import{i as f,n as u}from"./app-JmgyQoR0.js";import{b as g,g as m,q as l,h as s,t as o,u as i,B as n,H as r,l as p,j as y,E as c,x as d,v,T as B}from"./vue-y3KLWBaS.js";const w=g({props:{showHeader:{type:Boolean,required:!1,default:!0},thin:{type:Boolean,required:!1,default:!1},naked:{type:Boolean,required:!1,default:!1},foldable:{type:Boolean,required:!1,default:!1},expanded:{type:Boolean,required:!1,default:!0},scrollable:{type:Boolean,required:!1,default:!1},maxHeight:{type:Number,required:!1,default:null}},data(){return{showBody:this.expanded,omitted:null,ignoreOmit:!1,i18n:f}},mounted(){this.$watch("showBody",t=>{const a=this.showHeader?this.$refs.header.offsetHeight:0;this.$el.style.minHeight=`${a}px`,t?this.$el.style.flexBasis="auto":this.$el.style.flexBasis=`${a}px`},{immediate:!0}),this.$el.style.setProperty("--maxHeight",this.maxHeight+"px");const e=()=>{if(this.omitted||this.ignoreOmit||this.maxHeight==null)return;const t=this.$refs.content.offsetHeight;this.omitted=t>this.maxHeight};e(),new ResizeObserver((t,a)=>{e()}).observe(this.$refs.content)},methods:{toggleContent(e){this.foldable&&(this.showBody=e)},enter(e){const t=e.getBoundingClientRect().height;e.style.height=0,e.offsetHeight,e.style.height=t+"px"},afterEnter(e){e.style.height=null},leave(e){const t=e.getBoundingClientRect().height;e.style.height=t+"px",e.offsetHeight,e.style.height=0},afterLeave(e){e.style.height=null}}}),H={key:0,ref:"header"},b={class:"title"},$={class:"sub"},k={key:0,class:"ph-caret-up ph-bold ph-lg"},C={key:1,class:"ph-caret-down ph-bold ph-lg"};function q(e,t,a,E,L,O){const h=m("size");return l((s(),o("div",{class:d(["ukygtjoj _panel",{naked:e.naked,thin:e.thin,hideHeader:!e.showHeader,scrollable:e.scrollable,closed:!e.showBody}])},[e.showHeader?(s(),o("header",H,[i("div",b,[n(e.$slots,"header",{},void 0,!0)]),i("div",$,[n(e.$slots,"func",{},void 0,!0),e.foldable?(s(),o("button",{key:0,class:"_button",onClick:t[0]||(t[0]=()=>e.showBody=!e.showBody)},[e.showBody?(s(),o("i",k)):(s(),o("i",C))])):r("",!0)])],512)):r("",!0),p(B,{name:e.$store.state.animation?"container-toggle":"",onEnter:e.enter,onAfterEnter:e.afterEnter,onLeave:e.leave,onAfterLeave:e.afterLeave},{default:y(()=>[l(i("div",{ref:"content",class:d(["content",{omitted:e.omitted}])},[n(e.$slots,"default",{},void 0,!0),e.omitted?(s(),o("button",{key:0,class:"fade _button",onClick:t[1]||(t[1]=()=>{e.ignoreOmit=!0,e.omitted=!1})},[i("span",null,c(e.i18n.ts.showMore),1)])):r("",!0)],2),[[v,e.showBody]])]),_:3},8,["name","onEnter","onAfterEnter","onLeave","onAfterLeave"])],2)),[[h,{max:[380]}]])}const N=u(w,[["render",q],["__scopeId","data-v-ca2ddd11"]]);export{N as M};
