import{aY as B,aZ as F,b4 as ae,cD as S,cE as T,bH as se,r as K,df as W,aM as le,bd as te,a_ as Y,Y as d,d as _,o as z,c as D,aC as x,T as m,a as e,a$ as L,dH as M,aR as ie,g as A,y as oe,t as ne,f as w,w as O,c0 as de,bb as ce,N as re,aL as ue,z as pe,$ as me,dI as ve,b0 as be,b3 as fe,__tla as he}from"./index-8dc1e40a.js";let R,Z,Ce=Promise.all([(()=>{try{return he}catch{}})()]).then(async()=>{const $=v=>typeof se(v),j=B({accordion:Boolean,modelValue:{type:F([Array,String,Number]),default:()=>ae([])}}),q={[S]:$,[T]:$},E=Symbol("collapseContextKey"),P=_({name:"ElCollapse"});var G=L(_({...P,props:j,emits:q,setup(v,{expose:k,emit:f}){const h=v,{activeNames:g,setActiveNames:r}=((t,u)=>{const o=K(W(t.modelValue)),b=c=>{o.value=c;const n=t.accordion?o.value[0]:o.value;u(S,n),u(T,n)};return le(()=>t.modelValue,()=>o.value=W(t.modelValue),{deep:!0}),te(E,{activeNames:o,handleItemClick:c=>{if(t.accordion)b([o.value[0]===c?"":c]);else{const n=[...o.value],y=n.indexOf(c);y>-1?n.splice(y,1):n.push(c),b(n)}}}),{activeNames:o,setActiveNames:b}})(h,f),{rootKls:C}=(()=>{const t=Y("collapse");return{rootKls:d(()=>t.b())}})();return k({activeNames:g,setActiveNames:r}),(t,u)=>(z(),D("div",{class:m(e(C))},[x(t.$slots,"default")],2))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/collapse/src/collapse.vue"]]);const J=B({title:{type:String,default:""},name:{type:F([String,Number]),default:()=>M()},disabled:Boolean}),Q=["id","aria-expanded","aria-controls","aria-describedby","tabindex"],U=["id","aria-hidden","aria-labelledby"],X=_({name:"ElCollapseItem"});var H=L(_({...X,props:J,setup(v,{expose:k}){const f=v,{focusing:h,id:g,isActive:r,handleFocus:C,handleHeaderClick:t,handleEnterClick:u}=(i=>{const a=ie(E),s=K(!1),p=K(!1),l=K(M()),I=d(()=>a==null?void 0:a.activeNames.value.includes(i.name));return{focusing:s,id:l,isActive:I,handleFocus:()=>{setTimeout(()=>{p.value?p.value=!1:s.value=!0},50)},handleHeaderClick:()=>{i.disabled||(a==null||a.handleItemClick(i.name),s.value=!1,p.value=!0)},handleEnterClick:()=>{a==null||a.handleItemClick(i.name)}}})(f),{arrowKls:o,headKls:b,rootKls:c,itemWrapperKls:n,itemContentKls:y,scopedContentId:N,scopedHeadId:V}=((i,{focusing:a,isActive:s,id:p})=>{const l=Y("collapse"),I=d(()=>[l.b("item"),l.is("active",e(s)),l.is("disabled",i.disabled)]),ee=d(()=>[l.be("item","header"),l.is("active",e(s)),{focusing:e(a)&&!i.disabled}]);return{arrowKls:d(()=>[l.be("item","arrow"),l.is("active",e(s))]),headKls:ee,rootKls:I,itemWrapperKls:d(()=>l.be("item","wrap")),itemContentKls:d(()=>l.be("item","content")),scopedContentId:d(()=>l.b(`content-${e(p)}`)),scopedHeadId:d(()=>l.b(`head-${e(p)}`))}})(f,{focusing:h,isActive:r,id:g});return k({isActive:r}),(i,a)=>(z(),D("div",{class:m(e(c))},[A("button",{id:e(V),class:m(e(b)),"aria-expanded":e(r),"aria-controls":e(N),"aria-describedby":e(N),tabindex:i.disabled?-1:0,type:"button",onClick:a[0]||(a[0]=(...s)=>e(t)&&e(t)(...s)),onKeydown:a[1]||(a[1]=re(ue((...s)=>e(u)&&e(u)(...s),["stop","prevent"]),["space","enter"])),onFocus:a[2]||(a[2]=(...s)=>e(C)&&e(C)(...s)),onBlur:a[3]||(a[3]=s=>h.value=!1)},[x(i.$slots,"title",{},()=>[oe(ne(i.title),1)]),w(e(ce),{class:m(e(o))},{default:O(()=>[w(e(de))]),_:1},8,["class"])],42,Q),w(e(ve),null,{default:O(()=>[pe(A("div",{id:e(N),role:"region",class:m(e(n)),"aria-hidden":!e(r),"aria-labelledby":e(V)},[A("div",{class:m(e(y))},[x(i.$slots,"default")],2)],10,U),[[me,e(r)]])]),_:3})],2))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/collapse/src/collapse-item.vue"]]);Z=be(G,{CollapseItem:H}),R=fe(H)});export{R as E,Ce as __tla,Z as a};
