@object-ui/layout 3.1.1 → 3.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
 
2
- > @object-ui/layout@3.1.1 build /home/runner/work/objectui/objectui/packages/layout
2
+ > @object-ui/layout@3.1.3 build /home/runner/work/objectui/objectui/packages/layout
3
3
  > vite build
4
4
 
5
5
  vite v7.3.1 building client environment for production...
@@ -9,8 +9,8 @@ rendering chunks...
9
9
  
10
10
  [vite:dts] Start generate declaration files...
11
11
  computing gzip size...
12
- dist/index.js 103.90 kB │ gzip: 27.41 kB
13
- [vite:dts] Declaration files built in 21900ms.
12
+ dist/index.js 103.89 kB │ gzip: 27.41 kB
13
+ [vite:dts] Declaration files built in 29205ms.
14
14
  
15
15
  No name was provided for external module "@object-ui/core" in "output.globals" – guessing "core".
16
16
  No name was provided for external module "react" in "output.globals" – guessing "React".
@@ -20,5 +20,5 @@ computing gzip size...
20
20
  No name was provided for external module "react-dom" in "output.globals" – guessing "reactDom".
21
21
  No name was provided for external module "@object-ui/types" in "output.globals" – guessing "types".
22
22
  No name was provided for external module "@object-ui/react" in "output.globals" – guessing "react".
23
- dist/index.umd.cjs 70.10 kB │ gzip: 23.15 kB
24
- ✓ built in 25.15s
23
+ dist/index.umd.cjs 70.08 kB │ gzip: 23.15 kB
24
+ ✓ built in 32.87s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @object-ui/layout
2
2
 
3
+ ## 3.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - @object-ui/types@3.1.3
8
+ - @object-ui/core@3.1.3
9
+ - @object-ui/react@3.1.3
10
+ - @object-ui/components@3.1.3
11
+
12
+ ## 3.1.2
13
+
14
+ ### Patch Changes
15
+
16
+ - @object-ui/types@3.1.2
17
+ - @object-ui/core@3.1.2
18
+ - @object-ui/react@3.1.2
19
+ - @object-ui/components@3.1.2
20
+
3
21
  ## 3.1.1
4
22
 
5
23
  ### Patch Changes
