import{aq as e,Q as t,ar as a,as as l,y as i,at as n,au as o,av as r,aw as s,ax as c,A as u,J as d,a3 as v,W as f,d as p,ay as h,r as g,a as b,az as m,I as w,aA as x,x as y,k as C,aB as I,N as k,a7 as S,aC as B,aD as T,c as z,H as R,G as M,a4 as A,C as O,D as H,ac as W,o as L,aE as X,aF as D,M as E,a8 as N,ab as Z,aG as F,aH as P,X as Y,aI as $,E as j,aJ as V,aK as G,aL as J,aM as K,a0 as Q,K as q,Z as U,aN as _,af as ee,aO as te,U as ae,aP as le,aQ as ie,ai as ne,S as oe,R as re,z as se,V as ce}from"./index-830a56cb.js";function ue(e,t){if(!o||!window.IntersectionObserver)return;const a=new IntersectionObserver((e=>{t(e[0].intersectionRatio>0)}),{root:document.body}),l=()=>{e.value&&a.unobserve(e.value)};r(l),s(l),c((()=>{e.value&&a.observe(e.value)}))}const[de,ve]=u("sticky"),fe=R(p({name:de,props:{zIndex:d,position:v("top"),container:Object,offsetTop:f(0),offsetBottom:f(0)},emits:["scroll","change"],setup(e,{emit:t,slots:l}){const n=i(),o=h(n),r=g({fixed:!1,width:0,height:0,transform:0}),s=i(!1),c=b((()=>m("top"===e.position?e.offsetTop:e.offsetBottom))),u=b((()=>{if(s.value)return;const{fixed:e,height:t,width:a}=r;return e?{width:"".concat(a,"px"),height:"".concat(t,"px")}:void 0})),d=b((()=>{if(!r.fixed||s.value)return;const t=w(x(e.zIndex),{width:"".concat(r.width,"px"),height:"".concat(r.height,"px"),[e.position]:"".concat(c.value,"px")});return r.transform&&(t.transform="translate3d(0, ".concat(r.transform,"px, 0)")),t})),v=()=>{if(!n.value||I(n))return;const{container:l,position:i}=e,o=S(n),s=a(window);if(r.width=o.width,r.height=o.height,"top"===i)if(l){const e=S(l),t=e.bottom-c.value-r.height;r.fixed=c.value>o.top&&e.bottom>0,r.transform=t<0?t:0}else r.fixed=c.value>o.top;else{const{clientHeight:e}=document.documentElement;if(l){const t=S(l),a=e-t.top-c.value-r.height;r.fixed=e-c.valuet.top,r.transform=a<0?-a:0}else r.fixed=e-c.valuer.fixed),(e=>t("change",e))),C("scroll",v,{target:o,passive:!0}),ue(n,v),y([B,T],(()=>{n.value&&!I(n)&&r.fixed&&(s.value=!0,k((()=>{const e=S(n);r.width=e.width,r.height=e.height,s.value=!1})))})),()=>{var e;return z("div",{ref:n,style:u.value},[z("div",{"class":ve({fixed:r.fixed&&!s.value}),style:d.value},[null==(e=l["default"])?void 0:e.call(l)])])}}})),[pe,he]=u("swipe"),ge={loop:M,width:d,height:d,vertical:Boolean,autoplay:f(0),duration:f(500),touchable:M,lazyRender:Boolean,initialSwipe:f(0),indicatorColor:String,showIndicators:M,stopPropagation:M},be=Symbol(pe),me=R(p({name:pe,props:ge,emits:["change","dragStart","dragEnd"],setup(e,{emit:t,slots:a}){const l=i(),n=i(),o=g({rect:null,width:0,height:0,offset:0,active:0,swiping:!1});let c=!1;const u=A(),{children:d,linkChildren:v}=O(be),f=b((()=>d.length)),p=b((()=>o[e.vertical?"height":"width"])),h=b((()=>e.vertical?u.deltaY.value:u.deltaX.value)),m=b((()=>o.rect?(e.vertical?o.rect.height:o.rect.width)-p.value*f.value:0)),w=b((()=>p.value?Math.ceil(Math.abs(m.value)/p.value):f.value)),x=b((()=>f.value*p.value)),S=b((()=>(o.active+f.value)%f.value)),R=b((()=>{const t=e.vertical?"vertical":"horizontal";return u.direction.value===t})),M=b((()=>{const t={transitionDuration:"".concat(o.swiping?0:e.duration,"ms"),transform:"translate".concat(e.vertical?"Y":"X","(").concat(+o.offset.toFixed(2),"px)")};if(p.value){const a=e.vertical?"height":"width",l=e.vertical?"width":"height";t[a]="".concat(x.value,"px"),t[l]=e[l]?"".concat(e[l],"px"):""}return t})),F=(t,a=0)=>{let l=t*p.value;e.loop||(l=Math.min(l,-m.value));let i=a-l;return e.loop||(i=Z(i,m.value,0)),i},P=({pace:a=0,offset:l=0,emitChange:i})=>{if(f.value<=1)return;const{active:n}=o,r=(t=>{const{active:a}=o;return t?e.loop?Z(a+t,-1,f.value):Z(a+t,0,w.value):a})(a),s=F(r,l);if(e.loop){if(d[0]&&s!==m.value){const e=s0;d[f.value-1].setOffset(e?-x.value:0)}}o.active=r,o.offset=s,i&&r!==n&&t("change",S.value)},Y=()=>{o.swiping=!0,o.active<=-1?P({pace:f.value}):o.active>=f.value&&P({pace:-f.value})},$=()=>{Y(),u.reset(),E((()=>{o.swiping=!1,P({pace:1,emitChange:!0})}))};let j;const V=()=>clearTimeout(j),G=()=>{V(),+e.autoplay>0&&f.value>1&&(j=setTimeout((()=>{$(),G()}),+e.autoplay))},J=(t=+e.initialSwipe)=>{if(!l.value)return;const a=()=>{var a,i;if(!I(l)){const t={width:l.value.offsetWidth,height:l.value.offsetHeight};o.rect=t,o.width=+(null!=(a=e.width)?a:t.width),o.height=+(null!=(i=e.height)?i:t.height)}f.value&&-1===(t=Math.min(f.value-1,t))&&(t=f.value-1),o.active=t,o.swiping=!0,o.offset=F(t),d.forEach((e=>{e.setOffset(0)})),G()};I(l)?k().then(a):a()},K=()=>J(o.active);let Q;const q=t=>{!e.touchable||t.touches.length>1||(u.start(t),c=!1,Q=Date.now(),V(),Y())},U=()=>{if(!e.touchable||!o.swiping)return;const a=Date.now()-Q,l=h.value/a;if((Math.abs(l)>.25||Math.abs(h.value)>p.value/2)&&R.value){const t=e.vertical?u.offsetY.value:u.offsetX.value;let a=0;a=e.loop?t>0?h.value>0?-1:1:0:-Math[h.value>0?"ceil":"floor"](h.value/p.value),P({pace:a,emitChange:!0})}else h.value&&P({pace:0});c=!1,o.swiping=!1,t("dragEnd",{index:S.value}),G()},_=(t,a)=>{const l=a===S.value,i=l?{backgroundColor:e.indicatorColor}:void 0;return z("i",{style:i,"class":he("indicator",{active:l})},null)};return H({prev:()=>{Y(),u.reset(),E((()=>{o.swiping=!1,P({pace:-1,emitChange:!0})}))},next:$,state:o,resize:K,swipeTo:(t,a={})=>{Y(),u.reset(),E((()=>{let l;l=e.loop&&t===f.value?0===o.active?0:t:t%f.value,a.immediate?E((()=>{o.swiping=!1})):o.swiping=!1,P({pace:l-o.active,emitChange:!0})}))}}),v({size:p,props:e,count:f,activeIndicator:S}),y((()=>e.initialSwipe),(e=>J(+e))),y(f,(()=>J(o.active))),y((()=>e.autoplay),G),y([B,T,()=>e.width,()=>e.height],K),y(W(),(e=>{"visible"===e?G():V()})),L(J),X((()=>J(o.active))),D((()=>J(o.active))),r(V),s(V),C("touchmove",(a=>{e.touchable&&o.swiping&&(u.move(a),R.value)&&(!e.loop&&(0===o.active&&h.value>0||o.active===f.value-1&&h.value<0)||(N(a,e.stopPropagation),P({offset:h.value}),c||(t("dragStart",{index:S.value}),c=!0)))}),{target:n}),()=>{var t;return z("div",{ref:l,"class":he()},[z("div",{ref:n,style:M.value,"class":he("track",{vertical:e.vertical}),onTouchstartPassive:q,onTouchend:U,onTouchcancel:U},[null==(t=a["default"])?void 0:t.call(a)]),a.indicator?a.indicator({active:S.value,total:f.value}):e.showIndicators&&f.value>1?z("div",{"class":he("indicators",{vertical:e.vertical})},[Array(f.value).fill("").map(_)]):void 0])}}})),[we,xe]=u("tabs");var ye=p({name:we,props:{count:F(Number),inited:Boolean,animated:Boolean,duration:F(d),swipeable:Boolean,lazyRender:Boolean,currentIndex:F(Number)},emits:["change"],setup(e,{emit:t,slots:a}){const l=i(),n=e=>t("change",e),o=()=>{var t;const i=null==(t=a["default"])?void 0:t.call(a);return e.animated||e.swipeable?z(me,{ref:l,loop:!1,"class":xe("track"),duration:1e3*+e.duration,touchable:e.swipeable,lazyRender:e.lazyRender,showIndicators:!1,onChange:n},{"default":()=>[i]}):i},r=t=>{const a=l.value;a&&a.state.active!==t&&a.swipeTo(t,{immediate:!e.inited})};return y((()=>e.currentIndex),r),L((()=>{r(e.currentIndex)})),H({swipeRef:l}),()=>z("div",{"class":xe("content",{animated:e.animated||e.swipeable})},[o()])}});const[Ce,Ie]=u("tabs"),ke={type:v("line"),color:String,border:Boolean,sticky:Boolean,shrink:Boolean,active:f(0),duration:f(.3),animated:Boolean,ellipsis:M,swipeable:Boolean,scrollspy:Boolean,offsetTop:f(0),background:String,lazyRender:M,showHeader:M,lineWidth:d,lineHeight:d,beforeChange:Function,swipeThreshold:f(5),titleActiveColor:String,titleInactiveColor:String},Se=Symbol(Ce);var Be=p({name:Ce,props:ke,emits:["change","scroll","rendered","clickTab","update:active"],setup(o,{emit:r,slots:s}){let u,d,v,f,p;const w=i(),x=i(),T=i(),R=i(),M=P(),A=h(w),[W,L]=function(){const e=i([]),t=[];return n((()=>{e.value=[]})),[e,a=>(t[a]||(t[a]=t=>{e.value[a]=t}),t[a])]}(),{children:E,linkChildren:N}=O(Se),Z=g({inited:!1,position:"",lineStyle:{},currentIndex:-1}),F=b((()=>E.length>+o.swipeThreshold||!o.ellipsis||o.shrink)),Q=b((()=>({borderColor:o.color,background:o.background}))),q=(e,t)=>{var a;return null!=(a=e.name)?a:t},U=b((()=>{const e=E[Z.currentIndex];if(e)return q(e,Z.currentIndex)})),_=b((()=>m(o.offsetTop))),ee=b((()=>o.sticky?_.value+u:0)),te=a=>{const l=x.value,i=W.value;if(!(F.value&&l&&i&&i[Z.currentIndex]))return;const n=i[Z.currentIndex].$el,r=n.offsetLeft-(l.offsetWidth-n.offsetWidth)/2;f&&f(),f=function(a,l,i){let n,o=0;const r=a.scrollLeft,s=0===i?1:Math.round(1e3*i/16);return function c(){a.scrollLeft+=(l-r)/s,++o{const e=Z.inited;k((()=>{const t=W.value;if(!t||!t[Z.currentIndex]||"line"!==o.type||I(w.value))return;const a=t[Z.currentIndex].$el,{lineWidth:l,lineHeight:i}=o,n=a.offsetLeft+a.offsetWidth/2,r={width:Y(l),backgroundColor:o.color,transform:"translateX(".concat(n,"px) translateX(-50%)")};if(e&&(r.transitionDuration="".concat(o.duration,"s")),$(i)){const e=Y(i);r.height=e,r.borderRadius=e}Z.lineStyle=r}))},le=(e,t)=>{const a=(e=>{const t=e=0&&e{const a=E.find(((t,a)=>q(t,a)===e)),l=a?E.indexOf(a):0;le(l,t)},ne=(i=!1)=>{if(o.scrollspy){const n=E[Z.currentIndex].$el;if(n&&A.value){const r=G(n,A.value)-ee.value;d=!0,p&&p(),p=function(i,n,o,r){let s,c=a(i);const u=cn||!u&&cn?s=t(f):r&&(s=t(r))}(),function(){e(s)}}(A.value,r,i?0:+o.duration,(()=>{d=!1}))}}},oe=(e,t,a)=>{const{title:l,disabled:i}=E[t],n=q(E[t],t);i||(J(o.beforeChange,{args:[n],done:()=>{le(t),ne()}}),K(e)),r("clickTab",{name:n,title:l,event:a,disabled:i})},re=e=>{v=e.isFixed,r("scroll",e)},se=()=>{if("line"===o.type&&E.length)return z("div",{"class":Ie("line"),style:Z.lineStyle},null)},ce=()=>{var e,t,a;const{type:l,border:i,sticky:n}=o,r=[z("div",{ref:n?void 0:T,"class":[Ie("wrap"),{[j]:"line"===l&&i}]},[z("div",{ref:x,role:"tablist","class":Ie("nav",[l,{shrink:o.shrink,complete:F.value}]),style:Q.value,"aria-orientation":"horizontal"},[null==(e=s["nav-left"])?void 0:e.call(s),E.map((e=>e.renderTitle(oe))),se(),null==(t=s["nav-right"])?void 0:t.call(s)])]),null==(a=s["nav-bottom"])?void 0:a.call(s)];return n?z("div",{ref:T},[r]):r},de=()=>{ae(),k((()=>{var e,t;te(!0),null==(t=null==(e=R.value)?void 0:e.swipeRef.value)||t.resize()}))};return y((()=>[o.color,o.duration,o.lineWidth,o.lineHeight]),ae),y(B,de),y((()=>o.active),(e=>{e!==U.value&&ie(e)})),y((()=>E.length),(()=>{Z.inited&&(ie(o.active),ae(),k((()=>{te(!0)})))})),H({resize:de,scrollTo:e=>{k((()=>{ie(e),ne(!0)}))}}),X(ae),D(ae),c((()=>{ie(o.active,!0),k((()=>{Z.inited=!0,T.value&&(u=S(T.value).height),te(!0)}))})),ue(w,ae),C("scroll",(()=>{if(o.scrollspy&&!d){const e=(()=>{for(let e=0;eee.value)return 0===e?0:e-1}return E.length-1})();le(e)}}),{target:A,passive:!0}),N({id:M,props:o,setLine:ae,scrollable:F,onRendered:(e,t)=>r("rendered",e,t),currentName:U,setTitleRefs:L,scrollIntoView:te}),()=>z("div",{ref:w,"class":Ie([o.type])},[o.showHeader?o.sticky?z(fe,{container:w.value,offsetTop:_.value,onScroll:re},{"default":()=>[ce()]}):ce():null,z(ye,{ref:R,count:E.length,inited:Z.inited,animated:o.animated,duration:o.duration,swipeable:o.swipeable,lazyRender:o.lazyRender,currentIndex:Z.currentIndex,onChange:le},{"default":()=>{var e;return[null==(e=s["default"])?void 0:e.call(s)]}})])}});const Te=Symbol(),[ze,Re]=u("tab"),Me=p({name:ze,props:{id:String,dot:Boolean,type:String,color:String,title:String,badge:d,shrink:Boolean,isActive:Boolean,disabled:Boolean,controls:String,scrollable:Boolean,activeColor:String,inactiveColor:String,showZeroBadge:M},setup(e,{slots:t}){const a=b((()=>{const t={},{type:a,color:l,disabled:i,isActive:n,activeColor:o,inactiveColor:r}=e;l&&"card"===a&&(t.borderColor=l,i||(n?t.backgroundColor=l:t.color=l));const s=n?o:r;return s&&(t.color=s),t})),l=()=>{const a=z("span",{"class":Re("text",{ellipsis:!e.scrollable})},[t.title?t.title():e.title]);return e.dot||$(e.badge)&&""!==e.badge?z(Q,{dot:e.dot,content:e.badge,showZero:e.showZeroBadge},{"default":()=>[a]}):a};return()=>z("div",{id:e.id,role:"tab","class":[Re([e.type,{grow:e.scrollable&&!e.shrink,shrink:e.shrink,active:e.isActive,disabled:e.disabled}])],style:a.value,tabindex:e.disabled?void 0:e.isActive?0:-1,"aria-selected":e.isActive,"aria-disabled":e.disabled||void 0,"aria-controls":e.controls},[l()])}}),[Ae,Oe]=u("swipe-item"),He=R(p({name:Ae,setup(e,{slots:t}){let a;const l=g({offset:0,inited:!1,mounted:!1}),{parent:i,index:n}=q(be);if(!i)return;const o=b((()=>{const e={},{vertical:t}=i.props;return i.size.value&&(e[t?"height":"width"]="".concat(i.size.value,"px")),l.offset&&(e.transform="translate".concat(t?"Y":"X","(").concat(l.offset,"px)")),e})),r=b((()=>{const{loop:e,lazyRender:t}=i.props;if(!t||a)return!0;if(!l.mounted)return!1;const o=i.activeIndicator.value,r=i.count.value-1,s=0===o&&e?r:o-1,c=o===r&&e?0:o+1;return a=n.value===o||n.value===s||n.value===c,a}));return L((()=>{k((()=>{l.mounted=!0}))})),H({setOffset:e=>{l.offset=e}}),()=>{var e;return z("div",{"class":Oe(),style:o.value},[r.value?null==(e=t["default"])?void 0:e.call(t):null])}}})),[We,Le]=u("tab"),Xe=R(p({name:We,props:w({},U,{dot:Boolean,name:d,badge:d,title:String,disabled:Boolean,titleClass:_,titleStyle:[String,Object],showZeroBadge:M}),setup(e,{slots:t}){const a=P(),l=i(!1),n=se(),{parent:o,index:r}=q(Se);if(!o)return;const s=()=>{var t;return null!=(t=e.name)?t:r.value},c=b((()=>{const t=s()===o.currentName.value;return t&&!l.value&&(l.value=!0,o.props.lazyRender&&k((()=>{o.onRendered(s(),e.title)}))),t})),u=i(""),d=i("");ee((()=>{const{titleClass:t,titleStyle:a}=e;u.value=t?le(t):"",d.value=a&&"string"!=typeof a?ie(ne(a)):a}));const v=i(!c.value);return y(c,(e=>{e?v.value=!1:E((()=>{v.value=!0}))})),y((()=>e.title),(()=>{o.setLine(),o.scrollIntoView()})),te(Te,c),H({id:a,renderTitle:l=>z(Me,oe({key:a,id:"".concat(o.id,"-").concat(r.value),ref:o.setTitleRefs(r.value),style:d.value,"class":u.value,isActive:c.value,controls:a,scrollable:o.scrollable.value,activeColor:o.props.titleActiveColor,inactiveColor:o.props.titleInactiveColor,onClick:e=>l(n.proxy,r.value,e)},re(o.props,["type","color","shrink"]),re(e,["dot","badge","title","disabled","showZeroBadge"])),{title:t.title})}),()=>{var e;const i="".concat(o.id,"-").concat(r.value),{animated:n,swipeable:s,scrollspy:u,lazyRender:d}=o.props;if(!t["default"]&&!n)return;const f=u||c.value;if(n||s)return z(He,{id:a,role:"tabpanel","class":Le("panel-wrapper",{inactive:v.value}),tabindex:c.value?0:-1,"aria-hidden":!c.value,"aria-labelledby":i},{"default":()=>{var e;return[z("div",{"class":Le("panel")},[null==(e=t["default"])?void 0:e.call(t)])]}});const p=l.value||u||!d?null==(e=t["default"])?void 0:e.call(t):null;return ae(z("div",{id:a,role:"tabpanel","class":Le("panel"),tabindex:f?0:-1,"aria-labelledby":i},[p]),[[ce,f]])}}})),De=R(Be);export{De as T,Xe as a};