@aiquants/resize-panels 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(ae,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],m):(ae=typeof globalThis<"u"?globalThis:ae||self,m(ae.AiquantsResizePanels={},ae.React,ae.ReactDOM))})(this,(function(ae,m,Wt){"use strict";const Ve=m.createContext(null),Be=()=>{const e=m.useContext(Ve);if(!e)throw new Error("usePanelGroup must be used within a PanelGroup");return e},rt=(e,t=0)=>{if(!Number.isFinite(e))return e;const n=10**t,o=e*n,i=Math.floor(o),s=o-i,a=Number.EPSILON*Math.max(1,Math.abs(o));return s<.5-a?i/n:s>.5+a?(i+1)/n:(i%2===0?i:i+1)/n},it=12,ot=8,Ut=8,Vt=8,st=.05,at=10,Yt=.05,Xt=20,Jt=.05,Ye=0,lt=0,ct=6,fe=(e,t)=>t<=0?0:rt(e/t*100,ct),Ie=(e,t)=>!e||t<=0?0:e/100*t,Ee=(e,t="percentage")=>{if(e!==void 0)return typeof e=="number"?{value:e,unit:t}:e},dt=(e,t)=>e?e.unit==="percentage"?e.value/100*t:e.value:0,oe=(e,t,n)=>e?typeof e=="number"?e/100*n:e.unit==="pixels"?e.value:e.value/100*n:t,pe=(e,t,n)=>Math.min(Math.max(e,t),n),Xe=e=>{if(!Number.isFinite(e)||e<=0)return lt;const t=e*st,n=Math.min(it,at,t);return Math.max(lt,n)},Je=(e,t,n)=>{if(Math.abs(t)<=0)return t;const o=e.map((l,c)=>({panel:l,index:c})).filter(({panel:l})=>!l.collapsed&&(l.sizeUnit==="pixels"||l.originalPixelSize!==void 0));if(o.length===0)return t;const i=[...o].sort((l,c)=>{const P=l.panel.pixelAdjustPriority??l.index+1,z=c.panel.pixelAdjustPriority??c.index+1;return P===z?l.index-c.index:P-z});let s=t;return(()=>{for(const{index:l}of i){if(Math.abs(s)<=0)break;const c=e[l];if(!c||c.collapsed)continue;const P=Ee(c.minSize,"pixels"),z=Ee(c.maxSize,"pixels"),d=P?dt(P,n):0,u=z?dt(z,n):n;if(s>0){if(Math.abs(c.size)<=0&&(c.percentageSize??0)<=0)continue;const C=Math.max(0,u-c.size);if(C<=0)continue;const k=Math.min(C,s);if(k<=0)continue;const w=c.size+k,p=fe(w,n),g=c.collapsible?w:c.sizeBeforeCollapse,_=c.collapsible?c.measuredPixelSizeBeforeCollapse??c.measuredPixelSize??w:c.measuredPixelSizeBeforeCollapse;e[l]={...c,size:w,percentageSize:p,originalPixelSize:c.originalPixelSize!==void 0?c.originalPixelSize:w,sizeBeforeCollapse:g,measuredPixelSizeBeforeCollapse:_},s-=k}else{const x=Math.max(0,c.size-d);if(x<=0)continue;const C=Math.min(x,Math.abs(s));if(C<=0)continue;const k=c.size-C,w=fe(k,n),p=c.collapsible?k:c.sizeBeforeCollapse,g=c.collapsible?c.measuredPixelSizeBeforeCollapse??c.measuredPixelSize??k:c.measuredPixelSizeBeforeCollapse;e[l]={...c,size:k,percentageSize:w,originalPixelSize:c.originalPixelSize!==void 0?c.originalPixelSize:k,sizeBeforeCollapse:p,measuredPixelSizeBeforeCollapse:g},s+=C}}})(),s},Le=e=>{if(!e)return 0;const t=parseFloat(e);return Number.isFinite(t)?t:0},be=(e,t)=>{const n=e.getBoundingClientRect(),o=typeof window<"u"?window.getComputedStyle(e):null,i=o?Le(o.borderLeftWidth)+Le(o.borderRightWidth):0,s=o?Le(o.borderTopWidth)+Le(o.borderBottomWidth):0;if(t==="horizontal"){const P=n.width>0?n.width:e.offsetWidth,z=n.width>0?Math.max(0,n.width-i):e.clientWidth,d=e.offsetWidth>0?e.offsetWidth:e.clientWidth+i;return{inner:z>0?z:Math.max(0,e.clientWidth),outer:P>0?P:Math.max(0,d)}}const a=n.height>0?n.height:e.offsetHeight,l=n.height>0?Math.max(0,n.height-s):e.clientHeight,c=e.offsetHeight>0?e.offsetHeight:e.clientHeight+s;return{inner:l>0?l:Math.max(0,e.clientHeight),outer:a>0?a:Math.max(0,c)}};let ut=0,ft=0;const pt=()=>typeof window>"u"?(ut+=1,`panel-server-${ut}`):`panel-${Date.now()}-${Math.random().toString(36).substr(2,5)}`,Zt=()=>typeof window>"u"?(ft+=1,`resize-handle-server-${ft}`):`resize-handle-${Date.now()}-${Math.random().toString(36).substr(2,5)}`,mt=(e,t)=>{try{localStorage.setItem(`panel-layout-${e}`,JSON.stringify(t))}catch(n){console.warn("Failed to save panel layout:",n)}},gt=e=>{try{const t=localStorage.getItem(`panel-layout-${e}`);return t?JSON.parse(t):null}catch(t){return console.warn("Failed to load panel layout:",t),null}},Ze=(e,t)=>{const n=e.map(u=>{if(u.collapsed)return{...u,size:0,percentageSize:0};if(u.sizeUnit==="pixels"||u.originalPixelSize!==void 0){const x=oe(u.minSize,0,t),C=oe(u.maxSize,t,t),k=pe(u.size,x,C);let w=k,p=Math.abs(k-u.size)>Ye,g=u.size;if(u.originalPixelSize!==void 0&&Math.abs(u.size-u.originalPixelSize)<=Ye&&(g=u.originalPixelSize),g!==void 0){const _=pe(g,x,C);_>w+Ye&&(w=_,p=!0)}if(p){const _=fe(w,t),H=u.collapsible?w:u.sizeBeforeCollapse,X=u.collapsible?u.measuredPixelSizeBeforeCollapse??u.measuredPixelSize??w:u.measuredPixelSizeBeforeCollapse;return{...u,size:w,percentageSize:_,sizeBeforeCollapse:H,measuredPixelSizeBeforeCollapse:X}}}if(u.sizeUnit==="percentage"&&(!u.percentageSize||u.percentageSize<=0)&&u.size>0){const x=fe(u.size,t);return{...u,percentageSize:x}}return u}),o=n.reduce((u,x)=>x.collapsed?u:x.sizeUnit==="pixels"||x.originalPixelSize!==void 0?u+x.size:u,0),i=()=>{const u=n.map((p,g)=>({panel:p,index:g})).filter(({panel:p})=>!p.collapsed&&(p.sizeUnit==="pixels"||p.originalPixelSize!==void 0));if(u.length===0)return n;const x=u.reduce((p,{panel:g})=>p+g.size,0),C=t-x;if(Math.abs(C)<=.1)return n;const k=[...u].sort((p,g)=>{const _=p.panel.pixelAdjustPriority??p.index+1,H=g.panel.pixelAdjustPriority??g.index+1;return _===H?p.index-g.index:_-H});let w=C;for(const{panel:p,index:g}of k){if(Math.abs(w)<=.1)break;const _=oe(p.minSize,0,t),H=oe(p.maxSize,t,t),X=p.size;if(w>0){const A=Math.max(0,H-X);if(A<=0)continue;const te=Math.min(A,w),R=X+te,U=fe(R,t),V=p.collapsible?R:p.sizeBeforeCollapse,K=p.collapsible?p.measuredPixelSizeBeforeCollapse??p.measuredPixelSize??R:p.measuredPixelSizeBeforeCollapse;n[g]={...p,size:R,percentageSize:U,sizeBeforeCollapse:V,measuredPixelSizeBeforeCollapse:K},w-=te}else{const A=Math.max(0,X-_);if(A<=0)continue;const te=Math.min(A,Math.abs(w)),R=X-te,U=fe(R,t),V=p.collapsible?R:p.sizeBeforeCollapse,K=p.collapsible?p.measuredPixelSizeBeforeCollapse??p.measuredPixelSize??R:p.measuredPixelSizeBeforeCollapse;n[g]={...p,size:R,percentageSize:U,sizeBeforeCollapse:V,measuredPixelSizeBeforeCollapse:K},w+=te}}return n},s=n.reduce((u,x,C)=>(!x.collapsed&&x.sizeUnit==="percentage"&&x.originalPixelSize===void 0&&u.push(C),u),[]);if(s.length===0)return i();const a=Math.max(0,t-o),l=s.map(u=>{const x=n[u];return x.percentageSize!==void 0&&x.percentageSize>0?Ie(x.percentageSize,t):x.size>0?x.size:0}),c=l.reduce((u,x)=>x>0?u+x:u,0);if(c<=0)return i();const P=[...n];let z=0;s.forEach((u,x)=>{const C=P[u],k=l[x];let w;if(k>0){const A=k/c;w=a*A}else w=C.size;const p=oe(C.minSize,0,t),g=oe(C.maxSize,t,t);w=pe(w,p,g),z+=w;const _=fe(w,t),H=C.collapsible?w:C.sizeBeforeCollapse,X=C.collapsible?C.measuredPixelSizeBeforeCollapse??C.measuredPixelSize??w:C.measuredPixelSizeBeforeCollapse;P[u]={...C,size:w,percentageSize:_,sizeBeforeCollapse:H,measuredPixelSizeBeforeCollapse:X}});const d=a-z;return Math.abs(d)>.1&&Je(P,d,t),we(P)},we=e=>{let t=0;for(const i of e)i.collapsed||(t+=Math.max(i.size,0));if(t<=0){let i=!1;const s=e.map(a=>(a.percentageSize??0)!==0?(i=!0,{...a,percentageSize:0,measuredPercentageSize:a.measuredPercentageSize!==void 0?0:a.measuredPercentageSize}):!a.collapsed&&a.sizeBeforeCollapse!==a.size?(i=!0,{...a,sizeBeforeCollapse:a.size}):a);return i?s:e}let n=!1;const o=e.map(i=>{if(i.collapsed)return(i.percentageSize??0)!==0?(n=!0,{...i,percentageSize:0,measuredPercentageSize:i.measuredPercentageSize!==void 0?0:i.measuredPercentageSize}):i;const s=fe(i.size,t),a=i.measuredPercentageSize,P=(a!==void 0?Math.abs(a-s):1/0)<1e-4&&a!==void 0?a:s,z=rt(P,ct),u=Math.abs((i.percentageSize??0)-z)>0||i.percentageSize===void 0,x=i.sizeBeforeCollapse===void 0||i.sizeBeforeCollapse!==i.size,C=i.collapsible&&x,k=i.measuredPixelSize??i.size,w=i.collapsible&&(i.measuredPixelSizeBeforeCollapse===void 0||i.measuredPixelSizeBeforeCollapse!==k);if(!(u||C||w))return i;n=!0;const p=C?i.size:i.sizeBeforeCollapse,g=w?k:i.measuredPixelSizeBeforeCollapse;return{...i,percentageSize:z,sizeBeforeCollapse:p,measuredPixelSizeBeforeCollapse:g}});return n?o:e},De=(e,t)=>{if(t<=0)return!1;const n=[];let o=0;for(let z=0;z<e.length;z+=1){const d=e[z];!d||d.collapsed||(n.push(z),o+=d.size)}if(n.length===0)return!1;let i=t-o;if(Math.abs(i)<=0)return!1;let s=!1;const a=z=>{const d=e[z],u=oe(d.minSize,0,t),x=oe(d.maxSize,t,t),C=d.sizeUnit==="percentage"&&d.originalPixelSize===void 0;return{index:z,minSize:u,maxSize:x,isFlexible:C}},l=(z,d)=>{if(!Number.isFinite(d)||Math.abs(d)<=0)return;const u=e[z];if(!u)return;const x=Math.max(0,u.size+d);if(Math.abs(x-u.size)<=0)return;const C=fe(x,t),k=u.collapsible?x:u.sizeBeforeCollapse,w=u.collapsible?u.measuredPixelSizeBeforeCollapse??u.measuredPixelSize??x:u.measuredPixelSizeBeforeCollapse;e[z]={...u,size:x,percentageSize:C,sizeBeforeCollapse:k,measuredPixelSizeBeforeCollapse:w,measuredPixelSize:void 0,measuredPercentageSize:void 0},i-=d,s=!0},c=z=>{for(const d of z){if(Math.abs(i)<=0)break;const u=e[d.index];if(!u||u.collapsed)continue;const x=u.size;if(i>0){const C=Math.max(0,d.maxSize-x);if(C<=0)continue;const k=Math.min(C,i);if(k<=0)continue;l(d.index,k)}else{const C=Math.max(0,x-d.minSize);if(C<=0)continue;const k=Math.min(C,Math.abs(i));if(k<=0)continue;l(d.index,-k)}}},P=n.map(z=>a(z)).filter(z=>z.isFlexible);if(P.length>0&&c(P),Math.abs(i)>0){const z=i;i=Je(e,i,t),Math.abs(i-z)>0&&(s=!0)}return s},ht=(e,t,n)=>{if(!(e.sizeUnit==="pixels"||e.originalPixelSize!==void 0)||e.pixelAdjustPriority!==void 0)return e;const i=t.filter((a,l)=>l!==n&&(a.sizeUnit==="pixels"||a.originalPixelSize!==void 0)).map(a=>a.pixelAdjustPriority).filter(a=>a!==void 0),s=i.length>0?Math.max(...i)+1:1;return{...e,pixelAdjustPriority:s}},Qt=(e,t)=>{switch(t.type){case"REGISTER_PANEL":{console.log("REGISTER_PANEL",t.panel);const n=e.findIndex(s=>s.id===t.panel.id);if(n>=0){const s=[...e],a=e[n],l={...a,minSize:t.panel.minSize,maxSize:t.panel.maxSize,collapsible:t.panel.collapsible,sizeUnit:t.panel.sizeUnit,originalPixelSize:t.panel.originalPixelSize,pixelAdjustPriority:t.panel.pixelAdjustPriority!==void 0?t.panel.pixelAdjustPriority:a.pixelAdjustPriority},c=ht(l,e,n);return s[n]=c,s}const o={...t.panel},i=ht(o,e);return[...e,i]}case"UNREGISTER_PANEL":{console.log("UNREGISTER_PANEL",t.id);const n=e.filter(o=>o.id!==t.id);return we(n)}case"RESIZE_PANELS":{console.log("RESIZE_PANELS",t.leftId,t.rightId,t.leftSize,t.rightSize);const n=e.findIndex(N=>N.id===t.leftId),o=e.findIndex(N=>N.id===t.rightId);if(n===-1||o===-1)return e;const i=[...e],s=i[n],a=i[o];if(s.collapsed||a.collapsed||t.leftSize===s.size&&t.rightSize===a.size)return e;const l=t.containerSize??e.reduce((N,G)=>N+G.size,0),c=oe(s.minSize,0,l),P=oe(s.maxSize,l,l),z=oe(a.minSize,0,l),d=oe(a.maxSize,l,l),u=s.size+a.size,x=e.reduce((N,G)=>G.collapsed?N:N+G.size,0),C=x-u,k=c+z,w=P+d,p=pe(t.leftSize+t.rightSize,k,w);let g=l>0?l-C:p;Number.isFinite(g)||(g=p);const _=pe(Math.max(p,g),k,w),H=N=>({min:Math.max(c,N-d),max:Math.min(P,N-z)}),X=N=>({min:Math.max(z,N-P),max:Math.min(d,N-c)}),A=Math.abs(t.leftSize-s.size),te=Math.abs(t.rightSize-a.size),R=A>=te;let U=s.size,V=a.size;if(R){const N=H(_);if(N.min>N.max)return e;const G=pe(t.leftSize,N.min,N.max),E=_-G;if(E<z||E>d)return e;U=G,V=E}else{const N=X(_);if(N.min>N.max)return e;const G=pe(t.rightSize,N.min,N.max),E=_-G;if(E<c||E>P)return e;V=G,U=E}const K=U+V;if(_!==K)return e;const ne=x-s.size-a.size+K,J=l>0?l:ne,q=J>0?fe(U,J):0,W=J>0?fe(V,J):0;return i[n]={...s,size:U,percentageSize:q,sizeBeforeCollapse:s.collapsible?U:s.sizeBeforeCollapse,measuredPixelSize:void 0,measuredPercentageSize:void 0},i[o]={...a,size:V,percentageSize:W,sizeBeforeCollapse:a.collapsible?V:a.sizeBeforeCollapse,measuredPixelSize:void 0,measuredPercentageSize:void 0},l>0&&De(i,l)?we(i):i}case"SET_PANELS":return console.log("SET_PANELS",t.panels),we(t.panels);case"CONTAINER_RESIZED":{console.log("CONTAINER_RESIZED",t.containerSize);const n=Ze(e,t.containerSize);return t.containerSize>0&&De(n,t.containerSize)?we(n):n}case"COLLAPSE_PANEL":{console.log("COLLAPSE_PANEL",t.id);const n=e.findIndex(P=>P.id===t.id);if(n===-1)return e;const o=e[n];if(!o.collapsible||o.collapsed)return e;const i=o.size,s=o.measuredPixelSize??i,a={...o,collapsed:!0,sizeBeforeCollapse:i,measuredPixelSizeBeforeCollapse:s,size:0,percentageSize:0,measuredPixelSize:o.measuredPixelSize!==void 0?0:o.measuredPixelSize,measuredPercentageSize:o.measuredPercentageSize!==void 0?0:o.measuredPercentageSize},l=[...e];l[n]=a;const c=Ze(l,t.containerSize);return t.containerSize>0&&De(c,t.containerSize)?we(c):c}case"EXPAND_PANEL":{console.log("EXPAND_PANEL",t.id,t.targetSize);const n=e.findIndex(w=>w.id===t.id);if(n===-1)return e;const o=t.containerSize,i=e[n];if(!(i.collapsible&&i.collapsed))return e;const a=[t.targetSize,i.sizeBeforeCollapse,i.measuredPixelSizeBeforeCollapse,i.originalPixelSize].find(w=>w!==void 0)??0,l=oe(i.minSize,0,o),c=oe(i.maxSize,o,o),P=pe(a,l,c),z=fe(P,o),d=i.measuredPixelSizeBeforeCollapse??P,u=fe(d,o),x={...i,collapsed:!1,size:P,percentageSize:z,sizeBeforeCollapse:P,measuredPixelSize:P,measuredPixelSizeBeforeCollapse:d,measuredPercentageSize:u},C=[...e];C[n]=x;const k=Ze(C,o);return o>0&&De(k,o)?we(k):k}default:return e}},xt=({direction:e,style:t,onLayout:n,autoSaveId:o,showDebugInfo:i=!1})=>{const[s,a]=m.useReducer(Qt,[]),[l,c]=m.useState({width:0,height:0}),[P,z]=m.useState(!1),[d,u]=m.useState(!1),[x,C]=m.useState(null),[k,w]=m.useState({}),[p,g]=m.useState({}),_=m.useRef(null),H=m.useRef(n),X=m.useRef(!1),A=m.useRef(0),te=m.useRef(l);m.useLayoutEffect(()=>{if(!_.current)return;const I=new ResizeObserver(r=>{for(const S of r){const M=S.target,T=M?be(M,"horizontal"):null,Y=M?be(M,"vertical"):null,y=T?T.inner:0,b=Y?Y.inner:0,h=S.contentRect.width,v=S.contentRect.height,L=y>0?y:h,B=b>0?b:v;c(F=>(!P&&L>0&&B>0&&z(!0),F.width===L&&F.height===B?F:{width:L,height:B}))}});return I.observe(_.current),()=>I.disconnect()},[P]),m.useLayoutEffect(()=>{const I=te.current,r=l,S=e==="horizontal"?Math.abs(I.width-r.width)>0:Math.abs(I.height-r.height)>0;if(d&&S){const M=e==="horizontal"?r.width:r.height;a({type:"CONTAINER_RESIZED",containerSize:M,direction:e})}te.current=r},[l,d,e]);const R=m.useCallback(()=>{console.log("panels[0]?.id",s[0]?.id);const I=s.some(f=>{if(f.collapsed||f.sizeUnit!=="percentage")return!1;const Z=f.collapsible?f.sizeBeforeCollapse??f.measuredPixelSizeBeforeCollapse??f.originalPixelSize??f.measuredPixelSize??0:f.measuredPixelSize??f.originalPixelSize??f.size,ce=f.percentageSize!==void 0&&f.percentageSize>0;return f.size<=0&&(Z>0||ce)}),r=e==="horizontal"?l.width:l.height,S=r>0;if(x||!S||!(s.length>0&&(s.length!==A.current||!d||I)))return;const Y=s.filter(f=>!f.collapsed&&(f.originalPixelSize!==void 0||f.sizeUnit==="pixels")).reduce((f,Z)=>Z.originalPixelSize!==void 0?f+Z.originalPixelSize:f+Z.size,0),y=s.filter(f=>f.sizeUnit==="percentage"&&!f.collapsed),b=y.map(f=>f.id),h=y.map(f=>f.percentageSize!==void 0&&f.percentageSize>0?Ie(f.percentageSize,r):f.size>0?f.size:0),v=h.reduce((f,Z)=>f+Z,0),L=r-Y,B=Math.max(0,L),F=B>0,re=s.map(f=>{if(f.collapsed){const Z=f.sizeBeforeCollapse??f.measuredPixelSizeBeforeCollapse??f.originalPixelSize??(f.sizeUnit==="pixels"?f.size:void 0),ce=f.sizeUnit==="percentage"&&f.percentageSize!==void 0?Ie(f.percentageSize,r):void 0,se=Z??ce??0,ue=f.measuredPixelSizeBeforeCollapse??f.measuredPixelSize??se;return{...f,size:0,percentageSize:0,sizeBeforeCollapse:se,measuredPixelSizeBeforeCollapse:ue}}if(f.sizeUnit==="pixels"||f.originalPixelSize!==void 0){const Z=f.size,ce=r>0?fe(Z,r):0,se={...f,size:Z,percentageSize:ce};if(f.collapsible){const ue=f.sizeBeforeCollapse??Z,he=f.measuredPixelSizeBeforeCollapse??f.measuredPixelSize??ue;se.sizeBeforeCollapse=ue,se.measuredPixelSizeBeforeCollapse=he}return se}if(f.sizeUnit==="percentage"){const Z=b.indexOf(f.id),ce=Z!==-1?h[Z]:0,se=oe(f.minSize,0,r),ue=oe(f.maxSize,r,r),he=Math.max(se,f.sizeBeforeCollapse??0,f.measuredPixelSizeBeforeCollapse??0,f.measuredPixelSize??0,f.originalPixelSize??0,f.size>0?f.size:0,f.percentageSize!==void 0?Ie(f.percentageSize,r):0,1),ge=ce>0?ce:he;let me;if(!F)me=se;else if(Z!==-1&&v>0){const Se=ge/v,ve=B*Se;me=pe(ve,se,ue)}else{const Se=f.percentageSize!==void 0?Ie(f.percentageSize,r):f.size,ve=Se>0?Se:ge;me=pe(ve,se,ue)}const xe=r>0?fe(me,r):0,ke={...f,size:me,percentageSize:xe};if(f.collapsible){const Se=f.sizeBeforeCollapse??me,ve=f.measuredPixelSizeBeforeCollapse??f.measuredPixelSize??Se;ke.sizeBeforeCollapse=Se,ke.measuredPixelSizeBeforeCollapse=ve}return ke}return f}),ee=[];for(let f=0;f<re.length;f+=1){const Z=re[f];Z.sizeUnit==="percentage"&&!Z.collapsed&&ee.push(f)}const $=ee.reduce((f,Z)=>f+re[Z].size,0),le=L-$;Math.abs(le)>0&&Je(re,le,r),a({type:"SET_PANELS",panels:re}),A.current=s.length,u(!0)},[s,e,l.width,l.height,d,x]);m.useEffect(()=>{const I=e==="horizontal"?l.width:l.height,r=I>0,S=r&&s.length>0,M=S?s.reduce((v,L)=>{if(L.collapsed)return v;const B=oe(L.minSize,0,I);return v+Math.max(0,B)},0):null,T=S?s.reduce((v,L)=>{if(L.collapsed)return v;const B=oe(L.maxSize,I,I);return v+Math.max(0,B)},0):null,Y=M??x?.totalMinimumSize??null,y=T??x?.totalMaximumSize??null;if(!r){x&&C(v=>!v||v.availableContainerSize===I?v:{reason:v.reason,totalMinimumSize:null,totalMaximumSize:null,availableContainerSize:I});return}const b=Y!==null&&Y-I>Number.EPSILON,h=y!==null&&I-y>Number.EPSILON;if(b||h){const L={reason:b?"minimum-exceeded":"maximum-insufficient",totalMinimumSize:Y,totalMaximumSize:y,availableContainerSize:I};C(B=>B&&B.reason===L.reason&&Math.abs((B.totalMinimumSize??0)-(L.totalMinimumSize??0))<=Number.EPSILON&&Math.abs((B.totalMaximumSize??0)-(L.totalMaximumSize??0))<=Number.EPSILON&&Math.abs(B.availableContainerSize-L.availableContainerSize)<=Number.EPSILON?B:L);return}if(x){const v=x.reason==="minimum-exceeded",L=x.reason==="maximum-insufficient";(!v||Y!==null)&&(!L||y!==null)&&!b&&!h&&C($=>$&&null)}},[s,e,l.width,l.height,x]),m.useEffect(()=>{R()},[R]),m.useEffect(()=>{H.current=n},[n]);const U=m.useMemo(()=>s.map(I=>I.size),[s]);m.useLayoutEffect(()=>{U.length>0&&H.current&&H.current(U)},[U]),m.useEffect(()=>{if(o&&U.length>0){const I=setTimeout(()=>{mt(o,U)},200);return()=>clearTimeout(I)}},[o,U]),m.useEffect(()=>{if(!o||s.length===0||X.current)return;const I=e==="horizontal"?l.width:l.height;if(I<=0)return;const r=gt(o);if(r&&r.length===s.length){const S=s.map((M,T)=>{const Y=oe(M.minSize,0,I),y=oe(M.maxSize,I,I),b=pe(r[T],Y,y),h=fe(b,I);return{...M,size:b,percentageSize:h}});a({type:"SET_PANELS",panels:S}),X.current=!0}},[o,s,l.width,l.height,e]);const V=m.useCallback(I=>{a({type:"REGISTER_PANEL",panel:I})},[]),K=m.useCallback(I=>{a({type:"UNREGISTER_PANEL",id:I}),w(r=>{if(!(I in r))return r;const S={...r};return delete S[I],S})},[]),ne=m.useCallback((I,r,S,M)=>{const T=e==="horizontal"?l.width:l.height,Y=s.find($=>$.id===I),y=s.find($=>$.id===r);if(!(Y&&y)){a({type:"RESIZE_PANELS",leftId:I,rightId:r,leftSize:S,rightSize:M,containerSize:T});return}if(Y.collapsed||y.collapsed)return;const b=oe(Y.minSize,0,T),h=oe(Y.maxSize,T,T),v=oe(y.minSize,0,T),L=oe(y.maxSize,T,T);let B=pe(S,b,h),F=pe(M,v,L);const re=B+F,ee=S+M;if(re!==ee){const $=ee-re;if($>0){const le=h-B,f=L-F,Z=le+f;if(Z>0){const ce=Math.min($*(le/Z),le),se=Math.min($-ce,f);B+=ce,F+=se}}else if($<0){const le=Math.abs($),f=B-b,Z=F-v,ce=f+Z;if(ce>0){const se=Math.min(le*(f/ce),f),ue=Math.min(le-se,Z);B-=se,F-=ue}}}B=pe(B,b,h),F=pe(F,v,L),console.assert(B+F===ee,"Total size after constraints should be close to the original total size.",{constrainedLeftSize:B,constrainedRightSize:F,originalTotalSize:ee}),a({type:"RESIZE_PANELS",leftId:I,rightId:r,leftSize:B,rightSize:F,containerSize:T})},[e,l.width,l.height,s]),J=m.useCallback(I=>{const r=e==="horizontal"?l.width:l.height;a({type:"COLLAPSE_PANEL",id:I,containerSize:r})},[e,l.width,l.height]),q=m.useCallback((I,r)=>{const S=e==="horizontal"?l.width:l.height;a({type:"EXPAND_PANEL",id:I,containerSize:S,targetSize:r})},[e,l.width,l.height]),W=m.useCallback(I=>s.find(r=>r.id===I),[s]),N=m.useCallback((I,r)=>{w(S=>{if(r===null){if(!(I in S))return S;const T={...S};return delete T[I],T}const M=S[I];return M&&M.pixelSize===r.pixelSize&&M.percentageSize===r.percentageSize?S:{...S,[I]:r}})},[]),G=m.useCallback((I,r)=>{g(S=>{if(r===null){if(!(I in S))return S;const T={...S};return delete T[I],T}const M=S[I];return M&&Math.abs(M.thickness-r.thickness)<=.25&&M.visible===r.visible&&M.direction===r.direction&&M.startPanelId===r.startPanelId&&M.endPanelId===r.endPanelId?S:{...S,[I]:r}})},[]),E=m.useMemo(()=>({direction:e,panels:s,containerSize:l,isContainerReady:P,showDebugInfo:i,registerPanel:V,unregisterPanel:K,resizePanels:ne,collapsePanel:J,expandPanel:q,getPanel:W,reportPanelMeasurement:N,panelMeasurements:k,reportHandleMeasurement:G,handleMeasurements:p,layoutConstraintViolation:x}),[e,s,l,P,i,V,K,ne,J,q,W,N,k,G,p,x]),ie=m.useMemo(()=>({display:"flex",flexDirection:e==="horizontal"?"row":"column",alignItems:"stretch",width:"100%",height:"100%",minWidth:"0px",minHeight:"0px",position:"relative",overflow:"hidden",...t}),[e,t]);return{groupRef:_,contextValue:E,groupStyle:ie}},Kt=e=>{const{getPanel:t,collapsePanel:n,expandPanel:o}=Be(),i=t(e),s=m.useCallback(()=>{n(e)},[n,e]),a=m.useCallback(c=>{o(e,c)},[o,e]),l=m.useCallback(()=>{i?.collapsed?a():s()},[i?.collapsed,s,a]);return m.useMemo(()=>({panel:i,isCollapsed:i?.collapsed??!1,collapse:s,expand:a,toggle:l}),[i,s,a,l])};var Ge={exports:{}},Ae={};/**
1
+ (function(ue,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],x):(ue=typeof globalThis<"u"?globalThis:ue||self,x(ue.AiquantsResizePanels={},ue.React,ue.ReactDOM))})(this,(function(ue,x,Kt){"use strict";const tt=x.createContext(null),Ye=()=>{const e=x.useContext(tt);if(!e)throw new Error("usePanelGroup must be used within a PanelGroup");return e},ut=(e,t=0)=>{if(!Number.isFinite(e))return e;const o=10**t,i=e*o,r=Math.floor(i),s=i-r,n=Number.EPSILON*Math.max(1,Math.abs(i));return s<.5-n?r/o:s>.5+n?(r+1)/o:(r%2===0?r:r+1)/o},ft=12,pt=8,qt=8,$t=8,mt=.05,gt=10,er=.05,tr=20,rr=.05,ht=0,xt=6,be=(e,t)=>t<=0?0:ut(e/t*100,xt),De=(e,t)=>!e||t<=0?0:e/100*t,Je=(e,t="percentage")=>{if(e!==void 0)return typeof e=="number"?{value:e,unit:t}:e},zt=(e,t)=>e?e.unit==="percentage"?e.value/100*t:e.value:0,se=(e,t,o)=>e?typeof e=="number"?e/100*o:e.unit==="pixels"?e.value:e.value/100*o:t,Se=(e,t,o)=>Math.min(Math.max(e,t),o),rt=e=>{if(!Number.isFinite(e)||e<=0)return ht;const t=e*mt,o=Math.min(ft,gt,t);return Math.max(ht,o)},St=(e,t,o,i={})=>{if(Math.abs(t)<=0)return t;const r=i.enforceAutoMinSize??!1,s=e.map((l,c)=>({panel:l,index:c})).filter(({panel:l})=>!l.collapsed&&(l.sizeUnit==="pixels"||l.originalPixelSize!==void 0));if(s.length===0)return t;const n=t>0,u=[...s].sort((l,c)=>{const d=l.panel.pixelAdjustPriority??l.index+1,S=c.panel.pixelAdjustPriority??c.index+1;return d===S?n?c.index-l.index:l.index-c.index:n?S-d:d-S});let a=t;const g=l=>{for(const{index:c}of u){if(Math.abs(a)<=0)break;const d=e[c];if(!d||d.collapsed)continue;const S=Je(d.minSize,"pixels"),P=Je(d.maxSize,"pixels"),y=S?zt(S,o):0,M=P?zt(P,o):o,v=r?se(d.autoMinSize,0,o):0,E=Math.max(y,v),C=d.preferredPixelSize!==void 0?Se(d.preferredPixelSize,E,M):d.size,D=d.collapseFromStart||d.collapseFromEnd;if(a>0){if(Math.abs(d.size)<=0&&(d.percentageSize??0)<=0)continue;const ee=Math.max(d.size,C),K=l?Math.min(M,ee):M,w=Math.max(0,K-d.size);if(w<=0)continue;const L=Math.min(w,a);if(L<=0)continue;const X=d.size+L,ne=be(X,o),W=D?X:d.sizeBeforeCollapse,V=D?d.measuredPixelSizeBeforeCollapse??d.measuredPixelSize??X:d.measuredPixelSizeBeforeCollapse;e[c]={...d,size:X,percentageSize:ne,sizeBeforeCollapse:W,measuredPixelSizeBeforeCollapse:V,measuredPixelSize:void 0,measuredPercentageSize:void 0},a-=L}else{const q=l?C:E,ee=Math.max(0,d.size-q);if(ee<=0)continue;const K=Math.min(ee,Math.abs(a));if(K<=0)continue;const w=d.size-K,L=be(w,o),X=D?w:d.sizeBeforeCollapse,ne=D?d.measuredPixelSizeBeforeCollapse??d.measuredPixelSize??w:d.measuredPixelSizeBeforeCollapse;e[c]={...d,size:w,percentageSize:L,sizeBeforeCollapse:X,measuredPixelSizeBeforeCollapse:ne,measuredPixelSize:void 0,measuredPercentageSize:void 0},a+=K}}};return g(!0),(n&&a>0||!n&&a<0)&&g(!1),a},Xe=e=>{if(!e)return 0;const t=parseFloat(e);return Number.isFinite(t)?t:0},ke=(e,t)=>{const o=e.getBoundingClientRect(),i=typeof window<"u"?window.getComputedStyle(e):null,r=i?Xe(i.borderLeftWidth)+Xe(i.borderRightWidth):0,s=i?Xe(i.borderTopWidth)+Xe(i.borderBottomWidth):0;if(t==="horizontal"){const g=o.width>0?o.width:e.offsetWidth,l=o.width>0?Math.max(0,o.width-r):e.clientWidth,c=e.offsetWidth>0?e.offsetWidth:e.clientWidth+r;return{inner:l>0?l:Math.max(0,e.clientWidth),outer:g>0?g:Math.max(0,c)}}const n=o.height>0?o.height:e.offsetHeight,u=o.height>0?Math.max(0,o.height-s):e.clientHeight,a=e.offsetHeight>0?e.offsetHeight:e.clientHeight+s;return{inner:u>0?u:Math.max(0,e.clientHeight),outer:n>0?n:Math.max(0,a)}};let bt=0,Pt=0;const yt=()=>typeof window>"u"?(bt+=1,`panel-server-${bt}`):`panel-${Date.now()}-${Math.random().toString(36).substr(2,5)}`,nr=()=>typeof window>"u"?(Pt+=1,`resize-handle-server-${Pt}`):`resize-handle-${Date.now()}-${Math.random().toString(36).substr(2,5)}`,vt=(e,t)=>{try{localStorage.setItem(`panel-layout-${e}`,JSON.stringify(t))}catch(o){console.warn("Failed to save panel layout:",o)}},wt=e=>{try{const t=localStorage.getItem(`panel-layout-${e}`);return t?JSON.parse(t):null}catch(t){return console.warn("Failed to load panel layout:",t),null}},Pe=e=>e.map(t=>({id:t.id,size:t.size,percentageSize:t.percentageSize,preferredPercentageSize:t.preferredPercentageSize,sizeBeforeCollapse:t.sizeBeforeCollapse,percentageSizeBeforeCollapse:t.percentageSizeBeforeCollapse,preferredPercentageSizeBeforeCollapse:t.preferredPercentageSizeBeforeCollapse,measuredPercentageSize:t.measuredPercentageSize,excludeFromAutoGrowth:t.excludeFromAutoGrowth??!1,collapsed:t.collapsed??!1,collapseFromStart:t.collapseFromStart,collapseFromEnd:t.collapseFromEnd,collapsedByDirection:t.collapsedByDirection??null})),Ze=e=>e?Pe([e])[0]:null,Ae=e=>e?!!(e.collapseFromStart||e.collapseFromEnd):!1,nt=(e,t)=>{if(!Number.isFinite(t)||t<=0)return e;const o=e.map(a=>({...a})),i=[];for(let a=0;a<o.length;a+=1){const g=o[a];if(g.collapsed){o[a]={...g,size:0,percentageSize:0};continue}const l=Math.max(0,se(g.minSize,0,t)),c=Math.max(0,se(g.autoMinSize,0,t)),d=Math.max(l,c),S=Math.max(.001,d),P=se(g.maxSize,t,t),y=Math.max(d,P),M=g.sizeUnit==="pixels"||g.originalPixelSize!==void 0,v=Math.max(0,g.size);let E=d;if(M){const D=g.preferredPixelSize??g.size??g.originalPixelSize??d;E=Se(D,d,y)}else{const D=g.preferredPercentageSize??g.percentageSize??be(g.size,t),q=De(D,t);E=Se(q,d,y)}const C=!M&&(g.excludeFromAutoGrowth??!1)&&v<=S;i.push({index:a,isPixelPanel:M,minSize:d,maxSize:y,preferredSize:E,priority:g.pixelAdjustPriority??a+1,flexPriority:M?void 0:g.flexAdjustPriority,excludeFromGrowth:C})}if(i.length===0)return o;const r=new Map;let s=0;for(const a of i)r.set(a.index,a.minSize),s+=a.minSize;let n=t-s;const u=(a,g)=>{if(g<=0)return 0;const l=r.get(a.index)??a.minSize,c=Math.max(0,a.maxSize-l);if(c<=0)return 0;const d=Math.min(g,c);return r.set(a.index,l+d),d};if(n>0){const a=l=>{for(;n>1e-6;){let d=0;const S=[];for(const M of l){if(!M.isPixelPanel&&M.excludeFromGrowth)continue;const v=r.get(M.index)??M.minSize,E=Math.min(M.preferredSize,M.maxSize),C=Math.max(0,E-v);C>1e-6&&(d+=C,S.push({descriptor:M,capacity:C}))}if(S.length===0||d<=1e-6)break;let P=0;const y=n;for(const M of S){if(n<=1e-6)break;if(!M.descriptor.isPixelPanel&&M.descriptor.excludeFromGrowth)continue;const v=y*M.capacity/d,E=Math.min(M.capacity,v);if(E<=0)continue;const C=u(M.descriptor,E);C>0&&(n-=C,P+=C)}if(P<=1e-6)break}},g=i.filter(l=>l.isPixelPanel);g.sort((l,c)=>c.priority-l.priority);for(const l of g){if(n<=0)break;const c=r.get(l.index)??l.minSize,d=Math.min(l.preferredSize,l.maxSize),S=Math.max(0,d-c);if(S<=0)continue;const P=u(l,Math.min(S,n));P>0&&(n-=P)}if(n>0){const l=i.filter(c=>!c.isPixelPanel);if(l.length>0){const c=l.filter(d=>d.flexPriority!==void 0&&!d.excludeFromGrowth);if(c.length>0){c.sort((d,S)=>(S.flexPriority??0)-(d.flexPriority??0));for(const d of c){if(n<=0)break;if(d.excludeFromGrowth)continue;const S=r.get(d.index)??d.minSize,P=Math.min(d.preferredSize,d.maxSize),y=Math.max(0,P-S);if(y<=0)continue;const M=u(d,Math.min(y,n));M>0&&(n-=M)}}if(n>0){const d=c.length>0?l.filter(S=>S.flexPriority===void 0&&!S.excludeFromGrowth):l.filter(S=>!S.excludeFromGrowth);d.length>0&&a(d)}}}}if(n>0){let a=n;for(;;){let g=0;const l=[];for(const d of i){if(!d.isPixelPanel&&d.excludeFromGrowth)continue;const S=r.get(d.index)??d.minSize,P=d.isPixelPanel?Math.min(d.maxSize,d.preferredSize):d.maxSize,y=Math.max(0,P-S);y>0&&(l.push(d),g+=y)}if(g<=0)break;const c=n;for(const d of l){if(n<=0)break;if(!d.isPixelPanel&&d.excludeFromGrowth)continue;const S=r.get(d.index)??d.minSize,P=d.isPixelPanel?Math.min(d.maxSize,d.preferredSize):d.maxSize,y=Math.max(0,P-S);if(y<=0)continue;const M=c*y/g,v=u(d,Math.min(y,M));v>0&&(n-=v)}if(n<=1e-6||Math.abs(a-n)<=1e-6)break;a=n}n=Math.max(0,n)}if(n<0){let a=n;const g=i.filter(l=>l.isPixelPanel);for(g.sort((l,c)=>l.priority-c.priority);!(n>=0);){let l=!1;for(const c of g){if(n>=0)break;const d=r.get(c.index)??c.minSize,S=Se(c.preferredSize,c.minSize,c.maxSize),P=Math.max(0,d-S);if(P>0&&n<0){const M=Math.min(P,Math.abs(n));r.set(c.index,d-M),n+=M,l=!0;continue}const y=Math.max(0,d-c.minSize);if(y>0&&n<0){const M=Math.min(y,Math.abs(n));r.set(c.index,d-M),n+=M,l=!0}}if(!l||Math.abs(a-n)<=1e-6)break;a=n}}for(const a of i){const g=r.get(a.index)??a.minSize,l=o[a.index],c=Ae(l),d=c?g:l.sizeBeforeCollapse,S=c?l.measuredPixelSizeBeforeCollapse??l.measuredPixelSize??g:l.measuredPixelSizeBeforeCollapse,P=t>0?be(g,t):0;o[a.index]={...l,size:g,percentageSize:P,preferredPercentageSize:l.preferredPercentageSize,preferredPixelSize:a.isPixelPanel?l.preferredPixelSize??g:l.preferredPixelSize,sizeBeforeCollapse:d,measuredPixelSizeBeforeCollapse:S,measuredPixelSize:void 0,measuredPercentageSize:void 0}}return _e(o)},_e=e=>{let t=0;for(const r of e)r.collapsed||(t+=Math.max(r.size,0));if(t<=0){let r=!1;const s=e.map(n=>(n.percentageSize??0)!==0?(r=!0,{...n,percentageSize:0,measuredPercentageSize:n.measuredPercentageSize!==void 0?0:n.measuredPercentageSize}):!n.collapsed&&n.sizeBeforeCollapse!==n.size?(r=!0,{...n,sizeBeforeCollapse:n.size}):n);return r?s:e}let o=!1;const i=e.map(r=>{if(r.collapsed)return(r.percentageSize??0)!==0?(o=!0,{...r,percentageSize:0,measuredPercentageSize:r.measuredPercentageSize!==void 0?0:r.measuredPercentageSize}):r;const s=be(r.size,t),n=r.measuredPercentageSize,g=(n!==void 0?Math.abs(n-s):1/0)<1e-4&&n!==void 0?n:s,l=ut(g,xt),d=Math.abs((r.percentageSize??0)-l)>0||r.percentageSize===void 0,S=r.sizeBeforeCollapse===void 0||r.sizeBeforeCollapse!==r.size,P=Ae(r),y=P&&S,M=r.measuredPixelSize??r.size,v=P&&(r.measuredPixelSizeBeforeCollapse===void 0||r.measuredPixelSizeBeforeCollapse!==M);if(!(d||y||v))return r;o=!0;const E=y?r.size:r.sizeBeforeCollapse,C=v?M:r.measuredPixelSizeBeforeCollapse;return{...r,percentageSize:l,sizeBeforeCollapse:E,measuredPixelSizeBeforeCollapse:C,collapsedByDirection:r.collapsed?r.collapsedByDirection??null:null}});return o?i:e},Qe=(e,t)=>{if(t<=0)return!1;const o=[];let i=0;for(let l=0;l<e.length;l+=1){const c=e[l];!c||c.collapsed||(o.push(l),i+=c.size)}if(o.length===0)return!1;let r=t-i;if(Math.abs(r)<=0)return!1;let s=!1;const n=l=>{const c=e[l],d=se(c.minSize,0,t),S=se(c.autoMinSize,0,t),P=Math.max(d,S),y=se(c.maxSize,t,t),M=c.sizeUnit==="percentage"&&c.originalPixelSize===void 0;return{index:l,minSize:P,maxSize:y,isFlexible:M}},u=(l,c)=>{if(!Number.isFinite(c)||Math.abs(c)<=0)return;const d=e[l];if(!d)return;const S=Math.max(0,d.size+c);if(Math.abs(S-d.size)<=0)return;const P=be(S,t),y=Ae(d),M=y?S:d.sizeBeforeCollapse,v=y?d.measuredPixelSizeBeforeCollapse??d.measuredPixelSize??S:d.measuredPixelSizeBeforeCollapse;e[l]={...d,size:S,percentageSize:P,sizeBeforeCollapse:M,measuredPixelSizeBeforeCollapse:v,measuredPixelSize:void 0,measuredPercentageSize:void 0},r-=c,s=!0},a=l=>{for(const c of l){if(Math.abs(r)<=0)break;const d=e[c.index];if(!d||d.collapsed)continue;const S=d.size;if(r>0){const P=Math.max(0,c.maxSize-S);if(P<=0)continue;const y=Math.min(P,r);if(y<=0)continue;u(c.index,y)}else{const P=Math.max(0,S-c.minSize);if(P<=0)continue;const y=Math.min(P,Math.abs(r));if(y<=0)continue;u(c.index,-y)}}},g=o.map(l=>n(l)).filter(l=>l.isFlexible);if(g.length>0&&a(g),Math.abs(r)>0){const l=r;r=St(e,r,t,{enforceAutoMinSize:!0}),Math.abs(r-l)>0&&(s=!0)}return s},Ct=(e,t,o)=>{if(!(e.sizeUnit==="pixels"||e.originalPixelSize!==void 0)||e.pixelAdjustPriority!==void 0)return e;const r=t.filter((n,u)=>u!==o&&(n.sizeUnit==="pixels"||n.originalPixelSize!==void 0)).map(n=>n.pixelAdjustPriority).filter(n=>n!==void 0),s=r.length>0?Math.max(...r)+1:1;return{...e,pixelAdjustPriority:s}},or=(e,t)=>{switch(t.type){case"REGISTER_PANEL":{console.log("REGISTER_PANEL",t.panel);const o=e.findIndex(s=>s.id===t.panel.id);if(o>=0){const s=[...e],n=e[o],u={...n,minSize:t.panel.minSize,maxSize:t.panel.maxSize,collapseFromStart:t.panel.collapseFromStart,collapseFromEnd:t.panel.collapseFromEnd,collapsedByDirection:t.panel.collapsedByDirection!==void 0?t.panel.collapsedByDirection:n.collapsedByDirection,sizeUnit:t.panel.sizeUnit,originalPixelSize:t.panel.originalPixelSize,preferredPercentageSize:t.panel.preferredPercentageSize!==void 0?t.panel.preferredPercentageSize:n.preferredPercentageSize,preferredPercentageSizeBeforeCollapse:t.panel.preferredPercentageSizeBeforeCollapse!==void 0?t.panel.preferredPercentageSizeBeforeCollapse:n.preferredPercentageSizeBeforeCollapse,percentageSizeBeforeCollapse:t.panel.percentageSizeBeforeCollapse!==void 0?t.panel.percentageSizeBeforeCollapse:n.percentageSizeBeforeCollapse,pixelAdjustPriority:t.panel.pixelAdjustPriority!==void 0?t.panel.pixelAdjustPriority:n.pixelAdjustPriority,autoMinSize:t.panel.autoMinSize!==void 0?t.panel.autoMinSize:n.autoMinSize,excludeFromAutoGrowth:t.panel.excludeFromAutoGrowth!==void 0?t.panel.excludeFromAutoGrowth:n.excludeFromAutoGrowth},a=Ct(u,e,o);return console.log("[resize-panels] register panel (update)",{panelId:a.id,incoming:Ze(t.panel),previous:Ze(n),next:Ze(a)}),s[o]=a,s}const i={...t.panel},r=Ct(i,e);return console.log("[resize-panels] register panel (insert)",{panelId:r.id,incoming:Ze(r),previousLength:e.length}),[...e,r]}case"UNREGISTER_PANEL":{console.log("UNREGISTER_PANEL",t.id);const o=e.filter(r=>r.id!==t.id),i=_e(o);return console.log("[resize-panels] unregister panel",{panelId:t.id,previous:Pe(e),filtered:Pe(o),next:Pe(i)}),i}case"RESIZE_PANELS":{console.log("RESIZE_PANELS",t.leftId,t.rightId,t.leftSize,t.rightSize);const o=e.findIndex(z=>z.id===t.leftId),i=e.findIndex(z=>z.id===t.rightId);if(o===-1||i===-1)return e;const r=[...e],s=r[o],n=r[i];if(s.collapsed||n.collapsed||t.leftSize===s.size&&t.rightSize===n.size)return e;const u=t.containerSize??e.reduce((z,h)=>z+h.size,0),a=se(s.minSize,0,u),g=se(s.maxSize,u,u),l=se(n.minSize,0,u),c=se(n.maxSize,u,u),d=s.size+n.size,S=e.reduce((z,h)=>h.collapsed?z:z+h.size,0),P=S-d,y=a+l,M=g+c,v=Se(t.leftSize+t.rightSize,y,M);let E=u>0?u-P:v;Number.isFinite(E)||(E=v);const C=Se(Math.max(v,E),y,M),D=z=>({min:Math.max(a,z-c),max:Math.min(g,z-l)}),q=z=>({min:Math.max(l,z-g),max:Math.min(c,z-a)}),ee=Math.abs(t.leftSize-s.size),K=Math.abs(t.rightSize-n.size),w=ee>=K;let L=s.size,X=n.size;if(w){const z=D(C);if(z.min>z.max)return e;const h=Se(t.leftSize,z.min,z.max),b=C-h;if(b<l||b>c)return e;L=h,X=b}else{const z=q(C);if(z.min>z.max)return e;const h=Se(t.rightSize,z.min,z.max),b=C-h;if(b<a||b>g)return e;X=h,L=b}const ne=L+X;if(C!==ne)return e;const W=S-s.size-n.size+ne,V=u>0?u:W,ae=V>0?be(L,V):0,k=V>0?be(X,V):0,T=s.sizeUnit==="pixels"||s.originalPixelSize!==void 0?L:s.preferredPixelSize,J=n.sizeUnit==="pixels"||n.originalPixelSize!==void 0?X:n.preferredPixelSize,R=se(s.autoMinSize,0,u),me=se(n.autoMinSize,0,u),ze=Math.max(.001,R),p=Math.max(.001,me),B=s.sizeUnit==="percentage"&&s.originalPixelSize===void 0,O=n.sizeUnit==="percentage"&&n.originalPixelSize===void 0;let H=s.excludeFromAutoGrowth,fe=n.excludeFromAutoGrowth;B&&(L<=ze?H=!0:L>ze&&(H=!1)),O&&(X<=p?fe=!0:X>p&&(fe=!1));const ge=Ae(s),f=Ae(n);return r[o]={...s,size:L,percentageSize:ae,preferredPercentageSize:ae>0?ae:s.preferredPercentageSize,preferredPixelSize:T,sizeBeforeCollapse:ge?L:s.sizeBeforeCollapse,measuredPixelSize:void 0,measuredPercentageSize:void 0,excludeFromAutoGrowth:H},r[i]={...n,size:X,percentageSize:k,preferredPercentageSize:k>0?k:n.preferredPercentageSize,preferredPixelSize:J,sizeBeforeCollapse:f?X:n.sizeBeforeCollapse,measuredPixelSize:void 0,measuredPercentageSize:void 0,excludeFromAutoGrowth:fe},u>0&&Qe(r,u)?_e(r):r}case"SET_PANELS":{console.log("SET_PANELS",t.panels);const o=t.panels.map(a=>{const g=a.sizeUnit==="pixels"||a.originalPixelSize!==void 0,l=a.preferredPercentageSize!==void 0?a.preferredPercentageSize:a.percentageSize,c=a.preferredPixelSize!==void 0?a.preferredPixelSize:g?a.size:a.preferredPixelSize;return{...a,preferredPercentageSize:l,preferredPixelSize:c}}),i=Pe(e),r=Pe(o),s=_e(o),n=Pe(s);let u=i.length===n.length;if(u)for(let a=0;a<n.length;a+=1){const g=n[a],l=i[a];if(!l){u=!1;break}if(!(l.id===g.id&&l.size===g.size&&l.percentageSize===g.percentageSize&&l.sizeBeforeCollapse===g.sizeBeforeCollapse&&l.measuredPercentageSize===g.measuredPercentageSize&&l.collapsed===g.collapsed)){u=!1;break}}return u?(console.log("[resize-panels] set panels skipped (no diff)",{previous:i,incoming:r,next:n,previousLength:i.length,incomingLength:r.length}),e):(console.log("[resize-panels] set panels",{previous:i,incoming:r,next:n,previousLength:i.length,incomingLength:r.length}),s)}case"CONTAINER_RESIZED":{if(console.log("CONTAINER_RESIZED",t.containerSize),t.containerSize<=0)return console.log("[resize-panels] container resized skipped (non-positive size)",{containerSize:t.containerSize,panels:Pe(e)}),e;console.log("[resize-panels] container resized (before)",{containerSize:t.containerSize,panels:Pe(e)});const o=nt(e,t.containerSize);if(console.log("[resize-panels] container resized (after recalc)",{containerSize:t.containerSize,panels:Pe(o)}),t.containerSize>0&&Qe(o,t.containerSize)){const i=_e(o);return console.log("[resize-panels] container resized (after reconcile)",{containerSize:t.containerSize,panels:Pe(i)}),i}return console.log("[resize-panels] container resized (final)",{containerSize:t.containerSize,panels:Pe(o)}),o}case"COLLAPSE_PANEL":{console.log("COLLAPSE_PANEL",t.id);const o=e.findIndex(d=>d.id===t.id);if(o===-1)return e;const i=e[o],r=t.from==="start"?i.collapseFromStart:i.collapseFromEnd;if(!(Ae(i)&&r)||i.collapsed)return e;const n=i.size,u=i.measuredPixelSize??n,a=i.percentageSize??i.preferredPercentageSize??0,g={...i,collapsed:!0,collapsedByDirection:t.from,sizeBeforeCollapse:n,percentageSizeBeforeCollapse:a,preferredPercentageSizeBeforeCollapse:i.preferredPercentageSize??a,preferredPixelSizeBeforeCollapse:i.preferredPixelSize??n,measuredPixelSizeBeforeCollapse:u,size:0,percentageSize:0,preferredPercentageSize:i.preferredPercentageSize,measuredPixelSize:i.measuredPixelSize!==void 0?0:i.measuredPixelSize,measuredPercentageSize:i.measuredPercentageSize!==void 0?0:i.measuredPercentageSize},l=[...e];l[o]=g;const c=nt(l,t.containerSize);return t.containerSize>0&&Qe(c,t.containerSize)?_e(c):c}case"EXPAND_PANEL":{console.log("EXPAND_PANEL",t.id,t.targetSize);const o=e.findIndex(C=>C.id===t.id);if(o===-1)return e;const i=t.containerSize,r=e[o],s=t.from==="start"?r.collapseFromStart:r.collapseFromEnd;if(!(Ae(r)&&s)||!r.collapsed||r.collapsedByDirection&&r.collapsedByDirection!==t.from)return e;const u=[t.targetSize,r.sizeBeforeCollapse,r.measuredPixelSizeBeforeCollapse,r.preferredPixelSizeBeforeCollapse,r.originalPixelSize].find(C=>C!==void 0)??0,a=se(r.minSize,0,i),g=se(r.maxSize,i,i),l=Se(u,a,g),c=be(l,i),d=r.measuredPixelSizeBeforeCollapse??l,S=be(d,i),P=r.preferredPercentageSizeBeforeCollapse??r.percentageSizeBeforeCollapse??c,y=r.preferredPixelSizeBeforeCollapse??r.preferredPixelSize??l,M={...r,collapsed:!1,collapsedByDirection:null,size:l,percentageSize:c,preferredPercentageSize:P,preferredPixelSize:y,sizeBeforeCollapse:l,percentageSizeBeforeCollapse:void 0,preferredPercentageSizeBeforeCollapse:void 0,preferredPixelSizeBeforeCollapse:void 0,measuredPixelSize:l,measuredPixelSizeBeforeCollapse:d,measuredPercentageSize:S},v=[...e];v[o]=M;const E=nt(v,i);return i>0&&Qe(E,i)?_e(E):E}default:return e}},Et=({direction:e,style:t,onLayout:o,autoSaveId:i,showDebugInfo:r=!1})=>{const[s,n]=x.useReducer(or,[]),[u,a]=x.useState({width:0,height:0}),[g,l]=x.useState(!1),[c,d]=x.useState(!1),[S,P]=x.useState(null),[y,M]=x.useState({}),[v,E]=x.useState({}),C=x.useRef(null),D=x.useRef(o),q=x.useRef(!1),ee=x.useRef(0),K=x.useRef(u),w=x.useRef(u),L=x.useRef(g),X=x.useRef(S?.reason??null),ne=x.useRef({}),W=x.useRef(null),V=x.useRef(null),ae=x.useCallback(f=>f.map(z=>({...z})),[]);x.useEffect(()=>{w.current=u},[u]),x.useEffect(()=>{L.current=g},[g]),x.useEffect(()=>{X.current=S?.reason??null},[S?.reason]),x.useEffect(()=>{if(S)return;const f=e==="horizontal"?u.width:u.height;!Number.isFinite(f)||f<=4||s.length!==0&&(W.current=ae(s))},[S,s,e,u.width,u.height,ae]),x.useEffect(()=>{const f=V.current;if(S){V.current=S;return}if(f&&!S&&W.current){V.current=null;const z=ae(W.current);n({type:"SET_PANELS",panels:z});return}V.current=S},[S,ae]),x.useLayoutEffect(()=>{if(!C.current)return;const f=new ResizeObserver(z=>{for(const h of z){const b=h.target,N=b?ke(b,"horizontal"):null,Y=b?ke(b,"vertical"):null,re=N?N.inner:0,U=Y?Y.inner:0,$=h.contentRect.width,Z=h.contentRect.height,j=re>0?re:$,F=U>0?U:Z;a(oe=>(!g&&j>0&&F>0&&l(!0),oe.width===j&&oe.height===F?oe:{width:j,height:F}))}});return f.observe(C.current),()=>f.disconnect()},[g]),x.useLayoutEffect(()=>{const f=K.current,z=u,h=e==="horizontal"?Math.abs(f.width-z.width)>0:Math.abs(f.height-z.height)>0;if(c&&h){const b=e==="horizontal"?z.width:z.height;n({type:"CONTAINER_RESIZED",containerSize:b,direction:e})}K.current=z},[u,c,e]);const k=x.useCallback(()=>{console.log("panels[0]?.id",s[0]?.id);const f=s.some(m=>{if(m.collapsed||m.sizeUnit!=="percentage")return!1;const ie=m.collapseFromStart||m.collapseFromEnd?m.sizeBeforeCollapse??m.measuredPixelSizeBeforeCollapse??m.originalPixelSize??m.measuredPixelSize??0:m.measuredPixelSize??m.originalPixelSize??m.size,te=m.percentageSize!==void 0&&m.percentageSize>0;return m.size<=0&&(ie>0||te)}),z=e==="horizontal"?u.width:u.height,h=z>0;if(S||!h||!(s.length>0&&(s.length!==ee.current||!c||f)))return;const Y=s.filter(m=>!m.collapsed&&(m.originalPixelSize!==void 0||m.sizeUnit==="pixels")).reduce((m,G)=>{const ie=G.preferredPixelSize??G.originalPixelSize??G.size;return m+Math.max(0,ie??0)},0),re=s.filter(m=>m.sizeUnit==="percentage"&&!m.collapsed),U=re.map(m=>m.id),$=re.map(m=>{const G=m.preferredPercentageSize??m.percentageSize;return G!==void 0&&G>0?De(G,z):m.size>0?m.size:0}),Z=$.reduce((m,G)=>m+G,0),j=z-Y,F=Math.max(0,j),oe=F>0,pe=s.map(m=>{if(m.collapsed){const G=m.sizeBeforeCollapse??m.measuredPixelSizeBeforeCollapse??m.originalPixelSize??(m.sizeUnit==="pixels"?m.size:void 0),ie=m.sizeUnit==="percentage"&&m.percentageSize!==void 0?De(m.percentageSize,z):void 0,te=G??ie??0,he=m.measuredPixelSizeBeforeCollapse??m.measuredPixelSize??te;return{...m,size:0,percentageSize:0,preferredPercentageSize:m.preferredPercentageSize,sizeBeforeCollapse:te,percentageSizeBeforeCollapse:m.percentageSizeBeforeCollapse??m.percentageSize??m.preferredPercentageSize??0,preferredPercentageSizeBeforeCollapse:m.preferredPercentageSizeBeforeCollapse??m.preferredPercentageSize??m.percentageSize??void 0,preferredPixelSizeBeforeCollapse:m.preferredPixelSizeBeforeCollapse??m.preferredPixelSize??te,measuredPixelSizeBeforeCollapse:he}}if(m.sizeUnit==="pixels"||m.originalPixelSize!==void 0){const G=m.size,ie=z>0?be(G,z):0,te={...m,size:G,percentageSize:ie,preferredPixelSize:m.preferredPixelSize??m.originalPixelSize??G,preferredPercentageSize:m.preferredPercentageSize!==void 0?m.preferredPercentageSize:ie>0?ie:void 0};if(m.collapseFromStart||m.collapseFromEnd){const he=m.sizeBeforeCollapse??G,we=m.measuredPixelSizeBeforeCollapse??m.measuredPixelSize??he;te.sizeBeforeCollapse=he,te.measuredPixelSizeBeforeCollapse=we,te.preferredPixelSizeBeforeCollapse=m.preferredPixelSizeBeforeCollapse??m.preferredPixelSize??he}return te}if(m.sizeUnit==="percentage"){const G=U.indexOf(m.id),ie=G!==-1?$[G]:0,te=se(m.minSize,0,z),he=se(m.maxSize,z,z),we=Math.max(te,m.sizeBeforeCollapse??0,m.measuredPixelSizeBeforeCollapse??0,m.measuredPixelSize??0,m.originalPixelSize??0,m.size>0?m.size:0,m.percentageSize!==void 0?De(m.percentageSize,z):0,1),Re=ie>0?ie:we;let ye;if(!oe)ye=te;else if(G!==-1&&Z>0){const Ce=Re/Z,Ne=F*Ce;ye=Se(Ne,te,he)}else{const Ce=m.percentageSize!==void 0?De(m.percentageSize,z):m.size,Ne=Ce>0?Ce:Re;ye=Se(Ne,te,he)}const Be=z>0?be(ye,z):0,Te={...m,size:ye,percentageSize:Be,preferredPercentageSize:m.preferredPercentageSize!==void 0?m.preferredPercentageSize:Be>0?Be:void 0};if(m.collapseFromStart||m.collapseFromEnd){const Ce=m.sizeBeforeCollapse??ye,Ne=m.measuredPixelSizeBeforeCollapse??m.measuredPixelSize??Ce;Te.sizeBeforeCollapse=Ce,Te.measuredPixelSizeBeforeCollapse=Ne,Te.preferredPixelSizeBeforeCollapse=m.preferredPixelSizeBeforeCollapse??m.preferredPixelSize??Ce}return Te}return m}),le=[];for(let m=0;m<pe.length;m+=1){const G=pe[m];G.sizeUnit==="percentage"&&!G.collapsed&&le.push(m)}const ce=le.reduce((m,G)=>m+pe[G].size,0),de=j-ce;Math.abs(de)>0&&St(pe,de,z,{enforceAutoMinSize:!0}),n({type:"SET_PANELS",panels:pe}),ee.current=s.length,d(!0)},[s,e,u.width,u.height,c,S]);x.useEffect(()=>{const f=e==="horizontal"?u.width:u.height,z=f>0,h=z&&s.length>0,b=h?s.reduce((Z,j)=>{if(j.collapsed)return Z;const F=se(j.minSize,0,f);return Z+Math.max(0,F)},0):null,N=h?s.reduce((Z,j)=>{if(j.collapsed)return Z;const F=se(j.maxSize,f,f);return Z+Math.max(0,F)},0):null,Y=b??S?.totalMinimumSize??null,re=N??S?.totalMaximumSize??null;if(!z){S&&P(Z=>!Z||Z.availableContainerSize===f?Z:{reason:Z.reason,totalMinimumSize:null,totalMaximumSize:null,availableContainerSize:f});return}const U=Y!==null&&Y-f>Number.EPSILON,$=re!==null&&f-re>Number.EPSILON;if(U||$){const j={reason:U?"minimum-exceeded":"maximum-insufficient",totalMinimumSize:Y,totalMaximumSize:re,availableContainerSize:f};P(F=>F&&F.reason===j.reason&&Math.abs((F.totalMinimumSize??0)-(j.totalMinimumSize??0))<=Number.EPSILON&&Math.abs((F.totalMaximumSize??0)-(j.totalMaximumSize??0))<=Number.EPSILON&&Math.abs(F.availableContainerSize-j.availableContainerSize)<=Number.EPSILON?F:j);return}if(S){const Z=S.reason==="minimum-exceeded",j=S.reason==="maximum-insufficient";(!Z||Y!==null)&&(!j||re!==null)&&!U&&!$&&P(ce=>ce&&null)}},[s,e,u.width,u.height,S]),x.useEffect(()=>{k()},[k]),x.useEffect(()=>{D.current=o},[o]);const T=x.useMemo(()=>s.map(f=>f.size),[s]);x.useLayoutEffect(()=>{T.length>0&&D.current&&D.current(T)},[T]),x.useEffect(()=>{if(i&&T.length>0){const f=setTimeout(()=>{vt(i,T)},200);return()=>clearTimeout(f)}},[i,T]),x.useEffect(()=>{if(!i||s.length===0||q.current)return;const f=e==="horizontal"?u.width:u.height;if(f<=0)return;const z=wt(i);if(z&&z.length===s.length){const h=s.map((b,N)=>{const Y=se(b.minSize,0,f),re=se(b.maxSize,f,f),U=Se(z[N],Y,re),$=be(U,f),Z=b.sizeUnit==="pixels"||b.originalPixelSize!==void 0?U:b.preferredPixelSize;return{...b,size:U,percentageSize:$,preferredPercentageSize:$>0?$:b.preferredPercentageSize,preferredPixelSize:Z}});n({type:"SET_PANELS",panels:h}),q.current=!0}},[i,s,u.width,u.height,e]);const J=x.useCallback(f=>{const z=w.current,h=ne.current,b=JSON.stringify({id:f.id,size:f.size??null,percentageSize:f.percentageSize??null,preferredPercentageSize:f.preferredPercentageSize??null,preferredPixelSize:f.preferredPixelSize??null,sizeUnit:f.sizeUnit,originalPixelSize:f.originalPixelSize??null,minSize:f.minSize??null,maxSize:f.maxSize??null,collapseFromStart:f.collapseFromStart,collapseFromEnd:f.collapseFromEnd,collapsed:f.collapsed??!1,collapsedByDirection:f.collapsedByDirection??null,sizeBeforeCollapse:f.sizeBeforeCollapse??null,percentageSizeBeforeCollapse:f.percentageSizeBeforeCollapse??null,preferredPercentageSizeBeforeCollapse:f.preferredPercentageSizeBeforeCollapse??null,preferredPixelSizeBeforeCollapse:f.preferredPixelSizeBeforeCollapse??null,pixelAdjustPriority:f.pixelAdjustPriority??null});if(h[f.id]===b){console.log("[resize-panels] useResizablePanels.registerPanel skipped",{panelId:f.id,reason:"duplicate-registration"});return}h[f.id]=b,console.log("[resize-panels] useResizablePanels.registerPanel",{panelId:f.id,containerReady:L.current,violationReason:X.current,containerSize:{width:z.width,height:z.height}}),n({type:"REGISTER_PANEL",panel:f})},[]),R=x.useCallback(f=>{const z=w.current;console.log("[resize-panels] useResizablePanels.unregisterPanel",{panelId:f,containerReady:L.current,violationReason:X.current,containerSize:{width:z.width,height:z.height}}),n({type:"UNREGISTER_PANEL",id:f}),delete ne.current[f],M(h=>{if(!(f in h))return h;const b={...h};return delete b[f],b})},[]),me=x.useCallback((f,z,h,b)=>{const N=e==="horizontal"?u.width:u.height,Y=s.find(ce=>ce.id===f),re=s.find(ce=>ce.id===z);if(!(Y&&re)){n({type:"RESIZE_PANELS",leftId:f,rightId:z,leftSize:h,rightSize:b,containerSize:N});return}if(Y.collapsed||re.collapsed)return;const U=se(Y.minSize,0,N),$=se(Y.maxSize,N,N),Z=se(re.minSize,0,N),j=se(re.maxSize,N,N);let F=Se(h,U,$),oe=Se(b,Z,j);const pe=F+oe,le=h+b;if(pe!==le){const ce=le-pe;if(ce>0){const de=$-F,m=j-oe,G=de+m;if(G>0){const ie=Math.min(ce*(de/G),de),te=Math.min(ce-ie,m);F+=ie,oe+=te}}else if(ce<0){const de=Math.abs(ce),m=F-U,G=oe-Z,ie=m+G;if(ie>0){const te=Math.min(de*(m/ie),m),he=Math.min(de-te,G);F-=te,oe-=he}}}F=Se(F,U,$),oe=Se(oe,Z,j),console.assert(F+oe===le,"Total size after constraints should be close to the original total size.",{constrainedLeftSize:F,constrainedRightSize:oe,originalTotalSize:le}),n({type:"RESIZE_PANELS",leftId:f,rightId:z,leftSize:F,rightSize:oe,containerSize:N})},[e,u.width,u.height,s]),ze=x.useCallback((f,z)=>{const h=e==="horizontal"?u.width:u.height;n({type:"COLLAPSE_PANEL",id:f,from:z,containerSize:h})},[e,u.width,u.height]),p=x.useCallback((f,z,h)=>{const b=e==="horizontal"?u.width:u.height;n({type:"EXPAND_PANEL",id:f,from:z,containerSize:b,targetSize:h})},[e,u.width,u.height]),B=x.useCallback(f=>s.find(z=>z.id===f),[s]),O=x.useCallback((f,z)=>{M(h=>{if(z===null){if(!(f in h))return h;const N={...h};return delete N[f],N}const b=h[f];return b&&b.pixelSize===z.pixelSize&&b.percentageSize===z.percentageSize?h:{...h,[f]:z}})},[]),H=x.useCallback((f,z)=>{E(h=>{if(z===null){if(!(f in h))return h;const N={...h};return delete N[f],N}const b=h[f];return b&&Math.abs(b.thickness-z.thickness)<=.25&&b.visible===z.visible&&b.direction===z.direction&&b.startPanelId===z.startPanelId&&b.endPanelId===z.endPanelId?h:{...h,[f]:z}})},[]),fe=x.useMemo(()=>({direction:e,panels:s,containerSize:u,isContainerReady:g,showDebugInfo:r,registerPanel:J,unregisterPanel:R,resizePanels:me,collapsePanel:ze,expandPanel:p,getPanel:B,reportPanelMeasurement:O,panelMeasurements:y,reportHandleMeasurement:H,handleMeasurements:v,layoutConstraintViolation:S}),[e,s,u,g,r,J,R,me,ze,p,B,O,y,H,v,S]),ge=x.useMemo(()=>({display:"flex",flexDirection:e==="horizontal"?"row":"column",alignItems:"stretch",width:"100%",height:"100%",minWidth:"0px",minHeight:"0px",position:"relative",overflow:"hidden",...t}),[e,t]);return{groupRef:C,contextValue:fe,groupStyle:ge}},ir=e=>{const{getPanel:t,collapsePanel:o,expandPanel:i}=Ye(),r=t(e),s=x.useCallback(a=>{o(e,a)},[o,e]),n=x.useCallback((a,g)=>{i(e,a,g)},[i,e]),u=x.useCallback((a,g)=>{r?.collapsed?n(a,g):s(a)},[r?.collapsed,s,n]);return x.useMemo(()=>({panel:r,isCollapsed:r?.collapsed??!1,canCollapseFromStart:r?.collapseFromStart??!1,canCollapseFromEnd:r?.collapseFromEnd??!1,collapse:s,expand:n,toggle:u}),[r,s,n,u])};var Ke={exports:{}},Ge={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var bt;function qt(){if(bt)return Ae;bt=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(o,i,s){var a=null;if(s!==void 0&&(a=""+s),i.key!==void 0&&(a=""+i.key),"key"in i){s={};for(var l in i)l!=="key"&&(s[l]=i[l])}else s=i;return i=s.ref,{$$typeof:e,type:o,key:a,ref:i!==void 0?i:null,props:s}}return Ae.Fragment=t,Ae.jsx=n,Ae.jsxs=n,Ae}var Ne={};/**
9
+ */var kt;function sr(){if(kt)return Ge;kt=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(i,r,s){var n=null;if(s!==void 0&&(n=""+s),r.key!==void 0&&(n=""+r.key),"key"in r){s={};for(var u in r)u!=="key"&&(s[u]=r[u])}else s=r;return r=s.ref,{$$typeof:e,type:i,key:n,ref:r!==void 0?r:null,props:s}}return Ge.Fragment=t,Ge.jsx=o,Ge.jsxs=o,Ge}var He={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,10 +14,10 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var zt;function $t(){return zt||(zt=1,process.env.NODE_ENV!=="production"&&(function(){function e(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===K?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case g:return"Profiler";case p:return"StrictMode";case A:return"Suspense";case te:return"SuspenseList";case V:return"Activity"}if(typeof r=="object")switch(typeof r.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),r.$$typeof){case k:return"Portal";case H:return r.displayName||"Context";case _:return(r._context.displayName||"Context")+".Consumer";case X:var S=r.render;return r=r.displayName,r||(r=S.displayName||S.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case R:return S=r.displayName||null,S!==null?S:e(r.type)||"Memo";case U:S=r._payload,r=r._init;try{return e(r(S))}catch{}}return null}function t(r){return""+r}function n(r){try{t(r);var S=!1}catch{S=!0}if(S){S=console;var M=S.error,T=typeof Symbol=="function"&&Symbol.toStringTag&&r[Symbol.toStringTag]||r.constructor.name||"Object";return M.call(S,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",T),t(r)}}function o(r){if(r===w)return"<>";if(typeof r=="object"&&r!==null&&r.$$typeof===U)return"<...>";try{var S=e(r);return S?"<"+S+">":"<...>"}catch{return"<...>"}}function i(){var r=ne.A;return r===null?null:r.getOwner()}function s(){return Error("react-stack-top-frame")}function a(r){if(J.call(r,"key")){var S=Object.getOwnPropertyDescriptor(r,"key").get;if(S&&S.isReactWarning)return!1}return r.key!==void 0}function l(r,S){function M(){N||(N=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",S))}M.isReactWarning=!0,Object.defineProperty(r,"key",{get:M,configurable:!0})}function c(){var r=e(this.type);return G[r]||(G[r]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),r=this.props.ref,r!==void 0?r:null}function P(r,S,M,T,Y,y){var b=M.ref;return r={$$typeof:C,type:r,key:S,props:M,_owner:T},(b!==void 0?b:null)!==null?Object.defineProperty(r,"ref",{enumerable:!1,get:c}):Object.defineProperty(r,"ref",{enumerable:!1,value:null}),r._store={},Object.defineProperty(r._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(r,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(r,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.defineProperty(r,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:y}),Object.freeze&&(Object.freeze(r.props),Object.freeze(r)),r}function z(r,S,M,T,Y,y){var b=S.children;if(b!==void 0)if(T)if(q(b)){for(T=0;T<b.length;T++)d(b[T]);Object.freeze&&Object.freeze(b)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(b);if(J.call(S,"key")){b=e(r);var h=Object.keys(S).filter(function(L){return L!=="key"});T=0<h.length?"{key: someKey, "+h.join(": ..., ")+": ...}":"{key: someKey}",I[b+T]||(h=0<h.length?"{"+h.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var Mt;function ar(){return Mt||(Mt=1,process.env.NODE_ENV!=="production"&&(function(){function e(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===ne?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case M:return"Fragment";case E:return"Profiler";case v:return"StrictMode";case ee:return"Suspense";case K:return"SuspenseList";case X:return"Activity"}if(typeof p=="object")switch(typeof p.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),p.$$typeof){case y:return"Portal";case D:return p.displayName||"Context";case C:return(p._context.displayName||"Context")+".Consumer";case q:var B=p.render;return p=p.displayName,p||(p=B.displayName||B.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case w:return B=p.displayName||null,B!==null?B:e(p.type)||"Memo";case L:B=p._payload,p=p._init;try{return e(p(B))}catch{}}return null}function t(p){return""+p}function o(p){try{t(p);var B=!1}catch{B=!0}if(B){B=console;var O=B.error,H=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return O.call(B,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",H),t(p)}}function i(p){if(p===M)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===L)return"<...>";try{var B=e(p);return B?"<"+B+">":"<...>"}catch{return"<...>"}}function r(){var p=W.A;return p===null?null:p.getOwner()}function s(){return Error("react-stack-top-frame")}function n(p){if(V.call(p,"key")){var B=Object.getOwnPropertyDescriptor(p,"key").get;if(B&&B.isReactWarning)return!1}return p.key!==void 0}function u(p,B){function O(){T||(T=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",B))}O.isReactWarning=!0,Object.defineProperty(p,"key",{get:O,configurable:!0})}function a(){var p=e(this.type);return J[p]||(J[p]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),p=this.props.ref,p!==void 0?p:null}function g(p,B,O,H,fe,ge){var f=O.ref;return p={$$typeof:P,type:p,key:B,props:O,_owner:H},(f!==void 0?f:null)!==null?Object.defineProperty(p,"ref",{enumerable:!1,get:a}):Object.defineProperty(p,"ref",{enumerable:!1,value:null}),p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(p,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(p,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:fe}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ge}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function l(p,B,O,H,fe,ge){var f=B.children;if(f!==void 0)if(H)if(ae(f)){for(H=0;H<f.length;H++)c(f[H]);Object.freeze&&Object.freeze(f)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else c(f);if(V.call(B,"key")){f=e(p);var z=Object.keys(B).filter(function(b){return b!=="key"});H=0<z.length?"{key: someKey, "+z.join(": ..., ")+": ...}":"{key: someKey}",ze[f+H]||(z=0<z.length?"{"+z.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,T,b,h,b),I[b+T]=!0)}if(b=null,M!==void 0&&(n(M),b=""+M),a(S)&&(n(S.key),b=""+S.key),"key"in S){M={};for(var v in S)v!=="key"&&(M[v]=S[v])}else M=S;return b&&l(M,typeof r=="function"?r.displayName||r.name||"Unknown":r),P(r,b,M,i(),Y,y)}function d(r){u(r)?r._store&&(r._store.validated=1):typeof r=="object"&&r!==null&&r.$$typeof===U&&(r._payload.status==="fulfilled"?u(r._payload.value)&&r._payload.value._store&&(r._payload.value._store.validated=1):r._store&&(r._store.validated=1))}function u(r){return typeof r=="object"&&r!==null&&r.$$typeof===C}var x=m,C=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),H=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),K=Symbol.for("react.client.reference"),ne=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=Object.prototype.hasOwnProperty,q=Array.isArray,W=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(r){return r()}};var N,G={},E=x.react_stack_bottom_frame.bind(x,s)(),ie=W(o(s)),I={};Ne.Fragment=w,Ne.jsx=function(r,S,M){var T=1e4>ne.recentlyCreatedOwnerStacks++;return z(r,S,M,!1,T?Error("react-stack-top-frame"):E,T?W(o(r)):ie)},Ne.jsxs=function(r,S,M){var T=1e4>ne.recentlyCreatedOwnerStacks++;return z(r,S,M,!0,T?Error("react-stack-top-frame"):E,T?W(o(r)):ie)}})()),Ne}var St;function en(){return St||(St=1,process.env.NODE_ENV==="production"?Ge.exports=qt():Ge.exports=$t()),Ge.exports}var D=en();const Qe="-",tn=e=>{const t=rn(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:a=>{const l=a.split(Qe);return l[0]===""&&l.length!==1&&l.shift(),Pt(l,t)||nn(a)},getConflictingClassGroupIds:(a,l)=>{const c=n[a]||[];return l&&o[a]?[...c,...o[a]]:c}}},Pt=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),i=o?Pt(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(Qe);return t.validators.find(({validator:a})=>a(s))?.classGroupId},yt=/^\[(.+)\]$/,nn=e=>{if(yt.test(e)){const t=yt.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},rn=e=>{const{theme:t,classGroups:n}=e,o={nextPart:new Map,validators:[]};for(const i in n)Ke(n[i],o,i,t);return o},Ke=(e,t,n,o)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:vt(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(on(i)){Ke(i(o),t,n,o);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{Ke(a,vt(t,s),n,o)})})},vt=(e,t)=>{let n=e;return t.split(Qe).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},on=e=>e.isThemeGetter,sn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const i=(s,a)=>{n.set(s,a),t++,t>e&&(t=0,o=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=o.get(s))!==void 0)return i(s,a),a},set(s,a){n.has(s)?n.set(s,a):i(s,a)}}},qe="!",$e=":",an=$e.length,ln=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=i=>{const s=[];let a=0,l=0,c=0,P;for(let C=0;C<i.length;C++){let k=i[C];if(a===0&&l===0){if(k===$e){s.push(i.slice(c,C)),c=C+an;continue}if(k==="/"){P=C;continue}}k==="["?a++:k==="]"?a--:k==="("?l++:k===")"&&l--}const z=s.length===0?i:i.substring(c),d=cn(z),u=d!==z,x=P&&P>c?P-c:void 0;return{modifiers:s,hasImportantModifier:u,baseClassName:d,maybePostfixModifierPosition:x}};if(t){const i=t+$e,s=o;o=a=>a.startsWith(i)?s(a.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){const i=o;o=s=>n({className:s,parseClassName:i})}return o},cn=e=>e.endsWith(qe)?e.substring(0,e.length-1):e.startsWith(qe)?e.substring(1):e,dn=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const i=[];let s=[];return o.forEach(a=>{a[0]==="["||t[a]?(i.push(...s.sort(),a),s=[]):s.push(a)}),i.push(...s.sort()),i}},un=e=>({cache:sn(e.cacheSize),parseClassName:ln(e),sortModifiers:dn(e),...tn(e)}),fn=/\s+/,pn=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:i,sortModifiers:s}=t,a=[],l=e.trim().split(fn);let c="";for(let P=l.length-1;P>=0;P-=1){const z=l[P],{isExternal:d,modifiers:u,hasImportantModifier:x,baseClassName:C,maybePostfixModifierPosition:k}=n(z);if(d){c=z+(c.length>0?" "+c:c);continue}let w=!!k,p=o(w?C.substring(0,k):C);if(!p){if(!w){c=z+(c.length>0?" "+c:c);continue}if(p=o(C),!p){c=z+(c.length>0?" "+c:c);continue}w=!1}const g=s(u).join(":"),_=x?g+qe:g,H=_+p;if(a.includes(H))continue;a.push(H);const X=i(p,w);for(let A=0;A<X.length;++A){const te=X[A];a.push(_+te)}c=z+(c.length>0?" "+c:c)}return c};function mn(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=wt(t))&&(o&&(o+=" "),o+=n);return o}const wt=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=wt(e[o]))&&(n&&(n+=" "),n+=t);return n};function gn(e,...t){let n,o,i,s=a;function a(c){const P=t.reduce((z,d)=>d(z),e());return n=un(P),o=n.cache.get,i=n.cache.set,s=l,l(c)}function l(c){const P=o(c);if(P)return P;const z=pn(c,n);return i(c,z),z}return function(){return s(mn.apply(null,arguments))}}const de=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ct=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,kt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,hn=/^\d+\/\d+$/,xn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,zn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Sn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Pn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Me=e=>hn.test(e),Q=e=>!!e&&!Number.isNaN(Number(e)),ye=e=>!!e&&Number.isInteger(Number(e)),et=e=>e.endsWith("%")&&Q(e.slice(0,-1)),Pe=e=>xn.test(e),yn=()=>!0,vn=e=>bn.test(e)&&!zn.test(e),Et=()=>!1,wn=e=>Sn.test(e),Cn=e=>Pn.test(e),kn=e=>!O(e)&&!j(e),En=e=>Re(e,At,Et),O=e=>Ct.test(e),Ce=e=>Re(e,Nt,vn),tt=e=>Re(e,An,Q),Mt=e=>Re(e,_t,Et),Mn=e=>Re(e,It,Cn),Fe=e=>Re(e,Tt,wn),j=e=>kt.test(e),Te=e=>_e(e,Nt),Rn=e=>_e(e,Nn),Rt=e=>_e(e,_t),_n=e=>_e(e,At),In=e=>_e(e,It),He=e=>_e(e,Tt,!0),Re=(e,t,n)=>{const o=Ct.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},_e=(e,t,n=!1)=>{const o=kt.exec(e);return o?o[1]?t(o[1]):n:!1},_t=e=>e==="position"||e==="percentage",It=e=>e==="image"||e==="url",At=e=>e==="length"||e==="size"||e==="bg-size",Nt=e=>e==="length",An=e=>e==="number",Nn=e=>e==="family-name",Tt=e=>e==="shadow",Oe=gn(()=>{const e=de("color"),t=de("font"),n=de("text"),o=de("font-weight"),i=de("tracking"),s=de("leading"),a=de("breakpoint"),l=de("container"),c=de("spacing"),P=de("radius"),z=de("shadow"),d=de("inset-shadow"),u=de("text-shadow"),x=de("drop-shadow"),C=de("blur"),k=de("perspective"),w=de("aspect"),p=de("ease"),g=de("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],X=()=>[...H(),j,O],A=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto","contain","none"],R=()=>[j,O,c],U=()=>[Me,"full","auto",...R()],V=()=>[ye,"none","subgrid",j,O],K=()=>["auto",{span:["full",ye,j,O]},ye,j,O],ne=()=>[ye,"auto",j,O],J=()=>["auto","min","max","fr",j,O],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...R()],G=()=>[Me,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],E=()=>[e,j,O],ie=()=>[...H(),Rt,Mt,{position:[j,O]}],I=()=>["no-repeat",{repeat:["","x","y","space","round"]}],r=()=>["auto","cover","contain",_n,En,{size:[j,O]}],S=()=>[et,Te,Ce],M=()=>["","none","full",P,j,O],T=()=>["",Q,Te,Ce],Y=()=>["solid","dashed","dotted","double"],y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],b=()=>[Q,et,Rt,Mt],h=()=>["","none",C,j,O],v=()=>["none",Q,j,O],L=()=>["none",Q,j,O],B=()=>[Q,j,O],F=()=>[Me,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Pe],breakpoint:[Pe],color:[yn],container:[Pe],"drop-shadow":[Pe],ease:["in","out","in-out"],font:[kn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Pe],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Pe],shadow:[Pe],spacing:["px",Q],text:[Pe],"text-shadow":[Pe],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Me,O,j,w]}],container:["container"],columns:[{columns:[Q,O,j,l]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:X()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:te()}],"overscroll-x":[{"overscroll-x":te()}],"overscroll-y":[{"overscroll-y":te()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{start:U()}],end:[{end:U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[ye,"auto",j,O]}],basis:[{basis:[Me,"full","auto",l,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Q,Me,"auto","initial","none",O]}],grow:[{grow:["",Q,j,O]}],shrink:[{shrink:["",Q,j,O]}],order:[{order:[ye,"first","last","none",j,O]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],w:[{w:[l,"screen",...G()]}],"min-w":[{"min-w":[l,"screen","none",...G()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[a]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",n,Te,Ce]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,j,tt]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",et,O]}],"font-family":[{font:[Rn,O,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,j,O]}],"line-clamp":[{"line-clamp":[Q,"none",j,tt]}],leading:[{leading:[s,...R()]}],"list-image":[{"list-image":["none",j,O]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",j,O]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:[Q,"from-font","auto",j,Ce]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[Q,"auto",j,O]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",j,O]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",j,O]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:I()}],"bg-size":[{bg:r()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ye,j,O],radial:["",j,O],conic:[ye,j,O]},In,Mn]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:S()}],"gradient-via-pos":[{via:S()}],"gradient-to-pos":[{to:S()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:M()}],"rounded-s":[{"rounded-s":M()}],"rounded-e":[{"rounded-e":M()}],"rounded-t":[{"rounded-t":M()}],"rounded-r":[{"rounded-r":M()}],"rounded-b":[{"rounded-b":M()}],"rounded-l":[{"rounded-l":M()}],"rounded-ss":[{"rounded-ss":M()}],"rounded-se":[{"rounded-se":M()}],"rounded-ee":[{"rounded-ee":M()}],"rounded-es":[{"rounded-es":M()}],"rounded-tl":[{"rounded-tl":M()}],"rounded-tr":[{"rounded-tr":M()}],"rounded-br":[{"rounded-br":M()}],"rounded-bl":[{"rounded-bl":M()}],"border-w":[{border:T()}],"border-w-x":[{"border-x":T()}],"border-w-y":[{"border-y":T()}],"border-w-s":[{"border-s":T()}],"border-w-e":[{"border-e":T()}],"border-w-t":[{"border-t":T()}],"border-w-r":[{"border-r":T()}],"border-w-b":[{"border-b":T()}],"border-w-l":[{"border-l":T()}],"divide-x":[{"divide-x":T()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":T()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Y(),"hidden","none"]}],"divide-style":[{divide:[...Y(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...Y(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Q,j,O]}],"outline-w":[{outline:["",Q,Te,Ce]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",z,He,Fe]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",d,He,Fe]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[Q,Ce]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":T()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",u,He,Fe]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[Q,j,O]}],"mix-blend":[{"mix-blend":[...y(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":y()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Q]}],"mask-image-linear-from-pos":[{"mask-linear-from":b()}],"mask-image-linear-to-pos":[{"mask-linear-to":b()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":b()}],"mask-image-t-to-pos":[{"mask-t-to":b()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":b()}],"mask-image-r-to-pos":[{"mask-r-to":b()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":b()}],"mask-image-b-to-pos":[{"mask-b-to":b()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":b()}],"mask-image-l-to-pos":[{"mask-l-to":b()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":b()}],"mask-image-x-to-pos":[{"mask-x-to":b()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":b()}],"mask-image-y-to-pos":[{"mask-y-to":b()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[j,O]}],"mask-image-radial-from-pos":[{"mask-radial-from":b()}],"mask-image-radial-to-pos":[{"mask-radial-to":b()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":H()}],"mask-image-conic-pos":[{"mask-conic":[Q]}],"mask-image-conic-from-pos":[{"mask-conic-from":b()}],"mask-image-conic-to-pos":[{"mask-conic-to":b()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:I()}],"mask-size":[{mask:r()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",j,O]}],filter:[{filter:["","none",j,O]}],blur:[{blur:h()}],brightness:[{brightness:[Q,j,O]}],contrast:[{contrast:[Q,j,O]}],"drop-shadow":[{"drop-shadow":["","none",x,He,Fe]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",Q,j,O]}],"hue-rotate":[{"hue-rotate":[Q,j,O]}],invert:[{invert:["",Q,j,O]}],saturate:[{saturate:[Q,j,O]}],sepia:[{sepia:["",Q,j,O]}],"backdrop-filter":[{"backdrop-filter":["","none",j,O]}],"backdrop-blur":[{"backdrop-blur":h()}],"backdrop-brightness":[{"backdrop-brightness":[Q,j,O]}],"backdrop-contrast":[{"backdrop-contrast":[Q,j,O]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Q,j,O]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Q,j,O]}],"backdrop-invert":[{"backdrop-invert":["",Q,j,O]}],"backdrop-opacity":[{"backdrop-opacity":[Q,j,O]}],"backdrop-saturate":[{"backdrop-saturate":[Q,j,O]}],"backdrop-sepia":[{"backdrop-sepia":["",Q,j,O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",j,O]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Q,"initial",j,O]}],ease:[{ease:["linear","initial",p,j,O]}],delay:[{delay:[Q,j,O]}],animate:[{animate:["none",g,j,O]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,j,O]}],"perspective-origin":[{"perspective-origin":X()}],rotate:[{rotate:v()}],"rotate-x":[{"rotate-x":v()}],"rotate-y":[{"rotate-y":v()}],"rotate-z":[{"rotate-z":v()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:B()}],"skew-x":[{"skew-x":B()}],"skew-y":[{"skew-y":B()}],transform:[{transform:[j,O,"","none","gpu","cpu"]}],"transform-origin":[{origin:X()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:F()}],"translate-x":[{"translate-x":F()}],"translate-y":[{"translate-y":F()}],"translate-z":[{"translate-z":F()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",j,O]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",j,O]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[Q,Te,Ce,tt]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}),Tn=({panel:e,isLastFlexiblePanel:t,measuredPixelSize:n,measuredPercentageSize:o,containerAxisSize:i,containerLabel:s})=>{const a=e?.size,l=typeof a=="number"&&Number.isFinite(a)?`${a.toFixed(3)}px`:"-",c=e?.percentageSize!==void 0?`${e.percentageSize.toFixed(3)}%`:"-",P=Number.isFinite(n)?`${n.toFixed(3)}px`:"-",z=Number.isFinite(o)?`${o.toFixed(3)}%`:"-",d=Number.isFinite(i)?`${i.toFixed(3)}px`:"-",u=`${l} / ${c}`,x=`${P} / ${z}`,C=`${e?.sizeUnit==="pixels"?"Fixed":"Flexible"}${t?" (Grow)":""}`,k=[C,`${s}: ${d}`,`size (state): ${u}`,`size (measured): ${x}`];return{stateValueDisplay:u,measuredValueDisplay:x,containerDisplay:d,headlineLabel:C,titleText:k.join(`
23
- `)}},On=m.memo(({panel:e,isLastFlexiblePanel:t,measuredPixelSize:n,measuredPercentageSize:o,containerAxisSize:i,direction:s})=>{const a=s==="horizontal"?"container width":"container height",{stateValueDisplay:l,measuredValueDisplay:c,containerDisplay:P,headlineLabel:z,titleText:d}=m.useMemo(()=>Tn({panel:e,isLastFlexiblePanel:t,measuredPixelSize:n,measuredPercentageSize:o,containerAxisSize:i,containerLabel:a}),[e,t,n,o,i,a]),u={position:"absolute",top:"2px",right:"4px",backgroundColor:"rgba(30, 41, 59, 0.6)",color:"#fff",padding:"4px 8px",borderRadius:"6px",fontSize:"11px",fontFamily:"monospace",pointerEvents:"auto",zIndex:10,boxShadow:"0 2px 4px rgba(0,0,0,0.3)",border:"1px solid rgba(255,255,255,0.1)",maxWidth:"calc(100% - 12px)",minWidth:"60px",width:"fit-content",overflow:"hidden"},x={display:"flex",flexDirection:"column",gap:"1px",minWidth:"0",width:"100%"},C={display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"6px",fontSize:"10px",color:"#ccc",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:"0",width:"100%"},k={display:"flex",justifyContent:"space-between",alignItems:"center",gap:"6px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:"0",width:"100%"},w={marginLeft:"auto",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"};return D.jsx("div",{style:u,title:d,children:D.jsxs("div",{style:x,children:[D.jsx("div",{style:C,children:D.jsx("span",{children:z})}),D.jsxs("div",{style:k,children:[D.jsx("span",{children:a}),D.jsx("span",{style:w,children:P})]}),D.jsxs("div",{style:k,children:[D.jsx("span",{children:"size (state)"}),D.jsx("span",{style:w,children:l})]}),D.jsxs("div",{style:k,children:[D.jsx("span",{children:"size (measured)"}),D.jsx("span",{style:w,children:c})]})]})})}),jn=m.memo(({id:e,defaultSize:t={value:50,unit:"percentage"},minSize:n,maxSize:o,className:i,style:s,children:a,order:l=0,collapsible:c=!1,defaultCollapsed:P=!1,pixelAdjustPriority:z})=>{const{direction:d,registerPanel:u,unregisterPanel:x,getPanel:C,showDebugInfo:k,panels:w,isContainerReady:p,reportPanelMeasurement:g,containerSize:_}=Be(),H=m.useRef(null),X=m.useRef(e||pt()),A=C(X.current),te=!!A?.collapsed,R=(A?.size??0)<=0,U=te||R,[V,K]=m.useState(()=>{const h=Ee(t);return h?.unit==="pixels"?h.value:A?.size!==void 0?A.size:0}),[ne,J]=m.useState(()=>{const h=Ee(t);return h?.unit==="percentage"?h.value:A?.percentageSize!==void 0?A.percentageSize:0}),q=m.useRef(ne);q.current=ne;const W=m.useRef(V);W.current=V;const N=m.useCallback(h=>{if(!Number.isFinite(h))return;const v=h<0?0:h;W.current!==v&&(W.current=v,console.debug("[resize-panels] commit pixel",{panelId:X.current,pixel:v}),K(v))},[]),G=m.useCallback(h=>{if(!Number.isFinite(h))return;const v=h<0?0:h;q.current!==v&&(q.current=v,console.debug("[resize-panels] commit percentage",{panelId:X.current,percentage:v}),J(v))},[]);m.useEffect(()=>{e||console.warn("Panel component should have an explicit 'id' prop to avoid hydration issues. Auto-generated ID may cause SSR/client mismatch.")},[e]),m.useEffect(()=>{if(!p)return;const h=Ee(t),v=h?.unit==="pixels";let L=0;if(v){let f=h.value;n&&typeof n=="object"&&n.unit==="pixels"&&(f=Math.max(f,n.value)),o&&typeof o=="object"&&o.unit==="pixels"&&(f=Math.min(f,o.value)),L=f}const B=v?void 0:h?.value,F=P,re=c&&F&&v?L:void 0,ee=c?B:void 0,$={id:X.current,size:F?0:L,percentageSize:F?0:B,sizeUnit:h?.unit||"percentage",originalPixelSize:v?L:void 0,minSize:n,maxSize:o,collapsible:c,collapsed:F,sizeBeforeCollapse:re,percentageSizeBeforeCollapse:ee,pixelAdjustPriority:z};return u($),()=>{x(X.current),g(X.current,null)}},[t,n,o,u,x,c,P,z,g,p]);const E=A?.size??0;m.useEffect(()=>{const h=H.current;if(!h)return;const v=()=>{if(!A)return;const ee=h.parentElement;if(!ee)return;const{width:$,height:le}=h.getBoundingClientRect(),{inner:f}=be(ee,"horizontal"),{inner:Z}=be(ee,"vertical"),ce=d==="horizontal"?$:le,se=d==="horizontal"?f:Z,ue=Xe(se);if(U){W.current!==0&&(W.current=0,K(0)),q.current!==0&&(q.current=0,J(0));return}const he=A?.size??0,ge=Math.max(2,ue*.5);if(!U&&he>ue&&ce<ge){console.debug("[resize-panels] skip noisy measurement",{panelId:X.current,expectedPanelSize:he,measured:ce,noiseThreshold:ge});return}if(ce>0){if(N(ce),se>0){const xe=ce/se*100;G(xe)}}else if(A?.size!==void 0&&N(A.size),A?.percentageSize!==void 0){const xe=A.percentageSize;G(xe)}else if(A?.sizeUnit==="pixels"&&A?.size!==void 0&&se>0){const xe=A.size/se*100;G(xe)}},L=new ResizeObserver(()=>{v()});L.observe(h),v();const B=[],F=new MutationObserver(()=>{(()=>{if(!H.current)return!1;const $=H.current.getBoundingClientRect();return(d==="horizontal"?$.width:$.height)!==W.current})()&&setTimeout(v,0)}),re=h.parentElement;return re&&F.observe(re,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]}),()=>{L.disconnect(),F.disconnect();for(const ee of B)clearTimeout(ee)}},[d,A,U,N,G]);const ie=A?.size,I=A?.percentageSize,r=A?.sizeUnit;m.useEffect(()=>{if(A){if(U){W.current!==0&&(W.current=0,K(0)),q.current!==0&&(q.current=0,J(0));return}if(ie!==void 0&&N(ie),I!==void 0)G(I);else if(r==="pixels"&&ie!==void 0){const h=H.current,v=h?.parentElement;if(h&&v){const{width:L,height:B}=h.getBoundingClientRect(),F=v.clientWidth,re=v.clientHeight,ee=d==="horizontal"?L:B,$=d==="horizontal"?F:re;if(ee>0&&$>0){const le=ee/$*100;G(le)}}}}},[ie,I,r,d,U,N,G,A]),m.useEffect(()=>{g(X.current,{pixelSize:V,percentageSize:ne})},[g,V,ne]);const S=()=>U?"0px":A?.originalPixelSize!==void 0?`${E}px`:A?.percentageSize!==void 0?`${A.percentageSize}%`:`${E}px`,M=(()=>{if(!w||w.length===0)return!1;const h=w.filter(B=>B.sizeUnit==="percentage");if(h.length===0||h[h.length-1]?.id!==X.current)return!1;const L=A?.percentageSize;return!(L!==void 0&&h.filter(F=>Math.abs((F.percentageSize||0)-L)<.01).length>1)})(),T=A?.sizeUnit==="percentage"&&!A?.collapsed?1:0,Y={flexBasis:S(),flexGrow:M?1:0,flexShrink:T,overflow:"hidden",position:"relative",boxSizing:"border-box",minHeight:"0px",minWidth:"0px",...s};d==="horizontal"?(Y.height="100%",Y.minWidth=0):(Y.width="100%",Y.minHeight=0),U&&(d==="horizontal"?(Y.width="0px",Y.minWidth="0px"):(Y.height="0px",Y.minHeight="0px"),Y.flexGrow=0,Y.flexShrink=0,Y.pointerEvents="none",Y.visibility="hidden",te&&(Y.display="none"));const y=d==="horizontal"?_.width:_.height,b=m.useMemo(()=>({position:"absolute",inset:"0px",overflow:"auto",display:"flex",flexDirection:"column",width:"100%",height:"100%",minWidth:"0px",minHeight:"0px"}),[]);return D.jsxs("div",{ref:H,className:Oe("panel",i),style:Y,"data-panel-id":X.current,"data-panel-size":E,"data-panel-size-unit":A?.sizeUnit||"percentage","data-panel-pixel-size":A?.sizeUnit==="pixels"?A?.originalPixelSize:null,"data-panel-order":l,"data-panel-collapsible":c,"data-panel-collapsed":A?.collapsed,"aria-hidden":U,children:[D.jsx("div",{style:b,children:a}),k&&D.jsx(On,{panel:A,isLastFlexiblePanel:M,measuredPixelSize:V,measuredPercentageSize:ne,containerAxisSize:y,direction:d})]})}),Bn=e=>JSON.stringify(e.map(t=>({id:t.id,size:t.size,percentageSize:t.percentageSize??null,sizeUnit:t.sizeUnit,originalPixelSize:t.originalPixelSize??null,minSize:t.minSize??null,maxSize:t.maxSize??null,collapsible:t.collapsible??!1,collapsed:t.collapsed??!1,sizeBeforeCollapse:t.sizeBeforeCollapse??null,measuredPixelSizeBeforeCollapse:t.measuredPixelSizeBeforeCollapse??null,pixelAdjustPriority:t.pixelAdjustPriority??null,measuredPixelSize:t.measuredPixelSize??null,measuredPercentageSize:t.measuredPercentageSize??null}))),Ln=e=>JSON.stringify(e.map(t=>({id:t.id,thickness:t.thickness,visible:t.visible,direction:t.direction,startPanelId:t.startPanelId??null,endPanelId:t.endPanelId??null}))),ze=(()=>{const e=new Set,t=new Map,n=new Set;let o=null,i=0,s=!0,a=[],l={ownerId:null,groups:a};const c=()=>{for(const p of e)p()},P=()=>{s=!0,c()},z=()=>{const p=o;if(p&&n.has(p))return!1;o=null;const g=n.values().next();return g.done||(o=g.value),p!==o};return{subscribe:p=>(e.add(p),()=>{e.delete(p)}),getSnapshot:()=>(z()&&(s=!0),s&&(a=Array.from(t.values()).sort((g,_)=>g.index-_.index).map(({serializedPanels:g,serializedHandles:_,...H})=>H),l={ownerId:o,groups:a},s=!1),l),getOwnerId:()=>(z()&&(s=!0),o),enableGroup:p=>{const g=n.size;n.add(p),n.size!==g&&z()&&P()},disableGroup:p=>{n.delete(p)&&z()&&P()},updateGroup:(p,g)=>{const _=t.get(p),H=_?.index??i++,X=Bn(g.panels),A=Ln(g.handles),te=_?.displayName!==g.displayName,R=_?.direction!==g.direction,U=_?_.containerSize.width!==g.containerSize.width||_.containerSize.height!==g.containerSize.height:!0;let V=_?.serializedPanels!==X;if(!V&&_)if(_.panels.length!==g.panels.length)V=!0;else for(let W=0;W<g.panels.length;W+=1){const N=_.panels[W],G=g.panels[W];if(!(N&&G)){V=!0;break}if(N.id!==G.id||N.size!==G.size||N.percentageSize!==G.percentageSize||N.collapsed!==G.collapsed||N.measuredPixelSize!==G.measuredPixelSize||N.measuredPercentageSize!==G.measuredPercentageSize){V=!0;break}}let K=_?.serializedHandles!==A;if(!K&&_)if(_.handles.length!==g.handles.length)K=!0;else for(let W=0;W<g.handles.length;W+=1){const N=_.handles[W],G=g.handles[W];if(!(N&&G)){K=!0;break}if(N.id!==G.id||N.thickness!==G.thickness||N.visible!==G.visible||N.direction!==G.direction||N.startPanelId!==G.startPanelId||N.endPanelId!==G.endPanelId){K=!0;break}}if(!_&&g.panels.length===0&&g.handles.length===0||_&&!te&&!R&&!U&&!V&&!K)return;const ne=g.panels.map(W=>({...W})),J=g.handles.map(W=>({...W})),q={...g.containerSize};t.set(p,{groupId:p,displayName:g.displayName,direction:g.direction,containerSize:q,panels:ne,handles:J,index:H,serializedPanels:X,serializedHandles:A}),P()},removeGroup:p=>{const g=t.delete(p),_=n.delete(p),H=z();(g||_||H)&&P()}}})(),Dn=()=>m.useSyncExternalStore(ze.subscribe,ze.getOwnerId,ze.getOwnerId),Gn=()=>m.useSyncExternalStore(ze.subscribe,ze.getSnapshot,ze.getSnapshot),Fn=e=>{ze.enableGroup(e)},Ot=e=>{ze.disableGroup(e)},Hn=(e,t)=>{ze.updateGroup(e,t)},jt=e=>{ze.removeGroup(e)};let Bt=0;const Wn=()=>(Bt+=1,`panel-group-${Bt}`),Lt=(e,t)=>typeof e!="number"||!Number.isFinite(e)?"—":`${(e<0?0:e).toFixed(8)}${t}`,We=e=>Lt(e,"px"),Dt=e=>Lt(e,"%"),Un=e=>{const{id:t,className:n,style:o,children:i,direction:s}=e,{groupRef:a,contextValue:l,groupStyle:c}=xt(e),[P,z]=m.useState({width:0,height:0}),d=l.layoutConstraintViolation,u=!!d,x=u&&d?D.jsxs("div",{className:"flex w-full flex-1 flex-col items-center justify-center gap-2 rounded-lg border border-slate-300 border-dashed bg-slate-100/70 px-6 py-8 text-center text-slate-600 text-sm dark:border-slate-600 dark:bg-slate-800/50 dark:text-slate-200","data-panel-group-placeholder":"constraint-violation",children:[D.jsx("span",{children:d.reason==="minimum-exceeded"?"Layout unavailable: minimum panel sizes exceed the container.":"Layout unavailable: panels cannot fill the container with their maximum sizes."}),D.jsx("span",{className:"text-slate-500 text-xs dark:text-slate-400",children:d.reason==="minimum-exceeded"?`Min required: ${Math.ceil(d.totalMinimumSize??0)}px | Available: ${Math.floor(d.availableContainerSize)}px`:`Max total: ${Math.floor(d.totalMaximumSize??0)}px | Needed: ${Math.floor(d.availableContainerSize)}px`})]}):null,k=m.useRef(t??Wn()).current,w=t??k,p=l.showDebugInfo&&l.panels.length>0,g=p?l.panels:[],_=p?l.panelMeasurements:{},H=m.useMemo(()=>{if(!p)return[];const K=Object.values(l.handleMeasurements);return K.length<=1?K:K.slice().sort((ne,J)=>ne.id.localeCompare(J.id))},[l.handleMeasurements,p]),X=l.containerSize,A=P.width>0?P.width:X.width,te=P.height>0?P.height:X.height,R=Dn(),U=p&&R===k;m.useLayoutEffect(()=>{if(!p){z({width:0,height:0});return}if(typeof window>"u"||typeof ResizeObserver>"u")return;const K=a.current;if(!K)return;const ne=new ResizeObserver(E=>{for(const ie of E){if(ie.target!==K)continue;const I=ie.target,r=I?be(I,"horizontal"):null,S=I?be(I,"vertical"):null,M=r?r.inner:0,T=S?S.inner:0,Y=ie.contentRect.width,y=ie.contentRect.height,b=M>0?M:Y,h=T>0?T:y;z(v=>v.width===b&&v.height===h?v:{width:b,height:h})}});ne.observe(K);const{inner:J}=be(K,"horizontal"),{inner:q}=be(K,"vertical"),W=K.getBoundingClientRect(),N=J>0?J:W.width,G=q>0?q:W.height;return z({width:N,height:G}),()=>{ne.disconnect()}},[a,p]);const V=m.useMemo(()=>{if(g.length===0)return g;let K=!1;const ne=g.map(J=>{const q=_[J.id];return!q||J.measuredPixelSize===q.pixelSize&&J.measuredPercentageSize===q.percentageSize?J:(K=!0,{...J,measuredPixelSize:q.pixelSize,measuredPercentageSize:q.percentageSize})});return K?ne:g},[g,_]);return m.useEffect(()=>{if(!p){Ot(k),jt(k);return}return Fn(k),()=>{Ot(k),jt(k)}},[p,k]),m.useEffect(()=>{p&&Hn(k,{displayName:w,direction:s,containerSize:{width:A,height:te},panels:V,handles:H})},[p,k,w,s,A,te,V,H]),D.jsxs(Ve.Provider,{value:l,children:[D.jsx("div",{ref:a,className:Oe("panel-group",s==="horizontal"?"flex-row":"flex-col",n),style:{...c,...o},"data-panel-group-id":t,"data-panel-group-direction":s,children:u?x:i}),U&&D.jsx(Vn,{})]})},Vn=()=>{const t=Gn().groups,[n,o]=m.useState(!0);if(t.length===0||typeof document>"u")return null;const i=t.reduce((c,P)=>c+P.panels.length,0),s=t.reduce((c,P)=>c+(P.handles?.length??0),0),a=()=>{o(c=>!c)},l=D.jsxs("div",{style:{position:"fixed",left:"50%",bottom:"20px",transform:"translate(-50%, 0)",zIndex:100,maxWidth:"min(90vw, 1120px)",width:"100%",padding:n?"10px 18px":"14px 18px",borderRadius:"14px",backgroundColor:"rgba(15, 23, 42, 0.72)",color:"#e2e8f0",fontFamily:"monospace",fontSize:"11px",lineHeight:1.6,boxShadow:"0 22px 45px rgba(15,23,42,0.45)",border:"1px solid rgba(148, 163, 184, 0.22)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",pointerEvents:"auto",overflow:"auto",maxHeight:n?"52px":"min(65vh, 520px)",transition:"max-height 0.24s ease, padding 0.24s ease"},children:[D.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"12px",marginBottom:n?0:"12px"},children:[D.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[D.jsx("span",{style:{fontWeight:700,fontSize:"12px",letterSpacing:"0.03em"},children:"Panel Overview"}),D.jsxs("span",{style:{color:"#cbd5f5"},children:["groups: ",t.length," / panels: ",i," / resizers: ",s]})]}),D.jsx("button",{type:"button",onClick:()=>a(),style:{padding:"6px 10px",borderRadius:"9999px",border:"1px solid rgba(148, 163, 184, 0.35)",backgroundColor:n?"rgba(59, 130, 246, 0.2)":"rgba(71, 85, 105, 0.45)",color:"#e2e8f0",fontWeight:600,fontSize:"10px",letterSpacing:"0.03em",textTransform:"uppercase",cursor:"pointer",transition:"background-color 0.18s ease, 0.18s ease border-color"},title:n?"Panel Overview を開く":"Panel Overview を閉じる",children:n?"開く":"閉じる"})]}),!n&&D.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px",maxHeight:"45vh",overflowY:"auto",paddingRight:"6px"},children:t.map((c,P)=>{const z=c.direction==="horizontal"?c.containerSize.width:c.containerSize.height;return D.jsxs("div",{style:{padding:"10px 12px",borderRadius:"10px",backgroundColor:"rgba(30, 41, 59, 0.55)",border:"1px solid rgba(148, 163, 184, 0.18)",display:"flex",flexDirection:"column",gap:"10px"},children:[D.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"10px",color:"#dbeafe"},children:[D.jsxs("span",{style:{fontWeight:600,fontSize:"11px",letterSpacing:"0.02em",textTransform:"uppercase"},children:["group ",P+1,": ",c.displayName]}),D.jsxs("span",{children:["direction: ",c.direction," / container: ",We(c.containerSize.width)," × ",We(c.containerSize.height)]})]}),D.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:"10px"},children:c.panels.map((d,u)=>{const x=d.measuredPixelSize??d.size,C=d.size,k=We(C),w=d.percentageSize??(z>0?d.size/z*100:void 0),p=d.measuredPercentageSize!==void 0?d.measuredPercentageSize:z>0?x/z*100:void 0,g=d.collapsed||x<=it,_=d.collapsed?"collapsed":g?"hidden":"visible",H=Dt(w),X=Dt(p),A=We(x);return D.jsxs("div",{style:{padding:"8px 10px",borderRadius:"8px",backgroundColor:"rgba(15, 23, 42, 0.55)",border:"1px solid rgba(148, 163, 184, 0.16)",display:"flex",flexDirection:"column",gap:"4px"},children:[D.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"6px"},children:[D.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:d.id}),D.jsx("span",{style:{padding:"2px 6px",borderRadius:"9999px",fontSize:"10px",textTransform:"uppercase",backgroundColor:d.collapsed?"rgba(251, 113, 133, 0.25)":g?"rgba(250, 204, 21, 0.25)":"rgba(74, 222, 128, 0.25)",color:d.collapsed?"#fecdd3":g?"#fef08a":"#bbf7d0"},children:_})]}),D.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"2px 10px",color:"#e2e8f0"},children:[D.jsx("span",{children:"size (state):"}),D.jsx("span",{children:k}),D.jsx("span",{children:"size (measured):"}),D.jsx("span",{children:A}),D.jsx("span",{children:"percentage (state):"}),D.jsx("span",{children:H}),D.jsx("span",{children:"percentage (measured):"}),D.jsx("span",{children:X}),D.jsx("span",{children:"unit:"}),D.jsx("span",{children:d.sizeUnit}),D.jsx("span",{children:"min:"}),D.jsx("span",{children:d.minSize!==void 0?JSON.stringify(d.minSize):"—"}),D.jsx("span",{children:"max:"}),D.jsx("span",{children:d.maxSize!==void 0?JSON.stringify(d.maxSize):"—"}),D.jsx("span",{children:"priority:"}),D.jsx("span",{children:d.pixelAdjustPriority??"—"})]})]},d.id||u)})})]},c.groupId)})})]});return Wt.createPortal(l,document.body)},Yn=m.memo(({id:e,disabled:t=!1,className:n,style:o,children:i,onDragging:s})=>{const{direction:a,resizePanels:l,getPanel:c,collapsePanel:P,expandPanel:z,panels:d,reportHandleMeasurement:u,containerSize:x}=Be(),[C,k]=m.useState(!1),w=m.useRef(null),p=m.useRef(null),g=m.useRef(""),_=m.useRef(""),[H,X]=m.useState({left:null,right:null}),A=m.useRef(e??Zt()),te=m.useRef(null),R=e??A.current;m.useEffect(()=>{if(w.current){const y=w.current.parentElement;if(y){p.current=y;const b=Array.from(y.children),h=w.current,v=b.indexOf(h);if(v>0&&v<b.length-1){let L=null,B=null;for(let F=v-1;F>=0;F-=1){const re=b[F];if(re.dataset.panelId){L=re;break}}for(let F=v+1;F<b.length;F+=1){const re=b[F];if(re.dataset.panelId){B=re;break}}g.current=L?.dataset.panelId||"",_.current=B?.dataset.panelId||"",X({left:g.current||null,right:_.current||null})}}}},[]),m.useEffect(()=>{if(R===A.current)return;const y=A.current;A.current=R,te.current=null,y!==R&&u(y,null)},[u,R]),m.useEffect(()=>{const y=A.current;return()=>{u(y,null)}},[u]);const U=m.useCallback(y=>{if(t||!p.current)return;y.preventDefault(),y.stopPropagation();const b=p.current,{inner:h}=be(b,a),v={x:y.clientX,y:y.clientY},L=c(g.current),B=c(_.current);if(!(L&&B))return;const F=L.size,re=B.size;let ee=0;const $=Vt;k(!0),s?.(!0),y.currentTarget.setPointerCapture(y.pointerId);const le=Z=>{if(!w.current)return;Z.preventDefault(),Z.stopPropagation();const ce=performance.now();if(ce-ee<$)return;ee=ce;const se=a==="horizontal"?Z.clientX-v.x:Z.clientY-v.y;if(se===0)return;const ue=F+se,he=re-se,ge=c(g.current),me=c(_.current);if(ge&&me&&g.current&&_.current){const xe=oe(ge.minSize,0,h),ke=oe(me.minSize,0,h),Se=xe,ve=ke,Gt=Math.min(h*st,at),Ft=Math.min(h*Yt,Xt);if(me.collapsible&&!me.collapsed&&he<=Math.max(ke*.3,Gt)){P(_.current);return}if(ge.collapsible&&!ge.collapsed&&ue<=Math.max(xe*.3,Gt)){P(g.current);return}if(me.collapsed&&he>Math.max(ke*.3,Ft)){z(_.current,he);return}if(ge.collapsed&&ue>Math.max(xe*.3,Ft)){z(g.current,ue);return}if(h>0){const Ht=ge.size+me.size,Ue=Xe(h);let nt=!1;if(Se<=Ue&&ue<=Ue&&F!==0){const je=Math.max(0,Ht-0);je>=ve&&(l(g.current,_.current,0,je),nt=!0)}else if(ve<=Ue&&he<=Ue&&re!==0){const je=Math.max(0,Ht-0);je>=Se&&(l(g.current,_.current,je,0),nt=!0)}if(nt)return}if(ge.collapsed||me.collapsed)return;l(g.current,_.current,ue,he)}},f=()=>{k(!1),s?.(!1),document.removeEventListener("pointermove",le),document.removeEventListener("pointerup",f)};document.addEventListener("pointermove",le),document.addEventListener("pointerup",f)},[t,a,l,c,P,z,s]),V=a==="horizontal",ne=Oe("group absolute z-20 flex select-none items-center justify-center border-none bg-transparent transition-colors duration-150 overflow-visible",V?"cursor-col-resize":"cursor-row-resize",V?"h-full":"w-full",!t&&"hover:bg-gray-200/70 dark:hover:bg-gray-700/70",!t&&"active:bg-blue-300/60 dark:active:bg-blue-700/60",C&&"bg-blue-200/80 dark:bg-blue-800/60",t&&"cursor-not-allowed opacity-50","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50",n),J=m.useMemo(()=>{const y=b=>{if(!b)return-1;for(let h=0;h<d.length;h+=1)if(d[h].id===b)return h;return-1};return{left:y(H.left),right:y(H.right)}},[H.left,H.right,d]),q=V?x.width:x.height,W=m.useMemo(()=>{const y=(b,h)=>{if(b>h)return 0;let v=0;for(let L=b;L<=h;L+=1){const B=d[L];if(!B)continue;const F=B.size??0,re=Math.max(0,F);v+=B.collapsed?0:re}return v};return J.left>=0?y(0,J.left):J.right>0?y(0,J.right-1):0},[J.left,J.right,d]),N=m.useMemo(()=>!Number.isFinite(W)||W<0?0:q>0&&W>q?q:W,[W,q]),G=m.useMemo(()=>{const y={position:"absolute",zIndex:20,touchAction:"none"};return V?(y.top=0,y.left=`${N}px`,y.transform="translateX(-50%)",y.width=`${ot}px`,y.height="100%"):(y.left=0,y.top=`${N}px`,y.transform="translateY(-50%)",y.height=`${ot}px`,y.width="100%"),y},[N,V]),E=m.useMemo(()=>{const y=Xe(q),b=$=>{if($<0||$>=d.length)return!1;const le=d[$];return le?le.collapsed?!0:le.size<=y:!1},h=($,le)=>{if(!b($))return 0;let f=0;for(let Z=$;Z>=0&&Z<d.length&&b(Z);Z+=le)f+=1;return f},v=J.left,L=J.right,B=v>=0?h(v,-1):0,F=L>=0?h(L,1):0;return{groupSize:B+F+1,overlapIndex:B}},[J.left,J.right,d,q]),ie=m.useMemo(()=>{if(E.groupSize<=1)return!1;const y=E.groupSize-1;return E.overlapIndex>0&&E.overlapIndex<y},[E]),I=m.useMemo(()=>{if(E.groupSize<=1||ie)return 0;const y=E.groupSize>1?2:1;if(y===1)return 0;const b=E.overlapIndex===0?0:y-1,h=(y-1)/2;return(b-h)*Ut},[E,ie]),r=m.useMemo(()=>{if(ie)return{display:"none"};if(I!==0)return V?{transform:`translateX(${I}px)`}:{transform:`translateY(${I}px)`}},[I,V,ie]),S=Oe("flex items-center justify-center rounded-full bg-white text-slate-700 ring-1 ring-inset ring-white/80 backdrop-blur-sm transition-colors duration-150 shadow-[0_0_0_1px_rgba(255,255,255,0.85),0_1px_3px_rgba(15,23,42,0.18)]","dark:bg-slate-800/95 dark:text-slate-200 dark:ring-slate-500/60 dark:shadow-[0_0_0_1px_rgba(148,163,184,0.45),0_1px_3px_rgba(2,6,23,0.55)]",V?"h-12 w-[6px] px-[2px]":"h-[6px] w-20 py-[2px]",C&&"bg-blue-200/80 ring-blue-300 shadow-[0_0_0_1px_rgba(191,219,254,0.65),0_1px_4px_rgba(59,130,246,0.45)] dark:bg-blue-900/70 dark:ring-blue-400 dark:shadow-[0_0_0_1px_rgba(147,197,253,0.5),0_1px_4px_rgba(59,130,246,0.55)]"),M=Oe("rounded-full bg-slate-600 transition-colors duration-150 shadow-[0_0_0_1px_rgba(255,255,255,0.9)] dark:bg-slate-200 dark:shadow-[0_0_0_1px_rgba(15,23,42,0.55)]",V?"h-8 w-[2px]":"h-[2px] w-16",C&&"bg-blue-500 dark:bg-blue-300",!t&&"group-hover:bg-slate-700 dark:group-hover:bg-slate-100"),T=m.useCallback(()=>{const y=w.current;if(!y)return;let b=0;if(!ie){const L=a==="horizontal"?y.offsetWidth:y.offsetHeight;let B=0,F=0;if(typeof window<"u"){const ee=window.getComputedStyle(y);a==="horizontal"?(B=Number.parseFloat(ee.marginLeft||"0"),F=Number.parseFloat(ee.marginRight||"0")):(B=Number.parseFloat(ee.marginTop||"0"),F=Number.parseFloat(ee.marginBottom||"0"))}b=[L,B,F].reduce((ee,$)=>Number.isFinite($)?ee+$:ee,0)}(!Number.isFinite(b)||b<0)&&(b=0);const h={id:R,thickness:b,direction:a,visible:!ie&&b>Jt,startPanelId:H.left,endPanelId:H.right},v=te.current;v&&Math.abs(v.thickness-h.thickness)<=.25&&v.visible===h.visible&&v.direction===h.direction&&v.startPanelId===h.startPanelId&&v.endPanelId===h.endPanelId||(te.current=h,u(R,h))},[a,H.left,H.right,u,R,ie]);m.useEffect(()=>{T()},[T]),m.useEffect(()=>{const y=w.current;if(!y)return;if(typeof ResizeObserver>"u"){T();return}const b=new ResizeObserver(()=>{T()});return b.observe(y),()=>{b.disconnect()}},[T]);const Y=m.useMemo(()=>{const y=o?{...G,...o}:G;return ie?{...y,display:"none",pointerEvents:"none",visibility:"hidden"}:y},[G,ie,o]);return D.jsx("button",{type:"button",ref:w,className:ne,style:Y,onPointerDown:U,disabled:t,"aria-hidden":ie||void 0,"aria-label":`Resize ${V?"columns":"rows"} - Drag to collapse/expand panels`,"data-resize-handle-id":R,title:`ドラッグして${V?"列":"行"}をリサイズ、端まで移動して折りたたみ/展開`,children:i||D.jsx("div",{className:S,style:r,children:D.jsx("span",{className:M})})})}),Xn=e=>document.querySelector(`[data-panel-id="${e}"]`),Jn=e=>document.querySelector(`[data-panel-group-id="${e}"]`),Zn=e=>document.querySelector(`[data-resize-handle-id="${e}"]`);ae.Panel=jn,ae.PanelGroup=Un,ae.PanelGroupContext=Ve,ae.PanelResizeHandle=Yn,ae.clamp=pe,ae.generatePanelId=pt,ae.getConstraintInPixels=oe,ae.getContainerSize=be,ae.getPanelElement=Xn,ae.getPanelGroupElement=Jn,ae.getResizeHandleElement=Zn,ae.loadLayout=gt,ae.normalizeSizeConfig=Ee,ae.saveLayout=mt,ae.usePanelControls=Kt,ae.usePanelGroup=Be,ae.useResizablePanels=xt,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})}));
22
+ <%s key={someKey} {...props} />`,H,f,z,f),ze[f+H]=!0)}if(f=null,O!==void 0&&(o(O),f=""+O),n(B)&&(o(B.key),f=""+B.key),"key"in B){O={};for(var h in B)h!=="key"&&(O[h]=B[h])}else O=B;return f&&u(O,typeof p=="function"?p.displayName||p.name||"Unknown":p),g(p,f,O,r(),fe,ge)}function c(p){d(p)?p._store&&(p._store.validated=1):typeof p=="object"&&p!==null&&p.$$typeof===L&&(p._payload.status==="fulfilled"?d(p._payload.value)&&p._payload.value._store&&(p._payload.value._store.validated=1):p._store&&(p._store.validated=1))}function d(p){return typeof p=="object"&&p!==null&&p.$$typeof===P}var S=x,P=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),D=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),ne=Symbol.for("react.client.reference"),W=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=Object.prototype.hasOwnProperty,ae=Array.isArray,k=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(p){return p()}};var T,J={},R=S.react_stack_bottom_frame.bind(S,s)(),me=k(i(s)),ze={};He.Fragment=M,He.jsx=function(p,B,O){var H=1e4>W.recentlyCreatedOwnerStacks++;return l(p,B,O,!1,H?Error("react-stack-top-frame"):R,H?k(i(p)):me)},He.jsxs=function(p,B,O){var H=1e4>W.recentlyCreatedOwnerStacks++;return l(p,B,O,!0,H?Error("react-stack-top-frame"):R,H?k(i(p)):me)}})()),He}var Rt;function lr(){return Rt||(Rt=1,process.env.NODE_ENV==="production"?Ke.exports=sr():Ke.exports=ar()),Ke.exports}var I=lr();const ot="-",cr=e=>{const t=ur(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:n=>{const u=n.split(ot);return u[0]===""&&u.length!==1&&u.shift(),At(u,t)||dr(n)},getConflictingClassGroupIds:(n,u)=>{const a=o[n]||[];return u&&i[n]?[...a,...i[n]]:a}}},At=(e,t)=>{if(e.length===0)return t.classGroupId;const o=e[0],i=t.nextPart.get(o),r=i?At(e.slice(1),i):void 0;if(r)return r;if(t.validators.length===0)return;const s=e.join(ot);return t.validators.find(({validator:n})=>n(s))?.classGroupId},_t=/^\[(.+)\]$/,dr=e=>{if(_t.test(e)){const t=_t.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},ur=e=>{const{theme:t,classGroups:o}=e,i={nextPart:new Map,validators:[]};for(const r in o)it(o[r],i,r,t);return i},it=(e,t,o,i)=>{e.forEach(r=>{if(typeof r=="string"){const s=r===""?t:It(t,r);s.classGroupId=o;return}if(typeof r=="function"){if(fr(r)){it(r(i),t,o,i);return}t.validators.push({validator:r,classGroupId:o});return}Object.entries(r).forEach(([s,n])=>{it(n,It(t,s),o,i)})})},It=(e,t)=>{let o=e;return t.split(ot).forEach(i=>{o.nextPart.has(i)||o.nextPart.set(i,{nextPart:new Map,validators:[]}),o=o.nextPart.get(i)}),o},fr=e=>e.isThemeGetter,pr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,i=new Map;const r=(s,n)=>{o.set(s,n),t++,t>e&&(t=0,i=o,o=new Map)};return{get(s){let n=o.get(s);if(n!==void 0)return n;if((n=i.get(s))!==void 0)return r(s,n),n},set(s,n){o.has(s)?o.set(s,n):r(s,n)}}},st="!",at=":",mr=at.length,gr=e=>{const{prefix:t,experimentalParseClassName:o}=e;let i=r=>{const s=[];let n=0,u=0,a=0,g;for(let P=0;P<r.length;P++){let y=r[P];if(n===0&&u===0){if(y===at){s.push(r.slice(a,P)),a=P+mr;continue}if(y==="/"){g=P;continue}}y==="["?n++:y==="]"?n--:y==="("?u++:y===")"&&u--}const l=s.length===0?r:r.substring(a),c=hr(l),d=c!==l,S=g&&g>a?g-a:void 0;return{modifiers:s,hasImportantModifier:d,baseClassName:c,maybePostfixModifierPosition:S}};if(t){const r=t+at,s=i;i=n=>n.startsWith(r)?s(n.substring(r.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:n,maybePostfixModifierPosition:void 0}}if(o){const r=i;i=s=>o({className:s,parseClassName:r})}return i},hr=e=>e.endsWith(st)?e.substring(0,e.length-1):e.startsWith(st)?e.substring(1):e,xr=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(i=>[i,!0]));return i=>{if(i.length<=1)return i;const r=[];let s=[];return i.forEach(n=>{n[0]==="["||t[n]?(r.push(...s.sort(),n),s=[]):s.push(n)}),r.push(...s.sort()),r}},zr=e=>({cache:pr(e.cacheSize),parseClassName:gr(e),sortModifiers:xr(e),...cr(e)}),Sr=/\s+/,br=(e,t)=>{const{parseClassName:o,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:s}=t,n=[],u=e.trim().split(Sr);let a="";for(let g=u.length-1;g>=0;g-=1){const l=u[g],{isExternal:c,modifiers:d,hasImportantModifier:S,baseClassName:P,maybePostfixModifierPosition:y}=o(l);if(c){a=l+(a.length>0?" "+a:a);continue}let M=!!y,v=i(M?P.substring(0,y):P);if(!v){if(!M){a=l+(a.length>0?" "+a:a);continue}if(v=i(P),!v){a=l+(a.length>0?" "+a:a);continue}M=!1}const E=s(d).join(":"),C=S?E+st:E,D=C+v;if(n.includes(D))continue;n.push(D);const q=r(v,M);for(let ee=0;ee<q.length;++ee){const K=q[ee];n.push(C+K)}a=l+(a.length>0?" "+a:a)}return a};function Pr(){let e=0,t,o,i="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Bt(t))&&(i&&(i+=" "),i+=o);return i}const Bt=e=>{if(typeof e=="string")return e;let t,o="";for(let i=0;i<e.length;i++)e[i]&&(t=Bt(e[i]))&&(o&&(o+=" "),o+=t);return o};function yr(e,...t){let o,i,r,s=n;function n(a){const g=t.reduce((l,c)=>c(l),e());return o=zr(g),i=o.cache.get,r=o.cache.set,s=u,u(a)}function u(a){const g=i(a);if(g)return g;const l=br(a,o);return r(a,l),l}return function(){return s(Pr.apply(null,arguments))}}const xe=e=>{const t=o=>o[e]||[];return t.isThemeGetter=!0,t},Tt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Nt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,vr=/^\d+\/\d+$/,wr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Cr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Er=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Mr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Le=e=>vr.test(e),Q=e=>!!e&&!Number.isNaN(Number(e)),Me=e=>!!e&&Number.isInteger(Number(e)),lt=e=>e.endsWith("%")&&Q(e.slice(0,-1)),Ee=e=>wr.test(e),Rr=()=>!0,Ar=e=>Cr.test(e)&&!Er.test(e),Lt=()=>!1,_r=e=>kr.test(e),Ir=e=>Mr.test(e),Br=e=>!A(e)&&!_(e),Tr=e=>Fe(e,Gt,Lt),A=e=>Tt.test(e),Ie=e=>Fe(e,Ht,Ar),ct=e=>Fe(e,jr,Q),Ft=e=>Fe(e,jt,Lt),Nr=e=>Fe(e,Dt,Ir),qe=e=>Fe(e,Ut,_r),_=e=>Nt.test(e),Ue=e=>Oe(e,Ht),Lr=e=>Oe(e,Dr),Ot=e=>Oe(e,jt),Fr=e=>Oe(e,Gt),Or=e=>Oe(e,Dt),$e=e=>Oe(e,Ut,!0),Fe=(e,t,o)=>{const i=Tt.exec(e);return i?i[1]?t(i[1]):o(i[2]):!1},Oe=(e,t,o=!1)=>{const i=Nt.exec(e);return i?i[1]?t(i[1]):o:!1},jt=e=>e==="position"||e==="percentage",Dt=e=>e==="image"||e==="url",Gt=e=>e==="length"||e==="size"||e==="bg-size",Ht=e=>e==="length",jr=e=>e==="number",Dr=e=>e==="family-name",Ut=e=>e==="shadow",We=yr(()=>{const e=xe("color"),t=xe("font"),o=xe("text"),i=xe("font-weight"),r=xe("tracking"),s=xe("leading"),n=xe("breakpoint"),u=xe("container"),a=xe("spacing"),g=xe("radius"),l=xe("shadow"),c=xe("inset-shadow"),d=xe("text-shadow"),S=xe("drop-shadow"),P=xe("blur"),y=xe("perspective"),M=xe("aspect"),v=xe("ease"),E=xe("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],q=()=>[...D(),_,A],ee=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto","contain","none"],w=()=>[_,A,a],L=()=>[Le,"full","auto",...w()],X=()=>[Me,"none","subgrid",_,A],ne=()=>["auto",{span:["full",Me,_,A]},Me,_,A],W=()=>[Me,"auto",_,A],V=()=>["auto","min","max","fr",_,A],ae=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],k=()=>["start","end","center","stretch","center-safe","end-safe"],T=()=>["auto",...w()],J=()=>[Le,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],R=()=>[e,_,A],me=()=>[...D(),Ot,Ft,{position:[_,A]}],ze=()=>["no-repeat",{repeat:["","x","y","space","round"]}],p=()=>["auto","cover","contain",Fr,Tr,{size:[_,A]}],B=()=>[lt,Ue,Ie],O=()=>["","none","full",g,_,A],H=()=>["",Q,Ue,Ie],fe=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],f=()=>[Q,lt,Ot,Ft],z=()=>["","none",P,_,A],h=()=>["none",Q,_,A],b=()=>["none",Q,_,A],N=()=>[Q,_,A],Y=()=>[Le,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ee],breakpoint:[Ee],color:[Rr],container:[Ee],"drop-shadow":[Ee],ease:["in","out","in-out"],font:[Br],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ee],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ee],shadow:[Ee],spacing:["px",Q],text:[Ee],"text-shadow":[Ee],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Le,A,_,M]}],container:["container"],columns:[{columns:[Q,A,_,u]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:q()}],overflow:[{overflow:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Me,"auto",_,A]}],basis:[{basis:[Le,"full","auto",u,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Q,Le,"auto","initial","none",A]}],grow:[{grow:["",Q,_,A]}],shrink:[{shrink:["",Q,_,A]}],order:[{order:[Me,"first","last","none",_,A]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ae(),"normal"]}],"justify-items":[{"justify-items":[...k(),"normal"]}],"justify-self":[{"justify-self":["auto",...k()]}],"align-content":[{content:["normal",...ae()]}],"align-items":[{items:[...k(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...k(),{baseline:["","last"]}]}],"place-content":[{"place-content":ae()}],"place-items":[{"place-items":[...k(),"baseline"]}],"place-self":[{"place-self":["auto",...k()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:T()}],mx:[{mx:T()}],my:[{my:T()}],ms:[{ms:T()}],me:[{me:T()}],mt:[{mt:T()}],mr:[{mr:T()}],mb:[{mb:T()}],ml:[{ml:T()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],w:[{w:[u,"screen",...J()]}],"min-w":[{"min-w":[u,"screen","none",...J()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[n]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",o,Ue,Ie]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,_,ct]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lt,A]}],"font-family":[{font:[Lr,A,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,_,A]}],"line-clamp":[{"line-clamp":[Q,"none",_,ct]}],leading:[{leading:[s,...w()]}],"list-image":[{"list-image":["none",_,A]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",_,A]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Q,"from-font","auto",_,Ie]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[Q,"auto",_,A]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_,A]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",_,A]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:me()}],"bg-repeat":[{bg:ze()}],"bg-size":[{bg:p()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Me,_,A],radial:["",_,A],conic:[Me,_,A]},Or,Nr]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":H()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Q,_,A]}],"outline-w":[{outline:["",Q,Ue,Ie]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",l,$e,qe]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",c,$e,qe]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[Q,Ie]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",d,$e,qe]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[Q,_,A]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Q]}],"mask-image-linear-from-pos":[{"mask-linear-from":f()}],"mask-image-linear-to-pos":[{"mask-linear-to":f()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":f()}],"mask-image-t-to-pos":[{"mask-t-to":f()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":f()}],"mask-image-r-to-pos":[{"mask-r-to":f()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":f()}],"mask-image-b-to-pos":[{"mask-b-to":f()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":f()}],"mask-image-l-to-pos":[{"mask-l-to":f()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":f()}],"mask-image-x-to-pos":[{"mask-x-to":f()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":f()}],"mask-image-y-to-pos":[{"mask-y-to":f()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[_,A]}],"mask-image-radial-from-pos":[{"mask-radial-from":f()}],"mask-image-radial-to-pos":[{"mask-radial-to":f()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":D()}],"mask-image-conic-pos":[{"mask-conic":[Q]}],"mask-image-conic-from-pos":[{"mask-conic-from":f()}],"mask-image-conic-to-pos":[{"mask-conic-to":f()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:me()}],"mask-repeat":[{mask:ze()}],"mask-size":[{mask:p()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",_,A]}],filter:[{filter:["","none",_,A]}],blur:[{blur:z()}],brightness:[{brightness:[Q,_,A]}],contrast:[{contrast:[Q,_,A]}],"drop-shadow":[{"drop-shadow":["","none",S,$e,qe]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",Q,_,A]}],"hue-rotate":[{"hue-rotate":[Q,_,A]}],invert:[{invert:["",Q,_,A]}],saturate:[{saturate:[Q,_,A]}],sepia:[{sepia:["",Q,_,A]}],"backdrop-filter":[{"backdrop-filter":["","none",_,A]}],"backdrop-blur":[{"backdrop-blur":z()}],"backdrop-brightness":[{"backdrop-brightness":[Q,_,A]}],"backdrop-contrast":[{"backdrop-contrast":[Q,_,A]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Q,_,A]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Q,_,A]}],"backdrop-invert":[{"backdrop-invert":["",Q,_,A]}],"backdrop-opacity":[{"backdrop-opacity":[Q,_,A]}],"backdrop-saturate":[{"backdrop-saturate":[Q,_,A]}],"backdrop-sepia":[{"backdrop-sepia":["",Q,_,A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",_,A]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Q,"initial",_,A]}],ease:[{ease:["linear","initial",v,_,A]}],delay:[{delay:[Q,_,A]}],animate:[{animate:["none",E,_,A]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,_,A]}],"perspective-origin":[{"perspective-origin":q()}],rotate:[{rotate:h()}],"rotate-x":[{"rotate-x":h()}],"rotate-y":[{"rotate-y":h()}],"rotate-z":[{"rotate-z":h()}],scale:[{scale:b()}],"scale-x":[{"scale-x":b()}],"scale-y":[{"scale-y":b()}],"scale-z":[{"scale-z":b()}],"scale-3d":["scale-3d"],skew:[{skew:N()}],"skew-x":[{"skew-x":N()}],"skew-y":[{"skew-y":N()}],transform:[{transform:[_,A,"","none","gpu","cpu"]}],"transform-origin":[{origin:q()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Y()}],"translate-x":[{"translate-x":Y()}],"translate-y":[{"translate-y":Y()}],"translate-z":[{"translate-z":Y()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",_,A]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",_,A]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[Q,Ue,Ie,ct]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}),Gr=({panel:e,measuredPixelSize:t,measuredPercentageSize:o,containerAxisSize:i,containerLabel:r})=>{const s=e?.size,n=typeof s=="number"&&Number.isFinite(s)?`${s.toFixed(3)}px`:"-",u=e?.percentageSize!==void 0?`${e.percentageSize.toFixed(3)}%`:"-",a=Number.isFinite(t)?`${t.toFixed(3)}px`:"-",g=Number.isFinite(o)?`${o.toFixed(3)}%`:"-",l=Number.isFinite(i)?`${i.toFixed(3)}px`:"-",c=`${n} / ${u}`,d=`${a} / ${g}`,S=e?.sizeUnit==="pixels"?"Fixed":"Flexible",P=[S,`${r}: ${l}`,`size (state): ${c}`,`size (measured): ${d}`];return{stateValueDisplay:c,measuredValueDisplay:d,containerDisplay:l,headlineLabel:S,titleText:P.join(`
23
+ `)}},Hr=x.memo(({panel:e,measuredPixelSize:t,measuredPercentageSize:o,containerAxisSize:i,direction:r})=>{const s=r==="horizontal"?"container width":"container height",{stateValueDisplay:n,measuredValueDisplay:u,containerDisplay:a,headlineLabel:g,titleText:l}=x.useMemo(()=>Gr({panel:e,measuredPixelSize:t,measuredPercentageSize:o,containerAxisSize:i,containerLabel:s}),[e,t,o,i,s]),c={position:"absolute",top:"2px",right:"4px",backgroundColor:"rgba(30, 41, 59, 0.6)",color:"#fff",padding:"4px 8px",borderRadius:"6px",fontSize:"11px",fontFamily:"monospace",pointerEvents:"auto",zIndex:10,boxShadow:"0 2px 4px rgba(0,0,0,0.3)",border:"1px solid rgba(255,255,255,0.1)",maxWidth:"calc(100% - 12px)",minWidth:"60px",width:"fit-content",overflow:"hidden"},d={display:"flex",flexDirection:"column",gap:"1px",minWidth:"0",width:"100%"},S={display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"6px",fontSize:"10px",color:"#ccc",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:"0",width:"100%"},P={display:"flex",justifyContent:"space-between",alignItems:"center",gap:"6px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:"0",width:"100%"},y={marginLeft:"auto",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"};return I.jsx("div",{style:c,title:l,children:I.jsxs("div",{style:d,children:[I.jsx("div",{style:S,children:I.jsx("span",{children:g})}),I.jsxs("div",{style:P,children:[I.jsx("span",{children:s}),I.jsx("span",{style:y,children:a})]}),I.jsxs("div",{style:P,children:[I.jsx("span",{children:"size (state)"}),I.jsx("span",{style:y,children:n})]}),I.jsxs("div",{style:P,children:[I.jsx("span",{children:"size (measured)"}),I.jsx("span",{style:y,children:u})]})]})})}),Ur={both:{collapseFromStart:!0,collapseFromEnd:!0},start:{collapseFromStart:!0,collapseFromEnd:!1},end:{collapseFromStart:!1,collapseFromEnd:!0}},Wr=e=>{if(!e)return{collapseFromStart:!1,collapseFromEnd:!1};const t=Ur[e.from];if(!t)throw new Error("Invalid collapsible configuration: unsupported 'from' value");return t},Wt=({ref:e,setState:t,panelIdRef:o,label:i})=>r=>{if(!Number.isFinite(r))return;const s=r<0?0:r;e.current!==s&&(e.current=s,console.debug(`[resize-panels] commit ${i}`,{panelId:o.current,[i]:s}),t(s))},Vr=x.memo(({id:e,defaultSize:t={value:50,unit:"percentage"},minSize:o,maxSize:i,autoMinSize:r,className:s,style:n,children:u,order:a=0,collapsible:g,defaultCollapsed:l=!1,pixelAdjustPriority:c,flexAdjustPriority:d,contentOverflow:S="auto"})=>{const{direction:P,registerPanel:y,unregisterPanel:M,getPanel:v,showDebugInfo:E,isContainerReady:C,reportPanelMeasurement:D,containerSize:q}=Ye(),ee=x.useRef(null),K=x.useRef(e||yt()),w=x.useMemo(()=>Wr(g),[g]),L=w.collapseFromStart||w.collapseFromEnd,X=x.useMemo(()=>L?w.collapseFromStart?"start":w.collapseFromEnd?"end":null:null,[L,w.collapseFromStart,w.collapseFromEnd]),ne=L&&l,W=x.useMemo(()=>Je(t),[t]),V=W?.unit==="pixels",ae=V?void 0:W?.value,k=v(K.current),T=!!k?.collapsed,J=(k?.size??0)<=0,R=T||J,[me,ze]=x.useState(()=>V&&W?W.value:k?.size!==void 0?k.size:0),[p,B]=x.useState(()=>!V&&W?W.value:k?.percentageSize!==void 0?k.percentageSize:0),O=x.useRef(p);O.current=p;const H=x.useRef(me);H.current=me;const fe=x.useMemo(()=>Wt({ref:H,setState:ze,panelIdRef:K,label:"pixel"}),[]),ge=x.useMemo(()=>Wt({ref:O,setState:B,panelIdRef:K,label:"percentage"}),[]),f=x.useCallback(()=>{H.current!==0&&(H.current=0,ze(0)),O.current!==0&&(O.current=0,B(0))},[]);x.useEffect(()=>{e||console.warn("Panel component should have an explicit 'id' prop to avoid hydration issues. Auto-generated ID may cause SSR/client mismatch.")},[e]),x.useEffect(()=>{if(!C)return;let j=0;if(V&&W){let G=W.value;o&&typeof o=="object"&&o.unit==="pixels"&&(G=Math.max(G,o.value)),i&&typeof i=="object"&&i.unit==="pixels"&&(G=Math.min(G,i.value)),j=G}const F=ne,oe=F?X:null;l&&!L&&console.warn("Panel defaultCollapsed is ignored because collapsible configuration is not provided.");const pe=L&&F&&V?j:void 0,le=L?ae:void 0,ce=V?j:void 0,de={id:K.current,size:F?0:j,percentageSize:F?0:ae,preferredPercentageSize:ae,preferredPixelSize:ce,sizeUnit:W?.unit||"percentage",originalPixelSize:V?j:void 0,minSize:o,maxSize:i,collapseFromStart:w.collapseFromStart,collapseFromEnd:w.collapseFromEnd,collapsedByDirection:oe,collapsed:F,sizeBeforeCollapse:pe,percentageSizeBeforeCollapse:le,preferredPercentageSizeBeforeCollapse:L?ae:void 0,preferredPixelSizeBeforeCollapse:L?ce:void 0,pixelAdjustPriority:c,flexAdjustPriority:d,autoMinSize:r};return y(de),()=>{M(K.current),D(K.current,null)}},[r,w.collapseFromEnd,w.collapseFromStart,l,W,d,L,C,V,i,o,c,X,ae,y,D,ne,M]);const z=k?.size??0;x.useEffect(()=>{const j=ee.current;if(!j)return;const F=()=>{if(!k)return;const de=j.parentElement;if(!de)return;const m=j.getBoundingClientRect(),G=ke(de,"horizontal"),ie=ke(de,"vertical"),te=P==="horizontal"?m.width:m.height,he=P==="horizontal"?G.inner:ie.inner,we=rt(he);if(R){f();return}const Re=k.size??0,ye=Math.max(2,we*.5);if(Re>we&&te<ye){console.debug("[resize-panels] skip noisy measurement",{panelId:K.current,expectedPanelSize:Re,measured:te,noiseThreshold:ye});return}if(te>0){fe(te),he>0&&ge(te/he*100);return}k.size!==void 0&&fe(k.size),k.percentageSize!==void 0?ge(k.percentageSize):k.sizeUnit==="pixels"&&k.size!==void 0&&he>0&&ge(k.size/he*100)},oe=new ResizeObserver(()=>{F()});oe.observe(j),F();const pe=[],le=new MutationObserver(()=>{(()=>{if(!ee.current)return!1;const m=ee.current.getBoundingClientRect();return(P==="horizontal"?m.width:m.height)!==H.current})()&&setTimeout(F,0)}),ce=j.parentElement;return ce&&le.observe(ce,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]}),()=>{oe.disconnect(),le.disconnect();for(const de of pe)clearTimeout(de)}},[ge,fe,k,P,R,f]);const h=k?.size,b=k?.percentageSize,N=k?.sizeUnit;x.useEffect(()=>{if(k){if(R){f();return}if(h!==void 0&&fe(h),b!==void 0)ge(b);else if(N==="pixels"&&h!==void 0){const j=ee.current,F=j?.parentElement;if(j&&F){const{width:oe,height:pe}=j.getBoundingClientRect(),le=F.clientWidth,ce=F.clientHeight,de=P==="horizontal"?oe:pe,m=P==="horizontal"?le:ce;if(de>0&&m>0){const G=de/m*100;ge(G)}}}}},[ge,fe,k,b,h,N,P,R,f]),x.useEffect(()=>{D(K.current,{pixelSize:me,percentageSize:p})},[D,me,p]);const Y=()=>R?"0px":k?.originalPixelSize!==void 0?`${z}px`:k?.percentageSize!==void 0?`${k.percentageSize}%`:`${z}px`,re=k?.sizeUnit==="percentage"&&!k?.collapsed?1:0,U={flexBasis:Y(),flexGrow:0,flexShrink:re,overflow:"hidden",position:"relative",boxSizing:"border-box",minHeight:"0px",minWidth:"0px",...n};P==="horizontal"?(U.height="100%",U.minWidth=0):(U.width="100%",U.minHeight=0),R&&(P==="horizontal"?(U.width="0px",U.minWidth="0px"):(U.height="0px",U.minHeight="0px"),U.flexGrow=0,U.flexShrink=0,U.pointerEvents="none",U.visibility="hidden",T&&(U.display="none"));const $=P==="horizontal"?q.width:q.height,Z=x.useMemo(()=>({position:"absolute",inset:"0px",overflow:S,display:"flex",flexDirection:"column",width:"100%",height:"100%",minWidth:"0px",minHeight:"0px"}),[S]);return I.jsxs("div",{ref:ee,className:We("panel",s),style:U,"data-panel-id":K.current,"data-panel-size":z,"data-panel-size-unit":k?.sizeUnit||"percentage","data-panel-pixel-size":k?.sizeUnit==="pixels"?k?.originalPixelSize:null,"data-panel-order":a,"data-panel-collapsible":L,"data-panel-collapse-start":w.collapseFromStart,"data-panel-collapse-end":w.collapseFromEnd,"data-panel-collapsed":k?.collapsed,"aria-hidden":R,children:[I.jsx("div",{style:Z,children:u}),E&&I.jsx(Hr,{panel:k,measuredPixelSize:me,measuredPercentageSize:p,containerAxisSize:$,direction:P})]})}),Yr=e=>JSON.stringify(e.map(t=>({id:t.id,size:t.size,percentageSize:t.percentageSize??null,preferredPercentageSize:t.preferredPercentageSize??null,preferredPixelSize:t.preferredPixelSize??null,sizeUnit:t.sizeUnit,originalPixelSize:t.originalPixelSize??null,minSize:t.minSize??null,maxSize:t.maxSize??null,autoMinSize:t.autoMinSize??null,collapseFromStart:t.collapseFromStart,collapseFromEnd:t.collapseFromEnd,collapsedByDirection:t.collapsedByDirection??null,collapsed:t.collapsed??!1,sizeBeforeCollapse:t.sizeBeforeCollapse??null,preferredPercentageSizeBeforeCollapse:t.preferredPercentageSizeBeforeCollapse??null,preferredPixelSizeBeforeCollapse:t.preferredPixelSizeBeforeCollapse??null,measuredPixelSizeBeforeCollapse:t.measuredPixelSizeBeforeCollapse??null,pixelAdjustPriority:t.pixelAdjustPriority??null,flexAdjustPriority:t.flexAdjustPriority??null,measuredPixelSize:t.measuredPixelSize??null,measuredPercentageSize:t.measuredPercentageSize??null}))),Jr=e=>JSON.stringify(e.map(t=>({id:t.id,thickness:t.thickness,visible:t.visible,direction:t.direction,startPanelId:t.startPanelId??null,endPanelId:t.endPanelId??null}))),ve=(()=>{const e=new Set,t=new Map,o=new Set;let i=null,r=0,s=!0,n=[],u={ownerId:null,groups:n};const a=()=>{for(const v of e)v()},g=()=>{s=!0,a()},l=()=>{const v=i;if(v&&o.has(v))return!1;i=null;const E=o.values().next();return E.done||(i=E.value),v!==i};return{subscribe:v=>(e.add(v),()=>{e.delete(v)}),getSnapshot:()=>(l()&&(s=!0),s&&(n=Array.from(t.values()).sort((E,C)=>E.index-C.index).map(({serializedPanels:E,serializedHandles:C,...D})=>D),u={ownerId:i,groups:n},s=!1),u),getOwnerId:()=>(l()&&(s=!0),i),enableGroup:v=>{const E=o.size;o.add(v),o.size!==E&&l()&&g()},disableGroup:v=>{o.delete(v)&&l()&&g()},updateGroup:(v,E)=>{const C=t.get(v),D=C?.index??r++,q=Yr(E.panels),ee=Jr(E.handles),K=C?.displayName!==E.displayName,w=C?.direction!==E.direction,L=C?C.containerSize.width!==E.containerSize.width||C.containerSize.height!==E.containerSize.height:!0;let X=C?.serializedPanels!==q;if(!X&&C)if(C.panels.length!==E.panels.length)X=!0;else for(let k=0;k<E.panels.length;k+=1){const T=C.panels[k],J=E.panels[k];if(!(T&&J)){X=!0;break}if(T.id!==J.id||T.size!==J.size||T.percentageSize!==J.percentageSize||T.collapsed!==J.collapsed||T.measuredPixelSize!==J.measuredPixelSize||T.measuredPercentageSize!==J.measuredPercentageSize){X=!0;break}}let ne=C?.serializedHandles!==ee;if(!ne&&C)if(C.handles.length!==E.handles.length)ne=!0;else for(let k=0;k<E.handles.length;k+=1){const T=C.handles[k],J=E.handles[k];if(!(T&&J)){ne=!0;break}if(T.id!==J.id||T.thickness!==J.thickness||T.visible!==J.visible||T.direction!==J.direction||T.startPanelId!==J.startPanelId||T.endPanelId!==J.endPanelId){ne=!0;break}}if(!C&&E.panels.length===0&&E.handles.length===0||C&&!K&&!w&&!L&&!X&&!ne)return;const W=E.panels.map(k=>({...k})),V=E.handles.map(k=>({...k})),ae={...E.containerSize};t.set(v,{groupId:v,displayName:E.displayName,direction:E.direction,containerSize:ae,panels:W,handles:V,index:D,serializedPanels:q,serializedHandles:ee}),g()},removeGroup:v=>{const E=t.delete(v),C=o.delete(v),D=l();(E||C||D)&&g()}}})(),Xr=()=>x.useSyncExternalStore(ve.subscribe,ve.getOwnerId,ve.getOwnerId),Zr=()=>x.useSyncExternalStore(ve.subscribe,ve.getSnapshot,ve.getSnapshot),Qr=e=>{ve.enableGroup(e)},Vt=e=>{ve.disableGroup(e)},Kr=(e,t)=>{ve.updateGroup(e,t)},Yt=e=>{ve.removeGroup(e)};let Jt=0;const qr=()=>(Jt+=1,`panel-group-${Jt}`),je=(e,t)=>typeof e!="number"||!Number.isFinite(e)?"—":`${(e<0?0:e).toFixed(8)}${t}`,$r={position:"fixed",left:"50%",bottom:"20px",transform:"translate(-50%, 0)",zIndex:100,maxWidth:"min(90vw, 1120px)",width:"100%",borderRadius:"14px",backgroundColor:"rgba(15, 23, 42, 0.72)",color:"#e2e8f0",fontFamily:"monospace",fontSize:"11px",lineHeight:1.6,boxShadow:"0 22px 45px rgba(15,23,42,0.45)",border:"1px solid rgba(148, 163, 184, 0.22)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",pointerEvents:"auto",overflow:"auto"},en={display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"12px"},tn={display:"flex",flexDirection:"column",gap:"4px"},rn={padding:"6px 10px",borderRadius:"9999px",border:"1px solid rgba(148, 163, 184, 0.35)",color:"#e2e8f0",fontWeight:600,fontSize:"10px",letterSpacing:"0.03em",textTransform:"uppercase",cursor:"pointer",transition:"background-color 0.18s ease, border-color 0.18s ease"},nn={padding:"10px 12px",borderRadius:"10px",backgroundColor:"rgba(30, 41, 59, 0.55)",border:"1px solid rgba(148, 163, 184, 0.18)",display:"flex",flexDirection:"column",gap:"10px"},on={padding:"8px 10px",borderRadius:"8px",backgroundColor:"rgba(15, 23, 42, 0.55)",border:"1px solid rgba(148, 163, 184, 0.16)",display:"flex",flexDirection:"column",gap:"4px"},Xt={display:"flex",justifyContent:"space-between",alignItems:"center",gap:"6px"},sn={display:"grid",gridTemplateColumns:"auto 1fr",gap:"2px 10px",color:"#e2e8f0"},an={padding:"2px 6px",borderRadius:"9999px",fontSize:"10px",textTransform:"uppercase"},ln=e=>{const t=e.reason==="minimum-exceeded",o=t?"Layout unavailable: minimum panel sizes exceed the container.":"Layout unavailable: panels cannot fill the container with their maximum sizes.",i=t?`Min required: ${Math.ceil(e.totalMinimumSize??0)}px | Available: ${Math.floor(e.availableContainerSize)}px`:`Max total: ${Math.floor(e.totalMaximumSize??0)}px | Needed: ${Math.floor(e.availableContainerSize)}px`;return{summary:o,detail:i}},cn=(e,t)=>{let o=!1;const i=e.map(r=>{const s=t[r.id];return!s||r.measuredPixelSize===s.pixelSize&&r.measuredPercentageSize===s.percentageSize?r:(o=!0,{...r,measuredPixelSize:s.pixelSize,measuredPercentageSize:s.percentageSize})});return o?i:e},Zt=(e,t,o)=>{const i=ke(e,"horizontal"),r=ke(e,"vertical"),s=e.getBoundingClientRect(),n=i.inner>0?i.inner:t??s.width,u=r.inner>0?r.inner:o??s.height;return{width:n,height:u}},dn=e=>{const{id:t,className:o,style:i,children:r,direction:s}=e,{groupRef:n,contextValue:u,groupStyle:a}=Et(e),[g,l]=x.useState({width:0,height:0}),c=u.layoutConstraintViolation,d=!!c,S=x.useMemo(()=>{if(!c)return null;const{summary:W,detail:V}=ln(c);return I.jsxs("div",{className:"flex w-full flex-1 flex-col items-center justify-center gap-2 rounded-lg border border-slate-300 border-dashed bg-slate-100/70 px-6 py-8 text-center text-slate-600 text-sm dark:border-slate-600 dark:bg-slate-800/50 dark:text-slate-200","data-panel-group-placeholder":"constraint-violation",children:[I.jsx("span",{children:W}),I.jsx("span",{className:"text-slate-500 text-xs dark:text-slate-400",children:V})]})},[c]),y=x.useRef(t??qr()).current,M=t??y,v=u.showDebugInfo&&u.panels.length>0,E=v?u.panels:[],C=v?u.panelMeasurements:{},D=x.useMemo(()=>{if(!v)return[];const W=Object.values(u.handleMeasurements);return W.length<=1?W:W.slice().sort((V,ae)=>V.id.localeCompare(ae.id))},[u.handleMeasurements,v]),q=u.containerSize,ee=g.width>0?g.width:q.width,K=g.height>0?g.height:q.height,w=Xr(),L=v&&w===y;x.useLayoutEffect(()=>{if(!v){l({width:0,height:0});return}if(typeof window>"u"||typeof ResizeObserver>"u")return;const W=n.current;if(!W)return;const V=k=>{l(T=>T.width===k.width&&T.height===k.height?T:k)},ae=new ResizeObserver(k=>{for(const T of k){if(T.target!==W)continue;const J=Zt(W,T.contentRect.width,T.contentRect.height);V(J)}});return ae.observe(W),V(Zt(W)),()=>{ae.disconnect()}},[n,v]);const X=x.useMemo(()=>cn(E,C),[E,C]);x.useEffect(()=>{if(!v){Vt(y),Yt(y);return}return Qr(y),()=>{Vt(y),Yt(y)}},[v,y]),x.useEffect(()=>{v&&Kr(y,{displayName:M,direction:s,containerSize:{width:ee,height:K},panels:X,handles:D})},[v,y,M,s,ee,K,X,D]);const ne=x.useMemo(()=>{const W={...a,...i};return W.position||(W.position="relative"),W},[a,i]);return I.jsxs(tt.Provider,{value:u,children:[I.jsxs("div",{ref:n,className:We("panel-group",s==="horizontal"?"flex-row":"flex-col",o),style:ne,"data-panel-group-id":t,"data-panel-group-direction":s,children:[r,d&&S?I.jsx("div",{className:"pointer-events-auto",style:{position:"absolute",inset:0,zIndex:40,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(248, 250, 252, 0.82)",backdropFilter:"blur(2px)"},children:S}):null]}),L&&I.jsx(un,{})]})},un=()=>{const t=Zr().groups,[o,i]=x.useState(!0);if(t.length===0||typeof document>"u")return null;const r=t.reduce((a,g)=>a+g.panels.length,0),s=t.reduce((a,g)=>a+(g.handles?.length??0),0),n=()=>i(a=>!a),u=I.jsxs("div",{style:{...$r,padding:o?"10px 18px":"14px 18px",maxHeight:o?"52px":"min(65vh, 520px)",transition:"max-height 0.24s ease, padding 0.24s ease"},children:[I.jsxs("div",{style:{...en,marginBottom:o?0:"12px"},children:[I.jsxs("div",{style:tn,children:[I.jsx("span",{style:{fontWeight:700,fontSize:"12px",letterSpacing:"0.03em"},children:"Panel Overview"}),I.jsxs("span",{style:{color:"#cbd5f5"},children:["groups: ",t.length," / panels: ",r," / resizers: ",s]})]}),I.jsx("button",{type:"button",onClick:n,style:{...rn,backgroundColor:o?"rgba(59, 130, 246, 0.2)":"rgba(71, 85, 105, 0.45)"},title:o?"Panel Overview を開く":"Panel Overview を閉じる",children:o?"開く":"閉じる"})]}),!o&&I.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px",maxHeight:"45vh",overflowY:"auto",paddingRight:"6px"},children:t.map((a,g)=>{const l=a.direction==="horizontal"?a.containerSize.width:a.containerSize.height;return I.jsxs("div",{style:nn,children:[I.jsxs("div",{style:{...Xt,flexWrap:"wrap",gap:"10px",color:"#dbeafe"},children:[I.jsxs("span",{style:{fontWeight:600,fontSize:"11px",letterSpacing:"0.02em",textTransform:"uppercase"},children:["group ",g+1,": ",a.displayName]}),I.jsxs("span",{children:["direction: ",a.direction," / container: ",je(a.containerSize.width,"px")," × ",je(a.containerSize.height,"px")]})]}),I.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:"10px"},children:a.panels.map((c,d)=>{const S=c.measuredPixelSize??c.size,P=c.size,y=je(P,"px"),M=c.percentageSize??(l>0?c.size/l*100:void 0),v=c.measuredPercentageSize!==void 0?c.measuredPercentageSize:l>0?S/l*100:void 0,E=c.collapsed||S<=ft,C=c.collapsed?"collapsed":E?"hidden":"visible",D=je(M,"%"),q=je(v,"%"),ee=je(S,"px");return I.jsxs("div",{style:on,children:[I.jsxs("div",{style:Xt,children:[I.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:c.id}),I.jsx("span",{style:{...an,backgroundColor:c.collapsed?"rgba(251, 113, 133, 0.25)":E?"rgba(250, 204, 21, 0.25)":"rgba(74, 222, 128, 0.25)",color:c.collapsed?"#fecdd3":E?"#fef08a":"#bbf7d0"},children:C})]}),I.jsxs("div",{style:sn,children:[I.jsx("span",{children:"size (state):"}),I.jsx("span",{children:y}),I.jsx("span",{children:"size (measured):"}),I.jsx("span",{children:ee}),I.jsx("span",{children:"percentage (state):"}),I.jsx("span",{children:D}),I.jsx("span",{children:"percentage (measured):"}),I.jsx("span",{children:q}),I.jsx("span",{children:"unit:"}),I.jsx("span",{children:c.sizeUnit}),I.jsx("span",{children:"min:"}),I.jsx("span",{children:c.minSize!==void 0?JSON.stringify(c.minSize):"—"}),I.jsx("span",{children:"auto min:"}),I.jsx("span",{children:c.autoMinSize!==void 0?JSON.stringify(c.autoMinSize):"—"}),I.jsx("span",{children:"max:"}),I.jsx("span",{children:c.maxSize!==void 0?JSON.stringify(c.maxSize):"—"}),I.jsx("span",{children:"priority:"}),I.jsx("span",{children:c.pixelAdjustPriority??"—"}),I.jsx("span",{children:"flex priority:"}),I.jsx("span",{children:c.flexAdjustPriority??"—"})]})]},c.id||d)})})]},a.groupId)})})]});return Kt.createPortal(u,document.body)},fn=x.memo(({id:e,disabled:t=!1,className:o,style:i,children:r,onDragging:s})=>{const{direction:n,resizePanels:u,getPanel:a,collapsePanel:g,expandPanel:l,panels:c,reportHandleMeasurement:d,containerSize:S,layoutConstraintViolation:P}=Ye(),[y,M]=x.useState(!1),v=x.useRef(null),E=x.useRef(null),C=x.useRef(""),D=x.useRef(""),[q,ee]=x.useState({left:null,right:null}),K=x.useRef(e??nr()),w=x.useRef(null),L=e??K.current,X=!!P,ne=t||X;x.useEffect(()=>{if(v.current){const h=v.current.parentElement;if(h){E.current=h;const b=Array.from(h.children),N=v.current,Y=b.indexOf(N);if(Y>0&&Y<b.length-1){let re=null,U=null;for(let $=Y-1;$>=0;$-=1){const Z=b[$];if(Z.dataset.panelId){re=Z;break}}for(let $=Y+1;$<b.length;$+=1){const Z=b[$];if(Z.dataset.panelId){U=Z;break}}C.current=re?.dataset.panelId||"",D.current=U?.dataset.panelId||"",ee({left:C.current||null,right:D.current||null})}}}},[]),x.useEffect(()=>{if(L===K.current)return;const h=K.current;K.current=L,w.current=null,h!==L&&d(h,null)},[d,L]),x.useEffect(()=>{const h=K.current;return()=>{d(h,null)}},[d]);const W=x.useCallback(h=>{if(ne||!E.current)return;h.preventDefault(),h.stopPropagation();const b=E.current,{inner:N}=ke(b,n),Y={x:h.clientX,y:h.clientY},re=a(C.current),U=a(D.current);if(!(re&&U))return;const $=re.size,Z=U.size;let j=0;const F=$t;M(!0),s?.(!0),h.currentTarget.setPointerCapture(h.pointerId);const oe=le=>{if(!v.current)return;le.preventDefault(),le.stopPropagation();const ce=performance.now();if(ce-j<F)return;j=ce;const de=n==="horizontal"?le.clientX-Y.x:le.clientY-Y.y;if(de===0)return;const m=$+de,G=Z-de,ie=a(C.current),te=a(D.current);if(ie&&te&&C.current&&D.current){const he=se(ie.minSize,0,N),we=se(te.minSize,0,N),Re=he,ye=we,Be=Math.min(N*mt,gt),Te=Math.min(N*er,tr),Ce=te.collapseFromStart,Ne=te.collapsedByDirection??"start";if(Ce&&!te.collapsed&&G<=Math.max(we*.3,Be)){g(D.current,"start");return}const hn=ie.collapseFromEnd,xn=ie.collapsedByDirection??"end";if(hn&&!ie.collapsed&&m<=Math.max(he*.3,Be)){g(C.current,"end");return}if(te.collapsed&&G>Math.max(we*.3,Te)){l(D.current,Ne,G);return}if(ie.collapsed&&m>Math.max(he*.3,Te)){l(C.current,xn,m);return}if(N>0){const Qt=ie.size+te.size,et=rt(N);let dt=!1;if(Re<=et&&m<=et&&$!==0){const Ve=Math.max(0,Qt-0);Ve>=ye&&(u(C.current,D.current,0,Ve),dt=!0)}else if(ye<=et&&G<=et&&Z!==0){const Ve=Math.max(0,Qt-0);Ve>=Re&&(u(C.current,D.current,Ve,0),dt=!0)}if(dt)return}if(ie.collapsed||te.collapsed)return;u(C.current,D.current,m,G)}},pe=()=>{M(!1),s?.(!1),document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",pe)};document.addEventListener("pointermove",oe),document.addEventListener("pointerup",pe)},[ne,n,u,a,g,l,s]),V=n==="horizontal",k=We("group absolute z-20 flex select-none items-center justify-center border-none bg-transparent transition-colors duration-150 overflow-visible",V?"cursor-col-resize":"cursor-row-resize",V?"h-full":"w-full",!ne&&"hover:bg-gray-200/70 dark:hover:bg-gray-700/70",!ne&&"active:bg-blue-300/60 dark:active:bg-blue-700/60",y&&"bg-blue-200/80 dark:bg-blue-800/60",ne&&"cursor-not-allowed opacity-50","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50",o),T=x.useMemo(()=>{const h=b=>{if(!b)return-1;for(let N=0;N<c.length;N+=1)if(c[N].id===b)return N;return-1};return{left:h(q.left),right:h(q.right)}},[q.left,q.right,c]),J=V?S.width:S.height,R=x.useMemo(()=>{const h=(b,N)=>{if(b>N)return 0;let Y=0;for(let re=b;re<=N;re+=1){const U=c[re];if(!U)continue;const $=U.size??0,Z=Math.max(0,$);Y+=U.collapsed?0:Z}return Y};return T.left>=0?h(0,T.left):T.right>0?h(0,T.right-1):0},[T.left,T.right,c]),me=x.useMemo(()=>!Number.isFinite(R)||R<0?0:J>0&&R>J?J:R,[R,J]),ze=x.useMemo(()=>{const h={position:"absolute",zIndex:20,touchAction:"none"};return V?(h.top=0,h.left=`${me}px`,h.transform="translateX(-50%)",h.width=`${pt}px`,h.height="100%"):(h.left=0,h.top=`${me}px`,h.transform="translateY(-50%)",h.height=`${pt}px`,h.width="100%"),h},[me,V]),p=x.useMemo(()=>{const h=rt(J),b=F=>{if(F<0||F>=c.length)return!1;const oe=c[F];return oe?oe.collapsed?!0:oe.size<=h:!1},N=(F,oe)=>{if(!b(F))return 0;let pe=0;for(let le=F;le>=0&&le<c.length&&b(le);le+=oe)pe+=1;return pe},Y=T.left,re=T.right,U=Y>=0?N(Y,-1):0,$=re>=0?N(re,1):0;return{groupSize:U+$+1,overlapIndex:U}},[T.left,T.right,c,J]),B=x.useMemo(()=>{if(X)return!0;if(p.groupSize<=1)return!1;const h=p.groupSize-1;return p.overlapIndex>0&&p.overlapIndex<h},[p,X]),O=x.useMemo(()=>{if(p.groupSize<=1||B)return 0;const h=p.groupSize>1?2:1;if(h===1)return 0;const b=p.overlapIndex===0?0:h-1,N=(h-1)/2;return(b-N)*qt},[p,B]),H=x.useMemo(()=>{if(B)return{display:"none"};if(O!==0)return V?{transform:`translateX(${O}px)`}:{transform:`translateY(${O}px)`}},[O,V,B]),fe=We("flex items-center justify-center rounded-full bg-white text-slate-700 ring-1 ring-inset ring-white/80 backdrop-blur-sm transition-colors duration-150 shadow-[0_0_0_1px_rgba(255,255,255,0.85),0_1px_3px_rgba(15,23,42,0.18)]","dark:bg-slate-800/95 dark:text-slate-200 dark:ring-slate-500/60 dark:shadow-[0_0_0_1px_rgba(148,163,184,0.45),0_1px_3px_rgba(2,6,23,0.55)]",V?"h-12 w-[6px] px-[2px]":"h-[6px] w-20 py-[2px]",y&&"bg-blue-200/80 ring-blue-300 shadow-[0_0_0_1px_rgba(191,219,254,0.65),0_1px_4px_rgba(59,130,246,0.45)] dark:bg-blue-900/70 dark:ring-blue-400 dark:shadow-[0_0_0_1px_rgba(147,197,253,0.5),0_1px_4px_rgba(59,130,246,0.55)]"),ge=We("rounded-full bg-slate-600 transition-colors duration-150 shadow-[0_0_0_1px_rgba(255,255,255,0.9)] dark:bg-slate-200 dark:shadow-[0_0_0_1px_rgba(15,23,42,0.55)]",V?"h-8 w-[2px]":"h-[2px] w-16",y&&"bg-blue-500 dark:bg-blue-300",!ne&&"group-hover:bg-slate-700 dark:group-hover:bg-slate-100"),f=x.useCallback(()=>{const h=v.current;if(!h)return;let b=0;if(!B){const re=n==="horizontal"?h.offsetWidth:h.offsetHeight;let U=0,$=0;if(typeof window<"u"){const j=window.getComputedStyle(h);n==="horizontal"?(U=Number.parseFloat(j.marginLeft||"0"),$=Number.parseFloat(j.marginRight||"0")):(U=Number.parseFloat(j.marginTop||"0"),$=Number.parseFloat(j.marginBottom||"0"))}b=[re,U,$].reduce((j,F)=>Number.isFinite(F)?j+F:j,0)}(!Number.isFinite(b)||b<0)&&(b=0);const N={id:L,thickness:b,direction:n,visible:!B&&b>rr,startPanelId:q.left,endPanelId:q.right},Y=w.current;Y&&Math.abs(Y.thickness-N.thickness)<=.25&&Y.visible===N.visible&&Y.direction===N.direction&&Y.startPanelId===N.startPanelId&&Y.endPanelId===N.endPanelId||(w.current=N,d(L,N))},[n,q.left,q.right,d,L,B]);x.useEffect(()=>{f()},[f]),x.useEffect(()=>{const h=v.current;if(!h)return;if(typeof ResizeObserver>"u"){f();return}const b=new ResizeObserver(()=>{f()});return b.observe(h),()=>{b.disconnect()}},[f]);const z=x.useMemo(()=>{const h=i?{...ze,...i}:ze;return B?{...h,display:"none",pointerEvents:"none",visibility:"hidden"}:h},[ze,B,i]);return I.jsx("button",{type:"button",ref:v,className:k,style:z,onPointerDown:W,disabled:ne,"aria-hidden":B||void 0,"aria-label":`Resize ${V?"columns":"rows"} - Drag to collapse/expand panels`,"data-resize-handle-id":L,title:`ドラッグして${V?"列":"行"}をリサイズ、端まで移動して折りたたみ/展開`,children:r||I.jsx("div",{className:fe,style:H,children:I.jsx("span",{className:ge})})})}),pn=e=>document.querySelector(`[data-panel-id="${e}"]`),mn=e=>document.querySelector(`[data-panel-group-id="${e}"]`),gn=e=>document.querySelector(`[data-resize-handle-id="${e}"]`);ue.Panel=Vr,ue.PanelGroup=dn,ue.PanelGroupContext=tt,ue.PanelResizeHandle=fn,ue.clamp=Se,ue.generatePanelId=yt,ue.getConstraintInPixels=se,ue.getContainerSize=ke,ue.getPanelElement=pn,ue.getPanelGroupElement=mn,ue.getResizeHandleElement=gn,ue.loadLayout=wt,ue.normalizeSizeConfig=Je,ue.saveLayout=vt,ue.usePanelControls=ir,ue.usePanelGroup=Ye,ue.useResizablePanels=Et,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})}));
package/dist/reducer.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { PanelLayoutData } from './types';
1
+ import { PanelCollapseDirection, PanelLayoutData } from './types';
2
2
 
3
3
  export type PanelAction = {
4
4
  type: "REGISTER_PANEL";
@@ -24,10 +24,12 @@ export type PanelAction = {
24
24
  type: "COLLAPSE_PANEL";
25
25
  id: string;
26
26
  containerSize: number;
27
+ from: PanelCollapseDirection;
27
28
  } | {
28
29
  type: "EXPAND_PANEL";
29
30
  id: string;
30
31
  containerSize: number;
32
+ from: PanelCollapseDirection;
31
33
  targetSize?: number;
32
34
  };
33
35
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../src/reducer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAkC,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAwkB9E,MAAM,MAAM,WAAW,GACjB;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,eAAe,CAAA;CAAE,GAClD;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,GACvH;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,GACjD;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,YAAY,GAAG,UAAU,CAAA;CAAE,GAC1F;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAiCtF;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,eAAe,EAAE,EAAE,QAAQ,WAAW,KAAG,eAAe,EAmT3F,CAAA"}
1
+ {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../src/reducer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AA8rBtE,MAAM,MAAM,WAAW,GACjB;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,eAAe,CAAA;CAAE,GAClD;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,GACvH;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,GACjD;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,YAAY,GAAG,UAAU,CAAA;CAAE,GAC1F;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,sBAAsB,CAAA;CAAE,GAC3F;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,sBAAsB,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAiCpH;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,eAAe,EAAE,EAAE,QAAQ,WAAW,KAAG,eAAe,EAwe3F,CAAA"}