One Hat Cyber Team
Your IP :
216.73.216.84
Server IP :
50.6.229.107
Server :
Linux server.hostburly.com 5.14.0-611.38.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 10 17:21:28 EDT 2026 x86_64
Server Software :
Apache
PHP Version :
8.2.30
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
andjemzt
/
.trash
/
assets.1
/
Edit File:
index-xhJXOF-R.js
var zD=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var _ve=zD((Xo,Zo)=>{function ID(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const a=Object.getOwnPropertyDescriptor(s,o);a&&Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();var jc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ig(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C2={exports:{}},Zh={};var SE;function FD(){if(SE)return Zh;SE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,o,a){var l=null;if(a!==void 0&&(l=""+a),o.key!==void 0&&(l=""+o.key),"key"in o){a={};for(var u in o)u!=="key"&&(a[u]=o[u])}else a=o;return o=a.ref,{$$typeof:e,type:s,key:l,ref:o!==void 0?o:null,props:a}}return Zh.Fragment=t,Zh.jsx=n,Zh.jsxs=n,Zh}var jE;function _D(){return jE||(jE=1,C2.exports=FD()),C2.exports}var r=_D(),w2={exports:{}},hn={};var CE;function LD(){if(CE)return hn;CE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function b(V){return V===null||typeof V!="object"?null:(V=x&&V[x]||V["@@iterator"],typeof V=="function"?V:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,j={};function A(V,re,fe){this.props=V,this.context=re,this.refs=j,this.updater=fe||y}A.prototype.isReactComponent={},A.prototype.setState=function(V,re){if(typeof V!="object"&&typeof V!="function"&&V!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,V,re,"setState")},A.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function M(){}M.prototype=A.prototype;function R(V,re,fe){this.props=V,this.context=re,this.refs=j,this.updater=fe||y}var _=R.prototype=new M;_.constructor=R,S(_,A.prototype),_.isPureReactComponent=!0;var z=Array.isArray;function F(){}var N={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function B(V,re,fe){var ae=fe.ref;return{$$typeof:e,type:V,key:re,ref:ae!==void 0?ae:null,props:fe}}function H(V,re){return B(V.type,re,V.props)}function P(V){return typeof V=="object"&&V!==null&&V.$$typeof===e}function k(V){var re={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(fe){return re[fe]})}var L=/\/+/g;function O(V,re){return typeof V=="object"&&V!==null&&V.key!=null?k(""+V.key):re.toString(36)}function W(V){switch(V.status){case"fulfilled":return V.value;case"rejected":throw V.reason;default:switch(typeof V.status=="string"?V.then(F,F):(V.status="pending",V.then(function(re){V.status==="pending"&&(V.status="fulfilled",V.value=re)},function(re){V.status==="pending"&&(V.status="rejected",V.reason=re)})),V.status){case"fulfilled":return V.value;case"rejected":throw V.reason}}throw V}function D(V,re,fe,ae,ue){var se=typeof V;(se==="undefined"||se==="boolean")&&(V=null);var J=!1;if(V===null)J=!0;else switch(se){case"bigint":case"string":case"number":J=!0;break;case"object":switch(V.$$typeof){case e:case t:J=!0;break;case p:return J=V._init,D(J(V._payload),re,fe,ae,ue)}}if(J)return ue=ue(V),J=ae===""?"."+O(V,0):ae,z(ue)?(fe="",J!=null&&(fe=J.replace(L,"$&/")+"/"),D(ue,re,fe,"",function(ge){return ge})):ue!=null&&(P(ue)&&(ue=H(ue,fe+(ue.key==null||V&&V.key===ue.key?"":(""+ue.key).replace(L,"$&/")+"/")+J)),re.push(ue)),1;J=0;var ce=ae===""?".":ae+":";if(z(V))for(var oe=0;oe<V.length;oe++)ae=V[oe],se=ce+O(ae,oe),J+=D(ae,re,fe,se,ue);else if(oe=b(V),typeof oe=="function")for(V=oe.call(V),oe=0;!(ae=V.next()).done;)ae=ae.value,se=ce+O(ae,oe++),J+=D(ae,re,fe,se,ue);else if(se==="object"){if(typeof V.then=="function")return D(W(V),re,fe,ae,ue);throw re=String(V),Error("Objects are not valid as a React child (found: "+(re==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":re)+"). If you meant to render a collection of children, use an array instead.")}return J}function q(V,re,fe){if(V==null)return V;var ae=[],ue=0;return D(V,ae,"","",function(se){return re.call(fe,se,ue++)}),ae}function K(V){if(V._status===-1){var re=V._result;re=re(),re.then(function(fe){(V._status===0||V._status===-1)&&(V._status=1,V._result=fe)},function(fe){(V._status===0||V._status===-1)&&(V._status=2,V._result=fe)}),V._status===-1&&(V._status=0,V._result=re)}if(V._status===1)return V._result.default;throw V._result}var Y=typeof reportError=="function"?reportError:function(V){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var re=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof V=="object"&&V!==null&&typeof V.message=="string"?String(V.message):String(V),error:V});if(!window.dispatchEvent(re))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",V);return}console.error(V)},ie={map:q,forEach:function(V,re,fe){q(V,function(){re.apply(this,arguments)},fe)},count:function(V){var re=0;return q(V,function(){re++}),re},toArray:function(V){return q(V,function(re){return re})||[]},only:function(V){if(!P(V))throw Error("React.Children.only expected to receive a single React element child.");return V}};return hn.Activity=g,hn.Children=ie,hn.Component=A,hn.Fragment=n,hn.Profiler=o,hn.PureComponent=R,hn.StrictMode=s,hn.Suspense=d,hn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,hn.__COMPILER_RUNTIME={__proto__:null,c:function(V){return N.H.useMemoCache(V)}},hn.cache=function(V){return function(){return V.apply(null,arguments)}},hn.cacheSignal=function(){return null},hn.cloneElement=function(V,re,fe){if(V==null)throw Error("The argument must be a React element, but you passed "+V+".");var ae=S({},V.props),ue=V.key;if(re!=null)for(se in re.key!==void 0&&(ue=""+re.key),re)!I.call(re,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&re.ref===void 0||(ae[se]=re[se]);var se=arguments.length-2;if(se===1)ae.children=fe;else if(1<se){for(var J=Array(se),ce=0;ce<se;ce++)J[ce]=arguments[ce+2];ae.children=J}return B(V.type,ue,ae)},hn.createContext=function(V){return V={$$typeof:l,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null},V.Provider=V,V.Consumer={$$typeof:a,_context:V},V},hn.createElement=function(V,re,fe){var ae,ue={},se=null;if(re!=null)for(ae in re.key!==void 0&&(se=""+re.key),re)I.call(re,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ue[ae]=re[ae]);var J=arguments.length-2;if(J===1)ue.children=fe;else if(1<J){for(var ce=Array(J),oe=0;oe<J;oe++)ce[oe]=arguments[oe+2];ue.children=ce}if(V&&V.defaultProps)for(ae in J=V.defaultProps,J)ue[ae]===void 0&&(ue[ae]=J[ae]);return B(V,se,ue)},hn.createRef=function(){return{current:null}},hn.forwardRef=function(V){return{$$typeof:u,render:V}},hn.isValidElement=P,hn.lazy=function(V){return{$$typeof:p,_payload:{_status:-1,_result:V},_init:K}},hn.memo=function(V,re){return{$$typeof:f,type:V,compare:re===void 0?null:re}},hn.startTransition=function(V){var re=N.T,fe={};N.T=fe;try{var ae=V(),ue=N.S;ue!==null&&ue(fe,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(F,Y)}catch(se){Y(se)}finally{re!==null&&fe.types!==null&&(re.types=fe.types),N.T=re}},hn.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},hn.use=function(V){return N.H.use(V)},hn.useActionState=function(V,re,fe){return N.H.useActionState(V,re,fe)},hn.useCallback=function(V,re){return N.H.useCallback(V,re)},hn.useContext=function(V){return N.H.useContext(V)},hn.useDebugValue=function(){},hn.useDeferredValue=function(V,re){return N.H.useDeferredValue(V,re)},hn.useEffect=function(V,re){return N.H.useEffect(V,re)},hn.useEffectEvent=function(V){return N.H.useEffectEvent(V)},hn.useId=function(){return N.H.useId()},hn.useImperativeHandle=function(V,re,fe){return N.H.useImperativeHandle(V,re,fe)},hn.useInsertionEffect=function(V,re){return N.H.useInsertionEffect(V,re)},hn.useLayoutEffect=function(V,re){return N.H.useLayoutEffect(V,re)},hn.useMemo=function(V,re){return N.H.useMemo(V,re)},hn.useOptimistic=function(V,re){return N.H.useOptimistic(V,re)},hn.useReducer=function(V,re,fe){return N.H.useReducer(V,re,fe)},hn.useRef=function(V){return N.H.useRef(V)},hn.useState=function(V){return N.H.useState(V)},hn.useSyncExternalStore=function(V,re,fe){return N.H.useSyncExternalStore(V,re,fe)},hn.useTransition=function(){return N.H.useTransition()},hn.version="19.2.5",hn}var wE;function Fg(){return wE||(wE=1,w2.exports=LD()),w2.exports}var v=Fg();const Er=Ig(v),Qp=ID({__proto__:null,default:Er},[v]);var A2={exports:{}},Qh={},E2={exports:{}},T2={};var AE;function PD(){return AE||(AE=1,(function(e){function t(D,q){var K=D.length;D.push(q);e:for(;0<K;){var Y=K-1>>>1,ie=D[Y];if(0<o(ie,q))D[Y]=q,D[K]=ie,K=Y;else break e}}function n(D){return D.length===0?null:D[0]}function s(D){if(D.length===0)return null;var q=D[0],K=D.pop();if(K!==q){D[0]=K;e:for(var Y=0,ie=D.length,V=ie>>>1;Y<V;){var re=2*(Y+1)-1,fe=D[re],ae=re+1,ue=D[ae];if(0>o(fe,K))ae<ie&&0>o(ue,fe)?(D[Y]=ue,D[ae]=K,Y=ae):(D[Y]=fe,D[re]=K,Y=re);else if(ae<ie&&0>o(ue,K))D[Y]=ue,D[ae]=K,Y=ae;else break e}}return q}function o(D,q){var K=D.sortIndex-q.sortIndex;return K!==0?K:D.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],f=[],p=1,g=null,x=3,b=!1,y=!1,S=!1,j=!1,A=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function _(D){for(var q=n(f);q!==null;){if(q.callback===null)s(f);else if(q.startTime<=D)s(f),q.sortIndex=q.expirationTime,t(d,q);else break;q=n(f)}}function z(D){if(S=!1,_(D),!y)if(n(d)!==null)y=!0,F||(F=!0,k());else{var q=n(f);q!==null&&W(z,q.startTime-D)}}var F=!1,N=-1,I=5,B=-1;function H(){return j?!0:!(e.unstable_now()-B<I)}function P(){if(j=!1,F){var D=e.unstable_now();B=D;var q=!0;try{e:{y=!1,S&&(S=!1,M(N),N=-1),b=!0;var K=x;try{t:{for(_(D),g=n(d);g!==null&&!(g.expirationTime>D&&H());){var Y=g.callback;if(typeof Y=="function"){g.callback=null,x=g.priorityLevel;var ie=Y(g.expirationTime<=D);if(D=e.unstable_now(),typeof ie=="function"){g.callback=ie,_(D),q=!0;break t}g===n(d)&&s(d),_(D)}else s(d);g=n(d)}if(g!==null)q=!0;else{var V=n(f);V!==null&&W(z,V.startTime-D),q=!1}}break e}finally{g=null,x=K,b=!1}q=void 0}}finally{q?k():F=!1}}}var k;if(typeof R=="function")k=function(){R(P)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,O=L.port2;L.port1.onmessage=P,k=function(){O.postMessage(null)}}else k=function(){A(P,0)};function W(D,q){N=A(function(){D(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(D){switch(x){case 1:case 2:case 3:var q=3;break;default:q=x}var K=x;x=q;try{return D()}finally{x=K}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(D,q){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var K=x;x=D;try{return q()}finally{x=K}},e.unstable_scheduleCallback=function(D,q,K){var Y=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?Y+K:Y):K=Y,D){case 1:var ie=-1;break;case 2:ie=250;break;case 5:ie=1073741823;break;case 4:ie=1e4;break;default:ie=5e3}return ie=K+ie,D={id:p++,callback:q,priorityLevel:D,startTime:K,expirationTime:ie,sortIndex:-1},K>Y?(D.sortIndex=K,t(f,D),n(d)===null&&D===n(f)&&(S?(M(N),N=-1):S=!0,W(z,K-Y))):(D.sortIndex=ie,t(d,D),y||b||(y=!0,F||(F=!0,k()))),D},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(D){var q=x;return function(){var K=x;x=q;try{return D.apply(this,arguments)}finally{x=K}}}})(T2)),T2}var EE;function DD(){return EE||(EE=1,E2.exports=PD()),E2.exports}var k2={exports:{}},Os={};var TE;function OD(){if(TE)return Os;TE=1;var e=Fg();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function a(d,f,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:d,containerInfo:f,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Os.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Os.createPortal=function(d,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return a(d,f,null,p)},Os.flushSync=function(d){var f=l.T,p=s.p;try{if(l.T=null,s.p=2,d)return d()}finally{l.T=f,s.p=p,s.d.f()}},Os.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,s.d.C(d,f))},Os.prefetchDNS=function(d){typeof d=="string"&&s.d.D(d)},Os.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,g=u(p,f.crossOrigin),x=typeof f.integrity=="string"?f.integrity:void 0,b=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?s.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:b}):p==="script"&&s.d.X(d,{crossOrigin:g,integrity:x,fetchPriority:b,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Os.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=u(f.as,f.crossOrigin);s.d.M(d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&s.d.M(d)},Os.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,g=u(p,f.crossOrigin);s.d.L(d,p,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Os.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=u(f.as,f.crossOrigin);s.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else s.d.m(d)},Os.requestFormReset=function(d){s.d.r(d)},Os.unstable_batchedUpdates=function(d,f){return d(f)},Os.useFormState=function(d,f,p){return l.H.useFormState(d,f,p)},Os.useFormStatus=function(){return l.H.useHostTransitionStatus()},Os.version="19.2.5",Os}var kE;function qM(){if(kE)return k2.exports;kE=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),k2.exports=OD(),k2.exports}var ME;function BD(){if(ME)return Qh;ME=1;var e=DD(),t=Fg(),n=qM();function s(i){var c="https://react.dev/errors/"+i;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+i+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function a(i){var c=i,h=i;if(i.alternate)for(;c.return;)c=c.return;else{i=c;do c=i,(c.flags&4098)!==0&&(h=c.return),i=c.return;while(i)}return c.tag===3?h:null}function l(i){if(i.tag===13){var c=i.memoizedState;if(c===null&&(i=i.alternate,i!==null&&(c=i.memoizedState)),c!==null)return c.dehydrated}return null}function u(i){if(i.tag===31){var c=i.memoizedState;if(c===null&&(i=i.alternate,i!==null&&(c=i.memoizedState)),c!==null)return c.dehydrated}return null}function d(i){if(a(i)!==i)throw Error(s(188))}function f(i){var c=i.alternate;if(!c){if(c=a(i),c===null)throw Error(s(188));return c!==i?null:i}for(var h=i,m=c;;){var w=h.return;if(w===null)break;var T=w.alternate;if(T===null){if(m=w.return,m!==null){h=m;continue}break}if(w.child===T.child){for(T=w.child;T;){if(T===h)return d(w),i;if(T===m)return d(w),c;T=T.sibling}throw Error(s(188))}if(h.return!==m.return)h=w,m=T;else{for(var U=!1,te=w.child;te;){if(te===h){U=!0,h=w,m=T;break}if(te===m){U=!0,m=w,h=T;break}te=te.sibling}if(!U){for(te=T.child;te;){if(te===h){U=!0,h=T,m=w;break}if(te===m){U=!0,m=T,h=w;break}te=te.sibling}if(!U)throw Error(s(189))}}if(h.alternate!==m)throw Error(s(190))}if(h.tag!==3)throw Error(s(188));return h.stateNode.current===h?i:c}function p(i){var c=i.tag;if(c===5||c===26||c===27||c===6)return i;for(i=i.child;i!==null;){if(c=p(i),c!==null)return c;i=i.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),R=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function k(i){return i===null||typeof i!="object"?null:(i=P&&i[P]||i["@@iterator"],typeof i=="function"?i:null)}var L=Symbol.for("react.client.reference");function O(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===L?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case S:return"Fragment";case A:return"Profiler";case j:return"StrictMode";case z:return"Suspense";case F:return"SuspenseList";case B:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case y:return"Portal";case R:return i.displayName||"Context";case M:return(i._context.displayName||"Context")+".Consumer";case _:var c=i.render;return i=i.displayName,i||(i=c.displayName||c.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case N:return c=i.displayName||null,c!==null?c:O(i.type)||"Memo";case I:c=i._payload,i=i._init;try{return O(i(c))}catch{}}return null}var W=Array.isArray,D=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},Y=[],ie=-1;function V(i){return{current:i}}function re(i){0>ie||(i.current=Y[ie],Y[ie]=null,ie--)}function fe(i,c){ie++,Y[ie]=i.current,i.current=c}var ae=V(null),ue=V(null),se=V(null),J=V(null);function ce(i,c){switch(fe(se,c),fe(ue,i),fe(ae,null),c.nodeType){case 9:case 11:i=(i=c.documentElement)&&(i=i.namespaceURI)?UA(i):0;break;default:if(i=c.tagName,c=c.namespaceURI)c=UA(c),i=qA(c,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}re(ae),fe(ae,i)}function oe(){re(ae),re(ue),re(se)}function ge(i){i.memoizedState!==null&&fe(J,i);var c=ae.current,h=qA(c,i.type);c!==h&&(fe(ue,i),fe(ae,h))}function de(i){ue.current===i&&(re(ae),re(ue)),J.current===i&&(re(J),Gh._currentValue=K)}var le,ee;function X(i){if(le===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);le=c&&c[1]||"",ee=-1<h.stack.indexOf(` at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return` `+le+i+ee}var ve=!1;function st(i,c){if(!i||ve)return"";ve=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(c){var rt=function(){throw Error()};if(Object.defineProperty(rt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(rt,[])}catch(Ue){var Ne=Ue}Reflect.construct(i,[],rt)}else{try{rt.call()}catch(Ue){Ne=Ue}i.call(rt.prototype)}}else{try{throw Error()}catch(Ue){Ne=Ue}(rt=i())&&typeof rt.catch=="function"&&rt.catch(function(){})}}catch(Ue){if(Ue&&Ne&&typeof Ue.stack=="string")return[Ue.stack,Ne.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var w=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");w&&w.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var T=m.DetermineComponentFrameRoot(),U=T[0],te=T[1];if(U&&te){var xe=U.split(` `),De=te.split(` `);for(w=m=0;m<xe.length&&!xe[m].includes("DetermineComponentFrameRoot");)m++;for(;w<De.length&&!De[w].includes("DetermineComponentFrameRoot");)w++;if(m===xe.length||w===De.length)for(m=xe.length-1,w=De.length-1;1<=m&&0<=w&&xe[m]!==De[w];)w--;for(;1<=m&&0<=w;m--,w--)if(xe[m]!==De[w]){if(m!==1||w!==1)do if(m--,w--,0>w||xe[m]!==De[w]){var Ze=` `+xe[m].replace(" at new "," at ");return i.displayName&&Ze.includes("<anonymous>")&&(Ze=Ze.replace("<anonymous>",i.displayName)),Ze}while(1<=m&&0<=w);break}}}finally{ve=!1,Error.prepareStackTrace=h}return(h=i?i.displayName||i.name:"")?X(h):""}function Ge(i,c){switch(i.tag){case 26:case 27:case 5:return X(i.type);case 16:return X("Lazy");case 13:return i.child!==c&&c!==null?X("Suspense Fallback"):X("Suspense");case 19:return X("SuspenseList");case 0:case 15:return st(i.type,!1);case 11:return st(i.type.render,!1);case 1:return st(i.type,!0);case 31:return X("Activity");default:return""}}function qe(i){try{var c="",h=null;do c+=Ge(i,h),h=i,i=i.return;while(i);return c}catch(m){return` Error generating stack: `+m.message+` `+m.stack}}var Be=Object.prototype.hasOwnProperty,Te=e.unstable_scheduleCallback,Re=e.unstable_cancelCallback,Se=e.unstable_shouldYield,Ke=e.unstable_requestPaint,ot=e.unstable_now,He=e.unstable_getCurrentPriorityLevel,$e=e.unstable_ImmediatePriority,Z=e.unstable_UserBlockingPriority,pe=e.unstable_NormalPriority,Q=e.unstable_LowPriority,me=e.unstable_IdlePriority,we=e.log,et=e.unstable_setDisableYieldValue,ht=null,ct=null;function bt(i){if(typeof we=="function"&&et(i),ct&&typeof ct.setStrictMode=="function")try{ct.setStrictMode(ht,i)}catch{}}var wt=Math.clz32?Math.clz32:ut,gn=Math.log,mn=Math.LN2;function ut(i){return i>>>=0,i===0?32:31-(gn(i)/mn|0)|0}var _t=256,Yt=262144,Xt=4194304;function ln(i){var c=i&42;if(c!==0)return c;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function pr(i,c,h){var m=i.pendingLanes;if(m===0)return 0;var w=0,T=i.suspendedLanes,U=i.pingedLanes;i=i.warmLanes;var te=m&134217727;return te!==0?(m=te&~T,m!==0?w=ln(m):(U&=te,U!==0?w=ln(U):h||(h=te&~i,h!==0&&(w=ln(h))))):(te=m&~T,te!==0?w=ln(te):U!==0?w=ln(U):h||(h=m&~i,h!==0&&(w=ln(h)))),w===0?0:c!==0&&c!==w&&(c&T)===0&&(T=w&-w,h=c&-c,T>=h||T===32&&(h&4194048)!==0)?c:w}function nr(i,c){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&c)===0}function Bn(i,c){switch(i){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ht(){var i=Xt;return Xt<<=1,(Xt&62914560)===0&&(Xt=4194304),i}function rn(i){for(var c=[],h=0;31>h;h++)c.push(i);return c}function yt(i,c){i.pendingLanes|=c,c!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Ft(i,c,h,m,w,T){var U=i.pendingLanes;i.pendingLanes=h,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=h,i.entangledLanes&=h,i.errorRecoveryDisabledLanes&=h,i.shellSuspendCounter=0;var te=i.entanglements,xe=i.expirationTimes,De=i.hiddenUpdates;for(h=U&~h;0<h;){var Ze=31-wt(h),rt=1<<Ze;te[Ze]=0,xe[Ze]=-1;var Ne=De[Ze];if(Ne!==null)for(De[Ze]=null,Ze=0;Ze<Ne.length;Ze++){var Ue=Ne[Ze];Ue!==null&&(Ue.lane&=-536870913)}h&=~rt}m!==0&&un(i,m,0),T!==0&&w===0&&i.tag!==0&&(i.suspendedLanes|=T&~(U&~c))}function un(i,c,h){i.pendingLanes|=c,i.suspendedLanes&=~c;var m=31-wt(c);i.entangledLanes|=c,i.entanglements[m]=i.entanglements[m]|1073741824|h&261930}function an(i,c){var h=i.entangledLanes|=c;for(i=i.entanglements;h;){var m=31-wt(h),w=1<<m;w&c|i[m]&c&&(i[m]|=c),h&=~w}}function he(i,c){var h=c&-c;return h=(h&42)!==0?1:Ee(h),(h&(i.suspendedLanes|c))!==0?0:h}function Ee(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Fe(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Xe(){var i=q.p;return i!==0?i:(i=window.event,i===void 0?32:pE(i.type))}function dt(i,c){var h=q.p;try{return q.p=i,c()}finally{q.p=h}}var At=Math.random().toString(36).slice(2),at="__reactFiber$"+At,lt="__reactProps$"+At,kt="__reactContainer$"+At,vt="__reactEvents$"+At,Nt="__reactListeners$"+At,Dt="__reactHandles$"+At,vn="__reactResources$"+At,cn="__reactMarker$"+At;function An(i){delete i[at],delete i[lt],delete i[vt],delete i[Nt],delete i[Dt]}function dn(i){var c=i[at];if(c)return c;for(var h=i.parentNode;h;){if(c=h[kt]||h[at]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(i=QA(i);i!==null;){if(h=i[at])return h;i=QA(i)}return c}i=h,h=i.parentNode}return null}function Oe(i){if(i=i[at]||i[kt]){var c=i.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return i}return null}function _e(i){var c=i.tag;if(c===5||c===26||c===27||c===6)return i.stateNode;throw Error(s(33))}function ft(i){var c=i[vn];return c||(c=i[vn]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function Lt(i){i[cn]=!0}var Qt=new Set,sn={};function on(i,c){ir(i,c),ir(i+"Capture",c)}function ir(i,c){for(sn[i]=c,i=0;i<c.length;i++)Qt.add(c[i])}var $r=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ts={},zo={};function Io(i){return Be.call(zo,i)?!0:Be.call(Ts,i)?!1:$r.test(i)?zo[i]=!0:(Ts[i]=!0,!1)}function zt(i,c,h){if(Io(c))if(h===null)i.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":i.removeAttribute(c);return;case"boolean":var m=c.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){i.removeAttribute(c);return}}i.setAttribute(c,""+h)}}function Nn(i,c,h){if(h===null)i.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(c);return}i.setAttribute(c,""+h)}}function ar(i,c,h,m){if(m===null)i.removeAttribute(h);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(h);return}i.setAttributeNS(c,h,""+m)}}function Hn(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Xn(i){var c=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function ao(i,c,h){var m=Object.getOwnPropertyDescriptor(i.constructor.prototype,c);if(!i.hasOwnProperty(c)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var w=m.get,T=m.set;return Object.defineProperty(i,c,{configurable:!0,get:function(){return w.call(this)},set:function(U){h=""+U,T.call(this,U)}}),Object.defineProperty(i,c,{enumerable:m.enumerable}),{getValue:function(){return h},setValue:function(U){h=""+U},stopTracking:function(){i._valueTracker=null,delete i[c]}}}}function Vi(i){if(!i._valueTracker){var c=Xn(i)?"checked":"value";i._valueTracker=ao(i,c,""+i[c])}}function Xa(i){if(!i)return!1;var c=i._valueTracker;if(!c)return!0;var h=c.getValue(),m="";return i&&(m=Xn(i)?i.checked?"true":"false":i.value),i=m,i!==h?(c.setValue(i),!0):!1}function Bl(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var dh=/[\n"\\]/g;function Ls(i){return i.replace(dh,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Kc(i,c,h,m,w,T,U,te){i.name="",U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?i.type=U:i.removeAttribute("type"),c!=null?U==="number"?(c===0&&i.value===""||i.value!=c)&&(i.value=""+Hn(c)):i.value!==""+Hn(c)&&(i.value=""+Hn(c)):U!=="submit"&&U!=="reset"||i.removeAttribute("value"),c!=null?Xc(i,U,Hn(c)):h!=null?Xc(i,U,Hn(h)):m!=null&&i.removeAttribute("value"),w==null&&T!=null&&(i.defaultChecked=!!T),w!=null&&(i.checked=w&&typeof w!="function"&&typeof w!="symbol"),te!=null&&typeof te!="function"&&typeof te!="symbol"&&typeof te!="boolean"?i.name=""+Hn(te):i.removeAttribute("name")}function Nl(i,c,h,m,w,T,U,te){if(T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(i.type=T),c!=null||h!=null){if(!(T!=="submit"&&T!=="reset"||c!=null)){Vi(i);return}h=h!=null?""+Hn(h):"",c=c!=null?""+Hn(c):h,te||c===i.value||(i.value=c),i.defaultValue=c}m=m??w,m=typeof m!="function"&&typeof m!="symbol"&&!!m,i.checked=te?i.checked:!!m,i.defaultChecked=!!m,U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"&&(i.name=U),Vi(i)}function Xc(i,c,h){c==="number"&&Bl(i.ownerDocument)===i||i.defaultValue===""+h||(i.defaultValue=""+h)}function ba(i,c,h,m){if(i=i.options,c){c={};for(var w=0;w<h.length;w++)c["$"+h[w]]=!0;for(h=0;h<i.length;h++)w=c.hasOwnProperty("$"+i[h].value),i[h].selected!==w&&(i[h].selected=w),w&&m&&(i[h].defaultSelected=!0)}else{for(h=""+Hn(h),c=null,w=0;w<i.length;w++){if(i[w].value===h){i[w].selected=!0,m&&(i[w].defaultSelected=!0);return}c!==null||i[w].disabled||(c=i[w])}c!==null&&(c.selected=!0)}}function ya(i,c,h){if(c!=null&&(c=""+Hn(c),c!==i.value&&(i.value=c),h==null)){i.defaultValue!==c&&(i.defaultValue=c);return}i.defaultValue=h!=null?""+Hn(h):""}function lo(i,c,h,m){if(c==null){if(m!=null){if(h!=null)throw Error(s(92));if(W(m)){if(1<m.length)throw Error(s(93));m=m[0]}h=m}h==null&&(h=""),c=h}h=Hn(c),i.defaultValue=h,m=i.textContent,m===h&&m!==""&&m!==null&&(i.value=m),Vi(i)}function Ps(i,c){if(c){var h=i.firstChild;if(h&&h===i.lastChild&&h.nodeType===3){h.nodeValue=c;return}}i.textContent=c}var Gi=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ld(i,c,h){var m=c.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?m?i.setProperty(c,""):c==="float"?i.cssFloat="":i[c]="":m?i.setProperty(c,h):typeof h!="number"||h===0||Gi.has(c)?c==="float"?i.cssFloat=h:i[c]=(""+h).trim():i[c]=h+"px"}function Fo(i,c,h){if(c!=null&&typeof c!="object")throw Error(s(62));if(i=i.style,h!=null){for(var m in h)!h.hasOwnProperty(m)||c!=null&&c.hasOwnProperty(m)||(m.indexOf("--")===0?i.setProperty(m,""):m==="float"?i.cssFloat="":i[m]="");for(var w in c)m=c[w],c.hasOwnProperty(w)&&h[w]!==m&&ld(i,w,m)}else for(var T in c)c.hasOwnProperty(T)&&ld(i,T,c[T])}function Zc(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var fh=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),hh=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function $l(i){return hh.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function co(){}var ms=null;function Hl(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Yi=null,_o=null;function Wl(i){var c=Oe(i);if(c&&(i=c.stateNode)){var h=i[lt]||null;e:switch(i=c.stateNode,c.type){case"input":if(Kc(i,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),c=h.name,h.type==="radio"&&c!=null){for(h=i;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+Ls(""+c)+'"][type="radio"]'),c=0;c<h.length;c++){var m=h[c];if(m!==i&&m.form===i.form){var w=m[lt]||null;if(!w)throw Error(s(90));Kc(m,w.value,w.defaultValue,w.defaultValue,w.checked,w.defaultChecked,w.type,w.name)}}for(c=0;c<h.length;c++)m=h[c],m.form===i.form&&Xa(m)}break e;case"textarea":ya(i,h.value,h.defaultValue);break e;case"select":c=h.value,c!=null&&ba(i,!!h.multiple,c,!1)}}}var va=!1;function cd(i,c,h){if(va)return i(c,h);va=!0;try{var m=i(c);return m}finally{if(va=!1,(Yi!==null||_o!==null)&&(hx(),Yi&&(c=Yi,i=_o,_o=Yi=null,Wl(c),i)))for(c=0;c<i.length;c++)Wl(i[c])}}function Sa(i,c){var h=i.stateNode;if(h===null)return null;var m=h[lt]||null;if(m===null)return null;h=m[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(i=i.type,m=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!m;break e;default:i=!1}if(i)return null;if(h&&typeof h!="function")throw Error(s(231,c,typeof h));return h}var Vs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ul=!1;if(Vs)try{var Ds={};Object.defineProperty(Ds,"passive",{get:function(){Ul=!0}}),window.addEventListener("test",Ds,Ds),window.removeEventListener("test",Ds,Ds)}catch{Ul=!1}var Lo=null,Za=null,ql=null;function ud(){if(ql)return ql;var i,c=Za,h=c.length,m,w="value"in Lo?Lo.value:Lo.textContent,T=w.length;for(i=0;i<h&&c[i]===w[i];i++);var U=h-i;for(m=1;m<=U&&c[h-m]===w[T-m];m++);return ql=w.slice(i,1<m?1-m:void 0)}function $(i){var c=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&c===13&&(i=13)):i=c,i===10&&(i=13),32<=i||i===13?i:0}function ne(){return!0}function be(){return!1}function We(i){function c(h,m,w,T,U){this._reactName=h,this._targetInst=w,this.type=m,this.nativeEvent=T,this.target=U,this.currentTarget=null;for(var te in i)i.hasOwnProperty(te)&&(h=i[te],this[te]=h?h(T):T[te]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?ne:be,this.isPropagationStopped=be,this}return g(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=ne)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=ne)},persist:function(){},isPersistent:ne}),c}var Jt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ut=We(Jt),wn=g({},Jt,{view:0,detail:0}),Ln=We(wn),_r,$n,qr,xs=g({},wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ky,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==qr&&(qr&&i.type==="mousemove"?(_r=i.screenX-qr.screenX,$n=i.screenY-qr.screenY):$n=_r=0,qr=i),_r)},movementY:function(i){return"movementY"in i?i.movementY:$n}}),Vr=We(xs),Cs=g({},xs,{dataTransfer:0}),bs=We(Cs),ja=g({},wn,{relatedTarget:0}),Po=We(ja),Qa=g({},Jt,{animationName:0,elapsedTime:0,pseudoElement:0}),zm=We(Qa),dd=g({},Jt,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),fd=We(dd),DL=g({},Jt,{data:0}),Yw=We(DL),OL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},BL={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},NL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $L(i){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(i):(i=NL[i])?!!c[i]:!1}function ky(){return $L}var HL=g({},wn,{key:function(i){if(i.key){var c=OL[i.key]||i.key;if(c!=="Unidentified")return c}return i.type==="keypress"?(i=$(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?BL[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ky,charCode:function(i){return i.type==="keypress"?$(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?$(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),WL=We(HL),UL=g({},xs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Kw=We(UL),qL=g({},wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ky}),VL=We(qL),GL=g({},Jt,{propertyName:0,elapsedTime:0,pseudoElement:0}),YL=We(GL),KL=g({},xs,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),XL=We(KL),ZL=g({},Jt,{newState:0,oldState:0}),QL=We(ZL),JL=[9,13,27,32],My=Vs&&"CompositionEvent"in window,ph=null;Vs&&"documentMode"in document&&(ph=document.documentMode);var eP=Vs&&"TextEvent"in window&&!ph,Xw=Vs&&(!My||ph&&8<ph&&11>=ph),Zw=" ",Qw=!1;function Jw(i,c){switch(i){case"keyup":return JL.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function e4(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var hd=!1;function tP(i,c){switch(i){case"compositionend":return e4(c);case"keypress":return c.which!==32?null:(Qw=!0,Zw);case"textInput":return i=c.data,i===Zw&&Qw?null:i;default:return null}}function nP(i,c){if(hd)return i==="compositionend"||!My&&Jw(i,c)?(i=ud(),ql=Za=Lo=null,hd=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return Xw&&c.locale!=="ko"?null:c.data;default:return null}}var rP={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function t4(i){var c=i&&i.nodeName&&i.nodeName.toLowerCase();return c==="input"?!!rP[i.type]:c==="textarea"}function n4(i,c,h,m){Yi?_o?_o.push(m):_o=[m]:Yi=m,c=vx(c,"onChange"),0<c.length&&(h=new Ut("onChange","change",null,h,m),i.push({event:h,listeners:c}))}var gh=null,mh=null;function sP(i){OA(i,0)}function Im(i){var c=_e(i);if(Xa(c))return i}function r4(i,c){if(i==="change")return c}var s4=!1;if(Vs){var Ry;if(Vs){var zy="oninput"in document;if(!zy){var o4=document.createElement("div");o4.setAttribute("oninput","return;"),zy=typeof o4.oninput=="function"}Ry=zy}else Ry=!1;s4=Ry&&(!document.documentMode||9<document.documentMode)}function i4(){gh&&(gh.detachEvent("onpropertychange",a4),mh=gh=null)}function a4(i){if(i.propertyName==="value"&&Im(mh)){var c=[];n4(c,mh,i,Hl(i)),cd(sP,c)}}function oP(i,c,h){i==="focusin"?(i4(),gh=c,mh=h,gh.attachEvent("onpropertychange",a4)):i==="focusout"&&i4()}function iP(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Im(mh)}function aP(i,c){if(i==="click")return Im(c)}function lP(i,c){if(i==="input"||i==="change")return Im(c)}function cP(i,c){return i===c&&(i!==0||1/i===1/c)||i!==i&&c!==c}var Do=typeof Object.is=="function"?Object.is:cP;function xh(i,c){if(Do(i,c))return!0;if(typeof i!="object"||i===null||typeof c!="object"||c===null)return!1;var h=Object.keys(i),m=Object.keys(c);if(h.length!==m.length)return!1;for(m=0;m<h.length;m++){var w=h[m];if(!Be.call(c,w)||!Do(i[w],c[w]))return!1}return!0}function l4(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function c4(i,c){var h=l4(i);i=0;for(var m;h;){if(h.nodeType===3){if(m=i+h.textContent.length,i<=c&&m>=c)return{node:h,offset:c-i};i=m}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=l4(h)}}function u4(i,c){return i&&c?i===c?!0:i&&i.nodeType===3?!1:c&&c.nodeType===3?u4(i,c.parentNode):"contains"in i?i.contains(c):i.compareDocumentPosition?!!(i.compareDocumentPosition(c)&16):!1:!1}function d4(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var c=Bl(i.document);c instanceof i.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)i=c.contentWindow;else break;c=Bl(i.document)}return c}function Iy(i){var c=i&&i.nodeName&&i.nodeName.toLowerCase();return c&&(c==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||c==="textarea"||i.contentEditable==="true")}var uP=Vs&&"documentMode"in document&&11>=document.documentMode,pd=null,Fy=null,bh=null,_y=!1;function f4(i,c,h){var m=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;_y||pd==null||pd!==Bl(m)||(m=pd,"selectionStart"in m&&Iy(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),bh&&xh(bh,m)||(bh=m,m=vx(Fy,"onSelect"),0<m.length&&(c=new Ut("onSelect","select",null,c,h),i.push({event:c,listeners:m}),c.target=pd)))}function Qc(i,c){var h={};return h[i.toLowerCase()]=c.toLowerCase(),h["Webkit"+i]="webkit"+c,h["Moz"+i]="moz"+c,h}var gd={animationend:Qc("Animation","AnimationEnd"),animationiteration:Qc("Animation","AnimationIteration"),animationstart:Qc("Animation","AnimationStart"),transitionrun:Qc("Transition","TransitionRun"),transitionstart:Qc("Transition","TransitionStart"),transitioncancel:Qc("Transition","TransitionCancel"),transitionend:Qc("Transition","TransitionEnd")},Ly={},h4={};Vs&&(h4=document.createElement("div").style,"AnimationEvent"in window||(delete gd.animationend.animation,delete gd.animationiteration.animation,delete gd.animationstart.animation),"TransitionEvent"in window||delete gd.transitionend.transition);function Jc(i){if(Ly[i])return Ly[i];if(!gd[i])return i;var c=gd[i],h;for(h in c)if(c.hasOwnProperty(h)&&h in h4)return Ly[i]=c[h];return i}var p4=Jc("animationend"),g4=Jc("animationiteration"),m4=Jc("animationstart"),dP=Jc("transitionrun"),fP=Jc("transitionstart"),hP=Jc("transitioncancel"),x4=Jc("transitionend"),b4=new Map,Py="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Py.push("scrollEnd");function Ki(i,c){b4.set(i,c),on(c,[i])}var Fm=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},si=[],md=0,Dy=0;function _m(){for(var i=md,c=Dy=md=0;c<i;){var h=si[c];si[c++]=null;var m=si[c];si[c++]=null;var w=si[c];si[c++]=null;var T=si[c];if(si[c++]=null,m!==null&&w!==null){var U=m.pending;U===null?w.next=w:(w.next=U.next,U.next=w),m.pending=w}T!==0&&y4(h,w,T)}}function Lm(i,c,h,m){si[md++]=i,si[md++]=c,si[md++]=h,si[md++]=m,Dy|=m,i.lanes|=m,i=i.alternate,i!==null&&(i.lanes|=m)}function Oy(i,c,h,m){return Lm(i,c,h,m),Pm(i)}function eu(i,c){return Lm(i,null,null,c),Pm(i)}function y4(i,c,h){i.lanes|=h;var m=i.alternate;m!==null&&(m.lanes|=h);for(var w=!1,T=i.return;T!==null;)T.childLanes|=h,m=T.alternate,m!==null&&(m.childLanes|=h),T.tag===22&&(i=T.stateNode,i===null||i._visibility&1||(w=!0)),i=T,T=T.return;return i.tag===3?(T=i.stateNode,w&&c!==null&&(w=31-wt(h),i=T.hiddenUpdates,m=i[w],m===null?i[w]=[c]:m.push(c),c.lane=h|536870912),T):null}function Pm(i){if(50<Nh)throw Nh=0,Gv=null,Error(s(185));for(var c=i.return;c!==null;)i=c,c=i.return;return i.tag===3?i.stateNode:null}var xd={};function pP(i,c,h,m){this.tag=i,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Oo(i,c,h,m){return new pP(i,c,h,m)}function By(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Ja(i,c){var h=i.alternate;return h===null?(h=Oo(i.tag,c,i.key,i.mode),h.elementType=i.elementType,h.type=i.type,h.stateNode=i.stateNode,h.alternate=i,i.alternate=h):(h.pendingProps=c,h.type=i.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=i.flags&65011712,h.childLanes=i.childLanes,h.lanes=i.lanes,h.child=i.child,h.memoizedProps=i.memoizedProps,h.memoizedState=i.memoizedState,h.updateQueue=i.updateQueue,c=i.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=i.sibling,h.index=i.index,h.ref=i.ref,h.refCleanup=i.refCleanup,h}function v4(i,c){i.flags&=65011714;var h=i.alternate;return h===null?(i.childLanes=0,i.lanes=c,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=h.childLanes,i.lanes=h.lanes,i.child=h.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=h.memoizedProps,i.memoizedState=h.memoizedState,i.updateQueue=h.updateQueue,i.type=h.type,c=h.dependencies,i.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),i}function Dm(i,c,h,m,w,T){var U=0;if(m=i,typeof i=="function")By(i)&&(U=1);else if(typeof i=="string")U=yD(i,h,ae.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case B:return i=Oo(31,h,c,w),i.elementType=B,i.lanes=T,i;case S:return tu(h.children,w,T,c);case j:U=8,w|=24;break;case A:return i=Oo(12,h,c,w|2),i.elementType=A,i.lanes=T,i;case z:return i=Oo(13,h,c,w),i.elementType=z,i.lanes=T,i;case F:return i=Oo(19,h,c,w),i.elementType=F,i.lanes=T,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case R:U=10;break e;case M:U=9;break e;case _:U=11;break e;case N:U=14;break e;case I:U=16,m=null;break e}U=29,h=Error(s(130,i===null?"null":typeof i,"")),m=null}return c=Oo(U,h,c,w),c.elementType=i,c.type=m,c.lanes=T,c}function tu(i,c,h,m){return i=Oo(7,i,m,c),i.lanes=h,i}function Ny(i,c,h){return i=Oo(6,i,null,c),i.lanes=h,i}function S4(i){var c=Oo(18,null,null,0);return c.stateNode=i,c}function $y(i,c,h){return c=Oo(4,i.children!==null?i.children:[],i.key,c),c.lanes=h,c.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},c}var j4=new WeakMap;function oi(i,c){if(typeof i=="object"&&i!==null){var h=j4.get(i);return h!==void 0?h:(c={value:i,source:c,stack:qe(c)},j4.set(i,c),c)}return{value:i,source:c,stack:qe(c)}}var bd=[],yd=0,Om=null,yh=0,ii=[],ai=0,Vl=null,Ca=1,wa="";function el(i,c){bd[yd++]=yh,bd[yd++]=Om,Om=i,yh=c}function C4(i,c,h){ii[ai++]=Ca,ii[ai++]=wa,ii[ai++]=Vl,Vl=i;var m=Ca;i=wa;var w=32-wt(m)-1;m&=~(1<<w),h+=1;var T=32-wt(c)+w;if(30<T){var U=w-w%5;T=(m&(1<<U)-1).toString(32),m>>=U,w-=U,Ca=1<<32-wt(c)+w|h<<w|m,wa=T+i}else Ca=1<<T|h<<w|m,wa=i}function Hy(i){i.return!==null&&(el(i,1),C4(i,1,0))}function Wy(i){for(;i===Om;)Om=bd[--yd],bd[yd]=null,yh=bd[--yd],bd[yd]=null;for(;i===Vl;)Vl=ii[--ai],ii[ai]=null,wa=ii[--ai],ii[ai]=null,Ca=ii[--ai],ii[ai]=null}function w4(i,c){ii[ai++]=Ca,ii[ai++]=wa,ii[ai++]=Vl,Ca=c.id,wa=c.overflow,Vl=i}var ks=null,Mr=null,Pn=!1,Gl=null,li=!1,Uy=Error(s(519));function Yl(i){var c=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw vh(oi(c,i)),Uy}function A4(i){var c=i.stateNode,h=i.type,m=i.memoizedProps;switch(c[at]=i,c[lt]=m,h){case"dialog":Tn("cancel",c),Tn("close",c);break;case"iframe":case"object":case"embed":Tn("load",c);break;case"video":case"audio":for(h=0;h<Hh.length;h++)Tn(Hh[h],c);break;case"source":Tn("error",c);break;case"img":case"image":case"link":Tn("error",c),Tn("load",c);break;case"details":Tn("toggle",c);break;case"input":Tn("invalid",c),Nl(c,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Tn("invalid",c);break;case"textarea":Tn("invalid",c),lo(c,m.value,m.defaultValue,m.children)}h=m.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||c.textContent===""+h||m.suppressHydrationWarning===!0||HA(c.textContent,h)?(m.popover!=null&&(Tn("beforetoggle",c),Tn("toggle",c)),m.onScroll!=null&&Tn("scroll",c),m.onScrollEnd!=null&&Tn("scrollend",c),m.onClick!=null&&(c.onclick=co),c=!0):c=!1,c||Yl(i,!0)}function E4(i){for(ks=i.return;ks;)switch(ks.tag){case 5:case 31:case 13:li=!1;return;case 27:case 3:li=!0;return;default:ks=ks.return}}function vd(i){if(i!==ks)return!1;if(!Pn)return E4(i),Pn=!0,!1;var c=i.tag,h;if((h=c!==3&&c!==27)&&((h=c===5)&&(h=i.type,h=!(h!=="form"&&h!=="button")||l2(i.type,i.memoizedProps)),h=!h),h&&Mr&&Yl(i),E4(i),c===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(317));Mr=ZA(i)}else if(c===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(317));Mr=ZA(i)}else c===27?(c=Mr,lc(i.type)?(i=h2,h2=null,Mr=i):Mr=c):Mr=ks?ui(i.stateNode.nextSibling):null;return!0}function nu(){Mr=ks=null,Pn=!1}function qy(){var i=Gl;return i!==null&&(po===null?po=i:po.push.apply(po,i),Gl=null),i}function vh(i){Gl===null?Gl=[i]:Gl.push(i)}var Vy=V(null),ru=null,tl=null;function Kl(i,c,h){fe(Vy,c._currentValue),c._currentValue=h}function nl(i){i._currentValue=Vy.current,re(Vy)}function Gy(i,c,h){for(;i!==null;){var m=i.alternate;if((i.childLanes&c)!==c?(i.childLanes|=c,m!==null&&(m.childLanes|=c)):m!==null&&(m.childLanes&c)!==c&&(m.childLanes|=c),i===h)break;i=i.return}}function Yy(i,c,h,m){var w=i.child;for(w!==null&&(w.return=i);w!==null;){var T=w.dependencies;if(T!==null){var U=w.child;T=T.firstContext;e:for(;T!==null;){var te=T;T=w;for(var xe=0;xe<c.length;xe++)if(te.context===c[xe]){T.lanes|=h,te=T.alternate,te!==null&&(te.lanes|=h),Gy(T.return,h,i),m||(U=null);break e}T=te.next}}else if(w.tag===18){if(U=w.return,U===null)throw Error(s(341));U.lanes|=h,T=U.alternate,T!==null&&(T.lanes|=h),Gy(U,h,i),U=null}else U=w.child;if(U!==null)U.return=w;else for(U=w;U!==null;){if(U===i){U=null;break}if(w=U.sibling,w!==null){w.return=U.return,U=w;break}U=U.return}w=U}}function Sd(i,c,h,m){i=null;for(var w=c,T=!1;w!==null;){if(!T){if((w.flags&524288)!==0)T=!0;else if((w.flags&262144)!==0)break}if(w.tag===10){var U=w.alternate;if(U===null)throw Error(s(387));if(U=U.memoizedProps,U!==null){var te=w.type;Do(w.pendingProps.value,U.value)||(i!==null?i.push(te):i=[te])}}else if(w===J.current){if(U=w.alternate,U===null)throw Error(s(387));U.memoizedState.memoizedState!==w.memoizedState.memoizedState&&(i!==null?i.push(Gh):i=[Gh])}w=w.return}i!==null&&Yy(c,i,h,m),c.flags|=262144}function Bm(i){for(i=i.firstContext;i!==null;){if(!Do(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function su(i){ru=i,tl=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Ms(i){return T4(ru,i)}function Nm(i,c){return ru===null&&su(i),T4(i,c)}function T4(i,c){var h=c._currentValue;if(c={context:c,memoizedValue:h,next:null},tl===null){if(i===null)throw Error(s(308));tl=c,i.dependencies={lanes:0,firstContext:c},i.flags|=524288}else tl=tl.next=c;return h}var gP=typeof AbortController<"u"?AbortController:function(){var i=[],c=this.signal={aborted:!1,addEventListener:function(h,m){i.push(m)}};this.abort=function(){c.aborted=!0,i.forEach(function(h){return h()})}},mP=e.unstable_scheduleCallback,xP=e.unstable_NormalPriority,ls={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ky(){return{controller:new gP,data:new Map,refCount:0}}function Sh(i){i.refCount--,i.refCount===0&&mP(xP,function(){i.controller.abort()})}var jh=null,Xy=0,jd=0,Cd=null;function bP(i,c){if(jh===null){var h=jh=[];Xy=0,jd=Jv(),Cd={status:"pending",value:void 0,then:function(m){h.push(m)}}}return Xy++,c.then(k4,k4),c}function k4(){if(--Xy===0&&jh!==null){Cd!==null&&(Cd.status="fulfilled");var i=jh;jh=null,jd=0,Cd=null;for(var c=0;c<i.length;c++)(0,i[c])()}}function yP(i,c){var h=[],m={status:"pending",value:null,reason:null,then:function(w){h.push(w)}};return i.then(function(){m.status="fulfilled",m.value=c;for(var w=0;w<h.length;w++)(0,h[w])(c)},function(w){for(m.status="rejected",m.reason=w,w=0;w<h.length;w++)(0,h[w])(void 0)}),m}var M4=D.S;D.S=function(i,c){fA=ot(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&bP(i,c),M4!==null&&M4(i,c)};var ou=V(null);function Zy(){var i=ou.current;return i!==null?i:Sr.pooledCache}function $m(i,c){c===null?fe(ou,ou.current):fe(ou,c.pool)}function R4(){var i=Zy();return i===null?null:{parent:ls._currentValue,pool:i}}var wd=Error(s(460)),Qy=Error(s(474)),Hm=Error(s(542)),Wm={then:function(){}};function z4(i){return i=i.status,i==="fulfilled"||i==="rejected"}function I4(i,c,h){switch(h=i[h],h===void 0?i.push(c):h!==c&&(c.then(co,co),c=h),c.status){case"fulfilled":return c.value;case"rejected":throw i=c.reason,_4(i),i;default:if(typeof c.status=="string")c.then(co,co);else{if(i=Sr,i!==null&&100<i.shellSuspendCounter)throw Error(s(482));i=c,i.status="pending",i.then(function(m){if(c.status==="pending"){var w=c;w.status="fulfilled",w.value=m}},function(m){if(c.status==="pending"){var w=c;w.status="rejected",w.reason=m}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw i=c.reason,_4(i),i}throw au=c,wd}}function iu(i){try{var c=i._init;return c(i._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(au=h,wd):h}}var au=null;function F4(){if(au===null)throw Error(s(459));var i=au;return au=null,i}function _4(i){if(i===wd||i===Hm)throw Error(s(483))}var Ad=null,Ch=0;function Um(i){var c=Ch;return Ch+=1,Ad===null&&(Ad=[]),I4(Ad,i,c)}function wh(i,c){c=c.props.ref,i.ref=c!==void 0?c:null}function qm(i,c){throw c.$$typeof===x?Error(s(525)):(i=Object.prototype.toString.call(c),Error(s(31,i==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":i)))}function L4(i){function c(Ie,Ae){if(i){var Pe=Ie.deletions;Pe===null?(Ie.deletions=[Ae],Ie.flags|=16):Pe.push(Ae)}}function h(Ie,Ae){if(!i)return null;for(;Ae!==null;)c(Ie,Ae),Ae=Ae.sibling;return null}function m(Ie){for(var Ae=new Map;Ie!==null;)Ie.key!==null?Ae.set(Ie.key,Ie):Ae.set(Ie.index,Ie),Ie=Ie.sibling;return Ae}function w(Ie,Ae){return Ie=Ja(Ie,Ae),Ie.index=0,Ie.sibling=null,Ie}function T(Ie,Ae,Pe){return Ie.index=Pe,i?(Pe=Ie.alternate,Pe!==null?(Pe=Pe.index,Pe<Ae?(Ie.flags|=67108866,Ae):Pe):(Ie.flags|=67108866,Ae)):(Ie.flags|=1048576,Ae)}function U(Ie){return i&&Ie.alternate===null&&(Ie.flags|=67108866),Ie}function te(Ie,Ae,Pe,tt){return Ae===null||Ae.tag!==6?(Ae=Ny(Pe,Ie.mode,tt),Ae.return=Ie,Ae):(Ae=w(Ae,Pe),Ae.return=Ie,Ae)}function xe(Ie,Ae,Pe,tt){var Kt=Pe.type;return Kt===S?Ze(Ie,Ae,Pe.props.children,tt,Pe.key):Ae!==null&&(Ae.elementType===Kt||typeof Kt=="object"&&Kt!==null&&Kt.$$typeof===I&&iu(Kt)===Ae.type)?(Ae=w(Ae,Pe.props),wh(Ae,Pe),Ae.return=Ie,Ae):(Ae=Dm(Pe.type,Pe.key,Pe.props,null,Ie.mode,tt),wh(Ae,Pe),Ae.return=Ie,Ae)}function De(Ie,Ae,Pe,tt){return Ae===null||Ae.tag!==4||Ae.stateNode.containerInfo!==Pe.containerInfo||Ae.stateNode.implementation!==Pe.implementation?(Ae=$y(Pe,Ie.mode,tt),Ae.return=Ie,Ae):(Ae=w(Ae,Pe.children||[]),Ae.return=Ie,Ae)}function Ze(Ie,Ae,Pe,tt,Kt){return Ae===null||Ae.tag!==7?(Ae=tu(Pe,Ie.mode,tt,Kt),Ae.return=Ie,Ae):(Ae=w(Ae,Pe),Ae.return=Ie,Ae)}function rt(Ie,Ae,Pe){if(typeof Ae=="string"&&Ae!==""||typeof Ae=="number"||typeof Ae=="bigint")return Ae=Ny(""+Ae,Ie.mode,Pe),Ae.return=Ie,Ae;if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case b:return Pe=Dm(Ae.type,Ae.key,Ae.props,null,Ie.mode,Pe),wh(Pe,Ae),Pe.return=Ie,Pe;case y:return Ae=$y(Ae,Ie.mode,Pe),Ae.return=Ie,Ae;case I:return Ae=iu(Ae),rt(Ie,Ae,Pe)}if(W(Ae)||k(Ae))return Ae=tu(Ae,Ie.mode,Pe,null),Ae.return=Ie,Ae;if(typeof Ae.then=="function")return rt(Ie,Um(Ae),Pe);if(Ae.$$typeof===R)return rt(Ie,Nm(Ie,Ae),Pe);qm(Ie,Ae)}return null}function Ne(Ie,Ae,Pe,tt){var Kt=Ae!==null?Ae.key:null;if(typeof Pe=="string"&&Pe!==""||typeof Pe=="number"||typeof Pe=="bigint")return Kt!==null?null:te(Ie,Ae,""+Pe,tt);if(typeof Pe=="object"&&Pe!==null){switch(Pe.$$typeof){case b:return Pe.key===Kt?xe(Ie,Ae,Pe,tt):null;case y:return Pe.key===Kt?De(Ie,Ae,Pe,tt):null;case I:return Pe=iu(Pe),Ne(Ie,Ae,Pe,tt)}if(W(Pe)||k(Pe))return Kt!==null?null:Ze(Ie,Ae,Pe,tt,null);if(typeof Pe.then=="function")return Ne(Ie,Ae,Um(Pe),tt);if(Pe.$$typeof===R)return Ne(Ie,Ae,Nm(Ie,Pe),tt);qm(Ie,Pe)}return null}function Ue(Ie,Ae,Pe,tt,Kt){if(typeof tt=="string"&&tt!==""||typeof tt=="number"||typeof tt=="bigint")return Ie=Ie.get(Pe)||null,te(Ae,Ie,""+tt,Kt);if(typeof tt=="object"&&tt!==null){switch(tt.$$typeof){case b:return Ie=Ie.get(tt.key===null?Pe:tt.key)||null,xe(Ae,Ie,tt,Kt);case y:return Ie=Ie.get(tt.key===null?Pe:tt.key)||null,De(Ae,Ie,tt,Kt);case I:return tt=iu(tt),Ue(Ie,Ae,Pe,tt,Kt)}if(W(tt)||k(tt))return Ie=Ie.get(Pe)||null,Ze(Ae,Ie,tt,Kt,null);if(typeof tt.then=="function")return Ue(Ie,Ae,Pe,Um(tt),Kt);if(tt.$$typeof===R)return Ue(Ie,Ae,Pe,Nm(Ae,tt),Kt);qm(Ae,tt)}return null}function Ot(Ie,Ae,Pe,tt){for(var Kt=null,Vn=null,qt=Ae,bn=Ae=0,zn=null;qt!==null&&bn<Pe.length;bn++){qt.index>bn?(zn=qt,qt=null):zn=qt.sibling;var Gn=Ne(Ie,qt,Pe[bn],tt);if(Gn===null){qt===null&&(qt=zn);break}i&&qt&&Gn.alternate===null&&c(Ie,qt),Ae=T(Gn,Ae,bn),Vn===null?Kt=Gn:Vn.sibling=Gn,Vn=Gn,qt=zn}if(bn===Pe.length)return h(Ie,qt),Pn&&el(Ie,bn),Kt;if(qt===null){for(;bn<Pe.length;bn++)qt=rt(Ie,Pe[bn],tt),qt!==null&&(Ae=T(qt,Ae,bn),Vn===null?Kt=qt:Vn.sibling=qt,Vn=qt);return Pn&&el(Ie,bn),Kt}for(qt=m(qt);bn<Pe.length;bn++)zn=Ue(qt,Ie,bn,Pe[bn],tt),zn!==null&&(i&&zn.alternate!==null&&qt.delete(zn.key===null?bn:zn.key),Ae=T(zn,Ae,bn),Vn===null?Kt=zn:Vn.sibling=zn,Vn=zn);return i&&qt.forEach(function(hc){return c(Ie,hc)}),Pn&&el(Ie,bn),Kt}function en(Ie,Ae,Pe,tt){if(Pe==null)throw Error(s(151));for(var Kt=null,Vn=null,qt=Ae,bn=Ae=0,zn=null,Gn=Pe.next();qt!==null&&!Gn.done;bn++,Gn=Pe.next()){qt.index>bn?(zn=qt,qt=null):zn=qt.sibling;var hc=Ne(Ie,qt,Gn.value,tt);if(hc===null){qt===null&&(qt=zn);break}i&&qt&&hc.alternate===null&&c(Ie,qt),Ae=T(hc,Ae,bn),Vn===null?Kt=hc:Vn.sibling=hc,Vn=hc,qt=zn}if(Gn.done)return h(Ie,qt),Pn&&el(Ie,bn),Kt;if(qt===null){for(;!Gn.done;bn++,Gn=Pe.next())Gn=rt(Ie,Gn.value,tt),Gn!==null&&(Ae=T(Gn,Ae,bn),Vn===null?Kt=Gn:Vn.sibling=Gn,Vn=Gn);return Pn&&el(Ie,bn),Kt}for(qt=m(qt);!Gn.done;bn++,Gn=Pe.next())Gn=Ue(qt,Ie,bn,Gn.value,tt),Gn!==null&&(i&&Gn.alternate!==null&&qt.delete(Gn.key===null?bn:Gn.key),Ae=T(Gn,Ae,bn),Vn===null?Kt=Gn:Vn.sibling=Gn,Vn=Gn);return i&&qt.forEach(function(RD){return c(Ie,RD)}),Pn&&el(Ie,bn),Kt}function xr(Ie,Ae,Pe,tt){if(typeof Pe=="object"&&Pe!==null&&Pe.type===S&&Pe.key===null&&(Pe=Pe.props.children),typeof Pe=="object"&&Pe!==null){switch(Pe.$$typeof){case b:e:{for(var Kt=Pe.key;Ae!==null;){if(Ae.key===Kt){if(Kt=Pe.type,Kt===S){if(Ae.tag===7){h(Ie,Ae.sibling),tt=w(Ae,Pe.props.children),tt.return=Ie,Ie=tt;break e}}else if(Ae.elementType===Kt||typeof Kt=="object"&&Kt!==null&&Kt.$$typeof===I&&iu(Kt)===Ae.type){h(Ie,Ae.sibling),tt=w(Ae,Pe.props),wh(tt,Pe),tt.return=Ie,Ie=tt;break e}h(Ie,Ae);break}else c(Ie,Ae);Ae=Ae.sibling}Pe.type===S?(tt=tu(Pe.props.children,Ie.mode,tt,Pe.key),tt.return=Ie,Ie=tt):(tt=Dm(Pe.type,Pe.key,Pe.props,null,Ie.mode,tt),wh(tt,Pe),tt.return=Ie,Ie=tt)}return U(Ie);case y:e:{for(Kt=Pe.key;Ae!==null;){if(Ae.key===Kt)if(Ae.tag===4&&Ae.stateNode.containerInfo===Pe.containerInfo&&Ae.stateNode.implementation===Pe.implementation){h(Ie,Ae.sibling),tt=w(Ae,Pe.children||[]),tt.return=Ie,Ie=tt;break e}else{h(Ie,Ae);break}else c(Ie,Ae);Ae=Ae.sibling}tt=$y(Pe,Ie.mode,tt),tt.return=Ie,Ie=tt}return U(Ie);case I:return Pe=iu(Pe),xr(Ie,Ae,Pe,tt)}if(W(Pe))return Ot(Ie,Ae,Pe,tt);if(k(Pe)){if(Kt=k(Pe),typeof Kt!="function")throw Error(s(150));return Pe=Kt.call(Pe),en(Ie,Ae,Pe,tt)}if(typeof Pe.then=="function")return xr(Ie,Ae,Um(Pe),tt);if(Pe.$$typeof===R)return xr(Ie,Ae,Nm(Ie,Pe),tt);qm(Ie,Pe)}return typeof Pe=="string"&&Pe!==""||typeof Pe=="number"||typeof Pe=="bigint"?(Pe=""+Pe,Ae!==null&&Ae.tag===6?(h(Ie,Ae.sibling),tt=w(Ae,Pe),tt.return=Ie,Ie=tt):(h(Ie,Ae),tt=Ny(Pe,Ie.mode,tt),tt.return=Ie,Ie=tt),U(Ie)):h(Ie,Ae)}return function(Ie,Ae,Pe,tt){try{Ch=0;var Kt=xr(Ie,Ae,Pe,tt);return Ad=null,Kt}catch(qt){if(qt===wd||qt===Hm)throw qt;var Vn=Oo(29,qt,null,Ie.mode);return Vn.lanes=tt,Vn.return=Ie,Vn}}}var lu=L4(!0),P4=L4(!1),Xl=!1;function Jy(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ev(i,c){i=i.updateQueue,c.updateQueue===i&&(c.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Zl(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Ql(i,c,h){var m=i.updateQueue;if(m===null)return null;if(m=m.shared,(Zn&2)!==0){var w=m.pending;return w===null?c.next=c:(c.next=w.next,w.next=c),m.pending=c,c=Pm(i),y4(i,null,h),c}return Lm(i,m,c,h),Pm(i)}function Ah(i,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194048)!==0)){var m=c.lanes;m&=i.pendingLanes,h|=m,c.lanes=h,an(i,h)}}function tv(i,c){var h=i.updateQueue,m=i.alternate;if(m!==null&&(m=m.updateQueue,h===m)){var w=null,T=null;if(h=h.firstBaseUpdate,h!==null){do{var U={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};T===null?w=T=U:T=T.next=U,h=h.next}while(h!==null);T===null?w=T=c:T=T.next=c}else w=T=c;h={baseState:m.baseState,firstBaseUpdate:w,lastBaseUpdate:T,shared:m.shared,callbacks:m.callbacks},i.updateQueue=h;return}i=h.lastBaseUpdate,i===null?h.firstBaseUpdate=c:i.next=c,h.lastBaseUpdate=c}var nv=!1;function Eh(){if(nv){var i=Cd;if(i!==null)throw i}}function Th(i,c,h,m){nv=!1;var w=i.updateQueue;Xl=!1;var T=w.firstBaseUpdate,U=w.lastBaseUpdate,te=w.shared.pending;if(te!==null){w.shared.pending=null;var xe=te,De=xe.next;xe.next=null,U===null?T=De:U.next=De,U=xe;var Ze=i.alternate;Ze!==null&&(Ze=Ze.updateQueue,te=Ze.lastBaseUpdate,te!==U&&(te===null?Ze.firstBaseUpdate=De:te.next=De,Ze.lastBaseUpdate=xe))}if(T!==null){var rt=w.baseState;U=0,Ze=De=xe=null,te=T;do{var Ne=te.lane&-536870913,Ue=Ne!==te.lane;if(Ue?(Rn&Ne)===Ne:(m&Ne)===Ne){Ne!==0&&Ne===jd&&(nv=!0),Ze!==null&&(Ze=Ze.next={lane:0,tag:te.tag,payload:te.payload,callback:null,next:null});e:{var Ot=i,en=te;Ne=c;var xr=h;switch(en.tag){case 1:if(Ot=en.payload,typeof Ot=="function"){rt=Ot.call(xr,rt,Ne);break e}rt=Ot;break e;case 3:Ot.flags=Ot.flags&-65537|128;case 0:if(Ot=en.payload,Ne=typeof Ot=="function"?Ot.call(xr,rt,Ne):Ot,Ne==null)break e;rt=g({},rt,Ne);break e;case 2:Xl=!0}}Ne=te.callback,Ne!==null&&(i.flags|=64,Ue&&(i.flags|=8192),Ue=w.callbacks,Ue===null?w.callbacks=[Ne]:Ue.push(Ne))}else Ue={lane:Ne,tag:te.tag,payload:te.payload,callback:te.callback,next:null},Ze===null?(De=Ze=Ue,xe=rt):Ze=Ze.next=Ue,U|=Ne;if(te=te.next,te===null){if(te=w.shared.pending,te===null)break;Ue=te,te=Ue.next,Ue.next=null,w.lastBaseUpdate=Ue,w.shared.pending=null}}while(!0);Ze===null&&(xe=rt),w.baseState=xe,w.firstBaseUpdate=De,w.lastBaseUpdate=Ze,T===null&&(w.shared.lanes=0),rc|=U,i.lanes=U,i.memoizedState=rt}}function D4(i,c){if(typeof i!="function")throw Error(s(191,i));i.call(c)}function O4(i,c){var h=i.callbacks;if(h!==null)for(i.callbacks=null,i=0;i<h.length;i++)D4(h[i],c)}var Ed=V(null),Vm=V(0);function B4(i,c){i=dl,fe(Vm,i),fe(Ed,c),dl=i|c.baseLanes}function rv(){fe(Vm,dl),fe(Ed,Ed.current)}function sv(){dl=Vm.current,re(Ed),re(Vm)}var Bo=V(null),ci=null;function Jl(i){var c=i.alternate;fe(Jr,Jr.current&1),fe(Bo,i),ci===null&&(c===null||Ed.current!==null||c.memoizedState!==null)&&(ci=i)}function ov(i){fe(Jr,Jr.current),fe(Bo,i),ci===null&&(ci=i)}function N4(i){i.tag===22?(fe(Jr,Jr.current),fe(Bo,i),ci===null&&(ci=i)):ec()}function ec(){fe(Jr,Jr.current),fe(Bo,Bo.current)}function No(i){re(Bo),ci===i&&(ci=null),re(Jr)}var Jr=V(0);function Gm(i){for(var c=i;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||d2(h)||f2(h)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===i)break;for(;c.sibling===null;){if(c.return===null||c.return===i)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var rl=0,xn=null,gr=null,cs=null,Ym=!1,Td=!1,cu=!1,Km=0,kh=0,kd=null,vP=0;function Gr(){throw Error(s(321))}function iv(i,c){if(c===null)return!1;for(var h=0;h<c.length&&h<i.length;h++)if(!Do(i[h],c[h]))return!1;return!0}function av(i,c,h,m,w,T){return rl=T,xn=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,D.H=i===null||i.memoizedState===null?C3:jv,cu=!1,T=h(m,w),cu=!1,Td&&(T=H4(c,h,m,w)),$4(i),T}function $4(i){D.H=zh;var c=gr!==null&&gr.next!==null;if(rl=0,cs=gr=xn=null,Ym=!1,kh=0,kd=null,c)throw Error(s(300));i===null||us||(i=i.dependencies,i!==null&&Bm(i)&&(us=!0))}function H4(i,c,h,m){xn=i;var w=0;do{if(Td&&(kd=null),kh=0,Td=!1,25<=w)throw Error(s(301));if(w+=1,cs=gr=null,i.updateQueue!=null){var T=i.updateQueue;T.lastEffect=null,T.events=null,T.stores=null,T.memoCache!=null&&(T.memoCache.index=0)}D.H=w3,T=c(h,m)}while(Td);return T}function SP(){var i=D.H,c=i.useState()[0];return c=typeof c.then=="function"?Mh(c):c,i=i.useState()[0],(gr!==null?gr.memoizedState:null)!==i&&(xn.flags|=1024),c}function lv(){var i=Km!==0;return Km=0,i}function cv(i,c,h){c.updateQueue=i.updateQueue,c.flags&=-2053,i.lanes&=~h}function uv(i){if(Ym){for(i=i.memoizedState;i!==null;){var c=i.queue;c!==null&&(c.pending=null),i=i.next}Ym=!1}rl=0,cs=gr=xn=null,Td=!1,kh=Km=0,kd=null}function Gs(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return cs===null?xn.memoizedState=cs=i:cs=cs.next=i,cs}function es(){if(gr===null){var i=xn.alternate;i=i!==null?i.memoizedState:null}else i=gr.next;var c=cs===null?xn.memoizedState:cs.next;if(c!==null)cs=c,gr=i;else{if(i===null)throw xn.alternate===null?Error(s(467)):Error(s(310));gr=i,i={memoizedState:gr.memoizedState,baseState:gr.baseState,baseQueue:gr.baseQueue,queue:gr.queue,next:null},cs===null?xn.memoizedState=cs=i:cs=cs.next=i}return cs}function Xm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Mh(i){var c=kh;return kh+=1,kd===null&&(kd=[]),i=I4(kd,i,c),c=xn,(cs===null?c.memoizedState:cs.next)===null&&(c=c.alternate,D.H=c===null||c.memoizedState===null?C3:jv),i}function Zm(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Mh(i);if(i.$$typeof===R)return Ms(i)}throw Error(s(438,String(i)))}function dv(i){var c=null,h=xn.updateQueue;if(h!==null&&(c=h.memoCache),c==null){var m=xn.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(c={data:m.data.map(function(w){return w.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),h===null&&(h=Xm(),xn.updateQueue=h),h.memoCache=c,h=c.data[c.index],h===void 0)for(h=c.data[c.index]=Array(i),m=0;m<i;m++)h[m]=H;return c.index++,h}function sl(i,c){return typeof c=="function"?c(i):c}function Qm(i){var c=es();return fv(c,gr,i)}function fv(i,c,h){var m=i.queue;if(m===null)throw Error(s(311));m.lastRenderedReducer=h;var w=i.baseQueue,T=m.pending;if(T!==null){if(w!==null){var U=w.next;w.next=T.next,T.next=U}c.baseQueue=w=T,m.pending=null}if(T=i.baseState,w===null)i.memoizedState=T;else{c=w.next;var te=U=null,xe=null,De=c,Ze=!1;do{var rt=De.lane&-536870913;if(rt!==De.lane?(Rn&rt)===rt:(rl&rt)===rt){var Ne=De.revertLane;if(Ne===0)xe!==null&&(xe=xe.next={lane:0,revertLane:0,gesture:null,action:De.action,hasEagerState:De.hasEagerState,eagerState:De.eagerState,next:null}),rt===jd&&(Ze=!0);else if((rl&Ne)===Ne){De=De.next,Ne===jd&&(Ze=!0);continue}else rt={lane:0,revertLane:De.revertLane,gesture:null,action:De.action,hasEagerState:De.hasEagerState,eagerState:De.eagerState,next:null},xe===null?(te=xe=rt,U=T):xe=xe.next=rt,xn.lanes|=Ne,rc|=Ne;rt=De.action,cu&&h(T,rt),T=De.hasEagerState?De.eagerState:h(T,rt)}else Ne={lane:rt,revertLane:De.revertLane,gesture:De.gesture,action:De.action,hasEagerState:De.hasEagerState,eagerState:De.eagerState,next:null},xe===null?(te=xe=Ne,U=T):xe=xe.next=Ne,xn.lanes|=rt,rc|=rt;De=De.next}while(De!==null&&De!==c);if(xe===null?U=T:xe.next=te,!Do(T,i.memoizedState)&&(us=!0,Ze&&(h=Cd,h!==null)))throw h;i.memoizedState=T,i.baseState=U,i.baseQueue=xe,m.lastRenderedState=T}return w===null&&(m.lanes=0),[i.memoizedState,m.dispatch]}function hv(i){var c=es(),h=c.queue;if(h===null)throw Error(s(311));h.lastRenderedReducer=i;var m=h.dispatch,w=h.pending,T=c.memoizedState;if(w!==null){h.pending=null;var U=w=w.next;do T=i(T,U.action),U=U.next;while(U!==w);Do(T,c.memoizedState)||(us=!0),c.memoizedState=T,c.baseQueue===null&&(c.baseState=T),h.lastRenderedState=T}return[T,m]}function W4(i,c,h){var m=xn,w=es(),T=Pn;if(T){if(h===void 0)throw Error(s(407));h=h()}else h=c();var U=!Do((gr||w).memoizedState,h);if(U&&(w.memoizedState=h,us=!0),w=w.queue,mv(V4.bind(null,m,w,i),[i]),w.getSnapshot!==c||U||cs!==null&&cs.memoizedState.tag&1){if(m.flags|=2048,Md(9,{destroy:void 0},q4.bind(null,m,w,h,c),null),Sr===null)throw Error(s(349));T||(rl&127)!==0||U4(m,c,h)}return h}function U4(i,c,h){i.flags|=16384,i={getSnapshot:c,value:h},c=xn.updateQueue,c===null?(c=Xm(),xn.updateQueue=c,c.stores=[i]):(h=c.stores,h===null?c.stores=[i]:h.push(i))}function q4(i,c,h,m){c.value=h,c.getSnapshot=m,G4(c)&&Y4(i)}function V4(i,c,h){return h(function(){G4(c)&&Y4(i)})}function G4(i){var c=i.getSnapshot;i=i.value;try{var h=c();return!Do(i,h)}catch{return!0}}function Y4(i){var c=eu(i,2);c!==null&&go(c,i,2)}function pv(i){var c=Gs();if(typeof i=="function"){var h=i;if(i=h(),cu){bt(!0);try{h()}finally{bt(!1)}}}return c.memoizedState=c.baseState=i,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sl,lastRenderedState:i},c}function K4(i,c,h,m){return i.baseState=h,fv(i,gr,typeof m=="function"?m:sl)}function jP(i,c,h,m,w){if(tx(i))throw Error(s(485));if(i=c.action,i!==null){var T={payload:w,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(U){T.listeners.push(U)}};D.T!==null?h(!0):T.isTransition=!1,m(T),h=c.pending,h===null?(T.next=c.pending=T,X4(c,T)):(T.next=h.next,c.pending=h.next=T)}}function X4(i,c){var h=c.action,m=c.payload,w=i.state;if(c.isTransition){var T=D.T,U={};D.T=U;try{var te=h(w,m),xe=D.S;xe!==null&&xe(U,te),Z4(i,c,te)}catch(De){gv(i,c,De)}finally{T!==null&&U.types!==null&&(T.types=U.types),D.T=T}}else try{T=h(w,m),Z4(i,c,T)}catch(De){gv(i,c,De)}}function Z4(i,c,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(m){Q4(i,c,m)},function(m){return gv(i,c,m)}):Q4(i,c,h)}function Q4(i,c,h){c.status="fulfilled",c.value=h,J4(c),i.state=h,c=i.pending,c!==null&&(h=c.next,h===c?i.pending=null:(h=h.next,c.next=h,X4(i,h)))}function gv(i,c,h){var m=i.pending;if(i.pending=null,m!==null){m=m.next;do c.status="rejected",c.reason=h,J4(c),c=c.next;while(c!==m)}i.action=null}function J4(i){i=i.listeners;for(var c=0;c<i.length;c++)(0,i[c])()}function e3(i,c){return c}function t3(i,c){if(Pn){var h=Sr.formState;if(h!==null){e:{var m=xn;if(Pn){if(Mr){t:{for(var w=Mr,T=li;w.nodeType!==8;){if(!T){w=null;break t}if(w=ui(w.nextSibling),w===null){w=null;break t}}T=w.data,w=T==="F!"||T==="F"?w:null}if(w){Mr=ui(w.nextSibling),m=w.data==="F!";break e}}Yl(m)}m=!1}m&&(c=h[0])}}return h=Gs(),h.memoizedState=h.baseState=c,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e3,lastRenderedState:c},h.queue=m,h=v3.bind(null,xn,m),m.dispatch=h,m=pv(!1),T=Sv.bind(null,xn,!1,m.queue),m=Gs(),w={state:c,dispatch:null,action:i,pending:null},m.queue=w,h=jP.bind(null,xn,w,T,h),w.dispatch=h,m.memoizedState=i,[c,h,!1]}function n3(i){var c=es();return r3(c,gr,i)}function r3(i,c,h){if(c=fv(i,c,e3)[0],i=Qm(sl)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var m=Mh(c)}catch(U){throw U===wd?Hm:U}else m=c;c=es();var w=c.queue,T=w.dispatch;return h!==c.memoizedState&&(xn.flags|=2048,Md(9,{destroy:void 0},CP.bind(null,w,h),null)),[m,T,i]}function CP(i,c){i.action=c}function s3(i){var c=es(),h=gr;if(h!==null)return r3(c,h,i);es(),c=c.memoizedState,h=es();var m=h.queue.dispatch;return h.memoizedState=i,[c,m,!1]}function Md(i,c,h,m){return i={tag:i,create:h,deps:m,inst:c,next:null},c=xn.updateQueue,c===null&&(c=Xm(),xn.updateQueue=c),h=c.lastEffect,h===null?c.lastEffect=i.next=i:(m=h.next,h.next=i,i.next=m,c.lastEffect=i),i}function o3(){return es().memoizedState}function Jm(i,c,h,m){var w=Gs();xn.flags|=i,w.memoizedState=Md(1|c,{destroy:void 0},h,m===void 0?null:m)}function ex(i,c,h,m){var w=es();m=m===void 0?null:m;var T=w.memoizedState.inst;gr!==null&&m!==null&&iv(m,gr.memoizedState.deps)?w.memoizedState=Md(c,T,h,m):(xn.flags|=i,w.memoizedState=Md(1|c,T,h,m))}function i3(i,c){Jm(8390656,8,i,c)}function mv(i,c){ex(2048,8,i,c)}function wP(i){xn.flags|=4;var c=xn.updateQueue;if(c===null)c=Xm(),xn.updateQueue=c,c.events=[i];else{var h=c.events;h===null?c.events=[i]:h.push(i)}}function a3(i){var c=es().memoizedState;return wP({ref:c,nextImpl:i}),function(){if((Zn&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}function l3(i,c){return ex(4,2,i,c)}function c3(i,c){return ex(4,4,i,c)}function u3(i,c){if(typeof c=="function"){i=i();var h=c(i);return function(){typeof h=="function"?h():c(null)}}if(c!=null)return i=i(),c.current=i,function(){c.current=null}}function d3(i,c,h){h=h!=null?h.concat([i]):null,ex(4,4,u3.bind(null,c,i),h)}function xv(){}function f3(i,c){var h=es();c=c===void 0?null:c;var m=h.memoizedState;return c!==null&&iv(c,m[1])?m[0]:(h.memoizedState=[i,c],i)}function h3(i,c){var h=es();c=c===void 0?null:c;var m=h.memoizedState;if(c!==null&&iv(c,m[1]))return m[0];if(m=i(),cu){bt(!0);try{i()}finally{bt(!1)}}return h.memoizedState=[m,c],m}function bv(i,c,h){return h===void 0||(rl&1073741824)!==0&&(Rn&261930)===0?i.memoizedState=c:(i.memoizedState=h,i=pA(),xn.lanes|=i,rc|=i,h)}function p3(i,c,h,m){return Do(h,c)?h:Ed.current!==null?(i=bv(i,h,m),Do(i,c)||(us=!0),i):(rl&42)===0||(rl&1073741824)!==0&&(Rn&261930)===0?(us=!0,i.memoizedState=h):(i=pA(),xn.lanes|=i,rc|=i,c)}function g3(i,c,h,m,w){var T=q.p;q.p=T!==0&&8>T?T:8;var U=D.T,te={};D.T=te,Sv(i,!1,c,h);try{var xe=w(),De=D.S;if(De!==null&&De(te,xe),xe!==null&&typeof xe=="object"&&typeof xe.then=="function"){var Ze=yP(xe,m);Rh(i,c,Ze,Wo(i))}else Rh(i,c,m,Wo(i))}catch(rt){Rh(i,c,{then:function(){},status:"rejected",reason:rt},Wo())}finally{q.p=T,U!==null&&te.types!==null&&(U.types=te.types),D.T=U}}function AP(){}function yv(i,c,h,m){if(i.tag!==5)throw Error(s(476));var w=m3(i).queue;g3(i,w,c,K,h===null?AP:function(){return x3(i),h(m)})}function m3(i){var c=i.memoizedState;if(c!==null)return c;c={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sl,lastRenderedState:K},next:null};var h={};return c.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sl,lastRenderedState:h},next:null},i.memoizedState=c,i=i.alternate,i!==null&&(i.memoizedState=c),c}function x3(i){var c=m3(i);c.next===null&&(c=i.alternate.memoizedState),Rh(i,c.next.queue,{},Wo())}function vv(){return Ms(Gh)}function b3(){return es().memoizedState}function y3(){return es().memoizedState}function EP(i){for(var c=i.return;c!==null;){switch(c.tag){case 24:case 3:var h=Wo();i=Zl(h);var m=Ql(c,i,h);m!==null&&(go(m,c,h),Ah(m,c,h)),c={cache:Ky()},i.payload=c;return}c=c.return}}function TP(i,c,h){var m=Wo();h={lane:m,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},tx(i)?S3(c,h):(h=Oy(i,c,h,m),h!==null&&(go(h,i,m),j3(h,c,m)))}function v3(i,c,h){var m=Wo();Rh(i,c,h,m)}function Rh(i,c,h,m){var w={lane:m,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(tx(i))S3(c,w);else{var T=i.alternate;if(i.lanes===0&&(T===null||T.lanes===0)&&(T=c.lastRenderedReducer,T!==null))try{var U=c.lastRenderedState,te=T(U,h);if(w.hasEagerState=!0,w.eagerState=te,Do(te,U))return Lm(i,c,w,0),Sr===null&&_m(),!1}catch{}if(h=Oy(i,c,w,m),h!==null)return go(h,i,m),j3(h,c,m),!0}return!1}function Sv(i,c,h,m){if(m={lane:2,revertLane:Jv(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},tx(i)){if(c)throw Error(s(479))}else c=Oy(i,h,m,2),c!==null&&go(c,i,2)}function tx(i){var c=i.alternate;return i===xn||c!==null&&c===xn}function S3(i,c){Td=Ym=!0;var h=i.pending;h===null?c.next=c:(c.next=h.next,h.next=c),i.pending=c}function j3(i,c,h){if((h&4194048)!==0){var m=c.lanes;m&=i.pendingLanes,h|=m,c.lanes=h,an(i,h)}}var zh={readContext:Ms,use:Zm,useCallback:Gr,useContext:Gr,useEffect:Gr,useImperativeHandle:Gr,useLayoutEffect:Gr,useInsertionEffect:Gr,useMemo:Gr,useReducer:Gr,useRef:Gr,useState:Gr,useDebugValue:Gr,useDeferredValue:Gr,useTransition:Gr,useSyncExternalStore:Gr,useId:Gr,useHostTransitionStatus:Gr,useFormState:Gr,useActionState:Gr,useOptimistic:Gr,useMemoCache:Gr,useCacheRefresh:Gr};zh.useEffectEvent=Gr;var C3={readContext:Ms,use:Zm,useCallback:function(i,c){return Gs().memoizedState=[i,c===void 0?null:c],i},useContext:Ms,useEffect:i3,useImperativeHandle:function(i,c,h){h=h!=null?h.concat([i]):null,Jm(4194308,4,u3.bind(null,c,i),h)},useLayoutEffect:function(i,c){return Jm(4194308,4,i,c)},useInsertionEffect:function(i,c){Jm(4,2,i,c)},useMemo:function(i,c){var h=Gs();c=c===void 0?null:c;var m=i();if(cu){bt(!0);try{i()}finally{bt(!1)}}return h.memoizedState=[m,c],m},useReducer:function(i,c,h){var m=Gs();if(h!==void 0){var w=h(c);if(cu){bt(!0);try{h(c)}finally{bt(!1)}}}else w=c;return m.memoizedState=m.baseState=w,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:w},m.queue=i,i=i.dispatch=TP.bind(null,xn,i),[m.memoizedState,i]},useRef:function(i){var c=Gs();return i={current:i},c.memoizedState=i},useState:function(i){i=pv(i);var c=i.queue,h=v3.bind(null,xn,c);return c.dispatch=h,[i.memoizedState,h]},useDebugValue:xv,useDeferredValue:function(i,c){var h=Gs();return bv(h,i,c)},useTransition:function(){var i=pv(!1);return i=g3.bind(null,xn,i.queue,!0,!1),Gs().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,c,h){var m=xn,w=Gs();if(Pn){if(h===void 0)throw Error(s(407));h=h()}else{if(h=c(),Sr===null)throw Error(s(349));(Rn&127)!==0||U4(m,c,h)}w.memoizedState=h;var T={value:h,getSnapshot:c};return w.queue=T,i3(V4.bind(null,m,T,i),[i]),m.flags|=2048,Md(9,{destroy:void 0},q4.bind(null,m,T,h,c),null),h},useId:function(){var i=Gs(),c=Sr.identifierPrefix;if(Pn){var h=wa,m=Ca;h=(m&~(1<<32-wt(m)-1)).toString(32)+h,c="_"+c+"R_"+h,h=Km++,0<h&&(c+="H"+h.toString(32)),c+="_"}else h=vP++,c="_"+c+"r_"+h.toString(32)+"_";return i.memoizedState=c},useHostTransitionStatus:vv,useFormState:t3,useActionState:t3,useOptimistic:function(i){var c=Gs();c.memoizedState=c.baseState=i;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=h,c=Sv.bind(null,xn,!0,h),h.dispatch=c,[i,c]},useMemoCache:dv,useCacheRefresh:function(){return Gs().memoizedState=EP.bind(null,xn)},useEffectEvent:function(i){var c=Gs(),h={impl:i};return c.memoizedState=h,function(){if((Zn&2)!==0)throw Error(s(440));return h.impl.apply(void 0,arguments)}}},jv={readContext:Ms,use:Zm,useCallback:f3,useContext:Ms,useEffect:mv,useImperativeHandle:d3,useInsertionEffect:l3,useLayoutEffect:c3,useMemo:h3,useReducer:Qm,useRef:o3,useState:function(){return Qm(sl)},useDebugValue:xv,useDeferredValue:function(i,c){var h=es();return p3(h,gr.memoizedState,i,c)},useTransition:function(){var i=Qm(sl)[0],c=es().memoizedState;return[typeof i=="boolean"?i:Mh(i),c]},useSyncExternalStore:W4,useId:b3,useHostTransitionStatus:vv,useFormState:n3,useActionState:n3,useOptimistic:function(i,c){var h=es();return K4(h,gr,i,c)},useMemoCache:dv,useCacheRefresh:y3};jv.useEffectEvent=a3;var w3={readContext:Ms,use:Zm,useCallback:f3,useContext:Ms,useEffect:mv,useImperativeHandle:d3,useInsertionEffect:l3,useLayoutEffect:c3,useMemo:h3,useReducer:hv,useRef:o3,useState:function(){return hv(sl)},useDebugValue:xv,useDeferredValue:function(i,c){var h=es();return gr===null?bv(h,i,c):p3(h,gr.memoizedState,i,c)},useTransition:function(){var i=hv(sl)[0],c=es().memoizedState;return[typeof i=="boolean"?i:Mh(i),c]},useSyncExternalStore:W4,useId:b3,useHostTransitionStatus:vv,useFormState:s3,useActionState:s3,useOptimistic:function(i,c){var h=es();return gr!==null?K4(h,gr,i,c):(h.baseState=i,[i,h.queue.dispatch])},useMemoCache:dv,useCacheRefresh:y3};w3.useEffectEvent=a3;function Cv(i,c,h,m){c=i.memoizedState,h=h(m,c),h=h==null?c:g({},c,h),i.memoizedState=h,i.lanes===0&&(i.updateQueue.baseState=h)}var wv={enqueueSetState:function(i,c,h){i=i._reactInternals;var m=Wo(),w=Zl(m);w.payload=c,h!=null&&(w.callback=h),c=Ql(i,w,m),c!==null&&(go(c,i,m),Ah(c,i,m))},enqueueReplaceState:function(i,c,h){i=i._reactInternals;var m=Wo(),w=Zl(m);w.tag=1,w.payload=c,h!=null&&(w.callback=h),c=Ql(i,w,m),c!==null&&(go(c,i,m),Ah(c,i,m))},enqueueForceUpdate:function(i,c){i=i._reactInternals;var h=Wo(),m=Zl(h);m.tag=2,c!=null&&(m.callback=c),c=Ql(i,m,h),c!==null&&(go(c,i,h),Ah(c,i,h))}};function A3(i,c,h,m,w,T,U){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(m,T,U):c.prototype&&c.prototype.isPureReactComponent?!xh(h,m)||!xh(w,T):!0}function E3(i,c,h,m){i=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(h,m),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(h,m),c.state!==i&&wv.enqueueReplaceState(c,c.state,null)}function uu(i,c){var h=c;if("ref"in c){h={};for(var m in c)m!=="ref"&&(h[m]=c[m])}if(i=i.defaultProps){h===c&&(h=g({},h));for(var w in i)h[w]===void 0&&(h[w]=i[w])}return h}function T3(i){Fm(i)}function k3(i){console.error(i)}function M3(i){Fm(i)}function nx(i,c){try{var h=i.onUncaughtError;h(c.value,{componentStack:c.stack})}catch(m){setTimeout(function(){throw m})}}function R3(i,c,h){try{var m=i.onCaughtError;m(h.value,{componentStack:h.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(w){setTimeout(function(){throw w})}}function Av(i,c,h){return h=Zl(h),h.tag=3,h.payload={element:null},h.callback=function(){nx(i,c)},h}function z3(i){return i=Zl(i),i.tag=3,i}function I3(i,c,h,m){var w=h.type.getDerivedStateFromError;if(typeof w=="function"){var T=m.value;i.payload=function(){return w(T)},i.callback=function(){R3(c,h,m)}}var U=h.stateNode;U!==null&&typeof U.componentDidCatch=="function"&&(i.callback=function(){R3(c,h,m),typeof w!="function"&&(sc===null?sc=new Set([this]):sc.add(this));var te=m.stack;this.componentDidCatch(m.value,{componentStack:te!==null?te:""})})}function kP(i,c,h,m,w){if(h.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(c=h.alternate,c!==null&&Sd(c,h,w,!0),h=Bo.current,h!==null){switch(h.tag){case 31:case 13:return ci===null?px():h.alternate===null&&Yr===0&&(Yr=3),h.flags&=-257,h.flags|=65536,h.lanes=w,m===Wm?h.flags|=16384:(c=h.updateQueue,c===null?h.updateQueue=new Set([m]):c.add(m),Xv(i,m,w)),!1;case 22:return h.flags|=65536,m===Wm?h.flags|=16384:(c=h.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([m])},h.updateQueue=c):(h=c.retryQueue,h===null?c.retryQueue=new Set([m]):h.add(m)),Xv(i,m,w)),!1}throw Error(s(435,h.tag))}return Xv(i,m,w),px(),!1}if(Pn)return c=Bo.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=w,m!==Uy&&(i=Error(s(422),{cause:m}),vh(oi(i,h)))):(m!==Uy&&(c=Error(s(423),{cause:m}),vh(oi(c,h))),i=i.current.alternate,i.flags|=65536,w&=-w,i.lanes|=w,m=oi(m,h),w=Av(i.stateNode,m,w),tv(i,w),Yr!==4&&(Yr=2)),!1;var T=Error(s(520),{cause:m});if(T=oi(T,h),Bh===null?Bh=[T]:Bh.push(T),Yr!==4&&(Yr=2),c===null)return!0;m=oi(m,h),h=c;do{switch(h.tag){case 3:return h.flags|=65536,i=w&-w,h.lanes|=i,i=Av(h.stateNode,m,i),tv(h,i),!1;case 1:if(c=h.type,T=h.stateNode,(h.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(sc===null||!sc.has(T))))return h.flags|=65536,w&=-w,h.lanes|=w,w=z3(w),I3(w,i,h,m),tv(h,w),!1}h=h.return}while(h!==null);return!1}var Ev=Error(s(461)),us=!1;function Rs(i,c,h,m){c.child=i===null?P4(c,null,h,m):lu(c,i.child,h,m)}function F3(i,c,h,m,w){h=h.render;var T=c.ref;if("ref"in m){var U={};for(var te in m)te!=="ref"&&(U[te]=m[te])}else U=m;return su(c),m=av(i,c,h,U,T,w),te=lv(),i!==null&&!us?(cv(i,c,w),ol(i,c,w)):(Pn&&te&&Hy(c),c.flags|=1,Rs(i,c,m,w),c.child)}function _3(i,c,h,m,w){if(i===null){var T=h.type;return typeof T=="function"&&!By(T)&&T.defaultProps===void 0&&h.compare===null?(c.tag=15,c.type=T,L3(i,c,T,m,w)):(i=Dm(h.type,null,m,c,c.mode,w),i.ref=c.ref,i.return=c,c.child=i)}if(T=i.child,!_v(i,w)){var U=T.memoizedProps;if(h=h.compare,h=h!==null?h:xh,h(U,m)&&i.ref===c.ref)return ol(i,c,w)}return c.flags|=1,i=Ja(T,m),i.ref=c.ref,i.return=c,c.child=i}function L3(i,c,h,m,w){if(i!==null){var T=i.memoizedProps;if(xh(T,m)&&i.ref===c.ref)if(us=!1,c.pendingProps=m=T,_v(i,w))(i.flags&131072)!==0&&(us=!0);else return c.lanes=i.lanes,ol(i,c,w)}return Tv(i,c,h,m,w)}function P3(i,c,h,m){var w=m.children,T=i!==null?i.memoizedState:null;if(i===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((c.flags&128)!==0){if(T=T!==null?T.baseLanes|h:h,i!==null){for(m=c.child=i.child,w=0;m!==null;)w=w|m.lanes|m.childLanes,m=m.sibling;m=w&~T}else m=0,c.child=null;return D3(i,c,T,h,m)}if((h&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},i!==null&&$m(c,T!==null?T.cachePool:null),T!==null?B4(c,T):rv(),N4(c);else return m=c.lanes=536870912,D3(i,c,T!==null?T.baseLanes|h:h,h,m)}else T!==null?($m(c,T.cachePool),B4(c,T),ec(),c.memoizedState=null):(i!==null&&$m(c,null),rv(),ec());return Rs(i,c,w,h),c.child}function Ih(i,c){return i!==null&&i.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function D3(i,c,h,m,w){var T=Zy();return T=T===null?null:{parent:ls._currentValue,pool:T},c.memoizedState={baseLanes:h,cachePool:T},i!==null&&$m(c,null),rv(),N4(c),i!==null&&Sd(i,c,m,!0),c.childLanes=w,null}function rx(i,c){return c=ox({mode:c.mode,children:c.children},i.mode),c.ref=i.ref,i.child=c,c.return=i,c}function O3(i,c,h){return lu(c,i.child,null,h),i=rx(c,c.pendingProps),i.flags|=2,No(c),c.memoizedState=null,i}function MP(i,c,h){var m=c.pendingProps,w=(c.flags&128)!==0;if(c.flags&=-129,i===null){if(Pn){if(m.mode==="hidden")return i=rx(c,m),c.lanes=536870912,Ih(null,i);if(ov(c),(i=Mr)?(i=XA(i,li),i=i!==null&&i.data==="&"?i:null,i!==null&&(c.memoizedState={dehydrated:i,treeContext:Vl!==null?{id:Ca,overflow:wa}:null,retryLane:536870912,hydrationErrors:null},h=S4(i),h.return=c,c.child=h,ks=c,Mr=null)):i=null,i===null)throw Yl(c);return c.lanes=536870912,null}return rx(c,m)}var T=i.memoizedState;if(T!==null){var U=T.dehydrated;if(ov(c),w)if(c.flags&256)c.flags&=-257,c=O3(i,c,h);else if(c.memoizedState!==null)c.child=i.child,c.flags|=128,c=null;else throw Error(s(558));else if(us||Sd(i,c,h,!1),w=(h&i.childLanes)!==0,us||w){if(m=Sr,m!==null&&(U=he(m,h),U!==0&&U!==T.retryLane))throw T.retryLane=U,eu(i,U),go(m,i,U),Ev;px(),c=O3(i,c,h)}else i=T.treeContext,Mr=ui(U.nextSibling),ks=c,Pn=!0,Gl=null,li=!1,i!==null&&w4(c,i),c=rx(c,m),c.flags|=4096;return c}return i=Ja(i.child,{mode:m.mode,children:m.children}),i.ref=c.ref,c.child=i,i.return=c,i}function sx(i,c){var h=c.ref;if(h===null)i!==null&&i.ref!==null&&(c.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(s(284));(i===null||i.ref!==h)&&(c.flags|=4194816)}}function Tv(i,c,h,m,w){return su(c),h=av(i,c,h,m,void 0,w),m=lv(),i!==null&&!us?(cv(i,c,w),ol(i,c,w)):(Pn&&m&&Hy(c),c.flags|=1,Rs(i,c,h,w),c.child)}function B3(i,c,h,m,w,T){return su(c),c.updateQueue=null,h=H4(c,m,h,w),$4(i),m=lv(),i!==null&&!us?(cv(i,c,T),ol(i,c,T)):(Pn&&m&&Hy(c),c.flags|=1,Rs(i,c,h,T),c.child)}function N3(i,c,h,m,w){if(su(c),c.stateNode===null){var T=xd,U=h.contextType;typeof U=="object"&&U!==null&&(T=Ms(U)),T=new h(m,T),c.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,T.updater=wv,c.stateNode=T,T._reactInternals=c,T=c.stateNode,T.props=m,T.state=c.memoizedState,T.refs={},Jy(c),U=h.contextType,T.context=typeof U=="object"&&U!==null?Ms(U):xd,T.state=c.memoizedState,U=h.getDerivedStateFromProps,typeof U=="function"&&(Cv(c,h,U,m),T.state=c.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(U=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),U!==T.state&&wv.enqueueReplaceState(T,T.state,null),Th(c,m,T,w),Eh(),T.state=c.memoizedState),typeof T.componentDidMount=="function"&&(c.flags|=4194308),m=!0}else if(i===null){T=c.stateNode;var te=c.memoizedProps,xe=uu(h,te);T.props=xe;var De=T.context,Ze=h.contextType;U=xd,typeof Ze=="object"&&Ze!==null&&(U=Ms(Ze));var rt=h.getDerivedStateFromProps;Ze=typeof rt=="function"||typeof T.getSnapshotBeforeUpdate=="function",te=c.pendingProps!==te,Ze||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(te||De!==U)&&E3(c,T,m,U),Xl=!1;var Ne=c.memoizedState;T.state=Ne,Th(c,m,T,w),Eh(),De=c.memoizedState,te||Ne!==De||Xl?(typeof rt=="function"&&(Cv(c,h,rt,m),De=c.memoizedState),(xe=Xl||A3(c,h,xe,m,Ne,De,U))?(Ze||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(c.flags|=4194308)):(typeof T.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=m,c.memoizedState=De),T.props=m,T.state=De,T.context=U,m=xe):(typeof T.componentDidMount=="function"&&(c.flags|=4194308),m=!1)}else{T=c.stateNode,ev(i,c),U=c.memoizedProps,Ze=uu(h,U),T.props=Ze,rt=c.pendingProps,Ne=T.context,De=h.contextType,xe=xd,typeof De=="object"&&De!==null&&(xe=Ms(De)),te=h.getDerivedStateFromProps,(De=typeof te=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(U!==rt||Ne!==xe)&&E3(c,T,m,xe),Xl=!1,Ne=c.memoizedState,T.state=Ne,Th(c,m,T,w),Eh();var Ue=c.memoizedState;U!==rt||Ne!==Ue||Xl||i!==null&&i.dependencies!==null&&Bm(i.dependencies)?(typeof te=="function"&&(Cv(c,h,te,m),Ue=c.memoizedState),(Ze=Xl||A3(c,h,Ze,m,Ne,Ue,xe)||i!==null&&i.dependencies!==null&&Bm(i.dependencies))?(De||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(m,Ue,xe),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(m,Ue,xe)),typeof T.componentDidUpdate=="function"&&(c.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof T.componentDidUpdate!="function"||U===i.memoizedProps&&Ne===i.memoizedState||(c.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||U===i.memoizedProps&&Ne===i.memoizedState||(c.flags|=1024),c.memoizedProps=m,c.memoizedState=Ue),T.props=m,T.state=Ue,T.context=xe,m=Ze):(typeof T.componentDidUpdate!="function"||U===i.memoizedProps&&Ne===i.memoizedState||(c.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||U===i.memoizedProps&&Ne===i.memoizedState||(c.flags|=1024),m=!1)}return T=m,sx(i,c),m=(c.flags&128)!==0,T||m?(T=c.stateNode,h=m&&typeof h.getDerivedStateFromError!="function"?null:T.render(),c.flags|=1,i!==null&&m?(c.child=lu(c,i.child,null,w),c.child=lu(c,null,h,w)):Rs(i,c,h,w),c.memoizedState=T.state,i=c.child):i=ol(i,c,w),i}function $3(i,c,h,m){return nu(),c.flags|=256,Rs(i,c,h,m),c.child}var kv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Mv(i){return{baseLanes:i,cachePool:R4()}}function Rv(i,c,h){return i=i!==null?i.childLanes&~h:0,c&&(i|=Ho),i}function H3(i,c,h){var m=c.pendingProps,w=!1,T=(c.flags&128)!==0,U;if((U=T)||(U=i!==null&&i.memoizedState===null?!1:(Jr.current&2)!==0),U&&(w=!0,c.flags&=-129),U=(c.flags&32)!==0,c.flags&=-33,i===null){if(Pn){if(w?Jl(c):ec(),(i=Mr)?(i=XA(i,li),i=i!==null&&i.data!=="&"?i:null,i!==null&&(c.memoizedState={dehydrated:i,treeContext:Vl!==null?{id:Ca,overflow:wa}:null,retryLane:536870912,hydrationErrors:null},h=S4(i),h.return=c,c.child=h,ks=c,Mr=null)):i=null,i===null)throw Yl(c);return f2(i)?c.lanes=32:c.lanes=536870912,null}var te=m.children;return m=m.fallback,w?(ec(),w=c.mode,te=ox({mode:"hidden",children:te},w),m=tu(m,w,h,null),te.return=c,m.return=c,te.sibling=m,c.child=te,m=c.child,m.memoizedState=Mv(h),m.childLanes=Rv(i,U,h),c.memoizedState=kv,Ih(null,m)):(Jl(c),zv(c,te))}var xe=i.memoizedState;if(xe!==null&&(te=xe.dehydrated,te!==null)){if(T)c.flags&256?(Jl(c),c.flags&=-257,c=Iv(i,c,h)):c.memoizedState!==null?(ec(),c.child=i.child,c.flags|=128,c=null):(ec(),te=m.fallback,w=c.mode,m=ox({mode:"visible",children:m.children},w),te=tu(te,w,h,null),te.flags|=2,m.return=c,te.return=c,m.sibling=te,c.child=m,lu(c,i.child,null,h),m=c.child,m.memoizedState=Mv(h),m.childLanes=Rv(i,U,h),c.memoizedState=kv,c=Ih(null,m));else if(Jl(c),f2(te)){if(U=te.nextSibling&&te.nextSibling.dataset,U)var De=U.dgst;U=De,m=Error(s(419)),m.stack="",m.digest=U,vh({value:m,source:null,stack:null}),c=Iv(i,c,h)}else if(us||Sd(i,c,h,!1),U=(h&i.childLanes)!==0,us||U){if(U=Sr,U!==null&&(m=he(U,h),m!==0&&m!==xe.retryLane))throw xe.retryLane=m,eu(i,m),go(U,i,m),Ev;d2(te)||px(),c=Iv(i,c,h)}else d2(te)?(c.flags|=192,c.child=i.child,c=null):(i=xe.treeContext,Mr=ui(te.nextSibling),ks=c,Pn=!0,Gl=null,li=!1,i!==null&&w4(c,i),c=zv(c,m.children),c.flags|=4096);return c}return w?(ec(),te=m.fallback,w=c.mode,xe=i.child,De=xe.sibling,m=Ja(xe,{mode:"hidden",children:m.children}),m.subtreeFlags=xe.subtreeFlags&65011712,De!==null?te=Ja(De,te):(te=tu(te,w,h,null),te.flags|=2),te.return=c,m.return=c,m.sibling=te,c.child=m,Ih(null,m),m=c.child,te=i.child.memoizedState,te===null?te=Mv(h):(w=te.cachePool,w!==null?(xe=ls._currentValue,w=w.parent!==xe?{parent:xe,pool:xe}:w):w=R4(),te={baseLanes:te.baseLanes|h,cachePool:w}),m.memoizedState=te,m.childLanes=Rv(i,U,h),c.memoizedState=kv,Ih(i.child,m)):(Jl(c),h=i.child,i=h.sibling,h=Ja(h,{mode:"visible",children:m.children}),h.return=c,h.sibling=null,i!==null&&(U=c.deletions,U===null?(c.deletions=[i],c.flags|=16):U.push(i)),c.child=h,c.memoizedState=null,h)}function zv(i,c){return c=ox({mode:"visible",children:c},i.mode),c.return=i,i.child=c}function ox(i,c){return i=Oo(22,i,null,c),i.lanes=0,i}function Iv(i,c,h){return lu(c,i.child,null,h),i=zv(c,c.pendingProps.children),i.flags|=2,c.memoizedState=null,i}function W3(i,c,h){i.lanes|=c;var m=i.alternate;m!==null&&(m.lanes|=c),Gy(i.return,c,h)}function Fv(i,c,h,m,w,T){var U=i.memoizedState;U===null?i.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:m,tail:h,tailMode:w,treeForkCount:T}:(U.isBackwards=c,U.rendering=null,U.renderingStartTime=0,U.last=m,U.tail=h,U.tailMode=w,U.treeForkCount=T)}function U3(i,c,h){var m=c.pendingProps,w=m.revealOrder,T=m.tail;m=m.children;var U=Jr.current,te=(U&2)!==0;if(te?(U=U&1|2,c.flags|=128):U&=1,fe(Jr,U),Rs(i,c,m,h),m=Pn?yh:0,!te&&i!==null&&(i.flags&128)!==0)e:for(i=c.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&W3(i,h,c);else if(i.tag===19)W3(i,h,c);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===c)break e;for(;i.sibling===null;){if(i.return===null||i.return===c)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(w){case"forwards":for(h=c.child,w=null;h!==null;)i=h.alternate,i!==null&&Gm(i)===null&&(w=h),h=h.sibling;h=w,h===null?(w=c.child,c.child=null):(w=h.sibling,h.sibling=null),Fv(c,!1,w,h,T,m);break;case"backwards":case"unstable_legacy-backwards":for(h=null,w=c.child,c.child=null;w!==null;){if(i=w.alternate,i!==null&&Gm(i)===null){c.child=w;break}i=w.sibling,w.sibling=h,h=w,w=i}Fv(c,!0,h,null,T,m);break;case"together":Fv(c,!1,null,null,void 0,m);break;default:c.memoizedState=null}return c.child}function ol(i,c,h){if(i!==null&&(c.dependencies=i.dependencies),rc|=c.lanes,(h&c.childLanes)===0)if(i!==null){if(Sd(i,c,h,!1),(h&c.childLanes)===0)return null}else return null;if(i!==null&&c.child!==i.child)throw Error(s(153));if(c.child!==null){for(i=c.child,h=Ja(i,i.pendingProps),c.child=h,h.return=c;i.sibling!==null;)i=i.sibling,h=h.sibling=Ja(i,i.pendingProps),h.return=c;h.sibling=null}return c.child}function _v(i,c){return(i.lanes&c)!==0?!0:(i=i.dependencies,!!(i!==null&&Bm(i)))}function RP(i,c,h){switch(c.tag){case 3:ce(c,c.stateNode.containerInfo),Kl(c,ls,i.memoizedState.cache),nu();break;case 27:case 5:ge(c);break;case 4:ce(c,c.stateNode.containerInfo);break;case 10:Kl(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,ov(c),null;break;case 13:var m=c.memoizedState;if(m!==null)return m.dehydrated!==null?(Jl(c),c.flags|=128,null):(h&c.child.childLanes)!==0?H3(i,c,h):(Jl(c),i=ol(i,c,h),i!==null?i.sibling:null);Jl(c);break;case 19:var w=(i.flags&128)!==0;if(m=(h&c.childLanes)!==0,m||(Sd(i,c,h,!1),m=(h&c.childLanes)!==0),w){if(m)return U3(i,c,h);c.flags|=128}if(w=c.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),fe(Jr,Jr.current),m)break;return null;case 22:return c.lanes=0,P3(i,c,h,c.pendingProps);case 24:Kl(c,ls,i.memoizedState.cache)}return ol(i,c,h)}function q3(i,c,h){if(i!==null)if(i.memoizedProps!==c.pendingProps)us=!0;else{if(!_v(i,h)&&(c.flags&128)===0)return us=!1,RP(i,c,h);us=(i.flags&131072)!==0}else us=!1,Pn&&(c.flags&1048576)!==0&&C4(c,yh,c.index);switch(c.lanes=0,c.tag){case 16:e:{var m=c.pendingProps;if(i=iu(c.elementType),c.type=i,typeof i=="function")By(i)?(m=uu(i,m),c.tag=1,c=N3(null,c,i,m,h)):(c.tag=0,c=Tv(null,c,i,m,h));else{if(i!=null){var w=i.$$typeof;if(w===_){c.tag=11,c=F3(null,c,i,m,h);break e}else if(w===N){c.tag=14,c=_3(null,c,i,m,h);break e}}throw c=O(i)||i,Error(s(306,c,""))}}return c;case 0:return Tv(i,c,c.type,c.pendingProps,h);case 1:return m=c.type,w=uu(m,c.pendingProps),N3(i,c,m,w,h);case 3:e:{if(ce(c,c.stateNode.containerInfo),i===null)throw Error(s(387));m=c.pendingProps;var T=c.memoizedState;w=T.element,ev(i,c),Th(c,m,null,h);var U=c.memoizedState;if(m=U.cache,Kl(c,ls,m),m!==T.cache&&Yy(c,[ls],h,!0),Eh(),m=U.element,T.isDehydrated)if(T={element:m,isDehydrated:!1,cache:U.cache},c.updateQueue.baseState=T,c.memoizedState=T,c.flags&256){c=$3(i,c,m,h);break e}else if(m!==w){w=oi(Error(s(424)),c),vh(w),c=$3(i,c,m,h);break e}else for(i=c.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,Mr=ui(i.firstChild),ks=c,Pn=!0,Gl=null,li=!0,h=P4(c,null,m,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(nu(),m===w){c=ol(i,c,h);break e}Rs(i,c,m,h)}c=c.child}return c;case 26:return sx(i,c),i===null?(h=nE(c.type,null,c.pendingProps,null))?c.memoizedState=h:Pn||(h=c.type,i=c.pendingProps,m=Sx(se.current).createElement(h),m[at]=c,m[lt]=i,zs(m,h,i),Lt(m),c.stateNode=m):c.memoizedState=nE(c.type,i.memoizedProps,c.pendingProps,i.memoizedState),null;case 27:return ge(c),i===null&&Pn&&(m=c.stateNode=JA(c.type,c.pendingProps,se.current),ks=c,li=!0,w=Mr,lc(c.type)?(h2=w,Mr=ui(m.firstChild)):Mr=w),Rs(i,c,c.pendingProps.children,h),sx(i,c),i===null&&(c.flags|=4194304),c.child;case 5:return i===null&&Pn&&((w=m=Mr)&&(m=iD(m,c.type,c.pendingProps,li),m!==null?(c.stateNode=m,ks=c,Mr=ui(m.firstChild),li=!1,w=!0):w=!1),w||Yl(c)),ge(c),w=c.type,T=c.pendingProps,U=i!==null?i.memoizedProps:null,m=T.children,l2(w,T)?m=null:U!==null&&l2(w,U)&&(c.flags|=32),c.memoizedState!==null&&(w=av(i,c,SP,null,null,h),Gh._currentValue=w),sx(i,c),Rs(i,c,m,h),c.child;case 6:return i===null&&Pn&&((i=h=Mr)&&(h=aD(h,c.pendingProps,li),h!==null?(c.stateNode=h,ks=c,Mr=null,i=!0):i=!1),i||Yl(c)),null;case 13:return H3(i,c,h);case 4:return ce(c,c.stateNode.containerInfo),m=c.pendingProps,i===null?c.child=lu(c,null,m,h):Rs(i,c,m,h),c.child;case 11:return F3(i,c,c.type,c.pendingProps,h);case 7:return Rs(i,c,c.pendingProps,h),c.child;case 8:return Rs(i,c,c.pendingProps.children,h),c.child;case 12:return Rs(i,c,c.pendingProps.children,h),c.child;case 10:return m=c.pendingProps,Kl(c,c.type,m.value),Rs(i,c,m.children,h),c.child;case 9:return w=c.type._context,m=c.pendingProps.children,su(c),w=Ms(w),m=m(w),c.flags|=1,Rs(i,c,m,h),c.child;case 14:return _3(i,c,c.type,c.pendingProps,h);case 15:return L3(i,c,c.type,c.pendingProps,h);case 19:return U3(i,c,h);case 31:return MP(i,c,h);case 22:return P3(i,c,h,c.pendingProps);case 24:return su(c),m=Ms(ls),i===null?(w=Zy(),w===null&&(w=Sr,T=Ky(),w.pooledCache=T,T.refCount++,T!==null&&(w.pooledCacheLanes|=h),w=T),c.memoizedState={parent:m,cache:w},Jy(c),Kl(c,ls,w)):((i.lanes&h)!==0&&(ev(i,c),Th(c,null,null,h),Eh()),w=i.memoizedState,T=c.memoizedState,w.parent!==m?(w={parent:m,cache:m},c.memoizedState=w,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=w),Kl(c,ls,m)):(m=T.cache,Kl(c,ls,m),m!==w.cache&&Yy(c,[ls],h,!0))),Rs(i,c,c.pendingProps.children,h),c.child;case 29:throw c.pendingProps}throw Error(s(156,c.tag))}function il(i){i.flags|=4}function Lv(i,c,h,m,w){if((c=(i.mode&32)!==0)&&(c=!1),c){if(i.flags|=16777216,(w&335544128)===w)if(i.stateNode.complete)i.flags|=8192;else if(bA())i.flags|=8192;else throw au=Wm,Qy}else i.flags&=-16777217}function V3(i,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!aE(c))if(bA())i.flags|=8192;else throw au=Wm,Qy}function ix(i,c){c!==null&&(i.flags|=4),i.flags&16384&&(c=i.tag!==22?Ht():536870912,i.lanes|=c,Fd|=c)}function Fh(i,c){if(!Pn)switch(i.tailMode){case"hidden":c=i.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?i.tail=null:h.sibling=null;break;case"collapsed":h=i.tail;for(var m=null;h!==null;)h.alternate!==null&&(m=h),h=h.sibling;m===null?c||i.tail===null?i.tail=null:i.tail.sibling=null:m.sibling=null}}function Rr(i){var c=i.alternate!==null&&i.alternate.child===i.child,h=0,m=0;if(c)for(var w=i.child;w!==null;)h|=w.lanes|w.childLanes,m|=w.subtreeFlags&65011712,m|=w.flags&65011712,w.return=i,w=w.sibling;else for(w=i.child;w!==null;)h|=w.lanes|w.childLanes,m|=w.subtreeFlags,m|=w.flags,w.return=i,w=w.sibling;return i.subtreeFlags|=m,i.childLanes=h,c}function zP(i,c,h){var m=c.pendingProps;switch(Wy(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rr(c),null;case 1:return Rr(c),null;case 3:return h=c.stateNode,m=null,i!==null&&(m=i.memoizedState.cache),c.memoizedState.cache!==m&&(c.flags|=2048),nl(ls),oe(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(i===null||i.child===null)&&(vd(c)?il(c):i===null||i.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,qy())),Rr(c),null;case 26:var w=c.type,T=c.memoizedState;return i===null?(il(c),T!==null?(Rr(c),V3(c,T)):(Rr(c),Lv(c,w,null,m,h))):T?T!==i.memoizedState?(il(c),Rr(c),V3(c,T)):(Rr(c),c.flags&=-16777217):(i=i.memoizedProps,i!==m&&il(c),Rr(c),Lv(c,w,i,m,h)),null;case 27:if(de(c),h=se.current,w=c.type,i!==null&&c.stateNode!=null)i.memoizedProps!==m&&il(c);else{if(!m){if(c.stateNode===null)throw Error(s(166));return Rr(c),null}i=ae.current,vd(c)?A4(c):(i=JA(w,m,h),c.stateNode=i,il(c))}return Rr(c),null;case 5:if(de(c),w=c.type,i!==null&&c.stateNode!=null)i.memoizedProps!==m&&il(c);else{if(!m){if(c.stateNode===null)throw Error(s(166));return Rr(c),null}if(T=ae.current,vd(c))A4(c);else{var U=Sx(se.current);switch(T){case 1:T=U.createElementNS("http://www.w3.org/2000/svg",w);break;case 2:T=U.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;default:switch(w){case"svg":T=U.createElementNS("http://www.w3.org/2000/svg",w);break;case"math":T=U.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;case"script":T=U.createElement("div"),T.innerHTML="<script><\/script>",T=T.removeChild(T.firstChild);break;case"select":T=typeof m.is=="string"?U.createElement("select",{is:m.is}):U.createElement("select"),m.multiple?T.multiple=!0:m.size&&(T.size=m.size);break;default:T=typeof m.is=="string"?U.createElement(w,{is:m.is}):U.createElement(w)}}T[at]=c,T[lt]=m;e:for(U=c.child;U!==null;){if(U.tag===5||U.tag===6)T.appendChild(U.stateNode);else if(U.tag!==4&&U.tag!==27&&U.child!==null){U.child.return=U,U=U.child;continue}if(U===c)break e;for(;U.sibling===null;){if(U.return===null||U.return===c)break e;U=U.return}U.sibling.return=U.return,U=U.sibling}c.stateNode=T;e:switch(zs(T,w,m),w){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&il(c)}}return Rr(c),Lv(c,c.type,i===null?null:i.memoizedProps,c.pendingProps,h),null;case 6:if(i&&c.stateNode!=null)i.memoizedProps!==m&&il(c);else{if(typeof m!="string"&&c.stateNode===null)throw Error(s(166));if(i=se.current,vd(c)){if(i=c.stateNode,h=c.memoizedProps,m=null,w=ks,w!==null)switch(w.tag){case 27:case 5:m=w.memoizedProps}i[at]=c,i=!!(i.nodeValue===h||m!==null&&m.suppressHydrationWarning===!0||HA(i.nodeValue,h)),i||Yl(c,!0)}else i=Sx(i).createTextNode(m),i[at]=c,c.stateNode=i}return Rr(c),null;case 31:if(h=c.memoizedState,i===null||i.memoizedState!==null){if(m=vd(c),h!==null){if(i===null){if(!m)throw Error(s(318));if(i=c.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(557));i[at]=c}else nu(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Rr(c),i=!1}else h=qy(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=h),i=!0;if(!i)return c.flags&256?(No(c),c):(No(c),null);if((c.flags&128)!==0)throw Error(s(558))}return Rr(c),null;case 13:if(m=c.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(w=vd(c),m!==null&&m.dehydrated!==null){if(i===null){if(!w)throw Error(s(318));if(w=c.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(s(317));w[at]=c}else nu(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Rr(c),w=!1}else w=qy(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=w),w=!0;if(!w)return c.flags&256?(No(c),c):(No(c),null)}return No(c),(c.flags&128)!==0?(c.lanes=h,c):(h=m!==null,i=i!==null&&i.memoizedState!==null,h&&(m=c.child,w=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(w=m.alternate.memoizedState.cachePool.pool),T=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(T=m.memoizedState.cachePool.pool),T!==w&&(m.flags|=2048)),h!==i&&h&&(c.child.flags|=8192),ix(c,c.updateQueue),Rr(c),null);case 4:return oe(),i===null&&r2(c.stateNode.containerInfo),Rr(c),null;case 10:return nl(c.type),Rr(c),null;case 19:if(re(Jr),m=c.memoizedState,m===null)return Rr(c),null;if(w=(c.flags&128)!==0,T=m.rendering,T===null)if(w)Fh(m,!1);else{if(Yr!==0||i!==null&&(i.flags&128)!==0)for(i=c.child;i!==null;){if(T=Gm(i),T!==null){for(c.flags|=128,Fh(m,!1),i=T.updateQueue,c.updateQueue=i,ix(c,i),c.subtreeFlags=0,i=h,h=c.child;h!==null;)v4(h,i),h=h.sibling;return fe(Jr,Jr.current&1|2),Pn&&el(c,m.treeForkCount),c.child}i=i.sibling}m.tail!==null&&ot()>dx&&(c.flags|=128,w=!0,Fh(m,!1),c.lanes=4194304)}else{if(!w)if(i=Gm(T),i!==null){if(c.flags|=128,w=!0,i=i.updateQueue,c.updateQueue=i,ix(c,i),Fh(m,!0),m.tail===null&&m.tailMode==="hidden"&&!T.alternate&&!Pn)return Rr(c),null}else 2*ot()-m.renderingStartTime>dx&&h!==536870912&&(c.flags|=128,w=!0,Fh(m,!1),c.lanes=4194304);m.isBackwards?(T.sibling=c.child,c.child=T):(i=m.last,i!==null?i.sibling=T:c.child=T,m.last=T)}return m.tail!==null?(i=m.tail,m.rendering=i,m.tail=i.sibling,m.renderingStartTime=ot(),i.sibling=null,h=Jr.current,fe(Jr,w?h&1|2:h&1),Pn&&el(c,m.treeForkCount),i):(Rr(c),null);case 22:case 23:return No(c),sv(),m=c.memoizedState!==null,i!==null?i.memoizedState!==null!==m&&(c.flags|=8192):m&&(c.flags|=8192),m?(h&536870912)!==0&&(c.flags&128)===0&&(Rr(c),c.subtreeFlags&6&&(c.flags|=8192)):Rr(c),h=c.updateQueue,h!==null&&ix(c,h.retryQueue),h=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),m=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(m=c.memoizedState.cachePool.pool),m!==h&&(c.flags|=2048),i!==null&&re(ou),null;case 24:return h=null,i!==null&&(h=i.memoizedState.cache),c.memoizedState.cache!==h&&(c.flags|=2048),nl(ls),Rr(c),null;case 25:return null;case 30:return null}throw Error(s(156,c.tag))}function IP(i,c){switch(Wy(c),c.tag){case 1:return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 3:return nl(ls),oe(),i=c.flags,(i&65536)!==0&&(i&128)===0?(c.flags=i&-65537|128,c):null;case 26:case 27:case 5:return de(c),null;case 31:if(c.memoizedState!==null){if(No(c),c.alternate===null)throw Error(s(340));nu()}return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 13:if(No(c),i=c.memoizedState,i!==null&&i.dehydrated!==null){if(c.alternate===null)throw Error(s(340));nu()}return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 19:return re(Jr),null;case 4:return oe(),null;case 10:return nl(c.type),null;case 22:case 23:return No(c),sv(),i!==null&&re(ou),i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 24:return nl(ls),null;case 25:return null;default:return null}}function G3(i,c){switch(Wy(c),c.tag){case 3:nl(ls),oe();break;case 26:case 27:case 5:de(c);break;case 4:oe();break;case 31:c.memoizedState!==null&&No(c);break;case 13:No(c);break;case 19:re(Jr);break;case 10:nl(c.type);break;case 22:case 23:No(c),sv(),i!==null&&re(ou);break;case 24:nl(ls)}}function _h(i,c){try{var h=c.updateQueue,m=h!==null?h.lastEffect:null;if(m!==null){var w=m.next;h=w;do{if((h.tag&i)===i){m=void 0;var T=h.create,U=h.inst;m=T(),U.destroy=m}h=h.next}while(h!==w)}}catch(te){cr(c,c.return,te)}}function tc(i,c,h){try{var m=c.updateQueue,w=m!==null?m.lastEffect:null;if(w!==null){var T=w.next;m=T;do{if((m.tag&i)===i){var U=m.inst,te=U.destroy;if(te!==void 0){U.destroy=void 0,w=c;var xe=h,De=te;try{De()}catch(Ze){cr(w,xe,Ze)}}}m=m.next}while(m!==T)}}catch(Ze){cr(c,c.return,Ze)}}function Y3(i){var c=i.updateQueue;if(c!==null){var h=i.stateNode;try{O4(c,h)}catch(m){cr(i,i.return,m)}}}function K3(i,c,h){h.props=uu(i.type,i.memoizedProps),h.state=i.memoizedState;try{h.componentWillUnmount()}catch(m){cr(i,c,m)}}function Lh(i,c){try{var h=i.ref;if(h!==null){switch(i.tag){case 26:case 27:case 5:var m=i.stateNode;break;case 30:m=i.stateNode;break;default:m=i.stateNode}typeof h=="function"?i.refCleanup=h(m):h.current=m}}catch(w){cr(i,c,w)}}function Aa(i,c){var h=i.ref,m=i.refCleanup;if(h!==null)if(typeof m=="function")try{m()}catch(w){cr(i,c,w)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(w){cr(i,c,w)}else h.current=null}function X3(i){var c=i.type,h=i.memoizedProps,m=i.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":h.autoFocus&&m.focus();break e;case"img":h.src?m.src=h.src:h.srcSet&&(m.srcset=h.srcSet)}}catch(w){cr(i,i.return,w)}}function Pv(i,c,h){try{var m=i.stateNode;eD(m,i.type,h,c),m[lt]=c}catch(w){cr(i,i.return,w)}}function Z3(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&lc(i.type)||i.tag===4}function Dv(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Z3(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&lc(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Ov(i,c,h){var m=i.tag;if(m===5||m===6)i=i.stateNode,c?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(i,c):(c=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,c.appendChild(i),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=co));else if(m!==4&&(m===27&&lc(i.type)&&(h=i.stateNode,c=null),i=i.child,i!==null))for(Ov(i,c,h),i=i.sibling;i!==null;)Ov(i,c,h),i=i.sibling}function ax(i,c,h){var m=i.tag;if(m===5||m===6)i=i.stateNode,c?h.insertBefore(i,c):h.appendChild(i);else if(m!==4&&(m===27&&lc(i.type)&&(h=i.stateNode),i=i.child,i!==null))for(ax(i,c,h),i=i.sibling;i!==null;)ax(i,c,h),i=i.sibling}function Q3(i){var c=i.stateNode,h=i.memoizedProps;try{for(var m=i.type,w=c.attributes;w.length;)c.removeAttributeNode(w[0]);zs(c,m,h),c[at]=i,c[lt]=h}catch(T){cr(i,i.return,T)}}var al=!1,ds=!1,Bv=!1,J3=typeof WeakSet=="function"?WeakSet:Set,ws=null;function FP(i,c){if(i=i.containerInfo,i2=kx,i=d4(i),Iy(i)){if("selectionStart"in i)var h={start:i.selectionStart,end:i.selectionEnd};else e:{h=(h=i.ownerDocument)&&h.defaultView||window;var m=h.getSelection&&h.getSelection();if(m&&m.rangeCount!==0){h=m.anchorNode;var w=m.anchorOffset,T=m.focusNode;m=m.focusOffset;try{h.nodeType,T.nodeType}catch{h=null;break e}var U=0,te=-1,xe=-1,De=0,Ze=0,rt=i,Ne=null;t:for(;;){for(var Ue;rt!==h||w!==0&&rt.nodeType!==3||(te=U+w),rt!==T||m!==0&&rt.nodeType!==3||(xe=U+m),rt.nodeType===3&&(U+=rt.nodeValue.length),(Ue=rt.firstChild)!==null;)Ne=rt,rt=Ue;for(;;){if(rt===i)break t;if(Ne===h&&++De===w&&(te=U),Ne===T&&++Ze===m&&(xe=U),(Ue=rt.nextSibling)!==null)break;rt=Ne,Ne=rt.parentNode}rt=Ue}h=te===-1||xe===-1?null:{start:te,end:xe}}else h=null}h=h||{start:0,end:0}}else h=null;for(a2={focusedElem:i,selectionRange:h},kx=!1,ws=c;ws!==null;)if(c=ws,i=c.child,(c.subtreeFlags&1028)!==0&&i!==null)i.return=c,ws=i;else for(;ws!==null;){switch(c=ws,T=c.alternate,i=c.flags,c.tag){case 0:if((i&4)!==0&&(i=c.updateQueue,i=i!==null?i.events:null,i!==null))for(h=0;h<i.length;h++)w=i[h],w.ref.impl=w.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&T!==null){i=void 0,h=c,w=T.memoizedProps,T=T.memoizedState,m=h.stateNode;try{var Ot=uu(h.type,w);i=m.getSnapshotBeforeUpdate(Ot,T),m.__reactInternalSnapshotBeforeUpdate=i}catch(en){cr(h,h.return,en)}}break;case 3:if((i&1024)!==0){if(i=c.stateNode.containerInfo,h=i.nodeType,h===9)u2(i);else if(h===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":u2(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(s(163))}if(i=c.sibling,i!==null){i.return=c.return,ws=i;break}ws=c.return}}function eA(i,c,h){var m=h.flags;switch(h.tag){case 0:case 11:case 15:cl(i,h),m&4&&_h(5,h);break;case 1:if(cl(i,h),m&4)if(i=h.stateNode,c===null)try{i.componentDidMount()}catch(U){cr(h,h.return,U)}else{var w=uu(h.type,c.memoizedProps);c=c.memoizedState;try{i.componentDidUpdate(w,c,i.__reactInternalSnapshotBeforeUpdate)}catch(U){cr(h,h.return,U)}}m&64&&Y3(h),m&512&&Lh(h,h.return);break;case 3:if(cl(i,h),m&64&&(i=h.updateQueue,i!==null)){if(c=null,h.child!==null)switch(h.child.tag){case 27:case 5:c=h.child.stateNode;break;case 1:c=h.child.stateNode}try{O4(i,c)}catch(U){cr(h,h.return,U)}}break;case 27:c===null&&m&4&&Q3(h);case 26:case 5:cl(i,h),c===null&&m&4&&X3(h),m&512&&Lh(h,h.return);break;case 12:cl(i,h);break;case 31:cl(i,h),m&4&&rA(i,h);break;case 13:cl(i,h),m&4&&sA(i,h),m&64&&(i=h.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(h=HP.bind(null,h),lD(i,h))));break;case 22:if(m=h.memoizedState!==null||al,!m){c=c!==null&&c.memoizedState!==null||ds,w=al;var T=ds;al=m,(ds=c)&&!T?ul(i,h,(h.subtreeFlags&8772)!==0):cl(i,h),al=w,ds=T}break;case 30:break;default:cl(i,h)}}function tA(i){var c=i.alternate;c!==null&&(i.alternate=null,tA(c)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(c=i.stateNode,c!==null&&An(c)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Lr=null,uo=!1;function ll(i,c,h){for(h=h.child;h!==null;)nA(i,c,h),h=h.sibling}function nA(i,c,h){if(ct&&typeof ct.onCommitFiberUnmount=="function")try{ct.onCommitFiberUnmount(ht,h)}catch{}switch(h.tag){case 26:ds||Aa(h,c),ll(i,c,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:ds||Aa(h,c);var m=Lr,w=uo;lc(h.type)&&(Lr=h.stateNode,uo=!1),ll(i,c,h),Uh(h.stateNode),Lr=m,uo=w;break;case 5:ds||Aa(h,c);case 6:if(m=Lr,w=uo,Lr=null,ll(i,c,h),Lr=m,uo=w,Lr!==null)if(uo)try{(Lr.nodeType===9?Lr.body:Lr.nodeName==="HTML"?Lr.ownerDocument.body:Lr).removeChild(h.stateNode)}catch(T){cr(h,c,T)}else try{Lr.removeChild(h.stateNode)}catch(T){cr(h,c,T)}break;case 18:Lr!==null&&(uo?(i=Lr,YA(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,h.stateNode),$d(i)):YA(Lr,h.stateNode));break;case 4:m=Lr,w=uo,Lr=h.stateNode.containerInfo,uo=!0,ll(i,c,h),Lr=m,uo=w;break;case 0:case 11:case 14:case 15:tc(2,h,c),ds||tc(4,h,c),ll(i,c,h);break;case 1:ds||(Aa(h,c),m=h.stateNode,typeof m.componentWillUnmount=="function"&&K3(h,c,m)),ll(i,c,h);break;case 21:ll(i,c,h);break;case 22:ds=(m=ds)||h.memoizedState!==null,ll(i,c,h),ds=m;break;default:ll(i,c,h)}}function rA(i,c){if(c.memoizedState===null&&(i=c.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{$d(i)}catch(h){cr(c,c.return,h)}}}function sA(i,c){if(c.memoizedState===null&&(i=c.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{$d(i)}catch(h){cr(c,c.return,h)}}function _P(i){switch(i.tag){case 31:case 13:case 19:var c=i.stateNode;return c===null&&(c=i.stateNode=new J3),c;case 22:return i=i.stateNode,c=i._retryCache,c===null&&(c=i._retryCache=new J3),c;default:throw Error(s(435,i.tag))}}function lx(i,c){var h=_P(i);c.forEach(function(m){if(!h.has(m)){h.add(m);var w=WP.bind(null,i,m);m.then(w,w)}})}function fo(i,c){var h=c.deletions;if(h!==null)for(var m=0;m<h.length;m++){var w=h[m],T=i,U=c,te=U;e:for(;te!==null;){switch(te.tag){case 27:if(lc(te.type)){Lr=te.stateNode,uo=!1;break e}break;case 5:Lr=te.stateNode,uo=!1;break e;case 3:case 4:Lr=te.stateNode.containerInfo,uo=!0;break e}te=te.return}if(Lr===null)throw Error(s(160));nA(T,U,w),Lr=null,uo=!1,T=w.alternate,T!==null&&(T.return=null),w.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)oA(c,i),c=c.sibling}var Xi=null;function oA(i,c){var h=i.alternate,m=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:fo(c,i),ho(i),m&4&&(tc(3,i,i.return),_h(3,i),tc(5,i,i.return));break;case 1:fo(c,i),ho(i),m&512&&(ds||h===null||Aa(h,h.return)),m&64&&al&&(i=i.updateQueue,i!==null&&(m=i.callbacks,m!==null&&(h=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=h===null?m:h.concat(m))));break;case 26:var w=Xi;if(fo(c,i),ho(i),m&512&&(ds||h===null||Aa(h,h.return)),m&4){var T=h!==null?h.memoizedState:null;if(m=i.memoizedState,h===null)if(m===null)if(i.stateNode===null){e:{m=i.type,h=i.memoizedProps,w=w.ownerDocument||w;t:switch(m){case"title":T=w.getElementsByTagName("title")[0],(!T||T[cn]||T[at]||T.namespaceURI==="http://www.w3.org/2000/svg"||T.hasAttribute("itemprop"))&&(T=w.createElement(m),w.head.insertBefore(T,w.querySelector("head > title"))),zs(T,m,h),T[at]=i,Lt(T),m=T;break e;case"link":var U=oE("link","href",w).get(m+(h.href||""));if(U){for(var te=0;te<U.length;te++)if(T=U[te],T.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&T.getAttribute("rel")===(h.rel==null?null:h.rel)&&T.getAttribute("title")===(h.title==null?null:h.title)&&T.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){U.splice(te,1);break t}}T=w.createElement(m),zs(T,m,h),w.head.appendChild(T);break;case"meta":if(U=oE("meta","content",w).get(m+(h.content||""))){for(te=0;te<U.length;te++)if(T=U[te],T.getAttribute("content")===(h.content==null?null:""+h.content)&&T.getAttribute("name")===(h.name==null?null:h.name)&&T.getAttribute("property")===(h.property==null?null:h.property)&&T.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&T.getAttribute("charset")===(h.charSet==null?null:h.charSet)){U.splice(te,1);break t}}T=w.createElement(m),zs(T,m,h),w.head.appendChild(T);break;default:throw Error(s(468,m))}T[at]=i,Lt(T),m=T}i.stateNode=m}else iE(w,i.type,i.stateNode);else i.stateNode=sE(w,m,i.memoizedProps);else T!==m?(T===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):T.count--,m===null?iE(w,i.type,i.stateNode):sE(w,m,i.memoizedProps)):m===null&&i.stateNode!==null&&Pv(i,i.memoizedProps,h.memoizedProps)}break;case 27:fo(c,i),ho(i),m&512&&(ds||h===null||Aa(h,h.return)),h!==null&&m&4&&Pv(i,i.memoizedProps,h.memoizedProps);break;case 5:if(fo(c,i),ho(i),m&512&&(ds||h===null||Aa(h,h.return)),i.flags&32){w=i.stateNode;try{Ps(w,"")}catch(Ot){cr(i,i.return,Ot)}}m&4&&i.stateNode!=null&&(w=i.memoizedProps,Pv(i,w,h!==null?h.memoizedProps:w)),m&1024&&(Bv=!0);break;case 6:if(fo(c,i),ho(i),m&4){if(i.stateNode===null)throw Error(s(162));m=i.memoizedProps,h=i.stateNode;try{h.nodeValue=m}catch(Ot){cr(i,i.return,Ot)}}break;case 3:if(wx=null,w=Xi,Xi=jx(c.containerInfo),fo(c,i),Xi=w,ho(i),m&4&&h!==null&&h.memoizedState.isDehydrated)try{$d(c.containerInfo)}catch(Ot){cr(i,i.return,Ot)}Bv&&(Bv=!1,iA(i));break;case 4:m=Xi,Xi=jx(i.stateNode.containerInfo),fo(c,i),ho(i),Xi=m;break;case 12:fo(c,i),ho(i);break;case 31:fo(c,i),ho(i),m&4&&(m=i.updateQueue,m!==null&&(i.updateQueue=null,lx(i,m)));break;case 13:fo(c,i),ho(i),i.child.flags&8192&&i.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(ux=ot()),m&4&&(m=i.updateQueue,m!==null&&(i.updateQueue=null,lx(i,m)));break;case 22:w=i.memoizedState!==null;var xe=h!==null&&h.memoizedState!==null,De=al,Ze=ds;if(al=De||w,ds=Ze||xe,fo(c,i),ds=Ze,al=De,ho(i),m&8192)e:for(c=i.stateNode,c._visibility=w?c._visibility&-2:c._visibility|1,w&&(h===null||xe||al||ds||du(i)),h=null,c=i;;){if(c.tag===5||c.tag===26){if(h===null){xe=h=c;try{if(T=xe.stateNode,w)U=T.style,typeof U.setProperty=="function"?U.setProperty("display","none","important"):U.display="none";else{te=xe.stateNode;var rt=xe.memoizedProps.style,Ne=rt!=null&&rt.hasOwnProperty("display")?rt.display:null;te.style.display=Ne==null||typeof Ne=="boolean"?"":(""+Ne).trim()}}catch(Ot){cr(xe,xe.return,Ot)}}}else if(c.tag===6){if(h===null){xe=c;try{xe.stateNode.nodeValue=w?"":xe.memoizedProps}catch(Ot){cr(xe,xe.return,Ot)}}}else if(c.tag===18){if(h===null){xe=c;try{var Ue=xe.stateNode;w?KA(Ue,!0):KA(xe.stateNode,!1)}catch(Ot){cr(xe,xe.return,Ot)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===i)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===i)break e;for(;c.sibling===null;){if(c.return===null||c.return===i)break e;h===c&&(h=null),c=c.return}h===c&&(h=null),c.sibling.return=c.return,c=c.sibling}m&4&&(m=i.updateQueue,m!==null&&(h=m.retryQueue,h!==null&&(m.retryQueue=null,lx(i,h))));break;case 19:fo(c,i),ho(i),m&4&&(m=i.updateQueue,m!==null&&(i.updateQueue=null,lx(i,m)));break;case 30:break;case 21:break;default:fo(c,i),ho(i)}}function ho(i){var c=i.flags;if(c&2){try{for(var h,m=i.return;m!==null;){if(Z3(m)){h=m;break}m=m.return}if(h==null)throw Error(s(160));switch(h.tag){case 27:var w=h.stateNode,T=Dv(i);ax(i,T,w);break;case 5:var U=h.stateNode;h.flags&32&&(Ps(U,""),h.flags&=-33);var te=Dv(i);ax(i,te,U);break;case 3:case 4:var xe=h.stateNode.containerInfo,De=Dv(i);Ov(i,De,xe);break;default:throw Error(s(161))}}catch(Ze){cr(i,i.return,Ze)}i.flags&=-3}c&4096&&(i.flags&=-4097)}function iA(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var c=i;iA(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),i=i.sibling}}function cl(i,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)eA(i,c.alternate,c),c=c.sibling}function du(i){for(i=i.child;i!==null;){var c=i;switch(c.tag){case 0:case 11:case 14:case 15:tc(4,c,c.return),du(c);break;case 1:Aa(c,c.return);var h=c.stateNode;typeof h.componentWillUnmount=="function"&&K3(c,c.return,h),du(c);break;case 27:Uh(c.stateNode);case 26:case 5:Aa(c,c.return),du(c);break;case 22:c.memoizedState===null&&du(c);break;case 30:du(c);break;default:du(c)}i=i.sibling}}function ul(i,c,h){for(h=h&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var m=c.alternate,w=i,T=c,U=T.flags;switch(T.tag){case 0:case 11:case 15:ul(w,T,h),_h(4,T);break;case 1:if(ul(w,T,h),m=T,w=m.stateNode,typeof w.componentDidMount=="function")try{w.componentDidMount()}catch(De){cr(m,m.return,De)}if(m=T,w=m.updateQueue,w!==null){var te=m.stateNode;try{var xe=w.shared.hiddenCallbacks;if(xe!==null)for(w.shared.hiddenCallbacks=null,w=0;w<xe.length;w++)D4(xe[w],te)}catch(De){cr(m,m.return,De)}}h&&U&64&&Y3(T),Lh(T,T.return);break;case 27:Q3(T);case 26:case 5:ul(w,T,h),h&&m===null&&U&4&&X3(T),Lh(T,T.return);break;case 12:ul(w,T,h);break;case 31:ul(w,T,h),h&&U&4&&rA(w,T);break;case 13:ul(w,T,h),h&&U&4&&sA(w,T);break;case 22:T.memoizedState===null&&ul(w,T,h),Lh(T,T.return);break;case 30:break;default:ul(w,T,h)}c=c.sibling}}function Nv(i,c){var h=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),i=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(i=c.memoizedState.cachePool.pool),i!==h&&(i!=null&&i.refCount++,h!=null&&Sh(h))}function $v(i,c){i=null,c.alternate!==null&&(i=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==i&&(c.refCount++,i!=null&&Sh(i))}function Zi(i,c,h,m){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)aA(i,c,h,m),c=c.sibling}function aA(i,c,h,m){var w=c.flags;switch(c.tag){case 0:case 11:case 15:Zi(i,c,h,m),w&2048&&_h(9,c);break;case 1:Zi(i,c,h,m);break;case 3:Zi(i,c,h,m),w&2048&&(i=null,c.alternate!==null&&(i=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==i&&(c.refCount++,i!=null&&Sh(i)));break;case 12:if(w&2048){Zi(i,c,h,m),i=c.stateNode;try{var T=c.memoizedProps,U=T.id,te=T.onPostCommit;typeof te=="function"&&te(U,c.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(xe){cr(c,c.return,xe)}}else Zi(i,c,h,m);break;case 31:Zi(i,c,h,m);break;case 13:Zi(i,c,h,m);break;case 23:break;case 22:T=c.stateNode,U=c.alternate,c.memoizedState!==null?T._visibility&2?Zi(i,c,h,m):Ph(i,c):T._visibility&2?Zi(i,c,h,m):(T._visibility|=2,Rd(i,c,h,m,(c.subtreeFlags&10256)!==0||!1)),w&2048&&Nv(U,c);break;case 24:Zi(i,c,h,m),w&2048&&$v(c.alternate,c);break;default:Zi(i,c,h,m)}}function Rd(i,c,h,m,w){for(w=w&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var T=i,U=c,te=h,xe=m,De=U.flags;switch(U.tag){case 0:case 11:case 15:Rd(T,U,te,xe,w),_h(8,U);break;case 23:break;case 22:var Ze=U.stateNode;U.memoizedState!==null?Ze._visibility&2?Rd(T,U,te,xe,w):Ph(T,U):(Ze._visibility|=2,Rd(T,U,te,xe,w)),w&&De&2048&&Nv(U.alternate,U);break;case 24:Rd(T,U,te,xe,w),w&&De&2048&&$v(U.alternate,U);break;default:Rd(T,U,te,xe,w)}c=c.sibling}}function Ph(i,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var h=i,m=c,w=m.flags;switch(m.tag){case 22:Ph(h,m),w&2048&&Nv(m.alternate,m);break;case 24:Ph(h,m),w&2048&&$v(m.alternate,m);break;default:Ph(h,m)}c=c.sibling}}var Dh=8192;function zd(i,c,h){if(i.subtreeFlags&Dh)for(i=i.child;i!==null;)lA(i,c,h),i=i.sibling}function lA(i,c,h){switch(i.tag){case 26:zd(i,c,h),i.flags&Dh&&i.memoizedState!==null&&vD(h,Xi,i.memoizedState,i.memoizedProps);break;case 5:zd(i,c,h);break;case 3:case 4:var m=Xi;Xi=jx(i.stateNode.containerInfo),zd(i,c,h),Xi=m;break;case 22:i.memoizedState===null&&(m=i.alternate,m!==null&&m.memoizedState!==null?(m=Dh,Dh=16777216,zd(i,c,h),Dh=m):zd(i,c,h));break;default:zd(i,c,h)}}function cA(i){var c=i.alternate;if(c!==null&&(i=c.child,i!==null)){c.child=null;do c=i.sibling,i.sibling=null,i=c;while(i!==null)}}function Oh(i){var c=i.deletions;if((i.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var m=c[h];ws=m,dA(m,i)}cA(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)uA(i),i=i.sibling}function uA(i){switch(i.tag){case 0:case 11:case 15:Oh(i),i.flags&2048&&tc(9,i,i.return);break;case 3:Oh(i);break;case 12:Oh(i);break;case 22:var c=i.stateNode;i.memoizedState!==null&&c._visibility&2&&(i.return===null||i.return.tag!==13)?(c._visibility&=-3,cx(i)):Oh(i);break;default:Oh(i)}}function cx(i){var c=i.deletions;if((i.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var m=c[h];ws=m,dA(m,i)}cA(i)}for(i=i.child;i!==null;){switch(c=i,c.tag){case 0:case 11:case 15:tc(8,c,c.return),cx(c);break;case 22:h=c.stateNode,h._visibility&2&&(h._visibility&=-3,cx(c));break;default:cx(c)}i=i.sibling}}function dA(i,c){for(;ws!==null;){var h=ws;switch(h.tag){case 0:case 11:case 15:tc(8,h,c);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var m=h.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Sh(h.memoizedState.cache)}if(m=h.child,m!==null)m.return=h,ws=m;else e:for(h=i;ws!==null;){m=ws;var w=m.sibling,T=m.return;if(tA(m),m===h){ws=null;break e}if(w!==null){w.return=T,ws=w;break e}ws=T}}}var LP={getCacheForType:function(i){var c=Ms(ls),h=c.data.get(i);return h===void 0&&(h=i(),c.data.set(i,h)),h},cacheSignal:function(){return Ms(ls).controller.signal}},PP=typeof WeakMap=="function"?WeakMap:Map,Zn=0,Sr=null,En=null,Rn=0,lr=0,$o=null,nc=!1,Id=!1,Hv=!1,dl=0,Yr=0,rc=0,fu=0,Wv=0,Ho=0,Fd=0,Bh=null,po=null,Uv=!1,ux=0,fA=0,dx=1/0,fx=null,sc=null,ys=0,oc=null,_d=null,fl=0,qv=0,Vv=null,hA=null,Nh=0,Gv=null;function Wo(){return(Zn&2)!==0&&Rn!==0?Rn&-Rn:D.T!==null?Jv():Xe()}function pA(){if(Ho===0)if((Rn&536870912)===0||Pn){var i=Yt;Yt<<=1,(Yt&3932160)===0&&(Yt=262144),Ho=i}else Ho=536870912;return i=Bo.current,i!==null&&(i.flags|=32),Ho}function go(i,c,h){(i===Sr&&(lr===2||lr===9)||i.cancelPendingCommit!==null)&&(Ld(i,0),ic(i,Rn,Ho,!1)),yt(i,h),((Zn&2)===0||i!==Sr)&&(i===Sr&&((Zn&2)===0&&(fu|=h),Yr===4&&ic(i,Rn,Ho,!1)),Ea(i))}function gA(i,c,h){if((Zn&6)!==0)throw Error(s(327));var m=!h&&(c&127)===0&&(c&i.expiredLanes)===0||nr(i,c),w=m?BP(i,c):Kv(i,c,!0),T=m;do{if(w===0){Id&&!m&&ic(i,c,0,!1);break}else{if(h=i.current.alternate,T&&!DP(h)){w=Kv(i,c,!1),T=!1;continue}if(w===2){if(T=c,i.errorRecoveryDisabledLanes&T)var U=0;else U=i.pendingLanes&-536870913,U=U!==0?U:U&536870912?536870912:0;if(U!==0){c=U;e:{var te=i;w=Bh;var xe=te.current.memoizedState.isDehydrated;if(xe&&(Ld(te,U).flags|=256),U=Kv(te,U,!1),U!==2){if(Hv&&!xe){te.errorRecoveryDisabledLanes|=T,fu|=T,w=4;break e}T=po,po=w,T!==null&&(po===null?po=T:po.push.apply(po,T))}w=U}if(T=!1,w!==2)continue}}if(w===1){Ld(i,0),ic(i,c,0,!0);break}e:{switch(m=i,T=w,T){case 0:case 1:throw Error(s(345));case 4:if((c&4194048)!==c)break;case 6:ic(m,c,Ho,!nc);break e;case 2:po=null;break;case 3:case 5:break;default:throw Error(s(329))}if((c&62914560)===c&&(w=ux+300-ot(),10<w)){if(ic(m,c,Ho,!nc),pr(m,0,!0)!==0)break e;fl=c,m.timeoutHandle=VA(mA.bind(null,m,h,po,fx,Uv,c,Ho,fu,Fd,nc,T,"Throttled",-0,0),w);break e}mA(m,h,po,fx,Uv,c,Ho,fu,Fd,nc,T,null,-0,0)}}break}while(!0);Ea(i)}function mA(i,c,h,m,w,T,U,te,xe,De,Ze,rt,Ne,Ue){if(i.timeoutHandle=-1,rt=c.subtreeFlags,rt&8192||(rt&16785408)===16785408){rt={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:co},lA(c,T,rt);var Ot=(T&62914560)===T?ux-ot():(T&4194048)===T?fA-ot():0;if(Ot=SD(rt,Ot),Ot!==null){fl=T,i.cancelPendingCommit=Ot(wA.bind(null,i,c,T,h,m,w,U,te,xe,Ze,rt,null,Ne,Ue)),ic(i,T,U,!De);return}}wA(i,c,T,h,m,w,U,te,xe)}function DP(i){for(var c=i;;){var h=c.tag;if((h===0||h===11||h===15)&&c.flags&16384&&(h=c.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var m=0;m<h.length;m++){var w=h[m],T=w.getSnapshot;w=w.value;try{if(!Do(T(),w))return!1}catch{return!1}}if(h=c.child,c.subtreeFlags&16384&&h!==null)h.return=c,c=h;else{if(c===i)break;for(;c.sibling===null;){if(c.return===null||c.return===i)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function ic(i,c,h,m){c&=~Wv,c&=~fu,i.suspendedLanes|=c,i.pingedLanes&=~c,m&&(i.warmLanes|=c),m=i.expirationTimes;for(var w=c;0<w;){var T=31-wt(w),U=1<<T;m[T]=-1,w&=~U}h!==0&&un(i,h,c)}function hx(){return(Zn&6)===0?($h(0),!1):!0}function Yv(){if(En!==null){if(lr===0)var i=En.return;else i=En,tl=ru=null,uv(i),Ad=null,Ch=0,i=En;for(;i!==null;)G3(i.alternate,i),i=i.return;En=null}}function Ld(i,c){var h=i.timeoutHandle;h!==-1&&(i.timeoutHandle=-1,rD(h)),h=i.cancelPendingCommit,h!==null&&(i.cancelPendingCommit=null,h()),fl=0,Yv(),Sr=i,En=h=Ja(i.current,null),Rn=c,lr=0,$o=null,nc=!1,Id=nr(i,c),Hv=!1,Fd=Ho=Wv=fu=rc=Yr=0,po=Bh=null,Uv=!1,(c&8)!==0&&(c|=c&32);var m=i.entangledLanes;if(m!==0)for(i=i.entanglements,m&=c;0<m;){var w=31-wt(m),T=1<<w;c|=i[w],m&=~T}return dl=c,_m(),h}function xA(i,c){xn=null,D.H=zh,c===wd||c===Hm?(c=F4(),lr=3):c===Qy?(c=F4(),lr=4):lr=c===Ev?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,$o=c,En===null&&(Yr=1,nx(i,oi(c,i.current)))}function bA(){var i=Bo.current;return i===null?!0:(Rn&4194048)===Rn?ci===null:(Rn&62914560)===Rn||(Rn&536870912)!==0?i===ci:!1}function yA(){var i=D.H;return D.H=zh,i===null?zh:i}function vA(){var i=D.A;return D.A=LP,i}function px(){Yr=4,nc||(Rn&4194048)!==Rn&&Bo.current!==null||(Id=!0),(rc&134217727)===0&&(fu&134217727)===0||Sr===null||ic(Sr,Rn,Ho,!1)}function Kv(i,c,h){var m=Zn;Zn|=2;var w=yA(),T=vA();(Sr!==i||Rn!==c)&&(fx=null,Ld(i,c)),c=!1;var U=Yr;e:do try{if(lr!==0&&En!==null){var te=En,xe=$o;switch(lr){case 8:Yv(),U=6;break e;case 3:case 2:case 9:case 6:Bo.current===null&&(c=!0);var De=lr;if(lr=0,$o=null,Pd(i,te,xe,De),h&&Id){U=0;break e}break;default:De=lr,lr=0,$o=null,Pd(i,te,xe,De)}}OP(),U=Yr;break}catch(Ze){xA(i,Ze)}while(!0);return c&&i.shellSuspendCounter++,tl=ru=null,Zn=m,D.H=w,D.A=T,En===null&&(Sr=null,Rn=0,_m()),U}function OP(){for(;En!==null;)SA(En)}function BP(i,c){var h=Zn;Zn|=2;var m=yA(),w=vA();Sr!==i||Rn!==c?(fx=null,dx=ot()+500,Ld(i,c)):Id=nr(i,c);e:do try{if(lr!==0&&En!==null){c=En;var T=$o;t:switch(lr){case 1:lr=0,$o=null,Pd(i,c,T,1);break;case 2:case 9:if(z4(T)){lr=0,$o=null,jA(c);break}c=function(){lr!==2&&lr!==9||Sr!==i||(lr=7),Ea(i)},T.then(c,c);break e;case 3:lr=7;break e;case 4:lr=5;break e;case 7:z4(T)?(lr=0,$o=null,jA(c)):(lr=0,$o=null,Pd(i,c,T,7));break;case 5:var U=null;switch(En.tag){case 26:U=En.memoizedState;case 5:case 27:var te=En;if(U?aE(U):te.stateNode.complete){lr=0,$o=null;var xe=te.sibling;if(xe!==null)En=xe;else{var De=te.return;De!==null?(En=De,gx(De)):En=null}break t}}lr=0,$o=null,Pd(i,c,T,5);break;case 6:lr=0,$o=null,Pd(i,c,T,6);break;case 8:Yv(),Yr=6;break e;default:throw Error(s(462))}}NP();break}catch(Ze){xA(i,Ze)}while(!0);return tl=ru=null,D.H=m,D.A=w,Zn=h,En!==null?0:(Sr=null,Rn=0,_m(),Yr)}function NP(){for(;En!==null&&!Se();)SA(En)}function SA(i){var c=q3(i.alternate,i,dl);i.memoizedProps=i.pendingProps,c===null?gx(i):En=c}function jA(i){var c=i,h=c.alternate;switch(c.tag){case 15:case 0:c=B3(h,c,c.pendingProps,c.type,void 0,Rn);break;case 11:c=B3(h,c,c.pendingProps,c.type.render,c.ref,Rn);break;case 5:uv(c);default:G3(h,c),c=En=v4(c,dl),c=q3(h,c,dl)}i.memoizedProps=i.pendingProps,c===null?gx(i):En=c}function Pd(i,c,h,m){tl=ru=null,uv(c),Ad=null,Ch=0;var w=c.return;try{if(kP(i,w,c,h,Rn)){Yr=1,nx(i,oi(h,i.current)),En=null;return}}catch(T){if(w!==null)throw En=w,T;Yr=1,nx(i,oi(h,i.current)),En=null;return}c.flags&32768?(Pn||m===1?i=!0:Id||(Rn&536870912)!==0?i=!1:(nc=i=!0,(m===2||m===9||m===3||m===6)&&(m=Bo.current,m!==null&&m.tag===13&&(m.flags|=16384))),CA(c,i)):gx(c)}function gx(i){var c=i;do{if((c.flags&32768)!==0){CA(c,nc);return}i=c.return;var h=zP(c.alternate,c,dl);if(h!==null){En=h;return}if(c=c.sibling,c!==null){En=c;return}En=c=i}while(c!==null);Yr===0&&(Yr=5)}function CA(i,c){do{var h=IP(i.alternate,i);if(h!==null){h.flags&=32767,En=h;return}if(h=i.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!c&&(i=i.sibling,i!==null)){En=i;return}En=i=h}while(i!==null);Yr=6,En=null}function wA(i,c,h,m,w,T,U,te,xe){i.cancelPendingCommit=null;do mx();while(ys!==0);if((Zn&6)!==0)throw Error(s(327));if(c!==null){if(c===i.current)throw Error(s(177));if(T=c.lanes|c.childLanes,T|=Dy,Ft(i,h,T,U,te,xe),i===Sr&&(En=Sr=null,Rn=0),_d=c,oc=i,fl=h,qv=T,Vv=w,hA=m,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,UP(pe,function(){return MA(),null})):(i.callbackNode=null,i.callbackPriority=0),m=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||m){m=D.T,D.T=null,w=q.p,q.p=2,U=Zn,Zn|=4;try{FP(i,c,h)}finally{Zn=U,q.p=w,D.T=m}}ys=1,AA(),EA(),TA()}}function AA(){if(ys===1){ys=0;var i=oc,c=_d,h=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||h){h=D.T,D.T=null;var m=q.p;q.p=2;var w=Zn;Zn|=4;try{oA(c,i);var T=a2,U=d4(i.containerInfo),te=T.focusedElem,xe=T.selectionRange;if(U!==te&&te&&te.ownerDocument&&u4(te.ownerDocument.documentElement,te)){if(xe!==null&&Iy(te)){var De=xe.start,Ze=xe.end;if(Ze===void 0&&(Ze=De),"selectionStart"in te)te.selectionStart=De,te.selectionEnd=Math.min(Ze,te.value.length);else{var rt=te.ownerDocument||document,Ne=rt&&rt.defaultView||window;if(Ne.getSelection){var Ue=Ne.getSelection(),Ot=te.textContent.length,en=Math.min(xe.start,Ot),xr=xe.end===void 0?en:Math.min(xe.end,Ot);!Ue.extend&&en>xr&&(U=xr,xr=en,en=U);var Ie=c4(te,en),Ae=c4(te,xr);if(Ie&&Ae&&(Ue.rangeCount!==1||Ue.anchorNode!==Ie.node||Ue.anchorOffset!==Ie.offset||Ue.focusNode!==Ae.node||Ue.focusOffset!==Ae.offset)){var Pe=rt.createRange();Pe.setStart(Ie.node,Ie.offset),Ue.removeAllRanges(),en>xr?(Ue.addRange(Pe),Ue.extend(Ae.node,Ae.offset)):(Pe.setEnd(Ae.node,Ae.offset),Ue.addRange(Pe))}}}}for(rt=[],Ue=te;Ue=Ue.parentNode;)Ue.nodeType===1&&rt.push({element:Ue,left:Ue.scrollLeft,top:Ue.scrollTop});for(typeof te.focus=="function"&&te.focus(),te=0;te<rt.length;te++){var tt=rt[te];tt.element.scrollLeft=tt.left,tt.element.scrollTop=tt.top}}kx=!!i2,a2=i2=null}finally{Zn=w,q.p=m,D.T=h}}i.current=c,ys=2}}function EA(){if(ys===2){ys=0;var i=oc,c=_d,h=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||h){h=D.T,D.T=null;var m=q.p;q.p=2;var w=Zn;Zn|=4;try{eA(i,c.alternate,c)}finally{Zn=w,q.p=m,D.T=h}}ys=3}}function TA(){if(ys===4||ys===3){ys=0,Ke();var i=oc,c=_d,h=fl,m=hA;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?ys=5:(ys=0,_d=oc=null,kA(i,i.pendingLanes));var w=i.pendingLanes;if(w===0&&(sc=null),Fe(h),c=c.stateNode,ct&&typeof ct.onCommitFiberRoot=="function")try{ct.onCommitFiberRoot(ht,c,void 0,(c.current.flags&128)===128)}catch{}if(m!==null){c=D.T,w=q.p,q.p=2,D.T=null;try{for(var T=i.onRecoverableError,U=0;U<m.length;U++){var te=m[U];T(te.value,{componentStack:te.stack})}}finally{D.T=c,q.p=w}}(fl&3)!==0&&mx(),Ea(i),w=i.pendingLanes,(h&261930)!==0&&(w&42)!==0?i===Gv?Nh++:(Nh=0,Gv=i):Nh=0,$h(0)}}function kA(i,c){(i.pooledCacheLanes&=c)===0&&(c=i.pooledCache,c!=null&&(i.pooledCache=null,Sh(c)))}function mx(){return AA(),EA(),TA(),MA()}function MA(){if(ys!==5)return!1;var i=oc,c=qv;qv=0;var h=Fe(fl),m=D.T,w=q.p;try{q.p=32>h?32:h,D.T=null,h=Vv,Vv=null;var T=oc,U=fl;if(ys=0,_d=oc=null,fl=0,(Zn&6)!==0)throw Error(s(331));var te=Zn;if(Zn|=4,uA(T.current),aA(T,T.current,U,h),Zn=te,$h(0,!1),ct&&typeof ct.onPostCommitFiberRoot=="function")try{ct.onPostCommitFiberRoot(ht,T)}catch{}return!0}finally{q.p=w,D.T=m,kA(i,c)}}function RA(i,c,h){c=oi(h,c),c=Av(i.stateNode,c,2),i=Ql(i,c,2),i!==null&&(yt(i,2),Ea(i))}function cr(i,c,h){if(i.tag===3)RA(i,i,h);else for(;c!==null;){if(c.tag===3){RA(c,i,h);break}else if(c.tag===1){var m=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(sc===null||!sc.has(m))){i=oi(h,i),h=z3(2),m=Ql(c,h,2),m!==null&&(I3(h,m,c,i),yt(m,2),Ea(m));break}}c=c.return}}function Xv(i,c,h){var m=i.pingCache;if(m===null){m=i.pingCache=new PP;var w=new Set;m.set(c,w)}else w=m.get(c),w===void 0&&(w=new Set,m.set(c,w));w.has(h)||(Hv=!0,w.add(h),i=$P.bind(null,i,c,h),c.then(i,i))}function $P(i,c,h){var m=i.pingCache;m!==null&&m.delete(c),i.pingedLanes|=i.suspendedLanes&h,i.warmLanes&=~h,Sr===i&&(Rn&h)===h&&(Yr===4||Yr===3&&(Rn&62914560)===Rn&&300>ot()-ux?(Zn&2)===0&&Ld(i,0):Wv|=h,Fd===Rn&&(Fd=0)),Ea(i)}function zA(i,c){c===0&&(c=Ht()),i=eu(i,c),i!==null&&(yt(i,c),Ea(i))}function HP(i){var c=i.memoizedState,h=0;c!==null&&(h=c.retryLane),zA(i,h)}function WP(i,c){var h=0;switch(i.tag){case 31:case 13:var m=i.stateNode,w=i.memoizedState;w!==null&&(h=w.retryLane);break;case 19:m=i.stateNode;break;case 22:m=i.stateNode._retryCache;break;default:throw Error(s(314))}m!==null&&m.delete(c),zA(i,h)}function UP(i,c){return Te(i,c)}var xx=null,Dd=null,Zv=!1,bx=!1,Qv=!1,ac=0;function Ea(i){i!==Dd&&i.next===null&&(Dd===null?xx=Dd=i:Dd=Dd.next=i),bx=!0,Zv||(Zv=!0,VP())}function $h(i,c){if(!Qv&&bx){Qv=!0;do for(var h=!1,m=xx;m!==null;){if(i!==0){var w=m.pendingLanes;if(w===0)var T=0;else{var U=m.suspendedLanes,te=m.pingedLanes;T=(1<<31-wt(42|i)+1)-1,T&=w&~(U&~te),T=T&201326741?T&201326741|1:T?T|2:0}T!==0&&(h=!0,LA(m,T))}else T=Rn,T=pr(m,m===Sr?T:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(T&3)===0||nr(m,T)||(h=!0,LA(m,T));m=m.next}while(h);Qv=!1}}function qP(){IA()}function IA(){bx=Zv=!1;var i=0;ac!==0&&nD()&&(i=ac);for(var c=ot(),h=null,m=xx;m!==null;){var w=m.next,T=FA(m,c);T===0?(m.next=null,h===null?xx=w:h.next=w,w===null&&(Dd=h)):(h=m,(i!==0||(T&3)!==0)&&(bx=!0)),m=w}ys!==0&&ys!==5||$h(i),ac!==0&&(ac=0)}function FA(i,c){for(var h=i.suspendedLanes,m=i.pingedLanes,w=i.expirationTimes,T=i.pendingLanes&-62914561;0<T;){var U=31-wt(T),te=1<<U,xe=w[U];xe===-1?((te&h)===0||(te&m)!==0)&&(w[U]=Bn(te,c)):xe<=c&&(i.expiredLanes|=te),T&=~te}if(c=Sr,h=Rn,h=pr(i,i===c?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),m=i.callbackNode,h===0||i===c&&(lr===2||lr===9)||i.cancelPendingCommit!==null)return m!==null&&m!==null&&Re(m),i.callbackNode=null,i.callbackPriority=0;if((h&3)===0||nr(i,h)){if(c=h&-h,c===i.callbackPriority)return c;switch(m!==null&&Re(m),Fe(h)){case 2:case 8:h=Z;break;case 32:h=pe;break;case 268435456:h=me;break;default:h=pe}return m=_A.bind(null,i),h=Te(h,m),i.callbackPriority=c,i.callbackNode=h,c}return m!==null&&m!==null&&Re(m),i.callbackPriority=2,i.callbackNode=null,2}function _A(i,c){if(ys!==0&&ys!==5)return i.callbackNode=null,i.callbackPriority=0,null;var h=i.callbackNode;if(mx()&&i.callbackNode!==h)return null;var m=Rn;return m=pr(i,i===Sr?m:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),m===0?null:(gA(i,m,c),FA(i,ot()),i.callbackNode!=null&&i.callbackNode===h?_A.bind(null,i):null)}function LA(i,c){if(mx())return null;gA(i,c,!0)}function VP(){sD(function(){(Zn&6)!==0?Te($e,qP):IA()})}function Jv(){if(ac===0){var i=jd;i===0&&(i=_t,_t<<=1,(_t&261888)===0&&(_t=256)),ac=i}return ac}function PA(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:$l(""+i)}function DA(i,c){var h=c.ownerDocument.createElement("input");return h.name=c.name,h.value=c.value,i.id&&h.setAttribute("form",i.id),c.parentNode.insertBefore(h,c),i=new FormData(i),h.parentNode.removeChild(h),i}function GP(i,c,h,m,w){if(c==="submit"&&h&&h.stateNode===w){var T=PA((w[lt]||null).action),U=m.submitter;U&&(c=(c=U[lt]||null)?PA(c.formAction):U.getAttribute("formAction"),c!==null&&(T=c,U=null));var te=new Ut("action","action",null,m,w);i.push({event:te,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(ac!==0){var xe=U?DA(w,U):new FormData(w);yv(h,{pending:!0,data:xe,method:w.method,action:T},null,xe)}}else typeof T=="function"&&(te.preventDefault(),xe=U?DA(w,U):new FormData(w),yv(h,{pending:!0,data:xe,method:w.method,action:T},T,xe))},currentTarget:w}]})}}for(var e2=0;e2<Py.length;e2++){var t2=Py[e2],YP=t2.toLowerCase(),KP=t2[0].toUpperCase()+t2.slice(1);Ki(YP,"on"+KP)}Ki(p4,"onAnimationEnd"),Ki(g4,"onAnimationIteration"),Ki(m4,"onAnimationStart"),Ki("dblclick","onDoubleClick"),Ki("focusin","onFocus"),Ki("focusout","onBlur"),Ki(dP,"onTransitionRun"),Ki(fP,"onTransitionStart"),Ki(hP,"onTransitionCancel"),Ki(x4,"onTransitionEnd"),ir("onMouseEnter",["mouseout","mouseover"]),ir("onMouseLeave",["mouseout","mouseover"]),ir("onPointerEnter",["pointerout","pointerover"]),ir("onPointerLeave",["pointerout","pointerover"]),on("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),on("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),on("onBeforeInput",["compositionend","keypress","textInput","paste"]),on("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),on("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),on("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hh="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),XP=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hh));function OA(i,c){c=(c&4)!==0;for(var h=0;h<i.length;h++){var m=i[h],w=m.event;m=m.listeners;e:{var T=void 0;if(c)for(var U=m.length-1;0<=U;U--){var te=m[U],xe=te.instance,De=te.currentTarget;if(te=te.listener,xe!==T&&w.isPropagationStopped())break e;T=te,w.currentTarget=De;try{T(w)}catch(Ze){Fm(Ze)}w.currentTarget=null,T=xe}else for(U=0;U<m.length;U++){if(te=m[U],xe=te.instance,De=te.currentTarget,te=te.listener,xe!==T&&w.isPropagationStopped())break e;T=te,w.currentTarget=De;try{T(w)}catch(Ze){Fm(Ze)}w.currentTarget=null,T=xe}}}}function Tn(i,c){var h=c[vt];h===void 0&&(h=c[vt]=new Set);var m=i+"__bubble";h.has(m)||(BA(c,i,2,!1),h.add(m))}function n2(i,c,h){var m=0;c&&(m|=4),BA(h,i,m,c)}var yx="_reactListening"+Math.random().toString(36).slice(2);function r2(i){if(!i[yx]){i[yx]=!0,Qt.forEach(function(h){h!=="selectionchange"&&(XP.has(h)||n2(h,!1,i),n2(h,!0,i))});var c=i.nodeType===9?i:i.ownerDocument;c===null||c[yx]||(c[yx]=!0,n2("selectionchange",!1,c))}}function BA(i,c,h,m){switch(pE(c)){case 2:var w=wD;break;case 8:w=AD;break;default:w=b2}h=w.bind(null,c,h,i),w=void 0,!Ul||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(w=!0),m?w!==void 0?i.addEventListener(c,h,{capture:!0,passive:w}):i.addEventListener(c,h,!0):w!==void 0?i.addEventListener(c,h,{passive:w}):i.addEventListener(c,h,!1)}function s2(i,c,h,m,w){var T=m;if((c&1)===0&&(c&2)===0&&m!==null)e:for(;;){if(m===null)return;var U=m.tag;if(U===3||U===4){var te=m.stateNode.containerInfo;if(te===w)break;if(U===4)for(U=m.return;U!==null;){var xe=U.tag;if((xe===3||xe===4)&&U.stateNode.containerInfo===w)return;U=U.return}for(;te!==null;){if(U=dn(te),U===null)return;if(xe=U.tag,xe===5||xe===6||xe===26||xe===27){m=T=U;continue e}te=te.parentNode}}m=m.return}cd(function(){var De=T,Ze=Hl(h),rt=[];e:{var Ne=b4.get(i);if(Ne!==void 0){var Ue=Ut,Ot=i;switch(i){case"keypress":if($(h)===0)break e;case"keydown":case"keyup":Ue=WL;break;case"focusin":Ot="focus",Ue=Po;break;case"focusout":Ot="blur",Ue=Po;break;case"beforeblur":case"afterblur":Ue=Po;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ue=Vr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ue=bs;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ue=VL;break;case p4:case g4:case m4:Ue=zm;break;case x4:Ue=YL;break;case"scroll":case"scrollend":Ue=Ln;break;case"wheel":Ue=XL;break;case"copy":case"cut":case"paste":Ue=fd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ue=Kw;break;case"toggle":case"beforetoggle":Ue=QL}var en=(c&4)!==0,xr=!en&&(i==="scroll"||i==="scrollend"),Ie=en?Ne!==null?Ne+"Capture":null:Ne;en=[];for(var Ae=De,Pe;Ae!==null;){var tt=Ae;if(Pe=tt.stateNode,tt=tt.tag,tt!==5&&tt!==26&&tt!==27||Pe===null||Ie===null||(tt=Sa(Ae,Ie),tt!=null&&en.push(Wh(Ae,tt,Pe))),xr)break;Ae=Ae.return}0<en.length&&(Ne=new Ue(Ne,Ot,null,h,Ze),rt.push({event:Ne,listeners:en}))}}if((c&7)===0){e:{if(Ne=i==="mouseover"||i==="pointerover",Ue=i==="mouseout"||i==="pointerout",Ne&&h!==ms&&(Ot=h.relatedTarget||h.fromElement)&&(dn(Ot)||Ot[kt]))break e;if((Ue||Ne)&&(Ne=Ze.window===Ze?Ze:(Ne=Ze.ownerDocument)?Ne.defaultView||Ne.parentWindow:window,Ue?(Ot=h.relatedTarget||h.toElement,Ue=De,Ot=Ot?dn(Ot):null,Ot!==null&&(xr=a(Ot),en=Ot.tag,Ot!==xr||en!==5&&en!==27&&en!==6)&&(Ot=null)):(Ue=null,Ot=De),Ue!==Ot)){if(en=Vr,tt="onMouseLeave",Ie="onMouseEnter",Ae="mouse",(i==="pointerout"||i==="pointerover")&&(en=Kw,tt="onPointerLeave",Ie="onPointerEnter",Ae="pointer"),xr=Ue==null?Ne:_e(Ue),Pe=Ot==null?Ne:_e(Ot),Ne=new en(tt,Ae+"leave",Ue,h,Ze),Ne.target=xr,Ne.relatedTarget=Pe,tt=null,dn(Ze)===De&&(en=new en(Ie,Ae+"enter",Ot,h,Ze),en.target=Pe,en.relatedTarget=xr,tt=en),xr=tt,Ue&&Ot)t:{for(en=ZP,Ie=Ue,Ae=Ot,Pe=0,tt=Ie;tt;tt=en(tt))Pe++;tt=0;for(var Kt=Ae;Kt;Kt=en(Kt))tt++;for(;0<Pe-tt;)Ie=en(Ie),Pe--;for(;0<tt-Pe;)Ae=en(Ae),tt--;for(;Pe--;){if(Ie===Ae||Ae!==null&&Ie===Ae.alternate){en=Ie;break t}Ie=en(Ie),Ae=en(Ae)}en=null}else en=null;Ue!==null&&NA(rt,Ne,Ue,en,!1),Ot!==null&&xr!==null&&NA(rt,xr,Ot,en,!0)}}e:{if(Ne=De?_e(De):window,Ue=Ne.nodeName&&Ne.nodeName.toLowerCase(),Ue==="select"||Ue==="input"&&Ne.type==="file")var Vn=r4;else if(t4(Ne))if(s4)Vn=lP;else{Vn=iP;var qt=oP}else Ue=Ne.nodeName,!Ue||Ue.toLowerCase()!=="input"||Ne.type!=="checkbox"&&Ne.type!=="radio"?De&&Zc(De.elementType)&&(Vn=r4):Vn=aP;if(Vn&&(Vn=Vn(i,De))){n4(rt,Vn,h,Ze);break e}qt&&qt(i,Ne,De),i==="focusout"&&De&&Ne.type==="number"&&De.memoizedProps.value!=null&&Xc(Ne,"number",Ne.value)}switch(qt=De?_e(De):window,i){case"focusin":(t4(qt)||qt.contentEditable==="true")&&(pd=qt,Fy=De,bh=null);break;case"focusout":bh=Fy=pd=null;break;case"mousedown":_y=!0;break;case"contextmenu":case"mouseup":case"dragend":_y=!1,f4(rt,h,Ze);break;case"selectionchange":if(uP)break;case"keydown":case"keyup":f4(rt,h,Ze)}var bn;if(My)e:{switch(i){case"compositionstart":var zn="onCompositionStart";break e;case"compositionend":zn="onCompositionEnd";break e;case"compositionupdate":zn="onCompositionUpdate";break e}zn=void 0}else hd?Jw(i,h)&&(zn="onCompositionEnd"):i==="keydown"&&h.keyCode===229&&(zn="onCompositionStart");zn&&(Xw&&h.locale!=="ko"&&(hd||zn!=="onCompositionStart"?zn==="onCompositionEnd"&&hd&&(bn=ud()):(Lo=Ze,Za="value"in Lo?Lo.value:Lo.textContent,hd=!0)),qt=vx(De,zn),0<qt.length&&(zn=new Yw(zn,i,null,h,Ze),rt.push({event:zn,listeners:qt}),bn?zn.data=bn:(bn=e4(h),bn!==null&&(zn.data=bn)))),(bn=eP?tP(i,h):nP(i,h))&&(zn=vx(De,"onBeforeInput"),0<zn.length&&(qt=new Yw("onBeforeInput","beforeinput",null,h,Ze),rt.push({event:qt,listeners:zn}),qt.data=bn)),GP(rt,i,De,h,Ze)}OA(rt,c)})}function Wh(i,c,h){return{instance:i,listener:c,currentTarget:h}}function vx(i,c){for(var h=c+"Capture",m=[];i!==null;){var w=i,T=w.stateNode;if(w=w.tag,w!==5&&w!==26&&w!==27||T===null||(w=Sa(i,h),w!=null&&m.unshift(Wh(i,w,T)),w=Sa(i,c),w!=null&&m.push(Wh(i,w,T))),i.tag===3)return m;i=i.return}return[]}function ZP(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function NA(i,c,h,m,w){for(var T=c._reactName,U=[];h!==null&&h!==m;){var te=h,xe=te.alternate,De=te.stateNode;if(te=te.tag,xe!==null&&xe===m)break;te!==5&&te!==26&&te!==27||De===null||(xe=De,w?(De=Sa(h,T),De!=null&&U.unshift(Wh(h,De,xe))):w||(De=Sa(h,T),De!=null&&U.push(Wh(h,De,xe)))),h=h.return}U.length!==0&&i.push({event:c,listeners:U})}var QP=/\r\n?/g,JP=/\u0000|\uFFFD/g;function $A(i){return(typeof i=="string"?i:""+i).replace(QP,` `).replace(JP,"")}function HA(i,c){return c=$A(c),$A(i)===c}function mr(i,c,h,m,w,T){switch(h){case"children":typeof m=="string"?c==="body"||c==="textarea"&&m===""||Ps(i,m):(typeof m=="number"||typeof m=="bigint")&&c!=="body"&&Ps(i,""+m);break;case"className":Nn(i,"class",m);break;case"tabIndex":Nn(i,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Nn(i,h,m);break;case"style":Fo(i,m,T);break;case"data":if(c!=="object"){Nn(i,"data",m);break}case"src":case"href":if(m===""&&(c!=="a"||h!=="href")){i.removeAttribute(h);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){i.removeAttribute(h);break}m=$l(""+m),i.setAttribute(h,m);break;case"action":case"formAction":if(typeof m=="function"){i.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof T=="function"&&(h==="formAction"?(c!=="input"&&mr(i,c,"name",w.name,w,null),mr(i,c,"formEncType",w.formEncType,w,null),mr(i,c,"formMethod",w.formMethod,w,null),mr(i,c,"formTarget",w.formTarget,w,null)):(mr(i,c,"encType",w.encType,w,null),mr(i,c,"method",w.method,w,null),mr(i,c,"target",w.target,w,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){i.removeAttribute(h);break}m=$l(""+m),i.setAttribute(h,m);break;case"onClick":m!=null&&(i.onclick=co);break;case"onScroll":m!=null&&Tn("scroll",i);break;case"onScrollEnd":m!=null&&Tn("scrollend",i);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(h=m.__html,h!=null){if(w.children!=null)throw Error(s(60));i.innerHTML=h}}break;case"multiple":i.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":i.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){i.removeAttribute("xlink:href");break}h=$l(""+m),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?i.setAttribute(h,""+m):i.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?i.setAttribute(h,""):i.removeAttribute(h);break;case"capture":case"download":m===!0?i.setAttribute(h,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?i.setAttribute(h,m):i.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?i.setAttribute(h,m):i.removeAttribute(h);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?i.removeAttribute(h):i.setAttribute(h,m);break;case"popover":Tn("beforetoggle",i),Tn("toggle",i),zt(i,"popover",m);break;case"xlinkActuate":ar(i,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":ar(i,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":ar(i,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":ar(i,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":ar(i,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":ar(i,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":ar(i,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":ar(i,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":ar(i,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":zt(i,"is",m);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=fh.get(h)||h,zt(i,h,m))}}function o2(i,c,h,m,w,T){switch(h){case"style":Fo(i,m,T);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(h=m.__html,h!=null){if(w.children!=null)throw Error(s(60));i.innerHTML=h}}break;case"children":typeof m=="string"?Ps(i,m):(typeof m=="number"||typeof m=="bigint")&&Ps(i,""+m);break;case"onScroll":m!=null&&Tn("scroll",i);break;case"onScrollEnd":m!=null&&Tn("scrollend",i);break;case"onClick":m!=null&&(i.onclick=co);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!sn.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(w=h.endsWith("Capture"),c=h.slice(2,w?h.length-7:void 0),T=i[lt]||null,T=T!=null?T[h]:null,typeof T=="function"&&i.removeEventListener(c,T,w),typeof m=="function")){typeof T!="function"&&T!==null&&(h in i?i[h]=null:i.hasAttribute(h)&&i.removeAttribute(h)),i.addEventListener(c,m,w);break e}h in i?i[h]=m:m===!0?i.setAttribute(h,""):zt(i,h,m)}}}function zs(i,c,h){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Tn("error",i),Tn("load",i);var m=!1,w=!1,T;for(T in h)if(h.hasOwnProperty(T)){var U=h[T];if(U!=null)switch(T){case"src":m=!0;break;case"srcSet":w=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,c));default:mr(i,c,T,U,h,null)}}w&&mr(i,c,"srcSet",h.srcSet,h,null),m&&mr(i,c,"src",h.src,h,null);return;case"input":Tn("invalid",i);var te=T=U=w=null,xe=null,De=null;for(m in h)if(h.hasOwnProperty(m)){var Ze=h[m];if(Ze!=null)switch(m){case"name":w=Ze;break;case"type":U=Ze;break;case"checked":xe=Ze;break;case"defaultChecked":De=Ze;break;case"value":T=Ze;break;case"defaultValue":te=Ze;break;case"children":case"dangerouslySetInnerHTML":if(Ze!=null)throw Error(s(137,c));break;default:mr(i,c,m,Ze,h,null)}}Nl(i,T,te,xe,De,U,w,!1);return;case"select":Tn("invalid",i),m=U=T=null;for(w in h)if(h.hasOwnProperty(w)&&(te=h[w],te!=null))switch(w){case"value":T=te;break;case"defaultValue":U=te;break;case"multiple":m=te;default:mr(i,c,w,te,h,null)}c=T,h=U,i.multiple=!!m,c!=null?ba(i,!!m,c,!1):h!=null&&ba(i,!!m,h,!0);return;case"textarea":Tn("invalid",i),T=w=m=null;for(U in h)if(h.hasOwnProperty(U)&&(te=h[U],te!=null))switch(U){case"value":m=te;break;case"defaultValue":w=te;break;case"children":T=te;break;case"dangerouslySetInnerHTML":if(te!=null)throw Error(s(91));break;default:mr(i,c,U,te,h,null)}lo(i,m,w,T);return;case"option":for(xe in h)h.hasOwnProperty(xe)&&(m=h[xe],m!=null)&&(xe==="selected"?i.selected=m&&typeof m!="function"&&typeof m!="symbol":mr(i,c,xe,m,h,null));return;case"dialog":Tn("beforetoggle",i),Tn("toggle",i),Tn("cancel",i),Tn("close",i);break;case"iframe":case"object":Tn("load",i);break;case"video":case"audio":for(m=0;m<Hh.length;m++)Tn(Hh[m],i);break;case"image":Tn("error",i),Tn("load",i);break;case"details":Tn("toggle",i);break;case"embed":case"source":case"link":Tn("error",i),Tn("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(De in h)if(h.hasOwnProperty(De)&&(m=h[De],m!=null))switch(De){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,c));default:mr(i,c,De,m,h,null)}return;default:if(Zc(c)){for(Ze in h)h.hasOwnProperty(Ze)&&(m=h[Ze],m!==void 0&&o2(i,c,Ze,m,h,void 0));return}}for(te in h)h.hasOwnProperty(te)&&(m=h[te],m!=null&&mr(i,c,te,m,h,null))}function eD(i,c,h,m){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var w=null,T=null,U=null,te=null,xe=null,De=null,Ze=null;for(Ue in h){var rt=h[Ue];if(h.hasOwnProperty(Ue)&&rt!=null)switch(Ue){case"checked":break;case"value":break;case"defaultValue":xe=rt;default:m.hasOwnProperty(Ue)||mr(i,c,Ue,null,m,rt)}}for(var Ne in m){var Ue=m[Ne];if(rt=h[Ne],m.hasOwnProperty(Ne)&&(Ue!=null||rt!=null))switch(Ne){case"type":T=Ue;break;case"name":w=Ue;break;case"checked":De=Ue;break;case"defaultChecked":Ze=Ue;break;case"value":U=Ue;break;case"defaultValue":te=Ue;break;case"children":case"dangerouslySetInnerHTML":if(Ue!=null)throw Error(s(137,c));break;default:Ue!==rt&&mr(i,c,Ne,Ue,m,rt)}}Kc(i,U,te,xe,De,Ze,T,w);return;case"select":Ue=U=te=Ne=null;for(T in h)if(xe=h[T],h.hasOwnProperty(T)&&xe!=null)switch(T){case"value":break;case"multiple":Ue=xe;default:m.hasOwnProperty(T)||mr(i,c,T,null,m,xe)}for(w in m)if(T=m[w],xe=h[w],m.hasOwnProperty(w)&&(T!=null||xe!=null))switch(w){case"value":Ne=T;break;case"defaultValue":te=T;break;case"multiple":U=T;default:T!==xe&&mr(i,c,w,T,m,xe)}c=te,h=U,m=Ue,Ne!=null?ba(i,!!h,Ne,!1):!!m!=!!h&&(c!=null?ba(i,!!h,c,!0):ba(i,!!h,h?[]:"",!1));return;case"textarea":Ue=Ne=null;for(te in h)if(w=h[te],h.hasOwnProperty(te)&&w!=null&&!m.hasOwnProperty(te))switch(te){case"value":break;case"children":break;default:mr(i,c,te,null,m,w)}for(U in m)if(w=m[U],T=h[U],m.hasOwnProperty(U)&&(w!=null||T!=null))switch(U){case"value":Ne=w;break;case"defaultValue":Ue=w;break;case"children":break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(s(91));break;default:w!==T&&mr(i,c,U,w,m,T)}ya(i,Ne,Ue);return;case"option":for(var Ot in h)Ne=h[Ot],h.hasOwnProperty(Ot)&&Ne!=null&&!m.hasOwnProperty(Ot)&&(Ot==="selected"?i.selected=!1:mr(i,c,Ot,null,m,Ne));for(xe in m)Ne=m[xe],Ue=h[xe],m.hasOwnProperty(xe)&&Ne!==Ue&&(Ne!=null||Ue!=null)&&(xe==="selected"?i.selected=Ne&&typeof Ne!="function"&&typeof Ne!="symbol":mr(i,c,xe,Ne,m,Ue));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var en in h)Ne=h[en],h.hasOwnProperty(en)&&Ne!=null&&!m.hasOwnProperty(en)&&mr(i,c,en,null,m,Ne);for(De in m)if(Ne=m[De],Ue=h[De],m.hasOwnProperty(De)&&Ne!==Ue&&(Ne!=null||Ue!=null))switch(De){case"children":case"dangerouslySetInnerHTML":if(Ne!=null)throw Error(s(137,c));break;default:mr(i,c,De,Ne,m,Ue)}return;default:if(Zc(c)){for(var xr in h)Ne=h[xr],h.hasOwnProperty(xr)&&Ne!==void 0&&!m.hasOwnProperty(xr)&&o2(i,c,xr,void 0,m,Ne);for(Ze in m)Ne=m[Ze],Ue=h[Ze],!m.hasOwnProperty(Ze)||Ne===Ue||Ne===void 0&&Ue===void 0||o2(i,c,Ze,Ne,m,Ue);return}}for(var Ie in h)Ne=h[Ie],h.hasOwnProperty(Ie)&&Ne!=null&&!m.hasOwnProperty(Ie)&&mr(i,c,Ie,null,m,Ne);for(rt in m)Ne=m[rt],Ue=h[rt],!m.hasOwnProperty(rt)||Ne===Ue||Ne==null&&Ue==null||mr(i,c,rt,Ne,m,Ue)}function WA(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tD(){if(typeof performance.getEntriesByType=="function"){for(var i=0,c=0,h=performance.getEntriesByType("resource"),m=0;m<h.length;m++){var w=h[m],T=w.transferSize,U=w.initiatorType,te=w.duration;if(T&&te&&WA(U)){for(U=0,te=w.responseEnd,m+=1;m<h.length;m++){var xe=h[m],De=xe.startTime;if(De>te)break;var Ze=xe.transferSize,rt=xe.initiatorType;Ze&&WA(rt)&&(xe=xe.responseEnd,U+=Ze*(xe<te?1:(te-De)/(xe-De)))}if(--m,c+=8*(T+U)/(w.duration/1e3),i++,10<i)break}}if(0<i)return c/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var i2=null,a2=null;function Sx(i){return i.nodeType===9?i:i.ownerDocument}function UA(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function qA(i,c){if(i===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&c==="foreignObject"?0:i}function l2(i,c){return i==="textarea"||i==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var c2=null;function nD(){var i=window.event;return i&&i.type==="popstate"?i===c2?!1:(c2=i,!0):(c2=null,!1)}var VA=typeof setTimeout=="function"?setTimeout:void 0,rD=typeof clearTimeout=="function"?clearTimeout:void 0,GA=typeof Promise=="function"?Promise:void 0,sD=typeof queueMicrotask=="function"?queueMicrotask:typeof GA<"u"?function(i){return GA.resolve(null).then(i).catch(oD)}:VA;function oD(i){setTimeout(function(){throw i})}function lc(i){return i==="head"}function YA(i,c){var h=c,m=0;do{var w=h.nextSibling;if(i.removeChild(h),w&&w.nodeType===8)if(h=w.data,h==="/$"||h==="/&"){if(m===0){i.removeChild(w),$d(c);return}m--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")m++;else if(h==="html")Uh(i.ownerDocument.documentElement);else if(h==="head"){h=i.ownerDocument.head,Uh(h);for(var T=h.firstChild;T;){var U=T.nextSibling,te=T.nodeName;T[cn]||te==="SCRIPT"||te==="STYLE"||te==="LINK"&&T.rel.toLowerCase()==="stylesheet"||h.removeChild(T),T=U}}else h==="body"&&Uh(i.ownerDocument.body);h=w}while(h);$d(c)}function KA(i,c){var h=i;i=0;do{var m=h.nextSibling;if(h.nodeType===1?c?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(c?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),m&&m.nodeType===8)if(h=m.data,h==="/$"){if(i===0)break;i--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||i++;h=m}while(h)}function u2(i){var c=i.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var h=c;switch(c=c.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":u2(h),An(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}i.removeChild(h)}}function iD(i,c,h,m){for(;i.nodeType===1;){var w=h;if(i.nodeName.toLowerCase()!==c.toLowerCase()){if(!m&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(m){if(!i[cn])switch(c){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(T=i.getAttribute("rel"),T==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(T!==w.rel||i.getAttribute("href")!==(w.href==null||w.href===""?null:w.href)||i.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin)||i.getAttribute("title")!==(w.title==null?null:w.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(T=i.getAttribute("src"),(T!==(w.src==null?null:w.src)||i.getAttribute("type")!==(w.type==null?null:w.type)||i.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin))&&T&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(c==="input"&&i.type==="hidden"){var T=w.name==null?null:""+w.name;if(w.type==="hidden"&&i.getAttribute("name")===T)return i}else return i;if(i=ui(i.nextSibling),i===null)break}return null}function aD(i,c,h){if(c==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!h||(i=ui(i.nextSibling),i===null))return null;return i}function XA(i,c){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!c||(i=ui(i.nextSibling),i===null))return null;return i}function d2(i){return i.data==="$?"||i.data==="$~"}function f2(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function lD(i,c){var h=i.ownerDocument;if(i.data==="$~")i._reactRetry=c;else if(i.data!=="$?"||h.readyState!=="loading")c();else{var m=function(){c(),h.removeEventListener("DOMContentLoaded",m)};h.addEventListener("DOMContentLoaded",m),i._reactRetry=m}}function ui(i){for(;i!=null;i=i.nextSibling){var c=i.nodeType;if(c===1||c===3)break;if(c===8){if(c=i.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return i}var h2=null;function ZA(i){i=i.nextSibling;for(var c=0;i;){if(i.nodeType===8){var h=i.data;if(h==="/$"||h==="/&"){if(c===0)return ui(i.nextSibling);c--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||c++}i=i.nextSibling}return null}function QA(i){i=i.previousSibling;for(var c=0;i;){if(i.nodeType===8){var h=i.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(c===0)return i;c--}else h!=="/$"&&h!=="/&"||c++}i=i.previousSibling}return null}function JA(i,c,h){switch(c=Sx(h),i){case"html":if(i=c.documentElement,!i)throw Error(s(452));return i;case"head":if(i=c.head,!i)throw Error(s(453));return i;case"body":if(i=c.body,!i)throw Error(s(454));return i;default:throw Error(s(451))}}function Uh(i){for(var c=i.attributes;c.length;)i.removeAttributeNode(c[0]);An(i)}var di=new Map,eE=new Set;function jx(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var hl=q.d;q.d={f:cD,r:uD,D:dD,C:fD,L:hD,m:pD,X:mD,S:gD,M:xD};function cD(){var i=hl.f(),c=hx();return i||c}function uD(i){var c=Oe(i);c!==null&&c.tag===5&&c.type==="form"?x3(c):hl.r(i)}var Od=typeof document>"u"?null:document;function tE(i,c,h){var m=Od;if(m&&typeof c=="string"&&c){var w=Ls(c);w='link[rel="'+i+'"][href="'+w+'"]',typeof h=="string"&&(w+='[crossorigin="'+h+'"]'),eE.has(w)||(eE.add(w),i={rel:i,crossOrigin:h,href:c},m.querySelector(w)===null&&(c=m.createElement("link"),zs(c,"link",i),Lt(c),m.head.appendChild(c)))}}function dD(i){hl.D(i),tE("dns-prefetch",i,null)}function fD(i,c){hl.C(i,c),tE("preconnect",i,c)}function hD(i,c,h){hl.L(i,c,h);var m=Od;if(m&&i&&c){var w='link[rel="preload"][as="'+Ls(c)+'"]';c==="image"&&h&&h.imageSrcSet?(w+='[imagesrcset="'+Ls(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(w+='[imagesizes="'+Ls(h.imageSizes)+'"]')):w+='[href="'+Ls(i)+'"]';var T=w;switch(c){case"style":T=Bd(i);break;case"script":T=Nd(i)}di.has(T)||(i=g({rel:"preload",href:c==="image"&&h&&h.imageSrcSet?void 0:i,as:c},h),di.set(T,i),m.querySelector(w)!==null||c==="style"&&m.querySelector(qh(T))||c==="script"&&m.querySelector(Vh(T))||(c=m.createElement("link"),zs(c,"link",i),Lt(c),m.head.appendChild(c)))}}function pD(i,c){hl.m(i,c);var h=Od;if(h&&i){var m=c&&typeof c.as=="string"?c.as:"script",w='link[rel="modulepreload"][as="'+Ls(m)+'"][href="'+Ls(i)+'"]',T=w;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":T=Nd(i)}if(!di.has(T)&&(i=g({rel:"modulepreload",href:i},c),di.set(T,i),h.querySelector(w)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Vh(T)))return}m=h.createElement("link"),zs(m,"link",i),Lt(m),h.head.appendChild(m)}}}function gD(i,c,h){hl.S(i,c,h);var m=Od;if(m&&i){var w=ft(m).hoistableStyles,T=Bd(i);c=c||"default";var U=w.get(T);if(!U){var te={loading:0,preload:null};if(U=m.querySelector(qh(T)))te.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":c},h),(h=di.get(T))&&p2(i,h);var xe=U=m.createElement("link");Lt(xe),zs(xe,"link",i),xe._p=new Promise(function(De,Ze){xe.onload=De,xe.onerror=Ze}),xe.addEventListener("load",function(){te.loading|=1}),xe.addEventListener("error",function(){te.loading|=2}),te.loading|=4,Cx(U,c,m)}U={type:"stylesheet",instance:U,count:1,state:te},w.set(T,U)}}}function mD(i,c){hl.X(i,c);var h=Od;if(h&&i){var m=ft(h).hoistableScripts,w=Nd(i),T=m.get(w);T||(T=h.querySelector(Vh(w)),T||(i=g({src:i,async:!0},c),(c=di.get(w))&&g2(i,c),T=h.createElement("script"),Lt(T),zs(T,"link",i),h.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},m.set(w,T))}}function xD(i,c){hl.M(i,c);var h=Od;if(h&&i){var m=ft(h).hoistableScripts,w=Nd(i),T=m.get(w);T||(T=h.querySelector(Vh(w)),T||(i=g({src:i,async:!0,type:"module"},c),(c=di.get(w))&&g2(i,c),T=h.createElement("script"),Lt(T),zs(T,"link",i),h.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},m.set(w,T))}}function nE(i,c,h,m){var w=(w=se.current)?jx(w):null;if(!w)throw Error(s(446));switch(i){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(c=Bd(h.href),h=ft(w).hoistableStyles,m=h.get(c),m||(m={type:"style",instance:null,count:0,state:null},h.set(c,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){i=Bd(h.href);var T=ft(w).hoistableStyles,U=T.get(i);if(U||(w=w.ownerDocument||w,U={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},T.set(i,U),(T=w.querySelector(qh(i)))&&!T._p&&(U.instance=T,U.state.loading=5),di.has(i)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},di.set(i,h),T||bD(w,i,h,U.state))),c&&m===null)throw Error(s(528,""));return U}if(c&&m!==null)throw Error(s(529,""));return null;case"script":return c=h.async,h=h.src,typeof h=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=Nd(h),h=ft(w).hoistableScripts,m=h.get(c),m||(m={type:"script",instance:null,count:0,state:null},h.set(c,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,i))}}function Bd(i){return'href="'+Ls(i)+'"'}function qh(i){return'link[rel="stylesheet"]['+i+"]"}function rE(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function bD(i,c,h,m){i.querySelector('link[rel="preload"][as="style"]['+c+"]")?m.loading=1:(c=i.createElement("link"),m.preload=c,c.addEventListener("load",function(){return m.loading|=1}),c.addEventListener("error",function(){return m.loading|=2}),zs(c,"link",h),Lt(c),i.head.appendChild(c))}function Nd(i){return'[src="'+Ls(i)+'"]'}function Vh(i){return"script[async]"+i}function sE(i,c,h){if(c.count++,c.instance===null)switch(c.type){case"style":var m=i.querySelector('style[data-href~="'+Ls(h.href)+'"]');if(m)return c.instance=m,Lt(m),m;var w=g({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return m=(i.ownerDocument||i).createElement("style"),Lt(m),zs(m,"style",w),Cx(m,h.precedence,i),c.instance=m;case"stylesheet":w=Bd(h.href);var T=i.querySelector(qh(w));if(T)return c.state.loading|=4,c.instance=T,Lt(T),T;m=rE(h),(w=di.get(w))&&p2(m,w),T=(i.ownerDocument||i).createElement("link"),Lt(T);var U=T;return U._p=new Promise(function(te,xe){U.onload=te,U.onerror=xe}),zs(T,"link",m),c.state.loading|=4,Cx(T,h.precedence,i),c.instance=T;case"script":return T=Nd(h.src),(w=i.querySelector(Vh(T)))?(c.instance=w,Lt(w),w):(m=h,(w=di.get(T))&&(m=g({},h),g2(m,w)),i=i.ownerDocument||i,w=i.createElement("script"),Lt(w),zs(w,"link",m),i.head.appendChild(w),c.instance=w);case"void":return null;default:throw Error(s(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(m=c.instance,c.state.loading|=4,Cx(m,h.precedence,i));return c.instance}function Cx(i,c,h){for(var m=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),w=m.length?m[m.length-1]:null,T=w,U=0;U<m.length;U++){var te=m[U];if(te.dataset.precedence===c)T=te;else if(T!==w)break}T?T.parentNode.insertBefore(i,T.nextSibling):(c=h.nodeType===9?h.head:h,c.insertBefore(i,c.firstChild))}function p2(i,c){i.crossOrigin==null&&(i.crossOrigin=c.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=c.referrerPolicy),i.title==null&&(i.title=c.title)}function g2(i,c){i.crossOrigin==null&&(i.crossOrigin=c.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=c.referrerPolicy),i.integrity==null&&(i.integrity=c.integrity)}var wx=null;function oE(i,c,h){if(wx===null){var m=new Map,w=wx=new Map;w.set(h,m)}else w=wx,m=w.get(h),m||(m=new Map,w.set(h,m));if(m.has(i))return m;for(m.set(i,null),h=h.getElementsByTagName(i),w=0;w<h.length;w++){var T=h[w];if(!(T[cn]||T[at]||i==="link"&&T.getAttribute("rel")==="stylesheet")&&T.namespaceURI!=="http://www.w3.org/2000/svg"){var U=T.getAttribute(c)||"";U=i+U;var te=m.get(U);te?te.push(T):m.set(U,[T])}}return m}function iE(i,c,h){i=i.ownerDocument||i,i.head.insertBefore(h,c==="title"?i.querySelector("head > title"):null)}function yD(i,c,h){if(h===1||c.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;return c.rel==="stylesheet"?(i=c.disabled,typeof c.precedence=="string"&&i==null):!0;case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function aE(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function vD(i,c,h,m){if(h.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var w=Bd(m.href),T=c.querySelector(qh(w));if(T){c=T._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(i.count++,i=Ax.bind(i),c.then(i,i)),h.state.loading|=4,h.instance=T,Lt(T);return}T=c.ownerDocument||c,m=rE(m),(w=di.get(w))&&p2(m,w),T=T.createElement("link"),Lt(T);var U=T;U._p=new Promise(function(te,xe){U.onload=te,U.onerror=xe}),zs(T,"link",m),h.instance=T}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(h,c),(c=h.state.preload)&&(h.state.loading&3)===0&&(i.count++,h=Ax.bind(i),c.addEventListener("load",h),c.addEventListener("error",h))}}var m2=0;function SD(i,c){return i.stylesheets&&i.count===0&&Tx(i,i.stylesheets),0<i.count||0<i.imgCount?function(h){var m=setTimeout(function(){if(i.stylesheets&&Tx(i,i.stylesheets),i.unsuspend){var T=i.unsuspend;i.unsuspend=null,T()}},6e4+c);0<i.imgBytes&&m2===0&&(m2=62500*tD());var w=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Tx(i,i.stylesheets),i.unsuspend)){var T=i.unsuspend;i.unsuspend=null,T()}},(i.imgBytes>m2?50:800)+c);return i.unsuspend=h,function(){i.unsuspend=null,clearTimeout(m),clearTimeout(w)}}:null}function Ax(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Tx(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Ex=null;function Tx(i,c){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Ex=new Map,c.forEach(jD,i),Ex=null,Ax.call(i))}function jD(i,c){if(!(c.state.loading&4)){var h=Ex.get(i);if(h)var m=h.get(null);else{h=new Map,Ex.set(i,h);for(var w=i.querySelectorAll("link[data-precedence],style[data-precedence]"),T=0;T<w.length;T++){var U=w[T];(U.nodeName==="LINK"||U.getAttribute("media")!=="not all")&&(h.set(U.dataset.precedence,U),m=U)}m&&h.set(null,m)}w=c.instance,U=w.getAttribute("data-precedence"),T=h.get(U)||m,T===m&&h.set(null,w),h.set(U,w),this.count++,m=Ax.bind(this),w.addEventListener("load",m),w.addEventListener("error",m),T?T.parentNode.insertBefore(w,T.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(w,i.firstChild)),c.state.loading|=4}}var Gh={$$typeof:R,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function CD(i,c,h,m,w,T,U,te,xe){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=rn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rn(0),this.hiddenUpdates=rn(null),this.identifierPrefix=m,this.onUncaughtError=w,this.onCaughtError=T,this.onRecoverableError=U,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=xe,this.incompleteTransitions=new Map}function lE(i,c,h,m,w,T,U,te,xe,De,Ze,rt){return i=new CD(i,c,h,U,xe,De,Ze,rt,te),c=1,T===!0&&(c|=24),T=Oo(3,null,null,c),i.current=T,T.stateNode=i,c=Ky(),c.refCount++,i.pooledCache=c,c.refCount++,T.memoizedState={element:m,isDehydrated:h,cache:c},Jy(T),i}function cE(i){return i?(i=xd,i):xd}function uE(i,c,h,m,w,T){w=cE(w),m.context===null?m.context=w:m.pendingContext=w,m=Zl(c),m.payload={element:h},T=T===void 0?null:T,T!==null&&(m.callback=T),h=Ql(i,m,c),h!==null&&(go(h,i,c),Ah(h,i,c))}function dE(i,c){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var h=i.retryLane;i.retryLane=h!==0&&h<c?h:c}}function x2(i,c){dE(i,c),(i=i.alternate)&&dE(i,c)}function fE(i){if(i.tag===13||i.tag===31){var c=eu(i,67108864);c!==null&&go(c,i,67108864),x2(i,67108864)}}function hE(i){if(i.tag===13||i.tag===31){var c=Wo();c=Ee(c);var h=eu(i,c);h!==null&&go(h,i,c),x2(i,c)}}var kx=!0;function wD(i,c,h,m){var w=D.T;D.T=null;var T=q.p;try{q.p=2,b2(i,c,h,m)}finally{q.p=T,D.T=w}}function AD(i,c,h,m){var w=D.T;D.T=null;var T=q.p;try{q.p=8,b2(i,c,h,m)}finally{q.p=T,D.T=w}}function b2(i,c,h,m){if(kx){var w=y2(m);if(w===null)s2(i,c,m,Mx,h),gE(i,m);else if(TD(w,i,c,h,m))m.stopPropagation();else if(gE(i,m),c&4&&-1<ED.indexOf(i)){for(;w!==null;){var T=Oe(w);if(T!==null)switch(T.tag){case 3:if(T=T.stateNode,T.current.memoizedState.isDehydrated){var U=ln(T.pendingLanes);if(U!==0){var te=T;for(te.pendingLanes|=2,te.entangledLanes|=2;U;){var xe=1<<31-wt(U);te.entanglements[1]|=xe,U&=~xe}Ea(T),(Zn&6)===0&&(dx=ot()+500,$h(0))}}break;case 31:case 13:te=eu(T,2),te!==null&&go(te,T,2),hx(),x2(T,2)}if(T=y2(m),T===null&&s2(i,c,m,Mx,h),T===w)break;w=T}w!==null&&m.stopPropagation()}else s2(i,c,m,null,h)}}function y2(i){return i=Hl(i),v2(i)}var Mx=null;function v2(i){if(Mx=null,i=dn(i),i!==null){var c=a(i);if(c===null)i=null;else{var h=c.tag;if(h===13){if(i=l(c),i!==null)return i;i=null}else if(h===31){if(i=u(c),i!==null)return i;i=null}else if(h===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;i=null}else c!==i&&(i=null)}}return Mx=i,null}function pE(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(He()){case $e:return 2;case Z:return 8;case pe:case Q:return 32;case me:return 268435456;default:return 32}default:return 32}}var S2=!1,cc=null,uc=null,dc=null,Yh=new Map,Kh=new Map,fc=[],ED="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function gE(i,c){switch(i){case"focusin":case"focusout":cc=null;break;case"dragenter":case"dragleave":uc=null;break;case"mouseover":case"mouseout":dc=null;break;case"pointerover":case"pointerout":Yh.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Kh.delete(c.pointerId)}}function Xh(i,c,h,m,w,T){return i===null||i.nativeEvent!==T?(i={blockedOn:c,domEventName:h,eventSystemFlags:m,nativeEvent:T,targetContainers:[w]},c!==null&&(c=Oe(c),c!==null&&fE(c)),i):(i.eventSystemFlags|=m,c=i.targetContainers,w!==null&&c.indexOf(w)===-1&&c.push(w),i)}function TD(i,c,h,m,w){switch(c){case"focusin":return cc=Xh(cc,i,c,h,m,w),!0;case"dragenter":return uc=Xh(uc,i,c,h,m,w),!0;case"mouseover":return dc=Xh(dc,i,c,h,m,w),!0;case"pointerover":var T=w.pointerId;return Yh.set(T,Xh(Yh.get(T)||null,i,c,h,m,w)),!0;case"gotpointercapture":return T=w.pointerId,Kh.set(T,Xh(Kh.get(T)||null,i,c,h,m,w)),!0}return!1}function mE(i){var c=dn(i.target);if(c!==null){var h=a(c);if(h!==null){if(c=h.tag,c===13){if(c=l(h),c!==null){i.blockedOn=c,dt(i.priority,function(){hE(h)});return}}else if(c===31){if(c=u(h),c!==null){i.blockedOn=c,dt(i.priority,function(){hE(h)});return}}else if(c===3&&h.stateNode.current.memoizedState.isDehydrated){i.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Rx(i){if(i.blockedOn!==null)return!1;for(var c=i.targetContainers;0<c.length;){var h=y2(i.nativeEvent);if(h===null){h=i.nativeEvent;var m=new h.constructor(h.type,h);ms=m,h.target.dispatchEvent(m),ms=null}else return c=Oe(h),c!==null&&fE(c),i.blockedOn=h,!1;c.shift()}return!0}function xE(i,c,h){Rx(i)&&h.delete(c)}function kD(){S2=!1,cc!==null&&Rx(cc)&&(cc=null),uc!==null&&Rx(uc)&&(uc=null),dc!==null&&Rx(dc)&&(dc=null),Yh.forEach(xE),Kh.forEach(xE)}function zx(i,c){i.blockedOn===c&&(i.blockedOn=null,S2||(S2=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,kD)))}var Ix=null;function bE(i){Ix!==i&&(Ix=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ix===i&&(Ix=null);for(var c=0;c<i.length;c+=3){var h=i[c],m=i[c+1],w=i[c+2];if(typeof m!="function"){if(v2(m||h)===null)continue;break}var T=Oe(h);T!==null&&(i.splice(c,3),c-=3,yv(T,{pending:!0,data:w,method:h.method,action:m},m,w))}}))}function $d(i){function c(xe){return zx(xe,i)}cc!==null&&zx(cc,i),uc!==null&&zx(uc,i),dc!==null&&zx(dc,i),Yh.forEach(c),Kh.forEach(c);for(var h=0;h<fc.length;h++){var m=fc[h];m.blockedOn===i&&(m.blockedOn=null)}for(;0<fc.length&&(h=fc[0],h.blockedOn===null);)mE(h),h.blockedOn===null&&fc.shift();if(h=(i.ownerDocument||i).$$reactFormReplay,h!=null)for(m=0;m<h.length;m+=3){var w=h[m],T=h[m+1],U=w[lt]||null;if(typeof T=="function")U||bE(h);else if(U){var te=null;if(T&&T.hasAttribute("formAction")){if(w=T,U=T[lt]||null)te=U.formAction;else if(v2(w)!==null)continue}else te=U.action;typeof te=="function"?h[m+1]=te:(h.splice(m,3),m-=3),bE(h)}}}function yE(){function i(T){T.canIntercept&&T.info==="react-transition"&&T.intercept({handler:function(){return new Promise(function(U){return w=U})},focusReset:"manual",scroll:"manual"})}function c(){w!==null&&(w(),w=null),m||setTimeout(h,20)}function h(){if(!m&&!navigation.transition){var T=navigation.currentEntry;T&&T.url!=null&&navigation.navigate(T.url,{state:T.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,w=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(h,100),function(){m=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),w!==null&&(w(),w=null)}}}function j2(i){this._internalRoot=i}Fx.prototype.render=j2.prototype.render=function(i){var c=this._internalRoot;if(c===null)throw Error(s(409));var h=c.current,m=Wo();uE(h,m,i,c,null,null)},Fx.prototype.unmount=j2.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var c=i.containerInfo;uE(i.current,2,null,i,null,null),hx(),c[kt]=null}};function Fx(i){this._internalRoot=i}Fx.prototype.unstable_scheduleHydration=function(i){if(i){var c=Xe();i={blockedOn:null,target:i,priority:c};for(var h=0;h<fc.length&&c!==0&&c<fc[h].priority;h++);fc.splice(h,0,i),h===0&&mE(i)}};var vE=t.version;if(vE!=="19.2.5")throw Error(s(527,vE,"19.2.5"));q.findDOMNode=function(i){var c=i._reactInternals;if(c===void 0)throw typeof i.render=="function"?Error(s(188)):(i=Object.keys(i).join(","),Error(s(268,i)));return i=f(c),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var MD={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _x=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_x.isDisabled&&_x.supportsFiber)try{ht=_x.inject(MD),ct=_x}catch{}}return Qh.createRoot=function(i,c){if(!o(i))throw Error(s(299));var h=!1,m="",w=T3,T=k3,U=M3;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(m=c.identifierPrefix),c.onUncaughtError!==void 0&&(w=c.onUncaughtError),c.onCaughtError!==void 0&&(T=c.onCaughtError),c.onRecoverableError!==void 0&&(U=c.onRecoverableError)),c=lE(i,1,!1,null,null,h,m,null,w,T,U,yE),i[kt]=c.current,r2(i),new j2(c)},Qh.hydrateRoot=function(i,c,h){if(!o(i))throw Error(s(299));var m=!1,w="",T=T3,U=k3,te=M3,xe=null;return h!=null&&(h.unstable_strictMode===!0&&(m=!0),h.identifierPrefix!==void 0&&(w=h.identifierPrefix),h.onUncaughtError!==void 0&&(T=h.onUncaughtError),h.onCaughtError!==void 0&&(U=h.onCaughtError),h.onRecoverableError!==void 0&&(te=h.onRecoverableError),h.formState!==void 0&&(xe=h.formState)),c=lE(i,1,!0,c,h??null,m,w,xe,T,U,te,yE),c.context=cE(null),h=c.current,m=Wo(),m=Ee(m),w=Zl(m),w.callback=null,Ql(h,w,m),h=m,c.current.lanes=h,yt(c,h),Ea(c),i[kt]=c.current,r2(i),new Fx(c)},Qh.version="19.2.5",Qh}var RE;function ND(){if(RE)return A2.exports;RE=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),A2.exports=BD(),A2.exports}var $D=ND();var VM=e=>{throw TypeError(e)},HD=(e,t,n)=>t.has(e)||VM("Cannot "+n),M2=(e,t,n)=>(HD(e,t,"read from private field"),n?n.call(e):t.get(e)),WD=(e,t,n)=>t.has(e)?VM("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),zE="popstate";function IE(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function UD(e={}){function t(s,o){let a=o.state?.masked,{pathname:l,search:u,hash:d}=a||s.location;return Jp("",{pathname:l,search:u,hash:d},o.state&&o.state.usr||null,o.state&&o.state.key||"default",a?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function n(s,o){return typeof o=="string"?o:Ba(o)}return VD(t,n,null,e)}function Cn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Qr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function qD(){return Math.random().toString(36).substring(2,10)}function FE(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Jp(e,t,n=null,s,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?qa(t):t,state:n,key:t&&t.key||s||qD(),unstable_mask:o}}function Ba({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function qa(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substring(s),e=e.substring(0,s)),e&&(t.pathname=e)}return t}function VD(e,t,n,s={}){let{window:o=document.defaultView,v5Compat:a=!1}=s,l=o.history,u="POP",d=null,f=p();f==null&&(f=0,l.replaceState({...l.state,idx:f},""));function p(){return(l.state||{idx:null}).idx}function g(){u="POP";let j=p(),A=j==null?null:j-f;f=j,d&&d({action:u,location:S.location,delta:A})}function x(j,A){u="PUSH";let M=IE(j)?j:Jp(S.location,j,A);f=p()+1;let R=FE(M,f),_=S.createHref(M.unstable_mask||M);try{l.pushState(R,"",_)}catch(z){if(z instanceof DOMException&&z.name==="DataCloneError")throw z;o.location.assign(_)}a&&d&&d({action:u,location:S.location,delta:1})}function b(j,A){u="REPLACE";let M=IE(j)?j:Jp(S.location,j,A);f=p();let R=FE(M,f),_=S.createHref(M.unstable_mask||M);l.replaceState(R,"",_),a&&d&&d({action:u,location:S.location,delta:0})}function y(j){return GM(j)}let S={get action(){return u},get location(){return e(o,l)},listen(j){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(zE,g),d=j,()=>{o.removeEventListener(zE,g),d=null}},createHref(j){return t(o,j)},createURL:y,encodeLocation(j){let A=y(j);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:x,replace:b,go(j){return l.go(j)}};return S}function GM(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Cn(n,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Ba(e);return s=s.replace(/ $/,"%20"),!t&&s.startsWith("//")&&(s=n+s),new URL(s,n)}var Ap,_E=class{constructor(e){if(WD(this,Ap,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(M2(this,Ap).has(e))return M2(this,Ap).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){M2(this,Ap).set(e,t)}};Ap=new WeakMap;var GD=new Set(["lazy","caseSensitive","path","id","index","children"]);function YD(e){return GD.has(e)}var KD=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function XD(e){return KD.has(e)}function ZD(e){return e.index===!0}function eg(e,t,n=[],s={},o=!1){return e.map((a,l)=>{let u=[...n,String(l)],d=typeof a.id=="string"?a.id:u.join("-");if(Cn(a.index!==!0||!a.children,"Cannot specify children on an index route"),Cn(o||!s[d],`Found a route id collision on id "${d}". Route id's must be globally unique within Data Router usages`),ZD(a)){let f={...a,id:d};return s[d]=LE(f,t(f)),f}else{let f={...a,id:d,children:void 0};return s[d]=LE(f,t(f)),a.children&&(f.children=eg(a.children,t,u,s,o)),f}})}function LE(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function xc(e,t,n="/"){return Ep(e,t,n,!1)}function Ep(e,t,n,s){let o=typeof t=="string"?qa(t):t,a=_i(o.pathname||"/",n);if(a==null)return null;let l=YM(e);JD(l);let u=null;for(let d=0;u==null&&d<l.length;++d){let f=uO(a);u=lO(l[d],f,s)}return u}function QD(e,t){let{route:n,pathname:s,params:o}=e;return{id:n.id,pathname:s,params:o,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function YM(e,t=[],n=[],s="",o=!1){let a=(l,u,d=o,f)=>{let p={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(s)&&d)return;Cn(p.relativePath.startsWith(s),`Absolute route path "${p.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(s.length)}let g=Mi([s,p.relativePath]),x=n.concat(p);l.children&&l.children.length>0&&(Cn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),YM(l.children,t,x,g,d)),!(l.path==null&&!l.index)&&t.push({path:g,score:iO(g,l.index),routesMeta:x})};return e.forEach((l,u)=>{if(l.path===""||!l.path?.includes("?"))a(l,u);else for(let d of KM(l.path))a(l,u,!0,d)}),t}function KM(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,o=n.endsWith("?"),a=n.replace(/\?$/,"");if(s.length===0)return o?[a,""]:[a];let l=KM(s.join("/")),u=[];return u.push(...l.map(d=>d===""?a:[a,d].join("/"))),o&&u.push(...l),u.map(d=>e.startsWith("/")&&d===""?"/":d)}function JD(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:aO(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var eO=/^:[\w-]+$/,tO=3,nO=2,rO=1,sO=10,oO=-2,PE=e=>e==="*";function iO(e,t){let n=e.split("/"),s=n.length;return n.some(PE)&&(s+=oO),t&&(s+=nO),n.filter(o=>!PE(o)).reduce((o,a)=>o+(eO.test(a)?tO:a===""?rO:sO),s)}function aO(e,t){return e.length===t.length&&e.slice(0,-1).every((s,o)=>s===t[o])?e[e.length-1]-t[t.length-1]:0}function lO(e,t,n=!1){let{routesMeta:s}=e,o={},a="/",l=[];for(let u=0;u<s.length;++u){let d=s[u],f=u===s.length-1,p=a==="/"?t:t.slice(a.length)||"/",g=Y0({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},p),x=d.route;if(!g&&f&&n&&!s[s.length-1].route.index&&(g=Y0({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},p)),!g)return null;Object.assign(o,g.params),l.push({params:o,pathname:Mi([a,g.pathname]),pathnameBase:hO(Mi([a,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(a=Mi([a,g.pathnameBase]))}return l}function Y0(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=cO(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let a=o[0],l=a.replace(/(.)\/+$/,"$1"),u=o.slice(1);return{params:s.reduce((f,{paramName:p,isOptional:g},x)=>{if(p==="*"){let y=u[x]||"";l=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const b=u[x];return g&&!b?f[p]=void 0:f[p]=(b||"").replace(/%2F/g,"/"),f},{}),pathname:a,pathnameBase:l,pattern:e}}function cO(e,t=!1,n=!0){Qr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d,f,p)=>{if(s.push({paramName:u,isOptional:d!=null}),d){let g=p.charAt(f+l.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),s]}function uO(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Qr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function _i(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}function dO({basename:e,pathname:t}){return t==="/"?e:Mi([e,t])}var XM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wj=e=>XM.test(e);function fO(e,t="/"){let{pathname:n,search:s="",hash:o=""}=typeof e=="string"?qa(e):e,a;return n?(n=Aj(n),n.startsWith("/")?a=DE(n.substring(1),"/"):a=DE(n,t)):a=t,{pathname:a,search:pO(s),hash:gO(o)}}function DE(e,t){let n=K0(t).split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function R2(e,t,n,s){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ZM(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function H1(e){let t=ZM(e);return t.map((n,s)=>s===t.length-1?n.pathname:n.pathnameBase)}function _g(e,t,n,s=!1){let o;typeof e=="string"?o=qa(e):(o={...e},Cn(!o.pathname||!o.pathname.includes("?"),R2("?","pathname","search",o)),Cn(!o.pathname||!o.pathname.includes("#"),R2("#","pathname","hash",o)),Cn(!o.search||!o.search.includes("#"),R2("#","search","hash",o)));let a=e===""||o.pathname==="",l=a?"/":o.pathname,u;if(l==null)u=n;else{let g=t.length-1;if(!s&&l.startsWith("..")){let x=l.split("/");for(;x[0]==="..";)x.shift(),g-=1;o.pathname=x.join("/")}u=g>=0?t[g]:"/"}let d=fO(o,u),f=l&&l!=="/"&&l.endsWith("/"),p=(a||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||p)&&(d.pathname+="/"),d}var Aj=e=>e.replace(/\/\/+/g,"/"),Mi=e=>Aj(e.join("/")),K0=e=>e.replace(/\/+$/,""),hO=e=>K0(e).replace(/^\/*/,"/"),pO=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,gO=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Lg=class{constructor(e,t,n,s=!1){this.status=e,this.statusText=t||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function tg(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Pg(e){let t=e.map(n=>n.route.path).filter(Boolean);return Mi(t)||"/"}var QM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function JM(e,t){let n=e;if(typeof n!="string"||!XM.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,o=!1;if(QM)try{let a=new URL(window.location.href),l=n.startsWith("//")?new URL(a.protocol+n):new URL(n),u=_i(l.pathname,t);l.origin===a.origin&&u!=null?n=u+l.search+l.hash:o=!0}catch{Qr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:o,to:n}}var Cc=Symbol("Uninstrumented");function mO(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(a){let l=Object.keys(n);for(let u of l)a[u]&&n[u].push(a[u])}}));let s={};if(typeof t.lazy=="function"&&n.lazy.length>0){let o=gf(n.lazy,t.lazy,()=>{});o&&(s.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(a=>{let l=o[a],u=n[`lazy.${a}`];if(typeof l=="function"&&u.length>0){let d=gf(u,l,()=>{});d&&(s.lazy=Object.assign(s.lazy||{},{[a]:d}))}})}return["loader","action"].forEach(o=>{let a=t[o];if(typeof a=="function"&&n[o].length>0){let l=a[Cc]??a,u=gf(n[o],l,(...d)=>OE(d[0]));u&&(o==="loader"&&l.hydrate===!0&&(u.hydrate=!0),u[Cc]=l,s[o]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(s.middleware=t.middleware.map(o=>{let a=o[Cc]??o,l=gf(n.middleware,a,(...u)=>OE(u[0]));return l?(l[Cc]=a,l):o})),s}function xO(e,t){let n={navigate:[],fetch:[]};if(t.forEach(s=>s({instrument(o){let a=Object.keys(o);for(let l of a)o[l]&&n[l].push(o[l])}})),n.navigate.length>0){let s=e.navigate[Cc]??e.navigate,o=gf(n.navigate,s,(...a)=>{let[l,u]=a;return{to:typeof l=="number"||typeof l=="string"?l:l?Ba(l):".",...BE(e,u??{})}});o&&(o[Cc]=s,e.navigate=o)}if(n.fetch.length>0){let s=e.fetch[Cc]??e.fetch,o=gf(n.fetch,s,(...a)=>{let[l,,u,d]=a;return{href:u??".",fetcherKey:l,...BE(e,d??{})}});o&&(o[Cc]=s,e.fetch=o)}return e}function gf(e,t,n){return e.length===0?null:async(...s)=>{let o=await e7(e,n(...s),()=>t(...s),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function e7(e,t,n,s){let o=e[s],a;if(o){let l,u=async()=>(l?console.error("You cannot call instrumented handlers more than once"):l=e7(e,t,n,s-1),a=await l,Cn(a,"Expected a result"),a.type==="error"&&a.value instanceof Error?{status:"error",error:a.value}:{status:"success",error:void 0});try{await o(u,t)}catch(d){console.error("An instrumentation function threw an error:",d)}l||await u(),await l}else try{a={type:"success",value:await n()}}catch(l){a={type:"error",value:l}}return a||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function OE(e){let{request:t,context:n,params:s,unstable_pattern:o}=e;return{request:bO(t),params:{...s},unstable_pattern:o,context:yO(n)}}function BE(e,t){return{currentUrl:Ba(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function bO(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function yO(e){if(SO(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var vO=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function SO(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===vO}var t7=["POST","PUT","PATCH","DELETE"],jO=new Set(t7),CO=["GET",...t7],wO=new Set(CO),n7=new Set([301,302,303,307,308]),AO=new Set([307,308]),z2={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},EO={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Jh={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},TO=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),r7="remix-router-transitions",s7=Symbol("ResetLoaderData");function kO(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";Cn(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=e.hydrationRouteProperties||[],o=e.mapRouteProperties||TO,a=o;if(e.unstable_instrumentations){let he=e.unstable_instrumentations;a=Ee=>({...o(Ee),...mO(he.map(Fe=>Fe.route).filter(Boolean),Ee)})}let l={},u=eg(e.routes,a,void 0,l),d,f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let p=e.dataStrategy||FO,g={unstable_passThroughRequests:!1,...e.future},x=null,b=new Set,y=null,S=null,j=null,A=e.hydrationData!=null,M=xc(u,e.history.location,f),R=!1,_=null,z,F;if(M==null&&!e.patchRoutesOnNavigation){let he=xi(404,{pathname:e.history.location.pathname}),{matches:Ee,route:Fe}=Lx(u);z=!0,F=!z,M=Ee,_={[Fe.id]:he}}else if(M&&!e.hydrationData&&rn(M,u,e.history.location.pathname).active&&(M=null),M)if(M.some(he=>he.route.lazy))z=!1,F=!z;else if(!M.some(he=>Ej(he.route)))z=!0,F=!z;else{let he=e.hydrationData?e.hydrationData.loaderData:null,Ee=e.hydrationData?e.hydrationData.errors:null,Fe=M;if(Ee){let Xe=M.findIndex(dt=>Ee[dt.route.id]!==void 0);Fe=Fe.slice(0,Xe+1)}F=!1,z=!0,Fe.forEach(Xe=>{let dt=o7(Xe.route,he,Ee);F=F||dt.renderFallback,z=z&&!dt.shouldLoad})}else{z=!1,F=!z,M=[];let he=rn(null,u,e.history.location.pathname);he.active&&he.matches&&(R=!0,M=he.matches)}let N,I={historyAction:e.history.action,location:e.history.location,matches:M,initialized:z,renderFallback:F,navigation:z2,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||_,fetchers:new Map,blockers:new Map},B="POP",H=null,P=!1,k,L=!1,O=new Map,W=null,D=!1,q=!1,K=new Set,Y=new Map,ie=0,V=-1,re=new Map,fe=new Set,ae=new Map,ue=new Map,se=new Set,J=new Map,ce,oe=null;function ge(){if(x=e.history.listen(({action:he,location:Ee,delta:Fe})=>{if(ce){ce(),ce=void 0;return}Qr(J.size===0||Fe!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Xe=Xt({currentLocation:I.location,nextLocation:Ee,historyAction:he});if(Xe&&Fe!=null){let dt=new Promise(At=>{ce=At});e.history.go(Fe*-1),Yt(Xe,{state:"blocked",location:Ee,proceed(){Yt(Xe,{state:"proceeding",proceed:void 0,reset:void 0,location:Ee}),dt.then(()=>e.history.go(Fe))},reset(){let At=new Map(I.blockers);At.set(Xe,Jh),ee({blockers:At})}}),H?.resolve(),H=null;return}return Ge(he,Ee)}),n){ZO(t,O);let he=()=>QO(t,O);t.addEventListener("pagehide",he),W=()=>t.removeEventListener("pagehide",he)}return I.initialized||Ge("POP",I.location,{initialHydration:!0}),N}function de(){x&&x(),W&&W(),b.clear(),k&&k.abort(),I.fetchers.forEach((he,Ee)=>ht(Ee)),I.blockers.forEach((he,Ee)=>_t(Ee))}function le(he){return b.add(he),()=>b.delete(he)}function ee(he,Ee={}){he.matches&&(he.matches=he.matches.map(dt=>{let At=l[dt.route.id],at=dt.route;return at.element!==At.element||at.errorElement!==At.errorElement||at.hydrateFallbackElement!==At.hydrateFallbackElement?{...dt,route:At}:dt})),I={...I,...he};let Fe=[],Xe=[];I.fetchers.forEach((dt,At)=>{dt.state==="idle"&&(se.has(At)?Fe.push(At):Xe.push(At))}),se.forEach(dt=>{!I.fetchers.has(dt)&&!Y.has(dt)&&Fe.push(dt)}),[...b].forEach(dt=>dt(I,{deletedFetchers:Fe,newErrors:he.errors??null,viewTransitionOpts:Ee.viewTransitionOpts,flushSync:Ee.flushSync===!0})),Fe.forEach(dt=>ht(dt)),Xe.forEach(dt=>I.fetchers.delete(dt))}function X(he,Ee,{flushSync:Fe}={}){let Xe=I.actionData!=null&&I.navigation.formMethod!=null&&Ns(I.navigation.formMethod)&&I.navigation.state==="loading"&&he.state?._isRedirect!==!0,dt;Ee.actionData?Object.keys(Ee.actionData).length>0?dt=Ee.actionData:dt=null:Xe?dt=I.actionData:dt=null;let At=Ee.loaderData?XE(I.loaderData,Ee.loaderData,Ee.matches||[],Ee.errors):I.loaderData,at=I.blockers;at.size>0&&(at=new Map(at),at.forEach((Nt,Dt)=>at.set(Dt,Jh)));let lt=D?!1:Ht(he,Ee.matches||I.matches),kt=P===!0||I.navigation.formMethod!=null&&Ns(I.navigation.formMethod)&&he.state?._isRedirect!==!0;d&&(u=d,d=void 0),D||B==="POP"||(B==="PUSH"?e.history.push(he,he.state):B==="REPLACE"&&e.history.replace(he,he.state));let vt;if(B==="POP"){let Nt=O.get(I.location.pathname);Nt&&Nt.has(he.pathname)?vt={currentLocation:I.location,nextLocation:he}:O.has(he.pathname)&&(vt={currentLocation:he,nextLocation:I.location})}else if(L){let Nt=O.get(I.location.pathname);Nt?Nt.add(he.pathname):(Nt=new Set([he.pathname]),O.set(I.location.pathname,Nt)),vt={currentLocation:I.location,nextLocation:he}}ee({...Ee,actionData:dt,loaderData:At,historyAction:B,location:he,initialized:!0,renderFallback:!1,navigation:z2,revalidation:"idle",restoreScrollPosition:lt,preventScrollReset:kt,blockers:at},{viewTransitionOpts:vt,flushSync:Fe===!0}),B="POP",P=!1,L=!1,D=!1,q=!1,H?.resolve(),H=null,oe?.resolve(),oe=null}async function ve(he,Ee){if(H?.resolve(),H=null,typeof he=="number"){H||(H=eT());let An=H.promise;return e.history.go(he),An}let Fe=nS(I.location,I.matches,f,he,Ee?.fromRouteId,Ee?.relative),{path:Xe,submission:dt,error:At}=NE(!1,Fe,Ee),at;Ee?.unstable_mask&&(at={pathname:"",search:"",hash:"",...typeof Ee.unstable_mask=="string"?qa(Ee.unstable_mask):{...I.location.unstable_mask,...Ee.unstable_mask}});let lt=I.location,kt=Jp(lt,Xe,Ee&&Ee.state,void 0,at);kt={...kt,...e.history.encodeLocation(kt)};let vt=Ee&&Ee.replace!=null?Ee.replace:void 0,Nt="PUSH";vt===!0?Nt="REPLACE":vt===!1||dt!=null&&Ns(dt.formMethod)&&dt.formAction===I.location.pathname+I.location.search&&(Nt="REPLACE");let Dt=Ee&&"preventScrollReset"in Ee?Ee.preventScrollReset===!0:void 0,vn=(Ee&&Ee.flushSync)===!0,cn=Xt({currentLocation:lt,nextLocation:kt,historyAction:Nt});if(cn){Yt(cn,{state:"blocked",location:kt,proceed(){Yt(cn,{state:"proceeding",proceed:void 0,reset:void 0,location:kt}),ve(he,Ee)},reset(){let An=new Map(I.blockers);An.set(cn,Jh),ee({blockers:An})}});return}await Ge(Nt,kt,{submission:dt,pendingError:At,preventScrollReset:Dt,replace:Ee&&Ee.replace,enableViewTransition:Ee&&Ee.viewTransition,flushSync:vn,callSiteDefaultShouldRevalidate:Ee&&Ee.unstable_defaultShouldRevalidate})}function st(){oe||(oe=eT()),pe(),ee({revalidation:"loading"});let he=oe.promise;return I.navigation.state==="submitting"?he:I.navigation.state==="idle"?(Ge(I.historyAction,I.location,{startUninterruptedRevalidation:!0}),he):(Ge(B||I.historyAction,I.navigation.location,{overrideNavigation:I.navigation,enableViewTransition:L===!0}),he)}async function Ge(he,Ee,Fe){k&&k.abort(),k=null,B=he,D=(Fe&&Fe.startUninterruptedRevalidation)===!0,Bn(I.location,I.matches),P=(Fe&&Fe.preventScrollReset)===!0,L=(Fe&&Fe.enableViewTransition)===!0;let Xe=d||u,dt=Fe&&Fe.overrideNavigation,At=Fe?.initialHydration&&I.matches&&I.matches.length>0&&!R?I.matches:xc(Xe,Ee,f),at=(Fe&&Fe.flushSync)===!0;if(At&&I.initialized&&!q&&$O(I.location,Ee)&&!(Fe&&Fe.submission&&Ns(Fe.submission.formMethod))){X(Ee,{matches:At},{flushSync:at});return}let lt=rn(At,Xe,Ee.pathname);if(lt.active&<.matches&&(At=lt.matches),!At){let{error:dn,notFoundMatches:Oe,route:_e}=ln(Ee.pathname);X(Ee,{matches:Oe,loaderData:{},errors:{[_e.id]:dn}},{flushSync:at});return}k=new AbortController;let kt=rf(e.history,Ee,k.signal,Fe&&Fe.submission),vt=e.getContext?await e.getContext():new _E,Nt;if(Fe&&Fe.pendingError)Nt=[bc(At).route.id,{type:"error",error:Fe.pendingError}];else if(Fe&&Fe.submission&&Ns(Fe.submission.formMethod)){let dn=await qe(kt,Ee,Fe.submission,At,vt,lt.active,Fe&&Fe.initialHydration===!0,{replace:Fe.replace,flushSync:at});if(dn.shortCircuited)return;if(dn.pendingActionResult){let[Oe,_e]=dn.pendingActionResult;if(qo(_e)&&tg(_e.error)&&_e.error.status===404){k=null,X(Ee,{matches:dn.matches,loaderData:{},errors:{[Oe]:_e.error}});return}}At=dn.matches||At,Nt=dn.pendingActionResult,dt=I2(Ee,Fe.submission),at=!1,lt.active=!1,kt=rf(e.history,kt.url,kt.signal)}let{shortCircuited:Dt,matches:vn,loaderData:cn,errors:An}=await Be(kt,Ee,At,vt,lt.active,dt,Fe&&Fe.submission,Fe&&Fe.fetcherSubmission,Fe&&Fe.replace,Fe&&Fe.initialHydration===!0,at,Nt,Fe&&Fe.callSiteDefaultShouldRevalidate);Dt||(k=null,X(Ee,{matches:vn||At,...ZE(Nt),loaderData:cn,errors:An}))}async function qe(he,Ee,Fe,Xe,dt,At,at,lt={}){pe();let kt=KO(Ee,Fe);if(ee({navigation:kt},{flushSync:lt.flushSync===!0}),At){let Dt=await yt(Xe,Ee.pathname,he.signal);if(Dt.type==="aborted")return{shortCircuited:!0};if(Dt.type==="error"){if(Dt.partialMatches.length===0){let{matches:cn,route:An}=Lx(u);return{matches:cn,pendingActionResult:[An.id,{type:"error",error:Dt.error}]}}let vn=bc(Dt.partialMatches).route.id;return{matches:Dt.partialMatches,pendingActionResult:[vn,{type:"error",error:Dt.error}]}}else if(Dt.matches)Xe=Dt.matches;else{let{notFoundMatches:vn,error:cn,route:An}=ln(Ee.pathname);return{matches:vn,pendingActionResult:[An.id,{type:"error",error:cn}]}}}let vt,Nt=I0(Xe,Ee);if(!Nt.route.action&&!Nt.route.lazy)vt={type:"error",error:xi(405,{method:he.method,pathname:Ee.pathname,routeId:Nt.route.id})};else{let Dt=Cf(a,l,he,Ee,Xe,Nt,at?[]:s,dt),vn=await $e(he,Ee,Dt,dt,null);if(vt=vn[Nt.route.id],!vt){for(let cn of Xe)if(vn[cn.route.id]){vt=vn[cn.route.id];break}}if(he.signal.aborted)return{shortCircuited:!0}}if(vu(vt)){let Dt;return lt&<.replace!=null?Dt=lt.replace:Dt=GE(vt.response.headers.get("Location"),new URL(he.url),f,e.history)===I.location.pathname+I.location.search,await He(he,vt,!0,{submission:Fe,replace:Dt}),{shortCircuited:!0}}if(qo(vt)){let Dt=bc(Xe,Nt.route.id);return(lt&<.replace)!==!0&&(B="PUSH"),{matches:Xe,pendingActionResult:[Dt.route.id,vt,Nt.route.id]}}return{matches:Xe,pendingActionResult:[Nt.route.id,vt]}}async function Be(he,Ee,Fe,Xe,dt,At,at,lt,kt,vt,Nt,Dt,vn){let cn=At||I2(Ee,at),An=at||lt||JE(cn),dn=!D&&!vt;if(dt){if(dn){let Nn=Te(Dt);ee({navigation:cn,...Nn!==void 0?{actionData:Nn}:{}},{flushSync:Nt})}let zt=await yt(Fe,Ee.pathname,he.signal);if(zt.type==="aborted")return{shortCircuited:!0};if(zt.type==="error"){if(zt.partialMatches.length===0){let{matches:ar,route:Hn}=Lx(u);return{matches:ar,loaderData:{},errors:{[Hn.id]:zt.error}}}let Nn=bc(zt.partialMatches).route.id;return{matches:zt.partialMatches,loaderData:{},errors:{[Nn]:zt.error}}}else if(zt.matches)Fe=zt.matches;else{let{error:Nn,notFoundMatches:ar,route:Hn}=ln(Ee.pathname);return{matches:ar,loaderData:{},errors:{[Hn.id]:Nn}}}}let Oe=d||u,{dsMatches:_e,revalidatingFetchers:ft}=$E(he,Xe,a,l,e.history,I,Fe,An,Ee,vt?[]:s,vt===!0,q,K,se,ae,fe,Oe,f,e.patchRoutesOnNavigation!=null,Dt,vn);if(V=++ie,!e.dataStrategy&&!_e.some(zt=>zt.shouldLoad)&&!_e.some(zt=>zt.route.middleware&&zt.route.middleware.length>0)&&ft.length===0){let zt=gn();return X(Ee,{matches:Fe,loaderData:{},errors:Dt&&qo(Dt[1])?{[Dt[0]]:Dt[1].error}:null,...ZE(Dt),...zt?{fetchers:new Map(I.fetchers)}:{}},{flushSync:Nt}),{shortCircuited:!0}}if(dn){let zt={};if(!dt){zt.navigation=cn;let Nn=Te(Dt);Nn!==void 0&&(zt.actionData=Nn)}ft.length>0&&(zt.fetchers=Re(ft)),ee(zt,{flushSync:Nt})}ft.forEach(zt=>{bt(zt.key),zt.controller&&Y.set(zt.key,zt.controller)});let Lt=()=>ft.forEach(zt=>bt(zt.key));k&&k.signal.addEventListener("abort",Lt);let{loaderResults:Qt,fetcherResults:sn}=await Z(_e,ft,he,Ee,Xe);if(he.signal.aborted)return{shortCircuited:!0};k&&k.signal.removeEventListener("abort",Lt),ft.forEach(zt=>Y.delete(zt.key));let on=Px(Qt);if(on)return await He(he,on.result,!0,{replace:kt}),{shortCircuited:!0};if(on=Px(sn),on)return fe.add(on.key),await He(he,on.result,!0,{replace:kt}),{shortCircuited:!0};let{loaderData:ir,errors:$r}=KE(I,Fe,Qt,Dt,ft,sn);vt&&I.errors&&($r={...I.errors,...$r});let Ts=gn(),zo=mn(V),Io=Ts||zo||ft.length>0;return{matches:Fe,loaderData:ir,errors:$r,...Io?{fetchers:new Map(I.fetchers)}:{}}}function Te(he){if(he&&!qo(he[1]))return{[he[0]]:he[1].data};if(I.actionData)return Object.keys(I.actionData).length===0?null:I.actionData}function Re(he){return he.forEach(Ee=>{let Fe=I.fetchers.get(Ee.key),Xe=ep(void 0,Fe?Fe.data:void 0);I.fetchers.set(Ee.key,Xe)}),new Map(I.fetchers)}async function Se(he,Ee,Fe,Xe){bt(he);let dt=(Xe&&Xe.flushSync)===!0,At=d||u,at=nS(I.location,I.matches,f,Fe,Ee,Xe?.relative),lt=xc(At,at,f),kt=rn(lt,At,at);if(kt.active&&kt.matches&&(lt=kt.matches),!lt){me(he,Ee,xi(404,{pathname:at}),{flushSync:dt});return}let{path:vt,submission:Nt,error:Dt}=NE(!0,at,Xe);if(Dt){me(he,Ee,Dt,{flushSync:dt});return}let vn=e.getContext?await e.getContext():new _E,cn=(Xe&&Xe.preventScrollReset)===!0;if(Nt&&Ns(Nt.formMethod)){await Ke(he,Ee,vt,lt,vn,kt.active,dt,cn,Nt,Xe&&Xe.unstable_defaultShouldRevalidate);return}ae.set(he,{routeId:Ee,path:vt}),await ot(he,Ee,vt,lt,vn,kt.active,dt,cn,Nt)}async function Ke(he,Ee,Fe,Xe,dt,At,at,lt,kt,vt){pe(),ae.delete(he);let Nt=I.fetchers.get(he);Q(he,XO(kt,Nt),{flushSync:at});let Dt=new AbortController,vn=rf(e.history,Fe,Dt.signal,kt);if(At){let Xn=await yt(Xe,new URL(vn.url).pathname,vn.signal,he);if(Xn.type==="aborted")return;if(Xn.type==="error"){me(he,Ee,Xn.error,{flushSync:at});return}else if(Xn.matches)Xe=Xn.matches;else{me(he,Ee,xi(404,{pathname:Fe}),{flushSync:at});return}}let cn=I0(Xe,Fe);if(!cn.route.action&&!cn.route.lazy){let Xn=xi(405,{method:kt.formMethod,pathname:Fe,routeId:Ee});me(he,Ee,Xn,{flushSync:at});return}Y.set(he,Dt);let An=ie,dn=Cf(a,l,vn,Fe,Xe,cn,s,dt),Oe=await $e(vn,Fe,dn,dt,he),_e=Oe[cn.route.id];if(!_e){for(let Xn of dn)if(Oe[Xn.route.id]){_e=Oe[Xn.route.id];break}}if(vn.signal.aborted){Y.get(he)===Dt&&Y.delete(he);return}if(se.has(he)){if(vu(_e)||qo(_e)){Q(he,bl(void 0));return}}else{if(vu(_e))if(Y.delete(he),V>An){Q(he,bl(void 0));return}else return fe.add(he),Q(he,ep(kt)),He(vn,_e,!1,{fetcherSubmission:kt,preventScrollReset:lt});if(qo(_e)){me(he,Ee,_e.error);return}}let ft=I.navigation.location||I.location,Lt=rf(e.history,ft,Dt.signal),Qt=d||u,sn=I.navigation.state!=="idle"?xc(Qt,I.navigation.location,f):I.matches;Cn(sn,"Didn't find any matches after fetcher action");let on=++ie;re.set(he,on);let ir=ep(kt,_e.data);I.fetchers.set(he,ir);let{dsMatches:$r,revalidatingFetchers:Ts}=$E(Lt,dt,a,l,e.history,I,sn,kt,ft,s,!1,q,K,se,ae,fe,Qt,f,e.patchRoutesOnNavigation!=null,[cn.route.id,_e],vt);Ts.filter(Xn=>Xn.key!==he).forEach(Xn=>{let ao=Xn.key,Vi=I.fetchers.get(ao),Xa=ep(void 0,Vi?Vi.data:void 0);I.fetchers.set(ao,Xa),bt(ao),Xn.controller&&Y.set(ao,Xn.controller)}),ee({fetchers:new Map(I.fetchers)});let zo=()=>Ts.forEach(Xn=>bt(Xn.key));Dt.signal.addEventListener("abort",zo);let{loaderResults:Io,fetcherResults:zt}=await Z($r,Ts,Lt,ft,dt);if(Dt.signal.aborted)return;if(Dt.signal.removeEventListener("abort",zo),re.delete(he),Y.delete(he),Ts.forEach(Xn=>Y.delete(Xn.key)),I.fetchers.has(he)){let Xn=bl(_e.data);I.fetchers.set(he,Xn)}let Nn=Px(Io);if(Nn)return He(Lt,Nn.result,!1,{preventScrollReset:lt});if(Nn=Px(zt),Nn)return fe.add(Nn.key),He(Lt,Nn.result,!1,{preventScrollReset:lt});let{loaderData:ar,errors:Hn}=KE(I,sn,Io,void 0,Ts,zt);mn(on),I.navigation.state==="loading"&&on>V?(Cn(B,"Expected pending action"),k&&k.abort(),X(I.navigation.location,{matches:sn,loaderData:ar,errors:Hn,fetchers:new Map(I.fetchers)})):(ee({errors:Hn,loaderData:XE(I.loaderData,ar,sn,Hn),fetchers:new Map(I.fetchers)}),q=!1)}async function ot(he,Ee,Fe,Xe,dt,At,at,lt,kt){let vt=I.fetchers.get(he);Q(he,ep(kt,vt?vt.data:void 0),{flushSync:at});let Nt=new AbortController,Dt=rf(e.history,Fe,Nt.signal);if(At){let _e=await yt(Xe,new URL(Dt.url).pathname,Dt.signal,he);if(_e.type==="aborted")return;if(_e.type==="error"){me(he,Ee,_e.error,{flushSync:at});return}else if(_e.matches)Xe=_e.matches;else{me(he,Ee,xi(404,{pathname:Fe}),{flushSync:at});return}}let vn=I0(Xe,Fe);Y.set(he,Nt);let cn=ie,An=Cf(a,l,Dt,Fe,Xe,vn,s,dt),Oe=(await $e(Dt,Fe,An,dt,he))[vn.route.id];if(Y.get(he)===Nt&&Y.delete(he),!Dt.signal.aborted){if(se.has(he)){Q(he,bl(void 0));return}if(vu(Oe))if(V>cn){Q(he,bl(void 0));return}else{fe.add(he),await He(Dt,Oe,!1,{preventScrollReset:lt});return}if(qo(Oe)){me(he,Ee,Oe.error);return}Q(he,bl(Oe.data))}}async function He(he,Ee,Fe,{submission:Xe,fetcherSubmission:dt,preventScrollReset:At,replace:at}={}){Fe||(H?.resolve(),H=null),Ee.response.headers.has("X-Remix-Revalidate")&&(q=!0);let lt=Ee.response.headers.get("Location");Cn(lt,"Expected a Location header on the redirect Response"),lt=GE(lt,new URL(he.url),f,e.history);let kt=Jp(I.location,lt,{_isRedirect:!0});if(n){let An=!1;if(Ee.response.headers.has("X-Remix-Reload-Document"))An=!0;else if(wj(lt)){const dn=GM(lt,!0);An=dn.origin!==t.location.origin||_i(dn.pathname,f)==null}if(An){at?t.location.replace(lt):t.location.assign(lt);return}}k=null;let vt=at===!0||Ee.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Nt,formAction:Dt,formEncType:vn}=I.navigation;!Xe&&!dt&&Nt&&Dt&&vn&&(Xe=JE(I.navigation));let cn=Xe||dt;if(AO.has(Ee.response.status)&&cn&&Ns(cn.formMethod))await Ge(vt,kt,{submission:{...cn,formAction:lt},preventScrollReset:At||P,enableViewTransition:Fe?L:void 0});else{let An=I2(kt,Xe);await Ge(vt,kt,{overrideNavigation:An,fetcherSubmission:dt,preventScrollReset:At||P,enableViewTransition:Fe?L:void 0})}}async function $e(he,Ee,Fe,Xe,dt){let At,at={};try{At=await LO(p,he,Ee,Fe,dt,Xe,!1)}catch(lt){return Fe.filter(kt=>kt.shouldLoad).forEach(kt=>{at[kt.route.id]={type:"error",error:lt}}),at}if(he.signal.aborted)return at;if(!Ns(he.method))for(let lt of Fe){if(At[lt.route.id]?.type==="error")break;!At.hasOwnProperty(lt.route.id)&&!I.loaderData.hasOwnProperty(lt.route.id)&&(!I.errors||!I.errors.hasOwnProperty(lt.route.id))&<.shouldCallHandler()&&(At[lt.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${lt.route.id}`)})}for(let[lt,kt]of Object.entries(At))if(qO(kt)){let vt=kt.result;at[lt]={type:"redirect",response:BO(vt,he,lt,Fe,f)}}else at[lt]=await OO(kt);return at}async function Z(he,Ee,Fe,Xe,dt){let At=$e(Fe,Xe,he,dt,null),at=Promise.all(Ee.map(async vt=>{if(vt.matches&&vt.match&&vt.request&&vt.controller){let Dt=(await $e(vt.request,vt.path,vt.matches,dt,vt.key))[vt.match.route.id];return{[vt.key]:Dt}}else return Promise.resolve({[vt.key]:{type:"error",error:xi(404,{pathname:vt.path})}})})),lt=await At,kt=(await at).reduce((vt,Nt)=>Object.assign(vt,Nt),{});return{loaderResults:lt,fetcherResults:kt}}function pe(){q=!0,ae.forEach((he,Ee)=>{Y.has(Ee)&&K.add(Ee),bt(Ee)})}function Q(he,Ee,Fe={}){I.fetchers.set(he,Ee),ee({fetchers:new Map(I.fetchers)},{flushSync:(Fe&&Fe.flushSync)===!0})}function me(he,Ee,Fe,Xe={}){let dt=bc(I.matches,Ee);ht(he),ee({errors:{[dt.route.id]:Fe},fetchers:new Map(I.fetchers)},{flushSync:(Xe&&Xe.flushSync)===!0})}function we(he){return ue.set(he,(ue.get(he)||0)+1),se.has(he)&&se.delete(he),I.fetchers.get(he)||EO}function et(he,Ee){bt(he,Ee?.reason),Q(he,bl(null))}function ht(he){let Ee=I.fetchers.get(he);Y.has(he)&&!(Ee&&Ee.state==="loading"&&re.has(he))&&bt(he),ae.delete(he),re.delete(he),fe.delete(he),se.delete(he),K.delete(he),I.fetchers.delete(he)}function ct(he){let Ee=(ue.get(he)||0)-1;Ee<=0?(ue.delete(he),se.add(he)):ue.set(he,Ee),ee({fetchers:new Map(I.fetchers)})}function bt(he,Ee){let Fe=Y.get(he);Fe&&(Fe.abort(Ee),Y.delete(he))}function wt(he){for(let Ee of he){let Fe=we(Ee),Xe=bl(Fe.data);I.fetchers.set(Ee,Xe)}}function gn(){let he=[],Ee=!1;for(let Fe of fe){let Xe=I.fetchers.get(Fe);Cn(Xe,`Expected fetcher: ${Fe}`),Xe.state==="loading"&&(fe.delete(Fe),he.push(Fe),Ee=!0)}return wt(he),Ee}function mn(he){let Ee=[];for(let[Fe,Xe]of re)if(Xe<he){let dt=I.fetchers.get(Fe);Cn(dt,`Expected fetcher: ${Fe}`),dt.state==="loading"&&(bt(Fe),re.delete(Fe),Ee.push(Fe))}return wt(Ee),Ee.length>0}function ut(he,Ee){let Fe=I.blockers.get(he)||Jh;return J.get(he)!==Ee&&J.set(he,Ee),Fe}function _t(he){I.blockers.delete(he),J.delete(he)}function Yt(he,Ee){let Fe=I.blockers.get(he)||Jh;Cn(Fe.state==="unblocked"&&Ee.state==="blocked"||Fe.state==="blocked"&&Ee.state==="blocked"||Fe.state==="blocked"&&Ee.state==="proceeding"||Fe.state==="blocked"&&Ee.state==="unblocked"||Fe.state==="proceeding"&&Ee.state==="unblocked",`Invalid blocker state transition: ${Fe.state} -> ${Ee.state}`);let Xe=new Map(I.blockers);Xe.set(he,Ee),ee({blockers:Xe})}function Xt({currentLocation:he,nextLocation:Ee,historyAction:Fe}){if(J.size===0)return;J.size>1&&Qr(!1,"A router only supports one blocker at a time");let Xe=Array.from(J.entries()),[dt,At]=Xe[Xe.length-1],at=I.blockers.get(dt);if(!(at&&at.state==="proceeding")&&At({currentLocation:he,nextLocation:Ee,historyAction:Fe}))return dt}function ln(he){let Ee=xi(404,{pathname:he}),Fe=d||u,{matches:Xe,route:dt}=Lx(Fe);return{notFoundMatches:Xe,route:dt,error:Ee}}function pr(he,Ee,Fe){if(y=he,j=Ee,S=Fe||null,!A&&I.navigation===z2){A=!0;let Xe=Ht(I.location,I.matches);Xe!=null&&ee({restoreScrollPosition:Xe})}return()=>{y=null,j=null,S=null}}function nr(he,Ee){return S&&S(he,Ee.map(Xe=>QD(Xe,I.loaderData)))||he.key}function Bn(he,Ee){if(y&&j){let Fe=nr(he,Ee);y[Fe]=j()}}function Ht(he,Ee){if(y){let Fe=nr(he,Ee),Xe=y[Fe];if(typeof Xe=="number")return Xe}return null}function rn(he,Ee,Fe){if(e.patchRoutesOnNavigation)if(he){if(Object.keys(he[0].params).length>0)return{active:!0,matches:Ep(Ee,Fe,f,!0)}}else return{active:!0,matches:Ep(Ee,Fe,f,!0)||[]};return{active:!1,matches:null}}async function yt(he,Ee,Fe,Xe){if(!e.patchRoutesOnNavigation)return{type:"success",matches:he};let dt=he;for(;;){let At=d==null,at=d||u,lt=l;try{await e.patchRoutesOnNavigation({signal:Fe,path:Ee,matches:dt,fetcherKey:Xe,patch:(Nt,Dt)=>{Fe.aborted||HE(Nt,Dt,at,lt,a,!1)}})}catch(Nt){return{type:"error",error:Nt,partialMatches:dt}}finally{At&&!Fe.aborted&&(u=[...u])}if(Fe.aborted)return{type:"aborted"};let kt=xc(at,Ee,f),vt=null;if(kt){if(Object.keys(kt[0].params).length===0)return{type:"success",matches:kt};if(vt=Ep(at,Ee,f,!0),!(vt&&dt.length<vt.length&&Ft(dt,vt.slice(0,dt.length))))return{type:"success",matches:kt}}if(vt||(vt=Ep(at,Ee,f,!0)),!vt||Ft(dt,vt))return{type:"success",matches:null};dt=vt}}function Ft(he,Ee){return he.length===Ee.length&&he.every((Fe,Xe)=>Fe.route.id===Ee[Xe].route.id)}function un(he){l={},d=eg(he,a,void 0,l)}function an(he,Ee,Fe=!1){let Xe=d==null;HE(he,Ee,d||u,l,a,Fe),Xe&&(u=[...u],ee({}))}return N={get basename(){return f},get future(){return g},get state(){return I},get routes(){return u},get window(){return t},initialize:ge,subscribe:le,enableScrollRestoration:pr,navigate:ve,fetch:Se,revalidate:st,createHref:he=>e.history.createHref(he),encodeLocation:he=>e.history.encodeLocation(he),getFetcher:we,resetFetcher:et,deleteFetcher:ct,dispose:de,getBlocker:ut,deleteBlocker:_t,patchRoutes:an,_internalFetchControllers:Y,_internalSetRoutes:un,_internalSetStateDoNotUseOrYouWillBreakYourApp(he){ee(he)}},e.unstable_instrumentations&&(N=xO(N,e.unstable_instrumentations.map(he=>he.router).filter(Boolean))),N}function MO(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function nS(e,t,n,s,o,a){let l,u;if(o){l=[];for(let f of t)if(l.push(f),f.route.id===o){u=f;break}}else l=t,u=t[t.length-1];let d=_g(s||".",H1(l),_i(e.pathname,n)||e.pathname,a==="path");if(s==null&&(d.search=e.search,d.hash=e.hash),(s==null||s===""||s===".")&&u){let f=kj(d.search);if(u.route.index&&!f)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&f){let p=new URLSearchParams(d.search),g=p.getAll("index");p.delete("index"),g.filter(b=>b).forEach(b=>p.append("index",b));let x=p.toString();d.search=x?`?${x}`:""}}return n!=="/"&&(d.pathname=dO({basename:n,pathname:d.pathname})),Ba(d)}function NE(e,t,n){if(!n||!MO(n))return{path:t};if(n.formMethod&&!YO(n.formMethod))return{path:t,error:xi(405,{method:n.formMethod})};let s=()=>({path:t,error:xi(400,{type:"invalid-body"})}),a=(n.formMethod||"get").toUpperCase(),l=f7(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Ns(a))return s();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((x,[b,y])=>`${x}${b}=${y} `,""):String(n.body);return{path:t,submission:{formMethod:a,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!Ns(a))return s();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:a,formAction:l,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return s()}}}Cn(typeof FormData=="function","FormData is not available in this environment");let u,d;if(n.formData)u=sS(n.formData),d=n.formData;else if(n.body instanceof FormData)u=sS(n.body),d=n.body;else if(n.body instanceof URLSearchParams)u=n.body,d=YE(u);else if(n.body==null)u=new URLSearchParams,d=new FormData;else try{u=new URLSearchParams(n.body),d=YE(u)}catch{return s()}let f={formMethod:a,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(Ns(f.formMethod))return{path:t,submission:f};let p=qa(t);return e&&p.search&&kj(p.search)&&u.append("index",""),p.search=`?${u}`,{path:Ba(p),submission:f}}function $E(e,t,n,s,o,a,l,u,d,f,p,g,x,b,y,S,j,A,M,R,_){let z=R?qo(R[1])?R[1].error:R[1].data:void 0,F=o.createURL(a.location),N=o.createURL(d),I;if(p&&a.errors){let W=Object.keys(a.errors)[0];I=l.findIndex(D=>D.route.id===W)}else if(R&&qo(R[1])){let W=R[0];I=l.findIndex(D=>D.route.id===W)-1}let B=R?R[1].statusCode:void 0,H=B&&B>=400,P={currentUrl:F,currentParams:a.matches[0]?.params||{},nextUrl:N,nextParams:l[0].params,...u,actionResult:z,actionStatus:B},k=Pg(l),L=l.map((W,D)=>{let{route:q}=W,K=null;if(I!=null&&D>I)K=!1;else if(q.lazy)K=!0;else if(!Ej(q))K=!1;else if(p){let{shouldLoad:re}=o7(q,a.loaderData,a.errors);K=re}else RO(a.loaderData,a.matches[D],W)&&(K=!0);if(K!==null)return rS(n,s,e,d,k,W,f,t,K);let Y=!1;typeof _=="boolean"?Y=_:H?Y=!1:(g||F.pathname+F.search===N.pathname+N.search||F.search!==N.search||zO(a.matches[D],W))&&(Y=!0);let ie={...P,defaultShouldRevalidate:Y},V=Dp(W,ie);return rS(n,s,e,d,k,W,f,t,V,ie,_)}),O=[];return y.forEach((W,D)=>{if(p||!l.some(ae=>ae.route.id===W.routeId)||b.has(D))return;let q=a.fetchers.get(D),K=q&&q.state!=="idle"&&q.data===void 0,Y=xc(j,W.path,A);if(!Y){if(M&&K)return;O.push({key:D,routeId:W.routeId,path:W.path,matches:null,match:null,request:null,controller:null});return}if(S.has(D))return;let ie=I0(Y,W.path),V=new AbortController,re=rf(o,W.path,V.signal),fe=null;if(x.has(D))x.delete(D),fe=Cf(n,s,re,W.path,Y,ie,f,t);else if(K)g&&(fe=Cf(n,s,re,W.path,Y,ie,f,t));else{let ae;typeof _=="boolean"?ae=_:H?ae=!1:ae=g;let ue={...P,defaultShouldRevalidate:ae};Dp(ie,ue)&&(fe=Cf(n,s,re,W.path,Y,ie,f,t,ue))}fe&&O.push({key:D,routeId:W.routeId,path:W.path,matches:fe,match:ie,request:re,controller:V})}),{dsMatches:L,revalidatingFetchers:O}}function Ej(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function o7(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Ej(e))return{shouldLoad:!1,renderFallback:!1};let s=t!=null&&e.id in t,o=n!=null&&n[e.id]!==void 0;if(!s&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!s};let a=!s&&!o;return{shouldLoad:a,renderFallback:a}}function RO(e,t,n){let s=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return s||o}function zO(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Dp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function HE(e,t,n,s,o,a){let l;if(e){let f=s[e];Cn(f,`No route found to patch children into: routeId = ${e}`),f.children||(f.children=[]),l=f.children}else l=n;let u=[],d=[];if(t.forEach(f=>{let p=l.find(g=>i7(f,g));p?d.push({existingRoute:p,newRoute:f}):u.push(f)}),u.length>0){let f=eg(u,o,[e||"_","patch",String(l?.length||"0")],s);l.push(...f)}if(a&&d.length>0)for(let f=0;f<d.length;f++){let{existingRoute:p,newRoute:g}=d[f],x=p,[b]=eg([g],o,[],{},!0);Object.assign(x,{element:b.element?b.element:x.element,errorElement:b.errorElement?b.errorElement:x.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:x.hydrateFallbackElement})}}function i7(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((n,s)=>t.children?.some(o=>i7(n,o)))??!1:!1}var WE=new WeakMap,a7=({key:e,route:t,manifest:n,mapRouteProperties:s})=>{let o=n[t.id];if(Cn(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let a=o.lazy[e];if(!a)return;let l=WE.get(o);l||(l={},WE.set(o,l));let u=l[e];if(u)return u;let d=(async()=>{let f=YD(e),g=o[e]!==void 0&&e!=="hasErrorBoundary";if(f)Qr(!f,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(g)Qr(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await a();x!=null&&(Object.assign(o,{[e]:x}),Object.assign(o,s(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(x=>x===void 0)&&(o.lazy=void 0))})();return l[e]=d,d},UE=new WeakMap;function IO(e,t,n,s,o){let a=n[e.id];if(Cn(a,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let p=UE.get(a);if(p)return{lazyRoutePromise:p,lazyHandlerPromise:p};let g=(async()=>{Cn(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),b={};for(let y in x){let S=x[y];if(S===void 0)continue;let j=XD(y),M=a[y]!==void 0&&y!=="hasErrorBoundary";j?Qr(!j,"Route property "+y+" is not a supported property to be returned from a lazy route function. This property will be ignored."):M?Qr(!M,`Route "${a.id}" has a static property "${y}" defined but its lazy function is also returning a value for this property. The lazy route property "${y}" will be ignored.`):b[y]=S}Object.assign(a,b),Object.assign(a,{...s(a),lazy:void 0})})();return UE.set(a,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let l=Object.keys(e.lazy),u=[],d;for(let p of l){if(o&&o.includes(p))continue;let g=a7({key:p,route:e,manifest:n,mapRouteProperties:s});g&&(u.push(g),p===t&&(d=g))}let f=u.length>0?Promise.all(u).then(()=>{}):void 0;return f?.catch(()=>{}),d?.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:d}}async function qE(e){let t=e.matches.filter(o=>o.shouldLoad),n={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,a)=>{n[t[a].route.id]=o}),n}async function FO(e){return e.matches.some(t=>t.route.middleware)?l7(e,()=>qE(e)):qE(e)}function l7(e,t){return _O(e,t,s=>{if(GO(s))throw s;return s},WO,n);function n(s,o,a){if(a)return Promise.resolve(Object.assign(a.value,{[o]:{type:"error",result:s}}));{let{matches:l}=e,u=Math.min(Math.max(l.findIndex(f=>f.route.id===o),0),Math.max(l.findIndex(f=>f.shouldCallHandler()),0)),d=bc(l,l[u].route.id).route.id;return Promise.resolve({[d]:{type:"error",result:s}})}}}async function _O(e,t,n,s,o){let{matches:a,...l}=e,u=a.flatMap(f=>f.route.middleware?f.route.middleware.map(p=>[f.route.id,p]):[]);return await c7(l,u,t,n,s,o)}async function c7(e,t,n,s,o,a,l=0){let{request:u}=e;if(u.signal.aborted)throw u.signal.reason??new Error(`Request aborted: ${u.method} ${u.url}`);let d=t[l];if(!d)return await n();let[f,p]=d,g,x=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await c7(e,t,n,s,o,a,l+1)},g.value}catch(b){return g={value:await a(b,f,g)},g.value}};try{let b=await p(e,x),y=b!=null?s(b):void 0;return o(y)?y:g?y??g.value:(g={value:await x()},g.value)}catch(b){return await a(b,f,g)}}function u7(e,t,n,s,o){let a=a7({key:"middleware",route:s.route,manifest:t,mapRouteProperties:e}),l=IO(s.route,Ns(n.method)?"action":"loader",t,e,o);return{middleware:a,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function rS(e,t,n,s,o,a,l,u,d,f=null,p){let g=!1,x=u7(e,t,n,a,l);return{...a,_lazyPromises:x,shouldLoad:d,shouldRevalidateArgs:f,shouldCallHandler(b){return g=!0,f?typeof p=="boolean"?Dp(a,{...f,defaultShouldRevalidate:p}):typeof b=="boolean"?Dp(a,{...f,defaultShouldRevalidate:b}):Dp(a,f):d},resolve(b){let{lazy:y,loader:S,middleware:j}=a.route,A=g||d||b&&!Ns(n.method)&&(y||S),M=j&&j.length>0&&!S&&!y;return A&&(Ns(n.method)||!M)?PO({request:n,path:s,unstable_pattern:o,match:a,lazyHandlerPromise:x?.handler,lazyRoutePromise:x?.route,handlerOverride:b,scopedContext:u}):Promise.resolve({type:"data",result:void 0})}}}function Cf(e,t,n,s,o,a,l,u,d=null){return o.map(f=>f.route.id!==a.route.id?{...f,shouldLoad:!1,shouldRevalidateArgs:d,shouldCallHandler:()=>!1,_lazyPromises:u7(e,t,n,f,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:rS(e,t,n,s,Pg(o),f,l,u,!0,d))}async function LO(e,t,n,s,o,a,l){s.some(p=>p._lazyPromises?.middleware)&&await Promise.all(s.map(p=>p._lazyPromises?.middleware));let u={request:t,unstable_url:d7(t,n),unstable_pattern:Pg(s),params:s[0].params,context:a,matches:s},f=await e({...u,fetcherKey:o,runClientMiddleware:p=>{let g=u;return l7(g,()=>p({...g,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(p=>[p._lazyPromises?.handler,p._lazyPromises?.route]))}catch{}return f}async function PO({request:e,path:t,unstable_pattern:n,match:s,lazyHandlerPromise:o,lazyRoutePromise:a,handlerOverride:l,scopedContext:u}){let d,f,p=Ns(e.method),g=p?"action":"loader",x=b=>{let y,S=new Promise((M,R)=>y=R);f=()=>y(),e.signal.addEventListener("abort",f);let j=M=>typeof b!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${s.route.id}]`)):b({request:e,unstable_url:d7(e,t),unstable_pattern:n,params:s.params,context:u},...M!==void 0?[M]:[]),A=(async()=>{try{return{type:"data",result:await(l?l(R=>j(R)):j())}}catch(M){return{type:"error",result:M}}})();return Promise.race([A,S])};try{let b=p?s.route.action:s.route.loader;if(o||a)if(b){let y,[S]=await Promise.all([x(b).catch(j=>{y=j}),o,a]);if(y!==void 0)throw y;d=S}else{await o;let y=p?s.route.action:s.route.loader;if(y)[d]=await Promise.all([x(y),a]);else if(g==="action"){let S=new URL(e.url),j=S.pathname+S.search;throw xi(405,{method:e.method,pathname:j,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(b)d=await x(b);else{let y=new URL(e.url),S=y.pathname+y.search;throw xi(404,{pathname:S})}}catch(b){return{type:"error",result:b}}finally{f&&e.signal.removeEventListener("abort",f)}return d}async function DO(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function OO(e){let{result:t,type:n}=e;if(Tj(t)){let s;try{s=await DO(t)}catch(o){return{type:"error",error:o}}return n==="error"?{type:"error",error:new Lg(t.status,t.statusText,s),statusCode:t.status,headers:t.headers}:{type:"data",data:s,statusCode:t.status,headers:t.headers}}return n==="error"?QE(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:HO(t),statusCode:tg(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:tg(t)?t.status:void 0}:QE(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function BO(e,t,n,s,o){let a=e.headers.get("Location");if(Cn(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!wj(a)){let l=s.slice(0,s.findIndex(u=>u.route.id===n)+1);a=nS(new URL(t.url),l,o,a),e.headers.set("Location",a)}return e}var VE=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function GE(e,t,n,s){if(wj(e)){let o=e,a=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(VE.includes(a.protocol))throw new Error("Invalid redirect location");let l=_i(a.pathname,n)!=null;if(a.origin===t.origin&&l)return Aj(a.pathname)+a.search+a.hash}try{let o=s.createURL(e);if(VE.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function rf(e,t,n,s){let o=e.createURL(f7(t)).toString(),a={signal:n};if(s&&Ns(s.formMethod)){let{formMethod:l,formEncType:u}=s;a.method=l.toUpperCase(),u==="application/json"?(a.headers=new Headers({"Content-Type":u}),a.body=JSON.stringify(s.json)):u==="text/plain"?a.body=s.text:u==="application/x-www-form-urlencoded"&&s.formData?a.body=sS(s.formData):a.body=s.formData}return new Request(o,a)}function d7(e,t){let n=new URL(e.url),s=typeof t=="string"?qa(t):t;if(n.pathname=s.pathname||"/",s.search){let o=new URLSearchParams(s.search),a=o.getAll("index");o.delete("index");for(let l of a.filter(Boolean))o.append("index",l);n.search=o.size?`?${o.toString()}`:""}else n.search="";return n.hash=s.hash||"",n}function sS(e){let t=new URLSearchParams;for(let[n,s]of e.entries())t.append(n,typeof s=="string"?s:s.name);return t}function YE(e){let t=new FormData;for(let[n,s]of e.entries())t.append(n,s);return t}function NO(e,t,n,s=!1,o=!1){let a={},l=null,u,d=!1,f={},p=n&&qo(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let x=g.route.id,b=t[x];if(Cn(!vu(b),"Cannot handle redirect results in processLoaderData"),qo(b)){let y=b.error;if(p!==void 0&&(y=p,p=void 0),l=l||{},o)l[x]=y;else{let S=bc(e,x);l[S.route.id]==null&&(l[S.route.id]=y)}s||(a[x]=s7),d||(d=!0,u=tg(b.error)?b.error.status:500),b.headers&&(f[x]=b.headers)}else a[x]=b.data,b.statusCode&&b.statusCode!==200&&!d&&(u=b.statusCode),b.headers&&(f[x]=b.headers)}),p!==void 0&&n&&(l={[n[0]]:p},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:l,statusCode:u||200,loaderHeaders:f}}function KE(e,t,n,s,o,a){let{loaderData:l,errors:u}=NO(t,n,s);return o.filter(d=>!d.matches||d.matches.some(f=>f.shouldLoad)).forEach(d=>{let{key:f,match:p,controller:g}=d;if(g&&g.signal.aborted)return;let x=a[f];if(Cn(x,"Did not find corresponding fetcher result"),qo(x)){let b=bc(e.matches,p?.route.id);u&&u[b.route.id]||(u={...u,[b.route.id]:x.error}),e.fetchers.delete(f)}else if(vu(x))Cn(!1,"Unhandled fetcher revalidation redirect");else{let b=bl(x.data);e.fetchers.set(f,b)}}),{loaderData:l,errors:u}}function XE(e,t,n,s){let o=Object.entries(t).filter(([,a])=>a!==s7).reduce((a,[l,u])=>(a[l]=u,a),{});for(let a of n){let l=a.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&a.route.loader&&(o[l]=e[l]),s&&s.hasOwnProperty(l))break}return o}function ZE(e){return e?qo(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function bc(e,t){return(t?e.slice(0,e.findIndex(s=>s.route.id===t)+1):[...e]).reverse().find(s=>s.route.hasErrorBoundary===!0)||e[0]}function Lx(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function xi(e,{pathname:t,routeId:n,method:s,type:o,message:a}={}){let l="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(l="Bad Request",s&&t&&n?u=`You made a ${s} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:o==="invalid-body"&&(u="Unable to encode submission body")):e===403?(l="Forbidden",u=`Route "${n}" does not match URL "${t}"`):e===404?(l="Not Found",u=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",s&&t&&n?u=`You made a ${s.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:s&&(u=`Invalid request method "${s.toUpperCase()}"`)),new Lg(e||500,l,new Error(u),!0)}function Px(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[s,o]=t[n];if(vu(o))return{key:s,result:o}}}function f7(e){let t=typeof e=="string"?qa(e):e;return Ba({...t,hash:""})}function $O(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function HO(e){return new Lg(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function WO(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&UO(n))}function UO(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function qO(e){return Tj(e.result)&&n7.has(e.result.status)}function qo(e){return e.type==="error"}function vu(e){return(e&&e.type)==="redirect"}function QE(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Tj(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function VO(e){return n7.has(e)}function GO(e){return Tj(e)&&VO(e.status)&&e.headers.has("Location")}function YO(e){return wO.has(e.toUpperCase())}function Ns(e){return jO.has(e.toUpperCase())}function kj(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function I0(e,t){let n=typeof t=="string"?qa(t).search:t.search;if(e[e.length-1].route.index&&kj(n||""))return e[e.length-1];let s=ZM(e);return s[s.length-1]}function JE(e){let{formMethod:t,formAction:n,formEncType:s,text:o,formData:a,json:l}=e;if(!(!t||!n||!s)){if(o!=null)return{formMethod:t,formAction:n,formEncType:s,formData:void 0,json:void 0,text:o};if(a!=null)return{formMethod:t,formAction:n,formEncType:s,formData:a,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:s,formData:void 0,json:l,text:void 0}}}function I2(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function KO(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function ep(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function XO(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function bl(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function ZO(e,t){try{let n=e.sessionStorage.getItem(r7);if(n){let s=JSON.parse(n);for(let[o,a]of Object.entries(s||{}))a&&Array.isArray(a)&&t.set(o,new Set(a||[]))}}catch{}}function QO(e,t){if(t.size>0){let n={};for(let[s,o]of t)n[s]=[...o];try{e.sessionStorage.setItem(r7,JSON.stringify(n))}catch(s){Qr(!1,`Failed to save applied view transitions in sessionStorage (${s}).`)}}}function eT(){let e,t,n=new Promise((s,o)=>{e=async a=>{s(a);try{await n}catch{}},t=async a=>{o(a);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var qu=v.createContext(null);qu.displayName="DataRouter";var Dg=v.createContext(null);Dg.displayName="DataRouterState";var h7=v.createContext(!1);function p7(){return v.useContext(h7)}var Mj=v.createContext({isTransitioning:!1});Mj.displayName="ViewTransition";var g7=v.createContext(new Map);g7.displayName="Fetchers";var JO=v.createContext(null);JO.displayName="Await";var ni=v.createContext(null);ni.displayName="Navigation";var W1=v.createContext(null);W1.displayName="Location";var Ni=v.createContext({outlet:null,matches:[],isDataRoute:!1});Ni.displayName="Route";var Rj=v.createContext(null);Rj.displayName="RouteError";var m7="REACT_ROUTER_ERROR",eB="REDIRECT",tB="ROUTE_ERROR_RESPONSE";function nB(e){if(e.startsWith(`${m7}:${eB}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function rB(e){if(e.startsWith(`${m7}:${tB}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Lg(t.status,t.statusText,t.data)}catch{}}function sB(e,{relative:t}={}){Cn(th(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=v.useContext(ni),{hash:o,pathname:a,search:l}=Og(e,{relative:t}),u=a;return n!=="/"&&(u=a==="/"?n:Mi([n,a])),s.createHref({pathname:u,search:l,hash:o})}function th(){return v.useContext(W1)!=null}function Nr(){return Cn(th(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(W1).location}var x7="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function b7(e){v.useContext(ni).static||v.useLayoutEffect(e)}function Dn(){let{isDataRoute:e}=v.useContext(Ni);return e?yB():oB()}function oB(){Cn(th(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(qu),{basename:t,navigator:n}=v.useContext(ni),{matches:s}=v.useContext(Ni),{pathname:o}=Nr(),a=JSON.stringify(H1(s)),l=v.useRef(!1);return b7(()=>{l.current=!0}),v.useCallback((d,f={})=>{if(Qr(l.current,x7),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=_g(d,JSON.parse(a),o,f.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Mi([t,p.pathname])),(f.replace?n.replace:n.push)(p,f.state,f)},[t,n,a,o,e])}var iB=v.createContext(null);function aB(e){let t=v.useContext(Ni).outlet;return v.useMemo(()=>t&&v.createElement(iB.Provider,{value:e},t),[t,e])}function Vu(){let{matches:e}=v.useContext(Ni),t=e[e.length-1];return t?t.params:{}}function Og(e,{relative:t}={}){let{matches:n}=v.useContext(Ni),{pathname:s}=Nr(),o=JSON.stringify(H1(n));return v.useMemo(()=>_g(e,JSON.parse(o),s,t==="path"),[e,o,s,t])}function lB(e,t,n){Cn(th(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=v.useContext(ni),{matches:o}=v.useContext(Ni),a=o[o.length-1],l=a?a.params:{},u=a?a.pathname:"/",d=a?a.pathnameBase:"/",f=a&&a.route;{let j=f&&f.path||"";v7(u,!f||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${j}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. Please change the parent <Route path="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let p=Nr(),g;g=p;let x=g.pathname||"/",b=x;if(d!=="/"){let j=d.replace(/^\//,"").split("/");b="/"+x.replace(/^\//,"").split("/").slice(j.length).join("/")}let y=xc(e,{pathname:b});return Qr(f||y!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Qr(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),hB(y&&y.map(j=>Object.assign({},j,{params:Object.assign({},l,j.params),pathname:Mi([d,s.encodeLocation?s.encodeLocation(j.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?d:Mi([d,s.encodeLocation?s.encodeLocation(j.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),o,n)}function cB(){let e=bB(),t=tg(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},a={padding:"2px 4px",backgroundColor:s},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:a},"ErrorBoundary")," or"," ",v.createElement("code",{style:a},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:o},n):null,l)}var uB=v.createElement(cB,null),y7=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=rB(e.digest);n&&(e=n)}let t=e!==void 0?v.createElement(Ni.Provider,{value:this.props.routeContext},v.createElement(Rj.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(dB,{error:e},t):t}};y7.contextType=h7;var F2=new WeakMap;function dB({children:e,error:t}){let{basename:n}=v.useContext(ni);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let s=nB(t.digest);if(s){let o=F2.get(t);if(o)throw o;let a=JM(s.location,n);if(QM&&!F2.get(t))if(a.isExternal||s.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:s.replace}));throw F2.set(t,l),l}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function fB({routeContext:e,match:t,children:n}){let s=v.useContext(qu);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Ni.Provider,{value:e},n)}function hB(e,t=[],n){let s=n?.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(t.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let o=e,a=s?.errors;if(a!=null){let p=o.findIndex(g=>g.route.id&&a?.[g.route.id]!==void 0);Cn(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),o=o.slice(0,Math.min(o.length,p+1))}let l=!1,u=-1;if(n&&s){l=s.renderFallback;for(let p=0;p<o.length;p++){let g=o[p];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(u=p),g.route.id){let{loaderData:x,errors:b}=s,y=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!b||b[g.route.id]===void 0);if(g.route.lazy||y){n.isStatic&&(l=!0),u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}}let d=n?.onError,f=s&&d?(p,g)=>{d(p,{location:s.location,params:s.matches?.[0]?.params??{},unstable_pattern:Pg(s.matches),errorInfo:g})}:void 0;return o.reduceRight((p,g,x)=>{let b,y=!1,S=null,j=null;s&&(b=a&&g.route.id?a[g.route.id]:void 0,S=g.route.errorElement||uB,l&&(u<0&&x===0?(v7("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,j=null):u===x&&(y=!0,j=g.route.hydrateFallbackElement||null)));let A=t.concat(o.slice(0,x+1)),M=()=>{let R;return b?R=S:y?R=j:g.route.Component?R=v.createElement(g.route.Component,null):g.route.element?R=g.route.element:R=p,v.createElement(fB,{match:g,routeContext:{outlet:p,matches:A,isDataRoute:s!=null},children:R})};return s&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?v.createElement(y7,{location:s.location,revalidation:s.revalidation,component:S,error:b,children:M(),routeContext:{outlet:null,matches:A,isDataRoute:!0},onError:f}):M()},null)}function zj(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function pB(e){let t=v.useContext(qu);return Cn(t,zj(e)),t}function gB(e){let t=v.useContext(Dg);return Cn(t,zj(e)),t}function mB(e){let t=v.useContext(Ni);return Cn(t,zj(e)),t}function Ij(e){let t=mB(e),n=t.matches[t.matches.length-1];return Cn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function xB(){return Ij("useRouteId")}function bB(){let e=v.useContext(Rj),t=gB("useRouteError"),n=Ij("useRouteError");return e!==void 0?e:t.errors?.[n]}function yB(){let{router:e}=pB("useNavigate"),t=Ij("useNavigate"),n=v.useRef(!1);return b7(()=>{n.current=!0}),v.useCallback(async(o,a={})=>{Qr(n.current,x7),n.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...a}))},[e,t])}var tT={};function v7(e,t,n){!t&&!tT[e]&&(tT[e]=!0,Qr(!1,n))}var nT={};function rT(e,t){!e&&!nT[t]&&(nT[t]=!0,console.warn(t))}var vB="useOptimistic",sT=Qp[vB],SB=()=>{};function jB(e){return sT?sT(e):[e,SB]}function CB(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Qr(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:v.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Qr(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Qr(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var wB=["HydrateFallback","hydrateFallbackElement"],AB=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function EB({router:e,flushSync:t,onError:n,unstable_useTransitions:s}){s=p7()||s;let[a,l]=v.useState(e.state),[u,d]=jB(a),[f,p]=v.useState(),[g,x]=v.useState({isTransitioning:!1}),[b,y]=v.useState(),[S,j]=v.useState(),[A,M]=v.useState(),R=v.useRef(new Map),_=v.useCallback((B,{deletedFetchers:H,newErrors:P,flushSync:k,viewTransitionOpts:L})=>{P&&n&&Object.values(P).forEach(W=>n(W,{location:B.location,params:B.matches[0]?.params??{},unstable_pattern:Pg(B.matches)})),B.fetchers.forEach((W,D)=>{W.data!==void 0&&R.current.set(D,W.data)}),H.forEach(W=>R.current.delete(W)),rT(k===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let O=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(rT(L==null||O,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!L||!O){t&&k?t(()=>l(B)):s===!1?l(B):v.startTransition(()=>{s===!0&&d(W=>oT(W,B)),l(B)});return}if(t&&k){t(()=>{S&&(b?.resolve(),S.skipTransition()),x({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let W=e.window.document.startViewTransition(()=>{t(()=>l(B))});W.finished.finally(()=>{t(()=>{y(void 0),j(void 0),p(void 0),x({isTransitioning:!1})})}),t(()=>j(W));return}S?(b?.resolve(),S.skipTransition(),M({state:B,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(p(B),x({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[e.window,t,S,b,s,d,n]);v.useLayoutEffect(()=>e.subscribe(_),[e,_]);let z=u.initialized;v.useLayoutEffect(()=>{!z&&e.state.initialized&&_(e.state,{deletedFetchers:[],flushSync:!1,newErrors:null})},[z,_,e.state]),v.useEffect(()=>{g.isTransitioning&&!g.flushSync&&y(new AB)},[g]),v.useEffect(()=>{if(b&&f&&e.window){let B=f,H=b.promise,P=e.window.document.startViewTransition(async()=>{s===!1?l(B):v.startTransition(()=>{s===!0&&d(k=>oT(k,B)),l(B)}),await H});P.finished.finally(()=>{y(void 0),j(void 0),p(void 0),x({isTransitioning:!1})}),j(P)}},[f,b,e.window,s,d]),v.useEffect(()=>{b&&f&&u.location.key===f.location.key&&b.resolve()},[b,S,u.location,f]),v.useEffect(()=>{!g.isTransitioning&&A&&(p(A.state),x({isTransitioning:!0,flushSync:!1,currentLocation:A.currentLocation,nextLocation:A.nextLocation}),M(void 0))},[g.isTransitioning,A]);let F=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:B=>e.navigate(B),push:(B,H,P)=>e.navigate(B,{state:H,preventScrollReset:P?.preventScrollReset}),replace:(B,H,P)=>e.navigate(B,{replace:!0,state:H,preventScrollReset:P?.preventScrollReset})}),[e]),N=e.basename||"/",I=v.useMemo(()=>({router:e,navigator:F,static:!1,basename:N,onError:n}),[e,F,N,n]);return v.createElement(v.Fragment,null,v.createElement(qu.Provider,{value:I},v.createElement(Dg.Provider,{value:u},v.createElement(g7.Provider,{value:R.current},v.createElement(Mj.Provider,{value:g},v.createElement(MB,{basename:N,location:u.location,navigationType:u.historyAction,navigator:F,unstable_useTransitions:s},v.createElement(TB,{routes:e.routes,future:e.future,state:u,isStatic:!1,onError:n})))))),null)}function oT(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var TB=v.memo(kB);function kB({routes:e,future:t,state:n,isStatic:s,onError:o}){return lB(e,void 0,{state:n,isStatic:s,onError:o})}function wi({to:e,replace:t,state:n,relative:s}){Cn(th(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=v.useContext(ni);Qr(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=v.useContext(Ni),{pathname:l}=Nr(),u=Dn(),d=_g(e,H1(a),l,s==="path"),f=JSON.stringify(d);return v.useEffect(()=>{u(JSON.parse(f),{replace:t,state:n,relative:s})},[u,f,s,t,n]),null}function Fj(e){return aB(e.context)}function MB({basename:e="/",children:t=null,location:n,navigationType:s="POP",navigator:o,static:a=!1,unstable_useTransitions:l}){Cn(!th(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),d=v.useMemo(()=>({basename:u,navigator:o,static:a,unstable_useTransitions:l,future:{}}),[u,o,a,l]);typeof n=="string"&&(n=qa(n));let{pathname:f="/",search:p="",hash:g="",state:x=null,key:b="default",unstable_mask:y}=n,S=v.useMemo(()=>{let j=_i(f,u);return j==null?null:{location:{pathname:j,search:p,hash:g,state:x,key:b,unstable_mask:y},navigationType:s}},[u,f,p,g,x,b,s,y]);return Qr(S!=null,`<Router basename="${u}"> is not able to match the URL "${f}${p}${g}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:v.createElement(ni.Provider,{value:d},v.createElement(W1.Provider,{children:t,value:S}))}var F0="get",_0="application/x-www-form-urlencoded";function U1(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function RB(e){return U1(e)&&e.tagName.toLowerCase()==="button"}function zB(e){return U1(e)&&e.tagName.toLowerCase()==="form"}function IB(e){return U1(e)&&e.tagName.toLowerCase()==="input"}function FB(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function _B(e,t){return e.button===0&&(!t||t==="_self")&&!FB(e)}function oS(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(o=>[n,o]):[[n,s]])},[]))}function LB(e,t){let n=oS(e);return t&&t.forEach((s,o)=>{n.has(o)||t.getAll(o).forEach(a=>{n.append(o,a)})}),n}var Dx=null;function PB(){if(Dx===null)try{new FormData(document.createElement("form"),0),Dx=!1}catch{Dx=!0}return Dx}var DB=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function _2(e){return e!=null&&!DB.has(e)?(Qr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${_0}"`),null):e}function OB(e,t){let n,s,o,a,l;if(zB(e)){let u=e.getAttribute("action");s=u?_i(u,t):null,n=e.getAttribute("method")||F0,o=_2(e.getAttribute("enctype"))||_0,a=new FormData(e)}else if(RB(e)||IB(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||u.getAttribute("action");if(s=d?_i(d,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||F0,o=_2(e.getAttribute("formenctype"))||_2(u.getAttribute("enctype"))||_0,a=new FormData(u,e),!PB()){let{name:f,type:p,value:g}=e;if(p==="image"){let x=f?`${f}.`:"";a.append(`${x}x`,"0"),a.append(`${x}y`,"0")}else f&&a.append(f,g)}}else{if(U1(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=F0,s=null,o=_0,l=e}return a&&o==="text/plain"&&(l=a,a=void 0),{action:s,method:n.toLowerCase(),encType:o,formData:a,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function _j(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function S7(e,t,n,s){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${s}`:o.pathname=`${o.pathname}.${s}`:o.pathname==="/"?o.pathname=`_root.${s}`:t&&_i(o.pathname,t)==="/"?o.pathname=`${K0(t)}/_root.${s}`:o.pathname=`${K0(o.pathname)}.${s}`,o}async function BB(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function NB(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function $B(e,t,n){let s=await Promise.all(e.map(async o=>{let a=t.routes[o.route.id];if(a){let l=await BB(a,n);return l.links?l.links():[]}return[]}));return qB(s.flat(1).filter(NB).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function iT(e,t,n,s,o,a){let l=(d,f)=>n[f]?d.route.id!==n[f].route.id:!0,u=(d,f)=>n[f].pathname!==d.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==d.params["*"];return a==="assets"?t.filter((d,f)=>l(d,f)||u(d,f)):a==="data"?t.filter((d,f)=>{let p=s.routes[d.route.id];if(!p||!p.hasLoader)return!1;if(l(d,f)||u(d,f))return!0;if(d.route.shouldRevalidate){let g=d.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function HB(e,t,{includeHydrateFallback:n}={}){return WB(e.map(s=>{let o=t.routes[s.route.id];if(!o)return[];let a=[o.module];return o.clientActionModule&&(a=a.concat(o.clientActionModule)),o.clientLoaderModule&&(a=a.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(a=a.concat(o.hydrateFallbackModule)),o.imports&&(a=a.concat(o.imports)),a}).flat(1))}function WB(e){return[...new Set(e)]}function UB(e){let t={},n=Object.keys(e).sort();for(let s of n)t[s]=e[s];return t}function qB(e,t){let n=new Set;return new Set(t),e.reduce((s,o)=>{let a=JSON.stringify(UB(o));return n.has(a)||(n.add(a),s.push({key:a,link:o})),s},[])}function Lj(){let e=v.useContext(qu);return _j(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function VB(){let e=v.useContext(Dg);return _j(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Pj=v.createContext(void 0);Pj.displayName="FrameworkContext";function Dj(){let e=v.useContext(Pj);return _j(e,"You must render this element inside a <HydratedRouter> element"),e}function GB(e,t){let n=v.useContext(Pj),[s,o]=v.useState(!1),[a,l]=v.useState(!1),{onFocus:u,onBlur:d,onMouseEnter:f,onMouseLeave:p,onTouchStart:g}=t,x=v.useRef(null);v.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let S=A=>{A.forEach(M=>{l(M.isIntersecting)})},j=new IntersectionObserver(S,{threshold:.5});return x.current&&j.observe(x.current),()=>{j.disconnect()}}},[e]),v.useEffect(()=>{if(s){let S=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(S)}}},[s]);let b=()=>{o(!0)},y=()=>{o(!1),l(!1)};return n?e!=="intent"?[a,x,{}]:[a,x,{onFocus:tp(u,b),onBlur:tp(d,y),onMouseEnter:tp(f,b),onMouseLeave:tp(p,y),onTouchStart:tp(g,b)}]:[!1,x,{}]}function tp(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function YB({page:e,...t}){let n=p7(),{router:s}=Lj(),o=v.useMemo(()=>xc(s.routes,e,s.basename),[s.routes,e,s.basename]);return o?n?v.createElement(XB,{page:e,matches:o,...t}):v.createElement(ZB,{page:e,matches:o,...t}):null}function KB(e){let{manifest:t,routeModules:n}=Dj(),[s,o]=v.useState([]);return v.useEffect(()=>{let a=!1;return $B(e,t,n).then(l=>{a||o(l)}),()=>{a=!0}},[e,t,n]),s}function XB({page:e,matches:t,...n}){let s=Nr(),{future:o}=Dj(),{basename:a}=Lj(),l=v.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let u=S7(e,a,o.unstable_trailingSlashAwareDataRequests,"rsc"),d=!1,f=[];for(let p of t)typeof p.route.shouldRevalidate=="function"?d=!0:f.push(p.route.id);return d&&f.length>0&&u.searchParams.set("_routes",f.join(",")),[u.pathname+u.search]},[a,o.unstable_trailingSlashAwareDataRequests,e,s,t]);return v.createElement(v.Fragment,null,l.map(u=>v.createElement("link",{key:u,rel:"prefetch",as:"fetch",href:u,...n})))}function ZB({page:e,matches:t,...n}){let s=Nr(),{future:o,manifest:a,routeModules:l}=Dj(),{basename:u}=Lj(),{loaderData:d,matches:f}=VB(),p=v.useMemo(()=>iT(e,t,f,a,s,"data"),[e,t,f,a,s]),g=v.useMemo(()=>iT(e,t,f,a,s,"assets"),[e,t,f,a,s]),x=v.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let S=new Set,j=!1;if(t.forEach(M=>{let R=a.routes[M.route.id];!R||!R.hasLoader||(!p.some(_=>_.route.id===M.route.id)&&M.route.id in d&&l[M.route.id]?.shouldRevalidate||R.hasClientLoader?j=!0:S.add(M.route.id))}),S.size===0)return[];let A=S7(e,u,o.unstable_trailingSlashAwareDataRequests,"data");return j&&S.size>0&&A.searchParams.set("_routes",t.filter(M=>S.has(M.route.id)).map(M=>M.route.id).join(",")),[A.pathname+A.search]},[u,o.unstable_trailingSlashAwareDataRequests,d,s,a,p,t,e,l]),b=v.useMemo(()=>HB(g,a),[g,a]),y=KB(g);return v.createElement(v.Fragment,null,x.map(S=>v.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),b.map(S=>v.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),y.map(({key:S,link:j})=>v.createElement("link",{key:S,nonce:n.nonce,...j,crossOrigin:j.crossOrigin??n.crossOrigin})))}function QB(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var JB=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{JB&&(window.__reactRouterVersion="7.14.1")}catch{}function eN(e,t){return kO({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:UD({window:t?.window}),hydrationData:tN(),routes:e,mapRouteProperties:CB,hydrationRouteProperties:wB,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function tN(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:nN(e.errors)}),e}function nN(e){if(!e)return null;let t=Object.entries(e),n={};for(let[s,o]of t)if(o&&o.__type==="RouteErrorResponse")n[s]=new Lg(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let a=window[o.__subType];if(typeof a=="function")try{let l=new a(o.message);l.stack="",n[s]=l}catch{}}if(n[s]==null){let a=new Error(o.message);a.stack="",n[s]=a}}else n[s]=o;return n}var j7=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yn=v.forwardRef(function({onClick:t,discover:n="render",prefetch:s="none",relative:o,reloadDocument:a,replace:l,unstable_mask:u,state:d,target:f,to:p,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:b,...y},S){let{basename:j,navigator:A,unstable_useTransitions:M}=v.useContext(ni),R=typeof p=="string"&&j7.test(p),_=JM(p,j);p=_.to;let z=sB(p,{relative:o}),F=Nr(),N=null;if(u){let W=_g(u,[],F.unstable_mask?F.unstable_mask.pathname:"/",!0);j!=="/"&&(W.pathname=W.pathname==="/"?j:Mi([j,W.pathname])),N=A.createHref(W)}let[I,B,H]=GB(s,y),P=iN(p,{replace:l,unstable_mask:u,state:d,target:f,preventScrollReset:g,relative:o,viewTransition:x,unstable_defaultShouldRevalidate:b,unstable_useTransitions:M});function k(W){t&&t(W),W.defaultPrevented||P(W)}let L=!(_.isExternal||a),O=v.createElement("a",{...y,...H,href:(L?N:void 0)||_.absoluteURL||z,onClick:L?k:t,ref:QB(S,B),target:f,"data-discover":!R&&n==="render"?"true":void 0});return I&&!R?v.createElement(v.Fragment,null,O,v.createElement(YB,{page:z})):O});yn.displayName="Link";var rN=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:s="",end:o=!1,style:a,to:l,viewTransition:u,children:d,...f},p){let g=Og(l,{relative:f.relative}),x=Nr(),b=v.useContext(Dg),{navigator:y,basename:S}=v.useContext(ni),j=b!=null&&dN(g)&&u===!0,A=y.encodeLocation?y.encodeLocation(g).pathname:g.pathname,M=x.pathname,R=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(M=M.toLowerCase(),R=R?R.toLowerCase():null,A=A.toLowerCase()),R&&S&&(R=_i(R,S)||R);const _=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let z=M===A||!o&&M.startsWith(A)&&M.charAt(_)==="/",F=R!=null&&(R===A||!o&&R.startsWith(A)&&R.charAt(A.length)==="/"),N={isActive:z,isPending:F,isTransitioning:j},I=z?t:void 0,B;typeof s=="function"?B=s(N):B=[s,z?"active":null,F?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let H=typeof a=="function"?a(N):a;return v.createElement(yn,{...f,"aria-current":I,className:B,ref:p,style:H,to:l,viewTransition:u},typeof d=="function"?d(N):d)});rN.displayName="NavLink";var sN=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:s,replace:o,state:a,method:l=F0,action:u,onSubmit:d,relative:f,preventScrollReset:p,viewTransition:g,unstable_defaultShouldRevalidate:x,...b},y)=>{let{unstable_useTransitions:S}=v.useContext(ni),j=cN(),A=uN(u,{relative:f}),M=l.toLowerCase()==="get"?"get":"post",R=typeof u=="string"&&j7.test(u),_=z=>{if(d&&d(z),z.defaultPrevented)return;z.preventDefault();let F=z.nativeEvent.submitter,N=F?.getAttribute("formmethod")||l,I=()=>j(F||z.currentTarget,{fetcherKey:t,method:N,navigate:n,replace:o,state:a,relative:f,preventScrollReset:p,viewTransition:g,unstable_defaultShouldRevalidate:x});S&&n!==!1?v.startTransition(()=>I()):I()};return v.createElement("form",{ref:y,method:M,action:A,onSubmit:s?d:_,...b,"data-discover":!R&&e==="render"?"true":void 0})});sN.displayName="Form";function oN(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function C7(e){let t=v.useContext(qu);return Cn(t,oN(e)),t}function iN(e,{target:t,replace:n,unstable_mask:s,state:o,preventScrollReset:a,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:d,unstable_useTransitions:f}={}){let p=Dn(),g=Nr(),x=Og(e,{relative:l});return v.useCallback(b=>{if(_B(b,t)){b.preventDefault();let y=n!==void 0?n:Ba(g)===Ba(x),S=()=>p(e,{replace:y,unstable_mask:s,state:o,preventScrollReset:a,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:d});f?v.startTransition(()=>S()):S()}},[g,p,x,n,s,o,t,e,a,l,u,d,f])}function Oj(e){Qr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(oS(e)),n=v.useRef(!1),s=Nr(),o=v.useMemo(()=>LB(s.search,n.current?null:t.current),[s.search]),a=Dn(),l=v.useCallback((u,d)=>{const f=oS(typeof u=="function"?u(new URLSearchParams(o)):u);n.current=!0,a("?"+f,d)},[a,o]);return[o,l]}var aN=0,lN=()=>`__${String(++aN)}__`;function cN(){let{router:e}=C7("useSubmit"),{basename:t}=v.useContext(ni),n=xB(),s=e.fetch,o=e.navigate;return v.useCallback(async(a,l={})=>{let{action:u,method:d,encType:f,formData:p,body:g}=OB(a,t);if(l.navigate===!1){let x=l.fetcherKey||lN();await s(x,n,l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:g,formMethod:l.method||d,formEncType:l.encType||f,flushSync:l.flushSync})}else await o(l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:g,formMethod:l.method||d,formEncType:l.encType||f,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[s,o,t,n])}function uN(e,{relative:t}={}){let{basename:n}=v.useContext(ni),s=v.useContext(Ni);Cn(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),a={...Og(e||".",{relative:t})},l=Nr();if(e==null){a.search=l.search;let u=new URLSearchParams(a.search),d=u.getAll("index");if(d.some(p=>p==="")){u.delete("index"),d.filter(g=>g).forEach(g=>u.append("index",g));let p=u.toString();a.search=p?`?${p}`:""}}return(!e||e===".")&&o.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:Mi([n,a.pathname])),Ba(a)}function dN(e,{relative:t}={}){let n=v.useContext(Mj);Cn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=C7("useViewTransitionState"),o=Og(e,{relative:t});if(!n.isTransitioning)return!1;let a=_i(n.currentLocation.pathname,s)||n.currentLocation.pathname,l=_i(n.nextLocation.pathname,s)||n.nextLocation.pathname;return Y0(o.pathname,l)!=null||Y0(o.pathname,a)!=null}var q1=qM();const Ox=Ig(q1);function fN(e){return v.createElement(EB,{flushSync:q1.flushSync,...e})}const hN="/api",pN={"Content-Type":"application/json",Accept:"application/json"},gN=()=>{const e=localStorage.getItem("user");return e?JSON.parse(e).token:null},mN=(e={},{isFormData:t=!1}={})=>{const n={...pN,...e},s=gN();return s&&(n.Authorization=`Bearer ${s}`),t&&(delete n["Content-Type"],delete n["content-type"]),n},aT=async(e,{allowPlainText:t=!1}={})=>{const n=String(e.headers.get("content-type")||"").toLowerCase(),s=n.includes("application/json"),o=await e.text();if(!o.trim())return{contentType:n,isJson:s,text:o,data:null};if(s)try{return{contentType:n,isJson:s,text:o,data:JSON.parse(o)}}catch{throw new Error("Invalid response format: expected JSON")}try{return{contentType:n,isJson:s,text:o,data:JSON.parse(o)}}catch{if(t)return{contentType:n,isJson:s,text:o,data:o};throw new Error("Invalid response format: expected JSON")}},np=async(e,t={})=>{const n=`${hN}${e}`,s=typeof FormData<"u"&&t.body instanceof FormData,o={...t,headers:mN(t.headers,{isFormData:s})};try{const a=await fetch(n,o);if(!a.ok){let u,d="An error occurred";try{const p=await aT(a,{allowPlainText:!0});u=p.data&&typeof p.data=="object"?p.data:null,p.isJson&&p.data&&typeof p.data=="object"?d=p.data.message||d:p.text?(console.error("Non-JSON error response:",p.text.substring(0,200)),d=a.statusText||`Server error (${a.status})`):d=a.statusText||d}catch{d=a.statusText||d}const f=new Error(d);throw f.status=a.status,f.data=u,f}if(a.status===204||a.status===205)return null;const l=await aT(a);return l.data===null?null:l.data}catch(a){throw a.status||console.error("API Error:",a),a}},ke={get:e=>np(e,{method:"GET"}),post:(e,t)=>{const n=typeof FormData<"u"&&t instanceof FormData;return np(e,{method:"POST",body:n?t:JSON.stringify(t)})},put:(e,t)=>{const n=typeof FormData<"u"&&t instanceof FormData;return np(e,{method:"PUT",body:n?t:JSON.stringify(t)})},patch:(e,t)=>{const n=typeof FormData<"u"&&t instanceof FormData;return np(e,{method:"PATCH",body:n?t:JSON.stringify(t)})},delete:e=>np(e,{method:"DELETE"})},mo={login:e=>ke.post("/auth/login",e),register:e=>ke.post("/auth/signup",e),logout:()=>ke.post("/auth/logout"),getCurrentUser:()=>ke.get("/auth/me"),verifyEmail:e=>ke.get(e),resendEmail:()=>ke.post("/auth/email/resend"),forgotPassword:e=>ke.post("/auth/password/forgot",{email:e}),verifyPasswordOtp:(e,t)=>ke.post("/auth/password/verify-otp",{email:e,otp:t}),resetPassword:(e,t,n,s)=>ke.post("/auth/password/reset",{email:e,otp:t,password:n,password_confirmation:s}),changePassword:(e,t,n)=>ke.post("/auth/password/change",{current_password:e,password:t,password_confirmation:n})},lT={getAll:()=>ke.get("/users"),getById:e=>ke.get(`/users/${e}`),create:e=>ke.post("/users",e),update:(e,t)=>ke.put(`/users/${e}`,t),delete:e=>ke.delete(`/users/${e}`)},xN=e=>String(e||"").trim().toLowerCase(),bN={administrator:"admin",super_admin:"admin","super-admin":"admin",superadmin:"admin",student:"learner",org_owner:"owner",org_admin:"organization_admin",org_manager:"manager",org_staff:"staff"},X0=new Set(["owner","manager","staff","organization_owner","organization_admin","organization_manager","organization_staff"]),cT=new Set(["learner"]),uT=new Set(["tutor"]),dT=new Set(["admin"]),ng=e=>{const t=xN(e);return bN[t]||t},w7=e=>Array.isArray(e?.roles)?e.roles.map(t=>ng(t?.name||t)).filter(Boolean):[],yN=e=>{const t=[e?.organization_role,e?.organizationRole,e?.org_role,e?.orgRole,e?.organization_user?.role,e?.organizationUser?.role,e?.organization?.pivot?.role];for(const n of t){const s=ng(n);if(X0.has(s))return s==="organization_admin"?"admin":s}if(Array.isArray(e?.organizations))for(const n of e.organizations){const s=ng(n?.pivot?.role||n?.role);if(X0.has(s))return s==="organization_admin"?"admin":s}return null},rg=e=>{const t=yN(e);if(t)return t;const n=w7(e);return n.includes("owner")?"owner":n.includes("organization_admin")?"admin":n.includes("manager")?"manager":n.includes("staff")?"staff":null},vN=e=>!!rg(e),SN=e=>{const t=rg(e);return t==="owner"||t==="admin"||t==="manager"},Bj=e=>{const t=ng(e?.role||e?.userType);if(dT.has(t))return"admin";if(rg(e)||X0.has(t))return"organization";if(uT.has(t))return"tutor";if(cT.has(t))return"learner";const n=w7(e);return n.some(s=>dT.has(s))?"admin":rg(e)?"organization":n.some(s=>uT.has(s))?"tutor":n.some(s=>cT.has(s))?"learner":null},jN=(e,t)=>{if(!e)return!1;const n=typeof e=="string"?e:e?.pathname;if(!n)return!1;const s=Bj(t);return n.startsWith("/admin")?s==="admin":n.startsWith("/tutor")?s==="tutor":n.startsWith("/learner/organization")||n.startsWith("/org")?s==="organization":!0},V1=e=>{if(typeof e=="string"){const n=ng(e);return n==="admin"?"/admin":n==="organization"||X0.has(n)?"/learner/organization":n==="tutor"?"/tutor":"/learner"}const t=Bj(e);return t==="admin"?"/admin":t==="organization"?"/learner/organization":t==="tutor"?"/tutor":"/learner"},Ko=(e,t="USD",n="en-US")=>new Intl.NumberFormat(n,{style:"currency",currency:t}).format(e),CN="https://goodgov.andjemztech.com/",Ru=e=>{if(!e)return"";const t=String(e).trim();return t?t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")?t:CN+t.replace(/^\//,""):""},wN="https://goodgov.andjemztech.com/storage/",fT=e=>{if(!e)return"";const t=String(e).trim();return t?t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")?t:wN+t.replace(/^\//,""):""},A7=v.createContext(null),AN=({children:e})=>{const[t,n]=v.useState(()=>{const I=localStorage.getItem("user");return I?JSON.parse(I):null}),[s,o]=v.useState(!0);v.useEffect(()=>{(async()=>{const B=localStorage.getItem("user");if(B)try{const H=JSON.parse(B);if(H.token){const P=await mo.getCurrentUser(),k=P.user||P;k.token=H.token,k.role=l(k)||k.role,!k.kyc_status&&H.kyc_status&&(k.kyc_status=H.kyc_status),k.email==="admin@test.com"&&(k.role="admin"),n(k),localStorage.setItem("user",JSON.stringify(k))}else n(H)}catch(H){console.error("Failed to get current user:",H),localStorage.removeItem("user"),n(null)}o(!1)})()},[]);const a=async(I,B)=>{try{const H=await mo.login({email:I,password:B}),P=H.user||H,k=H.token||P?.token||null,L={...P,...k?{token:k}:{}};if(L.role=l(L)||L.role,n(L),localStorage.setItem("user",JSON.stringify(L)),!k)return L;try{const O=await mo.getCurrentUser(),W=O.user||O;return W.token=k,W.role=l(W)||W.role,!W.kyc_status&&L.kyc_status&&(W.kyc_status=L.kyc_status),n(W),localStorage.setItem("user",JSON.stringify(W)),W}catch(O){return console.warn("Failed to fetch current user after login, using login response:",O),L}}catch(H){throw console.error("Login failed:",H),H}},l=I=>Bj(I),u=async I=>{try{const B=await mo.register(I),H=B.user||B,P=B.token,k={...H,token:P};k.role=l(k)||k.role,n(k),localStorage.setItem("user",JSON.stringify(k));let L=k;try{const W=await mo.getCurrentUser();L={...W.user||W,token:P},L.role=l(L)||k.role,L.email==="admin@test.com"&&(L.role="admin"),n(L),localStorage.setItem("user",JSON.stringify(L))}catch(W){console.warn("Failed to fetch current user after registration, using register response:",W)}if(!(L?.email_verified===!0||L?.emailVerified===!0||!!L?.email_verified_at||!!L?.emailVerifiedAt))try{await mo.resendEmail()}catch(W){console.warn("Auto-resend of verification email failed:",W)}return L}catch(B){throw console.error("Registration failed:",B),B}},d=async()=>{let I=String(t?.token||"").trim();if(!I)try{const B=localStorage.getItem("user");if(B){const H=JSON.parse(B);I=String(H?.token||"").trim()}}catch{I=""}try{I&&await mo.logout()}catch(B){B?.status!==401&&console.error("Logout API error:",B)}finally{n(null),localStorage.removeItem("user")}},f=I=>{const B={...t,...I};n(B),localStorage.setItem("user",JSON.stringify(B))},p=async()=>{try{const I=await mo.getCurrentUser(),B=I.user||I;return t?.token&&(B.token=t.token,B.role=l(B)||B.role),!B.kyc_status&&t?.kyc_status&&(B.kyc_status=t.kyc_status),n(B),localStorage.setItem("user",JSON.stringify(B)),B}catch(I){throw console.error("Failed to refresh user:",I),I}},g=()=>t?.email_verified===!0||t?.emailVerified===!0||!!t?.email_verified_at||!!t?.emailVerifiedAt,x=()=>{const I=t?.kyc_status||t?.kycStatus||null;return I?I.toLowerCase():null},b=()=>!!rg(t),N={user:t,loading:s,isAuthenticated:!!t,login:a,register:u,logout:d,updateUser:f,refreshUser:p,verifyEmail:async(I,B,H={})=>{try{const P=new URLSearchParams(H).toString(),k=`/auth/email/verify/${I}/${B}${P?`?${P}`:""}`,L=await mo.verifyEmail(k);if(localStorage.getItem("user"))try{await p()}catch(W){console.warn("Refresh user failed after verification:",W)}return L}catch(P){throw console.error("Email verification failed:",P),P}},resendEmail:async()=>{try{return await mo.resendEmail()}catch(I){throw console.error("Failed to resend email:",I),I}},forgotPassword:async I=>{try{return await mo.forgotPassword(I)}catch(B){throw console.error("Failed to send password reset OTP:",B),B}},verifyPasswordOtp:async(I,B)=>{try{return await mo.verifyPasswordOtp(I,B)}catch(H){if(H.status===422){const P=new Error("Invalid or expired OTP. Please request a new one.");throw P.status=422,P}else if(H.status===429){const P=new Error("Too many failed attempts. Your account has been temporarily locked. Please try again later.");throw P.status=429,P}throw console.error("Failed to verify password reset OTP:",H),H}},resetPassword:async(I,B,H,P)=>{try{return await mo.resetPassword(I,B,H,P)}catch(k){if(k.status===422){const L=new Error(k.message||"Invalid OTP or password does not meet requirements.");throw L.status=422,L}throw console.error("Failed to reset password:",k),k}},changePassword:async(I,B,H)=>{try{const P=await mo.changePassword(I,B,H);return n(null),localStorage.removeItem("user"),P}catch(P){if(P.status===422){const k=new Error(P.message||"Current password is incorrect or new password does not meet requirements.");throw k.status=422,k}throw console.error("Failed to change password:",P),P}},isEmailVerified:g,getKycStatus:x,isKycComplete:()=>{const I=x();return I==="approved"||I==="completed"},needsEmailVerification:()=>b()?!1:!g(),needsKyc:()=>{const I=x();return!I||I==="pending"||I==="draft"||I==="rejected"}};return r.jsx(A7.Provider,{value:N,children:e})},ps=()=>{const e=v.useContext(A7);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e};function wl(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(s=>n.searchParams.append("args[]",s)),`Minified MUI error #${e}; visit ${n} for the full message.`}const Ri="$$material";function Ce(){return Ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ce.apply(null,arguments)}function EN(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function TN(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var kN=(function(){function e(n){var s=this;this._insertTag=function(o){var a;s.tags.length===0?s.insertionPoint?a=s.insertionPoint.nextSibling:s.prepend?a=s.container.firstChild:a=s.before:a=s.tags[s.tags.length-1].nextSibling,s.container.insertBefore(o,a),s.tags.push(o)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(s){s.forEach(this._insertTag)},t.insert=function(s){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(TN(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var a=EN(o);try{a.insertRule(s,a.cssRules.length)}catch{}}else o.appendChild(document.createTextNode(s));this.ctr++},t.flush=function(){this.tags.forEach(function(s){var o;return(o=s.parentNode)==null?void 0:o.removeChild(s)}),this.tags=[],this.ctr=0},e})(),Bs="-ms-",Z0="-moz-",Qn="-webkit-",E7="comm",Nj="rule",$j="decl",MN="@import",T7="@keyframes",RN="@layer",zN=Math.abs,G1=String.fromCharCode,IN=Object.assign;function FN(e,t){return Is(e,0)^45?(((t<<2^Is(e,0))<<2^Is(e,1))<<2^Is(e,2))<<2^Is(e,3):0}function k7(e){return e.trim()}function _N(e,t){return(e=t.exec(e))?e[0]:e}function Jn(e,t,n){return e.replace(t,n)}function iS(e,t){return e.indexOf(t)}function Is(e,t){return e.charCodeAt(t)|0}function sg(e,t,n){return e.slice(t,n)}function Ma(e){return e.length}function Hj(e){return e.length}function Bx(e,t){return t.push(e),e}function LN(e,t){return e.map(t).join("")}var Y1=1,Pf=1,M7=0,Co=0,fs=0,nh="";function K1(e,t,n,s,o,a,l){return{value:e,root:t,parent:n,type:s,props:o,children:a,line:Y1,column:Pf,length:l,return:""}}function rp(e,t){return IN(K1("",null,null,"",null,null,0),e,{length:-e.length},t)}function PN(){return fs}function DN(){return fs=Co>0?Is(nh,--Co):0,Pf--,fs===10&&(Pf=1,Y1--),fs}function Qo(){return fs=Co<M7?Is(nh,Co++):0,Pf++,fs===10&&(Pf=1,Y1++),fs}function _a(){return Is(nh,Co)}function L0(){return Co}function Bg(e,t){return sg(nh,e,t)}function og(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function R7(e){return Y1=Pf=1,M7=Ma(nh=e),Co=0,[]}function z7(e){return nh="",e}function P0(e){return k7(Bg(Co-1,aS(e===91?e+2:e===40?e+1:e)))}function ON(e){for(;(fs=_a())&&fs<33;)Qo();return og(e)>2||og(fs)>3?"":" "}function BN(e,t){for(;--t&&Qo()&&!(fs<48||fs>102||fs>57&&fs<65||fs>70&&fs<97););return Bg(e,L0()+(t<6&&_a()==32&&Qo()==32))}function aS(e){for(;Qo();)switch(fs){case e:return Co;case 34:case 39:e!==34&&e!==39&&aS(fs);break;case 40:e===41&&aS(e);break;case 92:Qo();break}return Co}function NN(e,t){for(;Qo()&&e+fs!==57;)if(e+fs===84&&_a()===47)break;return"/*"+Bg(t,Co-1)+"*"+G1(e===47?e:Qo())}function $N(e){for(;!og(_a());)Qo();return Bg(e,Co)}function HN(e){return z7(D0("",null,null,null,[""],e=R7(e),0,[0],e))}function D0(e,t,n,s,o,a,l,u,d){for(var f=0,p=0,g=l,x=0,b=0,y=0,S=1,j=1,A=1,M=0,R="",_=o,z=a,F=s,N=R;j;)switch(y=M,M=Qo()){case 40:if(y!=108&&Is(N,g-1)==58){iS(N+=Jn(P0(M),"&","&\f"),"&\f")!=-1&&(A=-1);break}case 34:case 39:case 91:N+=P0(M);break;case 9:case 10:case 13:case 32:N+=ON(y);break;case 92:N+=BN(L0()-1,7);continue;case 47:switch(_a()){case 42:case 47:Bx(WN(NN(Qo(),L0()),t,n),d);break;default:N+="/"}break;case 123*S:u[f++]=Ma(N)*A;case 125*S:case 59:case 0:switch(M){case 0:case 125:j=0;case 59+p:A==-1&&(N=Jn(N,/\f/g,"")),b>0&&Ma(N)-g&&Bx(b>32?pT(N+";",s,n,g-1):pT(Jn(N," ","")+";",s,n,g-2),d);break;case 59:N+=";";default:if(Bx(F=hT(N,t,n,f,p,o,u,R,_=[],z=[],g),a),M===123)if(p===0)D0(N,t,F,F,_,a,g,u,z);else switch(x===99&&Is(N,3)===110?100:x){case 100:case 108:case 109:case 115:D0(e,F,F,s&&Bx(hT(e,F,F,0,0,o,u,R,o,_=[],g),z),o,z,g,u,s?_:z);break;default:D0(N,F,F,F,[""],z,0,u,z)}}f=p=b=0,S=A=1,R=N="",g=l;break;case 58:g=1+Ma(N),b=y;default:if(S<1){if(M==123)--S;else if(M==125&&S++==0&&DN()==125)continue}switch(N+=G1(M),M*S){case 38:A=p>0?1:(N+="\f",-1);break;case 44:u[f++]=(Ma(N)-1)*A,A=1;break;case 64:_a()===45&&(N+=P0(Qo())),x=_a(),p=g=Ma(R=N+=$N(L0())),M++;break;case 45:y===45&&Ma(N)==2&&(S=0)}}return a}function hT(e,t,n,s,o,a,l,u,d,f,p){for(var g=o-1,x=o===0?a:[""],b=Hj(x),y=0,S=0,j=0;y<s;++y)for(var A=0,M=sg(e,g+1,g=zN(S=l[y])),R=e;A<b;++A)(R=k7(S>0?x[A]+" "+M:Jn(M,/&\f/g,x[A])))&&(d[j++]=R);return K1(e,t,n,o===0?Nj:u,d,f,p)}function WN(e,t,n){return K1(e,t,n,E7,G1(PN()),sg(e,2,-2),0)}function pT(e,t,n,s){return K1(e,t,n,$j,sg(e,0,s),sg(e,s+1,-1),s)}function wf(e,t){for(var n="",s=Hj(e),o=0;o<s;o++)n+=t(e[o],o,e,t)||"";return n}function UN(e,t,n,s){switch(e.type){case RN:if(e.children.length)break;case MN:case $j:return e.return=e.return||e.value;case E7:return"";case T7:return e.return=e.value+"{"+wf(e.children,s)+"}";case Nj:e.value=e.props.join(",")}return Ma(n=wf(e.children,s))?e.return=e.value+"{"+n+"}":""}function qN(e){var t=Hj(e);return function(n,s,o,a){for(var l="",u=0;u<t;u++)l+=e[u](n,s,o,a)||"";return l}}function VN(e){return function(t){t.root||(t=t.return)&&e(t)}}function I7(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var GN=function(t,n,s){for(var o=0,a=0;o=a,a=_a(),o===38&&a===12&&(n[s]=1),!og(a);)Qo();return Bg(t,Co)},YN=function(t,n){var s=-1,o=44;do switch(og(o)){case 0:o===38&&_a()===12&&(n[s]=1),t[s]+=GN(Co-1,n,s);break;case 2:t[s]+=P0(o);break;case 4:if(o===44){t[++s]=_a()===58?"&\f":"",n[s]=t[s].length;break}default:t[s]+=G1(o)}while(o=Qo());return t},KN=function(t,n){return z7(YN(R7(t),n))},gT=new WeakMap,XN=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,s=t.parent,o=t.column===s.column&&t.line===s.line;s.type!=="rule";)if(s=s.parent,!s)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!gT.get(s))&&!o){gT.set(t,!0);for(var a=[],l=KN(n,a),u=s.props,d=0,f=0;d<l.length;d++)for(var p=0;p<u.length;p++,f++)t.props[f]=a[d]?l[d].replace(/&\f/g,u[p]):u[p]+" "+l[d]}}},ZN=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function F7(e,t){switch(FN(e,t)){case 5103:return Qn+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Qn+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Qn+e+Z0+e+Bs+e+e;case 6828:case 4268:return Qn+e+Bs+e+e;case 6165:return Qn+e+Bs+"flex-"+e+e;case 5187:return Qn+e+Jn(e,/(\w+).+(:[^]+)/,Qn+"box-$1$2"+Bs+"flex-$1$2")+e;case 5443:return Qn+e+Bs+"flex-item-"+Jn(e,/flex-|-self/,"")+e;case 4675:return Qn+e+Bs+"flex-line-pack"+Jn(e,/align-content|flex-|-self/,"")+e;case 5548:return Qn+e+Bs+Jn(e,"shrink","negative")+e;case 5292:return Qn+e+Bs+Jn(e,"basis","preferred-size")+e;case 6060:return Qn+"box-"+Jn(e,"-grow","")+Qn+e+Bs+Jn(e,"grow","positive")+e;case 4554:return Qn+Jn(e,/([^-])(transform)/g,"$1"+Qn+"$2")+e;case 6187:return Jn(Jn(Jn(e,/(zoom-|grab)/,Qn+"$1"),/(image-set)/,Qn+"$1"),e,"")+e;case 5495:case 3959:return Jn(e,/(image-set\([^]*)/,Qn+"$1$`$1");case 4968:return Jn(Jn(e,/(.+:)(flex-)?(.*)/,Qn+"box-pack:$3"+Bs+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Qn+e+e;case 4095:case 3583:case 4068:case 2532:return Jn(e,/(.+)-inline(.+)/,Qn+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ma(e)-1-t>6)switch(Is(e,t+1)){case 109:if(Is(e,t+4)!==45)break;case 102:return Jn(e,/(.+:)(.+)-([^]+)/,"$1"+Qn+"$2-$3$1"+Z0+(Is(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~iS(e,"stretch")?F7(Jn(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Is(e,t+1)!==115)break;case 6444:switch(Is(e,Ma(e)-3-(~iS(e,"!important")&&10))){case 107:return Jn(e,":",":"+Qn)+e;case 101:return Jn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Qn+(Is(e,14)===45?"inline-":"")+"box$3$1"+Qn+"$2$3$1"+Bs+"$2box$3")+e}break;case 5936:switch(Is(e,t+11)){case 114:return Qn+e+Bs+Jn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Qn+e+Bs+Jn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Qn+e+Bs+Jn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Qn+e+Bs+e+e}return e}var QN=function(t,n,s,o){if(t.length>-1&&!t.return)switch(t.type){case $j:t.return=F7(t.value,t.length);break;case T7:return wf([rp(t,{value:Jn(t.value,"@","@"+Qn)})],o);case Nj:if(t.length)return LN(t.props,function(a){switch(_N(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return wf([rp(t,{props:[Jn(a,/:(read-\w+)/,":"+Z0+"$1")]})],o);case"::placeholder":return wf([rp(t,{props:[Jn(a,/:(plac\w+)/,":"+Qn+"input-$1")]}),rp(t,{props:[Jn(a,/:(plac\w+)/,":"+Z0+"$1")]}),rp(t,{props:[Jn(a,/:(plac\w+)/,Bs+"input-$1")]})],o)}return""})}},JN=[QN],e$=function(t){var n=t.key;if(n==="css"){var s=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(s,function(S){var j=S.getAttribute("data-emotion");j.indexOf(" ")!==-1&&(document.head.appendChild(S),S.setAttribute("data-s",""))})}var o=t.stylisPlugins||JN,a={},l,u=[];l=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(S){for(var j=S.getAttribute("data-emotion").split(" "),A=1;A<j.length;A++)a[j[A]]=!0;u.push(S)});var d,f=[XN,ZN];{var p,g=[UN,VN(function(S){p.insert(S)})],x=qN(f.concat(o,g)),b=function(j){return wf(HN(j),x)};d=function(j,A,M,R){p=M,b(j?j+"{"+A.styles+"}":A.styles),R&&(y.inserted[A.name]=!0)}}var y={key:n,sheet:new kN({key:n,container:l,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:d};return y.sheet.hydrate(u),y},L2={exports:{}},rr={};var mT;function t$(){if(mT)return rr;mT=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,s=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,p=e?Symbol.for("react.forward_ref"):60112,g=e?Symbol.for("react.suspense"):60113,x=e?Symbol.for("react.suspense_list"):60120,b=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,S=e?Symbol.for("react.block"):60121,j=e?Symbol.for("react.fundamental"):60117,A=e?Symbol.for("react.responder"):60118,M=e?Symbol.for("react.scope"):60119;function R(z){if(typeof z=="object"&&z!==null){var F=z.$$typeof;switch(F){case t:switch(z=z.type,z){case d:case f:case s:case a:case o:case g:return z;default:switch(z=z&&z.$$typeof,z){case u:case p:case y:case b:case l:return z;default:return F}}case n:return F}}}function _(z){return R(z)===f}return rr.AsyncMode=d,rr.ConcurrentMode=f,rr.ContextConsumer=u,rr.ContextProvider=l,rr.Element=t,rr.ForwardRef=p,rr.Fragment=s,rr.Lazy=y,rr.Memo=b,rr.Portal=n,rr.Profiler=a,rr.StrictMode=o,rr.Suspense=g,rr.isAsyncMode=function(z){return _(z)||R(z)===d},rr.isConcurrentMode=_,rr.isContextConsumer=function(z){return R(z)===u},rr.isContextProvider=function(z){return R(z)===l},rr.isElement=function(z){return typeof z=="object"&&z!==null&&z.$$typeof===t},rr.isForwardRef=function(z){return R(z)===p},rr.isFragment=function(z){return R(z)===s},rr.isLazy=function(z){return R(z)===y},rr.isMemo=function(z){return R(z)===b},rr.isPortal=function(z){return R(z)===n},rr.isProfiler=function(z){return R(z)===a},rr.isStrictMode=function(z){return R(z)===o},rr.isSuspense=function(z){return R(z)===g},rr.isValidElementType=function(z){return typeof z=="string"||typeof z=="function"||z===s||z===f||z===a||z===o||z===g||z===x||typeof z=="object"&&z!==null&&(z.$$typeof===y||z.$$typeof===b||z.$$typeof===l||z.$$typeof===u||z.$$typeof===p||z.$$typeof===j||z.$$typeof===A||z.$$typeof===M||z.$$typeof===S)},rr.typeOf=R,rr}var xT;function n$(){return xT||(xT=1,L2.exports=t$()),L2.exports}var P2,bT;function r$(){if(bT)return P2;bT=1;var e=n$(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};a[e.ForwardRef]=s,a[e.Memo]=o;function l(y){return e.isMemo(y)?o:a[y.$$typeof]||t}var u=Object.defineProperty,d=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,g=Object.getPrototypeOf,x=Object.prototype;function b(y,S,j){if(typeof S!="string"){if(x){var A=g(S);A&&A!==x&&b(y,A,j)}var M=d(S);f&&(M=M.concat(f(S)));for(var R=l(y),_=l(S),z=0;z<M.length;++z){var F=M[z];if(!n[F]&&!(j&&j[F])&&!(_&&_[F])&&!(R&&R[F])){var N=p(S,F);try{u(y,F,N)}catch{}}}}return y}return P2=b,P2}r$();var s$=!0;function _7(e,t,n){var s="";return n.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):o&&(s+=o+" ")}),s}var Wj=function(t,n,s){var o=t.key+"-"+n.name;(s===!1||s$===!1)&&t.registered[o]===void 0&&(t.registered[o]=n.styles)},Uj=function(t,n,s){Wj(t,n,s);var o=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var a=n;do t.insert(n===a?"."+o:"",a,t.sheet,!0),a=a.next;while(a!==void 0)}};function o$(e){for(var t=0,n,s=0,o=e.length;o>=4;++s,o-=4)n=e.charCodeAt(s)&255|(e.charCodeAt(++s)&255)<<8|(e.charCodeAt(++s)&255)<<16|(e.charCodeAt(++s)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(s+2)&255)<<16;case 2:t^=(e.charCodeAt(s+1)&255)<<8;case 1:t^=e.charCodeAt(s)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var i$={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},a$=/[A-Z]|^ms/g,l$=/_EMO_([^_]+?)_([^]*?)_EMO_/g,L7=function(t){return t.charCodeAt(1)===45},yT=function(t){return t!=null&&typeof t!="boolean"},D2=I7(function(e){return L7(e)?e:e.replace(a$,"-$&").toLowerCase()}),vT=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(l$,function(s,o,a){return Ra={name:o,styles:a,next:Ra},o})}return i$[t]!==1&&!L7(t)&&typeof n=="number"&&n!==0?n+"px":n};function ig(e,t,n){if(n==null)return"";var s=n;if(s.__emotion_styles!==void 0)return s;switch(typeof n){case"boolean":return"";case"object":{var o=n;if(o.anim===1)return Ra={name:o.name,styles:o.styles,next:Ra},o.name;var a=n;if(a.styles!==void 0){var l=a.next;if(l!==void 0)for(;l!==void 0;)Ra={name:l.name,styles:l.styles,next:Ra},l=l.next;var u=a.styles+";";return u}return c$(e,t,n)}case"function":{if(e!==void 0){var d=Ra,f=n(e);return Ra=d,ig(e,t,f)}break}}var p=n;if(t==null)return p;var g=t[p];return g!==void 0?g:p}function c$(e,t,n){var s="";if(Array.isArray(n))for(var o=0;o<n.length;o++)s+=ig(e,t,n[o])+";";else for(var a in n){var l=n[a];if(typeof l!="object"){var u=l;t!=null&&t[u]!==void 0?s+=a+"{"+t[u]+"}":yT(u)&&(s+=D2(a)+":"+vT(a,u)+";")}else if(Array.isArray(l)&&typeof l[0]=="string"&&(t==null||t[l[0]]===void 0))for(var d=0;d<l.length;d++)yT(l[d])&&(s+=D2(a)+":"+vT(a,l[d])+";");else{var f=ig(e,t,l);switch(a){case"animation":case"animationName":{s+=D2(a)+":"+f+";";break}default:s+=a+"{"+f+"}"}}}return s}var ST=/label:\s*([^\s;{]+)\s*(;|$)/g,Ra;function Ng(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var s=!0,o="";Ra=void 0;var a=e[0];if(a==null||a.raw===void 0)s=!1,o+=ig(n,t,a);else{var l=a;o+=l[0]}for(var u=1;u<e.length;u++)if(o+=ig(n,t,e[u]),s){var d=a;o+=d[u]}ST.lastIndex=0;for(var f="",p;(p=ST.exec(o))!==null;)f+="-"+p[1];var g=o$(o)+f;return{name:g,styles:o,next:Ra}}var u$=function(t){return t()},P7=Qp.useInsertionEffect?Qp.useInsertionEffect:!1,D7=P7||u$,jT=P7||v.useLayoutEffect,O7=v.createContext(typeof HTMLElement<"u"?e$({key:"css"}):null);O7.Provider;var qj=function(t){return v.forwardRef(function(n,s){var o=v.useContext(O7);return t(n,o,s)})},$g=v.createContext({}),Vj={}.hasOwnProperty,lS="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",d$=function(t,n){var s={};for(var o in n)Vj.call(n,o)&&(s[o]=n[o]);return s[lS]=t,s},f$=function(t){var n=t.cache,s=t.serialized,o=t.isStringTag;return Wj(n,s,o),D7(function(){return Uj(n,s,o)}),null},h$=qj(function(e,t,n){var s=e.css;typeof s=="string"&&t.registered[s]!==void 0&&(s=t.registered[s]);var o=e[lS],a=[s],l="";typeof e.className=="string"?l=_7(t.registered,a,e.className):e.className!=null&&(l=e.className+" ");var u=Ng(a,void 0,v.useContext($g));l+=t.key+"-"+u.name;var d={};for(var f in e)Vj.call(e,f)&&f!=="css"&&f!==lS&&(d[f]=e[f]);return d.className=l,n&&(d.ref=n),v.createElement(v.Fragment,null,v.createElement(f$,{cache:t,serialized:u,isStringTag:typeof o=="string"}),v.createElement(o,d))}),p$=h$,CT=function(t,n){var s=arguments;if(n==null||!Vj.call(n,"css"))return v.createElement.apply(void 0,s);var o=s.length,a=new Array(o);a[0]=p$,a[1]=d$(t,n);for(var l=2;l<o;l++)a[l]=s[l];return v.createElement.apply(null,a)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(CT||(CT={}));var g$=qj(function(e,t){var n=e.styles,s=Ng([n],void 0,v.useContext($g)),o=v.useRef();return jT(function(){var a=t.key+"-global",l=new t.sheet.constructor({key:a,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),u=!1,d=document.querySelector('style[data-emotion="'+a+" "+s.name+'"]');return t.sheet.tags.length&&(l.before=t.sheet.tags[0]),d!==null&&(u=!0,d.setAttribute("data-emotion",a),l.hydrate([d])),o.current=[l,u],function(){l.flush()}},[t]),jT(function(){var a=o.current,l=a[0],u=a[1];if(u){a[1]=!1;return}if(s.next!==void 0&&Uj(t,s.next,!0),l.tags.length){var d=l.tags[l.tags.length-1].nextElementSibling;l.before=d,l.flush()}t.insert("",s,l,!1)},[t,s.name]),null});function Oc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ng(t)}function Va(){var e=Oc.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var m$=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,x$=I7(function(e){return m$.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),b$=x$,y$=function(t){return t!=="theme"},wT=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?b$:y$},AT=function(t,n,s){var o;if(n){var a=n.shouldForwardProp;o=t.__emotion_forwardProp&&a?function(l){return t.__emotion_forwardProp(l)&&a(l)}:a}return typeof o!="function"&&s&&(o=t.__emotion_forwardProp),o},v$=function(t){var n=t.cache,s=t.serialized,o=t.isStringTag;return Wj(n,s,o),D7(function(){return Uj(n,s,o)}),null},S$=function e(t,n){var s=t.__emotion_real===t,o=s&&t.__emotion_base||t,a,l;n!==void 0&&(a=n.label,l=n.target);var u=AT(t,n,s),d=u||wT(o),f=!d("as");return function(){var p=arguments,g=s&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(a!==void 0&&g.push("label:"+a+";"),p[0]==null||p[0].raw===void 0)g.push.apply(g,p);else{var x=p[0];g.push(x[0]);for(var b=p.length,y=1;y<b;y++)g.push(p[y],x[y])}var S=qj(function(j,A,M){var R=f&&j.as||o,_="",z=[],F=j;if(j.theme==null){F={};for(var N in j)F[N]=j[N];F.theme=v.useContext($g)}typeof j.className=="string"?_=_7(A.registered,z,j.className):j.className!=null&&(_=j.className+" ");var I=Ng(g.concat(z),A.registered,F);_+=A.key+"-"+I.name,l!==void 0&&(_+=" "+l);var B=f&&u===void 0?wT(R):d,H={};for(var P in j)f&&P==="as"||B(P)&&(H[P]=j[P]);return H.className=_,M&&(H.ref=M),v.createElement(v.Fragment,null,v.createElement(v$,{cache:A,serialized:I,isStringTag:typeof R=="string"}),v.createElement(R,H))});return S.displayName=a!==void 0?a:"Styled("+(typeof o=="string"?o:o.displayName||o.name||"Component")+")",S.defaultProps=t.defaultProps,S.__emotion_real=S,S.__emotion_base=o,S.__emotion_styles=g,S.__emotion_forwardProp=u,Object.defineProperty(S,"toString",{value:function(){return"."+l}}),S.withComponent=function(j,A){var M=e(j,Ce({},n,A,{shouldForwardProp:AT(S,A,!0)}));return M.apply(void 0,g)},S}},j$=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],cS=S$.bind(null);j$.forEach(function(e){cS[e]=cS(e)});function C$(e){return e==null||Object.keys(e).length===0}function B7(e){const{styles:t,defaultTheme:n={}}=e,s=typeof t=="function"?o=>t(C$(o)?n:o):t;return r.jsx(g$,{styles:s})}function N7(e,t){return cS(e,t)}function w$(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const ET=[];function Tc(e){return ET[0]=e,Ng(ET)}var O2={exports:{}},br={};var TT;function A$(){if(TT)return br;TT=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),x=Symbol.for("react.view_transition"),b=Symbol.for("react.client.reference");function y(S){if(typeof S=="object"&&S!==null){var j=S.$$typeof;switch(j){case e:switch(S=S.type,S){case n:case o:case s:case d:case f:case x:return S;default:switch(S=S&&S.$$typeof,S){case l:case u:case g:case p:return S;case a:return S;default:return j}}case t:return j}}}return br.ContextConsumer=a,br.ContextProvider=l,br.Element=e,br.ForwardRef=u,br.Fragment=n,br.Lazy=g,br.Memo=p,br.Portal=t,br.Profiler=o,br.StrictMode=s,br.Suspense=d,br.SuspenseList=f,br.isContextConsumer=function(S){return y(S)===a},br.isContextProvider=function(S){return y(S)===l},br.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===e},br.isForwardRef=function(S){return y(S)===u},br.isFragment=function(S){return y(S)===n},br.isLazy=function(S){return y(S)===g},br.isMemo=function(S){return y(S)===p},br.isPortal=function(S){return y(S)===t},br.isProfiler=function(S){return y(S)===o},br.isStrictMode=function(S){return y(S)===s},br.isSuspense=function(S){return y(S)===d},br.isSuspenseList=function(S){return y(S)===f},br.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===n||S===o||S===s||S===d||S===f||typeof S=="object"&&S!==null&&(S.$$typeof===g||S.$$typeof===p||S.$$typeof===l||S.$$typeof===a||S.$$typeof===u||S.$$typeof===b||S.getModuleId!==void 0)},br.typeOf=y,br}var kT;function E$(){return kT||(kT=1,O2.exports=A$()),O2.exports}var $7=E$();function Fa(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function H7(e){if(v.isValidElement(e)||$7.isValidElementType(e)||!Fa(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=H7(e[n])}),t}function As(e,t,n={clone:!0}){const s=n.clone?{...e}:e;return Fa(e)&&Fa(t)&&Object.keys(t).forEach(o=>{v.isValidElement(t[o])||$7.isValidElementType(t[o])?s[o]=t[o]:Fa(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&Fa(e[o])?s[o]=As(e[o],t[o],n):n.clone?s[o]=Fa(t[o])?H7(t[o]):t[o]:s[o]=t[o]}),s}const T$=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,s)=>n.val-s.val),t.reduce((n,s)=>({...n,[s.key]:s.val}),{})};function k$(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:s=5,...o}=e,a=T$(t),l=Object.keys(a);function u(x){return`@media (min-width:${typeof t[x]=="number"?t[x]:x}${n})`}function d(x){return`@media (max-width:${(typeof t[x]=="number"?t[x]:x)-s/100}${n})`}function f(x,b){const y=l.indexOf(b);return`@media (min-width:${typeof t[x]=="number"?t[x]:x}${n}) and (max-width:${(y!==-1&&typeof t[l[y]]=="number"?t[l[y]]:b)-s/100}${n})`}function p(x){return l.indexOf(x)+1<l.length?f(x,l[l.indexOf(x)+1]):u(x)}function g(x){const b=l.indexOf(x);return b===0?u(l[1]):b===l.length-1?d(l[b]):f(x,l[l.indexOf(x)+1]).replace("@media","@media not all and")}return{keys:l,values:a,up:u,down:d,between:f,only:p,not:g,unit:n,...o}}function MT(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(s=>s.startsWith("@container")).sort((s,o)=>{const a=/min-width:\s*([0-9.]+)/;return+(s.match(a)?.[1]||0)-+(o.match(a)?.[1]||0)});return n.length?n.reduce((s,o)=>{const a=t[o];return delete s[o],s[o]=a,s},{...t}):t}function M$(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function R$(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,s,o]=n,a=Number.isNaN(+s)?s||0:+s;return e.containerQueries(o).up(a)}function z$(e){const t=(a,l)=>a.replace("@media",l?`@container ${l}`:"@container");function n(a,l){a.up=(...u)=>t(e.breakpoints.up(...u),l),a.down=(...u)=>t(e.breakpoints.down(...u),l),a.between=(...u)=>t(e.breakpoints.between(...u),l),a.only=(...u)=>t(e.breakpoints.only(...u),l),a.not=(...u)=>{const d=t(e.breakpoints.not(...u),l);return d.includes("not all and")?d.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):d}}const s={},o=a=>(n(s,a),s);return n(o),{...e,containerQueries:o}}const I$={borderRadius:4};function Op(e,t){return t?As(e,t,{clone:!1}):e}const X1={xs:0,sm:600,md:900,lg:1200,xl:1536},RT={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${X1[e]}px)`},F$={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:X1[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function da(e,t,n){const s=e.theme||{};if(Array.isArray(t)){const a=s.breakpoints||RT;return t.reduce((l,u,d)=>(l[a.up(a.keys[d])]=n(t[d]),l),{})}if(typeof t=="object"){const a=s.breakpoints||RT;return Object.keys(t).reduce((l,u)=>{if(M$(a.keys,u)){const d=R$(s.containerQueries?s:F$,u);d&&(l[d]=n(t[u],u))}else if(Object.keys(a.values||X1).includes(u)){const d=a.up(u);l[d]=n(t[u],u)}else{const d=u;l[d]=t[d]}return l},{})}return n(t)}function W7(e={}){return e.keys?.reduce((n,s)=>{const o=e.up(s);return n[o]={},n},{})||{}}function uS(e,t){return e.reduce((n,s)=>{const o=n[s];return(!o||Object.keys(o).length===0)&&delete n[s],n},t)}function _$(e,...t){const n=W7(e),s=[n,...t].reduce((o,a)=>As(o,a),{});return uS(Object.keys(n),s)}function L$(e,t){if(typeof e!="object")return{};const n={},s=Object.keys(t);return Array.isArray(e)?s.forEach((o,a)=>{a<e.length&&(n[o]=!0)}):s.forEach(o=>{e[o]!=null&&(n[o]=!0)}),n}function B2({values:e,breakpoints:t,base:n}){const s=n||L$(e,t),o=Object.keys(s);if(o.length===0)return e;let a;return o.reduce((l,u,d)=>(Array.isArray(e)?(l[u]=e[d]!=null?e[d]:e[a],a=d):typeof e=="object"?(l[u]=e[u]!=null?e[u]:e[a],a=u):l[u]=e,l),{})}function Le(e){if(typeof e!="string")throw new Error(wl(7));return e.charAt(0).toUpperCase()+e.slice(1)}function za(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const s=`vars.${t}`.split(".").reduce((o,a)=>o&&o[a]?o[a]:null,e);if(s!=null)return s}return t.split(".").reduce((s,o)=>s&&s[o]!=null?s[o]:null,e)}function Q0(e,t,n,s=n){let o;return typeof e=="function"?o=e(n):Array.isArray(e)?o=e[n]||s:o=za(e,n)||s,t&&(o=t(o,s,e)),o}function as(e){const{prop:t,cssProperty:n=e.prop,themeKey:s,transform:o}=e,a=l=>{if(l[t]==null)return null;const u=l[t],d=l.theme,f=za(d,s)||{};return da(l,u,g=>{let x=Q0(f,o,g);return g===x&&typeof g=="string"&&(x=Q0(f,o,`${t}${g==="default"?"":Le(g)}`,g)),n===!1?x:{[n]:x}})};return a.propTypes={},a.filterProps=[t],a}function P$(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const D$={m:"margin",p:"padding"},O$={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},zT={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},B$=P$(e=>{if(e.length>2)if(zT[e])e=zT[e];else return[e];const[t,n]=e.split(""),s=D$[t],o=O$[n]||"";return Array.isArray(o)?o.map(a=>s+a):[s+o]}),Gj=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Yj=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Gj,...Yj];function Hg(e,t,n,s){const o=za(e,t,!0)??n;return typeof o=="number"||typeof o=="string"?a=>typeof a=="string"?a:typeof o=="string"?o.startsWith("var(")&&a===0?0:o.startsWith("var(")&&a===1?o:`calc(${a} * ${o})`:o*a:Array.isArray(o)?a=>{if(typeof a=="string")return a;const l=Math.abs(a),u=o[l];return a>=0?u:typeof u=="number"?-u:typeof u=="string"&&u.startsWith("var(")?`calc(-1 * ${u})`:`-${u}`}:typeof o=="function"?o:()=>{}}function Z1(e){return Hg(e,"spacing",8)}function zu(e,t){return typeof t=="string"||t==null?t:e(t)}function N$(e,t){return n=>e.reduce((s,o)=>(s[o]=zu(t,n),s),{})}function $$(e,t,n,s){if(!t.includes(n))return null;const o=B$(n),a=N$(o,s),l=e[n];return da(e,l,a)}function U7(e,t){const n=Z1(e.theme);return Object.keys(e).map(s=>$$(e,t,s,n)).reduce(Op,{})}function Kr(e){return U7(e,Gj)}Kr.propTypes={};Kr.filterProps=Gj;function Xr(e){return U7(e,Yj)}Xr.propTypes={};Xr.filterProps=Yj;function q7(e=8,t=Z1({spacing:e})){if(e.mui)return e;const n=(...s)=>(s.length===0?[1]:s).map(a=>{const l=t(a);return typeof l=="number"?`${l}px`:l}).join(" ");return n.mui=!0,n}function Q1(...e){const t=e.reduce((s,o)=>(o.filterProps.forEach(a=>{s[a]=o}),s),{}),n=s=>Object.keys(s).reduce((o,a)=>t[a]?Op(o,t[a](s)):o,{});return n.propTypes={},n.filterProps=e.reduce((s,o)=>s.concat(o.filterProps),[]),n}function yi(e){return typeof e!="number"?e:`${e}px solid`}function $i(e,t){return as({prop:e,themeKey:"borders",transform:t})}const H$=$i("border",yi),W$=$i("borderTop",yi),U$=$i("borderRight",yi),q$=$i("borderBottom",yi),V$=$i("borderLeft",yi),G$=$i("borderColor"),Y$=$i("borderTopColor"),K$=$i("borderRightColor"),X$=$i("borderBottomColor"),Z$=$i("borderLeftColor"),Q$=$i("outline",yi),J$=$i("outlineColor"),J1=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Hg(e.theme,"shape.borderRadius",4),n=s=>({borderRadius:zu(t,s)});return da(e,e.borderRadius,n)}return null};J1.propTypes={};J1.filterProps=["borderRadius"];Q1(H$,W$,U$,q$,V$,G$,Y$,K$,X$,Z$,J1,Q$,J$);const eb=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Hg(e.theme,"spacing",8),n=s=>({gap:zu(t,s)});return da(e,e.gap,n)}return null};eb.propTypes={};eb.filterProps=["gap"];const tb=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Hg(e.theme,"spacing",8),n=s=>({columnGap:zu(t,s)});return da(e,e.columnGap,n)}return null};tb.propTypes={};tb.filterProps=["columnGap"];const nb=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Hg(e.theme,"spacing",8),n=s=>({rowGap:zu(t,s)});return da(e,e.rowGap,n)}return null};nb.propTypes={};nb.filterProps=["rowGap"];const eH=as({prop:"gridColumn"}),tH=as({prop:"gridRow"}),nH=as({prop:"gridAutoFlow"}),rH=as({prop:"gridAutoColumns"}),sH=as({prop:"gridAutoRows"}),oH=as({prop:"gridTemplateColumns"}),iH=as({prop:"gridTemplateRows"}),aH=as({prop:"gridTemplateAreas"}),lH=as({prop:"gridArea"});Q1(eb,tb,nb,eH,tH,nH,rH,sH,oH,iH,aH,lH);function Af(e,t){return t==="grey"?t:e}const cH=as({prop:"color",themeKey:"palette",transform:Af}),uH=as({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Af}),dH=as({prop:"backgroundColor",themeKey:"palette",transform:Af});Q1(cH,uH,dH);function Yo(e){return e<=1&&e!==0?`${e*100}%`:e}const fH=as({prop:"width",transform:Yo}),Kj=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const s=e.theme?.breakpoints?.values?.[n]||X1[n];return s?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${s}${e.theme.breakpoints.unit}`}:{maxWidth:s}:{maxWidth:Yo(n)}};return da(e,e.maxWidth,t)}return null};Kj.filterProps=["maxWidth"];const hH=as({prop:"minWidth",transform:Yo}),pH=as({prop:"height",transform:Yo}),gH=as({prop:"maxHeight",transform:Yo}),mH=as({prop:"minHeight",transform:Yo});as({prop:"size",cssProperty:"width",transform:Yo});as({prop:"size",cssProperty:"height",transform:Yo});const xH=as({prop:"boxSizing"});Q1(fH,Kj,hH,pH,gH,mH,xH);const Wg={border:{themeKey:"borders",transform:yi},borderTop:{themeKey:"borders",transform:yi},borderRight:{themeKey:"borders",transform:yi},borderBottom:{themeKey:"borders",transform:yi},borderLeft:{themeKey:"borders",transform:yi},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:yi},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:J1},color:{themeKey:"palette",transform:Af},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Af},backgroundColor:{themeKey:"palette",transform:Af},p:{style:Xr},pt:{style:Xr},pr:{style:Xr},pb:{style:Xr},pl:{style:Xr},px:{style:Xr},py:{style:Xr},padding:{style:Xr},paddingTop:{style:Xr},paddingRight:{style:Xr},paddingBottom:{style:Xr},paddingLeft:{style:Xr},paddingX:{style:Xr},paddingY:{style:Xr},paddingInline:{style:Xr},paddingInlineStart:{style:Xr},paddingInlineEnd:{style:Xr},paddingBlock:{style:Xr},paddingBlockStart:{style:Xr},paddingBlockEnd:{style:Xr},m:{style:Kr},mt:{style:Kr},mr:{style:Kr},mb:{style:Kr},ml:{style:Kr},mx:{style:Kr},my:{style:Kr},margin:{style:Kr},marginTop:{style:Kr},marginRight:{style:Kr},marginBottom:{style:Kr},marginLeft:{style:Kr},marginX:{style:Kr},marginY:{style:Kr},marginInline:{style:Kr},marginInlineStart:{style:Kr},marginInlineEnd:{style:Kr},marginBlock:{style:Kr},marginBlockStart:{style:Kr},marginBlockEnd:{style:Kr},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:eb},rowGap:{style:nb},columnGap:{style:tb},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Yo},maxWidth:{style:Kj},minWidth:{transform:Yo},height:{transform:Yo},maxHeight:{transform:Yo},minHeight:{transform:Yo},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function bH(...e){const t=e.reduce((s,o)=>s.concat(Object.keys(o)),[]),n=new Set(t);return e.every(s=>n.size===Object.keys(s).length)}function yH(e,t){return typeof e=="function"?e(t):e}function vH(){function e(n,s,o,a){const l={[n]:s,theme:o},u=a[n];if(!u)return{[n]:s};const{cssProperty:d=n,themeKey:f,transform:p,style:g}=u;if(s==null)return null;if(f==="typography"&&s==="inherit")return{[n]:s};const x=za(o,f)||{};return g?g(l):da(l,s,y=>{let S=Q0(x,p,y);return y===S&&typeof y=="string"&&(S=Q0(x,p,`${n}${y==="default"?"":Le(y)}`,y)),d===!1?S:{[d]:S}})}function t(n){const{sx:s,theme:o={},nested:a}=n||{};if(!s)return null;const l=o.unstable_sxConfig??Wg;function u(d){let f=d;if(typeof d=="function")f=d(o);else if(typeof d!="object")return d;if(!f)return null;const p=W7(o.breakpoints),g=Object.keys(p);let x=p;return Object.keys(f).forEach(b=>{const y=yH(f[b],o);if(y!=null)if(typeof y=="object")if(l[b])x=Op(x,e(b,y,o,l));else{const S=da({theme:o},y,j=>({[b]:j}));bH(S,y)?x[b]=t({sx:y,theme:o,nested:!0}):x=Op(x,S)}else x=Op(x,e(b,y,o,l))}),!a&&o.modularCssLayers?{"@layer sx":MT(o,uS(g,x))}:MT(o,uS(g,x))}return Array.isArray(s)?s.map(u):u(s)}return t}const Rc=vH();Rc.filterProps=["sx"];function SH(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!="function")return{};let s=n.getColorSchemeSelector(e);return s==="&"?t:((s.includes("data-")||s.includes("."))&&(s=`*:where(${s.replace(/\s*&$/,"")}) &`),{[s]:t})}return n.palette.mode===e?t:{}}function rh(e={},...t){const{breakpoints:n={},palette:s={},spacing:o,shape:a={},...l}=e,u=k$(n),d=q7(o);let f=As({breakpoints:u,direction:"ltr",components:{},palette:{mode:"light",...s},spacing:d,shape:{...I$,...a}},l);return f=z$(f),f.applyStyles=SH,f=t.reduce((p,g)=>As(p,g),f),f.unstable_sxConfig={...Wg,...l?.unstable_sxConfig},f.unstable_sx=function(g){return Rc({sx:g,theme:this})},f}function jH(e){return Object.keys(e).length===0}function rb(e=null){const t=v.useContext($g);return!t||jH(t)?e:t}const CH=rh();function Ug(e=CH){return rb(e)}function N2(e){const t=Tc(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function V7({styles:e,themeId:t,defaultTheme:n={}}){const s=Ug(n),o=t&&s[t]||s;let a=typeof e=="function"?e(o):e;return o.modularCssLayers&&(Array.isArray(a)?a=a.map(l=>N2(typeof l=="function"?l(o):l)):a=N2(a)),r.jsx(B7,{styles:a})}const wH=e=>{const t={systemProps:{},otherProps:{}},n=e?.theme?.unstable_sxConfig??Wg;return Object.keys(e).forEach(s=>{n[s]?t.systemProps[s]=e[s]:t.otherProps[s]=e[s]}),t};function sb(e){const{sx:t,...n}=e,{systemProps:s,otherProps:o}=wH(n);let a;return Array.isArray(t)?a=[s,...t]:typeof t=="function"?a=(...l)=>{const u=t(...l);return Fa(u)?{...s,...u}:s}:a={...s,...t},{...o,sx:a}}const IT=e=>e,AH=()=>{let e=IT;return{configure(t){e=t},generate(t){return e(t)},reset(){e=IT}}},G7=AH();function Y7(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Y7(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Ye(){for(var e,t,n=0,s="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Y7(e))&&(s&&(s+=" "),s+=t);return s}function EH(e={}){const{themeId:t,defaultTheme:n,defaultClassName:s="MuiBox-root",generateClassName:o}=e,a=N7("div",{shouldForwardProp:u=>u!=="theme"&&u!=="sx"&&u!=="as"})(Rc);return v.forwardRef(function(d,f){const p=Ug(n),{className:g,component:x="div",...b}=sb(d);return r.jsx(a,{as:x,ref:f,className:Ye(g,o?o(s):s),theme:t&&p[t]||p,...b})})}const TH={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function gt(e,t,n="Mui"){const s=TH[t];return s?`${n}-${s}`:`${G7.generate(e)}-${t}`}function mt(e,t,n="Mui"){const s={};return t.forEach(o=>{s[o]=gt(e,o,n)}),s}function K7(e){const{variants:t,...n}=e,s={variants:t,style:Tc(n),isProcessed:!0};return s.style===n||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=Tc(o.style))}),s}const kH=rh();function O0(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function Su(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function MH(e){return e?(t,n)=>n[e]:null}function RH(e,t,n){e.theme=IH(e.theme)?n:e.theme[t]||e.theme}function B0(e,t,n){const s=typeof t=="function"?t(e):t;if(Array.isArray(s))return s.flatMap(o=>B0(e,o,n));if(Array.isArray(s?.variants)){let o;if(s.isProcessed)o=n?Su(s.style,n):s.style;else{const{variants:a,...l}=s;o=n?Su(Tc(l),n):l}return X7(e,s.variants,[o],n)}return s?.isProcessed?n?Su(Tc(s.style),n):s.style:n?Su(Tc(s),n):s}function X7(e,t,n=[],s=void 0){let o;e:for(let a=0;a<t.length;a+=1){const l=t[a];if(typeof l.props=="function"){if(o??={...e,...e.ownerState,ownerState:e.ownerState},!l.props(o))continue}else for(const u in l.props)if(e[u]!==l.props[u]&&e.ownerState?.[u]!==l.props[u])continue e;typeof l.style=="function"?(o??={...e,...e.ownerState,ownerState:e.ownerState},n.push(s?Su(Tc(l.style(o)),s):l.style(o))):n.push(s?Su(Tc(l.style),s):l.style)}return n}function Z7(e={}){const{themeId:t,defaultTheme:n=kH,rootShouldForwardProp:s=O0,slotShouldForwardProp:o=O0}=e;function a(u){RH(u,t,n)}return(u,d={})=>{w$(u,F=>F.filter(N=>N!==Rc));const{name:f,slot:p,skipVariantsResolver:g,skipSx:x,overridesResolver:b=MH(_H(p)),...y}=d,S=f&&f.startsWith("Mui")||p?"components":"custom",j=g!==void 0?g:p&&p!=="Root"&&p!=="root"||!1,A=x||!1;let M=O0;p==="Root"||p==="root"?M=s:p?M=o:FH(u)&&(M=void 0);const R=N7(u,{shouldForwardProp:M,label:zH(),...y}),_=F=>{if(F.__emotion_real===F)return F;if(typeof F=="function")return function(I){return B0(I,F,I.theme.modularCssLayers?S:void 0)};if(Fa(F)){const N=K7(F);return function(B){return N.variants?B0(B,N,B.theme.modularCssLayers?S:void 0):B.theme.modularCssLayers?Su(N.style,S):N.style}}return F},z=(...F)=>{const N=[],I=F.map(_),B=[];if(N.push(a),f&&b&&B.push(function(L){const W=L.theme.components?.[f]?.styleOverrides;if(!W)return null;const D={};for(const q in W)D[q]=B0(L,W[q],L.theme.modularCssLayers?"theme":void 0);return b(L,D)}),f&&!j&&B.push(function(L){const W=L.theme?.components?.[f]?.variants;return W?X7(L,W,[],L.theme.modularCssLayers?"theme":void 0):null}),A||B.push(Rc),Array.isArray(I[0])){const k=I.shift(),L=new Array(N.length).fill(""),O=new Array(B.length).fill("");let W;W=[...L,...k,...O],W.raw=[...L,...k.raw,...O],N.unshift(W)}const H=[...N,...I,...B],P=R(...H);return u.muiName&&(P.muiName=u.muiName),P};return R.withConfig&&(z.withConfig=R.withConfig),z}}function zH(e,t){return void 0}function IH(e){for(const t in e)return!1;return!0}function FH(e){return typeof e=="string"&&e.charCodeAt(0)>96}function _H(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}const Xj=Z7();function Iu(e,t,n=!1){const s={...t};for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)){const a=o;if(a==="components"||a==="slots")s[a]={...e[a],...s[a]};else if(a==="componentsProps"||a==="slotProps"){const l=e[a],u=t[a];if(!u)s[a]=l||{};else if(!l)s[a]=u;else{s[a]={...u};for(const d in l)if(Object.prototype.hasOwnProperty.call(l,d)){const f=d;s[a][f]=Iu(l[f],u[f],n)}}}else a==="className"&&n&&t.className?s.className=Ye(e?.className,t?.className):a==="style"&&n&&t.style?s.style={...e?.style,...t?.style}:s[a]===void 0&&(s[a]=e[a])}return s}function Q7(e){const{theme:t,name:n,props:s}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?s:Iu(t.components[n].defaultProps,s)}function ob({props:e,name:t,defaultTheme:n,themeId:s}){let o=Ug(n);return s&&(o=o[s]||o),Q7({theme:o,name:t,props:e})}const or=typeof window<"u"?v.useLayoutEffect:v.useEffect;function LH(e,t,n,s,o){const[a,l]=v.useState(()=>o&&n?n(e).matches:s?s(e).matches:t);return or(()=>{if(!n)return;const u=n(e),d=()=>{l(u.matches)};return d(),u.addEventListener("change",d),()=>{u.removeEventListener("change",d)}},[e,n]),a}const PH={...Qp},J7=PH.useSyncExternalStore;function DH(e,t,n,s,o){const a=v.useCallback(()=>t,[t]),l=v.useMemo(()=>{if(o&&n)return()=>n(e).matches;if(s!==null){const{matches:p}=s(e);return()=>p}return a},[a,e,s,o,n]),[u,d]=v.useMemo(()=>{if(n===null)return[a,()=>()=>{}];const p=n(e);return[()=>p.matches,g=>(p.addEventListener("change",g),()=>{p.removeEventListener("change",g)})]},[a,n,e]);return J7(d,u,l)}function eR(e={}){const{themeId:t}=e;return function(s,o={}){let a=rb();a&&t&&(a=a[t]||a);const l=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:u=!1,matchMedia:d=l?window.matchMedia:null,ssrMatchMedia:f=null,noSsr:p=!1}=Q7({name:"MuiUseMediaQuery",props:o,theme:a});let g=typeof s=="function"?s(a):s;return g=g.replace(/^@media( ?)/m,""),g.includes("print")&&console.warn(["MUI: You have provided a `print` query to the `useMediaQuery` hook.","Using the print media query to modify print styles can lead to unexpected results.","Consider using the `displayPrint` field in the `sx` prop instead.","More information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."].join(` `)),(J7!==void 0?DH:LH)(g,u,d,f,p)}}eR();function yu(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function Zj(e,t=0,n=1){return yu(e,t,n)}function OH(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(s=>s+s)),n?`rgb${n.length===4?"a":""}(${n.map((s,o)=>o<3?parseInt(s,16):Math.round(parseInt(s,16)/255*1e3)/1e3).join(", ")})`:""}function zc(e){if(e.type)return e;if(e.charAt(0)==="#")return zc(OH(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(wl(9,e));let s=e.substring(t+1,e.length-1),o;if(n==="color"){if(s=s.split(" "),o=s.shift(),s.length===4&&s[3].charAt(0)==="/"&&(s[3]=s[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(o))throw new Error(wl(10,o))}else s=s.split(",");return s=s.map(a=>parseFloat(a)),{type:n,values:s,colorSpace:o}}const BH=e=>{const t=zc(e);return t.values.slice(0,3).map((n,s)=>t.type.includes("hsl")&&s!==0?`${n}%`:n).join(" ")},Tp=(e,t)=>{try{return BH(e)}catch{return e}};function ib(e){const{type:t,colorSpace:n}=e;let{values:s}=e;return t.includes("rgb")?s=s.map((o,a)=>a<3?parseInt(o,10):o):t.includes("hsl")&&(s[1]=`${s[1]}%`,s[2]=`${s[2]}%`),t.includes("color")?s=`${n} ${s.join(" ")}`:s=`${s.join(", ")}`,`${t}(${s})`}function tR(e){e=zc(e);const{values:t}=e,n=t[0],s=t[1]/100,o=t[2]/100,a=s*Math.min(o,1-o),l=(f,p=(f+n/30)%12)=>o-a*Math.max(Math.min(p-3,9-p,1),-1);let u="rgb";const d=[Math.round(l(0)*255),Math.round(l(8)*255),Math.round(l(4)*255)];return e.type==="hsla"&&(u+="a",d.push(t[3])),ib({type:u,values:d})}function dS(e){e=zc(e);let t=e.type==="hsl"||e.type==="hsla"?zc(tR(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function NH(e,t){const n=dS(e),s=dS(t);return(Math.max(n,s)+.05)/(Math.min(n,s)+.05)}function In(e,t){return e=zc(e),t=Zj(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,ib(e)}function hu(e,t,n){try{return In(e,t)}catch{return e}}function ab(e,t){if(e=zc(e),t=Zj(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return ib(e)}function ur(e,t,n){try{return ab(e,t)}catch{return e}}function lb(e,t){if(e=zc(e),t=Zj(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return ib(e)}function dr(e,t,n){try{return lb(e,t)}catch{return e}}function ag(e,t=.15){return dS(e)>.5?ab(e,t):lb(e,t)}function Nx(e,t,n){try{return ag(e,t)}catch{return e}}const nR=v.createContext(null);function Qj(){return v.useContext(nR)}const $H=typeof Symbol=="function"&&Symbol.for,HH=$H?Symbol.for("mui.nested"):"__THEME_NESTED__";function WH(e,t){return typeof t=="function"?t(e):{...e,...t}}function UH(e){const{children:t,theme:n}=e,s=Qj(),o=v.useMemo(()=>{const a=s===null?{...n}:WH(s,n);return a!=null&&(a[HH]=s!==null),a},[n,s]);return r.jsx(nR.Provider,{value:o,children:t})}const rR=v.createContext();function qH({value:e,...t}){return r.jsx(rR.Provider,{value:e??!0,...t})}const Ao=()=>v.useContext(rR)??!1,sR=v.createContext(void 0);function VH({value:e,children:t}){return r.jsx(sR.Provider,{value:e,children:t})}function GH(e){const{theme:t,name:n,props:s}=e;if(!t||!t.components||!t.components[n])return s;const o=t.components[n];return o.defaultProps?Iu(o.defaultProps,s,t.components.mergeClassNameAndStyle):!o.styleOverrides&&!o.variants?Iu(o,s,t.components.mergeClassNameAndStyle):s}function YH({props:e,name:t}){const n=v.useContext(sR);return GH({props:e,name:t,theme:{components:n}})}let FT=0;function KH(e){const[t,n]=v.useState(e),s=e||t;return v.useEffect(()=>{t==null&&(FT+=1,n(`mui-${FT}`))},[t]),s}const XH={...Qp},_T=XH.useId;function Hi(e){if(_T!==void 0){const t=_T();return e??t}return KH(e)}function ZH(e){const t=rb(),n=Hi()||"",{modularCssLayers:s}=e;let o="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!s||t!==null?o="":typeof s=="string"?o=s.replace(/mui(?!\.)/g,o):o=`@layer ${o};`,or(()=>{const a=document.querySelector("head");if(!a)return;const l=a.firstChild;if(o){if(l&&l.hasAttribute?.("data-mui-layer-order")&&l.getAttribute("data-mui-layer-order")===n)return;const u=document.createElement("style");u.setAttribute("data-mui-layer-order",n),u.textContent=o,a.prepend(u)}else a.querySelector(`style[data-mui-layer-order="${n}"]`)?.remove()},[o,n]),o?r.jsx(V7,{styles:o}):null}const LT={};function PT(e,t,n,s=!1){return v.useMemo(()=>{const o=e&&t[e]||t;if(typeof n=="function"){const a=n(o),l=e?{...t,[e]:a}:a;return s?()=>l:l}return e?{...t,[e]:n}:{...t,...n}},[e,t,n,s])}function oR(e){const{children:t,theme:n,themeId:s}=e,o=rb(LT),a=Qj()||LT,l=PT(s,o,n),u=PT(s,a,n,!0),d=(s?l[s]:l).direction==="rtl",f=ZH(l);return r.jsx(UH,{theme:u,children:r.jsx($g.Provider,{value:l,children:r.jsx(qH,{value:d,children:r.jsxs(VH,{value:s?l[s].components:l.components,children:[f,t]})})})})}const DT={theme:void 0};function QH(e){let t,n;return function(o){let a=t;return(a===void 0||o.theme!==n)&&(DT.theme=o.theme,a=K7(e(DT)),t=a,n=o.theme),a}}const Jj="mode",eC="color-scheme",JH="data-color-scheme";function eW(e){const{defaultMode:t="system",defaultLightColorScheme:n="light",defaultDarkColorScheme:s="dark",modeStorageKey:o=Jj,colorSchemeStorageKey:a=eC,attribute:l=JH,colorSchemeNode:u="document.documentElement",nonce:d}=e||{};let f="",p=l;if(l==="class"&&(p=".%s"),l==="data"&&(p="[data-%s]"),p.startsWith(".")){const x=p.substring(1);f+=`${u}.classList.remove('${x}'.replace('%s', light), '${x}'.replace('%s', dark)); ${u}.classList.add('${x}'.replace('%s', colorScheme));`}const g=p.match(/\[([^[\]]+)\]/);if(g){const[x,b]=g[1].split("=");b||(f+=`${u}.removeAttribute('${x}'.replace('%s', light)); ${u}.removeAttribute('${x}'.replace('%s', dark));`),f+=` ${u}.setAttribute('${x}'.replace('%s', colorScheme), ${b?`${b}.replace('%s', colorScheme)`:'""'});`}else p!==".%s"&&(f+=`${u}.setAttribute('${p}', colorScheme);`);return r.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?d:"",dangerouslySetInnerHTML:{__html:`(function() { try { let colorScheme = ''; const mode = localStorage.getItem('${o}') || '${t}'; const dark = localStorage.getItem('${a}-dark') || '${s}'; const light = localStorage.getItem('${a}-light') || '${n}'; if (mode === 'system') { // handle system mode const mql = window.matchMedia('(prefers-color-scheme: dark)'); if (mql.matches) { colorScheme = dark } else { colorScheme = light } } if (mode === 'light') { colorScheme = light; } if (mode === 'dark') { colorScheme = dark; } if (colorScheme) { ${f} } } catch(e){}})();`}},"mui-color-scheme-init")}function tW(){}const nW=({key:e,storageWindow:t})=>(!t&&typeof window<"u"&&(t=window),{get(n){if(typeof window>"u")return;if(!t)return n;let s;try{s=t.localStorage.getItem(e)}catch{}return s||n},set:n=>{if(t)try{t.localStorage.setItem(e,n)}catch{}},subscribe:n=>{if(!t)return tW;const s=o=>{const a=o.newValue;o.key===e&&n(a)};return t.addEventListener("storage",s),()=>{t.removeEventListener("storage",s)}}});function $2(){}function OT(e){if(typeof window<"u"&&typeof window.matchMedia=="function"&&e==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function iR(e,t){if(e.mode==="light"||e.mode==="system"&&e.systemMode==="light")return t("light");if(e.mode==="dark"||e.mode==="system"&&e.systemMode==="dark")return t("dark")}function rW(e){return iR(e,t=>{if(t==="light")return e.lightColorScheme;if(t==="dark")return e.darkColorScheme})}function sW(e){const{defaultMode:t="light",defaultLightColorScheme:n,defaultDarkColorScheme:s,supportedColorSchemes:o=[],modeStorageKey:a=Jj,colorSchemeStorageKey:l=eC,storageWindow:u=typeof window>"u"?void 0:window,storageManager:d=nW,noSsr:f=!1}=e,p=o.join(","),g=o.length>1,x=v.useMemo(()=>d?.({key:a,storageWindow:u}),[d,a,u]),b=v.useMemo(()=>d?.({key:`${l}-light`,storageWindow:u}),[d,l,u]),y=v.useMemo(()=>d?.({key:`${l}-dark`,storageWindow:u}),[d,l,u]),[S,j]=v.useState(()=>{const I=x?.get(t)||t,B=b?.get(n)||n,H=y?.get(s)||s;return{mode:I,systemMode:OT(I),lightColorScheme:B,darkColorScheme:H}}),[A,M]=v.useState(f||!g);v.useEffect(()=>{M(!0)},[]);const R=rW(S),_=v.useCallback(I=>{j(B=>{if(I===B.mode)return B;const H=I??t;return x?.set(H),{...B,mode:H,systemMode:OT(H)}})},[x,t]),z=v.useCallback(I=>{I?typeof I=="string"?I&&!p.includes(I)?console.error(`\`${I}\` does not exist in \`theme.colorSchemes\`.`):j(B=>{const H={...B};return iR(B,P=>{P==="light"&&(b?.set(I),H.lightColorScheme=I),P==="dark"&&(y?.set(I),H.darkColorScheme=I)}),H}):j(B=>{const H={...B},P=I.light===null?n:I.light,k=I.dark===null?s:I.dark;return P&&(p.includes(P)?(H.lightColorScheme=P,b?.set(P)):console.error(`\`${P}\` does not exist in \`theme.colorSchemes\`.`)),k&&(p.includes(k)?(H.darkColorScheme=k,y?.set(k)):console.error(`\`${k}\` does not exist in \`theme.colorSchemes\`.`)),H}):j(B=>(b?.set(n),y?.set(s),{...B,lightColorScheme:n,darkColorScheme:s}))},[p,b,y,n,s]),F=v.useCallback(I=>{S.mode==="system"&&j(B=>{const H=I?.matches?"dark":"light";return B.systemMode===H?B:{...B,systemMode:H}})},[S.mode]),N=v.useRef(F);return N.current=F,v.useEffect(()=>{if(typeof window.matchMedia!="function"||!g)return;const I=(...H)=>N.current(...H),B=window.matchMedia("(prefers-color-scheme: dark)");return B.addListener(I),I(B),()=>{B.removeListener(I)}},[g]),v.useEffect(()=>{if(g){const I=x?.subscribe(P=>{(!P||["light","dark","system"].includes(P))&&_(P||t)})||$2,B=b?.subscribe(P=>{(!P||p.match(P))&&z({light:P})})||$2,H=y?.subscribe(P=>{(!P||p.match(P))&&z({dark:P})})||$2;return()=>{I(),B(),H()}}},[z,_,p,t,u,g,x,b,y]),{...S,mode:A?S.mode:void 0,systemMode:A?S.systemMode:void 0,colorScheme:A?R:void 0,setMode:_,setColorScheme:z}}const oW="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function iW(e){const{themeId:t,theme:n={},modeStorageKey:s=Jj,colorSchemeStorageKey:o=eC,disableTransitionOnChange:a=!1,defaultColorScheme:l,resolveTheme:u}=e,d={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},f=v.createContext(void 0),p=()=>v.useContext(f)||d,g={},x={};function b(A){const{children:M,theme:R,modeStorageKey:_=s,colorSchemeStorageKey:z=o,disableTransitionOnChange:F=a,storageManager:N,storageWindow:I=typeof window>"u"?void 0:window,documentNode:B=typeof document>"u"?void 0:document,colorSchemeNode:H=typeof document>"u"?void 0:document.documentElement,disableNestedContext:P=!1,disableStyleSheetGeneration:k=!1,defaultMode:L="system",forceThemeRerender:O=!1,noSsr:W}=A,D=v.useRef(!1),q=Qj(),K=v.useContext(f),Y=!!K&&!P,ie=v.useMemo(()=>R||(typeof n=="function"?n():n),[R]),V=ie[t],re=V||ie,{colorSchemes:fe=g,components:ae=x,cssVarPrefix:ue}=re,se=Object.keys(fe).filter($e=>!!fe[$e]).join(","),J=v.useMemo(()=>se.split(","),[se]),ce=typeof l=="string"?l:l.light,oe=typeof l=="string"?l:l.dark,ge=fe[ce]&&fe[oe]?L:fe[re.defaultColorScheme]?.palette?.mode||re.palette?.mode,{mode:de,setMode:le,systemMode:ee,lightColorScheme:X,darkColorScheme:ve,colorScheme:st,setColorScheme:Ge}=sW({supportedColorSchemes:J,defaultLightColorScheme:ce,defaultDarkColorScheme:oe,modeStorageKey:_,colorSchemeStorageKey:z,defaultMode:ge,storageManager:N,storageWindow:I,noSsr:W});let qe=de,Be=st;Y&&(qe=K.mode,Be=K.colorScheme);let Te=Be||re.defaultColorScheme;re.vars&&!O&&(Te=re.defaultColorScheme);const Re=v.useMemo(()=>{const $e=re.generateThemeVars?.()||re.vars,Z={...re,components:ae,colorSchemes:fe,cssVarPrefix:ue,vars:$e};if(typeof Z.generateSpacing=="function"&&(Z.spacing=Z.generateSpacing()),Te){const pe=fe[Te];pe&&typeof pe=="object"&&Object.keys(pe).forEach(Q=>{pe[Q]&&typeof pe[Q]=="object"?Z[Q]={...Z[Q],...pe[Q]}:Z[Q]=pe[Q]})}return u?u(Z):Z},[re,Te,ae,fe,ue]),Se=re.colorSchemeSelector;or(()=>{if(Be&&H&&Se&&Se!=="media"){const $e=Se;let Z=Se;if($e==="class"&&(Z=".%s"),$e==="data"&&(Z="[data-%s]"),$e?.startsWith("data-")&&!$e.includes("%s")&&(Z=`[${$e}="%s"]`),Z.startsWith("."))H.classList.remove(...J.map(pe=>Z.substring(1).replace("%s",pe))),H.classList.add(Z.substring(1).replace("%s",Be));else{const pe=Z.replace("%s",Be).match(/\[([^\]]+)\]/);if(pe){const[Q,me]=pe[1].split("=");me||J.forEach(we=>{H.removeAttribute(Q.replace(Be,we))}),H.setAttribute(Q,me?me.replace(/"|'/g,""):"")}else H.setAttribute(Z,Be)}}},[Be,Se,H,J]),v.useEffect(()=>{let $e;if(F&&D.current&&B){const Z=B.createElement("style");Z.appendChild(B.createTextNode(oW)),B.head.appendChild(Z),window.getComputedStyle(B.body),$e=setTimeout(()=>{B.head.removeChild(Z)},1)}return()=>{clearTimeout($e)}},[Be,F,B]),v.useEffect(()=>(D.current=!0,()=>{D.current=!1}),[]);const Ke=v.useMemo(()=>({allColorSchemes:J,colorScheme:Be,darkColorScheme:ve,lightColorScheme:X,mode:qe,setColorScheme:Ge,setMode:le,systemMode:ee}),[J,Be,ve,X,qe,Ge,le,ee,Re.colorSchemeSelector]);let ot=!0;(k||re.cssVariables===!1||Y&&q?.cssVarPrefix===ue)&&(ot=!1);const He=r.jsxs(v.Fragment,{children:[r.jsx(oR,{themeId:V?t:void 0,theme:Re,children:M}),ot&&r.jsx(B7,{styles:Re.generateStyleSheets?.()||[]})]});return Y?He:r.jsx(f.Provider,{value:Ke,children:He})}const y=typeof l=="string"?l:l.light,S=typeof l=="string"?l:l.dark;return{CssVarsProvider:b,useColorScheme:p,getInitColorSchemeScript:A=>eW({colorSchemeStorageKey:o,defaultLightColorScheme:y,defaultDarkColorScheme:S,modeStorageKey:s,...A})}}function aW(e=""){function t(...s){if(!s.length)return"";const o=s[0];return typeof o=="string"&&!o.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${o}${t(...s.slice(1))})`:`, ${o}`}return(s,...o)=>`var(--${e?`${e}-`:""}${s}${t(...o)})`}const BT=(e,t,n,s=[])=>{let o=e;t.forEach((a,l)=>{l===t.length-1?Array.isArray(o)?o[Number(a)]=n:o&&typeof o=="object"&&(o[a]=n):o&&typeof o=="object"&&(o[a]||(o[a]=s.includes(a)?[]:{}),o=o[a])})},lW=(e,t,n)=>{function s(o,a=[],l=[]){Object.entries(o).forEach(([u,d])=>{(!n||n&&!n([...a,u]))&&d!=null&&(typeof d=="object"&&Object.keys(d).length>0?s(d,[...a,u],Array.isArray(d)?[...l,u]:l):t([...a,u],d,l))})}s(e)},cW=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(s=>e.includes(s))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function H2(e,t){const{prefix:n,shouldSkipGeneratingVar:s}=t||{},o={},a={},l={};return lW(e,(u,d,f)=>{if((typeof d=="string"||typeof d=="number")&&(!s||!s(u,d))){const p=`--${n?`${n}-`:""}${u.join("-")}`,g=cW(u,d);Object.assign(o,{[p]:g}),BT(a,u,`var(${p})`,f),BT(l,u,`var(${p}, ${g})`,f)}},u=>u[0]==="vars"),{css:o,vars:a,varsWithDefaults:l}}function uW(e,t={}){const{getSelector:n=A,disableCssColorScheme:s,colorSchemeSelector:o,enableContrastVars:a}=t,{colorSchemes:l={},components:u,defaultColorScheme:d="light",...f}=e,{vars:p,css:g,varsWithDefaults:x}=H2(f,t);let b=x;const y={},{[d]:S,...j}=l;if(Object.entries(j||{}).forEach(([_,z])=>{const{vars:F,css:N,varsWithDefaults:I}=H2(z,t);b=As(b,I),y[_]={css:N,vars:F}}),S){const{css:_,vars:z,varsWithDefaults:F}=H2(S,t);b=As(b,F),y[d]={css:_,vars:z}}function A(_,z){let F=o;if(o==="class"&&(F=".%s"),o==="data"&&(F="[data-%s]"),o?.startsWith("data-")&&!o.includes("%s")&&(F=`[${o}="%s"]`),_){if(F==="media")return e.defaultColorScheme===_?":root":{[`@media (prefers-color-scheme: ${l[_]?.palette?.mode||_})`]:{":root":z}};if(F)return e.defaultColorScheme===_?`:root, ${F.replace("%s",String(_))}`:F.replace("%s",String(_))}return":root"}return{vars:b,generateThemeVars:()=>{let _={...p};return Object.entries(y).forEach(([,{vars:z}])=>{_=As(_,z)}),_},generateStyleSheets:()=>{const _=[],z=e.defaultColorScheme||"light";function F(B,H){Object.keys(H).length&&_.push(typeof B=="string"?{[B]:{...H}}:B)}F(n(void 0,{...g}),g);const{[z]:N,...I}=y;if(N){const{css:B}=N,H=l[z]?.palette?.mode,P=!s&&H?{colorScheme:H,...B}:{...B};F(n(z,{...P}),P)}return Object.entries(I).forEach(([B,{css:H}])=>{const P=l[B]?.palette?.mode,k=!s&&P?{colorScheme:P,...H}:{...H};F(n(B,{...k}),k)}),a&&_.push({":root":{"--__l-threshold":"0.7","--__l":"clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)","--__a":"clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"}}),_}}}function dW(e){return function(n){return e==="media"?`@media (prefers-color-scheme: ${n})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}function pt(e,t,n=void 0){const s={};for(const o in e){const a=e[o];let l="",u=!0;for(let d=0;d<a.length;d+=1){const f=a[d];f&&(l+=(u===!0?"":" ")+t(f),u=!1,n&&n[f]&&(l+=" "+n[f]))}s[o]=l}return s}const fW=rh(),hW=Xj("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`maxWidth${Le(String(n.maxWidth))}`],n.fixed&&t.fixed,n.disableGutters&&t.disableGutters]}}),pW=e=>ob({props:e,name:"MuiContainer",defaultTheme:fW}),gW=(e,t)=>{const n=d=>gt(t,d),{classes:s,fixed:o,disableGutters:a,maxWidth:l}=e,u={root:["root",l&&`maxWidth${Le(String(l))}`,o&&"fixed",a&&"disableGutters"]};return pt(u,n,s)};function mW(e={}){const{createStyledComponent:t=hW,useThemeProps:n=pW,componentName:s="MuiContainer"}=e,o=t(({theme:l,ownerState:u})=>({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",...!u.disableGutters&&{paddingLeft:l.spacing(2),paddingRight:l.spacing(2),[l.breakpoints.up("sm")]:{paddingLeft:l.spacing(3),paddingRight:l.spacing(3)}}}),({theme:l,ownerState:u})=>u.fixed&&Object.keys(l.breakpoints.values).reduce((d,f)=>{const p=f,g=l.breakpoints.values[p];return g!==0&&(d[l.breakpoints.up(p)]={maxWidth:`${g}${l.breakpoints.unit}`}),d},{}),({theme:l,ownerState:u})=>({...u.maxWidth==="xs"&&{[l.breakpoints.up("xs")]:{maxWidth:Math.max(l.breakpoints.values.xs,444)}},...u.maxWidth&&u.maxWidth!=="xs"&&{[l.breakpoints.up(u.maxWidth)]:{maxWidth:`${l.breakpoints.values[u.maxWidth]}${l.breakpoints.unit}`}}}));return v.forwardRef(function(u,d){const f=n(u),{className:p,component:g="div",disableGutters:x=!1,fixed:b=!1,maxWidth:y="lg",classes:S,...j}=f,A={...f,component:g,disableGutters:x,fixed:b,maxWidth:y},M=gW(A,s);return r.jsx(o,{as:g,ownerState:A,className:Ye(M.root,p),ref:d,...j})})}function Bp(e,t){return v.isValidElement(e)&&t.indexOf(e.type.muiName??e.type?._payload?.value?.muiName)!==-1}const xW=(e,t)=>e.filter(n=>t.includes(n)),sh=(e,t,n)=>{const s=e.keys[0];Array.isArray(t)?t.forEach((o,a)=>{n((l,u)=>{a<=e.keys.length-1&&(a===0?Object.assign(l,u):l[e.up(e.keys[a])]=u)},o)}):t&&typeof t=="object"?(Object.keys(t).length>e.keys.length?e.keys:xW(e.keys,Object.keys(t))).forEach(a=>{if(e.keys.includes(a)){const l=t[a];l!==void 0&&n((u,d)=>{s===a?Object.assign(u,d):u[e.up(a)]=d},l)}}):(typeof t=="number"||typeof t=="string")&&n((o,a)=>{Object.assign(o,a)},t)};function J0(e){return`--Grid-${e}Spacing`}function cb(e){return`--Grid-parent-${e}Spacing`}const NT="--Grid-columns",Ef="--Grid-parent-columns",bW=({theme:e,ownerState:t})=>{const n={};return sh(e.breakpoints,t.size,(s,o)=>{let a={};o==="grow"&&(a={flexBasis:0,flexGrow:1,maxWidth:"100%"}),o==="auto"&&(a={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"}),typeof o=="number"&&(a={flexGrow:0,flexBasis:"auto",width:`calc(100% * ${o} / var(${Ef}) - (var(${Ef}) - ${o}) * (var(${cb("column")}) / var(${Ef})))`}),s(n,a)}),n},yW=({theme:e,ownerState:t})=>{const n={};return sh(e.breakpoints,t.offset,(s,o)=>{let a={};o==="auto"&&(a={marginLeft:"auto"}),typeof o=="number"&&(a={marginLeft:o===0?"0px":`calc(100% * ${o} / var(${Ef}) + var(${cb("column")}) * ${o} / var(${Ef}))`}),s(n,a)}),n},vW=({theme:e,ownerState:t})=>{if(!t.container)return{};const n={[NT]:12};return sh(e.breakpoints,t.columns,(s,o)=>{const a=o??12;s(n,{[NT]:a,"> *":{[Ef]:a}})}),n},SW=({theme:e,ownerState:t})=>{if(!t.container)return{};const n={};return sh(e.breakpoints,t.rowSpacing,(s,o)=>{const a=typeof o=="string"?o:e.spacing?.(o);s(n,{[J0("row")]:a,"> *":{[cb("row")]:a}})}),n},jW=({theme:e,ownerState:t})=>{if(!t.container)return{};const n={};return sh(e.breakpoints,t.columnSpacing,(s,o)=>{const a=typeof o=="string"?o:e.spacing?.(o);s(n,{[J0("column")]:a,"> *":{[cb("column")]:a}})}),n},CW=({theme:e,ownerState:t})=>{if(!t.container)return{};const n={};return sh(e.breakpoints,t.direction,(s,o)=>{s(n,{flexDirection:o})}),n},wW=({ownerState:e})=>({minWidth:0,boxSizing:"border-box",...e.container&&{display:"flex",flexWrap:"wrap",...e.wrap&&e.wrap!=="wrap"&&{flexWrap:e.wrap},gap:`var(${J0("row")}) var(${J0("column")})`}}),AW=e=>{const t=[];return Object.entries(e).forEach(([n,s])=>{s!==!1&&s!==void 0&&t.push(`grid-${n}-${String(s)}`)}),t},EW=(e,t="xs")=>{function n(s){return s===void 0?!1:typeof s=="string"&&!Number.isNaN(Number(s))||typeof s=="number"&&s>0}if(n(e))return[`spacing-${t}-${String(e)}`];if(typeof e=="object"&&!Array.isArray(e)){const s=[];return Object.entries(e).forEach(([o,a])=>{n(a)&&s.push(`spacing-${o}-${String(a)}`)}),s}return[]},TW=e=>e===void 0?[]:typeof e=="object"?Object.entries(e).map(([t,n])=>`direction-${t}-${n}`):[`direction-xs-${String(e)}`];function kW(e,t){e.item!==void 0&&delete e.item,e.zeroMinWidth!==void 0&&delete e.zeroMinWidth,t.keys.forEach(n=>{e[n]!==void 0&&delete e[n]})}const MW=rh(),RW=Xj("div",{name:"MuiGrid",slot:"Root"});function zW(e){return ob({props:e,name:"MuiGrid",defaultTheme:MW})}function IW(e={}){const{createStyledComponent:t=RW,useThemeProps:n=zW,useTheme:s=Ug,componentName:o="MuiGrid"}=e,a=(f,p)=>{const{container:g,direction:x,spacing:b,wrap:y,size:S}=f,j={root:["root",g&&"container",y!=="wrap"&&`wrap-xs-${String(y)}`,...TW(x),...AW(S),...g?EW(b,p.breakpoints.keys[0]):[]]};return pt(j,A=>gt(o,A),{})};function l(f,p,g=()=>!0){const x={};return f===null||(Array.isArray(f)?f.forEach((b,y)=>{b!==null&&g(b)&&p.keys[y]&&(x[p.keys[y]]=b)}):typeof f=="object"?Object.keys(f).forEach(b=>{const y=f[b];y!=null&&g(y)&&(x[b]=y)}):x[p.keys[0]]=f),x}const u=t(vW,jW,SW,bW,CW,wW,yW),d=v.forwardRef(function(p,g){const x=s(),b=n(p),y=sb(b);kW(y,x.breakpoints);const{className:S,children:j,columns:A=12,container:M=!1,component:R="div",direction:_="row",wrap:z="wrap",size:F={},offset:N={},spacing:I=0,rowSpacing:B=I,columnSpacing:H=I,unstable_level:P=0,...k}=y,L=l(F,x.breakpoints,V=>V!==!1),O=l(N,x.breakpoints),W=p.columns??(P?void 0:A),D=p.spacing??(P?void 0:I),q=p.rowSpacing??p.spacing??(P?void 0:B),K=p.columnSpacing??p.spacing??(P?void 0:H),Y={...y,level:P,columns:W,container:M,direction:_,wrap:z,spacing:D,rowSpacing:q,columnSpacing:K,size:L,offset:O},ie=a(Y,x);return r.jsx(u,{ref:g,as:R,ownerState:Y,className:Ye(ie.root,S),...k,children:v.Children.map(j,V=>v.isValidElement(V)&&Bp(V,["Grid"])&&M&&V.props.container?v.cloneElement(V,{unstable_level:V.props?.unstable_level??P+1}):V)})});return d.muiName="Grid",d}const FW=rh(),_W=Xj("div",{name:"MuiStack",slot:"Root"});function LW(e){return ob({props:e,name:"MuiStack",defaultTheme:FW})}function PW(e,t){const n=v.Children.toArray(e).filter(Boolean);return n.reduce((s,o,a)=>(s.push(o),a<n.length-1&&s.push(v.cloneElement(t,{key:`separator-${a}`})),s),[])}const DW=e=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],OW=({ownerState:e,theme:t})=>{let n={display:"flex",flexDirection:"column",...da({theme:t},B2({values:e.direction,breakpoints:t.breakpoints.values}),s=>({flexDirection:s}))};if(e.spacing){const s=Z1(t),o=Object.keys(t.breakpoints.values).reduce((d,f)=>((typeof e.spacing=="object"&&e.spacing[f]!=null||typeof e.direction=="object"&&e.direction[f]!=null)&&(d[f]=!0),d),{}),a=B2({values:e.direction,base:o}),l=B2({values:e.spacing,base:o});typeof a=="object"&&Object.keys(a).forEach((d,f,p)=>{if(!a[d]){const x=f>0?a[p[f-1]]:"column";a[d]=x}}),n=As(n,da({theme:t},l,(d,f)=>e.useFlexGap?{gap:zu(s,d)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${DW(f?a[f]:e.direction)}`]:zu(s,d)}}))}return n=_$(t.breakpoints,n),n};function BW(e={}){const{createStyledComponent:t=_W,useThemeProps:n=LW,componentName:s="MuiStack"}=e,o=()=>pt({root:["root"]},d=>gt(s,d),{}),a=t(OW);return v.forwardRef(function(d,f){const p=n(d),g=sb(p),{component:x="div",direction:b="column",spacing:y=0,divider:S,children:j,className:A,useFlexGap:M=!1,...R}=g,_={direction:b,spacing:y,useFlexGap:M},z=o();return r.jsx(a,{as:x,ownerState:_,ref:f,className:Ye(z.root,A),...R,children:S?PW(j,S):j})})}const lg={black:"#000",white:"#fff"},NW={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Hd={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},Wd={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},sp={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},Ud={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},qd={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Vd={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function aR(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:lg.white,default:lg.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const lR=aR();function cR(){return{text:{primary:lg.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:lg.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const fS=cR();function $T(e,t,n,s){const o=s.light||s,a=s.dark||s*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=lb(e.main,o):t==="dark"&&(e.dark=ab(e.main,a)))}function HT(e,t,n,s,o){const a=o.light||o,l=o.dark||o*1.5;t[n]||(t.hasOwnProperty(s)?t[n]=t[s]:n==="light"?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(a*100).toFixed(0)}%)`:n==="dark"&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(l*100).toFixed(0)}%)`))}function $W(e="light"){return e==="dark"?{main:Ud[200],light:Ud[50],dark:Ud[400]}:{main:Ud[700],light:Ud[400],dark:Ud[800]}}function HW(e="light"){return e==="dark"?{main:Hd[200],light:Hd[50],dark:Hd[400]}:{main:Hd[500],light:Hd[300],dark:Hd[700]}}function WW(e="light"){return e==="dark"?{main:Wd[500],light:Wd[300],dark:Wd[700]}:{main:Wd[700],light:Wd[400],dark:Wd[800]}}function UW(e="light"){return e==="dark"?{main:qd[400],light:qd[300],dark:qd[700]}:{main:qd[700],light:qd[500],dark:qd[900]}}function qW(e="light"){return e==="dark"?{main:Vd[400],light:Vd[300],dark:Vd[700]}:{main:Vd[800],light:Vd[500],dark:Vd[900]}}function VW(e="light"){return e==="dark"?{main:sp[400],light:sp[300],dark:sp[700]}:{main:"#ed6c02",light:sp[500],dark:sp[900]}}function GW(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function tC(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:s=.2,colorSpace:o,...a}=e,l=e.primary||$W(t),u=e.secondary||HW(t),d=e.error||WW(t),f=e.info||UW(t),p=e.success||qW(t),g=e.warning||VW(t);function x(j){return o?GW(j):NH(j,fS.text.primary)>=n?fS.text.primary:lR.text.primary}const b=({color:j,name:A,mainShade:M=500,lightShade:R=300,darkShade:_=700})=>{if(j={...j},!j.main&&j[M]&&(j.main=j[M]),!j.hasOwnProperty("main"))throw new Error(wl(11,A?` (${A})`:"",M));if(typeof j.main!="string")throw new Error(wl(12,A?` (${A})`:"",JSON.stringify(j.main)));return o?(HT(o,j,"light",R,s),HT(o,j,"dark",_,s)):($T(j,"light",R,s),$T(j,"dark",_,s)),j.contrastText||(j.contrastText=x(j.main)),j};let y;return t==="light"?y=aR():t==="dark"&&(y=cR()),As({common:{...lg},mode:t,primary:b({color:l,name:"primary"}),secondary:b({color:u,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:b({color:d,name:"error"}),warning:b({color:g,name:"warning"}),info:b({color:f,name:"info"}),success:b({color:p,name:"success"}),grey:NW,contrastThreshold:n,getContrastText:x,augmentColor:b,tonalOffset:s,...y},a)}function YW(e){const t={};return Object.entries(e).forEach(s=>{const[o,a]=s;typeof a=="object"&&(t[o]=`${a.fontStyle?`${a.fontStyle} `:""}${a.fontVariant?`${a.fontVariant} `:""}${a.fontWeight?`${a.fontWeight} `:""}${a.fontStretch?`${a.fontStretch} `:""}${a.fontSize||""}${a.lineHeight?`/${a.lineHeight} `:""}${a.fontFamily||""}`)}),t}function KW(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function XW(e){return Math.round(e*1e5)/1e5}const WT={textTransform:"uppercase"},UT='"Roboto", "Helvetica", "Arial", sans-serif';function uR(e,t){const{fontFamily:n=UT,fontSize:s=14,fontWeightLight:o=300,fontWeightRegular:a=400,fontWeightMedium:l=500,fontWeightBold:u=700,htmlFontSize:d=16,allVariants:f,pxToRem:p,...g}=typeof t=="function"?t(e):t,x=s/14,b=p||(j=>`${j/d*x}rem`),y=(j,A,M,R,_)=>({fontFamily:n,fontWeight:j,fontSize:b(A),lineHeight:M,...n===UT?{letterSpacing:`${XW(R/A)}em`}:{},..._,...f}),S={h1:y(o,96,1.167,-1.5),h2:y(o,60,1.2,-.5),h3:y(a,48,1.167,0),h4:y(a,34,1.235,.25),h5:y(a,24,1.334,0),h6:y(l,20,1.6,.15),subtitle1:y(a,16,1.75,.15),subtitle2:y(l,14,1.57,.1),body1:y(a,16,1.5,.15),body2:y(a,14,1.43,.15),button:y(l,14,1.75,.4,WT),caption:y(a,12,1.66,.4),overline:y(a,12,2.66,1,WT),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return As({htmlFontSize:d,pxToRem:b,fontFamily:n,fontSize:s,fontWeightLight:o,fontWeightRegular:a,fontWeightMedium:l,fontWeightBold:u,...S},g,{clone:!1})}const ZW=.2,QW=.14,JW=.12;function Pr(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${ZW})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${QW})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${JW})`].join(",")}const eU=["none",Pr(0,2,1,-1,0,1,1,0,0,1,3,0),Pr(0,3,1,-2,0,2,2,0,0,1,5,0),Pr(0,3,3,-2,0,3,4,0,0,1,8,0),Pr(0,2,4,-1,0,4,5,0,0,1,10,0),Pr(0,3,5,-1,0,5,8,0,0,1,14,0),Pr(0,3,5,-1,0,6,10,0,0,1,18,0),Pr(0,4,5,-2,0,7,10,1,0,2,16,1),Pr(0,5,5,-3,0,8,10,1,0,3,14,2),Pr(0,5,6,-3,0,9,12,1,0,3,16,2),Pr(0,6,6,-3,0,10,14,1,0,4,18,3),Pr(0,6,7,-4,0,11,15,1,0,4,20,3),Pr(0,7,8,-4,0,12,17,2,0,5,22,4),Pr(0,7,8,-4,0,13,19,2,0,5,24,4),Pr(0,7,9,-4,0,14,21,2,0,5,26,4),Pr(0,8,9,-5,0,15,22,2,0,6,28,5),Pr(0,8,10,-5,0,16,24,2,0,6,30,5),Pr(0,8,11,-5,0,17,26,2,0,6,32,5),Pr(0,9,11,-5,0,18,28,2,0,7,34,6),Pr(0,9,12,-6,0,19,29,2,0,7,36,6),Pr(0,10,13,-6,0,20,31,3,0,8,38,7),Pr(0,10,13,-6,0,21,33,3,0,8,40,7),Pr(0,10,14,-6,0,22,35,3,0,8,42,7),Pr(0,11,14,-7,0,23,36,3,0,9,44,8),Pr(0,11,15,-7,0,24,38,3,0,9,46,8)],tU={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},dR={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function qT(e){return`${Math.round(e)}ms`}function nU(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function rU(e){const t={...tU,...e.easing},n={...dR,...e.duration};return{getAutoHeightDuration:nU,create:(o=["all"],a={})=>{const{duration:l=n.standard,easing:u=t.easeInOut,delay:d=0,...f}=a;return(Array.isArray(o)?o:[o]).map(p=>`${p} ${typeof l=="string"?l:qT(l)} ${u} ${typeof d=="string"?d:qT(d)}`).join(",")},...e,easing:t,duration:n}}const sU={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function oU(e){return Fa(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function fR(e={}){const t={...e};function n(s){const o=Object.entries(s);for(let a=0;a<o.length;a++){const[l,u]=o[a];!oU(u)||l.startsWith("unstable_")?delete s[l]:Fa(u)&&(s[l]={...u},n(s[l]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles'; const theme = ${JSON.stringify(t,null,2)}; theme.breakpoints = createBreakpoints(theme.breakpoints || {}); theme.transitions = createTransitions(theme.transitions || {}); export default theme;`}function VT(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const iU=e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let s=0;s<t.length;s+=1)n+=+t[s];return n};function aU(e){Object.assign(e,{alpha(t,n){const s=this||e;return s.colorSpace?`oklch(from ${t} l c h / ${typeof n=="string"?`calc(${n})`:n})`:s.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof n=="string"?`calc(${n})`:n})`:In(t,iU(n))},lighten(t,n){const s=this||e;return s.colorSpace?`color-mix(in ${s.colorSpace}, ${t}, #fff ${VT(n)})`:lb(t,n)},darken(t,n){const s=this||e;return s.colorSpace?`color-mix(in ${s.colorSpace}, ${t}, #000 ${VT(n)})`:ab(t,n)}})}function hS(e={},...t){const{breakpoints:n,mixins:s={},spacing:o,palette:a={},transitions:l={},typography:u={},shape:d,colorSpace:f,...p}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(wl(20));const g=tC({...a,colorSpace:f}),x=rh(e);let b=As(x,{mixins:KW(x.breakpoints,s),palette:g,shadows:eU.slice(),typography:uR(g,u),transitions:rU(l),zIndex:{...sU}});return b=As(b,p),b=t.reduce((y,S)=>As(y,S),b),b.unstable_sxConfig={...Wg,...p?.unstable_sxConfig},b.unstable_sx=function(S){return Rc({sx:S,theme:this})},b.toRuntimeSource=fR,aU(b),b}function pS(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const lU=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=pS(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function hR(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function pR(e){return e==="dark"?lU:[]}function cU(e){const{palette:t={mode:"light"},opacity:n,overlays:s,colorSpace:o,...a}=e,l=tC({...t,colorSpace:o});return{palette:l,opacity:{...hR(l.mode),...n},overlays:s||pR(l.mode),...a}}function uU(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const dU=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],fU=e=>(t,n)=>{const s=e.rootSelector||":root",o=e.colorSchemeSelector;let a=o;if(o==="class"&&(a=".%s"),o==="data"&&(a="[data-%s]"),o?.startsWith("data-")&&!o.includes("%s")&&(a=`[${o}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const l={};return dU(e.cssVarPrefix).forEach(u=>{l[u]=n[u],delete n[u]}),a==="media"?{[s]:n,"@media (prefers-color-scheme: dark)":{[s]:l}}:a?{[a.replace("%s",t)]:l,[`${s}, ${a.replace("%s",t)}`]:n}:{[s]:{...n,...l}}}if(a&&a!=="media")return`${s}, ${a.replace("%s",String(t))}`}else if(t){if(a==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[s]:n}};if(a)return a.replace("%s",String(t))}return s};function hU(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function Qe(e,t,n){!e[t]&&n&&(e[t]=n)}function kp(e){return typeof e!="string"||!e.startsWith("hsl")?e:tR(e)}function pl(e,t){`${t}Channel`in e||(e[`${t}Channel`]=Tp(kp(e[t])))}function pU(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Ta=e=>{try{return e()}catch{}},gU=(e="mui")=>aW(e);function W2(e,t,n,s,o){if(!n)return;n=n===!0?{}:n;const a=o==="dark"?"dark":"light";if(!s){t[o]=cU({...n,palette:{mode:a,...n?.palette},colorSpace:e});return}const{palette:l,...u}=hS({...s,palette:{mode:a,...n?.palette},colorSpace:e});return t[o]={...n,palette:l,opacity:{...hR(a),...n?.opacity},overlays:n?.overlays||pR(a)},u}function mU(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:s,disableCssColorScheme:o=!1,cssVarPrefix:a="mui",nativeColor:l=!1,shouldSkipGeneratingVar:u=uU,colorSchemeSelector:d=n.light&&n.dark?"media":void 0,rootSelector:f=":root",...p}=e,g=Object.keys(n)[0],x=s||(n.light&&g!=="light"?"light":g),b=gU(a),{[x]:y,light:S,dark:j,...A}=n,M={...A};let R=y;if((x==="dark"&&!("dark"in n)||x==="light"&&!("light"in n))&&(R=!0),!R)throw new Error(wl(21,x));let _;l&&(_="oklch");const z=W2(_,M,R,p,x);S&&!M.light&&W2(_,M,S,void 0,"light"),j&&!M.dark&&W2(_,M,j,void 0,"dark");let F={defaultColorScheme:x,...z,cssVarPrefix:a,colorSchemeSelector:d,rootSelector:f,getCssVar:b,colorSchemes:M,font:{...YW(z.typography),...z.font},spacing:pU(p.spacing)};Object.keys(F.colorSchemes).forEach(P=>{const k=F.colorSchemes[P].palette,L=W=>{const D=W.split("-"),q=D[1],K=D[2];return b(W,k[q][K])};k.mode==="light"&&(Qe(k.common,"background","#fff"),Qe(k.common,"onBackground","#000")),k.mode==="dark"&&(Qe(k.common,"background","#000"),Qe(k.common,"onBackground","#fff"));function O(W,D,q){if(_){let K;return W===hu&&(K=`transparent ${((1-q)*100).toFixed(0)}%`),W===ur&&(K=`#000 ${(q*100).toFixed(0)}%`),W===dr&&(K=`#fff ${(q*100).toFixed(0)}%`),`color-mix(in ${_}, ${D}, ${K})`}return W(D,q)}if(hU(k,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),k.mode==="light"){Qe(k.Alert,"errorColor",O(ur,l?b("palette-error-light"):k.error.light,.6)),Qe(k.Alert,"infoColor",O(ur,l?b("palette-info-light"):k.info.light,.6)),Qe(k.Alert,"successColor",O(ur,l?b("palette-success-light"):k.success.light,.6)),Qe(k.Alert,"warningColor",O(ur,l?b("palette-warning-light"):k.warning.light,.6)),Qe(k.Alert,"errorFilledBg",L("palette-error-main")),Qe(k.Alert,"infoFilledBg",L("palette-info-main")),Qe(k.Alert,"successFilledBg",L("palette-success-main")),Qe(k.Alert,"warningFilledBg",L("palette-warning-main")),Qe(k.Alert,"errorFilledColor",Ta(()=>k.getContrastText(k.error.main))),Qe(k.Alert,"infoFilledColor",Ta(()=>k.getContrastText(k.info.main))),Qe(k.Alert,"successFilledColor",Ta(()=>k.getContrastText(k.success.main))),Qe(k.Alert,"warningFilledColor",Ta(()=>k.getContrastText(k.warning.main))),Qe(k.Alert,"errorStandardBg",O(dr,l?b("palette-error-light"):k.error.light,.9)),Qe(k.Alert,"infoStandardBg",O(dr,l?b("palette-info-light"):k.info.light,.9)),Qe(k.Alert,"successStandardBg",O(dr,l?b("palette-success-light"):k.success.light,.9)),Qe(k.Alert,"warningStandardBg",O(dr,l?b("palette-warning-light"):k.warning.light,.9)),Qe(k.Alert,"errorIconColor",L("palette-error-main")),Qe(k.Alert,"infoIconColor",L("palette-info-main")),Qe(k.Alert,"successIconColor",L("palette-success-main")),Qe(k.Alert,"warningIconColor",L("palette-warning-main")),Qe(k.AppBar,"defaultBg",L("palette-grey-100")),Qe(k.Avatar,"defaultBg",L("palette-grey-400")),Qe(k.Button,"inheritContainedBg",L("palette-grey-300")),Qe(k.Button,"inheritContainedHoverBg",L("palette-grey-A100")),Qe(k.Chip,"defaultBorder",L("palette-grey-400")),Qe(k.Chip,"defaultAvatarColor",L("palette-grey-700")),Qe(k.Chip,"defaultIconColor",L("palette-grey-700")),Qe(k.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),Qe(k.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),Qe(k.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),Qe(k.LinearProgress,"primaryBg",O(dr,l?b("palette-primary-main"):k.primary.main,.62)),Qe(k.LinearProgress,"secondaryBg",O(dr,l?b("palette-secondary-main"):k.secondary.main,.62)),Qe(k.LinearProgress,"errorBg",O(dr,l?b("palette-error-main"):k.error.main,.62)),Qe(k.LinearProgress,"infoBg",O(dr,l?b("palette-info-main"):k.info.main,.62)),Qe(k.LinearProgress,"successBg",O(dr,l?b("palette-success-main"):k.success.main,.62)),Qe(k.LinearProgress,"warningBg",O(dr,l?b("palette-warning-light"):k.warning.main,.62)),Qe(k.Skeleton,"bg",_?O(hu,l?b("palette-text-primary"):k.text.primary,.11):`rgba(${L("palette-text-primaryChannel")} / 0.11)`),Qe(k.Slider,"primaryTrack",O(dr,l?b("palette-primary-main"):k.primary.main,.62)),Qe(k.Slider,"secondaryTrack",O(dr,l?b("palette-secondary-main"):k.secondary.main,.62)),Qe(k.Slider,"errorTrack",O(dr,l?b("palette-error-main"):k.error.main,.62)),Qe(k.Slider,"infoTrack",O(dr,l?b("palette-info-main"):k.info.main,.62)),Qe(k.Slider,"successTrack",O(dr,l?b("palette-success-main"):k.success.main,.62)),Qe(k.Slider,"warningTrack",O(dr,l?b("palette-warning-main"):k.warning.main,.62));const W=_?O(ur,l?b("palette-background-default"):k.background.default,.6825):Nx(k.background.default,.8);Qe(k.SnackbarContent,"bg",W),Qe(k.SnackbarContent,"color",Ta(()=>_?fS.text.primary:k.getContrastText(W))),Qe(k.SpeedDialAction,"fabHoverBg",Nx(k.background.paper,.15)),Qe(k.StepConnector,"border",L("palette-grey-400")),Qe(k.StepContent,"border",L("palette-grey-400")),Qe(k.Switch,"defaultColor",L("palette-common-white")),Qe(k.Switch,"defaultDisabledColor",L("palette-grey-100")),Qe(k.Switch,"primaryDisabledColor",O(dr,l?b("palette-primary-main"):k.primary.main,.62)),Qe(k.Switch,"secondaryDisabledColor",O(dr,l?b("palette-secondary-main"):k.secondary.main,.62)),Qe(k.Switch,"errorDisabledColor",O(dr,l?b("palette-error-main"):k.error.main,.62)),Qe(k.Switch,"infoDisabledColor",O(dr,l?b("palette-info-main"):k.info.main,.62)),Qe(k.Switch,"successDisabledColor",O(dr,l?b("palette-success-main"):k.success.main,.62)),Qe(k.Switch,"warningDisabledColor",O(dr,l?b("palette-warning-main"):k.warning.main,.62)),Qe(k.TableCell,"border",O(dr,hu(l?b("palette-divider"):k.divider,1),.88)),Qe(k.Tooltip,"bg",O(hu,l?b("palette-grey-700"):k.grey[700],.92))}if(k.mode==="dark"){Qe(k.Alert,"errorColor",O(dr,l?b("palette-error-light"):k.error.light,.6)),Qe(k.Alert,"infoColor",O(dr,l?b("palette-info-light"):k.info.light,.6)),Qe(k.Alert,"successColor",O(dr,l?b("palette-success-light"):k.success.light,.6)),Qe(k.Alert,"warningColor",O(dr,l?b("palette-warning-light"):k.warning.light,.6)),Qe(k.Alert,"errorFilledBg",L("palette-error-dark")),Qe(k.Alert,"infoFilledBg",L("palette-info-dark")),Qe(k.Alert,"successFilledBg",L("palette-success-dark")),Qe(k.Alert,"warningFilledBg",L("palette-warning-dark")),Qe(k.Alert,"errorFilledColor",Ta(()=>k.getContrastText(k.error.dark))),Qe(k.Alert,"infoFilledColor",Ta(()=>k.getContrastText(k.info.dark))),Qe(k.Alert,"successFilledColor",Ta(()=>k.getContrastText(k.success.dark))),Qe(k.Alert,"warningFilledColor",Ta(()=>k.getContrastText(k.warning.dark))),Qe(k.Alert,"errorStandardBg",O(ur,l?b("palette-error-light"):k.error.light,.9)),Qe(k.Alert,"infoStandardBg",O(ur,l?b("palette-info-light"):k.info.light,.9)),Qe(k.Alert,"successStandardBg",O(ur,l?b("palette-success-light"):k.success.light,.9)),Qe(k.Alert,"warningStandardBg",O(ur,l?b("palette-warning-light"):k.warning.light,.9)),Qe(k.Alert,"errorIconColor",L("palette-error-main")),Qe(k.Alert,"infoIconColor",L("palette-info-main")),Qe(k.Alert,"successIconColor",L("palette-success-main")),Qe(k.Alert,"warningIconColor",L("palette-warning-main")),Qe(k.AppBar,"defaultBg",L("palette-grey-900")),Qe(k.AppBar,"darkBg",L("palette-background-paper")),Qe(k.AppBar,"darkColor",L("palette-text-primary")),Qe(k.Avatar,"defaultBg",L("palette-grey-600")),Qe(k.Button,"inheritContainedBg",L("palette-grey-800")),Qe(k.Button,"inheritContainedHoverBg",L("palette-grey-700")),Qe(k.Chip,"defaultBorder",L("palette-grey-700")),Qe(k.Chip,"defaultAvatarColor",L("palette-grey-300")),Qe(k.Chip,"defaultIconColor",L("palette-grey-300")),Qe(k.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),Qe(k.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),Qe(k.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),Qe(k.LinearProgress,"primaryBg",O(ur,l?b("palette-primary-main"):k.primary.main,.5)),Qe(k.LinearProgress,"secondaryBg",O(ur,l?b("palette-secondary-main"):k.secondary.main,.5)),Qe(k.LinearProgress,"errorBg",O(ur,l?b("palette-error-main"):k.error.main,.5)),Qe(k.LinearProgress,"infoBg",O(ur,l?b("palette-info-main"):k.info.main,.5)),Qe(k.LinearProgress,"successBg",O(ur,l?b("palette-success-main"):k.success.main,.5)),Qe(k.LinearProgress,"warningBg",O(ur,l?b("palette-warning-main"):k.warning.main,.5)),Qe(k.Skeleton,"bg",_?O(hu,l?b("palette-text-primary"):k.text.primary,.13):`rgba(${L("palette-text-primaryChannel")} / 0.13)`),Qe(k.Slider,"primaryTrack",O(ur,l?b("palette-primary-main"):k.primary.main,.5)),Qe(k.Slider,"secondaryTrack",O(ur,l?b("palette-secondary-main"):k.secondary.main,.5)),Qe(k.Slider,"errorTrack",O(ur,l?b("palette-error-main"):k.error.main,.5)),Qe(k.Slider,"infoTrack",O(ur,l?b("palette-info-main"):k.info.main,.5)),Qe(k.Slider,"successTrack",O(ur,l?b("palette-success-main"):k.success.main,.5)),Qe(k.Slider,"warningTrack",O(ur,l?b("palette-warning-light"):k.warning.main,.5));const W=_?O(dr,l?b("palette-background-default"):k.background.default,.985):Nx(k.background.default,.98);Qe(k.SnackbarContent,"bg",W),Qe(k.SnackbarContent,"color",Ta(()=>_?lR.text.primary:k.getContrastText(W))),Qe(k.SpeedDialAction,"fabHoverBg",Nx(k.background.paper,.15)),Qe(k.StepConnector,"border",L("palette-grey-600")),Qe(k.StepContent,"border",L("palette-grey-600")),Qe(k.Switch,"defaultColor",L("palette-grey-300")),Qe(k.Switch,"defaultDisabledColor",L("palette-grey-600")),Qe(k.Switch,"primaryDisabledColor",O(ur,l?b("palette-primary-main"):k.primary.main,.55)),Qe(k.Switch,"secondaryDisabledColor",O(ur,l?b("palette-secondary-main"):k.secondary.main,.55)),Qe(k.Switch,"errorDisabledColor",O(ur,l?b("palette-error-main"):k.error.main,.55)),Qe(k.Switch,"infoDisabledColor",O(ur,l?b("palette-info-main"):k.info.main,.55)),Qe(k.Switch,"successDisabledColor",O(ur,l?b("palette-success-main"):k.success.main,.55)),Qe(k.Switch,"warningDisabledColor",O(ur,l?b("palette-warning-light"):k.warning.main,.55)),Qe(k.TableCell,"border",O(ur,hu(l?b("palette-divider"):k.divider,1),.68)),Qe(k.Tooltip,"bg",O(hu,l?b("palette-grey-700"):k.grey[700],.92))}l||(pl(k.background,"default"),pl(k.background,"paper"),pl(k.common,"background"),pl(k.common,"onBackground"),pl(k,"divider")),Object.keys(k).forEach(W=>{const D=k[W];W!=="tonalOffset"&&!l&&D&&typeof D=="object"&&(D.main&&Qe(k[W],"mainChannel",Tp(kp(D.main))),D.light&&Qe(k[W],"lightChannel",Tp(kp(D.light))),D.dark&&Qe(k[W],"darkChannel",Tp(kp(D.dark))),D.contrastText&&Qe(k[W],"contrastTextChannel",Tp(kp(D.contrastText))),W==="text"&&(pl(k[W],"primary"),pl(k[W],"secondary")),W==="action"&&(D.active&&pl(k[W],"active"),D.selected&&pl(k[W],"selected")))})}),F=t.reduce((P,k)=>As(P,k),F);const N={prefix:a,disableCssColorScheme:o,shouldSkipGeneratingVar:u,getSelector:fU(F),enableContrastVars:l},{vars:I,generateThemeVars:B,generateStyleSheets:H}=uW(F,N);return F.vars=I,Object.entries(F.colorSchemes[F.defaultColorScheme]).forEach(([P,k])=>{F[P]=k}),F.generateThemeVars=B,F.generateStyleSheets=H,F.generateSpacing=function(){return q7(p.spacing,Z1(this))},F.getColorSchemeSelector=dW(d),F.spacing=F.generateSpacing(),F.shouldSkipGeneratingVar=u,F.unstable_sxConfig={...Wg,...p?.unstable_sxConfig},F.unstable_sx=function(k){return Rc({sx:k,theme:this})},F.toRuntimeSource=fR,F}function GT(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:tC({...n===!0?{}:n.palette,mode:t})})}function ub(e={},...t){const{palette:n,cssVariables:s=!1,colorSchemes:o=n?void 0:{light:!0},defaultColorScheme:a=n?.mode,...l}=e,u=a||"light",d=o?.[u],f={...o,...n?{[u]:{...typeof d!="boolean"&&d,palette:n}}:void 0};if(s===!1){if(!("colorSchemes"in e))return hS(e,...t);let p=n;"palette"in e||f[u]&&(f[u]!==!0?p=f[u].palette:u==="dark"&&(p={mode:"dark"}));const g=hS({...e,palette:p},...t);return g.defaultColorScheme=u,g.colorSchemes=f,g.palette.mode==="light"&&(g.colorSchemes.light={...f.light!==!0&&f.light,palette:g.palette},GT(g,"dark",f.dark)),g.palette.mode==="dark"&&(g.colorSchemes.dark={...f.dark!==!0&&f.dark,palette:g.palette},GT(g,"light",f.light)),g}return!n&&!("light"in f)&&u==="light"&&(f.light=!0),mU({...l,colorSchemes:f,defaultColorScheme:u,...typeof s!="boolean"&&s},...t)}function xU(e){return String(e).match(/[\d.\-+]*\s*(.*)/)[1]||""}function bU(e){return parseFloat(e)}const db=ub();function On(){const e=Ug(db);return e[Ri]||e}function Wi({props:e,name:t}){return ob({props:e,name:t,defaultTheme:db,themeId:Ri})}function qg(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Us=e=>qg(e)&&e!=="classes",Me=Z7({themeId:Ri,defaultTheme:db,rootShouldForwardProp:Us});function yU({theme:e,...t}){const n=Ri in e?e[Ri]:void 0;return r.jsx(oR,{...t,themeId:n?Ri:void 0,theme:n||e})}const $x={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:vU}=iW({themeId:Ri,theme:()=>ub({cssVariables:!0}),colorSchemeStorageKey:$x.colorSchemeStorageKey,modeStorageKey:$x.modeStorageKey,defaultColorScheme:{light:$x.defaultLightColorScheme,dark:$x.defaultDarkColorScheme},resolveTheme:e=>{const t={...e,typography:uR(e.palette,e.typography)};return t.unstable_sx=function(s){return Rc({sx:s,theme:this})},t}}),SU=vU;function jU({theme:e,...t}){const n=v.useMemo(()=>{if(typeof e=="function")return e;const s=Ri in e?e[Ri]:e;return"colorSchemes"in s?null:"vars"in s?e:{...e,vars:null}},[e]);return n?r.jsx(yU,{theme:n,...t}):r.jsx(SU,{theme:e,...t})}function CU(e){return r.jsx(V7,{...e,defaultTheme:db,themeId:Ri})}function nC(e){return function(n){return r.jsx(CU,{styles:typeof e=="function"?s=>e({theme:s,...n}):e})}}function wU(){return sb}function Tt(e){return YH(e)}const gS=typeof nC({})=="function",AU=(e,t)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...t&&!e.vars&&{colorScheme:e.palette.mode}}),EU=e=>({color:(e.vars||e).palette.text.primary,...e.typography.body1,backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}}),gR=(e,t=!1)=>{const n={};t&&e.colorSchemes&&typeof e.getColorSchemeSelector=="function"&&Object.entries(e.colorSchemes).forEach(([a,l])=>{const u=e.getColorSchemeSelector(a);u.startsWith("@")?n[u]={":root":{colorScheme:l.palette?.mode}}:n[u.replace(/\s*&/,"")]={colorScheme:l.palette?.mode}});let s={html:AU(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...EU(e),"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}},...n};const o=e.components?.MuiCssBaseline?.styleOverrides;return o&&(s=[s,o]),s},N0="mui-ecs",TU=e=>{const t=gR(e,!1),n=Array.isArray(t)?t[0]:t;return!e.vars&&n&&(n.html[`:root:has(${N0})`]={colorScheme:e.palette.mode}),e.colorSchemes&&Object.entries(e.colorSchemes).forEach(([s,o])=>{const a=e.getColorSchemeSelector(s);a.startsWith("@")?n[a]={[`:root:not(:has(.${N0}))`]:{colorScheme:o.palette?.mode}}:n[a.replace(/\s*&/,"")]={[`&:not(:has(.${N0}))`]:{colorScheme:o.palette?.mode}}}),t},kU=nC(gS?({theme:e,enableColorScheme:t})=>gR(e,t):({theme:e})=>TU(e));function MU(e){const t=Tt({props:e,name:"MuiCssBaseline"}),{children:n,enableColorScheme:s=!1}=t;return r.jsxs(v.Fragment,{children:[gS&&r.jsx(kU,{enableColorScheme:s}),!gS&&!s&&r.jsx("span",{className:N0,style:{display:"none"}}),n]})}const mR=v.createContext(),Fl=()=>{const e=v.useContext(mR);if(!e)throw new Error("useThemeMode must be used within a ThemeModeProvider");return e},RU=e=>({palette:{mode:e,...e==="dark"?{primary:{main:"rgba(17, 82, 212, 1)",light:"rgba(17, 82, 212, 0.15)",dark:"rgba(13, 65, 170, 1)"},background:{default:"#0C1322",paper:"#111827",darker:"#080D19",hero:"rgba(40, 46, 57, 1)"},text:{primary:"#FFFFFF",secondary:"#9CA3AF",muted:"#6B7280"},divider:"#1F2937"}:{primary:{main:"rgba(17, 82, 212, 1)",light:"rgba(17, 82, 212, 0.1)",dark:"rgba(13, 65, 170, 1)"},background:{default:"#FFFFFF",paper:"#F8FAFC",darker:"#F1F5F9",hero:"#F8FAFC"},text:{primary:"#1E293B",secondary:"#64748B",muted:"#94A3B8"},divider:"#E2E8F0"}},typography:{fontFamily:'"Inter", "Roboto", "Helvetica", "Arial", sans-serif'},shape:{borderRadius:8},components:{MuiButton:{styleOverrides:{root:{textTransform:"none",fontWeight:600}}}}}),zU=({children:e})=>{const[t,n]=v.useState("dark");v.useEffect(()=>{localStorage.setItem("themeMode",t)},[t]);const s=()=>{n(l=>l==="dark"?"light":"dark")},o=v.useMemo(()=>ub(RU(t)),[t]),a=v.useMemo(()=>({mode:t,toggleThemeMode:s,isDark:t==="dark"}),[t]);return r.jsx(mR.Provider,{value:a,children:r.jsxs(jU,{theme:o,children:[r.jsx(MU,{}),e]})})},e1=({children:e,variant:t="primary",size:n="medium",onClick:s,disabled:o=!1,type:a="button",className:l=""})=>{const d={primary:"btn-primary",secondary:"btn-secondary",danger:"btn-danger",outline:"btn-outline"},f={small:"btn-sm",medium:"btn-md",large:"btn-lg"};return r.jsx("button",{type:a,className:`btn ${d[t]} ${f[n]} ${l}`,onClick:s,disabled:o,children:e})},Np=({children:e,title:t,subtitle:n,className:s="",padding:o=!0})=>r.jsxs("div",{className:`card ${o?"card-padded":""} ${s}`,children:[(t||n)&&r.jsxs("div",{className:"card-header",children:[t&&r.jsx("h3",{className:"card-title",children:t}),n&&r.jsx("p",{className:"card-subtitle",children:n})]}),r.jsx("div",{className:"card-body",children:e})]}),IU=()=>r.jsx("div",{className:"not-found-page",children:r.jsxs("div",{className:"not-found-content",children:[r.jsx("h1",{children:"404"}),r.jsx("h2",{children:"Page Not Found"}),r.jsx("p",{children:"The page you're looking for doesn't exist or has been moved."}),r.jsx(yn,{to:"/",children:r.jsx(e1,{variant:"primary",children:"Go Back Home"})})]})});function YT(...e){return e.reduce((t,n)=>n==null?t:function(...o){t.apply(this,o),n.apply(this,o)},()=>{})}const St=QH;function FU(e){return gt("MuiSvgIcon",e)}mt("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const _U=e=>{const{color:t,fontSize:n,classes:s}=e,o={root:["root",t!=="inherit"&&`color${Le(t)}`,`fontSize${Le(n)}`]};return pt(o,FU,s)},LU=Me("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Le(n.color)}`],t[`fontSize${Le(n.fontSize)}`]]}})(St(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:t=>!t.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,t])=>t&&t.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),mS=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiSvgIcon"}),{children:o,className:a,color:l="inherit",component:u="svg",fontSize:d="medium",htmlColor:f,inheritViewBox:p=!1,titleAccess:g,viewBox:x="0 0 24 24",...b}=s,y=v.isValidElement(o)&&o.type==="svg",S={...s,color:l,component:u,fontSize:d,instanceFontSize:t.fontSize,inheritViewBox:p,viewBox:x,hasSvgAsChild:y},j={};p||(j.viewBox=x);const A=_U(S);return r.jsxs(LU,{as:u,className:Ye(A.root,a),focusable:"false",color:f,"aria-hidden":g?void 0:!0,role:g?"img":void 0,ref:n,...j,...b,...y&&o.props,ownerState:S,children:[y?o.props.children:o,g?r.jsx("title",{children:g}):null]})});mS.muiName="SvgIcon";function ze(e,t){function n(s,o){return r.jsx(mS,{"data-testid":void 0,ref:o,...s,children:e})}return n.muiName=mS.muiName,v.memo(v.forwardRef(n))}function Vg(e,t=166){let n;function s(...o){const a=()=>{e.apply(this,o)};clearTimeout(n),n=setTimeout(a,t)}return s.clear=()=>{clearTimeout(n)},s}function is(e){return e&&e.ownerDocument||document}function wo(e){return is(e).defaultView||window}function xS(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function la(e){const{controlled:t,default:n,name:s,state:o="value"}=e,{current:a}=v.useRef(t!==void 0),[l,u]=v.useState(n),d=a?t:l,f=v.useCallback(p=>{a||u(p)},[]);return[d,f]}function pn(e){const t=v.useRef(e);return or(()=>{t.current=e}),v.useRef((...n)=>(0,t.current)(...n)).current}function vr(...e){const t=v.useRef(void 0),n=v.useCallback(s=>{const o=e.map(a=>{if(a==null)return null;if(typeof a=="function"){const l=a,u=l(s);return typeof u=="function"?u:()=>{l(null)}}return a.current=s,()=>{a.current=null}});return()=>{o.forEach(a=>a?.())}},e);return v.useMemo(()=>e.every(s=>s==null)?null:s=>{t.current&&(t.current(),t.current=void 0),s!=null&&(t.current=n(s))},e)}function PU(e,t){const n=e.charCodeAt(2);return e[0]==="o"&&e[1]==="n"&&n>=65&&n<=90&&typeof t=="function"}function rC(e,t){if(!e)return t;function n(l,u){const d={};return Object.keys(u).forEach(f=>{PU(f,u[f])&&typeof l[f]=="function"&&(d[f]=(...p)=>{l[f](...p),u[f](...p)})}),d}if(typeof e=="function"||typeof t=="function")return l=>{const u=typeof t=="function"?t(l):t,d=typeof e=="function"?e({...l,...u}):e,f=Ye(l?.className,u?.className,d?.className),p=n(d,u);return{...u,...d,...p,...!!f&&{className:f},...u?.style&&d?.style&&{style:{...u.style,...d.style}},...u?.sx&&d?.sx&&{sx:[...Array.isArray(u.sx)?u.sx:[u.sx],...Array.isArray(d.sx)?d.sx:[d.sx]]}}};const s=t,o=n(e,s),a=Ye(s?.className,e?.className);return{...t,...e,...o,...!!a&&{className:a},...s?.style&&e?.style&&{style:{...s.style,...e.style}},...s?.sx&&e?.sx&&{sx:[...Array.isArray(s.sx)?s.sx:[s.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}function _n(e,t){if(e==null)return{};var n={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.indexOf(s)!==-1)continue;n[s]=e[s]}return n}function bS(e,t){return bS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},bS(e,t)}function xR(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,bS(e,t)}const KT={disabled:!1},t1=Er.createContext(null);var DU=function(t){return t.scrollTop},Mp="unmounted",gu="exited",mu="entering",sf="entered",yS="exiting",Ui=(function(e){xR(t,e);function t(s,o){var a;a=e.call(this,s,o)||this;var l=o,u=l&&!l.isMounting?s.enter:s.appear,d;return a.appearStatus=null,s.in?u?(d=gu,a.appearStatus=mu):d=sf:s.unmountOnExit||s.mountOnEnter?d=Mp:d=gu,a.state={status:d},a.nextCallback=null,a}t.getDerivedStateFromProps=function(o,a){var l=o.in;return l&&a.status===Mp?{status:gu}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var a=null;if(o!==this.props){var l=this.state.status;this.props.in?l!==mu&&l!==sf&&(a=mu):(l===mu||l===sf)&&(a=yS)}this.updateStatus(!1,a)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,a,l,u;return a=l=u=o,o!=null&&typeof o!="number"&&(a=o.exit,l=o.enter,u=o.appear!==void 0?o.appear:l),{exit:a,enter:l,appear:u}},n.updateStatus=function(o,a){if(o===void 0&&(o=!1),a!==null)if(this.cancelNextCallback(),a===mu){if(this.props.unmountOnExit||this.props.mountOnEnter){var l=this.props.nodeRef?this.props.nodeRef.current:Ox.findDOMNode(this);l&&DU(l)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===gu&&this.setState({status:Mp})},n.performEnter=function(o){var a=this,l=this.props.enter,u=this.context?this.context.isMounting:o,d=this.props.nodeRef?[u]:[Ox.findDOMNode(this),u],f=d[0],p=d[1],g=this.getTimeouts(),x=u?g.appear:g.enter;if(!o&&!l||KT.disabled){this.safeSetState({status:sf},function(){a.props.onEntered(f)});return}this.props.onEnter(f,p),this.safeSetState({status:mu},function(){a.props.onEntering(f,p),a.onTransitionEnd(x,function(){a.safeSetState({status:sf},function(){a.props.onEntered(f,p)})})})},n.performExit=function(){var o=this,a=this.props.exit,l=this.getTimeouts(),u=this.props.nodeRef?void 0:Ox.findDOMNode(this);if(!a||KT.disabled){this.safeSetState({status:gu},function(){o.props.onExited(u)});return}this.props.onExit(u),this.safeSetState({status:yS},function(){o.props.onExiting(u),o.onTransitionEnd(l.exit,function(){o.safeSetState({status:gu},function(){o.props.onExited(u)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,a){a=this.setNextCallback(a),this.setState(o,a)},n.setNextCallback=function(o){var a=this,l=!0;return this.nextCallback=function(u){l&&(l=!1,a.nextCallback=null,o(u))},this.nextCallback.cancel=function(){l=!1},this.nextCallback},n.onTransitionEnd=function(o,a){this.setNextCallback(a);var l=this.props.nodeRef?this.props.nodeRef.current:Ox.findDOMNode(this),u=o==null&&!this.props.addEndListener;if(!l||u){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var d=this.props.nodeRef?[this.nextCallback]:[l,this.nextCallback],f=d[0],p=d[1];this.props.addEndListener(f,p)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===Mp)return null;var a=this.props,l=a.children;a.in,a.mountOnEnter,a.unmountOnExit,a.appear,a.enter,a.exit,a.timeout,a.addEndListener,a.onEnter,a.onEntering,a.onEntered,a.onExit,a.onExiting,a.onExited,a.nodeRef;var u=_n(a,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Er.createElement(t1.Provider,{value:null},typeof l=="function"?l(o,u):Er.cloneElement(Er.Children.only(l),u))},t})(Er.Component);Ui.contextType=t1;Ui.propTypes={};function Gd(){}Ui.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Gd,onEntering:Gd,onEntered:Gd,onExit:Gd,onExiting:Gd,onExited:Gd};Ui.UNMOUNTED=Mp;Ui.EXITED=gu;Ui.ENTERING=mu;Ui.ENTERED=sf;Ui.EXITING=yS;function OU(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sC(e,t){var n=function(a){return t&&v.isValidElement(a)?t(a):a},s=Object.create(null);return e&&v.Children.map(e,function(o){return o}).forEach(function(o){s[o.key]=n(o)}),s}function BU(e,t){e=e||{},t=t||{};function n(p){return p in t?t[p]:e[p]}var s=Object.create(null),o=[];for(var a in e)a in t?o.length&&(s[a]=o,o=[]):o.push(a);var l,u={};for(var d in t){if(s[d])for(l=0;l<s[d].length;l++){var f=s[d][l];u[s[d][l]]=n(f)}u[d]=n(d)}for(l=0;l<o.length;l++)u[o[l]]=n(o[l]);return u}function ju(e,t,n){return n[t]!=null?n[t]:e.props[t]}function NU(e,t){return sC(e.children,function(n){return v.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:ju(n,"appear",e),enter:ju(n,"enter",e),exit:ju(n,"exit",e)})})}function $U(e,t,n){var s=sC(e.children),o=BU(t,s);return Object.keys(o).forEach(function(a){var l=o[a];if(v.isValidElement(l)){var u=a in t,d=a in s,f=t[a],p=v.isValidElement(f)&&!f.props.in;d&&(!u||p)?o[a]=v.cloneElement(l,{onExited:n.bind(null,l),in:!0,exit:ju(l,"exit",e),enter:ju(l,"enter",e)}):!d&&u&&!p?o[a]=v.cloneElement(l,{in:!1}):d&&u&&v.isValidElement(f)&&(o[a]=v.cloneElement(l,{onExited:n.bind(null,l),in:f.props.in,exit:ju(l,"exit",e),enter:ju(l,"enter",e)}))}}),o}var HU=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},WU={component:"div",childFactory:function(t){return t}},oC=(function(e){xR(t,e);function t(s,o){var a;a=e.call(this,s,o)||this;var l=a.handleExited.bind(OU(a));return a.state={contextValue:{isMounting:!0},handleExited:l,firstRender:!0},a}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,a){var l=a.children,u=a.handleExited,d=a.firstRender;return{children:d?NU(o,u):$U(o,l,u),firstRender:!1}},n.handleExited=function(o,a){var l=sC(this.props.children);o.key in l||(o.props.onExited&&o.props.onExited(a),this.mounted&&this.setState(function(u){var d=Ce({},u.children);return delete d[o.key],{children:d}}))},n.render=function(){var o=this.props,a=o.component,l=o.childFactory,u=_n(o,["component","childFactory"]),d=this.state.contextValue,f=HU(this.state.children).map(l);return delete u.appear,delete u.enter,delete u.exit,a===null?Er.createElement(t1.Provider,{value:d},f):Er.createElement(t1.Provider,{value:d},Er.createElement(a,u,f))},t})(Er.Component);oC.propTypes={};oC.defaultProps=WU;const XT={};function fb(e,t){const n=v.useRef(XT);return n.current===XT&&(n.current=e(t)),n}const UU=[];function bR(e){v.useEffect(e,UU)}class hb{static create(){return new hb}currentId=null;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function wc(){const e=fb(hb.create).current;return bR(e.disposeEffect),e}const iC=e=>e.scrollTop;function Or(e,t){return n=>{if(t){const s=e.current;n===void 0?t(s):t(s,n)}}}function yR(e,t,n,s,o,a){const l=e==="exited"&&!t?s:n[e]||n.exited;return o||a?{...l,...o,...a}:l}function Ic(e,t){const{timeout:n,easing:s,style:o={}}=e;return{duration:o.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:o.transitionTimingFunction??(typeof s=="object"?s[t.mode]:s),delay:o.transitionDelay}}function La(e){return typeof e=="string"}function vR(e,t,n){return e===void 0||La(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function SR(e,t,n){return typeof e=="function"?e(t,n):e}function Au(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(s=>s.match(/^on[A-Z]/)&&typeof e[s]=="function"&&!t.includes(s)).forEach(s=>{n[s]=e[s]}),n}function ZT(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function jR(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:s,externalForwardedProps:o,className:a}=e;if(!t){const b=Ye(n?.className,a,o?.className,s?.className),y={...n?.style,...o?.style,...s?.style},S={...n,...o,...s};return b.length>0&&(S.className=b),Object.keys(y).length>0&&(S.style=y),{props:S,internalRef:void 0}}const l=Au({...o,...s}),u=ZT(s),d=ZT(o),f=t(l),p=Ye(f?.className,n?.className,a,o?.className,s?.className),g={...f?.style,...n?.style,...o?.style,...s?.style},x={...f,...n,...d,...u};return p.length>0&&(x.className=p),Object.keys(g).length>0&&(x.style=g),{props:x,internalRef:f.ref}}function jt(e,t){const{className:n,elementType:s,ownerState:o,externalForwardedProps:a,internalForwardedProps:l,shouldForwardComponentProp:u=!1,...d}=t,{component:f,slots:p={[e]:void 0},slotProps:g={[e]:void 0},...x}=a,b=p[e]||s,y=SR(g[e],o),{props:{component:S,...j},internalRef:A}=jR({className:n,...d,externalForwardedProps:e==="root"?x:void 0,externalSlotProps:y}),M=vr(A,y?.ref,t.ref),R=e==="root"?S||f:S,_=vR(b,{...e==="root"&&!f&&!p[e]&&l,...e!=="root"&&!p[e]&&l,...j,...R&&!u&&{as:R},...R&&u&&{component:R},ref:M},o);return[b,_]}function qU(e){return gt("MuiCollapse",e)}mt("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const VU=e=>{const{orientation:t,classes:n}=e;return pt({root:["root",t],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",t],wrapperInner:["wrapperInner",t]},qU,n)},GU=Me("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(St(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),YU=Me("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),KU=Me("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Al=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiCollapse"}),{addEndListener:o,children:a,className:l,collapsedSize:u="0px",component:d,easing:f,in:p,onEnter:g,onEntered:x,onEntering:b,onExit:y,onExited:S,onExiting:j,orientation:A="vertical",slots:M={},slotProps:R={},style:_,timeout:z=dR.standard,TransitionComponent:F=Ui,...N}=s,I={...s,orientation:A,collapsedSize:u},B=VU(I),H=On(),P=wc(),k=v.useRef(null),L=v.useRef(),O=typeof u=="number"?`${u}px`:u,W=A==="horizontal",D=W?"width":"height",q=v.useRef(null),K=vr(n,q),Y=()=>k.current?k.current[W?"clientWidth":"clientHeight"]:0,ie=Or(q,(X,ve)=>{k.current&&W&&(k.current.style.position="absolute"),X.style[D]=O,g&&g(X,ve)}),V=Or(q,(X,ve)=>{const st=Y();k.current&&W&&(k.current.style.position="");const{duration:Ge,easing:qe}=Ic({style:_,timeout:z,easing:f},{mode:"enter"});if(z==="auto"){const Be=H.transitions.getAutoHeightDuration(st);X.style.transitionDuration=`${Be}ms`,L.current=Be}else X.style.transitionDuration=typeof Ge=="string"?Ge:`${Ge}ms`;X.style[D]=`${st}px`,X.style.transitionTimingFunction=qe,b&&b(X,ve)}),re=Or(q,(X,ve)=>{X.style[D]="auto",x&&x(X,ve)}),fe=Or(q,X=>{X.style[D]=`${Y()}px`,y&&y(X)}),ae=Or(q,S),ue=Or(q,X=>{const ve=Y(),{duration:st,easing:Ge}=Ic({style:_,timeout:z,easing:f},{mode:"exit"});if(z==="auto"){const qe=H.transitions.getAutoHeightDuration(ve);X.style.transitionDuration=`${qe}ms`,L.current=qe}else X.style.transitionDuration=typeof st=="string"?st:`${st}ms`;X.style[D]=O,X.style.transitionTimingFunction=Ge,j&&j(X)}),se=X=>{z==="auto"&&P.start(L.current||0,X),o&&o(q.current,X)},J={slots:M,slotProps:R,component:d},[ce,oe]=jt("root",{ref:K,className:Ye(B.root,l),elementType:GU,externalForwardedProps:J,ownerState:I,additionalProps:{style:{[W?"minWidth":"minHeight"]:O,..._}}}),[ge,de]=jt("wrapper",{ref:k,className:B.wrapper,elementType:YU,externalForwardedProps:J,ownerState:I}),[le,ee]=jt("wrapperInner",{className:B.wrapperInner,elementType:KU,externalForwardedProps:J,ownerState:I});return r.jsx(F,{in:p,onEnter:ie,onEntered:re,onEntering:V,onExit:fe,onExited:ae,onExiting:ue,addEndListener:se,nodeRef:q,timeout:z==="auto"?null:z,...N,children:(X,{ownerState:ve,...st})=>{const Ge={...I,state:X};return r.jsx(ce,{...oe,className:Ye(oe.className,{entered:B.entered,exited:!p&&O==="0px"&&B.hidden}[X]),ownerState:Ge,...st,children:r.jsx(ge,{...de,ownerState:Ge,children:r.jsx(le,{...ee,ownerState:Ge,children:a})})})}})});Al&&(Al.muiSupportAuto=!0);function XU(e){return gt("MuiPaper",e)}mt("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const ZU=e=>{const{square:t,elevation:n,variant:s,classes:o}=e,a={root:["root",s,!t&&"rounded",s==="elevation"&&`elevation${n}`]};return pt(a,XU,o)},QU=Me("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(St(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:t})=>!t.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),Je=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiPaper"}),o=On(),{className:a,component:l="div",elevation:u=1,square:d=!1,variant:f="elevation",...p}=s,g={...s,component:l,elevation:u,square:d,variant:f},x=ZU(g);return r.jsx(QU,{as:l,ownerState:g,className:Ye(x.root,a),ref:n,...p,style:{...f==="elevation"&&{"--Paper-shadow":(o.vars||o).shadows[u],...o.vars&&{"--Paper-overlay":o.vars.overlays?.[u]},...!o.vars&&o.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${In("#fff",pS(u))}, ${In("#fff",pS(u))})`}},...p.style}})}),CR=v.createContext({});function JU(e){return gt("MuiAccordion",e)}const Hx=mt("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),eq=e=>{const{classes:t,square:n,expanded:s,disabled:o,disableGutters:a}=e;return pt({root:["root",!n&&"rounded",s&&"expanded",o&&"disabled",!a&&"gutters"],heading:["heading"],region:["region"]},JU,t)},tq=Me(Je,{name:"MuiAccordion",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Hx.region}`]:t.region},t.root,!n.square&&t.rounded,!n.disableGutters&&t.gutters]}})(St(({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{position:"relative",transition:e.transitions.create(["margin"],t),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(e.vars||e).palette.divider,transition:e.transitions.create(["opacity","background-color"],t)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${Hx.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${Hx.disabled}`]:{backgroundColor:(e.vars||e).palette.action.disabledBackground}}}),St(({theme:e})=>({variants:[{props:t=>!t.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(e.vars||e).shape.borderRadius,borderBottomRightRadius:(e.vars||e).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:t=>!t.disableGutters,style:{[`&.${Hx.expanded}`]:{margin:"16px 0"}}}]}))),nq=Me("h3",{name:"MuiAccordion",slot:"Heading"})({all:"unset"}),rq=Me("div",{name:"MuiAccordion",slot:"Region"})({}),Fu=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiAccordion"}),{children:o,className:a,defaultExpanded:l=!1,disabled:u=!1,disableGutters:d=!1,expanded:f,onChange:p,slots:g={},slotProps:x={},TransitionComponent:b,TransitionProps:y,...S}=s,[j,A]=la({controlled:f,default:l,name:"Accordion",state:"expanded"}),M=v.useCallback(Y=>{A(!j),p&&p(Y,!j)},[j,p,A]),[R,..._]=v.Children.toArray(o),z=v.useMemo(()=>({expanded:j,disabled:u,disableGutters:d,toggle:M}),[j,u,d,M]),F={...s,disabled:u,disableGutters:d,expanded:j},N=eq(F),I={transition:b,...g},B={transition:y,...x},H={slots:I,slotProps:B},[P,k]=jt("root",{elementType:tq,externalForwardedProps:{...H,...S},className:Ye(N.root,a),shouldForwardComponentProp:!0,ownerState:F,ref:n}),[L,O]=jt("heading",{elementType:nq,externalForwardedProps:H,className:N.heading,ownerState:F}),[W,D]=jt("transition",{elementType:Al,externalForwardedProps:H,ownerState:F}),[q,K]=jt("region",{elementType:rq,externalForwardedProps:H,ownerState:F,className:N.region,additionalProps:{"aria-labelledby":R.props.id,id:R.props["aria-controls"],role:"region"}});return r.jsxs(P,{...k,children:[r.jsx(L,{...O,children:r.jsx(CR.Provider,{value:z,children:R})}),r.jsx(W,{in:j,timeout:"auto",...D,children:r.jsx(q,{...K,children:_})})]})});function sq(e){return gt("MuiAccordionDetails",e)}mt("MuiAccordionDetails",["root"]);const oq=e=>{const{classes:t}=e;return pt({root:["root"]},sq,t)},iq=Me("div",{name:"MuiAccordionDetails",slot:"Root"})(St(({theme:e})=>({padding:e.spacing(1,2,2)}))),_u=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiAccordionDetails"}),{className:o,...a}=s,l=s,u=oq(l);return r.jsx(iq,{className:Ye(u.root,o),ref:n,ownerState:l,...a})});function Na(e){try{return e.matches(":focus-visible")}catch{}return!1}class n1{static create(){return new n1}static use(){const t=fb(n1.create).current,[n,s]=v.useState(!1);return t.shouldMount=n,t.setShouldMount=s,v.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=lq(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...t){this.mount().then(()=>this.ref.current?.start(...t))}stop(...t){this.mount().then(()=>this.ref.current?.stop(...t))}pulsate(...t){this.mount().then(()=>this.ref.current?.pulsate(...t))}}function aq(){return n1.use()}function lq(){let e,t;const n=new Promise((s,o)=>{e=s,t=o});return n.resolve=e,n.reject=t,n}function cq(e){const{className:t,classes:n,pulsate:s=!1,rippleX:o,rippleY:a,rippleSize:l,in:u,onExited:d,timeout:f}=e,[p,g]=v.useState(!1),x=Ye(t,n.ripple,n.rippleVisible,s&&n.ripplePulsate),b={width:l,height:l,top:-(l/2)+a,left:-(l/2)+o},y=Ye(n.child,p&&n.childLeaving,s&&n.childPulsate);return!u&&!p&&g(!0),v.useEffect(()=>{if(!u&&d!=null){const S=setTimeout(d,f);return()=>{clearTimeout(S)}}},[d,u,f]),r.jsx("span",{className:x,style:b,children:r.jsx("span",{className:y})})}const bi=mt("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),vS=550,uq=80,dq=Va` 0% { transform: scale(0); opacity: 0.1; } 100% { transform: scale(1); opacity: 0.3; } `,fq=Va` 0% { opacity: 1; } 100% { opacity: 0; } `,hq=Va` 0% { transform: scale(1); } 50% { transform: scale(0.92); } 100% { transform: scale(1); } `,pq=Me("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),gq=Me(cq,{name:"MuiTouchRipple",slot:"Ripple"})` opacity: 0; position: absolute; &.${bi.rippleVisible} { opacity: 0.3; transform: scale(1); animation-name: ${dq}; animation-duration: ${vS}ms; animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; } &.${bi.ripplePulsate} { animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms; } & .${bi.child} { opacity: 1; display: block; width: 100%; height: 100%; border-radius: 50%; background-color: currentColor; } & .${bi.childLeaving} { opacity: 0; animation-name: ${fq}; animation-duration: ${vS}ms; animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; } & .${bi.childPulsate} { position: absolute; /* @noflip */ left: 0px; top: 0; animation-name: ${hq}; animation-duration: 2500ms; animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; animation-iteration-count: infinite; animation-delay: 200ms; } `,mq=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:a={},className:l,...u}=s,[d,f]=v.useState([]),p=v.useRef(0),g=v.useRef(null);v.useEffect(()=>{g.current&&(g.current(),g.current=null)},[d]);const x=v.useRef(!1),b=wc(),y=v.useRef(null),S=v.useRef(null),j=v.useCallback(_=>{const{pulsate:z,rippleX:F,rippleY:N,rippleSize:I,cb:B}=_;f(H=>[...H,r.jsx(gq,{classes:{ripple:Ye(a.ripple,bi.ripple),rippleVisible:Ye(a.rippleVisible,bi.rippleVisible),ripplePulsate:Ye(a.ripplePulsate,bi.ripplePulsate),child:Ye(a.child,bi.child),childLeaving:Ye(a.childLeaving,bi.childLeaving),childPulsate:Ye(a.childPulsate,bi.childPulsate)},timeout:vS,pulsate:z,rippleX:F,rippleY:N,rippleSize:I},p.current)]),p.current+=1,g.current=B},[a]),A=v.useCallback((_={},z={},F=()=>{})=>{const{pulsate:N=!1,center:I=o||z.pulsate,fakeElement:B=!1}=z;if(_?.type==="mousedown"&&x.current){x.current=!1;return}_?.type==="touchstart"&&(x.current=!0);const H=B?null:S.current,P=H?H.getBoundingClientRect():{width:0,height:0,left:0,top:0};let k,L,O;if(I||_===void 0||_.clientX===0&&_.clientY===0||!_.clientX&&!_.touches)k=Math.round(P.width/2),L=Math.round(P.height/2);else{const{clientX:W,clientY:D}=_.touches&&_.touches.length>0?_.touches[0]:_;k=Math.round(W-P.left),L=Math.round(D-P.top)}if(I)O=Math.sqrt((2*P.width**2+P.height**2)/3),O%2===0&&(O+=1);else{const W=Math.max(Math.abs((H?H.clientWidth:0)-k),k)*2+2,D=Math.max(Math.abs((H?H.clientHeight:0)-L),L)*2+2;O=Math.sqrt(W**2+D**2)}_?.touches?y.current===null&&(y.current=()=>{j({pulsate:N,rippleX:k,rippleY:L,rippleSize:O,cb:F})},b.start(uq,()=>{y.current&&(y.current(),y.current=null)})):j({pulsate:N,rippleX:k,rippleY:L,rippleSize:O,cb:F})},[o,j,b]),M=v.useCallback(()=>{A({},{pulsate:!0})},[A]),R=v.useCallback((_,z)=>{if(b.clear(),_?.type==="touchend"&&y.current){y.current(),y.current=null,b.start(0,()=>{R(_,z)});return}y.current=null,f(F=>F.length>0?F.slice(1):F),g.current=z},[b]);return v.useImperativeHandle(n,()=>({pulsate:M,start:A,stop:R}),[M,A,R]),r.jsx(pq,{className:Ye(bi.root,a.root,l),ref:S,...u,children:r.jsx(oC,{component:null,exit:!0,children:d})})});function xq(e){return gt("MuiButtonBase",e)}const bq=mt("MuiButtonBase",["root","disabled","focusVisible"]),yq=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:s,classes:o}=e,l=pt({root:["root",t&&"disabled",n&&"focusVisible"]},xq,o);return n&&s&&(l.root+=` ${s}`),l},vq=Me("button",{name:"MuiButtonBase",slot:"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"},[`&.${bq.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Li=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:a=!1,children:l,className:u,component:d="button",disabled:f=!1,disableRipple:p=!1,disableTouchRipple:g=!1,focusRipple:x=!1,focusVisibleClassName:b,LinkComponent:y="a",onBlur:S,onClick:j,onContextMenu:A,onDragLeave:M,onFocus:R,onFocusVisible:_,onKeyDown:z,onKeyUp:F,onMouseDown:N,onMouseLeave:I,onMouseUp:B,onTouchEnd:H,onTouchMove:P,onTouchStart:k,tabIndex:L=0,TouchRippleProps:O,touchRippleRef:W,type:D,...q}=s,K=v.useRef(null),Y=aq(),ie=vr(Y.ref,W),[V,re]=v.useState(!1);f&&V&&re(!1),v.useImperativeHandle(o,()=>({focusVisible:()=>{re(!0),K.current.focus()}}),[]);const fe=Y.shouldMount&&!p&&!f;v.useEffect(()=>{V&&x&&!p&&Y.pulsate()},[p,x,V,Y]);const ae=gl(Y,"start",N,g),ue=gl(Y,"stop",A,g),se=gl(Y,"stop",M,g),J=gl(Y,"stop",B,g),ce=gl(Y,"stop",Se=>{V&&Se.preventDefault(),I&&I(Se)},g),oe=gl(Y,"start",k,g),ge=gl(Y,"stop",H,g),de=gl(Y,"stop",P,g),le=gl(Y,"stop",Se=>{Na(Se.target)||re(!1),S&&S(Se)},!1),ee=pn(Se=>{K.current||(K.current=Se.currentTarget),Na(Se.target)&&(re(!0),_&&_(Se)),R&&R(Se)}),X=()=>{const Se=K.current;return Se?Se.tagName==="BUTTON"?!1:!(Se.tagName==="A"&&Se.href):d&&d!=="button"},ve=pn(Se=>{x&&!Se.repeat&&V&&Se.key===" "&&Y.stop(Se,()=>{Y.start(Se)}),Se.target===Se.currentTarget&&X()&&Se.key===" "&&Se.preventDefault(),z&&z(Se),Se.target===Se.currentTarget&&X()&&Se.key==="Enter"&&!f&&(Se.preventDefault(),j&&j(Se))}),st=pn(Se=>{x&&Se.key===" "&&V&&!Se.defaultPrevented&&Y.stop(Se,()=>{Y.pulsate(Se)}),F&&F(Se),j&&Se.target===Se.currentTarget&&X()&&Se.key===" "&&!Se.defaultPrevented&&!f&&j(Se)});let Ge=d;Ge==="button"&&(q.href||q.to)&&(Ge=y);const qe={};if(Ge==="button"){const Se=!!q.formAction;qe.type=D===void 0&&!Se?"button":D,qe.disabled=f}else!q.href&&!q.to&&(qe.role="button"),f&&(qe["aria-disabled"]=f);const Be=vr(n,K),Te={...s,centerRipple:a,component:d,disabled:f,disableRipple:p,disableTouchRipple:g,focusRipple:x,tabIndex:L,focusVisible:V},Re=yq(Te);return r.jsxs(vq,{as:Ge,className:Ye(Re.root,u),ownerState:Te,onBlur:le,onClick:j,onContextMenu:ue,onFocus:ee,onKeyDown:ve,onKeyUp:st,onMouseDown:ae,onMouseLeave:ce,onMouseUp:J,onDragLeave:se,onTouchEnd:ge,onTouchMove:de,onTouchStart:oe,ref:Be,tabIndex:f?-1:L,type:D,...qe,...q,children:[l,fe?r.jsx(mq,{ref:ie,center:a,...O}):null]})});function gl(e,t,n,s=!1){return pn(o=>(n&&n(o),s||e[t](o),!0))}function Sq(e){return gt("MuiAccordionSummary",e)}const mf=mt("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),jq=e=>{const{classes:t,expanded:n,disabled:s,disableGutters:o}=e;return pt({root:["root",n&&"expanded",s&&"disabled",!o&&"gutters"],focusVisible:["focusVisible"],content:["content",n&&"expanded",!o&&"contentGutters"],expandIconWrapper:["expandIconWrapper",n&&"expanded"]},Sq,t)},Cq=Me(Li,{name:"MuiAccordionSummary",slot:"Root"})(St(({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{display:"flex",width:"100%",minHeight:48,padding:e.spacing(0,2),transition:e.transitions.create(["min-height","background-color"],t),[`&.${mf.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${mf.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`&:hover:not(.${mf.disabled})`]:{cursor:"pointer"},variants:[{props:n=>!n.disableGutters,style:{[`&.${mf.expanded}`]:{minHeight:64}}}]}})),wq=Me("span",{name:"MuiAccordionSummary",slot:"Content"})(St(({theme:e})=>({display:"flex",textAlign:"start",flexGrow:1,margin:"12px 0",variants:[{props:t=>!t.disableGutters,style:{transition:e.transitions.create(["margin"],{duration:e.transitions.duration.shortest}),[`&.${mf.expanded}`]:{margin:"20px 0"}}}]}))),Aq=Me("span",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper"})(St(({theme:e})=>({display:"flex",color:(e.vars||e).palette.action.active,transform:"rotate(0deg)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest}),[`&.${mf.expanded}`]:{transform:"rotate(180deg)"}}))),Lu=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiAccordionSummary"}),{children:o,className:a,expandIcon:l,focusVisibleClassName:u,onClick:d,slots:f,slotProps:p,...g}=s,{disabled:x=!1,disableGutters:b,expanded:y,toggle:S}=v.useContext(CR),j=H=>{S&&S(H),d&&d(H)},A={...s,expanded:y,disabled:x,disableGutters:b},M=jq(A),R={slots:f,slotProps:p},[_,z]=jt("root",{ref:n,shouldForwardComponentProp:!0,className:Ye(M.root,a),elementType:Cq,externalForwardedProps:{...R,...g},ownerState:A,additionalProps:{focusRipple:!1,disableRipple:!0,disabled:x,"aria-expanded":y,focusVisibleClassName:Ye(M.focusVisible,u)},getSlotProps:H=>({...H,onClick:P=>{H.onClick?.(P),j(P)}})}),[F,N]=jt("content",{className:M.content,elementType:wq,externalForwardedProps:R,ownerState:A}),[I,B]=jt("expandIconWrapper",{className:M.expandIconWrapper,elementType:Aq,externalForwardedProps:R,ownerState:A});return r.jsxs(_,{...z,children:[r.jsx(F,{...N,children:o}),l&&r.jsx(I,{...B,children:l})]})});function Eq(e){return typeof e.main=="string"}function Tq(e,t=[]){if(!Eq(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function er(e=[]){return([,t])=>t&&Tq(t,e)}function kq(e){return gt("MuiAlert",e)}const QT=mt("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function Mq(e){return gt("MuiCircularProgress",e)}mt("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","track","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const Qi=44,SS=Va` 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } `,jS=Va` 0% { stroke-dasharray: 1px, 200px; stroke-dashoffset: 0; } 50% { stroke-dasharray: 100px, 200px; stroke-dashoffset: -15px; } 100% { stroke-dasharray: 1px, 200px; stroke-dashoffset: -126px; } `,Rq=typeof SS!="string"?Oc` animation: ${SS} 1.4s linear infinite; `:null,zq=typeof jS!="string"?Oc` animation: ${jS} 1.4s ease-in-out infinite; `:null,Iq=e=>{const{classes:t,variant:n,color:s,disableShrink:o}=e,a={root:["root",n,`color${Le(s)}`],svg:["svg"],track:["track"],circle:["circle",`circle${Le(n)}`,o&&"circleDisableShrink"]};return pt(a,Mq,t)},Fq=Me("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${Le(n.color)}`]]}})(St(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:Rq||{animation:`${SS} 1.4s linear infinite`}},...Object.entries(e.palette).filter(er()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),_q=Me("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),Lq=Me("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Le(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(St(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:zq||{animation:`${jS} 1.4s ease-in-out infinite`}}]}))),Pq=Me("circle",{name:"MuiCircularProgress",slot:"Track"})(St(({theme:e})=>({stroke:"currentColor",opacity:(e.vars||e).palette.action.activatedOpacity}))),nn=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiCircularProgress"}),{className:o,color:a="primary",disableShrink:l=!1,enableTrackSlot:u=!1,size:d=40,style:f,thickness:p=3.6,value:g=0,variant:x="indeterminate",...b}=s,y={...s,color:a,disableShrink:l,size:d,thickness:p,value:g,variant:x,enableTrackSlot:u},S=Iq(y),j={},A={},M={};if(x==="determinate"){const R=2*Math.PI*((Qi-p)/2);j.strokeDasharray=R.toFixed(3),M["aria-valuenow"]=Math.round(g),j.strokeDashoffset=`${((100-g)/100*R).toFixed(3)}px`,A.transform="rotate(-90deg)"}return r.jsx(Fq,{className:Ye(S.root,o),style:{width:d,height:d,...A,...f},ownerState:y,ref:n,role:"progressbar",...M,...b,children:r.jsxs(_q,{className:S.svg,ownerState:y,viewBox:`${Qi/2} ${Qi/2} ${Qi} ${Qi}`,children:[u?r.jsx(Pq,{className:S.track,ownerState:y,cx:Qi,cy:Qi,r:(Qi-p)/2,fill:"none",strokeWidth:p,"aria-hidden":"true"}):null,r.jsx(Lq,{className:S.circle,style:j,ownerState:y,cx:Qi,cy:Qi,r:(Qi-p)/2,fill:"none",strokeWidth:p})]})})});function Dq(e){return gt("MuiIconButton",e)}const JT=mt("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),Oq=e=>{const{classes:t,disabled:n,color:s,edge:o,size:a,loading:l}=e,u={root:["root",l&&"loading",n&&"disabled",s!=="default"&&`color${Le(s)}`,o&&`edge${Le(o)}`,`size${Le(a)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return pt(u,Dq,t)},Bq=Me(Li,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${Le(n.color)}`],n.edge&&t[`edge${Le(n.edge)}`],t[`size${Le(n.size)}`]]}})(St(({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:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||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}}]})),St(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(er()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(er()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||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)}}],[`&.${JT.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${JT.loading}`]:{color:"transparent"}}))),Nq=Me("span",{name:"MuiIconButton",slot:"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"}}]})),Ve=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiIconButton"}),{edge:o=!1,children:a,className:l,color:u="default",disabled:d=!1,disableFocusRipple:f=!1,size:p="medium",id:g,loading:x=null,loadingIndicator:b,...y}=s,S=Hi(g),j=b??r.jsx(nn,{"aria-labelledby":S,color:"inherit",size:16}),A={...s,edge:o,color:u,disabled:d,disableFocusRipple:f,loading:x,loadingIndicator:j,size:p},M=Oq(A);return r.jsxs(Bq,{id:x?S:g,className:Ye(M.root,l),centerRipple:!0,focusRipple:!f,disabled:d||x,ref:n,...y,ownerState:A,children:[typeof x=="boolean"&&r.jsx("span",{className:M.loadingWrapper,style:{display:"contents"},children:r.jsx(Nq,{className:M.loadingIndicator,ownerState:A,children:x&&j})}),a]})}),$q=ze(r.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"})),Hq=ze(r.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"})),Wq=ze(r.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),Uq=ze(r.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"})),wR=ze(r.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),qq=e=>{const{variant:t,color:n,severity:s,classes:o}=e,a={root:["root",`color${Le(n||s)}`,`${t}${Le(n||s)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return pt(a,kq,o)},Vq=Me(Je,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${Le(n.color||n.severity)}`]]}})(St(({theme:e})=>{const t=e.palette.mode==="light"?e.darken:e.lighten,n=e.palette.mode==="light"?e.lighten:e.darken;return{...e.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(e.palette).filter(er(["light"])).map(([s])=>({props:{colorSeverity:s,variant:"standard"},style:{color:e.vars?e.vars.palette.Alert[`${s}Color`]:t(e.palette[s].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${s}StandardBg`]:n(e.palette[s].light,.9),[`& .${QT.icon}`]:e.vars?{color:e.vars.palette.Alert[`${s}IconColor`]}:{color:e.palette[s].main}}})),...Object.entries(e.palette).filter(er(["light"])).map(([s])=>({props:{colorSeverity:s,variant:"outlined"},style:{color:e.vars?e.vars.palette.Alert[`${s}Color`]:t(e.palette[s].light,.6),border:`1px solid ${(e.vars||e).palette[s].light}`,[`& .${QT.icon}`]:e.vars?{color:e.vars.palette.Alert[`${s}IconColor`]}:{color:e.palette[s].main}}})),...Object.entries(e.palette).filter(er(["dark"])).map(([s])=>({props:{colorSeverity:s,variant:"filled"},style:{fontWeight:e.typography.fontWeightMedium,...e.vars?{color:e.vars.palette.Alert[`${s}FilledColor`],backgroundColor:e.vars.palette.Alert[`${s}FilledBg`]}:{backgroundColor:e.palette.mode==="dark"?e.palette[s].dark:e.palette[s].main,color:e.palette.getContrastText(e.palette[s].main)}}}))]}})),Gq=Me("div",{name:"MuiAlert",slot:"Icon"})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Yq=Me("div",{name:"MuiAlert",slot:"Message"})({padding:"8px 0",minWidth:0,overflow:"auto"}),Kq=Me("div",{name:"MuiAlert",slot:"Action"})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),e6={success:r.jsx($q,{fontSize:"inherit"}),warning:r.jsx(Hq,{fontSize:"inherit"}),error:r.jsx(Wq,{fontSize:"inherit"}),info:r.jsx(Uq,{fontSize:"inherit"})},Wt=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiAlert"}),{action:o,children:a,className:l,closeText:u="Close",color:d,components:f={},componentsProps:p={},icon:g,iconMapping:x=e6,onClose:b,role:y="alert",severity:S="success",slotProps:j={},slots:A={},variant:M="standard",...R}=s,_={...s,color:d,severity:S,variant:M,colorSeverity:d||S},z=qq(_),F={slots:{closeButton:f.CloseButton,closeIcon:f.CloseIcon,...A},slotProps:{...p,...j}},[N,I]=jt("root",{ref:n,shouldForwardComponentProp:!0,className:Ye(z.root,l),elementType:Vq,externalForwardedProps:{...F,...R},ownerState:_,additionalProps:{role:y,elevation:0}}),[B,H]=jt("icon",{className:z.icon,elementType:Gq,externalForwardedProps:F,ownerState:_}),[P,k]=jt("message",{className:z.message,elementType:Yq,externalForwardedProps:F,ownerState:_}),[L,O]=jt("action",{className:z.action,elementType:Kq,externalForwardedProps:F,ownerState:_}),[W,D]=jt("closeButton",{elementType:Ve,externalForwardedProps:F,ownerState:_}),[q,K]=jt("closeIcon",{elementType:wR,externalForwardedProps:F,ownerState:_});return r.jsxs(N,{...I,children:[g!==!1?r.jsx(B,{...H,children:g||x[S]||e6[S]}):null,r.jsx(P,{...k,children:a}),o!=null?r.jsx(L,{...O,children:o}):null,o==null&&b?r.jsx(L,{...O,children:r.jsx(W,{size:"small","aria-label":u,title:u,color:"inherit",onClick:b,...D,children:r.jsx(q,{fontSize:"small",...K})})}):null]})});function Xq(e){return gt("MuiTypography",e)}const t6=mt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),Zq={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},Qq=wU(),Jq=e=>{const{align:t,gutterBottom:n,noWrap:s,paragraph:o,variant:a,classes:l}=e,u={root:["root",a,e.align!=="inherit"&&`align${Le(t)}`,n&&"gutterBottom",s&&"noWrap",o&&"paragraph"]};return pt(u,Xq,l)},eV=Me("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${Le(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(St(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([t,n])=>t!=="inherit"&&n&&typeof n=="object").map(([t,n])=>({props:{variant:t},style:n})),...Object.entries(e.palette).filter(er()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,t])=>typeof t=="string").map(([t])=>({props:{color:`text${Le(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:t})=>t.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:t})=>t.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:t})=>t.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:t})=>t.paragraph,style:{marginBottom:16}}]}))),n6={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},C=v.forwardRef(function(t,n){const{color:s,...o}=Tt({props:t,name:"MuiTypography"}),a=!Zq[s],l=Qq({...o,...a&&{color:s}}),{align:u="inherit",className:d,component:f,gutterBottom:p=!1,noWrap:g=!1,paragraph:x=!1,variant:b="body1",variantMapping:y=n6,...S}=l,j={...l,align:u,color:s,className:d,component:f,gutterBottom:p,noWrap:g,paragraph:x,variant:b,variantMapping:y},A=f||(x?"p":y[b]||n6[b])||"span",M=Jq(j);return r.jsx(eV,{as:A,ref:n,className:Ye(M.root,d),...S,ownerState:j,style:{...u!=="inherit"&&{"--Typography-textAlign":u},...S.style}})});function tV(e){return gt("MuiAlertTitle",e)}mt("MuiAlertTitle",["root"]);const nV=e=>{const{classes:t}=e;return pt({root:["root"]},tV,t)},rV=Me(C,{name:"MuiAlertTitle",slot:"Root"})(St(({theme:e})=>({fontWeight:e.typography.fontWeightMedium,marginTop:-2}))),sV=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiAlertTitle"}),{className:o,...a}=s,l=s,u=nV(l);return r.jsx(rV,{gutterBottom:!0,component:"div",ownerState:l,ref:n,className:Ye(u.root,o),...a})});function aC(e){const t=v.useRef({});return v.useEffect(()=>{t.current=e}),t.current}function r6({array1:e,array2:t,parser:n=s=>s}){return e&&t&&e.length===t.length&&e.every((s,o)=>n(s)===n(t[o]))}function s6(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function oV(e={}){const{ignoreAccents:t=!0,ignoreCase:n=!0,limit:s,matchFrom:o="any",stringify:a,trim:l=!1}=e;return(u,{inputValue:d,getOptionLabel:f})=>{let p=l?d.trim():d;n&&(p=p.toLowerCase()),t&&(p=s6(p));const g=p?u.filter(x=>{let b=(a||f)(x);return n&&(b=b.toLowerCase()),t&&(b=s6(b)),o==="start"?b.startsWith(p):b.includes(p)}):u;return typeof s=="number"?g.slice(0,s):g}}const iV=oV(),o6=5,aV=e=>e.current!==null&&e.current.parentElement?.contains(document.activeElement),i6=(e,t)=>e===t,lV=[];function a6(e,t,n,s){if(t||e==null||s)return"";const o=n(e);return typeof o=="string"?o:""}function cV(e){const{unstable_isActiveElementInListbox:t=aV,unstable_classNamePrefix:n="Mui",autoComplete:s=!1,autoHighlight:o=!1,autoSelect:a=!1,blurOnSelect:l=!1,clearOnBlur:u=!e.freeSolo,clearOnEscape:d=!1,componentName:f="useAutocomplete",defaultValue:p=e.multiple?lV:null,disableClearable:g=!1,disableCloseOnSelect:x=!1,disabled:b,disabledItemsFocusable:y=!1,disableListWrap:S=!1,filterOptions:j=iV,filterSelectedOptions:A=!1,freeSolo:M=!1,getOptionDisabled:R,getOptionKey:_,getOptionLabel:z=Oe=>Oe.label??Oe,groupBy:F,handleHomeEndKeys:N=!e.freeSolo,id:I,includeInputInList:B=!1,inputValue:H,isOptionEqualToValue:P=i6,multiple:k=!1,onChange:L,onClose:O,onHighlightChange:W,onInputChange:D,onOpen:q,open:K,openOnFocus:Y=!1,options:ie,readOnly:V=!1,renderValue:re,selectOnFocus:fe=!e.freeSolo,value:ae}=e,ue=Hi(I);let se=z;se=Oe=>{const _e=z(Oe);return typeof _e!="string"?String(_e):_e};const J=v.useRef(!1),ce=v.useRef(!0),oe=v.useRef(null),ge=v.useRef(null),de=v.useRef(!1),[le,ee]=v.useState(null),[X,ve]=v.useState(-1),st=o?0:-1,Ge=v.useRef(st),qe=v.useRef(a6(p??ae,k,se)).current,[Be,Te]=la({controlled:ae,default:p,name:f}),[Re,Se]=la({controlled:H,default:qe,name:f,state:"inputValue"}),[Ke,ot]=v.useState(!1),He=v.useCallback((Oe,_e,ft)=>{if(!(k?Be.length<_e.length:_e!==null)&&!u)return;const Qt=a6(_e,k,se,re);Re!==Qt&&(Se(Qt),D&&D(Oe,Qt,ft))},[se,Re,k,D,Se,u,Be,re]),[$e,Z]=la({controlled:K,default:!1,name:f,state:"open"}),[pe,Q]=v.useState(!0),me=!k&&Be!=null&&Re===se(Be),we=$e&&!V,et=v.useMemo(()=>k?Be:Be!=null?[Be]:[],[k,Be]),ht=v.useMemo(()=>P!==i6||et.length===0?null:new Set(et),[P,et]),ct=v.useCallback(Oe=>ht?ht.has(Oe):et.some(_e=>_e!=null&&P(Oe,_e)),[P,et,ht]),bt=we?j(ie.filter(Oe=>!(A&&ct(Oe))),{inputValue:me&&pe?"":Re,getOptionLabel:se}):[],wt=aC({filteredOptions:bt,value:Be,inputValue:Re});v.useEffect(()=>{const Oe=Be!==wt.value;Ke&&!Oe||M&&!Oe||He(null,Be,"reset")},[Be,He,Ke,wt.value,M]);const gn=$e&&bt.length>0&&!V,mn=pn(Oe=>{if(Oe===-1)oe.current.focus();else{const _e=re?"data-item-index":"data-tag-index";le.querySelector(`[${_e}="${Oe}"]`).focus()}});v.useEffect(()=>{k&&X>Be.length-1&&(ve(-1),mn(-1))},[Be,k,X,mn]);function ut(Oe,_e){if(!ge.current||Oe<0||Oe>=bt.length)return-1;let ft=Oe;for(;;){const Lt=ge.current.querySelector(`[data-option-index="${ft}"]`),Qt=y?!1:!Lt||Lt.disabled||Lt.getAttribute("aria-disabled")==="true";if(Lt&&Lt.hasAttribute("tabindex")&&!Qt)return ft;if(_e==="next"?ft=(ft+1)%bt.length:ft=(ft-1+bt.length)%bt.length,ft===Oe)return-1}}const _t=pn(({event:Oe,index:_e,reason:ft})=>{if(Ge.current=_e,_e===-1?oe.current.removeAttribute("aria-activedescendant"):oe.current.setAttribute("aria-activedescendant",`${ue}-option-${_e}`),W&&["mouse","keyboard","touch"].includes(ft)&&W(Oe,_e===-1?null:bt[_e],ft),!ge.current)return;const Lt=ge.current.querySelector(`[role="option"].${n}-focused`);Lt&&(Lt.classList.remove(`${n}-focused`),Lt.classList.remove(`${n}-focusVisible`));let Qt=ge.current;if(ge.current.getAttribute("role")!=="listbox"&&(Qt=ge.current.parentElement.querySelector('[role="listbox"]')),!Qt)return;if(_e===-1){Qt.scrollTop=0;return}const sn=ge.current.querySelector(`[data-option-index="${_e}"]`);if(sn&&(sn.classList.add(`${n}-focused`),ft==="keyboard"&&sn.classList.add(`${n}-focusVisible`),Qt.scrollHeight>Qt.clientHeight&&ft!=="mouse"&&ft!=="touch")){const on=sn,ir=Qt.clientHeight+Qt.scrollTop,$r=on.offsetTop+on.offsetHeight;$r>ir?Qt.scrollTop=$r-Qt.clientHeight:on.offsetTop-on.offsetHeight*(F?1.3:0)<Qt.scrollTop&&(Qt.scrollTop=on.offsetTop-on.offsetHeight*(F?1.3:0))}}),Yt=pn(({event:Oe,diff:_e,direction:ft="next",reason:Lt})=>{if(!we)return;const sn=ut((()=>{const on=bt.length-1;if(_e==="reset")return st;if(_e==="start")return 0;if(_e==="end")return on;const ir=Ge.current+_e;return ir<0?ir===-1&&B?-1:S&&Ge.current!==-1||Math.abs(_e)>1?0:on:ir>on?ir===on+1&&B?-1:S||Math.abs(_e)>1?on:0:ir})(),ft);if(_t({index:sn,reason:Lt,event:Oe}),s&&_e!=="reset")if(sn===-1)oe.current.value=Re;else{const on=se(bt[sn]);oe.current.value=on,on.toLowerCase().indexOf(Re.toLowerCase())===0&&Re.length>0&&oe.current.setSelectionRange(Re.length,on.length)}}),Xt=!r6({array1:wt.filteredOptions,array2:bt,parser:se}),ln=()=>{const Oe=(_e,ft)=>{const Lt=_e?se(_e):"",Qt=ft?se(ft):"";return Lt===Qt};if(Ge.current!==-1&&!r6({array1:wt.filteredOptions,array2:bt,parser:se})&&wt.inputValue===Re&&(k?Be.length===wt.value.length&&wt.value.every((_e,ft)=>se(Be[ft])===se(_e)):Oe(wt.value,Be))){const _e=wt.filteredOptions[Ge.current];if(_e)return bt.findIndex(ft=>se(ft)===se(_e))}return-1},pr=v.useCallback(()=>{if(!we)return;const Oe=ln();if(Oe!==-1){Ge.current=Oe;return}const _e=k?Be[0]:Be;if(bt.length===0||_e==null){Yt({diff:"reset"});return}if(ge.current){if(_e!=null){const ft=bt[Ge.current];if(k&&ft&&Be.findIndex(Qt=>P(ft,Qt))!==-1)return;const Lt=bt.findIndex(Qt=>P(Qt,_e));Lt===-1?Yt({diff:"reset"}):_t({index:Lt});return}if(Ge.current>=bt.length-1){_t({index:bt.length-1});return}_t({index:Ge.current})}},[bt.length,k?!1:Be,Yt,_t,we,Re,k]),nr=pn(Oe=>{xS(ge,Oe),Oe&&pr()});v.useEffect(()=>{(Xt||we&&!x)&&pr()},[pr,Xt,we,x]),v.useEffect(()=>{if(typeof window>"u")return;const Oe=()=>{de.current=!0};return window.addEventListener("blur",Oe),()=>{window.removeEventListener("blur",Oe)}},[]);const Bn=Oe=>{$e||(Z(!0),Q(!0),q&&q(Oe))},Ht=(Oe,_e)=>{$e&&(Z(!1),O&&O(Oe,_e))},rn=(Oe,_e,ft,Lt)=>{if(k){if(Be.length===_e.length&&Be.every((Qt,sn)=>Qt===_e[sn]))return}else if(Be===_e)return;L&&L(Oe,_e,ft,Lt),Te(_e)},yt=v.useRef(!1),Ft=(Oe,_e,ft="selectOption",Lt="options")=>{let Qt=ft,sn=_e;if(k){sn=Array.isArray(Be)?Be.slice():[];const on=sn.findIndex(ir=>P(_e,ir));on===-1?sn.push(_e):Lt!=="freeSolo"&&(sn.splice(on,1),Qt="removeOption")}He(Oe,sn,Qt),rn(Oe,sn,Qt,{option:_e}),!x&&(!Oe||!Oe.ctrlKey&&!Oe.metaKey)&&Ht(Oe,Qt),(l===!0||l==="touch"&&yt.current||l==="mouse"&&!yt.current)&&oe.current.blur()};function un(Oe,_e){if(Oe===-1)return-1;let ft=Oe;for(;;){if(_e==="next"&&ft===Be.length||_e==="previous"&&ft===-1)return-1;const Lt=re?"data-item-index":"data-tag-index",Qt=le.querySelector(`[${Lt}="${ft}"]`);if(!Qt||!Qt.hasAttribute("tabindex")||Qt.disabled||Qt.getAttribute("aria-disabled")==="true")ft+=_e==="next"?1:-1;else return ft}}const an=(Oe,_e)=>{if(!k)return;Re===""&&Ht(Oe,"toggleInput");let ft=X;X===-1&&_e==="previous"?(ft=Be.length-1,M&&Re!==""&&(Se(""),D&&D(Oe,"","reset"))):(ft+=_e==="next"?1:-1,ft<0&&(ft=0),ft===Be.length&&(ft=-1)),ft=un(ft,_e),ve(ft),mn(ft)},he=Oe=>{J.current=!0,Se(""),D&&D(Oe,"","clear"),rn(Oe,k?[]:null,"clear")},Ee=Oe=>_e=>{if(Oe.onKeyDown&&Oe.onKeyDown(_e),!_e.defaultMuiPrevented&&(X!==-1&&!["ArrowLeft","ArrowRight"].includes(_e.key)&&(ve(-1),mn(-1)),_e.which!==229))switch(_e.key){case"Home":we&&N&&(_e.preventDefault(),Yt({diff:"start",direction:"next",reason:"keyboard",event:_e}));break;case"End":we&&N&&(_e.preventDefault(),Yt({diff:"end",direction:"previous",reason:"keyboard",event:_e}));break;case"PageUp":_e.preventDefault(),Yt({diff:-o6,direction:"previous",reason:"keyboard",event:_e}),Bn(_e);break;case"PageDown":_e.preventDefault(),Yt({diff:o6,direction:"next",reason:"keyboard",event:_e}),Bn(_e);break;case"ArrowDown":_e.preventDefault(),Yt({diff:1,direction:"next",reason:"keyboard",event:_e}),Bn(_e);break;case"ArrowUp":_e.preventDefault(),Yt({diff:-1,direction:"previous",reason:"keyboard",event:_e}),Bn(_e);break;case"ArrowLeft":{const ft=oe.current;if(!(ft&&ft.selectionStart===0&&ft.selectionEnd===0))return;!k&&re&&Be!=null?(M&&Re!==""&&(Se(""),D&&D(_e,"","reset")),ve(0),mn(0)):an(_e,"previous");break}case"ArrowRight":!k&&re?(ve(-1),mn(-1)):an(_e,"next");break;case"Enter":if(Ge.current!==-1&&we){const ft=bt[Ge.current],Lt=R?R(ft):!1;if(_e.preventDefault(),Lt)return;Ft(_e,ft,"selectOption"),s&&oe.current.setSelectionRange(oe.current.value.length,oe.current.value.length)}else M&&Re!==""&&me===!1&&(k&&_e.preventDefault(),Ft(_e,Re,"createOption","freeSolo"));break;case"Escape":we?(_e.preventDefault(),_e.stopPropagation(),Ht(_e,"escape")):d&&(Re!==""||k&&Be.length>0||re)&&(_e.preventDefault(),_e.stopPropagation(),he(_e));break;case"Backspace":if(k&&!V&&Re===""&&Be.length>0){const ft=X===-1?Be.length-1:X,Lt=Be.slice();Lt.splice(ft,1),rn(_e,Lt,"removeOption",{option:Be[ft]})}!k&&re&&!V&&Re===""&&rn(_e,null,"removeOption",{option:Be});break;case"Delete":if(k&&!V&&Re===""&&Be.length>0&&X!==-1){const ft=X,Lt=Be.slice();Lt.splice(ft,1),rn(_e,Lt,"removeOption",{option:Be[ft]})}!k&&re&&!V&&Re===""&&rn(_e,null,"removeOption",{option:Be});break}},Fe=Oe=>{if(ot(!0),X!==-1&&(ve(-1),mn(-1)),de.current){de.current=!1;return}Y&&!J.current&&Bn(Oe)},Xe=Oe=>{if(t(ge)){oe.current.focus();return}ot(!1),ce.current=!0,J.current=!1,a&&Ge.current!==-1&&we?Ft(Oe,bt[Ge.current],"blur"):a&&M&&Re!==""?Ft(Oe,Re,"blur","freeSolo"):u&&He(Oe,Be,"blur"),Ht(Oe,"blur")},dt=Oe=>{const _e=Oe.target.value;Re!==_e&&(Se(_e),Q(!1),D&&D(Oe,_e,"input")),_e===""?!g&&!k&&!re&&rn(Oe,null,"clear"):Bn(Oe)},At=Oe=>{const _e=Number(Oe.currentTarget.getAttribute("data-option-index"));Ge.current!==_e&&_t({event:Oe,index:_e,reason:"mouse"})},at=Oe=>{_t({event:Oe,index:Number(Oe.currentTarget.getAttribute("data-option-index")),reason:"touch"}),yt.current=!0},lt=Oe=>{const _e=Number(Oe.currentTarget.getAttribute("data-option-index"));Ft(Oe,bt[_e],"selectOption"),yt.current=!1},kt=Oe=>_e=>{const ft=Be.slice();ft.splice(Oe,1),rn(_e,ft,"removeOption",{option:Be[Oe]})},vt=Oe=>{rn(Oe,null,"removeOption",{option:Be})},Nt=Oe=>{$e?Ht(Oe,"toggleInput"):Bn(Oe)},Dt=Oe=>{Oe.currentTarget.contains(Oe.target)&&(le&&!le.contains(Oe.target)||Oe.target.getAttribute("id")!==ue&&Oe.preventDefault())},vn=Oe=>{Oe.currentTarget.contains(Oe.target)&&(le&&!le.contains(Oe.target)||(oe.current.focus(),fe&&ce.current&&oe.current.selectionEnd-oe.current.selectionStart===0&&oe.current.select(),ce.current=!1))},cn=Oe=>{!b&&(Re===""||!$e)&&Nt(Oe)};let An=M&&Re.length>0;An=An||(k?Be.length>0:Be!==null);let dn=bt;return F&&(dn=bt.reduce((Oe,_e,ft)=>{const Lt=F(_e);return Oe.length>0&&Oe[Oe.length-1].group===Lt?Oe[Oe.length-1].options.push(_e):Oe.push({key:ft,index:ft,group:Lt,options:[_e]}),Oe},[])),b&&Ke&&Xe(),{getRootProps:(Oe={})=>({...Oe,onKeyDown:Ee(Oe),onMouseDown:Dt,onClick:vn}),getInputLabelProps:()=>({id:`${ue}-label`,htmlFor:ue}),getInputProps:()=>({id:ue,value:Re,onBlur:Xe,onFocus:Fe,onChange:dt,onMouseDown:cn,"aria-activedescendant":we?"":null,"aria-autocomplete":s?"both":"list","aria-controls":gn?`${ue}-listbox`:void 0,"aria-expanded":gn,autoComplete:"off",ref:oe,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:b}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:he}),getItemProps:({index:Oe=0}={})=>({...k&&{key:Oe},...re?{"data-item-index":Oe}:{"data-tag-index":Oe},tabIndex:-1,...!V&&{onDelete:k?kt(Oe):vt}}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Nt}),getTagProps:({index:Oe})=>({key:Oe,"data-tag-index":Oe,tabIndex:-1,...!V&&{onDelete:kt(Oe)}}),getListboxProps:()=>({role:"listbox",id:`${ue}-listbox`,"aria-labelledby":`${ue}-label`,"aria-multiselectable":k||void 0,ref:nr,onMouseDown:Oe=>{Oe.preventDefault()}}),getOptionProps:({index:Oe,option:_e})=>{const ft=ct(_e),Lt=R?R(_e):!1;return{key:_?.(_e)??se(_e),tabIndex:-1,role:"option",id:`${ue}-option-${Oe}`,onMouseMove:At,onClick:lt,onTouchStart:at,"data-option-index":Oe,"aria-disabled":Lt,"aria-selected":ft}},id:ue,inputValue:Re,value:Be,dirty:An,expanded:we&&le,popupOpen:we,focused:Ke||X!==-1,anchorEl:le,setAnchorEl:ee,focusedItem:X,focusedTag:X,groupedOptions:dn}}var vo="top",Pi="bottom",Di="right",So="left",lC="auto",Gg=[vo,Pi,Di,So],Df="start",cg="end",uV="clippingParents",AR="viewport",op="popper",dV="reference",l6=Gg.reduce(function(e,t){return e.concat([t+"-"+Df,t+"-"+cg])},[]),ER=[].concat(Gg,[lC]).reduce(function(e,t){return e.concat([t,t+"-"+Df,t+"-"+cg])},[]),fV="beforeRead",hV="read",pV="afterRead",gV="beforeMain",mV="main",xV="afterMain",bV="beforeWrite",yV="write",vV="afterWrite",SV=[fV,hV,pV,gV,mV,xV,bV,yV,vV];function $a(e){return e?(e.nodeName||"").toLowerCase():null}function ei(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Pu(e){var t=ei(e).Element;return e instanceof t||e instanceof Element}function zi(e){var t=ei(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function cC(e){if(typeof ShadowRoot>"u")return!1;var t=ei(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function jV(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var s=t.styles[n]||{},o=t.attributes[n]||{},a=t.elements[n];!zi(a)||!$a(a)||(Object.assign(a.style,s),Object.keys(o).forEach(function(l){var u=o[l];u===!1?a.removeAttribute(l):a.setAttribute(l,u===!0?"":u)}))})}function CV(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(s){var o=t.elements[s],a=t.attributes[s]||{},l=Object.keys(t.styles.hasOwnProperty(s)?t.styles[s]:n[s]),u=l.reduce(function(d,f){return d[f]="",d},{});!zi(o)||!$a(o)||(Object.assign(o.style,u),Object.keys(a).forEach(function(d){o.removeAttribute(d)}))})}}const wV={name:"applyStyles",enabled:!0,phase:"write",fn:jV,effect:CV,requires:["computeStyles"]};function Pa(e){return e.split("-")[0]}var Eu=Math.max,r1=Math.min,Of=Math.round;function CS(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function TR(){return!/^((?!chrome|android).)*safari/i.test(CS())}function Bf(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var s=e.getBoundingClientRect(),o=1,a=1;t&&zi(e)&&(o=e.offsetWidth>0&&Of(s.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Of(s.height)/e.offsetHeight||1);var l=Pu(e)?ei(e):window,u=l.visualViewport,d=!TR()&&n,f=(s.left+(d&&u?u.offsetLeft:0))/o,p=(s.top+(d&&u?u.offsetTop:0))/a,g=s.width/o,x=s.height/a;return{width:g,height:x,top:p,right:f+g,bottom:p+x,left:f,x:f,y:p}}function uC(e){var t=Bf(e),n=e.offsetWidth,s=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:s}}function kR(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&cC(n)){var s=t;do{if(s&&e.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function El(e){return ei(e).getComputedStyle(e)}function AV(e){return["table","td","th"].indexOf($a(e))>=0}function Bc(e){return((Pu(e)?e.ownerDocument:e.document)||window.document).documentElement}function pb(e){return $a(e)==="html"?e:e.assignedSlot||e.parentNode||(cC(e)?e.host:null)||Bc(e)}function c6(e){return!zi(e)||El(e).position==="fixed"?null:e.offsetParent}function EV(e){var t=/firefox/i.test(CS()),n=/Trident/i.test(CS());if(n&&zi(e)){var s=El(e);if(s.position==="fixed")return null}var o=pb(e);for(cC(o)&&(o=o.host);zi(o)&&["html","body"].indexOf($a(o))<0;){var a=El(o);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return o;o=o.parentNode}return null}function Yg(e){for(var t=ei(e),n=c6(e);n&&AV(n)&&El(n).position==="static";)n=c6(n);return n&&($a(n)==="html"||$a(n)==="body"&&El(n).position==="static")?t:n||EV(e)||t}function dC(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function $p(e,t,n){return Eu(e,r1(t,n))}function TV(e,t,n){var s=$p(e,t,n);return s>n?n:s}function MR(){return{top:0,right:0,bottom:0,left:0}}function RR(e){return Object.assign({},MR(),e)}function zR(e,t){return t.reduce(function(n,s){return n[s]=e,n},{})}var kV=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,RR(typeof t!="number"?t:zR(t,Gg))};function MV(e){var t,n=e.state,s=e.name,o=e.options,a=n.elements.arrow,l=n.modifiersData.popperOffsets,u=Pa(n.placement),d=dC(u),f=[So,Di].indexOf(u)>=0,p=f?"height":"width";if(!(!a||!l)){var g=kV(o.padding,n),x=uC(a),b=d==="y"?vo:So,y=d==="y"?Pi:Di,S=n.rects.reference[p]+n.rects.reference[d]-l[d]-n.rects.popper[p],j=l[d]-n.rects.reference[d],A=Yg(a),M=A?d==="y"?A.clientHeight||0:A.clientWidth||0:0,R=S/2-j/2,_=g[b],z=M-x[p]-g[y],F=M/2-x[p]/2+R,N=$p(_,F,z),I=d;n.modifiersData[s]=(t={},t[I]=N,t.centerOffset=N-F,t)}}function RV(e){var t=e.state,n=e.options,s=n.element,o=s===void 0?"[data-popper-arrow]":s;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||kR(t.elements.popper,o)&&(t.elements.arrow=o))}const zV={name:"arrow",enabled:!0,phase:"main",fn:MV,effect:RV,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Nf(e){return e.split("-")[1]}var IV={top:"auto",right:"auto",bottom:"auto",left:"auto"};function FV(e,t){var n=e.x,s=e.y,o=t.devicePixelRatio||1;return{x:Of(n*o)/o||0,y:Of(s*o)/o||0}}function u6(e){var t,n=e.popper,s=e.popperRect,o=e.placement,a=e.variation,l=e.offsets,u=e.position,d=e.gpuAcceleration,f=e.adaptive,p=e.roundOffsets,g=e.isFixed,x=l.x,b=x===void 0?0:x,y=l.y,S=y===void 0?0:y,j=typeof p=="function"?p({x:b,y:S}):{x:b,y:S};b=j.x,S=j.y;var A=l.hasOwnProperty("x"),M=l.hasOwnProperty("y"),R=So,_=vo,z=window;if(f){var F=Yg(n),N="clientHeight",I="clientWidth";if(F===ei(n)&&(F=Bc(n),El(F).position!=="static"&&u==="absolute"&&(N="scrollHeight",I="scrollWidth")),F=F,o===vo||(o===So||o===Di)&&a===cg){_=Pi;var B=g&&F===z&&z.visualViewport?z.visualViewport.height:F[N];S-=B-s.height,S*=d?1:-1}if(o===So||(o===vo||o===Pi)&&a===cg){R=Di;var H=g&&F===z&&z.visualViewport?z.visualViewport.width:F[I];b-=H-s.width,b*=d?1:-1}}var P=Object.assign({position:u},f&&IV),k=p===!0?FV({x:b,y:S},ei(n)):{x:b,y:S};if(b=k.x,S=k.y,d){var L;return Object.assign({},P,(L={},L[_]=M?"0":"",L[R]=A?"0":"",L.transform=(z.devicePixelRatio||1)<=1?"translate("+b+"px, "+S+"px)":"translate3d("+b+"px, "+S+"px, 0)",L))}return Object.assign({},P,(t={},t[_]=M?S+"px":"",t[R]=A?b+"px":"",t.transform="",t))}function _V(e){var t=e.state,n=e.options,s=n.gpuAcceleration,o=s===void 0?!0:s,a=n.adaptive,l=a===void 0?!0:a,u=n.roundOffsets,d=u===void 0?!0:u,f={placement:Pa(t.placement),variation:Nf(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,u6(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:d})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,u6(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:d})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const LV={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:_V,data:{}};var Wx={passive:!0};function PV(e){var t=e.state,n=e.instance,s=e.options,o=s.scroll,a=o===void 0?!0:o,l=s.resize,u=l===void 0?!0:l,d=ei(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&f.forEach(function(p){p.addEventListener("scroll",n.update,Wx)}),u&&d.addEventListener("resize",n.update,Wx),function(){a&&f.forEach(function(p){p.removeEventListener("scroll",n.update,Wx)}),u&&d.removeEventListener("resize",n.update,Wx)}}const DV={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:PV,data:{}};var OV={left:"right",right:"left",bottom:"top",top:"bottom"};function $0(e){return e.replace(/left|right|bottom|top/g,function(t){return OV[t]})}var BV={start:"end",end:"start"};function d6(e){return e.replace(/start|end/g,function(t){return BV[t]})}function fC(e){var t=ei(e),n=t.pageXOffset,s=t.pageYOffset;return{scrollLeft:n,scrollTop:s}}function hC(e){return Bf(Bc(e)).left+fC(e).scrollLeft}function NV(e,t){var n=ei(e),s=Bc(e),o=n.visualViewport,a=s.clientWidth,l=s.clientHeight,u=0,d=0;if(o){a=o.width,l=o.height;var f=TR();(f||!f&&t==="fixed")&&(u=o.offsetLeft,d=o.offsetTop)}return{width:a,height:l,x:u+hC(e),y:d}}function $V(e){var t,n=Bc(e),s=fC(e),o=(t=e.ownerDocument)==null?void 0:t.body,a=Eu(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),l=Eu(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),u=-s.scrollLeft+hC(e),d=-s.scrollTop;return El(o||n).direction==="rtl"&&(u+=Eu(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:l,x:u,y:d}}function pC(e){var t=El(e),n=t.overflow,s=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+s)}function IR(e){return["html","body","#document"].indexOf($a(e))>=0?e.ownerDocument.body:zi(e)&&pC(e)?e:IR(pb(e))}function Hp(e,t){var n;t===void 0&&(t=[]);var s=IR(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),a=ei(s),l=o?[a].concat(a.visualViewport||[],pC(s)?s:[]):s,u=t.concat(l);return o?u:u.concat(Hp(pb(l)))}function wS(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function HV(e,t){var n=Bf(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function f6(e,t,n){return t===AR?wS(NV(e,n)):Pu(t)?HV(t,n):wS($V(Bc(e)))}function WV(e){var t=Hp(pb(e)),n=["absolute","fixed"].indexOf(El(e).position)>=0,s=n&&zi(e)?Yg(e):e;return Pu(s)?t.filter(function(o){return Pu(o)&&kR(o,s)&&$a(o)!=="body"}):[]}function UV(e,t,n,s){var o=t==="clippingParents"?WV(e):[].concat(t),a=[].concat(o,[n]),l=a[0],u=a.reduce(function(d,f){var p=f6(e,f,s);return d.top=Eu(p.top,d.top),d.right=r1(p.right,d.right),d.bottom=r1(p.bottom,d.bottom),d.left=Eu(p.left,d.left),d},f6(e,l,s));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function FR(e){var t=e.reference,n=e.element,s=e.placement,o=s?Pa(s):null,a=s?Nf(s):null,l=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,d;switch(o){case vo:d={x:l,y:t.y-n.height};break;case Pi:d={x:l,y:t.y+t.height};break;case Di:d={x:t.x+t.width,y:u};break;case So:d={x:t.x-n.width,y:u};break;default:d={x:t.x,y:t.y}}var f=o?dC(o):null;if(f!=null){var p=f==="y"?"height":"width";switch(a){case Df:d[f]=d[f]-(t[p]/2-n[p]/2);break;case cg:d[f]=d[f]+(t[p]/2-n[p]/2);break}}return d}function ug(e,t){t===void 0&&(t={});var n=t,s=n.placement,o=s===void 0?e.placement:s,a=n.strategy,l=a===void 0?e.strategy:a,u=n.boundary,d=u===void 0?uV:u,f=n.rootBoundary,p=f===void 0?AR:f,g=n.elementContext,x=g===void 0?op:g,b=n.altBoundary,y=b===void 0?!1:b,S=n.padding,j=S===void 0?0:S,A=RR(typeof j!="number"?j:zR(j,Gg)),M=x===op?dV:op,R=e.rects.popper,_=e.elements[y?M:x],z=UV(Pu(_)?_:_.contextElement||Bc(e.elements.popper),d,p,l),F=Bf(e.elements.reference),N=FR({reference:F,element:R,placement:o}),I=wS(Object.assign({},R,N)),B=x===op?I:F,H={top:z.top-B.top+A.top,bottom:B.bottom-z.bottom+A.bottom,left:z.left-B.left+A.left,right:B.right-z.right+A.right},P=e.modifiersData.offset;if(x===op&&P){var k=P[o];Object.keys(H).forEach(function(L){var O=[Di,Pi].indexOf(L)>=0?1:-1,W=[vo,Pi].indexOf(L)>=0?"y":"x";H[L]+=k[W]*O})}return H}function qV(e,t){t===void 0&&(t={});var n=t,s=n.placement,o=n.boundary,a=n.rootBoundary,l=n.padding,u=n.flipVariations,d=n.allowedAutoPlacements,f=d===void 0?ER:d,p=Nf(s),g=p?u?l6:l6.filter(function(y){return Nf(y)===p}):Gg,x=g.filter(function(y){return f.indexOf(y)>=0});x.length===0&&(x=g);var b=x.reduce(function(y,S){return y[S]=ug(e,{placement:S,boundary:o,rootBoundary:a,padding:l})[Pa(S)],y},{});return Object.keys(b).sort(function(y,S){return b[y]-b[S]})}function VV(e){if(Pa(e)===lC)return[];var t=$0(e);return[d6(e),t,d6(t)]}function GV(e){var t=e.state,n=e.options,s=e.name;if(!t.modifiersData[s]._skip){for(var o=n.mainAxis,a=o===void 0?!0:o,l=n.altAxis,u=l===void 0?!0:l,d=n.fallbackPlacements,f=n.padding,p=n.boundary,g=n.rootBoundary,x=n.altBoundary,b=n.flipVariations,y=b===void 0?!0:b,S=n.allowedAutoPlacements,j=t.options.placement,A=Pa(j),M=A===j,R=d||(M||!y?[$0(j)]:VV(j)),_=[j].concat(R).reduce(function(ae,ue){return ae.concat(Pa(ue)===lC?qV(t,{placement:ue,boundary:p,rootBoundary:g,padding:f,flipVariations:y,allowedAutoPlacements:S}):ue)},[]),z=t.rects.reference,F=t.rects.popper,N=new Map,I=!0,B=_[0],H=0;H<_.length;H++){var P=_[H],k=Pa(P),L=Nf(P)===Df,O=[vo,Pi].indexOf(k)>=0,W=O?"width":"height",D=ug(t,{placement:P,boundary:p,rootBoundary:g,altBoundary:x,padding:f}),q=O?L?Di:So:L?Pi:vo;z[W]>F[W]&&(q=$0(q));var K=$0(q),Y=[];if(a&&Y.push(D[k]<=0),u&&Y.push(D[q]<=0,D[K]<=0),Y.every(function(ae){return ae})){B=P,I=!1;break}N.set(P,Y)}if(I)for(var ie=y?3:1,V=function(ue){var se=_.find(function(J){var ce=N.get(J);if(ce)return ce.slice(0,ue).every(function(oe){return oe})});if(se)return B=se,"break"},re=ie;re>0;re--){var fe=V(re);if(fe==="break")break}t.placement!==B&&(t.modifiersData[s]._skip=!0,t.placement=B,t.reset=!0)}}const YV={name:"flip",enabled:!0,phase:"main",fn:GV,requiresIfExists:["offset"],data:{_skip:!1}};function h6(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function p6(e){return[vo,Di,Pi,So].some(function(t){return e[t]>=0})}function KV(e){var t=e.state,n=e.name,s=t.rects.reference,o=t.rects.popper,a=t.modifiersData.preventOverflow,l=ug(t,{elementContext:"reference"}),u=ug(t,{altBoundary:!0}),d=h6(l,s),f=h6(u,o,a),p=p6(d),g=p6(f);t.modifiersData[n]={referenceClippingOffsets:d,popperEscapeOffsets:f,isReferenceHidden:p,hasPopperEscaped:g},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":g})}const XV={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:KV};function ZV(e,t,n){var s=Pa(e),o=[So,vo].indexOf(s)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,l=a[0],u=a[1];return l=l||0,u=(u||0)*o,[So,Di].indexOf(s)>=0?{x:u,y:l}:{x:l,y:u}}function QV(e){var t=e.state,n=e.options,s=e.name,o=n.offset,a=o===void 0?[0,0]:o,l=ER.reduce(function(p,g){return p[g]=ZV(g,t.rects,a),p},{}),u=l[t.placement],d=u.x,f=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=d,t.modifiersData.popperOffsets.y+=f),t.modifiersData[s]=l}const JV={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:QV};function eG(e){var t=e.state,n=e.name;t.modifiersData[n]=FR({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const tG={name:"popperOffsets",enabled:!0,phase:"read",fn:eG,data:{}};function nG(e){return e==="x"?"y":"x"}function rG(e){var t=e.state,n=e.options,s=e.name,o=n.mainAxis,a=o===void 0?!0:o,l=n.altAxis,u=l===void 0?!1:l,d=n.boundary,f=n.rootBoundary,p=n.altBoundary,g=n.padding,x=n.tether,b=x===void 0?!0:x,y=n.tetherOffset,S=y===void 0?0:y,j=ug(t,{boundary:d,rootBoundary:f,padding:g,altBoundary:p}),A=Pa(t.placement),M=Nf(t.placement),R=!M,_=dC(A),z=nG(_),F=t.modifiersData.popperOffsets,N=t.rects.reference,I=t.rects.popper,B=typeof S=="function"?S(Object.assign({},t.rects,{placement:t.placement})):S,H=typeof B=="number"?{mainAxis:B,altAxis:B}:Object.assign({mainAxis:0,altAxis:0},B),P=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(F){if(a){var L,O=_==="y"?vo:So,W=_==="y"?Pi:Di,D=_==="y"?"height":"width",q=F[_],K=q+j[O],Y=q-j[W],ie=b?-I[D]/2:0,V=M===Df?N[D]:I[D],re=M===Df?-I[D]:-N[D],fe=t.elements.arrow,ae=b&&fe?uC(fe):{width:0,height:0},ue=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:MR(),se=ue[O],J=ue[W],ce=$p(0,N[D],ae[D]),oe=R?N[D]/2-ie-ce-se-H.mainAxis:V-ce-se-H.mainAxis,ge=R?-N[D]/2+ie+ce+J+H.mainAxis:re+ce+J+H.mainAxis,de=t.elements.arrow&&Yg(t.elements.arrow),le=de?_==="y"?de.clientTop||0:de.clientLeft||0:0,ee=(L=P?.[_])!=null?L:0,X=q+oe-ee-le,ve=q+ge-ee,st=$p(b?r1(K,X):K,q,b?Eu(Y,ve):Y);F[_]=st,k[_]=st-q}if(u){var Ge,qe=_==="x"?vo:So,Be=_==="x"?Pi:Di,Te=F[z],Re=z==="y"?"height":"width",Se=Te+j[qe],Ke=Te-j[Be],ot=[vo,So].indexOf(A)!==-1,He=(Ge=P?.[z])!=null?Ge:0,$e=ot?Se:Te-N[Re]-I[Re]-He+H.altAxis,Z=ot?Te+N[Re]+I[Re]-He-H.altAxis:Ke,pe=b&&ot?TV($e,Te,Z):$p(b?$e:Se,Te,b?Z:Ke);F[z]=pe,k[z]=pe-Te}t.modifiersData[s]=k}}const sG={name:"preventOverflow",enabled:!0,phase:"main",fn:rG,requiresIfExists:["offset"]};function oG(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function iG(e){return e===ei(e)||!zi(e)?fC(e):oG(e)}function aG(e){var t=e.getBoundingClientRect(),n=Of(t.width)/e.offsetWidth||1,s=Of(t.height)/e.offsetHeight||1;return n!==1||s!==1}function lG(e,t,n){n===void 0&&(n=!1);var s=zi(t),o=zi(t)&&aG(t),a=Bc(t),l=Bf(e,o,n),u={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(s||!s&&!n)&&(($a(t)!=="body"||pC(a))&&(u=iG(t)),zi(t)?(d=Bf(t,!0),d.x+=t.clientLeft,d.y+=t.clientTop):a&&(d.x=hC(a))),{x:l.left+u.scrollLeft-d.x,y:l.top+u.scrollTop-d.y,width:l.width,height:l.height}}function cG(e){var t=new Map,n=new Set,s=[];e.forEach(function(a){t.set(a.name,a)});function o(a){n.add(a.name);var l=[].concat(a.requires||[],a.requiresIfExists||[]);l.forEach(function(u){if(!n.has(u)){var d=t.get(u);d&&o(d)}}),s.push(a)}return e.forEach(function(a){n.has(a.name)||o(a)}),s}function uG(e){var t=cG(e);return SV.reduce(function(n,s){return n.concat(t.filter(function(o){return o.phase===s}))},[])}function dG(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function fG(e){var t=e.reduce(function(n,s){var o=n[s.name];return n[s.name]=o?Object.assign({},o,s,{options:Object.assign({},o.options,s.options),data:Object.assign({},o.data,s.data)}):s,n},{});return Object.keys(t).map(function(n){return t[n]})}var g6={placement:"bottom",modifiers:[],strategy:"absolute"};function m6(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function hG(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,s=n===void 0?[]:n,o=t.defaultOptions,a=o===void 0?g6:o;return function(u,d,f){f===void 0&&(f=a);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},g6,a),modifiersData:{},elements:{reference:u,popper:d},attributes:{},styles:{}},g=[],x=!1,b={state:p,setOptions:function(A){var M=typeof A=="function"?A(p.options):A;S(),p.options=Object.assign({},a,p.options,M),p.scrollParents={reference:Pu(u)?Hp(u):u.contextElement?Hp(u.contextElement):[],popper:Hp(d)};var R=uG(fG([].concat(s,p.options.modifiers)));return p.orderedModifiers=R.filter(function(_){return _.enabled}),y(),b.update()},forceUpdate:function(){if(!x){var A=p.elements,M=A.reference,R=A.popper;if(m6(M,R)){p.rects={reference:lG(M,Yg(R),p.options.strategy==="fixed"),popper:uC(R)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(H){return p.modifiersData[H.name]=Object.assign({},H.data)});for(var _=0;_<p.orderedModifiers.length;_++){if(p.reset===!0){p.reset=!1,_=-1;continue}var z=p.orderedModifiers[_],F=z.fn,N=z.options,I=N===void 0?{}:N,B=z.name;typeof F=="function"&&(p=F({state:p,options:I,name:B,instance:b})||p)}}}},update:dG(function(){return new Promise(function(j){b.forceUpdate(),j(p)})}),destroy:function(){S(),x=!0}};if(!m6(u,d))return b;b.setOptions(f).then(function(j){!x&&f.onFirstUpdate&&f.onFirstUpdate(j)});function y(){p.orderedModifiers.forEach(function(j){var A=j.name,M=j.options,R=M===void 0?{}:M,_=j.effect;if(typeof _=="function"){var z=_({state:p,name:A,instance:b,options:R}),F=function(){};g.push(z||F)}})}function S(){g.forEach(function(j){return j()}),g=[]}return b}}var pG=[DV,tG,LV,wV,JV,YV,sG,zV,XV],gG=hG({defaultModifiers:pG});function Hr(e){const{elementType:t,externalSlotProps:n,ownerState:s,skipResolvingSlotProps:o=!1,...a}=e,l=o?{}:SR(n,s),{props:u,internalRef:d}=jR({...a,externalSlotProps:l}),f=vr(d,l?.ref,e.additionalProps?.ref);return vR(t,{...u,ref:f},s)}function Nc(e){return parseInt(v.version,10)>=19?e?.props?.ref||null:e?.ref||null}function mG(e){return typeof e=="function"?e():e}const _R=v.forwardRef(function(t,n){const{children:s,container:o,disablePortal:a=!1}=t,[l,u]=v.useState(null),d=vr(v.isValidElement(s)?Nc(s):null,n);if(or(()=>{a||u(mG(o)||document.body)},[o,a]),or(()=>{if(l&&!a)return xS(n,l),()=>{xS(n,null)}},[n,l,a]),a){if(v.isValidElement(s)){const f={ref:d};return v.cloneElement(s,f)}return s}return l&&q1.createPortal(s,l)});function xG(e){return gt("MuiPopper",e)}mt("MuiPopper",["root"]);function bG(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function AS(e){return typeof e=="function"?e():e}function yG(e){return e.nodeType!==void 0}const vG=e=>{const{classes:t}=e;return pt({root:["root"]},xG,t)},SG={},jG=v.forwardRef(function(t,n){const{anchorEl:s,children:o,direction:a,disablePortal:l,modifiers:u,open:d,placement:f,popperOptions:p,popperRef:g,slotProps:x={},slots:b={},TransitionProps:y,ownerState:S,...j}=t,A=v.useRef(null),M=vr(A,n),R=v.useRef(null),_=vr(R,g),z=v.useRef(_);or(()=>{z.current=_},[_]),v.useImperativeHandle(g,()=>R.current,[]);const F=bG(f,a),[N,I]=v.useState(F),[B,H]=v.useState(AS(s));v.useEffect(()=>{R.current&&R.current.forceUpdate()}),v.useEffect(()=>{s&&H(AS(s))},[s]),or(()=>{if(!B||!d)return;const W=K=>{I(K.placement)};let D=[{name:"preventOverflow",options:{altBoundary:l}},{name:"flip",options:{altBoundary:l}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:K})=>{W(K)}}];u!=null&&(D=D.concat(u)),p&&p.modifiers!=null&&(D=D.concat(p.modifiers));const q=gG(B,A.current,{placement:F,...p,modifiers:D});return z.current(q),()=>{q.destroy(),z.current(null)}},[B,l,u,d,p,F]);const P={placement:N};y!==null&&(P.TransitionProps=y);const k=vG(t),L=b.root??"div",O=Hr({elementType:L,externalSlotProps:x.root,externalForwardedProps:j,additionalProps:{role:"tooltip",ref:M},ownerState:t,className:k.root});return r.jsx(L,{...O,children:typeof o=="function"?o(P):o})}),CG=v.forwardRef(function(t,n){const{anchorEl:s,children:o,container:a,direction:l="ltr",disablePortal:u=!1,keepMounted:d=!1,modifiers:f,open:p,placement:g="bottom",popperOptions:x=SG,popperRef:b,style:y,transition:S=!1,slotProps:j={},slots:A={},...M}=t,[R,_]=v.useState(!0),z=()=>{_(!1)},F=()=>{_(!0)};if(!d&&!p&&(!S||R))return null;let N;if(a)N=a;else if(s){const H=AS(s);N=H&&yG(H)?is(H).body:is(null).body}const I=!p&&d&&(!S||R)?"none":void 0,B=S?{in:p,onEnter:z,onExited:F}:void 0;return r.jsx(_R,{disablePortal:u,container:N,children:r.jsx(jG,{anchorEl:s,direction:l,disablePortal:u,modifiers:f,ref:n,open:S?!R:p,placement:g,popperOptions:x,popperRef:b,slotProps:j,slots:A,...M,style:{position:"fixed",top:0,left:0,display:I,...y},TransitionProps:B,children:o})})}),wG=Me(CG,{name:"MuiPopper",slot:"Root"})({}),Kg=v.forwardRef(function(t,n){const s=Ao(),o=Tt({props:t,name:"MuiPopper"}),{anchorEl:a,component:l,components:u,componentsProps:d,container:f,disablePortal:p,keepMounted:g,modifiers:x,open:b,placement:y,popperOptions:S,popperRef:j,transition:A,slots:M,slotProps:R,..._}=o,z=M?.root??u?.Root,F={anchorEl:a,container:f,disablePortal:p,keepMounted:g,modifiers:x,open:b,placement:y,popperOptions:S,popperRef:j,transition:A,..._};return r.jsx(wG,{as:l,direction:s?"rtl":"ltr",slots:{root:z},slotProps:R??d,...F,ref:n})});function AG(e){return gt("MuiListSubheader",e)}mt("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const EG=e=>{const{classes:t,color:n,disableGutters:s,inset:o,disableSticky:a}=e,l={root:["root",n!=="default"&&`color${Le(n)}`,!s&&"gutters",o&&"inset",!a&&"sticky"]};return pt(l,AG,t)},TG=Me("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${Le(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})(St(({theme:e})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(e.vars||e).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.inset,style:{paddingLeft:72}},{props:({ownerState:t})=>!t.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}}]}))),dg=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiListSubheader"}),{className:o,color:a="default",component:l="li",disableGutters:u=!1,disableSticky:d=!1,inset:f=!1,...p}=s,g={...s,color:a,component:l,disableGutters:u,disableSticky:d,inset:f},x=EG(g);return r.jsx(TG,{as:l,className:Ye(x.root,o),ref:n,ownerState:g,...p})});dg&&(dg.muiSkipListHighlight=!0);const kG=ze(r.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}));function MG(e){return gt("MuiChip",e)}const kn=mt("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),RG=e=>{const{classes:t,disabled:n,size:s,color:o,iconColor:a,onDelete:l,clickable:u,variant:d}=e,f={root:["root",d,n&&"disabled",`size${Le(s)}`,`color${Le(o)}`,u&&"clickable",u&&`clickableColor${Le(o)}`,l&&"deletable",l&&`deletableColor${Le(o)}`,`${d}${Le(o)}`],label:["label",`label${Le(s)}`],avatar:["avatar",`avatar${Le(s)}`,`avatarColor${Le(o)}`],icon:["icon",`icon${Le(s)}`,`iconColor${Le(a)}`],deleteIcon:["deleteIcon",`deleteIcon${Le(s)}`,`deleteIconColor${Le(o)}`,`deleteIcon${Le(d)}Color${Le(o)}`]};return pt(f,MG,t)},zG=Me("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:s,iconColor:o,clickable:a,onDelete:l,size:u,variant:d}=n;return[{[`& .${kn.avatar}`]:t.avatar},{[`& .${kn.avatar}`]:t[`avatar${Le(u)}`]},{[`& .${kn.avatar}`]:t[`avatarColor${Le(s)}`]},{[`& .${kn.icon}`]:t.icon},{[`& .${kn.icon}`]:t[`icon${Le(u)}`]},{[`& .${kn.icon}`]:t[`iconColor${Le(o)}`]},{[`& .${kn.deleteIcon}`]:t.deleteIcon},{[`& .${kn.deleteIcon}`]:t[`deleteIcon${Le(u)}`]},{[`& .${kn.deleteIcon}`]:t[`deleteIconColor${Le(s)}`]},{[`& .${kn.deleteIcon}`]:t[`deleteIcon${Le(d)}Color${Le(s)}`]},t.root,t[`size${Le(u)}`],t[`color${Le(s)}`],a&&t.clickable,a&&s!=="default"&&t[`clickableColor${Le(s)}`],l&&t.deletable,l&&s!=="default"&&t[`deletableColor${Le(s)}`],t[d],t[`${d}${Le(s)}`]]}})(St(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,lineHeight:1.5,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${kn.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${kn.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${kn.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${kn.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${kn.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${kn.icon}`]:{marginLeft:5,marginRight:-6},[`& .${kn.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.alpha((e.vars||e).palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.alpha((e.vars||e).palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${kn.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${kn.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(er(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText,[`& .${kn.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${kn.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${kn.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${kn.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}},...Object.entries(e.palette).filter(er(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${kn.focusVisible}`]:{background:(e.vars||e).palette[n].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)},[`&.${kn.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(er(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${kn.focusVisible}`]:{backgroundColor:(e.vars||e).palette[n].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${kn.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${kn.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${kn.avatar}`]:{marginLeft:4},[`& .${kn.avatarSmall}`]:{marginLeft:2},[`& .${kn.icon}`]:{marginLeft:4},[`& .${kn.iconSmall}`]:{marginLeft:2},[`& .${kn.deleteIcon}`]:{marginRight:5},[`& .${kn.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(er()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(e.vars||e).palette[n].main,border:`1px solid ${e.alpha((e.vars||e).palette[n].main,.7)}`,[`&.${kn.clickable}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.hoverOpacity)},[`&.${kn.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.focusOpacity)},[`& .${kn.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].main}}}}))]}})),IG=Me("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:s}=n;return[t.label,t[`label${Le(s)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function x6(e){return e.key==="Backspace"||e.key==="Delete"}const Pt=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiChip"}),{avatar:o,className:a,clickable:l,color:u="default",component:d,deleteIcon:f,disabled:p=!1,icon:g,label:x,onClick:b,onDelete:y,onKeyDown:S,onKeyUp:j,size:A="medium",variant:M="filled",tabIndex:R,skipFocusWhenDisabled:_=!1,slots:z={},slotProps:F={},...N}=s,I=v.useRef(null),B=vr(I,n),H=se=>{se.stopPropagation(),y(se)},P=se=>{se.currentTarget===se.target&&x6(se)&&se.preventDefault(),S&&S(se)},k=se=>{se.currentTarget===se.target&&y&&x6(se)&&y(se),j&&j(se)},L=l!==!1&&b?!0:l,O=L||y?Li:d||"div",W={...s,component:O,disabled:p,size:A,color:u,iconColor:v.isValidElement(g)&&g.props.color||u,onDelete:!!y,clickable:L,variant:M},D=RG(W),q=O===Li?{component:d||"div",focusVisibleClassName:D.focusVisible,...y&&{disableRipple:!0}}:{};let K=null;y&&(K=f&&v.isValidElement(f)?v.cloneElement(f,{className:Ye(f.props.className,D.deleteIcon),onClick:H}):r.jsx(kG,{className:D.deleteIcon,onClick:H}));let Y=null;o&&v.isValidElement(o)&&(Y=v.cloneElement(o,{className:Ye(D.avatar,o.props.className)}));let ie=null;g&&v.isValidElement(g)&&(ie=v.cloneElement(g,{className:Ye(D.icon,g.props.className)}));const V={slots:z,slotProps:F},[re,fe]=jt("root",{elementType:zG,externalForwardedProps:{...V,...N},ownerState:W,shouldForwardComponentProp:!0,ref:B,className:Ye(D.root,a),additionalProps:{disabled:L&&p?!0:void 0,tabIndex:_&&p?-1:R,...q},getSlotProps:se=>({...se,onClick:J=>{se.onClick?.(J),b?.(J)},onKeyDown:J=>{se.onKeyDown?.(J),P(J)},onKeyUp:J=>{se.onKeyUp?.(J),k(J)}})}),[ae,ue]=jt("label",{elementType:IG,externalForwardedProps:V,ownerState:W,className:D.label});return r.jsxs(re,{as:O,...fe,children:[Y||ie,r.jsx(ae,{...ue,children:x}),K]})});function Ux(e){return parseInt(e,10)||0}const FG={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function _G(e){for(const t in e)return!1;return!0}function b6(e){return _G(e)||e.outerHeightStyle===0&&!e.overflowing}const LG=v.forwardRef(function(t,n){const{onChange:s,maxRows:o,minRows:a=1,style:l,value:u,...d}=t,{current:f}=v.useRef(u!=null),p=v.useRef(null),g=vr(n,p),x=v.useRef(null),b=v.useRef(null),y=v.useCallback(()=>{const R=p.current,_=b.current;if(!R||!_)return;const F=wo(R).getComputedStyle(R);if(F.width==="0px")return{outerHeightStyle:0,overflowing:!1};_.style.width=F.width,_.value=R.value||t.placeholder||"x",_.value.slice(-1)===` `&&(_.value+=" ");const N=F.boxSizing,I=Ux(F.paddingBottom)+Ux(F.paddingTop),B=Ux(F.borderBottomWidth)+Ux(F.borderTopWidth),H=_.scrollHeight;_.value="x";const P=_.scrollHeight;let k=H;a&&(k=Math.max(Number(a)*P,k)),o&&(k=Math.min(Number(o)*P,k)),k=Math.max(k,P);const L=k+(N==="border-box"?I+B:0),O=Math.abs(k-H)<=1;return{outerHeightStyle:L,overflowing:O}},[o,a,t.placeholder]),S=pn(()=>{const R=p.current,_=y();if(!R||!_||b6(_))return!1;const z=_.outerHeightStyle;return x.current!=null&&x.current!==z}),j=v.useCallback(()=>{const R=p.current,_=y();if(!R||!_||b6(_))return;const z=_.outerHeightStyle;x.current!==z&&(x.current=z,R.style.height=`${z}px`),R.style.overflow=_.overflowing?"hidden":""},[y]),A=v.useRef(-1);or(()=>{const R=Vg(j),_=p?.current;if(!_)return;const z=wo(_);z.addEventListener("resize",R);let F;return typeof ResizeObserver<"u"&&(F=new ResizeObserver(()=>{S()&&(F.unobserve(_),cancelAnimationFrame(A.current),j(),A.current=requestAnimationFrame(()=>{F.observe(_)}))}),F.observe(_)),()=>{R.clear(),cancelAnimationFrame(A.current),z.removeEventListener("resize",R),F&&F.disconnect()}},[y,j,S]),or(()=>{j()});const M=R=>{f||j();const _=R.target,z=_.value.length,F=_.value.endsWith(` `),N=_.selectionStart===z;F&&N&&_.setSelectionRange(z,z),s&&s(R)};return r.jsxs(v.Fragment,{children:[r.jsx("textarea",{value:u,onChange:M,ref:g,rows:a,style:l,...d}),r.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:b,tabIndex:-1,style:{...FG.shadow,...l,paddingTop:0,paddingBottom:0}})]})});function Gu({props:e,states:t,muiFormControl:n}){return t.reduce((s,o)=>(s[o]=e[o],n&&typeof e[o]>"u"&&(s[o]=n[o]),s),{})}const gb=v.createContext(void 0);function _l(){return v.useContext(gb)}function y6(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function s1(e,t=!1){return e&&(y6(e.value)&&e.value!==""||t&&y6(e.defaultValue)&&e.defaultValue!=="")}function PG(e){return e.startAdornment}function DG(e){return gt("MuiInputBase",e)}const Vo=mt("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var v6;const mb=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${Le(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},xb=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},OG=e=>{const{classes:t,color:n,disabled:s,error:o,endAdornment:a,focused:l,formControl:u,fullWidth:d,hiddenLabel:f,multiline:p,readOnly:g,size:x,startAdornment:b,type:y}=e,S={root:["root",`color${Le(n)}`,s&&"disabled",o&&"error",d&&"fullWidth",l&&"focused",u&&"formControl",x&&x!=="medium"&&`size${Le(x)}`,p&&"multiline",b&&"adornedStart",a&&"adornedEnd",f&&"hiddenLabel",g&&"readOnly"],input:["input",s&&"disabled",y==="search"&&"inputTypeSearch",p&&"inputMultiline",x==="small"&&"inputSizeSmall",f&&"inputHiddenLabel",b&&"inputAdornedStart",a&&"inputAdornedEnd",g&&"readOnly"]};return pt(S,DG,t)},bb=Me("div",{name:"MuiInputBase",slot:"Root",overridesResolver:mb})(St(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Vo.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:t})=>t.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:t,size:n})=>t.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:t})=>t.fullWidth,style:{width:"100%"}}]}))),yb=Me("input",{name:"MuiInputBase",slot:"Input",overridesResolver:xb})(St(({theme:e})=>{const t=e.palette.mode==="light",n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},s={opacity:"0 !important"},o=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Vo.formControl} &`]:{"&::-webkit-input-placeholder":s,"&::-moz-placeholder":s,"&::-ms-input-placeholder":s,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${Vo.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:a})=>!a.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:a})=>a.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),S6=nC({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),sr=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:a,autoFocus:l,className:u,color:d,components:f={},componentsProps:p={},defaultValue:g,disabled:x,disableInjectingGlobalStyles:b,endAdornment:y,error:S,fullWidth:j=!1,id:A,inputComponent:M="input",inputProps:R={},inputRef:_,margin:z,maxRows:F,minRows:N,multiline:I=!1,name:B,onBlur:H,onChange:P,onClick:k,onFocus:L,onKeyDown:O,onKeyUp:W,placeholder:D,readOnly:q,renderSuffix:K,rows:Y,size:ie,slotProps:V={},slots:re={},startAdornment:fe,type:ae="text",value:ue,...se}=s,J=R.value!=null?R.value:ue,{current:ce}=v.useRef(J!=null),oe=v.useRef(),ge=v.useCallback(we=>{},[]),de=vr(oe,_,R.ref,ge),[le,ee]=v.useState(!1),X=_l(),ve=Gu({props:s,muiFormControl:X,states:["color","disabled","error","hiddenLabel","size","required","filled"]});ve.focused=X?X.focused:le,v.useEffect(()=>{!X&&x&&le&&(ee(!1),H&&H())},[X,x,le,H]);const st=X&&X.onFilled,Ge=X&&X.onEmpty,qe=v.useCallback(we=>{s1(we)?st&&st():Ge&&Ge()},[st,Ge]);or(()=>{ce&&qe({value:J})},[J,qe,ce]);const Be=we=>{L&&L(we),R.onFocus&&R.onFocus(we),X&&X.onFocus?X.onFocus(we):ee(!0)},Te=we=>{H&&H(we),R.onBlur&&R.onBlur(we),X&&X.onBlur?X.onBlur(we):ee(!1)},Re=(we,...et)=>{if(!ce){const ht=we.target||oe.current;if(ht==null)throw new Error(wl(1));qe({value:ht.value})}R.onChange&&R.onChange(we,...et),P&&P(we,...et)};v.useEffect(()=>{qe(oe.current)},[]);const Se=we=>{oe.current&&we.currentTarget===we.target&&oe.current.focus(),k&&k(we)};let Ke=M,ot=R;I&&Ke==="input"&&(Y?ot={type:void 0,minRows:Y,maxRows:Y,...ot}:ot={type:void 0,maxRows:F,minRows:N,...ot},Ke=LG);const He=we=>{qe(we.animationName==="mui-auto-fill-cancel"?oe.current:{value:"x"})};v.useEffect(()=>{X&&X.setAdornedStart(!!fe)},[X,fe]);const $e={...s,color:ve.color||"primary",disabled:ve.disabled,endAdornment:y,error:ve.error,focused:ve.focused,formControl:X,fullWidth:j,hiddenLabel:ve.hiddenLabel,multiline:I,size:ve.size,startAdornment:fe,type:ae},Z=OG($e),pe=re.root||f.Root||bb,Q=V.root||p.root||{},me=re.input||f.Input||yb;return ot={...ot,...V.input??p.input},r.jsxs(v.Fragment,{children:[!b&&typeof S6=="function"&&(v6||(v6=r.jsx(S6,{}))),r.jsxs(pe,{...Q,ref:n,onClick:Se,...se,...!La(pe)&&{ownerState:{...$e,...Q.ownerState}},className:Ye(Z.root,Q.className,u,q&&"MuiInputBase-readOnly"),children:[fe,r.jsx(gb.Provider,{value:null,children:r.jsx(me,{"aria-invalid":ve.error,"aria-describedby":o,autoComplete:a,autoFocus:l,defaultValue:g,disabled:ve.disabled,id:A,onAnimationStart:He,name:B,placeholder:D,readOnly:q,required:ve.required,rows:Y,value:J,onKeyDown:O,onKeyUp:W,type:ae,...ot,...!La(me)&&{as:Ke,ownerState:{...$e,...ot.ownerState}},ref:de,className:Ye(Z.input,ot.className,q&&"MuiInputBase-readOnly"),onBlur:Te,onChange:Re,onFocus:Be})}),y,K?K({...ve,startAdornment:fe}):null]})]})});function BG(e){return gt("MuiInput",e)}const yc={...Vo,...mt("MuiInput",["root","underline","input"])};function NG(e){return gt("MuiOutlinedInput",e)}const mi={...Vo,...mt("MuiOutlinedInput",["root","notchedOutline","input"])};function $G(e){return gt("MuiFilledInput",e)}const Go={...Vo,...mt("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},LR=ze(r.jsx("path",{d:"M7 10l5 5 5-5z"}));function HG(e){return gt("MuiAutocomplete",e)}const Sn=mt("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var j6,C6;const WG=e=>{const{classes:t,disablePortal:n,expanded:s,focused:o,fullWidth:a,hasClearIcon:l,hasPopupIcon:u,inputFocused:d,popupOpen:f,size:p}=e,g={root:["root",s&&"expanded",o&&"focused",a&&"fullWidth",l&&"hasClearIcon",u&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",d&&"inputFocused"],tag:["tag",`tagSize${Le(p)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",f&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return pt(g,HG,t)},UG=Me("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:s,hasClearIcon:o,hasPopupIcon:a,inputFocused:l,size:u}=n;return[{[`& .${Sn.tag}`]:t.tag},{[`& .${Sn.tag}`]:t[`tagSize${Le(u)}`]},{[`& .${Sn.inputRoot}`]:t.inputRoot},{[`& .${Sn.input}`]:t.input},{[`& .${Sn.input}`]:l&&t.inputFocused},t.root,s&&t.fullWidth,a&&t.hasPopupIcon,o&&t.hasClearIcon]}})({[`&.${Sn.focused} .${Sn.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${Sn.clearIndicator}`]:{visibility:"visible"}},[`& .${Sn.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${Sn.inputRoot}`]:{[`.${Sn.hasPopupIcon}&, .${Sn.hasClearIcon}&`]:{paddingRight:30},[`.${Sn.hasPopupIcon}.${Sn.hasClearIcon}&`]:{paddingRight:56},[`& .${Sn.input}`]:{width:0,minWidth:30}},[`& .${yc.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${yc.root}.${Vo.sizeSmall}`]:{[`& .${yc.input}`]:{padding:"2px 4px 3px 0"}},[`& .${mi.root}`]:{padding:9,[`.${Sn.hasPopupIcon}&, .${Sn.hasClearIcon}&`]:{paddingRight:39},[`.${Sn.hasPopupIcon}.${Sn.hasClearIcon}&`]:{paddingRight:65},[`& .${Sn.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${Sn.endAdornment}`]:{right:9}},[`& .${mi.root}.${Vo.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${Sn.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${Go.root}`]:{paddingTop:19,paddingLeft:8,[`.${Sn.hasPopupIcon}&, .${Sn.hasClearIcon}&`]:{paddingRight:39},[`.${Sn.hasPopupIcon}.${Sn.hasClearIcon}&`]:{paddingRight:65},[`& .${Go.input}`]:{padding:"7px 4px"},[`& .${Sn.endAdornment}`]:{right:9}},[`& .${Go.root}.${Vo.sizeSmall}`]:{paddingBottom:1,[`& .${Go.input}`]:{padding:"2.5px 4px"}},[`& .${Vo.hiddenLabel}`]:{paddingTop:8},[`& .${Go.root}.${Vo.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${Sn.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${Go.root}.${Vo.hiddenLabel}.${Vo.sizeSmall}`]:{[`& .${Sn.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${Sn.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${Sn.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${Sn.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${Sn.inputRoot}`]:{flexWrap:"wrap"}}}]}),qG=Me("div",{name:"MuiAutocomplete",slot:"EndAdornment"})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),VG=Me(Ve,{name:"MuiAutocomplete",slot:"ClearIndicator"})({marginRight:-2,padding:4,visibility:"hidden"}),GG=Me(Ve,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popupIndicator,n.popupOpen&&t.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),YG=Me(Kg,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Sn.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(St(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),KG=Me(Je,{name:"MuiAutocomplete",slot:"Paper"})(St(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),XG=Me("div",{name:"MuiAutocomplete",slot:"Loading"})(St(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),ZG=Me("div",{name:"MuiAutocomplete",slot:"NoOptions"})(St(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),QG=Me("ul",{name:"MuiAutocomplete",slot:"Listbox"})(St(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${Sn.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${Sn.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${Sn.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${Sn.focused}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${Sn.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}}}))),JG=Me(dg,{name:"MuiAutocomplete",slot:"GroupLabel"})(St(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),eY=Me("ul",{name:"MuiAutocomplete",slot:"GroupUl"})({padding:0,[`& .${Sn.option}`]:{paddingLeft:24}}),tY=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiAutocomplete"}),{autoComplete:o=!1,autoHighlight:a=!1,autoSelect:l=!1,blurOnSelect:u=!1,ChipProps:d,className:f,clearIcon:p=j6||(j6=r.jsx(wR,{fontSize:"small"})),clearOnBlur:g=!s.freeSolo,clearOnEscape:x=!1,clearText:b="Clear",closeText:y="Close",componentsProps:S,defaultValue:j=s.multiple?[]:null,disableClearable:A=!1,disableCloseOnSelect:M=!1,disabled:R=!1,disabledItemsFocusable:_=!1,disableListWrap:z=!1,disablePortal:F=!1,filterOptions:N,filterSelectedOptions:I=!1,forcePopupIcon:B="auto",freeSolo:H=!1,fullWidth:P=!1,getLimitTagsText:k=zt=>`+${zt}`,getOptionDisabled:L,getOptionKey:O,getOptionLabel:W,isOptionEqualToValue:D,groupBy:q,handleHomeEndKeys:K=!s.freeSolo,id:Y,includeInputInList:ie=!1,inputValue:V,limitTags:re=-1,ListboxComponent:fe,ListboxProps:ae,loading:ue=!1,loadingText:se="Loading…",multiple:J=!1,noOptionsText:ce="No options",onChange:oe,onClose:ge,onHighlightChange:de,onInputChange:le,onOpen:ee,open:X,openOnFocus:ve=!1,openText:st="Open",options:Ge,PaperComponent:qe,PopperComponent:Be,popupIcon:Te=C6||(C6=r.jsx(LR,{})),readOnly:Re=!1,renderGroup:Se,renderInput:Ke,renderOption:ot,renderTags:He,renderValue:$e,selectOnFocus:Z=!s.freeSolo,size:pe="medium",slots:Q={},slotProps:me={},value:we,...et}=s,{getRootProps:ht,getInputProps:ct,getInputLabelProps:bt,getPopupIndicatorProps:wt,getClearProps:gn,getItemProps:mn,getListboxProps:ut,getOptionProps:_t,value:Yt,dirty:Xt,expanded:ln,id:pr,popupOpen:nr,focused:Bn,focusedItem:Ht,anchorEl:rn,setAnchorEl:yt,inputValue:Ft,groupedOptions:un}=cV({...s,componentName:"Autocomplete"}),an=!A&&!R&&Xt&&!Re,he=(!H||B===!0)&&B!==!1,{onMouseDown:Ee}=ct(),{ref:Fe,...Xe}=ut(),At=W||(zt=>zt.label??zt),at={...s,disablePortal:F,expanded:ln,focused:Bn,fullWidth:P,getOptionLabel:At,hasClearIcon:an,hasPopupIcon:he,inputFocused:Ht===-1,popupOpen:nr,size:pe},lt=WG(at),kt={slots:{paper:qe,popper:Be,...Q},slotProps:{chip:d,listbox:ae,...S,...me}},[vt,Nt]=jt("root",{ref:n,className:[lt.root,f],elementType:UG,externalForwardedProps:{...kt,...et},getSlotProps:ht,ownerState:at}),[Dt,vn]=jt("listbox",{elementType:QG,externalForwardedProps:kt,ownerState:at,className:lt.listbox,additionalProps:Xe,ref:Fe}),[cn,An]=jt("paper",{elementType:Je,externalForwardedProps:kt,ownerState:at,className:lt.paper}),[dn,Oe]=jt("popper",{elementType:Kg,externalForwardedProps:kt,ownerState:at,className:lt.popper,additionalProps:{disablePortal:F,style:{width:rn?rn.clientWidth:null},role:"presentation",anchorEl:rn,open:nr}}),[_e,ft]=jt("clearIndicator",{elementType:VG,externalForwardedProps:kt,ownerState:at,className:lt.clearIndicator,shouldForwardComponentProp:!0,additionalProps:{...gn(),"aria-label":b,title:b}}),[Lt,Qt]=jt("popupIndicator",{elementType:GG,externalForwardedProps:kt,ownerState:at,className:lt.popupIndicator,shouldForwardComponentProp:!0,additionalProps:{...wt(),disabled:R,"aria-label":nr?y:st,title:nr?y:st}});let sn;const on=zt=>({className:lt.tag,disabled:R,...mn(zt)});if(J?Yt.length>0&&(He?sn=He(Yt,on,at):$e?sn=$e(Yt,on,at):sn=Yt.map((zt,Nn)=>{const{key:ar,...Hn}=on({index:Nn});return r.jsx(Pt,{label:At(zt),size:pe,...Hn,...kt.slotProps.chip},ar)})):$e&&Yt!=null&&(sn=$e(Yt,on,at)),re>-1&&Array.isArray(sn)){const zt=sn.length-re;!Bn&&zt>0&&(sn=sn.splice(0,re),sn.push(r.jsx("span",{className:lt.tag,children:k(zt)},sn.length)))}const $r=Se||(zt=>r.jsxs("li",{children:[r.jsx(JG,{className:lt.groupLabel,ownerState:at,component:"div",children:zt.group}),r.jsx(eY,{className:lt.groupUl,ownerState:at,children:zt.children})]},zt.key)),zo=ot||((zt,Nn)=>{const{key:ar,...Hn}=zt;return r.jsx("li",{...Hn,children:At(Nn)},ar)}),Io=(zt,Nn)=>{const ar=_t({option:zt,index:Nn});return zo({...ar,className:lt.option},zt,{selected:ar["aria-selected"],index:Nn,inputValue:Ft},at)};return r.jsxs(v.Fragment,{children:[r.jsx(vt,{...Nt,children:Ke({id:pr,disabled:R,fullWidth:s.fullWidth??!0,size:pe==="small"?"small":void 0,InputLabelProps:bt(),InputProps:{ref:yt,className:lt.inputRoot,startAdornment:sn,onMouseDown:zt=>{zt.target===zt.currentTarget&&Ee(zt)},...(an||he)&&{endAdornment:r.jsxs(qG,{className:lt.endAdornment,ownerState:at,children:[an?r.jsx(_e,{...ft,children:p}):null,he?r.jsx(Lt,{...Qt,children:Te}):null]})}},inputProps:{className:lt.input,disabled:R,readOnly:Re,...ct()}})}),rn?r.jsx(YG,{as:dn,...Oe,children:r.jsxs(KG,{as:cn,...An,children:[ue&&un.length===0?r.jsx(XG,{className:lt.loading,ownerState:at,children:se}):null,un.length===0&&!H&&!ue?r.jsx(ZG,{className:lt.noOptions,ownerState:at,role:"presentation",onMouseDown:zt=>{zt.preventDefault()},children:ce}):null,un.length>0?r.jsx(Dt,{as:fe,...vn,children:un.map((zt,Nn)=>q?$r({key:zt.key,group:zt.group,children:zt.options.map((ar,Hn)=>Io(ar,zt.index+Hn))}):Io(zt,Nn))}):null]})}):null]})}),nY=ze(r.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}));function rY(e){return gt("MuiAvatar",e)}mt("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const sY=e=>{const{classes:t,variant:n,colorDefault:s}=e;return pt({root:["root",n,s&&"colorDefault"],img:["img"],fallback:["fallback"]},rY,t)},oY=Me("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],n.colorDefault&&t.colorDefault]}})(St(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:{color:(e.vars||e).palette.background.default,...e.vars?{backgroundColor:e.vars.palette.Avatar.defaultBg}:{backgroundColor:e.palette.grey[400],...e.applyStyles("dark",{backgroundColor:e.palette.grey[600]})}}}]}))),iY=Me("img",{name:"MuiAvatar",slot:"Img"})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),aY=Me(nY,{name:"MuiAvatar",slot:"Fallback"})({width:"75%",height:"75%"});function lY({crossOrigin:e,referrerPolicy:t,src:n,srcSet:s}){const[o,a]=v.useState(!1);return v.useEffect(()=>{if(!n&&!s)return;a(!1);let l=!0;const u=new Image;return u.onload=()=>{l&&a("loaded")},u.onerror=()=>{l&&a("error")},u.crossOrigin=e,u.referrerPolicy=t,u.src=n,s&&(u.srcset=s),()=>{l=!1}},[e,t,n,s]),o}const yr=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiAvatar"}),{alt:o,children:a,className:l,component:u="div",slots:d={},slotProps:f={},imgProps:p,sizes:g,src:x,srcSet:b,variant:y="circular",...S}=s;let j=null;const A={...s,component:u,variant:y},M=lY({...p,...typeof f.img=="function"?f.img(A):f.img,src:x,srcSet:b}),R=x||b,_=R&&M!=="error";A.colorDefault=!_,delete A.ownerState;const z=sY(A),[F,N]=jt("root",{ref:n,className:Ye(z.root,l),elementType:oY,externalForwardedProps:{slots:d,slotProps:f,component:u,...S},ownerState:A}),[I,B]=jt("img",{className:z.img,elementType:iY,externalForwardedProps:{slots:d,slotProps:{img:{...p,...f.img}}},additionalProps:{alt:o,src:x,srcSet:b,sizes:g},ownerState:A}),[H,P]=jt("fallback",{className:z.fallback,elementType:aY,externalForwardedProps:{slots:d,slotProps:f},shouldForwardComponentProp:!0,ownerState:A});return _?j=r.jsx(I,{...B}):a||a===0?j=a:R&&o?j=o[0]:j=r.jsx(H,{...P}),r.jsx(F,{...N,children:j})}),cY={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0},exited:{opacity:0}},uY={opacity:0,visibility:"hidden"},Du=v.forwardRef(function(t,n){const s=On(),o={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{addEndListener:a,appear:l=!0,children:u,easing:d,in:f,onEnter:p,onEntered:g,onEntering:x,onExit:b,onExited:y,onExiting:S,style:j,timeout:A=o,...M}=t,R=v.useRef(null),_=vr(R,Nc(u),n),z=Or(R,x),F=Or(R,(k,L)=>{iC(k);const O=Ic({style:j,timeout:A,easing:d},{mode:"enter"});k.style.transition=s.transitions.create("opacity",O),p&&p(k,L)}),N=Or(R,g),I=Or(R,S),B=Or(R,k=>{const L=Ic({style:j,timeout:A,easing:d},{mode:"exit"});k.style.transition=s.transitions.create("opacity",L),b&&b(k)}),H=Or(R,k=>{k.style.transition="",y&&y(k)}),P=k=>{a&&a(R.current,k)};return r.jsx(Ui,{appear:l,in:f,nodeRef:R,onEnter:F,onEntered:N,onEntering:z,onExit:B,onExited:H,onExiting:I,addEndListener:P,timeout:A,...M,children:(k,{ownerState:L,...O})=>{const W=yR(k,f,cY,uY,j,u.props.style);return v.cloneElement(u,{style:W,ref:_,...O})}})});function dY(e){return gt("MuiBackdrop",e)}mt("MuiBackdrop",["root","invisible"]);const fY=e=>{const{classes:t,invisible:n}=e;return pt({root:["root",n&&"invisible"]},dY,t)},hY=Me("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),gC=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiBackdrop"}),{children:o,className:a,component:l="div",invisible:u=!1,open:d,components:f={},componentsProps:p={},slotProps:g={},slots:x={},TransitionComponent:b,transitionDuration:y,...S}=s,j={...s,component:l,invisible:u},A=fY(j),M={transition:b,root:f.Root,...x},R={...p,...g},_={component:l,slots:M,slotProps:R},[z,F]=jt("root",{elementType:hY,externalForwardedProps:_,className:Ye(A.root,a),ownerState:j}),[N,I]=jt("transition",{elementType:Du,externalForwardedProps:_,ownerState:j});return r.jsx(N,{in:d,timeout:y,...S,...I,children:r.jsx(z,{"aria-hidden":!0,...F,ref:n,children:o})})});function pY(e){const{badgeContent:t,invisible:n=!1,max:s=99,showZero:o=!1}=e,a=aC({badgeContent:t,max:s});let l=n;n===!1&&t===0&&!o&&(l=!0);const{badgeContent:u,max:d=s}=l?a:e,f=u&&Number(u)>d?`${d}+`:u;return{badgeContent:u,invisible:l,max:d,displayValue:f}}function gY(e){return gt("MuiBadge",e)}const mY=mt("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),U2=10,q2=4,xY=e=>{const{color:t,anchorOrigin:n,invisible:s,overlap:o,variant:a,classes:l={}}=e,u={root:["root"],badge:["badge",a,s&&"invisible",`anchorOrigin${Le(n.vertical)}${Le(n.horizontal)}`,`anchorOrigin${Le(n.vertical)}${Le(n.horizontal)}${Le(o)}`,`overlap${Le(o)}`,t!=="default"&&`color${Le(t)}`]};return pt(u,gY,l)},bY=Me("span",{name:"MuiBadge",slot:"Root"})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),yY=Me("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.badge,t[n.variant],t[`anchorOrigin${Le(n.anchorOrigin.vertical)}${Le(n.anchorOrigin.horizontal)}${Le(n.overlap)}`],n.color!=="default"&&t[`color${Le(n.color)}`],n.invisible&&t.invisible]}})(St(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:U2*2,lineHeight:1,padding:"0 6px",height:U2*2,borderRadius:U2,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen}),variants:[...Object.entries(e.palette).filter(er(["contrastText"])).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main,color:(e.vars||e).palette[t].contrastText}})),{props:{variant:"dot"},style:{borderRadius:q2,height:q2*2,minWidth:q2*2,padding:0}},{props:{invisible:!0},style:{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})}},{style:({ownerState:t})=>{const{vertical:n,horizontal:s}=t.anchorOrigin,o=t.overlap==="circular"?"14%":0;return{"--Badge-translateX":s==="right"?"50%":"-50%","--Badge-translateY":n==="top"?"-50%":"50%",top:n==="top"?o:"initial",bottom:n==="bottom"?o:"initial",right:s==="right"?o:"initial",left:s==="left"?o:"initial",transform:"scale(1) translate(var(--Badge-translateX), var(--Badge-translateY))",transformOrigin:`${s==="right"?"100%":"0%"} ${n==="top"?"0%":"100%"}`,[`&.${mY.invisible}`]:{transform:"scale(0) translate(var(--Badge-translateX), var(--Badge-translateY))"}}}}]})));function w6(e){return{vertical:e?.vertical??"top",horizontal:e?.horizontal??"right"}}const mC=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiBadge"}),{anchorOrigin:o,className:a,classes:l,component:u,components:d={},componentsProps:f={},children:p,overlap:g="rectangular",color:x="default",invisible:b=!1,max:y=99,badgeContent:S,slots:j,slotProps:A,showZero:M=!1,variant:R="standard",..._}=s,{badgeContent:z,invisible:F,max:N,displayValue:I}=pY({max:y,invisible:b,badgeContent:S,showZero:M}),B=aC({anchorOrigin:w6(o),color:x,overlap:g,variant:R,badgeContent:S}),H=F||z==null&&R!=="dot",{color:P=x,overlap:k=g,anchorOrigin:L,variant:O=R}=H?B:s,W=w6(L),D=O!=="dot"?I:void 0,q={...s,badgeContent:z,invisible:H,max:N,displayValue:D,showZero:M,anchorOrigin:W,color:P,overlap:k,variant:O},K=xY(q),Y={slots:{root:j?.root??d.Root,badge:j?.badge??d.Badge},slotProps:{root:A?.root??f.root,badge:A?.badge??f.badge}},[ie,V]=jt("root",{elementType:bY,externalForwardedProps:{...Y,..._},ownerState:q,className:Ye(K.root,a),ref:n,additionalProps:{as:u}}),[re,fe]=jt("badge",{elementType:yY,externalForwardedProps:Y,ownerState:q,className:K.badge});return r.jsxs(ie,{...V,children:[p,r.jsx(re,{...fe,children:D})]})}),vY=mt("MuiBox",["root"]),SY=ub(),E=EH({themeId:Ri,defaultTheme:SY,defaultClassName:vY.root,generateClassName:G7.generate}),jY=ze(r.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),CY=Me(Li,{name:"MuiBreadcrumbCollapsed"})(St(({theme:e})=>({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`,...e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}},"&:active":{boxShadow:e.shadows[0],...e.palette.mode==="light"?{backgroundColor:ag(e.palette.grey[200],.12)}:{backgroundColor:ag(e.palette.grey[600],.12)}}}))),wY=Me(jY)({width:24,height:16});function AY(e){const{slots:t={},slotProps:n={},...s}=e,o=e;return r.jsx("li",{children:r.jsx(CY,{focusRipple:!0,...s,ownerState:o,children:r.jsx(wY,{as:t.CollapsedIcon,ownerState:o,...n.collapsedIcon})})})}function EY(e){return gt("MuiBreadcrumbs",e)}const TY=mt("MuiBreadcrumbs",["root","ol","li","separator"]),kY=e=>{const{classes:t}=e;return pt({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},EY,t)},MY=Me(C,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${TY.li}`]:t.li},t.root]})({}),RY=Me("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),zY=Me("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function IY(e,t,n,s){return e.reduce((o,a,l)=>(l<e.length-1?o=o.concat(a,r.jsx(zY,{"aria-hidden":!0,className:t,ownerState:s,children:n},`separator-${l}`)):o.push(a),o),[])}const xC=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiBreadcrumbs"}),{children:o,className:a,component:l="nav",slots:u={},slotProps:d={},expandText:f="Show path",itemsAfterCollapse:p=1,itemsBeforeCollapse:g=1,maxItems:x=8,separator:b="/",...y}=s,[S,j]=v.useState(!1),A={...s,component:l,expanded:S,expandText:f,itemsAfterCollapse:p,itemsBeforeCollapse:g,maxItems:x,separator:b},M=kY(A),R=Hr({elementType:u.CollapsedIcon,externalSlotProps:d.collapsedIcon,ownerState:A}),_=v.useRef(null),z=N=>{const I=()=>{j(!0);const B=_.current.querySelector("a[href],button,[tabindex]");B&&B.focus()};return g+p>=N.length?N:[...N.slice(0,g),r.jsx(AY,{"aria-label":f,slots:{CollapsedIcon:u.CollapsedIcon},slotProps:{collapsedIcon:R},onClick:I},"ellipsis"),...N.slice(N.length-p,N.length)]},F=v.Children.toArray(o).filter(N=>v.isValidElement(N)).map((N,I)=>r.jsx("li",{className:M.li,children:N},`child-${I}`));return r.jsx(MY,{ref:n,component:l,color:"textSecondary",className:Ye(M.root,a),ownerState:A,...y,children:r.jsx(RY,{className:M.ol,ref:_,ownerState:A,children:IY(S||x&&F.length<=x?F:z(F),M.separator,b,A)})})});function FY(e){return gt("MuiButton",e)}const pu=mt("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),_Y=v.createContext({}),LY=v.createContext(void 0),PY=e=>{const{color:t,disableElevation:n,fullWidth:s,size:o,variant:a,loading:l,loadingPosition:u,classes:d}=e,f={root:["root",l&&"loading",a,`${a}${Le(t)}`,`size${Le(o)}`,`${a}Size${Le(o)}`,`color${Le(t)}`,n&&"disableElevation",s&&"fullWidth",l&&`loadingPosition${Le(u)}`],startIcon:["icon","startIcon",`iconSize${Le(o)}`],endIcon:["icon","endIcon",`iconSize${Le(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},p=pt(f,FY,d);return{...d,...p}},PR=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],DY=Me(Li,{shouldForwardProp:e=>Us(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${Le(n.color)}`],t[`size${Le(n.size)}`],t[`${n.variant}Size${Le(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(St(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${pu.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${pu.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${pu.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${pu.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(er()).map(([s])=>({props:{color:s},style:{"--variant-textColor":(e.vars||e).palette[s].main,"--variant-outlinedColor":(e.vars||e).palette[s].main,"--variant-outlinedBorder":e.alpha((e.vars||e).palette[s].main,.5),"--variant-containedColor":(e.vars||e).palette[s].contrastText,"--variant-containedBg":(e.vars||e).palette[s].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[s].dark,"--variant-textBg":e.alpha((e.vars||e).palette[s].main,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[s].main,"--variant-outlinedBg":e.alpha((e.vars||e).palette[s].main,(e.vars||e).palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${pu.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${pu.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${pu.loading}`]:{color:"transparent"}}}]}})),OY=Me("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${Le(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...PR]})),BY=Me("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${Le(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...PR]})),NY=Me("span",{name:"MuiButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),A6=Me("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),ye=v.forwardRef(function(t,n){const s=v.useContext(_Y),o=v.useContext(LY),a=Iu(s,t),l=Tt({props:a,name:"MuiButton"}),{children:u,color:d="primary",component:f="button",className:p,disabled:g=!1,disableElevation:x=!1,disableFocusRipple:b=!1,endIcon:y,focusVisibleClassName:S,fullWidth:j=!1,id:A,loading:M=null,loadingIndicator:R,loadingPosition:_="center",size:z="medium",startIcon:F,type:N,variant:I="text",...B}=l,H=Hi(A),P=R??r.jsx(nn,{"aria-labelledby":H,color:"inherit",size:16}),k={...l,color:d,component:f,disabled:g,disableElevation:x,disableFocusRipple:b,fullWidth:j,loading:M,loadingIndicator:P,loadingPosition:_,size:z,type:N,variant:I},L=PY(k),O=(F||M&&_==="start")&&r.jsx(OY,{className:L.startIcon,ownerState:k,children:F||r.jsx(A6,{className:L.loadingIconPlaceholder,ownerState:k})}),W=(y||M&&_==="end")&&r.jsx(BY,{className:L.endIcon,ownerState:k,children:y||r.jsx(A6,{className:L.loadingIconPlaceholder,ownerState:k})}),D=o||"",q=typeof M=="boolean"?r.jsx("span",{className:L.loadingWrapper,style:{display:"contents"},children:M&&r.jsx(NY,{className:L.loadingIndicator,ownerState:k,children:P})}):null;return r.jsxs(DY,{ownerState:k,className:Ye(s.className,L.root,p,D),component:f,disabled:g||M,focusRipple:!b,focusVisibleClassName:Ye(L.focusVisible,S),ref:n,type:N,id:M?H:A,...B,classes:L,children:[O,_!=="end"&&q,u,_==="end"&&q,W]})});function $Y(e){return gt("MuiCard",e)}mt("MuiCard",["root"]);const HY=e=>{const{classes:t}=e;return pt({root:["root"]},$Y,t)},WY=Me(Je,{name:"MuiCard",slot:"Root"})({overflow:"hidden"}),ts=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiCard"}),{className:o,raised:a=!1,...l}=s,u={...s,raised:a},d=HY(u);return r.jsx(WY,{className:Ye(d.root,o),elevation:a?8:void 0,ref:n,ownerState:u,...l})});function UY(e){return gt("MuiCardContent",e)}mt("MuiCardContent",["root"]);const qY=e=>{const{classes:t}=e;return pt({root:["root"]},UY,t)},VY=Me("div",{name:"MuiCardContent",slot:"Root"})({padding:16,"&:last-child":{paddingBottom:24}}),ji=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiCardContent"}),{className:o,component:a="div",...l}=s,u={...s,component:a},d=qY(u);return r.jsx(VY,{as:a,className:Ye(d.root,o),ownerState:u,ref:n,...l})});function GY(e){return gt("MuiCardMedia",e)}mt("MuiCardMedia",["root","media","img"]);const YY=e=>{const{classes:t,isMediaComponent:n,isImageComponent:s}=e;return pt({root:["root",n&&"media",s&&"img"]},GY,t)},KY=Me("div",{name:"MuiCardMedia",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{isMediaComponent:s,isImageComponent:o}=n;return[t.root,s&&t.media,o&&t.img]}})({display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center",variants:[{props:{isMediaComponent:!0},style:{width:"100%"}},{props:{isImageComponent:!0},style:{objectFit:"cover"}}]}),XY=["video","audio","picture","iframe","img"],ZY=["picture","img"],DR=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiCardMedia"}),{children:o,className:a,component:l="div",image:u,src:d,style:f,...p}=s,g=XY.includes(l),x=!g&&u?{backgroundImage:`url("${u}")`,...f}:f,b={...s,component:l,isMediaComponent:g,isImageComponent:ZY.includes(l)},y=YY(b);return r.jsx(KY,{className:Ye(y.root,a),as:l,role:!g&&u?"img":void 0,ref:n,style:x,ownerState:b,src:g?u||d:void 0,...p,children:o})});function QY(e){return gt("PrivateSwitchBase",e)}mt("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const JY=e=>{const{classes:t,checked:n,disabled:s,edge:o}=e,a={root:["root",n&&"checked",s&&"disabled",o&&`edge${Le(o)}`],input:["input"]};return pt(a,QY,t)},eK=Me(Li,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),tK=Me("input",{name:"MuiSwitchBase",shouldForwardProp:Us})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),OR=v.forwardRef(function(t,n){const{autoFocus:s,checked:o,checkedIcon:a,defaultChecked:l,disabled:u,disableFocusRipple:d=!1,edge:f=!1,icon:p,id:g,inputProps:x,inputRef:b,name:y,onBlur:S,onChange:j,onFocus:A,readOnly:M,required:R=!1,tabIndex:_,type:z,value:F,slots:N={},slotProps:I={},...B}=t,[H,P]=la({controlled:o,default:!!l,name:"SwitchBase",state:"checked"}),k=_l(),L=ue=>{A&&A(ue),k&&k.onFocus&&k.onFocus(ue)},O=ue=>{S&&S(ue),k&&k.onBlur&&k.onBlur(ue)},W=ue=>{if(ue.nativeEvent.defaultPrevented||M)return;const se=ue.target.checked;P(se),j&&j(ue,se)};let D=u;k&&typeof D>"u"&&(D=k.disabled);const q=z==="checkbox"||z==="radio",K={...t,checked:H,disabled:D,disableFocusRipple:d,edge:f},Y=JY(K),ie={slots:N,slotProps:{input:x,...I}},[V,re]=jt("root",{ref:n,elementType:eK,className:Y.root,shouldForwardComponentProp:!0,externalForwardedProps:{...ie,component:"span",...B},getSlotProps:ue=>({...ue,onFocus:se=>{ue.onFocus?.(se),L(se)},onBlur:se=>{ue.onBlur?.(se),O(se)}}),ownerState:K,additionalProps:{centerRipple:!0,focusRipple:!d,role:void 0,tabIndex:null}}),[fe,ae]=jt("input",{ref:b,elementType:tK,className:Y.input,externalForwardedProps:ie,getSlotProps:ue=>({...ue,onChange:se=>{ue.onChange?.(se),W(se)}}),ownerState:K,additionalProps:{autoFocus:s,checked:o,defaultChecked:l,disabled:D,id:q?g:void 0,name:y,readOnly:M,required:R,tabIndex:_,type:z,...z==="checkbox"&&F===void 0?{}:{value:F}}});return r.jsxs(V,{...re,children:[r.jsx(fe,{...ae}),H?a:p]})}),nK=ze(r.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})),rK=ze(r.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),sK=ze(r.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}));function oK(e){return gt("MuiCheckbox",e)}const V2=mt("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),iK=e=>{const{classes:t,indeterminate:n,color:s,size:o}=e,a={root:["root",n&&"indeterminate",`color${Le(s)}`,`size${Le(o)}`]},l=pt(a,oK,t);return{...t,...l}},aK=Me(OR,{shouldForwardProp:e=>Us(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${Le(n.size)}`],n.color!=="default"&&t[`color${Le(n.color)}`]]}})(St(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(er()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(er()).map(([t])=>({props:{color:t},style:{[`&.${V2.checked}, &.${V2.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${V2.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),lK=r.jsx(rK,{}),cK=r.jsx(nK,{}),uK=r.jsx(sK,{}),$f=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiCheckbox"}),{checkedIcon:o=lK,color:a="primary",icon:l=cK,indeterminate:u=!1,indeterminateIcon:d=uK,inputProps:f,size:p="medium",disableRipple:g=!1,className:x,slots:b={},slotProps:y={},...S}=s,j=u?d:l,A=u?d:o,M={...s,disableRipple:g,color:a,indeterminate:u,size:p},R=iK(M),_=y.input??f,[z,F]=jt("root",{ref:n,elementType:aK,className:Ye(R.root,x),shouldForwardComponentProp:!0,externalForwardedProps:{slots:b,slotProps:y,...S},ownerState:M,additionalProps:{type:"checkbox",icon:v.cloneElement(j,{fontSize:j.props.fontSize??p}),checkedIcon:v.cloneElement(A,{fontSize:A.props.fontSize??p}),disableRipple:g,slots:b,slotProps:{input:rC(typeof _=="function"?_(M):_,{"data-indeterminate":u})}}});return r.jsx(z,{...F,classes:R})});function E6(e){return e.substring(2).toLowerCase()}function dK(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function fK(e){const{children:t,disableReactTree:n=!1,mouseEvent:s="onClick",onClickAway:o,touchEvent:a="onTouchEnd"}=e,l=v.useRef(!1),u=v.useRef(null),d=v.useRef(!1),f=v.useRef(!1);v.useEffect(()=>(setTimeout(()=>{d.current=!0},0),()=>{d.current=!1}),[]);const p=vr(Nc(t),u),g=pn(y=>{const S=f.current;f.current=!1;const j=is(u.current);if(!d.current||!u.current||"clientX"in y&&dK(y,j))return;if(l.current){l.current=!1;return}let A;y.composedPath?A=y.composedPath().includes(u.current):A=!j.documentElement.contains(y.target)||u.current.contains(y.target),!A&&(n||!S)&&o(y)}),x=y=>S=>{f.current=!0;const j=t.props[y];j&&j(S)},b={ref:p};return a!==!1&&(b[a]=x(a)),v.useEffect(()=>{if(a!==!1){const y=E6(a),S=is(u.current),j=()=>{l.current=!0};return S.addEventListener(y,g),S.addEventListener("touchmove",j),()=>{S.removeEventListener(y,g),S.removeEventListener("touchmove",j)}}},[g,a]),s!==!1&&(b[s]=x(s)),v.useEffect(()=>{if(s!==!1){const y=E6(s),S=is(u.current);return S.addEventListener(y,g),()=>{S.removeEventListener(y,g)}}},[g,s]),v.cloneElement(t,b)}const Zs=mW({createStyledComponent:Me("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`maxWidth${Le(String(n.maxWidth))}`],n.fixed&&t.fixed,n.disableGutters&&t.disableGutters]}}),useThemeProps:e=>Tt({props:e,name:"MuiContainer"})});function BR(e=window){const t=e.document.documentElement.clientWidth;return e.innerWidth-t}function hK(e){const t=is(e);return t.body===e?wo(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function Wp(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function T6(e){return parseFloat(wo(e).getComputedStyle(e).paddingRight)||0}function pK(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),s=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||s}function k6(e,t,n,s,o){const a=[t,n,...s];[].forEach.call(e.children,l=>{const u=!a.includes(l),d=!pK(l);u&&d&&Wp(l,o)})}function G2(e,t){let n=-1;return e.some((s,o)=>t(s)?(n=o,!0):!1),n}function gK(e,t){const n=[],s=e.container;if(!t.disableScrollLock){if(hK(s)){const l=BR(wo(s));n.push({value:s.style.paddingRight,property:"padding-right",el:s}),s.style.paddingRight=`${T6(s)+l}px`;const u=is(s).querySelectorAll(".mui-fixed");[].forEach.call(u,d=>{n.push({value:d.style.paddingRight,property:"padding-right",el:d}),d.style.paddingRight=`${T6(d)+l}px`})}let a;if(s.parentNode instanceof DocumentFragment)a=is(s).body;else{const l=s.parentElement,u=wo(s);a=l?.nodeName==="HTML"&&u.getComputedStyle(l).overflowY==="scroll"?l:s}n.push({value:a.style.overflow,property:"overflow",el:a},{value:a.style.overflowX,property:"overflow-x",el:a},{value:a.style.overflowY,property:"overflow-y",el:a}),a.style.overflow="hidden"}return()=>{n.forEach(({value:a,el:l,property:u})=>{a?l.style.setProperty(u,a):l.style.removeProperty(u)})}}function mK(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class xK{constructor(){this.modals=[],this.containers=[]}add(t,n){let s=this.modals.indexOf(t);if(s!==-1)return s;s=this.modals.length,this.modals.push(t),t.modalRef&&Wp(t.modalRef,!1);const o=mK(n);k6(n,t.mount,t.modalRef,o,!0);const a=G2(this.containers,l=>l.container===n);return a!==-1?(this.containers[a].modals.push(t),s):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:o}),s)}mount(t,n){const s=G2(this.containers,a=>a.modals.includes(t)),o=this.containers[s];o.restore||(o.restore=gK(o,n))}remove(t,n=!0){const s=this.modals.indexOf(t);if(s===-1)return s;const o=G2(this.containers,l=>l.modals.includes(t)),a=this.containers[o];if(a.modals.splice(a.modals.indexOf(t),1),this.modals.splice(s,1),a.modals.length===0)a.restore&&a.restore(),t.modalRef&&Wp(t.modalRef,n),k6(a.container,t.mount,t.modalRef,a.hiddenSiblings,!1),this.containers.splice(o,1);else{const l=a.modals[a.modals.length-1];l.modalRef&&Wp(l.modalRef,!1)}return s}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function xf(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}const bK=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function yK(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function vK(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=s=>e.ownerDocument.querySelector(`input[type="radio"]${s}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function SK(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||vK(e))}function jK(e){const t=[],n=[];return Array.from(e.querySelectorAll(bK)).forEach((s,o)=>{const a=yK(s);a===-1||!SK(s)||(a===0?t.push(s):n.push({documentOrder:o,tabIndex:a,node:s}))}),n.sort((s,o)=>s.tabIndex===o.tabIndex?s.documentOrder-o.documentOrder:s.tabIndex-o.tabIndex).map(s=>s.node).concat(t)}function CK(){return!0}function wK(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:s=!1,disableRestoreFocus:o=!1,getTabbable:a=jK,isEnabled:l=CK,open:u}=e,d=v.useRef(!1),f=v.useRef(null),p=v.useRef(null),g=v.useRef(null),x=v.useRef(null),b=v.useRef(!1),y=v.useRef(null),S=vr(Nc(t),y),j=v.useRef(null);v.useEffect(()=>{!u||!y.current||(b.current=!n)},[n,u]),v.useEffect(()=>{if(!u||!y.current)return;const R=is(y.current),_=xf(R);return y.current.contains(_)||(y.current.hasAttribute("tabIndex")||y.current.setAttribute("tabIndex","-1"),b.current&&y.current.focus()),()=>{o||(g.current&&g.current.focus&&(d.current=!0,g.current.focus()),g.current=null)}},[u]),v.useEffect(()=>{if(!u||!y.current)return;const R=is(y.current),_=N=>{if(j.current=N,s||!l()||N.key!=="Tab")return;xf(R)===y.current&&N.shiftKey&&(d.current=!0,p.current&&p.current.focus())},z=()=>{const N=y.current;if(N===null)return;const I=xf(R);if(!R.hasFocus()||!l()||d.current){d.current=!1;return}if(N.contains(I)||s&&I!==f.current&&I!==p.current)return;if(I!==x.current)x.current=null;else if(x.current!==null)return;if(!b.current)return;let B=[];if((I===f.current||I===p.current)&&(B=a(y.current)),B.length>0){const H=!!(j.current?.shiftKey&&j.current?.key==="Tab"),P=B[0],k=B[B.length-1];typeof P!="string"&&typeof k!="string"&&(H?k.focus():P.focus())}else N.focus()};R.addEventListener("focusin",z),R.addEventListener("keydown",_,!0);const F=setInterval(()=>{const N=xf(R);N&&N.tagName==="BODY"&&z()},50);return()=>{clearInterval(F),R.removeEventListener("focusin",z),R.removeEventListener("keydown",_,!0)}},[n,s,o,l,u,a]);const A=R=>{g.current===null&&(g.current=R.relatedTarget),b.current=!0,x.current=R.target;const _=t.props.onFocus;_&&_(R)},M=R=>{g.current===null&&(g.current=R.relatedTarget),b.current=!0};return r.jsxs(v.Fragment,{children:[r.jsx("div",{tabIndex:u?0:-1,onFocus:M,ref:f,"data-testid":"sentinelStart"}),v.cloneElement(t,{ref:S,onFocus:A}),r.jsx("div",{tabIndex:u?0:-1,onFocus:M,ref:p,"data-testid":"sentinelEnd"})]})}function AK(e){return typeof e=="function"?e():e}function EK(e){return e?e.props.hasOwnProperty("in"):!1}const M6=()=>{},qx=new xK;function TK(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:s=!1,closeAfterTransition:o=!1,onTransitionEnter:a,onTransitionExited:l,children:u,onClose:d,open:f,rootRef:p}=e,g=v.useRef({}),x=v.useRef(null),b=v.useRef(null),y=vr(b,p),[S,j]=v.useState(!f),A=EK(u);let M=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(M=!1);const R=()=>is(x.current),_=()=>(g.current.modalRef=b.current,g.current.mount=x.current,g.current),z=()=>{qx.mount(_(),{disableScrollLock:s}),b.current&&(b.current.scrollTop=0)},F=pn(()=>{const W=AK(t)||R().body;qx.add(_(),W),b.current&&z()}),N=()=>qx.isTopModal(_()),I=pn(W=>{x.current=W,W&&(f&&N()?z():b.current&&Wp(b.current,M))}),B=v.useCallback(()=>{qx.remove(_(),M)},[M]);v.useEffect(()=>()=>{B()},[B]),v.useEffect(()=>{f?F():(!A||!o)&&B()},[f,B,A,o,F]);const H=W=>D=>{W.onKeyDown?.(D),!(D.key!=="Escape"||D.which===229||!N())&&(n||(D.stopPropagation(),d&&d(D,"escapeKeyDown")))},P=W=>D=>{W.onClick?.(D),D.target===D.currentTarget&&d&&d(D,"backdropClick")};return{getRootProps:(W={})=>{const D=Au(e);delete D.onTransitionEnter,delete D.onTransitionExited;const q={...D,...W};return{role:"presentation",...q,onKeyDown:H(q),ref:y}},getBackdropProps:(W={})=>{const D=W;return{"aria-hidden":!0,...D,onClick:P(D),open:f}},getTransitionProps:()=>{const W=()=>{j(!1),a&&a()},D=()=>{j(!0),l&&l(),o&&B()};return{onEnter:YT(W,u?.props.onEnter??M6),onExited:YT(D,u?.props.onExited??M6)}},rootRef:y,portalRef:I,isTopModal:N,exited:S,hasTransition:A}}function kK(e){return gt("MuiModal",e)}mt("MuiModal",["root","hidden","backdrop"]);const MK=e=>{const{open:t,exited:n,classes:s}=e;return pt({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},kK,s)},RK=Me("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(St(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:t})=>!t.open&&t.exited,style:{visibility:"hidden"}}]}))),zK=Me(gC,{name:"MuiModal",slot:"Backdrop"})({zIndex:-1}),tr=v.forwardRef(function(t,n){const s=Tt({name:"MuiModal",props:t}),{BackdropComponent:o=zK,BackdropProps:a,classes:l,className:u,closeAfterTransition:d=!1,children:f,container:p,component:g,components:x={},componentsProps:b={},disableAutoFocus:y=!1,disableEnforceFocus:S=!1,disableEscapeKeyDown:j=!1,disablePortal:A=!1,disableRestoreFocus:M=!1,disableScrollLock:R=!1,hideBackdrop:_=!1,keepMounted:z=!1,onClose:F,onTransitionEnter:N,onTransitionExited:I,open:B,slotProps:H={},slots:P={},theme:k,...L}=s,O={...s,closeAfterTransition:d,disableAutoFocus:y,disableEnforceFocus:S,disableEscapeKeyDown:j,disablePortal:A,disableRestoreFocus:M,disableScrollLock:R,hideBackdrop:_,keepMounted:z},{getRootProps:W,getBackdropProps:D,getTransitionProps:q,portalRef:K,isTopModal:Y,exited:ie,hasTransition:V}=TK({...O,rootRef:n}),re={...O,exited:ie},fe=MK(re),ae={};if(f.props.tabIndex===void 0&&(ae.tabIndex="-1"),V){const{onEnter:ge,onExited:de}=q();ae.onEnter=ge,ae.onExited=de}const ue={slots:{root:x.Root,backdrop:x.Backdrop,...P},slotProps:{...b,...H}},[se,J]=jt("root",{ref:n,elementType:RK,externalForwardedProps:{...ue,...L,component:g},getSlotProps:W,ownerState:re,className:Ye(u,fe?.root,!re.open&&re.exited&&fe?.hidden)}),[ce,oe]=jt("backdrop",{ref:a?.ref,elementType:o,externalForwardedProps:ue,shouldForwardComponentProp:!0,additionalProps:a,getSlotProps:ge=>D({...ge,onClick:de=>{ge?.onClick&&ge.onClick(de)}}),className:Ye(a?.className,fe?.backdrop),ownerState:re});return!z&&!B&&(!V||ie)?null:r.jsx(_R,{ref:K,container:p,disablePortal:A,children:r.jsxs(se,{...J,children:[!_&&o?r.jsx(ce,{...oe}):null,r.jsx(wK,{disableEnforceFocus:S,disableAutoFocus:y,disableRestoreFocus:M,isEnabled:Y,open:B,children:v.cloneElement(f,ae)})]})})});function IK(e){return gt("MuiDialog",e)}const Y2=mt("MuiDialog",["root","backdrop","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),NR=v.createContext({}),FK=Me(gC,{name:"MuiDialog",slot:"Backdrop"})({zIndex:-1}),_K=e=>{const{classes:t,scroll:n,maxWidth:s,fullWidth:o,fullScreen:a}=e,l={root:["root"],backdrop:["backdrop"],container:["container",`scroll${Le(n)}`],paper:["paper",`paperScroll${Le(n)}`,`paperWidth${Le(String(s))}`,o&&"paperFullWidth",a&&"paperFullScreen"]};return pt(l,IK,t)},LK=Me(tr,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),PK=Me("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${Le(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),DK=Me(Je,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${Le(n.scroll)}`],t[`paperWidth${Le(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(St(({theme:e})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:t})=>!t.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:e.breakpoints.unit==="px"?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${Y2.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter(t=>t!=="xs").map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${Y2.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:t})=>t.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:t})=>t.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${Y2.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),OK=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiDialog"}),o=On(),a={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{"aria-describedby":l,"aria-labelledby":u,"aria-modal":d=!0,BackdropComponent:f,BackdropProps:p,children:g,className:x,disableEscapeKeyDown:b=!1,fullScreen:y=!1,fullWidth:S=!1,maxWidth:j="sm",onClick:A,onClose:M,open:R,PaperComponent:_=Je,PaperProps:z={},role:F="dialog",scroll:N="paper",slots:I={},slotProps:B={},TransitionComponent:H=Du,transitionDuration:P=a,TransitionProps:k,...L}=s,O={...s,disableEscapeKeyDown:b,fullScreen:y,fullWidth:S,maxWidth:j,scroll:N},W=_K(O),D=v.useRef(),q=X=>{D.current=X.target===X.currentTarget},K=X=>{A&&A(X),D.current&&(D.current=null,M&&M(X,"backdropClick"))},Y=Hi(u),ie=v.useMemo(()=>({titleId:Y}),[Y]),V={transition:H,...I},re={transition:k,paper:z,backdrop:p,...B},fe={slots:V,slotProps:re},[ae,ue]=jt("root",{elementType:LK,shouldForwardComponentProp:!0,externalForwardedProps:fe,ownerState:O,className:Ye(W.root,x),ref:n}),[se,J]=jt("backdrop",{elementType:FK,shouldForwardComponentProp:!0,externalForwardedProps:fe,ownerState:O,className:W.backdrop}),[ce,oe]=jt("paper",{elementType:DK,shouldForwardComponentProp:!0,externalForwardedProps:fe,ownerState:O,className:Ye(W.paper,z.className)}),[ge,de]=jt("container",{elementType:PK,externalForwardedProps:fe,ownerState:O,className:W.container}),[le,ee]=jt("transition",{elementType:Du,externalForwardedProps:fe,ownerState:O,additionalProps:{appear:!0,in:R,timeout:P,role:"presentation"}});return r.jsx(ae,{closeAfterTransition:!0,slots:{backdrop:se},slotProps:{backdrop:{transitionDuration:P,as:f,...J}},disableEscapeKeyDown:b,onClose:M,open:R,onClick:K,...ue,...L,children:r.jsx(le,{...ee,children:r.jsx(ge,{onMouseDown:q,...de,children:r.jsx(ce,{as:_,elevation:24,role:F,"aria-describedby":l,"aria-labelledby":Y,"aria-modal":d,...oe,children:r.jsx(NR.Provider,{value:ie,children:g})})})})})});function BK(e){return gt("MuiDialogActions",e)}mt("MuiDialogActions",["root","spacing"]);const NK=e=>{const{classes:t,disableSpacing:n}=e;return pt({root:["root",!n&&"spacing"]},BK,t)},$K=Me("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),HK=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiDialogActions"}),{className:o,disableSpacing:a=!1,...l}=s,u={...s,disableSpacing:a},d=NK(u);return r.jsx($K,{className:Ye(d.root,o),ownerState:u,ref:n,...l})});function WK(e){return gt("MuiDialogContent",e)}mt("MuiDialogContent",["root","dividers"]);function UK(e){return gt("MuiDialogTitle",e)}const qK=mt("MuiDialogTitle",["root"]),VK=e=>{const{classes:t,dividers:n}=e;return pt({root:["root",n&&"dividers"]},WK,t)},GK=Me("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(St(({theme:e})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:t})=>t.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>!t.dividers,style:{[`.${qK.root} + &`]:{paddingTop:0}}}]}))),YK=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiDialogContent"}),{className:o,dividers:a=!1,...l}=s,u={...s,dividers:a},d=VK(u);return r.jsx(GK,{className:Ye(d.root,o),ownerState:u,ref:n,...l})}),KK=e=>{const{classes:t}=e;return pt({root:["root"]},UK,t)},XK=Me(C,{name:"MuiDialogTitle",slot:"Root"})({padding:"16px 24px",flex:"0 0 auto"}),ZK=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiDialogTitle"}),{className:o,id:a,...l}=s,u=s,d=KK(u),{titleId:f=a}=v.useContext(NR);return r.jsx(XK,{component:"h2",className:Ye(d.root,o),ownerState:u,ref:n,variant:"h6",id:a??f,...l})});function QK(e){return gt("MuiDivider",e)}const R6=mt("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),JK=e=>{const{absolute:t,children:n,classes:s,flexItem:o,light:a,orientation:l,textAlign:u,variant:d}=e;return pt({root:["root",t&&"absolute",d,a&&"light",l==="vertical"&&"vertical",o&&"flexItem",n&&"withChildren",n&&l==="vertical"&&"withChildrenVertical",u==="right"&&l!=="vertical"&&"textAlignRight",u==="left"&&l!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",l==="vertical"&&"wrapperVertical"]},QK,s)},eX=Me("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,n.orientation==="vertical"&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&n.orientation==="vertical"&&t.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&t.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&t.textAlignLeft]}})(St(({theme:e})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:e.alpha((e.vars||e).palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:e.spacing(2),marginRight:e.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:e.spacing(1),marginBottom:e.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:t})=>!!t.children,style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:t})=>t.children&&t.orientation!=="vertical",style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:t})=>t.orientation==="vertical"&&t.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:t})=>t.textAlign==="right"&&t.orientation!=="vertical",style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:t})=>t.textAlign==="left"&&t.orientation!=="vertical",style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),tX=Me("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.wrapper,n.orientation==="vertical"&&t.wrapperVertical]}})(St(({theme:e})=>({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`}}]}))),Ir=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiDivider"}),{absolute:o=!1,children:a,className:l,orientation:u="horizontal",component:d=a||u==="vertical"?"div":"hr",flexItem:f=!1,light:p=!1,role:g=d!=="hr"?"separator":void 0,textAlign:x="center",variant:b="fullWidth",...y}=s,S={...s,absolute:o,component:d,flexItem:f,light:p,orientation:u,role:g,textAlign:x,variant:b},j=JK(S);return r.jsx(eX,{as:d,className:Ye(j.root,l),role:g,ref:n,ownerState:S,"aria-orientation":g==="separator"&&(d!=="hr"||u==="vertical")?u:void 0,...y,children:a?r.jsx(tX,{className:j.wrapper,ownerState:S,children:a}):null})});Ir&&(Ir.muiSkipListHighlight=!0);const nX={visibility:"hidden"};function rX(e,t,n){const s=n&&n.getBoundingClientRect(),o=wo(t),a=t.style.transform,l=t.style.transition;t.style.transition="",t.style.transform="";const u=t.getBoundingClientRect(),f=o.getComputedStyle(t).getPropertyValue("transform");t.style.transform=a,t.style.transition=l;let p=0,g=0;if(f&&f!=="none"&&typeof f=="string"){const x=f.split("(")[1].split(")")[0].split(",");p=parseInt(x[4],10),g=parseInt(x[5],10)}return e==="left"?s?`translateX(${s.right+p-u.left}px)`:`translateX(${o.innerWidth+p-u.left}px)`:e==="right"?s?`translateX(-${u.right-s.left-p}px)`:`translateX(-${u.left+u.width-p}px)`:e==="up"?s?`translateY(${s.bottom+g-u.top}px)`:`translateY(${o.innerHeight+g-u.top}px)`:s?`translateY(-${u.top-s.top+u.height-g}px)`:`translateY(-${u.top+u.height-g}px)`}function sX(e){return typeof e=="function"?e():e}function Vx(e,t,n){const s=sX(n),o=rX(e,t,s);o&&(t.style.transform=o)}const oX=v.forwardRef(function(t,n){const s=On(),o={enter:s.transitions.easing.easeOut,exit:s.transitions.easing.sharp},a={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{addEndListener:l,appear:u=!0,children:d,container:f,direction:p="down",easing:g=o,in:x,onEnter:b,onEntered:y,onEntering:S,onExit:j,onExited:A,onExiting:M,style:R,timeout:_=a,...z}=t,F=v.useRef(null),N=vr(Nc(d),F,n),I=Or(F,(D,q)=>{Vx(p,D,f),iC(D),b&&b(D,q)}),B=Or(F,(D,q)=>{const K=Ic({timeout:_,style:R,easing:g},{mode:"enter"});D.style.transition=s.transitions.create("transform",K),D.style.transform="none",S&&S(D,q)}),H=Or(F,y),P=Or(F,M),k=Or(F,D=>{const q=Ic({timeout:_,style:R,easing:g},{mode:"exit"});D.style.transition=s.transitions.create("transform",q),Vx(p,D,f),j&&j(D)}),L=Or(F,D=>{D.style.transition="",A&&A(D)}),O=D=>{l&&l(F.current,D)},W=v.useCallback(()=>{F.current&&Vx(p,F.current,f)},[p,f]);return v.useEffect(()=>{if(x||p==="down"||p==="right")return;const D=Vg(()=>{F.current&&Vx(p,F.current,f)}),q=wo(F.current);return q.addEventListener("resize",D),()=>{D.clear(),q.removeEventListener("resize",D)}},[p,x,f]),v.useEffect(()=>{x||W()},[x,W]),r.jsx(Ui,{nodeRef:F,onEnter:I,onEntered:H,onEntering:B,onExit:k,onExited:L,onExiting:P,addEndListener:O,appear:u,in:x,timeout:_,...z,children:(D,{ownerState:q,...K})=>{let Y;return D==="exited"&&!x?Y=R||d.props.style?{visibility:"hidden",...R,...d.props.style}:nX:R&&d.props.style?Y={...R,...d.props.style}:Y=R||d.props.style,v.cloneElement(d,{ref:N,style:Y,...K})}})});function iX(e){return gt("MuiDrawer",e)}mt("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const $R=(e,t)=>{const{ownerState:n}=e;return[t.root,(n.variant==="permanent"||n.variant==="persistent")&&t.docked,n.variant==="temporary"&&t.modal]},aX=e=>{const{classes:t,anchor:n,variant:s}=e,o={root:["root",`anchor${Le(n)}`],docked:[(s==="permanent"||s==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${Le(n)}`,s!=="temporary"&&`paperAnchorDocked${Le(n)}`]};return pt(o,iX,t)},lX=Me(tr,{name:"MuiDrawer",slot:"Root",overridesResolver:$R})(St(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),cX=Me("div",{shouldForwardProp:Us,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:$R})({flex:"0 0 auto"}),uX=Me(Je,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`paperAnchor${Le(n.anchor)}`],n.variant!=="temporary"&&t[`paperAnchorDocked${Le(n.anchor)}`]]}})(St(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:t})=>t.anchor==="left"&&t.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="top"&&t.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="right"&&t.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="bottom"&&t.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),HR={left:"right",right:"left",top:"down",bottom:"up"};function dX(e){return["left","right"].includes(e)}function fX({direction:e},t){return e==="rtl"&&dX(t)?HR[t]:t}const Ou=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiDrawer"}),o=On(),a=Ao(),l={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{anchor:u="left",BackdropProps:d,children:f,className:p,elevation:g=16,hideBackdrop:x=!1,ModalProps:{BackdropProps:b,...y}={},onClose:S,open:j=!1,PaperProps:A={},SlideProps:M,TransitionComponent:R,transitionDuration:_=l,variant:z="temporary",slots:F={},slotProps:N={},...I}=s,B=v.useRef(!1);v.useEffect(()=>{B.current=!0},[]);const H=fX({direction:a?"rtl":"ltr"},u),k={...s,anchor:u,elevation:g,open:j,variant:z,...I},L=aX(k),O={slots:{transition:R,...F},slotProps:{paper:A,transition:M,...N,backdrop:rC(N.backdrop||{...d,...b},{transitionDuration:_})}},[W,D]=jt("root",{ref:n,elementType:lX,className:Ye(L.root,L.modal,p),shouldForwardComponentProp:!0,ownerState:k,externalForwardedProps:{...O,...I,...y},additionalProps:{open:j,onClose:S,hideBackdrop:x,slots:{backdrop:O.slots.backdrop},slotProps:{backdrop:O.slotProps.backdrop}}}),[q,K]=jt("paper",{elementType:uX,shouldForwardComponentProp:!0,className:Ye(L.paper,A.className),ownerState:k,externalForwardedProps:O,additionalProps:{elevation:z==="temporary"?g:0,square:!0,...z==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[Y,ie]=jt("docked",{elementType:cX,ref:n,className:Ye(L.root,L.docked,p),ownerState:k,externalForwardedProps:O,additionalProps:I}),[V,re]=jt("transition",{elementType:oX,ownerState:k,externalForwardedProps:O,additionalProps:{in:j,direction:HR[H],timeout:_,appear:B.current}}),fe=r.jsx(q,{...K,children:f});if(z==="permanent")return r.jsx(Y,{...ie,children:fe});const ae=r.jsx(V,{...re,children:fe});return z==="persistent"?r.jsx(Y,{...ie,children:ae}):r.jsx(W,{...D,children:ae})}),hX=e=>{const{classes:t,disableUnderline:n,startAdornment:s,endAdornment:o,size:a,hiddenLabel:l,multiline:u}=e,d={root:["root",!n&&"underline",s&&"adornedStart",o&&"adornedEnd",a==="small"&&`size${Le(a)}`,l&&"hiddenLabel",u&&"multiline"],input:["input"]},f=pt(d,$G,t);return{...t,...f}},pX=Me(bb,{shouldForwardProp:e=>Us(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...mb(e,t),!n.disableUnderline&&t.underline]}})(St(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",s=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",a=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:s,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:s}},[`&.${Go.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:s},[`&.${Go.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:a},variants:[{props:({ownerState:l})=>!l.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Go.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Go.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline):n}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Go.disabled}, .${Go.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${Go.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(er()).map(([l])=>({props:{disableUnderline:!1,color:l},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[l]?.main}`}}})),{props:({ownerState:l})=>l.startAdornment,style:{paddingLeft:12}},{props:({ownerState:l})=>l.endAdornment,style:{paddingRight:12}},{props:({ownerState:l})=>l.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:l,size:u})=>l.multiline&&u==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:l})=>l.multiline&&l.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:l})=>l.multiline&&l.hiddenLabel&&l.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),gX=Me(yb,{name:"MuiFilledInput",slot:"Input",overridesResolver:xb})(St(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:t})=>t.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}},{props:({ownerState:t})=>t.hiddenLabel&&t.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:t})=>t.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),bC=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiFilledInput"}),{disableUnderline:o=!1,components:a={},componentsProps:l,fullWidth:u=!1,hiddenLabel:d,inputComponent:f="input",multiline:p=!1,slotProps:g,slots:x={},type:b="text",...y}=s,S={...s,disableUnderline:o,fullWidth:u,inputComponent:f,multiline:p,type:b},j=hX(s),A={root:{ownerState:S},input:{ownerState:S}},M=g??l?As(A,g??l):A,R=x.root??a.Root??pX,_=x.input??a.Input??gX;return r.jsx(sr,{slots:{root:R,input:_},slotProps:M,fullWidth:u,inputComponent:f,multiline:p,ref:n,type:b,...y,classes:j})});bC.muiName="Input";function mX(e){return gt("MuiFormControl",e)}mt("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const xX=e=>{const{classes:t,margin:n,fullWidth:s}=e,o={root:["root",n!=="none"&&`margin${Le(n)}`,s&&"fullWidth"]};return pt(o,mX,t)},bX=Me("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${Le(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),Ur=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiFormControl"}),{children:o,className:a,color:l="primary",component:u="div",disabled:d=!1,error:f=!1,focused:p,fullWidth:g=!1,hiddenLabel:x=!1,margin:b="none",required:y=!1,size:S="medium",variant:j="outlined",...A}=s,M={...s,color:l,component:u,disabled:d,error:f,fullWidth:g,hiddenLabel:x,margin:b,required:y,size:S,variant:j},R=xX(M),[_,z]=v.useState(()=>{let W=!1;return o&&v.Children.forEach(o,D=>{if(!Bp(D,["Input","Select"]))return;const q=Bp(D,["Select"])?D.props.input:D;q&&PG(q.props)&&(W=!0)}),W}),[F,N]=v.useState(()=>{let W=!1;return o&&v.Children.forEach(o,D=>{Bp(D,["Input","Select"])&&(s1(D.props,!0)||s1(D.props.inputProps,!0))&&(W=!0)}),W}),[I,B]=v.useState(!1);d&&I&&B(!1);const H=p!==void 0&&!d?p:I;let P;v.useRef(!1);const k=v.useCallback(()=>{N(!0)},[]),L=v.useCallback(()=>{N(!1)},[]),O=v.useMemo(()=>({adornedStart:_,setAdornedStart:z,color:l,disabled:d,error:f,filled:F,focused:H,fullWidth:g,hiddenLabel:x,size:S,onBlur:()=>{B(!1)},onFocus:()=>{B(!0)},onEmpty:L,onFilled:k,registerEffect:P,required:y,variant:j}),[_,l,d,f,F,H,g,x,P,L,k,y,S,j]);return r.jsx(gb.Provider,{value:O,children:r.jsx(bX,{as:u,ownerState:M,className:Ye(R.root,a),ref:n,...A,children:o})})});function yX(e){return gt("MuiFormControlLabel",e)}const Rp=mt("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),vX=e=>{const{classes:t,disabled:n,labelPlacement:s,error:o,required:a}=e,l={root:["root",n&&"disabled",`labelPlacement${Le(s)}`,o&&"error",a&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",o&&"error"]};return pt(l,yX,t)},SX=Me("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Rp.label}`]:t.label},t.root,t[`labelPlacement${Le(n.labelPlacement)}`]]}})(St(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Rp.disabled}`]:{cursor:"default"},[`& .${Rp.label}`]:{[`&.${Rp.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:t})=>t==="start"||t==="top"||t==="bottom",style:{marginLeft:16}}]}))),jX=Me("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(St(({theme:e})=>({[`&.${Rp.error}`]:{color:(e.vars||e).palette.error.main}}))),vb=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiFormControlLabel"}),{checked:o,className:a,componentsProps:l={},control:u,disabled:d,disableTypography:f,inputRef:p,label:g,labelPlacement:x="end",name:b,onChange:y,required:S,slots:j={},slotProps:A={},value:M,...R}=s,_=_l(),z=d??u.props.disabled??_?.disabled,F=S??u.props.required,N={disabled:z,required:F};["checked","name","onChange","value","inputRef"].forEach(W=>{typeof u.props[W]>"u"&&typeof s[W]<"u"&&(N[W]=s[W])});const I=Gu({props:s,muiFormControl:_,states:["error"]}),B={...s,disabled:z,labelPlacement:x,required:F,error:I.error},H=vX(B),P={slots:j,slotProps:{...l,...A}},[k,L]=jt("typography",{elementType:C,externalForwardedProps:P,ownerState:B});let O=g;return O!=null&&O.type!==C&&!f&&(O=r.jsx(k,{component:"span",...L,className:Ye(H.label,L?.className),children:O})),r.jsxs(SX,{className:Ye(H.root,a),ownerState:B,ref:n,...R,children:[v.cloneElement(u,N),F?r.jsxs("div",{children:[O,r.jsxs(jX,{ownerState:B,"aria-hidden":!0,className:H.asterisk,children:[" ","*"]})]}):O]})});function CX(e){return gt("MuiFormHelperText",e)}const z6=mt("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var I6;const wX=e=>{const{classes:t,contained:n,size:s,disabled:o,error:a,filled:l,focused:u,required:d}=e,f={root:["root",o&&"disabled",a&&"error",s&&`size${Le(s)}`,n&&"contained",u&&"focused",l&&"filled",d&&"required"]};return pt(f,CX,t)},AX=Me("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${Le(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(St(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${z6.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${z6.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:t})=>t.contained,style:{marginLeft:14,marginRight:14}}]}))),EX=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiFormHelperText"}),{children:o,className:a,component:l="p",disabled:u,error:d,filled:f,focused:p,margin:g,required:x,variant:b,...y}=s,S=_l(),j=Gu({props:s,muiFormControl:S,states:["variant","size","disabled","error","filled","focused","required"]}),A={...s,component:l,contained:j.variant==="filled"||j.variant==="outlined",variant:j.variant,size:j.size,disabled:j.disabled,error:j.error,filled:j.filled,focused:j.focused,required:j.required};delete A.ownerState;const M=wX(A);return r.jsx(AX,{as:l,className:Ye(M.root,a),ref:n,...y,ownerState:A,children:o===" "?I6||(I6=r.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):o})});function TX(e){return gt("MuiFormLabel",e)}const Up=mt("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),kX=e=>{const{classes:t,color:n,focused:s,disabled:o,error:a,filled:l,required:u}=e,d={root:["root",`color${Le(n)}`,o&&"disabled",a&&"error",l&&"filled",s&&"focused",u&&"required"],asterisk:["asterisk",a&&"error"]};return pt(d,TX,t)},MX=Me("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color==="secondary"&&t.colorSecondary,n.filled&&t.filled]}})(St(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(er()).map(([t])=>({props:{color:t},style:{[`&.${Up.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${Up.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Up.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),RX=Me("span",{name:"MuiFormLabel",slot:"Asterisk"})(St(({theme:e})=>({[`&.${Up.error}`]:{color:(e.vars||e).palette.error.main}}))),zX=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiFormLabel"}),{children:o,className:a,color:l,component:u="label",disabled:d,error:f,filled:p,focused:g,required:x,...b}=s,y=_l(),S=Gu({props:s,muiFormControl:y,states:["color","required","focused","disabled","error","filled"]}),j={...s,color:S.color||"primary",component:u,disabled:S.disabled,error:S.error,filled:S.filled,focused:S.focused,required:S.required},A=kX(j);return r.jsxs(MX,{as:u,ownerState:j,className:Ye(A.root,a),ref:n,...b,children:[o,S.required&&r.jsxs(RX,{ownerState:j,"aria-hidden":!0,className:A.asterisk,children:[" ","*"]})]})}),Zt=IW({createStyledComponent:Me("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.container&&t.container]}}),componentName:"MuiGrid",useThemeProps:e=>Tt({props:e,name:"MuiGrid"}),useTheme:On});function qp(e){return`scale(${e}, ${e**2})`}const IX={entering:{opacity:1,transform:qp(1)},entered:{opacity:1,transform:"none"},exiting:{opacity:0,transform:qp(.75)},exited:{opacity:0,transform:qp(.75)}},FX={opacity:0,transform:qp(.75),visibility:"hidden"},fg=v.forwardRef(function(t,n){const{addEndListener:s,appear:o=!0,children:a,easing:l,in:u,onEnter:d,onEntered:f,onEntering:p,onExit:g,onExited:x,onExiting:b,style:y,timeout:S="auto",...j}=t,A=wc(),M=v.useRef(),R=On(),_=v.useRef(null),z=vr(_,Nc(a),n),F=Or(_,p),N=Or(_,(L,O)=>{iC(L);const{duration:W,delay:D,easing:q}=Ic({style:y,timeout:S,easing:l},{mode:"enter"});let K;S==="auto"?(K=R.transitions.getAutoHeightDuration(L.clientHeight),M.current=K):K=W,L.style.transition=[R.transitions.create("opacity",{duration:K,delay:D}),R.transitions.create("transform",{duration:K*.666,delay:D,easing:q})].join(","),d&&d(L,O)}),I=Or(_,f),B=Or(_,b),H=Or(_,L=>{const{duration:O,delay:W,easing:D}=Ic({style:y,timeout:S,easing:l},{mode:"exit"});let q;S==="auto"?(q=R.transitions.getAutoHeightDuration(L.clientHeight),M.current=q):q=O,L.style.transition=[R.transitions.create("opacity",{duration:q,delay:W}),R.transitions.create("transform",{duration:q*.666,delay:W||q*.333,easing:D})].join(","),L.style.opacity=0,L.style.transform=qp(.75),g&&g(L)}),P=Or(_,L=>{L.style.transition="",x&&x(L)}),k=L=>{S==="auto"&&A.start(M.current||0,L),s&&s(_.current,L)};return r.jsx(Ui,{appear:o,in:u,nodeRef:_,onEnter:N,onEntered:I,onEntering:F,onExit:H,onExited:P,onExiting:B,addEndListener:k,timeout:S==="auto"?null:S,...j,children:(L,{ownerState:O,...W})=>{const D=yR(L,u,IX,FX,y,a.props.style);return v.cloneElement(a,{style:D,ref:z,...W})}})});fg&&(fg.muiSupportAuto=!0);const _X=e=>{const{classes:t,disableUnderline:n}=e,o=pt({root:["root",!n&&"underline"],input:["input"]},BG,t);return{...t,...o}},LX=Me(bb,{shouldForwardProp:e=>Us(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...mb(e,t),!n.disableUnderline&&t.underline]}})(St(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline)),{position:"relative",variants:[{props:({ownerState:s})=>s.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:s})=>!s.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${yc.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${yc.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${yc.disabled}, .${yc.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${yc.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(er()).map(([s])=>({props:{color:s,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[s].main}`}}}))]}})),PX=Me(yb,{name:"MuiInput",slot:"Input",overridesResolver:xb})({}),yC=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiInput"}),{disableUnderline:o=!1,components:a={},componentsProps:l,fullWidth:u=!1,inputComponent:d="input",multiline:f=!1,slotProps:p,slots:g={},type:x="text",...b}=s,y=_X(s),j={root:{ownerState:{disableUnderline:o}}},A=p??l?As(p??l,j):j,M=g.root??a.Root??LX,R=g.input??a.Input??PX;return r.jsx(sr,{slots:{root:M,input:R},slotProps:A,fullWidth:u,inputComponent:d,multiline:f,ref:n,type:x,...b,classes:y})});yC.muiName="Input";function DX(e){return gt("MuiInputAdornment",e)}const F6=mt("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var _6;const OX=(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${Le(n.position)}`],n.disablePointerEvents===!0&&t.disablePointerEvents,t[n.variant]]},BX=e=>{const{classes:t,disablePointerEvents:n,hiddenLabel:s,position:o,size:a,variant:l}=e,u={root:["root",n&&"disablePointerEvents",o&&`position${Le(o)}`,l,s&&"hiddenLabel",a&&`size${Le(a)}`]};return pt(u,DX,t)},NX=Me("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:OX})(St(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${F6.positionStart}&:not(.${F6.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),Ar=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiInputAdornment"}),{children:o,className:a,component:l="div",disablePointerEvents:u=!1,disableTypography:d=!1,position:f,variant:p,...g}=s,x=_l()||{};let b=p;p&&x.variant,x&&!b&&(b=x.variant);const y={...s,hiddenLabel:x.hiddenLabel,size:x.size,disablePointerEvents:u,position:f,variant:b},S=BX(y);return r.jsx(gb.Provider,{value:null,children:r.jsx(NX,{as:l,ownerState:y,className:Ye(S.root,a),ref:n,...g,children:typeof o=="string"&&!d?r.jsx(C,{color:"textSecondary",children:o}):r.jsxs(v.Fragment,{children:[f==="start"?_6||(_6=r.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):null,o]})})})});function $X(e){return gt("MuiInputLabel",e)}mt("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const HX=e=>{const{classes:t,formControl:n,size:s,shrink:o,disableAnimation:a,variant:l,required:u}=e,d={root:["root",n&&"formControl",!a&&"animated",o&&"shrink",s&&s!=="medium"&&`size${Le(s)}`,l],asterisk:[u&&"asterisk"]},f=pt(d,$X,t);return{...t,...f}},WX=Me(zX,{shouldForwardProp:e=>Us(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Up.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(St(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:t})=>t.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:t})=>t.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:t})=>!t.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:t,ownerState:n,size:s})=>t==="filled"&&n.shrink&&s==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),rs=v.forwardRef(function(t,n){const s=Tt({name:"MuiInputLabel",props:t}),{disableAnimation:o=!1,margin:a,shrink:l,variant:u,className:d,...f}=s,p=_l();let g=l;typeof g>"u"&&p&&(g=p.filled||p.focused||p.adornedStart);const x=Gu({props:s,muiFormControl:p,states:["size","variant","required","focused"]}),b={...s,disableAnimation:o,formControl:p,shrink:g,size:x.size,variant:x.variant,required:x.required,focused:x.focused},y=HX(b);return r.jsx(WX,{"data-shrink":g,ref:n,className:Ye(y.root,d),...f,ownerState:b,classes:y})});function UX(e){return gt("MuiLinearProgress",e)}mt("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","bar1","bar2","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const ES=4,TS=Va` 0% { left: -35%; right: 100%; } 60% { left: 100%; right: -90%; } 100% { left: 100%; right: -90%; } `,qX=typeof TS!="string"?Oc` animation: ${TS} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; `:null,kS=Va` 0% { left: -200%; right: 100%; } 60% { left: 107%; right: -8%; } 100% { left: 107%; right: -8%; } `,VX=typeof kS!="string"?Oc` animation: ${kS} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite; `:null,MS=Va` 0% { opacity: 1; background-position: 0 -23px; } 60% { opacity: 0; background-position: 0 -23px; } 100% { opacity: 1; background-position: -200px -23px; } `,GX=typeof MS!="string"?Oc` animation: ${MS} 3s infinite linear; `:null,YX=e=>{const{classes:t,variant:n,color:s}=e,o={root:["root",`color${Le(s)}`,n],dashed:["dashed",`dashedColor${Le(s)}`],bar1:["bar","bar1",`barColor${Le(s)}`,(n==="indeterminate"||n==="query")&&"bar1Indeterminate",n==="determinate"&&"bar1Determinate",n==="buffer"&&"bar1Buffer"],bar2:["bar","bar2",n!=="buffer"&&`barColor${Le(s)}`,n==="buffer"&&`color${Le(s)}`,(n==="indeterminate"||n==="query")&&"bar2Indeterminate",n==="buffer"&&"bar2Buffer"]};return pt(o,UX,t)},vC=(e,t)=>e.vars?e.vars.palette.LinearProgress[`${t}Bg`]:e.palette.mode==="light"?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.5),KX=Me("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${Le(n.color)}`],t[n.variant]]}})(St(({theme:e})=>({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},variants:[...Object.entries(e.palette).filter(er()).map(([t])=>({props:{color:t},style:{backgroundColor:vC(e,t)}})),{props:({ownerState:t})=>t.color==="inherit"&&t.variant!=="buffer",style:{"&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}}},{props:{variant:"buffer"},style:{backgroundColor:"transparent"}},{props:{variant:"query"},style:{transform:"rotate(180deg)"}}]}))),XX=Me("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.dashed,t[`dashedColor${Le(n.color)}`]]}})(St(({theme:e})=>({position:"absolute",marginTop:0,height:"100%",width:"100%",backgroundSize:"10px 10px",backgroundPosition:"0 -23px",variants:[{props:{color:"inherit"},style:{opacity:.3,backgroundImage:"radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)"}},...Object.entries(e.palette).filter(er()).map(([t])=>{const n=vC(e,t);return{props:{color:t},style:{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`}}})]})),GX||{animation:`${MS} 3s infinite linear`}),ZX=Me("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.bar,t.bar1,t[`barColor${Le(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&t.bar1Indeterminate,n.variant==="determinate"&&t.bar1Determinate,n.variant==="buffer"&&t.bar1Buffer]}})(St(({theme:e})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[{props:{color:"inherit"},style:{backgroundColor:"currentColor"}},...Object.entries(e.palette).filter(er()).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main}})),{props:{variant:"determinate"},style:{transition:`transform .${ES}s linear`}},{props:{variant:"buffer"},style:{zIndex:1,transition:`transform .${ES}s linear`}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:{width:"auto"}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:qX||{animation:`${TS} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),QX=Me("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.bar,t.bar2,t[`barColor${Le(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&t.bar2Indeterminate,n.variant==="buffer"&&t.bar2Buffer]}})(St(({theme:e})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[...Object.entries(e.palette).filter(er()).map(([t])=>({props:{color:t},style:{"--LinearProgressBar2-barColor":(e.vars||e).palette[t].main}})),{props:({ownerState:t})=>t.variant!=="buffer"&&t.color!=="inherit",style:{backgroundColor:"var(--LinearProgressBar2-barColor, currentColor)"}},{props:({ownerState:t})=>t.variant!=="buffer"&&t.color==="inherit",style:{backgroundColor:"currentColor"}},{props:{color:"inherit"},style:{opacity:.3}},...Object.entries(e.palette).filter(er()).map(([t])=>({props:{color:t,variant:"buffer"},style:{backgroundColor:vC(e,t),transition:`transform .${ES}s linear`}})),{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:{width:"auto"}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:VX||{animation:`${kS} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),Ha=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiLinearProgress"}),{className:o,color:a="primary",value:l,valueBuffer:u,variant:d="indeterminate",...f}=s,p={...s,color:a,variant:d},g=YX(p),x=Ao(),b={},y={bar1:{},bar2:{}};if((d==="determinate"||d==="buffer")&&l!==void 0){b["aria-valuenow"]=Math.round(l),b["aria-valuemin"]=0,b["aria-valuemax"]=100;let S=l-100;x&&(S=-S),y.bar1.transform=`translateX(${S}%)`}if(d==="buffer"&&u!==void 0){let S=(u||0)-100;x&&(S=-S),y.bar2.transform=`translateX(${S}%)`}return r.jsxs(KX,{className:Ye(g.root,o),ownerState:p,role:"progressbar",...b,ref:n,...f,children:[d==="buffer"?r.jsx(XX,{className:g.dashed,ownerState:p}):null,r.jsx(ZX,{className:g.bar1,ownerState:p,style:y.bar1}),d==="determinate"?null:r.jsx(QX,{className:g.bar2,ownerState:p,style:y.bar2})]})});function JX(e){return gt("MuiLink",e)}const eZ=mt("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),tZ=({theme:e,ownerState:t})=>{const n=t.color;if("colorSpace"in e&&e.colorSpace){const a=za(e,`palette.${n}.main`)||za(e,`palette.${n}`)||t.color;return e.alpha(a,.4)}const s=za(e,`palette.${n}.main`,!1)||za(e,`palette.${n}`,!1)||t.color,o=za(e,`palette.${n}.mainChannel`)||za(e,`palette.${n}Channel`);return"vars"in e&&o?`rgba(${o} / 0.4)`:In(s,.4)},L6={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},nZ=e=>{const{classes:t,component:n,focusVisible:s,underline:o}=e,a={root:["root",`underline${Le(o)}`,n==="button"&&"button",s&&"focusVisible"]};return pt(a,JX,t)},rZ=Me(C,{name:"MuiLink",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`underline${Le(n.underline)}`],n.component==="button"&&t.button]}})(St(({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:t,ownerState:n})=>t==="always"&&n.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},{props:({underline:t,ownerState:n})=>t==="always"&&n.color==="inherit",style:e.colorSpace?{textDecorationColor:e.alpha("currentColor",.4)}:null},...Object.entries(e.palette).filter(er()).map(([t])=>({props:{underline:"always",color:t},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette[t].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"},[`&.${eZ.focusVisible}`]:{outline:"auto"}}}]}))),Vp=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiLink"}),o=On(),{className:a,color:l="primary",component:u="a",onBlur:d,onFocus:f,TypographyClasses:p,underline:g="always",variant:x="inherit",sx:b,...y}=s,[S,j]=v.useState(!1),A=z=>{Na(z.target)||j(!1),d&&d(z)},M=z=>{Na(z.target)&&j(!0),f&&f(z)},R={...s,color:l,component:u,focusVisible:S,underline:g,variant:x},_=nZ(R);return r.jsx(rZ,{color:l,className:Ye(_.root,a),classes:p,component:u,onBlur:A,onFocus:M,ref:n,ownerState:R,variant:x,...y,sx:[...L6[l]===void 0?[{color:l}]:[],...Array.isArray(b)?b:[b]],style:{...y.style,...g==="always"&&l!=="inherit"&&!L6[l]&&{"--Link-underlineColor":tZ({theme:o,ownerState:R})}}})}),ca=v.createContext({});function sZ(e){return gt("MuiList",e)}mt("MuiList",["root","padding","dense","subheader"]);const oZ=e=>{const{classes:t,disablePadding:n,dense:s,subheader:o}=e;return pt({root:["root",!n&&"padding",s&&"dense",o&&"subheader"]},sZ,t)},iZ=Me("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),Hs=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiList"}),{children:o,className:a,component:l="ul",dense:u=!1,disablePadding:d=!1,subheader:f,...p}=s,g=v.useMemo(()=>({dense:u}),[u]),x={...s,component:l,dense:u,disablePadding:d},b=oZ(x);return r.jsx(ca.Provider,{value:g,children:r.jsxs(iZ,{as:l,className:Ye(b.root,a),ref:n,ownerState:x,...p,children:[f,o]})})});function aZ(e){return gt("MuiListItem",e)}mt("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);function lZ(e){return gt("MuiListItemButton",e)}const of=mt("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),cZ=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems==="flex-start"&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters]},uZ=e=>{const{alignItems:t,classes:n,dense:s,disabled:o,disableGutters:a,divider:l,selected:u}=e,f=pt({root:["root",s&&"dense",!a&&"gutters",l&&"divider",o&&"disabled",t==="flex-start"&&"alignItemsFlexStart",u&&"selected"]},lZ,n);return{...n,...f}},dZ=Me(Li,{shouldForwardProp:e=>Us(e)||e==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:cZ})(St(({theme:e})=>({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${of.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${of.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${of.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${of.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${of.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},variants:[{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.dense,style:{paddingTop:4,paddingBottom:4}}]}))),Jo=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiListItemButton"}),{alignItems:o="center",autoFocus:a=!1,component:l="div",children:u,dense:d=!1,disableGutters:f=!1,divider:p=!1,focusVisibleClassName:g,selected:x=!1,className:b,...y}=s,S=v.useContext(ca),j=v.useMemo(()=>({dense:d||S.dense||!1,alignItems:o,disableGutters:f}),[o,S.dense,d,f]),A=v.useRef(null);or(()=>{a&&A.current&&A.current.focus()},[a]);const M={...s,alignItems:o,dense:j.dense,disableGutters:f,divider:p,selected:x},R=uZ(M),_=vr(A,n);return r.jsx(ca.Provider,{value:j,children:r.jsx(dZ,{ref:_,href:y.href||y.to,component:(y.href||y.to)&&l==="div"?"button":l,focusVisibleClassName:Ye(R.focusVisible,g),ownerState:M,className:Ye(R.root,b),...y,classes:R,children:u})})});function fZ(e){return gt("MuiListItemSecondaryAction",e)}mt("MuiListItemSecondaryAction",["root","disableGutters"]);const hZ=e=>{const{disableGutters:t,classes:n}=e;return pt({root:["root",t&&"disableGutters"]},fZ,n)},pZ=Me("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),Sb=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiListItemSecondaryAction"}),{className:o,...a}=s,l=v.useContext(ca),u={...s,disableGutters:l.disableGutters},d=hZ(u);return r.jsx(pZ,{className:Ye(d.root,o),ownerState:u,ref:n,...a})});Sb.muiName="ListItemSecondaryAction";const gZ=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems==="flex-start"&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]},mZ=e=>{const{alignItems:t,classes:n,dense:s,disableGutters:o,disablePadding:a,divider:l,hasSecondaryAction:u}=e;return pt({root:["root",s&&"dense",!o&&"gutters",!a&&"padding",l&&"divider",t==="flex-start"&&"alignItemsFlexStart",u&&"secondaryAction"],container:["container"],secondaryAction:["secondaryAction"]},aZ,n)},xZ=Me("div",{name:"MuiListItem",slot:"Root",overridesResolver:gZ})(St(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:t})=>!t.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:t})=>!t.disablePadding&&t.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:t})=>!t.disablePadding&&!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>!t.disablePadding&&!!t.secondaryAction,style:{paddingRight:48}},{props:({ownerState:t})=>!!t.secondaryAction,style:{[`& > .${of.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>t.button,style:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:t})=>t.hasSecondaryAction,style:{paddingRight:48}}]}))),bZ=Me("li",{name:"MuiListItem",slot:"Container"})({position:"relative"}),Ii=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiListItem"}),{alignItems:o="center",children:a,className:l,component:u,components:d={},componentsProps:f={},ContainerComponent:p="li",ContainerProps:{className:g,...x}={},dense:b=!1,disableGutters:y=!1,disablePadding:S=!1,divider:j=!1,secondaryAction:A,slotProps:M={},slots:R={},..._}=s,z=v.useContext(ca),F=v.useMemo(()=>({dense:b||z.dense||!1,alignItems:o,disableGutters:y}),[o,z.dense,b,y]),N=v.useRef(null),I=v.Children.toArray(a),B=I.length&&Bp(I[I.length-1],["ListItemSecondaryAction"]),H={...s,alignItems:o,dense:F.dense,disableGutters:y,disablePadding:S,divider:j,hasSecondaryAction:B},P=mZ(H),k=vr(N,n),L={slots:R,slotProps:M},[O,W]=jt("secondaryAction",{elementType:Sb,externalForwardedProps:L,ownerState:H,className:P.secondaryAction}),D=R.root||d.Root||xZ,q=M.root||f.root||{},K={className:Ye(P.root,q.className,l),..._};let Y=u||"li";return B?(Y=!K.component&&!u?"div":Y,p==="li"&&(Y==="li"?Y="div":K.component==="li"&&(K.component="div")),r.jsx(ca.Provider,{value:F,children:r.jsxs(bZ,{as:p,className:Ye(P.container,g),ref:k,ownerState:H,...x,children:[r.jsx(D,{...q,...!La(D)&&{as:Y,ownerState:{...H,...q.ownerState}},...K,children:I}),I.pop()]})})):r.jsx(ca.Provider,{value:F,children:r.jsxs(D,{...q,as:Y,ref:k,...!La(D)&&{ownerState:{...H,...q.ownerState}},...K,children:[I,A&&r.jsx(O,{...W,children:A})]})})});function yZ(e){return gt("MuiListItemIcon",e)}const P6=mt("MuiListItemIcon",["root","alignItemsFlexStart"]),vZ=e=>{const{alignItems:t,classes:n}=e;return pt({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},yZ,n)},SZ=Me("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(St(({theme:e})=>({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}))),Tl=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiListItemIcon"}),{className:o,...a}=s,l=v.useContext(ca),u={...s,alignItems:l.alignItems},d=vZ(u);return r.jsx(SZ,{className:Ye(d.root,o),ownerState:u,ref:n,...a})});function jZ(e){return gt("MuiListItemText",e)}const bf=mt("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),CZ=e=>{const{classes:t,inset:n,primary:s,secondary:o,dense:a}=e;return pt({root:["root",n&&"inset",a&&"dense",s&&o&&"multiline"],primary:["primary"],secondary:["secondary"]},jZ,t)},wZ=Me("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${bf.primary}`]:t.primary},{[`& .${bf.secondary}`]:t.secondary},t.root,n.inset&&t.inset,n.primary&&n.secondary&&t.multiline,n.dense&&t.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${t6.root}:where(& .${bf.primary})`]:{display:"block"},[`.${t6.root}:where(& .${bf.secondary})`]:{display:"block"},variants:[{props:({ownerState:e})=>e.primary&&e.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:56}}]}),Js=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiListItemText"}),{children:o,className:a,disableTypography:l=!1,inset:u=!1,primary:d,primaryTypographyProps:f,secondary:p,secondaryTypographyProps:g,slots:x={},slotProps:b={},...y}=s,{dense:S}=v.useContext(ca);let j=d??o,A=p;const M={...s,disableTypography:l,inset:u,primary:!!j,secondary:!!A,dense:S},R=CZ(M),_={slots:x,slotProps:{primary:f,secondary:g,...b}},[z,F]=jt("root",{className:Ye(R.root,a),elementType:wZ,externalForwardedProps:{..._,...y},ownerState:M,ref:n}),[N,I]=jt("primary",{className:R.primary,elementType:C,externalForwardedProps:_,ownerState:M}),[B,H]=jt("secondary",{className:R.secondary,elementType:C,externalForwardedProps:_,ownerState:M});return j!=null&&j.type!==C&&!l&&(j=r.jsx(N,{variant:S?"body2":"body1",component:I?.variant?void 0:"span",...I,children:j})),A!=null&&A.type!==C&&!l&&(A=r.jsx(B,{variant:"body2",color:"textSecondary",...H,children:A})),r.jsxs(z,{...F,children:[j,A]})});function K2(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function D6(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function WR(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(""))}function ip(e,t,n,s,o,a){let l=!1,u=o(e,t,t?n:!1);for(;u;){if(u===e.firstChild){if(l)return!1;l=!0}const d=s?!1:u.disabled||u.getAttribute("aria-disabled")==="true";if(!u.hasAttribute("tabindex")||!WR(u,a)||d)u=o(e,u,n);else return u.focus(),!0}return!1}const AZ=v.forwardRef(function(t,n){const{actions:s,autoFocus:o=!1,autoFocusItem:a=!1,children:l,className:u,disabledItemsFocusable:d=!1,disableListWrap:f=!1,onKeyDown:p,variant:g="selectedMenu",...x}=t,b=v.useRef(null),y=v.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});or(()=>{o&&b.current.focus()},[o]),v.useImperativeHandle(s,()=>({adjustStyleForScrollbar:(R,{direction:_})=>{const z=!b.current.style.width;if(R.clientHeight<b.current.clientHeight&&z){const F=`${BR(wo(R))}px`;b.current.style[_==="rtl"?"paddingLeft":"paddingRight"]=F,b.current.style.width=`calc(100% + ${F})`}return b.current}}),[]);const S=R=>{const _=b.current,z=R.key;if(R.ctrlKey||R.metaKey||R.altKey){p&&p(R);return}const N=xf(is(_));if(z==="ArrowDown")R.preventDefault(),ip(_,N,f,d,K2);else if(z==="ArrowUp")R.preventDefault(),ip(_,N,f,d,D6);else if(z==="Home")R.preventDefault(),ip(_,null,f,d,K2);else if(z==="End")R.preventDefault(),ip(_,null,f,d,D6);else if(z.length===1){const I=y.current,B=z.toLowerCase(),H=performance.now();I.keys.length>0&&(H-I.lastTime>500?(I.keys=[],I.repeating=!0,I.previousKeyMatched=!0):I.repeating&&B!==I.keys[0]&&(I.repeating=!1)),I.lastTime=H,I.keys.push(B);const P=N&&!I.repeating&&WR(N,I);I.previousKeyMatched&&(P||ip(_,N,!1,d,K2,I))?R.preventDefault():I.previousKeyMatched=!1}p&&p(R)},j=vr(b,n);let A=-1;v.Children.forEach(l,(R,_)=>{if(!v.isValidElement(R)){A===_&&(A+=1,A>=l.length&&(A=-1));return}R.props.disabled||(g==="selectedMenu"&&R.props.selected||A===-1)&&(A=_),A===_&&(R.props.disabled||R.props.muiSkipListHighlight||R.type.muiSkipListHighlight)&&(A+=1,A>=l.length&&(A=-1))});const M=v.Children.map(l,(R,_)=>{if(_===A){const z={};return a&&(z.autoFocus=!0),R.props.tabIndex===void 0&&g==="selectedMenu"&&(z.tabIndex=0),v.cloneElement(R,z)}return R});return r.jsx(Hs,{role:"menu",ref:j,className:u,onKeyDown:S,tabIndex:o?0:-1,...x,children:M})});function EZ(e){return gt("MuiPopover",e)}mt("MuiPopover",["root","paper"]);function O6(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function B6(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function N6(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function Gx(e){return typeof e=="function"?e():e}const TZ=e=>{const{classes:t}=e;return pt({root:["root"],paper:["paper"]},EZ,t)},kZ=Me(tr,{name:"MuiPopover",slot:"Root"})({}),UR=Me(Je,{name:"MuiPopover",slot:"Paper"})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Xg=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiPopover"}),{action:o,anchorEl:a,anchorOrigin:l={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:d="anchorEl",children:f,className:p,container:g,elevation:x=8,marginThreshold:b=16,open:y,PaperProps:S={},slots:j={},slotProps:A={},transformOrigin:M={vertical:"top",horizontal:"left"},TransitionComponent:R,transitionDuration:_="auto",TransitionProps:z={},disableScrollLock:F=!1,...N}=s,I=v.useRef(),B={...s,anchorOrigin:l,anchorReference:d,elevation:x,marginThreshold:b,transformOrigin:M,TransitionComponent:R,transitionDuration:_,TransitionProps:z},H=TZ(B),P=v.useCallback(()=>{if(d==="anchorPosition")return u;const ge=Gx(a),le=(ge&&ge.nodeType===1?ge:is(I.current).body).getBoundingClientRect();return{top:le.top+O6(le,l.vertical),left:le.left+B6(le,l.horizontal)}},[a,l.horizontal,l.vertical,u,d]),k=v.useCallback(ge=>({vertical:O6(ge,M.vertical),horizontal:B6(ge,M.horizontal)}),[M.horizontal,M.vertical]),L=v.useCallback(ge=>{const de={width:ge.offsetWidth,height:ge.offsetHeight},le=k(de);if(d==="none")return{top:null,left:null,transformOrigin:N6(le)};const ee=P();let X=ee.top-le.vertical,ve=ee.left-le.horizontal;const st=X+de.height,Ge=ve+de.width,qe=wo(Gx(a)),Be=qe.innerHeight-b,Te=qe.innerWidth-b;if(b!==null&&X<b){const Re=X-b;X-=Re,le.vertical+=Re}else if(b!==null&&st>Be){const Re=st-Be;X-=Re,le.vertical+=Re}if(b!==null&&ve<b){const Re=ve-b;ve-=Re,le.horizontal+=Re}else if(Ge>Te){const Re=Ge-Te;ve-=Re,le.horizontal+=Re}return{top:`${Math.round(X)}px`,left:`${Math.round(ve)}px`,transformOrigin:N6(le)}},[a,d,P,k,b]),[O,W]=v.useState(y),D=v.useCallback(()=>{const ge=I.current;if(!ge)return;const de=L(ge);de.top!==null&&ge.style.setProperty("top",de.top),de.left!==null&&(ge.style.left=de.left),ge.style.transformOrigin=de.transformOrigin,W(!0)},[L]);v.useEffect(()=>(F&&window.addEventListener("scroll",D),()=>window.removeEventListener("scroll",D)),[a,F,D]);const q=()=>{D()},K=()=>{W(!1)};v.useEffect(()=>{y&&D()}),v.useImperativeHandle(o,()=>y?{updatePosition:()=>{D()}}:null,[y,D]),v.useEffect(()=>{if(!y)return;const ge=Vg(()=>{D()}),de=wo(Gx(a));return de.addEventListener("resize",ge),()=>{ge.clear(),de.removeEventListener("resize",ge)}},[a,y,D]);let Y=_;const ie={slots:{transition:R,...j},slotProps:{transition:z,paper:S,...A}},[V,re]=jt("transition",{elementType:fg,externalForwardedProps:ie,ownerState:B,getSlotProps:ge=>({...ge,onEntering:(de,le)=>{ge.onEntering?.(de,le),q()},onExited:de=>{ge.onExited?.(de),K()}}),additionalProps:{appear:!0,in:y}});_==="auto"&&!V.muiSupportAuto&&(Y=void 0);const fe=g||(a?is(Gx(a)).body:void 0),[ae,{slots:ue,slotProps:se,...J}]=jt("root",{ref:n,elementType:kZ,externalForwardedProps:{...ie,...N},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:j.backdrop},slotProps:{backdrop:rC(typeof A.backdrop=="function"?A.backdrop(B):A.backdrop,{invisible:!0})},container:fe,open:y},ownerState:B,className:Ye(H.root,p)}),[ce,oe]=jt("paper",{ref:I,className:H.paper,elementType:UR,externalForwardedProps:ie,shouldForwardComponentProp:!0,additionalProps:{elevation:x,style:O?void 0:{opacity:0}},ownerState:B});return r.jsx(ae,{...J,...!La(ae)&&{slots:ue,slotProps:se,disableScrollLock:F},children:r.jsx(V,{...re,timeout:Y,children:r.jsx(ce,{...oe,children:f})})})});function MZ(e){return gt("MuiMenu",e)}mt("MuiMenu",["root","paper","list"]);const RZ={vertical:"top",horizontal:"right"},zZ={vertical:"top",horizontal:"left"},IZ=e=>{const{classes:t}=e;return pt({root:["root"],paper:["paper"],list:["list"]},MZ,t)},FZ=Me(Xg,{shouldForwardProp:e=>Us(e)||e==="classes",name:"MuiMenu",slot:"Root"})({}),_Z=Me(UR,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),LZ=Me(AZ,{name:"MuiMenu",slot:"List"})({outline:0}),SC=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiMenu"}),{autoFocus:o=!0,children:a,className:l,disableAutoFocusItem:u=!1,MenuListProps:d={},onClose:f,open:p,PaperProps:g={},PopoverClasses:x,transitionDuration:b="auto",TransitionProps:{onEntering:y,...S}={},variant:j="selectedMenu",slots:A={},slotProps:M={},...R}=s,_=Ao(),z={...s,autoFocus:o,disableAutoFocusItem:u,MenuListProps:d,onEntering:y,PaperProps:g,transitionDuration:b,TransitionProps:S,variant:j},F=IZ(z),N=o&&!u&&p,I=v.useRef(null),B=(Y,ie)=>{I.current&&I.current.adjustStyleForScrollbar(Y,{direction:_?"rtl":"ltr"}),y&&y(Y,ie)},H=Y=>{Y.key==="Tab"&&(Y.preventDefault(),f&&f(Y,"tabKeyDown"))};let P=-1;v.Children.map(a,(Y,ie)=>{v.isValidElement(Y)&&(Y.props.disabled||(j==="selectedMenu"&&Y.props.selected||P===-1)&&(P=ie))});const k={slots:A,slotProps:{list:d,transition:S,paper:g,...M}},L=Hr({elementType:A.root,externalSlotProps:M.root,ownerState:z,className:[F.root,l]}),[O,W]=jt("paper",{className:F.paper,elementType:_Z,externalForwardedProps:k,shouldForwardComponentProp:!0,ownerState:z}),[D,q]=jt("list",{className:Ye(F.list,d.className),elementType:LZ,shouldForwardComponentProp:!0,externalForwardedProps:k,getSlotProps:Y=>({...Y,onKeyDown:ie=>{H(ie),Y.onKeyDown?.(ie)}}),ownerState:z}),K=typeof k.slotProps.transition=="function"?k.slotProps.transition(z):k.slotProps.transition;return r.jsx(FZ,{onClose:f,anchorOrigin:{vertical:"bottom",horizontal:_?"right":"left"},transformOrigin:_?RZ:zZ,slots:{root:A.root,paper:O,backdrop:A.backdrop,...A.transition&&{transition:A.transition}},slotProps:{root:L,paper:W,backdrop:typeof M.backdrop=="function"?M.backdrop(z):M.backdrop,transition:{...K,onEntering:(...Y)=>{B(...Y),K?.onEntering?.(...Y)}}},open:p,ref:n,transitionDuration:b,ownerState:z,...R,classes:x,children:r.jsx(D,{actions:I,autoFocus:o&&(P===-1||u),autoFocusItem:N,variant:j,...q,children:a})})});function PZ(e){return gt("MuiMenuItem",e)}const ap=mt("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]);function DZ(e){return gt("MuiNativeSelect",e)}const jC=mt("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),OZ=e=>{const{classes:t,variant:n,disabled:s,multiple:o,open:a,error:l}=e,u={select:["select",n,s&&"disabled",o&&"multiple",l&&"error"],icon:["icon",`icon${Le(n)}`,a&&"iconOpen",s&&"disabled"]};return pt(u,DZ,t)},qR=Me("select",{name:"MuiNativeSelect"})(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${jC.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:t})=>t.variant!=="filled"&&t.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),BZ=Me(qR,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Us,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${jC.multiple}`]:t.multiple}]}})({}),VR=Me("svg",{name:"MuiNativeSelect"})(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${jC.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:t})=>t.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),NZ=Me(VR,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Le(n.variant)}`],n.open&&t.iconOpen]}})({}),$Z=v.forwardRef(function(t,n){const{className:s,disabled:o,error:a,IconComponent:l,inputRef:u,variant:d="standard",...f}=t,p={...t,disabled:o,variant:d,error:a},g=OZ(p);return r.jsxs(v.Fragment,{children:[r.jsx(BZ,{ownerState:p,className:Ye(g.select,s),disabled:o,ref:u||n,...f}),t.multiple?null:r.jsx(NZ,{as:l,ownerState:p,className:g.icon})]})});function GR(e){return gt("MuiSelect",e)}const lp=mt("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);function HZ(e){return e?e.type==="mousedown"||e.type==="pointerdown"||e.type==="touchstart"?"pointer":e.type==="keydown"||e.type==="click"&&e.detail===0?"keyboard":null:null}function WZ(e){return e==null||typeof e=="string"&&!e.trim()}function $6(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}const YR=v.createContext(null);function UZ(){return v.useContext(YR)}const qZ=YR.Provider;var H6;const VZ=Me(qR,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${lp.select}`]:t.select},{[`&.${lp.select}`]:t[n.variant]},{[`&.${lp.error}`]:t.error},{[`&.${lp.multiple}`]:t.multiple}]}})({[`&.${lp.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),GZ=Me(VR,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Le(n.variant)}`],n.open&&t.iconOpen]}})({}),YZ=Me("input",{shouldForwardProp:e=>qg(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"}),KZ=e=>{const{classes:t,variant:n,disabled:s,multiple:o,open:a,error:l}=e,u={select:["select",n,s&&"disabled",o&&"multiple",l&&"error"],icon:["icon",`icon${Le(n)}`,a&&"iconOpen",s&&"disabled"],nativeInput:["nativeInput"]};return pt(u,GR,t)},XZ=v.forwardRef(function(t,n){const{"aria-describedby":s,"aria-label":o,autoFocus:a,autoWidth:l,children:u,className:d,defaultOpen:f,defaultValue:p,disabled:g,displayEmpty:x,error:b=!1,IconComponent:y,inputRef:S,labelId:j,MenuProps:A={},multiple:M,name:R,onBlur:_,onChange:z,onClose:F,onFocus:N,onKeyDown:I,onMouseDown:B,onOpen:H,open:P,readOnly:k,renderValue:L,required:O,SelectDisplayProps:W={},tabIndex:D,type:q,value:K,variant:Y="standard",...ie}=t,[V,re]=la({controlled:K,default:p,name:"Select"}),[fe,ae]=la({controlled:P,default:f,name:"Select"}),ue=v.useRef(null),se=v.useRef(null),[J,ce]=v.useState(null),{current:oe}=v.useRef(P!=null),[ge,de]=v.useState(),[le,ee]=v.useState(null),X=vr(n,S),ve=v.useCallback(ut=>{se.current=ut,ut&&ce(ut)},[]),st=J?.parentNode;v.useImperativeHandle(X,()=>({focus:()=>{se.current.focus()},node:ue.current,value:V}),[V]);const Ge=J!==null&&fe;v.useEffect(()=>{if(!Ge||!st||l||typeof ResizeObserver>"u")return;const ut=new ResizeObserver(()=>{de(st.clientWidth)});return ut.observe(st),()=>{ut.disconnect()}},[Ge,st,l]),v.useEffect(()=>{f&&fe&&J&&!oe&&(de(l?null:st.clientWidth),se.current.focus())},[J,l]),v.useEffect(()=>{a&&se.current.focus()},[a]),v.useEffect(()=>{if(!j)return;const ut=is(se.current).getElementById(j);if(ut){const _t=()=>{getSelection().isCollapsed&&se.current.focus()};return ut.addEventListener("click",_t),()=>{ut.removeEventListener("click",_t)}}},[j]);const qe=(ut,_t)=>{ut?(ee(HZ(_t)),H&&H(_t)):(ee(null),F&&F(_t)),oe||(de(l?null:st.clientWidth),ae(ut))},Be=ut=>{B?.(ut),ut.button===0&&(ut.preventDefault(),se.current.focus(),qe(!0,ut))},Te=ut=>{qe(!1,ut)},Re=v.Children.toArray(u),Se=ut=>{const _t=Re.find(Yt=>Yt.props.value===ut.target.value);_t!==void 0&&(re(_t.props.value),z&&z(ut,_t))},Ke=ut=>_t=>{let Yt;if(_t.currentTarget.hasAttribute("tabindex")){if(M){Yt=Array.isArray(V)?V.slice():[];const Xt=V.indexOf(ut.props.value);Xt===-1?Yt.push(ut.props.value):Yt.splice(Xt,1)}else Yt=ut.props.value;if(ut.props.onClick&&ut.props.onClick(_t),V!==Yt&&(re(Yt),z)){const Xt=_t.nativeEvent||_t,ln=new Xt.constructor(Xt.type,Xt);Object.defineProperty(ln,"target",{writable:!0,value:{value:Yt,name:R}}),z(ln,ut)}M||qe(!1,_t)}},ot=ut=>{k||([" ","ArrowUp","ArrowDown","Enter"].includes(ut.key)&&(ut.preventDefault(),qe(!0,ut)),I?.(ut))},He=ut=>{!Ge&&_&&(Object.defineProperty(ut,"target",{writable:!0,value:{value:V,name:R}}),_(ut))};delete ie["aria-invalid"];let $e,Z;const pe=[];let Q=!1;(s1({value:V})||x)&&(L?$e=L(V):Q=!0);const me=Re.map(ut=>{if(!v.isValidElement(ut))return null;let _t;if(M){if(!Array.isArray(V))throw new Error(wl(2));_t=V.some(Yt=>$6(Yt,ut.props.value)),_t&&Q&&pe.push(ut.props.children)}else _t=$6(V,ut.props.value),_t&&Q&&(Z=ut.props.children);return v.cloneElement(ut,{"aria-selected":_t?"true":"false",onClick:Ke(ut),onKeyUp:Yt=>{Yt.key===" "&&Yt.preventDefault(),ut.props.onKeyUp&&ut.props.onKeyUp(Yt)},role:"option",selected:_t,value:void 0,"data-value":ut.props.value})});Q&&(M?pe.length===0?$e=null:$e=pe.reduce((ut,_t,Yt)=>(ut.push(_t),Yt<pe.length-1&&ut.push(", "),ut),[]):$e=Z);let we=ge;!l&&oe&&J&&(we=st.clientWidth);let et;typeof D<"u"?et=D:et=g?null:0;const ht=W.id||(R?`mui-component-select-${R}`:void 0),ct={...t,variant:Y,value:V,open:Ge,error:b},bt=KZ(ct),wt={...A.PaperProps,...typeof A.slotProps?.paper=="function"?A.slotProps.paper(ct):A.slotProps?.paper},gn={...A.MenuListProps,...typeof A.slotProps?.list=="function"?A.slotProps.list(ct):A.slotProps?.list},mn=Hi();return r.jsxs(v.Fragment,{children:[r.jsx(VZ,{as:"div",ref:ve,tabIndex:et,role:"combobox","aria-controls":Ge?mn:void 0,"aria-disabled":g?"true":void 0,"aria-expanded":Ge?"true":"false","aria-haspopup":"listbox","aria-label":o,"aria-labelledby":[j,ht].filter(Boolean).join(" ")||void 0,"aria-describedby":s,"aria-required":O?"true":void 0,"aria-invalid":b?"true":void 0,onKeyDown:ot,onMouseDown:g||k?null:Be,onBlur:He,onFocus:N,...W,ownerState:ct,className:Ye(W.className,bt.select,d),id:ht,children:WZ($e)?H6||(H6=r.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):$e}),r.jsx(YZ,{"aria-invalid":b,value:Array.isArray(V)?V.join(","):V,name:R,ref:ue,"aria-hidden":!0,onChange:Se,tabIndex:-1,disabled:g,className:bt.nativeInput,autoFocus:a,required:O,...ie,ownerState:ct}),r.jsx(GZ,{as:y,className:bt.icon,ownerState:ct}),r.jsx(qZ,{value:le,children:r.jsx(SC,{id:`menu-${R||""}`,anchorEl:st,open:Ge,onClose:Te,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...A,slotProps:{...A.slotProps,list:{"aria-labelledby":j,role:"listbox","aria-multiselectable":M?"true":void 0,disableListWrap:!0,id:mn,...gn},paper:{...wt,style:{minWidth:we,...wt!=null?wt.style:null}}},children:me})})]})});var W6;const ZZ=Me("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:Us})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),QZ=Me("legend",{name:"MuiNotchedOutlined",shouldForwardProp:Us})(St(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:t})=>!t.withLabel,style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:t})=>t.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:t})=>t.withLabel&&t.notched,style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function JZ(e){const{children:t,classes:n,className:s,label:o,notched:a,...l}=e,u=o!=null&&o!=="",d={...e,notched:a,withLabel:u};return r.jsx(ZZ,{"aria-hidden":!0,className:s,ownerState:d,...l,children:r.jsx(QZ,{ownerState:d,children:u?r.jsx("span",{children:o}):W6||(W6=r.jsx("span",{className:"notranslate","aria-hidden":!0,children:""}))})})}const eQ=e=>{const{classes:t}=e,s=pt({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},NG,t);return{...t,...s}},tQ=Me(bb,{shouldForwardProp:e=>Us(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:mb})(St(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${mi.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${mi.notchedOutline}`]:{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}},[`&.${mi.focused} .${mi.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(er()).map(([n])=>({props:{color:n},style:{[`&.${mi.focused} .${mi.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}})),{props:{},style:{[`&.${mi.error} .${mi.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${mi.disabled} .${mi.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:s})=>n.multiline&&s==="small",style:{padding:"8.5px 14px"}}]}})),nQ=Me(JZ,{name:"MuiOutlinedInput",slot:"NotchedOutline"})(St(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}})),rQ=Me(yb,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:xb})(St(({theme:e})=>({padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:t})=>t.multiline,style:{padding:0}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}}]}))),jb=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiOutlinedInput"}),{components:o={},fullWidth:a=!1,inputComponent:l="input",label:u,multiline:d=!1,notched:f,slots:p={},slotProps:g={},type:x="text",...b}=s,y=eQ(s),S=_l(),j=Gu({props:s,muiFormControl:S,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),A={...s,color:j.color||"primary",disabled:j.disabled,error:j.error,focused:j.focused,formControl:S,fullWidth:a,hiddenLabel:j.hiddenLabel,multiline:d,size:j.size,type:x},M=p.root??o.Root??tQ,R=p.input??o.Input??rQ,[_,z]=jt("notchedOutline",{elementType:nQ,className:y.notchedOutline,shouldForwardComponentProp:!0,ownerState:A,externalForwardedProps:{slots:p,slotProps:g},additionalProps:{label:u!=null&&u!==""&&j.required?r.jsxs(v.Fragment,{children:[u," ","*"]}):u}});return r.jsx(sr,{slots:{root:M,input:R},slotProps:g,renderSuffix:F=>r.jsx(_,{...z,notched:typeof f<"u"?f:!!(F.startAdornment||F.filled||F.focused)}),fullWidth:a,inputComponent:l,multiline:d,ref:n,type:x,...b,classes:{...y,notchedOutline:null}})});jb.muiName="Input";const sQ=e=>{const{classes:t}=e,s=pt({root:["root"]},GR,t);return{...t,...s}},CC={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>Us(e)&&e!=="variant"},oQ=Me(yC,CC)(""),iQ=Me(jb,CC)(""),aQ=Me(bC,CC)(""),Fn=v.forwardRef(function(t,n){const s=Tt({name:"MuiSelect",props:t}),{autoWidth:o=!1,children:a,classes:l={},className:u,defaultOpen:d=!1,displayEmpty:f=!1,IconComponent:p=LR,id:g,input:x,inputProps:b,label:y,labelId:S,MenuProps:j,multiple:A=!1,native:M=!1,onClose:R,onOpen:_,open:z,renderValue:F,SelectDisplayProps:N,variant:I="outlined",...B}=s,H=M?$Z:XZ,P=_l(),k=Gu({props:s,muiFormControl:P,states:["variant","error"]}),L=k.variant||I,O={...s,variant:L,classes:l},W=sQ(O),{root:D,...q}=W,K=x||{standard:r.jsx(oQ,{ownerState:O}),outlined:r.jsx(iQ,{label:y,ownerState:O}),filled:r.jsx(aQ,{ownerState:O})}[L],Y=vr(n,Nc(K));return r.jsx(v.Fragment,{children:v.cloneElement(K,{inputComponent:H,inputProps:{children:a,error:k.error,IconComponent:p,variant:L,type:void 0,multiple:A,...M?{id:g}:{autoWidth:o,defaultOpen:d,displayEmpty:f,labelId:S,MenuProps:j,onClose:R,onOpen:_,open:z,renderValue:F,SelectDisplayProps:{id:g,...N}},...b,classes:b?As(q,b.classes):q,...x?x.props.inputProps:{}},...(A&&M||f)&&L==="outlined"?{notched:!0}:{},ref:Y,className:Ye(K.props.className,u,W.root),...!x&&{variant:L},...B})})});Fn.muiName="Select";function lQ(e,t){if(t==null){e.focus();return}try{e.focus({focusVisible:t==="keyboard"})}catch{e.focus()}}const cQ=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},uQ=e=>{const{disabled:t,dense:n,divider:s,disableGutters:o,selected:a,classes:l}=e,d=pt({root:["root",n&&"dense",t&&"disabled",!o&&"gutters",s&&"divider",a&&"selected"]},PZ,l);return{...l,...d}},dQ=Me(Li,{shouldForwardProp:e=>Us(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:cQ})(St(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${ap.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${ap.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${ap.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${ap.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${ap.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${R6.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${R6.inset}`]:{marginLeft:52},[`& .${bf.root}`]:{marginTop:0,marginBottom:0},[`& .${bf.inset}`]:{paddingLeft:36},[`& .${P6.root}`]:{minWidth:36},variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>!t.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:t})=>t.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${P6.root} svg`]:{fontSize:"1.25rem"}}}]}))),It=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:a="li",dense:l=!1,divider:u=!1,disableGutters:d=!1,focusVisibleClassName:f,role:p="menuitem",tabIndex:g,className:x,...b}=s,y=UZ(),S=v.useContext(ca),j=v.useMemo(()=>({dense:l||S.dense||!1,disableGutters:d}),[S.dense,l,d]),A=v.useRef(null);or(()=>{o&&A.current&&lQ(A.current,y)},[o]);const M={...s,dense:j.dense,divider:u,disableGutters:d},R=uQ(s),_=vr(A,n);let z;return s.disabled||(z=g!==void 0?g:-1),r.jsx(ca.Provider,{value:j,children:r.jsx(dQ,{ref:_,role:p,tabIndex:z,component:a,focusVisibleClassName:Ye(R.focusVisible,f),className:Ye(R.root,x),...b,ownerState:M,classes:R})})});function fQ(e){const{children:t,defer:n=!1,fallback:s=null}=e,[o,a]=v.useState(!1);return or(()=>{n||a(!0)},[n]),v.useEffect(()=>{n&&a(!0)},[n]),o?t:s}function hQ(e){return gt("MuiPagination",e)}mt("MuiPagination",["root","ul","outlined","text"]);function pQ(e={}){const{boundaryCount:t=1,componentName:n="usePagination",count:s=1,defaultPage:o=1,disabled:a=!1,hideNextButton:l=!1,hidePrevButton:u=!1,onChange:d,page:f,showFirstButton:p=!1,showLastButton:g=!1,siblingCount:x=1,...b}=e,[y,S]=la({controlled:f,default:o,name:n,state:"page"}),j=(B,H)=>{f||S(H),d&&d(B,H)},A=(B,H)=>{const P=H-B+1;return Array.from({length:P},(k,L)=>B+L)},M=A(1,Math.min(t,s)),R=A(Math.max(s-t+1,t+1),s),_=Math.max(Math.min(y-x,s-t-x*2-1),t+2),z=Math.min(Math.max(y+x,t+x*2+2),s-t-1),F=[...p?["first"]:[],...u?[]:["previous"],...M,..._>t+2?["start-ellipsis"]:t+1<s-t?[t+1]:[],...A(_,z),...z<s-t-1?["end-ellipsis"]:s-t>t?[s-t]:[],...R,...l?[]:["next"],...g?["last"]:[]],N=B=>{switch(B){case"first":return 1;case"previous":return y-1;case"next":return y+1;case"last":return s;default:return null}};return{items:F.map(B=>typeof B=="number"?{onClick:H=>{j(H,B)},type:"page",page:B,selected:B===y,disabled:a,"aria-current":B===y?"page":void 0}:{onClick:H=>{j(H,N(B))},type:B,page:N(B),selected:!1,disabled:a||!B.includes("ellipsis")&&(B==="next"||B==="last"?y>=s:y<=1)}),...b}}function gQ(e){return gt("MuiPaginationItem",e)}const Ys=mt("MuiPaginationItem",["root","page","sizeSmall","sizeLarge","text","textPrimary","textSecondary","outlined","outlinedPrimary","outlinedSecondary","rounded","ellipsis","firstLast","previousNext","focusVisible","disabled","selected","icon","colorPrimary","colorSecondary"]),mQ=ze(r.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"})),xQ=ze(r.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"})),bQ=ze(r.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),yQ=ze(r.jsx("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),KR=(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${Le(n.size)}`],n.variant==="text"&&t[`text${Le(n.color)}`],n.variant==="outlined"&&t[`outlined${Le(n.color)}`],n.shape==="rounded"&&t.rounded,n.type==="page"&&t.page,(n.type==="start-ellipsis"||n.type==="end-ellipsis")&&t.ellipsis,(n.type==="previous"||n.type==="next")&&t.previousNext,(n.type==="first"||n.type==="last")&&t.firstLast]},vQ=e=>{const{classes:t,color:n,disabled:s,selected:o,size:a,shape:l,type:u,variant:d}=e,f={root:["root",`size${Le(a)}`,d,l,n!=="standard"&&`color${Le(n)}`,n!=="standard"&&`${d}${Le(n)}`,s&&"disabled",o&&"selected",{page:"page",first:"firstLast",last:"firstLast","start-ellipsis":"ellipsis","end-ellipsis":"ellipsis",previous:"previousNext",next:"previousNext"}[u]],icon:["icon"]};return pt(f,gQ,t)},SQ=Me("div",{name:"MuiPaginationItem",slot:"Root",overridesResolver:KR})(St(({theme:e})=>({...e.typography.body2,borderRadius:32/2,textAlign:"center",boxSizing:"border-box",minWidth:32,padding:"0 6px",margin:"0 3px",color:(e.vars||e).palette.text.primary,height:"auto",[`&.${Ys.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},variants:[{props:{size:"small"},style:{minWidth:26,borderRadius:26/2,margin:"0 1px",padding:"0 4px"}},{props:{size:"large"},style:{minWidth:40,borderRadius:40/2,padding:"0 10px",fontSize:e.typography.pxToRem(15)}}]}))),jQ=Me(Li,{name:"MuiPaginationItem",slot:"Root",overridesResolver:KR})(St(({theme:e})=>({...e.typography.body2,borderRadius:32/2,textAlign:"center",boxSizing:"border-box",minWidth:32,height:32,padding:"0 6px",margin:"0 3px",color:(e.vars||e).palette.text.primary,[`&.${Ys.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Ys.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},transition:e.transitions.create(["color","background-color"],{duration:e.transitions.duration.short}),"&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Ys.selected}`]:{backgroundColor:(e.vars||e).palette.action.selected,"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${Ys.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)},[`&.${Ys.disabled}`]:{opacity:1,color:(e.vars||e).palette.action.disabled,backgroundColor:(e.vars||e).palette.action.selected}},variants:[{props:{size:"small"},style:{minWidth:26,height:26,borderRadius:26/2,margin:"0 1px",padding:"0 4px"}},{props:{size:"large"},style:{minWidth:40,height:40,borderRadius:40/2,padding:"0 10px",fontSize:e.typography.pxToRem(15)}},{props:{shape:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:{variant:"outlined"},style:{border:e.vars?`1px solid ${e.alpha(e.vars.palette.common.onBackground,.23)}`:`1px solid ${e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"}`,[`&.${Ys.selected}`]:{[`&.${Ys.disabled}`]:{borderColor:(e.vars||e).palette.action.disabledBackground,color:(e.vars||e).palette.action.disabled}}}},{props:{variant:"text"},style:{[`&.${Ys.selected}`]:{[`&.${Ys.disabled}`]:{color:(e.vars||e).palette.action.disabled}}}},...Object.entries(e.palette).filter(er(["dark","contrastText"])).map(([t])=>({props:{variant:"text",color:t},style:{[`&.${Ys.selected}`]:{color:(e.vars||e).palette[t].contrastText,backgroundColor:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:(e.vars||e).palette[t].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t].main}},[`&.${Ys.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t].dark},[`&.${Ys.disabled}`]:{color:(e.vars||e).palette.action.disabled}}}})),...Object.entries(e.palette).filter(er(["light"])).map(([t])=>({props:{variant:"outlined",color:t},style:{[`&.${Ys.selected}`]:{color:(e.vars||e).palette[t].main,border:`1px solid ${e.alpha((e.vars||e).palette[t].main,.5)}`,backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.activatedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,`${(e.vars||e).palette.action.activatedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Ys.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette[t].main,`${(e.vars||e).palette.action.activatedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}}}))]}))),CQ=Me("div",{name:"MuiPaginationItem",slot:"Icon"})(St(({theme:e})=>({fontSize:e.typography.pxToRem(20),margin:"0 -8px",variants:[{props:{size:"small"},style:{fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{fontSize:e.typography.pxToRem(22)}}]}))),wQ=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiPaginationItem"}),{className:o,color:a="standard",component:l,components:u={},disabled:d=!1,page:f,selected:p=!1,shape:g="circular",size:x="medium",slots:b={},slotProps:y={},type:S="page",variant:j="text",...A}=s,M={...s,color:a,disabled:d,selected:p,shape:g,size:x,type:S,variant:j},R=Ao(),_=vQ(M),z={slots:{previous:b.previous??u.previous,next:b.next??u.next,first:b.first??u.first,last:b.last??u.last},slotProps:y},[F,N]=jt("previous",{elementType:bQ,externalForwardedProps:z,ownerState:M}),[I,B]=jt("next",{elementType:yQ,externalForwardedProps:z,ownerState:M}),[H,P]=jt("first",{elementType:mQ,externalForwardedProps:z,ownerState:M}),[k,L]=jt("last",{elementType:xQ,externalForwardedProps:z,ownerState:M}),O=R?{previous:"next",next:"previous",first:"last",last:"first"}[S]:S,W={previous:F,next:I,first:H,last:k}[O],D={previous:N,next:B,first:P,last:L}[O];return S==="start-ellipsis"||S==="end-ellipsis"?r.jsx(SQ,{ref:n,ownerState:M,className:Ye(_.root,o),children:"…"}):r.jsxs(jQ,{ref:n,ownerState:M,component:l,disabled:d,className:Ye(_.root,o),...A,children:[S==="page"&&f,W?r.jsx(CQ,{...D,className:_.icon,as:W}):null]})}),AQ=e=>{const{classes:t,variant:n}=e;return pt({root:["root",n],ul:["ul"]},hQ,t)},EQ=Me("nav",{name:"MuiPagination",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant]]}})({}),TQ=Me("ul",{name:"MuiPagination",slot:"Ul"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"});function kQ(e,t,n){return e==="page"?`${n?"":"Go to "}page ${t}`:`Go to ${e} page`}const MQ=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiPagination"}),{boundaryCount:o=1,className:a,color:l="standard",count:u=1,defaultPage:d=1,disabled:f=!1,getItemAriaLabel:p=kQ,hideNextButton:g=!1,hidePrevButton:x=!1,onChange:b,page:y,renderItem:S=H=>r.jsx(wQ,{...H}),shape:j="circular",showFirstButton:A=!1,showLastButton:M=!1,siblingCount:R=1,size:_="medium",variant:z="text",...F}=s,{items:N}=pQ({...s,componentName:"Pagination"}),I={...s,boundaryCount:o,color:l,count:u,defaultPage:d,disabled:f,getItemAriaLabel:p,hideNextButton:g,hidePrevButton:x,renderItem:S,shape:j,showFirstButton:A,showLastButton:M,siblingCount:R,size:_,variant:z},B=AQ(I);return r.jsx(EQ,{"aria-label":"pagination navigation",className:Ye(B.root,a),ownerState:I,ref:n,...F,children:r.jsx(TQ,{className:B.ul,ownerState:I,children:N.map((H,P)=>r.jsx("li",{children:S({...H,color:l,"aria-label":p(H.type,H.page,H.selected),shape:j,size:_,variant:z})},P))})})}),XR={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},RQ=ze(r.jsx("path",{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"})),zQ=ze(r.jsx("path",{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}));function IQ(e){return gt("MuiRating",e)}const cp=mt("MuiRating",["root","sizeSmall","sizeMedium","sizeLarge","readOnly","disabled","focusVisible","visuallyHidden","pristine","label","labelEmptyValueActive","icon","iconEmpty","iconFilled","iconHover","iconFocus","iconActive","decimal"]);function FQ(e){const t=e.toString().split(".")[1];return t?t.length:0}function X2(e,t){if(e==null)return e;const n=Math.round(e/t)*t;return Number(n.toFixed(FQ(t)))}const _Q=e=>{const{classes:t,size:n,readOnly:s,disabled:o,emptyValueFocused:a,focusVisible:l}=e,u={root:["root",`size${Le(n)}`,o&&"disabled",l&&"focusVisible",s&&"readOnly"],label:["label","pristine"],labelEmptyValue:[a&&"labelEmptyValueActive"],icon:["icon"],iconEmpty:["iconEmpty"],iconFilled:["iconFilled"],iconHover:["iconHover"],iconFocus:["iconFocus"],iconActive:["iconActive"],decimal:["decimal"],visuallyHidden:["visuallyHidden"]};return pt(u,IQ,t)},LQ=Me("span",{name:"MuiRating",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${cp.visuallyHidden}`]:t.visuallyHidden},t.root,t[`size${Le(n.size)}`],n.readOnly&&t.readOnly]}})(St(({theme:e})=>({display:"inline-flex",position:"relative",fontSize:e.typography.pxToRem(24),color:"#faaf00",cursor:"pointer",textAlign:"left",width:"min-content",WebkitTapHighlightColor:"transparent",[`&.${cp.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${cp.focusVisible} .${cp.iconActive}`]:{outline:"1px solid #999"},[`& .${cp.visuallyHidden}`]:XR,variants:[{props:{size:"small"},style:{fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{fontSize:e.typography.pxToRem(30)}},{props:({ownerState:t})=>t.readOnly,style:{pointerEvents:"none"}}]}))),ZR=Me("label",{name:"MuiRating",slot:"Label",overridesResolver:({ownerState:e},t)=>[t.label,e.emptyValueFocused&&t.labelEmptyValueActive]})({cursor:"inherit",variants:[{props:({ownerState:e})=>e.emptyValueFocused,style:{top:0,bottom:0,position:"absolute",outline:"1px solid #999",width:"100%"}}]}),PQ=Me("span",{name:"MuiRating",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.iconEmpty&&t.iconEmpty,n.iconFilled&&t.iconFilled,n.iconHover&&t.iconHover,n.iconFocus&&t.iconFocus,n.iconActive&&t.iconActive]}})(St(({theme:e})=>({display:"flex",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest}),pointerEvents:"none",variants:[{props:({ownerState:t})=>t.iconActive,style:{transform:"scale(1.2)"}},{props:({ownerState:t})=>t.iconEmpty,style:{color:(e.vars||e).palette.action.disabled}}]}))),DQ=Me("span",{name:"MuiRating",slot:"Decimal",shouldForwardProp:e=>qg(e)&&e!=="iconActive",overridesResolver:(e,t)=>{const{iconActive:n}=e;return[t.decimal,n&&t.iconActive]}})({position:"relative",variants:[{props:({iconActive:e})=>e,style:{transform:"scale(1.2)"}}]});function OQ(e){const{value:t,...n}=e;return r.jsx("span",{...n})}function U6(e){const{classes:t,disabled:n,emptyIcon:s,focus:o,getLabelText:a,highlightSelectedOnly:l,hover:u,icon:d,IconContainerComponent:f,isActive:p,itemValue:g,labelProps:x,name:b,onBlur:y,onChange:S,onClick:j,onFocus:A,readOnly:M,ownerState:R,ratingValue:_,ratingValueRounded:z,slots:F={},slotProps:N={}}=e,I=l?g===_:g<=_,B=g<=u,H=g<=o,P=g===z,k=`${b}-${Hi()}`,L={slots:F,slotProps:N},[O,W]=jt("icon",{elementType:PQ,className:Ye(t.icon,I?t.iconFilled:t.iconEmpty,B&&t.iconHover,H&&t.iconFocus,p&&t.iconActive),externalForwardedProps:L,ownerState:{...R,iconEmpty:!I,iconFilled:I,iconHover:B,iconFocus:H,iconActive:p},additionalProps:{value:g},internalForwardedProps:{as:f}}),[D,q]=jt("label",{elementType:ZR,externalForwardedProps:L,ownerState:{...R,emptyValueFocused:void 0},additionalProps:{style:x?.style,htmlFor:k}}),K=r.jsx(O,{...W,children:s&&!I?s:d});return M?r.jsx("span",{...x,children:K}):r.jsxs(v.Fragment,{children:[r.jsxs(D,{...q,children:[K,r.jsx("span",{className:t.visuallyHidden,children:a(g)})]}),r.jsx("input",{className:t.visuallyHidden,onFocus:A,onBlur:y,onChange:S,onClick:j,disabled:n,value:g,id:k,type:"radio",name:b,checked:P})]})}const BQ=r.jsx(RQ,{fontSize:"inherit"}),NQ=r.jsx(zQ,{fontSize:"inherit"});function $Q(e){return`${e||"0"} Star${e!==1?"s":""}`}const Z2=v.forwardRef(function(t,n){const s=Tt({name:"MuiRating",props:t}),{component:o="span",className:a,defaultValue:l=null,disabled:u=!1,emptyIcon:d=NQ,emptyLabelText:f="Empty",getLabelText:p=$Q,highlightSelectedOnly:g=!1,icon:x=BQ,IconContainerComponent:b=OQ,max:y=5,name:S,onChange:j,onChangeActive:A,onMouseLeave:M,onMouseMove:R,precision:_=1,readOnly:z=!1,size:F="medium",value:N,slots:I={},slotProps:B={},...H}=s,P=Hi(S),[k,L]=la({controlled:N,default:l,name:"Rating"}),O=X2(k,_),W=Ao(),[{hover:D,focus:q},K]=v.useState({hover:-1,focus:-1});let Y=O;D!==-1&&(Y=D),q!==-1&&(Y=q);const[ie,V]=v.useState(!1),re=v.useRef(),fe=vr(re,n),ae=Re=>{R&&R(Re);const Se=re.current,{right:Ke,left:ot,width:He}=Se.getBoundingClientRect();let $e;W?$e=(Ke-Re.clientX)/He:$e=(Re.clientX-ot)/He;let Z=X2(y*$e+_/2,_);Z=yu(Z,_,y),K(pe=>pe.hover===Z&&pe.focus===Z?pe:{hover:Z,focus:Z}),V(!1),A&&D!==Z&&A(Re,Z)},ue=Re=>{M&&M(Re);const Se=-1;K({hover:Se,focus:Se}),A&&D!==Se&&A(Re,Se)},se=Re=>{let Se=Re.target.value===""?null:parseFloat(Re.target.value);D!==-1&&(Se=D),L(Se),j&&j(Re,Se)},J=Re=>{Re.clientX===0&&Re.clientY===0||(K({hover:-1,focus:-1}),L(null),j&&parseFloat(Re.target.value)===O&&j(Re,null))},ce=Re=>{Na(Re.target)&&V(!0);const Se=parseFloat(Re.target.value);K(Ke=>({hover:Ke.hover,focus:Se}))},oe=Re=>{if(D!==-1)return;Na(Re.target)||V(!1);const Se=-1;K(Ke=>({hover:Ke.hover,focus:Se}))},[ge,de]=v.useState(!1),le={...s,component:o,defaultValue:l,disabled:u,emptyIcon:d,emptyLabelText:f,emptyValueFocused:ge,focusVisible:ie,getLabelText:p,icon:x,IconContainerComponent:b,max:y,precision:_,readOnly:z,size:F},ee=_Q(le),X={slots:I,slotProps:B},[ve,st]=jt("root",{ref:fe,className:Ye(ee.root,a),elementType:LQ,externalForwardedProps:{...X,...H,component:o},getSlotProps:Re=>({...Re,onMouseMove:Se=>{ae(Se),Re.onMouseMove?.(Se)},onMouseLeave:Se=>{ue(Se),Re.onMouseLeave?.(Se)}}),ownerState:le,additionalProps:{role:z?"img":null,"aria-label":z?p(Y):null}}),[Ge,qe]=jt("label",{className:Ye(ee.label,ee.labelEmptyValue),elementType:ZR,externalForwardedProps:X,ownerState:le}),[Be,Te]=jt("decimal",{className:ee.decimal,elementType:DQ,externalForwardedProps:X,ownerState:le});return r.jsxs(ve,{...st,children:[Array.from(new Array(y)).map((Re,Se)=>{const Ke=Se+1,ot={classes:ee,disabled:u,emptyIcon:d,focus:q,getLabelText:p,highlightSelectedOnly:g,hover:D,icon:x,IconContainerComponent:b,name:P,onBlur:oe,onChange:se,onClick:J,onFocus:ce,ratingValue:Y,ratingValueRounded:O,readOnly:z,ownerState:le,slots:I,slotProps:B},He=Ke===Math.ceil(Y)&&(D!==-1||q!==-1);if(_<1){const $e=Array.from(new Array(1/_));return v.createElement(Be,{...Te,key:Ke,className:Ye(Te.className,He&&ee.iconActive),iconActive:He},$e.map((Z,pe)=>{const Q=X2(Ke-1+(pe+1)*_,_);return r.jsx(U6,{...ot,isActive:!1,itemValue:Q,labelProps:{style:$e.length-1===pe?{}:{width:Q===Y?`${(pe+1)*_*100}%`:"0%",overflow:"hidden",position:"absolute"}}},Q)}))}return r.jsx(U6,{...ot,isActive:He,itemValue:Ke},Ke)}),!z&&!u&&r.jsxs(Ge,{...qe,children:[r.jsx("input",{className:ee.visuallyHidden,value:"",id:`${P}-empty`,type:"radio",name:P,checked:O==null,onFocus:()=>de(!0),onBlur:()=>de(!1),onChange:se}),r.jsx("span",{className:ee.visuallyHidden,children:f})]})]})});function HQ(e){return gt("MuiSkeleton",e)}mt("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const WQ=e=>{const{classes:t,variant:n,animation:s,hasChildren:o,width:a,height:l}=e;return pt({root:["root",n,s,o&&"withChildren",o&&!a&&"fitContent",o&&!l&&"heightAuto"]},HQ,t)},RS=Va` 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } `,zS=Va` 0% { transform: translateX(-100%); } 50% { /* +0.5s of delay between each loop */ transform: translateX(100%); } 100% { transform: translateX(100%); } `,UQ=typeof RS!="string"?Oc` animation: ${RS} 2s ease-in-out 0.5s infinite; `:null,qQ=typeof zS!="string"?Oc` &::after { animation: ${zS} 2s linear 0.5s infinite; } `:null,VQ=Me("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],n.animation!==!1&&t[n.animation],n.hasChildren&&t.withChildren,n.hasChildren&&!n.width&&t.fitContent,n.hasChildren&&!n.height&&t.heightAuto]}})(St(({theme:e})=>{const t=xU(e.shape.borderRadius)||"px",n=bU(e.shape.borderRadius);return{display:"block",backgroundColor:e.vars?e.vars.palette.Skeleton.bg:e.alpha(e.palette.text.primary,e.palette.mode==="light"?.11:.13),height:"1.2em",variants:[{props:{variant:"text"},style:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${n}${t}/${Math.round(n/.6*10)/10}${t}`,"&:empty:before":{content:'"\\00a0"'}}},{props:{variant:"circular"},style:{borderRadius:"50%"}},{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:({ownerState:s})=>s.hasChildren,style:{"& > *":{visibility:"hidden"}}},{props:({ownerState:s})=>s.hasChildren&&!s.width,style:{maxWidth:"fit-content"}},{props:({ownerState:s})=>s.hasChildren&&!s.height,style:{height:"auto"}},{props:{animation:"pulse"},style:UQ||{animation:`${RS} 2s ease-in-out 0.5s infinite`}},{props:{animation:"wave"},style:{position:"relative",overflow:"hidden",WebkitMaskImage:"-webkit-radial-gradient(white, black)","&::after":{background:`linear-gradient( 90deg, transparent, ${(e.vars||e).palette.action.hover}, transparent )`,content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}}},{props:{animation:"wave"},style:qQ||{"&::after":{animation:`${zS} 2s linear 0.5s infinite`}}}]}})),jn=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiSkeleton"}),{animation:o="pulse",className:a,component:l="span",height:u,style:d,variant:f="text",width:p,...g}=s,x={...s,animation:o,component:l,variant:f,hasChildren:!!g.children},b=WQ(x);return r.jsx(VQ,{as:l,ref:n,className:Ye(b.root,a),ownerState:x,...g,style:{width:p,height:u,...d}})});function GQ(e,t,n=(s,o)=>s===o){return e.length===t.length&&e.every((s,o)=>n(s,t[o]))}const YQ=2;function Yd(e,t,n,s,o){return n===1?Math.min(e+t,o):Math.max(e-t,s)}function QR(e,t){return e-t}function q6(e,t){const{index:n}=e.reduce((s,o,a)=>{const l=Math.abs(t-o);return s===null||l<s.distance||l===s.distance?{distance:l,index:a}:s},null)??{};return n}function Yx(e,t){if(t.current!==void 0&&e.changedTouches){const n=e;for(let s=0;s<n.changedTouches.length;s+=1){const o=n.changedTouches[s];if(o.identifier===t.current)return{x:o.clientX,y:o.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function o1(e,t,n){return(e-t)*100/(n-t)}function KQ(e,t,n){return(n-t)*e+t}function XQ(e){if(Math.abs(e)<1){const n=e.toExponential().split("e-"),s=n[0].split(".")[1];return(s?s.length:0)+parseInt(n[1],10)}const t=e.toString().split(".")[1];return t?t.length:0}function ZQ(e,t,n){const s=Math.round((e-n)/t)*t+n;return Number(s.toFixed(XQ(t)))}function V6({values:e,newValue:t,index:n}){const s=e.slice();return s[n]=t,s.sort(QR)}function Kx({sliderRef:e,activeIndex:t,setActive:n}){const s=is(e.current);(!e.current?.contains(s.activeElement)||Number(s?.activeElement?.getAttribute("data-index"))!==t)&&e.current?.querySelector(`[type="range"][data-index="${t}"]`).focus(),n&&n(t)}function Xx(e,t){return typeof e=="number"&&typeof t=="number"?e===t:typeof e=="object"&&typeof t=="object"?GQ(e,t):!1}const QQ={horizontal:{offset:e=>({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},JQ=e=>e;let Zx;function G6(){return Zx===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?Zx=CSS.supports("touch-action","none"):Zx=!0),Zx}function eJ(e){const{"aria-labelledby":t,defaultValue:n,disabled:s=!1,disableSwap:o=!1,isRtl:a=!1,marks:l=!1,max:u=100,min:d=0,name:f,onChange:p,onChangeCommitted:g,orientation:x="horizontal",rootRef:b,scale:y=JQ,step:S=1,shiftStep:j=10,tabIndex:A,value:M}=e,R=v.useRef(void 0),[_,z]=v.useState(-1),[F,N]=v.useState(-1),[I,B]=v.useState(!1),H=v.useRef(0),P=v.useRef(null),[k,L]=la({controlled:M,default:n??d,name:"Slider"}),O=p&&((He,$e,Z)=>{const pe=He.nativeEvent||He,Q=new pe.constructor(pe.type,pe);Object.defineProperty(Q,"target",{writable:!0,value:{value:$e,name:f}}),P.current=$e,p(Q,$e,Z)}),W=Array.isArray(k);let D=W?k.slice().sort(QR):[k];D=D.map(He=>He==null?d:yu(He,d,u));const q=l===!0&&S!==null?[...Array(Math.floor((u-d)/S)+1)].map((He,$e)=>({value:d+S*$e})):l||[],K=q.map(He=>He.value),[Y,ie]=v.useState(-1),V=v.useRef(null),re=vr(b,V),fe=He=>$e=>{const Z=Number($e.currentTarget.getAttribute("data-index"));Na($e.target)&&ie(Z),N(Z),He?.onFocus?.($e)},ae=He=>$e=>{Na($e.target)||ie(-1),N(-1),He?.onBlur?.($e)},ue=(He,$e)=>{const Z=Number(He.currentTarget.getAttribute("data-index")),pe=D[Z],Q=K.indexOf(pe);let me=$e;if(q&&S==null){const we=K[K.length-1];me>=we?me=we:me<=K[0]?me=K[0]:me=me<pe?K[Q-1]:K[Q+1]}if(me=yu(me,d,u),W){o&&(me=yu(me,D[Z-1]||-1/0,D[Z+1]||1/0));const we=me;me=V6({values:D,newValue:me,index:Z});let et=Z;o||(et=me.indexOf(we)),Kx({sliderRef:V,activeIndex:et})}L(me),ie(Z),O&&!Xx(me,k)&&O(He,me,Z),g&&g(He,P.current??me)},se=He=>$e=>{if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes($e.key)){$e.preventDefault();const Z=Number($e.currentTarget.getAttribute("data-index")),pe=D[Z];let Q=null;if(S!=null){const me=$e.shiftKey?j:S;switch($e.key){case"ArrowUp":Q=Yd(pe,me,1,d,u);break;case"ArrowRight":Q=Yd(pe,me,a?-1:1,d,u);break;case"ArrowDown":Q=Yd(pe,me,-1,d,u);break;case"ArrowLeft":Q=Yd(pe,me,a?1:-1,d,u);break;case"PageUp":Q=Yd(pe,j,1,d,u);break;case"PageDown":Q=Yd(pe,j,-1,d,u);break;case"Home":Q=d;break;case"End":Q=u;break}}else if(q){const me=K[K.length-1],we=K.indexOf(pe),et=[a?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],ht=[a?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];et.includes($e.key)?we===0?Q=K[0]:Q=K[we-1]:ht.includes($e.key)&&(we===K.length-1?Q=me:Q=K[we+1])}Q!=null&&ue($e,Q)}He?.onKeyDown?.($e)};or(()=>{s&&V.current.contains(document.activeElement)&&document.activeElement?.blur()},[s]),s&&_!==-1&&z(-1),s&&Y!==-1&&ie(-1);const J=He=>$e=>{He.onChange?.($e),ue($e,$e.target.valueAsNumber)},ce=v.useRef(void 0);let oe=x;a&&x==="horizontal"&&(oe+="-reverse");const ge=({finger:He,move:$e=!1})=>{const{current:Z}=V,{width:pe,height:Q,bottom:me,left:we}=Z.getBoundingClientRect();let et;oe.startsWith("vertical")?et=(me-He.y)/Q:et=(He.x-we)/pe,oe.includes("-reverse")&&(et=1-et);let ht;if(ht=KQ(et,d,u),S)ht=ZQ(ht,S,d);else{const bt=q6(K,ht);ht=K[bt]}ht=yu(ht,d,u);let ct=0;if(W){$e?ct=ce.current:ct=q6(D,ht),o&&(ht=yu(ht,D[ct-1]||-1/0,D[ct+1]||1/0));const bt=ht;ht=V6({values:D,newValue:ht,index:ct}),o&&$e||(ct=ht.indexOf(bt),ce.current=ct)}return{newValue:ht,activeIndex:ct}},de=pn(He=>{const $e=Yx(He,R);if(!$e)return;if(H.current+=1,He.type==="mousemove"&&He.buttons===0){le(He);return}const{newValue:Z,activeIndex:pe}=ge({finger:$e,move:!0});Kx({sliderRef:V,activeIndex:pe,setActive:z}),L(Z),!I&&H.current>YQ&&B(!0),O&&!Xx(Z,k)&&O(He,Z,pe)}),le=pn(He=>{const $e=Yx(He,R);if(B(!1),!$e)return;const{newValue:Z}=ge({finger:$e,move:!0});z(-1),He.type==="touchend"&&N(-1),g&&g(He,P.current??Z),R.current=void 0,X()}),ee=pn(He=>{if(s)return;G6()||He.preventDefault();const $e=He.changedTouches[0];$e!=null&&(R.current=$e.identifier);const Z=Yx(He,R);if(Z!==!1){const{newValue:Q,activeIndex:me}=ge({finger:Z});Kx({sliderRef:V,activeIndex:me,setActive:z}),L(Q),O&&!Xx(Q,k)&&O(He,Q,me)}H.current=0;const pe=is(V.current);pe.addEventListener("touchmove",de,{passive:!0}),pe.addEventListener("touchend",le,{passive:!0})}),X=v.useCallback(()=>{const He=is(V.current);He.removeEventListener("mousemove",de),He.removeEventListener("mouseup",le),He.removeEventListener("touchmove",de),He.removeEventListener("touchend",le)},[le,de]);v.useEffect(()=>{const{current:He}=V;return He.addEventListener("touchstart",ee,{passive:G6()}),()=>{He.removeEventListener("touchstart",ee),X()}},[X,ee]),v.useEffect(()=>{s&&X()},[s,X]);const ve=He=>$e=>{if(He.onMouseDown?.($e),s||$e.defaultPrevented||$e.button!==0)return;$e.preventDefault();const Z=Yx($e,R);if(Z!==!1){const{newValue:Q,activeIndex:me}=ge({finger:Z});Kx({sliderRef:V,activeIndex:me,setActive:z}),L(Q),O&&!Xx(Q,k)&&O($e,Q,me)}H.current=0;const pe=is(V.current);pe.addEventListener("mousemove",de,{passive:!0}),pe.addEventListener("mouseup",le)},st=o1(W?D[0]:d,d,u),Ge=o1(D[D.length-1],d,u)-st,qe=(He={})=>{const $e=Au(He),Z={onMouseDown:ve($e||{})},pe={...$e,...Z};return{...He,ref:re,...pe}},Be=He=>$e=>{He.onMouseOver?.($e);const Z=Number($e.currentTarget.getAttribute("data-index"));N(Z)},Te=He=>$e=>{He.onMouseLeave?.($e),N(-1)},Re=(He={})=>{const $e=Au(He),Z={onMouseOver:Be($e||{}),onMouseLeave:Te($e||{})};return{...He,...$e,...Z}},Se=He=>({pointerEvents:_!==-1&&_!==He?"none":void 0});let Ke;return x==="vertical"&&(Ke=a?"vertical-rl":"vertical-lr"),{active:_,axis:oe,axisProps:QQ,dragging:I,focusedThumbIndex:Y,getHiddenInputProps:(He={})=>{const $e=Au(He),Z={onChange:J($e||{}),onFocus:fe($e||{}),onBlur:ae($e||{}),onKeyDown:se($e||{})},pe={...$e,...Z};return{tabIndex:A,"aria-labelledby":t,"aria-orientation":x,"aria-valuemax":y(u),"aria-valuemin":y(d),name:f,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":e.step??void 0,disabled:s,...He,...pe,style:{...XR,direction:a?"rtl":"ltr",width:"100%",height:"100%",writingMode:Ke}}},getRootProps:qe,getThumbProps:Re,marks:q,open:F,range:W,rootRef:re,trackLeap:Ge,trackOffset:st,values:D,getThumbStyle:Se}}const tJ=e=>!e||!La(e);function nJ(e){return gt("MuiSlider",e)}const Ai=mt("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),rJ=e=>{const{open:t}=e;return{offset:Ye(t&&Ai.valueLabelOpen),circle:Ai.valueLabelCircle,label:Ai.valueLabelLabel}};function sJ(e){const{children:t,className:n,value:s}=e,o=rJ(e);return t?v.cloneElement(t,{className:t.props.className},r.jsxs(v.Fragment,{children:[t.props.children,r.jsx("span",{className:Ye(o.offset,n),"aria-hidden":!0,children:r.jsx("span",{className:o.circle,children:r.jsx("span",{className:o.label,children:s})})})]})):null}function Y6(e){return e}const oJ=Me("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${Le(n.color)}`],n.size!=="medium"&&t[`size${Le(n.size)}`],n.marked&&t.marked,n.orientation==="vertical"&&t.vertical,n.track==="inverted"&&t.trackInverted,n.track===!1&&t.trackFalse]}})(St(({theme:e})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${Ai.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${Ai.dragging}`]:{[`& .${Ai.thumb}, & .${Ai.track}`]:{transition:"none"}},variants:[...Object.entries(e.palette).filter(er()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}))),iJ=Me("span",{name:"MuiSlider",slot:"Rail"})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),aJ=Me("span",{name:"MuiSlider",slot:"Track"})(St(({theme:e})=>({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:e.transitions.create(["left","width","bottom","height"],{duration:e.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.entries(e.palette).filter(er()).map(([t])=>({props:{color:t,track:"inverted"},style:{...e.vars?{backgroundColor:e.vars.palette.Slider[`${t}Track`],borderColor:e.vars.palette.Slider[`${t}Track`]}:{backgroundColor:e.lighten(e.palette[t].main,.62),borderColor:e.lighten(e.palette[t].main,.62),...e.applyStyles("dark",{backgroundColor:e.darken(e.palette[t].main,.5)}),...e.applyStyles("dark",{borderColor:e.darken(e.palette[t].main,.5)})}}}))]}))),lJ=Me("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.thumb,t[`thumbColor${Le(n.color)}`],n.size!=="medium"&&t[`thumbSize${Le(n.size)}`]]}})(St(({theme:e})=>({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow","left","bottom"],{duration:e.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(e.vars||e).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${Ai.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.entries(e.palette).filter(er()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${Ai.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.alpha((e.vars||e).palette[t].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${Ai.active}`]:{boxShadow:`0px 0px 0px 14px ${e.alpha((e.vars||e).palette[t].main,.16)}`}}}))]}))),cJ=Me(sJ,{name:"MuiSlider",slot:"ValueLabel"})(St(({theme:e})=>({zIndex:1,whiteSpace:"nowrap",...e.typography.body2,fontWeight:500,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),position:"absolute",backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${Ai.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${Ai.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:e.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]}))),uJ=Me("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>qg(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:n}=e;return[t.mark,n&&t.markActive]}})(St(({theme:e})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8}}]}))),dJ=Me("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>qg(e)&&e!=="markLabelActive"})(St(({theme:e})=>({...e.typography.body2,color:(e.vars||e).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(e.vars||e).palette.text.primary}}]}))),fJ=e=>{const{disabled:t,dragging:n,marked:s,orientation:o,track:a,classes:l,color:u,size:d}=e,f={root:["root",t&&"disabled",n&&"dragging",s&&"marked",o==="vertical"&&"vertical",a==="inverted"&&"trackInverted",a===!1&&"trackFalse",u&&`color${Le(u)}`,d&&`size${Le(d)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",d&&`thumbSize${Le(d)}`,u&&`thumbColor${Le(u)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return pt(f,nJ,l)},hJ=({children:e})=>e,JR=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiSlider"}),o=Ao(),{"aria-label":a,"aria-valuetext":l,"aria-labelledby":u,component:d="span",components:f={},componentsProps:p={},color:g="primary",classes:x,className:b,disableSwap:y=!1,disabled:S=!1,getAriaLabel:j,getAriaValueText:A,marks:M=!1,max:R=100,min:_=0,name:z,onChange:F,onChangeCommitted:N,orientation:I="horizontal",shiftStep:B=10,size:H="medium",step:P=1,scale:k=Y6,slotProps:L,slots:O,tabIndex:W,track:D="normal",value:q,valueLabelDisplay:K="off",valueLabelFormat:Y=Y6,...ie}=s,V={...s,isRtl:o,max:R,min:_,classes:x,disabled:S,disableSwap:y,orientation:I,marks:M,color:g,size:H,step:P,shiftStep:B,scale:k,track:D,valueLabelDisplay:K,valueLabelFormat:Y},{axisProps:re,getRootProps:fe,getHiddenInputProps:ae,getThumbProps:ue,open:se,active:J,axis:ce,focusedThumbIndex:oe,range:ge,dragging:de,marks:le,values:ee,trackOffset:X,trackLeap:ve,getThumbStyle:st}=eJ({...V,rootRef:n});V.marked=le.length>0&&le.some(Xt=>Xt.label),V.dragging=de,V.focusedThumbIndex=oe;const Ge=fJ(V),qe=O?.root??f.Root??oJ,Be=O?.rail??f.Rail??iJ,Te=O?.track??f.Track??aJ,Re=O?.thumb??f.Thumb??lJ,Se=O?.valueLabel??f.ValueLabel??cJ,Ke=O?.mark??f.Mark??uJ,ot=O?.markLabel??f.MarkLabel??dJ,He=O?.input??f.Input??"input",$e=L?.root??p.root,Z=L?.rail??p.rail,pe=L?.track??p.track,Q=L?.thumb??p.thumb,me=L?.valueLabel??p.valueLabel,we=L?.mark??p.mark,et=L?.markLabel??p.markLabel,ht=L?.input??p.input,ct=Hr({elementType:qe,getSlotProps:fe,externalSlotProps:$e,externalForwardedProps:ie,additionalProps:{...tJ(qe)&&{as:d}},ownerState:{...V,...$e?.ownerState},className:[Ge.root,b]}),bt=Hr({elementType:Be,externalSlotProps:Z,ownerState:V,className:Ge.rail}),wt=Hr({elementType:Te,externalSlotProps:pe,additionalProps:{style:{...re[ce].offset(X),...re[ce].leap(ve)}},ownerState:{...V,...pe?.ownerState},className:Ge.track}),gn=Hr({elementType:Re,getSlotProps:ue,externalSlotProps:Q,ownerState:{...V,...Q?.ownerState},className:Ge.thumb}),mn=Hr({elementType:Se,externalSlotProps:me,ownerState:{...V,...me?.ownerState},className:Ge.valueLabel}),ut=Hr({elementType:Ke,externalSlotProps:we,ownerState:V,className:Ge.mark}),_t=Hr({elementType:ot,externalSlotProps:et,ownerState:V,className:Ge.markLabel}),Yt=Hr({elementType:He,getSlotProps:ae,externalSlotProps:ht,ownerState:V});return r.jsxs(qe,{...ct,children:[r.jsx(Be,{...bt}),r.jsx(Te,{...wt}),le.filter(Xt=>Xt.value>=_&&Xt.value<=R).map((Xt,ln)=>{const pr=o1(Xt.value,_,R),nr=re[ce].offset(pr);let Bn;return D===!1?Bn=ee.includes(Xt.value):Bn=D==="normal"&&(ge?Xt.value>=ee[0]&&Xt.value<=ee[ee.length-1]:Xt.value<=ee[0])||D==="inverted"&&(ge?Xt.value<=ee[0]||Xt.value>=ee[ee.length-1]:Xt.value>=ee[0]),r.jsxs(v.Fragment,{children:[r.jsx(Ke,{"data-index":ln,...ut,...!La(Ke)&&{markActive:Bn},style:{...nr,...ut.style},className:Ye(ut.className,Bn&&Ge.markActive)}),Xt.label!=null?r.jsx(ot,{"aria-hidden":!0,"data-index":ln,..._t,...!La(ot)&&{markLabelActive:Bn},style:{...nr,..._t.style},className:Ye(Ge.markLabel,_t.className,Bn&&Ge.markLabelActive),children:Xt.label}):null]},ln)}),ee.map((Xt,ln)=>{const pr=o1(Xt,_,R),nr=re[ce].offset(pr),Bn=K==="off"?hJ:Se;return r.jsx(Bn,{...!La(Bn)&&{valueLabelFormat:Y,valueLabelDisplay:K,value:typeof Y=="function"?Y(k(Xt),ln):Y,index:ln,open:se===ln||J===ln||K==="on",disabled:S},...mn,children:r.jsx(Re,{"data-index":ln,...gn,className:Ye(Ge.thumb,gn.className,J===ln&&Ge.active,oe===ln&&Ge.focusVisible),style:{...nr,...st(ln),...gn.style},children:r.jsx(He,{"data-index":ln,"aria-label":j?j(ln):a,"aria-valuenow":k(Xt),"aria-labelledby":u,"aria-valuetext":A?A(k(Xt),ln):l,value:ee[ln],...Yt})})},ln)})]})});function pJ(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:s,open:o,resumeHideDuration:a}=e,l=wc();v.useEffect(()=>{if(!o)return;function A(M){M.defaultPrevented||M.key==="Escape"&&s?.(M,"escapeKeyDown")}return document.addEventListener("keydown",A),()=>{document.removeEventListener("keydown",A)}},[o,s]);const u=pn((A,M)=>{s?.(A,M)}),d=pn(A=>{!s||A==null||l.start(A,()=>{u(null,"timeout")})});v.useEffect(()=>(o&&d(t),l.clear),[o,t,d,l]);const f=A=>{s?.(A,"clickaway")},p=l.clear,g=v.useCallback(()=>{t!=null&&d(a??t*.5)},[t,a,d]),x=A=>M=>{const R=A.onBlur;R?.(M),g()},b=A=>M=>{const R=A.onFocus;R?.(M),p()},y=A=>M=>{const R=A.onMouseEnter;R?.(M),p()},S=A=>M=>{const R=A.onMouseLeave;R?.(M),g()};return v.useEffect(()=>{if(!n&&o)return window.addEventListener("focus",g),window.addEventListener("blur",p),()=>{window.removeEventListener("focus",g),window.removeEventListener("blur",p)}},[n,o,g,p]),{getRootProps:(A={})=>{const M={...Au(e),...Au(A)};return{role:"presentation",...A,...M,onBlur:x(M),onFocus:b(M),onMouseEnter:y(M),onMouseLeave:S(M)}},onClickAway:f}}function gJ(e){return gt("MuiSnackbarContent",e)}mt("MuiSnackbarContent",["root","message","action"]);const mJ=e=>{const{classes:t}=e;return pt({root:["root"],action:["action"],message:["message"]},gJ,t)},xJ=Me(Je,{name:"MuiSnackbarContent",slot:"Root"})(St(({theme:e})=>{const t=e.palette.mode==="light"?.8:.98;return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(ag(e.palette.background.default,t)),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:ag(e.palette.background.default,t),display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),bJ=Me("div",{name:"MuiSnackbarContent",slot:"Message"})({padding:"8px 0"}),yJ=Me("div",{name:"MuiSnackbarContent",slot:"Action"})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),vJ=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiSnackbarContent"}),{action:o,className:a,message:l,role:u="alert",...d}=s,f=s,p=mJ(f);return r.jsxs(xJ,{role:u,elevation:6,className:Ye(p.root,a),ownerState:f,ref:n,...d,children:[r.jsx(bJ,{className:p.message,ownerState:f,children:l}),o?r.jsx(yJ,{className:p.action,ownerState:f,children:o}):null]})});function SJ(e){return gt("MuiSnackbar",e)}mt("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const jJ=e=>{const{classes:t,anchorOrigin:n}=e,s={root:["root",`anchorOrigin${Le(n.vertical)}${Le(n.horizontal)}`]};return pt(s,SJ,t)},CJ=Me("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${Le(n.anchorOrigin.vertical)}${Le(n.anchorOrigin.horizontal)}`]]}})(St(({theme:e})=>({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:t})=>t.anchorOrigin.vertical==="top",style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:t})=>t.anchorOrigin.vertical!=="top",style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="center",style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),gs=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiSnackbar"}),o=On(),a={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{action:l,anchorOrigin:{vertical:u,horizontal:d}={vertical:"bottom",horizontal:"left"},autoHideDuration:f=null,children:p,className:g,ClickAwayListenerProps:x,ContentProps:b,disableWindowBlurListener:y=!1,message:S,onBlur:j,onClose:A,onFocus:M,onMouseEnter:R,onMouseLeave:_,open:z,resumeHideDuration:F,slots:N={},slotProps:I={},TransitionComponent:B,transitionDuration:H=a,TransitionProps:{onEnter:P,onExited:k,...L}={},...O}=s,W={...s,anchorOrigin:{vertical:u,horizontal:d},autoHideDuration:f,disableWindowBlurListener:y,TransitionComponent:B,transitionDuration:H},D=jJ(W),{getRootProps:q,onClickAway:K}=pJ(W),[Y,ie]=v.useState(!0),V=ee=>{ie(!0),k&&k(ee)},re=(ee,X)=>{ie(!1),P&&P(ee,X)},fe={slots:{transition:B,...N},slotProps:{content:b,clickAwayListener:x,transition:L,...I}},[ae,ue]=jt("root",{ref:n,className:[D.root,g],elementType:CJ,getSlotProps:q,externalForwardedProps:{...fe,...O},ownerState:W}),[se,{ownerState:J,...ce}]=jt("clickAwayListener",{elementType:fK,externalForwardedProps:fe,getSlotProps:ee=>({onClickAway:(...X)=>{const ve=X[0];ee.onClickAway?.(...X),!ve?.defaultMuiPrevented&&K(...X)}}),ownerState:W}),[oe,ge]=jt("content",{elementType:vJ,shouldForwardComponentProp:!0,externalForwardedProps:fe,additionalProps:{message:S,action:l},ownerState:W}),[de,le]=jt("transition",{elementType:fg,externalForwardedProps:fe,getSlotProps:ee=>({onEnter:(...X)=>{ee.onEnter?.(...X),re(...X)},onExited:(...X)=>{ee.onExited?.(...X),V(...X)}}),additionalProps:{appear:!0,in:z,timeout:H,direction:u==="top"?"down":"up"},ownerState:W});return!z&&Y?null:r.jsx(se,{...ce,...N.clickAwayListener&&{ownerState:J},children:r.jsx(ae,{...ue,children:r.jsx(de,{...le,children:p||r.jsx(oe,{...ge})})})})});function wJ(e){return gt("MuiTooltip",e)}const Zr=mt("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function AJ(e){return Math.round(e*1e5)/1e5}const EJ=e=>{const{classes:t,disableInteractive:n,arrow:s,touch:o,placement:a}=e,l={popper:["popper",!n&&"popperInteractive",s&&"popperArrow"],tooltip:["tooltip",s&&"tooltipArrow",o&&"touch",`tooltipPlacement${Le(a.split("-")[0])}`],arrow:["arrow"]};return pt(l,wJ,t)},TJ=Me(Kg,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(St(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:t})=>!t.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:t})=>!t,style:{pointerEvents:"none"}},{props:({ownerState:t})=>t.arrow,style:{[`&[data-popper-placement*="bottom"] .${Zr.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Zr.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Zr.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${Zr.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="right"] .${Zr.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="right"] .${Zr.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="left"] .${Zr.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="left"] .${Zr.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),kJ=Me("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${Le(n.placement.split("-")[0])}`]]}})(St(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${Zr.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${Zr.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${Zr.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${Zr.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:t})=>t.arrow,style:{position:"relative",margin:0}},{props:({ownerState:t})=>t.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${AJ(16/14)}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:t})=>!t.isRtl,style:{[`.${Zr.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${Zr.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:t})=>!t.isRtl&&t.touch,style:{[`.${Zr.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${Zr.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:t})=>!!t.isRtl,style:{[`.${Zr.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${Zr.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:t})=>!!t.isRtl&&t.touch,style:{[`.${Zr.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${Zr.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${Zr.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${Zr.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),MJ=Me("span",{name:"MuiTooltip",slot:"Arrow"})(St(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let Qx=!1;const K6=new hb;let up={x:0,y:0};function Jx(e,t){return(n,...s)=>{t&&t(n,...s),e(n,...s)}}const tn=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiTooltip"}),{arrow:o=!1,children:a,classes:l,components:u={},componentsProps:d={},describeChild:f=!1,disableFocusListener:p=!1,disableHoverListener:g=!1,disableInteractive:x=!1,disableTouchListener:b=!1,enterDelay:y=100,enterNextDelay:S=0,enterTouchDelay:j=700,followCursor:A=!1,id:M,leaveDelay:R=0,leaveTouchDelay:_=1500,onClose:z,onOpen:F,open:N,placement:I="bottom",PopperComponent:B,PopperProps:H={},slotProps:P={},slots:k={},title:L,TransitionComponent:O,TransitionProps:W,...D}=s,q=v.isValidElement(a)?a:r.jsx("span",{children:a}),K=On(),Y=Ao(),[ie,V]=v.useState(),[re,fe]=v.useState(null),ae=v.useRef(!1),ue=x||A,se=wc(),J=wc(),ce=wc(),oe=wc(),[ge,de]=la({controlled:N,default:!1,name:"Tooltip",state:"open"});let le=ge;const ee=Hi(M),X=v.useRef(),ve=pn(()=>{X.current!==void 0&&(document.body.style.WebkitUserSelect=X.current,X.current=void 0),oe.clear()});v.useEffect(()=>ve,[ve]);const st=Ht=>{K6.clear(),Qx=!0,de(!0),F&&!le&&F(Ht)},Ge=pn(Ht=>{K6.start(800+R,()=>{Qx=!1}),de(!1),z&&le&&z(Ht),se.start(K.transitions.duration.shortest,()=>{ae.current=!1})}),qe=Ht=>{ae.current&&Ht.type!=="touchstart"||(ie&&ie.removeAttribute("title"),J.clear(),ce.clear(),y||Qx&&S?J.start(Qx?S:y,()=>{st(Ht)}):st(Ht))},Be=Ht=>{J.clear(),ce.start(R,()=>{Ge(Ht)})},[,Te]=v.useState(!1),Re=Ht=>{const rn=Ht?.target??ie;if(!rn||!Na(rn)){Te(!1);const yt=Ht??new Event("blur");!Ht&&rn&&(Object.defineProperty(yt,"target",{value:rn}),Object.defineProperty(yt,"currentTarget",{value:rn})),Be(yt)}},Se=Ht=>{ie||V(Ht.currentTarget),Na(Ht.target)&&(Te(!0),qe(Ht))},Ke=Ht=>{ae.current=!0;const rn=q.props;rn.onTouchStart&&rn.onTouchStart(Ht)},ot=Ht=>{Ke(Ht),ce.clear(),se.clear(),ve(),X.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",oe.start(j,()=>{document.body.style.WebkitUserSelect=X.current,qe(Ht)})},He=Ht=>{q.props.onTouchEnd&&q.props.onTouchEnd(Ht),ve(),ce.start(_,()=>{Ge(Ht)})};v.useEffect(()=>{if(!le)return;function Ht(rn){rn.key==="Escape"&&Ge(rn)}return document.addEventListener("keydown",Ht),()=>{document.removeEventListener("keydown",Ht)}},[Ge,le]);const $e=vr(Nc(q),V,n);!L&&L!==0&&(le=!1);const Z=v.useRef(),pe=Ht=>{const rn=q.props;rn.onMouseMove&&rn.onMouseMove(Ht),up={x:Ht.clientX,y:Ht.clientY},Z.current&&Z.current.update()},Q={},me=typeof L=="string";f?(Q.title=!le&&me&&!g?L:null,Q["aria-describedby"]=le?ee:null):(Q["aria-label"]=me?L:null,Q["aria-labelledby"]=le&&!me?ee:null);const we={...Q,...D,...q.props,className:Ye(D.className,q.props.className),onTouchStart:Ke,ref:$e,...A?{onMouseMove:pe}:{}},et={};b||(we.onTouchStart=ot,we.onTouchEnd=He),g||(we.onMouseOver=Jx(qe,we.onMouseOver),we.onMouseLeave=Jx(Be,we.onMouseLeave),ue||(et.onMouseOver=qe,et.onMouseLeave=Be)),p||(we.onFocus=Jx(Se,we.onFocus),we.onBlur=Jx(Re,we.onBlur),ue||(et.onFocus=Se,et.onBlur=Re));const ht={...s,isRtl:Y,arrow:o,disableInteractive:ue,placement:I,PopperComponentProp:B,touch:ae.current},ct=typeof P.popper=="function"?P.popper(ht):P.popper,bt=v.useMemo(()=>{let Ht=[{name:"arrow",enabled:!!re,options:{element:re,padding:4}}];return H.popperOptions?.modifiers&&(Ht=Ht.concat(H.popperOptions.modifiers)),ct?.popperOptions?.modifiers&&(Ht=Ht.concat(ct.popperOptions.modifiers)),{...H.popperOptions,...ct?.popperOptions,modifiers:Ht}},[re,H.popperOptions,ct?.popperOptions]),wt=EJ(ht),gn=typeof P.transition=="function"?P.transition(ht):P.transition,mn={slots:{popper:u.Popper,transition:u.Transition??O,tooltip:u.Tooltip,arrow:u.Arrow,...k},slotProps:{arrow:P.arrow??d.arrow,popper:{...H,...ct??d.popper},tooltip:P.tooltip??d.tooltip,transition:{...W,...gn??d.transition}}},[ut,_t]=jt("popper",{elementType:TJ,externalForwardedProps:mn,ownerState:ht,className:Ye(wt.popper,H?.className)}),[Yt,Xt]=jt("transition",{elementType:fg,externalForwardedProps:mn,ownerState:ht}),[ln,pr]=jt("tooltip",{elementType:kJ,className:wt.tooltip,externalForwardedProps:mn,ownerState:ht}),[nr,Bn]=jt("arrow",{elementType:MJ,className:wt.arrow,externalForwardedProps:mn,ownerState:ht,ref:fe});return r.jsxs(v.Fragment,{children:[v.cloneElement(q,we),r.jsx(ut,{as:B??Kg,placement:I,anchorEl:A?{getBoundingClientRect:()=>({top:up.y,left:up.x,right:up.x,bottom:up.y,width:0,height:0})}:ie,popperRef:Z,open:ie?le:!1,id:ee,transition:!0,...et,..._t,popperOptions:bt,children:({TransitionProps:Ht})=>r.jsx(Yt,{timeout:K.transitions.duration.shorter,...Ht,...Xt,children:r.jsxs(ln,{...pr,children:[L,o?r.jsx(nr,{...Bn}):null]})})})]})}),G=BW({createStyledComponent:Me("div",{name:"MuiStack",slot:"Root"}),useThemeProps:e=>Tt({props:e,name:"MuiStack"})});function RJ(e){return gt("MuiSwitch",e)}const Ks=mt("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),zJ=e=>{const{classes:t,edge:n,size:s,color:o,checked:a,disabled:l}=e,u={root:["root",n&&`edge${Le(n)}`,`size${Le(s)}`],switchBase:["switchBase",`color${Le(o)}`,a&&"checked",l&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},d=pt(u,RJ,t);return{...t,...d}},IJ=Me("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.edge&&t[`edge${Le(n.edge)}`],t[`size${Le(n.size)}`]]}})({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${Ks.thumb}`]:{width:16,height:16},[`& .${Ks.switchBase}`]:{padding:4,[`&.${Ks.checked}`]:{transform:"translateX(16px)"}}}}]}),FJ=Me(OR,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.switchBase,{[`& .${Ks.input}`]:t.input},n.color!=="default"&&t[`color${Le(n.color)}`]]}})(St(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode==="light"?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${Ks.checked}`]:{transform:"translateX(20px)"},[`&.${Ks.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${Ks.checked} + .${Ks.track}`]:{opacity:.5},[`&.${Ks.disabled} + .${Ks.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode==="light"?.12:.2}`},[`& .${Ks.input}`]:{left:"-100%",width:"300%"}})),St(({theme:e})=>({"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(er(["light"])).map(([t])=>({props:{color:t},style:{[`&.${Ks.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Ks.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${e.palette.mode==="light"?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.55)}`}},[`&.${Ks.checked} + .${Ks.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),_J=Me("span",{name:"MuiSwitch",slot:"Track"})(St(({theme:e})=>({height:"100%",width:"100%",borderRadius:14/2,boxSizing:"border-box",border:"1px solid transparent",zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode==="light"?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode==="light"?.38:.3}`}))),LJ=Me("span",{name:"MuiSwitch",slot:"Thumb"})(St(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",boxSizing:"border-box",border:"1px solid transparent",width:20,height:20,borderRadius:"50%"}))),IS=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiSwitch"}),{className:o,color:a="primary",edge:l=!1,size:u="medium",sx:d,slots:f={},slotProps:p={},...g}=s,x={...s,color:a,edge:l,size:u},b=zJ(x),y={slots:f,slotProps:p},[S,j]=jt("root",{className:Ye(b.root,o),elementType:IJ,externalForwardedProps:y,ownerState:x,additionalProps:{sx:d}}),[A,M]=jt("thumb",{className:b.thumb,elementType:LJ,externalForwardedProps:y,ownerState:x}),R=r.jsx(A,{...M}),[_,z]=jt("track",{className:b.track,elementType:_J,externalForwardedProps:y,ownerState:x});return r.jsxs(S,{...j,children:[r.jsx(FJ,{type:"checkbox",icon:R,checkedIcon:R,ref:n,ownerState:x,...g,classes:{...b,root:b.switchBase},slots:{...f.switchBase&&{root:f.switchBase},...f.input&&{input:f.input}},slotProps:{...p.switchBase&&{root:typeof p.switchBase=="function"?p.switchBase(x):p.switchBase},input:{role:"switch"},...p.input&&{input:typeof p.input=="function"?p.input(x):p.input}}}),r.jsx(_,{...z})]})});function PJ(e){return gt("MuiTab",e)}const fi=mt("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),DJ=e=>{const{classes:t,textColor:n,fullWidth:s,wrapped:o,icon:a,label:l,selected:u,disabled:d}=e,f={root:["root",a&&l&&"labelIcon",`textColor${Le(n)}`,s&&"fullWidth",o&&"wrapped",u&&"selected",d&&"disabled"],icon:["iconWrapper","icon"]};return pt(f,PJ,t)},OJ=Me(Li,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${Le(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{[`& .${fi.iconWrapper}`]:t.iconWrapper},{[`& .${fi.icon}`]:t.icon}]}})(St(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:t})=>t.label&&(t.iconPosition==="top"||t.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:t})=>t.label&&t.iconPosition!=="top"&&t.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:t})=>t.icon&&t.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="top",style:{[`& > .${fi.icon}`]:{marginBottom:6}}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="bottom",style:{[`& > .${fi.icon}`]:{marginTop:6}}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="start",style:{[`& > .${fi.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="end",style:{[`& > .${fi.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${fi.selected}`]:{opacity:1},[`&.${fi.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${fi.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${fi.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${fi.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${fi.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:t})=>t.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:t})=>t.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),Qs=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiTab"}),{className:o,disabled:a=!1,disableFocusRipple:l=!1,fullWidth:u,icon:d,iconPosition:f="top",indicator:p,label:g,onChange:x,onClick:b,onFocus:y,selected:S,selectionFollowsFocus:j,textColor:A="inherit",value:M,wrapped:R=!1,..._}=s,z={...s,disabled:a,disableFocusRipple:l,selected:S,icon:!!d,iconPosition:f,label:!!g,fullWidth:u,textColor:A,wrapped:R},F=DJ(z),N=d&&g&&v.isValidElement(d)?v.cloneElement(d,{className:Ye(F.icon,d.props.className)}):d,I=H=>{!S&&x&&x(H,M),b&&b(H)},B=H=>{j&&!S&&x&&x(H,M),y&&y(H)};return r.jsxs(OJ,{focusRipple:!l,className:Ye(F.root,o),ref:n,role:"tab","aria-selected":S,disabled:a,onClick:I,onFocus:B,ownerState:z,tabIndex:S?0:-1,..._,children:[f==="top"||f==="start"?r.jsxs(v.Fragment,{children:[N,g]}):r.jsxs(v.Fragment,{children:[g,N]}),p]})}),ez=v.createContext();function BJ(e){return gt("MuiTable",e)}mt("MuiTable",["root","stickyHeader"]);const NJ=e=>{const{classes:t,stickyHeader:n}=e;return pt({root:["root",n&&"stickyHeader"]},BJ,t)},$J=Me("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.stickyHeader&&t.stickyHeader]}})(St(({theme:e})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...e.typography.body2,padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:t})=>t.stickyHeader,style:{borderCollapse:"separate"}}]}))),X6="table",Eo=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiTable"}),{className:o,component:a=X6,padding:l="normal",size:u="medium",stickyHeader:d=!1,...f}=s,p={...s,component:a,padding:l,size:u,stickyHeader:d},g=NJ(p),x=v.useMemo(()=>({padding:l,size:u,stickyHeader:d}),[l,u,d]);return r.jsx(ez.Provider,{value:x,children:r.jsx($J,{as:a,role:a===X6?null:"table",ref:n,className:Ye(g.root,o),ownerState:p,...f})})}),Cb=v.createContext();function HJ(e){return gt("MuiTableBody",e)}mt("MuiTableBody",["root"]);const WJ=e=>{const{classes:t}=e;return pt({root:["root"]},HJ,t)},UJ=Me("tbody",{name:"MuiTableBody",slot:"Root"})({display:"table-row-group"}),qJ={variant:"body"},Z6="tbody",To=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiTableBody"}),{className:o,component:a=Z6,...l}=s,u={...s,component:a},d=WJ(u);return r.jsx(Cb.Provider,{value:qJ,children:r.jsx(UJ,{className:Ye(d.root,o),as:a,ref:n,role:a===Z6?null:"rowgroup",ownerState:u,...l})})});function VJ(e){return gt("MuiTableCell",e)}const GJ=mt("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),YJ=e=>{const{classes:t,variant:n,align:s,padding:o,size:a,stickyHeader:l}=e,u={root:["root",n,l&&"stickyHeader",s!=="inherit"&&`align${Le(s)}`,o!=="normal"&&`padding${Le(o)}`,`size${Le(a)}`]};return pt(u,VJ,t)},KJ=Me("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${Le(n.size)}`],n.padding!=="normal"&&t[`padding${Le(n.padding)}`],n.align!=="inherit"&&t[`align${Le(n.align)}`],n.stickyHeader&&t.stickyHeader]}})(St(({theme:e})=>({...e.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid ${e.palette.mode==="light"?e.lighten(e.alpha(e.palette.divider,1),.88):e.darken(e.alpha(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${GJ.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:t})=>t.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}))),je=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiTableCell"}),{align:o="inherit",className:a,component:l,padding:u,scope:d,size:f,sortDirection:p,variant:g,...x}=s,b=v.useContext(ez),y=v.useContext(Cb),S=y&&y.variant==="head";let j;l?j=l:j=S?"th":"td";let A=d;j==="td"?A=void 0:!A&&S&&(A="col");const M=g||y&&y.variant,R={...s,align:o,component:j,padding:u||(b&&b.padding?b.padding:"normal"),size:f||(b&&b.size?b.size:"medium"),sortDirection:p,stickyHeader:M==="head"&&b&&b.stickyHeader,variant:M},_=YJ(R);let z=null;return p&&(z=p==="asc"?"ascending":"descending"),r.jsx(KJ,{as:j,ref:n,className:Ye(_.root,a),"aria-sort":z,scope:A,ownerState:R,...x})});function XJ(e){return gt("MuiTableContainer",e)}mt("MuiTableContainer",["root"]);const ZJ=e=>{const{classes:t}=e;return pt({root:["root"]},XJ,t)},QJ=Me("div",{name:"MuiTableContainer",slot:"Root"})({width:"100%",overflowX:"auto"}),ko=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiTableContainer"}),{className:o,component:a="div",...l}=s,u={...s,component:a},d=ZJ(u);return r.jsx(QJ,{ref:n,as:a,className:Ye(d.root,o),ownerState:u,...l})});function JJ(e){return gt("MuiTableHead",e)}mt("MuiTableHead",["root"]);const eee=e=>{const{classes:t}=e;return pt({root:["root"]},JJ,t)},tee=Me("thead",{name:"MuiTableHead",slot:"Root"})({display:"table-header-group"}),nee={variant:"head"},Q6="thead",Mo=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiTableHead"}),{className:o,component:a=Q6,...l}=s,u={...s,component:a},d=eee(u);return r.jsx(Cb.Provider,{value:nee,children:r.jsx(tee,{as:a,className:Ye(d.root,o),ref:n,role:a===Q6?null:"rowgroup",ownerState:u,...l})})}),ree=ze(r.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})),see=ze(r.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}));function oee(e){return gt("MuiTableRow",e)}const J6=mt("MuiTableRow",["root","selected","hover","head","footer"]),iee=e=>{const{classes:t,selected:n,hover:s,head:o,footer:a}=e;return pt({root:["root",n&&"selected",s&&"hover",o&&"head",a&&"footer"]},oee,t)},aee=Me("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.head&&t.head,n.footer&&t.footer]}})(St(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${J6.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${J6.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)}}}))),e8="tr",Bt=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiTableRow"}),{className:o,component:a=e8,hover:l=!1,selected:u=!1,...d}=s,f=v.useContext(Cb),p={...s,component:a,hover:l,selected:u,head:f&&f.variant==="head",footer:f&&f.variant==="footer"},g=iee(p);return r.jsx(aee,{as:a,ref:n,className:Ye(g.root,o),role:a===e8?null:"row",ownerState:p,...d})});function lee(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function cee(e,t,n,s={},o=()=>{}){const{ease:a=lee,duration:l=300}=s;let u=null;const d=t[e];let f=!1;const p=()=>{f=!0},g=x=>{if(f){o(new Error("Animation cancelled"));return}u===null&&(u=x);const b=Math.min(1,(x-u)/l);if(t[e]=a(b)*(n-d)+d,b>=1){requestAnimationFrame(()=>{o(null)});return}requestAnimationFrame(g)};return d===n?(o(new Error("Element already at target position")),p):(requestAnimationFrame(g),p)}const uee={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function dee(e){const{onChange:t,...n}=e,s=v.useRef(),o=v.useRef(null),a=()=>{s.current=o.current.offsetHeight-o.current.clientHeight};return or(()=>{const l=Vg(()=>{const d=s.current;a(),d!==s.current&&t(s.current)}),u=wo(o.current);return u.addEventListener("resize",l),()=>{l.clear(),u.removeEventListener("resize",l)}},[t]),v.useEffect(()=>{a(),t(s.current)},[t]),r.jsx("div",{style:uee,...n,ref:o})}function fee(e){return gt("MuiTabScrollButton",e)}const hee=mt("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),pee=e=>{const{classes:t,orientation:n,disabled:s}=e;return pt({root:["root",n,s&&"disabled"]},fee,t)},gee=Me(Li,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${hee.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),mee=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiTabScrollButton"}),{className:o,slots:a={},slotProps:l={},direction:u,orientation:d,disabled:f,...p}=s,g=Ao(),x={isRtl:g,...s},b=pee(x),y=a.StartScrollButtonIcon??ree,S=a.EndScrollButtonIcon??see,j=Hr({elementType:y,externalSlotProps:l.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:x}),A=Hr({elementType:S,externalSlotProps:l.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:x});return r.jsx(gee,{component:"div",className:Ye(b.root,o),ref:n,role:null,ownerState:x,tabIndex:null,...p,style:{...p.style,...d==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${g?-90:90}deg)`}},children:u==="left"?r.jsx(y,{...j}):r.jsx(S,{...A})})});function xee(e){return gt("MuiTabs",e)}const Q2=mt("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),t8=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,n8=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,e0=(e,t,n)=>{let s=!1,o=n(e,t);for(;o;){if(o===e.firstChild){if(s)return;s=!0}const a=o.disabled||o.getAttribute("aria-disabled")==="true";if(!o.hasAttribute("tabindex")||a)o=n(e,o);else{o.focus();return}}},bee=e=>{const{vertical:t,fixed:n,hideScrollbar:s,scrollableX:o,scrollableY:a,centered:l,scrollButtonsHideMobile:u,classes:d}=e;return pt({root:["root",t&&"vertical"],scroller:["scroller",n&&"fixed",s&&"hideScrollbar",o&&"scrollableX",a&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",l&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",u&&"scrollButtonsHideMobile"],scrollableX:[o&&"scrollableX"],hideScrollbar:[s&&"hideScrollbar"]},xee,d)},yee=Me("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Q2.scrollButtons}`]:t.scrollButtons},{[`& .${Q2.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(St(({theme:e})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.scrollButtonsHideMobile,style:{[`& .${Q2.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}}}]}))),vee=Me("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]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),See=Me("div",{name:"MuiTabs",slot:"List",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.list,t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.centered,style:{justifyContent:"center"}}]}),jee=Me("span",{name:"MuiTabs",slot:"Indicator"})(St(({theme:e})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:t})=>t.vertical,style:{height:"100%",width:2,right:0}}]}))),Cee=Me(dee)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),r8={},Zg=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiTabs"}),o=On(),a=Ao(),{"aria-label":l,"aria-labelledby":u,action:d,centered:f=!1,children:p,className:g,component:x="div",allowScrollButtonsMobile:b=!1,indicatorColor:y="primary",onChange:S,orientation:j="horizontal",ScrollButtonComponent:A,scrollButtons:M="auto",selectionFollowsFocus:R,slots:_={},slotProps:z={},TabIndicatorProps:F={},TabScrollButtonProps:N={},textColor:I="primary",value:B,variant:H="standard",visibleScrollbar:P=!1,...k}=s,L=H==="scrollable",O=j==="vertical",W=O?"scrollTop":"scrollLeft",D=O?"top":"left",q=O?"bottom":"right",K=O?"clientHeight":"clientWidth",Y=O?"height":"width",ie={...s,component:x,allowScrollButtonsMobile:b,indicatorColor:y,orientation:j,vertical:O,scrollButtons:M,textColor:I,variant:H,visibleScrollbar:P,fixed:!L,hideScrollbar:L&&!P,scrollableX:L&&!O,scrollableY:L&&O,centered:f&&!L,scrollButtonsHideMobile:!b},V=bee(ie),re=Hr({elementType:_.StartScrollButtonIcon,externalSlotProps:z.startScrollButtonIcon,ownerState:ie}),fe=Hr({elementType:_.EndScrollButtonIcon,externalSlotProps:z.endScrollButtonIcon,ownerState:ie}),[ae,ue]=v.useState(!1),[se,J]=v.useState(r8),[ce,oe]=v.useState(!1),[ge,de]=v.useState(!1),[le,ee]=v.useState(!1),[X,ve]=v.useState({overflow:"hidden",scrollbarWidth:0}),st=new Map,Ge=v.useRef(null),qe=v.useRef(null),Be={slots:_,slotProps:{indicator:F,scrollButtons:N,...z}},Te=()=>{const yt=Ge.current;let Ft;if(yt){const an=yt.getBoundingClientRect();Ft={clientWidth:yt.clientWidth,scrollLeft:yt.scrollLeft,scrollTop:yt.scrollTop,scrollWidth:yt.scrollWidth,top:an.top,bottom:an.bottom,left:an.left,right:an.right}}let un;if(yt&&B!==!1){const an=qe.current.children;if(an.length>0){const he=an[st.get(B)];un=he?he.getBoundingClientRect():null}}return{tabsMeta:Ft,tabMeta:un}},Re=pn(()=>{const{tabsMeta:yt,tabMeta:Ft}=Te();let un=0,an;O?(an="top",Ft&&yt&&(un=Ft.top-yt.top+yt.scrollTop)):(an=a?"right":"left",Ft&&yt&&(un=(a?-1:1)*(Ft[an]-yt[an]+yt.scrollLeft)));const he={[an]:un,[Y]:Ft?Ft[Y]:0};if(typeof se[an]!="number"||typeof se[Y]!="number")J(he);else{const Ee=Math.abs(se[an]-he[an]),Fe=Math.abs(se[Y]-he[Y]);(Ee>=1||Fe>=1)&&J(he)}}),Se=(yt,{animation:Ft=!0}={})=>{Ft?cee(W,Ge.current,yt,{duration:o.transitions.duration.standard}):Ge.current[W]=yt},Ke=yt=>{let Ft=Ge.current[W];O?Ft+=yt:Ft+=yt*(a?-1:1),Se(Ft)},ot=()=>{const yt=Ge.current[K];let Ft=0;const un=Array.from(qe.current.children);for(let an=0;an<un.length;an+=1){const he=un[an];if(Ft+he[K]>yt){an===0&&(Ft=yt);break}Ft+=he[K]}return Ft},He=()=>{Ke(-1*ot())},$e=()=>{Ke(ot())},[Z,{onChange:pe,...Q}]=jt("scrollbar",{className:Ye(V.scrollableX,V.hideScrollbar),elementType:Cee,shouldForwardComponentProp:!0,externalForwardedProps:Be,ownerState:ie}),me=v.useCallback(yt=>{pe?.(yt),ve({overflow:null,scrollbarWidth:yt})},[pe]),[we,et]=jt("scrollButtons",{className:Ye(V.scrollButtons,N.className),elementType:mee,externalForwardedProps:Be,ownerState:ie,additionalProps:{orientation:j,slots:{StartScrollButtonIcon:_.startScrollButtonIcon||_.StartScrollButtonIcon,EndScrollButtonIcon:_.endScrollButtonIcon||_.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:re,endScrollButtonIcon:fe}}}),ht=()=>{const yt={};yt.scrollbarSizeListener=L?r.jsx(Z,{...Q,onChange:me}):null;const un=L&&(M==="auto"&&(ce||ge)||M===!0);return yt.scrollButtonStart=un?r.jsx(we,{direction:a?"right":"left",onClick:He,disabled:!ce,...et}):null,yt.scrollButtonEnd=un?r.jsx(we,{direction:a?"left":"right",onClick:$e,disabled:!ge,...et}):null,yt},ct=pn(yt=>{const{tabsMeta:Ft,tabMeta:un}=Te();if(!(!un||!Ft)){if(un[D]<Ft[D]){const an=Ft[W]+(un[D]-Ft[D]);Se(an,{animation:yt})}else if(un[q]>Ft[q]){const an=Ft[W]+(un[q]-Ft[q]);Se(an,{animation:yt})}}}),bt=pn(()=>{L&&M!==!1&&ee(!le)});v.useEffect(()=>{const yt=Vg(()=>{Ge.current&&Re()});let Ft;const un=Ee=>{Ee.forEach(Fe=>{Fe.removedNodes.forEach(Xe=>{Ft?.unobserve(Xe)}),Fe.addedNodes.forEach(Xe=>{Ft?.observe(Xe)})}),yt(),bt()},an=wo(Ge.current);an.addEventListener("resize",yt);let he;return typeof ResizeObserver<"u"&&(Ft=new ResizeObserver(yt),Array.from(qe.current.children).forEach(Ee=>{Ft.observe(Ee)})),typeof MutationObserver<"u"&&(he=new MutationObserver(un),he.observe(qe.current,{childList:!0})),()=>{yt.clear(),an.removeEventListener("resize",yt),he?.disconnect(),Ft?.disconnect()}},[Re,bt]),v.useEffect(()=>{const yt=Array.from(qe.current.children),Ft=yt.length;if(typeof IntersectionObserver<"u"&&Ft>0&&L&&M!==!1){const un=yt[0],an=yt[Ft-1],he={root:Ge.current,threshold:.99},Ee=At=>{oe(!At[0].isIntersecting)},Fe=new IntersectionObserver(Ee,he);Fe.observe(un);const Xe=At=>{de(!At[0].isIntersecting)},dt=new IntersectionObserver(Xe,he);return dt.observe(an),()=>{Fe.disconnect(),dt.disconnect()}}},[L,M,le,p?.length]),v.useEffect(()=>{ue(!0)},[]),v.useEffect(()=>{Re()}),v.useEffect(()=>{ct(r8!==se)},[ct,se]),v.useImperativeHandle(d,()=>({updateIndicator:Re,updateScrollButtons:bt}),[Re,bt]);const[wt,gn]=jt("indicator",{className:Ye(V.indicator,F.className),elementType:jee,externalForwardedProps:Be,ownerState:ie,additionalProps:{style:se}}),mn=r.jsx(wt,{...gn});let ut=0;const _t=v.Children.map(p,yt=>{if(!v.isValidElement(yt))return null;const Ft=yt.props.value===void 0?ut:yt.props.value;st.set(Ft,ut);const un=Ft===B;return ut+=1,v.cloneElement(yt,{fullWidth:H==="fullWidth",indicator:un&&!ae&&mn,selected:un,selectionFollowsFocus:R,onChange:S,textColor:I,value:Ft,...ut===1&&B===!1&&!yt.props.tabIndex?{tabIndex:0}:{}})}),Yt=yt=>{if(yt.altKey||yt.shiftKey||yt.ctrlKey||yt.metaKey)return;const Ft=qe.current,un=xf(is(Ft));if(un?.getAttribute("role")!=="tab")return;let he=j==="horizontal"?"ArrowLeft":"ArrowUp",Ee=j==="horizontal"?"ArrowRight":"ArrowDown";switch(j==="horizontal"&&a&&(he="ArrowRight",Ee="ArrowLeft"),yt.key){case he:yt.preventDefault(),e0(Ft,un,n8);break;case Ee:yt.preventDefault(),e0(Ft,un,t8);break;case"Home":yt.preventDefault(),e0(Ft,null,t8);break;case"End":yt.preventDefault(),e0(Ft,null,n8);break}},Xt=ht(),[ln,pr]=jt("root",{ref:n,className:Ye(V.root,g),elementType:yee,externalForwardedProps:{...Be,...k,component:x},ownerState:ie}),[nr,Bn]=jt("scroller",{ref:Ge,className:V.scroller,elementType:vee,externalForwardedProps:Be,ownerState:ie,additionalProps:{style:{overflow:X.overflow,[O?`margin${a?"Left":"Right"}`:"marginBottom"]:P?void 0:-X.scrollbarWidth}}}),[Ht,rn]=jt("list",{ref:qe,className:Ye(V.list,V.flexContainer),elementType:See,externalForwardedProps:Be,ownerState:ie,getSlotProps:yt=>({...yt,onKeyDown:Ft=>{Yt(Ft),yt.onKeyDown?.(Ft)}})});return r.jsxs(ln,{...pr,children:[Xt.scrollButtonStart,Xt.scrollbarSizeListener,r.jsxs(nr,{...Bn,children:[r.jsx(Ht,{"aria-label":l,"aria-labelledby":u,"aria-orientation":j==="vertical"?"vertical":null,role:"tablist",...rn,children:_t}),ae&&mn]}),Xt.scrollButtonEnd]})});function wee(e){return gt("MuiTextField",e)}mt("MuiTextField",["root"]);const Aee={standard:yC,filled:bC,outlined:jb},Eee=e=>{const{classes:t}=e;return pt({root:["root"]},wee,t)},Tee=Me(Ur,{name:"MuiTextField",slot:"Root"})({}),it=v.forwardRef(function(t,n){const s=Tt({props:t,name:"MuiTextField"}),{autoComplete:o,autoFocus:a=!1,children:l,className:u,color:d="primary",defaultValue:f,disabled:p=!1,error:g=!1,FormHelperTextProps:x,fullWidth:b=!1,helperText:y,id:S,InputLabelProps:j,inputProps:A,InputProps:M,inputRef:R,label:_,maxRows:z,minRows:F,multiline:N=!1,name:I,onBlur:B,onChange:H,onFocus:P,placeholder:k,required:L=!1,rows:O,select:W=!1,SelectProps:D,slots:q={},slotProps:K={},type:Y,value:ie,variant:V="outlined",...re}=s,fe={...s,autoFocus:a,color:d,disabled:p,error:g,fullWidth:b,multiline:N,required:L,select:W,variant:V},ae=Eee(fe),ue=Hi(S),se=y&&ue?`${ue}-helper-text`:void 0,J=_&&ue?`${ue}-label`:void 0,ce=Aee[V],oe={slots:q,slotProps:{input:M,inputLabel:j,htmlInput:A,formHelperText:x,select:D,...K}},ge={},de=oe.slotProps.inputLabel;V==="outlined"&&(de&&typeof de.shrink<"u"&&(ge.notched=de.shrink),ge.label=_),W&&((!D||!D.native)&&(ge.id=void 0),ge["aria-describedby"]=void 0);const[le,ee]=jt("root",{elementType:Tee,shouldForwardComponentProp:!0,externalForwardedProps:{...oe,...re},ownerState:fe,className:Ye(ae.root,u),ref:n,additionalProps:{disabled:p,error:g,fullWidth:b,required:L,color:d,variant:V}}),[X,ve]=jt("input",{elementType:ce,externalForwardedProps:oe,additionalProps:ge,ownerState:fe}),[st,Ge]=jt("inputLabel",{elementType:rs,externalForwardedProps:oe,ownerState:fe}),[qe,Be]=jt("htmlInput",{elementType:"input",externalForwardedProps:oe,ownerState:fe}),[Te,Re]=jt("formHelperText",{elementType:EX,externalForwardedProps:oe,ownerState:fe}),[Se,Ke]=jt("select",{elementType:Fn,externalForwardedProps:oe,ownerState:fe}),ot=r.jsx(X,{"aria-describedby":se,autoComplete:o,autoFocus:a,defaultValue:f,fullWidth:b,multiline:N,name:I,rows:O,maxRows:z,minRows:F,type:Y,value:ie,id:ue,inputRef:R,onBlur:B,onChange:H,onFocus:P,placeholder:k,inputProps:Be,slots:{input:q.htmlInput?qe:void 0},...ve});return r.jsxs(le,{...ee,children:[_!=null&&_!==""&&r.jsx(st,{htmlFor:ue,id:J,...Ge,children:_}),W?r.jsx(Se,{"aria-describedby":se,id:ue,labelId:J,value:ie,input:ot,...Ke,children:l}):ot,y&&r.jsx(Te,{id:se,...Re,children:y})]})}),Yu=eR({themeId:Ri}),Fc=ze([r.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),r.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")]),kee=ze(r.jsx("path",{d:"M4 10h3v7H4zm6.5 0h3v7h-3zM2 19h20v3H2zm15-9h3v7h-3zm-5-9L2 6v2h20V6z"})),J2=ze(r.jsx("path",{d:"M6.5 10h-2v7h2zm6 0h-2v7h2zm8.5 9H2v2h19zm-2.5-9h-2v7h2zm-7-6.74L16.71 6H6.29zm0-2.26L2 6v2h19V6z"})),Br=ze(r.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"})),wb=ze(r.jsx("path",{d:"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1"})),t0=ze([r.jsx("path",{d:"M17 11c.34 0 .67.04 1 .09V6.27L10.5 3 3 6.27v4.91c0 4.54 3.2 8.79 7.5 9.82.55-.13 1.08-.32 1.6-.55-.69-.98-1.1-2.17-1.1-3.45 0-3.31 2.69-6 6-6"},"0"),r.jsx("path",{d:"M17 13c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 1.38c.62 0 1.12.51 1.12 1.12s-.51 1.12-1.12 1.12-1.12-.51-1.12-1.12.5-1.12 1.12-1.12m0 5.37c-.93 0-1.74-.46-2.24-1.17.05-.72 1.51-1.08 2.24-1.08s2.19.36 2.24 1.08c-.5.71-1.31 1.17-2.24 1.17"},"1")]),Mee=ze(r.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M9 17H7v-5h2zm4 0h-2v-3h2zm0-5h-2v-2h2zm4 5h-2V7h2z"})),Ree=ze(r.jsx("path",{d:"m20.54 5.23-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27M12 17.5 6.5 12H10v-2h4v2h3.5zM5.12 5l.81-1h12l.94 1z"})),zee=ze(r.jsx("path",{d:"m20.54 5.23-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27M6.24 5h11.52l.81.97H5.44zM5 19V8h14v11zm8.45-9h-2.9v3H8l4 4 4-4h-2.55z"})),fa=ze(r.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"})),Oi=ze(r.jsx("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"})),Iee=ze(r.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-5 14H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"})),Hf=ze([r.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),r.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),Fee=ze(r.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V5h14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"})),s8=ze(r.jsx("path",{d:"M19 3h-4.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m2 14H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"})),H0=ze(r.jsx("path",{d:"M7 15h7v2H7zm0-4h10v2H7zm0-4h10v2H7zm12-4h-4.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H5c-.14 0-.27.01-.4.04-.39.08-.74.28-1.01.55-.18.18-.33.4-.43.64-.1.23-.16.49-.16.77v14c0 .27.06.54.16.78s.25.45.43.64c.27.27.62.47 1.01.55.13.02.26.03.4.03h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7-.25c.41 0 .75.34.75.75s-.34.75-.75.75-.75-.34-.75-.75.34-.75.75-.75M19 19H5V5h14z"})),_ee=ze(r.jsx("path",{d:"M19 3h-4.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m-2 14-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z"})),Ab=ze(r.jsx("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6z"})),o8=ze(r.jsx("path",{d:"M22.47 5.2c-.47-.24-.96-.44-1.47-.61v12.03c-1.14-.41-2.31-.62-3.5-.62-1.9 0-3.78.54-5.5 1.58V5.48C10.38 4.55 8.51 4 6.5 4c-1.79 0-3.48.44-4.97 1.2-.33.16-.53.51-.53.88v12.08c0 .58.47.99 1 .99q.24 0 .48-.12C3.69 18.4 5.05 18 6.5 18c2.07 0 3.98.82 5.5 2 1.52-1.18 3.43-2 5.5-2 1.45 0 2.81.4 4.02 1.04q.24.12.48.12c.52 0 1-.41 1-.99V6.08c0-.37-.2-.72-.53-.88M10 16.62C8.86 16.21 7.69 16 6.5 16s-2.36.21-3.5.62V6.71C4.11 6.24 5.28 6 6.5 6c1.2 0 2.39.25 3.5.72zM19 .5l-5 5V15l5-4.5z"})),Lee=ze([r.jsx("path",{d:"M14 12h4v1.5h-4zm0 3h4v1.5h-4z"},"0"),r.jsx("path",{d:"M20 7h-5V4c0-1.1-.9-2-2-2h-2c-1.1 0-2 .9-2 2v3H4c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2m-9 0V4h2v5h-2zm9 13H4V9h5c0 1.1.9 2 2 2h2c1.1 0 2-.9 2-2h5z"},"1"),r.jsx("circle",{cx:"9",cy:"13.5",r:"1.5"},"2"),r.jsx("path",{d:"M11.08 16.18c-.64-.28-1.34-.43-2.08-.43s-1.44.15-2.08.43c-.56.24-.92.78-.92 1.39V18h6v-.43c0-.61-.36-1.15-.92-1.39"},"3")]),Pee=ze(r.jsx("path",{d:"M4 9h4v11H4zm12 4h4v7h-4zm-6-9h4v16h-4z"})),_c=ze(r.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),Dee=ze(r.jsx("path",{d:"M18 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M9 4h2v5l-1-.75L9 9zm9 16H6V4h1v9l3-2.25L13 13V4h5z"})),Oee=ze(r.jsx("path",{d:"M12 7V3H2v18h20V7zM6 19H4v-2h2zm0-4H4v-2h2zm0-4H4V9h2zm0-4H4V5h2zm4 12H8v-2h2zm0-4H8v-2h2zm0-4H8V9h2zm0-4H8V5h2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8zm-2-8h-2v2h2zm0 4h-2v2h2z"})),Cl=ze(r.jsx("path",{d:"M12 7V3H2v18h20V7zM6 19H4v-2h2zm0-4H4v-2h2zm0-4H4V9h2zm0-4H4V5h2zm4 12H8v-2h2zm0-4H8v-2h2zm0-4H8V9h2zm0-4H8V5h2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8zm-2-8h-2v2h2zm0 4h-2v2h2z"})),Bee=ze(r.jsx("path",{d:"M17 2c-.55 0-1 .45-1 1v1H8V3c0-.55-.45-1-1-1s-1 .45-1 1v1H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-1V3c0-.55-.45-1-1-1m2 18H5V10h14zm-8-7c0-.55.45-1 1-1s1 .45 1 1-.45 1-1 1-1-.45-1-1m-4 0c0-.55.45-1 1-1s1 .45 1 1-.45 1-1 1-1-.45-1-1m8 0c0-.55.45-1 1-1s1 .45 1 1-.45 1-1 1-1-.45-1-1m-4 4c0-.55.45-1 1-1s1 .45 1 1-.45 1-1 1-1-.45-1-1m-4 0c0-.55.45-1 1-1s1 .45 1 1-.45 1-1 1-1-.45-1-1m8 0c0-.55.45-1 1-1s1 .45 1 1-.45 1-1 1-1-.45-1-1"})),wC=ze(r.jsx("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V8h16z"})),Nee=ze(r.jsx("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V10h16zm0-13H4V5h16z"})),$ee=ze(r.jsx("path",{d:"M20 3h-1V2c0-.55-.45-1-1-1s-1 .45-1 1v1H7V2c0-.55-.45-1-1-1s-1 .45-1 1v1H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-1 18H5c-.55 0-1-.45-1-1V8h16v12c0 .55-.45 1-1 1"})),Hee=ze(r.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"})),tz=ze(r.jsx("path",{d:"M20 2H4c-1.11 0-2 .89-2 2v11c0 1.11.89 2 2 2h4v5l4-2 4 2v-5h4c1.11 0 2-.89 2-2V4c0-1.11-.89-2-2-2m0 13H4v-2h16zm0-5H4V4h16z"})),e5=ze([r.jsx("path",{d:"m12 2-5.5 9h11z"},"0"),r.jsx("circle",{cx:"17.5",cy:"17.5",r:"4.5"},"1"),r.jsx("path",{d:"M3 13.5h8v8H3z"},"2")]),Wee=ze(r.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})),fr=ze(r.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"})),Ia=ze(r.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),hg=ze(r.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"})),nz=ze(r.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M9.29 16.29 5.7 12.7a.996.996 0 0 1 0-1.41c.39-.39 1.02-.39 1.41 0L10 14.17l6.88-6.88c.39-.39 1.02-.39 1.41 0s.39 1.02 0 1.41l-7.59 7.59c-.38.39-1.02.39-1.41 0"})),Uee=ze(r.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),Eb=ze(r.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),hs=ze(r.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),pg=ze(r.jsx("path",{d:"M18.3 5.71a.996.996 0 0 0-1.41 0L12 10.59 7.11 5.7a.996.996 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41s1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0s.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4"})),Bu=ze(r.jsx("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"})),i8=ze(r.jsx("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3M8 13h2.55v3h2.9v-3H16l-4-4z"})),qee=ze(r.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"})),zp=ze(r.jsx("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2m0 14H4v-6h16zm0-10H4V6h16z"})),Tf=ze(r.jsx("path",{d:"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"})),Vee=ze(r.jsx("path",{d:"M3 13h8V3H3zm0 8h8v-6H3zm10 0h8V11h-8zm0-18v6h8V3z"})),rz=ze(r.jsx("path",{d:"M19 5v2h-4V5zM9 5v6H5V5zm10 8v6h-4v-6zM9 17v2H5v-2zM21 3h-8v6h8zM11 3H3v10h8zm10 8h-8v10h8zm-10 4H3v6h8z"})),ss=ze(r.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"})),a8=ze(r.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"})),FS=ze(r.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2zM18 4h-2.5l-.71-.71c-.18-.18-.44-.29-.7-.29H9.91c-.26 0-.52.11-.7.29L8.5 4H6c-.55 0-1 .45-1 1s.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1"})),Gee=ze(r.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 16H8v-2h8zm0-4H8v-2h8zm-3-5V3.5L18.5 9z"})),Qg=ze(r.jsx("path",{d:"M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"})),l8=ze(r.jsx("path",{d:"M12 7V5c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2zM6 19H4v-2h2zm0-4H4v-2h2zm0-4H4V9h2zm0-4H4V5h2zm4 12H8v-2h2zm0-4H8v-2h2zm0-4H8V9h2zm0-4H8V5h2zm9 12h-7v-2h2v-2h-2v-2h2v-2h-2V9h7c.55 0 1 .45 1 1v8c0 .55-.45 1-1 1m-1-8h-2v2h2zm0 4h-2v2h2z"})),sz=ze(r.jsx("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"})),Yee=ze(r.jsx("path",{d:"M19 9h-4V3H9v6H5l7 7zm-8 2V5h2v6h1.17L12 13.17 9.83 11zm-6 7h14v2H5z"})),kf=ze(r.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})),Ws=ze(r.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"})),Kee=ze(r.jsx("path",{d:"M3 17.46v3.04c0 .28.22.5.5.5h3.04c.13 0 .26-.05.35-.15L17.81 9.94l-3.75-3.75L3.15 17.1q-.15.15-.15.36M20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"})),Xee=ze(r.jsx("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 4-8 5-8-5V6l8 5 8-5z"})),gg=ze(r.jsx("path",{d:"M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2zm-2 0-8 5-8-5zm0 12H4V8l8 5 8-5z"})),Jg=ze(r.jsx("path",{d:"M19 5h-2V3H7v2H5c-1.1 0-2 .9-2 2v1c0 2.55 1.92 4.63 4.39 4.94.63 1.5 1.98 2.63 3.61 2.96V19H7v2h10v-2h-4v-3.1c1.63-.33 2.98-1.46 3.61-2.96C19.08 12.63 21 10.55 21 8V7c0-1.1-.9-2-2-2M5 8V7h2v3.82C5.84 10.4 5 9.3 5 8m14 0c0 1.3-.84 2.4-2 2.82V7h2z"})),Zee=ze(r.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),em=ze(r.jsx("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"})),ti=ze(r.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})),Qee=ze(r.jsx("path",{d:"M15.88 9.29 12 13.17 8.12 9.29a.996.996 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41-.39-.38-1.03-.39-1.42 0"})),Jee=ze(r.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"})),Tb=ze(r.jsx("path",{d:"M11 18h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M3 7c0 .55.45 1 1 1h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1m4 6h10c.55 0 1-.45 1-1s-.45-1-1-1H7c-.55 0-1 .45-1 1s.45 1 1 1"})),ete=ze(r.jsx("path",{d:"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"})),tte=ze(r.jsx("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"})),oz=ze(r.jsx("path",{d:"M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z"})),c8=ze(r.jsx("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"})),iz=ze(r.jsx("path",{d:"M12 12.75c1.63 0 3.07.39 4.24.9 1.08.48 1.76 1.56 1.76 2.73V18H6v-1.61c0-1.18.68-2.26 1.76-2.73 1.17-.52 2.61-.91 4.24-.91M4 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m1.13 1.1c-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58C.48 14.9 0 15.62 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29M20 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m4 3.43c0-.81-.48-1.53-1.22-1.85-.85-.37-1.79-.58-2.78-.58-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24zM12 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3"})),az=ze(r.jsx("path",{d:"M16.48 10.41c-.39.39-1.04.39-1.43 0l-4.47-4.46-7.05 7.04-.66-.63c-1.17-1.17-1.17-3.07 0-4.24l4.24-4.24c1.17-1.17 3.07-1.17 4.24 0L16.48 9c.39.39.39 1.02 0 1.41m.7-2.12c.78.78.78 2.05 0 2.83-1.27 1.27-2.61.22-2.83 0l-3.76-3.76-5.57 5.57c-.39.39-.39 1.02 0 1.41s1.02.39 1.42 0l4.62-4.62.71.71-4.62 4.62c-.39.39-.39 1.02 0 1.41s1.02.39 1.42 0l4.62-4.62.71.71-4.62 4.62c-.39.39-.39 1.02 0 1.41s1.02.39 1.41 0l4.62-4.62.71.71-4.62 4.62c-.39.39-.39 1.02 0 1.41s1.02.39 1.41 0l8.32-8.34c1.17-1.17 1.17-3.07 0-4.24l-4.24-4.24c-1.15-1.15-3.01-1.17-4.18-.06z"})),nte=ze(r.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"})),rte=ze(r.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"})),i1=ze(r.jsx("path",{d:"M14.59 8 12 10.59 9.41 8 8 9.41 10.59 12 8 14.59 9.41 16 12 13.41 14.59 16 16 14.59 13.41 12 16 9.41zM12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"})),Gp=ze(r.jsx("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8z"})),ste=ze(r.jsx("path",{d:"M9 4v1.38c-.83-.33-1.72-.5-2.61-.5-1.79 0-3.58.68-4.95 2.05l3.33 3.33h1.11v1.11c.86.86 1.98 1.31 3.11 1.36V15H6v3c0 1.1.9 2 2 2h10c1.66 0 3-1.34 3-3V4zm-1.11 6.41V8.26H5.61L4.57 7.22a5.07 5.07 0 0 1 1.82-.34c1.34 0 2.59.52 3.54 1.46l1.41 1.41-.2.2c-.51.51-1.19.8-1.92.8-.47 0-.93-.12-1.33-.34M19 17c0 .55-.45 1-1 1s-1-.45-1-1v-2h-6v-2.59c.57-.23 1.1-.57 1.56-1.03l.2-.2L15.59 14H17v-1.41l-6-5.97V6h8z"})),u8=ze(r.jsx("path",{d:"M13.26 3C8.17 2.86 4 6.95 4 12H2.21c-.45 0-.67.54-.35.85l2.79 2.8c.2.2.51.2.71 0l2.79-2.8c.31-.31.09-.85-.36-.85H6c0-3.9 3.18-7.05 7.1-7 3.72.05 6.85 3.18 6.9 6.9.05 3.91-3.1 7.1-7 7.1-1.61 0-3.1-.55-4.28-1.48-.4-.31-.96-.28-1.32.08-.42.42-.39 1.13.08 1.49C9 20.29 10.91 21 13 21c5.05 0 9.14-4.17 9-9.26-.13-4.69-4.05-8.61-8.74-8.74m-.51 5c-.41 0-.75.34-.75.75v3.68c0 .35.19.68.49.86l3.12 1.85c.36.21.82.09 1.03-.26.21-.36.09-.82-.26-1.03l-2.88-1.71v-3.4c0-.4-.34-.74-.75-.74"})),ote=ze(r.jsx("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"})),ite=ze(r.jsx("path",{d:"M6 2v6h.01L6 8.01 10 12l-4 4 .01.01H6V22h12v-5.99h-.01L18 16l-4-4 4-3.99-.01-.01H18V2zm10 14.5V20H8v-3.5l4-4zm-4-5-4-4V4h8v3.5z"})),kb=ze(r.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"})),Lc=ze(r.jsx("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"})),ate=ze([r.jsx("path",{d:"M21 8c-1.45 0-2.26 1.44-1.93 2.51l-3.55 3.56c-.3-.09-.74-.09-1.04 0l-2.55-2.55C12.27 10.45 11.46 9 10 9c-1.45 0-2.27 1.44-1.93 2.52l-4.56 4.55C2.44 15.74 1 16.55 1 18c0 1.1.9 2 2 2 1.45 0 2.26-1.44 1.93-2.51l4.55-4.56c.3.09.74.09 1.04 0l2.55 2.55C12.73 16.55 13.54 18 15 18c1.45 0 2.27-1.44 1.93-2.52l3.56-3.55c1.07.33 2.51-.48 2.51-1.93 0-1.1-.9-2-2-2"},"0"),r.jsx("path",{d:"m15 9 .94-2.07L18 6l-2.06-.93L15 3l-.92 2.07L12 6l2.08.93zM3.5 11 4 9l2-.5L4 8l-.5-2L3 8l-2 .5L3 9z"},"1")]),mg=ze(r.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56M12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96M4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2s.06 1.34.14 2zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56m2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8M12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96M14.34 14H9.66c-.09-.66-.16-1.32-.16-2s.07-1.35.16-2h4.68c.09.65.16 1.32.16 2s-.07 1.34-.16 2m.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56M16.36 14c.08-.66.14-1.32.14-2s-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2z"})),lte=ze(r.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56M12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96M4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2s.06 1.34.14 2zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56m2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8M12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96M14.34 14H9.66c-.09-.66-.16-1.32-.16-2s.07-1.35.16-2h4.68c.09.65.16 1.32.16 2s-.07 1.34-.16 2m.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56M16.36 14c.08-.66.14-1.32.14-2s-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2z"})),n0=ze(r.jsx("path",{d:"m11.99 18.54-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27zm0-11.47L17.74 9 12 13.47 6.26 9z"})),cte=ze(r.jsx("path",{d:"M3 6c-.55 0-1 .45-1 1v13c0 1.1.9 2 2 2h13c.55 0 1-.45 1-1s-.45-1-1-1H5c-.55 0-1-.45-1-1V7c0-.55-.45-1-1-1m17-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-2 9h-3v3c0 .55-.45 1-1 1s-1-.45-1-1v-3h-3c-.55 0-1-.45-1-1s.45-1 1-1h3V6c0-.55.45-1 1-1s1 .45 1 1v3h3c.55 0 1 .45 1 1s-.45 1-1 1"})),Mf=ze(r.jsx("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"})),ute=ze(r.jsx("path",{d:"M9 21c0 .5.4 1 1 1h4c.6 0 1-.5 1-1v-1H9zm3-19C8.1 2 5 5.1 5 9c0 2.4 1.2 4.5 3 5.7V17c0 .5.4 1 1 1h6c.6 0 1-.5 1-1v-2.3c1.8-1.3 3-3.4 3-5.7 0-3.9-3.1-7-7-7"})),lz=ze([r.jsx("path",{d:"m12 12.9-2.13 2.09c-.56.56-.87 1.29-.87 2.07C9 18.68 10.35 20 12 20s3-1.32 3-2.94c0-.78-.31-1.52-.87-2.07z"},"0"),r.jsx("path",{d:"m16 6-.44.55C14.38 8.02 12 7.19 12 5.3V2S4 6 4 13c0 2.92 1.56 5.47 3.89 6.86-.56-.79-.89-1.76-.89-2.8 0-1.32.52-2.56 1.47-3.5L12 10.1l3.53 3.47c.95.93 1.47 2.17 1.47 3.5 0 1.02-.31 1.96-.85 2.75 1.89-1.15 3.29-3.06 3.71-5.3.66-3.55-1.07-6.9-3.86-8.52"},"1")]),dte=ze([r.jsx("path",{d:"m21.41 11.58-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42M13 20.01 4 11V4h7v-.01l9 9z"},"0"),r.jsx("circle",{cx:"6.5",cy:"6.5",r:"1.5"},"1")]),fte=ze(r.jsx("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"})),_S=ze([r.jsx("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7M7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.88-2.88 7.19-5 9.88C9.92 16.21 7 11.85 7 9"},"0"),r.jsx("circle",{cx:"12",cy:"9",r:"2.5"},"1")]),Yp=ze(r.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),yf=ze(r.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2M9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9zm9 14H6V10h12zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2"})),hte=ze(r.jsx("path",{d:"M13 3c-4.97 0-9 4.03-9 9 0 .06.01.12.01.19l-1.84-1.84-1.41 1.41L5 16l4.24-4.24-1.41-1.41-1.82 1.82c0-.06-.01-.11-.01-.17 0-3.86 3.14-7 7-7s7 3.14 7 7-3.14 7-7 7c-1.9 0-3.62-.76-4.88-1.99L6.7 18.42C8.32 20.01 10.55 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m2 8v-1c0-1.1-.9-2-2-2s-2 .9-2 2v1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1m-1 0h-2v-1c0-.55.45-1 1-1s1 .45 1 1z"})),pte=ze(r.jsx("path",{d:"m17 7-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4z"})),cz=ze(r.jsx("path",{d:"m17 8-1.41 1.41L17.17 11H9v2h8.17l-1.58 1.58L17 16l4-4zM5 5h7V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h7v-2H5z"})),gte=ze(r.jsx("path",{d:"M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2zm-2 0-8 4.99L4 6zm0 12H4V8l8 5 8-5z"})),tm=ze(r.jsx("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"})),mte=ze([r.jsx("path",{d:"M21 5c-1.11-.35-2.33-.5-3.5-.5-1.95 0-4.05.4-5.5 1.5-1.45-1.1-3.55-1.5-5.5-1.5S2.45 4.9 1 6v14.65c0 .25.25.5.5.5.1 0 .15-.05.25-.05C3.1 20.45 5.05 20 6.5 20c1.95 0 4.05.4 5.5 1.5 1.35-.85 3.8-1.5 5.5-1.5 1.65 0 3.35.3 4.75 1.05.1.05.15.05.25.05.25 0 .5-.25.5-.5V6c-.6-.45-1.25-.75-2-1m0 13.5c-1.1-.35-2.3-.5-3.5-.5-1.7 0-4.15.65-5.5 1.5V8c1.35-.85 3.8-1.5 5.5-1.5 1.2 0 2.4.15 3.5.5z"},"0"),r.jsx("path",{d:"M17.5 10.5c.88 0 1.73.09 2.5.26V9.24c-.79-.15-1.64-.24-2.5-.24-1.7 0-3.24.29-4.5.83v1.66c1.13-.64 2.7-.99 4.5-.99M13 12.49v1.66c1.13-.64 2.7-.99 4.5-.99.88 0 1.73.09 2.5.26V11.9c-.79-.15-1.64-.24-2.5-.24-1.7 0-3.24.3-4.5.83m4.5 1.84c-1.7 0-3.24.29-4.5.83v1.66c1.13-.64 2.7-.99 4.5-.99.88 0 1.73.09 2.5.26v-1.52c-.79-.16-1.64-.24-2.5-.24"},"1")]),uz=ze([r.jsx("path",{d:"M21 5c-1.11-.35-2.33-.5-3.5-.5-1.95 0-4.05.4-5.5 1.5-1.45-1.1-3.55-1.5-5.5-1.5S2.45 4.9 1 6v14.65c0 .25.25.5.5.5.1 0 .15-.05.25-.05C3.1 20.45 5.05 20 6.5 20c1.95 0 4.05.4 5.5 1.5 1.35-.85 3.8-1.5 5.5-1.5 1.65 0 3.35.3 4.75 1.05.1.05.15.05.25.05.25 0 .5-.25.5-.5V6c-.6-.45-1.25-.75-2-1m0 13.5c-1.1-.35-2.3-.5-3.5-.5-1.7 0-4.15.65-5.5 1.5V8c1.35-.85 3.8-1.5 5.5-1.5 1.2 0 2.4.15 3.5.5z"},"0"),r.jsx("path",{d:"M17.5 10.5c.88 0 1.73.09 2.5.26V9.24c-.79-.15-1.64-.24-2.5-.24-1.7 0-3.24.29-4.5.83v1.66c1.13-.64 2.7-.99 4.5-.99M13 12.49v1.66c1.13-.64 2.7-.99 4.5-.99.88 0 1.73.09 2.5.26V11.9c-.79-.15-1.64-.24-2.5-.24-1.7 0-3.24.3-4.5.83m4.5 1.84c-1.7 0-3.24.29-4.5.83v1.66c1.13-.64 2.7-.99 4.5-.99.88 0 1.73.09 2.5.26v-1.52c-.79-.16-1.64-.24-2.5-.24"},"1")]),xte=ze(r.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})),bte=ze(r.jsx("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"})),dz=ze(r.jsx("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"})),yte=ze(r.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),LS=ze(r.jsx("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"})),a1=ze(r.jsx("path",{d:"M19 14V6c0-1.1-.9-2-2-2H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2m-9-1c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m13-6v11c0 1.1-.9 2-2 2H4v-2h17V7z"})),fz=ze(r.jsx("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"})),d8=ze(r.jsx("path",{d:"M16.67 13.13C18.04 14.06 19 15.32 19 17v3h4v-3c0-2.18-3.57-3.47-6.33-3.87M15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4c-.47 0-.91.1-1.33.24C14.5 5.27 15 6.58 15 8s-.5 2.73-1.33 3.76c.42.14.86.24 1.33.24m-6 0c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 7c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4m6 5H3v-.99C3.2 16.29 6.3 15 9 15s5.8 1.29 6 2z"})),vte=ze(r.jsx("path",{d:"M9 13.75c-2.34 0-7 1.17-7 3.5V19h14v-1.75c0-2.33-4.66-3.5-7-3.5M4.34 17c.84-.58 2.87-1.25 4.66-1.25s3.82.67 4.66 1.25zM9 12c1.93 0 3.5-1.57 3.5-3.5S10.93 5 9 5 5.5 6.57 5.5 8.5 7.07 12 9 12m0-5c.83 0 1.5.67 1.5 1.5S9.83 10 9 10s-1.5-.67-1.5-1.5S8.17 7 9 7m7.04 6.81c1.16.84 1.96 1.96 1.96 3.44V19h4v-1.75c0-2.02-3.5-3.17-5.96-3.44M15 12c1.93 0 3.5-1.57 3.5-3.5S16.93 5 15 5c-.54 0-1.04.13-1.5.35.63.89 1 1.98 1 3.15s-.37 2.26-1 3.15c.46.22.96.35 1.5.35"})),hz=ze(r.jsx("path",{d:"M2 6H0v5h.01L0 20c0 1.1.9 2 2 2h18v-2H2zm5 9h14l-3.5-4.5-2.5 3.01L11.5 9zM22 4h-8l-2-2H6c-1.1 0-1.99.9-1.99 2L4 16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 12H6V4h5.17l1.41 1.41.59.59H22z"})),pz=ze(r.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"})),Mb=ze(r.jsx("path",{d:"M15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m-9-2V7H4v3H1v2h3v3h2v-3h3v-2zm9 4c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"})),gz=ze(r.jsx("path",{d:"M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4"})),PS=ze(r.jsx("path",{d:"M12 6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 10c2.7 0 5.8 1.29 6 2H6c.23-.72 3.31-2 6-2m0-12C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 10c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"})),Ste=ze(r.jsx("path",{d:"M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02z"})),jte=ze(r.jsx("path",{d:"M6.54 5c.06.89.21 1.76.45 2.59l-1.2 1.2c-.41-1.2-.67-2.47-.76-3.79zm9.86 12.02c.85.24 1.72.39 2.6.45v1.49c-1.32-.09-2.59-.35-3.8-.75zM7.5 3H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.49c0-.55-.45-1-1-1-1.24 0-2.45-.2-3.57-.57-.1-.04-.21-.05-.31-.05-.26 0-.51.1-.71.29l-2.2 2.2c-2.83-1.45-5.15-3.76-6.59-6.59l2.2-2.2c.28-.28.36-.67.25-1.02C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1"})),l1=ze(r.jsx("path",{d:"M8 5v14l11-7z"})),jo=ze(r.jsx("path",{d:"m10 16.5 6-4.5-6-4.5zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"})),Cte=ze(r.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m-2.5-3.5 7-4.5-7-4.5z"})),wte=ze([r.jsx("path",{d:"M13 8.57c-.79 0-1.43.64-1.43 1.43s.64 1.43 1.43 1.43 1.43-.64 1.43-1.43-.64-1.43-1.43-1.43"},"0"),r.jsx("path",{d:"M13 3C9.25 3 6.2 5.94 6.02 9.64L4.1 12.2c-.25.33-.01.8.4.8H6v3c0 1.1.9 2 2 2h1v3h7v-4.68c2.36-1.12 4-3.53 4-6.32 0-3.87-3.13-7-7-7m3 7c0 .13-.01.26-.02.39l.83.66c.08.06.1.16.05.25l-.8 1.39c-.05.09-.16.12-.24.09l-.99-.4c-.21.16-.43.29-.67.39L14 13.83c-.01.1-.1.17-.2.17h-1.6c-.1 0-.18-.07-.2-.17l-.15-1.06c-.25-.1-.47-.23-.68-.39l-.99.4c-.09.03-.2 0-.25-.09l-.8-1.39c-.05-.08-.03-.19.05-.25l.84-.66c-.01-.13-.02-.26-.02-.39s.02-.27.04-.39l-.85-.66c-.08-.06-.1-.16-.05-.26l.8-1.38c.05-.09.15-.12.24-.09l1 .4c.2-.15.43-.29.67-.39L12 6.17c.02-.1.1-.17.2-.17h1.6c.1 0 .18.07.2.17l.15 1.06c.24.1.46.23.67.39l1-.4c.09-.03.2 0 .24.09l.8 1.38c.05.09.03.2-.05.26l-.85.66c.03.12.04.25.04.39"},"1")]),mz=ze(r.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39"})),Ate=ze(r.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-.61.08-1.21.21-1.78L8.99 15v1c0 1.1.9 2 2 2v1.93C7.06 19.43 4 16.07 4 12m13.89 5.4c-.26-.81-1-1.4-1.9-1.4h-1v-3c0-.55-.45-1-1-1h-6v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41C17.92 5.77 20 8.65 20 12c0 2.08-.81 3.98-2.11 5.4"})),W0=ze(r.jsx("path",{d:"M5 4v2h14V4zm0 10h4v6h6v-6h4l-7-7z"})),Ete=ze(r.jsx("path",{d:"M5 5c0 .55.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1H6c-.55 0-1 .45-1 1m2.41 9H9v5c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-5h1.59c.89 0 1.34-1.08.71-1.71L12.71 7.7a.996.996 0 0 0-1.41 0l-4.59 4.59c-.63.63-.19 1.71.7 1.71"})),xz=ze(r.jsx("path",{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H8V4h12zm-6.49-5.84c.41-.73 1.18-1.16 1.63-1.8.48-.68.21-1.94-1.14-1.94-.88 0-1.32.67-1.5 1.23l-1.37-.57C11.51 5.96 12.52 5 13.99 5c1.23 0 2.08.56 2.51 1.26.37.6.58 1.73.01 2.57-.63.93-1.23 1.21-1.56 1.81-.13.24-.18.4-.18 1.18h-1.52c.01-.41-.06-1.08.26-1.66m-.56 3.79c0-.59.47-1.04 1.05-1.04.59 0 1.04.45 1.04 1.04 0 .58-.44 1.05-1.04 1.05-.58 0-1.05-.47-1.05-1.05"})),Tte=ze(r.jsx("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M6 14v-2.47l6.88-6.88c.2-.2.51-.2.71 0l1.77 1.77c.2.2.2.51 0 .71L8.47 14zm12 0h-7.5l2-2H18z"})),bz=ze(r.jsx("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H5.17l-.59.59-.58.58V4h16zm-9.5-2H18v-2h-5.5zm3.86-5.87c.2-.2.2-.51 0-.71l-1.77-1.77c-.2-.2-.51-.2-.71 0L6 11.53V14h2.47z"})),Ku=ze(r.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"})),nm=ze(r.jsx("path",{d:"M17.65 6.35c-1.63-1.63-3.94-2.57-6.48-2.31-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20c3.19 0 5.93-1.87 7.21-4.56.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53-1.13 2.43-3.84 3.97-6.8 3.31-2.22-.49-4.01-2.3-4.48-4.52C5.31 9.44 8.26 6 12 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71z"})),kte=ze(r.jsx("path",{d:"M12 5V2.21c0-.45-.54-.67-.85-.35l-3.8 3.79c-.2.2-.2.51 0 .71l3.79 3.79c.32.31.86.09.86-.36V7c3.73 0 6.68 3.42 5.86 7.29-.47 2.27-2.31 4.1-4.57 4.57-3.57.75-6.75-1.7-7.23-5.01-.07-.48-.49-.85-.98-.85-.6 0-1.08.53-1 1.13.62 4.39 4.8 7.64 9.53 6.72 3.12-.61 5.63-3.12 6.24-6.24C20.84 9.48 16.94 5 12 5"})),yz=ze(r.jsx("path",{d:"M9.19 6.35c-2.04 2.29-3.44 5.58-3.57 5.89L2 10.69l4.05-4.05c.47-.47 1.15-.68 1.81-.55zM11.17 17s3.74-1.55 5.89-3.7c5.4-5.4 4.5-9.62 4.21-10.57-.95-.3-5.17-1.19-10.57 4.21C8.55 9.09 7 12.83 7 12.83zm6.48-2.19c-2.29 2.04-5.58 3.44-5.89 3.57L13.31 22l4.05-4.05c.47-.47.68-1.15.55-1.81zM9 18c0 .83-.34 1.58-.88 2.12C6.94 21.3 2 22 2 22s.7-4.94 1.88-6.12C4.42 15.34 5.17 15 6 15c1.66 0 3 1.34 3 3m4-9c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2"})),Mte=ze(r.jsx("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"})),rm=ze([r.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),r.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")]),hr=ze(r.jsx("path",{d:"M5 13.18v4L12 21l7-3.82v-4L12 17zM12 3 1 9l11 6 9-4.91V17h2V9z"})),AC=ze(r.jsx("path",{d:"M12 3 1 9l4 2.18v6L12 21l7-3.82v-6l2-1.09V17h2V9zm6.82 6L12 12.72 5.18 9 12 5.28zM17 15.99l-5 2.73-5-2.73v-3.72L12 15l5-2.73z"})),to=ze(r.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"})),EC=ze(r.jsx("path",{d:"M15.5 14h-.79l-.28-.27c1.2-1.4 1.82-3.31 1.48-5.34-.47-2.78-2.79-5-5.59-5.34-4.23-.52-7.79 3.04-7.27 7.27.34 2.8 2.56 5.12 5.34 5.59 2.03.34 3.94-.28 5.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0s.41-1.08 0-1.49zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"})),Rte=ze(r.jsx("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11z"})),f8=ze(r.jsx("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11z"})),Rb=ze(r.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"})),c1=ze(r.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"})),zte=ze(r.jsx("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.09-.16-.26-.25-.44-.25-.06 0-.12.01-.17.03l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1q-.09-.03-.18-.03c-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.09.16.26.25.44.25.06 0 .12-.01.17-.03l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1q.09.03.18.03c.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64zm-1.98-1.71c.04.31.05.52.05.73s-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"})),Ite=ze(r.jsx("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92"})),TC=ze(r.jsx("path",{d:"M17 4h3v16h-3zM5 14h3v6H5zm6-5h3v11h-3z"})),Fte=ze(r.jsx("path",{d:"M3 18h6v-2H3zM3 6v2h18V6zm0 7h12v-2H3z"})),vz=ze(r.jsx("path",{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"})),t5=ze(r.jsx("path",{d:"m22 9.24-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28z"})),Sz=ze(r.jsx("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2M4 12h4v2H4zm10 6H4v-2h10zm6 0h-4v-2h4zm0-4H10v-2h10z"})),_te=ze([r.jsx("path",{d:"M21 12.22C21 6.73 16.74 3 12 3c-4.69 0-9 3.65-9 9.28-.6.34-1 .98-1 1.72v2c0 1.1.9 2 2 2h1v-6.1c0-3.87 3.13-7 7-7s7 3.13 7 7V19h-8v2h8c1.1 0 2-.9 2-2v-1.22c.59-.31 1-.92 1-1.64v-2.3c0-.7-.41-1.31-1-1.62"},"0"),r.jsx("circle",{cx:"9",cy:"13",r:"1"},"1"),r.jsx("circle",{cx:"15",cy:"13",r:"1"},"2"),r.jsx("path",{d:"M18 11.03C17.52 8.18 15.04 6 12.05 6c-3.03 0-6.29 2.51-6.03 6.45 2.47-1.01 4.33-3.21 4.86-5.89 1.31 2.63 4 4.44 7.12 4.47"},"3")]),jz=ze(r.jsx("path",{d:"M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61M13 14h-2V8h2z"})),Cz=ze(r.jsx("path",{d:"m16 18 2.29-2.29-4.88-4.88-4 4L2 7.41 3.41 6l6 6 4-4 6.3 6.29L22 12v6z"})),sm=ze(r.jsx("path",{d:"m16 6 2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"})),h8=ze(r.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5zM8 15.01l1.41 1.41L11 14.84V19h2v-4.16l1.59 1.59L16 15.01 12.01 11z"})),zb=ze(r.jsx("path",{d:"m23 12-2.44-2.79.34-3.69-3.61-.82-1.89-3.2L12 2.96 8.6 1.5 6.71 4.69 3.1 5.5l.34 3.7L1 12l2.44 2.79-.34 3.7 3.61.82L8.6 22.5l3.4-1.47 3.4 1.46 1.89-3.19 3.61-.82-.34-3.69zm-12.91 4.72-3.8-3.81 1.48-1.48 2.32 2.33 5.85-5.87 1.48 1.48z"})),Lte=ze(r.jsx("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-2 16-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z"})),p8=ze(r.jsx("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm7 10c0 4.52-2.98 8.69-7 9.93-4.02-1.24-7-5.41-7-9.93V6.3l7-3.11 7 3.11zm-11.59.59L6 13l4 4 8-8-1.41-1.42L10 14.17z"})),Pte=ze(r.jsx("path",{d:"m11.19 1.36-7 3.11C3.47 4.79 3 5.51 3 6.3V11c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V6.3c0-.79-.47-1.51-1.19-1.83l-7-3.11c-.51-.23-1.11-.23-1.62 0m-1.9 14.93L6.7 13.7a.996.996 0 0 1 0-1.41c.39-.39 1.02-.39 1.41 0L10 14.17l5.88-5.88c.39-.39 1.02-.39 1.41 0s.39 1.02 0 1.41l-6.59 6.59c-.38.39-1.02.39-1.41 0"})),Dte=ze(r.jsx("path",{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-8 12.5v-9l6 4.5z"})),Bi=ze(r.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"})),xg=ze(r.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"})),g8=ze(r.jsx("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5C4.83 8.13 8.21 6 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4m0 5c1.38 0 2.5 1.12 2.5 2.5S13.38 14 12 14s-2.5-1.12-2.5-2.5S10.62 9 12 9m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7"})),Ote=ze(r.jsx("path",{d:"M12 4C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4m0 12.5c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"})),wz=ze(r.jsx("path",{d:"M3 9v6h4l5 5V4L7 9zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77"})),Pc="/assets/GGH_logo-DdZ7wJ9E.png",om=()=>{const e=[{label:"Courses",to:"/explore"},{label:"About Us",to:"/about-us"},{label:"Partners",to:"/partners"}],{mode:t,toggleThemeMode:n,isDark:s}=Fl();On();const[o,a]=v.useState(!1),{isAuthenticated:l}=ps(),u=()=>{a(!o)},d=r.jsxs(E,{sx:{width:280,height:"100%",bgcolor:s?"#111827":"#FFFFFF",color:s?"#FFFFFF":"#1E293B"},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{p:2,borderBottom:`1px solid ${s?"#282E39":"#E2E8F0"}`},children:[r.jsxs(E,{component:yn,to:"/",onClick:u,sx:{display:"flex",alignItems:"center",gap:1.5,textDecoration:"none",color:s?"#FFFFFF":"#1E293B",fontWeight:700,fontSize:"1rem"},children:[r.jsx(E,{component:"img",src:Pc,alt:"Integritas Hub Logo",sx:{height:32,width:"auto"}}),r.jsx("span",{children:"Integritas Hub"})]}),r.jsx(Ve,{onClick:u,sx:{color:s?"#9CA3AF":"#64748B"},children:r.jsx(hs,{})})]}),r.jsx(Hs,{sx:{py:2},children:e.map(f=>r.jsx(Ii,{disablePadding:!0,children:r.jsx(Jo,{component:yn,to:f.to,onClick:u,sx:{py:1.5,px:3,"&:hover":{bgcolor:s?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.03)"}},children:r.jsx(Js,{primary:f.label,primaryTypographyProps:{fontWeight:500,color:s?"#9CA3AF":"#64748B"}})})},f.label))}),r.jsx(Ir,{sx:{borderColor:s?"#282E39":"#E2E8F0"}}),r.jsxs(G,{spacing:2,sx:{p:3},children:[r.jsx(ye,{component:yn,to:"/login",onClick:u,fullWidth:!0,sx:{bgcolor:s?"#282E39":"#F1F5F9","&:hover":{bgcolor:s?"#374151":"#E2E8F0"},textTransform:"none",fontWeight:600,color:s?"#FFFFFF":"#1E293B",borderRadius:"10px",py:1.5},children:"Login"}),r.jsx(ye,{component:yn,to:"/signup",onClick:u,variant:"contained",fullWidth:!0,sx:{bgcolor:"rgba(17, 82, 212, 1)","&:hover":{bgcolor:"rgba(13, 65, 170, 1)"},textTransform:"none",fontWeight:600,borderRadius:"10px",color:"#FFFFFF",py:1.5},children:"Sign Up"}),!l&&r.jsx(ye,{component:yn,to:"/login",variant:"contained",sx:{bgcolor:"rgba(17, 82, 212, 1)",textTransform:"none",fontWeight:600,borderRadius:1,px:3},children:"Log in"})]}),r.jsx(E,{sx:{px:3,mt:2},children:r.jsx(ye,{onClick:()=>{n()},startIcon:s?r.jsx(Mf,{}):r.jsx(Tf,{}),fullWidth:!0,sx:{color:s?"#9CA3AF":"#64748B",textTransform:"none",justifyContent:"flex-start","&:hover":{bgcolor:s?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.03)"}},children:s?"Light Mode":"Dark Mode"})})]});return r.jsxs(r.Fragment,{children:[r.jsx(E,{component:"header",sx:{bgcolor:s?"#111318D9":"rgba(255, 255, 255, 0.95)",borderBottom:`1px solid ${s?"#282E39":"#E2E8F0"}`,position:"sticky",top:0,zIndex:100,backdropFilter:"blur(10px)"},children:r.jsx(E,{sx:{px:{xs:2,md:4,lg:6}},children:r.jsxs(G,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{py:2},children:[r.jsxs(E,{component:yn,to:"/",sx:{display:"flex",alignItems:"center",gap:1.5,textDecoration:"none",color:s?"#FFFFFF":"#1E293B",fontWeight:700,fontSize:"1.125rem"},children:[r.jsx(E,{component:"img",src:Pc,alt:"Integritas Hub Logo",sx:{height:36,width:"auto"}}),r.jsx(E,{component:"span",sx:{display:{xs:"none",sm:"inline"}},children:"Integritas Hub"})]}),r.jsxs(G,{direction:"row",spacing:4,alignItems:"center",sx:{display:{xs:"none",md:"flex"}},children:[r.jsx(G,{direction:"row",spacing:4,children:e.map(f=>r.jsx(E,{component:yn,to:f.to,sx:{color:s?"#9CA3AF":"#64748B",textDecoration:"none",fontWeight:500,fontSize:"0.9375rem","&:hover":{color:s?"#FFFFFF":"#1E293B"}},children:f.label},f.label))}),r.jsx(Ve,{onClick:n,sx:{color:s?"#9CA3AF":"#64748B","&:hover":{color:s?"#FFFFFF":"#1E293B",bgcolor:s?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.05)"}},children:s?r.jsx(Mf,{}):r.jsx(Tf,{})}),r.jsxs(G,{direction:"row",spacing:2,alignItems:"center",children:[r.jsx(ye,{component:yn,to:"/login",sx:{bgcolor:s?"#282E39":"#F1F5F9","&:hover":{bgcolor:s?"#374151":"#E2E8F0"},textTransform:"none",fontWeight:600,color:s?"#FFFFFF":"#1E293B",borderRadius:"10px"},children:"Login"}),r.jsx(ye,{component:yn,to:"/signup",variant:"contained",sx:{bgcolor:"rgba(17, 82, 212, 1)","&:hover":{bgcolor:"rgba(13, 65, 170, 1)",color:"#FFFFFF"},textTransform:"none",fontWeight:600,borderRadius:"10px",color:"#FFFFFF"},children:"Sign Up"})]})]}),r.jsxs(G,{direction:"row",spacing:1,alignItems:"center",sx:{display:{xs:"flex",md:"none"}},children:[r.jsx(Ve,{onClick:n,sx:{color:s?"#9CA3AF":"#64748B","&:hover":{color:s?"#FFFFFF":"#1E293B",bgcolor:s?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.05)"}},children:s?r.jsx(Mf,{}):r.jsx(Tf,{})}),r.jsx(Ve,{onClick:u,sx:{color:s?"#FFFFFF":"#1E293B"},children:r.jsx(tm,{})})]})]})})}),r.jsx(Ou,{anchor:"right",open:o,onClose:u,sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",border:"none"}},children:d})]})},Bte=e=>({bgDarker:e?"#080D19":"#F8FAFC",textWhite:e?"#FFFFFF":"#1E293B",textMuted:e?"#9CA3AF":"#64748B",textDark:e?"#6B7280":"#94A3B8",border:e?"#1F2937":"#E2E8F0",borderLight:e?"#374151":"#CBD5E1"}),im=()=>{const{isDark:e}=Fl(),t=Bte(e),n=["Privacy","Terms","Support"],s=new Date().getFullYear();return r.jsx(E,{component:"footer",sx:{bgcolor:t.bgDarker,py:4,px:{xs:2,md:4,lg:6}},children:r.jsx(E,{maxWidth:"lg",sx:{mx:"auto"},children:r.jsxs(G,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:"center",spacing:2,children:[r.jsxs(C,{sx:{fontSize:"0.875rem",color:t.textDark},children:["© ",s," Integritas Hub. All rights reserved."]}),r.jsx(G,{direction:"row",spacing:4,children:n.map(o=>r.jsx(E,{component:yn,to:`/${o.toLowerCase().replace(" ","-")}`,sx:{color:t.textDark,textDecoration:"none",fontSize:"0.875rem","&:hover":{color:t.textWhite}},children:o},o))})]})})})},af=e=>e?e.data?e.data:e:null,n5=e=>e?{data:e.data||[],meta:e.meta||{},links:e.links||{}}:{data:[],meta:{},links:{}},r5=e=>e?e.data||e.id?af(e):{success:!0}:{success:!0},ia={getCourseAccess:async e=>{const t=await ke.get(`/lms/courses/${e}/access`);return t?.data?t.data:t},enrollInCourse:async e=>{const t=await ke.post(`/lms/courses/${e}/enroll`);return af(t)},enrollInEssentialCourse:async e=>{const t=await ke.post("/lms/essential/enroll",{course_id:e});return af(t)},getEnrollments:async({user_id:e,course_id:t,status:n,per_page:s=20,page:o}={})=>{const a=new URLSearchParams;e&&a.append("user_id",e),t&&a.append("course_id",t),n&&a.append("status",n),s&&a.append("per_page",s),o&&a.append("page",o);const l=a.toString(),u=await ke.get(`/lms/enrollments${l?`?${l}`:""}`);return n5(u)},verifyPayment:async({trxref:e,reference:t})=>{const n=await ke.get(`/payments/verify?trxref=${e}&reference=${t}`);return n?.data?n.data:n},verifyPaymentStatus:async e=>{const t=await ke.get(`/payments/verify-status?reference=${encodeURIComponent(e)}`);return t?.data?t.data:t},getMyEnrolledCourses:async({per_page:e=50,page:t}={})=>{const n=new URLSearchParams;e&&n.append("per_page",e),t&&n.append("page",t);const s=n.toString(),o=await ke.get(`/lms/my/courses/enrolled${s?`?${s}`:""}`);return n5(o)},getMyEnrollments:async({page:e,per_page:t=20,status:n}={})=>{const s=new URLSearchParams;e&&s.append("page",e),t&&s.append("per_page",t),n&&s.append("status",n);const o=s.toString(),a=o?`/lms/enrollments?${o}`:"/lms/enrollments",l=await ke.get(a);return n5(l)},unenrollFromCourse:async e=>({success:!0,...await ke.post(`/lms/courses/${e}/unenroll`)}),getEnrollmentStatus:async e=>{const t=await ke.get(`/lms/courses/${e}/enrollment-status`);return af(t)},completeLesson:async e=>{const t=await ke.post(`/lms/lessons/${e}/complete`);return r5(t)},completeModule:async e=>{const t=await ke.post(`/lms/modules/${e}/complete`);return r5(t)},completeCourse:async e=>{const t=await ke.post(`/lms/courses/${e}/complete`);return r5(t)},requestCertificate:async e=>{const t=await ke.post(`/lms/courses/${e}/certificate`);return af(t)},getCompletionStatus:async e=>{const t=await ke.get(`/lms/courses/${e}/completion-status`);return af(t)}},Cr=e=>e?e.data&&!Array.isArray(e.data)?e.data:e:null,ka=(e,t=[])=>{if(!e)return{data:[],meta:{},links:{}};if(Array.isArray(e))return{data:e,meta:{},links:{}};if(Array.isArray(e.data))return{data:e.data,meta:e.meta||{},links:e.links||{}};if(e.data&&Array.isArray(e.data.data))return{data:e.data.data,meta:{current_page:e.data.current_page,from:e.data.from,last_page:e.data.last_page,path:e.data.path,per_page:e.data.per_page,to:e.data.to,total:e.data.total,links:e.data.links||[]},links:{first:e.data.first_page_url,last:e.data.last_page_url,prev:e.data.prev_page_url,next:e.data.next_page_url}};for(const n of t)if(Array.isArray(e[n]))return{data:e[n],meta:e.meta||{},links:e.links||{}};return{data:[],meta:e.meta||{},links:e.links||{}}},m8=(e,t,n)=>{n==null||n===""||e.append(t,n)},Nte=["email","user_email","invited_email"],$te=["token","invite_token","invitation_token","accept_token"],x8=(e,t=[])=>{for(const n of t){const s=e?.[n];if(s==null)continue;const o=String(s).trim();if(o)return o}return""},Hte=e=>{const t=[],n=[e],s=new Set;for(;n.length>0;){const a=n.shift();if(!a||typeof a!="object"||s.has(a))continue;if(s.add(a),Array.isArray(a)){a.forEach(g=>n.push(g));continue}const l=x8(a,Nte),u=x8(a,$te),d=a?.id??a?.invitation_id??null,f=a?.role??a?.invited_role??null,p=a?.status??null;(l||u||d)&&t.push({email:l||null,token:u||null,invitation_id:d,role:f,status:p}),Object.values(a).forEach(g=>{g&&typeof g=="object"&&n.push(g)})}const o=new Map;return t.forEach(a=>{const l=`${a.email||""}::${a.token||""}::${a.invitation_id||""}`;o.has(l)||o.set(l,a)}),Array.from(o.values())},Wte=e=>{const t=String(e||"").trim();if(!t)return"";const n=encodeURIComponent(t);return typeof window<"u"&&window.location?.origin?`${window.location.origin}/accept-invite?token=${n}`:`/accept-invite?token=${n}`},b8=(e,t)=>{try{const n=Hte(e);if(console.groupCollapsed("[Learner Org Invite] Invite response debug"),console.log("requestPayload:",t),console.log("rawResponse:",e),!n.length){console.warn("No invitation token or invited user info was found in this response."),console.groupEnd();return}const s=n.map(o=>({invited_email:o.email,token:o.token,invitation_id:o.invitation_id,role:o.role,status:o.status,accept_link:Wte(o.token)}));console.table(s),console.groupEnd()}catch(n){console.warn("[Learner Org Invite] Failed to log invite debug info:",n)}},ml=(e={})=>{const t=new URLSearchParams;Object.entries(e).forEach(([s,o])=>{o==null||o===""||t.append(s,o)});const n=t.toString();return n?`?${n}`:""},Kd=()=>({data:[],meta:{},links:{}}),Az=e=>[401,403,404,405].includes(e?.status),Ute=["owned_organizations","ownedOrganizations","owned"],qte=["membered_organizations","member_organizations","memberOrganizations","membered","memberships","member_of","memberOf","member_of_organizations","memberOfOrganizations"],Vte=["organizations"],Gte=e=>{const t=String(e||"").trim().toLowerCase();return t?t==="org_owner"||t==="organization_owner"?"owner":t==="org_admin"||t==="organization_admin"?"admin":t==="org_manager"||t==="organization_manager"?"manager":t==="org_staff"||t==="organization_staff"?"staff":t:""},Yte=(e={},t="")=>{const n=e?.organization&&typeof e.organization=="object"?e.organization:e,s=e?.pivot||n?.pivot||null,o=String(n?.id||n?.organization_id||n?.org_id||e?.organization_id||"").trim();if(!o)return null;const a=Gte(s?.role||e?.membership_role||n?.membership_role||e?.organization_role||n?.organization_role||e?.role||n?.role),l=t==="owned"||a==="owner",u=l?"owner":a;return{...n,id:o,pivot:s,membership_role:u,membership_source:t||(l?"owned":"membered"),is_owner:l,can_delete:l,can_manage:["owner","admin","manager"].includes(u)}},Kte=e=>{const t=[],n=(s,o="")=>{Array.isArray(s)&&s.forEach(a=>{const l=Yte(a,o);l&&t.push(l)})};return n(Array.isArray(e)?e:[],""),n(Array.isArray(e?.data)?e.data:[],""),Ute.forEach(s=>{n(e?.[s],"owned"),n(e?.data?.[s],"owned")}),qte.forEach(s=>{n(e?.[s],"membered"),n(e?.data?.[s],"membered")}),Vte.forEach(s=>{n(e?.[s],""),n(e?.data?.[s],"")}),t},Xte=(e=[])=>{const t=new Map;return e.forEach(n=>{const s=String(n?.id||"").trim();if(!s)return;const o=t.get(s)||{},a=!!(o.is_owner||n.is_owner),l=a?"owner":n.membership_role||o.membership_role||"";t.set(s,{...o,...n,id:s,membership_role:l,membership_source:n.membership_source||o.membership_source||"",is_owner:a,can_delete:!!(o.can_delete||n.can_delete||a),can_manage:!!(o.can_manage||n.can_manage||["owner","admin","manager"].includes(l))})}),Array.from(t.values())},Zte=(e={})=>{const t=e?.user&&typeof e.user=="object"?e.user:e?.member&&typeof e.member=="object"?e.member:null,n=t?{...e,...t,pivot:e?.pivot||t?.pivot||null}:e,s=String(n?.id||n?.user_id||n?.member_id||n?.pivot?.user_id||"").trim();return s?{...n,id:s,name:String(n?.name||"").trim(),email:String(n?.email||"").trim(),role:String(n?.pivot?.role||n?.role||"").trim(),status:String(n?.pivot?.status||n?.status||"").trim(),joined_at:n?.pivot?.joined_at||n?.joined_at||null}:null},y8=async(e=[])=>{for(const t of e)try{return await ke.get(t)}catch(n){if(!Az(n))throw n}return null},Un={createOrganizationJson:async e=>{const t=await ke.post("/orgs",e);return Cr(t)},createOrganizationMultipart:async(e={})=>{const t=new FormData;m8(t,"name",e.name),m8(t,"email_domain",e.email_domain),e.logo instanceof File&&t.append("logo",e.logo);const n=await ke.post("/orgs",t);return Cr(n)},inviteOrganizationMembers:async(e,t)=>{const n=await ke.post(`/orgs/${e}/invitations`,t),s=Cr(n);return b8(s,t),s},batchInviteStaff:async(e,t)=>{const n=await ke.post(`/orgs/${e}/invitations`,t),s=Cr(n);return b8(s,t),s},listUserOrganizations:async()=>{try{const e=await ke.get("/orgs/user/organizations"),t=Xte(Kte(e));return{data:t,meta:{total:t.length},links:{}}}catch(e){if(Az(e))return Kd();throw e}},acceptInvitationPublic:async e=>{const t=await ke.post("/org-invitations/public/accept",e);return Cr(t)},acceptInvitationLoggedIn:async e=>{const t=await ke.post("/org-invitations/public/accept",e);return Cr(t)},acceptOrganizationInvitationPublic:async e=>{const t=await ke.post("/org-invitations/public/accept",e);return Cr(t)},acceptOrganizationInvitationLoggedIn:async e=>{const t=await ke.post("/org-invitations/public/accept",e);return Cr(t)},resendSingleInvitation:async(e,t)=>{const n=await ke.post(`/orgs/${e}/invitations/resend`,t);return Cr(n)},resendBulkInvitations:async(e,t)=>{const n=await ke.post(`/orgs/${e}/invitations/resend-bulk`,t);return Cr(n)},listInvitations:async(e,{status:t,role:n,q:s,per_page:o=20,page:a}={})=>{const l=ml({status:t,role:n,q:s,per_page:o,page:a}),u=await ke.get(`/orgs/${e}/invitations${l}`);return ka(u)},listOrganizationInvitations:async(e,t={})=>{const n=ml({status:t.status,role:t.role,q:t.q,per_page:t.per_page??20,page:t.page}),s=await ke.get(`/orgs/${e}/invitations${n}`);return ka(s)},revokeSingleInvitation:async(e,t,n={})=>{const s=await ke.post(`/orgs/${e}/invitations/${t}/revoke`,n);return Cr(s)},revokeOrganizationInvitation:async(e,t,n={})=>{const s=await ke.post(`/orgs/${e}/invitations/${t}/revoke`,n);return Cr(s)},revokeBulkInvitations:async(e,t)=>{const n=await ke.post(`/orgs/${e}/invitations/revoke-bulk`,t);return Cr(n)},revokeOrganizationInvitationsBulk:async(e,t)=>{const n=await ke.post(`/orgs/${e}/invitations/revoke-bulk`,t);return Cr(n)},listLearningPaths:async(e,{status:t,q:n,per_page:s=20,page:o}={})=>{const a=ml({status:t,q:n,per_page:s,page:o}),l=await ke.get(`/learning-path/${e}/learning-paths${a}`);return ka(l)},createLearningPath:async(e,t)=>{const n=await ke.post(`/orgs/${e}/learning-paths`,t);return Cr(n)},getLearningPathById:async(e,t,{with_items:n=1}={})=>{const s=ml({with_items:n}),o=await ke.get(`/orgs/${e}/learning-paths/${t}${s}`);return Cr(o)},updateLearningPath:async(e,t,n)=>{const s=await ke.patch(`/orgs/${e}/learning-paths/${t}`,n);return Cr(s)},publishLearningPath:async(e,t)=>{const n=await ke.post(`/orgs/${e}/learning-paths/${t}/publish`);return Cr(n)},archiveLearningPath:async(e,t)=>{const n=await ke.post(`/orgs/${e}/learning-paths/${t}/archive`);return Cr(n)},deleteLearningPath:async(e,t)=>{const n=await ke.delete(`/orgs/${e}/learning-paths/${t}`);return Cr(n)},listLearningPathItems:async(e,t)=>{const n=await ke.get(`/orgs/${e}/learning-paths/${t}/items`);return ka(n,["items"])},addCourseToLearningPath:async(e,t,n)=>{const s=await ke.post(`/orgs/${e}/learning-paths/${t}/items`,n);return Cr(s)},removeLearningPathItem:async(e,t,n)=>{const s=await ke.delete(`/orgs/${e}/learning-paths/${t}/items/${n}`);return Cr(s)},reorderLearningPathItems:async(e,t,n)=>{const s=await ke.post(`/orgs/${e}/learning-paths/${t}/items/reorder`,n);return Cr(s)},assignToUsers:async(e,t)=>{const n=await ke.post(`/orgs/${e}/assignments`,t);return Cr(n)},listAssignments:async(e,{type:t,status:n,per_page:s=20,page:o}={})=>{const a=ml({type:t,status:n,per_page:s,page:o}),l=await ke.get(`/orgs/${e}/assignments${a}`);return ka(l)},revokeAssignment:async(e,t)=>{try{const n=await ke.post(`/orgs/${e}/assignments/${t}/revoke`);return Cr(n)}catch(n){if(n?.status===404||n?.status===405){const s=await ke.get(`/orgs/${e}/assignments/${t}/revoke`);return Cr(s)}throw n}},listMyAssignments:async({status:e,type:t,per_page:n=20,page:s,org_id:o,organization_id:a}={})=>{const l=ml({status:e,type:t,per_page:n,page:s}),u=String(a||o||"").trim();if(u)try{const d=await ke.get(`/orgs/${u}/assignments${l}`);return ka(d)}catch(d){if(d?.status!==404&&d?.status!==405)throw d;return Kd()}try{const d=await ke.get(`/learning-path/my/assignments${l}`);return ka(d)}catch(d){if(d?.status!==404&&d?.status!==405)throw d;return Kd()}},getProgressReport:async(e,{course_id:t,user_id:n,per_page:s=20,page:o}={})=>{const a=ml({course_id:t,user_id:n,per_page:s,page:o}),l=await ke.get(`/orgs/${e}/reports/progress${a}`);return ka(l)},listOrganizationMembers:async(e,{q:t,per_page:n=100,page:s}={})=>{const o=String(e||"").trim();if(!o)return Kd();const a=ml({q:t,per_page:n,page:s}),l=await y8([`/orgs/organizations/${o}/members${a}`,`/orgs/${o}/members${a}`]);if(!l)return Kd();const u=ka(l,["members","users"]),d=String(t||"").trim().toLowerCase();let f=(u.data||[]).map(g=>Zte(g)).filter(Boolean);d&&(f=f.filter(g=>{const x=String(g?.id||"").toLowerCase(),b=String(g?.name||"").toLowerCase(),y=String(g?.email||"").toLowerCase();return x.includes(d)||b.includes(d)||y.includes(d)}));const p=Number(l?.total_members||l?.data?.total_members||u?.meta?.total||f.length);return{data:f,meta:{...u.meta,total:p,current_page:Number(s)||u?.meta?.current_page||1,per_page:Number(n)||u?.meta?.per_page||f.length||0,organization_name:l?.organization_name||l?.data?.organization_name||""},links:u.links||{}}},listUsers:async({q:e,per_page:t=100,page:n,org_id:s,organization_id:o}={})=>{const a=String(o||s||"").trim();return a?Un.listOrganizationMembers(a,{q:e,per_page:t,page:n}):Kd()},listCourses:async({q:e,per_page:t=100,page:n}={})=>{const s=ml({q:e,per_page:t,page:n}),o=await y8([`/public/courses${s}`,`/lms/courses${s}`,`/courses${s}`]);return ka(o,["courses"])},getInvitationByEmail:async(e,t)=>((await Un.listInvitations(e,{q:t,per_page:20})).data||[]).find(o=>String(o?.email||"").toLowerCase()===String(t||"").toLowerCase())||null},Fs=e=>String(e??"").trim(),s5=(e,t=0)=>{const n=Number(e);return Number.isFinite(n)?n:t},Qte=e=>{const t=Fs(e).toLowerCase();return t?t==="beginner"?"Beginner":t==="intermediate"?"Intermediate":t==="advanced"?"Advanced":t==="expert"?"Expert":t.charAt(0).toUpperCase()+t.slice(1):"Unspecified"},Jte=e=>{if(!e&&e!==0)return"TBD";if(typeof e=="number"){const n=Math.max(0,Math.round(e)),s=Math.floor(n/60),o=n%60;return s===0?`${o}m`:`${s}h ${o.toString().padStart(2,"0")}m`}const t=Fs(e);return t||"TBD"},v8=e=>e?Array.isArray(e)?{data:e,meta:{},links:{}}:Array.isArray(e.data)?{data:e.data,meta:e.meta||{},links:e.links||{}}:e.data&&Array.isArray(e.data.data)?{data:e.data.data,meta:{current_page:e.data.current_page,from:e.data.from,last_page:e.data.last_page,path:e.data.path,per_page:e.data.per_page,to:e.data.to,total:e.data.total,links:e.data.links||[]},links:{first:e.data.first_page_url,last:e.data.last_page_url,prev:e.data.prev_page_url,next:e.data.next_page_url}}:Array.isArray(e.courses)?{data:e.courses,meta:e.meta||{},links:e.links||{}}:Array.isArray(e.results)?{data:e.results,meta:e.meta||{},links:e.links||{}}:{data:[],meta:e.meta||{},links:e.links||{}}:{data:[],meta:{},links:{}},ene=(e={})=>{const t=Array.isArray(e.categories)?e.categories.map(o=>Fs(o?.name||o?.title||o?.slug||o)).filter(Boolean):[],n=[e.category_name,e.category,e.topic].map(o=>Fs(o?.name||o?.title||o?.slug||o)).filter(Boolean),s=new Set([...t,...n]);return Array.from(s)},o5=(e={})=>{const t=Fs(e.id||e.course_id||e.slug||e.uuid),n=ene(e),s=s5(e.rating?.average??e.average_rating??e.avg_rating??e.rating),o=s5(e.rating?.count??e.review_count??e.reviews_count??e.ratings_count),a=Fs(e.tutor?.name||e.user?.name||e.creator?.name||e.created_by?.name||e.tutor?.user?.name||e.user?.full_name||e.creator?.full_name||e.created_by?.full_name||e.tutors?.[0]?.name||e.tutors?.[0]?.user?.name||e.instructor?.name||e.author?.name||e.organization?.name||e.org?.name)||"Integritas Hub",l=Fs(e.short_description)||Fs(e.summary)||Fs(e.description)||"No description available yet.",u=Qte(e.level||e.difficulty||e.difficulty_level),d=Ru(e.thumbnail_url||e.thumbnail||e.cover_image_url||e.cover_image||e.image_url||e.image);return{id:t,raw:e,slug:Fs(e.slug),title:Fs(e.title||e.name||"Untitled Course"),description:l,instructor:a,type:e.organization||e.org||e.organization_id?"institution":"individual",level:u,rating:s,reviews:o,duration:Jte(e.duration_text||e.duration||e.total_duration||e.duration_minutes),image:d,topics:n,topic:n[0]||"",trailerUrl:Ru(e.trailer_url||e.preview_video_url||e.intro_video_url),createdAt:e.created_at||e.createdAt||null,price:s5(e.price,0)}},i5=(e={})=>{const t=new URLSearchParams;Object.entries(e).forEach(([s,o])=>{o==null||o===""||t.append(s,String(o))});const n=t.toString();return n?`?${n}`:""},tne=e=>{const t=Fs(e).toLowerCase();if(t)return t==="newest"?"newest":t==="highest_rated"||t==="highest rated"?"highest_rated":t==="price_asc"||t.includes("low")?"price_asc":t==="price_desc"||t.includes("high")?"price_desc":"popular"},nne=(e,t)=>{const n=Fs(t).toLowerCase();return n?[...e.topics||[],e.topic,e.raw?.category_name,e.raw?.category?.name,e.raw?.category?.slug,...Array.isArray(e.raw?.categories)?e.raw.categories.flatMap(o=>[o?.name,o?.slug,o?.title]):[]].map(o=>Fs(o).toLowerCase()).filter(Boolean).includes(n):!0},rne=(e=[],t)=>{const n=tne(t),s=[...e];return n==="newest"?s.sort((o,a)=>new Date(a.createdAt||0).getTime()-new Date(o.createdAt||0).getTime()):n==="highest_rated"?s.sort((o,a)=>{const l=Number(a.rating||0)-Number(o.rating||0);return l!==0?l:Number(a.reviews||0)-Number(o.reviews||0)}):n==="price_asc"?s.sort((o,a)=>Number(o.price||0)-Number(a.price||0)):n==="price_desc"?s.sort((o,a)=>Number(a.price||0)-Number(o.price||0)):s},Wa={listCourses:async({q:e,category:t,level:n,sort:s="popular",status:o,language:a,page:l,per_page:u=30}={})=>{const d=i5({q:e,status:o,level:n,language:a,page:l,per_page:u,with_categories:1,with_audit:1}),f=await ke.get(`/lms/courses${d}`),p=v8(f),g=(p.data||[]).map(x=>o5(x)).filter(x=>x.id).filter(x=>nne(x,t));return{data:rne(g,s),meta:p.meta||{},links:p.links||{}}},getCourseById:async e=>{const t=encodeURIComponent(Fs(e)),n=i5({with_categories:1,with_audit:1});let s;try{s=await ke.get(`/lms/courses/${t}${n}`)}catch(a){if(a?.status===404){const l=new Error("Course not found");throw l.status=404,l}throw a}const o=s.data?s.data:s;return{...o,...o5(o),raw_data:o}},getLessonById:async e=>{const t=await ke.get(`/lms/lessons/${encodeURIComponent(Fs(e))}`);return t?.data?t.data:t},getFeaturedCourses:async({limit:e=1}={})=>Wa.listCourses({per_page:e,sort:"popular",status:"published"}),listEssentialCourses:async({per_page:e=20,page:t,status:n}={})=>{const s=i5({per_page:e,page:t,status:n}),o=await ke.get(`/lms/courses/essential${s}`),a=v8(o);return{data:(a.data||[]).map(l=>o5(l)).filter(l=>l.id),meta:a.meta||{},links:a.links||{}}},listCategories:async()=>{const e=await Wa.listCourses({per_page:100,status:"published"}),t=new Set;return e.data.forEach(n=>{(n.topics||[]).forEach(s=>{const o=Fs(s);o&&t.add(o)})}),{data:Array.from(t).map(n=>({id:n.toLowerCase().replace(/\s+/g,"-"),name:n,slug:n.toLowerCase().replace(/\s+/g,"-")})),meta:{},links:{}}}},sne=e=>({bgDark:e?"#0C1322":"#FFFFFF",bgDarker:e?"#080D19":"#F8FAFC",bgCard:e?"#111827":"#FFFFFF",primary:"rgba(17, 82, 212, 1)",primaryHover:"rgba(13, 65, 170, 1)",primaryLight:"rgba(17, 82, 212, 0.1)",textWhite:e?"#FFFFFF":"#1E293B",textLight:e?"#F3F4F6":"#334155",textMuted:e?"#9CA3AF":"#64748B",textDark:e?"#6B7280":"#94A3B8",border:e?"#1F2937":"#E2E8F0",borderLight:e?"#374151":"#CBD5E1",rating:"#FBBF24",heroGradient:e?"linear-gradient(135deg, rgba(40, 46, 57, 1) 0%, rgba(30, 35, 45, 1) 50%, rgba(20, 25, 35, 1) 100%)":"linear-gradient(135deg, #F8FAFC 0%, #EEF2FF 50%, #F0FDF4 100%)"}),one=()=>{const{isDark:e}=Fl(),t=sne(e),[n,s]=v.useState([]),[o,a]=v.useState(!0);v.useEffect(()=>{Wa.listEssentialCourses({per_page:3,status:"published"}).then(f=>s(f.data||[])).catch(()=>s([])).finally(()=>a(!1))},[]);const l=[{value:"15k+",label:"Active Learners"},{value:"45k+",label:"Courses Completed"},{value:"120+",label:"Partner Institutions"}],u=[{icon:r.jsx(hr,{sx:{fontSize:28,color:t.primary}}),title:"Expert-Led Curriculum",description:"Courses taught by top government officials and policy experts with real-world experience in public sector challenges."},{icon:r.jsx(zb,{sx:{fontSize:28,color:"#22D3EE"}}),title:"Certified Accreditation",description:"Earn certifications recognized by government bodies, enhancing your credibility and career advancement opportunities."},{icon:r.jsx(Mee,{sx:{fontSize:28,color:"#818CF8"}}),title:"Data-Driven Policy Tools",description:"Access cutting-edge tools for policy analysis, implementation monitoring, and data-driven decision making."}],d={quote:"The Integritas Hub has transformed how our department approaches policy making. The rigorous curriculum and practical tools are unmatched in the field of public service education.",name:"CEO Integritas Hub",title:"Senior Policy adviser",avatar:""};return r.jsxs(E,{sx:{minHeight:"100vh",bgcolor:t.bgDark,color:t.textWhite},children:[r.jsx(om,{}),r.jsx(E,{sx:{py:{xs:6,md:10},px:{xs:2,md:4,lg:6},background:t.heroGradient,position:"relative",overflow:"hidden"},children:r.jsxs(E,{sx:{display:"flex",flexDirection:{xs:"column",lg:"row"},alignItems:"center",justifyContent:"space-between",gap:{xs:4,lg:6}},children:[r.jsxs(E,{sx:{flex:"0 0 auto",maxWidth:{xs:"100%",lg:"45%"}},children:[r.jsxs(E,{sx:{bgcolor:"rgba(17, 82, 212, 0.15)",color:"rgba(17, 82, 212, 1)",px:2,py:.5,borderRadius:50,display:"inline-flex",alignItems:"center",gap:1,fontSize:"0.75rem",fontWeight:600,mb:3,textTransform:"uppercase",letterSpacing:"0.05em"},children:[r.jsx(E,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:"rgba(17, 82, 212, 1)"}}),"New Courses Available"]}),r.jsxs(C,{variant:"h1",sx:{fontSize:{xs:"2.5rem",md:"3.5rem"},fontWeight:800,lineHeight:1.1,mb:3,color:t.textWhite},children:["Empowering Public",r.jsx("br",{}),"Service Through",r.jsx("br",{}),r.jsx(E,{component:"span",sx:{color:"rgba(17, 82, 212, 1)"},children:"Excellence"})]}),r.jsx(C,{sx:{fontSize:"1.125rem",color:t.textMuted,lineHeight:1.7,mb:4,maxWidth:450},children:"The premier learning platform for policy professionals, government officials, and civic leaders. Master the skills needed for modern governance."}),r.jsxs(G,{direction:{xs:"column",sm:"row"},spacing:2,sx:{mb:4},children:[r.jsx(ye,{component:yn,to:"/explore",variant:"contained",size:"large",endIcon:r.jsx(Oi,{}),sx:{bgcolor:"rgba(17, 82, 212, 1)","&:hover":{bgcolor:"rgba(13, 65, 170, 1)",color:"#FFFFFF"},textTransform:"none",fontWeight:600,py:1.5,px:3,borderRadius:2},children:"Explore Courses"}),r.jsx(ye,{component:yn,to:"/demo",variant:"outlined",size:"large",sx:{borderColor:t.border,color:t.textWhite,bgcolor:"transparent","&:hover":{borderColor:"rgba(255, 255, 255, 0.5)",color:"#FFFFFF",bgcolor:"rgba(255, 255, 255, 0.1)"},textTransform:"none",fontWeight:600,py:1.5,px:3,borderRadius:2},children:"View Syllabus"})]}),r.jsx(C,{sx:{fontSize:"0.75rem",color:t.textDark,textTransform:"uppercase",letterSpacing:"0.1em",fontWeight:500},children:"Trusted by officials from"})]}),r.jsx(E,{sx:{flex:"0 0 auto",maxWidth:{xs:"100%",lg:"50%"},display:{xs:"none",lg:"block"}},children:r.jsx(E,{component:"img",src:"/src/assets/images/hero-screen.png",alt:"Integritas Hub Platform Dashboard",sx:{width:"100%",maxWidth:550,height:"auto",borderRadius:2}})})]})}),r.jsx(E,{sx:{bgcolor:t.bgDarker,borderTop:`1px solid ${t.border}`,borderBottom:`1px solid ${t.border}`,py:6,px:{xs:2,md:4,lg:6}},children:r.jsx(G,{direction:{xs:"column",md:"row"},spacing:{xs:5,md:0},justifyContent:"space-around",alignItems:"center",divider:r.jsx(Ir,{orientation:"vertical",flexItem:!0,sx:{bgcolor:t.border,display:{xs:"none",md:"block"}}}),children:l.map(f=>r.jsxs(E,{sx:{textAlign:"center",minWidth:150},children:[r.jsx(C,{sx:{fontSize:{xs:"2.5rem",md:"3rem"},fontWeight:700,color:t.textWhite,lineHeight:1.1},children:f.value}),r.jsx(C,{sx:{fontSize:"0.875rem",color:t.textMuted,mt:1.5,textTransform:"uppercase",letterSpacing:"0.05em"},children:f.label})]},f.label))})}),r.jsxs(E,{sx:{py:10,bgcolor:t.bgDark,px:{xs:2,md:4,lg:6}},children:[r.jsxs(E,{sx:{mb:5},children:[r.jsx(C,{variant:"h2",sx:{fontSize:{xs:"1.75rem",md:"2rem"},fontWeight:700,mb:1,color:t.textWhite},children:"Why Choose Integritas Hub?"}),r.jsx(C,{sx:{fontSize:"1.0625rem",color:t.textMuted,lineHeight:1.6},children:"Designed for the unique challenges of the public sector, our platform combines academic rigor with practical application."})]}),r.jsx(G,{direction:{xs:"column",md:"row"},spacing:3,sx:{width:"100%"},children:u.map(f=>r.jsx(E,{sx:{flex:1},children:r.jsx(ts,{sx:{bgcolor:t.bgCard,border:`1px solid ${t.border}`,borderRadius:3,height:"100%",transition:"all 0.3s","&:hover":{transform:"translateY(-4px)",borderColor:t.borderLight}},children:r.jsxs(ji,{sx:{p:4},children:[r.jsx(E,{sx:{width:48,height:48,bgcolor:t.primaryLight,borderRadius:2,display:"flex",alignItems:"center",justifyContent:"center",mb:2.5},children:f.icon}),r.jsx(C,{sx:{fontSize:"1.125rem",fontWeight:600,color:t.textWhite,mb:1.5},children:f.title}),r.jsx(C,{sx:{fontSize:"0.875rem",color:t.textMuted,lineHeight:1.7},children:f.description})]})})},f.title))})]}),r.jsxs(E,{sx:{bgcolor:t.bgDarker},children:[r.jsx(Ir,{sx:{borderColor:t.border}}),r.jsxs(E,{sx:{py:10,px:{xs:2,md:4,lg:6}},children:[r.jsxs(G,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},sx:{mb:5},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h2",sx:{fontSize:{xs:"1.75rem",md:"2rem"},fontWeight:700,mb:1,color:t.textWhite},children:"Essential Courses"}),r.jsx(C,{sx:{color:t.textMuted},children:"Core courses recommended for every public service professional."})]}),r.jsx(ye,{component:yn,to:"/explore",endIcon:r.jsx(Oi,{}),sx:{color:t.primary,textTransform:"none",fontWeight:600,mt:{xs:2,md:0},"&:hover":{bgcolor:"transparent"}},children:"View All Courses"})]}),o?r.jsx(G,{direction:{xs:"column",md:"row"},spacing:3,children:[1,2,3].map(f=>r.jsxs(E,{sx:{flex:1},children:[r.jsx(jn,{variant:"rounded",height:200,sx:{mb:1,bgcolor:t.border}}),r.jsx(jn,{variant:"text",height:28,sx:{bgcolor:t.border}}),r.jsx(jn,{variant:"text",height:20,sx:{bgcolor:t.border}}),r.jsx(jn,{variant:"text",width:"60%",height:20,sx:{bgcolor:t.border}})]},f))}):n.length===0?r.jsx(C,{sx:{color:t.textMuted,textAlign:"center",py:4},children:"No essential courses available at this time."}):r.jsx(G,{direction:{xs:"column",md:"row"},spacing:3,sx:{width:"100%"},children:n.map(f=>r.jsx(E,{sx:{flex:1},children:r.jsxs(ts,{component:yn,to:`/explore/course/${f.id}`,sx:{bgcolor:t.bgCard,border:`1px solid ${t.border}`,borderRadius:3,overflow:"hidden",height:"100%",textDecoration:"none",display:"flex",flexDirection:"column",transition:"all 0.3s","&:hover":{transform:"translateY(-4px)",borderColor:t.borderLight}},children:[r.jsxs(E,{sx:{position:"relative"},children:[f.image?r.jsx(DR,{component:"img",height:"200",image:f.image,alt:f.title}):r.jsx(E,{sx:{height:200,bgcolor:t.primaryLight,display:"flex",alignItems:"center",justifyContent:"center"},children:r.jsx(hr,{sx:{fontSize:64,color:t.primary,opacity:.5}})}),f.duration&&f.duration!=="TBD"&&r.jsx(E,{sx:{position:"absolute",top:16,right:16,bgcolor:"rgba(0,0,0,0.6)",color:"#FFFFFF",px:1.5,py:.5,borderRadius:1,fontSize:"0.75rem",fontWeight:500},children:f.duration})]}),r.jsxs(ji,{sx:{p:3,flex:1,display:"flex",flexDirection:"column"},children:[f.topic&&r.jsxs(G,{direction:"row",alignItems:"center",spacing:.75,sx:{mb:2},children:[r.jsx(hr,{sx:{fontSize:14,color:"#F97316"}}),r.jsx(C,{sx:{fontSize:"0.75rem",fontWeight:600,color:"#F97316",textTransform:"uppercase",letterSpacing:"0.05em"},children:f.topic})]}),r.jsx(C,{sx:{fontSize:"1.125rem",fontWeight:600,color:t.textWhite,mb:1.5},children:f.title}),r.jsx(C,{sx:{fontSize:"0.875rem",color:t.textMuted,lineHeight:1.6,mb:3,minHeight:60,flex:1},children:f.description}),r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[r.jsxs(G,{direction:"row",spacing:1.5,alignItems:"center",children:[r.jsx(yr,{sx:{width:32,height:32,bgcolor:t.primary,fontSize:"0.75rem"},children:f.instructor?f.instructor.split(" ").map(p=>p[0]).join(""):"IH"}),r.jsx(C,{sx:{fontSize:"0.875rem",color:t.textMuted},children:f.instructor||"Integritas Hub"})]}),f.price>0&&r.jsxs(C,{sx:{fontSize:"1.125rem",fontWeight:700,color:t.textWhite},children:["$",f.price]})]})]})]})},f.id))})]})]}),r.jsx(E,{sx:{py:10},children:r.jsx(Zs,{maxWidth:"md",children:r.jsxs(E,{sx:{textAlign:"center"},children:[r.jsx(tte,{sx:{fontSize:"3rem",color:t.primary,mb:3}}),r.jsxs(C,{sx:{fontSize:"1.375rem",color:t.textLight,lineHeight:1.7,fontStyle:"italic",mb:4},children:['"',d.quote,'"']}),r.jsxs(G,{direction:"column",alignItems:"center",spacing:1.5,children:[r.jsx(yr,{src:d.avatar,alt:d.name,sx:{width:56,height:56}}),r.jsxs(E,{children:[r.jsx(C,{sx:{fontWeight:600,color:t.textWhite},children:d.name}),r.jsx(C,{sx:{fontSize:"0.875rem",color:t.textMuted},children:d.title})]})]})]})})}),r.jsx(E,{sx:{py:10,px:{xs:2,md:4,lg:6},bgcolor:"#1152D4"},children:r.jsx(Zs,{maxWidth:"md",children:r.jsxs(E,{sx:{textAlign:"center"},children:[r.jsx(C,{variant:"h2",sx:{fontSize:{xs:"1.75rem",md:"2.25rem"},fontWeight:700,mb:2,color:"#FFFFFF"},children:"Ready to Elevate Your Public Service Career?"}),r.jsx(C,{sx:{fontSize:"1.125rem",color:"rgba(255,255,255,0.9)",mb:4},children:"Join thousands of governance professionals accessing world-class education today."}),r.jsxs(G,{direction:{xs:"column",sm:"row"},spacing:2,justifyContent:"center",sx:{mb:3},children:[r.jsx(ye,{component:yn,to:"/signup",variant:"contained",size:"large",sx:{bgcolor:"#FFFFFF",color:"#1152D4","&:hover":{bgcolor:"#E8EFFC",color:"#0D3FA8"},textTransform:"none",fontWeight:600,py:1.5,px:4,borderRadius:2},children:"Get Started Now"}),r.jsx(ye,{component:yn,to:"/contact",variant:"outlined",size:"large",sx:{borderColor:"rgba(255,255,255,0.5)",color:"#FFFFFF","&:hover":{borderColor:"#FFFFFF",bgcolor:"rgba(255,255,255,0.15)",color:"#FFFFFF"},textTransform:"none",fontWeight:600,py:1.5,px:4,borderRadius:2},children:"Contact Sales"})]}),r.jsx(C,{sx:{fontSize:"0.875rem",color:"rgba(255,255,255,0.7)"},children:"free account with government employess with .gov email"})]})})}),r.jsx(im,{})]})},ine=e=>({bgDark:e?"#0C1322":"#FFFFFF",bgDarker:e?"#080D19":"#F8FAFC",bgCard:e?"#111827":"#FFFFFF",primary:"rgba(17, 82, 212, 1)",primaryHover:"rgba(13, 65, 170, 1)",primaryLight:"rgba(17, 82, 212, 0.1)",textWhite:e?"#FFFFFF":"#1E293B",textLight:e?"#F3F4F6":"#334155",textMuted:e?"#9CA3AF":"#64748B",textDark:e?"#6B7280":"#94A3B8",border:e?"#1F2937":"#E2E8F0",borderLight:e?"#374151":"#CBD5E1",heroGradient:e?"linear-gradient(135deg, rgba(40, 46, 57, 1) 0%, rgba(30, 35, 45, 1) 50%, rgba(20, 25, 35, 1) 100%)":"linear-gradient(135deg, #F8FAFC 0%, #EEF2FF 50%, #F0FDF4 100%)"}),ane=[{value:"15k+",label:"Active Learners"},{value:"120+",label:"Partner Institutions"},{value:"45k+",label:"Courses Completed"},{value:"98%",label:"Satisfaction Rate"}],lne=[{icon:r.jsx(ute,{sx:{fontSize:28}}),color:"#FBBF24",bgColor:"rgba(251, 191, 36, 0.1)",title:"Innovation",description:"We continuously evolve our curriculum and platform to reflect the latest developments in governance, policy, and public sector leadership."},{icon:r.jsx(zb,{sx:{fontSize:28}}),color:"#22D3EE",bgColor:"rgba(34, 211, 238, 0.1)",title:"Integrity",description:"Our name says it all. We hold ourselves to the highest standards of transparency, accountability, and ethical practice in everything we do."},{icon:r.jsx(az,{sx:{fontSize:28}}),color:"#34D399",bgColor:"rgba(52, 211, 153, 0.1)",title:"Partnership",description:"We collaborate with government agencies, institutions, and experts to co-create learning experiences that are grounded in real-world practice."},{icon:r.jsx(Rte,{sx:{fontSize:28}}),color:"rgba(17, 82, 212, 1)",bgColor:"rgba(17, 82, 212, 0.1)",title:"Excellence",description:"We are committed to delivering world-class education that empowers public servants and institutional leaders to perform at their very best."}],cne=()=>{const{isDark:e}=Fl(),t=ine(e);return r.jsxs(E,{sx:{bgcolor:t.bgDark,minHeight:"100vh",display:"flex",flexDirection:"column"},children:[r.jsx(om,{}),r.jsx(E,{sx:{background:t.heroGradient,borderBottom:`1px solid ${t.border}`,py:{xs:10,md:14},textAlign:"center"},children:r.jsxs(Zs,{maxWidth:"md",children:[r.jsx(C,{variant:"overline",sx:{color:"rgba(17, 82, 212, 1)",fontWeight:700,letterSpacing:"0.15em",fontSize:"0.8rem",display:"block",mb:2},children:"Our Story"}),r.jsxs(C,{variant:"h2",sx:{fontWeight:800,color:t.textWhite,fontSize:{xs:"2rem",md:"3rem"},lineHeight:1.2,mb:3},children:["Empowering Public Servants"," ",r.jsx(E,{component:"span",sx:{color:"rgba(17, 82, 212, 1)"},children:"Through Knowledge"})]}),r.jsx(C,{sx:{fontSize:"1.125rem",color:t.textMuted,lineHeight:1.8,maxWidth:640,mx:"auto",mb:5},children:"Integritas Hub was founded with a singular mission: to bridge the gap between public sector potential and professional excellence through world-class, accessible education."}),r.jsx(ye,{component:yn,to:"/explore/courses",variant:"contained",endIcon:r.jsx(Oi,{}),sx:{bgcolor:"rgba(17, 82, 212, 1)","&:hover":{bgcolor:"rgba(13, 65, 170, 1)"},textTransform:"none",fontWeight:600,borderRadius:2,px:4,py:1.5,fontSize:"1rem"},children:"Explore Our Courses"})]})}),r.jsx(E,{sx:{py:8,borderBottom:`1px solid ${t.border}`},children:r.jsx(Zs,{maxWidth:"lg",children:r.jsx(Zt,{container:!0,spacing:3,justifyContent:"center",children:ane.map(n=>r.jsx(Zt,{size:{xs:6,md:3},children:r.jsxs(E,{sx:{textAlign:"center"},children:[r.jsx(C,{sx:{fontSize:{xs:"2rem",md:"2.75rem"},fontWeight:800,color:"rgba(17, 82, 212, 1)",lineHeight:1,mb:.5},children:n.value}),r.jsx(C,{sx:{color:t.textMuted,fontSize:"0.9rem",fontWeight:500},children:n.label})]})},n.label))})})}),r.jsx(E,{sx:{py:{xs:8,md:12},borderBottom:`1px solid ${t.border}`},children:r.jsx(Zs,{maxWidth:"lg",children:r.jsxs(Zt,{container:!0,spacing:6,alignItems:"center",children:[r.jsxs(Zt,{size:{xs:12,md:6},children:[r.jsx(C,{variant:"overline",sx:{color:"rgba(17, 82, 212, 1)",fontWeight:700,letterSpacing:"0.15em",fontSize:"0.8rem"},children:"Who We Are"}),r.jsx(C,{variant:"h3",sx:{fontWeight:800,color:t.textWhite,fontSize:{xs:"1.75rem",md:"2.25rem"},mt:1,mb:3,lineHeight:1.3},children:"Our Mission"}),r.jsx(C,{sx:{color:t.textMuted,lineHeight:1.9,fontSize:"1rem",mb:3},children:"At Integritas Hub, our mission is to equip public servants, institutional leaders, and government professionals with the knowledge, skills, and certifications they need to drive meaningful change in their communities and organizations."}),r.jsx(C,{sx:{color:t.textMuted,lineHeight:1.9,fontSize:"1rem"},children:"We believe that a well-trained public sector is the backbone of a thriving nation. Every course we design, every partnership we forge, and every certificate we issue is a step toward that vision of capable, accountable, and impactful governance."})]}),r.jsx(Zt,{size:{xs:12,md:6},children:r.jsx(E,{sx:{bgcolor:t.bgCard,border:`1px solid ${t.border}`,borderRadius:3,p:{xs:3,md:5}},children:r.jsx(G,{spacing:4,children:[{icon:r.jsx(hr,{sx:{color:"rgba(17, 82, 212, 1)",fontSize:28}}),bg:"rgba(17, 82, 212, 0.1)",title:"Expert-Led Learning",desc:"Every course is designed and delivered by practitioners with deep real-world experience in the public sector."},{icon:r.jsx(Jg,{sx:{color:"#FBBF24",fontSize:28}}),bg:"rgba(251, 191, 36, 0.1)",title:"Recognized Certifications",desc:"Our certificates are recognized by government bodies and institutions across Africa."},{icon:r.jsx(mz,{sx:{color:"#34D399",fontSize:28}}),bg:"rgba(52, 211, 153, 0.1)",title:"African Reach",desc:"Serving learners and institutions across Africa."}].map(n=>r.jsxs(G,{direction:"row",spacing:2.5,alignItems:"flex-start",children:[r.jsx(yr,{sx:{bgcolor:n.bg,width:52,height:52,borderRadius:2,flexShrink:0},children:n.icon}),r.jsxs(E,{children:[r.jsx(C,{sx:{fontWeight:700,color:t.textWhite,mb:.5},children:n.title}),r.jsx(C,{sx:{color:t.textMuted,fontSize:"0.9rem",lineHeight:1.7},children:n.desc})]})]},n.title))})})})]})})}),r.jsx(E,{sx:{py:{xs:8,md:12},bgcolor:t.bgDarker,borderBottom:`1px solid ${t.border}`},children:r.jsxs(Zs,{maxWidth:"lg",children:[r.jsxs(E,{sx:{textAlign:"center",mb:8},children:[r.jsx(C,{variant:"overline",sx:{color:"rgba(17, 82, 212, 1)",fontWeight:700,letterSpacing:"0.15em",fontSize:"0.8rem",display:"block",mb:1.5},children:"What Drives Us"}),r.jsx(C,{variant:"h3",sx:{fontWeight:800,color:t.textWhite,fontSize:{xs:"1.75rem",md:"2.25rem"}},children:"Our Core Values"})]}),r.jsx(Zt,{container:!0,spacing:3,children:lne.map(n=>r.jsx(Zt,{size:{xs:12,sm:6,md:3},children:r.jsxs(E,{sx:{bgcolor:t.bgCard,border:`1px solid ${t.border}`,borderRadius:3,p:3.5,height:"100%",transition:"all 0.3s","&:hover":{borderColor:t.borderLight,transform:"translateY(-4px)"}},children:[r.jsx(yr,{sx:{bgcolor:n.bgColor,color:n.color,width:56,height:56,mb:2.5,borderRadius:2},children:n.icon}),r.jsx(C,{sx:{fontWeight:700,color:t.textWhite,mb:1.25,fontSize:"1.05rem"},children:n.title}),r.jsx(C,{sx:{color:t.textMuted,fontSize:"0.9rem",lineHeight:1.75},children:n.description})]})},n.title))})]})}),r.jsx(E,{sx:{py:{xs:10,md:14},textAlign:"center",bgcolor:t.bgDarker},children:r.jsxs(Zs,{maxWidth:"md",children:[r.jsx(yr,{sx:{bgcolor:"rgba(17, 82, 212, 0.12)",width:72,height:72,mx:"auto",mb:3},children:r.jsx(iz,{sx:{fontSize:36,color:"rgba(17, 82, 212, 1)"}})}),r.jsx(C,{variant:"h3",sx:{fontWeight:800,color:t.textWhite,fontSize:{xs:"1.75rem",md:"2.5rem"},mb:2,lineHeight:1.25},children:"Ready to Start Your Learning Journey?"}),r.jsx(C,{sx:{color:t.textMuted,fontSize:"1.05rem",lineHeight:1.8,mb:5,maxWidth:560,mx:"auto"},children:"Join thousands of public servants and institutional leaders who are advancing their careers through Integritas Hub."}),r.jsxs(G,{direction:{xs:"column",sm:"row"},spacing:2,justifyContent:"center",children:[r.jsx(ye,{component:yn,to:"/explore/courses",variant:"contained",endIcon:r.jsx(Oi,{}),sx:{bgcolor:"rgba(17, 82, 212, 1)","&:hover":{bgcolor:"rgba(13, 65, 170, 1)"},textTransform:"none",fontWeight:600,borderRadius:2,px:4,py:1.5,fontSize:"1rem"},children:"Browse Courses"}),r.jsx(ye,{component:yn,to:"/signup",variant:"outlined",sx:{borderColor:t.borderLight,color:t.textWhite,textTransform:"none",fontWeight:600,borderRadius:2,px:4,py:1.5,fontSize:"1rem","&:hover":{borderColor:t.textWhite,bgcolor:"transparent"}},children:"Create Free Account"})]})]})}),r.jsx(im,{})]})},une=e=>({bgDark:e?"#0C1322":"#FFFFFF",bgDarker:e?"#080D19":"#F8FAFC",bgCard:e?"#111827":"#FFFFFF",primary:"rgba(17, 82, 212, 1)",primaryHover:"rgba(13, 65, 170, 1)",primaryLight:"rgba(17, 82, 212, 0.1)",textWhite:e?"#FFFFFF":"#1E293B",textLight:e?"#F3F4F6":"#334155",textMuted:e?"#9CA3AF":"#64748B",textDark:e?"#6B7280":"#94A3B8",border:e?"#1F2937":"#E2E8F0",borderLight:e?"#374151":"#CBD5E1",heroGradient:e?"linear-gradient(135deg, rgba(40, 46, 57, 1) 0%, rgba(30, 35, 45, 1) 50%, rgba(20, 25, 35, 1) 100%)":"linear-gradient(135deg, #F8FAFC 0%, #EEF2FF 50%, #F0FDF4 100%)"}),dne=[{icon:r.jsx(kee,{sx:{fontSize:26}}),color:"rgba(17, 82, 212, 1)",bgColor:"rgba(17, 82, 212, 0.1)",label:"Government Agencies"},{icon:r.jsx(hr,{sx:{fontSize:26}}),color:"#0891B2",bgColor:"rgba(8, 145, 178, 0.1)",label:"Academic Institutions"},{icon:r.jsx(Oee,{sx:{fontSize:26}}),color:"#7C3AED",bgColor:"rgba(124, 58, 237, 0.1)",label:"Private Sector"},{icon:r.jsx(mz,{sx:{fontSize:26}}),color:"#059669",bgColor:"rgba(5, 150, 105, 0.1)",label:"International Bodies"}],fne=[{icon:r.jsx(Lte,{sx:{fontSize:28}}),color:"#22D3EE",bgColor:"rgba(34, 211, 238, 0.1)",title:"Co-Branded Certification",description:"Offer your learners certificates that carry both your institution's brand and Integritas Hub's accreditation."},{icon:r.jsx(iz,{sx:{fontSize:28}}),color:"#34D399",bgColor:"rgba(52, 211, 153, 0.1)",title:"Custom Learning Paths",description:"We build tailored training programs designed specifically for your team's needs and organizational goals."},{icon:r.jsx(sm,{sx:{fontSize:28}}),color:"rgba(17, 82, 212, 1)",bgColor:"rgba(17, 82, 212, 0.1)",title:"Analytics & Reporting",description:"Real-time dashboards and progress reports so your organization can track and measure learning outcomes."},{icon:r.jsx(Jg,{sx:{fontSize:28}}),color:"#FBBF24",bgColor:"rgba(251, 191, 36, 0.1)",title:"Priority Support",description:"Dedicated account management and priority technical support to ensure seamless delivery for your teams."}],hne=[{value:"120+",label:"Partner Institutions"},{value:"30+",label:"Countries Reached"},{value:"200+",label:"Joint Programs"},{value:"15k+",label:"Professionals Trained"}],pne=()=>{const{isDark:e}=Fl(),t=une(e);return r.jsxs(E,{sx:{bgcolor:t.bgDark,minHeight:"100vh",display:"flex",flexDirection:"column"},children:[r.jsx(om,{}),r.jsx(E,{sx:{background:t.heroGradient,borderBottom:`1px solid ${t.border}`,py:{xs:10,md:14},textAlign:"center"},children:r.jsxs(Zs,{maxWidth:"md",children:[r.jsx(C,{variant:"overline",sx:{color:"rgba(17, 82, 212, 1)",fontWeight:700,letterSpacing:"0.15em",fontSize:"0.8rem",display:"block",mb:2},children:"Stronger Together"}),r.jsxs(C,{variant:"h2",sx:{fontWeight:800,color:t.textWhite,fontSize:{xs:"2rem",md:"3rem"},lineHeight:1.2,mb:3},children:["Our"," ",r.jsx(E,{component:"span",sx:{color:"rgba(17, 82, 212, 1)"},children:"Partners"})," ","& Collaborators"]}),r.jsx(C,{sx:{fontSize:"1.125rem",color:t.textMuted,lineHeight:1.8,maxWidth:620,mx:"auto",mb:5},children:"We build meaningful partnerships with government bodies, academic institutions, international organizations, and private sector leaders to deliver world-class public sector education."}),r.jsxs(G,{direction:{xs:"column",sm:"row"},spacing:2,justifyContent:"center",children:[r.jsx(ye,{component:yn,to:"/signup",variant:"contained",endIcon:r.jsx(Oi,{}),sx:{bgcolor:"rgba(17, 82, 212, 1)","&:hover":{bgcolor:"rgba(13, 65, 170, 1)"},textTransform:"none",fontWeight:600,borderRadius:2,px:4,py:1.5,fontSize:"1rem"},children:"Become a Partner"}),r.jsx(ye,{component:yn,to:"/explore/courses",variant:"outlined",sx:{borderColor:t.borderLight,color:t.textWhite,textTransform:"none",fontWeight:600,borderRadius:2,px:4,py:1.5,fontSize:"1rem","&:hover":{borderColor:t.textWhite,bgcolor:"transparent"}},children:"View Courses"})]})]})}),r.jsx(E,{sx:{py:8,borderBottom:`1px solid ${t.border}`},children:r.jsx(Zs,{maxWidth:"lg",children:r.jsx(Zt,{container:!0,spacing:3,justifyContent:"center",children:hne.map(n=>r.jsx(Zt,{size:{xs:6,md:3},children:r.jsxs(E,{sx:{textAlign:"center"},children:[r.jsx(C,{sx:{fontSize:{xs:"2rem",md:"2.75rem"},fontWeight:800,color:"rgba(17, 82, 212, 1)",lineHeight:1,mb:.5},children:n.value}),r.jsx(C,{sx:{color:t.textMuted,fontSize:"0.9rem",fontWeight:500},children:n.label})]})},n.label))})})}),r.jsx(E,{sx:{py:{xs:8,md:12},bgcolor:t.bgDarker,borderBottom:`1px solid ${t.border}`},children:r.jsxs(Zs,{maxWidth:"lg",children:[r.jsxs(E,{sx:{textAlign:"center",mb:7},children:[r.jsx(C,{variant:"overline",sx:{color:"rgba(17, 82, 212, 1)",fontWeight:700,letterSpacing:"0.15em",fontSize:"0.8rem",display:"block",mb:1.5},children:"Who We Work With"}),r.jsx(C,{variant:"h3",sx:{fontWeight:800,color:t.textWhite,fontSize:{xs:"1.75rem",md:"2.25rem"}},children:"Partner Categories"})]}),r.jsx(Zt,{container:!0,spacing:3,justifyContent:"center",children:dne.map(n=>r.jsx(Zt,{size:{xs:12,sm:6,md:3},children:r.jsxs(E,{sx:{bgcolor:t.bgCard,border:`1px solid ${t.border}`,borderRadius:3,p:4,textAlign:"center",transition:"all 0.3s","&:hover":{borderColor:t.borderLight,transform:"translateY(-4px)"}},children:[r.jsx(yr,{sx:{bgcolor:n.bgColor,color:n.color,width:64,height:64,mx:"auto",mb:2,borderRadius:2},children:n.icon}),r.jsx(C,{sx:{fontWeight:700,color:t.textWhite,fontSize:"1rem"},children:n.label})]})},n.label))})]})}),r.jsx(E,{sx:{py:{xs:8,md:12},bgcolor:t.bgDarker,borderBottom:`1px solid ${t.border}`},children:r.jsxs(Zs,{maxWidth:"lg",children:[r.jsxs(E,{sx:{textAlign:"center",mb:8},children:[r.jsx(C,{variant:"overline",sx:{color:"rgba(17, 82, 212, 1)",fontWeight:700,letterSpacing:"0.15em",fontSize:"0.8rem",display:"block",mb:1.5},children:"Why Partner With Us"}),r.jsx(C,{variant:"h3",sx:{fontWeight:800,color:t.textWhite,fontSize:{xs:"1.75rem",md:"2.25rem"}},children:"Partnership Benefits"}),r.jsx(C,{sx:{color:t.textMuted,mt:2,maxWidth:560,mx:"auto",lineHeight:1.8},children:"We offer flexible partnership models designed to create lasting value for your institution and the learners you serve."})]}),r.jsx(Zt,{container:!0,spacing:3,children:fne.map(n=>r.jsx(Zt,{size:{xs:12,sm:6},children:r.jsxs(E,{sx:{bgcolor:t.bgCard,border:`1px solid ${t.border}`,borderRadius:3,p:3.5,display:"flex",gap:2.5,alignItems:"flex-start",height:"100%",transition:"all 0.3s","&:hover":{borderColor:t.borderLight}},children:[r.jsx(yr,{sx:{bgcolor:n.bgColor,color:n.color,width:56,height:56,borderRadius:2,flexShrink:0},children:n.icon}),r.jsxs(E,{children:[r.jsx(C,{sx:{fontWeight:700,color:t.textWhite,mb:.75},children:n.title}),r.jsx(C,{sx:{color:t.textMuted,fontSize:"0.9rem",lineHeight:1.75},children:n.description})]})]})},n.title))})]})}),r.jsx(E,{sx:{py:{xs:10,md:14},textAlign:"center",bgcolor:t.bgDark},children:r.jsxs(Zs,{maxWidth:"md",children:[r.jsx(yr,{sx:{bgcolor:"rgba(17, 82, 212, 0.12)",width:72,height:72,mx:"auto",mb:3},children:r.jsx(az,{sx:{fontSize:36,color:"rgba(17, 82, 212, 1)"}})}),r.jsxs(C,{variant:"h3",sx:{fontWeight:800,color:t.textWhite,fontSize:{xs:"1.75rem",md:"2.5rem"},mb:2,lineHeight:1.25},children:["Let's Build Something"," ",r.jsx(E,{component:"span",sx:{color:"rgba(17, 82, 212, 1)"},children:"Meaningful Together"})]}),r.jsx(C,{sx:{color:t.textMuted,fontSize:"1.05rem",lineHeight:1.8,mb:5,maxWidth:560,mx:"auto"},children:"Whether you're a government ministry, a university, or an international organization, we'd love to explore how we can work together to train the next generation of public sector leaders."}),r.jsx(G,{direction:{xs:"column",sm:"row"},spacing:2,justifyContent:"center"})]})}),r.jsx(im,{})]})},am="/assets/GGH_icon-Bv4hIxr8.png",gne=()=>{const e=Dn(),t=Nr(),{login:n}=ps(),[s,o]=v.useState(!1),[a,l]=v.useState(!1),[u,d]=v.useState(""),[f,p]=v.useState({email:"",password:""}),g=y=>{const{name:S,value:j}=y.target;p(A=>({...A,[S]:j}))},x=async y=>{if(y.preventDefault(),d(""),!f.email||!f.password){d("Please fill in all fields.");return}l(!0);try{const S=await n(f.email,f.password),j=S?.role||S?.userType;if(!j){d("Unable to determine user role. Please contact support."),l(!1);return}const A=V1(S||j),M=t.state?.from,R=jN(M,S)?M:A;e(R,{replace:!0})}catch(S){console.error("Login error:",S),d(S?.message||"Login failed. Please check your credentials and try again.")}finally{l(!1)}},b=()=>{o(y=>!y)};return r.jsxs(E,{sx:{minHeight:"100vh",display:"flex",flexDirection:{xs:"column",md:"row"}},children:[r.jsxs(E,{sx:{flex:{md:"0 0 45%"},backgroundImage:"url(/src/assets/images/LoginBg.png)",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",display:{xs:"none",md:"flex"},flexDirection:"column",justifyContent:"center",alignItems:"center",p:6,minHeight:"100vh",position:"relative",overflow:"hidden"},children:[r.jsx(E,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,bgcolor:"#212c4c98",pointerEvents:"none"}}),r.jsxs(E,{sx:{textAlign:"center",position:"relative",zIndex:1},children:[r.jsx(E,{component:"img",src:Pc,alt:"Integritas Hub Logo",sx:{height:100,width:100,borderRadius:2,mb:2}}),r.jsx(C,{variant:"h4",sx:{color:"#FFFFFF",fontWeight:700,fontSize:{xs:"1.5rem",md:"1.75rem"},mb:2},children:"Governance Reimagined"}),r.jsx(C,{sx:{color:"rgba(255, 255, 255, 0.7)",fontSize:"0.875rem",lineHeight:1.7,maxWidth:320,mx:"auto"},children:"Ensuring transparency, accountability, and secure access for all governance professionals worldwide."})]})]}),r.jsxs(E,{sx:{flex:{xs:"1 1 auto",md:"0 0 55%"},bgcolor:"#0C1322",display:"flex",flexDirection:"column",justifyContent:"space-between",p:{xs:3,sm:4,md:6,lg:8},minHeight:"100vh"},children:[r.jsxs(E,{sx:{maxWidth:400,mx:"auto",width:"100%",my:"auto"},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1},children:[r.jsx(E,{component:"img",src:am,alt:"Integritas Hub Logo",sx:{height:50,width:50}}),r.jsx(C,{sx:{fontSize:"1.2rem",fontWeight:600,color:"#FFFFFF"},children:"Integritas Hub"})]}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.5},children:[r.jsx(C,{variant:"h4",sx:{fontWeight:700,color:"#FFFFFF",fontSize:{xs:"1.5rem",md:"2rem"}},children:"Welcome back"}),r.jsx(yf,{sx:{color:"#1152D4",fontSize:24}})]}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.875rem",mb:3},children:"Secure Access for Governance Professionals"}),r.jsxs(E,{component:"form",onSubmit:x,children:[r.jsxs(E,{sx:{mb:2.5},children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Email Address"}),r.jsx(it,{fullWidth:!0,name:"email",type:"email",placeholder:"name@organization.com",value:f.email,onChange:g,size:"small",autoComplete:"off",inputProps:{autoComplete:"new-email"},sx:{"& .MuiOutlinedInput-root":{bgcolor:"#1E293B",borderRadius:1.5,"& fieldset":{borderColor:"#374151"},"&:hover fieldset":{borderColor:"#4B5563"},"&.Mui-focused fieldset":{borderColor:"#1152D4"}},"& .MuiInputBase-input":{py:1.25,fontSize:"0.875rem",color:"#FFFFFF",border:"none","&::placeholder":{color:"#9CA3AF",opacity:1}}}})]}),r.jsxs(E,{sx:{mb:3},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:.75},children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB"},children:"Password"}),r.jsx(yn,{to:"/forgot-password",style:{fontSize:"0.75rem",color:"#3B82F6",textDecoration:"none",fontWeight:500},children:"Forgot Password?"})]}),r.jsx(it,{fullWidth:!0,name:"password",type:s?"text":"password",placeholder:"••••••••",value:f.password,onChange:g,size:"small",autoComplete:"off",inputProps:{autoComplete:"new-password"},InputProps:{endAdornment:r.jsx(Ar,{position:"end",children:r.jsx(Ve,{onClick:b,edge:"end",size:"small",sx:{color:"#9CA3AF"},children:s?r.jsx(xg,{fontSize:"small"}):r.jsx(Bi,{fontSize:"small"})})})},sx:{"& .MuiOutlinedInput-root":{bgcolor:"#1E293B",borderRadius:1.5,"& fieldset":{borderColor:"#374151"},"&:hover fieldset":{borderColor:"#4B5563"},"&.Mui-focused fieldset":{borderColor:"#1152D4"}},"& .MuiInputBase-input":{py:1.25,fontSize:"0.875rem",color:"#FFFFFF",border:"none","&::placeholder":{color:"#9CA3AF",opacity:1}}}})]}),u&&r.jsx(Wt,{severity:"error",sx:{mb:2,bgcolor:"#1E293B",color:"#EF4444","& .MuiAlert-icon":{color:"#EF4444"}},children:u}),r.jsx(ye,{type:"submit",fullWidth:!0,variant:"contained",disabled:a,sx:{bgcolor:"#1152D4",color:"#FFFFFF",py:1.5,textTransform:"none",fontWeight:600,fontSize:"0.875rem",borderRadius:1.5,boxShadow:"none","&:hover":{bgcolor:"#0D41AA",boxShadow:"0 4px 12px rgba(17, 82, 212, 0.3)"},"&:disabled":{bgcolor:"#374151",color:"#9CA3AF"}},children:a?"Logging in...":"Log In"})]}),r.jsxs(C,{sx:{textAlign:"center",mt:3,fontSize:"0.875rem",color:"#9CA3AF"},children:["Don't have an account?"," ",r.jsx(yn,{to:"/Signup",style:{color:"#3B82F6",textDecoration:"none",fontWeight:600},children:"Click to Register"})]})]}),r.jsx(C,{sx:{textAlign:"center",fontSize:"0.75rem",color:"#6B7280",pt:2},children:"© 2026 Integritas Hub. All rights reserved."})]})]})},mne=()=>{const e=Dn(),{register:t}=ps(),[n,s]=v.useState(!1),[o,a]=v.useState(""),[l,u]=v.useState(!1),[d,f]=v.useState(!1),[p,g]=v.useState("student"),[x,b]=v.useState({name:!1,email:!1,password:!1,password_confirmation:!1}),[y,S]=v.useState({name:"",email:"",password:"",password_confirmation:""}),j=(O,W)=>{W!==null&&g(W)},A=O=>{const{name:W,value:D}=O.target;S(q=>({...q,[W]:D}))},M=O=>{b(W=>({...W,[O]:!0}))},R=()=>u(O=>!O),_=()=>f(O=>!O),z={minLen:y.password.length>=8,hasUpper:/[A-Z]/.test(y.password),hasNumber:/\d/.test(y.password)},F=z.minLen&&z.hasUpper&&z.hasNumber,N=z.minLen&&z.hasUpper&&z.hasNumber,I=y.password_confirmation.length>0&&y.password===y.password_confirmation,B=y.name.trim().length>=2,H=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(y.email.trim()),P=!n&&B&&H&&N&&I,k=x.password_confirmation||y.password_confirmation.length>0,L=async O=>{if(O.preventDefault(),a(""),b({name:!0,email:!0,password:!0,password_confirmation:!0}),!B){a("Please enter your full name.");return}if(!H){a("Please enter a valid email address.");return}if(!N){a("Password does not meet the required rules.");return}if(!I){a("Passwords do not match.");return}s(!0);try{const W=await t({name:y.name.trim(),email:y.email.trim(),password:y.password,password_confirmation:y.password_confirmation,role:p,user_type:p}),D=V1(W||p);e(D)}catch(W){console.error(W),a(W?.message||"Registration failed. Please try again.")}finally{s(!1)}};return r.jsxs(E,{sx:{minHeight:"100vh",display:"flex",flexDirection:{xs:"column",md:"row"}},children:[r.jsxs(E,{sx:{flex:{md:"0 0 45%"},backgroundImage:"url(/src/assets/images/LoginBg.png)",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",display:{xs:"none",md:"flex"},flexDirection:"column",justifyContent:"center",alignItems:"center",p:6,minHeight:"100vh",position:"relative",overflow:"hidden"},children:[r.jsx(E,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,bgcolor:"#212c4c98",pointerEvents:"none"}}),r.jsxs(E,{sx:{textAlign:"center",position:"relative",zIndex:1},children:[r.jsx(E,{component:"img",src:Pc,alt:"Integritas Hub Logo",sx:{height:100,width:100,borderRadius:2,mb:2}}),r.jsx(C,{variant:"h4",sx:{color:"#FFFFFF",fontWeight:700,fontSize:{xs:"1.5rem",md:"1.75rem"},mb:2},children:"Governance Reimagined"}),r.jsx(C,{sx:{color:"rgba(255, 255, 255, 0.7)",fontSize:"0.875rem",lineHeight:1.7,maxWidth:320,mx:"auto"},children:"Ensuring transparency, accountability, and secure access for all governance professionals worldwide."})]})]}),r.jsxs(E,{sx:{flex:{xs:"1 1 auto",md:"0 0 55%"},bgcolor:"#0C1322",display:"flex",flexDirection:"column",justifyContent:"space-between",p:{xs:3,sm:4,md:6,lg:8},minHeight:"100vh"},children:[r.jsxs(E,{sx:{maxWidth:420,mx:"auto",width:"100%",my:"auto"},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1},children:[r.jsx(E,{component:"img",src:am,alt:"Integritas Hub Logo",sx:{height:50,width:50}}),r.jsx(C,{sx:{fontSize:"1.2rem",fontWeight:600,color:"#FFFFFF"},children:"Integritas Hub"})]}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.5},children:[r.jsx(C,{variant:"h4",sx:{fontWeight:700,color:"#FFFFFF",fontSize:{xs:"1.5rem",md:"2rem"}},children:"Create Account"}),r.jsx(yf,{sx:{color:"#1152D4",fontSize:24}})]}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.875rem",mb:3},children:"Secure Access for Governance Professionals"}),r.jsx(E,{sx:{bgcolor:"#1E293B",borderRadius:2,p:.5,mb:3},children:r.jsxs(Zg,{value:p,onChange:j,variant:"fullWidth",TabIndicatorProps:{style:{display:"none"}},sx:{minHeight:40,"& .MuiTab-root":{minHeight:36,textTransform:"none",fontWeight:500,fontSize:"0.875rem",color:"#9CA3AF",borderRadius:1.5,transition:"all 0.2s","&.Mui-selected":{color:"#FFFFFF",bgcolor:"#374151",boxShadow:"0 1px 3px rgba(0,0,0,0.3)"}}},children:[r.jsx(Qs,{label:"Student",value:"student"}),r.jsx(Qs,{label:"Tutor",value:"tutor"})]})}),r.jsx(Al,{in:!!o,children:r.jsx(Wt,{severity:"error",icon:r.jsx(Zee,{fontSize:"inherit"}),sx:{mb:3,bgcolor:"rgba(239, 68, 68, 0.1)",color:"#FCA5A5","& .MuiAlert-icon":{color:"#EF4444"}},children:o})}),r.jsxs(E,{component:"form",onSubmit:L,children:[r.jsxs(E,{sx:{mb:.5},children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Full Name"}),r.jsx(it,{fullWidth:!0,name:"name",type:"text",placeholder:"Enter your full name",value:y.name,onChange:A,onBlur:()=>M("name"),disabled:n,size:"small",autoComplete:"off",inputProps:{autoComplete:"name"},error:x.name&&!B,helperText:x.name&&!B?"Please enter your full name.":" ",FormHelperTextProps:{sx:{color:"#FCA5A5",m:0,mt:.75}},sx:{"& .MuiOutlinedInput-root":{bgcolor:"#1E293B",borderRadius:1.5,"& fieldset":{borderColor:"#374151"},"&:hover fieldset":{borderColor:"#4B5563"},"&.Mui-focused fieldset":{borderColor:"#1152D4"},"&.Mui-error fieldset":{borderColor:"#EF4444"}},"& .MuiInputBase-input":{py:1.25,fontSize:"0.875rem",color:"#FFFFFF",border:"none","&::placeholder":{color:"#9CA3AF",opacity:1}}}})]}),r.jsxs(E,{sx:{mb:.5},children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Email Address"}),r.jsx(it,{fullWidth:!0,name:"email",type:"email",placeholder:"name@organization.com",value:y.email,onChange:A,onBlur:()=>M("email"),disabled:n,size:"small",autoComplete:"off",inputProps:{autoComplete:"new-email"},error:x.email&&!H,helperText:x.email&&!H?"Please enter a valid email address.":" ",FormHelperTextProps:{sx:{color:"#FCA5A5",m:0,mt:.75}},sx:{"& .MuiOutlinedInput-root":{bgcolor:"#1E293B",borderRadius:1.5,"& fieldset":{borderColor:"#374151"},"&:hover fieldset":{borderColor:"#4B5563"},"&.Mui-focused fieldset":{borderColor:"#1152D4"},"&.Mui-error fieldset":{borderColor:"#EF4444"}},"& .MuiInputBase-input":{py:1.25,fontSize:"0.875rem",color:"#FFFFFF",border:"none","&::placeholder":{color:"#9CA3AF",opacity:1}}}})]}),r.jsxs(E,{sx:{mb:2},children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Password"}),r.jsx(it,{fullWidth:!0,name:"password",type:l?"text":"password",placeholder:"••••••••",value:y.password,onChange:A,onBlur:()=>b(O=>({...O,password:!0})),error:x.password&&!F,InputProps:{endAdornment:r.jsx(Ar,{position:"end",children:r.jsx(Ve,{onClick:R,edge:"end",size:"small",sx:{color:"#9CA3AF"},children:l?r.jsx(xg,{fontSize:"small"}):r.jsx(Bi,{fontSize:"small"})})})},sx:{"& .MuiOutlinedInput-root":{bgcolor:"#1E293B",borderRadius:1.5,"& fieldset":{borderColor:"#374151"},"&:hover fieldset":{borderColor:"#4B5563"},"&.Mui-focused fieldset":{borderColor:"#1152D4"},"&.Mui-error fieldset":{borderColor:"#EF4444"}},"& .MuiInputBase-input":{py:1.25,fontSize:"0.875rem",color:"#FFFFFF",border:"none","&::placeholder":{color:"#9CA3AF",opacity:1}}}}),(x.password||y.password.length>0)&&r.jsx(G,{spacing:.5,sx:{mt:1},children:[{ok:z.minLen,label:"At least 8 characters"},{ok:z.hasUpper,label:"One uppercase letter"},{ok:z.hasNumber,label:"One number"}].map(O=>r.jsxs(G,{direction:"row",spacing:1,alignItems:"center",children:[O.ok?r.jsx(Ia,{sx:{fontSize:16,color:"#22C55E"}}):r.jsx(i1,{sx:{fontSize:16,color:"#EF4444"}}),r.jsx(C,{sx:{fontSize:"0.75rem",color:O.ok?"#86EFAC":"#FCA5A5"},children:O.label})]},O.label))})]}),r.jsxs(E,{sx:{mb:3},children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Confirm Password"}),r.jsx(it,{fullWidth:!0,name:"password_confirmation",type:d?"text":"password",placeholder:"••••••••",value:y.password_confirmation,onChange:A,onBlur:()=>M("password_confirmation"),disabled:n,size:"small",autoComplete:"off",inputProps:{autoComplete:"new-password"},error:k&&!I,InputProps:{endAdornment:r.jsx(Ar,{position:"end",children:r.jsx(Ve,{onClick:_,edge:"end",size:"small",sx:{color:"#9CA3AF"},children:d?r.jsx(xg,{fontSize:"small"}):r.jsx(Bi,{fontSize:"small"})})})},sx:{"& .MuiOutlinedInput-root":{bgcolor:"#1E293B",borderRadius:1.5,"& fieldset":{borderColor:"#374151"},"&:hover fieldset":{borderColor:"#4B5563"},"&.Mui-focused fieldset":{borderColor:"#1152D4"},"&.Mui-error fieldset":{borderColor:"#EF4444"}},"& .MuiInputBase-input":{py:1.25,fontSize:"0.875rem",color:"#FFFFFF",border:"none","&::placeholder":{color:"#9CA3AF",opacity:1}}}}),r.jsx(E,{sx:{mt:1},children:k&&y.password_confirmation.length>0&&r.jsxs(E,{sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.6,borderRadius:999,border:"1px solid",borderColor:I?"rgba(34,197,94,0.35)":"rgba(239,68,68,0.35)",bgcolor:I?"rgba(34,197,94,0.12)":"rgba(239,68,68,0.10)",color:I?"#86EFAC":"#FCA5A5",fontSize:"0.75rem",lineHeight:1},children:[I?r.jsx(Ia,{sx:{fontSize:16,color:"#22C55E"}}):r.jsx(i1,{sx:{fontSize:16,color:"#EF4444"}}),I?"Passwords match":"Passwords do not match"]})})]}),r.jsx(ye,{type:"submit",fullWidth:!0,variant:"contained",disabled:!P,sx:{bgcolor:"#1152D4",color:"#FFFFFF",py:1.5,textTransform:"none",fontWeight:600,fontSize:"0.875rem",borderRadius:1.5,boxShadow:"none","&:hover":{bgcolor:"#0D41AA",boxShadow:"0 4px 12px rgba(17, 82, 212, 0.3)"},"&.Mui-disabled":{bgcolor:"rgba(17, 82, 212, 0.35)",color:"rgba(255, 255, 255, 0.5)"}},children:n?"Creating Account...":"Sign Up"})]}),r.jsxs(C,{sx:{textAlign:"center",mt:3,fontSize:"0.875rem",color:"#9CA3AF"},children:["Already have an account?"," ",r.jsx(yn,{to:"/login",style:{color:"#3B82F6",textDecoration:"none",fontWeight:600},children:"Log In"})]})]}),r.jsx(C,{sx:{textAlign:"center",fontSize:"0.75rem",color:"#6B7280",pt:2},children:"© 2026 Integritas Hub. All rights reserved."})]})]})},S8=()=>{const{id:e,hash:t}=Vu(),[n]=Oj(),s=Dn(),{verifyEmail:o,resendEmail:a,user:l,logout:u}=ps(),[d,f]=v.useState(60),[p,g]=v.useState(!1),[x,b]=v.useState(!1),[y,S]=v.useState(""),[j,A]=v.useState("");v.useEffect(()=>{(async()=>{if(e&&t){b(!0),S(""),A("");try{const z=Object.fromEntries([...n]);await o(e,t,z),A("Email verified successfully! Redirecting to dashboard..."),setTimeout(()=>{s(V1(l))},3e3)}catch(z){console.error("Auto-verification error:",z),S(z?.message||"Verification link is invalid or has expired.")}finally{b(!1)}}})()},[e,t,n,o,s,l]),v.useEffect(()=>{if(d>0){const _=setInterval(()=>{f(z=>z-1)},1e3);return()=>clearInterval(_)}},[d]);const M=_=>{const z=Math.floor(_/60),F=_%60;return`${z.toString().padStart(2,"0")}:${F.toString().padStart(2,"0")}`},R=async()=>{g(!0),S(""),A("");try{await a(),f(60),A("Verification email has been resent. Please check your inbox.")}catch(_){S(_?.message||"Failed to resend verification email. Please try again.")}finally{g(!1)}};return r.jsxs(E,{sx:{minHeight:"100vh",bgcolor:"#0C1322",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",p:{xs:2,md:4}},children:[r.jsxs(E,{sx:{position:"fixed",top:0,left:0,right:0,display:"flex",justifyContent:"space-between",alignItems:"center",p:{xs:2,md:3},bgcolor:"#0C1322",zIndex:10},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,children:[r.jsx(E,{component:"img",src:am,alt:"Integritas Hub Logo",sx:{height:28,width:28}}),r.jsx(C,{sx:{fontSize:"0.9rem",fontWeight:600,color:"#FFFFFF"},children:"Integritas Hub"})]}),r.jsxs(G,{direction:"row",spacing:3,children:[r.jsx(C,{component:yn,to:"/support",sx:{fontSize:"0.875rem",color:"#9CA3AF",textDecoration:"none","&:hover":{color:"#FFFFFF"}},children:"Support"}),r.jsx(C,{component:yn,to:"/privacy",sx:{fontSize:"0.875rem",color:"#9CA3AF",textDecoration:"none","&:hover":{color:"#FFFFFF"}},children:"Privacy"})]})]}),r.jsxs(E,{sx:{bgcolor:"#1A2230",borderRadius:3,borderTop:"4px solid #1152D4",p:{xs:3,sm:3.5,md:4},maxWidth:450,width:"100%",height:500,textAlign:"center",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.5)"},children:[r.jsx(E,{sx:{width:56,height:56,bgcolor:"#1152D4",borderRadius:2,display:"flex",alignItems:"center",justifyContent:"center",mx:"auto",mb:3},children:r.jsx(gg,{sx:{fontSize:28,color:"#FFFFFF"}})}),r.jsx(C,{variant:"h5",sx:{fontWeight:700,color:"#FFFFFF",fontSize:{xs:"1.25rem",md:"1.5rem"},mb:1.5},children:x?"Verifying your email...":e&&t?"Verification in progress":"Verify your email"}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.875rem",mb:3},children:e&&t?"Please wait while we confirm your verification link...":r.jsxs(r.Fragment,{children:["We sent a verification link to"," ",r.jsx(E,{component:"span",sx:{color:"#3B82F6",fontWeight:600},children:l?.email||"your email"}),". Please click the link in that email to confirm your identity."]})}),y&&r.jsx(Wt,{severity:"error",sx:{mb:3,bgcolor:"rgba(239, 68, 68, 0.1)",color:"#EF4444",border:"1px solid rgba(239, 68, 68, 0.2)","& .MuiAlert-icon":{color:"#EF4444"}},onClose:()=>S(""),children:y}),j&&r.jsx(Wt,{severity:"success",sx:{mb:3,bgcolor:"rgba(16, 185, 129, 0.1)",color:"#10B981",border:"1px solid rgba(16, 185, 129, 0.2)","& .MuiAlert-icon":{color:"#10B981"}},onClose:()=>A(""),children:j}),!e&&!t&&r.jsx(r.Fragment,{children:r.jsx(ye,{fullWidth:!0,variant:"contained",disabled:p||d>0,onClick:R,sx:{bgcolor:"#1152D4",color:"#FFFFFF",py:1.5,textTransform:"none",fontWeight:600,fontSize:"0.9rem",borderRadius:1.5,boxShadow:"none","&:hover":{bgcolor:"#0D41AA"},mb:3},children:p?"Sending...":d>0?`Resend email in ${M(d)}`:"Resend Verification Email"})}),r.jsx(E,{sx:{pt:3,borderTop:"1px solid #374151",display:"flex",justifyContent:"center"},children:r.jsxs(C,{onClick:async()=>{await u(),s("/login")},sx:{display:"flex",alignItems:"center",gap:"4px",fontSize:"0.875rem",color:"#3B82F6",cursor:"pointer",fontWeight:500,"&:hover":{textDecoration:"underline"}},children:["← ",l?"Logout & Back to Login":"Back to Login"]})})]}),r.jsxs(G,{direction:"row",spacing:4,sx:{mt:4},children:[r.jsx(C,{component:yn,to:"/help",sx:{fontSize:"0.875rem",color:"#6B7280",textDecoration:"none","&:hover":{color:"#9CA3AF"}},children:"Need help?"}),r.jsx(C,{component:yn,to:"/change-email",sx:{fontSize:"0.875rem",color:"#6B7280",textDecoration:"none","&:hover":{color:"#9CA3AF"}},children:"Change email address"})]})]})},xne=()=>{const e=Dn(),{forgotPassword:t,verifyPasswordOtp:n,resetPassword:s}=ps(),[o,a]=v.useState(""),[l,u]=v.useState(!1),[d,f]=v.useState(!1),[p,g]=v.useState(["","","","","",""]),[x,b]=v.useState(!1),[y,S]=v.useState(!1),[j,A]=v.useState(!1),[M,R]=v.useState(!1),[_,z]=v.useState(!1),[F,N]=v.useState(!1),[I,B]=v.useState(""),[H,P]=v.useState(""),[k,L]=v.useState(""),[O,W]=v.useState(600),D=v.useRef([]);v.useEffect(()=>{if(O>0&&d){const se=setInterval(()=>{W(J=>J-1)},1e3);return()=>clearInterval(se)}},[O,d]);const q=se=>{const J=Math.floor(se/60),ce=se%60;return`${J.toString().padStart(2,"0")}:${ce.toString().padStart(2,"0")}`},K=(se,J)=>{if(J&&!/^\d$/.test(J))return;const ce=[...p];ce[se]=J,g(ce),J&&se<5&&D.current[se+1]?.focus()},Y=(se,J)=>{J.key==="Backspace"&&!p[se]&&se>0&&D.current[se-1]?.focus()},ie=se=>{se.preventDefault();const J=se.clipboardData.getData("text").slice(0,6);if(/^\d+$/.test(J)){const ce=[...p];J.split("").forEach((ge,de)=>{de<6&&(ce[de]=ge)}),g(ce);const oe=Math.min(J.length,5);D.current[oe]?.focus()}},V=async se=>{se.preventDefault(),L(""),u(!0);try{await t(o),f(!0),W(600)}catch(J){L(J?.message||"Failed to send OTP. Please try again.")}finally{u(!1)}},re=async se=>{se.preventDefault(),L(""),b(!0);const J=p.join("");try{await n(o,J),S(!0)}catch(ce){L(ce?.message||"Invalid OTP. Please try again."),g(["","","","","",""]),D.current[0]?.focus()}finally{b(!1)}},fe=async se=>{if(se.preventDefault(),L(""),I!==H){L("Passwords do not match.");return}if(I.length<8){L("Password must be at least 8 characters long.");return}A(!0);const J=p.join("");try{await s(o,J,I,H),R(!0),setTimeout(()=>{e("/login")},2e3)}catch(ce){L(ce?.message||"Failed to reset password. Please try again.")}finally{A(!1)}},ae=o&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o),ue=p.every(se=>se!=="");return r.jsxs(E,{sx:{minHeight:"100vh",bgcolor:"#0C1322",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",p:{xs:2,md:4}},children:[r.jsxs(E,{sx:{position:"fixed",top:0,left:0,right:0,display:"flex",justifyContent:"space-between",alignItems:"center",p:{xs:2,md:3},bgcolor:"#0C1322",zIndex:10},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,children:[r.jsx(E,{component:"img",src:am,alt:"Integritas Hub Logo",sx:{height:28,width:28}}),r.jsx(C,{sx:{fontSize:"0.9rem",fontWeight:600,color:"#FFFFFF"},children:"Integritas Hub"})]}),r.jsxs(G,{direction:"row",spacing:3,children:[r.jsx(C,{component:yn,to:"/support",sx:{fontSize:"0.875rem",color:"#9CA3AF",textDecoration:"none","&:hover":{color:"#FFFFFF"}},children:"Support"}),r.jsx(C,{component:yn,to:"/privacy",sx:{fontSize:"0.875rem",color:"#9CA3AF",textDecoration:"none","&:hover":{color:"#FFFFFF"}},children:"Privacy"})]})]}),r.jsxs(E,{sx:{bgcolor:"#1A2230",borderRadius:3,borderTop:"4px solid #1152D4",p:{xs:3,sm:3.5,md:4},maxWidth:450,width:"100%",textAlign:"center",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.5)"},children:[r.jsx(E,{sx:{width:56,height:56,bgcolor:"#1152D4",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",mx:"auto",mb:3},children:r.jsx(hte,{sx:{fontSize:28,color:"#FFFFFF"}})}),r.jsx(C,{variant:"h5",sx:{fontWeight:700,color:"#FFFFFF",fontSize:{xs:"1.25rem",md:"1.5rem"},mb:1.5},children:"Forgot your password?"}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.875rem",mb:3,lineHeight:1.6},children:"No worries. Enter the email address associated with your Integritas Hub account, and we'll send you a 6-digit OTP to reset your password."}),k&&r.jsx(Wt,{severity:"error",sx:{mb:3,bgcolor:"rgba(239, 68, 68, 0.1)",color:"#EF4444",border:"1px solid rgba(239, 68, 68, 0.2)","& .MuiAlert-icon":{color:"#EF4444"}},onClose:()=>L(""),children:k}),d?y?M?r.jsx(E,{sx:{py:2},children:r.jsx(Wt,{severity:"success",sx:{bgcolor:"rgba(16, 185, 129, 0.1)",color:"#10B981",border:"1px solid rgba(16, 185, 129, 0.2)","& .MuiAlert-icon":{color:"#10B981"}},children:r.jsx(C,{sx:{color:"#10B981",fontSize:"0.9rem",fontWeight:500},children:"✓ Password reset successfully! Redirecting to login..."})})}):r.jsxs(E,{children:[r.jsx(Wt,{severity:"success",sx:{mb:3,bgcolor:"rgba(16, 185, 129, 0.1)",color:"#10B981",border:"1px solid rgba(16, 185, 129, 0.2)","& .MuiAlert-icon":{color:"#10B981"}},children:r.jsx(C,{sx:{color:"#10B981",fontSize:"0.875rem",fontWeight:500},children:"✓ OTP verified successfully! Please enter your new password."})}),r.jsxs(E,{component:"form",onSubmit:fe,children:[r.jsxs(E,{sx:{mb:2.5,textAlign:"left"},children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"New Password"}),r.jsx(it,{fullWidth:!0,type:_?"text":"password",placeholder:"Enter new password",value:I,onChange:se=>B(se.target.value),size:"small",autoComplete:"off",InputProps:{endAdornment:r.jsx(Ar,{position:"end",children:r.jsx(Ve,{onClick:()=>z(!_),edge:"end",size:"small",sx:{color:"#9CA3AF"},children:_?r.jsx(xg,{fontSize:"small"}):r.jsx(Bi,{fontSize:"small"})})})},sx:{"& .MuiOutlinedInput-root":{bgcolor:"#0C1322",borderRadius:1.5,"& fieldset":{border:"none"},"&:hover fieldset":{border:"none"},"&.Mui-focused fieldset":{border:"2px solid #1152D4"}},"& .MuiInputBase-input":{py:1.5,fontSize:"0.875rem",color:"#FFFFFF",border:"none","&::placeholder":{color:"#6B7280",opacity:1}}}})]}),r.jsxs(E,{sx:{mb:3,textAlign:"left"},children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Confirm New Password"}),r.jsx(it,{fullWidth:!0,type:F?"text":"password",placeholder:"Confirm new password",value:H,onChange:se=>P(se.target.value),size:"small",autoComplete:"off",InputProps:{endAdornment:r.jsx(Ar,{position:"end",children:r.jsx(Ve,{onClick:()=>N(!F),edge:"end",size:"small",sx:{color:"#9CA3AF"},children:F?r.jsx(xg,{fontSize:"small"}):r.jsx(Bi,{fontSize:"small"})})})},sx:{"& .MuiOutlinedInput-root":{bgcolor:"#0C1322",borderRadius:1.5,"& fieldset":{border:"none"},"&:hover fieldset":{border:"none"},"&.Mui-focused fieldset":{border:"2px solid #1152D4"}},"& .MuiInputBase-input":{py:1.5,fontSize:"0.875rem",color:"#FFFFFF",border:"none","&::placeholder":{color:"#6B7280",opacity:1}}}})]}),r.jsx(ye,{type:"submit",fullWidth:!0,variant:"contained",disabled:!I||!H||j,endIcon:r.jsx(Oi,{}),sx:{bgcolor:"#1152D4",color:"#FFFFFF",py:1.5,textTransform:"none",fontWeight:600,fontSize:"0.9rem",borderRadius:1.5,boxShadow:"none","&:hover":{bgcolor:"#0D41AA",boxShadow:"0 4px 12px rgba(17, 82, 212, 0.3)"},"&:disabled":{bgcolor:"#374151",color:"#6B7280"}},children:j?"Resetting Password...":"Reset Password"})]})]}):r.jsxs(E,{children:[r.jsx(Wt,{severity:"success",sx:{mb:3,bgcolor:"rgba(16, 185, 129, 0.1)",color:"#10B981",border:"1px solid rgba(16, 185, 129, 0.2)","& .MuiAlert-icon":{color:"#10B981"}},children:r.jsxs(C,{sx:{color:"#10B981",fontSize:"0.875rem",fontWeight:500},children:["✓ OTP sent to ",o,". Enter the 6-digit code below. Expires in ",q(O),"."]})}),r.jsxs(E,{component:"form",onSubmit:re,children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:2,textAlign:"left"},children:"Enter OTP Code"}),r.jsx(G,{direction:"row",spacing:{xs:1,sm:1.5},justifyContent:"center",sx:{mb:3},children:p.map((se,J)=>r.jsx(it,{inputRef:ce=>D.current[J]=ce,value:se,onChange:ce=>K(J,ce.target.value),onKeyDown:ce=>Y(J,ce),onPaste:J===0?ie:void 0,inputProps:{maxLength:1,style:{textAlign:"center",fontSize:"1.25rem",fontWeight:600,padding:"14px 0"}},sx:{width:{xs:44,sm:48},"& .MuiOutlinedInput-root":{bgcolor:"#0C1322",borderRadius:1.5,"& fieldset":{border:"none"},"&:hover fieldset":{border:"none"},"&.Mui-focused fieldset":{border:"2px solid #1152D4"}},"& .MuiInputBase-input":{color:"#FFFFFF",border:"none"}}},J))}),r.jsx(ye,{type:"submit",fullWidth:!0,variant:"contained",disabled:!ue||x,endIcon:r.jsx(Oi,{}),sx:{bgcolor:"#1152D4",color:"#FFFFFF",py:1.5,textTransform:"none",fontWeight:600,fontSize:"0.9rem",borderRadius:1.5,boxShadow:"none","&:hover":{bgcolor:"#0D41AA",boxShadow:"0 4px 12px rgba(17, 82, 212, 0.3)"},"&:disabled":{bgcolor:"#374151",color:"#6B7280"}},children:x?"Verifying...":"Verify OTP"})]})]}):r.jsxs(E,{component:"form",onSubmit:V,children:[r.jsxs(E,{sx:{mb:3,textAlign:"left"},children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Email Address"}),r.jsx(it,{fullWidth:!0,type:"email",placeholder:"name@governancehub.org",value:o,onChange:se=>a(se.target.value),size:"small",autoComplete:"off",sx:{"& .MuiOutlinedInput-root":{bgcolor:"#0C1322",borderRadius:1.5,"& fieldset":{border:"none"},"&:hover fieldset":{border:"none"},"&.Mui-focused fieldset":{border:"2px solid #1152D4"}},"& .MuiInputBase-input":{py:1.5,fontSize:"0.875rem",color:"#FFFFFF",border:"none","&::placeholder":{color:"#6B7280",opacity:1}}}})]}),r.jsx(ye,{type:"submit",fullWidth:!0,variant:"contained",disabled:!ae||l,sx:{bgcolor:"#1152D4",color:"#FFFFFF",py:1.5,textTransform:"none",fontWeight:600,fontSize:"0.9rem",borderRadius:1.5,boxShadow:"none","&:hover":{bgcolor:"#0D41AA",boxShadow:"0 4px 12px rgba(17, 82, 212, 0.3)"},"&:disabled":{bgcolor:"#374151",color:"#6B7280"}},children:l?"Sending...":"Send OTP"})]}),r.jsx(E,{sx:{mt:3,pt:3,borderTop:"1px solid #374151"},children:r.jsxs(yn,{to:"/login",style:{display:"inline-flex",alignItems:"center",gap:"6px",fontSize:"0.875rem",color:"#3B82F6",textDecoration:"none",fontWeight:500},children:[r.jsx(fa,{sx:{fontSize:16}}),"Return to Log In"]})})]}),r.jsxs(G,{direction:"row",spacing:4,sx:{mt:4},children:[r.jsx(C,{component:yn,to:"/help",sx:{fontSize:"0.875rem",color:"#6B7280",textDecoration:"none","&:hover":{color:"#9CA3AF"}},children:"Need help?"}),r.jsx(C,{component:yn,to:"/contact",sx:{fontSize:"0.875rem",color:"#6B7280",textDecoration:"none","&:hover":{color:"#9CA3AF"}},children:"Contact support"})]})]})},j8=["token","invitation_token","invite_token"],bne=()=>{try{const e=localStorage.getItem("user");if(!e)return"";const t=JSON.parse(e);return String(t?.token||"").trim()}catch{return""}},yne=e=>{const t=typeof window<"u"?String(window.location.search||""):"";for(const n of j8){const s=t.match(new RegExp(`[?&]${n}=([^&#]+)`));if(s?.[1])try{return decodeURIComponent(s[1]).trim()}catch{return String(s[1]).trim()}}for(const n of j8){const s=String(e.get(n)||"").trim();if(s)return s}return""},C8=(e,t)=>{const n=encodeURIComponent(String(t||"").trim());return`${e}?token=${n}`},w8=(e={},t)=>{const n=String(t||"").trim(),s={...e,token:n,invitation_token:n,invite_token:n,invitation:n};return/^\d+$/.test(n)&&(s.invitation_id=n,s.id=n),s},vne=e=>{const t=Number(e?.status||0);if(t===404||t===405)return!0;const n=String(e?.message||"").toLowerCase();return n.includes("invalid invite token")||n.includes("no query results")},A8=e=>{const t=[e],n=new Set;for(;t.length>0;){const s=t.shift();if(!s||typeof s!="object"||n.has(s))continue;n.add(s);const o=String(s?.organization_name||s?.organizationName||s?.org_name||"").trim();if(o)return o;const a=String(s?.organization?.name||s?.org?.name||"").trim();if(a)return a;Object.values(s).forEach(l=>{l&&typeof l=="object"&&t.push(l)})}return""},E8=async(e=[])=>{let t=null;for(const n of e)try{return await ke.post(n.endpoint,n.payload)}catch(s){if(t=s,!vne(s))throw s}throw t},a5=()=>{const e=Dn(),[t]=Oj(),n=v.useMemo(()=>yne(t),[t]),s=!!bne(),[o,a]=v.useState(!1),[l,u]=v.useState(""),[d,f]=v.useState(""),[p,g]=v.useState({name:"",password:""}),x=S=>{const{name:j,value:A}=S.target;g(M=>({...M,[j]:A}))},b=async()=>{if(!n){u("Invitation token is missing in the URL.");return}a(!0),u(""),f("");try{const S=w8({},n),j=await E8([{endpoint:"/org-invitations/public/accept",payload:S},{endpoint:C8("/org-invitations/public/accept",n),payload:S}]),A=A8(j);f(A?`Invite accepted for ${A}. Redirecting to organization...`:"Invite accepted. Redirecting to organization..."),setTimeout(()=>{window.location.assign("/learner/organization")},600)}catch(S){console.error("Failed to accept invitation (logged in):",S),u(S?.message||"Failed to accept invitation.")}finally{a(!1)}},y=async S=>{if(S.preventDefault(),!n){u("Invitation token is missing in the URL.");return}if(!String(p.name||"").trim()||!String(p.password||"").trim()){u("Name and password are required.");return}a(!0),u(""),f("");try{const j={name:String(p.name||"").trim(),password:p.password},A=w8(j,n),M=await E8([{endpoint:"/org-invitations/public/accept",payload:A},{endpoint:C8("/org-invitations/public/accept",n),payload:A}]),R=A8(M);f(R?`Invite accepted for ${R}. You can now log in with the invited email and password.`:"Invite accepted. You can now log in with the invited email and password."),setTimeout(()=>e("/login",{replace:!0}),900)}catch(j){console.error("Failed to accept invitation (public):",j),u(j?.message||"Failed to accept invitation.")}finally{a(!1)}};return r.jsx(E,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"#0C1322",p:2},children:r.jsx(Je,{sx:{width:"100%",maxWidth:520,bgcolor:"#1A2230",border:"1px solid #374151",borderRadius:3,p:{xs:3,md:4}},children:r.jsxs(G,{spacing:2.25,children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h5",sx:{color:"#fff",fontWeight:700,mb:.5},children:"Accept Organization Invitation"}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.9rem"},children:"This page reads your invitation token from the URL link."})]}),!n&&r.jsx(Wt,{severity:"error",children:"No invitation token was found in this link."}),l&&r.jsx(Wt,{severity:"error",children:l}),d&&r.jsx(Wt,{severity:"success",children:d}),s?r.jsxs(r.Fragment,{children:[r.jsx(Wt,{severity:"info",sx:{bgcolor:"rgba(59,130,246,0.12)",color:"#BFDBFE"},children:"You are signed in. Accepting now will link this account to the invited organization."}),r.jsx(ye,{variant:"contained",onClick:b,disabled:o||!n,sx:{bgcolor:"#1152D4",textTransform:"none",py:1.2,"&:hover":{bgcolor:"#0E46B5"}},children:o?r.jsx(nn,{size:22,sx:{color:"#fff"}}):"Accept Invite"})]}):r.jsx(E,{component:"form",onSubmit:y,children:r.jsxs(G,{spacing:2,children:[r.jsx(it,{label:"Full Name",name:"name",value:p.name,onChange:x,fullWidth:!0,disabled:o,sx:{"& .MuiOutlinedInput-root":{bgcolor:"#1F2937",color:"#fff","& fieldset":{borderColor:"#374151"},"&:hover fieldset":{borderColor:"#4B5563"},"&.Mui-focused fieldset":{borderColor:"#1152D4"}},"& .MuiInputLabel-root":{color:"#9CA3AF"}}}),r.jsx(it,{label:"Password",name:"password",type:"password",value:p.password,onChange:x,fullWidth:!0,disabled:o,sx:{"& .MuiOutlinedInput-root":{bgcolor:"#1F2937",color:"#fff","& fieldset":{borderColor:"#374151"},"&:hover fieldset":{borderColor:"#4B5563"},"&.Mui-focused fieldset":{borderColor:"#1152D4"}},"& .MuiInputLabel-root":{color:"#9CA3AF"}}}),r.jsx(ye,{type:"submit",variant:"contained",disabled:o||!n,sx:{bgcolor:"#1152D4",textTransform:"none",py:1.2,"&:hover":{bgcolor:"#0E46B5"}},children:o?r.jsx(nn,{size:22,sx:{color:"#fff"}}):"Accept Invite"})]})})]})})})},Sne=e=>({bgDark:e?"#0C1322":"#FFFFFF",bgDarker:e?"#080D19":"#F8FAFC",bgCard:e?"#111827":"#FFFFFF",primary:"rgba(17, 82, 212, 1)",primaryHover:"rgba(13, 65, 170, 1)",primaryLight:"rgba(17, 82, 212, 0.1)",textWhite:e?"#FFFFFF":"#1E293B",textLight:e?"#F3F4F6":"#334155",textMuted:e?"#9CA3AF":"#64748B",border:e?"#1F2937":"#E2E8F0",borderLight:e?"#374151":"#CBD5E1",inputBg:e?"#1F2937":"#F8FAFC"}),jne=["Sales Inquiry","Partnership Opportunity","Technical Support","General Question","Course Information","Other"],Cne=[{icon:r.jsx(Xee,{}),label:"Email",value:"contact@integritashub.com"},{icon:r.jsx(Ste,{}),label:"Phone",value:"+234 800 000 0000"},{icon:r.jsx(fte,{}),label:"Address",value:"Abuja, Nigeria"}],wne=()=>{const{isDark:e}=Fl(),t=Sne(e),[n,s]=v.useState({firstName:"",lastName:"",email:"",organization:"",inquiryType:"",message:""}),[o,a]=v.useState({}),[l,u]=v.useState(!1),[d,f]=v.useState(!1),p=()=>{const S={};return n.firstName.trim()||(S.firstName="First name is required"),n.lastName.trim()||(S.lastName="Last name is required"),n.email.trim()?/\S+@\S+\.\S+/.test(n.email)||(S.email="Enter a valid email address"):S.email="Email is required",n.inquiryType||(S.inquiryType="Please select an inquiry type"),n.message.trim()||(S.message="Message is required"),S},g=S=>{const{name:j,value:A}=S.target;s(M=>({...M,[j]:A})),o[j]&&a(M=>({...M,[j]:""}))},x=S=>{S.preventDefault();const j=p();if(Object.keys(j).length>0){a(j);return}u(!0),f(!0),s({firstName:"",lastName:"",email:"",organization:"",inquiryType:"",message:""}),a({})},b=S=>r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:t.textMuted,mb:.75},children:S}),y={"& .MuiFilledInput-root":{borderRadius:2,backgroundColor:t.inputBg,border:"none","&:hover":{backgroundColor:t.inputBg},"&.Mui-focused":{backgroundColor:t.inputBg},"& input:-webkit-autofill":{WebkitBoxShadow:`0 0 0 100px ${t.inputBg} inset`,WebkitTextFillColor:t.textWhite}},"& .MuiInputBase-input":{color:t.textWhite,pt:1.5,pb:1.5},"& .MuiInputBase-input::placeholder":{color:t.textMuted,opacity:1},"& .MuiSvgIcon-root":{color:t.textMuted},"& .MuiFormHelperText-root":{color:"#EF4444",mx:0}};return r.jsxs(E,{sx:{minHeight:"100vh",bgcolor:t.bgDark,color:t.textWhite},children:[r.jsx(om,{}),r.jsxs(E,{sx:{py:{xs:8,md:12},px:{xs:2,md:4,lg:6},background:e?"linear-gradient(135deg, rgba(40,46,57,1) 0%, rgba(20,25,35,1) 100%)":"linear-gradient(135deg, #F8FAFC 0%, #EEF2FF 100%)",textAlign:"center"},children:[r.jsxs(C,{variant:"h1",sx:{fontSize:{xs:"2rem",md:"3rem"},fontWeight:800,mb:2,color:t.textWhite},children:["Contact"," ",r.jsx(E,{component:"span",sx:{color:t.primary},children:"Sales"})]}),r.jsx(C,{sx:{fontSize:"1.125rem",color:t.textMuted,maxWidth:520,mx:"auto",lineHeight:1.7},children:"Interested in Integritas Hub for your organization? Our team is ready to help you find the right solution for your public service training needs."})]}),r.jsx(Zs,{maxWidth:"lg",sx:{py:{xs:6,md:10}},children:r.jsxs(G,{direction:{xs:"column",md:"row"},spacing:{xs:6,md:8},alignItems:"flex-start",children:[r.jsxs(E,{sx:{flex:"0 0 auto",width:{xs:"100%",md:280}},children:[r.jsx(C,{sx:{fontSize:"1.25rem",fontWeight:700,mb:3,color:t.textWhite},children:"Get in Touch"}),r.jsx(G,{spacing:3,children:Cne.map(S=>r.jsxs(G,{direction:"row",spacing:2,alignItems:"flex-start",children:[r.jsx(E,{sx:{width:44,height:44,borderRadius:2,bgcolor:t.primaryLight,display:"flex",alignItems:"center",justifyContent:"center",color:t.primary,flexShrink:0},children:S.icon}),r.jsxs(E,{children:[r.jsx(C,{sx:{fontSize:"0.75rem",fontWeight:600,color:t.textMuted,textTransform:"uppercase",letterSpacing:"0.05em",mb:.25},children:S.label}),r.jsx(C,{sx:{fontSize:"0.9375rem",color:t.textWhite},children:S.value})]})]},S.label))})]}),r.jsxs(E,{component:"form",onSubmit:x,sx:{flex:1,bgcolor:t.bgCard,border:`1px solid ${t.border}`,borderRadius:3,p:{xs:3,md:5}},children:[r.jsx(C,{sx:{fontSize:"1.25rem",fontWeight:700,mb:4,color:t.textWhite},children:"Send Us a Message"}),r.jsxs(G,{spacing:3,children:[r.jsxs(G,{direction:{xs:"column",sm:"row"},spacing:2,children:[r.jsxs(E,{sx:{flex:1},children:[b("First Name"),r.jsx(it,{variant:"filled",InputProps:{disableUnderline:!0},placeholder:"First Name",name:"firstName",value:n.firstName,onChange:g,error:!!o.firstName,helperText:o.firstName,fullWidth:!0,sx:y})]}),r.jsxs(E,{sx:{flex:1},children:[b("Last Name"),r.jsx(it,{variant:"filled",InputProps:{disableUnderline:!0},placeholder:"Last Name",name:"lastName",value:n.lastName,onChange:g,error:!!o.lastName,helperText:o.lastName,fullWidth:!0,sx:y})]})]}),r.jsxs(E,{children:[b("Email"),r.jsx(it,{variant:"filled",InputProps:{disableUnderline:!0},placeholder:"you@example.com",name:"email",type:"email",value:n.email,onChange:g,error:!!o.email,helperText:o.email,fullWidth:!0,sx:y})]}),r.jsxs(E,{children:[b("Organization (optional)"),r.jsx(it,{variant:"filled",InputProps:{disableUnderline:!0},placeholder:"Your organization",name:"organization",value:n.organization,onChange:g,fullWidth:!0,sx:y})]}),r.jsxs(E,{children:[b("Inquiry Type"),r.jsx(it,{select:!0,variant:"filled",name:"inquiryType",value:n.inquiryType,onChange:g,error:!!o.inquiryType,helperText:o.inquiryType,fullWidth:!0,sx:y,InputProps:{disableUnderline:!0},SelectProps:{displayEmpty:!0,renderValue:S=>S||r.jsx("span",{style:{color:t.textMuted},children:"Select inquiry type"}),MenuProps:{PaperProps:{sx:{bgcolor:t.bgCard,border:`1px solid ${t.border}`,"& .MuiMenuItem-root":{color:t.textWhite,"&:hover":{bgcolor:t.primaryLight},"&.Mui-selected":{bgcolor:t.primaryLight}}}}}},children:jne.map(S=>r.jsx(It,{value:S,children:S},S))})]}),r.jsxs(E,{children:[b("Message"),r.jsx(it,{variant:"filled",InputProps:{disableUnderline:!0},placeholder:"Tell us how we can help...",name:"message",value:n.message,onChange:g,error:!!o.message,helperText:o.message,fullWidth:!0,multiline:!0,rows:5,sx:y})]}),r.jsx(ye,{type:"submit",variant:"contained",size:"large",endIcon:r.jsx(Rb,{}),sx:{bgcolor:t.primary,"&:hover":{bgcolor:t.primaryHover,color:"#FFFFFF"},textTransform:"none",fontWeight:600,py:1.5,borderRadius:2,alignSelf:"flex-start",px:4},children:"Send Message"})]})]})]})}),r.jsx(im,{}),r.jsx(gs,{open:d,autoHideDuration:6e3,onClose:()=>f(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:r.jsx(Wt,{onClose:()=>f(!1),severity:"success",sx:{width:"100%"},children:"Your message has been sent! We'll get back to you shortly."})})]})},dp=260,Ane=({mobileOpen:e=!1,onDrawerClose:t=()=>{}})=>{const n=Nr(),s=Dn(),o=On(),a=Yu(o.breakpoints.down("md")),[l,u]=Er.useState(""),{logout:d}=ps(),f=async()=>{try{await d(),s("/login")}catch(y){console.error("Logout error:",y),s("/login")}},p=[{path:"/admin",label:"Dashboard",icon:r.jsx(rz,{sx:{fontSize:22}})},{label:"User Management",icon:r.jsx(vte,{sx:{fontSize:22}}),children:[{path:"/admin/users/staff",label:"Staff"},{path:"/admin/users/learners",label:"Learners"},{path:"/admin/users/tutors",label:"Tutors"},{path:"/admin/users/reviewers",label:"Reviewers"}]},{label:"Course Management",icon:r.jsx(AC,{sx:{fontSize:22}}),children:[{path:"/admin/content/courses",label:"Courses"},{path:"/admin/content/essential-courses",label:"Essential Courses"},{path:"/admin/content/categories",label:"Categories"},{path:"/admin/content/price-changes",label:"Price Changes"}]},{path:"/admin/kycreview",label:"KYC Review",icon:r.jsx(p8,{sx:{fontSize:22}})},{path:"/admin/analytics",label:"Analytics",icon:r.jsx(Pee,{sx:{fontSize:22}})},{path:"/admin/verifications",label:"Verifications",icon:r.jsx(p8,{sx:{fontSize:22}})},{path:"/admin/settings",label:"Settings",icon:r.jsx(zte,{sx:{fontSize:22}})}],g=y=>y==="/admin"?n.pathname==="/admin":n.pathname.startsWith(y),x=y=>{y.children?u(l===y.label?"":y.label):(s(y.path),a&&t())},b=r.jsxs(E,{sx:{width:dp,minWidth:dp,maxWidth:dp,bgcolor:"#0F1729",borderRight:"1px solid #1F2937",display:"flex",flexDirection:"column",height:"100%",overflowX:"hidden"},children:[r.jsx(E,{sx:{p:2.5},children:r.jsxs(G,{component:yn,to:"/",direction:"row",alignItems:"center",spacing:1.5,sx:{textDecoration:"none"},children:[r.jsx(E,{component:"img",src:"/src/assets/images/GGH_icon.png",alt:"Integritas Hub Logo",sx:{height:50,width:50}}),r.jsxs(E,{children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:600,color:"#FFFFFF",lineHeight:1.2},children:"Integritas Hub"}),r.jsx(C,{sx:{fontSize:"0.75rem",color:"#6B7280"},children:"Admin Portal"})]})]})}),r.jsx(E,{sx:{flex:1,py:2,overflow:"auto"},children:r.jsx(Hs,{sx:{px:0},children:p.map(y=>r.jsxs(Er.Fragment,{children:[r.jsx(Ii,{disablePadding:!0,sx:{mb:.5},children:r.jsxs(Jo,{onClick:()=>x(y),sx:{borderRadius:1.5,py:1.5,px:2,bgcolor:y.path&&g(y.path)||y.children&&l===y.label?"#1152D4":"transparent","&:hover":{bgcolor:y.path&&g(y.path)||y.children&&l===y.label?"#1152D4":"rgba(17, 82, 212, 0.1)"},justifyContent:"space-between"},children:[r.jsxs(E,{sx:{display:"flex",alignItems:"center"},children:[r.jsx(Tl,{sx:{minWidth:40,color:y.path&&g(y.path)||y.children&&l===y.label?"#FFFFFF":"#6B7280"},children:y.icon}),r.jsx(Js,{primary:y.label,primaryTypographyProps:{fontSize:"0.9rem",fontWeight:y.path&&g(y.path)||y.children&&l===y.label?600:400,color:y.path&&g(y.path)||y.children&&l===y.label?"#FFFFFF":"#9CA3AF"}})]}),y.children&&(l===y.label?r.jsx(em,{sx:{color:"#fff"}}):r.jsx(ti,{sx:{color:"#9CA3AF"}}))]})}),y.children&&r.jsx(Al,{in:l===y.label,timeout:"auto",unmountOnExit:!0,children:r.jsx(Hs,{component:"div",disablePadding:!0,children:y.children.map(S=>r.jsx(Jo,{onClick:()=>x(S),sx:{pl:9,borderRadius:1.5,mb:.5,bgcolor:g(S.path)?"rgba(17, 82, 212, 0.15)":"transparent","&:hover":{bgcolor:g(S.path)?"rgba(17, 82, 212, 0.15)":"rgba(17, 82, 212, 0.05)"}},children:r.jsx(Js,{primary:S.label,primaryTypographyProps:{fontSize:"0.85rem",color:g(S.path)?"#1152D4":"#9CA3AF",fontWeight:g(S.path)?600:400}})},S.label))})})]},y.label))})}),r.jsx(E,{sx:{p:2,borderTop:"1px solid #1F2937"},children:r.jsx(ye,{fullWidth:!0,onClick:f,startIcon:r.jsx(cz,{}),sx:{justifyContent:"flex-start",color:"#EF4444",py:1.5,px:2,borderRadius:1.5,textTransform:"none",fontSize:"0.9rem",fontWeight:500,"&:hover":{bgcolor:"rgba(239, 68, 68, 0.1)"}},children:"Logout"})})]});return r.jsxs(r.Fragment,{children:[r.jsx(Ou,{variant:"temporary",open:e,onClose:t,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:dp,bgcolor:"#0F1729",border:"none",overflowX:"hidden"}},children:b}),r.jsx(Ou,{variant:"permanent",sx:{display:{xs:"none",md:"block"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:dp,bgcolor:"#0F1729",border:"none",borderRight:"1px solid #1F2937",overflowX:"hidden"}},open:!0,children:b})]})},Ene=({onDrawerToggle:e=()=>{}})=>{const t=On(),n=Yu(t.breakpoints.down("md")),{isDark:s,toggleThemeMode:o}=Fl(),[a,l]=v.useState(""),{user:u}=ps(),f=(u?.name||u?.first_name||"Admin").split(" ").map(p=>p[0]).join("").toUpperCase().slice(0,2)||"AD";return r.jsxs(E,{sx:{height:70,bgcolor:"#0F1729",borderBottom:"1px solid #1F2937",display:"flex",alignItems:"center",justifyContent:"space-between",px:{xs:2,md:4},overflow:"hidden"},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:{xs:1,md:3},children:[r.jsx(Ve,{onClick:e,sx:{display:{xs:"flex",md:"none"},color:"#FFFFFF",mr:1},children:r.jsx(tm,{})}),r.jsx(C,{sx:{color:"#FFFFFF",fontWeight:600,fontSize:{xs:"1rem",md:"1.1rem"}},children:"Admin Dashboard"}),!n&&r.jsxs(E,{sx:{bgcolor:"#1F2937",borderRadius:1,px:2,display:{xs:"none",sm:"flex"},alignItems:"center",gap:1,width:"260px",height:"40px"},children:[r.jsx(to,{sx:{color:"#9CA3AF",fontSize:20}}),r.jsx(sr,{placeholder:"Search users, courses...",value:a,onChange:p=>l(p.target.value),sx:{color:"#FFFFFF",fontSize:"0.9rem",width:"100%","& input":{border:"none",outline:"none","&:focus":{border:"none",outline:"none"}}}})]})]}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,children:[r.jsx(Ve,{onClick:o,sx:{color:"#6B7280","&:hover":{color:"#FFFFFF",bgcolor:"rgba(255,255,255,0.05)"}},children:s?r.jsx(Mf,{fontSize:"small"}):r.jsx(Tf,{fontSize:"small"})}),r.jsx(Ve,{sx:{color:"#6B7280","&:hover":{bgcolor:"rgba(255,255,255,0.05)"}},children:r.jsx(mC,{badgeContent:5,color:"error",children:r.jsx(dz,{sx:{fontSize:24}})})}),r.jsx(yr,{sx:{width:40,height:40,bgcolor:"#1152D4",ml:1,cursor:"pointer",fontSize:"0.9rem",fontWeight:600},children:f})]})]})},T8=260,Tne=()=>{const[e,t]=v.useState(!1),n=()=>{t(!e)},s=()=>{t(!1)};return r.jsxs(E,{sx:{display:"flex",minHeight:"100vh",bgcolor:"#0C1322",overflowX:"hidden"},children:[r.jsx(Ane,{mobileOpen:e,onDrawerClose:s}),r.jsxs(E,{sx:{marginLeft:{xs:0,md:`${T8}px`},width:{xs:"100%",md:`calc(100% - ${T8}px)`},display:"flex",flexDirection:"column",minHeight:"100vh",overflowX:"hidden"},children:[r.jsx(E,{sx:{position:"sticky",top:0,zIndex:100},children:r.jsx(Ene,{onDrawerToggle:n})}),r.jsx(E,{sx:{flex:1,overflowX:"hidden",overflowY:"auto"},children:r.jsx(Fj,{})})]})]})};var u1=Symbol("NOT_FOUND");function kne(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Mne(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Rne(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(s=>typeof s=="function"?`function ${s.name||"unnamed"}()`:typeof s).join(", ");throw new TypeError(`${t}[${n}]`)}}var k8=e=>Array.isArray(e)?e:[e];function zne(e){const t=Array.isArray(e[0])?e[0]:e;return Rne(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Ine(e,t){const n=[],{length:s}=e;for(let o=0;o<s;o++)n.push(e[o].apply(null,t));return n}function Fne(e){let t;return{get(n){return t&&e(t.key,n)?t.value:u1},put(n,s){t={key:n,value:s}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function _ne(e,t){let n=[];function s(u){const d=n.findIndex(f=>t(u,f.key));if(d>-1){const f=n[d];return d>0&&(n.splice(d,1),n.unshift(f)),f.value}return u1}function o(u,d){s(u)===u1&&(n.unshift({key:u,value:d}),n.length>e&&n.pop())}function a(){return n}function l(){n=[]}return{get:s,put:o,getEntries:a,clear:l}}var Lne=(e,t)=>e===t;function Pne(e){return function(n,s){if(n===null||s===null||n.length!==s.length)return!1;const{length:o}=n;for(let a=0;a<o;a++)if(!e(n[a],s[a]))return!1;return!0}}function Dne(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:s=Lne,maxSize:o=1,resultEqualityCheck:a}=n,l=Pne(s);let u=0;const d=o<=1?Fne(l):_ne(o,l);function f(){let p=d.get(arguments);if(p===u1){if(p=e.apply(null,arguments),u++,a){const x=d.getEntries().find(b=>a(b.value,p));x&&(p=x.value,u!==0&&u--)}d.put(arguments,p)}return p}return f.clearCache=()=>{d.clear(),f.resetResultsCount()},f.resultsCount=()=>u,f.resetResultsCount=()=>{u=0},f}var One=class{constructor(e){this.value=e}deref(){return this.value}},Bne=typeof WeakRef<"u"?WeakRef:One,Nne=0,M8=1;function r0(){return{s:Nne,v:void 0,o:null,p:null}}function Ez(e,t={}){let n=r0();const{resultEqualityCheck:s}=t;let o,a=0;function l(){let u=n;const{length:d}=arguments;for(let g=0,x=d;g<x;g++){const b=arguments[g];if(typeof b=="function"||typeof b=="object"&&b!==null){let y=u.o;y===null&&(u.o=y=new WeakMap);const S=y.get(b);S===void 0?(u=r0(),y.set(b,u)):u=S}else{let y=u.p;y===null&&(u.p=y=new Map);const S=y.get(b);S===void 0?(u=r0(),y.set(b,u)):u=S}}const f=u;let p;if(u.s===M8)p=u.v;else if(p=e.apply(null,arguments),a++,s){const g=o?.deref?.()??o;g!=null&&s(g,p)&&(p=g,a!==0&&a--),o=typeof p=="object"&&p!==null||typeof p=="function"?new Bne(p):p}return f.s=M8,f.v=p,p}return l.clearCache=()=>{n=r0(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function Tz(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,s=(...o)=>{let a=0,l=0,u,d={},f=o.pop();typeof f=="object"&&(d=f,f=o.pop()),kne(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const p={...n,...d},{memoize:g,memoizeOptions:x=[],argsMemoize:b=Ez,argsMemoizeOptions:y=[]}=p,S=k8(x),j=k8(y),A=zne(o),M=g(function(){return a++,f.apply(null,arguments)},...S),R=b(function(){l++;const z=Ine(A,arguments);return u=M.apply(null,z),u},...j);return Object.assign(R,{resultFunc:f,memoizedResultFunc:M,dependencies:A,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>u,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:g,argsMemoize:b})};return Object.assign(s,{withTypes:()=>s}),s}var $ne=Tz(Ez),Hne=Object.assign((e,t=$ne)=>{Mne(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),s=n.map(a=>e[a]);return t(s,(...a)=>a.reduce((l,u,d)=>(l[n[d]]=u,l),{}))},{withTypes:()=>Hne});const Wne=Tz({memoize:Dne,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),Ct=(e,t,n,s,o,a,l,u,...d)=>{if(d.length>0)throw new Error("Unsupported number of selectors");let f;if(e&&t&&n&&s&&o&&a&&l&&u)f=(p,g,x,b)=>{const y=e(p,g,x,b),S=t(p,g,x,b),j=n(p,g,x,b),A=s(p,g,x,b),M=o(p,g,x,b),R=a(p,g,x,b),_=l(p,g,x,b);return u(y,S,j,A,M,R,_,g,x,b)};else if(e&&t&&n&&s&&o&&a&&l)f=(p,g,x,b)=>{const y=e(p,g,x,b),S=t(p,g,x,b),j=n(p,g,x,b),A=s(p,g,x,b),M=o(p,g,x,b),R=a(p,g,x,b);return l(y,S,j,A,M,R,g,x,b)};else if(e&&t&&n&&s&&o&&a)f=(p,g,x,b)=>{const y=e(p,g,x,b),S=t(p,g,x,b),j=n(p,g,x,b),A=s(p,g,x,b),M=o(p,g,x,b);return a(y,S,j,A,M,g,x,b)};else if(e&&t&&n&&s&&o)f=(p,g,x,b)=>{const y=e(p,g,x,b),S=t(p,g,x,b),j=n(p,g,x,b),A=s(p,g,x,b);return o(y,S,j,A,g,x,b)};else if(e&&t&&n&&s)f=(p,g,x,b)=>{const y=e(p,g,x,b),S=t(p,g,x,b),j=n(p,g,x,b);return s(y,S,j,g,x,b)};else if(e&&t&&n)f=(p,g,x,b)=>{const y=e(p,g,x,b),S=t(p,g,x,b);return n(y,S,g,x,b)};else if(e&&t)f=(p,g,x,b)=>{const y=e(p,g,x,b);return t(y,g,x,b)};else if(e)f=e;else throw new Error("Missing arguments");return f},Ib=e=>(...t)=>{const n=new WeakMap;let s=1;const o=t[t.length-1],a=t.length-1||1,l=Math.max(o.length-a,0);if(l>3)throw new Error("Unsupported number of arguments");return(d,f,p,g)=>{let x=d.__cacheKey__;x||(x={id:s},d.__cacheKey__=x,s+=1);let b=n.get(x);if(!b){const y=t.length===1?[A=>A,o]:t;let S=t;const j=[void 0,void 0,void 0];switch(l){case 0:break;case 1:{S=[...y.slice(0,-1),()=>j[0],o];break}case 2:{S=[...y.slice(0,-1),()=>j[0],()=>j[1],o];break}case 3:{S=[...y.slice(0,-1),()=>j[0],()=>j[1],()=>j[2],o];break}default:throw new Error("Unsupported number of arguments")}e&&(S=[...S,e]),b=Wne(...S),b.selectorArgs=j,n.set(x,b)}switch(l){case 3:b.selectorArgs[2]=g;case 2:b.selectorArgs[1]=p;case 1:b.selectorArgs[0]=f}switch(l){case 0:return b(d);case 1:return b(d,f);case 2:return b(d,f,p);case 3:return b(d,f,p,g);default:throw new Error("unreachable")}}},qn=Ib();var l5={exports:{}},c5={};var R8;function Une(){if(R8)return c5;R8=1;var e=Fg();function t(g,x){return g===x&&(g!==0||1/g===1/x)||g!==g&&x!==x}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function u(g,x){var b=x(),y=s({inst:{value:b,getSnapshot:x}}),S=y[0].inst,j=y[1];return a(function(){S.value=b,S.getSnapshot=x,d(S)&&j({inst:S})},[g,b,x]),o(function(){return d(S)&&j({inst:S}),g(function(){d(S)&&j({inst:S})})},[g]),l(b),b}function d(g){var x=g.getSnapshot;g=g.value;try{var b=x();return!n(g,b)}catch{return!0}}function f(g,x){return x()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return c5.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,c5}var z8;function kz(){return z8||(z8=1,l5.exports=Une()),l5.exports}var qne=kz(),u5={exports:{}},d5={};var I8;function Vne(){if(I8)return d5;I8=1;var e=Fg(),t=kz();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var s=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return d5.useSyncExternalStoreWithSelector=function(f,p,g,x,b){var y=a(null);if(y.current===null){var S={hasValue:!1,value:null};y.current=S}else S=y.current;y=u(function(){function A(F){if(!M){if(M=!0,R=F,F=x(F),b!==void 0&&S.hasValue){var N=S.value;if(b(N,F))return _=N}return _=F}if(N=_,s(R,F))return N;var I=x(F);return b!==void 0&&b(N,I)?(R=F,N):(R=F,_=I)}var M=!1,R,_,z=g===void 0?null:g;return[function(){return A(p())},z===null?void 0:function(){return A(z())}]},[p,g,x,b]);var j=o(f,y[0],y[1]);return l(function(){S.hasValue=!0,S.value=j},[j]),d(j),j},d5}var F8;function Gne(){return F8||(F8=1,u5.exports=Vne()),u5.exports}var Yne=Gne();const Mz=parseInt(v.version,10),Kne=Mz>=19,Xne=Kne?Qne:Jne;function Zne(e,t,n,s,o){return Xne(e,t,n,s,o)}function Qne(e,t,n,s,o){const a=v.useCallback(()=>t(e.getSnapshot(),n,s,o),[e,t,n,s,o]);return qne.useSyncExternalStore(e.subscribe,a,a)}function Jne(e,t,n,s,o){return Yne.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,s,o))}const ere=()=>{};function tre(e,t,n){const s=fb(nre,{store:e,selector:t}).current;s.effect=n,bR(s.onMount)}function nre(e){const{store:t,selector:n}=e;let s=n(t.state);const o={effect:ere,dispose:null,subscribe:()=>{o.dispose??=t.subscribe(a=>{const l=n(a);if(!Object.is(s,l)){const u=s;s=l,o.effect(u,l)}})},onMount:()=>(o.subscribe(),()=>{o.dispose?.(),o.dispose=null})};return o.subscribe(),o}class kC{static create(t){return new kC(t)}constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){this.state=t,this.updateTick+=1;const n=this.updateTick,s=this.listeners.values();let o;for(;o=s.next(),!o.done;){if(n!==this.updateTick)return;const a=o.value;a(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState(Ce({},this.state,t));return}}set(t,n){Object.is(this.state[t],n)||this.setState(Ce({},this.state,{[t]:n}))}use=(t,n,s,o)=>Zne(this,t,n,s,o)}const Fb=({params:e,store:t})=>{v.useEffect(()=>{t.set("animation",Ce({},t.state.animation,{skip:e.skipAnimation}))},[t,e.skipAnimation]);const n=v.useCallback(()=>{let s=!1;return t.set("animation",Ce({},t.state.animation,{skipAnimationRequests:t.state.animation.skipAnimationRequests+1})),()=>{s||(s=!0,t.set("animation",Ce({},t.state.animation,{skipAnimationRequests:t.state.animation.skipAnimationRequests-1})))}},[t]);return or(()=>{if(typeof window>"u"||!window?.matchMedia)return;let o;const a=u=>{u.matches?o=n():o?.()},l=window.matchMedia("(prefers-reduced-motion)");return a(l),l.addEventListener("change",a),()=>{l.removeEventListener("change",a)}},[n,t]),{instance:{disableAnimation:n}}};Fb.params={skipAnimation:!0};Fb.getDefaultizedParams=({params:e})=>Ce({},e,{skipAnimation:e.skipAnimation??!1});Fb.getInitialState=({skipAnimation:e})=>({animation:{skip:e,skipAnimationRequests:0}});const rre=e=>e.animation,sre=Ct(rre,e=>e.skip||e.skipAnimationRequests>0);function MC(e,t){const n=v.useRef(!0);v.useEffect(()=>{if(n.current){n.current=!1;return}return e()},t)}const RC="DEFAULT_X_AXIS_KEY",ore="DEFAULT_Y_AXIS_KEY",ire={top:20,bottom:20,left:20,right:20},are=45,lre=25,Rz=20,Ll=e=>e.cartesianAxis?.x,$c=e=>e.cartesianAxis?.y,cre=Ct($c,function(t){return(t??[]).reduce((n,s)=>s.position==="left"?n+(s.width||0)+(s.zoom?.slider.enabled?s.zoom.slider.size:0):n,0)}),ure=Ct($c,function(t){return(t??[]).reduce((n,s)=>s.position==="right"?n+(s.width||0)+(s.zoom?.slider.enabled?s.zoom.slider.size:0):n,0)}),dre=Ct(Ll,function(t){return(t??[]).reduce((n,s)=>s.position==="top"?n+(s.height||0)+(s.zoom?.slider.enabled?s.zoom.slider.size:0):n,0)}),fre=Ct(Ll,function(t){return(t??[]).reduce((n,s)=>s.position==="bottom"?n+(s.height||0)+(s.zoom?.slider.enabled?s.zoom.slider.size:0):n,0)}),hre=qn(cre,ure,dre,fre,function(t,n,s,o){return{left:t,right:n,top:s,bottom:o}}),lm=e=>e.dimensions,pre=e=>e.dimensions.margin,Ro=qn(lm,pre,hre,function({width:t,height:n},{top:s,right:o,bottom:a,left:l},{left:u,right:d,top:f,bottom:p}){return{width:t-l-o-u-d,left:l+u,right:o+d,height:n-s-a-f-p,top:s+f,bottom:a+p}}),gre=Ct(lm,e=>e.width),mre=Ct(lm,e=>e.height),zz=Ct(lm,e=>e.propsWidth),Iz=Ct(lm,e=>e.propsHeight);function xre(e,t){return typeof e=="number"?{top:e,bottom:e,left:e,right:e}:t?Ce({},t,e):e}const bre=10,_b=({params:e,store:t,svgRef:n})=>{const s=e.width!==void 0&&e.height!==void 0,o=v.useRef({displayError:!1,initialCompute:!0,computeRun:0}),[a,l]=v.useState(0),[u,d]=v.useState(0),f=v.useCallback(()=>{const y=n?.current;if(!y)return{};const j=wo(y).getComputedStyle(y),A=Math.floor(parseFloat(j.height))||0,M=Math.floor(parseFloat(j.width))||0;return(t.state.dimensions.width!==M||t.state.dimensions.height!==A)&&t.set("dimensions",{margin:{top:e.margin.top,right:e.margin.right,bottom:e.margin.bottom,left:e.margin.left},width:e.width??M,height:e.height??A,propsWidth:e.width,propsHeight:e.height}),{height:A,width:M}},[t,n,e.height,e.width,e.margin.left,e.margin.right,e.margin.top,e.margin.bottom]);MC(()=>{const y=e.width??t.state.dimensions.width,S=e.height??t.state.dimensions.height;t.set("dimensions",{margin:{top:e.margin.top,right:e.margin.right,bottom:e.margin.bottom,left:e.margin.left},width:y,height:S,propsHeight:e.height,propsWidth:e.width})},[t,e.height,e.width,e.margin.left,e.margin.right,e.margin.top,e.margin.bottom]),v.useEffect(()=>{o.current.displayError=!0},[]),or(()=>{if(s||!o.current.initialCompute||o.current.computeRun>bre)return;const y=f();y.width!==a||y.height!==u?(o.current.computeRun+=1,y.width!==void 0&&l(y.width),y.height!==void 0&&d(y.height)):o.current.initialCompute&&(o.current.initialCompute=!1)},[u,a,f,s]),or(()=>{if(s)return()=>{};f();const y=n.current;if(typeof ResizeObserver>"u")return()=>{};let S;const j=new ResizeObserver(()=>{S=requestAnimationFrame(()=>{f()})});return y&&j.observe(y),()=>{S&&cancelAnimationFrame(S),y&&j.unobserve(y)}},[f,s,n]);const p=t.use(Ro),g=v.useCallback(y=>y>=p.left-1&&y<=p.left+p.width,[p.left,p.width]),x=v.useCallback(y=>y>=p.top-1&&y<=p.top+p.height,[p.height,p.top]);return{instance:{isPointInside:v.useCallback((y,S,j)=>j&&"closest"in j&&j.closest("[data-drawing-container]")?!0:g(y)&&x(S),[g,x]),isXInside:g,isYInside:x}}};_b.params={width:!0,height:!0,margin:!0};_b.getDefaultizedParams=({params:e})=>Ce({},e,{margin:xre(e.margin,ire)});_b.getInitialState=({width:e,height:t,margin:n})=>({dimensions:{margin:n,width:e??0,height:t??0,propsWidth:e,propsHeight:t}});const zC=({params:e,store:t})=>(or(()=>{t.set("experimentalFeatures",e.experimentalFeatures)},[t,e.experimentalFeatures]),{});zC.params={experimentalFeatures:!0};zC.getInitialState=({experimentalFeatures:e})=>({experimentalFeatures:e});const yre=e=>e.experimentalFeatures,Lb=Ct(yre,e=>!!e?.preferStrictDomainInLineCharts);let _8=0;const vre=()=>(_8+=1,`mui-chart-${_8}`),IC=({params:e,store:t})=>(v.useEffect(()=>{e.id===void 0||e.id===t.state.id.providedChartId&&t.state.id.chartId!==void 0||t.set("id",Ce({},t.state.id,{chartId:e.id??vre()}))},[t,e.id]),{});IC.params={id:!0};IC.getInitialState=({id:e})=>({id:{chartId:e,providedChartId:e}});const Sre=e=>e.id,jre=Ct(Sre,e=>e.chartId),Cre=["#4254FB","#FFB422","#FA4F58","#0DBEFF","#22BF75","#FA83B4","#FF7511"],wre=["#495AFB","#FFC758","#F35865","#30C8FF","#44CE8D","#F286B3","#FF8C39"],Fz=e=>e==="dark"?wre:Cre,_z=({series:e,colors:t,seriesConfig:n})=>{const s={};return e.forEach((o,a)=>{const l=n[o.type].getSeriesWithDefaultValues(o,a,t),u=l.id;if(s[o.type]===void 0&&(s[o.type]={series:{},seriesOrder:[]}),s[o.type]?.series[u]!==void 0)throw new Error(`MUI X Charts: series' id "${u}" is not unique.`);s[o.type].series[u]=l,s[o.type].seriesOrder.push(u)}),s},Are=(e,t,n,s)=>{const o={};return Object.keys(t).forEach(a=>{const l=e[a];l!==void 0&&(o[a]=t[a]?.seriesProcessor?.(l,n,s)??l)}),o},Ere=(e,t,n)=>{let s=!1;const o={};return Object.keys(e).forEach(a=>{const l=t[a]?.seriesLayout,u=e[a];if(l!==void 0&&u!==void 0){const d=l(u,n);d&&d!==e[a]&&(s=!0,o[a]=d)}}),s?o:{}},FC=(e,t)=>{const n=e[t.type]?.identifierSerializer;if(!n)throw new Error(`MUI X Charts: No identifier serializer found for series type "${t.type}".`);return n(t)},Pb=({params:e,store:t,seriesConfig:n})=>{const{series:s,dataset:o,theme:a,colors:l}=e;return MC(()=>{t.set("series",Ce({},t.state.series,{defaultizedSeries:_z({series:s,colors:typeof l=="function"?l(a):l,seriesConfig:n}),dataset:o}))},[l,o,s,a,n,t]),{instance:{serializeIdentifier:pn(d=>FC(n,d))}}};Pb.params={dataset:!0,series:!0,colors:!0,theme:!0};const Tre=[];Pb.getDefaultizedParams=({params:e})=>Ce({},e,{series:e.series?.length?e.series:Tre,colors:e.colors??Fz,theme:e.theme??"light"});Pb.getInitialState=({series:e=[],colors:t,theme:n,dataset:s},o,a)=>({series:{seriesConfig:a,defaultizedSeries:_z({series:e,colors:typeof t=="function"?t(n):t,seriesConfig:a}),dataset:s}});const kre=(e,t,n)=>{const s=FC(n,t);return!e.has(s)},Mre=e=>e.visibilityManager,Lz=new Map,Rre=Ct(Mre,e=>e?.visibilityMap??Lz),Pz=qn(Rre,e=>(t,n)=>kre(e,n,t)),Dz=(e,t)=>{const n=new Map;return e&&e.forEach(s=>{const o=FC(t,s);n.set(o,s)}),n},Db=({store:e,params:t,seriesConfig:n,instance:s})=>{MC(()=>{t.hiddenItems!==void 0&&e.set("visibilityManager",Ce({},e.state.visibilityManager,{visibilityMap:Dz(t.hiddenItems,n)}))},[e,t.hiddenItems,n]);const o=pn(u=>{const d=e.state.visibilityManager.visibilityMap,f=s.serializeIdentifier(u);if(d.has(f))return;const p=new Map(d);p.set(f,u),e.set("visibilityManager",Ce({},e.state.visibilityManager,{visibilityMap:p})),t.onHiddenItemsChange?.(Array.from(p.values()))}),a=pn(u=>{const d=e.state.visibilityManager.visibilityMap,f=s.serializeIdentifier(u);if(!d.has(f))return;const p=new Map(d);p.delete(f),e.set("visibilityManager",Ce({},e.state.visibilityManager,{visibilityMap:p})),t.onHiddenItemsChange?.(Array.from(p.values()))}),l=pn(u=>{const d=e.state.visibilityManager.visibilityMap,f=s.serializeIdentifier(u);d.has(f)?a(u):o(u)});return{instance:{hideItem:o,showItem:a,toggleItemVisibility:l}}};Db.getInitialState=(e,t,n)=>{const s=e.hiddenItems??e.initialHiddenItems;return{visibilityManager:{visibilityMap:s?Dz(s,n):Lz,isControlled:e.hiddenItems!==void 0}}};Db.params={onHiddenItemsChange:!0,hiddenItems:!0,initialHiddenItems:!0};const _C=e=>e.series,Oz=Ct(_C,e=>e.defaultizedSeries),no=Ct(_C,e=>e.seriesConfig),zre=Ct(_C,e=>e.dataset),Fr=qn(Oz,no,zre,Pz,function(t,n,s,o){return Are(t,n,s,a=>o(n,a))}),Ire=qn(Fr,no,Ro,function(t,n,s){return Ere(t,n,s)}),Fre={abort:!0,animationcancel:!0,animationend:!0,animationiteration:!0,animationstart:!0,auxclick:!0,beforeinput:!0,beforetoggle:!0,blur:!0,cancel:!0,canplay:!0,canplaythrough:!0,change:!0,click:!0,close:!0,compositionend:!0,compositionstart:!0,compositionupdate:!0,contextlost:!0,contextmenu:!0,contextrestored:!0,copy:!0,cuechange:!0,cut:!0,dblclick:!0,drag:!0,dragend:!0,dragenter:!0,dragleave:!0,dragover:!0,dragstart:!0,drop:!0,durationchange:!0,emptied:!0,ended:!0,error:!0,focus:!0,focusin:!0,focusout:!0,formdata:!0,gotpointercapture:!0,input:!0,invalid:!0,keydown:!0,keypress:!0,keyup:!0,load:!0,loadeddata:!0,loadedmetadata:!0,loadstart:!0,lostpointercapture:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,paste:!0,pause:!0,play:!0,playing:!0,pointercancel:!0,pointerdown:!0,pointerenter:!0,pointerleave:!0,pointermove:!0,pointerout:!0,pointerover:!0,pointerup:!0,progress:!0,ratechange:!0,reset:!0,resize:!0,scroll:!0,scrollend:!0,securitypolicyviolation:!0,seeked:!0,seeking:!0,select:!0,selectionchange:!0,selectstart:!0,slotchange:!0,stalled:!0,submit:!0,suspend:!0,timeupdate:!0,toggle:!0,touchcancel:!0,touchend:!0,touchmove:!0,touchstart:!0,transitioncancel:!0,transitionend:!0,transitionrun:!0,transitionstart:!0,volumechange:!0,waiting:!0,webkitanimationend:!0,webkitanimationiteration:!0,webkitanimationstart:!0,webkittransitionend:!0,wheel:!0,beforematch:!0,pointerrawupdate:!0};class Bz{customData={};constructor(t){if(!t||!t.name)throw new Error("Gesture must be initialized with a valid name.");if(t.name in Fre)throw new Error(`Gesture can't be created with a native event name. Tried to use "${t.name}". Please use a custom name instead.`);this.name=t.name,this.preventDefault=t.preventDefault??!1,this.stopPropagation=t.stopPropagation??!1,this.preventIf=t.preventIf??[],this.requiredKeys=t.requiredKeys??[],this.pointerMode=t.pointerMode??[],this.pointerOptions=t.pointerOptions??{}}init(t,n,s,o){this.element=t,this.pointerManager=n,this.gesturesRegistry=s,this.keyboardManager=o;const a=`${this.name}ChangeOptions`;this.element.addEventListener(a,this.handleOptionsChange);const l=`${this.name}ChangeState`;this.element.addEventListener(l,this.handleStateChange)}handleOptionsChange=t=>{t&&t.detail&&this.updateOptions(t.detail)};updateOptions(t){this.preventDefault=t.preventDefault??this.preventDefault,this.stopPropagation=t.stopPropagation??this.stopPropagation,this.preventIf=t.preventIf??this.preventIf,this.requiredKeys=t.requiredKeys??this.requiredKeys,this.pointerMode=t.pointerMode??this.pointerMode,this.pointerOptions=t.pointerOptions??this.pointerOptions}getBaseConfig(){return{requiredKeys:this.requiredKeys}}getEffectiveConfig(t,n){if(t!=="mouse"&&t!=="touch"&&t!=="pen")return n;const s=this.pointerOptions[t];return s?Ce({},n,s):n}handleStateChange=t=>{t&&t.detail&&this.updateState(t.detail)};updateState(t){Object.assign(this.state,t)}getTargetElement(t){return this.isActive||this.element===t.target||"contains"in this.element&&this.element.contains(t.target)||"getRootNode"in this.element&&this.element.getRootNode()instanceof ShadowRoot&&t.composedPath().includes(this.element)?this.element:null}set isActive(t){t?this.gesturesRegistry.registerActiveGesture(this.element,this):this.gesturesRegistry.unregisterActiveGesture(this.element,this)}get isActive(){return this.gesturesRegistry.isGestureActive(this.element,this)??!1}shouldPreventGesture(t,n){const s=this.getEffectiveConfig(n,this.getBaseConfig());if(!this.keyboardManager.areKeysPressed(s.requiredKeys))return!0;if(this.preventIf.length===0)return!1;const o=this.gesturesRegistry.getActiveGestures(t);return this.preventIf.some(a=>o[a])}isPointerTypeAllowed(t){return!this.pointerMode||this.pointerMode.length===0?!0:this.pointerMode.includes(t)}destroy(){const t=`${this.name}ChangeOptions`;this.element.removeEventListener(t,this.handleOptionsChange);const n=`${this.name}ChangeState`;this.element.removeEventListener(n,this.handleStateChange)}}class _re{activeGestures=new Map;registerActiveGesture(t,n){this.activeGestures.has(t)||this.activeGestures.set(t,new Set);const s=this.activeGestures.get(t),o={gesture:n,element:t};s.add(o)}unregisterActiveGesture(t,n){const s=this.activeGestures.get(t);s&&(s.forEach(o=>{o.gesture===n&&s.delete(o)}),s.size===0&&this.activeGestures.delete(t))}getActiveGestures(t){const n=this.activeGestures.get(t);return n?Array.from(n).reduce((s,o)=>(s[o.gesture.name]=!0,s),{}):{}}isGestureActive(t,n){const s=this.activeGestures.get(t);return s?Array.from(s).some(o=>o.gesture===n):!1}destroy(){this.activeGestures.clear()}unregisterElement(t){this.activeGestures.delete(t)}}class Lre{pressedKeys=new Set;constructor(){this.initialize()}initialize(){typeof window>"u"||(window.addEventListener("keydown",this.handleKeyDown),window.addEventListener("keyup",this.handleKeyUp),window.addEventListener("blur",this.clearKeys))}handleKeyDown=t=>{this.pressedKeys.add(t.key)};handleKeyUp=t=>{this.pressedKeys.delete(t.key)};clearKeys=()=>{this.pressedKeys.clear()};areKeysPressed(t){return!t||t.length===0?!0:t.every(n=>n==="ControlOrMeta"?navigator.platform.includes("Mac")?this.pressedKeys.has("Meta"):this.pressedKeys.has("Control"):this.pressedKeys.has(n))}destroy(){typeof window<"u"&&(window.removeEventListener("keydown",this.handleKeyDown),window.removeEventListener("keyup",this.handleKeyUp),window.removeEventListener("blur",this.clearKeys)),this.clearKeys()}}class Pre{preventEventInterruption=!0;pointers=new Map;gestureHandlers=new Set;constructor(t){this.root=t.root??document.getRootNode({composed:!0})??document.body,this.touchAction=t.touchAction||"auto",this.passive=t.passive??!1,this.preventEventInterruption=t.preventEventInterruption??!0,this.setupEventListeners()}registerGestureHandler(t){return this.gestureHandlers.add(t),()=>{this.gestureHandlers.delete(t)}}getPointers(){return new Map(this.pointers)}setupEventListeners(){this.touchAction!=="auto"&&(this.root.style.touchAction=this.touchAction),this.root.addEventListener("pointerdown",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("pointermove",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("pointerup",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("pointercancel",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("forceCancel",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("blur",this.handleInterruptEvents),this.root.addEventListener("contextmenu",this.handleInterruptEvents)}handleInterruptEvents=t=>{if(this.preventEventInterruption&&"pointerType"in t&&t.pointerType==="touch"){t.preventDefault();return}const n=new PointerEvent("forceCancel",{bubbles:!1,cancelable:!1}),s=this.pointers.values().next().value;if(this.pointers.size>0&&s){Object.defineProperties(n,{clientX:{value:s.clientX},clientY:{value:s.clientY},pointerId:{value:s.pointerId},pointerType:{value:s.pointerType}});for(const[o,a]of this.pointers.entries()){const l=Ce({},a,{type:"forceCancel"});this.pointers.set(o,l)}}this.notifyHandlers(n),this.pointers.clear()};handlePointerEvent=t=>{const{type:n,pointerId:s}=t;if(n==="pointerdown"||n==="pointermove")this.pointers.set(s,this.createPointerData(t));else if(n==="pointerup"||n==="pointercancel"||n==="forceCancel"){this.pointers.set(s,this.createPointerData(t)),this.notifyHandlers(t),this.pointers.delete(s);return}this.notifyHandlers(t)};notifyHandlers(t){this.gestureHandlers.forEach(n=>n(this.pointers,t))}createPointerData(t){return{pointerId:t.pointerId,clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,target:t.target,timeStamp:t.timeStamp,type:t.type,isPrimary:t.isPrimary,pressure:t.pressure,width:t.width,height:t.height,pointerType:t.pointerType,srcEvent:t}}destroy(){this.root.removeEventListener("pointerdown",this.handlePointerEvent),this.root.removeEventListener("pointermove",this.handlePointerEvent),this.root.removeEventListener("pointerup",this.handlePointerEvent),this.root.removeEventListener("pointercancel",this.handlePointerEvent),this.root.removeEventListener("forceCancel",this.handlePointerEvent),this.root.removeEventListener("blur",this.handleInterruptEvents),this.root.removeEventListener("contextmenu",this.handleInterruptEvents),this.pointers.clear(),this.gestureHandlers.clear()}}class Dre{gestureTemplates=new Map;elementGestureMap=new Map;activeGesturesRegistry=new _re;keyboardManager=new Lre;constructor(t){this.pointerManager=new Pre({root:t.root,touchAction:t.touchAction,passive:t.passive}),t.gestures&&t.gestures.length>0&&t.gestures.forEach(n=>{this.addGestureTemplate(n)})}addGestureTemplate(t){this.gestureTemplates.has(t.name)&&console.warn(`Gesture template with name "${t.name}" already exists. It will be overwritten.`),this.gestureTemplates.set(t.name,t)}setGestureOptions(t,n,s){const o=this.elementGestureMap.get(n);if(!o||!o.has(t)){console.error(`Gesture "${t}" not found on the provided element.`);return}const a=new CustomEvent(`${t}ChangeOptions`,{detail:s,bubbles:!1,cancelable:!1,composed:!1});n.dispatchEvent(a)}setGestureState(t,n,s){const o=this.elementGestureMap.get(n);if(!o||!o.has(t)){console.error(`Gesture "${t}" not found on the provided element.`);return}const a=new CustomEvent(`${t}ChangeState`,{detail:s,bubbles:!1,cancelable:!1,composed:!1});n.dispatchEvent(a)}registerElement(t,n,s){return Array.isArray(t)||(t=[t]),t.forEach(o=>{const a=s?.[o];this.registerSingleGesture(o,n,a)}),n}registerSingleGesture(t,n,s){const o=this.gestureTemplates.get(t);if(!o)return console.error(`Gesture template "${t}" not found.`),!1;this.elementGestureMap.has(n)||this.elementGestureMap.set(n,new Map);const a=this.elementGestureMap.get(n);a.has(t)&&(console.warn(`Element already has gesture "${t}" registered. It will be replaced.`),this.unregisterElement(t,n));const l=o.clone(s);return l.init(n,this.pointerManager,this.activeGesturesRegistry,this.keyboardManager),a.set(t,l),!0}unregisterElement(t,n){const s=this.elementGestureMap.get(n);return!s||!s.has(t)?!1:(s.get(t).destroy(),s.delete(t),this.activeGesturesRegistry.unregisterElement(n),s.size===0&&this.elementGestureMap.delete(n),!0)}unregisterAllGestures(t){const n=this.elementGestureMap.get(t);if(n){for(const[,s]of n)s.destroy(),this.activeGesturesRegistry.unregisterElement(t);this.elementGestureMap.delete(t)}}destroy(){for(const[t]of this.elementGestureMap)this.unregisterAllGestures(t);this.gestureTemplates.clear(),this.elementGestureMap.clear(),this.activeGesturesRegistry.destroy(),this.keyboardManager.destroy(),this.pointerManager.destroy()}}class Xu extends Bz{unregisterHandler=null;originalTarget=null;constructor(t){super(t),this.minPointers=t.minPointers??1,this.maxPointers=t.maxPointers??1/0}init(t,n,s,o){super.init(t,n,s,o),this.unregisterHandler=this.pointerManager.registerGestureHandler(this.handlePointerEvent)}updateOptions(t){super.updateOptions(t),this.minPointers=t.minPointers??this.minPointers,this.maxPointers=t.maxPointers??this.maxPointers}getBaseConfig(){return{requiredKeys:this.requiredKeys,minPointers:this.minPointers,maxPointers:this.maxPointers}}isWithinPointerCount(t,n){const s=this.getEffectiveConfig(n,this.getBaseConfig());return t.length>=s.minPointers&&t.length<=s.maxPointers}getRelevantPointers(t,n){return t.filter(s=>this.isPointerTypeAllowed(s.pointerType)&&(n===s.target||s.target===this.originalTarget||n===this.originalTarget||"contains"in n&&n.contains(s.target))||"getRootNode"in n&&n.getRootNode()instanceof ShadowRoot&&s.srcEvent.composedPath().includes(n))}destroy(){this.unregisterHandler&&(this.unregisterHandler(),this.unregisterHandler=null),super.destroy()}}function Ore(e,t){const n=t.x-e.x,s=t.y-e.y;return Math.sqrt(n*n+s*s)}function s0(e){if(e.length<2)return 0;let t=0,n=0;for(let s=0;s<e.length;s+=1)for(let o=s+1;o<e.length;o+=1)t+=Ore({x:e[s].clientX,y:e[s].clientY},{x:e[o].clientX,y:e[o].clientY}),n+=1;return n>0?t/n:0}function aa(e){if(e.length===0)return{x:0,y:0};const t=e.reduce((n,s)=>(n.x+=s.clientX,n.y+=s.clientY,n),{x:0,y:0});return{x:t.x/e.length,y:t.y/e.length}}function Fi(e,t){return`${e}${t==="ongoing"?"":t.charAt(0).toUpperCase()+t.slice(1)}`}const o0=1e-5,pc=1e-5,L8=.15;function Bre(e,t){const n=t.x-e.x,s=t.y-e.y,o={vertical:null,horizontal:null,mainAxis:null},a=Nre(t,e),l=Math.abs(n)>Math.abs(s)?"horizontal":"vertical",u=a||l==="horizontal"?o0:L8,d=a?o0:l==="horizontal"?L8:o0;return Math.abs(n)>u&&(o.horizontal=n>0?"right":"left"),Math.abs(s)>d&&(o.vertical=s>0?"down":"up"),o.mainAxis=a?"diagonal":l,o}function Nre(e,t){const n=t.x-e.x,s=t.y-e.y,o=Math.atan2(s,n)*180/Math.PI;return o>=-45+pc&&o<=-22.5+pc||o>=22.5+pc&&o<=45+pc||o>=135+pc&&o<=157.5+pc||o>=-157.5+pc&&o<=-135+pc}function $re(e,t){if(!e.vertical&&!e.horizontal)return!1;if(t.length===0)return!0;const n=e.vertical===null||t.includes(e.vertical),s=e.horizontal===null||t.includes(e.horizontal);return n&&s}const P8=0,Hre=e=>e>P8?1:e<-P8?-1:0,mc=e=>{e.cancelable&&e.preventDefault()};class LC extends Xu{state={lastPosition:null};constructor(t){super(t),this.threshold=t.threshold||0}clone(t){return new LC(Ce({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}init(t,n,s,o){super.init(t,n,s,o),this.element.addEventListener("pointerenter",this.handleElementEnter),this.element.addEventListener("pointerleave",this.handleElementLeave)}destroy(){this.element.removeEventListener("pointerenter",this.handleElementEnter),this.element.removeEventListener("pointerleave",this.handleElementLeave),this.resetState(),super.destroy()}updateOptions(t){super.updateOptions(t)}resetState(){this.isActive=!1,this.state={lastPosition:null}}handleElementEnter=t=>{if(t.pointerType!=="mouse"&&t.pointerType!=="pen")return;const n=this.pointerManager.getPointers()||new Map,s=Array.from(n.values());if(this.isWithinPointerCount(s,t.pointerType)){this.isActive=!0;const o={x:t.clientX,y:t.clientY};this.state.lastPosition=o,this.emitMoveEvent(this.element,"start",s,t),this.emitMoveEvent(this.element,"ongoing",s,t)}};handleElementLeave=t=>{if(t.pointerType!=="mouse"&&t.pointerType!=="pen"||!this.isActive)return;const n=this.pointerManager.getPointers()||new Map,s=Array.from(n.values());this.emitMoveEvent(this.element,"end",s,t),this.resetState()};handlePointerEvent=(t,n)=>{if(n.type!=="pointermove"||n.pointerType!=="mouse"&&n.pointerType!=="pen")return;this.preventDefault&&n.preventDefault(),this.stopPropagation&&n.stopPropagation();const s=Array.from(t.values()),o=this.getTargetElement(n);if(!o||!this.isWithinPointerCount(s,n.pointerType))return;if(this.shouldPreventGesture(o,n.pointerType)){if(!this.isActive)return;this.resetState(),this.emitMoveEvent(o,"end",s,n);return}const a={x:n.clientX,y:n.clientY};this.state.lastPosition=a,this.isActive||(this.isActive=!0,this.emitMoveEvent(o,"start",s,n)),this.emitMoveEvent(o,"ongoing",s,n)};emitMoveEvent(t,n,s,o){const a=this.state.lastPosition||aa(s),l=this.gesturesRegistry.getActiveGestures(t),u={gestureName:this.name,centroid:a,target:o.target,srcEvent:o,phase:n,pointers:s,timeStamp:o.timeStamp,activeGestures:l,customData:this.customData},d=Fi(this.name,n),f=new CustomEvent(d,{bubbles:!0,cancelable:!0,composed:!0,detail:u});t.dispatchEvent(f)}}class Tu extends Xu{state={startPointers:new Map,startCentroid:null,lastCentroid:null,movementThresholdReached:!1,totalDeltaX:0,totalDeltaY:0,activeDeltaX:0,activeDeltaY:0,lastDirection:{vertical:null,horizontal:null,mainAxis:null},lastDeltas:null};constructor(t){super(t),this.direction=t.direction||["up","down","left","right"],this.threshold=t.threshold||0}clone(t){return new Tu(Ce({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,direction:[...this.direction],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}destroy(){this.resetState(),super.destroy()}updateOptions(t){super.updateOptions(t),this.direction=t.direction||this.direction,this.threshold=t.threshold??this.threshold}resetState(){this.isActive=!1,this.state=Ce({},this.state,{startPointers:new Map,startCentroid:null,lastCentroid:null,lastDeltas:null,activeDeltaX:0,activeDeltaY:0,movementThresholdReached:!1,lastDirection:{vertical:null,horizontal:null,mainAxis:null}})}handlePointerEvent=(t,n)=>{const s=Array.from(t.values());if(n.type==="forceCancel"){this.cancel(n.target,s,n);return}const o=this.getTargetElement(n);if(!o)return;if(this.shouldPreventGesture(o,n.pointerType)){this.cancel(o,s,n);return}const a=this.getRelevantPointers(s,o);if(!this.isWithinPointerCount(a,n.pointerType)){this.cancel(o,a,n);return}switch(n.type){case"pointerdown":if(!this.isActive&&!this.state.startCentroid)a.forEach(l=>{this.state.startPointers.set(l.pointerId,l)}),this.originalTarget=o,this.state.startCentroid=aa(a),this.state.lastCentroid=Ce({},this.state.startCentroid);else if(this.state.startCentroid&&this.state.lastCentroid){const l=this.state.lastCentroid,u=aa(a),d=u.x-l.x,f=u.y-l.y;this.state.startCentroid={x:this.state.startCentroid.x+d,y:this.state.startCentroid.y+f},this.state.lastCentroid=u,a.forEach(p=>{this.state.startPointers.has(p.pointerId)||this.state.startPointers.set(p.pointerId,p)})}break;case"pointermove":if(this.state.startCentroid&&this.isWithinPointerCount(s,n.pointerType)){const l=aa(a),u=l.x-this.state.startCentroid.x,d=l.y-this.state.startCentroid.y,f=Math.sqrt(u*u+d*d),p=Bre(this.state.lastCentroid??this.state.startCentroid,l),g=this.state.lastCentroid?l.x-this.state.lastCentroid.x:0,x=this.state.lastCentroid?l.y-this.state.lastCentroid.y:0;!this.state.movementThresholdReached&&f>=this.threshold&&$re(p,this.direction)?(this.state.movementThresholdReached=!0,this.isActive=!0,this.state.lastDeltas={x:g,y:x},this.state.totalDeltaX+=g,this.state.totalDeltaY+=x,this.state.activeDeltaX+=g,this.state.activeDeltaY+=x,this.emitPanEvent(o,"start",a,n,l),this.emitPanEvent(o,"ongoing",a,n,l)):this.state.movementThresholdReached&&this.isActive&&(this.state.lastDeltas={x:g,y:x},this.state.totalDeltaX+=g,this.state.totalDeltaY+=x,this.state.activeDeltaX+=g,this.state.activeDeltaY+=x,this.emitPanEvent(o,"ongoing",a,n,l)),this.state.lastCentroid=l,this.state.lastDirection=p}break;case"pointerup":case"pointercancel":case"forceCancel":if(this.isActive&&this.state.movementThresholdReached){const l=a.filter(u=>u.type!=="pointerup"&&u.type!=="pointercancel");if(this.isWithinPointerCount(l,n.pointerType)){if(l.length>=1&&this.state.lastCentroid){const u=aa(l),d=u.x-this.state.lastCentroid.x,f=u.y-this.state.lastCentroid.y;this.state.startCentroid={x:this.state.startCentroid.x+d,y:this.state.startCentroid.y+f},this.state.lastCentroid=u;const p=a.find(g=>g.type==="pointerup"||g.type==="pointercancel")?.pointerId;p!==void 0&&this.state.startPointers.delete(p)}}else{const u=this.state.lastCentroid||this.state.startCentroid;n.type==="pointercancel"&&this.emitPanEvent(o,"cancel",a,n,u),this.emitPanEvent(o,"end",a,n,u),this.resetState()}}else this.resetState();break}};emitPanEvent(t,n,s,o,a){if(!this.state.startCentroid)return;const l=this.state.lastDeltas?.x??0,u=this.state.lastDeltas?.y??0,d=this.state.startPointers.values().next().value,f=d?(o.timeStamp-d.timeStamp)/1e3:0,p=f>0?l/f:0,g=f>0?u/f:0,x=Math.sqrt(p*p+g*g),b=this.gesturesRegistry.getActiveGestures(t),y={gestureName:this.name,initialCentroid:this.state.startCentroid,centroid:a,target:o.target,srcEvent:o,phase:n,pointers:s,timeStamp:o.timeStamp,deltaX:l,deltaY:u,direction:this.state.lastDirection,velocityX:p,velocityY:g,velocity:x,totalDeltaX:this.state.totalDeltaX,totalDeltaY:this.state.totalDeltaY,activeDeltaX:this.state.activeDeltaX,activeDeltaY:this.state.activeDeltaY,activeGestures:b,customData:this.customData},S=Fi(this.name,n),j=new CustomEvent(S,{bubbles:!0,cancelable:!0,composed:!0,detail:y});t.dispatchEvent(j),this.preventDefault&&o.preventDefault(),this.stopPropagation&&o.stopPropagation()}cancel(t,n,s){if(this.isActive){const o=t??this.element;this.emitPanEvent(o,"cancel",n,s,this.state.lastCentroid),this.emitPanEvent(o,"end",n,s,this.state.lastCentroid)}this.resetState()}}class PC extends Xu{state={startDistance:0,lastDistance:0,lastScale:1,lastTime:0,velocity:0,totalScale:1,deltaScale:0};constructor(t){super(Ce({},t,{minPointers:t.minPointers??2})),this.threshold=t.threshold??0}clone(t){return new PC(Ce({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}destroy(){this.resetState(),super.destroy()}updateOptions(t){super.updateOptions(t)}resetState(){this.isActive=!1,this.state=Ce({},this.state,{startDistance:0,lastDistance:0,lastScale:1,lastTime:0,velocity:0,deltaScale:0})}handlePointerEvent=(t,n)=>{const s=Array.from(t.values()),o=this.getTargetElement(n);if(!o)return;if(this.shouldPreventGesture(o,n.pointerType)){this.isActive&&(this.emitPinchEvent(o,"cancel",s,n),this.resetState());return}const a=this.getRelevantPointers(s,o);switch(n.type){case"pointerdown":if(a.length>=2&&!this.isActive){const l=s0(a);this.state.startDistance=l,this.state.lastDistance=l,this.state.lastTime=n.timeStamp,this.originalTarget=o}else if(this.isActive&&a.length>=2){const l=s0(a);this.state.startDistance=l/this.state.lastScale,this.state.lastDistance=l,this.state.lastTime=n.timeStamp}break;case"pointermove":if(this.state.startDistance&&this.isWithinPointerCount(a,n.pointerType)){const l=s0(a),u=Math.abs(l-this.state.lastDistance);if(u!==0&&u>=this.threshold){const d=this.state.startDistance?l/this.state.startDistance:1,f=d/this.state.lastScale;this.state.totalScale*=f;const p=(n.timeStamp-this.state.lastTime)/1e3;if(this.state.lastDistance){const x=(l-this.state.lastDistance)/p;this.state.velocity=Number.isNaN(x)?0:x}this.state.lastDistance=l,this.state.deltaScale=d-this.state.lastScale,this.state.lastScale=d,this.state.lastTime=n.timeStamp,this.isActive?this.emitPinchEvent(o,"ongoing",a,n):(this.isActive=!0,this.emitPinchEvent(o,"start",a,n),this.emitPinchEvent(o,"ongoing",a,n))}}break;case"pointerup":case"pointercancel":case"forceCancel":if(this.isActive){const l=a.filter(u=>u.type!=="pointerup"&&u.type!=="pointercancel");if(!this.isWithinPointerCount(l,n.pointerType))n.type==="pointercancel"&&this.emitPinchEvent(o,"cancel",a,n),this.emitPinchEvent(o,"end",a,n),this.resetState();else if(l.length>=2){const u=s0(l);this.state.startDistance=u/this.state.lastScale,this.state.lastDistance=u,this.state.lastTime=n.timeStamp}}break}};emitPinchEvent(t,n,s,o){const a=aa(s),l=this.state.lastDistance,u=this.state.lastScale,d=this.gesturesRegistry.getActiveGestures(t),f={gestureName:this.name,centroid:a,target:o.target,srcEvent:o,phase:n,pointers:s,timeStamp:o.timeStamp,scale:u,deltaScale:this.state.deltaScale,totalScale:this.state.totalScale,distance:l,velocity:this.state.velocity,activeGestures:d,direction:Hre(this.state.velocity),customData:this.customData};this.preventDefault&&o.preventDefault(),this.stopPropagation&&o.stopPropagation();const p=Fi(this.name,n),g=new CustomEvent(p,{bubbles:!0,cancelable:!0,composed:!0,detail:f});t.dispatchEvent(g)}}class Ob extends Xu{state={startCentroid:null,lastPosition:null,timerId:null,startTime:0,pressThresholdReached:!1};constructor(t){super(t),this.duration=t.duration??500,this.maxDistance=t.maxDistance??10}clone(t){return new Ob(Ce({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,duration:this.duration,maxDistance:this.maxDistance,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}destroy(){this.clearPressTimer(),this.resetState(),super.destroy()}updateOptions(t){super.updateOptions(t),this.duration=t.duration??this.duration,this.maxDistance=t.maxDistance??this.maxDistance}resetState(){this.clearPressTimer(),this.isActive=!1,this.state=Ce({},this.state,{startCentroid:null,lastPosition:null,timerId:null,startTime:0,pressThresholdReached:!1})}clearPressTimer(){this.state.timerId!==null&&(clearTimeout(this.state.timerId),this.state.timerId=null)}handlePointerEvent=(t,n)=>{const s=Array.from(t.values());if(n.type==="forceCancel"){this.cancelPress(n.target,s,n);return}const o=this.getTargetElement(n);if(!o)return;if(this.shouldPreventGesture(o,n.pointerType)){this.isActive&&this.cancelPress(o,s,n);return}const a=this.getRelevantPointers(s,o);if(!this.isWithinPointerCount(a,n.pointerType)){this.isActive&&this.cancelPress(o,a,n);return}switch(n.type){case"pointerdown":!this.isActive&&!this.state.startCentroid&&(this.state.startCentroid=aa(a),this.state.lastPosition=Ce({},this.state.startCentroid),this.state.startTime=n.timeStamp,this.isActive=!0,this.originalTarget=o,this.clearPressTimer(),this.state.timerId=setTimeout(()=>{if(this.isActive&&this.state.startCentroid){this.state.pressThresholdReached=!0;const l=this.state.lastPosition;this.emitPressEvent(o,"start",a,n,l),this.emitPressEvent(o,"ongoing",a,n,l)}},this.duration));break;case"pointermove":if(this.isActive&&this.state.startCentroid){const l=aa(a);this.state.lastPosition=l;const u=l.x-this.state.startCentroid.x,d=l.y-this.state.startCentroid.y;Math.sqrt(u*u+d*d)>this.maxDistance&&this.cancelPress(o,a,n)}break;case"pointerup":if(this.isActive){if(this.state.pressThresholdReached){const l=this.state.lastPosition||this.state.startCentroid;this.emitPressEvent(o,"end",a,n,l)}this.resetState()}break;case"pointercancel":case"forceCancel":this.cancelPress(o,a,n);break}};emitPressEvent(t,n,s,o,a){const l=this.gesturesRegistry.getActiveGestures(t),u=o.timeStamp-this.state.startTime,d={gestureName:this.name,centroid:a,target:o.target,srcEvent:o,phase:n,pointers:s,timeStamp:o.timeStamp,x:a.x,y:a.y,duration:u,activeGestures:l,customData:this.customData},f=Fi(this.name,n),p=new CustomEvent(f,{bubbles:!0,cancelable:!0,composed:!0,detail:d});t.dispatchEvent(p),this.preventDefault&&o.preventDefault(),this.stopPropagation&&o.stopPropagation()}cancelPress(t,n,s){if(this.isActive&&this.state.pressThresholdReached){const o=this.state.lastPosition||this.state.startCentroid;this.emitPressEvent(t??this.element,"cancel",n,s,o),this.emitPressEvent(t??this.element,"end",n,s,o)}this.resetState()}}class DC extends Xu{state={phase:"waitingForPress",dragTimeoutId:null};constructor(t){super(t),this.pressDuration=t.pressDuration??500,this.pressMaxDistance=t.pressMaxDistance??10,this.dragTimeout=t.dragTimeout??1e3,this.dragThreshold=t.dragThreshold??0,this.dragDirection=t.dragDirection||["up","down","left","right"],this.pressGesture=new Ob({name:`${this.name}-press`,duration:this.pressDuration,maxDistance:this.pressMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}),this.panGesture=new Tu({name:`${this.name}-pan`,minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)})}clone(t){return new DC(Ce({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,pressDuration:this.pressDuration,pressMaxDistance:this.pressMaxDistance,dragTimeout:this.dragTimeout,dragThreshold:this.dragThreshold,dragDirection:[...this.dragDirection],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}init(t,n,s,o){super.init(t,n,s,o),this.pressGesture.init(t,n,s,o),this.panGesture.init(t,n,s,o),this.element.addEventListener(this.pressGesture.name,this.pressHandler),this.element.addEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.addEventListener(this.panGesture.name,this.dragMoveHandler),this.element.addEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.addEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler)}destroy(){this.resetState(),this.pressGesture.destroy(),this.panGesture.destroy(),this.element.removeEventListener(this.pressGesture.name,this.pressHandler),this.element.removeEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.removeEventListener(this.panGesture.name,this.dragMoveHandler),this.element.removeEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.removeEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler),super.destroy()}updateOptions(t){super.updateOptions(t),this.pressDuration=t.pressDuration??this.pressDuration,this.pressMaxDistance=t.pressMaxDistance??this.pressMaxDistance,this.dragTimeout=t.dragTimeout??this.dragTimeout,this.dragThreshold=t.dragThreshold??this.dragThreshold,this.dragDirection=t.dragDirection||this.dragDirection,this.element.dispatchEvent(new CustomEvent(`${this.panGesture.name}ChangeOptions`,{detail:{minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}})),this.element.dispatchEvent(new CustomEvent(`${this.pressGesture.name}ChangeOptions`,{detail:{duration:this.pressDuration,maxDistance:this.pressMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}}))}resetState(){this.state.dragTimeoutId!==null&&clearTimeout(this.state.dragTimeoutId),this.restoreTouchAction(),this.isActive=!1,this.state={phase:"waitingForPress",dragTimeoutId:null}}handlePointerEvent(){}pressHandler=()=>{this.state.phase==="waitingForPress"&&(this.state.phase="pressDetected",this.setTouchAction(),this.state.dragTimeoutId=setTimeout(()=>{this.resetState()},this.dragTimeout))};dragStartHandler=t=>{this.state.phase==="pressDetected"&&(this.state.dragTimeoutId!==null&&(clearTimeout(this.state.dragTimeoutId),this.state.dragTimeoutId=null),this.restoreTouchAction(),this.state.phase="dragging",this.isActive=!0,this.element.dispatchEvent(new CustomEvent(Fi(this.name,t.detail.phase),t)))};dragMoveHandler=t=>{this.state.phase==="dragging"&&this.element.dispatchEvent(new CustomEvent(Fi(this.name,t.detail.phase),t))};dragEndHandler=t=>{this.state.phase==="dragging"&&(this.resetState(),this.element.dispatchEvent(new CustomEvent(Fi(this.name,t.detail.phase),t)))};setTouchAction(){this.element.addEventListener("touchstart",mc,{passive:!1}),this.element.addEventListener("touchmove",mc,{passive:!1}),this.element.addEventListener("touchend",mc,{passive:!1})}restoreTouchAction(){this.element.removeEventListener("touchstart",mc),this.element.removeEventListener("touchmove",mc),this.element.removeEventListener("touchend",mc)}}class bg extends Xu{state={startCentroid:null,currentTapCount:0,lastTapTime:0,lastPosition:null};constructor(t){super(t),this.maxDistance=t.maxDistance??10,this.taps=t.taps??1}clone(t){return new bg(Ce({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,maxDistance:this.maxDistance,taps:this.taps,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}destroy(){this.resetState(),super.destroy()}updateOptions(t){super.updateOptions(t),this.maxDistance=t.maxDistance??this.maxDistance,this.taps=t.taps??this.taps}resetState(){this.isActive=!1,this.state={startCentroid:null,currentTapCount:0,lastTapTime:0,lastPosition:null}}handlePointerEvent=(t,n)=>{const s=Array.from(t.values()),o=this.getTargetElement(n);if(!o)return;const a=this.getRelevantPointers(s,o);if(this.shouldPreventGesture(o,n.pointerType)||!this.isWithinPointerCount(a,n.pointerType)){this.isActive&&this.cancelTap(o,a,n);return}switch(n.type){case"pointerdown":this.isActive||(this.state.startCentroid=aa(a),this.state.lastPosition=Ce({},this.state.startCentroid),this.isActive=!0,this.originalTarget=o);break;case"pointermove":if(this.isActive&&this.state.startCentroid){const l=aa(a);this.state.lastPosition=l;const u=l.x-this.state.startCentroid.x,d=l.y-this.state.startCentroid.y;Math.sqrt(u*u+d*d)>this.maxDistance&&this.cancelTap(o,a,n)}break;case"pointerup":if(this.isActive){this.state.currentTapCount+=1;const l=this.state.lastPosition||this.state.startCentroid;if(!l){this.cancelTap(o,a,n);return}this.state.currentTapCount>=this.taps?(this.fireTapEvent(o,a,n,l),this.resetState()):(this.state.lastTapTime=n.timeStamp,this.isActive=!1,this.state.startCentroid=null,setTimeout(()=>{this.state&&this.state.currentTapCount>0&&this.state.currentTapCount<this.taps&&(this.state.currentTapCount=0)},300))}break;case"pointercancel":case"forceCancel":this.cancelTap(o,a,n);break}};fireTapEvent(t,n,s,o){const a=this.gesturesRegistry.getActiveGestures(t),l={gestureName:this.name,centroid:o,target:s.target,srcEvent:s,phase:"end",pointers:n,timeStamp:s.timeStamp,x:o.x,y:o.y,tapCount:this.state.currentTapCount,activeGestures:a,customData:this.customData},u=new CustomEvent(this.name,{bubbles:!0,cancelable:!0,composed:!0,detail:l});t.dispatchEvent(u),this.preventDefault&&s.preventDefault(),this.stopPropagation&&s.stopPropagation()}cancelTap(t,n,s){if(this.state.startCentroid||this.state.lastPosition){const o=this.state.lastPosition||this.state.startCentroid,a=this.gesturesRegistry.getActiveGestures(t),l={gestureName:this.name,centroid:o,target:s.target,srcEvent:s,phase:"cancel",pointers:n,timeStamp:s.timeStamp,x:o.x,y:o.y,tapCount:this.state.currentTapCount,activeGestures:a,customData:this.customData},u=Fi(this.name,"cancel"),d=new CustomEvent(u,{bubbles:!0,cancelable:!0,composed:!0,detail:l});t.dispatchEvent(d)}this.resetState()}}class OC extends Xu{state={phase:"waitingForTap",dragTimeoutId:null};constructor(t){super(t),this.tapMaxDistance=t.tapMaxDistance??10,this.dragTimeout=t.dragTimeout??1e3,this.dragThreshold=t.dragThreshold??0,this.dragDirection=t.dragDirection||["up","down","left","right"],this.tapGesture=new bg({name:`${this.name}-tap`,maxDistance:this.tapMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}),this.panGesture=new Tu({name:`${this.name}-pan`,minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)})}clone(t){return new OC(Ce({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,tapMaxDistance:this.tapMaxDistance,dragTimeout:this.dragTimeout,dragThreshold:this.dragThreshold,dragDirection:[...this.dragDirection],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}init(t,n,s,o){super.init(t,n,s,o),this.tapGesture.init(t,n,s,o),this.panGesture.init(t,n,s,o),this.element.addEventListener(this.tapGesture.name,this.tapHandler),this.element.addEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.addEventListener(this.panGesture.name,this.dragMoveHandler),this.element.addEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.addEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler)}destroy(){this.resetState(),this.tapGesture.destroy(),this.panGesture.destroy(),this.element.removeEventListener(this.tapGesture.name,this.tapHandler),this.element.removeEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.removeEventListener(this.panGesture.name,this.dragMoveHandler),this.element.removeEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.removeEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler),super.destroy()}updateOptions(t){super.updateOptions(t),this.tapMaxDistance=t.tapMaxDistance??this.tapMaxDistance,this.dragTimeout=t.dragTimeout??this.dragTimeout,this.dragThreshold=t.dragThreshold??this.dragThreshold,this.dragDirection=t.dragDirection||this.dragDirection,this.element.dispatchEvent(new CustomEvent(`${this.panGesture.name}ChangeOptions`,{detail:{minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}})),this.element.dispatchEvent(new CustomEvent(`${this.tapGesture.name}ChangeOptions`,{detail:{maxDistance:this.tapMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}}))}resetState(){this.state.dragTimeoutId!==null&&clearTimeout(this.state.dragTimeoutId),this.restoreTouchAction(),this.isActive=!1,this.state={phase:"waitingForTap",dragTimeoutId:null}}handlePointerEvent(){}tapHandler=()=>{this.state.phase==="waitingForTap"&&(this.state.phase="tapDetected",this.setTouchAction(),this.state.dragTimeoutId=setTimeout(()=>{this.resetState()},this.dragTimeout))};dragStartHandler=t=>{this.state.phase==="tapDetected"&&(this.state.dragTimeoutId!==null&&(clearTimeout(this.state.dragTimeoutId),this.state.dragTimeoutId=null),this.restoreTouchAction(),this.state.phase="dragging",this.isActive=!0,this.element.dispatchEvent(new CustomEvent(Fi(this.name,t.detail.phase),t)))};dragMoveHandler=t=>{this.state.phase==="dragging"&&this.element.dispatchEvent(new CustomEvent(Fi(this.name,t.detail.phase),t))};dragEndHandler=t=>{this.state.phase==="dragging"&&(this.resetState(),this.element.dispatchEvent(new CustomEvent(Fi(this.name,t.detail.phase),t)))};setTouchAction(){this.element.addEventListener("touchstart",mc,{passive:!1})}restoreTouchAction(){this.element.removeEventListener("touchstart",mc)}}class d1 extends Bz{state={totalDeltaX:0,totalDeltaY:0,totalDeltaZ:0};constructor(t){super(t),this.sensitivity=t.sensitivity??1,this.max=t.max??Number.MAX_SAFE_INTEGER,this.min=t.min??Number.MIN_SAFE_INTEGER,this.initialDelta=t.initialDelta??0,this.invert=t.invert??!1,this.state.totalDeltaX=this.initialDelta,this.state.totalDeltaY=this.initialDelta,this.state.totalDeltaZ=this.initialDelta}clone(t){return new d1(Ce({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,sensitivity:this.sensitivity,max:this.max,min:this.min,initialDelta:this.initialDelta,invert:this.invert,requiredKeys:[...this.requiredKeys],preventIf:[...this.preventIf]},t))}init(t,n,s,o){super.init(t,n,s,o),this.element.addEventListener("wheel",this.handleWheelEvent)}destroy(){this.element.removeEventListener("wheel",this.handleWheelEvent),this.resetState(),super.destroy()}resetState(){this.isActive=!1,this.state={totalDeltaX:0,totalDeltaY:0,totalDeltaZ:0}}updateOptions(t){super.updateOptions(t),this.sensitivity=t.sensitivity??this.sensitivity,this.max=t.max??this.max,this.min=t.min??this.min,this.initialDelta=t.initialDelta??this.initialDelta,this.invert=t.invert??this.invert}handleWheelEvent=t=>{if(this.shouldPreventGesture(this.element,"mouse"))return;const n=this.pointerManager.getPointers()||new Map,s=Array.from(n.values());this.state.totalDeltaX+=t.deltaX*this.sensitivity*(this.invert?-1:1),this.state.totalDeltaY+=t.deltaY*this.sensitivity*(this.invert?-1:1),this.state.totalDeltaZ+=t.deltaZ*this.sensitivity*(this.invert?-1:1),["totalDeltaX","totalDeltaY","totalDeltaZ"].forEach(o=>{this.state[o]<this.min&&(this.state[o]=this.min),this.state[o]>this.max&&(this.state[o]=this.max)}),this.emitWheelEvent(s,t)};emitWheelEvent(t,n){const s=t.length>0?aa(t):{x:n.clientX,y:n.clientY},o=this.gesturesRegistry.getActiveGestures(this.element),a={gestureName:this.name,centroid:s,target:n.target,srcEvent:n,phase:"ongoing",pointers:t,timeStamp:n.timeStamp,deltaX:n.deltaX*this.sensitivity*(this.invert?-1:1),deltaY:n.deltaY*this.sensitivity*(this.invert?-1:1),deltaZ:n.deltaZ*this.sensitivity*(this.invert?-1:1),deltaMode:n.deltaMode,totalDeltaX:this.state.totalDeltaX,totalDeltaY:this.state.totalDeltaY,totalDeltaZ:this.state.totalDeltaZ,activeGestures:o,customData:this.customData};this.preventDefault&&n.preventDefault(),this.stopPropagation&&n.stopPropagation();const l=Fi(this.name,"ongoing"),u=new CustomEvent(l,{bubbles:!0,cancelable:!0,composed:!0,detail:a});this.element.dispatchEvent(u)}}const Xd=e=>e.preventDefault(),BC=({svgRef:e})=>{const t=v.useRef(null);v.useEffect(()=>{const o=e.current;t.current||(t.current=new Dre({gestures:[new Tu({name:"pan",threshold:0,maxPointers:1}),new LC({name:"move",preventIf:["pan","zoomPinch","zoomPan"]}),new bg({name:"tap",preventIf:["pan","zoomPinch","zoomPan"]}),new Ob({name:"quickPress",duration:50}),new Tu({name:"brush",threshold:0,maxPointers:1}),new Tu({name:"zoomPan",threshold:0,preventIf:["zoomTapAndDrag","zoomPressAndDrag"]}),new PC({name:"zoomPinch",threshold:5}),new d1({name:"zoomTurnWheel",sensitivity:.01,initialDelta:1}),new d1({name:"panTurnWheel",sensitivity:.5}),new OC({name:"zoomTapAndDrag",dragThreshold:10}),new DC({name:"zoomPressAndDrag",dragThreshold:10,preventIf:["zoomPinch"]}),new bg({name:"zoomDoubleTapReset",taps:2})]}));const a=t.current;if(!(!o||!a))return a.registerElement(["pan","move","zoomPinch","zoomPan","zoomTurnWheel","panTurnWheel","tap","quickPress","zoomTapAndDrag","zoomPressAndDrag","zoomDoubleTapReset","brush"],o),()=>{a.unregisterAllGestures(o)}},[e,t]);const n=v.useCallback((o,a,l)=>{const u=e.current;return u?.addEventListener(o,a,l),{cleanup:()=>u?.removeEventListener(o,a)}},[e]),s=v.useCallback((o,a)=>{const l=e.current,u=t.current;!u||!l||u.setGestureOptions(o,l,a??{})},[e,t]);return v.useEffect(()=>{const o=e.current;return o?.addEventListener("gesturestart",Xd),o?.addEventListener("gesturechange",Xd),o?.addEventListener("gestureend",Xd),()=>{o?.removeEventListener("gesturestart",Xd),o?.removeEventListener("gesturechange",Xd),o?.removeEventListener("gestureend",Xd)}},[e]),{instance:{addInteractionListener:n,updateZoomInteractionListeners:s}}};BC.params={};BC.getInitialState=()=>({});const Wre=[IC,zC,_b,Pb,BC,Fb],Ure=["apiRef"],qre=e=>{let{plugins:t}=e,n=_n(e.props,Ure);const s={};t.forEach(l=>{Object.assign(s,l.params)});const o={};return Object.keys(n).forEach(l=>{const u=n[l];s[l]&&(o[l]=u)}),t.reduce((l,u)=>u.getDefaultizedParams?u.getDefaultizedParams({params:l}):l,o)};let D8=0;function Vre(e,t,n){const s=Hi(),o=v.useMemo(()=>[...Wre,...e],[e]),a=qre({plugins:o,props:t});a.id=a.id??s;const u=v.useRef({}).current,d=Yre(t.apiRef),f=v.useRef(null),p=v.useRef(null),g=v.useRef(null);if(g.current==null){D8+=1;const y={cacheKey:{id:D8}};o.forEach(S=>{S.getInitialState&&Object.assign(y,S.getInitialState(a,y,n))}),g.current=new kC(y)}const x=y=>{const S=y({instance:u,params:a,plugins:o,store:g.current,svgRef:p,chartRootRef:f,seriesConfig:n});S.publicAPI&&Object.assign(d.current,S.publicAPI),S.instance&&Object.assign(u,S.instance)};return o.forEach(x),{contextValue:v.useMemo(()=>({store:g.current,publicAPI:d.current,instance:u,svgRef:p,chartRootRef:f}),[u,d])}}function Gre(e){return e.current==null&&(e.current={}),e}function Yre(e){const t=v.useRef({});return e?Gre(e):t}const Nz=v.createContext(null),NC=()=>{},$z=4,Hz=20+2*$z,Kre=40+2*$z,Xre="hover",i0={minStart:0,maxEnd:100,step:5,minSpan:10,maxSpan:100,panning:!0,filterMode:"keep",reverse:!1,slider:{enabled:!1,preview:!1,size:Hz,showTooltip:Xre}},$C=(e,t,n,s)=>{if(e)return e===!0?Ce({axisId:t,axisDirection:n},i0,{reverse:s??!1}):Ce({axisId:t,axisDirection:n},i0,{reverse:s??!1},e,{slider:Ce({},i0.slider,{size:e.slider?.preview??i0.slider.preview?Kre:Hz},e.slider)})};function Wz(e,t){const n={top:0,bottom:0,none:0};return(e&&e.length>0?e:[{id:RC,scaleType:"linear"}]).map((a,l)=>{const u=a.dataKey,d=l===0?"bottom":"none",f=a.position??d,p=lre+(a.label?Rz:0),g=a.id??`defaultized-x-axis-${l}`,x=Ce({offset:n[f]},a,{id:g,position:f,height:a.height??p,zoom:$C(a.zoom,g,"x",a.reverse)});if(f!=="none"&&(n[f]+=x.height,x.zoom?.slider.enabled&&(n[f]+=x.zoom.slider.size)),u===void 0||a.data!==void 0)return x;if(t===void 0)throw new Error("MUI X Charts: x-axis uses `dataKey` but no `dataset` is provided.");return Ce({},x,{data:t.map(b=>b[u])})})}function Uz(e,t){const n={right:0,left:0,none:0};return(e&&e.length>0?e:[{id:ore,scaleType:"linear"}]).map((a,l)=>{const u=a.dataKey,d=l===0?"left":"none",f=a.position??d,p=are+(a.label?Rz:0),g=a.id??`defaultized-y-axis-${l}`,x=Ce({offset:n[f]},a,{id:g,position:f,width:a.width??p,zoom:$C(a.zoom,g,"y",a.reverse)});if(f!=="none"&&(n[f]+=x.width,x.zoom?.slider.enabled&&(n[f]+=x.zoom.slider.size)),u===void 0||a.data!==void 0)return x;if(t===void 0)throw new Error("MUI X Charts: y-axis uses `dataKey` but no `dataset` is provided.");return Ce({},x,{data:t.map(b=>b[u])})})}function Zre(e,t){return function(s,o){if(o.location==="tick"){const a=o.scale.domain();return a[0]===a[1]?o.scale.tickFormat(1)(s):o.scale.tickFormat(e)(s)}return o.location==="zoom-slider-tooltip"?t.tickFormat(2)(s):`${s}`}}function Zu(e){return e.scaleType==="band"}function Qu(e){return e.scaleType==="point"}function Qre(e){return e.scaleType!=="point"&&e.scaleType!=="band"}function Jre(e){return e.scaleType==="symlog"}function U0(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ese(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function HC(e){let t,n,s;e.length!==2?(t=U0,n=(u,d)=>U0(e(u),d),s=(u,d)=>e(u)-d):(t=e===U0||e===ese?e:tse,n=e,s=e);function o(u,d,f=0,p=u.length){if(f<p){if(t(d,d)!==0)return p;do{const g=f+p>>>1;n(u[g],d)<0?f=g+1:p=g}while(f<p)}return f}function a(u,d,f=0,p=u.length){if(f<p){if(t(d,d)!==0)return p;do{const g=f+p>>>1;n(u[g],d)<=0?f=g+1:p=g}while(f<p)}return f}function l(u,d,f=0,p=u.length){const g=o(u,d,f,p-1);return g>f&&s(u[g-1],d)>-s(u[g],d)?g-1:g}return{left:o,center:l,right:a}}function tse(){return 0}function nse(e){return e===null?NaN:+e}const rse=HC(U0),qz=rse.right;HC(nse).center;class f1 extends Map{constructor(t,n=ise){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[s,o]of t)this.set(s,o)}get(t){return super.get(O8(this,t))}has(t){return super.has(O8(this,t))}set(t,n){return super.set(sse(this,t),n)}delete(t){return super.delete(ose(this,t))}}function O8({_intern:e,_key:t},n){const s=t(n);return e.has(s)?e.get(s):n}function sse({_intern:e,_key:t},n){const s=t(n);return e.has(s)?e.get(s):(e.set(s,n),n)}function ose({_intern:e,_key:t},n){const s=t(n);return e.has(s)&&(n=e.get(s),e.delete(s)),n}function ise(e){return e!==null&&typeof e=="object"?e.valueOf():e}const ase=Math.sqrt(50),lse=Math.sqrt(10),cse=Math.sqrt(2);function h1(e,t,n){const s=(t-e)/Math.max(0,n),o=Math.floor(Math.log10(s)),a=s/Math.pow(10,o),l=a>=ase?10:a>=lse?5:a>=cse?2:1;let u,d,f;return o<0?(f=Math.pow(10,-o)/l,u=Math.round(e*f),d=Math.round(t*f),u/f<e&&++u,d/f>t&&--d,f=-f):(f=Math.pow(10,o)*l,u=Math.round(e/f),d=Math.round(t/f),u*f<e&&++u,d*f>t&&--d),d<u&&.5<=n&&n<2?h1(e,t,n*2):[u,d,f]}function DS(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const s=t<e,[o,a,l]=s?h1(t,e,n):h1(e,t,n);if(!(a>=o))return[];const u=a-o+1,d=new Array(u);if(s)if(l<0)for(let f=0;f<u;++f)d[f]=(a-f)/-l;else for(let f=0;f<u;++f)d[f]=(a-f)*l;else if(l<0)for(let f=0;f<u;++f)d[f]=(o+f)/-l;else for(let f=0;f<u;++f)d[f]=(o+f)*l;return d}function OS(e,t,n){return t=+t,e=+e,n=+n,h1(e,t,n)[2]}function BS(e,t,n){t=+t,e=+e,n=+n;const s=t<e,o=s?OS(t,e,n):OS(e,t,n);return(s?-1:1)*(o<0?1/-o:o)}function use(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var s=-1,o=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(o);++s<o;)a[s]=e+s*n;return a}function Hc(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function dse(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const B8=Symbol("implicit");function NS(){var e=new f1,t=[],n=[],s=B8;function o(a){let l=e.get(a);if(l===void 0){if(s!==B8)return s;e.set(a,l=t.push(a)-1)}return n[l%n.length]}return o.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new f1;for(const l of a)e.has(l)||e.set(l,t.push(l)-1);return o},o.range=function(a){return arguments.length?(n=Array.from(a),o):n.slice()},o.unknown=function(a){return arguments.length?(s=a,o):s},o.copy=function(){return NS(t,n).unknown(s)},Hc.apply(o,arguments),o}function WC(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Vz(e,t){var n=Object.create(e.prototype);for(var s in t)n[s]=t[s];return n}function cm(){}var yg=.7,p1=1/yg,Rf="\\s*([+-]?\\d+)\\s*",vg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Da="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fse=/^#([0-9a-f]{3,8})$/,hse=new RegExp(`^rgb\\(${Rf},${Rf},${Rf}\\)$`),pse=new RegExp(`^rgb\\(${Da},${Da},${Da}\\)$`),gse=new RegExp(`^rgba\\(${Rf},${Rf},${Rf},${vg}\\)$`),mse=new RegExp(`^rgba\\(${Da},${Da},${Da},${vg}\\)$`),xse=new RegExp(`^hsl\\(${vg},${Da},${Da}\\)$`),bse=new RegExp(`^hsla\\(${vg},${Da},${Da},${vg}\\)$`),N8={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};WC(cm,Sg,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:$8,formatHex:$8,formatHex8:yse,formatHsl:vse,formatRgb:H8,toString:H8});function $8(){return this.rgb().formatHex()}function yse(){return this.rgb().formatHex8()}function vse(){return Gz(this).formatHsl()}function H8(){return this.rgb().formatRgb()}function Sg(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=fse.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?W8(t):n===3?new yo(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?a0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?a0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=hse.exec(e))?new yo(t[1],t[2],t[3],1):(t=pse.exec(e))?new yo(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gse.exec(e))?a0(t[1],t[2],t[3],t[4]):(t=mse.exec(e))?a0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=xse.exec(e))?V8(t[1],t[2]/100,t[3]/100,1):(t=bse.exec(e))?V8(t[1],t[2]/100,t[3]/100,t[4]):N8.hasOwnProperty(e)?W8(N8[e]):e==="transparent"?new yo(NaN,NaN,NaN,0):null}function W8(e){return new yo(e>>16&255,e>>8&255,e&255,1)}function a0(e,t,n,s){return s<=0&&(e=t=n=NaN),new yo(e,t,n,s)}function Sse(e){return e instanceof cm||(e=Sg(e)),e?(e=e.rgb(),new yo(e.r,e.g,e.b,e.opacity)):new yo}function $S(e,t,n,s){return arguments.length===1?Sse(e):new yo(e,t,n,s??1)}function yo(e,t,n,s){this.r=+e,this.g=+t,this.b=+n,this.opacity=+s}WC(yo,$S,Vz(cm,{brighter(e){return e=e==null?p1:Math.pow(p1,e),new yo(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?yg:Math.pow(yg,e),new yo(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new yo(ku(this.r),ku(this.g),ku(this.b),g1(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:U8,formatHex:U8,formatHex8:jse,formatRgb:q8,toString:q8}));function U8(){return`#${Cu(this.r)}${Cu(this.g)}${Cu(this.b)}`}function jse(){return`#${Cu(this.r)}${Cu(this.g)}${Cu(this.b)}${Cu((isNaN(this.opacity)?1:this.opacity)*255)}`}function q8(){const e=g1(this.opacity);return`${e===1?"rgb(":"rgba("}${ku(this.r)}, ${ku(this.g)}, ${ku(this.b)}${e===1?")":`, ${e})`}`}function g1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ku(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Cu(e){return e=ku(e),(e<16?"0":"")+e.toString(16)}function V8(e,t,n,s){return s<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new sa(e,t,n,s)}function Gz(e){if(e instanceof sa)return new sa(e.h,e.s,e.l,e.opacity);if(e instanceof cm||(e=Sg(e)),!e)return new sa;if(e instanceof sa)return e;e=e.rgb();var t=e.r/255,n=e.g/255,s=e.b/255,o=Math.min(t,n,s),a=Math.max(t,n,s),l=NaN,u=a-o,d=(a+o)/2;return u?(t===a?l=(n-s)/u+(n<s)*6:n===a?l=(s-t)/u+2:l=(t-n)/u+4,u/=d<.5?a+o:2-a-o,l*=60):u=d>0&&d<1?0:l,new sa(l,u,d,e.opacity)}function Cse(e,t,n,s){return arguments.length===1?Gz(e):new sa(e,t,n,s??1)}function sa(e,t,n,s){this.h=+e,this.s=+t,this.l=+n,this.opacity=+s}WC(sa,Cse,Vz(cm,{brighter(e){return e=e==null?p1:Math.pow(p1,e),new sa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?yg:Math.pow(yg,e),new sa(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,s=n+(n<.5?n:1-n)*t,o=2*n-s;return new yo(f5(e>=240?e-240:e+120,o,s),f5(e,o,s),f5(e<120?e+240:e-120,o,s),this.opacity)},clamp(){return new sa(G8(this.h),l0(this.s),l0(this.l),g1(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=g1(this.opacity);return`${e===1?"hsl(":"hsla("}${G8(this.h)}, ${l0(this.s)*100}%, ${l0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function G8(e){return e=(e||0)%360,e<0?e+360:e}function l0(e){return Math.max(0,Math.min(1,e||0))}function f5(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const UC=e=>()=>e;function wse(e,t){return function(n){return e+n*t}}function Ase(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(s){return Math.pow(e+s*t,n)}}function Ese(e){return(e=+e)==1?Yz:function(t,n){return n-t?Ase(t,n,e):UC(isNaN(t)?n:t)}}function Yz(e,t){var n=t-e;return n?wse(e,n):UC(isNaN(e)?t:e)}const Y8=(function e(t){var n=Ese(t);function s(o,a){var l=n((o=$S(o)).r,(a=$S(a)).r),u=n(o.g,a.g),d=n(o.b,a.b),f=Yz(o.opacity,a.opacity);return function(p){return o.r=l(p),o.g=u(p),o.b=d(p),o.opacity=f(p),o+""}}return s.gamma=e,s})(1);function Tse(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,s=t.slice(),o;return function(a){for(o=0;o<n;++o)s[o]=e[o]*(1-a)+t[o]*a;return s}}function kse(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Mse(e,t){var n=t?t.length:0,s=e?Math.min(n,e.length):0,o=new Array(s),a=new Array(n),l;for(l=0;l<s;++l)o[l]=Bb(e[l],t[l]);for(;l<n;++l)a[l]=t[l];return function(u){for(l=0;l<s;++l)a[l]=o[l](u);return a}}function qC(e,t){var n=new Date;return e=+e,t=+t,function(s){return n.setTime(e*(1-s)+t*s),n}}function Wf(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Rse(e,t){var n={},s={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=Bb(e[o],t[o]):s[o]=t[o];return function(a){for(o in n)s[o]=n[o](a);return s}}var HS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,h5=new RegExp(HS.source,"g");function zse(e){return function(){return e}}function Ise(e){return function(t){return e(t)+""}}function VC(e,t){var n=HS.lastIndex=h5.lastIndex=0,s,o,a,l=-1,u=[],d=[];for(e=e+"",t=t+"";(s=HS.exec(e))&&(o=h5.exec(t));)(a=o.index)>n&&(a=t.slice(n,a),u[l]?u[l]+=a:u[++l]=a),(s=s[0])===(o=o[0])?u[l]?u[l]+=o:u[++l]=o:(u[++l]=null,d.push({i:l,x:Wf(s,o)})),n=h5.lastIndex;return n<t.length&&(a=t.slice(n),u[l]?u[l]+=a:u[++l]=a),u.length<2?d[0]?Ise(d[0].x):zse(t):(t=d.length,function(f){for(var p=0,g;p<t;++p)u[(g=d[p]).i]=g.x(f);return u.join("")})}function Bb(e,t){var n=typeof t,s;return t==null||n==="boolean"?UC(t):(n==="number"?Wf:n==="string"?(s=Sg(t))?(t=s,Y8):VC:t instanceof Sg?Y8:t instanceof Date?qC:kse(t)?Tse:Array.isArray(t)?Mse:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Rse:Wf)(e,t)}function Kz(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Fse(e){return function(){return e}}function _se(e){return+e}var K8=[0,1];function Ei(e){return e}function WS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Fse(isNaN(t)?NaN:.5)}function Lse(e,t){var n;return e>t&&(n=e,e=t,t=n),function(s){return Math.max(e,Math.min(t,s))}}function Pse(e,t,n){var s=e[0],o=e[1],a=t[0],l=t[1];return o<s?(s=WS(o,s),a=n(l,a)):(s=WS(s,o),a=n(a,l)),function(u){return a(s(u))}}function Dse(e,t,n){var s=Math.min(e.length,t.length)-1,o=new Array(s),a=new Array(s),l=-1;for(e[s]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<s;)o[l]=WS(e[l],e[l+1]),a[l]=n(t[l],t[l+1]);return function(u){var d=qz(e,u,1,s)-1;return a[d](o[d](u))}}function um(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Nb(){var e=K8,t=K8,n=Bb,s,o,a,l=Ei,u,d,f;function p(){var x=Math.min(e.length,t.length);return l!==Ei&&(l=Lse(e[0],e[x-1])),u=x>2?Dse:Pse,d=f=null,g}function g(x){return x==null||isNaN(x=+x)?a:(d||(d=u(e.map(s),t,n)))(s(l(x)))}return g.invert=function(x){return l(o((f||(f=u(t,e.map(s),Wf)))(x)))},g.domain=function(x){return arguments.length?(e=Array.from(x,_se),p()):e.slice()},g.range=function(x){return arguments.length?(t=Array.from(x),p()):t.slice()},g.rangeRound=function(x){return t=Array.from(x),n=Kz,p()},g.clamp=function(x){return arguments.length?(l=x?!0:Ei,p()):l!==Ei},g.interpolate=function(x){return arguments.length?(n=x,p()):n},g.unknown=function(x){return arguments.length?(a=x,g):a},function(x,b){return s=x,o=b,p()}}function Xz(){return Nb()(Ei,Ei)}function Ose(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function m1(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),s=e.slice(0,n);return[s.length>1?s[0]+s.slice(2):s,+e.slice(n+1)]}function Uf(e){return e=m1(Math.abs(e)),e?e[1]:NaN}function Bse(e,t){return function(n,s){for(var o=n.length,a=[],l=0,u=e[0],d=0;o>0&&u>0&&(d+u+1>s&&(u=Math.max(1,s-d)),a.push(n.substring(o-=u,o+u)),!((d+=u+1)>s));)u=e[l=(l+1)%e.length];return a.reverse().join(t)}}function Nse(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var $se=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function jg(e){if(!(t=$se.exec(e)))throw new Error("invalid format: "+e);var t;return new GC({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}jg.prototype=GC.prototype;function GC(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}GC.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Hse(e){e:for(var t=e.length,n=1,s=-1,o;n<t;++n)switch(e[n]){case".":s=o=n;break;case"0":s===0&&(s=n),o=n;break;default:if(!+e[n])break e;s>0&&(s=0);break}return s>0?e.slice(0,s)+e.slice(o+1):e}var x1;function Wse(e,t){var n=m1(e,t);if(!n)return x1=void 0,e.toPrecision(t);var s=n[0],o=n[1],a=o-(x1=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,l=s.length;return a===l?s:a>l?s+new Array(a-l+1).join("0"):a>0?s.slice(0,a)+"."+s.slice(a):"0."+new Array(1-a).join("0")+m1(e,Math.max(0,t+a-1))[0]}function X8(e,t){var n=m1(e,t);if(!n)return e+"";var s=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+s:s.length>o+1?s.slice(0,o+1)+"."+s.slice(o+1):s+new Array(o-s.length+2).join("0")}const Z8={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Ose,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>X8(e*100,t),r:X8,s:Wse,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Q8(e){return e}var J8=Array.prototype.map,e9=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Use(e){var t=e.grouping===void 0||e.thousands===void 0?Q8:Bse(J8.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",s=e.currency===void 0?"":e.currency[1]+"",o=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?Q8:Nse(J8.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(g,x){g=jg(g);var b=g.fill,y=g.align,S=g.sign,j=g.symbol,A=g.zero,M=g.width,R=g.comma,_=g.precision,z=g.trim,F=g.type;F==="n"?(R=!0,F="g"):Z8[F]||(_===void 0&&(_=12),z=!0,F="g"),(A||b==="0"&&y==="=")&&(A=!0,b="0",y="=");var N=(x&&x.prefix!==void 0?x.prefix:"")+(j==="$"?n:j==="#"&&/[boxX]/.test(F)?"0"+F.toLowerCase():""),I=(j==="$"?s:/[%p]/.test(F)?l:"")+(x&&x.suffix!==void 0?x.suffix:""),B=Z8[F],H=/[defgprs%]/.test(F);_=_===void 0?6:/[gprs]/.test(F)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function P(k){var L=N,O=I,W,D,q;if(F==="c")O=B(k)+O,k="";else{k=+k;var K=k<0||1/k<0;if(k=isNaN(k)?d:B(Math.abs(k),_),z&&(k=Hse(k)),K&&+k==0&&S!=="+"&&(K=!1),L=(K?S==="("?S:u:S==="-"||S==="("?"":S)+L,O=(F==="s"&&!isNaN(k)&&x1!==void 0?e9[8+x1/3]:"")+O+(K&&S==="("?")":""),H){for(W=-1,D=k.length;++W<D;)if(q=k.charCodeAt(W),48>q||q>57){O=(q===46?o+k.slice(W+1):k.slice(W))+O,k=k.slice(0,W);break}}}R&&!A&&(k=t(k,1/0));var Y=L.length+k.length+O.length,ie=Y<M?new Array(M-Y+1).join(b):"";switch(R&&A&&(k=t(ie+k,ie.length?M-O.length:1/0),ie=""),y){case"<":k=L+k+O+ie;break;case"=":k=L+ie+k+O;break;case"^":k=ie.slice(0,Y=ie.length>>1)+L+k+O+ie.slice(Y);break;default:k=ie+L+k+O;break}return a(k)}return P.toString=function(){return g+""},P}function p(g,x){var b=Math.max(-8,Math.min(8,Math.floor(Uf(x)/3)))*3,y=Math.pow(10,-b),S=f((g=jg(g),g.type="f",g),{suffix:e9[8+b/3]});return function(j){return S(y*j)}}return{format:f,formatPrefix:p}}var c0,YC,Zz;qse({thousands:",",grouping:[3],currency:["$",""]});function qse(e){return c0=Use(e),YC=c0.format,Zz=c0.formatPrefix,c0}function Vse(e){return Math.max(0,-Uf(Math.abs(e)))}function Gse(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Uf(t)/3)))*3-Uf(Math.abs(e)))}function Yse(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Uf(t)-Uf(e))+1}function Kse(e,t,n,s){var o=BS(e,t,n),a;switch(s=jg(s??",f"),s.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return s.precision==null&&!isNaN(a=Gse(o,l))&&(s.precision=a),Zz(s,l)}case"":case"e":case"g":case"p":case"r":{s.precision==null&&!isNaN(a=Yse(o,Math.max(Math.abs(e),Math.abs(t))))&&(s.precision=a-(s.type==="e"));break}case"f":case"%":{s.precision==null&&!isNaN(a=Vse(o))&&(s.precision=a-(s.type==="%")*2);break}}return YC(s)}function $b(e){var t=e.domain;return e.ticks=function(n){var s=t();return DS(s[0],s[s.length-1],n??10)},e.tickFormat=function(n,s){var o=t();return Kse(o[0],o[o.length-1],n??10,s)},e.nice=function(n){n==null&&(n=10);var s=t(),o=0,a=s.length-1,l=s[o],u=s[a],d,f,p=10;for(u<l&&(f=l,l=u,u=f,f=o,o=a,a=f);p-- >0;){if(f=OS(l,u,n),f===d)return s[o]=l,s[a]=u,t(s);if(f>0)l=Math.floor(l/f)*f,u=Math.ceil(u/f)*f;else if(f<0)l=Math.ceil(l*f)/f,u=Math.floor(u*f)/f;else break;d=f}return e},e}function KC(){var e=Xz();return e.copy=function(){return um(e,KC())},Hc.apply(e,arguments),$b(e)}function Qz(e,t){e=e.slice();var n=0,s=e.length-1,o=e[n],a=e[s],l;return a<o&&(l=n,n=s,s=l,l=o,o=a,a=l),e[n]=t.floor(o),e[s]=t.ceil(a),e}function t9(e){return Math.log(e)}function n9(e){return Math.exp(e)}function Xse(e){return-Math.log(-e)}function Zse(e){return-Math.exp(-e)}function Qse(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Jse(e){return e===10?Qse:e===Math.E?Math.exp:t=>Math.pow(e,t)}function eoe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function r9(e){return(t,n)=>-e(-t,n)}function toe(e){const t=e(t9,n9),n=t.domain;let s=10,o,a;function l(){return o=eoe(s),a=Jse(s),n()[0]<0?(o=r9(o),a=r9(a),e(Xse,Zse)):e(t9,n9),t}return t.base=function(u){return arguments.length?(s=+u,l()):s},t.domain=function(u){return arguments.length?(n(u),l()):n()},t.ticks=u=>{const d=n();let f=d[0],p=d[d.length-1];const g=p<f;g&&([f,p]=[p,f]);let x=o(f),b=o(p),y,S;const j=u==null?10:+u;let A=[];if(!(s%1)&&b-x<j){if(x=Math.floor(x),b=Math.ceil(b),f>0){for(;x<=b;++x)for(y=1;y<s;++y)if(S=x<0?y/a(-x):y*a(x),!(S<f)){if(S>p)break;A.push(S)}}else for(;x<=b;++x)for(y=s-1;y>=1;--y)if(S=x>0?y/a(-x):y*a(x),!(S<f)){if(S>p)break;A.push(S)}A.length*2<j&&(A=DS(f,p,j))}else A=DS(x,b,Math.min(b-x,j)).map(a);return g?A.reverse():A},t.tickFormat=(u,d)=>{if(u==null&&(u=10),d==null&&(d=s===10?"s":","),typeof d!="function"&&(!(s%1)&&(d=jg(d)).precision==null&&(d.trim=!0),d=YC(d)),u===1/0)return d;const f=Math.max(1,s*u/t.ticks().length);return p=>{let g=p/a(Math.round(o(p)));return g*s<s-.5&&(g*=s),g<=f?d(p):""}},t.nice=()=>n(Qz(n(),{floor:u=>a(Math.floor(o(u))),ceil:u=>a(Math.ceil(o(u)))})),t}function b1(){const e=toe(Nb()).domain([1,10]);return e.copy=()=>um(e,b1()).base(e.base()),Hc.apply(e,arguments),e}function s9(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function o9(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function noe(e){var t=1,n=e(s9(t),o9(t));return n.constant=function(s){return arguments.length?e(s9(t=+s),o9(t)):t},$b(n)}function Jz(){var e=noe(Nb());return e.copy=function(){return um(e,Jz()).constant(e.constant())},Hc.apply(e,arguments)}function i9(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function roe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function soe(e){return e<0?-e*e:e*e}function ooe(e){var t=e(Ei,Ei),n=1;function s(){return n===1?e(Ei,Ei):n===.5?e(roe,soe):e(i9(n),i9(1/n))}return t.exponent=function(o){return arguments.length?(n=+o,s()):n},$b(t)}function XC(){var e=ooe(Nb());return e.copy=function(){return um(e,XC()).exponent(e.exponent())},Hc.apply(e,arguments),e}function ioe(){return XC.apply(null,arguments).exponent(.5)}function eI(){var e=[.5],t=[0,1],n,s=1;function o(a){return a!=null&&a<=a?t[qz(e,a,0,s)]:n}return o.domain=function(a){return arguments.length?(e=Array.from(a),s=Math.min(e.length,t.length-1),o):e.slice()},o.range=function(a){return arguments.length?(t=Array.from(a),s=Math.min(e.length,t.length-1),o):t.slice()},o.invertExtent=function(a){var l=t.indexOf(a);return[e[l-1],e[l]]},o.unknown=function(a){return arguments.length?(n=a,o):n},o.copy=function(){return eI().domain(e).range(t).unknown(n)},Hc.apply(o,arguments)}const p5=new Date,g5=new Date;function js(e,t,n,s){function o(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return o.floor=a=>(e(a=new Date(+a)),a),o.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),o.round=a=>{const l=o(a),u=o.ceil(a);return a-l<u-a?l:u},o.offset=(a,l)=>(t(a=new Date(+a),l==null?1:Math.floor(l)),a),o.range=(a,l,u)=>{const d=[];if(a=o.ceil(a),u=u==null?1:Math.floor(u),!(a<l)||!(u>0))return d;let f;do d.push(f=new Date(+a)),t(a,u),e(a);while(f<a&&a<l);return d},o.filter=a=>js(l=>{if(l>=l)for(;e(l),!a(l);)l.setTime(l-1)},(l,u)=>{if(l>=l)if(u<0)for(;++u<=0;)for(;t(l,-1),!a(l););else for(;--u>=0;)for(;t(l,1),!a(l););}),n&&(o.count=(a,l)=>(p5.setTime(+a),g5.setTime(+l),e(p5),e(g5),Math.floor(n(p5,g5))),o.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?o.filter(s?l=>s(l)%a===0:l=>o.count(0,l)%a===0):o)),o}const y1=js(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);y1.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?js(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):y1);y1.range;const vl=1e3,Ti=vl*60,Sl=Ti*60,kl=Sl*24,ZC=kl*7,a9=kl*30,m5=kl*365,wu=js(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*vl)},(e,t)=>(t-e)/vl,e=>e.getUTCSeconds());wu.range;const QC=js(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vl)},(e,t)=>{e.setTime(+e+t*Ti)},(e,t)=>(t-e)/Ti,e=>e.getMinutes());QC.range;const JC=js(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ti)},(e,t)=>(t-e)/Ti,e=>e.getUTCMinutes());JC.range;const ew=js(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vl-e.getMinutes()*Ti)},(e,t)=>{e.setTime(+e+t*Sl)},(e,t)=>(t-e)/Sl,e=>e.getHours());ew.range;const tw=js(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Sl)},(e,t)=>(t-e)/Sl,e=>e.getUTCHours());tw.range;const dm=js(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ti)/kl,e=>e.getDate()-1);dm.range;const Hb=js(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/kl,e=>e.getUTCDate()-1);Hb.range;const tI=js(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/kl,e=>Math.floor(e/kl));tI.range;function Ju(e){return js(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Ti)/ZC)}const Wb=Ju(0),v1=Ju(1),aoe=Ju(2),loe=Ju(3),qf=Ju(4),coe=Ju(5),uoe=Ju(6);Wb.range;v1.range;aoe.range;loe.range;qf.range;coe.range;uoe.range;function ed(e){return js(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/ZC)}const Ub=ed(0),S1=ed(1),doe=ed(2),foe=ed(3),Vf=ed(4),hoe=ed(5),poe=ed(6);Ub.range;S1.range;doe.range;foe.range;Vf.range;hoe.range;poe.range;const nw=js(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());nw.range;const rw=js(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());rw.range;const Ml=js(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Ml.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:js(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Ml.range;const Rl=js(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Rl.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:js(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Rl.range;function nI(e,t,n,s,o,a){const l=[[wu,1,vl],[wu,5,5*vl],[wu,15,15*vl],[wu,30,30*vl],[a,1,Ti],[a,5,5*Ti],[a,15,15*Ti],[a,30,30*Ti],[o,1,Sl],[o,3,3*Sl],[o,6,6*Sl],[o,12,12*Sl],[s,1,kl],[s,2,2*kl],[n,1,ZC],[t,1,a9],[t,3,3*a9],[e,1,m5]];function u(f,p,g){const x=p<f;x&&([f,p]=[p,f]);const b=g&&typeof g.range=="function"?g:d(f,p,g),y=b?b.range(f,+p+1):[];return x?y.reverse():y}function d(f,p,g){const x=Math.abs(p-f)/g,b=HC(([,,j])=>j).right(l,x);if(b===l.length)return e.every(BS(f/m5,p/m5,g));if(b===0)return y1.every(Math.max(BS(f,p,g),1));const[y,S]=l[x/l[b-1][2]<l[b][2]/x?b-1:b];return y.every(S)}return[u,d]}const[goe,moe]=nI(Rl,rw,Ub,tI,tw,JC),[xoe,boe]=nI(Ml,nw,Wb,dm,ew,QC);function x5(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function b5(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function fp(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function yoe(e){var t=e.dateTime,n=e.date,s=e.time,o=e.periods,a=e.days,l=e.shortDays,u=e.months,d=e.shortMonths,f=hp(o),p=pp(o),g=hp(a),x=pp(a),b=hp(l),y=pp(l),S=hp(u),j=pp(u),A=hp(d),M=pp(d),R={a:q,A:K,b:Y,B:ie,c:null,d:h9,e:h9,f:Hoe,g:Qoe,G:eie,H:Boe,I:Noe,j:$oe,L:rI,m:Woe,M:Uoe,p:V,q:re,Q:m9,s:x9,S:qoe,u:Voe,U:Goe,V:Yoe,w:Koe,W:Xoe,x:null,X:null,y:Zoe,Y:Joe,Z:tie,"%":g9},_={a:fe,A:ae,b:ue,B:se,c:null,d:p9,e:p9,f:oie,g:gie,G:xie,H:nie,I:rie,j:sie,L:oI,m:iie,M:aie,p:J,q:ce,Q:m9,s:x9,S:lie,u:cie,U:uie,V:die,w:fie,W:hie,x:null,X:null,y:pie,Y:mie,Z:bie,"%":g9},z={a:H,A:P,b:k,B:L,c:O,d:d9,e:d9,f:Loe,g:u9,G:c9,H:f9,I:f9,j:zoe,L:_oe,m:Roe,M:Ioe,p:B,q:Moe,Q:Doe,s:Ooe,S:Foe,u:woe,U:Aoe,V:Eoe,w:Coe,W:Toe,x:W,X:D,y:u9,Y:c9,Z:koe,"%":Poe};R.x=F(n,R),R.X=F(s,R),R.c=F(t,R),_.x=F(n,_),_.X=F(s,_),_.c=F(t,_);function F(oe,ge){return function(de){var le=[],ee=-1,X=0,ve=oe.length,st,Ge,qe;for(de instanceof Date||(de=new Date(+de));++ee<ve;)oe.charCodeAt(ee)===37&&(le.push(oe.slice(X,ee)),(Ge=l9[st=oe.charAt(++ee)])!=null?st=oe.charAt(++ee):Ge=st==="e"?" ":"0",(qe=ge[st])&&(st=qe(de,Ge)),le.push(st),X=ee+1);return le.push(oe.slice(X,ee)),le.join("")}}function N(oe,ge){return function(de){var le=fp(1900,void 0,1),ee=I(le,oe,de+="",0),X,ve;if(ee!=de.length)return null;if("Q"in le)return new Date(le.Q);if("s"in le)return new Date(le.s*1e3+("L"in le?le.L:0));if(ge&&!("Z"in le)&&(le.Z=0),"p"in le&&(le.H=le.H%12+le.p*12),le.m===void 0&&(le.m="q"in le?le.q:0),"V"in le){if(le.V<1||le.V>53)return null;"w"in le||(le.w=1),"Z"in le?(X=b5(fp(le.y,0,1)),ve=X.getUTCDay(),X=ve>4||ve===0?S1.ceil(X):S1(X),X=Hb.offset(X,(le.V-1)*7),le.y=X.getUTCFullYear(),le.m=X.getUTCMonth(),le.d=X.getUTCDate()+(le.w+6)%7):(X=x5(fp(le.y,0,1)),ve=X.getDay(),X=ve>4||ve===0?v1.ceil(X):v1(X),X=dm.offset(X,(le.V-1)*7),le.y=X.getFullYear(),le.m=X.getMonth(),le.d=X.getDate()+(le.w+6)%7)}else("W"in le||"U"in le)&&("w"in le||(le.w="u"in le?le.u%7:"W"in le?1:0),ve="Z"in le?b5(fp(le.y,0,1)).getUTCDay():x5(fp(le.y,0,1)).getDay(),le.m=0,le.d="W"in le?(le.w+6)%7+le.W*7-(ve+5)%7:le.w+le.U*7-(ve+6)%7);return"Z"in le?(le.H+=le.Z/100|0,le.M+=le.Z%100,b5(le)):x5(le)}}function I(oe,ge,de,le){for(var ee=0,X=ge.length,ve=de.length,st,Ge;ee<X;){if(le>=ve)return-1;if(st=ge.charCodeAt(ee++),st===37){if(st=ge.charAt(ee++),Ge=z[st in l9?ge.charAt(ee++):st],!Ge||(le=Ge(oe,de,le))<0)return-1}else if(st!=de.charCodeAt(le++))return-1}return le}function B(oe,ge,de){var le=f.exec(ge.slice(de));return le?(oe.p=p.get(le[0].toLowerCase()),de+le[0].length):-1}function H(oe,ge,de){var le=b.exec(ge.slice(de));return le?(oe.w=y.get(le[0].toLowerCase()),de+le[0].length):-1}function P(oe,ge,de){var le=g.exec(ge.slice(de));return le?(oe.w=x.get(le[0].toLowerCase()),de+le[0].length):-1}function k(oe,ge,de){var le=A.exec(ge.slice(de));return le?(oe.m=M.get(le[0].toLowerCase()),de+le[0].length):-1}function L(oe,ge,de){var le=S.exec(ge.slice(de));return le?(oe.m=j.get(le[0].toLowerCase()),de+le[0].length):-1}function O(oe,ge,de){return I(oe,t,ge,de)}function W(oe,ge,de){return I(oe,n,ge,de)}function D(oe,ge,de){return I(oe,s,ge,de)}function q(oe){return l[oe.getDay()]}function K(oe){return a[oe.getDay()]}function Y(oe){return d[oe.getMonth()]}function ie(oe){return u[oe.getMonth()]}function V(oe){return o[+(oe.getHours()>=12)]}function re(oe){return 1+~~(oe.getMonth()/3)}function fe(oe){return l[oe.getUTCDay()]}function ae(oe){return a[oe.getUTCDay()]}function ue(oe){return d[oe.getUTCMonth()]}function se(oe){return u[oe.getUTCMonth()]}function J(oe){return o[+(oe.getUTCHours()>=12)]}function ce(oe){return 1+~~(oe.getUTCMonth()/3)}return{format:function(oe){var ge=F(oe+="",R);return ge.toString=function(){return oe},ge},parse:function(oe){var ge=N(oe+="",!1);return ge.toString=function(){return oe},ge},utcFormat:function(oe){var ge=F(oe+="",_);return ge.toString=function(){return oe},ge},utcParse:function(oe){var ge=N(oe+="",!0);return ge.toString=function(){return oe},ge}}}var l9={"-":"",_:" ",0:"0"},Es=/^\s*\d+/,voe=/^%/,Soe=/[\\^$*+?|[\]().{}]/g;function Kn(e,t,n){var s=e<0?"-":"",o=(s?-e:e)+"",a=o.length;return s+(a<n?new Array(n-a+1).join(t)+o:o)}function joe(e){return e.replace(Soe,"\\$&")}function hp(e){return new RegExp("^(?:"+e.map(joe).join("|")+")","i")}function pp(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Coe(e,t,n){var s=Es.exec(t.slice(n,n+1));return s?(e.w=+s[0],n+s[0].length):-1}function woe(e,t,n){var s=Es.exec(t.slice(n,n+1));return s?(e.u=+s[0],n+s[0].length):-1}function Aoe(e,t,n){var s=Es.exec(t.slice(n,n+2));return s?(e.U=+s[0],n+s[0].length):-1}function Eoe(e,t,n){var s=Es.exec(t.slice(n,n+2));return s?(e.V=+s[0],n+s[0].length):-1}function Toe(e,t,n){var s=Es.exec(t.slice(n,n+2));return s?(e.W=+s[0],n+s[0].length):-1}function c9(e,t,n){var s=Es.exec(t.slice(n,n+4));return s?(e.y=+s[0],n+s[0].length):-1}function u9(e,t,n){var s=Es.exec(t.slice(n,n+2));return s?(e.y=+s[0]+(+s[0]>68?1900:2e3),n+s[0].length):-1}function koe(e,t,n){var s=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return s?(e.Z=s[1]?0:-(s[2]+(s[3]||"00")),n+s[0].length):-1}function Moe(e,t,n){var s=Es.exec(t.slice(n,n+1));return s?(e.q=s[0]*3-3,n+s[0].length):-1}function Roe(e,t,n){var s=Es.exec(t.slice(n,n+2));return s?(e.m=s[0]-1,n+s[0].length):-1}function d9(e,t,n){var s=Es.exec(t.slice(n,n+2));return s?(e.d=+s[0],n+s[0].length):-1}function zoe(e,t,n){var s=Es.exec(t.slice(n,n+3));return s?(e.m=0,e.d=+s[0],n+s[0].length):-1}function f9(e,t,n){var s=Es.exec(t.slice(n,n+2));return s?(e.H=+s[0],n+s[0].length):-1}function Ioe(e,t,n){var s=Es.exec(t.slice(n,n+2));return s?(e.M=+s[0],n+s[0].length):-1}function Foe(e,t,n){var s=Es.exec(t.slice(n,n+2));return s?(e.S=+s[0],n+s[0].length):-1}function _oe(e,t,n){var s=Es.exec(t.slice(n,n+3));return s?(e.L=+s[0],n+s[0].length):-1}function Loe(e,t,n){var s=Es.exec(t.slice(n,n+6));return s?(e.L=Math.floor(s[0]/1e3),n+s[0].length):-1}function Poe(e,t,n){var s=voe.exec(t.slice(n,n+1));return s?n+s[0].length:-1}function Doe(e,t,n){var s=Es.exec(t.slice(n));return s?(e.Q=+s[0],n+s[0].length):-1}function Ooe(e,t,n){var s=Es.exec(t.slice(n));return s?(e.s=+s[0],n+s[0].length):-1}function h9(e,t){return Kn(e.getDate(),t,2)}function Boe(e,t){return Kn(e.getHours(),t,2)}function Noe(e,t){return Kn(e.getHours()%12||12,t,2)}function $oe(e,t){return Kn(1+dm.count(Ml(e),e),t,3)}function rI(e,t){return Kn(e.getMilliseconds(),t,3)}function Hoe(e,t){return rI(e,t)+"000"}function Woe(e,t){return Kn(e.getMonth()+1,t,2)}function Uoe(e,t){return Kn(e.getMinutes(),t,2)}function qoe(e,t){return Kn(e.getSeconds(),t,2)}function Voe(e){var t=e.getDay();return t===0?7:t}function Goe(e,t){return Kn(Wb.count(Ml(e)-1,e),t,2)}function sI(e){var t=e.getDay();return t>=4||t===0?qf(e):qf.ceil(e)}function Yoe(e,t){return e=sI(e),Kn(qf.count(Ml(e),e)+(Ml(e).getDay()===4),t,2)}function Koe(e){return e.getDay()}function Xoe(e,t){return Kn(v1.count(Ml(e)-1,e),t,2)}function Zoe(e,t){return Kn(e.getFullYear()%100,t,2)}function Qoe(e,t){return e=sI(e),Kn(e.getFullYear()%100,t,2)}function Joe(e,t){return Kn(e.getFullYear()%1e4,t,4)}function eie(e,t){var n=e.getDay();return e=n>=4||n===0?qf(e):qf.ceil(e),Kn(e.getFullYear()%1e4,t,4)}function tie(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Kn(t/60|0,"0",2)+Kn(t%60,"0",2)}function p9(e,t){return Kn(e.getUTCDate(),t,2)}function nie(e,t){return Kn(e.getUTCHours(),t,2)}function rie(e,t){return Kn(e.getUTCHours()%12||12,t,2)}function sie(e,t){return Kn(1+Hb.count(Rl(e),e),t,3)}function oI(e,t){return Kn(e.getUTCMilliseconds(),t,3)}function oie(e,t){return oI(e,t)+"000"}function iie(e,t){return Kn(e.getUTCMonth()+1,t,2)}function aie(e,t){return Kn(e.getUTCMinutes(),t,2)}function lie(e,t){return Kn(e.getUTCSeconds(),t,2)}function cie(e){var t=e.getUTCDay();return t===0?7:t}function uie(e,t){return Kn(Ub.count(Rl(e)-1,e),t,2)}function iI(e){var t=e.getUTCDay();return t>=4||t===0?Vf(e):Vf.ceil(e)}function die(e,t){return e=iI(e),Kn(Vf.count(Rl(e),e)+(Rl(e).getUTCDay()===4),t,2)}function fie(e){return e.getUTCDay()}function hie(e,t){return Kn(S1.count(Rl(e)-1,e),t,2)}function pie(e,t){return Kn(e.getUTCFullYear()%100,t,2)}function gie(e,t){return e=iI(e),Kn(e.getUTCFullYear()%100,t,2)}function mie(e,t){return Kn(e.getUTCFullYear()%1e4,t,4)}function xie(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Vf(e):Vf.ceil(e),Kn(e.getUTCFullYear()%1e4,t,4)}function bie(){return"+0000"}function g9(){return"%"}function m9(e){return+e}function x9(e){return Math.floor(+e/1e3)}var Zd,aI,lI;yie({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function yie(e){return Zd=yoe(e),aI=Zd.format,Zd.parse,lI=Zd.utcFormat,Zd.utcParse,Zd}function vie(e){return new Date(e)}function Sie(e){return e instanceof Date?+e:+new Date(+e)}function sw(e,t,n,s,o,a,l,u,d,f){var p=Xz(),g=p.invert,x=p.domain,b=f(".%L"),y=f(":%S"),S=f("%I:%M"),j=f("%I %p"),A=f("%a %d"),M=f("%b %d"),R=f("%B"),_=f("%Y");function z(F){return(d(F)<F?b:u(F)<F?y:l(F)<F?S:a(F)<F?j:s(F)<F?o(F)<F?A:M:n(F)<F?R:_)(F)}return p.invert=function(F){return new Date(g(F))},p.domain=function(F){return arguments.length?x(Array.from(F,Sie)):x().map(vie)},p.ticks=function(F){var N=x();return e(N[0],N[N.length-1],F??10)},p.tickFormat=function(F,N){return N==null?z:f(N)},p.nice=function(F){var N=x();return(!F||typeof F.range!="function")&&(F=t(N[0],N[N.length-1],F??10)),F?x(Qz(N,F)):p},p.copy=function(){return um(p,sw(e,t,n,s,o,a,l,u,d,f))},p}function cI(){return Hc.apply(sw(xoe,boe,Ml,nw,Wb,dm,ew,QC,wu,aI).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function jie(){return Hc.apply(sw(goe,moe,Rl,rw,Ub,Hb,tw,JC,wu,lI).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Cie(){var e=0,t=1,n,s,o,a,l=Ei,u=!1,d;function f(g){return g==null||isNaN(g=+g)?d:l(o===0?.5:(g=(a(g)-n)*o,u?Math.max(0,Math.min(1,g)):g))}f.domain=function(g){return arguments.length?([e,t]=g,n=a(e=+e),s=a(t=+t),o=n===s?0:1/(s-n),f):[e,t]},f.clamp=function(g){return arguments.length?(u=!!g,f):u},f.interpolator=function(g){return arguments.length?(l=g,f):l};function p(g){return function(x){var b,y;return arguments.length?([b,y]=x,l=g(b,y),f):[l(0),l(1)]}}return f.range=p(Bb),f.rangeRound=p(Kz),f.unknown=function(g){return arguments.length?(d=g,f):d},function(g){return a=g,n=g(e),s=g(t),o=n===s?0:1/(s-n),f}}function wie(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function uI(){var e=$b(Cie()(Ei));return e.copy=function(){return wie(e,uI())},dse.apply(e,arguments)}function dI(e){return e.type==="piecewise"?eI(e.thresholds,e.colors):uI([e.min??0,e.max??100],e.color)}function Gf(e){return e.values?NS(e.values,e.colors).unknown(e.unknownColor??null):NS(e.colors.map((t,n)=>n),e.colors).unknown(e.unknownColor??null)}function zf(e){return e.type==="ordinal"?Gf(e):dI(e)}function qb(e,t,n){const{tickMaxStep:s,tickMinStep:o,tickNumber:a}=e,l=o===void 0?999:Math.floor(Math.abs(t[1]-t[0])/o),u=s===void 0?2:Math.ceil(Math.abs(t[1]-t[0])/s);return Math.min(l,Math.max(u,a??n))}function fI(e,t){return t[1]-t[0]===0?1:e/((t[1]-t[0])/100)}function ow(e){return Math.floor(Math.abs(e)/50)}function b9(e){return Array.isArray(e)?JSON.stringify(e):typeof e=="object"&&e!==null?e.valueOf():e}function Vb(...e){let t=new f1(void 0,b9),n=[],s=[],o=0,a=1,l,u,d=!1,f=0,p=0,g=.5;const x=j=>{const A=t.get(j);if(A!==void 0)return s[A%s.length]},b=()=>{const j=n.length,A=a<o,M=A?a:o,R=A?o:a;l=(R-M)/Math.max(1,j-f+p*2),d&&(l=Math.floor(l));const _=M+(R-M-l*(j-f))*g;u=l*(1-f);const z=d?Math.round(_):_;u=d?Math.round(u):u;const N=use(j).map(I=>z+l*I);return s=A?N.reverse():N,x};x.domain=function(j){if(!arguments.length)return n.slice();n=[],t=new f1(void 0,b9);for(const A of j)t.has(A)||t.set(A,n.push(A)-1);return b()},x.range=function(j){if(!arguments.length)return[o,a];const[A,M]=j;return o=+A,a=+M,b()},x.rangeRound=function(j){const[A,M]=j;return o=+A,a=+M,d=!0,b()},x.bandwidth=function(){return u},x.step=function(){return l},x.round=function(j){return arguments.length?(d=!!j,b()):d},x.padding=function(j){return arguments.length?(f=Math.min(1,p=+j),b()):f},x.paddingInner=function(j){return arguments.length?(f=Math.min(1,j),b()):f},x.paddingOuter=function(j){return arguments.length?(p=+j,b()):p},x.align=function(j){return arguments.length?(g=Math.max(0,Math.min(1,j)),b()):g},x.copy=()=>Vb(n,[o,a]).round(d).paddingInner(f).paddingOuter(p).align(g);const[y,S]=e;return e.length>1?(x.domain(y),x.range(S)):y?x.range(y):b(),x}function hI(...e){const t=Vb(...e).paddingInner(1),n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=()=>{const s=n();return s.padding=s.paddingOuter,delete s.paddingInner,delete s.paddingOuter,s.copy=t.copy,s},t}function pI(...e){const t=Jz(...e),n=t.ticks,{negativeScale:s,linearScale:o,positiveScale:a}=Aie(t);return t.ticks=l=>{const u=n(l),d=t.constant();let f=0,p=0,g=0;u.forEach(b=>{b>-d&&b<d&&(p+=1),b<=-d&&(f+=1),b>=d&&(g+=1)});const x=[];if(f>0&&x.push(...s.ticks(f)),p>0){const b=o.ticks(p);x.at(-1)===b[0]?x.push(...b.slice(1)):x.push(...b)}if(g>0){const b=a.ticks(g);x.at(-1)===b[0]?x.push(...b.slice(1)):x.push(...b)}return x},t.tickFormat=(l=10,u)=>{const d=t.constant(),[f,p]=t.domain(),g=p-f,x=s.domain(),b=x[1]-x[0],S=(g===0?0:b/g)*l,j=o.domain(),A=j[1]-j[0],R=(g===0?0:A/g)*l,_=a.domain(),z=_[1]-_[0],N=(g===0?0:z/g)*l,I=s.tickFormat(S,u),B=o.tickFormat(R,u),H=a.tickFormat(N,u);return P=>(P.valueOf()<=-d?I:P.valueOf()>=d?H:B)(P)},t.copy=()=>pI(t.domain(),t.range()).constant(t.constant()),t}function Aie(e){const t=e.constant(),n=e.domain(),s=[n[0],Math.min(n[1],-t)],o=b1(s,e.range()),a=[Math.max(n[0],-t),Math.min(n[1],t)],l=KC(a,e.range()),u=[Math.max(n[0],t),n[1]],d=b1(u,e.range());return{negativeScale:o,linearScale:l,positiveScale:d}}function Gb(e,t,n){switch(e){case"log":return b1(t,n);case"pow":return XC(t,n);case"sqrt":return ioe(t,n);case"time":return cI(t,n);case"utc":return jie(t,n);case"symlog":return pI(t,n);default:return KC(t,n)}}const j1=e=>e?.[0]instanceof Date;function US(e,t,n){const s=cI(e,t);return(o,{location:a})=>a==="tick"?s.tickFormat(n)(o):`${o.toLocaleString()}`}let y9,v9;class Eie{types=new Set;constructor(){if(y9)throw new Error("You can only create one instance!");y9=this.types}addType(t){this.types.add(t)}getTypes(){return this.types}}class Tie{types=new Set;constructor(){if(v9)throw new Error("You can only create one instance!");v9=this.types}addType(t){this.types.add(t)}getTypes(){return this.types}}const Yb=new Eie;Yb.addType("bar");Yb.addType("line");Yb.addType("scatter");const gI=new Tie;gI.addType("radar");function Kb(e){return Yb.getTypes().has(e)}function C1(e){return Kb(e.type)}const kie=(e,t,n,s)=>{const o=new Set;return Object.keys(t).filter(Kb).forEach(l=>{const u=n[l]?.series??{},d=t[l].axisTooltipGetter?.(u);d!==void 0&&d.forEach(({axisId:f,direction:p})=>{p===e&&o.add(f??s)})}),o};function Ss(e){return e.bandwidth!==void 0}function Mie(e){return Ss(e)&&e.paddingOuter!==void 0}function Rie(e,t,n){const s=t==="x"?[e.left,e.left+e.width]:[e.top+e.height,e.top];return n?[s[1],s[0]]:s}function zie(e,t){return e.step()*t<.1}const Iie=.2,Fie=.1;function mI({scales:e,drawingArea:t,formattedSeries:n,axis:s,seriesConfig:o,axisDirection:a,zoomMap:l,domains:u}){if(s===void 0)return{axis:{},axisIds:[]};const d=kie(a,o,n,s[0].id),f={};return s.forEach(p=>{const g=p,x=e[g.id],b=l?.get(g.id),y=b?[b.start,b.end]:[0,100],S=Rie(t,a,g.reverse??!1),j=u[g.id].tickNumber,A=!g.ignoreTooltip&&d.has(g.id),M=fI(j,y),R=g.data??[];if(Ss(x)){const F=a==="y"?[S[1],S[0]]:S;if(Mie(x)&&Zu(g)){const N=g.categoryGapRatio??Iie,I=zie(x,N),B=I?0:N,H=I?0:g.barGapRatio??Fie;f[g.id]=Ce({offset:0,height:0,categoryGapRatio:B,barGapRatio:H,triggerTooltip:A},g,{data:R,scale:I?x.copy().padding(0):x,tickNumber:M,colorScale:g.colorMap&&(g.colorMap.type==="ordinal"?Gf(Ce({values:g.data},g.colorMap)):zf(g.colorMap))})}if(Qu(g)&&(f[g.id]=Ce({offset:0,height:0,triggerTooltip:A},g,{data:R,scale:x,tickNumber:M,colorScale:g.colorMap&&(g.colorMap.type==="ordinal"?Gf(Ce({values:g.data},g.colorMap)):zf(g.colorMap))})),j1(g.data)){const N=US(g.data,F,g.tickNumber);f[g.id].valueFormatter=g.valueFormatter??N}return}if(g.scaleType==="band"||g.scaleType==="point")return;const _=g,z=_.scaleType??"linear";f[g.id]=Ce({offset:0,height:0,triggerTooltip:A},_,{data:R,scaleType:z,scale:x,tickNumber:M,colorScale:_.colorMap&&dI(_.colorMap),valueFormatter:g.valueFormatter??Zre(M,Gb(z,S.map(F=>x.invert(F)),S))})}),{axis:f,axisIds:s.map(({id:p})=>p)}}function _ie(e){return e!=null}function Lie(e,t,n,s){const o=e?.length??0,a=Math.floor(t*o/100),l=Math.ceil(n*o/100);return function(d,f){return(d[s]??e?.[f])==null?!0:f>=a&&f<l}}function Pie(e,t,n,s,o){const a=e[0].valueOf(),l=e[1].valueOf(),u=a+t*(l-a)/100,d=a+n*(l-a)/100;return function(p,g){const x=p[s]??o?.[g];return x==null?!0:x>=u&&x<=d}}const Die=e=>({currentAxisId:t,seriesXAxisId:n,seriesYAxisId:s,isDefaultAxis:o})=>(a,l)=>!(t===n?s:n)||o?Object.values(e??{})[0]?.(a,l)??!0:[s,n].filter(f=>f!==t).map(f=>e[f??""]).filter(_ie).every(f=>f(a,l)),S9=e=>(t=[])=>t.reduce((n,s)=>{const{zoom:o,id:a,reverse:l}=s,u=$C(o,a,e,l);return u&&(n[a]=u),n},{}),Oie=.2;function xI(e,t,n){const s=t==="x"?[e.left,e.left+e.width]:[e.top+e.height,e.top];return n.reverse?[s[1],s[0]]:s}function bI(e,t){const n=[0,1];if(Zu(e)){const a=e.categoryGapRatio??Oie;return Vb(t,n).paddingInner(a).paddingOuter(a/2)}if(Qu(e))return hI(t,n);const s=e.scaleType??"linear",o=Gb(s,t,n);return Jre(e)&&e.constant!=null&&o.constant(e.constant),o}const yI=(e,t)=>{const n=e[1]-e[0],s=t[1]-t[0],o=e[0]-t[0]*n/s,a=e[1]+(100-t[1])*n/s;return[o,a]},Bie=(e,t,n,s,o,a,l)=>{const u=n==="x"?s[e].xExtremumGetter:s[e].yExtremumGetter,d=a[e]?.series??{};return u?.({series:d,axis:t,axisIndex:o,isDefaultAxis:o===0,getFilters:l})??[1/0,-1/0]};function Xb(e,t,n,s,o,a){const l=Object.keys(n).filter(Kb);let u=[1/0,-1/0];for(const d of l){const[f,p]=Bie(d,e,t,n,s,o,a);u=[Math.min(u[0],f),Math.max(u[1],p)]}return Number.isNaN(u[0])||Number.isNaN(u[1])?[1/0,-1/0]:u}const Nie=(e,t,n,s)=>{if(e.domainLimit!==void 0)return e.domainLimit;if(t==="x")for(const o of s.line?.seriesOrder??[]){const a=s.line.series[o];if(a.xAxisId===e.id||a.xAxisId===void 0&&n===0)return"strict"}return"nice"};function vI(e,t,n){return Gb(e??"linear",t,[0,1]).nice(n).domain()}function SI(e,t,n,s,[o,a],l,u){const d=CI(e,t,n,s,u);let f=wI(e,o,a);if(typeof d=="function"){const{min:g,max:x}=d(o.valueOf(),a.valueOf());f[0]=g,f[1]=x}const p=qb(e,f,l);return d==="nice"&&(f=vI(e.scaleType,f,p)),f=["min"in e?e.min??f[0]:f[0],"max"in e?e.max??f[1]:f[1]],{domain:f,tickNumber:p}}function jI(e,t,n,s,[o,a],l,u){const d=CI(e,t,n,s,u);let f=wI(e,o,a);if(typeof d=="function"){const{min:p,max:g}=d(o.valueOf(),a.valueOf());f[0]=p,f[1]=g}return d==="nice"&&(f=vI(e.scaleType,f,l)),[e.min??f[0],e.max??f[1]]}function CI(e,t,n,s,o){return o?Nie(e,t,n,s):e.domainLimit??"nice"}function wI(e,t,n){let s=t,o=n;return"max"in e&&e.max!=null&&e.max<t&&(s=e.max),"min"in e&&e.min!=null&&e.min>t&&(o=e.min),!("min"in e)&&!("max"in e)?[s,o]:[e.min??s,e.max??o]}class $ie{constructor(){this.ids=[],this.values=[],this.length=0}clear(){this.length=0}push(t,n){let s=this.length++;for(;s>0;){const o=s-1>>1,a=this.values[o];if(n>=a)break;this.ids[s]=this.ids[o],this.values[s]=a,s=o}this.ids[s]=t,this.values[s]=n}pop(){if(this.length===0)return;const t=this.ids,n=this.values,s=t[0],o=--this.length;if(o>0){const a=t[o],l=n[o];let u=0;const d=o>>1;for(;u<d;){const f=(u<<1)+1,p=f+1,g=f+(+(p<o)&+(n[p]<n[f]));if(n[g]>=l)break;t[u]=t[g],n[u]=n[g],u=g}t[u]=a,n[u]=l}return s}peek(){return this.length>0?this.ids[0]:void 0}peekValue(){return this.length>0?this.values[0]:void 0}shrink(){this.ids.length=this.values.length=this.length}}const j9=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],y5=3;class iw{static from(t,n=0){if(n%8!==0)throw new Error("byteOffset must be 8-byte aligned.");if(!t||t.byteLength===void 0||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[s,o]=new Uint8Array(t,n+0,2);if(s!==251)throw new Error("Data does not appear to be in a Flatbush format.");const a=o>>4;if(a!==y5)throw new Error(`Got v${a} data when expected v${y5}.`);const l=j9[o&15];if(!l)throw new Error("Unrecognized array type.");const[u]=new Uint16Array(t,n+2,1),[d]=new Uint32Array(t,n+4,1);return new iw(d,u,l,void 0,t,n)}constructor(t,n=16,s=Float64Array,o=ArrayBuffer,a,l=0){if(t===void 0)throw new Error("Missing required argument: numItems.");if(isNaN(t)||t<=0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.byteOffset=l;let u=t,d=u;this._levelBounds=[u*4];do u=Math.ceil(u/this.nodeSize),d+=u,this._levelBounds.push(d*4);while(u!==1);this.ArrayType=s,this.IndexArrayType=d<16384?Uint16Array:Uint32Array;const f=j9.indexOf(s),p=d*4*s.BYTES_PER_ELEMENT;if(f<0)throw new Error(`Unexpected typed array class: ${s}.`);if(a)this.data=a,this._boxes=new s(a,l+8,d*4),this._indices=new this.IndexArrayType(a,l+8+p,d),this._pos=d*4,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1];else{const g=this.data=new o(8+p+d*this.IndexArrayType.BYTES_PER_ELEMENT);this._boxes=new s(g,8,d*4),this._indices=new this.IndexArrayType(g,8+p,d),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(g,0,2).set([251,(y5<<4)+f]),new Uint16Array(g,2,1)[0]=n,new Uint32Array(g,4,1)[0]=t}this._queue=new $ie}add(t,n,s=t,o=n){const a=this._pos>>2,l=this._boxes;return this._indices[a]=a,l[this._pos++]=t,l[this._pos++]=n,l[this._pos++]=s,l[this._pos++]=o,t<this.minX&&(this.minX=t),n<this.minY&&(this.minY=n),s>this.maxX&&(this.maxX=s),o>this.maxY&&(this.maxY=o),a}finish(){if(this._pos>>2!==this.numItems)throw new Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);const t=this._boxes;if(this.numItems<=this.nodeSize){t[this._pos++]=this.minX,t[this._pos++]=this.minY,t[this._pos++]=this.maxX,t[this._pos++]=this.maxY;return}const n=this.maxX-this.minX||1,s=this.maxY-this.minY||1,o=new Uint32Array(this.numItems),a=65535;for(let l=0,u=0;l<this.numItems;l++){const d=t[u++],f=t[u++],p=t[u++],g=t[u++],x=Math.floor(a*((d+p)/2-this.minX)/n),b=Math.floor(a*((f+g)/2-this.minY)/s);o[l]=Uie(x,b)}qS(o,t,this._indices,0,this.numItems-1,this.nodeSize);for(let l=0,u=0;l<this._levelBounds.length-1;l++){const d=this._levelBounds[l];for(;u<d;){const f=u;let p=t[u++],g=t[u++],x=t[u++],b=t[u++];for(let y=1;y<this.nodeSize&&u<d;y++)p=Math.min(p,t[u++]),g=Math.min(g,t[u++]),x=Math.max(x,t[u++]),b=Math.max(b,t[u++]);this._indices[this._pos>>2]=f,t[this._pos++]=p,t[this._pos++]=g,t[this._pos++]=x,t[this._pos++]=b}}}search(t,n,s,o,a){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let l=this._boxes.length-4;const u=[],d=[];for(;l!==void 0;){const f=Math.min(l+this.nodeSize*4,C9(l,this._levelBounds));for(let p=l;p<f;p+=4){if(s<this._boxes[p]||o<this._boxes[p+1]||t>this._boxes[p+2]||n>this._boxes[p+3])continue;const g=this._indices[p>>2]|0;l>=this.numItems*4?u.push(g):(a===void 0||a(g))&&(d.push(g),d.push(this._boxes[p]),d.push(this._boxes[p+1]))}l=u.pop()}return d}neighbors(t,n,s=1/0,o=1/0,a,l=Hie){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let u=this._boxes.length-4;const d=this._queue,f=[];e:for(;u!==void 0;){const p=Math.min(u+this.nodeSize*4,C9(u,this._levelBounds));for(let g=u;g<p;g+=4){const x=this._indices[g>>2]|0,b=this._boxes[g],y=this._boxes[g+1],S=this._boxes[g+2],j=this._boxes[g+3],A=t<b?b-t:t>S?t-S:0,M=n<y?y-n:n>j?n-j:0,R=l(A,M);R>o||(u>=this.numItems*4?d.push(x<<1,R):(a===void 0||a(x))&&d.push((x<<1)+1,R))}for(;d.length&&d.peek()&1;)if(d.peekValue()>o||(f.push(d.pop()>>1),f.length===s))break e;u=d.length?d.pop()>>1:void 0}return d.clear(),f}}function Hie(e,t){return e*e+t*t}function C9(e,t){let n=0,s=t.length-1;for(;n<s;){const o=n+s>>1;t[o]>e?s=o:n=o+1}return t[n]}function qS(e,t,n,s,o,a){if(Math.floor(s/a)>=Math.floor(o/a))return;const l=e[s],u=e[s+o>>1],d=e[o];let f=d;const p=Math.max(l,u);d>p?f=p:p===l?f=Math.max(u,d):p===u&&(f=Math.max(l,d));let g=s-1,x=o+1;for(;;){do g++;while(e[g]<f);do x--;while(e[x]>f);if(g>=x)break;Wie(e,t,n,g,x)}qS(e,t,n,s,x,a),qS(e,t,n,x+1,o,a)}function Wie(e,t,n,s,o){const a=e[s];e[s]=e[o],e[o]=a;const l=4*s,u=4*o,d=t[l],f=t[l+1],p=t[l+2],g=t[l+3];t[l]=t[u],t[l+1]=t[u+1],t[l+2]=t[u+2],t[l+3]=t[u+3],t[u]=d,t[u+1]=f,t[u+2]=p,t[u+3]=g;const x=n[s];n[s]=n[o],n[o]=x}function Uie(e,t){let n=e^t,s=65535^n,o=65535^(e|t),a=e&(t^65535),l=n|s>>1,u=n>>1^n,d=o>>1^s&a>>1^o,f=n&o>>1^a>>1^a;n=l,s=u,o=d,a=f,l=n&n>>2^s&s>>2,u=n&s>>2^s&(n^s)>>2,d^=n&o>>2^s&a>>2,f^=s&o>>2^(n^s)&a>>2,n=l,s=u,o=d,a=f,l=n&n>>4^s&s>>4,u=n&s>>4^s&(n^s)>>4,d^=n&o>>4^s&a>>4,f^=s&o>>4^(n^s)&a>>4,n=l,s=u,o=d,a=f,d^=n&o>>8^s&a>>8,f^=s&o>>8^(n^s)&a>>8,n=d^d>>1,s=f^f>>1;let p=e^t,g=s|65535^(p|n);return p=(p|p<<8)&16711935,p=(p|p<<4)&252645135,p=(p|p<<2)&858993459,p=(p|p<<1)&1431655765,g=(g|g<<8)&16711935,g=(g|g<<4)&252645135,g=(g|g<<2)&858993459,g=(g|g<<1)&1431655765,(g<<1|p)>>>0}const qie=e=>{const t=new Map;return e.forEach(n=>{t.set(n.axisId,n)}),t},AI=e=>e.zoom,EI=Ct(AI,e=>e?.isInteracting),Wc=qn(AI,function(t){return t?.zoomData&&qie(t?.zoomData)}),w9=Ct(Wc,(e,t)=>e?.get(t)),fm=qn(Ll,$c,function(t,n){return Ce({},S9("x")(t),S9("y")(n))});Ct(fm,(e,t)=>e[t]);const Vie=Ct(Ro,function(t){return ow(t.width)}),Gie=Ct(Ro,function(t){return ow(t.height)}),aw=qn(Ll,Fr,no,Lb,Vie,function(t,n,s,o,a){const u={};return t?.forEach((d,f)=>{const p=d;if(Zu(p)||Qu(p)){u[p.id]={domain:p.data},p.ordinalTimeTicks!==void 0&&(u[p.id].tickNumber=qb(p,[p.data?.find(x=>x!==null),p.data?.findLast(x=>x!==null)],a));return}const g=Xb(p,"x",s,f,n);u[p.id]=SI(p,"x",f,n,g,a,o)}),{axes:t,domains:u}}),lw=qn($c,Fr,no,Lb,Gie,function(t,n,s,o,a){const u={};return t?.forEach((d,f)=>{const p=d;if(Zu(p)||Qu(p)){u[p.id]={domain:p.data},p.ordinalTimeTicks!==void 0&&(u[p.id].tickNumber=qb(p,[p.data?.find(x=>x!==null),p.data?.findLast(x=>x!==null)],a));return}const g=Xb(p,"y",s,f,n);u[p.id]=SI(p,"y",f,n,g,a,o)}),{axes:t,domains:u}}),TI=qn(Wc,fm,aw,lw,function(t,n,{axes:s,domains:o},{axes:a,domains:l}){if(!t||!n)return;let u=!1;const d={},f=[...s??[],...a??[]];for(let p=0;p<f.length;p+=1){const g=f[p];if(!n[g.id]||n[g.id].filterMode!=="discard")continue;const x=t.get(g.id);if(x===void 0||x.start<=0&&x.end>=100)continue;const b=p<(s?.length??0)?"x":"y";if(g.scaleType==="band"||g.scaleType==="point")d[g.id]=Lie(g.data,x.start,x.end,b);else{const{domain:y}=b==="x"?o[g.id]:l[g.id];d[g.id]=Pie(y,x.start,x.end,b,g.data)}u=!0}if(u)return Die(d)}),Yie=qn(Fr,no,Wc,fm,TI,Lb,aw,function(t,n,s,o,a,l,{axes:u,domains:d}){const f={};return u?.forEach((p,g)=>{const x=d[p.id].domain;if(Zu(p)||Qu(p)){f[p.id]=x;return}const b=s?.get(p.id),y=o?.[p.id],S=b===void 0&&!y?a:void 0;if(!S){f[p.id]=x;return}const j=d[p.id].tickNumber,A=Xb(p,"x",n,g,t,S);f[p.id]=jI(p,"x",g,t,A,j,l)}),f}),Kie=qn(Fr,no,Wc,fm,TI,Lb,lw,function(t,n,s,o,a,l,{axes:u,domains:d}){const f={};return u?.forEach((p,g)=>{const x=d[p.id].domain;if(Zu(p)||Qu(p)){f[p.id]=x;return}const b=s?.get(p.id),y=o?.[p.id],S=b===void 0&&!y?a:void 0;if(!S){f[p.id]=x;return}const j=d[p.id].tickNumber,A=Xb(p,"y",n,g,t,S);f[p.id]=jI(p,"y",g,t,A,j,l)}),f}),kI=qn(Ll,Yie,function(t,n){const s={};return t?.forEach(o=>{const a=o,l=n[a.id];s[a.id]=bI(a,l)}),s}),MI=qn($c,Kie,function(t,n){const s={};return t?.forEach(o=>{const a=o,l=n[a.id];s[a.id]=bI(a,l)}),s}),Xie=qn(Ll,kI,Ro,Wc,function(t,n,s,o){const a={};return t?.forEach(l=>{const u=l,d=o?.get(u.id),f=d?[d.start,d.end]:[0,100],p=xI(s,"x",u),g=n[u.id].copy(),x=yI(p,f);g.range(x),a[u.id]=g}),a}),Zie=qn($c,MI,Ro,Wc,function(t,n,s,o){const a={};return t?.forEach(l=>{const u=l,d=o?.get(u.id),f=d?[d.start,d.end]:[0,100],p=xI(s,"y",u),g=n[u.id].copy(),x=Ss(g)?p.reverse():p,b=yI(x,f);g.range(b),a[u.id]=g}),a}),ro=qn(Ro,Fr,no,Wc,aw,Xie,function(t,n,s,o,{axes:a,domains:l},u){return mI({scales:u,drawingArea:t,formattedSeries:n,axis:a,seriesConfig:s,axisDirection:"x",zoomMap:o,domains:l})}),so=qn(Ro,Fr,no,Wc,lw,Zie,function(t,n,s,o,{axes:a,domains:l},u){return mI({scales:u,drawingArea:t,formattedSeries:n,axis:a,seriesConfig:s,axisDirection:"y",zoomMap:o,domains:l})});Ct(ro,so,(e,t,n)=>e?.axis[n]??t?.axis[n]);Ct(Ll,$c,(e,t,n)=>{const s=e?.find(o=>o.id===n)??t?.find(o=>o.id===n)??null;if(s)return s});const Qie=Ct(Ll,e=>e[0].id),Jie=Ct($c,e=>e[0].id),eae=new Map,tae=()=>eae,nae=qn(Fr,kI,MI,Qie,Jie,function(t,n,s,o,a){const l=t.scatter,u=new Map;return l&&l.seriesOrder.forEach(d=>{const{data:f,xAxisId:p=o,yAxisId:g=a}=l.series[d],x=new iw(f.length),b=n[p],y=s[g];for(const S of f)x.add(b(S.x),y(S.y));x.finish(),u.set(d,x)}),u});function Qd(e){return e instanceof Date?e.getTime():e}function Yf(e,t){const{scale:n,data:s,reverse:o}=e;if(!Ss(n)){const l=n.invert(t);if(s===void 0)return-1;const u=Qd(l);return s?.findIndex((f,p)=>{const g=Qd(f);return g>u&&(p===0||Math.abs(u-g)<=Math.abs(u-Qd(s[p-1])))||g<=u&&(p===s.length-1||Math.abs(Qd(l)-g)<Math.abs(Qd(l)-Qd(s[p+1])))})}const a=n.bandwidth()===0?Math.floor((t-Math.min(...n.range())+n.step()/2)/n.step()):Math.floor((t-Math.min(...n.range()))/n.step());return a<0||a>=s.length?-1:o?s.length-1-a:a}function A9(e,t,n,s){if(!Ss(e)){if(s===null){const o=e.invert(n);return Number.isNaN(o)?null:o}return t[s]}return s===null||s<0||s>=t.length?null:t[s]}function Cg(e,t){const n=e.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n.matrixTransform(e.getScreenCTM().inverse())}const hm=({store:e})=>{const t=pn(function(){e.update({interaction:Ce({},e.state.interaction,{pointer:null})})}),n=pn(function(u){e.state.interaction.lastUpdate!==u&&e.set("interaction",Ce({},e.state.interaction,{lastUpdate:u}))}),s=pn(function(u){e.set("interaction",Ce({},e.state.interaction,{pointer:u,lastUpdate:u!==null?"pointer":e.state.interaction.lastUpdate}))}),o=pn(function(u){e.set("interaction",Ce({},e.state.interaction,{pointerType:u.pointerType}))}),a=pn(function(){e.set("interaction",Ce({},e.state.interaction,{pointerType:null}))});return{instance:{cleanInteraction:t,setLastUpdateSource:n,setPointerCoordinate:s,handlePointerEnter:o,handlePointerLeave:a}}};hm.getInitialState=()=>({interaction:{item:null,pointer:null,lastUpdate:"pointer",pointerType:null}});hm.params={};const Zb=e=>e.interaction,rae=Ct(Zb,e=>e!==void 0),RI=Ct(Zb,e=>e?.pointer??null),pm=Ct(RI,e=>e&&e.x),gm=Ct(RI,e=>e&&e.y),td=Ct(Zb,e=>e?.lastUpdate),sae=Ct(Zb,e=>e?.pointerType??null);function If(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const o=e.length;if(o!==t.length)return!1;for(let a=0;a<o;a+=1)if(!If(e[a],t[a]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;const o=Array.from(e.entries());for(let a=0;a<o.length;a+=1)if(!t.has(o[a][0]))return!1;for(let a=0;a<o.length;a+=1){const l=o[a];if(!If(l[1],t.get(l[0])))return!1}return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;const o=Array.from(e.entries());for(let a=0;a<o.length;a+=1)if(!t.has(o[a][0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){const o=e.length;if(o!==t.length)return!1;for(let a=0;a<o;a+=1)if(e[a]!==t[a])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),s=n.length;if(s!==Object.keys(t).length)return!1;for(let o=0;o<s;o+=1)if(!Object.prototype.hasOwnProperty.call(t,n[o]))return!1;for(let o=0;o<s;o+=1){const a=n[o];if(!If(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function VS(e,t,n=t.axisIds[0]){return Array.isArray(n)?n.map(s=>Yf(t.axis[s],e)):Yf(t.axis[n],e)}const zI=(e,t,n)=>{if(e===null)return null;const s=VS(e,t,n);return s===-1?null:s},cw=Ct(pm,ro,zI),uw=Ct(gm,so,zI),oae=Ct(pm,gm,ro,so,(e,t,n,s)=>[...e===null?[]:n.axisIds.map(o=>({axisId:o,dataIndex:VS(e,n,o)})),...t===null?[]:s.axisIds.map(o=>({axisId:o,dataIndex:VS(t,s,o)}))].filter(o=>o.dataIndex!==null&&o.dataIndex>=0));function II(e,t,n,s=t.axisIds[0]){return Array.isArray(s)?s.map((o,a)=>{const l=t.axis[o];return A9(l.scale,l.data,e,n[a])}):A9(t.axis[s].scale,t.axis[s].data,e,n)}const iae=Ct(pm,ro,cw,(e,t,n,s)=>e===null||t.axisIds.length===0?null:II(e,t,n,s)),aae=Ct(gm,so,uw,(e,t,n,s)=>e===null||t.axisIds.length===0?null:II(e,t,n,s)),FI=[],_I=Ib({memoizeOptions:{resultEqualityCheck:If}})(pm,ro,(e,t)=>e===null?FI:t.axisIds.filter(n=>t.axis[n].triggerTooltip).map(n=>({axisId:n,dataIndex:Yf(t.axis[n],e)})).filter(({dataIndex:n})=>n>=0)),LI=Ib({memoizeOptions:{resultEqualityCheck:If}})(gm,so,(e,t)=>e===null?FI:t.axisIds.filter(n=>t.axis[n].triggerTooltip).map(n=>({axisId:n,dataIndex:Yf(t.axis[n],e)})).filter(({dataIndex:n})=>n>=0)),lae=Ct(_I,LI,(e,t)=>e.length>0||t.length>0);function cae(e){return e.setPointerCoordinate!==void 0}const uae=new Set(["bar","rangeBar","line"]),oh=({params:e,store:t,seriesConfig:n,svgRef:s,instance:o})=>{const{xAxis:a,yAxis:l,dataset:u,onHighlightedAxisChange:d}=e,f=t.use(Ro),p=t.use(Fr),g=t.use(rae),{axis:x,axisIds:b}=t.use(ro),{axis:y,axisIds:S}=t.use(so);NC({controlled:e.highlightedAxis}),or(()=>{e.highlightedAxis!==void 0&&t.set("controlledCartesianAxisHighlight",e.highlightedAxis)},[t,e.highlightedAxis]);const j=v.useRef(!0);v.useEffect(()=>{if(j.current){j.current=!1;return}t.set("cartesianAxis",{x:Wz(a,u),y:Uz(l,u)})},[n,f,a,l,u,t]);const A=b[0],M=S[0];tre(t,oae,(_,z)=>{if(d&&!Object.is(_,z)){if(_.length!==z.length){d(z);return}_?.some(({axisId:F,dataIndex:N},I)=>z[I].axisId!==F||z[I].dataIndex!==N)&&d(z)}});const R=cae(o);return v.useEffect(()=>{const _=s.current;if(!g||!R||!_||e.disableAxisListener)return()=>{};const z=o.addInteractionListener("moveEnd",k=>{k.detail.activeGestures.pan||o.cleanInteraction()}),F=o.addInteractionListener("panEnd",k=>{k.detail.activeGestures.move||o.cleanInteraction()}),N=o.addInteractionListener("quickPressEnd",k=>{!k.detail.activeGestures.move&&!k.detail.activeGestures.pan&&o.cleanInteraction()}),I=k=>{const L=k.detail.srcEvent,O=k.detail.target,W=Cg(_,L);if(k.detail.srcEvent.buttons>=1&&O?.hasPointerCapture(k.detail.srcEvent.pointerId)&&!O?.closest("[data-charts-zoom-slider]")&&O?.releasePointerCapture(k.detail.srcEvent.pointerId),!o.isPointInside(W.x,W.y,O)){o.cleanInteraction?.();return}o.setPointerCoordinate(W)},B=o.addInteractionListener("move",I),H=o.addInteractionListener("pan",I),P=o.addInteractionListener("quickPress",I);return()=>{B.cleanup(),z.cleanup(),H.cleanup(),F.cleanup(),P.cleanup(),N.cleanup()}},[s,t,x,A,y,M,o,e.disableAxisListener,g,R]),v.useEffect(()=>{const _=s.current,z=e.onAxisClick;if(_===null||!z)return()=>{};const F=o.addInteractionListener("tap",N=>{let I=null,B=!1;const H=Cg(_,N.detail.srcEvent),P=Yf(x[A],H.x);B=P!==-1,I=B?P:Yf(y[M],H.y);const k=B?b[0]:S[0];if(I==null||I===-1)return;const L=(B?x:y)[k].data[I],O={};Object.keys(p).filter(W=>uae.has(W)).forEach(W=>{const D=p[W];D?.seriesOrder.forEach(q=>{const K=D.series[q],Y=K.xAxisId,ie=K.yAxisId,V=B?Y:ie;(V===void 0||V===k)&&(O[q]=K.data[I])})}),z(N.detail.srcEvent,{dataIndex:I,axisValue:L,seriesValues:O})});return()=>{F.cleanup()}},[e.onAxisClick,p,s,x,b,y,S,A,M,o]),{}};oh.params={xAxis:!0,yAxis:!0,dataset:!0,onAxisClick:!0,disableAxisListener:!0,onHighlightedAxisChange:!0,highlightedAxis:!0};oh.getDefaultizedParams=({params:e})=>Ce({},e,{colors:e.colors??Fz,theme:e.theme??"light",defaultizedXAxis:Wz(e.xAxis,e.dataset),defaultizedYAxis:Uz(e.yAxis,e.dataset)});oh.getInitialState=e=>Ce({cartesianAxis:{x:e.defaultizedXAxis,y:e.defaultizedYAxis}},e.highlightedAxis===void 0?{}:{controlledCartesianAxisHighlight:e.highlightedAxis});const dae=Object.is;function w1(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=0,s=0;for(const o in e)if(n+=1,!dae(e[o],t[o])||!(o in t))return!1;for(const o in t)s+=1;return n===s}const mm=e=>e.keyboardNavigation;Ct(mm,(e,t)=>e?.item!=null&&w1(e.item,t));const PI=Ct(mm,e=>e?.item!=null),dw=Ct(mm,e=>e?.item??null),fae=Ct(mm,e=>!!e?.enableKeyboardNavigation),DI=e=>(t,n,s)=>{if(t==null||!("dataIndex"in t)||t.dataIndex===void 0)return;const o=s[t.type]?.series[t.seriesId];if(!o)return;let a=e==="x"?"xAxisId"in o&&o.xAxisId:"yAxisId"in o&&o.yAxisId;return(a===void 0||a===!1)&&(a=n.axisIds[0]),{axisId:a,dataIndex:t.dataIndex}},OI=Ct(dw,ro,Fr,DI("x")),BI=Ct(dw,so,Fr,DI("y")),NI=Ct(mm,function(t){if(t?.item==null)return null;const{type:n,seriesId:s}=t.item;return n===void 0||s===void 0?null:t.item}),Ga=e=>e.brush;Ct(Ga,e=>e?.start);Ct(Ga,e=>e?.current);const hae=Ct(Ga,e=>e?.start?.x??null),pae=Ct(Ga,e=>e?.start?.y??null),gae=Ct(Ga,e=>e?.current?.x??null),mae=Ct(Ga,e=>e?.current?.y??null);qn(hae,pae,gae,mae,(e,t,n,s)=>e===null||t===null||n===null||s===null?null:{start:{x:e,y:t},current:{x:n,y:s}});const xae=Ct(Fr,e=>{let t=!1,n=!1;return e&&Object.entries(e).forEach(([s,o])=>{Object.values(o.series).some(a=>a.layout==="horizontal")&&(t=!0),s==="scatter"&&o.seriesOrder.length>0&&(n=!0)}),n?"xy":t?"y":"x"}),bae=Ct(fm,function(t){let n=!1,s=!1;return Object.values(t).forEach(o=>{o.axisDirection==="y"&&(s=!0),o.axisDirection==="x"&&(n=!0)}),n&&s?"xy":s?"y":n?"x":null});Ct(xae,bae,(e,t)=>t??e);const $I=Ct(Ga,e=>e?.enabled||e?.isZoomBrushEnabled),HI=Ct($I,Ga,(e,t)=>e&&t?.start!==null&&t?.current!==null),Qb=Ct(Ga,HI,(e,t)=>t&&e?.preventHighlight),yae=Ct(Ga,HI,(e,t)=>t&&e?.preventTooltip),xm=({store:e,svgRef:t,instance:n,params:s})=>{const o=e.use($I);or(()=>{e.set("brush",Ce({},e.state.brush,{enabled:s.brushConfig.enabled,preventTooltip:s.brushConfig.preventTooltip,preventHighlight:s.brushConfig.preventHighlight}))},[e,s.brushConfig.enabled,s.brushConfig.preventTooltip,s.brushConfig.preventHighlight]);const a=pn(function(f){e.set("brush",Ce({},e.state.brush,{start:e.state.brush.start??f,current:f}))}),l=pn(function(){e.set("brush",Ce({},e.state.brush,{start:null,current:null}))}),u=pn(function(f){e.state.brush.isZoomBrushEnabled!==f&&e.set("brush",Ce({},e.state.brush,{isZoomBrushEnabled:f}))});return v.useEffect(()=>{const d=t.current;if(d===null||!o)return()=>{};const f=S=>{if(S.detail.target?.closest("[data-charts-zoom-slider]"))return;const j=Cg(d,{clientX:S.detail.initialCentroid.x,clientY:S.detail.initialCentroid.y});a(j)},p=S=>{const j=Cg(d,{clientX:S.detail.centroid.x,clientY:S.detail.centroid.y});a(j)},g=n.addInteractionListener("brushStart",f),x=n.addInteractionListener("brush",p),b=n.addInteractionListener("brushCancel",l),y=n.addInteractionListener("brushEnd",l);return()=>{g.cleanup(),x.cleanup(),y.cleanup(),b.cleanup()}},[t,n,e,l,a,o]),{instance:{setBrushCoordinates:a,clearBrush:l,setZoomBrushEnabled:u}}};xm.params={brushConfig:!0};xm.getDefaultizedParams=({params:e})=>Ce({},e,{brushConfig:{enabled:e?.brushConfig?.enabled??!1,preventTooltip:e?.brushConfig?.preventTooltip??!0,preventHighlight:e?.brushConfig?.preventHighlight??!0}});xm.getInitialState=e=>({brush:{enabled:e.brushConfig.enabled,isZoomBrushEnabled:!1,preventTooltip:e.brushConfig.preventTooltip,preventHighlight:e.brushConfig.preventHighlight,start:null,current:null}});function WI(e,t,n){if(e==="pointer"){if(t)return[t];if(n)return[n]}if(e==="keyboard"){if(n)return[n];if(t)return[t]}return[]}const ih=e=>e.controlledCartesianAxisHighlight,UI=(e,t,n,s,o,a)=>{if(a)return[];if(n!==void 0)return n.filter(d=>t.axis[d.axisId]!==void 0).map(d=>d);const l=e!==null&&{axisId:t.axisIds[0],dataIndex:e},u=s!=null&&s;return WI(o,l,u)},qI=qn(cw,ro,ih,OI,td,Qb,UI);qn(uw,so,ih,BI,td,Qb,UI);const VI=(e,t,n,s,o,a,l)=>{if(l)return[];if(s!==void 0)return s.map(p=>Ce({},p,{value:n.axis[p.axisId]?.data?.[p.dataIndex]})).filter(({value:p})=>p!==void 0);const u=t!=null&&{axisId:n.axisIds[0],value:t};u&&e!=null&&(u.dataIndex=e);const d=o!=null&&n.axis[o.axisId]?.data?.[o.dataIndex],f=o!=null&&d!=null&&Ce({},o,{value:d});return WI(a,u,f)},vae=qn(cw,iae,ro,ih,OI,td,Qb,VI),Sae=qn(uw,aae,so,ih,BI,td,Qb,VI),GI=(e,t)=>e===void 0?[t.axis[t.axisIds[0]]]:e.map(s=>t.axis[s.axisId]??null).filter(s=>s!==null);Ct(ih,ro,GI);Ct(ih,so,GI);const bm=({store:e,params:t})=>{NC({controlled:t.tooltipItem}),or(()=>{e.state.tooltip.item!==t.tooltipItem&&e.set("tooltip",Ce({},e.state.tooltip,{item:t.tooltipItem}))},[e,t.tooltipItem]);const n=pn(function(a){const l=e.state.tooltip.item;if(l!==null&&(!a||w1(l,a))){t.onTooltipItemChange?.(null),e.state.tooltip.itemIsControlled||e.set("tooltip",Ce({},e.state.tooltip,{item:null}));return}});return{instance:{setTooltipItem:pn(function(a){w1(e.state.tooltip.item,a)||(t.onTooltipItemChange?.(a),e.state.tooltip.itemIsControlled||e.set("tooltip",Ce({},e.state.tooltip,{item:a})))}),removeTooltipItem:n}}};bm.getInitialState=e=>({tooltip:{itemIsControlled:e.tooltipItem!==void 0,item:e.tooltipItem??null}});bm.params={tooltipItem:!0,onTooltipItemChange:!0};const Jb=({params:e,store:t,svgRef:n})=>{const s=pn(function(){t.state.keyboardNavigation.item!==null&&t.set("keyboardNavigation",Ce({},t.state.keyboardNavigation,{item:null}))});return v.useEffect(()=>{const o=n.current;if(!o||!e.enableKeyboardNavigation)return;function a(l){let u=t.state.keyboardNavigation.item,d=u?.type;if(!d&&(d=Object.keys(Oz(t.state)).find(p=>t.state.series.seriesConfig[p]!==void 0),d===void 0))return;const f=t.state.series.seriesConfig[d]?.keyboardFocusHandler?.(l);f&&(u=f(u,t.state),u!==t.state.keyboardNavigation.item&&(l.preventDefault(),t.update(Ce({},t.state.highlight&&{highlight:Ce({},t.state.highlight,{lastUpdate:"keyboard"})},t.state.interaction&&{interaction:Ce({},t.state.interaction,{lastUpdate:"keyboard"})},{keyboardNavigation:Ce({},t.state.keyboardNavigation,{item:u})}))))}return o.addEventListener("keydown",a),o.addEventListener("blur",s),()=>{o.removeEventListener("keydown",a),o.removeEventListener("blur",s)}},[n,s,e.enableKeyboardNavigation,t]),or(()=>{t.state.keyboardNavigation.enableKeyboardNavigation!==e.enableKeyboardNavigation&&t.set("keyboardNavigation",Ce({},t.state.keyboardNavigation,{enableKeyboardNavigation:!!e.enableKeyboardNavigation}))},[t,e.enableKeyboardNavigation]),{}};Jb.getInitialState=e=>({keyboardNavigation:{item:null,enableKeyboardNavigation:!!e.enableKeyboardNavigation}});Jb.params={enableKeyboardNavigation:!0};function fw(e){return gI.getTypes().has(e)}const jae=(e,t,n,s,o,a,l)=>{const u=s==="rotation"?o[t].rotationExtremumGetter:o[t].radiusExtremumGetter,d=l[t]?.series??{},[f,p]=u?.({series:d,axis:n,axisIndex:a,isDefaultAxis:a===0})??[1/0,-1/0],[g,x]=e;return[Math.min(f,g),Math.max(p,x)]},Cae=(e,t,n,s,o)=>{const l=Object.keys(n).filter(fw).reduce((u,d)=>jae(u,d,e,t,n,s,o),[1/0,-1/0]);return Number.isNaN(l[0])||Number.isNaN(l[1])?[1/0,-1/0]:l},jl=(e,t)=>e===void 0?t:Math.PI*e/180,wae=(e,t,n,s)=>{const o=new Set;return Object.keys(t).filter(fw).forEach(l=>{const u=n[l]?.series??{},d=t[l].axisTooltipGetter?.(u);d!==void 0&&d.forEach(({axisId:f,direction:p})=>{p===e&&o.add(f??s)})}),o};function Aae(e,t,n){if(t==="rotation"){if(n.scaleType==="point"){const s=[jl(n.startAngle,0),jl(n.endAngle,2*Math.PI)],o=s[1]-s[0];return o>Math.PI*2-.1&&(s[1]-=o/n.data.length),s}return[jl(n.startAngle,0),jl(n.endAngle,2*Math.PI)]}return[0,Math.min(e.height,e.width)/2]}const Eae=.2,Tae=.1;function YI({drawingArea:e,formattedSeries:t,axis:n,seriesConfig:s,axisDirection:o}){if(n===void 0)return{axis:{},axisIds:[]};const a=wae(o,s,t,n[0].id),l={};return n.forEach((u,d)=>{const f=u,p=Aae(e,o,f),[g,x]=Cae(f,o,s,d,t),b=!f.ignoreTooltip&&a.has(f.id),y=f.data??[];if(Zu(f)){const B=f.categoryGapRatio??Eae,H=f.barGapRatio??Tae;if(l[f.id]=Ce({offset:0,categoryGapRatio:B,barGapRatio:H,triggerTooltip:b},f,{data:y,scale:Vb(f.data,p).paddingInner(B).paddingOuter(B/2),tickNumber:f.data.length,colorScale:f.colorMap&&(f.colorMap.type==="ordinal"?Gf(Ce({values:f.data},f.colorMap)):zf(f.colorMap))}),j1(f.data)){const P=US(f.data,p,f.tickNumber);l[f.id].valueFormatter=f.valueFormatter??P}}if(Qu(f)&&(l[f.id]=Ce({offset:0,triggerTooltip:b},f,{data:y,scale:hI(f.data,p),tickNumber:f.data.length,colorScale:f.colorMap&&(f.colorMap.type==="ordinal"?Gf(Ce({values:f.data},f.colorMap)):zf(f.colorMap))}),j1(f.data))){const B=US(f.data,p,f.tickNumber);l[f.id].valueFormatter=f.valueFormatter??B}if(!Qre(f))return;const S=f.scaleType??"linear",j=f.domainLimit??"nice",A=[f.min??g,f.max??x];if(typeof j=="function"){const{min:B,max:H}=j(g,x);A[0]=B,A[1]=H}const M=qb(f,A,ow(Math.abs(p[1]-p[0]))),R=fI(M,p),_=Gb(S,A,p),z=j==="nice"?_.nice(M):_,[F,N]=z.domain(),I=[f.min??F,f.max??N];l[f.id]=Ce({offset:0,triggerTooltip:b},f,{data:y,scaleType:S,scale:z.domain(I),tickNumber:R,colorScale:f.colorMap&&zf(f.colorMap)})}),{axis:l,axisIds:n.map(({id:u})=>u)}}const KI=e=>e.polarAxis,XI=Ct(KI,e=>e?.rotation),kae=Ct(KI,e=>e?.radius),Uc=qn(XI,Ro,Fr,no,(e,t,n,s)=>YI({drawingArea:t,formattedSeries:n,axis:e,seriesConfig:s,axisDirection:"rotation"})),Mae=qn(kae,Ro,Fr,no,(e,t,n,s)=>YI({drawingArea:t,formattedSeries:n,axis:e,seriesConfig:s,axisDirection:"radius"}));function Rae(e){return{cx:e.left+e.width/2,cy:e.top+e.height/2}}const zae=qn(Ro,Rae),Iae=e=>e.tooltip,ZI=Ct(Iae,e=>e?.item??null),Fae=Ct(ZI,e=>e!==null),hw=Ct(td,ZI,NI,(e,t,n)=>e==="keyboard"?n:t??null),_ae=Ct(td,Fae,PI,(e,t,n)=>e==="keyboard"?n:t),Lae=qn(hw,ro,so,Uc,Mae,Fr,function(t,{axis:n,axisIds:s},{axis:o,axisIds:a},l,u,d){if(!t)return{};const f=d[t.type]?.series[t.seriesId];if(!f)return{};const p={rotationAxes:l,radiusAxes:u},g=C1(f)?f.xAxisId??s[0]:void 0,x=C1(f)?f.yAxisId??a[0]:void 0;return g!==void 0&&(p.x=n[g]),x!==void 0&&(p.y=o[x]),p}),Pae=qn(hw,Ro,no,Fr,Ire,Lae,function(t,n,s,o,a,l,u="top"){if(!t)return null;const d=o[t.type]?.series[t.seriesId];return d?s[d.type].tooltipItemPositionGetter?.({series:o,seriesLayout:a,drawingArea:n,axesConfig:l,identifier:t,placement:u})??null:null});function E9(e,t){return e.id!==void 0?e:Ce({id:t},e)}function T9(e){return e.colorMap?Ce({},e,{colorScale:e.colorMap.type==="ordinal"&&e.data?Gf(Ce({values:e.data},e.colorMap)):zf(e.colorMap.type==="continuous"?Ce({min:e.min,max:e.max},e.colorMap):e.colorMap)}):e}function QI(e,t){if(!e||e.length===0)return{axis:{},axisIds:[]};const n={},s=[];return e.forEach((o,a)=>{const l=o.dataKey,u=o.id??`defaultized-z-axis-${a}`;if(l===void 0||o.data!==void 0){n[u]=T9(E9(o,u)),s.push(u);return}if(t===void 0)throw new Error("MUI X Charts: z-axis uses `dataKey` but no `dataset` is provided.");n[u]=T9(E9(Ce({},o,{data:t.map(d=>d[l])}),u)),s.push(u)}),{axis:n,axisIds:s}}const ym=({params:e,store:t})=>{const{zAxis:n,dataset:s}=e,o=v.useRef(!0);return v.useEffect(()=>{if(o.current){o.current=!1;return}t.set("zAxis",QI(n,s))},[n,s,t]),{}};ym.params={zAxis:!0,dataset:!0};ym.getInitialState=e=>({zAxis:QI(e.zAxis,e.dataset)});const Dae=e=>e,Oae=Ct(Dae,e=>e.zAxis),vm=({store:e,params:t})=>{NC({controlled:t.highlightedItem}),or(()=>{e.state.highlight.item!==t.highlightedItem&&e.set("highlight",Ce({},e.state.highlight,{item:t.highlightedItem}))},[e,t.highlightedItem]);const n=pn(()=>{t.onHighlightChange?.(null);const o=e.state.highlight;o.item===null||o.isControlled||e.set("highlight",{item:null,lastUpdate:"pointer",isControlled:!1})}),s=pn(o=>{const a=e.state.highlight;w1(a.item,o)||(t.onHighlightChange?.(o),!a.isControlled&&e.set("highlight",{item:o,lastUpdate:"pointer",isControlled:!1}))});return{instance:{clearHighlight:n,setHighlight:s}}};vm.getInitialState=e=>({highlight:{item:e.highlightedItem,lastUpdate:"pointer",isControlled:e.highlightedItem!==void 0}});vm.params={highlightedItem:!0,onHighlightChange:!0};function wg(e){let t=1/0,n=-1/0;for(const s of e??[])s<t&&(t=s),s>n&&(n=s);return[t,n]}const k9=(e,t)=>t==="x"?{x:e,y:null}:{x:null,y:e},JI=e=>{const{axis:t,getFilters:n,isDefaultAxis:s}=e,o=n?.({currentAxisId:t.id,isDefaultAxis:s}),a=o?t.data?.filter((l,u)=>o({x:null,y:null},u)):t.data;return wg(a??[])},eF=e=>t=>{const{series:n,axis:s,getFilters:o,isDefaultAxis:a}=t;return Object.keys(n).filter(l=>{const u=e==="x"?n[l].xAxisId:n[l].yAxisId;return u===s.id||a&&u===void 0}).reduce((l,u)=>{const{stackedData:d}=n[u],f=o?.({currentAxisId:s.id,isDefaultAxis:a,seriesXAxisId:n[u].xAxisId,seriesYAxisId:n[u].yAxisId}),[p,g]=d?.reduce((x,b,y)=>f&&(!f(k9(b[0],e),y)||!f(k9(b[1],e),y))?x:[Math.min(...b,x[0]),Math.max(...b,x[1])],[1/0,-1/0])??[1/0,-1/0];return[Math.min(p,l[0]),Math.max(g,l[1])]},[1/0,-1/0])},Bae=e=>Object.keys(e.series).some(n=>e.series[n].layout==="horizontal")?eF("x")(e):JI(e),Nae=e=>Object.keys(e.series).some(n=>e.series[n].layout==="horizontal")?JI(e):eF("y")(e);function Wn(e){return function(){return e}}const tF=Math.cos,A1=Math.sin,ga=Math.sqrt,M9=1e-12,E1=Math.PI,Mu=2*E1,GS=Math.PI,YS=2*GS,xu=1e-6,$ae=YS-xu;function nF(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Hae(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return nF;const n=10**t;return function(s){this._+=s[0];for(let o=1,a=s.length;o<a;++o)this._+=Math.round(arguments[o]*n)/n+s[o]}}class Wae{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?nF:Hae(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,s,o){this._append`Q${+t},${+n},${this._x1=+s},${this._y1=+o}`}bezierCurveTo(t,n,s,o,a,l){this._append`C${+t},${+n},${+s},${+o},${this._x1=+a},${this._y1=+l}`}arcTo(t,n,s,o,a){if(t=+t,n=+n,s=+s,o=+o,a=+a,a<0)throw new Error(`negative radius: ${a}`);let l=this._x1,u=this._y1,d=s-t,f=o-n,p=l-t,g=u-n,x=p*p+g*g;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(x>xu)if(!(Math.abs(g*d-f*p)>xu)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let b=s-l,y=o-u,S=d*d+f*f,j=b*b+y*y,A=Math.sqrt(S),M=Math.sqrt(x),R=a*Math.tan((GS-Math.acos((S+x-j)/(2*A*M)))/2),_=R/M,z=R/A;Math.abs(_-1)>xu&&this._append`L${t+_*p},${n+_*g}`,this._append`A${a},${a},0,0,${+(g*b>p*y)},${this._x1=t+z*d},${this._y1=n+z*f}`}}arc(t,n,s,o,a,l){if(t=+t,n=+n,s=+s,l=!!l,s<0)throw new Error(`negative radius: ${s}`);let u=s*Math.cos(o),d=s*Math.sin(o),f=t+u,p=n+d,g=1^l,x=l?o-a:a-o;this._x1===null?this._append`M${f},${p}`:(Math.abs(this._x1-f)>xu||Math.abs(this._y1-p)>xu)&&this._append`L${f},${p}`,s&&(x<0&&(x=x%YS+YS),x>$ae?this._append`A${s},${s},0,1,${g},${t-u},${n-d}A${s},${s},0,1,${g},${this._x1=f},${this._y1=p}`:x>xu&&this._append`A${s},${s},0,${+(x>=GS)},${g},${this._x1=t+s*Math.cos(a)},${this._y1=n+s*Math.sin(a)}`)}rect(t,n,s,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${s=+s}v${+o}h${-s}Z`}toString(){return this._}}function pw(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const s=Math.floor(n);if(!(s>=0))throw new RangeError(`invalid digits: ${n}`);t=s}return e},()=>new Wae(t)}function ey(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function rF(e){this._context=e}rF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function gw(e){return new rF(e)}function sF(e){return e[0]}function oF(e){return e[1]}function iF(e,t){var n=Wn(!0),s=null,o=gw,a=null,l=pw(u);e=typeof e=="function"?e:e===void 0?sF:Wn(e),t=typeof t=="function"?t:t===void 0?oF:Wn(t);function u(d){var f,p=(d=ey(d)).length,g,x=!1,b;for(s==null&&(a=o(b=l())),f=0;f<=p;++f)!(f<p&&n(g=d[f],f,d))===x&&((x=!x)?a.lineStart():a.lineEnd()),x&&a.point(+e(g,f,d),+t(g,f,d));if(b)return a=null,b+""||null}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Wn(+d),u):e},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Wn(+d),u):t},u.defined=function(d){return arguments.length?(n=typeof d=="function"?d:Wn(!!d),u):n},u.curve=function(d){return arguments.length?(o=d,s!=null&&(a=o(s)),u):o},u.context=function(d){return arguments.length?(d==null?s=a=null:a=o(s=d),u):s},u}function Uae(e,t,n){var s=null,o=Wn(!0),a=null,l=gw,u=null,d=pw(f);e=typeof e=="function"?e:e===void 0?sF:Wn(+e),t=typeof t=="function"?t:Wn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?oF:Wn(+n);function f(g){var x,b,y,S=(g=ey(g)).length,j,A=!1,M,R=new Array(S),_=new Array(S);for(a==null&&(u=l(M=d())),x=0;x<=S;++x){if(!(x<S&&o(j=g[x],x,g))===A)if(A=!A)b=x,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),y=x-1;y>=b;--y)u.point(R[y],_[y]);u.lineEnd(),u.areaEnd()}A&&(R[x]=+e(j,x,g),_[x]=+t(j,x,g),u.point(s?+s(j,x,g):R[x],n?+n(j,x,g):_[x]))}if(M)return u=null,M+""||null}function p(){return iF().defined(o).curve(l).context(a)}return f.x=function(g){return arguments.length?(e=typeof g=="function"?g:Wn(+g),s=null,f):e},f.x0=function(g){return arguments.length?(e=typeof g=="function"?g:Wn(+g),f):e},f.x1=function(g){return arguments.length?(s=g==null?null:typeof g=="function"?g:Wn(+g),f):s},f.y=function(g){return arguments.length?(t=typeof g=="function"?g:Wn(+g),n=null,f):t},f.y0=function(g){return arguments.length?(t=typeof g=="function"?g:Wn(+g),f):t},f.y1=function(g){return arguments.length?(n=g==null?null:typeof g=="function"?g:Wn(+g),f):n},f.lineX0=f.lineY0=function(){return p().x(e).y(t)},f.lineY1=function(){return p().x(e).y(n)},f.lineX1=function(){return p().x(s).y(t)},f.defined=function(g){return arguments.length?(o=typeof g=="function"?g:Wn(!!g),f):o},f.curve=function(g){return arguments.length?(l=g,a!=null&&(u=l(a)),f):l},f.context=function(g){return arguments.length?(g==null?a=u=null:u=l(a=g),f):a},f}function qae(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Vae(e){return e}function Gae(){var e=Vae,t=qae,n=null,s=Wn(0),o=Wn(Mu),a=Wn(0);function l(u){var d,f=(u=ey(u)).length,p,g,x=0,b=new Array(f),y=new Array(f),S=+s.apply(this,arguments),j=Math.min(Mu,Math.max(-Mu,o.apply(this,arguments)-S)),A,M=Math.min(Math.abs(j)/f,a.apply(this,arguments)),R=M*(j<0?-1:1),_;for(d=0;d<f;++d)(_=y[b[d]=d]=+e(u[d],d,u))>0&&(x+=_);for(t!=null?b.sort(function(z,F){return t(y[z],y[F])}):n!=null&&b.sort(function(z,F){return n(u[z],u[F])}),d=0,g=x?(j-f*R)/x:0;d<f;++d,S=A)p=b[d],_=y[p],A=S+(_>0?_*g:0)+R,y[p]={data:u[p],index:d,value:_,startAngle:S,endAngle:A,padAngle:M};return y}return l.value=function(u){return arguments.length?(e=typeof u=="function"?u:Wn(+u),l):e},l.sortValues=function(u){return arguments.length?(t=u,n=null,l):t},l.sort=function(u){return arguments.length?(n=u,t=null,l):n},l.startAngle=function(u){return arguments.length?(s=typeof u=="function"?u:Wn(+u),l):s},l.endAngle=function(u){return arguments.length?(o=typeof u=="function"?u:Wn(+u),l):o},l.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:Wn(+u),l):a},l}class aF{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Yae(e){return new aF(e,!0)}function Kae(e){return new aF(e,!1)}const lF={draw(e,t){const n=ga(t/E1);e.moveTo(n,0),e.arc(0,0,n,0,Mu)}},Xae={draw(e,t){const n=ga(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},cF=ga(1/3),Zae=cF*2,Qae={draw(e,t){const n=ga(t/Zae),s=n*cF;e.moveTo(0,-n),e.lineTo(s,0),e.lineTo(0,n),e.lineTo(-s,0),e.closePath()}},Jae={draw(e,t){const n=ga(t),s=-n/2;e.rect(s,s,n,n)}},ele=.8908130915292852,uF=A1(E1/10)/A1(7*E1/10),tle=A1(Mu/10)*uF,nle=-tF(Mu/10)*uF,rle={draw(e,t){const n=ga(t*ele),s=tle*n,o=nle*n;e.moveTo(0,-n),e.lineTo(s,o);for(let a=1;a<5;++a){const l=Mu*a/5,u=tF(l),d=A1(l);e.lineTo(d*n,-u*n),e.lineTo(u*s-d*o,d*s+u*o)}e.closePath()}},v5=ga(3),sle={draw(e,t){const n=-ga(t/(v5*3));e.moveTo(0,n*2),e.lineTo(-v5*n,-n),e.lineTo(v5*n,-n),e.closePath()}},hi=-.5,pi=ga(3)/2,KS=1/ga(12),ole=(KS/2+1)*3,ile={draw(e,t){const n=ga(t/ole),s=n/2,o=n*KS,a=s,l=n*KS+n,u=-a,d=l;e.moveTo(s,o),e.lineTo(a,l),e.lineTo(u,d),e.lineTo(hi*s-pi*o,pi*s+hi*o),e.lineTo(hi*a-pi*l,pi*a+hi*l),e.lineTo(hi*u-pi*d,pi*u+hi*d),e.lineTo(hi*s+pi*o,hi*o-pi*s),e.lineTo(hi*a+pi*l,hi*l-pi*a),e.lineTo(hi*u+pi*d,hi*d-pi*u),e.closePath()}},dF=[lF,Xae,Qae,Jae,rle,sle,ile];function fF(e,t){let n=null,s=pw(o);e=typeof e=="function"?e:Wn(e||lF),t=typeof t=="function"?t:Wn(t===void 0?64:+t);function o(){let a;if(n||(n=a=s()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return o.type=function(a){return arguments.length?(e=typeof a=="function"?a:Wn(a),o):e},o.size=function(a){return arguments.length?(t=typeof a=="function"?a:Wn(+a),o):t},o.context=function(a){return arguments.length?(n=a??null,o):n},o}function R9(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function mw(e,t){this._context=e,this._k=(1-t)/6}mw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:R9(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:R9(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function n(s){return new mw(s,t)}return n.tension=function(s){return e(+s)},n})(0);function ale(e,t,n){var s=e._x1,o=e._y1,a=e._x2,l=e._y2;if(e._l01_a>M9){var u=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,d=3*e._l01_a*(e._l01_a+e._l12_a);s=(s*u-e._x0*e._l12_2a+e._x2*e._l01_2a)/d,o=(o*u-e._y0*e._l12_2a+e._y2*e._l01_2a)/d}if(e._l23_a>M9){var f=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,p=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*f+e._x1*e._l23_2a-t*e._l12_2a)/p,l=(l*f+e._y1*e._l23_2a-n*e._l12_2a)/p}e._context.bezierCurveTo(s,o,a,l,e._x2,e._y2)}function hF(e,t){this._context=e,this._alpha=t}hF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,s=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+s*s,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:ale(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const lle=(function e(t){function n(s){return t?new hF(s,t):new mw(s,0)}return n.alpha=function(s){return e(+s)},n})(.5);function z9(e){return e<0?-1:1}function I9(e,t,n){var s=e._x1-e._x0,o=t-e._x1,a=(e._y1-e._y0)/(s||o<0&&-0),l=(n-e._y1)/(o||s<0&&-0),u=(a*o+l*s)/(s+o);return(z9(a)+z9(l))*Math.min(Math.abs(a),Math.abs(l),.5*Math.abs(u))||0}function F9(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function S5(e,t,n){var s=e._x0,o=e._y0,a=e._x1,l=e._y1,u=(a-s)/3;e._context.bezierCurveTo(s+u,o+u*t,a-u,l-u*n,a,l)}function T1(e){this._context=e}T1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:S5(this,this._t0,F9(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,S5(this,F9(this,n=I9(this,e,t)),n);break;default:S5(this,this._t0,n=I9(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function pF(e){this._context=new gF(e)}(pF.prototype=Object.create(T1.prototype)).point=function(e,t){T1.prototype.point.call(this,t,e)};function gF(e){this._context=e}gF.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,s,o,a){this._context.bezierCurveTo(t,e,s,n,a,o)}};function _9(e){return new T1(e)}function cle(e){return new pF(e)}function mF(e){this._context=e}mF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var s=L9(e),o=L9(t),a=0,l=1;l<n;++a,++l)this._context.bezierCurveTo(s[0][a],o[0][a],s[1][a],o[1][a],e[l],t[l]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function L9(e){var t,n=e.length-1,s,o=new Array(n),a=new Array(n),l=new Array(n);for(o[0]=0,a[0]=2,l[0]=e[0]+2*e[1],t=1;t<n-1;++t)o[t]=1,a[t]=4,l[t]=4*e[t]+2*e[t+1];for(o[n-1]=2,a[n-1]=7,l[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)s=o[t]/a[t-1],a[t]-=s,l[t]-=s*l[t-1];for(o[n-1]=l[n-1]/a[n-1],t=n-2;t>=0;--t)o[t]=(l[t]-o[t+1])/a[t];for(a[n-1]=(e[n]+o[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-o[t+1];return[o,a]}function ule(e){return new mF(e)}function ty(e,t){this._context=e,this._t=t}ty.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function dle(e){return new ty(e,.5)}function fle(e){return new ty(e,0)}function hle(e){return new ty(e,1)}function Kf(e,t){if((l=e.length)>1)for(var n=1,s,o,a=e[t[0]],l,u=a.length;n<l;++n)for(o=a,a=e[t[n]],s=0;s<u;++s)a[s][1]+=a[s][0]=isNaN(o[s][1])?o[s][0]:o[s][1]}function Xf(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function ple(e,t){return e[t]}function gle(e){const t=[];return t.key=e,t}function k1(){var e=Wn([]),t=Xf,n=Kf,s=ple;function o(a){var l=Array.from(e.apply(this,arguments),gle),u,d=l.length,f=-1,p;for(const g of a)for(u=0,++f;u<d;++u)(l[u][f]=[0,+s(g,l[u].key,f,a)]).data=g;for(u=0,p=ey(t(l));u<d;++u)l[p[u]].index=u;return n(l,p),l}return o.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Wn(Array.from(a)),o):e},o.value=function(a){return arguments.length?(s=typeof a=="function"?a:Wn(+a),o):s},o.order=function(a){return arguments.length?(t=a==null?Xf:typeof a=="function"?a:Wn(Array.from(a)),o):t},o.offset=function(a){return arguments.length?(n=a??Kf,o):n},o}function mle(e,t){if((s=e.length)>0){for(var n,s,o=0,a=e[0].length,l;o<a;++o){for(l=n=0;n<s;++n)l+=e[n][o][1]||0;if(l)for(n=0;n<s;++n)e[n][o][1]/=l}Kf(e,t)}}function xle(e,t){if((o=e.length)>0){for(var n=0,s=e[t[0]],o,a=s.length;n<a;++n){for(var l=0,u=0;l<o;++l)u+=e[l][n][1]||0;s[n][1]+=s[n][0]=-u/2}Kf(e,t)}}function ble(e,t){if(!(!((l=e.length)>0)||!((a=(o=e[t[0]]).length)>0))){for(var n=0,s=1,o,a,l;s<a;++s){for(var u=0,d=0,f=0;u<l;++u){for(var p=e[t[u]],g=p[s][1]||0,x=p[s-1][1]||0,b=(g-x)/2,y=0;y<u;++y){var S=e[t[y]],j=S[s][1]||0,A=S[s-1][1]||0;b+=j-A}d+=g,f+=b*g}o[s-1][1]+=o[s-1][0]=n,d&&(n-=f/d)}o[s-1][1]+=o[s-1][0]=n,Kf(e,t)}}function xF(e){var t=e.map(yle);return Xf(e).sort(function(n,s){return t[n]-t[s]})}function yle(e){for(var t=-1,n=0,s=e.length,o,a=-1/0;++t<s;)(o=+e[t][1])>a&&(a=o,n=t);return n}function bF(e){var t=e.map(yF);return Xf(e).sort(function(n,s){return t[n]-t[s]})}function yF(e){for(var t=0,n=-1,s=e.length,o;++n<s;)(o=+e[n][1])&&(t+=o);return t}function vle(e){return bF(e).reverse()}function Sle(e){var t=e.length,n,s,o=e.map(yF),a=xF(e),l=0,u=0,d=[],f=[];for(n=0;n<t;++n)s=a[n],l<u?(l+=o[s],d.push(s)):(u+=o[s],f.push(s));return f.reverse().concat(d)}function jle(e){return Xf(e).reverse()}function Cle(e,t){if(e.length===0)return;const n=e.length,s=t,o=e[s[0]].length;for(let a=0;a<o;a+=1){let l=0,u=0;for(let d=0;d<n;d+=1){const f=e[s[d]],p=f[a],g=p[1]-p[0];g>0?(p[0]=l,l+=g,p[1]=l):g<0?(p[1]=u,u+=g,p[0]=u):p.data[f.key]>0?(p[0]=l,p[1]=l):p.data[f.key]<0?(p[1]=u,p[0]=u):(p[0]=0,p[1]=0)}}}const j5={appearance:xF,ascending:bF,descending:vle,insideOut:Sle,none:Xf,reverse:jle},C5={expand:mle,diverging:Cle,none:Kf,silhouette:xle,wiggle:ble},vF=e=>{const{series:t,seriesOrder:n,defaultStrategy:s}=e,o=[],a={};return n.forEach(l=>{const{stack:u,stackOrder:d,stackOffset:f}=t[l];u===void 0?o.push({ids:[l],stackingOrder:j5.none,stackingOffset:C5.none}):a[u]===void 0?(a[u]=o.length,o.push({ids:[l],stackingOrder:j5[d??s?.stackOrder??"none"],stackingOffset:C5[f??s?.stackOffset??"diverging"]})):(o[a[u]].ids.push(l),d!==void 0&&(o[a[u]].stackingOrder=j5[d]),f!==void 0&&(o[a[u]].stackingOffset=C5[f]))}),o},wle=e=>e==null?"":e.toLocaleString(),Ale=(e,t,n)=>{const{seriesOrder:s,series:o}=e,a=vF(e),l=t??[];s.forEach(d=>{const f=o[d].data;if(f!==void 0)f.forEach((p,g)=>{l.length<=g?l.push({[d]:p}):l[g][d]=p});else if(t===void 0)throw new Error([`MUI X Charts: bar series with id='${d}' has no data.`,"Either provide a data property to the series or use the dataset prop."].join(` `))});const u={};return a.forEach(d=>{const{ids:f,stackingOffset:p,stackingOrder:g}=d,x=f.map(A=>{const M=o[A].dataKey;return o[A].data===void 0&&M!==void 0?M:A}),b=k1().keys(x).value((A,M)=>A[M]??0).order(g).offset(p)(l),y=b.map(A=>A.index),S=()=>y,j=k1().keys(x).value((A,M)=>{const R=x.indexOf(M),_=f[R];return n?.({type:"bar",seriesId:_})?A[M]??0:0}).order(S).offset(p)(l);f.forEach((A,M)=>{const R=o[A].dataKey,_=R?t.map(F=>{const N=F[R];return typeof N=="number"?N:null}):o[A].data,z=!n?.({type:"bar",seriesId:A});u[A]=Ce({layout:"vertical",labelMarkType:"square",minBarSize:0,valueFormatter:o[A].valueFormatter??wle},o[A],{data:_,hidden:z,stackedData:b[M],visibleStackedData:j[M]})})}),{seriesOrder:s,stackingGroups:a,series:u}};function ha(e,t){return typeof e=="function"?e(t):e}const Ele=e=>{const{seriesOrder:t,series:n}=e;return t.reduce((s,o)=>{const a=ha(n[o].label,"legend");return a===void 0||s.push({type:"bar",markType:n[o].labelMarkType,id:o,seriesId:o,color:n[o].color,label:a}),s},[])};function xw(e){return e.colorGetter?e.colorGetter:()=>e.color}const Tle=(e,t,n)=>{const s=e.layout==="vertical",o=s?t?.colorScale:n?.colorScale,a=s?n?.colorScale:t?.colorScale,l=s?t?.data:n?.data,u=xw(e);return a?d=>{if(d===void 0)return e.color;const f=e.data[d],p=f===null?u({value:f,dataIndex:d}):a(f);return p===null?u({value:f,dataIndex:d}):p}:o&&l?d=>{if(d===void 0)return e.color;const f=l[d],p=f===null?u({value:f,dataIndex:d}):o(f);return p===null?u({value:f,dataIndex:d}):p}:d=>{if(d===void 0)return e.color;const f=e.data[d];return u({value:f,dataIndex:d})}};function SF(e,t){return Object.keys(e).filter(n=>t.has(n)).flatMap(n=>{const s=e[n];return s.seriesOrder.filter(o=>s.series[o].data.length>0&&s.series[o].data.some(a=>a!=null)).map(o=>({type:n,seriesId:o}))})}function jF(e,t,n,s){const o=SF(e,t);if(o.length===0)return null;const a=n!==void 0&&s!==void 0?o.findIndex(l=>l.type===n&&l.seriesId===s):-1;return a<=0?o[o.length-1]:o[(a-1+o.length)%o.length]}function CF(e,t){return Object.keys(e).filter(n=>t.has(n)).flatMap(n=>{const s=e[n];return s.seriesOrder.filter(o=>s.series[o].data.length>0&&s.series[o].data.some(a=>a!=null)).map(o=>s.series[o].data.length)}).reduce((n,s)=>Math.max(n,s),0)}function wF(e,t,n,s){const o=SF(e,t);if(o.length===0)return null;const a=n!==void 0&&s!==void 0?o.findIndex(l=>l.type===n&&l.seriesId===s):-1;return o[(a+1)%o.length]}function AF(e,t,n){if(t==="sankey")return!1;const s=e[t]?.series[n]?.data;return s!=null&&s.length>0}function ny(e,t=!1){return function(s,o){const a=Fr(o);let l=s?.seriesId,u=s?.type;if(!u||l==null||!AF(a,u,l)){const p=wF(a,e,u,l);if(p===null)return null;u=p.type,l=p.seriesId}const d=CF(a,e);let f=s?.dataIndex==null?0:s.dataIndex+1;return t?f=f%d:f=Math.min(d-1,f),{type:u,seriesId:l,dataIndex:f}}}function ry(e,t=!1){return function(s,o){const a=Fr(o);let l=s?.seriesId,u=s?.type;if(!u||l==null||!AF(a,u,l)){const p=jF(a,e,u,l);if(p===null)return null;u=p.type,l=p.seriesId}const d=CF(a,e);let f=s?.dataIndex==null?d-1:s.dataIndex-1;return t?f=(d+f)%d:f=Math.max(0,f),{type:u,seriesId:l,dataIndex:f}}}function sy(e){return function(n,s){const o=Fr(s);let a=n?.seriesId,l=n?.type;const u=wF(o,e,l,a);if(u===null)return null;l=u.type,a=u.seriesId;const d=n?.dataIndex==null?0:n.dataIndex;return{type:l,seriesId:a,dataIndex:d}}}function oy(e){return function(n,s){const o=Fr(s);let a=n?.seriesId,l=n?.type;const u=jF(o,e,l,a);if(u===null)return null;l=u.type,a=u.seriesId;const d=o[l].series[a].data,f=n?.dataIndex==null?d.length-1:n.dataIndex;return{type:l,seriesId:a,dataIndex:f}}}const u0=new Set(["bar","line","scatter"]),kle=e=>{switch(e.key){case"ArrowRight":return ny(u0);case"ArrowLeft":return ry(u0);case"ArrowDown":return oy(u0);case"ArrowUp":return sy(u0);default:return null}},Mle=e=>{const{series:t,getColor:n,identifier:s}=e;if(!s||s.dataIndex===void 0)return null;const o=ha(t.label,"tooltip"),a=t.data[s.dataIndex];if(a==null)return null;const l=t.valueFormatter(a,{dataIndex:s.dataIndex});return{identifier:s,color:n(s.dataIndex),label:o,value:a,formattedValue:l,markType:t.labelMarkType}},Rle=e=>Object.values(e).map(t=>t.layout==="horizontal"?{direction:"y",axisId:t.yAxisId}:{direction:"x",axisId:t.xAxisId});function zle(e,t,n){if(n===0)return{barWidth:e/t,offset:0};const s=e/(t+(t-1)*n),o=n*s;return{barWidth:s,offset:o}}function Ile(e,t,n){const s=e&&t>0,o=!e&&t<0,a=s||o;return n?!a:a}function Fle(e){const{verticalLayout:t,xAxisConfig:n,yAxisConfig:s,series:o,dataIndex:a,numberOfGroups:l,groupIndex:u}=e,d=t?n:s,f=(t?s.reverse:n.reverse)??!1,{barWidth:p,offset:g}=zle(d.scale.bandwidth(),l,d.barGapRatio),x=u*(p+g),b=n.scale,y=s.scale,S=d.data[a],j=o.data[a];if(j==null)return null;const M=o.visibleStackedData[a].map(I=>t?y(I):b(I)),[R,_]=wg(M).map(I=>Math.round(I));let z=0;j!==0&&(o.hidden||(z=Math.max(o.minBarSize,_-R)));const F=Ile(t,j,f);let N=0;return F?N=_-z:N=R,{x:t?b(S)+x:N,y:t?N:y(S)+x,height:t?z:p,width:t?p:z}}const _le=e=>{const{series:t,identifier:n,axesConfig:s,placement:o}=e;if(!n||n.dataIndex===void 0)return null;const a=t.bar?.series[n.seriesId];if(t.bar==null||a==null||s.x===void 0||s.y===void 0)return null;const l=Fle({verticalLayout:a.layout==="vertical",xAxisConfig:s.x,yAxisConfig:s.y,series:a,dataIndex:n.dataIndex,numberOfGroups:t.bar.stackingGroups.length,groupIndex:t.bar.stackingGroups.findIndex(g=>g.ids.includes(a.id))});if(l==null)return null;const{x:u,y:d,width:f,height:p}=l;switch(o){case"right":return{x:u+f,y:d+p/2};case"bottom":return{x:u+f/2,y:d+p};case"left":return{x:u,y:d+p/2};default:return{x:u+f/2,y:d}}};function Lle(e,t,n){return Ce({},e,{id:e.id??`auto-generated-id-${t}`,color:e.color??n[t%n.length]})}const Ple=e=>`Type(${e})`,Dle=e=>`Series(${e})`,Ole=e=>e===void 0?"":`Index(${e})`,iy=e=>`${Ple(e.type)}${Dle(e.seriesId)}${Ole(e.dataIndex)}`,Ble={seriesProcessor:Ale,colorProcessor:Tle,legendGetter:Ele,tooltipGetter:Mle,tooltipItemPositionGetter:_le,axisTooltipGetter:Rle,xExtremumGetter:Bae,yExtremumGetter:Nae,getSeriesWithDefaultValues:Lle,keyboardFocusHandler:kle,identifierSerializer:iy},Nle=e=>{const{axis:t}=e;return wg(t.data??[])};function $le(e,t,n,s){return n.reduce((o,a,l)=>{if(t[l]===null)return o;const[u,d]=e(a);return s&&(!s({y:u,x:null},l)||!s({y:d,x:null},l))?o:[Math.min(u,d,o[0]),Math.max(u,d,o[1])]},[1/0,-1/0])}const Hle=e=>{const{series:t,axis:n,isDefaultAxis:s,getFilters:o}=e;return Object.keys(t).filter(a=>{const l=t[a].yAxisId;return l===n.id||s&&l===void 0}).reduce((a,l)=>{const{area:u,stackedData:d,data:f}=t[l],p=u!==void 0,g=o?.({currentAxisId:n.id,isDefaultAxis:s,seriesXAxisId:t[l].xAxisId,seriesYAxisId:t[l].yAxisId}),x=p&&n.scaleType!=="log"&&typeof t[l].baseline!="string"?j=>j:j=>[j[1],j[1]],b=$le(x,f,d,g),[y,S]=b;return[Math.min(y,a[0]),Math.max(S,a[1])]},[1/0,-1/0])},Wle=e=>e==null?"":e.toLocaleString(),Ule=(e,t,n)=>{const{seriesOrder:s,series:o}=e,a=vF(Ce({},e,{defaultStrategy:{stackOffset:"none"}})),l=t??[];s.forEach(d=>{const f=o[d].data;f!==void 0&&f.forEach((p,g)=>{l.length<=g?l.push({[d]:p}):l[g][d]=p})});const u={};return a.forEach(d=>{const{ids:f,stackingOffset:p,stackingOrder:g}=d,x=f.map(A=>{const M=o[A].dataKey;return o[A].data===void 0&&M!==void 0?M:A}),b=k1().keys(x).value((A,M)=>A[M]??0).order(g).offset(p)(l),y=b.map(A=>A.index),S=()=>y,j=k1().keys(x).value((A,M)=>{const R=x.indexOf(M),_=f[R];return n?.({type:"line",seriesId:_})?A[M]??0:0}).order(S).offset(p)(l);f.forEach((A,M)=>{const R=o[A].dataKey,_=R?t.map(F=>{const N=F[R];return typeof N=="number"?N:null}):o[A].data,z=!n?.({type:"line",seriesId:A});u[A]=Ce({labelMarkType:"line"},o[A],{data:_,valueFormatter:o[A].valueFormatter??Wle,hidden:z,stackedData:b[M],visibleStackedData:j[M]})})}),{seriesOrder:s,stackingGroups:a,series:u}},bw=(e,t,n)=>{const s=n?.colorScale,o=t?.colorScale,a=xw(e);return s?l=>{if(l===void 0)return e.color;const u=e.data[l],d=u===null?a({value:u,dataIndex:l}):s(u);return d===null?a({value:u,dataIndex:l}):d}:o?l=>{if(l===void 0)return e.color;const u=t.data?.[l],d=u===null?a({value:u,dataIndex:l}):o(u);return d===null?a({value:u,dataIndex:l}):d}:l=>{if(l===void 0)return e.color;const u=e.data[l];return a({value:u,dataIndex:l})}},qle=e=>{const{seriesOrder:t,series:n}=e;return t.reduce((s,o)=>{const a=ha(n[o].label,"legend");return a===void 0||s.push({type:"line",markType:n[o].labelMarkType,id:o,seriesId:o,color:n[o].color,label:a}),s},[])},Vle=e=>{const{series:t,getColor:n,identifier:s}=e;if(!s||s.dataIndex===void 0)return null;const o=ha(t.label,"tooltip"),a=t.data[s.dataIndex],l=t.valueFormatter(a,{dataIndex:s.dataIndex});return{identifier:s,color:n(s.dataIndex),label:o,value:a,formattedValue:l,markType:t.labelMarkType}},Gle=e=>Object.values(e).map(t=>({direction:"x",axisId:t.xAxisId})),Yle=(e,t,n)=>Ce({},e,{id:e.id??`auto-generated-id-${t}`,color:e.color??n[t%n.length]}),Kle=e=>{const{series:t,identifier:n,axesConfig:s}=e;if(!n||n.dataIndex===void 0)return null;const o=t.line?.series[n.seriesId];if(o==null||s.x===void 0||s.y===void 0)return null;const a=s.x.data?.[n.dataIndex],l=o.data[n.dataIndex]==null?null:o.visibleStackedData[n.dataIndex][1];return a==null||l==null?null:{x:s.x.scale(a),y:s.y.scale(l)}},d0=new Set(["bar","line","scatter"]),Xle=e=>{switch(e.key){case"ArrowRight":return ny(d0);case"ArrowLeft":return ry(d0);case"ArrowDown":return oy(d0);case"ArrowUp":return sy(d0);default:return null}},Zle={colorProcessor:bw,seriesProcessor:Ule,legendGetter:qle,tooltipGetter:Vle,tooltipItemPositionGetter:Kle,axisTooltipGetter:Gle,xExtremumGetter:Nle,yExtremumGetter:Hle,getSeriesWithDefaultValues:Yle,keyboardFocusHandler:Xle,identifierSerializer:iy},Qle=(e="none")=>{if(typeof e=="function")return e;switch(e){case"none":return null;case"desc":return(t,n)=>n-t;case"asc":return(t,n)=>t-n;default:return null}},Jle=(e,t,n)=>{const{seriesOrder:s,series:o}=e,a={};return s.forEach(l=>{const u=o[l].data.filter((p,g)=>n?.({type:"pie",seriesId:l,dataIndex:g})),d=Gae().startAngle(jl(o[l].startAngle??0)).endAngle(jl(o[l].endAngle??360)).padAngle(jl(o[l].paddingAngle??0)).sortValues(Qle(o[l].sortingValues??"none"))(u.map(p=>p.value));let f=0;a[l]=Ce({labelMarkType:"circle",valueFormatter:p=>p.value.toLocaleString()},o[l],{data:o[l].data.map((p,g)=>{const x=p.id??`auto-generated-pie-id-${l}-${g}`,b=!n?.({type:"pie",seriesId:l,dataIndex:g});let y;if(b){const j=f>0?d[f-1].endAngle:jl(o[l].startAngle??0);y={startAngle:j,endAngle:j,padAngle:0,value:p.value,index:g}}else y=d[f],f+=1;const S=Ce({},p,{id:x,hidden:b},y);return Ce({labelMarkType:"circle"},S,{formattedValue:o[l].valueFormatter?.(Ce({},S,{label:ha(S.label,"arc")}),{dataIndex:g})??S.value.toLocaleString()})})})}),{seriesOrder:s,series:a}},ece=e=>t=>e.data[t].color,tce=e=>{const{seriesOrder:t,series:n}=e;return t.reduce((s,o)=>(n[o].data.forEach((a,l)=>{const u=ha(a.label,"legend");if(u===void 0)return;const d=a.id??l;s.push({type:"pie",markType:a.labelMarkType??n[o].labelMarkType,seriesId:o,id:d,itemId:d,dataIndex:l,color:a.color,label:u})}),s),[])},nce=e=>{const{series:t,getColor:n,identifier:s}=e;if(!s||s.dataIndex===void 0)return null;const o=t.data[s.dataIndex];if(o==null)return null;const a=ha(o.label,"tooltip"),l=Ce({},o,{label:a}),u=t.valueFormatter(l,{dataIndex:s.dataIndex});return{identifier:s,color:n(s.dataIndex),label:a,value:l,formattedValue:u,markType:o.labelMarkType??t.labelMarkType}};function Kp(e,t){if(typeof e=="number")return e;if(e==="100%")return t;if(e.endsWith("%")){const n=Number.parseFloat(e.slice(0,e.length-1));if(!Number.isNaN(n))return n*t/100}if(e.endsWith("px")){const n=Number.parseFloat(e.slice(0,e.length-2));if(!Number.isNaN(n))return n}throw new Error(`MUI X Charts: Received an unknown value "${e}". It should be a number, or a string with a percentage value.`)}function rce(e,t){const{height:n,width:s}=t,{cx:o,cy:a}=e,l=Math.min(s,n)/2,u=Kp(o??"50%",s),d=Kp(a??"50%",n);return{cx:u,cy:d,availableRadius:l}}const sce=(e,t)=>{const n={};for(const s of e.seriesOrder){const{innerRadius:o,outerRadius:a,arcLabelRadius:l,cx:u,cy:d}=e.series[s],{cx:f,cy:p,availableRadius:g}=rce({cx:u,cy:d},{width:t.width,height:t.height}),x=Kp(a??g,g),b=Kp(o??0,g),y=l===void 0?(b+x)/2:Kp(l,g);n[s]={radius:{available:g,inner:b,outer:x,label:y},center:{x:t.left+f,y:t.top+p}}}return n},oce=(e,t,n)=>Ce({},e,{id:e.id??`auto-generated-id-${t}`,data:e.data.map((s,o)=>Ce({},s,{color:s.color??n[o%n.length]}))}),ice=e=>{const{series:t,identifier:n,placement:s,seriesLayout:o}=e;if(!n||n.dataIndex===void 0)return null;const a=t.pie?.series[n.seriesId],l=o.pie?.[n.seriesId];if(a==null||l==null)return null;const{center:u,radius:d}=l,{data:f}=a,p=f[n.dataIndex];if(!p)return null;const g=[[d.inner,p.startAngle],[d.inner,p.endAngle],[d.outer,p.startAngle],[d.outer,p.endAngle]].map(([j,A])=>({x:u.x+j*Math.sin(A),y:u.y-j*Math.cos(A)})),[x,b]=wg(g.map(j=>j.x)),[y,S]=wg(g.map(j=>j.y));switch(s){case"bottom":return{x:(b+x)/2,y:S};case"left":return{x,y:(S+y)/2};case"right":return{x:b,y:(S+y)/2};default:return{x:(b+x)/2,y}}},f0=new Set(["pie"]),ace=e=>{switch(e.key){case"ArrowRight":return ny(f0);case"ArrowLeft":return ry(f0);case"ArrowDown":return oy(f0);case"ArrowUp":return sy(f0);default:return null}},lce={colorProcessor:ece,seriesProcessor:Jle,seriesLayout:sce,legendGetter:tce,tooltipGetter:nce,tooltipItemPositionGetter:ice,getSeriesWithDefaultValues:oce,keyboardFocusHandler:ace,identifierSerializer:iy},cce=e=>{const{series:t,axis:n,isDefaultAxis:s,getFilters:o}=e;let a=1/0,l=-1/0;for(const u in t){if(!Object.hasOwn(t,u))continue;const d=t[u].xAxisId;if(!(d===n.id||d===void 0&&s))continue;const f=o?.({currentAxisId:n.id,isDefaultAxis:s,seriesXAxisId:t[u].xAxisId,seriesYAxisId:t[u].yAxisId}),p=t[u].data??[];for(let g=0;g<p.length;g+=1){const x=p[g];f&&!f(x,g)||x.x!==null&&(x.x<a&&(a=x.x),x.x>l&&(l=x.x))}}return[a,l]},uce=e=>{const{series:t,axis:n,isDefaultAxis:s,getFilters:o}=e;let a=1/0,l=-1/0;for(const u in t){if(!Object.hasOwn(t,u))continue;const d=t[u].yAxisId;if(!(d===n.id||d===void 0&&s))continue;const f=o?.({currentAxisId:n.id,isDefaultAxis:s,seriesXAxisId:t[u].xAxisId,seriesYAxisId:t[u].yAxisId}),p=t[u].data??[];for(let g=0;g<p.length;g+=1){const x=p[g];f&&!f(x,g)||x.y!==null&&(x.y<a&&(a=x.y),x.y>l&&(l=x.y))}}return[a,l]},dce=({series:e,seriesOrder:t},n,s)=>({series:Object.fromEntries(Object.entries(e).map(([a,l])=>{const u=l?.datasetKeys,d=["x","y"].filter(p=>typeof u?.[p]!="string");if(l?.datasetKeys&&d.length>0)throw new Error([`MUI X Charts: scatter series with id='${a}' has incomplete datasetKeys.`,`Properties ${d.map(p=>`"${p}"`).join(", ")} are missing.`].join(` `));const f=u?n?.map(p=>({x:p[u.x]??null,y:p[u.y]??null,z:u.z&&p[u.z],id:u.id&&p[u.id]}))??[]:l.data??[];return[a,Ce({labelMarkType:"circle",markerSize:4},l,{preview:Ce({markerSize:1},l?.preview),data:f,hidden:!s?.({type:"scatter",seriesId:a}),valueFormatter:l.valueFormatter??(p=>p&&`(${p.x}, ${p.y})`)})]})),seriesOrder:t}),fce=(e,t,n,s)=>{const o=s?.colorScale,a=n?.colorScale,l=t?.colorScale,u=xw(e);return o?d=>{if(d===void 0)return e.color;if(s?.data?.[d]!==void 0){const g=o(s?.data?.[d]);if(g!==null)return g}const f=e.data[d],p=f===null?u({value:f,dataIndex:d}):o(f.z);return p===null?u({value:f,dataIndex:d}):p}:a?d=>{if(d===void 0)return e.color;const f=e.data[d],p=f===null?u({value:f,dataIndex:d}):a(f.y);return p===null?u({value:f,dataIndex:d}):p}:l?d=>{if(d===void 0)return e.color;const f=e.data[d],p=f===null?u({value:f,dataIndex:d}):l(f.x);return p===null?u({value:f,dataIndex:d}):p}:d=>{if(d===void 0)return e.color;const f=e.data[d];return u({value:f,dataIndex:d})}},hce=e=>{const{seriesOrder:t,series:n}=e;return t.reduce((s,o)=>{const a=ha(n[o].label,"legend");return a===void 0||s.push({type:"scatter",markType:n[o].labelMarkType,id:o,seriesId:o,color:n[o].color,label:a}),s},[])},pce=e=>{const{series:t,getColor:n,identifier:s}=e;if(!s||s.dataIndex===void 0)return null;const o=ha(t.label,"tooltip"),a=t.data[s.dataIndex],l=t.valueFormatter(a,{dataIndex:s.dataIndex});return{identifier:s,color:n(s.dataIndex),label:o,value:a,formattedValue:l,markType:t.labelMarkType}},gce=(e,t,n)=>Ce({},e,{id:e.id??`auto-generated-id-${t}`,color:e.color??n[t%n.length]}),mce=e=>{const{series:t,identifier:n,axesConfig:s}=e;if(!n||n.dataIndex===void 0)return null;const o=t.scatter?.series[n.seriesId];if(o==null||s.x===void 0||s.y===void 0)return null;const a=o.data?.[n.dataIndex].x,l=o.data?.[n.dataIndex].y;return a==null||l==null?null:{x:s.x.scale(a),y:s.y.scale(l)}},h0=new Set(["bar","line","scatter"]),xce=e=>{switch(e.key){case"ArrowRight":return ny(h0);case"ArrowLeft":return ry(h0);case"ArrowDown":return oy(h0);case"ArrowUp":return sy(h0);default:return null}},bce={seriesProcessor:dce,colorProcessor:fce,legendGetter:hce,tooltipGetter:pce,tooltipItemPositionGetter:mce,xExtremumGetter:cce,yExtremumGetter:uce,getSeriesWithDefaultValues:gce,keyboardFocusHandler:xce,identifierSerializer:iy},yce={bar:Ble,scatter:bce,line:Zle,pie:lce},vce=[ym,bm,hm,oh,vm];function Sce(e){const{children:t,plugins:n=vce,pluginParams:s={},seriesConfig:o=yce}=e,{contextValue:a}=Vre(n,s,o);return r.jsx(Nz.Provider,{value:a,children:t})}const jce=()=>{const e=v.useContext(Nz);if(e==null)throw new Error("MUI X Charts: Could not find the Charts context. This happens when the component is rendered outside of a ChartsDataProvider or ChartsContainer parent component, which means the required context is not available. Wrap your component in a ChartsDataProvider or ChartsContainer. This can also happen if you are bundling multiple versions of the library.");return e},qs=jce;function Cce(e){"hasPointerCapture"in e.currentTarget&&e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)}const ay=(e,t)=>{const{instance:n}=qs(),s=v.useRef(!1),o=pn(()=>{s.current=!0,n.setLastUpdateSource("pointer"),n.setTooltipItem(e),n.setHighlight(e.type==="sankey"?e:{seriesId:e.seriesId,dataIndex:e.dataIndex})}),a=pn(()=>{s.current=!1,n.removeTooltipItem(e),n.clearHighlight()});return v.useEffect(()=>()=>{s.current&&a()},[a]),v.useMemo(()=>({onPointerEnter:o,onPointerLeave:a,onPointerDown:Cce}),[t,o,a])};function jr(){const e=qs();if(!e)throw new Error("MUI X Charts: Could not find the Charts context. This happens when the component is rendered outside of a ChartsContainer parent component. Wrap your component in a ChartsContainer or ChartsDataProvider.");return e.store}function wce(){return!1}function EF(e,t){return!e||!t?wce:function(s){return s?e.highlight==="series"?s.seriesId===t.seriesId:e.highlight==="item"?s.dataIndex===t.dataIndex&&s.seriesId===t.seriesId:!1:!1}}function Ace(){return!1}function TF(e,t){return!e||!t?Ace:function(s){return s?e.fade==="series"?s.seriesId===t.seriesId&&s.dataIndex!==t.dataIndex:e.fade==="global"?s.seriesId!==t.seriesId||s.dataIndex!==t.dataIndex:!1:!1}}function yw(e,t,n){return e?.highlight==="series"&&t?.seriesId===n}function Ece(e,t,n){return yw(e,t,n)?!1:e?.fade==="global"&&t!=null||e?.fade==="series"&&t?.seriesId===n}function kF(e,t,n){return e?.highlight==="item"&&t?.seriesId===n?t.dataIndex:null}function Tce(e,t,n){return yw(e,t,n)||kF(e,t,n)===t?.dataIndex?null:(e?.fade==="series"||e?.fade==="global")&&t?.seriesId===n?t.dataIndex:null}const kce=e=>e.highlight,Mce=Ct(Fr,e=>{const t=new Map;return Object.keys(e).forEach(n=>{const s=e[n];s?.seriesOrder?.forEach(o=>{const a=s?.series[o];t.set(o,a?.highlightScope)})}),t}),Pl=qn(kce,NI,function(t,n){return t.isControlled||t.lastUpdate==="pointer"?t.item:n}),qc=Ct(Mce,Pl,function(t,n){if(!n)return null;const s=t.get(n.seriesId);return s===void 0?null:s}),Rce=qn(qc,Pl,EF),zce=qn(qc,Pl,TF),Ice=Ct(qc,Pl,function(t,n,s){return EF(t,n)(s)});Ct(qc,Pl,yw);Ct(qc,Pl,Ece);Ct(qc,Pl,Tce);Ct(qc,Pl,kF);const Fce=Ct(qc,Pl,function(t,n,s){return TF(t,n)(s)});function MF(e){const t=jr(),n=t.use(Ice,e),s=t.use(Fce,e);return{isHighlighted:n,isFaded:!n&&s}}var w5,P9;function _ce(){if(P9)return w5;P9=1;var e=4,t=.001,n=1e-7,s=10,o=11,a=1/(o-1),l=typeof Float32Array=="function";function u(S,j){return 1-3*j+3*S}function d(S,j){return 3*j-6*S}function f(S){return 3*S}function p(S,j,A){return((u(j,A)*S+d(j,A))*S+f(j))*S}function g(S,j,A){return 3*u(j,A)*S*S+2*d(j,A)*S+f(j)}function x(S,j,A,M,R){var _,z,F=0;do z=j+(A-j)/2,_=p(z,M,R)-S,_>0?A=z:j=z;while(Math.abs(_)>n&&++F<s);return z}function b(S,j,A,M){for(var R=0;R<e;++R){var _=g(j,A,M);if(_===0)return j;var z=p(j,A,M)-S;j-=z/_}return j}function y(S){return S}return w5=function(j,A,M,R){if(!(0<=j&&j<=1&&0<=M&&M<=1))throw new Error("bezier x values must be in [0, 1] range");if(j===A&&M===R)return y;for(var _=l?new Float32Array(o):new Array(o),z=0;z<o;++z)_[z]=p(z*a,j,M);function F(N){for(var I=0,B=1,H=o-1;B!==H&&_[B]<=N;++B)I+=a;--B;var P=(N-_[B])/(_[B+1]-_[B]),k=I+P*a,L=g(k,j,M);return L>=t?b(N,k,j,M):L===0?k:x(N,I,I+a,j,M)}return function(I){return I===0?0:I===1?1:p(F(I),A,R)}},w5}var Lce=_ce();const Pce=Ig(Lce),ah=300,Sm="cubic-bezier(0.66, 0, 0.34, 1)",Dce=Pce(.66,0,.34,1);var Zf=0,Ip=0,gp=0,RF=1e3,M1,Fp,R1=0,Nu=0,ly=0,Ag=typeof performance=="object"&&performance.now?performance:Date,zF=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function vw(){return Nu||(zF(Oce),Nu=Ag.now()+ly)}function Oce(){Nu=0}function z1(){this._call=this._time=this._next=null}z1.prototype=IF.prototype={constructor:z1,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?vw():+n)+(t==null?0:+t),!this._next&&Fp!==this&&(Fp?Fp._next=this:M1=this,Fp=this),this._call=e,this._time=n,XS()},stop:function(){this._call&&(this._call=null,this._time=1/0,XS())}};function IF(e,t,n){var s=new z1;return s.restart(e,t,n),s}function Bce(){vw(),++Zf;for(var e=M1,t;e;)(t=Nu-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Zf}function D9(){Nu=(R1=Ag.now())+ly,Zf=Ip=0;try{Bce()}finally{Zf=0,$ce(),Nu=0}}function Nce(){var e=Ag.now(),t=e-R1;t>RF&&(ly-=t,R1=e)}function $ce(){for(var e,t=M1,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:M1=n);Fp=e,XS(s)}function XS(e){if(!Zf){Ip&&(Ip=clearTimeout(Ip));var t=e-Nu;t>24?(e<1/0&&(Ip=setTimeout(D9,e-Ag.now()-ly)),gp&&(gp=clearInterval(gp))):(gp||(R1=Ag.now(),gp=setInterval(Nce,RF)),Zf=1,zF(D9))}}function Hce(e,t,n){var s=new z1;return t=t==null?0:+t,s.restart(o=>{s.stop(),e(o+t)},t,n),s}class Wce{elapsed=0;timer=null;constructor(t,n,s){this.duration=t,this.easingFn=n,this.onTickCallback=s,this.resume()}get running(){return this.timer!==null}timerCallback(t){this.elapsed=Math.min(t,this.duration);const n=this.duration===0?1:this.elapsed/this.duration,s=this.easingFn(n);this.onTickCallback(s),this.elapsed>=this.duration&&this.stop()}resume(){if(this.running||this.elapsed>=this.duration)return this;const t=vw()-this.elapsed;return this.timer=IF(n=>this.timerCallback(n),0,t),this}stop(){return this.running?(this.timer&&(this.timer.stop(),this.timer=null),this):this}finish(){return this.stop(),Hce(()=>this.timerCallback(this.duration)),this}}function Uce(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(let o=0;o<n.length;o+=1){const a=n[o];if(!Object.prototype.hasOwnProperty.call(t,a)||!Object.is(e[a],t[a]))return!1}return!0}function qce(e,{createInterpolator:t,applyProps:n,skip:s,initialProps:o=e}){const a=v.useRef(o),l=v.useRef(null),u=v.useRef(null),d=v.useRef(e);or(()=>{d.current=e},[e]),or(()=>{s&&(l.current?.finish(),l.current=null,u.current=null,a.current=e)},[e,s]);const f=v.useCallback(g=>{const x=a.current,b=t(x,e);l.current=new Wce(ah,Dce,y=>{const S=b(y);a.current=S,n(g,S)})},[n,t,e]);return[v.useCallback(g=>{if(g===null){l.current?.stop();return}const x=u.current;if(x===g){if(Uce(d.current,e)){l.current?.resume();return}l.current?.stop()}x&&l.current?.stop(),u.current=g,(l.current||!s)&&f(g)},[f,e,s]),a.current]}function FF(e,{createInterpolator:t,transformProps:n,applyProps:s,skip:o,initialProps:a=e,ref:l}){const u=n??(g=>g),[d,f]=qce(e,{initialProps:a,createInterpolator:t,applyProps:(g,x)=>s(g,u(x)),skip:o}),p=n(o?e:f);return Ce({},p,{ref:vr(d,l)})}function Vce(e){return FF({d:e.d},{createInterpolator:(t,n)=>{const s=VC(t.d,n.d);return o=>({d:s(o)})},applyProps:(t,{d:n})=>t.setAttribute("d",n),transformProps:t=>t,skip:e.skipAnimation,ref:e.ref})}function _F(e){return e.replace(" ","_")}function qi(){return jr().use(Ro)}function cy(){return jr().use(jre)}const Gce=e=>(t,n)=>Math.atan2(t-e.cx,e.cy-n);function uy(e){return(e%360+360)%360}const A5=2*Math.PI;function Yce(e){return(e%A5+A5)%A5}function O9(e,t){const{scale:n,data:s,reverse:o}=e;if(!Ss(n))throw new Error("MUI X Charts: getAxisValue is not implemented for polare continuous axes.");if(!s)return-1;const a=Yce(t-Math.min(...n.range())),l=n.bandwidth()===0?Math.floor((a+n.step()/2)/n.step())%s.length:Math.floor(a/n.step());return l<0||l>=s.length?-1:o?s.length-1-l:l}function oo(){const e=jr(),{axis:t,axisIds:n}=e.use(ro);return{xAxis:t,xAxisIds:n}}function io(){const e=jr(),{axis:t,axisIds:n}=e.use(so);return{yAxis:t,yAxisIds:n}}function Kce(e){const t=jr(),{axis:n,axisIds:s}=t.use(ro),o=s[0];return n[o]}function Xce(e){const t=jr(),{axis:n,axisIds:s}=t.use(so),o=s[0];return n[o]}function LF(){const e=jr(),{axis:t,axisIds:n}=e.use(Uc);return{rotationAxis:t,rotationAxisIds:n}}function Zce(e){const t=jr(),{axis:n,axisIds:s}=t.use(Uc),o=s[0];return n[o]}function lh(e){if(Ss(e))return n=>(e(n)??0)+e.bandwidth()/2;const t=e.domain();return t[0]===t[1]?n=>n===t[0]?e(n):NaN:n=>e(n)}function Sw(){const e=jr(),{axis:t,axisIds:n}=e.use(Oae)??{axis:{},axisIds:[]};return{zAxis:t,zAxisIds:n}}function PF(){const e=qs();if(!e)throw new Error(["MUI X Charts: Could not find the svg ref context.","It looks like you rendered your component outside of a ChartContainer parent component."].join(` `));return e.svgRef}function dy(){return jr().use(Fr)}const Qce=Ct(Fr,(e,t)=>e[t]);qn(Fr,(e,t,n)=>{if(n===void 0||Array.isArray(n)&&n.length===0)return e[t]?.seriesOrder?.map(o=>e[t]?.series[o])??[];if(!Array.isArray(n))return e[t]?.series?.[n];const s=[];for(const o of n){const a=e[t]?.series?.[o];a&&s.push(a)}return s});const Jce=e=>jr().use(Qce,e);function jm(){return Jce("line")}function eue(){const e=jr(),t=e.use(Rce),n=e.use(zce);return{isHighlighted:t,isFaded:n}}function tue(e,t){return Object.keys(e).flatMap(n=>{const s=t[n].legendGetter;return s===void 0?[]:s(e[n])})}function nue(){const e=dy(),n=jr().use(no);return{items:tue(e,n)}}function jw(){const e=cy();return v.useCallback(t=>`${e}-gradient-${t}`,[e])}function rue(){const e=cy();return v.useCallback(t=>`${e}-gradient-${t}-object-bound`,[e])}function sue(e){return FF({d:e.d},{createInterpolator:(t,n)=>{const s=VC(t.d,n.d);return o=>({d:s(o)})},applyProps:(t,{d:n})=>t.setAttribute("d",n),skip:e.skipAnimation,transformProps:t=>t,ref:e.ref})}function oue(){return qs().chartRootRef}const iue={"image/png":"PNG","image/jpeg":"JPEG","image/webp":"WebP"},aue=e=>({components:{MuiChartsLocalizationProvider:{defaultProps:{localeText:Ce({},e)}}}}),DF={loading:"Loading data…",noData:"No data to display",zoomIn:"Zoom in",zoomOut:"Zoom out",toolbarExport:"Export",toolbarExportPrint:"Print",toolbarExportImage:e=>`Export as ${iue[e]??e}`,chartTypeBar:"Bar",chartTypeColumn:"Column",chartTypeLine:"Line",chartTypeArea:"Area",chartTypePie:"Pie",chartPaletteLabel:"Color palette",chartPaletteNameRainbowSurge:"Rainbow Surge",chartPaletteNameBlueberryTwilight:"Blueberry Twilight",chartPaletteNameMangoFusion:"Mango Fusion",chartPaletteNameCheerfulFiesta:"Cheerful Fiesta",chartPaletteNameStrawberrySky:"Strawberry Sky",chartPaletteNameBlue:"Blue",chartPaletteNameGreen:"Green",chartPaletteNamePurple:"Purple",chartPaletteNameRed:"Red",chartPaletteNameOrange:"Orange",chartPaletteNameYellow:"Yellow",chartPaletteNameCyan:"Cyan",chartPaletteNamePink:"Pink",chartConfigurationSectionChart:"Chart",chartConfigurationSectionColumns:"Columns",chartConfigurationSectionBars:"Bars",chartConfigurationSectionAxes:"Axes",chartConfigurationGrid:"Grid",chartConfigurationBorderRadius:"Border radius",chartConfigurationCategoryGapRatio:"Category gap ratio",chartConfigurationBarGapRatio:"Series gap ratio",chartConfigurationStacked:"Stacked",chartConfigurationShowToolbar:"Show toolbar",chartConfigurationSkipAnimation:"Skip animation",chartConfigurationInnerRadius:"Inner radius",chartConfigurationOuterRadius:"Outer radius",chartConfigurationColors:"Colors",chartConfigurationHideLegend:"Hide legend",chartConfigurationShowMark:"Show mark",chartConfigurationHeight:"Height",chartConfigurationWidth:"Width",chartConfigurationSeriesGap:"Series gap",chartConfigurationTickPlacement:"Tick placement",chartConfigurationTickLabelPlacement:"Tick label placement",chartConfigurationCategoriesAxisLabel:"Categories axis label",chartConfigurationSeriesAxisLabel:"Series axis label",chartConfigurationXAxisPosition:"X-axis position",chartConfigurationYAxisPosition:"Y-axis position",chartConfigurationSeriesAxisReverse:"Reverse series axis",chartConfigurationTooltipPlacement:"Placement",chartConfigurationTooltipTrigger:"Trigger",chartConfigurationLegendPosition:"Position",chartConfigurationLegendDirection:"Direction",chartConfigurationBarLabels:"Bar labels",chartConfigurationColumnLabels:"Column labels",chartConfigurationInterpolation:"Interpolation",chartConfigurationSectionTooltip:"Tooltip",chartConfigurationSectionLegend:"Legend",chartConfigurationSectionLines:"Lines",chartConfigurationSectionAreas:"Areas",chartConfigurationSectionArcs:"Arcs",chartConfigurationPaddingAngle:"Padding angle",chartConfigurationCornerRadius:"Corner radius",chartConfigurationArcLabels:"Arc labels",chartConfigurationStartAngle:"Start angle",chartConfigurationEndAngle:"End angle",chartConfigurationPieTooltipTrigger:"Trigger",chartConfigurationPieLegendPosition:"Position",chartConfigurationPieLegendDirection:"Direction",chartConfigurationOptionNone:"None",chartConfigurationOptionValue:"Value",chartConfigurationOptionAuto:"Auto",chartConfigurationOptionTop:"Top",chartConfigurationOptionTopLeft:"Top Left",chartConfigurationOptionTopRight:"Top Right",chartConfigurationOptionBottom:"Bottom",chartConfigurationOptionBottomLeft:"Bottom Left",chartConfigurationOptionBottomRight:"Bottom Right",chartConfigurationOptionLeft:"Left",chartConfigurationOptionRight:"Right",chartConfigurationOptionAxis:"Axis",chartConfigurationOptionItem:"Item",chartConfigurationOptionHorizontal:"Horizontal",chartConfigurationOptionVertical:"Vertical",chartConfigurationOptionBoth:"Both",chartConfigurationOptionStart:"Start",chartConfigurationOptionMiddle:"Middle",chartConfigurationOptionEnd:"End",chartConfigurationOptionExtremities:"Extremities",chartConfigurationOptionTick:"Tick",chartConfigurationOptionMonotoneX:"Monotone X",chartConfigurationOptionMonotoneY:"Monotone Y",chartConfigurationOptionCatmullRom:"Catmull-Rom",chartConfigurationOptionLinear:"Linear",chartConfigurationOptionNatural:"Natural",chartConfigurationOptionStep:"Step",chartConfigurationOptionStepBefore:"Step Before",chartConfigurationOptionStepAfter:"Step After",chartConfigurationOptionBumpX:"Bump X",chartConfigurationOptionBumpY:"Bump Y"},lue=DF;aue(DF);const cue=["localeText"],ZS=v.createContext(null);function uue(e){const{localeText:t}=e,n=_n(e,cue),{localeText:s}=v.useContext(ZS)??{localeText:void 0},o=Wi({props:n,name:"MuiChartsLocalizationProvider"}),{children:a,localeText:l}=o,u=v.useMemo(()=>Ce({},lue,l,s,t),[l,s,t]),d=v.useMemo(()=>({localeText:u}),[u]);return r.jsx(ZS.Provider,{value:d,children:a})}const OF=()=>{const e=v.useContext(ZS);if(e===null)throw new Error(["MUI X Charts: Can not find the charts localization context.","It looks like you forgot to wrap your component in ChartsLocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-charts` package"].join(` `));return e};function due(){return jr().use(dw)}const BF=mt("MuiAppearingMask",["animate"]),fue=Me("rect",{slot:"internal",shouldForwardProp:void 0})({animationName:"animate-width",animationTimingFunction:Sm,animationDuration:"0s",[`&.${BF.animate}`]:{animationDuration:`${ah}ms`},"@keyframes animate-width":{from:{width:0}}});function NF(e){const t=qi(),n=cy(),s=_F(`${n}-${e.id}`);return r.jsxs(v.Fragment,{children:[r.jsx("clipPath",{id:s,children:r.jsx(fue,{className:e.skipAnimation?"":BF.animate,x:0,y:0,width:t.left+t.width+t.right,height:t.top+t.height+t.bottom})}),r.jsx("g",{clipPath:`url(#${s})`,children:e.children})]})}const hue=["skipAnimation","ownerState"];function pue(e){const{skipAnimation:t,ownerState:n}=e,s=_n(e,hue),o=Vce(e);return r.jsx(NF,{skipAnimation:t,id:`${n.id}-area-clip`,children:r.jsx("path",Ce({fill:n.gradientId?`url(#${n.gradientId})`:n.color,filter:n.isHighlighted?"brightness(140%)":n.gradientId?void 0:"brightness(120%)",opacity:n.isFaded?.3:1,stroke:"none","data-series":n.id,"data-highlighted":n.isHighlighted||void 0,"data-faded":n.isFaded||void 0},s,o))})}function gue(e){return gt("MuiLineChart",e)}const $F=mt("MuiLineChart",["area","line","mark","markAnimate","highlight","areaPlot","linePlot","markPlot"]),Vc=e=>{const{skipAnimation:t,classes:n}=e??{};return pt({area:["area"],line:["line"],mark:["mark",!t&&"markAnimate"],highlight:["highlight"],areaPlot:["areaPlot"],linePlot:["linePlot"],markPlot:["markPlot"]},gue,n)},mue=["id","classes","color","gradientId","slots","slotProps","onClick"];function xue(e){return gt("MuiAreaElement",e)}mt("MuiAreaElement",["root","highlighted","faded","series"]);const bue=e=>{const{classes:t,id:n,isFaded:s,isHighlighted:o}=e,a={root:["root",`series-${n}`,o&&"highlighted",s&&"faded"]};return pt(a,xue,t)};function yue(e){const{id:t,classes:n,color:s,gradientId:o,slots:a,slotProps:l,onClick:u}=e,d=_n(e,mue),f=ay({type:"line",seriesId:t}),{isFaded:p,isHighlighted:g}=MF({seriesId:t}),x={id:t,classes:n,color:s,gradientId:o,isFaded:p,isHighlighted:g},b=Vc(),y=bue(x),S=a?.area??pue,j=Hr({elementType:S,externalSlotProps:l?.area,additionalProps:Ce({},f,{onClick:u,cursor:u?"pointer":"unset","data-highlighted":g||void 0,"data-faded":p||void 0,"data-series-id":t,"data-series":t}),className:`${b.area} ${y.root}`,ownerState:x});return r.jsx(S,Ce({},d,j))}function Cw(e){const n=jr().use(sre);return e||n}function ww(){return jr().use(EI)}function HF(e){switch(e){case"catmullRom":return lle.alpha(.5);case"linear":return gw;case"monotoneX":return _9;case"monotoneY":return cle;case"natural":return ule;case"step":return dle;case"stepBefore":return fle;case"stepAfter":return hle;case"bumpY":return Kae;case"bumpX":return Yae;default:return _9}}function vue(e,t){const n=jm(),s=oo().xAxisIds[0],o=io().yAxisIds[0],a=jw();return v.useMemo(()=>{if(n===void 0)return[];const{series:u,stackingGroups:d}=n,f=[];for(const p of d){const g=p.ids;for(let x=g.length-1;x>=0;x-=1){const b=g[x],{xAxisId:y=s,yAxisId:S=o,visibleStackedData:j,stackedData:A,data:M,connectNulls:R,baseline:_,curve:z,strictStepCurve:F,area:N}=u[b];if(!N||!(y in e)||!(S in t))continue;const I=e[y].scale,B=lh(I),H=t[S].scale,P=e[y].data,k=t[S].colorScale&&a(S)||e[y].colorScale&&a(y)||void 0,L=z?.includes("step")&&!F&&Ss(I),O=P?.flatMap((K,Y)=>{const ie=M[Y]==null;if(L){const V=[{x:K,y:j[Y],nullData:ie,isExtension:!1}];return!ie&&(Y===0||M[Y-1]==null)&&V.unshift({x:(I(K)??0)-(I.step()-I.bandwidth())/2,y:j[Y],nullData:ie,isExtension:!0}),!ie&&(Y===M.length-1||M[Y+1]==null)&&V.push({x:(I(K)??0)+(I.step()+I.bandwidth())/2,y:j[Y],nullData:ie,isExtension:!0}),V}return{x:K,y:j[Y],nullData:ie}})??[],W=R?O.filter(K=>!K.nullData):O,q=Uae().x(K=>K.isExtension?K.x:B(K.x)).defined(K=>R||!K.nullData||!!K.isExtension).y0(K=>{if(typeof _=="number")return H(_);if(_==="max")return H.range()[1];if(_==="min")return H.range()[0];const Y=K.y&&H(K.y[0]);return Number.isNaN(Y)?H.range()[0]:Y}).y1(K=>K.y&&H(K.y[1])).curve(HF(z))(W)||"";f.push({area:u[b].area,color:u[b].color,gradientId:k,d:q,seriesId:b})}}return f},[n,s,o,e,t,a])}const Sue=["slots","slotProps","onItemClick","skipAnimation","className"],jue=Me("g",{name:"MuiAreaPlot",slot:"Root"})({[`& .${$F.area}`]:{transitionProperty:"opacity, fill",transitionDuration:`${ah}ms`,transitionTimingFunction:Sm}}),Cue=()=>{const{xAxis:e}=oo(),{yAxis:t}=io();return vue(e,t)};function wue(e){const{slots:t,slotProps:n,onItemClick:s,skipAnimation:o,className:a}=e,l=_n(e,Sue),u=ww(),d=Cw(u||o),f=Cue(),p=Vc();return r.jsx(jue,Ce({className:Ye(p.areaPlot,a)},l,{children:f.map(({d:g,seriesId:x,color:b,area:y,gradientId:S})=>!!y&&r.jsx(yue,{id:x,d:g,color:b,gradientId:S,slots:t,slotProps:n,onClick:s&&(j=>s(j,{type:"line",seriesId:x})),skipAnimation:d},x))}))}const Aue=["skipAnimation","ownerState"],Eue=v.forwardRef(function(t,n){const{skipAnimation:s,ownerState:o}=t,a=_n(t,Aue),l=sue({d:t.d,skipAnimation:s,ref:n}),u=o.isFaded?.3:1;return r.jsx(NF,{skipAnimation:s,id:`${o.id}-line-clip`,children:r.jsx("path",Ce({stroke:o.gradientId?`url(#${o.gradientId})`:o.color,strokeWidth:2,strokeLinejoin:"round",fill:"none",filter:o.isHighlighted?"brightness(120%)":void 0,opacity:o.hidden?0:u,"data-series":o.id,"data-highlighted":o.isHighlighted||void 0,"data-faded":o.isFaded||void 0},a,l))})}),Tue=["id","classes","color","gradientId","slots","slotProps","onClick","hidden"];function kue(e){return gt("MuiLineElement",e)}mt("MuiLineElement",["root","highlighted","faded","series"]);const Mue=e=>{const{classes:t,id:n,isFaded:s,isHighlighted:o}=e,a={root:["root",`series-${n}`,o&&"highlighted",s&&"faded"]};return pt(a,kue,t)};function Rue(e){const{id:t,classes:n,color:s,gradientId:o,slots:a,slotProps:l,onClick:u,hidden:d}=e,f=_n(e,Tue),p=ay({type:"line",seriesId:t}),{isFaded:g,isHighlighted:x}=MF({seriesId:t}),b={id:t,classes:n,color:s,gradientId:o,isFaded:g,isHighlighted:x,hidden:d},y=Vc(),S=Mue(b),j=a?.line??Eue,A=Hr({elementType:j,externalSlotProps:l?.line,additionalProps:Ce({},p,{onClick:u,cursor:u?"pointer":"unset","data-highlighted":x||void 0,"data-faded":g||void 0,"data-series-id":t,"data-series":t}),className:`${y.line} ${S.root}`,ownerState:b});return r.jsx(j,Ce({},f,A))}function zue(e,t){const n=jm(),s=oo().xAxisIds[0],o=io().yAxisIds[0],a=jw();return v.useMemo(()=>{if(n===void 0)return[];const{series:u,stackingGroups:d}=n,f=[];for(const p of d){const g=p.ids;for(const x of g){const{xAxisId:b=s,yAxisId:y=o,stackedData:S,visibleStackedData:j,data:A,connectNulls:M,curve:R,strictStepCurve:_}=u[x];if(!(b in e)||!(y in t))continue;const z=e[b].scale,F=lh(z),N=t[y].scale,I=e[b].data,B=t[y].colorScale&&a(y)||e[b].colorScale&&a(b)||void 0,H=R?.includes("step")&&!_&&Ss(z),P=I?.flatMap((D,q)=>{const K=A[q]==null;if(H){const Y=[{x:D,y:j[q],nullData:K,isExtension:!1}];return!K&&(q===0||A[q-1]==null)&&Y.unshift({x:(z(D)??0)-(z.step()-z.bandwidth())/2,y:j[q],nullData:K,isExtension:!0}),!K&&(q===A.length-1||A[q+1]==null)&&Y.push({x:(z(D)??0)+(z.step()+z.bandwidth())/2,y:j[q],nullData:K,isExtension:!0}),Y}return{x:D,y:j[q],nullData:K}})??[],k=M?P.filter(D=>!D.nullData):P,L=u[x].hidden,W=iF().x(D=>D.isExtension?D.x:F(D.x)).defined(D=>M||!D.nullData||!!D.isExtension).y(D=>N(L?N.domain()[0]:D.y[1])).curve(HF(R))(k)||"";f.push({color:u[x].color,gradientId:B,d:W,seriesId:x,hidden:u[x].hidden})}}return f},[n,s,o,e,t,a])}const Iue=["slots","slotProps","skipAnimation","onItemClick","className"],Fue=Me("g",{name:"MuiLinePlot",slot:"Root"})({[`& .${$F.line}`]:{transitionProperty:"opacity, fill",transitionDuration:`${ah}ms`,transitionTimingFunction:Sm}}),_ue=()=>{const{xAxis:e}=oo(),{yAxis:t}=io();return zue(e,t)};function Lue(e){const{slots:t,slotProps:n,skipAnimation:s,onItemClick:o,className:a}=e,l=_n(e,Iue),u=ww(),d=Cw(u||s),f=_ue(),p=Vc();return r.jsx(Fue,Ce({className:Ye(p.linePlot,a)},l,{children:f.map(({d:g,seriesId:x,color:b,gradientId:y,hidden:S})=>r.jsx(Rue,{id:x,d:g,color:b,gradientId:y,hidden:S,skipAnimation:d,slots:t,slotProps:n,onClick:o&&(j=>o(j,{type:"line",seriesId:x}))},x))}))}function Pue(e){return gt("MuiMarkElement",e)}const WF=mt("MuiMarkElement",["root","highlighted","faded","animate","series"]),UF=e=>{const{classes:t,id:n,isFaded:s,isHighlighted:o,skipAnimation:a}=e,l={root:["root",`series-${n}`,o&&"highlighted",s&&"faded",a?void 0:"animate"]};return pt(l,Pue,t)},Due=["x","y","id","classes","color","dataIndex","onClick","skipAnimation","isFaded","isHighlighted","shape","hidden"],Oue=Me("circle",{slot:"internal",shouldForwardProp:void 0})({[`&.${WF.animate}`]:{transitionDuration:`${ah}ms`,transitionProperty:"cx, cy, opacity",transitionTimingFunction:Sm}});function Bue(e){const{x:t,y:n,id:s,classes:o,color:a,dataIndex:l,onClick:u,skipAnimation:d,isFaded:f=!1,isHighlighted:p=!1,hidden:g}=e,x=_n(e,Due),b=On(),y=ay({type:"line",seriesId:s,dataIndex:l}),S={id:s,classes:o,isHighlighted:p,isFaded:f,skipAnimation:d},j=Vc({skipAnimation:d,classes:o}),A=UF(S);return r.jsx(Oue,Ce({},x,{cx:t,cy:n,r:5,fill:(b.vars||b).palette.background.paper,stroke:a,strokeWidth:2,className:`${j.mark} ${A.root}`,onClick:u,cursor:u?"pointer":"unset",pointerEvents:g?"none":void 0},y,{"data-highlighted":p||void 0,"data-faded":f||void 0,"data-series-id":s,"data-series":s,"data-index":l,opacity:g?0:1}))}function qF(e){switch(e){case"circle":return 0;case"cross":return 1;case"diamond":return 2;case"square":return 3;case"star":return 4;case"triangle":return 5;case"wye":return 6;default:return 0}}const Nue=["x","y","id","classes","color","shape","dataIndex","onClick","skipAnimation","isFaded","isHighlighted","hidden","style"],$ue=Me("path",{name:"MuiMarkElement",slot:"Root"})(({theme:e})=>({fill:(e.vars||e).palette.background.paper,[`&.${WF.animate}`]:{transitionDuration:`${ah}ms`,transitionProperty:"transform, transform-origin, opacity",transitionTimingFunction:Sm}}));function Hue(e){const{x:t,y:n,id:s,classes:o,color:a,shape:l,dataIndex:u,onClick:d,skipAnimation:f,isFaded:p=!1,isHighlighted:g=!1,hidden:x,style:b}=e,y=_n(e,Nue),S=ay({type:"line",seriesId:s,dataIndex:u}),j={id:s,classes:o,isHighlighted:g,isFaded:p,skipAnimation:f},A=Vc({skipAnimation:f,classes:o}),M=UF(j);return r.jsx($ue,Ce({},y,{style:Ce({},b,{transform:`translate(${t}px, ${n}px)`,transformOrigin:`${t}px ${n}px`}),ownerState:j,className:`${A.mark} ${M.root}`,d:fF(dF[qF(l)])(),onClick:d,cursor:d?"pointer":"unset",pointerEvents:x?"none":void 0},S,{"data-highlighted":g||void 0,"data-faded":p||void 0,"data-series-id":s,"data-series":s,"data-index":u,opacity:x?0:1,strokeWidth:2,stroke:a}))}function Wue(e,t){const n=jm(),s=oo().xAxisIds[0],o=io().yAxisIds[0],a=cy(),{instance:l}=qs();return v.useMemo(()=>{if(n===void 0)return[];const{series:d,stackingGroups:f}=n,p=[];for(const g of f){const x=g.ids;for(const b of x){const{xAxisId:y=s,yAxisId:S=o,visibleStackedData:j,data:A,showMark:M=!0,shape:R="circle",hidden:_}=d[b];if(M===!1||!(y in e)||!(S in t))continue;const z=lh(e[y].scale),F=t[S].scale,N=e[y].data,I=_F(`${a}-${b}-line-clip`),B=bw(d[b],e[y],t[S]),H=[];if(N)for(let P=0;P<N.length;P+=1){const k=N[P],L=A[P]==null?null:j[P][1];if(L===null)continue;const O=F(_?F.domain()[0]:L),W=z(k);l.isPointInside(W,O)&&(M!==!0&&!M({x:W,y:O,index:P,position:k,value:L})||H.push({x:W,y:O,index:P,color:B(P)}))}p.push({seriesId:b,clipId:I,shape:R,xAxisId:y,marks:H,hidden:_})}}return p},[n,s,o,a,e,t,l])}const Uue=["slots","slotProps","skipAnimation","onItemClick","className"],que=Me("g",{name:"MuiMarkPlot",slot:"Root"})({});function Vue(e){const{slots:t,slotProps:n,skipAnimation:s,onItemClick:o,className:a}=e,l=_n(e,Uue),u=ww(),d=Cw(u||s),{xAxis:f}=oo(),{yAxis:p}=io(),{store:g}=qs(),{isFaded:x,isHighlighted:b}=eue(),y=g.use(qI),S=v.useMemo(()=>{const M={};for(const{dataIndex:R,axisId:_}of y)M[_]===void 0?M[_]=new Set([R]):M[_].add(R);return M},[y]),j=Wue(f,p),A=Vc();return r.jsx(que,Ce({className:Ye(A.markPlot,a)},l,{children:j.map(({seriesId:M,clipId:R,shape:_,xAxisId:z,marks:F,hidden:N})=>{const I=t?.mark??(_==="circle"?Bue:Hue),B=b({seriesId:M}),H=!B&&x({seriesId:M});return r.jsx("g",{clipPath:`url(#${R})`,"data-series":M,children:F.map(({x:P,y:k,index:L,color:O})=>r.jsx(I,Ce({id:M,dataIndex:L,shape:_,color:O,x:P,y:k,skipAnimation:d,onClick:o&&(W=>o(W,{type:"line",seriesId:M,dataIndex:L})),isHighlighted:S[z]?.has(L)||B,isFaded:H,hidden:N},n?.mark),`${M}-${L}`))},M)})}))}function fy(){const[e,t]=v.useState(!1);return v.useEffect(()=>{t(!0)},[]),e}function Aw(e){return typeof e=="number"&&!Number.isFinite(e)}function Gue(e,t){return Math.abs(t.getFullYear()-e.getFullYear())}function B9(e,t){return Math.abs(t.getFullYear()*12+t.getMonth()-12*e.getFullYear()-e.getMonth())}function mp(e,t){return Math.abs(t.getTime()-e.getTime())/(1e3*60*60*24)}function Yue(e,t){return Math.abs(t.getTime()-e.getTime())/(1e3*60*60)}const Kue={years:{getTickNumber:Gue,isTick:(e,t)=>t.getFullYear()!==e.getFullYear(),format:e=>e.getFullYear().toString()},quarterly:{getTickNumber:(e,t)=>Math.floor(B9(e,t)/3),isTick:(e,t)=>t.getMonth()!==e.getMonth()&&t.getMonth()%3===0,format:new Intl.DateTimeFormat("default",{month:"short"}).format},months:{getTickNumber:B9,isTick:(e,t)=>t.getMonth()!==e.getMonth(),format:new Intl.DateTimeFormat("default",{month:"short"}).format},biweekly:{getTickNumber:(e,t)=>mp(e,t)/14,isTick:(e,t)=>(t.getDay()<e.getDay()||mp(t,e)>7)&&Math.floor(t.getDate()/7)%2===1,format:new Intl.DateTimeFormat("default",{day:"numeric"}).format},weeks:{getTickNumber:(e,t)=>mp(e,t)/7,isTick:(e,t)=>t.getDay()<e.getDay()||mp(t,e)>=7,format:new Intl.DateTimeFormat("default",{day:"numeric"}).format},days:{getTickNumber:mp,isTick:(e,t)=>t.getDate()!==e.getDate(),format:new Intl.DateTimeFormat("default",{day:"numeric"}).format},hours:{getTickNumber:Yue,isTick:(e,t)=>t.getHours()!==e.getHours(),format:new Intl.DateTimeFormat("default",{hour:"2-digit",minute:"2-digit"}).format}},QS={start:0,extremities:0,end:1,middle:.5};function vf(e,t,n){return e(t)-(e.step()-e.bandwidth())/2+QS[n]*e.step()}function Xue(e,t,n){const s=Math.abs(t[1]-t[0]),o=Math.ceil(e.length/(s/n));return Number.isNaN(o)||o<=1?e:e.filter((a,l)=>l%o===0)}function Zue(e,t,n,s,o){if(n.length===0)return[];const a=s.range()[0]>s.range()[1],l=e.findIndex(b=>o(vf(s,b,a?"start":"end"))),u=e.findLastIndex(b=>o(vf(s,b,a?"end":"start"))),d=e[0],f=e[e.length-1];if(!(d instanceof Date)||!(f instanceof Date))return[];let p=0;for(let b=0;b<n.length;b+=1)if(n[b].getTickNumber(d,f)!==0){p=b;break}let g=p;for(let b=p;b<n.length;b+=1){if(b===n.length-1){g=b;break}const y=n[b].getTickNumber(d,f),S=n[b+1].getTickNumber(d,f);if(S>t||t/y<S/t){g=b;break}}const x=[];for(let b=Math.max(1,l);b<=u;b+=1)for(let y=p;y<=g;y+=1){const S=e[b-1],j=e[b];if(S instanceof Date&&j instanceof Date&&n[y].isTick(S,j)){x.push({index:b,formatter:n[y].format});break}}return x}function Que(e){const{scale:t,tickNumber:n,valueFormatter:s,tickInterval:o,tickPlacement:a,tickLabelPlacement:l,tickSpacing:u,isInside:d,ordinalTimeTicks:f}=e;if(f!==void 0&&j1(t.domain())&&Ss(t)){const S=t.domain();if(S.length===0||S.length===1)return[];const j="middle";return Zue(S,n,f.map(M=>typeof M=="string"?Kue[M]:M),t,d).map(({index:M,formatter:R})=>{const _=S[M],z=R(_);return{value:_,formattedValue:z,offset:vf(t,_,j),labelOffset:0}})}const p=a??"extremities";if(Ss(t)){const S=t.domain(),j=l??"middle";let A=S;if(typeof o=="object"&&o!=null?A=o:(typeof o=="function"&&(A=A.filter(o)),u!==void 0&&u>0&&(A=Xue(A,t.range(),u))),A.length===0)return[];if(t.bandwidth()>0){const M=t.range()[0]>t.range()[1],R=A.findIndex(z=>d(vf(t,z,M?"start":"end"))),_=A.findLastIndex(z=>d(vf(t,z,M?"end":"start")));return[...A.slice(R,_+1).map(z=>{const F=`${z}`;return{value:z,formattedValue:s?.(z,{location:"tick",scale:t,tickNumber:n,defaultTickLabel:F})??F,offset:vf(t,z,p),labelOffset:j==="tick"?0:t.step()*(QS[j]-QS[p])}}),...p==="extremities"&&_===S.length-1&&d(t.range()[1])?[{formattedValue:void 0,offset:t.range()[1],labelOffset:0}]:[]]}return A.map(M=>{const R=`${M}`;return{value:M,formattedValue:s?.(M,{location:"tick",scale:t,tickNumber:n,defaultTickLabel:R})??R,offset:t(M),labelOffset:0}})}if(t.domain().some(Aw))return[];const x=l,b=typeof o=="object"?o:Jue(t,n),y=[];for(let S=0;S<b.length;S+=1){const j=b[S],A=t(j);if(d(A)){const M=t.tickFormat(n)(j);y.push({value:j,formattedValue:s?.(j,{location:"tick",scale:t,tickNumber:n,defaultTickLabel:M})??M,offset:A,labelOffset:x==="middle"?t(b[S-1]??0)-(A+t(b[S-1]??0))/2:0})}}return y}function Jue(e,t){const n=e.domain();return n[0]===n[1]?[n[0]]:e.ticks(t)}function hy(e){const{scale:t,tickNumber:n,valueFormatter:s,tickInterval:o,tickPlacement:a="extremities",tickLabelPlacement:l,tickSpacing:u,direction:d,ordinalTimeTicks:f}=e,{instance:p}=qs(),g=d==="x"?p.isXInside:p.isYInside;return v.useMemo(()=>Que({scale:t,tickNumber:n,tickPlacement:a,tickInterval:o,tickLabelPlacement:l,tickSpacing:u,valueFormatter:s,isInside:g,ordinalTimeTicks:f}),[t,n,a,o,l,u,s,g,f])}function ede(e=!1){const[t,n]=v.useState(!1);return or(()=>{e||n(!0)},[e]),v.useEffect(()=>{e&&n(!0)},[e]),t}const VF=typeof window<"u"&&"Intl"in window&&"Segmenter"in Intl?new Intl.Segmenter(void 0,{granularity:"grapheme"}):null;function tde(e){return e.length}function nde(e){const t=VF.segment(e);let n=0;for(const s of t)n+=1;return n}const rde=VF?nde:tde;function sde(e){return e*(Math.PI/180)}const GF=typeof window<"u"&&"Intl"in window&&"Segmenter"in Intl?new Intl.Segmenter(void 0,{granularity:"grapheme"}):null;function ode(e,t){return e.slice(0,t)}function ide(e,t){const n=GF.segment(e);let s="",o=0;for(const a of n)if(s+=a.segment,o+=1,o>=t)break;return s}const ade=GF?ide:ode,N9="…";function YF(e,t){const{width:n,height:s,measureText:o}=t,a=sde(t.angle),l=o(e),u=Math.abs(l.width*Math.cos(a))+Math.abs(l.height*Math.sin(a)),d=Math.abs(l.width*Math.sin(a))+Math.abs(l.height*Math.cos(a));return u<=n&&d<=s}function KF(e,t){if(t(e))return e;let n=e,s=1,o=1/2;const a=rde(e);let l=a,u=a,d=null;do{if(u=l,l=Math.floor(a*o),l===0)break;n=ade(e,l).trim();const f=t(n+N9);s+=1,f?(d=n,o+=1/2**s):o-=1/2**s}while(Math.abs(l-u)!==1);return d?d+N9:""}function XF(){return typeof window>"u"}const Ac=new Map,ZF=2e3,lde=new Set(["minWidth","maxWidth","width","minHeight","maxHeight","height","top","left","fontSize","padding","margin","paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom"]);function Ew(e,t){return lde.has(e)&&t===+t?`${t}px`:t}const cde=/([A-Z])/g;function Tw(e){return String(e).replace(cde,t=>`-${t.toLowerCase()}`)}function QF(e){let t="";for(const n in e)if(Object.hasOwn(e,n)){const s=n,o=e[s];if(o===void 0)continue;t+=`${Tw(s)}:${Ew(s,o)};`}return t}const Cm=(e,t={})=>{if(e==null||XF())return{width:0,height:0};const n=String(e),s=QF(t),o=`${n}-${s}`,a=Ac.get(o);if(a)return a;try{const l=e_(),u=document.createElementNS("http://www.w3.org/2000/svg","text");Object.keys(t).map(f=>(u.style[Tw(f)]=Ew(f,t[f]),f)),u.textContent=n,l.replaceChildren(u);const d=JF(u);return Ac.set(o,d),Ac.size+1>ZF&&Ac.clear(),d}catch{return{width:0,height:0}}};function ude(e,t={}){if(XF())return new Map(Array.from(e).map(d=>[d,{width:0,height:0}]));const n=new Map,s=[],o=QF(t);for(const d of e){const f=`${d}-${o}`,p=Ac.get(f);p?n.set(d,p):s.push(d)}const a=e_(),l=Ce({},t);Object.keys(l).map(d=>(a.style[Tw(d)]=Ew(d,l[d]),d));const u=[];for(const d of s){const f=document.createElementNS("http://www.w3.org/2000/svg","text");f.textContent=`${d}`,u.push(f)}a.replaceChildren(...u);for(let d=0;d<s.length;d+=1){const f=s[d],p=a.children[d],g=JF(p),x=`${f}-${o}`;Ac.set(x,g),n.set(f,g)}return Ac.size+1>ZF&&Ac.clear(),n}function JF(e){try{const t=e.getBBox();return{width:t.width,height:t.height}}catch{const t=e.getBoundingClientRect();return{width:t.width,height:t.height}}}let xo=null;function e_(){return xo===null&&(xo=document.createElementNS("http://www.w3.org/2000/svg","svg"),xo.setAttribute("aria-hidden","true"),xo.style.position="absolute",xo.style.top="-20000px",xo.style.left="0",xo.style.padding="0",xo.style.margin="0",xo.style.border="none",xo.style.pointerEvents="none",xo.style.visibility="hidden",xo.style.contain="strict",document.body.appendChild(xo)),xo}function dde(e,t,n,s,o){const a=new Map,l=uy(o?.angle??0);let u=1,d=1;o?.textAnchor==="start"?(u=1/0,d=1):o?.textAnchor==="end"?(u=1,d=1/0):(u=2,d=2),l>90&&l<270&&([u,d]=[d,u]),s&&([u,d]=[d,u]);for(const f of e)if(f.formattedValue){const p=Math.min((f.offset+f.labelOffset)*u,(t.left+t.width+t.right-f.offset-f.labelOffset)*d),g=x=>YF(x,{width:p,height:n,angle:l,measureText:b=>Cm(b,o)});a.set(f,KF(f.formattedValue.toString(),g))}return a}const $9=5;function fde(e,t,n=0){const s=Math.min(Math.abs(n)%180,Math.abs(Math.abs(n)%180-180)%180);if(s<$9)return e;if(s>90-$9)return t;const o=jl(s),a=Math.atan2(t,e);return o<a?e/Math.cos(o):t/Math.sin(o)}function hde(e,{tickLabelStyle:t,tickLabelInterval:n,tickLabelMinGap:s,reverse:o,isMounted:a,isXInside:l}){if(typeof n=="function")return new Set(e.filter((g,x)=>n(g.value,x)));let u=0;const d=o?-1:1,f=e.filter(g=>{const{offset:x,labelOffset:b,formattedValue:y}=g;if(y==="")return!1;const S=x+b;return l(S)}),p=gde(f,t);return new Set(f.filter((g,x)=>{const{offset:b,labelOffset:y}=g,S=b+y;if(x>0&&d*S<d*(u+s))return!1;const{width:j,height:A}=a?pde(p,g):{width:0,height:0},M=fde(j,A,t?.angle),R=S-d*M/2;return x>0&&d*R<d*(u+s)?!1:(u=S+d*M/2,!0)}))}function pde(e,t){if(t.formattedValue===void 0)return{width:0,height:0};let n=0,s=0;for(const o of t.formattedValue.split(` `)){const a=e.get(o);a&&(n=Math.max(n,a.width),s+=a.height)}return{width:n,height:s}}function gde(e,t){const n=new Set;for(const s of e)s.formattedValue&&s.formattedValue.split(` `).forEach(o=>n.add(o));return ude(n,t)}function t_(e){return gt("MuiChartsAxis",e)}const p0=mt("MuiChartsAxis",["root","line","tickContainer","tick","tickLabel","label","directionX","directionY","top","bottom","left","right","id"]),n_=e=>{const{classes:t,position:n,id:s}=e,o={root:["root","directionX",n,`id-${s}`],line:["line"],tickContainer:["tickContainer"],tick:["tick"],tickLabel:["tickLabel"],label:["label"]};return pt(o,t_,t)},JS=3,mde=4,r_={disableLine:!1,disableTicks:!1,tickSize:6,tickLabelMinGap:4};function xde({style:e,needsComputation:t,text:n}){return n.split(` `).map(s=>Ce({text:s},t?Cm(s,e):{width:0,height:0}))}const bde=["x","y","style","text","ownerState"],yde=["angle","textAnchor","dominantBaseline"];function py(e){const{x:t,y:n,style:s,text:o}=e,a=_n(e,bde),l=s??{},{angle:u,textAnchor:d,dominantBaseline:f}=l,p=_n(l,yde),g=fy(),x=v.useMemo(()=>xde({style:p,needsComputation:g&&o.includes(` `),text:o}),[p,o,g]);let b;switch(f){case"hanging":case"text-before-edge":b=0;break;case"central":b=(x.length-1)/2*-x[0].height;break;default:b=(x.length-1)*-x[0].height;break}return r.jsx("text",Ce({},a,{transform:u?`rotate(${u}, ${t}, ${n})`:void 0,x:t,y:n,textAnchor:d,dominantBaseline:f,style:p,children:x.map((y,S)=>r.jsx("tspan",{x:t,dy:`${S===0?b:x[0].height}px`,dominantBaseline:f,children:y.text},S))}))}function s_(e){const t=uy(e);return t<=30||t>=330||t<=210&&t>=150?"middle":t<=180?"end":"start"}function o_(e){const t=uy(e);return t<=30||t>=330?"hanging":t<=210&&t>=150?"auto":"central"}function i_(e){switch(e){case"start":return"end";case"end":return"start";default:return e}}const vde=["scale","tickNumber","reverse"];function a_(e){const{xAxis:t,xAxisIds:n}=oo(),s=t[e.axisId??n[0]],{scale:o,tickNumber:a,reverse:l}=s,u=_n(s,vde),d=Wi({props:Ce({},u,e),name:"MuiChartsXAxis"}),f=Ce({},r_,d),{position:p,tickLabelStyle:g,slots:x,slotProps:b}=f,y=On(),S=Ao(),j=n_(f),A=p==="bottom"?1:-1,M=x?.axisTick??"line",R=x?.axisTickLabel??py,_=s_((p==="bottom"?0:180)-(g?.angle??0)),z=o_((p==="bottom"?0:180)-(g?.angle??0)),F=Hr({elementType:R,externalSlotProps:b?.axisTickLabel,additionalProps:{style:Ce({},y.typography.caption,{fontSize:12,lineHeight:1.25,textAnchor:S?i_(_):_,dominantBaseline:z},g)},className:j.tickLabel,ownerState:{}});return{xScale:o,defaultizedProps:f,tickNumber:a,positionSign:A,classes:j,Tick:M,TickLabel:R,axisTickLabelProps:F,reverse:l}}function Sde(e){const{axisLabelHeight:t,ordinalTimeTicks:n}=e,{xScale:s,defaultizedProps:o,tickNumber:a,positionSign:l,classes:u,Tick:d,TickLabel:f,axisTickLabelProps:p,reverse:g}=a_(e),x=Ao(),b=ede(),{disableTicks:y,tickSize:S,valueFormatter:j,slotProps:A,tickInterval:M,tickLabelInterval:R,tickPlacement:_,tickLabelPlacement:z,tickLabelMinGap:F,tickSpacing:N,height:I}=o,B=qi(),{instance:H}=qs(),P=fy(),k=y?4:S,L=hy({scale:s,tickNumber:a,valueFormatter:j,tickInterval:M,tickPlacement:_,tickLabelPlacement:z,tickSpacing:N,direction:"x",ordinalTimeTicks:n}),O=hde(L,{tickLabelStyle:p.style,tickLabelInterval:R,tickLabelMinGap:F,reverse:g,isMounted:b,isXInside:H.isXInside}),W=Math.max(0,I-(t>0?t+mde:0)-k-JS),D=P?dde(O,B,W,x,p.style):new Map(Array.from(O).map(q=>[q,q.formattedValue]));return r.jsx(v.Fragment,{children:L.map((q,K)=>{const{offset:Y,labelOffset:ie}=q,V=ie??0,re=l*(k+JS),fe=H.isXInside(Y),ae=D.get(q),ue=O.has(q);return r.jsxs("g",{transform:`translate(${Y}, 0)`,className:u.tickContainer,children:[!y&&fe&&r.jsx(d,Ce({y2:l*k,className:u.tick},A?.axisTick)),ae!==void 0&&ue&&r.jsx(f,Ce({x:V,y:re},p,{text:ae}))]},K)})})}const xp={start:0,extremities:0,end:1,middle:.5,tick:0};function l_(e){const{scale:t,tickInterval:n,tickLabelPlacement:s="middle",tickPlacement:o="extremities",groups:a}=e;return v.useMemo(()=>{const l=t.domain(),u=typeof n=="function"&&l.filter(n)||typeof n=="object"&&n||l;if(t.bandwidth()>0){const d=H9(u,a,o,s,t);return d[0]&&(d[0].ignoreTick=!0),[{formattedValue:void 0,offset:t.range()[0],labelOffset:0,groupIndex:a.length-1},...d,{formattedValue:void 0,offset:t.range()[1],labelOffset:0,groupIndex:a.length-1}]}return H9(u,a,o,s,t)},[t,n,a,o,s])}function H9(e,t,n,s,o){const a=[],l=new Map;let u=0;for(let d=0;d<t.length;d+=1)for(let f=0;f<e.length;f+=1){const p=e[f],g=t[d].getValue(p,f),x=a[a.length-1];if(x?.value!==g||x?.groupIndex!==d){u=1;const y=Ss(o)?o(p)-(o.step()-o.bandwidth())/2+xp[n]*o.step():o(p),S=o.step()*u*(xp[s]-xp[n]);a.push({value:g,formattedValue:`${g}`,offset:y,groupIndex:d,dataIndex:f,ignoreTick:!1,labelOffset:S}),l.has(f)||l.set(f,new Set);const j=l.get(f);for(const A of j.values())a[A].ignoreTick=!0;j.add(a.length-1)}else{u+=1;const y=o.step()*u*(xp[s]-xp[n]);x.labelOffset=y}}return a}const W9={tickSize:6},jde=(e,t,n)=>{const s=e[t]??{},o=n??W9.tickSize,a=o*t*2+o;return Ce({},W9,s,{tickSize:s.tickSize??a})};function Cde(e){const{xScale:t,defaultizedProps:n,positionSign:s,classes:o,Tick:a,TickLabel:l,axisTickLabelProps:u}=a_(e);if(!Ss(t))throw new Error("MUI X Charts: ChartsGroupedXAxis only supports the `band` and `point` scale types.");const{disableTicks:d,tickSize:f,valueFormatter:p,slotProps:g,tickInterval:x,tickPlacement:b,tickLabelPlacement:y}=n,S=n.groups,{instance:j}=qs(),A=l_({scale:t,tickInterval:x,tickPlacement:b,tickLabelPlacement:y,groups:S});return r.jsx(v.Fragment,{children:A.map((M,R)=>{const{offset:_,labelOffset:z}=M,F=z??0,N=j.isXInside(_),I=M.formattedValue,B=M.ignoreTick??!1,H=M.groupIndex??0,P=jde(S,H,f),k=s*P.tickSize,L=s*(P.tickSize+JS);return r.jsxs("g",{transform:`translate(${_}, 0)`,className:o.tickContainer,"data-group-index":H,children:[!d&&!B&&N&&r.jsx(a,Ce({y2:k,className:o.tick},g?.axisTick)),I!==void 0&&r.jsx(l,Ce({x:F,y:L},u,{style:Ce({},u.style,P.tickLabelStyle),text:I}))]},R)})})}const c_=Me("g",{name:"MuiChartsAxis",slot:"Root"})(({theme:e})=>({[`& .${p0.tickLabel}`]:Ce({},e.typography.caption,{fill:(e.vars||e).palette.text.primary}),[`& .${p0.label}`]:{fill:(e.vars||e).palette.text.primary},[`& .${p0.line}`]:{stroke:(e.vars||e).palette.text.primary,shapeRendering:"crispEdges",strokeWidth:1},[`& .${p0.tick}`]:{stroke:(e.vars||e).palette.text.primary,shapeRendering:"crispEdges"}})),wde=["axis"],Ade=["scale","tickNumber","reverse","ordinalTimeTicks"],Ede=Me(c_,{name:"MuiChartsXAxis",slot:"Root"})({});function Tde(e){let{axis:t}=e,n=_n(e,wde);const{scale:s,ordinalTimeTicks:o}=t,a=_n(t,Ade),l=Wi({props:Ce({},a,n),name:"MuiChartsXAxis"}),u=Ce({},r_,l),{position:d,labelStyle:f,offset:p,slots:g,slotProps:x,sx:b,disableLine:y,label:S,height:j}=u,A=On(),M=n_(u),{left:R,top:_,width:z,height:F}=qi(),N=d==="bottom"?1:-1,I=g?.axisLine??"line",B=g?.axisLabel??py,H=Hr({elementType:B,externalSlotProps:x?.axisLabel,additionalProps:{style:Ce({},A.typography.body1,{lineHeight:1,fontSize:14,textAnchor:"middle",dominantBaseline:d==="bottom"?"text-after-edge":"text-before-edge"},f)},ownerState:{}});if(d==="none")return null;const P=S?Cm(S,H.style).height:0,k=s.domain(),O=Ss(s)?k.length===0:k.some(Aw);let W=null;O||(W="groups"in t&&Array.isArray(t.groups)?r.jsx(Cde,Ce({},n)):r.jsx(Sde,Ce({},n,{axisLabelHeight:P,ordinalTimeTicks:o})));const D={x:R+z/2,y:N*j};return r.jsxs(Ede,{transform:`translate(0, ${d==="bottom"?_+F+p:_-p})`,className:M.root,"data-axis-id":u.id,sx:b,children:[!y&&r.jsx(I,Ce({x1:R,x2:R+z,className:M.line},x?.axisLine)),W,S&&r.jsx("g",{className:M.label,children:r.jsx(B,Ce({},D,H,{text:S}))})]})}function kde(e){const{xAxis:t,xAxisIds:n}=oo(),s=t[e.axisId??n[0]];return s?r.jsx(Tde,Ce({},e,{axis:s})):(`${e.axisId}`,null)}function Mde(e,t,n,s,o){const a=new Map,l=uy(o?.angle??0);let u=1,d=1;o?.textAnchor==="start"?(u=1/0,d=1):o?.textAnchor==="end"?(u=1,d=1/0):(u=2,d=2),l>180&&([u,d]=[d,u]),s&&([u,d]=[d,u]);for(const f of e)if(f.formattedValue){const p=Math.min((f.offset+f.labelOffset)*u,(t.top+t.height+t.bottom-f.offset-f.labelOffset)*d),g=x=>YF(x,{width:n,height:p,angle:l,measureText:b=>Cm(b,o)});a.set(f,KF(f.formattedValue.toString(),g))}return a}const u_=e=>{const{classes:t,position:n,id:s}=e,o={root:["root","directionY",n,`id-${s}`],line:["line"],tickContainer:["tickContainer"],tick:["tick"],tickLabel:["tickLabel"],label:["label"]};return pt(o,t_,t)},ej=2,Rde=2,d_={disableLine:!1,disableTicks:!1,tickSize:6},zde=["scale","tickNumber","reverse"];function f_(e){const{yAxis:t,yAxisIds:n}=io(),s=t[e.axisId??n[0]],{scale:o,tickNumber:a}=s,l=_n(s,zde),u=Wi({props:Ce({},l,e),name:"MuiChartsYAxis"}),d=Ce({},d_,u),{position:f,tickLabelStyle:p,slots:g,slotProps:x}=d,b=On(),y=Ao(),S=u_(d),j=f==="right"?1:-1,A=typeof p?.fontSize=="number"?p.fontSize:12,M=g?.axisTick??"line",R=g?.axisTickLabel??py,_=s_((f==="right"?-90:90)-(p?.angle??0)),z=o_((f==="right"?-90:90)-(p?.angle??0)),F=Hr({elementType:R,externalSlotProps:x?.axisTickLabel,additionalProps:{style:Ce({},b.typography.caption,{fontSize:A,textAnchor:y?i_(_):_,dominantBaseline:z},p)},className:S.tickLabel,ownerState:{}});return{yScale:o,defaultizedProps:d,tickNumber:a,positionSign:j,classes:S,Tick:M,TickLabel:R,axisTickLabelProps:F}}function Ide(e){const{axisLabelHeight:t,ordinalTimeTicks:n}=e,{yScale:s,defaultizedProps:o,tickNumber:a,positionSign:l,classes:u,Tick:d,TickLabel:f,axisTickLabelProps:p}=f_(e),g=Ao(),{disableTicks:x,tickSize:b,valueFormatter:y,slotProps:S,tickPlacement:j,tickLabelPlacement:A,tickInterval:M,tickLabelInterval:R,tickSpacing:_,width:z}=o,F=qi(),{instance:N}=qs(),I=fy(),B=x?4:b,H=hy({scale:s,tickNumber:a,valueFormatter:y,tickPlacement:j,tickLabelPlacement:A,tickInterval:M,tickSpacing:_,direction:"y",ordinalTimeTicks:n}),P=Math.max(0,z-(t>0?t+Rde:0)-B-ej),k=I?Mde(H,F,P,g,p.style):new Map(Array.from(H).map(L=>[L,L.formattedValue]));return r.jsx(v.Fragment,{children:H.map((L,O)=>{const{offset:W,labelOffset:D,value:q}=L,K=l*(B+ej),Y=D,ie=typeof R=="function"&&!R?.(q,O),V=N.isYInside(W),re=k.get(L);return V?r.jsxs("g",{transform:`translate(0, ${W})`,className:u.tickContainer,children:[!x&&r.jsx(d,Ce({x2:l*B,className:u.tick},S?.axisTick)),re!==void 0&&!ie&&r.jsx(f,Ce({x:K,y:Y,text:re},p))]},O):null})})}const U9={tickSize:6},Fde=(e,t,n)=>{const s=e[t]??{},o=n??U9.tickSize,a=o*t*2+o;return Ce({},U9,s,{tickSize:s.tickSize??a})};function _de(e){const{yScale:t,defaultizedProps:n,positionSign:s,classes:o,Tick:a,TickLabel:l,axisTickLabelProps:u}=f_(e);if(!Ss(t))throw new Error("MUI X Charts: ChartsGroupedYAxis only supports the `band` and `point` scale types.");const{disableTicks:d,tickSize:f,valueFormatter:p,slotProps:g,tickInterval:x,tickPlacement:b,tickLabelPlacement:y}=n,S=n.groups,{instance:j}=qs(),A=l_({scale:t,tickInterval:x,tickPlacement:b,tickLabelPlacement:y,groups:S});return r.jsx(v.Fragment,{children:A.map((M,R)=>{const{offset:_,labelOffset:z}=M,F=z??0,N=j.isYInside(_),I=M.formattedValue,B=M.ignoreTick??!1,H=M.groupIndex??0,P=Fde(S,H,f),k=s*P.tickSize,L=s*(P.tickSize+ej);return r.jsxs("g",{transform:`translate(0, ${_})`,className:o.tickContainer,"data-group-index":H,children:[!d&&!B&&N&&r.jsx(a,Ce({x2:k,className:o.tick},g?.axisTick)),I!==void 0&&r.jsx(l,Ce({x:L,y:F},u,{style:Ce({},u.style,P.tickLabelStyle),text:I}))]},R)})})}const Lde=["axis"],Pde=["scale","tickNumber","reverse","ordinalTimeTicks"],Dde=Me(c_,{name:"MuiChartsYAxis",slot:"Root"})({});function Ode(e){let{axis:t}=e,n=_n(e,Lde);const{scale:s,ordinalTimeTicks:o}=t,a=_n(t,Pde),l=fy(),u=Wi({props:Ce({},a,n),name:"MuiChartsYAxis"}),d=Ce({},d_,u),{position:f,disableLine:p,label:g,labelStyle:x,offset:b,width:y,sx:S,slots:j,slotProps:A}=d,M=On(),R=u_(d),{left:_,top:z,width:F,height:N}=qi(),I=f==="right"?1:-1,B=j?.axisLine??"line",H=j?.axisLabel??py,P=Hr({elementType:B,externalSlotProps:A?.axisLine,additionalProps:{strokeLinecap:"square"},ownerState:{}}),k=Hr({elementType:H,externalSlotProps:A?.axisLabel,additionalProps:{style:Ce({},M.typography.body1,{lineHeight:1,fontSize:14,angle:I*90,textAnchor:"middle",dominantBaseline:"text-before-edge"},x)},ownerState:{}});if(f==="none")return null;const L={x:I*y,y:z+N/2},O=g==null?0:Cm(g,k.style).height,W=s.domain(),q=Ss(s)?W.length===0:W.some(Aw);let K=null;return q||(K="groups"in t&&Array.isArray(t.groups)?r.jsx(_de,Ce({},n)):r.jsx(Ide,Ce({},n,{axisLabelHeight:O,ordinalTimeTicks:o}))),r.jsxs(Dde,{transform:`translate(${f==="right"?_+F+b:_-b}, 0)`,className:R.root,"data-axis-id":d.id,sx:S,children:[!p&&r.jsx(B,Ce({y1:z,y2:z+N,className:R.line},P)),K,g&&l&&r.jsx("g",{className:R.label,children:r.jsx(H,Ce({},L,k,{text:g}))})]})}function Bde(e){const{yAxis:t,yAxisIds:n}=io(),s=t[e.axisId??n[0]];return s?r.jsx(Ode,Ce({},e,{axis:s})):(`${e.axisId}`,null)}function Nde(e){const{slots:t,slotProps:n}=e,{xAxisIds:s,xAxis:o}=oo(),{yAxisIds:a,yAxis:l}=io();return r.jsxs(v.Fragment,{children:[s.map(u=>!o[u].position||o[u].position==="none"?null:r.jsx(kde,{slots:t,slotProps:n,axisId:u},u)),a.map(u=>!l[u].position||l[u].position==="none"?null:r.jsx(Bde,{slots:t,slotProps:n,axisId:u},u))]})}function $de(e){return gt("MuiChartsTooltip",e)}const lf=mt("MuiChartsTooltip",["root","paper","table","row","cell","mark","markContainer","labelCell","valueCell","axisValueCell"]),gy=e=>pt({root:["root"],paper:["paper"],table:["table"],row:["row"],cell:["cell"],mark:["mark"],markContainer:["markContainer"],labelCell:["labelCell"],valueCell:["valueCell"],axisValueCell:["axisValueCell"]},$de,e);function Hde(){const e=jr(),t=e.use(hw),n=e.use(no),s=dy(),{xAxis:o,xAxisIds:a}=oo(),{yAxis:l,yAxisIds:u}=io(),{zAxis:d,zAxisIds:f}=Sw(),{rotationAxis:p,rotationAxisIds:g}=LF();if(!t)return null;const x=s[t.type]?.series[t.seriesId];if(!x)return null;const b=C1(x)?x.xAxisId??a[0]:void 0,y=C1(x)?x.yAxisId??u[0]:void 0,S="zAxisId"in x?x.zAxisId??f[0]:f[0],j=g[0],A=n[x.type].colorProcessor?.(x,b!==void 0?o[b]:void 0,y!==void 0?l[y]:void 0,S!==void 0?d[S]:void 0)??(()=>""),M={};return b!==void 0&&(M.x=o[b]),y!==void 0&&(M.y=l[y]),j!==void 0&&(M.rotation=p[j]),n[x.type].tooltipGetter({series:x,axesConfig:M,getColor:A,identifier:t})}const tj=Me("div",{name:"MuiChartsTooltip",slot:"Container",overridesResolver:(e,t)=>t.paper})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,borderRadius:(e.vars||e).shape?.borderRadius,border:`solid ${(e.vars||e).palette.divider} 1px`})),nj=Me("table",{name:"MuiChartsTooltip",slot:"Table"})(({theme:e})=>({borderSpacing:0,[`& .${lf.markContainer}`]:{display:"inline-block",width:`calc(20px + ${e.spacing(1.5)})`,verticalAlign:"middle"},"& caption":{borderBottom:`solid ${(e.vars||e).palette.divider} 1px`,padding:e.spacing(.5,1.5),textAlign:"start",whiteSpace:"nowrap","& span":{marginRight:e.spacing(1.5)}}})),rj=Me("tr",{name:"MuiChartsTooltip",slot:"Row"})(({theme:e})=>({"tr:first-of-type& td":{paddingTop:e.spacing(.5)},"tr:last-of-type& td":{paddingBottom:e.spacing(.5)}})),Sf=Me(C,{name:"MuiChartsTooltip",slot:"Cell"})(({theme:e})=>({verticalAlign:"middle",color:(e.vars||e).palette.text.secondary,textAlign:"start",[`&.${lf.cell}`]:{paddingLeft:e.spacing(1),paddingRight:e.spacing(1)},[`&.${lf.labelCell}`]:{whiteSpace:"nowrap",fontWeight:e.typography.fontWeightRegular},[`&.${lf.valueCell}, &.${lf.axisValueCell}`]:{color:(e.vars||e).palette.text.primary,fontWeight:e.typography.fontWeightMedium},[`&.${lf.valueCell}`]:{paddingLeft:e.spacing(1.5),paddingRight:e.spacing(1.5)},"td:first-of-type&, th:first-of-type&":{paddingLeft:e.spacing(1.5)},"td:last-of-type&, th:last-of-type&":{paddingRight:e.spacing(1.5)}}));function Wde(e){return gt("MuiChartsLabelMark",e)}const Jd=mt("MuiChartsLabelMark",["root","line","square","circle","mask","fill"]),Ude=e=>{const{type:t}=e;return pt({root:typeof t=="function"?["root"]:["root",t],mask:["mask"],fill:["fill"]},Wde,e.classes)},h_=(e,t,n)=>v.forwardRef(function(o,a){const l=Wi({props:o,name:e}),u=typeof t.defaultProps=="function"?t.defaultProps(l):t.defaultProps??{},d=Iu(u,l),f=On(),p=t.classesResolver?.(d,f),g=v.forwardRef(n);return r.jsx(g,Ce({},d,{classes:p,ref:a}))}),qde=["type","color","className","classes"],Vde=Me("div",{name:"MuiChartsLabelMark",slot:"Root"})(()=>({display:"flex",width:14,height:14,[`&.${Jd.line}`]:{width:16,height:"unset",alignItems:"center",[`.${Jd.mask}`]:{height:4,width:"100%",borderRadius:1,overflow:"hidden"}},[`&.${Jd.square}`]:{height:13,width:13,borderRadius:2,overflow:"hidden"},[`&.${Jd.circle}`]:{height:15,width:15},svg:{display:"block"},[`& .${Jd.mask} > *`]:{height:"100%",width:"100%"},[`& .${Jd.mask}`]:{height:"100%",width:"100%"}})),I1=h_("MuiChartsLabelMark",{defaultProps:{type:"square"},classesResolver:Ude},function(t,n){const{type:s,color:o,className:a,classes:l}=t,u=_n(t,qde),d=s;return r.jsx(Vde,Ce({className:Ye(l?.root,a),ownerState:t,"aria-hidden":"true",ref:n},u,{children:r.jsx("div",{className:l?.mask,children:typeof d=="function"?r.jsx(d,{className:l?.fill,color:o}):r.jsx("svg",{viewBox:"0 0 24 24",preserveAspectRatio:s==="line"?"none":void 0,children:s==="circle"?r.jsx("circle",{className:l?.fill,r:"12",cx:"12",cy:"12",fill:o}):r.jsx("rect",{className:l?.fill,width:"24",height:"24",fill:o})})})}))});function Gde(e){const{classes:t,sx:n}=e,s=Hde(),o=gy(t);if(!s)return null;if("values"in s){const{label:f,color:p,markType:g}=s;return r.jsx(tj,{sx:n,className:o.paper,children:r.jsxs(nj,{className:o.table,children:[r.jsxs(C,{component:"caption",children:[r.jsx("div",{className:o.markContainer,children:r.jsx(I1,{type:g,color:p,className:o.mark})}),f]}),r.jsx("tbody",{children:s.values.map(({formattedValue:x,label:b})=>r.jsxs(rj,{className:o.row,children:[r.jsx(Sf,{className:Ye(o.labelCell,o.cell),component:"th",children:b}),r.jsx(Sf,{className:Ye(o.valueCell,o.cell),component:"td",children:x})]},b))})]})})}const{color:a,label:l,formattedValue:u,markType:d}=s;return r.jsx(tj,{sx:n,className:o.paper,children:r.jsx(nj,{className:o.table,children:r.jsx("tbody",{children:r.jsxs(rj,{className:o.row,children:[r.jsxs(Sf,{className:Ye(o.labelCell,o.cell),component:"th",children:[r.jsx("div",{className:o.markContainer,children:r.jsx(I1,{type:d,color:a,className:o.mark})}),l]}),r.jsx(Sf,{className:Ye(o.valueCell,o.cell),component:"td",children:u})]})})})})}function Yde(e){const n=jr().use(no);return v.useMemo(()=>{const o={};return Object.keys(n).forEach(a=>{o[a]=n[a].colorProcessor}),o},[n])}function Kde(e){return e instanceof Date?e.toUTCString():e.toLocaleString()}const Xde="@media (pointer: fine)",Zde=()=>Yu(Xde,{defaultMatches:!0}),p_=(e,t)=>t,g_=(e,t)=>t;function m_(e,t,n){return Array.isArray(n)?n.map(s=>O9(t.axis[s],e)):O9(t.axis[n],e)}const x_=Ct(pm,gm,zae,(e,t,n)=>e===null||t===null?null:Gce(n)(e,t)),Qde=Ct(x_,Uc,p_,(e,t,n=t.axisIds[0])=>e===null?null:m_(e,t,n)),b_=Ct(x_,Uc,g_,(e,t,n=t.axisIds)=>e===null?null:m_(e,t,n));Ct(Uc,Qde,p_,(e,t,n=e.axisIds[0])=>{if(t===null||t===-1||e.axisIds.length===0)return null;const s=e.axis[n]?.data;return s?s[t]:null});Ct(Uc,b_,g_,(e,t,n=e.axisIds)=>t===null?null:n.map((s,o)=>{const a=t[o];return a===-1?null:e.axis[s].data?.[a]}));const y_=Ib({memoizeOptions:{resultEqualityCheck:If}})(b_,Uc,(e,t)=>e===null?[]:t.axisIds.map((n,s)=>({axisId:n,dataIndex:e[s]})).filter(({axisId:n,dataIndex:s})=>t.axis[n].triggerTooltip&&s>=0)),Jde=Ct(y_,e=>e.length>0);function E5(e,t,n){const s=e.data?.[t]??null,a=(e.valueFormatter??(l=>e.scaleType==="utc"?Kde(l):l.toLocaleString()))(s,{location:"tooltip",scale:e.scale});return{axisDirection:n,axisId:e.id,mainAxis:e,dataIndex:t,axisValue:s,axisFormattedValue:a,seriesItems:[]}}function efe(e={}){const{multipleAxes:t,directions:n}=e,s=Kce(),o=Xce(),a=Zce(),l=jr(),u=l.use(_I),d=l.use(LI),f=l.use(y_),p=dy(),{xAxis:g}=oo(),{yAxis:x}=io(),{zAxis:b,zAxisIds:y}=Sw(),{rotationAxis:S}=LF(),j=Yde();if(u.length===0&&d.length===0&&f.length===0)return null;const A=[];return(n===void 0||n.includes("x"))&&u.forEach(({axisId:M,dataIndex:R})=>{!t&&A.length>1||A.push(E5(g[M],R,"x"))}),(n===void 0||n.includes("y"))&&d.forEach(({axisId:M,dataIndex:R})=>{!t&&A.length>1||A.push(E5(x[M],R,"y"))}),(n===void 0||n.includes("rotation"))&&f.forEach(({axisId:M,dataIndex:R})=>{!t&&A.length>1||A.push(E5(S[M],R,"rotation"))}),Object.keys(p).filter(Kb).forEach(M=>{const R=p[M];return R?R.seriesOrder.forEach(_=>{const z=R.series[_],F=z.xAxisId??s.id,N=z.yAxisId??o.id,I=A.findIndex(({axisDirection:B,axisId:H})=>B==="x"&&H===F||B==="y"&&H===N);if(I>=0){const B="zAxisId"in z?z.zAxisId:y[0],{dataIndex:H}=A[I],P=j[M]?.(z,g[F],x[N],B?b[B]:void 0)(H)??"",k=z.data[H]??null,L=z.valueFormatter(k,{dataIndex:H}),O=ha(z.label,"tooltip")??null;A[I].seriesItems.push({seriesId:_,color:P,value:k,formattedValue:L,formattedLabel:O,markType:z.labelMarkType})}}):[]}),Object.keys(p).filter(fw).forEach(M=>{const R=p[M];return R?R.seriesOrder.forEach(_=>{const z=R.series[_],F=z.rotationAxisId??a?.id,N=A.findIndex(({axisDirection:I,axisId:B})=>I==="rotation"&&B===F);if(N>=0){const{dataIndex:I}=A[N],B=j[M]?.(z)(I)??"",H=z.data[I]??null,P=z.valueFormatter(H,{dataIndex:I}),k=ha(z.label,"tooltip")??null;A[N].seriesItems.push({seriesId:_,color:B,value:H,formattedValue:P,formattedLabel:k,markType:z.labelMarkType})}}):[]}),t?A:A.length===0?A[0]:null}function tfe(e){return efe(Ce({},e,{multipleAxes:!0}))}function nfe(e){const t=gy(e.classes),n=tfe();return n===null?null:r.jsx(tj,{sx:e.sx,className:t.paper,children:n.map(({axisId:s,mainAxis:o,axisValue:a,axisFormattedValue:l,seriesItems:u})=>r.jsxs(nj,{className:t.table,children:[a!=null&&!o.hideTooltip&&r.jsx(C,{component:"caption",children:l}),r.jsx("tbody",{children:u.map(({seriesId:d,color:f,formattedValue:p,formattedLabel:g,markType:x})=>p==null?null:r.jsxs(rj,{className:t.row,children:[r.jsxs(Sf,{className:Ye(t.labelCell,t.cell),component:"th",children:[r.jsx("div",{className:t.markContainer,children:r.jsx(I1,{type:x,color:f,className:t.mark})}),g||null]}),r.jsx(Sf,{className:Ye(t.valueCell,t.cell),component:"td",children:p})]},d))})]},s))})}function rfe(e){let t,n;const s=()=>{n=null,e(...t)};function o(...a){t=a,n||(n=requestAnimationFrame(s))}return o.clear=()=>{n&&(cancelAnimationFrame(n),n=null)},o}function sfe(){const e=jr(),t=e.use(XI),n=e.use(Ll);return t!==void 0?"polar":n!==void 0?"cartesian":"none"}const ofe=["trigger","position","anchor","classes","children"],q9=()=>!1,ife=()=>null;function afe(e,t,n){return n?q9:e==="item"?_ae:t==="polar"?Jde:t==="cartesian"?lae:q9}const lfe=Me(Kg,{name:"MuiChartsTooltip",slot:"Root"})(({theme:e})=>({pointerEvents:"none",zIndex:e.zIndex.modal}));function cfe(e){const t=Wi({props:e,name:"MuiChartsTooltipContainer"}),{trigger:n="axis",position:s,anchor:o="pointer",classes:a,children:l}=t,u=_n(t,ofe),d=jr(),f=PF(),p=v.useRef(null),g=gy(a),x=d.use(sae),b=Zde(),y=v.useRef(null),S=fb(()=>({x:0,y:0})),j=sfe(),A=d.use(yae),M=d.use(afe(n,j,A)),_=d.use(td)==="keyboard"||x===null?"node":o,z=d.use(n==="item"&&_==="node"?Pae:ife,s),F=z!==null;v.useEffect(()=>{const P=f.current;if(P===null)return()=>{};if(F)return;const k=rfe((O,W)=>{S.current={x:O,y:W},y.current?.update()}),L=O=>{k(O.clientX,O.clientY)};return P.addEventListener("pointermove",L),P.addEventListener("pointerenter",L),()=>{P.removeEventListener("pointermove",L),P.removeEventListener("pointerenter",L),k.clear()}},[f,S,F]);const N=v.useMemo(()=>({getBoundingClientRect:()=>({x:S.current.x,y:S.current.y,top:S.current.y,left:S.current.x,right:S.current.x,bottom:S.current.y,width:0,height:0,toJSON:()=>""})}),[S]),I=x==="mouse"||b,B=x==="touch"||!b,H=v.useMemo(()=>[{name:"offset",options:{offset:()=>B&&!F?[0,64]:[0,8]}},...I?[]:[{name:"flip",options:{fallbackPlacements:["top-end","top-start","bottom-end","bottom"]}}],{name:"preventOverflow",options:{altAxis:!0}}],[I,F,B]);return n==="none"?null:r.jsxs(v.Fragment,{children:[f.current&&q1.createPortal(r.jsx("rect",Ce({ref:p},z,{display:"hidden",pointerEvents:"none",opacity:0,width:1,height:1})),f.current),r.jsx(fQ,{children:M&&r.jsx(lfe,Ce({},u,{className:g?.root,open:M,placement:u.placement??s??(!F&&I?"right-start":"top"),popperRef:y,anchorEl:z?p.current:N,modifiers:H,children:l}))})]})}function ufe(e){const{classes:t,trigger:n="axis"}=e,s=gy(t);return r.jsx(cfe,Ce({},e,{classes:t,children:n==="axis"?r.jsx(nfe,{classes:s}):r.jsx(Gde,{classes:s})}))}const dfe=e=>({type:"series",color:e.color,label:e.label,seriesId:e.seriesId,itemId:e.itemId,dataIndex:e.dataIndex});function ffe(e){return gt("MuiChartsLegend",e)}const hfe=e=>{const{classes:t,direction:n}=e;return pt({root:["root",n],item:["item"],mark:["mark"],label:["label"],series:["series"],hidden:["hidden"]},ffe,t)},T5=mt("MuiChartsLegend",["root","item","series","mark","label","vertical","horizontal","hidden"]),pfe=["slots","slotProps"],gfe=["ownerState"],mfe=(e,t,n,s)=>{function o(a,l){const u=Wi({props:a,name:e}),d=typeof n.defaultProps=="function"?n.defaultProps(u):n.defaultProps??{},f=Iu(d,u),p=f,{slots:g,slotProps:x}=p,b=_n(p,pfe),y=On(),S=n.classesResolver?.(f,y),j=g?.[t]??s,A=n.propagateSlots&&!g?.[t],M=Hr({elementType:j,externalSlotProps:x?.[t],additionalProps:Ce({},b,{classes:S},A&&{slots:g,slotProps:x}),ownerState:{}}),R=_n(M,gfe),_=Ce({},R);for(const z of n.omitProps??[])delete _[z];return r.jsx(j,Ce({},_,{ref:l}))}return v.forwardRef(o)};function xfe(e){return gt("MuiChartsLabel",e)}mt("MuiChartsLabel",["root"]);const bfe=e=>pt({root:["root"]},xfe,e.classes),yfe=["children","className","classes"],vfe=h_("MuiChartsLabel",{classesResolver:bfe},function(t,n){const{children:s,className:o,classes:a}=t,l=_n(t,yfe);return r.jsx("span",Ce({className:Ye(a?.root,o),ref:n},l,{children:s}))}),Sfe=["direction","onItemClick","className","classes","toggleVisibilityOnClick"],jfe=Me("ul",{name:"MuiChartsLegend",slot:"Root"})(({ownerState:e,theme:t})=>Ce({},t.typography.caption,{color:(t.vars||t).palette.text.primary,lineHeight:"100%",display:"flex",flexDirection:e.direction==="vertical"?"column":"row",alignItems:e.direction==="vertical"?void 0:"center",flexShrink:0,gap:t.spacing(2),listStyleType:"none",paddingInlineStart:0,marginBlock:t.spacing(1),marginInline:t.spacing(1),flexWrap:"wrap",li:{display:e.direction==="horizontal"?"inline-flex":void 0},[`button.${T5.series}`]:{background:"none",border:"none",padding:0,fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",letterSpacing:"inherit",color:"inherit"},[`& .${T5.series}`]:{display:e.direction==="vertical"?"flex":"inline-flex",alignItems:"center",gap:t.spacing(1),cursor:e.onItemClick||e.toggleVisibilityOnClick?"pointer":"default",[`&.${T5.hidden}`]:{opacity:.5}},gridArea:"legend"})),Cfe=mfe("MuiChartsLegend","legend",{defaultProps:{direction:"horizontal"},omitProps:["position"],classesResolver:hfe},v.forwardRef(function(t,n){const s=nue(),{instance:o}=qs(),a=jr(),l=a.use(no),u=a.use(Pz),{onItemClick:d,className:f,classes:p,toggleVisibilityOnClick:g}=t,x=_n(t,Sfe),b=!!(d||g),y=b?"button":"div",S=pn((j,A)=>M=>{d&&j&&d(M,dfe(j),A),g&&o.toggleItemVisibility({type:j.type,seriesId:j.seriesId,dataIndex:j.dataIndex})});return s.items.length===0?null:r.jsx(jfe,Ce({className:Ye(p?.root,f),ref:n},x,{ownerState:t,children:s.items.map((j,A)=>{const M=u(l,{type:j.type,seriesId:j.seriesId,dataIndex:j.dataIndex});return r.jsx("li",{className:p?.item,"data-series":j.seriesId,"data-index":j.dataIndex,children:r.jsxs(y,{className:Ye(p?.series,!M&&p?.hidden),role:b?"button":void 0,type:b?"button":void 0,onClick:b?S(j,A):void 0,children:[r.jsx(I1,{className:p?.mark,color:j.color,type:j.markType}),r.jsx(vfe,{className:p?.label,children:j.label})]})},`${j.seriesId}-${j.dataIndex}`)})}))}));function wfe(e){return gt("MuiChartsAxisHighlight",e)}mt("MuiChartsAxisHighlight",["root"]);const F1=Me("path",{name:"MuiChartsAxisHighlight",slot:"Root"})(({theme:e})=>({pointerEvents:"none",variants:[{props:{axisHighlight:"band"},style:Ce({fill:"white",fillOpacity:.1},e.applyStyles("light",{fill:"gray"}))},{props:{axisHighlight:"line"},style:Ce({strokeDasharray:"5 2",stroke:"#ffffff"},e.applyStyles("light",{stroke:"#000000"}))}]}));function Afe(e){const{type:t,classes:n}=e,{left:s,width:o}=qi(),a=jr(),l=a.use(Sae),u=a.use(so);return l.length===0?null:l.map(({axisId:d,value:f})=>{const g=u.axis[d].scale,x=lh(g),b=t==="band"&&f!==null&&Ss(g);return r.jsxs(v.Fragment,{children:[b&&g(f)!==void 0&&r.jsx(F1,{d:`M ${s} ${g(f)-(g.step()-g.bandwidth())/2} l 0 ${g.step()} l ${o} 0 l 0 ${-g.step()} Z`,className:n.root,ownerState:{axisHighlight:"band"}}),t==="line"&&f!==null&&r.jsx(F1,{d:`M ${s} ${x(f)} L ${s+o} ${x(f)}`,className:n.root,ownerState:{axisHighlight:"line"}})]},`${d}-${f}`)})}function Efe(e){const{type:t,classes:n}=e,{top:s,height:o}=qi(),a=jr(),l=a.use(vae),u=a.use(ro);return l.length===0?null:l.map(({axisId:d,value:f})=>{const g=u.axis[d].scale,x=lh(g),b=t==="band"&&f!==null&&Ss(g);return r.jsxs(v.Fragment,{children:[b&&g(f)!==void 0&&r.jsx(F1,{d:`M ${g(f)-(g.step()-g.bandwidth())/2} ${s} l ${g.step()} 0 l 0 ${o} l ${-g.step()} 0 Z`,className:n.root,ownerState:{axisHighlight:"band"}}),t==="line"&&f!==null&&r.jsx(F1,{d:`M ${x(f)} ${s} L ${x(f)} ${s+o}`,className:n.root,ownerState:{axisHighlight:"line"}})]},`${d}-${f}`)})}const Tfe=()=>pt({root:["root"]},wfe);function kfe(e){const{x:t,y:n}=e,s=Tfe();return r.jsxs(v.Fragment,{children:[t&&t!=="none"&&r.jsx(Efe,{type:t,classes:s}),n&&n!=="none"&&r.jsx(Afe,{type:n,classes:s})]})}function Mfe(e){const{id:t,offset:n}=e,{left:s,top:o,width:a,height:l}=qi(),u=Ce({top:0,right:0,bottom:0,left:0},n);return r.jsx("clipPath",{id:t,children:r.jsx("rect",{x:s-u.left,y:o-u.top,width:a+u.left+u.right,height:l+u.top+u.bottom})})}const Rfe=["x","y","id","classes","color","shape"];function zfe(e){return gt("MuiHighlightElement",e)}mt("MuiHighlightElement",["root"]);const Ife=e=>{const{classes:t,id:n}=e,s={root:["root",`series-${n}`]};return pt(s,zfe,t)};function Ffe(e){const{x:t,y:n,color:s,shape:o}=e,a=_n(e,Rfe),l=Vc(),u=Ife(e),d=o==="circle"?"circle":"path",f=o==="circle"?{cx:0,cy:0,r:a.r===void 0?5:a.r}:{d:fF(dF[qF(o)])()},p=Mz>18?{transformOrigin:`${t} ${n}`}:{"transform-origin":`${t} ${n}`};return r.jsx(d,Ce({pointerEvents:"none",className:`${l.highlight} ${u.root}`,transform:`translate(${t} ${n})`,fill:s},p,f,a))}const _fe=["slots","slotProps"];function Lfe(e){const{slots:t,slotProps:n}=e,s=_n(e,_fe),o=jm(),{xAxis:a,xAxisIds:l}=oo(),{yAxis:u,yAxisIds:d}=io(),{instance:f}=qs(),g=jr().use(qI);if(g.length===0||o===void 0)return null;const{series:x,stackingGroups:b}=o,y=l[0],S=d[0],j=t?.lineHighlight??Ffe;return r.jsx("g",Ce({},s,{children:g.flatMap(({dataIndex:A,axisId:M})=>b.flatMap(({ids:R})=>R.flatMap(_=>{const{xAxisId:z=y,yAxisId:F=S,visibleStackedData:N,data:I,disableHighlight:B,shape:H="circle"}=x[_];if(B||I[A]==null||M!==z)return null;const P=lh(a[z].scale),k=u[F].scale,L=a[z].data;if(L===void 0)throw new Error(`MUI X Charts: ${z===RC?"The first `xAxis`":`The x-axis with id "${z}"`} should have data property to be able to display a line plot.`);const O=P(L[A]),W=k(N[A][1]);if(!f.isPointInside(O,W))return null;const D=bw(x[_],a[z],u[F]);return r.jsx(j,Ce({id:_,color:D(A),x:O,y:W,shape:H},n?.lineHighlight),`${_}`)})))}))}function Pfe(e){return gt("MuiChartsGrid",e)}const V9=mt("MuiChartsGrid",["root","line","horizontalLine","verticalLine"]),Dfe=Me("g",{name:"MuiChartsGrid",slot:"Root",overridesResolver:(e,t)=>[{[`&.${V9.verticalLine}`]:t.verticalLine},{[`&.${V9.horizontalLine}`]:t.horizontalLine},t.root]})({}),v_=Me("line",{name:"MuiChartsGrid",slot:"Line"})(({theme:e})=>({stroke:(e.vars||e).palette.divider,shapeRendering:"crispEdges",strokeWidth:1}));function Ofe(e){const{instance:t}=qs(),{axis:n,start:s,end:o,classes:a}=e,{scale:l,tickNumber:u,tickInterval:d,tickSpacing:f}=n,p=hy({scale:l,tickNumber:u,tickInterval:d,tickSpacing:f,direction:"x",ordinalTimeTicks:"ordinalTimeTicks"in n?n.ordinalTimeTicks:void 0});return r.jsx(v.Fragment,{children:p.map(({value:g,offset:x})=>t.isXInside(x)?r.jsx(v_,{y1:s,y2:o,x1:x,x2:x,className:a.verticalLine},`vertical-${g?.getTime?.()??g}`):null)})}function Bfe(e){const{instance:t}=qs(),{axis:n,start:s,end:o,classes:a}=e,{scale:l,tickNumber:u,tickInterval:d,tickSpacing:f}=n,p=hy({scale:l,tickNumber:u,tickInterval:d,tickSpacing:f,direction:"y",ordinalTimeTicks:"ordinalTimeTicks"in n?n.ordinalTimeTicks:void 0});return r.jsx(v.Fragment,{children:p.map(({value:g,offset:x})=>t.isYInside(x)?r.jsx(v_,{y1:x,y2:x,x1:s,x2:o,className:a.horizontalLine},`horizontal-${g?.getTime?.()??g}`):null)})}const Nfe=["vertical","horizontal"],$fe=({classes:e})=>pt({root:["root"],verticalLine:["line","verticalLine"],horizontalLine:["line","horizontalLine"]},Pfe,e);function Hfe(e){const t=Wi({props:e,name:"MuiChartsGrid"}),n=qi(),{vertical:s,horizontal:o}=t,a=_n(t,Nfe),{xAxis:l,xAxisIds:u}=oo(),{yAxis:d,yAxisIds:f}=io(),p=$fe(t),g=d[f[0]],x=l[u[0]];return r.jsxs(Dfe,Ce({},a,{className:p.root,children:[s&&r.jsx(Ofe,{axis:x,start:n.top,end:n.height+n.top,classes:p}),o&&r.jsx(Bfe,{axis:g,start:n.left,end:n.width+n.left,classes:p})]}))}const Wfe=["message"],Ufe=Me("text",{slot:"internal",shouldForwardProp:void 0})(({theme:e})=>Ce({},e.typography.body2,{stroke:"none",fill:(e.vars||e).palette.text.primary,shapeRendering:"crispEdges",textAnchor:"middle",dominantBaseline:"middle"}));function qfe(e){const{message:t}=e,n=_n(e,Wfe),{top:s,left:o,height:a,width:l}=qi(),{localeText:u}=OF();return r.jsx(Ufe,Ce({x:o+l/2,y:s+a/2},n,{children:t??u.loading}))}const Vfe=["message"],Gfe=Me("text",{slot:"internal",shouldForwardProp:void 0})(({theme:e})=>Ce({},e.typography.body2,{stroke:"none",fill:(e.vars||e).palette.text.primary,shapeRendering:"crispEdges",textAnchor:"middle",dominantBaseline:"middle"}));function Yfe(e){const{message:t}=e,n=_n(e,Vfe),{top:s,left:o,height:a,width:l}=qi(),{localeText:u}=OF();return r.jsx(Gfe,Ce({x:o+l/2,y:s+a/2},n,{children:t??u.noData}))}function Kfe(){const e=dy();return Object.values(e).every(t=>{if(!t)return!0;const{series:n,seriesOrder:s}=t;return s.every(o=>{const a=n[o];return a.type==="sankey"?a.data.links.length===0:a.data.length===0})})}function Xfe(e){const t=Kfe();if(e.loading){const n=e.slots?.loadingOverlay??qfe;return r.jsx(n,Ce({},e.slotProps?.loadingOverlay))}if(t){const n=e.slots?.noDataOverlay??Yfe;return r.jsx(n,Ce({},e.slotProps?.noDataOverlay))}return null}const Zfe=[ym,xm,bm,hm,oh,vm,Db,Jb],Qfe=["xAxis","yAxis","series","width","height","margin","colors","dataset","sx","onAreaClick","onLineClick","onMarkClick","axisHighlight","disableLineItemHighlight","hideLegend","grid","children","slots","slotProps","skipAnimation","loading","highlightedItem","onHighlightChange","className","showToolbar","brushConfig"],Jfe=e=>{const{xAxis:t,yAxis:n,series:s,width:o,height:a,margin:l,colors:u,dataset:d,sx:f,onAreaClick:p,onLineClick:g,onMarkClick:x,axisHighlight:b,disableLineItemHighlight:y,grid:S,children:j,slots:A,slotProps:M,skipAnimation:R,loading:_,highlightedItem:z,onHighlightChange:F,className:N,brushConfig:I}=e,B=_n(e,Qfe),P=`${Hi()}-clip-path`,k=v.useMemo(()=>s.map(se=>Ce({disableHighlight:!!y,type:"line"},se)),[y,s]),L=Ce({},B,{series:k,width:o,height:a,margin:l,colors:u,dataset:d,xAxis:t??[{id:RC,scaleType:"point",data:Array.from({length:Math.max(...s.map(se=>(se.data??d??[]).length))},(se,J)=>J)}],yAxis:n,highlightedItem:z,onHighlightChange:F,disableAxisListener:M?.tooltip?.trigger!=="axis"&&b?.x==="none"&&b?.y==="none",className:N,skipAnimation:R,brushConfig:I,plugins:Zfe}),O={vertical:S?.vertical,horizontal:S?.horizontal},W={clipPath:`url(#${P})`},D={id:P},q={slots:A,slotProps:M,onItemClick:p},K={slots:A,slotProps:M,onItemClick:g},Y={slots:A,slotProps:M,onItemClick:x,skipAnimation:R},ie={slots:A,slotProps:M,loading:_},V={slots:A,slotProps:M},re=Ce({x:"line"},b),fe={slots:A,slotProps:M},ae={slots:A,slotProps:M};return{chartsWrapperProps:{sx:f,legendPosition:e.slotProps?.legend?.position,legendDirection:e.slotProps?.legend?.direction,hideLegend:e.hideLegend??!1},chartContainerProps:L,gridProps:O,clipPathProps:D,clipPathGroupProps:W,areaPlotProps:q,linePlotProps:K,markPlotProps:Y,overlayProps:ie,chartsAxisProps:V,axisHighlightProps:re,lineHighlightPlotProps:fe,legendProps:ae,children:j}};function ehe(e,t,n,s,o,a,l,u,d,f,p=1/0,g=1){const x=n.copy(),b=s.copy();x.range([0,1]),b.range([0,1]);const y=function(N){const I=x(t[N].x),B=b(t[N].y);return I>=o&&I<=a&&B>=l&&B<=u},S=n.range()[1]-n.range()[0],j=s.range()[1]-s.range()[0],A=S*S,M=j*j;function R(F,N){return A*F*F+M*N*N}const _=x(G9(n,d,F=>t[F]?.x)),z=b(G9(s,f,F=>t[F]?.y));return e.neighbors(_,z,g,p!=null?p*p:1/0,y,R)}function G9(e,t,n){if(Ss(e)){const s=e.bandwidth()===0?Math.floor((t-Math.min(...e.range())+e.step()/2)/e.step()):Math.floor((t-Math.min(...e.range()))/e.step());return n(s)}return e.invert(t)}const my=({svgRef:e,params:t,store:n,instance:s})=>{const{disableVoronoi:o,voronoiMaxRadius:a,onItemClick:l}=t,{axis:u,axisIds:d}=n.use(ro),{axis:f,axisIds:p}=n.use(so),g=n.use(EI),{series:x,seriesOrder:b}=n.use(Fr)?.scatter??{},y=n.use(g?tae:nae),S=d[0],j=p[0];or(()=>{n.set("voronoi",{isVoronoiEnabled:!o})},[n,o]),v.useEffect(()=>{if(e.current===null||o)return;const R=e.current;function _(L){const O=Cg(R,L);if(!s.isPointInside(O.x,O.y))return"outside-chart";let W;for(const D of b??[]){const q=(x??{})[D],K=y.get(D);if(!K)continue;const Y=q.xAxisId??S,ie=q.yAxisId??j,V=w9(n.state,Y),re=w9(n.state,ie),fe=a==="item"?q.markerSize:a,ae=(V?.start??0)/100,ue=(V?.end??100)/100,se=(re?.start??0)/100,J=(re?.end??100)/100,ce=u[Y].scale,oe=f[ie].scale,ge=ehe(K,q.data,ce,oe,ae,ue,se,J,O.x,O.y,fe)[0];if(ge===void 0)continue;const de=q.data[ge],le=ce(de.x),ee=oe(de.y),X=(le-O.x)**2+(ee-O.y)**2;(W===void 0||X<W.distanceSq)&&(W={dataIndex:ge,seriesId:D,distanceSq:X})}return W===void 0?"no-point-found":{seriesId:W.seriesId,dataIndex:W.dataIndex}}const z=s.addInteractionListener("moveEnd",L=>{L.detail.activeGestures.pan||(s.cleanInteraction?.(),s.clearHighlight?.(),s.removeTooltipItem?.())}),F=s.addInteractionListener("panEnd",L=>{L.detail.activeGestures.move||(s.cleanInteraction?.(),s.clearHighlight?.(),s.removeTooltipItem?.())}),N=s.addInteractionListener("quickPressEnd",L=>{!L.detail.activeGestures.move&&!L.detail.activeGestures.pan&&(s.cleanInteraction?.(),s.clearHighlight?.(),s.removeTooltipItem?.())}),I=L=>{const O=_(L.detail.srcEvent);if(O==="outside-chart"){s.cleanInteraction?.(),s.clearHighlight?.(),s.removeTooltipItem?.();return}if(O==="outside-voronoi-max-radius"||O==="no-point-found"){s.removeTooltipItem?.(),s.clearHighlight?.(),s.removeTooltipItem?.();return}const{seriesId:W,dataIndex:D}=O;s.setTooltipItem?.({type:"scatter",seriesId:W,dataIndex:D}),s.setLastUpdateSource?.("pointer"),s.setHighlight?.({seriesId:W,dataIndex:D})},B=s.addInteractionListener("tap",L=>{const O=_(L.detail.srcEvent);if(typeof O!="string"&&l){const{seriesId:W,dataIndex:D}=O;l(L.detail.srcEvent,{type:"scatter",seriesId:W,dataIndex:D})}}),H=s.addInteractionListener("move",I),P=s.addInteractionListener("pan",I),k=s.addInteractionListener("quickPress",I);return()=>{B.cleanup(),H.cleanup(),z.cleanup(),P.cleanup(),F.cleanup(),k.cleanup(),N.cleanup()}},[e,f,u,a,l,o,s,b,x,y,S,j,n]);const A=pn(()=>{n.set("voronoi",{isVoronoiEnabled:!0})}),M=pn(()=>{n.set("voronoi",{isVoronoiEnabled:!1})});return{instance:{enableVoronoi:A,disableVoronoi:M}}};my.getDefaultizedParams=({params:e})=>Ce({},e,{disableVoronoi:e.disableVoronoi??!e.series.some(t=>t.type==="scatter")});my.getInitialState=e=>({voronoi:{isVoronoiEnabled:!e.disableVoronoi}});my.params={disableVoronoi:!0,voronoiMaxRadius:!0,onItemClick:!0};const S_=[ym,xm,bm,hm,oh,vm,Db,my,Jb],the=["width","height","margin","children","series","colors","dataset","desc","onAxisClick","highlightedAxis","onHighlightedAxisChange","tooltipItem","onTooltipItemChange","disableVoronoi","voronoiMaxRadius","onItemClick","disableAxisListener","highlightedItem","onHighlightChange","sx","title","xAxis","yAxis","zAxis","rotationAxis","radiusAxis","skipAnimation","seriesConfig","plugins","localeText","slots","slotProps","experimentalFeatures","enableKeyboardNavigation","brushConfig","onHiddenItemsChange","hiddenItems","initialHiddenItems"],nhe=(e,t)=>{const n=e,{width:s,height:o,margin:a,children:l,series:u,colors:d,dataset:f,desc:p,onAxisClick:g,highlightedAxis:x,onHighlightedAxisChange:b,tooltipItem:y,onTooltipItemChange:S,disableVoronoi:j,voronoiMaxRadius:A,onItemClick:M,disableAxisListener:R,highlightedItem:_,onHighlightChange:z,sx:F,title:N,xAxis:I,yAxis:B,zAxis:H,rotationAxis:P,radiusAxis:k,skipAnimation:L,seriesConfig:O,plugins:W,localeText:D,slots:q,slotProps:K,experimentalFeatures:Y,enableKeyboardNavigation:ie,brushConfig:V,onHiddenItemsChange:re,hiddenItems:fe,initialHiddenItems:ae}=n,ue=_n(n,the),se=Ce({title:N,desc:p,sx:F,ref:t},ue);return{chartDataProviderProps:{margin:a,series:u,colors:d,dataset:f,disableAxisListener:R,highlightedItem:_,onHighlightChange:z,onAxisClick:g,highlightedAxis:x,onHighlightedAxisChange:b,tooltipItem:y,onTooltipItemChange:S,disableVoronoi:j,voronoiMaxRadius:A,onItemClick:M,xAxis:I,yAxis:B,zAxis:H,rotationAxis:P,radiusAxis:k,skipAnimation:L,width:s,height:o,localeText:D,seriesConfig:O,experimentalFeatures:Y,enableKeyboardNavigation:ie,brushConfig:V,onHiddenItemsChange:re,hiddenItems:fe,initialHiddenItems:ae,plugins:W??S_,slots:q,slotProps:K},chartsSurfaceProps:se,children:l}},rhe=(e,t)=>nhe(e,t),she={baseButton:ye,baseIconButton:Ve},ohe={},ihe=Ce({},she,ohe),ahe=v.createContext(null);function lhe(e){const{slots:t,slotProps:n={},defaultSlots:s,children:o}=e,a=v.useMemo(()=>({slots:Ce({},s,t),slotProps:n}),[s,t,n]);return r.jsx(ahe.Provider,{value:a,children:o})}const che=["children","localeText","plugins","slots","slotProps","seriesConfig"],uhe=e=>{const t=Wi({props:e,name:"MuiChartDataProvider"}),{children:n,localeText:s,plugins:o=S_,slots:a,slotProps:l,seriesConfig:u}=t,d=_n(t,che),f=On(),p={plugins:o,seriesConfig:u,pluginParams:Ce({theme:f.palette.mode},d)};return{children:n,localeText:s,chartProviderProps:p,slots:a,slotProps:l}};function dhe(e){const{children:t,localeText:n,chartProviderProps:s,slots:o,slotProps:a}=uhe(e);return r.jsx(Sce,Ce({},s,{children:r.jsx(uue,{localeText:n,children:r.jsx(lhe,{slots:o,slotProps:a,defaultSlots:ihe,children:t})})}))}const fhe=dhe;function Y9(e){const{isReversed:t,gradientId:n,size:s,direction:o,scale:a,colorMap:l}=e;return s<=0?null:r.jsx("linearGradient",{id:n,x1:"0",x2:"0",y1:"0",y2:"0",[`${o}${t?1:2}`]:`${s}px`,gradientUnits:"userSpaceOnUse",children:l.thresholds.map((u,d)=>{const f=a(u);if(f===void 0)return null;const p=t?1-f/s:f/s;return Number.isNaN(p)?null:r.jsxs(v.Fragment,{children:[r.jsx("stop",{offset:p,stopColor:l.colors[d],stopOpacity:1}),r.jsx("stop",{offset:p,stopColor:l.colors[d+1],stopOpacity:1})]},u.toString()+d)})})}const hhe=10;function K9(e){const{gradientUnits:t,isReversed:n,gradientId:s,size:o,direction:a,scale:l,colorScale:u,colorMap:d}=e,f=[d.min??0,d.max??100],p=f.map(l).filter(y=>y!==void 0);if(p.length!==2)return null;const g=typeof f[0]=="number"?Wf(f[0],f[1]):qC(f[0],f[1]),x=Math.round((Math.max(...p)-Math.min(...p))/hhe),b=`${f[0]}-${f[1]}-`;return r.jsx("linearGradient",{id:s,x1:"0",x2:"0",y1:"0",y2:"0",[`${a}${n?1:2}`]:t==="objectBoundingBox"?1:`${o}px`,gradientUnits:t??"userSpaceOnUse",children:Array.from({length:x+1},(y,S)=>{const j=g(S/x);if(j===void 0)return null;const A=l(j);if(A===void 0)return null;const M=n?1-A/o:A/o,R=u(j);return R===null?null:r.jsx("stop",{offset:M,stopColor:R,stopOpacity:1},b+S)})})}const phe=10,ghe=e=>e?{x1:"1",x2:"0",y1:"0",y2:"0"}:{x1:"0",x2:"1",y1:"0",y2:"0"};function k5(e){const{isReversed:t,gradientId:n,colorScale:s,colorMap:o}=e,a=[o.min??0,o.max??100],l=typeof a[0]=="number"?Wf(a[0],a[1]):qC(a[0],a[1]),u=phe,d=`${a[0]}-${a[1]}-`;return r.jsx("linearGradient",Ce({id:n},ghe(t),{gradientUnits:"objectBoundingBox",children:Array.from({length:u+1},(f,p)=>{const g=p/u,x=l(g);if(x===void 0)return null;const b=s(x);return b===null?null:r.jsx("stop",{offset:g,stopColor:b,stopOpacity:1},d+p)})}))}function mhe(){const{top:e,height:t,bottom:n,left:s,width:o,right:a}=qi(),l=e+t+n,u=s+o+a,d=jw(),f=rue(),{xAxis:p,xAxisIds:g}=oo(),{yAxis:x,yAxisIds:b}=io(),{zAxis:y,zAxisIds:S}=Sw(),j=b.filter(R=>x[R].colorMap!==void 0),A=g.filter(R=>p[R].colorMap!==void 0),M=S.filter(R=>y[R].colorMap!==void 0);return j.length===0&&A.length===0&&M.length===0?null:r.jsxs("defs",{children:[j.map(R=>{const _=d(R),z=f(R),{colorMap:F,scale:N,colorScale:I,reverse:B}=x[R];return F?.type==="piecewise"?r.jsx(Y9,{isReversed:!B,scale:N,colorMap:F,size:l,gradientId:_,direction:"y"},_):F?.type==="continuous"?r.jsxs(v.Fragment,{children:[r.jsx(K9,{isReversed:!B,scale:N,colorScale:I,colorMap:F,size:l,gradientId:_,direction:"y"}),r.jsx(k5,{isReversed:B,colorScale:I,colorMap:F,gradientId:z})]},_):null}),A.map(R=>{const _=d(R),z=f(R),{colorMap:F,scale:N,reverse:I,colorScale:B}=p[R];return F?.type==="piecewise"?r.jsx(Y9,{isReversed:I,scale:N,colorMap:F,size:u,gradientId:_,direction:"x"},_):F?.type==="continuous"?r.jsxs(v.Fragment,{children:[r.jsx(K9,{isReversed:I,scale:N,colorScale:B,colorMap:F,size:u,gradientId:_,direction:"x"}),r.jsx(k5,{isReversed:I,colorScale:B,colorMap:F,gradientId:z})]},_):null}),M.map(R=>{const _=f(R),{colorMap:z,colorScale:F}=y[R];return z?.type==="continuous"?r.jsx(k5,{colorScale:F,colorMap:z,gradientId:_},_):null})]})}function xhe(e){return gt("MuiChartsSurface",e)}const bhe=()=>pt({root:["root"]},xhe);mt("MuiChartsSurface",["root"]);const yhe=["children","className","title","desc"],vhe=Me("svg",{name:"MuiChartsSurface",slot:"Root"})(({ownerState:e})=>({width:e.width??"100%",height:e.height??"100%",display:"flex",position:"relative",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden",touchAction:"pan-y",userSelect:"none",gridArea:"chart","&:focus":{outline:"none"}})),She=v.forwardRef(function(t,n){const{store:s,instance:o}=qs(),a=s.use(gre),l=s.use(mre),u=s.use(zz),d=s.use(Iz),f=s.use(fae),p=s.use(PI),g=PF(),x=vr(g,n),b=Wi({props:t,name:"MuiChartsSurface"}),{children:y,className:S,title:j,desc:A}=b,M=_n(b,yhe),R=bhe(),_=l>0&&a>0;return r.jsxs(vhe,Ce({ownerState:{width:u,height:d},viewBox:`0 0 ${a} ${l}`,className:Ye(R.root,S),tabIndex:f?0:void 0,"data-has-focused-item":p||void 0},M,{onPointerEnter:z=>{M.onPointerEnter?.(z),o.handlePointerEnter?.(z)},onPointerLeave:z=>{M.onPointerLeave?.(z),o.handlePointerLeave?.(z)},onClick:z=>{M.onClick?.(z),o.handleClick?.(z)},ref:x,children:[j&&r.jsx("title",{children:j}),A&&r.jsx("desc",{children:A}),r.jsx(mhe,{}),_&&y]}))}),X9=mt("MuiChartsToolbar",["root"]),jhe=e=>e?.horizontal==="start"?"start":e?.horizontal==="end"?"end":"center",Che=e=>e?.vertical==="top"?"flex-start":e?.vertical==="bottom"?"flex-end":"center",whe=(e,t,n)=>e?'"chart"':t==="vertical"?n?.horizontal==="start"?'"legend chart"':'"chart legend"':n?.vertical==="bottom"?`"chart" "legend"`:`"legend" "chart"`,Ahe=(e=!1,t="horizontal",n="end",s=void 0)=>{const o=s?"auto":"1fr";return t==="horizontal"||e?o:n==="start"?`auto ${o}`:`${o} auto`},Ehe=(e=!1,t="horizontal",n="top")=>t==="vertical"||e?"1fr":n==="bottom"?"1fr auto":"auto 1fr",The=Me("div",{name:"MuiChartsWrapper",slot:"Root",shouldForwardProp:e=>O0(e)&&e!=="extendVertically"&&e!=="width"})(({ownerState:e,width:t})=>{const n=Ahe(e.hideLegend,e.legendDirection,e.legendPosition?.horizontal,t),s=Ehe(e.hideLegend,e.legendDirection,e.legendPosition?.vertical),o=whe(e.hideLegend,e.legendDirection,e.legendPosition);return{variants:[{props:{extendVertically:!0},style:{height:"100%",minHeight:0}}],flex:1,display:"grid",gridTemplateColumns:n,gridTemplateRows:s,gridTemplateAreas:o,[`&:has(.${X9.root})`]:{gridTemplateRows:`auto ${s}`,gridTemplateAreas:`"${n.split(" ").map(()=>"toolbar").join(" ")}" ${o}`},[`& .${X9.root}`]:{gridArea:"toolbar",justifySelf:"center"},justifyContent:"safe center",justifyItems:jhe(e.legendPosition),alignItems:Che(e.legendPosition)}});function khe(e){const{children:t,sx:n,extendVertically:s}=e,o=oue(),a=jr(),l=a.use(zz),u=a.use(Iz);return r.jsx(The,{ref:o,ownerState:e,sx:n,extendVertically:s??u===void 0,width:l,children:t})}const g0=6;function Mhe(){const e=On(),t=due(),n=jm(),{xAxis:s,xAxisIds:o}=oo(),{yAxis:a,yAxisIds:l}=io();if(t===null||t.type!=="line"||!n)return null;const u=n.series[t.seriesId];if(u.data[t.dataIndex]==null)return null;const d=u.xAxisId??o[0],f=u.yAxisId??l[0];return r.jsx("rect",{fill:"none",stroke:(e.vars??e).palette.text.primary,strokeWidth:2,x:s[d].scale(s[d].data[t.dataIndex])-g0,y:a[f].scale(u.visibleStackedData[t.dataIndex][1])-g0,width:2*g0,height:2*g0,rx:3,ry:3})}const j_=v.forwardRef(function(t,n){const s=Wi({props:t,name:"MuiLineChart"}),{chartsWrapperProps:o,chartContainerProps:a,gridProps:l,clipPathProps:u,clipPathGroupProps:d,areaPlotProps:f,linePlotProps:p,markPlotProps:g,overlayProps:x,chartsAxisProps:b,axisHighlightProps:y,lineHighlightPlotProps:S,legendProps:j,children:A}=Jfe(s),{chartDataProviderProps:M,chartsSurfaceProps:R}=rhe(a,n),_=s.slots?.tooltip??ufe,z=s.slots?.toolbar;return r.jsx(fhe,Ce({},M,{children:r.jsxs(khe,Ce({},o,{children:[s.showToolbar&&z?r.jsx(z,Ce({},s.slotProps?.toolbar)):null,!s.hideLegend&&r.jsx(Cfe,Ce({},j)),r.jsxs(She,Ce({},R,{children:[r.jsx(Hfe,Ce({},l)),r.jsxs("g",Ce({},d,{children:[r.jsx(wue,Ce({},f)),r.jsx(Lue,Ce({},p)),r.jsx(Xfe,Ce({},x)),r.jsx(kfe,Ce({},y))]})),r.jsx(Mhe,{}),r.jsx(Nde,Ce({},b)),r.jsx("g",{"data-drawing-container":!0,children:r.jsx(Vue,Ce({},g))}),r.jsx(Lfe,Ce({},S)),r.jsx(Mfe,Ce({},u)),A]})),!s.loading&&r.jsx(_,Ce({},s.slotProps?.tooltip))]}))}))}),Uo=e=>e?e.data&&!Array.isArray(e.data)?e.data:e:null,M5=(e,t=[])=>{if(!e)return{data:[],meta:{},links:{}};if(Array.isArray(e))return{data:e,meta:{},links:{}};if(Array.isArray(e.data))return{data:e.data,meta:e.meta||{},links:e.links||{}};if(e.data&&Array.isArray(e.data.data))return{data:e.data.data,meta:e.data.meta||e.meta||{},links:e.data.links||e.links||{}};for(const n of t)if(Array.isArray(e[n]))return{data:e[n],meta:e.meta||{},links:e.links||{}};return{data:[],meta:e.meta||{},links:e.links||{}}},_1=(e,t,n)=>{n==null||n===""||e.append(t,n)},ef=(e,t,n=[])=>{Array.isArray(n)&&n.forEach((s,o)=>{s==null||s===""||e.append(`${t}[${o}]`,s)})},Rhe=(e,t,n=[])=>{Array.isArray(n)&&n.forEach(s=>{s==null||s===""||e.append(`${t}[]`,s)})},zhe=(e={})=>{const t=new FormData;return["name","email","password","phone","country","state","city","address","bio","highest_education","id_type","id_number","bank_name","account_number","account_name","review_note"].forEach(s=>_1(t,s,e[s])),Rhe(t,"skills",e.skills||[]),Array.isArray(e.docs)&&e.docs.forEach((s,o)=>{s&&(_1(t,`docs[${o}][type]`,s.type),s.file&&t.append(`docs[${o}][file]`,s.file))}),t},Z9=(e={})=>{const t=new FormData;return["title","summary","description","level","language","duration_minutes","status","thumbnail_url","banner_url","intro_video_url"].forEach(s=>_1(t,s,e[s])),ef(t,"tutor_ids",e.tutor_ids||[]),ef(t,"category_ids",e.category_ids||[]),ef(t,"tags",e.tags||[]),ef(t,"learning_objectives",e.learning_objectives||[]),ef(t,"requirements",e.requirements||[]),ef(t,"target_audience",e.target_audience||[]),e.thumbnail instanceof File&&t.append("thumbnail",e.thumbnail),e.banner instanceof File&&t.append("banner",e.banner),e.intro_video instanceof File&&t.append("intro_video",e.intro_video),t},R5=(e={})=>{const t=new URLSearchParams;Object.entries(e).forEach(([s,o])=>{o==null||o===""||t.append(s,o)});const n=t.toString();return n?`?${n}`:""},ns={listTutors:async({q:e,per_page:t=20,page:n}={})=>{const s=R5({q:e,per_page:t,page:n}),o=await ke.get(`/option/admin/tutors${s}`);return M5(o,["tutors"])},getTutorById:async e=>{const t=await ke.get(`/option/admin/tutors/${e}`);return Uo(t)},createTutor:async e=>{const t=zhe(e),n=await ke.post("/option/admin/tutors",t);return Uo(n)},updateTutor:async(e,t)=>{const n=await ke.put(`/option/admin/tutors/${e}`,t);return Uo(n)},uploadTutorKycDoc:async(e,{type:t,file:n})=>{const s=new FormData;_1(s,"type",t),n&&s.append("file",n);const o=await ke.post(`/option/admin/tutors/${e}/kyc/docs`,s);return Uo(o)},deleteTutorKycDoc:async(e,t)=>{const n=await ke.delete(`/option/admin/tutors/${e}/kyc/docs/${t}`);return Uo(n)},listEssentialCourses:async({q:e,status:t,level:n,language:s,category_id:o,with_categories:a=1,with_audit:l=1,with_tutors:u=1,per_page:d=20,page:f}={})=>{const p=R5({q:e,status:t,level:n,language:s,category_id:o,with_categories:a,with_audit:l,with_tutors:u,per_page:d,page:f}),g=await ke.get(`/option/admin/courses${p}`);return M5(g,["courses"])},getEssentialCourseById:async(e,{with_categories:t=1,with_audit:n=1,with_tutors:s=1}={})=>{const o=R5({with_categories:t,with_audit:n,with_tutors:s}),a=await ke.get(`/option/admin/courses/${e}${o}`);return Uo(a)},createEssentialCourseJson:async e=>{const t=await ke.post("/option/admin/courses",e);return Uo(t)},createEssentialCourseMultipart:async e=>{const t=Z9(e),n=await ke.post("/option/admin/courses",t);return Uo(n)},updateEssentialCourseJson:async(e,t)=>{const n=await ke.patch(`/option/admin/courses/${e}`,t);return Uo(n)},updateEssentialCourseMultipart:async(e,t)=>{const n=Z9(t),s=await ke.patch(`/option/admin/courses/${e}`,n);return Uo(s)},addTutorsToCourse:async(e,t=[])=>{const n=await ke.post(`/option/admin/courses/${e}/tutors`,{tutor_ids:t});return Uo(n)},syncCourseTutors:async(e,t=[])=>{const n=await ke.put(`/option/admin/courses/${e}/tutors`,{tutor_ids:t});return Uo(n)},removeTutorFromCourse:async(e,t)=>{const n=await ke.delete(`/option/admin/courses/${e}/tutors/${t}`);return Uo(n)},listLessonsByModule:async e=>{const t=await ke.get(`/option/admin/modules/${e}/lessons`);return M5(t,["lessons"])}},bo=e=>e?e.data?e.data:e:null,tf=e=>e?{data:e.data||[],meta:e.meta||{},links:e.links||{}}:{data:[],meta:{},links:{}},z5={getDashboard:async()=>{const e=await ke.get("/admin/dashboard");return bo(e)},getStats:async()=>{const e=await ke.get("/admin/stats");return bo(e)},listTutors:async({page:e,per_page:t=20,status:n}={})=>{const s=new URLSearchParams;e&&s.append("page",e),t&&s.append("per_page",t),n&&s.append("status",n);const o=s.toString(),a=o?`/admin/tutors?${o}`:"/admin/tutors",l=await ke.get(a);return tf(l)},getTutorById:async e=>{const t=await ke.get(`/admin/tutors/${e}`);return bo(t)},listTutors:async({page:e,per_page:t=20,status:n}={})=>{const s=new URLSearchParams;e&&s.append("page",e),t&&s.append("per_page",t),n&&s.append("status",n);const o=s.toString(),a=o?`/admin/tutors?${o}`:"/admin/tutors",l=await ke.get(a);return tf(l)},getTutorById:async e=>{const t=await ke.get(`/admin/tutors/${e}`);return bo(t)},deleteTutor:async e=>({success:!0,...await ke.delete(`/admin/tutors/${e}`)}),approveTutor:async e=>{const t=await ke.post(`/admin/tutors/${e}/approve`);return bo(t)},rejectTutor:async(e,t)=>{const n=await ke.post(`/admin/tutors/${e}/reject`,{reason:t});return bo(n)},suspendTutor:async(e,t)=>{const n=await ke.post(`/admin/tutors/${e}/suspend`,{reason:t});return bo(n)},unsuspendTutor:async e=>{const t=await ke.post(`/admin/tutors/${e}/unsuspend`);return bo(t)},listReviewers:async({page:e,per_page:t=20}={})=>{const n=new URLSearchParams;e&&n.append("page",e),t&&n.append("per_page",t);const s=n.toString(),o=s?`/admin/reviewers?${s}`:"/admin/reviewers",a=await ke.get(o);return tf(a)},createReviewer:async e=>{const t=await ke.post("/admin/reviewers",e);return bo(t)},getReviewerById:async e=>{const t=await ke.get(`/admin/reviewers/${e}`);return bo(t)},deleteReviewer:async e=>({success:!0,...await ke.delete(`/admin/reviewers/${e}`)}),listStudents:async({page:e,per_page:t=20,q:n}={})=>{const s=new URLSearchParams;e&&s.append("page",e),t&&s.append("per_page",t),n&&s.append("q",n);const o=s.toString(),a=o?`/admin/students?${o}`:"/admin/students",l=await ke.get(a);return tf(l)},getStudentById:async e=>{const t=await ke.get(`/admin/students/${e}`);return bo(t)},deleteStudent:async e=>({success:!0,...await ke.delete(`/admin/students/${e}`)}),listWithdrawRequests:async({page:e,per_page:t=20,status:n}={})=>{const s=new URLSearchParams;e&&s.append("page",e),t&&s.append("per_page",t),n&&s.append("status",n);const o=s.toString(),a=o?`/admin/withdraw-requests?${o}`:"/admin/withdraw-requests",l=await ke.get(a);return tf(l)},processPayout:async e=>{const t=await ke.post("/admin/payouts",e);return bo(t)},getAuditLogs:async({page:e,per_page:t=50}={})=>{const n=new URLSearchParams;e&&n.append("page",e),t&&n.append("per_page",t);const s=n.toString(),o=s?`/admin/audit-logs?${s}`:"/admin/audit-logs",a=await ke.get(o);return tf(a)},getSettings:async()=>{const e=await ke.get("/admin/settings");return bo(e)},updateSettings:async e=>{const t=await ke.post("/admin/settings",e);return bo(t)}},Ihe=[{label:"Total Users",value:"0",change:"18%",changeType:"positive",icon:fz},{label:"Active Courses",value:"0",change:"8%",changeType:"positive",icon:hr},{label:"Pending Verifications",value:"0",sublabel:"Needs Review",sublabelColor:"#F59E0B",icon:zb},{label:"Active Tutors",value:"0",change:"12%",changeType:"positive",icon:Mb}],Fhe=e=>{if(!e)return"Recently";const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4),s=Math.floor(n/60),o=Math.floor(s/24);return o>0?`${o}d ago`:s>0?`${s}h ago`:n>0?`${n}m ago`:"Just now"},_he=()=>{const e=v.useRef(null),[t,n]=v.useState(0),[s,o]=v.useState(Ihe),[a,l]=v.useState([]),[u,d]=v.useState([]),[f,p]=v.useState([]),[g,x]=v.useState([120,180,250,380,520,847]),[b,y]=v.useState("+847"),[S,j]=v.useState("+23.4%");return v.useEffect(()=>{const A=()=>{e.current&&n(e.current.offsetWidth)};return A(),window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)},[]),v.useEffect(()=>{(async()=>{try{const[M,R,_,z]=await Promise.allSettled([z5.getDashboard(),z5.getStats(),ns.listTutors({per_page:20}),z5.listStudents({per_page:4})]),F=M.status==="fulfilled"?M.value:null,N=R.status==="fulfilled"?R.value:null,I={...N,...F};if(F||N){o(P=>P.map(k=>{if(k.label==="Total Users"){const L=I.total_users??I.users_count??I.total_students??null;return L!==null?{...k,value:Number(L).toLocaleString()}:k}if(k.label==="Active Courses"){const L=I.active_courses??I.courses_count??I.total_courses??null;return L!==null?{...k,value:Number(L).toLocaleString()}:k}if(k.label==="Pending Verifications"){const L=I.pending_verifications??I.pending_kyc??I.kyc_pending??null;return L!==null?{...k,value:Number(L).toLocaleString()}:k}return k}));const B=I.pending_actions??I.pending_courses??I.recent_submissions??[];Array.isArray(B)&&B.length>0&&p(B.slice(0,3).map((P,k)=>({id:P.id||k,title:P.title||P.name||"Pending Item",author:P.author||P.tutor_name||P.user?.name||P.student?.name||"Unknown",time:Fhe(P.submitted_at||P.created_at||P.updated_at),action:P.action||"Review"})));const H=I.user_growth??I.monthly_users??I.registrations??[];if(Array.isArray(H)&&H.length>0){const P=H.map(L=>Number(L.count??L.value??L.total??0));x(P);const k=P[P.length-1]||0;y(`+${k.toLocaleString()}`)}}if(_.status==="fulfilled"){const B=_.value?.data||_.value||[],H=Array.isArray(B)?B:[],P=H.slice(0,4).map((k,L)=>({id:k.id||L,name:k.name||`${k.first_name||""} ${k.last_name||""}`.trim()||"Unknown Tutor",subject:k.specialization||k.expertise||"General",status:k.status==="Active"?"Online":"Offline"}));l(P),o(k=>k.map(L=>L.label==="Active Tutors"?{...L,value:H.length.toString()}:L))}if(z.status==="fulfilled"){const H=(z.value?.data||[]).slice(0,4).map(P=>({id:P.id,name:P.name||`${P.first_name||""} ${P.last_name||""}`.trim()||"Unknown User",email:P.email||"",role:P.role||"Learner",status:P.status==="active"||P.is_active?"active":"pending",avatar:P.avatar||P.profile_photo||null}));H.length>0&&d(H)}}catch(M){console.error("Error fetching admin dashboard data:",M)}})()},[]),r.jsxs(E,{sx:{p:{xs:2,md:4},bgcolor:"#0C1322",minHeight:"calc(100vh - 70px)",width:"100%",boxSizing:"border-box"},children:[r.jsxs(E,{sx:{mb:3},children:[r.jsx(C,{sx:{fontWeight:700,color:"#FFFFFF",fontSize:{xs:"1.5rem",md:"1.75rem"},mb:.5},children:"Welcome back, Admin"}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.95rem"},children:"Here's an overview of the platform's performance and pending tasks."})]}),r.jsx(E,{sx:{display:"flex",flexWrap:"wrap",gap:3,mb:4,width:"100%"},children:s.map((A,M)=>r.jsx(E,{sx:{flex:{xs:"1 1 100%",sm:"1 1 calc(50% - 12px)",md:"1 1 calc(25% - 18px)"},minWidth:0},children:r.jsxs(Je,{sx:{bgcolor:"#1A2230",p:3,borderRadius:2,border:"1px solid #374151",minHeight:120,height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.9rem",fontWeight:500},children:A.label}),r.jsx(E,{sx:{bgcolor:"#0C1322",borderRadius:1.5,p:1,display:"flex",alignItems:"center",justifyContent:"center"},children:r.jsx(A.icon,{sx:{fontSize:22,color:"#6B7280"}})})]}),r.jsxs(G,{direction:"row",alignItems:"baseline",spacing:1.5,sx:{mt:2},children:[r.jsx(C,{sx:{color:"#FFFFFF",fontSize:"2rem",fontWeight:700,lineHeight:1},children:A.value}),A.change&&r.jsxs(G,{direction:"row",alignItems:"center",spacing:.25,children:[A.changeType==="positive"?r.jsx(sm,{sx:{fontSize:14,color:"#10B981"}}):r.jsx(Cz,{sx:{fontSize:14,color:"#EF4444"}}),r.jsx(C,{sx:{color:A.changeType==="positive"?"#10B981":"#EF4444",fontSize:"0.75rem",fontWeight:500},children:A.change})]}),A.sublabel&&r.jsx(C,{sx:{color:A.sublabelColor||"#F59E0B",fontSize:"0.75rem",fontWeight:500},children:A.sublabel})]})]})},M))}),r.jsxs(E,{sx:{display:"flex",flexWrap:"wrap",gap:4,mb:4,mt:4,width:"100%"},children:[r.jsx(E,{sx:{flex:{xs:"1 1 100%",md:"1 1 calc(66.67% - 16px)"},minWidth:0},children:r.jsxs(Je,{sx:{bgcolor:"#1A2230",p:2,borderRadius:2,border:"1px solid #374151",height:{xs:250,md:280},width:"100%",maxWidth:"100%",overflow:"hidden"},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:1},children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#FFFFFF",fontWeight:600,fontSize:"0.85rem"},children:"User Growth"}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.65rem"},children:"New registrations over the last 6 months"})]}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:.5,children:[r.jsx(C,{sx:{color:"#FFFFFF",fontSize:"1.1rem",fontWeight:700},children:b}),r.jsx(C,{sx:{color:"#10B981",fontSize:"0.7rem",fontWeight:500},children:S})]})]}),r.jsx(E,{ref:e,sx:{height:200,mt:1,width:"100%",overflow:"hidden"},children:t>0&&r.jsx(j_,{width:t,height:200,xAxis:[{data:[1,2,3,4,5,6],scaleType:"point",valueFormatter:A=>["Jan","Feb","Mar","Apr","May","Jun"][A-1],tickLabelStyle:{fill:"#4B5563",fontSize:9,fontWeight:500},disableLine:!0,disableTicks:!0}],yAxis:[{disableLine:!0,disableTicks:!0,tickLabelStyle:{display:"none"}}],series:[{data:g,area:!0,color:"#1152D4",showMark:!1,curve:"natural"}],sx:{"& .MuiLineElement-root":{strokeWidth:2.5,stroke:"#1152D4"},"& .MuiAreaElement-root":{fill:"url(#adminAreaGradient)"},"& .MuiChartsAxis-line":{display:"none"},"& .MuiChartsAxis-tick":{display:"none"},"& .MuiChartsGrid-line":{stroke:"#1F2937",strokeDasharray:"3 3"}},margin:{left:10,right:10,top:20,bottom:30},slotProps:{legend:{hidden:!0}},children:r.jsx("defs",{children:r.jsxs("linearGradient",{id:"adminAreaGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0%",stopColor:"#1152D4",stopOpacity:.4}),r.jsx("stop",{offset:"50%",stopColor:"#1152D4",stopOpacity:.15}),r.jsx("stop",{offset:"100%",stopColor:"#1152D4",stopOpacity:0})]})})})})]})}),r.jsx(E,{sx:{flex:{xs:"1 1 100%",md:"1 1 calc(33.33% - 16px)"},minWidth:0},children:r.jsxs(Je,{sx:{bgcolor:"transparent",p:0,borderRadius:2,height:{xs:"auto",md:280},display:"flex",flexDirection:"column"},elevation:0,children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:1},children:[r.jsx(C,{sx:{color:"#FFFFFF",fontWeight:600,fontSize:"0.85rem"},children:"Pending Actions"}),r.jsx(ye,{size:"small",sx:{color:"#3B82F6",textTransform:"none",fontSize:"0.7rem",p:0},children:"View All"})]}),r.jsxs(G,{spacing:1,sx:{flex:1},children:[f.length===0&&r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.8rem",textAlign:"center",mt:2},children:"No pending actions"}),f.map(A=>r.jsx(E,{sx:{bgcolor:"#1A2230",borderRadius:1.5,p:1.5,border:"1px solid #374151",transition:"border-color 0.2s ease","&:hover":{borderColor:"#4B5563"}},children:r.jsxs(G,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1.5,sx:{flex:1,minWidth:0},children:[r.jsx(E,{sx:{width:32,height:32,borderRadius:"50%",bgcolor:"rgba(59, 130, 246, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:r.jsx(Qg,{sx:{fontSize:16,color:"#3B82F6"}})}),r.jsxs(E,{sx:{flex:1,minWidth:0},children:[r.jsx(C,{sx:{color:"#FFFFFF",fontWeight:600,fontSize:"0.8rem",lineHeight:1.3},children:A.title}),r.jsxs(C,{sx:{color:"#9CA3AF",fontSize:"0.7rem"},children:[A.author," • ",A.time]})]})]}),r.jsx(ye,{endIcon:r.jsx(Oi,{sx:{fontSize:12}}),sx:{color:"#3B82F6",textTransform:"none",fontSize:"0.7rem",fontWeight:600,p:0,minWidth:"auto",ml:1,flexShrink:0,"&:hover":{bgcolor:"transparent",color:"#60A5FA"}},children:A.action})]})},A.id))]})]})})]}),r.jsxs(E,{sx:{display:"flex",flexWrap:"wrap",gap:4,mt:4,width:"100%"},children:[r.jsx(E,{sx:{flex:{xs:"1 1 100%",md:"1 1 calc(66.67% - 16px)"},minWidth:0},children:r.jsxs(Je,{sx:{bgcolor:"#1A2230",p:3,borderRadius:2,border:"1px solid #374151"},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:2},children:[r.jsx(C,{sx:{color:"#FFFFFF",fontWeight:600,fontSize:"0.9rem"},children:"Recent Users"}),r.jsx(ye,{variant:"contained",startIcon:r.jsx(Mb,{sx:{fontSize:16}}),size:"small",sx:{bgcolor:"#1152D4",color:"#FFFFFF",textTransform:"none",fontSize:"0.75rem",px:2,py:.75,"&:hover":{bgcolor:"#0D41AA"}},children:"Add User"})]}),r.jsxs(G,{spacing:1.5,children:[u.length===0&&r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.8rem",textAlign:"center",mt:2},children:"No recent users"}),u.map(A=>r.jsxs(E,{sx:{bgcolor:"#0C1322",borderRadius:1.5,p:2,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(yr,{sx:{width:40,height:40,bgcolor:"#1152D4",fontSize:"0.9rem"},children:A.name.split(" ").map(M=>M[0]).join("")}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#FFFFFF",fontWeight:600,fontSize:"0.85rem"},children:A.name}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:A.email})]})]}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(Pt,{label:A.role,size:"small",sx:{bgcolor:A.role==="Tutor"?"#7C3AED":"#374151",color:"#FFFFFF",fontSize:"0.7rem"}}),r.jsx(Pt,{icon:A.status==="active"?r.jsx(fr,{sx:{fontSize:14}}):r.jsx(rm,{sx:{fontSize:14}}),label:A.status==="active"?"Active":"Pending",size:"small",sx:{bgcolor:A.status==="active"?"rgba(16, 185, 129, 0.2)":"rgba(245, 158, 11, 0.2)",color:A.status==="active"?"#10B981":"#F59E0B",fontSize:"0.7rem","& .MuiChip-icon":{color:A.status==="active"?"#10B981":"#F59E0B"}}}),r.jsx(Ve,{size:"small",sx:{color:"#6B7280","&:hover":{bgcolor:"rgba(255,255,255,0.05)"}},children:r.jsx(xte,{sx:{fontSize:18}})})]})]},A.id))]})]})}),r.jsx(E,{sx:{flex:{xs:"1 1 100%",md:"1 1 calc(33.33% - 16px)"},minWidth:0},children:r.jsxs(Je,{sx:{bgcolor:"#1A2230",p:3,borderRadius:2,border:"1px solid #374151",height:"100%"},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:2},children:[r.jsx(C,{sx:{color:"#FFFFFF",fontWeight:600,fontSize:"0.9rem"},children:"Active Tutors"}),r.jsx(ye,{size:"small",sx:{color:"#3B82F6",textTransform:"none",fontSize:"0.7rem",p:0},children:"View All"})]}),r.jsx(G,{spacing:1.5,children:a.map(A=>r.jsxs(E,{sx:{bgcolor:"#0C1322",borderRadius:1.5,p:1.5,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1.5,children:[r.jsxs(E,{sx:{position:"relative"},children:[r.jsx(yr,{sx:{width:36,height:36,bgcolor:"#7C3AED",fontSize:"0.85rem"},children:A.name.split(" ").map(M=>M[0]).join("")}),r.jsx(E,{sx:{position:"absolute",bottom:0,right:0,width:10,height:10,bgcolor:A.status==="Online"?"#10B981":A.status==="In Session"?"#F59E0B":"#9CA3AF",borderRadius:"50%",border:"2px solid #0C1322"}})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#FFFFFF",fontWeight:600,fontSize:"0.8rem"},children:A.name}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.7rem"},children:A.subject})]})]}),r.jsx(Pt,{label:A.status,size:"small",sx:{bgcolor:A.status==="Online"?"rgba(16, 185, 129, 0.1)":A.status==="In Session"?"rgba(245, 158, 11, 0.1)":"rgba(156, 163, 175, 0.1)",color:A.status==="Online"?"#10B981":A.status==="In Session"?"#F59E0B":"#9CA3AF",fontSize:"0.65rem",height:20}})]},A.id))})]})})]})]})},xt={"& .MuiOutlinedInput-root":{bgcolor:"#1E293B",borderRadius:1.5,"& fieldset":{borderColor:"#374151"},"&:hover fieldset":{borderColor:"#4B5563"},"&.Mui-focused fieldset":{borderColor:"#1152D4"}},"& .MuiInputBase-input":{py:1.25,fontSize:"0.875rem",color:"#FFFFFF",border:"none","&::placeholder":{color:"#9CA3AF",opacity:1}}},Yn={bgcolor:"#1E293B",borderRadius:1.5,color:"#FFFFFF","& .MuiOutlinedInput-notchedOutline":{borderColor:"#374151"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#4B5563"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"#1152D4"},"& .MuiSvgIcon-root":{color:"#9CA3AF"}},Tr={PaperProps:{sx:{bgcolor:"#1E293B",color:"#fff",border:"1px solid #374151",borderRadius:1.5,mt:.5,"& .MuiMenuItem-root":{"&:hover":{bgcolor:"#374151"}}}}},kr={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:500,bgcolor:"#1A2230",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:4,boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05)",overflow:"hidden",outline:"none"},kw={"&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-track":{background:"#0C1322",borderRadius:"4px"},"&::-webkit-scrollbar-thumb":{background:"#374151",borderRadius:"4px","&:hover":{background:"#4B5563"}}},xy={bgcolor:"#1F2937",borderRadius:1,px:2,display:"flex",alignItems:"center",gap:1,width:"100%",height:"40px"},by={color:"#FFFFFF",fontSize:"0.9rem",width:"100%","& input":{border:"none",outline:"none","&::placeholder":{color:"#6B7280"}}},os={bgcolor:"#1152D4","&:hover":{bgcolor:"#0D42AF"},boxShadow:"0 4px 14px rgba(17, 82, 212, 0.4)"},fn={color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},Rt={borderBottom:"1px solid #374151"},Wr={bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151"},I5=e=>e?e.data||e.admin||e:null,Lhe=e=>e?Array.isArray(e)?{data:e,meta:{},links:{}}:{data:e.data||e.admins||[],meta:e.meta||{},links:e.links||{}}:{data:[],meta:{},links:{}},m0={listStaff:async({search:e,status:t,page:n,per_page:s}={})=>{const o=new URLSearchParams;e&&o.append("search",e),t&&o.append("status",t),n&&o.append("page",n),s&&o.append("per_page",s);const a=o.toString(),l=a?`/admins?${a}`:"/admins",u=await ke.get(l);return Lhe(u)},createStaff:async e=>await ke.post("/admins",e),getStaffById:async e=>{const t=await ke.get(`/admins/${e}`);return I5(t)},updateStaff:async(e,t)=>{const n=await ke.put(`/admins/${e}`,t);return I5(n)},deleteStaff:async e=>({success:!0,...await ke.delete(`/admins/${e}`)}),toggleStatus:async(e,t)=>{const n=await ke.put(`/admins/${e}`,{status:t});return I5(n)}},Q9=["manage_staff","manage_learners","manage_tutors","manage_reviewers","manage_courses","review_submissions","manage_payments","view_reports","system_settings"],Phe=()=>{const[e,t]=v.useState([]),[n,s]=v.useState(""),[o,a]=v.useState(""),[l,u]=v.useState(!0),[d,f]=v.useState(null),[p,g]=v.useState(!1),[x,b]=v.useState(null),[y,S]=v.useState({open:!1,message:"",severity:"success"}),[j,A]=v.useState(null),[M,R]=v.useState([{id:1,name:"Admin",description:"Full system access",privileges:Q9},{id:2,name:"Support",description:"Can view reports and manage users",privileges:["manage_learners","manage_tutors"]}]),[_,z]=v.useState(""),[F,N]=v.useState(""),[I,B]=v.useState([]),[H,P]=v.useState(!1),[k,L]=v.useState(!1),[O,W]=v.useState(null),[D,q]=v.useState({first_name:"",last_name:"",email:"",phone:"",gender:"",department:"",job_title:"",staff_no:"",status:"Active"}),K=v.useCallback(async()=>{u(!0),b(null);try{const ee=await m0.listStaff({search:n||void 0,status:o||void 0});t(ee.data||[])}catch(ee){console.error("Error fetching staff:",ee),b(ee.message||"Failed to load staff"),S({open:!0,message:"Failed to load staff",severity:"error"})}finally{u(!1)}},[n,o]);v.useEffect(()=>{K()},[K]);const Y=e.filter(ee=>(ee.first_name&&ee.last_name?`${ee.first_name} ${ee.last_name}`:ee.user?.name||ee.name||"").toLowerCase().includes(n.toLowerCase())||(ee.user?.email||ee.email||"").toLowerCase().includes(n.toLowerCase())),ie=(ee=null)=>{ee?(q({first_name:ee.first_name||"",last_name:ee.last_name||"",email:ee.user?.email||ee.email||"",phone:ee.phone||"",gender:ee.gender||"",department:ee.department||"",job_title:ee.job_title||"",staff_no:ee.staff_no||"",status:ee.status||"Active"}),W(ee)):(q({first_name:"",last_name:"",email:"",phone:"",gender:"",department:"",job_title:"",staff_no:"",status:"Active"}),W(null)),P(!0)},V=()=>{P(!1),W(null)},re=async()=>{if(!D.first_name.trim()||!D.last_name.trim()||!D.email.trim()){S({open:!0,message:"First name, last name, and email are required",severity:"error"});return}g(!0);try{if(O)await m0.updateStaff(O.id,D),S({open:!0,message:"Staff updated successfully",severity:"success"});else{const ee=await m0.createStaff(D);ee.credentials&&A(ee.credentials),S({open:!0,message:"Staff created successfully",severity:"success"})}V(),await K()}catch(ee){console.error("Error saving staff:",ee),S({open:!0,message:ee.message||"Failed to save staff",severity:"error"})}finally{g(!1)}},fe=async ee=>{const X=ee.first_name&&ee.last_name?`${ee.first_name} ${ee.last_name}`:ee.user?.name||"this staff member";if(window.confirm(`Are you sure you want to delete ${X}? This action cannot be undone.`)){f(ee.id);try{await m0.deleteStaff(ee.id),S({open:!0,message:"Staff deleted successfully",severity:"success"}),await K()}catch(ve){console.error("Error deleting staff:",ve),S({open:!0,message:ve.message||"Failed to delete staff",severity:"error"})}finally{f(null)}}},ae=()=>{if(j){const ee=`Email: ${j.email} Password: ${j.password}`;navigator.clipboard.writeText(ee),S({open:!0,message:"Credentials copied to clipboard",severity:"success"})}},ue=()=>{z(""),N(""),B([]),L(!0)},se=()=>{L(!1)},J=ee=>{B(X=>X.includes(ee)?X.filter(ve=>ve!==ee):[...X,ee])},ce=()=>{if(_){const ee={id:M.length+1,name:_,description:F,privileges:I};R([...M,ee]),z(""),N(""),B([])}},oe=ee=>{R(M.filter(X=>X.id!==ee))},ge=()=>{S({...y,open:!1})},de=ee=>ee.first_name&&ee.last_name?`${ee.first_name} ${ee.last_name}`:ee.user?.name||ee.name||"Unknown",le=ee=>ee.first_name&&ee.last_name?`${ee.first_name[0]}${ee.last_name[0]}`:(ee.user?.name||ee.name||"?").split(" ").map(ve=>ve[0]).join("");return r.jsxs(E,{sx:{p:{xs:2,md:4},bgcolor:"#0C1322",minHeight:"calc(100vh - 70px)",width:"100%"},children:[r.jsxs(G,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:2,sx:{mb:4},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h4",sx:{color:"#fff",fontWeight:700,mb:1},children:"Staff Management"}),r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF"},children:"Manage administrative staff and system roles."})]}),r.jsxs(G,{direction:"row",spacing:2,children:[r.jsx(tn,{title:"Refresh",children:r.jsx(Ve,{onClick:K,disabled:l,sx:{color:"#9CA3AF","&:hover":{bgcolor:"rgba(255,255,255,0.1)"}},children:r.jsx(Ku,{})})}),r.jsx(ye,{variant:"outlined",startIcon:r.jsx(t0,{}),onClick:ue,sx:{color:"#fff",borderColor:"#374151","&:hover":{borderColor:"#4B5563",bgcolor:"rgba(255,255,255,0.05)"}},children:"Manage Roles"}),r.jsx(ye,{variant:"contained",startIcon:r.jsx(Br,{}),onClick:()=>ie(),sx:{bgcolor:"#1152D4","&:hover":{bgcolor:"#0D42AF"},boxShadow:"0 4px 14px rgba(17, 82, 212, 0.4)"},children:"Create Staff"})]})]}),r.jsx(Je,{sx:{p:2,mb:4,bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151"},children:r.jsxs(G,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[r.jsxs(E,{sx:{bgcolor:"#1F2937",borderRadius:1,px:2,display:"flex",alignItems:"center",gap:1,width:"100%",maxWidth:400,height:"40px"},children:[r.jsx(to,{sx:{color:"#9CA3AF",fontSize:20}}),r.jsx(sr,{placeholder:"Search staff by name or email...",value:n,onChange:ee=>s(ee.target.value),sx:{color:"#FFFFFF",fontSize:"0.9rem",width:"100%","& input":{border:"none",outline:"none","&::placeholder":{color:"#6B7280"}}}})]}),r.jsxs(Fn,{value:o,onChange:ee=>a(ee.target.value),displayEmpty:!0,sx:{...Yn,minWidth:150,height:"40px"},children:[r.jsx(It,{value:"",children:"All Status"}),r.jsx(It,{value:"Active",children:"Active"}),r.jsx(It,{value:"Inactive",children:"Inactive"})]})]})}),r.jsx(ko,{component:Je,sx:{bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151"},children:r.jsxs(Eo,{children:[r.jsx(Mo,{children:r.jsxs(Bt,{children:[r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Staff Member"}),r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Department"}),r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Job Title"}),r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Status"}),r.jsx(je,{align:"right",sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Actions"})]})}),r.jsx(To,{children:l?r.jsx(Bt,{children:r.jsxs(je,{colSpan:5,align:"center",sx:{borderBottom:"1px solid #374151",py:6},children:[r.jsx(nn,{size:40,sx:{color:"#1152D4"}}),r.jsx(C,{sx:{color:"#9CA3AF",mt:2},children:"Loading staff..."})]})}):x?r.jsx(Bt,{children:r.jsxs(je,{colSpan:5,align:"center",sx:{borderBottom:"1px solid #374151",py:4},children:[r.jsx(Wt,{severity:"error",sx:{bgcolor:"transparent",justifyContent:"center"},children:x}),r.jsx(ye,{onClick:K,sx:{mt:2,color:"#1152D4"},children:"Try Again"})]})}):Y.length===0?r.jsx(Bt,{children:r.jsxs(je,{colSpan:5,align:"center",sx:{borderBottom:"1px solid #374151",py:6},children:[r.jsx(t0,{sx:{fontSize:48,color:"#374151",mb:2}}),r.jsx(C,{sx:{color:"#9CA3AF"},children:n||o?"No staff match your filters":'No staff found. Click "Create Staff" to add one.'})]})}):Y.map(ee=>{const X=d===ee.id,ve=ee.status?.toLowerCase()==="active";return r.jsxs(Bt,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[r.jsx(je,{sx:{color:"#fff",borderBottom:"1px solid #374151"},children:r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(yr,{sx:{width:40,height:40,bgcolor:"#7C3AED",fontSize:"0.9rem"},children:le(ee)}),r.jsxs(E,{children:[r.jsx(C,{variant:"subtitle2",sx:{fontWeight:600,color:"#fff"},children:de(ee)}),r.jsxs(C,{variant:"caption",sx:{color:"#6B7280"},children:[ee.user?.email||ee.email||"No email",ee.staff_no&&` • ${ee.staff_no}`]})]})]})}),r.jsx(je,{sx:{borderBottom:"1px solid #374151"},children:r.jsx(C,{variant:"body2",sx:{color:"#D1D5DB"},children:ee.department||"-"})}),r.jsx(je,{sx:{borderBottom:"1px solid #374151"},children:r.jsx(Pt,{icon:r.jsx(t0,{sx:{fontSize:14}}),label:ee.job_title||"Staff",size:"small",sx:{bgcolor:"rgba(17, 82, 212, 0.15)",color:"#3B82F6",fontSize:"0.75rem","& .MuiChip-icon":{color:"#3B82F6"}}})}),r.jsx(je,{sx:{borderBottom:"1px solid #374151"},children:r.jsx(Pt,{icon:ve?r.jsx(fr,{sx:{fontSize:14}}):r.jsx(_c,{sx:{fontSize:14}}),label:ee.status||"Unknown",size:"small",sx:{bgcolor:ve?"rgba(16, 185, 129, 0.15)":"rgba(239, 68, 68, 0.15)",color:ve?"#10B981":"#EF4444",fontSize:"0.75rem","& .MuiChip-icon":{color:ve?"#10B981":"#EF4444"}}})}),r.jsx(je,{align:"right",sx:{borderBottom:"1px solid #374151"},children:r.jsxs(G,{direction:"row",spacing:1,justifyContent:"flex-end",children:[r.jsx(tn,{title:"Edit Staff",children:r.jsx(Ve,{onClick:()=>ie(ee),disabled:X,sx:{color:"#3B82F6",bgcolor:"rgba(59, 130, 246, 0.1)","&:hover":{bgcolor:"rgba(59, 130, 246, 0.2)"}},children:r.jsx(Ws,{fontSize:"small"})})}),r.jsx(tn,{title:"Delete Staff",children:r.jsx(Ve,{onClick:()=>fe(ee),disabled:X,sx:{color:"#EF4444",bgcolor:"rgba(239, 68, 68, 0.1)","&:hover":{bgcolor:"rgba(239, 68, 68, 0.2)"}},children:X?r.jsx(nn,{size:18,sx:{color:"inherit"}}):r.jsx(ss,{fontSize:"small"})})})]})})]},ee.id)})})]})}),r.jsx(tr,{open:H,onClose:V,children:r.jsxs(E,{sx:{...kr,maxHeight:"90vh",overflowY:"auto"},children:[r.jsxs(E,{sx:{background:"linear-gradient(135deg, #1152D4 0%, #0D42AF 100%)",p:3,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(Mb,{sx:{color:"#fff",fontSize:28}}),r.jsx(C,{variant:"h6",sx:{color:"#fff",fontWeight:600},children:O?"Edit Staff Member":"Create Staff Member"})]}),r.jsx(Ve,{onClick:V,sx:{color:"#fff","&:hover":{bgcolor:"rgba(255,255,255,0.1)"}},children:r.jsx(hs,{})})]}),r.jsx(E,{sx:{p:3},children:r.jsxs(G,{spacing:2.5,children:[r.jsxs(Zt,{container:!0,spacing:2,children:[r.jsxs(Zt,{item:!0,xs:12,sm:6,children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"First Name *"}),r.jsx(it,{fullWidth:!0,placeholder:"e.g. John",value:D.first_name,onChange:ee=>q({...D,first_name:ee.target.value}),sx:xt})]}),r.jsxs(Zt,{item:!0,xs:12,sm:6,children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Last Name *"}),r.jsx(it,{fullWidth:!0,placeholder:"e.g. Doe",value:D.last_name,onChange:ee=>q({...D,last_name:ee.target.value}),sx:xt})]})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Email Address *"}),r.jsx(it,{fullWidth:!0,placeholder:"name@organization.com",value:D.email,onChange:ee=>q({...D,email:ee.target.value}),disabled:!!O,sx:xt})]}),r.jsxs(Zt,{container:!0,spacing:2,children:[r.jsxs(Zt,{item:!0,xs:12,sm:6,children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Phone"}),r.jsx(it,{fullWidth:!0,placeholder:"08012345678",value:D.phone,onChange:ee=>q({...D,phone:ee.target.value}),sx:xt})]}),r.jsxs(Zt,{item:!0,xs:12,sm:6,children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Gender"}),r.jsxs(Fn,{fullWidth:!0,value:D.gender,onChange:ee=>q({...D,gender:ee.target.value}),displayEmpty:!0,sx:Yn,children:[r.jsx(It,{value:"",children:"Select Gender"}),r.jsx(It,{value:"Male",children:"Male"}),r.jsx(It,{value:"Female",children:"Female"})]})]})]}),r.jsxs(Zt,{container:!0,spacing:2,children:[r.jsxs(Zt,{item:!0,xs:12,sm:6,children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Department"}),r.jsx(it,{fullWidth:!0,placeholder:"e.g. Academics",value:D.department,onChange:ee=>q({...D,department:ee.target.value}),sx:xt})]}),r.jsxs(Zt,{item:!0,xs:12,sm:6,children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Job Title"}),r.jsx(it,{fullWidth:!0,placeholder:"e.g. Content Manager",value:D.job_title,onChange:ee=>q({...D,job_title:ee.target.value}),sx:xt})]})]}),r.jsxs(Zt,{container:!0,spacing:2,children:[r.jsxs(Zt,{item:!0,xs:12,sm:6,children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Staff Number"}),r.jsx(it,{fullWidth:!0,placeholder:"e.g. STF-1001",value:D.staff_no,onChange:ee=>q({...D,staff_no:ee.target.value}),sx:xt})]}),r.jsxs(Zt,{item:!0,xs:12,sm:6,children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Status"}),r.jsxs(Fn,{fullWidth:!0,value:D.status,onChange:ee=>q({...D,status:ee.target.value}),sx:Yn,children:[r.jsx(It,{value:"Active",children:"Active"}),r.jsx(It,{value:"Inactive",children:"Inactive"})]})]})]}),r.jsx(ye,{variant:"contained",fullWidth:!0,onClick:re,disabled:!D.first_name.trim()||!D.last_name.trim()||!D.email.trim()||p,sx:{bgcolor:"#1152D4",py:1.5,borderRadius:1.5,fontWeight:600,fontSize:"0.875rem",boxShadow:"0 4px 14px rgba(17, 82, 212, 0.4)","&:hover":{bgcolor:"#0D42AF"},"&:disabled":{bgcolor:"#1F2937",color:"#6B7280",boxShadow:"none"}},children:p?r.jsx(nn,{size:20,sx:{color:"#fff"}}):O?"Update Staff":"Create Staff"})]})})]})}),r.jsx(tr,{open:k,onClose:se,children:r.jsxs(E,{sx:{...kr,width:600,maxHeight:"85vh",display:"flex",flexDirection:"column"},children:[r.jsxs(E,{sx:{background:"linear-gradient(135deg, #1152D4 0%, #0D42AF 100%)",p:3,display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(t0,{sx:{color:"#fff",fontSize:28}}),r.jsx(C,{variant:"h6",sx:{color:"#fff",fontWeight:600},children:"Roles & Permissions"})]}),r.jsx(Ve,{onClick:se,sx:{color:"#fff","&:hover":{bgcolor:"rgba(255,255,255,0.1)"}},children:r.jsx(hs,{})})]}),r.jsxs(E,{sx:{p:3,overflowY:"auto",flex:1,"&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-track":{background:"#0C1322",borderRadius:"4px"},"&::-webkit-scrollbar-thumb":{background:"#374151",borderRadius:"4px","&:hover":{background:"#4B5563"}}},children:[r.jsxs(E,{sx:{mb:4,p:3,bgcolor:"#0C1322",borderRadius:"12px",border:"1px solid #374151"},children:[r.jsx(C,{variant:"subtitle1",sx:{color:"#fff",mb:2.5,fontWeight:600},children:"Define New Role"}),r.jsxs(G,{spacing:2.5,children:[r.jsxs(E,{children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Role Name"}),r.jsx(it,{fullWidth:!0,placeholder:"e.g. Super Admin",value:_,onChange:ee=>z(ee.target.value),sx:xt})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Description"}),r.jsx(it,{fullWidth:!0,placeholder:"Brief description of the role's responsibilities",value:F,onChange:ee=>N(ee.target.value),sx:xt})]}),r.jsxs(E,{children:[r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF",mb:1.5,fontWeight:500},children:"Select Privileges"}),r.jsx(Zt,{container:!0,spacing:1,children:Q9.map(ee=>r.jsx(Zt,{item:!0,xs:6,children:r.jsx(vb,{control:r.jsx($f,{checked:I.includes(ee),onChange:()=>J(ee),size:"small",sx:{color:"#6B7280","&.Mui-checked":{color:"#1152D4"}}}),label:r.jsx(C,{variant:"body2",sx:{color:"#D1D5DB"},children:ee})})},ee))})]}),r.jsx(ye,{variant:"contained",onClick:ce,disabled:!_,sx:{bgcolor:"#1152D4",py:1.5,borderRadius:"8px",fontWeight:600,boxShadow:"0 4px 14px rgba(17, 82, 212, 0.4)","&:hover":{bgcolor:"#0D42AF"},"&:disabled":{bgcolor:"#1F2937",color:"#6B7280",boxShadow:"none"}},children:"Save Role"})]})]}),r.jsx(C,{variant:"subtitle1",sx:{color:"#9CA3AF",mb:2,fontWeight:600},children:"Existing Roles"}),r.jsx(G,{spacing:1.5,children:M.map(ee=>r.jsx(Je,{sx:{p:2,bgcolor:"#0C1322",border:"1px solid #374151",borderRadius:"12px",transition:"border-color 0.2s","&:hover":{borderColor:"#4B5563"}},children:r.jsx(G,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:r.jsxs(E,{sx:{width:"100%"},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[r.jsx(C,{variant:"subtitle2",sx:{color:"#fff",fontWeight:600},children:ee.name}),r.jsx(Ve,{size:"small",onClick:()=>oe(ee.id),sx:{color:"#EF4444","&:hover":{bgcolor:"rgba(239, 68, 68, 0.1)"}},children:r.jsx(ss,{fontSize:"small"})})]}),r.jsx(C,{variant:"caption",sx:{color:"#9CA3AF",display:"block",mb:1.5},children:ee.description}),r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:"#6B7280",display:"block",mb:.5},children:"Privileges:"}),r.jsx(G,{direction:"row",spacing:.5,sx:{flexWrap:"wrap",gap:.5},children:ee.privileges?.length>0?ee.privileges.map(X=>r.jsx(Pt,{label:X,size:"small",sx:{height:22,fontSize:"0.7rem",bgcolor:"#1F2937",color:"#D1D5DB",borderRadius:"6px"}},X)):r.jsx(C,{variant:"caption",sx:{color:"#6B7280"},children:"No specific privileges"})})]})]})})},ee.id))})]})]})}),r.jsx(tr,{open:!!j,onClose:()=>A(null),children:r.jsxs(E,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151",boxShadow:24,p:4},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:3},children:[r.jsx(C,{variant:"h6",sx:{color:"#fff",fontWeight:600},children:"Staff Created Successfully!"}),r.jsx(Ve,{onClick:()=>A(null),sx:{color:"#9CA3AF"},children:r.jsx(hs,{})})]}),r.jsx(Wt,{severity:"success",sx:{mb:3},children:"Please save these credentials securely. The password cannot be retrieved later."}),r.jsxs(E,{sx:{bgcolor:"#0C1322",p:2,borderRadius:1,mb:2},children:[r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF",mb:.5},children:"Email:"}),r.jsx(C,{sx:{color:"#fff",fontWeight:600,mb:2},children:j?.email}),r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF",mb:.5},children:"Password:"}),r.jsx(C,{sx:{color:"#10B981",fontWeight:600,fontFamily:"monospace"},children:j?.password})]}),r.jsx(ye,{variant:"contained",fullWidth:!0,startIcon:r.jsx(qee,{}),onClick:ae,sx:{bgcolor:"#1152D4","&:hover":{bgcolor:"#0D42AF"}},children:"Copy Credentials"})]})}),r.jsx(gs,{open:y.open,autoHideDuration:4e3,onClose:ge,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:r.jsx(Wt,{onClose:ge,severity:y.severity,sx:{width:"100%"},children:y.message})})]})},J9=[{id:1,name:"John Doe",email:"john@example.com",status:"Active",enrollments_count:3,last_login_at:"2025-01-14T10:30:00Z"},{id:2,name:"Jane Smith",email:"jane@example.com",status:"Suspended",enrollments_count:1,last_login_at:"2024-12-20T14:15:00Z"},{id:3,name:"Michael Johnson",email:"michael@example.com",status:"Active",enrollments_count:5,last_login_at:"2025-01-15T09:00:00Z"}],Dhe=()=>{const[e,t]=v.useState([]),[n,s]=v.useState(""),[o,a]=v.useState(!0),[l,u]=v.useState(null),[d,f]=v.useState(null),[p,g]=v.useState(!1),[x,b]=v.useState({open:!1,message:"",severity:"success"}),y=v.useCallback(async()=>{a(!0),f(null),g(!1);try{const R=await lT.getAll(),_=R?.data||R||[],z=Array.isArray(_)?_.filter(F=>F.role==="learner"||F.role==="student"):[];z.length>0?t(z):(t(J9),g(!0))}catch(R){console.error("Error fetching learners:",R),t(J9),g(!0),b({open:!0,message:"Using demo data - API endpoint not available",severity:"warning"})}finally{a(!1)}},[]);v.useEffect(()=>{y()},[y]);const S=e.filter(R=>(R.name?.toLowerCase()||"").includes(n.toLowerCase())||(R.email?.toLowerCase()||"").includes(n.toLowerCase())),j=async R=>{if(window.confirm(`Are you sure you want to delete ${R.name}? This action cannot be undone.`)){if(p){t(_=>_.filter(z=>z.id!==R.id)),b({open:!0,message:"Learner deleted (demo mode)",severity:"info"});return}u(R.id);try{await lT.delete(R.id),b({open:!0,message:"Learner deleted successfully",severity:"success"}),await y()}catch(_){console.error("Error deleting learner:",_),b({open:!0,message:_.message||"Failed to delete learner",severity:"error"})}finally{u(null)}}},A=R=>{if(!R)return"Never";try{return new Date(R).toLocaleString()}catch{return R}},M=()=>{b({...x,open:!1})};return r.jsxs(E,{sx:{p:{xs:2,md:4},bgcolor:"#0C1322",minHeight:"calc(100vh - 70px)",width:"100%"},children:[r.jsxs(G,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:2,sx:{mb:4},children:[r.jsxs(E,{children:[r.jsxs(C,{variant:"h4",sx:{color:"#fff",fontWeight:700,mb:1},children:["Learner Management",p&&r.jsx(Pt,{label:"Demo Mode",size:"small",sx:{ml:2,bgcolor:"rgba(245, 158, 11, 0.2)",color:"#F59E0B"}})]}),r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF"},children:"View and manage platform learners."})]}),r.jsx(tn,{title:"Refresh",children:r.jsx(Ve,{onClick:y,disabled:o,sx:{color:"#9CA3AF","&:hover":{bgcolor:"rgba(255,255,255,0.1)"}},children:r.jsx(Ku,{})})})]}),r.jsx(Je,{sx:{p:2,mb:4,bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151"},children:r.jsxs(E,{sx:{bgcolor:"#1F2937",borderRadius:1,px:2,display:"flex",alignItems:"center",gap:1,width:"100%",maxWidth:400,height:"40px"},children:[r.jsx(to,{sx:{color:"#9CA3AF",fontSize:20}}),r.jsx(sr,{placeholder:"Search learners...",value:n,onChange:R=>s(R.target.value),sx:{color:"#FFFFFF",fontSize:"0.9rem",width:"100%","& input":{border:"none",outline:"none","&::placeholder":{color:"#6B7280"}}}})]})}),r.jsx(ko,{component:Je,sx:{bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151"},children:r.jsxs(Eo,{children:[r.jsx(Mo,{children:r.jsxs(Bt,{children:[r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Learner"}),r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Enrolled Courses"}),r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Status"}),r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Last Login"}),r.jsx(je,{align:"right",sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Actions"})]})}),r.jsx(To,{children:o?r.jsx(Bt,{children:r.jsxs(je,{colSpan:5,align:"center",sx:{borderBottom:"1px solid #374151",py:6},children:[r.jsx(nn,{size:40,sx:{color:"#1152D4"}}),r.jsx(C,{sx:{color:"#9CA3AF",mt:2},children:"Loading learners..."})]})}):d?r.jsx(Bt,{children:r.jsxs(je,{colSpan:5,align:"center",sx:{borderBottom:"1px solid #374151",py:4},children:[r.jsx(Wt,{severity:"error",sx:{bgcolor:"transparent",justifyContent:"center"},children:d}),r.jsx(ye,{onClick:y,sx:{mt:2,color:"#1152D4"},children:"Try Again"})]})}):S.length===0?r.jsx(Bt,{children:r.jsxs(je,{colSpan:5,align:"center",sx:{borderBottom:"1px solid #374151",py:6},children:[r.jsx(pz,{sx:{fontSize:48,color:"#374151",mb:2}}),r.jsx(C,{sx:{color:"#9CA3AF"},children:n?"No learners match your search":"No learners found"})]})}):S.map(R=>{const _=l===R.id,z=R.status?.toLowerCase()==="active";return r.jsxs(Bt,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[r.jsx(je,{sx:{color:"#fff",borderBottom:"1px solid #374151"},children:r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(yr,{sx:{width:40,height:40,bgcolor:"#1152D4",fontSize:"0.9rem"},children:R.name?.split(" ").map(F=>F[0]).join("")||"?"}),r.jsxs(E,{children:[r.jsx(C,{variant:"subtitle2",sx:{fontWeight:600,color:"#fff"},children:R.name||"Unknown"}),r.jsx(C,{variant:"caption",sx:{color:"#6B7280"},children:R.email||"No email"})]})]})}),r.jsx(je,{sx:{borderBottom:"1px solid #374151"},children:r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,children:[r.jsx(hr,{sx:{color:"#1152D4",fontSize:18}}),r.jsx(C,{variant:"body2",sx:{color:"#fff",fontWeight:600},children:R.enrollments_count??R.enrolledCourses??0}),r.jsx(C,{variant:"caption",sx:{color:"#6B7280"},children:"courses"})]})}),r.jsx(je,{sx:{borderBottom:"1px solid #374151"},children:r.jsx(Pt,{icon:z?r.jsx(fr,{sx:{fontSize:14}}):r.jsx(_c,{sx:{fontSize:14}}),label:R.status||"Unknown",size:"small",sx:{bgcolor:z?"rgba(16, 185, 129, 0.15)":"rgba(239, 68, 68, 0.15)",color:z?"#10B981":"#EF4444",fontSize:"0.75rem","& .MuiChip-icon":{color:z?"#10B981":"#EF4444"}}})}),r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151"},children:r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF"},children:A(R.last_login_at??R.lastLogin)})}),r.jsx(je,{align:"right",sx:{borderBottom:"1px solid #374151"},children:r.jsxs(G,{direction:"row",spacing:1,justifyContent:"flex-end",children:[r.jsx(tn,{title:"View Profile",children:r.jsx(Ve,{disabled:_,sx:{color:"#3B82F6",bgcolor:"rgba(59, 130, 246, 0.1)","&:hover":{bgcolor:"rgba(59, 130, 246, 0.2)"}},children:r.jsx(Bi,{fontSize:"small"})})}),r.jsx(tn,{title:"Delete Learner",children:r.jsx(Ve,{onClick:()=>j(R),disabled:_,sx:{color:"#EF4444",bgcolor:"rgba(239, 68, 68, 0.1)","&:hover":{bgcolor:"rgba(239, 68, 68, 0.2)"}},children:_?r.jsx(nn,{size:18,sx:{color:"inherit"}}):r.jsx(ss,{fontSize:"small"})})})]})})]},R.id)})})]})}),r.jsx(gs,{open:x.open,autoHideDuration:4e3,onClose:M,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:r.jsx(Wt,{onClose:M,severity:x.severity,sx:{width:"100%"},children:x.message})})]})},ek=["id_front","id_back","certificate","utility_bill","passport"],Ohe=["nin","passport","driver_license","national_id","voter_card","bvn"],Bhe=["secondary_school","diploma","bachelor","master","phd","other"],x0={name:"",email:"",password:"",phone:"",country:"",state:"",city:"",address:"",bio:"",skills:"",highest_education:"",id_type:"",id_number:"",bank_name:"",account_number:"",account_name:"",review_note:"",initial_doc_type:"certificate",initial_doc_file:null},Nhe=e=>String(e||"").split(",").map(t=>t.trim()).filter(Boolean),tk=e=>Array.isArray(e)?e.filter(Boolean).join(", "):"",nk=(e=[],t="")=>{const n=String(t||"").trim();return n?e.includes(n)?e:[...e,n]:e},rk=e=>String(e||"").split("_").filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "),F5=e=>{if(!e)return"Unknown Tutor";const t=String(e.name||"").trim();if(t)return t;const n=String(e.first_name||e.firstName||"").trim(),s=String(e.last_name||e.lastName||"").trim(),o=`${n} ${s}`.trim();if(o)return o;const a=String(e.user?.name||"").trim();return a||String(e.email||e.user?.email||"Unknown Tutor")},_5=e=>e?.kyc?.data||e?.kyc_data||{},sk=e=>Array.isArray(e?.kycDocuments)?e.kycDocuments:Array.isArray(e?.kyc_documents)?e.kyc_documents:Array.isArray(e?.kyc?.documents)?e.kyc.documents:[],$he=e=>String(e?.kyc?.status||e?.kyc_status||e?.status||"unknown").toLowerCase(),Hhe=()=>{const[e,t]=v.useState([]),[n,s]=v.useState(""),[o,a]=v.useState(!0),[l,u]=v.useState(!1),[d,f]=v.useState(null),[p,g]=v.useState(""),[x,b]=v.useState(!1),[y,S]=v.useState(null),[j,A]=v.useState(x0),[M,R]=v.useState(!1),[_,z]=v.useState(!1),[F,N]=v.useState(null),[I,B]=v.useState(!1),[H,P]=v.useState(""),[k,L]=v.useState("certificate"),[O,W]=v.useState(null),[D,q]=v.useState({open:!1,message:"",severity:"success"}),K=v.useCallback(async(X="")=>{a(!0),g("");try{const ve=await ns.listTutors({q:X,per_page:50});t(ve.data||[])}catch(ve){console.error("Failed to fetch admin tutors:",ve),g(ve.message||"Failed to load tutors."),t([])}finally{a(!1)}},[]);v.useEffect(()=>{const X=setTimeout(()=>{K(n)},350);return()=>clearTimeout(X)},[n,K]);const Y=(X,ve="success")=>{q({open:!0,message:X,severity:ve})},ie=()=>{q(X=>({...X,open:!1}))},V=v.useMemo(()=>e.map(X=>{const ve=sk(X),st=$he(X),Ge=_5(X);return{...X,_name:F5(X),_email:X.email||X.user?.email||"-",_phone:X.phone||Ge.phone||"-",_kycStatus:st,_docsCount:ve.length}}),[e]),re=v.useCallback(async(X,{openModal:ve=!1}={})=>{z(!0);try{const st=await ns.getTutorById(X);return N(st),ve&&R(!0),st}catch(st){return console.error("Failed to load tutor detail:",st),Y(st.message||"Failed to load tutor detail.","error"),null}finally{z(!1)}},[]),fe=X=>{const ve=_5(X);return{...x0,name:F5(X),email:String(X.email||X.user?.email||""),phone:String(X.phone||ve.phone||""),country:String(ve.country||""),state:String(ve.state||""),city:String(ve.city||""),address:String(ve.address||""),bio:String(ve.bio||""),skills:tk(ve.skills||X.skills||[]),highest_education:String(ve.highest_education||""),id_type:String(ve.id_type||""),id_number:String(ve.id_number||""),bank_name:String(ve.bank_name||""),account_number:String(ve.account_number||""),account_name:String(ve.account_name||""),review_note:String(ve.review_note||""),password:"",initial_doc_type:"certificate",initial_doc_file:null}},ae=()=>{S(null),A(x0),b(!0)},ue=async X=>{f(X);try{const ve=await ns.getTutorById(X);if(!ve)return;S(ve),A(fe(ve)),b(!0)}catch(ve){console.error("Failed to open edit modal:",ve),Y(ve.message||"Unable to load tutor for editing.","error")}finally{f(null)}},se=X=>{P(X),L("certificate"),W(null),B(!0)},J=async()=>{if((y?["name","phone"]:["name","email","password","phone","country","state","city","address","bio","skills","highest_education","id_type","id_number"]).find(Ge=>!String(j[Ge]||"").trim())){Y("Please fill all required fields.","error");return}const st={name:j.name.trim(),email:j.email.trim(),password:j.password.trim(),phone:j.phone.trim(),country:j.country.trim(),state:j.state.trim(),city:j.city.trim(),address:j.address.trim(),bio:j.bio.trim(),skills:Nhe(j.skills),highest_education:j.highest_education.trim(),id_type:j.id_type.trim(),id_number:j.id_number.trim(),bank_name:j.bank_name.trim(),account_number:j.account_number.trim(),account_name:j.account_name.trim(),review_note:j.review_note.trim()};j.initial_doc_file&&(st.docs=[{type:j.initial_doc_type,file:j.initial_doc_file}]),y&&(delete st.password,st.email||delete st.email),u(!0);try{y?(await ns.updateTutor(y.id,st),Y("Tutor updated successfully.")):(await ns.createTutor(st),Y("Tutor created successfully.")),b(!1),A(x0),await K(n)}catch(Ge){console.error("Failed to save tutor:",Ge),Y(Ge.message||"Failed to save tutor.","error")}finally{u(!1)}},ce=async()=>{if(!H||!k||!O){Y("Please choose a document type and file.","error");return}u(!0);try{await ns.uploadTutorKycDoc(H,{type:k,file:O}),Y("KYC document uploaded successfully."),B(!1),await K(n),F?.id===H&&await re(H)}catch(X){console.error("Failed to upload KYC document:",X),Y(X.message||"Failed to upload document.","error")}finally{u(!1)}},oe=async X=>{if(F?.id&&window.confirm("Delete this KYC document?")){f(X);try{await ns.deleteTutorKycDoc(F.id,X),Y("KYC document removed successfully."),await re(F.id),await K(n)}catch(ve){console.error("Failed to delete KYC document:",ve),Y(ve.message||"Failed to delete document.","error")}finally{f(null)}}},ge=v.useMemo(()=>sk(F),[F]),de=v.useMemo(()=>_5(F),[F]),le=v.useMemo(()=>nk(Ohe,j.id_type),[j.id_type]),ee=v.useMemo(()=>nk(Bhe,j.highest_education),[j.highest_education]);return r.jsxs(E,{sx:{p:{xs:2,md:4},bgcolor:"#0C1322",minHeight:"calc(100vh - 70px)",width:"100%"},children:[r.jsxs(G,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:2,sx:{mb:4},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h4",sx:{color:"#fff",fontWeight:700,mb:1},children:"Tutor Management"}),r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF"},children:"Manage tutors with full KYC profile and supporting documents."})]}),r.jsxs(G,{direction:"row",spacing:1,children:[r.jsx(tn,{title:"Refresh",children:r.jsx(Ve,{onClick:()=>K(n),disabled:o,sx:{color:"#9CA3AF","&:hover":{bgcolor:"rgba(255,255,255,0.08)"}},children:r.jsx(Ku,{})})}),r.jsx(ye,{variant:"contained",startIcon:r.jsx(Br,{}),onClick:ae,sx:os,children:"Add Tutor"})]})]}),r.jsx(Je,{sx:{...Wr,p:2,mb:4},children:r.jsxs(E,{sx:{...xy,maxWidth:420},children:[r.jsx(to,{sx:{color:"#9CA3AF",fontSize:20}}),r.jsx(sr,{placeholder:"Search tutors by name or email...",value:n,onChange:X=>s(X.target.value),sx:by})]})}),r.jsx(ko,{component:Je,sx:Wr,children:r.jsxs(Eo,{children:[r.jsx(Mo,{children:r.jsxs(Bt,{children:[r.jsx(je,{sx:fn,children:"Tutor"}),r.jsx(je,{sx:fn,children:"Email"}),r.jsx(je,{sx:fn,children:"Phone"}),r.jsx(je,{sx:fn,children:"KYC Status"}),r.jsx(je,{sx:fn,children:"Documents"}),r.jsx(je,{align:"right",sx:fn,children:"Actions"})]})}),r.jsx(To,{children:o?r.jsx(Bt,{children:r.jsx(je,{colSpan:6,align:"center",sx:{...Rt,py:7},children:r.jsx(nn,{})})}):p?r.jsx(Bt,{children:r.jsx(je,{colSpan:6,align:"center",sx:{...Rt,py:4},children:r.jsx(Wt,{severity:"error",sx:{bgcolor:"transparent",justifyContent:"center"},children:p})})}):V.length===0?r.jsx(Bt,{children:r.jsx(je,{colSpan:6,align:"center",sx:{...Rt,py:5,color:"#9CA3AF"},children:"No tutors found."})}):V.map(X=>{const ve=d===X.id,st=X._kycStatus==="approved"?"#10B981":X._kycStatus==="submitted"?"#F59E0B":"#9CA3AF";return r.jsxs(Bt,{children:[r.jsx(je,{sx:Rt,children:r.jsxs(G,{direction:"row",alignItems:"center",spacing:1.5,children:[r.jsx(yr,{sx:{bgcolor:"#1152D4",width:36,height:36},children:(X._name||"?").charAt(0).toUpperCase()}),r.jsx(C,{sx:{color:"#fff",fontWeight:600},children:X._name})]})}),r.jsx(je,{sx:{...Rt,color:"#D1D5DB"},children:X._email}),r.jsx(je,{sx:{...Rt,color:"#D1D5DB"},children:X._phone}),r.jsx(je,{sx:Rt,children:r.jsx(C,{sx:{color:st,textTransform:"capitalize",fontWeight:600},children:X._kycStatus})}),r.jsx(je,{sx:{...Rt,color:"#D1D5DB"},children:X._docsCount}),r.jsx(je,{align:"right",sx:Rt,children:r.jsxs(G,{direction:"row",spacing:1,justifyContent:"flex-end",children:[r.jsx(tn,{title:"View Details",children:r.jsx("span",{children:r.jsx(Ve,{onClick:()=>re(X.id,{openModal:!0}),sx:{color:"#3B82F6"},disabled:ve,children:r.jsx(Bi,{fontSize:"small"})})})}),r.jsx(tn,{title:"Edit Tutor",children:r.jsx("span",{children:r.jsx(Ve,{onClick:()=>ue(X.id),sx:{color:"#F59E0B"},disabled:ve,children:r.jsx(Ws,{fontSize:"small"})})})}),r.jsx(tn,{title:"Upload KYC Doc",children:r.jsx("span",{children:r.jsx(Ve,{onClick:()=>se(X.id),sx:{color:"#10B981"},disabled:ve,children:r.jsx(h8,{fontSize:"small"})})})})]})})]},X.id)})})]})}),r.jsx(tr,{open:x,onClose:()=>!l&&b(!1),children:r.jsxs(E,{sx:{...kr,width:{xs:"95%",md:820},maxHeight:"90vh",display:"flex",flexDirection:"column"},children:[r.jsxs(G,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{p:2.5,borderBottom:"1px solid #374151"},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:700,fontSize:"1.05rem"},children:y?"Update Tutor":"Create Tutor"}),r.jsx(Ve,{onClick:()=>!l&&b(!1),sx:{color:"#9CA3AF"},children:r.jsx(hs,{})})]}),r.jsx(E,{sx:{p:2.5,overflowY:"auto"},children:r.jsxs(G,{spacing:2,children:[r.jsxs(G,{direction:{xs:"column",md:"row"},spacing:2,children:[r.jsx(it,{label:"Name",value:j.name,onChange:X=>A(ve=>({...ve,name:X.target.value})),fullWidth:!0,sx:xt}),r.jsx(it,{label:"Email",value:j.email,onChange:X=>A(ve=>({...ve,email:X.target.value})),fullWidth:!0,sx:xt,disabled:!!y})]}),r.jsxs(G,{direction:{xs:"column",md:"row"},spacing:2,children:[r.jsx(it,{label:y?"Password (optional)":"Password",type:"password",value:j.password,onChange:X=>A(ve=>({...ve,password:X.target.value})),fullWidth:!0,sx:xt}),r.jsx(it,{label:"Phone",value:j.phone,onChange:X=>A(ve=>({...ve,phone:X.target.value})),fullWidth:!0,sx:xt})]}),r.jsxs(G,{direction:{xs:"column",md:"row"},spacing:2,children:[r.jsx(it,{label:"Country",value:j.country,onChange:X=>A(ve=>({...ve,country:X.target.value})),fullWidth:!0,sx:xt}),r.jsx(it,{label:"State",value:j.state,onChange:X=>A(ve=>({...ve,state:X.target.value})),fullWidth:!0,sx:xt}),r.jsx(it,{label:"City",value:j.city,onChange:X=>A(ve=>({...ve,city:X.target.value})),fullWidth:!0,sx:xt})]}),r.jsx(it,{label:"Address",value:j.address,onChange:X=>A(ve=>({...ve,address:X.target.value})),fullWidth:!0,sx:xt}),r.jsx(it,{label:"Bio",value:j.bio,onChange:X=>A(ve=>({...ve,bio:X.target.value})),fullWidth:!0,minRows:2,multiline:!0,sx:xt}),r.jsxs(G,{direction:{xs:"column",md:"row"},spacing:2,children:[r.jsx(it,{label:"Skills (comma separated)",value:j.skills,onChange:X=>A(ve=>({...ve,skills:X.target.value})),fullWidth:!0,sx:xt}),r.jsxs(Ur,{fullWidth:!0,children:[r.jsx(rs,{sx:{color:"#9CA3AF"},children:"Highest Education"}),r.jsx(Fn,{label:"Highest Education",value:j.highest_education,onChange:X=>A(ve=>({...ve,highest_education:X.target.value})),sx:Yn,MenuProps:Tr,children:ee.map(X=>r.jsx(It,{value:X,children:rk(X)},X))})]})]}),r.jsxs(G,{direction:{xs:"column",md:"row"},spacing:2,children:[r.jsxs(Ur,{fullWidth:!0,children:[r.jsx(rs,{sx:{color:"#9CA3AF"},children:"ID Type"}),r.jsx(Fn,{label:"ID Type",value:j.id_type,onChange:X=>A(ve=>({...ve,id_type:X.target.value})),sx:Yn,MenuProps:Tr,children:le.map(X=>r.jsx(It,{value:X,children:rk(X)},X))})]}),r.jsx(it,{label:"ID Number",value:j.id_number,onChange:X=>A(ve=>({...ve,id_number:X.target.value})),fullWidth:!0,sx:xt})]}),r.jsxs(G,{direction:{xs:"column",md:"row"},spacing:2,children:[r.jsx(it,{label:"Bank Name",value:j.bank_name,onChange:X=>A(ve=>({...ve,bank_name:X.target.value})),fullWidth:!0,sx:xt}),r.jsx(it,{label:"Account Number",value:j.account_number,onChange:X=>A(ve=>({...ve,account_number:X.target.value})),fullWidth:!0,sx:xt}),r.jsx(it,{label:"Account Name",value:j.account_name,onChange:X=>A(ve=>({...ve,account_name:X.target.value})),fullWidth:!0,sx:xt})]}),r.jsx(it,{label:"Review Note",value:j.review_note,onChange:X=>A(ve=>({...ve,review_note:X.target.value})),fullWidth:!0,minRows:2,multiline:!0,sx:xt}),!y&&r.jsxs(G,{direction:{xs:"column",md:"row"},spacing:2,children:[r.jsxs(Ur,{fullWidth:!0,children:[r.jsx(rs,{sx:{color:"#9CA3AF"},children:"Initial Doc Type"}),r.jsx(Fn,{label:"Initial Doc Type",value:j.initial_doc_type,onChange:X=>A(ve=>({...ve,initial_doc_type:X.target.value})),sx:Yn,MenuProps:Tr,children:ek.map(X=>r.jsx(It,{value:X,children:X},X))})]}),r.jsxs(ye,{component:"label",variant:"outlined",sx:{borderColor:"#374151",color:"#E5E7EB",textTransform:"none",minHeight:56,"&:hover":{borderColor:"#4B5563",bgcolor:"rgba(255,255,255,0.03)"}},children:[j.initial_doc_file?j.initial_doc_file.name:"Attach Initial KYC Doc (optional)",r.jsx("input",{hidden:!0,type:"file",onChange:X=>{const ve=X.target.files?.[0]||null;A(st=>({...st,initial_doc_file:ve}))}})]})]})]})}),r.jsxs(G,{direction:"row",justifyContent:"flex-end",spacing:1.5,sx:{p:2.5,borderTop:"1px solid #374151"},children:[r.jsx(ye,{onClick:()=>b(!1),disabled:l,sx:{color:"#9CA3AF",textTransform:"none"},children:"Cancel"}),r.jsx(ye,{variant:"contained",onClick:J,disabled:l,sx:os,children:l?"Saving...":y?"Update Tutor":"Create Tutor"})]})]})}),r.jsx(tr,{open:M,onClose:()=>R(!1),children:r.jsxs(E,{sx:{...kr,width:{xs:"95%",md:760},maxHeight:"90vh",display:"flex",flexDirection:"column"},children:[r.jsxs(G,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{p:2.5,borderBottom:"1px solid #374151"},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:700,fontSize:"1.05rem"},children:"Tutor Details"}),r.jsx(Ve,{onClick:()=>R(!1),sx:{color:"#9CA3AF"},children:r.jsx(hs,{})})]}),r.jsx(E,{sx:{p:2.5,overflowY:"auto"},children:_?r.jsx(E,{sx:{py:6,display:"flex",justifyContent:"center"},children:r.jsx(nn,{})}):F?r.jsxs(G,{spacing:2.5,children:[r.jsxs(Je,{sx:{...Wr,p:2},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:700,mb:1.5},children:F5(F)}),r.jsxs(C,{sx:{color:"#D1D5DB",fontSize:"0.9rem"},children:["Email: ",F.email||F.user?.email||"-"]}),r.jsxs(C,{sx:{color:"#D1D5DB",fontSize:"0.9rem"},children:["Phone: ",F.phone||de.phone||"-"]}),r.jsxs(C,{sx:{color:"#D1D5DB",fontSize:"0.9rem",textTransform:"capitalize"},children:["KYC Status: ",F.kyc?.status||F.kyc_status||"unknown"]})]}),r.jsxs(Je,{sx:{...Wr,p:2},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:700,mb:1.5},children:"KYC Profile"}),r.jsxs(C,{sx:{color:"#D1D5DB",fontSize:"0.9rem"},children:["Country: ",de.country||"-"]}),r.jsxs(C,{sx:{color:"#D1D5DB",fontSize:"0.9rem"},children:["State: ",de.state||"-"]}),r.jsxs(C,{sx:{color:"#D1D5DB",fontSize:"0.9rem"},children:["City: ",de.city||"-"]}),r.jsxs(C,{sx:{color:"#D1D5DB",fontSize:"0.9rem"},children:["Address: ",de.address||"-"]}),r.jsxs(C,{sx:{color:"#D1D5DB",fontSize:"0.9rem"},children:["Skills: ",tk(de.skills)||"-"]}),r.jsxs(C,{sx:{color:"#D1D5DB",fontSize:"0.9rem"},children:["Highest Education: ",de.highest_education||"-"]})]}),r.jsxs(Je,{sx:{...Wr,p:2},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:1.5},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:700},children:"KYC Documents"}),r.jsx(ye,{size:"small",startIcon:r.jsx(h8,{}),onClick:()=>{R(!1),se(F.id)},sx:{color:"#10B981",textTransform:"none"},children:"Add Document"})]}),ge.length===0?r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.9rem"},children:"No documents uploaded."}):r.jsx(G,{spacing:1,children:ge.map(X=>{const ve=X.url||X.file_url||X.path||"";return r.jsxs(G,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,sx:{p:1.25,borderRadius:1,bgcolor:"#0F1729",border:"1px solid #374151"},children:[r.jsxs(G,{spacing:.25,children:[r.jsx(C,{sx:{color:"#E5E7EB",fontWeight:600,fontSize:"0.9rem"},children:X.type||"document"}),r.jsxs(C,{sx:{color:"#9CA3AF",fontSize:"0.8rem"},children:["ID: ",X.id]}),ve?r.jsx("a",{href:ve,target:"_blank",rel:"noreferrer",style:{color:"#60A5FA",fontSize:"0.8rem"},children:"View file"}):null]}),r.jsx(ye,{size:"small",color:"error",startIcon:r.jsx(ss,{}),disabled:d===X.id,onClick:()=>oe(X.id),sx:{textTransform:"none"},children:"Remove"})]},X.id)})})]})]}):r.jsx(C,{sx:{color:"#9CA3AF"},children:"No tutor selected."})})]})}),r.jsx(tr,{open:I,onClose:()=>!l&&B(!1),children:r.jsxs(E,{sx:{...kr,width:{xs:"95%",md:520}},children:[r.jsxs(G,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{p:2.5,borderBottom:"1px solid #374151"},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:700},children:"Upload KYC Document"}),r.jsx(Ve,{onClick:()=>!l&&B(!1),sx:{color:"#9CA3AF"},children:r.jsx(hs,{})})]}),r.jsxs(G,{spacing:2,sx:{p:2.5},children:[r.jsxs(Ur,{fullWidth:!0,children:[r.jsx(rs,{sx:{color:"#9CA3AF"},children:"Document Type"}),r.jsx(Fn,{value:k,label:"Document Type",onChange:X=>L(X.target.value),sx:Yn,MenuProps:Tr,children:ek.map(X=>r.jsx(It,{value:X,children:X},X))})]}),r.jsxs(ye,{component:"label",variant:"outlined",startIcon:r.jsx(Iee,{}),sx:{borderColor:"#374151",color:"#E5E7EB",textTransform:"none",justifyContent:"flex-start","&:hover":{borderColor:"#4B5563",bgcolor:"rgba(255,255,255,0.03)"}},children:[O?O.name:"Choose File",r.jsx("input",{hidden:!0,type:"file",onChange:X=>W(X.target.files?.[0]||null)})]}),r.jsxs(G,{direction:"row",justifyContent:"flex-end",spacing:1.5,sx:{pt:1},children:[r.jsx(ye,{onClick:()=>B(!1),disabled:l,sx:{color:"#9CA3AF",textTransform:"none"},children:"Cancel"}),r.jsx(ye,{variant:"contained",onClick:ce,disabled:l,sx:os,children:l?"Uploading...":"Upload"})]})]})]})}),r.jsx(gs,{open:D.open,autoHideDuration:3500,onClose:ie,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:r.jsx(Wt,{severity:D.severity,onClose:ie,variant:"filled",children:D.message})})]})},b0=e=>e?e.data||e.reviewer||e:null,ok=e=>e?Array.isArray(e)?{data:e,meta:{},links:{}}:{data:e.data||e.reviewers||[],meta:e.meta||{},links:e.links||{}}:{data:[],meta:{},links:{}},bp={listMyLogs:async({page:e,per_page:t=20}={})=>{const n=new URLSearchParams;e&&n.append("page",e),t&&n.append("per_page",t);const s=n.toString(),o=s?`/reviewer/logs?${s}`:"/reviewer/logs",a=await ke.get(o);return ok(a)},createLog:async e=>{const t=await ke.post("/reviewer/logs",e);return b0(t)},listReviewers:async({search:e,status:t,page:n,per_page:s}={})=>{const o=new URLSearchParams;e&&o.append("search",e),t&&o.append("status",t),n&&o.append("page",n),s&&o.append("per_page",s);const a=o.toString(),l=a?`/reviewers?${a}`:"/reviewers",u=await ke.get(l);return ok(u)},createReviewer:async e=>await ke.post("/reviewers",e),getReviewerById:async e=>{const t=await ke.get(`/reviewers/${e}`);return b0(t)},updateReviewer:async(e,t)=>{const n=await ke.put(`/reviewers/${e}`,t);return b0(n)},updateStatus:async(e,t)=>{const n=await ke.patch(`/reviewers/${e}/status`,{status:t});return b0(n)},deleteReviewer:async e=>({success:!0,...await ke.delete(`/reviewers/${e}`)})},Whe=()=>{const[e,t]=v.useState([]),[n,s]=v.useState(""),[o,a]=v.useState(!0),[l,u]=v.useState(null),[d,f]=v.useState(!1),[p,g]=v.useState(null),[x,b]=v.useState(!1),[y,S]=v.useState({first_name:"",last_name:"",email:"",phone:"",specialization:"",max_assignments:"",can_publish:!1,status:"Active"}),[j,A]=v.useState(null),[M,R]=v.useState({open:!1,message:"",severity:"success"}),_=v.useCallback(async()=>{a(!0),g(null);try{const W=(await bp.listReviewers())?.data||[];t(W)}catch(O){console.error("Error fetching reviewers:",O),g(O.message||"Failed to load reviewers"),R({open:!0,message:"Failed to load reviewers from API",severity:"error"})}finally{a(!1)}},[]);v.useEffect(()=>{_()},[_]);const z=e.filter(O=>(O.name?.toLowerCase()||"").includes(n.toLowerCase())||(O.email?.toLowerCase()||"").includes(n.toLowerCase())),F=()=>{S({first_name:"",last_name:"",email:"",phone:"",specialization:"",max_assignments:"",can_publish:!1,status:"Active"}),A(null),b(!0)},N=O=>{O.first_name&&O.last_name?`${O.first_name}${O.last_name}`:O.user?.name||O.name,S({first_name:O.first_name||O.user?.name?.split(" ")?.[0]||"",last_name:O.last_name||O.user?.name?.split(" ")?.slice(1).join(" ")||"",email:O.user?.email||O.email||"",phone:O.phone||"",specialization:O.specialization||"",max_assignments:O.max_assignments??O.tasks_count??"",can_publish:!!O.can_publish,status:O.status||"Active"}),A(O),b(!0)},I=()=>{b(!1),S({first_name:"",last_name:"",email:"",phone:"",specialization:"",max_assignments:"",can_publish:!1,status:"Active"})},B=async()=>{const O=W=>String(W??"").trim();if(!O(y.first_name)||!O(y.last_name)||!O(y.email)||!O(y.phone)||!O(y.specialization)||!O(y.max_assignments)){R({open:!0,message:"All fields are required",severity:"error"});return}f(!0);try{const W={email:y.email,first_name:y.first_name,last_name:y.last_name,phone:y.phone,specialization:y.specialization,max_assignments:Number(y.max_assignments),can_publish:!!y.can_publish,status:y.status||"Active"};await bp.createReviewer(W),R({open:!0,message:"Reviewer created successfully",severity:"success"}),I(),await _()}catch(W){console.error("Error creating reviewer:",W),R({open:!0,message:W.message||"Failed to create reviewer",severity:"error"})}finally{f(!1)}},H=async()=>{if(!j)return;const O=W=>String(W??"").trim();if(!O(y.first_name)||!O(y.last_name)||!O(y.email)||!O(y.phone)||!O(y.specialization)||!O(y.max_assignments)){R({open:!0,message:"All fields are required",severity:"error"});return}f(!0);try{const W={first_name:y.first_name,last_name:y.last_name,phone:y.phone,specialization:y.specialization,max_assignments:Number(y.max_assignments),can_publish:!!y.can_publish,status:y.status||void 0};await bp.updateReviewer(j.id,W),R({open:!0,message:"Reviewer updated successfully",severity:"success"}),I(),A(null),await _()}catch(W){console.error("Error updating reviewer:",W),R({open:!0,message:W.message||"Failed to update reviewer",severity:"error"})}finally{f(!1)}},P=async O=>{if(window.confirm(`Are you sure you want to delete ${O.first_name||O.name||"this reviewer"}? This action cannot be undone.`)){u(O.id);try{await bp.deleteReviewer(O.id),R({open:!0,message:"Reviewer deleted successfully",severity:"success"}),await _()}catch(W){console.error("Error deleting reviewer:",W),R({open:!0,message:W.message||"Failed to delete reviewer",severity:"error"})}finally{u(null)}}},k=async O=>{const D=(O.status||"Active")==="Active"?"Inactive":"Active";u(O.id);try{await bp.updateStatus(O.id,D),R({open:!0,message:`Reviewer ${D==="Active"?"activated":"deactivated"} successfully`,severity:"success"}),await _()}catch(q){console.error("Error updating reviewer status:",q),R({open:!0,message:q.message||"Failed to update status",severity:"error"})}finally{u(null)}},L=()=>{R({...M,open:!1})};return r.jsxs(E,{sx:{p:{xs:2,md:4},bgcolor:"#0C1322",minHeight:"calc(100vh - 70px)",width:"100%"},children:[r.jsxs(G,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:2,sx:{mb:4},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h4",sx:{color:"#fff",fontWeight:700,mb:1},children:"Reviewer Management"}),r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF"},children:"Manage content reviewers and their access."})]}),r.jsxs(G,{direction:"row",spacing:1,children:[r.jsx(tn,{title:"Refresh",children:r.jsx(Ve,{onClick:_,disabled:o,sx:{color:"#9CA3AF","&:hover":{bgcolor:"rgba(255,255,255,0.1)"}},children:r.jsx(Ku,{})})}),r.jsx(ye,{variant:"contained",startIcon:r.jsx(Br,{}),onClick:F,sx:{bgcolor:"#1152D4","&:hover":{bgcolor:"#0D42AF"},boxShadow:"0 4px 14px rgba(17, 82, 212, 0.4)"},children:"Add Reviewer"})]})]}),r.jsx(Je,{sx:{p:2,mb:4,bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151"},children:r.jsxs(E,{sx:{bgcolor:"#1F2937",borderRadius:1,px:2,display:"flex",alignItems:"center",gap:1,width:"100%",maxWidth:400,height:"40px"},children:[r.jsx(to,{sx:{color:"#9CA3AF",fontSize:20}}),r.jsx(sr,{placeholder:"Search reviewers...",value:n,onChange:O=>s(O.target.value),sx:{color:"#FFFFFF",fontSize:"0.9rem",width:"100%","& input":{border:"none",outline:"none","&::placeholder":{color:"#6B7280"}}}})]})}),r.jsx(ko,{component:Je,sx:{bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151"},children:r.jsxs(Eo,{children:[r.jsx(Mo,{children:r.jsxs(Bt,{children:[r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Reviewer"}),r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Assigned Tasks"}),r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Status"}),r.jsx(je,{align:"right",sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Actions"})]})}),r.jsx(To,{children:o?r.jsx(Bt,{children:r.jsxs(je,{colSpan:4,align:"center",sx:{borderBottom:"1px solid #374151",py:6},children:[r.jsx(nn,{size:40,sx:{color:"#F59E0B"}}),r.jsx(C,{sx:{color:"#9CA3AF",mt:2},children:"Loading reviewers..."})]})}):p?r.jsx(Bt,{children:r.jsxs(je,{colSpan:4,align:"center",sx:{borderBottom:"1px solid #374151",py:4},children:[r.jsx(Wt,{severity:"error",sx:{bgcolor:"transparent",justifyContent:"center"},children:p}),r.jsx(ye,{onClick:_,sx:{mt:2,color:"#F59E0B"},children:"Try Again"})]})}):z.length===0?r.jsx(Bt,{children:r.jsxs(je,{colSpan:4,align:"center",sx:{borderBottom:"1px solid #374151",py:6},children:[r.jsx(s8,{sx:{fontSize:48,color:"#374151",mb:2}}),r.jsx(C,{sx:{color:"#9CA3AF"},children:n?"No reviewers match your search":'No reviewers found. Click "Add Reviewer" to create one.'})]})}):z.map(O=>{const W=l===O.id,D=(O.status||"Active").toLowerCase()==="active",q=O.first_name&&O.last_name?`${O.first_name} ${O.last_name}`:O.user?.name||O.name||"Unknown",K=O.user?.email||O.email||"No email",Y=q.split(" ").map(ie=>ie[0]).join("").toUpperCase()||"?";return r.jsxs(Bt,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[r.jsx(je,{sx:{color:"#fff",borderBottom:"1px solid #374151"},children:r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(yr,{sx:{width:40,height:40,bgcolor:"#F59E0B",fontSize:"0.9rem"},children:Y}),r.jsxs(E,{children:[r.jsx(C,{variant:"subtitle2",sx:{fontWeight:600,color:"#fff"},children:q}),r.jsxs(C,{variant:"caption",sx:{color:"#6B7280"},children:[K,O.specialization&&` • ${O.specialization}`]})]})]})}),r.jsx(je,{sx:{borderBottom:"1px solid #374151"},children:r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,children:[r.jsx(s8,{sx:{color:"#F59E0B",fontSize:18}}),r.jsx(C,{variant:"body2",sx:{color:"#fff",fontWeight:600},children:O.max_assignments??O.tasks_count??0}),r.jsx(C,{variant:"caption",sx:{color:"#6B7280"},children:"max tasks"})]})}),r.jsx(je,{sx:{borderBottom:"1px solid #374151"},children:r.jsx(Pt,{icon:D?r.jsx(fr,{sx:{fontSize:14}}):r.jsx(_c,{sx:{fontSize:14}}),label:O.status||"Active",size:"small",sx:{bgcolor:D?"rgba(16, 185, 129, 0.15)":"rgba(239, 68, 68, 0.15)",color:D?"#10B981":"#EF4444",fontSize:"0.75rem",cursor:"pointer","& .MuiChip-icon":{color:D?"#10B981":"#EF4444"},"&:hover":{bgcolor:D?"rgba(16, 185, 129, 0.25)":"rgba(239, 68, 68, 0.25)"}},onClick:()=>k(O)})}),r.jsx(je,{align:"right",sx:{borderBottom:"1px solid #374151"},children:r.jsxs(G,{direction:"row",spacing:1,justifyContent:"flex-end",children:[r.jsx(tn,{title:D?"Deactivate":"Activate",children:r.jsx(Ve,{onClick:()=>k(O),disabled:W,sx:{color:D?"#EF4444":"#10B981",bgcolor:D?"rgba(239, 68, 68, 0.1)":"rgba(16, 185, 129, 0.1)","&:hover":{bgcolor:D?"rgba(239, 68, 68, 0.2)":"rgba(16, 185, 129, 0.2)"}},children:D?r.jsx(_c,{fontSize:"small"}):r.jsx(fr,{fontSize:"small"})})}),r.jsx(tn,{title:"View Profile",children:r.jsx(Ve,{disabled:W,sx:{color:"#3B82F6",bgcolor:"rgba(59, 130, 246, 0.1)","&:hover":{bgcolor:"rgba(59, 130, 246, 0.2)"}},children:r.jsx(Bi,{fontSize:"small"})})}),r.jsx(tn,{title:"Edit Reviewer",children:r.jsx(Ve,{onClick:()=>N(O),disabled:W,sx:{color:"#F59E0B",bgcolor:"rgba(245, 158, 11, 0.08)","&:hover":{bgcolor:"rgba(245, 158, 11, 0.14)"}},children:r.jsx(Ws,{fontSize:"small"})})}),r.jsx(tn,{title:"Delete Reviewer",children:r.jsx(Ve,{onClick:()=>P(O),disabled:W,sx:{color:"#EF4444",bgcolor:"rgba(239, 68, 68, 0.1)","&:hover":{bgcolor:"rgba(239, 68, 68, 0.2)"}},children:W?r.jsx(nn,{size:18,sx:{color:"inherit"}}):r.jsx(ss,{fontSize:"small"})})})]})})]},O.id)})})]})}),r.jsx(tr,{open:x,onClose:I,children:r.jsxs(E,{sx:kr,children:[r.jsxs(E,{sx:{background:"#195fcfff",p:3,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(Mb,{sx:{color:"#fff",fontSize:28}}),r.jsx(C,{variant:"h6",sx:{color:"#fff",fontWeight:600},children:"Add New Reviewer"})]}),r.jsx(Ve,{onClick:I,sx:{color:"#fff","&:hover":{bgcolor:"rgba(255,255,255,0.1)"}},children:r.jsx(hs,{})})]}),r.jsx(E,{sx:{p:3},children:r.jsxs(G,{spacing:2.5,children:[r.jsxs(G,{direction:{xs:"column",sm:"row"},spacing:2,children:[r.jsxs(E,{sx:{flex:1},children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"First Name"}),r.jsx(it,{fullWidth:!0,placeholder:"First name",value:y.first_name,onChange:O=>S({...y,first_name:O.target.value}),sx:xt})]}),r.jsxs(E,{sx:{flex:1},children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Last Name"}),r.jsx(it,{fullWidth:!0,placeholder:"Last name",value:y.last_name,onChange:O=>S({...y,last_name:O.target.value}),sx:xt})]})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Email Address"}),r.jsx(it,{fullWidth:!0,placeholder:"reviewer@example.com",value:y.email,onChange:O=>S({...y,email:O.target.value}),sx:xt})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Phone"}),r.jsx(it,{fullWidth:!0,type:"number",placeholder:"e.g. 08022223333",value:y.phone,onChange:O=>S({...y,phone:O.target.value}),sx:xt})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Specialization"}),r.jsx(it,{fullWidth:!0,placeholder:"e.g. Tutor Videos",value:y.specialization,onChange:O=>S({...y,specialization:O.target.value}),sx:xt})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Max Assignments"}),r.jsx(it,{fullWidth:!0,type:"number",placeholder:"e.g. 10",value:y.max_assignments,onChange:O=>S({...y,max_assignments:O.target.value}),sx:xt})]}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,sx:{mt:.5},children:[r.jsxs(Ur,{sx:{minWidth:140},children:[r.jsx(rs,{sx:{color:"#9CA3AF"},children:"Status"}),r.jsxs(Fn,{value:y.status,label:"Status",onChange:O=>S({...y,status:O.target.value}),sx:{color:"#fff","& .MuiSelect-icon":{color:"#9CA3AF"}},children:[r.jsx(It,{value:"Active",children:"Active"}),r.jsx(It,{value:"Inactive",children:"Inactive"})]})]}),r.jsx(vb,{control:r.jsx($f,{checked:!!y.can_publish,onChange:O=>S({...y,can_publish:O.target.checked}),sx:{color:"#195fcfff"}}),label:r.jsx(C,{sx:{color:"#E5E7EB"},children:"Can Publish"})})]}),r.jsx(ye,{variant:"contained",fullWidth:!0,onClick:j?H:B,disabled:String(y.first_name??"").trim()===""||String(y.last_name??"").trim()===""||String(y.email??"").trim()===""||String(y.phone??"").trim()===""||String(y.specialization??"").trim()===""||String(y.max_assignments??"").trim()===""||d,sx:{bgcolor:"#195fcfff",py:1.5,borderRadius:1.5,fontWeight:600,fontSize:"0.875rem",boxShadow:"0 4px 14px rgba(25, 95, 207, 0.4)","&:hover":{bgcolor:"#195fcfff"},"&:disabled":{bgcolor:"#1F2937",color:"#6B7280",boxShadow:"none"}},children:d?r.jsx(nn,{size:20,sx:{color:"#fff"}}):j?"Update Reviewer":"Create Reviewer"})]})})]})}),r.jsx(gs,{open:M.open,autoHideDuration:4e3,onClose:L,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:r.jsx(Wt,{onClose:L,severity:M.severity,sx:{width:"100%"},children:M.message})})]})},ik=async({status:e,role:t,q:n="",page:s=1}={})=>{const o=new URLSearchParams;return e&&o.append("status",e),t&&o.append("role",t),n!==void 0&&o.append("q",n),s&&o.append("page",String(s)),ke.get(`/admin/kyc?${o.toString()}`)},ak=async e=>ke.get(`/admin/kyc/${e}`),Uhe=async(e,t="Approved.")=>ke.post(`/admin/kyc/${e}/approve`,{review_note:t}),qhe=async(e,t)=>ke.post(`/admin/kyc/${e}/reject`,{review_note:t}),Ji=e=>e?e.data?e.data:e:null,lk=e=>e?{data:e.data||[],meta:e.meta||{},links:e.links||{}}:{data:[],meta:{},links:{}},Dr={listCourses:async({page:e,per_page:t=20,q:n,status:s,level:o,language:a,with_categories:l=1,with_tutor:u=1,with_audit:d=1}={})=>{const f=new URLSearchParams;e&&f.append("page",e),t&&f.append("per_page",t),n&&f.append("q",n),s&&f.append("status",s),o&&f.append("level",o),a&&f.append("language",a),l&&f.append("with_categories",l),u&&f.append("with_tutor",u),d&&f.append("with_audit",d);const p=await ke.get(`/lms/courses?${f.toString()}`);return lk(p)},getCourseDetail:async e=>{const t=await ke.get(`/lms/courses/${e}`);return Ji(t)},getCourseModules:async e=>{const t=await ke.get(`/lms/courses/${e}/modules?with_lessons=1`);return t.data||t||[]},approveCourse:async e=>{const t=await ke.post(`/lms/courses/${e}/approve`);return Ji(t)},rejectCourse:async(e,t)=>{const n=await ke.post(`/lms/courses/${e}/reject`,{reason:t});return n&&(n.data||n.id)?Ji(n):{success:!0}},updateCourse:async(e,t)=>{const n=await ke.put(`/lms/courses/${e}`,t);return Ji(n)},deleteCourse:async e=>({success:!0,...await ke.delete(`/lms/courses/${e}`)}),listPriceChanges:async({status:e="pending",page:t,per_page:n=20,with_course:s=1}={})=>{const o=new URLSearchParams;return e&&o.append("status",e),t&&o.append("page",t),n&&o.append("per_page",n),s&&o.append("with_course",s),await ke.get(`/lms/certificate-price-changes?${o.toString()}`)},approvePriceChange:async e=>await ke.post(`/lms/certificate-price-changes/${e}/approve`),rejectPriceChange:async(e,t)=>await ke.post(`/lms/certificate-price-changes/${e}/reject`,{rejection_reason:t}),createModule:async(e,t)=>{const n=await ke.post(`/lms/courses/${e}/modules`,t);return Ji(n)},updateModule:async(e,t)=>{const n=await ke.put(`/lms/modules/${e}`,t);return Ji(n)},deleteModule:async e=>({success:!0,...await ke.delete(`/lms/modules/${e}`)}),listLessons:async e=>{const t=await ke.get(`/lms/modules/${e}/lessons`);return lk(t)},createLesson:async(e,t)=>{const n=await ke.post(`/lms/modules/${e}/lessons`,t);return Ji(n)},deleteLesson:async e=>({success:!0,...await ke.delete(`/lms/lessons/${e}`)}),publishLesson:async(e,t)=>{const n=await ke.post(`/lms/modules/${e}/lessons/${t}/publish`);return Ji(n)},unpublishLesson:async(e,t)=>{const n=await ke.post(`/lms/modules/${e}/lessons/${t}/unpublish`);return Ji(n)},uploadLessonMedia:async(e,t)=>{const n="/api",s=localStorage.getItem("user"),o=s?JSON.parse(s).token:null,a={Accept:"application/json"};o&&(a.Authorization=`Bearer ${o}`);const l=await fetch(`${n}/lms/lessons/${e}/media`,{method:"POST",headers:a,body:t});if(!l.ok){let u="Upload failed";try{u=(await l.json()).message||u}catch{}throw new Error(u)}return l.status===204?null:l.json()},publishModule:async(e,t)=>{const n=await ke.post(`/lms/courses/${e}/modules/${t}/publish`);return Ji(n)},unpublishModule:async(e,t)=>{const n=await ke.post(`/lms/courses/${e}/modules/${t}/unpublish`);return Ji(n)}},Vhe=()=>{const e=Dn(),[t,n]=v.useState([]),[s,o]=v.useState(!0),[a,l]=v.useState(""),[u,d]=v.useState({});v.useEffect(()=>{const p=async()=>{o(!0);try{const[x,b]=await Promise.all([Dr.listCourses({q:a}),Dr.listPriceChanges({status:"pending"})]);n(x.data||[]);const y={};(b?.data||b||[]).forEach(S=>{y[S.course_id]=S}),d(y)}catch(x){console.error("Failed to fetch data:",x)}finally{o(!1)}},g=setTimeout(()=>{p()},500);return()=>clearTimeout(g)},[a]);const f=p=>{e(`/admin/content/courses/${p.id}`)};return r.jsxs(E,{sx:{p:{xs:2,md:4},bgcolor:"#0C1322",minHeight:"calc(100vh - 70px)",width:"100%"},children:[r.jsx(G,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:2,sx:{mb:4},children:r.jsxs(E,{children:[r.jsx(C,{variant:"h4",sx:{color:"#fff",fontWeight:700,mb:1},children:"Course Management"}),r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF"},children:"Manage all courses, view content, and control course status."})]})}),r.jsx(Je,{sx:{...Wr,p:2,mb:4},children:r.jsxs(E,{sx:{...xy,maxWidth:400},children:[r.jsx(to,{sx:{color:"#9CA3AF",fontSize:20}}),r.jsx(sr,{placeholder:"Search courses, tutors, categories...",value:a,onChange:p=>l(p.target.value),sx:by})]})}),r.jsx(ko,{component:Je,sx:Wr,children:r.jsxs(Eo,{children:[r.jsx(Mo,{children:r.jsxs(Bt,{children:[r.jsx(je,{sx:fn,children:"Course"}),r.jsx(je,{sx:fn,children:"Tutor"}),r.jsx(je,{sx:fn,children:"Students"}),r.jsx(je,{sx:fn,children:"Category"}),r.jsx(je,{sx:fn,children:"Price"}),r.jsx(je,{sx:fn,children:"Status"}),r.jsx(je,{align:"right",sx:fn,children:"Actions"})]})}),r.jsx(To,{children:s?r.jsx(Bt,{children:r.jsx(je,{colSpan:6,align:"center",sx:{py:8},children:r.jsx(nn,{})})}):t.length===0?r.jsx(Bt,{children:r.jsx(je,{colSpan:6,align:"center",sx:{py:8,color:"#9CA3AF"},children:"No courses found."})}):t.map(p=>{const g=p.status==="active"||p.status==="published",x=p.status?p.status.charAt(0).toUpperCase()+p.status.slice(1):"Unknown",b=p.category?.name||p.category?.title||p.category_name||p.categories&&p.categories[0]?.name||"Uncategorized",y=p.tutor||p.user||p.creator||p.created_by,S=(()=>{if(!y)return null;if(typeof y=="string")return String(y).trim()||null;const A=String(y.first_name||y.firstName||"").trim(),M=String(y.last_name||y.lastName||"").trim();return A||M?`${A} ${M}`.trim():String(y.name||y.full_name||y.fullName||y.display_name||y.displayName||y.username||y.email||"").trim()||null})(),j=y?typeof y=="string"?y[0]||"?":y.first_name?.[0]||y.firstName?.[0]||y.name?.[0]||y.username?.[0]||"?":"?";return r.jsxs(Bt,{hover:!0,sx:{"&:last-child td, &:last-child th":{border:0}},children:[r.jsx(je,{sx:{...Rt,color:"#fff"},children:r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(E,{sx:{width:40,height:40,borderRadius:1.5,bgcolor:"#1152D4",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},children:p.image_url?r.jsx("img",{src:Ru(p.image_url),alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}}):r.jsx(hr,{sx:{color:"#fff",fontSize:20}})}),r.jsxs(E,{children:[r.jsx(C,{variant:"subtitle2",sx:{fontWeight:600,color:"#fff"},children:p.title}),r.jsxs(C,{variant:"caption",sx:{color:"#6B7280"},children:[p.modules_count||0," modules • ",p.lessons_count||0," lessons"]})]})]})}),r.jsx(je,{sx:Rt,children:r.jsx(G,{direction:"row",alignItems:"center",spacing:1.5,children:r.jsxs(r.Fragment,{children:[r.jsx(yr,{sx:{width:32,height:32,bgcolor:"#7C3AED",fontSize:"0.8rem"},src:y?.avatar_url||y?.profile_photo_url,children:j}),r.jsx(C,{variant:"body2",sx:{color:"#E5E7EB"},children:S||"Unknown"})]})})}),r.jsx(je,{sx:Rt,children:r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,children:[r.jsx(C,{variant:"body2",sx:{color:"#fff",fontWeight:600},children:p.students_count||0}),r.jsx(C,{variant:"caption",sx:{color:"#6B7280"},children:"enrolled"})]})}),r.jsx(je,{sx:Rt,children:r.jsx(Pt,{label:b,size:"small",sx:{bgcolor:"#374151",color:"#E5E7EB",fontSize:"0.75rem",borderRadius:1}})}),r.jsxs(je,{sx:Rt,children:[r.jsx(C,{variant:"body2",sx:{color:"#fff",fontWeight:600},children:p.price>0?Ko(p.price,p.currency):"Free"}),u[p.id]&&r.jsx(tn,{title:`Pending Change: ${Ko(u[p.id].new_amount,u[p.id].new_currency)}`,children:r.jsxs(G,{direction:"row",alignItems:"center",spacing:.5,sx:{color:"#3B82F6",mt:.5},children:[r.jsx(Gp,{sx:{fontSize:12}}),r.jsx(C,{variant:"caption",sx:{fontWeight:600},children:Ko(u[p.id].new_amount,u[p.id].new_currency)})]})})]}),r.jsx(je,{sx:Rt,children:r.jsx(Pt,{icon:g?r.jsx(fr,{sx:{fontSize:14}}):r.jsx(_c,{sx:{fontSize:14}}),label:x,size:"small",sx:{bgcolor:g?"rgba(16, 185, 129, 0.15)":"rgba(239, 68, 68, 0.15)",color:g?"#10B981":"#EF4444",fontSize:"0.75rem","& .MuiChip-icon":{color:g?"#10B981":"#EF4444"}}})}),r.jsx(je,{align:"right",sx:Rt,children:r.jsx(ye,{variant:"contained",size:"small",onClick:()=>f(p),startIcon:r.jsx(kb,{fontSize:"small"}),sx:{bgcolor:"#1E293B",color:"#3B82F6",textTransform:"none",boxShadow:"none","&:hover":{bgcolor:"#334155"}},children:"View Details"})})]},p.id)})})]})})]})},L5=e=>e?e.data?e.data:e:null,ck=e=>e?{data:e.data||[],meta:e.meta||{},links:e.links||{}}:{data:[],meta:{},links:{}},vc={listCategories:async({page:e,per_page:t=50}={})=>{const n=new URLSearchParams;e&&n.append("page",e),t&&n.append("per_page",t);const s=n.toString(),o=s?`/categories?${s}`:"/categories",a=await ke.get(o);return ck(a)},getAllCategories:async()=>{const e=await ke.get("/categories?per_page=100");return ck(e).data},createCategory:async e=>{const t=await ke.post("/categories",e);return L5(t)},getCategoryById:async e=>{const t=await ke.get(`/categories/${e}`);return L5(t)},updateCategory:async(e,t)=>{const n=await ke.put(`/categories/${e}`,t);return L5(n)},deleteCategory:async e=>({success:!0,...await ke.delete(`/categories/${e}`)})},Ghe=["draft","published","archived"],Yhe=e=>String(e||"").split(",").map(t=>t.trim()).filter(Boolean),C_=e=>e?.name||e?.user?.name||e?.email||e?.id||"Unknown tutor",sj=e=>[e?.tutors,e?.users,e?.course_tutors,e?.courseTutors,e?.tutor_users,e?.tutorUsers,e?.tutor_assignments,e?.tutorAssignments,e?.data?.tutors,e?.data?.users,e?.data?.course_tutors,e?.data?.courseTutors,e?.data?.tutor_users,e?.data?.tutorUsers,e?.data?.tutor_assignments,e?.data?.tutorAssignments].find(n=>Array.isArray(n))||[],uk=e=>Array.isArray(e?.categories)?e.categories:Array.isArray(e?.data?.categories)?e.data.categories:[],Khe=(e,t=[])=>{if(e==null)return null;if(typeof e=="string"||typeof e=="number"){const d=String(e).trim();if(!d)return null;const f=t.find(p=>String(p?.id)===d);return f?{id:d,name:C_(f),email:f?.email||f?.user?.email||""}:{id:d,name:d}}const s=(e.tutor&&typeof e.tutor=="object"?e.tutor:e.user&&typeof e.user=="object"?e.user:null)||e,o=s?.id||e?.tutor_id||e?.user_id||e?.pivot?.tutor_id||e?.pivot?.user_id;if(!o)return null;const a=String(o).trim();if(!a)return null;const l=s?.name||s?.full_name||s?.email||a,u=s?.email||e?.email||"";return{...s,id:a,name:l,email:u}},dk=e=>{const n=[e?.tutor_ids,e?.tutorIds,e?.data?.tutor_ids,e?.data?.tutorIds].flatMap(a=>Array.isArray(a)?a:typeof a=="string"?Yhe(a):[]),o=sj(e).map(a=>typeof a=="string"||typeof a=="number"?a:a?.id||a?.tutor_id||a?.user_id||a?.pivot?.tutor_id||null);return[...n,...o].map(a=>String(a||"").trim()).filter(Boolean)},fk=(e=[])=>{const t=new Set;return e.filter(n=>{const s=String(n?.id||"").trim();return!s||t.has(s)?!1:(t.add(s),!0)})},P5=(e,{fallbackCourse:t=null,tutorOptions:n=[]}={})=>{const s=[...sj(e),...sj(t)],o=fk(s.map(l=>Khe(l,n)).filter(Boolean));if(o.length>0)return o;const a=[...dk(e),...dk(t)].map(l=>String(l||"").trim()).filter(Boolean);return a.length===0?[]:fk(a.map(l=>{const u=n.find(d=>String(d?.id)===l);return u?{id:l,name:C_(u),email:u?.email||u?.user?.email||""}:{id:l,name:l,email:""}}))},Xhe=()=>{const e=Dn(),[t,n]=v.useState([]),[s,o]=v.useState(!0),[a,l]=v.useState(!1),[u,d]=v.useState(null),[f,p]=v.useState(""),[g,x]=v.useState(""),[b,y]=v.useState(""),[S,j]=v.useState(!1),[A,M]=v.useState(!1),[R,_]=v.useState(null),[z,F]=v.useState([]),[N,I]=v.useState([]),[B,H]=v.useState([]),[P,k]=v.useState({open:!1,message:"",severity:"success"}),L=(J,ce="success")=>{k({open:!0,message:J,severity:ce})},O=()=>{k(J=>({...J,open:!1}))},W=v.useCallback(async({q:J="",status:ce=""}={})=>{o(!0),p("");try{const oe=await ns.listEssentialCourses({q:J,status:ce,with_categories:1,with_tutors:1,with_audit:1,per_page:50});n(oe.data||[])}catch(oe){console.error("Failed to load essential courses:",oe),p(oe.message||"Failed to load essential courses."),n([])}finally{o(!1)}},[]),D=v.useCallback(async()=>{try{const J=await ns.listTutors({per_page:100});F(J.data||[])}catch(J){console.error("Failed to load tutor options:",J)}},[]),q=v.useCallback(async()=>{try{const J=await vc.listCategories({per_page:100});I(J.data||[])}catch(J){console.error("Failed to load category options:",J)}},[]);v.useEffect(()=>{D(),q()},[D,q]),v.useEffect(()=>{const J=setTimeout(()=>{W({q:g,status:b})},350);return()=>clearTimeout(J)},[g,b,W]);const K=v.useMemo(()=>t.map(J=>{const ce=P5(J,{tutorOptions:z}),oe=uk(J);return{...J,_title:J.title||"-",_status:String(J.status||"unknown").toLowerCase(),_duration:J.duration_minutes||"-",_tutorCount:ce.length,_categoryCount:oe.length}}),[t,z]),Y=v.useCallback(async(J,{openModal:ce=!1,fallbackCourse:oe=null}={})=>{M(!0);try{const ge=await ns.getEssentialCourseById(J,{with_categories:1,with_tutors:1,with_audit:1}),de=P5(ge,{fallbackCourse:oe,tutorOptions:z});return H(de.map(le=>le.id).filter(Boolean)),_(de.length>0?{...ge,tutors:de}:ge),ce&&j(!0),de.length>0?{...ge,tutors:de}:ge}catch(ge){return console.error("Failed to load course detail:",ge),L(ge.message||"Failed to load course detail.","error"),null}finally{M(!1)}},[z]),ie=()=>{e("/admin/content/essential-courses/create")},V=J=>{e(`/admin/content/essential-courses/create?edit=${J}`)},re=async()=>{if(!R?.id||B.length===0){L("Select at least one tutor.","error");return}l(!0);try{await ns.addTutorsToCourse(R.id,B),L("Tutors added successfully."),await Y(R.id,{fallbackCourse:R}),await W({q:g,status:b})}catch(J){console.error("Failed to add tutors:",J),L(J.message||"Failed to add tutors.","error")}finally{l(!1)}},fe=async()=>{if(!R?.id||B.length===0){L("Select at least one tutor.","error");return}l(!0);try{await ns.syncCourseTutors(R.id,B),L("Course tutors updated successfully."),await Y(R.id,{fallbackCourse:R}),await W({q:g,status:b})}catch(J){console.error("Failed to sync tutors:",J),L(J.message||"Failed to sync tutors.","error")}finally{l(!1)}},ae=async J=>{if(R?.id&&window.confirm("Remove this tutor from the course?")){d(J);try{await ns.removeTutorFromCourse(R.id,J),L("Tutor removed from course."),await Y(R.id,{fallbackCourse:R}),await W({q:g,status:b})}catch(ce){console.error("Failed to remove tutor from course:",ce),L(ce.message||"Failed to remove tutor.","error")}finally{d(null)}}},ue=v.useMemo(()=>P5(R,{tutorOptions:z}),[R,z]),se=v.useMemo(()=>uk(R),[R]);return r.jsxs(E,{sx:{p:{xs:2,md:4},bgcolor:"#0C1322",minHeight:"calc(100vh - 70px)",width:"100%"},children:[r.jsxs(G,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:2,sx:{mb:4},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h4",sx:{color:"#fff",fontWeight:700,mb:1},children:"Essential Courses"}),r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF"},children:"Manage admin-owned essential courses and tutor assignments."})]}),r.jsxs(G,{direction:"row",spacing:1,children:[r.jsx(tn,{title:"Refresh",children:r.jsx(Ve,{onClick:()=>W({q:g,status:b}),disabled:s,sx:{color:"#9CA3AF","&:hover":{bgcolor:"rgba(255,255,255,0.08)"}},children:r.jsx(Ku,{})})}),r.jsx(ye,{variant:"contained",startIcon:r.jsx(Br,{}),onClick:ie,sx:os,children:"Create Course"})]})]}),r.jsx(Je,{sx:{...Wr,p:2,mb:4},children:r.jsxs(G,{direction:{xs:"column",md:"row"},spacing:2,alignItems:{xs:"stretch",md:"center"},children:[r.jsxs(E,{sx:{...xy,maxWidth:460},children:[r.jsx(to,{sx:{color:"#9CA3AF",fontSize:20}}),r.jsx(sr,{placeholder:"Search by title or summary...",value:g,onChange:J=>x(J.target.value),sx:by})]}),r.jsxs(Ur,{sx:{minWidth:220},children:[r.jsx(rs,{sx:{color:"#9CA3AF"},children:"Status"}),r.jsxs(Fn,{label:"Status",value:b,onChange:J=>y(J.target.value),sx:Yn,MenuProps:Tr,children:[r.jsx(It,{value:"",children:"All"}),Ghe.map(J=>r.jsx(It,{value:J,children:J},J))]})]})]})}),r.jsx(ko,{component:Je,sx:Wr,children:r.jsxs(Eo,{children:[r.jsx(Mo,{children:r.jsxs(Bt,{children:[r.jsx(je,{sx:fn,children:"Course"}),r.jsx(je,{sx:fn,children:"Status"}),r.jsx(je,{sx:fn,children:"Duration"}),r.jsx(je,{sx:fn,children:"Tutors"}),r.jsx(je,{sx:fn,children:"Categories"}),r.jsx(je,{align:"right",sx:fn,children:"Actions"})]})}),r.jsx(To,{children:s?r.jsx(Bt,{children:r.jsx(je,{colSpan:6,align:"center",sx:{...Rt,py:7},children:r.jsx(nn,{})})}):f?r.jsx(Bt,{children:r.jsx(je,{colSpan:6,align:"center",sx:{...Rt,py:4},children:r.jsx(Wt,{severity:"error",sx:{bgcolor:"transparent",justifyContent:"center"},children:f})})}):K.length===0?r.jsx(Bt,{children:r.jsx(je,{colSpan:6,align:"center",sx:{...Rt,py:5,color:"#9CA3AF"},children:"No essential courses found."})}):K.map(J=>{const ce=J._status==="published"?"#10B981":J._status==="archived"?"#EF4444":"#F59E0B";return r.jsxs(Bt,{children:[r.jsxs(je,{sx:Rt,children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600},children:J._title}),r.jsxs(C,{sx:{color:"#9CA3AF",fontSize:"0.8rem"},children:[J.language||"-"," · ",J.level||"-"]})]}),r.jsx(je,{sx:Rt,children:r.jsx(Pt,{label:J._status,size:"small",sx:{textTransform:"capitalize",color:ce,bgcolor:"rgba(255,255,255,0.06)",fontWeight:600}})}),r.jsxs(je,{sx:{...Rt,color:"#D1D5DB"},children:[J._duration," min"]}),r.jsx(je,{sx:{...Rt,color:"#D1D5DB"},children:J._tutorCount}),r.jsx(je,{sx:{...Rt,color:"#D1D5DB"},children:J._categoryCount}),r.jsx(je,{align:"right",sx:Rt,children:r.jsxs(G,{direction:"row",spacing:1,justifyContent:"flex-end",children:[r.jsx(tn,{title:"View Details",children:r.jsx(Ve,{onClick:()=>Y(J.id,{openModal:!0,fallbackCourse:J}),sx:{color:"#3B82F6"},children:r.jsx(Bi,{fontSize:"small"})})}),r.jsx(tn,{title:"Edit Course",children:r.jsx(Ve,{onClick:()=>V(J.id),disabled:u===J.id,sx:{color:"#F59E0B"},children:r.jsx(Ws,{fontSize:"small"})})})]})})]},J.id)})})]})}),r.jsx(tr,{open:S,onClose:()=>j(!1),children:r.jsxs(E,{sx:{...kr,width:{xs:"95%",md:860},maxHeight:"92vh",display:"flex",flexDirection:"column"},children:[r.jsxs(G,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{p:2.5,borderBottom:"1px solid #374151"},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:700,fontSize:"1.05rem"},children:"Essential Course Details"}),r.jsx(Ve,{onClick:()=>j(!1),sx:{color:"#9CA3AF"},children:r.jsx(hs,{})})]}),r.jsx(E,{sx:{p:2.5,overflowY:"auto"},children:A?r.jsx(E,{sx:{py:6,display:"flex",justifyContent:"center"},children:r.jsx(nn,{})}):R?r.jsxs(G,{spacing:2,children:[r.jsxs(Je,{sx:{...Wr,p:2},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:700,mb:1},children:R.title||"-"}),r.jsx(C,{sx:{color:"#D1D5DB",fontSize:"0.9rem",mb:1},children:R.summary||"-"}),r.jsxs(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem"},children:["Status: ",R.status||"-"," · Level: ",R.level||"-"," · Language: ",R.language||"-"]})]}),r.jsxs(Je,{sx:{...Wr,p:2},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:700,mb:1.5},children:"Categories"}),se.length===0?r.jsx(C,{sx:{color:"#9CA3AF"},children:"No categories attached."}):r.jsx(G,{direction:"row",spacing:1,flexWrap:"wrap",useFlexGap:!0,children:se.map(J=>r.jsx(Pt,{label:J.name||J.title||J.id,size:"small",sx:{bgcolor:"rgba(255,255,255,0.08)",color:"#E5E7EB"}},J.id))})]}),r.jsxs(Je,{sx:{...Wr,p:2},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:700,mb:1.5},children:"Tutor Assignment"}),ue.length===0?r.jsx(C,{sx:{color:"#9CA3AF",mb:1.5},children:"No tutors attached."}):r.jsx(G,{spacing:1.25,sx:{mb:2},children:ue.map(J=>r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{p:1.25,borderRadius:1,bgcolor:"#0F1729",border:"1px solid #374151"},children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#E5E7EB",fontWeight:600,fontSize:"0.9rem"},children:J.name||J.email||J.id}),r.jsxs(C,{sx:{color:"#9CA3AF",fontSize:"0.8rem"},children:["ID: ",J.id]})]}),r.jsx(ye,{size:"small",color:"error",startIcon:r.jsx(ss,{}),onClick:()=>ae(J.id),disabled:u===J.id,sx:{textTransform:"none"},children:"Remove"})]},J.id))}),r.jsx(tY,{multiple:!0,id:"tutor-select",options:z,getOptionLabel:J=>J.name||J.user?.name||J.email||J.id||"",value:z.filter(J=>B.includes(J.id)),onChange:(J,ce)=>{H(ce.map(oe=>oe.id))},renderInput:J=>r.jsx(it,{...J,label:"Select Tutors",sx:xt}),renderTags:(J,ce)=>J.map((oe,ge)=>r.jsx(Pt,{label:oe.name||oe.user?.name||oe.email||oe.id,...ce({index:ge}),size:"small",sx:{bgcolor:"rgba(59, 130, 246, 0.2)",color:"#93C5FD"}})),sx:{mb:1.5},PaperComponent:({children:J})=>r.jsx(Je,{sx:{bgcolor:"#1F2937",color:"#fff"},children:J})}),r.jsxs(G,{direction:{xs:"column",md:"row"},spacing:1.5,justifyContent:"flex-end",children:[r.jsx(ye,{variant:"outlined",onClick:re,disabled:a||B.length===0,sx:{borderColor:"#3B82F6",color:"#3B82F6",textTransform:"none"},children:"Add Selected Tutors"}),r.jsx(ye,{variant:"contained",onClick:fe,disabled:a||B.length===0,sx:os,children:"Replace Tutors"})]})]})]}):r.jsx(C,{sx:{color:"#9CA3AF"},children:"No course selected."})})]})}),r.jsx(gs,{open:P.open,autoHideDuration:3500,onClose:O,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:r.jsx(Wt,{severity:P.severity,onClose:O,variant:"filled",children:P.message})})]})};var w_=typeof global=="object"&&global&&global.Object===Object&&global,Zhe=typeof self=="object"&&self&&self.Object===Object&&self,Ya=w_||Zhe||Function("return this")(),Dc=Ya.Symbol,A_=Object.prototype,Qhe=A_.hasOwnProperty,Jhe=A_.toString,yp=Dc?Dc.toStringTag:void 0;function epe(e){var t=Qhe.call(e,yp),n=e[yp];try{e[yp]=void 0;var s=!0}catch{}var o=Jhe.call(e);return s&&(t?e[yp]=n:delete e[yp]),o}var tpe=Object.prototype,npe=tpe.toString;function rpe(e){return npe.call(e)}var spe="[object Null]",ope="[object Undefined]",hk=Dc?Dc.toStringTag:void 0;function ch(e){return e==null?e===void 0?ope:spe:hk&&hk in Object(e)?epe(e):rpe(e)}function zl(e){return e!=null&&typeof e=="object"}var $u=Array.isArray;function Gc(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function E_(e){return e}var ipe="[object AsyncFunction]",ape="[object Function]",lpe="[object GeneratorFunction]",cpe="[object Proxy]";function Mw(e){if(!Gc(e))return!1;var t=ch(e);return t==ape||t==lpe||t==ipe||t==cpe}var D5=Ya["__core-js_shared__"],pk=(function(){var e=/[^.]+$/.exec(D5&&D5.keys&&D5.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function upe(e){return!!pk&&pk in e}var dpe=Function.prototype,fpe=dpe.toString;function nd(e){if(e!=null){try{return fpe.call(e)}catch{}try{return e+""}catch{}}return""}var hpe=/[\\^$.*+?()[\]{}|]/g,ppe=/^\[object .+?Constructor\]$/,gpe=Function.prototype,mpe=Object.prototype,xpe=gpe.toString,bpe=mpe.hasOwnProperty,ype=RegExp("^"+xpe.call(bpe).replace(hpe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function vpe(e){if(!Gc(e)||upe(e))return!1;var t=Mw(e)?ype:ppe;return t.test(nd(e))}function Spe(e,t){return e?.[t]}function rd(e,t){var n=Spe(e,t);return vpe(n)?n:void 0}var oj=rd(Ya,"WeakMap"),gk=Object.create,jpe=(function(){function e(){}return function(t){if(!Gc(t))return{};if(gk)return gk(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function Cpe(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function wpe(e,t){var n=-1,s=e.length;for(t||(t=Array(s));++n<s;)t[n]=e[n];return t}var Ape=800,Epe=16,Tpe=Date.now;function kpe(e){var t=0,n=0;return function(){var s=Tpe(),o=Epe-(s-n);if(n=s,o>0){if(++t>=Ape)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Mpe(e){return function(){return e}}var L1=(function(){try{var e=rd(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Rpe=L1?function(e,t){return L1(e,"toString",{configurable:!0,enumerable:!1,value:Mpe(t),writable:!0})}:E_,zpe=kpe(Rpe);function Ipe(e,t){for(var n=-1,s=e==null?0:e.length;++n<s&&t(e[n],n,e)!==!1;);return e}var Fpe=9007199254740991,_pe=/^(?:0|[1-9]\d*)$/;function T_(e,t){var n=typeof e;return t=t??Fpe,!!t&&(n=="number"||n!="symbol"&&_pe.test(e))&&e>-1&&e%1==0&&e<t}function Rw(e,t,n){t=="__proto__"&&L1?L1(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function wm(e,t){return e===t||e!==e&&t!==t}var Lpe=Object.prototype,Ppe=Lpe.hasOwnProperty;function k_(e,t,n){var s=e[t];(!(Ppe.call(e,t)&&wm(s,n))||n===void 0&&!(t in e))&&Rw(e,t,n)}function Dpe(e,t,n,s){var o=!n;n||(n={});for(var a=-1,l=t.length;++a<l;){var u=t[a],d=void 0;d===void 0&&(d=e[u]),o?Rw(n,u,d):k_(n,u,d)}return n}var mk=Math.max;function Ope(e,t,n){return t=mk(t===void 0?e.length-1:t,0),function(){for(var s=arguments,o=-1,a=mk(s.length-t,0),l=Array(a);++o<a;)l[o]=s[t+o];o=-1;for(var u=Array(t+1);++o<t;)u[o]=s[o];return u[t]=n(l),Cpe(e,this,u)}}function Bpe(e,t){return zpe(Ope(e,t,E_),e+"")}var Npe=9007199254740991;function M_(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Npe}function yy(e){return e!=null&&M_(e.length)&&!Mw(e)}function $pe(e,t,n){if(!Gc(n))return!1;var s=typeof t;return(s=="number"?yy(n)&&T_(t,n.length):s=="string"&&t in n)?wm(n[t],e):!1}function Hpe(e){return Bpe(function(t,n){var s=-1,o=n.length,a=o>1?n[o-1]:void 0,l=o>2?n[2]:void 0;for(a=e.length>3&&typeof a=="function"?(o--,a):void 0,l&&$pe(n[0],n[1],l)&&(a=o<3?void 0:a,o=1),t=Object(t);++s<o;){var u=n[s];u&&e(t,u,s,a)}return t})}var Wpe=Object.prototype;function zw(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Wpe;return e===n}function Upe(e,t){for(var n=-1,s=Array(e);++n<e;)s[n]=t(n);return s}var qpe="[object Arguments]";function xk(e){return zl(e)&&ch(e)==qpe}var R_=Object.prototype,Vpe=R_.hasOwnProperty,Gpe=R_.propertyIsEnumerable,ij=xk((function(){return arguments})())?xk:function(e){return zl(e)&&Vpe.call(e,"callee")&&!Gpe.call(e,"callee")};function Ype(){return!1}var z_=typeof Xo=="object"&&Xo&&!Xo.nodeType&&Xo,bk=z_&&typeof Zo=="object"&&Zo&&!Zo.nodeType&&Zo,Kpe=bk&&bk.exports===z_,yk=Kpe?Ya.Buffer:void 0,Xpe=yk?yk.isBuffer:void 0,Eg=Xpe||Ype,Zpe="[object Arguments]",Qpe="[object Array]",Jpe="[object Boolean]",ege="[object Date]",tge="[object Error]",nge="[object Function]",rge="[object Map]",sge="[object Number]",oge="[object Object]",ige="[object RegExp]",age="[object Set]",lge="[object String]",cge="[object WeakMap]",uge="[object ArrayBuffer]",dge="[object DataView]",fge="[object Float32Array]",hge="[object Float64Array]",pge="[object Int8Array]",gge="[object Int16Array]",mge="[object Int32Array]",xge="[object Uint8Array]",bge="[object Uint8ClampedArray]",yge="[object Uint16Array]",vge="[object Uint32Array]",zr={};zr[fge]=zr[hge]=zr[pge]=zr[gge]=zr[mge]=zr[xge]=zr[bge]=zr[yge]=zr[vge]=!0;zr[Zpe]=zr[Qpe]=zr[uge]=zr[Jpe]=zr[dge]=zr[ege]=zr[tge]=zr[nge]=zr[rge]=zr[sge]=zr[oge]=zr[ige]=zr[age]=zr[lge]=zr[cge]=!1;function Sge(e){return zl(e)&&M_(e.length)&&!!zr[ch(e)]}function Iw(e){return function(t){return e(t)}}var I_=typeof Xo=="object"&&Xo&&!Xo.nodeType&&Xo,Xp=I_&&typeof Zo=="object"&&Zo&&!Zo.nodeType&&Zo,jge=Xp&&Xp.exports===I_,O5=jge&&w_.process,Qf=(function(){try{var e=Xp&&Xp.require&&Xp.require("util").types;return e||O5&&O5.binding&&O5.binding("util")}catch{}})(),vk=Qf&&Qf.isTypedArray,Fw=vk?Iw(vk):Sge,Cge=Object.prototype,wge=Cge.hasOwnProperty;function F_(e,t){var n=$u(e),s=!n&&ij(e),o=!n&&!s&&Eg(e),a=!n&&!s&&!o&&Fw(e),l=n||s||o||a,u=l?Upe(e.length,String):[],d=u.length;for(var f in e)(t||wge.call(e,f))&&!(l&&(f=="length"||o&&(f=="offset"||f=="parent")||a&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||T_(f,d)))&&u.push(f);return u}function __(e,t){return function(n){return e(t(n))}}var Age=__(Object.keys,Object),Ege=Object.prototype,Tge=Ege.hasOwnProperty;function kge(e){if(!zw(e))return Age(e);var t=[];for(var n in Object(e))Tge.call(e,n)&&n!="constructor"&&t.push(n);return t}function Mge(e){return yy(e)?F_(e):kge(e)}function Rge(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var zge=Object.prototype,Ige=zge.hasOwnProperty;function Fge(e){if(!Gc(e))return Rge(e);var t=zw(e),n=[];for(var s in e)s=="constructor"&&(t||!Ige.call(e,s))||n.push(s);return n}function L_(e){return yy(e)?F_(e,!0):Fge(e)}var Tg=rd(Object,"create");function _ge(){this.__data__=Tg?Tg(null):{},this.size=0}function Lge(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Pge="__lodash_hash_undefined__",Dge=Object.prototype,Oge=Dge.hasOwnProperty;function Bge(e){var t=this.__data__;if(Tg){var n=t[e];return n===Pge?void 0:n}return Oge.call(t,e)?t[e]:void 0}var Nge=Object.prototype,$ge=Nge.hasOwnProperty;function Hge(e){var t=this.__data__;return Tg?t[e]!==void 0:$ge.call(t,e)}var Wge="__lodash_hash_undefined__";function Uge(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Tg&&t===void 0?Wge:t,this}function Hu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Hu.prototype.clear=_ge;Hu.prototype.delete=Lge;Hu.prototype.get=Bge;Hu.prototype.has=Hge;Hu.prototype.set=Uge;function qge(){this.__data__=[],this.size=0}function vy(e,t){for(var n=e.length;n--;)if(wm(e[n][0],t))return n;return-1}var Vge=Array.prototype,Gge=Vge.splice;function Yge(e){var t=this.__data__,n=vy(t,e);if(n<0)return!1;var s=t.length-1;return n==s?t.pop():Gge.call(t,n,1),--this.size,!0}function Kge(e){var t=this.__data__,n=vy(t,e);return n<0?void 0:t[n][1]}function Xge(e){return vy(this.__data__,e)>-1}function Zge(e,t){var n=this.__data__,s=vy(n,e);return s<0?(++this.size,n.push([e,t])):n[s][1]=t,this}function Dl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Dl.prototype.clear=qge;Dl.prototype.delete=Yge;Dl.prototype.get=Kge;Dl.prototype.has=Xge;Dl.prototype.set=Zge;var kg=rd(Ya,"Map");function Qge(){this.size=0,this.__data__={hash:new Hu,map:new(kg||Dl),string:new Hu}}function Jge(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Sy(e,t){var n=e.__data__;return Jge(t)?n[typeof t=="string"?"string":"hash"]:n.map}function eme(e){var t=Sy(this,e).delete(e);return this.size-=t?1:0,t}function tme(e){return Sy(this,e).get(e)}function nme(e){return Sy(this,e).has(e)}function rme(e,t){var n=Sy(this,e),s=n.size;return n.set(e,t),this.size+=n.size==s?0:1,this}function sd(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}sd.prototype.clear=Qge;sd.prototype.delete=eme;sd.prototype.get=tme;sd.prototype.has=nme;sd.prototype.set=rme;function sme(e,t){for(var n=-1,s=t.length,o=e.length;++n<s;)e[o+n]=t[n];return e}var P_=__(Object.getPrototypeOf,Object),ome="[object Object]",ime=Function.prototype,ame=Object.prototype,D_=ime.toString,lme=ame.hasOwnProperty,cme=D_.call(Object);function ume(e){if(!zl(e)||ch(e)!=ome)return!1;var t=P_(e);if(t===null)return!0;var n=lme.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&D_.call(n)==cme}function dme(){this.__data__=new Dl,this.size=0}function fme(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function hme(e){return this.__data__.get(e)}function pme(e){return this.__data__.has(e)}var gme=200;function mme(e,t){var n=this.__data__;if(n instanceof Dl){var s=n.__data__;if(!kg||s.length<gme-1)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new sd(s)}return n.set(e,t),this.size=n.size,this}function Oa(e){var t=this.__data__=new Dl(e);this.size=t.size}Oa.prototype.clear=dme;Oa.prototype.delete=fme;Oa.prototype.get=hme;Oa.prototype.has=pme;Oa.prototype.set=mme;var O_=typeof Xo=="object"&&Xo&&!Xo.nodeType&&Xo,Sk=O_&&typeof Zo=="object"&&Zo&&!Zo.nodeType&&Zo,xme=Sk&&Sk.exports===O_,jk=xme?Ya.Buffer:void 0,Ck=jk?jk.allocUnsafe:void 0;function B_(e,t){if(t)return e.slice();var n=e.length,s=Ck?Ck(n):new e.constructor(n);return e.copy(s),s}function bme(e,t){for(var n=-1,s=e==null?0:e.length,o=0,a=[];++n<s;){var l=e[n];t(l,n,e)&&(a[o++]=l)}return a}function yme(){return[]}var vme=Object.prototype,Sme=vme.propertyIsEnumerable,wk=Object.getOwnPropertySymbols,jme=wk?function(e){return e==null?[]:(e=Object(e),bme(wk(e),function(t){return Sme.call(e,t)}))}:yme;function Cme(e,t,n){var s=t(e);return $u(e)?s:sme(s,n(e))}function aj(e){return Cme(e,Mge,jme)}var lj=rd(Ya,"DataView"),cj=rd(Ya,"Promise"),uj=rd(Ya,"Set"),Ak="[object Map]",wme="[object Object]",Ek="[object Promise]",Tk="[object Set]",kk="[object WeakMap]",Mk="[object DataView]",Ame=nd(lj),Eme=nd(kg),Tme=nd(cj),kme=nd(uj),Mme=nd(oj),ta=ch;(lj&&ta(new lj(new ArrayBuffer(1)))!=Mk||kg&&ta(new kg)!=Ak||cj&&ta(cj.resolve())!=Ek||uj&&ta(new uj)!=Tk||oj&&ta(new oj)!=kk)&&(ta=function(e){var t=ch(e),n=t==wme?e.constructor:void 0,s=n?nd(n):"";if(s)switch(s){case Ame:return Mk;case Eme:return Ak;case Tme:return Ek;case kme:return Tk;case Mme:return kk}return t});var Rme=Object.prototype,zme=Rme.hasOwnProperty;function Ime(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&zme.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var P1=Ya.Uint8Array;function _w(e){var t=new e.constructor(e.byteLength);return new P1(t).set(new P1(e)),t}function Fme(e,t){var n=_w(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var _me=/\w*$/;function Lme(e){var t=new e.constructor(e.source,_me.exec(e));return t.lastIndex=e.lastIndex,t}var Rk=Dc?Dc.prototype:void 0,zk=Rk?Rk.valueOf:void 0;function Pme(e){return zk?Object(zk.call(e)):{}}function N_(e,t){var n=t?_w(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Dme="[object Boolean]",Ome="[object Date]",Bme="[object Map]",Nme="[object Number]",$me="[object RegExp]",Hme="[object Set]",Wme="[object String]",Ume="[object Symbol]",qme="[object ArrayBuffer]",Vme="[object DataView]",Gme="[object Float32Array]",Yme="[object Float64Array]",Kme="[object Int8Array]",Xme="[object Int16Array]",Zme="[object Int32Array]",Qme="[object Uint8Array]",Jme="[object Uint8ClampedArray]",exe="[object Uint16Array]",txe="[object Uint32Array]";function nxe(e,t,n){var s=e.constructor;switch(t){case qme:return _w(e);case Dme:case Ome:return new s(+e);case Vme:return Fme(e);case Gme:case Yme:case Kme:case Xme:case Zme:case Qme:case Jme:case exe:case txe:return N_(e,n);case Bme:return new s;case Nme:case Wme:return new s(e);case $me:return Lme(e);case Hme:return new s;case Ume:return Pme(e)}}function $_(e){return typeof e.constructor=="function"&&!zw(e)?jpe(P_(e)):{}}var rxe="[object Map]";function sxe(e){return zl(e)&&ta(e)==rxe}var Ik=Qf&&Qf.isMap,oxe=Ik?Iw(Ik):sxe,ixe="[object Set]";function axe(e){return zl(e)&&ta(e)==ixe}var Fk=Qf&&Qf.isSet,lxe=Fk?Iw(Fk):axe,cxe=1,H_="[object Arguments]",uxe="[object Array]",dxe="[object Boolean]",fxe="[object Date]",hxe="[object Error]",W_="[object Function]",pxe="[object GeneratorFunction]",gxe="[object Map]",mxe="[object Number]",U_="[object Object]",xxe="[object RegExp]",bxe="[object Set]",yxe="[object String]",vxe="[object Symbol]",Sxe="[object WeakMap]",jxe="[object ArrayBuffer]",Cxe="[object DataView]",wxe="[object Float32Array]",Axe="[object Float64Array]",Exe="[object Int8Array]",Txe="[object Int16Array]",kxe="[object Int32Array]",Mxe="[object Uint8Array]",Rxe="[object Uint8ClampedArray]",zxe="[object Uint16Array]",Ixe="[object Uint32Array]",wr={};wr[H_]=wr[uxe]=wr[jxe]=wr[Cxe]=wr[dxe]=wr[fxe]=wr[wxe]=wr[Axe]=wr[Exe]=wr[Txe]=wr[kxe]=wr[gxe]=wr[mxe]=wr[U_]=wr[xxe]=wr[bxe]=wr[yxe]=wr[vxe]=wr[Mxe]=wr[Rxe]=wr[zxe]=wr[Ixe]=!0;wr[hxe]=wr[W_]=wr[Sxe]=!1;function q0(e,t,n,s,o,a){var l,u=t&cxe;if(l!==void 0)return l;if(!Gc(e))return e;var d=$u(e);if(d)l=Ime(e);else{var f=ta(e),p=f==W_||f==pxe;if(Eg(e))return B_(e,u);if(f==U_||f==H_||p&&!o)l=p?{}:$_(e);else{if(!wr[f])return o?e:{};l=nxe(e,f,u)}}a||(a=new Oa);var g=a.get(e);if(g)return g;a.set(e,l),lxe(e)?e.forEach(function(y){l.add(q0(y,t,n,y,e,a))}):oxe(e)&&e.forEach(function(y,S){l.set(S,q0(y,t,n,S,e,a))});var x=aj,b=d?void 0:x(e);return Ipe(b||e,function(y,S){b&&(S=y,y=e[S]),k_(l,S,q0(y,t,n,S,e,a))}),l}var Fxe=1,_xe=4;function Ff(e){return q0(e,Fxe|_xe)}var Lxe="__lodash_hash_undefined__";function Pxe(e){return this.__data__.set(e,Lxe),this}function Dxe(e){return this.__data__.has(e)}function D1(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new sd;++t<n;)this.add(e[t])}D1.prototype.add=D1.prototype.push=Pxe;D1.prototype.has=Dxe;function Oxe(e,t){for(var n=-1,s=e==null?0:e.length;++n<s;)if(t(e[n],n,e))return!0;return!1}function Bxe(e,t){return e.has(t)}var Nxe=1,$xe=2;function q_(e,t,n,s,o,a){var l=n&Nxe,u=e.length,d=t.length;if(u!=d&&!(l&&d>u))return!1;var f=a.get(e),p=a.get(t);if(f&&p)return f==t&&p==e;var g=-1,x=!0,b=n&$xe?new D1:void 0;for(a.set(e,t),a.set(t,e);++g<u;){var y=e[g],S=t[g];if(s)var j=l?s(S,y,g,t,e,a):s(y,S,g,e,t,a);if(j!==void 0){if(j)continue;x=!1;break}if(b){if(!Oxe(t,function(A,M){if(!Bxe(b,M)&&(y===A||o(y,A,n,s,a)))return b.push(M)})){x=!1;break}}else if(!(y===S||o(y,S,n,s,a))){x=!1;break}}return a.delete(e),a.delete(t),x}function Hxe(e){var t=-1,n=Array(e.size);return e.forEach(function(s,o){n[++t]=[o,s]}),n}function Wxe(e){var t=-1,n=Array(e.size);return e.forEach(function(s){n[++t]=s}),n}var Uxe=1,qxe=2,Vxe="[object Boolean]",Gxe="[object Date]",Yxe="[object Error]",Kxe="[object Map]",Xxe="[object Number]",Zxe="[object RegExp]",Qxe="[object Set]",Jxe="[object String]",e0e="[object Symbol]",t0e="[object ArrayBuffer]",n0e="[object DataView]",_k=Dc?Dc.prototype:void 0,B5=_k?_k.valueOf:void 0;function r0e(e,t,n,s,o,a,l){switch(n){case n0e:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case t0e:return!(e.byteLength!=t.byteLength||!a(new P1(e),new P1(t)));case Vxe:case Gxe:case Xxe:return wm(+e,+t);case Yxe:return e.name==t.name&&e.message==t.message;case Zxe:case Jxe:return e==t+"";case Kxe:var u=Hxe;case Qxe:var d=s&Uxe;if(u||(u=Wxe),e.size!=t.size&&!d)return!1;var f=l.get(e);if(f)return f==t;s|=qxe,l.set(e,t);var p=q_(u(e),u(t),s,o,a,l);return l.delete(e),p;case e0e:if(B5)return B5.call(e)==B5.call(t)}return!1}var s0e=1,o0e=Object.prototype,i0e=o0e.hasOwnProperty;function a0e(e,t,n,s,o,a){var l=n&s0e,u=aj(e),d=u.length,f=aj(t),p=f.length;if(d!=p&&!l)return!1;for(var g=d;g--;){var x=u[g];if(!(l?x in t:i0e.call(t,x)))return!1}var b=a.get(e),y=a.get(t);if(b&&y)return b==t&&y==e;var S=!0;a.set(e,t),a.set(t,e);for(var j=l;++g<d;){x=u[g];var A=e[x],M=t[x];if(s)var R=l?s(M,A,x,t,e,a):s(A,M,x,e,t,a);if(!(R===void 0?A===M||o(A,M,n,s,a):R)){S=!1;break}j||(j=x=="constructor")}if(S&&!j){var _=e.constructor,z=t.constructor;_!=z&&"constructor"in e&&"constructor"in t&&!(typeof _=="function"&&_ instanceof _&&typeof z=="function"&&z instanceof z)&&(S=!1)}return a.delete(e),a.delete(t),S}var l0e=1,Lk="[object Arguments]",Pk="[object Array]",y0="[object Object]",c0e=Object.prototype,Dk=c0e.hasOwnProperty;function u0e(e,t,n,s,o,a){var l=$u(e),u=$u(t),d=l?Pk:ta(e),f=u?Pk:ta(t);d=d==Lk?y0:d,f=f==Lk?y0:f;var p=d==y0,g=f==y0,x=d==f;if(x&&Eg(e)){if(!Eg(t))return!1;l=!0,p=!1}if(x&&!p)return a||(a=new Oa),l||Fw(e)?q_(e,t,n,s,o,a):r0e(e,t,d,n,s,o,a);if(!(n&l0e)){var b=p&&Dk.call(e,"__wrapped__"),y=g&&Dk.call(t,"__wrapped__");if(b||y){var S=b?e.value():e,j=y?t.value():t;return a||(a=new Oa),o(S,j,n,s,a)}}return x?(a||(a=new Oa),a0e(e,t,n,s,o,a)):!1}function V_(e,t,n,s,o){return e===t?!0:e==null||t==null||!zl(e)&&!zl(t)?e!==e&&t!==t:u0e(e,t,n,s,V_,o)}function d0e(e){return function(t,n,s){for(var o=-1,a=Object(t),l=s(t),u=l.length;u--;){var d=l[++o];if(n(a[d],d,a)===!1)break}return t}}var f0e=d0e();function dj(e,t,n){(n!==void 0&&!wm(e[t],n)||n===void 0&&!(t in e))&&Rw(e,t,n)}function h0e(e){return zl(e)&&yy(e)}function fj(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function p0e(e){return Dpe(e,L_(e))}function g0e(e,t,n,s,o,a,l){var u=fj(e,n),d=fj(t,n),f=l.get(d);if(f){dj(e,n,f);return}var p=a?a(u,d,n+"",e,t,l):void 0,g=p===void 0;if(g){var x=$u(d),b=!x&&Eg(d),y=!x&&!b&&Fw(d);p=d,x||b||y?$u(u)?p=u:h0e(u)?p=wpe(u):b?(g=!1,p=B_(d,!0)):y?(g=!1,p=N_(d,!0)):p=[]:ume(d)||ij(d)?(p=u,ij(u)?p=p0e(u):(!Gc(u)||Mw(u))&&(p=$_(d))):g=!1}g&&(l.set(d,p),o(p,d,s,a,l),l.delete(d)),dj(e,n,p)}function G_(e,t,n,s,o){e!==t&&f0e(t,function(a,l){if(o||(o=new Oa),Gc(a))g0e(e,t,l,n,G_,s,o);else{var u=s?s(fj(e,l),a,l+"",e,t,o):void 0;u===void 0&&(u=a),dj(e,l,u)}},L_)}function Sc(e,t){return V_(e,t)}var kc=Hpe(function(e,t,n){G_(e,t,n)}),Gt=(e=>(e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY",e))(Gt||{});class Ua{constructor(t,n,s={}){this.attrName=t,this.keyName=n;const o=Gt.TYPE&Gt.ATTRIBUTE;this.scope=s.scope!=null?s.scope&Gt.LEVEL|o:Gt.ATTRIBUTE,s.whitelist!=null&&(this.whitelist=s.whitelist)}static keys(t){return Array.from(t.attributes).map(n=>n.name)}add(t,n){return this.canAdd(t,n)?(t.setAttribute(this.keyName,n),!0):!1}canAdd(t,n){return this.whitelist==null?!0:typeof n=="string"?this.whitelist.indexOf(n.replace(/["']/g,""))>-1:this.whitelist.indexOf(n)>-1}remove(t){t.removeAttribute(this.keyName)}value(t){const n=t.getAttribute(this.keyName);return this.canAdd(t,n)&&n?n:""}}class _f extends Error{constructor(t){t="[Parchment] "+t,super(t),this.message=t,this.name=this.constructor.name}}const Y_=class hj{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t,n=!1){if(t==null)return null;if(this.blots.has(t))return this.blots.get(t)||null;if(n){let s=null;try{s=t.parentNode}catch{return null}return this.find(s,n)}return null}create(t,n,s){const o=this.query(n);if(o==null)throw new _f(`Unable to create ${n} blot`);const a=o,l=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(s),u=new a(t,l,s);return hj.blots.set(u.domNode,u),u}find(t,n=!1){return hj.find(t,n)}query(t,n=Gt.ANY){let s;return typeof t=="string"?s=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?s=this.types.text:typeof t=="number"?t&Gt.LEVEL&Gt.BLOCK?s=this.types.block:t&Gt.LEVEL&Gt.INLINE&&(s=this.types.inline):t instanceof Element&&((t.getAttribute("class")||"").split(/\s+/).some(o=>(s=this.classes[o],!!s)),s=s||this.tags[t.tagName]),s==null?null:"scope"in s&&n&Gt.LEVEL&s.scope&&n&Gt.TYPE&s.scope?s:null}register(...t){return t.map(n=>{const s="blotName"in n,o="attrName"in n;if(!s&&!o)throw new _f("Invalid definition");if(s&&n.blotName==="abstract")throw new _f("Cannot register abstract class");const a=s?n.blotName:o?n.attrName:void 0;return this.types[a]=n,o?typeof n.keyName=="string"&&(this.attributes[n.keyName]=n):s&&(n.className&&(this.classes[n.className]=n),n.tagName&&(Array.isArray(n.tagName)?n.tagName=n.tagName.map(l=>l.toUpperCase()):n.tagName=n.tagName.toUpperCase(),(Array.isArray(n.tagName)?n.tagName:[n.tagName]).forEach(l=>{(this.tags[l]==null||n.className==null)&&(this.tags[l]=n)}))),n})}};Y_.blots=new WeakMap;let Jf=Y_;function Ok(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter(n=>n.indexOf(`${t}-`)===0)}class m0e extends Ua{static keys(t){return(t.getAttribute("class")||"").split(/\s+/).map(n=>n.split("-").slice(0,-1).join("-"))}add(t,n){return this.canAdd(t,n)?(this.remove(t),t.classList.add(`${this.keyName}-${n}`),!0):!1}remove(t){Ok(t,this.keyName).forEach(n=>{t.classList.remove(n)}),t.classList.length===0&&t.removeAttribute("class")}value(t){const n=(Ok(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,n)?n:""}}const ma=m0e;function N5(e){const t=e.split("-"),n=t.slice(1).map(s=>s[0].toUpperCase()+s.slice(1)).join("");return t[0]+n}class x0e extends Ua{static keys(t){return(t.getAttribute("style")||"").split(";").map(n=>n.split(":")[0].trim())}add(t,n){return this.canAdd(t,n)?(t.style[N5(this.keyName)]=n,!0):!1}remove(t){t.style[N5(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const n=t.style[N5(this.keyName)];return this.canAdd(t,n)?n:""}}const Yc=x0e;class b0e{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,n){n?t.add(this.domNode,n)&&(t.value(this.domNode)!=null?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=Jf.find(this.domNode);if(t==null)return;const n=Ua.keys(this.domNode),s=ma.keys(this.domNode),o=Yc.keys(this.domNode);n.concat(s).concat(o).forEach(a=>{const l=t.scroll.query(a,Gt.ATTRIBUTE);l instanceof Ua&&(this.attributes[l.attrName]=l)})}copy(t){Object.keys(this.attributes).forEach(n=>{const s=this.attributes[n].value(this.domNode);t.format(n,s)})}move(t){this.copy(t),Object.keys(this.attributes).forEach(n=>{this.attributes[n].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((t,n)=>(t[n]=this.attributes[n].value(this.domNode),t),{})}}const jy=b0e,K_=class{constructor(t,n){this.scroll=t,this.domNode=n,Jf.blots.set(n,this),this.prev=null,this.next=null}static create(t){if(this.tagName==null)throw new _f("Blot definition missing tagName");let n,s;return Array.isArray(this.tagName)?(typeof t=="string"?(s=t.toUpperCase(),parseInt(s,10).toString()===s&&(s=parseInt(s,10))):typeof t=="number"&&(s=t),typeof s=="number"?n=document.createElement(this.tagName[s-1]):s&&this.tagName.indexOf(s)>-1?n=document.createElement(s):n=document.createElement(this.tagName[0])):n=document.createElement(this.tagName),this.className&&n.classList.add(this.className),n}get statics(){return this.constructor}attach(){}clone(){const t=this.domNode.cloneNode(!1);return this.scroll.create(t)}detach(){this.parent!=null&&this.parent.removeChild(this),Jf.blots.delete(this.domNode)}deleteAt(t,n){this.isolate(t,n).remove()}formatAt(t,n,s,o){const a=this.isolate(t,n);if(this.scroll.query(s,Gt.BLOT)!=null&&o)a.wrap(s,o);else if(this.scroll.query(s,Gt.ATTRIBUTE)!=null){const l=this.scroll.create(this.statics.scope);a.wrap(l),l.format(s,o)}}insertAt(t,n,s){const o=s==null?this.scroll.create("text",n):this.scroll.create(n,s),a=this.split(t);this.parent.insertBefore(o,a||void 0)}isolate(t,n){const s=this.split(t);if(s==null)throw new Error("Attempt to isolate at end");return s.split(n),s}length(){return 1}offset(t=this.parent){return this.parent==null||this===t?0:this.parent.children.offset(this)+this.parent.offset(t)}optimize(t){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(t,n){const s=typeof t=="string"?this.scroll.create(t,n):t;return this.parent!=null&&(this.parent.insertBefore(s,this.next||void 0),this.remove()),s}split(t,n){return t===0?this:this.next}update(t,n){}wrap(t,n){const s=typeof t=="string"?this.scroll.create(t,n):t;if(this.parent!=null&&this.parent.insertBefore(s,this.next||void 0),typeof s.appendChild!="function")throw new _f(`Cannot wrap ${t}`);return s.appendChild(this),s}};K_.blotName="abstract";let X_=K_;const Z_=class extends X_{static value(t){return!0}index(t,n){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(n,1):-1}position(t,n){let s=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(s+=1),[this.parent.domNode,s]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Z_.scope=Gt.INLINE_BLOT;let y0e=Z_;const $s=y0e;class v0e{constructor(){this.head=null,this.tail=null,this.length=0}append(...t){if(this.insertBefore(t[0],null),t.length>1){const n=t.slice(1);this.append(...n)}}at(t){const n=this.iterator();let s=n();for(;s&&t>0;)t-=1,s=n();return s}contains(t){const n=this.iterator();let s=n();for(;s;){if(s===t)return!0;s=n()}return!1}indexOf(t){const n=this.iterator();let s=n(),o=0;for(;s;){if(s===t)return o;o+=1,s=n()}return-1}insertBefore(t,n){t!=null&&(this.remove(t),t.next=n,n!=null?(t.prev=n.prev,n.prev!=null&&(n.prev.next=t),n.prev=t,n===this.head&&(this.head=t)):this.tail!=null?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)}offset(t){let n=0,s=this.head;for(;s!=null;){if(s===t)return n;n+=s.length(),s=s.next}return-1}remove(t){this.contains(t)&&(t.prev!=null&&(t.prev.next=t.next),t.next!=null&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)}iterator(t=this.head){return()=>{const n=t;return t!=null&&(t=t.next),n}}find(t,n=!1){const s=this.iterator();let o=s();for(;o;){const a=o.length();if(t<a||n&&t===a&&(o.next==null||o.next.length()!==0))return[o,t];t-=a,o=s()}return[null,0]}forEach(t){const n=this.iterator();let s=n();for(;s;)t(s),s=n()}forEachAt(t,n,s){if(n<=0)return;const[o,a]=this.find(t);let l=t-a;const u=this.iterator(o);let d=u();for(;d&&l<t+n;){const f=d.length();t>l?s(d,t-l,Math.min(n,l+f-t)):s(d,0,Math.min(f,t+n-l)),l+=f,d=u()}}map(t){return this.reduce((n,s)=>(n.push(t(s)),n),[])}reduce(t,n){const s=this.iterator();let o=s();for(;o;)n=t(n,o),o=s();return n}}function Bk(e,t){const n=t.find(e);if(n)return n;try{return t.create(e)}catch{const s=t.create(Gt.INLINE);return Array.from(e.childNodes).forEach(o=>{s.domNode.appendChild(o)}),e.parentNode&&e.parentNode.replaceChild(s.domNode,e),s.attach(),s}}const Q_=class gc extends X_{constructor(t,n){super(t,n),this.uiNode=null,this.build()}appendChild(t){this.insertBefore(t)}attach(){super.attach(),this.children.forEach(t=>{t.attach()})}attachUI(t){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=t,gc.uiClass&&this.uiNode.classList.add(gc.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new v0e,Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).reverse().forEach(t=>{try{const n=Bk(t,this.scroll);this.insertBefore(n,this.children.head||void 0)}catch(n){if(n instanceof _f)return;throw n}})}deleteAt(t,n){if(t===0&&n===this.length())return this.remove();this.children.forEachAt(t,n,(s,o,a)=>{s.deleteAt(o,a)})}descendant(t,n=0){const[s,o]=this.children.find(n);return t.blotName==null&&t(s)||t.blotName!=null&&s instanceof t?[s,o]:s instanceof gc?s.descendant(t,o):[null,-1]}descendants(t,n=0,s=Number.MAX_VALUE){let o=[],a=s;return this.children.forEachAt(n,s,(l,u,d)=>{(t.blotName==null&&t(l)||t.blotName!=null&&l instanceof t)&&o.push(l),l instanceof gc&&(o=o.concat(l.descendants(t,u,a))),a-=d}),o}detach(){this.children.forEach(t=>{t.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(n=>{t||this.statics.allowedChildren.some(s=>n instanceof s)||(n.statics.scope===Gt.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),t=!0):n instanceof gc?n.unwrap():n.remove())})}formatAt(t,n,s,o){this.children.forEachAt(t,n,(a,l,u)=>{a.formatAt(l,u,s,o)})}insertAt(t,n,s){const[o,a]=this.children.find(t);if(o)o.insertAt(a,n,s);else{const l=s==null?this.scroll.create("text",n):this.scroll.create(n,s);this.appendChild(l)}}insertBefore(t,n){t.parent!=null&&t.parent.children.remove(t);let s=null;this.children.insertBefore(t,n||null),t.parent=this,n!=null&&(s=n.domNode),(this.domNode.parentNode!==t.domNode||this.domNode.nextSibling!==s)&&this.domNode.insertBefore(t.domNode,s),t.attach()}length(){return this.children.reduce((t,n)=>t+n.length(),0)}moveChildren(t,n){this.children.forEach(s=>{t.insertBefore(s,n)})}optimize(t){if(super.optimize(t),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const n=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(n)}else this.remove()}path(t,n=!1){const[s,o]=this.children.find(t,n),a=[[this,t]];return s instanceof gc?a.concat(s.path(o,n)):(s!=null&&a.push([s,o]),a)}removeChild(t){this.children.remove(t)}replaceWith(t,n){const s=typeof t=="string"?this.scroll.create(t,n):t;return s instanceof gc&&this.moveChildren(s),super.replaceWith(s)}split(t,n=!1){if(!n){if(t===0)return this;if(t===this.length())return this.next}const s=this.clone();return this.parent&&this.parent.insertBefore(s,this.next||void 0),this.children.forEachAt(t,this.length(),(o,a,l)=>{const u=o.split(a,n);u!=null&&s.appendChild(u)}),s}splitAfter(t){const n=this.clone();for(;t.next!=null;)n.appendChild(t.next);return this.parent&&this.parent.insertBefore(n,this.next||void 0),n}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(t,n){const s=[],o=[];t.forEach(a=>{a.target===this.domNode&&a.type==="childList"&&(s.push(...a.addedNodes),o.push(...a.removedNodes))}),o.forEach(a=>{if(a.parentNode!=null&&a.tagName!=="IFRAME"&&document.body.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const l=this.scroll.find(a);l!=null&&(l.domNode.parentNode==null||l.domNode.parentNode===this.domNode)&&l.detach()}),s.filter(a=>a.parentNode===this.domNode&&a!==this.uiNode).sort((a,l)=>a===l?0:a.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(a=>{let l=null;a.nextSibling!=null&&(l=this.scroll.find(a.nextSibling));const u=Bk(a,this.scroll);(u.next!==l||u.next==null)&&(u.parent!=null&&u.parent.removeChild(this),this.insertBefore(u,l||void 0))}),this.enforceAllowedChildren()}};Q_.uiClass="";let S0e=Q_;const ua=S0e;function j0e(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}const cf=class uf extends ua{static create(t){return super.create(t)}static formats(t,n){const s=n.query(uf.blotName);if(!(s!=null&&t.tagName===s.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(t,n){super(t,n),this.attributes=new jy(this.domNode)}format(t,n){if(t===this.statics.blotName&&!n)this.children.forEach(s=>{s instanceof uf||(s=s.wrap(uf.blotName,!0)),this.attributes.copy(s)}),this.unwrap();else{const s=this.scroll.query(t,Gt.INLINE);if(s==null)return;s instanceof Ua?this.attributes.attribute(s,n):n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n)}}formats(){const t=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(t[this.statics.blotName]=n),t}formatAt(t,n,s,o){this.formats()[s]!=null||this.scroll.query(s,Gt.ATTRIBUTE)?this.isolate(t,n).format(s,o):super.formatAt(t,n,s,o)}optimize(t){super.optimize(t);const n=this.formats();if(Object.keys(n).length===0)return this.unwrap();const s=this.next;s instanceof uf&&s.prev===this&&j0e(n,s.formats())&&(s.moveChildren(this),s.remove())}replaceWith(t,n){const s=super.replaceWith(t,n);return this.attributes.copy(s),s}update(t,n){super.update(t,n),t.some(s=>s.target===this.domNode&&s.type==="attributes")&&this.attributes.build()}wrap(t,n){const s=super.wrap(t,n);return s instanceof uf&&this.attributes.move(s),s}};cf.allowedChildren=[cf,$s],cf.blotName="inline",cf.scope=Gt.INLINE_BLOT,cf.tagName="SPAN";let C0e=cf;const Lw=C0e,df=class pj extends ua{static create(t){return super.create(t)}static formats(t,n){const s=n.query(pj.blotName);if(!(s!=null&&t.tagName===s.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(t,n){super(t,n),this.attributes=new jy(this.domNode)}format(t,n){const s=this.scroll.query(t,Gt.BLOCK);s!=null&&(s instanceof Ua?this.attributes.attribute(s,n):t===this.statics.blotName&&!n?this.replaceWith(pj.blotName):n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n))}formats(){const t=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(t[this.statics.blotName]=n),t}formatAt(t,n,s,o){this.scroll.query(s,Gt.BLOCK)!=null?this.format(s,o):super.formatAt(t,n,s,o)}insertAt(t,n,s){if(s==null||this.scroll.query(n,Gt.INLINE)!=null)super.insertAt(t,n,s);else{const o=this.split(t);if(o!=null){const a=this.scroll.create(n,s);o.parent.insertBefore(a,o)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(t,n){const s=super.replaceWith(t,n);return this.attributes.copy(s),s}update(t,n){super.update(t,n),t.some(s=>s.target===this.domNode&&s.type==="attributes")&&this.attributes.build()}};df.blotName="block",df.scope=Gt.BLOCK_BLOT,df.tagName="P",df.allowedChildren=[Lw,df,$s];let w0e=df;const Mg=w0e,gj=class extends ua{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,n){super.deleteAt(t,n),this.enforceAllowedChildren()}formatAt(t,n,s,o){super.formatAt(t,n,s,o),this.enforceAllowedChildren()}insertAt(t,n,s){super.insertAt(t,n,s),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};gj.blotName="container",gj.scope=Gt.BLOCK_BLOT;let A0e=gj;const Cy=A0e;class E0e extends $s{static formats(t,n){}format(t,n){super.formatAt(0,this.length(),t,n)}formatAt(t,n,s,o){t===0&&n===this.length()?this.format(s,o):super.formatAt(t,n,s,o)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const ri=E0e,T0e={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},k0e=100,ff=class extends ua{constructor(t,n){super(null,n),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver(s=>{this.update(s)}),this.observer.observe(this.domNode,T0e),this.attach()}create(t,n){return this.registry.create(this,t,n)}find(t,n=!1){const s=this.registry.find(t,n);return s?s.scroll===this?s:n?this.find(s.scroll.domNode.parentNode,!0):null:null}query(t,n=Gt.ANY){return this.registry.query(t,n)}register(...t){return this.registry.register(...t)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,n){this.update(),t===0&&n===this.length()?this.children.forEach(s=>{s.remove()}):super.deleteAt(t,n)}formatAt(t,n,s,o){this.update(),super.formatAt(t,n,s,o)}insertAt(t,n,s){this.update(),super.insertAt(t,n,s)}optimize(t=[],n={}){super.optimize(n);const s=n.mutationsMap||new WeakMap;let o=Array.from(this.observer.takeRecords());for(;o.length>0;)t.push(o.pop());const a=(d,f=!0)=>{d==null||d===this||d.domNode.parentNode!=null&&(s.has(d.domNode)||s.set(d.domNode,[]),f&&a(d.parent))},l=d=>{s.has(d.domNode)&&(d instanceof ua&&d.children.forEach(l),s.delete(d.domNode),d.optimize(n))};let u=t;for(let d=0;u.length>0;d+=1){if(d>=k0e)throw new Error("[Parchment] Maximum optimize iterations reached");for(u.forEach(f=>{const p=this.find(f.target,!0);p!=null&&(p.domNode===f.target&&(f.type==="childList"?(a(this.find(f.previousSibling,!1)),Array.from(f.addedNodes).forEach(g=>{const x=this.find(g,!1);a(x,!1),x instanceof ua&&x.children.forEach(b=>{a(b,!1)})})):f.type==="attributes"&&a(p.prev)),a(p))}),this.children.forEach(l),u=Array.from(this.observer.takeRecords()),o=u.slice();o.length>0;)t.push(o.pop())}}update(t,n={}){t=t||this.observer.takeRecords();const s=new WeakMap;t.map(o=>{const a=this.find(o.target,!0);return a==null?null:s.has(a.domNode)?(s.get(a.domNode).push(o),null):(s.set(a.domNode,[o]),a)}).forEach(o=>{o!=null&&o!==this&&s.has(o.domNode)&&o.update(s.get(o.domNode)||[],n)}),n.mutationsMap=s,s.has(this.domNode)&&super.update(s.get(this.domNode),n),this.optimize(t,n)}};ff.blotName="scroll",ff.defaultChild=Mg,ff.allowedChildren=[Mg,Cy],ff.scope=Gt.BLOCK_BLOT,ff.tagName="DIV";let M0e=ff;const Pw=M0e,mj=class J_ extends $s{static create(t){return document.createTextNode(t)}static value(t){return t.data}constructor(t,n){super(t,n),this.text=this.statics.value(this.domNode)}deleteAt(t,n){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+n)}index(t,n){return this.domNode===t?n:-1}insertAt(t,n,s){s==null?(this.text=this.text.slice(0,t)+n+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,n,s)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof J_&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(t,n=!1){return[this.domNode,t]}split(t,n=!1){if(!n){if(t===0)return this;if(t===this.length())return this.next}const s=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(s,this.next||void 0),this.text=this.statics.value(this.domNode),s}update(t,n){t.some(s=>s.type==="characterData"&&s.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};mj.blotName="text",mj.scope=Gt.INLINE_BLOT;let R0e=mj;const O1=R0e,z0e=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Ua,AttributorStore:jy,BlockBlot:Mg,ClassAttributor:ma,ContainerBlot:Cy,EmbedBlot:ri,InlineBlot:Lw,LeafBlot:$s,ParentBlot:ua,Registry:Jf,Scope:Gt,ScrollBlot:Pw,StyleAttributor:Yc,TextBlot:O1},Symbol.toStringTag,{value:"Module"}));var v0={exports:{}},$5,Nk;function I0e(){if(Nk)return $5;Nk=1;var e=-1,t=1,n=0;function s(P,k,L,O,W){if(P===k)return P?[[n,P]]:[];if(L!=null){var D=B(P,k,L);if(D)return D}var q=u(P,k),K=P.substring(0,q);P=P.substring(q),k=k.substring(q),q=f(P,k);var Y=P.substring(P.length-q);P=P.substring(0,P.length-q),k=k.substring(0,k.length-q);var ie=o(P,k);return K&&ie.unshift([n,K]),Y&&ie.push([n,Y]),M(ie,W),O&&g(ie),ie}function o(P,k){var L;if(!P)return[[t,k]];if(!k)return[[e,P]];var O=P.length>k.length?P:k,W=P.length>k.length?k:P,D=O.indexOf(W);if(D!==-1)return L=[[t,O.substring(0,D)],[n,W],[t,O.substring(D+W.length)]],P.length>k.length&&(L[0][0]=L[2][0]=e),L;if(W.length===1)return[[e,P],[t,k]];var q=p(P,k);if(q){var K=q[0],Y=q[1],ie=q[2],V=q[3],re=q[4],fe=s(K,ie),ae=s(Y,V);return fe.concat([[n,re]],ae)}return a(P,k)}function a(P,k){for(var L=P.length,O=k.length,W=Math.ceil((L+O)/2),D=W,q=2*W,K=new Array(q),Y=new Array(q),ie=0;ie<q;ie++)K[ie]=-1,Y[ie]=-1;K[D+1]=0,Y[D+1]=0;for(var V=L-O,re=V%2!==0,fe=0,ae=0,ue=0,se=0,J=0;J<W;J++){for(var ce=-J+fe;ce<=J-ae;ce+=2){var oe=D+ce,ge;ce===-J||ce!==J&&K[oe-1]<K[oe+1]?ge=K[oe+1]:ge=K[oe-1]+1;for(var de=ge-ce;ge<L&&de<O&&P.charAt(ge)===k.charAt(de);)ge++,de++;if(K[oe]=ge,ge>L)ae+=2;else if(de>O)fe+=2;else if(re){var le=D+V-ce;if(le>=0&&le<q&&Y[le]!==-1){var ee=L-Y[le];if(ge>=ee)return l(P,k,ge,de)}}}for(var X=-J+ue;X<=J-se;X+=2){var le=D+X,ee;X===-J||X!==J&&Y[le-1]<Y[le+1]?ee=Y[le+1]:ee=Y[le-1]+1;for(var ve=ee-X;ee<L&&ve<O&&P.charAt(L-ee-1)===k.charAt(O-ve-1);)ee++,ve++;if(Y[le]=ee,ee>L)se+=2;else if(ve>O)ue+=2;else if(!re){var oe=D+V-X;if(oe>=0&&oe<q&&K[oe]!==-1){var ge=K[oe],de=D+ge-oe;if(ee=L-ee,ge>=ee)return l(P,k,ge,de)}}}}return[[e,P],[t,k]]}function l(P,k,L,O){var W=P.substring(0,L),D=k.substring(0,O),q=P.substring(L),K=k.substring(O),Y=s(W,D),ie=s(q,K);return Y.concat(ie)}function u(P,k){if(!P||!k||P.charAt(0)!==k.charAt(0))return 0;for(var L=0,O=Math.min(P.length,k.length),W=O,D=0;L<W;)P.substring(D,W)==k.substring(D,W)?(L=W,D=L):O=W,W=Math.floor((O-L)/2+L);return R(P.charCodeAt(W-1))&&W--,W}function d(P,k){var L=P.length,O=k.length;if(L==0||O==0)return 0;L>O?P=P.substring(L-O):L<O&&(k=k.substring(0,L));var W=Math.min(L,O);if(P==k)return W;for(var D=0,q=1;;){var K=P.substring(W-q),Y=k.indexOf(K);if(Y==-1)return D;q+=Y,(Y==0||P.substring(W-q)==k.substring(0,q))&&(D=q,q++)}}function f(P,k){if(!P||!k||P.slice(-1)!==k.slice(-1))return 0;for(var L=0,O=Math.min(P.length,k.length),W=O,D=0;L<W;)P.substring(P.length-W,P.length-D)==k.substring(k.length-W,k.length-D)?(L=W,D=L):O=W,W=Math.floor((O-L)/2+L);return _(P.charCodeAt(P.length-W))&&W--,W}function p(P,k){var L=P.length>k.length?P:k,O=P.length>k.length?k:P;if(L.length<4||O.length*2<L.length)return null;function W(ae,ue,se){for(var J=ae.substring(se,se+Math.floor(ae.length/4)),ce=-1,oe="",ge,de,le,ee;(ce=ue.indexOf(J,ce+1))!==-1;){var X=u(ae.substring(se),ue.substring(ce)),ve=f(ae.substring(0,se),ue.substring(0,ce));oe.length<ve+X&&(oe=ue.substring(ce-ve,ce)+ue.substring(ce,ce+X),ge=ae.substring(0,se-ve),de=ae.substring(se+X),le=ue.substring(0,ce-ve),ee=ue.substring(ce+X))}return oe.length*2>=ae.length?[ge,de,le,ee,oe]:null}var D=W(L,O,Math.ceil(L.length/4)),q=W(L,O,Math.ceil(L.length/2)),K;if(!D&&!q)return null;q?D?K=D[4].length>q[4].length?D:q:K=q:K=D;var Y,ie,V,re;P.length>k.length?(Y=K[0],ie=K[1],V=K[2],re=K[3]):(V=K[0],re=K[1],Y=K[2],ie=K[3]);var fe=K[4];return[Y,ie,V,re,fe]}function g(P){for(var k=!1,L=[],O=0,W=null,D=0,q=0,K=0,Y=0,ie=0;D<P.length;)P[D][0]==n?(L[O++]=D,q=Y,K=ie,Y=0,ie=0,W=P[D][1]):(P[D][0]==t?Y+=P[D][1].length:ie+=P[D][1].length,W&&W.length<=Math.max(q,K)&&W.length<=Math.max(Y,ie)&&(P.splice(L[O-1],0,[e,W]),P[L[O-1]+1][0]=t,O--,O--,D=O>0?L[O-1]:-1,q=0,K=0,Y=0,ie=0,W=null,k=!0)),D++;for(k&&M(P),A(P),D=1;D<P.length;){if(P[D-1][0]==e&&P[D][0]==t){var V=P[D-1][1],re=P[D][1],fe=d(V,re),ae=d(re,V);fe>=ae?(fe>=V.length/2||fe>=re.length/2)&&(P.splice(D,0,[n,re.substring(0,fe)]),P[D-1][1]=V.substring(0,V.length-fe),P[D+1][1]=re.substring(fe),D++):(ae>=V.length/2||ae>=re.length/2)&&(P.splice(D,0,[n,V.substring(0,ae)]),P[D-1][0]=t,P[D-1][1]=re.substring(0,re.length-ae),P[D+1][0]=e,P[D+1][1]=V.substring(ae),D++),D++}D++}}var x=/[^a-zA-Z0-9]/,b=/\s/,y=/[\r\n]/,S=/\n\r?\n$/,j=/^\r?\n\r?\n/;function A(P){function k(ae,ue){if(!ae||!ue)return 6;var se=ae.charAt(ae.length-1),J=ue.charAt(0),ce=se.match(x),oe=J.match(x),ge=ce&&se.match(b),de=oe&&J.match(b),le=ge&&se.match(y),ee=de&&J.match(y),X=le&&ae.match(S),ve=ee&&ue.match(j);return X||ve?5:le||ee?4:ce&&!ge&&de?3:ge||de?2:ce||oe?1:0}for(var L=1;L<P.length-1;){if(P[L-1][0]==n&&P[L+1][0]==n){var O=P[L-1][1],W=P[L][1],D=P[L+1][1],q=f(O,W);if(q){var K=W.substring(W.length-q);O=O.substring(0,O.length-q),W=K+W.substring(0,W.length-q),D=K+D}for(var Y=O,ie=W,V=D,re=k(O,W)+k(W,D);W.charAt(0)===D.charAt(0);){O+=W.charAt(0),W=W.substring(1)+D.charAt(0),D=D.substring(1);var fe=k(O,W)+k(W,D);fe>=re&&(re=fe,Y=O,ie=W,V=D)}P[L-1][1]!=Y&&(Y?P[L-1][1]=Y:(P.splice(L-1,1),L--),P[L][1]=ie,V?P[L+1][1]=V:(P.splice(L+1,1),L--))}L++}}function M(P,k){P.push([n,""]);for(var L=0,O=0,W=0,D="",q="",K;L<P.length;){if(L<P.length-1&&!P[L][1]){P.splice(L,1);continue}switch(P[L][0]){case t:W++,q+=P[L][1],L++;break;case e:O++,D+=P[L][1],L++;break;case n:var Y=L-W-O-1;if(k){if(Y>=0&&F(P[Y][1])){var ie=P[Y][1].slice(-1);if(P[Y][1]=P[Y][1].slice(0,-1),D=ie+D,q=ie+q,!P[Y][1]){P.splice(Y,1),L--;var V=Y-1;P[V]&&P[V][0]===t&&(W++,q=P[V][1]+q,V--),P[V]&&P[V][0]===e&&(O++,D=P[V][1]+D,V--),Y=V}}if(z(P[L][1])){var ie=P[L][1].charAt(0);P[L][1]=P[L][1].slice(1),D+=ie,q+=ie}}if(L<P.length-1&&!P[L][1]){P.splice(L,1);break}if(D.length>0||q.length>0){D.length>0&&q.length>0&&(K=u(q,D),K!==0&&(Y>=0?P[Y][1]+=q.substring(0,K):(P.splice(0,0,[n,q.substring(0,K)]),L++),q=q.substring(K),D=D.substring(K)),K=f(q,D),K!==0&&(P[L][1]=q.substring(q.length-K)+P[L][1],q=q.substring(0,q.length-K),D=D.substring(0,D.length-K)));var re=W+O;D.length===0&&q.length===0?(P.splice(L-re,re),L=L-re):D.length===0?(P.splice(L-re,re,[t,q]),L=L-re+1):q.length===0?(P.splice(L-re,re,[e,D]),L=L-re+1):(P.splice(L-re,re,[e,D],[t,q]),L=L-re+2)}L!==0&&P[L-1][0]===n?(P[L-1][1]+=P[L][1],P.splice(L,1)):L++,W=0,O=0,D="",q="";break}}P[P.length-1][1]===""&&P.pop();var fe=!1;for(L=1;L<P.length-1;)P[L-1][0]===n&&P[L+1][0]===n&&(P[L][1].substring(P[L][1].length-P[L-1][1].length)===P[L-1][1]?(P[L][1]=P[L-1][1]+P[L][1].substring(0,P[L][1].length-P[L-1][1].length),P[L+1][1]=P[L-1][1]+P[L+1][1],P.splice(L-1,1),fe=!0):P[L][1].substring(0,P[L+1][1].length)==P[L+1][1]&&(P[L-1][1]+=P[L+1][1],P[L][1]=P[L][1].substring(P[L+1][1].length)+P[L+1][1],P.splice(L+1,1),fe=!0)),L++;fe&&M(P,k)}function R(P){return P>=55296&&P<=56319}function _(P){return P>=56320&&P<=57343}function z(P){return _(P.charCodeAt(0))}function F(P){return R(P.charCodeAt(P.length-1))}function N(P){for(var k=[],L=0;L<P.length;L++)P[L][1].length>0&&k.push(P[L]);return k}function I(P,k,L,O){return F(P)||z(O)?null:N([[n,P],[e,k],[t,L],[n,O]])}function B(P,k,L){var O=typeof L=="number"?{index:L,length:0}:L.oldRange,W=typeof L=="number"?null:L.newRange,D=P.length,q=k.length;if(O.length===0&&(W===null||W.length===0)){var K=O.index,Y=P.slice(0,K),ie=P.slice(K),V=W?W.index:null;e:{var re=K+q-D;if(V!==null&&V!==re||re<0||re>q)break e;var fe=k.slice(0,re),ae=k.slice(re);if(ae!==ie)break e;var ue=Math.min(K,re),se=Y.slice(0,ue),J=fe.slice(0,ue);if(se!==J)break e;var ce=Y.slice(ue),oe=fe.slice(ue);return I(se,ce,oe,ie)}e:{if(V!==null&&V!==K)break e;var ge=K,fe=k.slice(0,ge),ae=k.slice(ge);if(fe!==Y)break e;var de=Math.min(D-ge,q-ge),le=ie.slice(ie.length-de),ee=ae.slice(ae.length-de);if(le!==ee)break e;var ce=ie.slice(0,ie.length-de),oe=ae.slice(0,ae.length-de);return I(Y,ce,oe,le)}}if(O.length>0&&W&&W.length===0)e:{var se=P.slice(0,O.index),le=P.slice(O.index+O.length),ue=se.length,de=le.length;if(q<ue+de)break e;var J=k.slice(0,ue),ee=k.slice(q-de);if(se!==J||le!==ee)break e;var ce=P.slice(ue,D-de),oe=k.slice(ue,q-de);return I(se,ce,oe,le)}return null}function H(P,k,L,O){return s(P,k,L,O,!0)}return H.INSERT=t,H.DELETE=e,H.EQUAL=n,$5=H,$5}var _p={exports:{}};_p.exports;var $k;function eL(){return $k||($k=1,(function(e,t){var n=200,s="__lodash_hash_undefined__",o=9007199254740991,a="[object Arguments]",l="[object Array]",u="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Function]",g="[object GeneratorFunction]",x="[object Map]",b="[object Number]",y="[object Object]",S="[object Promise]",j="[object RegExp]",A="[object Set]",M="[object String]",R="[object Symbol]",_="[object WeakMap]",z="[object ArrayBuffer]",F="[object DataView]",N="[object Float32Array]",I="[object Float64Array]",B="[object Int8Array]",H="[object Int16Array]",P="[object Int32Array]",k="[object Uint8Array]",L="[object Uint8ClampedArray]",O="[object Uint16Array]",W="[object Uint32Array]",D=/[\\^$.*+?()[\]{}|]/g,q=/\w*$/,K=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,ie={};ie[a]=ie[l]=ie[z]=ie[F]=ie[u]=ie[d]=ie[N]=ie[I]=ie[B]=ie[H]=ie[P]=ie[x]=ie[b]=ie[y]=ie[j]=ie[A]=ie[M]=ie[R]=ie[k]=ie[L]=ie[O]=ie[W]=!0,ie[f]=ie[p]=ie[_]=!1;var V=typeof jc=="object"&&jc&&jc.Object===Object&&jc,re=typeof self=="object"&&self&&self.Object===Object&&self,fe=V||re||Function("return this")(),ae=t&&!t.nodeType&&t,ue=ae&&!0&&e&&!e.nodeType&&e,se=ue&&ue.exports===ae;function J($,ne){return $.set(ne[0],ne[1]),$}function ce($,ne){return $.add(ne),$}function oe($,ne){for(var be=-1,We=$?$.length:0;++be<We&&ne($[be],be,$)!==!1;);return $}function ge($,ne){for(var be=-1,We=ne.length,Jt=$.length;++be<We;)$[Jt+be]=ne[be];return $}function de($,ne,be,We){for(var Jt=-1,Ut=$?$.length:0;++Jt<Ut;)be=ne(be,$[Jt],Jt,$);return be}function le($,ne){for(var be=-1,We=Array($);++be<$;)We[be]=ne(be);return We}function ee($,ne){return $?.[ne]}function X($){var ne=!1;if($!=null&&typeof $.toString!="function")try{ne=!!($+"")}catch{}return ne}function ve($){var ne=-1,be=Array($.size);return $.forEach(function(We,Jt){be[++ne]=[Jt,We]}),be}function st($,ne){return function(be){return $(ne(be))}}function Ge($){var ne=-1,be=Array($.size);return $.forEach(function(We){be[++ne]=We}),be}var qe=Array.prototype,Be=Function.prototype,Te=Object.prototype,Re=fe["__core-js_shared__"],Se=(function(){var $=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""})(),Ke=Be.toString,ot=Te.hasOwnProperty,He=Te.toString,$e=RegExp("^"+Ke.call(ot).replace(D,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Z=se?fe.Buffer:void 0,pe=fe.Symbol,Q=fe.Uint8Array,me=st(Object.getPrototypeOf,Object),we=Object.create,et=Te.propertyIsEnumerable,ht=qe.splice,ct=Object.getOwnPropertySymbols,bt=Z?Z.isBuffer:void 0,wt=st(Object.keys,Object),gn=lo(fe,"DataView"),mn=lo(fe,"Map"),ut=lo(fe,"Promise"),_t=lo(fe,"Set"),Yt=lo(fe,"WeakMap"),Xt=lo(Object,"create"),ln=ms(gn),pr=ms(mn),nr=ms(ut),Bn=ms(_t),Ht=ms(Yt),rn=pe?pe.prototype:void 0,yt=rn?rn.valueOf:void 0;function Ft($){var ne=-1,be=$?$.length:0;for(this.clear();++ne<be;){var We=$[ne];this.set(We[0],We[1])}}function un(){this.__data__=Xt?Xt(null):{}}function an($){return this.has($)&&delete this.__data__[$]}function he($){var ne=this.__data__;if(Xt){var be=ne[$];return be===s?void 0:be}return ot.call(ne,$)?ne[$]:void 0}function Ee($){var ne=this.__data__;return Xt?ne[$]!==void 0:ot.call(ne,$)}function Fe($,ne){var be=this.__data__;return be[$]=Xt&&ne===void 0?s:ne,this}Ft.prototype.clear=un,Ft.prototype.delete=an,Ft.prototype.get=he,Ft.prototype.has=Ee,Ft.prototype.set=Fe;function Xe($){var ne=-1,be=$?$.length:0;for(this.clear();++ne<be;){var We=$[ne];this.set(We[0],We[1])}}function dt(){this.__data__=[]}function At($){var ne=this.__data__,be=ir(ne,$);if(be<0)return!1;var We=ne.length-1;return be==We?ne.pop():ht.call(ne,be,1),!0}function at($){var ne=this.__data__,be=ir(ne,$);return be<0?void 0:ne[be][1]}function lt($){return ir(this.__data__,$)>-1}function kt($,ne){var be=this.__data__,We=ir(be,$);return We<0?be.push([$,ne]):be[We][1]=ne,this}Xe.prototype.clear=dt,Xe.prototype.delete=At,Xe.prototype.get=at,Xe.prototype.has=lt,Xe.prototype.set=kt;function vt($){var ne=-1,be=$?$.length:0;for(this.clear();++ne<be;){var We=$[ne];this.set(We[0],We[1])}}function Nt(){this.__data__={hash:new Ft,map:new(mn||Xe),string:new Ft}}function Dt($){return ya(this,$).delete($)}function vn($){return ya(this,$).get($)}function cn($){return ya(this,$).has($)}function An($,ne){return ya(this,$).set($,ne),this}vt.prototype.clear=Nt,vt.prototype.delete=Dt,vt.prototype.get=vn,vt.prototype.has=cn,vt.prototype.set=An;function dn($){this.__data__=new Xe($)}function Oe(){this.__data__=new Xe}function _e($){return this.__data__.delete($)}function ft($){return this.__data__.get($)}function Lt($){return this.__data__.has($)}function Qt($,ne){var be=this.__data__;if(be instanceof Xe){var We=be.__data__;if(!mn||We.length<n-1)return We.push([$,ne]),this;be=this.__data__=new vt(We)}return be.set($,ne),this}dn.prototype.clear=Oe,dn.prototype.delete=_e,dn.prototype.get=ft,dn.prototype.has=Lt,dn.prototype.set=Qt;function sn($,ne){var be=Wl($)||_o($)?le($.length,String):[],We=be.length,Jt=!!We;for(var Ut in $)ot.call($,Ut)&&!(Jt&&(Ut=="length"||fh(Ut,We)))&&be.push(Ut);return be}function on($,ne,be){var We=$[ne];(!(ot.call($,ne)&&Yi(We,be))||be===void 0&&!(ne in $))&&($[ne]=be)}function ir($,ne){for(var be=$.length;be--;)if(Yi($[be][0],ne))return be;return-1}function $r($,ne){return $&&Nl(ne,Za(ne),$)}function Ts($,ne,be,We,Jt,Ut,wn){var Ln;if(We&&(Ln=Ut?We($,Jt,Ut,wn):We($)),Ln!==void 0)return Ln;if(!Ds($))return $;var _r=Wl($);if(_r){if(Ln=ld($),!ne)return Kc($,Ln)}else{var $n=Gi($),qr=$n==p||$n==g;if(Sa($))return Hn($,ne);if($n==y||$n==a||qr&&!Ut){if(X($))return Ut?$:{};if(Ln=Fo(qr?{}:$),!ne)return Xc($,$r(Ln,$))}else{if(!ie[$n])return Ut?$:{};Ln=Zc($,$n,Ts,ne)}}wn||(wn=new dn);var xs=wn.get($);if(xs)return xs;if(wn.set($,Ln),!_r)var Vr=be?ba($):Za($);return oe(Vr||$,function(Cs,bs){Vr&&(bs=Cs,Cs=$[bs]),on(Ln,bs,Ts(Cs,ne,be,We,bs,$,wn))}),Ln}function zo($){return Ds($)?we($):{}}function Io($,ne,be){var We=ne($);return Wl($)?We:ge(We,be($))}function zt($){return He.call($)}function Nn($){if(!Ds($)||$l($))return!1;var ne=Vs($)||X($)?$e:K;return ne.test(ms($))}function ar($){if(!co($))return wt($);var ne=[];for(var be in Object($))ot.call($,be)&&be!="constructor"&&ne.push(be);return ne}function Hn($,ne){if(ne)return $.slice();var be=new $.constructor($.length);return $.copy(be),be}function Xn($){var ne=new $.constructor($.byteLength);return new Q(ne).set(new Q($)),ne}function ao($,ne){var be=ne?Xn($.buffer):$.buffer;return new $.constructor(be,$.byteOffset,$.byteLength)}function Vi($,ne,be){var We=ne?be(ve($),!0):ve($);return de(We,J,new $.constructor)}function Xa($){var ne=new $.constructor($.source,q.exec($));return ne.lastIndex=$.lastIndex,ne}function Bl($,ne,be){var We=ne?be(Ge($),!0):Ge($);return de(We,ce,new $.constructor)}function dh($){return yt?Object(yt.call($)):{}}function Ls($,ne){var be=ne?Xn($.buffer):$.buffer;return new $.constructor(be,$.byteOffset,$.length)}function Kc($,ne){var be=-1,We=$.length;for(ne||(ne=Array(We));++be<We;)ne[be]=$[be];return ne}function Nl($,ne,be,We){be||(be={});for(var Jt=-1,Ut=ne.length;++Jt<Ut;){var wn=ne[Jt],Ln=void 0;on(be,wn,Ln===void 0?$[wn]:Ln)}return be}function Xc($,ne){return Nl($,Ps($),ne)}function ba($){return Io($,Za,Ps)}function ya($,ne){var be=$.__data__;return hh(ne)?be[typeof ne=="string"?"string":"hash"]:be.map}function lo($,ne){var be=ee($,ne);return Nn(be)?be:void 0}var Ps=ct?st(ct,Object):ql,Gi=zt;(gn&&Gi(new gn(new ArrayBuffer(1)))!=F||mn&&Gi(new mn)!=x||ut&&Gi(ut.resolve())!=S||_t&&Gi(new _t)!=A||Yt&&Gi(new Yt)!=_)&&(Gi=function($){var ne=He.call($),be=ne==y?$.constructor:void 0,We=be?ms(be):void 0;if(We)switch(We){case ln:return F;case pr:return x;case nr:return S;case Bn:return A;case Ht:return _}return ne});function ld($){var ne=$.length,be=$.constructor(ne);return ne&&typeof $[0]=="string"&&ot.call($,"index")&&(be.index=$.index,be.input=$.input),be}function Fo($){return typeof $.constructor=="function"&&!co($)?zo(me($)):{}}function Zc($,ne,be,We){var Jt=$.constructor;switch(ne){case z:return Xn($);case u:case d:return new Jt(+$);case F:return ao($,We);case N:case I:case B:case H:case P:case k:case L:case O:case W:return Ls($,We);case x:return Vi($,We,be);case b:case M:return new Jt($);case j:return Xa($);case A:return Bl($,We,be);case R:return dh($)}}function fh($,ne){return ne=ne??o,!!ne&&(typeof $=="number"||Y.test($))&&$>-1&&$%1==0&&$<ne}function hh($){var ne=typeof $;return ne=="string"||ne=="number"||ne=="symbol"||ne=="boolean"?$!=="__proto__":$===null}function $l($){return!!Se&&Se in $}function co($){var ne=$&&$.constructor,be=typeof ne=="function"&&ne.prototype||Te;return $===be}function ms($){if($!=null){try{return Ke.call($)}catch{}try{return $+""}catch{}}return""}function Hl($){return Ts($,!0,!0)}function Yi($,ne){return $===ne||$!==$&&ne!==ne}function _o($){return cd($)&&ot.call($,"callee")&&(!et.call($,"callee")||He.call($)==a)}var Wl=Array.isArray;function va($){return $!=null&&Ul($.length)&&!Vs($)}function cd($){return Lo($)&&va($)}var Sa=bt||ud;function Vs($){var ne=Ds($)?He.call($):"";return ne==p||ne==g}function Ul($){return typeof $=="number"&&$>-1&&$%1==0&&$<=o}function Ds($){var ne=typeof $;return!!$&&(ne=="object"||ne=="function")}function Lo($){return!!$&&typeof $=="object"}function Za($){return va($)?sn($):ar($)}function ql(){return[]}function ud(){return!1}e.exports=Hl})(_p,_p.exports)),_p.exports}var Lp={exports:{}};Lp.exports;var Hk;function tL(){return Hk||(Hk=1,(function(e,t){var n=200,s="__lodash_hash_undefined__",o=1,a=2,l=9007199254740991,u="[object Arguments]",d="[object Array]",f="[object AsyncFunction]",p="[object Boolean]",g="[object Date]",x="[object Error]",b="[object Function]",y="[object GeneratorFunction]",S="[object Map]",j="[object Number]",A="[object Null]",M="[object Object]",R="[object Promise]",_="[object Proxy]",z="[object RegExp]",F="[object Set]",N="[object String]",I="[object Symbol]",B="[object Undefined]",H="[object WeakMap]",P="[object ArrayBuffer]",k="[object DataView]",L="[object Float32Array]",O="[object Float64Array]",W="[object Int8Array]",D="[object Int16Array]",q="[object Int32Array]",K="[object Uint8Array]",Y="[object Uint8ClampedArray]",ie="[object Uint16Array]",V="[object Uint32Array]",re=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,ae=/^(?:0|[1-9]\d*)$/,ue={};ue[L]=ue[O]=ue[W]=ue[D]=ue[q]=ue[K]=ue[Y]=ue[ie]=ue[V]=!0,ue[u]=ue[d]=ue[P]=ue[p]=ue[k]=ue[g]=ue[x]=ue[b]=ue[S]=ue[j]=ue[M]=ue[z]=ue[F]=ue[N]=ue[H]=!1;var se=typeof jc=="object"&&jc&&jc.Object===Object&&jc,J=typeof self=="object"&&self&&self.Object===Object&&self,ce=se||J||Function("return this")(),oe=t&&!t.nodeType&&t,ge=oe&&!0&&e&&!e.nodeType&&e,de=ge&&ge.exports===oe,le=de&&se.process,ee=(function(){try{return le&&le.binding&&le.binding("util")}catch{}})(),X=ee&&ee.isTypedArray;function ve($,ne){for(var be=-1,We=$==null?0:$.length,Jt=0,Ut=[];++be<We;){var wn=$[be];ne(wn,be,$)&&(Ut[Jt++]=wn)}return Ut}function st($,ne){for(var be=-1,We=ne.length,Jt=$.length;++be<We;)$[Jt+be]=ne[be];return $}function Ge($,ne){for(var be=-1,We=$==null?0:$.length;++be<We;)if(ne($[be],be,$))return!0;return!1}function qe($,ne){for(var be=-1,We=Array($);++be<$;)We[be]=ne(be);return We}function Be($){return function(ne){return $(ne)}}function Te($,ne){return $.has(ne)}function Re($,ne){return $?.[ne]}function Se($){var ne=-1,be=Array($.size);return $.forEach(function(We,Jt){be[++ne]=[Jt,We]}),be}function Ke($,ne){return function(be){return $(ne(be))}}function ot($){var ne=-1,be=Array($.size);return $.forEach(function(We){be[++ne]=We}),be}var He=Array.prototype,$e=Function.prototype,Z=Object.prototype,pe=ce["__core-js_shared__"],Q=$e.toString,me=Z.hasOwnProperty,we=(function(){var $=/[^.]+$/.exec(pe&&pe.keys&&pe.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""})(),et=Z.toString,ht=RegExp("^"+Q.call(me).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ct=de?ce.Buffer:void 0,bt=ce.Symbol,wt=ce.Uint8Array,gn=Z.propertyIsEnumerable,mn=He.splice,ut=bt?bt.toStringTag:void 0,_t=Object.getOwnPropertySymbols,Yt=ct?ct.isBuffer:void 0,Xt=Ke(Object.keys,Object),ln=Ps(ce,"DataView"),pr=Ps(ce,"Map"),nr=Ps(ce,"Promise"),Bn=Ps(ce,"Set"),Ht=Ps(ce,"WeakMap"),rn=Ps(Object,"create"),yt=ms(ln),Ft=ms(pr),un=ms(nr),an=ms(Bn),he=ms(Ht),Ee=bt?bt.prototype:void 0,Fe=Ee?Ee.valueOf:void 0;function Xe($){var ne=-1,be=$==null?0:$.length;for(this.clear();++ne<be;){var We=$[ne];this.set(We[0],We[1])}}function dt(){this.__data__=rn?rn(null):{},this.size=0}function At($){var ne=this.has($)&&delete this.__data__[$];return this.size-=ne?1:0,ne}function at($){var ne=this.__data__;if(rn){var be=ne[$];return be===s?void 0:be}return me.call(ne,$)?ne[$]:void 0}function lt($){var ne=this.__data__;return rn?ne[$]!==void 0:me.call(ne,$)}function kt($,ne){var be=this.__data__;return this.size+=this.has($)?0:1,be[$]=rn&&ne===void 0?s:ne,this}Xe.prototype.clear=dt,Xe.prototype.delete=At,Xe.prototype.get=at,Xe.prototype.has=lt,Xe.prototype.set=kt;function vt($){var ne=-1,be=$==null?0:$.length;for(this.clear();++ne<be;){var We=$[ne];this.set(We[0],We[1])}}function Nt(){this.__data__=[],this.size=0}function Dt($){var ne=this.__data__,be=Hn(ne,$);if(be<0)return!1;var We=ne.length-1;return be==We?ne.pop():mn.call(ne,be,1),--this.size,!0}function vn($){var ne=this.__data__,be=Hn(ne,$);return be<0?void 0:ne[be][1]}function cn($){return Hn(this.__data__,$)>-1}function An($,ne){var be=this.__data__,We=Hn(be,$);return We<0?(++this.size,be.push([$,ne])):be[We][1]=ne,this}vt.prototype.clear=Nt,vt.prototype.delete=Dt,vt.prototype.get=vn,vt.prototype.has=cn,vt.prototype.set=An;function dn($){var ne=-1,be=$==null?0:$.length;for(this.clear();++ne<be;){var We=$[ne];this.set(We[0],We[1])}}function Oe(){this.size=0,this.__data__={hash:new Xe,map:new(pr||vt),string:new Xe}}function _e($){var ne=lo(this,$).delete($);return this.size-=ne?1:0,ne}function ft($){return lo(this,$).get($)}function Lt($){return lo(this,$).has($)}function Qt($,ne){var be=lo(this,$),We=be.size;return be.set($,ne),this.size+=be.size==We?0:1,this}dn.prototype.clear=Oe,dn.prototype.delete=_e,dn.prototype.get=ft,dn.prototype.has=Lt,dn.prototype.set=Qt;function sn($){var ne=-1,be=$==null?0:$.length;for(this.__data__=new dn;++ne<be;)this.add($[ne])}function on($){return this.__data__.set($,s),this}function ir($){return this.__data__.has($)}sn.prototype.add=sn.prototype.push=on,sn.prototype.has=ir;function $r($){var ne=this.__data__=new vt($);this.size=ne.size}function Ts(){this.__data__=new vt,this.size=0}function zo($){var ne=this.__data__,be=ne.delete($);return this.size=ne.size,be}function Io($){return this.__data__.get($)}function zt($){return this.__data__.has($)}function Nn($,ne){var be=this.__data__;if(be instanceof vt){var We=be.__data__;if(!pr||We.length<n-1)return We.push([$,ne]),this.size=++be.size,this;be=this.__data__=new dn(We)}return be.set($,ne),this.size=be.size,this}$r.prototype.clear=Ts,$r.prototype.delete=zo,$r.prototype.get=Io,$r.prototype.has=zt,$r.prototype.set=Nn;function ar($,ne){var be=_o($),We=!be&&Yi($),Jt=!be&&!We&&va($),Ut=!be&&!We&&!Jt&&Lo($),wn=be||We||Jt||Ut,Ln=wn?qe($.length,String):[],_r=Ln.length;for(var $n in $)me.call($,$n)&&!(wn&&($n=="length"||Jt&&($n=="offset"||$n=="parent")||Ut&&($n=="buffer"||$n=="byteLength"||$n=="byteOffset")||Zc($n,_r)))&&Ln.push($n);return Ln}function Hn($,ne){for(var be=$.length;be--;)if(Hl($[be][0],ne))return be;return-1}function Xn($,ne,be){var We=ne($);return _o($)?We:st(We,be($))}function ao($){return $==null?$===void 0?B:A:ut&&ut in Object($)?Gi($):co($)}function Vi($){return Ds($)&&ao($)==u}function Xa($,ne,be,We,Jt){return $===ne?!0:$==null||ne==null||!Ds($)&&!Ds(ne)?$!==$&&ne!==ne:Bl($,ne,be,We,Xa,Jt)}function Bl($,ne,be,We,Jt,Ut){var wn=_o($),Ln=_o(ne),_r=wn?d:Fo($),$n=Ln?d:Fo(ne);_r=_r==u?M:_r,$n=$n==u?M:$n;var qr=_r==M,xs=$n==M,Vr=_r==$n;if(Vr&&va($)){if(!va(ne))return!1;wn=!0,qr=!1}if(Vr&&!qr)return Ut||(Ut=new $r),wn||Lo($)?Nl($,ne,be,We,Jt,Ut):Xc($,ne,_r,be,We,Jt,Ut);if(!(be&o)){var Cs=qr&&me.call($,"__wrapped__"),bs=xs&&me.call(ne,"__wrapped__");if(Cs||bs){var ja=Cs?$.value():$,Po=bs?ne.value():ne;return Ut||(Ut=new $r),Jt(ja,Po,be,We,Ut)}}return Vr?(Ut||(Ut=new $r),ba($,ne,be,We,Jt,Ut)):!1}function dh($){if(!Ul($)||hh($))return!1;var ne=Sa($)?ht:fe;return ne.test(ms($))}function Ls($){return Ds($)&&Vs($.length)&&!!ue[ao($)]}function Kc($){if(!$l($))return Xt($);var ne=[];for(var be in Object($))me.call($,be)&&be!="constructor"&&ne.push(be);return ne}function Nl($,ne,be,We,Jt,Ut){var wn=be&o,Ln=$.length,_r=ne.length;if(Ln!=_r&&!(wn&&_r>Ln))return!1;var $n=Ut.get($);if($n&&Ut.get(ne))return $n==ne;var qr=-1,xs=!0,Vr=be&a?new sn:void 0;for(Ut.set($,ne),Ut.set(ne,$);++qr<Ln;){var Cs=$[qr],bs=ne[qr];if(We)var ja=wn?We(bs,Cs,qr,ne,$,Ut):We(Cs,bs,qr,$,ne,Ut);if(ja!==void 0){if(ja)continue;xs=!1;break}if(Vr){if(!Ge(ne,function(Po,Qa){if(!Te(Vr,Qa)&&(Cs===Po||Jt(Cs,Po,be,We,Ut)))return Vr.push(Qa)})){xs=!1;break}}else if(!(Cs===bs||Jt(Cs,bs,be,We,Ut))){xs=!1;break}}return Ut.delete($),Ut.delete(ne),xs}function Xc($,ne,be,We,Jt,Ut,wn){switch(be){case k:if($.byteLength!=ne.byteLength||$.byteOffset!=ne.byteOffset)return!1;$=$.buffer,ne=ne.buffer;case P:return!($.byteLength!=ne.byteLength||!Ut(new wt($),new wt(ne)));case p:case g:case j:return Hl(+$,+ne);case x:return $.name==ne.name&&$.message==ne.message;case z:case N:return $==ne+"";case S:var Ln=Se;case F:var _r=We&o;if(Ln||(Ln=ot),$.size!=ne.size&&!_r)return!1;var $n=wn.get($);if($n)return $n==ne;We|=a,wn.set($,ne);var qr=Nl(Ln($),Ln(ne),We,Jt,Ut,wn);return wn.delete($),qr;case I:if(Fe)return Fe.call($)==Fe.call(ne)}return!1}function ba($,ne,be,We,Jt,Ut){var wn=be&o,Ln=ya($),_r=Ln.length,$n=ya(ne),qr=$n.length;if(_r!=qr&&!wn)return!1;for(var xs=_r;xs--;){var Vr=Ln[xs];if(!(wn?Vr in ne:me.call(ne,Vr)))return!1}var Cs=Ut.get($);if(Cs&&Ut.get(ne))return Cs==ne;var bs=!0;Ut.set($,ne),Ut.set(ne,$);for(var ja=wn;++xs<_r;){Vr=Ln[xs];var Po=$[Vr],Qa=ne[Vr];if(We)var zm=wn?We(Qa,Po,Vr,ne,$,Ut):We(Po,Qa,Vr,$,ne,Ut);if(!(zm===void 0?Po===Qa||Jt(Po,Qa,be,We,Ut):zm)){bs=!1;break}ja||(ja=Vr=="constructor")}if(bs&&!ja){var dd=$.constructor,fd=ne.constructor;dd!=fd&&"constructor"in $&&"constructor"in ne&&!(typeof dd=="function"&&dd instanceof dd&&typeof fd=="function"&&fd instanceof fd)&&(bs=!1)}return Ut.delete($),Ut.delete(ne),bs}function ya($){return Xn($,Za,ld)}function lo($,ne){var be=$.__data__;return fh(ne)?be[typeof ne=="string"?"string":"hash"]:be.map}function Ps($,ne){var be=Re($,ne);return dh(be)?be:void 0}function Gi($){var ne=me.call($,ut),be=$[ut];try{$[ut]=void 0;var We=!0}catch{}var Jt=et.call($);return We&&(ne?$[ut]=be:delete $[ut]),Jt}var ld=_t?function($){return $==null?[]:($=Object($),ve(_t($),function(ne){return gn.call($,ne)}))}:ql,Fo=ao;(ln&&Fo(new ln(new ArrayBuffer(1)))!=k||pr&&Fo(new pr)!=S||nr&&Fo(nr.resolve())!=R||Bn&&Fo(new Bn)!=F||Ht&&Fo(new Ht)!=H)&&(Fo=function($){var ne=ao($),be=ne==M?$.constructor:void 0,We=be?ms(be):"";if(We)switch(We){case yt:return k;case Ft:return S;case un:return R;case an:return F;case he:return H}return ne});function Zc($,ne){return ne=ne??l,!!ne&&(typeof $=="number"||ae.test($))&&$>-1&&$%1==0&&$<ne}function fh($){var ne=typeof $;return ne=="string"||ne=="number"||ne=="symbol"||ne=="boolean"?$!=="__proto__":$===null}function hh($){return!!we&&we in $}function $l($){var ne=$&&$.constructor,be=typeof ne=="function"&&ne.prototype||Z;return $===be}function co($){return et.call($)}function ms($){if($!=null){try{return Q.call($)}catch{}try{return $+""}catch{}}return""}function Hl($,ne){return $===ne||$!==$&&ne!==ne}var Yi=Vi((function(){return arguments})())?Vi:function($){return Ds($)&&me.call($,"callee")&&!gn.call($,"callee")},_o=Array.isArray;function Wl($){return $!=null&&Vs($.length)&&!Sa($)}var va=Yt||ud;function cd($,ne){return Xa($,ne)}function Sa($){if(!Ul($))return!1;var ne=ao($);return ne==b||ne==y||ne==f||ne==_}function Vs($){return typeof $=="number"&&$>-1&&$%1==0&&$<=l}function Ul($){var ne=typeof $;return $!=null&&(ne=="object"||ne=="function")}function Ds($){return $!=null&&typeof $=="object"}var Lo=X?Be(X):Ls;function Za($){return Wl($)?ar($):Kc($)}function ql(){return[]}function ud(){return!1}e.exports=cd})(Lp,Lp.exports)),Lp.exports}var S0={},Wk;function F0e(){if(Wk)return S0;Wk=1,Object.defineProperty(S0,"__esModule",{value:!0});const e=eL(),t=tL();var n;return(function(s){function o(d={},f={},p=!1){typeof d!="object"&&(d={}),typeof f!="object"&&(f={});let g=e(f);p||(g=Object.keys(g).reduce((x,b)=>(g[b]!=null&&(x[b]=g[b]),x),{}));for(const x in d)d[x]!==void 0&&f[x]===void 0&&(g[x]=d[x]);return Object.keys(g).length>0?g:void 0}s.compose=o;function a(d={},f={}){typeof d!="object"&&(d={}),typeof f!="object"&&(f={});const p=Object.keys(d).concat(Object.keys(f)).reduce((g,x)=>(t(d[x],f[x])||(g[x]=f[x]===void 0?null:f[x]),g),{});return Object.keys(p).length>0?p:void 0}s.diff=a;function l(d={},f={}){d=d||{};const p=Object.keys(f).reduce((g,x)=>(f[x]!==d[x]&&d[x]!==void 0&&(g[x]=f[x]),g),{});return Object.keys(d).reduce((g,x)=>(d[x]!==f[x]&&f[x]===void 0&&(g[x]=null),g),p)}s.invert=l;function u(d,f,p=!1){if(typeof d!="object")return f;if(typeof f!="object")return;if(!p)return f;const g=Object.keys(f).reduce((x,b)=>(d[b]===void 0&&(x[b]=f[b]),x),{});return Object.keys(g).length>0?g:void 0}s.transform=u})(n||(n={})),S0.default=n,S0}var j0={},Uk;function nL(){if(Uk)return j0;Uk=1,Object.defineProperty(j0,"__esModule",{value:!0});var e;return(function(t){function n(s){return typeof s.delete=="number"?s.delete:typeof s.retain=="number"?s.retain:typeof s.retain=="object"&&s.retain!==null?1:typeof s.insert=="string"?s.insert.length:1}t.length=n})(e||(e={})),j0.default=e,j0}var C0={},qk;function _0e(){if(qk)return C0;qk=1,Object.defineProperty(C0,"__esModule",{value:!0});const e=nL();class t{constructor(s){this.ops=s,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(s){s||(s=1/0);const o=this.ops[this.index];if(o){const a=this.offset,l=e.default.length(o);if(s>=l-a?(s=l-a,this.index+=1,this.offset=0):this.offset+=s,typeof o.delete=="number")return{delete:s};{const u={};return o.attributes&&(u.attributes=o.attributes),typeof o.retain=="number"?u.retain=s:typeof o.retain=="object"&&o.retain!==null?u.retain=o.retain:typeof o.insert=="string"?u.insert=o.insert.substr(a,s):u.insert=o.insert,u}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?e.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const s=this.ops[this.index];return s?typeof s.delete=="number"?"delete":typeof s.retain=="number"||typeof s.retain=="object"&&s.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const s=this.offset,o=this.index,a=this.next(),l=this.ops.slice(this.index);return this.offset=s,this.index=o,[a].concat(l)}}else return[]}}return C0.default=t,C0}var Vk;function L0e(){return Vk||(Vk=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const n=I0e(),s=eL(),o=tL(),a=F0e();t.AttributeMap=a.default;const l=nL();t.Op=l.default;const u=_0e();t.OpIterator=u.default;const d="\0",f=(g,x)=>{if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);if(typeof x!="object"||x===null)throw new Error(`cannot retain a ${typeof x}`);const b=Object.keys(g)[0];if(!b||b!==Object.keys(x)[0])throw new Error(`embed types not matched: ${b} != ${Object.keys(x)[0]}`);return[b,g[b],x[b]]};class p{constructor(x){Array.isArray(x)?this.ops=x:x!=null&&Array.isArray(x.ops)?this.ops=x.ops:this.ops=[]}static registerEmbed(x,b){this.handlers[x]=b}static unregisterEmbed(x){delete this.handlers[x]}static getHandler(x){const b=this.handlers[x];if(!b)throw new Error(`no handlers for embed type "${x}"`);return b}insert(x,b){const y={};return typeof x=="string"&&x.length===0?this:(y.insert=x,b!=null&&typeof b=="object"&&Object.keys(b).length>0&&(y.attributes=b),this.push(y))}delete(x){return x<=0?this:this.push({delete:x})}retain(x,b){if(typeof x=="number"&&x<=0)return this;const y={retain:x};return b!=null&&typeof b=="object"&&Object.keys(b).length>0&&(y.attributes=b),this.push(y)}push(x){let b=this.ops.length,y=this.ops[b-1];if(x=s(x),typeof y=="object"){if(typeof x.delete=="number"&&typeof y.delete=="number")return this.ops[b-1]={delete:y.delete+x.delete},this;if(typeof y.delete=="number"&&x.insert!=null&&(b-=1,y=this.ops[b-1],typeof y!="object"))return this.ops.unshift(x),this;if(o(x.attributes,y.attributes)){if(typeof x.insert=="string"&&typeof y.insert=="string")return this.ops[b-1]={insert:y.insert+x.insert},typeof x.attributes=="object"&&(this.ops[b-1].attributes=x.attributes),this;if(typeof x.retain=="number"&&typeof y.retain=="number")return this.ops[b-1]={retain:y.retain+x.retain},typeof x.attributes=="object"&&(this.ops[b-1].attributes=x.attributes),this}}return b===this.ops.length?this.ops.push(x):this.ops.splice(b,0,x),this}chop(){const x=this.ops[this.ops.length-1];return x&&typeof x.retain=="number"&&!x.attributes&&this.ops.pop(),this}filter(x){return this.ops.filter(x)}forEach(x){this.ops.forEach(x)}map(x){return this.ops.map(x)}partition(x){const b=[],y=[];return this.forEach(S=>{(x(S)?b:y).push(S)}),[b,y]}reduce(x,b){return this.ops.reduce(x,b)}changeLength(){return this.reduce((x,b)=>b.insert?x+l.default.length(b):b.delete?x-b.delete:x,0)}length(){return this.reduce((x,b)=>x+l.default.length(b),0)}slice(x=0,b=1/0){const y=[],S=new u.default(this.ops);let j=0;for(;j<b&&S.hasNext();){let A;j<x?A=S.next(x-j):(A=S.next(b-j),y.push(A)),j+=l.default.length(A)}return new p(y)}compose(x){const b=new u.default(this.ops),y=new u.default(x.ops),S=[],j=y.peek();if(j!=null&&typeof j.retain=="number"&&j.attributes==null){let M=j.retain;for(;b.peekType()==="insert"&&b.peekLength()<=M;)M-=b.peekLength(),S.push(b.next());j.retain-M>0&&y.next(j.retain-M)}const A=new p(S);for(;b.hasNext()||y.hasNext();)if(y.peekType()==="insert")A.push(y.next());else if(b.peekType()==="delete")A.push(b.next());else{const M=Math.min(b.peekLength(),y.peekLength()),R=b.next(M),_=y.next(M);if(_.retain){const z={};if(typeof R.retain=="number")z.retain=typeof _.retain=="number"?M:_.retain;else if(typeof _.retain=="number")R.retain==null?z.insert=R.insert:z.retain=R.retain;else{const N=R.retain==null?"insert":"retain",[I,B,H]=f(R[N],_.retain),P=p.getHandler(I);z[N]={[I]:P.compose(B,H,N==="retain")}}const F=a.default.compose(R.attributes,_.attributes,typeof R.retain=="number");if(F&&(z.attributes=F),A.push(z),!y.hasNext()&&o(A.ops[A.ops.length-1],z)){const N=new p(b.rest());return A.concat(N).chop()}}else typeof _.delete=="number"&&(typeof R.retain=="number"||typeof R.retain=="object"&&R.retain!==null)&&A.push(_)}return A.chop()}concat(x){const b=new p(this.ops.slice());return x.ops.length>0&&(b.push(x.ops[0]),b.ops=b.ops.concat(x.ops.slice(1))),b}diff(x,b){if(this.ops===x.ops)return new p;const y=[this,x].map(R=>R.map(_=>{if(_.insert!=null)return typeof _.insert=="string"?_.insert:d;const z=R===x?"on":"with";throw new Error("diff() called "+z+" non-document")}).join("")),S=new p,j=n(y[0],y[1],b,!0),A=new u.default(this.ops),M=new u.default(x.ops);return j.forEach(R=>{let _=R[1].length;for(;_>0;){let z=0;switch(R[0]){case n.INSERT:z=Math.min(M.peekLength(),_),S.push(M.next(z));break;case n.DELETE:z=Math.min(_,A.peekLength()),A.next(z),S.delete(z);break;case n.EQUAL:z=Math.min(A.peekLength(),M.peekLength(),_);const F=A.next(z),N=M.next(z);o(F.insert,N.insert)?S.retain(z,a.default.diff(F.attributes,N.attributes)):S.push(N).delete(z);break}_-=z}}),S.chop()}eachLine(x,b=` `){const y=new u.default(this.ops);let S=new p,j=0;for(;y.hasNext();){if(y.peekType()!=="insert")return;const A=y.peek(),M=l.default.length(A)-y.peekLength(),R=typeof A.insert=="string"?A.insert.indexOf(b,M)-M:-1;if(R<0)S.push(y.next());else if(R>0)S.push(y.next(R));else{if(x(S,y.next(1).attributes||{},j)===!1)return;j+=1,S=new p}}S.length()>0&&x(S,{},j)}invert(x){const b=new p;return this.reduce((y,S)=>{if(S.insert)b.delete(l.default.length(S));else{if(typeof S.retain=="number"&&S.attributes==null)return b.retain(S.retain),y+S.retain;if(S.delete||typeof S.retain=="number"){const j=S.delete||S.retain;return x.slice(y,y+j).forEach(M=>{S.delete?b.push(M):S.retain&&S.attributes&&b.retain(l.default.length(M),a.default.invert(S.attributes,M.attributes))}),y+j}else if(typeof S.retain=="object"&&S.retain!==null){const j=x.slice(y,y+1),A=new u.default(j.ops).next(),[M,R,_]=f(S.retain,A.insert),z=p.getHandler(M);return b.retain({[M]:z.invert(R,_)},a.default.invert(S.attributes,A.attributes)),y+1}}return y},0),b.chop()}transform(x,b=!1){if(b=!!b,typeof x=="number")return this.transformPosition(x,b);const y=x,S=new u.default(this.ops),j=new u.default(y.ops),A=new p;for(;S.hasNext()||j.hasNext();)if(S.peekType()==="insert"&&(b||j.peekType()!=="insert"))A.retain(l.default.length(S.next()));else if(j.peekType()==="insert")A.push(j.next());else{const M=Math.min(S.peekLength(),j.peekLength()),R=S.next(M),_=j.next(M);if(R.delete)continue;if(_.delete)A.push(_);else{const z=R.retain,F=_.retain;let N=typeof F=="object"&&F!==null?F:M;if(typeof z=="object"&&z!==null&&typeof F=="object"&&F!==null){const I=Object.keys(z)[0];if(I===Object.keys(F)[0]){const B=p.getHandler(I);B&&(N={[I]:B.transform(z[I],F[I],b)})}}A.retain(N,a.default.transform(R.attributes,_.attributes,b))}}return A.chop()}transformPosition(x,b=!1){b=!!b;const y=new u.default(this.ops);let S=0;for(;y.hasNext()&&S<=x;){const j=y.peekLength(),A=y.peekType();if(y.next(),A==="delete"){x-=Math.min(j,x-S);continue}else A==="insert"&&(S<x||!b)&&(x+=j);S+=j}return x}}p.Op=l.default,p.OpIterator=u.default,p.AttributeMap=a.default,p.handlers={},t.default=p,e.exports=p,e.exports.default=p})(v0,v0.exports)),v0.exports}var ki=L0e();const Vt=Ig(ki);class xa extends ri{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}xa.blotName="break";xa.tagName="BR";let pa=class extends O1{};const P0e={"&":"&","<":"<",">":">",'"':""","'":"'"};function wy(e){return e.replace(/[&<>"']/g,t=>P0e[t])}class Xs extends Lw{static allowedChildren=[Xs,xa,ri,pa];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(t,n){const s=Xs.order.indexOf(t),o=Xs.order.indexOf(n);return s>=0||o>=0?s-o:t===n?0:t<n?-1:1}formatAt(t,n,s,o){if(Xs.compare(this.statics.blotName,s)<0&&this.scroll.query(s,Gt.BLOT)){const a=this.isolate(t,n);o&&a.wrap(s,o)}else super.formatAt(t,n,s,o)}optimize(t){if(super.optimize(t),this.parent instanceof Xs&&Xs.compare(this.statics.blotName,this.parent.statics.blotName)>0){const n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}const Gk=1;class _s extends Mg{cache={};delta(){return this.cache.delta==null&&(this.cache.delta=rL(this)),this.cache.delta}deleteAt(t,n){super.deleteAt(t,n),this.cache={}}formatAt(t,n,s,o){n<=0||(this.scroll.query(s,Gt.BLOCK)?t+n===this.length()&&this.format(s,o):super.formatAt(t,Math.min(n,this.length()-t-1),s,o),this.cache={})}insertAt(t,n,s){if(s!=null){super.insertAt(t,n,s),this.cache={};return}if(n.length===0)return;const o=n.split(` `),a=o.shift();a.length>0&&(t<this.length()-1||this.children.tail==null?super.insertAt(Math.min(t,this.length()-1),a):this.children.tail.insertAt(this.children.tail.length(),a),this.cache={});let l=this;o.reduce((u,d)=>(l=l.split(u,!0),l.insertAt(0,d),d.length),t+a.length)}insertBefore(t,n){const{head:s}=this.children;super.insertBefore(t,n),s instanceof xa&&s.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+Gk),this.cache.length}moveChildren(t,n){super.moveChildren(t,n),this.cache={}}optimize(t){super.optimize(t),this.cache={}}path(t){return super.path(t,!0)}removeChild(t){super.removeChild(t),this.cache={}}split(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(n&&(t===0||t>=this.length()-Gk)){const o=this.clone();return t===0?(this.parent.insertBefore(o,this),this):(this.parent.insertBefore(o,this.next),o)}const s=super.split(t,n);return this.cache={},s}}_s.blotName="block";_s.tagName="P";_s.defaultChild=xa;_s.allowedChildren=[xa,Xs,ri,pa];class Ci extends ri{attach(){super.attach(),this.attributes=new jy(this.domNode)}delta(){return new Vt().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(t,n){const s=this.scroll.query(t,Gt.BLOCK_ATTRIBUTE);s!=null&&this.attributes.attribute(s,n)}formatAt(t,n,s,o){this.format(s,o)}insertAt(t,n,s){if(s!=null){super.insertAt(t,n,s);return}const o=n.split(` `),a=o.pop(),l=o.map(d=>{const f=this.scroll.create(_s.blotName);return f.insertAt(0,d),f}),u=this.split(t);l.forEach(d=>{this.parent.insertBefore(d,u)}),a&&this.parent.insertBefore(this.scroll.create("text",a),u)}}Ci.scope=Gt.BLOCK_BLOT;function rL(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.descendants($s).reduce((n,s)=>s.length()===0?n:n.insert(s.value(),vi(s,{},t)),new Vt).insert(` `,vi(e))}function vi(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e==null||("formats"in e&&typeof e.formats=="function"&&(t={...t,...e.formats()},n&&delete t["code-token"]),e.parent==null||e.parent.statics.blotName==="scroll"||e.parent.statics.scope!==e.statics.scope)?t:vi(e.parent,t,n)}class na extends ri{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\uFEFF";static value(){}constructor(t,n,s){super(t,n),this.selection=s,this.textNode=document.createTextNode(na.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(t,n){if(this.savedLength!==0){super.format(t,n);return}let s=this,o=0;for(;s!=null&&s.statics.scope!==Gt.BLOCK_BLOT;)o+=s.offset(s.parent),s=s.parent;s!=null&&(this.savedLength=na.CONTENTS.length,s.optimize(),s.formatAt(o,na.CONTENTS.length,t,n),this.savedLength=0)}index(t,n){return t===this.textNode?0:super.index(t,n)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const t=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const n=this.prev instanceof pa?this.prev:null,s=n?n.length():0,o=this.next instanceof pa?this.next:null,a=o?o.text:"",{textNode:l}=this,u=l.data.split(na.CONTENTS).join("");l.data=na.CONTENTS;let d;if(n)d=n,(u||o)&&(n.insertAt(n.length(),u+a),o&&o.remove());else if(o)d=o,o.insertAt(0,u);else{const f=document.createTextNode(u);d=this.scroll.create(f),this.parent.insertBefore(d,this)}if(this.remove(),t){const f=(x,b)=>n&&x===n.domNode?b:x===l?s+b-1:o&&x===o.domNode?s+u.length+b:null,p=f(t.start.node,t.start.offset),g=f(t.end.node,t.end.offset);if(p!==null&&g!==null)return{startNode:d.domNode,startOffset:p,endNode:d.domNode,endOffset:g}}return null}update(t,n){if(t.some(s=>s.type==="characterData"&&s.target===this.textNode)){const s=this.restore();s&&(n.range=s)}}optimize(t){super.optimize(t);let{parent:n}=this;for(;n;){if(n.domNode.tagName==="A"){this.savedLength=na.CONTENTS.length,n.isolate(this.offset(n),this.length()).unwrap(),this.savedLength=0;break}n=n.parent}}value(){return""}}var H5={exports:{}},Yk;function D0e(){return Yk||(Yk=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(n=!1));function o(d,f,p){this.fn=d,this.context=f,this.once=p||!1}function a(d,f,p,g,x){if(typeof p!="function")throw new TypeError("The listener must be a function");var b=new o(p,g||d,x),y=n?n+f:f;return d._events[y]?d._events[y].fn?d._events[y]=[d._events[y],b]:d._events[y].push(b):(d._events[y]=b,d._eventsCount++),d}function l(d,f){--d._eventsCount===0?d._events=new s:delete d._events[f]}function u(){this._events=new s,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],p,g;if(this._eventsCount===0)return f;for(g in p=this._events)t.call(p,g)&&f.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},u.prototype.listeners=function(f){var p=n?n+f:f,g=this._events[p];if(!g)return[];if(g.fn)return[g.fn];for(var x=0,b=g.length,y=new Array(b);x<b;x++)y[x]=g[x].fn;return y},u.prototype.listenerCount=function(f){var p=n?n+f:f,g=this._events[p];return g?g.fn?1:g.length:0},u.prototype.emit=function(f,p,g,x,b,y){var S=n?n+f:f;if(!this._events[S])return!1;var j=this._events[S],A=arguments.length,M,R;if(j.fn){switch(j.once&&this.removeListener(f,j.fn,void 0,!0),A){case 1:return j.fn.call(j.context),!0;case 2:return j.fn.call(j.context,p),!0;case 3:return j.fn.call(j.context,p,g),!0;case 4:return j.fn.call(j.context,p,g,x),!0;case 5:return j.fn.call(j.context,p,g,x,b),!0;case 6:return j.fn.call(j.context,p,g,x,b,y),!0}for(R=1,M=new Array(A-1);R<A;R++)M[R-1]=arguments[R];j.fn.apply(j.context,M)}else{var _=j.length,z;for(R=0;R<_;R++)switch(j[R].once&&this.removeListener(f,j[R].fn,void 0,!0),A){case 1:j[R].fn.call(j[R].context);break;case 2:j[R].fn.call(j[R].context,p);break;case 3:j[R].fn.call(j[R].context,p,g);break;case 4:j[R].fn.call(j[R].context,p,g,x);break;default:if(!M)for(z=1,M=new Array(A-1);z<A;z++)M[z-1]=arguments[z];j[R].fn.apply(j[R].context,M)}}return!0},u.prototype.on=function(f,p,g){return a(this,f,p,g,!1)},u.prototype.once=function(f,p,g){return a(this,f,p,g,!0)},u.prototype.removeListener=function(f,p,g,x){var b=n?n+f:f;if(!this._events[b])return this;if(!p)return l(this,b),this;var y=this._events[b];if(y.fn)y.fn===p&&(!x||y.once)&&(!g||y.context===g)&&l(this,b);else{for(var S=0,j=[],A=y.length;S<A;S++)(y[S].fn!==p||x&&!y[S].once||g&&y[S].context!==g)&&j.push(y[S]);j.length?this._events[b]=j.length===1?j[0]:j:l(this,b)}return this},u.prototype.removeAllListeners=function(f){var p;return f?(p=n?n+f:f,this._events[p]&&l(this,p)):(this._events=new s,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u})(H5)),H5.exports}var O0e=D0e();const B0e=Ig(O0e),xj=new WeakMap,bj=["error","warn","log","info"];let yj="warn";function sL(e){if(yj&&bj.indexOf(e)<=bj.indexOf(yj)){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];console[e](...n)}}function Ol(e){return bj.reduce((t,n)=>(t[n]=sL.bind(console,n,e),t),{})}Ol.level=e=>{yj=e};sL.level=Ol.level;const W5=Ol("quill:events"),N0e=["selectionchange","mousedown","mouseup","click"];N0e.forEach(e=>{document.addEventListener(e,function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];Array.from(document.querySelectorAll(".ql-container")).forEach(o=>{const a=xj.get(o);a&&a.emitter&&a.emitter.handleDOM(...n)})})});class $t extends B0e{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",W5.error)}emit(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return W5.log.call(W5,...n),super.emit(...n)}handleDOM(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];(this.domListeners[t.type]||[]).forEach(a=>{let{node:l,handler:u}=a;(t.target===l||l.contains(t.target))&&u(t,...s)})}listenDOM(t,n,s){this.domListeners[t]||(this.domListeners[t]=[]),this.domListeners[t].push({node:n,handler:s})}}const U5=Ol("quill:selection");class Wu{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=t,this.length=n}}class $0e{constructor(t,n){this.emitter=n,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Wu(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,$t.sources.USER),1)}),this.emitter.on($t.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const s=this.getNativeRange();s!=null&&s.start.node!==this.cursor.textNode&&this.emitter.once($t.events.SCROLL_UPDATE,(o,a)=>{try{this.root.contains(s.start.node)&&this.root.contains(s.end.node)&&this.setNativeRange(s.start.node,s.start.offset,s.end.node,s.end.offset);const l=a.some(u=>u.type==="characterData"||u.type==="childList"||u.type==="attributes"&&u.target===this.root);this.update(l?$t.sources.SILENT:o)}catch{}})}),this.emitter.on($t.events.SCROLL_OPTIMIZE,(s,o)=>{if(o.range){const{startNode:a,startOffset:l,endNode:u,endOffset:d}=o.range;this.setNativeRange(a,l,u,d),this.update($t.sources.SILENT)}}),this.update($t.sources.SILENT)}handleComposition(){this.emitter.on($t.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on($t.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const t=this.cursor.restore();if(!t)return;setTimeout(()=>{this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update($t.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(t,n){this.scroll.update();const s=this.getNativeRange();if(!(s==null||!s.native.collapsed||this.scroll.query(t,Gt.BLOCK))){if(s.start.node!==this.cursor.textNode){const o=this.scroll.find(s.start.node,!1);if(o==null)return;if(o instanceof $s){const a=o.split(s.start.offset);o.parent.insertBefore(this.cursor,a)}else o.insertBefore(this.cursor,s.start.node);this.cursor.attach()}this.cursor.format(t,n),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const s=this.scroll.length();t=Math.min(t,s-1),n=Math.min(t+n,s-1)-t;let o,[a,l]=this.scroll.leaf(t);if(a==null)return null;if(n>0&&l===a.length()){const[p]=this.scroll.leaf(t+1);if(p){const[g]=this.scroll.line(t),[x]=this.scroll.line(t+1);g===x&&(a=p,l=0)}}[o,l]=a.position(l,!0);const u=document.createRange();if(n>0)return u.setStart(o,l),[a,l]=this.scroll.leaf(t+n),a==null?null:([o,l]=a.position(l,!0),u.setEnd(o,l),u.getBoundingClientRect());let d="left",f;if(o instanceof Text){if(!o.data.length)return null;l<o.data.length?(u.setStart(o,l),u.setEnd(o,l+1)):(u.setStart(o,l-1),u.setEnd(o,l),d="right"),f=u.getBoundingClientRect()}else{if(!(a.domNode instanceof Element))return null;f=a.domNode.getBoundingClientRect(),l>0&&(d="right")}return{bottom:f.top+f.height,height:f.height,left:f[d],right:f[d],top:f.top,width:0}}getNativeRange(){const t=document.getSelection();if(t==null||t.rangeCount<=0)return null;const n=t.getRangeAt(0);if(n==null)return null;const s=this.normalizeNative(n);return U5.info("getNativeRange",s),s}getRange(){const t=this.scroll.domNode;if("isConnected"in t&&!t.isConnected)return[null,null];const n=this.getNativeRange();return n==null?[null,null]:[this.normalizedToRange(n),n]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&q5(this.root,document.activeElement)}normalizedToRange(t){const n=[[t.start.node,t.start.offset]];t.native.collapsed||n.push([t.end.node,t.end.offset]);const s=n.map(l=>{const[u,d]=l,f=this.scroll.find(u,!0),p=f.offset(this.scroll);return d===0?p:f instanceof $s?p+f.index(u,d):p+f.length()}),o=Math.min(Math.max(...s),this.scroll.length()-1),a=Math.min(o,...s);return new Wu(a,o-a)}normalizeNative(t){if(!q5(this.root,t.startContainer)||!t.collapsed&&!q5(this.root,t.endContainer))return null;const n={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[n.start,n.end].forEach(s=>{let{node:o,offset:a}=s;for(;!(o instanceof Text)&&o.childNodes.length>0;)if(o.childNodes.length>a)o=o.childNodes[a],a=0;else if(o.childNodes.length===a)o=o.lastChild,o instanceof Text?a=o.data.length:o.childNodes.length>0?a=o.childNodes.length:a=o.childNodes.length+1;else break;s.node=o,s.offset=a}),n}rangeToNative(t){const n=this.scroll.length(),s=(o,a)=>{o=Math.min(n-1,o);const[l,u]=this.scroll.leaf(o);return l?l.position(u,a):[null,-1]};return[...s(t.index,!1),...s(t.index+t.length,!0)]}setNativeRange(t,n){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(U5.info("setNativeRange",t,n,s,o),t!=null&&(this.root.parentNode==null||t.parentNode==null||s.parentNode==null))return;const l=document.getSelection();if(l!=null)if(t!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:u}=this.getNativeRange()||{};if(u==null||a||t!==u.startContainer||n!==u.startOffset||s!==u.endContainer||o!==u.endOffset){t instanceof Element&&t.tagName==="BR"&&(n=Array.from(t.parentNode.childNodes).indexOf(t),t=t.parentNode),s instanceof Element&&s.tagName==="BR"&&(o=Array.from(s.parentNode.childNodes).indexOf(s),s=s.parentNode);const d=document.createRange();d.setStart(t,n),d.setEnd(s,o),l.removeAllRanges(),l.addRange(d)}}else l.removeAllRanges(),this.root.blur()}setRange(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$t.sources.API;if(typeof n=="string"&&(s=n,n=!1),U5.info("setRange",t),t!=null){const o=this.rangeToNative(t);this.setNativeRange(...o,n)}else this.setNativeRange(null);this.update(s)}update(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$t.sources.USER;const n=this.lastRange,[s,o]=this.getRange();if(this.lastRange=s,this.lastNative=o,this.lastRange!=null&&(this.savedRange=this.lastRange),!Sc(n,this.lastRange)){if(!this.composing&&o!=null&&o.native.collapsed&&o.start.node!==this.cursor.textNode){const l=this.cursor.restore();l&&this.setNativeRange(l.startNode,l.startOffset,l.endNode,l.endOffset)}const a=[$t.events.SELECTION_CHANGE,Ff(this.lastRange),Ff(n),t];this.emitter.emit($t.events.EDITOR_CHANGE,...a),t!==$t.sources.SILENT&&this.emitter.emit(...a)}}}function q5(e,t){try{t.parentNode}catch{return!1}return e.contains(t)}const H0e=/^[ -~]*$/;class W0e{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){this.scroll.update();let n=this.scroll.length();this.scroll.batchStart();const s=Kk(t),o=new Vt;return q0e(s.ops.slice()).reduce((l,u)=>{const d=ki.Op.length(u);let f=u.attributes||{},p=!1,g=!1;if(u.insert!=null){if(o.retain(d),typeof u.insert=="string"){const y=u.insert;g=!y.endsWith(` `)&&(n<=l||!!this.scroll.descendant(Ci,l)[0]),this.scroll.insertAt(l,y);const[S,j]=this.scroll.line(l);let A=kc({},vi(S));if(S instanceof _s){const[M]=S.descendant($s,j);M&&(A=kc(A,vi(M)))}f=ki.AttributeMap.diff(A,f)||{}}else if(typeof u.insert=="object"){const y=Object.keys(u.insert)[0];if(y==null)return l;const S=this.scroll.query(y,Gt.INLINE)!=null;if(S)(n<=l||this.scroll.descendant(Ci,l)[0])&&(g=!0);else if(l>0){const[j,A]=this.scroll.descendant($s,l-1);j instanceof pa?j.value()[A]!==` `&&(p=!0):j instanceof ri&&j.statics.scope===Gt.INLINE_BLOT&&(p=!0)}if(this.scroll.insertAt(l,y,u.insert[y]),S){const[j]=this.scroll.descendant($s,l);if(j){const A=kc({},vi(j));f=ki.AttributeMap.diff(A,f)||{}}}}n+=d}else if(o.push(u),u.retain!==null&&typeof u.retain=="object"){const y=Object.keys(u.retain)[0];if(y==null)return l;this.scroll.updateEmbedAt(l,y,u.retain[y])}Object.keys(f).forEach(y=>{this.scroll.formatAt(l,d,y,f[y])});const x=p?1:0,b=g?1:0;return n+=x+b,o.retain(x),o.delete(b),l+d+x+b},0),o.reduce((l,u)=>typeof u.delete=="number"?(this.scroll.deleteAt(l,u.delete),l):l+ki.Op.length(u),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(s)}deleteText(t,n){return this.scroll.deleteAt(t,n),this.update(new Vt().retain(t).delete(n))}formatLine(t,n){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(s).forEach(a=>{this.scroll.lines(t,Math.max(n,1)).forEach(l=>{l.format(a,s[a])})}),this.scroll.optimize();const o=new Vt().retain(t).retain(n,Ff(s));return this.update(o)}formatText(t,n){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(s).forEach(a=>{this.scroll.formatAt(t,n,a,s[a])});const o=new Vt().retain(t).retain(n,Ff(s));return this.update(o)}getContents(t,n){return this.delta.slice(t,t+n)}getDelta(){return this.scroll.lines().reduce((t,n)=>t.concat(n.delta()),new Vt)}getFormat(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=[],o=[];n===0?this.scroll.path(t).forEach(u=>{const[d]=u;d instanceof _s?s.push(d):d instanceof $s&&o.push(d)}):(s=this.scroll.lines(t,n),o=this.scroll.descendants($s,t,n));const[a,l]=[s,o].map(u=>{const d=u.shift();if(d==null)return{};let f=vi(d);for(;Object.keys(f).length>0;){const p=u.shift();if(p==null)return f;f=U0e(vi(p),f)}return f});return{...a,...l}}getHTML(t,n){const[s,o]=this.scroll.line(t);if(s){const a=s.length();return s.length()>=o+n&&!(o===0&&n===a)?Rg(s,o,n,!0):Rg(this.scroll,t,n,!0)}return""}getText(t,n){return this.getContents(t,n).filter(s=>typeof s.insert=="string").map(s=>s.insert).join("")}insertContents(t,n){const s=Kk(n),o=new Vt().retain(t).concat(s);return this.scroll.insertContents(t,s),this.update(o)}insertEmbed(t,n,s){return this.scroll.insertAt(t,n,s),this.update(new Vt().retain(t).insert({[n]:s}))}insertText(t,n){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return n=n.replace(/\r\n/g,` `).replace(/\r/g,` `),this.scroll.insertAt(t,n),Object.keys(s).forEach(o=>{this.scroll.formatAt(t,n.length,o,s[o])}),this.update(new Vt().retain(t).insert(n,Ff(s)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const t=this.scroll.children.head;if(t?.statics.blotName!==_s.blotName)return!1;const n=t;return n.children.length>1?!1:n.children.head instanceof xa}removeFormat(t,n){const s=this.getText(t,n),[o,a]=this.scroll.line(t+n);let l=0,u=new Vt;o!=null&&(l=o.length()-a,u=o.delta().slice(a,a+l-1).insert(` `));const f=this.getContents(t,n+l).diff(new Vt().insert(s).concat(u)),p=new Vt().retain(t).concat(f);return this.applyDelta(p)}update(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const o=this.delta;if(n.length===1&&n[0].type==="characterData"&&n[0].target.data.match(H0e)&&this.scroll.find(n[0].target)){const a=this.scroll.find(n[0].target),l=vi(a),u=a.offset(this.scroll),d=n[0].oldValue.replace(na.CONTENTS,""),f=new Vt().insert(d),p=new Vt().insert(a.value()),g=s&&{oldRange:Xk(s.oldRange,-u),newRange:Xk(s.newRange,-u)};t=new Vt().retain(u).concat(f.diff(p,g)).reduce((b,y)=>y.insert?b.insert(y.insert,l):b.push(y),new Vt),this.delta=o.compose(t)}else this.delta=this.getDelta(),(!t||!Sc(o.compose(t),this.delta))&&(t=o.diff(this.delta,s));return t}}function hf(e,t,n){if(e.length===0){const[b]=V5(n.pop());return t<=0?`</li></${b}>`:`</li></${b}>${hf([],t-1,n)}`}const[{child:s,offset:o,length:a,indent:l,type:u},...d]=e,[f,p]=V5(u);if(l>t)return n.push(u),l===t+1?`<${f}><li${p}>${Rg(s,o,a)}${hf(d,l,n)}`:`<${f}><li>${hf(e,t+1,n)}`;const g=n[n.length-1];if(l===t&&u===g)return`</li><li${p}>${Rg(s,o,a)}${hf(d,l,n)}`;const[x]=V5(n.pop());return`</li></${x}>${hf(e,t-1,n)}`}function Rg(e,t,n){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in e&&typeof e.html=="function")return e.html(t,n);if(e instanceof pa)return wy(e.value().slice(t,t+n)).replaceAll(" "," ");if(e instanceof ua){if(e.statics.blotName==="list-container"){const f=[];return e.children.forEachAt(t,n,(p,g,x)=>{const b="formats"in p&&typeof p.formats=="function"?p.formats():{};f.push({child:p,offset:g,length:x,indent:b.indent||0,type:b.list})}),hf(f,-1,[])}const o=[];if(e.children.forEachAt(t,n,(f,p,g)=>{o.push(Rg(f,p,g))}),s||e.statics.blotName==="list")return o.join("");const{outerHTML:a,innerHTML:l}=e.domNode,[u,d]=a.split(`>${l}<`);return u==="<table"?`<table style="border: 1px solid #000;">${o.join("")}<${d}`:`${u}>${o.join("")}<${d}`}return e.domNode instanceof Element?e.domNode.outerHTML:""}function U0e(e,t){return Object.keys(t).reduce((n,s)=>{if(e[s]==null)return n;const o=t[s];return o===e[s]?n[s]=o:Array.isArray(o)?o.indexOf(e[s])<0?n[s]=o.concat([e[s]]):n[s]=o:n[s]=[o,e[s]],n},{})}function V5(e){const t=e==="ordered"?"ol":"ul";switch(e){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function Kk(e){return e.reduce((t,n)=>{if(typeof n.insert=="string"){const s=n.insert.replace(/\r\n/g,` `).replace(/\r/g,` `);return t.insert(s,n.attributes)}return t.push(n)},new Vt)}function Xk(e,t){let{index:n,length:s}=e;return new Wu(n+t,s)}function q0e(e){const t=[];return e.forEach(n=>{typeof n.insert=="string"?n.insert.split(` `).forEach((o,a)=>{a&&t.push({insert:` `,attributes:n.attributes}),o&&t.push({insert:o,attributes:n.attributes})}):t.push(n)}),t}class Ka{static DEFAULTS={};constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=t,this.options=n}}const w0="\uFEFF";class Dw extends ri{constructor(t,n){super(t,n),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(s=>{this.contentNode.appendChild(s)}),this.leftGuard=document.createTextNode(w0),this.rightGuard=document.createTextNode(w0),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(t,n){return t===this.leftGuard?0:t===this.rightGuard?1:super.index(t,n)}restore(t){let n=null,s;const o=t.data.split(w0).join("");if(t===this.leftGuard)if(this.prev instanceof pa){const a=this.prev.length();this.prev.insertAt(a,o),n={startNode:this.prev.domNode,startOffset:a+o.length}}else s=document.createTextNode(o),this.parent.insertBefore(this.scroll.create(s),this),n={startNode:s,startOffset:o.length};else t===this.rightGuard&&(this.next instanceof pa?(this.next.insertAt(0,o),n={startNode:this.next.domNode,startOffset:o.length}):(s=document.createTextNode(o),this.parent.insertBefore(this.scroll.create(s),this.next),n={startNode:s,startOffset:o.length}));return t.data=w0,n}update(t,n){t.forEach(s=>{if(s.type==="characterData"&&(s.target===this.leftGuard||s.target===this.rightGuard)){const o=this.restore(s.target);o&&(n.range=o)}})}}class V0e{isComposing=!1;constructor(t,n){this.scroll=t,this.emitter=n,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",t=>{this.isComposing||this.handleCompositionStart(t)}),this.scroll.domNode.addEventListener("compositionend",t=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(t)})})}handleCompositionStart(t){const n=t.target instanceof Node?this.scroll.find(t.target,!0):null;n&&!(n instanceof Dw)&&(this.emitter.emit($t.events.COMPOSITION_BEFORE_START,t),this.scroll.batchStart(),this.emitter.emit($t.events.COMPOSITION_START,t),this.isComposing=!0)}handleCompositionEnd(t){this.emitter.emit($t.events.COMPOSITION_BEFORE_END,t),this.scroll.batchEnd(),this.emitter.emit($t.events.COMPOSITION_END,t),this.isComposing=!1}}class uh{static DEFAULTS={modules:{}};static themes={default:uh};modules={};constructor(t,n){this.quill=t,this.options=n}init(){Object.keys(this.options.modules).forEach(t=>{this.modules[t]==null&&this.addModule(t)})}addModule(t){const n=this.quill.constructor.import(`modules/${t}`);return this.modules[t]=new n(this.quill,this.options.modules[t]||{}),this.modules[t]}}const G0e=e=>e.parentElement||e.getRootNode().host||null,Y0e=e=>{const t=e.getBoundingClientRect(),n="offsetWidth"in e&&Math.abs(t.width)/e.offsetWidth||1,s="offsetHeight"in e&&Math.abs(t.height)/e.offsetHeight||1;return{top:t.top,right:t.left+e.clientWidth*n,bottom:t.top+e.clientHeight*s,left:t.left}},A0=e=>{const t=parseInt(e,10);return Number.isNaN(t)?0:t},Zk=(e,t,n,s,o,a)=>e<n&&t>s?0:e<n?-(n-e+o):t>s?t-e>s-n?e+o-n:t-s+a:0,K0e=(e,t)=>{const n=e.ownerDocument;let s=t,o=e;for(;o;){const a=o===n.body,l=a?{top:0,right:window.visualViewport?.width??n.documentElement.clientWidth,bottom:window.visualViewport?.height??n.documentElement.clientHeight,left:0}:Y0e(o),u=getComputedStyle(o),d=Zk(s.left,s.right,l.left,l.right,A0(u.scrollPaddingLeft),A0(u.scrollPaddingRight)),f=Zk(s.top,s.bottom,l.top,l.bottom,A0(u.scrollPaddingTop),A0(u.scrollPaddingBottom));if(d||f)if(a)n.defaultView?.scrollBy(d,f);else{const{scrollLeft:p,scrollTop:g}=o;f&&(o.scrollTop+=f),d&&(o.scrollLeft+=d);const x=o.scrollLeft-p,b=o.scrollTop-g;s={left:s.left-x,top:s.top-b,right:s.right-x,bottom:s.bottom-b}}o=a||u.position==="fixed"?null:G0e(o)}},X0e=100,Z0e=["block","break","cursor","inline","scroll","text"],Q0e=(e,t,n)=>{const s=new Jf;return Z0e.forEach(o=>{const a=t.query(o);a&&s.register(a)}),e.forEach(o=>{let a=t.query(o);a||n.error(`Cannot register "${o}" specified in "formats" config. Are you sure it was registered?`);let l=0;for(;a;)if(s.register(a),a="blotName"in a?a.requiredContainer??null:null,l+=1,l>X0e){n.error(`Cycle detected in registering blot requiredContainer: "${o}"`);break}}),s},Lf=Ol("quill"),E0=new Jf;ua.uiClass="ql-ui";class nt{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:E0,theme:"default"};static events=$t.events;static sources=$t.sources;static version="2.0.3";static imports={delta:Vt,parchment:z0e,"core/module":Ka,"core/theme":uh};static debug(t){t===!0&&(t="log"),Ol.level(t)}static find(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return xj.get(t)||E0.find(t,n)}static import(t){return this.imports[t]==null&&Lf.error(`Cannot import ${t}. Are you sure it was registered?`),this.imports[t]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const t=arguments.length<=0?void 0:arguments[0],n=!!(!(arguments.length<=1)&&arguments[1]),s="attrName"in t?t.attrName:t.blotName;typeof s=="string"?this.register(`formats/${s}`,t,n):Object.keys(t).forEach(o=>{this.register(o,t[o],n)})}else{const t=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],s=!!(!(arguments.length<=2)&&arguments[2]);this.imports[t]!=null&&!s&&Lf.warn(`Overwriting ${t} with`,n),this.imports[t]=n,(t.startsWith("blots/")||t.startsWith("formats/"))&&n&&typeof n!="boolean"&&n.blotName!=="abstract"&&E0.register(n),typeof n.register=="function"&&n.register(E0)}}constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=J0e(t,n),this.container=this.options.container,this.container==null){Lf.error("Invalid Quill container",t);return}this.options.debug&&nt.debug(this.options.debug);const s=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",xj.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new $t;const o=Pw.blotName,a=this.options.registry.query(o);if(!a||!("blotName"in a))throw new Error(`Cannot initialize Quill without "${o}" blot`);if(this.scroll=new a(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new W0e(this.scroll),this.selection=new $0e(this.scroll,this.emitter),this.composition=new V0e(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on($t.events.EDITOR_CHANGE,l=>{l===$t.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on($t.events.SCROLL_UPDATE,(l,u)=>{const d=this.selection.lastRange,[f]=this.selection.getRange(),p=d&&f?{oldRange:d,newRange:f}:void 0;ea.call(this,()=>this.editor.update(null,u,p),l)}),this.emitter.on($t.events.SCROLL_EMBED_UPDATE,(l,u)=>{const d=this.selection.lastRange,[f]=this.selection.getRange(),p=d&&f?{oldRange:d,newRange:f}:void 0;ea.call(this,()=>{const g=new Vt().retain(l.offset(this)).retain({[l.statics.blotName]:u});return this.editor.update(g,[],p)},nt.sources.USER)}),s){const l=this.clipboard.convert({html:`${s}<p><br></p>`,text:` `});this.setContents(l)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof t=="string"){const s=t;t=document.createElement("div"),t.classList.add(s)}return this.container.insertBefore(t,n),t}blur(){this.selection.setRange(null)}deleteText(t,n,s){return[t,n,,s]=xl(t,n,s),ea.call(this,()=>this.editor.deleteText(t,n),s,t,-1*n)}disable(){this.enable(!1)}editReadOnly(t){this.allowReadOnlyEdits=!0;const n=t();return this.allowReadOnlyEdits=!1,n}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}focus(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),t.preventScroll||this.scrollSelectionIntoView()}format(t,n){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$t.sources.API;return ea.call(this,()=>{const o=this.getSelection(!0);let a=new Vt;if(o==null)return a;if(this.scroll.query(t,Gt.BLOCK))a=this.editor.formatLine(o.index,o.length,{[t]:n});else{if(o.length===0)return this.selection.format(t,n),a;a=this.editor.formatText(o.index,o.length,{[t]:n})}return this.setSelection(o,$t.sources.SILENT),a},s)}formatLine(t,n,s,o,a){let l;return[t,n,l,a]=xl(t,n,s,o,a),ea.call(this,()=>this.editor.formatLine(t,n,l),a,t,0)}formatText(t,n,s,o,a){let l;return[t,n,l,a]=xl(t,n,s,o,a),ea.call(this,()=>this.editor.formatText(t,n,l),a,t,0)}getBounds(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=null;if(typeof t=="number"?s=this.selection.getBounds(t,n):s=this.selection.getBounds(t.index,t.length),!s)return null;const o=this.container.getBoundingClientRect();return{bottom:s.bottom-o.top,height:s.height,left:s.left-o.left,right:s.right-o.left,top:s.top-o.top,width:s.width}}getContents(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-t;return[t,n]=xl(t,n),this.editor.getContents(t,n)}getFormat(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof t=="number"?this.editor.getFormat(t,n):this.editor.getFormat(t.index,t.length)}getIndex(t){return t.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(t){return this.scroll.leaf(t)}getLine(t){return this.scroll.line(t)}getLines(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof t!="number"?this.scroll.lines(t.index,t.length):this.scroll.lines(t,n)}getModule(t){return this.theme.modules[t]}getSelection(){return arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0;return typeof t=="number"&&(n=n??this.getLength()-t),[t,n]=xl(t,n),this.editor.getHTML(t,n)}getText(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0;return typeof t=="number"&&(n=n??this.getLength()-t),[t,n]=xl(t,n),this.editor.getText(t,n)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,n,s){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:nt.sources.API;return ea.call(this,()=>this.editor.insertEmbed(t,n,s),o,t)}insertText(t,n,s,o,a){let l;return[t,,l,a]=xl(t,0,s,o,a),ea.call(this,()=>this.editor.insertText(t,n,l),a,t,n.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(t,n,s){return[t,n,,s]=xl(t,n,s),ea.call(this,()=>this.editor.removeFormat(t,n),s,t)}scrollRectIntoView(t){K0e(this.root,t)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const t=this.selection.lastRange,n=t&&this.selection.getBounds(t.index,t.length);n&&this.scrollRectIntoView(n)}setContents(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$t.sources.API;return ea.call(this,()=>{t=new Vt(t);const s=this.getLength(),o=this.editor.deleteText(0,s),a=this.editor.insertContents(0,t),l=this.editor.deleteText(this.getLength()-1,1);return o.compose(a).compose(l)},n)}setSelection(t,n,s){t==null?this.selection.setRange(null,n||nt.sources.API):([t,n,,s]=xl(t,n,s),this.selection.setRange(new Wu(Math.max(0,t),n),s),s!==$t.sources.SILENT&&this.scrollSelectionIntoView())}setText(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$t.sources.API;const s=new Vt().insert(t);return this.setContents(s,n)}update(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$t.sources.USER;const n=this.scroll.update(t);return this.selection.update(t),n}updateContents(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$t.sources.API;return ea.call(this,()=>(t=new Vt(t),this.editor.applyDelta(t)),n,!0)}}function Qk(e){return typeof e=="string"?document.querySelector(e):e}function G5(e){return Object.entries(e??{}).reduce((t,n)=>{let[s,o]=n;return{...t,[s]:o===!0?{}:o}},{})}function Jk(e){return Object.fromEntries(Object.entries(e).filter(t=>t[1]!==void 0))}function J0e(e,t){const n=Qk(e);if(!n)throw new Error("Invalid Quill container");const o=!t.theme||t.theme===nt.DEFAULTS.theme?uh:nt.import(`themes/${t.theme}`);if(!o)throw new Error(`Invalid theme ${t.theme}. Did you register it?`);const{modules:a,...l}=nt.DEFAULTS,{modules:u,...d}=o.DEFAULTS;let f=G5(t.modules);f!=null&&f.toolbar&&f.toolbar.constructor!==Object&&(f={...f,toolbar:{container:f.toolbar}});const p=kc({},G5(a),G5(u),f),g={...l,...Jk(d),...Jk(t)};let x=t.registry;return x?t.formats&&Lf.warn('Ignoring "formats" option because "registry" is specified'):x=t.formats?Q0e(t.formats,g.registry,Lf):g.registry,{...g,registry:x,container:n,theme:o,modules:Object.entries(p).reduce((b,y)=>{let[S,j]=y;if(!j)return b;const A=nt.import(`modules/${S}`);return A==null?(Lf.error(`Cannot load ${S} module. Are you sure you registered it?`),b):{...b,[S]:kc({},A.DEFAULTS||{},j)}},{}),bounds:Qk(g.bounds)}}function ea(e,t,n,s){if(!this.isEnabled()&&t===$t.sources.USER&&!this.allowReadOnlyEdits)return new Vt;let o=n==null?null:this.getSelection();const a=this.editor.delta,l=e();if(o!=null&&(n===!0&&(n=o.index),s==null?o=eM(o,l,t):s!==0&&(o=eM(o,n,s,t)),this.setSelection(o,$t.sources.SILENT)),l.length()>0){const u=[$t.events.TEXT_CHANGE,l,a,t];this.emitter.emit($t.events.EDITOR_CHANGE,...u),t!==$t.sources.SILENT&&this.emitter.emit(...u)}return l}function xl(e,t,n,s,o){let a={};return typeof e.index=="number"&&typeof e.length=="number"?typeof t!="number"?(o=s,s=n,n=t,t=e.length,e=e.index):(t=e.length,e=e.index):typeof t!="number"&&(o=s,s=n,n=t,t=0),typeof n=="object"?(a=n,o=s):typeof n=="string"&&(s!=null?a[n]=s:o=n),o=o||$t.sources.API,[e,t,a,o]}function eM(e,t,n,s){const o=typeof n=="number"?n:0;if(e==null)return null;let a,l;return t&&typeof t.transformPosition=="function"?[a,l]=[e.index,e.index+e.length].map(u=>t.transformPosition(u,s!==$t.sources.USER)):[a,l]=[e.index,e.index+e.length].map(u=>u<t||u===t&&s===$t.sources.USER?u:o>=0?u+o:Math.max(t,u+o)),new Wu(a,l-a)}class od extends Cy{}function tM(e){return e instanceof _s||e instanceof Ci}function nM(e){return typeof e.updateContent=="function"}class e1e extends Pw{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=_s;static allowedChildren=[_s,Ci,od];constructor(t,n,s){let{emitter:o}=s;super(t,n),this.emitter=o,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",a=>this.handleDragStart(a))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const t=this.batch;this.batch=!1,this.update(t)}emitMount(t){this.emitter.emit($t.events.SCROLL_BLOT_MOUNT,t)}emitUnmount(t){this.emitter.emit($t.events.SCROLL_BLOT_UNMOUNT,t)}emitEmbedUpdate(t,n){this.emitter.emit($t.events.SCROLL_EMBED_UPDATE,t,n)}deleteAt(t,n){const[s,o]=this.line(t),[a]=this.line(t+n);if(super.deleteAt(t,n),a!=null&&s!==a&&o>0){if(s instanceof Ci||a instanceof Ci){this.optimize();return}const l=a.children.head instanceof xa?null:a.children.head;s.moveChildren(a,l),s.remove()}this.optimize()}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",t?"true":"false")}formatAt(t,n,s,o){super.formatAt(t,n,s,o),this.optimize()}insertAt(t,n,s){if(t>=this.length())if(s==null||this.scroll.query(n,Gt.BLOCK)==null){const o=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(o),s==null&&n.endsWith(` `)?o.insertAt(0,n.slice(0,-1),s):o.insertAt(0,n,s)}else{const o=this.scroll.create(n,s);this.appendChild(o)}else super.insertAt(t,n,s);this.optimize()}insertBefore(t,n){if(t.statics.scope===Gt.INLINE_BLOT){const s=this.scroll.create(this.statics.defaultChild.blotName);s.appendChild(t),super.insertBefore(s,n)}else super.insertBefore(t,n)}insertContents(t,n){const s=this.deltaToRenderBlocks(n.concat(new Vt().insert(` `))),o=s.pop();if(o==null)return;this.batchStart();const a=s.shift();if(a){const d=a.type==="block"&&(a.delta.length()===0||!this.descendant(Ci,t)[0]&&t<this.length()),f=a.type==="block"?a.delta:new Vt().insert({[a.key]:a.value});Y5(this,t,f);const p=a.type==="block"?1:0,g=t+f.length()+p;d&&this.insertAt(g-1,` `);const x=vi(this.line(t)[0]),b=ki.AttributeMap.diff(x,a.attributes)||{};Object.keys(b).forEach(y=>{this.formatAt(g-1,1,y,b[y])}),t=g}let[l,u]=this.children.find(t);if(s.length&&(l&&(l=l.split(u),u=0),s.forEach(d=>{if(d.type==="block"){const f=this.createBlock(d.attributes,l||void 0);Y5(f,0,d.delta)}else{const f=this.create(d.key,d.value);this.insertBefore(f,l||void 0),Object.keys(d.attributes).forEach(p=>{f.format(p,d.attributes[p])})}})),o.type==="block"&&o.delta.length()){const d=l?l.offset(l.scroll)+u:this.length();Y5(this,d,o.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(t){const n=this.path(t).pop();if(!n)return[null,-1];const[s,o]=n;return s instanceof $s?[s,o]:[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(tM,t)}lines(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const s=(o,a,l)=>{let u=[],d=l;return o.children.forEachAt(a,l,(f,p,g)=>{tM(f)?u.push(f):f instanceof Cy&&(u=u.concat(s(f,p,d))),d-=g}),u};return s(this,t,n)}optimize(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(t,n),t.length>0&&this.emitter.emit($t.events.SCROLL_OPTIMIZE,t,n))}path(t){return super.path(t).slice(1)}remove(){}update(t){if(this.batch){Array.isArray(t)&&(this.batch=this.batch.concat(t));return}let n=$t.sources.USER;typeof t=="string"&&(n=t),Array.isArray(t)||(t=this.observer.takeRecords()),t=t.filter(s=>{let{target:o}=s;const a=this.find(o,!0);return a&&!nM(a)}),t.length>0&&this.emitter.emit($t.events.SCROLL_BEFORE_UPDATE,n,t),super.update(t.concat([])),t.length>0&&this.emitter.emit($t.events.SCROLL_UPDATE,n,t)}updateEmbedAt(t,n,s){const[o]=this.descendant(a=>a instanceof Ci,t);o&&o.statics.blotName===n&&nM(o)&&o.updateContent(s)}handleDragStart(t){t.preventDefault()}deltaToRenderBlocks(t){const n=[];let s=new Vt;return t.forEach(o=>{const a=o?.insert;if(a)if(typeof a=="string"){const l=a.split(` `);l.slice(0,-1).forEach(d=>{s.insert(d,o.attributes),n.push({type:"block",delta:s,attributes:o.attributes??{}}),s=new Vt});const u=l[l.length-1];u&&s.insert(u,o.attributes)}else{const l=Object.keys(a)[0];if(!l)return;this.query(l,Gt.INLINE)?s.push(o):(s.length()&&n.push({type:"block",delta:s,attributes:{}}),s=new Vt,n.push({type:"blockEmbed",key:l,value:a[l],attributes:o.attributes??{}}))}}),s.length()&&n.push({type:"block",delta:s,attributes:{}}),n}createBlock(t,n){let s;const o={};Object.entries(t).forEach(u=>{let[d,f]=u;this.query(d,Gt.BLOCK&Gt.BLOT)!=null?s=d:o[d]=f});const a=this.create(s||this.statics.defaultChild.blotName,s?t[s]:void 0);this.insertBefore(a,n||void 0);const l=a.length();return Object.entries(o).forEach(u=>{let[d,f]=u;a.formatAt(0,l,d,f)}),a}}function Y5(e,t,n){n.reduce((s,o)=>{const a=ki.Op.length(o);let l=o.attributes||{};if(o.insert!=null){if(typeof o.insert=="string"){const u=o.insert;e.insertAt(s,u);const[d]=e.descendant($s,s),f=vi(d);l=ki.AttributeMap.diff(f,l)||{}}else if(typeof o.insert=="object"){const u=Object.keys(o.insert)[0];if(u==null)return s;if(e.insertAt(s,u,o.insert[u]),e.scroll.query(u,Gt.INLINE)!=null){const[f]=e.descendant($s,s),p=vi(f);l=ki.AttributeMap.diff(p,l)||{}}}}return Object.keys(l).forEach(u=>{e.formatAt(s,a,u,l[u])}),s+a},t)}const Ow={scope:Gt.BLOCK,whitelist:["right","center","justify"]},t1e=new Ua("align","align",Ow),oL=new ma("align","ql-align",Ow),iL=new Yc("align","text-align",Ow);class aL extends Yc{value(t){let n=super.value(t);return n.startsWith("rgb(")?(n=n.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${n.split(",").map(o=>`00${parseInt(o,10).toString(16)}`.slice(-2)).join("")}`):n}}const n1e=new ma("color","ql-color",{scope:Gt.INLINE}),Bw=new aL("color","color",{scope:Gt.INLINE}),r1e=new ma("background","ql-bg",{scope:Gt.INLINE}),Nw=new aL("background","background-color",{scope:Gt.INLINE});class id extends od{static create(t){const n=super.create(t);return n.setAttribute("spellcheck","false"),n}code(t,n){return this.children.map(s=>s.length()<=1?"":s.domNode.innerText).join(` `).slice(t,t+n)}html(t,n){return`<pre> ${wy(this.code(t,n))} </pre>`}}class eo extends _s{static TAB=" ";static register(){nt.register(id)}}class $w extends Xs{}$w.blotName="code";$w.tagName="CODE";eo.blotName="code-block";eo.className="ql-code-block";eo.tagName="DIV";id.blotName="code-block-container";id.className="ql-code-block-container";id.tagName="DIV";id.allowedChildren=[eo];eo.allowedChildren=[pa,xa,na];eo.requiredContainer=id;const Hw={scope:Gt.BLOCK,whitelist:["rtl"]},lL=new Ua("direction","dir",Hw),cL=new ma("direction","ql-direction",Hw),uL=new Yc("direction","direction",Hw),dL={scope:Gt.INLINE,whitelist:["serif","monospace"]},fL=new ma("font","ql-font",dL);class s1e extends Yc{value(t){return super.value(t).replace(/["']/g,"")}}const hL=new s1e("font","font-family",dL),pL=new ma("size","ql-size",{scope:Gt.INLINE,whitelist:["small","large","huge"]}),gL=new Yc("size","font-size",{scope:Gt.INLINE,whitelist:["10px","18px","32px"]}),o1e=Ol("quill:keyboard"),i1e=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Ay extends Ka{static match(t,n){return["altKey","ctrlKey","metaKey","shiftKey"].some(s=>!!n[s]!==t[s]&&n[s]!==null)?!1:n.key===t.key||n.key===t.which}constructor(t,n){super(t,n),this.bindings={},Object.keys(this.options.bindings).forEach(s=>{this.options.bindings[s]&&this.addBinding(this.options.bindings[s])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=l1e(t);if(o==null){o1e.warn("Attempted to add invalid keyboard binding",o);return}typeof n=="function"&&(n={handler:n}),typeof s=="function"&&(s={handler:s}),(Array.isArray(o.key)?o.key:[o.key]).forEach(l=>{const u={...o,key:l,...n,...s};this.bindings[u.key]=this.bindings[u.key]||[],this.bindings[u.key].push(u)})}listen(){this.quill.root.addEventListener("keydown",t=>{if(t.defaultPrevented||t.isComposing||t.keyCode===229&&(t.key==="Enter"||t.key==="Backspace"))return;const o=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter(A=>Ay.match(t,A));if(o.length===0)return;const a=nt.find(t.target,!0);if(a&&a.scroll!==this.quill.scroll)return;const l=this.quill.getSelection();if(l==null||!this.quill.hasFocus())return;const[u,d]=this.quill.getLine(l.index),[f,p]=this.quill.getLeaf(l.index),[g,x]=l.length===0?[f,p]:this.quill.getLeaf(l.index+l.length),b=f instanceof O1?f.value().slice(0,p):"",y=g instanceof O1?g.value().slice(x):"",S={collapsed:l.length===0,empty:l.length===0&&u.length()<=1,format:this.quill.getFormat(l),line:u,offset:d,prefix:b,suffix:y,event:t};o.some(A=>{if(A.collapsed!=null&&A.collapsed!==S.collapsed||A.empty!=null&&A.empty!==S.empty||A.offset!=null&&A.offset!==S.offset)return!1;if(Array.isArray(A.format)){if(A.format.every(M=>S.format[M]==null))return!1}else if(typeof A.format=="object"&&!Object.keys(A.format).every(M=>A.format[M]===!0?S.format[M]!=null:A.format[M]===!1?S.format[M]==null:Sc(A.format[M],S.format[M])))return!1;return A.prefix!=null&&!A.prefix.test(S.prefix)||A.suffix!=null&&!A.suffix.test(S.suffix)?!1:A.handler.call(this,l,S,A)!==!0})&&t.preventDefault()})}handleBackspace(t,n){const s=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(n.prefix)?2:1;if(t.index===0||this.quill.getLength()<=1)return;let o={};const[a]=this.quill.getLine(t.index);let l=new Vt().retain(t.index-s).delete(s);if(n.offset===0){const[u]=this.quill.getLine(t.index-1);if(u&&!(u.statics.blotName==="block"&&u.length()<=1)){const f=a.formats(),p=this.quill.getFormat(t.index-1,1);if(o=ki.AttributeMap.diff(f,p)||{},Object.keys(o).length>0){const g=new Vt().retain(t.index+a.length()-2).retain(1,o);l=l.compose(g)}}}this.quill.updateContents(l,nt.sources.USER),this.quill.focus()}handleDelete(t,n){const s=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(n.suffix)?2:1;if(t.index>=this.quill.getLength()-s)return;let o={};const[a]=this.quill.getLine(t.index);let l=new Vt().retain(t.index).delete(s);if(n.offset>=a.length()-1){const[u]=this.quill.getLine(t.index+1);if(u){const d=a.formats(),f=this.quill.getFormat(t.index,1);o=ki.AttributeMap.diff(d,f)||{},Object.keys(o).length>0&&(l=l.retain(u.length()-1).retain(1,o))}}this.quill.updateContents(l,nt.sources.USER),this.quill.focus()}handleDeleteRange(t){Ww({range:t,quill:this.quill}),this.quill.focus()}handleEnter(t,n){const s=Object.keys(n.format).reduce((a,l)=>(this.quill.scroll.query(l,Gt.BLOCK)&&!Array.isArray(n.format[l])&&(a[l]=n.format[l]),a),{}),o=new Vt().retain(t.index).delete(t.length).insert(` `,s);this.quill.updateContents(o,nt.sources.USER),this.quill.setSelection(t.index+1,nt.sources.SILENT),this.quill.focus()}}const a1e={bindings:{bold:K5("bold"),italic:K5("italic"),underline:K5("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(e,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","+1",nt.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(e,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","-1",nt.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(e,t){t.format.indent!=null?this.quill.format("indent","-1",nt.sources.USER):t.format.list!=null&&this.quill.format("list",!1,nt.sources.USER)}},"indent code-block":rM(!0),"outdent code-block":rM(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(e){this.quill.deleteText(e.index-1,1,nt.sources.USER)}},tab:{key:"Tab",handler(e,t){if(t.format.table)return!0;this.quill.history.cutoff();const n=new Vt().retain(e.index).delete(e.length).insert(" ");return this.quill.updateContents(n,nt.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,nt.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,nt.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(e,t){const n={list:!1};t.format.indent&&(n.indent=!1),this.quill.formatLine(e.index,e.length,n,nt.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(e){const[t,n]=this.quill.getLine(e.index),s={...t.formats(),list:"checked"},o=new Vt().retain(e.index).insert(` `,s).retain(t.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(o,nt.sources.USER),this.quill.setSelection(e.index+1,nt.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(e,t){const[n,s]=this.quill.getLine(e.index),o=new Vt().retain(e.index).insert(` `,t.format).retain(n.length()-s-1).retain(1,{header:null});this.quill.updateContents(o,nt.sources.USER),this.quill.setSelection(e.index+1,nt.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(e){const t=this.quill.getModule("table");if(t){const[n,s,o,a]=t.getTable(e),l=c1e(n,s,o,a);if(l==null)return;let u=n.offset();if(l<0){const d=new Vt().retain(u).insert(` `);this.quill.updateContents(d,nt.sources.USER),this.quill.setSelection(e.index+1,e.length,nt.sources.SILENT)}else if(l>0){u+=n.length();const d=new Vt().retain(u).insert(` `);this.quill.updateContents(d,nt.sources.USER),this.quill.setSelection(u,nt.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(e,t){const{event:n,line:s}=t,o=s.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(o-1,nt.sources.USER):this.quill.setSelection(o+s.length(),nt.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(e,t){if(this.quill.scroll.query("list")==null)return!0;const{length:n}=t.prefix,[s,o]=this.quill.getLine(e.index);if(o>n)return!0;let a;switch(t.prefix.trim()){case"[]":case"[ ]":a="unchecked";break;case"[x]":a="checked";break;case"-":case"*":a="bullet";break;default:a="ordered"}this.quill.insertText(e.index," ",nt.sources.USER),this.quill.history.cutoff();const l=new Vt().retain(e.index-o).delete(n+1).retain(s.length()-2-o).retain(1,{list:a});return this.quill.updateContents(l,nt.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,nt.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(e){const[t,n]=this.quill.getLine(e.index);let s=2,o=t;for(;o!=null&&o.length()<=1&&o.formats()["code-block"];)if(o=o.prev,s-=1,s<=0){const a=new Vt().retain(e.index+t.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(a,nt.sources.USER),this.quill.setSelection(e.index-1,nt.sources.SILENT),!1}return!0}},"embed left":T0("ArrowLeft",!1),"embed left shift":T0("ArrowLeft",!0),"embed right":T0("ArrowRight",!1),"embed right shift":T0("ArrowRight",!0),"table down":sM(!1),"table up":sM(!0)}};Ay.DEFAULTS=a1e;function rM(e){return{key:"Tab",shiftKey:!e,format:{"code-block":!0},handler(t,n){let{event:s}=n;const o=this.quill.scroll.query("code-block"),{TAB:a}=o;if(t.length===0&&!s.shiftKey){this.quill.insertText(t.index,a,nt.sources.USER),this.quill.setSelection(t.index+a.length,nt.sources.SILENT);return}const l=t.length===0?this.quill.getLines(t.index,1):this.quill.getLines(t);let{index:u,length:d}=t;l.forEach((f,p)=>{e?(f.insertAt(0,a),p===0?u+=a.length:d+=a.length):f.domNode.textContent.startsWith(a)&&(f.deleteAt(0,a.length),p===0?u-=a.length:d-=a.length)}),this.quill.update(nt.sources.USER),this.quill.setSelection(u,d,nt.sources.SILENT)}}}function T0(e,t){return{key:e,shiftKey:t,altKey:null,[e==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(s){let{index:o}=s;e==="ArrowRight"&&(o+=s.length+1);const[a]=this.quill.getLeaf(o);return a instanceof ri?(e==="ArrowLeft"?t?this.quill.setSelection(s.index-1,s.length+1,nt.sources.USER):this.quill.setSelection(s.index-1,nt.sources.USER):t?this.quill.setSelection(s.index,s.length+1,nt.sources.USER):this.quill.setSelection(s.index+s.length+1,nt.sources.USER),!1):!0}}}function K5(e){return{key:e[0],shortKey:!0,handler(t,n){this.quill.format(e,!n.format[e],nt.sources.USER)}}}function sM(e){return{key:e?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,n){const s=e?"prev":"next",o=n.line,a=o.parent[s];if(a!=null){if(a.statics.blotName==="table-row"){let l=a.children.head,u=o;for(;u.prev!=null;)u=u.prev,l=l.next;const d=l.offset(this.quill.scroll)+Math.min(n.offset,l.length()-1);this.quill.setSelection(d,0,nt.sources.USER)}}else{const l=o.table()[s];l!=null&&(e?this.quill.setSelection(l.offset(this.quill.scroll)+l.length()-1,0,nt.sources.USER):this.quill.setSelection(l.offset(this.quill.scroll),0,nt.sources.USER))}return!1}}}function l1e(e){if(typeof e=="string"||typeof e=="number")e={key:e};else if(typeof e=="object")e=Ff(e);else return null;return e.shortKey&&(e[i1e]=e.shortKey,delete e.shortKey),e}function Ww(e){let{quill:t,range:n}=e;const s=t.getLines(n);let o={};if(s.length>1){const a=s[0].formats(),l=s[s.length-1].formats();o=ki.AttributeMap.diff(l,a)||{}}t.deleteText(n,nt.sources.USER),Object.keys(o).length>0&&t.formatLine(n.index,1,o,nt.sources.USER),t.setSelection(n.index,nt.sources.SILENT)}function c1e(e,t,n,s){return t.prev==null&&t.next==null?n.prev==null&&n.next==null?s===0?-1:1:n.prev==null?-1:1:t.prev==null?-1:t.next==null?1:null}const u1e=/font-weight:\s*normal/,d1e=["P","OL","UL"],oM=e=>e&&d1e.includes(e.tagName),f1e=e=>{Array.from(e.querySelectorAll("br")).filter(t=>oM(t.previousElementSibling)&&oM(t.nextElementSibling)).forEach(t=>{t.parentNode?.removeChild(t)})},h1e=e=>{Array.from(e.querySelectorAll('b[style*="font-weight"]')).filter(t=>t.getAttribute("style")?.match(u1e)).forEach(t=>{const n=e.createDocumentFragment();n.append(...t.childNodes),t.parentNode?.replaceChild(n,t)})};function p1e(e){e.querySelector('[id^="docs-internal-guid-"]')&&(h1e(e),f1e(e))}const g1e=/\bmso-list:[^;]*ignore/i,m1e=/\bmso-list:[^;]*\bl(\d+)/i,x1e=/\bmso-list:[^;]*\blevel(\d+)/i,b1e=(e,t)=>{const n=e.getAttribute("style"),s=n?.match(m1e);if(!s)return null;const o=Number(s[1]),a=n?.match(x1e),l=a?Number(a[1]):1,u=new RegExp(`@list l${o}:level${l}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),d=t.match(u),f=d&&d[1]==="bullet"?"bullet":"ordered";return{id:o,indent:l,type:f,element:e}},y1e=e=>{const t=Array.from(e.querySelectorAll("[style*=mso-list]")),n=[],s=[];t.forEach(l=>{(l.getAttribute("style")||"").match(g1e)?n.push(l):s.push(l)}),n.forEach(l=>l.parentNode?.removeChild(l));const o=e.documentElement.innerHTML,a=s.map(l=>b1e(l,o)).filter(l=>l);for(;a.length;){const l=[];let u=a.shift();for(;u;)l.push(u),u=a.length&&a[0]?.element===u.element.nextElementSibling&&a[0].id===u.id?a.shift():null;const d=document.createElement("ul");l.forEach(g=>{const x=document.createElement("li");x.setAttribute("data-list",g.type),g.indent>1&&x.setAttribute("class",`ql-indent-${g.indent-1}`),x.innerHTML=g.element.innerHTML,d.appendChild(x)});const f=l[0]?.element,{parentNode:p}=f??{};f&&p?.replaceChild(d,f),l.slice(1).forEach(g=>{let{element:x}=g;p?.removeChild(x)})}};function v1e(e){e.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&y1e(e)}const S1e=[v1e,p1e],j1e=e=>{e.documentElement&&S1e.forEach(t=>{t(e)})},C1e=Ol("quill:clipboard"),w1e=[[Node.TEXT_NODE,D1e],[Node.TEXT_NODE,aM],["br",R1e],[Node.ELEMENT_NODE,aM],[Node.ELEMENT_NODE,M1e],[Node.ELEMENT_NODE,k1e],[Node.ELEMENT_NODE,L1e],["li",F1e],["ol, ul",_1e],["pre",z1e],["tr",P1e],["b",X5("bold")],["i",X5("italic")],["strike",X5("strike")],["style",I1e]],A1e=[t1e,lL].reduce((e,t)=>(e[t.keyName]=t,e),{}),iM=[iL,Nw,Bw,uL,hL,gL].reduce((e,t)=>(e[t.keyName]=t,e),{});class E1e extends Ka{static DEFAULTS={matchers:[]};constructor(t,n){super(t,n),this.quill.root.addEventListener("copy",s=>this.onCaptureCopy(s,!1)),this.quill.root.addEventListener("cut",s=>this.onCaptureCopy(s,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],w1e.concat(this.options.matchers??[]).forEach(s=>{let[o,a]=s;this.addMatcher(o,a)})}addMatcher(t,n){this.matchers.push([t,n])}convert(t){let{html:n,text:s}=t,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(o[eo.blotName])return new Vt().insert(s||"",{[eo.blotName]:o[eo.blotName]});if(!n)return new Vt().insert(s||"",o);const a=this.convertHTML(n);return Am(a,` `)&&(a.ops[a.ops.length-1].attributes==null||o.table)?a.compose(new Vt().retain(a.length()-1).delete(1)):a}normalizeHTML(t){j1e(t)}convertHTML(t){const n=new DOMParser().parseFromString(t,"text/html");this.normalizeHTML(n);const s=n.body,o=new WeakMap,[a,l]=this.prepareMatching(s,o);return Uw(this.quill.scroll,s,a,l,o)}dangerouslyPasteHTML(t,n){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nt.sources.API;if(typeof t=="string"){const o=this.convert({html:t,text:""});this.quill.setContents(o,n),this.quill.setSelection(0,nt.sources.SILENT)}else{const o=this.convert({html:n,text:""});this.quill.updateContents(new Vt().retain(t).concat(o),s),this.quill.setSelection(t+o.length(),nt.sources.SILENT)}}onCaptureCopy(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t.defaultPrevented)return;t.preventDefault();const[s]=this.quill.selection.getRange();if(s==null)return;const{html:o,text:a}=this.onCopy(s,n);t.clipboardData?.setData("text/plain",a),t.clipboardData?.setData("text/html",o),n&&Ww({range:s,quill:this.quill})}normalizeURIList(t){return t.split(/\r?\n/).filter(n=>n[0]!=="#").join(` `)}onCapturePaste(t){if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault();const n=this.quill.getSelection(!0);if(n==null)return;const s=t.clipboardData?.getData("text/html");let o=t.clipboardData?.getData("text/plain");if(!s&&!o){const l=t.clipboardData?.getData("text/uri-list");l&&(o=this.normalizeURIList(l))}const a=Array.from(t.clipboardData?.files||[]);if(!s&&a.length>0){this.quill.uploader.upload(n,a);return}if(s&&a.length>0){const l=new DOMParser().parseFromString(s,"text/html");if(l.body.childElementCount===1&&l.body.firstElementChild?.tagName==="IMG"){this.quill.uploader.upload(n,a);return}}this.onPaste(n,{html:s,text:o})}onCopy(t){const n=this.quill.getText(t);return{html:this.quill.getSemanticHTML(t),text:n}}onPaste(t,n){let{text:s,html:o}=n;const a=this.quill.getFormat(t.index),l=this.convert({text:s,html:o},a);C1e.log("onPaste",l,{text:s,html:o});const u=new Vt().retain(t.index).delete(t.length).concat(l);this.quill.updateContents(u,nt.sources.USER),this.quill.setSelection(u.length()-t.length,nt.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(t,n){const s=[],o=[];return this.matchers.forEach(a=>{const[l,u]=a;switch(l){case Node.TEXT_NODE:o.push(u);break;case Node.ELEMENT_NODE:s.push(u);break;default:Array.from(t.querySelectorAll(l)).forEach(d=>{n.has(d)?n.get(d)?.push(u):n.set(d,[u])});break}}),[s,o]}}function ad(e,t,n,s){return s.query(t)?e.reduce((o,a)=>{if(!a.insert)return o;if(a.attributes&&a.attributes[t])return o.push(a);const l=n?{[t]:n}:{};return o.insert(a.insert,{...l,...a.attributes})},new Vt):e}function Am(e,t){let n="";for(let s=e.ops.length-1;s>=0&&n.length<t.length;--s){const o=e.ops[s];if(typeof o.insert!="string")break;n=o.insert+n}return n.slice(-1*t.length)===t}function Ec(e,t){if(!(e instanceof Element))return!1;const n=t.query(e);return n&&n.prototype instanceof ri?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(e.tagName.toLowerCase())}function T1e(e,t){return e.previousElementSibling&&e.nextElementSibling&&!Ec(e.previousElementSibling,t)&&!Ec(e.nextElementSibling,t)}const k0=new WeakMap;function mL(e){return e==null?!1:(k0.has(e)||(e.tagName==="PRE"?k0.set(e,!0):k0.set(e,mL(e.parentNode))),k0.get(e))}function Uw(e,t,n,s,o){return t.nodeType===t.TEXT_NODE?s.reduce((a,l)=>l(t,a,e),new Vt):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce((a,l)=>{let u=Uw(e,l,n,s,o);return l.nodeType===t.ELEMENT_NODE&&(u=n.reduce((d,f)=>f(l,d,e),u),u=(o.get(l)||[]).reduce((d,f)=>f(l,d,e),u)),a.concat(u)},new Vt):new Vt}function X5(e){return(t,n,s)=>ad(n,e,!0,s)}function k1e(e,t,n){const s=Ua.keys(e),o=ma.keys(e),a=Yc.keys(e),l={};return s.concat(o).concat(a).forEach(u=>{let d=n.query(u,Gt.ATTRIBUTE);d!=null&&(l[d.attrName]=d.value(e),l[d.attrName])||(d=A1e[u],d!=null&&(d.attrName===u||d.keyName===u)&&(l[d.attrName]=d.value(e)||void 0),d=iM[u],d!=null&&(d.attrName===u||d.keyName===u)&&(d=iM[u],l[d.attrName]=d.value(e)||void 0))}),Object.entries(l).reduce((u,d)=>{let[f,p]=d;return ad(u,f,p,n)},t)}function M1e(e,t,n){const s=n.query(e);if(s==null)return t;if(s.prototype instanceof ri){const o={},a=s.value(e);if(a!=null)return o[s.blotName]=a,new Vt().insert(o,s.formats(e,n))}else if(s.prototype instanceof Mg&&!Am(t,` `)&&t.insert(` `),"blotName"in s&&"formats"in s&&typeof s.formats=="function")return ad(t,s.blotName,s.formats(e,n),n);return t}function R1e(e,t){return Am(t,` `)||t.insert(` `),t}function z1e(e,t,n){const s=n.query("code-block"),o=s&&"formats"in s&&typeof s.formats=="function"?s.formats(e,n):!0;return ad(t,"code-block",o,n)}function I1e(){return new Vt}function F1e(e,t,n){const s=n.query(e);if(s==null||s.blotName!=="list"||!Am(t,` `))return t;let o=-1,a=e.parentNode;for(;a!=null;)["OL","UL"].includes(a.tagName)&&(o+=1),a=a.parentNode;return o<=0?t:t.reduce((l,u)=>u.insert?u.attributes&&typeof u.attributes.indent=="number"?l.push(u):l.insert(u.insert,{indent:o,...u.attributes||{}}):l,new Vt)}function _1e(e,t,n){const s=e;let o=s.tagName==="OL"?"ordered":"bullet";const a=s.getAttribute("data-checked");return a&&(o=a==="true"?"checked":"unchecked"),ad(t,"list",o,n)}function aM(e,t,n){if(!Am(t,` `)){if(Ec(e,n)&&(e.childNodes.length>0||e instanceof HTMLParagraphElement))return t.insert(` `);if(t.length()>0&&e.nextSibling){let s=e.nextSibling;for(;s!=null;){if(Ec(s,n))return t.insert(` `);const o=n.query(s);if(o&&o.prototype instanceof Ci)return t.insert(` `);s=s.firstChild}}}return t}function L1e(e,t,n){const s={},o=e.style||{};return o.fontStyle==="italic"&&(s.italic=!0),o.textDecoration==="underline"&&(s.underline=!0),o.textDecoration==="line-through"&&(s.strike=!0),(o.fontWeight?.startsWith("bold")||parseInt(o.fontWeight,10)>=700)&&(s.bold=!0),t=Object.entries(s).reduce((a,l)=>{let[u,d]=l;return ad(a,u,d,n)},t),parseFloat(o.textIndent||0)>0?new Vt().insert(" ").concat(t):t}function P1e(e,t,n){const s=e.parentElement?.tagName==="TABLE"?e.parentElement:e.parentElement?.parentElement;if(s!=null){const a=Array.from(s.querySelectorAll("tr")).indexOf(e)+1;return ad(t,"table",a,n)}return t}function D1e(e,t,n){let s=e.data;if(e.parentElement?.tagName==="O:P")return t.insert(s.trim());if(!mL(e)){if(s.trim().length===0&&s.includes(` `)&&!T1e(e,n))return t;s=s.replace(/[^\S\u00a0]/g," "),s=s.replace(/ {2,}/g," "),(e.previousSibling==null&&e.parentElement!=null&&Ec(e.parentElement,n)||e.previousSibling instanceof Element&&Ec(e.previousSibling,n))&&(s=s.replace(/^ /,"")),(e.nextSibling==null&&e.parentElement!=null&&Ec(e.parentElement,n)||e.nextSibling instanceof Element&&Ec(e.nextSibling,n))&&(s=s.replace(/ $/,"")),s=s.replaceAll(" "," ")}return t.insert(s)}class O1e extends Ka{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(t,n){super(t,n),this.quill.on(nt.events.EDITOR_CHANGE,(s,o,a,l)=>{s===nt.events.SELECTION_CHANGE?o&&l!==nt.sources.SILENT&&(this.currentRange=o):s===nt.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||l===nt.sources.USER?this.record(o,a):this.transform(o)),this.currentRange=vj(this.currentRange,o))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",s=>{s.inputType==="historyUndo"?(this.undo(),s.preventDefault()):s.inputType==="historyRedo"&&(this.redo(),s.preventDefault())})}change(t,n){if(this.stack[t].length===0)return;const s=this.stack[t].pop();if(!s)return;const o=this.quill.getContents(),a=s.delta.invert(o);this.stack[n].push({delta:a,range:vj(s.range,a)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s.delta,nt.sources.USER),this.ignoreChange=!1,this.restoreSelection(s)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,n){if(t.ops.length===0)return;this.stack.redo=[];let s=t.invert(n),o=this.currentRange;const a=Date.now();if(this.lastRecorded+this.options.delay>a&&this.stack.undo.length>0){const l=this.stack.undo.pop();l&&(s=s.compose(l.delta),o=l.range)}else this.lastRecorded=a;s.length()!==0&&(this.stack.undo.push({delta:s,range:o}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(t){lM(this.stack.undo,t),lM(this.stack.redo,t)}undo(){this.change("undo","redo")}restoreSelection(t){if(t.range)this.quill.setSelection(t.range,nt.sources.USER);else{const n=N1e(this.quill.scroll,t.delta);this.quill.setSelection(n,nt.sources.USER)}}}function lM(e,t){let n=t;for(let s=e.length-1;s>=0;s-=1){const o=e[s];e[s]={delta:n.transform(o.delta,!0),range:o.range&&vj(o.range,n)},n=o.delta.transform(n),e[s].delta.length()===0&&e.splice(s,1)}}function B1e(e,t){const n=t.ops[t.ops.length-1];return n==null?!1:n.insert!=null?typeof n.insert=="string"&&n.insert.endsWith(` `):n.attributes!=null?Object.keys(n.attributes).some(s=>e.query(s,Gt.BLOCK)!=null):!1}function N1e(e,t){const n=t.reduce((o,a)=>o+(a.delete||0),0);let s=t.length()-n;return B1e(e,t)&&(s-=1),s}function vj(e,t){if(!e)return e;const n=t.transformPosition(e.index),s=t.transformPosition(e.index+e.length);return{index:n,length:s-n}}class xL extends Ka{constructor(t,n){super(t,n),t.root.addEventListener("drop",s=>{s.preventDefault();let o=null;if(document.caretRangeFromPoint)o=document.caretRangeFromPoint(s.clientX,s.clientY);else if(document.caretPositionFromPoint){const l=document.caretPositionFromPoint(s.clientX,s.clientY);o=document.createRange(),o.setStart(l.offsetNode,l.offset),o.setEnd(l.offsetNode,l.offset)}const a=o&&t.selection.normalizeNative(o);if(a){const l=t.selection.normalizedToRange(a);s.dataTransfer?.files&&this.upload(l,s.dataTransfer.files)}})}upload(t,n){const s=[];Array.from(n).forEach(o=>{o&&this.options.mimetypes?.includes(o.type)&&s.push(o)}),s.length>0&&this.options.handler.call(this,t,s)}}xL.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(e,t){if(!this.quill.scroll.query("image"))return;const n=t.map(s=>new Promise(o=>{const a=new FileReader;a.onload=()=>{o(a.result)},a.readAsDataURL(s)}));Promise.all(n).then(s=>{const o=s.reduce((a,l)=>a.insert({image:l}),new Vt().retain(e.index).delete(e.length));this.quill.updateContents(o,$t.sources.USER),this.quill.setSelection(e.index+s.length,$t.sources.SILENT)})}};const $1e=["insertText","insertReplacementText"];class H1e extends Ka{constructor(t,n){super(t,n),t.root.addEventListener("beforeinput",s=>{this.handleBeforeInput(s)}),/Android/i.test(navigator.userAgent)||t.on(nt.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(t){Ww({range:t,quill:this.quill})}replaceText(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(t.length===0)return!1;if(n){const s=this.quill.getFormat(t.index,1);this.deleteRange(t),this.quill.updateContents(new Vt().retain(t.index).insert(n,s),nt.sources.USER)}else this.deleteRange(t);return this.quill.setSelection(t.index+n.length,0,nt.sources.SILENT),!0}handleBeforeInput(t){if(this.quill.composition.isComposing||t.defaultPrevented||!$1e.includes(t.inputType))return;const n=t.getTargetRanges?t.getTargetRanges()[0]:null;if(!n||n.collapsed===!0)return;const s=W1e(t);if(s==null)return;const o=this.quill.selection.normalizeNative(n),a=o?this.quill.selection.normalizedToRange(o):null;a&&this.replaceText(a,s)&&t.preventDefault()}handleCompositionStart(){const t=this.quill.getSelection();t&&this.replaceText(t)}}function W1e(e){return typeof e.data=="string"?e.data:e.dataTransfer?.types.includes("text/plain")?e.dataTransfer.getData("text/plain"):null}const U1e=/Mac/i.test(navigator.platform),q1e=100,V1e=e=>!!(e.key==="ArrowLeft"||e.key==="ArrowRight"||e.key==="ArrowUp"||e.key==="ArrowDown"||e.key==="Home"||U1e&&e.key==="a"&&e.ctrlKey===!0);class G1e extends Ka{isListening=!1;selectionChangeDeadline=0;constructor(t,n){super(t,n),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(t,n){let{line:s,event:o}=n;if(!(s instanceof ua)||!s.uiNode)return!0;const a=getComputedStyle(s.domNode).direction==="rtl";return a&&o.key!=="ArrowRight"||!a&&o.key!=="ArrowLeft"?!0:(this.quill.setSelection(t.index-1,t.length+(o.shiftKey?1:0),nt.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",t=>{!t.defaultPrevented&&V1e(t)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+q1e,this.isListening)return;this.isListening=!0;const t=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",t,{once:!0})}handleSelectionChange(){const t=document.getSelection();if(!t)return;const n=t.getRangeAt(0);if(n.collapsed!==!0||n.startOffset!==0)return;const s=this.quill.scroll.find(n.startContainer);if(!(s instanceof ua)||!s.uiNode)return;const o=document.createRange();o.setStartAfter(s.uiNode),o.setEndAfter(s.uiNode),t.removeAllRanges(),t.addRange(o)}}nt.register({"blots/block":_s,"blots/block/embed":Ci,"blots/break":xa,"blots/container":od,"blots/cursor":na,"blots/embed":Dw,"blots/inline":Xs,"blots/scroll":e1e,"blots/text":pa,"modules/clipboard":E1e,"modules/history":O1e,"modules/keyboard":Ay,"modules/uploader":xL,"modules/input":H1e,"modules/uiNode":G1e});class Y1e extends ma{add(t,n){let s=0;if(n==="+1"||n==="-1"){const o=this.value(t)||0;s=n==="+1"?o+1:o-1}else typeof n=="number"&&(s=n);return s===0?(this.remove(t),!0):super.add(t,s.toString())}canAdd(t,n){return super.canAdd(t,n)||super.canAdd(t,parseInt(n,10))}value(t){return parseInt(super.value(t),10)||void 0}}const K1e=new Y1e("indent","ql-indent",{scope:Gt.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class X1e extends _s{static blotName="blockquote";static tagName="blockquote"}class Z1e extends _s{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(t){return this.tagName.indexOf(t.tagName)+1}}class Em extends od{}Em.blotName="list-container";Em.tagName="OL";class Tm extends _s{static create(t){const n=super.create();return n.setAttribute("data-list",t),n}static formats(t){return t.getAttribute("data-list")||void 0}static register(){nt.register(Em)}constructor(t,n){super(t,n);const s=n.ownerDocument.createElement("span"),o=a=>{if(!t.isEnabled())return;const l=this.statics.formats(n,t);l==="checked"?(this.format("list","unchecked"),a.preventDefault()):l==="unchecked"&&(this.format("list","checked"),a.preventDefault())};s.addEventListener("mousedown",o),s.addEventListener("touchstart",o),this.attachUI(s)}format(t,n){t===this.statics.blotName&&n?this.domNode.setAttribute("data-list",n):super.format(t,n)}}Tm.blotName="list";Tm.tagName="LI";Em.allowedChildren=[Tm];Tm.requiredContainer=Em;class qw extends Xs{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return!0}optimize(t){super.optimize(t),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}class Q1e extends qw{static blotName="italic";static tagName=["EM","I"]}class B1 extends Xs{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(t){const n=super.create(t);return n.setAttribute("href",this.sanitize(t)),n.setAttribute("rel","noopener noreferrer"),n.setAttribute("target","_blank"),n}static formats(t){return t.getAttribute("href")}static sanitize(t){return bL(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}format(t,n){t!==this.statics.blotName||!n?super.format(t,n):this.domNode.setAttribute("href",this.constructor.sanitize(n))}}function bL(e,t){const n=document.createElement("a");n.href=e;const s=n.href.slice(0,n.href.indexOf(":"));return t.indexOf(s)>-1}class J1e extends Xs{static blotName="script";static tagName=["SUB","SUP"];static create(t){return t==="super"?document.createElement("sup"):t==="sub"?document.createElement("sub"):super.create(t)}static formats(t){if(t.tagName==="SUB")return"sub";if(t.tagName==="SUP")return"super"}}class ebe extends qw{static blotName="strike";static tagName=["S","STRIKE"]}class tbe extends Xs{static blotName="underline";static tagName="U"}class nbe extends Dw{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(t){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const n=super.create(t);return typeof t=="string"&&(window.katex.render(t,n,{throwOnError:!1,errorColor:"#f00"}),n.setAttribute("data-value",t)),n}static value(t){return t.getAttribute("data-value")}html(){const{formula:t}=this.value();return`<span>${t}</span>`}}const cM=["alt","height","width"];let rbe=class extends ri{static blotName="image";static tagName="IMG";static create(t){const n=super.create(t);return typeof t=="string"&&n.setAttribute("src",this.sanitize(t)),n}static formats(t){return cM.reduce((n,s)=>(t.hasAttribute(s)&&(n[s]=t.getAttribute(s)),n),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static sanitize(t){return bL(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,n){cM.indexOf(t)>-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):super.format(t,n)}};const uM=["height","width"];class sbe extends Ci{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(t){const n=super.create(t);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen","true"),n.setAttribute("src",this.sanitize(t)),n}static formats(t){return uM.reduce((n,s)=>(t.hasAttribute(s)&&(n[s]=t.getAttribute(s)),n),{})}static sanitize(t){return B1.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,n){uM.indexOf(t)>-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):super.format(t,n)}html(){const{video:t}=this.value();return`<a href="${t}">${t}</a>`}}const Pp=new ma("code-token","hljs",{scope:Gt.INLINE});class Il extends Xs{static formats(t,n){for(;t!=null&&t!==n.domNode;){if(t.classList&&t.classList.contains(eo.className))return super.formats(t,n);t=t.parentNode}}constructor(t,n,s){super(t,n,s),Pp.add(this.domNode,s)}format(t,n){t!==Il.blotName?super.format(t,n):n?Pp.add(this.domNode,n):(Pp.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Pp.value(this.domNode)||this.unwrap()}}Il.blotName="code-token";Il.className="ql-token";class Si extends eo{static create(t){const n=super.create(t);return typeof t=="string"&&n.setAttribute("data-language",t),n}static formats(t){return t.getAttribute("data-language")||"plain"}static register(){}format(t,n){t===this.statics.blotName&&n?this.domNode.setAttribute("data-language",n):super.format(t,n)}replaceWith(t,n){return this.formatAt(0,this.length(),Il.blotName,!1),super.replaceWith(t,n)}}class Zp extends id{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(t,n){t===Si.blotName&&(this.forceNext=!0,this.children.forEach(s=>{s.format(t,n)}))}formatAt(t,n,s,o){s===Si.blotName&&(this.forceNext=!0),super.formatAt(t,n,s,o)}highlight(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const o=`${Array.from(this.domNode.childNodes).filter(l=>l!==this.uiNode).map(l=>l.textContent).join(` `)} `,a=Si.formats(this.children.head.domNode);if(n||this.forceNext||this.cachedText!==o){if(o.trim().length>0||this.cachedText==null){const l=this.children.reduce((d,f)=>d.concat(rL(f,!1)),new Vt),u=t(o,a);l.diff(u).reduce((d,f)=>{let{retain:p,attributes:g}=f;return p?(g&&Object.keys(g).forEach(x=>{[Si.blotName,Il.blotName].includes(x)&&this.formatAt(d,p,x,g[x])}),d+p):d},0)}this.cachedText=o,this.forceNext=!1}}html(t,n){const[s]=this.children.find(t);return`<pre data-language="${s?Si.formats(s.domNode):"plain"}"> ${wy(this.code(t,n))} </pre>`}optimize(t){if(super.optimize(t),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const n=Si.formats(this.children.head.domNode);n!==this.uiNode.value&&(this.uiNode.value=n)}}}Zp.allowedChildren=[Si];Si.requiredContainer=Zp;Si.allowedChildren=[Il,na,pa,xa];const obe=(e,t,n)=>{if(typeof e.versionString=="string"){const s=e.versionString.split(".")[0];if(parseInt(s,10)>=11)return e.highlight(n,{language:t}).value}return e.highlight(t,n).value};class yL extends Ka{static register(){nt.register(Il,!0),nt.register(Si,!0),nt.register(Zp,!0)}constructor(t,n){if(super(t,n),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((s,o)=>{let{key:a}=o;return s[a]=!0,s},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(nt.events.SCROLL_BLOT_MOUNT,t=>{if(!(t instanceof Zp))return;const n=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(s=>{let{key:o,label:a}=s;const l=n.ownerDocument.createElement("option");l.textContent=a,l.setAttribute("value",o),n.appendChild(l)}),n.addEventListener("change",()=>{t.format(Si.blotName,n.value),this.quill.root.focus(),this.highlight(t,!0)}),t.uiNode==null&&(t.attachUI(n),t.children.head&&(n.value=Si.formats(t.children.head.domNode)))})}initTimer(){let t=null;this.quill.on(nt.events.SCROLL_OPTIMIZE,()=>{t&&clearTimeout(t),t=setTimeout(()=>{this.highlight(),t=null},this.options.interval)})}highlight(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(nt.sources.USER);const s=this.quill.getSelection();(t==null?this.quill.scroll.descendants(Zp):[t]).forEach(a=>{a.highlight(this.highlightBlot,n)}),this.quill.update(nt.sources.SILENT),s!=null&&this.quill.setSelection(s,nt.sources.SILENT)}highlightBlot(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(n=this.languages[n]?n:"plain",n==="plain")return wy(t).split(` `).reduce((o,a,l)=>(l!==0&&o.insert(` `,{[eo.blotName]:n}),o.insert(a)),new Vt);const s=this.quill.root.ownerDocument.createElement("div");return s.classList.add(eo.className),s.innerHTML=obe(this.options.hljs,n,t),Uw(this.quill.scroll,s,[(o,a)=>{const l=Pp.value(o);return l?a.compose(new Vt().retain(a.length(),{[Il.blotName]:l})):a}],[(o,a)=>o.data.split(` `).reduce((l,u,d)=>(d!==0&&l.insert(` `,{[eo.blotName]:n}),l.insert(u)),a)],new WeakMap)}}yL.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};class oa extends _s{static blotName="table";static tagName="TD";static create(t){const n=super.create();return t?n.setAttribute("data-row",t):n.setAttribute("data-row",Vw()),n}static formats(t){if(t.hasAttribute("data-row"))return t.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(t,n){t===oa.blotName&&n?this.domNode.setAttribute("data-row",n):super.format(t,n)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}class Uu extends od{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const t=this.children.head.formats(),n=this.children.tail.formats(),s=this.next.children.head.formats(),o=this.next.children.tail.formats();return t.table===n.table&&t.table===s.table&&t.table===o.table}return!1}optimize(t){super.optimize(t),this.children.forEach(n=>{if(n.next==null)return;const s=n.formats(),o=n.next.formats();if(s.table!==o.table){const a=this.splitAfter(n);a&&a.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}class Mc extends od{static blotName="table-body";static tagName="TBODY"}class N1 extends od{static blotName="table-container";static tagName="TABLE";balanceCells(){const t=this.descendants(Uu),n=t.reduce((s,o)=>Math.max(o.children.length,s),0);t.forEach(s=>{new Array(n-s.children.length).fill(0).forEach(()=>{let o;s.children.head!=null&&(o=oa.formats(s.children.head.domNode));const a=this.scroll.create(oa.blotName,o);s.appendChild(a),a.optimize()})})}cells(t){return this.rows().map(n=>n.children.at(t))}deleteColumn(t){const[n]=this.descendant(Mc);n==null||n.children.head==null||n.children.forEach(s=>{const o=s.children.at(t);o?.remove()})}insertColumn(t){const[n]=this.descendant(Mc);n==null||n.children.head==null||n.children.forEach(s=>{const o=s.children.at(t),a=oa.formats(s.children.head.domNode),l=this.scroll.create(oa.blotName,a);s.insertBefore(l,o)})}insertRow(t){const[n]=this.descendant(Mc);if(n==null||n.children.head==null)return;const s=Vw(),o=this.scroll.create(Uu.blotName);n.children.head.children.forEach(()=>{const l=this.scroll.create(oa.blotName,s);o.appendChild(l)});const a=n.children.at(t);n.insertBefore(o,a)}rows(){const t=this.children.head;return t==null?[]:t.children.map(n=>n)}}N1.allowedChildren=[Mc];Mc.requiredContainer=N1;Mc.allowedChildren=[Uu];Uu.requiredContainer=Mc;Uu.allowedChildren=[oa];oa.requiredContainer=Uu;function Vw(){return`row-${Math.random().toString(36).slice(2,6)}`}class ibe extends Ka{static register(){nt.register(oa),nt.register(Uu),nt.register(Mc),nt.register(N1)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(N1).forEach(t=>{t.balanceCells()})}deleteColumn(){const[t,,n]=this.getTable();n!=null&&(t.deleteColumn(n.cellOffset()),this.quill.update(nt.sources.USER))}deleteRow(){const[,t]=this.getTable();t!=null&&(t.remove(),this.quill.update(nt.sources.USER))}deleteTable(){const[t]=this.getTable();if(t==null)return;const n=t.offset();t.remove(),this.quill.update(nt.sources.USER),this.quill.setSelection(n,nt.sources.SILENT)}getTable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(t==null)return[null,null,null,-1];const[n,s]=this.quill.getLine(t.index);if(n==null||n.statics.blotName!==oa.blotName)return[null,null,null,-1];const o=n.parent;return[o.parent.parent,o,n,s]}insertColumn(t){const n=this.quill.getSelection();if(!n)return;const[s,o,a]=this.getTable(n);if(a==null)return;const l=a.cellOffset();s.insertColumn(l+t),this.quill.update(nt.sources.USER);let u=o.rowOffset();t===0&&(u+=1),this.quill.setSelection(n.index+u,n.length,nt.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(t){const n=this.quill.getSelection();if(!n)return;const[s,o,a]=this.getTable(n);if(a==null)return;const l=o.rowOffset();s.insertRow(l+t),this.quill.update(nt.sources.USER),t>0?this.quill.setSelection(n,nt.sources.SILENT):this.quill.setSelection(n.index+o.children.length,n.length,nt.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(t,n){const s=this.quill.getSelection();if(s==null)return;const o=new Array(t).fill(0).reduce(a=>{const l=new Array(n).fill(` `).join("");return a.insert(l,{table:Vw()})},new Vt().retain(s.index));this.quill.updateContents(o,nt.sources.USER),this.quill.setSelection(s.index,nt.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(nt.events.SCROLL_OPTIMIZE,t=>{t.some(n=>["TD","TR","TBODY","TABLE"].includes(n.target.tagName)?(this.quill.once(nt.events.TEXT_CHANGE,(s,o,a)=>{a===nt.sources.USER&&this.balanceTables()}),!0):!1)})}}const dM=Ol("quill:toolbar");class Gw extends Ka{constructor(t,n){if(super(t,n),Array.isArray(this.options.container)){const s=document.createElement("div");s.setAttribute("role","toolbar"),abe(s,this.options.container),t.container?.parentNode?.insertBefore(s,t.container),this.container=s}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){dM.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(s=>{const o=this.options.handlers?.[s];o&&this.addHandler(s,o)}),Array.from(this.container.querySelectorAll("button, select")).forEach(s=>{this.attach(s)}),this.quill.on(nt.events.EDITOR_CHANGE,()=>{const[s]=this.quill.selection.getRange();this.update(s)})}addHandler(t,n){this.handlers[t]=n}attach(t){let n=Array.from(t.classList).find(o=>o.indexOf("ql-")===0);if(!n)return;if(n=n.slice(3),t.tagName==="BUTTON"&&t.setAttribute("type","button"),this.handlers[n]==null&&this.quill.scroll.query(n)==null){dM.warn("ignoring attaching to nonexistent format",n,t);return}const s=t.tagName==="SELECT"?"change":"click";t.addEventListener(s,o=>{let a;if(t.tagName==="SELECT"){if(t.selectedIndex<0)return;const u=t.options[t.selectedIndex];u.hasAttribute("selected")?a=!1:a=u.value||!1}else t.classList.contains("ql-active")?a=!1:a=t.value||!t.hasAttribute("value"),o.preventDefault();this.quill.focus();const[l]=this.quill.selection.getRange();if(this.handlers[n]!=null)this.handlers[n].call(this,a);else if(this.quill.scroll.query(n).prototype instanceof ri){if(a=prompt(`Enter ${n}`),!a)return;this.quill.updateContents(new Vt().retain(l.index).delete(l.length).insert({[n]:a}),nt.sources.USER)}else this.quill.format(n,a,nt.sources.USER);this.update(l)}),this.controls.push([n,t])}update(t){const n=t==null?{}:this.quill.getFormat(t);this.controls.forEach(s=>{const[o,a]=s;if(a.tagName==="SELECT"){let l=null;if(t==null)l=null;else if(n[o]==null)l=a.querySelector("option[selected]");else if(!Array.isArray(n[o])){let u=n[o];typeof u=="string"&&(u=u.replace(/"/g,'\\"')),l=a.querySelector(`option[value="${u}"]`)}l==null?(a.value="",a.selectedIndex=-1):l.selected=!0}else if(t==null)a.classList.remove("ql-active"),a.setAttribute("aria-pressed","false");else if(a.hasAttribute("value")){const l=n[o],u=l===a.getAttribute("value")||l!=null&&l.toString()===a.getAttribute("value")||l==null&&!a.getAttribute("value");a.classList.toggle("ql-active",u),a.setAttribute("aria-pressed",u.toString())}else{const l=n[o]!=null;a.classList.toggle("ql-active",l),a.setAttribute("aria-pressed",l.toString())}})}}Gw.DEFAULTS={};function fM(e,t,n){const s=document.createElement("button");s.setAttribute("type","button"),s.classList.add(`ql-${t}`),s.setAttribute("aria-pressed","false"),n!=null?(s.value=n,s.setAttribute("aria-label",`${t}: ${n}`)):s.setAttribute("aria-label",t),e.appendChild(s)}function abe(e,t){Array.isArray(t[0])||(t=[t]),t.forEach(n=>{const s=document.createElement("span");s.classList.add("ql-formats"),n.forEach(o=>{if(typeof o=="string")fM(s,o);else{const a=Object.keys(o)[0],l=o[a];Array.isArray(l)?lbe(s,a,l):fM(s,a,l)}}),e.appendChild(s)})}function lbe(e,t,n){const s=document.createElement("select");s.classList.add(`ql-${t}`),n.forEach(o=>{const a=document.createElement("option");o!==!1?a.setAttribute("value",String(o)):a.setAttribute("selected","selected"),s.appendChild(a)}),e.appendChild(s)}Gw.DEFAULTS={container:null,handlers:{clean(){const e=this.quill.getSelection();if(e!=null)if(e.length===0){const t=this.quill.getFormat();Object.keys(t).forEach(n=>{this.quill.scroll.query(n,Gt.INLINE)!=null&&this.quill.format(n,!1,nt.sources.USER)})}else this.quill.removeFormat(e.index,e.length,nt.sources.USER)},direction(e){const{align:t}=this.quill.getFormat();e==="rtl"&&t==null?this.quill.format("align","right",nt.sources.USER):!e&&t==="right"&&this.quill.format("align",!1,nt.sources.USER),this.quill.format("direction",e,nt.sources.USER)},indent(e){const t=this.quill.getSelection(),n=this.quill.getFormat(t),s=parseInt(n.indent||0,10);if(e==="+1"||e==="-1"){let o=e==="+1"?1:-1;n.direction==="rtl"&&(o*=-1),this.quill.format("indent",s+o,nt.sources.USER)}},link(e){e===!0&&(e=prompt("Enter link URL:")),this.quill.format("link",e,nt.sources.USER)},list(e){const t=this.quill.getSelection(),n=this.quill.getFormat(t);e==="check"?n.list==="checked"||n.list==="unchecked"?this.quill.format("list",!1,nt.sources.USER):this.quill.format("list","unchecked",nt.sources.USER):this.quill.format("list",e,nt.sources.USER)}}};const cbe='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',ube='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',dbe='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',fbe='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',hbe='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',pbe='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',gbe='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',mbe='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',hM='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',xbe='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',bbe='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',ybe='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',vbe='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',Sbe='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',jbe='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',Cbe='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',wbe='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',Abe='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',Ebe='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',Tbe='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',kbe='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',Mbe='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',Rbe='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',zbe='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',Ibe='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',Fbe='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',_be='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',Lbe='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',Pbe='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',Dbe='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',Obe='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',Bbe='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',Nbe='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',zg={align:{"":cbe,center:ube,right:dbe,justify:fbe},background:hbe,blockquote:pbe,bold:gbe,clean:mbe,code:hM,"code-block":hM,color:xbe,direction:{"":bbe,rtl:ybe},formula:vbe,header:{1:Sbe,2:jbe,3:Cbe,4:wbe,5:Abe,6:Ebe},italic:Tbe,image:kbe,indent:{"+1":Mbe,"-1":Rbe},link:zbe,list:{bullet:Ibe,check:Fbe,ordered:_be},script:{sub:Lbe,super:Pbe},strike:Dbe,table:Obe,underline:Bbe,video:Nbe},$be='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let pM=0;function gM(e,t){e.setAttribute(t,`${e.getAttribute(t)!=="true"}`)}class Ey{constructor(t){this.select=t,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",n=>{switch(n.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),n.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),gM(this.label,"aria-expanded"),gM(this.options,"aria-hidden")}buildItem(t){const n=document.createElement("span");n.tabIndex="0",n.setAttribute("role","button"),n.classList.add("ql-picker-item");const s=t.getAttribute("value");return s&&n.setAttribute("data-value",s),t.textContent&&n.setAttribute("data-label",t.textContent),n.addEventListener("click",()=>{this.selectItem(n,!0)}),n.addEventListener("keydown",o=>{switch(o.key){case"Enter":this.selectItem(n,!0),o.preventDefault();break;case"Escape":this.escape(),o.preventDefault();break}}),n}buildLabel(){const t=document.createElement("span");return t.classList.add("ql-picker-label"),t.innerHTML=$be,t.tabIndex="0",t.setAttribute("role","button"),t.setAttribute("aria-expanded","false"),this.container.appendChild(t),t}buildOptions(){const t=document.createElement("span");t.classList.add("ql-picker-options"),t.setAttribute("aria-hidden","true"),t.tabIndex="-1",t.id=`ql-picker-options-${pM}`,pM+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,Array.from(this.select.options).forEach(n=>{const s=this.buildItem(n);t.appendChild(s),n.selected===!0&&this.selectItem(s)}),this.container.appendChild(t)}buildPicker(){Array.from(this.select.attributes).forEach(t=>{this.container.setAttribute(t.name,t.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const s=this.container.querySelector(".ql-selected");t!==s&&(s?.classList.remove("ql-selected"),t!=null&&(t.classList.add("ql-selected"),this.select.selectedIndex=Array.from(t.parentNode.children).indexOf(t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),n&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let t;if(this.select.selectedIndex>-1){const s=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(s)}else this.selectItem(null);const n=t!=null&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}class vL extends Ey{constructor(t,n){super(t),this.label.innerHTML=n,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(s=>{s.classList.add("ql-primary")})}buildItem(t){const n=super.buildItem(t);return n.style.backgroundColor=t.getAttribute("value")||"",n}selectItem(t,n){super.selectItem(t,n);const s=this.label.querySelector(".ql-color-label"),o=t&&t.getAttribute("data-value")||"";s&&(s.tagName==="line"?s.style.stroke=o:s.style.fill=o)}}class SL extends Ey{constructor(t,n){super(t),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(s=>{s.innerHTML=n[s.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(t,n){super.selectItem(t,n);const s=t||this.defaultItem;if(s!=null){if(this.label.innerHTML===s.innerHTML)return;this.label.innerHTML=s.innerHTML}}}const Hbe=e=>{const{overflowY:t}=getComputedStyle(e,null);return t!=="visible"&&t!=="clip"};class jL{constructor(t,n){this.quill=t,this.boundsContainer=n||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,Hbe(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(t){const n=t.left+t.width/2-this.root.offsetWidth/2,s=t.bottom+this.quill.root.scrollTop;this.root.style.left=`${n}px`,this.root.style.top=`${s}px`,this.root.classList.remove("ql-flip");const o=this.boundsContainer.getBoundingClientRect(),a=this.root.getBoundingClientRect();let l=0;if(a.right>o.right&&(l=o.right-a.right,this.root.style.left=`${n+l}px`),a.left<o.left&&(l=o.left-a.left,this.root.style.left=`${n+l}px`),a.bottom>o.bottom){const u=a.bottom-a.top,d=t.bottom-t.top+u;this.root.style.top=`${s-d}px`,this.root.classList.add("ql-flip")}return l}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const Wbe=[!1,"center","right","justify"],Ube=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],qbe=[!1,"serif","monospace"],Vbe=["1","2","3",!1],Gbe=["small",!1,"large","huge"];class km extends uh{constructor(t,n){super(t,n);const s=o=>{if(!document.body.contains(t.root)){document.body.removeEventListener("click",s);return}this.tooltip!=null&&!this.tooltip.root.contains(o.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(a=>{a.container.contains(o.target)||a.close()})};t.emitter.listenDOM("click",document.body,s)}addModule(t){const n=super.addModule(t);return t==="toolbar"&&this.extendToolbar(n),n}buildButtons(t,n){Array.from(t).forEach(s=>{(s.getAttribute("class")||"").split(/\s+/).forEach(a=>{if(a.startsWith("ql-")&&(a=a.slice(3),n[a]!=null))if(a==="direction")s.innerHTML=n[a][""]+n[a].rtl;else if(typeof n[a]=="string")s.innerHTML=n[a];else{const l=s.value||"";l!=null&&n[a][l]&&(s.innerHTML=n[a][l])}})})}buildPickers(t,n){this.pickers=Array.from(t).map(o=>{if(o.classList.contains("ql-align")&&(o.querySelector("option")==null&&vp(o,Wbe),typeof n.align=="object"))return new SL(o,n.align);if(o.classList.contains("ql-background")||o.classList.contains("ql-color")){const a=o.classList.contains("ql-background")?"background":"color";return o.querySelector("option")==null&&vp(o,Ube,a==="background"?"#ffffff":"#000000"),new vL(o,n[a])}return o.querySelector("option")==null&&(o.classList.contains("ql-font")?vp(o,qbe):o.classList.contains("ql-header")?vp(o,Vbe):o.classList.contains("ql-size")&&vp(o,Gbe)),new Ey(o)});const s=()=>{this.pickers.forEach(o=>{o.update()})};this.quill.on($t.events.EDITOR_CHANGE,s)}}km.DEFAULTS=kc({},uh.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let e=this.container.querySelector("input.ql-image[type=file]");e==null&&(e=document.createElement("input"),e.setAttribute("type","file"),e.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),e.classList.add("ql-image"),e.addEventListener("change",()=>{const t=this.quill.getSelection(!0);this.quill.uploader.upload(t,e.files),e.value=""}),this.container.appendChild(e)),e.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class CL extends jL{constructor(t,n){super(t,n),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",t=>{t.key==="Enter"?(this.save(),t.preventDefault()):t.key==="Escape"&&(this.cancel(),t.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;n!=null?this.textbox.value=n:t!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const s=this.quill.getBounds(this.quill.selection.savedRange);s!=null&&this.position(s),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${t}`)||""),this.root.setAttribute("data-mode",t)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:t}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:n}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,$t.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,$t.sources.USER)),this.quill.root.scrollTop=n;break}case"video":t=Ybe(t);case"formula":{if(!t)break;const n=this.quill.getSelection(!0);if(n!=null){const s=n.index+n.length;this.quill.insertEmbed(s,this.root.getAttribute("data-mode"),t,$t.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(s+1," ",$t.sources.USER),this.quill.setSelection(s+2,$t.sources.USER)}break}}this.textbox.value="",this.hide()}}function Ybe(e){let t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return t?`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`:(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`:e}function vp(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t.forEach(s=>{const o=document.createElement("option");s===n?o.setAttribute("selected","selected"):o.setAttribute("value",String(s)),e.appendChild(o)})}const Kbe=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Xbe extends CL{static TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join("");constructor(t,n){super(t,n),this.quill.on($t.events.EDITOR_CHANGE,(s,o,a,l)=>{if(s===$t.events.SELECTION_CHANGE)if(o!=null&&o.length>0&&l===$t.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const u=this.quill.getLines(o.index,o.length);if(u.length===1){const d=this.quill.getBounds(o);d!=null&&this.position(d)}else{const d=u[u.length-1],f=this.quill.getIndex(d),p=Math.min(d.length()-1,o.index+o.length-f),g=this.quill.getBounds(new Wu(f,p));g!=null&&this.position(g)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on($t.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const t=this.quill.getSelection();if(t!=null){const n=this.quill.getBounds(t);n!=null&&this.position(n)}},1)})}cancel(){this.show()}position(t){const n=super.position(t),s=this.root.querySelector(".ql-tooltip-arrow");return s.style.marginLeft="",n!==0&&(s.style.marginLeft=`${-1*n-s.offsetWidth/2}px`),n}}class wL extends km{constructor(t,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=Kbe),super(t,n),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new Xbe(this.quill,this.options.bounds),t.container!=null&&(this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),zg),this.buildPickers(t.container.querySelectorAll("select"),zg))}}wL.DEFAULTS=kc({},km.DEFAULTS,{modules:{toolbar:{handlers:{link(e){e?this.quill.theme.tooltip.edit():this.quill.format("link",!1,nt.sources.USER)}}}}});const Zbe=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Qbe extends CL{static TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",t=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),t.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",t=>{if(this.linkRange!=null){const n=this.linkRange;this.restoreFocus(),this.quill.formatText(n,"link",!1,$t.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()}),this.quill.on($t.events.SELECTION_CHANGE,(t,n,s)=>{if(t!=null){if(t.length===0&&s===$t.sources.USER){const[o,a]=this.quill.scroll.descendant(B1,t.index);if(o!=null){this.linkRange=new Wu(t.index-a,o.length());const l=B1.formats(o.domNode);this.preview.textContent=l,this.preview.setAttribute("href",l),this.show();const u=this.quill.getBounds(this.linkRange);u!=null&&this.position(u);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}class AL extends km{constructor(t,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=Zbe),super(t,n),this.quill.container.classList.add("ql-snow")}extendToolbar(t){t.container!=null&&(t.container.classList.add("ql-snow"),this.buildButtons(t.container.querySelectorAll("button"),zg),this.buildPickers(t.container.querySelectorAll("select"),zg),this.tooltip=new Qbe(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(n,s)=>{t.handlers.link.call(t,!s.format.link)}))}}AL.DEFAULTS=kc({},km.DEFAULTS,{modules:{toolbar:{handlers:{link(e){if(e){const t=this.quill.getSelection();if(t==null||t.length===0)return;let n=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(n)&&n.indexOf("mailto:")!==0&&(n=`mailto:${n}`);const{tooltip:s}=this.quill.theme;s.edit("link",n)}else this.quill.format("link",!1,nt.sources.USER)}}}}});nt.register({"attributors/attribute/direction":lL,"attributors/class/align":oL,"attributors/class/background":r1e,"attributors/class/color":n1e,"attributors/class/direction":cL,"attributors/class/font":fL,"attributors/class/size":pL,"attributors/style/align":iL,"attributors/style/background":Nw,"attributors/style/color":Bw,"attributors/style/direction":uL,"attributors/style/font":hL,"attributors/style/size":gL},!0);nt.register({"formats/align":oL,"formats/direction":cL,"formats/indent":K1e,"formats/background":Nw,"formats/color":Bw,"formats/font":fL,"formats/size":pL,"formats/blockquote":X1e,"formats/code-block":eo,"formats/header":Z1e,"formats/list":Tm,"formats/bold":qw,"formats/code":$w,"formats/italic":Q1e,"formats/link":B1,"formats/script":J1e,"formats/strike":ebe,"formats/underline":tbe,"formats/formula":nbe,"formats/image":rbe,"formats/video":sbe,"modules/syntax":yL,"modules/table":ibe,"modules/toolbar":Gw,"themes/bubble":wL,"themes/snow":AL,"ui/icons":zg,"ui/picker":Ey,"ui/icon-picker":SL,"ui/color-picker":vL,"ui/tooltip":jL},!0);var Ty=class extends Er.Component{constructor(e){super(e),this.editingAreaRef=v.createRef(),this.containerRef=v.createRef(),this.dirtyProps=["modules","formats","bounds","theme","children"],this.cleanProps=["id","className","style","placeholder","tabIndex","onChange","onChangeSelection","onFocus","onBlur","onKeyPress","onKeyDown","onKeyUp","useSemanticHTML"],this.state={generation:0},this.selection=null,this.onEditorChange=(n,s,o,a)=>{n==="text-change"?this.onEditorChangeText?.(this.props.useSemanticHTML!==!1?this.editor.getSemanticHTML():this.editor.root.innerHTML,s,a,this.unprivilegedEditor):n==="selection-change"&&this.onEditorChangeSelection?.(s,a,this.unprivilegedEditor)};const t=this.isControlled()?e.value:e.defaultValue;this.value=t??""}validateProps(e){if(Er.Children.count(e.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(Er.Children.count(e.children)&&Er.Children.only(e.children)?.type==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.");if(this.lastDeltaChangeSet&&e.value===this.lastDeltaChangeSet)throw new Error("You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas")}shouldComponentUpdate(e,t){if(this.validateProps(e),!this.editor||this.state.generation!==t.generation)return!0;if("value"in e){const n=this.getEditorContents(),s=e.value??"";this.isEqualValue(s,n)||this.setEditorContents(this.editor,s)}return e.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,e.readOnly),[...this.cleanProps,...this.dirtyProps].some(n=>!Sc(e[n],this.props[n]))}shouldComponentRegenerate(e){return this.dirtyProps.some(t=>!Sc(e[t],this.props[t]))}componentDidMount(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())}componentWillUnmount(){this.destroyEditor()}componentDidUpdate(e,t){if(this.editor&&this.shouldComponentRegenerate(e)){const n=this.editor.getContents(),s=this.editor.getSelection();this.regenerationSnapshot={delta:n,selection:s},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.editor&&e.placeholder!==this.props.placeholder&&(this.editor.root.dataset.placeholder=this.props.placeholder||""),this.state.generation!==t.generation){const{delta:n,selection:s}=this.regenerationSnapshot;delete this.regenerationSnapshot,this.instantiateEditor();const o=this.editor;o.setContents(n),mM(()=>this.setEditorSelection(o,s))}}instantiateEditor(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())}destroyEditor(){if(!this.editor)return;this.unhookEditor(this.editor);const e=this.props.modules?.toolbar;if(!(typeof e=="object"&&e&&"container"in e&&typeof e.container=="string"||typeof e=="string")){const n=this.containerRef.current?.querySelector(".ql-toolbar");n&&n.remove()}delete this.editor}isControlled(){return"value"in this.props}getEditorConfig(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,tabIndex:this.props.tabIndex,theme:this.props.theme}}getEditor(){if(!this.editor)throw new Error("Accessing non-instantiated editor");return this.editor}createEditor(e,t){const n=new nt(e,t);return t.tabIndex!=null&&this.setEditorTabIndex(n,t.tabIndex),this.hookEditor(n),n}hookEditor(e){this.unprivilegedEditor=this.makeUnprivilegedEditor(e),e.on("editor-change",this.onEditorChange)}unhookEditor(e){e.off("editor-change",this.onEditorChange)}getEditorContents(){return this.value}getEditorSelection(){return this.selection}isDelta(e){return e&&e.ops}isEqualValue(e,t){return this.isDelta(e)&&this.isDelta(t)?Sc(e.ops,t.ops):Sc(e,t)}setEditorContents(e,t){this.value=t;const n=this.getEditorSelection();typeof t=="string"?e.setContents(e.clipboard.convert({html:t})):e.setContents(t),mM(()=>this.setEditorSelection(e,n))}setEditorSelection(e,t){if(this.selection=t,t){const n=e.getLength();t.index=Math.max(0,Math.min(t.index,n-1)),t.length=Math.max(0,Math.min(t.length,n-1-t.index)),e.setSelection(t)}}setEditorTabIndex(e,t){e?.scroll?.domNode&&(e.scroll.domNode.tabIndex=t)}setEditorReadOnly(e,t){t?e.disable():e.enable()}makeUnprivilegedEditor(e){const t=e;return{getHTML:()=>t.root.innerHTML,getSemanticHTML:t.getSemanticHTML.bind(t),getLength:t.getLength.bind(t),getText:t.getText.bind(t),getContents:t.getContents.bind(t),getSelection:t.getSelection.bind(t),getBounds:t.getBounds.bind(t)}}getEditingArea(){const e=this.editingAreaRef.current;if(!e)throw new Error("Cannot find element for editing area");if(e.nodeType===3)throw new Error("Editing area cannot be a text node");return e}renderEditingArea(){const{children:e,preserveWhitespace:t}=this.props,{generation:n}=this.state;return Er.Children.count(e)?Er.cloneElement(Er.Children.only(e),{key:n,ref:this.editingAreaRef}):t?r.jsx("pre",{ref:this.editingAreaRef},n):r.jsx("div",{ref:this.editingAreaRef},n)}render(){return r.jsx("div",{ref:this.containerRef,id:this.props.id,style:this.props.style,className:`quill ${this.props.className??""}`,onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp,children:this.renderEditingArea()},this.state.generation)}onEditorChangeText(e,t,n,s){if(!this.editor)return;const o=this.isDelta(this.value)?s.getContents():this.props.useSemanticHTML!==!1?s.getSemanticHTML():s.getHTML();o!==this.getEditorContents()&&(this.lastDeltaChangeSet=t,this.value=o,this.props.onChange?.(e,t,n,s))}onEditorChangeSelection(e,t,n){if(!this.editor)return;const s=this.getEditorSelection(),o=!s&&e,a=s&&!e;Sc(e,s)||(this.selection=e,this.props.onChangeSelection?.(e,t,n),o?this.props.onFocus?.(e,t,n):a&&this.props.onBlur?.(s,t,n))}focus(){this.editor&&this.editor.focus()}blur(){this.editor&&(this.selection=null,this.editor.blur())}};Ty.displayName="React Quill";Ty.Quill=nt;Ty.defaultProps={theme:"snow",modules:{},readOnly:!1};function mM(e){Promise.resolve().then(e)}var eh=Ty;const Jbe="/api",eye=()=>{const e=localStorage.getItem("user");return e?JSON.parse(e).token:null},yl={getKyc:()=>ke.get("/kyc/me"),updateKyc:e=>ke.put("/kyc/me",e),deleteDocument:e=>ke.delete(`/kyc/documents/${e}`),submitKyc:()=>ke.post("/kyc/submit"),uploadDocument:async(e,t)=>{const n=new FormData;n.append("file",e),n.append("type",t);const s=eye(),o=await fetch(`${Jbe}/kyc/documents`,{method:"POST",headers:{Authorization:s?`Bearer ${s}`:"",Accept:"application/json"},body:n});if(!o.ok){const a=await o.json().catch(()=>({})),l=new Error(a.message||"Failed to upload document");throw l.status=o.status,l.data=a,l}return o.json()}},tye="/api",nye=()=>{const e=localStorage.getItem("user");return e?JSON.parse(e).token:null},gi=e=>e?e.data?e.data:e:null,rye=e=>e?{data:e.data||[],meta:e.meta||{},links:e.links||{}}:{data:[],meta:{},links:{}},sye=e=>e?e.data||e.id?gi(e):{success:!0}:{success:!0},xM=async(e,t,n)=>{const s=nye(),o={Accept:"application/json"};s&&(o.Authorization=`Bearer ${s}`);const a=await fetch(`${tye}${e}`,{method:t,headers:o,body:n});if(!a.ok){let l="An error occurred";try{const d=await a.json();l=d.message||l,a.status===422&&d.message&&(l=d.message)}catch{l=a.statusText}const u=new Error(l);throw u.status=a.status,u}return a.status===204?null:a.json()},vs={listCourses:async({page:e,per_page:t=20,q:n,status:s,level:o,language:a,with_categories:l=1,with_audit:u=1}={})=>{const d=new URLSearchParams;e&&d.append("page",e),t&&d.append("per_page",t),n&&d.append("q",n),s&&d.append("status",s),o&&d.append("level",o),a&&d.append("language",a),l&&d.append("with_categories",l),u&&d.append("with_audit",u);const f=await ke.get(`/lms/courses?${d.toString()}`);return rye(f)},createCourseJson:async e=>{const t=await ke.post("/lms/courses",e);return gi(t)},createCourseMultipart:async e=>{const t=await xM("/lms/courses","POST",e);return sye(t)},getCourseDetail:async e=>{const t=await ke.get(`/lms/courses/${e}`);return gi(t)},getCourseById:async(e,{with_categories:t=1,with_audit:n=1}={})=>{const s=new URLSearchParams;t&&s.append("with_categories",t),n&&s.append("with_audit",n);const o=await ke.get(`/lms/courses/${e}?${s.toString()}`);return gi(o)},updateCourseJson:async(e,t)=>{const n=await ke.put(`/lms/courses/${e}`,t);return gi(n)},updateCourseMultipart:async(e,t)=>{const n=await xM(`/lms/courses/${e}`,"PATCH",t);return gi(n)},publishCourse:async e=>{const t=await ke.post(`/lms/courses/${e}/publish`);return gi(t)},unpublishCourse:async e=>{try{const t=await ke.post(`/lms/courses/${e}/unpublish`);return gi(t)}catch(t){throw t}},archiveCourse:async e=>{const t=await ke.post(`/lms/courses/${e}/archive`);return gi(t)},rejectCourse:async(e,t)=>{const n=await ke.post(`/lms/courses/${e}/reject`,{reason:t});return gi(n)},deleteCourseMedia:async(e,t)=>{const n=await ke.delete(`/lms/courses/${e}/media/${t}`);return gi(n)},deleteCourse:async e=>({success:!0,...await ke.delete(`/lms/courses/${e}`)}),requestPriceChange:async(e,t)=>{const n=await ke.post(`/lms/courses/${e}/certificate-price-change`,t);return gi(n)},listPriceChanges:async({status:e="pending",page:t,per_page:n=20,with_course:s=1}={})=>{const o=new URLSearchParams;return e&&o.append("status",e),t&&o.append("page",t),n&&o.append("per_page",n),s&&o.append("with_course",s),await ke.get(`/lms/certificate-price-changes?${o.toString()}`)}},pf=e=>e?e.data?e.data:e:null,oye=e=>e?{data:e.data||[],meta:e.meta||{},links:e.links||{}}:{data:[],meta:{},links:{}},iye=e=>e?e.data||e.id?pf(e):{success:!0}:{success:!0},jf={listModules:async e=>{const t=await ke.get(`/lms/courses/${e}/modules`);return oye(t)},createModule:async(e,t)=>{const n=await ke.post(`/lms/courses/${e}/modules`,t);return pf(n)},getModuleById:async e=>{const t=await ke.get(`/lms/modules/${e}`);return pf(t)},updateModule:async(e,t)=>{const n=await ke.put(`/lms/modules/${e}`,t);return pf(n)},deleteModule:async e=>({success:!0,...await ke.delete(`/lms/modules/${e}`)}),reorderModules:async(e,t)=>{const n=await ke.post(`/lms/courses/${e}/modules/reorder`,{order:t});return iye(n)},publishModule:async(e,t)=>{const n=await ke.post(`/lms/courses/${e}/modules/${t}/publish`);return pf(n)},unpublishModule:async(e,t)=>{const n=await ke.post(`/lms/courses/${e}/modules/${t}/unpublish`);return pf(n)}},aye="/api",lye=()=>{const e=localStorage.getItem("user");return e?JSON.parse(e).token:null},bu=e=>e?e.data?e.data:e:null,bM=e=>{if(!e)return{data:[],meta:{},links:{}};if(Array.isArray(e))return{data:e,meta:{},links:{}};const t=e.data??e;return Array.isArray(t)?{data:t,meta:{},links:{}}:{data:t.data??t.results??[],meta:t.meta??{},links:t.links??{}}},yM=e=>e?e.data||e.id?bu(e):{success:!0}:{success:!0},vM=async(e,t,n)=>{const s=lye(),o={Accept:"application/json"};s&&(o.Authorization=`Bearer ${s}`);const a=await fetch(`${aye}${e}`,{method:t,headers:o,body:n});if(!a.ok){let l="An error occurred";try{l=(await a.json()).message||l}catch{l=a.statusText}const u=new Error(l);throw u.status=a.status,u}return a.status===204?null:a.json()},ra={listLessons:async e=>{const t=await ke.get(`/lms/modules/${e}/lessons`);return bM(t)},createLesson:async(e,t)=>{const n=await ke.post(`/lms/modules/${e}/lessons`,t);return bu(n)},createLessonMultipart:async(e,t)=>{const n=await vM(`/lms/modules/${e}/lessons`,"POST",t);return bu(n)},getLessonById:async e=>{const t=await ke.get(`/lms/lessons/${e}`);return bu(t)},updateLesson:async(e,t)=>{const n=await ke.put(`/lms/lessons/${e}`,t);return bu(n)},deleteLesson:async e=>({success:!0,...await ke.delete(`/lms/lessons/${e}`)}),listLessonMedia:async e=>{const t=await ke.get(`/lms/lessons/${e}/media`);return bM(t)},uploadLessonMedia:async(e,t)=>{const n=await vM(`/lms/lessons/${e}/media`,"POST",t);return yM(n)},deleteLessonMedia:async e=>({success:!0,...await ke.delete(`/lms/lessons/media/${e}`)}),reorderLessons:async(e,t)=>{const n=await ke.post(`/lms/modules/${e}/lessons/reorder`,{order:t});return yM(n)},publishLesson:async(e,t)=>{const n=await ke.post(`/lms/modules/${e}/lessons/${t}/publish`);return bu(n)},unpublishLesson:async(e,t)=>{const n=await ke.post(`/lms/modules/${e}/lessons/${t}/unpublish`);return bu(n)}},V0=e=>e?e.data?e.data:e:null,cye=e=>{if(!e)return{data:[],meta:{},links:{}};const t=e.data??e;return Array.isArray(t)?{data:t,meta:{},links:{}}:{data:t.data??t.results??[],meta:t.meta??{},links:t.links??{}}},uye=e=>e?e.data||e.id?V0(e):{success:!0}:{success:!0},Sp={listQuestions:async e=>{const t=await ke.get(`/lms/lessons/${e}/questions`);return cye(t)},createQuestion:async(e,t)=>{const n=String(t.prompt??t.question??"").trim(),s=t.correct_answer??t.correctAnswer??t.answer??null,o=s==null?[]:Array.isArray(s)?s:[s],a={prompt:n,type:t.type??"multiple_choice",options:t.options??[],correct_answer:o,explanation:t.explanation??null,points:t.points??1,position:t.position??null},l=await ke.post(`/lms/lessons/${e}/questions`,a);return V0(l)},getQuestionById:async e=>{const t=await ke.get(`/lms/questions/${e}`);return V0(t)},updateQuestion:async(e,t)=>{const n=await ke.put(`/lms/questions/${e}`,t);return V0(n)},deleteQuestion:async e=>({success:!0,...await ke.delete(`/lms/questions/${e}`)}),reorderQuestions:async(e,t)=>{const n=await ke.post(`/lms/lessons/${e}/questions/reorder`,{items:t});return uye(n)}},jp=[{label:"Step 1",sublabel:"Basic Details",icon:Qg},{label:"Step 2",sublabel:"Curriculum",icon:uz},{label:"Step 3",sublabel:"Media",icon:hz},{label:"Step 4",sublabel:"Review",icon:bz}],dye=["beginner","intermediate","advanced"],fye=["draft","published","archived"],Z5=e=>e?.name||e?.user?.name||e?.email||e?.id||"Unknown tutor",hye=()=>{const e=Dn(),t=Nr(),n=new URLSearchParams(t.search).get("edit")||null,s=!!n,[o,a]=v.useState(0),[l,u]=v.useState(null),[d,f]=v.useState(!1),[p,g]=v.useState({}),[x,b]=v.useState(s),[y,S]=v.useState(!1),[j,A]=v.useState({open:!1,message:"",severity:"success"}),[M,R]=v.useState([]),[_,z]=v.useState([]),[F,N]=v.useState({title:"",summary:"",description:"",level:"beginner",language:"en",duration_minutes:0,thumbnail_url:"",status:"published",category_id:"",tutor_ids:[]}),[I,B]=v.useState(null),[H,P]=v.useState([]),[k,L]=v.useState(null),[O,W]=v.useState(!1),[D,q]=v.useState({title:"",description:""}),[K,Y]=v.useState(null),[ie,V]=v.useState(!1),[re,fe]=v.useState(null),[ae,ue]=v.useState(null),[se,J]=v.useState({title:"",type:"video",content:"",duration:0});v.useEffect(()=>{const Z=setTimeout(()=>{F.title&&u(new Date)},2e3);return()=>clearTimeout(Z)},[F]),v.useEffect(()=>{(async()=>{try{const pe=await vc.getAllCategories();R(Array.isArray(pe)?pe:[])}catch(pe){console.error("Failed to load categories:",pe),R([])}try{const pe=await ns.listTutors({per_page:100});z(pe.data||[])}catch(pe){console.error("Failed to load tutors:",pe),z([])}})()},[]),v.useEffect(()=>{if(!s)return;(async()=>{b(!0);try{const pe=await ns.getEssentialCourseById(n,{with_categories:1,with_tutors:1,with_audit:1}),Q=pe?.data??pe,me=Array.isArray(Q?.tutors)?Q.tutors.map(we=>String(we?.id||"")).filter(Boolean):Array.isArray(Q?.tutor_ids)?Q.tutor_ids.map(String):[];N({title:Q.title||"",summary:Q.summary||"",description:Q.description||"",level:Q.level||"beginner",language:Q.language||"en",duration_minutes:Q.duration_minutes||0,thumbnail_url:Q.thumbnail_url||"",status:Q.status||"published",category_id:Q.categories?.[0]?.id||Q.category_id||"",tutor_ids:me})}catch(pe){console.error("Error loading course for editing:",pe),A({open:!0,message:"Failed to load course data.",severity:"error"})}finally{b(!1)}})()},[n,s]);const ce=(Z,pe)=>{N(Q=>({...Q,[Z]:pe})),p[Z]&&g(Q=>({...Q,[Z]:null}))},oe=Z=>{const pe={};return Z===0&&(F.title||(pe.title="Course title is required"),F.category_id||(pe.category_id="Category is required"),F.summary||(pe.summary="Summary is required"),!s&&(!F.tutor_ids||F.tutor_ids.length===0)&&(pe.tutor_ids="At least one tutor is required")),Z===3&&(H.length===0&&(pe.modules="At least one module is required"),H.some(me=>me.lessons&&me.lessons.length>0)||(pe.lessons="At least one lesson is required")),g(pe),Object.keys(pe).length===0},ge=()=>{oe(o)&&a(Z=>Z+1)},de=()=>a(Z=>Z-1),le=()=>{if(D.title){const Z={id:Date.now(),...D,order:H.length,lessons:[]};P([...H,Z]),q({title:"",description:""}),W(!1)}},ee=Z=>{L(Z),q({title:Z.title,description:Z.description}),W(!0)},X=()=>{P(H.map(Z=>Z.id===k.id?{...Z,...D}:Z)),L(null),q({title:"",description:""}),W(!1)},ve=Z=>{const pe=H.find(Q=>Q.id===Z);pe&&(!pe.lessons||pe.lessons.length===0)&&P(H.filter(Q=>Q.id!==Z))},st={title:"",type:"video",content:"",videoUrl:"",videoFile:null,fileName:"",durationHours:0,durationMinutes:0,duration:0},Ge=Z=>{ue(Z),J({...st}),fe(null),V(!0)},qe=()=>{const Z=String(se.title||"").trim();if(!Z){A({open:!0,message:"Lesson title is required",severity:"error"});return}if(!String(se.content||"").replace(/<(.|\n)*?>/g,"").trim()){A({open:!0,message:"Please provide lesson content",severity:"error"});return}const Q=String(se.videoUrl||"").trim();if(Q&&!/^https?:\/\//.test(Q)){A({open:!0,message:"Video URL must start with http:// or https://",severity:"error"});return}const me=(parseInt(se.durationHours)||0)*60+(parseInt(se.durationMinutes)||0),we={...se,title:Z,type:"video",videoUrl:Q,duration:me};P(H.map(et=>et.id===ae?re?{...et,lessons:et.lessons.map(ht=>ht.id===re.id?{...ht,...we}:ht)}:{...et,lessons:[...et.lessons||[],{id:Date.now(),...we}]}:et)),V(!1),J({...st})},Be=(Z,pe)=>{ue(Z),fe(pe);const Q=parseInt(pe.duration)||0;J({title:pe.title||"",type:"video",content:pe.content||"",videoUrl:pe.videoUrl||"",videoFile:pe.videoFile||null,fileName:pe.fileName||"",durationHours:Math.floor(Q/60),durationMinutes:Q%60,duration:Q}),V(!0)},Te=(Z,pe)=>{P(H.map(Q=>Q.id===Z?{...Q,lessons:Q.lessons.filter(me=>me.id!==pe)}:Q))},Re=async(Z=!0)=>{if(!(!Z&&!oe(3))){S(!0),f(!1);try{const pe={title:F.title.trim(),summary:F.summary.trim(),description:F.description||"",level:F.level,language:F.language,duration_minutes:Number(F.duration_minutes||0),status:Z?"draft":F.status||"published",category_ids:F.category_id?[String(F.category_id)]:[],tutor_ids:(F.tutor_ids||[]).map(String)};s&&pe.tutor_ids.length===0&&delete pe.tutor_ids,s&&pe.category_ids.length===0&&delete pe.category_ids;let Q;s?I?Q=await ns.updateEssentialCourseMultipart(n,{...pe,thumbnail:I}):Q=await ns.updateEssentialCourseJson(n,pe):I?Q=await ns.createEssentialCourseMultipart({...pe,thumbnail:I}):Q=await ns.createEssentialCourseJson(pe);const me=Q?.id||Q?.data?.id||n;if(!s&&!me)throw new Error("Course was created but no ID was returned");if(!s&&me)for(let we=0;we<H.length;we++){const et=H[we],ht=await jf.createModule(me,{title:et.title,summary:et.description||""}),ct=ht?.id||ht?.data?.id;if(ct)for(let bt=0;bt<(et.lessons||[]).length;bt++){const wt=et.lessons[bt],gn=wt.duration_minutes||wt.duration||0,mn=/^https?:\/\//.test(String(wt.videoUrl||"").trim());if(wt.videoFile){const ut=new FormData;ut.append("title",wt.title),ut.append("type","video"),ut.append("video_file",wt.videoFile),ut.append("content",wt.content||""),gn&&ut.append("duration_minutes",String(gn)),await ra.createLessonMultipart(ct,ut)}else{const ut={title:wt.title,type:"video",content:wt.content||""};gn&&(ut.duration_minutes=gn),mn&&(ut.video_url=String(wt.videoUrl).trim()),await ra.createLesson(ct,ut)}}}A({open:!0,message:s?"Essential course updated successfully!":Z?"Essential course saved as draft successfully!":"Essential course published successfully!",severity:"success"}),setTimeout(()=>e("/admin/content/essential-courses"),1500)}catch(pe){console.error("Error saving essential course:",pe),A({open:!0,message:pe.message||`Failed to ${s?"update":"create"} course. Please try again.`,severity:"error"})}finally{S(!1)}}},Se=Z=>{switch(Z){case"video":return r.jsx(jo,{sx:{fontSize:18}});case"text":case"reading":return r.jsx(Hf,{sx:{fontSize:18}});case"document":case"file":return r.jsx(Ab,{sx:{fontSize:18}});default:return null}},Ke=()=>r.jsxs(E,{sx:{display:"flex",gap:4,flexWrap:"wrap"},children:[r.jsx(E,{sx:{flex:{xs:"1 1 100%",md:"1 1 55%"},minWidth:0},children:r.jsxs(G,{spacing:3,children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Course Title"}),r.jsx(it,{fullWidth:!0,placeholder:"e.g. Essential Governance Foundations",value:F.title,onChange:Z=>ce("title",Z.target.value),error:!!p.title,helperText:p.title||"Use a clear, catchy title (Max 80 chars)",sx:xt,FormHelperTextProps:{sx:{color:p.title?"#EF4444":"#6B7280"}}})]}),r.jsxs(E,{sx:{display:"flex",gap:2,flexWrap:"wrap"},children:[r.jsxs(E,{sx:{flex:"1 1 45%",minWidth:200},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Category"}),r.jsxs(Fn,{fullWidth:!0,value:F.category_id,onChange:Z=>ce("category_id",Z.target.value),displayEmpty:!0,sx:Yn,error:!!p.category_id,MenuProps:Tr,children:[r.jsx(It,{value:"",disabled:!0,children:"Select category"}),M.map(Z=>r.jsx(It,{value:Z.id,children:Z.name},Z.id))]})]}),r.jsxs(E,{sx:{flex:"1 1 45%",minWidth:200},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Course Level"}),r.jsx(Fn,{fullWidth:!0,value:F.level,onChange:Z=>ce("level",Z.target.value),sx:Yn,MenuProps:Tr,children:dye.map(Z=>r.jsx(It,{value:Z,sx:{textTransform:"capitalize"},children:Z},Z))})]})]}),r.jsxs(E,{sx:{display:"flex",gap:2,flexWrap:"wrap"},children:[r.jsxs(E,{sx:{flex:"1 1 45%",minWidth:200},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Language"}),r.jsx(it,{fullWidth:!0,value:F.language,onChange:Z=>ce("language",Z.target.value),sx:xt})]}),r.jsxs(E,{sx:{flex:"1 1 45%",minWidth:200},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Status"}),r.jsx(Fn,{fullWidth:!0,value:F.status,onChange:Z=>ce("status",Z.target.value),sx:Yn,MenuProps:Tr,children:fye.map(Z=>r.jsx(It,{value:Z,sx:{textTransform:"capitalize"},children:Z},Z))})]})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Assign Tutors"}),r.jsxs(Ur,{fullWidth:!0,error:!!p.tutor_ids,children:[r.jsx(Fn,{multiple:!0,displayEmpty:!0,value:F.tutor_ids,onChange:Z=>{const pe=Z.target.value;ce("tutor_ids",typeof pe=="string"?pe.split(","):pe)},input:r.jsx(jb,{}),renderValue:Z=>!Z||Z.length===0?r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.875rem"},children:"Select tutors"}):r.jsx(G,{direction:"row",spacing:.75,flexWrap:"wrap",useFlexGap:!0,children:Z.map(pe=>{const Q=_.find(me=>String(me.id)===String(pe));return r.jsx(Pt,{size:"small",label:Z5(Q)||pe,sx:{bgcolor:"rgba(255,255,255,0.08)",color:"#E5E7EB"}},pe)})}),sx:Yn,MenuProps:Tr,children:_.length===0?r.jsx(It,{disabled:!0,value:"",children:"No tutors available"}):_.map(Z=>r.jsx(It,{value:String(Z.id),children:Z5(Z)},Z.id))}),p.tutor_ids&&r.jsx(C,{sx:{color:"#EF4444",fontSize:"0.75rem",mt:.5},children:p.tutor_ids})]})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Short Summary"}),r.jsx(it,{fullWidth:!0,multiline:!0,rows:2,placeholder:"Brief overview of what students will learn...",value:F.summary,onChange:Z=>ce("summary",Z.target.value),error:!!p.summary,helperText:p.summary,sx:xt,FormHelperTextProps:{sx:{color:"#EF4444"}}})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Description"}),r.jsx(E,{sx:{"& .quill":{display:"flex",flexDirection:"column"},"& .ql-toolbar":{bgcolor:"#1E293B",borderColor:"#374151",borderRadius:"6px 6px 0 0","& .ql-stroke":{stroke:"#9CA3AF"},"& .ql-fill":{fill:"#9CA3AF"},"& .ql-picker":{color:"#9CA3AF"},"& .ql-picker-options":{bgcolor:"#1E293B",border:"1px solid #374151"},"& .ql-picker-item:hover":{color:"#fff"},"& button:hover .ql-stroke":{stroke:"#fff"},"& button:hover .ql-fill":{fill:"#fff"},"& button.ql-active .ql-stroke":{stroke:"#1152D4"},"& button.ql-active .ql-fill":{fill:"#1152D4"}},"& .ql-container":{bgcolor:"#0F172A",borderColor:"#374151",borderRadius:"0 0 6px 6px",minHeight:150,fontSize:"0.95rem"},"& .ql-editor":{color:"#fff",minHeight:150,"&.ql-blank::before":{color:"#6B7280",fontStyle:"normal"}}},children:r.jsx(eh,{theme:"snow",value:F.description,onChange:Z=>ce("description",Z),placeholder:"Describe what students will learn in this course...",modules:{toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline","strike"],[{list:"ordered"},{list:"bullet"}],["link"],["clean"]]}})})]})]})}),r.jsx(E,{sx:{flex:{xs:"1 1 100%",md:"1 1 35%"},minWidth:0},children:r.jsxs(G,{spacing:3,children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Course Thumbnail"}),r.jsx("input",{type:"file",accept:"image/*",style:{display:"none"},id:"thumbnail-upload",onChange:Z=>{const pe=Z.target.files[0];if(pe){B(pe);const Q=new FileReader;Q.onloadend=()=>ce("thumbnail_url",Q.result),Q.readAsDataURL(pe)}}}),r.jsx("label",{htmlFor:"thumbnail-upload",children:r.jsx(E,{sx:{bgcolor:"#1E293B",border:F.thumbnail_url?"2px solid #1152D4":"2px dashed #374151",borderRadius:2,p:F.thumbnail_url?0:4,textAlign:"center",cursor:"pointer",transition:"border-color 0.2s","&:hover":{borderColor:"#1152D4"},overflow:"hidden",minHeight:150,display:"flex",alignItems:"center",justifyContent:"center"},children:F.thumbnail_url?r.jsx(E,{component:"img",src:F.thumbnail_url,alt:"Thumbnail preview",sx:{width:"100%",height:"auto",maxHeight:200,objectFit:"cover"}}):r.jsxs(E,{children:[r.jsx(Bu,{sx:{fontSize:40,color:"#6B7280",mb:1}}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:.5},children:"Click to upload"}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"or drag and drop"}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.7rem",mt:1},children:"SVG, PNG, JPG (max. 800x400px)"})]})})}),F.thumbnail_url&&r.jsx(ye,{size:"small",onClick:()=>{ce("thumbnail_url",""),B(null)},sx:{mt:1,color:"#EF4444",fontSize:"0.75rem"},children:"Remove Image"})]}),r.jsxs(Je,{sx:{bgcolor:"#1A2230",border:"1px solid #374151",borderRadius:2,p:2.5},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1.5},children:[r.jsx(kb,{sx:{color:"#1152D4",fontSize:18}}),r.jsx(C,{sx:{color:"#1152D4",fontWeight:600,fontSize:"0.85rem"},children:"Admin Tips"})]}),r.jsxs(G,{spacing:1,children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.8rem"},children:"• Essential courses are mandatory for every learner"}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.8rem"},children:"• Assign qualified tutors to maintain content authority"}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.8rem"},children:"• Use high-quality thumbnails for better engagement"})]})]})]})})]}),ot=()=>r.jsxs(E,{children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:3},children:[r.jsxs(C,{sx:{color:"#fff",fontWeight:600},children:["Course Modules (",H.length,")"]}),r.jsx(ye,{variant:"contained",startIcon:r.jsx(Br,{}),onClick:()=>{L(null),q({title:"",description:""}),W(!0)},sx:{bgcolor:"#1152D4","&:hover":{bgcolor:"#0D42AF"}},children:"Add Module"})]}),p.modules&&r.jsx(Wt,{severity:"error",sx:{mb:2,bgcolor:"rgba(239, 68, 68, 0.1)",color:"#EF4444"},children:p.modules}),H.length===0?r.jsxs(Je,{sx:{p:6,bgcolor:"#1A2230",borderRadius:2,border:"1px dashed #374151",textAlign:"center"},children:[r.jsx(C,{sx:{color:"#6B7280",mb:2},children:"No modules added yet"}),r.jsx(ye,{variant:"outlined",startIcon:r.jsx(Br,{}),onClick:()=>W(!0),sx:{color:"#1152D4",borderColor:"#1152D4"},children:"Create First Module"})]}):r.jsx(G,{spacing:2,children:H.map((Z,pe)=>r.jsxs(Je,{sx:{bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151",overflow:"hidden"},children:[r.jsxs(E,{sx:{p:2,display:"flex",alignItems:"center",cursor:"pointer"},onClick:()=>Y(K===Z.id?null:Z.id),children:[r.jsx(kf,{sx:{color:"#6B7280",mr:2}}),r.jsxs(E,{sx:{flex:1},children:[r.jsxs(C,{sx:{color:"#fff",fontWeight:600},children:["Module ",pe+1,": ",Z.title]}),r.jsxs(C,{sx:{color:"#6B7280",fontSize:"0.8rem"},children:[Z.lessons?.length||0," lessons"]})]}),r.jsxs(G,{direction:"row",spacing:1,children:[r.jsx(tn,{title:"Edit Module",children:r.jsx(Ve,{onClick:Q=>{Q.stopPropagation(),ee(Z)},sx:{color:"#3B82F6"},children:r.jsx(Ws,{fontSize:"small"})})}),r.jsx(tn,{title:"Delete Module",children:r.jsx(Ve,{onClick:Q=>{Q.stopPropagation(),ve(Z.id)},disabled:Z.lessons?.length>0,sx:{color:Z.lessons?.length>0?"#374151":"#EF4444"},children:r.jsx(ss,{fontSize:"small"})})}),K===Z.id?r.jsx(em,{sx:{color:"#9CA3AF"}}):r.jsx(ti,{sx:{color:"#9CA3AF"}})]})]}),r.jsxs(Al,{in:K===Z.id,children:[r.jsx(Ir,{sx:{bgcolor:"#374151"}}),r.jsxs(E,{sx:{p:2,bgcolor:"#0F172A"},children:[Z.lessons?.length>0?r.jsx(Hs,{dense:!0,children:Z.lessons.map(Q=>r.jsxs(Ii,{sx:{bgcolor:"#1A2230",borderRadius:1,mb:1},children:[r.jsx(E,{sx:{display:"flex",alignItems:"center",mr:2},children:Se(Q.type)}),r.jsx(Js,{primary:Q.title,secondary:Q.duration?`${Q.duration} min`:null,primaryTypographyProps:{sx:{color:"#fff",fontSize:"0.85rem"}},secondaryTypographyProps:{sx:{color:"#6B7280"}}}),r.jsxs(Sb,{children:[r.jsx(Ve,{onClick:()=>Be(Z.id,Q),sx:{color:"#3B82F6"},children:r.jsx(Ws,{fontSize:"small"})}),r.jsx(Ve,{onClick:()=>Te(Z.id,Q.id),sx:{color:"#EF4444"},children:r.jsx(ss,{fontSize:"small"})})]})]},Q.id))}):r.jsx(C,{sx:{color:"#6B7280",textAlign:"center",py:2},children:"No lessons in this module"}),r.jsx(ye,{fullWidth:!0,variant:"outlined",startIcon:r.jsx(Br,{}),onClick:()=>Ge(Z.id),sx:{mt:1,color:"#1152D4",borderColor:"#374151","&:hover":{borderColor:"#1152D4"}},children:"Add Lesson"})]})]})]},Z.id))})]}),He=()=>r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600,mb:3},children:"Lesson Content Overview"}),p.lessons&&r.jsx(Wt,{severity:"error",sx:{mb:2,bgcolor:"rgba(239, 68, 68, 0.1)",color:"#EF4444"},children:p.lessons}),H.length===0?r.jsx(Je,{sx:{p:6,bgcolor:"#1A2230",borderRadius:2,border:"1px dashed #374151",textAlign:"center"},children:r.jsx(C,{sx:{color:"#6B7280"},children:"Create modules first to add lessons"})}):r.jsx(G,{spacing:3,children:H.map((Z,pe)=>r.jsxs(Je,{sx:{bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151",p:3},children:[r.jsxs(C,{sx:{color:"#fff",fontWeight:600,mb:2},children:["Module ",pe+1,": ",Z.title]}),Z.lessons?.length>0?r.jsx(G,{spacing:1.5,children:Z.lessons.map(Q=>r.jsxs(E,{sx:{bgcolor:"#0F172A",borderRadius:1.5,p:2,display:"flex",alignItems:"center",gap:2},children:[r.jsx(E,{sx:{p:1,bgcolor:"#1E293B",borderRadius:1},children:Se(Q.type)}),r.jsxs(E,{sx:{flex:1},children:[r.jsx(C,{sx:{color:"#fff",fontSize:"0.9rem",fontWeight:500},children:Q.title}),r.jsxs(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:[Q.type," ",Q.duration?`• ${Q.duration} min`:""]})]}),r.jsx(Pt,{label:Q.content?"Content Added":"Pending",size:"small",sx:{bgcolor:Q.content?"rgba(16, 185, 129, 0.15)":"rgba(245, 158, 11, 0.15)",color:Q.content?"#10B981":"#F59E0B",fontSize:"0.7rem"}})]},Q.id))}):r.jsx(C,{sx:{color:"#6B7280",textAlign:"center",py:2},children:"No lessons added"}),r.jsxs(ye,{fullWidth:!0,variant:"outlined",startIcon:r.jsx(Br,{}),onClick:()=>Ge(Z.id),sx:{mt:2,color:"#1152D4",borderColor:"#374151"},children:["Add Lesson to Module ",pe+1]})]},Z.id))})]}),$e=()=>{const Z=H.reduce((me,we)=>me+(we.lessons?.length||0),0),pe=M.find(me=>me.id===F.category_id)?.name||"-",Q=_.filter(me=>F.tutor_ids.map(String).includes(String(me.id))).map(Z5);return r.jsx(E,{children:r.jsxs(G,{spacing:3,children:[r.jsxs(Je,{sx:{bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151",p:3},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600,mb:2},children:"Course Information"}),r.jsxs(G,{spacing:2,children:[r.jsxs(E,{sx:{display:"flex",gap:2},children:[r.jsx(C,{sx:{color:"#6B7280",width:140},children:"Title:"}),r.jsx(C,{sx:{color:"#fff"},children:F.title||"-"})]}),r.jsxs(E,{sx:{display:"flex",gap:2},children:[r.jsx(C,{sx:{color:"#6B7280",width:140},children:"Category:"}),r.jsx(C,{sx:{color:"#fff"},children:pe})]}),r.jsxs(E,{sx:{display:"flex",gap:2},children:[r.jsx(C,{sx:{color:"#6B7280",width:140},children:"Level:"}),r.jsx(C,{sx:{color:"#fff",textTransform:"capitalize"},children:F.level})]}),r.jsxs(E,{sx:{display:"flex",gap:2},children:[r.jsx(C,{sx:{color:"#6B7280",width:140},children:"Status:"}),r.jsx(C,{sx:{color:"#fff",textTransform:"capitalize"},children:F.status})]}),r.jsxs(E,{sx:{display:"flex",gap:2},children:[r.jsx(C,{sx:{color:"#6B7280",width:140},children:"Summary:"}),r.jsx(C,{sx:{color:"#fff"},children:F.summary||"-"})]}),r.jsxs(E,{sx:{display:"flex",gap:2},children:[r.jsx(C,{sx:{color:"#6B7280",width:140},children:"Tutors:"}),r.jsx(C,{sx:{color:"#fff"},children:Q.length>0?Q.join(", "):"-"})]})]})]}),r.jsxs(Je,{sx:{bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151",p:3},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600,mb:2},children:"Curriculum Summary"}),r.jsxs(G,{direction:"row",spacing:4,children:[r.jsxs(E,{sx:{textAlign:"center"},children:[r.jsx(C,{sx:{color:"#1152D4",fontSize:"2rem",fontWeight:700},children:H.length}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.85rem"},children:"Modules"})]}),r.jsxs(E,{sx:{textAlign:"center"},children:[r.jsx(C,{sx:{color:"#10B981",fontSize:"2rem",fontWeight:700},children:Z}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.85rem"},children:"Lessons"})]})]})]}),r.jsxs(Je,{sx:{bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151",p:3},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600,mb:2},children:"Submission Checklist"}),r.jsxs(G,{spacing:1.5,children:[r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:2},children:[r.jsx(fr,{sx:{color:F.title?"#10B981":"#374151",fontSize:20}}),r.jsx(C,{sx:{color:F.title?"#fff":"#6B7280"},children:"Course title provided"})]}),r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:2},children:[r.jsx(fr,{sx:{color:F.category_id?"#10B981":"#374151",fontSize:20}}),r.jsx(C,{sx:{color:F.category_id?"#fff":"#6B7280"},children:"Category selected"})]}),r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:2},children:[r.jsx(fr,{sx:{color:F.tutor_ids.length>0?"#10B981":"#374151",fontSize:20}}),r.jsx(C,{sx:{color:F.tutor_ids.length>0?"#fff":"#6B7280"},children:"Tutor assignment ready"})]}),r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:2},children:[r.jsx(fr,{sx:{color:H.length>0?"#10B981":"#374151",fontSize:20}}),r.jsx(C,{sx:{color:H.length>0?"#fff":"#6B7280"},children:"At least one module"})]}),r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:2},children:[r.jsx(fr,{sx:{color:Z>0?"#10B981":"#374151",fontSize:20}}),r.jsx(C,{sx:{color:Z>0?"#fff":"#6B7280"},children:"At least one lesson"})]})]})]})]})})};return x?r.jsx(E,{sx:{p:4,bgcolor:"#0C1322",minHeight:"calc(100vh - 70px)",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx(nn,{sx:{color:"#1152D4"}})}):r.jsxs(E,{sx:{p:{xs:2,md:4},bgcolor:"#0C1322",minHeight:"calc(100vh - 70px)",width:"100%"},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:4},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h4",sx:{color:"#fff",fontWeight:700,mb:.5},children:s?"Edit Essential Course":"Create Essential Course"}),r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF"},children:s?"Update essential course details, tutors, and curriculum.":"Build a mandatory essential course and assign tutors to deliver it."})]}),r.jsx(G,{direction:"row",alignItems:"center",spacing:2,children:r.jsx(Pt,{icon:F.status==="draft"?r.jsx(rm,{sx:{fontSize:14}}):r.jsx(fr,{sx:{fontSize:14}}),label:l?`Draft saved ${l.toLocaleTimeString()}`:"Draft",sx:{bgcolor:"rgba(245, 158, 11, 0.15)",color:"#F59E0B","& .MuiChip-icon":{color:"#F59E0B"}}})})]}),r.jsx(E,{sx:{mb:4},children:r.jsx(E,{sx:{display:"flex",alignItems:"center",bgcolor:"#1A2230",borderRadius:"50px",p:.5,border:"1px solid #374151",overflow:"hidden"},children:jp.map((Z,pe)=>{const Q=Z.icon,me=pe===o,we=pe<o,et=pe===jp.length-1;return r.jsxs(Er.Fragment,{children:[r.jsxs(E,{onClick:()=>{we&&a(pe)},sx:{display:"flex",alignItems:"center",gap:1.5,py:1.5,px:2.5,borderRadius:"50px",bgcolor:me?"#1152D4":"transparent",cursor:we?"pointer":"default",transition:"all 0.2s ease","&:hover":{bgcolor:we&&!me?"rgba(17, 82, 212, 0.15)":me?"#1152D4":"transparent"},flexShrink:0},children:[r.jsx(E,{sx:{width:32,height:32,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:me?"rgba(255,255,255,0.2)":we?"rgba(16, 185, 129, 0.2)":"rgba(107, 114, 128, 0.2)",color:me?"#fff":we?"#10B981":"#6B7280"},children:we?r.jsx(fr,{sx:{fontSize:18}}):r.jsx(Q,{sx:{fontSize:18}})}),r.jsxs(E,{sx:{display:"flex",flexDirection:"column"},children:[r.jsx(C,{sx:{color:me?"#fff":we?"#10B981":"#9CA3AF",fontSize:"0.75rem",fontWeight:600,lineHeight:1.2},children:Z.label}),r.jsx(C,{sx:{color:me?"rgba(255,255,255,0.7)":"#6B7280",fontSize:"0.7rem",lineHeight:1.2},children:Z.sublabel})]})]}),!et&&r.jsx(E,{sx:{display:"flex",alignItems:"center",color:"#374151",flex:1,justifyContent:"center",minWidth:40},children:r.jsx(Eb,{sx:{fontSize:24}})})]},Z.label)})})}),r.jsxs(Je,{sx:{p:4,mb:4,bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151"},children:[o===0&&Ke(),o===1&&ot(),o===2&&He(),o===3&&$e()]}),r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,children:[r.jsxs(G,{direction:"row",spacing:1,children:[r.jsx(ye,{onClick:()=>e("/admin/content/essential-courses"),sx:{color:"#9CA3AF","&:hover":{bgcolor:"rgba(255,255,255,0.05)"}},children:"Cancel"}),!(o===jp.length-1&&s)&&r.jsx(ye,{onClick:()=>Re(!0),disabled:y||!F.title,variant:"outlined",sx:{borderColor:"#374151",color:"#9CA3AF","&:hover":{borderColor:"#6B7280",color:"#fff"},"&:disabled":{borderColor:"#1F2937",color:"#374151"}},children:y?"Saving…":s?"Save Changes":"Save Draft"})]}),r.jsxs(G,{direction:"row",spacing:2,children:[o>0&&r.jsx(ye,{onClick:de,startIcon:r.jsx(fa,{}),sx:{color:"#fff",borderColor:"#374151","&:hover":{borderColor:"#4B5563"}},variant:"outlined",children:"Back"}),o<jp.length-1?r.jsxs(ye,{onClick:ge,endIcon:r.jsx(Oi,{}),variant:"contained",sx:{bgcolor:"#1152D4","&:hover":{bgcolor:"#0D42AF"}},children:["Continue to ",jp[o+1].sublabel]}):r.jsx(ye,{onClick:()=>s?Re(!0):f(!0),endIcon:r.jsx(Rb,{}),variant:"contained",disabled:y,sx:{bgcolor:"#10B981","&:hover":{bgcolor:"#059669"}},children:s?"Save Changes":"Publish Course"})]})]}),r.jsx(tr,{open:O,onClose:()=>W(!1),children:r.jsxs(E,{sx:kr,children:[r.jsxs(E,{sx:{background:"linear-gradient(135deg, #1152D4 0%, #0D42AF 100%)",p:3,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600},children:k?"Edit Module":"Add Module"}),r.jsx(Ve,{onClick:()=>W(!1),sx:{color:"#fff"},children:r.jsx(hs,{})})]}),r.jsxs(E,{sx:{p:3},children:[r.jsxs(G,{spacing:2,children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Module Title"}),r.jsx(it,{fullWidth:!0,placeholder:"e.g. Introduction to the Course",value:D.title,onChange:Z=>q({...D,title:Z.target.value}),sx:xt})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Description (optional)"}),r.jsx(it,{fullWidth:!0,multiline:!0,rows:3,placeholder:"Brief description of what this module covers",value:D.description,onChange:Z=>q({...D,description:Z.target.value}),sx:xt})]})]}),r.jsxs(G,{direction:"row",justifyContent:"flex-end",spacing:2,sx:{mt:3},children:[r.jsx(ye,{onClick:()=>W(!1),sx:{color:"#9CA3AF"},children:"Cancel"}),r.jsx(ye,{variant:"contained",onClick:k?X:le,sx:{bgcolor:"#1152D4"},children:k?"Update":"Add Module"})]})]})]})}),r.jsx(tr,{open:ie,onClose:()=>V(!1),children:r.jsxs(E,{sx:{...kr,width:{xs:"95vw",sm:"90vw",md:900},maxHeight:"90vh",display:"flex",flexDirection:"column"},children:[r.jsxs(E,{sx:{background:"linear-gradient(135deg, #1152D4 0%, #0D42AF 100%)",p:3,display:"flex",justifyContent:"space-between",alignItems:"center",flexShrink:0},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600},children:re?"Edit Lesson":"Add Lesson"}),r.jsx(Ve,{onClick:()=>V(!1),sx:{color:"#fff"},children:r.jsx(hs,{})})]}),r.jsxs(E,{sx:{p:3,overflowY:"auto",flex:1,...kw},children:[r.jsxs(G,{spacing:2,children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Lesson Title"}),r.jsx(it,{fullWidth:!0,placeholder:"e.g. Welcome Video",value:se.title,onChange:Z=>J({...se,title:Z.target.value}),sx:xt})]}),r.jsxs(E,{children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem"},children:"Video"}),r.jsx(Pt,{label:"Optional",size:"small",sx:{bgcolor:"rgba(156, 163, 175, 0.15)",color:"#9CA3AF",fontSize:"0.7rem",height:20}})]}),r.jsx("input",{type:"file",accept:"video/*",style:{display:"none"},id:"lesson-video-upload",onChange:Z=>{const pe=Z.target.files[0];pe&&J({...se,videoFile:pe,fileName:pe.name,videoUrl:""})}}),r.jsx("label",{htmlFor:"lesson-video-upload",children:r.jsx(E,{sx:{bgcolor:"#1E293B",border:se.videoFile||se.fileName?"2px solid #10B981":"2px dashed #374151",borderRadius:2,p:3,textAlign:"center",cursor:"pointer","&:hover":{borderColor:"#1152D4"}},children:se.videoFile||se.fileName?r.jsxs(G,{alignItems:"center",spacing:1,children:[r.jsx(jo,{sx:{fontSize:36,color:"#10B981"}}),r.jsx(C,{sx:{color:"#fff",fontSize:"0.85rem"},children:se.fileName}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Click to change"})]}):r.jsxs(G,{alignItems:"center",spacing:1,children:[r.jsx(Bu,{sx:{fontSize:36,color:"#6B7280"}}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem"},children:"Click to upload video"}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.7rem"},children:"MP4, WebM, MOV (max. 500MB)"})]})})}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem",textAlign:"center",my:1},children:"— or —"}),r.jsx(it,{fullWidth:!0,placeholder:"Paste a video URL (https://...)",value:se.videoUrl,onChange:Z=>{const pe=Z.target.value;J({...se,videoUrl:pe,...pe?{videoFile:null,fileName:""}:{}})},sx:xt,slotProps:{htmlInput:{maxLength:2048}}})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Lesson Content"}),r.jsx(E,{sx:{bgcolor:"#1E293B",borderRadius:1.5,border:"1px solid #374151","& .ql-toolbar":{borderTopLeftRadius:6,borderTopRightRadius:6,borderColor:"#374151",bgcolor:"#111827"},"& .ql-container":{borderBottomLeftRadius:6,borderBottomRightRadius:6,borderColor:"#374151",minHeight:220,fontSize:"0.9rem"},"& .ql-editor":{color:"#FFFFFF",minHeight:220},"& .ql-editor.ql-blank::before":{color:"#6B7280",fontStyle:"normal"},"& .ql-stroke":{stroke:"#9CA3AF"},"& .ql-fill":{fill:"#9CA3AF"},"& .ql-picker-label":{color:"#9CA3AF"}},children:r.jsx(eh,{theme:"snow",value:se.content,onChange:Z=>J({...se,content:Z}),placeholder:"Write your lesson content here...",modules:{toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline","strike"],[{list:"ordered"},{list:"bullet"}],["link","blockquote","code-block"],["clean"]]}})})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Duration"}),r.jsxs(G,{direction:"row",spacing:2,alignItems:"center",children:[r.jsx(it,{type:"number",label:"Hours",value:se.durationHours===0?"":se.durationHours,onFocus:Z=>Z.target.select(),onChange:Z=>{const pe=Z.target.value;if(pe===""){J({...se,durationHours:0});return}const Q=Math.max(0,parseInt(pe)||0);J({...se,durationHours:Q})},slotProps:{htmlInput:{min:0,max:23,placeholder:"0"}},sx:{...xt,width:140,"& .MuiInputLabel-root":{color:"#9CA3AF"}}}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"1.25rem",fontWeight:600},children:":"}),r.jsx(it,{type:"number",label:"Minutes",value:se.durationMinutes===0?"":se.durationMinutes,onFocus:Z=>Z.target.select(),onChange:Z=>{const pe=Z.target.value;if(pe===""){J({...se,durationMinutes:0});return}const Q=Math.min(59,Math.max(0,parseInt(pe)||0));J({...se,durationMinutes:Q})},slotProps:{htmlInput:{min:0,max:59,placeholder:"0"}},sx:{...xt,width:140,"& .MuiInputLabel-root":{color:"#9CA3AF"}}})]})]})]}),r.jsxs(G,{direction:"row",justifyContent:"flex-end",spacing:2,sx:{mt:3},children:[r.jsx(ye,{onClick:()=>V(!1),sx:{color:"#9CA3AF"},children:"Cancel"}),r.jsx(ye,{variant:"contained",onClick:qe,sx:{bgcolor:"#1152D4"},children:re?"Update":"Add Lesson"})]})]})]})}),r.jsx(tr,{open:d,onClose:()=>f(!1),children:r.jsxs(E,{sx:kr,children:[r.jsx(E,{sx:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",p:3},children:r.jsx(C,{sx:{color:"#fff",fontWeight:600},children:"Publish Essential Course"})}),r.jsxs(E,{sx:{p:3},children:[r.jsx(C,{sx:{color:"#9CA3AF",mb:3},children:"Once published, this essential course will be visible to learners. You can still edit it later. Are you sure you want to publish?"}),r.jsxs(G,{direction:"row",justifyContent:"flex-end",spacing:2,children:[r.jsx(ye,{onClick:()=>Re(!0),sx:{color:"#9CA3AF"},children:"Save as Draft"}),r.jsx(ye,{variant:"contained",onClick:()=>Re(!1),sx:{bgcolor:"#10B981","&:hover":{bgcolor:"#059669"}},children:"Publish Course"})]})]})]})}),y&&r.jsxs(E,{sx:{position:"fixed",top:0,left:0,right:0,bottom:0,bgcolor:"rgba(0, 0, 0, 0.7)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",zIndex:9999},children:[r.jsx(nn,{size:60,sx:{color:"#1152D4",mb:2}}),r.jsx(C,{sx:{color:"#fff",fontSize:"1.1rem"},children:s?"Updating essential course...":"Creating essential course..."}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mt:1},children:"Please wait while we save the course, modules, and lessons."})]}),r.jsx(gs,{open:j.open,autoHideDuration:6e3,onClose:()=>A({...j,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:r.jsx(Wt,{onClose:()=>A({...j,open:!1}),severity:j.severity,sx:{width:"100%"},children:j.message})})]})},pye=e=>{const t=String(e||"").toLowerCase();return t==="video"?r.jsx(jo,{}):t==="quiz"?r.jsx(xz,{}):t==="document"||t==="file"?r.jsx(Ab,{}):r.jsx(Hf,{})},gye=()=>{const[e,t]=v.useState(""),[n,s]=v.useState([]),[o,a]=v.useState(!1),[l,u]=v.useState(""),[d,f]=v.useState({open:!1,message:"",severity:"success"}),p=(y,S="success")=>{f({open:!0,message:y,severity:S})},g=()=>{f(y=>({...y,open:!1}))},x=v.useMemo(()=>[...n].sort((y,S)=>Number(y.position||0)-Number(S.position||0)),[n]),b=async()=>{if(!String(e).trim()){p("Please provide a module ID.","error");return}a(!0),u("");try{const y=await ns.listLessonsByModule(e.trim());s(y.data||[])}catch(y){console.error("Failed to load lessons by module:",y),u(y.message||"Failed to load lessons."),s([])}finally{a(!1)}};return r.jsxs(E,{sx:{p:{xs:2,md:4},bgcolor:"#0C1322",minHeight:"calc(100vh - 70px)",width:"100%"},children:[r.jsxs(G,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:2,sx:{mb:4},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h4",sx:{color:"#fff",fontWeight:700,mb:1},children:"Lessons by Admin"}),r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF"},children:"Tutor-style lesson view for the admin module endpoint."})]}),r.jsx(Ve,{onClick:b,disabled:o||!e.trim(),sx:{color:"#9CA3AF","&:hover":{bgcolor:"rgba(255,255,255,0.08)"}},children:r.jsx(Ku,{})})]}),r.jsx(Je,{sx:{...Wr,p:2,mb:4},children:r.jsxs(G,{direction:{xs:"column",md:"row"},spacing:2,alignItems:{xs:"stretch",md:"center"},children:[r.jsxs(E,{sx:{...xy,maxWidth:620},children:[r.jsx(to,{sx:{color:"#9CA3AF",fontSize:20}}),r.jsx(sr,{placeholder:"Enter module UUID...",value:e,onChange:y=>t(y.target.value),sx:by})]}),r.jsx(ye,{variant:"contained",onClick:b,disabled:o,sx:os,children:o?"Loading...":"Load Lessons"})]})}),o?r.jsx(Je,{sx:{...Wr,py:8,display:"flex",justifyContent:"center"},children:r.jsx(nn,{})}):l?r.jsx(Je,{sx:{...Wr,p:2},children:r.jsx(Wt,{severity:"error",sx:{bgcolor:"transparent"},children:l})}):x.length===0?r.jsxs(Je,{sx:{...Wr,p:6,textAlign:"center",border:"1px dashed #374151"},children:[r.jsx(hr,{sx:{fontSize:60,color:"#374151",mb:2}}),r.jsx(C,{sx:{color:"#9CA3AF"},children:"No lessons loaded for this module."})]}):r.jsx(G,{spacing:2,children:r.jsx(Je,{sx:{bgcolor:"#1A2230",borderRadius:2,border:"1px solid #1F2937",overflow:"hidden"},children:r.jsxs(Fu,{defaultExpanded:!0,disableGutters:!0,sx:{bgcolor:"transparent",boxShadow:"none","&:before":{display:"none"}},children:[r.jsx(Lu,{component:"div",expandIcon:r.jsx(ti,{sx:{color:"#6B7280"}}),children:r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,sx:{width:"100%",pr:2},children:[r.jsxs(C,{sx:{color:"#E5E7EB",fontWeight:600},children:["Module: ",e]}),r.jsx(Pt,{label:`${x.length} lessons`,size:"small",sx:{bgcolor:"rgba(255,255,255,0.05)",color:"#9CA3AF",height:20,fontSize:"0.7rem"}})]})}),r.jsx(_u,{sx:{pt:0,pb:2},children:r.jsx(Hs,{disablePadding:!0,children:x.map(y=>r.jsx(Ii,{disablePadding:!0,sx:{mb:1},children:r.jsxs(Jo,{sx:{bgcolor:"#0F172A",borderRadius:1,border:"1px solid transparent","&:hover":{bgcolor:"#1E293B",borderColor:"rgba(59, 130, 246, 0.3)"},display:"flex",alignItems:"center",px:1},children:[r.jsx(Tl,{sx:{minWidth:40,color:"#3B82F6"},children:pye(y.type)}),r.jsx(Js,{primary:y.title||"Untitled lesson",secondary:r.jsxs(C,{variant:"caption",sx:{color:"#6B7280",display:"flex",alignItems:"center",gap:1},children:[y.type||"lesson"," • ",y.duration_minutes||y.duration||0," min • position ",y.position??"-"]}),primaryTypographyProps:{color:"#fff",fontSize:"0.9rem",fontWeight:500}}),r.jsx(Pt,{label:y.status||"draft",size:"small",sx:{textTransform:"capitalize",bgcolor:"rgba(255,255,255,0.05)",color:"#9CA3AF"}})]})},y.id))})})]})})}),r.jsx(gs,{open:d.open,autoHideDuration:3500,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:r.jsx(Wt,{severity:d.severity,onClose:g,variant:"filled",children:d.message})})]})},mye=()=>{const[e,t]=v.useState([]),[n,s]=v.useState(""),[o,a]=v.useState(!0),[l,u]=v.useState(!1),[d,f]=v.useState(null),[p,g]=v.useState({open:!1,message:"",severity:"success"}),[x,b]=v.useState(!1),[y,S]=v.useState(null),[j,A]=v.useState({name:"",description:""}),M=v.useCallback(async()=>{a(!0),f(null);try{const H=await vc.listCategories({per_page:100});t(H.data||[])}catch(H){console.error("Error fetching categories:",H),f(H.message||"Failed to load categories"),g({open:!0,message:"Failed to load categories",severity:"error"})}finally{a(!1)}},[]);v.useEffect(()=>{M()},[M]);const R=e.filter(H=>(H.name||"").toLowerCase().includes(n.toLowerCase())||(H.description||"").toLowerCase().includes(n.toLowerCase())),_=(H=null)=>{H?(S(H),A({name:H.name,description:H.description||""})):(S(null),A({name:"",description:""})),b(!0)},z=()=>{b(!1),S(null),A({name:"",description:""})},F=async()=>{if(!j.name.trim()){g({open:!0,message:"Category name is required",severity:"warning"});return}u(!0);try{y?(await vc.updateCategory(y.id,j),g({open:!0,message:"Category updated successfully",severity:"success"})):(await vc.createCategory(j),g({open:!0,message:"Category created successfully",severity:"success"})),z(),await M()}catch(H){console.error("Error saving category:",H),g({open:!0,message:H.message||"Failed to save category",severity:"error"})}finally{u(!1)}},N=async H=>{const P=e.find(k=>k.id===H);if(P)try{const k=P.status==="Active"?"Inactive":"Active";await vc.updateCategory(H,{...P,status:k}),g({open:!0,message:`Category ${k==="Active"?"activated":"deactivated"}`,severity:"success"}),await M()}catch(k){console.error("Error toggling status:",k),g({open:!0,message:"Failed to update status",severity:"error"})}},I=async H=>{const P=e.find(k=>k.id===H);if(P){if(P.courses_count>0||P.coursesCount>0){g({open:!0,message:"Cannot delete category with existing courses. Please reassign courses first.",severity:"warning"});return}if(window.confirm(`Are you sure you want to delete "${P.name}"?`))try{await vc.deleteCategory(H),g({open:!0,message:"Category deleted successfully",severity:"success"}),await M()}catch(k){console.error("Error deleting category:",k),g({open:!0,message:k.message||"Failed to delete category",severity:"error"})}}},B=()=>{g({...p,open:!1})};return r.jsxs(E,{sx:{p:{xs:2,md:4},bgcolor:"#0C1322",minHeight:"calc(100vh - 70px)",width:"100%"},children:[r.jsxs(G,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:2,sx:{mb:4},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h4",sx:{color:"#fff",fontWeight:700,mb:1},children:"Category Management"}),r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF"},children:"Create and manage course categories for tutors to select."})]}),r.jsxs(G,{direction:"row",spacing:1,children:[r.jsx(tn,{title:"Refresh",children:r.jsx(Ve,{onClick:M,disabled:o,sx:{color:"#9CA3AF","&:hover":{bgcolor:"rgba(255,255,255,0.1)"}},children:r.jsx(Ku,{})})}),r.jsx(ye,{variant:"contained",startIcon:r.jsx(Br,{}),onClick:()=>_(),sx:{bgcolor:"#1152D4","&:hover":{bgcolor:"#0D42AF"},boxShadow:"0 4px 14px rgba(17, 82, 212, 0.4)"},children:"Add Category"})]})]}),r.jsx(Je,{sx:{p:2,mb:4,bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151"},children:r.jsxs(E,{sx:{bgcolor:"#1F2937",borderRadius:1,px:2,display:"flex",alignItems:"center",gap:1,width:"100%",maxWidth:400,height:"40px"},children:[r.jsx(to,{sx:{color:"#9CA3AF",fontSize:20}}),r.jsx(sr,{placeholder:"Search categories...",value:n,onChange:H=>s(H.target.value),sx:{color:"#FFFFFF",fontSize:"0.9rem",width:"100%","& input":{border:"none",outline:"none","&::placeholder":{color:"#6B7280"}}}})]})}),r.jsx(ko,{component:Je,sx:{bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151"},children:r.jsxs(Eo,{children:[r.jsx(Mo,{children:r.jsxs(Bt,{children:[r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Category"}),r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Description"}),r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Courses"}),r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Status"}),r.jsx(je,{align:"right",sx:{color:"#9CA3AF",borderBottom:"1px solid #374151",fontWeight:600},children:"Actions"})]})}),r.jsx(To,{children:o?r.jsx(Bt,{children:r.jsxs(je,{colSpan:5,align:"center",sx:{borderBottom:"1px solid #374151",py:6},children:[r.jsx(nn,{size:40,sx:{color:"#7C3AED"}}),r.jsx(C,{sx:{color:"#9CA3AF",mt:2},children:"Loading categories..."})]})}):d?r.jsx(Bt,{children:r.jsxs(je,{colSpan:5,align:"center",sx:{borderBottom:"1px solid #374151",py:4},children:[r.jsx(Wt,{severity:"error",sx:{bgcolor:"transparent",justifyContent:"center"},children:d}),r.jsx(ye,{onClick:M,sx:{mt:2,color:"#7C3AED"},children:"Try Again"})]})}):R.length===0?r.jsx(Bt,{children:r.jsxs(je,{colSpan:5,align:"center",sx:{borderBottom:"1px solid #374151",py:6},children:[r.jsx(e5,{sx:{fontSize:48,color:"#374151",mb:2}}),r.jsx(C,{sx:{color:"#9CA3AF"},children:n?"No categories match your search":'No categories yet. Click "Add Category" to create one.'})]})}):R.map(H=>r.jsxs(Bt,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[r.jsx(je,{sx:{color:"#fff",borderBottom:"1px solid #374151"},children:r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(E,{sx:{width:40,height:40,borderRadius:1.5,bgcolor:"#7C3AED",display:"flex",alignItems:"center",justifyContent:"center"},children:r.jsx(e5,{sx:{color:"#fff",fontSize:20}})}),r.jsx(C,{variant:"subtitle2",sx:{fontWeight:600,color:"#fff"},children:H.name})]})}),r.jsx(je,{sx:{borderBottom:"1px solid #374151"},children:r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF",maxWidth:300,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:H.description})}),r.jsx(je,{sx:{borderBottom:"1px solid #374151"},children:r.jsx(Pt,{label:`${H.coursesCount} courses`,size:"small",sx:{bgcolor:"#374151",color:"#E5E7EB",fontSize:"0.75rem"}})}),r.jsx(je,{sx:{borderBottom:"1px solid #374151"},children:r.jsx(Pt,{icon:H.status==="Active"?r.jsx(fr,{sx:{fontSize:14}}):r.jsx(_c,{sx:{fontSize:14}}),label:H.status,size:"small",sx:{bgcolor:H.status==="Active"?"rgba(16, 185, 129, 0.15)":"rgba(239, 68, 68, 0.15)",color:H.status==="Active"?"#10B981":"#EF4444",fontSize:"0.75rem","& .MuiChip-icon":{color:H.status==="Active"?"#10B981":"#EF4444"}}})}),r.jsx(je,{align:"right",sx:{borderBottom:"1px solid #374151"},children:r.jsxs(G,{direction:"row",spacing:1,justifyContent:"flex-end",children:[r.jsx(tn,{title:"Edit Category",children:r.jsx(Ve,{onClick:()=>_(H),sx:{color:"#3B82F6",bgcolor:"rgba(59, 130, 246, 0.1)","&:hover":{bgcolor:"rgba(59, 130, 246, 0.2)"}},children:r.jsx(Ws,{fontSize:"small"})})}),r.jsx(tn,{title:H.status==="Active"?"Deactivate":"Activate",children:r.jsx(Ve,{onClick:()=>N(H.id),sx:{color:H.status==="Active"?"#F59E0B":"#10B981",bgcolor:H.status==="Active"?"rgba(245, 158, 11, 0.1)":"rgba(16, 185, 129, 0.1)","&:hover":{bgcolor:H.status==="Active"?"rgba(245, 158, 11, 0.2)":"rgba(16, 185, 129, 0.2)"}},children:H.status==="Active"?r.jsx(_c,{fontSize:"small"}):r.jsx(fr,{fontSize:"small"})})}),r.jsx(tn,{title:H.coursesCount>0?"Cannot delete - has courses":"Delete Category",children:r.jsx("span",{children:r.jsx(Ve,{onClick:()=>I(H.id),disabled:H.coursesCount>0,sx:{color:H.coursesCount>0?"#4B5563":"#EF4444",bgcolor:H.coursesCount>0?"transparent":"rgba(239, 68, 68, 0.1)","&:hover":{bgcolor:H.coursesCount>0?"transparent":"rgba(239, 68, 68, 0.2)"},"&.Mui-disabled":{color:"#4B5563"}},children:r.jsx(ss,{fontSize:"small"})})})})]})})]},H.id))})]})}),r.jsx(tr,{open:x,onClose:z,children:r.jsxs(E,{sx:kr,children:[r.jsxs(E,{sx:{background:"linear-gradient(135deg, #7C3AED 0%, #5B21B6 100%)",p:3,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(e5,{sx:{color:"#fff",fontSize:28}}),r.jsx(C,{variant:"h6",sx:{color:"#fff",fontWeight:600},children:y?"Edit Category":"Add New Category"})]}),r.jsx(Ve,{onClick:z,sx:{color:"#fff","&:hover":{bgcolor:"rgba(255,255,255,0.1)"}},children:r.jsx(hs,{})})]}),r.jsx(E,{sx:{p:3},children:r.jsxs(G,{spacing:2.5,children:[r.jsxs(E,{children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Category Name"}),r.jsx(it,{fullWidth:!0,placeholder:"e.g. Political Science",value:j.name,onChange:H=>A({...j,name:H.target.value}),sx:xt})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:500,color:"#E5E7EB",mb:.75},children:"Description"}),r.jsx(it,{fullWidth:!0,multiline:!0,rows:3,placeholder:"Brief description of this category...",value:j.description,onChange:H=>A({...j,description:H.target.value}),sx:xt})]}),r.jsx(ye,{variant:"contained",fullWidth:!0,onClick:F,disabled:!j.name.trim()||l,sx:{bgcolor:"#7C3AED",py:1.5,borderRadius:1.5,fontWeight:600,fontSize:"0.875rem",boxShadow:"0 4px 14px rgba(124, 58, 237, 0.4)","&:hover":{bgcolor:"#6D28D9"},"&:disabled":{bgcolor:"#1F2937",color:"#6B7280",boxShadow:"none"}},children:l?r.jsx(nn,{size:20,sx:{color:"#fff"}}):y?"Update Category":"Create Category"})]})})]})}),r.jsx(gs,{open:p.open,autoHideDuration:4e3,onClose:B,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:r.jsx(Wt,{onClose:B,severity:p.severity,sx:{width:"100%"},children:p.message})})]})},xye=()=>r.jsxs("div",{className:"admin-settings",children:[r.jsxs("div",{className:"page-header",children:[r.jsx("h1",{children:"System Settings"}),r.jsx("p",{children:"Configure system-wide settings"})]}),r.jsxs("div",{className:"settings-grid",children:[r.jsxs(Np,{title:"General Settings",children:[r.jsxs("div",{className:"setting-item",children:[r.jsx("label",{children:"Site Name"}),r.jsx("input",{type:"text",defaultValue:"Integritas Hub Platform"})]}),r.jsxs("div",{className:"setting-item",children:[r.jsx("label",{children:"Contact Email"}),r.jsx("input",{type:"email",defaultValue:"admin@Integritas Hub.com"})]})]}),r.jsxs(Np,{title:"Security Settings",children:[r.jsx("div",{className:"setting-item",children:r.jsxs("label",{children:[r.jsx("input",{type:"checkbox",defaultChecked:!0}),"Enable Two-Factor Authentication"]})}),r.jsx("div",{className:"setting-item",children:r.jsxs("label",{children:[r.jsx("input",{type:"checkbox",defaultChecked:!0}),"Require Email Verification"]})})]}),r.jsxs(Np,{title:"Notification Settings",children:[r.jsx("div",{className:"setting-item",children:r.jsxs("label",{children:[r.jsx("input",{type:"checkbox",defaultChecked:!0}),"Email Notifications"]})}),r.jsx("div",{className:"setting-item",children:r.jsxs("label",{children:[r.jsx("input",{type:"checkbox"}),"SMS Notifications"]})})]})]})]}),bye=()=>{Dn();const[e,t]=v.useState("list"),[n,s]=v.useState(null),[o,a]=v.useState(""),[l,u]=v.useState(""),d={pageBg:"#0B1220",cardBg:"#111A2C",cardBg2:"rgba(255,255,255,0.02)",border:"rgba(148, 163, 184, 0.14)",borderStrong:"rgba(148, 163, 184, 0.22)",text:"#E5E7EB",muted:"#94A3B8",dim:"#64748B",primary:"#3B82F6"},[f,p]=v.useState([]),[g,x]=v.useState(!1),[b,y]=v.useState(!1),[S,j]=v.useState(1),A=f;v.useEffect(()=>{(async()=>{try{x(!0),u("");const N=await ik({q:o,page:S});p(N?.data||[])}catch(N){console.error(N),u("Failed to load KYC submissions."),p([])}finally{x(!1)}})()},[o,S]);const M=F=>{switch(F){case"approved":return{color:"#10B981",bg:"rgba(16, 185, 129, 0.14)",icon:r.jsx(Ia,{sx:{fontSize:16}})};case"rejected":return{color:"#EF4444",bg:"rgba(239, 68, 68, 0.14)",icon:r.jsx(i1,{sx:{fontSize:16}})};case"submitted":return{color:"#F59E0B",bg:"rgba(245, 158, 11, 0.14)",icon:r.jsx(ite,{sx:{fontSize:16}})};default:return{color:d.muted,bg:"rgba(148,163,184,0.10)",icon:null}}},R=async F=>{try{u(""),y(!0);const N=await ak(F.id);s({id:N.id,status:N.status,submitted_at:N.submitted_at,reviewed_at:N.reviewed_at,review_note:N.review_note||"",user:N.user,data:N.data,documents:N.documents||[]}),t("detail")}catch(N){console.error(N),u("Failed to load KYC details.")}finally{y(!1)}},_=()=>{t("list"),s(null),u("")},z=async F=>{try{if(u(""),y(!0),F==="rejected"&&!n.review_note?.trim()){u("Please provide a review note for rejection.");return}F==="approved"?await Uhe(n.id,n.review_note||"Approved."):await qhe(n.id,n.review_note);const N=await ak(n.id);s({id:N.id,status:N.status,submitted_at:N.submitted_at,reviewed_at:N.reviewed_at,review_note:N.review_note||"",user:N.user,data:N.data,documents:N.documents||[]});const I=await ik({q:o,page:S});p(I?.data||[])}catch(N){console.error(N),u("Action failed. Check token/permissions and KYC status.")}finally{y(!1)}};if(e==="detail"&&n){const F=n.status==="submitted",N=n.status==="approved",I=M(n.status),B=n.user||{},H=n.data||{};return r.jsx(E,{sx:{p:{xs:2,md:4},bgcolor:d.pageBg,minHeight:"calc(100vh - 70px)",width:"100%",boxSizing:"border-box"},children:r.jsxs(Zt,{container:!0,spacing:3,children:[r.jsx(Zt,{item:!0,xs:12,children:r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(Ve,{onClick:_,sx:{color:d.text,bgcolor:"rgba(255,255,255,0.04)",border:`1px solid ${d.border}`,borderRadius:2,"&:hover":{bgcolor:"rgba(255,255,255,0.07)"}},children:r.jsx(fa,{})}),r.jsxs(E,{sx:{flex:1},children:[r.jsxs(G,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},spacing:1.5,children:[r.jsx(C,{variant:"h5",sx:{color:d.text,fontWeight:800},children:"KYC Review"}),r.jsx(Pt,{label:n.status.toUpperCase(),icon:I.icon,sx:{bgcolor:I.bg,color:I.color,fontWeight:800,fontSize:"0.75rem",height:28,border:`1px solid ${d.border}`,"& .MuiChip-icon":{color:"inherit"}}})]}),r.jsxs(C,{variant:"caption",sx:{color:d.muted,fontWeight:500},children:["Integritas Hub • Tutor Verification • Submitted on ",n.submitted_at]})]})]})}),r.jsx(Zt,{item:!0,xs:12,children:r.jsxs(Je,{sx:{p:{xs:3,md:4},bgcolor:d.cardBg,border:`1px solid ${d.border}`,borderRadius:4,boxShadow:"0 4px 24px rgba(0,0,0,0.2)",position:"relative",overflow:"hidden","&::after":{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"2px",background:`linear-gradient(90deg, ${d.primary}, transparent)`}},children:[r.jsxs(G,{direction:"row",spacing:2,alignItems:"center",sx:{mb:2.5},children:[r.jsx(E,{sx:{width:56,height:56,borderRadius:2,bgcolor:"rgba(59,130,246,0.12)",border:"1px solid rgba(59,130,246,0.35)",display:"grid",placeItems:"center",flexShrink:0},children:r.jsx(Lee,{sx:{color:d.primary}})}),r.jsxs(E,{sx:{minWidth:0},children:[r.jsx(C,{variant:"h6",sx:{color:d.text,fontWeight:900,lineHeight:1.2},noWrap:!0,children:B.name||"—"}),r.jsxs(G,{direction:"row",spacing:1,alignItems:"center",sx:{mt:.5},children:[r.jsx(gg,{sx:{color:d.dim,fontSize:16}}),r.jsx(C,{variant:"body2",sx:{color:d.muted},noWrap:!0,children:B.email||"—"}),n.reviewed_at&&r.jsx(Pt,{size:"small",label:`Reviewed: ${n.reviewed_at}`,sx:{ml:1,bgcolor:"rgba(16,185,129,0.10)",color:"#10B981",border:`1px solid ${d.border}`,fontWeight:700,height:24}})]})]})]}),r.jsx(Ir,{sx:{borderColor:d.border,mb:2.5}}),r.jsxs(C,{variant:"subtitle2",sx:{color:d.text,mb:2,fontWeight:900,textTransform:"uppercase",letterSpacing:.9,display:"flex",alignItems:"center",gap:1},children:[r.jsx(Lc,{sx:{color:d.primary,fontSize:18}})," KYC Information"]}),r.jsxs(Zt,{container:!0,spacing:2,children:[[{label:"Phone Number",value:H.phone,icon:r.jsx(jte,{})},{label:"Country",value:H.country,icon:r.jsx(Ate,{})},{label:"State / Province",value:H.state,icon:r.jsx(_S,{})},{label:"City",value:H.city,icon:r.jsx(_S,{})},{label:"Residential Address",value:H.address,icon:r.jsx(ote,{}),fullWidth:!0},{label:"Highest Education",value:H.highest_education,icon:r.jsx(ste,{}),fullWidth:!0}].map((P,k)=>r.jsx(Zt,{item:!0,xs:12,sm:P.fullWidth?12:6,children:r.jsx(E,{sx:{p:2,bgcolor:d.cardBg2,borderRadius:2,border:`1px solid ${d.border}`},children:r.jsxs(G,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[r.jsx(E,{sx:{color:d.primary,mt:.4},children:P.icon}),r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:d.dim,fontWeight:800,textTransform:"uppercase",fontSize:"0.65rem",display:"block",mb:.4,letterSpacing:.7},children:P.label}),r.jsx(C,{variant:"body2",sx:{color:d.text,fontWeight:600},children:P.value})]})]})})},k)),r.jsx(Zt,{item:!0,xs:12,children:r.jsxs(E,{sx:{p:2,bgcolor:d.cardBg2,borderRadius:2,border:`1px solid ${d.border}`},children:[r.jsx(C,{variant:"caption",sx:{color:d.dim,fontWeight:800,textTransform:"uppercase",fontSize:"0.65rem",display:"block",mb:1,letterSpacing:.7},children:"Skills & Expertise"}),r.jsx(G,{direction:"row",spacing:1,flexWrap:"wrap",useFlexGap:!0,sx:{gap:1},children:(H.skills||[]).map(P=>r.jsx(Pt,{label:P,size:"small",sx:{color:d.text,bgcolor:"rgba(59,130,246,0.10)",border:"1px solid rgba(59,130,246,0.25)",fontWeight:700}},P))})]})}),r.jsx(Zt,{item:!0,xs:12,children:r.jsxs(E,{sx:{p:2.5,bgcolor:d.cardBg2,borderRadius:2,border:`1px solid ${d.border}`},children:[r.jsx(C,{variant:"caption",sx:{color:d.dim,fontWeight:800,textTransform:"uppercase",fontSize:"0.65rem",display:"block",mb:1,letterSpacing:.7},children:"Professional Bio"}),r.jsx(C,{variant:"body2",sx:{color:d.muted,lineHeight:1.8},children:H.bio})]})})]})]})}),r.jsx(Zt,{item:!0,xs:12,lg:6,children:r.jsxs(Je,{sx:{p:4,bgcolor:d.cardBg,border:`1px solid ${d.border}`,borderRadius:4,height:"100%",display:"flex",flexDirection:"column"},children:[r.jsx(C,{variant:"h6",sx:{color:d.text,mb:2,fontWeight:900},children:"Review Decision"}),F?r.jsxs(G,{spacing:2.5,children:[r.jsx(it,{label:"Internal Review Note",multiline:!0,rows:5,placeholder:"Provide detail on why this submission is approved or rejected...",value:n.review_note,onChange:P=>s(k=>({...k,review_note:P.target.value})),fullWidth:!0,error:!!l,helperText:l,sx:{"& .MuiOutlinedInput-root":{color:d.text,bgcolor:"rgba(255,255,255,0.02)","& fieldset":{borderColor:d.borderStrong,borderRadius:2},"&:hover fieldset":{borderColor:"rgba(148,163,184,0.35)"},"&.Mui-focused fieldset":{borderColor:d.primary}},"& .MuiInputLabel-root":{color:d.muted},"& .MuiFormHelperText-root":{color:"#FCA5A5"}}}),r.jsxs(G,{direction:"column",spacing:1.5,children:[r.jsx(ye,{fullWidth:!0,variant:"contained",size:"large",startIcon:r.jsx(Ia,{}),sx:{bgcolor:"#10B981",py:1.3,fontWeight:900,borderRadius:2,"&:hover":{bgcolor:"#059669"}},onClick:()=>z("approved"),children:"Approve"}),r.jsx(ye,{fullWidth:!0,variant:"outlined",size:"large",startIcon:r.jsx(i1,{}),sx:{color:"#EF4444",borderColor:"rgba(239,68,68,0.65)",py:1.3,fontWeight:900,borderRadius:2,"&:hover":{bgcolor:"rgba(239,68,68,0.06)",borderColor:"rgba(239,68,68,0.9)"}},onClick:()=>z("rejected"),children:"Reject"})]})]}):r.jsxs(G,{spacing:2.5,children:[r.jsx(Wt,{severity:N?"success":"error",variant:"filled",sx:{borderRadius:2,fontWeight:800,bgcolor:N?"#10B981":"#EF4444"},children:N?"Verification Successful":"Verification Rejected"}),r.jsxs(E,{sx:{p:2.5,bgcolor:d.cardBg2,borderRadius:2,border:`1px solid ${d.border}`},children:[r.jsx(C,{variant:"caption",sx:{color:d.muted,fontWeight:900,textTransform:"uppercase",fontSize:"0.65rem",display:"block",mb:1,letterSpacing:.7},children:"Decision Rationale"}),r.jsx(C,{variant:"body2",sx:{color:d.text,fontStyle:n.review_note?"normal":"italic"},children:n.review_note||"No rationale provided."})]})]})]})}),r.jsx(Zt,{item:!0,xs:12,lg:6,children:r.jsxs(Je,{sx:{p:4,bgcolor:d.cardBg,border:`1px solid ${d.border}`,borderRadius:4,height:"100%",display:"flex",flexDirection:"column"},children:[r.jsx(C,{variant:"h6",sx:{color:d.text,mb:3,fontWeight:900,textTransform:"uppercase",letterSpacing:1},children:"Supporting Documents"}),r.jsx(G,{spacing:2,sx:{flex:1},children:n.documents.map(P=>r.jsxs(E,{sx:{p:2.5,borderRadius:3,border:`1px solid ${d.border}`,bgcolor:d.cardBg2,display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{bgcolor:"rgba(255,255,255,0.05)",borderColor:d.primary,transform:"translateY(-2px)",boxShadow:`0 4px 12px ${d.primary}20`}},children:[r.jsxs(G,{direction:"row",spacing:2,alignItems:"center",sx:{minWidth:0},children:[r.jsx(E,{sx:{p:1.2,bgcolor:"rgba(59,130,246,0.12)",border:"1px solid rgba(59,130,246,0.22)",borderRadius:2,display:"grid",placeItems:"center",flexShrink:0},children:r.jsx(Qg,{sx:{color:d.primary,fontSize:24}})}),r.jsxs(E,{sx:{minWidth:0},children:[r.jsx(C,{variant:"body2",sx:{color:d.text,fontWeight:800,mb:.5},noWrap:!0,children:P.name}),r.jsx(C,{variant:"caption",sx:{color:d.dim,textTransform:"uppercase",fontWeight:700,letterSpacing:.5},children:P.type})]})]}),r.jsxs(G,{direction:"row",spacing:1,sx:{flexShrink:0},children:[r.jsx(tn,{title:"View Document",children:r.jsx(Ve,{size:"small",sx:{color:d.primary,bgcolor:"rgba(59,130,246,0.06)","&:hover":{bgcolor:"rgba(59,130,246,0.15)"}},onClick:()=>console.log("VIEW",P),children:r.jsx(g8,{fontSize:"small"})})}),r.jsx(tn,{title:"Download",children:r.jsx(Ve,{size:"small",sx:{color:d.primary,bgcolor:"rgba(59,130,246,0.06)","&:hover":{bgcolor:"rgba(59,130,246,0.15)"}},onClick:()=>console.log("DOWNLOAD",P),children:r.jsx(Yee,{fontSize:"small"})})})]})]},P.id))})]})})]})})}return r.jsxs(E,{sx:{p:{xs:2,md:4},bgcolor:d.pageBg,minHeight:"calc(100vh - 70px)",width:"100%",boxSizing:"border-box"},children:[r.jsxs(G,{direction:{xs:"column",md:"row"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",spacing:2,sx:{mb:3},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h4",sx:{color:d.text,fontWeight:900,mb:.5},children:"KYC Review"}),r.jsx(C,{variant:"body2",sx:{color:d.muted},children:"Integritas Hub • Review and manage tutor verification submissions."})]}),r.jsx(G,{direction:"row",spacing:1,flexWrap:"wrap",useFlexGap:!0,sx:{gap:1},children:r.jsx(Pt,{label:`Total: ${f.length}`,sx:{bgcolor:"rgba(245,158,11,0.12)",color:"#F59E0B",border:`1px solid ${d.border}`,fontWeight:900}})})]}),r.jsx(Je,{elevation:0,sx:{p:2,mb:3,bgcolor:d.cardBg,borderRadius:3,border:`1px solid ${d.border}`,display:"flex",alignItems:"center",gap:2},children:r.jsxs(E,{sx:{bgcolor:"#1F2937",borderRadius:1,px:2,display:"flex",alignItems:"center",gap:1,width:"100%",maxWidth:400,height:"40px"},children:[r.jsx(to,{sx:{color:"#9CA3AF",fontSize:20}}),r.jsx(sr,{placeholder:"Search by name, email, or status...",value:o,onChange:F=>a(F.target.value),sx:{color:"#FFFFFF",fontSize:"0.9rem",width:"100%","& input":{border:"none",outline:"none","&::placeholder":{color:"#6B7280"}}}})]})}),r.jsxs(ko,{component:Je,sx:{bgcolor:d.cardBg,borderRadius:3,border:`1px solid ${d.border}`,overflow:"hidden"},children:[l&&r.jsx(Wt,{severity:"error",sx:{mb:2},children:l}),g&&r.jsx(Wt,{severity:"info",sx:{mb:2},children:"Loading submissions..."}),r.jsxs(Eo,{children:[r.jsx(Mo,{sx:{bgcolor:"rgba(255,255,255,0.02)"},children:r.jsxs(Bt,{children:[r.jsx(je,{sx:{color:d.muted,borderBottom:`1px solid ${d.border}`,fontWeight:900,textTransform:"uppercase",fontSize:"0.75rem",letterSpacing:.9,py:2},children:"KYC ID"}),r.jsx(je,{sx:{color:d.muted,borderBottom:`1px solid ${d.border}`,fontWeight:900,textTransform:"uppercase",fontSize:"0.75rem",letterSpacing:.9,py:2},children:"Role"}),r.jsx(je,{sx:{color:d.muted,borderBottom:`1px solid ${d.border}`,fontWeight:900,textTransform:"uppercase",fontSize:"0.75rem",letterSpacing:.9,py:2},children:"Status"}),r.jsx(je,{align:"right",sx:{color:d.muted,borderBottom:`1px solid ${d.border}`,fontWeight:900,textTransform:"uppercase",fontSize:"0.75rem",letterSpacing:.9,py:2},children:"Action"})]})}),r.jsx(To,{children:A.map(F=>{const N=M(F.status);return r.jsxs(Bt,{hover:!0,sx:{"&:last-child td, &:last-child th":{border:0},"&:hover":{bgcolor:"rgba(255,255,255,0.03)"},transition:"background-color 0.2s"},children:[r.jsx(je,{sx:{borderBottom:`1px solid ${d.border}`,py:1.6},children:r.jsxs(G,{spacing:.2,children:[r.jsxs(C,{variant:"subtitle2",sx:{fontWeight:900,color:d.text},children:[String(F.id).slice(0,8),"..."]}),r.jsx(C,{variant:"caption",sx:{color:d.muted},children:F.id})]})}),r.jsx(je,{sx:{borderBottom:`1px solid ${d.border}`,py:1.6},children:r.jsx(Pt,{size:"small",label:(F.role||"—").toUpperCase(),sx:{bgcolor:"rgba(59,130,246,0.10)",color:d.text,border:`1px solid ${d.border}`,fontWeight:900,height:26}})}),r.jsx(je,{sx:{borderBottom:`1px solid ${d.border}`,py:1.6},children:r.jsx(Pt,{icon:N.icon,label:(F.status||"—").toUpperCase(),size:"small",sx:{bgcolor:N.bg,color:N.color,fontWeight:900,fontSize:"0.7rem",height:26,border:`1px solid ${d.border}`,"& .MuiChip-icon":{color:"inherit"}}})}),r.jsx(je,{align:"right",sx:{borderBottom:`1px solid ${d.border}`,py:1.6},children:r.jsx(tn,{title:"Review",children:r.jsx(Ve,{onClick:()=>R(F),sx:{color:d.primary,bgcolor:"rgba(59,130,246,0.10)",border:"1px solid rgba(59,130,246,0.18)",borderRadius:2,"&:hover":{bgcolor:"rgba(59,130,246,0.18)"}},children:r.jsx(g8,{fontSize:"small"})})})})]},F.id)})})]}),A.length===0&&r.jsx(E,{sx:{p:4,textAlign:"center"},children:r.jsx(C,{sx:{color:d.muted,fontWeight:700},children:"No submissions found."})})]})]})},yye=()=>{const{courseId:e}=Vu(),t=Dn(),[n,s]=v.useState(null),[o,a]=v.useState([]),[l,u]=v.useState(!0),[d,f]=v.useState(!1),[p,g]=v.useState(0),[x,b]=v.useState(!1),[y,S]=v.useState(""),[j,A]=v.useState(""),[M,R]=v.useState(null),[_,z]=v.useState(!1),[F,N]=v.useState(null),[I,B]=v.useState(""),[H,P]=v.useState("video"),[k,L]=v.useState(""),[O,W]=v.useState(0),[D,q]=v.useState(null),[K,Y]=v.useState(""),[ie,V]=v.useState(!1),[re,fe]=v.useState(""),[ae,ue]=v.useState({open:!1,message:"",severity:"success"});v.useEffect(()=>{se()},[e]);const se=async()=>{try{u(!0);const Se=await Dr.getCourseDetail(e);s(Se);const Ke=await Dr.getCourseModules(e);if(Ke&&Ke.length>0){const ot=await Promise.all(Ke.map(async He=>{try{const $e=await Dr.listLessons(He.id);return{...He,lessons:$e.data||[]}}catch{return{...He,lessons:[]}}}));a(ot)}else a([])}catch(Se){console.error("Error fetching course data:",Se),J("Failed to load course data","error")}finally{u(!1)}},J=(Se,Ke="success")=>{ue({open:!0,message:Se,severity:Ke})},ce=async()=>{if(y.trim())try{f(!0);const Se={title:y,description:j};M?(await Dr.updateModule(M,Se),J("Module updated successfully")):(await Dr.createModule(e,Se),J("Module created successfully")),b(!1),S(""),A(""),R(null),se()}catch{J("Failed to save module","error")}finally{f(!1)}},oe=async Se=>{if(window.confirm("Are you sure? All lessons in this module will be deleted."))try{f(!0),await Dr.deleteModule(Se),J("Module deleted"),se()}catch{J("Failed to delete module","error")}finally{f(!1)}},ge=async(Se,Ke)=>{try{const ot=o.map(He=>He.id===Se?{...He,is_published:!Ke}:He);a(ot),Ke?(await Dr.unpublishModule(e,Se),J("Module unpublished")):(await Dr.publishModule(e,Se),J("Module published")),se()}catch{J("Failed to update module status","error"),se()}},de=Se=>{N(Se),B(""),P("video"),L(""),W(0),q(null),Y(""),z(!0)},le=async()=>{if(!I.trim()){J("Lesson title is required","error");return}try{f(!0);const Se={title:I,type:H,content:k,duration:O,position:0},Ke=await Dr.createLesson(F,Se);if((H==="video"||H==="document")&&D){const ot=new FormData;ot.append("file",D),await Dr.uploadLessonMedia(Ke.id,ot)}J("Lesson created successfully"),z(!1),se()}catch(Se){console.error("Create lesson error:",Se),J(Se.message||"Failed to create lesson","error")}finally{f(!1)}},ee=async Se=>{if(window.confirm("Delete this lesson?"))try{f(!0),await Dr.deleteLesson(Se),J("Lesson deleted"),se()}catch{J("Failed to delete lesson","error")}finally{f(!1)}},X=async(Se,Ke,ot)=>{try{ot?(await Dr.unpublishLesson(Se,Ke),J("Lesson unpublished")):(await Dr.publishLesson(Se,Ke),J("Lesson published")),se()}catch{J("Failed to update lesson status","error")}},ve=async()=>{try{f(!0),n.published_at?(await Dr.unpublishCourse(e),J("Course unpublished")):(await Dr.publishCourse(e),J("Course published")),se()}catch{J("Failed to update course status","error")}finally{f(!1)}},st=async()=>{if(window.confirm("Approve this course? It will be marked as reviewed."))try{f(!0),await Dr.updateCourse(e,{status:"published"}),J("Course approved"),se()}catch{J("Failed to approve course","error")}finally{f(!1)}},Ge=async()=>{if(!re.trim()){J("Please provide a reason","error");return}try{f(!0),await Dr.updateCourse(e,{status:"rejected",rejection_reason:re}),J("Course rejected"),V(!1),se()}catch{J("Failed to reject course","error")}finally{f(!1)}},qe=async()=>{if(window.confirm("CRITICAL: Delete this course permanently? This cannot be undone."))try{f(!0),await Dr.deleteCourse(e),t("/admin/content/courses")}catch{J("Failed to delete course","error"),f(!1)}},Be=Se=>{switch(Se){case"video":return r.jsx(jo,{});case"document":return r.jsx(Gee,{});case"text":return r.jsx(mg,{});case"quiz":return r.jsx(hr,{});default:return r.jsx(Dte,{})}},Te=(Se,Ke)=>new Intl.NumberFormat("en-NG",{style:"currency",currency:Ke||"NGN"}).format(Se);if(l)return r.jsx(E,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",bgcolor:"#0F1729"},children:r.jsx(nn,{})});if(!n)return null;const Re=!!String(n.thumbnail_url||"").trim();return r.jsxs(E,{sx:{p:{xs:2,md:4},bgcolor:"#0F1729",minHeight:"100vh",color:"#fff"},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,sx:{mb:4},children:[r.jsx(Ve,{onClick:()=>t("/admin/content/courses"),sx:{color:"#9CA3AF"},children:r.jsx(fa,{})}),r.jsxs(E,{sx:{flexGrow:1},children:[r.jsxs(xC,{separator:"›",sx:{color:"#6B7280",fontSize:"0.85rem",mb:.5},children:[r.jsx(yn,{to:"/admin/content/courses",style:{color:"#6B7280",textDecoration:"none"},children:"Courses"}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem"},children:"Details"})]}),r.jsx(C,{variant:"h5",sx:{fontWeight:600,color:"#fff"},children:n.title})]}),r.jsx(G,{direction:"row",spacing:2,children:r.jsx(Pt,{label:n.status,color:n.status==="published"?"success":n.status==="rejected"?"error":"warning",sx:{fontWeight:600,borderRadius:1}})})]}),r.jsx(E,{sx:{borderBottom:1,borderColor:"divider",mb:3},children:r.jsxs(Zg,{value:p,onChange:(Se,Ke)=>g(Ke),textColor:"primary",indicatorColor:"primary",children:[r.jsx(Qs,{label:"Curriculum",sx:{textTransform:"none",color:"#9CA3AF"}}),r.jsx(Qs,{label:"Details",sx:{textTransform:"none",color:"#9CA3AF"}}),r.jsx(Qs,{label:"Settings",sx:{textTransform:"none",color:"#9CA3AF"}})]})}),p===0&&r.jsxs(E,{children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:3},children:[r.jsx(C,{variant:"h6",sx:{fontWeight:600},children:"Course Content"}),r.jsx(ye,{variant:"contained",startIcon:r.jsx(Br,{}),onClick:()=>{R(null),S(""),A(""),b(!0)},sx:os,children:"Add Module"})]}),o.length===0?r.jsxs(Je,{sx:{p:6,textAlign:"center",bgcolor:"#1A2230",border:"1px dashed #374151",borderRadius:2},children:[r.jsx(hr,{sx:{fontSize:60,color:"#374151",mb:2}}),r.jsx(C,{sx:{color:"#9CA3AF",mb:2},children:"No modules yet."})]}):r.jsx(G,{spacing:2,children:o.map(Se=>r.jsx(Je,{sx:{bgcolor:"#1A2230",overflow:"hidden",border:"1px solid #374151",borderRadius:2},children:r.jsxs(Fu,{disableGutters:!0,sx:{bgcolor:"transparent",boxShadow:"none","&:before":{display:"none"}},children:[r.jsx(Lu,{expandIcon:r.jsx(ti,{sx:{color:"#9CA3AF"}}),children:r.jsxs(G,{direction:"row",alignItems:"center",sx:{width:"100%",mr:2},children:[r.jsxs(E,{sx:{flexGrow:1},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600},children:Se.title}),Se.description&&r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem"},children:Se.description})]}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,onClick:Ke=>Ke.stopPropagation(),children:[r.jsx(IS,{size:"small",checked:!!Se.is_published,onChange:()=>ge(Se.id,Se.is_published),color:"success"}),r.jsx(Ve,{size:"small",sx:{color:"#3B82F6"},onClick:()=>{R(Se.id),S(Se.title),A(Se.description||""),b(!0)},children:r.jsx(Ws,{fontSize:"small"})}),r.jsx(Ve,{size:"small",sx:{color:"#EF4444"},onClick:()=>oe(Se.id),children:r.jsx(ss,{fontSize:"small"})})]})]})}),r.jsx(_u,{sx:{bgcolor:"#111827",borderTop:"1px solid #374151",p:0},children:r.jsxs(Hs,{children:[Se.lessons&&Se.lessons.map(Ke=>r.jsx(Ii,{disablePadding:!0,secondaryAction:r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,children:[r.jsx(IS,{size:"small",checked:!!Ke.published_at,onChange:()=>X(Se.id,Ke.id,!!Ke.published_at),color:"success"}),r.jsx(Ve,{size:"small",sx:{color:"#EF4444"},onClick:()=>ee(Ke.id),children:r.jsx(ss,{fontSize:"small"})})]}),children:r.jsxs(Jo,{children:[r.jsx(Tl,{sx:{color:"#9CA3AF",minWidth:40},children:Be(Ke.type)}),r.jsx(Js,{primary:r.jsx(C,{sx:{color:"#E5E7EB",fontSize:"0.9rem"},children:Ke.title}),secondary:r.jsxs(C,{sx:{color:"#6B7280",fontSize:"0.8rem"},children:[Ke.type," • ",Ke.duration||0,"m"]})})]})},Ke.id)),(!Se.lessons||Se.lessons.length===0)&&r.jsx(Ii,{children:r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.85rem",p:1,width:"100%",textAlign:"center"},children:"No lessons yet"})}),r.jsx(Ii,{children:r.jsx(ye,{fullWidth:!0,startIcon:r.jsx(Br,{}),onClick:()=>de(Se.id),sx:{color:"#3B82F6",bgcolor:"rgba(59, 130, 246, 0.05)","&:hover":{bgcolor:"rgba(59, 130, 246, 0.1)"}},children:"Add Lesson"})})]})})]})},Se.id))})]}),p===1&&r.jsxs(E,{children:[r.jsx(C,{variant:"h6",sx:{fontWeight:600,mb:3},children:"Course Details"}),r.jsxs(G,{spacing:3,children:[r.jsxs(Je,{sx:{...Wr,padding:2},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Thumbnail"}),Re?r.jsx(E,{component:"img",src:Ru(n.thumbnail_url),sx:{width:"100%",maxWidth:400,borderRadius:1}}):r.jsx(E,{sx:{width:"100%",maxWidth:400,aspectRatio:"1 / 1",bgcolor:"#000000",borderRadius:1}})]}),r.jsxs(Je,{sx:{...Wr,padding:3},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:2},children:"Basic Info"}),r.jsxs(G,{spacing:2,children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Title"}),r.jsx(C,{sx:{color:"#fff"},children:n.title})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Slug"}),r.jsx(C,{sx:{color:"#9CA3AF"},children:n.slug||"-"})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Summary"}),r.jsx(C,{sx:{color:"#9CA3AF"},children:n.summary||"-"})]}),n.description&&r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Description"}),r.jsx(C,{sx:{color:"#9CA3AF"},dangerouslySetInnerHTML:{__html:n.description}})]})]})]}),r.jsxs(Je,{sx:{...Wr,padding:3},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:2},children:"Attributes"}),r.jsxs(E,{sx:{display:"flex",gap:4,flexWrap:"wrap"},children:[r.jsxs(E,{children:[r.jsxs(G,{direction:"row",spacing:1,alignItems:"center",children:[r.jsx(hr,{sx:{fontSize:16,color:"#6B7280"}}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Level"})]}),r.jsx(C,{sx:{color:"#fff"},children:n.level||"-"})]}),r.jsxs(E,{children:[r.jsxs(G,{direction:"row",spacing:1,alignItems:"center",children:[r.jsx(mg,{sx:{fontSize:16,color:"#6B7280"}}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Language"})]}),r.jsx(C,{sx:{color:"#fff"},children:n.language||"-"})]}),r.jsxs(E,{children:[r.jsxs(G,{direction:"row",spacing:1,alignItems:"center",children:[r.jsx(jz,{sx:{fontSize:16,color:"#6B7280"}}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Duration"})]}),r.jsxs(C,{sx:{color:"#fff"},children:[n.duration_minutes||0," min"]})]}),r.jsxs(E,{children:[r.jsxs(G,{direction:"row",spacing:1,alignItems:"center",children:[r.jsx(a1,{sx:{fontSize:16,color:"#6B7280"}}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Price"})]}),r.jsx(C,{sx:{color:"#fff"},children:Te(n.price,n.currency)})]})]})]})]})]}),p===2&&r.jsxs(E,{children:[r.jsx(C,{variant:"h6",sx:{fontWeight:600,mb:3},children:"Course Settings"}),r.jsxs(G,{spacing:3,children:[r.jsxs(Je,{sx:{...Wr,padding:3},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:2},children:"Publication"}),r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#fff",fontWeight:500},children:n.published_at?"Published":"Draft"}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.85rem"},children:n.published_at?"Visible to students":"Hidden from students"})]}),r.jsx(ye,{variant:"contained",color:n.published_at?"warning":"success",onClick:ve,startIcon:r.jsx(W0,{}),children:n.published_at?"Unpublish":"Publish"})]})]}),r.jsxs(Je,{sx:{...Wr,padding:3},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:2},children:"Approval Status"}),r.jsxs(G,{direction:"row",spacing:2,children:[r.jsx(ye,{variant:"contained",color:"success",onClick:st,startIcon:r.jsx(fr,{}),children:"Approve Course"}),r.jsx(ye,{variant:"outlined",color:"error",onClick:()=>V(!0),startIcon:r.jsx(Hee,{}),children:"Reject Course"})]})]}),r.jsxs(Je,{sx:{bgcolor:"rgba(239, 68, 68, 0.05)",p:3,borderRadius:2,border:"1px solid rgba(239, 68, 68, 0.3)"},children:[r.jsx(C,{sx:{color:"#EF4444",fontSize:"0.85rem",mb:2},children:"Danger Zone"}),r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#fff",fontWeight:500},children:"Delete Course"}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.85rem"},children:"Irreversible action"})]}),r.jsx(ye,{variant:"outlined",color:"error",onClick:qe,startIcon:r.jsx(ss,{}),children:"Delete"})]})]})]})]}),r.jsx(tr,{open:x,onClose:()=>b(!1),children:r.jsxs(E,{sx:kr,children:[r.jsx(C,{variant:"h6",sx:{color:"#fff",mb:2},children:M?"Edit Module":"Add Module"}),r.jsxs(G,{spacing:2,children:[r.jsx(it,{label:"Title",fullWidth:!0,value:y,onChange:Se=>S(Se.target.value),sx:xt}),r.jsx(it,{label:"Description",fullWidth:!0,multiline:!0,rows:3,value:j,onChange:Se=>A(Se.target.value),sx:xt}),r.jsxs(E,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:2},children:[r.jsx(ye,{onClick:()=>b(!1),sx:{color:"#9CA3AF"},children:"Cancel"}),r.jsx(ye,{variant:"contained",onClick:ce,disabled:d,sx:os,children:"Save"})]})]})]})}),r.jsx(tr,{open:_,onClose:()=>z(!1),children:r.jsxs(E,{sx:kr,children:[r.jsx(C,{variant:"h6",sx:{color:"#fff",mb:2},children:"Add Lesson"}),r.jsxs(G,{spacing:2,children:[r.jsx(it,{label:"Lesson Title",fullWidth:!0,value:I,onChange:Se=>B(Se.target.value),sx:xt}),r.jsxs(Ur,{fullWidth:!0,children:[r.jsx(rs,{sx:{color:"#9CA3AF"},children:"Type"}),r.jsxs(Fn,{value:H,onChange:Se=>P(Se.target.value),sx:Yn,MenuProps:Tr,label:"Type",children:[r.jsx(It,{value:"video",children:"Video"}),r.jsx(It,{value:"text",children:"Text/Article"}),r.jsx(It,{value:"document",children:"File Attachment"})]})]}),(H==="video"||H==="document")&&r.jsxs(E,{sx:{border:"1px dashed #374151",p:2,borderRadius:1,textAlign:"center"},children:[r.jsx("input",{type:"file",id:"lesson-file-upload",style:{display:"none"},onChange:Se=>{const Ke=Se.target.files[0];Ke&&(q(Ke),Y(Ke.name))}}),r.jsx("label",{htmlFor:"lesson-file-upload",children:r.jsx(ye,{component:"span",startIcon:r.jsx(Bu,{}),sx:{color:"#3B82F6"},children:K||"Upload File"})})]}),H==="text"&&r.jsx(it,{label:"Content",fullWidth:!0,multiline:!0,rows:4,value:k,onChange:Se=>L(Se.target.value),sx:xt}),r.jsx(it,{label:"Duration (minutes)",type:"number",fullWidth:!0,value:O,onChange:Se=>W(Se.target.value),sx:xt}),r.jsxs(E,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:2},children:[r.jsx(ye,{onClick:()=>z(!1),sx:{color:"#9CA3AF"},children:"Cancel"}),r.jsx(ye,{variant:"contained",onClick:le,disabled:d,sx:os,children:"Create"})]})]})]})}),r.jsx(tr,{open:ie,onClose:()=>V(!1),children:r.jsxs(E,{sx:kr,children:[r.jsx(C,{variant:"h6",sx:{color:"#fff",mb:2},children:"Reject Course"}),r.jsx(it,{label:"Reason for rejection",fullWidth:!0,multiline:!0,rows:3,value:re,onChange:Se=>fe(Se.target.value),sx:xt}),r.jsxs(E,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:2},children:[r.jsx(ye,{onClick:()=>V(!1),sx:{color:"#9CA3AF"},children:"Cancel"}),r.jsx(ye,{variant:"contained",color:"error",onClick:Ge,disabled:d,children:"Reject"})]})]})}),r.jsx(gs,{open:ae.open,autoHideDuration:4e3,onClose:()=>ue({...ae,open:!1}),children:r.jsx(Wt,{severity:ae.severity,sx:{width:"100%"},onClose:()=>ue({...ae,open:!1}),children:ae.message})})]})},vye=()=>{const[e,t]=v.useState(!0),[n,s]=v.useState([]),[o,a]=v.useState(0),[l,u]=v.useState(!1),[d,f]=v.useState({open:!1,message:"",severity:"success"}),[p,g]=v.useState(!1),[x,b]=v.useState(null),[y,S]=v.useState(""),j=["pending","approved","rejected"],A=async()=>{try{t(!0);const z=j[o],F=await Dr.listPriceChanges({status:z,with_course:1});s((F?.data||F)??[])}catch(z){console.error("Failed to fetch requests:",z),f({open:!0,message:"Failed to load requests",severity:"error"})}finally{t(!1)}};v.useEffect(()=>{A()},[o]);const M=async z=>{try{u(!0),await Dr.approvePriceChange(z),f({open:!0,message:"Request approved successfully",severity:"success"}),A()}catch(F){f({open:!0,message:F.message||"Failed to approve request",severity:"error"})}finally{u(!1)}},R=async z=>{try{u(!0),await Dr.rejectPriceChange(z,"Price change rejected by administrator."),f({open:!0,message:"Request rejected",severity:"success"}),A()}catch(F){f({open:!0,message:F.message||"Failed to reject request",severity:"error"})}finally{u(!1)}},_=async()=>{if(!y){f({open:!0,message:"Please provide a reason",severity:"warning"});return}try{u(!0),await Dr.rejectPriceChange(x.id,y),f({open:!0,message:"Request rejected",severity:"success"}),g(!1),S(""),A()}catch(z){f({open:!0,message:z.message||"Failed to reject request",severity:"error"})}finally{u(!1)}};return r.jsxs(E,{sx:{p:{xs:2,md:4},bgcolor:"#0C1322",minHeight:"calc(100vh - 70px)",width:"100%"},children:[r.jsxs(E,{sx:{mb:4},children:[r.jsx(C,{variant:"h4",sx:{color:"#fff",fontWeight:700,mb:1},children:"Certificate Price Changes"}),r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF"},children:"Review and manage certificate price change requests from tutors."})]}),r.jsxs(Zg,{value:o,onChange:(z,F)=>a(F),sx:{mb:3,"& .MuiTab-root":{color:"#9CA3AF",textTransform:"none"},"& .Mui-selected":{color:"#fff !important"},"& .MuiTabs-indicator":{bgcolor:"#1152D4"}},children:[r.jsx(Qs,{label:"Pending"}),r.jsx(Qs,{label:"Approved"}),r.jsx(Qs,{label:"Rejected"})]}),r.jsx(ko,{component:Je,sx:{bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151"},children:r.jsxs(Eo,{children:[r.jsx(Mo,{children:r.jsxs(Bt,{children:[r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151"},children:"Course Name"}),r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151"},children:"Old Price"}),r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151"},children:"New Price"}),r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151"},children:"Reason"}),r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151"},children:"Requested At"}),o===0&&r.jsx(je,{align:"right",sx:{color:"#9CA3AF",borderBottom:"1px solid #374151"},children:"Actions"})]})}),r.jsx(To,{children:e?r.jsx(Bt,{children:r.jsx(je,{colSpan:6,align:"center",sx:{py:8},children:r.jsx(nn,{})})}):!Array.isArray(n)||n.length===0?r.jsx(Bt,{children:r.jsx(je,{colSpan:6,align:"center",sx:{py:8,color:"#9CA3AF"},children:"No requests found."})}):n.map(z=>r.jsxs(Bt,{children:[r.jsx(je,{sx:{color:"#fff",borderBottom:"1px solid #374151"},children:r.jsx(C,{variant:"body2",sx:{fontWeight:600},children:z.course?.title||z.course_title||`ID: ${z.course_id}`})}),r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151"},children:Ko(z.old_amount,z.old_currency)}),r.jsx(je,{sx:{color:"#fff",fontWeight:600,borderBottom:"1px solid #374151"},children:Ko(z.new_amount,z.new_currency)}),r.jsx(je,{sx:{color:"#9CA3AF",maxWidth:300,borderBottom:"1px solid #374151"},children:z.reason}),r.jsx(je,{sx:{color:"#9CA3AF",borderBottom:"1px solid #374151"},children:z.requested_at?new Date(z.requested_at).toLocaleDateString():"-"}),o===0&&r.jsx(je,{align:"right",sx:{borderBottom:"1px solid #374151"},children:r.jsxs(G,{direction:"row",spacing:1,justifyContent:"flex-end",children:[r.jsx(ye,{size:"small",variant:"contained",color:"success",onClick:()=>M(z.id),disabled:l,sx:{textTransform:"none",bgcolor:"#10B981","&:hover":{bgcolor:"#059669"}},children:"Approve"}),r.jsx(ye,{size:"small",variant:"outlined",color:"error",onClick:()=>R(z.id),disabled:l,sx:{textTransform:"none",borderColor:"#EF4444",color:"#EF4444"},children:"Quick Reject"}),r.jsx(ye,{size:"small",variant:"outlined",onClick:()=>{b(z),g(!0)},disabled:l,sx:{textTransform:"none",borderColor:"#9CA3AF",color:"#9CA3AF"},children:"Reject..."})]})})]},z.id))})]})}),r.jsx(tr,{open:p,onClose:()=>!l&&g(!1),children:r.jsxs(E,{sx:kr,children:[r.jsxs(E,{sx:{bgcolor:"#EF4444",p:3,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600},children:"Reject Price Change"}),r.jsx(Ve,{onClick:()=>g(!1),sx:{color:"#fff"},disabled:l,children:r.jsx(hs,{})})]}),r.jsxs(E,{sx:{p:3},children:[r.jsxs(C,{sx:{color:"#fff",fontWeight:600,mb:1},children:["Course: ",x?.course?.title||x?.course_title||`ID: ${x?.course_id}`]}),r.jsx(C,{sx:{color:"#E5E7EB",mb:2},children:"Provide a reason for rejecting this request."}),r.jsx(it,{fullWidth:!0,multiline:!0,rows:4,placeholder:"e.g. Price increase is too significant...",value:y,onChange:z=>S(z.target.value),sx:xt}),r.jsxs(G,{direction:"row",spacing:2,justifyContent:"flex-end",sx:{mt:3},children:[r.jsx(ye,{onClick:()=>g(!1),sx:{color:"#9CA3AF"},disabled:l,children:"Cancel"}),r.jsx(ye,{variant:"contained",sx:{bgcolor:"#EF4444","&:hover":{bgcolor:"#DC2626"}},onClick:_,disabled:l,children:l?r.jsx(nn,{size:24,color:"inherit"}):"Reject Request"})]})]})]})}),r.jsx(gs,{open:d.open,autoHideDuration:6e3,onClose:()=>f({...d,open:!1}),children:r.jsx(Wt,{severity:d.severity,sx:{width:"100%"},children:d.message})})]})},SM={path:"/admin",element:r.jsx(Tne,{}),children:[{index:!0,element:r.jsx(_he,{})},{path:"users",children:[{index:!0,element:r.jsx(wi,{to:"staff",replace:!0})},{path:"staff",element:r.jsx(Phe,{})},{path:"learners",element:r.jsx(Dhe,{})},{path:"tutors",element:r.jsx(Hhe,{})},{path:"reviewers",element:r.jsx(Whe,{})}]},{path:"content",children:[{index:!0,element:r.jsx(wi,{to:"essential-courses",replace:!0})},{path:"essential-courses",element:r.jsx(Xhe,{})},{path:"essential-courses/create",element:r.jsx(hye,{})},{path:"courses",element:r.jsx(Vhe,{})},{path:"courses/:courseId",element:r.jsx(yye,{})},{path:"lessons-by-admin",element:r.jsx(gye,{})},{path:"lessons",element:r.jsx(wi,{to:"/admin/content/lessons-by-admin",replace:!0})},{path:"categories",element:r.jsx(mye,{})},{path:"price-changes",element:r.jsx(vye,{})}]},{path:"settings",element:r.jsx(xye,{})},{path:"kycreview",element:r.jsx(bye,{})}]},Cp=260,Sye=({mobileOpen:e=!1,onDrawerClose:t=()=>{}})=>{const n=Nr(),s=Dn(),o=On(),a=Yu(o.breakpoints.down("md")),[l,u]=Er.useState(""),{logout:d}=ps(),f=[{path:"/tutor",label:"Dashboard",icon:r.jsx(rz,{sx:{fontSize:22}})},{label:"Courses",icon:r.jsx(AC,{sx:{fontSize:22}}),children:[{path:"/tutor/courses",label:"My Courses"},{path:"/tutor/create-course",label:"Create Course"}]},{path:"/tutor/assignments",label:"Assignments",icon:r.jsx(H0,{sx:{fontSize:22}})},{path:"/tutor/profile",label:"Profile",icon:r.jsx(PS,{sx:{fontSize:22}})}],p=b=>b==="/tutor"?n.pathname==="/tutor":n.pathname.startsWith(b),g=b=>{b.children?u(l===b.label?"":b.label):(s(b.path),a&&t())},x=r.jsxs(E,{sx:{width:Cp,minWidth:Cp,maxWidth:Cp,bgcolor:"#0F1729",borderRight:"1px solid #1F2937",display:"flex",flexDirection:"column",height:"100%",overflowX:"hidden"},children:[r.jsx(E,{sx:{p:2.5},children:r.jsxs(G,{component:yn,to:"/",direction:"row",alignItems:"center",spacing:1.5,sx:{textDecoration:"none"},children:[r.jsx(E,{component:"img",src:"/src/assets/images/Integritas Hub_icon.png",alt:"Integritas Hub Logo",sx:{height:50,width:50}}),r.jsxs(E,{children:[r.jsx(C,{sx:{fontSize:"0.875rem",fontWeight:600,color:"#FFFFFF",lineHeight:1.2},children:"Integritas Hub"}),r.jsx(C,{sx:{fontSize:"0.75rem",color:"#6B7280"},children:"Tutor Portal"})]})]})}),r.jsx(E,{sx:{flex:1,py:2,overflow:"auto"},children:r.jsx(Hs,{sx:{px:0},children:f.map(b=>r.jsxs(Er.Fragment,{children:[r.jsx(Ii,{disablePadding:!0,sx:{mb:.5},children:r.jsxs(Jo,{onClick:()=>g(b),sx:{borderRadius:1.5,py:1.5,px:2,bgcolor:b.path&&p(b.path)||b.children&&l===b.label?"#1152D4":"transparent","&:hover":{bgcolor:b.path&&p(b.path)||b.children&&l===b.label?"#1152D4":"rgba(17, 82, 212, 0.1)"},justifyContent:"space-between"},children:[r.jsxs(E,{sx:{display:"flex",alignItems:"center"},children:[r.jsx(Tl,{sx:{minWidth:40,color:b.path&&p(b.path)||b.children&&l===b.label?"#FFFFFF":"#6B7280"},children:b.icon}),r.jsx(Js,{primary:b.label,primaryTypographyProps:{fontSize:"0.9rem",fontWeight:b.path&&p(b.path)||b.children&&l===b.label?600:400,color:b.path&&p(b.path)||b.children&&l===b.label?"#FFFFFF":"#9CA3AF"}})]}),b.children&&(l===b.label?r.jsx(em,{sx:{color:"#fff"}}):r.jsx(ti,{sx:{color:"#9CA3AF"}}))]})}),b.children&&r.jsx(Al,{in:l===b.label,timeout:"auto",unmountOnExit:!0,children:r.jsx(Hs,{component:"div",disablePadding:!0,children:b.children.map(y=>r.jsx(Jo,{onClick:()=>g(y),sx:{pl:9,borderRadius:1.5,mb:.5,bgcolor:p(y.path)?"rgba(17, 82, 212, 0.15)":"transparent","&:hover":{bgcolor:p(y.path)?"rgba(17, 82, 212, 0.15)":"rgba(17, 82, 212, 0.05)"}},children:r.jsx(Js,{primary:y.label,primaryTypographyProps:{fontSize:"0.85rem",color:p(y.path)?"#1152D4":"#9CA3AF",fontWeight:p(y.path)?600:400}})},y.label))})})]},b.label))})}),r.jsx(E,{sx:{p:2,borderTop:"1px solid #1F2937"},children:r.jsx(ye,{fullWidth:!0,variant:"outlined",startIcon:r.jsx(cz,{}),onClick:async()=>{await d(),s("/login"),a&&t()},sx:{borderColor:"#374151",color:"#EF4444",textTransform:"none",py:1.25,fontSize:"0.9rem","&:hover":{borderColor:"#EF4444",bgcolor:"rgba(239, 68, 68, 0.1)"}},children:"Logout"})})]});return r.jsxs(r.Fragment,{children:[r.jsx(Ou,{variant:"temporary",open:e,onClose:t,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:Cp,bgcolor:"#0F1729",border:"none",overflowX:"hidden"}},children:x}),r.jsx(Ou,{variant:"permanent",sx:{display:{xs:"none",md:"block"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:Cp,bgcolor:"#0F1729",border:"none",borderRight:"1px solid #1F2937",overflowX:"hidden"}},open:!0,children:x})]})},jye=({title:e="Dashboard",searchPlaceholder:t="Search...",user:n={name:"User",initials:"U"},notificationCount:s=0,showSearch:o=!0,onDrawerToggle:a=()=>{},kycStatus:l="approved"})=>{const u=On(),d=Yu(u.breakpoints.down("md")),{isDark:f,toggleThemeMode:p}=Fl(),[g,x]=v.useState(""),b=y=>{switch(y){case"approved":return"#10B981";case"pending":case"submitted":return"#F59E0B";case"rejected":return"#EF4444";default:return"#9CA3AF"}};return r.jsxs(E,{sx:{height:70,bgcolor:"#0F1729",borderBottom:"1px solid #1F2937",display:"flex",alignItems:"center",justifyContent:"space-between",px:{xs:2,md:4},overflow:"hidden"},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:{xs:1,md:3},children:[r.jsx(Ve,{onClick:a,sx:{display:{xs:"flex",md:"none"},color:"#FFFFFF",mr:1},children:r.jsx(tm,{})}),r.jsx(C,{sx:{color:"#FFFFFF",fontWeight:600,fontSize:{xs:"1rem",md:"1.1rem"}},children:e}),o&&!d&&r.jsxs(E,{sx:{bgcolor:"#1F2937",borderRadius:1,px:2,display:{xs:"none",sm:"flex"},alignItems:"center",gap:1,width:"260px",height:"40px"},children:[r.jsx(to,{sx:{color:"#9CA3AF",fontSize:20}}),r.jsx(sr,{placeholder:"Search courses",value:g,onChange:y=>x(y.target.value),sx:{color:"#FFFFFF",fontSize:"0.9rem",width:"100%","& input":{border:"none",outline:"none","&:focus":{border:"none",outline:"none"}}}})]})]}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(Ve,{onClick:p,sx:{color:"#6B7280","&:hover":{color:"#FFFFFF",bgcolor:"rgba(255,255,255,0.05)"}},children:f?r.jsx(Mf,{fontSize:"small"}):r.jsx(Tf,{fontSize:"small"})}),!d&&r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:1.5,bgcolor:"rgba(255, 255, 255, 0.03)",px:1.5,py:.75,borderRadius:"50px",border:"1px solid #1F2937",mr:1},children:[r.jsx(E,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:b(l),boxShadow:`0 0 8px ${b(l)}`}}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.75rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px"},children:l==="submitted"?"Pending Verification":l})]}),r.jsx(Ve,{sx:{color:"#6B7280","&:hover":{bgcolor:"rgba(255,255,255,0.05)"}},children:r.jsx(mC,{badgeContent:s,color:"error",children:r.jsx(dz,{sx:{fontSize:24}})})}),r.jsx(yr,{src:n.avatar,sx:{width:40,height:40,bgcolor:"#1152D4",cursor:"pointer",fontSize:"0.9rem",fontWeight:600,ml:1},children:n.initials})]})]})},jM=260,Cye=()=>{const e=On(),{user:t,getKycStatus:n,updateUser:s}=ps();Yu(e.breakpoints.down("md"));const[o,a]=v.useState(!1),[l,u]=v.useState(n()||"draft");v.useEffect(()=>{(async()=>{try{const x=await yl.getKyc();x?.status&&(u(x.status),s({kyc_status:x.status}))}catch(x){console.warn("Failed to fetch KYC status:",x)}})()},[]);const d=()=>{a(!o)},f=()=>{a(!1)},p={name:t?.name||"Tutor",initials:t?.name?t.name.split(" ").map(g=>g[0]).join("").toUpperCase():"T",avatar:t?.avatar};return r.jsxs(E,{sx:{display:"flex",minHeight:"100vh",bgcolor:"#0C1322",overflowX:"hidden"},children:[r.jsx(Sye,{mobileOpen:o,onDrawerClose:f}),r.jsxs(E,{sx:{marginLeft:{xs:0,md:`${jM}px`},width:{xs:"100%",md:`calc(100% - ${jM}px)`},display:"flex",flexDirection:"column",minHeight:"100vh",overflowX:"hidden"},children:[r.jsx(E,{sx:{position:"sticky",top:0,zIndex:100},children:r.jsx(jye,{title:"Tutor Dashboard",searchPlaceholder:"Search courses or students...",user:p,notificationCount:3,onDrawerToggle:d,kycStatus:l})}),r.jsx(E,{sx:{flex:1,overflowX:"hidden",overflowY:"auto"},children:r.jsx(Fj,{})})]})]})},wye=e=>{if(!e)return"Recently";const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4),s=Math.floor(n/60),o=Math.floor(s/24);return o>0?`${o}d ago`:s>0?`${s}h ago`:n>0?`${n}m ago`:"Just now"},Aye=()=>{const e=Dn(),{user:t,isKycComplete:n}=ps(),s=v.useRef(null),[o,a]=v.useState(0),[l,u]=v.useState([]),[d,f]=v.useState(null),[p,g]=v.useState(!0),[x,b]=v.useState(0),[y,S]=v.useState([]),[j,A]=v.useState(0),[M,R]=v.useState(null);v.useEffect(()=>{(async()=>{g(!0);try{const[I,B,H]=await Promise.allSettled([vs.listCourses({per_page:20}),yl.getKyc(),vs.listCourses({status:"pending_review",per_page:5})]);if(I.status==="fulfilled"){const P=I.value.data||[];u(P.slice(0,5));const k=P.reduce((O,W)=>O+(W.students_count||0),0);b(k);const L=P.filter(O=>O.completion_rate!=null||O.completion_percentage!=null);if(L.length>0){const O=L.reduce((W,D)=>W+Number(D.completion_rate??D.completion_percentage??0),0)/L.length;R(Math.round(O))}}if(B.status==="fulfilled"){const P=B.value.data||B.value;f(P?.status||"pending")}else f(t?.kyc_status||"pending");if(H.status==="fulfilled"){const P=H.value.data||[],k=H.value.meta?.total??P.length;A(k);const L=P.slice(0,3).map((O,W)=>({id:O.id||W,title:O.title||"Untitled Course",student:O.submitted_by?.name||O.tutor?.name||"Awaiting Review",time:wye(O.submitted_at||O.updated_at||O.created_at),type:"Course",typeColor:"#374151"}));L.length>0&&S(L)}}catch(I){console.error("Dashboard fetch error:",I)}finally{g(!1)}})();const N=()=>{s.current&&a(s.current.offsetWidth)};return N(),window.addEventListener("resize",N),()=>window.removeEventListener("resize",N)},[t]);const _=[{label:"Total Enrolled",value:x.toLocaleString(),change:"12%",changeType:"positive",icon:c8},{label:"Pending Reviews",value:j>0?j.toString():"0",sublabel:j>0?"Needs Action":"All clear",sublabelColor:j>0?"#F59E0B":"#10B981",icon:Tte},{label:"Course Completion Rate",value:M!==null?`${M}%`:"N/A",...M!==null?{change:"1%",changeType:"positive"}:{},icon:Jg}],z=!n()&&(!d||d==="pending"||d==="rejected"||d==="draft");return p?r.jsx(E,{sx:{p:4,bgcolor:"#0C1322",minHeight:"calc(100vh - 70px)",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx(nn,{})}):r.jsxs(E,{sx:{p:4,bgcolor:"#0C1322",minHeight:"calc(100vh - 70px)"},children:[z&&r.jsxs(Wt,{severity:"warning",sx:{mb:4,cursor:"pointer",bgcolor:"rgba(245, 158, 11, 0.1)",color:"#FCD34D",border:"1px solid rgba(245, 158, 11, 0.2)","& .MuiAlert-icon":{color:"#F59E0B"},"&:hover":{bgcolor:"rgba(245, 158, 11, 0.15)"}},onClick:()=>e("/tutor/kyc"),children:[r.jsx(sV,{sx:{fontWeight:600},children:"Action Required: Teacher Verification"}),d==="rejected"?"Your previous KYC submission was rejected. Please review and resubmit.":"Please complete your KYC verification to start creating courses and accepting students.",r.jsx("strong",{children:" Click here to complete now."})]}),r.jsxs(E,{sx:{mb:3},children:[r.jsxs(C,{sx:{fontWeight:700,color:"#FFFFFF",fontSize:{xs:"1.5rem",md:"1.75rem"},mb:.5},children:["Welcome back, ",t?.first_name?`Tutor ${t.first_name}`:"Tutor"]}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.95rem"},children:"Here is an overview of your courses and student performance today."})]}),r.jsx(E,{sx:{display:"flex",flexWrap:"wrap",gap:3,mb:4,width:"100%"},children:_.map((F,N)=>r.jsx(E,{sx:{flex:{xs:"1 1 100%",sm:"1 1 calc(50% - 12px)",md:"1 1 calc(33.33% - 16px)"},minWidth:0},children:r.jsxs(Je,{sx:{bgcolor:"#1A2230",p:3,borderRadius:2,border:"1px solid #374151",minHeight:120,height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.9rem",fontWeight:500},children:F.label}),r.jsx(E,{sx:{bgcolor:"#0C1322",borderRadius:1.5,p:1,display:"flex",alignItems:"center",justifyContent:"center"},children:r.jsx(F.icon,{sx:{fontSize:22,color:"#6B7280"}})})]}),r.jsxs(G,{direction:"row",alignItems:"baseline",spacing:1.5,sx:{mt:2},children:[r.jsx(C,{sx:{color:"#FFFFFF",fontSize:"2.5rem",fontWeight:700,lineHeight:1},children:F.value}),F.change&&r.jsxs(G,{direction:"row",alignItems:"center",spacing:.25,children:[F.changeType==="positive"?r.jsx(sm,{sx:{fontSize:14,color:"#10B981"}}):r.jsx(Cz,{sx:{fontSize:14,color:"#EF4444"}}),r.jsx(C,{sx:{color:F.changeType==="positive"?"#10B981":"#EF4444",fontSize:"0.75rem",fontWeight:500},children:F.change})]}),F.sublabel&&r.jsx(C,{sx:{color:F.sublabelColor||"#F59E0B",fontSize:"0.75rem",fontWeight:500},children:F.sublabel})]})]})},N))}),r.jsxs(E,{sx:{display:"flex",flexWrap:"wrap",gap:4,mb:4,width:"100%"},children:[r.jsx(E,{sx:{flex:{xs:"1 1 100%",md:"1 1 calc(66.67% - 16px)"},minWidth:0},children:r.jsxs(Je,{sx:{bgcolor:"#1A2230",p:2,borderRadius:2,border:"1px solid #374151",height:{xs:250,md:280},width:"100%",maxWidth:"100%",overflow:"hidden"},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:1},children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#FFFFFF",fontWeight:600,fontSize:"0.85rem"},children:"Learner Engagement"}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.65rem"},children:"Video views and lesson completions (Last 30 Days)"})]}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:.5,children:[r.jsx(C,{sx:{color:"#FFFFFF",fontSize:"1.1rem",fontWeight:700},children:"15.2k"}),r.jsx(C,{sx:{color:"#10B981",fontSize:"0.7rem",fontWeight:500},children:"+14.5%"})]})]}),r.jsx(E,{ref:s,sx:{height:200,mt:1,width:"100%",overflow:"hidden"},children:o>0&&r.jsx(j_,{width:o,height:200,xAxis:[{data:[1,2,3,4,5,6],scaleType:"point",valueFormatter:F=>`WEEK ${F}`,tickLabelStyle:{fill:"#4B5563",fontSize:9,fontWeight:500},disableLine:!0,disableTicks:!0}],yAxis:[{disableLine:!0,disableTicks:!0,tickLabelStyle:{display:"none"}}],series:[{data:[1800,3500,2800,4200,3600,5500],area:!0,color:"#1E90FF",showMark:!1,curve:"natural"}],sx:{"& .MuiLineElement-root":{strokeWidth:2.5,stroke:"#00BFFF"},"& .MuiAreaElement-root":{fill:"url(#areaGradient)"},"& .MuiChartsAxis-line":{display:"none"},"& .MuiChartsAxis-tick":{display:"none"},"& .MuiChartsGrid-line":{stroke:"#1F2937",strokeDasharray:"3 3"}},margin:{left:10,right:10,top:20,bottom:30},slotProps:{legend:{hidden:!0}},children:r.jsx("defs",{children:r.jsxs("linearGradient",{id:"areaGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0%",stopColor:"#1E90FF",stopOpacity:.4}),r.jsx("stop",{offset:"50%",stopColor:"#1E90FF",stopOpacity:.15}),r.jsx("stop",{offset:"100%",stopColor:"#1E90FF",stopOpacity:0})]})})})})]})}),r.jsx(E,{sx:{flex:{xs:"1 1 100%",md:"1 1 calc(33.33% - 16px)"},minWidth:0},children:r.jsxs(Je,{sx:{bgcolor:"#1A2230",p:2,borderRadius:2,border:"1px solid #374151",height:280,display:"flex",flexDirection:"column"},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:1.5},children:[r.jsx(C,{sx:{color:"#FFFFFF",fontWeight:600,fontSize:"0.85rem"},children:"Pending Reviews"}),r.jsx(ye,{size:"small",sx:{color:"#3B82F6",textTransform:"none",fontSize:"0.7rem",p:0},children:"View All"})]}),r.jsxs(G,{spacing:1,sx:{flex:1,overflow:"auto"},children:[y.length===0&&r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.8rem",textAlign:"center",mt:2},children:"No pending reviews"}),y.map(F=>r.jsx(E,{sx:{bgcolor:"#0C1322",borderRadius:1.5,p:1.25},children:r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[r.jsxs(E,{sx:{flex:1,minWidth:0},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:.75,sx:{mb:.25},children:[r.jsx(Pt,{label:F.type,size:"small",sx:{bgcolor:F.typeColor,color:"#FFFFFF",fontSize:"0.55rem",height:16,"& .MuiChip-label":{px:.75}}}),r.jsx(C,{sx:{color:"#FFFFFF",fontWeight:600,fontSize:"0.75rem",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F.title})]}),r.jsxs(C,{sx:{color:"#6B7280",fontSize:"0.65rem"},children:[F.student," • ",F.time]})]}),r.jsx(ye,{size:"small",variant:"contained",sx:{bgcolor:"#1152D4",color:"#FFFFFF",textTransform:"none",fontSize:"0.65rem",px:1.25,py:.5,minWidth:"auto",ml:1,"&:hover":{bgcolor:"#0D41AA"}},children:"Grade Now →"})]})},F.id))]})]})})]}),r.jsxs(E,{children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:1.5},children:[r.jsx(C,{sx:{color:"#FFFFFF",fontWeight:600,fontSize:"0.9rem"},children:"Managed Courses"}),r.jsx(ye,{variant:"contained",startIcon:r.jsx(Br,{sx:{fontSize:16}}),size:"small",onClick:()=>e("/tutor/create-course"),sx:{bgcolor:"#1152D4",color:"#FFFFFF",textTransform:"none",fontSize:"0.75rem",px:2,py:.75,"&:hover":{bgcolor:"#0D41AA"}},children:"Create New"})]}),l.length===0?r.jsxs(Je,{sx:{bgcolor:"#1A2230",p:4,borderRadius:2,border:"1px solid #374151",textAlign:"center"},children:[r.jsx(C,{sx:{color:"#9CA3AF",mb:2},children:"You haven't created any courses yet."}),r.jsx(ye,{variant:"outlined",onClick:()=>e("/tutor/create-course"),sx:{color:"#3B82F6",borderColor:"#3B82F6"},children:"Create your first course"})]}):r.jsx(E,{sx:{display:"flex",flexWrap:"wrap",gap:4},children:l.map(F=>r.jsx(E,{sx:{flex:{xs:"1 1 100%",sm:"1 1 calc(50% - 16px)",md:"1 1 calc(33.33% - 21.33px)"},minWidth:0},children:r.jsxs(Je,{sx:{bgcolor:"#1A2230",borderRadius:2,overflow:"hidden",border:"1px solid #374151",height:"100%",display:"flex",flexDirection:"column"},children:[r.jsx(E,{sx:{height:120,position:"relative",backgroundImage:(()=>{const N=Ru(F.thumbnail_url||F.image_url||F.cover_image_url||F.image);return N?`url(${N})`:"none"})(),backgroundSize:"cover",backgroundPosition:"center",bgcolor:F.thumbnail_url||F.image_url||F.cover_image_url||F.image?"transparent":"#0C1322",display:"flex",alignItems:"center",justifyContent:"center"},children:(F.status==="draft"||F.status==="inactive")&&r.jsx(Pt,{label:F.status,size:"small",sx:{position:"absolute",top:8,right:8,bgcolor:"#F59E0B",color:"#000000",fontWeight:600,fontSize:"0.55rem",height:18}})}),r.jsxs(E,{sx:{p:3,flex:1,display:"flex",flexDirection:"column"},children:[r.jsx(C,{sx:{color:"#FFFFFF",fontWeight:600,fontSize:"1rem",mb:1,lineHeight:1.3},children:F.title}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.85rem",mb:2,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",lineHeight:1.5},children:F.summary||F.description||"No description available."}),r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:2,mt:"auto"},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,children:[r.jsx(c8,{sx:{fontSize:16,color:"#6B7280"}}),r.jsxs(C,{sx:{color:"#9CA3AF",fontSize:"0.8rem"},children:[F.students_count||0," Students"]})]}),F.rating&&r.jsxs(G,{direction:"row",alignItems:"center",spacing:.5,children:[r.jsx(C,{sx:{color:"#F59E0B",fontSize:"0.8rem"},children:"★"}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.8rem"},children:F.rating})]})]}),r.jsx(G,{direction:"row",spacing:.75,children:r.jsx(ye,{fullWidth:!0,variant:"outlined",size:"small",onClick:()=>e(`/tutor/create-course?edit=${F.id}`),sx:{borderColor:"#374151",color:"#FFFFFF",textTransform:"none",fontSize:"0.65rem",py:.5,"&:hover":{borderColor:"#1152D4",bgcolor:"rgba(17, 82, 212, 0.1)"}},children:F.status==="draft"?"Edit Draft":"Manage"})})]})]})},F.id))})]})]})},Eye=()=>{const e=Dn(),[t,n]=v.useState(""),[s,o]=v.useState([]),[a,l]=v.useState(!0),[u,d]=v.useState(null),[f,p]=v.useState({}),[g,x]=v.useState({open:!1,course:null}),[b,y]=v.useState(!1),[S,j]=v.useState({open:!1,message:"",severity:"success"});v.useEffect(()=>{const z=async()=>{l(!0),d(null);try{const[N,I]=await Promise.all([vs.listCourses({q:t}),vs.listPriceChanges({status:"pending"})]);o(N.data||[]);const B={};(I?.data||I||[]).forEach(H=>{B[H.course_id]=H}),p(B)}catch(N){console.error("Failed to fetch data:",N),d("Failed to load data. Please try again.")}finally{l(!1)}},F=setTimeout(()=>{z()},500);return()=>clearTimeout(F)},[t]);const A=z=>{x({open:!0,course:z})},M=()=>{x({open:!1,course:null})},R=async()=>{if(g.course){y(!0);try{await vs.deleteCourse(g.course.id),o(s.filter(z=>z.id!==g.course.id)),j({open:!0,message:"Course deleted successfully!",severity:"success"})}catch(z){console.error("Failed to delete course:",z),j({open:!0,message:z.message||"Failed to delete course. Please try again.",severity:"error"})}finally{y(!1),x({open:!1,course:null})}}},_=z=>{switch(z?z.charAt(0).toUpperCase()+z.slice(1).toLowerCase():"Draft"){case"Published":case"Active":return{color:"#10B981",bg:"rgba(16, 185, 129, 0.15)",icon:r.jsx(fr,{sx:{fontSize:14}})};case"Draft":return{color:"#F59E0B",bg:"rgba(245, 158, 11, 0.15)",icon:r.jsx(rm,{sx:{fontSize:14}})};case"Inactive":case"Archived":return{color:"#EF4444",bg:"rgba(239, 68, 68, 0.15)",icon:r.jsx(_c,{sx:{fontSize:14}})};default:return{color:"#6B7280",bg:"rgba(107, 114, 128, 0.15)",icon:null}}};return r.jsxs(E,{sx:{p:{xs:2,md:4},bgcolor:"#0C1322",minHeight:"calc(100vh - 70px)",width:"100%"},children:[r.jsxs(G,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:2,sx:{mb:4},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h4",sx:{color:"#fff",fontWeight:700,mb:1},children:"My Courses"}),r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF"},children:"Manage and track your course content."})]}),r.jsx(ye,{variant:"contained",startIcon:r.jsx(Br,{}),onClick:()=>e("/tutor/create-course"),sx:{bgcolor:"#1152D4","&:hover":{bgcolor:"#0D42AF"},boxShadow:"0 4px 14px rgba(17, 82, 212, 0.4)"},children:"Create New Course"})]}),r.jsx(Je,{sx:{p:2,mb:4,bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151"},children:r.jsxs(E,{sx:{bgcolor:"#1F2937",borderRadius:1,px:2,display:"flex",alignItems:"center",gap:1,width:"100%",maxWidth:400,height:"40px"},children:[r.jsx(to,{sx:{color:"#9CA3AF",fontSize:20}}),r.jsx(sr,{placeholder:"Search courses...",value:t,onChange:z=>n(z.target.value),sx:{color:"#FFFFFF",fontSize:"0.9rem",width:"100%","& input":{border:"none",outline:"none","&::placeholder":{color:"#6B7280"}}}})]})}),a?r.jsx(E,{sx:{display:"flex",justifyContent:"center",py:8,width:"100%"},children:r.jsx(nn,{sx:{color:"#1152D4"}})}):u?r.jsx(E,{sx:{textAlign:"center",py:8,width:"100%"},children:r.jsx(C,{color:"error",children:u})}):r.jsx(E,{sx:{display:"flex",flexWrap:"wrap",gap:3},children:s.map(z=>{const F=_(z.status),N=z.status?z.status.charAt(0).toUpperCase()+z.status.slice(1).toLowerCase():"Draft";return r.jsx(E,{sx:{flex:{xs:"1 1 100%",sm:"1 1 calc(50% - 12px)",lg:"1 1 calc(33.33% - 16px)"},minWidth:0},children:r.jsxs(Je,{sx:{bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151",overflow:"hidden",height:"100%",display:"flex",flexDirection:"column",transition:"border-color 0.2s, transform 0.2s","&:hover":{borderColor:"#1152D4",transform:"translateY(-2px)"}},children:[r.jsxs(E,{sx:{p:2.5,borderBottom:"1px solid #374151"},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:1.5},children:[r.jsx(E,{sx:{width:44,height:44,borderRadius:1.5,bgcolor:"#1152D4",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},children:z.thumbnail_url?r.jsx("img",{src:Ru(z.thumbnail_url),alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}}):r.jsx(hr,{sx:{color:"#fff",fontSize:22}})}),r.jsx(Pt,{icon:F.icon,label:N,size:"small",sx:{bgcolor:F.bg,color:F.color,fontSize:"0.7rem",height:24,"& .MuiChip-icon":{color:F.color}}})]}),r.jsx(C,{variant:"subtitle1",sx:{fontWeight:600,color:"#fff",mb:.5},children:z.title}),r.jsx(C,{variant:"body2",sx:{color:"#6B7280",fontSize:"0.8rem",mb:1.5,minHeight:40,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:z.summary||z.description||"No description available"}),r.jsx(Pt,{label:z.category?.name||"Uncategorized",size:"small",sx:{bgcolor:"#374151",color:"#9CA3AF",fontSize:"0.7rem",height:22}})]}),r.jsxs(E,{sx:{p:2.5,flex:1},children:[r.jsxs(G,{direction:"row",spacing:3,sx:{mb:2},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:.75,children:[r.jsx(fz,{sx:{color:"#10B981",fontSize:18}}),r.jsx(C,{sx:{color:"#fff",fontWeight:600,fontSize:"0.85rem"},children:z.students_count||0}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"students"})]}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:.75,children:[r.jsx(hr,{sx:{color:"#3B82F6",fontSize:18}}),r.jsx(C,{sx:{color:"#fff",fontWeight:600,fontSize:"0.85rem"},children:z.lessons_count||0}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"lessons"})]}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:.75,children:[r.jsx(a1,{sx:{color:"#F59E0B",fontSize:18}}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600,fontSize:"0.85rem"},children:z.price>0?Ko(z.price,z.currency):"Free"}),f[z.id]&&r.jsx(tn,{title:`Pending Change: ${Ko(f[z.id].new_amount,f[z.id].new_currency)}`,children:r.jsxs(G,{direction:"row",alignItems:"center",spacing:.5,sx:{color:"#3B82F6"},children:[r.jsx(Gp,{sx:{fontSize:12}}),r.jsx(C,{variant:"caption",sx:{fontWeight:600},children:Ko(f[z.id].new_amount,f[z.id].new_currency)})]})})]})]})]}),r.jsxs(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:["Last updated: ",z.updated_at?new Date(z.updated_at).toLocaleDateString():"-"]})]}),r.jsx(E,{sx:{p:2,borderTop:"1px solid #374151",bgcolor:"#0C1322"},children:r.jsxs(G,{direction:"row",spacing:1,children:[r.jsx(tn,{title:"Edit Course",children:r.jsx(Ve,{onClick:()=>e(`/tutor/create-course?edit=${z.id}`),sx:{color:"#3B82F6",bgcolor:"rgba(59, 130, 246, 0.1)","&:hover":{bgcolor:"rgba(59, 130, 246, 0.2)"}},children:r.jsx(Ws,{fontSize:"small"})})}),r.jsx(tn,{title:"View Course",children:r.jsx(Ve,{onClick:()=>e(`/tutor/courses/${z.id}`),sx:{color:"#10B981",bgcolor:"rgba(16, 185, 129, 0.1)","&:hover":{bgcolor:"rgba(16, 185, 129, 0.2)"}},children:r.jsx(Bi,{fontSize:"small"})})}),r.jsx(E,{sx:{flex:1}}),r.jsx(tn,{title:"Delete Course",children:r.jsx(Ve,{onClick:()=>A(z),sx:{color:"#EF4444",bgcolor:"rgba(239, 68, 68, 0.1)","&:hover":{bgcolor:"rgba(239, 68, 68, 0.2)"}},children:r.jsx(ss,{fontSize:"small"})})})]})})]})},z.id)})}),!a&&!u&&s.length===0&&r.jsxs(Je,{sx:{p:6,bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151",textAlign:"center"},children:[r.jsx(hr,{sx:{fontSize:60,color:"#374151",mb:2}}),r.jsx(C,{variant:"h6",sx:{color:"#9CA3AF",mb:1},children:"No courses found"}),r.jsx(C,{variant:"body2",sx:{color:"#6B7280",mb:3},children:t?"Try adjusting your search terms":"Get started by creating your first course"}),!t&&r.jsx(ye,{variant:"contained",startIcon:r.jsx(Br,{}),onClick:()=>e("/tutor/create-course"),sx:{bgcolor:"#1152D4","&:hover":{bgcolor:"#0D42AF"}},children:"Create Your First Course"})]}),r.jsxs(OK,{open:g.open,onClose:M,PaperProps:{sx:{bgcolor:"#1A2230",border:"1px solid #374151",borderRadius:2,minWidth:400}},children:[r.jsx(ZK,{sx:{color:"#fff",borderBottom:"1px solid #374151"},children:"Delete Course"}),r.jsxs(YK,{sx:{py:3},children:[r.jsxs(C,{sx:{color:"#9CA3AF",mb:2},children:["Are you sure you want to delete ",r.jsx("strong",{style:{color:"#fff"},children:g.course?.title}),"?"]}),r.jsx(C,{sx:{color:"#EF4444",fontSize:"0.85rem"},children:"⚠️ This action cannot be undone. All modules and lessons in this course will also be deleted."})]}),r.jsxs(HK,{sx:{px:3,py:2,borderTop:"1px solid #374151"},children:[r.jsx(ye,{onClick:M,sx:{color:"#9CA3AF","&:hover":{bgcolor:"rgba(156, 163, 175, 0.1)"}},children:"Cancel"}),r.jsx(ye,{onClick:R,disabled:b,variant:"contained",sx:{bgcolor:"#EF4444","&:hover":{bgcolor:"#DC2626"},"&:disabled":{bgcolor:"#374151"}},children:b?r.jsx(nn,{size:20,sx:{color:"#fff"}}):"Delete Course"})]})]}),r.jsx(gs,{open:S.open,autoHideDuration:4e3,onClose:()=>j({...S,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:r.jsx(Wt,{onClose:()=>j({...S,open:!1}),severity:S.severity,sx:{width:"100%"},children:S.message})})]})},Tye=()=>{const[e]=v.useState([{id:1,name:"Alice Johnson",email:"alice@example.com",course:"React Fundamentals",progress:75},{id:2,name:"Bob Smith",email:"bob@example.com",course:"Advanced JavaScript",progress:60},{id:3,name:"Carol White",email:"carol@example.com",course:"React Fundamentals",progress:90},{id:4,name:"David Brown",email:"david@example.com",course:"Node.js Basics",progress:30}]);return r.jsxs("div",{className:"students-page",children:[r.jsxs("div",{className:"page-header",children:[r.jsx("h1",{children:"My Students"}),r.jsx("div",{className:"header-actions",children:r.jsx("input",{type:"search",placeholder:"Search students...",className:"search-input"})})]}),r.jsx(Np,{className:"students-table-card",children:r.jsxs("table",{className:"data-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{children:"Name"}),r.jsx("th",{children:"Email"}),r.jsx("th",{children:"Course"}),r.jsx("th",{children:"Progress"}),r.jsx("th",{children:"Actions"})]})}),r.jsx("tbody",{children:e.map(t=>r.jsxs("tr",{children:[r.jsx("td",{children:t.name}),r.jsx("td",{children:t.email}),r.jsx("td",{children:t.course}),r.jsx("td",{children:r.jsxs("div",{className:"progress-bar",children:[r.jsx("div",{className:"progress-fill",style:{width:`${t.progress}%`}}),r.jsxs("span",{className:"progress-text",children:[t.progress,"%"]})]})}),r.jsxs("td",{children:[r.jsx(e1,{size:"small",variant:"outline",children:"View Profile"}),r.jsx(e1,{size:"small",variant:"secondary",children:"Message"})]})]},t.id))})]})})]})},wp=[{label:"Step 1",sublabel:"Basic Details",icon:Qg},{label:"Step 2",sublabel:"Curriculum",icon:uz},{label:"Step 3",sublabel:"Media",icon:hz},{label:"Step 4",sublabel:"Review",icon:bz}],kye=["beginner","intermediate","advanced"],Mye=()=>{const e=Dn(),t=Nr(),n=new URLSearchParams(t.search).get("edit")||null,s=!!n,[o,a]=v.useState(0),[l,u]=v.useState(null),[d,f]=v.useState(!1),[p,g]=v.useState(!1),[x,b]=v.useState({}),[y,S]=v.useState(s),[j,A]=v.useState(!1),[M,R]=v.useState({open:!1,message:"",severity:"success"}),[_,z]=v.useState([]),[F,N]=v.useState(!0),[I,B]=v.useState({title:"",slug:"",summary:"",description:"",level:"beginner",language:"en",price:0,currency:"USD",duration_minutes:0,thumbnail_url:"",category_id:"",status:"draft",is_editable:!0,tags:[],certificate_fee_amount:""}),[H,P]=v.useState(null),[k,L]=v.useState([]),[O,W]=v.useState(null),[D,q]=v.useState(!1),[K,Y]=v.useState({title:"",description:""}),[ie,V]=v.useState(null),[re,fe]=v.useState(!1),[ae,ue]=v.useState(null),[se,J]=v.useState(null),[ce,oe]=v.useState({title:"",type:"video",content:"",duration:0});v.useEffect(()=>{if(!d&&I.title){const Q=I.title.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");B(me=>({...me,slug:Q}))}},[I.title,d]),v.useEffect(()=>{const Q=setTimeout(()=>{I.title&&u(new Date)},2e3);return()=>clearTimeout(Q)},[I]),v.useEffect(()=>{(async()=>{try{N(!0);const me=await vc.getAllCategories(),we=Array.isArray(me)?me:[];z(we)}catch(me){console.error("Error fetching categories:",me),z([])}finally{N(!1)}})()},[]),v.useEffect(()=>{if(!s)return;(async()=>{S(!0);try{const me=await vs.getCourseById(n),we=me?.data??me;B({title:we.title||"",slug:we.slug||"",summary:we.summary||"",description:we.description||"",level:we.level||"beginner",language:we.language||"en",price:we.price??0,currency:we.currency||"NGN",duration_minutes:we.duration_minutes||0,thumbnail_url:we.thumbnail_url||"",category_id:we.categories?.[0]?.id||we.category_id||"",status:we.status||"draft",is_editable:we.is_editable!==!1,tags:we.tags||[],certificate_fee_amount:we.certificate?.fee_amount??""}),f(!0)}catch(me){console.error("Error loading course for editing:",me),R({open:!0,message:"Failed to load course data.",severity:"error"})}finally{S(!1)}})()},[n,s]);const ge=(Q,me)=>{B(we=>({...we,[Q]:me})),x[Q]&&b(we=>({...we,[Q]:null}))},de=Q=>{const me={};return Q===0&&(I.title||(me.title="Course title is required"),I.category_id||(me.category_id="Category is required"),I.summary||(me.summary="Summary is required")),Q===3&&(k.length===0&&(me.modules="At least one module is required"),k.some(et=>et.lessons&&et.lessons.length>0)||(me.lessons="At least one lesson is required")),b(me),Object.keys(me).length===0},le=()=>{de(o)&&a(Q=>Q+1)},ee=()=>{a(Q=>Q-1)},X=()=>{if(K.title){const Q={id:Date.now(),...K,order:k.length,lessons:[]};L([...k,Q]),Y({title:"",description:""}),q(!1)}},ve=Q=>{W(Q),Y({title:Q.title,description:Q.description}),q(!0)},st=()=>{L(k.map(Q=>Q.id===O.id?{...Q,...K}:Q)),W(null),Y({title:"",description:""}),q(!1)},Ge=Q=>{const me=k.find(we=>we.id===Q);me&&(!me.lessons||me.lessons.length===0)&&L(k.filter(we=>we.id!==Q))},qe={title:"",type:"video",content:"",videoUrl:"",videoFile:null,fileName:"",durationHours:0,durationMinutes:0,duration:0},Be=Q=>{J(Q),oe({...qe}),ue(null),fe(!0)},Te=()=>{const Q=String(ce.title||"").trim();if(!Q){R({open:!0,message:"Lesson title is required",severity:"error"});return}if(!String(ce.content||"").replace(/<(.|\n)*?>/g,"").trim()){R({open:!0,message:"Please provide lesson content",severity:"error"});return}const we=String(ce.videoUrl||"").trim();if(we&&!/^https?:\/\//.test(we)){R({open:!0,message:"Video URL must start with http:// or https://",severity:"error"});return}const et=(parseInt(ce.durationHours)||0)*60+(parseInt(ce.durationMinutes)||0),ht={...ce,title:Q,type:"video",videoUrl:we,duration:et};L(k.map(ct=>ct.id===se?ae?{...ct,lessons:ct.lessons.map(bt=>bt.id===ae.id?{...bt,...ht}:bt)}:{...ct,lessons:[...ct.lessons||[],{id:Date.now(),...ht}]}:ct)),fe(!1),oe({...qe})},Re=(Q,me)=>{J(Q),ue(me);const we=parseInt(me.duration)||0;oe({title:me.title||"",type:"video",content:me.content||"",videoUrl:me.videoUrl||"",videoFile:me.videoFile||null,fileName:me.fileName||"",durationHours:Math.floor(we/60),durationMinutes:we%60,duration:we}),fe(!0)},Se=(Q,me)=>{L(k.map(we=>we.id===Q?{...we,lessons:we.lessons.filter(et=>et.id!==me)}:we))},Ke=async(Q=!0)=>{if(!(!Q&&!de(3))){A(!0),g(!1);try{if(s){if(H){const me=new FormData;me.append("title",I.title),me.append("summary",I.summary),I.description&&me.append("description",I.description),me.append("level",I.level),me.append("language",I.language),me.append("duration_minutes",I.duration_minutes||0),I.category_id&&me.append("category_ids[]",I.category_id),me.append("thumbnail",H),await vs.updateCourseMultipart(n,me)}else{const me={title:I.title,summary:I.summary,level:I.level,language:I.language,duration_minutes:I.duration_minutes||0,category_ids:I.category_id?[I.category_id]:[]};I.description&&(me.description=I.description),Array.isArray(I.tags)&&I.tags.length>0&&(me.tags=I.tags),I.certificate_fee_amount!==""&&I.certificate_fee_amount!=null&&(me.certificate_fee_amount=Number(I.certificate_fee_amount)),await vs.updateCourseJson(n,me)}R({open:!0,message:"Course updated successfully!",severity:"success"}),setTimeout(()=>e("/tutor/courses"),1500)}else{let me;if(H){const et=new FormData;et.append("title",I.title),et.append("summary",I.summary),I.description&&et.append("description",I.description),et.append("level",I.level),et.append("language",I.language),et.append("price",I.price||0),et.append("currency",I.currency||"USD"),et.append("duration_minutes",I.duration_minutes||0),I.category_id&&et.append("category_ids[]",I.category_id),et.append("thumbnail",H),me=await vs.createCourseMultipart(et)}else{const et={title:I.title,summary:I.summary,level:I.level,language:I.language,price:I.price||0,currency:I.currency||"USD",duration_minutes:I.duration_minutes||0,category_ids:I.category_id?[I.category_id]:[]};I.description&&(et.description=I.description),me=await vs.createCourseJson(et)}const we=me?.id||me?.data?.id;if(!we)throw new Error("Course was created but no ID was returned");for(let et=0;et<k.length;et++){const ht=k[et],ct=await jf.createModule(we,{title:ht.title,summary:ht.description||""}),bt=ct?.id||ct?.data?.id;if(bt)for(let wt=0;wt<(ht.lessons||[]).length;wt++){const gn=ht.lessons[wt],mn=gn.duration_minutes||gn.duration||0,ut=/^https?:\/\//.test(String(gn.videoUrl||"").trim());if(gn.videoFile){const _t=new FormData;_t.append("title",gn.title),_t.append("type","video"),_t.append("video_file",gn.videoFile),_t.append("content",gn.content||""),mn&&_t.append("duration_minutes",String(mn)),await ra.createLessonMultipart(bt,_t)}else{const _t={title:gn.title,type:"video",content:gn.content||""};mn&&(_t.duration_minutes=mn),ut&&(_t.video_url=String(gn.videoUrl).trim()),await ra.createLesson(bt,_t)}}}R({open:!0,message:Q?"Course saved as draft successfully!":"Course submitted for approval successfully!",severity:"success"}),setTimeout(()=>e("/tutor/courses"),1500)}}catch(me){console.error("Error saving course:",me),R({open:!0,message:me.message||`Failed to ${s?"update":"create"} course. Please try again.`,severity:"error"})}finally{A(!1)}}},ot=Q=>{switch(Q){case"video":return r.jsx(jo,{sx:{fontSize:18}});case"text":case"reading":return r.jsx(Hf,{sx:{fontSize:18}});case"document":case"file":return r.jsx(Ab,{sx:{fontSize:18}});default:return null}},He=()=>r.jsxs(E,{sx:{display:"flex",gap:4,flexWrap:"wrap"},children:[r.jsx(E,{sx:{flex:{xs:"1 1 100%",md:"1 1 55%"},minWidth:0},children:r.jsxs(G,{spacing:3,children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Course Title"}),r.jsx(it,{fullWidth:!0,placeholder:"e.g. Introduction to Public Ethics 101",value:I.title,onChange:Q=>ge("title",Q.target.value),error:!!x.title,helperText:x.title||"Use a clear, catchy title (Max 80 chars)",sx:xt,FormHelperTextProps:{sx:{color:x.title?"#EF4444":"#6B7280"}}})]}),r.jsxs(E,{sx:{display:"flex",gap:2,flexWrap:"wrap"},children:[r.jsxs(E,{sx:{flex:"1 1 45%",minWidth:200},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Category"}),r.jsxs(Fn,{fullWidth:!0,value:I.category_id,onChange:Q=>ge("category_id",Q.target.value),displayEmpty:!0,sx:Yn,error:!!x.category_id,children:[r.jsx(It,{value:"",disabled:!0,children:"Select category"}),_.map(Q=>r.jsx(It,{value:Q.id,children:Q.name},Q.id))]})]}),r.jsxs(E,{sx:{flex:"1 1 45%",minWidth:200},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Course Level"}),r.jsx(Fn,{fullWidth:!0,value:I.level,onChange:Q=>ge("level",Q.target.value),sx:Yn,children:kye.map(Q=>r.jsx(It,{value:Q,sx:{textTransform:"capitalize"},children:Q},Q))})]})]}),r.jsxs(E,{sx:{display:"flex",gap:2,flexWrap:"wrap"},children:[r.jsxs(E,{sx:{flex:"1 1 45%",minWidth:200},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Price"}),r.jsx(it,{fullWidth:!0,type:"number",placeholder:"0.00",value:I.price,onChange:Q=>ge("price",parseFloat(Q.target.value)||0),sx:xt,InputProps:{startAdornment:r.jsx(C,{sx:{color:"#6B7280",mr:1},children:I.currency})}})]}),r.jsxs(E,{sx:{flex:"1 1 45%",minWidth:200},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Currency"}),r.jsxs(Fn,{fullWidth:!0,value:I.currency,onChange:Q=>ge("currency",Q.target.value),sx:Yn,children:[r.jsx(It,{value:"USD",children:"USD ($)"}),r.jsx(It,{value:"NGN",children:"NGN (₦)"}),r.jsx(It,{value:"GBP",children:"GBP (£)"}),r.jsx(It,{value:"EUR",children:"EUR (€)"})]})]})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Short Summary"}),r.jsx(it,{fullWidth:!0,multiline:!0,rows:2,placeholder:"Brief overview of what students will learn...",value:I.summary,onChange:Q=>ge("summary",Q.target.value),error:!!x.summary,sx:xt})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Description"}),r.jsx(E,{sx:{"& .quill":{display:"flex",flexDirection:"column"},"& .ql-toolbar":{bgcolor:"#1E293B",borderColor:"#374151",borderRadius:"6px 6px 0 0","& .ql-stroke":{stroke:"#9CA3AF"},"& .ql-fill":{fill:"#9CA3AF"},"& .ql-picker":{color:"#9CA3AF"},"& .ql-picker-options":{bgcolor:"#1E293B",border:"1px solid #374151"},"& .ql-picker-item:hover":{color:"#fff"},"& button:hover .ql-stroke":{stroke:"#fff"},"& button:hover .ql-fill":{fill:"#fff"},"& button.ql-active .ql-stroke":{stroke:"#1152D4"},"& button.ql-active .ql-fill":{fill:"#1152D4"}},"& .ql-container":{bgcolor:"#0F172A",borderColor:"#374151",borderRadius:"0 0 6px 6px",minHeight:150,fontSize:"0.95rem"},"& .ql-editor":{color:"#fff",minHeight:150,"&.ql-blank::before":{color:"#6B7280",fontStyle:"normal"}}},children:r.jsx(eh,{theme:"snow",value:I.description,onChange:Q=>ge("description",Q),placeholder:"Describe what students will learn in this course...",modules:{toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline","strike"],[{list:"ordered"},{list:"bullet"}],["link"],["clean"]]}})})]})]})}),r.jsx(E,{sx:{flex:{xs:"1 1 100%",md:"1 1 35%"},minWidth:0},children:r.jsxs(G,{spacing:3,children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Course Thumbnail"}),r.jsx("input",{type:"file",accept:"image/*",style:{display:"none"},id:"thumbnail-upload",onChange:Q=>{const me=Q.target.files[0];if(me){P(me);const we=new FileReader;we.onloadend=()=>{ge("thumbnail_url",we.result)},we.readAsDataURL(me)}}}),r.jsx("label",{htmlFor:"thumbnail-upload",children:r.jsx(E,{sx:{bgcolor:"#1E293B",border:I.thumbnail_url?"2px solid #1152D4":"2px dashed #374151",borderRadius:2,p:I.thumbnail_url?0:4,textAlign:"center",cursor:"pointer",transition:"border-color 0.2s","&:hover":{borderColor:"#1152D4"},overflow:"hidden",minHeight:150,display:"flex",alignItems:"center",justifyContent:"center"},children:I.thumbnail_url?r.jsx(E,{component:"img",src:I.thumbnail_url,alt:"Thumbnail preview",sx:{width:"100%",height:"auto",maxHeight:200,objectFit:"cover"}}):r.jsxs(E,{children:[r.jsx(Bu,{sx:{fontSize:40,color:"#6B7280",mb:1}}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:.5},children:"Click to upload"}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"or drag and drop"}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.7rem",mt:1},children:"SVG, PNG, JPG (max. 800x400px)"})]})})}),I.thumbnail_url&&r.jsx(ye,{size:"small",onClick:()=>{ge("thumbnail_url",""),P(null)},sx:{mt:1,color:"#EF4444",fontSize:"0.75rem"},children:"Remove Image"})]}),r.jsxs(Je,{sx:{bgcolor:"#1A2230",border:"1px solid #374151",borderRadius:2,p:2.5},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1.5},children:[r.jsx(kb,{sx:{color:"#1152D4",fontSize:18}}),r.jsx(C,{sx:{color:"#1152D4",fontWeight:600,fontSize:"0.85rem"},children:"Tutor Tips"})]}),r.jsxs(G,{spacing:1,children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.8rem"},children:"• Start with a catchy title that includes keywords"}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.8rem"},children:"• Clearly define the target audience in your description"}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.8rem"},children:"• Use high-quality images for better engagement"})]})]})]})})]}),$e=()=>r.jsxs(E,{children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:3},children:[r.jsxs(C,{sx:{color:"#fff",fontWeight:600},children:["Course Modules (",k.length,")"]}),r.jsx(ye,{variant:"contained",startIcon:r.jsx(Br,{}),onClick:()=>{W(null),Y({title:"",description:""}),q(!0)},sx:{bgcolor:"#1152D4","&:hover":{bgcolor:"#0D42AF"}},children:"Add Module"})]}),x.modules&&r.jsx(Wt,{severity:"error",sx:{mb:2,bgcolor:"rgba(239, 68, 68, 0.1)",color:"#EF4444"},children:x.modules}),k.length===0?r.jsxs(Je,{sx:{p:6,bgcolor:"#1A2230",borderRadius:2,border:"1px dashed #374151",textAlign:"center"},children:[r.jsx(C,{sx:{color:"#6B7280",mb:2},children:"No modules added yet"}),r.jsx(ye,{variant:"outlined",startIcon:r.jsx(Br,{}),onClick:()=>q(!0),sx:{color:"#1152D4",borderColor:"#1152D4"},children:"Create First Module"})]}):r.jsx(G,{spacing:2,children:k.map((Q,me)=>r.jsxs(Je,{sx:{bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151",overflow:"hidden"},children:[r.jsxs(E,{sx:{p:2,display:"flex",alignItems:"center",cursor:"pointer"},onClick:()=>V(ie===Q.id?null:Q.id),children:[r.jsx(kf,{sx:{color:"#6B7280",mr:2}}),r.jsxs(E,{sx:{flex:1},children:[r.jsxs(C,{sx:{color:"#fff",fontWeight:600},children:["Module ",me+1,": ",Q.title]}),r.jsxs(C,{sx:{color:"#6B7280",fontSize:"0.8rem"},children:[Q.lessons?.length||0," lessons"]})]}),r.jsxs(G,{direction:"row",spacing:1,children:[r.jsx(tn,{title:"Edit Module",children:r.jsx(Ve,{onClick:we=>{we.stopPropagation(),ve(Q)},sx:{color:"#3B82F6"},children:r.jsx(Ws,{fontSize:"small"})})}),r.jsx(tn,{title:"Delete Module",children:r.jsx(Ve,{onClick:we=>{we.stopPropagation(),Ge(Q.id)},disabled:Q.lessons?.length>0,sx:{color:Q.lessons?.length>0?"#374151":"#EF4444"},children:r.jsx(ss,{fontSize:"small"})})}),ie===Q.id?r.jsx(em,{sx:{color:"#9CA3AF"}}):r.jsx(ti,{sx:{color:"#9CA3AF"}})]})]}),r.jsxs(Al,{in:ie===Q.id,children:[r.jsx(Ir,{sx:{bgcolor:"#374151"}}),r.jsxs(E,{sx:{p:2,bgcolor:"#0F172A"},children:[Q.lessons?.length>0?r.jsx(Hs,{dense:!0,children:Q.lessons.map((we,et)=>r.jsxs(Ii,{sx:{bgcolor:"#1A2230",borderRadius:1,mb:1},children:[r.jsx(E,{sx:{display:"flex",alignItems:"center",mr:2},children:ot(we.type)}),r.jsx(Js,{primary:we.title,secondary:we.duration?`${we.duration} min`:null,primaryTypographyProps:{sx:{color:"#fff",fontSize:"0.85rem"}},secondaryTypographyProps:{sx:{color:"#6B7280"}}}),r.jsxs(Sb,{children:[r.jsx(Ve,{onClick:()=>Re(Q.id,we),sx:{color:"#3B82F6"},children:r.jsx(Ws,{fontSize:"small"})}),r.jsx(Ve,{onClick:()=>Se(Q.id,we.id),sx:{color:"#EF4444"},children:r.jsx(ss,{fontSize:"small"})})]})]},we.id))}):r.jsx(C,{sx:{color:"#6B7280",textAlign:"center",py:2},children:"No lessons in this module"}),r.jsx(ye,{fullWidth:!0,variant:"outlined",startIcon:r.jsx(Br,{}),onClick:()=>Be(Q.id),sx:{mt:1,color:"#1152D4",borderColor:"#374151","&:hover":{borderColor:"#1152D4"}},children:"Add Lesson"})]})]})]},Q.id))})]}),Z=()=>r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600,mb:3},children:"Lesson Content Overview"}),x.lessons&&r.jsx(Wt,{severity:"error",sx:{mb:2,bgcolor:"rgba(239, 68, 68, 0.1)",color:"#EF4444"},children:x.lessons}),k.length===0?r.jsx(Je,{sx:{p:6,bgcolor:"#1A2230",borderRadius:2,border:"1px dashed #374151",textAlign:"center"},children:r.jsx(C,{sx:{color:"#6B7280"},children:"Create modules first to add lessons"})}):r.jsx(G,{spacing:3,children:k.map((Q,me)=>r.jsxs(Je,{sx:{bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151",p:3},children:[r.jsxs(C,{sx:{color:"#fff",fontWeight:600,mb:2},children:["Module ",me+1,": ",Q.title]}),Q.lessons?.length>0?r.jsx(G,{spacing:1.5,children:Q.lessons.map((we,et)=>r.jsxs(E,{sx:{bgcolor:"#0F172A",borderRadius:1.5,p:2,display:"flex",alignItems:"center",gap:2},children:[r.jsx(E,{sx:{p:1,bgcolor:"#1E293B",borderRadius:1},children:ot(we.type)}),r.jsxs(E,{sx:{flex:1},children:[r.jsx(C,{sx:{color:"#fff",fontSize:"0.9rem",fontWeight:500},children:we.title}),r.jsxs(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:[we.type," ",we.duration?`• ${we.duration} min`:""]})]}),r.jsx(Pt,{label:we.content?"Content Added":"Pending",size:"small",sx:{bgcolor:we.content?"rgba(16, 185, 129, 0.15)":"rgba(245, 158, 11, 0.15)",color:we.content?"#10B981":"#F59E0B",fontSize:"0.7rem"}})]},we.id))}):r.jsx(C,{sx:{color:"#6B7280",textAlign:"center",py:2},children:"No lessons added"}),r.jsxs(ye,{fullWidth:!0,variant:"outlined",startIcon:r.jsx(Br,{}),onClick:()=>Be(Q.id),sx:{mt:2,color:"#1152D4",borderColor:"#374151"},children:["Add Lesson to Module ",me+1]})]},Q.id))})]}),pe=()=>{const Q=k.reduce((me,we)=>me+(we.lessons?.length||0),0);return r.jsx(E,{children:r.jsxs(G,{spacing:3,children:[r.jsxs(Je,{sx:{bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151",p:3},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600,mb:2},children:"Course Information"}),r.jsxs(G,{spacing:2,children:[r.jsxs(E,{sx:{display:"flex",gap:2},children:[r.jsx(C,{sx:{color:"#6B7280",width:120},children:"Title:"}),r.jsx(C,{sx:{color:"#fff"},children:I.title||"-"})]}),r.jsxs(E,{sx:{display:"flex",gap:2},children:[r.jsx(C,{sx:{color:"#6B7280",width:120},children:"Category:"}),r.jsx(C,{sx:{color:"#fff"},children:_.find(me=>me.id===I.category_id)?.name||"-"})]}),r.jsxs(E,{sx:{display:"flex",gap:2},children:[r.jsx(C,{sx:{color:"#6B7280",width:120},children:"Level:"}),r.jsx(C,{sx:{color:"#fff",textTransform:"capitalize"},children:I.level})]}),r.jsxs(E,{sx:{display:"flex",gap:2},children:[r.jsx(C,{sx:{color:"#6B7280",width:120},children:"Summary:"}),r.jsx(C,{sx:{color:"#fff"},children:I.summary||"-"})]}),r.jsxs(E,{sx:{display:"flex",gap:2},children:[r.jsx(C,{sx:{color:"#6B7280",width:120},children:"Price:"}),r.jsx(C,{sx:{color:"#fff",fontWeight:600},children:I.price>0?Ko(I.price,I.currency):"Free"})]})]})]}),r.jsxs(Je,{sx:{bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151",p:3},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600,mb:2},children:"Curriculum Summary"}),r.jsxs(G,{direction:"row",spacing:4,children:[r.jsxs(E,{sx:{textAlign:"center"},children:[r.jsx(C,{sx:{color:"#1152D4",fontSize:"2rem",fontWeight:700},children:k.length}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.85rem"},children:"Modules"})]}),r.jsxs(E,{sx:{textAlign:"center"},children:[r.jsx(C,{sx:{color:"#10B981",fontSize:"2rem",fontWeight:700},children:Q}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.85rem"},children:"Lessons"})]})]})]}),r.jsxs(Je,{sx:{bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151",p:3},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600,mb:2},children:"Submission Checklist"}),r.jsxs(G,{spacing:1.5,children:[r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:2},children:[r.jsx(fr,{sx:{color:I.title?"#10B981":"#374151",fontSize:20}}),r.jsx(C,{sx:{color:I.title?"#fff":"#6B7280"},children:"Course title provided"})]}),r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:2},children:[r.jsx(fr,{sx:{color:I.category_id?"#10B981":"#374151",fontSize:20}}),r.jsx(C,{sx:{color:I.category_id?"#fff":"#6B7280"},children:"Category selected"})]}),r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:2},children:[r.jsx(fr,{sx:{color:k.length>0?"#10B981":"#374151",fontSize:20}}),r.jsx(C,{sx:{color:k.length>0?"#fff":"#6B7280"},children:"At least one module"})]}),r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:2},children:[r.jsx(fr,{sx:{color:Q>0?"#10B981":"#374151",fontSize:20}}),r.jsx(C,{sx:{color:Q>0?"#fff":"#6B7280"},children:"At least one lesson"})]})]})]})]})})};return y?r.jsx(E,{sx:{p:4,bgcolor:"#0C1322",minHeight:"calc(100vh - 70px)",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx(nn,{sx:{color:"#1152D4"}})}):r.jsxs(E,{sx:{p:{xs:2,md:4},bgcolor:"#0C1322",minHeight:"calc(100vh - 70px)",width:"100%"},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:4},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h4",sx:{color:"#fff",fontWeight:700,mb:.5},children:s?"Edit Course":"Create New Course"}),r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF"},children:s?"Update your course details and media.":"Share your expertise in governance and policy."})]}),r.jsx(G,{direction:"row",alignItems:"center",spacing:2,children:r.jsx(Pt,{icon:I.status==="draft"?r.jsx(rm,{sx:{fontSize:14}}):r.jsx(fr,{sx:{fontSize:14}}),label:l?`Draft saved ${l.toLocaleTimeString()}`:"Draft",sx:{bgcolor:"rgba(245, 158, 11, 0.15)",color:"#F59E0B","& .MuiChip-icon":{color:"#F59E0B"}}})})]}),r.jsx(E,{sx:{mb:4},children:r.jsx(E,{sx:{display:"flex",alignItems:"center",bgcolor:"#1A2230",borderRadius:"50px",p:.5,border:"1px solid #374151",overflow:"hidden"},children:wp.map((Q,me)=>{const we=Q.icon,et=me===o,ht=me<o,ct=me===wp.length-1;return r.jsxs(Er.Fragment,{children:[r.jsxs(E,{onClick:()=>{ht&&a(me)},sx:{display:"flex",alignItems:"center",gap:1.5,py:1.5,px:2.5,borderRadius:"50px",bgcolor:et?"#1152D4":"transparent",cursor:ht?"pointer":"default",transition:"all 0.2s ease","&:hover":{bgcolor:ht&&!et?"rgba(17, 82, 212, 0.15)":et?"#1152D4":"transparent"},flexShrink:0},children:[r.jsx(E,{sx:{width:32,height:32,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:et?"rgba(255,255,255,0.2)":ht?"rgba(16, 185, 129, 0.2)":"rgba(107, 114, 128, 0.2)",color:et?"#fff":ht?"#10B981":"#6B7280"},children:ht?r.jsx(fr,{sx:{fontSize:18}}):r.jsx(we,{sx:{fontSize:18}})}),r.jsxs(E,{sx:{display:"flex",flexDirection:"column"},children:[r.jsx(C,{sx:{color:et?"#fff":ht?"#10B981":"#9CA3AF",fontSize:"0.75rem",fontWeight:600,lineHeight:1.2},children:Q.label}),r.jsx(C,{sx:{color:et?"rgba(255,255,255,0.7)":"#6B7280",fontSize:"0.7rem",lineHeight:1.2},children:Q.sublabel})]})]}),!ct&&r.jsx(E,{sx:{display:"flex",alignItems:"center",color:"#374151",flex:1,justifyContent:"center",minWidth:40},children:r.jsx(Eb,{sx:{fontSize:24}})})]},Q.label)})})}),r.jsxs(Je,{sx:{p:4,mb:4,bgcolor:"#1A2230",borderRadius:2,border:"1px solid #374151"},children:[o===0&&He(),o===1&&$e(),o===2&&Z(),o===3&&pe()]}),r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,children:[r.jsxs(G,{direction:"row",spacing:1,children:[r.jsx(ye,{onClick:()=>e("/tutor/courses"),sx:{color:"#9CA3AF","&:hover":{bgcolor:"rgba(255,255,255,0.05)"}},children:"Cancel"}),!(o===wp.length-1&&s)&&r.jsx(ye,{onClick:()=>Ke(!0),disabled:j||!I.title,variant:"outlined",sx:{borderColor:"#374151",color:"#9CA3AF","&:hover":{borderColor:"#6B7280",color:"#fff"},"&:disabled":{borderColor:"#1F2937",color:"#374151"}},children:j?"Saving…":s?"Save Changes":"Save Draft"})]}),r.jsxs(G,{direction:"row",spacing:2,children:[o>0&&r.jsx(ye,{onClick:ee,startIcon:r.jsx(fa,{}),sx:{color:"#fff",borderColor:"#374151","&:hover":{borderColor:"#4B5563"}},variant:"outlined",children:"Back"}),o<wp.length-1?r.jsxs(ye,{onClick:le,endIcon:r.jsx(Oi,{}),variant:"contained",sx:{bgcolor:"#1152D4","&:hover":{bgcolor:"#0D42AF"}},children:["Continue to ",wp[o+1].sublabel]}):r.jsx(ye,{onClick:()=>s?Ke(!0):g(!0),endIcon:r.jsx(Rb,{}),variant:"contained",disabled:j,sx:{bgcolor:"#10B981","&:hover":{bgcolor:"#059669"}},children:s?"Save Changes":"Submit Course"})]})]}),r.jsx(tr,{open:D,onClose:()=>q(!1),children:r.jsxs(E,{sx:kr,children:[r.jsxs(E,{sx:{background:"linear-gradient(135deg, #1152D4 0%, #0D42AF 100%)",p:3,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600},children:O?"Edit Module":"Add Module"}),r.jsx(Ve,{onClick:()=>q(!1),sx:{color:"#fff"},children:r.jsx(hs,{})})]}),r.jsxs(E,{sx:{p:3},children:[r.jsxs(G,{spacing:2,children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Module Title"}),r.jsx(it,{fullWidth:!0,placeholder:"e.g. Introduction to the Course",value:K.title,onChange:Q=>Y({...K,title:Q.target.value}),sx:xt})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Description (optional)"}),r.jsx(it,{fullWidth:!0,multiline:!0,rows:3,placeholder:"Brief description of what this module covers",value:K.description,onChange:Q=>Y({...K,description:Q.target.value}),sx:xt})]})]}),r.jsxs(G,{direction:"row",justifyContent:"flex-end",spacing:2,sx:{mt:3},children:[r.jsx(ye,{onClick:()=>q(!1),sx:{color:"#9CA3AF"},children:"Cancel"}),r.jsx(ye,{variant:"contained",onClick:O?st:X,sx:{bgcolor:"#1152D4"},children:O?"Update":"Add Module"})]})]})]})}),r.jsx(tr,{open:re,onClose:()=>fe(!1),children:r.jsxs(E,{sx:{...kr,width:{xs:"95vw",sm:"90vw",md:900},maxHeight:"90vh",display:"flex",flexDirection:"column"},children:[r.jsxs(E,{sx:{background:"linear-gradient(135deg, #1152D4 0%, #0D42AF 100%)",p:3,display:"flex",justifyContent:"space-between",alignItems:"center",flexShrink:0},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600},children:ae?"Edit Lesson":"Add Lesson"}),r.jsx(Ve,{onClick:()=>fe(!1),sx:{color:"#fff"},children:r.jsx(hs,{})})]}),r.jsxs(E,{sx:{p:3,overflowY:"auto",flex:1,...kw},children:[r.jsxs(G,{spacing:2,children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Lesson Title"}),r.jsx(it,{fullWidth:!0,placeholder:"e.g. Welcome Video",value:ce.title,onChange:Q=>oe({...ce,title:Q.target.value}),sx:xt})]}),r.jsxs(E,{children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem"},children:"Video"}),r.jsx(Pt,{label:"Optional",size:"small",sx:{bgcolor:"rgba(156, 163, 175, 0.15)",color:"#9CA3AF",fontSize:"0.7rem",height:20}})]}),r.jsx("input",{type:"file",accept:"video/*",style:{display:"none"},id:"lesson-video-upload",onChange:Q=>{const me=Q.target.files[0];me&&oe({...ce,videoFile:me,fileName:me.name,videoUrl:""})}}),r.jsx("label",{htmlFor:"lesson-video-upload",children:r.jsx(E,{sx:{bgcolor:"#1E293B",border:ce.videoFile||ce.fileName?"2px solid #10B981":"2px dashed #374151",borderRadius:2,p:3,textAlign:"center",cursor:"pointer","&:hover":{borderColor:"#1152D4"}},children:ce.videoFile||ce.fileName?r.jsxs(G,{alignItems:"center",spacing:1,children:[r.jsx(jo,{sx:{fontSize:36,color:"#10B981"}}),r.jsx(C,{sx:{color:"#fff",fontSize:"0.85rem"},children:ce.fileName}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Click to change"})]}):r.jsxs(G,{alignItems:"center",spacing:1,children:[r.jsx(Bu,{sx:{fontSize:36,color:"#6B7280"}}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem"},children:"Click to upload video"}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.7rem"},children:"MP4, WebM, MOV (max. 500MB)"})]})})}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem",textAlign:"center",my:1},children:"— or —"}),r.jsx(it,{fullWidth:!0,placeholder:"Paste a video URL (https://...)",value:ce.videoUrl,onChange:Q=>{const me=Q.target.value;oe({...ce,videoUrl:me,...me?{videoFile:null,fileName:""}:{}})},sx:xt,slotProps:{htmlInput:{maxLength:2048}}})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Lesson Content"}),r.jsx(E,{sx:{bgcolor:"#1E293B",borderRadius:1.5,border:"1px solid #374151","& .ql-toolbar":{borderTopLeftRadius:6,borderTopRightRadius:6,borderColor:"#374151",bgcolor:"#111827"},"& .ql-container":{borderBottomLeftRadius:6,borderBottomRightRadius:6,borderColor:"#374151",minHeight:220,fontSize:"0.9rem"},"& .ql-editor":{color:"#FFFFFF",minHeight:220},"& .ql-editor.ql-blank::before":{color:"#6B7280",fontStyle:"normal"},"& .ql-stroke":{stroke:"#9CA3AF"},"& .ql-fill":{fill:"#9CA3AF"},"& .ql-picker-label":{color:"#9CA3AF"}},children:r.jsx(eh,{theme:"snow",value:ce.content,onChange:Q=>oe({...ce,content:Q}),placeholder:"Write your lesson content here...",modules:{toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline","strike"],[{list:"ordered"},{list:"bullet"}],["link","blockquote","code-block"],["clean"]]}})})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Duration"}),r.jsxs(G,{direction:"row",spacing:2,alignItems:"center",children:[r.jsx(it,{type:"number",label:"Hours",value:ce.durationHours===0?"":ce.durationHours,onFocus:Q=>Q.target.select(),onChange:Q=>{const me=Q.target.value;if(me===""){oe({...ce,durationHours:0});return}const we=Math.max(0,parseInt(me)||0);oe({...ce,durationHours:we})},slotProps:{htmlInput:{min:0,max:23,placeholder:"0"}},sx:{...xt,width:140,"& .MuiInputLabel-root":{color:"#9CA3AF"}}}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"1.25rem",fontWeight:600},children:":"}),r.jsx(it,{type:"number",label:"Minutes",value:ce.durationMinutes===0?"":ce.durationMinutes,onFocus:Q=>Q.target.select(),onChange:Q=>{const me=Q.target.value;if(me===""){oe({...ce,durationMinutes:0});return}const we=Math.min(59,Math.max(0,parseInt(me)||0));oe({...ce,durationMinutes:we})},slotProps:{htmlInput:{min:0,max:59,placeholder:"0"}},sx:{...xt,width:140,"& .MuiInputLabel-root":{color:"#9CA3AF"}}})]})]})]}),r.jsxs(G,{direction:"row",justifyContent:"flex-end",spacing:2,sx:{mt:3},children:[r.jsx(ye,{onClick:()=>fe(!1),sx:{color:"#9CA3AF"},children:"Cancel"}),r.jsx(ye,{variant:"contained",onClick:Te,sx:{bgcolor:"#1152D4"},children:ae?"Update":"Add Lesson"})]})]})]})}),r.jsx(tr,{open:p,onClose:()=>g(!1),children:r.jsxs(E,{sx:kr,children:[r.jsx(E,{sx:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",p:3},children:r.jsx(C,{sx:{color:"#fff",fontWeight:600},children:"Submit for Approval"})}),r.jsxs(E,{sx:{p:3},children:[r.jsx(C,{sx:{color:"#9CA3AF",mb:3},children:"Once submitted, your course will be locked for editing until reviewed by an admin. Are you sure you want to submit?"}),r.jsxs(G,{direction:"row",justifyContent:"flex-end",spacing:2,children:[r.jsx(ye,{onClick:()=>Ke(!0),sx:{color:"#9CA3AF"},children:"Save as Draft"}),r.jsx(ye,{variant:"contained",onClick:()=>Ke(!1),sx:{bgcolor:"#10B981","&:hover":{bgcolor:"#059669"}},children:"Submit for Approval"})]})]})]})}),j&&r.jsxs(E,{sx:{position:"fixed",top:0,left:0,right:0,bottom:0,bgcolor:"rgba(0, 0, 0, 0.7)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",zIndex:9999},children:[r.jsx(nn,{size:60,sx:{color:"#1152D4",mb:2}}),r.jsx(C,{sx:{color:"#fff",fontSize:"1.1rem"},children:"Creating your course..."}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mt:1},children:"Please wait while we set up your course, modules, and lessons."})]}),r.jsx(gs,{open:M.open,autoHideDuration:6e3,onClose:()=>R({...M,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:r.jsx(Wt,{onClose:()=>R({...M,open:!1}),severity:M.severity,sx:{width:"100%"},children:M.message})})]})},M0=[{label:"Step 1",sublabel:"Personal Info",icon:gz},{label:"Step 2",sublabel:"Documents",icon:Qg},{label:"Step 3",sublabel:"Review",icon:_ee}],Rye=()=>{const e=On(),t=Dn(),{user:n,updateUser:s}=ps();Yu(e.breakpoints.down("md"));const[o,a]=v.useState(0),[l,u]=v.useState("draft"),[d,f]=v.useState(null),[p,g]=v.useState({phone:"",country:"",state:"",city:"",address:"",bio:"",highest_education:"",skills:[]}),[x,b]=v.useState(""),[y,S]=v.useState([]),[j,A]=v.useState(null),[M,R]=v.useState(null),[_,z]=v.useState(!1),[F,N]=v.useState(!1),[I,B]=v.useState(!1),[H,P]=v.useState(null);v.useEffect(()=>{(async()=>{B(!0);try{const oe=await yl.getKyc();if(oe){let ge=oe.data?.skills||oe.skills||[];if(typeof ge=="string")try{ge=JSON.parse(ge)}catch{ge=[]}g({phone:oe.data?.phone||oe.phone||"",country:oe.data?.country||oe.country||"",state:oe.data?.state||oe.state||"",city:oe.data?.city||oe.city||"",address:oe.data?.address||oe.address||"",bio:oe.data?.bio||oe.bio||"",highest_education:oe.data?.highest_education||oe.highest_education||"",skills:Array.isArray(ge)?ge:[]}),S(oe.documents||[]),u(oe.status||"draft");const de=oe.documents||[],le=de.find(X=>X.type==="id_front"),ee=de.find(X=>X.type==="certificate");le&&A(le),ee&&R(ee),oe.status&&s({kyc_status:oe.status})}}catch(oe){oe?.status!==404&&P("Failed to load your KYC data. Please try again.")}finally{B(!1)}})()},[]);const k=l==="submitted"||l==="approved";v.useEffect(()=>{if(l!=="draft"&&l!=="rejected")return;const ce=setTimeout(async()=>{if(p.phone||p.bio)try{await yl.updateKyc(p),f(new Date)}catch(oe){console.error("Auto-save failed:",oe)}},5e3);return()=>clearTimeout(ce)},[p,l]);const L=ce=>{const{name:oe,value:ge}=ce.target;g(de=>({...de,[oe]:ge}))},O=ce=>{ce.key==="Enter"&&x.trim()&&(ce.preventDefault(),p.skills.includes(x.trim())||g(oe=>({...oe,skills:[...oe.skills,x.trim()]})),b(""))},W=ce=>{g(oe=>({...oe,skills:oe.skills.filter(ge=>ge!==ce)}))},D=async ce=>{const oe=ce.target.files?.[0];if(oe){z(!0),P(null);try{const ge=await yl.uploadDocument(oe,"id_front");A(ge.document||{name:oe.name,type:"id_front",...ge})}catch(ge){P(ge.message||"Failed to upload ID document.")}finally{z(!1)}}},q=async ce=>{const oe=ce.target.files?.[0];if(oe){N(!0),P(null);try{const ge=await yl.uploadDocument(oe,"certificate");R(ge.document||{name:oe.name,type:"certificate",...ge})}catch(ge){P(ge.message||"Failed to upload certificate.")}finally{N(!1)}}},K=async ce=>{const oe=ce==="id_front"?j:M;if(!oe?.id){ce==="id_front"?A(null):R(null);return}B(!0);try{await yl.deleteDocument(oe.id),ce==="id_front"?A(null):R(null)}catch(ge){P(ge.message||"Failed to remove document.")}finally{B(!1)}},Y=async()=>{if(o===0){B(!0);try{const ce={...p,skills:Array.isArray(p.skills)?p.skills:[]};await yl.updateKyc(ce),f(new Date),a(oe=>oe+1)}catch(ce){P(ce.message||"Failed to save progress.")}finally{B(!1)}}else a(ce=>ce+1)},ie=()=>{a(ce=>ce-1)},V=async()=>{B(!0),P(null);try{await yl.submitKyc(),u("submitted")}catch(ce){if(ce.status===422&&ce.data?.missing){const oe=ce.data.missing.map(ge=>ge.replace("document:","")).join(", ");P(`Submission failed. Missing required fields: ${oe}`)}else P(ce.message||"Failed to submit KYC.")}finally{B(!1)}},re=()=>["phone","country","state","city","address","highest_education"].every(oe=>p[oe]?.trim()!==""),fe=()=>j&&M,ae=re()&&fe(),ue=()=>r.jsxs(E,{sx:{display:"flex",gap:4,flexWrap:"wrap"},children:[r.jsx(E,{sx:{flex:{xs:"1 1 100%",md:1},minWidth:0},children:r.jsxs(G,{spacing:3,children:[r.jsxs(E,{sx:{display:"flex",gap:2,flexWrap:"wrap"},children:[r.jsxs(E,{sx:{flex:"1 1 45%",minWidth:200},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Phone Number"}),r.jsx(it,{fullWidth:!0,name:"phone",placeholder:"08012345678",value:p.phone,onChange:L,disabled:k,sx:xt})]}),r.jsxs(E,{sx:{flex:"1 1 45%",minWidth:200},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Highest Education"}),r.jsx(it,{fullWidth:!0,name:"highest_education",placeholder:"e.g. PhD in Political Science",value:p.highest_education,onChange:L,disabled:k,sx:xt})]})]}),r.jsxs(E,{sx:{display:"flex",gap:2,flexWrap:"wrap"},children:[r.jsxs(E,{sx:{flex:"1 1 45%",minWidth:200},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Country"}),r.jsx(it,{fullWidth:!0,name:"country",placeholder:"Nigeria",value:p.country,onChange:L,disabled:k,sx:xt})]}),r.jsxs(E,{sx:{flex:"1 1 45%",minWidth:200},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"State / Province"}),r.jsx(it,{fullWidth:!0,name:"state",placeholder:"Lagos",value:p.state,onChange:L,disabled:k,sx:xt})]})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"City"}),r.jsx(it,{fullWidth:!0,name:"city",placeholder:"Ikeja",value:p.city,onChange:L,disabled:k,sx:xt})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Areas of Expertise"}),r.jsx(it,{fullWidth:!0,value:x,onChange:ce=>b(ce.target.value),onKeyDown:O,disabled:k,placeholder:"e.g. Governance, Public Policy, Ethical Leadership",sx:xt}),r.jsx(G,{direction:"row",spacing:1,flexWrap:"wrap",sx:{mt:2},children:p.skills.map(ce=>r.jsx(Pt,{label:ce,onDelete:k?void 0:()=>W(ce),sx:{bgcolor:"rgba(17, 82, 212, 0.15)",color:"#3B82F6",mb:1,borderRadius:1.5,border:"1px solid rgba(17, 82, 212, 0.3)",fontWeight:500}},ce))})]})]})}),r.jsx(E,{sx:{flex:{xs:"1 1 100%",md:1},minWidth:0},children:r.jsxs(G,{spacing:3,children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Residential Address"}),r.jsx(it,{fullWidth:!0,multiline:!0,rows:2,name:"address",placeholder:"Enter your full residential address",value:p.address,onChange:L,disabled:k,sx:xt})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1,fontWeight:500},children:"Short Bio"}),r.jsx(it,{fullWidth:!0,multiline:!0,rows:11,name:"bio",placeholder:"Tell us about yourself and your professional background...",value:p.bio,onChange:L,disabled:k,sx:xt})]})]})})]}),se=()=>r.jsxs(E,{children:[r.jsx(C,{variant:"h6",sx:{color:"#fff",mb:2,fontWeight:600},children:"Verification Documents"}),r.jsxs(Wt,{severity:"info",icon:r.jsx(kb,{sx:{color:"#3B82F6"}}),sx:{mb:4,bgcolor:"rgba(59, 130, 246, 0.05)",color:"#93C5FD",border:"1px solid rgba(59, 130, 246, 0.2)","& .MuiAlert-icon":{color:"#3B82F6"}},children:["Please upload a clear copy of your ",r.jsx("strong",{children:"Government-Issued ID"})," (Passport, National ID, or Voter's Card) and your ",r.jsx("strong",{children:"Academic Certificate"}),"."]}),r.jsxs(G,{spacing:3,children:[r.jsxs(E,{children:[r.jsxs(C,{sx:{color:"#E5E7EB",fontSize:"0.875rem",fontWeight:500,mb:1},children:["Government-Issued ID (Front) ",r.jsx(E,{component:"span",sx:{color:"#EF4444"},children:"*"})]}),j?r.jsxs(Je,{sx:{bgcolor:"#111827",p:2,borderRadius:2,border:"1px solid #22C55E",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[r.jsxs(G,{direction:"row",spacing:2,alignItems:"center",children:[r.jsx(E,{sx:{p:1,bgcolor:"rgba(34, 197, 94, 0.1)",borderRadius:1.5,color:"#22C55E"},children:r.jsx(Ia,{})}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#fff",fontSize:"0.9rem",fontWeight:500},children:j.name||j.original_name||"ID Document"}),r.jsx(C,{sx:{color:"#22C55E",fontSize:"0.75rem"},children:"Uploaded"})]})]}),!k&&r.jsx(Ve,{onClick:()=>K("id_front"),sx:{color:"#EF4444","&:hover":{bgcolor:"rgba(239, 68, 68, 0.1)"}},children:r.jsx(a8,{})})]}):r.jsxs(E,{sx:{border:"2px dashed #374151",borderRadius:2,p:3,textAlign:"center",bgcolor:"rgba(255,255,255,0.02)",transition:"all 0.2s","&:hover":{borderColor:"#1152D4",bgcolor:"rgba(17, 82, 212, 0.02)"}},children:[r.jsx("input",{accept:"application/pdf,image/*",style:{display:"none"},id:"id-front-upload",type:"file",onChange:D,disabled:k||_}),r.jsx("label",{htmlFor:"id-front-upload",children:r.jsxs(G,{spacing:1,alignItems:"center",children:[r.jsx(i8,{sx:{fontSize:32,color:"#1152D4"}}),r.jsx(ye,{variant:"outlined",component:"span",disabled:_,sx:{color:"#1152D4",borderColor:"#1152D4",textTransform:"none","&:hover":{borderColor:"#0D42AF",bgcolor:"rgba(17, 82, 212, 0.05)"}},children:_?"Uploading...":"Upload ID Document"})]})})]})]}),r.jsxs(E,{children:[r.jsxs(C,{sx:{color:"#E5E7EB",fontSize:"0.875rem",fontWeight:500,mb:1},children:["Academic Certificate ",r.jsx(E,{component:"span",sx:{color:"#EF4444"},children:"*"})]}),M?r.jsxs(Je,{sx:{bgcolor:"#111827",p:2,borderRadius:2,border:"1px solid #22C55E",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[r.jsxs(G,{direction:"row",spacing:2,alignItems:"center",children:[r.jsx(E,{sx:{p:1,bgcolor:"rgba(34, 197, 94, 0.1)",borderRadius:1.5,color:"#22C55E"},children:r.jsx(Ia,{})}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#fff",fontSize:"0.9rem",fontWeight:500},children:M.name||M.original_name||"Certificate"}),r.jsx(C,{sx:{color:"#22C55E",fontSize:"0.75rem"},children:"Uploaded"})]})]}),!k&&r.jsx(Ve,{onClick:()=>K("certificate"),sx:{color:"#EF4444","&:hover":{bgcolor:"rgba(239, 68, 68, 0.1)"}},children:r.jsx(a8,{})})]}):r.jsxs(E,{sx:{border:"2px dashed #374151",borderRadius:2,p:3,textAlign:"center",bgcolor:"rgba(255,255,255,0.02)",transition:"all 0.2s","&:hover":{borderColor:"#1152D4",bgcolor:"rgba(17, 82, 212, 0.02)"}},children:[r.jsx("input",{accept:"application/pdf,image/*",style:{display:"none"},id:"certificate-upload",type:"file",onChange:q,disabled:k||F}),r.jsx("label",{htmlFor:"certificate-upload",children:r.jsxs(G,{spacing:1,alignItems:"center",children:[r.jsx(i8,{sx:{fontSize:32,color:"#1152D4"}}),r.jsx(ye,{variant:"outlined",component:"span",disabled:F,sx:{color:"#1152D4",borderColor:"#1152D4",textTransform:"none","&:hover":{borderColor:"#0D42AF",bgcolor:"rgba(17, 82, 212, 0.05)"}},children:F?"Uploading...":"Upload Certificate"})]})})]})]})]})]}),J=()=>r.jsxs(E,{children:[r.jsx(C,{variant:"h6",sx:{color:"#fff",mb:3,fontWeight:600},children:"Review Application"}),r.jsxs(G,{spacing:4,children:[r.jsxs(E,{children:[r.jsxs(C,{sx:{color:"#1152D4",fontWeight:600,fontSize:"0.9rem",mb:2,display:"flex",alignItems:"center",gap:1},children:[r.jsx(gz,{sx:{fontSize:20}})," Personal Information"]}),r.jsxs(Zt,{container:!0,spacing:3,children:[r.jsxs(Zt,{item:!0,xs:12,sm:6,children:[r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem",mb:.5},children:"Full Name"}),r.jsx(C,{sx:{color:"#fff"},children:n?.name||"Tutor User"})]}),r.jsxs(Zt,{item:!0,xs:12,sm:6,children:[r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem",mb:.5},children:"Phone Number"}),r.jsx(C,{sx:{color:"#fff"},children:p.phone||"-"})]}),r.jsxs(Zt,{item:!0,xs:12,sm:6,children:[r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem",mb:.5},children:"Education"}),r.jsx(C,{sx:{color:"#fff"},children:p.highest_education||"-"})]}),r.jsxs(Zt,{item:!0,xs:12,sm:6,children:[r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem",mb:.5},children:"Location"}),r.jsxs(C,{sx:{color:"#fff"},children:[p.city&&`${p.city}, `,p.state&&`${p.state}, `,p.country]})]})]})]}),r.jsx(Ir,{sx:{borderColor:"#374151"}}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#1152D4",fontWeight:600,fontSize:"0.9rem",mb:2},children:"Areas of Expertise"}),p.skills&&p.skills.length>0?r.jsx(G,{direction:"row",spacing:1,flexWrap:"wrap",useFlexGap:!0,children:p.skills.map(ce=>r.jsx(Pt,{label:ce,size:"small",sx:{bgcolor:"rgba(16, 185, 129, 0.1)",color:"#10B981",borderRadius:1}},ce))}):r.jsx(C,{sx:{color:"#6B7280",fontStyle:"italic",fontSize:"0.85rem"},children:"No skills added"})]}),r.jsx(Ir,{sx:{borderColor:"#374151"}}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#1152D4",fontWeight:600,fontSize:"0.9rem",mb:2},children:"Attached Documents"}),r.jsxs(G,{spacing:1,children:[j&&r.jsxs(C,{sx:{color:"#fff",fontSize:"0.85rem",display:"flex",alignItems:"center",gap:1},children:[r.jsx(Ia,{sx:{color:"#10B981",fontSize:16}}),"Government ID: ",j.name||j.original_name||"Uploaded"]}),M&&r.jsxs(C,{sx:{color:"#fff",fontSize:"0.85rem",display:"flex",alignItems:"center",gap:1},children:[r.jsx(Ia,{sx:{color:"#10B981",fontSize:16}}),"Certificate: ",M.name||M.original_name||"Uploaded"]}),!j&&!M&&r.jsx(C,{sx:{color:"#EF4444",fontStyle:"italic",fontSize:"0.85rem"},children:"No documents uploaded"})]})]})]})]});return r.jsxs(E,{sx:{p:{xs:2,md:4},bgcolor:"#0C1322",minHeight:"calc(100vh - 70px)",width:"100%"},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:4},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h4",sx:{color:"#fff",fontWeight:700,mb:.5},children:"Tutor Verification (KYC)"}),r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF"},children:"Complete your profile to start creating courses."})]}),r.jsx(G,{direction:"row",alignItems:"center",spacing:2,children:r.jsx(Pt,{icon:l==="draft"?r.jsx(rm,{sx:{fontSize:14}}):r.jsx(Ia,{sx:{fontSize:14}}),label:l==="submitted"?"Verification Pending":d?`Draft saved ${d.toLocaleTimeString()}`:"Not Started",sx:{bgcolor:l==="submitted"?"rgba(59, 130, 246, 0.15)":"rgba(245, 158, 11, 0.15)",color:l==="submitted"?"#3B82F6":"#F59E0B",fontWeight:600,"& .MuiChip-icon":{color:"inherit"}}})})]}),r.jsx(E,{sx:{mb:4},children:r.jsx(E,{sx:{display:"flex",alignItems:"center",bgcolor:"#1A2230",borderRadius:"50px",p:.5,border:"1px solid #374151",overflow:"hidden"},children:M0.map((ce,oe)=>{const ge=ce.icon,de=oe===o,le=oe<o,ee=oe===M0.length-1;return r.jsxs(Er.Fragment,{children:[r.jsxs(E,{onClick:()=>{le&&a(oe)},sx:{display:"flex",alignItems:"center",gap:1.5,py:1.5,px:2.5,borderRadius:"50px",bgcolor:de?"#1152D4":"transparent",cursor:le?"pointer":"default",transition:"all 0.2s ease","&:hover":{bgcolor:le&&!de?"rgba(17, 82, 212, 0.15)":de?"#1152D4":"transparent"},flexShrink:0},children:[r.jsx(E,{sx:{width:32,height:32,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:de?"rgba(255,255,255,0.2)":le?"rgba(16, 185, 129, 0.2)":"rgba(107, 114, 128, 0.2)",color:de?"#fff":le?"#10B981":"#6B7280"},children:le?r.jsx(fr,{sx:{fontSize:18}}):r.jsx(ge,{sx:{fontSize:18}})}),r.jsxs(E,{sx:{display:"flex",flexDirection:"column"},children:[r.jsx(C,{sx:{color:de?"#fff":le?"#10B981":"#9CA3AF",fontSize:"0.75rem",fontWeight:600,lineHeight:1.2},children:ce.label}),r.jsx(C,{sx:{color:de?"rgba(255,255,255,0.7)":"#6B7280",fontSize:"0.7rem",lineHeight:1.2},children:ce.sublabel})]})]}),!ee&&r.jsx(E,{sx:{display:"flex",alignItems:"center",color:"#374151",flex:1,justifyContent:"center",minWidth:40},children:r.jsx(Eb,{sx:{fontSize:24}})})]},ce.label)})})}),l==="approved"&&r.jsx(Wt,{severity:"success",sx:{mb:3,bgcolor:"rgba(16, 185, 129, 0.1)",color:"#10B981",border:"1px solid rgba(16, 185, 129, 0.2)"},children:"Your KYC has been approved! You are now a verified tutor."}),l==="submitted"&&r.jsx(Wt,{severity:"info",sx:{mb:3,bgcolor:"rgba(59, 130, 246, 0.1)",color:"#93C5FD",border:"1px solid rgba(59, 130, 246, 0.2)"},children:"Your application is under review. Our team will verify your details within 48 hours."}),H&&r.jsx(Wt,{severity:"error",sx:{mb:3,bgcolor:"rgba(239, 68, 68, 0.1)",color:"#F87171",border:"1px solid rgba(239, 68, 68, 0.2)"},onClose:()=>P(null),children:H}),r.jsxs(Je,{sx:{p:4,mb:4,bgcolor:"#1A2230",borderRadius:4,border:"1px solid #374151",width:"100%"},children:[o===0&&ue(),o===1&&se(),o===2&&J()]}),r.jsx(E,{sx:{width:"100%"},children:r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[r.jsx(ye,{onClick:()=>t("/tutor"),sx:{color:"#6B7280",textTransform:"none","&:hover":{color:"#fff"}},children:"Cancel & Return"}),r.jsxs(G,{direction:"row",spacing:2,children:[o>0&&r.jsx(ye,{onClick:ie,disabled:k,variant:"outlined",startIcon:r.jsx(fa,{}),sx:{color:"#fff",borderColor:"#374151","&:hover":{borderColor:"#4B5563"}},children:"Back"}),o<M0.length-1?r.jsxs(ye,{variant:"contained",disabled:k||o===0&&!re()||o===1&&!fe(),onClick:Y,endIcon:r.jsx(Oi,{}),sx:{bgcolor:"#1152D4","&:hover":{bgcolor:"#0D42AF"}},children:["Continue to ",M0[o+1].sublabel]}):l==="draft"||l==="rejected"?r.jsx(ye,{variant:"contained",onClick:V,disabled:!ae,startIcon:r.jsx(Rb,{}),sx:{bgcolor:"#10B981","&:hover":{bgcolor:"#059669"},px:4},children:"Submit for Verification"}):r.jsx(ye,{variant:"contained",disabled:!0,startIcon:r.jsx(Ia,{}),sx:{bgcolor:"rgba(16, 185, 129, 0.2) !important",color:"#10B981 !important"},children:"Submitted"})]})]})}),r.jsx(gC,{sx:{color:"#fff",zIndex:ce=>ce.zIndex.drawer+1},open:I,children:r.jsx(nn,{color:"inherit"})})]})},zye=()=>{const e=Dn(),{courseId:t,moduleId:n,lessonId:s}=Vu(),[o,a]=v.useState(null),[l,u]=v.useState(!0),[d,f]=v.useState(!1),[p,g]=v.useState(""),[x,b]=v.useState(""),[y,S]=v.useState(0),[j,A]=v.useState(!1),[M,R]=v.useState("Intermediate"),[_,z]=v.useState([]),[F,N]=v.useState("");v.useEffect(()=>{t&&s&&(async()=>{u(!0);try{const O=await vs.getCourseDetail(t);a(O);let W=null;O.modules?.forEach(D=>{if(D.id.toString()===n){const q=D.lessons?.find(K=>K.id.toString()===s);q&&(W=q)}}),W&&(g(W.title),b(W.content||""),S(W.duration||45),A(W.is_visible||!1),R(W.difficulty||"Intermediate"))}catch(O){console.error("Failed to fetch data:",O)}finally{u(!1)}})()},[t,n,s]);const I=async()=>{if(s){f(!0);try{const L={title:p,content:x,duration:parseInt(y)||0,difficulty:M,is_visible:j};await ra.updateLesson(s,L)}catch(L){console.error("Failed to save:",L)}finally{f(!1)}}},B=()=>{e(`/tutor/courses/${t}`)},H=L=>{L.key==="Enter"&&F.trim()&&(z([..._,F.trim()]),N(""))},P=L=>{z(_.filter(O=>O!==L))};if(l)return r.jsx(E,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",bgcolor:"#080D19"},children:r.jsx(nn,{sx:{color:"#1152D4"}})});if(!o)return null;const k=o.modules?.find(L=>L.id.toString()===n);return r.jsxs(E,{sx:{display:"flex",flexDirection:"column",height:"calc(100vh - 70px)",bgcolor:"#080D19",overflow:"hidden"},children:[r.jsxs(E,{sx:{px:4,height:70,borderBottom:"1px solid #1F2937",bgcolor:"#0C1322",display:"flex",justifyContent:"space-between",alignItems:"center",flexShrink:0},children:[r.jsx(G,{direction:"row",alignItems:"center",spacing:2,children:r.jsxs(xC,{separator:"/",sx:{color:"#9CA3AF",fontSize:"0.85rem"},children:[r.jsx(Vp,{underline:"hover",color:"inherit",onClick:()=>e("/tutor/courses"),sx:{cursor:"pointer"},children:"Courses"}),r.jsx(Vp,{underline:"hover",color:"inherit",onClick:B,sx:{cursor:"pointer"},children:o.title}),r.jsxs(C,{color:"text.primary",sx:{color:"#E5E7EB"},children:["Module ",k?.title]}),r.jsx(C,{color:"text.primary",sx:{color:"#fff",fontWeight:600},children:p})]})}),r.jsxs(G,{direction:"row",spacing:2,children:[r.jsx(ye,{variant:"outlined",onClick:I,disabled:d,sx:{borderColor:"#374151",color:"#fff",textTransform:"none","&:hover":{borderColor:"#6B7280"}},children:d?"Saving...":"Save Draft"}),r.jsx(ye,{variant:"contained",onClick:I,endIcon:r.jsx(yz,{fontSize:"small"}),sx:{bgcolor:"#1152D4",textTransform:"none","&:hover":{bgcolor:"#0D42AF"}},children:"Publish Lesson"})]})]}),r.jsxs(E,{sx:{display:"flex",flex:1,overflow:"hidden"},children:[r.jsx(E,{sx:{flex:1,overflowY:"auto",p:4,bgcolor:"#080D19"},children:r.jsxs(E,{sx:{maxWidth:800,mx:"auto"},children:[r.jsxs(E,{sx:{mb:4},children:[r.jsx(C,{variant:"caption",sx:{color:"#6B7280",fontWeight:700,letterSpacing:1,mb:1,display:"block"},children:"LESSON TITLE"}),r.jsx(sr,{value:p,onChange:L=>g(L.target.value),fullWidth:!0,sx:{fontSize:"2rem",fontWeight:700,color:"#fff","& input":{p:0}},placeholder:"Enter lesson title..."})]}),r.jsxs(E,{sx:{mb:4},children:[r.jsx(C,{variant:"caption",sx:{color:"#6B7280",fontWeight:700,letterSpacing:1,mb:1.5,display:"block"},children:"DESCRIPTION & INSTRUCTIONS"}),r.jsx(Je,{sx:{bgcolor:"#111827",border:"1px solid #1F2937",borderRadius:2,overflow:"hidden","& .ql-toolbar":{bgcolor:"#1F2937",borderBottom:"1px solid #374151",borderColor:"transparent"},"& .ql-container":{bgcolor:"#111827",borderColor:"transparent",minHeight:200,fontSize:"1rem"},"& .ql-editor":{color:"#D1D5DB"},"& .ql-stroke":{stroke:"#9CA3AF"},"& .ql-fill":{fill:"#9CA3AF"},"& .ql-picker":{color:"#9CA3AF"}},children:r.jsx(eh,{theme:"snow",value:x,onChange:b,placeholder:"Write a description or instructions for this lesson..."})})]}),r.jsx(E,{sx:{mb:4},children:r.jsxs(Je,{sx:{border:"2px dashed #374151",bgcolor:"transparent",p:4,borderRadius:2,textAlign:"center",cursor:"pointer","&:hover":{borderColor:"#3B82F6",bgcolor:"rgba(59, 130, 246, 0.05)"}},children:[r.jsx(Bu,{sx:{fontSize:40,color:"#3B82F6",mb:1}}),r.jsx(C,{sx:{color:"#fff",fontWeight:600},children:"Click to upload or drag and drop"}),r.jsxs(C,{variant:"caption",sx:{color:"#6B7280"},children:["Video (MP4), Documents (PDF), or create a ",r.jsx(Vp,{href:"#",sx:{color:"#3B82F6"},children:"New Quiz"})]})]})}),r.jsxs(E,{children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:2},children:[r.jsx(C,{variant:"h6",sx:{color:"#fff",fontSize:"1.1rem",fontWeight:600},children:"Lesson Content"}),r.jsx(C,{variant:"caption",sx:{color:"#3B82F6",cursor:"pointer"},children:"Expand All | Collapse All"})]}),r.jsxs(G,{spacing:2,children:[r.jsxs(Je,{sx:{p:2,bgcolor:"#1A2230",border:"1px solid #1F2937",borderRadius:2,display:"flex",alignItems:"center",gap:2},children:[r.jsx(kf,{sx:{color:"#6B7280",cursor:"move"}}),r.jsx(E,{sx:{p:1,bgcolor:"rgba(239, 68, 68, 0.1)",borderRadius:1},children:r.jsx(jo,{sx:{color:"#EF4444"}})}),r.jsxs(E,{sx:{flex:1},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:500,fontSize:"0.95rem"},children:"Video_Intro_Transparency.mp4"}),r.jsx(C,{variant:"caption",sx:{color:"#6B7280"},children:"10:00 mins • 45 MB"})]}),r.jsx(Pt,{label:"Ready",size:"small",sx:{bgcolor:"rgba(16, 185, 129, 0.1)",color:"#10B981",height:24}}),r.jsxs(G,{direction:"row",spacing:1,children:[r.jsx(Ve,{size:"small",sx:{color:"#6B7280"},children:r.jsx(Ws,{fontSize:"small"})}),r.jsx(Ve,{size:"small",sx:{color:"#6B7280"},children:r.jsx(Bi,{fontSize:"small"})}),r.jsx(Ve,{size:"small",sx:{color:"#EF4444"},children:r.jsx(ss,{fontSize:"small"})})]})]}),r.jsxs(Je,{sx:{p:2,bgcolor:"#1A2230",border:"1px solid #1F2937",borderRadius:2,display:"flex",alignItems:"center",gap:2},children:[r.jsx(kf,{sx:{color:"#6B7280",cursor:"move"}}),r.jsx(E,{sx:{p:1,bgcolor:"rgba(245, 158, 11, 0.1)",borderRadius:1},children:r.jsx(Hf,{sx:{color:"#F59E0B"}})}),r.jsxs(E,{sx:{flex:1},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:500,fontSize:"0.95rem"},children:"Case_Study_Brazil_2023.pdf"}),r.jsx(E,{sx:{width:100,height:4,bgcolor:"#374151",borderRadius:2,mt:.5},children:r.jsx(E,{sx:{width:"60%",height:"100%",bgcolor:"#3B82F6",borderRadius:2}})})]}),r.jsx(Pt,{label:"Processing..",size:"small",sx:{bgcolor:"rgba(59, 130, 246, 0.1)",color:"#3B82F6",height:24}}),r.jsxs(G,{direction:"row",spacing:1,children:[r.jsx(Ve,{size:"small",sx:{color:"#6B7280"},children:r.jsx(Ws,{fontSize:"small"})}),r.jsx(Ve,{size:"small",sx:{color:"#EF4444"},children:r.jsx(ss,{fontSize:"small"})})]})]}),r.jsxs(Je,{sx:{p:2,bgcolor:"#1A2230",border:"1px solid #1F2937",borderRadius:2,display:"flex",alignItems:"center",gap:2},children:[r.jsx(kf,{sx:{color:"#6B7280",cursor:"move"}}),r.jsx(E,{sx:{p:1,bgcolor:"rgba(16, 185, 129, 0.1)",borderRadius:1},children:r.jsx(xz,{sx:{color:"#10B981"}})}),r.jsxs(E,{sx:{flex:1},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:500,fontSize:"0.95rem"},children:"Unit 3 Assessment: Pillars of Governance"}),r.jsx(C,{variant:"caption",sx:{color:"#6B7280"},children:"10 Questions • Multiple Choice"})]}),r.jsx(Pt,{label:"Active",size:"small",sx:{bgcolor:"rgba(16, 185, 129, 0.1)",color:"#10B981",height:24}}),r.jsxs(G,{direction:"row",spacing:1,children:[r.jsx(Ve,{size:"small",sx:{color:"#6B7280"},children:r.jsx(Ws,{fontSize:"small"})}),r.jsx(Ve,{size:"small",sx:{color:"#6B7280"},children:r.jsx(Bi,{fontSize:"small"})}),r.jsx(Ve,{size:"small",sx:{color:"#EF4444"},children:r.jsx(ss,{fontSize:"small"})})]})]})]})]})]})}),r.jsxs(Je,{square:!0,sx:{width:350,bgcolor:"#111827",borderLeft:"1px solid #1F2937",display:"flex",flexDirection:"column",flexShrink:0},children:[r.jsx(E,{sx:{p:3,borderBottom:"1px solid #1F2937"},children:r.jsx(C,{variant:"h6",sx:{color:"#fff",fontSize:"1rem",fontWeight:600},children:"Lesson Settings"})}),r.jsx(E,{sx:{p:3,overflowY:"auto",flex:1},children:r.jsxs(G,{spacing:4,children:[r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#fff",fontSize:"0.9rem",fontWeight:500},children:"Visibility"}),r.jsx(C,{variant:"caption",sx:{color:"#9CA3AF"},children:"Visible to enrolled students"})]}),r.jsx(IS,{checked:j,onChange:L=>A(L.target.checked),color:"primary"})]}),r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:"#9CA3AF",fontWeight:700,mb:1,display:"block"},children:"EST. DURATION (MINUTES)"}),r.jsx(it,{fullWidth:!0,type:"number",value:y,onChange:L=>S(L.target.value),size:"small",placeholder:"e.g. 45",InputProps:{startAdornment:r.jsx(Fc,{sx:{color:"#6B7280",mr:1,fontSize:20}})},sx:{bgcolor:"#1F2937","& input":{color:"#fff"},"& fieldset":{borderColor:"#374151"}}})]}),r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:"#9CA3AF",fontWeight:700,mb:1,display:"block"},children:"DIFFICULTY LEVEL"}),r.jsxs(Fn,{fullWidth:!0,value:M,onChange:L=>R(L.target.value),size:"small",sx:{bgcolor:"#1F2937",color:"#fff","& .MuiOutlinedInput-notchedOutline":{borderColor:"#374151"},"& .MuiSvgIcon-root":{color:"#6B7280"}},children:[r.jsx(It,{value:"Beginner",children:"Beginner"}),r.jsx(It,{value:"Intermediate",children:"Intermediate"}),r.jsx(It,{value:"Advanced",children:"Advanced"})]})]}),r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:"#9CA3AF",fontWeight:700,mb:1,display:"block"},children:"TAGS"}),r.jsxs(G,{direction:"row",flexWrap:"wrap",gap:1,sx:{mb:1},children:[r.jsx(Pt,{label:"Governance",onDelete:()=>{},size:"small",sx:{bgcolor:"#1152D4",color:"#fff"}}),r.jsx(Pt,{label:"Policy",onDelete:()=>{},size:"small",sx:{bgcolor:"#1152D4",color:"#fff"}}),_.map((L,O)=>r.jsx(Pt,{label:L,onDelete:()=>P(L),size:"small",sx:{bgcolor:"#374151",color:"#fff"}},O))]}),r.jsx(it,{fullWidth:!0,value:F,onChange:L=>N(L.target.value),onKeyPress:H,placeholder:"Add a tag...",size:"small",sx:{bgcolor:"#1F2937","& input":{color:"#fff"},"& fieldset":{borderColor:"#374151"}}})]}),r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:"#9CA3AF",fontWeight:700,mb:1,display:"block"},children:"LESSON THUMBNAIL"}),r.jsx(E,{sx:{height:120,bgcolor:"#0f172a",borderRadius:2,border:"1px solid #1F2937",backgroundImage:"linear-gradient(to bottom right, #0f172a, #1e293b)",display:"flex",alignItems:"center",justifyContent:"center"},children:r.jsx(E,{sx:{width:"100%",height:"100%",opacity:.5,background:"radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.2), transparent)"}})})]})]})}),r.jsx(E,{sx:{p:3,borderTop:"1px solid #1F2937"},children:r.jsx(ye,{fullWidth:!0,startIcon:r.jsx(ss,{}),sx:{color:"#9CA3AF",textTransform:"none","&:hover":{color:"#EF4444",bgcolor:"rgba(239, 68, 68, 0.1)"}},children:"Delete Lesson"})})]})]})]})},Iye=e=>{switch(e){case"video":return r.jsx(jo,{});case"reading":case"text":return r.jsx(Hf,{});case"file":case"document":return r.jsx(Ab,{});default:return r.jsx(Hf,{})}},Fye=()=>{const{courseId:e}=Vu(),t=Dn(),[n,s]=v.useState(null),[o,a]=v.useState([]),[l,u]=v.useState(!0),[d,f]=v.useState(null),[p,g]=v.useState(0),[x,b]=v.useState(!1),[y,S]=v.useState({open:!1,message:"",severity:"success"}),[j,A]=v.useState(!1),[M,R]=v.useState(""),[_,z]=v.useState(""),[F,N]=v.useState(!1),[I,B]=v.useState(""),[H,P]=v.useState(""),[k,L]=v.useState(0),[O,W]=v.useState(0),[D,q]=v.useState(""),[K,Y]=v.useState(""),[ie,V]=v.useState(null),[re,fe]=v.useState(null),[ae,ue]=v.useState(!1),[se,J]=v.useState(null),[ce,oe]=v.useState({new_amount:"",new_currency:"USD",reason:""});v.useEffect(()=>{e&&(async()=>{try{u(!0),f(null);const pe=await vs.getCourseDetail(e);s(pe);try{const Q=await jf.listModules(e),me=Q?.data??Q??[],we=await Promise.all(me.map(async et=>{try{const ct=(await ra.listLessons(et.id))?.data??[];return{...et,lessons:ct}}catch(ht){return console.warn(`Failed to load lessons for module ${et.id}`,ht),S({open:!0,message:"Failed to load lessons (check login/token)",severity:"error"}),{...et,lessons:[]}}}));a(we)}catch(Q){console.warn("Could not fetch modules:",Q),a([])}try{const Q=await vs.listPriceChanges({status:"pending"}),me=(Q?.data||Q||[]).find(we=>we.course_id===e);J(me||null)}catch(Q){console.warn("Could not fetch price changes:",Q)}}catch(pe){console.error("Error fetching course:",pe),f("Failed to load course details.")}finally{u(!1)}})()},[e]);const ge=()=>{t("/tutor/courses")},de=async()=>{if(!ce.new_amount||!ce.reason){S({open:!0,message:"Please fill in all fields",severity:"warning"});return}try{b(!0),await vs.requestPriceChange(e,{new_amount:parseFloat(ce.new_amount),new_currency:ce.new_currency,reason:ce.reason}),S({open:!0,message:"Price change requested successfully. Awaiting admin approval.",severity:"success"}),ue(!1),oe({new_amount:"",new_currency:"USD",reason:""})}catch(Z){console.error("Failed to request price change:",Z),S({open:!0,message:Z.message||"Failed to request price change",severity:"error"})}finally{b(!1)}},le=async(Z,pe)=>{try{b(!0);const Q=await ra.publishLesson(Z,pe);a(me=>me.map(we=>we.id===Z?{...we,lessons:(we.lessons||[]).map(et=>et.id===pe?Q:et)}:we)),S({open:!0,message:"Lesson published",severity:"success"})}catch(Q){console.error("Error publishing lesson:",Q);const me=Q?.data?.message||Q.message||"Failed to publish lesson";S({open:!0,message:me,severity:"error"})}finally{b(!1)}},ee=async(Z,pe)=>{try{b(!0);const Q=await ra.unpublishLesson(Z,pe);a(me=>me.map(we=>we.id===Z?{...we,lessons:(we.lessons||[]).map(et=>et.id===pe?Q:et)}:we)),S({open:!0,message:"Lesson unpublished",severity:"success"})}catch(Q){console.error("Error unpublishing lesson:",Q);const me=Q?.data?.message||Q.message||"Failed to unpublish lesson";S({open:!0,message:me,severity:"error"})}finally{b(!1)}},X=(Z,pe)=>{t(`/tutor/courses/${e}/modules/${Z}/lessons/${pe}`)},ve=async(Z,pe,Q=6,me=1e3)=>{const we=et=>new Promise(ht=>setTimeout(ht,et));for(let et=0;et<Q;et++){try{const ct=(await ra.listLessons(Z)).data;if(console.debug(`Retry attempt ${et+1} for module ${Z}:`,ct),pe&&ct.find(bt=>bt.id===pe))return a(bt=>bt.map(wt=>wt.id===Z?{...wt,lessons:ct}:wt)),ct;if(et===Q-1)return a(bt=>bt.map(wt=>wt.id===Z?{...wt,lessons:ct}:wt)),ct}catch(ht){console.warn("Error listing lessons during retry:",ht)}await we(me)}return null},st=async()=>{try{b(!0),await vs.publishCourse(e),s(Z=>({...Z,status:"published",is_published:!0})),S({open:!0,message:"Course published successfully!",severity:"success"})}catch(Z){console.error("Error publishing course:",Z),S({open:!0,message:Z.message||"Failed to publish course",severity:"error"})}finally{b(!1)}},Ge=async()=>{try{b(!0),await vs.unpublishCourse(e),s(Z=>({...Z,status:"draft",is_published:!1})),S({open:!0,message:"Course unpublished successfully!",severity:"success"})}catch(Z){console.error("Error unpublishing course:",Z),S({open:!0,message:Z.message||"Failed to unpublish course",severity:"error"})}finally{b(!1)}},qe=async()=>{if(window.confirm("Are you sure you want to archive this course?"))try{b(!0),await vs.archiveCourse(e),s(Z=>({...Z,status:"archived"})),S({open:!0,message:"Course archived successfully!",severity:"success"})}catch(Z){console.error("Error archiving course:",Z),S({open:!0,message:Z.message||"Failed to archive course",severity:"error"})}finally{b(!1)}},Be=async()=>{if(window.confirm("Are you sure you want to delete this course? This action cannot be undone."))try{b(!0),await vs.deleteCourse(e),S({open:!0,message:"Course deleted successfully!",severity:"success"}),setTimeout(()=>t("/tutor/courses"),1500)}catch(Z){console.error("Error deleting course:",Z),S({open:!0,message:Z.message||"Failed to delete course",severity:"error"}),b(!1)}},Te=async Z=>{try{b(!0);const pe=await jf.publishModule(e,Z);a(Q=>Q.map(me=>me.id===Z?{...pe,lessons:me.lessons||pe.lessons||[]}:me)),S({open:!0,message:"Module published",severity:"success"})}catch(pe){console.error("Error publishing module:",pe);const Q=pe?.data?.message||pe.message||"Failed to publish module";S({open:!0,message:Q,severity:"error"})}finally{b(!1)}},Re=async Z=>{try{b(!0);const pe=await jf.unpublishModule(e,Z);a(Q=>Q.map(me=>me.id===Z?{...pe,lessons:me.lessons||pe.lessons||[]}:me)),S({open:!0,message:"Module unpublished",severity:"success"})}catch(pe){console.error("Error unpublishing module:",pe);const Q=pe?.data?.message||pe.message||"Failed to unpublish module";S({open:!0,message:Q,severity:"error"})}finally{b(!1)}},Se=async()=>{if(!String(M).trim()){S({open:!0,message:"Module title is required",severity:"error"});return}try{b(!0);const Z={title:M.trim(),description:_,position:(o.length||0)+1},pe=await jf.createModule(e,Z);a(Q=>[...Q,{...pe,lessons:pe.lessons||[]}]),A(!1),R(""),z(""),S({open:!0,message:"Module created",severity:"success"})}catch(Z){console.error("Error creating module:",Z);const pe=Z?.data||Z?.response||null;let Q=Z.message||"Failed to create module";if(pe&&(pe.message&&(Q=pe.message),pe.errors))try{const me=Object.values(pe.errors).flat().slice(0,3);me.length&&(Q=me.join(" "))}catch{}S({open:!0,message:Q,severity:"error"})}finally{b(!1)}},Ke=async()=>{if(!re)return;const Z=String(I).trim();if(!Z){S({open:!0,message:"Lesson title is required",severity:"error"});return}if(!String(D).replace(/<(.|\n)*?>/g,"").trim()){S({open:!0,message:"Please provide lesson content",severity:"error"});return}const Q=String(H).trim(),me=/^https?:\/\//.test(Q);if(Q&&!me){S({open:!0,message:"Video URL must start with http:// or https://",severity:"error"});return}const we=(parseInt(k)||0)*60+(parseInt(O)||0);try{b(!0);const et="video";let ht;if(ie){const ct=new FormData;ct.append("title",Z),ct.append("type",et),ct.append("video_file",ie),ct.append("content",D),we&&ct.append("duration_minutes",String(we)),ht=await ra.createLessonMultipart(re,ct)}else{const ct={title:Z,type:et,content:D};we&&(ct.duration_minutes=we),me&&(ct.video_url=Q),ht=await ra.createLesson(re,ct)}console.debug("Lesson create response:",ht);try{try{await ve(re,ht.id,6,1e3)}catch(ct){console.warn("Retry refresh failed, falling back to local insert:",ct),a(bt=>bt.map(wt=>wt.id===re?{...wt,lessons:[...wt.lessons||[],ht]}:wt))}}catch(ct){console.error("Error uploading lesson media or refreshing module:",ct),S({open:!0,message:ct?.data?.message||ct.message||"Failed to upload media",severity:"error"}),a(bt=>bt.map(wt=>wt.id===re?{...wt,lessons:[...wt.lessons||[],ht]}:wt))}N(!1),fe(null),B(""),P(""),L(0),W(0),q(""),Y(""),V(null),S({open:!0,message:"Lesson created",severity:"success"})}catch(et){console.error("Error creating lesson:",et),S({open:!0,message:et.message||"Failed to create lesson",severity:"error"})}finally{b(!1)}},ot=(Z,pe)=>{t(`/tutor/courses/${e}/modules/${Z}/lessons/${pe}/questions`)};if(l)return r.jsx(E,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",bgcolor:"#080D19"},children:r.jsx(nn,{sx:{color:"#1152D4"}})});if(d||!n)return r.jsxs(E,{sx:{p:4,bgcolor:"#080D19",minHeight:"100vh",color:"#fff"},children:[r.jsx(C,{color:"error",children:d||"Course not found"}),r.jsx(ye,{onClick:ge,sx:{mt:2,color:"#fff"},children:"Back to Courses"})]});const He=n.status==="published"||n.status==="active"||n.is_published,$e=o.reduce((Z,pe)=>Z+(pe.lessons?.length||0),0);return r.jsxs(E,{sx:{bgcolor:"#0C1322",minHeight:"100vh",color:"#fff"},children:[r.jsxs(E,{sx:{px:4,py:2,borderBottom:"1px solid #1F2937",display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"#0C1322"},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(Ve,{onClick:ge,sx:{color:"#9CA3AF"},children:r.jsx(fa,{})}),r.jsxs(E,{children:[r.jsx(C,{variant:"h6",sx:{fontWeight:700,lineHeight:1.2},children:n.title}),r.jsxs(G,{direction:"row",spacing:1,alignItems:"center",sx:{mt:.5},children:[r.jsx(Pt,{label:He?"Published":n.status||"Draft",size:"small",sx:{height:20,fontSize:"0.7rem",bgcolor:He?"rgba(16, 185, 129, 0.15)":"rgba(245, 158, 11, 0.15)",color:He?"#10B981":"#F59E0B",textTransform:"capitalize"}}),r.jsxs(C,{variant:"caption",sx:{color:"#6B7280"},children:["Last updated ",n.updated_at?new Date(n.updated_at).toLocaleDateString():"-"]})]})]})]}),r.jsxs(G,{direction:"row",spacing:2,children:[r.jsx(ye,{variant:"outlined",onClick:()=>window.open(`/courses/${e}/preview`,"_blank"),sx:{borderColor:"#374151",color:"#fff",textTransform:"none","&:hover":{borderColor:"#6B7280"}},children:"Preview"}),r.jsx(ye,{variant:"contained",onClick:He?Ge:st,disabled:x||n.status==="pending",sx:{bgcolor:He?"#F59E0B":n.status==="pending"?"#4B5563":"#1152D4",textTransform:"none",fontWeight:600,"&:hover":{bgcolor:He?"#D97706":n.status==="pending"?"#4B5563":"#0D42AF"}},children:x?r.jsx(nn,{size:20,sx:{color:"#fff"}}):He?"Unpublish":n.status==="pending"?"Under Review":"Publish Course"})]})]}),n.status==="draft"&&n.meta&&n.meta.review&&n.meta.review.reason&&r.jsx(E,{sx:{p:4,pb:0},children:r.jsxs(Wt,{severity:"error",variant:"filled",sx:{bgcolor:"rgba(239, 68, 68, 0.1)",color:"#EF4444",border:"1px solid rgba(239, 68, 68, 0.3)","& .MuiAlert-icon":{color:"#EF4444"}},children:[r.jsx(C,{variant:"subtitle2",fontWeight:"bold",children:"Course Rejected"}),r.jsx(C,{variant:"body2",children:n.meta.review.reason})]})}),r.jsx(E,{sx:{px:4,pt:2,borderBottom:"1px solid #1F2937",bgcolor:"#0C1322"},children:r.jsxs(Zg,{value:p,onChange:(Z,pe)=>g(pe),sx:{"& .MuiTab-root":{color:"#9CA3AF",textTransform:"none",fontWeight:500,fontSize:"0.95rem",minHeight:48,"&.Mui-selected":{color:"#3B82F6"}},"& .MuiTabs-indicator":{bgcolor:"#3B82F6"}},children:[r.jsx(Qs,{label:"Curriculum"}),r.jsx(Qs,{label:"Course Details"}),r.jsx(Qs,{label:"Settings"})]})}),r.jsxs(E,{sx:{maxWidth:1e3,mx:"auto",p:4},children:[p===0&&r.jsxs(E,{children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:3},children:[r.jsxs(C,{variant:"h6",sx:{fontWeight:600},children:["Course Content (",o.length," modules, ",$e," lessons)"]}),r.jsx(ye,{startIcon:r.jsx(Br,{}),variant:"contained",onClick:()=>A(!0),sx:{bgcolor:"#1152D4",textTransform:"none","&:hover":{bgcolor:"#0D42AF"}},children:"Add Module"})]}),o&&o.length>0?r.jsx(G,{spacing:2,children:o.map((Z,pe)=>r.jsx(Je,{sx:{bgcolor:"#1A2230",borderRadius:2,border:"1px solid #1F2937",overflow:"hidden"},children:r.jsxs(Fu,{defaultExpanded:pe===0,disableGutters:!0,sx:{bgcolor:"transparent",boxShadow:"none","&:before":{display:"none"}},children:[r.jsx(Lu,{component:"div",expandIcon:r.jsx(ti,{sx:{color:"#6B7280"}}),children:r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,sx:{width:"100%",pr:2},children:[r.jsxs(C,{sx:{color:"#E5E7EB",fontWeight:600},children:["Module ",pe+1,": ",Z.title]}),r.jsx(Pt,{label:`${Z.lessons?.length||0} lessons`,size:"small",sx:{bgcolor:"rgba(255,255,255,0.05)",color:"#9CA3AF",height:20,fontSize:"0.7rem"}}),r.jsx(E,{sx:{flex:1}}),r.jsx(Ve,{size:"small",onClick:Q=>{Q.stopPropagation(),Z.is_published?Re(Z.id):Te(Z.id)},sx:{color:Z.is_published?"#10B981":"#6B7280"},children:r.jsx(W0,{fontSize:"small"})}),r.jsx(Ve,{size:"small",onClick:Q=>Q.stopPropagation(),sx:{color:"#6B7280"},children:r.jsx(Ws,{fontSize:"small"})})]})}),r.jsxs(_u,{sx:{pt:0,pb:2},children:[Z.summary&&r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.85rem",mb:2,px:2},children:Z.summary}),r.jsx(Hs,{disablePadding:!0,children:Z.lessons&&Z.lessons.length>0?Z.lessons.map((Q,me)=>r.jsx(Ii,{disablePadding:!0,sx:{mb:1},children:r.jsxs(Jo,{component:"div",onClick:()=>X(Z.id,Q.id),sx:{bgcolor:"#0F172A",borderRadius:1,border:"1px solid transparent","&:hover":{bgcolor:"#1E293B",borderColor:"rgba(59, 130, 246, 0.3)"},display:"flex",alignItems:"center",px:1},children:[r.jsx(Tl,{sx:{minWidth:40,color:"#3B82F6"},children:Iye(Q.type)}),r.jsx(Js,{primary:Q.title,secondary:r.jsxs(C,{variant:"caption",sx:{color:"#6B7280",display:"flex",alignItems:"center",gap:1},children:[Q.type||"Lesson"," • ",Q.duration||Q.duration_minutes||0," min"]}),primaryTypographyProps:{color:"#fff",fontSize:"0.9rem",fontWeight:500}}),r.jsx(Ve,{size:"small",onClick:we=>{we.stopPropagation(),Q.is_published?ee(Z.id,Q.id):le(Z.id,Q.id)},sx:{color:Q.is_published?"#10B981":"#6B7280",mr:1},children:r.jsx(W0,{fontSize:"small"})}),r.jsx(Ve,{size:"small",onClick:we=>{we.stopPropagation(),ot(Z.id,Q.id)},sx:{color:"#3B82F6",mr:1},title:"Manage questions",children:r.jsx(hr,{fontSize:"small"})}),r.jsx(Ve,{size:"small",sx:{color:"#6B7280"},children:r.jsx(Ws,{fontSize:"small"})})]})},Q.id)):r.jsx(C,{sx:{color:"#6B7280",textAlign:"center",py:2},children:"No lessons in this module yet"})}),r.jsx(ye,{fullWidth:!0,startIcon:r.jsx(Br,{}),onClick:()=>{fe(Z.id),B(""),q(""),P(""),V(null),Y(""),L(0),W(0),N(!0)},sx:{mt:1,color:"#3B82F6",bgcolor:"rgba(59, 130, 246, 0.05)","&:hover":{bgcolor:"rgba(59, 130, 246, 0.1)"},textTransform:"none"},children:"Add Lesson"})]})]})},Z.id))}):r.jsxs(Je,{sx:{p:6,textAlign:"center",bgcolor:"#1A2230",border:"1px dashed #374151",borderRadius:2},children:[r.jsx(hr,{sx:{fontSize:60,color:"#374151",mb:2}}),r.jsx(C,{sx:{color:"#9CA3AF",mb:2},children:"No modules created yet."}),r.jsx(ye,{variant:"outlined",startIcon:r.jsx(Br,{}),onClick:()=>A(!0),sx:{borderColor:"#374151",color:"#9CA3AF"},children:"Create First Module"})]})]}),p===1&&r.jsxs(E,{children:[r.jsx(C,{variant:"h6",sx:{fontWeight:600,mb:3},children:"Course Details"}),r.jsxs(G,{spacing:3,children:[n.thumbnail_url&&r.jsxs(Je,{sx:{bgcolor:"#1A2230",p:2,borderRadius:2,border:"1px solid #1F2937"},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Thumbnail"}),r.jsx(E,{component:"img",src:Ru(n.thumbnail_url),alt:"Course thumbnail",sx:{width:"100%",maxWidth:400,borderRadius:1}})]}),r.jsxs(Je,{sx:{bgcolor:"#1A2230",p:3,borderRadius:2,border:"1px solid #1F2937"},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:2},children:"Basic Information"}),r.jsxs(G,{spacing:2,children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Title"}),r.jsx(C,{sx:{color:"#fff",fontWeight:500},children:n.title})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Slug"}),r.jsx(C,{sx:{color:"#9CA3AF"},children:n.slug||"-"})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Summary"}),r.jsx(C,{sx:{color:"#9CA3AF"},children:n.summary||"-"})]}),n.description&&r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Description"}),r.jsx(C,{sx:{color:"#9CA3AF"},dangerouslySetInnerHTML:{__html:n.description}})]})]})]}),r.jsxs(Je,{sx:{bgcolor:"#1A2230",p:3,borderRadius:2,border:"1px solid #1F2937"},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:2},children:"Course Attributes"}),r.jsxs(E,{sx:{display:"flex",flexWrap:"wrap",gap:3},children:[r.jsxs(E,{sx:{minWidth:150},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.5},children:[r.jsx(hr,{sx:{fontSize:16,color:"#6B7280"}}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Level"})]}),r.jsx(C,{sx:{color:"#fff",textTransform:"capitalize"},children:n.level||"-"})]}),r.jsxs(E,{sx:{minWidth:150},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.5},children:[r.jsx(mg,{sx:{fontSize:16,color:"#6B7280"}}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Language"})]}),r.jsx(C,{sx:{color:"#fff",textTransform:"uppercase"},children:n.language||"-"})]}),r.jsxs(E,{sx:{minWidth:150},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.5},children:[r.jsx(jz,{sx:{fontSize:16,color:"#6B7280"}}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Duration"})]}),r.jsxs(C,{sx:{color:"#fff"},children:[n.duration_minutes||0," minutes"]})]}),r.jsxs(E,{sx:{minWidth:150},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.5},children:[r.jsx(a1,{sx:{fontSize:16,color:"#6B7280"}}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Price"})]}),r.jsx(C,{sx:{color:"#fff",fontWeight:600},children:n.price>0?Ko(n.price,n.currency):"Free"}),se&&r.jsxs(G,{direction:"row",alignItems:"center",spacing:.5,sx:{color:"#3B82F6",mt:.5},children:[r.jsx(Gp,{sx:{fontSize:12}}),r.jsx(C,{variant:"caption",sx:{fontWeight:600},children:Ko(se.new_amount,se.new_currency)})]})]})]})]}),n.categories&&n.categories.length>0&&r.jsxs(Je,{sx:{bgcolor:"#1A2230",p:3,borderRadius:2,border:"1px solid #1F2937"},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:2},children:"Categories"}),r.jsx(G,{direction:"row",spacing:1,flexWrap:"wrap",children:n.categories.map(Z=>r.jsx(Pt,{label:Z.name,size:"small",sx:{bgcolor:"#374151",color:"#9CA3AF"}},Z.id))})]}),r.jsxs(Je,{sx:{bgcolor:"#1A2230",p:3,borderRadius:2,border:"1px solid #1F2937"},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:2},children:"Timestamps"}),r.jsxs(G,{direction:"row",spacing:4,children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Created"}),r.jsx(C,{sx:{color:"#9CA3AF"},children:n.created_at?new Date(n.created_at).toLocaleString():"-"})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Updated"}),r.jsx(C,{sx:{color:"#9CA3AF"},children:n.updated_at?new Date(n.updated_at).toLocaleString():"-"})]}),n.published_at&&r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Published"}),r.jsx(C,{sx:{color:"#9CA3AF"},children:new Date(n.published_at).toLocaleString()})]})]})]})]})]}),p===2&&r.jsxs(E,{children:[r.jsx(C,{variant:"h6",sx:{fontWeight:600,mb:3},children:"Course Settings"}),r.jsxs(G,{spacing:3,children:[r.jsxs(Je,{sx:{bgcolor:"#1A2230",p:3,borderRadius:2,border:"1px solid #1F2937"},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:2},children:"Publication Status"}),r.jsxs(G,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#fff",fontWeight:500},children:He?"Course is Published":"Course is Draft"}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.85rem"},children:He?"This course is visible to learners and can be enrolled.":"This course is not yet visible to learners."})]}),r.jsx(ye,{variant:"contained",startIcon:r.jsx(W0,{}),onClick:He?Ge:st,disabled:x,sx:{bgcolor:He?"#F59E0B":"#10B981",textTransform:"none","&:hover":{bgcolor:He?"#D97706":"#059669"}},children:He?"Unpublish":"Publish"})]})]}),r.jsxs(Je,{sx:{bgcolor:"#1A2230",p:3,borderRadius:2,border:"1px solid #1F2937"},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:2},children:"Archive Course"}),r.jsxs(G,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#fff",fontWeight:500},children:"Archive this course"}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.85rem"},children:"Archived courses are hidden from the catalog but retained for records."})]}),r.jsx(ye,{variant:"outlined",startIcon:r.jsx(Ree,{}),onClick:qe,disabled:x||n.status==="archived",sx:{borderColor:"#F59E0B",color:"#F59E0B",textTransform:"none","&:hover":{borderColor:"#D97706",bgcolor:"rgba(245, 158, 11, 0.1)"}},children:n.status==="archived"?"Archived":"Archive"})]})]}),r.jsxs(Je,{sx:{bgcolor:"#1A2230",p:3,borderRadius:2,border:"1px solid #1F2937"},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:2},children:"Certificate Pricing"}),r.jsxs(G,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#fff",fontWeight:500},children:"Request Price Change"}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.85rem"},children:"Request a change for the certificate issuance price. This requires admin approval."}),se&&r.jsxs(C,{sx:{color:"#3B82F6",fontSize:"0.85rem",mt:1,display:"flex",alignItems:"center",gap:.5},children:[r.jsx(Gp,{sx:{fontSize:16}})," Pending Approval: ",Ko(se.new_amount,se.new_currency)]})]}),r.jsx(ye,{variant:"outlined",startIcon:se?r.jsx(Gp,{}):r.jsx(a1,{}),onClick:()=>ue(!0),disabled:x||!!se,sx:{borderColor:se?"#9CA3AF":"#3B82F6",color:se?"#9CA3AF":"#3B82F6",textTransform:"none","&:hover":{borderColor:se?"#9CA3AF":"#2563EB",bgcolor:se?"transparent":"rgba(59, 130, 246, 0.1)"}},children:se?"Pending Approval":"Request Change"})]})]}),r.jsxs(Je,{sx:{bgcolor:"rgba(239, 68, 68, 0.05)",p:3,borderRadius:2,border:"1px solid rgba(239, 68, 68, 0.3)"},children:[r.jsx(C,{sx:{color:"#EF4444",fontSize:"0.85rem",mb:2},children:"Danger Zone"}),r.jsxs(G,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#fff",fontWeight:500},children:"Delete this course"}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.85rem"},children:"Once deleted, this course and all its content cannot be recovered."})]}),r.jsx(ye,{variant:"outlined",startIcon:r.jsx(ss,{}),onClick:Be,disabled:x,sx:{borderColor:"#EF4444",color:"#EF4444",textTransform:"none","&:hover":{borderColor:"#DC2626",bgcolor:"rgba(239, 68, 68, 0.1)"}},children:"Delete Course"})]})]})]})]})]}),r.jsx(tr,{open:j,onClose:()=>A(!1),children:r.jsxs(E,{sx:kr,children:[r.jsxs(E,{sx:{background:"linear-gradient(135deg, #1152D4 0%, #0D42AF 100%)",p:3,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600},children:M?"Edit Module":"Add Module"}),r.jsx(Ve,{onClick:()=>A(!1),sx:{color:"#fff"},children:r.jsx(hs,{})})]}),r.jsxs(E,{sx:{p:3},children:[r.jsxs(G,{spacing:2,children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Module Title"}),r.jsx(it,{fullWidth:!0,placeholder:"e.g. Introduction to the Course",value:M,onChange:Z=>R(Z.target.value),sx:xt})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Description (optional)"}),r.jsx(it,{fullWidth:!0,multiline:!0,rows:3,placeholder:"Brief description of what this module covers",value:_,onChange:Z=>z(Z.target.value),sx:xt})]})]}),r.jsxs(G,{direction:"row",justifyContent:"flex-end",spacing:2,sx:{mt:3},children:[r.jsx(ye,{onClick:()=>A(!1),sx:{color:"#9CA3AF"},children:"Cancel"}),r.jsx(ye,{variant:"contained",onClick:Se,sx:{bgcolor:"#1152D4"},disabled:x,children:"Create"})]})]})]})}),r.jsx(tr,{open:F,onClose:()=>N(!1),children:r.jsxs(E,{sx:{...kr,width:{xs:"95vw",sm:"90vw",md:900},maxHeight:"90vh",display:"flex",flexDirection:"column"},children:[r.jsxs(E,{sx:{background:"linear-gradient(135deg, #1152D4 0%, #0D42AF 100%)",p:3,display:"flex",justifyContent:"space-between",alignItems:"center",flexShrink:0},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600},children:"Add Lesson"}),r.jsx(Ve,{onClick:()=>N(!1),sx:{color:"#fff"},children:r.jsx(hs,{})})]}),r.jsxs(E,{sx:{p:3,overflowY:"auto",flex:1,...kw},children:[r.jsxs(G,{spacing:2,children:[r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Lesson Title"}),r.jsx(it,{fullWidth:!0,placeholder:"e.g. Welcome Video",value:I,onChange:Z=>B(Z.target.value),sx:xt})]}),r.jsxs(E,{children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem"},children:"Video"}),r.jsx(Pt,{label:"Optional",size:"small",sx:{bgcolor:"rgba(156, 163, 175, 0.15)",color:"#9CA3AF",fontSize:"0.7rem",height:20}})]}),r.jsx("input",{type:"file",accept:"video/*",style:{display:"none"},id:"lesson-video-upload",onChange:Z=>{const pe=Z.target.files[0];pe&&(V(pe),Y(pe.name),P(""))}}),r.jsx("label",{htmlFor:"lesson-video-upload",children:r.jsx(E,{sx:{bgcolor:"#1E293B",border:ie||K?"2px solid #10B981":"2px dashed #374151",borderRadius:2,p:3,textAlign:"center",cursor:"pointer","&:hover":{borderColor:"#1152D4"}},children:ie||K?r.jsxs(G,{alignItems:"center",spacing:1,children:[r.jsx(jo,{sx:{fontSize:36,color:"#10B981"}}),r.jsx(C,{sx:{color:"#fff",fontSize:"0.85rem"},children:K}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem"},children:"Click to change"})]}):r.jsxs(G,{alignItems:"center",spacing:1,children:[r.jsx(Bu,{sx:{fontSize:36,color:"#6B7280"}}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem"},children:"Click to upload video"}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.7rem"},children:"MP4, WebM, MOV (max. 500MB)"})]})})}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"0.75rem",textAlign:"center",my:1},children:"— or —"}),r.jsx(it,{fullWidth:!0,placeholder:"Paste a video URL (https://...)",value:H,onChange:Z=>{P(Z.target.value),Z.target.value&&(V(null),Y(""))},sx:xt,slotProps:{htmlInput:{maxLength:2048}}})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Lesson Content"}),r.jsx(E,{sx:{bgcolor:"#1E293B",borderRadius:1.5,border:"1px solid #374151","& .ql-toolbar":{borderTopLeftRadius:6,borderTopRightRadius:6,borderColor:"#374151",bgcolor:"#111827"},"& .ql-container":{borderBottomLeftRadius:6,borderBottomRightRadius:6,borderColor:"#374151",minHeight:220,fontSize:"0.9rem"},"& .ql-editor":{color:"#FFFFFF",minHeight:220},"& .ql-editor.ql-blank::before":{color:"#6B7280",fontStyle:"normal"},"& .ql-stroke":{stroke:"#9CA3AF"},"& .ql-fill":{fill:"#9CA3AF"},"& .ql-picker-label":{color:"#9CA3AF"}},children:r.jsx(eh,{theme:"snow",value:D,onChange:q,placeholder:"Write your lesson content here...",modules:{toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline","strike"],[{list:"ordered"},{list:"bullet"}],["link","blockquote","code-block"],["clean"]]}})})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Duration"}),r.jsxs(G,{direction:"row",spacing:2,alignItems:"center",children:[r.jsx(it,{type:"number",label:"Hours",value:k===0?"":k,onFocus:Z=>Z.target.select(),onChange:Z=>{const pe=Z.target.value;if(pe===""){L(0);return}const Q=Math.max(0,parseInt(pe)||0);L(Q)},slotProps:{htmlInput:{min:0,max:23,placeholder:"0"}},sx:{...xt,width:140,"& .MuiInputLabel-root":{color:"#9CA3AF"}}}),r.jsx(C,{sx:{color:"#6B7280",fontSize:"1.25rem",fontWeight:600},children:":"}),r.jsx(it,{type:"number",label:"Minutes",value:O===0?"":O,onFocus:Z=>Z.target.select(),onChange:Z=>{const pe=Z.target.value;if(pe===""){W(0);return}const Q=Math.min(59,Math.max(0,parseInt(pe)||0));W(Q)},slotProps:{htmlInput:{min:0,max:59,placeholder:"0"}},sx:{...xt,width:140,"& .MuiInputLabel-root":{color:"#9CA3AF"}}})]})]})]}),r.jsxs(G,{direction:"row",justifyContent:"flex-end",spacing:2,sx:{mt:3},children:[r.jsx(ye,{onClick:()=>N(!1),sx:{color:"#9CA3AF"},children:"Cancel"}),r.jsx(ye,{variant:"contained",onClick:Ke,disabled:x,sx:{bgcolor:"#1152D4"},children:"Add Lesson"})]})]})]})}),r.jsx(gs,{open:y.open,autoHideDuration:4e3,onClose:()=>S({...y,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:r.jsx(Wt,{onClose:()=>S({...y,open:!1}),severity:y.severity,sx:{width:"100%"},children:y.message})}),r.jsx(tr,{open:ae,onClose:()=>!x&&ue(!1),children:r.jsxs(E,{sx:kr,children:[r.jsxs(E,{sx:{background:"#2563EB",p:3,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600},children:"Request Price Change"}),r.jsx(Ve,{onClick:()=>ue(!1),sx:{color:"#fff"},disabled:x,children:r.jsx(hs,{})})]}),r.jsxs(E,{sx:{p:3},children:[r.jsxs(G,{spacing:3,children:[r.jsxs(Wt,{severity:"info",sx:{bgcolor:"rgba(59, 130, 246, 0.1)",color:"#3B82F6",border:"1px solid rgba(59, 130, 246, 0.2)"},children:["Current certificate price: ",n?Ko(n.price,n.currency):"..."]}),r.jsxs(E,{sx:{display:"flex",gap:2},children:[r.jsxs(E,{sx:{flex:1},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"New Amount"}),r.jsx(it,{fullWidth:!0,type:"number",placeholder:"0.00",value:ce.new_amount,onChange:Z=>oe(pe=>({...pe,new_amount:Z.target.value})),sx:xt})]}),r.jsxs(E,{sx:{flex:1},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Currency"}),r.jsxs(Fn,{fullWidth:!0,value:ce.new_currency,onChange:Z=>oe(pe=>({...pe,new_currency:Z.target.value})),sx:Yn,MenuProps:Tr,children:[r.jsx(It,{value:"USD",children:"USD ($)"}),r.jsx(It,{value:"NGN",children:"NGN (₦)"}),r.jsx(It,{value:"GBP",children:"GBP (£)"}),r.jsx(It,{value:"EUR",children:"EUR (€)"})]})]})]}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.85rem",mb:1},children:"Reason for Change"}),r.jsx(it,{fullWidth:!0,multiline:!0,rows:3,placeholder:"Explain why you are requesting this price change...",value:ce.reason,onChange:Z=>oe(pe=>({...pe,reason:Z.target.value})),sx:xt})]})]}),r.jsxs(G,{direction:"row",justifyContent:"flex-end",spacing:2,sx:{mt:4},children:[r.jsx(ye,{onClick:()=>ue(!1),sx:{color:"#9CA3AF"},disabled:x,children:"Cancel"}),r.jsx(ye,{variant:"contained",onClick:de,sx:{bgcolor:"#3B82F6","&:hover":{bgcolor:"#2563EB"}},disabled:x,children:x?r.jsx(nn,{size:24,sx:{color:"#fff"}}):"Submit Request"})]})]})]})})]})},_ye=()=>{const{courseId:e,moduleId:t,lessonId:n}=Vu(),s=Dn(),[o,a]=v.useState(null),[l,u]=v.useState(null),[d,f]=v.useState([]),[p,g]=v.useState(!0),[x,b]=v.useState(!1),[y,S]=v.useState({open:!1,message:"",severity:"success"}),[j,A]=v.useState(null),[M,R]=v.useState(""),[_,z]=v.useState("multiple_choice"),[F,N]=v.useState(["","",""]),[I,B]=v.useState(0),[H,P]=v.useState(""),[k,L]=v.useState(1),[O,W]=v.useState(null);v.useEffect(()=>{e&&n&&(async()=>{try{g(!0);const[ue,se]=await Promise.all([vs.getCourseDetail(e),Sp.listQuestions(n)]);a(ue),f(se.data||[]),ue.modules?.forEach(J=>{if(J.id.toString()===t){const ce=J.lessons?.find(oe=>oe.id.toString()===n);ce&&u(ce)}})}catch(ue){console.error("Error fetching data:",ue),S({open:!0,message:"Failed to load lesson data",severity:"error"})}finally{g(!1)}})()},[e,t,n]);const D=()=>{s(`/tutor/courses/${e}`)},q=()=>{R(""),z("multiple_choice"),N(["","",""]),B(0),P(""),L(1),A(null)},K=ae=>{A(ae.id),R(ae.question||ae.prompt||""),z(ae.type||"multiple_choice"),N(ae.options||["","",""]),Array.isArray(ae.correct_answer)&&ae.correct_answer.length>0?B(ae.correct_answer[0]):B(0),P(ae.explanation||""),L(ae.points||1)},Y=async()=>{const ae=String(M).trim();if(!ae){S({open:!0,message:"Question text is required",severity:"error"});return}if((_==="multiple_choice"||_==="true_false")&&F.filter(se=>String(se).trim()).length<2){S({open:!0,message:"At least 2 answer options are required",severity:"error"});return}try{b(!0);const ue={prompt:ae,question:ae,type:_,points:k,explanation:H.trim()};if(_==="multiple_choice"||_==="true_false"){const J=F.map(ce=>String(ce).trim()).filter(Boolean);ue.options=J,ue.correct_answer=[I]}let se;j?(se=await Sp.updateQuestion(j,ue),f(J=>J.map(ce=>ce.id===j?se:ce)),S({open:!0,message:"Question updated successfully",severity:"success"})):(ue.position=d.length+1,se=await Sp.createQuestion(n,ue),f(J=>[...J,se]),S({open:!0,message:"Question added successfully",severity:"success"})),q()}catch(ue){console.error("Error saving question:",ue),S({open:!0,message:ue?.data?.message||ue.message||"Failed to save question",severity:"error"})}finally{b(!1)}},ie=async ae=>{if(window.confirm("Are you sure you want to delete this question?"))try{b(!0),await Sp.deleteQuestion(ae),f(ue=>ue.filter(se=>se.id!==ae)),j===ae&&q(),S({open:!0,message:"Question deleted",severity:"success"})}catch(ue){console.error("Error deleting question:",ue),S({open:!0,message:"Failed to delete question",severity:"error"})}finally{b(!1)}},V=(ae,ue)=>{W(ue),ae.dataTransfer.effectAllowed="move"},re=ae=>{ae.preventDefault(),ae.dataTransfer.dropEffect="move"},fe=async(ae,ue)=>{if(ae.preventDefault(),O===ue){W(null);return}const se=d.findIndex(ce=>ce.id===O),J=d.findIndex(ce=>ce.id===ue);if(se>-1&&J>-1){const ce=[...d],[oe]=ce.splice(se,1);ce.splice(J,0,oe),f(ce);try{const ge=ce.map((de,le)=>({id:de.id,position:le+1}));await Sp.reorderQuestions(n,ge),S({open:!0,message:"Questions reordered",severity:"success"})}catch(ge){console.error("Error reordering questions:",ge),S({open:!0,message:"Failed to save new order",severity:"error"})}}W(null)};return p?r.jsx(E,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",bgcolor:"#080D19"},children:r.jsx(nn,{sx:{color:"#1152D4"}})}):r.jsxs(E,{sx:{bgcolor:"#080D19",minHeight:"100vh",color:"#fff"},children:[r.jsxs(E,{sx:{px:4,py:2,borderBottom:"1px solid #1F2937",bgcolor:"#0C1322",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(Ve,{onClick:D,sx:{color:"#9CA3AF"},children:r.jsx(fa,{})}),r.jsxs(E,{children:[r.jsxs(xC,{separator:"/",sx:{color:"#9CA3AF",fontSize:"0.85rem"},children:[r.jsx(Vp,{underline:"hover",color:"inherit",onClick:()=>s("/tutor/courses"),sx:{cursor:"pointer"},children:"Courses"}),r.jsx(Vp,{underline:"hover",color:"inherit",onClick:D,sx:{cursor:"pointer"},children:o?.title}),r.jsx(C,{sx:{color:"#fff",fontWeight:600},children:"Manage Questions"})]}),r.jsx(C,{variant:"h6",sx:{color:"#fff",mt:.5,fontWeight:700},children:l?.title})]})]}),r.jsx(ye,{variant:"contained",startIcon:r.jsx(fr,{}),onClick:D,sx:{bgcolor:"#1152D4",textTransform:"none","&:hover":{bgcolor:"#0D42AF"}},children:"Done"})]}),r.jsxs(E,{sx:{display:"flex",height:"calc(100vh - 85px)",overflow:"hidden"},children:[r.jsxs(E,{sx:{width:350,borderRight:"1px solid #1F2937",bgcolor:"#0C1322",display:"flex",flexDirection:"column",overflow:"hidden"},children:[r.jsxs(E,{sx:{p:3,borderBottom:"1px solid #1F2937",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r.jsxs(C,{variant:"subtitle1",sx:{fontWeight:600},children:["Questions (",d.length,")"]}),r.jsx(tn,{title:"Reset Form",children:r.jsx(Ve,{size:"small",onClick:q,sx:{color:"#3B82F6"},children:r.jsx(Br,{})})})]}),r.jsx(E,{sx:{flex:1,overflowY:"auto",p:2},children:d.length===0?r.jsxs(E,{sx:{textAlign:"center",py:8,opacity:.5},children:[r.jsx(hr,{sx:{fontSize:48,mb:1}}),r.jsx(C,{variant:"body2",children:"No questions yet"}),r.jsx(C,{variant:"caption",children:"Add your first question to the right"})]}):r.jsx(G,{spacing:1.5,children:d.map((ae,ue)=>r.jsx(Je,{draggable:!0,onDragStart:se=>V(se,ae.id),onDragOver:re,onDrop:se=>fe(se,ae.id),onClick:()=>K(ae),sx:{...Wr,p:2,cursor:"pointer",borderColor:j===ae.id?"#1152D4":"#374151",boxShadow:j===ae.id?"0 0 0 1px #1152D4":"none",bgcolor:O===ae.id?"#1E293B":j===ae.id?"rgba(17, 82, 212, 0.1)":"#1A2230",opacity:O===ae.id?.5:1,transition:"all 0.2s","&:hover":{borderColor:"#1152D4",bgcolor:"rgba(17, 82, 212, 0.05)"}},children:r.jsxs(G,{direction:"row",spacing:1,alignItems:"flex-start",children:[r.jsx(kf,{sx:{color:"#4B5563",mt:.2,cursor:"move",fontSize:18}}),r.jsxs(E,{sx:{flex:1,overflow:"hidden"},children:[r.jsxs(C,{variant:"body2",sx:{color:"#fff",fontWeight:500,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",mb:1},children:[ue+1,". ",ae.question||ae.prompt]}),r.jsxs(G,{direction:"row",spacing:1,children:[r.jsx(Pt,{label:ae.type?.replace("_"," "),size:"small",sx:{bgcolor:"rgba(59, 130, 246, 0.1)",color:"#3B82F6",height:20,fontSize:"0.7rem"}}),r.jsx(Pt,{label:`${ae.points||1} pts`,size:"small",sx:{bgcolor:"rgba(16, 185, 129, 0.1)",color:"#10B981",height:20,fontSize:"0.7rem"}})]})]}),r.jsx(Ve,{size:"small",onClick:se=>{se.stopPropagation(),ie(ae.id)},sx:{color:"#EF4444",p:.5},children:r.jsx(ss,{sx:{fontSize:18}})})]})},ae.id))})})]}),r.jsx(E,{sx:{flex:1,overflowY:"auto",p:6,bgcolor:"#080D19"},children:r.jsxs(E,{sx:{maxWidth:800,mx:"auto"},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:4},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h5",sx:{fontWeight:700,color:"#fff"},children:j?"Edit Question":"Add New Question"}),r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF"},children:"Create engaging assessments for your students"})]}),j&&r.jsx(ye,{startIcon:r.jsx(Br,{}),onClick:q,sx:{color:"#3B82F6",textTransform:"none"},children:"Create New Question instead"})]}),r.jsx(Je,{sx:{...Wr,p:4},children:r.jsxs(G,{spacing:4,children:[r.jsxs(E,{children:[r.jsx(C,{variant:"subtitle2",sx:{color:"#9CA3AF",mb:1,fontWeight:600},children:"Question Prompt"}),r.jsx(it,{fullWidth:!0,multiline:!0,rows:3,placeholder:"What is the capital of France?",value:M,onChange:ae=>R(ae.target.value),sx:xt})]}),r.jsxs(G,{direction:"row",spacing:3,children:[r.jsxs(E,{sx:{flex:1},children:[r.jsx(C,{variant:"subtitle2",sx:{color:"#9CA3AF",mb:1,fontWeight:600},children:"Question Type"}),r.jsxs(Fn,{fullWidth:!0,value:_,onChange:ae=>{z(ae.target.value),ae.target.value==="true_false"?(N(["True","False"]),B(0)):ae.target.value==="multiple_choice"&&(N(["","",""]),B(0))},sx:Yn,MenuProps:Tr,children:[r.jsx(It,{value:"multiple_choice",children:"Multiple Choice"}),r.jsx(It,{value:"true_false",children:"True/False"}),r.jsx(It,{value:"short_answer",children:"Short Answer"}),r.jsx(It,{value:"essay",children:"Essay"})]})]}),r.jsxs(E,{sx:{width:150},children:[r.jsx(C,{variant:"subtitle2",sx:{color:"#9CA3AF",mb:1,fontWeight:600},children:"Points"}),r.jsx(it,{fullWidth:!0,type:"number",value:k,onChange:ae=>L(parseInt(ae.target.value)||1),inputProps:{min:1},sx:xt})]})]}),r.jsx(Ir,{sx:{borderColor:"#1F2937"}}),(_==="multiple_choice"||_==="true_false")&&r.jsxs(E,{children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:2},children:[r.jsx(C,{variant:"subtitle2",sx:{color:"#9CA3AF",fontWeight:600},children:"Answer Options"}),r.jsx(C,{variant:"caption",sx:{color:"#6B7280"},children:"Select the correct answer using the radio button"})]}),r.jsx(G,{spacing:2,children:F.map((ae,ue)=>r.jsxs(G,{direction:"row",spacing:2,alignItems:"center",children:[r.jsx(E,{onClick:()=>B(ue),sx:{width:24,height:24,borderRadius:"50%",border:"2px solid",borderColor:I===ue?"#1152D4":"#374151",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",flexShrink:0,bgcolor:I===ue?"rgba(17, 82, 212, 0.2)":"transparent",transition:"all 0.2s"},children:I===ue&&r.jsx(E,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#1152D4"}})}),r.jsx(it,{fullWidth:!0,value:ae,onChange:se=>{if(_==="true_false")return;const J=[...F];J[ue]=se.target.value,N(J)},disabled:_==="true_false",placeholder:`Option ${ue+1}`,sx:xt}),_==="multiple_choice"&&F.length>2&&r.jsx(Ve,{onClick:()=>N(F.filter((se,J)=>J!==ue)),sx:{color:"#EF4444"},children:r.jsx(hs,{fontSize:"small"})})]},ue))}),_==="multiple_choice"&&r.jsx(ye,{startIcon:r.jsx(Br,{}),onClick:()=>N([...F,""]),sx:{mt:2,color:"#3B82F6",textTransform:"none"},children:"Add Option"})]}),r.jsxs(E,{children:[r.jsxs(G,{direction:"row",spacing:1,alignItems:"center",sx:{mb:1},children:[r.jsx(C,{variant:"subtitle2",sx:{color:"#9CA3AF",fontWeight:600},children:"Explanation"}),r.jsx(tn,{title:"Shown to students after they answer the question",children:r.jsx(Lc,{sx:{fontSize:16,color:"#6B7280"}})})]}),r.jsx(it,{fullWidth:!0,multiline:!0,rows:2,placeholder:"Explain why this is the correct answer...",value:H,onChange:ae=>P(ae.target.value),sx:xt})]}),r.jsx(E,{sx:{pt:2},children:r.jsx(ye,{fullWidth:!0,variant:"contained",size:"large",startIcon:x?r.jsx(nn,{size:20,color:"inherit"}):r.jsx(Mte,{}),onClick:Y,disabled:x,sx:{...os,py:1.5,fontWeight:700,fontSize:"1rem",textTransform:"none"},children:x?"Saving...":j?"Update Question":"Save Question"})})]})})]})})]}),r.jsx(gs,{open:y.open,autoHideDuration:4e3,onClose:()=>S({...y,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:r.jsx(Wt,{onClose:()=>S({...y,open:!1}),severity:y.severity,sx:{width:"100%",variant:"filled"},children:y.message})})]})},CM={path:"/tutor",element:r.jsx(Cye,{}),children:[{index:!0,element:r.jsx(Aye,{})},{path:"courses",element:r.jsx(Eye,{})},{path:"courses/:courseId",element:r.jsx(Fye,{})},{path:"courses/:courseId/modules/:moduleId/lessons/:lessonId",element:r.jsx(zye,{})},{path:"create-course",element:r.jsx(Mye,{})},{path:"students",element:r.jsx(Tye,{})},{path:"kyc",element:r.jsx(Rye,{})},{path:"courses/:courseId/modules/:moduleId/lessons/:lessonId/questions",element:r.jsx(_ye,{})}]},Lye=({onMobileMenuToggle:e})=>{const t=On(),n=Dn(),s=Nr(),{logout:o,user:a,isAuthenticated:l}=ps(),{isDark:u,toggleThemeMode:d}=Fl(),[f,p]=v.useState(""),[g,x]=v.useState(null),b={bg:t.palette.mode==="dark"?"#080D19":"#FFFFFF",paper:t.palette.mode==="dark"?"#0C1322":"#F8FAFC",card:t.palette.mode==="dark"?"rgba(28, 31, 39, 1)":"#F1F5F9",text:t.palette.mode==="dark"?"#FFFFFF":"#1E293B",textSecondary:t.palette.mode==="dark"?"#94A3B8":"#64748B",primary:"#2563EB",border:t.palette.mode==="dark"?"rgba(255, 255, 255, 0.05)":"rgba(0, 0, 0, 0.08)"},y=[{label:"Dashboard",path:"/learner"},{label:"Explore",path:"/explore"},{label:"Organization",path:"/learner/organization"}],S=A=>A==="/learner"?s.pathname==="/learner":s.pathname.startsWith(A),j=l?y:y.filter(A=>A.path==="/explore"||A.path==="/community");return r.jsxs(E,{component:"header",sx:{bgcolor:b.paper,px:{xs:2,md:3},py:"12px",height:{xs:"auto",md:"65px"},display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:`1px solid ${b.border}`,position:"sticky",top:0,zIndex:100,boxSizing:"border-box",gap:2},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(Ve,{onClick:e,sx:{display:{xs:"flex",md:"none"},color:b.text},children:r.jsx(tm,{})}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:1.5,onClick:()=>n("/learner"),sx:{cursor:"pointer"},children:[r.jsx(E,{component:"img",src:am,alt:"Integritas Hub Logo",sx:{width:32,height:32,objectFit:"contain"}}),r.jsxs(E,{sx:{display:{xs:"none",md:"block"}},children:[r.jsx(C,{variant:"subtitle2",sx:{fontWeight:700,color:b.text,lineHeight:1.2},children:"Integritas Hub"}),r.jsx(C,{variant:"caption",sx:{color:b.textSecondary,fontSize:"0.7rem"},children:"Learner Portal"})]})]}),r.jsxs(E,{sx:{bgcolor:"#1F2937",borderRadius:1,px:2,display:{xs:"none",sm:"flex"},alignItems:"center",gap:1,width:"260px",height:"40px"},children:[r.jsx(to,{sx:{color:"#9CA3AF",fontSize:20}}),r.jsx(sr,{placeholder:"Search courses",value:f,onChange:A=>p(A.target.value),sx:{color:"#FFFFFF",fontSize:"0.9rem",width:"100%","& input":{border:"none",outline:"none","&:focus":{border:"none",outline:"none"}}}})]})]}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:{xs:1,sm:2},children:[r.jsx(G,{direction:"row",spacing:3,sx:{display:{xs:"none",lg:"flex"},mr:2},children:j.map(A=>r.jsx(C,{onClick:()=>n(A.path),sx:{color:S(A.path)?b.primary:b.textSecondary,textDecoration:"none",fontSize:"0.9rem",fontWeight:S(A.path)?600:500,cursor:"pointer",transition:"color 0.2s","&:hover":{color:b.primary}},children:A.label},A.label))}),r.jsx(Ve,{onClick:d,sx:{color:b.textSecondary,"&:hover":{color:b.text,bgcolor:b.card}},children:u?r.jsx(Mf,{fontSize:"small"}):r.jsx(Tf,{fontSize:"small"})}),r.jsx(Ve,{sx:{bgcolor:b.card,color:b.text,borderRadius:2,"&:hover":{bgcolor:In(b.card,.8)}},children:r.jsx(mC,{badgeContent:3,color:"error",children:r.jsx(bte,{fontSize:"small"})})}),l?r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,onClick:A=>x(A.currentTarget),sx:{cursor:"pointer",bgcolor:b.card,borderRadius:2,px:1.5,py:.5,"&:hover":{bgcolor:In(b.card,.8)}},children:[r.jsx(yr,{sx:{width:32,height:32,bgcolor:b.primary},children:a?.name?.charAt(0)||a?.first_name?.charAt(0)||"U"}),r.jsx(C,{sx:{color:b.text,fontSize:"0.875rem",fontWeight:500,display:{xs:"none",sm:"block"}},children:a?.name||a?.first_name||"User"}),r.jsx(ti,{sx:{color:b.textSecondary,fontSize:18}})]}):r.jsx(Button,{variant:"contained",onClick:()=>n("/login"),sx:{bgcolor:b.primary,borderRadius:2,textTransform:"none",fontWeight:600,px:3,"&:hover":{bgcolor:In(b.primary,.9)}},children:"Log in"}),r.jsxs(SC,{anchorEl:g,open:!!g,onClose:()=>x(null),PaperProps:{sx:{bgcolor:b.paper,color:b.text,border:`1px solid ${b.border}`,mt:1}},children:[r.jsx(It,{onClick:()=>{x(null),n("/profile")},children:"My Profile"}),r.jsx(It,{onClick:()=>{x(null),n("/settings")},children:"Settings"}),r.jsx(It,{onClick:async()=>{x(null);try{await o(),n("/login")}catch(A){console.error("Logout error:",A),n("/login")}},children:"Logout"})]})]})]})},wM=({onClose:e})=>{const t=Dn(),n=Nr(),{logout:s,isAuthenticated:o}=ps(),[a,l]=Er.useState(n.pathname.startsWith("/learner/organization")?"Organization":""),u={bg:"#0F1729",text:"#9CA3AF",textSecondary:"#6B7280",activeText:"#FFFFFF",primary:"#1152D4",primaryBg:"#1152D4",hover:"rgba(17, 82, 212, 0.1)",border:"#1F2937"},d=[{label:"Dashboard",icon:r.jsx(Vee,{}),path:"/learner",private:!0},{label:"My Learning",icon:r.jsx(mte,{}),path:"/explore/my-learning",private:!0},{label:"Organization",icon:r.jsx(Cl,{sx:{fontSize:22}}),private:!0,children:[{label:"Overview",path:"/learner/organization/overview"},{label:"Invitations",path:"/learner/organization/invite"},{label:"Learning Paths",path:"/learner/organization/learning-paths"},{label:"Assignments",path:"/learner/organization/assignments"},{label:"My Assignments",path:"/learner/organization/my-assignments"},{label:"Reports",path:"/learner/organization/reports"}]},{label:"Achievements",icon:r.jsx(Jg,{}),path:"/achievements",private:!0},{label:"Resources",icon:r.jsx(ete,{}),path:"/resources"}],f=o?d:d.filter(S=>!S.private),p=[{label:"Settings",icon:r.jsx(c1,{}),path:"/settings"}],g=S=>S==="/learner"?n.pathname==="/learner":n.pathname.startsWith(S),x=S=>{t(S),e&&e()},b=S=>S.path?g(S.path):S.children?S.children.some(j=>g(j.path)):!1,y=({item:S})=>{const j=b(S),A=a===S.label,M=S.children?j||A:j;return r.jsxs(r.Fragment,{children:[r.jsx(Ii,{disablePadding:!0,sx:{mb:.5},children:r.jsxs(Jo,{onClick:()=>{if(S.children){l(A?"":S.label);return}x(S.path)},sx:{borderRadius:2,mx:1,py:1.25,bgcolor:M?u.primaryBg:"transparent","&:hover":{bgcolor:M?u.primaryBg:u.hover}},children:[r.jsx(Tl,{sx:{minWidth:40,color:M?u.activeText:u.textSecondary},children:S.icon}),r.jsx(Js,{primary:S.label,primaryTypographyProps:{fontSize:"0.9rem",fontWeight:M?600:400,color:M?u.activeText:u.text}}),S.children&&(A?r.jsx(em,{sx:{color:u.activeText}}):r.jsx(ti,{sx:{color:u.text}}))]})}),S.children&&r.jsx(Al,{in:A,timeout:"auto",unmountOnExit:!0,children:r.jsx(Hs,{component:"div",disablePadding:!0,sx:{mb:.5},children:S.children.map(R=>{const _=g(R.path);return r.jsx(Jo,{onClick:()=>x(R.path),sx:{pl:7,borderRadius:1.5,mx:1,mb:.5,py:1,bgcolor:_?"rgba(17, 82, 212, 0.15)":"transparent","&:hover":{bgcolor:_?"rgba(17, 82, 212, 0.15)":"rgba(17, 82, 212, 0.05)"}},children:r.jsx(Js,{primary:R.label,primaryTypographyProps:{fontSize:"0.84rem",fontWeight:_?600:400,color:_?u.primary:u.text}})},R.path)})})})]})};return r.jsxs(E,{sx:{width:260,height:"100%",bgcolor:u.bg,borderRight:`1px solid ${u.border}`,display:"flex",flexDirection:"column"},children:[r.jsx(E,{sx:{flex:1,pt:3,overflowY:"auto"},children:r.jsx(Hs,{sx:{px:1},children:f.map(S=>r.jsx(y,{item:S},S.label))})}),r.jsxs(E,{sx:{pb:2},children:[r.jsx(Ir,{sx:{borderColor:u.border,mb:2,mx:2}}),r.jsxs(Hs,{sx:{px:1},children:[p.map(S=>r.jsx(y,{item:S},S.label)),o&&r.jsx(Ii,{disablePadding:!0,sx:{mb:.5},children:r.jsxs(Jo,{onClick:async()=>{try{await s(),t("/login")}catch(S){console.error("Logout error:",S),t("/login")}},sx:{borderRadius:2,mx:1,py:1.25,"&:hover":{bgcolor:In("#EF4444",.1)}},children:[r.jsx(Tl,{sx:{minWidth:40,color:"#EF4444"},children:r.jsx(pte,{})}),r.jsx(Js,{primary:"Logout",primaryTypographyProps:{fontSize:"0.9rem",fontWeight:500,color:"#EF4444"}})]})})]})]})]})},Q5=260,AM=65,EM=()=>{const e=On(),[t,n]=v.useState(!1),s={bg:e.palette.mode==="dark"?"#080D19":"#F8FAFC"};return r.jsxs(E,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",bgcolor:s.bg},children:[r.jsx(Lye,{onMobileMenuToggle:()=>n(!0)}),r.jsxs(E,{sx:{display:"flex",flex:1},children:[r.jsx(E,{sx:{display:{xs:"none",md:"block"},flex:`0 0 ${Q5}px`,width:Q5,position:"sticky",top:`${AM}px`,alignSelf:"flex-start",height:`calc(100vh - ${AM}px)`},children:r.jsx(wM,{})}),r.jsx(Ou,{open:t,onClose:()=>n(!1),ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:Q5}},children:r.jsx(wM,{onClose:()=>n(!1)})}),r.jsx(E,{component:"main",sx:{flex:1,p:{xs:2,md:3},overflow:"auto",width:"100%"},children:r.jsx(Fj,{})})]})]})},Pye=()=>{const e=On(),t=Dn(),{user:n}=ps(),s={card:e.palette.mode==="dark"?"#1F2937":"#FFFFFF"},[o,a]=v.useState(!0),[l,u]=v.useState(null),[d,f]=v.useState([]),[p,g]=v.useState([]),[x,b]=v.useState(0),[y,S]=v.useState(0);if(v.useEffect(()=>{(async()=>{a(!0);try{const[R,_]=await Promise.allSettled([ia.getEnrollments({per_page:20}),Wa.listCourses({per_page:3,sort:"popular",status:"published"})]);if(R.status==="fulfilled"){const z=R.value.data||[],F=z.filter(B=>B.status==="active"||B.status==="enrolled"||B.status==="in_progress").sort((B,H)=>new Date(H.updated_at||H.last_accessed_at||0)-new Date(B.updated_at||B.last_accessed_at||0));if(F.length>0){const B=F[0];u({id:B.course_id||B.id,title:B.course?.title||B.course_title||"Continue Learning",description:B.course?.short_description||B.course?.summary||B.course?.description||"",progress:B.progress??B.completion_percentage??0,module:B.current_lesson?.title||B.last_lesson?.title||B.current_module?.title||"Continue where you left off",image:B.course?.thumbnail_url||B.course?.cover_image_url||B.course?.image_url||null})}const N=F.slice(0,4).map(B=>({id:B.course_id||B.id,title:B.course?.title||B.course_title||"Course",type:B.course?.level||B.course?.type||"Course",remaining:B.progress!=null?`${100-Math.round(B.progress)}% remaining`:"In progress",progress:Math.round(B.progress??B.completion_percentage??0),image:B.course?.thumbnail_url||B.course?.cover_image_url||B.course?.image_url||null}));f(N);const I=z.filter(B=>B.status==="completed");b(I.length),S(I.length*500+F.length*100)}if(_.status==="fulfilled"){const z=(_.value.data||[]).slice(0,3).map(F=>({id:F.id,title:F.title,category:F.topic||F.topics?.[0]||"General",duration:F.duration||"TBD",image:F.image||null}));g(z)}}catch(R){console.error("Learner dashboard fetch error:",R)}finally{a(!1)}})()},[]),o)return r.jsx(E,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:300},children:r.jsx(nn,{})});const j=n?.first_name||n?.name?.split(" ")[0]||"Learner",A=x>=10?"Scholar Level 5":x>=5?"Scholar Level 3":"Scholar Level 1";return r.jsxs(E,{children:[r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",mb:4},children:[r.jsxs(E,{children:[r.jsxs(C,{variant:"h4",sx:{fontWeight:700,color:e.palette.text.primary,mb:.5},children:["Welcome back, ",j]}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,children:[r.jsx(lz,{sx:{color:"#F59E0B",fontSize:20}}),r.jsx(C,{variant:"body2",sx:{color:e.palette.text.secondary},children:d.length>0?`You have ${d.length} course${d.length>1?"s":""} in progress. Keep it up!`:"Start a course to begin your learning journey!"})]})]}),r.jsx(ye,{variant:"outlined",startIcon:r.jsx(wC,{}),sx:{borderColor:e.palette.divider,color:e.palette.text.primary,textTransform:"none",borderRadius:2,display:{xs:"none",sm:"flex"},"&:hover":{borderColor:e.palette.primary.main}},children:"View Calendar"})]}),l?r.jsxs(r.Fragment,{children:[r.jsx(C,{variant:"h6",sx:{mb:2,fontWeight:700,color:e.palette.text.primary},children:"Continue Learning"}),r.jsx(ts,{sx:{mb:5,bgcolor:e.palette.mode==="dark"?"#1F2937":"#fff",color:e.palette.text.primary,borderRadius:3,overflow:"hidden",boxShadow:e.shadows[2]},children:r.jsxs(E,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"}},children:[r.jsxs(E,{sx:{width:{xs:"100%",md:"35%"},minHeight:{xs:200,md:"auto"},backgroundImage:l.image?`url(${l.image})`:"none",bgcolor:l.image?"transparent":In(e.palette.primary.main,.1),backgroundSize:"cover",backgroundPosition:"center",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[l.image&&r.jsx(E,{sx:{position:"absolute",inset:0,bgcolor:"rgba(0,0,0,0.3)"}}),!l.image&&r.jsx(hr,{sx:{fontSize:64,color:e.palette.primary.main,opacity:.5}})]}),r.jsxs(E,{sx:{flex:1,p:3},children:[r.jsx(Pt,{label:l.module,size:"small",sx:{bgcolor:"primary.main",color:"#fff",mb:2,borderRadius:1}}),r.jsx(C,{variant:"h5",sx:{fontWeight:700,mb:1},children:l.title}),l.description&&r.jsx(C,{variant:"body2",sx:{color:e.palette.text.secondary,mb:3},children:l.description}),r.jsxs(E,{sx:{mb:3},children:[r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[r.jsx(C,{variant:"caption",sx:{color:e.palette.text.secondary},children:"Progress"}),r.jsxs(C,{variant:"caption",sx:{fontWeight:700},children:[l.progress,"%"]})]}),r.jsx(Ha,{variant:"determinate",value:l.progress,sx:{height:8,borderRadius:4,bgcolor:In(e.palette.primary.main,.1),"& .MuiLinearProgress-bar":{bgcolor:"primary.main"}}})]}),r.jsx(ye,{variant:"contained",startIcon:r.jsx(l1,{}),onClick:()=>t("/explore/enrollments"),sx:{borderRadius:2,px:3},children:"Resume Course"})]})]})})]}):r.jsxs(ts,{sx:{mb:5,bgcolor:e.palette.mode==="dark"?"#1F2937":"#fff",borderRadius:3,p:4,textAlign:"center"},children:[r.jsx(hr,{sx:{fontSize:48,color:e.palette.primary.main,mb:2}}),r.jsx(C,{variant:"h6",sx:{fontWeight:700,mb:1},children:"No courses in progress"}),r.jsx(C,{variant:"body2",sx:{color:e.palette.text.secondary,mb:2},children:"Enroll in a course to start your learning journey."}),r.jsx(ye,{variant:"contained",onClick:()=>t("/explore"),sx:{borderRadius:2},children:"Explore Courses"})]}),r.jsxs(E,{sx:{display:"flex",flexWrap:"wrap",gap:3,width:"100%"},children:[r.jsxs(E,{sx:{flex:{xs:"1 1 100%",lg:"1 1 calc(66.67% - 12px)"},minWidth:0},children:[r.jsxs(E,{sx:{mb:4},children:[r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[r.jsx(C,{variant:"h6",sx:{fontWeight:700,color:e.palette.text.primary},children:"Active Courses"}),r.jsx(ye,{size:"small",sx:{textTransform:"none",color:"#3B82F6"},onClick:()=>t("/explore/enrollments"),children:"View All"})]}),d.length===0?r.jsx(C,{variant:"body2",sx:{color:e.palette.text.secondary},children:"No active courses. Browse the catalog to enroll."}):r.jsx(E,{sx:{display:"flex",flexWrap:"wrap",gap:2},children:d.map(M=>r.jsx(E,{sx:{flex:{xs:"1 1 100%",md:"1 1 calc(50% - 8px)"},minWidth:0},children:r.jsx(ts,{sx:{bgcolor:s.card,color:e.palette.text.primary,borderRadius:2,p:2,border:"1px solid rgba(255, 255, 255, 0.05)",height:"100%"},children:r.jsxs(E,{sx:{display:"flex",gap:2},children:[r.jsx(yr,{variant:"rounded",src:M.image,sx:{width:60,height:60,bgcolor:In(e.palette.primary.main,.1)},children:r.jsx(hr,{sx:{color:e.palette.primary.main}})}),r.jsxs(E,{sx:{flexGrow:1},children:[r.jsx(C,{variant:"subtitle1",sx:{fontWeight:600,lineHeight:1.2,mb:.5},children:M.title}),r.jsxs(C,{variant:"caption",sx:{color:e.palette.text.secondary,display:"block",mb:1},children:[M.type," • ",M.remaining]}),r.jsx(Ha,{variant:"determinate",value:M.progress,sx:{height:4,borderRadius:2,bgcolor:In(e.palette.primary.main,.1),mb:.5,"& .MuiLinearProgress-bar":{bgcolor:M.progress>80?"success.main":"primary.main"}}}),r.jsxs(C,{variant:"caption",sx:{color:e.palette.text.secondary,float:"right"},children:[M.progress,"% Complete"]})]})]})})},M.id))})]}),r.jsxs(E,{children:[r.jsx(C,{variant:"h6",sx:{fontWeight:700,mb:2,color:e.palette.text.primary},children:"Recommended for You"}),p.length===0?r.jsx(C,{variant:"body2",sx:{color:e.palette.text.secondary},children:"No recommendations available."}):r.jsx(E,{sx:{display:"flex",flexWrap:"wrap",gap:2},children:p.map(M=>r.jsx(E,{sx:{flex:{xs:"1 1 100%",sm:"1 1 calc(50% - 8px)",md:"1 1 calc(33.33% - 10.67px)"},minWidth:0},children:r.jsxs(ts,{sx:{bgcolor:s.card,color:e.palette.text.primary,borderRadius:2,overflow:"hidden",height:"100%",border:"1px solid rgba(255, 255, 255, 0.05)"},children:[r.jsx(E,{sx:{height:100,backgroundImage:M.image?`url(${M.image})`:"none",bgcolor:M.image?"transparent":In(e.palette.primary.main,.1),backgroundSize:"cover",backgroundPosition:"center",display:"flex",alignItems:"center",justifyContent:"center"},children:!M.image&&r.jsx(hr,{sx:{fontSize:36,color:e.palette.primary.main,opacity:.5}})}),r.jsxs(ji,{sx:{p:2},children:[r.jsxs(G,{direction:"row",spacing:1,sx:{mb:1},children:[r.jsx(Pt,{label:M.category,size:"small",sx:{height:20,fontSize:"0.65rem",bgcolor:In(e.palette.primary.main,.1),color:e.palette.primary.main}}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:.5,children:[r.jsx(Fc,{sx:{fontSize:12,color:e.palette.text.secondary}}),r.jsx(C,{variant:"caption",sx:{color:e.palette.text.secondary},children:M.duration})]})]}),r.jsx(C,{variant:"subtitle2",sx:{fontWeight:600,mb:2},children:M.title}),r.jsx(ye,{variant:"outlined",fullWidth:!0,size:"small",disabled:!String(M?.id||"").trim(),onClick:()=>{const R=String(M?.id||"").trim();R&&t(`/explore/course/${R}`)},sx:{borderColor:"rgba(255, 255, 255, 0.1)",color:e.palette.text.primary,"&:hover":{borderColor:e.palette.primary.main,color:e.palette.primary.main}},children:"Enroll Now"})]})]})},M.id))})]})]}),r.jsx(E,{sx:{flex:{xs:"1 1 100%",lg:"1 1 calc(33.33% - 12px)"},minWidth:0},children:r.jsx(ts,{sx:{bgcolor:e.palette.mode==="dark"?"#1F2937":"#fff",color:e.palette.text.primary,borderRadius:3,mb:3,boxShadow:e.shadows[1]},children:r.jsxs(ji,{sx:{p:2.5},children:[r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[r.jsx(C,{variant:"subtitle1",sx:{fontWeight:700},children:"Achievements"}),r.jsx(ye,{size:"small",sx:{textTransform:"none",fontSize:"0.75rem"},children:"View All"})]}),r.jsxs(E,{sx:{textAlign:"center",mb:2},children:[r.jsx(yr,{sx:{width:56,height:56,bgcolor:"#F59E0B",margin:"0 auto",mb:1},children:r.jsx(Jg,{sx:{fontSize:28}})}),r.jsx(C,{variant:"subtitle1",sx:{fontWeight:700},children:A}),r.jsxs(C,{variant:"caption",sx:{color:e.palette.text.secondary},children:[y.toLocaleString()," XP"]})]}),r.jsx(Ir,{sx:{borderColor:e.palette.divider,mb:2}}),r.jsxs(G,{spacing:2,children:[x>0&&r.jsxs(E,{sx:{display:"flex",gap:2},children:[r.jsx(yr,{variant:"rounded",sx:{bgcolor:In(e.palette.primary.main,.1),color:e.palette.primary.main},children:r.jsx(hr,{})}),r.jsxs(E,{children:[r.jsx(C,{variant:"subtitle2",sx:{fontWeight:600},children:"Course Completer"}),r.jsxs(C,{variant:"caption",sx:{color:e.palette.text.secondary},children:[x," course",x>1?"s":""," completed"]})]})]}),d.length>0&&r.jsxs(E,{sx:{display:"flex",gap:2},children:[r.jsx(yr,{variant:"rounded",sx:{bgcolor:In(e.palette.success.main,.1),color:e.palette.success.main},children:r.jsx(sm,{})}),r.jsxs(E,{children:[r.jsx(C,{variant:"subtitle2",sx:{fontWeight:600},children:"Active Learner"}),r.jsxs(C,{variant:"caption",sx:{color:e.palette.text.secondary},children:[d.length," course",d.length>1?"s":""," in progress"]})]})]}),x===0&&d.length===0&&r.jsx(C,{variant:"caption",sx:{color:e.palette.text.secondary,textAlign:"center",display:"block"},children:"Complete courses to earn achievements!"})]})]})})})]})]})},Dye=()=>{const e=Dn(),[t,n]=v.useState([]),[s,o]=v.useState(!0),[a,l]=v.useState(null),[u,d]=v.useState("");return v.useEffect(()=>{let f=!0;const p=async()=>{o(!0),l(null);try{const x=await Wa.listCourses({q:u});if(!f)return;n(x.data||[])}catch(x){if(!f)return;console.error("Failed to fetch courses:",x),l(x?.status===401?"Please log in to view courses.":"Failed to load courses. Please try again later.")}finally{f&&o(!1)}},g=setTimeout(()=>{p()},300);return()=>{f=!1,clearTimeout(g)}},[u]),r.jsxs("div",{className:"browse-courses",children:[r.jsxs("div",{className:"page-header",children:[r.jsx("h1",{children:"Browse Courses"}),r.jsx("div",{className:"search-box",children:r.jsx("input",{type:"search",placeholder:"Search courses...",value:u,onChange:f=>d(f.target.value),className:"search-input"})})]}),s?r.jsx("div",{style:{textAlign:"center",padding:"2rem"},children:"Loading courses..."}):a?r.jsx("div",{style:{textAlign:"center",padding:"2rem",color:"red"},children:a}):t.length===0?r.jsx("div",{style:{textAlign:"center",padding:"2rem"},children:"No courses found."}):r.jsx("div",{className:"courses-grid",children:t.map(f=>{const p=String(f?.id||"").trim();return r.jsxs(Np,{className:"course-card",children:[r.jsx("div",{className:"course-thumbnail",children:f.image?r.jsx("img",{src:f.image,alt:f.title,style:{width:"100%",height:"100%",objectFit:"cover"}}):r.jsx("div",{className:"thumbnail-placeholder",children:"📖"})}),r.jsxs("div",{className:"course-content",children:[r.jsx("h3",{children:f.title}),r.jsx("p",{className:"course-description",children:f.description}),r.jsxs("div",{className:"course-meta",children:[r.jsxs("span",{className:"tutor",children:["👤 ",f.instructor]}),r.jsxs("span",{className:"rating",children:["⭐ ",f.rating]}),r.jsxs("span",{className:"students",children:["👥 ",f.reviews]})]}),r.jsxs("div",{className:"course-footer",children:[r.jsx("span",{className:"price",children:f.price>0?`$${f.price}`:"Free"}),r.jsx(e1,{variant:"primary",size:"small",onClick:()=>p&&e(`/explore/course/${p}`),children:"Enroll Now"})]})]})]},f.id)})})]})},Oye=({src:e,alt:t})=>{const[n,s]=Er.useState(!1);return e&&!n?r.jsx(E,{component:"img",src:e,alt:t,onError:()=>s(!0),sx:{width:64,height:64,borderRadius:1,objectFit:"cover",flexShrink:0}}):r.jsx(E,{sx:{width:64,height:64,borderRadius:1,bgcolor:"rgba(37,99,235,0.15)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:r.jsx(Dee,{sx:{fontSize:28,color:"#3B82F6"}})})},TM={enrolled:{label:"Enrolled",color:"#3B82F6",bg:"rgba(59,130,246,0.12)"},in_progress:{label:"In Progress",color:"#F59E0B",bg:"rgba(245,158,11,0.12)"},completed:{label:"Completed",color:"#10B981",bg:"rgba(16,185,129,0.12)"}},Bye=e=>e?new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"—",Nye=()=>r.jsx(E,{sx:{p:3,border:"1px solid rgba(255,255,255,0.07)",borderRadius:2,bgcolor:"rgba(255,255,255,0.02)"},children:r.jsxs(G,{direction:"row",spacing:2,alignItems:"center",children:[r.jsx(jn,{variant:"rectangular",width:64,height:64,sx:{borderRadius:1,bgcolor:"rgba(255,255,255,0.08)"}}),r.jsxs(E,{sx:{flex:1},children:[r.jsx(jn,{width:"60%",height:20,sx:{bgcolor:"rgba(255,255,255,0.08)",mb:1}}),r.jsx(jn,{width:"40%",height:16,sx:{bgcolor:"rgba(255,255,255,0.08)"}})]})]})}),$ye=()=>{const e=Dn(),[t,n]=v.useState([]),[s,o]=v.useState(!0),[a,l]=v.useState(null),[u,d]=v.useState(1),[f,p]=v.useState({});return v.useEffect(()=>{(async()=>{o(!0),l(null);try{const x=await ia.getEnrollments({per_page:20,page:u});n(x.data||[]),p(x.meta||{})}catch{l("Failed to load your enrollments. Please try again.")}finally{o(!1)}})()},[u]),r.jsxs(E,{sx:{p:{xs:2,md:4}},children:[r.jsxs(E,{sx:{mb:4},children:[r.jsx(C,{variant:"h5",sx:{fontWeight:700,color:"#fff",mb:.5},children:"My Enrollments"}),r.jsx(C,{variant:"body2",sx:{color:"rgba(255,255,255,0.5)"},children:"View and manage your enrolled courses"})]}),a&&r.jsx(Wt,{severity:"error",sx:{mb:3,bgcolor:"rgba(239,68,68,0.1)",color:"#EF4444",border:"1px solid rgba(239,68,68,0.2)"},children:a}),s&&r.jsx(G,{spacing:2,children:[1,2,3].map(g=>r.jsx(Nye,{},g))}),!s&&!a&&t.length===0&&r.jsxs(E,{sx:{textAlign:"center",py:10,border:"1px dashed rgba(255,255,255,0.1)",borderRadius:2,bgcolor:"rgba(255,255,255,0.01)"},children:[r.jsx(AC,{sx:{fontSize:48,color:"rgba(255,255,255,0.2)",mb:2}}),r.jsx(C,{variant:"h6",sx:{color:"#fff",mb:1},children:"No enrollments yet"}),r.jsx(C,{variant:"body2",sx:{color:"rgba(255,255,255,0.4)",mb:3},children:"Browse available courses and start learning today."}),r.jsx(ye,{variant:"contained",onClick:()=>e("/explore/courses"),sx:{bgcolor:"#2563EB",textTransform:"none",fontWeight:600,"&:hover":{bgcolor:"#1D4ED8"}},children:"Browse Courses"})]}),!s&&t.length>0&&r.jsx(G,{spacing:2,children:t.map(g=>{const x=TM[g.status]||TM.enrolled,b=parseFloat(g.progress_percent||0),y=g.status==="completed",S=g.course?.title||g.title||`Course ${g.course_id?.slice(0,8)||""}`,j=g.course?.instructor||g.instructor||g.tutor||"";return r.jsxs(E,{sx:{p:3,border:"1px solid rgba(255,255,255,0.07)",borderRadius:2,bgcolor:"rgba(255,255,255,0.02)",display:"flex",gap:3,alignItems:"flex-start",flexDirection:{xs:"column",sm:"row"},"&:hover":{bgcolor:"rgba(255,255,255,0.04)",borderColor:"rgba(255,255,255,0.12)"},transition:"all 0.2s ease"},children:[r.jsx(Oye,{src:g.course?.thumbnail_url||g.course?.cover_image_url||g.course?.image_url||g.course?.image||g.thumbnail_url||null,alt:S}),r.jsxs(E,{sx:{flex:1,minWidth:0},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.5,flexWrap:"wrap",gap:1},children:[r.jsx(C,{variant:"subtitle1",sx:{fontWeight:700,color:"#fff",lineHeight:1.3},children:S}),r.jsx(Pt,{label:x.label,size:"small",sx:{bgcolor:x.bg,color:x.color,fontWeight:600,fontSize:11,height:22,border:`1px solid ${x.color}30`}})]}),j&&r.jsxs(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)",display:"block",mb:1.5},children:["Instructor: ",j]}),r.jsxs(E,{sx:{mb:1.5},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",sx:{mb:.5},children:[r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.4)"},children:"Progress"}),r.jsxs(C,{variant:"caption",sx:{color:"#fff",fontWeight:600},children:[b.toFixed(0),"%"]})]}),r.jsx(Ha,{variant:"determinate",value:b,sx:{height:4,borderRadius:2,bgcolor:"rgba(255,255,255,0.08)","& .MuiLinearProgress-bar":{bgcolor:y?"#10B981":"#2563EB",borderRadius:2}}})]}),r.jsxs(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.35)"},children:["Enrolled: ",Bye(g.enrolled_at)]})]}),r.jsx(Ir,{orientation:"vertical",flexItem:!0,sx:{borderColor:"rgba(255,255,255,0.07)",display:{xs:"none",sm:"block"}}}),r.jsx(E,{sx:{display:"flex",alignItems:"center",flexShrink:0},children:y?r.jsx(ye,{variant:"outlined",size:"small",startIcon:r.jsx(hg,{}),sx:{borderColor:"#10B981",color:"#10B981",textTransform:"none",fontWeight:600,"&:hover":{bgcolor:"rgba(16,185,129,0.1)",borderColor:"#10B981"}},children:"View Certificate"}):r.jsx(ye,{variant:"contained",size:"small",startIcon:r.jsx(Cte,{}),onClick:()=>e(`/explore/course/${g.course_id}`),sx:{bgcolor:"#2563EB",textTransform:"none",fontWeight:600,"&:hover":{bgcolor:"#1D4ED8"}},children:"Continue"})})]},g.id)})}),!s&&f.last_page>1&&r.jsxs(G,{direction:"row",justifyContent:"center",spacing:1,sx:{mt:4},children:[r.jsx(ye,{variant:"outlined",size:"small",disabled:u<=1,onClick:()=>d(g=>g-1),sx:{borderColor:"rgba(255,255,255,0.2)",color:"#fff",textTransform:"none"},children:"Previous"}),r.jsxs(C,{variant:"body2",sx:{color:"rgba(255,255,255,0.5)",alignSelf:"center",px:2},children:["Page ",u," of ",f.last_page]}),r.jsx(ye,{variant:"outlined",size:"small",disabled:u>=f.last_page,onClick:()=>d(g=>g+1),sx:{borderColor:"rgba(255,255,255,0.2)",color:"#fff",textTransform:"none"},children:"Next"})]})]})},Hye=["All Courses","In Progress","Completed","Certificates"],R0=e=>e&&String(e).toLowerCase()==="completed"?"COMPLETED":"IN PROGRESS",kM='data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="800" height="450"><rect width="100%25" height="100%25" fill="%23111827"/><text x="50%25" y="50%25" dominant-baseline="middle" text-anchor="middle" fill="%239CA3AF" font-size="28">Course Image</text></svg>',Wye=()=>{const e=Dn(),[t,n]=v.useState([]),[s,o]=v.useState(!0),[a,l]=v.useState(""),[u,d]=v.useState("All Courses"),[f,p]=v.useState("");v.useEffect(()=>{let S=!0;return o(!0),l(""),ia.getMyEnrollments({per_page:50}).then(j=>{S&&n(j.data||[])}).catch(j=>{S&&l(j?.message||"Failed to load your enrollments.")}).finally(()=>{S&&o(!1)}),()=>{S=!1}},[]);const g=v.useMemo(()=>{const S=t.filter(A=>{const M=R0(A.status);return u==="All Courses"?!0:u==="In Progress"?M==="IN PROGRESS":u==="Completed"||u==="Certificates"?M==="COMPLETED":!0}),j=String(f||"").trim().toLowerCase();return j?S.filter(A=>{const M=String(A.course?.title||A.course_title||"").toLowerCase(),R=String(A.course?.instructor||A.instructor||"").toLowerCase();return M.includes(j)||R.includes(j)}):S},[t,u,f]),x=t.filter(S=>R0(S.status)==="COMPLETED").length,b=t.filter(S=>R0(S.status)==="IN PROGRESS").length,y={"All Courses":t.length,"In Progress":b,Completed:x,Certificates:x};return r.jsxs(E,{sx:{color:"#fff",px:{xs:0,md:1},pb:4},children:[r.jsxs(G,{direction:{xs:"column",lg:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",lg:"center"},spacing:2,sx:{mb:3},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h4",sx:{fontWeight:700,mb:.5},children:"My Learning"}),r.jsx(C,{variant:"body2",sx:{color:"#9CA3AF"},children:"Track and continue your learning progress."})]}),r.jsx(G,{direction:"row",spacing:1.25,children:r.jsx(ye,{variant:"contained",onClick:()=>e("/explore/courses"),sx:{bgcolor:"#1152D4",textTransform:"none","&:hover":{bgcolor:"#0D42AF"}},children:"Explore Courses"})})]}),a&&r.jsx(Wt,{severity:"error",sx:{mb:2},children:a}),r.jsxs(Zt,{container:!0,spacing:2,sx:{mb:3},children:[r.jsx(Zt,{size:{xs:12,md:6},children:r.jsx(Je,{sx:{bgcolor:"#1A2230",border:"1px solid #374151",borderRadius:2,p:2},children:r.jsxs(G,{direction:"row",spacing:1.5,alignItems:"center",children:[r.jsx(yr,{sx:{bgcolor:In("#2563EB",.15),color:"#60A5FA"},children:r.jsx(Fc,{})}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.72rem",fontWeight:700,letterSpacing:.5},children:"COURSES ENROLLED"}),r.jsx(C,{sx:{color:"#fff",fontWeight:700,fontSize:"1.15rem"},children:s?r.jsx(jn,{width:60,sx:{bgcolor:"#374151"}}):t.length})]})]})})}),r.jsx(Zt,{size:{xs:12,md:6},children:r.jsx(Je,{sx:{bgcolor:"#1A2230",border:"1px solid #374151",borderRadius:2,p:2},children:r.jsxs(G,{direction:"row",spacing:1.5,alignItems:"center",children:[r.jsx(yr,{sx:{bgcolor:In("#10B981",.16),color:"#34D399"},children:r.jsx(fr,{})}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.72rem",fontWeight:700,letterSpacing:.5},children:"CERTIFICATES"}),r.jsx(C,{sx:{color:"#fff",fontWeight:700,fontSize:"1.15rem"},children:s?r.jsx(jn,{width:40,sx:{bgcolor:"#374151"}}):x})]})]})})})]}),r.jsx(Je,{sx:{bgcolor:"#1A2230",border:"1px solid #374151",borderRadius:2,p:2,mb:3},children:r.jsxs(G,{direction:{xs:"column",lg:"row"},spacing:2,justifyContent:"space-between",alignItems:{xs:"stretch",lg:"center"},children:[r.jsx(G,{direction:"row",spacing:1,sx:{overflowX:"auto"},children:Hye.map(S=>r.jsxs(ye,{size:"small",onClick:()=>d(S),sx:{textTransform:"none",borderRadius:1.5,px:1.8,color:u===S?"#fff":"#9CA3AF",bgcolor:u===S?"#1152D4":"#111827",border:u===S?"1px solid #1D4ED8":"1px solid #374151","&:hover":{bgcolor:u===S?"#0D42AF":"#1F2937"}},children:[S," (",y[S]??0,")"]},S))}),r.jsxs(E,{sx:{bgcolor:"#111827",borderRadius:1.5,px:1.5,border:"1px solid #374151",display:"flex",alignItems:"center",gap:1,width:{xs:"100%",lg:360},height:40},children:[r.jsx(to,{sx:{color:"#9CA3AF",fontSize:18}}),r.jsx(sr,{placeholder:"Filter by title or instructor...",value:f,onChange:S=>p(S.target.value),sx:{color:"#fff",fontSize:"0.9rem",width:"100%","& input::placeholder":{color:"#6B7280",opacity:1}}})]})]})}),s?r.jsx(E,{sx:{display:"flex",justifyContent:"center",py:6},children:r.jsx(nn,{})}):g.length===0?r.jsxs(E,{sx:{p:5,textAlign:"center",border:"1px dashed #374151",borderRadius:2},children:[r.jsx(C,{sx:{color:"#fff",fontWeight:600,mb:.5},children:t.length===0?"No enrollments yet":"No courses match your filter"}),r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.9rem",mb:2},children:t.length===0?"Browse and enroll in a course to get started.":"Try a different tab or search term."}),t.length===0&&r.jsx(ye,{variant:"contained",onClick:()=>e("/explore/courses"),sx:{bgcolor:"#1152D4",textTransform:"none","&:hover":{bgcolor:"#0D42AF"}},children:"Explore Courses"})]}):r.jsx(Zt,{container:!0,spacing:2,children:g.map(S=>{const j=R0(S.status),A=Number(S.progress_percent||0),M=String(S.course?.title||S.course_title||"Untitled Course"),R=String(S.course?.instructor||S.instructor||"Integritas Hub"),_=String(S.course?.thumbnail_url||S.course?.image||"").trim()||kM,z=S.course_id||S.course?.id;return r.jsx(Zt,{size:{xs:12,sm:6,xl:4},children:r.jsxs(Je,{sx:{bgcolor:"#1A2230",border:"1px solid #374151",borderRadius:2,overflow:"hidden",height:"100%",width:"100%",display:"flex",flexDirection:"column"},children:[r.jsx(E,{component:"img",src:_,alt:M,onError:F=>{F.currentTarget.src=kM},sx:{height:158,width:"100%",objectFit:"cover"}}),r.jsxs(E,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.25,flex:1},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[r.jsx(C,{sx:{color:j==="IN PROGRESS"?"#60A5FA":"#34D399",fontSize:"0.72rem",fontWeight:700},children:j==="IN PROGRESS"?"IN PROGRESS":"COMPLETED"}),S.enrolled_at&&r.jsxs(C,{sx:{color:"#9CA3AF",fontSize:"0.72rem"},children:["Enrolled ",new Date(S.enrolled_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]})]}),r.jsx(C,{sx:{color:"#fff",fontWeight:700,lineHeight:1.35},children:M}),r.jsxs(C,{sx:{color:"#9CA3AF",fontSize:"0.82rem"},children:["Instructor: ",R]}),r.jsx(E,{sx:{mt:"auto"},children:j==="IN PROGRESS"?r.jsxs(r.Fragment,{children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",sx:{mb:.75},children:[r.jsx(C,{sx:{color:"#9CA3AF",fontSize:"0.74rem"},children:"Progress"}),r.jsxs(C,{sx:{color:"#fff",fontSize:"0.74rem",fontWeight:700},children:[A,"%"]})]}),r.jsx(Ha,{variant:"determinate",value:A,sx:{height:7,borderRadius:10,bgcolor:"rgba(255,255,255,0.08)",mb:1.3,"& .MuiLinearProgress-bar":{bgcolor:"#2563EB"}}}),r.jsx(ye,{fullWidth:!0,variant:"contained",onClick:()=>z&&e(`/explore/lesson/${z}`),sx:{bgcolor:"#1152D4",textTransform:"none","&:hover":{bgcolor:"#0D42AF"}},children:"Resume Course"})]}):r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[r.jsxs(G,{direction:"row",spacing:.75,alignItems:"center",children:[r.jsx(fr,{sx:{color:"#34D399",fontSize:16}}),r.jsx(C,{sx:{color:"#34D399",fontSize:"0.76rem",fontWeight:600},children:"Certificate Earned"})]}),r.jsx(ye,{size:"small",onClick:()=>z&&e(`/explore/course/${z}`),sx:{color:"#9CA3AF",textTransform:"none"},children:"Review"})]})})]})]})},S.id)})})]})},Et={bg:"#080D19",sidebar:"#0C1322",card:"#1A1F2E",border:"rgba(255,255,255,0.06)",text:"#FFFFFF",textSecondary:"#9CA3AF",primary:"#2563EB",success:"#10B981"},MM=e=>{const t=Math.max(0,Math.floor(e)),n=Math.floor(t/60),s=t%60;return`${n.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`},Uye=e=>{if(!e)return 0;const t=parseInt(String(e),10);return Number.isFinite(t)?t:0},RM=()=>{const{courseId:e,lessonId:t}=Vu(),n=Dn(),[s,o]=v.useState(null),[a,l]=v.useState([]),[u,d]=v.useState(t||null),[f,p]=v.useState(null),[g,x]=v.useState(null),[b,y]=v.useState(!0),[S,j]=v.useState(!1),[A,M]=v.useState(null),[R,_]=v.useState(null),z=v.useRef(null),[F,N]=v.useState(!1),[I,B]=v.useState(0),[H,P]=v.useState(0),k=v.useRef(!1);v.useEffect(()=>{if(!e)return;let qe=!0;return(async()=>{y(!0),M(null);try{const Te=await Wa.getCourseById(e);if(!qe)return;o(Te);const Re=await ke.get(`/lms/courses/${e}/modules`);if(!qe)return;const Se=Array.isArray(Re?.data)?Re.data:Array.isArray(Re)?Re:[],Ke=await Promise.all(Se.map(async ot=>{try{const He=await ke.get(`/lms/modules/${ot.id}/lessons`),$e=Array.isArray(He?.data)?He.data:Array.isArray(He)?He:[];return{id:String(ot.id||""),title:String(ot.title||ot.name||"Untitled Module"),order:ot.order||ot.position||0,lessons:$e.map(Z=>({id:String(Z.id||""),title:String(Z.title||Z.name||"Untitled Lesson"),duration:Z.duration||Z.duration_minutes||0,order:Z.order||Z.position||0,video_url:Z.video_url||Z.video||"",description:Z.description||"",content:Z.content||""}))}}catch{return{id:String(ot.id||""),title:String(ot.title||ot.name||"Untitled Module"),order:ot.order||ot.position||0,lessons:[]}}}));if(!qe)return;if(l(Ke),!k.current){const ot=Ke.flatMap($e=>$e.lessons),He=t?ot.find($e=>$e.id===t):ot[0];if(He){d(He.id);const $e=Ke.find(Z=>Z.lessons.some(pe=>pe.id===He.id));$e&&_($e.id)}k.current=!0}ia.getEnrollments({course_id:e,per_page:1}).then(ot=>{qe&&x(ot.data?.[0]||null)}).catch(()=>{})}catch(Te){qe&&M(Te?.message||"Failed to load course.")}finally{qe&&y(!1)}})(),()=>{qe=!1}},[e]),v.useEffect(()=>{if(!u)return;let qe=!0;const Be=a.flatMap(Te=>Te.lessons).find(Te=>Te.id===u);return Be&&p(Be),j(!0),B(0),P(0),N(!1),z.current&&(z.current.pause(),z.current.src=""),Wa.getLessonById(u).then(Te=>{qe&&p(Re=>({...Re,...Te,video_url:Te?.video_url||Te?.video||Re?.video_url||Re?.video||""}))}).catch(()=>{}).finally(()=>{qe&&j(!1)}),()=>{qe=!1}},[u]),v.useEffect(()=>{if(!z.current||!f)return;const qe=fT(f.video_url||f.video||"");!qe||/youtube\.com|youtu\.be|vimeo\.com/.test(qe)||z.current.load()},[f]);const L=v.useMemo(()=>a.flatMap(qe=>qe.lessons),[a]),O=v.useMemo(()=>L.findIndex(qe=>qe.id===u),[L,u]),W=L[O-1]||null,D=L[O+1]||null,q=L.slice(O+1),K=q.reduce((qe,Be)=>qe+Uye(Be.duration),0),Y=L.length,ie=g?.progress_percent?Number(g.progress_percent):0,V=Math.round(ie/100*Y),re=a.find(qe=>qe.lessons.some(Be=>Be.id===u)),fe=qe=>{d(qe.id),n(`/explore/lesson/${e}/${qe.id}`,{replace:!0});const Be=a.find(Te=>Te.lessons.some(Re=>Re.id===qe.id));Be&&_(Be.id)};if(b)return r.jsx(E,{sx:{minHeight:"100vh",bgcolor:Et.bg,display:"flex",alignItems:"center",justifyContent:"center"},children:r.jsx(nn,{})});if(A)return r.jsx(E,{sx:{minHeight:"100vh",bgcolor:Et.bg,display:"flex",alignItems:"center",justifyContent:"center",p:4},children:r.jsx(Wt,{severity:"error",children:A})});const ae=fT(f?.video_url||f?.video||""),ue=/youtube\.com|youtu\.be/.test(ae),se=/vimeo\.com/.test(ae),J=ue||se,ce=qe=>{if(ue){const Be=qe.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([^&\s]+)/);return Be?`https://www.youtube.com/embed/${Be[1]}?autoplay=1`:qe}if(se){const Be=qe.match(/vimeo\.com\/(\d+)/);return Be?`https://player.vimeo.com/video/${Be[1]}?autoplay=1`:qe}return qe},oe=()=>{const qe=z.current;!qe||!qe.src||qe.readyState!==0&&(qe.paused?qe.play().catch(()=>{}):qe.pause())},ge=(qe,Be)=>{const Te=z.current;if(!Te||!H)return;const Re=Be/100*H;Te.currentTime=Re,B(Re)},de=Array.isArray(s?.raw?.tags)?s.raw.tags:[],le=s?.raw?.certificate,ee=le?.enabled??!!le,X=s?.duration||"—",ve=s?.level||"—",st=s?.raw?.language||"—",Ge=s?.raw?.start_date||s?.raw?.published_at||"Ongoing";return r.jsxs(E,{sx:{minHeight:"100vh",bgcolor:Et.bg,display:"flex",flexDirection:"column"},children:[r.jsxs(E,{sx:{bgcolor:Et.sidebar,borderBottom:`1px solid ${Et.border}`,px:3,py:1.25,display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(E,{component:"img",src:Pc,alt:"Integritas Hub",sx:{width:30,height:30,objectFit:"contain"}}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:.75,sx:{color:Et.textSecondary,fontSize:"0.82rem"},children:[r.jsx(C,{variant:"body2",sx:{color:Et.textSecondary,cursor:"pointer","&:hover":{color:Et.text}},onClick:()=>n("/explore/my-learning"),children:"My Learning"}),r.jsx(C,{variant:"body2",sx:{color:Et.textSecondary},children:"›"}),r.jsx(C,{variant:"body2",sx:{color:Et.textSecondary,cursor:"pointer",maxWidth:200,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","&:hover":{color:Et.text}},onClick:()=>n(`/explore/course/${e}`),children:s?.title||"Course"}),re&&r.jsxs(r.Fragment,{children:[r.jsx(C,{variant:"body2",sx:{color:Et.textSecondary},children:"›"}),r.jsx(C,{variant:"body2",sx:{color:Et.text,maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:re.title})]})]})]}),r.jsx(ye,{startIcon:r.jsx(fa,{sx:{fontSize:16}}),size:"small",onClick:()=>n("/explore/my-learning"),sx:{color:Et.textSecondary,textTransform:"none","&:hover":{color:Et.text}},children:"Back to Course"})]}),r.jsxs(E,{sx:{display:"flex",flex:1,overflow:"hidden",minHeight:0},children:[r.jsxs(E,{sx:{width:280,flexShrink:0,bgcolor:Et.sidebar,borderRight:`1px solid ${Et.border}`,display:"flex",flexDirection:"column",height:"100%",position:"sticky",top:0,overflowY:"auto"},children:[r.jsxs(E,{sx:{p:2.5,borderBottom:`1px solid ${Et.border}`},children:[r.jsx(C,{variant:"caption",sx:{color:Et.primary,fontWeight:700,letterSpacing:.5,textTransform:"uppercase"},children:"Current Course"}),r.jsx(C,{variant:"subtitle1",sx:{color:Et.text,fontWeight:700,mt:.5,mb:1.5,lineHeight:1.3},children:s?.title||"Course"}),r.jsxs(G,{direction:"row",justifyContent:"space-between",sx:{mb:.75},children:[r.jsxs(C,{variant:"body2",sx:{color:Et.text,fontWeight:600},children:[ie.toFixed(0),"% Complete"]}),r.jsxs(C,{variant:"caption",sx:{color:Et.textSecondary},children:[V,"/",Y," Lessons"]})]}),r.jsx(Ha,{variant:"determinate",value:ie,sx:{height:5,borderRadius:3,bgcolor:"rgba(255,255,255,0.08)","& .MuiLinearProgress-bar":{bgcolor:Et.primary,borderRadius:3}}})]}),r.jsx(E,{sx:{flex:1,overflowY:"auto"},children:a.length===0?r.jsx(E,{sx:{p:2.5},children:r.jsx(C,{variant:"body2",sx:{color:Et.textSecondary},children:"No modules available."})}):a.map(qe=>r.jsxs(Fu,{expanded:R===qe.id,onChange:(Be,Te)=>_(Te?qe.id:!1),sx:{bgcolor:"transparent",boxShadow:"none","&:before":{display:"none"},"& .MuiAccordionSummary-root":{bgcolor:"rgba(255,255,255,0.02)",minHeight:52,"&.Mui-expanded":{minHeight:52}}},children:[r.jsx(Lu,{expandIcon:r.jsx(ti,{sx:{color:Et.textSecondary,fontSize:18}}),sx:{px:2.5},children:r.jsxs(E,{children:[r.jsx(C,{variant:"subtitle2",sx:{fontWeight:600,color:Et.text,lineHeight:1.3},children:qe.title}),r.jsxs(C,{variant:"caption",sx:{color:Et.textSecondary},children:[qe.lessons.length," ",qe.lessons.length===1?"lesson":"lessons"]})]})}),r.jsx(_u,{sx:{p:0},children:r.jsx(Hs,{disablePadding:!0,children:qe.lessons.map(Be=>{const Te=Be.id===u;return r.jsxs(Jo,{onClick:()=>fe(Be),sx:{py:1.25,pl:2.5,pr:2,bgcolor:Te?In(Et.primary,.12):"transparent",borderLeft:`3px solid ${Te?Et.primary:"transparent"}`,"&:hover":{bgcolor:In(Et.primary,.07)}},children:[r.jsx(Tl,{sx:{minWidth:28},children:Te?r.jsx(jo,{sx:{color:Et.primary,fontSize:18}}):r.jsx(jo,{sx:{color:Et.textSecondary,fontSize:18}})}),r.jsx(Js,{primary:Be.title,secondary:Be.duration?`${Be.duration} min`:null,primaryTypographyProps:{variant:"body2",fontWeight:Te?600:400,color:Te?Et.primary:Et.text,sx:{fontSize:"0.84rem"}},secondaryTypographyProps:{variant:"caption",sx:{color:Et.textSecondary}}})]},Be.id)})})})]},qe.id))}),r.jsx(E,{sx:{p:2,borderTop:`1px solid ${Et.border}`},children:r.jsx(ye,{fullWidth:!0,startIcon:r.jsx(fa,{}),onClick:()=>n("/explore/my-learning"),sx:{justifyContent:"flex-start",color:Et.textSecondary,textTransform:"none",bgcolor:"rgba(255,255,255,0.04)",borderRadius:2,"&:hover":{bgcolor:"rgba(255,255,255,0.08)",color:Et.text}},children:"Back to Courses"})})]}),r.jsxs(E,{sx:{flex:1,overflowY:"auto",p:{xs:2,md:4}},children:[r.jsx(E,{sx:{position:"relative",width:"100%",aspectRatio:"16/9",bgcolor:"#000",borderRadius:2,overflow:"hidden",mb:3},children:S||!f?r.jsx(E,{sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"#111827"},children:r.jsx(nn,{size:48})}):ae?J?r.jsx(E,{component:"iframe",src:ce(ae),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen",allowFullScreen:!0,sx:{width:"100%",height:"100%",border:"none",display:"block"}}):r.jsxs(r.Fragment,{children:[r.jsx(E,{component:"video",ref:z,src:ae,onTimeUpdate:()=>B(z.current?.currentTime||0),onDurationChange:()=>P(z.current?.duration||0),onPlay:()=>N(!0),onPause:()=>N(!1),onEnded:()=>N(!1),sx:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),r.jsxs(E,{sx:{position:"absolute",bottom:0,left:0,right:0,bgcolor:"rgba(0,0,0,0.8)",p:1.5},children:[r.jsx(JR,{value:H?I/H*100:0,onChange:ge,sx:{color:Et.primary,height:4,p:0,mb:1,"& .MuiSlider-thumb":{width:12,height:12,"&:hover":{boxShadow:"none"}},"& .MuiSlider-rail":{bgcolor:"rgba(255,255,255,0.3)"}}}),r.jsxs(E,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:.5,children:[r.jsx(Ve,{size:"small",sx:{color:"#fff"},onClick:oe,children:F?r.jsx(LS,{fontSize:"small"}):r.jsx(l1,{fontSize:"small"})}),r.jsx(Ve,{size:"small",sx:{color:"#fff"},onClick:()=>{z.current&&(z.current.muted=!z.current.muted)},children:r.jsx(wz,{fontSize:"small"})}),r.jsxs(C,{variant:"caption",sx:{color:"#fff",ml:.5},children:[MM(I)," / ",MM(H)]})]}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:.25,children:[r.jsx(Ve,{size:"small",sx:{color:"#fff"},children:r.jsx(Sz,{fontSize:"small"})}),r.jsx(Ve,{size:"small",sx:{color:"#fff"},children:r.jsx(c1,{fontSize:"small"})}),r.jsx(Ve,{size:"small",sx:{color:"#fff"},onClick:()=>z.current?.requestFullscreen?.(),children:r.jsx(oz,{fontSize:"small"})})]})]})]})]}):r.jsxs(E,{sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",bgcolor:"#111827",gap:1.5},children:[r.jsx(jo,{sx:{fontSize:56,color:Et.textSecondary}}),r.jsx(C,{sx:{color:Et.textSecondary,fontSize:"0.9rem"},children:"No video available for this lesson"})]})}),r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",mb:2.5,flexWrap:"wrap",gap:1.5},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h5",sx:{fontWeight:700,color:Et.text,mb:.5},children:f?.title||"Select a lesson"}),f?.updated_at&&r.jsxs(C,{variant:"body2",sx:{color:Et.textSecondary},children:["Last updated ",new Date(f.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]})]}),r.jsxs(G,{direction:"row",spacing:1,children:[r.jsx(ye,{variant:"outlined",startIcon:r.jsx(Uee,{}),disabled:!W,onClick:()=>W&&fe(W),sx:{borderColor:"rgba(255,255,255,0.15)",color:Et.text,textTransform:"none","&:hover":{borderColor:"rgba(255,255,255,0.3)"},"&.Mui-disabled":{color:Et.textSecondary,borderColor:"rgba(255,255,255,0.06)"}},children:"Previous"}),r.jsx(ye,{variant:"contained",endIcon:r.jsx(Eb,{}),disabled:!D,onClick:()=>D&&fe(D),sx:{bgcolor:Et.primary,textTransform:"none","&:hover":{bgcolor:"#1D4ED8"}},children:"Next Lesson"})]})]}),r.jsx(Ir,{sx:{borderColor:Et.border,mb:3}}),f?.description&&r.jsx(C,{variant:"body1",sx:{color:Et.text,lineHeight:1.8,mb:3},children:f.description}),(()=>{const qe=f?.content;if(!qe)return null;const Be=Array.isArray(qe)?qe:[];return Be.length===0?null:r.jsxs(E,{sx:{mb:3},children:[r.jsx(C,{variant:"subtitle1",sx:{fontWeight:700,color:Et.text,mb:1.5},children:"Key Learning Outcomes"}),Be.map((Te,Re)=>r.jsxs(E,{sx:{display:"flex",alignItems:"flex-start",mb:1},children:[r.jsx(C,{variant:"body2",sx:{color:Et.textSecondary,mr:1},children:"•"}),r.jsx(C,{variant:"body2",sx:{color:Et.textSecondary},children:typeof Te=="string"?Te:JSON.stringify(Te)})]},Re))]})})()]}),r.jsxs(E,{sx:{width:300,flexShrink:0,bgcolor:Et.sidebar,borderLeft:`1px solid ${Et.border}`,p:2.5,overflowY:"auto"},children:[r.jsx(C,{variant:"subtitle2",sx:{color:Et.text,fontWeight:700,mb:1.5,textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.5},children:"Course Details"}),r.jsx(E,{sx:{bgcolor:Et.card,borderRadius:2,p:2,mb:2.5},children:r.jsxs(G,{spacing:1.5,children:[r.jsxs(G,{direction:"row",spacing:1.25,alignItems:"center",children:[r.jsx(TC,{sx:{color:Et.primary,fontSize:18}}),r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:Et.textSecondary,display:"block",fontSize:"0.68rem",textTransform:"uppercase"},children:"Level"}),r.jsx(C,{variant:"body2",sx:{color:Et.text,fontWeight:600},children:ve})]})]}),r.jsxs(G,{direction:"row",spacing:1.25,alignItems:"center",children:[r.jsx(Fc,{sx:{color:Et.primary,fontSize:18}}),r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:Et.textSecondary,display:"block",fontSize:"0.68rem",textTransform:"uppercase"},children:"Total Duration"}),r.jsx(C,{variant:"body2",sx:{color:Et.text,fontWeight:600},children:X})]})]}),r.jsxs(G,{direction:"row",spacing:1.25,alignItems:"center",children:[r.jsx(tz,{sx:{color:Et.primary,fontSize:18}}),r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:Et.textSecondary,display:"block",fontSize:"0.68rem",textTransform:"uppercase"},children:"Certificate"}),r.jsx(C,{variant:"body2",sx:{color:ee?Et.success:Et.textSecondary,fontWeight:600},children:ee?"Available":"Not included"})]})]}),r.jsxs(G,{direction:"row",spacing:1.25,alignItems:"center",children:[r.jsx(mg,{sx:{color:Et.primary,fontSize:18}}),r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:Et.textSecondary,display:"block",fontSize:"0.68rem",textTransform:"uppercase"},children:"Language"}),r.jsx(C,{variant:"body2",sx:{color:Et.text,fontWeight:600},children:st})]})]}),r.jsxs(G,{direction:"row",spacing:1.25,alignItems:"center",children:[r.jsx(wC,{sx:{color:Et.primary,fontSize:18}}),r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:Et.textSecondary,display:"block",fontSize:"0.68rem",textTransform:"uppercase"},children:"Start Date"}),r.jsx(C,{variant:"body2",sx:{color:Et.text,fontWeight:600},children:Ge})]})]})]})}),r.jsx(C,{variant:"subtitle2",sx:{color:Et.text,fontWeight:700,mb:1.5,textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.5},children:"Time Remaining"}),r.jsxs(E,{sx:{bgcolor:Et.card,borderRadius:2,p:2,mb:2.5},children:[r.jsxs(G,{direction:"row",spacing:1.25,alignItems:"center",sx:{mb:1.25},children:[r.jsx(Fc,{sx:{color:Et.success,fontSize:18}}),r.jsxs(E,{children:[r.jsxs(C,{variant:"body2",sx:{color:Et.text,fontWeight:700},children:[q.length," ",q.length===1?"lesson":"lessons"," left"]}),r.jsx(C,{variant:"caption",sx:{color:Et.textSecondary},children:K>0?`~${K} min remaining`:"Last lesson"})]})]}),r.jsx(Ha,{variant:"determinate",value:Y>0?(Y-q.length)/Y*100:0,sx:{height:5,borderRadius:3,bgcolor:"rgba(255,255,255,0.08)","& .MuiLinearProgress-bar":{bgcolor:Et.success,borderRadius:3}}})]}),de.length>0&&r.jsxs(r.Fragment,{children:[r.jsx(C,{variant:"subtitle2",sx:{color:Et.text,fontWeight:700,mb:1.25,textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.5},children:"Topics"}),r.jsx(G,{direction:"row",flexWrap:"wrap",gap:.75,children:de.map((qe,Be)=>r.jsx(Pt,{label:qe?.name||qe,size:"small",sx:{bgcolor:"rgba(37,99,235,0.15)",color:"#93C5FD",fontSize:"0.72rem",height:24}},Be))})]})]})]})]})},qye=()=>{const e=On(),t=Dn(),[n,s]=v.useState(!1),[o,a]=v.useState(135),[l]=v.useState(1125),[u,d]=v.useState("module2"),f=y=>{const S=Math.floor(y/60),j=Math.floor(y%60);return`${S.toString().padStart(2,"0")}:${j.toString().padStart(2,"0")}`},p={title:"Governance Ethics 101",progress:45,completedLessons:12,totalLessons:28},g={title:"Whistleblower Protection Mechanisms",lastUpdated:"2 days ago",description:"In this lesson, we explore the critical frameworks necessary to protect individuals who report misconduct. Effective whistleblower protection is a cornerstone of anti-corruption strategies in both public and private sectors.",keyTakeaways:["Legal definitions of protected disclosures.","Anonymity vs. Confidentiality: Understanding the difference.","Institutional reporting channels and their efficacy."],videoUrl:"https://images.unsplash.com/photo-1550751827-4bd374c3f58b?w=1200&h=675&fit=crop"},x=[{id:"module1",title:"Module 1: Introduction to Transparency",completedLessons:2,totalLessons:2,duration:"24 min",lessons:[{id:"1.1",title:"Introduction to Governance",duration:"12:00",completed:!0},{id:"1.2",title:"Transparency Fundamentals",duration:"12:00",completed:!0}]},{id:"module2",title:"Module 2: Anti-Corruption Strategies",completedLessons:1,totalLessons:3,duration:"45 min",lessons:[{id:"2.1",title:"Defining Modern Corruption",duration:"12:30",completed:!0},{id:"2.2",title:"Whistleblower Protection Mechanisms",duration:"18:45",active:!0,nowPlaying:!0},{id:"2.3",title:"Case Studies: Global Impact",duration:"14:03",locked:!1}]},{id:"module3",title:"Module 3: Implementation & Review",completedLessons:0,totalLessons:4,duration:"1h 02m",locked:!0,lessons:[{id:"3.1",title:"Implementation Strategies",duration:"15:00",locked:!0},{id:"3.2",title:"Monitoring & Evaluation",duration:"17:00",locked:!0},{id:"3.3",title:"Case Study: Local Government",duration:"15:00",locked:!0},{id:"3.4",title:"Final Review",duration:"15:00",locked:!0}]}],b=y=>(S,j)=>{d(j?y:!1)};return r.jsxs(E,{sx:{minHeight:"100vh",bgcolor:e.palette.mode==="dark"?"#080D19":"#F8FAFC",display:"flex"},children:[r.jsxs(E,{sx:{width:280,flexShrink:0,bgcolor:e.palette.mode==="dark"?"#0C1322":"#fff",borderRight:`1px solid ${e.palette.divider}`,display:"flex",flexDirection:"column",height:"100vh",position:"sticky",top:0},children:[r.jsxs(E,{sx:{p:2.5,borderBottom:`1px solid ${e.palette.divider}`},children:[r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",mb:2},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:e.palette.primary.main,fontWeight:600,letterSpacing:.5},children:"CURRENT COURSE"}),r.jsx(C,{variant:"subtitle1",sx:{fontWeight:700,color:e.palette.text.primary,mt:.5},children:p.title})]}),r.jsx(Ve,{size:"small",sx:{color:e.palette.text.secondary},children:r.jsx(c1,{sx:{fontSize:18}})})]}),r.jsxs(E,{sx:{mb:1},children:[r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:.5},children:[r.jsxs(C,{variant:"body2",sx:{color:e.palette.text.primary,fontWeight:600},children:[p.progress,"% Complete"]}),r.jsxs(C,{variant:"caption",sx:{color:e.palette.text.secondary},children:[p.completedLessons,"/",p.totalLessons," Lessons"]})]}),r.jsx(Ha,{variant:"determinate",value:p.progress,sx:{height:6,borderRadius:3,bgcolor:In(e.palette.primary.main,.1),"& .MuiLinearProgress-bar":{bgcolor:"primary.main",borderRadius:3}}})]})]}),r.jsx(E,{sx:{flex:1,overflowY:"auto"},children:x.map(y=>r.jsxs(Fu,{expanded:u===y.id,onChange:b(y.id),disabled:y.locked,sx:{bgcolor:"transparent",boxShadow:"none","&:before":{display:"none"},"& .MuiAccordionSummary-root":{minHeight:56,"&.Mui-expanded":{minHeight:56}}},children:[r.jsx(Lu,{expandIcon:y.locked?r.jsx(Yp,{sx:{color:e.palette.text.secondary,fontSize:18}}):r.jsx(ti,{sx:{color:e.palette.text.secondary}}),sx:{px:2.5,"&:hover":{bgcolor:In(e.palette.primary.main,.05)}},children:r.jsxs(E,{children:[r.jsx(C,{variant:"subtitle2",sx:{fontWeight:600,color:y.locked?e.palette.text.secondary:e.palette.text.primary,mb:.25},children:y.title}),r.jsxs(C,{variant:"caption",sx:{color:e.palette.text.secondary},children:[y.completedLessons,"/",y.totalLessons," Lessons • ",y.duration]})]})}),r.jsx(_u,{sx:{p:0},children:r.jsx(Hs,{sx:{py:0},children:y.lessons.map(S=>r.jsxs(Jo,{sx:{py:1.5,pl:3,pr:2,bgcolor:S.active?In(e.palette.primary.main,.1):"transparent",borderLeft:S.active?`3px solid ${e.palette.primary.main}`:"3px solid transparent","&:hover":{bgcolor:In(e.palette.primary.main,.05)}},children:[r.jsx(Tl,{sx:{minWidth:28},children:S.completed?r.jsx(fr,{sx:{color:"#10B981",fontSize:18}}):S.active?r.jsx(jo,{sx:{color:e.palette.primary.main,fontSize:18}}):S.locked?r.jsx(Yp,{sx:{color:e.palette.text.secondary,fontSize:16}}):r.jsx(jo,{sx:{color:e.palette.text.secondary,fontSize:18}})}),r.jsx(Js,{primary:r.jsxs(E,{children:[r.jsx(C,{variant:"body2",sx:{fontWeight:S.active?600:400,color:S.active?e.palette.primary.main:e.palette.text.primary,fontSize:"0.85rem"},children:S.title}),S.nowPlaying&&r.jsx(C,{variant:"caption",sx:{color:e.palette.primary.main,fontWeight:500},children:"Now Playing"})]})}),r.jsx(C,{variant:"caption",sx:{color:e.palette.text.secondary},children:S.duration})]},S.id))})})]},y.id))}),r.jsx(E,{sx:{p:2,borderTop:`1px solid ${e.palette.divider}`},children:r.jsx(ye,{fullWidth:!0,startIcon:r.jsx(fa,{}),onClick:()=>t("/explore"),sx:{justifyContent:"flex-start",color:e.palette.text.secondary,textTransform:"none",py:1.5,borderRadius:2,bgcolor:e.palette.mode==="dark"?"rgba(255,255,255,0.05)":"#f1f5f9","&:hover":{bgcolor:e.palette.mode==="dark"?"rgba(255,255,255,0.1)":"#e2e8f0",color:e.palette.text.primary}},children:"Back to Dashboard"})})]}),r.jsxs(E,{sx:{flex:1,display:"flex",flexDirection:"column"},children:[r.jsxs(E,{sx:{px:3,py:1.5,borderBottom:`1px solid ${e.palette.divider}`,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:e.palette.mode==="dark"?"#0C1322":"#fff"},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(Ve,{size:"small",sx:{color:e.palette.text.secondary},children:r.jsx(tm,{})}),r.jsx(E,{component:"img",src:Pc,alt:"Integritas Hub",sx:{width:32,height:32,objectFit:"contain",mr:1}}),r.jsxs(C,{variant:"body2",sx:{color:e.palette.text.secondary},children:["Course / ",p.title," / Module 2"]})]}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,children:[r.jsx(ye,{size:"small",startIcon:r.jsx(nte,{sx:{fontSize:18}}),sx:{color:e.palette.text.secondary,textTransform:"none","&:hover":{color:e.palette.text.primary}},children:"Help"}),r.jsx(yr,{sx:{width:32,height:32,bgcolor:"primary.main"},children:r.jsx(pz,{sx:{fontSize:18}})})]})]}),r.jsx(E,{sx:{flex:1,p:4,overflowY:"auto",display:"flex",justifyContent:"center"},children:r.jsxs(E,{sx:{maxWidth:800,width:"100%"},children:[r.jsxs(E,{sx:{position:"relative",width:"100%",aspectRatio:"16/9",bgcolor:"#000",borderRadius:2,overflow:"hidden",mb:4},children:[r.jsxs(E,{sx:{width:"100%",height:"100%",backgroundImage:`url(${g.videoUrl})`,backgroundSize:"cover",backgroundPosition:"center",position:"relative"},children:[r.jsx(E,{sx:{position:"absolute",inset:0,bgcolor:"rgba(0,0,0,0.4)"}}),r.jsx(E,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",cursor:"pointer"},onClick:()=>s(!n),children:r.jsx(E,{sx:{width:64,height:64,borderRadius:"50%",bgcolor:"primary.main",display:"flex",alignItems:"center",justifyContent:"center","&:hover":{bgcolor:"primary.dark",transform:"scale(1.1)",transition:"all 0.2s ease"}},children:n?r.jsx(LS,{sx:{color:"#fff",fontSize:32}}):r.jsx(l1,{sx:{color:"#fff",fontSize:32,ml:.5}})})})]}),r.jsxs(E,{sx:{position:"absolute",bottom:0,left:0,right:0,bgcolor:"rgba(0,0,0,0.8)",p:1.5},children:[r.jsx(JR,{value:o/l*100,onChange:(y,S)=>a(S/100*l),sx:{color:"primary.main",height:4,p:0,mb:1,"& .MuiSlider-thumb":{width:12,height:12,"&:hover":{boxShadow:"none"}},"& .MuiSlider-rail":{bgcolor:"rgba(255,255,255,0.3)"}}}),r.jsxs(E,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,children:[r.jsx(Ve,{size:"small",sx:{color:"#fff"},onClick:()=>s(!n),children:n?r.jsx(LS,{fontSize:"small"}):r.jsx(l1,{fontSize:"small"})}),r.jsx(Ve,{size:"small",sx:{color:"#fff"},children:r.jsx(wz,{fontSize:"small"})}),r.jsxs(C,{variant:"caption",sx:{color:"#fff",ml:1},children:[f(o)," / ",f(l)]})]}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:.5,children:[r.jsx(Ve,{size:"small",sx:{color:"#fff"},children:r.jsx(Sz,{fontSize:"small"})}),r.jsx(Ve,{size:"small",sx:{color:"#fff"},children:r.jsx(c1,{fontSize:"small"})}),r.jsx(Ve,{size:"small",sx:{color:"#fff"},children:r.jsx(oz,{fontSize:"small"})})]})]})]})]}),r.jsxs(E,{children:[r.jsx(C,{variant:"h5",sx:{fontWeight:700,color:e.palette.text.primary,mb:1},children:g.title}),r.jsxs(C,{variant:"body2",sx:{color:e.palette.text.secondary,mb:3},children:["Last updated ",g.lastUpdated]}),r.jsx(C,{variant:"body1",sx:{color:e.palette.text.primary,mb:4,lineHeight:1.8},children:g.description}),r.jsx(C,{variant:"subtitle1",sx:{fontWeight:700,color:e.palette.text.primary,mb:2},children:"Key Takeaways"}),r.jsx(E,{sx:{mb:4},children:g.keyTakeaways.map((y,S)=>r.jsxs(E,{sx:{display:"flex",alignItems:"flex-start",mb:1.5},children:[r.jsx(C,{variant:"body2",sx:{color:e.palette.text.secondary,mr:1},children:"•"}),r.jsx(C,{variant:"body2",sx:{color:e.palette.text.secondary},children:y})]},S))}),r.jsxs(G,{direction:"row",spacing:2,children:[r.jsx(ye,{variant:"outlined",startIcon:r.jsx(sz,{}),sx:{borderColor:e.palette.divider,color:e.palette.text.primary,textTransform:"none",borderRadius:2,"&:hover":{borderColor:e.palette.primary.main,color:e.palette.primary.main}},children:"Download Transcript"}),r.jsx(ye,{variant:"outlined",sx:{borderColor:e.palette.divider,color:e.palette.text.primary,textTransform:"none",borderRadius:2,"&:hover":{borderColor:e.palette.primary.main,color:e.palette.primary.main}},children:"View Case Study PDF"})]})]})]})})]})]})},Vye=()=>{const e=On(),t=Dn(),n=Nr(),[s,o]=v.useState("card"),[a,l]=v.useState(!1),[u,d]=v.useState(!1),[f,p]=v.useState(null),g=n.state||{},x=typeof g.instructor=="string"?g.instructor:g.instructor?.name||"—",b={courseId:g.courseId||null,title:g.title||"Course Enrollment",instructor:x,level:g.level||"—",thumbnail:g.thumbnail||null,price:g.price||0,tax:g.tax||0,fee:g.fee||0},y=b.price+b.tax+b.fee,S=async()=>{if(!b.courseId){p("Course information is missing. Please go back and try again.");return}d(!0),p(null);try{const j=await ia.enrollInCourse(b.courseId);j?.payment_url?window.location.href=j.payment_url:t("/payment-success",{state:{enrollment:j,course:b}})}catch(j){const A=j?.message||"Enrollment failed. Please try again.";p(A)}finally{d(!1)}};return r.jsxs(E,{sx:{minHeight:"100vh",bgcolor:"#0B1120",color:"#fff",display:"flex",flexDirection:"column"},children:[r.jsxs(E,{sx:{borderBottom:"1px solid rgba(255,255,255,0.1)",px:{xs:2,md:4},py:2,display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1.5,children:[r.jsx(E,{component:"img",src:Pc,alt:"Integritas Hub",sx:{width:32,height:32,objectFit:"contain"}}),r.jsx(C,{variant:"subtitle1",sx:{fontWeight:700,color:"#fff",display:{xs:"none",sm:"block"}},children:"Integritas Hub"})]}),r.jsxs(E,{sx:{bgcolor:"rgba(16, 185, 129, 0.1)",color:"#10B981",px:1.5,py:.5,borderRadius:1,display:"flex",alignItems:"center",gap:.5},children:[r.jsx(yf,{sx:{fontSize:14}}),r.jsx(C,{variant:"caption",sx:{fontWeight:600,letterSpacing:.5},children:"SECURE CHECKOUT"})]})]}),r.jsx(Zs,{maxWidth:"lg",sx:{flex:1,py:6,px:{xs:2,md:4}},children:r.jsxs(E,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:4,md:6},justifyContent:"space-between"},children:[r.jsxs(E,{sx:{flex:1,maxWidth:{md:"60%"}},children:[r.jsxs(E,{sx:{mb:4},children:[r.jsx(C,{variant:"h4",sx:{fontWeight:700,mb:1},children:"Checkout"}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,sx:{color:"rgba(255,255,255,0.5)",fontSize:"0.9rem"},children:[r.jsx(C,{sx:{color:"rgba(255,255,255,0.5)"},children:"Cart"}),r.jsx(C,{children:">"}),r.jsx(C,{sx:{color:e.palette.primary.main,fontWeight:600},children:"Payment"}),r.jsx(C,{children:">"}),r.jsx(C,{sx:{color:"rgba(255,255,255,0.5)"},children:"Confirmation"})]})]}),r.jsxs(E,{sx:{mb:6},children:[r.jsx(E,{sx:{display:"flex",justifyContent:"flex-end",mb:1},children:r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)"},children:"Step 2 of 3"})}),r.jsx(E,{sx:{height:4,bgcolor:"rgba(255,255,255,0.1)",borderRadius:2,overflow:"hidden"},children:r.jsx(E,{sx:{width:"66%",height:"100%",bgcolor:e.palette.primary.main}})})]}),r.jsx(C,{variant:"h6",sx:{fontWeight:600,mb:3},children:"Payment Method"}),r.jsx(G,{direction:{xs:"column",sm:"row"},spacing:2,sx:{mb:4},children:[{id:"card",label:"Card",icon:r.jsx(zp,{sx:{fontSize:28}})},{id:"paypal",label:"PayPal",icon:r.jsx(J2,{sx:{fontSize:28}})},{id:"bank",label:"Bank Transfer",icon:r.jsx(J2,{sx:{fontSize:28}})}].map(j=>r.jsxs(E,{onClick:()=>o(j.id),sx:{flex:1,border:`1px solid ${s===j.id?"#2563EB":"rgba(255,255,255,0.1)"}`,bgcolor:s===j.id?"rgba(37, 99, 235, 0.1)":"transparent",borderRadius:1,py:2.5,px:2,cursor:"pointer",display:"flex",flexDirection:"column",alignItems:"center",gap:1,position:"relative",transition:"all 0.2s ease","&:hover":{bgcolor:"rgba(255,255,255,0.05)",borderColor:s===j.id?"#2563EB":"rgba(255,255,255,0.2)"}},children:[s===j.id&&r.jsx(hg,{sx:{position:"absolute",top:8,right:8,color:"#2563EB",fontSize:16}}),r.jsx(E,{sx:{color:s===j.id?"#2563EB":"rgba(255,255,255,0.5)"},children:j.icon}),r.jsx(C,{variant:"body2",sx:{fontWeight:600,color:s===j.id?"#fff":"rgba(255,255,255,0.7)"},children:j.label})]},j.id))}),r.jsxs(E,{sx:{bgcolor:"rgba(255,255,255,0.02)",borderRadius:1,p:4,border:"1px solid rgba(255,255,255,0.05)"},children:[r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:[r.jsx(C,{variant:"h6",sx:{fontWeight:600},children:"Payment Details"}),r.jsxs(G,{direction:"row",spacing:1,children:[r.jsx(yf,{sx:{color:"#fff"}}),r.jsx(zp,{sx:{color:"#fff"}})]})]}),s==="card"&&r.jsxs(E,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:3},children:[r.jsxs(E,{sx:{gridColumn:"1 / -1"},children:[r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)",mb:1,display:"block",textTransform:"uppercase",fontWeight:600},children:"Card Number"}),r.jsx(sr,{fullWidth:!0,placeholder:"0000 0000 0000 0000",startAdornment:r.jsx(Ar,{position:"start",children:r.jsx(zp,{sx:{color:"rgba(255,255,255,0.3)"}})}),endAdornment:r.jsx(Ar,{position:"end",children:r.jsx(yf,{sx:{color:"#10B981",fontSize:18}})}),sx:{bgcolor:"rgba(255,255,255,0.03)",color:"#fff",borderRadius:1,p:1.5,"& .MuiInputBase-input":{border:"none",outline:"none",boxShadow:"none",padding:0}}})]}),r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)",mb:1,display:"block",textTransform:"uppercase",fontWeight:600},children:"Expiry Date"}),r.jsx(sr,{fullWidth:!0,placeholder:"MM / YY",startAdornment:r.jsx(Ar,{position:"start",children:r.jsx(Nee,{sx:{color:"rgba(255,255,255,0.3)",fontSize:18}})}),sx:{bgcolor:"rgba(255,255,255,0.03)",color:"#fff",borderRadius:1,p:1.5,"& .MuiInputBase-input":{border:"none",outline:"none",boxShadow:"none",padding:0}}})]}),r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)",mb:1,display:"block",textTransform:"uppercase",fontWeight:600},children:"CVC / CVV"}),r.jsx(sr,{fullWidth:!0,placeholder:"123",startAdornment:r.jsx(Ar,{position:"start",children:r.jsx(f8,{sx:{color:"rgba(255,255,255,0.3)",fontSize:18}})}),endAdornment:r.jsx(Ar,{position:"end",children:r.jsx(rte,{sx:{color:"rgba(255,255,255,0.3)",fontSize:18}})}),sx:{bgcolor:"rgba(255,255,255,0.03)",color:"#fff",borderRadius:1,p:1.5,"& .MuiInputBase-input":{border:"none",outline:"none",boxShadow:"none",padding:0}}})]}),r.jsxs(E,{sx:{gridColumn:"1 / -1"},children:[r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)",mb:1,display:"block",textTransform:"uppercase",fontWeight:600},children:"Name on Card"}),r.jsx(sr,{fullWidth:!0,placeholder:"e.g. Elena Rivas",startAdornment:r.jsx(Ar,{position:"start",children:r.jsx(PS,{sx:{color:"rgba(255,255,255,0.3)"}})}),sx:{bgcolor:"rgba(255,255,255,0.03)",color:"#fff",borderRadius:1,p:1.5,"& .MuiInputBase-input":{border:"none",outline:"none",boxShadow:"none",padding:0}}})]}),r.jsxs(E,{sx:{gridColumn:"1 / -1"},children:[r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)",mb:1,display:"block",textTransform:"uppercase",fontWeight:600},children:"Billing Zip / Postal Code"}),r.jsx(sr,{fullWidth:!0,placeholder:"10001",startAdornment:r.jsx(Ar,{position:"start",children:r.jsx(_S,{sx:{color:"rgba(255,255,255,0.3)"}})}),sx:{bgcolor:"rgba(255,255,255,0.03)",color:"#fff",borderRadius:1,p:1.5,"& .MuiInputBase-input":{border:"none",outline:"none",boxShadow:"none",padding:0}}})]}),r.jsx(E,{sx:{gridColumn:"1 / -1"},children:r.jsx(vb,{control:r.jsx($f,{checked:a,onChange:j=>l(j.target.checked),sx:{color:"rgba(255,255,255,0.3)","&.Mui-checked":{color:e.palette.primary.main}}}),label:r.jsxs(E,{children:[r.jsx(C,{variant:"body2",sx:{fontWeight:600,color:"#fff"},children:"Save payment details"}),r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)"},children:"Securely save this card for future governance course enrollments."})]})})})]}),s==="paypal"&&r.jsxs(E,{sx:{display:"flex",flexDirection:"column",gap:3},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)",mb:1,display:"block",textTransform:"uppercase",fontWeight:600},children:"PayPal Email"}),r.jsx(sr,{fullWidth:!0,placeholder:"username@example.com",startAdornment:r.jsx(Ar,{position:"start",children:r.jsx(gg,{sx:{color:"rgba(255,255,255,0.3)"}})}),sx:{bgcolor:"rgba(255,255,255,0.03)",color:"#fff",borderRadius:1,p:1.5,"& .MuiInputBase-input":{border:"none",outline:"none",boxShadow:"none",padding:0}}})]}),r.jsx(E,{sx:{p:2,bgcolor:"rgba(37, 99, 235, 0.1)",borderRadius:1,border:"1px solid rgba(37, 99, 235, 0.3)"},children:r.jsx(C,{variant:"body2",sx:{color:"#fff",textAlign:"center"},children:"You will be redirected to PayPal to complete your purchase securely."})})]}),s==="bank"&&r.jsxs(E,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:3},children:[r.jsxs(E,{sx:{gridColumn:"1 / -1"},children:[r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)",mb:1,display:"block",textTransform:"uppercase",fontWeight:600},children:"Bank Name"}),r.jsx(sr,{readOnly:!0,fullWidth:!0,value:"First Bank of Nigeria",startAdornment:r.jsx(Ar,{position:"start",children:r.jsx(J2,{sx:{color:"rgba(255,255,255,0.3)"}})}),sx:{bgcolor:"rgba(255,255,255,0.03)",color:"#fff",borderRadius:1,p:1.5,cursor:"default","& .MuiInputBase-input":{border:"none",outline:"none",boxShadow:"none",padding:0}}})]}),r.jsxs(E,{sx:{gridColumn:"1 / -1"},children:[r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)",mb:1,display:"block",textTransform:"uppercase",fontWeight:600},children:"Account Name"}),r.jsx(sr,{readOnly:!0,fullWidth:!0,value:"Integritas Hub",startAdornment:r.jsx(Ar,{position:"start",children:r.jsx(PS,{sx:{color:"rgba(255,255,255,0.3)"}})}),sx:{bgcolor:"rgba(255,255,255,0.03)",color:"#fff",borderRadius:1,p:1.5,cursor:"default","& .MuiInputBase-input":{border:"none",outline:"none",boxShadow:"none",padding:0}}})]}),r.jsxs(E,{sx:{gridColumn:"1 / -1"},children:[r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)",mb:1,display:"block",textTransform:"uppercase",fontWeight:600},children:"Account Number"}),r.jsx(sr,{readOnly:!0,fullWidth:!0,value:"2034567890",startAdornment:r.jsx(Ar,{position:"start",children:r.jsx(zp,{sx:{color:"rgba(255,255,255,0.3)"}})}),endAdornment:r.jsx(Ar,{position:"end",children:r.jsx(hg,{sx:{color:"#10B981",fontSize:18}})}),sx:{bgcolor:"rgba(255,255,255,0.03)",color:"#fff",borderRadius:1,p:1.5,cursor:"default","& .MuiInputBase-input":{border:"none",outline:"none",boxShadow:"none",padding:0}}})]}),r.jsxs(E,{sx:{gridColumn:"1 / -1"},children:[r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)",mb:1,display:"block",textTransform:"uppercase",fontWeight:600},children:"Payment Reference"}),r.jsx(sr,{readOnly:!0,fullWidth:!0,value:"Integritas Hub-7832-XK9",startAdornment:r.jsx(Ar,{position:"start",children:r.jsx(dte,{sx:{color:"rgba(255,255,255,0.3)"}})}),sx:{bgcolor:"rgba(255,255,255,0.03)",color:"#fff",borderRadius:1,p:1.5,cursor:"default","& .MuiInputBase-input":{border:"none",outline:"none",boxShadow:"none",padding:0}}})]}),r.jsx(E,{sx:{gridColumn:"1 / -1",p:2,bgcolor:"rgba(16, 185, 129, 0.1)",borderRadius:1,border:"1px solid rgba(16, 185, 129, 0.3)"},children:r.jsx(C,{variant:"body2",sx:{color:"#fff",textAlign:"center"},children:"Please use the reference code above when making the transfer."})})]})]})]}),r.jsx(E,{sx:{width:{xs:"100%",md:"35%"}},children:r.jsxs(E,{sx:{position:"sticky",top:24},children:[r.jsxs(E,{sx:{bgcolor:"rgba(255,255,255,0.02)",borderRadius:1,p:3,border:"1px solid rgba(255,255,255,0.05)"},children:[r.jsx(C,{variant:"h6",sx:{fontWeight:600,mb:3},children:"Order Summary"}),r.jsxs(E,{sx:{display:"flex",gap:2,mb:4},children:[r.jsx(E,{sx:{width:80,height:60,borderRadius:1,backgroundImage:`url(${b.thumbnail})`,backgroundSize:"cover",backgroundPosition:"center"}}),r.jsxs(E,{children:[r.jsx(C,{variant:"subtitle2",sx:{fontWeight:700,color:"#fff",lineHeight:1.3,mb:.5},children:b.title}),r.jsxs(C,{variant:"caption",sx:{display:"block",color:"rgba(255,255,255,0.5)"},children:["Instr: ",b.instructor]}),r.jsxs(C,{variant:"caption",sx:{color:e.palette.primary.main},children:["Level: ",b.level]})]})]}),r.jsx(Ir,{sx:{borderColor:"rgba(255,255,255,0.1)",mb:3}}),r.jsxs(G,{spacing:1.5,sx:{mb:3},children:[r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between"},children:[r.jsx(C,{variant:"body2",sx:{color:"rgba(255,255,255,0.6)"},children:"Subtotal"}),r.jsxs(C,{variant:"body2",sx:{color:"#fff",fontWeight:600},children:["$",b.price.toFixed(2)]})]}),r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between"},children:[r.jsx(C,{variant:"body2",sx:{color:"rgba(255,255,255,0.6)"},children:"Tax (VAT 10%)"}),r.jsxs(C,{variant:"body2",sx:{color:"#fff",fontWeight:600},children:["$",b.tax.toFixed(2)]})]}),r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between"},children:[r.jsx(C,{variant:"body2",sx:{color:"rgba(255,255,255,0.6)"},children:"Processing Fee"}),r.jsxs(C,{variant:"body2",sx:{color:"#fff",fontWeight:600},children:["$",b.fee.toFixed(2)]})]})]}),r.jsx(Ir,{sx:{borderColor:"rgba(255,255,255,0.1)",mb:3}}),r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:4},children:[r.jsx(C,{variant:"subtitle1",sx:{fontWeight:700,color:"#fff"},children:"Total Amount"}),r.jsxs(C,{variant:"h4",sx:{fontWeight:700,color:"#fff"},children:["$",y.toFixed(2)]})]}),r.jsxs(E,{sx:{display:"flex",gap:1,mb:4,border:"1px dashed rgba(255,255,255,0.2)",borderRadius:1,p:.5,bgcolor:"rgba(255,255,255,0.05)"},children:[r.jsx(sr,{fullWidth:!0,placeholder:"Promo Code",sx:{color:"#fff",fontSize:"0.875rem",ml:1,"& .MuiInputBase-input":{border:"none",outline:"none",boxShadow:"none",padding:0},"& input::placeholder":{color:"rgba(255,255,255,0.5)",opacity:1}}}),r.jsx(ye,{variant:"text",sx:{color:"rgba(255,255,255,0.7)",textTransform:"none",minWidth:"auto",px:2,"&:hover":{color:"#fff",bgcolor:"rgba(255,255,255,0.05)"}},children:"Apply"})]}),f&&r.jsx(Wt,{severity:"error",sx:{mb:2,bgcolor:"rgba(239,68,68,0.1)",color:"#EF4444",border:"1px solid rgba(239,68,68,0.2)",fontSize:"0.8rem"},children:f}),r.jsx(ye,{fullWidth:!0,variant:"contained",size:"large",onClick:S,disabled:u,startIcon:u?r.jsx(nn,{size:16,sx:{color:"#fff"}}):r.jsx(yf,{}),sx:{bgcolor:"#2563EB",color:"#fff",py:1.5,fontWeight:600,textTransform:"none",fontSize:"1rem",mb:2,boxShadow:"0 4px 6px -1px rgba(37, 99, 235, 0.1), 0 2px 4px -1px rgba(37, 99, 235, 0.06)","&:hover":{bgcolor:"#1d4ed8"},"&.Mui-disabled":{bgcolor:"#1d4ed8",opacity:.7}},children:u?"Processing...":"Complete Purchase"}),r.jsxs(E,{sx:{textAlign:"center"},children:[r.jsxs(G,{direction:"row",alignItems:"center",justifyContent:"center",spacing:1,sx:{mb:1},children:[r.jsx(f8,{sx:{fontSize:14,color:"#10B981"}}),r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.6)"},children:"256-bit SSL Secure Encryption"})]}),r.jsxs(E,{sx:{bgcolor:"#fff",px:.75,py:.25,borderRadius:1,display:"inline-flex",alignItems:"center",gap:1.5},children:[r.jsx(C,{variant:"caption",sx:{color:"#000",fontWeight:800,fontSize:10},children:"VISA"}),r.jsx(E,{sx:{width:1,height:10,bgcolor:"#ccc"}}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:.5,children:[r.jsxs(E,{sx:{position:"relative",width:21,height:14},children:[r.jsx(E,{sx:{position:"absolute",left:0,width:14,height:14,bgcolor:"#EB001B",borderRadius:"50%"}}),r.jsx(E,{sx:{position:"absolute",right:0,width:14,height:14,bgcolor:"#F79E1B",borderRadius:"50%",opacity:.8}})]}),r.jsx(C,{variant:"caption",sx:{color:"#000",fontWeight:800,fontSize:10},children:"Mastercard"})]})]})]})]}),r.jsxs(E,{sx:{mt:3,bgcolor:"rgba(255,255,255,0.02)",borderRadius:1,p:2.5,border:"1px solid rgba(255,255,255,0.05)",display:"flex",gap:2},children:[r.jsx(yr,{sx:{bgcolor:"rgba(37, 99, 235, 0.1)",color:"#2563EB"},children:r.jsx(_te,{})}),r.jsxs(E,{children:[r.jsx(C,{variant:"subtitle2",sx:{fontWeight:700,color:"#fff",mb:.5},children:"Need help?"}),r.jsxs(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.6)",lineHeight:1.4,display:"block"},children:["Contact our learner support team at ",r.jsx("span",{style:{color:"#2563EB",cursor:"pointer"},children:"support@govhub.com"})," for any payment issues."]})]})]})]})})]})}),r.jsxs(E,{sx:{borderTop:"1px solid rgba(255,255,255,0.1)",px:6,py:3,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.4)"},children:"© 2024 Integritas Hub. All rights reserved."}),r.jsxs(G,{direction:"row",spacing:4,children:[r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.4)",cursor:"pointer","&:hover":{color:"#fff"}},children:"Privacy Policy"}),r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.4)",cursor:"pointer","&:hover":{color:"#fff"}},children:"Terms of Service"}),r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.4)",cursor:"pointer","&:hover":{color:"#fff"}},children:"Refund Policy"})]})]})]})},Gye=()=>{const e=On(),t=[{label:"COURSES",value:"12",trend:"+2 this month",icon:r.jsx(hr,{}),color:"#3B82F6"},{label:"AVG. SCORE",value:"85%",trend:"+5% vs last month",icon:r.jsx(sm,{}),color:"#10B981"},{label:"LEARNING HOURS",value:"45h",trend:"+12h this week",icon:r.jsx(Fc,{}),color:"#F59E0B"},{label:"STREAK",value:"7 Days",trend:"Keep it up!",icon:r.jsx(lz,{}),color:"#EF4444"}],n=[{day:"Mon",value:30},{day:"Tue",value:45},{day:"Wed",value:25},{day:"Thu",value:60},{day:"Fri",value:40},{day:"Sat",value:20},{day:"Sun",value:10}],s=[{name:"Public Policy",progress:92,color:"#0EA5E9"},{name:"Ethical Leadership",progress:78,color:"#0EA5E9"},{name:"Civic Engagement",progress:64,color:"#0EA5E9"},{name:"Data Analysis",progress:45,color:"#0EA5E9"}],o=[{id:1,title:"Digital Governance Systems",module:"Module 4: Implementing e-Services",progress:75,remaining:"15m remaining",image:"https://images.unsplash.com/photo-1550751827-4bd374c3f58b?w=800&h=600&fit=crop"},{id:2,title:"Ethics in Public Service",module:"Module 2: Conflict of Interest",progress:30,remaining:"45m remaining",image:"https://images.unsplash.com/photo-1521737604893-d14cc237f11d?w=800&h=600&fit=crop"}],a=[{name:"Policy Pro",icon:r.jsx(fr,{}),color:"#0EA5E9",earned:!0},{name:"Thought Leader",icon:r.jsx(wte,{}),color:"#0EA5E9",earned:!0},{name:"Fast Starter",icon:r.jsx(yz,{}),color:"#0EA5E9",earned:!0},{name:"Scholar",icon:r.jsx(Yp,{}),color:"#64748B",earned:!1},{name:"Mentor",icon:r.jsx(Yp,{}),color:"#64748B",earned:!1},{name:"Guardian",icon:r.jsx(Yp,{}),color:"#64748B",earned:!1}];return r.jsxs(E,{sx:{minHeight:"100vh"},children:[r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",mb:4},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h4",sx:{fontWeight:700,color:e.palette.text.primary,mb:1},children:"My Progress"}),r.jsx(C,{variant:"body1",sx:{color:e.palette.text.secondary},children:"Track your journey and milestones in Good Governance."})]}),r.jsxs(G,{direction:"row",spacing:2,children:[r.jsx(ye,{variant:"outlined",startIcon:r.jsx(sz,{}),sx:{borderColor:e.palette.divider,color:e.palette.text.secondary,textTransform:"none","&:hover":{borderColor:e.palette.text.primary,color:e.palette.text.primary}},children:"Export Report"}),r.jsx(ye,{variant:"contained",startIcon:r.jsx(Ite,{}),sx:{bgcolor:"#0EA5E9",textTransform:"none","&:hover":{bgcolor:"#0284C7"}},children:"Share Stats"})]})]}),r.jsx(Zt,{container:!0,spacing:3,sx:{mb:4},children:t.map((l,u)=>r.jsx(Zt,{item:!0,xs:12,sm:6,md:3,children:r.jsx(ts,{sx:{bgcolor:e.palette.mode==="dark"?"rgba(255,255,255,0.03)":"#fff",borderRadius:3,border:`1px solid ${e.palette.divider}`,height:"100%",minHeight:160,boxShadow:e.shadows[1],display:"flex",flexDirection:"column",justifyContent:"center"},children:r.jsxs(ji,{sx:{p:4,"&:last-child":{pb:4}},children:[r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",mb:2},children:[r.jsx(C,{variant:"caption",sx:{fontWeight:600,color:e.palette.text.secondary,letterSpacing:1},children:l.label}),r.jsx(E,{sx:{color:l.color},children:l.icon})]}),r.jsx(C,{variant:"h4",sx:{fontWeight:700,color:e.palette.text.primary,mb:1},children:l.value}),r.jsx(C,{variant:"caption",sx:{color:l.color,fontWeight:500},children:l.trend})]})})},u))}),r.jsxs(Zt,{container:!0,spacing:4,children:[r.jsxs(Zt,{item:!0,xs:12,lg:8,children:[r.jsx(ts,{sx:{bgcolor:e.palette.mode==="dark"?"rgba(255,255,255,0.03)":"#fff",borderRadius:3,border:`1px solid ${e.palette.divider}`,mb:4,boxShadow:e.shadows[1]},children:r.jsxs(ji,{sx:{p:3},children:[r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:4},children:[r.jsx(C,{variant:"h6",sx:{fontWeight:700,color:e.palette.text.primary},children:"Weekly Activity"}),r.jsxs(G,{direction:"row",spacing:1,sx:{bgcolor:In(e.palette.text.primary,.05),p:.5,borderRadius:1},children:[r.jsx(E,{sx:{px:1.5,py:.5,borderRadius:.5,bgcolor:In(e.palette.text.primary,.1),cursor:"pointer"},children:r.jsx(C,{variant:"caption",sx:{fontWeight:600,color:e.palette.text.primary},children:"Week"})}),r.jsx(E,{sx:{px:1.5,py:.5,borderRadius:.5,cursor:"pointer"},children:r.jsx(C,{variant:"caption",sx:{fontWeight:600,color:e.palette.text.secondary},children:"Month"})})]})]}),r.jsx(E,{sx:{height:200,display:"flex",alignItems:"flex-end",justifyContent:"space-between",px:2},children:n.map((l,u)=>r.jsxs(E,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1,width:"100%"},children:[r.jsx(E,{sx:{width:8,height:`${l.value*2}px`,bgcolor:l.day==="Thu"?"#0EA5E9":In(e.palette.text.primary,.1),borderRadius:4,transition:"height 0.3s ease"}}),r.jsx(C,{variant:"caption",sx:{color:e.palette.text.secondary},children:l.day})]},u))})]})}),r.jsx(C,{variant:"h6",sx:{fontWeight:700,color:e.palette.text.primary,mb:2},children:"Continue Learning"}),r.jsx(G,{spacing:2,children:o.map(l=>r.jsx(ts,{sx:{bgcolor:e.palette.mode==="dark"?"rgba(255,255,255,0.03)":"#fff",borderRadius:3,border:`1px solid ${e.palette.divider}`,transition:"transform 0.2s",boxShadow:e.shadows[1],"&:hover":{transform:"translateY(-2px)"}},children:r.jsxs(ji,{sx:{p:2,display:"flex",gap:3,alignItems:"center"},children:[r.jsx(E,{sx:{width:160,height:90,borderRadius:2,backgroundImage:`url(${l.image})`,backgroundSize:"cover",backgroundPosition:"center",flexShrink:0}}),r.jsxs(E,{sx:{flex:1},children:[r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[r.jsx(C,{variant:"subtitle1",sx:{fontWeight:700,color:e.palette.text.primary},children:l.title}),r.jsx(Pt,{label:"In Progress",size:"small",sx:{height:20,fontSize:"0.65rem",bgcolor:"#0EA5E9",color:"#fff",fontWeight:600}})]}),r.jsx(C,{variant:"body2",sx:{color:e.palette.text.secondary,mb:2},children:l.module}),r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:2,mb:1},children:[r.jsx(Ha,{variant:"determinate",value:l.progress,sx:{flex:1,height:6,borderRadius:3,bgcolor:In(e.palette.text.primary,.1),"& .MuiLinearProgress-bar":{bgcolor:"#0EA5E9"}}}),r.jsx(C,{variant:"caption",sx:{color:e.palette.text.secondary},children:l.remaining})]}),r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r.jsxs(C,{variant:"caption",sx:{color:e.palette.text.secondary},children:[l.progress,"% Completed"]}),r.jsx(ye,{size:"small",endIcon:r.jsx(Oi,{sx:{fontSize:14}}),sx:{color:"#0EA5E9",textTransform:"none",p:0,"&:hover":{bgcolor:"transparent",textDecoration:"underline"}},children:"Resume Course"})]})]})]})},l.id))})]}),r.jsxs(Zt,{item:!0,xs:12,lg:4,children:[r.jsx(ts,{sx:{bgcolor:e.palette.mode==="dark"?"rgba(255,255,255,0.03)":"#fff",borderRadius:3,border:`1px solid ${e.palette.divider}`,mb:4,boxShadow:e.shadows[1]},children:r.jsxs(ji,{sx:{p:3},children:[r.jsx(C,{variant:"h6",sx:{fontWeight:700,color:e.palette.text.primary,mb:3},children:"Skills Mastery"}),r.jsx(G,{spacing:3,children:s.map((l,u)=>r.jsxs(E,{children:[r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[r.jsx(C,{variant:"body2",sx:{color:e.palette.text.primary,fontWeight:500},children:l.name}),r.jsxs(C,{variant:"body2",sx:{color:l.color,fontWeight:700},children:[l.progress,"%"]})]}),r.jsx(Ha,{variant:"determinate",value:l.progress,sx:{height:6,borderRadius:3,bgcolor:In(e.palette.text.primary,.1),"& .MuiLinearProgress-bar":{bgcolor:l.color}}})]},u))})]})}),r.jsx(ts,{sx:{bgcolor:e.palette.mode==="dark"?"rgba(255,255,255,0.03)":"#fff",borderRadius:3,border:`1px solid ${e.palette.divider}`,boxShadow:e.shadows[1]},children:r.jsxs(ji,{sx:{p:3},children:[r.jsxs(E,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:[r.jsx(C,{variant:"h6",sx:{fontWeight:700,color:e.palette.text.primary},children:"Badges"}),r.jsx(ye,{size:"small",sx:{color:"#0EA5E9",textTransform:"none"},children:"View All"})]}),r.jsx(Zt,{container:!0,spacing:2,children:a.map((l,u)=>r.jsx(Zt,{item:!0,xs:4,children:r.jsxs(E,{sx:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",gap:1},children:[r.jsx(E,{sx:{width:56,height:56,borderRadius:"50%",border:`2px solid ${l.earned?l.color:In(e.palette.text.primary,.1)}`,display:"flex",alignItems:"center",justifyContent:"center",color:l.earned?l.color:In(e.palette.text.primary,.2),bgcolor:l.earned?In(l.color,.1):"transparent"},children:l.icon}),r.jsx(C,{variant:"caption",sx:{color:l.earned?e.palette.text.primary:e.palette.text.secondary,fontWeight:500},children:l.name})]})},u))})]})})]})]})]})},Yye=({course:e,colors:t,access:n})=>{const s=Dn(),o=v.useMemo(()=>'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="800" height="450"><rect width="100%" height="100%" fill="%23111827"/><text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" fill="%239CA3AF" font-size="28">Course Image</text></svg>',[]),a=String(e?.id||"").trim(),l=String(e?.level||"Unspecified"),u=String(e?.title||"Untitled Course"),d=String(e?.description||"No description available."),f=String(e?.instructor||"Integritas Hub"),p=Number(e?.rating||0).toFixed(1),g=Number(e?.reviews||0),x=String(e?.duration||"TBD"),b=String(e?.image||"").trim()||o,y=S=>{switch(S){case"Beginner":return"#3B82F6";case"Intermediate":return"#10B981";case"Advanced":return"#F59E0B";default:return"#3B82F6"}};return r.jsxs(ts,{onClick:()=>a&&s(`/explore/course/${a}`),sx:{bgcolor:t.card,borderRadius:"16px",overflow:"hidden",transition:"transform 0.2s, box-shadow 0.2s",cursor:"pointer","&:hover":{transform:"translateY(-4px)",boxShadow:"0 12px 24px rgba(0, 0, 0, 0.3)"},boxShadow:"none",width:"100%",height:"100%",flex:1,display:"flex",flexDirection:"column",border:"1px solid rgba(255, 255, 255, 0.08)",boxSizing:"border-box"},children:[r.jsxs(E,{sx:{position:"relative",height:200,background:"linear-gradient(135deg, rgba(20, 30, 48, 1) 0%, rgba(36, 59, 85, 0.8) 100%)"},children:[r.jsx(DR,{component:"img",image:b,alt:u,onError:S=>{S.currentTarget.src=o},sx:{height:"100%",width:"100%",objectFit:"cover",opacity:.9}}),r.jsxs(E,{sx:{position:"absolute",top:16,left:16,bgcolor:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(8px)",color:t.text,px:1.5,py:.6,borderRadius:"8px",fontSize:"0.75rem",fontWeight:600,display:"flex",alignItems:"center",gap:.8,border:"1px solid rgba(255, 255, 255, 0.1)"},children:[r.jsx(TC,{sx:{fontSize:14,color:y(l)}}),l]}),n&&r.jsx(E,{sx:{position:"absolute",top:16,right:16,px:1.5,py:.6,borderRadius:"8px",fontSize:"0.7rem",fontWeight:700,letterSpacing:"0.4px",backdropFilter:"blur(8px)",...n.is_essential?{bgcolor:"rgba(245, 158, 11, 0.85)",color:"#fff",border:"1px solid rgba(245, 158, 11, 0.6)"}:{bgcolor:"rgba(16, 185, 129, 0.8)",color:"#fff",border:"1px solid rgba(16, 185, 129, 0.5)"}},children:n.is_essential?"Essential":"Standard"})]}),r.jsxs(ji,{sx:{p:3,flex:1,display:"flex",flexDirection:"column",gap:2},children:[r.jsx(C,{variant:"h6",sx:{fontWeight:700,fontSize:"1.1rem",lineHeight:1.3,color:t.text,minHeight:"2.6em",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:u}),r.jsx(C,{variant:"body2",sx:{color:t.textSecondary,fontSize:"0.875rem",lineHeight:1.5,minHeight:"3em",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:d}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:1.5,sx:{mt:"auto"},children:[r.jsx(E,{sx:{width:36,height:36,borderRadius:"50%",bgcolor:"rgba(37, 99, 235, 0.15)",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid rgba(37, 99, 235, 0.3)"},children:r.jsx(hr,{sx:{color:t.primary,fontSize:18}})}),r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:t.textSecondary,display:"block",fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5px"},children:e?.type==="institution"?"Institution":"Instructor"}),r.jsx(C,{variant:"body2",sx:{fontWeight:600,color:t.text,fontSize:"0.9rem"},children:f})]})]}),r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mt:"auto",pt:2,borderTop:"1px solid rgba(255, 255, 255, 0.08)"},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:.5,children:[r.jsx(vz,{sx:{color:t.warning,fontSize:18}}),r.jsx(C,{variant:"body2",sx:{fontWeight:600,color:t.text},children:p}),r.jsxs(C,{variant:"body2",sx:{color:t.textSecondary},children:["(",g,")"]})]}),r.jsxs(G,{direction:"row",alignItems:"center",spacing:.5,children:[r.jsx(Fc,{sx:{color:t.textSecondary,fontSize:18}}),r.jsx(C,{variant:"body2",sx:{color:t.textSecondary},children:x})]})]})]})]})},Kye=["Most Popular","Newest","Highest Rated","Price: Low to High"],Mn={bg:"#080D19",paper:"#0C1322",card:"rgba(28, 31, 39, 1)",text:"#FFFFFF",textSecondary:"#94A3B8",primary:"#2563EB",warning:"#F59E0B"},Xye=e=>e==="Newest"?"newest":e==="Highest Rated"?"highest_rated":e==="Price: Low to High"?"price_asc":"popular",Zye=()=>{const e=Dn(),[t,n]=v.useState(""),[s,o]=v.useState("Most Popular"),[a,l]=v.useState("All Topics"),[u,d]=v.useState([]),[f,p]=v.useState(0),[g,x]=v.useState(!1),[b,y]=v.useState(null),[S,j]=v.useState([]),[A,M]=v.useState([]),[R,_]=v.useState({}),[z,F]=v.useState(null),[N,I]=v.useState(!1),[B,H]=v.useState(""),P=v.useRef(!1),k=v.useRef(!1),L=v.useMemo(()=>["All Topics",...S.map(Y=>Y.name).filter(Boolean)],[S]),O=v.useMemo(()=>{const Y=new Set;return A.forEach(ie=>{const V=String(ie?.level||"").trim();V&&Y.add(V)}),u.forEach(ie=>Y.add(ie)),Array.from(Y)},[A,u]);v.useEffect(()=>{let Y=!0;const ie=setTimeout(async()=>{I(!0),H("");try{const V=a==="All Topics"?void 0:a.toLowerCase().replace(/\s+/g,"-"),re=await Wa.listCourses({q:t.trim()||void 0,category:V,level:u[0]||void 0,sort:Xye(s),per_page:30});if(!Y)return;let fe=re.data||[];if(u.length>0&&(fe=fe.filter(ae=>u.includes(ae.level))),f>0&&(fe=fe.filter(ae=>Number(ae.rating||0)>=f)),M(fe),fe.length>0&&Wa.listEssentialCourses({per_page:100}).then(ae=>{if(!Y)return;const ue=new Set((ae.data||[]).map(J=>J.id)),se={};fe.forEach(J=>{se[J.id]={is_essential:ue.has(J.id)}}),_(se)}).catch(()=>{}),!P.current&&fe.length>0&&(P.current=!0,F(fe[0])),!k.current&&a==="All Topics"&&!t&&u.length===0){const ae=new Set;fe.forEach(ue=>(ue.topics||[]).forEach(se=>{se&&ae.add(se)})),ae.size>0&&(k.current=!0,j(Array.from(ae).map(ue=>({id:ue.toLowerCase().replace(/\s+/g,"-"),name:ue,slug:ue.toLowerCase().replace(/\s+/g,"-")}))))}}catch(V){if(!Y)return;M([]),H(V?.status===401?"Please log in to view courses.":V?.message||"Failed to load courses.")}finally{Y&&I(!1)}},250);return()=>{Y=!1,clearTimeout(ie)}},[a,f,t,u,s]);const W=()=>{l("All Topics"),d([]),p(0)},D=Y=>{d(ie=>ie.includes(Y)?ie.filter(V=>V!==Y):[...ie,Y])},q=String(z?.id||"").trim(),K=()=>r.jsxs(E,{children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:2},children:[r.jsx(C,{sx:{color:Mn.text,fontWeight:700,fontSize:"0.85rem"},children:"Filters"}),r.jsx(C,{onClick:W,sx:{color:Mn.primary,cursor:"pointer",fontSize:"0.8rem"},children:"Reset"})]}),r.jsx(Ir,{sx:{borderColor:"rgba(255,255,255,0.08)",mb:2}}),r.jsx(C,{sx:{color:Mn.textSecondary,mb:1,fontSize:"0.8rem"},children:"Level"}),r.jsx(G,{children:O.length===0?r.jsx(C,{sx:{color:Mn.textSecondary,fontSize:"0.85rem"},children:"No levels available yet."}):O.map(Y=>r.jsx(vb,{control:r.jsx($f,{checked:u.includes(Y),onChange:()=>D(Y),sx:{color:Mn.textSecondary,"&.Mui-checked":{color:Mn.primary}}}),label:r.jsx(C,{sx:{color:Mn.text,fontSize:"0.85rem"},children:Y})},Y))}),r.jsx(Ir,{sx:{borderColor:"rgba(255,255,255,0.08)",my:2}}),r.jsx(C,{sx:{color:Mn.textSecondary,mb:1,fontSize:"0.8rem"},children:"Minimum Rating"}),r.jsx(G,{direction:"row",spacing:.5,children:[1,2,3,4,5].map(Y=>r.jsx(Ve,{onClick:()=>p(ie=>ie===Y?0:Y),sx:{p:.5},children:r.jsx(vz,{sx:{color:Y<=f?Mn.warning:"rgba(255,255,255,0.2)"}})},Y))})]});return r.jsxs(E,{sx:{bgcolor:Mn.bg,color:Mn.text,minHeight:"100%"},children:[r.jsxs(Ou,{open:g,onClose:()=>x(!1),PaperProps:{sx:{width:280,p:3,bgcolor:Mn.paper}},children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",sx:{mb:2},children:[r.jsx(C,{sx:{color:Mn.text,fontWeight:700},children:"Filters"}),r.jsx(Ve,{onClick:()=>x(!1),sx:{color:Mn.text},children:r.jsx(hs,{})})]}),K()]}),r.jsxs(E,{sx:{display:"flex"},children:[r.jsx(E,{sx:{width:280,p:3,bgcolor:Mn.paper,borderRight:"1px solid rgba(255,255,255,0.05)",display:{xs:"none",md:"block"}},children:K()}),r.jsxs(E,{sx:{flex:1,p:{xs:2,md:4}},children:[B&&r.jsx(Wt,{severity:"error",sx:{mb:2},children:B}),r.jsx(ts,{sx:{bgcolor:Mn.card,p:3,mb:3,border:"1px solid rgba(255,255,255,0.08)"},children:!z&&N?r.jsxs(G,{direction:"row",spacing:1.5,alignItems:"center",children:[r.jsx(nn,{size:20}),r.jsx(C,{sx:{color:Mn.textSecondary},children:"Loading featured course..."})]}):r.jsxs(G,{direction:{xs:"column",md:"row"},justifyContent:"space-between",spacing:2,children:[r.jsxs(E,{sx:{maxWidth:760},children:[r.jsx(C,{sx:{color:Mn.primary,fontSize:"0.78rem",fontWeight:700,mb:1},children:"FEATURED COURSE"}),r.jsx(C,{variant:"h4",sx:{color:Mn.text,fontWeight:800,mb:1},children:z?.title||"No featured course available"}),r.jsx(C,{sx:{color:Mn.textSecondary,mb:2},children:z?.description||"Courses will appear here once available."}),r.jsxs(G,{direction:"row",spacing:1,children:[r.jsx(ye,{variant:"contained",onClick:()=>q&&e(`/explore/course/${q}`),disabled:!q,sx:{textTransform:"none",bgcolor:Mn.primary},children:"View Course"}),r.jsx(ye,{variant:"outlined",onClick:()=>window.open(z?.trailerUrl,"_blank","noopener,noreferrer"),disabled:!z?.trailerUrl,endIcon:r.jsx(yte,{}),sx:{textTransform:"none",color:Mn.text,borderColor:"rgba(255,255,255,0.18)"},children:"Watch Trailer"})]})]}),z?.image?r.jsx(E,{component:"img",src:z.image,alt:z.title||"featured",onError:Y=>{Y.currentTarget.style.display="none"},sx:{width:{xs:"100%",md:320},height:{xs:180,md:190},objectFit:"cover",borderRadius:2}}):r.jsx(E,{sx:{width:{xs:"100%",md:320},height:{xs:180,md:190},borderRadius:2,bgcolor:"#111827",display:"flex",alignItems:"center",justifyContent:"center"},children:r.jsx(hr,{sx:{fontSize:56,color:"rgba(255,255,255,0.15)"}})})]})}),r.jsxs(G,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"stretch",sm:"center"},spacing:2,sx:{mb:2},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h5",sx:{color:Mn.text,fontWeight:800},children:"Explore Courses"}),r.jsx(C,{sx:{color:Mn.textSecondary,fontSize:"0.9rem"},children:"Discover governance and policy courses."})]}),r.jsxs(G,{direction:{xs:"column",sm:"row"},spacing:1.5,children:[r.jsxs(E,{sx:{bgcolor:Mn.card,px:1.5,borderRadius:2,display:"flex",alignItems:"center",minWidth:260},children:[r.jsx(to,{sx:{color:Mn.textSecondary,mr:1}}),r.jsx(sr,{value:t,onChange:Y=>n(Y.target.value),placeholder:"Search courses...",sx:{color:Mn.text,width:"100%"}})]}),r.jsx(ye,{onClick:Y=>y(Y.currentTarget),startIcon:r.jsx(Fte,{}),sx:{color:Mn.text,border:"1px solid rgba(255,255,255,0.2)",textTransform:"none"},children:s}),r.jsx(Ve,{onClick:()=>x(!0),sx:{display:{xs:"inline-flex",md:"none"},color:Mn.text,border:"1px solid rgba(255,255,255,0.2)"},children:r.jsx(Jee,{})}),r.jsx(SC,{anchorEl:b,open:!!b,onClose:()=>y(null),PaperProps:{sx:{bgcolor:Mn.card,color:Mn.text}},children:Kye.map(Y=>r.jsx(It,{selected:s===Y,onClick:()=>{o(Y),y(null)},children:Y},Y))})]})]}),r.jsx(G,{direction:"row",spacing:1,sx:{flexWrap:"wrap",mb:3},children:L.map(Y=>r.jsx(Pt,{label:Y,onClick:()=>l(Y),sx:{bgcolor:a===Y?Mn.primary:Mn.card,color:Mn.text}},Y))}),N?r.jsx(E,{sx:{minHeight:180,display:"flex",alignItems:"center",justifyContent:"center"},children:r.jsx(nn,{})}):A.length===0?r.jsxs(E,{sx:{p:4,textAlign:"center",border:"1px dashed rgba(255,255,255,0.2)",borderRadius:2},children:[r.jsx(C,{sx:{color:Mn.text,fontWeight:600},children:"No courses found"}),r.jsx(C,{sx:{color:Mn.textSecondary,fontSize:"0.9rem"},children:"Try another search or filter."})]}):r.jsx(E,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2,1fr)",lg:"repeat(3,1fr)"},gap:2.5},children:A.map(Y=>r.jsx(Yye,{course:Y,colors:Mn,access:R[Y.id]||null},Y.id))})]})]})]})},Mt={bg:"#0B0F19",card:"#1A1F2E",primary:"#2563EB",accent:"#3B82F6",text:"#FFFFFF",textSecondary:"#9CA3AF",border:"rgba(255, 255, 255, 0.08)",success:"#10B981",warning:"#F59E0B",error:"#EF4444"},Qye=(e={})=>{const t=[e?.tutors,e?.users,e?.course_tutors,e?.courseTutors,e?.tutor_users,e?.tutorUsers,e?.tutor_assignments,e?.tutorAssignments];return[e?.tutor,e?.user,e?.creator,e?.created_by,e?.createdBy,e?.instructor,e?.author,...t.flatMap(s=>Array.isArray(s)?s:[])].filter(Boolean).find(s=>{const o=s?.tutor&&typeof s.tutor=="object"?s.tutor:s?.user&&typeof s.user=="object"?s.user:s;return!!(o?.name||o?.full_name||o?.email||o?.id)})||null},Jye=e=>{const t=e?.tutor&&typeof e.tutor=="object"?e.tutor:e?.user&&typeof e.user=="object"?e.user:e,n=String(t?.first_name||t?.firstName||"").trim(),s=String(t?.last_name||t?.lastName||"").trim();return n||s?`${n} ${s}`.trim():[t?.name,t?.full_name,t?.fullName,t?.display_name,t?.displayName,t?.username,t?.email].map(o=>String(o||"").trim()).find(Boolean)||""},zM=(e,...t)=>{const n=e?.tutor&&typeof e.tutor=="object"?e.tutor:e?.user&&typeof e.user=="object"?e.user:e;return t.map(s=>String(n?.[s]||"").trim()).find(Boolean)||""},eve=()=>{const{courseId:e}=Vu(),t=Dn(),n=Nr(),{isAuthenticated:s}=ps(),[o,a]=v.useState(0),[l,u]=v.useState("module-1"),[d,f]=v.useState(""),[p,g]=v.useState(null),[x,b]=v.useState(!0),[y,S]=v.useState(null),j=v.useMemo(()=>{const L=p?.modules||[],O=L.length;let W=0,D=0;L.forEach(V=>{const re=Array.isArray(V.lessons)?V.lessons:[];W+=V.lessons_count??re.length,typeof V.duration_minutes=="number"?D+=V.duration_minutes:D+=re.reduce((fe,ae)=>fe+(Number(ae.duration_minutes)||0),0)});const q=Math.floor(D/60),K=D%60,Y=D>0?q>0?`${q}h ${K}m`:`${K}m`:null,ie=[`${O} ${O===1?"Module":"Modules"}`,`${W} ${W===1?"Lesson":"Lessons"}`];return Y&&ie.push(`${Y} total length`),ie.join(" • ")},[p]),[A,M]=v.useState(!1),[R,_]=v.useState(null),[z,F]=v.useState(null),[N,I]=v.useState(!1);v.useEffect(()=>{let L=!0;return e&&(async()=>{b(!0),S(null);try{const W=await Wa.getCourseById(e);if(!L)return;if(W){const D=W.raw_data||W,q=Qye(D),K=W.price?parseFloat(W.price):0,Y=D.certificate?.currency||D.currency||"USD",ie=D.learning_objectives,V=Array.isArray(ie)&&ie.length>0?ie:typeof ie=="string"&&ie.trim()?[ie]:[];g({id:W.id,title:W.title||"Untitled Course",description:W.description||"No description available.",price:K,currency:Y,level:W.level||"Intermediate",duration:W.duration||"TBD",hasCertificate:D.certificate?.enabled??!1,language:D.language||"—",startDate:D.start_date||D.published_at||"Ongoing",rating:W.rating||0,reviewCount:W.reviews||0,image:W.image||D.thumbnail_url||D.banner_url||"",tags:Array.isArray(D.tags)&&D.tags.length>0?D.tags.map(re=>({label:re.name||re,icon:zb,iconColor:"#3B82F6",bgColor:"#374151"})):[],learningObjectives:V,modules:Array.isArray(D.modules)?D.modules:[],instructor:{name:Jye(q)||W.instructor||"Integritas Hub",title:zM(q,"headline","title","profession")||"Course Instructor",bio:zM(q,"bio")||""},reviews:[],ratingBreakdown:{5:0,4:0,3:0,2:0,1:0},trainingFor:Array.isArray(D.target_audience)&&D.target_audience.length>0?D.target_audience:[]})}else S("Course not found")}catch(W){if(!L)return;console.error("Failed to fetch course details:",W),S(W?.status===401?"Please log in to view this course.":W?.message==="Course not found"?"Course not found":"Failed to load course details. Please try again.")}finally{L&&b(!1)}})(),()=>{L=!1}},[e]),v.useEffect(()=>{!s||!e||(ia.getCourseAccess(e).then(L=>F(L)).catch(()=>{}),ia.getEnrollments({course_id:e,per_page:1}).then(L=>{const O=L.data?.[0],W=String(O?.status||"").toLowerCase();(W==="enrolled"||W==="in_progress"||W==="completed")&&I(!0)}).catch(()=>{}))},[s,e]);const B=(L,O)=>{a(O)},H=L=>(O,W)=>{u(W?L:!1)},P=!!String(p?.image||"").trim(),k=async()=>{if(!s){t("/login",{state:{from:n}});return}M(!0),_(null);try{const O=await(z?.is_essential?ia.enrollInEssentialCourse:ia.enrollInCourse)(p.id);O?.payment_url?(sessionStorage.setItem("pending_course_id",p.id),window.location.href=O.payment_url):t("/payment-success",{state:{enrollment:O,course:{courseId:p.id,title:p.title,price:p.price,thumbnail:p.image}}})}catch(L){_(L?.message||"Enrollment failed. Please try again.")}finally{M(!1)}};return r.jsxs(E,{sx:{bgcolor:Mt.bg,color:Mt.text,minHeight:"100vh"},children:[r.jsx(om,{}),r.jsx(E,{sx:{maxWidth:"1280px",mx:"auto",px:{xs:2,sm:3,md:4},py:4,pb:8},children:x?r.jsx(E,{sx:{display:"flex",justifyContent:"center",py:8},children:r.jsx(C,{sx:{color:Mt.textSecondary},children:"Loading course details..."})}):y?r.jsx(E,{sx:{display:"flex",justifyContent:"center",py:8},children:r.jsx(C,{sx:{color:Mt.error},children:y})}):p&&r.jsxs(r.Fragment,{children:[r.jsxs(G,{direction:"row",spacing:1,alignItems:"center",sx:{mb:4},children:[r.jsx(C,{component:yn,to:"/",sx:{color:Mt.textSecondary,textDecoration:"none",fontSize:"0.875rem","&:hover":{color:Mt.text}},children:"Home"}),r.jsx(C,{sx:{color:Mt.textSecondary},children:"/"}),r.jsx(C,{component:yn,to:"/explore",sx:{color:Mt.textSecondary,textDecoration:"none",fontSize:"0.875rem","&:hover":{color:Mt.text}},children:"Courses"}),r.jsx(C,{sx:{color:Mt.textSecondary},children:"/"}),r.jsx(C,{sx:{color:Mt.accent,fontSize:"0.875rem"},children:p.title})]}),r.jsxs(G,{direction:{xs:"column",lg:"row"},spacing:4,children:[r.jsxs(E,{sx:{flex:1,maxWidth:{lg:"calc(100% - 400px)"}},children:[r.jsx(C,{variant:"h4",sx:{fontWeight:700,mb:2,fontSize:{xs:"1.5rem",md:"2rem"}},children:p.title}),r.jsx(C,{sx:{color:Mt.textSecondary,fontSize:"1rem",lineHeight:1.7,mb:3,maxWidth:"650px"},children:p.description}),p.tags.length>0&&r.jsxs(E,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1.5,alignItems:"center",mb:3},children:[p.tags.map((L,O)=>r.jsx(Pt,{icon:r.jsx(L.icon,{sx:{fontSize:14,color:`${L.iconColor} !important`}}),label:L.label,size:"small",sx:{bgcolor:L.bgColor,color:"#FFFFFF",fontWeight:600,fontSize:"0.7rem",borderRadius:"4px",px:1,height:"32px","& .MuiChip-icon":{marginLeft:"8px"}}},O)),r.jsxs(G,{direction:"row",alignItems:"center",spacing:.75,sx:{ml:{xs:0,sm:1}},children:[r.jsx(t5,{sx:{color:Mt.warning,fontSize:20}}),r.jsxs(C,{sx:{color:Mt.textSecondary,fontSize:"0.875rem"},children:["(",p.reviewCount.toLocaleString()," reviews)"]})]})]}),r.jsx(E,{sx:{borderBottom:`2px solid ${Mt.border}`,mb:4},children:r.jsxs(Zg,{value:o,onChange:B,sx:{"& .MuiTab-root":{color:Mt.textSecondary,textTransform:"none",fontWeight:500,fontSize:"0.9rem",minWidth:"auto",px:2,"&.Mui-selected":{color:Mt.text}},"& .MuiTabs-indicator":{bgcolor:Mt.primary,height:3}},children:[r.jsx(Qs,{label:"Overview"}),r.jsx(Qs,{label:"Curriculum"}),r.jsx(Qs,{label:"Instructor"}),r.jsx(Qs,{label:"Reviews"})]})}),o===0&&r.jsxs(E,{children:[p.learningObjectives.length>0&&r.jsxs(r.Fragment,{children:[r.jsx(C,{variant:"h5",sx:{fontWeight:700,mb:3},children:"What you'll learn"}),r.jsx(E,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"repeat(2, 1fr)"},gap:2,mb:5},children:p.learningObjectives.map((L,O)=>r.jsx(ts,{sx:{bgcolor:Mt.card,border:`1px solid ${Mt.border}`,borderRadius:1},children:r.jsxs(ji,{sx:{display:"flex",alignItems:"flex-start",gap:2,p:2.5,"&:last-child":{pb:2.5}},children:[r.jsx(Wee,{sx:{color:Mt.accent,fontSize:20,mt:.25}}),r.jsx(C,{sx:{color:Mt.textSecondary,fontSize:"0.875rem",lineHeight:1.5},children:L})]})},O))})]}),r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"baseline",sx:{mb:3},children:[r.jsx(C,{variant:"h5",sx:{fontWeight:700},children:"Course content"}),r.jsx(C,{sx:{color:Mt.textSecondary,fontSize:"0.875rem",fontWeight:500},children:j})]}),r.jsx(E,{sx:{mb:5},children:p.modules.length===0?r.jsx(C,{sx:{color:Mt.textSecondary,fontSize:"0.875rem"},children:"Curriculum not yet available."}):p.modules.map(L=>r.jsxs(Fu,{expanded:l===`module-${L.id}`,onChange:H(`module-${L.id}`),sx:{bgcolor:Mt.card,border:`1px solid ${Mt.border}`,borderRadius:"4px !important",mb:2,"&:before":{display:"none"},"&.Mui-expanded":{margin:"0 0 16px 0"}},children:[r.jsx(Lu,{expandIcon:r.jsx(ti,{sx:{color:Mt.textSecondary}}),sx:{px:3,py:1},children:r.jsxs(E,{children:[r.jsx(C,{sx:{fontWeight:600,fontSize:"0.95rem",mb:.5},children:L.title}),r.jsxs(C,{sx:{color:Mt.textSecondary,fontSize:"0.8rem"},children:[L.lessons_count??(Array.isArray(L.lessons)?L.lessons.length:L.lessons)??0," Lessons",L.duration_minutes?` • ${L.duration_minutes}m`:L.duration?` • ${L.duration}`:""]})]})}),r.jsx(_u,{sx:{px:3,pb:3},children:r.jsx(C,{sx:{color:Mt.textSecondary,fontSize:"0.875rem"},children:"Lesson content will be displayed here..."})})]},L.id))}),r.jsx(C,{variant:"h5",sx:{fontWeight:700,mb:3},children:"Instructor"}),r.jsxs(ts,{sx:{bgcolor:Mt.card,border:`1px solid ${Mt.border}`,borderRadius:1,p:3,mb:5},children:[r.jsx(C,{variant:"h6",sx:{fontWeight:700,mb:.5},children:p.instructor.name}),r.jsx(C,{sx:{color:Mt.accent,fontSize:"0.75rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",mb:2},children:p.instructor.title}),p.instructor.bio&&r.jsx(C,{sx:{color:Mt.textSecondary,fontSize:"0.875rem",lineHeight:1.7},children:p.instructor.bio})]}),r.jsx(C,{variant:"h5",sx:{fontWeight:700,mb:3},children:"Student Feedback"}),r.jsxs(ts,{sx:{bgcolor:Mt.card,border:`1px solid ${Mt.border}`,borderRadius:1,p:3},children:[r.jsxs(G,{direction:{xs:"column",md:"row"},spacing:4,children:[r.jsxs(E,{sx:{minWidth:150},children:[r.jsx(C,{variant:"h2",sx:{fontWeight:700,fontSize:"3rem",mb:1},children:p.rating}),r.jsx(Z2,{value:p.rating,precision:.1,readOnly:!0,icon:r.jsx(t5,{fontSize:"inherit"}),emptyIcon:r.jsx(t5,{fontSize:"inherit"}),sx:{color:Mt.warning,mb:1}}),r.jsx(C,{sx:{color:Mt.textSecondary,fontSize:"0.875rem"},children:"Course Rating"})]}),r.jsx(E,{sx:{flex:1},children:[5,4,3,2,1].map(L=>r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,sx:{mb:1},children:[r.jsx(C,{sx:{color:Mt.textSecondary,fontSize:"0.8rem",minWidth:15},children:L}),r.jsx(Ha,{variant:"determinate",value:p.ratingBreakdown[L],sx:{flex:1,height:8,borderRadius:4,bgcolor:Mt.border,"& .MuiLinearProgress-bar":{bgcolor:"#FFFFFF",borderRadius:4}}}),r.jsxs(C,{sx:{color:Mt.textSecondary,fontSize:"0.8rem",minWidth:35},children:[p.ratingBreakdown[L],"%"]})]},L))})]}),r.jsx(Ir,{sx:{borderColor:Mt.border,my:3}}),p.reviews.map(L=>r.jsx(E,{children:r.jsxs(G,{direction:"row",spacing:2,alignItems:"flex-start",children:[r.jsx(yr,{sx:{bgcolor:Mt.primary,width:40,height:40},children:L.avatar}),r.jsxs(E,{sx:{flex:1},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:2,sx:{mb:1},children:[r.jsx(C,{sx:{fontWeight:600,fontSize:"0.9rem"},children:L.user}),r.jsxs(C,{sx:{color:Mt.textSecondary,fontSize:"0.8rem"},children:["• ",L.date]})]}),r.jsx(Z2,{value:L.rating,size:"small",readOnly:!0,sx:{color:Mt.warning,mb:1}}),r.jsxs(C,{sx:{color:Mt.textSecondary,fontSize:"0.875rem",lineHeight:1.7},children:['"',L.comment,'"']})]})]})},L.id))]})]}),o===1&&r.jsxs(E,{children:[r.jsx(C,{sx:{color:Mt.textSecondary,mb:3},children:j}),p.modules.map(L=>r.jsxs(Fu,{expanded:l===`module-${L.id}`,onChange:H(`module-${L.id}`),sx:{bgcolor:Mt.card,border:`1px solid ${Mt.border}`,borderRadius:"12px !important",mb:2,"&:before":{display:"none"}},children:[r.jsx(Lu,{expandIcon:r.jsx(ti,{sx:{color:Mt.textSecondary}}),sx:{px:3},children:r.jsxs(E,{children:[r.jsx(C,{sx:{fontWeight:600,fontSize:"0.95rem",mb:.5},children:L.title}),r.jsxs(C,{sx:{color:Mt.textSecondary,fontSize:"0.8rem"},children:[L.lessons_count??(Array.isArray(L.lessons)?L.lessons.length:L.lessons)??0," Lessons • ",L.duration]})]})}),r.jsx(_u,{sx:{px:3,pb:3},children:r.jsx(C,{sx:{color:Mt.textSecondary},children:"Lesson content..."})})]},L.id))]}),o===2&&r.jsxs(ts,{sx:{bgcolor:Mt.card,border:`1px solid ${Mt.border}`,borderRadius:3,p:3},children:[r.jsx(C,{variant:"h6",sx:{fontWeight:700,mb:.5},children:p.instructor.name}),r.jsx(C,{sx:{color:Mt.accent,fontSize:"0.75rem",fontWeight:600,textTransform:"uppercase",mb:2},children:p.instructor.title}),p.instructor.bio&&r.jsx(C,{sx:{color:Mt.textSecondary,fontSize:"0.875rem",lineHeight:1.7},children:p.instructor.bio})]}),o===3&&r.jsxs(ts,{sx:{bgcolor:Mt.card,border:`1px solid ${Mt.border}`,borderRadius:3,p:3},children:[r.jsx(C,{variant:"h6",sx:{mb:3},children:"Student Reviews"}),p.reviews.map(L=>r.jsx(E,{children:r.jsxs(G,{direction:"row",spacing:2,children:[r.jsx(yr,{sx:{bgcolor:Mt.primary},children:L.avatar}),r.jsxs(E,{children:[r.jsx(C,{sx:{fontWeight:600},children:L.user}),r.jsx(Z2,{value:L.rating,size:"small",readOnly:!0,sx:{color:Mt.warning}}),r.jsxs(C,{sx:{color:Mt.textSecondary,fontSize:"0.875rem",mt:1},children:['"',L.comment,'"']})]})]})},L.id))]})]}),r.jsxs(E,{sx:{width:{xs:"100%",lg:"360px"},flexShrink:0,position:{lg:"sticky"},top:{lg:100},alignSelf:"flex-start"},children:[r.jsxs(ts,{sx:{bgcolor:Mt.card,border:`1px solid ${Mt.border}`,borderRadius:1,overflow:"hidden"},children:[r.jsx(E,{sx:{position:"relative"},children:P?r.jsxs(r.Fragment,{children:[r.jsx(E,{component:"img",src:p.image,alt:"Course Thumbnail",onError:L=>{L.currentTarget.style.display="none",L.currentTarget.parentElement.querySelector(".img-fallback").style.display="flex"},sx:{width:"100%",height:180,objectFit:"cover",display:"block"}}),r.jsx(E,{className:"img-fallback",sx:{display:"none",width:"100%",height:180,bgcolor:"#111827",alignItems:"center",justifyContent:"center"},children:r.jsx(hr,{sx:{fontSize:56,color:"rgba(255,255,255,0.15)"}})})]}):r.jsx(E,{sx:{width:"100%",height:180,bgcolor:"#111827",display:"flex",alignItems:"center",justifyContent:"center"},children:r.jsx(hr,{sx:{fontSize:56,color:"rgba(255,255,255,0.15)"}})})}),r.jsxs(ji,{sx:{p:2.5},children:[r.jsxs(G,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mb:2},children:[p.price>0?r.jsxs(C,{variant:"h5",sx:{fontWeight:700},children:[p.currency==="NGN"?"₦":"$",Number(p.price).toLocaleString()]}):r.jsx(C,{variant:"h5",sx:{fontWeight:700,color:Mt.success},children:"Free"}),z&&r.jsx(Pt,{label:z.is_essential?"Essential":"Standard",size:"small",sx:{bgcolor:z.is_essential?"rgba(245, 158, 11, 0.15)":"rgba(16, 185, 129, 0.15)",color:z.is_essential?"#F59E0B":"#10B981",border:`1px solid ${z.is_essential?"rgba(245, 158, 11, 0.3)":"rgba(16, 185, 129, 0.3)"}`,fontWeight:700,fontSize:"0.7rem"}})]}),z?.is_essential&&!N&&r.jsxs(E,{sx:{bgcolor:"rgba(245, 158, 11, 0.1)",border:"1px solid rgba(245, 158, 11, 0.3)",borderRadius:1,p:1.5,mb:2},children:[r.jsx(C,{sx:{color:"#F59E0B",fontWeight:600,fontSize:"0.8rem",mb:.5},children:"One-Time Payment — Unlimited Essential Access"}),r.jsx(C,{sx:{color:Mt.textSecondary,fontSize:"0.75rem",lineHeight:1.5},children:"Paying for any Essential course gives you permanent access to all Essential courses on the platform."})]}),R&&r.jsx(C,{sx:{color:Mt.error,fontSize:"0.8rem",mb:1.5},children:R}),N?r.jsx(ye,{fullWidth:!0,variant:"contained",onClick:()=>t(`/explore/lesson/${e}/`),sx:{bgcolor:Mt.success,py:1.25,fontWeight:600,textTransform:"none",borderRadius:1,mb:1.5,fontSize:"0.95rem","&:hover":{bgcolor:"#059669"}},children:"Resume Course"}):r.jsx(ye,{fullWidth:!0,variant:"contained",onClick:k,disabled:A,sx:{bgcolor:Mt.primary,py:1.25,fontWeight:600,textTransform:"none",borderRadius:1,mb:1.5,fontSize:"0.95rem","&.Mui-disabled":{bgcolor:Mt.primary,opacity:.7}},children:A?"Processing...":"Enroll Now"}),r.jsx(G,{spacing:1.5,children:[{icon:TC,label:"Level",value:p.level},{icon:Fc,label:"Duration",value:p.duration},{icon:tz,label:"Certificate",value:p.hasCertificate?"Yes, Official":"No"},{icon:mg,label:"Language",value:p.language},{icon:wC,label:"Start Date",value:p.startDate}].map((L,O)=>r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1,children:[r.jsx(L.icon,{sx:{color:Mt.textSecondary,fontSize:18}}),r.jsx(C,{sx:{color:Mt.textSecondary,fontSize:"0.8rem"},children:L.label})]}),r.jsx(C,{sx:{fontWeight:500,fontSize:"0.8rem"},children:L.value})]},O))})]}),r.jsx(E,{sx:{bgcolor:In(Mt.textSecondary,.1),p:1.5,textAlign:"center",borderTop:`1px solid ${Mt.border}`},children:r.jsx(C,{sx:{color:Mt.textSecondary,fontSize:"0.75rem"},children:"30-Day Money-Back Guarantee"})})]}),p.trainingFor.length>0&&r.jsxs(ts,{sx:{bgcolor:Mt.card,border:`1px solid ${Mt.border}`,borderRadius:1,mt:2,p:2.5},children:[r.jsx(C,{sx:{fontWeight:600,mb:1.5,fontSize:"0.95rem"},children:"Training For"}),r.jsx(G,{direction:"row",flexWrap:"wrap",gap:1,children:p.trainingFor.map((L,O)=>r.jsx(Pt,{label:L,size:"small",sx:{bgcolor:In(Mt.primary,.2),color:Mt.accent,fontSize:"0.75rem"}},O))})]})]})]})]})}),r.jsx(im,{})]})},tve=e=>e?new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):new Date().toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),IM=()=>{const e=Dn(),t=Nr(),n=On(),[s]=Oj(),[o,a]=v.useState(!1),[l,u]=v.useState(null),[d,f]=v.useState(t.state?.enrollment||null),[p]=v.useState(t.state?.course||{}),g=s.get("trxref"),x=s.get("reference");v.useEffect(()=>{x&&!g?(async()=>{a(!0),u(null);try{const S=await ia.verifyPaymentStatus(x);f(S)}catch{u("Payment verification failed. Your enrollment may still be active — check My Enrollments.")}finally{a(!1)}})():g&&x&&(async()=>{a(!0),u(null);try{const S=await ia.verifyPayment({trxref:g,reference:x});f(S)}catch{u("Payment verification failed. Your enrollment may still be active — check My Enrollments.")}finally{a(!1)}})()},[g,x]);const b={id:d?.id||g||x||"—",date:tve(d?.enrolled_at||d?.created_at),courseTitle:d?.course?.title||p?.title||"Your Course",instructor:d?.course?.instructor||p?.instructor||"—",price:p?.price??0};return r.jsxs(E,{sx:{minHeight:"100vh",bgcolor:"#0B1120",color:"#fff",display:"flex",flexDirection:"column"},children:[r.jsxs(E,{sx:{borderBottom:"1px solid rgba(255,255,255,0.1)",px:{xs:2,md:4},py:2,display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[r.jsxs(G,{direction:"row",alignItems:"center",spacing:1.5,children:[r.jsx(E,{component:"img",src:Pc,alt:"Integritas Hub",sx:{width:32,height:32,objectFit:"contain"}}),r.jsx(C,{variant:"subtitle1",sx:{fontWeight:700,color:"#fff",display:{xs:"none",sm:"block"}},children:"Integritas Hub"})]}),r.jsx(G,{direction:"row",spacing:3,sx:{display:{xs:"none",md:"flex"}},children:["Dashboard","Courses","Marketplace","Community"].map(y=>r.jsx(C,{variant:"body2",sx:{color:"rgba(255,255,255,0.7)",cursor:"pointer","&:hover":{color:"#fff"}},children:y},y))}),r.jsx(E,{sx:{width:32,height:32,bgcolor:"rgba(255,255,255,0.1)",borderRadius:"50%"}})]}),r.jsxs(Zs,{maxWidth:"md",sx:{flex:1,py:{xs:4,md:8},display:"flex",flexDirection:"column",alignItems:"center",maxWidth:{sm:"700px !important"}},children:[o&&r.jsxs(E,{sx:{display:"flex",flexDirection:"column",alignItems:"center",py:8,gap:2},children:[r.jsx(nn,{sx:{color:"#3B82F6"}}),r.jsx(C,{variant:"body2",sx:{color:"rgba(255,255,255,0.5)"},children:"Verifying your payment..."})]}),l&&!o&&r.jsx(Wt,{severity:"warning",sx:{mb:4,width:"100%",bgcolor:"rgba(245,158,11,0.1)",color:"#F59E0B",border:"1px solid rgba(245,158,11,0.2)"},children:l}),!o&&r.jsxs(r.Fragment,{children:[r.jsx(E,{sx:{width:72,height:72,bgcolor:In(n.palette.primary.main,.1),borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",mb:3},children:r.jsx(hg,{sx:{fontSize:40,color:"#3B82F6"}})}),r.jsx(C,{variant:"h5",sx:{fontWeight:700,mb:1,textAlign:"center"},children:l?"Enrollment Processed":"Payment Successful!"}),r.jsx(C,{variant:"body2",sx:{color:"rgba(255,255,255,0.6)",mb:6,textAlign:"center"},children:"Thank you for your purchase. You are now enrolled and can start learning."}),r.jsxs(E,{sx:{width:"100%",bgcolor:"rgba(255,255,255,0.05)",borderRadius:1,border:"1px solid rgba(255,255,255,0.05)",overflow:"hidden",mb:4},children:[r.jsx(E,{sx:{p:3,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"rgba(40, 46, 57, 1)"},children:r.jsx(C,{variant:"subtitle1",sx:{fontWeight:700},children:"Enrollment Details"})}),r.jsx(E,{sx:{p:3,borderBottom:"1px solid rgba(255,255,255,0.05)",bgcolor:"rgba(40, 46, 57, 1)"},children:r.jsxs(G,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",spacing:4,children:[r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)",display:"block",mb:.5,fontSize:10,letterSpacing:.5},children:"ENROLLMENT ID"}),r.jsx(C,{variant:"body2",sx:{color:"#fff",wordBreak:"break-all"},children:b.id})]}),r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)",display:"block",mb:.5,fontSize:10,letterSpacing:.5},children:"DATE"}),r.jsx(C,{variant:"body2",sx:{color:"#fff"},children:b.date})]}),r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)",display:"block",mb:.5,fontSize:10,letterSpacing:.5},children:"STATUS"}),r.jsx(C,{variant:"body2",sx:{color:"#10B981",fontWeight:600},children:d?.status||"Enrolled"})]})]})}),r.jsxs(E,{sx:{p:3,pb:0},children:[r.jsx(C,{variant:"subtitle2",sx:{color:"rgba(255,255,255,0.7)",display:"block",mb:2,fontWeight:600,fontSize:12,letterSpacing:.5,px:2},children:"ENROLLED COURSE"}),r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:2,bgcolor:"#000",p:2,borderRadius:1},children:[p?.thumbnail?r.jsx(E,{component:"img",src:p.thumbnail,alt:b.courseTitle,sx:{width:64,height:48,borderRadius:1,objectFit:"cover"}}):r.jsx(E,{sx:{width:64,height:48,borderRadius:1,bgcolor:"rgba(37,99,235,0.2)",display:"flex",alignItems:"center",justifyContent:"center"},children:r.jsx(zp,{sx:{color:"#3B82F6",fontSize:24}})}),r.jsxs(E,{sx:{flex:1},children:[r.jsx(C,{variant:"body2",sx:{fontWeight:600,mb:.5,color:"#fff"},children:b.courseTitle}),r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)"},children:b.instructor})]}),b.price>0&&r.jsxs(C,{variant:"subtitle2",sx:{fontWeight:600,color:"#fff"},children:["$",b.price.toFixed(2)]})]}),r.jsx(Ir,{sx:{mt:3,borderColor:"rgba(255,255,255,0.05)"}})]}),b.price>0&&r.jsxs(E,{sx:{p:3,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[r.jsx(C,{variant:"body2",sx:{color:"rgba(255,255,255,0.7)"},children:"Total Paid"}),r.jsxs(C,{variant:"h6",sx:{color:"#3B82F6",fontWeight:700},children:["$",b.price.toFixed(2)]})]})]})]}),r.jsxs(G,{direction:{xs:"column",sm:"row"},spacing:2,sx:{width:"100%",justifyContent:"center"},children:[r.jsx(ye,{variant:"contained",onClick:()=>{const y=d?.course_id||d?.course?.id||d?.courseId||p?.courseId||p?.id||sessionStorage.getItem("pending_course_id");sessionStorage.removeItem("pending_course_id"),e(y?`/explore/lesson/${y}`:"/learner")},startIcon:r.jsx(hg,{sx:{fontSize:20}}),sx:{bgcolor:"#2563EB",color:"#fff",py:1.5,px:4,textTransform:"none",fontWeight:600,borderRadius:1.5,"&:hover":{bgcolor:"#1D4ED8"}},children:"Start Learning Now"}),r.jsx(ye,{variant:"outlined",onClick:()=>e("/explore/courses"),sx:{color:"#fff",borderColor:"rgba(255,255,255,0.2)",py:1.5,px:4,textTransform:"none",fontWeight:600,borderRadius:1.5,"&:hover":{borderColor:"#fff",bgcolor:"rgba(255,255,255,0.05)"}},children:"Return to Marketplace"})]}),r.jsxs(C,{variant:"body2",sx:{color:"rgba(255,255,255,0.6)",mt:4},children:["Need help with your order? ",r.jsx(E,{component:"span",sx:{color:"#3B82F6",cursor:"pointer","&:hover":{textDecoration:"underline"}},children:"Contact Support"})]})]}),r.jsx(E,{sx:{borderTop:"1px solid rgba(255,255,255,0.1)",px:6,py:3,display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx(C,{variant:"caption",sx:{color:"rgba(255,255,255,0.4)",textAlign:"center"},children:"© 2024 Integritas Hub. All rights reserved."})})]})},nve=(e={})=>{const t=String(e?.membership_role||"").trim().toLowerCase();return e?.is_owner||t==="owner"?"Owner":t==="admin"?"Admin":t==="manager"?"Manager":t==="staff"?"Invited Member":e?.can_manage?"Manager Access":"Invited Member"},Mm=({title:e="Organization Scope",subtitle:t="Select an organization before performing org-level actions.",organizations:n=[],selectedOrgId:s="",selectedOrganization:o=null,onChangeOrgId:a,actions:l=null})=>{const u=n.filter(f=>!!(f?.is_owner||f?.can_manage)),d=n.filter(f=>!f?.is_owner&&!f?.can_manage);return r.jsxs(Je,{elevation:0,sx:{bgcolor:"rgba(15, 23, 42, 0.4)",backdropFilter:"blur(8px)",borderRadius:2,border:"1px solid #1E293B",p:{xs:1.5,md:2},mb:3,display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:2},children:[r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:2,flex:1,minWidth:280},children:[r.jsx(E,{sx:{width:44,height:44,borderRadius:"10px",bgcolor:o?"rgba(59, 130, 246, 0.1)":"rgba(255, 255, 255, 0.03)",border:"1px solid",borderColor:o?"rgba(59, 130, 246, 0.2)":"rgba(255, 255, 255, 0.05)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:r.jsx(Cl,{sx:{color:o?"#60A5FA":"#64748B",fontSize:22}})}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:o?"#F8FAFC":"#E2E8F0",fontSize:"0.95rem",fontWeight:600,lineHeight:1.2},children:o?o.name:e}),r.jsx(C,{sx:{color:"#94A3B8",fontSize:"0.8rem",mt:.5},children:o?`Role: ${nve(o)}`:t})]})]}),r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:1.5,flexShrink:0,width:{xs:"100%",sm:"auto"}},children:[r.jsx(Ur,{size:"small",sx:{minWidth:{xs:"100%",sm:240}},children:r.jsxs(Fn,{displayEmpty:!0,value:s,onChange:f=>a?.(f.target.value),IconComponent:Qee,sx:{...Yn,height:42,bgcolor:"#0B1120",borderColor:"#1E293B",borderRadius:"8px","&:hover":{borderColor:"#334155"},"& .MuiSelect-select":{py:1,px:1.5,color:s?"#F8FAFC":"#64748B",fontSize:"0.9rem"}},MenuProps:Tr,children:[r.jsx(It,{value:"",disabled:!0,children:r.jsx("em",{children:"Select Organization Context"})}),u.length>0&&r.jsx(dg,{disableSticky:!0,sx:{bgcolor:"#0B1120",color:"#94A3B8",fontSize:"0.75rem",lineHeight:"32px"},children:"Manageable Organizations"}),u.map(f=>r.jsx(It,{value:f.id,sx:{fontSize:"0.9rem"},children:f.name},f.id)),d.length>0&&r.jsx(dg,{disableSticky:!0,sx:{bgcolor:"#0B1120",color:"#94A3B8",fontSize:"0.75rem",lineHeight:"32px",borderTop:"1px solid #1E293B"},children:"Invited Organizations"}),d.map(f=>r.jsx(It,{value:f.id,sx:{fontSize:"0.9rem"},children:f.name},f.id))]})}),l]})]})},EL="Integritas Hub_admin_selected_org_id",rve=()=>typeof window>"u"?"":String(localStorage.getItem(EL)||"").trim(),sve=e=>{typeof window>"u"||localStorage.setItem(EL,String(e||"").trim())},TL="Integritas Hub_admin_known_orgs",ove=(e,t)=>{try{return JSON.parse(e)}catch{return t}},kL=(e={})=>{const t=String(e.id||e.organization_id||e.org_id||"").trim();if(!t)return null;const n=String(e.membership_role||"").trim(),s=!!e.is_owner||n==="owner",o=!!e.can_manage||["owner","admin","manager"].includes(n);return{id:t,name:String(e.name||e.slug||t).trim()||t,slug:String(e.slug||"").trim(),email_domain:String(e.email_domain||"").trim(),membership_role:n,membership_source:String(e.membership_source||"").trim(),is_owner:s,can_delete:!!e.can_delete||s,can_manage:o}},G0=(e=[])=>{const t=new Map;return e.forEach(n=>{const s=kL(n);if(!s)return;const o=t.get(s.id)||{},a=s.membership_role||o.membership_role||"",l=!!(o.is_owner||s.is_owner||a==="owner");t.set(s.id,{...o,...s,membership_role:a,is_owner:l,can_delete:!!(o.can_delete||s.can_delete||l),can_manage:!!(o.can_manage||s.can_manage||["owner","admin","manager"].includes(a))})}),Array.from(t.values())},ive=()=>{if(typeof window>"u")return[];const e=localStorage.getItem(TL);if(!e)return[];const t=ove(e,[]);return Array.isArray(t)?G0(t):[]},J5=e=>{typeof window>"u"||localStorage.setItem(TL,JSON.stringify(e))},ave=e=>[401,403,404,405].includes(e?.status),lve=(e=[])=>e.find(t=>t?.is_owner||t?.can_manage)||e[0]||null,Rm=()=>{const{user:e}=ps(),[t,n]=v.useState(()=>ive()),[s,o]=v.useState(()=>rve()),a=v.useCallback(async()=>{try{const g=await Un.listUserOrganizations(),x=G0(g?.data||[]);let b=x;return n(y=>{const S=G0([...y,...x]);return J5(S),b=S,S}),b}catch(g){return ave(g)||console.error("Failed to load user organizations:",g),[]}},[]);v.useEffect(()=>{if(!e)return;const g=setTimeout(()=>{a()},0);return()=>clearTimeout(g)},[a,e]);const l=v.useCallback(g=>{const x=String(g||"").trim();o(x),sve(x)},[]),u=v.useMemo(()=>t.some(x=>x.id===s)?s:String(lve(t)?.id||"").trim(),[t,s]),d=v.useCallback(g=>{const x=kL(g);x&&(n(b=>{const y=G0([x,...b]);return J5(y),y}),l(x.id))},[l]),f=v.useCallback(g=>{const x=String(g||"").trim();x&&(n(b=>{const y=b.filter(S=>S.id!==x);return J5(y),y}),u===x&&l(""))},[u,l]),p=v.useMemo(()=>t.find(g=>g.id===u)||null,[t,u]);return{organizations:t,selectedOrgId:u,selectedOrganization:p,setSelectedOrgId:l,refreshOrganizations:a,rememberOrganization:d,forgetOrganization:f}},ML=["course","learning_path"],cve=["assigned","in_progress","completed","revoked"],FM=e=>{if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString()},RL=(e={})=>String(e?.title||e?.name||"").trim()||"Untitled course",zL=(e={})=>String(e?.title||e?.name||"").trim()||"Untitled learning path",_M=(e={})=>e.type==="course"?RL(e.course):zL(e.learning_path),uve=(e={})=>String(e.user?.name||e.user?.email||"").trim()||"Unknown user",dve=(e={})=>String(e.user?.email||"").trim()||"No email available",fve=(e={})=>String(e.organization?.name||e.organization_name||e.org?.name||e.organization?.slug||"").trim()||"Organization",LM=e=>String(e||"").trim().toLowerCase(),Sj=e=>String(e||"").trim().toLowerCase(),hve=(e={})=>String(e?.id||e?.user_id||e?.user?.id||e?.member_id||e?.member?.id||"").trim(),pve=(e={})=>Sj(e?.email||e?.user?.email||e?.member?.email||""),IL=(e={})=>{const t=hve(e);return t?{id:t,name:String(e?.name||e?.user?.name||e?.member?.name||"").trim(),email:pve(e)}:null},PM=(e=[])=>{const t=new Map;return e.forEach(n=>{const s=IL(n);if(!s)return;const o=t.get(s.id)||{};t.set(s.id,{...o,...s,name:s.name||o.name||"",email:s.email||o.email||""})}),Array.from(t.values())},$1=(e={})=>{const t=String(e?.name||"").trim(),n=String(e?.email||"").trim();return t&&n?`${t} (${n})`:t||n||"Unknown user"},gve=(e=[],t=[])=>{const n=e.map(s=>t.find(o=>o.id===String(s))||{id:s}).map(s=>$1(s)).filter(Boolean);return n.length<=2?n.join(", "):`${n.slice(0,2).join(", ")} +${n.length-2} more`},mve=({open:e,onClose:t,onAssign:n,saving:s,assignForm:o,setAssignForm:a,courses:l,learningPaths:u,userOptions:d,selectedUserIds:f,setSelectedUserIds:p,inviteStats:g})=>r.jsx(tr,{open:e,onClose:t,closeAfterTransition:!0,sx:{display:"flex",alignItems:"center",justifyContent:"center",p:2},children:r.jsx(Du,{in:e,children:r.jsxs(Je,{sx:{width:"100%",maxWidth:600,bgcolor:"#0F172A",border:"1px solid #1E293B",borderRadius:3,boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.5)",overflow:"hidden",position:"relative"},children:[r.jsxs(E,{sx:{p:3,borderBottom:"1px solid #1E293B",bgcolor:"rgba(30, 41, 59, 0.5)"},children:[r.jsx(C,{variant:"h6",sx:{color:"#F8FAFC",fontWeight:700},children:"Create New Assignment"}),r.jsx(C,{variant:"body2",sx:{color:"#94A3B8",mt:.5},children:"Assign educational content to your organization members."})]}),r.jsx(E,{sx:{p:3},children:r.jsxs(G,{spacing:3,children:[r.jsxs(G,{direction:{xs:"column",sm:"row"},spacing:2,children:[r.jsxs(Ur,{fullWidth:!0,children:[r.jsx(rs,{sx:{color:"#94A3B8"},children:"Content Type"}),r.jsx(Fn,{label:"Content Type",value:o.type,onChange:x=>a(b=>({...b,type:x.target.value,course_id:"",learning_path_id:""})),sx:{...Yn,bgcolor:"#0B1120"},MenuProps:Tr,children:ML.map(x=>r.jsx(It,{value:x,sx:{textTransform:"capitalize"},children:x.replace("_"," ")},x))})]}),o.type==="course"?r.jsxs(Ur,{fullWidth:!0,children:[r.jsx(rs,{sx:{color:"#94A3B8"},children:"Select Course"}),r.jsx(Fn,{label:"Select Course",value:o.course_id,onChange:x=>a(b=>({...b,course_id:x.target.value})),sx:{...Yn,bgcolor:"#0B1120"},MenuProps:Tr,children:l.length===0?r.jsx(It,{value:"",disabled:!0,children:"No courses found"}):l.map(x=>r.jsx(It,{value:x.id,children:RL(x)},x.id))})]}):r.jsxs(Ur,{fullWidth:!0,children:[r.jsx(rs,{sx:{color:"#94A3B8"},children:"Select Learning Path"}),r.jsx(Fn,{label:"Select Learning Path",value:o.learning_path_id,onChange:x=>a(b=>({...b,learning_path_id:x.target.value})),sx:{...Yn,bgcolor:"#0B1120"},MenuProps:Tr,children:u.length===0?r.jsx(It,{value:"",disabled:!0,children:"No learning paths found"}):u.map(x=>r.jsx(It,{value:x.id,children:zL(x)},x.id))})]})]}),r.jsxs(Ur,{fullWidth:!0,children:[r.jsx(rs,{sx:{color:"#94A3B8"},children:"Select Members"}),r.jsx(Fn,{multiple:!0,label:"Select Members",value:f,onChange:x=>{const b=x.target.value;p(typeof b=="string"?b.split(","):b)},sx:{...Yn,bgcolor:"#0B1120"},MenuProps:Tr,renderValue:x=>gve(x,d),startAdornment:r.jsx(Ar,{position:"start",children:r.jsx(EC,{sx:{color:"#64748B",fontSize:20,ml:1}})}),children:d.length===0?r.jsx(It,{value:"",disabled:!0,children:"No members found"}):d.map(x=>r.jsx(It,{value:x.id,children:$1(x)},x.id))})]}),r.jsx(it,{label:"Deadline (Optional)",type:"date",value:o.due_at,onChange:x=>a(b=>({...b,due_at:x.target.value})),sx:{...xt,"& .MuiInputBase-root":{bgcolor:"#0B1120"}},InputLabelProps:{shrink:!0},fullWidth:!0,InputProps:{startAdornment:r.jsx(Ar,{position:"start",children:r.jsx(Bee,{sx:{color:"#64748B",fontSize:20}})})}}),(g.pending>0||g.acceptedWithoutUser>0)&&r.jsxs(E,{sx:{p:1.5,borderRadius:2,bgcolor:"rgba(59, 130, 246, 0.05)",border:"1px solid rgba(59, 130, 246, 0.1)",display:"flex",gap:1.5},children:[r.jsx(Lc,{sx:{color:"#3B82F6",fontSize:20,mt:.2}}),r.jsxs(C,{variant:"caption",sx:{color:"#94A3B8",lineHeight:1.4},children:[g.pending>0?`${g.pending} members are still pending. `:"",g.acceptedWithoutUser>0?"Some members are awaiting sync and aren't listed yet.":""]})]})]})}),r.jsxs(E,{sx:{p:3,bgcolor:"rgba(30, 41, 59, 0.5)",borderTop:"1px solid #1E293B",display:"flex",justifyContent:"flex-end",gap:2},children:[r.jsx(ye,{onClick:t,sx:{color:"#94A3B8",textTransform:"none",fontWeight:600,"&:hover":{bgcolor:"rgba(255,255,255,0.05)"}},children:"Cancel"}),r.jsx(ye,{variant:"contained",onClick:n,disabled:s,sx:{...os,px:4,textTransform:"none",fontWeight:600,boxShadow:"0 4px 6px -1px rgba(59, 130, 246, 0.3)"},children:s?"Creating...":"Create Assignment"})]})]})})}),xve=({typeFilter:e,setTypeFilter:t,statusFilter:n,setStatusFilter:s})=>{const[o,a]=v.useState(null),l=!!o;return r.jsxs(r.Fragment,{children:[r.jsx(tn,{title:"Filters",children:r.jsxs(ye,{startIcon:r.jsx(Tb,{}),onClick:u=>a(u.currentTarget),sx:{bgcolor:"rgba(30, 41, 59, 0.5)",border:"1px solid #1E293B",color:"#E2E8F0",textTransform:"none",px:2,"&:hover":{bgcolor:"rgba(30, 41, 59, 0.8)",borderColor:"#334155"}},children:["Filters",(e||n)&&r.jsx(E,{sx:{ml:1,width:8,height:8,borderRadius:"50%",bgcolor:"#3B82F6",border:"2px solid #0F172A"}})]})}),r.jsxs(Xg,{open:l,anchorEl:o,onClose:()=>a(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{sx:{bgcolor:"#0F172A",border:"1px solid #1E293B",borderRadius:2,p:2,minWidth:260,boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.5)"}},children:[r.jsx(C,{variant:"subtitle2",sx:{color:"#F8FAFC",fontWeight:700,mb:2},children:"Filter Assignments"}),r.jsxs(G,{spacing:2.5,children:[r.jsxs(Ur,{fullWidth:!0,size:"small",children:[r.jsx(rs,{sx:{color:"#94A3B8"},children:"Type"}),r.jsxs(Fn,{label:"Type",value:e,onChange:u=>t(u.target.value),sx:Yn,MenuProps:Tr,children:[r.jsx(It,{value:"",children:"All Types"}),ML.map(u=>r.jsx(It,{value:u,sx:{textTransform:"capitalize"},children:u},u))]})]}),r.jsxs(Ur,{fullWidth:!0,size:"small",children:[r.jsx(rs,{sx:{color:"#94A3B8"},children:"Status"}),r.jsxs(Fn,{label:"Status",value:n,onChange:u=>s(u.target.value),sx:Yn,MenuProps:Tr,children:[r.jsx(It,{value:"",children:"All Statuses"}),cve.map(u=>r.jsx(It,{value:u,sx:{textTransform:"capitalize"},children:u},u))]})]}),r.jsx(Ir,{sx:{borderColor:"#1E293B"}}),r.jsx(ye,{size:"small",fullWidth:!0,onClick:()=>{t(""),s(""),a(null)},sx:{color:"#EF4444",textTransform:"none",fontWeight:600},children:"Reset Filters"})]})]})]})},DM=()=>{const{user:e}=ps(),{pathname:t}=Nr(),{organizations:n,selectedOrgId:s,selectedOrganization:o,setSelectedOrgId:a}=Rm(),l=t.includes("/organization/my-assignments"),u=!!(o?.can_manage??SN(e)),[d,f]=v.useState([]),[p,g]=v.useState([]),[x,b]=v.useState(!1),[y,S]=v.useState(!1),[j,A]=v.useState(null),[M,R]=v.useState(""),[_,z]=v.useState(""),[F,N]=v.useState([]),[I,B]=v.useState([]),[H,P]=v.useState([]),[k,L]=v.useState({pending:0,acceptedWithoutUser:0}),[O,W]=v.useState([]),[D,q]=v.useState({type:"course",course_id:"",learning_path_id:"",due_at:""}),[K,Y]=v.useState({open:!1,message:"",severity:"success"}),[ie,V]=v.useState(!1),re=(ee,X="success")=>{Y({open:!0,message:ee,severity:X})},fe=()=>{Y(ee=>({...ee,open:!1}))},ae=v.useCallback(async()=>{if(!s||!u||l){f([]);return}b(!0);try{const ee=await Un.listAssignments(s,{type:M,status:_,per_page:50});f(ee.data||[])}catch(ee){console.error("Failed to load assignments:",ee),f([]),re(ee.message||"Failed to load assignments.","error")}finally{b(!1)}},[u,l,s,M,_]),ue=v.useCallback(async()=>{b(!0);try{const ee=await Un.listMyAssignments({status:_||void 0,type:M||void 0,per_page:20});g(ee.data||[])}catch(ee){console.error("Failed to load my assignments:",ee),re(ee.message||"Failed to load my assignments.","error")}finally{b(!1)}},[_,M]),se=v.useCallback(async()=>{if(!s||!u||l){N([]),B([]),L({pending:0,acceptedWithoutUser:0});return}try{const[ee,X,ve]=await Promise.all([Un.listUsers({per_page:100,org_id:s}),Un.listCourses({per_page:100,org_id:s}),Un.listInvitations(s,{per_page:200}).catch(()=>({data:[]}))]),st=Array.isArray(ve?.data)?ve.data:[],Ge=st.filter(Ke=>LM(Ke?.status)==="pending").length,qe=st.filter(Ke=>LM(Ke?.status)==="accepted"),Be=qe.map(Ke=>IL({id:Ke?.user_id||Ke?.user?.id||Ke?.member_id||Ke?.member?.id,name:Ke?.user?.name||Ke?.member?.name||Ke?.name,email:Ke?.user?.email||Ke?.member?.email||Ke?.email})).filter(Boolean),Te=PM([...ee.data||[],...Be]);N(Te),B(X.data||[]);const Re=new Set(Te.map(Ke=>Sj(Ke?.email)).filter(Boolean)),Se=qe.filter(Ke=>{const ot=Sj(Ke?.email||Ke?.user?.email||Ke?.member?.email);return ot?!Re.has(ot):!0}).length;L({pending:Ge,acceptedWithoutUser:Se})}catch(ee){console.error("Failed to load assignment options:",ee)}},[u,l,s]),J=v.useCallback(async()=>{if(!s||!u||l){P([]);return}try{const ee=await Un.listLearningPaths(s,{per_page:100});P(ee.data||[])}catch(ee){console.error("Failed to load learning paths for assignment:",ee),P([])}},[u,l,s]);v.useEffect(()=>{se()},[se]),v.useEffect(()=>{J()},[J]),v.useEffect(()=>{ae()},[ae]),v.useEffect(()=>{l&&ue()},[l,ue]),v.useEffect(()=>{const ee=new Set((F||[]).map(X=>String(X?.id||"").trim()).filter(Boolean));W(X=>X.filter(ve=>ee.has(String(ve||"").trim())))},[F]);const ce=v.useMemo(()=>[...new Set(O.map(ee=>String(ee).trim()).filter(Boolean))],[O]),oe=v.useMemo(()=>PM(F).sort((ee,X)=>$1(ee).localeCompare($1(X))),[F]),ge=async()=>{if(!s){re("Select an organization first.","error");return}if(ce.length===0){re("Select at least one user.","error");return}const ee={type:D.type,user_ids:ce,due_at:D.due_at||void 0};if(D.type==="course"){if(!String(D.course_id||"").trim()){re("Choose a course before assigning.","error");return}ee.course_id=D.course_id}if(D.type==="learning_path"){if(!String(D.learning_path_id||"").trim()){re("Choose a learning path before assigning.","error");return}ee.learning_path_id=D.learning_path_id}S(!0);try{await Un.assignToUsers(s,ee),re("Assignment created successfully."),W([]),q(X=>({...X,due_at:""})),V(!1),await ae()}catch(X){console.error("Failed to assign content:",X),re(X.message||"Failed to create assignment.","error")}finally{S(!1)}},de=async ee=>{if(!(!s||!ee)){A(ee);try{await Un.revokeAssignment(s,ee),re("Assignment revoked successfully."),await ae()}catch(X){console.error("Failed to revoke assignment:",X),re(X.message||"Failed to revoke assignment.","error")}finally{A(null)}}},le=v.useMemo(()=>d,[d]);return r.jsxs(E,{sx:{p:{xs:2.5,md:5},bgcolor:"#0F1729",minHeight:"calc(100vh - 70px)",width:"100%"},children:[r.jsxs(G,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"stretch",md:"center"},spacing:3,sx:{mb:5},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h4",sx:{color:"#F8FAFC",fontWeight:800,letterSpacing:"-0.02em",display:"flex",alignItems:"center",gap:1.5},children:l?r.jsxs(r.Fragment,{children:[r.jsx(H0,{sx:{fontSize:32,color:"#6366F1"}}),"My Learning Tasks"]}):r.jsxs(r.Fragment,{children:[r.jsx(H0,{sx:{fontSize:32,color:"#3B82F6"}}),"Organization Assignments"]})}),r.jsx(C,{variant:"body2",sx:{color:"#64748B",mt:1,maxWidth:600},children:l?"Monitor your assigned courses and learning paths, track deadlines, and view your progress in real-time.":"Plan your team’s development. Create specific assignments, set deadlines, and monitor completion metrics across your organization."})]}),r.jsxs(G,{direction:"row",spacing:2,children:[u&&!l&&r.jsx(ye,{variant:"contained",startIcon:r.jsx(wb,{}),onClick:()=>V(!0),sx:{...os,borderRadius:"10px",textTransform:"none",fontWeight:600,px:3,height:44},children:"Create Assignment"}),r.jsx(tn,{title:"Refresh Data",children:r.jsx(Ve,{onClick:l?ue:ae,sx:{color:"#94A3B8",bgcolor:"rgba(30, 41, 59, 0.4)",border:"1px solid #1E293B",borderRadius:"10px","&:hover":{bgcolor:"rgba(30, 41, 59, 0.8)"}},children:r.jsx(nm,{})})})]})]}),r.jsx(Mm,{organizations:n,selectedOrgId:s,selectedOrganization:o,onChangeOrgId:a}),!u&&!l&&r.jsx(Du,{in:!0,children:r.jsxs(E,{sx:{p:2,mb:4,borderRadius:2,bgcolor:"rgba(59, 130, 246, 0.05)",border:"1px solid rgba(59, 130, 246, 0.1)",display:"flex",alignItems:"center",gap:2},children:[r.jsx(Lc,{sx:{color:"#3B82F6"}}),r.jsx(C,{variant:"body2",sx:{color:"#94A3B8"},children:"You do not have organization assignment management access. Open the My Assignments menu to view the items assigned to you."})]})}),u&&!l&&r.jsx(G,{direction:"row",justifyContent:"flex-end",sx:{mb:2},children:r.jsx(xve,{typeFilter:M,setTypeFilter:R,statusFilter:_,setStatusFilter:z})}),!l&&r.jsx(ko,{component:Je,elevation:0,sx:{bgcolor:"rgba(15, 23, 42, 0.4)",backdropFilter:"blur(10px)",borderRadius:3,border:"1px solid #1E293B",overflow:"hidden"},children:r.jsxs(Eo,{children:[r.jsx(Mo,{children:r.jsxs(Bt,{sx:{bgcolor:"rgba(30, 41, 59, 0.5)"},children:[r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Member"}),r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Type"}),r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Assigned Content"}),r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Due Date"}),r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Status"}),r.jsx(je,{align:"right",sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Control"})]})}),r.jsx(To,{children:x?Array.from({length:5}).map((ee,X)=>r.jsxs(Bt,{sx:{borderBottom:"1px solid #1E293B"},children:[r.jsxs(je,{sx:Rt,children:[r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:"70%",height:24}}),r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:"50%",height:16}})]}),r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:60}})}),r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:"80%"}})}),r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:100}})}),r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"rectangular",sx:{bgcolor:"#1E293B",width:80,height:24,borderRadius:1}})}),r.jsx(je,{align:"right",sx:Rt,children:r.jsx(jn,{variant:"rectangular",sx:{bgcolor:"#1E293B",width:60,height:32,borderRadius:1,ml:"auto"}})})]},X)):s?le.length===0?r.jsx(Bt,{children:r.jsx(je,{colSpan:6,sx:{p:0},children:r.jsxs(E,{sx:{py:10,textAlign:"center"},children:[r.jsx(u8,{sx:{fontSize:60,color:"#1E293B",mb:2}}),r.jsx(C,{sx:{color:"#F8FAFC",fontWeight:600,mb:1},children:"Clean Slate"}),r.jsx(C,{sx:{color:"#64748B",maxWidth:300,mx:"auto"},children:'No assignments have been created yet. Click "Create Assignment" to get started.'})]})})}):le.map(ee=>r.jsxs(Bt,{sx:{"&:hover":{bgcolor:"rgba(255,255,255,0.02)"},transition:"background-color 0.2s ease",borderBottom:"1px solid #1E293B"},children:[r.jsxs(je,{sx:Rt,children:[r.jsx(C,{sx:{color:"#F1F5F9",fontWeight:600,fontSize:"0.9rem"},children:uve(ee)}),r.jsx(C,{sx:{color:"#64748B",fontSize:"0.75rem"},children:dve(ee)})]}),r.jsx(je,{sx:{...Rt,color:"#94A3B8",textTransform:"capitalize",fontSize:"0.85rem"},children:ee.type==="learning_path"?"Learning Path":ee.type}),r.jsx(je,{sx:{...Rt,color:"#E2E8F0",fontWeight:500,fontSize:"0.85rem"},children:_M(ee)}),r.jsx(je,{sx:{...Rt,color:"#94A3B8",fontSize:"0.85rem"},children:FM(ee.due_at)}),r.jsx(je,{sx:Rt,children:r.jsx(Pt,{size:"small",label:ee.status||"unknown",sx:{textTransform:"capitalize",bgcolor:ee.status==="completed"?"rgba(16, 185, 129, 0.1)":ee.status==="revoked"?"rgba(239, 68, 68, 0.1)":ee.status==="in_progress"?"rgba(59, 130, 246, 0.1)":"rgba(245, 158, 11, 0.1)",color:ee.status==="completed"?"#10B981":ee.status==="revoked"?"#EF4444":ee.status==="in_progress"?"#3B82F6":"#F59E0B",fontWeight:700,fontSize:"0.7rem",borderRadius:"6px",border:"1px solid transparent",borderColor:ee.status==="completed"?"rgba(16, 185, 129, 0.2)":"rgba(239, 68, 68, 0.2)"}})}),r.jsx(je,{align:"right",sx:Rt,children:r.jsx(ye,{size:"small",onClick:()=>de(ee.id),disabled:j===ee.id||ee.status==="revoked",sx:{textTransform:"none",color:"#EF4444",fontWeight:600,fontSize:"0.8rem","&:hover":{bgcolor:"rgba(239, 68, 68, 0.1)"},"&.Mui-disabled":{color:"#334155"}},children:j===ee.id?"Revoking...":"Revoke"})})]},ee.id)):r.jsx(Bt,{children:r.jsx(je,{colSpan:6,sx:{p:0},children:r.jsxs(E,{sx:{py:10,textAlign:"center"},children:[r.jsx(Cl,{sx:{fontSize:60,color:"#1E293B",mb:2}}),r.jsx(C,{sx:{color:"#F8FAFC",fontWeight:600,mb:1},children:"No Organization Selected"}),r.jsx(C,{sx:{color:"#64748B",maxWidth:300,mx:"auto"},children:"Please select an organization context above to see the member assignments."})]})})})})]})}),l&&r.jsxs(E,{sx:{mt:8},children:[r.jsxs(C,{variant:"h5",sx:{color:"#F8FAFC",fontWeight:700,mb:3,display:"flex",alignItems:"center",gap:1.5},children:[r.jsx(nz,{sx:{color:"#10B981"}}),"My Active Assignments"]}),x&&l?r.jsx(G,{spacing:2,children:Array.from({length:3}).map((ee,X)=>r.jsxs(Je,{sx:{p:2.5,borderRadius:3,bgcolor:"#0F172A",border:"1px solid #1E293B"},children:[r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:"55%",height:28}}),r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:"35%",height:20}}),r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:"25%",height:20}})]},X))}):p.length===0?r.jsxs(Je,{sx:{p:4,borderRadius:3,bgcolor:"#0F172A",border:"1px solid #1E293B",textAlign:"center"},children:[r.jsx(u8,{sx:{fontSize:52,color:"#1E293B",mb:2}}),r.jsx(C,{sx:{color:"#F8FAFC",fontWeight:600,mb:1},children:"No assignments yet"}),r.jsx(C,{sx:{color:"#64748B",maxWidth:360,mx:"auto"},children:"You have not been assigned any courses or learning paths yet."})]}):r.jsx(G,{spacing:2,children:p.map(ee=>r.jsxs(Je,{sx:{p:2.5,borderRadius:3,bgcolor:"#0F172A",border:"1px solid #1E293B",display:"flex",flexDirection:{xs:"column",md:"row"},justifyContent:"space-between",gap:2,transition:"transform 0.2s ease, border-color 0.2s ease","&:hover":{transform:"translateY(-2px)",borderColor:"#334155"}},children:[r.jsxs(E,{sx:{display:"flex",gap:2},children:[r.jsx(E,{sx:{width:48,height:48,borderRadius:2,bgcolor:"rgba(99, 102, 241, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:r.jsx(H0,{sx:{color:"#6366F1"}})}),r.jsxs(E,{children:[r.jsx(C,{sx:{color:"#F1F5F9",fontWeight:600,fontSize:"1rem"},children:_M(ee)}),r.jsxs(C,{sx:{color:"#64748B",fontSize:"0.85rem",mt:.5},children:["Organization: ",fve(ee)]})]})]}),r.jsxs(G,{direction:"row",spacing:3,alignItems:"center",children:[r.jsxs(E,{sx:{textAlign:{xs:"left",md:"right"}},children:[r.jsx(C,{sx:{color:"#94A3B8",fontSize:"0.75rem",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:700},children:"Due Date"}),r.jsx(C,{sx:{color:"#E2E8F0",fontWeight:600},children:FM(ee.due_at)})]}),r.jsx(Pt,{size:"small",label:ee.status||"Pending",sx:{bgcolor:"rgba(99, 102, 241, 0.1)",color:"#818CF8",fontWeight:700,fontSize:"0.7rem",borderRadius:"6px"}})]})]},ee.id))})]}),r.jsx(mve,{open:ie,onClose:()=>V(!1),onAssign:ge,saving:y,assignForm:D,setAssignForm:q,courses:I,learningPaths:H,userOptions:oe,selectedUserIds:O,setSelectedUserIds:W,inviteStats:k}),r.jsx(gs,{open:K.open,autoHideDuration:4e3,onClose:fe,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:r.jsx(Wt,{severity:K.severity,onClose:fe,variant:"filled",sx:{borderRadius:2,fontWeight:600},children:K.message})})]})},bve=["pending","accepted","expired","revoked"],OM={expires_days:"7",emails_text:""},BM={action:"resend",expires_days:"7",reason:"Access revoked by admin"},jj=e=>String(e||"").split(/[\n,;]/).map(t=>t.trim().toLowerCase()).filter(Boolean),yve=e=>String(e||"").trim().toLowerCase().replace(/^@+/,""),Cj=(e,t)=>{const n=String(e||"").trim().toLowerCase();return n?t&&n.endsWith("@")?`${n}${t}`:n:""},NM=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(e||"").trim()),vve=(e,t="")=>{const n=jj(e).map(l=>Cj(l,t)),s=[...new Set(n)],o=s.filter(NM),a=s.filter(l=>!NM(l));return{valid:o,invalid:a,duplicatesRemoved:n.length-s.length,totalParsed:n.length}},$M=e=>{if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()},Sve=({statusFilter:e,setStatusFilter:t,searchTerm:n,setSearchTerm:s})=>{const[o,a]=v.useState(null),l=!!o;return r.jsxs(r.Fragment,{children:[r.jsx(tn,{title:"Filters",children:r.jsxs(ye,{startIcon:r.jsx(Tb,{}),onClick:u=>a(u.currentTarget),sx:{bgcolor:"rgba(30, 41, 59, 0.5)",border:"1px solid #1E293B",color:"#E2E8F0",textTransform:"none",px:2,"&:hover":{bgcolor:"rgba(30, 41, 59, 0.8)",borderColor:"#334155"}},children:["Filters",(e||n)&&r.jsx(E,{sx:{ml:1,width:8,height:8,borderRadius:"50%",bgcolor:"#3B82F6",border:"2px solid #0F172A"}})]})}),r.jsxs(Xg,{open:l,anchorEl:o,onClose:()=>a(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{sx:{bgcolor:"#0F172A",border:"1px solid #1E293B",borderRadius:2,p:2,minWidth:280,boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.5)"}},children:[r.jsx(C,{variant:"subtitle2",sx:{color:"#F8FAFC",fontWeight:700,mb:2},children:"Filter Invitations"}),r.jsxs(G,{spacing:2.5,children:[r.jsx(it,{size:"small",placeholder:"Search by email...",value:n,onChange:u=>s(u.target.value),sx:xt,InputProps:{startAdornment:r.jsx(Ar,{position:"start",children:r.jsx(EC,{sx:{color:"#64748B",fontSize:20}})})}}),r.jsxs(Ur,{fullWidth:!0,size:"small",children:[r.jsx(rs,{sx:{color:"#94A3B8"},children:"Status"}),r.jsxs(Fn,{label:"Status",value:e,onChange:u=>t(u.target.value),sx:Yn,MenuProps:Tr,children:[r.jsx(It,{value:"",children:"All Statuses"}),bve.map(u=>r.jsx(It,{value:u,sx:{textTransform:"capitalize"},children:u},u))]})]}),r.jsx(Ir,{sx:{borderColor:"#1E293B"}}),r.jsx(ye,{size:"small",fullWidth:!0,onClick:()=>{s(""),t(""),a(null)},sx:{color:"#EF4444",textTransform:"none",fontWeight:600},children:"Reset Filters"})]})]})]})},jve=()=>{const{organizations:e,selectedOrgId:t,selectedOrganization:n,setSelectedOrgId:s}=Rm(),[o,a]=v.useState([]),[l,u]=v.useState(!1),[d,f]=v.useState(!1),[p,g]=v.useState(null),[x,b]=v.useState(""),[y,S]=v.useState(""),[j,A]=v.useState([]),[M,R]=v.useState({total:0}),[_,z]=v.useState(!1),[F,N]=v.useState(OM),[I,B]=v.useState(""),[H,P]=v.useState(!1),[k,L]=v.useState(BM),[O,W]=v.useState({open:!1,message:"",severity:"success"}),D=v.useMemo(()=>yve(n?.email_domain),[n]),q=v.useMemo(()=>vve(F.emails_text,D),[F.emails_text,D]),K=(de,le="success")=>{W({open:!0,message:de,severity:le})},Y=()=>{W(de=>({...de,open:!1}))},ie=v.useCallback(async()=>{if(!t){a([]),R({total:0});return}u(!0);try{const de=await Un.listInvitations(t,{q:x,status:y,per_page:50});a(de.data||[]),R(de.meta||{total:0})}catch(de){console.error("Failed to list invitations:",de),a([]),R({total:0}),K(de.message||"Failed to load invitations.","error")}finally{u(!1)}},[t,x,y]);v.useEffect(()=>{const de=setTimeout(()=>{ie()},300);return()=>clearTimeout(de)},[ie]),v.useEffect(()=>{A(de=>de.filter(le=>o.some(ee=>ee.id===le)))},[o]);const V=v.useMemo(()=>o.filter(de=>j.includes(de.id)),[o,j]),re=()=>{if(j.length===o.length&&o.length>0){A([]);return}A(o.map(de=>de.id))},fe=de=>{A(le=>le.includes(de)?le.filter(ee=>ee!==de):[...le,de])},ae=async()=>{if(!t){K("Select an organization first.","error");return}const de=q.valid;if(de.length===0){K("Add at least one valid staff email address.","error");return}f(!0);try{await Un.batchInviteStaff(t,{role:"staff",expires_days:Number(F.expires_days||7),emails:de}),N(OM),B(""),z(!1),K("Invitations sent successfully."),await ie()}catch(le){console.error("Failed to send invites:",le),K(le.message||"Failed to send invites.","error")}finally{f(!1)}},ue=de=>{const le=String(de.target.value||""),ee=Cj(le,D);B(ee)},se=()=>{const de=String(I||"").trim().toLowerCase();if(!de)return;const le=Cj(de,D);if(!le)return;if(new Set(jj(F.emails_text)).has(le)){B("");return}N(X=>{const ve=X.emails_text?`${X.emails_text} ${le}`:le;return{...X,emails_text:ve}}),B("")},J=de=>{const le=jj(F.emails_text).filter(ee=>ee!==de);N(ee=>({...ee,emails_text:le.join(` `)}))},ce=async de=>{if(!(!t||!de)){g(de);try{await Un.resendSingleInvitation(t,{email:de,expires_days:7}),K(`Invitation resent to ${de}.`),await ie()}catch(le){console.error("Failed to resend invite:",le),K(le.message||"Failed to resend invitation.","error")}finally{g(null)}}},oe=async de=>{if(!(!t||!de?.id)){g(de.id);try{await Un.revokeSingleInvitation(t,de.id,{reason:"Invitation revoked by admin"}),K(`Invitation revoked for ${de.email}.`),await ie()}catch(le){console.error("Failed to revoke invitation:",le),K(le.message||"Failed to revoke invitation.","error")}finally{g(null)}}},ge=async()=>{if(!t||V.length===0){K("Select one or more invitations first.","error");return}const de=V.map(le=>le.email).filter(Boolean);if(de.length===0){K("No valid emails selected.","error");return}f(!0);try{k.action==="resend"?(await Un.resendBulkInvitations(t,{emails:de,expires_days:Number(k.expires_days||7)}),K("Bulk resend completed.")):(await Un.revokeBulkInvitations(t,{emails:de,reason:k.reason||"Access revoked by admin"}),K("Bulk revoke completed.")),P(!1),A([]),await ie()}catch(le){console.error("Failed bulk invitation action:",le),K(le.message||"Bulk invitation action failed.","error")}finally{f(!1)}};return r.jsxs(E,{sx:{p:{xs:2.5,md:5},bgcolor:"#0F1729",minHeight:"calc(100vh - 70px)",width:"100%"},children:[r.jsxs(G,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"stretch",md:"center"},spacing:3,sx:{mb:5},children:[r.jsxs(E,{children:[r.jsxs(C,{variant:"h4",sx:{color:"#F8FAFC",fontWeight:800,letterSpacing:"-0.02em",display:"flex",alignItems:"center",gap:1.5},children:[r.jsx(gte,{sx:{fontSize:32,color:"#10B981"}}),"Organization Invitations"]}),r.jsx(C,{variant:"body2",sx:{color:"#64748B",mt:1,maxWidth:600},children:"Manage access to your organization. Invite staff quickly, use bulk tools to handle multiple invitations, and track status."})]}),r.jsxs(G,{direction:"row",spacing:2,children:[r.jsx(ye,{variant:"contained",startIcon:r.jsx(wb,{}),onClick:()=>z(!0),disabled:!t,sx:{...os,borderRadius:"10px",textTransform:"none",fontWeight:600,px:3,height:44},children:"Invite Staff"}),r.jsxs(ye,{variant:"soft",startIcon:r.jsx(kte,{}),onClick:()=>{L(BM),P(!0)},disabled:!t||j.length===0,sx:{bgcolor:"rgba(99, 102, 241, 0.1)",color:"#818CF8",borderRadius:"10px",textTransform:"none",fontWeight:600,px:2,"&:hover":{bgcolor:"rgba(99, 102, 241, 0.2)"},"&.Mui-disabled":{bgcolor:"rgba(30, 41, 59, 0.4)",color:"#475569"}},children:["Bulk Action (",j.length,")"]}),r.jsx(tn,{title:"Refresh Data",children:r.jsx(Ve,{onClick:ie,sx:{color:"#94A3B8",bgcolor:"rgba(30, 41, 59, 0.4)",border:"1px solid #1E293B",borderRadius:"10px","&:hover":{bgcolor:"rgba(30, 41, 59, 0.8)"}},children:r.jsx(nm,{})})})]})]}),r.jsx(Mm,{organizations:e,selectedOrgId:t,selectedOrganization:n,onChangeOrgId:s}),r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:2},children:[r.jsxs(C,{sx:{color:"#64748B",fontSize:"0.85rem"},children:["Showing ",o.length," of ",M.total||o.length," invitations"]}),r.jsx(Sve,{statusFilter:y,setStatusFilter:S,searchTerm:x,setSearchTerm:b})]}),r.jsx(ko,{component:Je,elevation:0,sx:{bgcolor:"rgba(15, 23, 42, 0.4)",backdropFilter:"blur(10px)",borderRadius:3,border:"1px solid #1E293B",overflow:"hidden"},children:r.jsxs(Eo,{children:[r.jsx(Mo,{children:r.jsxs(Bt,{sx:{bgcolor:"rgba(30, 41, 59, 0.5)"},children:[r.jsx(je,{sx:{...fn,py:2.5},padding:"checkbox",children:r.jsx($f,{checked:o.length>0&&j.length===o.length,indeterminate:j.length>0&&j.length<o.length,onChange:re,sx:{color:"#475569","&.Mui-checked":{color:"#3B82F6"},"&.MuiCheckbox-indeterminate":{color:"#3B82F6"}}})}),r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Member Email"}),r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Status"}),r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Expires"}),r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Accepted At"}),r.jsx(je,{align:"right",sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Actions"})]})}),r.jsx(To,{children:l?Array.from({length:5}).map((de,le)=>r.jsxs(Bt,{sx:{borderBottom:"1px solid #1E293B"},children:[r.jsx(je,{padding:"checkbox",children:r.jsx(jn,{variant:"rectangular",sx:{bgcolor:"#1E293B",width:20,height:20,borderRadius:.5}})}),r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:"60%",height:24}})}),r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"rectangular",sx:{bgcolor:"#1E293B",width:80,height:24,borderRadius:1}})}),r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:140}})}),r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:140}})}),r.jsx(je,{align:"right",sx:Rt,children:r.jsx(jn,{variant:"rectangular",sx:{bgcolor:"#1E293B",width:120,height:32,borderRadius:1,ml:"auto"}})})]},le)):t?o.length===0?r.jsx(Bt,{children:r.jsx(je,{colSpan:6,sx:{p:0},children:r.jsxs(E,{sx:{py:10,textAlign:"center"},children:[r.jsx(d8,{sx:{fontSize:60,color:"#1E293B",mb:2}}),r.jsx(C,{sx:{color:"#F8FAFC",fontWeight:600,mb:1},children:"No Invitations Found"}),r.jsx(C,{sx:{color:"#64748B",maxWidth:300,mx:"auto"},children:x||y?"Try adjusting your filters or search terms to find what you're looking for.":"Start building your team by inviting members to join your organization."})]})})}):o.map(de=>{const le=p===de.id||p===de.email,ee=j.includes(de.id);return r.jsxs(Bt,{sx:{"&:hover":{bgcolor:"rgba(255,255,255,0.02)"},transition:"background-color 0.2s ease",borderBottom:"1px solid #1E293B",bgcolor:ee?"rgba(59, 130, 246, 0.05)":"transparent"},children:[r.jsx(je,{sx:Rt,padding:"checkbox",children:r.jsx($f,{checked:ee,onChange:()=>fe(de.id),sx:{color:"#475569","&.Mui-checked":{color:"#3B82F6"}}})}),r.jsx(je,{sx:Rt,children:r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[r.jsx(gg,{sx:{color:"#64748B",fontSize:18}}),r.jsx(C,{sx:{color:"#F1F5F9",fontWeight:600,fontSize:"0.9rem"},children:de.email})]})}),r.jsx(je,{sx:Rt,children:r.jsx(Pt,{size:"small",label:de.status||"unknown",sx:{textTransform:"capitalize",bgcolor:de.status==="accepted"?"rgba(16, 185, 129, 0.1)":de.status==="revoked"?"rgba(239, 68, 68, 0.1)":de.status==="pending"?"rgba(245, 158, 11, 0.1)":"rgba(100, 116, 139, 0.1)",color:de.status==="accepted"?"#10B981":de.status==="revoked"?"#EF4444":de.status==="pending"?"#F59E0B":"#94A3B8",fontWeight:700,fontSize:"0.7rem",borderRadius:"6px"}})}),r.jsx(je,{sx:{...Rt,color:"#94A3B8",fontSize:"0.85rem"},children:$M(de.expires_at)}),r.jsx(je,{sx:{...Rt,color:"#94A3B8",fontSize:"0.85rem"},children:$M(de.accepted_at)}),r.jsx(je,{align:"right",sx:Rt,children:r.jsxs(G,{direction:"row",spacing:1,justifyContent:"flex-end",children:[r.jsx(ye,{size:"small",onClick:()=>ce(de.email),disabled:le||de.status==="accepted",sx:{textTransform:"none",color:"#3B82F6",fontWeight:600,fontSize:"0.8rem","&:hover":{bgcolor:"rgba(59, 130, 246, 0.1)"},"&.Mui-disabled":{color:"#334155"}},children:"Resend"}),r.jsx(ye,{size:"small",onClick:()=>oe(de),disabled:le||de.status==="accepted"||de.status==="revoked",sx:{textTransform:"none",color:"#EF4444",fontWeight:600,fontSize:"0.8rem","&:hover":{bgcolor:"rgba(239, 68, 68, 0.1)"},"&.Mui-disabled":{color:"#334155"}},children:"Revoke"})]})})]},de.id)}):r.jsx(Bt,{children:r.jsx(je,{colSpan:6,sx:{p:0},children:r.jsxs(E,{sx:{py:10,textAlign:"center"},children:[r.jsx(Cl,{sx:{fontSize:60,color:"#1E293B",mb:2}}),r.jsx(C,{sx:{color:"#F8FAFC",fontWeight:600,mb:1},children:"No Organization Selected"}),r.jsx(C,{sx:{color:"#64748B",maxWidth:300,mx:"auto"},children:"Please select an organization context above to manage pending and accepted invitations."})]})})})})]})}),r.jsx(tr,{open:_,onClose:()=>!d&&z(!1),children:r.jsxs(E,{sx:{...kr,width:{xs:"95%",md:640},bgcolor:"#0F172A",border:"1px solid #1E293B",borderRadius:3,boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.5)",p:0,overflow:"hidden"},children:[r.jsxs(E,{sx:{p:3,borderBottom:"1px solid #1E293B",bgcolor:"rgba(30, 41, 59, 0.5)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h6",sx:{color:"#F8FAFC",fontWeight:700},children:"Invite Staff Members"}),r.jsx(C,{variant:"body2",sx:{color:"#94A3B8",mt:.5},children:"Add new members to your organization."})]}),r.jsx(Ve,{onClick:()=>!d&&z(!1),sx:{color:"#94A3B8"},children:r.jsx(pg,{})})]}),r.jsxs(G,{spacing:3,sx:{p:3},children:[r.jsx(it,{label:"Expiration Period (Days)",type:"number",value:F.expires_days,onChange:de=>N(le=>({...le,expires_days:de.target.value})),sx:xt,fullWidth:!0}),r.jsxs(G,{direction:{xs:"column",md:"row"},spacing:1.5,children:[r.jsx(it,{label:"Single Email Entry",value:I,onChange:ue,onKeyDown:de=>{de.key==="Enter"&&(de.preventDefault(),se())},placeholder:D?"user@":"user@company.com",sx:xt,fullWidth:!0,InputProps:{startAdornment:r.jsx(Ar,{position:"start",children:r.jsx(gg,{sx:{color:"#64748B",fontSize:20}})})}}),r.jsx(ye,{variant:"contained",onClick:se,sx:{...os,minWidth:100,py:0},children:"Add"})]}),!!D&&r.jsx(E,{sx:{p:1,px:1.5,borderRadius:1.5,bgcolor:"rgba(59, 130, 246, 0.05)",border:"1px solid rgba(59, 130, 246, 0.1)"},children:r.jsxs(C,{sx:{color:"#3B82F6",fontSize:"0.75rem",fontWeight:600},children:["Domain Lock: @",D]})}),r.jsx(it,{label:"Bulk Email Import",multiline:!0,rows:4,value:F.emails_text,onChange:de=>N(le=>({...le,emails_text:de.target.value})),sx:xt,placeholder:`user1@company.com user2@company.com user3@company.com`,helperText:"Separate emails by new lines or commas."}),r.jsxs(E,{children:[r.jsxs(C,{sx:{color:"#94A3B8",fontSize:"0.8rem",mb:1,fontWeight:600},children:["Validation Summary: ",q.valid.length," Valid | ",q.invalid.length," Invalid"]}),r.jsxs(G,{direction:"row",spacing:1,useFlexGap:!0,flexWrap:"wrap",children:[q.valid.map(de=>r.jsx(Pt,{label:de,onDelete:()=>J(de),size:"small",sx:{bgcolor:"rgba(16, 185, 129, 0.1)",color:"#10B981",border:"1px solid rgba(16, 185, 129, 0.2)",fontWeight:600}},de)),q.invalid.map(de=>r.jsx(Pt,{label:de,onDelete:()=>J(de),size:"small",sx:{bgcolor:"rgba(239, 68, 68, 0.1)",color:"#EF4444",border:"1px solid rgba(239, 68, 68, 0.2)",fontWeight:600}},de))]})]}),r.jsx(Wt,{severity:"info",icon:r.jsx(Lc,{sx:{color:"#3B82F6"}}),sx:{bgcolor:"rgba(59, 130, 246, 0.05)",color:"#94A3B8",border:"1px solid rgba(59, 130, 246, 0.1)"},children:"Paste directly from CSV or spreadsheets to invite multiple members at once."})]}),r.jsxs(E,{sx:{p:3,borderTop:"1px solid #1E293B",bgcolor:"rgba(30, 41, 59, 0.5)",display:"flex",justifyContent:"flex-end",gap:2},children:[r.jsx(ye,{onClick:()=>z(!1),disabled:d,sx:{color:"#94A3B8",textTransform:"none",fontWeight:600},children:"Cancel"}),r.jsx(ye,{variant:"contained",onClick:ae,disabled:d,sx:os,children:d?"Sending...":"Send Invitations"})]})]})}),r.jsx(tr,{open:H,onClose:()=>!d&&P(!1),children:r.jsxs(E,{sx:{...kr,width:{xs:"95%",md:520},bgcolor:"#0F172A",border:"1px solid #1E293B",borderRadius:3,boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.5)",p:0,overflow:"hidden"},children:[r.jsxs(E,{sx:{p:3,borderBottom:"1px solid #1E293B",bgcolor:"rgba(30, 41, 59, 0.5)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r.jsx(C,{variant:"h6",sx:{color:"#F8FAFC",fontWeight:700},children:"Bulk Action Control"}),r.jsx(Ve,{onClick:()=>!d&&P(!1),sx:{color:"#94A3B8"},children:r.jsx(pg,{})})]}),r.jsxs(G,{spacing:3,sx:{p:3},children:[r.jsxs(Ur,{fullWidth:!0,children:[r.jsx(rs,{sx:{color:"#94A3B8"},children:"Select Operation"}),r.jsxs(Fn,{label:"Select Operation",value:k.action,onChange:de=>L(le=>({...le,action:de.target.value})),sx:Yn,MenuProps:Tr,children:[r.jsx(It,{value:"resend",children:"Resend Selected Invitations"}),r.jsx(It,{value:"revoke",children:"Revoke Selected Invitations"})]})]}),k.action==="resend"?r.jsx(it,{label:"New Expiration Period (Days)",type:"number",value:k.expires_days,onChange:de=>L(le=>({...le,expires_days:de.target.value})),sx:xt,fullWidth:!0}):r.jsx(it,{label:"Revocation Reason",value:k.reason,onChange:de=>L(le=>({...le,reason:de.target.value})),sx:xt,fullWidth:!0,placeholder:"e.g. Access policy update"}),r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:1.5,p:2,borderRadius:2,bgcolor:"rgba(30, 41, 59, 0.5)",border:"1px solid #1E293B"},children:[r.jsx(d8,{sx:{color:"#3B82F6"}}),r.jsxs(C,{sx:{color:"#E2E8F0",fontWeight:600},children:[j.length," members targeted for this action."]})]})]}),r.jsxs(E,{sx:{p:3,borderTop:"1px solid #1E293B",bgcolor:"rgba(30, 41, 59, 0.5)",display:"flex",justifyContent:"flex-end",gap:2},children:[r.jsx(ye,{onClick:()=>P(!1),disabled:d,sx:{color:"#94A3B8",textTransform:"none",fontWeight:600},children:"Cancel"}),r.jsx(ye,{variant:"contained",onClick:ge,disabled:d,sx:{...os,bgcolor:k.action==="revoke"?"#EF4444":"#3B82F6","&:hover":{bgcolor:k.action==="revoke"?"#DC2626":"#2563EB"}},children:d?"Applying...":"Apply Bulk Action"})]})]})}),r.jsx(gs,{open:O.open,autoHideDuration:4e3,onClose:Y,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:r.jsx(Wt,{severity:O.severity,onClose:Y,variant:"filled",sx:{borderRadius:2,fontWeight:600},children:O.message})})]})},FL=["draft","published","archived"],nf=20,eS={title:"",description:"",status:"draft"},HM=(e={})=>String(e?.title||e?.name||"").trim()||"Untitled course",Cve=(e={})=>String(e?.title||e?.name||"").trim()||"Untitled learning path",wve=({statusFilter:e,setStatusFilter:t,searchTerm:n,setSearchTerm:s})=>{const[o,a]=v.useState(null),l=!!o;return r.jsxs(r.Fragment,{children:[r.jsx(tn,{title:"Filters",children:r.jsxs(ye,{startIcon:r.jsx(Tb,{}),onClick:u=>a(u.currentTarget),sx:{bgcolor:"rgba(30, 41, 59, 0.5)",border:"1px solid #1E293B",color:"#E2E8F0",textTransform:"none",px:2,"&:hover":{bgcolor:"rgba(30, 41, 59, 0.8)",borderColor:"#334155"}},children:["Filters",(e||n)&&r.jsx(E,{sx:{ml:1,width:8,height:8,borderRadius:"50%",bgcolor:"#3B82F6",border:"2px solid #0F172A"}})]})}),r.jsxs(Xg,{open:l,anchorEl:o,onClose:()=>a(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{sx:{bgcolor:"#0F172A",border:"1px solid #1E293B",borderRadius:2,p:2,minWidth:280,boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.5)"}},children:[r.jsx(C,{variant:"subtitle2",sx:{color:"#F8FAFC",fontWeight:700,mb:2},children:"Filter Learning Paths"}),r.jsxs(G,{spacing:2.5,children:[r.jsx(it,{size:"small",placeholder:"Search by title...",value:n,onChange:u=>s(u.target.value),sx:xt,InputProps:{startAdornment:r.jsx(Ar,{position:"start",children:r.jsx(EC,{sx:{color:"#64748B",fontSize:20}})})}}),r.jsxs(Ur,{fullWidth:!0,size:"small",children:[r.jsx(rs,{sx:{color:"#94A3B8"},children:"Status"}),r.jsxs(Fn,{label:"Status",value:e,onChange:u=>t(u.target.value),sx:Yn,MenuProps:Tr,children:[r.jsx(It,{value:"",children:"All Statuses"}),FL.map(u=>r.jsx(It,{value:u,sx:{textTransform:"capitalize"},children:u},u))]})]}),r.jsx(Ir,{sx:{borderColor:"#1E293B"}}),r.jsx(ye,{size:"small",fullWidth:!0,onClick:()=>{s(""),t(""),a(null)},sx:{color:"#EF4444",textTransform:"none",fontWeight:600},children:"Reset Filters"})]})]})]})},Ave=()=>{const{organizations:e,selectedOrgId:t,selectedOrganization:n,setSelectedOrgId:s}=Rm(),o=!!n?.can_manage,[a,l]=v.useState([]),[u,d]=v.useState(!1),[f,p]=v.useState(!1),[g,x]=v.useState(null),[b,y]=v.useState(!1),[S,j]=v.useState(1),[A,M]=v.useState({current_page:1,last_page:1,total:0,per_page:nf}),[R,_]=v.useState(""),[z,F]=v.useState(""),[N,I]=v.useState(!1),[B,H]=v.useState(null),[P,k]=v.useState(eS),[L,O]=v.useState(!1),[W,D]=v.useState(!1),[q,K]=v.useState(null),[Y,ie]=v.useState([]),[V,re]=v.useState(""),[fe,ae]=v.useState([]),[ue,se]=v.useState({open:!1,message:"",severity:"success"}),J=(Te,Re="success")=>{se({open:!0,message:Te,severity:Re})},ce=()=>{se(Te=>({...Te,open:!1}))},oe=v.useCallback(async()=>{if(!t){l([]),y(!1),M({current_page:1,last_page:1,total:0,per_page:nf});return}if(!o){l([]),y(!0),M({current_page:1,last_page:1,total:0,per_page:nf});return}d(!0);try{const Te=await Un.listLearningPaths(t,{status:z,q:R,per_page:nf,page:S});l(Te.data||[]),M({current_page:Number(Te?.meta?.current_page)||S,last_page:Number(Te?.meta?.last_page)||1,total:Number(Te?.meta?.total)||(Te.data||[]).length,per_page:Number(Te?.meta?.per_page)||nf}),y(!1)}catch(Te){if(l([]),M({current_page:1,last_page:1,total:0,per_page:nf}),Te?.status===403){y(!0);return}console.error("Failed to list learning paths:",Te),J(Te.message||"Failed to load learning paths.","error")}finally{d(!1)}},[o,S,R,t,z]),ge=v.useCallback(async()=>{if(!t||!o){ie([]);return}try{const Te=await Un.listCourses({per_page:100,org_id:t||void 0});ie(Te.data||[])}catch(Te){console.error("Failed to load courses for dropdown:",Te),ie([])}},[o,t]);v.useEffect(()=>{ge()},[ge]),v.useEffect(()=>{const Te=setTimeout(()=>{oe()},300);return()=>clearTimeout(Te)},[oe]),v.useEffect(()=>{j(1)},[R,t,z]),v.useEffect(()=>{t&&o||(I(!1),O(!1),H(null),K(null),re(""),ae([]))},[o,t]);const de=()=>{H(null),k(eS),I(!0)},le=Te=>{H(Te),k({title:String(Te?.title||""),description:String(Te?.description||""),status:String(Te?.status||"draft")}),I(!0)},ee=async()=>{if(!t){J("Select an organization first.","error");return}if(!String(P.title||"").trim()){J("Learning path title is required.","error");return}p(!0);try{const Te={title:P.title.trim(),description:P.description.trim(),status:P.status};B?.id?(await Un.updateLearningPath(t,B.id,Te),J("Learning path updated successfully.")):(await Un.createLearningPath(t,Te),J("Learning path created successfully.")),I(!1),k(eS),await oe()}catch(Te){console.error("Failed to save learning path:",Te),J(Te.message||"Failed to save learning path.","error")}finally{p(!1)}},X=async(Te,{openModal:Re=!1}={})=>{if(!(!t||!Te)){D(!0);try{const Se=await Un.getLearningPathById(t,Te,{with_items:1}),Ke=Array.isArray(Se?.items)?Se.items:[];return K({...Se,items:Ke}),ae(Ke.map(ot=>({id:ot.id,position:Number(ot.position||0)||0}))),Re&&O(!0),Se}catch(Se){return console.error("Failed to load learning path detail:",Se),J(Se.message||"Failed to load learning path details.","error"),null}finally{D(!1)}}},ve=async(Te,Re)=>{if(!(!t||!Te?.id)){x(Te.id);try{if(Re==="publish"&&(await Un.publishLearningPath(t,Te.id),J("Learning path published.")),Re==="archive"&&(await Un.archiveLearningPath(t,Te.id),J("Learning path archived.")),Re==="delete"){if(!window.confirm("Delete this learning path? This action cannot be undone."))return;await Un.deleteLearningPath(t,Te.id),J("Learning path deleted.")}await oe(),q?.id===Te.id&&Re!=="delete"&&await X(Te.id),q?.id===Te.id&&Re==="delete"&&(O(!1),K(null))}catch(Se){console.error("Learning path action failed:",Se),J(Se.message||"Learning path action failed.","error")}finally{x(null)}}},st=async()=>{if(!t||!q?.id)return;const Te=String(V||"").trim();if(!Te){J("Select a course first.","error");return}p(!0);try{await Un.addCourseToLearningPath(t,q.id,{course_id:Te}),re(""),J("Course added to learning path."),await X(q.id),await oe()}catch(Re){console.error("Failed to add course to path:",Re),J(Re.message||"Failed to add course.","error")}finally{p(!1)}},Ge=async Te=>{if(!(!t||!q?.id||!Te)&&window.confirm("Remove this item from the path?")){x(Te);try{await Un.removeLearningPathItem(t,q.id,Te),J("Item removed from learning path."),await X(q.id),await oe()}catch(Re){console.error("Failed to remove path item:",Re),J(Re.message||"Failed to remove item.","error")}finally{x(null)}}},qe=async()=>{if(!t||!q?.id)return;const Te=fe.map(Re=>({id:Re.id,position:Number(Re.position||0)})).filter(Re=>Re.id&&Re.position>0);if(Te.length===0){J("Provide valid positions starting from 1.","error");return}p(!0);try{await Un.reorderLearningPathItems(t,q.id,{items:Te}),J("Learning path items reordered."),await X(q.id)}catch(Re){console.error("Failed to reorder items:",Re),J(Re.message||"Failed to reorder items.","error")}finally{p(!1)}},Be=v.useMemo(()=>[...Array.isArray(q?.items)?q.items:[]].sort((Re,Se)=>Number(Re.position||0)-Number(Se.position||0)),[q]);return r.jsxs(E,{sx:{p:{xs:2.5,md:5},bgcolor:"#0F1729",minHeight:"calc(100vh - 70px)",width:"100%"},children:[r.jsxs(G,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"stretch",md:"center"},spacing:3,sx:{mb:5},children:[r.jsxs(E,{children:[r.jsxs(C,{variant:"h4",sx:{color:"#F8FAFC",fontWeight:800,letterSpacing:"-0.02em",display:"flex",alignItems:"center",gap:1.5},children:[r.jsx(n0,{sx:{fontSize:32,color:"#6366F1"}}),"Learning Paths"]}),r.jsx(C,{variant:"body2",sx:{color:"#64748B",mt:1,maxWidth:600},children:"Curate specialized educational journeys. Oragnize courses into structured paths, manage status, and monitor deployment across your organization."})]}),r.jsxs(G,{direction:"row",spacing:2,children:[r.jsx(ye,{variant:"contained",startIcon:r.jsx(wb,{}),onClick:de,disabled:!t||!o,sx:{...os,borderRadius:"10px",textTransform:"none",fontWeight:600,px:3,height:44},children:"Create Learning Path"}),r.jsx(tn,{title:"Refresh Data",children:r.jsx(Ve,{onClick:oe,sx:{color:"#94A3B8",bgcolor:"rgba(30, 41, 59, 0.4)",border:"1px solid #1E293B",borderRadius:"10px","&:hover":{bgcolor:"rgba(30, 41, 59, 0.8)"}},children:r.jsx(nm,{})})})]})]}),r.jsx(Mm,{organizations:e,selectedOrgId:t,selectedOrganization:n,onChangeOrgId:s}),t&&b&&r.jsx(Du,{in:!0,children:r.jsxs(E,{sx:{p:2,mb:4,borderRadius:2,bgcolor:"rgba(59, 130, 246, 0.05)",border:"1px solid rgba(59, 130, 246, 0.1)",display:"flex",alignItems:"center",gap:2},children:[r.jsx(Lc,{sx:{color:"#3B82F6"}}),r.jsx(C,{variant:"body2",sx:{color:"#94A3B8"},children:"You are not authorized to manage learning paths in this organization. Please contact your administrator for manager access."})]})}),r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:2},children:[r.jsxs(C,{sx:{color:"#64748B",fontSize:"0.85rem"},children:["Showing ",a.length," of ",A.total," learning paths"]}),r.jsx(wve,{statusFilter:z,setStatusFilter:F,searchTerm:R,setSearchTerm:_})]}),r.jsx(ko,{component:Je,elevation:0,sx:{bgcolor:"rgba(15, 23, 42, 0.4)",backdropFilter:"blur(10px)",borderRadius:3,border:"1px solid #1E293B",overflow:"hidden"},children:r.jsxs(Eo,{children:[r.jsx(Mo,{children:r.jsxs(Bt,{sx:{bgcolor:"rgba(30, 41, 59, 0.5)"},children:[r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Path Name"}),r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Status"}),r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Course Count"}),r.jsx(je,{align:"right",sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Actions"})]})}),r.jsx(To,{children:u?Array.from({length:5}).map((Te,Re)=>r.jsxs(Bt,{sx:{borderBottom:"1px solid #1E293B"},children:[r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:"60%",height:24}})}),r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"rectangular",sx:{bgcolor:"#1E293B",width:80,height:24,borderRadius:1}})}),r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:40}})}),r.jsx(je,{align:"right",sx:Rt,children:r.jsx(jn,{variant:"rectangular",sx:{bgcolor:"#1E293B",width:140,height:32,borderRadius:1,ml:"auto"}})})]},Re)):t?a.length===0?r.jsx(Bt,{children:r.jsx(je,{colSpan:4,sx:{p:0},children:r.jsxs(E,{sx:{py:10,textAlign:"center"},children:[r.jsx(o8,{sx:{fontSize:60,color:"#1E293B",mb:2}}),r.jsx(C,{sx:{color:"#F8FAFC",fontWeight:600,mb:1},children:"No Paths Created"}),r.jsx(C,{sx:{color:"#64748B",maxWidth:300,mx:"auto"},children:R||z?"No paths match your current filters. Try adjusting them.":"Create your first learning journey for this organization."})]})})}):a.map(Te=>{const Re=g===Te.id;return r.jsxs(Bt,{sx:{"&:hover":{bgcolor:"rgba(255,255,255,0.02)"},transition:"background-color 0.2s ease",borderBottom:"1px solid #1E293B"},children:[r.jsxs(je,{sx:Rt,children:[r.jsx(C,{sx:{color:"#F1F5F9",fontWeight:600,fontSize:"0.9rem"},children:Cve(Te)}),Te.description&&r.jsx(C,{sx:{color:"#64748B",fontSize:"0.75rem",mt:.5,maxWidth:350},noWrap:!0,children:Te.description})]}),r.jsx(je,{sx:Rt,children:r.jsx(Pt,{size:"small",label:Te.status||"unknown",sx:{textTransform:"capitalize",bgcolor:Te.status==="published"?"rgba(16, 185, 129, 0.1)":Te.status==="archived"?"rgba(239, 68, 68, 0.1)":"rgba(245, 158, 11, 0.1)",color:Te.status==="published"?"#10B981":Te.status==="archived"?"#EF4444":"#F59E0B",fontWeight:700,fontSize:"0.7rem",borderRadius:"6px"}})}),r.jsxs(je,{sx:{...Rt,color:"#94A3B8",fontSize:"0.9rem"},children:[Te.items_count??0," courses"]}),r.jsx(je,{align:"right",sx:Rt,children:r.jsxs(G,{direction:"row",spacing:1,justifyContent:"flex-end",children:[r.jsx(tn,{title:"View Details",children:r.jsx(Ve,{size:"small",onClick:()=>X(Te.id,{openModal:!0}),disabled:Re,sx:{color:"#3B82F6","&:hover":{bgcolor:"rgba(59, 130, 246, 0.1)"}},children:r.jsx(Ote,{fontSize:"small"})})}),r.jsx(tn,{title:"Edit data",children:r.jsx(Ve,{size:"small",onClick:()=>le(Te),disabled:Re,sx:{color:"#F59E0B","&:hover":{bgcolor:"rgba(245, 158, 11, 0.1)"}},children:r.jsx(Kee,{fontSize:"small"})})}),Te.status!=="published"&&r.jsx(tn,{title:"Publish Path",children:r.jsx(Ve,{size:"small",onClick:()=>ve(Te,"publish"),disabled:Re,sx:{color:"#10B981","&:hover":{bgcolor:"rgba(16, 185, 129, 0.1)"}},children:r.jsx(Ete,{fontSize:"small"})})}),Te.status!=="archived"&&r.jsx(tn,{title:"Archive Path",children:r.jsx(Ve,{size:"small",onClick:()=>ve(Te,"archive"),disabled:Re,sx:{color:"#94A3B8","&:hover":{bgcolor:"rgba(148, 163, 184, 0.1)"}},children:r.jsx(zee,{fontSize:"small"})})}),r.jsx(tn,{title:"Delete Permanently",children:r.jsx(Ve,{size:"small",onClick:()=>ve(Te,"delete"),disabled:Re,sx:{color:"#EF4444","&:hover":{bgcolor:"rgba(239, 68, 68, 0.1)"}},children:r.jsx(FS,{fontSize:"small"})})})]})})]},Te.id)}):r.jsx(Bt,{children:r.jsx(je,{colSpan:4,sx:{p:0},children:r.jsxs(E,{sx:{py:10,textAlign:"center"},children:[r.jsx(Cl,{sx:{fontSize:60,color:"#1E293B",mb:2}}),r.jsx(C,{sx:{color:"#F8FAFC",fontWeight:600,mb:1},children:"No Organization Selected"}),r.jsx(C,{sx:{color:"#64748B",maxWidth:300,mx:"auto"},children:"Select an organization context to view and manage your curated learning paths."})]})})})})]})}),!b&&A.last_page>1&&r.jsx(G,{direction:"row",justifyContent:"center",sx:{mt:3},children:r.jsx(MQ,{page:A.current_page,count:A.last_page,onChange:(Te,Re)=>j(Re),color:"primary",shape:"rounded",sx:{"& .MuiPaginationItem-root":{color:"#CBD5E1",borderColor:"#334155"},"& .Mui-selected":{bgcolor:"rgba(59, 130, 246, 0.18)",color:"#BFDBFE"}}})}),r.jsx(tr,{open:N,onClose:()=>!f&&I(!1),children:r.jsxs(E,{sx:{...kr,width:{xs:"95%",md:640},bgcolor:"#0F172A",border:"1px solid #1E293B",borderRadius:3,boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.5)",p:0,overflow:"hidden"},children:[r.jsxs(E,{sx:{p:3,borderBottom:"1px solid #1E293B",bgcolor:"rgba(30, 41, 59, 0.5)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h6",sx:{color:"#F8FAFC",fontWeight:700},children:B?"Update Learning Path":"Create New Learning Journey"}),r.jsx(C,{variant:"body2",sx:{color:"#94A3B8",mt:.5},children:B?"Modify path metadata and status.":"Define the name and context for your new path."})]}),r.jsx(Ve,{onClick:()=>!f&&I(!1),sx:{color:"#94A3B8"},children:r.jsx(pg,{})})]}),r.jsxs(G,{spacing:3,sx:{p:3},children:[r.jsx(it,{label:"Journey Title",value:P.title,onChange:Te=>k(Re=>({...Re,title:Te.target.value})),sx:xt,fullWidth:!0,placeholder:"e.g. Senior Leadership Fundamentals",InputProps:{startAdornment:r.jsx(Ar,{position:"start",children:r.jsx(n0,{sx:{color:"#64748B",fontSize:20}})})}}),r.jsx(it,{label:"Executive Summary",value:P.description,onChange:Te=>k(Re=>({...Re,description:Te.target.value})),sx:xt,fullWidth:!0,multiline:!0,rows:3,placeholder:"Provide a brief overview of the learning objectives."}),r.jsxs(Ur,{fullWidth:!0,children:[r.jsx(rs,{sx:{color:"#94A3B8"},children:"Operational Status"}),r.jsx(Fn,{label:"Operational Status",value:P.status,onChange:Te=>k(Re=>({...Re,status:Te.target.value})),sx:Yn,MenuProps:Tr,children:FL.map(Te=>r.jsx(It,{value:Te,sx:{textTransform:"capitalize"},children:Te},Te))})]})]}),r.jsxs(E,{sx:{p:3,borderTop:"1px solid #1E293B",bgcolor:"rgba(30, 41, 59, 0.5)",display:"flex",justifyContent:"flex-end",gap:2},children:[r.jsx(ye,{onClick:()=>I(!1),disabled:f,sx:{color:"#94A3B8",textTransform:"none",fontWeight:600},children:"Cancel"}),r.jsx(ye,{variant:"contained",onClick:ee,disabled:f,sx:os,children:f?"Synchronizing...":B?"Update Journey":"Begin Journey Creation"})]})]})}),r.jsx(tr,{open:L,onClose:()=>O(!1),children:r.jsxs(E,{sx:{...kr,width:{xs:"95%",md:920},maxHeight:"92vh",display:"flex",flexDirection:"column",bgcolor:"#0F172A",border:"1px solid #1E293B",borderRadius:3,boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.5)",p:0,overflow:"hidden"},children:[r.jsxs(E,{sx:{p:3,borderBottom:"1px solid #1E293B",bgcolor:"rgba(30, 41, 59, 0.5)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:2},children:[r.jsx(n0,{sx:{color:"#6366F1"}}),r.jsxs(E,{children:[r.jsx(C,{variant:"h6",sx:{color:"#F8FAFC",fontWeight:700},children:q?.title||"Journey Content Management"}),r.jsx(C,{variant:"body2",sx:{color:"#94A3B8"},children:"Plan courses and manage order."})]})]}),r.jsx(Ve,{onClick:()=>O(!1),sx:{color:"#94A3B8"},children:r.jsx(pg,{})})]}),r.jsx(E,{sx:{p:3,overflowY:"auto",flex:1},children:W?r.jsxs(E,{sx:{py:10,textAlign:"center"},children:[r.jsx(nn,{size:32,sx:{color:"#3B82F6",mb:2}}),r.jsx(C,{sx:{color:"#64748B"},children:"Fetching journey architecture..."})]}):q?r.jsxs(G,{spacing:4,children:[r.jsxs(E,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"1fr 1fr"},gap:3},children:[r.jsxs(Je,{sx:{p:2.5,bgcolor:"rgba(30, 41, 59, 0.3)",border:"1px solid #1E293B",borderRadius:2},children:[r.jsx(C,{variant:"overline",sx:{color:"#64748B",fontWeight:800,letterSpacing:"0.1em"},children:"Add Course to order"}),r.jsxs(G,{direction:"row",spacing:2,sx:{mt:2},children:[r.jsxs(Ur,{fullWidth:!0,size:"small",children:[r.jsx(rs,{sx:{color:"#94A3B8"},children:"Search Course"}),r.jsx(Fn,{label:"Search Course",value:V,onChange:Te=>re(Te.target.value),sx:Yn,MenuProps:Tr,children:Y.length===0?r.jsx(It,{value:"",disabled:!0,children:"No compatible courses found"}):Y.map(Te=>r.jsx(It,{value:Te.id,children:HM(Te)},Te.id))})]}),r.jsx(ye,{variant:"contained",onClick:st,disabled:f,sx:{...os,minWidth:80,height:40,py:0},children:f?"Adding...":"Inject"})]})]}),r.jsxs(Je,{sx:{p:2.5,bgcolor:"rgba(30, 41, 59, 0.3)",border:"1px solid #1E293B",borderRadius:2,display:"flex",flexDirection:"column",justifyContent:"center"},children:[r.jsx(C,{variant:"overline",sx:{color:"#64748B",fontWeight:800,letterSpacing:"0.1em"},children:"Learning path Metrics"}),r.jsxs(G,{direction:"row",spacing:4,sx:{mt:1.5},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h4",sx:{color:"#F1F5F9",fontWeight:800},children:Be.length}),r.jsx(C,{variant:"caption",sx:{color:"#94A3B8"},children:"Total Items"})]}),r.jsxs(E,{children:[r.jsx(C,{variant:"h4",sx:{color:"#3B82F6",fontWeight:800},children:q.status==="published"?"Active":"Offline"}),r.jsx(C,{variant:"caption",sx:{color:"#94A3B8"},children:"Current Logic"})]})]})]})]}),r.jsxs(E,{children:[r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:2},children:[r.jsxs(C,{variant:"subtitle1",sx:{color:"#F1F5F9",fontWeight:700,display:"flex",alignItems:"center",gap:1},children:[r.jsx(o8,{sx:{fontSize:20,color:"#3B82F6"}}),"Order Architecture"]}),r.jsx(ye,{startIcon:r.jsx(n0,{}),onClick:qe,disabled:f||fe.length===0,sx:{color:"#3B82F6",textTransform:"none",fontWeight:700,"&:hover":{bgcolor:"rgba(59, 130, 246, 0.05)"}},children:"Apply Structural Change"})]}),Be.length===0?r.jsx(E,{sx:{py:6,textAlign:"center",bgcolor:"rgba(30, 41, 59, 0.2)",border:"1px dashed #334155",borderRadius:3},children:r.jsx(C,{sx:{color:"#64748B"},children:"No courses have been added to this path order."})}):r.jsx(G,{spacing:1.5,children:Be.map((Te,Re)=>{const Se=fe.find(ot=>ot.id===Te.id),Ke=Re===Be.length-1;return r.jsxs(E,{children:[r.jsxs(Je,{sx:{p:2,bgcolor:"#0F172A",border:"1px solid #1E293B",borderRadius:2,display:"flex",alignItems:"center",gap:2,transition:"transform 0.2s ease, border-color 0.2s ease","&:hover":{transform:"translateX(4px)",borderColor:"#334155"}},children:[r.jsx(E,{sx:{width:32,height:32,borderRadius:"50%",bgcolor:"rgba(59, 130, 246, 0.1)",color:"#3B82F6",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:800,fontSize:"0.8rem"},children:Te.position||Re+1}),r.jsxs(E,{sx:{flex:1},children:[r.jsx(C,{sx:{color:"#F1F5F9",fontWeight:600},children:HM(Te.course)}),r.jsxs(C,{sx:{color:"#64748B",fontSize:"0.75rem"},children:["Course ID: ",Te.course_id||"Internal"]})]}),r.jsxs(G,{direction:"row",spacing:2,alignItems:"center",children:[r.jsx(it,{size:"small",label:"Pos",type:"number",value:Se?.position??Te.position??"",onChange:ot=>{const He=ot.target.value;ae($e=>$e.map(Z=>Z.id===Te.id?{...Z,position:He}:Z))},sx:{...xt,width:80,"& .MuiInputBase-input":{py:.8,fontSize:"0.85rem"}}}),r.jsx(Ve,{size:"small",onClick:()=>Ge(Te.id),disabled:g===Te.id,sx:{color:"#EF4444",bgcolor:"rgba(239, 68, 68, 0.05)","&:hover":{bgcolor:"rgba(239, 68, 68, 0.1)"}},children:r.jsx(FS,{fontSize:"small"})})]})]}),!Ke&&r.jsx(E,{sx:{ml:3.8,width:2,height:12,bgcolor:"#1E293B"}})]},Te.id)})})]})]}):r.jsxs(E,{sx:{py:6,textAlign:"center"},children:[r.jsx(Lc,{sx:{fontSize:48,color:"#1E293B",mb:2}}),r.jsx(C,{sx:{color:"#64748B"},children:"Resource context lost. Please try reopening."})]})}),r.jsx(E,{sx:{p:3,borderTop:"1px solid #1E293B",bgcolor:"rgba(30, 41, 59, 0.5)",display:"flex",justifyContent:"flex-end"},children:r.jsx(ye,{variant:"outlined",onClick:()=>O(!1),disabled:f,sx:{color:"#94A3B8",borderColor:"#334155",textTransform:"none",fontWeight:600,px:4,"&:hover":{borderColor:"#475569",bgcolor:"rgba(255,255,255,0.05)"}},children:"Return To List"})})]})}),r.jsx(gs,{open:ue.open,autoHideDuration:4e3,onClose:ce,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:r.jsx(Wt,{severity:ue.severity,onClose:ce,variant:"filled",sx:{borderRadius:2,fontWeight:600},children:ue.message})})]})},WM=e=>{if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},_L=(e={})=>String(e?.title||e?.name||"").trim()||"Untitled course",LL=(e={})=>String(e?.name||e?.email||"").trim()||"Unknown user",Eve=({courseFilter:e,setCourseFilter:t,userFilter:n,setUserFilter:s,courses:o,users:a})=>{const[l,u]=v.useState(null),d=!!l;return r.jsxs(r.Fragment,{children:[r.jsx(tn,{title:"Filter Reports",children:r.jsxs(ye,{startIcon:r.jsx(Tb,{}),onClick:f=>u(f.currentTarget),sx:{bgcolor:"rgba(30, 41, 59, 0.5)",border:"1px solid #1E293B",color:"#E2E8F0",textTransform:"none",px:2,"&:hover":{bgcolor:"rgba(30, 41, 59, 0.8)",borderColor:"#334155"}},children:["Filters",(e||n)&&r.jsx(E,{sx:{ml:1,width:8,height:8,borderRadius:"50%",bgcolor:"#3B82F6",border:"2px solid #0F172A"}})]})}),r.jsxs(Xg,{open:d,anchorEl:l,onClose:()=>u(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{sx:{bgcolor:"#0F172A",border:"1px solid #1E293B",borderRadius:2,p:2,minWidth:320,boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.5)"}},children:[r.jsx(C,{variant:"subtitle2",sx:{color:"#F8FAFC",fontWeight:700,mb:2},children:"Report Scope Filters"}),r.jsxs(G,{spacing:2.5,children:[r.jsxs(Ur,{fullWidth:!0,size:"small",children:[r.jsx(rs,{sx:{color:"#94A3B8"},children:"Filter by Course"}),r.jsxs(Fn,{label:"Filter by Course",value:e,onChange:f=>t(f.target.value),sx:Yn,MenuProps:Tr,children:[r.jsx(It,{value:"",children:"All Active Courses"}),o.map(f=>r.jsx(It,{value:f.id,children:_L(f)},f.id))]})]}),r.jsxs(Ur,{fullWidth:!0,size:"small",children:[r.jsx(rs,{sx:{color:"#94A3B8"},children:"Filter by Learner"}),r.jsxs(Fn,{label:"Filter by Learner",value:n,onChange:f=>s(f.target.value),sx:Yn,MenuProps:Tr,children:[r.jsx(It,{value:"",children:"All Organization Members"}),a.map(f=>r.jsx(It,{value:f.id,children:LL(f)},f.id))]})]}),r.jsx(Ir,{sx:{borderColor:"#1E293B"}}),r.jsx(ye,{size:"small",fullWidth:!0,onClick:()=>{t(""),s(""),u(null)},sx:{color:"#EF4444",textTransform:"none",fontWeight:600},children:"Clear All Parameters"})]})]})]})},Tve=()=>{const{organizations:e,selectedOrgId:t,selectedOrganization:n,setSelectedOrgId:s}=Rm(),[o,a]=v.useState([]),[l,u]=v.useState(!1),[d,f]=v.useState(!1),[p,g]=v.useState([]),[x,b]=v.useState([]),[y,S]=v.useState(""),[j,A]=v.useState(""),[M,R]=v.useState({open:!1,message:"",severity:"success"}),_=(I,B="success")=>{R({open:!0,message:I,severity:B})},z=()=>{R(I=>({...I,open:!1}))},F=v.useCallback(async()=>{if(t)try{const[I,B]=await Promise.all([Un.listCourses({per_page:100,org_id:t||void 0}),Un.listUsers({per_page:100,org_id:t||void 0})]);g(I.data||[]),b(B.data||[])}catch(I){console.error("Failed to load report options:",I),g([]),b([])}},[t]),N=v.useCallback(async(I=!1)=>{if(!t){a([]);return}I?f(!0):u(!0);try{const B=await Un.getProgressReport(t,{course_id:y,user_id:j,per_page:50});a(B.data||[])}catch(B){console.error("Failed to load progress report:",B),a([]),_(B.message||"Failed to load progress report.","error")}finally{u(!1),f(!1)}},[t,y,j]);return v.useEffect(()=>{F()},[F]),v.useEffect(()=>{N()},[N]),r.jsxs(E,{sx:{p:{xs:2.5,md:5},bgcolor:"#0F1729",minHeight:"calc(100vh - 70px)",width:"100%"},children:[r.jsxs(G,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"stretch",md:"center"},spacing:3,sx:{mb:5},children:[r.jsxs(E,{children:[r.jsxs(C,{variant:"h4",sx:{color:"#F8FAFC",fontWeight:800,letterSpacing:"-0.02em",display:"flex",alignItems:"center",gap:1.5},children:[r.jsx(ate,{sx:{fontSize:32,color:"#10B981"}}),"Progress Intelligence"]}),r.jsx(C,{variant:"body2",sx:{color:"#64748B",mt:1,maxWidth:600},children:"Deep dive into organizational learning efficacy. Track enrollment status, course completion rates, and individual performance benchmarks."})]}),r.jsx(tn,{title:"Synchronize Intelligence",children:r.jsxs(Ve,{onClick:()=>N(!0),disabled:d||l,sx:{color:"#94A3B8",bgcolor:"rgba(30, 41, 59, 0.4)",border:"1px solid #1E293B",borderRadius:"10px",height:44,width:44,"&:hover":{bgcolor:"rgba(30, 41, 59, 0.8)"}},children:[r.jsx(nm,{sx:{animation:d?"spin 1s linear infinite":"none"}}),r.jsx("style",{children:` @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } `})]})})]}),r.jsx(Mm,{organizations:e,selectedOrgId:t,selectedOrganization:n,onChangeOrgId:s}),r.jsxs(G,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:2,mt:4},children:[r.jsxs(C,{sx:{color:"#64748B",fontSize:"0.85rem"},children:["Showing ",o.length," performance records"]}),r.jsx(Eve,{courseFilter:y,setCourseFilter:S,userFilter:j,setUserFilter:A,courses:p,users:x})]}),r.jsx(ko,{component:Je,elevation:0,sx:{bgcolor:"rgba(15, 23, 42, 0.4)",backdropFilter:"blur(10px)",borderRadius:3,border:"1px solid #1E293B",overflow:"hidden"},children:r.jsxs(Eo,{children:[r.jsx(Mo,{children:r.jsxs(Bt,{sx:{bgcolor:"rgba(30, 41, 59, 0.5)"},children:[r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Learner Identity"}),r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Course Domain"}),r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Operational Status"}),r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Mastery %"}),r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Timeline"})]})}),r.jsx(To,{children:l?Array.from({length:5}).map((I,B)=>r.jsxs(Bt,{sx:{borderBottom:"1px solid #1E293B"},children:[r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:"60%",height:24}})}),r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:"80%"}})}),r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"rectangular",sx:{bgcolor:"#1E293B",width:90,height:24,borderRadius:1}})}),r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:40}})}),r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:"40%"}})})]},B)):t?o.length===0?r.jsx(Bt,{children:r.jsx(je,{colSpan:5,sx:{p:0},children:r.jsxs(E,{sx:{py:12,textAlign:"center"},children:[r.jsx(Fee,{sx:{fontSize:60,color:"#1E293B",mb:2}}),r.jsx(C,{sx:{color:"#F8FAFC",fontWeight:600,mb:1},children:"No Intelligence Records"}),r.jsx(C,{sx:{color:"#64748B",maxWidth:350,mx:"auto"},children:y||j?"No records found matching your specified intelligence parameters.":"No active enrollments detected for this organization context."})]})})}):o.map(I=>{const B=I.progress_percent||0,H=I.status==="completed"||B===100;return r.jsxs(Bt,{sx:{"&:hover":{bgcolor:"rgba(255,255,255,0.02)"},transition:"background-color 0.2s ease",borderBottom:"1px solid #1E293B"},children:[r.jsx(je,{sx:Rt,children:r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[r.jsx(E,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:H?"#10B981":"#3B82F6"}}),r.jsx(C,{sx:{color:"#F8FAFC",fontWeight:600,fontSize:"0.9rem"},children:LL(I.user)})]})}),r.jsx(je,{sx:Rt,children:r.jsx(C,{sx:{color:"#CBD5E1",fontSize:"0.85rem"},children:_L(p.find(P=>P.id===I.course_id)||I.course)})}),r.jsx(je,{sx:Rt,children:r.jsx(Pt,{size:"small",label:I.status||"Active",sx:{textTransform:"capitalize",bgcolor:H?"rgba(16, 185, 129, 0.1)":"rgba(59, 130, 246, 0.1)",color:H?"#10B981":"#3B82F6",fontWeight:700,fontSize:"0.7rem",borderRadius:"6px"}})}),r.jsx(je,{sx:Rt,children:r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:1},children:[r.jsxs(C,{sx:{color:H?"#10B981":"#F1F5F9",fontWeight:800,fontSize:"1rem"},children:[B,"%"]}),H&&r.jsx(CheckCircleRounded,{sx:{fontSize:14,color:"#10B981"}})]})}),r.jsx(je,{sx:Rt,children:r.jsxs(G,{spacing:.5,children:[r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:1},children:[r.jsx($ee,{sx:{fontSize:12,color:"#475569"}}),r.jsxs(C,{sx:{color:"#94A3B8",fontSize:"0.75rem"},children:["In: ",WM(I.enrolled_at)]})]}),I.completed_at&&r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:1},children:[r.jsx(CheckCircleRounded,{sx:{fontSize:12,color:"#10B981"}}),r.jsxs(C,{sx:{color:"#10B981",fontSize:"0.75rem",fontWeight:600},children:["Out: ",WM(I.completed_at)]})]})]})})]},I.id)}):r.jsx(Bt,{children:r.jsx(je,{colSpan:5,sx:{p:0},children:r.jsxs(E,{sx:{py:12,textAlign:"center"},children:[r.jsx(Cl,{sx:{fontSize:60,color:"#1E293B",mb:2}}),r.jsx(C,{sx:{color:"#F8FAFC",fontWeight:600,mb:1},children:"Context Required"}),r.jsx(C,{sx:{color:"#64748B",maxWidth:300,mx:"auto"},children:"Select an organization to activate the real-time progress intelligence dashboard."})]})})})})]})}),r.jsx(gs,{open:M.open,autoHideDuration:4e3,onClose:z,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:r.jsx(Wt,{severity:M.severity,onClose:z,variant:"filled",sx:{borderRadius:2,fontWeight:600},children:M.message})})]})},UM={name:"",email_domain:"",logo:null},kve=(e={})=>{const t=String(e?.membership_role||"").trim().toLowerCase();return e?.is_owner||t==="owner"?"Owner":t==="admin"?"Admin":t==="manager"?"Manager":t==="staff"?"Invited Member":e?.can_manage?"Manager Access":"Invited Member"},Mve=()=>{const{organizations:e,selectedOrgId:t,selectedOrganization:n,setSelectedOrgId:s,refreshOrganizations:o,rememberOrganization:a,forgetOrganization:l}=Rm(),[u,d]=v.useState(!1),[f,p]=v.useState(UM),[g,x]=v.useState(!1),[b,y]=v.useState(!1),[S,j]=v.useState({open:!1,message:"",severity:"success"}),A=(N,I="success")=>{j({open:!0,message:N,severity:I})},M=()=>{j(N=>({...N,open:!1}))},R=async()=>{y(!0);try{await o()}finally{setTimeout(()=>y(!1),800)}},_=async()=>{if(!String(f.name||"").trim()||!String(f.email_domain||"").trim()){A("Organization name and email domain are required.","error");return}x(!0);try{const N={name:f.name.trim(),email_domain:f.email_domain.trim(),logo:f.logo};let I;f.logo instanceof File?I=await Un.createOrganizationMultipart(N):I=await Un.createOrganizationJson(N),a(I),p(UM),d(!1),A("Organization created and selected successfully.")}catch(N){console.error("Failed to create organization:",N),A(N.message||"Failed to create organization.","error")}finally{x(!1)}},z=v.useMemo(()=>[...e].sort((N,I)=>{const B=+!!(N?.is_owner||N?.can_manage),H=+!!(I?.is_owner||I?.can_manage);return B!==H?H-B:String(N?.name||"").localeCompare(String(I?.name||""))}),[e]),F=v.useMemo(()=>z.filter(N=>!N?.is_owner&&!N?.can_manage),[z]);return r.jsxs(E,{sx:{p:{xs:2.5,md:5},bgcolor:"#0F1729",minHeight:"calc(100vh - 70px)",width:"100%"},children:[r.jsxs(G,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"stretch",md:"center"},spacing:3,sx:{mb:5},children:[r.jsxs(E,{children:[r.jsxs(C,{variant:"h4",sx:{color:"#F8FAFC",fontWeight:800,letterSpacing:"-0.02em",display:"flex",alignItems:"center",gap:1.5},children:[r.jsx(Cl,{sx:{fontSize:32,color:"#3B82F6"}}),"Organization Hub"]}),r.jsx(C,{variant:"body2",sx:{color:"#64748B",mt:1,maxWidth:600},children:"Manage your enterprise ecosystems. Switch between organizations, monitor access roles, and provision new organization from a centralized dashboard."})]}),r.jsxs(G,{direction:"row",spacing:2,children:[r.jsx(ye,{variant:"contained",startIcon:r.jsx(wb,{}),onClick:()=>d(!0),sx:{...os,borderRadius:"10px",textTransform:"none",fontWeight:600,px:3,height:44},children:"Add Organization"}),r.jsx(tn,{title:"Synchronize Records",children:r.jsxs(Ve,{onClick:R,sx:{color:"#94A3B8",bgcolor:"rgba(30, 41, 59, 0.4)",border:"1px solid #1E293B",borderRadius:"10px","&:hover":{bgcolor:"rgba(30, 41, 59, 0.8)"}},children:[r.jsx(nm,{sx:{animation:b?"spin 1s linear infinite":"none"}}),r.jsx("style",{children:` @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } `})]})})]})]}),r.jsx(Mm,{title:"Context Selector",subtitle:"Override the active organization context to manage a different organization.",organizations:e,selectedOrgId:t,selectedOrganization:n,onChangeOrgId:s}),F.length>0&&r.jsx(Du,{in:!0,children:r.jsxs(E,{sx:{p:2,mb:4,borderRadius:2,bgcolor:"rgba(59, 130, 246, 0.05)",border:"1px solid rgba(59, 130, 246, 0.1)",display:"flex",alignItems:"center",gap:2},children:[r.jsx(Pte,{sx:{color:"#3B82F6"}}),r.jsxs(C,{variant:"body2",sx:{color:"#94A3B8"},children:["You are currently part of ",r.jsxs("strong",{children:[F.length," invited organizations"]}),". Use the selector above to switch between them."]})]})}),r.jsx(C,{variant:"subtitle2",sx:{color:"#94A3B8",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.1em",mb:2},children:"Organizational Repository"}),r.jsx(ko,{component:Je,elevation:0,sx:{bgcolor:"rgba(15, 23, 42, 0.4)",backdropFilter:"blur(10px)",borderRadius:3,border:"1px solid #1E293B",overflow:"hidden"},children:r.jsxs(Eo,{children:[r.jsx(Mo,{children:r.jsxs(Bt,{sx:{bgcolor:"rgba(30, 41, 59, 0.5)"},children:[r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Organization Name"}),r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Access Tier"}),r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Domain"}),r.jsx(je,{sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Status"}),r.jsx(je,{align:"right",sx:{...fn,py:2.5,color:"#94A3B8",fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Action"})]})}),r.jsx(To,{children:b?Array.from({length:3}).map((N,I)=>r.jsxs(Bt,{sx:{borderBottom:"1px solid #1E293B"},children:[r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:"70%",height:24}})}),r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"rectangular",sx:{bgcolor:"#1E293B",width:100,height:24,borderRadius:1}})}),r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"text",sx:{bgcolor:"#1E293B",width:"50%"}})}),r.jsx(je,{sx:Rt,children:r.jsx(jn,{variant:"rectangular",sx:{bgcolor:"#1E293B",width:80,height:24,borderRadius:1}})}),r.jsx(je,{align:"right",sx:Rt,children:r.jsx(jn,{variant:"rectangular",sx:{bgcolor:"#1E293B",width:120,height:32,borderRadius:1,ml:"auto"}})})]},I)):z.length===0?r.jsx(Bt,{children:r.jsx(je,{colSpan:5,sx:{p:0},children:r.jsxs(E,{sx:{py:12,textAlign:"center"},children:[r.jsx(cte,{sx:{fontSize:60,color:"#1E293B",mb:2}}),r.jsx(C,{sx:{color:"#F8FAFC",fontWeight:600,mb:1},children:"Empty Repository"}),r.jsx(C,{sx:{color:"#64748B",maxWidth:300,mx:"auto"},children:`You haven't provisioned or joined any organizations yet. Click "Add Organization" to begin.`})]})})}):z.map(N=>{const I=N.id===t,B=kve(N),H=N?.is_owner||N?.can_manage||B==="Admin"||B==="Owner"||B==="Manager";return r.jsxs(Bt,{sx:{"&:hover":{bgcolor:"rgba(255,255,255,0.02)"},transition:"background-color 0.2s ease",borderBottom:"1px solid #1E293B",bgcolor:I?"rgba(59, 130, 246, 0.03)":"transparent"},children:[r.jsx(je,{sx:Rt,children:r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:2},children:[r.jsx(E,{sx:{width:40,height:40,borderRadius:"10px",bgcolor:"rgba(30, 41, 59, 0.5)",border:"1px solid #1E293B",display:"flex",alignItems:"center",justifyContent:"center",color:I?"#3B82F6":"#94A3B8"},children:r.jsx(Cl,{fontSize:"small"})}),r.jsx(C,{sx:{color:"#F1F5F9",fontWeight:600,fontSize:"0.95rem"},children:N.name})]})}),r.jsx(je,{sx:Rt,children:r.jsx(Pt,{size:"small",label:B,sx:{bgcolor:H?"rgba(16, 185, 129, 0.1)":"rgba(59, 130, 246, 0.1)",color:H?"#10B981":"#3B82F6",fontWeight:700,fontSize:"0.7rem",borderRadius:"6px"}})}),r.jsx(je,{sx:{...Rt,color:"#94A3B8",fontSize:"0.9rem"},children:r.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:1},children:[r.jsx(lte,{sx:{fontSize:16,color:"#334155"}}),N.email_domain||"Internal Only"]})}),r.jsx(je,{sx:Rt,children:r.jsx(Pt,{size:"small",label:I?"Active Context":"Available",icon:I?r.jsx(nz,{style:{color:"inherit",fontSize:14}}):void 0,sx:{bgcolor:I?"rgba(59, 130, 246, 0.1)":"rgba(30, 41, 59, 0.5)",color:I?"#3B82F6":"#64748B",fontWeight:700,fontSize:"0.7rem",borderRadius:"6px","& .MuiChip-icon":{ml:.5}}})}),r.jsx(je,{align:"right",sx:Rt,children:r.jsxs(G,{direction:"row",spacing:1,justifyContent:"flex-end",children:[r.jsx(ye,{size:"small",variant:I?"soft":"outlined",onClick:()=>s(N.id),sx:{textTransform:"none",fontWeight:700,fontSize:"0.8rem",borderRadius:"8px",px:2,...I?{bgcolor:"rgba(59, 130, 246, 0.1)",color:"#3B82F6",pointerEvents:"none"}:{borderColor:"#1E293B",color:"#E2E8F0","&:hover":{bgcolor:"rgba(255,255,255,0.02)",borderColor:"#334155"}}},children:I?"Current Organization":"Switch Organization"}),N?.can_delete&&r.jsx(tn,{title:"Forget Connection",children:r.jsx(Ve,{onClick:()=>l(N.id),sx:{color:"#EF4444",bgcolor:"rgba(239, 68, 68, 0.05)","&:hover":{bgcolor:"rgba(239, 68, 68, 0.1)"},borderRadius:"8px"},size:"small",children:r.jsx(FS,{fontSize:"small"})})})]})})]},N.id)})})]})}),r.jsx(tr,{open:u,onClose:()=>!g&&d(!1),children:r.jsxs(E,{sx:{...kr,width:{xs:"95%",md:620},bgcolor:"#0F172A",border:"1px solid #1E293B",borderRadius:3,boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.5)",p:0,overflow:"hidden"},children:[r.jsxs(E,{sx:{p:3,borderBottom:"1px solid #1E293B",bgcolor:"rgba(30, 41, 59, 0.5)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r.jsxs(E,{children:[r.jsx(C,{variant:"h6",sx:{color:"#F8FAFC",fontWeight:700},children:"Add New Organization"}),r.jsx(C,{variant:"body2",sx:{color:"#94A3B8",mt:.5},children:"Deploy a fresh organization instance for your work team."})]}),r.jsx(Ve,{onClick:()=>!g&&d(!1),sx:{color:"#94A3B8"},children:r.jsx(pg,{})})]}),r.jsxs(G,{spacing:3,sx:{p:3},children:[r.jsx(it,{label:"Organization Title",value:f.name,onChange:N=>p(I=>({...I,name:N.target.value})),fullWidth:!0,sx:xt,placeholder:"e.g. Acme Global Industries",InputProps:{startAdornment:r.jsx(Ar,{position:"start",children:r.jsx(Cl,{sx:{color:"#64748B",fontSize:20}})})}}),r.jsx(it,{label:"Organization Email Domain",value:f.email_domain,onChange:N=>p(I=>({...I,email_domain:N.target.value})),fullWidth:!0,placeholder:"acme-global.com",sx:xt,InputProps:{startAdornment:r.jsx(Ar,{position:"start",children:r.jsx(l8,{sx:{color:"#64748B",fontSize:20}})})}}),r.jsxs(E,{children:[r.jsx(C,{variant:"caption",sx:{color:"#64748B",fontWeight:700,mb:1,display:"block"},children:"Identity Branding (Optional)"}),r.jsxs(ye,{component:"label",variant:"outlined",startIcon:r.jsx(l8,{}),fullWidth:!0,sx:{height:48,borderColor:"#1E293B",color:"#94A3B8",textTransform:"none",justifyContent:"flex-start",bgcolor:"rgba(15, 23, 42, 0.4)",px:2,"&:hover":{borderColor:"#334155",bgcolor:"rgba(30, 41, 59, 0.5)"}},children:[r.jsx(C,{noWrap:!0,sx:{fontSize:"0.85rem"},children:f.logo?f.logo.name:"Upload Core Branding (.svg, .png)"}),r.jsx("input",{hidden:!0,type:"file",accept:"image/*",onChange:N=>{const I=N.target.files?.[0]||null;p(B=>({...B,logo:I}))}})]})]}),r.jsxs(Wt,{severity:"info",icon:r.jsx(Lc,{sx:{color:"#3B82F6"}}),sx:{bgcolor:"rgba(59, 130, 246, 0.05)",color:"#94A3B8",border:"1px solid rgba(59, 130, 246, 0.1)",borderRadius:2},children:["You will be assigned the ",r.jsx("strong",{children:"Owner"})," role for this organization automatically after deployment."]})]}),r.jsxs(E,{sx:{p:3,borderTop:"1px solid #1E293B",bgcolor:"rgba(30, 41, 59, 0.5)",display:"flex",justifyContent:"flex-end",gap:2},children:[r.jsx(ye,{onClick:()=>d(!1),disabled:g,sx:{color:"#94A3B8",textTransform:"none",fontWeight:600},children:"Cancel"}),r.jsx(ye,{variant:"contained",onClick:_,disabled:g,sx:os,children:g?r.jsx(nn,{size:18,color:"inherit"}):"Deploy Organization"})]})]})}),r.jsx(gs,{open:S.open,autoHideDuration:4e3,onClose:M,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:r.jsx(Wt,{severity:S.severity,onClose:M,variant:"filled",sx:{borderRadius:2,fontWeight:600},children:S.message})})]})},Rve=[{path:"/explore",element:r.jsx(Zye,{})},{element:r.jsx(EM,{}),children:[{path:"/explore/my-learning",element:r.jsx(Wye,{})},{path:"/explore/courses",element:r.jsx(Dye,{})},{path:"/explore/enrollments",element:r.jsx($ye,{})},{path:"/explore/progress",element:r.jsx(Gye,{})}]},{path:"/explore/course/:courseId",element:r.jsx(eve,{})},{path:"/explore/lesson/:courseId",element:r.jsx(RM,{})},{path:"/explore/lesson/:courseId/:lessonId",element:r.jsx(RM,{})},{path:"/explore/lesson-v2/:courseId/:lessonId",element:r.jsx(qye,{})},{path:"/checkout",element:r.jsx(Vye,{})},{path:"/payment-success",element:r.jsx(IM,{})},{path:"/payment/success",element:r.jsx(IM,{})},{path:"/learner",element:r.jsx(EM,{}),children:[{index:!0,element:r.jsx(Pye,{})},{path:"organization",element:r.jsx(wi,{to:"overview",replace:!0})},{path:"organization/overview",element:r.jsx(Mve,{})},{path:"organization/invite",element:r.jsx(jve,{})},{path:"organization/my-assignments",element:r.jsx(DM,{})},{path:"organization/invitations",element:r.jsx(wi,{to:"../invite",replace:!0})},{path:"organization/learning-paths",element:r.jsx(Ave,{})},{path:"organization/assignments",element:r.jsx(DM,{})},{path:"organization/reports",element:r.jsx(Tve,{})}]}],PL=({children:e})=>{const{user:t,loading:n,needsEmailVerification:s,needsKyc:o,isKycComplete:a}=ps(),l=Nr();if(n)return r.jsx(E,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh",bgcolor:"#0C1322"},children:r.jsx(nn,{sx:{color:"#1152D4"}})});if(!t)return r.jsx(wi,{to:"/login",state:{from:l},replace:!0});if(!((l.pathname.startsWith("/org")||l.pathname.startsWith("/learner/organization"))&&vN(t))&&s()&&l.pathname!=="/verify")return r.jsx(wi,{to:"/verify",replace:!0});const f=l.pathname.startsWith("/tutor"),p=l.pathname==="/tutor/kyc";return f&&p&&a()?r.jsx(wi,{to:"/tutor",replace:!0}):f&&!p&&o()?r.jsx(wi,{to:"/tutor/kyc",replace:!0}):e},z0=({children:e})=>{const{isAuthenticated:t,loading:n}=ps(),s=Nr();return n?r.jsx(E,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh",bgcolor:"#0C1322"},children:r.jsx(nn,{sx:{color:"#1152D4"}})}):t?r.jsx(PL,{children:e}):r.jsx(wi,{to:"/login",state:{from:s},replace:!0})},tS=({children:e})=>{const{isAuthenticated:t,loading:n,user:s}=ps();return n?r.jsx(E,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh",bgcolor:"#0C1322"},children:r.jsx(nn,{sx:{color:"#1152D4"}})}):t&&s?r.jsx(wi,{to:V1(s),replace:!0}):e},zve=["/explore","/explore/courses","/explore/course/:courseId","/payment-success","/payment/success"],Ive=eN([{path:"/",element:r.jsx(one,{})},{path:"/about-us",element:r.jsx(cne,{})},{path:"/partners",element:r.jsx(pne,{})},{path:"/contact",element:r.jsx(wne,{})},{path:"/login",element:r.jsx(tS,{children:r.jsx(gne,{})})},{path:"/signup",element:r.jsx(tS,{children:r.jsx(mne,{})})},{path:"/verify",element:r.jsx(S8,{})},{path:"/verify/:id/:hash",element:r.jsx(S8,{})},{path:"/forgot-password",element:r.jsx(tS,{children:r.jsx(xne,{})})},{path:"/org-invitations/accept",element:r.jsx(a5,{})},{path:"/accept-invite",element:r.jsx(a5,{})},{path:"/org-invitations/public/accept",element:r.jsx(a5,{})},{...SM,element:r.jsx(z0,{children:SM.element})},{...CM,element:r.jsx(z0,{children:r.jsx(PL,{children:CM.element})})},{path:"/org/*",element:r.jsx(z0,{children:r.jsx(wi,{to:"/learner/organization/overview",replace:!0})})},...Rve.map(e=>{const t=zve.includes(e.path);return!e.path||!t?{...e,element:r.jsx(z0,{children:e.element})}:e}),{path:"*",element:r.jsx(IU,{})}]);function Fve(){return r.jsx(zU,{children:r.jsx(AN,{children:r.jsx(fN,{router:Ive})})})}$D.createRoot(document.getElementById("root")).render(r.jsx(v.StrictMode,{children:r.jsx(Fve,{})}))});export default _ve();
Simpan