????
Current Path : C:/inetpub/vhost/yte.nextform.vn/wwwroot/assets/ |
Current File : C:/inetpub/vhost/yte.nextform.vn/wwwroot/assets/Tabs-RTtN3277.js |
var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});import{a as generateUtilityClasses,g as generateUtilityClass,s as styled,ba as ButtonBase,c as capitalize,_ as _extends,b as reactExports,u as useThemeProps,f as _objectWithoutPropertiesLoose,h as clsx,j as jsxRuntimeExports,i as PropTypes,l as composeClasses,av as useEnhancedEffect,cd as debounce,cb as ownerWindow,e as useRtl,by as useSlotProps,d as useTheme,bo as useEventCallback,b8 as reactIsExports,aZ as refType,bp as ownerDocument}from"./index-D7FR_S6u.js";import{u as unsupportedProp}from"./unsupportedProp-BgrWi5Mc.js";import{a as KeyboardArrowLeft,K as KeyboardArrowRight}from"./KeyboardArrowRight-Bs7l1Ath.js";let cachedType;function detectScrollType(){if(cachedType)return cachedType;const dummy=document.createElement("div"),container=document.createElement("div");return container.style.width="10px",container.style.height="1px",dummy.appendChild(container),dummy.dir="rtl",dummy.style.fontSize="14px",dummy.style.width="4px",dummy.style.height="1px",dummy.style.position="absolute",dummy.style.top="-1000px",dummy.style.overflow="scroll",document.body.appendChild(dummy),cachedType="reverse",dummy.scrollLeft>0?cachedType="default":(dummy.scrollLeft=1,dummy.scrollLeft===0&&(cachedType="negative")),document.body.removeChild(dummy),cachedType}__name(detectScrollType,"detectScrollType");function getNormalizedScrollLeft(element,direction){const scrollLeft=element.scrollLeft;if(direction!=="rtl")return scrollLeft;switch(detectScrollType()){case"negative":return element.scrollWidth-element.clientWidth+scrollLeft;case"reverse":return element.scrollWidth-element.clientWidth-scrollLeft;default:return scrollLeft}}__name(getNormalizedScrollLeft,"getNormalizedScrollLeft");function getTabUtilityClass(slot){return generateUtilityClass("MuiTab",slot)}__name(getTabUtilityClass,"getTabUtilityClass");const tabClasses=generateUtilityClasses("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),_excluded$3=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],useUtilityClasses$2=__name(ownerState=>{const{classes,textColor,fullWidth,wrapped,icon,label,selected,disabled}=ownerState,slots={root:["root",icon&&label&&"labelIcon",`textColor${capitalize(textColor)}`,fullWidth&&"fullWidth",wrapped&&"wrapped",selected&&"selected",disabled&&"disabled"],iconWrapper:["iconWrapper"]};return composeClasses(slots,getTabUtilityClass,classes)},"useUtilityClasses$2"),TabRoot=styled(ButtonBase,{name:"MuiTab",slot:"Root",overridesResolver:(props,styles2)=>{const{ownerState}=props;return[styles2.root,ownerState.label&&ownerState.icon&&styles2.labelIcon,styles2[`textColor${capitalize(ownerState.textColor)}`],ownerState.fullWidth&&styles2.fullWidth,ownerState.wrapped&&styles2.wrapped]}})(({theme,ownerState})=>_extends({},theme.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},ownerState.label&&{flexDirection:ownerState.iconPosition==="top"||ownerState.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},ownerState.icon&&ownerState.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${tabClasses.iconWrapper}`]:_extends({},ownerState.iconPosition==="top"&&{marginBottom:6},ownerState.iconPosition==="bottom"&&{marginTop:6},ownerState.iconPosition==="start"&&{marginRight:theme.spacing(1)},ownerState.iconPosition==="end"&&{marginLeft:theme.spacing(1)})},ownerState.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${tabClasses.selected}`]:{opacity:1},[`&.${tabClasses.disabled}`]:{opacity:(theme.vars||theme).palette.action.disabledOpacity}},ownerState.textColor==="primary"&&{color:(theme.vars||theme).palette.text.secondary,[`&.${tabClasses.selected}`]:{color:(theme.vars||theme).palette.primary.main},[`&.${tabClasses.disabled}`]:{color:(theme.vars||theme).palette.text.disabled}},ownerState.textColor==="secondary"&&{color:(theme.vars||theme).palette.text.secondary,[`&.${tabClasses.selected}`]:{color:(theme.vars||theme).palette.secondary.main},[`&.${tabClasses.disabled}`]:{color:(theme.vars||theme).palette.text.disabled}},ownerState.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},ownerState.wrapped&&{fontSize:theme.typography.pxToRem(12)})),Tab=reactExports.forwardRef(__name(function(inProps,ref){const props=useThemeProps({props:inProps,name:"MuiTab"}),{className,disabled=!1,disableFocusRipple=!1,fullWidth,icon:iconProp,iconPosition="top",indicator,label,onChange,onClick,onFocus,selected,selectionFollowsFocus,textColor="inherit",value,wrapped=!1}=props,other=_objectWithoutPropertiesLoose(props,_excluded$3),ownerState=_extends({},props,{disabled,disableFocusRipple,selected,icon:!!iconProp,iconPosition,label:!!label,fullWidth,textColor,wrapped}),classes=useUtilityClasses$2(ownerState),icon=iconProp&&label&&reactExports.isValidElement(iconProp)?reactExports.cloneElement(iconProp,{className:clsx(classes.iconWrapper,iconProp.props.className)}):iconProp,handleClick=__name(event=>{!selected&&onChange&&onChange(event,value),onClick&&onClick(event)},"handleClick"),handleFocus=__name(event=>{selectionFollowsFocus&&!selected&&onChange&&onChange(event,value),onFocus&&onFocus(event)},"handleFocus");return jsxRuntimeExports.jsxs(TabRoot,_extends({focusRipple:!disableFocusRipple,className:clsx(classes.root,className),ref,role:"tab","aria-selected":selected,disabled,onClick:handleClick,onFocus:handleFocus,ownerState,tabIndex:selected?0:-1},other,{children:[iconPosition==="top"||iconPosition==="start"?jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[icon,label]}):jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[label,icon]}),indicator]}))},"Tab2"));Tab.propTypes={children:unsupportedProp,classes:PropTypes.object,className:PropTypes.string,disabled:PropTypes.bool,disableFocusRipple:PropTypes.bool,disableRipple:PropTypes.bool,icon:PropTypes.oneOfType([PropTypes.element,PropTypes.string]),iconPosition:PropTypes.oneOf(["bottom","end","start","top"]),label:PropTypes.node,onChange:PropTypes.func,onClick:PropTypes.func,onFocus:PropTypes.func,sx:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func,PropTypes.object,PropTypes.bool])),PropTypes.func,PropTypes.object]),value:PropTypes.any,wrapped:PropTypes.bool};function easeInOutSin(time){return(1+Math.sin(Math.PI*time-Math.PI/2))/2}__name(easeInOutSin,"easeInOutSin");function animate(property,element,to,options={},cb=()=>{}){const{ease=easeInOutSin,duration=300}=options;let start=null;const from=element[property];let cancelled=!1;const cancel=__name(()=>{cancelled=!0},"cancel"),step=__name(timestamp=>{if(cancelled){cb(new Error("Animation cancelled"));return}start===null&&(start=timestamp);const time=Math.min(1,(timestamp-start)/duration);if(element[property]=ease(time)*(to-from)+from,time>=1){requestAnimationFrame(()=>{cb(null)});return}requestAnimationFrame(step)},"step");return from===to?(cb(new Error("Element already at target position")),cancel):(requestAnimationFrame(step),cancel)}__name(animate,"animate");const _excluded$2=["onChange"],styles={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function ScrollbarSize(props){const{onChange}=props,other=_objectWithoutPropertiesLoose(props,_excluded$2),scrollbarHeight=reactExports.useRef(),nodeRef=reactExports.useRef(null),setMeasurements=__name(()=>{scrollbarHeight.current=nodeRef.current.offsetHeight-nodeRef.current.clientHeight},"setMeasurements");return useEnhancedEffect(()=>{const handleResize=debounce(()=>{const prevHeight=scrollbarHeight.current;setMeasurements(),prevHeight!==scrollbarHeight.current&&onChange(scrollbarHeight.current)}),containerWindow=ownerWindow(nodeRef.current);return containerWindow.addEventListener("resize",handleResize),()=>{handleResize.clear(),containerWindow.removeEventListener("resize",handleResize)}},[onChange]),reactExports.useEffect(()=>{setMeasurements(),onChange(scrollbarHeight.current)},[onChange]),jsxRuntimeExports.jsx("div",_extends({style:styles,ref:nodeRef},other))}__name(ScrollbarSize,"ScrollbarSize");ScrollbarSize.propTypes={onChange:PropTypes.func.isRequired};function getTabScrollButtonUtilityClass(slot){return generateUtilityClass("MuiTabScrollButton",slot)}__name(getTabScrollButtonUtilityClass,"getTabScrollButtonUtilityClass");const tabScrollButtonClasses=generateUtilityClasses("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),_excluded$1=["className","slots","slotProps","direction","orientation","disabled"],useUtilityClasses$1=__name(ownerState=>{const{classes,orientation,disabled}=ownerState;return composeClasses({root:["root",orientation,disabled&&"disabled"]},getTabScrollButtonUtilityClass,classes)},"useUtilityClasses$1"),TabScrollButtonRoot=styled(ButtonBase,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(props,styles2)=>{const{ownerState}=props;return[styles2.root,ownerState.orientation&&styles2[ownerState.orientation]]}})(({ownerState})=>_extends({width:40,flexShrink:0,opacity:.8,[`&.${tabScrollButtonClasses.disabled}`]:{opacity:0}},ownerState.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${ownerState.isRtl?-90:90}deg)`}})),TabScrollButton=reactExports.forwardRef(__name(function(inProps,ref){var _slots$StartScrollBut,_slots$EndScrollButto;const props=useThemeProps({props:inProps,name:"MuiTabScrollButton"}),{className,slots={},slotProps={},direction}=props,other=_objectWithoutPropertiesLoose(props,_excluded$1),isRtl=useRtl(),ownerState=_extends({isRtl},props),classes=useUtilityClasses$1(ownerState),StartButtonIcon=(_slots$StartScrollBut=slots.StartScrollButtonIcon)!=null?_slots$StartScrollBut:KeyboardArrowLeft,EndButtonIcon=(_slots$EndScrollButto=slots.EndScrollButtonIcon)!=null?_slots$EndScrollButto:KeyboardArrowRight,startButtonIconProps=useSlotProps({elementType:StartButtonIcon,externalSlotProps:slotProps.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState}),endButtonIconProps=useSlotProps({elementType:EndButtonIcon,externalSlotProps:slotProps.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState});return jsxRuntimeExports.jsx(TabScrollButtonRoot,_extends({component:"div",className:clsx(classes.root,className),ref,role:null,ownerState,tabIndex:null},other,{children:direction==="left"?jsxRuntimeExports.jsx(StartButtonIcon,_extends({},startButtonIconProps)):jsxRuntimeExports.jsx(EndButtonIcon,_extends({},endButtonIconProps))}))},"TabScrollButton2"));TabScrollButton.propTypes={children:PropTypes.node,classes:PropTypes.object,className:PropTypes.string,direction:PropTypes.oneOf(["left","right"]).isRequired,disabled:PropTypes.bool,orientation:PropTypes.oneOf(["horizontal","vertical"]).isRequired,slotProps:PropTypes.shape({endScrollButtonIcon:PropTypes.oneOfType([PropTypes.func,PropTypes.object]),startScrollButtonIcon:PropTypes.oneOfType([PropTypes.func,PropTypes.object])}),slots:PropTypes.shape({EndScrollButtonIcon:PropTypes.elementType,StartScrollButtonIcon:PropTypes.elementType}),sx:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func,PropTypes.object,PropTypes.bool])),PropTypes.func,PropTypes.object])};function getTabsUtilityClass(slot){return generateUtilityClass("MuiTabs",slot)}__name(getTabsUtilityClass,"getTabsUtilityClass");const tabsClasses=generateUtilityClasses("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),_excluded=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],nextItem=__name((list,item)=>list===item?list.firstChild:item&&item.nextElementSibling?item.nextElementSibling:list.firstChild,"nextItem"),previousItem=__name((list,item)=>list===item?list.lastChild:item&&item.previousElementSibling?item.previousElementSibling:list.lastChild,"previousItem"),moveFocus=__name((list,currentFocus,traversalFunction)=>{let wrappedOnce=!1,nextFocus=traversalFunction(list,currentFocus);for(;nextFocus;){if(nextFocus===list.firstChild){if(wrappedOnce)return;wrappedOnce=!0}const nextFocusDisabled=nextFocus.disabled||nextFocus.getAttribute("aria-disabled")==="true";if(!nextFocus.hasAttribute("tabindex")||nextFocusDisabled)nextFocus=traversalFunction(list,nextFocus);else{nextFocus.focus();return}}},"moveFocus"),useUtilityClasses=__name(ownerState=>{const{vertical,fixed,hideScrollbar,scrollableX,scrollableY,centered,scrollButtonsHideMobile,classes}=ownerState;return composeClasses({root:["root",vertical&&"vertical"],scroller:["scroller",fixed&&"fixed",hideScrollbar&&"hideScrollbar",scrollableX&&"scrollableX",scrollableY&&"scrollableY"],flexContainer:["flexContainer",vertical&&"flexContainerVertical",centered&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",scrollButtonsHideMobile&&"scrollButtonsHideMobile"],scrollableX:[scrollableX&&"scrollableX"],hideScrollbar:[hideScrollbar&&"hideScrollbar"]},getTabsUtilityClass,classes)},"useUtilityClasses"),TabsRoot=styled("div",{name:"MuiTabs",slot:"Root",overridesResolver:(props,styles2)=>{const{ownerState}=props;return[{[`& .${tabsClasses.scrollButtons}`]:styles2.scrollButtons},{[`& .${tabsClasses.scrollButtons}`]:ownerState.scrollButtonsHideMobile&&styles2.scrollButtonsHideMobile},styles2.root,ownerState.vertical&&styles2.vertical]}})(({ownerState,theme})=>_extends({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},ownerState.vertical&&{flexDirection:"column"},ownerState.scrollButtonsHideMobile&&{[`& .${tabsClasses.scrollButtons}`]:{[theme.breakpoints.down("sm")]:{display:"none"}}})),TabsScroller=styled("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(props,styles2)=>{const{ownerState}=props;return[styles2.scroller,ownerState.fixed&&styles2.fixed,ownerState.hideScrollbar&&styles2.hideScrollbar,ownerState.scrollableX&&styles2.scrollableX,ownerState.scrollableY&&styles2.scrollableY]}})(({ownerState})=>_extends({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},ownerState.fixed&&{overflowX:"hidden",width:"100%"},ownerState.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},ownerState.scrollableX&&{overflowX:"auto",overflowY:"hidden"},ownerState.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),FlexContainer=styled("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(props,styles2)=>{const{ownerState}=props;return[styles2.flexContainer,ownerState.vertical&&styles2.flexContainerVertical,ownerState.centered&&styles2.centered]}})(({ownerState})=>_extends({display:"flex"},ownerState.vertical&&{flexDirection:"column"},ownerState.centered&&{justifyContent:"center"})),TabsIndicator=styled("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(props,styles2)=>styles2.indicator})(({ownerState,theme})=>_extends({position:"absolute",height:2,bottom:0,width:"100%",transition:theme.transitions.create()},ownerState.indicatorColor==="primary"&&{backgroundColor:(theme.vars||theme).palette.primary.main},ownerState.indicatorColor==="secondary"&&{backgroundColor:(theme.vars||theme).palette.secondary.main},ownerState.vertical&&{height:"100%",width:2,right:0})),TabsScrollbarSize=styled(ScrollbarSize)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),defaultIndicatorStyle={};let warnedOnceTabPresent=!1;const Tabs=reactExports.forwardRef(__name(function(inProps,ref){const props=useThemeProps({props:inProps,name:"MuiTabs"}),theme=useTheme(),isRtl=useRtl(),{"aria-label":ariaLabel,"aria-labelledby":ariaLabelledBy,action,centered=!1,children:childrenProp,className,component="div",allowScrollButtonsMobile=!1,indicatorColor="primary",onChange,orientation="horizontal",ScrollButtonComponent=TabScrollButton,scrollButtons="auto",selectionFollowsFocus,slots={},slotProps={},TabIndicatorProps={},TabScrollButtonProps={},textColor="primary",value,variant="standard",visibleScrollbar=!1}=props,other=_objectWithoutPropertiesLoose(props,_excluded),scrollable=variant==="scrollable",vertical=orientation==="vertical",scrollStart=vertical?"scrollTop":"scrollLeft",start=vertical?"top":"left",end=vertical?"bottom":"right",clientSize=vertical?"clientHeight":"clientWidth",size=vertical?"height":"width",ownerState=_extends({},props,{component,allowScrollButtonsMobile,indicatorColor,orientation,vertical,scrollButtons,textColor,variant,visibleScrollbar,fixed:!scrollable,hideScrollbar:scrollable&&!visibleScrollbar,scrollableX:scrollable&&!vertical,scrollableY:scrollable&&vertical,centered:centered&&!scrollable,scrollButtonsHideMobile:!allowScrollButtonsMobile}),classes=useUtilityClasses(ownerState),startScrollButtonIconProps=useSlotProps({elementType:slots.StartScrollButtonIcon,externalSlotProps:slotProps.startScrollButtonIcon,ownerState}),endScrollButtonIconProps=useSlotProps({elementType:slots.EndScrollButtonIcon,externalSlotProps:slotProps.endScrollButtonIcon,ownerState});centered&&scrollable&&console.error('MUI: You can not use the `centered={true}` and `variant="scrollable"` properties at the same time on a `Tabs` component.');const[mounted,setMounted]=reactExports.useState(!1),[indicatorStyle,setIndicatorStyle]=reactExports.useState(defaultIndicatorStyle),[displayStartScroll,setDisplayStartScroll]=reactExports.useState(!1),[displayEndScroll,setDisplayEndScroll]=reactExports.useState(!1),[updateScrollObserver,setUpdateScrollObserver]=reactExports.useState(!1),[scrollerStyle,setScrollerStyle]=reactExports.useState({overflow:"hidden",scrollbarWidth:0}),valueToIndex=new Map,tabsRef=reactExports.useRef(null),tabListRef=reactExports.useRef(null),getTabsMeta=__name(()=>{const tabsNode=tabsRef.current;let tabsMeta;if(tabsNode){const rect=tabsNode.getBoundingClientRect();tabsMeta={clientWidth:tabsNode.clientWidth,scrollLeft:tabsNode.scrollLeft,scrollTop:tabsNode.scrollTop,scrollLeftNormalized:getNormalizedScrollLeft(tabsNode,isRtl?"rtl":"ltr"),scrollWidth:tabsNode.scrollWidth,top:rect.top,bottom:rect.bottom,left:rect.left,right:rect.right}}let tabMeta;if(tabsNode&&value!==!1){const children2=tabListRef.current.children;if(children2.length>0){const tab=children2[valueToIndex.get(value)];tab||console.error(["MUI: The `value` provided to the Tabs component is invalid.",`None of the Tabs' children match with "${value}".`,valueToIndex.keys?`You can provide one of the following values: ${Array.from(valueToIndex.keys()).join(", ")}.`:null].join(` `)),tabMeta=tab?tab.getBoundingClientRect():null,!warnedOnceTabPresent&&tabMeta&&tabMeta.width===0&&tabMeta.height===0&&tabsMeta.clientWidth!==0&&(tabsMeta=null,console.error(["MUI: The `value` provided to the Tabs component is invalid.",`The Tab with this \`value\` ("${value}") is not part of the document layout.`,"Make sure the tab item is present in the document or that it's not `display: none`."].join(` `)),warnedOnceTabPresent=!0)}}return{tabsMeta,tabMeta}},"getTabsMeta"),updateIndicatorState=useEventCallback(()=>{const{tabsMeta,tabMeta}=getTabsMeta();let startValue=0,startIndicator;if(vertical)startIndicator="top",tabMeta&&tabsMeta&&(startValue=tabMeta.top-tabsMeta.top+tabsMeta.scrollTop);else if(startIndicator=isRtl?"right":"left",tabMeta&&tabsMeta){const correction=isRtl?tabsMeta.scrollLeftNormalized+tabsMeta.clientWidth-tabsMeta.scrollWidth:tabsMeta.scrollLeft;startValue=(isRtl?-1:1)*(tabMeta[startIndicator]-tabsMeta[startIndicator]+correction)}const newIndicatorStyle={[startIndicator]:startValue,[size]:tabMeta?tabMeta[size]:0};if(isNaN(indicatorStyle[startIndicator])||isNaN(indicatorStyle[size]))setIndicatorStyle(newIndicatorStyle);else{const dStart=Math.abs(indicatorStyle[startIndicator]-newIndicatorStyle[startIndicator]),dSize=Math.abs(indicatorStyle[size]-newIndicatorStyle[size]);(dStart>=1||dSize>=1)&&setIndicatorStyle(newIndicatorStyle)}}),scroll=__name((scrollValue,{animation=!0}={})=>{animation?animate(scrollStart,tabsRef.current,scrollValue,{duration:theme.transitions.duration.standard}):tabsRef.current[scrollStart]=scrollValue},"scroll"),moveTabsScroll=__name(delta=>{let scrollValue=tabsRef.current[scrollStart];vertical?scrollValue+=delta:(scrollValue+=delta*(isRtl?-1:1),scrollValue*=isRtl&&detectScrollType()==="reverse"?-1:1),scroll(scrollValue)},"moveTabsScroll"),getScrollSize=__name(()=>{const containerSize=tabsRef.current[clientSize];let totalSize=0;const children2=Array.from(tabListRef.current.children);for(let i=0;i<children2.length;i+=1){const tab=children2[i];if(totalSize+tab[clientSize]>containerSize){i===0&&(totalSize=containerSize);break}totalSize+=tab[clientSize]}return totalSize},"getScrollSize"),handleStartScrollClick=__name(()=>{moveTabsScroll(-1*getScrollSize())},"handleStartScrollClick"),handleEndScrollClick=__name(()=>{moveTabsScroll(getScrollSize())},"handleEndScrollClick"),handleScrollbarSizeChange=reactExports.useCallback(scrollbarWidth=>{setScrollerStyle({overflow:null,scrollbarWidth})},[]),getConditionalElements=__name(()=>{const conditionalElements2={};conditionalElements2.scrollbarSizeListener=scrollable?jsxRuntimeExports.jsx(TabsScrollbarSize,{onChange:handleScrollbarSizeChange,className:clsx(classes.scrollableX,classes.hideScrollbar)}):null;const showScrollButtons=scrollable&&(scrollButtons==="auto"&&(displayStartScroll||displayEndScroll)||scrollButtons===!0);return conditionalElements2.scrollButtonStart=showScrollButtons?jsxRuntimeExports.jsx(ScrollButtonComponent,_extends({slots:{StartScrollButtonIcon:slots.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:startScrollButtonIconProps},orientation,direction:isRtl?"right":"left",onClick:handleStartScrollClick,disabled:!displayStartScroll},TabScrollButtonProps,{className:clsx(classes.scrollButtons,TabScrollButtonProps.className)})):null,conditionalElements2.scrollButtonEnd=showScrollButtons?jsxRuntimeExports.jsx(ScrollButtonComponent,_extends({slots:{EndScrollButtonIcon:slots.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:endScrollButtonIconProps},orientation,direction:isRtl?"left":"right",onClick:handleEndScrollClick,disabled:!displayEndScroll},TabScrollButtonProps,{className:clsx(classes.scrollButtons,TabScrollButtonProps.className)})):null,conditionalElements2},"getConditionalElements"),scrollSelectedIntoView=useEventCallback(animation=>{const{tabsMeta,tabMeta}=getTabsMeta();if(!(!tabMeta||!tabsMeta)){if(tabMeta[start]<tabsMeta[start]){const nextScrollStart=tabsMeta[scrollStart]+(tabMeta[start]-tabsMeta[start]);scroll(nextScrollStart,{animation})}else if(tabMeta[end]>tabsMeta[end]){const nextScrollStart=tabsMeta[scrollStart]+(tabMeta[end]-tabsMeta[end]);scroll(nextScrollStart,{animation})}}}),updateScrollButtonState=useEventCallback(()=>{scrollable&&scrollButtons!==!1&&setUpdateScrollObserver(!updateScrollObserver)});reactExports.useEffect(()=>{const handleResize=debounce(()=>{tabsRef.current&&updateIndicatorState()});let resizeObserver;const handleMutation=__name(records=>{records.forEach(record=>{record.removedNodes.forEach(item=>{var _resizeObserver;(_resizeObserver=resizeObserver)==null||_resizeObserver.unobserve(item)}),record.addedNodes.forEach(item=>{var _resizeObserver2;(_resizeObserver2=resizeObserver)==null||_resizeObserver2.observe(item)})}),handleResize(),updateScrollButtonState()},"handleMutation"),win=ownerWindow(tabsRef.current);win.addEventListener("resize",handleResize);let mutationObserver;return typeof ResizeObserver<"u"&&(resizeObserver=new ResizeObserver(handleResize),Array.from(tabListRef.current.children).forEach(child=>{resizeObserver.observe(child)})),typeof MutationObserver<"u"&&(mutationObserver=new MutationObserver(handleMutation),mutationObserver.observe(tabListRef.current,{childList:!0})),()=>{var _mutationObserver,_resizeObserver3;handleResize.clear(),win.removeEventListener("resize",handleResize),(_mutationObserver=mutationObserver)==null||_mutationObserver.disconnect(),(_resizeObserver3=resizeObserver)==null||_resizeObserver3.disconnect()}},[updateIndicatorState,updateScrollButtonState]),reactExports.useEffect(()=>{const tabListChildren=Array.from(tabListRef.current.children),length=tabListChildren.length;if(typeof IntersectionObserver<"u"&&length>0&&scrollable&&scrollButtons!==!1){const firstTab=tabListChildren[0],lastTab=tabListChildren[length-1],observerOptions={root:tabsRef.current,threshold:.99},handleScrollButtonStart=__name(entries=>{setDisplayStartScroll(!entries[0].isIntersecting)},"handleScrollButtonStart"),firstObserver=new IntersectionObserver(handleScrollButtonStart,observerOptions);firstObserver.observe(firstTab);const handleScrollButtonEnd=__name(entries=>{setDisplayEndScroll(!entries[0].isIntersecting)},"handleScrollButtonEnd"),lastObserver=new IntersectionObserver(handleScrollButtonEnd,observerOptions);return lastObserver.observe(lastTab),()=>{firstObserver.disconnect(),lastObserver.disconnect()}}},[scrollable,scrollButtons,updateScrollObserver,childrenProp==null?void 0:childrenProp.length]),reactExports.useEffect(()=>{setMounted(!0)},[]),reactExports.useEffect(()=>{updateIndicatorState()}),reactExports.useEffect(()=>{scrollSelectedIntoView(defaultIndicatorStyle!==indicatorStyle)},[scrollSelectedIntoView,indicatorStyle]),reactExports.useImperativeHandle(action,()=>({updateIndicator:updateIndicatorState,updateScrollButtons:updateScrollButtonState}),[updateIndicatorState,updateScrollButtonState]);const indicator=jsxRuntimeExports.jsx(TabsIndicator,_extends({},TabIndicatorProps,{className:clsx(classes.indicator,TabIndicatorProps.className),ownerState,style:_extends({},indicatorStyle,TabIndicatorProps.style)}));let childIndex=0;const children=reactExports.Children.map(childrenProp,child=>{if(!reactExports.isValidElement(child))return null;reactIsExports.isFragment(child)&&console.error(["MUI: The Tabs component doesn't accept a Fragment as a child.","Consider providing an array instead."].join(` `));const childValue=child.props.value===void 0?childIndex:child.props.value;valueToIndex.set(childValue,childIndex);const selected=childValue===value;return childIndex+=1,reactExports.cloneElement(child,_extends({fullWidth:variant==="fullWidth",indicator:selected&&!mounted&&indicator,selected,selectionFollowsFocus,onChange,textColor,value:childValue},childIndex===1&&value===!1&&!child.props.tabIndex?{tabIndex:0}:{}))}),handleKeyDown=__name(event=>{const list=tabListRef.current,currentFocus=ownerDocument(list).activeElement;if(currentFocus.getAttribute("role")!=="tab")return;let previousItemKey=orientation==="horizontal"?"ArrowLeft":"ArrowUp",nextItemKey=orientation==="horizontal"?"ArrowRight":"ArrowDown";switch(orientation==="horizontal"&&isRtl&&(previousItemKey="ArrowRight",nextItemKey="ArrowLeft"),event.key){case previousItemKey:event.preventDefault(),moveFocus(list,currentFocus,previousItem);break;case nextItemKey:event.preventDefault(),moveFocus(list,currentFocus,nextItem);break;case"Home":event.preventDefault(),moveFocus(list,null,nextItem);break;case"End":event.preventDefault(),moveFocus(list,null,previousItem);break}},"handleKeyDown"),conditionalElements=getConditionalElements();return jsxRuntimeExports.jsxs(TabsRoot,_extends({className:clsx(classes.root,className),ownerState,ref,as:component},other,{children:[conditionalElements.scrollButtonStart,conditionalElements.scrollbarSizeListener,jsxRuntimeExports.jsxs(TabsScroller,{className:classes.scroller,ownerState,style:{overflow:scrollerStyle.overflow,[vertical?`margin${isRtl?"Left":"Right"}`:"marginBottom"]:visibleScrollbar?void 0:-scrollerStyle.scrollbarWidth},ref:tabsRef,children:[jsxRuntimeExports.jsx(FlexContainer,{"aria-label":ariaLabel,"aria-labelledby":ariaLabelledBy,"aria-orientation":orientation==="vertical"?"vertical":null,className:classes.flexContainer,ownerState,onKeyDown:handleKeyDown,ref:tabListRef,role:"tablist",children}),mounted&&indicator]}),conditionalElements.scrollButtonEnd]}))},"Tabs2"));Tabs.propTypes={action:refType,allowScrollButtonsMobile:PropTypes.bool,"aria-label":PropTypes.string,"aria-labelledby":PropTypes.string,centered:PropTypes.bool,children:PropTypes.node,classes:PropTypes.object,className:PropTypes.string,component:PropTypes.elementType,indicatorColor:PropTypes.oneOfType([PropTypes.oneOf(["primary","secondary"]),PropTypes.string]),onChange:PropTypes.func,orientation:PropTypes.oneOf(["horizontal","vertical"]),ScrollButtonComponent:PropTypes.elementType,scrollButtons:PropTypes.oneOf(["auto",!1,!0]),selectionFollowsFocus:PropTypes.bool,slotProps:PropTypes.shape({endScrollButtonIcon:PropTypes.oneOfType([PropTypes.func,PropTypes.object]),startScrollButtonIcon:PropTypes.oneOfType([PropTypes.func,PropTypes.object])}),slots:PropTypes.shape({EndScrollButtonIcon:PropTypes.elementType,StartScrollButtonIcon:PropTypes.elementType}),sx:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func,PropTypes.object,PropTypes.bool])),PropTypes.func,PropTypes.object]),TabIndicatorProps:PropTypes.object,TabScrollButtonProps:PropTypes.object,textColor:PropTypes.oneOf(["inherit","primary","secondary"]),value:PropTypes.any,variant:PropTypes.oneOf(["fullWidth","scrollable","standard"]),visibleScrollbar:PropTypes.bool};export{Tabs as T,Tab as a};