import{b as A,_ as ee,d as E,W as $e,c as me,s as te,aj as ne,f as Ie,aD as _e,aE as Ue}from"./OdysseyThemeProvider-Bh0Bu-2o.js";import{r as a,e as Y}from"./index-NdkWRN8K.js";import{j as N}from"./jsx-runtime-CnH95YSl.js";import{a as ze,u as ue,b as Oe}from"./useIsFocusVisible-DH0qxT5e.js";import{_ as Ke}from"./assertThisInitialized-B9jnkVVz.js";import{_ as Ae,u as H}from"./inheritsLoose-CJ6Ie9dp.js";import{T as ce}from"./TransitionGroupContext-DAL84N7p.js";function oe(t,s){var r=function(e){return s&&a.isValidElement(e)?s(e):e},l=Object.create(null);return t&&a.Children.map(t,function(n){return n}).forEach(function(n){l[n.key]=r(n)}),l}function We(t,s){t=t||{},s=s||{};function r(f){return f in s?s[f]:t[f]}var l=Object.create(null),n=[];for(var e in t)e in s?n.length&&(l[e]=n,n=[]):n.push(e);var o,c={};for(var u in s){if(l[u])for(o=0;o<l[u].length;o++){var p=l[u][o];c[l[u][o]]=r(p)}c[u]=r(u)}for(o=0;o<n.length;o++)c[n[o]]=r(n[o]);return c}function F(t,s,r){return r[s]!=null?r[s]:t.props[s]}function Xe(t,s){return oe(t.children,function(r){return a.cloneElement(r,{onExited:s.bind(null,r),in:!0,appear:F(r,"appear",t),enter:F(r,"enter",t),exit:F(r,"exit",t)})})}function Ye(t,s,r){var l=oe(t.children),n=We(s,l);return Object.keys(n).forEach(function(e){var o=n[e];if(a.isValidElement(o)){var c=e in s,u=e in l,p=s[e],f=a.isValidElement(p)&&!p.props.in;u&&(!c||f)?n[e]=a.cloneElement(o,{onExited:r.bind(null,o),in:!0,exit:F(o,"exit",t),enter:F(o,"enter",t)}):!u&&c&&!f?n[e]=a.cloneElement(o,{in:!1}):u&&c&&a.isValidElement(p)&&(n[e]=a.cloneElement(o,{onExited:r.bind(null,o),in:p.props.in,exit:F(o,"exit",t),enter:F(o,"enter",t)}))}}),n}var He=Object.values||function(t){return Object.keys(t).map(function(s){return t[s]})},Ge={component:"div",childFactory:function(s){return s}},ie=function(t){Ae(s,t);function s(l,n){var e;e=t.call(this,l,n)||this;var o=e.handleExited.bind(Ke(e));return e.state={contextValue:{isMounting:!0},handleExited:o,firstRender:!0},e}var r=s.prototype;return r.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},r.componentWillUnmount=function(){this.mounted=!1},s.getDerivedStateFromProps=function(n,e){var o=e.children,c=e.handleExited,u=e.firstRender;return{children:u?Xe(n,c):Ye(n,o,c),firstRender:!1}},r.handleExited=function(n,e){var o=oe(this.props.children);n.key in o||(n.props.onExited&&n.props.onExited(e),this.mounted&&this.setState(function(c){var u=A({},c.children);return delete u[n.key],{children:u}}))},r.render=function(){var n=this.props,e=n.component,o=n.childFactory,c=ee(n,["component","childFactory"]),u=this.state.contextValue,p=He(this.state.children).map(o);return delete c.appear,delete c.enter,delete c.exit,e===null?Y.createElement(ce.Provider,{value:u},p):Y.createElement(ce.Provider,{value:u},Y.createElement(e,c,p))},s}(Y.Component);ie.propTypes={};ie.defaultProps=Ge;function qe(t){const{className:s,classes:r,pulsate:l=!1,rippleX:n,rippleY:e,rippleSize:o,in:c,onExited:u,timeout:p}=t,[f,g]=a.useState(!1),b=E(s,r.ripple,r.rippleVisible,l&&r.ripplePulsate),C={width:o,height:o,top:-(o/2)+e,left:-(o/2)+n},h=E(r.child,f&&r.childLeaving,l&&r.childPulsate);return!c&&!f&&g(!0),a.useEffect(()=>{if(!c&&u!=null){const R=setTimeout(u,p);return()=>{clearTimeout(R)}}},[u,c,p]),N.jsx("span",{className:b,style:C,children:N.jsx("span",{className:h})})}const m=$e("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Je=["center","classes","className"];let G=t=>t,pe,de,fe,he;const Z=550,Qe=80,Ze=ne(pe||(pe=G`
  0% {
    transform: scale(0);
    opacity: 0.1;
  }

  100% {
    transform: scale(1);
    opacity: 0.3;
  }
`)),et=ne(de||(de=G`
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
`)),tt=ne(fe||(fe=G`
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.92);
  }

  100% {
    transform: scale(1);
  }