package/dist/index.js CHANGED
@@ -3431,7 +3431,7 @@ function Le({
3431
3431
  s && i && /* @__PURE__ */ l.jsx(
3432
3432
  on,
3433
3433
  {
3434
- showOnHover: !e.pinned,
3434
+ showOnHover: !0,
3435
3435
  onClick: () => i(e.id, !e.pinned),
3436
3436
  "aria-label": e.pinned ? `Unpin ${ge(e.label, u)}` : `Pin ${ge(e.label, u)}`,
3437
3437
  children: e.pinned ? /* @__PURE__ */ l.jsx(X.PinOff, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ l.jsx(X.Pin, { className: "h-3.5 w-3.5" })
@@ -3450,7 +3450,7 @@ function Le({
3450
3450
  s && i && /* @__PURE__ */ l.jsx(
3451
3451
  on,
3452
3452
  {
3453
- showOnHover: !e.pinned,
3453
+ showOnHover: !0,
3454
3454
  onClick: () => i(e.id, !e.pinned),
3455
3455
  "aria-label": e.pinned ? `Unpin ${w}` : `Pin ${w}`,
3456
3456
  children: e.pinned ? /* @__PURE__ */ l.jsx(X.PinOff, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ l.jsx(X.Pin, { className: "h-3.5 w-3.5" })
@@ -1,10 +1,10 @@
1
- (function(P,se){typeof exports=="object"&&typeof module<"u"?se(exports,require("@object-ui/core"),require("react"),require("@object-ui/components"),require("react-router-dom"),require("lucide-react"),require("react-dom"),require("@object-ui/types"),require("@object-ui/react")):typeof define=="function"&&define.amd?define(["exports","@object-ui/core","react","@object-ui/components","react-router-dom","lucide-react","react-dom","@object-ui/types","@object-ui/react"],se):(P=typeof globalThis<"u"?globalThis:P||self,se(P.ObjectUILayout={},P.core,P.React,P.components,P.reactRouterDom,P.LucideIcons,P.reactDom,P.types,P.react))})(this,(function(P,se,l,v,Ce,gt,_e,$n,zn){"use strict";function Bn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const V=Bn(gt);var et={exports:{}},$e={};var Ft;function Fn(){if(Ft)return $e;Ft=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var i=null;if(s!==void 0&&(i=""+s),o.key!==void 0&&(i=""+o.key),"key"in o){s={};for(var a in o)a!=="key"&&(s[a]=o[a])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:i,ref:o!==void 0?o:null,props:s}}return $e.Fragment=t,$e.jsx=n,$e.jsxs=n,$e}var ze={};var Yt;function Yn(){return Yt||(Yt=1,process.env.NODE_ENV!=="production"&&(function(){function e(f){if(f==null)return null;if(typeof f=="function")return f.$$typeof===T?null:f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case m:return"Fragment";case D:return"Profiler";case C:return"StrictMode";case I:return"Suspense";case y:return"SuspenseList";case _:return"Activity"}if(typeof f=="object")switch(typeof f.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),f.$$typeof){case x:return"Portal";case N:return f.displayName||"Context";case E:return(f._context.displayName||"Context")+".Consumer";case M:var w=f.render;return f=f.displayName,f||(f=w.displayName||w.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case j:return w=f.displayName||null,w!==null?w:e(f.type)||"Memo";case A:w=f._payload,f=f._init;try{return e(f(w))}catch{}}return null}function t(f){return""+f}function n(f){try{t(f);var w=!1}catch{w=!0}if(w){w=console;var O=w.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return O.call(w,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),t(f)}}function r(f){if(f===m)return"<>";if(typeof f=="object"&&f!==null&&f.$$typeof===A)return"<...>";try{var w=e(f);return w?"<"+w+">":"<...>"}catch{return"<...>"}}function o(){var f=Y.A;return f===null?null:f.getOwner()}function s(){return Error("react-stack-top-frame")}function i(f){if(z.call(f,"key")){var w=Object.getOwnPropertyDescriptor(f,"key").get;if(w&&w.isReactWarning)return!1}return f.key!==void 0}function a(f,w){function O(){le||(le=!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)",w))}O.isReactWarning=!0,Object.defineProperty(f,"key",{get:O,configurable:!0})}function u(){var f=e(this.type);return q[f]||(q[f]=!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.")),f=this.props.ref,f!==void 0?f:null}function d(f,w,O,R,ue,X){var $=O.ref;return f={$$typeof:S,type:f,key:w,props:O,_owner:R},($!==void 0?$:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:u}):Object.defineProperty(f,"ref",{enumerable:!1,value:null}),f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(f,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(f,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ue}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function g(f,w,O,R,ue,X){var $=w.children;if($!==void 0)if(R)if(W($)){for(R=0;R<$.length;R++)h($[R]);Object.freeze&&Object.freeze($)}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 h($);if(z.call(w,"key")){$=e(f);var J=Object.keys(w).filter(function(L){return L!=="key"});R=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",be[$+R]||(J=0<J.length?"{"+J.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(P,se){typeof exports=="object"&&typeof module<"u"?se(exports,require("@object-ui/core"),require("react"),require("@object-ui/components"),require("react-router-dom"),require("lucide-react"),require("react-dom"),require("@object-ui/types"),require("@object-ui/react")):typeof define=="function"&&define.amd?define(["exports","@object-ui/core","react","@object-ui/components","react-router-dom","lucide-react","react-dom","@object-ui/types","@object-ui/react"],se):(P=typeof globalThis<"u"?globalThis:P||self,se(P.ObjectUILayout={},P.core,P.React,P.components,P.reactRouterDom,P.LucideIcons,P.reactDom,P.types,P.react))})(this,(function(P,se,l,v,Ce,gt,_e,_r,$r){"use strict";function zr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const V=zr(gt);var et={exports:{}},$e={};var Ft;function Br(){if(Ft)return $e;Ft=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,o,s){var i=null;if(s!==void 0&&(i=""+s),o.key!==void 0&&(i=""+o.key),"key"in o){s={};for(var a in o)a!=="key"&&(s[a]=o[a])}else s=o;return o=s.ref,{$$typeof:e,type:n,key:i,ref:o!==void 0?o:null,props:s}}return $e.Fragment=t,$e.jsx=r,$e.jsxs=r,$e}var ze={};var Yt;function Fr(){return Yt||(Yt=1,process.env.NODE_ENV!=="production"&&(function(){function e(f){if(f==null)return null;if(typeof f=="function")return f.$$typeof===T?null:f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case m:return"Fragment";case D:return"Profiler";case C:return"StrictMode";case I:return"Suspense";case y:return"SuspenseList";case _:return"Activity"}if(typeof f=="object")switch(typeof f.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),f.$$typeof){case x:return"Portal";case N:return f.displayName||"Context";case E:return(f._context.displayName||"Context")+".Consumer";case M:var w=f.render;return f=f.displayName,f||(f=w.displayName||w.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case j:return w=f.displayName||null,w!==null?w:e(f.type)||"Memo";case A:w=f._payload,f=f._init;try{return e(f(w))}catch{}}return null}function t(f){return""+f}function r(f){try{t(f);var w=!1}catch{w=!0}if(w){w=console;var O=w.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return O.call(w,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),t(f)}}function n(f){if(f===m)return"<>";if(typeof f=="object"&&f!==null&&f.$$typeof===A)return"<...>";try{var w=e(f);return w?"<"+w+">":"<...>"}catch{return"<...>"}}function o(){var f=Y.A;return f===null?null:f.getOwner()}function s(){return Error("react-stack-top-frame")}function i(f){if(z.call(f,"key")){var w=Object.getOwnPropertyDescriptor(f,"key").get;if(w&&w.isReactWarning)return!1}return f.key!==void 0}function a(f,w){function O(){le||(le=!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)",w))}O.isReactWarning=!0,Object.defineProperty(f,"key",{get:O,configurable:!0})}function u(){var f=e(this.type);return q[f]||(q[f]=!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.")),f=this.props.ref,f!==void 0?f:null}function d(f,w,O,R,ue,X){var $=O.ref;return f={$$typeof:S,type:f,key:w,props:O,_owner:R},($!==void 0?$:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:u}):Object.defineProperty(f,"ref",{enumerable:!1,value:null}),f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(f,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(f,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ue}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function g(f,w,O,R,ue,X){var $=w.children;if($!==void 0)if(R)if(W($)){for(R=0;R<$.length;R++)h($[R]);Object.freeze&&Object.freeze($)}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 h($);if(z.call(w,"key")){$=e(f);var J=Object.keys(w).filter(function(L){return L!=="key"});R=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",be[$+R]||(J=0<J.length?"{"+J.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} />`,R,$,J,$),be[$+R]=!0)}if($=null,O!==void 0&&(n(O),$=""+O),i(w)&&(n(w.key),$=""+w.key),"key"in w){O={};for(var Q in w)Q!=="key"&&(O[Q]=w[Q])}else O=w;return $&&a(O,typeof f=="function"?f.displayName||f.name||"Unknown":f),d(f,$,O,o(),ue,X)}function h(f){b(f)?f._store&&(f._store.validated=1):typeof f=="object"&&f!==null&&f.$$typeof===A&&(f._payload.status==="fulfilled"?b(f._payload.value)&&f._payload.value._store&&(f._payload.value._store.validated=1):f._store&&(f._store.validated=1))}function b(f){return typeof f=="object"&&f!==null&&f.$$typeof===S}var p=l,S=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),N=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),T=Symbol.for("react.client.reference"),Y=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,W=Array.isArray,B=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(f){return f()}};var le,q={},je=p.react_stack_bottom_frame.bind(p,s)(),re=B(r(s)),be={};ze.Fragment=m,ze.jsx=function(f,w,O){var R=1e4>Y.recentlyCreatedOwnerStacks++;return g(f,w,O,!1,R?Error("react-stack-top-frame"):je,R?B(r(f)):re)},ze.jsxs=function(f,w,O){var R=1e4>Y.recentlyCreatedOwnerStacks++;return g(f,w,O,!0,R?Error("react-stack-top-frame"):je,R?B(r(f)):re)}})()),ze}var Gt;function Gn(){return Gt||(Gt=1,process.env.NODE_ENV==="production"?et.exports=Fn():et.exports=Yn()),et.exports}var c=Gn();function tt({title:e,description:t,action:n,className:r,children:o,...s}){return c.jsx("div",{className:v.cn("flex flex-col gap-4 pb-4 md:pb-8",r),...s,children:c.jsxs("div",{className:"flex items-center justify-between gap-4",children:[c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:e}),t&&c.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),(n||o)&&c.jsxs("div",{className:"flex items-center gap-2",children:[n,o]})]})})}function Vt(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!t)return null;const n=parseInt(t[1],16)/255,r=parseInt(t[2],16)/255,o=parseInt(t[3],16)/255,s=Math.max(n,r,o),i=Math.min(n,r,o);let a=0,u=0;const d=(s+i)/2;if(s!==i){const g=s-i;switch(u=d>.5?g/(2-s-i):g/(s+i),s){case n:a=((r-o)/g+(r<o?6:0))/6;break;case r:a=((o-n)/g+2)/6;break;case o:a=((n-r)/g+4)/6;break}}return`${Math.round(a*360)} ${Math.round(u*100)}% ${Math.round(d*100)}%`}function Ut(e,t){l.useEffect(()=>{const n=document.documentElement;if(e?.primaryColor){const r=Vt(e.primaryColor);r&&(n.style.setProperty("--brand-primary",e.primaryColor),n.style.setProperty("--brand-primary-hsl",r))}else n.style.removeProperty("--brand-primary"),n.style.removeProperty("--brand-primary-hsl");if(e?.accentColor){const r=Vt(e.accentColor);r&&(n.style.setProperty("--brand-accent",e.accentColor),n.style.setProperty("--brand-accent-hsl",r))}else n.style.removeProperty("--brand-accent"),n.style.removeProperty("--brand-accent-hsl");if(e?.favicon){const r=document.querySelector("#favicon")||document.querySelector('link[rel="icon"]');r&&(r.href=e.favicon)}return t&&(document.title=t),()=>{n.style.removeProperty("--brand-primary"),n.style.removeProperty("--brand-primary-hsl"),n.style.removeProperty("--brand-accent"),n.style.removeProperty("--brand-accent-hsl")}},[e?.primaryColor,e?.accentColor,e?.favicon,t])}function pt({sidebar:e,navbar:t,children:n,className:r,defaultOpen:o=!0,branding:s}){return Ut(s,s?.title),c.jsxs(v.SidebarProvider,{defaultOpen:o,children:[e,c.jsxs(v.SidebarInset,{children:[c.jsxs("header",{className:"flex h-14 sm:h-16 shrink-0 items-center gap-2 border-b bg-background px-2 sm:px-4",children:[c.jsx(v.SidebarTrigger,{className:"-ml-1 hidden md:inline-flex"}),c.jsx("div",{className:"w-px h-4 bg-border mx-1 sm:mx-2 hidden md:block"}),t]}),c.jsx("main",{className:v.cn("flex-1 min-w-0 overflow-auto p-3 sm:p-4 md:p-6",r),children:n})]})]})}function Wt({className:e,children:t,...n}){return c.jsx("div",{className:v.cn("rounded-xl border bg-card text-card-foreground shadow",e),...n,children:c.jsx("div",{className:"p-6",children:t})})}const Vn={xs:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},sm:{1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",6:"sm:grid-cols-6",12:"sm:grid-cols-12"},md:{1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",6:"md:grid-cols-6",12:"md:grid-cols-12"},lg:{1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",6:"lg:grid-cols-6",12:"lg:grid-cols-12"},xl:{1:"xl:grid-cols-1",2:"xl:grid-cols-2",3:"xl:grid-cols-3",4:"xl:grid-cols-4",6:"xl:grid-cols-6",12:"xl:grid-cols-12"},"2xl":{1:"2xl:grid-cols-1",2:"2xl:grid-cols-2",3:"2xl:grid-cols-3",4:"2xl:grid-cols-4",6:"2xl:grid-cols-6",12:"2xl:grid-cols-12"}};function Un(e){if(!e)return"grid-cols-1";const t=[];for(const[n,r]of Object.entries(e)){const o=Vn[n];if(o&&r){const i=Object.keys(o).map(Number).reduce((a,u)=>Math.abs(u-r)<Math.abs(a-r)?u:a);t.push(o[i])}}return t.join(" ")||"grid-cols-1"}const Wn={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},qt=({columns:e,gap:t=4,className:n,children:r})=>{const o=Un(e),s=typeof t=="number"?Wn[t]||`gap-${t}`:"";return c.jsx("div",{className:v.cn("grid",o,s,n),children:r})};function qn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const nt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ee(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function vt(e){return"nodeType"in e}function K(e){var t,n;return e?Ee(e)?e:vt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function bt(e){const{Document:t}=K(e);return e instanceof t}function Be(e){return Ee(e)?!1:e instanceof K(e).HTMLElement}function Xt(e){return e instanceof K(e).SVGElement}function Ne(e){return e?Ee(e)?e.document:vt(e)?bt(e)?e:Be(e)||Xt(e)?e.ownerDocument:document:document:document}const ce=nt?l.useLayoutEffect:l.useEffect;function xt(e){const t=l.useRef(e);return ce(()=>{t.current=e}),l.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 Xn(){const e=l.useRef(null),t=l.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=l.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Fe(e,t){t===void 0&&(t=[e]);const n=l.useRef(e);return ce(()=>{n.current!==e&&(n.current=e)},t),n}function Ye(e,t){const n=l.useRef();return l.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function rt(e){const t=xt(e),n=l.useRef(null),r=l.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function mt(e){const t=l.useRef();return l.useEffect(()=>{t.current=e},[e]),t.current}let yt={};function Ge(e,t){return l.useMemo(()=>{if(t)return t;const n=yt[e]==null?0:yt[e]+1;return yt[e]=n,e+"-"+n},[e,t])}function Ht(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,i)=>{const a=Object.entries(i);for(const[u,d]of a){const g=s[u];g!=null&&(s[u]=g+e*d)}return s},{...t})}}const De=Ht(1),ot=Ht(-1);function Hn(e){return"clientX"in e&&"clientY"in e}function wt(e){if(!e)return!1;const{KeyboardEvent:t}=K(e.target);return t&&e instanceof t}function Jn(e){if(!e)return!1;const{TouchEvent:t}=K(e.target);return t&&e instanceof t}function St(e){if(Jn(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 Hn(e)?{x:e.clientX,y:e.clientY}:null}const Ve=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[Ve.Translate.toString(e),Ve.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Jt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Kn(e){return e.matches(Jt)?e:e.querySelector(Jt)}const Qn={display:"none"};function Zn(e){let{id:t,value:n}=e;return l.createElement("div",{id:t,style:Qn},n)}function er(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 l.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function tr(){const[e,t]=l.useState("");return{announce:l.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Kt=l.createContext(null);function nr(e){const t=l.useContext(Kt);l.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function rr(){const[e]=l.useState(()=>new Set),t=l.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[l.useCallback(r=>{let{type:o,event:s}=r;e.forEach(i=>{var a;return(a=i[o])==null?void 0:a.call(i,s)})},[e]),t]}const or={draggable:`
6
+ <%s key={someKey} {...props} />`,R,$,J,$),be[$+R]=!0)}if($=null,O!==void 0&&(r(O),$=""+O),i(w)&&(r(w.key),$=""+w.key),"key"in w){O={};for(var Q in w)Q!=="key"&&(O[Q]=w[Q])}else O=w;return $&&a(O,typeof f=="function"?f.displayName||f.name||"Unknown":f),d(f,$,O,o(),ue,X)}function h(f){b(f)?f._store&&(f._store.validated=1):typeof f=="object"&&f!==null&&f.$$typeof===A&&(f._payload.status==="fulfilled"?b(f._payload.value)&&f._payload.value._store&&(f._payload.value._store.validated=1):f._store&&(f._store.validated=1))}function b(f){return typeof f=="object"&&f!==null&&f.$$typeof===S}var p=l,S=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),N=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),T=Symbol.for("react.client.reference"),Y=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,W=Array.isArray,B=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(f){return f()}};var le,q={},je=p.react_stack_bottom_frame.bind(p,s)(),ne=B(n(s)),be={};ze.Fragment=m,ze.jsx=function(f,w,O){var R=1e4>Y.recentlyCreatedOwnerStacks++;return g(f,w,O,!1,R?Error("react-stack-top-frame"):je,R?B(n(f)):ne)},ze.jsxs=function(f,w,O){var R=1e4>Y.recentlyCreatedOwnerStacks++;return g(f,w,O,!0,R?Error("react-stack-top-frame"):je,R?B(n(f)):ne)}})()),ze}var Gt;function Yr(){return Gt||(Gt=1,process.env.NODE_ENV==="production"?et.exports=Br():et.exports=Fr()),et.exports}var c=Yr();function tt({title:e,description:t,action:r,className:n,children:o,...s}){return c.jsx("div",{className:v.cn("flex flex-col gap-4 pb-4 md:pb-8",n),...s,children:c.jsxs("div",{className:"flex items-center justify-between gap-4",children:[c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:e}),t&&c.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),(r||o)&&c.jsxs("div",{className:"flex items-center gap-2",children:[r,o]})]})})}function Vt(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!t)return null;const r=parseInt(t[1],16)/255,n=parseInt(t[2],16)/255,o=parseInt(t[3],16)/255,s=Math.max(r,n,o),i=Math.min(r,n,o);let a=0,u=0;const d=(s+i)/2;if(s!==i){const g=s-i;switch(u=d>.5?g/(2-s-i):g/(s+i),s){case r:a=((n-o)/g+(n<o?6:0))/6;break;case n:a=((o-r)/g+2)/6;break;case o:a=((r-n)/g+4)/6;break}}return`${Math.round(a*360)} ${Math.round(u*100)}% ${Math.round(d*100)}%`}function Ut(e,t){l.useEffect(()=>{const r=document.documentElement;if(e?.primaryColor){const n=Vt(e.primaryColor);n&&(r.style.setProperty("--brand-primary",e.primaryColor),r.style.setProperty("--brand-primary-hsl",n))}else r.style.removeProperty("--brand-primary"),r.style.removeProperty("--brand-primary-hsl");if(e?.accentColor){const n=Vt(e.accentColor);n&&(r.style.setProperty("--brand-accent",e.accentColor),r.style.setProperty("--brand-accent-hsl",n))}else r.style.removeProperty("--brand-accent"),r.style.removeProperty("--brand-accent-hsl");if(e?.favicon){const n=document.querySelector("#favicon")||document.querySelector('link[rel="icon"]');n&&(n.href=e.favicon)}return t&&(document.title=t),()=>{r.style.removeProperty("--brand-primary"),r.style.removeProperty("--brand-primary-hsl"),r.style.removeProperty("--brand-accent"),r.style.removeProperty("--brand-accent-hsl")}},[e?.primaryColor,e?.accentColor,e?.favicon,t])}function pt({sidebar:e,navbar:t,children:r,className:n,defaultOpen:o=!0,branding:s}){return Ut(s,s?.title),c.jsxs(v.SidebarProvider,{defaultOpen:o,children:[e,c.jsxs(v.SidebarInset,{children:[c.jsxs("header",{className:"flex h-14 sm:h-16 shrink-0 items-center gap-2 border-b bg-background px-2 sm:px-4",children:[c.jsx(v.SidebarTrigger,{className:"-ml-1 hidden md:inline-flex"}),c.jsx("div",{className:"w-px h-4 bg-border mx-1 sm:mx-2 hidden md:block"}),t]}),c.jsx("main",{className:v.cn("flex-1 min-w-0 overflow-auto p-3 sm:p-4 md:p-6",n),children:r})]})]})}function Wt({className:e,children:t,...r}){return c.jsx("div",{className:v.cn("rounded-xl border bg-card text-card-foreground shadow",e),...r,children:c.jsx("div",{className:"p-6",children:t})})}const Gr={xs:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},sm:{1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",6:"sm:grid-cols-6",12:"sm:grid-cols-12"},md:{1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",6:"md:grid-cols-6",12:"md:grid-cols-12"},lg:{1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",6:"lg:grid-cols-6",12:"lg:grid-cols-12"},xl:{1:"xl:grid-cols-1",2:"xl:grid-cols-2",3:"xl:grid-cols-3",4:"xl:grid-cols-4",6:"xl:grid-cols-6",12:"xl:grid-cols-12"},"2xl":{1:"2xl:grid-cols-1",2:"2xl:grid-cols-2",3:"2xl:grid-cols-3",4:"2xl:grid-cols-4",6:"2xl:grid-cols-6",12:"2xl:grid-cols-12"}};function Vr(e){if(!e)return"grid-cols-1";const t=[];for(const[r,n]of Object.entries(e)){const o=Gr[r];if(o&&n){const i=Object.keys(o).map(Number).reduce((a,u)=>Math.abs(u-n)<Math.abs(a-n)?u:a);t.push(o[i])}}return t.join(" ")||"grid-cols-1"}const Ur={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},qt=({columns:e,gap:t=4,className:r,children:n})=>{const o=Vr(e),s=typeof t=="number"?Ur[t]||`gap-${t}`:"";return c.jsx("div",{className:v.cn("grid",o,s,r),children:n})};function Wr(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return l.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const rt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ee(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function vt(e){return"nodeType"in e}function K(e){var t,r;return e?Ee(e)?e:vt(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function bt(e){const{Document:t}=K(e);return e instanceof t}function Be(e){return Ee(e)?!1:e instanceof K(e).HTMLElement}function Xt(e){return e instanceof K(e).SVGElement}function Ne(e){return e?Ee(e)?e.document:vt(e)?bt(e)?e:Be(e)||Xt(e)?e.ownerDocument:document:document:document}const ce=rt?l.useLayoutEffect:l.useEffect;function xt(e){const t=l.useRef(e);return ce(()=>{t.current=e}),l.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function qr(){const e=l.useRef(null),t=l.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=l.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function Fe(e,t){t===void 0&&(t=[e]);const r=l.useRef(e);return ce(()=>{r.current!==e&&(r.current=e)},t),r}function Ye(e,t){const r=l.useRef();return l.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function nt(e){const t=xt(e),r=l.useRef(null),n=l.useCallback(o=>{o!==r.current&&t?.(o,r.current),r.current=o},[]);return[r,n]}function mt(e){const t=l.useRef();return l.useEffect(()=>{t.current=e},[e]),t.current}let yt={};function Ge(e,t){return l.useMemo(()=>{if(t)return t;const r=yt[e]==null?0:yt[e]+1;return yt[e]=r,e+"-"+r},[e,t])}function Ht(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((s,i)=>{const a=Object.entries(i);for(const[u,d]of a){const g=s[u];g!=null&&(s[u]=g+e*d)}return s},{...t})}}const De=Ht(1),ot=Ht(-1);function Xr(e){return"clientX"in e&&"clientY"in e}function wt(e){if(!e)return!1;const{KeyboardEvent:t}=K(e.target);return t&&e instanceof t}function Hr(e){if(!e)return!1;const{TouchEvent:t}=K(e.target);return t&&e instanceof t}function St(e){if(Hr(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return Xr(e)?{x:e.clientX,y:e.clientY}:null}const Ve=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Ve.Translate.toString(e),Ve.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Jt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Jr(e){return e.matches(Jt)?e:e.querySelector(Jt)}const Kr={display:"none"};function Qr(e){let{id:t,value:r}=e;return l.createElement("div",{id:t,style:Kr},r)}function Zr(e){let{id:t,announcement:r,ariaLiveType:n="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 l.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function en(){const[e,t]=l.useState("");return{announce:l.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const Kt=l.createContext(null);function tn(e){const t=l.useContext(Kt);l.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function rn(){const[e]=l.useState(()=>new Set),t=l.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[l.useCallback(n=>{let{type:o,event:s}=n;e.forEach(i=>{var a;return(a=i[o])==null?void 0:a.call(i,s)})},[e]),t]}const nn={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
- `},sr={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 ir(e){let{announcements:t=sr,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=or}=e;const{announce:s,announcement:i}=tr(),a=Ge("DndLiveRegion"),[u,d]=l.useState(!1);if(l.useEffect(()=>{d(!0)},[]),nr(l.useMemo(()=>({onDragStart(h){let{active:b}=h;s(t.onDragStart({active:b}))},onDragMove(h){let{active:b,over:p}=h;t.onDragMove&&s(t.onDragMove({active:b,over:p}))},onDragOver(h){let{active:b,over:p}=h;s(t.onDragOver({active:b,over:p}))},onDragEnd(h){let{active:b,over:p}=h;s(t.onDragEnd({active:b,over:p}))},onDragCancel(h){let{active:b,over:p}=h;s(t.onDragCancel({active:b,over:p}))}}),[s,t])),!u)return null;const g=l.createElement(l.Fragment,null,l.createElement(Zn,{id:r,value:o.draggable}),l.createElement(er,{id:a,announcement:i}));return n?_e.createPortal(g,n):g}var F;(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"})(F||(F={}));function st(){}function Qt(e,t){return l.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function ar(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const ie=Object.freeze({x:0,y:0});function lr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function cr(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function ur(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function dr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Zt(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 fr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Zt(t,t.left,t.top),s=[];for(const i of r){const{id:a}=i,u=n.get(a);if(u){const d=lr(Zt(u),o);s.push({id:a,data:{droppableContainer:i,value:d}})}}return s.sort(cr)};function hr(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),i=o-r,a=s-n;if(r<o&&n<s){const u=t.width*t.height,d=e.width*e.height,g=i*a,h=g/(u+d-g);return Number(h.toFixed(4))}return 0}const gr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:i}=s,a=n.get(i);if(a){const u=hr(a,t);u>0&&o.push({id:i,data:{droppableContainer:s,value:u}})}}return o.sort(ur)};function pr(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function en(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ie}function vr(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((i,a)=>({...i,top:i.top+e*a.y,bottom:i.bottom+e*a.y,left:i.left+e*a.x,right:i.right+e*a.x}),{...n})}}const br=vr(1);function xr(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 mr(e,t,n){const r=xr(t);if(!r)return e;const{scaleX:o,scaleY:s,x:i,y:a}=r,u=e.left-i-(1-o)*parseFloat(n),d=e.top-a-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),g=o?e.width/o:e.width,h=s?e.height/s:e.height;return{width:g,height:h,top:d,right:u+g,bottom:d+h,left:u}}const yr={ignoreTransform:!1};function Ae(e,t){t===void 0&&(t=yr);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:g}=K(e).getComputedStyle(e);d&&(n=mr(n,d,g))}const{top:r,left:o,width:s,height:i,bottom:a,right:u}=n;return{top:r,left:o,width:s,height:i,bottom:a,right:u}}function tn(e){return Ae(e,{ignoreTransform:!0})}function wr(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Sr(e,t){return t===void 0&&(t=K(e).getComputedStyle(e)),t.position==="fixed"}function Cr(e,t){t===void 0&&(t=K(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function Ct(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(bt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Be(o)||Xt(o)||n.includes(o))return n;const s=K(e).getComputedStyle(o);return o!==e&&Cr(o,s)&&n.push(o),Sr(o,s)?n:r(o.parentNode)}return e?r(e):n}function nn(e){const[t]=Ct(e,1);return t??null}function jt(e){return!nt||!e?null:Ee(e)?e:vt(e)?bt(e)||e===Ne(e).scrollingElement?window:Be(e)?e:null:null}function rn(e){return Ee(e)?e.scrollX:e.scrollLeft}function on(e){return Ee(e)?e.scrollY:e.scrollTop}function Et(e){return{x:rn(e),y:on(e)}}var G;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(G||(G={}));function sn(e){return!nt||!e?!1:e===document.scrollingElement}function an(e){const t={x:0,y:0},n=sn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,i=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:i,isRight:a,maxScroll:r,minScroll:t}}const jr={x:.2,y:.2};function Er(e,t,n,r,o){let{top:s,left:i,right:a,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=jr);const{isTop:d,isBottom:g,isLeft:h,isRight:b}=an(e),p={x:0,y:0},S={x:0,y:0},x={height:t.height*o.y,width:t.width*o.x};return!d&&s<=t.top+x.height?(p.y=G.Backward,S.y=r*Math.abs((t.top+x.height-s)/x.height)):!g&&u>=t.bottom-x.height&&(p.y=G.Forward,S.y=r*Math.abs((t.bottom-x.height-u)/x.height)),!b&&a>=t.right-x.width?(p.x=G.Forward,S.x=r*Math.abs((t.right-x.width-a)/x.width)):!h&&i<=t.left+x.width&&(p.x=G.Backward,S.x=r*Math.abs((t.left+x.width-i)/x.width)),{direction:p,speed:S}}function Nr(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:i}=window;return{top:0,left:0,right:s,bottom:i,width:s,height:i}}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 ln(e){return e.reduce((t,n)=>De(t,Et(n)),ie)}function Dr(e){return e.reduce((t,n)=>t+rn(n),0)}function Ar(e){return e.reduce((t,n)=>t+on(n),0)}function Ir(e,t){if(t===void 0&&(t=Ae),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);nn(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Mr=[["x",["left","right"],Dr],["y",["top","bottom"],Ar]];class Nt{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=Ct(n),o=ln(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,i,a]of Mr)for(const u of i)Object.defineProperty(this,u,{get:()=>{const d=a(r),g=o[s]-d;return this.rect[u]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ue{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 Tr(e){const{EventTarget:t}=K(e);return e instanceof t?e:Ne(e)}function Dt(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 ne;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(ne||(ne={}));function cn(e){e.preventDefault()}function Or(e){e.stopPropagation()}var k;(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"})(k||(k={}));const un={start:[k.Space,k.Enter],cancel:[k.Esc],end:[k.Space,k.Enter,k.Tab]},kr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case k.Right:return{...n,x:n.x+25};case k.Left:return{...n,x:n.x-25};case k.Down:return{...n,y:n.y+25};case k.Up:return{...n,y:n.y-25}}};class At{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 Ue(Ne(n)),this.windowListeners=new Ue(K(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ne.Resize,this.handleCancel),this.windowListeners.add(ne.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ne.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Ir(r),n(ie)}handleKeyDown(t){if(wt(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=un,coordinateGetter:i=kr,scrollBehavior:a="smooth"}=o,{code:u}=t;if(s.end.includes(u)){this.handleEnd(t);return}if(s.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:d}=r.current,g=d?{x:d.left,y:d.top}:ie;this.referenceCoordinates||(this.referenceCoordinates=g);const h=i(t,{active:n,context:r.current,currentCoordinates:g});if(h){const b=ot(h,g),p={x:0,y:0},{scrollableAncestors:S}=r.current;for(const x of S){const m=t.code,{isTop:C,isRight:D,isLeft:E,isBottom:N,maxScroll:M,minScroll:I}=an(x),y=Nr(x),j={x:Math.min(m===k.Right?y.right-y.width/2:y.right,Math.max(m===k.Right?y.left:y.left+y.width/2,h.x)),y:Math.min(m===k.Down?y.bottom-y.height/2:y.bottom,Math.max(m===k.Down?y.top:y.top+y.height/2,h.y))},A=m===k.Right&&!D||m===k.Left&&!E,_=m===k.Down&&!N||m===k.Up&&!C;if(A&&j.x!==h.x){const T=x.scrollLeft+b.x,Y=m===k.Right&&T<=M.x||m===k.Left&&T>=I.x;if(Y&&!b.y){x.scrollTo({left:T,behavior:a});return}Y?p.x=x.scrollLeft-T:p.x=m===k.Right?x.scrollLeft-M.x:x.scrollLeft-I.x,p.x&&x.scrollBy({left:-p.x,behavior:a});break}else if(_&&j.y!==h.y){const T=x.scrollTop+b.y,Y=m===k.Down&&T<=M.y||m===k.Up&&T>=I.y;if(Y&&!b.x){x.scrollTo({top:T,behavior:a});return}Y?p.y=x.scrollTop-T:p.y=m===k.Down?x.scrollTop-M.y:x.scrollTop-I.y,p.y&&x.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,De(ot(h,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()}}At.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=un,onActivation:o}=t,{active:s}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const a=s.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function dn(e){return!!(e&&"distance"in e)}function fn(e){return!!(e&&"delay"in e)}class It{constructor(t,n,r){var o;r===void 0&&(r=Tr(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:i}=s;this.props=t,this.events=n,this.document=Ne(i),this.documentListeners=new Ue(this.document),this.listeners=new Ue(r),this.windowListeners=new Ue(K(i)),this.initialCoordinates=(o=St(s))!=null?o:ie,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(ne.Resize,this.handleCancel),this.windowListeners.add(ne.DragStart,cn),this.windowListeners.add(ne.VisibilityChange,this.handleCancel),this.windowListeners.add(ne.ContextMenu,cn),this.documentListeners.add(ne.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(fn(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(dn(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(ne.Click,Or,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ne.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:i,options:{activationConstraint:a}}=s;if(!o)return;const u=(n=St(t))!=null?n:ie,d=ot(o,u);if(!r&&a){if(dn(a)){if(a.tolerance!=null&&Dt(d,a.tolerance))return this.handleCancel();if(Dt(d,a.distance))return this.handleStart()}if(fn(a)&&Dt(d,a.tolerance))return this.handleCancel();this.handlePending(a,d);return}t.cancelable&&t.preventDefault(),i(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===k.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Lr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Mt extends It{constructor(t){const{event:n}=t,r=Ne(n.target);super(t,Lr,r)}}Mt.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 Rr={move:{name:"mousemove"},end:{name:"mouseup"}};var Tt;(function(e){e[e.RightClick=2]="RightClick"})(Tt||(Tt={}));class Pr extends It{constructor(t){super(t,Rr,Ne(t.event.target))}}Pr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Tt.RightClick?!1:(r?.({event:n}),!0)}}];const Ot={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class _r extends It{constructor(t){super(t,Ot)}static setup(){return window.addEventListener(Ot.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ot.move.name,t)};function t(){}}}_r.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 We;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(We||(We={}));var it;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(it||(it={}));function $r(e){let{acceleration:t,activator:n=We.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:i=5,order:a=it.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:g,delta:h,threshold:b}=e;const p=Br({delta:h,disabled:!s}),[S,x]=Xn(),m=l.useRef({x:0,y:0}),C=l.useRef({x:0,y:0}),D=l.useMemo(()=>{switch(n){case We.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case We.DraggableRect:return o}},[n,o,u]),E=l.useRef(null),N=l.useCallback(()=>{const I=E.current;if(!I)return;const y=m.current.x*C.current.x,j=m.current.y*C.current.y;I.scrollBy(y,j)},[]),M=l.useMemo(()=>a===it.TreeOrder?[...d].reverse():d,[a,d]);l.useEffect(()=>{if(!s||!d.length||!D){x();return}for(const I of M){if(r?.(I)===!1)continue;const y=d.indexOf(I),j=g[y];if(!j)continue;const{direction:A,speed:_}=Er(I,j,D,t,b);for(const T of["x","y"])p[T][A[T]]||(_[T]=0,A[T]=0);if(_.x>0||_.y>0){x(),E.current=I,S(N,i),m.current=_,C.current=A;return}}m.current={x:0,y:0},C.current={x:0,y:0},x()},[t,N,r,x,s,i,JSON.stringify(D),JSON.stringify(p),S,d,M,g,JSON.stringify(b)])}const zr={x:{[G.Backward]:!1,[G.Forward]:!1},y:{[G.Backward]:!1,[G.Forward]:!1}};function Br(e){let{delta:t,disabled:n}=e;const r=mt(t);return Ye(o=>{if(n||!r||!o)return zr;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[G.Backward]:o.x[G.Backward]||s.x===-1,[G.Forward]:o.x[G.Forward]||s.x===1},y:{[G.Backward]:o.y[G.Backward]||s.y===-1,[G.Forward]:o.y[G.Forward]||s.y===1}}},[n,t,r])}function Fr(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Ye(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function Yr(e,t){return l.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,r)}));return[...n,...s]},[]),[e,t])}var qe;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(qe||(qe={}));var kt;(function(e){e.Optimized="optimized"})(kt||(kt={}));const hn=new Map;function Gr(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,i]=l.useState(null),{frequency:a,measure:u,strategy:d}=o,g=l.useRef(e),h=m(),b=Fe(h),p=l.useCallback(function(C){C===void 0&&(C=[]),!b.current&&i(D=>D===null?C:D.concat(C.filter(E=>!D.includes(E))))},[b]),S=l.useRef(null),x=Ye(C=>{if(h&&!n)return hn;if(!C||C===hn||g.current!==e||s!=null){const D=new Map;for(let E of e){if(!E)continue;if(s&&s.length>0&&!s.includes(E.id)&&E.rect.current){D.set(E.id,E.rect.current);continue}const N=E.node.current,M=N?new Nt(u(N),N):null;E.rect.current=M,M&&D.set(E.id,M)}return D}return C},[e,s,n,h,u]);return l.useEffect(()=>{g.current=e},[e]),l.useEffect(()=>{h||p()},[n,h]),l.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),l.useEffect(()=>{h||typeof a!="number"||S.current!==null||(S.current=setTimeout(()=>{p(),S.current=null},a))},[a,h,p,...r]),{droppableRects:x,measureDroppableContainers:p,measuringScheduled:s!=null};function m(){switch(d){case qe.Always:return!1;case qe.BeforeDragging:return n;default:return!n}}}function gn(e,t){return Ye(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Vr(e,t){return gn(e,t)}function Ur(e){let{callback:t,disabled:n}=e;const r=xt(t),o=l.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return l.useEffect(()=>()=>o?.disconnect(),[o]),o}function at(e){let{callback:t,disabled:n}=e;const r=xt(t),o=l.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return l.useEffect(()=>()=>o?.disconnect(),[o]),o}function Wr(e){return new Nt(Ae(e),e)}function pn(e,t,n){t===void 0&&(t=Wr);const[r,o]=l.useState(null);function s(){o(u=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=u??n)!=null?d:null}const g=t(e);return JSON.stringify(u)===JSON.stringify(g)?u:g})}const i=Ur({callback(u){if(e)for(const d of u){const{type:g,target:h}=d;if(g==="childList"&&h instanceof HTMLElement&&h.contains(e)){s();break}}}}),a=at({callback:s});return ce(()=>{s(),e?(a?.observe(e),i?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),i?.disconnect())},[e]),r}function qr(e){const t=gn(e);return en(e,t)}const vn=[];function Xr(e){const t=l.useRef(e),n=Ye(r=>e?r&&r!==vn&&e&&t.current&&e.parentNode===t.current.parentNode?r:Ct(e):vn,[e]);return l.useEffect(()=>{t.current=e},[e]),n}function Hr(e){const[t,n]=l.useState(null),r=l.useRef(e),o=l.useCallback(s=>{const i=jt(s.target);i&&n(a=>a?(a.set(i,Et(i)),new Map(a)):null)},[]);return l.useEffect(()=>{const s=r.current;if(e!==s){i(s);const a=e.map(u=>{const d=jt(u);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Et(d)]):null}).filter(u=>u!=null);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(s)};function i(a){a.forEach(u=>{const d=jt(u);d?.removeEventListener("scroll",o)})}},[o,e]),l.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,i)=>De(s,i),ie):ln(e):ie,[e,t])}function bn(e,t){t===void 0&&(t=[]);const n=l.useRef(null);return l.useEffect(()=>{n.current=null},t),l.useEffect(()=>{const r=e!==ie;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?ot(e,n.current):ie}function Jr(e){l.useEffect(()=>{if(!nt)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 Kr(e,t){return l.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=i=>{s(i,t)},n},{}),[e,t])}function xn(e){return l.useMemo(()=>e?wr(e):null,[e])}const mn=[];function Qr(e,t){t===void 0&&(t=Ae);const[n]=e,r=xn(n?K(n):null),[o,s]=l.useState(mn);function i(){s(()=>e.length?e.map(u=>sn(u)?r:new Nt(t(u),u)):mn)}const a=at({callback:i});return ce(()=>{a?.disconnect(),i(),e.forEach(u=>a?.observe(u))},[e]),o}function Zr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Be(t)?t:e}function eo(e){let{measure:t}=e;const[n,r]=l.useState(null),o=l.useCallback(d=>{for(const{target:g}of d)if(Be(g)){r(h=>{const b=t(g);return h?{...h,width:b.width,height:b.height}:b});break}},[t]),s=at({callback:o}),i=l.useCallback(d=>{const g=Zr(d);s?.disconnect(),g&&s?.observe(g),r(g?t(g):null)},[t,s]),[a,u]=rt(i);return l.useMemo(()=>({nodeRef:a,rect:n,setRef:u}),[n,a,u])}const to=[{sensor:Mt,options:{}},{sensor:At,options:{}}],no={current:{}},lt={draggable:{measure:tn},droppable:{measure:tn,strategy:qe.WhileDragging,frequency:kt.Optimized},dragOverlay:{measure:Ae}};class Xe extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const ro={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Xe,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:st},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:lt,measureDroppableContainers:st,windowRect:null,measuringScheduled:!1},oo={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:st,draggableNodes:new Map,over:null,measureDroppableContainers:st},ct=l.createContext(oo),yn=l.createContext(ro);function so(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Xe}}}function io(e,t){switch(t.type){case F.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case F.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 F.DragEnd:case F.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case F.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Xe(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case F.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new Xe(e.droppable.containers);return i.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case F.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new Xe(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function ao(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=l.useContext(ct),s=mt(r),i=mt(n?.id);return l.useEffect(()=>{if(!t&&!r&&s&&i!=null){if(!wt(s)||document.activeElement===s.target)return;const a=o.get(i);if(!a)return;const{activatorNode:u,node:d}=a;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const g of[u.current,d.current]){if(!g)continue;const h=Kn(g);if(h){h.focus();break}}})}},[r,t,o,i,s]),null}function lo(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function co(e){return l.useMemo(()=>({draggable:{...lt.draggable,...e?.draggable},droppable:{...lt.droppable,...e?.droppable},dragOverlay:{...lt.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function uo(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=l.useRef(!1),{x:i,y:a}=typeof o=="boolean"?{x:o,y:o}:o;ce(()=>{if(!i&&!a||!t){s.current=!1;return}if(s.current||!r)return;const d=t?.node.current;if(!d||d.isConnected===!1)return;const g=n(d),h=en(g,r);if(i||(h.x=0),a||(h.y=0),s.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const b=nn(d);b&&b.scrollBy({top:h.y,left:h.x})}},[t,i,a,r,n])}const wn=l.createContext({...ie,scaleX:1,scaleY:1});var ve;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ve||(ve={}));const fo=l.memo(function(t){var n,r,o,s;let{id:i,accessibility:a,autoScroll:u=!0,children:d,sensors:g=to,collisionDetection:h=gr,measuring:b,modifiers:p,...S}=t;const x=l.useReducer(io,void 0,so),[m,C]=x,[D,E]=rr(),[N,M]=l.useState(ve.Uninitialized),I=N===ve.Initialized,{draggable:{active:y,nodes:j,translate:A},droppable:{containers:_}}=m,T=y!=null?j.get(y):null,Y=l.useRef({initial:null,translated:null}),z=l.useMemo(()=>{var H;return y!=null?{id:y,data:(H=T?.data)!=null?H:no,rect:Y}:null},[y,T]),W=l.useRef(null),[B,le]=l.useState(null),[q,je]=l.useState(null),re=Fe(S,Object.values(S)),be=Ge("DndDescribedBy",i),f=l.useMemo(()=>_.getEnabled(),[_]),w=co(b),{droppableRects:O,measureDroppableContainers:R,measuringScheduled:ue}=Gr(f,{dragging:I,dependencies:[A.x,A.y],config:w.droppable}),X=Fr(j,y),$=l.useMemo(()=>q?St(q):null,[q]),J=ts(),Q=Vr(X,w.draggable.measure);uo({activeNode:y!=null?j.get(y):null,config:J.layoutShiftCompensation,initialRect:Q,measure:w.draggable.measure});const L=pn(X,w.draggable.measure,Q),He=pn(X?X.parentElement:null),de=l.useRef({activatorEvent:null,active:null,activeNode:X,collisionRect:null,collisions:null,droppableRects:O,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:_,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Te=_.getNodeFor((n=de.current.over)==null?void 0:n.id),ge=eo({measure:w.dragOverlay.measure}),Oe=(r=ge.nodeRef.current)!=null?r:X,ke=I?(o=ge.rect)!=null?o:L:null,Mn=!!(ge.nodeRef.current&&ge.rect),Tn=qr(Mn?null:L),$t=xn(Oe?K(Oe):null),xe=Xr(I?Te??X:null),ft=Qr(xe),ht=lo(p,{transform:{x:A.x-Tn.x,y:A.y-Tn.y,scaleX:1,scaleY:1},activatorEvent:q,active:z,activeNodeRect:L,containerNodeRect:He,draggingNodeRect:ke,over:de.current.over,overlayNodeRect:ge.rect,scrollableAncestors:xe,scrollableAncestorRects:ft,windowRect:$t}),On=$?De($,A):null,kn=Hr(xe),Xo=bn(kn),Ho=bn(kn,[L]),Le=De(ht,Xo),Re=ke?br(ke,ht):null,Je=z&&Re?h({active:z,collisionRect:Re,droppableRects:O,droppableContainers:f,pointerCoordinates:On}):null,Ln=dr(Je,"id"),[me,Rn]=l.useState(null),Jo=Mn?ht:De(ht,Ho),Ko=pr(Jo,(s=me?.rect)!=null?s:null,L),zt=l.useRef(null),Pn=l.useCallback((H,Z)=>{let{sensor:ee,options:ye}=Z;if(W.current==null)return;const oe=j.get(W.current);if(!oe)return;const te=H.nativeEvent,fe=new ee({active:W.current,activeNode:oe,event:te,options:ye,context:de,onAbort(U){if(!j.get(U))return;const{onDragAbort:he}=re.current,pe={id:U};he?.(pe),D({type:"onDragAbort",event:pe})},onPending(U,we,he,pe){if(!j.get(U))return;const{onDragPending:Qe}=re.current,Se={id:U,constraint:we,initialCoordinates:he,offset:pe};Qe?.(Se),D({type:"onDragPending",event:Se})},onStart(U){const we=W.current;if(we==null)return;const he=j.get(we);if(!he)return;const{onDragStart:pe}=re.current,Ke={activatorEvent:te,active:{id:we,data:he.data,rect:Y}};_e.unstable_batchedUpdates(()=>{pe?.(Ke),M(ve.Initializing),C({type:F.DragStart,initialCoordinates:U,active:we}),D({type:"onDragStart",event:Ke}),le(zt.current),je(te)})},onMove(U){C({type:F.DragMove,coordinates:U})},onEnd:Pe(F.DragEnd),onCancel:Pe(F.DragCancel)});zt.current=fe;function Pe(U){return async function(){const{active:he,collisions:pe,over:Ke,scrollAdjustedTranslate:Qe}=de.current;let Se=null;if(he&&Qe){const{cancelDrop:Ze}=re.current;Se={activatorEvent:te,active:he,collisions:pe,delta:Qe,over:Ke},U===F.DragEnd&&typeof Ze=="function"&&await Promise.resolve(Ze(Se))&&(U=F.DragCancel)}W.current=null,_e.unstable_batchedUpdates(()=>{C({type:U}),M(ve.Uninitialized),Rn(null),le(null),je(null),zt.current=null;const Ze=U===F.DragEnd?"onDragEnd":"onDragCancel";if(Se){const Bt=re.current[Ze];Bt?.(Se),D({type:Ze,event:Se})}})}}},[j]),Qo=l.useCallback((H,Z)=>(ee,ye)=>{const oe=ee.nativeEvent,te=j.get(ye);if(W.current!==null||!te||oe.dndKit||oe.defaultPrevented)return;const fe={active:te};H(ee,Z.options,fe)===!0&&(oe.dndKit={capturedBy:Z.sensor},W.current=ye,Pn(ee,Z))},[j,Pn]),_n=Yr(g,Qo);Jr(g),ce(()=>{L&&N===ve.Initializing&&M(ve.Initialized)},[L,N]),l.useEffect(()=>{const{onDragMove:H}=re.current,{active:Z,activatorEvent:ee,collisions:ye,over:oe}=de.current;if(!Z||!ee)return;const te={active:Z,activatorEvent:ee,collisions:ye,delta:{x:Le.x,y:Le.y},over:oe};_e.unstable_batchedUpdates(()=>{H?.(te),D({type:"onDragMove",event:te})})},[Le.x,Le.y]),l.useEffect(()=>{const{active:H,activatorEvent:Z,collisions:ee,droppableContainers:ye,scrollAdjustedTranslate:oe}=de.current;if(!H||W.current==null||!Z||!oe)return;const{onDragOver:te}=re.current,fe=ye.get(Ln),Pe=fe&&fe.rect.current?{id:fe.id,rect:fe.rect.current,data:fe.data,disabled:fe.disabled}:null,U={active:H,activatorEvent:Z,collisions:ee,delta:{x:oe.x,y:oe.y},over:Pe};_e.unstable_batchedUpdates(()=>{Rn(Pe),te?.(U),D({type:"onDragOver",event:U})})},[Ln]),ce(()=>{de.current={activatorEvent:q,active:z,activeNode:X,collisionRect:Re,collisions:Je,droppableRects:O,draggableNodes:j,draggingNode:Oe,draggingNodeRect:ke,droppableContainers:_,over:me,scrollableAncestors:xe,scrollAdjustedTranslate:Le},Y.current={initial:ke,translated:Re}},[z,X,Je,Re,j,Oe,ke,O,_,me,xe,Le]),$r({...J,delta:A,draggingRect:Re,pointerCoordinates:On,scrollableAncestors:xe,scrollableAncestorRects:ft});const Zo=l.useMemo(()=>({active:z,activeNode:X,activeNodeRect:L,activatorEvent:q,collisions:Je,containerNodeRect:He,dragOverlay:ge,draggableNodes:j,droppableContainers:_,droppableRects:O,over:me,measureDroppableContainers:R,scrollableAncestors:xe,scrollableAncestorRects:ft,measuringConfiguration:w,measuringScheduled:ue,windowRect:$t}),[z,X,L,q,Je,He,ge,j,_,O,me,R,xe,ft,w,ue,$t]),es=l.useMemo(()=>({activatorEvent:q,activators:_n,active:z,activeNodeRect:L,ariaDescribedById:{draggable:be},dispatch:C,draggableNodes:j,over:me,measureDroppableContainers:R}),[q,_n,z,L,C,be,j,me,R]);return l.createElement(Kt.Provider,{value:E},l.createElement(ct.Provider,{value:es},l.createElement(yn.Provider,{value:Zo},l.createElement(wn.Provider,{value:Ko},d)),l.createElement(ao,{disabled:a?.restoreFocus===!1})),l.createElement(ir,{...a,hiddenTextDescribedById:be}));function ts(){const H=B?.autoScrollEnabled===!1,Z=typeof u=="object"?u.enabled===!1:u===!1,ee=I&&!H&&!Z;return typeof u=="object"?{...u,enabled:ee}:{enabled:ee}}}),ho=l.createContext(null),Sn="button",go="Draggable";function po(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=Ge(go),{activators:i,activatorEvent:a,active:u,activeNodeRect:d,ariaDescribedById:g,draggableNodes:h,over:b}=l.useContext(ct),{role:p=Sn,roleDescription:S="draggable",tabIndex:x=0}=o??{},m=u?.id===t,C=l.useContext(m?wn:ho),[D,E]=rt(),[N,M]=rt(),I=Kr(i,t),y=Fe(n);ce(()=>(h.set(t,{id:t,key:s,node:D,activatorNode:N,data:y}),()=>{const A=h.get(t);A&&A.key===s&&h.delete(t)}),[h,t]);const j=l.useMemo(()=>({role:p,tabIndex:x,"aria-disabled":r,"aria-pressed":m&&p===Sn?!0:void 0,"aria-roledescription":S,"aria-describedby":g.draggable}),[r,p,x,m,S,g.draggable]);return{active:u,activatorEvent:a,activeNodeRect:d,attributes:j,isDragging:m,listeners:r?void 0:I,node:D,over:b,setNodeRef:E,setActivatorNodeRef:M,transform:C}}function vo(){return l.useContext(yn)}const bo="Droppable",xo={timeout:25};function mo(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=Ge(bo),{active:i,dispatch:a,over:u,measureDroppableContainers:d}=l.useContext(ct),g=l.useRef({disabled:n}),h=l.useRef(!1),b=l.useRef(null),p=l.useRef(null),{disabled:S,updateMeasurementsFor:x,timeout:m}={...xo,...o},C=Fe(x??r),D=l.useCallback(()=>{if(!h.current){h.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{d(Array.isArray(C.current)?C.current:[C.current]),p.current=null},m)},[m]),E=at({callback:D,disabled:S||!i}),N=l.useCallback((j,A)=>{E&&(A&&(E.unobserve(A),h.current=!1),j&&E.observe(j))},[E]),[M,I]=rt(N),y=Fe(t);return l.useEffect(()=>{!E||!M.current||(E.disconnect(),h.current=!1,E.observe(M.current))},[M,E]),l.useEffect(()=>(a({type:F.RegisterDroppable,element:{id:r,key:s,disabled:n,node:M,rect:b,data:y}}),()=>a({type:F.UnregisterDroppable,key:s,id:r})),[r]),l.useEffect(()=>{n!==g.current.disabled&&(a({type:F.SetDroppableDisabled,id:r,key:s,disabled:n}),g.current.disabled=n)},[r,s,n,a]),{active:i,rect:b,isOver:u?.id===r,node:M,over:u,setNodeRef:I}}function Lt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function yo(e,t){return e.reduce((n,r,o)=>{const s=t.get(r);return s&&(n[o]=s),n},Array(e.length))}function ut(e){return e!==null&&e>=0}function wo(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 So(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Cn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=Lt(t,r,n),i=t[o],a=s[o];return!a||!i?null:{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}},dt={scaleX:1,scaleY:1},Co=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:i}=e;const a=(t=s[n])!=null?t:r;if(!a)return null;if(o===n){const d=s[i];return d?{x:0,y:n<i?d.top+d.height-(a.top+a.height):d.top-a.top,...dt}:null}const u=jo(s,o,n);return o>n&&o<=i?{x:0,y:-a.height-u,...dt}:o<n&&o>=i?{x:0,y:a.height+u,...dt}:{x:0,y:0,...dt}};function jo(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return r?n<t?o?r.top-(o.top+o.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const jn="Sortable",En=l.createContext({activeIndex:-1,containerId:jn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Cn,disabled:{draggable:!1,droppable:!1}});function Eo(e){let{children:t,id:n,items:r,strategy:o=Cn,disabled:s=!1}=e;const{active:i,dragOverlay:a,droppableRects:u,over:d,measureDroppableContainers:g}=vo(),h=Ge(jn,n),b=a.rect!==null,p=l.useMemo(()=>r.map(I=>typeof I=="object"&&"id"in I?I.id:I),[r]),S=i!=null,x=i?p.indexOf(i.id):-1,m=d?p.indexOf(d.id):-1,C=l.useRef(p),D=!wo(p,C.current),E=m!==-1&&x===-1||D,N=So(s);ce(()=>{D&&S&&g(p)},[D,p,S,g]),l.useEffect(()=>{C.current=p},[p]);const M=l.useMemo(()=>({activeIndex:x,containerId:h,disabled:N,disableTransforms:E,items:p,overIndex:m,useDragOverlay:b,sortedRects:yo(p,u),strategy:o}),[x,h,N.draggable,N.droppable,E,p,m,u,b,o]);return l.createElement(En.Provider,{value:M},t)}const No=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Lt(n,r,o).indexOf(t)},Do=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:i,previousItems:a,previousContainerId:u,transition:d}=e;return!d||!r||a!==s&&o===i?!1:n?!0:i!==o&&t===u},Ao={duration:200,easing:"ease"},Nn="transform",Io=Ve.Transition.toString({property:Nn,duration:0,easing:"linear"}),Mo={roleDescription:"sortable"};function To(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,i]=l.useState(null),a=l.useRef(n);return ce(()=>{if(!t&&n!==a.current&&r.current){const u=o.current;if(u){const d=Ae(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)&&i(g)}}n!==a.current&&(a.current=n)},[t,n,r,o]),l.useEffect(()=>{s&&i(null)},[s]),s}function Oo(e){let{animateLayoutChanges:t=Do,attributes:n,disabled:r,data:o,getNewIndex:s=No,id:i,strategy:a,resizeObserverConfig:u,transition:d=Ao}=e;const{items:g,containerId:h,activeIndex:b,disabled:p,disableTransforms:S,sortedRects:x,overIndex:m,useDragOverlay:C,strategy:D}=l.useContext(En),E=ko(r,p),N=g.indexOf(i),M=l.useMemo(()=>({sortable:{containerId:h,index:N,items:g},...o}),[h,o,N,g]),I=l.useMemo(()=>g.slice(g.indexOf(i)),[g,i]),{rect:y,node:j,isOver:A,setNodeRef:_}=mo({id:i,data:M,disabled:E.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...u}}),{active:T,activatorEvent:Y,activeNodeRect:z,attributes:W,setNodeRef:B,listeners:le,isDragging:q,over:je,setActivatorNodeRef:re,transform:be}=po({id:i,data:M,attributes:{...Mo,...n},disabled:E.draggable}),f=qn(_,B),w=!!T,O=w&&!S&&ut(b)&&ut(m),R=!C&&q,ue=R&&O?be:null,$=O?ue??(a??D)({rects:x,activeNodeRect:z,activeIndex:b,overIndex:m,index:N}):null,J=ut(b)&&ut(m)?s({id:i,items:g,activeIndex:b,overIndex:m}):N,Q=T?.id,L=l.useRef({activeId:Q,items:g,newIndex:J,containerId:h}),He=g!==L.current.items,de=t({active:T,containerId:h,isDragging:q,isSorting:w,id:i,index:N,items:g,newIndex:L.current.newIndex,previousItems:L.current.items,previousContainerId:L.current.containerId,transition:d,wasDragging:L.current.activeId!=null}),Te=To({disabled:!de,index:N,node:j,rect:y});return l.useEffect(()=>{w&&L.current.newIndex!==J&&(L.current.newIndex=J),h!==L.current.containerId&&(L.current.containerId=h),g!==L.current.items&&(L.current.items=g)},[w,J,h,g]),l.useEffect(()=>{if(Q===L.current.activeId)return;if(Q!=null&&L.current.activeId==null){L.current.activeId=Q;return}const Oe=setTimeout(()=>{L.current.activeId=Q},50);return()=>clearTimeout(Oe)},[Q]),{active:T,activeIndex:b,attributes:W,data:M,rect:y,index:N,newIndex:J,items:g,isOver:A,isSorting:w,isDragging:q,listeners:le,node:j,overIndex:m,over:je,setNodeRef:f,setActivatorNodeRef:re,setDroppableNodeRef:_,setDraggableNodeRef:B,transform:Te??$,transition:ge()};function ge(){if(Te||He&&L.current.newIndex===N)return Io;if(!(R&&!wt(Y)||!d)&&(w||de))return Ve.Transition.toString({...d,property:Nn})}}function ko(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}}k.Down,k.Right,k.Up,k.Left;const Rt=new Map;function Ie(e){if(!e)return V.FileText;const t=Rt.get(e);if(t)return t;if(V[e])return Rt.set(e,V[e]),V[e];const n=e.split("-").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("");return V[n]?(Rt.set(e,V[n]),V[n]):V.FileText}function ae(e,t){if(typeof e=="string")return e;if(t){const n=t(e.key,{defaultValue:e.defaultValue,...e.params});if(n&&n!==e.key)return n}return e.defaultValue||e.key}function Lo(e,t,n){const r=ae(e.label,n);return t&&e.type==="object"&&e.objectName&&typeof e.label=="string"?t(e.objectName,r):r}const Ro=e=>!(e===!1||e==="false"),Po=()=>!0;function _o(e,t){switch(e.type){case"object":{const n=`${t}/${e.objectName??""}`;return{href:e.viewName?`${n}/view/${e.viewName}`:n,external:!1}}case"dashboard":return{href:e.dashboardName?`${t}/dashboard/${e.dashboardName}`:"#",external:!1};case"page":return{href:e.pageName?`${t}/page/${e.pageName}`:"#",external:!1};case"report":return{href:e.reportName?`${t}/report/${e.reportName}`:"#",external:!1};case"url":return{href:e.url??"#",external:e.target==="_blank"};default:return{href:"#",external:!1}}}function Pt(e,t){if(!t.trim())return e;const n=t.toLowerCase().trim();return e.reduce((r,o)=>{if(o.type==="separator")return r;if(o.type==="group"&&o.children?.length){const s=Pt(o.children,t);return s.length>0&&r.push({...o,children:s}),r}return ae(o.label).toLowerCase().includes(n)&&r.push(o),r},[])}const $o=5;function zo({item:e,basePath:t,evalVis:n,checkPerm:r,onAction:o,enablePinning:s,onPinToggle:i,enableReorder:a,resolveObjectLabel:u,t:d}){const{attributes:g,listeners:h,setNodeRef:b,transform:p,transition:S,isDragging:x}=Oo({id:e.id,disabled:!a}),m={transform:Ve.Transform.toString(p),transition:S,opacity:x?.5:void 0,zIndex:x?10:void 0};return c.jsx("div",{ref:b,style:m,...g,children:c.jsx(Me,{item:e,basePath:t,evalVis:n,checkPerm:r,onAction:o,enablePinning:s,onPinToggle:i,dragListeners:a?h:void 0,resolveObjectLabel:u,t:d})})}function Me({item:e,basePath:t,evalVis:n,checkPerm:r,onAction:o,enablePinning:s,onPinToggle:i,dragListeners:a,resolveObjectLabel:u,t:d}){const g=Ce.useLocation(),[h,b]=l.useState(e.defaultOpen!==!1);if(!n(e.visible)||e.requiredPermissions?.length&&!r(e.requiredPermissions))return null;if(e.type==="separator")return c.jsx(v.Separator,{className:"my-2"});if(e.type==="group"){const E=(e.children??[]).slice().sort((N,M)=>(N.order??0)-(M.order??0));return c.jsx(v.Collapsible,{open:h,onOpenChange:b,children:c.jsxs(v.SidebarGroup,{children:[c.jsx(v.SidebarGroupLabel,{asChild:!0,children:c.jsxs(v.CollapsibleTrigger,{className:"flex w-full items-center justify-between",children:[ae(e.label,d),c.jsx(V.ChevronRight,{className:`ml-auto h-4 w-4 transition-transform ${h?"rotate-90":""}`})]})}),c.jsx(v.CollapsibleContent,{children:c.jsx(v.SidebarGroupContent,{children:c.jsx(v.SidebarMenu,{children:E.map(N=>c.jsx(Me,{item:N,basePath:t,evalVis:n,checkPerm:r,onAction:o,enablePinning:s,onPinToggle:i,resolveObjectLabel:u,t:d},N.id))})})})]})})}if(e.type==="action"){const E=Ie(e.icon);return c.jsxs(v.SidebarMenuItem,{children:[a&&c.jsx("span",{className:"absolute left-0.5 top-1/2 -translate-y-1/2 cursor-grab text-muted-foreground","aria-label":"Drag to reorder",...a,children:c.jsx(V.GripVertical,{className:"h-3.5 w-3.5"})}),c.jsxs(v.SidebarMenuButton,{tooltip:ae(e.label,d),onClick:()=>o?.(e),children:[c.jsx(E,{className:"h-4 w-4"}),c.jsx("span",{children:ae(e.label,d)}),e.badge!=null&&c.jsx(v.Badge,{variant:e.badgeVariant??"default",className:"ml-auto text-[10px] px-1.5 py-0",children:e.badge})]}),s&&i&&c.jsx(v.SidebarMenuAction,{showOnHover:!e.pinned,onClick:()=>i(e.id,!e.pinned),"aria-label":e.pinned?`Unpin ${ae(e.label,d)}`:`Pin ${ae(e.label,d)}`,children:e.pinned?c.jsx(V.PinOff,{className:"h-3.5 w-3.5"}):c.jsx(V.Pin,{className:"h-3.5 w-3.5"})})]})}const p=Ie(e.icon),{href:S,external:x}=_o(e,t),m=S!=="#"&&g.pathname.startsWith(S),C=Lo(e,u,d),D=c.jsxs(c.Fragment,{children:[c.jsx(p,{className:"h-4 w-4"}),c.jsx("span",{children:C}),e.badge!=null&&c.jsx(v.Badge,{variant:e.badgeVariant??"default",className:"ml-auto text-[10px] px-1.5 py-0",children:e.badge})]});return c.jsxs(v.SidebarMenuItem,{children:[a&&c.jsx("span",{className:"absolute left-0.5 top-1/2 -translate-y-1/2 cursor-grab text-muted-foreground","aria-label":"Drag to reorder",...a,children:c.jsx(V.GripVertical,{className:"h-3.5 w-3.5"})}),c.jsx(v.SidebarMenuButton,{asChild:!0,isActive:m,tooltip:C,children:x?c.jsx("a",{href:S,target:"_blank",rel:"noopener noreferrer",children:D}):c.jsx(Ce.Link,{to:S,children:D})}),s&&i&&c.jsx(v.SidebarMenuAction,{showOnHover:!e.pinned,onClick:()=>i(e.id,!e.pinned),"aria-label":e.pinned?`Unpin ${C}`:`Pin ${C}`,children:e.pinned?c.jsx(V.PinOff,{className:"h-3.5 w-3.5"}):c.jsx(V.Pin,{className:"h-3.5 w-3.5"})})]})}function _t({items:e,basePath:t="",evaluateVisibility:n=Ro,checkPermission:r=Po,onAction:o,searchQuery:s,enablePinning:i,onPinToggle:a,enableReorder:u,onReorder:d,resolveObjectLabel:g,t:h}){const b=l.useMemo(()=>s?Pt(e,s):e,[e,s]),p=l.useMemo(()=>Dn(b),[b]),S=b.slice().sort((y,j)=>(y.order??0)-(j.order??0)),x=ar(Qt(Mt,{activationConstraint:{distance:$o}}),Qt(At)),m=y=>{const{active:j,over:A}=y;if(!A||j.id===A.id||!d)return;const _=S.findIndex(z=>z.id===j.id),T=S.findIndex(z=>z.id===A.id);if(_===-1||T===-1)return;const Y=Lt(S,_,T).map((z,W)=>({...z,order:W}));d(Y)},C={basePath:t,evalVis:n,checkPerm:r,onAction:o,enablePinning:i,onPinToggle:a,resolveObjectLabel:g,t:h},D=S.some(y=>y.type==="group"),E=p.length>0&&i?c.jsxs(v.SidebarGroup,{children:[c.jsxs(v.SidebarGroupLabel,{className:"flex items-center gap-1.5",children:[c.jsx(V.Star,{className:"h-3.5 w-3.5"}),"Favorites"]}),c.jsx(v.SidebarGroupContent,{children:c.jsx(v.SidebarMenu,{children:p.map(y=>c.jsx(Me,{item:y,...C},`fav-${y.id}`))})})]}):null;if(!D){const y=S.filter(A=>A.type!=="group").map(A=>A.id),j=u?c.jsx(fo,{sensors:x,collisionDetection:fr,onDragEnd:m,children:c.jsx(Eo,{items:y,strategy:Co,children:c.jsx(v.SidebarMenu,{children:S.map(A=>c.jsx(zo,{item:A,enableReorder:u,...C},A.id))})})}):c.jsx(v.SidebarMenu,{children:S.map(A=>c.jsx(Me,{item:A,...C},A.id))});return c.jsxs(c.Fragment,{children:[E,c.jsx(v.SidebarGroup,{children:c.jsx(v.SidebarGroupContent,{children:j})})]})}const N=[];let M=[];const I=y=>{if(M.length===0)return;const j=M;M=[],N.push(c.jsx(v.SidebarGroup,{children:c.jsx(v.SidebarGroupContent,{children:c.jsx(v.SidebarMenu,{children:j.map(A=>c.jsx(Me,{item:A,...C},A.id))})})},y))};return S.forEach((y,j)=>{y.type==="group"?(I(`leaf-${j}`),N.push(c.jsx(Me,{item:y,...C},y.id))):M.push(y)}),I("leaf-end"),c.jsxs(c.Fragment,{children:[E,N]})}function Dn(e){const t=[];for(const n of e)n.pinned&&n.type!=="group"&&n.type!=="separator"&&t.push(n),n.children?.length&&t.push(...Dn(n.children));return t}function Bo({areas:e,activeAreaId:t,onAreaChange:n,evalVis:r,checkPerm:o}){const s=e.filter(i=>!(!r(i.visible)||i.requiredPermissions?.length&&!o(i.requiredPermissions)));return s.length<=1?null:c.jsxs(v.SidebarGroup,{children:[c.jsxs(v.SidebarGroupLabel,{className:"flex items-center gap-1.5",children:[c.jsx(V.Layers,{className:"h-3.5 w-3.5"}),"Area"]}),c.jsx(v.SidebarGroupContent,{children:c.jsx(v.SidebarMenu,{children:s.map(i=>{const a=Ie(i.icon);return c.jsx(v.SidebarMenuItem,{children:c.jsxs(v.SidebarMenuButton,{isActive:i.id===t,tooltip:ae(i.label),onClick:()=>n(i.id),children:[c.jsx(a,{className:"h-4 w-4"}),c.jsx("span",{children:ae(i.label)})]})},i.id)})})})]})}function Fo({items:e,basePath:t}){const n=Ce.useLocation(),r=e.filter(o=>o.type!=="group"&&o.type!=="separator").slice(0,5);return r.length===0?null:c.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-50 flex items-center justify-around border-t bg-background/95 backdrop-blur-sm px-2 py-1 sm:hidden safe-area-bottom",role:"navigation","aria-label":"Mobile navigation",children:r.map(o=>{const s=Ie(o.icon);let i="#";o.type==="object"?(i=`${t}/${o.objectName}`,o.viewName&&(i+=`/view/${o.viewName}`)):o.type==="dashboard"?i=o.dashboardName?`${t}/dashboard/${o.dashboardName}`:"#":o.type==="page"?i=o.pageName?`${t}/page/${o.pageName}`:"#":o.type==="report"?i=o.reportName?`${t}/report/${o.reportName}`:"#":o.type==="url"&&(i=o.url??"#");const a=i!=="#"&&n.pathname.startsWith(i);return c.jsxs(Ce.Link,{to:i,className:`flex flex-col items-center gap-0.5 px-2 py-1.5 transition-colors min-w-[44px] min-h-[44px] justify-center ${a?"text-primary":"text-muted-foreground hover:text-foreground"}`,children:[c.jsx(s,{className:"h-5 w-5"}),c.jsx("span",{className:"text-[10px] truncate max-w-[60px]",children:ae(o.label)})]},o.id)})})}function Yo({schema:e,basePath:t,evalVis:n,checkPerm:r,onAction:o,sidebarHeader:s,sidebarFooter:i,sidebarExtra:a,activeAreaId:u,setActiveAreaId:d,resolvedNavigation:g,enableSearch:h,enablePinning:b,onPinToggle:p,enableReorder:S,onReorder:x}){const m=Ie(e.logo),C=e.areas??[],[D,E]=l.useState("");return c.jsxs(v.Sidebar,{collapsible:"icon",children:[c.jsxs(v.SidebarHeader,{children:[s??c.jsx(v.SidebarMenu,{children:c.jsx(v.SidebarMenuItem,{children:c.jsxs(v.SidebarMenuButton,{size:"lg",tooltip:e.title??e.name,children:[c.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-primary text-primary-foreground",children:e.logo&&e.logo.startsWith("http")?c.jsx("img",{src:e.logo,alt:e.title??"",className:"size-6 object-contain"}):c.jsx(m,{className:"size-4"})}),c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[c.jsx("span",{className:"truncate font-semibold",children:e.title??e.name??"App"}),e.description&&c.jsx("span",{className:"truncate text-xs text-muted-foreground",children:e.description})]})]})})}),h&&c.jsx(v.SidebarInput,{placeholder:"Search navigation…",value:D,onChange:N=>E(N.target.value),"aria-label":"Search navigation"})]}),c.jsxs(v.SidebarContent,{children:[C.length>1&&u&&c.jsx(Bo,{areas:C,activeAreaId:u,onAreaChange:d,evalVis:n,checkPerm:r}),c.jsx(_t,{items:g,basePath:t,evaluateVisibility:n,checkPermission:r,onAction:o,searchQuery:D,enablePinning:b,onPinToggle:p,enableReorder:S,onReorder:x}),a]}),i&&c.jsx(v.SidebarFooter,{children:i})]})}function An({schema:e,basePath:t="",mobileNavMode:n="drawer",evaluateVisibility:r,checkPermission:o,onAction:s,navbar:i,sidebarHeader:a,sidebarFooter:u,sidebarExtra:d,children:g,className:h,defaultOpen:b=!0,enableSearch:p,enablePinning:S,onPinToggle:x,enableReorder:m,onReorder:C}){const D=r??(B=>!(B===!1||B==="false")),E=o??(()=>!0),N=l.useMemo(()=>(e.menu??[]).map((B,le)=>$n.menuItemToNavigationItem(B,le)),[e.menu]),M=e.navigation??N,I=e.areas??[],[y,j]=l.useState(()=>I.length>0?I[0].id:null),A=I.map(B=>B.id).join(",");l.useEffect(()=>{I.length>0?j(B=>I.some(le=>le.id===B)?B:I[0].id):j(null)},[e.name,A]);const T=I.find(B=>B.id===y)?.navigation??M,Y={title:e.title,favicon:e.favicon,logo:e.logo},z=c.jsx(Yo,{schema:e,basePath:t,evalVis:D,checkPerm:E,onAction:s,sidebarHeader:a,sidebarFooter:u,sidebarExtra:d,activeAreaId:y,setActiveAreaId:j,resolvedNavigation:T,enableSearch:p,enablePinning:S,onPinToggle:x,enableReorder:m,onReorder:C}),W=n==="bottom_nav";return c.jsxs(c.Fragment,{children:[c.jsx(pt,{sidebar:z,navbar:i,className:h,defaultOpen:b,branding:Y,children:g}),W&&c.jsx(Fo,{items:T,basePath:t})]})}const Go=e=>e?Array.isArray(e)?e:[e]:[];function Vo({schema:e,className:t,style:n,id:r,...o}){const s=Go(e.children);return c.jsxs("div",{id:r||e.id,className:v.cn("flex flex-col h-full space-y-4",t),style:n,children:[c.jsx(tt,{title:e.title,description:e.description}),c.jsx("div",{className:"flex-1 overflow-auto",children:s.map((i,a)=>c.jsx(zn.SchemaRenderer,{schema:i,...o},i?.id||a))})]})}function Uo(e){return"items"in e&&!("href"in e)}function Wo({item:e,pathname:t}){return e.children&&e.children.length>0?c.jsx(v.Collapsible,{asChild:!0,defaultOpen:!0,className:"group/collapsible",children:c.jsxs(v.SidebarMenuItem,{children:[c.jsx(v.CollapsibleTrigger,{asChild:!0,children:c.jsxs(v.SidebarMenuButton,{tooltip:e.title,children:[e.icon&&c.jsx(e.icon,{}),c.jsx("span",{children:e.title}),e.badge!=null&&c.jsx(v.Badge,{variant:e.badgeVariant||"default",className:"ml-auto mr-1 h-5 min-w-5 px-1 text-xs",children:e.badge}),c.jsx(gt.ChevronRight,{className:"ml-auto h-4 w-4 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),c.jsx(v.CollapsibleContent,{children:c.jsx(v.SidebarMenuSub,{children:e.children.map(n=>c.jsx(v.SidebarMenuSubItem,{children:c.jsx(v.SidebarMenuSubButton,{asChild:!0,isActive:t===n.href,children:c.jsxs(Ce.NavLink,{to:n.href,children:[n.icon&&c.jsx(n.icon,{}),c.jsx("span",{children:n.title}),n.badge!=null&&c.jsx(v.Badge,{variant:n.badgeVariant||"default",className:"ml-auto h-5 min-w-5 px-1 text-xs",children:n.badge})]})})},n.href))})})]})}):c.jsx(v.SidebarMenuItem,{children:c.jsx(v.SidebarMenuButton,{asChild:!0,isActive:t===e.href,tooltip:e.title,children:c.jsxs(Ce.NavLink,{to:e.href,children:[e.icon&&c.jsx(e.icon,{}),c.jsx("span",{children:e.title}),e.badge!=null&&c.jsx(v.Badge,{variant:e.badgeVariant||"default",className:"ml-auto h-5 min-w-5 px-1 text-xs",children:e.badge})]})})})}function qo({items:e,title:t="Application",className:n,collapsible:r="icon",searchEnabled:o=!1,searchPlaceholder:s="Search..."}){const i=Ce.useLocation(),[a,u]=l.useState(""),d=l.useMemo(()=>e.length===0?[]:Uo(e[0])?e.map(h=>({groupLabel:h.label,items:h.items})):[{items:e}],[e]),g=l.useMemo(()=>{if(!a)return d;const h=a.toLowerCase();return d.map(b=>({...b,items:b.items.filter(p=>p.title.toLowerCase().includes(h)||p.children?.some(S=>S.title.toLowerCase().includes(h)))})).filter(b=>b.items.length>0)},[d,a]);return c.jsx(v.Sidebar,{className:n,collapsible:r,children:c.jsxs(v.SidebarContent,{children:[o&&c.jsx("div",{className:"px-3 py-2",children:c.jsxs("div",{className:"relative",children:[c.jsx(gt.Search,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),c.jsx(v.Input,{type:"search",placeholder:s,value:a,onChange:h=>u(h.target.value),className:"pl-8 h-9"})]})}),g.map((h,b)=>c.jsxs(v.SidebarGroup,{children:[c.jsx(v.SidebarGroupLabel,{children:h.groupLabel||t}),c.jsx(v.SidebarGroupContent,{children:c.jsx(v.SidebarMenu,{children:h.items.map(p=>c.jsx(Wo,{item:p,pathname:i.pathname},p.href))})})]},h.groupLabel||b))]})})}function In(){se.ComponentRegistry.register("page-header",tt,{namespace:"layout",label:"Page Header",category:"Layout",inputs:[{name:"title",type:"string"},{name:"description",type:"string"}]}),se.ComponentRegistry.register("page:header",tt,{namespace:"layout"}),se.ComponentRegistry.register("page:card",Wt,{namespace:"layout",label:"Page Card",category:"Layout",isContainer:!0}),se.ComponentRegistry.register("app-shell",pt,{namespace:"layout",label:"App Shell",category:"Layout"}),se.ComponentRegistry.register("responsive-grid",qt,{namespace:"layout",label:"Responsive Grid",category:"Layout",isContainer:!0,inputs:[{name:"columns",type:"object"},{name:"gap",type:"number"}]}),se.ComponentRegistry.register("navigation-renderer",_t,{namespace:"layout",label:"Navigation Renderer",category:"Layout",inputs:[{name:"items",type:"object"},{name:"basePath",type:"string"}]}),se.ComponentRegistry.register("app-schema-renderer",An,{namespace:"layout",label:"App Schema Renderer",category:"Layout",isContainer:!0,inputs:[{name:"schema",type:"object"},{name:"basePath",type:"string"},{name:"mobileNavMode",type:"string"}]})}try{In()}catch{}P.AppSchemaRenderer=An,P.AppShell=pt,P.NavigationRenderer=_t,P.Page=Vo,P.PageCard=Wt,P.PageHeader=tt,P.ResponsiveGrid=qt,P.SidebarNav=qo,P.filterNavigationItems=Pt,P.registerLayout=In,P.resolveIcon=Ie,P.resolveLabel=ae,P.useAppShellBranding=Ut,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
10
+ `},on={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function sn(e){let{announcements:t=on,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=nn}=e;const{announce:s,announcement:i}=en(),a=Ge("DndLiveRegion"),[u,d]=l.useState(!1);if(l.useEffect(()=>{d(!0)},[]),tn(l.useMemo(()=>({onDragStart(h){let{active:b}=h;s(t.onDragStart({active:b}))},onDragMove(h){let{active:b,over:p}=h;t.onDragMove&&s(t.onDragMove({active:b,over:p}))},onDragOver(h){let{active:b,over:p}=h;s(t.onDragOver({active:b,over:p}))},onDragEnd(h){let{active:b,over:p}=h;s(t.onDragEnd({active:b,over:p}))},onDragCancel(h){let{active:b,over:p}=h;s(t.onDragCancel({active:b,over:p}))}}),[s,t])),!u)return null;const g=l.createElement(l.Fragment,null,l.createElement(Qr,{id:n,value:o.draggable}),l.createElement(Zr,{id:a,announcement:i}));return r?_e.createPortal(g,r):g}var F;(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"})(F||(F={}));function st(){}function Qt(e,t){return l.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function an(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return l.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const ie=Object.freeze({x:0,y:0});function ln(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function cn(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function un(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function dn(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function Zt(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const fn=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=Zt(t,t.left,t.top),s=[];for(const i of n){const{id:a}=i,u=r.get(a);if(u){const d=ln(Zt(u),o);s.push({id:a,data:{droppableContainer:i,value:d}})}}return s.sort(cn)};function hn(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),i=o-n,a=s-r;if(n<o&&r<s){const u=t.width*t.height,d=e.width*e.height,g=i*a,h=g/(u+d-g);return Number(h.toFixed(4))}return 0}const gn=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const s of n){const{id:i}=s,a=r.get(i);if(a){const u=hn(a,t);u>0&&o.push({id:i,data:{droppableContainer:s,value:u}})}}return o.sort(un)};function pn(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function er(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ie}function vn(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=arguments[s];return o.reduce((i,a)=>({...i,top:i.top+e*a.y,bottom:i.bottom+e*a.y,left:i.left+e*a.x,right:i.right+e*a.x}),{...r})}}const bn=vn(1);function xn(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 mn(e,t,r){const n=xn(t);if(!n)return e;const{scaleX:o,scaleY:s,x:i,y:a}=n,u=e.left-i-(1-o)*parseFloat(r),d=e.top-a-(1-s)*parseFloat(r.slice(r.indexOf(" ")+1)),g=o?e.width/o:e.width,h=s?e.height/s:e.height;return{width:g,height:h,top:d,right:u+g,bottom:d+h,left:u}}const yn={ignoreTransform:!1};function Ae(e,t){t===void 0&&(t=yn);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:g}=K(e).getComputedStyle(e);d&&(r=mn(r,d,g))}const{top:n,left:o,width:s,height:i,bottom:a,right:u}=r;return{top:n,left:o,width:s,height:i,bottom:a,right:u}}function tr(e){return Ae(e,{ignoreTransform:!0})}function wn(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Sn(e,t){return t===void 0&&(t=K(e).getComputedStyle(e)),t.position==="fixed"}function Cn(e,t){t===void 0&&(t=K(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?r.test(s):!1})}function Ct(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(bt(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!Be(o)||Xt(o)||r.includes(o))return r;const s=K(e).getComputedStyle(o);return o!==e&&Cn(o,s)&&r.push(o),Sn(o,s)?r:n(o.parentNode)}return e?n(e):r}function rr(e){const[t]=Ct(e,1);return t??null}function jt(e){return!rt||!e?null:Ee(e)?e:vt(e)?bt(e)||e===Ne(e).scrollingElement?window:Be(e)?e:null:null}function nr(e){return Ee(e)?e.scrollX:e.scrollLeft}function or(e){return Ee(e)?e.scrollY:e.scrollTop}function Et(e){return{x:nr(e),y:or(e)}}var G;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(G||(G={}));function sr(e){return!rt||!e?!1:e===document.scrollingElement}function ir(e){const t={x:0,y:0},r=sr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,i=e.scrollTop>=n.y,a=e.scrollLeft>=n.x;return{isTop:o,isLeft:s,isBottom:i,isRight:a,maxScroll:n,minScroll:t}}const jn={x:.2,y:.2};function En(e,t,r,n,o){let{top:s,left:i,right:a,bottom:u}=r;n===void 0&&(n=10),o===void 0&&(o=jn);const{isTop:d,isBottom:g,isLeft:h,isRight:b}=ir(e),p={x:0,y:0},S={x:0,y:0},x={height:t.height*o.y,width:t.width*o.x};return!d&&s<=t.top+x.height?(p.y=G.Backward,S.y=n*Math.abs((t.top+x.height-s)/x.height)):!g&&u>=t.bottom-x.height&&(p.y=G.Forward,S.y=n*Math.abs((t.bottom-x.height-u)/x.height)),!b&&a>=t.right-x.width?(p.x=G.Forward,S.x=n*Math.abs((t.right-x.width-a)/x.width)):!h&&i<=t.left+x.width&&(p.x=G.Backward,S.x=n*Math.abs((t.left+x.width-i)/x.width)),{direction:p,speed:S}}function Nn(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:i}=window;return{top:0,left:0,right:s,bottom:i,width:s,height:i}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function ar(e){return e.reduce((t,r)=>De(t,Et(r)),ie)}function Dn(e){return e.reduce((t,r)=>t+nr(r),0)}function An(e){return e.reduce((t,r)=>t+or(r),0)}function In(e,t){if(t===void 0&&(t=Ae),!e)return;const{top:r,left:n,bottom:o,right:s}=t(e);rr(e)&&(o<=0||s<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Mn=[["x",["left","right"],Dn],["y",["top","bottom"],An]];class Nt{constructor(t,r){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 n=Ct(r),o=ar(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,i,a]of Mn)for(const u of i)Object.defineProperty(this,u,{get:()=>{const d=a(n),g=o[s]-d;return this.rect[u]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ue{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Tn(e){const{EventTarget:t}=K(e);return e instanceof t?e:Ne(e)}function Dt(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var re;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(re||(re={}));function lr(e){e.preventDefault()}function On(e){e.stopPropagation()}var k;(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"})(k||(k={}));const cr={start:[k.Space,k.Enter],cancel:[k.Esc],end:[k.Space,k.Enter,k.Tab]},kn=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case k.Right:return{...r,x:r.x+25};case k.Left:return{...r,x:r.x-25};case k.Down:return{...r,y:r.y+25};case k.Up:return{...r,y:r.y-25}}};class At{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:r}}=t;this.props=t,this.listeners=new Ue(Ne(r)),this.windowListeners=new Ue(K(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(re.Resize,this.handleCancel),this.windowListeners.add(re.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(re.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&In(n),r(ie)}handleKeyDown(t){if(wt(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:s=cr,coordinateGetter:i=kn,scrollBehavior:a="smooth"}=o,{code:u}=t;if(s.end.includes(u)){this.handleEnd(t);return}if(s.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:d}=n.current,g=d?{x:d.left,y:d.top}:ie;this.referenceCoordinates||(this.referenceCoordinates=g);const h=i(t,{active:r,context:n.current,currentCoordinates:g});if(h){const b=ot(h,g),p={x:0,y:0},{scrollableAncestors:S}=n.current;for(const x of S){const m=t.code,{isTop:C,isRight:D,isLeft:E,isBottom:N,maxScroll:M,minScroll:I}=ir(x),y=Nn(x),j={x:Math.min(m===k.Right?y.right-y.width/2:y.right,Math.max(m===k.Right?y.left:y.left+y.width/2,h.x)),y:Math.min(m===k.Down?y.bottom-y.height/2:y.bottom,Math.max(m===k.Down?y.top:y.top+y.height/2,h.y))},A=m===k.Right&&!D||m===k.Left&&!E,_=m===k.Down&&!N||m===k.Up&&!C;if(A&&j.x!==h.x){const T=x.scrollLeft+b.x,Y=m===k.Right&&T<=M.x||m===k.Left&&T>=I.x;if(Y&&!b.y){x.scrollTo({left:T,behavior:a});return}Y?p.x=x.scrollLeft-T:p.x=m===k.Right?x.scrollLeft-M.x:x.scrollLeft-I.x,p.x&&x.scrollBy({left:-p.x,behavior:a});break}else if(_&&j.y!==h.y){const T=x.scrollTop+b.y,Y=m===k.Down&&T<=M.y||m===k.Up&&T>=I.y;if(Y&&!b.x){x.scrollTo({top:T,behavior:a});return}Y?p.y=x.scrollTop-T:p.y=m===k.Down?x.scrollTop-M.y:x.scrollTop-I.y,p.y&&x.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,De(ot(h,this.referenceCoordinates),p))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}At.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=cr,onActivation:o}=t,{active:s}=r;const{code:i}=e.nativeEvent;if(n.start.includes(i)){const a=s.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function ur(e){return!!(e&&"distance"in e)}function dr(e){return!!(e&&"delay"in e)}class It{constructor(t,r,n){var o;n===void 0&&(n=Tn(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=r;const{event:s}=t,{target:i}=s;this.props=t,this.events=r,this.document=Ne(i),this.documentListeners=new Ue(this.document),this.listeners=new Ue(n),this.windowListeners=new Ue(K(i)),this.initialCoordinates=(o=St(s))!=null?o:ie,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:r,bypassActivationConstraint:n}}}=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(re.Resize,this.handleCancel),this.windowListeners.add(re.DragStart,lr),this.windowListeners.add(re.VisibilityChange,this.handleCancel),this.windowListeners.add(re.ContextMenu,lr),this.documentListeners.add(re.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(dr(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(ur(r)){this.handlePending(r);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,r){const{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(re.Click,On,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(re.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:s}=this,{onMove:i,options:{activationConstraint:a}}=s;if(!o)return;const u=(r=St(t))!=null?r:ie,d=ot(o,u);if(!n&&a){if(ur(a)){if(a.tolerance!=null&&Dt(d,a.tolerance))return this.handleCancel();if(Dt(d,a.distance))return this.handleStart()}if(dr(a)&&Dt(d,a.tolerance))return this.handleCancel();this.handlePending(a,d);return}t.cancelable&&t.preventDefault(),i(u)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===k.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ln={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Mt extends It{constructor(t){const{event:r}=t,n=Ne(r.target);super(t,Ln,n)}}Mt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n?.({event:r}),!0)}}];const Rn={move:{name:"mousemove"},end:{name:"mouseup"}};var Tt;(function(e){e[e.RightClick=2]="RightClick"})(Tt||(Tt={}));class Pn extends It{constructor(t){super(t,Rn,Ne(t.event.target))}}Pn.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===Tt.RightClick?!1:(n?.({event:r}),!0)}}];const Ot={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class _n extends It{constructor(t){super(t,Ot)}static setup(){return window.addEventListener(Ot.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ot.move.name,t)};function t(){}}}_n.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n?.({event:r}),!0)}}];var We;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(We||(We={}));var it;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(it||(it={}));function $n(e){let{acceleration:t,activator:r=We.Pointer,canScroll:n,draggingRect:o,enabled:s,interval:i=5,order:a=it.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:g,delta:h,threshold:b}=e;const p=Bn({delta:h,disabled:!s}),[S,x]=qr(),m=l.useRef({x:0,y:0}),C=l.useRef({x:0,y:0}),D=l.useMemo(()=>{switch(r){case We.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case We.DraggableRect:return o}},[r,o,u]),E=l.useRef(null),N=l.useCallback(()=>{const I=E.current;if(!I)return;const y=m.current.x*C.current.x,j=m.current.y*C.current.y;I.scrollBy(y,j)},[]),M=l.useMemo(()=>a===it.TreeOrder?[...d].reverse():d,[a,d]);l.useEffect(()=>{if(!s||!d.length||!D){x();return}for(const I of M){if(n?.(I)===!1)continue;const y=d.indexOf(I),j=g[y];if(!j)continue;const{direction:A,speed:_}=En(I,j,D,t,b);for(const T of["x","y"])p[T][A[T]]||(_[T]=0,A[T]=0);if(_.x>0||_.y>0){x(),E.current=I,S(N,i),m.current=_,C.current=A;return}}m.current={x:0,y:0},C.current={x:0,y:0},x()},[t,N,n,x,s,i,JSON.stringify(D),JSON.stringify(p),S,d,M,g,JSON.stringify(b)])}const zn={x:{[G.Backward]:!1,[G.Forward]:!1},y:{[G.Backward]:!1,[G.Forward]:!1}};function Bn(e){let{delta:t,disabled:r}=e;const n=mt(t);return Ye(o=>{if(r||!n||!o)return zn;const s={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[G.Backward]:o.x[G.Backward]||s.x===-1,[G.Forward]:o.x[G.Forward]||s.x===1},y:{[G.Backward]:o.y[G.Backward]||s.y===-1,[G.Forward]:o.y[G.Forward]||s.y===1}}},[r,t,n])}function Fn(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return Ye(o=>{var s;return t==null?null:(s=n??o)!=null?s:null},[n,t])}function Yn(e,t){return l.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,s=o.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,n)}));return[...r,...s]},[]),[e,t])}var qe;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(qe||(qe={}));var kt;(function(e){e.Optimized="optimized"})(kt||(kt={}));const fr=new Map;function Gn(e,t){let{dragging:r,dependencies:n,config:o}=t;const[s,i]=l.useState(null),{frequency:a,measure:u,strategy:d}=o,g=l.useRef(e),h=m(),b=Fe(h),p=l.useCallback(function(C){C===void 0&&(C=[]),!b.current&&i(D=>D===null?C:D.concat(C.filter(E=>!D.includes(E))))},[b]),S=l.useRef(null),x=Ye(C=>{if(h&&!r)return fr;if(!C||C===fr||g.current!==e||s!=null){const D=new Map;for(let E of e){if(!E)continue;if(s&&s.length>0&&!s.includes(E.id)&&E.rect.current){D.set(E.id,E.rect.current);continue}const N=E.node.current,M=N?new Nt(u(N),N):null;E.rect.current=M,M&&D.set(E.id,M)}return D}return C},[e,s,r,h,u]);return l.useEffect(()=>{g.current=e},[e]),l.useEffect(()=>{h||p()},[r,h]),l.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),l.useEffect(()=>{h||typeof a!="number"||S.current!==null||(S.current=setTimeout(()=>{p(),S.current=null},a))},[a,h,p,...n]),{droppableRects:x,measureDroppableContainers:p,measuringScheduled:s!=null};function m(){switch(d){case qe.Always:return!1;case qe.BeforeDragging:return r;default:return!r}}}function hr(e,t){return Ye(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Vn(e,t){return hr(e,t)}function Un(e){let{callback:t,disabled:r}=e;const n=xt(t),o=l.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(n)},[n,r]);return l.useEffect(()=>()=>o?.disconnect(),[o]),o}function at(e){let{callback:t,disabled:r}=e;const n=xt(t),o=l.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(n)},[r]);return l.useEffect(()=>()=>o?.disconnect(),[o]),o}function Wn(e){return new Nt(Ae(e),e)}function gr(e,t,r){t===void 0&&(t=Wn);const[n,o]=l.useState(null);function s(){o(u=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=u??r)!=null?d:null}const g=t(e);return JSON.stringify(u)===JSON.stringify(g)?u:g})}const i=Un({callback(u){if(e)for(const d of u){const{type:g,target:h}=d;if(g==="childList"&&h instanceof HTMLElement&&h.contains(e)){s();break}}}}),a=at({callback:s});return ce(()=>{s(),e?(a?.observe(e),i?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),i?.disconnect())},[e]),n}function qn(e){const t=hr(e);return er(e,t)}const pr=[];function Xn(e){const t=l.useRef(e),r=Ye(n=>e?n&&n!==pr&&e&&t.current&&e.parentNode===t.current.parentNode?n:Ct(e):pr,[e]);return l.useEffect(()=>{t.current=e},[e]),r}function Hn(e){const[t,r]=l.useState(null),n=l.useRef(e),o=l.useCallback(s=>{const i=jt(s.target);i&&r(a=>a?(a.set(i,Et(i)),new Map(a)):null)},[]);return l.useEffect(()=>{const s=n.current;if(e!==s){i(s);const a=e.map(u=>{const d=jt(u);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Et(d)]):null}).filter(u=>u!=null);r(a.length?new Map(a):null),n.current=e}return()=>{i(e),i(s)};function i(a){a.forEach(u=>{const d=jt(u);d?.removeEventListener("scroll",o)})}},[o,e]),l.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,i)=>De(s,i),ie):ar(e):ie,[e,t])}function vr(e,t){t===void 0&&(t=[]);const r=l.useRef(null);return l.useEffect(()=>{r.current=null},t),l.useEffect(()=>{const n=e!==ie;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?ot(e,r.current):ie}function Jn(e){l.useEffect(()=>{if(!rt)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r?.()}},e.map(t=>{let{sensor:r}=t;return r}))}function Kn(e,t){return l.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:s}=n;return r[o]=i=>{s(i,t)},r},{}),[e,t])}function br(e){return l.useMemo(()=>e?wn(e):null,[e])}const xr=[];function Qn(e,t){t===void 0&&(t=Ae);const[r]=e,n=br(r?K(r):null),[o,s]=l.useState(xr);function i(){s(()=>e.length?e.map(u=>sr(u)?n:new Nt(t(u),u)):xr)}const a=at({callback:i});return ce(()=>{a?.disconnect(),i(),e.forEach(u=>a?.observe(u))},[e]),o}function Zn(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Be(t)?t:e}function eo(e){let{measure:t}=e;const[r,n]=l.useState(null),o=l.useCallback(d=>{for(const{target:g}of d)if(Be(g)){n(h=>{const b=t(g);return h?{...h,width:b.width,height:b.height}:b});break}},[t]),s=at({callback:o}),i=l.useCallback(d=>{const g=Zn(d);s?.disconnect(),g&&s?.observe(g),n(g?t(g):null)},[t,s]),[a,u]=nt(i);return l.useMemo(()=>({nodeRef:a,rect:r,setRef:u}),[r,a,u])}const to=[{sensor:Mt,options:{}},{sensor:At,options:{}}],ro={current:{}},lt={draggable:{measure:tr},droppable:{measure:tr,strategy:qe.WhileDragging,frequency:kt.Optimized},dragOverlay:{measure:Ae}};class Xe extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const no={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Xe,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:st},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:lt,measureDroppableContainers:st,windowRect:null,measuringScheduled:!1},oo={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:st,draggableNodes:new Map,over:null,measureDroppableContainers:st},ct=l.createContext(oo),mr=l.createContext(no);function so(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Xe}}}function io(e,t){switch(t.type){case F.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case F.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 F.DragEnd:case F.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case F.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new Xe(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case F.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,s=e.droppable.containers.get(r);if(!s||n!==s.key)return e;const i=new Xe(e.droppable.containers);return i.set(r,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case F.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const s=new Xe(e.droppable.containers);return s.delete(r),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function ao(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=l.useContext(ct),s=mt(n),i=mt(r?.id);return l.useEffect(()=>{if(!t&&!n&&s&&i!=null){if(!wt(s)||document.activeElement===s.target)return;const a=o.get(i);if(!a)return;const{activatorNode:u,node:d}=a;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const g of[u.current,d.current]){if(!g)continue;const h=Jr(g);if(h){h.focus();break}}})}},[n,t,o,i,s]),null}function lo(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...n}),r):r}function co(e){return l.useMemo(()=>({draggable:{...lt.draggable,...e?.draggable},droppable:{...lt.droppable,...e?.droppable},dragOverlay:{...lt.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function uo(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const s=l.useRef(!1),{x:i,y:a}=typeof o=="boolean"?{x:o,y:o}:o;ce(()=>{if(!i&&!a||!t){s.current=!1;return}if(s.current||!n)return;const d=t?.node.current;if(!d||d.isConnected===!1)return;const g=r(d),h=er(g,n);if(i||(h.x=0),a||(h.y=0),s.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const b=rr(d);b&&b.scrollBy({top:h.y,left:h.x})}},[t,i,a,n,r])}const yr=l.createContext({...ie,scaleX:1,scaleY:1});var ve;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ve||(ve={}));const fo=l.memo(function(t){var r,n,o,s;let{id:i,accessibility:a,autoScroll:u=!0,children:d,sensors:g=to,collisionDetection:h=gn,measuring:b,modifiers:p,...S}=t;const x=l.useReducer(io,void 0,so),[m,C]=x,[D,E]=rn(),[N,M]=l.useState(ve.Uninitialized),I=N===ve.Initialized,{draggable:{active:y,nodes:j,translate:A},droppable:{containers:_}}=m,T=y!=null?j.get(y):null,Y=l.useRef({initial:null,translated:null}),z=l.useMemo(()=>{var H;return y!=null?{id:y,data:(H=T?.data)!=null?H:ro,rect:Y}:null},[y,T]),W=l.useRef(null),[B,le]=l.useState(null),[q,je]=l.useState(null),ne=Fe(S,Object.values(S)),be=Ge("DndDescribedBy",i),f=l.useMemo(()=>_.getEnabled(),[_]),w=co(b),{droppableRects:O,measureDroppableContainers:R,measuringScheduled:ue}=Gn(f,{dragging:I,dependencies:[A.x,A.y],config:w.droppable}),X=Fn(j,y),$=l.useMemo(()=>q?St(q):null,[q]),J=ts(),Q=Vn(X,w.draggable.measure);uo({activeNode:y!=null?j.get(y):null,config:J.layoutShiftCompensation,initialRect:Q,measure:w.draggable.measure});const L=gr(X,w.draggable.measure,Q),He=gr(X?X.parentElement:null),de=l.useRef({activatorEvent:null,active:null,activeNode:X,collisionRect:null,collisions:null,droppableRects:O,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:_,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Te=_.getNodeFor((r=de.current.over)==null?void 0:r.id),ge=eo({measure:w.dragOverlay.measure}),Oe=(n=ge.nodeRef.current)!=null?n:X,ke=I?(o=ge.rect)!=null?o:L:null,Ir=!!(ge.nodeRef.current&&ge.rect),Mr=qn(Ir?null:L),$t=br(Oe?K(Oe):null),xe=Xn(I?Te??X:null),ft=Qn(xe),ht=lo(p,{transform:{x:A.x-Mr.x,y:A.y-Mr.y,scaleX:1,scaleY:1},activatorEvent:q,active:z,activeNodeRect:L,containerNodeRect:He,draggingNodeRect:ke,over:de.current.over,overlayNodeRect:ge.rect,scrollableAncestors:xe,scrollableAncestorRects:ft,windowRect:$t}),Tr=$?De($,A):null,Or=Hn(xe),Xo=vr(Or),Ho=vr(Or,[L]),Le=De(ht,Xo),Re=ke?bn(ke,ht):null,Je=z&&Re?h({active:z,collisionRect:Re,droppableRects:O,droppableContainers:f,pointerCoordinates:Tr}):null,kr=dn(Je,"id"),[me,Lr]=l.useState(null),Jo=Ir?ht:De(ht,Ho),Ko=pn(Jo,(s=me?.rect)!=null?s:null,L),zt=l.useRef(null),Rr=l.useCallback((H,Z)=>{let{sensor:ee,options:ye}=Z;if(W.current==null)return;const oe=j.get(W.current);if(!oe)return;const te=H.nativeEvent,fe=new ee({active:W.current,activeNode:oe,event:te,options:ye,context:de,onAbort(U){if(!j.get(U))return;const{onDragAbort:he}=ne.current,pe={id:U};he?.(pe),D({type:"onDragAbort",event:pe})},onPending(U,we,he,pe){if(!j.get(U))return;const{onDragPending:Qe}=ne.current,Se={id:U,constraint:we,initialCoordinates:he,offset:pe};Qe?.(Se),D({type:"onDragPending",event:Se})},onStart(U){const we=W.current;if(we==null)return;const he=j.get(we);if(!he)return;const{onDragStart:pe}=ne.current,Ke={activatorEvent:te,active:{id:we,data:he.data,rect:Y}};_e.unstable_batchedUpdates(()=>{pe?.(Ke),M(ve.Initializing),C({type:F.DragStart,initialCoordinates:U,active:we}),D({type:"onDragStart",event:Ke}),le(zt.current),je(te)})},onMove(U){C({type:F.DragMove,coordinates:U})},onEnd:Pe(F.DragEnd),onCancel:Pe(F.DragCancel)});zt.current=fe;function Pe(U){return async function(){const{active:he,collisions:pe,over:Ke,scrollAdjustedTranslate:Qe}=de.current;let Se=null;if(he&&Qe){const{cancelDrop:Ze}=ne.current;Se={activatorEvent:te,active:he,collisions:pe,delta:Qe,over:Ke},U===F.DragEnd&&typeof Ze=="function"&&await Promise.resolve(Ze(Se))&&(U=F.DragCancel)}W.current=null,_e.unstable_batchedUpdates(()=>{C({type:U}),M(ve.Uninitialized),Lr(null),le(null),je(null),zt.current=null;const Ze=U===F.DragEnd?"onDragEnd":"onDragCancel";if(Se){const Bt=ne.current[Ze];Bt?.(Se),D({type:Ze,event:Se})}})}}},[j]),Qo=l.useCallback((H,Z)=>(ee,ye)=>{const oe=ee.nativeEvent,te=j.get(ye);if(W.current!==null||!te||oe.dndKit||oe.defaultPrevented)return;const fe={active:te};H(ee,Z.options,fe)===!0&&(oe.dndKit={capturedBy:Z.sensor},W.current=ye,Rr(ee,Z))},[j,Rr]),Pr=Yn(g,Qo);Jn(g),ce(()=>{L&&N===ve.Initializing&&M(ve.Initialized)},[L,N]),l.useEffect(()=>{const{onDragMove:H}=ne.current,{active:Z,activatorEvent:ee,collisions:ye,over:oe}=de.current;if(!Z||!ee)return;const te={active:Z,activatorEvent:ee,collisions:ye,delta:{x:Le.x,y:Le.y},over:oe};_e.unstable_batchedUpdates(()=>{H?.(te),D({type:"onDragMove",event:te})})},[Le.x,Le.y]),l.useEffect(()=>{const{active:H,activatorEvent:Z,collisions:ee,droppableContainers:ye,scrollAdjustedTranslate:oe}=de.current;if(!H||W.current==null||!Z||!oe)return;const{onDragOver:te}=ne.current,fe=ye.get(kr),Pe=fe&&fe.rect.current?{id:fe.id,rect:fe.rect.current,data:fe.data,disabled:fe.disabled}:null,U={active:H,activatorEvent:Z,collisions:ee,delta:{x:oe.x,y:oe.y},over:Pe};_e.unstable_batchedUpdates(()=>{Lr(Pe),te?.(U),D({type:"onDragOver",event:U})})},[kr]),ce(()=>{de.current={activatorEvent:q,active:z,activeNode:X,collisionRect:Re,collisions:Je,droppableRects:O,draggableNodes:j,draggingNode:Oe,draggingNodeRect:ke,droppableContainers:_,over:me,scrollableAncestors:xe,scrollAdjustedTranslate:Le},Y.current={initial:ke,translated:Re}},[z,X,Je,Re,j,Oe,ke,O,_,me,xe,Le]),$n({...J,delta:A,draggingRect:Re,pointerCoordinates:Tr,scrollableAncestors:xe,scrollableAncestorRects:ft});const Zo=l.useMemo(()=>({active:z,activeNode:X,activeNodeRect:L,activatorEvent:q,collisions:Je,containerNodeRect:He,dragOverlay:ge,draggableNodes:j,droppableContainers:_,droppableRects:O,over:me,measureDroppableContainers:R,scrollableAncestors:xe,scrollableAncestorRects:ft,measuringConfiguration:w,measuringScheduled:ue,windowRect:$t}),[z,X,L,q,Je,He,ge,j,_,O,me,R,xe,ft,w,ue,$t]),es=l.useMemo(()=>({activatorEvent:q,activators:Pr,active:z,activeNodeRect:L,ariaDescribedById:{draggable:be},dispatch:C,draggableNodes:j,over:me,measureDroppableContainers:R}),[q,Pr,z,L,C,be,j,me,R]);return l.createElement(Kt.Provider,{value:E},l.createElement(ct.Provider,{value:es},l.createElement(mr.Provider,{value:Zo},l.createElement(yr.Provider,{value:Ko},d)),l.createElement(ao,{disabled:a?.restoreFocus===!1})),l.createElement(sn,{...a,hiddenTextDescribedById:be}));function ts(){const H=B?.autoScrollEnabled===!1,Z=typeof u=="object"?u.enabled===!1:u===!1,ee=I&&!H&&!Z;return typeof u=="object"?{...u,enabled:ee}:{enabled:ee}}}),ho=l.createContext(null),wr="button",go="Draggable";function po(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const s=Ge(go),{activators:i,activatorEvent:a,active:u,activeNodeRect:d,ariaDescribedById:g,draggableNodes:h,over:b}=l.useContext(ct),{role:p=wr,roleDescription:S="draggable",tabIndex:x=0}=o??{},m=u?.id===t,C=l.useContext(m?yr:ho),[D,E]=nt(),[N,M]=nt(),I=Kn(i,t),y=Fe(r);ce(()=>(h.set(t,{id:t,key:s,node:D,activatorNode:N,data:y}),()=>{const A=h.get(t);A&&A.key===s&&h.delete(t)}),[h,t]);const j=l.useMemo(()=>({role:p,tabIndex:x,"aria-disabled":n,"aria-pressed":m&&p===wr?!0:void 0,"aria-roledescription":S,"aria-describedby":g.draggable}),[n,p,x,m,S,g.draggable]);return{active:u,activatorEvent:a,activeNodeRect:d,attributes:j,isDragging:m,listeners:n?void 0:I,node:D,over:b,setNodeRef:E,setActivatorNodeRef:M,transform:C}}function vo(){return l.useContext(mr)}const bo="Droppable",xo={timeout:25};function mo(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const s=Ge(bo),{active:i,dispatch:a,over:u,measureDroppableContainers:d}=l.useContext(ct),g=l.useRef({disabled:r}),h=l.useRef(!1),b=l.useRef(null),p=l.useRef(null),{disabled:S,updateMeasurementsFor:x,timeout:m}={...xo,...o},C=Fe(x??n),D=l.useCallback(()=>{if(!h.current){h.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{d(Array.isArray(C.current)?C.current:[C.current]),p.current=null},m)},[m]),E=at({callback:D,disabled:S||!i}),N=l.useCallback((j,A)=>{E&&(A&&(E.unobserve(A),h.current=!1),j&&E.observe(j))},[E]),[M,I]=nt(N),y=Fe(t);return l.useEffect(()=>{!E||!M.current||(E.disconnect(),h.current=!1,E.observe(M.current))},[M,E]),l.useEffect(()=>(a({type:F.RegisterDroppable,element:{id:n,key:s,disabled:r,node:M,rect:b,data:y}}),()=>a({type:F.UnregisterDroppable,key:s,id:n})),[n]),l.useEffect(()=>{r!==g.current.disabled&&(a({type:F.SetDroppableDisabled,id:n,key:s,disabled:r}),g.current.disabled=r)},[n,s,r,a]),{active:i,rect:b,isOver:u?.id===n,node:M,over:u,setNodeRef:I}}function Lt(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function yo(e,t){return e.reduce((r,n,o)=>{const s=t.get(n);return s&&(r[o]=s),r},Array(e.length))}function ut(e){return e!==null&&e>=0}function wo(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function So(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Sr=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const s=Lt(t,n,r),i=t[o],a=s[o];return!a||!i?null:{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}},dt={scaleX:1,scaleY:1},Co=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:o,rects:s,overIndex:i}=e;const a=(t=s[r])!=null?t:n;if(!a)return null;if(o===r){const d=s[i];return d?{x:0,y:r<i?d.top+d.height-(a.top+a.height):d.top-a.top,...dt}:null}const u=jo(s,o,r);return o>r&&o<=i?{x:0,y:-a.height-u,...dt}:o<r&&o>=i?{x:0,y:a.height+u,...dt}:{x:0,y:0,...dt}};function jo(e,t,r){const n=e[t],o=e[t-1],s=e[t+1];return n?r<t?o?n.top-(o.top+o.height):s?s.top-(n.top+n.height):0:s?s.top-(n.top+n.height):o?n.top-(o.top+o.height):0:0}const Cr="Sortable",jr=l.createContext({activeIndex:-1,containerId:Cr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Sr,disabled:{draggable:!1,droppable:!1}});function Eo(e){let{children:t,id:r,items:n,strategy:o=Sr,disabled:s=!1}=e;const{active:i,dragOverlay:a,droppableRects:u,over:d,measureDroppableContainers:g}=vo(),h=Ge(Cr,r),b=a.rect!==null,p=l.useMemo(()=>n.map(I=>typeof I=="object"&&"id"in I?I.id:I),[n]),S=i!=null,x=i?p.indexOf(i.id):-1,m=d?p.indexOf(d.id):-1,C=l.useRef(p),D=!wo(p,C.current),E=m!==-1&&x===-1||D,N=So(s);ce(()=>{D&&S&&g(p)},[D,p,S,g]),l.useEffect(()=>{C.current=p},[p]);const M=l.useMemo(()=>({activeIndex:x,containerId:h,disabled:N,disableTransforms:E,items:p,overIndex:m,useDragOverlay:b,sortedRects:yo(p,u),strategy:o}),[x,h,N.draggable,N.droppable,E,p,m,u,b,o]);return l.createElement(jr.Provider,{value:M},t)}const No=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return Lt(r,n,o).indexOf(t)},Do=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:s,newIndex:i,previousItems:a,previousContainerId:u,transition:d}=e;return!d||!n||a!==s&&o===i?!1:r?!0:i!==o&&t===u},Ao={duration:200,easing:"ease"},Er="transform",Io=Ve.Transition.toString({property:Er,duration:0,easing:"linear"}),Mo={roleDescription:"sortable"};function To(e){let{disabled:t,index:r,node:n,rect:o}=e;const[s,i]=l.useState(null),a=l.useRef(r);return ce(()=>{if(!t&&r!==a.current&&n.current){const u=o.current;if(u){const d=Ae(n.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)&&i(g)}}r!==a.current&&(a.current=r)},[t,r,n,o]),l.useEffect(()=>{s&&i(null)},[s]),s}function Oo(e){let{animateLayoutChanges:t=Do,attributes:r,disabled:n,data:o,getNewIndex:s=No,id:i,strategy:a,resizeObserverConfig:u,transition:d=Ao}=e;const{items:g,containerId:h,activeIndex:b,disabled:p,disableTransforms:S,sortedRects:x,overIndex:m,useDragOverlay:C,strategy:D}=l.useContext(jr),E=ko(n,p),N=g.indexOf(i),M=l.useMemo(()=>({sortable:{containerId:h,index:N,items:g},...o}),[h,o,N,g]),I=l.useMemo(()=>g.slice(g.indexOf(i)),[g,i]),{rect:y,node:j,isOver:A,setNodeRef:_}=mo({id:i,data:M,disabled:E.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...u}}),{active:T,activatorEvent:Y,activeNodeRect:z,attributes:W,setNodeRef:B,listeners:le,isDragging:q,over:je,setActivatorNodeRef:ne,transform:be}=po({id:i,data:M,attributes:{...Mo,...r},disabled:E.draggable}),f=Wr(_,B),w=!!T,O=w&&!S&&ut(b)&&ut(m),R=!C&&q,ue=R&&O?be:null,$=O?ue??(a??D)({rects:x,activeNodeRect:z,activeIndex:b,overIndex:m,index:N}):null,J=ut(b)&&ut(m)?s({id:i,items:g,activeIndex:b,overIndex:m}):N,Q=T?.id,L=l.useRef({activeId:Q,items:g,newIndex:J,containerId:h}),He=g!==L.current.items,de=t({active:T,containerId:h,isDragging:q,isSorting:w,id:i,index:N,items:g,newIndex:L.current.newIndex,previousItems:L.current.items,previousContainerId:L.current.containerId,transition:d,wasDragging:L.current.activeId!=null}),Te=To({disabled:!de,index:N,node:j,rect:y});return l.useEffect(()=>{w&&L.current.newIndex!==J&&(L.current.newIndex=J),h!==L.current.containerId&&(L.current.containerId=h),g!==L.current.items&&(L.current.items=g)},[w,J,h,g]),l.useEffect(()=>{if(Q===L.current.activeId)return;if(Q!=null&&L.current.activeId==null){L.current.activeId=Q;return}const Oe=setTimeout(()=>{L.current.activeId=Q},50);return()=>clearTimeout(Oe)},[Q]),{active:T,activeIndex:b,attributes:W,data:M,rect:y,index:N,newIndex:J,items:g,isOver:A,isSorting:w,isDragging:q,listeners:le,node:j,overIndex:m,over:je,setNodeRef:f,setActivatorNodeRef:ne,setDroppableNodeRef:_,setDraggableNodeRef:B,transform:Te??$,transition:ge()};function ge(){if(Te||He&&L.current.newIndex===N)return Io;if(!(R&&!wt(Y)||!d)&&(w||de))return Ve.Transition.toString({...d,property:Er})}}function ko(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e?.draggable)!=null?r:t.draggable,droppable:(n=e?.droppable)!=null?n:t.droppable}}k.Down,k.Right,k.Up,k.Left;const Rt=new Map;function Ie(e){if(!e)return V.FileText;const t=Rt.get(e);if(t)return t;if(V[e])return Rt.set(e,V[e]),V[e];const r=e.split("-").filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("");return V[r]?(Rt.set(e,V[r]),V[r]):V.FileText}function ae(e,t){if(typeof e=="string")return e;if(t){const r=t(e.key,{defaultValue:e.defaultValue,...e.params});if(r&&r!==e.key)return r}return e.defaultValue||e.key}function Lo(e,t,r){const n=ae(e.label,r);return t&&e.type==="object"&&e.objectName&&typeof e.label=="string"?t(e.objectName,n):n}const Ro=e=>!(e===!1||e==="false"),Po=()=>!0;function _o(e,t){switch(e.type){case"object":{const r=`${t}/${e.objectName??""}`;return{href:e.viewName?`${r}/view/${e.viewName}`:r,external:!1}}case"dashboard":return{href:e.dashboardName?`${t}/dashboard/${e.dashboardName}`:"#",external:!1};case"page":return{href:e.pageName?`${t}/page/${e.pageName}`:"#",external:!1};case"report":return{href:e.reportName?`${t}/report/${e.reportName}`:"#",external:!1};case"url":return{href:e.url??"#",external:e.target==="_blank"};default:return{href:"#",external:!1}}}function Pt(e,t){if(!t.trim())return e;const r=t.toLowerCase().trim();return e.reduce((n,o)=>{if(o.type==="separator")return n;if(o.type==="group"&&o.children?.length){const s=Pt(o.children,t);return s.length>0&&n.push({...o,children:s}),n}return ae(o.label).toLowerCase().includes(r)&&n.push(o),n},[])}const $o=5;function zo({item:e,basePath:t,evalVis:r,checkPerm:n,onAction:o,enablePinning:s,onPinToggle:i,enableReorder:a,resolveObjectLabel:u,t:d}){const{attributes:g,listeners:h,setNodeRef:b,transform:p,transition:S,isDragging:x}=Oo({id:e.id,disabled:!a}),m={transform:Ve.Transform.toString(p),transition:S,opacity:x?.5:void 0,zIndex:x?10:void 0};return c.jsx("div",{ref:b,style:m,...g,children:c.jsx(Me,{item:e,basePath:t,evalVis:r,checkPerm:n,onAction:o,enablePinning:s,onPinToggle:i,dragListeners:a?h:void 0,resolveObjectLabel:u,t:d})})}function Me({item:e,basePath:t,evalVis:r,checkPerm:n,onAction:o,enablePinning:s,onPinToggle:i,dragListeners:a,resolveObjectLabel:u,t:d}){const g=Ce.useLocation(),[h,b]=l.useState(e.defaultOpen!==!1);if(!r(e.visible)||e.requiredPermissions?.length&&!n(e.requiredPermissions))return null;if(e.type==="separator")return c.jsx(v.Separator,{className:"my-2"});if(e.type==="group"){const E=(e.children??[]).slice().sort((N,M)=>(N.order??0)-(M.order??0));return c.jsx(v.Collapsible,{open:h,onOpenChange:b,children:c.jsxs(v.SidebarGroup,{children:[c.jsx(v.SidebarGroupLabel,{asChild:!0,children:c.jsxs(v.CollapsibleTrigger,{className:"flex w-full items-center justify-between",children:[ae(e.label,d),c.jsx(V.ChevronRight,{className:`ml-auto h-4 w-4 transition-transform ${h?"rotate-90":""}`})]})}),c.jsx(v.CollapsibleContent,{children:c.jsx(v.SidebarGroupContent,{children:c.jsx(v.SidebarMenu,{children:E.map(N=>c.jsx(Me,{item:N,basePath:t,evalVis:r,checkPerm:n,onAction:o,enablePinning:s,onPinToggle:i,resolveObjectLabel:u,t:d},N.id))})})})]})})}if(e.type==="action"){const E=Ie(e.icon);return c.jsxs(v.SidebarMenuItem,{children:[a&&c.jsx("span",{className:"absolute left-0.5 top-1/2 -translate-y-1/2 cursor-grab text-muted-foreground","aria-label":"Drag to reorder",...a,children:c.jsx(V.GripVertical,{className:"h-3.5 w-3.5"})}),c.jsxs(v.SidebarMenuButton,{tooltip:ae(e.label,d),onClick:()=>o?.(e),children:[c.jsx(E,{className:"h-4 w-4"}),c.jsx("span",{children:ae(e.label,d)}),e.badge!=null&&c.jsx(v.Badge,{variant:e.badgeVariant??"default",className:"ml-auto text-[10px] px-1.5 py-0",children:e.badge})]}),s&&i&&c.jsx(v.SidebarMenuAction,{showOnHover:!0,onClick:()=>i(e.id,!e.pinned),"aria-label":e.pinned?`Unpin ${ae(e.label,d)}`:`Pin ${ae(e.label,d)}`,children:e.pinned?c.jsx(V.PinOff,{className:"h-3.5 w-3.5"}):c.jsx(V.Pin,{className:"h-3.5 w-3.5"})})]})}const p=Ie(e.icon),{href:S,external:x}=_o(e,t),m=S!=="#"&&g.pathname.startsWith(S),C=Lo(e,u,d),D=c.jsxs(c.Fragment,{children:[c.jsx(p,{className:"h-4 w-4"}),c.jsx("span",{children:C}),e.badge!=null&&c.jsx(v.Badge,{variant:e.badgeVariant??"default",className:"ml-auto text-[10px] px-1.5 py-0",children:e.badge})]});return c.jsxs(v.SidebarMenuItem,{children:[a&&c.jsx("span",{className:"absolute left-0.5 top-1/2 -translate-y-1/2 cursor-grab text-muted-foreground","aria-label":"Drag to reorder",...a,children:c.jsx(V.GripVertical,{className:"h-3.5 w-3.5"})}),c.jsx(v.SidebarMenuButton,{asChild:!0,isActive:m,tooltip:C,children:x?c.jsx("a",{href:S,target:"_blank",rel:"noopener noreferrer",children:D}):c.jsx(Ce.Link,{to:S,children:D})}),s&&i&&c.jsx(v.SidebarMenuAction,{showOnHover:!0,onClick:()=>i(e.id,!e.pinned),"aria-label":e.pinned?`Unpin ${C}`:`Pin ${C}`,children:e.pinned?c.jsx(V.PinOff,{className:"h-3.5 w-3.5"}):c.jsx(V.Pin,{className:"h-3.5 w-3.5"})})]})}function _t({items:e,basePath:t="",evaluateVisibility:r=Ro,checkPermission:n=Po,onAction:o,searchQuery:s,enablePinning:i,onPinToggle:a,enableReorder:u,onReorder:d,resolveObjectLabel:g,t:h}){const b=l.useMemo(()=>s?Pt(e,s):e,[e,s]),p=l.useMemo(()=>Nr(b),[b]),S=b.slice().sort((y,j)=>(y.order??0)-(j.order??0)),x=an(Qt(Mt,{activationConstraint:{distance:$o}}),Qt(At)),m=y=>{const{active:j,over:A}=y;if(!A||j.id===A.id||!d)return;const _=S.findIndex(z=>z.id===j.id),T=S.findIndex(z=>z.id===A.id);if(_===-1||T===-1)return;const Y=Lt(S,_,T).map((z,W)=>({...z,order:W}));d(Y)},C={basePath:t,evalVis:r,checkPerm:n,onAction:o,enablePinning:i,onPinToggle:a,resolveObjectLabel:g,t:h},D=S.some(y=>y.type==="group"),E=p.length>0&&i?c.jsxs(v.SidebarGroup,{children:[c.jsxs(v.SidebarGroupLabel,{className:"flex items-center gap-1.5",children:[c.jsx(V.Star,{className:"h-3.5 w-3.5"}),"Favorites"]}),c.jsx(v.SidebarGroupContent,{children:c.jsx(v.SidebarMenu,{children:p.map(y=>c.jsx(Me,{item:y,...C},`fav-${y.id}`))})})]}):null;if(!D){const y=S.filter(A=>A.type!=="group").map(A=>A.id),j=u?c.jsx(fo,{sensors:x,collisionDetection:fn,onDragEnd:m,children:c.jsx(Eo,{items:y,strategy:Co,children:c.jsx(v.SidebarMenu,{children:S.map(A=>c.jsx(zo,{item:A,enableReorder:u,...C},A.id))})})}):c.jsx(v.SidebarMenu,{children:S.map(A=>c.jsx(Me,{item:A,...C},A.id))});return c.jsxs(c.Fragment,{children:[E,c.jsx(v.SidebarGroup,{children:c.jsx(v.SidebarGroupContent,{children:j})})]})}const N=[];let M=[];const I=y=>{if(M.length===0)return;const j=M;M=[],N.push(c.jsx(v.SidebarGroup,{children:c.jsx(v.SidebarGroupContent,{children:c.jsx(v.SidebarMenu,{children:j.map(A=>c.jsx(Me,{item:A,...C},A.id))})})},y))};return S.forEach((y,j)=>{y.type==="group"?(I(`leaf-${j}`),N.push(c.jsx(Me,{item:y,...C},y.id))):M.push(y)}),I("leaf-end"),c.jsxs(c.Fragment,{children:[E,N]})}function Nr(e){const t=[];for(const r of e)r.pinned&&r.type!=="group"&&r.type!=="separator"&&t.push(r),r.children?.length&&t.push(...Nr(r.children));return t}function Bo({areas:e,activeAreaId:t,onAreaChange:r,evalVis:n,checkPerm:o}){const s=e.filter(i=>!(!n(i.visible)||i.requiredPermissions?.length&&!o(i.requiredPermissions)));return s.length<=1?null:c.jsxs(v.SidebarGroup,{children:[c.jsxs(v.SidebarGroupLabel,{className:"flex items-center gap-1.5",children:[c.jsx(V.Layers,{className:"h-3.5 w-3.5"}),"Area"]}),c.jsx(v.SidebarGroupContent,{children:c.jsx(v.SidebarMenu,{children:s.map(i=>{const a=Ie(i.icon);return c.jsx(v.SidebarMenuItem,{children:c.jsxs(v.SidebarMenuButton,{isActive:i.id===t,tooltip:ae(i.label),onClick:()=>r(i.id),children:[c.jsx(a,{className:"h-4 w-4"}),c.jsx("span",{children:ae(i.label)})]})},i.id)})})})]})}function Fo({items:e,basePath:t}){const r=Ce.useLocation(),n=e.filter(o=>o.type!=="group"&&o.type!=="separator").slice(0,5);return n.length===0?null:c.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-50 flex items-center justify-around border-t bg-background/95 backdrop-blur-sm px-2 py-1 sm:hidden safe-area-bottom",role:"navigation","aria-label":"Mobile navigation",children:n.map(o=>{const s=Ie(o.icon);let i="#";o.type==="object"?(i=`${t}/${o.objectName}`,o.viewName&&(i+=`/view/${o.viewName}`)):o.type==="dashboard"?i=o.dashboardName?`${t}/dashboard/${o.dashboardName}`:"#":o.type==="page"?i=o.pageName?`${t}/page/${o.pageName}`:"#":o.type==="report"?i=o.reportName?`${t}/report/${o.reportName}`:"#":o.type==="url"&&(i=o.url??"#");const a=i!=="#"&&r.pathname.startsWith(i);return c.jsxs(Ce.Link,{to:i,className:`flex flex-col items-center gap-0.5 px-2 py-1.5 transition-colors min-w-[44px] min-h-[44px] justify-center ${a?"text-primary":"text-muted-foreground hover:text-foreground"}`,children:[c.jsx(s,{className:"h-5 w-5"}),c.jsx("span",{className:"text-[10px] truncate max-w-[60px]",children:ae(o.label)})]},o.id)})})}function Yo({schema:e,basePath:t,evalVis:r,checkPerm:n,onAction:o,sidebarHeader:s,sidebarFooter:i,sidebarExtra:a,activeAreaId:u,setActiveAreaId:d,resolvedNavigation:g,enableSearch:h,enablePinning:b,onPinToggle:p,enableReorder:S,onReorder:x}){const m=Ie(e.logo),C=e.areas??[],[D,E]=l.useState("");return c.jsxs(v.Sidebar,{collapsible:"icon",children:[c.jsxs(v.SidebarHeader,{children:[s??c.jsx(v.SidebarMenu,{children:c.jsx(v.SidebarMenuItem,{children:c.jsxs(v.SidebarMenuButton,{size:"lg",tooltip:e.title??e.name,children:[c.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-primary text-primary-foreground",children:e.logo&&e.logo.startsWith("http")?c.jsx("img",{src:e.logo,alt:e.title??"",className:"size-6 object-contain"}):c.jsx(m,{className:"size-4"})}),c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[c.jsx("span",{className:"truncate font-semibold",children:e.title??e.name??"App"}),e.description&&c.jsx("span",{className:"truncate text-xs text-muted-foreground",children:e.description})]})]})})}),h&&c.jsx(v.SidebarInput,{placeholder:"Search navigation…",value:D,onChange:N=>E(N.target.value),"aria-label":"Search navigation"})]}),c.jsxs(v.SidebarContent,{children:[C.length>1&&u&&c.jsx(Bo,{areas:C,activeAreaId:u,onAreaChange:d,evalVis:r,checkPerm:n}),c.jsx(_t,{items:g,basePath:t,evaluateVisibility:r,checkPermission:n,onAction:o,searchQuery:D,enablePinning:b,onPinToggle:p,enableReorder:S,onReorder:x}),a]}),i&&c.jsx(v.SidebarFooter,{children:i})]})}function Dr({schema:e,basePath:t="",mobileNavMode:r="drawer",evaluateVisibility:n,checkPermission:o,onAction:s,navbar:i,sidebarHeader:a,sidebarFooter:u,sidebarExtra:d,children:g,className:h,defaultOpen:b=!0,enableSearch:p,enablePinning:S,onPinToggle:x,enableReorder:m,onReorder:C}){const D=n??(B=>!(B===!1||B==="false")),E=o??(()=>!0),N=l.useMemo(()=>(e.menu??[]).map((B,le)=>_r.menuItemToNavigationItem(B,le)),[e.menu]),M=e.navigation??N,I=e.areas??[],[y,j]=l.useState(()=>I.length>0?I[0].id:null),A=I.map(B=>B.id).join(",");l.useEffect(()=>{I.length>0?j(B=>I.some(le=>le.id===B)?B:I[0].id):j(null)},[e.name,A]);const T=I.find(B=>B.id===y)?.navigation??M,Y={title:e.title,favicon:e.favicon,logo:e.logo},z=c.jsx(Yo,{schema:e,basePath:t,evalVis:D,checkPerm:E,onAction:s,sidebarHeader:a,sidebarFooter:u,sidebarExtra:d,activeAreaId:y,setActiveAreaId:j,resolvedNavigation:T,enableSearch:p,enablePinning:S,onPinToggle:x,enableReorder:m,onReorder:C}),W=r==="bottom_nav";return c.jsxs(c.Fragment,{children:[c.jsx(pt,{sidebar:z,navbar:i,className:h,defaultOpen:b,branding:Y,children:g}),W&&c.jsx(Fo,{items:T,basePath:t})]})}const Go=e=>e?Array.isArray(e)?e:[e]:[];function Vo({schema:e,className:t,style:r,id:n,...o}){const s=Go(e.children);return c.jsxs("div",{id:n||e.id,className:v.cn("flex flex-col h-full space-y-4",t),style:r,children:[c.jsx(tt,{title:e.title,description:e.description}),c.jsx("div",{className:"flex-1 overflow-auto",children:s.map((i,a)=>c.jsx($r.SchemaRenderer,{schema:i,...o},i?.id||a))})]})}function Uo(e){return"items"in e&&!("href"in e)}function Wo({item:e,pathname:t}){return e.children&&e.children.length>0?c.jsx(v.Collapsible,{asChild:!0,defaultOpen:!0,className:"group/collapsible",children:c.jsxs(v.SidebarMenuItem,{children:[c.jsx(v.CollapsibleTrigger,{asChild:!0,children:c.jsxs(v.SidebarMenuButton,{tooltip:e.title,children:[e.icon&&c.jsx(e.icon,{}),c.jsx("span",{children:e.title}),e.badge!=null&&c.jsx(v.Badge,{variant:e.badgeVariant||"default",className:"ml-auto mr-1 h-5 min-w-5 px-1 text-xs",children:e.badge}),c.jsx(gt.ChevronRight,{className:"ml-auto h-4 w-4 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),c.jsx(v.CollapsibleContent,{children:c.jsx(v.SidebarMenuSub,{children:e.children.map(r=>c.jsx(v.SidebarMenuSubItem,{children:c.jsx(v.SidebarMenuSubButton,{asChild:!0,isActive:t===r.href,children:c.jsxs(Ce.NavLink,{to:r.href,children:[r.icon&&c.jsx(r.icon,{}),c.jsx("span",{children:r.title}),r.badge!=null&&c.jsx(v.Badge,{variant:r.badgeVariant||"default",className:"ml-auto h-5 min-w-5 px-1 text-xs",children:r.badge})]})})},r.href))})})]})}):c.jsx(v.SidebarMenuItem,{children:c.jsx(v.SidebarMenuButton,{asChild:!0,isActive:t===e.href,tooltip:e.title,children:c.jsxs(Ce.NavLink,{to:e.href,children:[e.icon&&c.jsx(e.icon,{}),c.jsx("span",{children:e.title}),e.badge!=null&&c.jsx(v.Badge,{variant:e.badgeVariant||"default",className:"ml-auto h-5 min-w-5 px-1 text-xs",children:e.badge})]})})})}function qo({items:e,title:t="Application",className:r,collapsible:n="icon",searchEnabled:o=!1,searchPlaceholder:s="Search..."}){const i=Ce.useLocation(),[a,u]=l.useState(""),d=l.useMemo(()=>e.length===0?[]:Uo(e[0])?e.map(h=>({groupLabel:h.label,items:h.items})):[{items:e}],[e]),g=l.useMemo(()=>{if(!a)return d;const h=a.toLowerCase();return d.map(b=>({...b,items:b.items.filter(p=>p.title.toLowerCase().includes(h)||p.children?.some(S=>S.title.toLowerCase().includes(h)))})).filter(b=>b.items.length>0)},[d,a]);return c.jsx(v.Sidebar,{className:r,collapsible:n,children:c.jsxs(v.SidebarContent,{children:[o&&c.jsx("div",{className:"px-3 py-2",children:c.jsxs("div",{className:"relative",children:[c.jsx(gt.Search,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),c.jsx(v.Input,{type:"search",placeholder:s,value:a,onChange:h=>u(h.target.value),className:"pl-8 h-9"})]})}),g.map((h,b)=>c.jsxs(v.SidebarGroup,{children:[c.jsx(v.SidebarGroupLabel,{children:h.groupLabel||t}),c.jsx(v.SidebarGroupContent,{children:c.jsx(v.SidebarMenu,{children:h.items.map(p=>c.jsx(Wo,{item:p,pathname:i.pathname},p.href))})})]},h.groupLabel||b))]})})}function Ar(){se.ComponentRegistry.register("page-header",tt,{namespace:"layout",label:"Page Header",category:"Layout",inputs:[{name:"title",type:"string"},{name:"description",type:"string"}]}),se.ComponentRegistry.register("page:header",tt,{namespace:"layout"}),se.ComponentRegistry.register("page:card",Wt,{namespace:"layout",label:"Page Card",category:"Layout",isContainer:!0}),se.ComponentRegistry.register("app-shell",pt,{namespace:"layout",label:"App Shell",category:"Layout"}),se.ComponentRegistry.register("responsive-grid",qt,{namespace:"layout",label:"Responsive Grid",category:"Layout",isContainer:!0,inputs:[{name:"columns",type:"object"},{name:"gap",type:"number"}]}),se.ComponentRegistry.register("navigation-renderer",_t,{namespace:"layout",label:"Navigation Renderer",category:"Layout",inputs:[{name:"items",type:"object"},{name:"basePath",type:"string"}]}),se.ComponentRegistry.register("app-schema-renderer",Dr,{namespace:"layout",label:"App Schema Renderer",category:"Layout",isContainer:!0,inputs:[{name:"schema",type:"object"},{name:"basePath",type:"string"},{name:"mobileNavMode",type:"string"}]})}try{Ar()}catch{}P.AppSchemaRenderer=Dr,P.AppShell=pt,P.NavigationRenderer=_t,P.Page=Vo,P.PageCard=Wt,P.PageHeader=tt,P.ResponsiveGrid=qt,P.SidebarNav=qo,P.filterNavigationItems=Pt,P.registerLayout=Ar,P.resolveIcon=Ie,P.resolveLabel=ae,P.useAppShellBranding=Ut,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/layout",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.umd.cjs",
@@ -18,14 +18,14 @@
18
18
  "@dnd-kit/sortable": "^10.0.0",
19
19
  "@dnd-kit/utilities": "^3.2.2",
20
20
  "clsx": "^2.1.1",
21
- "lucide-react": "^0.576.0",
21
+ "lucide-react": "^0.577.0",
22
22
  "react": "19.2.4",
23
23
  "react-dom": "19.2.4",
24
24
  "tailwind-merge": "^3.5.0",
25
- "@object-ui/components": "3.1.1",
26
- "@object-ui/core": "3.1.1",
27
- "@object-ui/react": "3.1.1",
28
- "@object-ui/types": "3.1.1"
25
+ "@object-ui/components": "3.1.3",
26
+ "@object-ui/core": "3.1.3",
27
+ "@object-ui/react": "3.1.3",
28
+ "@object-ui/types": "3.1.3"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "react": "^18.0.0 || ^19.0.0",
@@ -449,7 +449,7 @@ function NavigationItemRenderer({
449
449
  </SidebarMenuButton>
450
450
  {enablePinning && onPinToggle && (
451
451
  <SidebarMenuAction
452
- showOnHover={!item.pinned}
452
+ showOnHover
453
453
  onClick={() => onPinToggle(item.id, !item.pinned)}
454
454
  aria-label={item.pinned ? `Unpin ${resolveLabel(item.label, tProp)}` : `Pin ${resolveLabel(item.label, tProp)}`}
455
455
  >
@@ -502,7 +502,7 @@ function NavigationItemRenderer({
502
502
  </SidebarMenuButton>
503
503
  {enablePinning && onPinToggle && (
504
504
  <SidebarMenuAction
505
- showOnHover={!item.pinned}
505
+ showOnHover
506
506
  onClick={() => onPinToggle(item.id, !item.pinned)}
507
507
  aria-label={item.pinned ? `Unpin ${itemLabel}` : `Pin ${itemLabel}`}
508
508
  >