import{cG as T,cF as V,en as l,o as i,f as F,T as A,cH as L,cI as M,cN as R,r as k,cJ as P,q as j,j as N,cL as U,cM as z,fS as m}from"./index-c1429e77.js";function B(e){return V("MuiLink",e)}const H=T("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),E=H,W=({theme:e,ownerState:n})=>{const t=n.color,r=l(e,`palette.${t}.main`,!1)||l(e,`palette.${t}`,!1)||n.color,o=l(e,`palette.${t}.mainChannel`)||l(e,`palette.${t}Channel`);return"vars"in e&&o?`rgba(${o} / 0.4)`:i(r,.4)},q=W,v={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},G=e=>{const{classes:n,component:t,focusVisible:r,underline:o}=e,c={root:["root",`underline${L(o)}`,t==="button"&&"button",r&&"focusVisible"]};return z(c,B,n)},I=F(A,{name:"MuiLink",slot:"Root",overridesResolver:(e,n)=>{const{ownerState:t}=e;return[n.root,n[`underline${L(t.underline)}`],t.component==="button"&&n.button]}})(M(({theme:e})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:n,ownerState:t})=>n==="always"&&t.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(e.palette).filter(R()).map(([n])=>({props:{underline:"always",color:n},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette[n].mainChannel} / 0.4)`:i(e.palette[n].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:i(e.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette.text.secondaryChannel} / 0.4)`:i(e.palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(e.vars||e).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${E.focusVisible}`]:{outline:"auto"}}}]}))),J=k.forwardRef(function(n,t){const r=P({props:n,name:"MuiLink"}),o=j(),{className:c,color:s="primary",component:d="a",onBlur:y,onFocus:f,TypographyClasses:$,underline:b="always",variant:x="inherit",sx:u,...C}=r,[w,g]=k.useState(!1),D=a=>{m(a.target)||g(!1),y&&y(a)},h=a=>{m(a.target)&&g(!0),f&&f(a)},p={...r,color:s,component:d,focusVisible:w,underline:b,variant:x},S=G(p);return N.jsx(I,{color:s,className:U(S.root,c),classes:$,component:d,onBlur:D,onFocus:h,ref:t,ownerState:p,variant:x,...C,sx:[...v[s]===void 0?[{color:s}]:[],...Array.isArray(u)?u:[u]],style:{...C.style,...b==="always"&&s!=="inherit"&&!v[s]&&{"--Link-underlineColor":q({theme:o,ownerState:p})}}})}),K=J;export{K as L};
