import{C as e,I as t,It as n,Q as r,Wt as i,X as a,Y as o,an as s,bt as c,j as l,lt as u,mt as d,tt as f,x as p}from"./_plugin-vue_export-helper-BVhEvvHC.js";import{Jr as m,Zr as h,gr as g}from"./src-CD6Jsigc.js";t(),i(),c();var _=l({__name:`SplitterPanel`,props:{collapsedSize:{type:Number,required:!1},collapsible:{type:Boolean,required:!1},defaultSize:{type:Number,required:!1},id:{type:String,required:!1},maxSize:{type:Number,required:!1},minSize:{type:Number,required:!1},order:{type:Number,required:!1},sizeUnit:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`collapse`,`expand`,`resize`],setup(t,{expose:i,emit:c}){let l=t,_=c,v=g();if(v===null)throw Error(`SplitterPanel components must be rendered within a SplitterGroup container`);let{collapsePanel:y,expandPanel:b,getPanelSize:x,getPanelStyle:S,isPanelCollapsed:C,resizePanel:w,groupId:T,reevaluatePanelConstraints:E,registerPanel:D,unregisterPanel:O}=v,k=h(l.id,`reka-splitter-panel`),A=p(()=>({callbacks:{onCollapse:()=>_(`collapse`),onExpand:()=>_(`expand`),onResize:(...e)=>_(`resize`,...e)},constraints:{collapsedSize:l.collapsedSize&&Number.parseFloat(l.collapsedSize.toFixed(10)),collapsible:l.collapsible,defaultSize:l.defaultSize,maxSize:l.maxSize,minSize:l.minSize,sizeUnit:l.sizeUnit??`%`},id:k,idIsFromProps:l.id!==void 0,order:l.order}));u(()=>A.value.constraints,(e,t)=>{(t.collapsedSize!==e.collapsedSize||t.collapsible!==e.collapsible||t.maxSize!==e.maxSize||t.minSize!==e.minSize||t.sizeUnit!==e.sizeUnit)&&E(A.value,t)},{deep:!0}),o(()=>{D(A.value)}),a(()=>{O(A.value)});let j=p(()=>S(A.value,l.defaultSize)),M=p(()=>C(A.value)),N=p(()=>!M.value);function P(){y(A.value)}function F(){b(A.value)}function I(e){w(A.value,e)}return i({collapse:P,expand:F,getSize(){return x(A.value)},resize:I,isCollapsed:M,isExpanded:N}),(t,i)=>(r(),e(n(m),{id:n(k),style:s(j.value),as:t.as,"as-child":t.asChild,"data-panel":``,"data-panel-collapsible":t.collapsible||void 0,"data-panel-group-id":n(T),"data-panel-id":n(k),"data-panel-size":Number.parseFloat(`${j.value.flexGrow}`).toFixed(1),"data-state":t.collapsible?M.value?`collapsed`:`expanded`:void 0},{default:d(()=>[f(t.$slots,`default`,{isCollapsed:M.value,isExpanded:N.value,expand:F,collapse:P,resize:I})]),_:3},8,[`id`,`style`,`as`,`as-child`,`data-panel-collapsible`,`data-panel-group-id`,`data-panel-id`,`data-panel-size`,`data-state`]))}});export{_ as t};