const e=require("../../../_util/classNames.js"),t=require("../../../_util/KeyCode.js");let n=require("vue");var r=(0,n.defineComponent)({compatConfig:{MODE:3},name:`TabNode`,props:{id:{type:String},prefixCls:{type:String},tab:{type:Object},active:{type:Boolean},closable:{type:Boolean},editable:{type:Object},onClick:{type:Function},onResize:{type:Function},renderWrapper:{type:Function},removeAriaLabel:{type:String},onFocus:{type:Function}},emits:[`click`,`resize`,`remove`,`focus`],setup(r,{expose:i,attrs:a}){let o=(0,n.ref)();function s(e){r.tab?.disabled||r.onClick(e)}i({domRef:o});function c(e){e.preventDefault(),e.stopPropagation(),r.editable.onEdit(`remove`,{key:r.tab?.key,event:e})}let l=(0,n.computed)(()=>r.editable&&r.closable!==!1&&!r.tab?.disabled);return()=>{let{prefixCls:i,id:u,active:d,tab:{key:f,tab:p,disabled:m,closeIcon:h},renderWrapper:g,removeAriaLabel:_,editable:v,onFocus:y}=r,b=`${i}-tab`,x=(0,n.createVNode)(`div`,{key:f,ref:o,class:e.default(b,{[`${b}-with-remove`]:l.value,[`${b}-active`]:d,[`${b}-disabled`]:m}),style:a.style,onClick:s},[(0,n.createVNode)(`div`,{role:`tab`,"aria-selected":d,id:u&&`${u}-tab-${f}`,class:`${b}-btn`,"aria-controls":u&&`${u}-panel-${f}`,"aria-disabled":m,tabindex:m?null:0,onClick:e=>{e.stopPropagation(),s(e)},onKeydown:e=>{[t.default.SPACE,t.default.ENTER].includes(e.which)&&(e.preventDefault(),s(e))},onFocus:y},[typeof p==`function`?p():p]),l.value&&(0,n.createVNode)(`button`,{type:`button`,"aria-label":_||`remove`,tabindex:0,class:`${b}-remove`,onClick:e=>{e.stopPropagation(),c(e)}},[h?.()||v.removeIcon?.()||`×`])]);return g?g(x):x}}});exports.default=r;