import{a as V,g as h,ai as a,a1 as T,r as g,u as A,z as F,j as R,s as M,c as P,h as L,b as j,T as z,m as U,i as B,V as k}from"./render-BEL5IN7j.js";function N(e){return h("MuiLink",e)}const E=V("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),H=({theme:e,ownerState:o})=>{const r=o.color;if("colorSpace"in e&&e.colorSpace){const l=a(e,`palette.${r}.main`)||a(e,`palette.${r}`)||o.color;return e.alpha(l,.4)}const n=a(e,`palette.${r}.main`,!1)||a(e,`palette.${r}`,!1)||o.color,t=a(e,`palette.${r}.mainChannel`)||a(e,`palette.${r}Channel`);return"vars"in e&&t?`rgba(${t} / 0.4)`:T(n,.4)},v={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},W=e=>{const{classes:o,component:r,focusVisible:n,underline:t}=e,l={root:["root",`underline${L(t)}`,r==="button"&&"button",n&&"focusVisible"]};return j(l,N,o)},O=M(z,{name:"MuiLink",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:r}=e;return[o.root,o[`underline${L(r.underline)}`],r.component==="button"&&o.button]}})(U(({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:o,ownerState:r})=>o==="always"&&r.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},{props:({underline:o,ownerState:r})=>o==="always"&&r.color==="inherit",style:e.colorSpace?{textDecorationColor:e.alpha("currentColor",.4)}:null},...Object.entries(e.palette).filter(B()).map(([o])=>({props:{underline:"always",color:o},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette[o].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.alpha((e.vars||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"}}}]}))),G=g.forwardRef(function(o,r){const n=A({props:o,name:"MuiLink"}),t=F(),{className:l,color:s="primary",component:p="a",onBlur:d,onFocus:y,TypographyClasses:w,underline:b="always",variant:f="inherit",sx:c,...x}=n,[m,C]=g.useState(!1),D=i=>{k(i.target)||C(!1),d&&d(i)},$=i=>{k(i.target)&&C(!0),y&&y(i)},u={...n,color:s,component:p,focusVisible:m,underline:b,variant:f},S=W(u);return R.jsx(O,{color:s,className:P(S.root,l),classes:w,component:p,onBlur:D,onFocus:$,ref:r,ownerState:u,variant:f,...x,sx:[...v[s]===void 0?[{color:s}]:[],...Array.isArray(c)?c:[c]],style:{...x.style,...b==="always"&&s!=="inherit"&&!v[s]&&{"--Link-underlineColor":H({theme:t,ownerState:u})}}})});export{G as L};
//# sourceMappingURL=Link-u7JOT8iP.js.map
