@principal-ade/panels 1.0.55 → 1.0.56
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.
|
@@ -9,18 +9,26 @@ export interface CollapsedHeaderConfig {
|
|
|
9
9
|
export interface CollapsibleSplitPaneProps {
|
|
10
10
|
/** Content for the primary panel (bottom, always visible) */
|
|
11
11
|
primaryContent: ReactNode;
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Content for the secondary panel (top, collapsible).
|
|
14
|
+
* When undefined/null, the component renders only the primary content
|
|
15
|
+
* without any split pane UI - useful as a stable wrapper that can
|
|
16
|
+
* later receive secondary content without remounting.
|
|
17
|
+
*/
|
|
18
|
+
secondaryContent?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Configuration for the collapsed header bar.
|
|
21
|
+
* Required when secondaryContent is provided.
|
|
22
|
+
*/
|
|
23
|
+
collapsedHeader?: CollapsedHeaderConfig;
|
|
16
24
|
/** Whether the secondary panel is collapsed */
|
|
17
|
-
collapsed
|
|
25
|
+
collapsed?: boolean;
|
|
18
26
|
/** Callback when collapsed state changes */
|
|
19
|
-
onCollapsedChange
|
|
27
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
20
28
|
/** Split ratio (0-1) - proportion of space for secondary panel when expanded */
|
|
21
|
-
ratio
|
|
29
|
+
ratio?: number;
|
|
22
30
|
/** Callback when ratio changes via drag */
|
|
23
|
-
onRatioChange
|
|
31
|
+
onRatioChange?: (ratio: number) => void;
|
|
24
32
|
/** Minimum ratio for secondary panel (default: 0.1) */
|
|
25
33
|
minRatio?: number;
|
|
26
34
|
/** Maximum ratio for secondary panel (default: 0.8) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsibleSplitPane.d.ts","sourceRoot":"","sources":["../../src/components/CollapsibleSplitPane.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,SAAS,EAKV,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAEtD,OAAO,4BAA4B,CAAC;AAEpC,MAAM,WAAW,qBAAqB;IACpC,8CAA8C;IAC9C,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAAyB;IACxC,6DAA6D;IAC7D,cAAc,EAAE,SAAS,CAAC;IAE1B
|
|
1
|
+
{"version":3,"file":"CollapsibleSplitPane.d.ts","sourceRoot":"","sources":["../../src/components/CollapsibleSplitPane.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,SAAS,EAKV,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAEtD,OAAO,4BAA4B,CAAC;AAEpC,MAAM,WAAW,qBAAqB;IACpC,8CAA8C;IAC9C,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAAyB;IACxC,6DAA6D;IAC7D,cAAc,EAAE,SAAS,CAAC;IAE1B;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAE7B;;;OAGG;IACH,eAAe,CAAC,EAAE,qBAAqB,CAAC;IAExC,+CAA+C;IAC/C,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAEjD,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,2CAA2C;IAC3C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAExC,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,6DAA6D;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,0CAA0C;IAC1C,KAAK,EAAE,KAAK,CAAC;IAEb,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,kDAAkD;IAClD,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAE5B,wDAAwD;IACxD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,8CAA8C;IAC9C,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAE7B,iDAAiD;IACjD,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAEhC,4CAA4C;IAC5C,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAE3B,+CAA+C;IAC/C,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA2DpE,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import r,{useState as o,useRef as i,useCallback as a,useEffect as l,createContext as s,useContext as c,forwardRef as d,useImperativeHandle as u,useMemo as p,useLayoutEffect as h,memo as m,useReducer as f}from"react";import{PanelGroup as g,Panel as v,PanelResizeHandle as b}from"react-resizable-panels";import{flushSync as y,unstable_batchedUpdates as w,createPortal as x}from"react-dom";import{useTheme as C}from"@principal-ade/industry-theme";function S(e){return{"--panel-background":e.colors.background,"--panel-border":e.colors.border,"--panel-handle":e.colors.backgroundSecondary,"--panel-handle-hover":e.colors.backgroundHover,"--panel-handle-active":e.colors.primary,"--panel-button-bg":e.colors.surface,"--panel-button-hover":e.colors.backgroundHover,"--panel-button-border":e.colors.border,"--panel-button-icon":e.colors.textSecondary,"--panel-accent-bg":e.colors.primary+"15"}}function R(e){return{"--tab-list-bg":e.colors.backgroundSecondary,"--tab-border":e.colors.border,"--tab-bg":e.colors.surface,"--tab-bg-hover":e.colors.backgroundHover,"--tab-bg-active":e.colors.primary,"--tab-text":e.colors.textSecondary,"--tab-text-hover":e.colors.text,"--tab-text-active":e.colors.background,"--tab-icon-color":e.colors.textTertiary,"--tab-icon-active":e.colors.background,"--tab-border-hover":e.colors.textSecondary,"--tab-border-active":e.colors.primary,"--tab-focus":e.colors.primary,"--tab-content-bg":e.colors.background,"--tab-empty-text":e.colors.textMuted,"--tab-font-family":e.fonts.body,"--tab-font-size":"11px","--tab-font-weight":String(e.fontWeights.medium),"--mobile-tab-text-active":e.colors.primary,"--mobile-tab-icon-active":e.colors.primary}}const N=({leftPanel:n,rightPanel:r,collapsibleSide:s="left",defaultSize:c=25,minSize:d=5,className:u="",collapsed:p=!1,style:h,showCollapseButton:m=!1,animationDuration:f=300,animationEasing:y="cubic-bezier(0.4, 0, 0.2, 1)",onCollapseStart:w,onCollapseComplete:x,onExpandStart:C,onExpandComplete:R,theme:N})=>{const[E,
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import r,{useState as o,useRef as i,useCallback as a,useEffect as l,createContext as s,useContext as c,forwardRef as d,useImperativeHandle as u,useMemo as p,useLayoutEffect as h,memo as m,useReducer as f}from"react";import{PanelGroup as g,Panel as v,PanelResizeHandle as b}from"react-resizable-panels";import{flushSync as y,unstable_batchedUpdates as w,createPortal as x}from"react-dom";import{useTheme as C}from"@principal-ade/industry-theme";function S(e){return{"--panel-background":e.colors.background,"--panel-border":e.colors.border,"--panel-handle":e.colors.backgroundSecondary,"--panel-handle-hover":e.colors.backgroundHover,"--panel-handle-active":e.colors.primary,"--panel-button-bg":e.colors.surface,"--panel-button-hover":e.colors.backgroundHover,"--panel-button-border":e.colors.border,"--panel-button-icon":e.colors.textSecondary,"--panel-accent-bg":e.colors.primary+"15"}}function R(e){return{"--tab-list-bg":e.colors.backgroundSecondary,"--tab-border":e.colors.border,"--tab-bg":e.colors.surface,"--tab-bg-hover":e.colors.backgroundHover,"--tab-bg-active":e.colors.primary,"--tab-text":e.colors.textSecondary,"--tab-text-hover":e.colors.text,"--tab-text-active":e.colors.background,"--tab-icon-color":e.colors.textTertiary,"--tab-icon-active":e.colors.background,"--tab-border-hover":e.colors.textSecondary,"--tab-border-active":e.colors.primary,"--tab-focus":e.colors.primary,"--tab-content-bg":e.colors.background,"--tab-empty-text":e.colors.textMuted,"--tab-font-family":e.fonts.body,"--tab-font-size":"11px","--tab-font-weight":String(e.fontWeights.medium),"--mobile-tab-text-active":e.colors.primary,"--mobile-tab-icon-active":e.colors.primary}}const N=({leftPanel:n,rightPanel:r,collapsibleSide:s="left",defaultSize:c=25,minSize:d=5,className:u="",collapsed:p=!1,style:h,showCollapseButton:m=!1,animationDuration:f=300,animationEasing:y="cubic-bezier(0.4, 0, 0.2, 1)",onCollapseStart:w,onCollapseComplete:x,onExpandStart:C,onExpandComplete:R,theme:N})=>{const[E,D]=o(p),[z,M]=o(!1),[T,A]=o(!1),[k,L]=o(p),[P,F]=o(p?0:c),$=i(null),B=i(void 0),O=i(void 0),I=i(void 0),q=a((e,t,n)=>{if(!$.current)return;B.current&&cancelAnimationFrame(B.current),O.current=performance.now();const r=o=>{if(!O.current||!$.current)return;const i=o-O.current,a=Math.min(i/f,1),l=a<.5?4*a*a*a:1-Math.pow(-2*a+2,3)/2,s=e+(t-e)*l;$.current.resize(s),a<1?B.current=requestAnimationFrame(r):(0===t?$.current.collapse():$.current.resize(t),M(!1),n&&n())};B.current=requestAnimationFrame(r)},[f]),H=a(()=>{z||T||(M(!0),D(!0),w&&w(),q(P,0,()=>{F(0),L(!0),x&&x()}))},[z,T,P,q,w,x]),W=a(()=>{z||T||(M(!0),D(!1),L(!1),C&&C(),q(0,c,()=>{F(c),R&&R()}))},[z,T,c,q,C,R]),j=a(()=>{E?W():H()},[E,H,W]),K=a(e=>{z||(F(e),e>0&&D(!1))},[z]),U=a(()=>{A(!0)},[]),X=a(()=>{A(!1)},[]);l(()=>{p!==E&&(p?H():W())},[p]),l(()=>{p&&!z?L(!0):p||z||L(!1)},[p,z]),l(()=>{const e=B.current,t=I.current;return()=>{e&&cancelAnimationFrame(e),t&&clearTimeout(t)}},[]);const Y="left"===s,V=E?Y?"▸":"◂":Y?"◂":"▸",J=S(N),G=z&&!T?{transition:`flex ${f}ms ${y}`}:void 0,_=e=>{let t="hybrid-panel";return e&&(t+=" collapsible-panel",z&&!T&&(t+=" animating"),E&&(t+=" collapsed")),t};/* @__PURE__ */
|
|
2
2
|
return e("div",{className:`animated-resizable-layout ${u}`,style:{...J,...h},children:/* @__PURE__ */t(g,{direction:"horizontal",onLayout:X,children:[
|
|
3
|
-
/* @__PURE__ */e(v,{ref:Y?$:void 0,collapsible:Y,defaultSize:Y?p?0:c:void 0,minSize:Y?d:30,collapsedSize:0,onResize:Y?K:void 0,onCollapse:Y?()=>
|
|
4
|
-
/* @__PURE__ */e(b,{className:"resize-handle "+(k?"collapsed":""),onDragging:U,style:k?{visibility:"hidden",width:0}:void 0,children:m&&/* @__PURE__ */e("div",{className:"handle-bar",children:/* @__PURE__ */e("button",{onClick:
|
|
5
|
-
/* @__PURE__ */e(v,{ref:Y?void 0:$,collapsible:!Y,defaultSize:Y?void 0:p?0:c,minSize:Y?30:d,collapsedSize:0,onResize:Y?void 0:K,onCollapse:Y?void 0:()=>
|
|
3
|
+
/* @__PURE__ */e(v,{ref:Y?$:void 0,collapsible:Y,defaultSize:Y?p?0:c:void 0,minSize:Y?d:30,collapsedSize:0,onResize:Y?K:void 0,onCollapse:Y?()=>D(!0):void 0,onExpand:Y?()=>D(!1):void 0,className:_(Y),style:Y?G:void 0,children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:Y&&E?0:1,transition:z?`opacity ${.5*f}ms ${y}`:"none"},children:n})}),
|
|
4
|
+
/* @__PURE__ */e(b,{className:"resize-handle "+(k?"collapsed":""),onDragging:U,style:k?{visibility:"hidden",width:0}:void 0,children:m&&/* @__PURE__ */e("div",{className:"handle-bar",children:/* @__PURE__ */e("button",{onClick:j,className:"collapse-toggle",disabled:z,"aria-label":E?"Expand panel":"Collapse panel",children:V})})}),
|
|
5
|
+
/* @__PURE__ */e(v,{ref:Y?void 0:$,collapsible:!Y,defaultSize:Y?void 0:p?0:c,minSize:Y?30:d,collapsedSize:0,onResize:Y?void 0:K,onCollapse:Y?void 0:()=>D(!0),onExpand:Y?void 0:()=>D(!1),className:_(!Y),style:Y?void 0:G,children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:!Y&&E?0:1,transition:z?`opacity ${.5*f}ms ${y}`:"none"},children:r})})]})})},E=({topPanel:n,bottomPanel:r,collapsiblePanels:s={top:!0,bottom:!0},defaultSizes:c={top:30,bottom:30},minSizes:d={top:5,bottom:5},className:u="",collapsed:p={top:!1,bottom:!1},style:h,showCollapseButtons:m=!1,animationDuration:f=300,animationEasing:y="cubic-bezier(0.4, 0, 0.2, 1)",theme:w,onTopCollapseStart:x,onTopCollapseComplete:C,onTopExpandStart:R,onTopExpandComplete:N,onBottomCollapseStart:E,onBottomCollapseComplete:D,onBottomExpandStart:z,onBottomExpandComplete:M,onPanelResize:T})=>{const[A,k]=o(p.top||!1),[L,P]=o(!1),[F,$]=o(p.top?0:c.top),B=i(null),O=i(void 0),I=i(void 0),[q,H]=o(p.bottom||!1),[W,j]=o(!1),[K,U]=o(p.bottom?0:c.bottom),X=i(null),Y=i(void 0),V=i(void 0),[J,G]=o(!1),_=a((e,t,n)=>{if(!B.current)return;O.current&&cancelAnimationFrame(O.current),I.current=performance.now();const r=o=>{if(!I.current||!B.current)return;const i=o-I.current,a=Math.min(i/f,1),l=a<.5?4*a*a*a:1-Math.pow(-2*a+2,3)/2,s=e+(t-e)*l;B.current.resize(s),a<1?O.current=requestAnimationFrame(r):(0===t?B.current.collapse():B.current.resize(t),P(!1),n&&n())};O.current=requestAnimationFrame(r)},[f]),Q=a((e,t,n)=>{if(!X.current)return;Y.current&&cancelAnimationFrame(Y.current),V.current=performance.now();const r=o=>{if(!V.current||!X.current)return;const i=o-V.current,a=Math.min(i/f,1),l=a<.5?4*a*a*a:1-Math.pow(-2*a+2,3)/2,s=e+(t-e)*l;X.current.resize(s),a<1?Y.current=requestAnimationFrame(r):(0===t?X.current.collapse():X.current.resize(t),j(!1),n&&n())};Y.current=requestAnimationFrame(r)},[f]),Z=a(()=>{L||J||!s.top||(P(!0),k(!0),x&&x(),_(F,0,()=>{$(0),C&&C()}))},[L,J,F,s.top,_,x,C]),ee=a(()=>{L||J||!s.top||(P(!0),k(!1),R&&R(),_(0,c.top,()=>{$(c.top),N&&N()}))},[L,J,c.top,s.top,_,R,N]),te=a(()=>{A?ee():Z()},[A,Z,ee]),ne=a(()=>{W||J||!s.bottom||(j(!0),H(!0),E&&E(),Q(K,0,()=>{U(0),D&&D()}))},[W,J,K,s.bottom,Q,E,D]),re=a(()=>{W||J||!s.bottom||(j(!0),H(!1),z&&z(),Q(0,c.bottom,()=>{U(c.bottom),M&&M()}))},[W,J,c.bottom,s.bottom,Q,z,M]),oe=a(()=>{q?re():ne()},[q,ne,re]),ie=a(e=>{L||($(e),e>0&&k(!1))},[L]),ae=a(e=>{W||(U(e),e>0&&H(!1))},[W]),le=a(()=>{G(!0)},[]),se=a(()=>{G(!1),T&&T({top:F,bottom:K})},[F,K,T]);l(()=>{void 0!==p.top&&p.top!==A&&(p.top?Z():ee())},[p.top]),l(()=>{void 0!==p.bottom&&p.bottom!==q&&(p.bottom?ne():re())},[p.bottom]),l(()=>()=>{O.current&&cancelAnimationFrame(O.current),Y.current&&cancelAnimationFrame(Y.current)},[]);const ce=S(w),de=L&&!J?{transition:`flex ${f}ms ${y}`}:void 0,ue=W&&!J?{transition:`flex ${f}ms ${y}`}:void 0;/* @__PURE__ */
|
|
6
6
|
return e("div",{className:`animated-vertical-layout ${u}`,style:{...ce,...h},children:/* @__PURE__ */t(g,{direction:"vertical",onLayout:se,children:[
|
|
7
7
|
/* @__PURE__ */e(v,{ref:B,collapsible:s.top,defaultSize:p.top?0:c.top,minSize:d.top,collapsedSize:0,onResize:ie,onCollapse:()=>k(!0),onExpand:()=>k(!1),className:(()=>{let e="vertical-panel collapsible-panel";return L&&!J&&(e+=" animating"),A&&(e+=" collapsed"),e})(),style:de,children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:A?0:1,transition:L?`opacity ${.5*f}ms ${y}`:"none"},children:n})}),
|
|
8
|
-
/* @__PURE__ */e(b,{className:"vertical-resize-handle",onDragging:le,children:m&&/* @__PURE__ */t("div",{className:"handle-bar",children:[s.top&&/* @__PURE__ */e("button",{onClick:te,className:"collapse-toggle collapse-toggle-top",disabled:L,"aria-label":A?"Expand top panel":"Collapse top panel",children:A?"▾":"▴"}),s.bottom&&/* @__PURE__ */e("button",{onClick:oe,className:"collapse-toggle collapse-toggle-bottom",disabled:
|
|
9
|
-
/* @__PURE__ */e(v,{ref:X,collapsible:s.bottom,defaultSize:p.bottom?0:c.bottom,minSize:d.bottom,collapsedSize:0,onResize:ae,onCollapse:()=>
|
|
8
|
+
/* @__PURE__ */e(b,{className:"vertical-resize-handle",onDragging:le,children:m&&/* @__PURE__ */t("div",{className:"handle-bar",children:[s.top&&/* @__PURE__ */e("button",{onClick:te,className:"collapse-toggle collapse-toggle-top",disabled:L,"aria-label":A?"Expand top panel":"Collapse top panel",children:A?"▾":"▴"}),s.bottom&&/* @__PURE__ */e("button",{onClick:oe,className:"collapse-toggle collapse-toggle-bottom",disabled:W,"aria-label":q?"Expand bottom panel":"Collapse bottom panel",children:q?"▴":"▾"})]})}),
|
|
9
|
+
/* @__PURE__ */e(v,{ref:X,collapsible:s.bottom,defaultSize:p.bottom?0:c.bottom,minSize:d.bottom,collapsedSize:0,onResize:ae,onCollapse:()=>H(!0),onExpand:()=>H(!1),className:(()=>{let e="vertical-panel collapsible-panel";return W&&!J&&(e+=" animating"),q&&(e+=" collapsed"),e})(),style:ue,children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:q?0:1,transition:W?`opacity ${.5*f}ms ${y}`:"none"},children:r})})]})})},D=({primaryContent:t,secondaryContent:n,collapsedHeader:r,collapsed:o=!0,onCollapsedChange:i,ratio:a=.3,onRatioChange:l,minRatio:s=.1,maxRatio:c=.8,collapsedHeight:d=28,theme:u,className:p="",style:h,animationDuration:m=200,onCollapseStart:f,onCollapseComplete:g,onExpandStart:v,onExpandComplete:b})=>{const y=S(u);return n?/* @__PURE__ */e(z,{primaryContent:t,secondaryContent:n,collapsedHeader:r??{title:"Content"},collapsed:o,onCollapsedChange:i??(()=>{}),ratio:a,onRatioChange:l??(()=>{}),minRatio:s,maxRatio:c,collapsedHeight:d,theme:u,className:p,style:h,animationDuration:m,onCollapseStart:f,onCollapseComplete:g,onExpandStart:v,onExpandComplete:b}):/* @__PURE__ */e("div",{className:`collapsible-split-pane ${p}`,style:{...y,...h},children:/* @__PURE__ */e("div",{className:"csp-primary-content-full",children:t})})},z=({primaryContent:r,secondaryContent:s,collapsedHeader:c,collapsed:d,onCollapsedChange:u,ratio:p,onRatioChange:h,minRatio:m=.1,maxRatio:f=.8,collapsedHeight:y=28,theme:w,className:x="",style:C,animationDuration:R=200,onCollapseStart:N,onCollapseComplete:E,onExpandStart:D,onExpandComplete:z})=>{const[M,T]=o(!1),[A,k]=o(!1),L=i(null),P=i(void 0),F=i(void 0),$=i(p),B=e=>100*e;l(()=>{!d&&p>0&&($.current=p)},[d,p]);const O=a((e,t,n)=>{if(!L.current)return;P.current&&cancelAnimationFrame(P.current),F.current=performance.now();const r=o=>{if(!F.current||!L.current)return;const i=o-F.current,a=Math.min(i/R,1),l=a<.5?4*a*a*a:1-Math.pow(-2*a+2,3)/2,s=e+(t-e)*l;L.current.resize(s),a<1?P.current=requestAnimationFrame(r):(0===t?L.current.collapse():L.current.resize(t),T(!1),n&&n())};P.current=requestAnimationFrame(r)},[R]),I=a(()=>{if(M||A)return;T(!0),N?.();const e=B(p);O(e,0,()=>{u(!0),E?.()})},[M,A,p,O,u,N,E]),q=a(()=>{if(M||A)return;T(!0),D?.();const e=$.current||p||.3,t=B(e);O(0,t,()=>{u(!1),h(e),z?.()})},[M,A,p,O,u,h,D,z]),H=a(()=>{d?q():I()},[d,I,q]),W=a(e=>{if(!M&&!d){const t=e/100;h(t)}},[M,d,h]),j=a(()=>{k(!0)},[]),K=a(()=>{k(!1)},[]);l(()=>{if(d&&!M&&L.current){L.current.getSize()>0&&I()}else if(!d&&!M&&L.current){0===L.current.getSize()&&q()}},[d]),l(()=>()=>{P.current&&cancelAnimationFrame(P.current)},[]);const U=S(w),X=["csp-secondary-panel",M&&!A?"csp-animating":"",d?"csp-collapsed":""].filter(Boolean).join(" ");/* @__PURE__ */
|
|
10
10
|
return e("div",{className:`collapsible-split-pane ${x}`,style:{...U,...C},children:d?
|
|
11
11
|
/* @__PURE__ */t(n,{children:[
|
|
12
|
-
/* @__PURE__ */t("div",{className:"csp-collapsed-header",style:{height:y},onClick:
|
|
12
|
+
/* @__PURE__ */t("div",{className:"csp-collapsed-header",style:{height:y},onClick:H,role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),H())},"aria-expanded":!1,"aria-label":`Expand ${c.title}`,children:[c.icon&&/* @__PURE__ */e("span",{className:"csp-collapsed-header-icon",children:c.icon}),
|
|
13
13
|
/* @__PURE__ */e("span",{className:"csp-collapsed-header-title",children:c.title}),
|
|
14
|
-
/* @__PURE__ */e("button",{className:"csp-collapsed-header-expand",onClick:e=>{e.stopPropagation(),
|
|
14
|
+
/* @__PURE__ */e("button",{className:"csp-collapsed-header-expand",onClick:e=>{e.stopPropagation(),H()},"aria-label":`Expand ${c.title}`,children:/* @__PURE__ */e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:/* @__PURE__ */e("path",{d:"M3 5L6 8L9 5"})})})]}),
|
|
15
15
|
/* @__PURE__ */e("div",{className:"csp-primary-content-full",children:r})]}):
|
|
16
16
|
/* @__PURE__ */t(g,{direction:"vertical",onLayout:K,children:[
|
|
17
|
-
/* @__PURE__ */e(v,{ref:L,collapsible:!0,defaultSize:B(p),minSize:B(m),maxSize:B(f),collapsedSize:0,onResize:
|
|
17
|
+
/* @__PURE__ */e(v,{ref:L,collapsible:!0,defaultSize:B(p),minSize:B(m),maxSize:B(f),collapsedSize:0,onResize:W,onCollapse:()=>u(!0),className:X,children:/* @__PURE__ */t("div",{className:"csp-panel-content",children:[
|
|
18
18
|
/* @__PURE__ */t("div",{className:"csp-secondary-header",children:[c.icon&&/* @__PURE__ */e("span",{className:"csp-secondary-header-icon",children:c.icon}),
|
|
19
19
|
/* @__PURE__ */e("span",{className:"csp-secondary-header-title",children:c.title}),
|
|
20
20
|
/* @__PURE__ */e("button",{className:"csp-secondary-header-collapse",onClick:I,"aria-label":`Collapse ${c.title}`,children:/* @__PURE__ */e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:/* @__PURE__ */e("path",{d:"M3 7L6 4L9 7"})})})]}),
|
|
21
21
|
/* @__PURE__ */e("div",{className:"csp-secondary-body",children:s})]})}),
|
|
22
|
-
/* @__PURE__ */e(b,{className:"csp-resize-handle",onDragging:
|
|
23
|
-
/* @__PURE__ */e(v,{className:"csp-primary-panel",minSize:20,children:/* @__PURE__ */e("div",{className:"csp-panel-content",children:r})})]})})},
|
|
22
|
+
/* @__PURE__ */e(b,{className:"csp-resize-handle",onDragging:j,children:/* @__PURE__ */e("div",{className:"csp-resize-handle-bar"})}),
|
|
23
|
+
/* @__PURE__ */e(v,{className:"csp-primary-panel",minSize:20,children:/* @__PURE__ */e("div",{className:"csp-panel-content",children:r})})]})})},M=({panelIds:r,panels:i,config:a={},className:s="",theme:c})=>{const{defaultActiveTab:d=0,tabPosition:u="top",centered:p=!0,hideTabList:h=!1,activeTabIndex:m,onTabChange:f}=a,[g,v]=o(d),b=void 0!==m,y=b?m:g;l(()=>{b||v(d)},[d,b]);const w=R(c),x=r.map(e=>i.find(t=>t.id===e)).filter(e=>void 0!==e),C=Math.min(y,x.length-1),S=x[C];if(0===x.length)/* @__PURE__ */
|
|
24
24
|
return e("div",{className:"tab-group-empty",children:"No panels available"});const N=/* @__PURE__ */e("div",{className:"tab-list "+("top"===u||"bottom"===u||p?"centered":""),role:"tablist",children:x.map((r,o)=>/* @__PURE__ */e("button",{role:"tab","aria-selected":o===C,"aria-controls":`tabpanel-${r.id}`,id:`tab-${r.id}`,className:"tab-button "+(o===C?"active":""),onClick:()=>(e=>{b||v(e),f?.(e)})(o),title:r.icon?r.label:void 0,children:r.icon?/* @__PURE__ */t(n,{children:[
|
|
25
25
|
/* @__PURE__ */e("span",{className:"tab-icon",children:r.icon}),
|
|
26
26
|
/* @__PURE__ */e("span",{className:"tab-label",children:r.label})]}):r.label},r.id))}),E=S?/* @__PURE__ */e("div",{className:"tab-content",role:"tabpanel",id:`tabpanel-${S.id}`,"aria-labelledby":`tab-${S.id}`,children:S.content}):null;/* @__PURE__ */
|
|
27
|
-
return t("div",{className:`tab-group tab-position-${u} ${s}`,style:w,children:[!h&&("top"===u||"left"===u)&&N,E,!h&&("bottom"===u||"right"===u)&&N]})},
|
|
28
|
-
return e(
|
|
27
|
+
return t("div",{className:`tab-group tab-position-${u} ${s}`,style:w,children:[!h&&("top"===u||"left"===u)&&N,E,!h&&("bottom"===u||"right"===u)&&N]})},T={x:0,y:0,width:0,height:0},A=s(null),k=({slot:t,children:n})=>{const r=i(null),[s,c]=o(T),d=a(()=>{if(r.current){const e=r.current.getBoundingClientRect();c({x:e.left,y:e.top,width:e.width,height:e.height})}},[]);l(()=>{const e=r.current;if(!e)return;d();const t=new ResizeObserver(()=>{d()});return t.observe(e),window.addEventListener("resize",d),window.addEventListener("scroll",d,!0),()=>{t.disconnect(),window.removeEventListener("resize",d),window.removeEventListener("scroll",d,!0)}},[d]);const u={slot:t,bounds:s};/* @__PURE__ */
|
|
28
|
+
return e(A.Provider,{value:u,children:/* @__PURE__ */e("div",{ref:r,className:"panel-bounds-container",style:{width:"100%",height:"100%"},children:n})})};function L(){const e=c(A);return e?{slot:e.slot,bounds:e.bounds,isInPanel:!0}:{slot:null,bounds:T,isInPanel:!1}}function P(){const{bounds:e}=L();return{offsetX:e.x,offsetY:e.y}}const F=({panels:n,layout:r,slotDataAttributes:s={},collapsiblePanels:c={left:!0,middle:!1,right:!0},defaultSizes:d={left:20,middle:60,right:20},minSizes:u={left:5,middle:10,right:5},className:p="",collapsed:h={left:!1,middle:!1,right:!1},style:m,showCollapseButtons:f=!1,animationDuration:w=300,animationEasing:x="cubic-bezier(0.4, 0, 0.2, 1)",theme:C,onLeftCollapseStart:R,onLeftCollapseComplete:N,onLeftExpandStart:E,onLeftExpandComplete:D,onMiddleCollapseStart:z,onMiddleCollapseComplete:T,onMiddleExpandStart:A,onMiddleExpandComplete:L,onRightCollapseStart:P,onRightCollapseComplete:F,onRightExpandStart:$,onRightExpandComplete:B,onPanelResize:O})=>{const I=null!==r.left&&void 0!==r.left,q=null!==r.middle&&void 0!==r.middle,H=null!==r.right&&void 0!==r.right,W=[I,q,H].filter(Boolean).length,j={left:I?d?.left??(2===W?50:3===W?20:100):0,middle:q?d?.middle??(2===W?50:3===W?60:100):0,right:H?d?.right??(2===W?50:3===W?20:100):0},K={left:u?.left??5,middle:u?.middle??10,right:u?.right??5},[U,X]=o(h.left||!I),[Y,V]=o(h.middle||!q),[J,G]=o(h.right||!H),[_,Q]=o(!1),[Z,ee]=o(!1),[te,ne]=o(!1),[re,oe]=o(!1),ie=U&&!_,ae=Y&&!Z,le=J&&!te,se=a(e=>{if(!e)return null;const t=n.find(t=>t.id===e);return t?.content||null},[n]),ce=a(t=>{if(null===t)return null;if("object"==typeof t&&"type"in t){const r=t;return"tabs"===r.type?/* @__PURE__ */e(M,{panelIds:r.panels,panels:n,config:r.config,theme:C}):null}return se(t)},[n,se,C]),de=ce(r.left??null),ue=ce(r.middle??null),pe=ce(r.right??null),[he,me]=o(h.left||!I?0:j.left),[fe,ge]=o(h.middle||!q?0:j.middle),[ve,be]=o(h.right||!H?0:j.right),[ye,we]=o(j.left),[xe,Ce]=o(j.middle),[Se,Re]=o(j.right),Ne=i(null),Ee=i(null),De=i(null),ze=i(null),Me=i(void 0),Te=i(void 0),Ae=i(void 0),ke=i(void 0),Le=i(void 0),Pe=i(void 0),Fe=a((e,t)=>{const n=e.filter(e=>e.panelRef.current);if(0===n.length)return;n.forEach(e=>{e.animationFrameRef.current&&cancelAnimationFrame(e.animationFrameRef.current)});let r=0;const o=()=>{r++;const e=r/10;if(e>=1)return n.forEach(e=>{e.panelRef.current&&(0===e.toSize?e.panelRef.current.collapse():e.panelRef.current.resize(e.toSize))}),void(t&&t());const i=e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2;n.forEach(e=>{if(e.panelRef.current){const t=e.fromSize+(e.toSize-e.fromSize)*i;e.panelRef.current.resize(t)}}),n[0].animationFrameRef.current=requestAnimationFrame(()=>{setTimeout(o,w/10)})};o()},[w]),$e=a(()=>{_||re||!c.left||(y(()=>{Q(!0),ee(!0),ne(!0),X(!0)}),R&&R(),Me.current&&cancelAnimationFrame(Me.current),Me.current=requestAnimationFrame(()=>{const e=Ne.current?.getLayout(),t=Math.round(1e3*(e?.[0]??he))/1e3,n=Math.round(1e3*(e?.[1]??fe))/1e3,r=Math.round(1e3*(e?.[2]??ve))/1e3,o=n+r,i=o>0?n/o*100:q?50:0,a=o>0?r/o*100:H?50:0;i>0&&Ce(i),a>0&&Re(a),Fe([{panelRef:Ee,fromSize:t,toSize:0,animationFrameRef:Me,startTimeRef:ke},{panelRef:De,fromSize:n,toSize:i,animationFrameRef:Te,startTimeRef:Le},{panelRef:ze,fromSize:r,toSize:a,animationFrameRef:Ae,startTimeRef:Pe}],()=>{me(0),ge(i),be(a),Q(!1),ee(!1),ne(!1),N&&N()})}))},[_,re,he,fe,ve,q,H,c.left,Fe,R,N]),Be=a(()=>{_||re||!c.left||(y(()=>{Q(!0),ee(!0),ne(!0),X(!1)}),E&&E(),Me.current&&cancelAnimationFrame(Me.current),Me.current=requestAnimationFrame(()=>{const e=Ne.current?.getLayout(),t=Math.round(1e3*(e?.[0]??0))/1e3,n=Math.round(1e3*(e?.[1]??fe))/1e3,r=Math.round(1e3*(e?.[2]??ve))/1e3,o=ye||j.left,i=100-o,a=n+r,l=a>0?n/a*i:q?i/2:0,s=a>0?r/a*i:H?i/2:0;l>0&&Ce(l),s>0&&Re(s),Fe([{panelRef:Ee,fromSize:t,toSize:o,animationFrameRef:Me,startTimeRef:ke},{panelRef:De,fromSize:n,toSize:l,animationFrameRef:Te,startTimeRef:Le},{panelRef:ze,fromSize:r,toSize:s,animationFrameRef:Ae,startTimeRef:Pe}],()=>{me(o),ge(l),be(s),Q(!1),ee(!1),ne(!1),D&&D()})}))},[_,re,fe,ve,j.left,ye,q,H,c.left,Fe,E,D]),Oe=a(()=>{te||re||!c.right||(y(()=>{Q(!0),ee(!0),ne(!0),G(!0)}),P&&P(),Ae.current&&cancelAnimationFrame(Ae.current),Ae.current=requestAnimationFrame(()=>{const e=Ne.current?.getLayout(),t=Math.round(1e3*(e?.[0]??he))/1e3,n=Math.round(1e3*(e?.[1]??fe))/1e3,r=Math.round(1e3*(e?.[2]??ve))/1e3,o=t+n,i=o>0?t/o*100:I?50:0,a=o>0?n/o*100:q?50:0;i>0&&we(i),a>0&&Ce(a),Fe([{panelRef:Ee,fromSize:t,toSize:i,animationFrameRef:Me,startTimeRef:ke},{panelRef:De,fromSize:n,toSize:a,animationFrameRef:Te,startTimeRef:Le},{panelRef:ze,fromSize:r,toSize:0,animationFrameRef:Ae,startTimeRef:Pe}],()=>{me(i),ge(a),be(0),Q(!1),ee(!1),ne(!1),F&&F()})}))},[te,re,he,fe,ve,I,q,c.right,Fe,P,F]),Ie=a(()=>{te||re||!c.right||(y(()=>{Q(!0),ee(!0),ne(!0),G(!1)}),$&&$(),Ae.current&&cancelAnimationFrame(Ae.current),Ae.current=requestAnimationFrame(()=>{const e=Ne.current?.getLayout(),t=Math.round(1e3*(e?.[0]??he))/1e3,n=Math.round(1e3*(e?.[1]??fe))/1e3,r=Math.round(1e3*(e?.[2]??0))/1e3,o=Se||j.right,i=100-o,a=t+n,l=a>0?t/a*i:I?i/2:0,s=a>0?n/a*i:q?i/2:0;l>0&&we(l),s>0&&Ce(s),Fe([{panelRef:Ee,fromSize:t,toSize:l,animationFrameRef:Me,startTimeRef:ke},{panelRef:De,fromSize:n,toSize:s,animationFrameRef:Te,startTimeRef:Le},{panelRef:ze,fromSize:r,toSize:o,animationFrameRef:Ae,startTimeRef:Pe}],()=>{me(l),ge(s),be(o),Q(!1),ee(!1),ne(!1),B&&B()})}))},[te,re,he,fe,j.right,Se,I,q,c.right,Fe,$,B]),qe=a(()=>{U?Be():$e()},[U,$e,Be]),He=a(()=>{Z||re||!c.middle||(y(()=>{Q(!0),ee(!0),ne(!0),V(!0)}),z&&z(),Te.current&&cancelAnimationFrame(Te.current),Te.current=requestAnimationFrame(()=>{const e=Ne.current?.getLayout(),t=Math.round(1e3*(e?.[0]??he))/1e3,n=Math.round(1e3*(e?.[1]??fe))/1e3,r=Math.round(1e3*(e?.[2]??ve))/1e3,o=t+r,i=o>0?t/o*100:I?50:0,a=o>0?r/o*100:H?50:0;i>0&&we(i),a>0&&Re(a),Fe([{panelRef:Ee,fromSize:t,toSize:i,animationFrameRef:Me,startTimeRef:ke},{panelRef:De,fromSize:n,toSize:0,animationFrameRef:Te,startTimeRef:Le},{panelRef:ze,fromSize:r,toSize:a,animationFrameRef:Ae,startTimeRef:Pe}],()=>{me(i),ge(0),be(a),Q(!1),ee(!1),ne(!1),T&&T()})}))},[Z,re,he,fe,ve,I,H,c.middle,Fe,z,T]),We=a(()=>{Z||re||!c.middle||(y(()=>{Q(!0),ee(!0),ne(!0),V(!1)}),A&&A(),Te.current&&cancelAnimationFrame(Te.current),Te.current=requestAnimationFrame(()=>{const e=Ne.current?.getLayout(),t=Math.round(1e3*(e?.[0]??he))/1e3,n=Math.round(1e3*(e?.[1]??0))/1e3,r=Math.round(1e3*(e?.[2]??ve))/1e3,o=xe||j.middle,i=100-o,a=t+r,l=a>0?t/a*i:I?i/2:0,s=a>0?r/a*i:H?i/2:0;l>0&&we(l),s>0&&Re(s),Fe([{panelRef:Ee,fromSize:t,toSize:l,animationFrameRef:Me,startTimeRef:ke},{panelRef:De,fromSize:n,toSize:o,animationFrameRef:Te,startTimeRef:Le},{panelRef:ze,fromSize:r,toSize:s,animationFrameRef:Ae,startTimeRef:Pe}],()=>{me(l),ge(o),be(s),Q(!1),ee(!1),ne(!1),L&&L()})}))},[Z,re,he,ve,j.middle,xe,I,H,c.middle,Fe,A,L]),je=a(()=>{J?Ie():Oe()},[J,Oe,Ie]),Ke=a(e=>{_||Z||te||(me(e),e>0&&(we(e),X(!1)))},[_,Z,te]),Ue=a(e=>{_||Z||te||(ge(e),e>0&&(Ce(e),V(!1)))},[_,Z,te]),Xe=a(e=>{_||Z||te||(be(e),e>0&&(Re(e),G(!1)))},[_,Z,te]),Ye=a(()=>{if(O){O({left:U?ye:he,middle:Y?xe:fe,right:J?Se:ve})}},[he,fe,ve,U,Y,J,ye,xe,Se,O]),Ve=a(e=>{oe(e),e||Ye()},[Ye]);l(()=>{void 0!==h.left&&h.left!==U&&queueMicrotask(()=>{h.left?$e():Be()})},[h.left,U,$e,Be]),l(()=>{void 0!==h.middle&&h.middle!==Y&&queueMicrotask(()=>{h.middle?He():We()})},[h.middle,Y,He,We]),l(()=>{void 0!==h.right&&h.right!==J&&queueMicrotask(()=>{h.right?Oe():Ie()})},[h.right,J,Oe,Ie]),l(()=>()=>{Me.current&&cancelAnimationFrame(Me.current),Te.current&&cancelAnimationFrame(Te.current),Ae.current&&cancelAnimationFrame(Ae.current)},[]);const Je=e=>{let t="three-panel-item";return"left"===e?!c.left&&I||(t+=" collapsible-panel",_&&!re&&(t+=" animating"),ie&&(t+=" collapsed")):"middle"===e?(t+=" middle-panel",!c.middle&&q||(t+=" collapsible-panel",Z&&!re&&(t+=" animating"),ae&&(t+=" collapsed"))):"right"===e&&(!c.right&&H||(t+=" collapsible-panel",te&&!re&&(t+=" animating"),le&&(t+=" collapsed"))),t},Ge=_&&!re?{transition:`width ${w}ms ${x}`,width:U?"0%":`${j.left}%`}:void 0,_e=Z&&!re?{transition:`width ${w}ms ${x}`,width:Y?"0%":`${j.middle}%`}:void 0,Qe=te&&!re?{transition:`width ${w}ms ${x}`,width:J?"0%":`${j.right}%`}:void 0,Ze=S(C),et=_||Z||te?0:K.left,tt=_||Z||te?0:K.middle,nt=_||Z||te?0:K.right;/* @__PURE__ */
|
|
29
29
|
return e("div",{className:`three-panel-layout ${p}`,style:{...Ze,...m},children:/* @__PURE__ */t(g,{ref:Ne,direction:"horizontal",onLayout:Ye,children:[
|
|
30
|
-
/* @__PURE__ */e(v,{ref:Ee,collapsible:c.left||!I,defaultSize:h.left||!I?0:
|
|
30
|
+
/* @__PURE__ */e(v,{ref:Ee,collapsible:c.left||!I,defaultSize:h.left||!I?0:j.left,minSize:et,collapsedSize:0,onResize:Ke,onCollapse:()=>X(!0),onExpand:()=>X(!1),className:Je("left"),style:Ge,...s.left||{},children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:U?0:1,transition:_?`opacity ${.5*w}ms ${x}`:"none"},children:/* @__PURE__ */e(k,{slot:"left",children:de})})}),
|
|
31
31
|
/* @__PURE__ */e(b,{className:"resize-handle left-handle "+(!ie&&I&&q?"":"collapsed"),onDragging:Ve,disabled:ie||!I||!q,children:f&&c.left&&/* @__PURE__ */e("div",{className:"handle-bar",children:/* @__PURE__ */e("button",{onClick:qe,className:"collapse-toggle",disabled:_,"aria-label":U?"Expand left panel":"Collapse left panel",children:U?"▸":"◂"})})}),
|
|
32
|
-
/* @__PURE__ */e(v,{ref:
|
|
33
|
-
/* @__PURE__ */e(b,{className:"resize-handle right-handle "+(le||!
|
|
34
|
-
/* @__PURE__ */e(v,{ref:
|
|
32
|
+
/* @__PURE__ */e(v,{ref:De,collapsible:c.middle||!q,defaultSize:h.middle||!q?0:j.middle,minSize:tt,collapsedSize:0,onResize:Ue,onCollapse:()=>V(!0),onExpand:()=>V(!1),className:Je("middle"),style:_e,...s.middle||{},children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:Y?0:1,transition:Z?`opacity ${.5*w}ms ${x}`:"none"},children:/* @__PURE__ */e(k,{slot:"middle",children:ue})})}),
|
|
33
|
+
/* @__PURE__ */e(b,{className:"resize-handle right-handle "+(le||!H||!q&&!I?"collapsed":""),onDragging:Ve,disabled:le||!H||!q&&!I,children:f&&c.right&&/* @__PURE__ */e("div",{className:"handle-bar",children:/* @__PURE__ */e("button",{onClick:je,className:"collapse-toggle",disabled:te,"aria-label":J?"Expand right panel":"Collapse right panel",children:J?"◂":"▸"})})}),
|
|
34
|
+
/* @__PURE__ */e(v,{ref:ze,collapsible:c.right||!H,defaultSize:h.right||!H?0:j.right,minSize:nt,collapsedSize:0,onResize:Xe,onCollapse:()=>G(!0),onExpand:()=>G(!1),className:Je("right"),style:Qe,...s.right||{},children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:J?0:1,transition:te?`opacity ${.5*w}ms ${x}`:"none"},children:/* @__PURE__ */e(k,{slot:"right",children:pe})})})]})})},$=d(({panels:o,className:a="",style:s,theme:c,minPanelWidth:d=350,idealPanelWidth:p=.333,showSeparator:h=!1,onPanelChange:m,preventKeyboardScroll:f=!0,disableSwipe:g=!1},v)=>{const b=i(null),y=i(!1),w=i(null),x=S(c);u(v,()=>({scrollToPanel:e=>{if(!b.current)return;const t=b.current,n=t.children[e];if(n){y.current=!0,w.current&&clearTimeout(w.current);const e=n.offsetLeft;t.scrollTo({left:e,behavior:"smooth"}),w.current=setTimeout(()=>{y.current=!1},500)}},getCurrentPanel:()=>{if(!b.current||0===b.current.children.length)return 0;const e=b.current,t=e.getBoundingClientRect().left;let n=0,r=1/0;for(let o=0;o<e.children.length;o++){const i=e.children[o].getBoundingClientRect(),a=Math.abs(i.left-t);a<r&&(r=a,n=o)}return n}}));l(()=>{if(!f||!b.current)return;const e=b.current,t=e=>{const t=e.target;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||"SELECT"===t.tagName||t.isContentEditable||null!==t.closest(".xterm")||null!==t.closest('[contenteditable="true"]'))return;[" ","Space","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown"].includes(e.key)&&e.preventDefault()};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},[f]),l(()=>()=>{w.current&&clearTimeout(w.current)},[]);const C=o.length,R=2*d;let N;N=1===C||2===C?"100%":`max(${d}px, ${100*p}%)`;const E=r.useId().replace(/:/g,"_");/* @__PURE__ */
|
|
35
35
|
return t(n,{children:[2===C&&/* @__PURE__ */e("style",{children:`\n .snap-carousel-container[data-carousel-id="${E}"][data-panel-count="2"] .snap-carousel-panel {\n width: 100%;\n }\n @container (min-width: ${R}px) {\n .snap-carousel-container[data-carousel-id="${E}"][data-panel-count="2"] .snap-carousel-panel {\n width: 50%;\n }\n }\n `}),
|
|
36
|
-
/* @__PURE__ */e("div",{ref:b,className:`snap-carousel-container ${g?"swipe-disabled":""} ${a}`,style:{...x,...s,"--snap-carousel-min-width":`${d}px`,"--snap-carousel-ideal-width":100*p+"%","--snap-carousel-gap":h?"1px":"0px","--snap-carousel-panel-width":N,"--snap-carousel-panel-count":C,"--snap-carousel-two-panel-threshold":`${R}px`},onScroll:e=>{if(!m||!b.current||0===b.current.children.length)return;if(y.current)return;const t=b.current,n=t.getBoundingClientRect().left;let r=0,o=1/0;for(let i=0;i<t.children.length;i++){const e=t.children[i].getBoundingClientRect(),a=Math.abs(e.left-n);a<o&&(o=a,r=i)}m(r)},"data-panel-count":C,"data-carousel-id":E,children:o.map((t,n)=>/* @__PURE__ */e("div",{className:"snap-carousel-panel",children:t},n))})]})});function
|
|
36
|
+
/* @__PURE__ */e("div",{ref:b,className:`snap-carousel-container ${g?"swipe-disabled":""} ${a}`,style:{...x,...s,"--snap-carousel-min-width":`${d}px`,"--snap-carousel-ideal-width":100*p+"%","--snap-carousel-gap":h?"1px":"0px","--snap-carousel-panel-width":N,"--snap-carousel-panel-count":C,"--snap-carousel-two-panel-threshold":`${R}px`},onScroll:e=>{if(!m||!b.current||0===b.current.children.length)return;if(y.current)return;const t=b.current,n=t.getBoundingClientRect().left;let r=0,o=1/0;for(let i=0;i<t.children.length;i++){const e=t.children[i].getBoundingClientRect(),a=Math.abs(e.left-n);a<o&&(o=a,r=i)}m(r)},"data-panel-count":C,"data-carousel-id":E,children:o.map((t,n)=>/* @__PURE__ */e("div",{className:"snap-carousel-panel",children:t},n))})]})});function B(e){const[t,n]=o(()=>"undefined"!=typeof window&&window.matchMedia(e).matches);return l(()=>{if("undefined"==typeof window)return;const t=window.matchMedia(e),r=e=>{n(e.matches)};return n(t.matches),t.addEventListener?(t.addEventListener("change",r),()=>t.removeEventListener("change",r)):(t.addListener(r),()=>t.removeListener(r))},[e]),t}$.displayName="SnapCarousel";const O=({mobileBreakpoint:n="(max-width: 768px)",mobileCarouselProps:r,onMobilePanelChange:a,theme:l,layout:s,panels:c,...d})=>{const u=B(n),h=i(null),[m,f]=o(0),g=p(()=>[s?.left,s?.middle,s?.right],[s]),v=["left","middle","right"],b=p(()=>{const t=e=>{if(!e)return null;const t=c.find(t=>t.id===e);return t?.content??null},n=e=>{const t=c.find(t=>t.id===e);return t?.label??e},r=e=>{const t=c.find(t=>t.id===e);return t?.icon??null};return g.map((o,i)=>((o,i)=>{if(null==o)return null;if("object"==typeof o&&"type"in o){const t=o;if("tabs"===t.type){const o=t.panels[0],a=t.panels.length>0?n(o):"Tab Group",s=t.panels.length>0?r(o):null;return{content:/* @__PURE__ */e(M,{panelIds:t.panels,panels:c,config:t.config,theme:l}),label:a,icon:s,slot:i}}return null}return{content:t(o),label:n(o),icon:r(o),slot:i}})(o,v[i])).filter(e=>null!==e)},[g,c,l]),y=e=>{f(e),r?.onPanelChange?.(e);const t=b[e]?.slot;t&&a?.(e,t)},{onPanelChange:w,...x}=r??{},C=R(l);if(u){if(0===b.length)return null;const n=b.map(e=>e.content);/* @__PURE__ */
|
|
37
37
|
return t("div",{className:"mobile-tab-layout",style:C,children:[
|
|
38
|
-
/* @__PURE__ */e("div",{className:"mobile-tab-content",children:/* @__PURE__ */e(
|
|
38
|
+
/* @__PURE__ */e("div",{className:"mobile-tab-content",children:/* @__PURE__ */e($,{ref:h,theme:l,panels:n,minPanelWidth:0,idealPanelWidth:1,disableSwipe:!0,onPanelChange:y,...x})}),
|
|
39
39
|
/* @__PURE__ */e("nav",{className:"mobile-tab-nav",role:"tablist",children:b.map((n,r)=>/* @__PURE__ */t("button",{role:"tab","aria-selected":r===m,className:"mobile-tab-button "+(r===m?"active":""),onClick:()=>(e=>{f(e),h.current?.scrollToPanel(e);const t=b[e]?.slot;t&&a?.(e,t)})(r),children:[n.icon&&/* @__PURE__ */e("span",{className:"tab-icon",children:n.icon}),
|
|
40
40
|
/* @__PURE__ */e("span",{className:"tab-label",children:n.label})]},r))})]})}/* @__PURE__ */
|
|
41
|
-
return e(P,{theme:l,layout:s,panels:c,...d})},O="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function I(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function q(e){return"nodeType"in e}function W(e){var t,n;return e?I(e)?e:q(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function j(e){const{Document:t}=W(e);return e instanceof t}function H(e){return!I(e)&&e instanceof W(e).HTMLElement}function K(e){return e instanceof W(e).SVGElement}function U(e){return e?I(e)?e.document:q(e)?j(e)?e:H(e)||K(e)?e.ownerDocument:document:document:document}const X=O?h:l;function Y(e){const t=i(e);return X(()=>{t.current=e}),a(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function V(e,t){void 0===t&&(t=[e]);const n=i(e);return X(()=>{n.current!==e&&(n.current=e)},t),n}function J(e,t){const n=i();return p(()=>{const t=e(n.current);return n.current=t,t},[...t])}function G(e){const t=Y(e),n=i(null),r=a(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function _(e){const t=i();return l(()=>{t.current=e},[e]),t.current}let Q={};function Z(e,t){return p(()=>{if(t)return t;const n=null==Q[e]?0:Q[e]+1;return Q[e]=n,e+"-"+n},[e,t])}function ee(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((t,n)=>{const r=Object.entries(n);for(const[o,i]of r){const n=t[o];null!=n&&(t[o]=n+e*i)}return t},{...t})}}const te=/* @__PURE__ */ee(1),ne=/* @__PURE__ */ee(-1);function re(e){if(!e)return!1;const{KeyboardEvent:t}=W(e.target);return t&&e instanceof t}function oe(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=W(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const ie="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ae(e){return e.matches(ie)?e:e.querySelector(ie)}const le={display:"none"};function se(e){let{id:t,value:n}=e;return r.createElement("div",{id:t,style:le},n)}function ce(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;return r.createElement("div",{id:t,style:{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"},role:"status","aria-live":o,"aria-atomic":!0},n)}const de=/* @__PURE__ */s(null);const ue={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},pe={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 he(e){let{announcements:t=pe,container:n,hiddenTextDescribedById:i,screenReaderInstructions:s=ue}=e;const{announce:d,announcement:u}=function(){const[e,t]=o("");return{announce:a(e=>{null!=e&&t(e)},[]),announcement:e}}(),h=Z("DndLiveRegion"),[m,f]=o(!1);if(l(()=>{f(!0)},[]),function(e){const t=c(de);l(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(p(()=>({onDragStart(e){let{active:n}=e;d(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&d(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;d(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;d(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;d(t.onDragCancel({active:n,over:r}))}}),[d,t])),!m)return null;const g=r.createElement(r.Fragment,null,r.createElement(se,{id:i,value:s.draggable}),r.createElement(ce,{id:h,announcement:u}));return n?x(g,n):g}var me,fe;function ge(){}(fe=me||(me={})).DragStart="dragStart",fe.DragMove="dragMove",fe.DragEnd="dragEnd",fe.DragCancel="dragCancel",fe.DragOver="dragOver",fe.RegisterDroppable="registerDroppable",fe.SetDroppableDisabled="setDroppableDisabled",fe.UnregisterDroppable="unregisterDroppable";const ve=/* @__PURE__ */Object.freeze({x:0,y:0});function be(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ye(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function we(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function xe(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const Ce=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=xe(t,t.left,t.top),i=[];for(const a of r){const{id:e}=a,t=n.get(e);if(t){const n=be(xe(t),o);i.push({id:e,data:{droppableContainer:a,value:n}})}}return i.sort(ye)};function Se(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*l;return Number((o/(n+r-o)).toFixed(4))}return 0}const Re=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:e}=i,r=n.get(e);if(r){const n=Se(r,t);n>0&&o.push({id:e,data:{droppableContainer:i,value:n}})}}return o.sort(we)};function Ne(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ve}function Ee(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((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const ze=/* @__PURE__ */Ee(1);const De={ignoreTransform:!1};function Me(e,t){void 0===t&&(t=De);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=W(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=function(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]}}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}(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,s=e.left-a-(1-o)*parseFloat(n),c=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:c,right:s+d,bottom:c+u,left:s}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:l,right:s}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:s}}function Te(e){return Me(e,{ignoreTransform:!0})}function Ae(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(j(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!H(o)||K(o))return n;if(n.includes(o))return n;const i=W(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=W(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=W(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function ke(e){const[t]=Ae(e,1);return null!=t?t:null}function Le(e){return O&&e?I(e)?e:q(e)?j(e)||e===U(e).scrollingElement?window:H(e)?e:null:null:null}function Pe(e){return I(e)?e.scrollX:e.scrollLeft}function Fe(e){return I(e)?e.scrollY:e.scrollTop}function $e(e){return{x:Pe(e),y:Fe(e)}}var Be,Oe;function Ie(e){return!(!O||!e)&&e===document.scrollingElement}function qe(e){const t={x:0,y:0},n=Ie(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}(Oe=Be||(Be={}))[Oe.Forward=1]="Forward",Oe[Oe.Backward=-1]="Backward";const We={x:.2,y:.2};function je(e,t,n,r,o){let{top:i,left:a,right:l,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=We);const{isTop:c,isBottom:d,isLeft:u,isRight:p}=qe(e),h={x:0,y:0},m={x:0,y:0},f=t.height*o.y,g=t.width*o.x;return!c&&i<=t.top+f?(h.y=Be.Backward,m.y=r*Math.abs((t.top+f-i)/f)):!d&&s>=t.bottom-f&&(h.y=Be.Forward,m.y=r*Math.abs((t.bottom-f-s)/f)),!p&&l>=t.right-g?(h.x=Be.Forward,m.x=r*Math.abs((t.right-g-l)/g)):!u&&a<=t.left+g&&(h.x=Be.Backward,m.x=r*Math.abs((t.left+g-a)/g)),{direction:h,speed:m}}function He(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}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 Ke(e){return e.reduce((e,t)=>te(e,$e(t)),ve)}const Ue=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Pe(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+Fe(t),0)}]];class Xe{constructor(e,t){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=Ae(t),r=Ke(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[o,i,a]of Ue)for(const e of i)Object.defineProperty(this,e,{get:()=>{const t=a(n),i=r[o]-t;return this.rect[e]+i},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ye{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Ve(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?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}var Je,Ge,_e,Qe;function Ze(e){e.preventDefault()}function et(e){e.stopPropagation()}(Ge=Je||(Je={})).Click="click",Ge.DragStart="dragstart",Ge.Keydown="keydown",Ge.ContextMenu="contextmenu",Ge.Resize="resize",Ge.SelectionChange="selectionchange",Ge.VisibilityChange="visibilitychange",(Qe=_e||(_e={})).Space="Space",Qe.Down="ArrowDown",Qe.Right="ArrowRight",Qe.Left="ArrowLeft",Qe.Up="ArrowUp",Qe.Esc="Escape",Qe.Enter="Enter",Qe.Tab="Tab";const tt={start:[_e.Space,_e.Enter],cancel:[_e.Esc],end:[_e.Space,_e.Enter,_e.Tab]},nt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case _e.Right:return{...n,x:n.x+25};case _e.Left:return{...n,x:n.x-25};case _e.Down:return{...n,y:n.y+25};case _e.Up:return{...n,y:n.y-25}}};class rt{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Ye(U(t)),this.windowListeners=new Ye(W(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Je.Resize,this.handleCancel),this.windowListeners.add(Je.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Je.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=Me),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);ke(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(ve)}handleKeyDown(e){if(re(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=tt,coordinateGetter:i=nt,scrollBehavior:a="smooth"}=r,{code:l}=e;if(o.end.includes(l))return void this.handleEnd(e);if(o.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:s}=n.current,c=s?{x:s.left,y:s.top}:ve;this.referenceCoordinates||(this.referenceCoordinates=c);const d=i(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=ne(d,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:l,isLeft:s,isBottom:c,maxScroll:u,minScroll:p}=qe(n),h=He(n),m={x:Math.min(o===_e.Right?h.right-h.width/2:h.right,Math.max(o===_e.Right?h.left:h.left+h.width/2,d.x)),y:Math.min(o===_e.Down?h.bottom-h.height/2:h.bottom,Math.max(o===_e.Down?h.top:h.top+h.height/2,d.y))},f=o===_e.Right&&!l||o===_e.Left&&!s,g=o===_e.Down&&!c||o===_e.Up&&!i;if(f&&m.x!==d.x){const e=n.scrollLeft+t.x,i=o===_e.Right&&e<=u.x||o===_e.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===_e.Right?n.scrollLeft-u.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(g&&m.y!==d.y){const e=n.scrollTop+t.y,i=o===_e.Down&&e<=u.y||o===_e.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===_e.Down?n.scrollTop-u.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,te(ne(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function ot(e){return Boolean(e&&"distance"in e)}function it(e){return Boolean(e&&"delay"in e)}rt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=tt,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class at{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=W(e);return e instanceof t?e:U(e)}(e.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=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=U(i),this.documentListeners=new Ye(this.document),this.listeners=new Ye(n),this.windowListeners=new Ye(W(i)),this.initialCoordinates=null!=(r=oe(o))?r:ve,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:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Je.Resize,this.handleCancel),this.windowListeners.add(Je.DragStart,Ze),this.windowListeners.add(Je.VisibilityChange,this.handleCancel),this.windowListeners.add(Je.ContextMenu,Ze),this.documentListeners.add(Je.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(it(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(ot(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Je.Click,et,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Je.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const l=null!=(t=oe(e))?t:ve,s=ne(r,l);if(!n&&a){if(ot(a)){if(null!=a.tolerance&&Ve(s,a.tolerance))return this.handleCancel();if(Ve(s,a.distance))return this.handleStart()}return it(a)&&Ve(s,a.tolerance)?this.handleCancel():void this.handlePending(a,s)}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===_e.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const lt={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class st extends at{constructor(e){const{event:t}=e,n=U(t.target);super(e,lt,n)}}st.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const ct={move:{name:"mousemove"},end:{name:"mouseup"}};var dt,ut;(ut=dt||(dt={}))[ut.RightClick=2]="RightClick";(class extends at{constructor(e){super(e,ct,U(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==dt.RightClick&&(null==r||r({event:n}),!0)}}];const pt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var ht,mt,ft,gt;function vt(e){let{acceleration:t,activator:n=ht.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:c=5,order:d=ft.TreeOrder,pointerCoordinates:u,scrollableAncestors:h,scrollableAncestorRects:m,delta:f,threshold:g}=e;const v=function(e){let{delta:t,disabled:n}=e;const r=_(t);return J(e=>{if(n||!r||!e)return bt;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Be.Backward]:e.x[Be.Backward]||-1===o.x,[Be.Forward]:e.x[Be.Forward]||1===o.x},y:{[Be.Backward]:e.y[Be.Backward]||-1===o.y,[Be.Forward]:e.y[Be.Forward]||1===o.y}}},[n,t,r])}({delta:f,disabled:!s}),[b,y]=function(){const e=i(null);return[a((t,n)=>{e.current=setInterval(t,n)},[]),a(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),w=i({x:0,y:0}),x=i({x:0,y:0}),C=p(()=>{switch(n){case ht.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case ht.DraggableRect:return o}},[n,o,u]),S=i(null),R=a(()=>{const e=S.current;if(!e)return;const t=w.current.x*x.current.x,n=w.current.y*x.current.y;e.scrollBy(t,n)},[]),N=p(()=>d===ft.TreeOrder?[...h].reverse():h,[d,h]);l(()=>{if(s&&h.length&&C){for(const e of N){if(!1===(null==r?void 0:r(e)))continue;const n=h.indexOf(e),o=m[n];if(!o)continue;const{direction:i,speed:a}=je(e,o,C,t,g);for(const e of["x","y"])v[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return y(),S.current=e,b(R,c),w.current=a,void(x.current=i)}w.current={x:0,y:0},x.current={x:0,y:0},y()}else y()},[t,R,r,y,s,c,JSON.stringify(C),JSON.stringify(v),b,h,N,m,JSON.stringify(g)])}(class extends at{constructor(e){super(e,pt)}static setup(){return window.addEventListener(pt.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(pt.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],(mt=ht||(ht={}))[mt.Pointer=0]="Pointer",mt[mt.DraggableRect=1]="DraggableRect",(gt=ft||(ft={}))[gt.TreeOrder=0]="TreeOrder",gt[gt.ReversedTreeOrder=1]="ReversedTreeOrder";const bt={x:{[Be.Backward]:!1,[Be.Forward]:!1},y:{[Be.Backward]:!1,[Be.Forward]:!1}};var yt,wt,xt;(wt=yt||(yt={}))[wt.Always=0]="Always",wt[wt.BeforeDragging=1]="BeforeDragging",wt[wt.WhileDragging=2]="WhileDragging",(xt||(xt={})).Optimized="optimized";const Ct=/* @__PURE__ */new Map;function St(e,t){return J(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function Rt(e){let{callback:t,disabled:n}=e;const r=Y(t),o=p(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return l(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function Nt(e){return new Xe(Me(e),e)}function Et(e,t,n){void 0===t&&(t=Nt);const[r,i]=o(null);function a(){i(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}const s=function(e){let{callback:t,disabled:n}=e;const r=Y(t),o=p(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return l(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),c=Rt({callback:a});return X(()=>{a(),e?(null==c||c.observe(e),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==c||c.disconnect(),null==s||s.disconnect())},[e]),r}const zt=[];function Dt(e,t){void 0===t&&(t=[]);const n=i(null);return l(()=>{n.current=null},t),l(()=>{const t=e!==ve;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?ne(e,n.current):ve}function Mt(e){return p(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const Tt=[];function At(e){let{measure:t}=e;const[n,r]=o(null),i=Rt({callback:a(e=>{for(const{target:n}of e)if(H(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),l=a(e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return H(t)?t:e}(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?t(n):null)},[t,i]),[s,c]=G(l);return p(()=>({nodeRef:s,rect:n,setRef:c}),[n,s,c])}const kt=[{sensor:st,options:{}},{sensor:rt,options:{}}],Lt={current:{}},Pt={draggable:{measure:Te},droppable:{measure:Te,strategy:yt.WhileDragging,frequency:xt.Optimized},dragOverlay:{measure:Me}};class Ft extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const $t={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:/* @__PURE__ */new Map,droppableRects:/* @__PURE__ */new Map,droppableContainers:/* @__PURE__ */new Ft,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ge},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Pt,measureDroppableContainers:ge,windowRect:null,measuringScheduled:!1},Bt=/* @__PURE__ */s({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ge,draggableNodes:/* @__PURE__ */new Map,over:null,measureDroppableContainers:ge}),Ot=/* @__PURE__ */s($t);function It(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:/* @__PURE__ */new Map,translate:{x:0,y:0}},droppable:{containers:new Ft}}}function qt(e,t){switch(t.type){case me.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case me.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case me.DragEnd:case me.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case me.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Ft(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case me.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new Ft(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case me.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Ft(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Wt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=c(Bt),i=_(r),a=_(null==n?void 0:n.id);return l(()=>{if(!t&&!r&&i&&null!=a){if(!re(i))return;if(document.activeElement===i.target)return;const e=o.get(a);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=ae(e);if(t){t.focus();break}}})}},[r,t,o,a,i]),null}const jt=/* @__PURE__ */s({...ve,scaleX:1,scaleY:1});var Ht,Kt;(Kt=Ht||(Ht={}))[Kt.Uninitialized=0]="Uninitialized",Kt[Kt.Initializing=1]="Initializing",Kt[Kt.Initialized=2]="Initialized";const Ut=/* @__PURE__ */m(function(e){var t,n,s,c;let{id:d,accessibility:u,autoScroll:h=!0,children:m,sensors:g=kt,collisionDetection:v=Re,measuring:b,modifiers:y,...x}=e;const C=f(qt,void 0,It),[S,R]=C,[N,E]=function(){const[e]=o(()=>/* @__PURE__ */new Set),t=a(t=>(e.add(t),()=>e.delete(t)),[e]);return[a(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[z,D]=o(Ht.Uninitialized),M=z===Ht.Initialized,{draggable:{active:T,nodes:A,translate:k},droppable:{containers:L}}=S,P=null!=T?A.get(T):null,F=i({initial:null,translated:null}),$=p(()=>{var e;return null!=T?{id:T,data:null!=(e=null==P?void 0:P.data)?e:Lt,rect:F}:null},[T,P]),B=i(null),[I,q]=o(null),[j,H]=o(null),K=V(x,Object.values(x)),U=Z("DndDescribedBy",d),Y=p(()=>L.getEnabled(),[L]),G=p(()=>({draggable:{...Pt.draggable,...null==_?void 0:_.draggable},droppable:{...Pt.droppable,...null==_?void 0:_.droppable},dragOverlay:{...Pt.dragOverlay,...null==_?void 0:_.dragOverlay}}),[null==(_=b)?void 0:_.draggable,null==_?void 0:_.droppable,null==_?void 0:_.dragOverlay]);var _;const{droppableRects:Q,measureDroppableContainers:ee,measuringScheduled:ne}=function(e,t){let{dragging:n,dependencies:r,config:s}=t;const[c,d]=o(null),{frequency:u,measure:p,strategy:h}=s,m=i(e),f=function(){switch(h){case yt.Always:return!1;case yt.BeforeDragging:return n;default:return!n}}(),g=V(f),v=a(function(e){void 0===e&&(e=[]),g.current||d(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[g]),b=i(null),y=J(t=>{if(f&&!n)return Ct;if(!t||t===Ct||m.current!==e||null!=c){const t=/* @__PURE__ */new Map;for(let n of e){if(!n)continue;if(c&&c.length>0&&!c.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new Xe(p(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,c,n,f,p]);return l(()=>{m.current=e},[e]),l(()=>{f||v()},[n,f]),l(()=>{c&&c.length>0&&d(null)},[JSON.stringify(c)]),l(()=>{f||"number"!=typeof u||null!==b.current||(b.current=setTimeout(()=>{v(),b.current=null},u))},[u,f,v,...r]),{droppableRects:y,measureDroppableContainers:v,measuringScheduled:null!=c}}(Y,{dragging:M,dependencies:[k.x,k.y],config:G.droppable}),re=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return J(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(A,T),ie=p(()=>j?oe(j):null,[j]),ae=function(){const e=!1===(null==I?void 0:I.autoScrollEnabled),t="object"==typeof h?!1===h.enabled:!1===h,n=M&&!e&&!t;if("object"==typeof h)return{...h,enabled:n};return{enabled:n}}(),le=function(e,t){return St(e,t)}(re,G.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const a=i(!1),{x:l,y:s}="boolean"==typeof o?{x:o,y:o}:o;X(()=>{if(!l&&!s||!t)return void(a.current=!1);if(a.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=Ne(n(e),r);if(l||(o.x=0),s||(o.y=0),a.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=ke(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,l,s,r,n])}({activeNode:null!=T?A.get(T):null,config:ae.layoutShiftCompensation,initialRect:le,measure:G.draggable.measure});const se=Et(re,G.draggable.measure,le),ce=Et(re?re.parentElement:null),ue=i({activatorEvent:null,active:null,activeNode:re,collisionRect:null,collisions:null,droppableRects:Q,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),pe=L.getNodeFor(null==(t=ue.current.over)?void 0:t.id),fe=At({measure:G.dragOverlay.measure}),ge=null!=(n=fe.nodeRef.current)?n:re,be=M?null!=(s=fe.rect)?s:se:null,ye=Boolean(fe.nodeRef.current&&fe.rect),we=Ne(xe=ye?null:se,St(xe));var xe;const Ce=Mt(ge?W(ge):null),Se=function(e){const t=i(e),n=J(n=>e?n&&n!==zt&&e&&t.current&&e.parentNode===t.current.parentNode?n:Ae(e):zt,[e]);return l(()=>{t.current=e},[e]),n}(M?null!=pe?pe:re:null),Ee=function(e,t){void 0===t&&(t=Me);const[n]=e,r=Mt(n?W(n):null),[i,a]=o(Tt);function l(){a(()=>e.length?e.map(e=>Ie(e)?r:new Xe(t(e),e)):Tt)}const s=Rt({callback:l});return X(()=>{null==s||s.disconnect(),l(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),i}(Se),De=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}(y,{transform:{x:k.x-we.x,y:k.y-we.y,scaleX:1,scaleY:1},activatorEvent:j,active:$,activeNodeRect:se,containerNodeRect:ce,draggingNodeRect:be,over:ue.current.over,overlayNodeRect:fe.rect,scrollableAncestors:Se,scrollableAncestorRects:Ee,windowRect:Ce}),Te=ie?te(ie,k):null,Pe=function(e){const[t,n]=o(null),r=i(e),s=a(e=>{const t=Le(e.target);t&&n(e=>e?(e.set(t,$e(t)),new Map(e)):null)},[]);return l(()=>{const t=r.current;if(e!==t){o(t);const i=e.map(e=>{const t=Le(e);return t?(t.addEventListener("scroll",s,{passive:!0}),[t,$e(t)]):null}).filter(e=>null!=e);n(i.length?new Map(i):null),r.current=e}return()=>{o(e),o(t)};function o(e){e.forEach(e=>{const t=Le(e);null==t||t.removeEventListener("scroll",s)})}},[s,e]),p(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>te(e,t),ve):Ke(e):ve,[e,t])}(Se),Fe=Dt(Pe),Be=Dt(Pe,[se]),Oe=te(De,Fe),qe=be?ze(be,De):null,We=$&&qe?v({active:$,collisionRect:qe,droppableRects:Q,droppableContainers:Y,pointerCoordinates:Te}):null,je=function(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}(We,"id"),[He,Ue]=o(null),Ye=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(ye?De:te(De,Be),null!=(c=null==He?void 0:He.rect)?c:null,se),Ve=i(null),Je=a((e,t)=>{let{sensor:n,options:r}=t;if(null==B.current)return;const o=A.get(B.current);if(!o)return;const i=e.nativeEvent,a=new n({active:B.current,activeNode:o,event:i,options:r,context:ue,onAbort(e){if(!A.get(e))return;const{onDragAbort:t}=K.current,n={id:e};null==t||t(n),N({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!A.get(e))return;const{onDragPending:o}=K.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),N({type:"onDragPending",event:i})},onStart(e){const t=B.current;if(null==t)return;const n=A.get(t);if(!n)return;const{onDragStart:r}=K.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:F}};w(()=>{null==r||r(o),D(Ht.Initializing),R({type:me.DragStart,initialCoordinates:e,active:t}),N({type:"onDragStart",event:o}),q(Ve.current),H(i)})},onMove(e){R({type:me.DragMove,coordinates:e})},onEnd:l(me.DragEnd),onCancel:l(me.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=ue.current;let a=null;if(t&&o){const{cancelDrop:l}=K.current;if(a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===me.DragEnd&&"function"==typeof l){await Promise.resolve(l(a))&&(e=me.DragCancel)}}B.current=null,w(()=>{R({type:e}),D(Ht.Uninitialized),Ue(null),q(null),H(null),Ve.current=null;const t=e===me.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=K.current[t];null==e||e(a),N({type:t,event:a})}})}}Ve.current=a},[A]),Ge=function(e,t){return p(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(g,a((e,t)=>(n,r)=>{const o=n.nativeEvent,i=A.get(r);if(null!==B.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},B.current=r,Je(n,t))},[A,Je]));!function(e){l(()=>{if(!O)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(g),X(()=>{se&&z===Ht.Initializing&&D(Ht.Initialized)},[se,z]),l(()=>{const{onDragMove:e}=K.current,{active:t,activatorEvent:n,collisions:r,over:o}=ue.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:Oe.x,y:Oe.y},over:o};w(()=>{null==e||e(i),N({type:"onDragMove",event:i})})},[Oe.x,Oe.y]),l(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=ue.current;if(!e||null==B.current||!t||!o)return;const{onDragOver:i}=K.current,a=r.get(je),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:l};w(()=>{Ue(l),null==i||i(s),N({type:"onDragOver",event:s})})},[je]),X(()=>{ue.current={activatorEvent:j,active:$,activeNode:re,collisionRect:qe,collisions:We,droppableRects:Q,draggableNodes:A,draggingNode:ge,draggingNodeRect:be,droppableContainers:L,over:He,scrollableAncestors:Se,scrollAdjustedTranslate:Oe},F.current={initial:be,translated:qe}},[$,re,We,qe,A,ge,be,Q,L,He,Se,Oe]),vt({...ae,delta:k,draggingRect:qe,pointerCoordinates:Te,scrollableAncestors:Se,scrollableAncestorRects:Ee});const _e=p(()=>({active:$,activeNode:re,activeNodeRect:se,activatorEvent:j,collisions:We,containerNodeRect:ce,dragOverlay:fe,draggableNodes:A,droppableContainers:L,droppableRects:Q,over:He,measureDroppableContainers:ee,scrollableAncestors:Se,scrollableAncestorRects:Ee,measuringConfiguration:G,measuringScheduled:ne,windowRect:Ce}),[$,re,se,j,We,ce,fe,A,L,Q,He,ee,Se,Ee,G,ne,Ce]),Qe=p(()=>({activatorEvent:j,activators:Ge,active:$,activeNodeRect:se,ariaDescribedById:{draggable:U},dispatch:R,draggableNodes:A,over:He,measureDroppableContainers:ee}),[j,Ge,$,se,R,U,A,He,ee]);return r.createElement(de.Provider,{value:E},r.createElement(Bt.Provider,{value:Qe},r.createElement(Ot.Provider,{value:_e},r.createElement(jt.Provider,{value:Ye},m)),r.createElement(Wt,{disabled:!1===(null==u?void 0:u.restoreFocus)})),r.createElement(he,{...u,hiddenTextDescribedById:U}))}),Xt=/* @__PURE__ */s(null),Yt="button";function Vt(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Z("Draggable"),{activators:a,activatorEvent:l,active:s,activeNodeRect:d,ariaDescribedById:u,draggableNodes:h,over:m}=c(Bt),{role:f=Yt,roleDescription:g="draggable",tabIndex:v=0}=null!=o?o:{},b=(null==s?void 0:s.id)===t,y=c(b?jt:Xt),[w,x]=G(),[C,S]=G(),R=function(e,t){return p(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(a,t),N=V(n);X(()=>(h.set(t,{id:t,key:i,node:w,activatorNode:C,data:N}),()=>{const e=h.get(t);e&&e.key===i&&h.delete(t)}),[h,t]);return{active:s,activatorEvent:l,activeNodeRect:d,attributes:p(()=>({role:f,tabIndex:v,"aria-disabled":r,"aria-pressed":!(!b||f!==Yt)||void 0,"aria-roledescription":g,"aria-describedby":u.draggable}),[r,f,v,b,g,u.draggable]),isDragging:b,listeners:r?void 0:R,node:w,over:m,setNodeRef:x,setActivatorNodeRef:S,transform:y}}const Jt={timeout:25};const Gt=({slotPosition:n,isEditing:r,isDragging:o,children:s})=>{const{attributes:d,listeners:u,setNodeRef:p,transform:h}=Vt({id:`slot-${n}`,data:{slotPosition:n},disabled:!r}),{setNodeRef:m,isOver:f}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=Z("Droppable"),{active:d,dispatch:u,over:p,measureDroppableContainers:h}=c(Bt),m=i({disabled:n}),f=i(!1),g=i(null),v=i(null),{disabled:b,updateMeasurementsFor:y,timeout:w}={...Jt,...o},x=V(null!=y?y:r),C=Rt({callback:a(()=>{f.current?(null!=v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{h(Array.isArray(x.current)?x.current:[x.current]),v.current=null},w)):f.current=!0},[w]),disabled:b||!d}),S=a((e,t)=>{C&&(t&&(C.unobserve(t),f.current=!1),e&&C.observe(e))},[C]),[R,N]=G(S),E=V(t);return l(()=>{C&&R.current&&(C.disconnect(),f.current=!1,C.observe(R.current))},[R,C]),l(()=>(u({type:me.RegisterDroppable,element:{id:r,key:s,disabled:n,node:R,rect:g,data:E}}),()=>u({type:me.UnregisterDroppable,key:s,id:r})),[r]),l(()=>{n!==m.current.disabled&&(u({type:me.SetDroppableDisabled,id:r,key:s,disabled:n}),m.current.disabled=n)},[r,s,n,u]),{active:d,rect:g,isOver:(null==p?void 0:p.id)===r,node:R,over:p,setNodeRef:N}}({id:`drop-${n}`,data:{slotPosition:n}}),g={position:"relative",height:"100%",width:"100%",transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:void 0},v=a(e=>{p(e),m(e)},[p,m]);/* @__PURE__ */
|
|
41
|
+
return e(F,{theme:l,layout:s,panels:c,...d})},I="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function q(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function H(e){return"nodeType"in e}function W(e){var t,n;return e?q(e)?e:H(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function j(e){const{Document:t}=W(e);return e instanceof t}function K(e){return!q(e)&&e instanceof W(e).HTMLElement}function U(e){return e instanceof W(e).SVGElement}function X(e){return e?q(e)?e.document:H(e)?j(e)?e:K(e)||U(e)?e.ownerDocument:document:document:document}const Y=I?h:l;function V(e){const t=i(e);return Y(()=>{t.current=e}),a(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function J(e,t){void 0===t&&(t=[e]);const n=i(e);return Y(()=>{n.current!==e&&(n.current=e)},t),n}function G(e,t){const n=i();return p(()=>{const t=e(n.current);return n.current=t,t},[...t])}function _(e){const t=V(e),n=i(null),r=a(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function Q(e){const t=i();return l(()=>{t.current=e},[e]),t.current}let Z={};function ee(e,t){return p(()=>{if(t)return t;const n=null==Z[e]?0:Z[e]+1;return Z[e]=n,e+"-"+n},[e,t])}function te(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((t,n)=>{const r=Object.entries(n);for(const[o,i]of r){const n=t[o];null!=n&&(t[o]=n+e*i)}return t},{...t})}}const ne=/* @__PURE__ */te(1),re=/* @__PURE__ */te(-1);function oe(e){if(!e)return!1;const{KeyboardEvent:t}=W(e.target);return t&&e instanceof t}function ie(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=W(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const ae="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function le(e){return e.matches(ae)?e:e.querySelector(ae)}const se={display:"none"};function ce(e){let{id:t,value:n}=e;return r.createElement("div",{id:t,style:se},n)}function de(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;return r.createElement("div",{id:t,style:{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"},role:"status","aria-live":o,"aria-atomic":!0},n)}const ue=/* @__PURE__ */s(null);const pe={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},he={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 me(e){let{announcements:t=he,container:n,hiddenTextDescribedById:i,screenReaderInstructions:s=pe}=e;const{announce:d,announcement:u}=function(){const[e,t]=o("");return{announce:a(e=>{null!=e&&t(e)},[]),announcement:e}}(),h=ee("DndLiveRegion"),[m,f]=o(!1);if(l(()=>{f(!0)},[]),function(e){const t=c(ue);l(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(p(()=>({onDragStart(e){let{active:n}=e;d(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&d(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;d(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;d(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;d(t.onDragCancel({active:n,over:r}))}}),[d,t])),!m)return null;const g=r.createElement(r.Fragment,null,r.createElement(ce,{id:i,value:s.draggable}),r.createElement(de,{id:h,announcement:u}));return n?x(g,n):g}var fe,ge;function ve(){}(ge=fe||(fe={})).DragStart="dragStart",ge.DragMove="dragMove",ge.DragEnd="dragEnd",ge.DragCancel="dragCancel",ge.DragOver="dragOver",ge.RegisterDroppable="registerDroppable",ge.SetDroppableDisabled="setDroppableDisabled",ge.UnregisterDroppable="unregisterDroppable";const be=/* @__PURE__ */Object.freeze({x:0,y:0});function ye(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function we(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function xe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Ce(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const Se=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Ce(t,t.left,t.top),i=[];for(const a of r){const{id:e}=a,t=n.get(e);if(t){const n=ye(Ce(t),o);i.push({id:e,data:{droppableContainer:a,value:n}})}}return i.sort(we)};function Re(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*l;return Number((o/(n+r-o)).toFixed(4))}return 0}const Ne=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:e}=i,r=n.get(e);if(r){const n=Re(r,t);n>0&&o.push({id:e,data:{droppableContainer:i,value:n}})}}return o.sort(xe)};function Ee(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:be}function De(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((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const ze=/* @__PURE__ */De(1);const Me={ignoreTransform:!1};function Te(e,t){void 0===t&&(t=Me);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=W(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=function(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]}}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}(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,s=e.left-a-(1-o)*parseFloat(n),c=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:c,right:s+d,bottom:c+u,left:s}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:l,right:s}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:s}}function Ae(e){return Te(e,{ignoreTransform:!0})}function ke(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(j(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!K(o)||U(o))return n;if(n.includes(o))return n;const i=W(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=W(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=W(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function Le(e){const[t]=ke(e,1);return null!=t?t:null}function Pe(e){return I&&e?q(e)?e:H(e)?j(e)||e===X(e).scrollingElement?window:K(e)?e:null:null:null}function Fe(e){return q(e)?e.scrollX:e.scrollLeft}function $e(e){return q(e)?e.scrollY:e.scrollTop}function Be(e){return{x:Fe(e),y:$e(e)}}var Oe,Ie;function qe(e){return!(!I||!e)&&e===document.scrollingElement}function He(e){const t={x:0,y:0},n=qe(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}(Ie=Oe||(Oe={}))[Ie.Forward=1]="Forward",Ie[Ie.Backward=-1]="Backward";const We={x:.2,y:.2};function je(e,t,n,r,o){let{top:i,left:a,right:l,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=We);const{isTop:c,isBottom:d,isLeft:u,isRight:p}=He(e),h={x:0,y:0},m={x:0,y:0},f=t.height*o.y,g=t.width*o.x;return!c&&i<=t.top+f?(h.y=Oe.Backward,m.y=r*Math.abs((t.top+f-i)/f)):!d&&s>=t.bottom-f&&(h.y=Oe.Forward,m.y=r*Math.abs((t.bottom-f-s)/f)),!p&&l>=t.right-g?(h.x=Oe.Forward,m.x=r*Math.abs((t.right-g-l)/g)):!u&&a<=t.left+g&&(h.x=Oe.Backward,m.x=r*Math.abs((t.left+g-a)/g)),{direction:h,speed:m}}function Ke(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}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 Ue(e){return e.reduce((e,t)=>ne(e,Be(t)),be)}const Xe=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Fe(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+$e(t),0)}]];class Ye{constructor(e,t){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=ke(t),r=Ue(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[o,i,a]of Xe)for(const e of i)Object.defineProperty(this,e,{get:()=>{const t=a(n),i=r[o]-t;return this.rect[e]+i},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ve{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Je(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?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}var Ge,_e,Qe,Ze;function et(e){e.preventDefault()}function tt(e){e.stopPropagation()}(_e=Ge||(Ge={})).Click="click",_e.DragStart="dragstart",_e.Keydown="keydown",_e.ContextMenu="contextmenu",_e.Resize="resize",_e.SelectionChange="selectionchange",_e.VisibilityChange="visibilitychange",(Ze=Qe||(Qe={})).Space="Space",Ze.Down="ArrowDown",Ze.Right="ArrowRight",Ze.Left="ArrowLeft",Ze.Up="ArrowUp",Ze.Esc="Escape",Ze.Enter="Enter",Ze.Tab="Tab";const nt={start:[Qe.Space,Qe.Enter],cancel:[Qe.Esc],end:[Qe.Space,Qe.Enter,Qe.Tab]},rt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Qe.Right:return{...n,x:n.x+25};case Qe.Left:return{...n,x:n.x-25};case Qe.Down:return{...n,y:n.y+25};case Qe.Up:return{...n,y:n.y-25}}};class ot{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Ve(X(t)),this.windowListeners=new Ve(W(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ge.Resize,this.handleCancel),this.windowListeners.add(Ge.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ge.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=Te),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Le(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(be)}handleKeyDown(e){if(oe(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=nt,coordinateGetter:i=rt,scrollBehavior:a="smooth"}=r,{code:l}=e;if(o.end.includes(l))return void this.handleEnd(e);if(o.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:s}=n.current,c=s?{x:s.left,y:s.top}:be;this.referenceCoordinates||(this.referenceCoordinates=c);const d=i(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=re(d,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:l,isLeft:s,isBottom:c,maxScroll:u,minScroll:p}=He(n),h=Ke(n),m={x:Math.min(o===Qe.Right?h.right-h.width/2:h.right,Math.max(o===Qe.Right?h.left:h.left+h.width/2,d.x)),y:Math.min(o===Qe.Down?h.bottom-h.height/2:h.bottom,Math.max(o===Qe.Down?h.top:h.top+h.height/2,d.y))},f=o===Qe.Right&&!l||o===Qe.Left&&!s,g=o===Qe.Down&&!c||o===Qe.Up&&!i;if(f&&m.x!==d.x){const e=n.scrollLeft+t.x,i=o===Qe.Right&&e<=u.x||o===Qe.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===Qe.Right?n.scrollLeft-u.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(g&&m.y!==d.y){const e=n.scrollTop+t.y,i=o===Qe.Down&&e<=u.y||o===Qe.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===Qe.Down?n.scrollTop-u.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,ne(re(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function it(e){return Boolean(e&&"distance"in e)}function at(e){return Boolean(e&&"delay"in e)}ot.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=nt,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class lt{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=W(e);return e instanceof t?e:X(e)}(e.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=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=X(i),this.documentListeners=new Ve(this.document),this.listeners=new Ve(n),this.windowListeners=new Ve(W(i)),this.initialCoordinates=null!=(r=ie(o))?r:be,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:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Ge.Resize,this.handleCancel),this.windowListeners.add(Ge.DragStart,et),this.windowListeners.add(Ge.VisibilityChange,this.handleCancel),this.windowListeners.add(Ge.ContextMenu,et),this.documentListeners.add(Ge.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(at(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(it(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Ge.Click,tt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ge.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const l=null!=(t=ie(e))?t:be,s=re(r,l);if(!n&&a){if(it(a)){if(null!=a.tolerance&&Je(s,a.tolerance))return this.handleCancel();if(Je(s,a.distance))return this.handleStart()}return at(a)&&Je(s,a.tolerance)?this.handleCancel():void this.handlePending(a,s)}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Qe.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const st={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ct extends lt{constructor(e){const{event:t}=e,n=X(t.target);super(e,st,n)}}ct.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const dt={move:{name:"mousemove"},end:{name:"mouseup"}};var ut,pt;(pt=ut||(ut={}))[pt.RightClick=2]="RightClick";(class extends lt{constructor(e){super(e,dt,X(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==ut.RightClick&&(null==r||r({event:n}),!0)}}];const ht={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var mt,ft,gt,vt;function bt(e){let{acceleration:t,activator:n=mt.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:c=5,order:d=gt.TreeOrder,pointerCoordinates:u,scrollableAncestors:h,scrollableAncestorRects:m,delta:f,threshold:g}=e;const v=function(e){let{delta:t,disabled:n}=e;const r=Q(t);return G(e=>{if(n||!r||!e)return yt;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Oe.Backward]:e.x[Oe.Backward]||-1===o.x,[Oe.Forward]:e.x[Oe.Forward]||1===o.x},y:{[Oe.Backward]:e.y[Oe.Backward]||-1===o.y,[Oe.Forward]:e.y[Oe.Forward]||1===o.y}}},[n,t,r])}({delta:f,disabled:!s}),[b,y]=function(){const e=i(null);return[a((t,n)=>{e.current=setInterval(t,n)},[]),a(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),w=i({x:0,y:0}),x=i({x:0,y:0}),C=p(()=>{switch(n){case mt.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case mt.DraggableRect:return o}},[n,o,u]),S=i(null),R=a(()=>{const e=S.current;if(!e)return;const t=w.current.x*x.current.x,n=w.current.y*x.current.y;e.scrollBy(t,n)},[]),N=p(()=>d===gt.TreeOrder?[...h].reverse():h,[d,h]);l(()=>{if(s&&h.length&&C){for(const e of N){if(!1===(null==r?void 0:r(e)))continue;const n=h.indexOf(e),o=m[n];if(!o)continue;const{direction:i,speed:a}=je(e,o,C,t,g);for(const e of["x","y"])v[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return y(),S.current=e,b(R,c),w.current=a,void(x.current=i)}w.current={x:0,y:0},x.current={x:0,y:0},y()}else y()},[t,R,r,y,s,c,JSON.stringify(C),JSON.stringify(v),b,h,N,m,JSON.stringify(g)])}(class extends lt{constructor(e){super(e,ht)}static setup(){return window.addEventListener(ht.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ht.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],(ft=mt||(mt={}))[ft.Pointer=0]="Pointer",ft[ft.DraggableRect=1]="DraggableRect",(vt=gt||(gt={}))[vt.TreeOrder=0]="TreeOrder",vt[vt.ReversedTreeOrder=1]="ReversedTreeOrder";const yt={x:{[Oe.Backward]:!1,[Oe.Forward]:!1},y:{[Oe.Backward]:!1,[Oe.Forward]:!1}};var wt,xt,Ct;(xt=wt||(wt={}))[xt.Always=0]="Always",xt[xt.BeforeDragging=1]="BeforeDragging",xt[xt.WhileDragging=2]="WhileDragging",(Ct||(Ct={})).Optimized="optimized";const St=/* @__PURE__ */new Map;function Rt(e,t){return G(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function Nt(e){let{callback:t,disabled:n}=e;const r=V(t),o=p(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return l(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function Et(e){return new Ye(Te(e),e)}function Dt(e,t,n){void 0===t&&(t=Et);const[r,i]=o(null);function a(){i(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}const s=function(e){let{callback:t,disabled:n}=e;const r=V(t),o=p(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return l(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),c=Nt({callback:a});return Y(()=>{a(),e?(null==c||c.observe(e),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==c||c.disconnect(),null==s||s.disconnect())},[e]),r}const zt=[];function Mt(e,t){void 0===t&&(t=[]);const n=i(null);return l(()=>{n.current=null},t),l(()=>{const t=e!==be;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?re(e,n.current):be}function Tt(e){return p(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const At=[];function kt(e){let{measure:t}=e;const[n,r]=o(null),i=Nt({callback:a(e=>{for(const{target:n}of e)if(K(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),l=a(e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return K(t)?t:e}(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?t(n):null)},[t,i]),[s,c]=_(l);return p(()=>({nodeRef:s,rect:n,setRef:c}),[n,s,c])}const Lt=[{sensor:ct,options:{}},{sensor:ot,options:{}}],Pt={current:{}},Ft={draggable:{measure:Ae},droppable:{measure:Ae,strategy:wt.WhileDragging,frequency:Ct.Optimized},dragOverlay:{measure:Te}};class $t extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Bt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:/* @__PURE__ */new Map,droppableRects:/* @__PURE__ */new Map,droppableContainers:/* @__PURE__ */new $t,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ve},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ft,measureDroppableContainers:ve,windowRect:null,measuringScheduled:!1},Ot=/* @__PURE__ */s({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ve,draggableNodes:/* @__PURE__ */new Map,over:null,measureDroppableContainers:ve}),It=/* @__PURE__ */s(Bt);function qt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:/* @__PURE__ */new Map,translate:{x:0,y:0}},droppable:{containers:new $t}}}function Ht(e,t){switch(t.type){case fe.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case fe.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case fe.DragEnd:case fe.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case fe.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new $t(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case fe.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new $t(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case fe.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new $t(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Wt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=c(Ot),i=Q(r),a=Q(null==n?void 0:n.id);return l(()=>{if(!t&&!r&&i&&null!=a){if(!oe(i))return;if(document.activeElement===i.target)return;const e=o.get(a);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=le(e);if(t){t.focus();break}}})}},[r,t,o,a,i]),null}const jt=/* @__PURE__ */s({...be,scaleX:1,scaleY:1});var Kt,Ut;(Ut=Kt||(Kt={}))[Ut.Uninitialized=0]="Uninitialized",Ut[Ut.Initializing=1]="Initializing",Ut[Ut.Initialized=2]="Initialized";const Xt=/* @__PURE__ */m(function(e){var t,n,s,c;let{id:d,accessibility:u,autoScroll:h=!0,children:m,sensors:g=Lt,collisionDetection:v=Ne,measuring:b,modifiers:y,...x}=e;const C=f(Ht,void 0,qt),[S,R]=C,[N,E]=function(){const[e]=o(()=>/* @__PURE__ */new Set),t=a(t=>(e.add(t),()=>e.delete(t)),[e]);return[a(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[D,z]=o(Kt.Uninitialized),M=D===Kt.Initialized,{draggable:{active:T,nodes:A,translate:k},droppable:{containers:L}}=S,P=null!=T?A.get(T):null,F=i({initial:null,translated:null}),$=p(()=>{var e;return null!=T?{id:T,data:null!=(e=null==P?void 0:P.data)?e:Pt,rect:F}:null},[T,P]),B=i(null),[O,q]=o(null),[H,j]=o(null),K=J(x,Object.values(x)),U=ee("DndDescribedBy",d),X=p(()=>L.getEnabled(),[L]),V=p(()=>({draggable:{...Ft.draggable,...null==_?void 0:_.draggable},droppable:{...Ft.droppable,...null==_?void 0:_.droppable},dragOverlay:{...Ft.dragOverlay,...null==_?void 0:_.dragOverlay}}),[null==(_=b)?void 0:_.draggable,null==_?void 0:_.droppable,null==_?void 0:_.dragOverlay]);var _;const{droppableRects:Q,measureDroppableContainers:Z,measuringScheduled:te}=function(e,t){let{dragging:n,dependencies:r,config:s}=t;const[c,d]=o(null),{frequency:u,measure:p,strategy:h}=s,m=i(e),f=function(){switch(h){case wt.Always:return!1;case wt.BeforeDragging:return n;default:return!n}}(),g=J(f),v=a(function(e){void 0===e&&(e=[]),g.current||d(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[g]),b=i(null),y=G(t=>{if(f&&!n)return St;if(!t||t===St||m.current!==e||null!=c){const t=/* @__PURE__ */new Map;for(let n of e){if(!n)continue;if(c&&c.length>0&&!c.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new Ye(p(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,c,n,f,p]);return l(()=>{m.current=e},[e]),l(()=>{f||v()},[n,f]),l(()=>{c&&c.length>0&&d(null)},[JSON.stringify(c)]),l(()=>{f||"number"!=typeof u||null!==b.current||(b.current=setTimeout(()=>{v(),b.current=null},u))},[u,f,v,...r]),{droppableRects:y,measureDroppableContainers:v,measuringScheduled:null!=c}}(X,{dragging:M,dependencies:[k.x,k.y],config:V.droppable}),re=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return G(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(A,T),oe=p(()=>H?ie(H):null,[H]),ae=function(){const e=!1===(null==O?void 0:O.autoScrollEnabled),t="object"==typeof h?!1===h.enabled:!1===h,n=M&&!e&&!t;if("object"==typeof h)return{...h,enabled:n};return{enabled:n}}(),le=function(e,t){return Rt(e,t)}(re,V.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const a=i(!1),{x:l,y:s}="boolean"==typeof o?{x:o,y:o}:o;Y(()=>{if(!l&&!s||!t)return void(a.current=!1);if(a.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=Ee(n(e),r);if(l||(o.x=0),s||(o.y=0),a.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=Le(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,l,s,r,n])}({activeNode:null!=T?A.get(T):null,config:ae.layoutShiftCompensation,initialRect:le,measure:V.draggable.measure});const se=Dt(re,V.draggable.measure,le),ce=Dt(re?re.parentElement:null),de=i({activatorEvent:null,active:null,activeNode:re,collisionRect:null,collisions:null,droppableRects:Q,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),pe=L.getNodeFor(null==(t=de.current.over)?void 0:t.id),he=kt({measure:V.dragOverlay.measure}),ge=null!=(n=he.nodeRef.current)?n:re,ve=M?null!=(s=he.rect)?s:se:null,ye=Boolean(he.nodeRef.current&&he.rect),we=Ee(xe=ye?null:se,Rt(xe));var xe;const Ce=Tt(ge?W(ge):null),Se=function(e){const t=i(e),n=G(n=>e?n&&n!==zt&&e&&t.current&&e.parentNode===t.current.parentNode?n:ke(e):zt,[e]);return l(()=>{t.current=e},[e]),n}(M?null!=pe?pe:re:null),Re=function(e,t){void 0===t&&(t=Te);const[n]=e,r=Tt(n?W(n):null),[i,a]=o(At);function l(){a(()=>e.length?e.map(e=>qe(e)?r:new Ye(t(e),e)):At)}const s=Nt({callback:l});return Y(()=>{null==s||s.disconnect(),l(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),i}(Se),De=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}(y,{transform:{x:k.x-we.x,y:k.y-we.y,scaleX:1,scaleY:1},activatorEvent:H,active:$,activeNodeRect:se,containerNodeRect:ce,draggingNodeRect:ve,over:de.current.over,overlayNodeRect:he.rect,scrollableAncestors:Se,scrollableAncestorRects:Re,windowRect:Ce}),Me=oe?ne(oe,k):null,Ae=function(e){const[t,n]=o(null),r=i(e),s=a(e=>{const t=Pe(e.target);t&&n(e=>e?(e.set(t,Be(t)),new Map(e)):null)},[]);return l(()=>{const t=r.current;if(e!==t){o(t);const i=e.map(e=>{const t=Pe(e);return t?(t.addEventListener("scroll",s,{passive:!0}),[t,Be(t)]):null}).filter(e=>null!=e);n(i.length?new Map(i):null),r.current=e}return()=>{o(e),o(t)};function o(e){e.forEach(e=>{const t=Pe(e);null==t||t.removeEventListener("scroll",s)})}},[s,e]),p(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>ne(e,t),be):Ue(e):be,[e,t])}(Se),Fe=Mt(Ae),$e=Mt(Ae,[se]),Oe=ne(De,Fe),Ie=ve?ze(ve,De):null,He=$&&Ie?v({active:$,collisionRect:Ie,droppableRects:Q,droppableContainers:X,pointerCoordinates:Me}):null,We=function(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}(He,"id"),[je,Ke]=o(null),Xe=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(ye?De:ne(De,$e),null!=(c=null==je?void 0:je.rect)?c:null,se),Ve=i(null),Je=a((e,t)=>{let{sensor:n,options:r}=t;if(null==B.current)return;const o=A.get(B.current);if(!o)return;const i=e.nativeEvent,a=new n({active:B.current,activeNode:o,event:i,options:r,context:de,onAbort(e){if(!A.get(e))return;const{onDragAbort:t}=K.current,n={id:e};null==t||t(n),N({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!A.get(e))return;const{onDragPending:o}=K.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),N({type:"onDragPending",event:i})},onStart(e){const t=B.current;if(null==t)return;const n=A.get(t);if(!n)return;const{onDragStart:r}=K.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:F}};w(()=>{null==r||r(o),z(Kt.Initializing),R({type:fe.DragStart,initialCoordinates:e,active:t}),N({type:"onDragStart",event:o}),q(Ve.current),j(i)})},onMove(e){R({type:fe.DragMove,coordinates:e})},onEnd:l(fe.DragEnd),onCancel:l(fe.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=de.current;let a=null;if(t&&o){const{cancelDrop:l}=K.current;if(a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===fe.DragEnd&&"function"==typeof l){await Promise.resolve(l(a))&&(e=fe.DragCancel)}}B.current=null,w(()=>{R({type:e}),z(Kt.Uninitialized),Ke(null),q(null),j(null),Ve.current=null;const t=e===fe.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=K.current[t];null==e||e(a),N({type:t,event:a})}})}}Ve.current=a},[A]),Ge=function(e,t){return p(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(g,a((e,t)=>(n,r)=>{const o=n.nativeEvent,i=A.get(r);if(null!==B.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},B.current=r,Je(n,t))},[A,Je]));!function(e){l(()=>{if(!I)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(g),Y(()=>{se&&D===Kt.Initializing&&z(Kt.Initialized)},[se,D]),l(()=>{const{onDragMove:e}=K.current,{active:t,activatorEvent:n,collisions:r,over:o}=de.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:Oe.x,y:Oe.y},over:o};w(()=>{null==e||e(i),N({type:"onDragMove",event:i})})},[Oe.x,Oe.y]),l(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=de.current;if(!e||null==B.current||!t||!o)return;const{onDragOver:i}=K.current,a=r.get(We),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:l};w(()=>{Ke(l),null==i||i(s),N({type:"onDragOver",event:s})})},[We]),Y(()=>{de.current={activatorEvent:H,active:$,activeNode:re,collisionRect:Ie,collisions:He,droppableRects:Q,draggableNodes:A,draggingNode:ge,draggingNodeRect:ve,droppableContainers:L,over:je,scrollableAncestors:Se,scrollAdjustedTranslate:Oe},F.current={initial:ve,translated:Ie}},[$,re,He,Ie,A,ge,ve,Q,L,je,Se,Oe]),bt({...ae,delta:k,draggingRect:Ie,pointerCoordinates:Me,scrollableAncestors:Se,scrollableAncestorRects:Re});const _e=p(()=>({active:$,activeNode:re,activeNodeRect:se,activatorEvent:H,collisions:He,containerNodeRect:ce,dragOverlay:he,draggableNodes:A,droppableContainers:L,droppableRects:Q,over:je,measureDroppableContainers:Z,scrollableAncestors:Se,scrollableAncestorRects:Re,measuringConfiguration:V,measuringScheduled:te,windowRect:Ce}),[$,re,se,H,He,ce,he,A,L,Q,je,Z,Se,Re,V,te,Ce]),Qe=p(()=>({activatorEvent:H,activators:Ge,active:$,activeNodeRect:se,ariaDescribedById:{draggable:U},dispatch:R,draggableNodes:A,over:je,measureDroppableContainers:Z}),[H,Ge,$,se,R,U,A,je,Z]);return r.createElement(ue.Provider,{value:E},r.createElement(Ot.Provider,{value:Qe},r.createElement(It.Provider,{value:_e},r.createElement(jt.Provider,{value:Xe},m)),r.createElement(Wt,{disabled:!1===(null==u?void 0:u.restoreFocus)})),r.createElement(me,{...u,hiddenTextDescribedById:U}))}),Yt=/* @__PURE__ */s(null),Vt="button";function Jt(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=ee("Draggable"),{activators:a,activatorEvent:l,active:s,activeNodeRect:d,ariaDescribedById:u,draggableNodes:h,over:m}=c(Ot),{role:f=Vt,roleDescription:g="draggable",tabIndex:v=0}=null!=o?o:{},b=(null==s?void 0:s.id)===t,y=c(b?jt:Yt),[w,x]=_(),[C,S]=_(),R=function(e,t){return p(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(a,t),N=J(n);Y(()=>(h.set(t,{id:t,key:i,node:w,activatorNode:C,data:N}),()=>{const e=h.get(t);e&&e.key===i&&h.delete(t)}),[h,t]);return{active:s,activatorEvent:l,activeNodeRect:d,attributes:p(()=>({role:f,tabIndex:v,"aria-disabled":r,"aria-pressed":!(!b||f!==Vt)||void 0,"aria-roledescription":g,"aria-describedby":u.draggable}),[r,f,v,b,g,u.draggable]),isDragging:b,listeners:r?void 0:R,node:w,over:m,setNodeRef:x,setActivatorNodeRef:S,transform:y}}const Gt={timeout:25};const _t=({slotPosition:n,isEditing:r,isDragging:o,children:s})=>{const{attributes:d,listeners:u,setNodeRef:p,transform:h}=Jt({id:`slot-${n}`,data:{slotPosition:n},disabled:!r}),{setNodeRef:m,isOver:f}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=ee("Droppable"),{active:d,dispatch:u,over:p,measureDroppableContainers:h}=c(Ot),m=i({disabled:n}),f=i(!1),g=i(null),v=i(null),{disabled:b,updateMeasurementsFor:y,timeout:w}={...Gt,...o},x=J(null!=y?y:r),C=Nt({callback:a(()=>{f.current?(null!=v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{h(Array.isArray(x.current)?x.current:[x.current]),v.current=null},w)):f.current=!0},[w]),disabled:b||!d}),S=a((e,t)=>{C&&(t&&(C.unobserve(t),f.current=!1),e&&C.observe(e))},[C]),[R,N]=_(S),E=J(t);return l(()=>{C&&R.current&&(C.disconnect(),f.current=!1,C.observe(R.current))},[R,C]),l(()=>(u({type:fe.RegisterDroppable,element:{id:r,key:s,disabled:n,node:R,rect:g,data:E}}),()=>u({type:fe.UnregisterDroppable,key:s,id:r})),[r]),l(()=>{n!==m.current.disabled&&(u({type:fe.SetDroppableDisabled,id:r,key:s,disabled:n}),m.current.disabled=n)},[r,s,n,u]),{active:d,rect:g,isOver:(null==p?void 0:p.id)===r,node:R,over:p,setNodeRef:N}}({id:`drop-${n}`,data:{slotPosition:n}}),g={position:"relative",height:"100%",width:"100%",transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:void 0},v=a(e=>{p(e),m(e)},[p,m]);/* @__PURE__ */
|
|
42
42
|
return t("div",{ref:v,style:g,className:`slot-with-overlay ${r?"edit-mode":""} ${o?"dragging":""} ${f?"drag-over":""}`,children:[s,r&&/* @__PURE__ */t("div",{className:"slot-edit-overlay",...d,...u,children:[
|
|
43
43
|
/* @__PURE__ */e("div",{className:"drag-indicator",children:"⋮⋮"}),
|
|
44
|
-
/* @__PURE__ */e("div",{className:"slot-position-label",children:n.toUpperCase()})]})]})},
|
|
45
|
-
return e(
|
|
46
|
-
/* @__PURE__ */e(
|
|
47
|
-
return e("div",{style:{position:"fixed",top:o.top,left:o.left,width:o.width,height:o.height,pointerEvents:"auto"},children:/* @__PURE__ */e(
|
|
48
|
-
return t("div",{className:`panel-configurator ${s}`,style:
|
|
44
|
+
/* @__PURE__ */e("div",{className:"slot-position-label",children:n.toUpperCase()})]})]})},Qt=({isEditMode:n,onLayoutChange:r,panels:i,layout:s,...c})=>{const[d,u]=o(null),[h,m]=o({x:0,y:0}),f=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p(()=>[...t].filter(e=>null!=e),[...t])}(p(()=>({sensor:g,options:null!=v?v:{}}),[g=ct,v={activationConstraint:{distance:8}}]));var g,v;const b=a(e=>{const t=e.active.id;if(t.startsWith("slot-")){const e=t.replace("slot-","");u(e),m({x:0,y:0})}},[]),y=a(e=>{const{delta:t}=e;m({x:t.x,y:t.y})},[]),w=a(e=>{const{active:t,over:n}=e;if(u(null),m({x:0,y:0}),!n)return;const o=t.id,i=n.id,a=o.replace("slot-",""),l=i.replace("drop-","");if(a===l)return;const c={...s},d=c[a];c[a]=c[l],c[l]=d,r&&r(c)},[s,r]);l(()=>{if(!d||!n)return;const e=document.querySelector(`[data-slot="${d}"]`);return e&&(e.setAttribute("data-dragging","true"),e.style.setProperty("transform",`scale(0.95) translate(${h.x}px, ${h.y}px)`,"important"),e.style.setProperty("z-index","1000","important"),e.style.setProperty("transition","none","important"),e.style.setProperty("opacity","0.95","important"),e.style.setProperty("box-shadow","0 12px 24px rgba(0, 0, 0, 0.25)","important")),()=>{e&&(e.removeAttribute("data-dragging"),e.style.removeProperty("transform"),e.style.removeProperty("z-index"),e.style.removeProperty("transition"),e.style.removeProperty("opacity"),e.style.removeProperty("box-shadow"))}},[d,h,n]);/* @__PURE__ */
|
|
45
|
+
return e(Xt,{sensors:f,collisionDetection:Se,onDragStart:b,onDragMove:y,onDragEnd:w,children:/* @__PURE__ */t("div",{className:"editable-panel-layout "+(n?"edit-mode-active":""),children:[
|
|
46
|
+
/* @__PURE__ */e(F,{...c,panels:i,layout:s,slotDataAttributes:{left:{"data-slot":"left","data-edit-mode":n?"true":"false"},middle:{"data-slot":"middle","data-edit-mode":n?"true":"false"},right:{"data-slot":"right","data-edit-mode":n?"true":"false"}}}),n&&/* @__PURE__ */e(Zt,{layout:s,activeSlot:d,onDragStart:()=>{},onDragEnd:()=>{}})]})})},Zt=({layout:t,activeSlot:n})=>{const[i,a]=o(/* @__PURE__ */new Map);return r.useEffect(()=>{const e=()=>{const e=/* @__PURE__ */new Map;["left","middle","right"].forEach(t=>{const n=document.querySelector(`[data-slot="${t}"]`);if(n){const r=n.getBoundingClientRect();e.set(t,r)}}),a(e)};e(),window.addEventListener("resize",e);const t=setInterval(e,100);return()=>{window.removeEventListener("resize",e),clearInterval(t)}},[t]),/* @__PURE__ */e("div",{style:{pointerEvents:"none",position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:999},children:["left","middle","right"].map(r=>{if(!t[r])return null;const o=i.get(r);if(!o)return null;const a=n===r;/* @__PURE__ */
|
|
47
|
+
return e("div",{style:{position:"fixed",top:o.top,left:o.left,width:o.width,height:o.height,pointerEvents:"auto"},children:/* @__PURE__ */e(_t,{slotPosition:r,isEditing:!0,isDragging:a,children:/* @__PURE__ */e("div",{style:{height:"100%"}})})},r)})})},en=e=>null!=e&&"object"==typeof e&&"type"in e,tn=e=>null==e?[]:"string"==typeof e?[e]:en(e)?e.panels:[],nn=({availablePanels:r,currentLayout:i,onChange:l,className:s="",theme:c})=>{const d=C(),u=c||d.theme,[p,h]=o(null),m=a(e=>e&&r.find(t=>t.id===e)||null,[r]),f=a(()=>[...r].sort((e,t)=>e.label.localeCompare(t.label)),[r]),g=a(e=>{const t=tn(i.left),n=tn(i.middle),r=tn(i.right);return t.includes(e)||n.includes(e)||r.includes(e)},[i]),v=a((e,t)=>{const n={...e};return["left","middle","right"].forEach(e=>{const r=n[e];if(r===t)n[e]=null;else if(null!=r&&en(r)){const o=r.panels.filter(e=>e!==t);0===o.length?n[e]=null:1===o.length?n[e]=o[0]:n[e]={...r,panels:o}}}),n},[]),b=a((e,t)=>{const n=i[e];if(!en(n)||"tabs"!==n.type)return;const r=n.panels.filter(e=>e!==t),o={...i};o[e]={...n,panels:r},l(o)},[i,l]),y=a((e,t)=>{t.stopPropagation();const n=i[e];if(en(n)&&"tabs"===n.type){const t={...i};t[e]=n.panels.length>0?n.panels[0]:null,l(t),h(null)}else{const t=n&&"string"==typeof n?[n]:[],r={...i};r[e]={type:"tabs",panels:t,config:{defaultActiveTab:0,tabPosition:"top"}},l(r),h({type:"slot",position:e})}},[i,l]),w=a(e=>{if(p)if("slot"===p.type){if(p.position===e)return;const t={...i},n=t[p.position];t[p.position]=t[e],t[e]=n,l(t),h(null)}else{const t=i[e];if(en(t)&&"tabs"===t.type){if(t.panels.includes(p.id))return void b(e,p.id);const n=t,r=v(i,p.id);return r[e]={...n,panels:[...n.panels,p.id]},void l(r)}{const t=v(i,p.id);t[e]=p.id,l(t),h(null)}}else h({type:"slot",position:e})},[p,i,l,v,b]),x=a(e=>{if(p)if("slot"===p.type){const t=i[p.position];if(en(t)&&"tabs"===t.type){if(t.panels.includes(e))return void b(p.position,e);const n=t,r=v(i,e);return r[p.position]={...n,panels:[...n.panels,e]},void l(r)}{const t=v(i,e);t[p.position]=e,l(t),h(null)}}else h({type:"panel",id:e});else h({type:"panel",id:e})},[p,i,l,v,b]),S=a((e,t)=>{t.stopPropagation();const n={...i};n[e]=null,l(n),h(null)},[i,l]),R=a((e,t,n)=>{n.stopPropagation();const r=i[e];if(!en(r)||"tabs"!==r.type)return;const o=r.panels.filter(e=>e!==t),a={...i};a[e]={...r,panels:o},l(a)},[i,l]),N=a((e,t)=>{const n=i[e];if(!en(n)||"tabs"!==n.type)return;const r={...i};r[e]={...n,config:{...n.config,...t}},l(r)},[i,l]),E=f(),D=e=>{const t=i[e];return en(t)&&"tabs"===t.type},z={"--configurator-bg":u.colors.background,"--configurator-title":u.colors.textSecondary,"--slot-bg":u.colors.backgroundSecondary,"--slot-border":u.colors.border,"--slot-border-hover":u.colors.textTertiary,"--slot-border-selected":u.colors.primary,"--slot-bg-selected":u.colors.backgroundLight,"--slot-label":u.colors.textTertiary,"--slot-content-text":u.colors.text,"--slot-preview-bg":u.colors.backgroundTertiary,"--slot-preview-border":u.colors.border,"--slot-preview-text":u.colors.textMuted,"--slot-empty-text":u.colors.textMuted,"--panel-bg":u.colors.backgroundSecondary,"--panel-border":u.colors.border,"--panel-border-hover":u.colors.textSecondary,"--panel-border-selected":u.colors.primary,"--panel-bg-selected":u.colors.backgroundLight,"--panel-label-text":u.colors.text,"--panel-preview-bg":u.colors.backgroundTertiary,"--panel-preview-text":u.colors.textMuted,"--clear-btn-bg":u.colors.error,"--clear-btn-text":u.colors.background,"--clear-btn-hover":u.colors.error,"--hint-bg":u.colors.backgroundLight,"--hint-border":u.colors.primary,"--hint-text":u.colors.text};/* @__PURE__ */
|
|
48
|
+
return t("div",{className:`panel-configurator ${s}`,style:z,children:[
|
|
49
49
|
/* @__PURE__ */t("div",{className:"configurator-section",children:[
|
|
50
50
|
/* @__PURE__ */e("h3",{className:"section-title",children:"Panel Layout (3 Slots)"}),
|
|
51
|
-
/* @__PURE__ */e("div",{className:"slots-container",children:["left","middle","right"].map(n=>{const r=i[n],o=(e=>"slot"===p?.type&&p.position===e)(n),a=
|
|
51
|
+
/* @__PURE__ */e("div",{className:"slots-container",children:["left","middle","right"].map(n=>{const r=i[n],o=(e=>"slot"===p?.type&&p.position===e)(n),a=en(r)&&"tabs"===r.type;/* @__PURE__ */
|
|
52
52
|
return t("div",{"data-position":n,className:`slot ${o?"selected":""} ${null!==r?"filled":"empty"} ${a?"tab-group":""}`,onClick:()=>w(n),children:[
|
|
53
|
-
/* @__PURE__ */e("button",{className:"tab-mode-toggle "+(a?"active":""),onClick:e=>y(n,e),title:a?"Disable tab mode":"Enable tab mode",children:/* @__PURE__ */e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:/* @__PURE__ */e("path",{d:"M2 2h4v2H2V2zm5 0h4v2H7V2zm5 0h2v2h-2V2zM2 5h12v9H2V5zm1 1v7h10V6H3z"})})}),null===r?/* @__PURE__ */e("div",{className:"slot-empty-state",children:a?"Click panels to add tabs":"Empty"}):
|
|
53
|
+
/* @__PURE__ */e("button",{className:"tab-mode-toggle "+(a?"active":""),onClick:e=>y(n,e),title:a?"Disable tab mode":"Enable tab mode",children:/* @__PURE__ */e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:/* @__PURE__ */e("path",{d:"M2 2h4v2H2V2zm5 0h4v2H7V2zm5 0h2v2h-2V2zM2 5h12v9H2V5zm1 1v7h10V6H3z"})})}),null===r?/* @__PURE__ */e("div",{className:"slot-empty-state",children:a?"Click panels to add tabs":"Empty"}):en(r)?/* @__PURE__ */t("div",{className:"slot-content group-content",children:["tabs"===r.type&&r.panels.length>0&&/* @__PURE__ */e("div",{className:"tab-config-controls",children:/* @__PURE__ */t("label",{className:"tab-config-label",children:["Tabs:",
|
|
54
54
|
/* @__PURE__ */t("select",{value:r.config?.tabPosition||"top",onChange:e=>N(n,{tabPosition:e.target.value}),onClick:e=>e.stopPropagation(),children:[
|
|
55
55
|
/* @__PURE__ */e("option",{value:"top",children:"Top (centered)"}),
|
|
56
56
|
/* @__PURE__ */e("option",{value:"bottom",children:"Bottom (centered)"}),
|
|
@@ -65,8 +65,8 @@ return t("div",{"data-position":n,className:`slot ${o?"selected":""} ${null!==r?
|
|
|
65
65
|
/* @__PURE__ */e("h3",{className:"section-title",children:"Available Panels"}),
|
|
66
66
|
/* @__PURE__ */e("div",{className:"available-panels",children:E.map(n=>{const r=(o=n.id,"panel"===p?.type&&p.id===o);var o;const i=g(n.id);/* @__PURE__ */
|
|
67
67
|
return t("div",{className:`available-panel ${r?"selected":""} ${i?"in-use":""}`,onClick:()=>x(n.id),children:[
|
|
68
|
-
/* @__PURE__ */e("div",{className:"panel-label",children:n.label}),n.preview&&/* @__PURE__ */e("div",{className:"panel-preview",children:n.preview})]},n.id)})})]}),p&&/* @__PURE__ */e("div",{className:"selection-hint",children:"slot"===p.type?
|
|
68
|
+
/* @__PURE__ */e("div",{className:"panel-label",children:n.label}),n.preview&&/* @__PURE__ */e("div",{className:"panel-preview",children:n.preview})]},n.id)})})]}),p&&/* @__PURE__ */e("div",{className:"selection-hint",children:"slot"===p.type?D(p.position)?/* @__PURE__ */t(n,{children:["Selected: ",p.position," slot (Tab Mode). Click panels to add them to the tab group."]}):/* @__PURE__ */t(n,{children:["Selected: ",p.position," slot. Click another slot to swap, or click a panel to assign."]}):/* @__PURE__ */t(n,{children:["Selected: ",m(p.id)?.label,". Click a slot to assign",D("left")||D("middle")||D("right")?" (or add to tab group)":"","."]})}),
|
|
69
69
|
/* @__PURE__ */t("div",{className:"usage-hint",children:[
|
|
70
70
|
/* @__PURE__ */e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",style:{verticalAlign:"text-bottom",marginRight:"4px"},children:/* @__PURE__ */e("path",{d:"M8 1a7 7 0 100 14A7 7 0 008 1zm0 1a6 6 0 110 12A6 6 0 018 2zm.5 3.5v3h-1v-3h1zm0 4v1h-1v-1h1z"})}),
|
|
71
|
-
/* @__PURE__ */e("strong",{children:"Tip:"})," Toggle the tab icon on a slot to enable tab mode, then click panels to add multiple tabs."]})]})};export{N as AnimatedResizableLayout,E as AnimatedVerticalLayout,
|
|
71
|
+
/* @__PURE__ */e("strong",{children:"Tip:"})," Toggle the tab icon on a slot to enable tab mode, then click panels to add multiple tabs."]})]})};export{N as AnimatedResizableLayout,E as AnimatedVerticalLayout,D as CollapsibleSplitPane,F as ConfigurablePanelLayout,Qt as EditableConfigurablePanelLayout,k as PanelBoundsProvider,nn as PanelConfigurator,O as ResponsiveConfigurablePanelLayout,$ as SnapCarousel,M as TabGroup,S as mapThemeToPanelVars,R as mapThemeToTabVars,B as useMediaQuery,L as usePanelBounds,P as usePanelOffset};
|
|
72
72
|
//# sourceMappingURL=index.esm.js.map
|