"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),b=require("../_util/classNames.js"),q=require("../_util/props-util/initDefaultProps.js"),I=require("../config-provider/hooks/useConfigInject.js"),g=require("../vc-util/devWarning.js"),j=require("./PanelContent.js"),P=require("./commonProps.js"),D=e.defineComponent({compatConfig:{MODE:3},name:"ACollapsePanel",inheritAttrs:!1,props:q.default(P.collapsePanelProps(),{showArrow:!0,isActive:!1,onItemClick(){},headerClass:"",forceRender:!1}),slots:Object,setup(l,{slots:o,emit:m,attrs:r}){g.default(l.disabled===void 0,"Collapse.Panel",'`disabled` is deprecated. Please use `collapsible="disabled"` instead.');const{prefixCls:v}=I.default("collapse",l),i=()=>{m("itemClick",l.panelKey)},x=n=>{(n.key==="Enter"||n.keyCode===13||n.which===13)&&i()};return()=>{const{header:n=o.header?.(),headerClass:d,isActive:s,showArrow:c,destroyInactivePanel:y,accordion:u,forceRender:$,openAnimation:w,expandIcon:f=o.expandIcon,extra:p=o.extra?.(),collapsible:t}=l,C=t==="disabled",a=v.value,A=b.default(`${a}-header`,{[d]:d,[`${a}-header-collapsible-only`]:t==="header",[`${a}-icon-collapsible-only`]:t==="icon"}),N=b.default({[`${a}-item`]:!0,[`${a}-item-active`]:s,[`${a}-item-disabled`]:C,[`${a}-no-arrow`]:!c,[`${r.class}`]:!!r.class});let h=e.createVNode("i",{class:"arrow"},null);c&&typeof f=="function"&&(h=f(l));const V=e.withDirectives(e.createVNode(j.default,{prefixCls:a,isActive:s,forceRender:$,role:u?"tabpanel":null},{default:o.default}),[[e.vShow,s]]),k={appear:!1,css:!1,...w};return e.createVNode("div",{...r,class:N},[e.createVNode("div",{class:A,onClick:()=>!["header","icon"].includes(t)&&i(),role:u?"tab":"button",tabindex:C?-1:0,"aria-expanded":s,onKeypress:x},[c&&h,e.createVNode("span",{onClick:()=>t==="header"&&i(),class:`${a}-header-text`},[n]),p&&e.createVNode("div",{class:`${a}-extra`},[p])]),e.createVNode(e.Transition,k,{default:()=>[!y||s?V:null]})])}}});exports.collapsePanelProps=P.collapsePanelProps;exports.default=D;
