@principal-ade/panels 1.0.69 → 1.0.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurablePanelLayout.d.ts","sourceRoot":"","sources":["../../src/components/ConfigurablePanelLayout.tsx"],"names":[],"mappings":"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
|
|
1
|
+
{"version":3,"file":"ConfigurablePanelLayout.d.ts","sourceRoot":"","sources":["../../src/components/ConfigurablePanelLayout.tsx"],"names":[],"mappings":"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"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import r,{useState as o,useRef as l,useCallback as i,useEffect as a,createContext as s,useContext as c,forwardRef as d,useImperativeHandle as u,useMemo as p,useLayoutEffect as h,memo as g,useReducer as v}from"react";import{Group as m,Panel as f,Separator as b}from"react-resizable-panels";import{unstable_batchedUpdates as y,createPortal as w}from"react-dom";import{useTheme as x}from"@principal-ade/industry-theme";import './index.css';function C(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 N(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 S=({leftPanel:n,rightPanel:r,collapsibleSide:s="left",defaultSize:c=25,minSize:d=5,className:u="",collapsed:p=!1,style:h,showCollapseButton:g=!1,animationDuration:v=300,animationEasing:y="cubic-bezier(0.4, 0, 0.2, 1)",onCollapseStart:w,onCollapseComplete:x,onExpandStart:N,onExpandComplete:S,theme:E})=>{const[D,R]=o(p),[z,k]=o(!1),[P
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import r,{useState as o,useRef as l,useCallback as i,useEffect as a,createContext as s,useContext as c,forwardRef as d,useImperativeHandle as u,useMemo as p,useLayoutEffect as h,memo as g,useReducer as v}from"react";import{Group as m,Panel as f,Separator as b}from"react-resizable-panels";import{unstable_batchedUpdates as y,createPortal as w}from"react-dom";import{useTheme as x}from"@principal-ade/industry-theme";import './index.css';function C(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 N(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 S=({leftPanel:n,rightPanel:r,collapsibleSide:s="left",defaultSize:c=25,minSize:d=5,className:u="",collapsed:p=!1,style:h,showCollapseButton:g=!1,animationDuration:v=300,animationEasing:y="cubic-bezier(0.4, 0, 0.2, 1)",onCollapseStart:w,onCollapseComplete:x,onExpandStart:N,onExpandComplete:S,theme:E})=>{const[D,R]=o(p),[z,k]=o(!1),[L,P]=o(!1),[M,A]=o(p),[T,$]=o(p?0:c),B=l(null),O=l(void 0),F=l(void 0),I=l(void 0),H=i((e,t,n)=>{if(!B.current)return;O.current&&cancelAnimationFrame(O.current),F.current=performance.now();const r=o=>{if(!F.current||!B.current)return;const l=o-F.current,i=Math.min(l/v,1),a=i<.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2,s=e+(t-e)*a;B.current.resize(s),i<1?O.current=requestAnimationFrame(r):(0===t?B.current.collapse():B.current.resize(t),k(!1),n&&n())};O.current=requestAnimationFrame(r)},[v]),W=i(()=>{z||L||(k(!0),R(!0),w&&w(),H(T,0,()=>{$(0),A(!0),x&&x()}))},[z,L,T,H,w,x]),j=i(()=>{z||L||(k(!0),R(!1),A(!1),N&&N(),H(0,c,()=>{$(c),S&&S()}))},[z,L,c,H,N,S]),q=i(()=>{D?j():W()},[D,W,j]),K=i(e=>{if(!z){const t=e.asPercentage;$(t),t>0&&R(!1)}},[z]),U=i(()=>{z||P(!0)},[z]),X=i(()=>{P(!1)},[]);a(()=>{p!==D&&(p?W():j())},[p]),a(()=>{p&&!z?A(!0):p||z||A(!1)},[p,z]),a(()=>{const e=O.current,t=I.current;return()=>{e&&cancelAnimationFrame(e),t&&clearTimeout(t)}},[]);const Y="left"===s,V=D?Y?"▸":"◂":Y?"◂":"▸",J=C(E),G=z&&!L?{transition:`flex ${v}ms ${y}`}:void 0,_=e=>{let t="hybrid-panel";return e&&(t+=" collapsible-panel",z&&!L&&(t+=" animating"),D&&(t+=" collapsed")),t};/* @__PURE__ */
|
|
2
2
|
return e("div",{className:`animated-resizable-layout ${u}`,style:{...J,...h},children:/* @__PURE__ */t(m,{orientation:"horizontal",onLayoutChange:U,onLayoutChanged:X,children:[
|
|
3
3
|
/* @__PURE__ */e(f,{panelRef:Y?B:void 0,collapsible:Y,defaultSize:Y?p?"0%":`${c}%`:void 0,minSize:Y?`${d}%`:"30%",collapsedSize:"0%",onResize:Y?K:void 0,className:_(Y),style:Y?G:void 0,children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:Y&&D?0:1,transition:z?`opacity ${.5*v}ms ${y}`:"none"},children:n})}),
|
|
4
4
|
/* @__PURE__ */e(b,{className:"resize-handle "+(M?"collapsed":""),style:M?{visibility:"hidden",width:0}:void 0,children:g&&/* @__PURE__ */e("div",{className:"handle-bar",children:/* @__PURE__ */e("button",{onClick:q,className:"collapse-toggle",disabled:z,"aria-label":D?"Expand panel":"Collapse panel",children:V})})}),
|
|
5
|
-
/* @__PURE__ */e(f,{panelRef:Y?void 0:B,collapsible:!Y,defaultSize:Y?void 0:p?"0%":`${c}%`,minSize:Y?"30%":`${d}%`,collapsedSize:"0%",onResize:Y?void 0:K,className:_(!Y),style:Y?void 0:G,children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:!Y&&D?0:1,transition:z?`opacity ${.5*v}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:g=!1,animationDuration:v=300,animationEasing:y="cubic-bezier(0.4, 0, 0.2, 1)",theme:w,onTopCollapseStart:x,onTopCollapseComplete:N,onTopExpandStart:S,onTopExpandComplete:E,onBottomCollapseStart:D,onBottomCollapseComplete:R,onBottomExpandStart:z,onBottomExpandComplete:k,onPanelResize:
|
|
5
|
+
/* @__PURE__ */e(f,{panelRef:Y?void 0:B,collapsible:!Y,defaultSize:Y?void 0:p?"0%":`${c}%`,minSize:Y?"30%":`${d}%`,collapsedSize:"0%",onResize:Y?void 0:K,className:_(!Y),style:Y?void 0:G,children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:!Y&&D?0:1,transition:z?`opacity ${.5*v}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:g=!1,animationDuration:v=300,animationEasing:y="cubic-bezier(0.4, 0, 0.2, 1)",theme:w,onTopCollapseStart:x,onTopCollapseComplete:N,onTopExpandStart:S,onTopExpandComplete:E,onBottomCollapseStart:D,onBottomCollapseComplete:R,onBottomExpandStart:z,onBottomExpandComplete:k,onPanelResize:L})=>{const[P,M]=o(p.top||!1),[A,T]=o(!1),[$,B]=o(p.top?0:c.top),O=l(null),F=l(void 0),I=l(void 0),[H,W]=o(p.bottom||!1),[j,q]=o(!1),[K,U]=o(p.bottom?0:c.bottom),X=l(null),Y=l(void 0),V=l(void 0),[J,G]=o(!1),_=i((e,t,n)=>{if(!O.current)return;F.current&&cancelAnimationFrame(F.current),I.current=performance.now();const r=o=>{if(!I.current||!O.current)return;const l=o-I.current,i=Math.min(l/v,1),a=i<.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2,s=e+(t-e)*a;O.current.resize(s),i<1?F.current=requestAnimationFrame(r):(0===t?O.current.collapse():O.current.resize(t),T(!1),n&&n())};F.current=requestAnimationFrame(r)},[v]),Q=i((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 l=o-V.current,i=Math.min(l/v,1),a=i<.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2,s=e+(t-e)*a;X.current.resize(s),i<1?Y.current=requestAnimationFrame(r):(0===t?X.current.collapse():X.current.resize(t),q(!1),n&&n())};Y.current=requestAnimationFrame(r)},[v]),Z=i(()=>{A||J||!s.top||(T(!0),M(!0),x&&x(),_($,0,()=>{B(0),N&&N()}))},[A,J,$,s.top,_,x,N]),ee=i(()=>{A||J||!s.top||(T(!0),M(!1),S&&S(),_(0,c.top,()=>{B(c.top),E&&E()}))},[A,J,c.top,s.top,_,S,E]),te=i(()=>{P?ee():Z()},[P,Z,ee]),ne=i(()=>{j||J||!s.bottom||(q(!0),W(!0),D&&D(),Q(K,0,()=>{U(0),R&&R()}))},[j,J,K,s.bottom,Q,D,R]),re=i(()=>{j||J||!s.bottom||(q(!0),W(!1),z&&z(),Q(0,c.bottom,()=>{U(c.bottom),k&&k()}))},[j,J,c.bottom,s.bottom,Q,z,k]),oe=i(()=>{H?re():ne()},[H,ne,re]),le=i(e=>{if(!A){const t=e.asPercentage;B(t),t>0&&M(!1)}},[A]),ie=i(e=>{if(!j){const t=e.asPercentage;U(t),t>0&&W(!1)}},[j]),ae=i(()=>{A||j||G(!0)},[A,j]),se=i(()=>{G(!1),L&&L({top:$,bottom:K})},[$,K,L]);a(()=>{void 0!==p.top&&p.top!==P&&(p.top?Z():ee())},[p.top]),a(()=>{void 0!==p.bottom&&p.bottom!==H&&(p.bottom?ne():re())},[p.bottom]),a(()=>()=>{F.current&&cancelAnimationFrame(F.current),Y.current&&cancelAnimationFrame(Y.current)},[]);const ce=C(w),de=A&&!J?{transition:`flex ${v}ms ${y}`}:void 0,ue=j&&!J?{transition:`flex ${v}ms ${y}`}:void 0;/* @__PURE__ */
|
|
6
6
|
return e("div",{className:`animated-vertical-layout ${u}`,style:{...ce,...h},children:/* @__PURE__ */t(m,{orientation:"vertical",onLayoutChange:ae,onLayoutChanged:se,children:[
|
|
7
|
-
/* @__PURE__ */e(f,{panelRef:O,collapsible:s.top,defaultSize:p.top?"0%":`${c.top}%`,minSize:`${d.top}%`,collapsedSize:"0%",onResize:le,className:(()=>{let e="vertical-panel collapsible-panel";return A&&!J&&(e+=" animating"),
|
|
8
|
-
/* @__PURE__ */e(b,{className:"vertical-resize-handle",children:g&&/* @__PURE__ */t("div",{className:"handle-bar",children:[s.top&&/* @__PURE__ */e("button",{onClick:te,className:"collapse-toggle collapse-toggle-top",disabled:A,"aria-label":
|
|
9
|
-
/* @__PURE__ */e(f,{panelRef:X,collapsible:s.bottom,defaultSize:p.bottom?"0%":`${c.bottom}%`,minSize:`${d.bottom}%`,collapsedSize:"0%",onResize:ie,className:(()=>{let e="vertical-panel collapsible-panel";return j&&!J&&(e+=" animating"),H&&(e+=" collapsed"),e})(),style:ue,children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:H?0:1,transition:j?`opacity ${.5*v}ms ${y}`:"none"},children:r})})]})})},D=({primaryContent:t,secondaryContent:n,collapsedHeader:r,collapsed:o=!0,onCollapsedChange:l,ratio:i=.3,onRatioChange:a,maxRatio:s=.8,collapsedHeight:c=28,hideHeader:d=!0,theme:u,className:p="",style:h,animationDuration:g=200,onCollapseStart:v,onCollapseComplete:m,onExpandStart:f,onExpandComplete:b})=>{const y=C(u);return n?/* @__PURE__ */e(R,{primaryContent:t,secondaryContent:n,collapsedHeader:r??{title:"Content"},collapsed:o,onCollapsedChange:l??(()=>{}),ratio:i,onRatioChange:a??(()=>{}),maxRatio:s,collapsedHeight:c,hideHeader:d,theme:u,className:p,style:h,animationDuration:g,onCollapseStart:v,onCollapseComplete:m,onExpandStart:f,onExpandComplete:b}):/* @__PURE__ */e("div",{className:`collapsible-split-pane ${p}`,style:{...y,...h},children:/* @__PURE__ */e("div",{className:"csp-primary-content-full",children:t})})},R=({primaryContent:n,secondaryContent:r,collapsedHeader:s,collapsed:c,onCollapsedChange:d,ratio:u,onRatioChange:p,maxRatio:h=.8,collapsedHeight:g=28,hideHeader:v=!0,theme:y,className:w="",style:x,animationDuration:N=200,onCollapseStart:S,onCollapseComplete:E,onExpandStart:D,onExpandComplete:R})=>{const[z,k]=o(!1),[P
|
|
7
|
+
/* @__PURE__ */e(f,{panelRef:O,collapsible:s.top,defaultSize:p.top?"0%":`${c.top}%`,minSize:`${d.top}%`,collapsedSize:"0%",onResize:le,className:(()=>{let e="vertical-panel collapsible-panel";return A&&!J&&(e+=" animating"),P&&(e+=" collapsed"),e})(),style:de,children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:P?0:1,transition:A?`opacity ${.5*v}ms ${y}`:"none"},children:n})}),
|
|
8
|
+
/* @__PURE__ */e(b,{className:"vertical-resize-handle",children:g&&/* @__PURE__ */t("div",{className:"handle-bar",children:[s.top&&/* @__PURE__ */e("button",{onClick:te,className:"collapse-toggle collapse-toggle-top",disabled:A,"aria-label":P?"Expand top panel":"Collapse top panel",children:P?"▾":"▴"}),s.bottom&&/* @__PURE__ */e("button",{onClick:oe,className:"collapse-toggle collapse-toggle-bottom",disabled:j,"aria-label":H?"Expand bottom panel":"Collapse bottom panel",children:H?"▴":"▾"})]})}),
|
|
9
|
+
/* @__PURE__ */e(f,{panelRef:X,collapsible:s.bottom,defaultSize:p.bottom?"0%":`${c.bottom}%`,minSize:`${d.bottom}%`,collapsedSize:"0%",onResize:ie,className:(()=>{let e="vertical-panel collapsible-panel";return j&&!J&&(e+=" animating"),H&&(e+=" collapsed"),e})(),style:ue,children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:H?0:1,transition:j?`opacity ${.5*v}ms ${y}`:"none"},children:r})})]})})},D=({primaryContent:t,secondaryContent:n,collapsedHeader:r,collapsed:o=!0,onCollapsedChange:l,ratio:i=.3,onRatioChange:a,maxRatio:s=.8,collapsedHeight:c=28,hideHeader:d=!0,theme:u,className:p="",style:h,animationDuration:g=200,onCollapseStart:v,onCollapseComplete:m,onExpandStart:f,onExpandComplete:b})=>{const y=C(u);return n?/* @__PURE__ */e(R,{primaryContent:t,secondaryContent:n,collapsedHeader:r??{title:"Content"},collapsed:o,onCollapsedChange:l??(()=>{}),ratio:i,onRatioChange:a??(()=>{}),maxRatio:s,collapsedHeight:c,hideHeader:d,theme:u,className:p,style:h,animationDuration:g,onCollapseStart:v,onCollapseComplete:m,onExpandStart:f,onExpandComplete:b}):/* @__PURE__ */e("div",{className:`collapsible-split-pane ${p}`,style:{...y,...h},children:/* @__PURE__ */e("div",{className:"csp-primary-content-full",children:t})})},R=({primaryContent:n,secondaryContent:r,collapsedHeader:s,collapsed:c,onCollapsedChange:d,ratio:u,onRatioChange:p,maxRatio:h=.8,collapsedHeight:g=28,hideHeader:v=!0,theme:y,className:w="",style:x,animationDuration:N=200,onCollapseStart:S,onCollapseComplete:E,onExpandStart:D,onExpandComplete:R})=>{const[z,k]=o(!1),[L,P]=o(!1),M=l(null),A=l(void 0),T=l(void 0),$=l(u),B=l(!1),O=l(c),F=e=>100*e;a(()=>{O.current=c},[c]),a(()=>{!c&&u>0&&($.current=u)},[c,u]);const I=i((e,t,n)=>{if(!M.current)return;A.current&&cancelAnimationFrame(A.current),T.current=performance.now();const r=o=>{if(!T.current||!M.current)return;const l=o-T.current,i=Math.min(l/N,1),a=i<.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2,s=e+(t-e)*a;M.current.resize(`${s}%`),i<1?A.current=requestAnimationFrame(r):(M.current.resize(`${t}%`),n&&n(),B.current=!1,k(!1))};A.current=requestAnimationFrame(r)},[N]),H=i(()=>{if(z||L||!M.current)return;u>0&&($.current=u),B.current=!0,k(!0),S?.();const e=F(u);I(e,0,()=>{O.current=!0,d(!0),E?.()})},[z,L,u,I,d,S,E]),W=i(()=>{if(z||L||!M.current)return;B.current=!0,k(!0),D?.();const e=$.current||u||.3,t=F(e);I(0,t,()=>{O.current=!1,d(!1),p(e),R?.()})},[z,L,u,I,d,p,D,R]),j=i(()=>{c?W():H()},[c,H,W]),q=i(e=>{if(B.current)return;const t=e.asPercentage/100;t<=.01&&!O.current?($.current=.4,O.current=!0,d(!0)):t>.01&&O.current&&(O.current=!1,d(!1)),O.current||p(t)},[p,d]),K=i(()=>{z||P(!0)},[z]),U=i(()=>{P(!1)},[]);a(()=>{if(c&&!z&&M.current){M.current.getSize().asPercentage>0&&H()}else if(!c&&!z&&M.current){0===M.current.getSize().asPercentage&&W()}},[c]),a(()=>()=>{A.current&&cancelAnimationFrame(A.current)},[]);const X=C(y),Y=["csp-secondary-panel",z&&!L?"csp-animating":"",c?"csp-collapsed":""].filter(Boolean).join(" ");/* @__PURE__ */
|
|
10
10
|
return t("div",{className:`collapsible-split-pane ${w}`,style:{...X,...x},children:[!v&&/* @__PURE__ */t("div",{className:"csp-header "+(c?"csp-header-collapsed":""),style:{height:g,backgroundColor:y.colors.backgroundSecondary,borderBottom:`1px solid ${y.colors.border}`},onClick:c?j:void 0,role:c?"button":void 0,tabIndex:c?0:void 0,onKeyDown:c?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),j())}:void 0,"aria-expanded":!c,"aria-label":c?`Expand ${s.title}`:s.title,children:[s.icon&&/* @__PURE__ */e("span",{className:"csp-header-icon",style:{color:y.colors.textSecondary},children:s.icon}),
|
|
11
11
|
/* @__PURE__ */e("span",{className:"csp-header-title",style:{color:y.colors.text,fontFamily:y.fonts.body,fontSize:y.fontSizes[1],fontWeight:y.fontWeights.medium},children:s.title}),
|
|
12
12
|
/* @__PURE__ */e("button",{className:"csp-header-toggle",style:{color:y.colors.textSecondary},onClick:e=>{e.stopPropagation(),j()},"aria-label":c?`Expand ${s.title}`:`Collapse ${s.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:c?"M3 5L6 8L9 5":"M3 7L6 4L9 7"})})})]}),
|
|
@@ -17,21 +17,21 @@ return t("div",{className:`collapsible-split-pane ${w}`,style:{...X,...x},childr
|
|
|
17
17
|
return e("div",{className:"tab-group-empty",children:"No panels available"});const E=/* @__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||f(e),v?.(e)})(o),title:r.icon?r.label:void 0,children:r.icon?/* @__PURE__ */t(n,{children:[
|
|
18
18
|
/* @__PURE__ */e("span",{className:"tab-icon",children:r.icon}),
|
|
19
19
|
/* @__PURE__ */e("span",{className:"tab-label",children:r.label})]}):r.label},r.id))}),D=S?/* @__PURE__ */e("div",{className:"tab-content",role:"tabpanel",id:`tabpanel-${S.id}`,"aria-labelledby":`tab-${S.id}`,children:S.content}):null;/* @__PURE__ */
|
|
20
|
-
return t("div",{className:`tab-group tab-position-${u} ${s}`,style:w,children:[!h&&("top"===u||"left"===u)&&E,D,!h&&("bottom"===u||"right"===u)&&E]})},k={x:0,y:0,width:0,height:0},
|
|
21
|
-
return e(
|
|
22
|
-
return e("div",{className:`three-panel-layout ${p} ${G?"is-dragging":""} ${Q?"":"is-mounting"}`,style:{...Te,...g,"--panel-transition-duration":`${y}ms`,"--panel-transition-easing":w},children:/* @__PURE__ */t(m,{groupRef:fe,orientation:"horizontal",onLayoutChange:
|
|
23
|
-
/* @__PURE__ */e(f,{id:"left",panelRef:be,collapsible:c.left||!I,defaultSize:h.left||!I?"0%":`${q.left}%`,minSize:"0%",collapsedSize:"0%",onResize:Re,className:Ae("left"),...s.left||{},children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:K?0:1},children:/* @__PURE__ */e(
|
|
20
|
+
return t("div",{className:`tab-group tab-position-${u} ${s}`,style:w,children:[!h&&("top"===u||"left"===u)&&E,D,!h&&("bottom"===u||"right"===u)&&E]})},k={x:0,y:0,width:0,height:0},L=s(null),P=({slot:t,children:n})=>{const r=l(null),[s,c]=o(k),d=i(()=>{if(r.current){const e=r.current.getBoundingClientRect();c({x:e.left,y:e.top,width:e.width,height:e.height})}},[]);a(()=>{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__ */
|
|
21
|
+
return e(L.Provider,{value:u,children:/* @__PURE__ */e("div",{ref:r,className:"panel-bounds-container",style:{width:"100%",height:"100%",minWidth:0},children:n})})};function M(){const e=c(L);return e?{slot:e.slot,bounds:e.bounds,isInPanel:!0}:{slot:null,bounds:k,isInPanel:!1}}function A(){const{bounds:e}=M();return{offsetX:e.x,offsetY:e.y}}const T=d(({panels:n,layout:r,slotDataAttributes:s={},collapsiblePanels:c={left:!0,middle:!1,right:!0},defaultSizes:d={left:20,middle:60,right:20},className:p="",collapsed:h={left:!1,middle:!1,right:!1},style:g,showCollapseButtons:v=!1,animationDuration:y=300,animationEasing:w="cubic-bezier(0.4, 0, 0.2, 1)",theme:x,onLeftCollapseStart:N,onLeftCollapseComplete:S,onLeftExpandStart:E,onLeftExpandComplete:D,onMiddleCollapseStart:R,onMiddleCollapseComplete:k,onMiddleExpandStart:L,onMiddleExpandComplete:M,onRightCollapseStart:A,onRightCollapseComplete:T,onRightExpandStart:$,onRightExpandComplete:B,onPanelResize:O},F)=>{const I=null!==r.left&&void 0!==r.left,H=null!==r.middle&&void 0!==r.middle,W=null!==r.right&&void 0!==r.right,j=[I,H,W].filter(Boolean).length,q={left:I?d?.left??(2===j?50:3===j?20:100):0,middle:H?d?.middle??(2===j?50:3===j?60:100):0,right:W?d?.right??(2===j?50:3===j?20:100):0},[K,U]=o(h.left||!I),[X,Y]=o(h.middle||!H),[V,J]=o(h.right||!W),[G,_]=o(!1),[Q,Z]=o(!1);a(()=>{const e=requestAnimationFrame(()=>{Z(!0)});return()=>cancelAnimationFrame(e)},[]);const ee=i(e=>{if(!e)return null;const t=n.find(t=>t.id===e);return t?.content||null},[n]),te=i(t=>{if(null===t)return null;if("object"==typeof t&&"type"in t){const r=t;return"tabs"===r.type?/* @__PURE__ */e(z,{panelIds:r.panels,panels:n,config:r.config,theme:x}):null}return ee(t)},[n,ee,x]),ne=te(r.left??null),re=te(r.middle??null),oe=te(r.right??null),[le,ie]=o(h.left||!I?0:q.left),[ae,se]=o(h.middle||!H?0:q.middle),[ce,de]=o(h.right||!W?0:q.right),[ue,pe]=o(q.left),[he,ge]=o(q.middle),[ve,me]=o(q.right),fe=l(null),be=l(null),ye=l(null),we=l(null),xe=i(()=>{!G&&c.left&&(N?.(),be.current?.collapse(),U(!0),S?.())},[G,c.left,N,S]),Ce=i(()=>{!G&&c.left&&(E?.(),be.current?.expand(),U(!1),D?.())},[G,c.left,E,D]),Ne=i(()=>{!G&&c.right&&(A?.(),we.current?.collapse(),J(!0),T?.())},[G,c.right,A,T]),Se=i(()=>{!G&&c.right&&($?.(),we.current?.expand(),J(!1),B?.())},[G,c.right,$,B]),Ee=i(()=>{K?Ce():xe()},[K,xe,Ce]),De=i(()=>{V?Se():Ne()},[V,Ne,Se]);u(F,()=>({setLayout:e=>{fe.current?(console.log("[ConfigurablePanelLayout] setLayout called with:",e),console.log("[ConfigurablePanelLayout] Current internal state:",{leftCollapsed:K,rightCollapsed:V,leftSize:le,middleSize:ae,rightSize:ce}),fe.current.setLayout(e)):console.warn("[ConfigurablePanelLayout] setLayout called but panelGroupRef is null")},collapsePanel:e=>{"left"===e?(be.current?.collapse(),U(!0)):(we.current?.collapse(),J(!0))},expandPanel:e=>{"left"===e?(be.current?.expand(),U(!1)):(we.current?.expand(),J(!1))},getLayout:()=>({left:le,middle:ae,right:ce})}),[le,ae,ce]);const Re=i(e=>{const t=e.asPercentage;ie(t),t>0?(pe(t),U(!1)):U(!0)},[]),ze=i(e=>{const t=e.asPercentage;se(t),t>0?(ge(t),Y(!1)):Y(!0)},[]),ke=i(e=>{const t=e.asPercentage;de(t),t>0?(me(t),J(!1)):J(!0)},[]),Le=i(()=>{if(O){O({left:K?ue:le,middle:X?he:ae,right:V?ve:ce})}},[le,ae,ce,K,X,V,ue,he,ve,O]),Pe=i(()=>{_(!0)},[]),Me=i(()=>{_(!1),Le()},[Le]),Ae=e=>{let t="three-panel-item";return"left"===e?!c.left&&I||(t+=" collapsible-panel",K&&(t+=" collapsed")):"middle"===e?(t+=" middle-panel",!c.middle&&H||(t+=" collapsible-panel",X&&(t+=" collapsed"))):"right"===e&&(!c.right&&W||(t+=" collapsible-panel",V&&(t+=" collapsed"))),t},Te=C(x);/* @__PURE__ */
|
|
22
|
+
return e("div",{className:`three-panel-layout ${p} ${G?"is-dragging":""} ${Q?"":"is-mounting"}`,style:{...Te,...g,"--panel-transition-duration":`${y}ms`,"--panel-transition-easing":w},children:/* @__PURE__ */t(m,{groupRef:fe,orientation:"horizontal",onLayoutChange:Pe,onLayoutChanged:Me,children:[
|
|
23
|
+
/* @__PURE__ */e(f,{id:"left",panelRef:be,collapsible:c.left||!I,defaultSize:h.left||!I?"0%":`${q.left}%`,minSize:"0%",collapsedSize:"0%",onResize:Re,className:Ae("left"),...s.left||{},children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:K?0:1},children:/* @__PURE__ */e(P,{slot:"left",children:ne})})}),
|
|
24
24
|
/* @__PURE__ */e(b,{className:"resize-handle left-handle "+(!K&&I&&H?"":"collapsed"),disabled:K||!I||!H,children:v&&c.left&&/* @__PURE__ */e("div",{className:"handle-bar",children:/* @__PURE__ */e("button",{onClick:Ee,className:"collapse-toggle","aria-label":K?"Expand left panel":"Collapse left panel",children:K?"▸":"◂"})})}),
|
|
25
|
-
/* @__PURE__ */e(f,{id:"middle",panelRef:ye,collapsible:c.middle||!H,defaultSize:h.middle||!H?"0%":`${q.middle}%`,minSize:"0%",collapsedSize:"0%",onResize:ze,className:Ae("middle"),...s.middle||{},children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:X?0:1},children:/* @__PURE__ */e(
|
|
25
|
+
/* @__PURE__ */e(f,{id:"middle",panelRef:ye,collapsible:c.middle||!H,defaultSize:h.middle||!H?"0%":`${q.middle}%`,minSize:"0%",collapsedSize:"0%",onResize:ze,className:Ae("middle"),...s.middle||{},children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:X?0:1},children:/* @__PURE__ */e(P,{slot:"middle",children:re})})}),
|
|
26
26
|
/* @__PURE__ */e(b,{className:"resize-handle right-handle "+(V||!W||!H&&!I?"collapsed":""),disabled:V||!W||!H&&!I,children:v&&c.right&&/* @__PURE__ */e("div",{className:"handle-bar",children:/* @__PURE__ */e("button",{onClick:De,className:"collapse-toggle","aria-label":V?"Expand right panel":"Collapse right panel",children:V?"◂":"▸"})})}),
|
|
27
|
-
/* @__PURE__ */e(f,{id:"right",panelRef:we,collapsible:c.right||!W,defaultSize:h.right||!W?"0%":`${q.right}%`,minSize:"0%",collapsedSize:"0%",onResize:ke,className:Ae("right"),...s.right||{},children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:V?0:1},children:/* @__PURE__ */e(
|
|
27
|
+
/* @__PURE__ */e(f,{id:"right",panelRef:we,collapsible:c.right||!W,defaultSize:h.right||!W?"0%":`${q.right}%`,minSize:"0%",collapsedSize:"0%",onResize:ke,className:Ae("right"),...s.right||{},children:/* @__PURE__ */e("div",{className:"panel-content-wrapper",style:{opacity:V?0:1},children:/* @__PURE__ */e(P,{slot:"right",children:oe})})})]})})});T.displayName="ConfigurablePanelLayout";const $=d(({panels:o,className:i="",style:s,theme:c,minPanelWidth:d=350,idealPanelWidth:p=.333,showSeparator:h=!1,onPanelChange:g,preventKeyboardScroll:v=!0,disableSwipe:m=!1},f)=>{const b=l(null),y=l(!1),w=l(null),x=C(c);u(f,()=>({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 l=e.children[o].getBoundingClientRect(),i=Math.abs(l.left-t);i<r&&(r=i,n=o)}return n}}));a(()=>{if(!v||!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)}},[v]),a(()=>()=>{w.current&&clearTimeout(w.current)},[]);const N=o.length,S=2*d;let E;E=1===N||2===N?"100%":`max(${d}px, ${100*p}%)`;const D=r.useId().replace(/:/g,"_");/* @__PURE__ */
|
|
28
28
|
return t(n,{children:[2===N&&/* @__PURE__ */e("style",{children:`\n .snap-carousel-container[data-carousel-id="${D}"][data-panel-count="2"] .snap-carousel-panel {\n width: 100%;\n }\n @container (min-width: ${S}px) {\n .snap-carousel-container[data-carousel-id="${D}"][data-panel-count="2"] .snap-carousel-panel {\n width: 50%;\n }\n }\n `}),
|
|
29
29
|
/* @__PURE__ */e("div",{ref:b,className:`snap-carousel-container ${m?"swipe-disabled":""} ${i}`,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":E,"--snap-carousel-panel-count":N,"--snap-carousel-two-panel-threshold":`${S}px`},onScroll:e=>{if(!g||!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 l=0;l<t.children.length;l++){const e=t.children[l].getBoundingClientRect(),i=Math.abs(e.left-n);i<o&&(o=i,r=l)}g(r)},"data-panel-count":N,"data-carousel-id":D,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 a(()=>{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:i,theme:a,layout:s,panels:c,...d})=>{const u=B(n),h=l(null),[g,v]=o(0),m=p(()=>[s?.left,s?.middle,s?.right],[s]),f=["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 m.map((o,l)=>((o,l)=>{if(null==o)return null;if("object"==typeof o&&"type"in o){const t=o;if("tabs"===t.type){const o=t.panels[0],i=t.panels.length>0?n(o):"Tab Group",s=t.panels.length>0?r(o):null;return{content:/* @__PURE__ */e(z,{panelIds:t.panels,panels:c,config:t.config,theme:a}),label:i,icon:s,slot:l}}return null}return{content:t(o),label:n(o),icon:r(o),slot:l}})(o,f[l])).filter(e=>null!==e)},[m,c,a]),y=e=>{v(e),r?.onPanelChange?.(e);const t=b[e]?.slot;t&&i?.(e,t)},{onPanelChange:w,...x}=r??{},C=N(a);if(u){if(0===b.length)return null;const n=b.map(e=>e.content);/* @__PURE__ */
|
|
30
30
|
return t("div",{className:"mobile-tab-layout",style:C,children:[
|
|
31
31
|
/* @__PURE__ */e("div",{className:"mobile-tab-content",children:/* @__PURE__ */e($,{ref:h,theme:a,panels:n,minPanelWidth:0,idealPanelWidth:1,disableSwipe:!0,onPanelChange:y,...x})}),
|
|
32
32
|
/* @__PURE__ */e("nav",{className:"mobile-tab-nav",role:"tablist",children:b.map((n,r)=>/* @__PURE__ */t("button",{role:"tab","aria-selected":r===g,className:"mobile-tab-button "+(r===g?"active":""),onClick:()=>(e=>{v(e),h.current?.scrollToPanel(e);const t=b[e]?.slot;t&&i?.(e,t)})(r),children:[n.icon&&/* @__PURE__ */e("span",{className:"tab-icon",children:n.icon}),
|
|
33
33
|
/* @__PURE__ */e("span",{className:"tab-label",children:n.label})]},r))})]})}/* @__PURE__ */
|
|
34
|
-
return e(T,{theme:a,layout:s,panels:c,...d})},F="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 H(e){return"nodeType"in e}function W(e){var t,n;return e?I(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 q(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:H(e)?j(e)?e:q(e)||K(e)?e.ownerDocument:document:document:document}const X=F?h:a;function Y(e){const t=l(e);return X(()=>{t.current=e}),i(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=l(e);return X(()=>{n.current!==e&&(n.current=e)},t),n}function J(e,t){const n=l();return p(()=>{const t=e(n.current);return n.current=t,t},[...t])}function G(e){const t=Y(e),n=l(null),r=i(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function _(e){const t=l();return a(()=>{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,l]of r){const n=t[o];null!=n&&(t[o]=n+e*l)}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 le="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ie(e){return e.matches(le)?e:e.querySelector(le)}const ae={display:"none"};function se(e){let{id:t,value:n}=e;return r.createElement("div",{id:t,style:ae},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:l,screenReaderInstructions:s=ue}=e;const{announce:d,announcement:u}=function(){const[e,t]=o("");return{announce:i(e=>{null!=e&&t(e)},[]),announcement:e}}(),h=Z("DndLiveRegion"),[g,v]=o(!1);if(a(()=>{v(!0)},[]),function(e){const t=c(de);a(()=>{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])),!g)return null;const m=r.createElement(r.Fragment,null,r.createElement(se,{id:l,value:s.draggable}),r.createElement(ce,{id:h,announcement:u}));return n?w(m,n):m}var ge,ve;function me(){}(ve=ge||(ge={})).DragStart="dragStart",ve.DragMove="dragMove",ve.DragEnd="dragEnd",ve.DragCancel="dragCancel",ve.DragOver="dragOver",ve.RegisterDroppable="registerDroppable",ve.SetDroppableDisabled="setDroppableDisabled",ve.UnregisterDroppable="unregisterDroppable";const fe=/* @__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),l=[];for(const i of r){const{id:e}=i,t=n.get(e);if(t){const n=be(xe(t),o);l.push({id:e,data:{droppableContainer:i,value:n}})}}return l.sort(ye)};function Ne(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),l=Math.min(t.top+t.height,e.top+e.height),i=o-r,a=l-n;if(r<o&&n<l){const n=t.width*t.height,r=e.width*e.height,o=i*a;return Number((o/(n+r-o)).toFixed(4))}return 0}const Se=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const l of r){const{id:e}=l,r=n.get(e);if(r){const n=Ne(r,t);n>0&&o.push({id:e,data:{droppableContainer:l,value:n}})}}return o.sort(we)};function Ee(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:fe}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 Re=/* @__PURE__ */De(1);const ze={ignoreTransform:!1};function ke(e,t){void 0===t&&(t=ze);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:l,x:i,y:a}=r,s=e.left-i-(1-o)*parseFloat(n),c=e.top-a-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=l?e.height/l: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:l,height:i,bottom:a,right:s}=n;return{top:r,left:o,width:l,height:i,bottom:a,right:s}}function Pe(e){return ke(e,{ignoreTransform:!0})}function Le(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(!q(o)||K(o))return n;if(n.includes(o))return n;const l=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,l)&&n.push(o),function(e,t){return void 0===t&&(t=W(e).getComputedStyle(e)),"fixed"===t.position}(o,l)?n:r(o.parentNode)}(e):n}function Me(e){const[t]=Le(e,1);return null!=t?t:null}function Ae(e){return F&&e?I(e)?e:H(e)?j(e)||e===U(e).scrollingElement?window:q(e)?e:null:null:null}function Te(e){return I(e)?e.scrollX:e.scrollLeft}function $e(e){return I(e)?e.scrollY:e.scrollTop}function Be(e){return{x:Te(e),y:$e(e)}}var Oe,Fe;function Ie(e){return!(!F||!e)&&e===document.scrollingElement}function He(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}}(Fe=Oe||(Oe={}))[Fe.Forward=1]="Forward",Fe[Fe.Backward=-1]="Backward";const We={x:.2,y:.2};function je(e,t,n,r,o){let{top:l,left:i,right:a,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},g={x:0,y:0},v=t.height*o.y,m=t.width*o.x;return!c&&l<=t.top+v?(h.y=Oe.Backward,g.y=r*Math.abs((t.top+v-l)/v)):!d&&s>=t.bottom-v&&(h.y=Oe.Forward,g.y=r*Math.abs((t.bottom-v-s)/v)),!p&&a>=t.right-m?(h.x=Oe.Forward,g.x=r*Math.abs((t.right-m-a)/m)):!u&&i<=t.left+m&&(h.x=Oe.Backward,g.x=r*Math.abs((t.left+m-i)/m)),{direction:h,speed:g}}function qe(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,Be(t)),fe)}const Ue=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Te(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+$e(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=Le(t),r=Ke(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[o,l,i]of Ue)for(const e of l)Object.defineProperty(this,e,{get:()=>{const t=i(n),l=r[o]-t;return this.rect[e]+l},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=ke),!e)return;const{top:n,left:r,bottom:o,right:l}=t(e);Me(e)&&(o<=0||l<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(fe)}handleKeyDown(e){if(re(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=tt,coordinateGetter:l=nt,scrollBehavior:i="smooth"}=r,{code:a}=e;if(o.end.includes(a))return void this.handleEnd(e);if(o.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:s}=n.current,c=s?{x:s.left,y:s.top}:fe;this.referenceCoordinates||(this.referenceCoordinates=c);const d=l(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:l,isRight:a,isLeft:s,isBottom:c,maxScroll:u,minScroll:p}=He(n),h=qe(n),g={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))},v=o===_e.Right&&!a||o===_e.Left&&!s,m=o===_e.Down&&!c||o===_e.Up&&!l;if(v&&g.x!==d.x){const e=n.scrollLeft+t.x,l=o===_e.Right&&e<=u.x||o===_e.Left&&e>=p.x;if(l&&!t.y)return void n.scrollTo({left:e,behavior:i});r.x=l?n.scrollLeft-e:o===_e.Right?n.scrollLeft-u.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:i});break}if(m&&g.y!==d.y){const e=n.scrollTop+t.y,l=o===_e.Down&&e<=u.y||o===_e.Up&&e>=p.y;if(l&&!t.x)return void n.scrollTo({top:e,behavior:i});r.y=l?n.scrollTop-e:o===_e.Down?n.scrollTop-u.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:i});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 lt(e){return Boolean(e&&"delay"in e)}rt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=tt,onActivation:o}=t,{active:l}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const t=l.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class it{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:l}=o;this.props=e,this.events=t,this.document=U(l),this.documentListeners=new Ye(this.document),this.listeners=new Ye(n),this.windowListeners=new Ye(W(l)),this.initialCoordinates=null!=(r=oe(o))?r:fe,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(lt(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:l,options:{activationConstraint:i}}=o;if(!r)return;const a=null!=(t=oe(e))?t:fe,s=ne(r,a);if(!n&&i){if(ot(i)){if(null!=i.tolerance&&Ve(s,i.tolerance))return this.handleCancel();if(Ve(s,i.distance))return this.handleStart()}return lt(i)&&Ve(s,i.tolerance)?this.handleCancel():void this.handlePending(i,s)}e.cancelable&&e.preventDefault(),l(a)}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 at={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class st extends it{constructor(e){const{event:t}=e,n=U(t.target);super(e,at,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 it{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,gt,vt,mt;function ft(e){let{acceleration:t,activator:n=ht.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:c=5,order:d=vt.TreeOrder,pointerCoordinates:u,scrollableAncestors:h,scrollableAncestorRects:g,delta:v,threshold:m}=e;const f=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:{[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:v,disabled:!s}),[b,y]=function(){const e=l(null);return[i((t,n)=>{e.current=setInterval(t,n)},[]),i(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),w=l({x:0,y:0}),x=l({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]),N=l(null),S=i(()=>{const e=N.current;if(!e)return;const t=w.current.x*x.current.x,n=w.current.y*x.current.y;e.scrollBy(t,n)},[]),E=p(()=>d===vt.TreeOrder?[...h].reverse():h,[d,h]);a(()=>{if(s&&h.length&&C){for(const e of E){if(!1===(null==r?void 0:r(e)))continue;const n=h.indexOf(e),o=g[n];if(!o)continue;const{direction:l,speed:i}=je(e,o,C,t,m);for(const e of["x","y"])f[e][l[e]]||(i[e]=0,l[e]=0);if(i.x>0||i.y>0)return y(),N.current=e,b(S,c),w.current=i,void(x.current=l)}w.current={x:0,y:0},x.current={x:0,y:0},y()}else y()},[t,S,r,y,s,c,JSON.stringify(C),JSON.stringify(f),b,h,E,g,JSON.stringify(m)])}(class extends it{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)}}],(gt=ht||(ht={}))[gt.Pointer=0]="Pointer",gt[gt.DraggableRect=1]="DraggableRect",(mt=vt||(vt={}))[mt.TreeOrder=0]="TreeOrder",mt[mt.ReversedTreeOrder=1]="ReversedTreeOrder";const bt={x:{[Oe.Backward]:!1,[Oe.Forward]:!1},y:{[Oe.Backward]:!1,[Oe.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 Nt(e,t){return J(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function St(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 a(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function Et(e){return new Xe(ke(e),e)}function Dt(e,t,n){void 0===t&&(t=Et);const[r,l]=o(null);function i(){l(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const l=t(e);return JSON.stringify(r)===JSON.stringify(l)?r:l})}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 a(()=>()=>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)){i();break}}}}),c=St({callback:i});return X(()=>{i(),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 Rt=[];function zt(e,t){void 0===t&&(t=[]);const n=l(null);return a(()=>{n.current=null},t),a(()=>{const t=e!==fe;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?ne(e,n.current):fe}function kt(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 Pt=[];function Lt(e){let{measure:t}=e;const[n,r]=o(null),l=St({callback:i(e=>{for(const{target:n}of e)if(q(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),a=i(e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return q(t)?t:e}(e);null==l||l.disconnect(),n&&(null==l||l.observe(n)),r(n?t(n):null)},[t,l]),[s,c]=G(a);return p(()=>({nodeRef:s,rect:n,setRef:c}),[n,s,c])}const Mt=[{sensor:st,options:{}},{sensor:rt,options:{}}],At={current:{}},Tt={draggable:{measure:Pe},droppable:{measure:Pe,strategy:yt.WhileDragging,frequency:xt.Optimized},dragOverlay:{measure:ke}};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:me},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Tt,measureDroppableContainers:me,windowRect:null,measuringScheduled:!1},Ot=/* @__PURE__ */s({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:me,draggableNodes:/* @__PURE__ */new Map,over:null,measureDroppableContainers:me}),Ft=/* @__PURE__ */s(Bt);function It(){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 ge.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ge.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 ge.DragEnd:case ge.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ge.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 ge.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,l=e.droppable.containers.get(n);if(!l||r!==l.key)return e;const i=new $t(e.droppable.containers);return i.set(n,{...l,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case ge.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const l=new $t(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Wt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=c(Ot),l=_(r),i=_(null==n?void 0:n.id);return a(()=>{if(!t&&!r&&l&&null!=i){if(!re(l))return;if(document.activeElement===l.target)return;const e=o.get(i);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=ie(e);if(t){t.focus();break}}})}},[r,t,o,i,l]),null}const jt=/* @__PURE__ */s({...fe,scaleX:1,scaleY:1});var qt,Kt;(Kt=qt||(qt={}))[Kt.Uninitialized=0]="Uninitialized",Kt[Kt.Initializing=1]="Initializing",Kt[Kt.Initialized=2]="Initialized";const Ut=/* @__PURE__ */g(function(e){var t,n,s,c;let{id:d,accessibility:u,autoScroll:h=!0,children:g,sensors:m=Mt,collisionDetection:f=Se,measuring:b,modifiers:w,...x}=e;const C=v(Ht,void 0,It),[N,S]=C,[E,D]=function(){const[e]=o(()=>/* @__PURE__ */new Set),t=i(t=>(e.add(t),()=>e.delete(t)),[e]);return[i(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]}(),[R,z]=o(qt.Uninitialized),k=R===qt.Initialized,{draggable:{active:P,nodes:L,translate:M},droppable:{containers:A}}=N,T=null!=P?L.get(P):null,$=l({initial:null,translated:null}),B=p(()=>{var e;return null!=P?{id:P,data:null!=(e=null==T?void 0:T.data)?e:At,rect:$}:null},[P,T]),O=l(null),[I,H]=o(null),[j,q]=o(null),K=V(x,Object.values(x)),U=Z("DndDescribedBy",d),Y=p(()=>A.getEnabled(),[A]),G=p(()=>({draggable:{...Tt.draggable,...null==_?void 0:_.draggable},droppable:{...Tt.droppable,...null==_?void 0:_.droppable},dragOverlay:{...Tt.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,g=l(e),v=function(){switch(h){case yt.Always:return!1;case yt.BeforeDragging:return n;default:return!n}}(),m=V(v),f=i(function(e){void 0===e&&(e=[]),m.current||d(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[m]),b=l(null),y=J(t=>{if(v&&!n)return Ct;if(!t||t===Ct||g.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,v,p]);return a(()=>{g.current=e},[e]),a(()=>{v||f()},[n,v]),a(()=>{c&&c.length>0&&d(null)},[JSON.stringify(c)]),a(()=>{v||"number"!=typeof u||null!==b.current||(b.current=setTimeout(()=>{f(),b.current=null},u))},[u,v,f,...r]),{droppableRects:y,measureDroppableContainers:f,measuringScheduled:null!=c}}(Y,{dragging:k,dependencies:[M.x,M.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])}(L,P),le=p(()=>j?oe(j):null,[j]),ie=function(){const e=!1===(null==I?void 0:I.autoScrollEnabled),t="object"==typeof h?!1===h.enabled:!1===h,n=k&&!e&&!t;if("object"==typeof h)return{...h,enabled:n};return{enabled:n}}(),ae=function(e,t){return Nt(e,t)}(re,G.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=l(!1),{x:a,y:s}="boolean"==typeof o?{x:o,y:o}:o;X(()=>{if(!a&&!s||!t)return void(i.current=!1);if(i.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(a||(o.x=0),s||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=Me(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,s,r,n])}({activeNode:null!=P?L.get(P):null,config:ie.layoutShiftCompensation,initialRect:ae,measure:G.draggable.measure});const se=Dt(re,G.draggable.measure,ae),ce=Dt(re?re.parentElement:null),ue=l({activatorEvent:null,active:null,activeNode:re,collisionRect:null,collisions:null,droppableRects:Q,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:A,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),pe=A.getNodeFor(null==(t=ue.current.over)?void 0:t.id),ve=Lt({measure:G.dragOverlay.measure}),me=null!=(n=ve.nodeRef.current)?n:re,be=k?null!=(s=ve.rect)?s:se:null,ye=Boolean(ve.nodeRef.current&&ve.rect),we=Ee(xe=ye?null:se,Nt(xe));var xe;const Ce=kt(me?W(me):null),Ne=function(e){const t=l(e),n=J(n=>e?n&&n!==Rt&&e&&t.current&&e.parentNode===t.current.parentNode?n:Le(e):Rt,[e]);return a(()=>{t.current=e},[e]),n}(k?null!=pe?pe:re:null),De=function(e,t){void 0===t&&(t=ke);const[n]=e,r=kt(n?W(n):null),[l,i]=o(Pt);function a(){i(()=>e.length?e.map(e=>Ie(e)?r:new Xe(t(e),e)):Pt)}const s=St({callback:a});return X(()=>{null==s||s.disconnect(),a(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),l}(Ne),ze=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}(w,{transform:{x:M.x-we.x,y:M.y-we.y,scaleX:1,scaleY:1},activatorEvent:j,active:B,activeNodeRect:se,containerNodeRect:ce,draggingNodeRect:be,over:ue.current.over,overlayNodeRect:ve.rect,scrollableAncestors:Ne,scrollableAncestorRects:De,windowRect:Ce}),Pe=le?te(le,M):null,Te=function(e){const[t,n]=o(null),r=l(e),s=i(e=>{const t=Ae(e.target);t&&n(e=>e?(e.set(t,Be(t)),new Map(e)):null)},[]);return a(()=>{const t=r.current;if(e!==t){o(t);const l=e.map(e=>{const t=Ae(e);return t?(t.addEventListener("scroll",s,{passive:!0}),[t,Be(t)]):null}).filter(e=>null!=e);n(l.length?new Map(l):null),r.current=e}return()=>{o(e),o(t)};function o(e){e.forEach(e=>{const t=Ae(e);null==t||t.removeEventListener("scroll",s)})}},[s,e]),p(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>te(e,t),fe):Ke(e):fe,[e,t])}(Ne),$e=zt(Te),Oe=zt(Te,[se]),Fe=te(ze,$e),He=be?Re(be,ze):null,We=B&&He?f({active:B,collisionRect:He,droppableRects:Q,droppableContainers:Y,pointerCoordinates:Pe}):null,je=function(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}(We,"id"),[qe,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?ze:te(ze,Oe),null!=(c=null==qe?void 0:qe.rect)?c:null,se),Ve=l(null),Je=i((e,t)=>{let{sensor:n,options:r}=t;if(null==O.current)return;const o=L.get(O.current);if(!o)return;const l=e.nativeEvent,i=new n({active:O.current,activeNode:o,event:l,options:r,context:ue,onAbort(e){if(!L.get(e))return;const{onDragAbort:t}=K.current,n={id:e};null==t||t(n),E({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!L.get(e))return;const{onDragPending:o}=K.current,l={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(l),E({type:"onDragPending",event:l})},onStart(e){const t=O.current;if(null==t)return;const n=L.get(t);if(!n)return;const{onDragStart:r}=K.current,o={activatorEvent:l,active:{id:t,data:n.data,rect:$}};y(()=>{null==r||r(o),z(qt.Initializing),S({type:ge.DragStart,initialCoordinates:e,active:t}),E({type:"onDragStart",event:o}),H(Ve.current),q(l)})},onMove(e){S({type:ge.DragMove,coordinates:e})},onEnd:a(ge.DragEnd),onCancel:a(ge.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=ue.current;let i=null;if(t&&o){const{cancelDrop:a}=K.current;if(i={activatorEvent:l,active:t,collisions:n,delta:o,over:r},e===ge.DragEnd&&"function"==typeof a){await Promise.resolve(a(i))&&(e=ge.DragCancel)}}O.current=null,y(()=>{S({type:e}),z(qt.Uninitialized),Ue(null),H(null),q(null),Ve.current=null;const t=e===ge.DragEnd?"onDragEnd":"onDragCancel";if(i){const e=K.current[t];null==e||e(i),E({type:t,event:i})}})}}Ve.current=i},[L]),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])}(m,i((e,t)=>(n,r)=>{const o=n.nativeEvent,l=L.get(r);if(null!==O.current||!l||o.dndKit||o.defaultPrevented)return;const i={active:l};!0===e(n,t.options,i)&&(o.dndKit={capturedBy:t.sensor},O.current=r,Je(n,t))},[L,Je]));!function(e){a(()=>{if(!F)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}))}(m),X(()=>{se&&R===qt.Initializing&&z(qt.Initialized)},[se,R]),a(()=>{const{onDragMove:e}=K.current,{active:t,activatorEvent:n,collisions:r,over:o}=ue.current;if(!t||!n)return;const l={active:t,activatorEvent:n,collisions:r,delta:{x:Fe.x,y:Fe.y},over:o};y(()=>{null==e||e(l),E({type:"onDragMove",event:l})})},[Fe.x,Fe.y]),a(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=ue.current;if(!e||null==O.current||!t||!o)return;const{onDragOver:l}=K.current,i=r.get(je),a=i&&i.rect.current?{id:i.id,rect:i.rect.current,data:i.data,disabled:i.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:a};y(()=>{Ue(a),null==l||l(s),E({type:"onDragOver",event:s})})},[je]),X(()=>{ue.current={activatorEvent:j,active:B,activeNode:re,collisionRect:He,collisions:We,droppableRects:Q,draggableNodes:L,draggingNode:me,draggingNodeRect:be,droppableContainers:A,over:qe,scrollableAncestors:Ne,scrollAdjustedTranslate:Fe},$.current={initial:be,translated:He}},[B,re,We,He,L,me,be,Q,A,qe,Ne,Fe]),ft({...ie,delta:M,draggingRect:He,pointerCoordinates:Pe,scrollableAncestors:Ne,scrollableAncestorRects:De});const _e=p(()=>({active:B,activeNode:re,activeNodeRect:se,activatorEvent:j,collisions:We,containerNodeRect:ce,dragOverlay:ve,draggableNodes:L,droppableContainers:A,droppableRects:Q,over:qe,measureDroppableContainers:ee,scrollableAncestors:Ne,scrollableAncestorRects:De,measuringConfiguration:G,measuringScheduled:ne,windowRect:Ce}),[B,re,se,j,We,ce,ve,L,A,Q,qe,ee,Ne,De,G,ne,Ce]),Qe=p(()=>({activatorEvent:j,activators:Ge,active:B,activeNodeRect:se,ariaDescribedById:{draggable:U},dispatch:S,draggableNodes:L,over:qe,measureDroppableContainers:ee}),[j,Ge,B,se,S,U,L,qe,ee]);return r.createElement(de.Provider,{value:D},r.createElement(Ot.Provider,{value:Qe},r.createElement(Ft.Provider,{value:_e},r.createElement(jt.Provider,{value:Ye},g)),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 l=Z("Draggable"),{activators:i,activatorEvent:a,active:s,activeNodeRect:d,ariaDescribedById:u,draggableNodes:h,over:g}=c(Ot),{role:v=Yt,roleDescription:m="draggable",tabIndex:f=0}=null!=o?o:{},b=(null==s?void 0:s.id)===t,y=c(b?jt:Xt),[w,x]=G(),[C,N]=G(),S=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])}(i,t),E=V(n);X(()=>(h.set(t,{id:t,key:l,node:w,activatorNode:C,data:E}),()=>{const e=h.get(t);e&&e.key===l&&h.delete(t)}),[h,t]);return{active:s,activatorEvent:a,activeNodeRect:d,attributes:p(()=>({role:v,tabIndex:f,"aria-disabled":r,"aria-pressed":!(!b||v!==Yt)||void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,v,f,b,m,u.draggable]),isDragging:b,listeners:r?void 0:S,node:w,over:g,setNodeRef:x,setActivatorNodeRef:N,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:g,isOver:v}=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(Ot),g=l({disabled:n}),v=l(!1),m=l(null),f=l(null),{disabled:b,updateMeasurementsFor:y,timeout:w}={...Jt,...o},x=V(null!=y?y:r),C=St({callback:i(()=>{v.current?(null!=f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{h(Array.isArray(x.current)?x.current:[x.current]),f.current=null},w)):v.current=!0},[w]),disabled:b||!d}),N=i((e,t)=>{C&&(t&&(C.unobserve(t),v.current=!1),e&&C.observe(e))},[C]),[S,E]=G(N),D=V(t);return a(()=>{C&&S.current&&(C.disconnect(),v.current=!1,C.observe(S.current))},[S,C]),a(()=>(u({type:ge.RegisterDroppable,element:{id:r,key:s,disabled:n,node:S,rect:m,data:D}}),()=>u({type:ge.UnregisterDroppable,key:s,id:r})),[r]),a(()=>{n!==g.current.disabled&&(u({type:ge.SetDroppableDisabled,id:r,key:s,disabled:n}),g.current.disabled=n)},[r,s,n,u]),{active:d,rect:m,isOver:(null==p?void 0:p.id)===r,node:S,over:p,setNodeRef:E}}({id:`drop-${n}`,data:{slotPosition:n}}),m={position:"relative",height:"100%",width:"100%",transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:void 0},f=i(e=>{p(e),g(e)},[p,g]);/* @__PURE__ */
|
|
34
|
+
return e(T,{theme:a,layout:s,panels:c,...d})},F="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 H(e){return"nodeType"in e}function W(e){var t,n;return e?I(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 q(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:H(e)?j(e)?e:q(e)||K(e)?e.ownerDocument:document:document:document}const X=F?h:a;function Y(e){const t=l(e);return X(()=>{t.current=e}),i(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=l(e);return X(()=>{n.current!==e&&(n.current=e)},t),n}function J(e,t){const n=l();return p(()=>{const t=e(n.current);return n.current=t,t},[...t])}function G(e){const t=Y(e),n=l(null),r=i(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function _(e){const t=l();return a(()=>{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,l]of r){const n=t[o];null!=n&&(t[o]=n+e*l)}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 le="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ie(e){return e.matches(le)?e:e.querySelector(le)}const ae={display:"none"};function se(e){let{id:t,value:n}=e;return r.createElement("div",{id:t,style:ae},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:l,screenReaderInstructions:s=ue}=e;const{announce:d,announcement:u}=function(){const[e,t]=o("");return{announce:i(e=>{null!=e&&t(e)},[]),announcement:e}}(),h=Z("DndLiveRegion"),[g,v]=o(!1);if(a(()=>{v(!0)},[]),function(e){const t=c(de);a(()=>{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])),!g)return null;const m=r.createElement(r.Fragment,null,r.createElement(se,{id:l,value:s.draggable}),r.createElement(ce,{id:h,announcement:u}));return n?w(m,n):m}var ge,ve;function me(){}(ve=ge||(ge={})).DragStart="dragStart",ve.DragMove="dragMove",ve.DragEnd="dragEnd",ve.DragCancel="dragCancel",ve.DragOver="dragOver",ve.RegisterDroppable="registerDroppable",ve.SetDroppableDisabled="setDroppableDisabled",ve.UnregisterDroppable="unregisterDroppable";const fe=/* @__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),l=[];for(const i of r){const{id:e}=i,t=n.get(e);if(t){const n=be(xe(t),o);l.push({id:e,data:{droppableContainer:i,value:n}})}}return l.sort(ye)};function Ne(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),l=Math.min(t.top+t.height,e.top+e.height),i=o-r,a=l-n;if(r<o&&n<l){const n=t.width*t.height,r=e.width*e.height,o=i*a;return Number((o/(n+r-o)).toFixed(4))}return 0}const Se=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const l of r){const{id:e}=l,r=n.get(e);if(r){const n=Ne(r,t);n>0&&o.push({id:e,data:{droppableContainer:l,value:n}})}}return o.sort(we)};function Ee(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:fe}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 Re=/* @__PURE__ */De(1);const ze={ignoreTransform:!1};function ke(e,t){void 0===t&&(t=ze);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:l,x:i,y:a}=r,s=e.left-i-(1-o)*parseFloat(n),c=e.top-a-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=l?e.height/l: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:l,height:i,bottom:a,right:s}=n;return{top:r,left:o,width:l,height:i,bottom:a,right:s}}function Le(e){return ke(e,{ignoreTransform:!0})}function Pe(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(!q(o)||K(o))return n;if(n.includes(o))return n;const l=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,l)&&n.push(o),function(e,t){return void 0===t&&(t=W(e).getComputedStyle(e)),"fixed"===t.position}(o,l)?n:r(o.parentNode)}(e):n}function Me(e){const[t]=Pe(e,1);return null!=t?t:null}function Ae(e){return F&&e?I(e)?e:H(e)?j(e)||e===U(e).scrollingElement?window:q(e)?e:null:null:null}function Te(e){return I(e)?e.scrollX:e.scrollLeft}function $e(e){return I(e)?e.scrollY:e.scrollTop}function Be(e){return{x:Te(e),y:$e(e)}}var Oe,Fe;function Ie(e){return!(!F||!e)&&e===document.scrollingElement}function He(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}}(Fe=Oe||(Oe={}))[Fe.Forward=1]="Forward",Fe[Fe.Backward=-1]="Backward";const We={x:.2,y:.2};function je(e,t,n,r,o){let{top:l,left:i,right:a,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},g={x:0,y:0},v=t.height*o.y,m=t.width*o.x;return!c&&l<=t.top+v?(h.y=Oe.Backward,g.y=r*Math.abs((t.top+v-l)/v)):!d&&s>=t.bottom-v&&(h.y=Oe.Forward,g.y=r*Math.abs((t.bottom-v-s)/v)),!p&&a>=t.right-m?(h.x=Oe.Forward,g.x=r*Math.abs((t.right-m-a)/m)):!u&&i<=t.left+m&&(h.x=Oe.Backward,g.x=r*Math.abs((t.left+m-i)/m)),{direction:h,speed:g}}function qe(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,Be(t)),fe)}const Ue=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Te(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+$e(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=Pe(t),r=Ke(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[o,l,i]of Ue)for(const e of l)Object.defineProperty(this,e,{get:()=>{const t=i(n),l=r[o]-t;return this.rect[e]+l},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=ke),!e)return;const{top:n,left:r,bottom:o,right:l}=t(e);Me(e)&&(o<=0||l<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(fe)}handleKeyDown(e){if(re(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=tt,coordinateGetter:l=nt,scrollBehavior:i="smooth"}=r,{code:a}=e;if(o.end.includes(a))return void this.handleEnd(e);if(o.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:s}=n.current,c=s?{x:s.left,y:s.top}:fe;this.referenceCoordinates||(this.referenceCoordinates=c);const d=l(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:l,isRight:a,isLeft:s,isBottom:c,maxScroll:u,minScroll:p}=He(n),h=qe(n),g={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))},v=o===_e.Right&&!a||o===_e.Left&&!s,m=o===_e.Down&&!c||o===_e.Up&&!l;if(v&&g.x!==d.x){const e=n.scrollLeft+t.x,l=o===_e.Right&&e<=u.x||o===_e.Left&&e>=p.x;if(l&&!t.y)return void n.scrollTo({left:e,behavior:i});r.x=l?n.scrollLeft-e:o===_e.Right?n.scrollLeft-u.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:i});break}if(m&&g.y!==d.y){const e=n.scrollTop+t.y,l=o===_e.Down&&e<=u.y||o===_e.Up&&e>=p.y;if(l&&!t.x)return void n.scrollTo({top:e,behavior:i});r.y=l?n.scrollTop-e:o===_e.Down?n.scrollTop-u.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:i});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 lt(e){return Boolean(e&&"delay"in e)}rt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=tt,onActivation:o}=t,{active:l}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const t=l.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class it{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:l}=o;this.props=e,this.events=t,this.document=U(l),this.documentListeners=new Ye(this.document),this.listeners=new Ye(n),this.windowListeners=new Ye(W(l)),this.initialCoordinates=null!=(r=oe(o))?r:fe,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(lt(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:l,options:{activationConstraint:i}}=o;if(!r)return;const a=null!=(t=oe(e))?t:fe,s=ne(r,a);if(!n&&i){if(ot(i)){if(null!=i.tolerance&&Ve(s,i.tolerance))return this.handleCancel();if(Ve(s,i.distance))return this.handleStart()}return lt(i)&&Ve(s,i.tolerance)?this.handleCancel():void this.handlePending(i,s)}e.cancelable&&e.preventDefault(),l(a)}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 at={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class st extends it{constructor(e){const{event:t}=e,n=U(t.target);super(e,at,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 it{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,gt,vt,mt;function ft(e){let{acceleration:t,activator:n=ht.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:c=5,order:d=vt.TreeOrder,pointerCoordinates:u,scrollableAncestors:h,scrollableAncestorRects:g,delta:v,threshold:m}=e;const f=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:{[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:v,disabled:!s}),[b,y]=function(){const e=l(null);return[i((t,n)=>{e.current=setInterval(t,n)},[]),i(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),w=l({x:0,y:0}),x=l({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]),N=l(null),S=i(()=>{const e=N.current;if(!e)return;const t=w.current.x*x.current.x,n=w.current.y*x.current.y;e.scrollBy(t,n)},[]),E=p(()=>d===vt.TreeOrder?[...h].reverse():h,[d,h]);a(()=>{if(s&&h.length&&C){for(const e of E){if(!1===(null==r?void 0:r(e)))continue;const n=h.indexOf(e),o=g[n];if(!o)continue;const{direction:l,speed:i}=je(e,o,C,t,m);for(const e of["x","y"])f[e][l[e]]||(i[e]=0,l[e]=0);if(i.x>0||i.y>0)return y(),N.current=e,b(S,c),w.current=i,void(x.current=l)}w.current={x:0,y:0},x.current={x:0,y:0},y()}else y()},[t,S,r,y,s,c,JSON.stringify(C),JSON.stringify(f),b,h,E,g,JSON.stringify(m)])}(class extends it{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)}}],(gt=ht||(ht={}))[gt.Pointer=0]="Pointer",gt[gt.DraggableRect=1]="DraggableRect",(mt=vt||(vt={}))[mt.TreeOrder=0]="TreeOrder",mt[mt.ReversedTreeOrder=1]="ReversedTreeOrder";const bt={x:{[Oe.Backward]:!1,[Oe.Forward]:!1},y:{[Oe.Backward]:!1,[Oe.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 Nt(e,t){return J(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function St(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 a(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function Et(e){return new Xe(ke(e),e)}function Dt(e,t,n){void 0===t&&(t=Et);const[r,l]=o(null);function i(){l(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const l=t(e);return JSON.stringify(r)===JSON.stringify(l)?r:l})}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 a(()=>()=>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)){i();break}}}}),c=St({callback:i});return X(()=>{i(),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 Rt=[];function zt(e,t){void 0===t&&(t=[]);const n=l(null);return a(()=>{n.current=null},t),a(()=>{const t=e!==fe;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?ne(e,n.current):fe}function kt(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 Lt=[];function Pt(e){let{measure:t}=e;const[n,r]=o(null),l=St({callback:i(e=>{for(const{target:n}of e)if(q(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),a=i(e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return q(t)?t:e}(e);null==l||l.disconnect(),n&&(null==l||l.observe(n)),r(n?t(n):null)},[t,l]),[s,c]=G(a);return p(()=>({nodeRef:s,rect:n,setRef:c}),[n,s,c])}const Mt=[{sensor:st,options:{}},{sensor:rt,options:{}}],At={current:{}},Tt={draggable:{measure:Le},droppable:{measure:Le,strategy:yt.WhileDragging,frequency:xt.Optimized},dragOverlay:{measure:ke}};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:me},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Tt,measureDroppableContainers:me,windowRect:null,measuringScheduled:!1},Ot=/* @__PURE__ */s({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:me,draggableNodes:/* @__PURE__ */new Map,over:null,measureDroppableContainers:me}),Ft=/* @__PURE__ */s(Bt);function It(){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 ge.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ge.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 ge.DragEnd:case ge.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ge.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 ge.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,l=e.droppable.containers.get(n);if(!l||r!==l.key)return e;const i=new $t(e.droppable.containers);return i.set(n,{...l,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case ge.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const l=new $t(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Wt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=c(Ot),l=_(r),i=_(null==n?void 0:n.id);return a(()=>{if(!t&&!r&&l&&null!=i){if(!re(l))return;if(document.activeElement===l.target)return;const e=o.get(i);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=ie(e);if(t){t.focus();break}}})}},[r,t,o,i,l]),null}const jt=/* @__PURE__ */s({...fe,scaleX:1,scaleY:1});var qt,Kt;(Kt=qt||(qt={}))[Kt.Uninitialized=0]="Uninitialized",Kt[Kt.Initializing=1]="Initializing",Kt[Kt.Initialized=2]="Initialized";const Ut=/* @__PURE__ */g(function(e){var t,n,s,c;let{id:d,accessibility:u,autoScroll:h=!0,children:g,sensors:m=Mt,collisionDetection:f=Se,measuring:b,modifiers:w,...x}=e;const C=v(Ht,void 0,It),[N,S]=C,[E,D]=function(){const[e]=o(()=>/* @__PURE__ */new Set),t=i(t=>(e.add(t),()=>e.delete(t)),[e]);return[i(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]}(),[R,z]=o(qt.Uninitialized),k=R===qt.Initialized,{draggable:{active:L,nodes:P,translate:M},droppable:{containers:A}}=N,T=null!=L?P.get(L):null,$=l({initial:null,translated:null}),B=p(()=>{var e;return null!=L?{id:L,data:null!=(e=null==T?void 0:T.data)?e:At,rect:$}:null},[L,T]),O=l(null),[I,H]=o(null),[j,q]=o(null),K=V(x,Object.values(x)),U=Z("DndDescribedBy",d),Y=p(()=>A.getEnabled(),[A]),G=p(()=>({draggable:{...Tt.draggable,...null==_?void 0:_.draggable},droppable:{...Tt.droppable,...null==_?void 0:_.droppable},dragOverlay:{...Tt.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,g=l(e),v=function(){switch(h){case yt.Always:return!1;case yt.BeforeDragging:return n;default:return!n}}(),m=V(v),f=i(function(e){void 0===e&&(e=[]),m.current||d(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[m]),b=l(null),y=J(t=>{if(v&&!n)return Ct;if(!t||t===Ct||g.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,v,p]);return a(()=>{g.current=e},[e]),a(()=>{v||f()},[n,v]),a(()=>{c&&c.length>0&&d(null)},[JSON.stringify(c)]),a(()=>{v||"number"!=typeof u||null!==b.current||(b.current=setTimeout(()=>{f(),b.current=null},u))},[u,v,f,...r]),{droppableRects:y,measureDroppableContainers:f,measuringScheduled:null!=c}}(Y,{dragging:k,dependencies:[M.x,M.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])}(P,L),le=p(()=>j?oe(j):null,[j]),ie=function(){const e=!1===(null==I?void 0:I.autoScrollEnabled),t="object"==typeof h?!1===h.enabled:!1===h,n=k&&!e&&!t;if("object"==typeof h)return{...h,enabled:n};return{enabled:n}}(),ae=function(e,t){return Nt(e,t)}(re,G.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=l(!1),{x:a,y:s}="boolean"==typeof o?{x:o,y:o}:o;X(()=>{if(!a&&!s||!t)return void(i.current=!1);if(i.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(a||(o.x=0),s||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=Me(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,s,r,n])}({activeNode:null!=L?P.get(L):null,config:ie.layoutShiftCompensation,initialRect:ae,measure:G.draggable.measure});const se=Dt(re,G.draggable.measure,ae),ce=Dt(re?re.parentElement:null),ue=l({activatorEvent:null,active:null,activeNode:re,collisionRect:null,collisions:null,droppableRects:Q,draggableNodes:P,draggingNode:null,draggingNodeRect:null,droppableContainers:A,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),pe=A.getNodeFor(null==(t=ue.current.over)?void 0:t.id),ve=Pt({measure:G.dragOverlay.measure}),me=null!=(n=ve.nodeRef.current)?n:re,be=k?null!=(s=ve.rect)?s:se:null,ye=Boolean(ve.nodeRef.current&&ve.rect),we=Ee(xe=ye?null:se,Nt(xe));var xe;const Ce=kt(me?W(me):null),Ne=function(e){const t=l(e),n=J(n=>e?n&&n!==Rt&&e&&t.current&&e.parentNode===t.current.parentNode?n:Pe(e):Rt,[e]);return a(()=>{t.current=e},[e]),n}(k?null!=pe?pe:re:null),De=function(e,t){void 0===t&&(t=ke);const[n]=e,r=kt(n?W(n):null),[l,i]=o(Lt);function a(){i(()=>e.length?e.map(e=>Ie(e)?r:new Xe(t(e),e)):Lt)}const s=St({callback:a});return X(()=>{null==s||s.disconnect(),a(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),l}(Ne),ze=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}(w,{transform:{x:M.x-we.x,y:M.y-we.y,scaleX:1,scaleY:1},activatorEvent:j,active:B,activeNodeRect:se,containerNodeRect:ce,draggingNodeRect:be,over:ue.current.over,overlayNodeRect:ve.rect,scrollableAncestors:Ne,scrollableAncestorRects:De,windowRect:Ce}),Le=le?te(le,M):null,Te=function(e){const[t,n]=o(null),r=l(e),s=i(e=>{const t=Ae(e.target);t&&n(e=>e?(e.set(t,Be(t)),new Map(e)):null)},[]);return a(()=>{const t=r.current;if(e!==t){o(t);const l=e.map(e=>{const t=Ae(e);return t?(t.addEventListener("scroll",s,{passive:!0}),[t,Be(t)]):null}).filter(e=>null!=e);n(l.length?new Map(l):null),r.current=e}return()=>{o(e),o(t)};function o(e){e.forEach(e=>{const t=Ae(e);null==t||t.removeEventListener("scroll",s)})}},[s,e]),p(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>te(e,t),fe):Ke(e):fe,[e,t])}(Ne),$e=zt(Te),Oe=zt(Te,[se]),Fe=te(ze,$e),He=be?Re(be,ze):null,We=B&&He?f({active:B,collisionRect:He,droppableRects:Q,droppableContainers:Y,pointerCoordinates:Le}):null,je=function(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}(We,"id"),[qe,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?ze:te(ze,Oe),null!=(c=null==qe?void 0:qe.rect)?c:null,se),Ve=l(null),Je=i((e,t)=>{let{sensor:n,options:r}=t;if(null==O.current)return;const o=P.get(O.current);if(!o)return;const l=e.nativeEvent,i=new n({active:O.current,activeNode:o,event:l,options:r,context:ue,onAbort(e){if(!P.get(e))return;const{onDragAbort:t}=K.current,n={id:e};null==t||t(n),E({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!P.get(e))return;const{onDragPending:o}=K.current,l={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(l),E({type:"onDragPending",event:l})},onStart(e){const t=O.current;if(null==t)return;const n=P.get(t);if(!n)return;const{onDragStart:r}=K.current,o={activatorEvent:l,active:{id:t,data:n.data,rect:$}};y(()=>{null==r||r(o),z(qt.Initializing),S({type:ge.DragStart,initialCoordinates:e,active:t}),E({type:"onDragStart",event:o}),H(Ve.current),q(l)})},onMove(e){S({type:ge.DragMove,coordinates:e})},onEnd:a(ge.DragEnd),onCancel:a(ge.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=ue.current;let i=null;if(t&&o){const{cancelDrop:a}=K.current;if(i={activatorEvent:l,active:t,collisions:n,delta:o,over:r},e===ge.DragEnd&&"function"==typeof a){await Promise.resolve(a(i))&&(e=ge.DragCancel)}}O.current=null,y(()=>{S({type:e}),z(qt.Uninitialized),Ue(null),H(null),q(null),Ve.current=null;const t=e===ge.DragEnd?"onDragEnd":"onDragCancel";if(i){const e=K.current[t];null==e||e(i),E({type:t,event:i})}})}}Ve.current=i},[P]),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])}(m,i((e,t)=>(n,r)=>{const o=n.nativeEvent,l=P.get(r);if(null!==O.current||!l||o.dndKit||o.defaultPrevented)return;const i={active:l};!0===e(n,t.options,i)&&(o.dndKit={capturedBy:t.sensor},O.current=r,Je(n,t))},[P,Je]));!function(e){a(()=>{if(!F)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}))}(m),X(()=>{se&&R===qt.Initializing&&z(qt.Initialized)},[se,R]),a(()=>{const{onDragMove:e}=K.current,{active:t,activatorEvent:n,collisions:r,over:o}=ue.current;if(!t||!n)return;const l={active:t,activatorEvent:n,collisions:r,delta:{x:Fe.x,y:Fe.y},over:o};y(()=>{null==e||e(l),E({type:"onDragMove",event:l})})},[Fe.x,Fe.y]),a(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=ue.current;if(!e||null==O.current||!t||!o)return;const{onDragOver:l}=K.current,i=r.get(je),a=i&&i.rect.current?{id:i.id,rect:i.rect.current,data:i.data,disabled:i.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:a};y(()=>{Ue(a),null==l||l(s),E({type:"onDragOver",event:s})})},[je]),X(()=>{ue.current={activatorEvent:j,active:B,activeNode:re,collisionRect:He,collisions:We,droppableRects:Q,draggableNodes:P,draggingNode:me,draggingNodeRect:be,droppableContainers:A,over:qe,scrollableAncestors:Ne,scrollAdjustedTranslate:Fe},$.current={initial:be,translated:He}},[B,re,We,He,P,me,be,Q,A,qe,Ne,Fe]),ft({...ie,delta:M,draggingRect:He,pointerCoordinates:Le,scrollableAncestors:Ne,scrollableAncestorRects:De});const _e=p(()=>({active:B,activeNode:re,activeNodeRect:se,activatorEvent:j,collisions:We,containerNodeRect:ce,dragOverlay:ve,draggableNodes:P,droppableContainers:A,droppableRects:Q,over:qe,measureDroppableContainers:ee,scrollableAncestors:Ne,scrollableAncestorRects:De,measuringConfiguration:G,measuringScheduled:ne,windowRect:Ce}),[B,re,se,j,We,ce,ve,P,A,Q,qe,ee,Ne,De,G,ne,Ce]),Qe=p(()=>({activatorEvent:j,activators:Ge,active:B,activeNodeRect:se,ariaDescribedById:{draggable:U},dispatch:S,draggableNodes:P,over:qe,measureDroppableContainers:ee}),[j,Ge,B,se,S,U,P,qe,ee]);return r.createElement(de.Provider,{value:D},r.createElement(Ot.Provider,{value:Qe},r.createElement(Ft.Provider,{value:_e},r.createElement(jt.Provider,{value:Ye},g)),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 l=Z("Draggable"),{activators:i,activatorEvent:a,active:s,activeNodeRect:d,ariaDescribedById:u,draggableNodes:h,over:g}=c(Ot),{role:v=Yt,roleDescription:m="draggable",tabIndex:f=0}=null!=o?o:{},b=(null==s?void 0:s.id)===t,y=c(b?jt:Xt),[w,x]=G(),[C,N]=G(),S=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])}(i,t),E=V(n);X(()=>(h.set(t,{id:t,key:l,node:w,activatorNode:C,data:E}),()=>{const e=h.get(t);e&&e.key===l&&h.delete(t)}),[h,t]);return{active:s,activatorEvent:a,activeNodeRect:d,attributes:p(()=>({role:v,tabIndex:f,"aria-disabled":r,"aria-pressed":!(!b||v!==Yt)||void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,v,f,b,m,u.draggable]),isDragging:b,listeners:r?void 0:S,node:w,over:g,setNodeRef:x,setActivatorNodeRef:N,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:g,isOver:v}=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(Ot),g=l({disabled:n}),v=l(!1),m=l(null),f=l(null),{disabled:b,updateMeasurementsFor:y,timeout:w}={...Jt,...o},x=V(null!=y?y:r),C=St({callback:i(()=>{v.current?(null!=f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{h(Array.isArray(x.current)?x.current:[x.current]),f.current=null},w)):v.current=!0},[w]),disabled:b||!d}),N=i((e,t)=>{C&&(t&&(C.unobserve(t),v.current=!1),e&&C.observe(e))},[C]),[S,E]=G(N),D=V(t);return a(()=>{C&&S.current&&(C.disconnect(),v.current=!1,C.observe(S.current))},[S,C]),a(()=>(u({type:ge.RegisterDroppable,element:{id:r,key:s,disabled:n,node:S,rect:m,data:D}}),()=>u({type:ge.UnregisterDroppable,key:s,id:r})),[r]),a(()=>{n!==g.current.disabled&&(u({type:ge.SetDroppableDisabled,id:r,key:s,disabled:n}),g.current.disabled=n)},[r,s,n,u]),{active:d,rect:m,isOver:(null==p?void 0:p.id)===r,node:S,over:p,setNodeRef:E}}({id:`drop-${n}`,data:{slotPosition:n}}),m={position:"relative",height:"100%",width:"100%",transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:void 0},f=i(e=>{p(e),g(e)},[p,g]);/* @__PURE__ */
|
|
35
35
|
return t("div",{ref:f,style:m,className:`slot-with-overlay ${r?"edit-mode":""} ${o?"dragging":""} ${v?"drag-over":""}`,children:[s,r&&/* @__PURE__ */t("div",{className:"slot-edit-overlay",...d,...u,children:[
|
|
36
36
|
/* @__PURE__ */e("div",{className:"drag-indicator",children:"⋮⋮"}),
|
|
37
37
|
/* @__PURE__ */e("div",{className:"slot-position-label",children:n.toUpperCase()})]})]})},_t=d(({isEditMode:n,onLayoutChange:r,panels:l,layout:s,...c},d)=>{const[u,h]=o(null),[g,v]=o({x:0,y:0}),m=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:f,options:null!=b?b:{}}),[f=st,b={activationConstraint:{distance:8}}]));var f,b;const y=i(e=>{const t=e.active.id;if(t.startsWith("slot-")){const e=t.replace("slot-","");h(e),v({x:0,y:0})}},[]),w=i(e=>{const{delta:t}=e;v({x:t.x,y:t.y})},[]),x=i(e=>{const{active:t,over:n}=e;if(h(null),v({x:0,y:0}),!n)return;const o=t.id,l=n.id,i=o.replace("slot-",""),a=l.replace("drop-","");if(i===a)return;const c={...s},d=c[i];c[i]=c[a],c[a]=d,r&&r(c)},[s,r]);a(()=>{if(!u||!n)return;const e=document.querySelector(`[data-slot="${u}"]`);return e&&(e.setAttribute("data-dragging","true"),e.style.setProperty("transform",`scale(0.95) translate(${g.x}px, ${g.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"))}},[u,g,n]);/* @__PURE__ */
|
|
@@ -61,5 +61,5 @@ return t("div",{className:`available-panel ${r?"selected":""} ${l?"in-use":""}`,
|
|
|
61
61
|
/* @__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?R(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: ",g(p.id)?.label,". Click a slot to assign",R("left")||R("middle")||R("right")?" (or add to tab group)":"","."]})}),
|
|
62
62
|
/* @__PURE__ */t("div",{className:"usage-hint",children:[
|
|
63
63
|
/* @__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"})}),
|
|
64
|
-
/* @__PURE__ */e("strong",{children:"Tip:"})," Toggle the tab icon on a slot to enable tab mode, then click panels to add multiple tabs."]})]})};export{S as AnimatedResizableLayout,E as AnimatedVerticalLayout,D as CollapsibleSplitPane,T as ConfigurablePanelLayout,_t as EditableConfigurablePanelLayout,
|
|
64
|
+
/* @__PURE__ */e("strong",{children:"Tip:"})," Toggle the tab icon on a slot to enable tab mode, then click panels to add multiple tabs."]})]})};export{S as AnimatedResizableLayout,E as AnimatedVerticalLayout,D as CollapsibleSplitPane,T as ConfigurablePanelLayout,_t as EditableConfigurablePanelLayout,P as PanelBoundsProvider,tn as PanelConfigurator,O as ResponsiveConfigurablePanelLayout,$ as SnapCarousel,z as TabGroup,C as mapThemeToPanelVars,N as mapThemeToTabVars,B as useMediaQuery,M as usePanelBounds,A as usePanelOffset};
|
|
65
65
|
//# sourceMappingURL=index.esm.js.map
|