import{aP as ft,aQ as pt,aR as j,ag as Pt,aT as Lt,aU as b,r as d,aV as ht,aW as rt,aX as N,j as v,aY as vt,ah as Nt,cT as Zt,cU as kt,cV as Ft,cF as At,cd as lt,a1 as te,c7 as ut,c8 as ee}from"./index-Csef3-wA.js";let _;function $t(){if(_)return _;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),_="reverse",t.scrollLeft>0?_="default":(t.scrollLeft=1,t.scrollLeft===0&&(_="negative")),document.body.removeChild(t),_}function oe(t,e){const r=t.scrollLeft;if(e!=="rtl")return r;switch($t()){case"negative":return t.scrollWidth-t.clientWidth+r;case"reverse":return t.scrollWidth-t.clientWidth-r;default:return r}}function le(t){return pt("MuiTab",t)}const L=ft("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),re=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],ne=t=>{const{classes:e,textColor:r,fullWidth:a,wrapped:s,icon:c,label:h,selected:p,disabled:u}=t,x={root:["root",c&&h&&"labelIcon",`textColor${Lt(r)}`,a&&"fullWidth",s&&"wrapped",p&&"selected",u&&"disabled"],iconWrapper:["iconWrapper"]};return vt(x,le,e)},se=j(Pt,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.label&&r.icon&&e.labelIcon,e[`textColor${Lt(r.textColor)}`],r.fullWidth&&e.fullWidth,r.wrapped&&e.wrapped,{[`& .${L.iconWrapper}`]:e.iconWrapper}]}})(({theme:t,ownerState:e})=>b({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${L.iconWrapper}`]:b({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${L.selected}`]:{opacity:1},[`&.${L.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${L.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${L.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${L.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${L.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),Re=d.forwardRef(function(e,r){const a=ht({props:e,name:"MuiTab"}),{className:s,disabled:c=!1,disableFocusRipple:h=!1,fullWidth:p,icon:u,iconPosition:x="top",indicator:B,label:y,onChange:S,onClick:w,onFocus:k,selected:T,selectionFollowsFocus:g,textColor:H="inherit",value:M,wrapped:nt=!1}=a,D=rt(a,re),Y=b({},a,{disabled:c,disableFocusRipple:h,selected:T,icon:!!u,iconPosition:x,label:!!y,fullWidth:p,textColor:H,wrapped:nt}),X=ne(Y),F=u&&y&&d.isValidElement(u)?d.cloneElement(u,{className:N(X.iconWrapper,u.props.className)}):u,Q=R=>{!T&&S&&S(R,M),w&&w(R)},U=R=>{g&&!T&&S&&S(R,M),k&&k(R)};return v.jsxs(se,b({focusRipple:!h,className:N(X.root,s),ref:r,role:"tab","aria-selected":T,disabled:c,onClick:Q,onFocus:U,ownerState:Y,tabIndex:T?0:-1},D,{children:[x==="top"||x==="start"?v.jsxs(d.Fragment,{children:[F,y]}):v.jsxs(d.Fragment,{children:[y,F]}),B]}))}),ae=Nt(v.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),ie=Nt(v.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function ce(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function de(t,e,r,a={},s=()=>{}){const{ease:c=ce,duration:h=300}=a;let p=null;const u=e[t];let x=!1;const B=()=>{x=!0},y=S=>{if(x){s(new Error("Animation cancelled"));return}p===null&&(p=S);const w=Math.min(1,(S-p)/h);if(e[t]=c(w)*(r-u)+u,w>=1){requestAnimationFrame(()=>{s(null)});return}requestAnimationFrame(y)};return u===r?(s(new Error("Element already at target position")),B):(requestAnimationFrame(y),B)}const ue=["onChange"],be={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function fe(t){const{onChange:e}=t,r=rt(t,ue),a=d.useRef(),s=d.useRef(null),c=()=>{a.current=s.current.offsetHeight-s.current.clientHeight};return Zt(()=>{const h=kt(()=>{const u=a.current;c(),u!==a.current&&e(a.current)}),p=Ft(s.current);return p.addEventListener("resize",h),()=>{h.clear(),p.removeEventListener("resize",h)}},[e]),d.useEffect(()=>{c(),e(a.current)},[e]),v.jsx("div",b({style:be,ref:s},r))}function pe(t){return pt("MuiTabScrollButton",t)}const he=ft("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),ve=["className","slots","slotProps","direction","orientation","disabled"],Se=t=>{const{classes:e,orientation:r,disabled:a}=t;return vt({root:["root",r,a&&"disabled"]},pe,e)},me=j(Pt,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.orientation&&e[r.orientation]]}})(({ownerState:t})=>b({width:40,flexShrink:0,opacity:.8,[`&.${he.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),xe=d.forwardRef(function(e,r){var a,s;const c=ht({props:e,name:"MuiTabScrollButton"}),{className:h,slots:p={},slotProps:u={},direction:x}=c,B=rt(c,ve),y=At(),S=b({isRtl:y},c),w=Se(S),k=(a=p.StartScrollButtonIcon)!=null?a:ae,T=(s=p.EndScrollButtonIcon)!=null?s:ie,g=lt({elementType:k,externalSlotProps:u.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S}),H=lt({elementType:T,externalSlotProps:u.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S});return v.jsx(me,b({component:"div",className:N(w.root,h),ref:r,role:null,ownerState:S,tabIndex:null},B,{children:x==="left"?v.jsx(k,b({},g)):v.jsx(T,b({},H))}))});function ge(t){return pt("MuiTabs",t)}const bt=ft("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),ye=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Rt=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,Wt=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,ot=(t,e,r)=>{let a=!1,s=r(t,e);for(;s;){if(s===t.firstChild){if(a)return;a=!0}const c=s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||c)s=r(t,s);else{s.focus();return}}},Ce=t=>{const{vertical:e,fixed:r,hideScrollbar:a,scrollableX:s,scrollableY:c,centered:h,scrollButtonsHideMobile:p,classes:u}=t;return vt({root:["root",e&&"vertical"],scroller:["scroller",r&&"fixed",a&&"hideScrollbar",s&&"scrollableX",c&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",h&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",p&&"scrollButtonsHideMobile"],scrollableX:[s&&"scrollableX"],hideScrollbar:[a&&"hideScrollbar"]},ge,u)},Be=j("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${bt.scrollButtons}`]:e.scrollButtons},{[`& .${bt.scrollButtons}`]:r.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,r.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>b({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${bt.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),we=j("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.scroller,r.fixed&&e.fixed,r.hideScrollbar&&e.hideScrollbar,r.scrollableX&&e.scrollableX,r.scrollableY&&e.scrollableY]}})(({ownerState:t})=>b({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),Te=j("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.flexContainer,r.vertical&&e.flexContainerVertical,r.centered&&e.centered]}})(({ownerState:t})=>b({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),Ie=j("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>b({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),Ee=j(fe)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),zt={},We=d.forwardRef(function(e,r){const a=ht({props:e,name:"MuiTabs"}),s=te(),c=At(),{"aria-label":h,"aria-labelledby":p,action:u,centered:x=!1,children:B,className:y,component:S="div",allowScrollButtonsMobile:w=!1,indicatorColor:k="primary",onChange:T,orientation:g="horizontal",ScrollButtonComponent:H=xe,scrollButtons:M="auto",selectionFollowsFocus:nt,slots:D={},slotProps:Y={},TabIndicatorProps:X={},TabScrollButtonProps:F={},textColor:Q="primary",value:U,variant:R="standard",visibleScrollbar:st=!1}=a,Ot=rt(a,ye),I=R==="scrollable",C=g==="vertical",V=C?"scrollTop":"scrollLeft",J=C?"top":"left",Z=C?"bottom":"right",at=C?"clientHeight":"clientWidth",K=C?"height":"width",A=b({},a,{component:S,allowScrollButtonsMobile:w,indicatorColor:k,orientation:g,vertical:C,scrollButtons:M,textColor:Q,variant:R,visibleScrollbar:st,fixed:!I,hideScrollbar:I&&!st,scrollableX:I&&!C,scrollableY:I&&C,centered:x&&!I,scrollButtonsHideMobile:!w}),z=Ce(A),jt=lt({elementType:D.StartScrollButtonIcon,externalSlotProps:Y.startScrollButtonIcon,ownerState:A}),Ht=lt({elementType:D.EndScrollButtonIcon,externalSlotProps:Y.endScrollButtonIcon,ownerState:A}),[St,Dt]=d.useState(!1),[$,mt]=d.useState(zt),[xt,Xt]=d.useState(!1),[gt,Ut]=d.useState(!1),[yt,_t]=d.useState(!1),[Ct,Yt]=d.useState({overflow:"hidden",scrollbarWidth:0}),Bt=new Map,W=d.useRef(null),O=d.useRef(null),wt=()=>{const o=W.current;let l;if(o){const n=o.getBoundingClientRect();l={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:oe(o,c?"rtl":"ltr"),scrollWidth:o.scrollWidth,top:n.top,bottom:n.bottom,left:n.left,right:n.right}}let i;if(o&&U!==!1){const n=O.current.children;if(n.length>0){const f=n[Bt.get(U)];i=f?f.getBoundingClientRect():null}}return{tabsMeta:l,tabMeta:i}},q=ut(()=>{const{tabsMeta:o,tabMeta:l}=wt();let i=0,n;if(C)n="top",l&&o&&(i=l.top-o.top+o.scrollTop);else if(n=c?"right":"left",l&&o){const m=c?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;i=(c?-1:1)*(l[n]-o[n]+m)}const f={[n]:i,[K]:l?l[K]:0};if(isNaN($[n])||isNaN($[K]))mt(f);else{const m=Math.abs($[n]-f[n]),E=Math.abs($[K]-f[K]);(m>=1||E>=1)&&mt(f)}}),it=(o,{animation:l=!0}={})=>{l?de(V,W.current,o,{duration:s.transitions.duration.standard}):W.current[V]=o},Tt=o=>{let l=W.current[V];C?l+=o:(l+=o*(c?-1:1),l*=c&&$t()==="reverse"?-1:1),it(l)},It=()=>{const o=W.current[at];let l=0;const i=Array.from(O.current.children);for(let n=0;n<i.length;n+=1){const f=i[n];if(l+f[at]>o){n===0&&(l=o);break}l+=f[at]}return l},Vt=()=>{Tt(-1*It())},Kt=()=>{Tt(It())},qt=d.useCallback(o=>{Yt({overflow:null,scrollbarWidth:o})},[]),Gt=()=>{const o={};o.scrollbarSizeListener=I?v.jsx(Ee,{onChange:qt,className:N(z.scrollableX,z.hideScrollbar)}):null;const i=I&&(M==="auto"&&(xt||gt)||M===!0);return o.scrollButtonStart=i?v.jsx(H,b({slots:{StartScrollButtonIcon:D.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:jt},orientation:g,direction:c?"right":"left",onClick:Vt,disabled:!xt},F,{className:N(z.scrollButtons,F.className)})):null,o.scrollButtonEnd=i?v.jsx(H,b({slots:{EndScrollButtonIcon:D.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Ht},orientation:g,direction:c?"left":"right",onClick:Kt,disabled:!gt},F,{className:N(z.scrollButtons,F.className)})):null,o},Et=ut(o=>{const{tabsMeta:l,tabMeta:i}=wt();if(!(!i||!l)){if(i[J]<l[J]){const n=l[V]+(i[J]-l[J]);it(n,{animation:o})}else if(i[Z]>l[Z]){const n=l[V]+(i[Z]-l[Z]);it(n,{animation:o})}}}),tt=ut(()=>{I&&M!==!1&&_t(!yt)});d.useEffect(()=>{const o=kt(()=>{W.current&&q()});let l;const i=m=>{m.forEach(E=>{E.removedNodes.forEach(G=>{var P;(P=l)==null||P.unobserve(G)}),E.addedNodes.forEach(G=>{var P;(P=l)==null||P.observe(G)})}),o(),tt()},n=Ft(W.current);n.addEventListener("resize",o);let f;return typeof ResizeObserver<"u"&&(l=new ResizeObserver(o),Array.from(O.current.children).forEach(m=>{l.observe(m)})),typeof MutationObserver<"u"&&(f=new MutationObserver(i),f.observe(O.current,{childList:!0})),()=>{var m,E;o.clear(),n.removeEventListener("resize",o),(m=f)==null||m.disconnect(),(E=l)==null||E.disconnect()}},[q,tt]),d.useEffect(()=>{const o=Array.from(O.current.children),l=o.length;if(typeof IntersectionObserver<"u"&&l>0&&I&&M!==!1){const i=o[0],n=o[l-1],f={root:W.current,threshold:.99},m=dt=>{Xt(!dt[0].isIntersecting)},E=new IntersectionObserver(m,f);E.observe(i);const G=dt=>{Ut(!dt[0].isIntersecting)},P=new IntersectionObserver(G,f);return P.observe(n),()=>{E.disconnect(),P.disconnect()}}},[I,M,yt,B==null?void 0:B.length]),d.useEffect(()=>{Dt(!0)},[]),d.useEffect(()=>{q()}),d.useEffect(()=>{Et(zt!==$)},[Et,$]),d.useImperativeHandle(u,()=>({updateIndicator:q,updateScrollButtons:tt}),[q,tt]);const Mt=v.jsx(Ie,b({},X,{className:N(z.indicator,X.className),ownerState:A,style:b({},$,X.style)}));let et=0;const Qt=d.Children.map(B,o=>{if(!d.isValidElement(o))return null;const l=o.props.value===void 0?et:o.props.value;Bt.set(l,et);const i=l===U;return et+=1,d.cloneElement(o,b({fullWidth:R==="fullWidth",indicator:i&&!St&&Mt,selected:i,selectionFollowsFocus:nt,onChange:T,textColor:Q,value:l},et===1&&U===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),Jt=o=>{const l=O.current,i=ee(l).activeElement;if(i.getAttribute("role")!=="tab")return;let f=g==="horizontal"?"ArrowLeft":"ArrowUp",m=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&c&&(f="ArrowRight",m="ArrowLeft"),o.key){case f:o.preventDefault(),ot(l,i,Wt);break;case m:o.preventDefault(),ot(l,i,Rt);break;case"Home":o.preventDefault(),ot(l,null,Rt);break;case"End":o.preventDefault(),ot(l,null,Wt);break}},ct=Gt();return v.jsxs(Be,b({className:N(z.root,y),ownerState:A,ref:r,as:S},Ot,{children:[ct.scrollButtonStart,ct.scrollbarSizeListener,v.jsxs(we,{className:z.scroller,ownerState:A,style:{overflow:Ct.overflow,[C?`margin${c?"Left":"Right"}`:"marginBottom"]:st?void 0:-Ct.scrollbarWidth},ref:W,children:[v.jsx(Te,{"aria-label":h,"aria-labelledby":p,"aria-orientation":g==="vertical"?"vertical":null,className:z.flexContainer,ownerState:A,onKeyDown:Jt,ref:O,role:"tablist",children:Qt}),St&&Mt]}),ct.scrollButtonEnd]}))});export{We as T,Re as a,bt as t};