@principal-ade/panels 1.0.41 → 1.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ResponsiveConfigurablePanelLayout.d.ts +1 -1
- package/dist/components/ResponsiveConfigurablePanelLayout.d.ts.map +1 -1
- package/dist/components/SnapCarousel.d.ts +2 -0
- package/dist/components/SnapCarousel.d.ts.map +1 -1
- package/dist/index.esm.js +21 -17
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/panels.css +1 -1
- package/dist/utils/themeMapping.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react/jsx-runtime"),require("react"),require("react-resizable-panels"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","react","react-resizable-panels","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).A24ZPanels={},e["react/jsx-runtime"],e.React,e.ReactResizablePanels,e.ReactDOM)}(this,function(e,t,n,r,o){"use strict";function a(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 l(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.text,"--tab-text-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}}const i=({panelIds:e,panels:r,config:o={},className:a="",theme:i})=>{const{defaultActiveTab:s=0,tabPosition:c="top",centered:d=!0,hideTabList:u=!1,activeTabIndex:p,onTabChange:f}=o,[h,m]=n.useState(s),g=void 0!==p,v=g?p:h;n.useEffect(()=>{g||m(s)},[s,g]);const b=l(i),y=e.map(e=>r.find(t=>t.id===e)).filter(e=>void 0!==e),x=Math.min(v,y.length-1),w=y[x];if(0===y.length)return t.jsx("div",{className:"tab-group-empty",children:"No panels available"});const C="top"===c||"bottom"===c||d,R=t.jsx("div",{className:"tab-list "+(C?"centered":""),role:"tablist",children:y.map((e,n)=>t.jsx("button",{role:"tab","aria-selected":n===x,"aria-controls":`tabpanel-${e.id}`,id:`tab-${e.id}`,className:"tab-button "+(n===x?"active":""),onClick:()=>(e=>{g||m(e),f?.(e)})(n),title:e.icon?e.label:void 0,children:e.icon?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"tab-icon",children:e.icon}),t.jsx("span",{className:"tab-label",children:e.label})]}):e.label},e.id))}),S=w?t.jsx("div",{className:"tab-content",role:"tabpanel",id:`tabpanel-${w.id}`,"aria-labelledby":`tab-${w.id}`,children:w.content}):null;return t.jsxs("div",{className:`tab-group tab-position-${c} ${a}`,style:b,children:[!u&&("top"===c||"left"===c)&&R,S,!u&&("bottom"===c||"right"===c)&&R]})},s=({panels:e,layout:l,slotDataAttributes:s={},collapsiblePanels:c={left:!0,middle:!1,right:!0},defaultSizes:d={left:20,middle:60,right:20},minSizes:u={left:5,middle:10,right:5},className:p="",collapsed:f={left:!1,middle:!1,right:!1},style:h,showCollapseButtons:m=!1,animationDuration:g=300,animationEasing:v="cubic-bezier(0.4, 0, 0.2, 1)",theme:b,onLeftCollapseStart:y,onLeftCollapseComplete:x,onLeftExpandStart:w,onLeftExpandComplete:C,onMiddleCollapseStart:R,onMiddleCollapseComplete:S,onMiddleExpandStart:E,onMiddleExpandComplete:k,onRightCollapseStart:D,onRightCollapseComplete:N,onRightExpandStart:z,onRightExpandComplete:M,onPanelResize:j})=>{const T=null!==l.left&&void 0!==l.left,A=null!==l.middle&&void 0!==l.middle,P=null!==l.right&&void 0!==l.right,L=[T,A,P].filter(Boolean).length,F={left:T?d?.left??(2===L?50:3===L?20:100):0,middle:A?d?.middle??(2===L?50:3===L?60:100):0,right:P?d?.right??(2===L?50:3===L?20:100):0},$={left:u?.left??5,middle:u?.middle??10,right:u?.right??5},[B,O]=n.useState(f.left||!T),[I,q]=n.useState(f.middle||!A),[_,H]=n.useState(f.right||!P),[U,W]=n.useState(!1),[K,V]=n.useState(!1),[X,Y]=n.useState(!1),[G,J]=n.useState(!1),Q=B&&!U,Z=I&&!K,ee=_&&!X,te=n.useCallback(t=>{if(!t)return null;const n=e.find(e=>e.id===t);return n?.content||null},[e]),ne=n.useCallback(n=>{if(null===n)return null;if("object"==typeof n&&"type"in n){const r=n;return"tabs"===r.type?t.jsx(i,{panelIds:r.panels,panels:e,config:r.config,theme:b}):null}return te(n)},[e,te,b]),re=ne(l.left??null),oe=ne(l.middle??null),ae=ne(l.right??null),[le,ie]=n.useState(f.left||!T?0:F.left),[se,ce]=n.useState(f.middle||!A?0:F.middle),[de,ue]=n.useState(f.right||!P?0:F.right),[pe,fe]=n.useState(F.left),[he,me]=n.useState(F.middle),[ge,ve]=n.useState(F.right),be=n.useRef(null),ye=n.useRef(null),xe=n.useRef(null),we=n.useRef(null),Ce=n.useRef(void 0),Re=n.useRef(void 0),Se=n.useRef(void 0),Ee=n.useRef(void 0),ke=n.useRef(void 0),De=n.useRef(void 0),Ne=n.useCallback((e,t)=>{const n=e.filter(e=>e.panelRef.current);if(0===n.length)return;n.forEach(e=>{e.animationFrameRef.current&&cancelAnimationFrame(e.animationFrameRef.current)});let r=0;const o=()=>{r++;const e=r/10;if(e>=1)return n.forEach(e=>{e.panelRef.current&&(0===e.toSize?e.panelRef.current.collapse():e.panelRef.current.resize(e.toSize))}),void(t&&t());const a=e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2;n.forEach(e=>{if(e.panelRef.current){const t=e.fromSize+(e.toSize-e.fromSize)*a;e.panelRef.current.resize(t)}}),n[0].animationFrameRef.current=requestAnimationFrame(()=>{setTimeout(o,g/10)})};o()},[g]),ze=n.useCallback(()=>{U||G||!c.left||(o.flushSync(()=>{W(!0),V(!0),Y(!0),O(!0)}),y&&y(),Ce.current&&cancelAnimationFrame(Ce.current),Ce.current=requestAnimationFrame(()=>{const e=be.current?.getLayout(),t=Math.round(1e3*(e?.[0]??le))/1e3,n=Math.round(1e3*(e?.[1]??se))/1e3,r=Math.round(1e3*(e?.[2]??de))/1e3,o=n+r,a=o>0?n/o*100:A?50:0,l=o>0?r/o*100:P?50:0;a>0&&me(a),l>0&&ve(l),Ne([{panelRef:ye,fromSize:t,toSize:0,animationFrameRef:Ce,startTimeRef:Ee},{panelRef:xe,fromSize:n,toSize:a,animationFrameRef:Re,startTimeRef:ke},{panelRef:we,fromSize:r,toSize:l,animationFrameRef:Se,startTimeRef:De}],()=>{ie(0),ce(a),ue(l),W(!1),V(!1),Y(!1),x&&x()})}))},[U,G,le,se,de,A,P,c.left,Ne,y,x]),Me=n.useCallback(()=>{U||G||!c.left||(o.flushSync(()=>{W(!0),V(!0),Y(!0),O(!1)}),w&&w(),Ce.current&&cancelAnimationFrame(Ce.current),Ce.current=requestAnimationFrame(()=>{const e=be.current?.getLayout(),t=Math.round(1e3*(e?.[0]??0))/1e3,n=Math.round(1e3*(e?.[1]??se))/1e3,r=Math.round(1e3*(e?.[2]??de))/1e3,o=pe||F.left,a=100-o,l=n+r,i=l>0?n/l*a:A?a/2:0,s=l>0?r/l*a:P?a/2:0;i>0&&me(i),s>0&&ve(s),Ne([{panelRef:ye,fromSize:t,toSize:o,animationFrameRef:Ce,startTimeRef:Ee},{panelRef:xe,fromSize:n,toSize:i,animationFrameRef:Re,startTimeRef:ke},{panelRef:we,fromSize:r,toSize:s,animationFrameRef:Se,startTimeRef:De}],()=>{ie(o),ce(i),ue(s),W(!1),V(!1),Y(!1),C&&C()})}))},[U,G,se,de,F.left,pe,A,P,c.left,Ne,w,C]),je=n.useCallback(()=>{X||G||!c.right||(o.flushSync(()=>{W(!0),V(!0),Y(!0),H(!0)}),D&&D(),Se.current&&cancelAnimationFrame(Se.current),Se.current=requestAnimationFrame(()=>{const e=be.current?.getLayout(),t=Math.round(1e3*(e?.[0]??le))/1e3,n=Math.round(1e3*(e?.[1]??se))/1e3,r=Math.round(1e3*(e?.[2]??de))/1e3,o=t+n,a=o>0?t/o*100:T?50:0,l=o>0?n/o*100:A?50:0;a>0&&fe(a),l>0&&me(l),Ne([{panelRef:ye,fromSize:t,toSize:a,animationFrameRef:Ce,startTimeRef:Ee},{panelRef:xe,fromSize:n,toSize:l,animationFrameRef:Re,startTimeRef:ke},{panelRef:we,fromSize:r,toSize:0,animationFrameRef:Se,startTimeRef:De}],()=>{ie(a),ce(l),ue(0),W(!1),V(!1),Y(!1),N&&N()})}))},[X,G,le,se,de,T,A,c.right,Ne,D,N]),Te=n.useCallback(()=>{X||G||!c.right||(o.flushSync(()=>{W(!0),V(!0),Y(!0),H(!1)}),z&&z(),Se.current&&cancelAnimationFrame(Se.current),Se.current=requestAnimationFrame(()=>{const e=be.current?.getLayout(),t=Math.round(1e3*(e?.[0]??le))/1e3,n=Math.round(1e3*(e?.[1]??se))/1e3,r=Math.round(1e3*(e?.[2]??0))/1e3,o=ge||F.right,a=100-o,l=t+n,i=l>0?t/l*a:T?a/2:0,s=l>0?n/l*a:A?a/2:0;i>0&&fe(i),s>0&&me(s),Ne([{panelRef:ye,fromSize:t,toSize:i,animationFrameRef:Ce,startTimeRef:Ee},{panelRef:xe,fromSize:n,toSize:s,animationFrameRef:Re,startTimeRef:ke},{panelRef:we,fromSize:r,toSize:o,animationFrameRef:Se,startTimeRef:De}],()=>{ie(i),ce(s),ue(o),W(!1),V(!1),Y(!1),M&&M()})}))},[X,G,le,se,F.right,ge,T,A,c.right,Ne,z,M]),Ae=n.useCallback(()=>{B?Me():ze()},[B,ze,Me]),Pe=n.useCallback(()=>{K||G||!c.middle||(o.flushSync(()=>{W(!0),V(!0),Y(!0),q(!0)}),R&&R(),Re.current&&cancelAnimationFrame(Re.current),Re.current=requestAnimationFrame(()=>{const e=be.current?.getLayout(),t=Math.round(1e3*(e?.[0]??le))/1e3,n=Math.round(1e3*(e?.[1]??se))/1e3,r=Math.round(1e3*(e?.[2]??de))/1e3,o=t+r,a=o>0?t/o*100:T?50:0,l=o>0?r/o*100:P?50:0;a>0&&fe(a),l>0&&ve(l),Ne([{panelRef:ye,fromSize:t,toSize:a,animationFrameRef:Ce,startTimeRef:Ee},{panelRef:xe,fromSize:n,toSize:0,animationFrameRef:Re,startTimeRef:ke},{panelRef:we,fromSize:r,toSize:l,animationFrameRef:Se,startTimeRef:De}],()=>{ie(a),ce(0),ue(l),W(!1),V(!1),Y(!1),S&&S()})}))},[K,G,le,se,de,T,P,c.middle,Ne,R,S]),Le=n.useCallback(()=>{K||G||!c.middle||(o.flushSync(()=>{W(!0),V(!0),Y(!0),q(!1)}),E&&E(),Re.current&&cancelAnimationFrame(Re.current),Re.current=requestAnimationFrame(()=>{const e=be.current?.getLayout(),t=Math.round(1e3*(e?.[0]??le))/1e3,n=Math.round(1e3*(e?.[1]??0))/1e3,r=Math.round(1e3*(e?.[2]??de))/1e3,o=he||F.middle,a=100-o,l=t+r,i=l>0?t/l*a:T?a/2:0,s=l>0?r/l*a:P?a/2:0;i>0&&fe(i),s>0&&ve(s),Ne([{panelRef:ye,fromSize:t,toSize:i,animationFrameRef:Ce,startTimeRef:Ee},{panelRef:xe,fromSize:n,toSize:o,animationFrameRef:Re,startTimeRef:ke},{panelRef:we,fromSize:r,toSize:s,animationFrameRef:Se,startTimeRef:De}],()=>{ie(i),ce(o),ue(s),W(!1),V(!1),Y(!1),k&&k()})}))},[K,G,le,de,F.middle,he,T,P,c.middle,Ne,E,k]),Fe=n.useCallback(()=>{_?Te():je()},[_,je,Te]),$e=n.useCallback(e=>{U||K||X||(ie(e),e>0&&(fe(e),O(!1)))},[U,K,X]),Be=n.useCallback(e=>{U||K||X||(ce(e),e>0&&(me(e),q(!1)))},[U,K,X]),Oe=n.useCallback(e=>{U||K||X||(ue(e),e>0&&(ve(e),H(!1)))},[U,K,X]),Ie=n.useCallback(()=>{if(j){j({left:B?pe:le,middle:I?he:se,right:_?ge:de})}},[le,se,de,B,I,_,pe,he,ge,j]),qe=n.useCallback(e=>{J(e),e||Ie()},[Ie]);n.useEffect(()=>{void 0!==f.left&&f.left!==B&&queueMicrotask(()=>{f.left?ze():Me()})},[f.left,B,ze,Me]),n.useEffect(()=>{void 0!==f.middle&&f.middle!==I&&queueMicrotask(()=>{f.middle?Pe():Le()})},[f.middle,I,Pe,Le]),n.useEffect(()=>{void 0!==f.right&&f.right!==_&&queueMicrotask(()=>{f.right?je():Te()})},[f.right,_,je,Te]),n.useEffect(()=>()=>{Ce.current&&cancelAnimationFrame(Ce.current),Re.current&&cancelAnimationFrame(Re.current),Se.current&&cancelAnimationFrame(Se.current)},[]);const _e=e=>{let t="three-panel-item";return"left"===e?!c.left&&T||(t+=" collapsible-panel",U&&!G&&(t+=" animating"),Q&&(t+=" collapsed")):"middle"===e?(t+=" middle-panel",!c.middle&&A||(t+=" collapsible-panel",K&&!G&&(t+=" animating"),Z&&(t+=" collapsed"))):"right"===e&&(!c.right&&P||(t+=" collapsible-panel",X&&!G&&(t+=" animating"),ee&&(t+=" collapsed"))),t},He=U&&!G?{transition:`width ${g}ms ${v}`,width:B?"0%":`${F.left}%`}:void 0,Ue=K&&!G?{transition:`width ${g}ms ${v}`,width:I?"0%":`${F.middle}%`}:void 0,We=X&&!G?{transition:`width ${g}ms ${v}`,width:_?"0%":`${F.right}%`}:void 0,Ke=a(b),Ve=U||K||X?0:$.left,Xe=U||K||X?0:$.middle,Ye=U||K||X?0:$.right;return t.jsx("div",{className:`three-panel-layout ${p}`,style:{...Ke,...h},children:t.jsxs(r.PanelGroup,{ref:be,direction:"horizontal",onLayout:Ie,children:[t.jsx(r.Panel,{ref:ye,collapsible:c.left||!T,defaultSize:f.left||!T?0:F.left,minSize:Ve,collapsedSize:0,onResize:$e,onCollapse:()=>O(!0),onExpand:()=>O(!1),className:_e("left"),style:He,...s.left||{},children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:B?0:1,transition:U?`opacity ${.5*g}ms ${v}`:"none"},children:re})}),t.jsx(r.PanelResizeHandle,{className:"resize-handle left-handle "+(!Q&&T&&A?"":"collapsed"),onDragging:qe,disabled:Q||!T||!A,children:m&&c.left&&t.jsx("div",{className:"handle-bar",children:t.jsx("button",{onClick:Ae,className:"collapse-toggle",disabled:U,"aria-label":B?"Expand left panel":"Collapse left panel",children:B?"▸":"◂"})})}),t.jsx(r.Panel,{ref:xe,collapsible:c.middle||!A,defaultSize:f.middle||!A?0:F.middle,minSize:Xe,collapsedSize:0,onResize:Be,onCollapse:()=>q(!0),onExpand:()=>q(!1),className:_e("middle"),style:Ue,...s.middle||{},children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:I?0:1,transition:K?`opacity ${.5*g}ms ${v}`:"none"},children:oe})}),t.jsx(r.PanelResizeHandle,{className:"resize-handle right-handle "+(ee||!P||!A&&!T?"collapsed":""),onDragging:qe,disabled:ee||!P||!A&&!T,children:m&&c.right&&t.jsx("div",{className:"handle-bar",children:t.jsx("button",{onClick:Fe,className:"collapse-toggle",disabled:X,"aria-label":_?"Expand right panel":"Collapse right panel",children:_?"◂":"▸"})})}),t.jsx(r.Panel,{ref:we,collapsible:c.right||!P,defaultSize:f.right||!P?0:F.right,minSize:Ye,collapsedSize:0,onResize:Oe,onCollapse:()=>H(!0),onExpand:()=>H(!1),className:_e("right"),style:We,...s.right||{},children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:_?0:1,transition:X?`opacity ${.5*g}ms ${v}`:"none"},children:ae})})]})})},c=n.forwardRef(({panels:e,className:r="",style:o,theme:l,minPanelWidth:i=350,idealPanelWidth:s=.333,showSeparator:c=!1,onPanelChange:d,preventKeyboardScroll:u=!0},p)=>{const f=n.useRef(null),h=a(l);n.useImperativeHandle(p,()=>({scrollToPanel:e=>{if(!f.current)return;const t=f.current,n=t.children[e];if(n){const e=n.offsetLeft;t.scrollTo({left:e,behavior:"smooth"})}},getCurrentPanel:()=>{if(!f.current||0===f.current.children.length)return 0;const e=f.current,t=e.getBoundingClientRect().left;let n=0,r=1/0;for(let o=0;o<e.children.length;o++){const a=e.children[o].getBoundingClientRect(),l=Math.abs(a.left-t);l<r&&(r=l,n=o)}return n}}));n.useEffect(()=>{if(!u||!f.current)return;const e=f.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)}},[u]);const m=e.length,g=2*i;let v;v=1===m||2===m?"100%":`max(${i}px, ${100*s}%)`;const b=n.useId().replace(/:/g,"_");return t.jsxs(t.Fragment,{children:[2===m&&t.jsx("style",{children:`\n .snap-carousel-container[data-carousel-id="${b}"][data-panel-count="2"] .snap-carousel-panel {\n width: 100%;\n }\n @container (min-width: ${g}px) {\n .snap-carousel-container[data-carousel-id="${b}"][data-panel-count="2"] .snap-carousel-panel {\n width: 50%;\n }\n }\n `}),t.jsx("div",{ref:f,className:`snap-carousel-container ${r}`,style:{...h,...o,"--snap-carousel-min-width":`${i}px`,"--snap-carousel-ideal-width":100*s+"%","--snap-carousel-gap":c?"1px":"0px","--snap-carousel-panel-width":v,"--snap-carousel-panel-count":m,"--snap-carousel-two-panel-threshold":`${g}px`},onScroll:e=>{if(!d||!f.current||0===f.current.children.length)return;const t=f.current,n=t.getBoundingClientRect().left;let r=0,o=1/0;for(let a=0;a<t.children.length;a++){const e=t.children[a].getBoundingClientRect(),l=Math.abs(e.left-n);l<o&&(o=l,r=a)}d(r)},"data-panel-count":m,"data-carousel-id":b,children:e.map((e,n)=>t.jsx("div",{className:"snap-carousel-panel",children:e},n))})]})});function d(e){const[t,r]=n.useState(()=>"undefined"!=typeof window&&window.matchMedia(e).matches);return n.useEffect(()=>{if("undefined"==typeof window)return;const t=window.matchMedia(e),n=e=>{r(e.matches)};return r(t.matches),t.addEventListener?(t.addEventListener("change",n),()=>t.removeEventListener("change",n)):(t.addListener(n),()=>t.removeListener(n))},[e]),t}c.displayName="SnapCarousel";const u="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function p(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function f(e){return"nodeType"in e}function h(e){var t,n;return e?p(e)?e:f(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function m(e){const{Document:t}=h(e);return e instanceof t}function g(e){return!p(e)&&e instanceof h(e).HTMLElement}function v(e){return e instanceof h(e).SVGElement}function b(e){return e?p(e)?e.document:f(e)?m(e)?e:g(e)||v(e)?e.ownerDocument:document:document:document}const y=u?n.useLayoutEffect:n.useEffect;function x(e){const t=n.useRef(e);return y(()=>{t.current=e}),n.useCallback(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 w(e,t){void 0===t&&(t=[e]);const r=n.useRef(e);return y(()=>{r.current!==e&&(r.current=e)},t),r}function C(e,t){const r=n.useRef();return n.useMemo(()=>{const t=e(r.current);return r.current=t,t},[...t])}function R(e){const t=x(e),r=n.useRef(null),o=n.useCallback(e=>{e!==r.current&&(null==t||t(e,r.current)),r.current=e},[]);return[r,o]}function S(e){const t=n.useRef();return n.useEffect(()=>{t.current=e},[e]),t.current}let E={};function k(e,t){return n.useMemo(()=>{if(t)return t;const n=null==E[e]?0:E[e]+1;return E[e]=n,e+"-"+n},[e,t])}function D(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,a]of r){const n=t[o];null!=n&&(t[o]=n+e*a)}return t},{...t})}}const N=D(1),z=D(-1);function M(e){if(!e)return!1;const{KeyboardEvent:t}=h(e.target);return t&&e instanceof t}function j(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=h(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 T="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function A(e){return e.matches(T)?e:e.querySelector(T)}const P={display:"none"};function L(e){let{id:t,value:r}=e;return n.createElement("div",{id:t,style:P},r)}function F(e){let{id:t,announcement:r,ariaLiveType:o="assertive"}=e;return n.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},r)}const $=n.createContext(null);const B={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 "},O={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 I(e){let{announcements:t=O,container:r,hiddenTextDescribedById:a,screenReaderInstructions:l=B}=e;const{announce:i,announcement:s}=function(){const[e,t]=n.useState("");return{announce:n.useCallback(e=>{null!=e&&t(e)},[]),announcement:e}}(),c=k("DndLiveRegion"),[d,u]=n.useState(!1);if(n.useEffect(()=>{u(!0)},[]),function(e){const t=n.useContext($);n.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(n.useMemo(()=>({onDragStart(e){let{active:n}=e;i(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&i(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;i(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;i(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;i(t.onDragCancel({active:n,over:r}))}}),[i,t])),!d)return null;const p=n.createElement(n.Fragment,null,n.createElement(L,{id:a,value:l.draggable}),n.createElement(F,{id:c,announcement:s}));return r?o.createPortal(p,r):p}var q,_;function H(){}(_=q||(q={})).DragStart="dragStart",_.DragMove="dragMove",_.DragEnd="dragEnd",_.DragCancel="dragCancel",_.DragOver="dragOver",_.RegisterDroppable="registerDroppable",_.SetDroppableDisabled="setDroppableDisabled",_.UnregisterDroppable="unregisterDroppable";const U=Object.freeze({x:0,y:0});function W(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function K(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function V(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function X(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 Y=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=X(t,t.left,t.top),a=[];for(const l of r){const{id:e}=l,t=n.get(e);if(t){const n=W(X(t),o);a.push({id:e,data:{droppableContainer:l,value:n}})}}return a.sort(K)};function G(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),a=Math.min(t.top+t.height,e.top+e.height),l=o-r,i=a-n;if(r<o&&n<a){const n=t.width*t.height,r=e.width*e.height,o=l*i;return Number((o/(n+r-o)).toFixed(4))}return 0}const J=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const a of r){const{id:e}=a,r=n.get(e);if(r){const n=G(r,t);n>0&&o.push({id:e,data:{droppableContainer:a,value:n}})}}return o.sort(V)};function Q(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:U}function Z(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 ee=Z(1);const te={ignoreTransform:!1};function ne(e,t){void 0===t&&(t=te);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=h(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:a,x:l,y:i}=r,s=e.left-l-(1-o)*parseFloat(n),c=e.top-i-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=a?e.height/a: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:a,height:l,bottom:i,right:s}=n;return{top:r,left:o,width:a,height:l,bottom:i,right:s}}function re(e){return ne(e,{ignoreTransform:!0})}function oe(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(m(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!g(o)||v(o))return n;if(n.includes(o))return n;const a=h(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=h(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,a)&&n.push(o),function(e,t){return void 0===t&&(t=h(e).getComputedStyle(e)),"fixed"===t.position}(o,a)?n:r(o.parentNode)}(e):n}function ae(e){const[t]=oe(e,1);return null!=t?t:null}function le(e){return u&&e?p(e)?e:f(e)?m(e)||e===b(e).scrollingElement?window:g(e)?e:null:null:null}function ie(e){return p(e)?e.scrollX:e.scrollLeft}function se(e){return p(e)?e.scrollY:e.scrollTop}function ce(e){return{x:ie(e),y:se(e)}}var de,ue;function pe(e){return!(!u||!e)&&e===document.scrollingElement}function fe(e){const t={x:0,y:0},n=pe(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}}(ue=de||(de={}))[ue.Forward=1]="Forward",ue[ue.Backward=-1]="Backward";const he={x:.2,y:.2};function me(e,t,n,r,o){let{top:a,left:l,right:i,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=he);const{isTop:c,isBottom:d,isLeft:u,isRight:p}=fe(e),f={x:0,y:0},h={x:0,y:0},m=t.height*o.y,g=t.width*o.x;return!c&&a<=t.top+m?(f.y=de.Backward,h.y=r*Math.abs((t.top+m-a)/m)):!d&&s>=t.bottom-m&&(f.y=de.Forward,h.y=r*Math.abs((t.bottom-m-s)/m)),!p&&i>=t.right-g?(f.x=de.Forward,h.x=r*Math.abs((t.right-g-i)/g)):!u&&l<=t.left+g&&(f.x=de.Backward,h.x=r*Math.abs((t.left+g-l)/g)),{direction:f,speed:h}}function ge(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 ve(e){return e.reduce((e,t)=>N(e,ce(t)),U)}const be=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+ie(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+se(t),0)}]];class ye{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=oe(t),r=ve(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[o,a,l]of be)for(const e of a)Object.defineProperty(this,e,{get:()=>{const t=l(n),a=r[o]-t;return this.rect[e]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class xe{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 we(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 Ce,Re,Se,Ee;function ke(e){e.preventDefault()}function De(e){e.stopPropagation()}(Re=Ce||(Ce={})).Click="click",Re.DragStart="dragstart",Re.Keydown="keydown",Re.ContextMenu="contextmenu",Re.Resize="resize",Re.SelectionChange="selectionchange",Re.VisibilityChange="visibilitychange",(Ee=Se||(Se={})).Space="Space",Ee.Down="ArrowDown",Ee.Right="ArrowRight",Ee.Left="ArrowLeft",Ee.Up="ArrowUp",Ee.Esc="Escape",Ee.Enter="Enter",Ee.Tab="Tab";const Ne={start:[Se.Space,Se.Enter],cancel:[Se.Esc],end:[Se.Space,Se.Enter,Se.Tab]},ze=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Se.Right:return{...n,x:n.x+25};case Se.Left:return{...n,x:n.x-25};case Se.Down:return{...n,y:n.y+25};case Se.Up:return{...n,y:n.y-25}}};class Me{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 xe(b(t)),this.windowListeners=new xe(h(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ce.Resize,this.handleCancel),this.windowListeners.add(Ce.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ce.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=ne),!e)return;const{top:n,left:r,bottom:o,right:a}=t(e);ae(e)&&(o<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(U)}handleKeyDown(e){if(M(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Ne,coordinateGetter:a=ze,scrollBehavior:l="smooth"}=r,{code:i}=e;if(o.end.includes(i))return void this.handleEnd(e);if(o.cancel.includes(i))return void this.handleCancel(e);const{collisionRect:s}=n.current,c=s?{x:s.left,y:s.top}:U;this.referenceCoordinates||(this.referenceCoordinates=c);const d=a(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=z(d,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:a,isRight:i,isLeft:s,isBottom:c,maxScroll:u,minScroll:p}=fe(n),f=ge(n),h={x:Math.min(o===Se.Right?f.right-f.width/2:f.right,Math.max(o===Se.Right?f.left:f.left+f.width/2,d.x)),y:Math.min(o===Se.Down?f.bottom-f.height/2:f.bottom,Math.max(o===Se.Down?f.top:f.top+f.height/2,d.y))},m=o===Se.Right&&!i||o===Se.Left&&!s,g=o===Se.Down&&!c||o===Se.Up&&!a;if(m&&h.x!==d.x){const e=n.scrollLeft+t.x,a=o===Se.Right&&e<=u.x||o===Se.Left&&e>=p.x;if(a&&!t.y)return void n.scrollTo({left:e,behavior:l});r.x=a?n.scrollLeft-e:o===Se.Right?n.scrollLeft-u.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:l});break}if(g&&h.y!==d.y){const e=n.scrollTop+t.y,a=o===Se.Down&&e<=u.y||o===Se.Up&&e>=p.y;if(a&&!t.x)return void n.scrollTo({top:e,behavior:l});r.y=a?n.scrollTop-e:o===Se.Down?n.scrollTop-u.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:l});break}}this.handleMove(e,N(z(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 je(e){return Boolean(e&&"distance"in e)}function Te(e){return Boolean(e&&"delay"in e)}Me.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Ne,onActivation:o}=t,{active:a}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const t=a.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class Ae{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=h(e);return e instanceof t?e:b(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:a}=o;this.props=e,this.events=t,this.document=b(a),this.documentListeners=new xe(this.document),this.listeners=new xe(n),this.windowListeners=new xe(h(a)),this.initialCoordinates=null!=(r=j(o))?r:U,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(Ce.Resize,this.handleCancel),this.windowListeners.add(Ce.DragStart,ke),this.windowListeners.add(Ce.VisibilityChange,this.handleCancel),this.windowListeners.add(Ce.ContextMenu,ke),this.documentListeners.add(Ce.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Te(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(je(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(Ce.Click,De,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ce.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:a,options:{activationConstraint:l}}=o;if(!r)return;const i=null!=(t=j(e))?t:U,s=z(r,i);if(!n&&l){if(je(l)){if(null!=l.tolerance&&we(s,l.tolerance))return this.handleCancel();if(we(s,l.distance))return this.handleStart()}return Te(l)&&we(s,l.tolerance)?this.handleCancel():void this.handlePending(l,s)}e.cancelable&&e.preventDefault(),a(i)}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===Se.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Pe={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Le extends Ae{constructor(e){const{event:t}=e,n=b(t.target);super(e,Pe,n)}}Le.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 Fe={move:{name:"mousemove"},end:{name:"mouseup"}};var $e,Be;(Be=$e||($e={}))[Be.RightClick=2]="RightClick";(class extends Ae{constructor(e){super(e,Fe,b(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==$e.RightClick&&(null==r||r({event:n}),!0)}}];const Oe={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var Ie,qe,_e,He;function Ue(e){let{acceleration:t,activator:r=Ie.Pointer,canScroll:o,draggingRect:a,enabled:l,interval:i=5,order:s=_e.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,delta:p,threshold:f}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=S(t);return C(e=>{if(n||!r||!e)return We;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[de.Backward]:e.x[de.Backward]||-1===o.x,[de.Forward]:e.x[de.Forward]||1===o.x},y:{[de.Backward]:e.y[de.Backward]||-1===o.y,[de.Forward]:e.y[de.Forward]||1===o.y}}},[n,t,r])}({delta:p,disabled:!l}),[m,g]=function(){const e=n.useRef(null);return[n.useCallback((t,n)=>{e.current=setInterval(t,n)},[]),n.useCallback(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),v=n.useRef({x:0,y:0}),b=n.useRef({x:0,y:0}),y=n.useMemo(()=>{switch(r){case Ie.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Ie.DraggableRect:return a}},[r,a,c]),x=n.useRef(null),w=n.useCallback(()=>{const e=x.current;if(!e)return;const t=v.current.x*b.current.x,n=v.current.y*b.current.y;e.scrollBy(t,n)},[]),R=n.useMemo(()=>s===_e.TreeOrder?[...d].reverse():d,[s,d]);n.useEffect(()=>{if(l&&d.length&&y){for(const e of R){if(!1===(null==o?void 0:o(e)))continue;const n=d.indexOf(e),r=u[n];if(!r)continue;const{direction:a,speed:l}=me(e,r,y,t,f);for(const e of["x","y"])h[e][a[e]]||(l[e]=0,a[e]=0);if(l.x>0||l.y>0)return g(),x.current=e,m(w,i),v.current=l,void(b.current=a)}v.current={x:0,y:0},b.current={x:0,y:0},g()}else g()},[t,w,o,g,l,i,JSON.stringify(y),JSON.stringify(h),m,d,R,u,JSON.stringify(f)])}(class extends Ae{constructor(e){super(e,Oe)}static setup(){return window.addEventListener(Oe.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Oe.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)}}],(qe=Ie||(Ie={}))[qe.Pointer=0]="Pointer",qe[qe.DraggableRect=1]="DraggableRect",(He=_e||(_e={}))[He.TreeOrder=0]="TreeOrder",He[He.ReversedTreeOrder=1]="ReversedTreeOrder";const We={x:{[de.Backward]:!1,[de.Forward]:!1},y:{[de.Backward]:!1,[de.Forward]:!1}};var Ke,Ve,Xe;(Ve=Ke||(Ke={}))[Ve.Always=0]="Always",Ve[Ve.BeforeDragging=1]="BeforeDragging",Ve[Ve.WhileDragging=2]="WhileDragging",(Xe||(Xe={})).Optimized="optimized";const Ye=new Map;function Ge(e,t){return C(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function Je(e){let{callback:t,disabled:r}=e;const o=x(t),a=n.useMemo(()=>{if(r||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)},[r]);return n.useEffect(()=>()=>null==a?void 0:a.disconnect(),[a]),a}function Qe(e){return new ye(ne(e),e)}function Ze(e,t,r){void 0===t&&(t=Qe);const[o,a]=n.useState(null);function l(){a(n=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=n?n:r)?o:null;const a=t(e);return JSON.stringify(n)===JSON.stringify(a)?n:a})}const i=function(e){let{callback:t,disabled:r}=e;const o=x(t),a=n.useMemo(()=>{if(r||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)},[o,r]);return n.useEffect(()=>()=>null==a?void 0:a.disconnect(),[a]),a}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){l();break}}}}),s=Je({callback:l});return y(()=>{l(),e?(null==s||s.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==i||i.disconnect())},[e]),o}const et=[];function tt(e,t){void 0===t&&(t=[]);const r=n.useRef(null);return n.useEffect(()=>{r.current=null},t),n.useEffect(()=>{const t=e!==U;t&&!r.current&&(r.current=e),!t&&r.current&&(r.current=null)},[e]),r.current?z(e,r.current):U}function nt(e){return n.useMemo(()=>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 rt=[];function ot(e){let{measure:t}=e;const[r,o]=n.useState(null),a=Je({callback:n.useCallback(e=>{for(const{target:n}of e)if(g(n)){o(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),l=n.useCallback(e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return g(t)?t:e}(e);null==a||a.disconnect(),n&&(null==a||a.observe(n)),o(n?t(n):null)},[t,a]),[i,s]=R(l);return n.useMemo(()=>({nodeRef:i,rect:r,setRef:s}),[r,i,s])}const at=[{sensor:Le,options:{}},{sensor:Me,options:{}}],lt={current:{}},it={draggable:{measure:re},droppable:{measure:re,strategy:Ke.WhileDragging,frequency:Xe.Optimized},dragOverlay:{measure:ne}};class st 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 ct={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new st,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:H},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:it,measureDroppableContainers:H,windowRect:null,measuringScheduled:!1},dt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:H,draggableNodes:new Map,over:null,measureDroppableContainers:H},ut=n.createContext(dt),pt=n.createContext(ct);function ft(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new st}}}function ht(e,t){switch(t.type){case q.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case q.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 q.DragEnd:case q.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case q.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new st(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case q.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const l=new st(e.droppable.containers);return l.set(n,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:l}}}case q.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new st(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function mt(e){let{disabled:t}=e;const{active:r,activatorEvent:o,draggableNodes:a}=n.useContext(ut),l=S(o),i=S(null==r?void 0:r.id);return n.useEffect(()=>{if(!t&&!o&&l&&null!=i){if(!M(l))return;if(document.activeElement===l.target)return;const e=a.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=A(e);if(t){t.focus();break}}})}},[o,t,a,i,l]),null}const gt=n.createContext({...U,scaleX:1,scaleY:1});var vt,bt;(bt=vt||(vt={}))[bt.Uninitialized=0]="Uninitialized",bt[bt.Initializing=1]="Initializing",bt[bt.Initialized=2]="Initialized";const yt=n.memo(function(e){var t,r,a,l;let{id:i,accessibility:s,autoScroll:c=!0,children:d,sensors:p=at,collisionDetection:f=J,measuring:m,modifiers:g,...v}=e;const b=n.useReducer(ht,void 0,ft),[x,R]=b,[S,E]=function(){const[e]=n.useState(()=>new Set),t=n.useCallback(t=>(e.add(t),()=>e.delete(t)),[e]);return[n.useCallback(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[D,z]=n.useState(vt.Uninitialized),M=D===vt.Initialized,{draggable:{active:T,nodes:A,translate:P},droppable:{containers:L}}=x,F=null!=T?A.get(T):null,B=n.useRef({initial:null,translated:null}),O=n.useMemo(()=>{var e;return null!=T?{id:T,data:null!=(e=null==F?void 0:F.data)?e:lt,rect:B}:null},[T,F]),_=n.useRef(null),[H,W]=n.useState(null),[K,V]=n.useState(null),X=w(v,Object.values(v)),Y=k("DndDescribedBy",i),G=n.useMemo(()=>L.getEnabled(),[L]),Z=(te=m,n.useMemo(()=>({draggable:{...it.draggable,...null==te?void 0:te.draggable},droppable:{...it.droppable,...null==te?void 0:te.droppable},dragOverlay:{...it.dragOverlay,...null==te?void 0:te.dragOverlay}}),[null==te?void 0:te.draggable,null==te?void 0:te.droppable,null==te?void 0:te.dragOverlay]));var te;const{droppableRects:re,measureDroppableContainers:ie,measuringScheduled:se}=function(e,t){let{dragging:r,dependencies:o,config:a}=t;const[l,i]=n.useState(null),{frequency:s,measure:c,strategy:d}=a,u=n.useRef(e),p=function(){switch(d){case Ke.Always:return!1;case Ke.BeforeDragging:return r;default:return!r}}(),f=w(p),h=n.useCallback(function(e){void 0===e&&(e=[]),f.current||i(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=n.useRef(null),g=C(t=>{if(p&&!r)return Ye;if(!t||t===Ye||u.current!==e||null!=l){const t=new Map;for(let n of e){if(!n)continue;if(l&&l.length>0&&!l.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new ye(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,l,r,p,c]);return n.useEffect(()=>{u.current=e},[e]),n.useEffect(()=>{p||h()},[r,p]),n.useEffect(()=>{l&&l.length>0&&i(null)},[JSON.stringify(l)]),n.useEffect(()=>{p||"number"!=typeof s||null!==m.current||(m.current=setTimeout(()=>{h(),m.current=null},s))},[s,p,h,...o]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:null!=l}}(G,{dragging:M,dependencies:[P.x,P.y],config:Z.droppable}),de=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return C(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(A,T),ue=n.useMemo(()=>K?j(K):null,[K]),fe=function(){const e=!1===(null==H?void 0:H.autoScrollEnabled),t="object"==typeof c?!1===c.enabled:!1===c,n=M&&!e&&!t;if("object"==typeof c)return{...c,enabled:n};return{enabled:n}}(),he=function(e,t){return Ge(e,t)}(de,Z.draggable.measure);!function(e){let{activeNode:t,measure:r,initialRect:o,config:a=!0}=e;const l=n.useRef(!1),{x:i,y:s}="boolean"==typeof a?{x:a,y:a}:a;y(()=>{if(!i&&!s||!t)return void(l.current=!1);if(l.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const n=Q(r(e),o);if(i||(n.x=0),s||(n.y=0),l.current=!0,Math.abs(n.x)>0||Math.abs(n.y)>0){const t=ae(e);t&&t.scrollBy({top:n.y,left:n.x})}},[t,i,s,o,r])}({activeNode:null!=T?A.get(T):null,config:fe.layoutShiftCompensation,initialRect:he,measure:Z.draggable.measure});const me=Ze(de,Z.draggable.measure,he),ge=Ze(de?de.parentElement:null),be=n.useRef({activatorEvent:null,active:null,activeNode:de,collisionRect:null,collisions:null,droppableRects:re,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),xe=L.getNodeFor(null==(t=be.current.over)?void 0:t.id),we=ot({measure:Z.dragOverlay.measure}),Ce=null!=(r=we.nodeRef.current)?r:de,Re=M?null!=(a=we.rect)?a:me:null,Se=Boolean(we.nodeRef.current&&we.rect),Ee=Q(ke=Se?null:me,Ge(ke));var ke;const De=nt(Ce?h(Ce):null),Ne=function(e){const t=n.useRef(e),r=C(n=>e?n&&n!==et&&e&&t.current&&e.parentNode===t.current.parentNode?n:oe(e):et,[e]);return n.useEffect(()=>{t.current=e},[e]),r}(M?null!=xe?xe:de:null),ze=function(e,t){void 0===t&&(t=ne);const[r]=e,o=nt(r?h(r):null),[a,l]=n.useState(rt);function i(){l(()=>e.length?e.map(e=>pe(e)?o:new ye(t(e),e)):rt)}const s=Je({callback:i});return y(()=>{null==s||s.disconnect(),i(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),a}(Ne),Me=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}(g,{transform:{x:P.x-Ee.x,y:P.y-Ee.y,scaleX:1,scaleY:1},activatorEvent:K,active:O,activeNodeRect:me,containerNodeRect:ge,draggingNodeRect:Re,over:be.current.over,overlayNodeRect:we.rect,scrollableAncestors:Ne,scrollableAncestorRects:ze,windowRect:De}),je=ue?N(ue,P):null,Te=function(e){const[t,r]=n.useState(null),o=n.useRef(e),a=n.useCallback(e=>{const t=le(e.target);t&&r(e=>e?(e.set(t,ce(t)),new Map(e)):null)},[]);return n.useEffect(()=>{const t=o.current;if(e!==t){n(t);const l=e.map(e=>{const t=le(e);return t?(t.addEventListener("scroll",a,{passive:!0}),[t,ce(t)]):null}).filter(e=>null!=e);r(l.length?new Map(l):null),o.current=e}return()=>{n(e),n(t)};function n(e){e.forEach(e=>{const t=le(e);null==t||t.removeEventListener("scroll",a)})}},[a,e]),n.useMemo(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>N(e,t),U):ve(e):U,[e,t])}(Ne),Ae=tt(Te),Pe=tt(Te,[me]),Le=N(Me,Ae),Fe=Re?ee(Re,Me):null,$e=O&&Fe?f({active:O,collisionRect:Fe,droppableRects:re,droppableContainers:G,pointerCoordinates:je}):null,Be=function(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}($e,"id"),[Oe,Ie]=n.useState(null),qe=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Se?Me:N(Me,Pe),null!=(l=null==Oe?void 0:Oe.rect)?l:null,me),_e=n.useRef(null),He=n.useCallback((e,t)=>{let{sensor:n,options:r}=t;if(null==_.current)return;const a=A.get(_.current);if(!a)return;const l=e.nativeEvent,i=new n({active:_.current,activeNode:a,event:l,options:r,context:be,onAbort(e){if(!A.get(e))return;const{onDragAbort:t}=X.current,n={id:e};null==t||t(n),S({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!A.get(e))return;const{onDragPending:o}=X.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(a),S({type:"onDragPending",event:a})},onStart(e){const t=_.current;if(null==t)return;const n=A.get(t);if(!n)return;const{onDragStart:r}=X.current,a={activatorEvent:l,active:{id:t,data:n.data,rect:B}};o.unstable_batchedUpdates(()=>{null==r||r(a),z(vt.Initializing),R({type:q.DragStart,initialCoordinates:e,active:t}),S({type:"onDragStart",event:a}),W(_e.current),V(l)})},onMove(e){R({type:q.DragMove,coordinates:e})},onEnd:s(q.DragEnd),onCancel:s(q.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:a}=be.current;let i=null;if(t&&a){const{cancelDrop:o}=X.current;if(i={activatorEvent:l,active:t,collisions:n,delta:a,over:r},e===q.DragEnd&&"function"==typeof o){await Promise.resolve(o(i))&&(e=q.DragCancel)}}_.current=null,o.unstable_batchedUpdates(()=>{R({type:e}),z(vt.Uninitialized),Ie(null),W(null),V(null),_e.current=null;const t=e===q.DragEnd?"onDragEnd":"onDragCancel";if(i){const e=X.current[t];null==e||e(i),S({type:t,event:i})}})}}_e.current=i},[A]),We=function(e,t){return n.useMemo(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(p,n.useCallback((e,t)=>(n,r)=>{const o=n.nativeEvent,a=A.get(r);if(null!==_.current||!a||o.dndKit||o.defaultPrevented)return;const l={active:a};!0===e(n,t.options,l)&&(o.dndKit={capturedBy:t.sensor},_.current=r,He(n,t))},[A,He]));!function(e){n.useEffect(()=>{if(!u)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}))}(p),y(()=>{me&&D===vt.Initializing&&z(vt.Initialized)},[me,D]),n.useEffect(()=>{const{onDragMove:e}=X.current,{active:t,activatorEvent:n,collisions:r,over:a}=be.current;if(!t||!n)return;const l={active:t,activatorEvent:n,collisions:r,delta:{x:Le.x,y:Le.y},over:a};o.unstable_batchedUpdates(()=>{null==e||e(l),S({type:"onDragMove",event:l})})},[Le.x,Le.y]),n.useEffect(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:a}=be.current;if(!e||null==_.current||!t||!a)return;const{onDragOver:l}=X.current,i=r.get(Be),s=i&&i.rect.current?{id:i.id,rect:i.rect.current,data:i.data,disabled:i.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:a.x,y:a.y},over:s};o.unstable_batchedUpdates(()=>{Ie(s),null==l||l(c),S({type:"onDragOver",event:c})})},[Be]),y(()=>{be.current={activatorEvent:K,active:O,activeNode:de,collisionRect:Fe,collisions:$e,droppableRects:re,draggableNodes:A,draggingNode:Ce,draggingNodeRect:Re,droppableContainers:L,over:Oe,scrollableAncestors:Ne,scrollAdjustedTranslate:Le},B.current={initial:Re,translated:Fe}},[O,de,$e,Fe,A,Ce,Re,re,L,Oe,Ne,Le]),Ue({...fe,delta:P,draggingRect:Fe,pointerCoordinates:je,scrollableAncestors:Ne,scrollableAncestorRects:ze});const Ve=n.useMemo(()=>({active:O,activeNode:de,activeNodeRect:me,activatorEvent:K,collisions:$e,containerNodeRect:ge,dragOverlay:we,draggableNodes:A,droppableContainers:L,droppableRects:re,over:Oe,measureDroppableContainers:ie,scrollableAncestors:Ne,scrollableAncestorRects:ze,measuringConfiguration:Z,measuringScheduled:se,windowRect:De}),[O,de,me,K,$e,ge,we,A,L,re,Oe,ie,Ne,ze,Z,se,De]),Xe=n.useMemo(()=>({activatorEvent:K,activators:We,active:O,activeNodeRect:me,ariaDescribedById:{draggable:Y},dispatch:R,draggableNodes:A,over:Oe,measureDroppableContainers:ie}),[K,We,O,me,R,Y,A,Oe,ie]);return n.createElement($.Provider,{value:E},n.createElement(ut.Provider,{value:Xe},n.createElement(pt.Provider,{value:Ve},n.createElement(gt.Provider,{value:qe},d)),n.createElement(mt,{disabled:!1===(null==s?void 0:s.restoreFocus)})),n.createElement(I,{...s,hiddenTextDescribedById:Y}))}),xt=n.createContext(null),wt="button";function Ct(e){let{id:t,data:r,disabled:o=!1,attributes:a}=e;const l=k("Draggable"),{activators:i,activatorEvent:s,active:c,activeNodeRect:d,ariaDescribedById:u,draggableNodes:p,over:f}=n.useContext(ut),{role:h=wt,roleDescription:m="draggable",tabIndex:g=0}=null!=a?a:{},v=(null==c?void 0:c.id)===t,b=n.useContext(v?gt:xt),[x,C]=R(),[S,E]=R(),D=function(e,t){return n.useMemo(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(i,t),N=w(r);y(()=>(p.set(t,{id:t,key:l,node:x,activatorNode:S,data:N}),()=>{const e=p.get(t);e&&e.key===l&&p.delete(t)}),[p,t]);return{active:c,activatorEvent:s,activeNodeRect:d,attributes:n.useMemo(()=>({role:h,tabIndex:g,"aria-disabled":o,"aria-pressed":!(!v||h!==wt)||void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[o,h,g,v,m,u.draggable]),isDragging:v,listeners:o?void 0:D,node:x,over:f,setNodeRef:C,setActivatorNodeRef:E,transform:b}}const Rt={timeout:25};const St=({slotPosition:e,isEditing:r,isDragging:o,children:a})=>{const{attributes:l,listeners:i,setNodeRef:s,transform:c}=Ct({id:`slot-${e}`,data:{slotPosition:e},disabled:!r}),{setNodeRef:d,isOver:u}=function(e){let{data:t,disabled:r=!1,id:o,resizeObserverConfig:a}=e;const l=k("Droppable"),{active:i,dispatch:s,over:c,measureDroppableContainers:d}=n.useContext(ut),u=n.useRef({disabled:r}),p=n.useRef(!1),f=n.useRef(null),h=n.useRef(null),{disabled:m,updateMeasurementsFor:g,timeout:v}={...Rt,...a},b=w(null!=g?g:o),y=Je({callback:n.useCallback(()=>{p.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{d(Array.isArray(b.current)?b.current:[b.current]),h.current=null},v)):p.current=!0},[v]),disabled:m||!i}),x=n.useCallback((e,t)=>{y&&(t&&(y.unobserve(t),p.current=!1),e&&y.observe(e))},[y]),[C,S]=R(x),E=w(t);return n.useEffect(()=>{y&&C.current&&(y.disconnect(),p.current=!1,y.observe(C.current))},[C,y]),n.useEffect(()=>(s({type:q.RegisterDroppable,element:{id:o,key:l,disabled:r,node:C,rect:f,data:E}}),()=>s({type:q.UnregisterDroppable,key:l,id:o})),[o]),n.useEffect(()=>{r!==u.current.disabled&&(s({type:q.SetDroppableDisabled,id:o,key:l,disabled:r}),u.current.disabled=r)},[o,l,r,s]),{active:i,rect:f,isOver:(null==c?void 0:c.id)===o,node:C,over:c,setNodeRef:S}}({id:`drop-${e}`,data:{slotPosition:e}}),p={position:"relative",height:"100%",width:"100%",transform:c?`translate3d(${c.x}px, ${c.y}px, 0)`:void 0},f=n.useCallback(e=>{s(e),d(e)},[s,d]);return t.jsxs("div",{ref:f,style:p,className:`slot-with-overlay ${r?"edit-mode":""} ${o?"dragging":""} ${u?"drag-over":""}`,children:[a,r&&t.jsxs("div",{className:"slot-edit-overlay",...l,...i,children:[t.jsx("div",{className:"drag-indicator",children:"⋮⋮"}),t.jsx("div",{className:"slot-position-label",children:e.toUpperCase()})]})]})},Et=({layout:e,activeSlot:r})=>{const[o,a]=n.useState(new Map);return n.useEffect(()=>{const e=()=>{const e=new Map;["left","middle","right"].forEach(t=>{const n=document.querySelector(`[data-slot="${t}"]`);if(n){const r=n.getBoundingClientRect();e.set(t,r)}}),a(e)};e(),window.addEventListener("resize",e);const t=setInterval(e,100);return()=>{window.removeEventListener("resize",e),clearInterval(t)}},[e]),t.jsx("div",{style:{pointerEvents:"none",position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:999},children:["left","middle","right"].map(n=>{if(!e[n])return null;const a=o.get(n);if(!a)return null;const l=r===n;return t.jsx("div",{style:{position:"fixed",top:a.top,left:a.left,width:a.width,height:a.height,pointerEvents:"auto"},children:t.jsx(St,{slotPosition:n,isEditing:!0,isDragging:l,children:t.jsx("div",{style:{height:"100%"}})})},n)})})};var kt,Dt=(()=>{if("undefined"!=typeof window){const e=window;return e.__principlemd_theme_context__||(e.__principlemd_theme_context__=n.createContext(void 0)),e.__principlemd_theme_context__}return kt||(kt=n.createContext(void 0)),kt})();const Nt=e=>null!=e&&"object"==typeof e&&"type"in e,zt=e=>null==e?[]:"string"==typeof e?[e]:Nt(e)?e.panels:[];e.AnimatedResizableLayout=({leftPanel:e,rightPanel:o,collapsibleSide:l="left",defaultSize:i=25,minSize:s=5,className:c="",collapsed:d=!1,style:u,showCollapseButton:p=!1,animationDuration:f=300,animationEasing:h="cubic-bezier(0.4, 0, 0.2, 1)",onCollapseStart:m,onCollapseComplete:g,onExpandStart:v,onExpandComplete:b,theme:y})=>{const[x,w]=n.useState(d),[C,R]=n.useState(!1),[S,E]=n.useState(!1),[k,D]=n.useState(d),[N,z]=n.useState(d?0:i),M=n.useRef(null),j=n.useRef(void 0),T=n.useRef(void 0),A=n.useRef(void 0),P=n.useCallback((e,t,n)=>{if(!M.current)return;j.current&&cancelAnimationFrame(j.current),T.current=performance.now();const r=o=>{if(!T.current||!M.current)return;const a=o-T.current,l=Math.min(a/f,1),i=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2,s=e+(t-e)*i;M.current.resize(s),l<1?j.current=requestAnimationFrame(r):(0===t?M.current.collapse():M.current.resize(t),R(!1),n&&n())};j.current=requestAnimationFrame(r)},[f]),L=n.useCallback(()=>{C||S||(R(!0),w(!0),m&&m(),P(N,0,()=>{z(0),D(!0),g&&g()}))},[C,S,N,P,m,g]),F=n.useCallback(()=>{C||S||(R(!0),w(!1),D(!1),v&&v(),P(0,i,()=>{z(i),b&&b()}))},[C,S,i,P,v,b]),$=n.useCallback(()=>{x?F():L()},[x,L,F]),B=n.useCallback(e=>{C||(z(e),e>0&&w(!1))},[C]),O=n.useCallback(()=>{E(!0)},[]),I=n.useCallback(()=>{E(!1)},[]);n.useEffect(()=>{d!==x&&(d?L():F())},[d]),n.useEffect(()=>{d&&!C?D(!0):d||C||D(!1)},[d,C]),n.useEffect(()=>{const e=j.current,t=A.current;return()=>{e&&cancelAnimationFrame(e),t&&clearTimeout(t)}},[]);const q="left"===l,_=x?q?"▸":"◂":q?"◂":"▸",H=a(y),U=C&&!S?{transition:`flex ${f}ms ${h}`}:void 0,W=e=>{let t="hybrid-panel";return e&&(t+=" collapsible-panel",C&&!S&&(t+=" animating"),x&&(t+=" collapsed")),t};return t.jsx("div",{className:`animated-resizable-layout ${c}`,style:{...H,...u},children:t.jsxs(r.PanelGroup,{direction:"horizontal",onLayout:I,children:[t.jsx(r.Panel,{ref:q?M:void 0,collapsible:q,defaultSize:q?d?0:i:void 0,minSize:q?s:30,collapsedSize:0,onResize:q?B:void 0,onCollapse:q?()=>w(!0):void 0,onExpand:q?()=>w(!1):void 0,className:W(q),style:q?U:void 0,children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:q&&x?0:1,transition:C?`opacity ${.5*f}ms ${h}`:"none"},children:e})}),t.jsx(r.PanelResizeHandle,{className:"resize-handle "+(k?"collapsed":""),onDragging:O,style:k?{visibility:"hidden",width:0}:void 0,children:p&&t.jsx("div",{className:"handle-bar",children:t.jsx("button",{onClick:$,className:"collapse-toggle",disabled:C,"aria-label":x?"Expand panel":"Collapse panel",children:_})})}),t.jsx(r.Panel,{ref:q?void 0:M,collapsible:!q,defaultSize:q?void 0:d?0:i,minSize:q?30:s,collapsedSize:0,onResize:q?void 0:B,onCollapse:q?void 0:()=>w(!0),onExpand:q?void 0:()=>w(!1),className:W(!q),style:q?void 0:U,children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:!q&&x?0:1,transition:C?`opacity ${.5*f}ms ${h}`:"none"},children:o})})]})})},e.AnimatedVerticalLayout=({topPanel:e,bottomPanel:o,collapsiblePanels:l={top:!0,bottom:!0},defaultSizes:i={top:30,bottom:30},minSizes:s={top:5,bottom:5},className:c="",collapsed:d={top:!1,bottom:!1},style:u,showCollapseButtons:p=!1,animationDuration:f=300,animationEasing:h="cubic-bezier(0.4, 0, 0.2, 1)",theme:m,onTopCollapseStart:g,onTopCollapseComplete:v,onTopExpandStart:b,onTopExpandComplete:y,onBottomCollapseStart:x,onBottomCollapseComplete:w,onBottomExpandStart:C,onBottomExpandComplete:R,onPanelResize:S})=>{const[E,k]=n.useState(d.top||!1),[D,N]=n.useState(!1),[z,M]=n.useState(d.top?0:i.top),j=n.useRef(null),T=n.useRef(void 0),A=n.useRef(void 0),[P,L]=n.useState(d.bottom||!1),[F,$]=n.useState(!1),[B,O]=n.useState(d.bottom?0:i.bottom),I=n.useRef(null),q=n.useRef(void 0),_=n.useRef(void 0),[H,U]=n.useState(!1),W=n.useCallback((e,t,n)=>{if(!j.current)return;T.current&&cancelAnimationFrame(T.current),A.current=performance.now();const r=o=>{if(!A.current||!j.current)return;const a=o-A.current,l=Math.min(a/f,1),i=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2,s=e+(t-e)*i;j.current.resize(s),l<1?T.current=requestAnimationFrame(r):(0===t?j.current.collapse():j.current.resize(t),N(!1),n&&n())};T.current=requestAnimationFrame(r)},[f]),K=n.useCallback((e,t,n)=>{if(!I.current)return;q.current&&cancelAnimationFrame(q.current),_.current=performance.now();const r=o=>{if(!_.current||!I.current)return;const a=o-_.current,l=Math.min(a/f,1),i=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2,s=e+(t-e)*i;I.current.resize(s),l<1?q.current=requestAnimationFrame(r):(0===t?I.current.collapse():I.current.resize(t),$(!1),n&&n())};q.current=requestAnimationFrame(r)},[f]),V=n.useCallback(()=>{D||H||!l.top||(N(!0),k(!0),g&&g(),W(z,0,()=>{M(0),v&&v()}))},[D,H,z,l.top,W,g,v]),X=n.useCallback(()=>{D||H||!l.top||(N(!0),k(!1),b&&b(),W(0,i.top,()=>{M(i.top),y&&y()}))},[D,H,i.top,l.top,W,b,y]),Y=n.useCallback(()=>{E?X():V()},[E,V,X]),G=n.useCallback(()=>{F||H||!l.bottom||($(!0),L(!0),x&&x(),K(B,0,()=>{O(0),w&&w()}))},[F,H,B,l.bottom,K,x,w]),J=n.useCallback(()=>{F||H||!l.bottom||($(!0),L(!1),C&&C(),K(0,i.bottom,()=>{O(i.bottom),R&&R()}))},[F,H,i.bottom,l.bottom,K,C,R]),Q=n.useCallback(()=>{P?J():G()},[P,G,J]),Z=n.useCallback(e=>{D||(M(e),e>0&&k(!1))},[D]),ee=n.useCallback(e=>{F||(O(e),e>0&&L(!1))},[F]),te=n.useCallback(()=>{U(!0)},[]),ne=n.useCallback(()=>{U(!1),S&&S({top:z,bottom:B})},[z,B,S]);n.useEffect(()=>{void 0!==d.top&&d.top!==E&&(d.top?V():X())},[d.top]),n.useEffect(()=>{void 0!==d.bottom&&d.bottom!==P&&(d.bottom?G():J())},[d.bottom]),n.useEffect(()=>()=>{T.current&&cancelAnimationFrame(T.current),q.current&&cancelAnimationFrame(q.current)},[]);const re=a(m),oe=D&&!H?{transition:`flex ${f}ms ${h}`}:void 0,ae=F&&!H?{transition:`flex ${f}ms ${h}`}:void 0;return t.jsx("div",{className:`animated-vertical-layout ${c}`,style:{...re,...u},children:t.jsxs(r.PanelGroup,{direction:"vertical",onLayout:ne,children:[t.jsx(r.Panel,{ref:j,collapsible:l.top,defaultSize:d.top?0:i.top,minSize:s.top,collapsedSize:0,onResize:Z,onCollapse:()=>k(!0),onExpand:()=>k(!1),className:(()=>{let e="vertical-panel collapsible-panel";return D&&!H&&(e+=" animating"),E&&(e+=" collapsed"),e})(),style:oe,children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:E?0:1,transition:D?`opacity ${.5*f}ms ${h}`:"none"},children:e})}),t.jsx(r.PanelResizeHandle,{className:"vertical-resize-handle",onDragging:te,children:p&&t.jsxs("div",{className:"handle-bar",children:[l.top&&t.jsx("button",{onClick:Y,className:"collapse-toggle collapse-toggle-top",disabled:D,"aria-label":E?"Expand top panel":"Collapse top panel",children:E?"▾":"▴"}),l.bottom&&t.jsx("button",{onClick:Q,className:"collapse-toggle collapse-toggle-bottom",disabled:F,"aria-label":P?"Expand bottom panel":"Collapse bottom panel",children:P?"▴":"▾"})]})}),t.jsx(r.Panel,{ref:I,collapsible:l.bottom,defaultSize:d.bottom?0:i.bottom,minSize:s.bottom,collapsedSize:0,onResize:ee,onCollapse:()=>L(!0),onExpand:()=>L(!1),className:(()=>{let e="vertical-panel collapsible-panel";return F&&!H&&(e+=" animating"),P&&(e+=" collapsed"),e})(),style:ae,children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:P?0:1,transition:F?`opacity ${.5*f}ms ${h}`:"none"},children:o})})]})})},e.ConfigurablePanelLayout=s,e.EditableConfigurablePanelLayout=({isEditMode:e,onLayoutChange:r,panels:o,layout:a,...l})=>{const[i,c]=n.useState(null),[d,u]=n.useState({x:0,y:0}),p=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.useMemo(()=>[...t].filter(e=>null!=e),[...t])}((f=Le,h={activationConstraint:{distance:8}},n.useMemo(()=>({sensor:f,options:null!=h?h:{}}),[f,h])));var f,h;const m=n.useCallback(e=>{const t=e.active.id;if(t.startsWith("slot-")){const e=t.replace("slot-","");c(e),u({x:0,y:0})}},[]),g=n.useCallback(e=>{const{delta:t}=e;u({x:t.x,y:t.y})},[]),v=n.useCallback(e=>{const{active:t,over:n}=e;if(c(null),u({x:0,y:0}),!n)return;const o=t.id,l=n.id,i=o.replace("slot-",""),s=l.replace("drop-","");if(i===s)return;const d={...a},p=d[i];d[i]=d[s],d[s]=p,r&&r(d)},[a,r]);n.useEffect(()=>{if(!i||!e)return;const t=document.querySelector(`[data-slot="${i}"]`);return t&&(t.setAttribute("data-dragging","true"),t.style.setProperty("transform",`scale(0.95) translate(${d.x}px, ${d.y}px)`,"important"),t.style.setProperty("z-index","1000","important"),t.style.setProperty("transition","none","important"),t.style.setProperty("opacity","0.95","important"),t.style.setProperty("box-shadow","0 12px 24px rgba(0, 0, 0, 0.25)","important")),()=>{t&&(t.removeAttribute("data-dragging"),t.style.removeProperty("transform"),t.style.removeProperty("z-index"),t.style.removeProperty("transition"),t.style.removeProperty("opacity"),t.style.removeProperty("box-shadow"))}},[i,d,e]);const b={left:{"data-slot":"left","data-edit-mode":e?"true":"false"},middle:{"data-slot":"middle","data-edit-mode":e?"true":"false"},right:{"data-slot":"right","data-edit-mode":e?"true":"false"}};return t.jsx(yt,{sensors:p,collisionDetection:Y,onDragStart:m,onDragMove:g,onDragEnd:v,children:t.jsxs("div",{className:"editable-panel-layout "+(e?"edit-mode-active":""),children:[t.jsx(s,{...l,panels:o,layout:a,slotDataAttributes:b}),e&&t.jsx(Et,{layout:a,activeSlot:i,onDragStart:()=>{},onDragEnd:()=>{}})]})})},e.PanelConfigurator=({availablePanels:e,currentLayout:r,onChange:o,className:a="",theme:l})=>{const i=(()=>{const e=n.useContext(Dt);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e})(),s=l||i.theme,[c,d]=n.useState(null),u=n.useCallback(t=>t&&e.find(e=>e.id===t)||null,[e]),p=n.useCallback(()=>[...e].sort((e,t)=>e.label.localeCompare(t.label)),[e]),f=n.useCallback(e=>{const t=zt(r.left),n=zt(r.middle),o=zt(r.right);return t.includes(e)||n.includes(e)||o.includes(e)},[r]),h=n.useCallback((e,t)=>{const n={...e};return["left","middle","right"].forEach(e=>{const r=n[e];if(r===t)n[e]=null;else if(null!=r&&Nt(r)){const o=r.panels.filter(e=>e!==t);0===o.length?n[e]=null:1===o.length?n[e]=o[0]:n[e]={...r,panels:o}}}),n},[]),m=n.useCallback((e,t)=>{const n=r[e];if(!Nt(n)||"tabs"!==n.type)return;const a=n.panels.filter(e=>e!==t),l={...r};l[e]={...n,panels:a},o(l)},[r,o]),g=n.useCallback((e,t)=>{t.stopPropagation();const n=r[e];if(Nt(n)&&"tabs"===n.type){const t={...r};t[e]=n.panels.length>0?n.panels[0]:null,o(t),d(null)}else{const t=n&&"string"==typeof n?[n]:[],a={...r};a[e]={type:"tabs",panels:t,config:{defaultActiveTab:0,tabPosition:"top"}},o(a),d({type:"slot",position:e})}},[r,o]),v=n.useCallback(e=>{if(c)if("slot"===c.type){if(c.position===e)return;const t={...r},n=t[c.position];t[c.position]=t[e],t[e]=n,o(t),d(null)}else{const t=r[e];if(Nt(t)&&"tabs"===t.type){if(t.panels.includes(c.id))return void m(e,c.id);const n=t,a=h(r,c.id);return a[e]={...n,panels:[...n.panels,c.id]},void o(a)}{const t=h(r,c.id);t[e]=c.id,o(t),d(null)}}else d({type:"slot",position:e})},[c,r,o,h,m]),b=n.useCallback(e=>{if(c)if("slot"===c.type){const t=r[c.position];if(Nt(t)&&"tabs"===t.type){if(t.panels.includes(e))return void m(c.position,e);const n=t,a=h(r,e);return a[c.position]={...n,panels:[...n.panels,e]},void o(a)}{const t=h(r,e);t[c.position]=e,o(t),d(null)}}else d({type:"panel",id:e});else d({type:"panel",id:e})},[c,r,o,h,m]),y=n.useCallback((e,t)=>{t.stopPropagation();const n={...r};n[e]=null,o(n),d(null)},[r,o]),x=n.useCallback((e,t,n)=>{n.stopPropagation();const a=r[e];if(!Nt(a)||"tabs"!==a.type)return;const l=a.panels.filter(e=>e!==t),i={...r};i[e]={...a,panels:l},o(i)},[r,o]),w=n.useCallback((e,t)=>{const n=r[e];if(!Nt(n)||"tabs"!==n.type)return;const a={...r};a[e]={...n,config:{...n.config,...t}},o(a)},[r,o]),C=p(),R=e=>{const t=r[e];return Nt(t)&&"tabs"===t.type},S={"--configurator-bg":s.colors.background,"--configurator-title":s.colors.textSecondary,"--slot-bg":s.colors.backgroundSecondary,"--slot-border":s.colors.border,"--slot-border-hover":s.colors.textTertiary,"--slot-border-selected":s.colors.primary,"--slot-bg-selected":s.colors.backgroundLight,"--slot-label":s.colors.textTertiary,"--slot-content-text":s.colors.text,"--slot-preview-bg":s.colors.backgroundTertiary,"--slot-preview-border":s.colors.border,"--slot-preview-text":s.colors.textMuted,"--slot-empty-text":s.colors.textMuted,"--panel-bg":s.colors.backgroundSecondary,"--panel-border":s.colors.border,"--panel-border-hover":s.colors.textSecondary,"--panel-border-selected":s.colors.primary,"--panel-bg-selected":s.colors.backgroundLight,"--panel-label-text":s.colors.text,"--panel-preview-bg":s.colors.backgroundTertiary,"--panel-preview-text":s.colors.textMuted,"--clear-btn-bg":s.colors.error,"--clear-btn-text":s.colors.background,"--clear-btn-hover":s.colors.error,"--hint-bg":s.colors.backgroundLight,"--hint-border":s.colors.primary,"--hint-text":s.colors.text};return t.jsxs("div",{className:`panel-configurator ${a}`,style:S,children:[t.jsxs("div",{className:"configurator-section",children:[t.jsx("h3",{className:"section-title",children:"Panel Layout (3 Slots)"}),t.jsx("div",{className:"slots-container",children:["left","middle","right"].map(e=>{const n=r[e],o=(e=>"slot"===c?.type&&c.position===e)(e),a=Nt(n)&&"tabs"===n.type,l=null!==n;return t.jsxs("div",{"data-position":e,className:`slot ${o?"selected":""} ${l?"filled":"empty"} ${a?"tab-group":""}`,onClick:()=>v(e),children:[t.jsx("button",{className:"tab-mode-toggle "+(a?"active":""),onClick:t=>g(e,t),title:a?"Disable tab mode":"Enable tab mode",children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:t.jsx("path",{d:"M2 2h4v2H2V2zm5 0h4v2H7V2zm5 0h2v2h-2V2zM2 5h12v9H2V5zm1 1v7h10V6H3z"})})}),null===n?t.jsx("div",{className:"slot-empty-state",children:a?"Click panels to add tabs":"Empty"}):Nt(n)?t.jsxs("div",{className:"slot-content group-content",children:["tabs"===n.type&&n.panels.length>0&&t.jsx("div",{className:"tab-config-controls",children:t.jsxs("label",{className:"tab-config-label",children:["Tabs:",t.jsxs("select",{value:n.config?.tabPosition||"top",onChange:t=>w(e,{tabPosition:t.target.value}),onClick:e=>e.stopPropagation(),children:[t.jsx("option",{value:"top",children:"Top (centered)"}),t.jsx("option",{value:"bottom",children:"Bottom (centered)"}),t.jsx("option",{value:"left",children:"Left"}),t.jsx("option",{value:"right",children:"Right"})]})]})}),t.jsx("div",{className:"group-panels",children:0===n.panels.length?t.jsx("div",{className:"slot-empty-state",children:"Click panels to add tabs"}):n.panels.map((r,o)=>{const a=u(r),l="tabs"===n.type&&(n.config?.defaultActiveTab??0)===o;return a?t.jsxs("div",{className:"group-panel-item",children:[t.jsxs("span",{className:"group-panel-label",children:[a.label,l&&t.jsx("span",{className:"default-badge",children:"★"})]}),t.jsx("button",{className:"remove-from-group-btn",onClick:t=>x(e,r,t),title:`Remove ${a.label}`,children:"×"})]},r):null})})]}):t.jsxs("div",{className:"slot-content",children:["string"==typeof n&&u(n)?.preview&&t.jsx("div",{className:"slot-preview",children:u(n)?.preview}),t.jsx("div",{className:"slot-panel-label",children:"string"==typeof n?u(n)?.label:""}),t.jsx("button",{className:"slot-clear-btn",onClick:t=>y(e,t),"aria-label":`Remove ${"string"==typeof n?u(n)?.label:"panel"} from ${e} slot`,children:"×"})]})]},e)})})]}),t.jsxs("div",{className:"configurator-section",children:[t.jsx("h3",{className:"section-title",children:"Available Panels"}),t.jsx("div",{className:"available-panels",children:C.map(e=>{const n=(r=e.id,"panel"===c?.type&&c.id===r);var r;const o=f(e.id);return t.jsxs("div",{className:`available-panel ${n?"selected":""} ${o?"in-use":""}`,onClick:()=>b(e.id),children:[t.jsx("div",{className:"panel-label",children:e.label}),e.preview&&t.jsx("div",{className:"panel-preview",children:e.preview})]},e.id)})})]}),c&&t.jsx("div",{className:"selection-hint",children:"slot"===c.type?R(c.position)?t.jsxs(t.Fragment,{children:["Selected: ",c.position," slot (Tab Mode). Click panels to add them to the tab group."]}):t.jsxs(t.Fragment,{children:["Selected: ",c.position," slot. Click another slot to swap, or click a panel to assign."]}):t.jsxs(t.Fragment,{children:["Selected: ",u(c.id)?.label,". Click a slot to assign",R("left")||R("middle")||R("right")?" (or add to tab group)":"","."]})}),t.jsxs("div",{className:"usage-hint",children:[t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",style:{verticalAlign:"text-bottom",marginRight:"4px"},children:t.jsx("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"})}),t.jsx("strong",{children:"Tip:"})," Toggle the tab icon on a slot to enable tab mode, then click panels to add multiple tabs."]})]})},e.ResponsiveConfigurablePanelLayout=({mobileBreakpoint:e="(max-width: 768px)",mobileCarouselProps:r,theme:o,layout:a,panels:l,...u})=>{const p=d(e),f=n.useMemo(()=>[a?.left,a?.middle,a?.right],[a]),h=n.useMemo(()=>f.map(e=>{if(null==e)return null;if("object"==typeof e&&"type"in e){const n=e;return"tabs"===n.type?t.jsx(i,{panelIds:n.panels,panels:l,config:n.config,theme:o}):null}return(e=>{if(!e)return null;const t=l.find(t=>t.id===e);return t?.content??null})(e)}).filter(e=>null!==e),[f,l,o]);return p?0===h.length?null:t.jsx(c,{theme:o,panels:h,minPanelWidth:0,idealPanelWidth:1,...r}):t.jsx(s,{theme:o,layout:a,panels:l,...u})},e.SnapCarousel=c,e.TabGroup=i,e.mapThemeToPanelVars=a,e.mapThemeToTabVars=l,e.useMediaQuery=d,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react/jsx-runtime"),require("react"),require("react-resizable-panels"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","react","react-resizable-panels","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).A24ZPanels={},e["react/jsx-runtime"],e.React,e.ReactResizablePanels,e.ReactDOM)}(this,function(e,t,n,r,o){"use strict";function a(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 l(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.text,"--tab-text-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":`${e.fontSizes[1]}px`,"--tab-font-weight":String(e.fontWeights.medium)}}const i=({panelIds:e,panels:r,config:o={},className:a="",theme:i})=>{const{defaultActiveTab:s=0,tabPosition:c="top",centered:d=!0,hideTabList:u=!1,activeTabIndex:p,onTabChange:f}=o,[h,m]=n.useState(s),g=void 0!==p,b=g?p:h;n.useEffect(()=>{g||m(s)},[s,g]);const v=l(i),y=e.map(e=>r.find(t=>t.id===e)).filter(e=>void 0!==e),x=Math.min(b,y.length-1),w=y[x];if(0===y.length)return t.jsx("div",{className:"tab-group-empty",children:"No panels available"});const C="top"===c||"bottom"===c||d,S=t.jsx("div",{className:"tab-list "+(C?"centered":""),role:"tablist",children:y.map((e,n)=>t.jsx("button",{role:"tab","aria-selected":n===x,"aria-controls":`tabpanel-${e.id}`,id:`tab-${e.id}`,className:"tab-button "+(n===x?"active":""),onClick:()=>(e=>{g||m(e),f?.(e)})(n),title:e.icon?e.label:void 0,children:e.icon?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"tab-icon",children:e.icon}),t.jsx("span",{className:"tab-label",children:e.label})]}):e.label},e.id))}),R=w?t.jsx("div",{className:"tab-content",role:"tabpanel",id:`tabpanel-${w.id}`,"aria-labelledby":`tab-${w.id}`,children:w.content}):null;return t.jsxs("div",{className:`tab-group tab-position-${c} ${a}`,style:v,children:[!u&&("top"===c||"left"===c)&&S,R,!u&&("bottom"===c||"right"===c)&&S]})},s=({panels:e,layout:l,slotDataAttributes:s={},collapsiblePanels:c={left:!0,middle:!1,right:!0},defaultSizes:d={left:20,middle:60,right:20},minSizes:u={left:5,middle:10,right:5},className:p="",collapsed:f={left:!1,middle:!1,right:!1},style:h,showCollapseButtons:m=!1,animationDuration:g=300,animationEasing:b="cubic-bezier(0.4, 0, 0.2, 1)",theme:v,onLeftCollapseStart:y,onLeftCollapseComplete:x,onLeftExpandStart:w,onLeftExpandComplete:C,onMiddleCollapseStart:S,onMiddleCollapseComplete:R,onMiddleExpandStart:E,onMiddleExpandComplete:k,onRightCollapseStart:N,onRightCollapseComplete:D,onRightExpandStart:z,onRightExpandComplete:M,onPanelResize:j})=>{const T=null!==l.left&&void 0!==l.left,A=null!==l.middle&&void 0!==l.middle,P=null!==l.right&&void 0!==l.right,L=[T,A,P].filter(Boolean).length,F={left:T?d?.left??(2===L?50:3===L?20:100):0,middle:A?d?.middle??(2===L?50:3===L?60:100):0,right:P?d?.right??(2===L?50:3===L?20:100):0},$={left:u?.left??5,middle:u?.middle??10,right:u?.right??5},[B,O]=n.useState(f.left||!T),[I,q]=n.useState(f.middle||!A),[_,H]=n.useState(f.right||!P),[U,W]=n.useState(!1),[K,V]=n.useState(!1),[X,Y]=n.useState(!1),[G,J]=n.useState(!1),Q=B&&!U,Z=I&&!K,ee=_&&!X,te=n.useCallback(t=>{if(!t)return null;const n=e.find(e=>e.id===t);return n?.content||null},[e]),ne=n.useCallback(n=>{if(null===n)return null;if("object"==typeof n&&"type"in n){const r=n;return"tabs"===r.type?t.jsx(i,{panelIds:r.panels,panels:e,config:r.config,theme:v}):null}return te(n)},[e,te,v]),re=ne(l.left??null),oe=ne(l.middle??null),ae=ne(l.right??null),[le,ie]=n.useState(f.left||!T?0:F.left),[se,ce]=n.useState(f.middle||!A?0:F.middle),[de,ue]=n.useState(f.right||!P?0:F.right),[pe,fe]=n.useState(F.left),[he,me]=n.useState(F.middle),[ge,be]=n.useState(F.right),ve=n.useRef(null),ye=n.useRef(null),xe=n.useRef(null),we=n.useRef(null),Ce=n.useRef(void 0),Se=n.useRef(void 0),Re=n.useRef(void 0),Ee=n.useRef(void 0),ke=n.useRef(void 0),Ne=n.useRef(void 0),De=n.useCallback((e,t)=>{const n=e.filter(e=>e.panelRef.current);if(0===n.length)return;n.forEach(e=>{e.animationFrameRef.current&&cancelAnimationFrame(e.animationFrameRef.current)});let r=0;const o=()=>{r++;const e=r/10;if(e>=1)return n.forEach(e=>{e.panelRef.current&&(0===e.toSize?e.panelRef.current.collapse():e.panelRef.current.resize(e.toSize))}),void(t&&t());const a=e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2;n.forEach(e=>{if(e.panelRef.current){const t=e.fromSize+(e.toSize-e.fromSize)*a;e.panelRef.current.resize(t)}}),n[0].animationFrameRef.current=requestAnimationFrame(()=>{setTimeout(o,g/10)})};o()},[g]),ze=n.useCallback(()=>{U||G||!c.left||(o.flushSync(()=>{W(!0),V(!0),Y(!0),O(!0)}),y&&y(),Ce.current&&cancelAnimationFrame(Ce.current),Ce.current=requestAnimationFrame(()=>{const e=ve.current?.getLayout(),t=Math.round(1e3*(e?.[0]??le))/1e3,n=Math.round(1e3*(e?.[1]??se))/1e3,r=Math.round(1e3*(e?.[2]??de))/1e3,o=n+r,a=o>0?n/o*100:A?50:0,l=o>0?r/o*100:P?50:0;a>0&&me(a),l>0&&be(l),De([{panelRef:ye,fromSize:t,toSize:0,animationFrameRef:Ce,startTimeRef:Ee},{panelRef:xe,fromSize:n,toSize:a,animationFrameRef:Se,startTimeRef:ke},{panelRef:we,fromSize:r,toSize:l,animationFrameRef:Re,startTimeRef:Ne}],()=>{ie(0),ce(a),ue(l),W(!1),V(!1),Y(!1),x&&x()})}))},[U,G,le,se,de,A,P,c.left,De,y,x]),Me=n.useCallback(()=>{U||G||!c.left||(o.flushSync(()=>{W(!0),V(!0),Y(!0),O(!1)}),w&&w(),Ce.current&&cancelAnimationFrame(Ce.current),Ce.current=requestAnimationFrame(()=>{const e=ve.current?.getLayout(),t=Math.round(1e3*(e?.[0]??0))/1e3,n=Math.round(1e3*(e?.[1]??se))/1e3,r=Math.round(1e3*(e?.[2]??de))/1e3,o=pe||F.left,a=100-o,l=n+r,i=l>0?n/l*a:A?a/2:0,s=l>0?r/l*a:P?a/2:0;i>0&&me(i),s>0&&be(s),De([{panelRef:ye,fromSize:t,toSize:o,animationFrameRef:Ce,startTimeRef:Ee},{panelRef:xe,fromSize:n,toSize:i,animationFrameRef:Se,startTimeRef:ke},{panelRef:we,fromSize:r,toSize:s,animationFrameRef:Re,startTimeRef:Ne}],()=>{ie(o),ce(i),ue(s),W(!1),V(!1),Y(!1),C&&C()})}))},[U,G,se,de,F.left,pe,A,P,c.left,De,w,C]),je=n.useCallback(()=>{X||G||!c.right||(o.flushSync(()=>{W(!0),V(!0),Y(!0),H(!0)}),N&&N(),Re.current&&cancelAnimationFrame(Re.current),Re.current=requestAnimationFrame(()=>{const e=ve.current?.getLayout(),t=Math.round(1e3*(e?.[0]??le))/1e3,n=Math.round(1e3*(e?.[1]??se))/1e3,r=Math.round(1e3*(e?.[2]??de))/1e3,o=t+n,a=o>0?t/o*100:T?50:0,l=o>0?n/o*100:A?50:0;a>0&&fe(a),l>0&&me(l),De([{panelRef:ye,fromSize:t,toSize:a,animationFrameRef:Ce,startTimeRef:Ee},{panelRef:xe,fromSize:n,toSize:l,animationFrameRef:Se,startTimeRef:ke},{panelRef:we,fromSize:r,toSize:0,animationFrameRef:Re,startTimeRef:Ne}],()=>{ie(a),ce(l),ue(0),W(!1),V(!1),Y(!1),D&&D()})}))},[X,G,le,se,de,T,A,c.right,De,N,D]),Te=n.useCallback(()=>{X||G||!c.right||(o.flushSync(()=>{W(!0),V(!0),Y(!0),H(!1)}),z&&z(),Re.current&&cancelAnimationFrame(Re.current),Re.current=requestAnimationFrame(()=>{const e=ve.current?.getLayout(),t=Math.round(1e3*(e?.[0]??le))/1e3,n=Math.round(1e3*(e?.[1]??se))/1e3,r=Math.round(1e3*(e?.[2]??0))/1e3,o=ge||F.right,a=100-o,l=t+n,i=l>0?t/l*a:T?a/2:0,s=l>0?n/l*a:A?a/2:0;i>0&&fe(i),s>0&&me(s),De([{panelRef:ye,fromSize:t,toSize:i,animationFrameRef:Ce,startTimeRef:Ee},{panelRef:xe,fromSize:n,toSize:s,animationFrameRef:Se,startTimeRef:ke},{panelRef:we,fromSize:r,toSize:o,animationFrameRef:Re,startTimeRef:Ne}],()=>{ie(i),ce(s),ue(o),W(!1),V(!1),Y(!1),M&&M()})}))},[X,G,le,se,F.right,ge,T,A,c.right,De,z,M]),Ae=n.useCallback(()=>{B?Me():ze()},[B,ze,Me]),Pe=n.useCallback(()=>{K||G||!c.middle||(o.flushSync(()=>{W(!0),V(!0),Y(!0),q(!0)}),S&&S(),Se.current&&cancelAnimationFrame(Se.current),Se.current=requestAnimationFrame(()=>{const e=ve.current?.getLayout(),t=Math.round(1e3*(e?.[0]??le))/1e3,n=Math.round(1e3*(e?.[1]??se))/1e3,r=Math.round(1e3*(e?.[2]??de))/1e3,o=t+r,a=o>0?t/o*100:T?50:0,l=o>0?r/o*100:P?50:0;a>0&&fe(a),l>0&&be(l),De([{panelRef:ye,fromSize:t,toSize:a,animationFrameRef:Ce,startTimeRef:Ee},{panelRef:xe,fromSize:n,toSize:0,animationFrameRef:Se,startTimeRef:ke},{panelRef:we,fromSize:r,toSize:l,animationFrameRef:Re,startTimeRef:Ne}],()=>{ie(a),ce(0),ue(l),W(!1),V(!1),Y(!1),R&&R()})}))},[K,G,le,se,de,T,P,c.middle,De,S,R]),Le=n.useCallback(()=>{K||G||!c.middle||(o.flushSync(()=>{W(!0),V(!0),Y(!0),q(!1)}),E&&E(),Se.current&&cancelAnimationFrame(Se.current),Se.current=requestAnimationFrame(()=>{const e=ve.current?.getLayout(),t=Math.round(1e3*(e?.[0]??le))/1e3,n=Math.round(1e3*(e?.[1]??0))/1e3,r=Math.round(1e3*(e?.[2]??de))/1e3,o=he||F.middle,a=100-o,l=t+r,i=l>0?t/l*a:T?a/2:0,s=l>0?r/l*a:P?a/2:0;i>0&&fe(i),s>0&&be(s),De([{panelRef:ye,fromSize:t,toSize:i,animationFrameRef:Ce,startTimeRef:Ee},{panelRef:xe,fromSize:n,toSize:o,animationFrameRef:Se,startTimeRef:ke},{panelRef:we,fromSize:r,toSize:s,animationFrameRef:Re,startTimeRef:Ne}],()=>{ie(i),ce(o),ue(s),W(!1),V(!1),Y(!1),k&&k()})}))},[K,G,le,de,F.middle,he,T,P,c.middle,De,E,k]),Fe=n.useCallback(()=>{_?Te():je()},[_,je,Te]),$e=n.useCallback(e=>{U||K||X||(ie(e),e>0&&(fe(e),O(!1)))},[U,K,X]),Be=n.useCallback(e=>{U||K||X||(ce(e),e>0&&(me(e),q(!1)))},[U,K,X]),Oe=n.useCallback(e=>{U||K||X||(ue(e),e>0&&(be(e),H(!1)))},[U,K,X]),Ie=n.useCallback(()=>{if(j){j({left:B?pe:le,middle:I?he:se,right:_?ge:de})}},[le,se,de,B,I,_,pe,he,ge,j]),qe=n.useCallback(e=>{J(e),e||Ie()},[Ie]);n.useEffect(()=>{void 0!==f.left&&f.left!==B&&queueMicrotask(()=>{f.left?ze():Me()})},[f.left,B,ze,Me]),n.useEffect(()=>{void 0!==f.middle&&f.middle!==I&&queueMicrotask(()=>{f.middle?Pe():Le()})},[f.middle,I,Pe,Le]),n.useEffect(()=>{void 0!==f.right&&f.right!==_&&queueMicrotask(()=>{f.right?je():Te()})},[f.right,_,je,Te]),n.useEffect(()=>()=>{Ce.current&&cancelAnimationFrame(Ce.current),Se.current&&cancelAnimationFrame(Se.current),Re.current&&cancelAnimationFrame(Re.current)},[]);const _e=e=>{let t="three-panel-item";return"left"===e?!c.left&&T||(t+=" collapsible-panel",U&&!G&&(t+=" animating"),Q&&(t+=" collapsed")):"middle"===e?(t+=" middle-panel",!c.middle&&A||(t+=" collapsible-panel",K&&!G&&(t+=" animating"),Z&&(t+=" collapsed"))):"right"===e&&(!c.right&&P||(t+=" collapsible-panel",X&&!G&&(t+=" animating"),ee&&(t+=" collapsed"))),t},He=U&&!G?{transition:`width ${g}ms ${b}`,width:B?"0%":`${F.left}%`}:void 0,Ue=K&&!G?{transition:`width ${g}ms ${b}`,width:I?"0%":`${F.middle}%`}:void 0,We=X&&!G?{transition:`width ${g}ms ${b}`,width:_?"0%":`${F.right}%`}:void 0,Ke=a(v),Ve=U||K||X?0:$.left,Xe=U||K||X?0:$.middle,Ye=U||K||X?0:$.right;return t.jsx("div",{className:`three-panel-layout ${p}`,style:{...Ke,...h},children:t.jsxs(r.PanelGroup,{ref:ve,direction:"horizontal",onLayout:Ie,children:[t.jsx(r.Panel,{ref:ye,collapsible:c.left||!T,defaultSize:f.left||!T?0:F.left,minSize:Ve,collapsedSize:0,onResize:$e,onCollapse:()=>O(!0),onExpand:()=>O(!1),className:_e("left"),style:He,...s.left||{},children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:B?0:1,transition:U?`opacity ${.5*g}ms ${b}`:"none"},children:re})}),t.jsx(r.PanelResizeHandle,{className:"resize-handle left-handle "+(!Q&&T&&A?"":"collapsed"),onDragging:qe,disabled:Q||!T||!A,children:m&&c.left&&t.jsx("div",{className:"handle-bar",children:t.jsx("button",{onClick:Ae,className:"collapse-toggle",disabled:U,"aria-label":B?"Expand left panel":"Collapse left panel",children:B?"▸":"◂"})})}),t.jsx(r.Panel,{ref:xe,collapsible:c.middle||!A,defaultSize:f.middle||!A?0:F.middle,minSize:Xe,collapsedSize:0,onResize:Be,onCollapse:()=>q(!0),onExpand:()=>q(!1),className:_e("middle"),style:Ue,...s.middle||{},children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:I?0:1,transition:K?`opacity ${.5*g}ms ${b}`:"none"},children:oe})}),t.jsx(r.PanelResizeHandle,{className:"resize-handle right-handle "+(ee||!P||!A&&!T?"collapsed":""),onDragging:qe,disabled:ee||!P||!A&&!T,children:m&&c.right&&t.jsx("div",{className:"handle-bar",children:t.jsx("button",{onClick:Fe,className:"collapse-toggle",disabled:X,"aria-label":_?"Expand right panel":"Collapse right panel",children:_?"◂":"▸"})})}),t.jsx(r.Panel,{ref:we,collapsible:c.right||!P,defaultSize:f.right||!P?0:F.right,minSize:Ye,collapsedSize:0,onResize:Oe,onCollapse:()=>H(!0),onExpand:()=>H(!1),className:_e("right"),style:We,...s.right||{},children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:_?0:1,transition:X?`opacity ${.5*g}ms ${b}`:"none"},children:ae})})]})})},c=n.forwardRef(({panels:e,className:r="",style:o,theme:l,minPanelWidth:i=350,idealPanelWidth:s=.333,showSeparator:c=!1,onPanelChange:d,preventKeyboardScroll:u=!0,disableSwipe:p=!1},f)=>{const h=n.useRef(null),m=a(l);n.useImperativeHandle(f,()=>({scrollToPanel:e=>{if(!h.current)return;const t=h.current,n=t.children[e];if(n){const e=n.offsetLeft;t.scrollTo({left:e,behavior:"smooth"})}},getCurrentPanel:()=>{if(!h.current||0===h.current.children.length)return 0;const e=h.current,t=e.getBoundingClientRect().left;let n=0,r=1/0;for(let o=0;o<e.children.length;o++){const a=e.children[o].getBoundingClientRect(),l=Math.abs(a.left-t);l<r&&(r=l,n=o)}return n}}));n.useEffect(()=>{if(!u||!h.current)return;const e=h.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)}},[u]);const g=e.length,b=2*i;let v;v=1===g||2===g?"100%":`max(${i}px, ${100*s}%)`;const y=n.useId().replace(/:/g,"_");return t.jsxs(t.Fragment,{children:[2===g&&t.jsx("style",{children:`\n .snap-carousel-container[data-carousel-id="${y}"][data-panel-count="2"] .snap-carousel-panel {\n width: 100%;\n }\n @container (min-width: ${b}px) {\n .snap-carousel-container[data-carousel-id="${y}"][data-panel-count="2"] .snap-carousel-panel {\n width: 50%;\n }\n }\n `}),t.jsx("div",{ref:h,className:`snap-carousel-container ${p?"swipe-disabled":""} ${r}`,style:{...m,...o,"--snap-carousel-min-width":`${i}px`,"--snap-carousel-ideal-width":100*s+"%","--snap-carousel-gap":c?"1px":"0px","--snap-carousel-panel-width":v,"--snap-carousel-panel-count":g,"--snap-carousel-two-panel-threshold":`${b}px`},onScroll:e=>{if(!d||!h.current||0===h.current.children.length)return;const t=h.current,n=t.getBoundingClientRect().left;let r=0,o=1/0;for(let a=0;a<t.children.length;a++){const e=t.children[a].getBoundingClientRect(),l=Math.abs(e.left-n);l<o&&(o=l,r=a)}d(r)},"data-panel-count":g,"data-carousel-id":y,children:e.map((e,n)=>t.jsx("div",{className:"snap-carousel-panel",children:e},n))})]})});function d(e){const[t,r]=n.useState(()=>"undefined"!=typeof window&&window.matchMedia(e).matches);return n.useEffect(()=>{if("undefined"==typeof window)return;const t=window.matchMedia(e),n=e=>{r(e.matches)};return r(t.matches),t.addEventListener?(t.addEventListener("change",n),()=>t.removeEventListener("change",n)):(t.addListener(n),()=>t.removeListener(n))},[e]),t}c.displayName="SnapCarousel";const u="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function p(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function f(e){return"nodeType"in e}function h(e){var t,n;return e?p(e)?e:f(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function m(e){const{Document:t}=h(e);return e instanceof t}function g(e){return!p(e)&&e instanceof h(e).HTMLElement}function b(e){return e instanceof h(e).SVGElement}function v(e){return e?p(e)?e.document:f(e)?m(e)?e:g(e)||b(e)?e.ownerDocument:document:document:document}const y=u?n.useLayoutEffect:n.useEffect;function x(e){const t=n.useRef(e);return y(()=>{t.current=e}),n.useCallback(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 w(e,t){void 0===t&&(t=[e]);const r=n.useRef(e);return y(()=>{r.current!==e&&(r.current=e)},t),r}function C(e,t){const r=n.useRef();return n.useMemo(()=>{const t=e(r.current);return r.current=t,t},[...t])}function S(e){const t=x(e),r=n.useRef(null),o=n.useCallback(e=>{e!==r.current&&(null==t||t(e,r.current)),r.current=e},[]);return[r,o]}function R(e){const t=n.useRef();return n.useEffect(()=>{t.current=e},[e]),t.current}let E={};function k(e,t){return n.useMemo(()=>{if(t)return t;const n=null==E[e]?0:E[e]+1;return E[e]=n,e+"-"+n},[e,t])}function N(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,a]of r){const n=t[o];null!=n&&(t[o]=n+e*a)}return t},{...t})}}const D=N(1),z=N(-1);function M(e){if(!e)return!1;const{KeyboardEvent:t}=h(e.target);return t&&e instanceof t}function j(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=h(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 T="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function A(e){return e.matches(T)?e:e.querySelector(T)}const P={display:"none"};function L(e){let{id:t,value:r}=e;return n.createElement("div",{id:t,style:P},r)}function F(e){let{id:t,announcement:r,ariaLiveType:o="assertive"}=e;return n.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},r)}const $=n.createContext(null);const B={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 "},O={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 I(e){let{announcements:t=O,container:r,hiddenTextDescribedById:a,screenReaderInstructions:l=B}=e;const{announce:i,announcement:s}=function(){const[e,t]=n.useState("");return{announce:n.useCallback(e=>{null!=e&&t(e)},[]),announcement:e}}(),c=k("DndLiveRegion"),[d,u]=n.useState(!1);if(n.useEffect(()=>{u(!0)},[]),function(e){const t=n.useContext($);n.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(n.useMemo(()=>({onDragStart(e){let{active:n}=e;i(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&i(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;i(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;i(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;i(t.onDragCancel({active:n,over:r}))}}),[i,t])),!d)return null;const p=n.createElement(n.Fragment,null,n.createElement(L,{id:a,value:l.draggable}),n.createElement(F,{id:c,announcement:s}));return r?o.createPortal(p,r):p}var q,_;function H(){}(_=q||(q={})).DragStart="dragStart",_.DragMove="dragMove",_.DragEnd="dragEnd",_.DragCancel="dragCancel",_.DragOver="dragOver",_.RegisterDroppable="registerDroppable",_.SetDroppableDisabled="setDroppableDisabled",_.UnregisterDroppable="unregisterDroppable";const U=Object.freeze({x:0,y:0});function W(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function K(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function V(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function X(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 Y=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=X(t,t.left,t.top),a=[];for(const l of r){const{id:e}=l,t=n.get(e);if(t){const n=W(X(t),o);a.push({id:e,data:{droppableContainer:l,value:n}})}}return a.sort(K)};function G(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),a=Math.min(t.top+t.height,e.top+e.height),l=o-r,i=a-n;if(r<o&&n<a){const n=t.width*t.height,r=e.width*e.height,o=l*i;return Number((o/(n+r-o)).toFixed(4))}return 0}const J=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const a of r){const{id:e}=a,r=n.get(e);if(r){const n=G(r,t);n>0&&o.push({id:e,data:{droppableContainer:a,value:n}})}}return o.sort(V)};function Q(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:U}function Z(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 ee=Z(1);const te={ignoreTransform:!1};function ne(e,t){void 0===t&&(t=te);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=h(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:a,x:l,y:i}=r,s=e.left-l-(1-o)*parseFloat(n),c=e.top-i-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=a?e.height/a: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:a,height:l,bottom:i,right:s}=n;return{top:r,left:o,width:a,height:l,bottom:i,right:s}}function re(e){return ne(e,{ignoreTransform:!0})}function oe(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(m(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!g(o)||b(o))return n;if(n.includes(o))return n;const a=h(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=h(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,a)&&n.push(o),function(e,t){return void 0===t&&(t=h(e).getComputedStyle(e)),"fixed"===t.position}(o,a)?n:r(o.parentNode)}(e):n}function ae(e){const[t]=oe(e,1);return null!=t?t:null}function le(e){return u&&e?p(e)?e:f(e)?m(e)||e===v(e).scrollingElement?window:g(e)?e:null:null:null}function ie(e){return p(e)?e.scrollX:e.scrollLeft}function se(e){return p(e)?e.scrollY:e.scrollTop}function ce(e){return{x:ie(e),y:se(e)}}var de,ue;function pe(e){return!(!u||!e)&&e===document.scrollingElement}function fe(e){const t={x:0,y:0},n=pe(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}}(ue=de||(de={}))[ue.Forward=1]="Forward",ue[ue.Backward=-1]="Backward";const he={x:.2,y:.2};function me(e,t,n,r,o){let{top:a,left:l,right:i,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=he);const{isTop:c,isBottom:d,isLeft:u,isRight:p}=fe(e),f={x:0,y:0},h={x:0,y:0},m=t.height*o.y,g=t.width*o.x;return!c&&a<=t.top+m?(f.y=de.Backward,h.y=r*Math.abs((t.top+m-a)/m)):!d&&s>=t.bottom-m&&(f.y=de.Forward,h.y=r*Math.abs((t.bottom-m-s)/m)),!p&&i>=t.right-g?(f.x=de.Forward,h.x=r*Math.abs((t.right-g-i)/g)):!u&&l<=t.left+g&&(f.x=de.Backward,h.x=r*Math.abs((t.left+g-l)/g)),{direction:f,speed:h}}function ge(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 be(e){return e.reduce((e,t)=>D(e,ce(t)),U)}const ve=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+ie(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+se(t),0)}]];class ye{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=oe(t),r=be(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[o,a,l]of ve)for(const e of a)Object.defineProperty(this,e,{get:()=>{const t=l(n),a=r[o]-t;return this.rect[e]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class xe{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 we(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 Ce,Se,Re,Ee;function ke(e){e.preventDefault()}function Ne(e){e.stopPropagation()}(Se=Ce||(Ce={})).Click="click",Se.DragStart="dragstart",Se.Keydown="keydown",Se.ContextMenu="contextmenu",Se.Resize="resize",Se.SelectionChange="selectionchange",Se.VisibilityChange="visibilitychange",(Ee=Re||(Re={})).Space="Space",Ee.Down="ArrowDown",Ee.Right="ArrowRight",Ee.Left="ArrowLeft",Ee.Up="ArrowUp",Ee.Esc="Escape",Ee.Enter="Enter",Ee.Tab="Tab";const De={start:[Re.Space,Re.Enter],cancel:[Re.Esc],end:[Re.Space,Re.Enter,Re.Tab]},ze=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Re.Right:return{...n,x:n.x+25};case Re.Left:return{...n,x:n.x-25};case Re.Down:return{...n,y:n.y+25};case Re.Up:return{...n,y:n.y-25}}};class Me{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 xe(v(t)),this.windowListeners=new xe(h(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ce.Resize,this.handleCancel),this.windowListeners.add(Ce.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ce.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=ne),!e)return;const{top:n,left:r,bottom:o,right:a}=t(e);ae(e)&&(o<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(U)}handleKeyDown(e){if(M(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=De,coordinateGetter:a=ze,scrollBehavior:l="smooth"}=r,{code:i}=e;if(o.end.includes(i))return void this.handleEnd(e);if(o.cancel.includes(i))return void this.handleCancel(e);const{collisionRect:s}=n.current,c=s?{x:s.left,y:s.top}:U;this.referenceCoordinates||(this.referenceCoordinates=c);const d=a(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=z(d,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:a,isRight:i,isLeft:s,isBottom:c,maxScroll:u,minScroll:p}=fe(n),f=ge(n),h={x:Math.min(o===Re.Right?f.right-f.width/2:f.right,Math.max(o===Re.Right?f.left:f.left+f.width/2,d.x)),y:Math.min(o===Re.Down?f.bottom-f.height/2:f.bottom,Math.max(o===Re.Down?f.top:f.top+f.height/2,d.y))},m=o===Re.Right&&!i||o===Re.Left&&!s,g=o===Re.Down&&!c||o===Re.Up&&!a;if(m&&h.x!==d.x){const e=n.scrollLeft+t.x,a=o===Re.Right&&e<=u.x||o===Re.Left&&e>=p.x;if(a&&!t.y)return void n.scrollTo({left:e,behavior:l});r.x=a?n.scrollLeft-e:o===Re.Right?n.scrollLeft-u.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:l});break}if(g&&h.y!==d.y){const e=n.scrollTop+t.y,a=o===Re.Down&&e<=u.y||o===Re.Up&&e>=p.y;if(a&&!t.x)return void n.scrollTo({top:e,behavior:l});r.y=a?n.scrollTop-e:o===Re.Down?n.scrollTop-u.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:l});break}}this.handleMove(e,D(z(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 je(e){return Boolean(e&&"distance"in e)}function Te(e){return Boolean(e&&"delay"in e)}Me.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=De,onActivation:o}=t,{active:a}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const t=a.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class Ae{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=h(e);return e instanceof t?e:v(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:a}=o;this.props=e,this.events=t,this.document=v(a),this.documentListeners=new xe(this.document),this.listeners=new xe(n),this.windowListeners=new xe(h(a)),this.initialCoordinates=null!=(r=j(o))?r:U,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(Ce.Resize,this.handleCancel),this.windowListeners.add(Ce.DragStart,ke),this.windowListeners.add(Ce.VisibilityChange,this.handleCancel),this.windowListeners.add(Ce.ContextMenu,ke),this.documentListeners.add(Ce.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Te(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(je(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(Ce.Click,Ne,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ce.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:a,options:{activationConstraint:l}}=o;if(!r)return;const i=null!=(t=j(e))?t:U,s=z(r,i);if(!n&&l){if(je(l)){if(null!=l.tolerance&&we(s,l.tolerance))return this.handleCancel();if(we(s,l.distance))return this.handleStart()}return Te(l)&&we(s,l.tolerance)?this.handleCancel():void this.handlePending(l,s)}e.cancelable&&e.preventDefault(),a(i)}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===Re.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Pe={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Le extends Ae{constructor(e){const{event:t}=e,n=v(t.target);super(e,Pe,n)}}Le.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 Fe={move:{name:"mousemove"},end:{name:"mouseup"}};var $e,Be;(Be=$e||($e={}))[Be.RightClick=2]="RightClick";(class extends Ae{constructor(e){super(e,Fe,v(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==$e.RightClick&&(null==r||r({event:n}),!0)}}];const Oe={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var Ie,qe,_e,He;function Ue(e){let{acceleration:t,activator:r=Ie.Pointer,canScroll:o,draggingRect:a,enabled:l,interval:i=5,order:s=_e.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,delta:p,threshold:f}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=R(t);return C(e=>{if(n||!r||!e)return We;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[de.Backward]:e.x[de.Backward]||-1===o.x,[de.Forward]:e.x[de.Forward]||1===o.x},y:{[de.Backward]:e.y[de.Backward]||-1===o.y,[de.Forward]:e.y[de.Forward]||1===o.y}}},[n,t,r])}({delta:p,disabled:!l}),[m,g]=function(){const e=n.useRef(null);return[n.useCallback((t,n)=>{e.current=setInterval(t,n)},[]),n.useCallback(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),b=n.useRef({x:0,y:0}),v=n.useRef({x:0,y:0}),y=n.useMemo(()=>{switch(r){case Ie.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Ie.DraggableRect:return a}},[r,a,c]),x=n.useRef(null),w=n.useCallback(()=>{const e=x.current;if(!e)return;const t=b.current.x*v.current.x,n=b.current.y*v.current.y;e.scrollBy(t,n)},[]),S=n.useMemo(()=>s===_e.TreeOrder?[...d].reverse():d,[s,d]);n.useEffect(()=>{if(l&&d.length&&y){for(const e of S){if(!1===(null==o?void 0:o(e)))continue;const n=d.indexOf(e),r=u[n];if(!r)continue;const{direction:a,speed:l}=me(e,r,y,t,f);for(const e of["x","y"])h[e][a[e]]||(l[e]=0,a[e]=0);if(l.x>0||l.y>0)return g(),x.current=e,m(w,i),b.current=l,void(v.current=a)}b.current={x:0,y:0},v.current={x:0,y:0},g()}else g()},[t,w,o,g,l,i,JSON.stringify(y),JSON.stringify(h),m,d,S,u,JSON.stringify(f)])}(class extends Ae{constructor(e){super(e,Oe)}static setup(){return window.addEventListener(Oe.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Oe.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)}}],(qe=Ie||(Ie={}))[qe.Pointer=0]="Pointer",qe[qe.DraggableRect=1]="DraggableRect",(He=_e||(_e={}))[He.TreeOrder=0]="TreeOrder",He[He.ReversedTreeOrder=1]="ReversedTreeOrder";const We={x:{[de.Backward]:!1,[de.Forward]:!1},y:{[de.Backward]:!1,[de.Forward]:!1}};var Ke,Ve,Xe;(Ve=Ke||(Ke={}))[Ve.Always=0]="Always",Ve[Ve.BeforeDragging=1]="BeforeDragging",Ve[Ve.WhileDragging=2]="WhileDragging",(Xe||(Xe={})).Optimized="optimized";const Ye=new Map;function Ge(e,t){return C(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function Je(e){let{callback:t,disabled:r}=e;const o=x(t),a=n.useMemo(()=>{if(r||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)},[r]);return n.useEffect(()=>()=>null==a?void 0:a.disconnect(),[a]),a}function Qe(e){return new ye(ne(e),e)}function Ze(e,t,r){void 0===t&&(t=Qe);const[o,a]=n.useState(null);function l(){a(n=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=n?n:r)?o:null;const a=t(e);return JSON.stringify(n)===JSON.stringify(a)?n:a})}const i=function(e){let{callback:t,disabled:r}=e;const o=x(t),a=n.useMemo(()=>{if(r||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)},[o,r]);return n.useEffect(()=>()=>null==a?void 0:a.disconnect(),[a]),a}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){l();break}}}}),s=Je({callback:l});return y(()=>{l(),e?(null==s||s.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==i||i.disconnect())},[e]),o}const et=[];function tt(e,t){void 0===t&&(t=[]);const r=n.useRef(null);return n.useEffect(()=>{r.current=null},t),n.useEffect(()=>{const t=e!==U;t&&!r.current&&(r.current=e),!t&&r.current&&(r.current=null)},[e]),r.current?z(e,r.current):U}function nt(e){return n.useMemo(()=>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 rt=[];function ot(e){let{measure:t}=e;const[r,o]=n.useState(null),a=Je({callback:n.useCallback(e=>{for(const{target:n}of e)if(g(n)){o(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),l=n.useCallback(e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return g(t)?t:e}(e);null==a||a.disconnect(),n&&(null==a||a.observe(n)),o(n?t(n):null)},[t,a]),[i,s]=S(l);return n.useMemo(()=>({nodeRef:i,rect:r,setRef:s}),[r,i,s])}const at=[{sensor:Le,options:{}},{sensor:Me,options:{}}],lt={current:{}},it={draggable:{measure:re},droppable:{measure:re,strategy:Ke.WhileDragging,frequency:Xe.Optimized},dragOverlay:{measure:ne}};class st 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 ct={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new st,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:H},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:it,measureDroppableContainers:H,windowRect:null,measuringScheduled:!1},dt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:H,draggableNodes:new Map,over:null,measureDroppableContainers:H},ut=n.createContext(dt),pt=n.createContext(ct);function ft(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new st}}}function ht(e,t){switch(t.type){case q.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case q.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 q.DragEnd:case q.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case q.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new st(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case q.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const l=new st(e.droppable.containers);return l.set(n,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:l}}}case q.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new st(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function mt(e){let{disabled:t}=e;const{active:r,activatorEvent:o,draggableNodes:a}=n.useContext(ut),l=R(o),i=R(null==r?void 0:r.id);return n.useEffect(()=>{if(!t&&!o&&l&&null!=i){if(!M(l))return;if(document.activeElement===l.target)return;const e=a.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=A(e);if(t){t.focus();break}}})}},[o,t,a,i,l]),null}const gt=n.createContext({...U,scaleX:1,scaleY:1});var bt,vt;(vt=bt||(bt={}))[vt.Uninitialized=0]="Uninitialized",vt[vt.Initializing=1]="Initializing",vt[vt.Initialized=2]="Initialized";const yt=n.memo(function(e){var t,r,a,l;let{id:i,accessibility:s,autoScroll:c=!0,children:d,sensors:p=at,collisionDetection:f=J,measuring:m,modifiers:g,...b}=e;const v=n.useReducer(ht,void 0,ft),[x,S]=v,[R,E]=function(){const[e]=n.useState(()=>new Set),t=n.useCallback(t=>(e.add(t),()=>e.delete(t)),[e]);return[n.useCallback(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]}(),[N,z]=n.useState(bt.Uninitialized),M=N===bt.Initialized,{draggable:{active:T,nodes:A,translate:P},droppable:{containers:L}}=x,F=null!=T?A.get(T):null,B=n.useRef({initial:null,translated:null}),O=n.useMemo(()=>{var e;return null!=T?{id:T,data:null!=(e=null==F?void 0:F.data)?e:lt,rect:B}:null},[T,F]),_=n.useRef(null),[H,W]=n.useState(null),[K,V]=n.useState(null),X=w(b,Object.values(b)),Y=k("DndDescribedBy",i),G=n.useMemo(()=>L.getEnabled(),[L]),Z=(te=m,n.useMemo(()=>({draggable:{...it.draggable,...null==te?void 0:te.draggable},droppable:{...it.droppable,...null==te?void 0:te.droppable},dragOverlay:{...it.dragOverlay,...null==te?void 0:te.dragOverlay}}),[null==te?void 0:te.draggable,null==te?void 0:te.droppable,null==te?void 0:te.dragOverlay]));var te;const{droppableRects:re,measureDroppableContainers:ie,measuringScheduled:se}=function(e,t){let{dragging:r,dependencies:o,config:a}=t;const[l,i]=n.useState(null),{frequency:s,measure:c,strategy:d}=a,u=n.useRef(e),p=function(){switch(d){case Ke.Always:return!1;case Ke.BeforeDragging:return r;default:return!r}}(),f=w(p),h=n.useCallback(function(e){void 0===e&&(e=[]),f.current||i(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=n.useRef(null),g=C(t=>{if(p&&!r)return Ye;if(!t||t===Ye||u.current!==e||null!=l){const t=new Map;for(let n of e){if(!n)continue;if(l&&l.length>0&&!l.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new ye(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,l,r,p,c]);return n.useEffect(()=>{u.current=e},[e]),n.useEffect(()=>{p||h()},[r,p]),n.useEffect(()=>{l&&l.length>0&&i(null)},[JSON.stringify(l)]),n.useEffect(()=>{p||"number"!=typeof s||null!==m.current||(m.current=setTimeout(()=>{h(),m.current=null},s))},[s,p,h,...o]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:null!=l}}(G,{dragging:M,dependencies:[P.x,P.y],config:Z.droppable}),de=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return C(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(A,T),ue=n.useMemo(()=>K?j(K):null,[K]),fe=function(){const e=!1===(null==H?void 0:H.autoScrollEnabled),t="object"==typeof c?!1===c.enabled:!1===c,n=M&&!e&&!t;if("object"==typeof c)return{...c,enabled:n};return{enabled:n}}(),he=function(e,t){return Ge(e,t)}(de,Z.draggable.measure);!function(e){let{activeNode:t,measure:r,initialRect:o,config:a=!0}=e;const l=n.useRef(!1),{x:i,y:s}="boolean"==typeof a?{x:a,y:a}:a;y(()=>{if(!i&&!s||!t)return void(l.current=!1);if(l.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const n=Q(r(e),o);if(i||(n.x=0),s||(n.y=0),l.current=!0,Math.abs(n.x)>0||Math.abs(n.y)>0){const t=ae(e);t&&t.scrollBy({top:n.y,left:n.x})}},[t,i,s,o,r])}({activeNode:null!=T?A.get(T):null,config:fe.layoutShiftCompensation,initialRect:he,measure:Z.draggable.measure});const me=Ze(de,Z.draggable.measure,he),ge=Ze(de?de.parentElement:null),ve=n.useRef({activatorEvent:null,active:null,activeNode:de,collisionRect:null,collisions:null,droppableRects:re,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),xe=L.getNodeFor(null==(t=ve.current.over)?void 0:t.id),we=ot({measure:Z.dragOverlay.measure}),Ce=null!=(r=we.nodeRef.current)?r:de,Se=M?null!=(a=we.rect)?a:me:null,Re=Boolean(we.nodeRef.current&&we.rect),Ee=Q(ke=Re?null:me,Ge(ke));var ke;const Ne=nt(Ce?h(Ce):null),De=function(e){const t=n.useRef(e),r=C(n=>e?n&&n!==et&&e&&t.current&&e.parentNode===t.current.parentNode?n:oe(e):et,[e]);return n.useEffect(()=>{t.current=e},[e]),r}(M?null!=xe?xe:de:null),ze=function(e,t){void 0===t&&(t=ne);const[r]=e,o=nt(r?h(r):null),[a,l]=n.useState(rt);function i(){l(()=>e.length?e.map(e=>pe(e)?o:new ye(t(e),e)):rt)}const s=Je({callback:i});return y(()=>{null==s||s.disconnect(),i(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),a}(De),Me=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}(g,{transform:{x:P.x-Ee.x,y:P.y-Ee.y,scaleX:1,scaleY:1},activatorEvent:K,active:O,activeNodeRect:me,containerNodeRect:ge,draggingNodeRect:Se,over:ve.current.over,overlayNodeRect:we.rect,scrollableAncestors:De,scrollableAncestorRects:ze,windowRect:Ne}),je=ue?D(ue,P):null,Te=function(e){const[t,r]=n.useState(null),o=n.useRef(e),a=n.useCallback(e=>{const t=le(e.target);t&&r(e=>e?(e.set(t,ce(t)),new Map(e)):null)},[]);return n.useEffect(()=>{const t=o.current;if(e!==t){n(t);const l=e.map(e=>{const t=le(e);return t?(t.addEventListener("scroll",a,{passive:!0}),[t,ce(t)]):null}).filter(e=>null!=e);r(l.length?new Map(l):null),o.current=e}return()=>{n(e),n(t)};function n(e){e.forEach(e=>{const t=le(e);null==t||t.removeEventListener("scroll",a)})}},[a,e]),n.useMemo(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>D(e,t),U):be(e):U,[e,t])}(De),Ae=tt(Te),Pe=tt(Te,[me]),Le=D(Me,Ae),Fe=Se?ee(Se,Me):null,$e=O&&Fe?f({active:O,collisionRect:Fe,droppableRects:re,droppableContainers:G,pointerCoordinates:je}):null,Be=function(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}($e,"id"),[Oe,Ie]=n.useState(null),qe=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Re?Me:D(Me,Pe),null!=(l=null==Oe?void 0:Oe.rect)?l:null,me),_e=n.useRef(null),He=n.useCallback((e,t)=>{let{sensor:n,options:r}=t;if(null==_.current)return;const a=A.get(_.current);if(!a)return;const l=e.nativeEvent,i=new n({active:_.current,activeNode:a,event:l,options:r,context:ve,onAbort(e){if(!A.get(e))return;const{onDragAbort:t}=X.current,n={id:e};null==t||t(n),R({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!A.get(e))return;const{onDragPending:o}=X.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(a),R({type:"onDragPending",event:a})},onStart(e){const t=_.current;if(null==t)return;const n=A.get(t);if(!n)return;const{onDragStart:r}=X.current,a={activatorEvent:l,active:{id:t,data:n.data,rect:B}};o.unstable_batchedUpdates(()=>{null==r||r(a),z(bt.Initializing),S({type:q.DragStart,initialCoordinates:e,active:t}),R({type:"onDragStart",event:a}),W(_e.current),V(l)})},onMove(e){S({type:q.DragMove,coordinates:e})},onEnd:s(q.DragEnd),onCancel:s(q.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:a}=ve.current;let i=null;if(t&&a){const{cancelDrop:o}=X.current;if(i={activatorEvent:l,active:t,collisions:n,delta:a,over:r},e===q.DragEnd&&"function"==typeof o){await Promise.resolve(o(i))&&(e=q.DragCancel)}}_.current=null,o.unstable_batchedUpdates(()=>{S({type:e}),z(bt.Uninitialized),Ie(null),W(null),V(null),_e.current=null;const t=e===q.DragEnd?"onDragEnd":"onDragCancel";if(i){const e=X.current[t];null==e||e(i),R({type:t,event:i})}})}}_e.current=i},[A]),We=function(e,t){return n.useMemo(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(p,n.useCallback((e,t)=>(n,r)=>{const o=n.nativeEvent,a=A.get(r);if(null!==_.current||!a||o.dndKit||o.defaultPrevented)return;const l={active:a};!0===e(n,t.options,l)&&(o.dndKit={capturedBy:t.sensor},_.current=r,He(n,t))},[A,He]));!function(e){n.useEffect(()=>{if(!u)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}))}(p),y(()=>{me&&N===bt.Initializing&&z(bt.Initialized)},[me,N]),n.useEffect(()=>{const{onDragMove:e}=X.current,{active:t,activatorEvent:n,collisions:r,over:a}=ve.current;if(!t||!n)return;const l={active:t,activatorEvent:n,collisions:r,delta:{x:Le.x,y:Le.y},over:a};o.unstable_batchedUpdates(()=>{null==e||e(l),R({type:"onDragMove",event:l})})},[Le.x,Le.y]),n.useEffect(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:a}=ve.current;if(!e||null==_.current||!t||!a)return;const{onDragOver:l}=X.current,i=r.get(Be),s=i&&i.rect.current?{id:i.id,rect:i.rect.current,data:i.data,disabled:i.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:a.x,y:a.y},over:s};o.unstable_batchedUpdates(()=>{Ie(s),null==l||l(c),R({type:"onDragOver",event:c})})},[Be]),y(()=>{ve.current={activatorEvent:K,active:O,activeNode:de,collisionRect:Fe,collisions:$e,droppableRects:re,draggableNodes:A,draggingNode:Ce,draggingNodeRect:Se,droppableContainers:L,over:Oe,scrollableAncestors:De,scrollAdjustedTranslate:Le},B.current={initial:Se,translated:Fe}},[O,de,$e,Fe,A,Ce,Se,re,L,Oe,De,Le]),Ue({...fe,delta:P,draggingRect:Fe,pointerCoordinates:je,scrollableAncestors:De,scrollableAncestorRects:ze});const Ve=n.useMemo(()=>({active:O,activeNode:de,activeNodeRect:me,activatorEvent:K,collisions:$e,containerNodeRect:ge,dragOverlay:we,draggableNodes:A,droppableContainers:L,droppableRects:re,over:Oe,measureDroppableContainers:ie,scrollableAncestors:De,scrollableAncestorRects:ze,measuringConfiguration:Z,measuringScheduled:se,windowRect:Ne}),[O,de,me,K,$e,ge,we,A,L,re,Oe,ie,De,ze,Z,se,Ne]),Xe=n.useMemo(()=>({activatorEvent:K,activators:We,active:O,activeNodeRect:me,ariaDescribedById:{draggable:Y},dispatch:S,draggableNodes:A,over:Oe,measureDroppableContainers:ie}),[K,We,O,me,S,Y,A,Oe,ie]);return n.createElement($.Provider,{value:E},n.createElement(ut.Provider,{value:Xe},n.createElement(pt.Provider,{value:Ve},n.createElement(gt.Provider,{value:qe},d)),n.createElement(mt,{disabled:!1===(null==s?void 0:s.restoreFocus)})),n.createElement(I,{...s,hiddenTextDescribedById:Y}))}),xt=n.createContext(null),wt="button";function Ct(e){let{id:t,data:r,disabled:o=!1,attributes:a}=e;const l=k("Draggable"),{activators:i,activatorEvent:s,active:c,activeNodeRect:d,ariaDescribedById:u,draggableNodes:p,over:f}=n.useContext(ut),{role:h=wt,roleDescription:m="draggable",tabIndex:g=0}=null!=a?a:{},b=(null==c?void 0:c.id)===t,v=n.useContext(b?gt:xt),[x,C]=S(),[R,E]=S(),N=function(e,t){return n.useMemo(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(i,t),D=w(r);y(()=>(p.set(t,{id:t,key:l,node:x,activatorNode:R,data:D}),()=>{const e=p.get(t);e&&e.key===l&&p.delete(t)}),[p,t]);return{active:c,activatorEvent:s,activeNodeRect:d,attributes:n.useMemo(()=>({role:h,tabIndex:g,"aria-disabled":o,"aria-pressed":!(!b||h!==wt)||void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[o,h,g,b,m,u.draggable]),isDragging:b,listeners:o?void 0:N,node:x,over:f,setNodeRef:C,setActivatorNodeRef:E,transform:v}}const St={timeout:25};const Rt=({slotPosition:e,isEditing:r,isDragging:o,children:a})=>{const{attributes:l,listeners:i,setNodeRef:s,transform:c}=Ct({id:`slot-${e}`,data:{slotPosition:e},disabled:!r}),{setNodeRef:d,isOver:u}=function(e){let{data:t,disabled:r=!1,id:o,resizeObserverConfig:a}=e;const l=k("Droppable"),{active:i,dispatch:s,over:c,measureDroppableContainers:d}=n.useContext(ut),u=n.useRef({disabled:r}),p=n.useRef(!1),f=n.useRef(null),h=n.useRef(null),{disabled:m,updateMeasurementsFor:g,timeout:b}={...St,...a},v=w(null!=g?g:o),y=Je({callback:n.useCallback(()=>{p.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{d(Array.isArray(v.current)?v.current:[v.current]),h.current=null},b)):p.current=!0},[b]),disabled:m||!i}),x=n.useCallback((e,t)=>{y&&(t&&(y.unobserve(t),p.current=!1),e&&y.observe(e))},[y]),[C,R]=S(x),E=w(t);return n.useEffect(()=>{y&&C.current&&(y.disconnect(),p.current=!1,y.observe(C.current))},[C,y]),n.useEffect(()=>(s({type:q.RegisterDroppable,element:{id:o,key:l,disabled:r,node:C,rect:f,data:E}}),()=>s({type:q.UnregisterDroppable,key:l,id:o})),[o]),n.useEffect(()=>{r!==u.current.disabled&&(s({type:q.SetDroppableDisabled,id:o,key:l,disabled:r}),u.current.disabled=r)},[o,l,r,s]),{active:i,rect:f,isOver:(null==c?void 0:c.id)===o,node:C,over:c,setNodeRef:R}}({id:`drop-${e}`,data:{slotPosition:e}}),p={position:"relative",height:"100%",width:"100%",transform:c?`translate3d(${c.x}px, ${c.y}px, 0)`:void 0},f=n.useCallback(e=>{s(e),d(e)},[s,d]);return t.jsxs("div",{ref:f,style:p,className:`slot-with-overlay ${r?"edit-mode":""} ${o?"dragging":""} ${u?"drag-over":""}`,children:[a,r&&t.jsxs("div",{className:"slot-edit-overlay",...l,...i,children:[t.jsx("div",{className:"drag-indicator",children:"⋮⋮"}),t.jsx("div",{className:"slot-position-label",children:e.toUpperCase()})]})]})},Et=({layout:e,activeSlot:r})=>{const[o,a]=n.useState(new Map);return n.useEffect(()=>{const e=()=>{const e=new Map;["left","middle","right"].forEach(t=>{const n=document.querySelector(`[data-slot="${t}"]`);if(n){const r=n.getBoundingClientRect();e.set(t,r)}}),a(e)};e(),window.addEventListener("resize",e);const t=setInterval(e,100);return()=>{window.removeEventListener("resize",e),clearInterval(t)}},[e]),t.jsx("div",{style:{pointerEvents:"none",position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:999},children:["left","middle","right"].map(n=>{if(!e[n])return null;const a=o.get(n);if(!a)return null;const l=r===n;return t.jsx("div",{style:{position:"fixed",top:a.top,left:a.left,width:a.width,height:a.height,pointerEvents:"auto"},children:t.jsx(Rt,{slotPosition:n,isEditing:!0,isDragging:l,children:t.jsx("div",{style:{height:"100%"}})})},n)})})};var kt,Nt=(()=>{if("undefined"!=typeof window){const e=window;return e.__principlemd_theme_context__||(e.__principlemd_theme_context__=n.createContext(void 0)),e.__principlemd_theme_context__}return kt||(kt=n.createContext(void 0)),kt})();const Dt=e=>null!=e&&"object"==typeof e&&"type"in e,zt=e=>null==e?[]:"string"==typeof e?[e]:Dt(e)?e.panels:[];e.AnimatedResizableLayout=({leftPanel:e,rightPanel:o,collapsibleSide:l="left",defaultSize:i=25,minSize:s=5,className:c="",collapsed:d=!1,style:u,showCollapseButton:p=!1,animationDuration:f=300,animationEasing:h="cubic-bezier(0.4, 0, 0.2, 1)",onCollapseStart:m,onCollapseComplete:g,onExpandStart:b,onExpandComplete:v,theme:y})=>{const[x,w]=n.useState(d),[C,S]=n.useState(!1),[R,E]=n.useState(!1),[k,N]=n.useState(d),[D,z]=n.useState(d?0:i),M=n.useRef(null),j=n.useRef(void 0),T=n.useRef(void 0),A=n.useRef(void 0),P=n.useCallback((e,t,n)=>{if(!M.current)return;j.current&&cancelAnimationFrame(j.current),T.current=performance.now();const r=o=>{if(!T.current||!M.current)return;const a=o-T.current,l=Math.min(a/f,1),i=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2,s=e+(t-e)*i;M.current.resize(s),l<1?j.current=requestAnimationFrame(r):(0===t?M.current.collapse():M.current.resize(t),S(!1),n&&n())};j.current=requestAnimationFrame(r)},[f]),L=n.useCallback(()=>{C||R||(S(!0),w(!0),m&&m(),P(D,0,()=>{z(0),N(!0),g&&g()}))},[C,R,D,P,m,g]),F=n.useCallback(()=>{C||R||(S(!0),w(!1),N(!1),b&&b(),P(0,i,()=>{z(i),v&&v()}))},[C,R,i,P,b,v]),$=n.useCallback(()=>{x?F():L()},[x,L,F]),B=n.useCallback(e=>{C||(z(e),e>0&&w(!1))},[C]),O=n.useCallback(()=>{E(!0)},[]),I=n.useCallback(()=>{E(!1)},[]);n.useEffect(()=>{d!==x&&(d?L():F())},[d]),n.useEffect(()=>{d&&!C?N(!0):d||C||N(!1)},[d,C]),n.useEffect(()=>{const e=j.current,t=A.current;return()=>{e&&cancelAnimationFrame(e),t&&clearTimeout(t)}},[]);const q="left"===l,_=x?q?"▸":"◂":q?"◂":"▸",H=a(y),U=C&&!R?{transition:`flex ${f}ms ${h}`}:void 0,W=e=>{let t="hybrid-panel";return e&&(t+=" collapsible-panel",C&&!R&&(t+=" animating"),x&&(t+=" collapsed")),t};return t.jsx("div",{className:`animated-resizable-layout ${c}`,style:{...H,...u},children:t.jsxs(r.PanelGroup,{direction:"horizontal",onLayout:I,children:[t.jsx(r.Panel,{ref:q?M:void 0,collapsible:q,defaultSize:q?d?0:i:void 0,minSize:q?s:30,collapsedSize:0,onResize:q?B:void 0,onCollapse:q?()=>w(!0):void 0,onExpand:q?()=>w(!1):void 0,className:W(q),style:q?U:void 0,children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:q&&x?0:1,transition:C?`opacity ${.5*f}ms ${h}`:"none"},children:e})}),t.jsx(r.PanelResizeHandle,{className:"resize-handle "+(k?"collapsed":""),onDragging:O,style:k?{visibility:"hidden",width:0}:void 0,children:p&&t.jsx("div",{className:"handle-bar",children:t.jsx("button",{onClick:$,className:"collapse-toggle",disabled:C,"aria-label":x?"Expand panel":"Collapse panel",children:_})})}),t.jsx(r.Panel,{ref:q?void 0:M,collapsible:!q,defaultSize:q?void 0:d?0:i,minSize:q?30:s,collapsedSize:0,onResize:q?void 0:B,onCollapse:q?void 0:()=>w(!0),onExpand:q?void 0:()=>w(!1),className:W(!q),style:q?void 0:U,children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:!q&&x?0:1,transition:C?`opacity ${.5*f}ms ${h}`:"none"},children:o})})]})})},e.AnimatedVerticalLayout=({topPanel:e,bottomPanel:o,collapsiblePanels:l={top:!0,bottom:!0},defaultSizes:i={top:30,bottom:30},minSizes:s={top:5,bottom:5},className:c="",collapsed:d={top:!1,bottom:!1},style:u,showCollapseButtons:p=!1,animationDuration:f=300,animationEasing:h="cubic-bezier(0.4, 0, 0.2, 1)",theme:m,onTopCollapseStart:g,onTopCollapseComplete:b,onTopExpandStart:v,onTopExpandComplete:y,onBottomCollapseStart:x,onBottomCollapseComplete:w,onBottomExpandStart:C,onBottomExpandComplete:S,onPanelResize:R})=>{const[E,k]=n.useState(d.top||!1),[N,D]=n.useState(!1),[z,M]=n.useState(d.top?0:i.top),j=n.useRef(null),T=n.useRef(void 0),A=n.useRef(void 0),[P,L]=n.useState(d.bottom||!1),[F,$]=n.useState(!1),[B,O]=n.useState(d.bottom?0:i.bottom),I=n.useRef(null),q=n.useRef(void 0),_=n.useRef(void 0),[H,U]=n.useState(!1),W=n.useCallback((e,t,n)=>{if(!j.current)return;T.current&&cancelAnimationFrame(T.current),A.current=performance.now();const r=o=>{if(!A.current||!j.current)return;const a=o-A.current,l=Math.min(a/f,1),i=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2,s=e+(t-e)*i;j.current.resize(s),l<1?T.current=requestAnimationFrame(r):(0===t?j.current.collapse():j.current.resize(t),D(!1),n&&n())};T.current=requestAnimationFrame(r)},[f]),K=n.useCallback((e,t,n)=>{if(!I.current)return;q.current&&cancelAnimationFrame(q.current),_.current=performance.now();const r=o=>{if(!_.current||!I.current)return;const a=o-_.current,l=Math.min(a/f,1),i=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2,s=e+(t-e)*i;I.current.resize(s),l<1?q.current=requestAnimationFrame(r):(0===t?I.current.collapse():I.current.resize(t),$(!1),n&&n())};q.current=requestAnimationFrame(r)},[f]),V=n.useCallback(()=>{N||H||!l.top||(D(!0),k(!0),g&&g(),W(z,0,()=>{M(0),b&&b()}))},[N,H,z,l.top,W,g,b]),X=n.useCallback(()=>{N||H||!l.top||(D(!0),k(!1),v&&v(),W(0,i.top,()=>{M(i.top),y&&y()}))},[N,H,i.top,l.top,W,v,y]),Y=n.useCallback(()=>{E?X():V()},[E,V,X]),G=n.useCallback(()=>{F||H||!l.bottom||($(!0),L(!0),x&&x(),K(B,0,()=>{O(0),w&&w()}))},[F,H,B,l.bottom,K,x,w]),J=n.useCallback(()=>{F||H||!l.bottom||($(!0),L(!1),C&&C(),K(0,i.bottom,()=>{O(i.bottom),S&&S()}))},[F,H,i.bottom,l.bottom,K,C,S]),Q=n.useCallback(()=>{P?J():G()},[P,G,J]),Z=n.useCallback(e=>{N||(M(e),e>0&&k(!1))},[N]),ee=n.useCallback(e=>{F||(O(e),e>0&&L(!1))},[F]),te=n.useCallback(()=>{U(!0)},[]),ne=n.useCallback(()=>{U(!1),R&&R({top:z,bottom:B})},[z,B,R]);n.useEffect(()=>{void 0!==d.top&&d.top!==E&&(d.top?V():X())},[d.top]),n.useEffect(()=>{void 0!==d.bottom&&d.bottom!==P&&(d.bottom?G():J())},[d.bottom]),n.useEffect(()=>()=>{T.current&&cancelAnimationFrame(T.current),q.current&&cancelAnimationFrame(q.current)},[]);const re=a(m),oe=N&&!H?{transition:`flex ${f}ms ${h}`}:void 0,ae=F&&!H?{transition:`flex ${f}ms ${h}`}:void 0;return t.jsx("div",{className:`animated-vertical-layout ${c}`,style:{...re,...u},children:t.jsxs(r.PanelGroup,{direction:"vertical",onLayout:ne,children:[t.jsx(r.Panel,{ref:j,collapsible:l.top,defaultSize:d.top?0:i.top,minSize:s.top,collapsedSize:0,onResize:Z,onCollapse:()=>k(!0),onExpand:()=>k(!1),className:(()=>{let e="vertical-panel collapsible-panel";return N&&!H&&(e+=" animating"),E&&(e+=" collapsed"),e})(),style:oe,children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:E?0:1,transition:N?`opacity ${.5*f}ms ${h}`:"none"},children:e})}),t.jsx(r.PanelResizeHandle,{className:"vertical-resize-handle",onDragging:te,children:p&&t.jsxs("div",{className:"handle-bar",children:[l.top&&t.jsx("button",{onClick:Y,className:"collapse-toggle collapse-toggle-top",disabled:N,"aria-label":E?"Expand top panel":"Collapse top panel",children:E?"▾":"▴"}),l.bottom&&t.jsx("button",{onClick:Q,className:"collapse-toggle collapse-toggle-bottom",disabled:F,"aria-label":P?"Expand bottom panel":"Collapse bottom panel",children:P?"▴":"▾"})]})}),t.jsx(r.Panel,{ref:I,collapsible:l.bottom,defaultSize:d.bottom?0:i.bottom,minSize:s.bottom,collapsedSize:0,onResize:ee,onCollapse:()=>L(!0),onExpand:()=>L(!1),className:(()=>{let e="vertical-panel collapsible-panel";return F&&!H&&(e+=" animating"),P&&(e+=" collapsed"),e})(),style:ae,children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:P?0:1,transition:F?`opacity ${.5*f}ms ${h}`:"none"},children:o})})]})})},e.ConfigurablePanelLayout=s,e.EditableConfigurablePanelLayout=({isEditMode:e,onLayoutChange:r,panels:o,layout:a,...l})=>{const[i,c]=n.useState(null),[d,u]=n.useState({x:0,y:0}),p=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.useMemo(()=>[...t].filter(e=>null!=e),[...t])}((f=Le,h={activationConstraint:{distance:8}},n.useMemo(()=>({sensor:f,options:null!=h?h:{}}),[f,h])));var f,h;const m=n.useCallback(e=>{const t=e.active.id;if(t.startsWith("slot-")){const e=t.replace("slot-","");c(e),u({x:0,y:0})}},[]),g=n.useCallback(e=>{const{delta:t}=e;u({x:t.x,y:t.y})},[]),b=n.useCallback(e=>{const{active:t,over:n}=e;if(c(null),u({x:0,y:0}),!n)return;const o=t.id,l=n.id,i=o.replace("slot-",""),s=l.replace("drop-","");if(i===s)return;const d={...a},p=d[i];d[i]=d[s],d[s]=p,r&&r(d)},[a,r]);n.useEffect(()=>{if(!i||!e)return;const t=document.querySelector(`[data-slot="${i}"]`);return t&&(t.setAttribute("data-dragging","true"),t.style.setProperty("transform",`scale(0.95) translate(${d.x}px, ${d.y}px)`,"important"),t.style.setProperty("z-index","1000","important"),t.style.setProperty("transition","none","important"),t.style.setProperty("opacity","0.95","important"),t.style.setProperty("box-shadow","0 12px 24px rgba(0, 0, 0, 0.25)","important")),()=>{t&&(t.removeAttribute("data-dragging"),t.style.removeProperty("transform"),t.style.removeProperty("z-index"),t.style.removeProperty("transition"),t.style.removeProperty("opacity"),t.style.removeProperty("box-shadow"))}},[i,d,e]);const v={left:{"data-slot":"left","data-edit-mode":e?"true":"false"},middle:{"data-slot":"middle","data-edit-mode":e?"true":"false"},right:{"data-slot":"right","data-edit-mode":e?"true":"false"}};return t.jsx(yt,{sensors:p,collisionDetection:Y,onDragStart:m,onDragMove:g,onDragEnd:b,children:t.jsxs("div",{className:"editable-panel-layout "+(e?"edit-mode-active":""),children:[t.jsx(s,{...l,panels:o,layout:a,slotDataAttributes:v}),e&&t.jsx(Et,{layout:a,activeSlot:i,onDragStart:()=>{},onDragEnd:()=>{}})]})})},e.PanelConfigurator=({availablePanels:e,currentLayout:r,onChange:o,className:a="",theme:l})=>{const i=(()=>{const e=n.useContext(Nt);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e})(),s=l||i.theme,[c,d]=n.useState(null),u=n.useCallback(t=>t&&e.find(e=>e.id===t)||null,[e]),p=n.useCallback(()=>[...e].sort((e,t)=>e.label.localeCompare(t.label)),[e]),f=n.useCallback(e=>{const t=zt(r.left),n=zt(r.middle),o=zt(r.right);return t.includes(e)||n.includes(e)||o.includes(e)},[r]),h=n.useCallback((e,t)=>{const n={...e};return["left","middle","right"].forEach(e=>{const r=n[e];if(r===t)n[e]=null;else if(null!=r&&Dt(r)){const o=r.panels.filter(e=>e!==t);0===o.length?n[e]=null:1===o.length?n[e]=o[0]:n[e]={...r,panels:o}}}),n},[]),m=n.useCallback((e,t)=>{const n=r[e];if(!Dt(n)||"tabs"!==n.type)return;const a=n.panels.filter(e=>e!==t),l={...r};l[e]={...n,panels:a},o(l)},[r,o]),g=n.useCallback((e,t)=>{t.stopPropagation();const n=r[e];if(Dt(n)&&"tabs"===n.type){const t={...r};t[e]=n.panels.length>0?n.panels[0]:null,o(t),d(null)}else{const t=n&&"string"==typeof n?[n]:[],a={...r};a[e]={type:"tabs",panels:t,config:{defaultActiveTab:0,tabPosition:"top"}},o(a),d({type:"slot",position:e})}},[r,o]),b=n.useCallback(e=>{if(c)if("slot"===c.type){if(c.position===e)return;const t={...r},n=t[c.position];t[c.position]=t[e],t[e]=n,o(t),d(null)}else{const t=r[e];if(Dt(t)&&"tabs"===t.type){if(t.panels.includes(c.id))return void m(e,c.id);const n=t,a=h(r,c.id);return a[e]={...n,panels:[...n.panels,c.id]},void o(a)}{const t=h(r,c.id);t[e]=c.id,o(t),d(null)}}else d({type:"slot",position:e})},[c,r,o,h,m]),v=n.useCallback(e=>{if(c)if("slot"===c.type){const t=r[c.position];if(Dt(t)&&"tabs"===t.type){if(t.panels.includes(e))return void m(c.position,e);const n=t,a=h(r,e);return a[c.position]={...n,panels:[...n.panels,e]},void o(a)}{const t=h(r,e);t[c.position]=e,o(t),d(null)}}else d({type:"panel",id:e});else d({type:"panel",id:e})},[c,r,o,h,m]),y=n.useCallback((e,t)=>{t.stopPropagation();const n={...r};n[e]=null,o(n),d(null)},[r,o]),x=n.useCallback((e,t,n)=>{n.stopPropagation();const a=r[e];if(!Dt(a)||"tabs"!==a.type)return;const l=a.panels.filter(e=>e!==t),i={...r};i[e]={...a,panels:l},o(i)},[r,o]),w=n.useCallback((e,t)=>{const n=r[e];if(!Dt(n)||"tabs"!==n.type)return;const a={...r};a[e]={...n,config:{...n.config,...t}},o(a)},[r,o]),C=p(),S=e=>{const t=r[e];return Dt(t)&&"tabs"===t.type},R={"--configurator-bg":s.colors.background,"--configurator-title":s.colors.textSecondary,"--slot-bg":s.colors.backgroundSecondary,"--slot-border":s.colors.border,"--slot-border-hover":s.colors.textTertiary,"--slot-border-selected":s.colors.primary,"--slot-bg-selected":s.colors.backgroundLight,"--slot-label":s.colors.textTertiary,"--slot-content-text":s.colors.text,"--slot-preview-bg":s.colors.backgroundTertiary,"--slot-preview-border":s.colors.border,"--slot-preview-text":s.colors.textMuted,"--slot-empty-text":s.colors.textMuted,"--panel-bg":s.colors.backgroundSecondary,"--panel-border":s.colors.border,"--panel-border-hover":s.colors.textSecondary,"--panel-border-selected":s.colors.primary,"--panel-bg-selected":s.colors.backgroundLight,"--panel-label-text":s.colors.text,"--panel-preview-bg":s.colors.backgroundTertiary,"--panel-preview-text":s.colors.textMuted,"--clear-btn-bg":s.colors.error,"--clear-btn-text":s.colors.background,"--clear-btn-hover":s.colors.error,"--hint-bg":s.colors.backgroundLight,"--hint-border":s.colors.primary,"--hint-text":s.colors.text};return t.jsxs("div",{className:`panel-configurator ${a}`,style:R,children:[t.jsxs("div",{className:"configurator-section",children:[t.jsx("h3",{className:"section-title",children:"Panel Layout (3 Slots)"}),t.jsx("div",{className:"slots-container",children:["left","middle","right"].map(e=>{const n=r[e],o=(e=>"slot"===c?.type&&c.position===e)(e),a=Dt(n)&&"tabs"===n.type,l=null!==n;return t.jsxs("div",{"data-position":e,className:`slot ${o?"selected":""} ${l?"filled":"empty"} ${a?"tab-group":""}`,onClick:()=>b(e),children:[t.jsx("button",{className:"tab-mode-toggle "+(a?"active":""),onClick:t=>g(e,t),title:a?"Disable tab mode":"Enable tab mode",children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:t.jsx("path",{d:"M2 2h4v2H2V2zm5 0h4v2H7V2zm5 0h2v2h-2V2zM2 5h12v9H2V5zm1 1v7h10V6H3z"})})}),null===n?t.jsx("div",{className:"slot-empty-state",children:a?"Click panels to add tabs":"Empty"}):Dt(n)?t.jsxs("div",{className:"slot-content group-content",children:["tabs"===n.type&&n.panels.length>0&&t.jsx("div",{className:"tab-config-controls",children:t.jsxs("label",{className:"tab-config-label",children:["Tabs:",t.jsxs("select",{value:n.config?.tabPosition||"top",onChange:t=>w(e,{tabPosition:t.target.value}),onClick:e=>e.stopPropagation(),children:[t.jsx("option",{value:"top",children:"Top (centered)"}),t.jsx("option",{value:"bottom",children:"Bottom (centered)"}),t.jsx("option",{value:"left",children:"Left"}),t.jsx("option",{value:"right",children:"Right"})]})]})}),t.jsx("div",{className:"group-panels",children:0===n.panels.length?t.jsx("div",{className:"slot-empty-state",children:"Click panels to add tabs"}):n.panels.map((r,o)=>{const a=u(r),l="tabs"===n.type&&(n.config?.defaultActiveTab??0)===o;return a?t.jsxs("div",{className:"group-panel-item",children:[t.jsxs("span",{className:"group-panel-label",children:[a.label,l&&t.jsx("span",{className:"default-badge",children:"★"})]}),t.jsx("button",{className:"remove-from-group-btn",onClick:t=>x(e,r,t),title:`Remove ${a.label}`,children:"×"})]},r):null})})]}):t.jsxs("div",{className:"slot-content",children:["string"==typeof n&&u(n)?.preview&&t.jsx("div",{className:"slot-preview",children:u(n)?.preview}),t.jsx("div",{className:"slot-panel-label",children:"string"==typeof n?u(n)?.label:""}),t.jsx("button",{className:"slot-clear-btn",onClick:t=>y(e,t),"aria-label":`Remove ${"string"==typeof n?u(n)?.label:"panel"} from ${e} slot`,children:"×"})]})]},e)})})]}),t.jsxs("div",{className:"configurator-section",children:[t.jsx("h3",{className:"section-title",children:"Available Panels"}),t.jsx("div",{className:"available-panels",children:C.map(e=>{const n=(r=e.id,"panel"===c?.type&&c.id===r);var r;const o=f(e.id);return t.jsxs("div",{className:`available-panel ${n?"selected":""} ${o?"in-use":""}`,onClick:()=>v(e.id),children:[t.jsx("div",{className:"panel-label",children:e.label}),e.preview&&t.jsx("div",{className:"panel-preview",children:e.preview})]},e.id)})})]}),c&&t.jsx("div",{className:"selection-hint",children:"slot"===c.type?S(c.position)?t.jsxs(t.Fragment,{children:["Selected: ",c.position," slot (Tab Mode). Click panels to add them to the tab group."]}):t.jsxs(t.Fragment,{children:["Selected: ",c.position," slot. Click another slot to swap, or click a panel to assign."]}):t.jsxs(t.Fragment,{children:["Selected: ",u(c.id)?.label,". Click a slot to assign",S("left")||S("middle")||S("right")?" (or add to tab group)":"","."]})}),t.jsxs("div",{className:"usage-hint",children:[t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",style:{verticalAlign:"text-bottom",marginRight:"4px"},children:t.jsx("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"})}),t.jsx("strong",{children:"Tip:"})," Toggle the tab icon on a slot to enable tab mode, then click panels to add multiple tabs."]})]})},e.ResponsiveConfigurablePanelLayout=({mobileBreakpoint:e="(max-width: 768px)",mobileCarouselProps:r,theme:o,layout:a,panels:u,...p})=>{const f=d(e),h=n.useRef(null),[m,g]=n.useState(0),b=n.useMemo(()=>[a?.left,a?.middle,a?.right],[a]),v=n.useMemo(()=>{const e=e=>{if(!e)return null;const t=u.find(t=>t.id===e);return t?.content??null},n=e=>{const t=u.find(t=>t.id===e);return t?.label??e};return b.map(r=>{if(null==r)return null;if("object"==typeof r&&"type"in r){const e=r;if("tabs"===e.type){const r=e.panels.length>0?n(e.panels[0]):"Tab Group";return{content:t.jsx(i,{panelIds:e.panels,panels:u,config:e.config,theme:o}),label:r}}return null}return{content:e(r),label:n(r)}}).filter(e=>null!==e)},[b,u,o]),y=e=>{g(e)},x=l(o);if(f){if(0===v.length)return null;const e=v.map(e=>e.content);return t.jsxs("div",{className:"mobile-tab-layout",style:x,children:[t.jsx("div",{className:"mobile-tab-content",children:t.jsx(c,{ref:h,theme:o,panels:e,minPanelWidth:0,idealPanelWidth:1,disableSwipe:!0,onPanelChange:y,...r})}),t.jsx("nav",{className:"mobile-tab-nav",role:"tablist",children:v.map((e,n)=>t.jsx("button",{role:"tab","aria-selected":n===m,className:"mobile-tab-button "+(n===m?"active":""),onClick:()=>(e=>{g(e),h.current?.scrollToPanel(e)})(n),children:e.label},n))})]})}return t.jsx(s,{theme:o,layout:a,panels:u,...p})},e.SnapCarousel=c,e.TabGroup=i,e.mapThemeToPanelVars=a,e.mapThemeToTabVars=l,e.useMediaQuery=d,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|