import{a as e,n as t}from"./preload-helper-DxX6f4wy.js";import{$ as n,E as r,F as i,I as a,O as o,P as s,d as c,f as l,g as u,h as d,r as f}from"./Fade-Bj1YUcWe.js";import{t as p}from"./ButtonBase-dVPwHUcG.js";import{n as m}from"./Button-uK26k-ET.js";import{t as h}from"./CircularProgress-zVZJTwOj.js";var g=e(t());function _(e){return i(`MuiIconButton`,e)}var v=s(`MuiIconButton`,[`root`,`disabled`,`colorInherit`,`colorPrimary`,`colorSecondary`,`colorError`,`colorInfo`,`colorSuccess`,`colorWarning`,`edgeStart`,`edgeEnd`,`sizeSmall`,`sizeMedium`,`sizeLarge`,`loading`,`loadingIndicator`,`loadingWrapper`]),y=n(),b=e=>{let{classes:t,disabled:n,color:i,edge:a,size:o,loading:s}=e;return r({root:[`root`,s&&`loading`,n&&`disabled`,i!=="default"&&`color${d(i)}`,a&&`edge${d(a)}`,`size${d(o)}`],loadingIndicator:[`loadingIndicator`],loadingWrapper:[`loadingWrapper`]},_,t)},x=u(p,{name:`MuiIconButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${d(n.color)}`],n.edge&&t[`edge${d(n.edge)}`],t[`size${d(n.size)}`]]}})(l(({theme:e})=>({textAlign:`center`,flex:`0 0 auto`,fontSize:e.typography.pxToRem(24),padding:8,borderRadius:`50%`,color:(e.vars||e).palette.action.active,transition:e.transitions.create(`background-color`,{duration:e.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:o(e.palette.action.active,e.palette.action.hoverOpacity),"&:hover":{backgroundColor:`var(--IconButton-hoverBg)`,"@media (hover: none)":{backgroundColor:`transparent`}}}},{props:{edge:`start`},style:{marginLeft:-12}},{props:{edge:`start`,size:`small`},style:{marginLeft:-3}},{props:{edge:`end`},style:{marginRight:-12}},{props:{edge:`end`,size:`small`},style:{marginRight:-3}}]})),l(({theme:e})=>({variants:[{props:{color:`inherit`},style:{color:`inherit`}},...Object.entries(e.palette).filter(f()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(f()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.vars?`rgba(${(e.vars||e).palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:o((e.vars||e).palette[t].main,e.palette.action.hoverOpacity)}})),{props:{size:`small`},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:`large`},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${v.disabled}`]:{backgroundColor:`transparent`,color:(e.vars||e).palette.action.disabled},[`&.${v.loading}`]:{color:`transparent`}}))),S=u(`span`,{name:`MuiIconButton`,slot:`LoadingIndicator`,overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e})=>({display:`none`,position:`absolute`,visibility:`visible`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:`flex`}}]})),C=g.forwardRef(function(e,t){let n=c({props:e,name:`MuiIconButton`}),{edge:r=!1,children:i,className:o,color:s=`default`,disabled:l=!1,disableFocusRipple:u=!1,size:d=`medium`,id:f,loading:p=null,loadingIndicator:g,..._}=n,v=m(f),C=g??(0,y.jsx)(h,{"aria-labelledby":v,color:`inherit`,size:16}),w={...n,edge:r,color:s,disabled:l,disableFocusRipple:u,loading:p,loadingIndicator:C,size:d},T=b(w);return(0,y.jsxs)(x,{id:p?v:f,className:a(T.root,o),centerRipple:!0,focusRipple:!u,disabled:l||p,ref:t,..._,ownerState:w,children:[typeof p==`boolean`&&(0,y.jsx)(`span`,{className:T.loadingWrapper,style:{display:`contents`},children:(0,y.jsx)(S,{className:T.loadingIndicator,ownerState:w,children:p&&C})}),i]})});export{C as t};