import{s as _,M as Ye,cd as Be,a as de,f as Q,n as v,c2 as ie,S as me,T as W,L as Ne,_ as w,ce as V,a6 as B,N as Oe,a7 as pe,cf as Mt,a$ as Lt,cg as Nt,ch as Ot,G as Ze,a4 as Dt,K as Kt,b7 as Wt,W as ct,ci as Pe,cj as vt,ck as pt,cl as Ft,as as St,Q as jt,c1 as $t,$ as zt,cm as Ht,c5 as Xe,J as Gt,X as Vt,cn as Ut,co as st,c7 as Xt}from"./index.7e08ba81.js";import{u as Yt}from"./useRefs.9e0a4abb.js";import{P as Zt}from"./PlusOutlined.29a85b0a.js";function Jt(S){var e=_(),t=_(!1);function o(){for(var a=arguments.length,i=new Array(a),r=0;rj?(T=n,N.value="x"):(T=b,N.value="y"),e(-T,-T)&&y.preventDefault()}var O=_({onTouchStart:u,onTouchMove:R,onTouchEnd:H,onWheel:P});function U(y){O.value.onTouchStart(y)}function D(y){O.value.onTouchMove(y)}function $(y){O.value.onTouchEnd(y)}function ce(y){O.value.onWheel(y)}Oe(function(){var y,n;document.addEventListener("touchmove",D,{passive:!1}),document.addEventListener("touchend",$,{passive:!1}),(y=S.value)===null||y===void 0||y.addEventListener("touchstart",U,{passive:!1}),(n=S.value)===null||n===void 0||n.addEventListener("wheel",ce,{passive:!1})}),Ye(function(){document.removeEventListener("touchmove",D),document.removeEventListener("touchend",$)})}function mt(S,e){var t=_(S);function o(a){var i=typeof a=="function"?a(t.value):a;i!==t.value&&e(i,t.value),t.value=i}return[t,o]}var yt={width:0,height:0,left:0,top:0,right:0},ra=function(){return{id:{type:String},tabPosition:{type:String},activeKey:{type:[String,Number]},rtl:{type:Boolean},animated:{type:Object,default:void 0},editable:{type:Object},moreIcon:Ze.any,moreTransitionName:{type:String},mobile:{type:Boolean},tabBarGutter:{type:Number},renderTabBar:{type:Function},locale:{type:Object,default:void 0},onTabClick:{type:Function},onTabScroll:{type:Function}}},ht=de({compatConfig:{MODE:3},name:"TabNavList",inheritAttrs:!1,props:ra(),slots:["moreIcon","leftExtra","rightExtra","tabBarExtraContent"],emits:["tabClick","tabScroll"],setup:function(e,t){var o=t.attrs,a=t.slots,i=kt(),r=i.tabs,d=i.prefixCls,l=_(),c=_(),f=_(),h=_(),g=Yt(),L=B(g,2),I=L[0],F=L[1],E=Q(function(){return e.tabPosition==="top"||e.tabPosition==="bottom"}),z=mt(0,function(m,p){E.value&&e.onTabScroll&&e.onTabScroll({direction:m>p?"left":"right"})}),x=B(z,2),u=x[0],R=x[1],H=mt(0,function(m,p){!E.value&&e.onTabScroll&&e.onTabScroll({direction:m>p?"top":"bottom"})}),N=B(H,2),P=N[0],O=N[1],U=V(0),D=B(U,2),$=D[0],ce=D[1],y=V(0),n=B(y,2),b=n[0],T=n[1],K=V(null),j=B(K,2),C=j[0],Se=j[1],ye=V(null),A=B(ye,2),X=A[0],re=A[1],xe=V(0),he=B(xe,2),Te=he[0],ve=he[1],_e=V(0),q=B(_e,2),De=q[0],Re=q[1],we=Qt(new Map),ge=B(we,2),Ke=ge[0],We=ge[1],Ae=ea(r,Ke),Et=Q(function(){return"".concat(d.value,"-nav-operations-hidden")}),Ce=_(0),ke=_(0);Ne(function(){E.value?e.rtl?(Ce.value=0,ke.value=Math.max(0,$.value-C.value)):(Ce.value=Math.min(0,C.value-$.value),ke.value=0):(Ce.value=Math.min(0,X.value-b.value),ke.value=0)});var Fe=function(p){return pke.value?ke.value:p},Je=_(),Pt=V(),Qe=B(Pt,2),je=Qe[0],qe=Qe[1],$e=function(){qe(Date.now())},ze=function(){clearTimeout(Je.value)},et=function(p,s){p(function(M){var k=Fe(M+s);return k})};ia(l,function(m,p){if(E.value){if(C.value>=$.value)return!1;et(R,m)}else{if(X.value>=b.value)return!1;et(O,p)}return ze(),$e(),!0}),pe(je,function(){ze(),je.value&&(Je.value=setTimeout(function(){qe(0)},100))});var tt=function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.activeKey,s=Ae.value.get(p)||{width:0,height:0,left:0,right:0,top:0};if(E.value){var M=u.value;e.rtl?s.rightu.value+C.value&&(M=s.right+s.width-C.value):s.left<-u.value?M=-s.left:s.left+s.width>-u.value+C.value&&(M=-(s.left+s.width-C.value)),O(0),R(Fe(M))}else{var k=P.value;s.top<-P.value?k=-s.top:s.top+s.height>-P.value+X.value&&(k=-(s.top+s.height-X.value)),R(0),O(Fe(k))}},He=_(0),Ge=_(0);Ne(function(){var m,p,s,M,k,Y,Z,fe=Ae.value;["top","bottom"].includes(e.tabPosition)?(p="width",k=C.value,Y=$.value,Z=Te.value,s=e.rtl?"right":"left",M=Math.abs(u.value)):(p="height",k=X.value,Y=$.value,Z=De.value,s="top",M=-P.value);var ee=k;Y+Z>k&&YM+ee){G=te-1;break}}for(var ue=0,J=be-1;J>=0;J-=1){var ne=fe.get(le[J].key)||yt;if(ne[s]0,ue=u.value+C.value<$.value):(ue=u.value<0,J=-u.value+C.value<$.value):(ne=P.value<0,lt=-P.value+X.value