`)),nt=te("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),ot=te(qe,{name:"MuiTouchRipple",slot:"Ripple"})(he||(he=G`
  opacity: 0;
  position: absolute;

  &.${0} {
    opacity: 0.3;
    transform: scale(1);
    animation-name: ${0};
    animation-duration: ${0}ms;
    animation-timing-function: ${0};
  }

  &.${0} {
    animation-duration: ${0}ms;
  }

  & .${0} {
    opacity: 1;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: currentColor;
  }

  & .${0} {
    opacity: 0;
    animation-name: ${0};
    animation-duration: ${0}ms;
    animation-timing-function: ${0};
  }

  & .${0} {
    position: absolute;
    /* @noflip */
    left: 0px;
    top: 0;
    animation-name: ${0};
    animation-duration: 2500ms;
    animation-timing-function: ${0};
    animation-iteration-count: infinite;
    animation-delay: 200ms;
  }
`),m.rippleVisible,Ze,Z,({theme:t})=>t.transitions.easing.easeInOut,m.ripplePulsate,({theme:t})=>t.transitions.duration.shorter,m.child,m.childLeaving,et,Z,({theme:t})=>t.transitions.easing.easeInOut,m.childPulsate,tt,({theme:t})=>t.transitions.easing.easeInOut),it=a.forwardRef(function(s,r){const l=me({props:s,name:"MuiTouchRipple"}),{center:n=!1,classes:e={},className:o}=l,c=ee(l,Je),[u,p]=a.useState([]),f=a.useRef(0),g=a.useRef(null);a.useEffect(()=>{g.current&&(g.current(),g.current=null)},[u]);const b=a.useRef(!1),C=ze(),h=a.useRef(null),R=a.useRef(null),_=a.useCallback(d=>{const{pulsate:M,rippleX:x,rippleY:S,rippleSize:I,cb:z}=d;p(y=>[...y,N.jsx(ot,{classes:{ripple:E(e.ripple,m.ripple),rippleVisible:E(e.rippleVisible,m.rippleVisible),ripplePulsate:E(e.ripplePulsate,m.ripplePulsate),child:E(e.child,m.child),childLeaving:E(e.childLeaving,m.childLeaving),childPulsate:E(e.childPulsate,m.childPulsate)},timeout:Z,pulsate:M,rippleX:x,rippleY:S,rippleSize:I},f.current)]),f.current+=1,g.current=z},[e]),j=a.useCallback((d={},M={},x=()=>{})=>{const{pulsate:S=!1,center:I=n||M.pulsate,fakeElement:z=!1}=M;if((d==null?void 0:d.type)==="mousedown"&&b.current){b.current=!1;return}(d==null?void 0:d.type)==="touchstart"&&(b.current=!0);const y=z?null:R.current,D=y?y.getBoundingClientRect():{width:0,height:0,left:0,top:0};let v,B,L;if(I||d===void 0||d.clientX===0&&d.clientY===0||!d.clientX&&!d.touches)v=Math.round(D.width/2),B=Math.round(D.height/2);else{const{clientX:k,clientY:V}=d.touches&&d.touches.length>0?d.touches[0]:d;v=Math.round(k-D.left),B=Math.round(V-D.top)}if(I)L=Math.sqrt((2*D.width**2+D.height**2)/3),L%2===0&&(L+=1);else{const k=Math.max(Math.abs((y?y.clientWidth:0)-v),v)*2+2,V=Math.max(Math.abs((y?y.clientHeight:0)-B),B)*2+2;L=Math.sqrt(k**2+V**2)}d!=null&&d.touches?h.current===null&&(h.current=()=>{_({pulsate:S,rippleX:v,rippleY:B,rippleSize:L,cb:x})},C.start(Qe,()=>{h.current&&(h.current(),h.current=null)})):_({pulsate:S,rippleX:v,rippleY:B,rippleSize:L,cb:x})},[n,_,C]),U=a.useCallback(()=>{j({},{pulsate:!0})},[j]),$=a.useCallback((d,M)=>{if(C.clear(),(d==null?void 0:d.type)==="touchend"&&h.current){h.current(),h.current=null,C.start(0,()=>{$(d,M)});return}h.current=null,p(x=>x.length>0?x.slice(1):x),g.current=M},[C]);return a.useImperativeHandle(r,()=>({pulsate:U,start:j,stop:$}),[U,j,$]),N.jsx(nt,A({className:E(m.root,e.root,o),ref:R},c,{children:N.jsx(ie,{component:null,exit:!0,children:u})}))}),st=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],rt=t=>{const{disabled:s,focusVisible:r,focusVisibleClassName:l,classes:n}=t,o=Ie({root:["root",s&&"disabled",r&&"focusVisible"]},_e,n);return r&&l&&(o.root+=` ${l}`),o},at=te("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(t,s)=>s.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Ue.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),bt=a.forwardRef(function(s,r){const l=me({props:s,name:"MuiButtonBase"}),{action:n,centerRipple:e=!1,children:o,className:c,component:u="button",disabled:p=!1,disableRipple:f=!1,disableTouchRipple:g=!1,focusRipple:b=!1,LinkComponent:C="a",onBlur:h,onClick:R,onContextMenu:_,onDragLeave:j,onFocus:U,onFocusVisible:$,onKeyDown:d,onKeyUp:M,onMouseDown:x,onMouseLeave:S,onMouseUp:I,onTouchEnd:z,onTouchMove:y,onTouchStart:D,tabIndex:v=0,TouchRippleProps:B,touchRippleRef:L,type:k}=l,V=ee(l,st),O=a.useRef(null),T=a.useRef(null),be=ue(T,L),{isFocusVisibleRef:se,onFocus:ge,onBlur:Re,ref:Me}=Oe(),[w,W]=a.useState(!1);p&&w&&W(!1),a.useImperativeHandle(n,()=>({focusVisible:()=>{W(!0),O.current.focus()}}),[]);const[q,xe]=a.useState(!1);a.useEffect(()=>{xe(!0)},[]);const ye=q&&!f&&!p;a.useEffect(()=>{w&&b&&!f&&q&&T.current.pulsate()},[f,b,w,q]);function P(i,ae,je=g){return H(le=>(ae&&ae(le),!je&&T.current&&T.current[i](le),!0))}const Te=P("start",x),Ee=P("stop",_),Ce=P("stop",j),ve=P("stop",I),Ve=P("stop",i=>{w&&i.preventDefault(),S&&S(i)}),Pe=P("start",D),De=P("stop",z),Be=P("stop",y),Le=P("stop",i=>{Re(i),se.current===!1&&W(!1),h&&h(i)},!1),Se=H(i=>{O.current||(O.current=i.currentTarget),ge(i),se.current===!0&&(W(!0),$&&$(i)),U&&U(i)}),J=()=>{const i=O.current;return u&&u!=="button"&&!(i.tagName==="A"&&i.href)},Q=a.useRef(!1),ke=H(i=>{b&&!Q.current&&w&&T.current&&i.key===" "&&(Q.current=!0,T.current.stop(i,()=>{T.current.start(i)})),i.target===i.currentTarget&&J()&&i.key===" "&&i.preventDefault(),d&&d(i),i.target===i.currentTarget&&J()&&i.key==="Enter"&&!p&&(i.preventDefault(),R&&R(i))}),we=H(i=>{b&&i.key===" "&&T.current&&w&&!i.defaultPrevented&&(Q.current=!1,T.current.stop(i,()=>{T.current.pulsate(i)})),M&&M(i),R&&i.target===i.currentTarget&&J()&&i.key===" "&&!i.defaultPrevented&&R(i)});let X=u;X==="button"&&(V.href||V.to)&&(X=C);const K={};X==="button"?(K.type=k===void 0?"button":k,K.disabled=p):(!V.href&&!V.to&&(K.role="button"),p&&(K["aria-disabled"]=p));const Fe=ue(r,Me,O),re=A({},l,{centerRipple:e,component:u,disabled:p,disableRipple:f,disableTouchRipple:g,focusRipple:b,tabIndex:v,focusVisible:w}),Ne=rt(re);return N.jsxs(at,A({as:X,className:E(Ne.root,c),ownerState:re,onBlur:Le,onClick:R,onContextMenu:Ee,onFocus:Se,onKeyDown:ke,onKeyUp:we,onMouseDown:Te,onMouseLeave:Ve,onMouseUp:ve,onDragLeave:Ce,onTouchEnd:De,onTouchMove:Be,onTouchStart:Pe,ref:Fe,tabIndex:p?-1:v,type:k},K,V,{children:[o,ye?N.jsx(it,A({ref:be,center:e},B)):null]}))});export{bt as B,ie as T};
