????

Your IP : 18.223.162.48


Current Path : C:/inetpub/vhost/tracnghiem.gdtsolutions.vn/wwwroot/assets/
Upload File :
Current File : C:/inetpub/vhost/tracnghiem.gdtsolutions.vn/wwwroot/assets/Tabs-59094e22.js

import{a as pe,g as he,s as O,aC as Ne,c as ke,_ as f,b as d,u as me,e as ne,f as z,j as g,p as o,h as ve,bg as fe,bi as Fe,d as Le,aM as ue,be as Je,a_ as Qe,aN as Ze}from"./index-9bcd78a9.js";import{u as et}from"./unsupportedProp-e368368f.js";import{a as tt,K as ot}from"./KeyboardArrowRight-930a3b01.js";let H;function $e(){if(H)return H;const e=document.createElement("div"),t=document.createElement("div");return t.style.width="10px",t.style.height="1px",e.appendChild(t),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),H="reverse",e.scrollLeft>0?H="default":(e.scrollLeft=1,e.scrollLeft===0&&(H="negative")),document.body.removeChild(e),H}function Me(e,t){const n=e.scrollLeft;if(t!=="rtl")return n;switch($e()){case"negative":return e.scrollWidth-e.clientWidth+n;case"reverse":return e.scrollWidth-e.clientWidth-n;default:return n}}function lt(e){return he("MuiTab",e)}const rt=pe("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),$=rt,nt=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],st=e=>{const{classes:t,textColor:n,fullWidth:c,wrapped:i,icon:u,label:h,selected:m,disabled:b}=e,v={root:["root",u&&h&&"labelIcon",`textColor${ke(n)}`,c&&"fullWidth",i&&"wrapped",m&&"selected",b&&"disabled"],iconWrapper:["iconWrapper"]};return ve(v,lt,t)},it=O(Ne,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${ke(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped]}})(({theme:e,ownerState:t})=>f({},e.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},t.label&&{flexDirection:t.iconPosition==="top"||t.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},t.icon&&t.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${$.iconWrapper}`]:f({},t.iconPosition==="top"&&{marginBottom:6},t.iconPosition==="bottom"&&{marginTop:6},t.iconPosition==="start"&&{marginRight:e.spacing(1)},t.iconPosition==="end"&&{marginLeft:e.spacing(1)})},t.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${$.selected}`]:{opacity:1},[`&.${$.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.textColor==="primary"&&{color:(e.vars||e).palette.text.secondary,[`&.${$.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${$.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.textColor==="secondary"&&{color:(e.vars||e).palette.text.secondary,[`&.${$.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${$.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},t.wrapped&&{fontSize:e.typography.pxToRem(12)})),Oe=d.forwardRef(function(t,n){const c=me({props:t,name:"MuiTab"}),{className:i,disabled:u=!1,disableFocusRipple:h=!1,fullWidth:m,icon:b,iconPosition:v="top",indicator:R,label:w,onChange:S,onClick:W,onFocus:J,selected:I,selectionFollowsFocus:C,textColor:Q="inherit",value:j,wrapped:se=!1}=c,X=ne(c,nt),N=f({},c,{disabled:u,disableFocusRipple:h,selected:I,icon:!!b,iconPosition:v,label:!!w,fullWidth:m,textColor:Q,wrapped:se}),D=st(N),B=b&&w&&d.isValidElement(b)?d.cloneElement(b,{className:z(D.iconWrapper,b.props.className)}):b,U=k=>{!I&&S&&S(k,j),W&&W(k)},Y=k=>{C&&!I&&S&&S(k,j),J&&J(k)};return g.jsxs(it,f({focusRipple:!h,className:z(D.root,i),ref:n,role:"tab","aria-selected":I,disabled:u,onClick:U,onFocus:Y,ownerState:N,tabIndex:I?0:-1},X,{children:[v==="top"||v==="start"?g.jsxs(d.Fragment,{children:[B,w]}):g.jsxs(d.Fragment,{children:[w,B]}),R]}))});Oe.propTypes={children:et,classes:o.object,className:o.string,disabled:o.bool,disableFocusRipple:o.bool,disableRipple:o.bool,icon:o.oneOfType([o.element,o.string]),iconPosition:o.oneOf(["bottom","end","start","top"]),label:o.node,onChange:o.func,onClick:o.func,onFocus:o.func,sx:o.oneOfType([o.arrayOf(o.oneOfType([o.func,o.object,o.bool])),o.func,o.object]),value:o.any,wrapped:o.bool};const It=Oe;function at(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function ct(e,t,n,c={},i=()=>{}){const{ease:u=at,duration:h=300}=c;let m=null;const b=t[e];let v=!1;const R=()=>{v=!0},w=S=>{if(v){i(new Error("Animation cancelled"));return}m===null&&(m=S);const W=Math.min(1,(S-m)/h);if(t[e]=u(W)*(n-b)+b,W>=1){requestAnimationFrame(()=>{i(null)});return}requestAnimationFrame(w)};return b===n?(i(new Error("Element already at target position")),R):(requestAnimationFrame(w),R)}const dt=["onChange"],ut={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function Pe(e){const{onChange:t}=e,n=ne(e,dt),c=d.useRef(),i=d.useRef(null),u=()=>{c.current=i.current.offsetHeight-i.current.clientHeight};return d.useEffect(()=>{const h=fe(()=>{const b=c.current;u(),b!==c.current&&t(c.current)}),m=Fe(i.current);return m.addEventListener("resize",h),()=>{h.clear(),m.removeEventListener("resize",h)}},[t]),d.useEffect(()=>{u(),t(c.current)},[t]),g.jsx("div",f({style:ut,ref:i},n))}Pe.propTypes={onChange:o.func.isRequired};function bt(e){return he("MuiTabScrollButton",e)}const ft=pe("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),pt=ft;var Re,We;const ht=["className","direction","orientation","disabled"],mt=e=>{const{classes:t,orientation:n,disabled:c}=e;return ve({root:["root",n,c&&"disabled"]},bt,t)},vt=O(Ne,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})(({ownerState:e})=>f({width:40,flexShrink:0,opacity:.8,[`&.${pt.disabled}`]:{opacity:0}},e.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${e.isRtl?-90:90}deg)`}})),Ae=d.forwardRef(function(t,n){const c=me({props:t,name:"MuiTabScrollButton"}),{className:i,direction:u}=c,h=ne(c,ht),b=Le().direction==="rtl",v=f({isRtl:b},c),R=mt(v);return g.jsx(vt,f({component:"div",className:z(R.root,i),ref:n,role:null,ownerState:v,tabIndex:null},h,{children:u==="left"?Re||(Re=g.jsx(tt,{fontSize:"small"})):We||(We=g.jsx(ot,{fontSize:"small"}))}))});Ae.propTypes={children:o.node,classes:o.object,className:o.string,direction:o.oneOf(["left","right"]).isRequired,disabled:o.bool,orientation:o.oneOf(["horizontal","vertical"]).isRequired,sx:o.oneOfType([o.arrayOf(o.oneOfType([o.func,o.object,o.bool])),o.func,o.object])};const gt=Ae;function xt(e){return he("MuiTabs",e)}const yt=pe("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),be=yt,St=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Ee=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,ze=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,re=(e,t,n)=>{let c=!1,i=n(e,t);for(;i;){if(i===e.firstChild){if(c)return;c=!0}const u=i.disabled||i.getAttribute("aria-disabled")==="true";if(!i.hasAttribute("tabindex")||u)i=n(e,i);else{i.focus();return}}},Ct=e=>{const{vertical:t,fixed:n,hideScrollbar:c,scrollableX:i,scrollableY:u,centered:h,scrollButtonsHideMobile:m,classes:b}=e;return ve({root:["root",t&&"vertical"],scroller:["scroller",n&&"fixed",c&&"hideScrollbar",i&&"scrollableX",u&&"scrollableY"],flexContainer:["flexContainer",t&&"flexContainerVertical",h&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",m&&"scrollButtonsHideMobile"],scrollableX:[i&&"scrollableX"],hideScrollbar:[c&&"hideScrollbar"]},xt,b)},Tt=O("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${be.scrollButtons}`]:t.scrollButtons},{[`& .${be.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(({ownerState:e,theme:t})=>f({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},e.vertical&&{flexDirection:"column"},e.scrollButtonsHideMobile&&{[`& .${be.scrollButtons}`]:{[t.breakpoints.down("sm")]:{display:"none"}}})),wt=O("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})(({ownerState:e})=>f({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},e.fixed&&{overflowX:"hidden",width:"100%"},e.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},e.scrollableX&&{overflowX:"auto",overflowY:"hidden"},e.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),Bt=O("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})(({ownerState:e})=>f({display:"flex"},e.vertical&&{flexDirection:"column"},e.centered&&{justifyContent:"center"})),Mt=O("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})(({ownerState:e,theme:t})=>f({position:"absolute",height:2,bottom:0,width:"100%",transition:t.transitions.create()},e.indicatorColor==="primary"&&{backgroundColor:(t.vars||t).palette.primary.main},e.indicatorColor==="secondary"&&{backgroundColor:(t.vars||t).palette.secondary.main},e.vertical&&{height:"100%",width:2,right:0})),Rt=O(Pe,{name:"MuiTabs",slot:"ScrollbarSize"})({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Ie={};let je=!1;const He=d.forwardRef(function(t,n){const c=me({props:t,name:"MuiTabs"}),i=Le(),u=i.direction==="rtl",{"aria-label":h,"aria-labelledby":m,action:b,centered:v=!1,children:R,className:w,component:S="div",allowScrollButtonsMobile:W=!1,indicatorColor:J="primary",onChange:I,orientation:C="horizontal",ScrollButtonComponent:Q=gt,scrollButtons:j="auto",selectionFollowsFocus:se,TabIndicatorProps:X={},TabScrollButtonProps:N={},textColor:D="primary",value:B,variant:U="standard",visibleScrollbar:Y=!1}=c,k=ne(c,St),M=U==="scrollable",x=C==="vertical",_=x?"scrollTop":"scrollLeft",Z=x?"top":"left",ee=x?"bottom":"right",ie=x?"clientHeight":"clientWidth",K=x?"height":"width",V=f({},c,{component:S,allowScrollButtonsMobile:W,indicatorColor:J,orientation:C,vertical:x,scrollButtons:j,textColor:D,variant:U,visibleScrollbar:Y,fixed:!M,hideScrollbar:M&&!Y,scrollableX:M&&!x,scrollableY:M&&x,centered:v&&!M,scrollButtonsHideMobile:!W}),E=Ct(V);v&&M&&console.error('MUI: You can not use the `centered={true}` and `variant="scrollable"` properties at the same time on a `Tabs` component.');const[ge,Xe]=d.useState(!1),[F,xe]=d.useState(Ie),[P,De]=d.useState({start:!1,end:!1}),[ye,Ue]=d.useState({overflow:"hidden",scrollbarWidth:0}),te=new Map,T=d.useRef(null),q=d.useRef(null),Se=()=>{const l=T.current;let r;if(l){const a=l.getBoundingClientRect();r={clientWidth:l.clientWidth,scrollLeft:l.scrollLeft,scrollTop:l.scrollTop,scrollLeftNormalized:Me(l,i.direction),scrollWidth:l.scrollWidth,top:a.top,bottom:a.bottom,left:a.left,right:a.right}}let s;if(l&&B!==!1){const a=q.current.children;if(a.length>0){const p=a[te.get(B)];p||console.error(["MUI: The `value` provided to the Tabs component is invalid.",`None of the Tabs' children match with "${B}".`,te.keys?`You can provide one of the following values: ${Array.from(te.keys()).join(", ")}.`:null].join(`
`)),s=p?p.getBoundingClientRect():null,!je&&s&&s.width===0&&s.height===0&&r.clientWidth!==0&&(r=null,console.error(["MUI: The `value` provided to the Tabs component is invalid.",`The Tab with this \`value\` ("${B}") 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(`
`)),je=!0)}}return{tabsMeta:r,tabMeta:s}},G=ue(()=>{const{tabsMeta:l,tabMeta:r}=Se();let s=0,a;if(x)a="top",r&&l&&(s=r.top-l.top+l.scrollTop);else if(a=u?"right":"left",r&&l){const y=u?l.scrollLeftNormalized+l.clientWidth-l.scrollWidth:l.scrollLeft;s=(u?-1:1)*(r[a]-l[a]+y)}const p={[a]:s,[K]:r?r[K]:0};if(isNaN(F[a])||isNaN(F[K]))xe(p);else{const y=Math.abs(F[a]-p[a]),A=Math.abs(F[K]-p[K]);(y>=1||A>=1)&&xe(p)}}),ae=(l,{animation:r=!0}={})=>{r?ct(_,T.current,l,{duration:i.transitions.duration.standard}):T.current[_]=l},Ce=l=>{let r=T.current[_];x?r+=l:(r+=l*(u?-1:1),r*=u&&$e()==="reverse"?-1:1),ae(r)},Te=()=>{const l=T.current[ie];let r=0;const s=Array.from(q.current.children);for(let a=0;a<s.length;a+=1){const p=s[a];if(r+p[ie]>l){a===0&&(r=l);break}r+=p[ie]}return r},Ye=()=>{Ce(-1*Te())},_e=()=>{Ce(Te())},Ke=d.useCallback(l=>{Ue({overflow:null,scrollbarWidth:l})},[]),Ve=()=>{const l={};l.scrollbarSizeListener=M?g.jsx(Rt,{onChange:Ke,className:z(E.scrollableX,E.hideScrollbar)}):null;const r=P.start||P.end,s=M&&(j==="auto"&&r||j===!0);return l.scrollButtonStart=s?g.jsx(Q,f({orientation:C,direction:u?"right":"left",onClick:Ye,disabled:!P.start},N,{className:z(E.scrollButtons,N.className)})):null,l.scrollButtonEnd=s?g.jsx(Q,f({orientation:C,direction:u?"left":"right",onClick:_e,disabled:!P.end},N,{className:z(E.scrollButtons,N.className)})):null,l},we=ue(l=>{const{tabsMeta:r,tabMeta:s}=Se();if(!(!s||!r)){if(s[Z]<r[Z]){const a=r[_]+(s[Z]-r[Z]);ae(a,{animation:l})}else if(s[ee]>r[ee]){const a=r[_]+(s[ee]-r[ee]);ae(a,{animation:l})}}}),L=ue(()=>{if(M&&j!==!1){const{scrollTop:l,scrollHeight:r,clientHeight:s,scrollWidth:a,clientWidth:p}=T.current;let y,A;if(x)y=l>1,A=l<r-s-1;else{const le=Me(T.current,i.direction);y=u?le<a-p-1:le>1,A=u?le>1:le<a-p-1}(y!==P.start||A!==P.end)&&De({start:y,end:A})}});d.useEffect(()=>{const l=fe(()=>{T.current&&(G(),L())}),r=Fe(T.current);r.addEventListener("resize",l);let s;return typeof ResizeObserver<"u"&&(s=new ResizeObserver(l),Array.from(q.current.children).forEach(a=>{s.observe(a)})),()=>{l.clear(),r.removeEventListener("resize",l),s&&s.disconnect()}},[G,L]);const ce=d.useMemo(()=>fe(()=>{L()}),[L]);d.useEffect(()=>()=>{ce.clear()},[ce]),d.useEffect(()=>{Xe(!0)},[]),d.useEffect(()=>{G(),L()}),d.useEffect(()=>{we(Ie!==F)},[we,F]),d.useImperativeHandle(b,()=>({updateIndicator:G,updateScrollButtons:L}),[G,L]);const Be=g.jsx(Mt,f({},X,{className:z(E.indicator,X.className),ownerState:V,style:f({},F,X.style)}));let oe=0;const qe=d.Children.map(R,l=>{if(!d.isValidElement(l))return null;Je.isFragment(l)&&console.error(["MUI: The Tabs component doesn't accept a Fragment as a child.","Consider providing an array instead."].join(`
`));const r=l.props.value===void 0?oe:l.props.value;te.set(r,oe);const s=r===B;return oe+=1,d.cloneElement(l,f({fullWidth:U==="fullWidth",indicator:s&&!ge&&Be,selected:s,selectionFollowsFocus:se,onChange:I,textColor:D,value:r},oe===1&&B===!1&&!l.props.tabIndex?{tabIndex:0}:{}))}),Ge=l=>{const r=q.current,s=Ze(r).activeElement;if(s.getAttribute("role")!=="tab")return;let p=C==="horizontal"?"ArrowLeft":"ArrowUp",y=C==="horizontal"?"ArrowRight":"ArrowDown";switch(C==="horizontal"&&u&&(p="ArrowRight",y="ArrowLeft"),l.key){case p:l.preventDefault(),re(r,s,ze);break;case y:l.preventDefault(),re(r,s,Ee);break;case"Home":l.preventDefault(),re(r,null,Ee);break;case"End":l.preventDefault(),re(r,null,ze);break}},de=Ve();return g.jsxs(Tt,f({className:z(E.root,w),ownerState:V,ref:n,as:S},k,{children:[de.scrollButtonStart,de.scrollbarSizeListener,g.jsxs(wt,{className:E.scroller,ownerState:V,style:{overflow:ye.overflow,[x?`margin${u?"Left":"Right"}`:"marginBottom"]:Y?void 0:-ye.scrollbarWidth},ref:T,onScroll:ce,children:[g.jsx(Bt,{"aria-label":h,"aria-labelledby":m,"aria-orientation":C==="vertical"?"vertical":null,className:E.flexContainer,ownerState:V,onKeyDown:Ge,ref:q,role:"tablist",children:qe}),ge&&Be]}),de.scrollButtonEnd]}))});He.propTypes={action:Qe,allowScrollButtonsMobile:o.bool,"aria-label":o.string,"aria-labelledby":o.string,centered:o.bool,children:o.node,classes:o.object,className:o.string,component:o.elementType,indicatorColor:o.oneOfType([o.oneOf(["primary","secondary"]),o.string]),onChange:o.func,orientation:o.oneOf(["horizontal","vertical"]),ScrollButtonComponent:o.elementType,scrollButtons:o.oneOf(["auto",!1,!0]),selectionFollowsFocus:o.bool,sx:o.oneOfType([o.arrayOf(o.oneOfType([o.func,o.object,o.bool])),o.func,o.object]),TabIndicatorProps:o.object,TabScrollButtonProps:o.object,textColor:o.oneOf(["inherit","primary","secondary"]),value:o.any,variant:o.oneOf(["fullWidth","scrollable","standard"]),visibleScrollbar:o.bool};const jt=He;export{jt as T,It as a};