@hivemagnus/hive-router 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
- (function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&u(m)}).observe(document,{childList:!0,subtree:!0});function r(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(d){if(d.ep)return;d.ep=!0;const f=r(d);fetch(d.href,f)}})();function Wp(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ro={exports:{}},Wi={};var Fm;function db(){if(Fm)return Wi;Fm=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function r(u,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var p in d)p!=="key"&&(f[p]=d[p])}else f=d;return d=f.ref,{$$typeof:n,type:u,key:m,ref:d!==void 0?d:null,props:f}}return Wi.Fragment=l,Wi.jsx=r,Wi.jsxs=r,Wi}var Wm;function fb(){return Wm||(Wm=1,ro.exports=db()),ro.exports}var i=fb(),co={exports:{}},Ne={};var ep;function hb(){if(ep)return Ne;ep=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),C=Symbol.iterator;function z(S){return S===null||typeof S!="object"?null:(S=C&&S[C]||S["@@iterator"],typeof S=="function"?S:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},K=Object.assign,J={};function I(S,U,te){this.props=S,this.context=U,this.refs=J,this.updater=te||M}I.prototype.isReactComponent={},I.prototype.setState=function(S,U){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,U,"setState")},I.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function ie(){}ie.prototype=I.prototype;function X(S,U,te){this.props=S,this.context=U,this.refs=J,this.updater=te||M}var se=X.prototype=new ie;se.constructor=X,K(se,I.prototype),se.isPureReactComponent=!0;var x=Array.isArray;function B(){}var V={H:null,A:null,T:null,S:null},Q=Object.prototype.hasOwnProperty;function ce(S,U,te){var re=te.ref;return{$$typeof:n,type:S,key:U,ref:re!==void 0?re:null,props:te}}function ue(S,U){return ce(S.type,U,S.props)}function $(S){return typeof S=="object"&&S!==null&&S.$$typeof===n}function pe(S){var U={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(te){return U[te]})}var qe=/\/+/g;function tt(S,U){return typeof S=="object"&&S!==null&&S.key!=null?pe(""+S.key):U.toString(36)}function Ie(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(B,B):(S.status="pending",S.then(function(U){S.status==="pending"&&(S.status="fulfilled",S.value=U)},function(U){S.status==="pending"&&(S.status="rejected",S.reason=U)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function Z(S,U,te,re,me){var xe=typeof S;(xe==="undefined"||xe==="boolean")&&(S=null);var ve=!1;if(S===null)ve=!0;else switch(xe){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(S.$$typeof){case n:case l:ve=!0;break;case b:return ve=S._init,Z(ve(S._payload),U,te,re,me)}}if(ve)return me=me(S),ve=re===""?"."+tt(S,0):re,x(me)?(te="",ve!=null&&(te=ve.replace(qe,"$&/")+"/"),Z(me,U,te,"",function($t){return $t})):me!=null&&($(me)&&(me=ue(me,te+(me.key==null||S&&S.key===me.key?"":(""+me.key).replace(qe,"$&/")+"/")+ve)),U.push(me)),1;ve=0;var He=re===""?".":re+":";if(x(S))for(var Ze=0;Ze<S.length;Ze++)re=S[Ze],xe=He+tt(re,Ze),ve+=Z(re,U,te,xe,me);else if(Ze=z(S),typeof Ze=="function")for(S=Ze.call(S),Ze=0;!(re=S.next()).done;)re=re.value,xe=He+tt(re,Ze++),ve+=Z(re,U,te,xe,me);else if(xe==="object"){if(typeof S.then=="function")return Z(Ie(S),U,te,re,me);throw U=String(S),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ve}function F(S,U,te){if(S==null)return S;var re=[],me=0;return Z(S,re,"","",function(xe){return U.call(te,xe,me++)}),re}function fe(S){if(S._status===-1){var U=S._result;U=U(),U.then(function(te){(S._status===0||S._status===-1)&&(S._status=1,S._result=te)},function(te){(S._status===0||S._status===-1)&&(S._status=2,S._result=te)}),S._status===-1&&(S._status=0,S._result=U)}if(S._status===1)return S._result.default;throw S._result}var Ae=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},w={map:F,forEach:function(S,U,te){F(S,function(){U.apply(this,arguments)},te)},count:function(S){var U=0;return F(S,function(){U++}),U},toArray:function(S){return F(S,function(U){return U})||[]},only:function(S){if(!$(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return Ne.Activity=j,Ne.Children=w,Ne.Component=I,Ne.Fragment=r,Ne.Profiler=d,Ne.PureComponent=X,Ne.StrictMode=u,Ne.Suspense=v,Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,Ne.__COMPILER_RUNTIME={__proto__:null,c:function(S){return V.H.useMemoCache(S)}},Ne.cache=function(S){return function(){return S.apply(null,arguments)}},Ne.cacheSignal=function(){return null},Ne.cloneElement=function(S,U,te){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var re=K({},S.props),me=S.key;if(U!=null)for(xe in U.key!==void 0&&(me=""+U.key),U)!Q.call(U,xe)||xe==="key"||xe==="__self"||xe==="__source"||xe==="ref"&&U.ref===void 0||(re[xe]=U[xe]);var xe=arguments.length-2;if(xe===1)re.children=te;else if(1<xe){for(var ve=Array(xe),He=0;He<xe;He++)ve[He]=arguments[He+2];re.children=ve}return ce(S.type,me,re)},Ne.createContext=function(S){return S={$$typeof:m,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:f,_context:S},S},Ne.createElement=function(S,U,te){var re,me={},xe=null;if(U!=null)for(re in U.key!==void 0&&(xe=""+U.key),U)Q.call(U,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(me[re]=U[re]);var ve=arguments.length-2;if(ve===1)me.children=te;else if(1<ve){for(var He=Array(ve),Ze=0;Ze<ve;Ze++)He[Ze]=arguments[Ze+2];me.children=He}if(S&&S.defaultProps)for(re in ve=S.defaultProps,ve)me[re]===void 0&&(me[re]=ve[re]);return ce(S,xe,me)},Ne.createRef=function(){return{current:null}},Ne.forwardRef=function(S){return{$$typeof:p,render:S}},Ne.isValidElement=$,Ne.lazy=function(S){return{$$typeof:b,_payload:{_status:-1,_result:S},_init:fe}},Ne.memo=function(S,U){return{$$typeof:g,type:S,compare:U===void 0?null:U}},Ne.startTransition=function(S){var U=V.T,te={};V.T=te;try{var re=S(),me=V.S;me!==null&&me(te,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(B,Ae)}catch(xe){Ae(xe)}finally{U!==null&&te.types!==null&&(U.types=te.types),V.T=U}},Ne.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},Ne.use=function(S){return V.H.use(S)},Ne.useActionState=function(S,U,te){return V.H.useActionState(S,U,te)},Ne.useCallback=function(S,U){return V.H.useCallback(S,U)},Ne.useContext=function(S){return V.H.useContext(S)},Ne.useDebugValue=function(){},Ne.useDeferredValue=function(S,U){return V.H.useDeferredValue(S,U)},Ne.useEffect=function(S,U){return V.H.useEffect(S,U)},Ne.useEffectEvent=function(S){return V.H.useEffectEvent(S)},Ne.useId=function(){return V.H.useId()},Ne.useImperativeHandle=function(S,U,te){return V.H.useImperativeHandle(S,U,te)},Ne.useInsertionEffect=function(S,U){return V.H.useInsertionEffect(S,U)},Ne.useLayoutEffect=function(S,U){return V.H.useLayoutEffect(S,U)},Ne.useMemo=function(S,U){return V.H.useMemo(S,U)},Ne.useOptimistic=function(S,U){return V.H.useOptimistic(S,U)},Ne.useReducer=function(S,U,te){return V.H.useReducer(S,U,te)},Ne.useRef=function(S){return V.H.useRef(S)},Ne.useState=function(S){return V.H.useState(S)},Ne.useSyncExternalStore=function(S,U,te){return V.H.useSyncExternalStore(S,U,te)},Ne.useTransition=function(){return V.H.useTransition()},Ne.version="19.2.7",Ne}var tp;function $o(){return tp||(tp=1,co.exports=hb()),co.exports}var k=$o();const mb=Wp(k);var uo={exports:{}},es={},oo={exports:{}},fo={};var np;function pb(){return np||(np=1,(function(n){function l(Z,F){var fe=Z.length;Z.push(F);e:for(;0<fe;){var Ae=fe-1>>>1,w=Z[Ae];if(0<d(w,F))Z[Ae]=F,Z[fe]=w,fe=Ae;else break e}}function r(Z){return Z.length===0?null:Z[0]}function u(Z){if(Z.length===0)return null;var F=Z[0],fe=Z.pop();if(fe!==F){Z[0]=fe;e:for(var Ae=0,w=Z.length,S=w>>>1;Ae<S;){var U=2*(Ae+1)-1,te=Z[U],re=U+1,me=Z[re];if(0>d(te,fe))re<w&&0>d(me,te)?(Z[Ae]=me,Z[re]=fe,Ae=re):(Z[Ae]=te,Z[U]=fe,Ae=U);else if(re<w&&0>d(me,fe))Z[Ae]=me,Z[re]=fe,Ae=re;else break e}}return F}function d(Z,F){var fe=Z.sortIndex-F.sortIndex;return fe!==0?fe:Z.id-F.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var m=Date,p=m.now();n.unstable_now=function(){return m.now()-p}}var v=[],g=[],b=1,j=null,C=3,z=!1,M=!1,K=!1,J=!1,I=typeof setTimeout=="function"?setTimeout:null,ie=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function se(Z){for(var F=r(g);F!==null;){if(F.callback===null)u(g);else if(F.startTime<=Z)u(g),F.sortIndex=F.expirationTime,l(v,F);else break;F=r(g)}}function x(Z){if(K=!1,se(Z),!M)if(r(v)!==null)M=!0,B||(B=!0,pe());else{var F=r(g);F!==null&&Ie(x,F.startTime-Z)}}var B=!1,V=-1,Q=5,ce=-1;function ue(){return J?!0:!(n.unstable_now()-ce<Q)}function $(){if(J=!1,B){var Z=n.unstable_now();ce=Z;var F=!0;try{e:{M=!1,K&&(K=!1,ie(V),V=-1),z=!0;var fe=C;try{t:{for(se(Z),j=r(v);j!==null&&!(j.expirationTime>Z&&ue());){var Ae=j.callback;if(typeof Ae=="function"){j.callback=null,C=j.priorityLevel;var w=Ae(j.expirationTime<=Z);if(Z=n.unstable_now(),typeof w=="function"){j.callback=w,se(Z),F=!0;break t}j===r(v)&&u(v),se(Z)}else u(v);j=r(v)}if(j!==null)F=!0;else{var S=r(g);S!==null&&Ie(x,S.startTime-Z),F=!1}}break e}finally{j=null,C=fe,z=!1}F=void 0}}finally{F?pe():B=!1}}}var pe;if(typeof X=="function")pe=function(){X($)};else if(typeof MessageChannel<"u"){var qe=new MessageChannel,tt=qe.port2;qe.port1.onmessage=$,pe=function(){tt.postMessage(null)}}else pe=function(){I($,0)};function Ie(Z,F){V=I(function(){Z(n.unstable_now())},F)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(Z){Z.callback=null},n.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<Z?Math.floor(1e3/Z):5},n.unstable_getCurrentPriorityLevel=function(){return C},n.unstable_next=function(Z){switch(C){case 1:case 2:case 3:var F=3;break;default:F=C}var fe=C;C=F;try{return Z()}finally{C=fe}},n.unstable_requestPaint=function(){J=!0},n.unstable_runWithPriority=function(Z,F){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var fe=C;C=Z;try{return F()}finally{C=fe}},n.unstable_scheduleCallback=function(Z,F,fe){var Ae=n.unstable_now();switch(typeof fe=="object"&&fe!==null?(fe=fe.delay,fe=typeof fe=="number"&&0<fe?Ae+fe:Ae):fe=Ae,Z){case 1:var w=-1;break;case 2:w=250;break;case 5:w=1073741823;break;case 4:w=1e4;break;default:w=5e3}return w=fe+w,Z={id:b++,callback:F,priorityLevel:Z,startTime:fe,expirationTime:w,sortIndex:-1},fe>Ae?(Z.sortIndex=fe,l(g,Z),r(v)===null&&Z===r(g)&&(K?(ie(V),V=-1):K=!0,Ie(x,fe-Ae))):(Z.sortIndex=w,l(v,Z),M||z||(M=!0,B||(B=!0,pe()))),Z},n.unstable_shouldYield=ue,n.unstable_wrapCallback=function(Z){var F=C;return function(){var fe=C;C=F;try{return Z.apply(this,arguments)}finally{C=fe}}}})(fo)),fo}var ap;function vb(){return ap||(ap=1,oo.exports=pb()),oo.exports}var ho={exports:{}},Ht={};var lp;function gb(){if(lp)return Ht;lp=1;var n=$o();function l(v){var g="https://react.dev/errors/"+v;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)g+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+v+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var u={d:{f:r,r:function(){throw Error(l(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(v,g,b){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:j==null?null:""+j,children:v,containerInfo:g,implementation:b}}var m=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(v,g){if(v==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Ht.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,Ht.createPortal=function(v,g){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(l(299));return f(v,g,null,b)},Ht.flushSync=function(v){var g=m.T,b=u.p;try{if(m.T=null,u.p=2,v)return v()}finally{m.T=g,u.p=b,u.d.f()}},Ht.preconnect=function(v,g){typeof v=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,u.d.C(v,g))},Ht.prefetchDNS=function(v){typeof v=="string"&&u.d.D(v)},Ht.preinit=function(v,g){if(typeof v=="string"&&g&&typeof g.as=="string"){var b=g.as,j=p(b,g.crossOrigin),C=typeof g.integrity=="string"?g.integrity:void 0,z=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;b==="style"?u.d.S(v,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:j,integrity:C,fetchPriority:z}):b==="script"&&u.d.X(v,{crossOrigin:j,integrity:C,fetchPriority:z,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Ht.preinitModule=function(v,g){if(typeof v=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var b=p(g.as,g.crossOrigin);u.d.M(v,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&u.d.M(v)},Ht.preload=function(v,g){if(typeof v=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var b=g.as,j=p(b,g.crossOrigin);u.d.L(v,b,{crossOrigin:j,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Ht.preloadModule=function(v,g){if(typeof v=="string")if(g){var b=p(g.as,g.crossOrigin);u.d.m(v,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else u.d.m(v)},Ht.requestFormReset=function(v){u.d.r(v)},Ht.unstable_batchedUpdates=function(v,g){return v(g)},Ht.useFormState=function(v,g,b){return m.H.useFormState(v,g,b)},Ht.useFormStatus=function(){return m.H.useHostTransitionStatus()},Ht.version="19.2.7",Ht}var ip;function yb(){if(ip)return ho.exports;ip=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),ho.exports=gb(),ho.exports}var sp;function bb(){if(sp)return es;sp=1;var n=vb(),l=$o(),r=yb();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function v(e){if(f(e)!==e)throw Error(u(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(u(188));return t!==e?null:e}for(var a=e,s=t;;){var c=a.return;if(c===null)break;var o=c.alternate;if(o===null){if(s=c.return,s!==null){a=s;continue}break}if(c.child===o.child){for(o=c.child;o;){if(o===a)return v(c),e;if(o===s)return v(c),t;o=o.sibling}throw Error(u(188))}if(a.return!==s.return)a=c,s=o;else{for(var h=!1,y=c.child;y;){if(y===a){h=!0,a=c,s=o;break}if(y===s){h=!0,s=c,a=o;break}y=y.sibling}if(!h){for(y=o.child;y;){if(y===a){h=!0,a=o,s=c;break}if(y===s){h=!0,s=o,a=c;break}y=y.sibling}if(!h)throw Error(u(189))}}if(a.alternate!==s)throw Error(u(190))}if(a.tag!==3)throw Error(u(188));return a.stateNode.current===a?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,C=Symbol.for("react.element"),z=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),J=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),ie=Symbol.for("react.consumer"),X=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),ue=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function pe(e){return e===null||typeof e!="object"?null:(e=$&&e[$]||e["@@iterator"],typeof e=="function"?e:null)}var qe=Symbol.for("react.client.reference");function tt(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===qe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case K:return"Fragment";case I:return"Profiler";case J:return"StrictMode";case x:return"Suspense";case B:return"SuspenseList";case ce:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case M:return"Portal";case X:return e.displayName||"Context";case ie:return(e._context.displayName||"Context")+".Consumer";case se:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return t=e.displayName||null,t!==null?t:tt(e.type)||"Memo";case Q:t=e._payload,e=e._init;try{return tt(e(t))}catch{}}return null}var Ie=Array.isArray,Z=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},Ae=[],w=-1;function S(e){return{current:e}}function U(e){0>w||(e.current=Ae[w],Ae[w]=null,w--)}function te(e,t){w++,Ae[w]=e.current,e.current=t}var re=S(null),me=S(null),xe=S(null),ve=S(null);function He(e,t){switch(te(xe,t),te(me,e),te(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?xm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=xm(t),e=Sm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(re),te(re,e)}function Ze(){U(re),U(me),U(xe)}function $t(e){e.memoizedState!==null&&te(ve,e);var t=re.current,a=Sm(t,e.type);t!==a&&(te(me,e),te(re,a))}function Rn(e){me.current===e&&(U(re),U(me)),ve.current===e&&(U(ve),Xi._currentValue=fe)}var Ya,Ja;function Nt(e){if(Ya===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Ya=t&&t[1]||"",Ja=-1<a.stack.indexOf(`
1
+ (function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&u(m)}).observe(document,{childList:!0,subtree:!0});function r(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(d){if(d.ep)return;d.ep=!0;const f=r(d);fetch(d.href,f)}})();function Wp(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ro={exports:{}},Wi={};var Fm;function db(){if(Fm)return Wi;Fm=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function r(u,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var p in d)p!=="key"&&(f[p]=d[p])}else f=d;return d=f.ref,{$$typeof:n,type:u,key:m,ref:d!==void 0?d:null,props:f}}return Wi.Fragment=l,Wi.jsx=r,Wi.jsxs=r,Wi}var Wm;function fb(){return Wm||(Wm=1,ro.exports=db()),ro.exports}var i=fb(),co={exports:{}},Ne={};var ep;function hb(){if(ep)return Ne;ep=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),C=Symbol.iterator;function z(S){return S===null||typeof S!="object"?null:(S=C&&S[C]||S["@@iterator"],typeof S=="function"?S:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},K=Object.assign,J={};function I(S,U,te){this.props=S,this.context=U,this.refs=J,this.updater=te||M}I.prototype.isReactComponent={},I.prototype.setState=function(S,U){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,U,"setState")},I.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function ie(){}ie.prototype=I.prototype;function X(S,U,te){this.props=S,this.context=U,this.refs=J,this.updater=te||M}var se=X.prototype=new ie;se.constructor=X,K(se,I.prototype),se.isPureReactComponent=!0;var x=Array.isArray;function B(){}var V={H:null,A:null,T:null,S:null},Q=Object.prototype.hasOwnProperty;function ce(S,U,te){var re=te.ref;return{$$typeof:n,type:S,key:U,ref:re!==void 0?re:null,props:te}}function ue(S,U){return ce(S.type,U,S.props)}function $(S){return typeof S=="object"&&S!==null&&S.$$typeof===n}function pe(S){var U={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(te){return U[te]})}var qe=/\/+/g;function tt(S,U){return typeof S=="object"&&S!==null&&S.key!=null?pe(""+S.key):U.toString(36)}function Pe(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(B,B):(S.status="pending",S.then(function(U){S.status==="pending"&&(S.status="fulfilled",S.value=U)},function(U){S.status==="pending"&&(S.status="rejected",S.reason=U)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function Z(S,U,te,re,me){var xe=typeof S;(xe==="undefined"||xe==="boolean")&&(S=null);var ve=!1;if(S===null)ve=!0;else switch(xe){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(S.$$typeof){case n:case l:ve=!0;break;case b:return ve=S._init,Z(ve(S._payload),U,te,re,me)}}if(ve)return me=me(S),ve=re===""?"."+tt(S,0):re,x(me)?(te="",ve!=null&&(te=ve.replace(qe,"$&/")+"/"),Z(me,U,te,"",function($t){return $t})):me!=null&&($(me)&&(me=ue(me,te+(me.key==null||S&&S.key===me.key?"":(""+me.key).replace(qe,"$&/")+"/")+ve)),U.push(me)),1;ve=0;var He=re===""?".":re+":";if(x(S))for(var Ue=0;Ue<S.length;Ue++)re=S[Ue],xe=He+tt(re,Ue),ve+=Z(re,U,te,xe,me);else if(Ue=z(S),typeof Ue=="function")for(S=Ue.call(S),Ue=0;!(re=S.next()).done;)re=re.value,xe=He+tt(re,Ue++),ve+=Z(re,U,te,xe,me);else if(xe==="object"){if(typeof S.then=="function")return Z(Pe(S),U,te,re,me);throw U=String(S),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ve}function F(S,U,te){if(S==null)return S;var re=[],me=0;return Z(S,re,"","",function(xe){return U.call(te,xe,me++)}),re}function fe(S){if(S._status===-1){var U=S._result;U=U(),U.then(function(te){(S._status===0||S._status===-1)&&(S._status=1,S._result=te)},function(te){(S._status===0||S._status===-1)&&(S._status=2,S._result=te)}),S._status===-1&&(S._status=0,S._result=U)}if(S._status===1)return S._result.default;throw S._result}var Ae=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},w={map:F,forEach:function(S,U,te){F(S,function(){U.apply(this,arguments)},te)},count:function(S){var U=0;return F(S,function(){U++}),U},toArray:function(S){return F(S,function(U){return U})||[]},only:function(S){if(!$(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return Ne.Activity=j,Ne.Children=w,Ne.Component=I,Ne.Fragment=r,Ne.Profiler=d,Ne.PureComponent=X,Ne.StrictMode=u,Ne.Suspense=v,Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,Ne.__COMPILER_RUNTIME={__proto__:null,c:function(S){return V.H.useMemoCache(S)}},Ne.cache=function(S){return function(){return S.apply(null,arguments)}},Ne.cacheSignal=function(){return null},Ne.cloneElement=function(S,U,te){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var re=K({},S.props),me=S.key;if(U!=null)for(xe in U.key!==void 0&&(me=""+U.key),U)!Q.call(U,xe)||xe==="key"||xe==="__self"||xe==="__source"||xe==="ref"&&U.ref===void 0||(re[xe]=U[xe]);var xe=arguments.length-2;if(xe===1)re.children=te;else if(1<xe){for(var ve=Array(xe),He=0;He<xe;He++)ve[He]=arguments[He+2];re.children=ve}return ce(S.type,me,re)},Ne.createContext=function(S){return S={$$typeof:m,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:f,_context:S},S},Ne.createElement=function(S,U,te){var re,me={},xe=null;if(U!=null)for(re in U.key!==void 0&&(xe=""+U.key),U)Q.call(U,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(me[re]=U[re]);var ve=arguments.length-2;if(ve===1)me.children=te;else if(1<ve){for(var He=Array(ve),Ue=0;Ue<ve;Ue++)He[Ue]=arguments[Ue+2];me.children=He}if(S&&S.defaultProps)for(re in ve=S.defaultProps,ve)me[re]===void 0&&(me[re]=ve[re]);return ce(S,xe,me)},Ne.createRef=function(){return{current:null}},Ne.forwardRef=function(S){return{$$typeof:p,render:S}},Ne.isValidElement=$,Ne.lazy=function(S){return{$$typeof:b,_payload:{_status:-1,_result:S},_init:fe}},Ne.memo=function(S,U){return{$$typeof:g,type:S,compare:U===void 0?null:U}},Ne.startTransition=function(S){var U=V.T,te={};V.T=te;try{var re=S(),me=V.S;me!==null&&me(te,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(B,Ae)}catch(xe){Ae(xe)}finally{U!==null&&te.types!==null&&(U.types=te.types),V.T=U}},Ne.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},Ne.use=function(S){return V.H.use(S)},Ne.useActionState=function(S,U,te){return V.H.useActionState(S,U,te)},Ne.useCallback=function(S,U){return V.H.useCallback(S,U)},Ne.useContext=function(S){return V.H.useContext(S)},Ne.useDebugValue=function(){},Ne.useDeferredValue=function(S,U){return V.H.useDeferredValue(S,U)},Ne.useEffect=function(S,U){return V.H.useEffect(S,U)},Ne.useEffectEvent=function(S){return V.H.useEffectEvent(S)},Ne.useId=function(){return V.H.useId()},Ne.useImperativeHandle=function(S,U,te){return V.H.useImperativeHandle(S,U,te)},Ne.useInsertionEffect=function(S,U){return V.H.useInsertionEffect(S,U)},Ne.useLayoutEffect=function(S,U){return V.H.useLayoutEffect(S,U)},Ne.useMemo=function(S,U){return V.H.useMemo(S,U)},Ne.useOptimistic=function(S,U){return V.H.useOptimistic(S,U)},Ne.useReducer=function(S,U,te){return V.H.useReducer(S,U,te)},Ne.useRef=function(S){return V.H.useRef(S)},Ne.useState=function(S){return V.H.useState(S)},Ne.useSyncExternalStore=function(S,U,te){return V.H.useSyncExternalStore(S,U,te)},Ne.useTransition=function(){return V.H.useTransition()},Ne.version="19.2.7",Ne}var tp;function $o(){return tp||(tp=1,co.exports=hb()),co.exports}var k=$o();const mb=Wp(k);var uo={exports:{}},es={},oo={exports:{}},fo={};var np;function pb(){return np||(np=1,(function(n){function l(Z,F){var fe=Z.length;Z.push(F);e:for(;0<fe;){var Ae=fe-1>>>1,w=Z[Ae];if(0<d(w,F))Z[Ae]=F,Z[fe]=w,fe=Ae;else break e}}function r(Z){return Z.length===0?null:Z[0]}function u(Z){if(Z.length===0)return null;var F=Z[0],fe=Z.pop();if(fe!==F){Z[0]=fe;e:for(var Ae=0,w=Z.length,S=w>>>1;Ae<S;){var U=2*(Ae+1)-1,te=Z[U],re=U+1,me=Z[re];if(0>d(te,fe))re<w&&0>d(me,te)?(Z[Ae]=me,Z[re]=fe,Ae=re):(Z[Ae]=te,Z[U]=fe,Ae=U);else if(re<w&&0>d(me,fe))Z[Ae]=me,Z[re]=fe,Ae=re;else break e}}return F}function d(Z,F){var fe=Z.sortIndex-F.sortIndex;return fe!==0?fe:Z.id-F.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var m=Date,p=m.now();n.unstable_now=function(){return m.now()-p}}var v=[],g=[],b=1,j=null,C=3,z=!1,M=!1,K=!1,J=!1,I=typeof setTimeout=="function"?setTimeout:null,ie=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function se(Z){for(var F=r(g);F!==null;){if(F.callback===null)u(g);else if(F.startTime<=Z)u(g),F.sortIndex=F.expirationTime,l(v,F);else break;F=r(g)}}function x(Z){if(K=!1,se(Z),!M)if(r(v)!==null)M=!0,B||(B=!0,pe());else{var F=r(g);F!==null&&Pe(x,F.startTime-Z)}}var B=!1,V=-1,Q=5,ce=-1;function ue(){return J?!0:!(n.unstable_now()-ce<Q)}function $(){if(J=!1,B){var Z=n.unstable_now();ce=Z;var F=!0;try{e:{M=!1,K&&(K=!1,ie(V),V=-1),z=!0;var fe=C;try{t:{for(se(Z),j=r(v);j!==null&&!(j.expirationTime>Z&&ue());){var Ae=j.callback;if(typeof Ae=="function"){j.callback=null,C=j.priorityLevel;var w=Ae(j.expirationTime<=Z);if(Z=n.unstable_now(),typeof w=="function"){j.callback=w,se(Z),F=!0;break t}j===r(v)&&u(v),se(Z)}else u(v);j=r(v)}if(j!==null)F=!0;else{var S=r(g);S!==null&&Pe(x,S.startTime-Z),F=!1}}break e}finally{j=null,C=fe,z=!1}F=void 0}}finally{F?pe():B=!1}}}var pe;if(typeof X=="function")pe=function(){X($)};else if(typeof MessageChannel<"u"){var qe=new MessageChannel,tt=qe.port2;qe.port1.onmessage=$,pe=function(){tt.postMessage(null)}}else pe=function(){I($,0)};function Pe(Z,F){V=I(function(){Z(n.unstable_now())},F)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(Z){Z.callback=null},n.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<Z?Math.floor(1e3/Z):5},n.unstable_getCurrentPriorityLevel=function(){return C},n.unstable_next=function(Z){switch(C){case 1:case 2:case 3:var F=3;break;default:F=C}var fe=C;C=F;try{return Z()}finally{C=fe}},n.unstable_requestPaint=function(){J=!0},n.unstable_runWithPriority=function(Z,F){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var fe=C;C=Z;try{return F()}finally{C=fe}},n.unstable_scheduleCallback=function(Z,F,fe){var Ae=n.unstable_now();switch(typeof fe=="object"&&fe!==null?(fe=fe.delay,fe=typeof fe=="number"&&0<fe?Ae+fe:Ae):fe=Ae,Z){case 1:var w=-1;break;case 2:w=250;break;case 5:w=1073741823;break;case 4:w=1e4;break;default:w=5e3}return w=fe+w,Z={id:b++,callback:F,priorityLevel:Z,startTime:fe,expirationTime:w,sortIndex:-1},fe>Ae?(Z.sortIndex=fe,l(g,Z),r(v)===null&&Z===r(g)&&(K?(ie(V),V=-1):K=!0,Pe(x,fe-Ae))):(Z.sortIndex=w,l(v,Z),M||z||(M=!0,B||(B=!0,pe()))),Z},n.unstable_shouldYield=ue,n.unstable_wrapCallback=function(Z){var F=C;return function(){var fe=C;C=F;try{return Z.apply(this,arguments)}finally{C=fe}}}})(fo)),fo}var ap;function vb(){return ap||(ap=1,oo.exports=pb()),oo.exports}var ho={exports:{}},Ht={};var lp;function gb(){if(lp)return Ht;lp=1;var n=$o();function l(v){var g="https://react.dev/errors/"+v;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)g+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+v+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var u={d:{f:r,r:function(){throw Error(l(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(v,g,b){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:j==null?null:""+j,children:v,containerInfo:g,implementation:b}}var m=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(v,g){if(v==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Ht.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,Ht.createPortal=function(v,g){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(l(299));return f(v,g,null,b)},Ht.flushSync=function(v){var g=m.T,b=u.p;try{if(m.T=null,u.p=2,v)return v()}finally{m.T=g,u.p=b,u.d.f()}},Ht.preconnect=function(v,g){typeof v=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,u.d.C(v,g))},Ht.prefetchDNS=function(v){typeof v=="string"&&u.d.D(v)},Ht.preinit=function(v,g){if(typeof v=="string"&&g&&typeof g.as=="string"){var b=g.as,j=p(b,g.crossOrigin),C=typeof g.integrity=="string"?g.integrity:void 0,z=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;b==="style"?u.d.S(v,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:j,integrity:C,fetchPriority:z}):b==="script"&&u.d.X(v,{crossOrigin:j,integrity:C,fetchPriority:z,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Ht.preinitModule=function(v,g){if(typeof v=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var b=p(g.as,g.crossOrigin);u.d.M(v,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&u.d.M(v)},Ht.preload=function(v,g){if(typeof v=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var b=g.as,j=p(b,g.crossOrigin);u.d.L(v,b,{crossOrigin:j,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Ht.preloadModule=function(v,g){if(typeof v=="string")if(g){var b=p(g.as,g.crossOrigin);u.d.m(v,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else u.d.m(v)},Ht.requestFormReset=function(v){u.d.r(v)},Ht.unstable_batchedUpdates=function(v,g){return v(g)},Ht.useFormState=function(v,g,b){return m.H.useFormState(v,g,b)},Ht.useFormStatus=function(){return m.H.useHostTransitionStatus()},Ht.version="19.2.7",Ht}var ip;function yb(){if(ip)return ho.exports;ip=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),ho.exports=gb(),ho.exports}var sp;function bb(){if(sp)return es;sp=1;var n=vb(),l=$o(),r=yb();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function v(e){if(f(e)!==e)throw Error(u(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(u(188));return t!==e?null:e}for(var a=e,s=t;;){var c=a.return;if(c===null)break;var o=c.alternate;if(o===null){if(s=c.return,s!==null){a=s;continue}break}if(c.child===o.child){for(o=c.child;o;){if(o===a)return v(c),e;if(o===s)return v(c),t;o=o.sibling}throw Error(u(188))}if(a.return!==s.return)a=c,s=o;else{for(var h=!1,y=c.child;y;){if(y===a){h=!0,a=c,s=o;break}if(y===s){h=!0,s=c,a=o;break}y=y.sibling}if(!h){for(y=o.child;y;){if(y===a){h=!0,a=o,s=c;break}if(y===s){h=!0,s=o,a=c;break}y=y.sibling}if(!h)throw Error(u(189))}}if(a.alternate!==s)throw Error(u(190))}if(a.tag!==3)throw Error(u(188));return a.stateNode.current===a?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,C=Symbol.for("react.element"),z=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),J=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),ie=Symbol.for("react.consumer"),X=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),ue=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function pe(e){return e===null||typeof e!="object"?null:(e=$&&e[$]||e["@@iterator"],typeof e=="function"?e:null)}var qe=Symbol.for("react.client.reference");function tt(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===qe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case K:return"Fragment";case I:return"Profiler";case J:return"StrictMode";case x:return"Suspense";case B:return"SuspenseList";case ce:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case M:return"Portal";case X:return e.displayName||"Context";case ie:return(e._context.displayName||"Context")+".Consumer";case se:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return t=e.displayName||null,t!==null?t:tt(e.type)||"Memo";case Q:t=e._payload,e=e._init;try{return tt(e(t))}catch{}}return null}var Pe=Array.isArray,Z=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},Ae=[],w=-1;function S(e){return{current:e}}function U(e){0>w||(e.current=Ae[w],Ae[w]=null,w--)}function te(e,t){w++,Ae[w]=e.current,e.current=t}var re=S(null),me=S(null),xe=S(null),ve=S(null);function He(e,t){switch(te(xe,t),te(me,e),te(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?xm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=xm(t),e=Sm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(re),te(re,e)}function Ue(){U(re),U(me),U(xe)}function $t(e){e.memoizedState!==null&&te(ve,e);var t=re.current,a=Sm(t,e.type);t!==a&&(te(me,e),te(re,a))}function Rn(e){me.current===e&&(U(re),U(me)),ve.current===e&&(U(ve),Xi._currentValue=fe)}var Ya,Ja;function Nt(e){if(Ya===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Ya=t&&t[1]||"",Ja=-1<a.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
3
  `+Ya+e+Ja}var _n=!1;function ct(e,t){if(!e||_n)return"";_n=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(D){var R=D}Reflect.construct(e,[],G)}else{try{G.call()}catch(D){R=D}e.call(G.prototype)}}else{try{throw Error()}catch(D){R=D}(G=e())&&typeof G.catch=="function"&&G.catch(function(){})}}catch(D){if(D&&R&&typeof D.stack=="string")return[D.stack,R.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=s.DetermineComponentFrameRoot(),h=o[0],y=o[1];if(h&&y){var _=h.split(`
4
4
  `),T=y.split(`
5
5
  `);for(c=s=0;s<_.length&&!_[s].includes("DetermineComponentFrameRoot");)s++;for(;c<T.length&&!T[c].includes("DetermineComponentFrameRoot");)c++;if(s===_.length||c===T.length)for(s=_.length-1,c=T.length-1;1<=s&&0<=c&&_[s]!==T[c];)c--;for(;1<=s&&0<=c;s--,c--)if(_[s]!==T[c]){if(s!==1||c!==1)do if(s--,c--,0>c||_[s]!==T[c]){var H=`
6
6
  `+_[s].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),H}while(1<=s&&0<=c);break}}}finally{_n=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Nt(a):""}function Nn(e,t){switch(e.tag){case 26:case 27:case 5:return Nt(e.type);case 16:return Nt("Lazy");case 13:return e.child!==t&&t!==null?Nt("Suspense Fallback"):Nt("Suspense");case 19:return Nt("SuspenseList");case 0:case 15:return ct(e.type,!1);case 11:return ct(e.type.render,!1);case 1:return ct(e.type,!0);case 31:return Nt("Activity");default:return""}}function Ut(e){try{var t="",a=null;do t+=Nn(e,a),a=e,e=e.return;while(e);return t}catch(s){return`
7
7
  Error generating stack: `+s.message+`
8
- `+s.stack}}var Mn=Object.prototype.hasOwnProperty,An=n.unstable_scheduleCallback,Dn=n.unstable_cancelCallback,Yn=n.unstable_shouldYield,Ge=n.unstable_requestPaint,ne=n.unstable_now,Me=n.unstable_getCurrentPriorityLevel,Ce=n.unstable_ImmediatePriority,nt=n.unstable_UserBlockingPriority,gt=n.unstable_NormalPriority,fa=n.unstable_LowPriority,Ka=n.unstable_IdlePriority,Jr=n.log,Kr=n.unstable_setDisableYieldValue,Qa=null,Lt=null;function Un(e){if(typeof Jr=="function"&&Kr(e),Lt&&typeof Lt.setStrictMode=="function")try{Lt.setStrictMode(Qa,e)}catch{}}var Bt=Math.clz32?Math.clz32:Xr,Qr=Math.log,Vr=Math.LN2;function Xr(e){return e>>>=0,e===0?32:31-(Qr(e)/Vr|0)|0}var N=256,W=262144,mt=4194304;function Zt(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function de(e,t,a){var s=e.pendingLanes;if(s===0)return 0;var c=0,o=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var y=s&134217727;return y!==0?(s=y&~o,s!==0?c=Zt(s):(h&=y,h!==0?c=Zt(h):a||(a=y&~e,a!==0&&(c=Zt(a))))):(y=s&~o,y!==0?c=Zt(y):h!==0?c=Zt(h):a||(a=s&~e,a!==0&&(c=Zt(a)))),c===0?0:t!==0&&t!==c&&(t&o)===0&&(o=c&-c,a=t&-t,o>=a||o===32&&(a&4194048)!==0)?t:c}function Cn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ds(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 fs(){var e=mt;return mt<<=1,(mt&62914560)===0&&(mt=4194304),e}function ui(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Va(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function zt(e,t,a,s,c,o){var h=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var y=e.entanglements,_=e.expirationTimes,T=e.hiddenUpdates;for(a=h&~a;0<a;){var H=31-Bt(a),G=1<<H;y[H]=0,_[H]=-1;var R=T[H];if(R!==null)for(T[H]=null,H=0;H<R.length;H++){var D=R[H];D!==null&&(D.lane&=-536870913)}a&=~G}s!==0&&nd(e,s,0),o!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=o&~(h&~t))}function nd(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Bt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|a&261930}function ad(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var s=31-Bt(a),c=1<<s;c&t|e[s]&t&&(e[s]|=t),a&=~c}}function ld(e,t){var a=t&-t;return a=(a&42)!==0?1:Ir(a),(a&(e.suspendedLanes|t))!==0?0:a}function Ir(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Pr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function id(){var e=F.p;return e!==0?e:(e=window.event,e===void 0?32:Jm(e.type))}function sd(e,t){var a=F.p;try{return F.p=e,t()}finally{F.p=a}}var ha=Math.random().toString(36).slice(2),Ot="__reactFiber$"+ha,Jt="__reactProps$"+ha,vl="__reactContainer$"+ha,Fr="__reactEvents$"+ha,eg="__reactListeners$"+ha,tg="__reactHandles$"+ha,rd="__reactResources$"+ha,oi="__reactMarker$"+ha;function Wr(e){delete e[Ot],delete e[Jt],delete e[Fr],delete e[eg],delete e[tg]}function gl(e){var t=e[Ot];if(t)return t;for(var a=e.parentNode;a;){if(t=a[vl]||a[Ot]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=wm(e);e!==null;){if(a=e[Ot])return a;e=wm(e)}return t}e=a,a=e.parentNode}return null}function yl(e){if(e=e[Ot]||e[vl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function di(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function bl(e){var t=e[rd];return t||(t=e[rd]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Et(e){e[oi]=!0}var cd=new Set,ud={};function Xa(e,t){jl(e,t),jl(e+"Capture",t)}function jl(e,t){for(ud[e]=t,e=0;e<t.length;e++)cd.add(t[e])}var ng=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]*$"),od={},dd={};function ag(e){return Mn.call(dd,e)?!0:Mn.call(od,e)?!1:ng.test(e)?dd[e]=!0:(od[e]=!0,!1)}function hs(e,t,a){if(ag(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function ms(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Jn(e,t,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+s)}}function dn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function fd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lg(e,t,a){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var c=s.get,o=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(h){a=""+h,o.call(this,h)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(h){a=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ec(e){if(!e._valueTracker){var t=fd(e)?"checked":"value";e._valueTracker=lg(e,t,""+e[t])}}function hd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),s="";return e&&(s=fd(e)?e.checked?"true":"false":e.value),e=s,e!==a?(t.setValue(e),!0):!1}function ps(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var ig=/[\n"\\]/g;function fn(e){return e.replace(ig,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function tc(e,t,a,s,c,o,h,y){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+dn(t)):e.value!==""+dn(t)&&(e.value=""+dn(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?nc(e,h,dn(t)):a!=null?nc(e,h,dn(a)):s!=null&&e.removeAttribute("value"),c==null&&o!=null&&(e.defaultChecked=!!o),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.name=""+dn(y):e.removeAttribute("name")}function md(e,t,a,s,c,o,h,y){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){ec(e);return}a=a!=null?""+dn(a):"",t=t!=null?""+dn(t):a,y||t===e.value||(e.value=t),e.defaultValue=t}s=s??c,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=y?e.checked:!!s,e.defaultChecked=!!s,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),ec(e)}function nc(e,t,a){t==="number"&&ps(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function xl(e,t,a,s){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&s&&(e[a].defaultSelected=!0)}else{for(a=""+dn(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function pd(e,t,a){if(t!=null&&(t=""+dn(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+dn(a):""}function vd(e,t,a,s){if(t==null){if(s!=null){if(a!=null)throw Error(u(92));if(Ie(s)){if(1<s.length)throw Error(u(93));s=s[0]}a=s}a==null&&(a=""),t=a}a=dn(t),e.defaultValue=a,s=e.textContent,s===a&&s!==""&&s!==null&&(e.value=s),ec(e)}function Sl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var sg=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 gd(e,t,a){var s=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,a):typeof a!="number"||a===0||sg.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function yd(e,t,a){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,a!=null){for(var s in a)!a.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var c in t)s=t[c],t.hasOwnProperty(c)&&a[c]!==s&&gd(e,c,s)}else for(var o in t)t.hasOwnProperty(o)&&gd(e,o,t[o])}function ac(e){if(e.indexOf("-")===-1)return!1;switch(e){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 rg=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"]]),cg=/^[\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 vs(e){return cg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Kn(){}var lc=null;function ic(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _l=null,Nl=null;function bd(e){var t=yl(e);if(t&&(e=t.stateNode)){var a=e[Jt]||null;e:switch(e=t.stateNode,t.type){case"input":if(tc(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+fn(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var s=a[t];if(s!==e&&s.form===e.form){var c=s[Jt]||null;if(!c)throw Error(u(90));tc(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)s=a[t],s.form===e.form&&hd(s)}break e;case"textarea":pd(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&xl(e,!!a.multiple,t,!1)}}}var sc=!1;function jd(e,t,a){if(sc)return e(t,a);sc=!0;try{var s=e(t);return s}finally{if(sc=!1,(_l!==null||Nl!==null)&&(ar(),_l&&(t=_l,e=Nl,Nl=_l=null,bd(t),e)))for(t=0;t<e.length;t++)bd(e[t])}}function fi(e,t){var a=e.stateNode;if(a===null)return null;var s=a[Jt]||null;if(s===null)return null;a=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(u(231,t,typeof a));return a}var Qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rc=!1;if(Qn)try{var hi={};Object.defineProperty(hi,"passive",{get:function(){rc=!0}}),window.addEventListener("test",hi,hi),window.removeEventListener("test",hi,hi)}catch{rc=!1}var ma=null,cc=null,gs=null;function xd(){if(gs)return gs;var e,t=cc,a=t.length,s,c="value"in ma?ma.value:ma.textContent,o=c.length;for(e=0;e<a&&t[e]===c[e];e++);var h=a-e;for(s=1;s<=h&&t[a-s]===c[o-s];s++);return gs=c.slice(e,1<s?1-s:void 0)}function ys(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function bs(){return!0}function Sd(){return!1}function Kt(e){function t(a,s,c,o,h){this._reactName=a,this._targetInst=c,this.type=s,this.nativeEvent=o,this.target=h,this.currentTarget=null;for(var y in e)e.hasOwnProperty(y)&&(a=e[y],this[y]=a?a(o):o[y]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?bs:Sd,this.isPropagationStopped=Sd,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=bs)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=bs)},persist:function(){},isPersistent:bs}),t}var Ia={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},js=Kt(Ia),mi=j({},Ia,{view:0,detail:0}),ug=Kt(mi),uc,oc,pi,xs=j({},mi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==pi&&(pi&&e.type==="mousemove"?(uc=e.screenX-pi.screenX,oc=e.screenY-pi.screenY):oc=uc=0,pi=e),uc)},movementY:function(e){return"movementY"in e?e.movementY:oc}}),_d=Kt(xs),og=j({},xs,{dataTransfer:0}),dg=Kt(og),fg=j({},mi,{relatedTarget:0}),dc=Kt(fg),hg=j({},Ia,{animationName:0,elapsedTime:0,pseudoElement:0}),mg=Kt(hg),pg=j({},Ia,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vg=Kt(pg),gg=j({},Ia,{data:0}),Nd=Kt(gg),yg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bg={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"},jg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jg[e])?!!t[e]:!1}function fc(){return xg}var Sg=j({},mi,{key:function(e){if(e.key){var t=yg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ys(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?bg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fc,charCode:function(e){return e.type==="keypress"?ys(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ys(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_g=Kt(Sg),Ng=j({},xs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ad=Kt(Ng),Ag=j({},mi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fc}),Cg=Kt(Ag),zg=j({},Ia,{propertyName:0,elapsedTime:0,pseudoElement:0}),Eg=Kt(zg),wg=j({},xs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Og=Kt(wg),Tg=j({},Ia,{newState:0,oldState:0}),kg=Kt(Tg),Rg=[9,13,27,32],hc=Qn&&"CompositionEvent"in window,vi=null;Qn&&"documentMode"in document&&(vi=document.documentMode);var Mg=Qn&&"TextEvent"in window&&!vi,Cd=Qn&&(!hc||vi&&8<vi&&11>=vi),zd=" ",Ed=!1;function wd(e,t){switch(e){case"keyup":return Rg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Od(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Al=!1;function Dg(e,t){switch(e){case"compositionend":return Od(t);case"keypress":return t.which!==32?null:(Ed=!0,zd);case"textInput":return e=t.data,e===zd&&Ed?null:e;default:return null}}function Ug(e,t){if(Al)return e==="compositionend"||!hc&&wd(e,t)?(e=xd(),gs=cc=ma=null,Al=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Cd&&t.locale!=="ko"?null:t.data;default:return null}}var Zg={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 Td(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Zg[e.type]:t==="textarea"}function kd(e,t,a,s){_l?Nl?Nl.push(s):Nl=[s]:_l=s,t=or(t,"onChange"),0<t.length&&(a=new js("onChange","change",null,a,s),e.push({event:a,listeners:t}))}var gi=null,yi=null;function Hg(e){pm(e,0)}function Ss(e){var t=di(e);if(hd(t))return e}function Rd(e,t){if(e==="change")return t}var Md=!1;if(Qn){var mc;if(Qn){var pc="oninput"in document;if(!pc){var Dd=document.createElement("div");Dd.setAttribute("oninput","return;"),pc=typeof Dd.oninput=="function"}mc=pc}else mc=!1;Md=mc&&(!document.documentMode||9<document.documentMode)}function Ud(){gi&&(gi.detachEvent("onpropertychange",Zd),yi=gi=null)}function Zd(e){if(e.propertyName==="value"&&Ss(yi)){var t=[];kd(t,yi,e,ic(e)),jd(Hg,t)}}function $g(e,t,a){e==="focusin"?(Ud(),gi=t,yi=a,gi.attachEvent("onpropertychange",Zd)):e==="focusout"&&Ud()}function Lg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ss(yi)}function Bg(e,t){if(e==="click")return Ss(t)}function qg(e,t){if(e==="input"||e==="change")return Ss(t)}function Gg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var en=typeof Object.is=="function"?Object.is:Gg;function bi(e,t){if(en(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),s=Object.keys(t);if(a.length!==s.length)return!1;for(s=0;s<a.length;s++){var c=a[s];if(!Mn.call(t,c)||!en(e[c],t[c]))return!1}return!0}function Hd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function $d(e,t){var a=Hd(e);e=0;for(var s;a;){if(a.nodeType===3){if(s=e+a.textContent.length,e<=t&&s>=t)return{node:a,offset:t-e};e=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Hd(a)}}function Ld(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ld(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ps(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=ps(e.document)}return t}function vc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Yg=Qn&&"documentMode"in document&&11>=document.documentMode,Cl=null,gc=null,ji=null,yc=!1;function qd(e,t,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;yc||Cl==null||Cl!==ps(s)||(s=Cl,"selectionStart"in s&&vc(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ji&&bi(ji,s)||(ji=s,s=or(gc,"onSelect"),0<s.length&&(t=new js("onSelect","select",null,t,a),e.push({event:t,listeners:s}),t.target=Cl)))}function Pa(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var zl={animationend:Pa("Animation","AnimationEnd"),animationiteration:Pa("Animation","AnimationIteration"),animationstart:Pa("Animation","AnimationStart"),transitionrun:Pa("Transition","TransitionRun"),transitionstart:Pa("Transition","TransitionStart"),transitioncancel:Pa("Transition","TransitionCancel"),transitionend:Pa("Transition","TransitionEnd")},bc={},Gd={};Qn&&(Gd=document.createElement("div").style,"AnimationEvent"in window||(delete zl.animationend.animation,delete zl.animationiteration.animation,delete zl.animationstart.animation),"TransitionEvent"in window||delete zl.transitionend.transition);function Fa(e){if(bc[e])return bc[e];if(!zl[e])return e;var t=zl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Gd)return bc[e]=t[a];return e}var Yd=Fa("animationend"),Jd=Fa("animationiteration"),Kd=Fa("animationstart"),Jg=Fa("transitionrun"),Kg=Fa("transitionstart"),Qg=Fa("transitioncancel"),Qd=Fa("transitionend"),Vd=new Map,jc="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(" ");jc.push("scrollEnd");function zn(e,t){Vd.set(e,t),Xa(t,[e])}var _s=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},hn=[],El=0,xc=0;function Ns(){for(var e=El,t=xc=El=0;t<e;){var a=hn[t];hn[t++]=null;var s=hn[t];hn[t++]=null;var c=hn[t];hn[t++]=null;var o=hn[t];if(hn[t++]=null,s!==null&&c!==null){var h=s.pending;h===null?c.next=c:(c.next=h.next,h.next=c),s.pending=c}o!==0&&Xd(a,c,o)}}function As(e,t,a,s){hn[El++]=e,hn[El++]=t,hn[El++]=a,hn[El++]=s,xc|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Sc(e,t,a,s){return As(e,t,a,s),Cs(e)}function Wa(e,t){return As(e,null,null,t),Cs(e)}function Xd(e,t,a){e.lanes|=a;var s=e.alternate;s!==null&&(s.lanes|=a);for(var c=!1,o=e.return;o!==null;)o.childLanes|=a,s=o.alternate,s!==null&&(s.childLanes|=a),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(c=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,c&&t!==null&&(c=31-Bt(a),e=o.hiddenUpdates,s=e[c],s===null?e[c]=[t]:s.push(t),t.lane=a|536870912),o):null}function Cs(e){if(50<qi)throw qi=0,Tu=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var wl={};function Vg(e,t,a,s){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(e,t,a,s){return new Vg(e,t,a,s)}function _c(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vn(e,t){var a=e.alternate;return a===null?(a=tn(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Id(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function zs(e,t,a,s,c,o){var h=0;if(s=e,typeof e=="function")_c(e)&&(h=1);else if(typeof e=="string")h=Wy(e,a,re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ce:return e=tn(31,a,t,c),e.elementType=ce,e.lanes=o,e;case K:return el(a.children,c,o,t);case J:h=8,c|=24;break;case I:return e=tn(12,a,t,c|2),e.elementType=I,e.lanes=o,e;case x:return e=tn(13,a,t,c),e.elementType=x,e.lanes=o,e;case B:return e=tn(19,a,t,c),e.elementType=B,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case X:h=10;break e;case ie:h=9;break e;case se:h=11;break e;case V:h=14;break e;case Q:h=16,s=null;break e}h=29,a=Error(u(130,e===null?"null":typeof e,"")),s=null}return t=tn(h,a,t,c),t.elementType=e,t.type=s,t.lanes=o,t}function el(e,t,a,s){return e=tn(7,e,s,t),e.lanes=a,e}function Nc(e,t,a){return e=tn(6,e,null,t),e.lanes=a,e}function Pd(e){var t=tn(18,null,null,0);return t.stateNode=e,t}function Ac(e,t,a){return t=tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fd=new WeakMap;function mn(e,t){if(typeof e=="object"&&e!==null){var a=Fd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Ut(t)},Fd.set(e,t),t)}return{value:e,source:t,stack:Ut(t)}}var Ol=[],Tl=0,Es=null,xi=0,pn=[],vn=0,pa=null,Zn=1,Hn="";function Xn(e,t){Ol[Tl++]=xi,Ol[Tl++]=Es,Es=e,xi=t}function Wd(e,t,a){pn[vn++]=Zn,pn[vn++]=Hn,pn[vn++]=pa,pa=e;var s=Zn;e=Hn;var c=32-Bt(s)-1;s&=~(1<<c),a+=1;var o=32-Bt(t)+c;if(30<o){var h=c-c%5;o=(s&(1<<h)-1).toString(32),s>>=h,c-=h,Zn=1<<32-Bt(t)+c|a<<c|s,Hn=o+e}else Zn=1<<o|a<<c|s,Hn=e}function Cc(e){e.return!==null&&(Xn(e,1),Wd(e,1,0))}function zc(e){for(;e===Es;)Es=Ol[--Tl],Ol[Tl]=null,xi=Ol[--Tl],Ol[Tl]=null;for(;e===pa;)pa=pn[--vn],pn[vn]=null,Hn=pn[--vn],pn[vn]=null,Zn=pn[--vn],pn[vn]=null}function ef(e,t){pn[vn++]=Zn,pn[vn++]=Hn,pn[vn++]=pa,Zn=t.id,Hn=t.overflow,pa=e}var Tt=null,We=null,Re=!1,va=null,gn=!1,Ec=Error(u(519));function ga(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Si(mn(t,e)),Ec}function tf(e){var t=e.stateNode,a=e.type,s=e.memoizedProps;switch(t[Ot]=e,t[Jt]=s,a){case"dialog":Oe("cancel",t),Oe("close",t);break;case"iframe":case"object":case"embed":Oe("load",t);break;case"video":case"audio":for(a=0;a<Yi.length;a++)Oe(Yi[a],t);break;case"source":Oe("error",t);break;case"img":case"image":case"link":Oe("error",t),Oe("load",t);break;case"details":Oe("toggle",t);break;case"input":Oe("invalid",t),md(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Oe("invalid",t);break;case"textarea":Oe("invalid",t),vd(t,s.value,s.defaultValue,s.children)}a=s.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||s.suppressHydrationWarning===!0||bm(t.textContent,a)?(s.popover!=null&&(Oe("beforetoggle",t),Oe("toggle",t)),s.onScroll!=null&&Oe("scroll",t),s.onScrollEnd!=null&&Oe("scrollend",t),s.onClick!=null&&(t.onclick=Kn),t=!0):t=!1,t||ga(e,!0)}function nf(e){for(Tt=e.return;Tt;)switch(Tt.tag){case 5:case 31:case 13:gn=!1;return;case 27:case 3:gn=!0;return;default:Tt=Tt.return}}function kl(e){if(e!==Tt)return!1;if(!Re)return nf(e),Re=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Ku(e.type,e.memoizedProps)),a=!a),a&&We&&ga(e),nf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));We=Em(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));We=Em(e)}else t===27?(t=We,Ta(e.type)?(e=Pu,Pu=null,We=e):We=t):We=Tt?bn(e.stateNode.nextSibling):null;return!0}function tl(){We=Tt=null,Re=!1}function wc(){var e=va;return e!==null&&(It===null?It=e:It.push.apply(It,e),va=null),e}function Si(e){va===null?va=[e]:va.push(e)}var Oc=S(null),nl=null,In=null;function ya(e,t,a){te(Oc,t._currentValue),t._currentValue=a}function Pn(e){e._currentValue=Oc.current,U(Oc)}function Tc(e,t,a){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===a)break;e=e.return}}function kc(e,t,a,s){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var o=c.dependencies;if(o!==null){var h=c.child;o=o.firstContext;e:for(;o!==null;){var y=o;o=c;for(var _=0;_<t.length;_++)if(y.context===t[_]){o.lanes|=a,y=o.alternate,y!==null&&(y.lanes|=a),Tc(o.return,a,e),s||(h=null);break e}o=y.next}}else if(c.tag===18){if(h=c.return,h===null)throw Error(u(341));h.lanes|=a,o=h.alternate,o!==null&&(o.lanes|=a),Tc(h,a,e),h=null}else h=c.child;if(h!==null)h.return=c;else for(h=c;h!==null;){if(h===e){h=null;break}if(c=h.sibling,c!==null){c.return=h.return,h=c;break}h=h.return}c=h}}function Rl(e,t,a,s){e=null;for(var c=t,o=!1;c!==null;){if(!o){if((c.flags&524288)!==0)o=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var h=c.alternate;if(h===null)throw Error(u(387));if(h=h.memoizedProps,h!==null){var y=c.type;en(c.pendingProps.value,h.value)||(e!==null?e.push(y):e=[y])}}else if(c===ve.current){if(h=c.alternate,h===null)throw Error(u(387));h.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Xi):e=[Xi])}c=c.return}e!==null&&kc(t,e,a,s),t.flags|=262144}function ws(e){for(e=e.firstContext;e!==null;){if(!en(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function al(e){nl=e,In=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function kt(e){return af(nl,e)}function Os(e,t){return nl===null&&al(e),af(e,t)}function af(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},In===null){if(e===null)throw Error(u(308));In=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else In=In.next=t;return a}var Xg=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Ig=n.unstable_scheduleCallback,Pg=n.unstable_NormalPriority,yt={$$typeof:X,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Rc(){return{controller:new Xg,data:new Map,refCount:0}}function _i(e){e.refCount--,e.refCount===0&&Ig(Pg,function(){e.controller.abort()})}var Ni=null,Mc=0,Ml=0,Dl=null;function Fg(e,t){if(Ni===null){var a=Ni=[];Mc=0,Ml=Zu(),Dl={status:"pending",value:void 0,then:function(s){a.push(s)}}}return Mc++,t.then(lf,lf),t}function lf(){if(--Mc===0&&Ni!==null){Dl!==null&&(Dl.status="fulfilled");var e=Ni;Ni=null,Ml=0,Dl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wg(e,t){var a=[],s={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(s.status="rejected",s.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),s}var sf=Z.S;Z.S=function(e,t){Gh=ne(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Fg(e,t),sf!==null&&sf(e,t)};var ll=S(null);function Dc(){var e=ll.current;return e!==null?e:Pe.pooledCache}function Ts(e,t){t===null?te(ll,ll.current):te(ll,t.pool)}function rf(){var e=Dc();return e===null?null:{parent:yt._currentValue,pool:e}}var Ul=Error(u(460)),Uc=Error(u(474)),ks=Error(u(542)),Rs={then:function(){}};function cf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function uf(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Kn,Kn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,df(e),e;default:if(typeof t.status=="string")t.then(Kn,Kn);else{if(e=Pe,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=s}},function(s){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,df(e),e}throw sl=t,Ul}}function il(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(sl=a,Ul):a}}var sl=null;function of(){if(sl===null)throw Error(u(459));var e=sl;return sl=null,e}function df(e){if(e===Ul||e===ks)throw Error(u(483))}var Zl=null,Ai=0;function Ms(e){var t=Ai;return Ai+=1,Zl===null&&(Zl=[]),uf(Zl,e,t)}function Ci(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ds(e,t){throw t.$$typeof===C?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function ff(e){function t(E,A){if(e){var O=E.deletions;O===null?(E.deletions=[A],E.flags|=16):O.push(A)}}function a(E,A){if(!e)return null;for(;A!==null;)t(E,A),A=A.sibling;return null}function s(E){for(var A=new Map;E!==null;)E.key!==null?A.set(E.key,E):A.set(E.index,E),E=E.sibling;return A}function c(E,A){return E=Vn(E,A),E.index=0,E.sibling=null,E}function o(E,A,O){return E.index=O,e?(O=E.alternate,O!==null?(O=O.index,O<A?(E.flags|=67108866,A):O):(E.flags|=67108866,A)):(E.flags|=1048576,A)}function h(E){return e&&E.alternate===null&&(E.flags|=67108866),E}function y(E,A,O,L){return A===null||A.tag!==6?(A=Nc(O,E.mode,L),A.return=E,A):(A=c(A,O),A.return=E,A)}function _(E,A,O,L){var ye=O.type;return ye===K?H(E,A,O.props.children,L,O.key):A!==null&&(A.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===Q&&il(ye)===A.type)?(A=c(A,O.props),Ci(A,O),A.return=E,A):(A=zs(O.type,O.key,O.props,null,E.mode,L),Ci(A,O),A.return=E,A)}function T(E,A,O,L){return A===null||A.tag!==4||A.stateNode.containerInfo!==O.containerInfo||A.stateNode.implementation!==O.implementation?(A=Ac(O,E.mode,L),A.return=E,A):(A=c(A,O.children||[]),A.return=E,A)}function H(E,A,O,L,ye){return A===null||A.tag!==7?(A=el(O,E.mode,L,ye),A.return=E,A):(A=c(A,O),A.return=E,A)}function G(E,A,O){if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return A=Nc(""+A,E.mode,O),A.return=E,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case z:return O=zs(A.type,A.key,A.props,null,E.mode,O),Ci(O,A),O.return=E,O;case M:return A=Ac(A,E.mode,O),A.return=E,A;case Q:return A=il(A),G(E,A,O)}if(Ie(A)||pe(A))return A=el(A,E.mode,O,null),A.return=E,A;if(typeof A.then=="function")return G(E,Ms(A),O);if(A.$$typeof===X)return G(E,Os(E,A),O);Ds(E,A)}return null}function R(E,A,O,L){var ye=A!==null?A.key:null;if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return ye!==null?null:y(E,A,""+O,L);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case z:return O.key===ye?_(E,A,O,L):null;case M:return O.key===ye?T(E,A,O,L):null;case Q:return O=il(O),R(E,A,O,L)}if(Ie(O)||pe(O))return ye!==null?null:H(E,A,O,L,null);if(typeof O.then=="function")return R(E,A,Ms(O),L);if(O.$$typeof===X)return R(E,A,Os(E,O),L);Ds(E,O)}return null}function D(E,A,O,L,ye){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return E=E.get(O)||null,y(A,E,""+L,ye);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case z:return E=E.get(L.key===null?O:L.key)||null,_(A,E,L,ye);case M:return E=E.get(L.key===null?O:L.key)||null,T(A,E,L,ye);case Q:return L=il(L),D(E,A,O,L,ye)}if(Ie(L)||pe(L))return E=E.get(O)||null,H(A,E,L,ye,null);if(typeof L.then=="function")return D(E,A,O,Ms(L),ye);if(L.$$typeof===X)return D(E,A,O,Os(A,L),ye);Ds(A,L)}return null}function oe(E,A,O,L){for(var ye=null,$e=null,he=A,Ee=A=0,ke=null;he!==null&&Ee<O.length;Ee++){he.index>Ee?(ke=he,he=null):ke=he.sibling;var Le=R(E,he,O[Ee],L);if(Le===null){he===null&&(he=ke);break}e&&he&&Le.alternate===null&&t(E,he),A=o(Le,A,Ee),$e===null?ye=Le:$e.sibling=Le,$e=Le,he=ke}if(Ee===O.length)return a(E,he),Re&&Xn(E,Ee),ye;if(he===null){for(;Ee<O.length;Ee++)he=G(E,O[Ee],L),he!==null&&(A=o(he,A,Ee),$e===null?ye=he:$e.sibling=he,$e=he);return Re&&Xn(E,Ee),ye}for(he=s(he);Ee<O.length;Ee++)ke=D(he,E,Ee,O[Ee],L),ke!==null&&(e&&ke.alternate!==null&&he.delete(ke.key===null?Ee:ke.key),A=o(ke,A,Ee),$e===null?ye=ke:$e.sibling=ke,$e=ke);return e&&he.forEach(function(Ua){return t(E,Ua)}),Re&&Xn(E,Ee),ye}function Se(E,A,O,L){if(O==null)throw Error(u(151));for(var ye=null,$e=null,he=A,Ee=A=0,ke=null,Le=O.next();he!==null&&!Le.done;Ee++,Le=O.next()){he.index>Ee?(ke=he,he=null):ke=he.sibling;var Ua=R(E,he,Le.value,L);if(Ua===null){he===null&&(he=ke);break}e&&he&&Ua.alternate===null&&t(E,he),A=o(Ua,A,Ee),$e===null?ye=Ua:$e.sibling=Ua,$e=Ua,he=ke}if(Le.done)return a(E,he),Re&&Xn(E,Ee),ye;if(he===null){for(;!Le.done;Ee++,Le=O.next())Le=G(E,Le.value,L),Le!==null&&(A=o(Le,A,Ee),$e===null?ye=Le:$e.sibling=Le,$e=Le);return Re&&Xn(E,Ee),ye}for(he=s(he);!Le.done;Ee++,Le=O.next())Le=D(he,E,Ee,Le.value,L),Le!==null&&(e&&Le.alternate!==null&&he.delete(Le.key===null?Ee:Le.key),A=o(Le,A,Ee),$e===null?ye=Le:$e.sibling=Le,$e=Le);return e&&he.forEach(function(ob){return t(E,ob)}),Re&&Xn(E,Ee),ye}function Xe(E,A,O,L){if(typeof O=="object"&&O!==null&&O.type===K&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case z:e:{for(var ye=O.key;A!==null;){if(A.key===ye){if(ye=O.type,ye===K){if(A.tag===7){a(E,A.sibling),L=c(A,O.props.children),L.return=E,E=L;break e}}else if(A.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===Q&&il(ye)===A.type){a(E,A.sibling),L=c(A,O.props),Ci(L,O),L.return=E,E=L;break e}a(E,A);break}else t(E,A);A=A.sibling}O.type===K?(L=el(O.props.children,E.mode,L,O.key),L.return=E,E=L):(L=zs(O.type,O.key,O.props,null,E.mode,L),Ci(L,O),L.return=E,E=L)}return h(E);case M:e:{for(ye=O.key;A!==null;){if(A.key===ye)if(A.tag===4&&A.stateNode.containerInfo===O.containerInfo&&A.stateNode.implementation===O.implementation){a(E,A.sibling),L=c(A,O.children||[]),L.return=E,E=L;break e}else{a(E,A);break}else t(E,A);A=A.sibling}L=Ac(O,E.mode,L),L.return=E,E=L}return h(E);case Q:return O=il(O),Xe(E,A,O,L)}if(Ie(O))return oe(E,A,O,L);if(pe(O)){if(ye=pe(O),typeof ye!="function")throw Error(u(150));return O=ye.call(O),Se(E,A,O,L)}if(typeof O.then=="function")return Xe(E,A,Ms(O),L);if(O.$$typeof===X)return Xe(E,A,Os(E,O),L);Ds(E,O)}return typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint"?(O=""+O,A!==null&&A.tag===6?(a(E,A.sibling),L=c(A,O),L.return=E,E=L):(a(E,A),L=Nc(O,E.mode,L),L.return=E,E=L),h(E)):a(E,A)}return function(E,A,O,L){try{Ai=0;var ye=Xe(E,A,O,L);return Zl=null,ye}catch(he){if(he===Ul||he===ks)throw he;var $e=tn(29,he,null,E.mode);return $e.lanes=L,$e.return=E,$e}}}var rl=ff(!0),hf=ff(!1),ba=!1;function Zc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xa(e,t,a){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Be&2)!==0){var c=s.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),s.pending=t,t=Cs(e),Xd(e,null,a),t}return As(e,s,t,a),Cs(e)}function zi(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,ad(e,a)}}function $c(e,t){var a=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var c=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var h={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?c=o=h:o=o.next=h,a=a.next}while(a!==null);o===null?c=o=t:o=o.next=t}else c=o=t;a={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:o,shared:s.shared,callbacks:s.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Lc=!1;function Ei(){if(Lc){var e=Dl;if(e!==null)throw e}}function wi(e,t,a,s){Lc=!1;var c=e.updateQueue;ba=!1;var o=c.firstBaseUpdate,h=c.lastBaseUpdate,y=c.shared.pending;if(y!==null){c.shared.pending=null;var _=y,T=_.next;_.next=null,h===null?o=T:h.next=T,h=_;var H=e.alternate;H!==null&&(H=H.updateQueue,y=H.lastBaseUpdate,y!==h&&(y===null?H.firstBaseUpdate=T:y.next=T,H.lastBaseUpdate=_))}if(o!==null){var G=c.baseState;h=0,H=T=_=null,y=o;do{var R=y.lane&-536870913,D=R!==y.lane;if(D?(Te&R)===R:(s&R)===R){R!==0&&R===Ml&&(Lc=!0),H!==null&&(H=H.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});e:{var oe=e,Se=y;R=t;var Xe=a;switch(Se.tag){case 1:if(oe=Se.payload,typeof oe=="function"){G=oe.call(Xe,G,R);break e}G=oe;break e;case 3:oe.flags=oe.flags&-65537|128;case 0:if(oe=Se.payload,R=typeof oe=="function"?oe.call(Xe,G,R):oe,R==null)break e;G=j({},G,R);break e;case 2:ba=!0}}R=y.callback,R!==null&&(e.flags|=64,D&&(e.flags|=8192),D=c.callbacks,D===null?c.callbacks=[R]:D.push(R))}else D={lane:R,tag:y.tag,payload:y.payload,callback:y.callback,next:null},H===null?(T=H=D,_=G):H=H.next=D,h|=R;if(y=y.next,y===null){if(y=c.shared.pending,y===null)break;D=y,y=D.next,D.next=null,c.lastBaseUpdate=D,c.shared.pending=null}}while(!0);H===null&&(_=G),c.baseState=_,c.firstBaseUpdate=T,c.lastBaseUpdate=H,o===null&&(c.shared.lanes=0),Ca|=h,e.lanes=h,e.memoizedState=G}}function mf(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function pf(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)mf(a[e],t)}var Hl=S(null),Us=S(0);function vf(e,t){e=sa,te(Us,e),te(Hl,t),sa=e|t.baseLanes}function Bc(){te(Us,sa),te(Hl,Hl.current)}function qc(){sa=Us.current,U(Hl),U(Us)}var nn=S(null),yn=null;function Sa(e){var t=e.alternate;te(pt,pt.current&1),te(nn,e),yn===null&&(t===null||Hl.current!==null||t.memoizedState!==null)&&(yn=e)}function Gc(e){te(pt,pt.current),te(nn,e),yn===null&&(yn=e)}function gf(e){e.tag===22?(te(pt,pt.current),te(nn,e),yn===null&&(yn=e)):_a()}function _a(){te(pt,pt.current),te(nn,nn.current)}function an(e){U(nn),yn===e&&(yn=null),U(pt)}var pt=S(0);function Zs(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Xu(a)||Iu(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Fn=0,ze=null,Qe=null,bt=null,Hs=!1,$l=!1,cl=!1,$s=0,Oi=0,Ll=null,ey=0;function ut(){throw Error(u(321))}function Yc(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!en(e[a],t[a]))return!1;return!0}function Jc(e,t,a,s,c,o){return Fn=o,ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Z.H=e===null||e.memoizedState===null?eh:su,cl=!1,o=a(s,c),cl=!1,$l&&(o=bf(t,a,s,c)),yf(e),o}function yf(e){Z.H=Ri;var t=Qe!==null&&Qe.next!==null;if(Fn=0,bt=Qe=ze=null,Hs=!1,Oi=0,Ll=null,t)throw Error(u(300));e===null||jt||(e=e.dependencies,e!==null&&ws(e)&&(jt=!0))}function bf(e,t,a,s){ze=e;var c=0;do{if($l&&(Ll=null),Oi=0,$l=!1,25<=c)throw Error(u(301));if(c+=1,bt=Qe=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}Z.H=th,o=t(a,s)}while($l);return o}function ty(){var e=Z.H,t=e.useState()[0];return t=typeof t.then=="function"?Ti(t):t,e=e.useState()[0],(Qe!==null?Qe.memoizedState:null)!==e&&(ze.flags|=1024),t}function Kc(){var e=$s!==0;return $s=0,e}function Qc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Vc(e){if(Hs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Hs=!1}Fn=0,bt=Qe=ze=null,$l=!1,Oi=$s=0,Ll=null}function qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?ze.memoizedState=bt=e:bt=bt.next=e,bt}function vt(){if(Qe===null){var e=ze.alternate;e=e!==null?e.memoizedState:null}else e=Qe.next;var t=bt===null?ze.memoizedState:bt.next;if(t!==null)bt=t,Qe=e;else{if(e===null)throw ze.alternate===null?Error(u(467)):Error(u(310));Qe=e,e={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},bt===null?ze.memoizedState=bt=e:bt=bt.next=e}return bt}function Ls(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ti(e){var t=Oi;return Oi+=1,Ll===null&&(Ll=[]),e=uf(Ll,e,t),t=ze,(bt===null?t.memoizedState:bt.next)===null&&(t=t.alternate,Z.H=t===null||t.memoizedState===null?eh:su),e}function Bs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ti(e);if(e.$$typeof===X)return kt(e)}throw Error(u(438,String(e)))}function Xc(e){var t=null,a=ze.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var s=ze.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Ls(),ze.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),s=0;s<e;s++)a[s]=ue;return t.index++,a}function Wn(e,t){return typeof t=="function"?t(e):t}function qs(e){var t=vt();return Ic(t,Qe,e)}function Ic(e,t,a){var s=e.queue;if(s===null)throw Error(u(311));s.lastRenderedReducer=a;var c=e.baseQueue,o=s.pending;if(o!==null){if(c!==null){var h=c.next;c.next=o.next,o.next=h}t.baseQueue=c=o,s.pending=null}if(o=e.baseState,c===null)e.memoizedState=o;else{t=c.next;var y=h=null,_=null,T=t,H=!1;do{var G=T.lane&-536870913;if(G!==T.lane?(Te&G)===G:(Fn&G)===G){var R=T.revertLane;if(R===0)_!==null&&(_=_.next={lane:0,revertLane:0,gesture:null,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null}),G===Ml&&(H=!0);else if((Fn&R)===R){T=T.next,R===Ml&&(H=!0);continue}else G={lane:0,revertLane:T.revertLane,gesture:null,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},_===null?(y=_=G,h=o):_=_.next=G,ze.lanes|=R,Ca|=R;G=T.action,cl&&a(o,G),o=T.hasEagerState?T.eagerState:a(o,G)}else R={lane:G,revertLane:T.revertLane,gesture:T.gesture,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},_===null?(y=_=R,h=o):_=_.next=R,ze.lanes|=G,Ca|=G;T=T.next}while(T!==null&&T!==t);if(_===null?h=o:_.next=y,!en(o,e.memoizedState)&&(jt=!0,H&&(a=Dl,a!==null)))throw a;e.memoizedState=o,e.baseState=h,e.baseQueue=_,s.lastRenderedState=o}return c===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Pc(e){var t=vt(),a=t.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=e;var s=a.dispatch,c=a.pending,o=t.memoizedState;if(c!==null){a.pending=null;var h=c=c.next;do o=e(o,h.action),h=h.next;while(h!==c);en(o,t.memoizedState)||(jt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,s]}function jf(e,t,a){var s=ze,c=vt(),o=Re;if(o){if(a===void 0)throw Error(u(407));a=a()}else a=t();var h=!en((Qe||c).memoizedState,a);if(h&&(c.memoizedState=a,jt=!0),c=c.queue,eu(_f.bind(null,s,c,e),[e]),c.getSnapshot!==t||h||bt!==null&&bt.memoizedState.tag&1){if(s.flags|=2048,Bl(9,{destroy:void 0},Sf.bind(null,s,c,a,t),null),Pe===null)throw Error(u(349));o||(Fn&127)!==0||xf(s,t,a)}return a}function xf(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=ze.updateQueue,t===null?(t=Ls(),ze.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Sf(e,t,a,s){t.value=a,t.getSnapshot=s,Nf(t)&&Af(e)}function _f(e,t,a){return a(function(){Nf(t)&&Af(e)})}function Nf(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!en(e,a)}catch{return!0}}function Af(e){var t=Wa(e,2);t!==null&&Pt(t,e,2)}function Fc(e){var t=qt();if(typeof e=="function"){var a=e;if(e=a(),cl){Un(!0);try{a()}finally{Un(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wn,lastRenderedState:e},t}function Cf(e,t,a,s){return e.baseState=a,Ic(e,Qe,typeof s=="function"?s:Wn)}function ny(e,t,a,s,c){if(Js(e))throw Error(u(485));if(e=t.action,e!==null){var o={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){o.listeners.push(h)}};Z.T!==null?a(!0):o.isTransition=!1,s(o),a=t.pending,a===null?(o.next=t.pending=o,zf(t,o)):(o.next=a.next,t.pending=a.next=o)}}function zf(e,t){var a=t.action,s=t.payload,c=e.state;if(t.isTransition){var o=Z.T,h={};Z.T=h;try{var y=a(c,s),_=Z.S;_!==null&&_(h,y),Ef(e,t,y)}catch(T){Wc(e,t,T)}finally{o!==null&&h.types!==null&&(o.types=h.types),Z.T=o}}else try{o=a(c,s),Ef(e,t,o)}catch(T){Wc(e,t,T)}}function Ef(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){wf(e,t,s)},function(s){return Wc(e,t,s)}):wf(e,t,a)}function wf(e,t,a){t.status="fulfilled",t.value=a,Of(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,zf(e,a)))}function Wc(e,t,a){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=a,Of(t),t=t.next;while(t!==s)}e.action=null}function Of(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Tf(e,t){return t}function kf(e,t){if(Re){var a=Pe.formState;if(a!==null){e:{var s=ze;if(Re){if(We){t:{for(var c=We,o=gn;c.nodeType!==8;){if(!o){c=null;break t}if(c=bn(c.nextSibling),c===null){c=null;break t}}o=c.data,c=o==="F!"||o==="F"?c:null}if(c){We=bn(c.nextSibling),s=c.data==="F!";break e}}ga(s)}s=!1}s&&(t=a[0])}}return a=qt(),a.memoizedState=a.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tf,lastRenderedState:t},a.queue=s,a=Pf.bind(null,ze,s),s.dispatch=a,s=Fc(!1),o=iu.bind(null,ze,!1,s.queue),s=qt(),c={state:t,dispatch:null,action:e,pending:null},s.queue=c,a=ny.bind(null,ze,c,o,a),c.dispatch=a,s.memoizedState=e,[t,a,!1]}function Rf(e){var t=vt();return Mf(t,Qe,e)}function Mf(e,t,a){if(t=Ic(e,t,Tf)[0],e=qs(Wn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Ti(t)}catch(h){throw h===Ul?ks:h}else s=t;t=vt();var c=t.queue,o=c.dispatch;return a!==t.memoizedState&&(ze.flags|=2048,Bl(9,{destroy:void 0},ay.bind(null,c,a),null)),[s,o,e]}function ay(e,t){e.action=t}function Df(e){var t=vt(),a=Qe;if(a!==null)return Mf(t,a,e);vt(),t=t.memoizedState,a=vt();var s=a.queue.dispatch;return a.memoizedState=e,[t,s,!1]}function Bl(e,t,a,s){return e={tag:e,create:a,deps:s,inst:t,next:null},t=ze.updateQueue,t===null&&(t=Ls(),ze.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(s=a.next,a.next=e,e.next=s,t.lastEffect=e),e}function Uf(){return vt().memoizedState}function Gs(e,t,a,s){var c=qt();ze.flags|=e,c.memoizedState=Bl(1|t,{destroy:void 0},a,s===void 0?null:s)}function Ys(e,t,a,s){var c=vt();s=s===void 0?null:s;var o=c.memoizedState.inst;Qe!==null&&s!==null&&Yc(s,Qe.memoizedState.deps)?c.memoizedState=Bl(t,o,a,s):(ze.flags|=e,c.memoizedState=Bl(1|t,o,a,s))}function Zf(e,t){Gs(8390656,8,e,t)}function eu(e,t){Ys(2048,8,e,t)}function ly(e){ze.flags|=4;var t=ze.updateQueue;if(t===null)t=Ls(),ze.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Hf(e){var t=vt().memoizedState;return ly({ref:t,nextImpl:e}),function(){if((Be&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function $f(e,t){return Ys(4,2,e,t)}function Lf(e,t){return Ys(4,4,e,t)}function Bf(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function qf(e,t,a){a=a!=null?a.concat([e]):null,Ys(4,4,Bf.bind(null,t,e),a)}function tu(){}function Gf(e,t){var a=vt();t=t===void 0?null:t;var s=a.memoizedState;return t!==null&&Yc(t,s[1])?s[0]:(a.memoizedState=[e,t],e)}function Yf(e,t){var a=vt();t=t===void 0?null:t;var s=a.memoizedState;if(t!==null&&Yc(t,s[1]))return s[0];if(s=e(),cl){Un(!0);try{e()}finally{Un(!1)}}return a.memoizedState=[s,t],s}function nu(e,t,a){return a===void 0||(Fn&1073741824)!==0&&(Te&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Jh(),ze.lanes|=e,Ca|=e,a)}function Jf(e,t,a,s){return en(a,t)?a:Hl.current!==null?(e=nu(e,a,s),en(e,t)||(jt=!0),e):(Fn&42)===0||(Fn&1073741824)!==0&&(Te&261930)===0?(jt=!0,e.memoizedState=a):(e=Jh(),ze.lanes|=e,Ca|=e,t)}function Kf(e,t,a,s,c){var o=F.p;F.p=o!==0&&8>o?o:8;var h=Z.T,y={};Z.T=y,iu(e,!1,t,a);try{var _=c(),T=Z.S;if(T!==null&&T(y,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var H=Wg(_,s);ki(e,t,H,rn(e))}else ki(e,t,s,rn(e))}catch(G){ki(e,t,{then:function(){},status:"rejected",reason:G},rn())}finally{F.p=o,h!==null&&y.types!==null&&(h.types=y.types),Z.T=h}}function iy(){}function au(e,t,a,s){if(e.tag!==5)throw Error(u(476));var c=Qf(e).queue;Kf(e,c,t,fe,a===null?iy:function(){return Vf(e),a(s)})}function Qf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wn,lastRenderedState:fe},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Vf(e){var t=Qf(e);t.next===null&&(t=e.alternate.memoizedState),ki(e,t.next.queue,{},rn())}function lu(){return kt(Xi)}function Xf(){return vt().memoizedState}function If(){return vt().memoizedState}function sy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=rn();e=ja(a);var s=xa(t,e,a);s!==null&&(Pt(s,t,a),zi(s,t,a)),t={cache:Rc()},e.payload=t;return}t=t.return}}function ry(e,t,a){var s=rn();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Js(e)?Ff(t,a):(a=Sc(e,t,a,s),a!==null&&(Pt(a,e,s),Wf(a,t,s)))}function Pf(e,t,a){var s=rn();ki(e,t,a,s)}function ki(e,t,a,s){var c={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Js(e))Ff(t,c);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var h=t.lastRenderedState,y=o(h,a);if(c.hasEagerState=!0,c.eagerState=y,en(y,h))return As(e,t,c,0),Pe===null&&Ns(),!1}catch{}if(a=Sc(e,t,c,s),a!==null)return Pt(a,e,s),Wf(a,t,s),!0}return!1}function iu(e,t,a,s){if(s={lane:2,revertLane:Zu(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Js(e)){if(t)throw Error(u(479))}else t=Sc(e,a,s,2),t!==null&&Pt(t,e,2)}function Js(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function Ff(e,t){$l=Hs=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Wf(e,t,a){if((a&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,ad(e,a)}}var Ri={readContext:kt,use:Bs,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut};Ri.useEffectEvent=ut;var eh={readContext:kt,use:Bs,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:kt,useEffect:Zf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Gs(4194308,4,Bf.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Gs(4194308,4,e,t)},useInsertionEffect:function(e,t){Gs(4,2,e,t)},useMemo:function(e,t){var a=qt();t=t===void 0?null:t;var s=e();if(cl){Un(!0);try{e()}finally{Un(!1)}}return a.memoizedState=[s,t],s},useReducer:function(e,t,a){var s=qt();if(a!==void 0){var c=a(t);if(cl){Un(!0);try{a(t)}finally{Un(!1)}}}else c=t;return s.memoizedState=s.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},s.queue=e,e=e.dispatch=ry.bind(null,ze,e),[s.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:function(e){e=Fc(e);var t=e.queue,a=Pf.bind(null,ze,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:tu,useDeferredValue:function(e,t){var a=qt();return nu(a,e,t)},useTransition:function(){var e=Fc(!1);return e=Kf.bind(null,ze,e.queue,!0,!1),qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var s=ze,c=qt();if(Re){if(a===void 0)throw Error(u(407));a=a()}else{if(a=t(),Pe===null)throw Error(u(349));(Te&127)!==0||xf(s,t,a)}c.memoizedState=a;var o={value:a,getSnapshot:t};return c.queue=o,Zf(_f.bind(null,s,o,e),[e]),s.flags|=2048,Bl(9,{destroy:void 0},Sf.bind(null,s,o,a,t),null),a},useId:function(){var e=qt(),t=Pe.identifierPrefix;if(Re){var a=Hn,s=Zn;a=(s&~(1<<32-Bt(s)-1)).toString(32)+a,t="_"+t+"R_"+a,a=$s++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=ey++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:lu,useFormState:kf,useActionState:kf,useOptimistic:function(e){var t=qt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=iu.bind(null,ze,!0,a),a.dispatch=t,[e,t]},useMemoCache:Xc,useCacheRefresh:function(){return qt().memoizedState=sy.bind(null,ze)},useEffectEvent:function(e){var t=qt(),a={impl:e};return t.memoizedState=a,function(){if((Be&2)!==0)throw Error(u(440));return a.impl.apply(void 0,arguments)}}},su={readContext:kt,use:Bs,useCallback:Gf,useContext:kt,useEffect:eu,useImperativeHandle:qf,useInsertionEffect:$f,useLayoutEffect:Lf,useMemo:Yf,useReducer:qs,useRef:Uf,useState:function(){return qs(Wn)},useDebugValue:tu,useDeferredValue:function(e,t){var a=vt();return Jf(a,Qe.memoizedState,e,t)},useTransition:function(){var e=qs(Wn)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:Ti(e),t]},useSyncExternalStore:jf,useId:Xf,useHostTransitionStatus:lu,useFormState:Rf,useActionState:Rf,useOptimistic:function(e,t){var a=vt();return Cf(a,Qe,e,t)},useMemoCache:Xc,useCacheRefresh:If};su.useEffectEvent=Hf;var th={readContext:kt,use:Bs,useCallback:Gf,useContext:kt,useEffect:eu,useImperativeHandle:qf,useInsertionEffect:$f,useLayoutEffect:Lf,useMemo:Yf,useReducer:Pc,useRef:Uf,useState:function(){return Pc(Wn)},useDebugValue:tu,useDeferredValue:function(e,t){var a=vt();return Qe===null?nu(a,e,t):Jf(a,Qe.memoizedState,e,t)},useTransition:function(){var e=Pc(Wn)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:Ti(e),t]},useSyncExternalStore:jf,useId:Xf,useHostTransitionStatus:lu,useFormState:Df,useActionState:Df,useOptimistic:function(e,t){var a=vt();return Qe!==null?Cf(a,Qe,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Xc,useCacheRefresh:If};th.useEffectEvent=Hf;function ru(e,t,a,s){t=e.memoizedState,a=a(s,t),a=a==null?t:j({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var cu={enqueueSetState:function(e,t,a){e=e._reactInternals;var s=rn(),c=ja(s);c.payload=t,a!=null&&(c.callback=a),t=xa(e,c,s),t!==null&&(Pt(t,e,s),zi(t,e,s))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var s=rn(),c=ja(s);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=xa(e,c,s),t!==null&&(Pt(t,e,s),zi(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=rn(),s=ja(a);s.tag=2,t!=null&&(s.callback=t),t=xa(e,s,a),t!==null&&(Pt(t,e,a),zi(t,e,a))}};function nh(e,t,a,s,c,o,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,o,h):t.prototype&&t.prototype.isPureReactComponent?!bi(a,s)||!bi(c,o):!0}function ah(e,t,a,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,s),t.state!==e&&cu.enqueueReplaceState(t,t.state,null)}function ul(e,t){var a=t;if("ref"in t){a={};for(var s in t)s!=="ref"&&(a[s]=t[s])}if(e=e.defaultProps){a===t&&(a=j({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function lh(e){_s(e)}function ih(e){console.error(e)}function sh(e){_s(e)}function Ks(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function rh(e,t,a){try{var s=e.onCaughtError;s(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function uu(e,t,a){return a=ja(a),a.tag=3,a.payload={element:null},a.callback=function(){Ks(e,t)},a}function ch(e){return e=ja(e),e.tag=3,e}function uh(e,t,a,s){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var o=s.value;e.payload=function(){return c(o)},e.callback=function(){rh(t,a,s)}}var h=a.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){rh(t,a,s),typeof c!="function"&&(za===null?za=new Set([this]):za.add(this));var y=s.stack;this.componentDidCatch(s.value,{componentStack:y!==null?y:""})})}function cy(e,t,a,s,c){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=a.alternate,t!==null&&Rl(t,a,c,!0),a=nn.current,a!==null){switch(a.tag){case 31:case 13:return yn===null?lr():a.alternate===null&&ot===0&&(ot=3),a.flags&=-257,a.flags|=65536,a.lanes=c,s===Rs?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([s]):t.add(s),Mu(e,s,c)),!1;case 22:return a.flags|=65536,s===Rs?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([s]):a.add(s)),Mu(e,s,c)),!1}throw Error(u(435,a.tag))}return Mu(e,s,c),lr(),!1}if(Re)return t=nn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,s!==Ec&&(e=Error(u(422),{cause:s}),Si(mn(e,a)))):(s!==Ec&&(t=Error(u(423),{cause:s}),Si(mn(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,s=mn(s,a),c=uu(e.stateNode,s,c),$c(e,c),ot!==4&&(ot=2)),!1;var o=Error(u(520),{cause:s});if(o=mn(o,a),Bi===null?Bi=[o]:Bi.push(o),ot!==4&&(ot=2),t===null)return!0;s=mn(s,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=uu(a.stateNode,s,e),$c(a,e),!1;case 1:if(t=a.type,o=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(za===null||!za.has(o))))return a.flags|=65536,c&=-c,a.lanes|=c,c=ch(c),uh(c,e,a,s),$c(a,c),!1}a=a.return}while(a!==null);return!1}var ou=Error(u(461)),jt=!1;function Rt(e,t,a,s){t.child=e===null?hf(t,null,a,s):rl(t,e.child,a,s)}function oh(e,t,a,s,c){a=a.render;var o=t.ref;if("ref"in s){var h={};for(var y in s)y!=="ref"&&(h[y]=s[y])}else h=s;return al(t),s=Jc(e,t,a,h,o,c),y=Kc(),e!==null&&!jt?(Qc(e,t,c),ea(e,t,c)):(Re&&y&&Cc(t),t.flags|=1,Rt(e,t,s,c),t.child)}function dh(e,t,a,s,c){if(e===null){var o=a.type;return typeof o=="function"&&!_c(o)&&o.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=o,fh(e,t,o,s,c)):(e=zs(a.type,null,s,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!yu(e,c)){var h=o.memoizedProps;if(a=a.compare,a=a!==null?a:bi,a(h,s)&&e.ref===t.ref)return ea(e,t,c)}return t.flags|=1,e=Vn(o,s),e.ref=t.ref,e.return=t,t.child=e}function fh(e,t,a,s,c){if(e!==null){var o=e.memoizedProps;if(bi(o,s)&&e.ref===t.ref)if(jt=!1,t.pendingProps=s=o,yu(e,c))(e.flags&131072)!==0&&(jt=!0);else return t.lanes=e.lanes,ea(e,t,c)}return du(e,t,a,s,c)}function hh(e,t,a,s){var c=s.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|a:a,e!==null){for(s=t.child=e.child,c=0;s!==null;)c=c|s.lanes|s.childLanes,s=s.sibling;s=c&~o}else s=0,t.child=null;return mh(e,t,o,a,s)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ts(t,o!==null?o.cachePool:null),o!==null?vf(t,o):Bc(),gf(t);else return s=t.lanes=536870912,mh(e,t,o!==null?o.baseLanes|a:a,a,s)}else o!==null?(Ts(t,o.cachePool),vf(t,o),_a(),t.memoizedState=null):(e!==null&&Ts(t,null),Bc(),_a());return Rt(e,t,c,a),t.child}function Mi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function mh(e,t,a,s,c){var o=Dc();return o=o===null?null:{parent:yt._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&Ts(t,null),Bc(),gf(t),e!==null&&Rl(e,t,s,!0),t.childLanes=c,null}function Qs(e,t){return t=Xs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ph(e,t,a){return rl(t,e.child,null,a),e=Qs(t,t.pendingProps),e.flags|=2,an(t),t.memoizedState=null,e}function uy(e,t,a){var s=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Re){if(s.mode==="hidden")return e=Qs(t,s),t.lanes=536870912,Mi(null,e);if(Gc(t),(e=We)?(e=zm(e,gn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:pa!==null?{id:Zn,overflow:Hn}:null,retryLane:536870912,hydrationErrors:null},a=Pd(e),a.return=t,t.child=a,Tt=t,We=null)):e=null,e===null)throw ga(t);return t.lanes=536870912,null}return Qs(t,s)}var o=e.memoizedState;if(o!==null){var h=o.dehydrated;if(Gc(t),c)if(t.flags&256)t.flags&=-257,t=ph(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(jt||Rl(e,t,a,!1),c=(a&e.childLanes)!==0,jt||c){if(s=Pe,s!==null&&(h=ld(s,a),h!==0&&h!==o.retryLane))throw o.retryLane=h,Wa(e,h),Pt(s,e,h),ou;lr(),t=ph(e,t,a)}else e=o.treeContext,We=bn(h.nextSibling),Tt=t,Re=!0,va=null,gn=!1,e!==null&&ef(t,e),t=Qs(t,s),t.flags|=4096;return t}return e=Vn(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Vs(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(u(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function du(e,t,a,s,c){return al(t),a=Jc(e,t,a,s,void 0,c),s=Kc(),e!==null&&!jt?(Qc(e,t,c),ea(e,t,c)):(Re&&s&&Cc(t),t.flags|=1,Rt(e,t,a,c),t.child)}function vh(e,t,a,s,c,o){return al(t),t.updateQueue=null,a=bf(t,s,a,c),yf(e),s=Kc(),e!==null&&!jt?(Qc(e,t,o),ea(e,t,o)):(Re&&s&&Cc(t),t.flags|=1,Rt(e,t,a,o),t.child)}function gh(e,t,a,s,c){if(al(t),t.stateNode===null){var o=wl,h=a.contextType;typeof h=="object"&&h!==null&&(o=kt(h)),o=new a(s,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=cu,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=s,o.state=t.memoizedState,o.refs={},Zc(t),h=a.contextType,o.context=typeof h=="object"&&h!==null?kt(h):wl,o.state=t.memoizedState,h=a.getDerivedStateFromProps,typeof h=="function"&&(ru(t,a,h,s),o.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(h=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),h!==o.state&&cu.enqueueReplaceState(o,o.state,null),wi(t,s,o,c),Ei(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){o=t.stateNode;var y=t.memoizedProps,_=ul(a,y);o.props=_;var T=o.context,H=a.contextType;h=wl,typeof H=="object"&&H!==null&&(h=kt(H));var G=a.getDerivedStateFromProps;H=typeof G=="function"||typeof o.getSnapshotBeforeUpdate=="function",y=t.pendingProps!==y,H||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(y||T!==h)&&ah(t,o,s,h),ba=!1;var R=t.memoizedState;o.state=R,wi(t,s,o,c),Ei(),T=t.memoizedState,y||R!==T||ba?(typeof G=="function"&&(ru(t,a,G,s),T=t.memoizedState),(_=ba||nh(t,a,_,s,R,T,h))?(H||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=T),o.props=s,o.state=T,o.context=h,s=_):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{o=t.stateNode,Hc(e,t),h=t.memoizedProps,H=ul(a,h),o.props=H,G=t.pendingProps,R=o.context,T=a.contextType,_=wl,typeof T=="object"&&T!==null&&(_=kt(T)),y=a.getDerivedStateFromProps,(T=typeof y=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(h!==G||R!==_)&&ah(t,o,s,_),ba=!1,R=t.memoizedState,o.state=R,wi(t,s,o,c),Ei();var D=t.memoizedState;h!==G||R!==D||ba||e!==null&&e.dependencies!==null&&ws(e.dependencies)?(typeof y=="function"&&(ru(t,a,y,s),D=t.memoizedState),(H=ba||nh(t,a,H,s,R,D,_)||e!==null&&e.dependencies!==null&&ws(e.dependencies))?(T||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,D,_),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,D,_)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||h===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=D),o.props=s,o.state=D,o.context=_,s=H):(typeof o.componentDidUpdate!="function"||h===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),s=!1)}return o=s,Vs(e,t),s=(t.flags&128)!==0,o||s?(o=t.stateNode,a=s&&typeof a.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&s?(t.child=rl(t,e.child,null,c),t.child=rl(t,null,a,c)):Rt(e,t,a,c),t.memoizedState=o.state,e=t.child):e=ea(e,t,c),e}function yh(e,t,a,s){return tl(),t.flags|=256,Rt(e,t,a,s),t.child}var fu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hu(e){return{baseLanes:e,cachePool:rf()}}function mu(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=sn),e}function bh(e,t,a){var s=t.pendingProps,c=!1,o=(t.flags&128)!==0,h;if((h=o)||(h=e!==null&&e.memoizedState===null?!1:(pt.current&2)!==0),h&&(c=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(Re){if(c?Sa(t):_a(),(e=We)?(e=zm(e,gn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:pa!==null?{id:Zn,overflow:Hn}:null,retryLane:536870912,hydrationErrors:null},a=Pd(e),a.return=t,t.child=a,Tt=t,We=null)):e=null,e===null)throw ga(t);return Iu(e)?t.lanes=32:t.lanes=536870912,null}var y=s.children;return s=s.fallback,c?(_a(),c=t.mode,y=Xs({mode:"hidden",children:y},c),s=el(s,c,a,null),y.return=t,s.return=t,y.sibling=s,t.child=y,s=t.child,s.memoizedState=hu(a),s.childLanes=mu(e,h,a),t.memoizedState=fu,Mi(null,s)):(Sa(t),pu(t,y))}var _=e.memoizedState;if(_!==null&&(y=_.dehydrated,y!==null)){if(o)t.flags&256?(Sa(t),t.flags&=-257,t=vu(e,t,a)):t.memoizedState!==null?(_a(),t.child=e.child,t.flags|=128,t=null):(_a(),y=s.fallback,c=t.mode,s=Xs({mode:"visible",children:s.children},c),y=el(y,c,a,null),y.flags|=2,s.return=t,y.return=t,s.sibling=y,t.child=s,rl(t,e.child,null,a),s=t.child,s.memoizedState=hu(a),s.childLanes=mu(e,h,a),t.memoizedState=fu,t=Mi(null,s));else if(Sa(t),Iu(y)){if(h=y.nextSibling&&y.nextSibling.dataset,h)var T=h.dgst;h=T,s=Error(u(419)),s.stack="",s.digest=h,Si({value:s,source:null,stack:null}),t=vu(e,t,a)}else if(jt||Rl(e,t,a,!1),h=(a&e.childLanes)!==0,jt||h){if(h=Pe,h!==null&&(s=ld(h,a),s!==0&&s!==_.retryLane))throw _.retryLane=s,Wa(e,s),Pt(h,e,s),ou;Xu(y)||lr(),t=vu(e,t,a)}else Xu(y)?(t.flags|=192,t.child=e.child,t=null):(e=_.treeContext,We=bn(y.nextSibling),Tt=t,Re=!0,va=null,gn=!1,e!==null&&ef(t,e),t=pu(t,s.children),t.flags|=4096);return t}return c?(_a(),y=s.fallback,c=t.mode,_=e.child,T=_.sibling,s=Vn(_,{mode:"hidden",children:s.children}),s.subtreeFlags=_.subtreeFlags&65011712,T!==null?y=Vn(T,y):(y=el(y,c,a,null),y.flags|=2),y.return=t,s.return=t,s.sibling=y,t.child=s,Mi(null,s),s=t.child,y=e.child.memoizedState,y===null?y=hu(a):(c=y.cachePool,c!==null?(_=yt._currentValue,c=c.parent!==_?{parent:_,pool:_}:c):c=rf(),y={baseLanes:y.baseLanes|a,cachePool:c}),s.memoizedState=y,s.childLanes=mu(e,h,a),t.memoizedState=fu,Mi(e.child,s)):(Sa(t),a=e.child,e=a.sibling,a=Vn(a,{mode:"visible",children:s.children}),a.return=t,a.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=a,t.memoizedState=null,a)}function pu(e,t){return t=Xs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Xs(e,t){return e=tn(22,e,null,t),e.lanes=0,e}function vu(e,t,a){return rl(t,e.child,null,a),e=pu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jh(e,t,a){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Tc(e.return,t,a)}function gu(e,t,a,s,c,o){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:c,treeForkCount:o}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=s,h.tail=a,h.tailMode=c,h.treeForkCount=o)}function xh(e,t,a){var s=t.pendingProps,c=s.revealOrder,o=s.tail;s=s.children;var h=pt.current,y=(h&2)!==0;if(y?(h=h&1|2,t.flags|=128):h&=1,te(pt,h),Rt(e,t,s,a),s=Re?xi:0,!y&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&jh(e,a,t);else if(e.tag===19)jh(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&Zs(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),gu(t,!1,c,a,o,s);break;case"backwards":case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Zs(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}gu(t,!0,a,null,o,s);break;case"together":gu(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function ea(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Ca|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Rl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,a=Vn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Vn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function yu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ws(e)))}function oy(e,t,a){switch(t.tag){case 3:He(t,t.stateNode.containerInfo),ya(t,yt,e.memoizedState.cache),tl();break;case 27:case 5:$t(t);break;case 4:He(t,t.stateNode.containerInfo);break;case 10:ya(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Gc(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Sa(t),t.flags|=128,null):(a&t.child.childLanes)!==0?bh(e,t,a):(Sa(t),e=ea(e,t,a),e!==null?e.sibling:null);Sa(t);break;case 19:var c=(e.flags&128)!==0;if(s=(a&t.childLanes)!==0,s||(Rl(e,t,a,!1),s=(a&t.childLanes)!==0),c){if(s)return xh(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),te(pt,pt.current),s)break;return null;case 22:return t.lanes=0,hh(e,t,a,t.pendingProps);case 24:ya(t,yt,e.memoizedState.cache)}return ea(e,t,a)}function Sh(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)jt=!0;else{if(!yu(e,a)&&(t.flags&128)===0)return jt=!1,oy(e,t,a);jt=(e.flags&131072)!==0}else jt=!1,Re&&(t.flags&1048576)!==0&&Wd(t,xi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=il(t.elementType),t.type=e,typeof e=="function")_c(e)?(s=ul(e,s),t.tag=1,t=gh(null,t,e,s,a)):(t.tag=0,t=du(null,t,e,s,a));else{if(e!=null){var c=e.$$typeof;if(c===se){t.tag=11,t=oh(null,t,e,s,a);break e}else if(c===V){t.tag=14,t=dh(null,t,e,s,a);break e}}throw t=tt(e)||e,Error(u(306,t,""))}}return t;case 0:return du(e,t,t.type,t.pendingProps,a);case 1:return s=t.type,c=ul(s,t.pendingProps),gh(e,t,s,c,a);case 3:e:{if(He(t,t.stateNode.containerInfo),e===null)throw Error(u(387));s=t.pendingProps;var o=t.memoizedState;c=o.element,Hc(e,t),wi(t,s,null,a);var h=t.memoizedState;if(s=h.cache,ya(t,yt,s),s!==o.cache&&kc(t,[yt],a,!0),Ei(),s=h.element,o.isDehydrated)if(o={element:s,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=yh(e,t,s,a);break e}else if(s!==c){c=mn(Error(u(424)),t),Si(c),t=yh(e,t,s,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,We=bn(e.firstChild),Tt=t,Re=!0,va=null,gn=!0,a=hf(t,null,s,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(tl(),s===c){t=ea(e,t,a);break e}Rt(e,t,s,a)}t=t.child}return t;case 26:return Vs(e,t),e===null?(a=Rm(t.type,null,t.pendingProps,null))?t.memoizedState=a:Re||(a=t.type,e=t.pendingProps,s=dr(xe.current).createElement(a),s[Ot]=t,s[Jt]=e,Mt(s,a,e),Et(s),t.stateNode=s):t.memoizedState=Rm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return $t(t),e===null&&Re&&(s=t.stateNode=Om(t.type,t.pendingProps,xe.current),Tt=t,gn=!0,c=We,Ta(t.type)?(Pu=c,We=bn(s.firstChild)):We=c),Rt(e,t,t.pendingProps.children,a),Vs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Re&&((c=s=We)&&(s=Ly(s,t.type,t.pendingProps,gn),s!==null?(t.stateNode=s,Tt=t,We=bn(s.firstChild),gn=!1,c=!0):c=!1),c||ga(t)),$t(t),c=t.type,o=t.pendingProps,h=e!==null?e.memoizedProps:null,s=o.children,Ku(c,o)?s=null:h!==null&&Ku(c,h)&&(t.flags|=32),t.memoizedState!==null&&(c=Jc(e,t,ty,null,null,a),Xi._currentValue=c),Vs(e,t),Rt(e,t,s,a),t.child;case 6:return e===null&&Re&&((e=a=We)&&(a=By(a,t.pendingProps,gn),a!==null?(t.stateNode=a,Tt=t,We=null,e=!0):e=!1),e||ga(t)),null;case 13:return bh(e,t,a);case 4:return He(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=rl(t,null,s,a):Rt(e,t,s,a),t.child;case 11:return oh(e,t,t.type,t.pendingProps,a);case 7:return Rt(e,t,t.pendingProps,a),t.child;case 8:return Rt(e,t,t.pendingProps.children,a),t.child;case 12:return Rt(e,t,t.pendingProps.children,a),t.child;case 10:return s=t.pendingProps,ya(t,t.type,s.value),Rt(e,t,s.children,a),t.child;case 9:return c=t.type._context,s=t.pendingProps.children,al(t),c=kt(c),s=s(c),t.flags|=1,Rt(e,t,s,a),t.child;case 14:return dh(e,t,t.type,t.pendingProps,a);case 15:return fh(e,t,t.type,t.pendingProps,a);case 19:return xh(e,t,a);case 31:return uy(e,t,a);case 22:return hh(e,t,a,t.pendingProps);case 24:return al(t),s=kt(yt),e===null?(c=Dc(),c===null&&(c=Pe,o=Rc(),c.pooledCache=o,o.refCount++,o!==null&&(c.pooledCacheLanes|=a),c=o),t.memoizedState={parent:s,cache:c},Zc(t),ya(t,yt,c)):((e.lanes&a)!==0&&(Hc(e,t),wi(t,null,null,a),Ei()),c=e.memoizedState,o=t.memoizedState,c.parent!==s?(c={parent:s,cache:s},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),ya(t,yt,s)):(s=o.cache,ya(t,yt,s),s!==c.cache&&kc(t,[yt],a,!0))),Rt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function ta(e){e.flags|=4}function bu(e,t,a,s,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Xh())e.flags|=8192;else throw sl=Rs,Uc}else e.flags&=-16777217}function _h(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Hm(t))if(Xh())e.flags|=8192;else throw sl=Rs,Uc}function Is(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?fs():536870912,e.lanes|=t,Jl|=t)}function Di(e,t){if(!Re)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function et(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,s=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags&65011712,s|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=a,t}function dy(e,t,a){var s=t.pendingProps;switch(zc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return et(t),null;case 1:return et(t),null;case 3:return a=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Pn(yt),Ze(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(kl(t)?ta(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,wc())),et(t),null;case 26:var c=t.type,o=t.memoizedState;return e===null?(ta(t),o!==null?(et(t),_h(t,o)):(et(t),bu(t,c,null,s,a))):o?o!==e.memoizedState?(ta(t),et(t),_h(t,o)):(et(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&ta(t),et(t),bu(t,c,e,s,a)),null;case 27:if(Rn(t),a=xe.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ta(t);else{if(!s){if(t.stateNode===null)throw Error(u(166));return et(t),null}e=re.current,kl(t)?tf(t):(e=Om(c,s,a),t.stateNode=e,ta(t))}return et(t),null;case 5:if(Rn(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ta(t);else{if(!s){if(t.stateNode===null)throw Error(u(166));return et(t),null}if(o=re.current,kl(t))tf(t);else{var h=dr(xe.current);switch(o){case 1:o=h.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:o=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":o=h.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":o=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":o=h.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof s.is=="string"?h.createElement("select",{is:s.is}):h.createElement("select"),s.multiple?o.multiple=!0:s.size&&(o.size=s.size);break;default:o=typeof s.is=="string"?h.createElement(c,{is:s.is}):h.createElement(c)}}o[Ot]=t,o[Jt]=s;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)o.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=o;e:switch(Mt(o,c,s),c){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&ta(t)}}return et(t),bu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&ta(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(u(166));if(e=xe.current,kl(t)){if(e=t.stateNode,a=t.memoizedProps,s=null,c=Tt,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}e[Ot]=t,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||bm(e.nodeValue,a)),e||ga(t,!0)}else e=dr(e).createTextNode(s),e[Ot]=t,t.stateNode=e}return et(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(s=kl(t),a!==null){if(e===null){if(!s)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Ot]=t}else tl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;et(t),e=!1}else a=wc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(an(t),t):(an(t),null);if((t.flags&128)!==0)throw Error(u(558))}return et(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=kl(t),s!==null&&s.dehydrated!==null){if(e===null){if(!c)throw Error(u(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(u(317));c[Ot]=t}else tl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;et(t),c=!1}else c=wc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(an(t),t):(an(t),null)}return an(t),(t.flags&128)!==0?(t.lanes=a,t):(a=s!==null,e=e!==null&&e.memoizedState!==null,a&&(s=t.child,c=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(c=s.alternate.memoizedState.cachePool.pool),o=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(o=s.memoizedState.cachePool.pool),o!==c&&(s.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Is(t,t.updateQueue),et(t),null);case 4:return Ze(),e===null&&Bu(t.stateNode.containerInfo),et(t),null;case 10:return Pn(t.type),et(t),null;case 19:if(U(pt),s=t.memoizedState,s===null)return et(t),null;if(c=(t.flags&128)!==0,o=s.rendering,o===null)if(c)Di(s,!1);else{if(ot!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=Zs(e),o!==null){for(t.flags|=128,Di(s,!1),e=o.updateQueue,t.updateQueue=e,Is(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Id(a,e),a=a.sibling;return te(pt,pt.current&1|2),Re&&Xn(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&ne()>tr&&(t.flags|=128,c=!0,Di(s,!1),t.lanes=4194304)}else{if(!c)if(e=Zs(o),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Is(t,e),Di(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Re)return et(t),null}else 2*ne()-s.renderingStartTime>tr&&a!==536870912&&(t.flags|=128,c=!0,Di(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(e=s.last,e!==null?e.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ne(),e.sibling=null,a=pt.current,te(pt,c?a&1|2:a&1),Re&&Xn(t,s.treeForkCount),e):(et(t),null);case 22:case 23:return an(t),qc(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(a&536870912)!==0&&(t.flags&128)===0&&(et(t),t.subtreeFlags&6&&(t.flags|=8192)):et(t),a=t.updateQueue,a!==null&&Is(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==a&&(t.flags|=2048),e!==null&&U(ll),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Pn(yt),et(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function fy(e,t){switch(zc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Pn(yt),Ze(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Rn(t),null;case 31:if(t.memoizedState!==null){if(an(t),t.alternate===null)throw Error(u(340));tl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(an(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));tl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(pt),null;case 4:return Ze(),null;case 10:return Pn(t.type),null;case 22:case 23:return an(t),qc(),e!==null&&U(ll),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Pn(yt),null;case 25:return null;default:return null}}function Nh(e,t){switch(zc(t),t.tag){case 3:Pn(yt),Ze();break;case 26:case 27:case 5:Rn(t);break;case 4:Ze();break;case 31:t.memoizedState!==null&&an(t);break;case 13:an(t);break;case 19:U(pt);break;case 10:Pn(t.type);break;case 22:case 23:an(t),qc(),e!==null&&U(ll);break;case 24:Pn(yt)}}function Ui(e,t){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var c=s.next;a=c;do{if((a.tag&e)===e){s=void 0;var o=a.create,h=a.inst;s=o(),h.destroy=s}a=a.next}while(a!==c)}}catch(y){Je(t,t.return,y)}}function Na(e,t,a){try{var s=t.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var o=c.next;s=o;do{if((s.tag&e)===e){var h=s.inst,y=h.destroy;if(y!==void 0){h.destroy=void 0,c=t;var _=a,T=y;try{T()}catch(H){Je(c,_,H)}}}s=s.next}while(s!==o)}}catch(H){Je(t,t.return,H)}}function Ah(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{pf(t,a)}catch(s){Je(e,e.return,s)}}}function Ch(e,t,a){a.props=ul(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){Je(e,t,s)}}function Zi(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof a=="function"?e.refCleanup=a(s):a.current=s}}catch(c){Je(e,t,c)}}function $n(e,t){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(c){Je(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){Je(e,t,c)}else a.current=null}function zh(e){var t=e.type,a=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break e;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(c){Je(e,e.return,c)}}function ju(e,t,a){try{var s=e.stateNode;My(s,e.type,a,t),s[Jt]=t}catch(c){Je(e,e.return,c)}}function Eh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ta(e.type)||e.tag===4}function xu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Eh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ta(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Su(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Kn));else if(s!==4&&(s===27&&Ta(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Su(e,t,a),e=e.sibling;e!==null;)Su(e,t,a),e=e.sibling}function Ps(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(s!==4&&(s===27&&Ta(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Ps(e,t,a),e=e.sibling;e!==null;)Ps(e,t,a),e=e.sibling}function wh(e){var t=e.stateNode,a=e.memoizedProps;try{for(var s=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Mt(t,s,a),t[Ot]=e,t[Jt]=a}catch(o){Je(e,e.return,o)}}var na=!1,xt=!1,_u=!1,Oh=typeof WeakSet=="function"?WeakSet:Set,wt=null;function hy(e,t){if(e=e.containerInfo,Yu=yr,e=Bd(e),vc(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var c=s.anchorOffset,o=s.focusNode;s=s.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var h=0,y=-1,_=-1,T=0,H=0,G=e,R=null;t:for(;;){for(var D;G!==a||c!==0&&G.nodeType!==3||(y=h+c),G!==o||s!==0&&G.nodeType!==3||(_=h+s),G.nodeType===3&&(h+=G.nodeValue.length),(D=G.firstChild)!==null;)R=G,G=D;for(;;){if(G===e)break t;if(R===a&&++T===c&&(y=h),R===o&&++H===s&&(_=h),(D=G.nextSibling)!==null)break;G=R,R=G.parentNode}G=D}a=y===-1||_===-1?null:{start:y,end:_}}else a=null}a=a||{start:0,end:0}}else a=null;for(Ju={focusedElem:e,selectionRange:a},yr=!1,wt=t;wt!==null;)if(t=wt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,wt=e;else for(;wt!==null;){switch(t=wt,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)c=e[a],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,a=t,c=o.memoizedProps,o=o.memoizedState,s=a.stateNode;try{var oe=ul(a.type,c);e=s.getSnapshotBeforeUpdate(oe,o),s.__reactInternalSnapshotBeforeUpdate=e}catch(Se){Je(a,a.return,Se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Vu(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Vu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(u(163))}if(e=t.sibling,e!==null){e.return=t.return,wt=e;break}wt=t.return}}function Th(e,t,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:la(e,a),s&4&&Ui(5,a);break;case 1:if(la(e,a),s&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(h){Je(a,a.return,h)}else{var c=ul(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Je(a,a.return,h)}}s&64&&Ah(a),s&512&&Zi(a,a.return);break;case 3:if(la(e,a),s&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{pf(e,t)}catch(h){Je(a,a.return,h)}}break;case 27:t===null&&s&4&&wh(a);case 26:case 5:la(e,a),t===null&&s&4&&zh(a),s&512&&Zi(a,a.return);break;case 12:la(e,a);break;case 31:la(e,a),s&4&&Mh(e,a);break;case 13:la(e,a),s&4&&Dh(e,a),s&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Sy.bind(null,a),qy(e,a))));break;case 22:if(s=a.memoizedState!==null||na,!s){t=t!==null&&t.memoizedState!==null||xt,c=na;var o=xt;na=s,(xt=t)&&!o?ia(e,a,(a.subtreeFlags&8772)!==0):la(e,a),na=c,xt=o}break;case 30:break;default:la(e,a)}}function kh(e){var t=e.alternate;t!==null&&(e.alternate=null,kh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Wr(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var at=null,Qt=!1;function aa(e,t,a){for(a=a.child;a!==null;)Rh(e,t,a),a=a.sibling}function Rh(e,t,a){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(Qa,a)}catch{}switch(a.tag){case 26:xt||$n(a,t),aa(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:xt||$n(a,t);var s=at,c=Qt;Ta(a.type)&&(at=a.stateNode,Qt=!1),aa(e,t,a),Ki(a.stateNode),at=s,Qt=c;break;case 5:xt||$n(a,t);case 6:if(s=at,c=Qt,at=null,aa(e,t,a),at=s,Qt=c,at!==null)if(Qt)try{(at.nodeType===9?at.body:at.nodeName==="HTML"?at.ownerDocument.body:at).removeChild(a.stateNode)}catch(o){Je(a,t,o)}else try{at.removeChild(a.stateNode)}catch(o){Je(a,t,o)}break;case 18:at!==null&&(Qt?(e=at,Am(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Wl(e)):Am(at,a.stateNode));break;case 4:s=at,c=Qt,at=a.stateNode.containerInfo,Qt=!0,aa(e,t,a),at=s,Qt=c;break;case 0:case 11:case 14:case 15:Na(2,a,t),xt||Na(4,a,t),aa(e,t,a);break;case 1:xt||($n(a,t),s=a.stateNode,typeof s.componentWillUnmount=="function"&&Ch(a,t,s)),aa(e,t,a);break;case 21:aa(e,t,a);break;case 22:xt=(s=xt)||a.memoizedState!==null,aa(e,t,a),xt=s;break;default:aa(e,t,a)}}function Mh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wl(e)}catch(a){Je(t,t.return,a)}}}function Dh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wl(e)}catch(a){Je(t,t.return,a)}}function my(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Oh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Oh),t;default:throw Error(u(435,e.tag))}}function Fs(e,t){var a=my(e);t.forEach(function(s){if(!a.has(s)){a.add(s);var c=_y.bind(null,e,s);s.then(c,c)}})}function Vt(e,t){var a=t.deletions;if(a!==null)for(var s=0;s<a.length;s++){var c=a[s],o=e,h=t,y=h;e:for(;y!==null;){switch(y.tag){case 27:if(Ta(y.type)){at=y.stateNode,Qt=!1;break e}break;case 5:at=y.stateNode,Qt=!1;break e;case 3:case 4:at=y.stateNode.containerInfo,Qt=!0;break e}y=y.return}if(at===null)throw Error(u(160));Rh(o,h,c),at=null,Qt=!1,o=c.alternate,o!==null&&(o.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Uh(t,e),t=t.sibling}var En=null;function Uh(e,t){var a=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Vt(t,e),Xt(e),s&4&&(Na(3,e,e.return),Ui(3,e),Na(5,e,e.return));break;case 1:Vt(t,e),Xt(e),s&512&&(xt||a===null||$n(a,a.return)),s&64&&na&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?s:a.concat(s))));break;case 26:var c=En;if(Vt(t,e),Xt(e),s&512&&(xt||a===null||$n(a,a.return)),s&4){var o=a!==null?a.memoizedState:null;if(s=e.memoizedState,a===null)if(s===null)if(e.stateNode===null){e:{s=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(s){case"title":o=c.getElementsByTagName("title")[0],(!o||o[oi]||o[Ot]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=c.createElement(s),c.head.insertBefore(o,c.querySelector("head > title"))),Mt(o,s,a),o[Ot]=e,Et(o),s=o;break e;case"link":var h=Um("link","href",c).get(s+(a.href||""));if(h){for(var y=0;y<h.length;y++)if(o=h[y],o.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&o.getAttribute("rel")===(a.rel==null?null:a.rel)&&o.getAttribute("title")===(a.title==null?null:a.title)&&o.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){h.splice(y,1);break t}}o=c.createElement(s),Mt(o,s,a),c.head.appendChild(o);break;case"meta":if(h=Um("meta","content",c).get(s+(a.content||""))){for(y=0;y<h.length;y++)if(o=h[y],o.getAttribute("content")===(a.content==null?null:""+a.content)&&o.getAttribute("name")===(a.name==null?null:a.name)&&o.getAttribute("property")===(a.property==null?null:a.property)&&o.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&o.getAttribute("charset")===(a.charSet==null?null:a.charSet)){h.splice(y,1);break t}}o=c.createElement(s),Mt(o,s,a),c.head.appendChild(o);break;default:throw Error(u(468,s))}o[Ot]=e,Et(o),s=o}e.stateNode=s}else Zm(c,e.type,e.stateNode);else e.stateNode=Dm(c,s,e.memoizedProps);else o!==s?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,s===null?Zm(c,e.type,e.stateNode):Dm(c,s,e.memoizedProps)):s===null&&e.stateNode!==null&&ju(e,e.memoizedProps,a.memoizedProps)}break;case 27:Vt(t,e),Xt(e),s&512&&(xt||a===null||$n(a,a.return)),a!==null&&s&4&&ju(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Vt(t,e),Xt(e),s&512&&(xt||a===null||$n(a,a.return)),e.flags&32){c=e.stateNode;try{Sl(c,"")}catch(oe){Je(e,e.return,oe)}}s&4&&e.stateNode!=null&&(c=e.memoizedProps,ju(e,c,a!==null?a.memoizedProps:c)),s&1024&&(_u=!0);break;case 6:if(Vt(t,e),Xt(e),s&4){if(e.stateNode===null)throw Error(u(162));s=e.memoizedProps,a=e.stateNode;try{a.nodeValue=s}catch(oe){Je(e,e.return,oe)}}break;case 3:if(mr=null,c=En,En=fr(t.containerInfo),Vt(t,e),En=c,Xt(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{Wl(t.containerInfo)}catch(oe){Je(e,e.return,oe)}_u&&(_u=!1,Zh(e));break;case 4:s=En,En=fr(e.stateNode.containerInfo),Vt(t,e),Xt(e),En=s;break;case 12:Vt(t,e),Xt(e);break;case 31:Vt(t,e),Xt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Fs(e,s)));break;case 13:Vt(t,e),Xt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(er=ne()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Fs(e,s)));break;case 22:c=e.memoizedState!==null;var _=a!==null&&a.memoizedState!==null,T=na,H=xt;if(na=T||c,xt=H||_,Vt(t,e),xt=H,na=T,Xt(e),s&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||_||na||xt||ol(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){_=a=t;try{if(o=_.stateNode,c)h=o.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{y=_.stateNode;var G=_.memoizedProps.style,R=G!=null&&G.hasOwnProperty("display")?G.display:null;y.style.display=R==null||typeof R=="boolean"?"":(""+R).trim()}}catch(oe){Je(_,_.return,oe)}}}else if(t.tag===6){if(a===null){_=t;try{_.stateNode.nodeValue=c?"":_.memoizedProps}catch(oe){Je(_,_.return,oe)}}}else if(t.tag===18){if(a===null){_=t;try{var D=_.stateNode;c?Cm(D,!0):Cm(_.stateNode,!1)}catch(oe){Je(_,_.return,oe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(a=s.retryQueue,a!==null&&(s.retryQueue=null,Fs(e,a))));break;case 19:Vt(t,e),Xt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Fs(e,s)));break;case 30:break;case 21:break;default:Vt(t,e),Xt(e)}}function Xt(e){var t=e.flags;if(t&2){try{for(var a,s=e.return;s!==null;){if(Eh(s)){a=s;break}s=s.return}if(a==null)throw Error(u(160));switch(a.tag){case 27:var c=a.stateNode,o=xu(e);Ps(e,o,c);break;case 5:var h=a.stateNode;a.flags&32&&(Sl(h,""),a.flags&=-33);var y=xu(e);Ps(e,y,h);break;case 3:case 4:var _=a.stateNode.containerInfo,T=xu(e);Su(e,T,_);break;default:throw Error(u(161))}}catch(H){Je(e,e.return,H)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Zh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Zh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function la(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Th(e,t.alternate,t),t=t.sibling}function ol(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Na(4,t,t.return),ol(t);break;case 1:$n(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Ch(t,t.return,a),ol(t);break;case 27:Ki(t.stateNode);case 26:case 5:$n(t,t.return),ol(t);break;case 22:t.memoizedState===null&&ol(t);break;case 30:ol(t);break;default:ol(t)}e=e.sibling}}function ia(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,c=e,o=t,h=o.flags;switch(o.tag){case 0:case 11:case 15:ia(c,o,a),Ui(4,o);break;case 1:if(ia(c,o,a),s=o,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(T){Je(s,s.return,T)}if(s=o,c=s.updateQueue,c!==null){var y=s.stateNode;try{var _=c.shared.hiddenCallbacks;if(_!==null)for(c.shared.hiddenCallbacks=null,c=0;c<_.length;c++)mf(_[c],y)}catch(T){Je(s,s.return,T)}}a&&h&64&&Ah(o),Zi(o,o.return);break;case 27:wh(o);case 26:case 5:ia(c,o,a),a&&s===null&&h&4&&zh(o),Zi(o,o.return);break;case 12:ia(c,o,a);break;case 31:ia(c,o,a),a&&h&4&&Mh(c,o);break;case 13:ia(c,o,a),a&&h&4&&Dh(c,o);break;case 22:o.memoizedState===null&&ia(c,o,a),Zi(o,o.return);break;case 30:break;default:ia(c,o,a)}t=t.sibling}}function Nu(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&_i(a))}function Au(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&_i(e))}function wn(e,t,a,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Hh(e,t,a,s),t=t.sibling}function Hh(e,t,a,s){var c=t.flags;switch(t.tag){case 0:case 11:case 15:wn(e,t,a,s),c&2048&&Ui(9,t);break;case 1:wn(e,t,a,s);break;case 3:wn(e,t,a,s),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&_i(e)));break;case 12:if(c&2048){wn(e,t,a,s),e=t.stateNode;try{var o=t.memoizedProps,h=o.id,y=o.onPostCommit;typeof y=="function"&&y(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(_){Je(t,t.return,_)}}else wn(e,t,a,s);break;case 31:wn(e,t,a,s);break;case 13:wn(e,t,a,s);break;case 23:break;case 22:o=t.stateNode,h=t.alternate,t.memoizedState!==null?o._visibility&2?wn(e,t,a,s):Hi(e,t):o._visibility&2?wn(e,t,a,s):(o._visibility|=2,ql(e,t,a,s,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Nu(h,t);break;case 24:wn(e,t,a,s),c&2048&&Au(t.alternate,t);break;default:wn(e,t,a,s)}}function ql(e,t,a,s,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,h=t,y=a,_=s,T=h.flags;switch(h.tag){case 0:case 11:case 15:ql(o,h,y,_,c),Ui(8,h);break;case 23:break;case 22:var H=h.stateNode;h.memoizedState!==null?H._visibility&2?ql(o,h,y,_,c):Hi(o,h):(H._visibility|=2,ql(o,h,y,_,c)),c&&T&2048&&Nu(h.alternate,h);break;case 24:ql(o,h,y,_,c),c&&T&2048&&Au(h.alternate,h);break;default:ql(o,h,y,_,c)}t=t.sibling}}function Hi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,s=t,c=s.flags;switch(s.tag){case 22:Hi(a,s),c&2048&&Nu(s.alternate,s);break;case 24:Hi(a,s),c&2048&&Au(s.alternate,s);break;default:Hi(a,s)}t=t.sibling}}var $i=8192;function Gl(e,t,a){if(e.subtreeFlags&$i)for(e=e.child;e!==null;)$h(e,t,a),e=e.sibling}function $h(e,t,a){switch(e.tag){case 26:Gl(e,t,a),e.flags&$i&&e.memoizedState!==null&&eb(a,En,e.memoizedState,e.memoizedProps);break;case 5:Gl(e,t,a);break;case 3:case 4:var s=En;En=fr(e.stateNode.containerInfo),Gl(e,t,a),En=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=$i,$i=16777216,Gl(e,t,a),$i=s):Gl(e,t,a));break;default:Gl(e,t,a)}}function Lh(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Li(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];wt=s,qh(s,e)}Lh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bh(e),e=e.sibling}function Bh(e){switch(e.tag){case 0:case 11:case 15:Li(e),e.flags&2048&&Na(9,e,e.return);break;case 3:Li(e);break;case 12:Li(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ws(e)):Li(e);break;default:Li(e)}}function Ws(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];wt=s,qh(s,e)}Lh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Na(8,t,t.return),Ws(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Ws(t));break;default:Ws(t)}e=e.sibling}}function qh(e,t){for(;wt!==null;){var a=wt;switch(a.tag){case 0:case 11:case 15:Na(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var s=a.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:_i(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,wt=s;else e:for(a=e;wt!==null;){s=wt;var c=s.sibling,o=s.return;if(kh(s),s===a){wt=null;break e}if(c!==null){c.return=o,wt=c;break e}wt=o}}}var py={getCacheForType:function(e){var t=kt(yt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return kt(yt).controller.signal}},vy=typeof WeakMap=="function"?WeakMap:Map,Be=0,Pe=null,we=null,Te=0,Ye=0,ln=null,Aa=!1,Yl=!1,Cu=!1,sa=0,ot=0,Ca=0,dl=0,zu=0,sn=0,Jl=0,Bi=null,It=null,Eu=!1,er=0,Gh=0,tr=1/0,nr=null,za=null,At=0,Ea=null,Kl=null,ra=0,wu=0,Ou=null,Yh=null,qi=0,Tu=null;function rn(){return(Be&2)!==0&&Te!==0?Te&-Te:Z.T!==null?Zu():id()}function Jh(){if(sn===0)if((Te&536870912)===0||Re){var e=W;W<<=1,(W&3932160)===0&&(W=262144),sn=e}else sn=536870912;return e=nn.current,e!==null&&(e.flags|=32),sn}function Pt(e,t,a){(e===Pe&&(Ye===2||Ye===9)||e.cancelPendingCommit!==null)&&(Ql(e,0),wa(e,Te,sn,!1)),Va(e,a),((Be&2)===0||e!==Pe)&&(e===Pe&&((Be&2)===0&&(dl|=a),ot===4&&wa(e,Te,sn,!1)),Ln(e))}function Kh(e,t,a){if((Be&6)!==0)throw Error(u(327));var s=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Cn(e,t),c=s?by(e,t):Ru(e,t,!0),o=s;do{if(c===0){Yl&&!s&&wa(e,t,0,!1);break}else{if(a=e.current.alternate,o&&!gy(a)){c=Ru(e,t,!1),o=!1;continue}if(c===2){if(o=t,e.errorRecoveryDisabledLanes&o)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var y=e;c=Bi;var _=y.current.memoizedState.isDehydrated;if(_&&(Ql(y,h).flags|=256),h=Ru(y,h,!1),h!==2){if(Cu&&!_){y.errorRecoveryDisabledLanes|=o,dl|=o,c=4;break e}o=It,It=c,o!==null&&(It===null?It=o:It.push.apply(It,o))}c=h}if(o=!1,c!==2)continue}}if(c===1){Ql(e,0),wa(e,t,0,!0);break}e:{switch(s=e,o=c,o){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:wa(s,t,sn,!Aa);break e;case 2:It=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(c=er+300-ne(),10<c)){if(wa(s,t,sn,!Aa),de(s,0,!0)!==0)break e;ra=t,s.timeoutHandle=_m(Qh.bind(null,s,a,It,nr,Eu,t,sn,dl,Jl,Aa,o,"Throttled",-0,0),c);break e}Qh(s,a,It,nr,Eu,t,sn,dl,Jl,Aa,o,null,-0,0)}}break}while(!0);Ln(e)}function Qh(e,t,a,s,c,o,h,y,_,T,H,G,R,D){if(e.timeoutHandle=-1,G=t.subtreeFlags,G&8192||(G&16785408)===16785408){G={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Kn},$h(t,o,G);var oe=(o&62914560)===o?er-ne():(o&4194048)===o?Gh-ne():0;if(oe=tb(G,oe),oe!==null){ra=o,e.cancelPendingCommit=oe(tm.bind(null,e,t,o,a,s,c,h,y,_,H,G,null,R,D)),wa(e,o,h,!T);return}}tm(e,t,o,a,s,c,h,y,_)}function gy(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var s=0;s<a.length;s++){var c=a[s],o=c.getSnapshot;c=c.value;try{if(!en(o(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function wa(e,t,a,s){t&=~zu,t&=~dl,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var c=t;0<c;){var o=31-Bt(c),h=1<<o;s[o]=-1,c&=~h}a!==0&&nd(e,a,t)}function ar(){return(Be&6)===0?(Gi(0),!1):!0}function ku(){if(we!==null){if(Ye===0)var e=we.return;else e=we,In=nl=null,Vc(e),Zl=null,Ai=0,e=we;for(;e!==null;)Nh(e.alternate,e),e=e.return;we=null}}function Ql(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Zy(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),ra=0,ku(),Pe=e,we=a=Vn(e.current,null),Te=t,Ye=0,ln=null,Aa=!1,Yl=Cn(e,t),Cu=!1,Jl=sn=zu=dl=Ca=ot=0,It=Bi=null,Eu=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var c=31-Bt(s),o=1<<c;t|=e[c],s&=~o}return sa=t,Ns(),a}function Vh(e,t){ze=null,Z.H=Ri,t===Ul||t===ks?(t=of(),Ye=3):t===Uc?(t=of(),Ye=4):Ye=t===ou?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ln=t,we===null&&(ot=1,Ks(e,mn(t,e.current)))}function Xh(){var e=nn.current;return e===null?!0:(Te&4194048)===Te?yn===null:(Te&62914560)===Te||(Te&536870912)!==0?e===yn:!1}function Ih(){var e=Z.H;return Z.H=Ri,e===null?Ri:e}function Ph(){var e=Z.A;return Z.A=py,e}function lr(){ot=4,Aa||(Te&4194048)!==Te&&nn.current!==null||(Yl=!0),(Ca&134217727)===0&&(dl&134217727)===0||Pe===null||wa(Pe,Te,sn,!1)}function Ru(e,t,a){var s=Be;Be|=2;var c=Ih(),o=Ph();(Pe!==e||Te!==t)&&(nr=null,Ql(e,t)),t=!1;var h=ot;e:do try{if(Ye!==0&&we!==null){var y=we,_=ln;switch(Ye){case 8:ku(),h=6;break e;case 3:case 2:case 9:case 6:nn.current===null&&(t=!0);var T=Ye;if(Ye=0,ln=null,Vl(e,y,_,T),a&&Yl){h=0;break e}break;default:T=Ye,Ye=0,ln=null,Vl(e,y,_,T)}}yy(),h=ot;break}catch(H){Vh(e,H)}while(!0);return t&&e.shellSuspendCounter++,In=nl=null,Be=s,Z.H=c,Z.A=o,we===null&&(Pe=null,Te=0,Ns()),h}function yy(){for(;we!==null;)Fh(we)}function by(e,t){var a=Be;Be|=2;var s=Ih(),c=Ph();Pe!==e||Te!==t?(nr=null,tr=ne()+500,Ql(e,t)):Yl=Cn(e,t);e:do try{if(Ye!==0&&we!==null){t=we;var o=ln;t:switch(Ye){case 1:Ye=0,ln=null,Vl(e,t,o,1);break;case 2:case 9:if(cf(o)){Ye=0,ln=null,Wh(t);break}t=function(){Ye!==2&&Ye!==9||Pe!==e||(Ye=7),Ln(e)},o.then(t,t);break e;case 3:Ye=7;break e;case 4:Ye=5;break e;case 7:cf(o)?(Ye=0,ln=null,Wh(t)):(Ye=0,ln=null,Vl(e,t,o,7));break;case 5:var h=null;switch(we.tag){case 26:h=we.memoizedState;case 5:case 27:var y=we;if(h?Hm(h):y.stateNode.complete){Ye=0,ln=null;var _=y.sibling;if(_!==null)we=_;else{var T=y.return;T!==null?(we=T,ir(T)):we=null}break t}}Ye=0,ln=null,Vl(e,t,o,5);break;case 6:Ye=0,ln=null,Vl(e,t,o,6);break;case 8:ku(),ot=6;break e;default:throw Error(u(462))}}jy();break}catch(H){Vh(e,H)}while(!0);return In=nl=null,Z.H=s,Z.A=c,Be=a,we!==null?0:(Pe=null,Te=0,Ns(),ot)}function jy(){for(;we!==null&&!Yn();)Fh(we)}function Fh(e){var t=Sh(e.alternate,e,sa);e.memoizedProps=e.pendingProps,t===null?ir(e):we=t}function Wh(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=vh(a,t,t.pendingProps,t.type,void 0,Te);break;case 11:t=vh(a,t,t.pendingProps,t.type.render,t.ref,Te);break;case 5:Vc(t);default:Nh(a,t),t=we=Id(t,sa),t=Sh(a,t,sa)}e.memoizedProps=e.pendingProps,t===null?ir(e):we=t}function Vl(e,t,a,s){In=nl=null,Vc(t),Zl=null,Ai=0;var c=t.return;try{if(cy(e,c,t,a,Te)){ot=1,Ks(e,mn(a,e.current)),we=null;return}}catch(o){if(c!==null)throw we=c,o;ot=1,Ks(e,mn(a,e.current)),we=null;return}t.flags&32768?(Re||s===1?e=!0:Yl||(Te&536870912)!==0?e=!1:(Aa=e=!0,(s===2||s===9||s===3||s===6)&&(s=nn.current,s!==null&&s.tag===13&&(s.flags|=16384))),em(t,e)):ir(t)}function ir(e){var t=e;do{if((t.flags&32768)!==0){em(t,Aa);return}e=t.return;var a=dy(t.alternate,t,sa);if(a!==null){we=a;return}if(t=t.sibling,t!==null){we=t;return}we=t=e}while(t!==null);ot===0&&(ot=5)}function em(e,t){do{var a=fy(e.alternate,e);if(a!==null){a.flags&=32767,we=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){we=e;return}we=e=a}while(e!==null);ot=6,we=null}function tm(e,t,a,s,c,o,h,y,_){e.cancelPendingCommit=null;do sr();while(At!==0);if((Be&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(o=t.lanes|t.childLanes,o|=xc,zt(e,a,o,h,y,_),e===Pe&&(we=Pe=null,Te=0),Kl=t,Ea=e,ra=a,wu=o,Ou=c,Yh=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Ny(gt,function(){return sm(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=Z.T,Z.T=null,c=F.p,F.p=2,h=Be,Be|=4;try{hy(e,t,a)}finally{Be=h,F.p=c,Z.T=s}}At=1,nm(),am(),lm()}}function nm(){if(At===1){At=0;var e=Ea,t=Kl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=Z.T,Z.T=null;var s=F.p;F.p=2;var c=Be;Be|=4;try{Uh(t,e);var o=Ju,h=Bd(e.containerInfo),y=o.focusedElem,_=o.selectionRange;if(h!==y&&y&&y.ownerDocument&&Ld(y.ownerDocument.documentElement,y)){if(_!==null&&vc(y)){var T=_.start,H=_.end;if(H===void 0&&(H=T),"selectionStart"in y)y.selectionStart=T,y.selectionEnd=Math.min(H,y.value.length);else{var G=y.ownerDocument||document,R=G&&G.defaultView||window;if(R.getSelection){var D=R.getSelection(),oe=y.textContent.length,Se=Math.min(_.start,oe),Xe=_.end===void 0?Se:Math.min(_.end,oe);!D.extend&&Se>Xe&&(h=Xe,Xe=Se,Se=h);var E=$d(y,Se),A=$d(y,Xe);if(E&&A&&(D.rangeCount!==1||D.anchorNode!==E.node||D.anchorOffset!==E.offset||D.focusNode!==A.node||D.focusOffset!==A.offset)){var O=G.createRange();O.setStart(E.node,E.offset),D.removeAllRanges(),Se>Xe?(D.addRange(O),D.extend(A.node,A.offset)):(O.setEnd(A.node,A.offset),D.addRange(O))}}}}for(G=[],D=y;D=D.parentNode;)D.nodeType===1&&G.push({element:D,left:D.scrollLeft,top:D.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<G.length;y++){var L=G[y];L.element.scrollLeft=L.left,L.element.scrollTop=L.top}}yr=!!Yu,Ju=Yu=null}finally{Be=c,F.p=s,Z.T=a}}e.current=t,At=2}}function am(){if(At===2){At=0;var e=Ea,t=Kl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=Z.T,Z.T=null;var s=F.p;F.p=2;var c=Be;Be|=4;try{Th(e,t.alternate,t)}finally{Be=c,F.p=s,Z.T=a}}At=3}}function lm(){if(At===4||At===3){At=0,Ge();var e=Ea,t=Kl,a=ra,s=Yh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?At=5:(At=0,Kl=Ea=null,im(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(za=null),Pr(a),t=t.stateNode,Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(Qa,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=Z.T,c=F.p,F.p=2,Z.T=null;try{for(var o=e.onRecoverableError,h=0;h<s.length;h++){var y=s[h];o(y.value,{componentStack:y.stack})}}finally{Z.T=t,F.p=c}}(ra&3)!==0&&sr(),Ln(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===Tu?qi++:(qi=0,Tu=e):qi=0,Gi(0)}}function im(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,_i(t)))}function sr(){return nm(),am(),lm(),sm()}function sm(){if(At!==5)return!1;var e=Ea,t=wu;wu=0;var a=Pr(ra),s=Z.T,c=F.p;try{F.p=32>a?32:a,Z.T=null,a=Ou,Ou=null;var o=Ea,h=ra;if(At=0,Kl=Ea=null,ra=0,(Be&6)!==0)throw Error(u(331));var y=Be;if(Be|=4,Bh(o.current),Hh(o,o.current,h,a),Be=y,Gi(0,!1),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(Qa,o)}catch{}return!0}finally{F.p=c,Z.T=s,im(e,t)}}function rm(e,t,a){t=mn(a,t),t=uu(e.stateNode,t,2),e=xa(e,t,2),e!==null&&(Va(e,2),Ln(e))}function Je(e,t,a){if(e.tag===3)rm(e,e,a);else for(;t!==null;){if(t.tag===3){rm(t,e,a);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(za===null||!za.has(s))){e=mn(a,e),a=ch(2),s=xa(t,a,2),s!==null&&(uh(a,s,t,e),Va(s,2),Ln(s));break}}t=t.return}}function Mu(e,t,a){var s=e.pingCache;if(s===null){s=e.pingCache=new vy;var c=new Set;s.set(t,c)}else c=s.get(t),c===void 0&&(c=new Set,s.set(t,c));c.has(a)||(Cu=!0,c.add(a),e=xy.bind(null,e,t,a),t.then(e,e))}function xy(e,t,a){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Pe===e&&(Te&a)===a&&(ot===4||ot===3&&(Te&62914560)===Te&&300>ne()-er?(Be&2)===0&&Ql(e,0):zu|=a,Jl===Te&&(Jl=0)),Ln(e)}function cm(e,t){t===0&&(t=fs()),e=Wa(e,t),e!==null&&(Va(e,t),Ln(e))}function Sy(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),cm(e,a)}function _y(e,t){var a=0;switch(e.tag){case 31:case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(u(314))}s!==null&&s.delete(t),cm(e,a)}function Ny(e,t){return An(e,t)}var rr=null,Xl=null,Du=!1,cr=!1,Uu=!1,Oa=0;function Ln(e){e!==Xl&&e.next===null&&(Xl===null?rr=Xl=e:Xl=Xl.next=e),cr=!0,Du||(Du=!0,Cy())}function Gi(e,t){if(!Uu&&cr){Uu=!0;do for(var a=!1,s=rr;s!==null;){if(e!==0){var c=s.pendingLanes;if(c===0)var o=0;else{var h=s.suspendedLanes,y=s.pingedLanes;o=(1<<31-Bt(42|e)+1)-1,o&=c&~(h&~y),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,fm(s,o))}else o=Te,o=de(s,s===Pe?o:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(o&3)===0||Cn(s,o)||(a=!0,fm(s,o));s=s.next}while(a);Uu=!1}}function Ay(){um()}function um(){cr=Du=!1;var e=0;Oa!==0&&Uy()&&(e=Oa);for(var t=ne(),a=null,s=rr;s!==null;){var c=s.next,o=om(s,t);o===0?(s.next=null,a===null?rr=c:a.next=c,c===null&&(Xl=a)):(a=s,(e!==0||(o&3)!==0)&&(cr=!0)),s=c}At!==0&&At!==5||Gi(e),Oa!==0&&(Oa=0)}function om(e,t){for(var a=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var h=31-Bt(o),y=1<<h,_=c[h];_===-1?((y&a)===0||(y&s)!==0)&&(c[h]=ds(y,t)):_<=t&&(e.expiredLanes|=y),o&=~y}if(t=Pe,a=Te,a=de(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,a===0||e===t&&(Ye===2||Ye===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Dn(s),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Cn(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(s!==null&&Dn(s),Pr(a)){case 2:case 8:a=nt;break;case 32:a=gt;break;case 268435456:a=Ka;break;default:a=gt}return s=dm.bind(null,e),a=An(a,s),e.callbackPriority=t,e.callbackNode=a,t}return s!==null&&s!==null&&Dn(s),e.callbackPriority=2,e.callbackNode=null,2}function dm(e,t){if(At!==0&&At!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(sr()&&e.callbackNode!==a)return null;var s=Te;return s=de(e,e===Pe?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Kh(e,s,t),om(e,ne()),e.callbackNode!=null&&e.callbackNode===a?dm.bind(null,e):null)}function fm(e,t){if(sr())return null;Kh(e,t,!0)}function Cy(){Hy(function(){(Be&6)!==0?An(Ce,Ay):um()})}function Zu(){if(Oa===0){var e=Ml;e===0&&(e=N,N<<=1,(N&261888)===0&&(N=256)),Oa=e}return Oa}function hm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:vs(""+e)}function mm(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function zy(e,t,a,s,c){if(t==="submit"&&a&&a.stateNode===c){var o=hm((c[Jt]||null).action),h=s.submitter;h&&(t=(t=h[Jt]||null)?hm(t.formAction):h.getAttribute("formAction"),t!==null&&(o=t,h=null));var y=new js("action","action",null,s,c);e.push({event:y,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Oa!==0){var _=h?mm(c,h):new FormData(c);au(a,{pending:!0,data:_,method:c.method,action:o},null,_)}}else typeof o=="function"&&(y.preventDefault(),_=h?mm(c,h):new FormData(c),au(a,{pending:!0,data:_,method:c.method,action:o},o,_))},currentTarget:c}]})}}for(var Hu=0;Hu<jc.length;Hu++){var $u=jc[Hu],Ey=$u.toLowerCase(),wy=$u[0].toUpperCase()+$u.slice(1);zn(Ey,"on"+wy)}zn(Yd,"onAnimationEnd"),zn(Jd,"onAnimationIteration"),zn(Kd,"onAnimationStart"),zn("dblclick","onDoubleClick"),zn("focusin","onFocus"),zn("focusout","onBlur"),zn(Jg,"onTransitionRun"),zn(Kg,"onTransitionStart"),zn(Qg,"onTransitionCancel"),zn(Qd,"onTransitionEnd"),jl("onMouseEnter",["mouseout","mouseover"]),jl("onMouseLeave",["mouseout","mouseover"]),jl("onPointerEnter",["pointerout","pointerover"]),jl("onPointerLeave",["pointerout","pointerover"]),Xa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Xa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Xa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Xa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Xa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Xa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yi="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(" "),Oy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yi));function pm(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var s=e[a],c=s.event;s=s.listeners;e:{var o=void 0;if(t)for(var h=s.length-1;0<=h;h--){var y=s[h],_=y.instance,T=y.currentTarget;if(y=y.listener,_!==o&&c.isPropagationStopped())break e;o=y,c.currentTarget=T;try{o(c)}catch(H){_s(H)}c.currentTarget=null,o=_}else for(h=0;h<s.length;h++){if(y=s[h],_=y.instance,T=y.currentTarget,y=y.listener,_!==o&&c.isPropagationStopped())break e;o=y,c.currentTarget=T;try{o(c)}catch(H){_s(H)}c.currentTarget=null,o=_}}}}function Oe(e,t){var a=t[Fr];a===void 0&&(a=t[Fr]=new Set);var s=e+"__bubble";a.has(s)||(vm(t,e,2,!1),a.add(s))}function Lu(e,t,a){var s=0;t&&(s|=4),vm(a,e,s,t)}var ur="_reactListening"+Math.random().toString(36).slice(2);function Bu(e){if(!e[ur]){e[ur]=!0,cd.forEach(function(a){a!=="selectionchange"&&(Oy.has(a)||Lu(a,!1,e),Lu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ur]||(t[ur]=!0,Lu("selectionchange",!1,t))}}function vm(e,t,a,s){switch(Jm(t)){case 2:var c=lb;break;case 8:c=ib;break;default:c=no}a=c.bind(null,t,a,e),c=void 0,!rc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),s?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function qu(e,t,a,s,c){var o=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var h=s.tag;if(h===3||h===4){var y=s.stateNode.containerInfo;if(y===c)break;if(h===4)for(h=s.return;h!==null;){var _=h.tag;if((_===3||_===4)&&h.stateNode.containerInfo===c)return;h=h.return}for(;y!==null;){if(h=gl(y),h===null)return;if(_=h.tag,_===5||_===6||_===26||_===27){s=o=h;continue e}y=y.parentNode}}s=s.return}jd(function(){var T=o,H=ic(a),G=[];e:{var R=Vd.get(e);if(R!==void 0){var D=js,oe=e;switch(e){case"keypress":if(ys(a)===0)break e;case"keydown":case"keyup":D=_g;break;case"focusin":oe="focus",D=dc;break;case"focusout":oe="blur",D=dc;break;case"beforeblur":case"afterblur":D=dc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":D=_d;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":D=dg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":D=Cg;break;case Yd:case Jd:case Kd:D=mg;break;case Qd:D=Eg;break;case"scroll":case"scrollend":D=ug;break;case"wheel":D=Og;break;case"copy":case"cut":case"paste":D=vg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":D=Ad;break;case"toggle":case"beforetoggle":D=kg}var Se=(t&4)!==0,Xe=!Se&&(e==="scroll"||e==="scrollend"),E=Se?R!==null?R+"Capture":null:R;Se=[];for(var A=T,O;A!==null;){var L=A;if(O=L.stateNode,L=L.tag,L!==5&&L!==26&&L!==27||O===null||E===null||(L=fi(A,E),L!=null&&Se.push(Ji(A,L,O))),Xe)break;A=A.return}0<Se.length&&(R=new D(R,oe,null,a,H),G.push({event:R,listeners:Se}))}}if((t&7)===0){e:{if(R=e==="mouseover"||e==="pointerover",D=e==="mouseout"||e==="pointerout",R&&a!==lc&&(oe=a.relatedTarget||a.fromElement)&&(gl(oe)||oe[vl]))break e;if((D||R)&&(R=H.window===H?H:(R=H.ownerDocument)?R.defaultView||R.parentWindow:window,D?(oe=a.relatedTarget||a.toElement,D=T,oe=oe?gl(oe):null,oe!==null&&(Xe=f(oe),Se=oe.tag,oe!==Xe||Se!==5&&Se!==27&&Se!==6)&&(oe=null)):(D=null,oe=T),D!==oe)){if(Se=_d,L="onMouseLeave",E="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(Se=Ad,L="onPointerLeave",E="onPointerEnter",A="pointer"),Xe=D==null?R:di(D),O=oe==null?R:di(oe),R=new Se(L,A+"leave",D,a,H),R.target=Xe,R.relatedTarget=O,L=null,gl(H)===T&&(Se=new Se(E,A+"enter",oe,a,H),Se.target=O,Se.relatedTarget=Xe,L=Se),Xe=L,D&&oe)t:{for(Se=Ty,E=D,A=oe,O=0,L=E;L;L=Se(L))O++;L=0;for(var ye=A;ye;ye=Se(ye))L++;for(;0<O-L;)E=Se(E),O--;for(;0<L-O;)A=Se(A),L--;for(;O--;){if(E===A||A!==null&&E===A.alternate){Se=E;break t}E=Se(E),A=Se(A)}Se=null}else Se=null;D!==null&&gm(G,R,D,Se,!1),oe!==null&&Xe!==null&&gm(G,Xe,oe,Se,!0)}}e:{if(R=T?di(T):window,D=R.nodeName&&R.nodeName.toLowerCase(),D==="select"||D==="input"&&R.type==="file")var $e=Rd;else if(Td(R))if(Md)$e=qg;else{$e=Lg;var he=$g}else D=R.nodeName,!D||D.toLowerCase()!=="input"||R.type!=="checkbox"&&R.type!=="radio"?T&&ac(T.elementType)&&($e=Rd):$e=Bg;if($e&&($e=$e(e,T))){kd(G,$e,a,H);break e}he&&he(e,R,T),e==="focusout"&&T&&R.type==="number"&&T.memoizedProps.value!=null&&nc(R,"number",R.value)}switch(he=T?di(T):window,e){case"focusin":(Td(he)||he.contentEditable==="true")&&(Cl=he,gc=T,ji=null);break;case"focusout":ji=gc=Cl=null;break;case"mousedown":yc=!0;break;case"contextmenu":case"mouseup":case"dragend":yc=!1,qd(G,a,H);break;case"selectionchange":if(Yg)break;case"keydown":case"keyup":qd(G,a,H)}var Ee;if(hc)e:{switch(e){case"compositionstart":var ke="onCompositionStart";break e;case"compositionend":ke="onCompositionEnd";break e;case"compositionupdate":ke="onCompositionUpdate";break e}ke=void 0}else Al?wd(e,a)&&(ke="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(ke="onCompositionStart");ke&&(Cd&&a.locale!=="ko"&&(Al||ke!=="onCompositionStart"?ke==="onCompositionEnd"&&Al&&(Ee=xd()):(ma=H,cc="value"in ma?ma.value:ma.textContent,Al=!0)),he=or(T,ke),0<he.length&&(ke=new Nd(ke,e,null,a,H),G.push({event:ke,listeners:he}),Ee?ke.data=Ee:(Ee=Od(a),Ee!==null&&(ke.data=Ee)))),(Ee=Mg?Dg(e,a):Ug(e,a))&&(ke=or(T,"onBeforeInput"),0<ke.length&&(he=new Nd("onBeforeInput","beforeinput",null,a,H),G.push({event:he,listeners:ke}),he.data=Ee)),zy(G,e,T,a,H)}pm(G,t)})}function Ji(e,t,a){return{instance:e,listener:t,currentTarget:a}}function or(e,t){for(var a=t+"Capture",s=[];e!==null;){var c=e,o=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||o===null||(c=fi(e,a),c!=null&&s.unshift(Ji(e,c,o)),c=fi(e,t),c!=null&&s.push(Ji(e,c,o))),e.tag===3)return s;e=e.return}return[]}function Ty(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function gm(e,t,a,s,c){for(var o=t._reactName,h=[];a!==null&&a!==s;){var y=a,_=y.alternate,T=y.stateNode;if(y=y.tag,_!==null&&_===s)break;y!==5&&y!==26&&y!==27||T===null||(_=T,c?(T=fi(a,o),T!=null&&h.unshift(Ji(a,T,_))):c||(T=fi(a,o),T!=null&&h.push(Ji(a,T,_)))),a=a.return}h.length!==0&&e.push({event:t,listeners:h})}var ky=/\r\n?/g,Ry=/\u0000|\uFFFD/g;function ym(e){return(typeof e=="string"?e:""+e).replace(ky,`
9
- `).replace(Ry,"")}function bm(e,t){return t=ym(t),ym(e)===t}function Ve(e,t,a,s,c,o){switch(a){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Sl(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Sl(e,""+s);break;case"className":ms(e,"class",s);break;case"tabIndex":ms(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":ms(e,a,s);break;case"style":yd(e,s,o);break;case"data":if(t!=="object"){ms(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=vs(""+s),e.setAttribute(a,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(a,"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 o=="function"&&(a==="formAction"?(t!=="input"&&Ve(e,t,"name",c.name,c,null),Ve(e,t,"formEncType",c.formEncType,c,null),Ve(e,t,"formMethod",c.formMethod,c,null),Ve(e,t,"formTarget",c.formTarget,c,null)):(Ve(e,t,"encType",c.encType,c,null),Ve(e,t,"method",c.method,c,null),Ve(e,t,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=vs(""+s),e.setAttribute(a,s);break;case"onClick":s!=null&&(e.onclick=Kn);break;case"onScroll":s!=null&&Oe("scroll",e);break;case"onScrollEnd":s!=null&&Oe("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(u(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}a=vs(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""+s):e.removeAttribute(a);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":s===!0?e.setAttribute(a,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,s):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(a,s):e.removeAttribute(a);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(a):e.setAttribute(a,s);break;case"popover":Oe("beforetoggle",e),Oe("toggle",e),hs(e,"popover",s);break;case"xlinkActuate":Jn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Jn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Jn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Jn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Jn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Jn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Jn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Jn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Jn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":hs(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=rg.get(a)||a,hs(e,a,s))}}function Gu(e,t,a,s,c,o){switch(a){case"style":yd(e,s,o);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(u(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"children":typeof s=="string"?Sl(e,s):(typeof s=="number"||typeof s=="bigint")&&Sl(e,""+s);break;case"onScroll":s!=null&&Oe("scroll",e);break;case"onScrollEnd":s!=null&&Oe("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Kn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ud.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),o=e[Jt]||null,o=o!=null?o[a]:null,typeof o=="function"&&e.removeEventListener(t,o,c),typeof s=="function")){typeof o!="function"&&o!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,s,c);break e}a in e?e[a]=s:s===!0?e.setAttribute(a,""):hs(e,a,s)}}}function Mt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Oe("error",e),Oe("load",e);var s=!1,c=!1,o;for(o in a)if(a.hasOwnProperty(o)){var h=a[o];if(h!=null)switch(o){case"src":s=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Ve(e,t,o,h,a,null)}}c&&Ve(e,t,"srcSet",a.srcSet,a,null),s&&Ve(e,t,"src",a.src,a,null);return;case"input":Oe("invalid",e);var y=o=h=c=null,_=null,T=null;for(s in a)if(a.hasOwnProperty(s)){var H=a[s];if(H!=null)switch(s){case"name":c=H;break;case"type":h=H;break;case"checked":_=H;break;case"defaultChecked":T=H;break;case"value":o=H;break;case"defaultValue":y=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(u(137,t));break;default:Ve(e,t,s,H,a,null)}}md(e,o,y,_,T,h,c,!1);return;case"select":Oe("invalid",e),s=h=o=null;for(c in a)if(a.hasOwnProperty(c)&&(y=a[c],y!=null))switch(c){case"value":o=y;break;case"defaultValue":h=y;break;case"multiple":s=y;default:Ve(e,t,c,y,a,null)}t=o,a=h,e.multiple=!!s,t!=null?xl(e,!!s,t,!1):a!=null&&xl(e,!!s,a,!0);return;case"textarea":Oe("invalid",e),o=c=s=null;for(h in a)if(a.hasOwnProperty(h)&&(y=a[h],y!=null))switch(h){case"value":s=y;break;case"defaultValue":c=y;break;case"children":o=y;break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(u(91));break;default:Ve(e,t,h,y,a,null)}vd(e,s,c,o);return;case"option":for(_ in a)a.hasOwnProperty(_)&&(s=a[_],s!=null)&&(_==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":Ve(e,t,_,s,a,null));return;case"dialog":Oe("beforetoggle",e),Oe("toggle",e),Oe("cancel",e),Oe("close",e);break;case"iframe":case"object":Oe("load",e);break;case"video":case"audio":for(s=0;s<Yi.length;s++)Oe(Yi[s],e);break;case"image":Oe("error",e),Oe("load",e);break;case"details":Oe("toggle",e);break;case"embed":case"source":case"link":Oe("error",e),Oe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(T in a)if(a.hasOwnProperty(T)&&(s=a[T],s!=null))switch(T){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Ve(e,t,T,s,a,null)}return;default:if(ac(t)){for(H in a)a.hasOwnProperty(H)&&(s=a[H],s!==void 0&&Gu(e,t,H,s,a,void 0));return}}for(y in a)a.hasOwnProperty(y)&&(s=a[y],s!=null&&Ve(e,t,y,s,a,null))}function My(e,t,a,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,o=null,h=null,y=null,_=null,T=null,H=null;for(D in a){var G=a[D];if(a.hasOwnProperty(D)&&G!=null)switch(D){case"checked":break;case"value":break;case"defaultValue":_=G;default:s.hasOwnProperty(D)||Ve(e,t,D,null,s,G)}}for(var R in s){var D=s[R];if(G=a[R],s.hasOwnProperty(R)&&(D!=null||G!=null))switch(R){case"type":o=D;break;case"name":c=D;break;case"checked":T=D;break;case"defaultChecked":H=D;break;case"value":h=D;break;case"defaultValue":y=D;break;case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(u(137,t));break;default:D!==G&&Ve(e,t,R,D,s,G)}}tc(e,h,y,_,T,H,o,c);return;case"select":D=h=y=R=null;for(o in a)if(_=a[o],a.hasOwnProperty(o)&&_!=null)switch(o){case"value":break;case"multiple":D=_;default:s.hasOwnProperty(o)||Ve(e,t,o,null,s,_)}for(c in s)if(o=s[c],_=a[c],s.hasOwnProperty(c)&&(o!=null||_!=null))switch(c){case"value":R=o;break;case"defaultValue":y=o;break;case"multiple":h=o;default:o!==_&&Ve(e,t,c,o,s,_)}t=y,a=h,s=D,R!=null?xl(e,!!a,R,!1):!!s!=!!a&&(t!=null?xl(e,!!a,t,!0):xl(e,!!a,a?[]:"",!1));return;case"textarea":D=R=null;for(y in a)if(c=a[y],a.hasOwnProperty(y)&&c!=null&&!s.hasOwnProperty(y))switch(y){case"value":break;case"children":break;default:Ve(e,t,y,null,s,c)}for(h in s)if(c=s[h],o=a[h],s.hasOwnProperty(h)&&(c!=null||o!=null))switch(h){case"value":R=c;break;case"defaultValue":D=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(u(91));break;default:c!==o&&Ve(e,t,h,c,s,o)}pd(e,R,D);return;case"option":for(var oe in a)R=a[oe],a.hasOwnProperty(oe)&&R!=null&&!s.hasOwnProperty(oe)&&(oe==="selected"?e.selected=!1:Ve(e,t,oe,null,s,R));for(_ in s)R=s[_],D=a[_],s.hasOwnProperty(_)&&R!==D&&(R!=null||D!=null)&&(_==="selected"?e.selected=R&&typeof R!="function"&&typeof R!="symbol":Ve(e,t,_,R,s,D));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 Se in a)R=a[Se],a.hasOwnProperty(Se)&&R!=null&&!s.hasOwnProperty(Se)&&Ve(e,t,Se,null,s,R);for(T in s)if(R=s[T],D=a[T],s.hasOwnProperty(T)&&R!==D&&(R!=null||D!=null))switch(T){case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(u(137,t));break;default:Ve(e,t,T,R,s,D)}return;default:if(ac(t)){for(var Xe in a)R=a[Xe],a.hasOwnProperty(Xe)&&R!==void 0&&!s.hasOwnProperty(Xe)&&Gu(e,t,Xe,void 0,s,R);for(H in s)R=s[H],D=a[H],!s.hasOwnProperty(H)||R===D||R===void 0&&D===void 0||Gu(e,t,H,R,s,D);return}}for(var E in a)R=a[E],a.hasOwnProperty(E)&&R!=null&&!s.hasOwnProperty(E)&&Ve(e,t,E,null,s,R);for(G in s)R=s[G],D=a[G],!s.hasOwnProperty(G)||R===D||R==null&&D==null||Ve(e,t,G,R,s,D)}function jm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Dy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),s=0;s<a.length;s++){var c=a[s],o=c.transferSize,h=c.initiatorType,y=c.duration;if(o&&y&&jm(h)){for(h=0,y=c.responseEnd,s+=1;s<a.length;s++){var _=a[s],T=_.startTime;if(T>y)break;var H=_.transferSize,G=_.initiatorType;H&&jm(G)&&(_=_.responseEnd,h+=H*(_<y?1:(y-T)/(_-T)))}if(--s,t+=8*(o+h)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Yu=null,Ju=null;function dr(e){return e.nodeType===9?e:e.ownerDocument}function xm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Sm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Ku(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Qu=null;function Uy(){var e=window.event;return e&&e.type==="popstate"?e===Qu?!1:(Qu=e,!0):(Qu=null,!1)}var _m=typeof setTimeout=="function"?setTimeout:void 0,Zy=typeof clearTimeout=="function"?clearTimeout:void 0,Nm=typeof Promise=="function"?Promise:void 0,Hy=typeof queueMicrotask=="function"?queueMicrotask:typeof Nm<"u"?function(e){return Nm.resolve(null).then(e).catch($y)}:_m;function $y(e){setTimeout(function(){throw e})}function Ta(e){return e==="head"}function Am(e,t){var a=t,s=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(s===0){e.removeChild(c),Wl(t);return}s--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")s++;else if(a==="html")Ki(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Ki(a);for(var o=a.firstChild;o;){var h=o.nextSibling,y=o.nodeName;o[oi]||y==="SCRIPT"||y==="STYLE"||y==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=h}}else a==="body"&&Ki(e.ownerDocument.body);a=c}while(a);Wl(t)}function Cm(e,t){var a=e;e=0;do{var s=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),s&&s.nodeType===8)if(a=s.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=s}while(a)}function Vu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Vu(a),Wr(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Ly(e,t,a,s){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[oi])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=bn(e.nextSibling),e===null)break}return null}function By(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=bn(e.nextSibling),e===null))return null;return e}function zm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=bn(e.nextSibling),e===null))return null;return e}function Xu(e){return e.data==="$?"||e.data==="$~"}function Iu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function qy(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var s=function(){t(),a.removeEventListener("DOMContentLoaded",s)};a.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function bn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Pu=null;function Em(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return bn(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function wm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Om(e,t,a){switch(t=dr(a),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function Ki(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Wr(e)}var jn=new Map,Tm=new Set;function fr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ca=F.d;F.d={f:Gy,r:Yy,D:Jy,C:Ky,L:Qy,m:Vy,X:Iy,S:Xy,M:Py};function Gy(){var e=ca.f(),t=ar();return e||t}function Yy(e){var t=yl(e);t!==null&&t.tag===5&&t.type==="form"?Vf(t):ca.r(e)}var Il=typeof document>"u"?null:document;function km(e,t,a){var s=Il;if(s&&typeof t=="string"&&t){var c=fn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),Tm.has(c)||(Tm.add(c),e={rel:e,crossOrigin:a,href:t},s.querySelector(c)===null&&(t=s.createElement("link"),Mt(t,"link",e),Et(t),s.head.appendChild(t)))}}function Jy(e){ca.D(e),km("dns-prefetch",e,null)}function Ky(e,t){ca.C(e,t),km("preconnect",e,t)}function Qy(e,t,a){ca.L(e,t,a);var s=Il;if(s&&e&&t){var c='link[rel="preload"][as="'+fn(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+fn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+fn(a.imageSizes)+'"]')):c+='[href="'+fn(e)+'"]';var o=c;switch(t){case"style":o=Pl(e);break;case"script":o=Fl(e)}jn.has(o)||(e=j({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),jn.set(o,e),s.querySelector(c)!==null||t==="style"&&s.querySelector(Qi(o))||t==="script"&&s.querySelector(Vi(o))||(t=s.createElement("link"),Mt(t,"link",e),Et(t),s.head.appendChild(t)))}}function Vy(e,t){ca.m(e,t);var a=Il;if(a&&e){var s=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+fn(s)+'"][href="'+fn(e)+'"]',o=c;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Fl(e)}if(!jn.has(o)&&(e=j({rel:"modulepreload",href:e},t),jn.set(o,e),a.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Vi(o)))return}s=a.createElement("link"),Mt(s,"link",e),Et(s),a.head.appendChild(s)}}}function Xy(e,t,a){ca.S(e,t,a);var s=Il;if(s&&e){var c=bl(s).hoistableStyles,o=Pl(e);t=t||"default";var h=c.get(o);if(!h){var y={loading:0,preload:null};if(h=s.querySelector(Qi(o)))y.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},a),(a=jn.get(o))&&Fu(e,a);var _=h=s.createElement("link");Et(_),Mt(_,"link",e),_._p=new Promise(function(T,H){_.onload=T,_.onerror=H}),_.addEventListener("load",function(){y.loading|=1}),_.addEventListener("error",function(){y.loading|=2}),y.loading|=4,hr(h,t,s)}h={type:"stylesheet",instance:h,count:1,state:y},c.set(o,h)}}}function Iy(e,t){ca.X(e,t);var a=Il;if(a&&e){var s=bl(a).hoistableScripts,c=Fl(e),o=s.get(c);o||(o=a.querySelector(Vi(c)),o||(e=j({src:e,async:!0},t),(t=jn.get(c))&&Wu(e,t),o=a.createElement("script"),Et(o),Mt(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},s.set(c,o))}}function Py(e,t){ca.M(e,t);var a=Il;if(a&&e){var s=bl(a).hoistableScripts,c=Fl(e),o=s.get(c);o||(o=a.querySelector(Vi(c)),o||(e=j({src:e,async:!0,type:"module"},t),(t=jn.get(c))&&Wu(e,t),o=a.createElement("script"),Et(o),Mt(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},s.set(c,o))}}function Rm(e,t,a,s){var c=(c=xe.current)?fr(c):null;if(!c)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Pl(a.href),a=bl(c).hoistableStyles,s=a.get(t),s||(s={type:"style",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Pl(a.href);var o=bl(c).hoistableStyles,h=o.get(e);if(h||(c=c.ownerDocument||c,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,h),(o=c.querySelector(Qi(e)))&&!o._p&&(h.instance=o,h.state.loading=5),jn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},jn.set(e,a),o||Fy(c,e,a,h.state))),t&&s===null)throw Error(u(528,""));return h}if(t&&s!==null)throw Error(u(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Fl(a),a=bl(c).hoistableScripts,s=a.get(t),s||(s={type:"script",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Pl(e){return'href="'+fn(e)+'"'}function Qi(e){return'link[rel="stylesheet"]['+e+"]"}function Mm(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function Fy(e,t,a,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Mt(t,"link",a),Et(t),e.head.appendChild(t))}function Fl(e){return'[src="'+fn(e)+'"]'}function Vi(e){return"script[async]"+e}function Dm(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+fn(a.href)+'"]');if(s)return t.instance=s,Et(s),s;var c=j({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Et(s),Mt(s,"style",c),hr(s,a.precedence,e),t.instance=s;case"stylesheet":c=Pl(a.href);var o=e.querySelector(Qi(c));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;s=Mm(a),(c=jn.get(c))&&Fu(s,c),o=(e.ownerDocument||e).createElement("link"),Et(o);var h=o;return h._p=new Promise(function(y,_){h.onload=y,h.onerror=_}),Mt(o,"link",s),t.state.loading|=4,hr(o,a.precedence,e),t.instance=o;case"script":return o=Fl(a.src),(c=e.querySelector(Vi(o)))?(t.instance=c,Et(c),c):(s=a,(c=jn.get(o))&&(s=j({},a),Wu(s,c)),e=e.ownerDocument||e,c=e.createElement("script"),Et(c),Mt(c,"link",s),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,hr(s,a.precedence,e));return t.instance}function hr(e,t,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=s.length?s[s.length-1]:null,o=c,h=0;h<s.length;h++){var y=s[h];if(y.dataset.precedence===t)o=y;else if(o!==c)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Fu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Wu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var mr=null;function Um(e,t,a){if(mr===null){var s=new Map,c=mr=new Map;c.set(a,s)}else c=mr,s=c.get(a),s||(s=new Map,c.set(a,s));if(s.has(e))return s;for(s.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var o=a[c];if(!(o[oi]||o[Ot]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var h=o.getAttribute(t)||"";h=e+h;var y=s.get(h);y?y.push(o):s.set(h,[o])}}return s}function Zm(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Wy(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Hm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function eb(e,t,a,s){if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=Pl(s.href),o=t.querySelector(Qi(c));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=pr.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=o,Et(o);return}o=t.ownerDocument||t,s=Mm(s),(c=jn.get(c))&&Fu(s,c),o=o.createElement("link"),Et(o);var h=o;h._p=new Promise(function(y,_){h.onload=y,h.onerror=_}),Mt(o,"link",s),a.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=pr.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var eo=0;function tb(e,t){return e.stylesheets&&e.count===0&&gr(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var s=setTimeout(function(){if(e.stylesheets&&gr(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&eo===0&&(eo=62500*Dy());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&gr(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>eo?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(c)}}:null}function pr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var vr=null;function gr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,vr=new Map,t.forEach(nb,e),vr=null,pr.call(e))}function nb(e,t){if(!(t.state.loading&4)){var a=vr.get(e);if(a)var s=a.get(null);else{a=new Map,vr.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<c.length;o++){var h=c[o];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(a.set(h.dataset.precedence,h),s=h)}s&&a.set(null,s)}c=t.instance,h=c.getAttribute("data-precedence"),o=a.get(h)||s,o===s&&a.set(null,c),a.set(h,c),this.count++,s=pr.bind(this),c.addEventListener("load",s),c.addEventListener("error",s),o?o.parentNode.insertBefore(c,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var Xi={$$typeof:X,Provider:null,Consumer:null,_currentValue:fe,_currentValue2:fe,_threadCount:0};function ab(e,t,a,s,c,o,h,y,_){this.tag=1,this.containerInfo=e,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=ui(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ui(0),this.hiddenUpdates=ui(null),this.identifierPrefix=s,this.onUncaughtError=c,this.onCaughtError=o,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.incompleteTransitions=new Map}function $m(e,t,a,s,c,o,h,y,_,T,H,G){return e=new ab(e,t,a,h,_,T,H,G,y),t=1,o===!0&&(t|=24),o=tn(3,null,null,t),e.current=o,o.stateNode=e,t=Rc(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:s,isDehydrated:a,cache:t},Zc(o),e}function Lm(e){return e?(e=wl,e):wl}function Bm(e,t,a,s,c,o){c=Lm(c),s.context===null?s.context=c:s.pendingContext=c,s=ja(t),s.payload={element:a},o=o===void 0?null:o,o!==null&&(s.callback=o),a=xa(e,s,t),a!==null&&(Pt(a,e,t),zi(a,e,t))}function qm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function to(e,t){qm(e,t),(e=e.alternate)&&qm(e,t)}function Gm(e){if(e.tag===13||e.tag===31){var t=Wa(e,67108864);t!==null&&Pt(t,e,67108864),to(e,67108864)}}function Ym(e){if(e.tag===13||e.tag===31){var t=rn();t=Ir(t);var a=Wa(e,t);a!==null&&Pt(a,e,t),to(e,t)}}var yr=!0;function lb(e,t,a,s){var c=Z.T;Z.T=null;var o=F.p;try{F.p=2,no(e,t,a,s)}finally{F.p=o,Z.T=c}}function ib(e,t,a,s){var c=Z.T;Z.T=null;var o=F.p;try{F.p=8,no(e,t,a,s)}finally{F.p=o,Z.T=c}}function no(e,t,a,s){if(yr){var c=ao(s);if(c===null)qu(e,t,s,br,a),Km(e,s);else if(rb(c,e,t,a,s))s.stopPropagation();else if(Km(e,s),t&4&&-1<sb.indexOf(e)){for(;c!==null;){var o=yl(c);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var h=Zt(o.pendingLanes);if(h!==0){var y=o;for(y.pendingLanes|=2,y.entangledLanes|=2;h;){var _=1<<31-Bt(h);y.entanglements[1]|=_,h&=~_}Ln(o),(Be&6)===0&&(tr=ne()+500,Gi(0))}}break;case 31:case 13:y=Wa(o,2),y!==null&&Pt(y,o,2),ar(),to(o,2)}if(o=ao(s),o===null&&qu(e,t,s,br,a),o===c)break;c=o}c!==null&&s.stopPropagation()}else qu(e,t,s,null,a)}}function ao(e){return e=ic(e),lo(e)}var br=null;function lo(e){if(br=null,e=gl(e),e!==null){var t=f(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===31){if(e=p(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return br=e,null}function Jm(e){switch(e){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(Me()){case Ce:return 2;case nt:return 8;case gt:case fa:return 32;case Ka:return 268435456;default:return 32}default:return 32}}var io=!1,ka=null,Ra=null,Ma=null,Ii=new Map,Pi=new Map,Da=[],sb="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 Km(e,t){switch(e){case"focusin":case"focusout":ka=null;break;case"dragenter":case"dragleave":Ra=null;break;case"mouseover":case"mouseout":Ma=null;break;case"pointerover":case"pointerout":Ii.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pi.delete(t.pointerId)}}function Fi(e,t,a,s,c,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:a,eventSystemFlags:s,nativeEvent:o,targetContainers:[c]},t!==null&&(t=yl(t),t!==null&&Gm(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function rb(e,t,a,s,c){switch(t){case"focusin":return ka=Fi(ka,e,t,a,s,c),!0;case"dragenter":return Ra=Fi(Ra,e,t,a,s,c),!0;case"mouseover":return Ma=Fi(Ma,e,t,a,s,c),!0;case"pointerover":var o=c.pointerId;return Ii.set(o,Fi(Ii.get(o)||null,e,t,a,s,c)),!0;case"gotpointercapture":return o=c.pointerId,Pi.set(o,Fi(Pi.get(o)||null,e,t,a,s,c)),!0}return!1}function Qm(e){var t=gl(e.target);if(t!==null){var a=f(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,sd(e.priority,function(){Ym(a)});return}}else if(t===31){if(t=p(a),t!==null){e.blockedOn=t,sd(e.priority,function(){Ym(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=ao(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);lc=s,a.target.dispatchEvent(s),lc=null}else return t=yl(a),t!==null&&Gm(t),e.blockedOn=a,!1;t.shift()}return!0}function Vm(e,t,a){jr(e)&&a.delete(t)}function cb(){io=!1,ka!==null&&jr(ka)&&(ka=null),Ra!==null&&jr(Ra)&&(Ra=null),Ma!==null&&jr(Ma)&&(Ma=null),Ii.forEach(Vm),Pi.forEach(Vm)}function xr(e,t){e.blockedOn===t&&(e.blockedOn=null,io||(io=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,cb)))}var Sr=null;function Xm(e){Sr!==e&&(Sr=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Sr===e&&(Sr=null);for(var t=0;t<e.length;t+=3){var a=e[t],s=e[t+1],c=e[t+2];if(typeof s!="function"){if(lo(s||a)===null)continue;break}var o=yl(a);o!==null&&(e.splice(t,3),t-=3,au(o,{pending:!0,data:c,method:a.method,action:s},s,c))}}))}function Wl(e){function t(_){return xr(_,e)}ka!==null&&xr(ka,e),Ra!==null&&xr(Ra,e),Ma!==null&&xr(Ma,e),Ii.forEach(t),Pi.forEach(t);for(var a=0;a<Da.length;a++){var s=Da[a];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Da.length&&(a=Da[0],a.blockedOn===null);)Qm(a),a.blockedOn===null&&Da.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var c=a[s],o=a[s+1],h=c[Jt]||null;if(typeof o=="function")h||Xm(a);else if(h){var y=null;if(o&&o.hasAttribute("formAction")){if(c=o,h=o[Jt]||null)y=h.formAction;else if(lo(c)!==null)continue}else y=h.action;typeof y=="function"?a[s+1]=y:(a.splice(s,3),s-=3),Xm(a)}}}function Im(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(h){return c=h})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),s||setTimeout(a,20)}function a(){if(!s&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function so(e){this._internalRoot=e}_r.prototype.render=so.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var a=t.current,s=rn();Bm(a,s,e,t,null,null)},_r.prototype.unmount=so.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Bm(e.current,2,null,e,null,null),ar(),t[vl]=null}};function _r(e){this._internalRoot=e}_r.prototype.unstable_scheduleHydration=function(e){if(e){var t=id();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Da.length&&t!==0&&t<Da[a].priority;a++);Da.splice(a,0,e),a===0&&Qm(e)}};var Pm=l.version;if(Pm!=="19.2.7")throw Error(u(527,Pm,"19.2.7"));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=g(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var ub={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nr.isDisabled&&Nr.supportsFiber)try{Qa=Nr.inject(ub),Lt=Nr}catch{}}return es.createRoot=function(e,t){if(!d(e))throw Error(u(299));var a=!1,s="",c=lh,o=ih,h=sh;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=$m(e,1,!1,null,null,a,s,null,c,o,h,Im),e[vl]=t.current,Bu(e),new so(t)},es.hydrateRoot=function(e,t,a){if(!d(e))throw Error(u(299));var s=!1,c="",o=lh,h=ih,y=sh,_=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(h=a.onCaughtError),a.onRecoverableError!==void 0&&(y=a.onRecoverableError),a.formState!==void 0&&(_=a.formState)),t=$m(e,1,!0,t,a??null,s,c,_,o,h,y,Im),t.context=Lm(null),a=t.current,s=rn(),s=Ir(s),c=ja(s),c.callback=null,xa(a,c,s),a=s,t.current.lanes=a,Va(t,a),Ln(t),e[vl]=t.current,Bu(e),new _r(t)},es.version="19.2.7",es}var rp;function jb(){if(rp)return uo.exports;rp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),uo.exports=bb(),uo.exports}var xb=jb();const Sb=Wp(xb);function No(n){const l=Object.values(n).filter(u=>typeof u=="number");return Object.entries(n).filter(([u,d])=>l.indexOf(+u)===-1).map(([u,d])=>d)}function cp(n,l="|"){return n.map(r=>iv(r)).join(l)}function Ao(n,l){return typeof l=="bigint"?l.toString():l}class _b{constructor(l){this._getter=l,this._value=void 0}get value(){const l=this._getter;return l!==void 0&&(this._value=l(),this._getter=void 0),this._value}}function Lo(n){return new _b(n)}function Nb(n){return n==null}function Bo(n){const l=n.startsWith("^")?1:0,r=n.endsWith("$")?n.length-1:n.length;return n.slice(l,r)}function Ab(n,l){const r=n/l,u=Math.round(r),d=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-u)<d?0:r-u}function Ba(n,l,r){Object.defineProperty(n,l,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ev(n){const l=Object.getOwnPropertyDescriptor(n,"shape");return l?.get?l.get.raw:l?.value}function da(n){return ev(n._zod.def)??n._zod.def.shape}function tv(n,l,r){Object.defineProperty(n,l,{get(){const u=r();return Ba(this,l,u),u},enumerable:!0,configurable:!0})}function nv(n,l,r){l in n?Ba(n,l,r):n[l]=r}function pl(n,l,r,u){const d=da(l);for(const f of r){const m=Object.getOwnPropertyDescriptor(d,f);m.enumerable&&(m.get?tv(n,f,()=>{const p=l._zod.def.shape[f];return u?u(p,f):p}):nv(n,f,u?u(m.value,f):m.value))}}function Cb(n,l){for(const r of Reflect.ownKeys(l)){const u=Object.getOwnPropertyDescriptor(l,r);u.enumerable&&(u.get?tv(n,r,()=>l[r]):nv(n,r,u.value))}}function cn(...n){const l={};for(const r of n){const u=Object.getOwnPropertyDescriptors(r);Object.assign(l,u)}return Object.defineProperties({},l)}function zb(n){return JSON.stringify(n)}function Eb(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const av="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function kr(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const wb=Lo(()=>{if(Tn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const n=Function;return new n(""),!0}catch{return!1}});function ai(n){if(kr(n)===!1)return!1;const l=n.constructor;if(l===void 0||typeof l!="function")return!0;const r=l.prototype;return!(kr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function lv(n){return ai(n)?{...n}:Array.isArray(n)?[...n]:n instanceof Map?new Map(n):n instanceof Set?new Set(n):n}const Ob=new Set(["string","number","symbol"]);function Lr(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qa(n,l,r){const u=new n._zod.constr(l??n._zod.def);return(!l||r?.parent)&&(u._zod.parent=n),u}function ge(n){const l=n;if(!l)return{};if(typeof l=="string")return{error:()=>l};if(l?.message!==void 0){if(l?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");l.error=l.message}return delete l.message,typeof l.error=="string"?{...l,error:()=>l.error}:l}function iv(n){return typeof n=="bigint"?n.toString()+"n":typeof n=="string"?`"${n}"`:`${n}`}function Tb(n){return Object.keys(n).filter(l=>n[l]._zod.optin!==void 0&&n[l]._zod.optout==="optional")}const sv={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},kb={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Rb(n,l){const r=n._zod.def,u=r.checks;if(u&&u.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const f={};return pl(f,n,Br(n,l)),qa(n,cn(r,{shape:f,checks:[]}))}function Br(n,l){const r=da(n),u=[];for(const d of Reflect.ownKeys(l)){if(!Object.getOwnPropertyDescriptor(r,d)?.enumerable)throw new Error(`Unrecognized key: "${String(d)}"`);l[d]&&u.push(d)}return u}function Mb(n,l){const r=n._zod.def,u=r.checks;if(u&&u.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const f=new Set(Br(n,l)),m={};return pl(m,n,Reflect.ownKeys(da(n)).filter(p=>!f.has(p))),qa(n,cn(r,{shape:m,checks:[]}))}function Db(n,l){if(!ai(l))throw new Error("Invalid input to extend: expected a plain object");const r=n._zod.def.checks;if(r&&r.length>0){const d=da(n);for(const f of Reflect.ownKeys(l))if(Object.getOwnPropertyDescriptor(d,f)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return qa(n,cn(n._zod.def,{shape:rv(n,l)}))}function rv(n,l){const r={};return pl(r,n,Reflect.ownKeys(da(n))),Cb(r,l),r}function Ub(n,l){if(!ai(l))throw new Error("Invalid input to safeExtend: expected a plain object");return qa(n,cn(n._zod.def,{shape:rv(n,l)}))}function Zb(n,l){if(!l?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(n._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r={};pl(r,n,Reflect.ownKeys(da(n))),pl(r,l,Reflect.ownKeys(da(l)));const u=cn(n._zod.def,{shape:r,get catchall(){return l._zod.def.catchall},checks:l._zod.def.checks??[]});return qa(n,u)}function up(n,l,r,u="partial"){const f=l._zod.def.checks;if(f&&f.length>0)throw new Error(`.${u}() cannot be used on object schemas containing refinements`);const p=r?new Set(Br(l,r)):void 0,v={};return pl(v,l,Reflect.ownKeys(da(l)),n&&((g,b)=>p&&!p.has(b)?g:new n({type:"optional",innerType:g}))),qa(l,cn(l._zod.def,{shape:v,checks:[]}))}function Hb(n,l,r){const u=r?new Set(Br(l,r)):void 0,d={};return pl(d,l,Reflect.ownKeys(da(l)),(f,m)=>u&&!u.has(m)?f:new n({type:"nonoptional",innerType:f})),qa(l,cn(l._zod.def,{shape:d}))}function oa(n,l=0){if(n.aborted===!0)return!0;for(let r=l;r<n.issues.length;r++)if(n.issues[r]?.continue!==!0)return!0;return!1}function $b(n,l=0){if(n.aborted===!0)return!0;for(let r=l;r<n.issues.length;r++)if(n.issues[r]?.continue===!1)return!0;return!1}function ti(n,l){return l.map(r=>{var u;return(u=r).path??(u.path=[]),r.path.unshift(n),r})}function ts(n){return typeof n=="string"?n:n?.message}function op(n){const l=[];for(const r of n??[]){const u=r._zod.def;if(!/_(length|size)$|_equals$/.test(u.check))break;const d=u.maximum??u.length??u.size;d>=0&&l.push([d,r])}return l}function Co(n,l,r){var u;for(let d=l;d<n.length;d++)(u=n[d]).schema??(u.schema=r)}function $a(n,l,r){var u;const d=n.inst?._zod?.traits;d?.has("$ZodType")&&(d.has("$ZodCheck")?(u=n).schema??(u.schema=n.inst):n.schema=n.inst);const f=n.schema!==n.inst?n.schema?._zod.def?.error:void 0,m=n.message?n.message:ts(n.inst?._zod.def?.error?.(n))??ts(f?.(n))??ts(l?.error?.(n))??ts(r.customError?.(n))??ts(r.localeError?.(n))??"Invalid input",p={};for(const v of Object.keys(n))v==="inst"||v==="schema"||v==="continue"||v==="input"||v==="__proto__"||(p[v]=n[v]);return p.path??(p.path=[]),p.message=m,l?.reportInput&&(p.input=n.input),p}const Lb=/[\uD800-\uDBFF]/;function qo(n){const l=n.length;if(!Lb.test(n))return l;let r=l;for(let u=0;u<l-1;u++)(n.charCodeAt(u)&64512)===55296&&(n.charCodeAt(u+1)&64512)===56320&&(r--,u++);return r}function Go(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function Bb(n){const l=typeof n;switch(l){case"number":return Number.isNaN(n)?"nan":"number";case"object":{if(n===null)return"null";if(Array.isArray(n))return"array";const r=n;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return l}function rs(...n){const[l,r,u]=n;return typeof l=="string"?{message:l,code:"custom",input:r,inst:u}:{...l}}function qb(n,l){for(const r in l){const u=Object.getOwnPropertyDescriptor(l,r);u.get?Object.defineProperty(n,r,{...u,enumerable:!1}):Gb(n,r,u.value)}}function La(n,l,r,u=!0){return Object.defineProperty(n,l,{configurable:!0,writable:!0,enumerable:u,value:r}),r}function cv(n,l,r){return La(n,l,r,!1)}function uv(n,l){for(const r in n){const u=n[r];Object.defineProperty(l,r,{configurable:!0,enumerable:!0,get(){return La(this,r,u(this))},set(d){La(this,r,d)}})}return l}function Gb(n,l,r){Object.defineProperty(n,l,{configurable:!0,get(){return this==null?r:La(this,l,r.bind(this))},set(u){La(this,l,u)}})}function Yb(n,l){const r=Object.getPrototypeOf(n);return l in r?void 0:r}let mo,Za=!1;const Jb={configurable:!0,get(){Za=!0}};function Ke(n,l,r){const u=Object.getPrototypeOf(n._zod);if(l in u&&mo!==n._zod){mo=void 0;return}mo=n._zod,Object.defineProperty(u,l,{configurable:!0,get(){Object.defineProperty(this,l,Jb);const d=Za;Za=!1;try{const f=r(this);return Za?delete this[l]:Object.defineProperty(this,l,{configurable:!0,writable:!0,value:f}),Za=Za||d,f}catch(f){throw delete this[l],Za=Za||d,f}},set(d){Object.defineProperty(this,l,{configurable:!0,writable:!0,value:d})}})}function Kb(n,l,r,u){const d=Yb(n,l);d&&Object.defineProperty(d,l,{configurable:!0,get(){const f={configurable:!0,writable:!0,enumerable:u,value:void 0};return Object.defineProperty(this,l,f),f.value=r(this),Object.defineProperty(this,l,f),f.value},set(f){Object.defineProperty(this,l,{configurable:!0,writable:!0,enumerable:u,value:f})}})}const Qb="~constantCatch";function Vb(n){const l=()=>n;return l[Qb]=!0,l}var dp;const po={value:void 0,enumerable:!1};let fp="captureStackTrace"in Error?Error:null;function Xb(n){const l=fp;if(l){const r=l.stackTraceLimit;if(typeof r=="number"){try{l.stackTraceLimit=0}catch{return fp=null,new n}try{return new n}finally{l.stackTraceLimit=r}}}return new n}function q(n,l,r,u){const d={};function f(C){this.def=C,this.constr=j,this.traits=new Set}f.prototype=d;const m=r,p=m&&new WeakSet;function v(C,z){if(C._zod){if(C._zod.traits.has(n))return}else{po.value=new f(z);try{Object.defineProperty(C,"_zod",po)}finally{po.value=void 0}}if(C._zod.traits.add(n),l(C,z),p){const K=Object.getPrototypeOf(C),J=C._zod.constr.prototype;let I=K;for(;I&&I!==J;)I=Object.getPrototypeOf(I);const ie=I??K;p.has(ie)||(p.add(ie),qb(ie,m))}const M=j.prototype;for(const K in M)Object.prototype.hasOwnProperty.call(M,K)&&(K in C||(C[K]=M[K].bind(C)))}const g=u?.Parent??Object;class b extends g{}Object.defineProperty(b,"name",{value:n});function j(C){const z=u?.Parent?Xb(b):this;v(z,C);const M=z._zod.deferred;if(M){for(const J of M)J();z._zod.deferred=void 0}const K=globalThis.__zod_globalConfig?.postProcessor;return K&&K(z),z}return Object.defineProperty(j,"init",{value:v}),Object.defineProperty(j,Symbol.hasInstance,{value:C=>u?.Parent&&C instanceof u.Parent?!0:C?._zod?.traits?.has(n)}),Object.defineProperty(j,"name",{value:n}),j}class ml extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ov extends Error{constructor(l){super(`Encountered unidirectional transform during encode: ${l}`),this.name="ZodEncodeError"}}(dp=globalThis).__zod_globalConfig??(dp.__zod_globalConfig={});const Tn=globalThis.__zod_globalConfig;function Gn(n){return n&&Object.assign(Tn,n),Tn}function Ib(){const n=this._zod;return n.message??(n.message=JSON.stringify(n.def,Ao,2)),n.message}function Pb(n){this._zod.message=n}const Fb={get:Ib,set:Pb,enumerable:!0,configurable:!0},vo={value:void 0,enumerable:!1},hp=new WeakSet([Object.prototype,Error.prototype]),Wb=(n,l)=>{n.name="$ZodError",vo.value=l,Object.defineProperty(n,"issues",vo),vo.value=void 0,Object.defineProperty(n,"message",Fb);const r=Object.getPrototypeOf(n);hp.has(r)||(hp.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){const u=()=>this.message;return Object.defineProperty(this,"toString",{value:u,configurable:!0,writable:!0}),u},set(u){Object.defineProperty(this,"toString",{value:u,configurable:!0,writable:!0})}}))},ej=q("$ZodError",Wb);function tj(n,l,r){return Object.prototype.hasOwnProperty.call(n,l)||(l==="__proto__"?Object.defineProperty(n,l,{value:r(),writable:!0,enumerable:!0,configurable:!0}):n[l]=r()),n[l]}function nj(n,l=r=>r.message){const r={},u=[];for(const d of n.issues)d.path.length>0?tj(r,d.path[0],()=>[]).push(l(d)):u.push(l(d));return{formErrors:u,fieldErrors:r}}function aj(n,l=r=>r.message){const r={_errors:[]},u=(d,f=[])=>{for(const m of d.issues)if(m.code==="invalid_union"&&m.errors.length)m.errors.map(p=>u({issues:p},[...f,...m.path]));else if(m.code==="invalid_key")u({issues:m.issues},[...f,...m.path]);else if(m.code==="invalid_element")u({issues:m.issues},[...f,...m.path]);else{const p=[...f,...m.path];if(p.length===0)r._errors.push(l(m));else{let v=r,g=0;for(;g<p.length;){const b=p[g],j=g===p.length-1;if(b==="_errors"){j&&v._errors.push(l(m)),g++;continue}Object.prototype.hasOwnProperty.call(v,b)||Object.defineProperty(v,b,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const C=v[b];j&&C._errors.push(l(m)),v=C,g++}}}};return u(n),r}function qr(n,l){return{callee:l?.callee??n,Err:l?.Err}}const Yo=n=>{const l=(r,u,d,f)=>{const m=d?{...d,async:!1}:{async:!1},p=r._zod.run({value:u,issues:[]},m);if(p instanceof Promise)throw new ml;if(p.issues.length){const v=new(f?.Err??n)(p.issues.map(g=>$a(g,m,Gn())));throw av(v,f?.callee??l),v}return p.value};return l},Jo=n=>{const l=async(r,u,d,f)=>{const m=d?{...d,async:!0}:{async:!0};let p=r._zod.run({value:u,issues:[]},m);if(p instanceof Promise&&(p=await p),p.issues.length){const v=new(f?.Err??n)(p.issues.map(g=>$a(g,m,Gn())));throw av(v,f?.callee??l),v}return p.value};return l},Ko=n=>(l,r,u)=>{const d=u?{...u,async:!1}:{async:!1},f=l._zod.run({value:r,issues:[]},d);if(f instanceof Promise)throw new ml;return f.issues.length?dv(n,f.issues,d):{success:!0,data:f.value}};function dv(n,l,r){let u;return{success:!1,get error(){return u||(u=new n(l.map(d=>$a(d,r,Gn()))),l=void 0,r=void 0),u},set error(d){u=d,l=void 0,r=void 0}}}const Qo=n=>async(l,r,u)=>{const d=u?{...u,async:!0}:{async:!0};let f=l._zod.run({value:r,issues:[]},d);return f instanceof Promise&&(f=await f),f.issues.length?dv(n,f.issues,d):{success:!0,data:f.value}},lj=Symbol.for("zod.compile.invalid"),ij=Symbol.for("zod.compile.fallback"),sj=((n,l,r)=>{const u=n._zod.bag.validator;if(u!==void 0){if(u(l)!==lj)return!0;if(u.definite===!0&&r===void 0)return!1}return rj(n,l,r)});function rj(n,l,r){const u=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},d=n._zod.bag.fallbackRun;let f;if(d?(u[ij]=!0,f=d({value:l,issues:[]},u)):f=n._zod.run({value:l,issues:[]},u),f instanceof Promise)throw new ml;return f.issues.length===0}const cj=async(n,l,r)=>{const u=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let d=n._zod.run({value:l,issues:[]},u);return d instanceof Promise&&(d=await d),d.issues.length===0},uj=n=>{const l=Yo(n),r=(u,d,f,m)=>{const p=f?{...f,direction:"backward"}:{direction:"backward"};return l(u,d,p,qr(r,m))};return r},oj=n=>{const l=Yo(n),r=(u,d,f,m)=>l(u,d,f,qr(r,m));return r},dj=n=>{const l=Jo(n),r=async(u,d,f,m)=>{const p=f?{...f,direction:"backward"}:{direction:"backward"};return await l(u,d,p,qr(r,m))};return r},fj=n=>{const l=Jo(n),r=async(u,d,f,m)=>await l(u,d,f,qr(r,m));return r},hj=n=>(l,r,u)=>{const d=u?{...u,direction:"backward"}:{direction:"backward"};return Ko(n)(l,r,d)},mj=n=>(l,r,u)=>Ko(n)(l,r,u),pj=n=>async(l,r,u)=>{const d=u?{...u,direction:"backward"}:{direction:"backward"};return Qo(n)(l,r,d)},vj=n=>async(l,r,u)=>Qo(n)(l,r,u),gj=/^[cC][0-9a-z]{6,}$/,yj=/^[0-9a-z]+$/,bj=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,jj=/^[0-9a-vA-V]{20}$/,xj=/^[A-Za-z0-9]{27}$/,Sj=/^[a-zA-Z0-9_-]{21}$/;function _j(n){return new RegExp(`^[a-zA-Z0-9_-]{${n}}$`)}const Nj=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Aj=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,mp=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Cj=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,zj="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Ej(){return new RegExp(zj,"u")}const wj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Oj=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Tj=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,kj=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Rj=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Mj=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Dj=/^https?$/,Uj=/^\+[1-9]\d{6,14}$/,fv="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function Zj(n){return new RegExp(`^${n}$`)}const Hj=Zj(fv);function zo(n){const l="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${l}`:n.precision===0?`${l}:[0-5]\\d`:`${l}:[0-5]\\d\\.\\d{${n.precision}}`:n.seconds?`${l}:[0-5]\\d(?:\\.\\d+)?`:`${l}(?::[0-5]\\d(?:\\.\\d+)?)?`}function $j(n){return new RegExp(`^${zo(n)}$`)}function Lj(n){const l=["Z"];n.offset&&l.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${zo({precision:n.precision,seconds:!0})}(?:${l.join("|")})`,u=n.local?`${r}|${zo({precision:n.precision})}`:r;return new RegExp(`^${fv}T(?:${u})$`)}const Bj=/^[\s\S]{0,}$/,qj=/^-?\d+$/,Vo=/^-?\d+(?:\.\d+)?$/,Gj=/^(?:true|false)$/i,Yj=/^[^A-Z]*$/,Jj=/^[^a-z]*$/,Wt=q("$ZodCheck",(n,l)=>{var r;n._zod??(n._zod={}),n._zod.def=l,(r=n._zod).onattach??(r.onattach=[])}),Xo=n=>{const l=n.value;return!Nb(l)&&l.length!==void 0},Rr={number:"number",bigint:"bigint",object:"date"},hv=q("$ZodCheckLessThan",(n,l)=>{Wt.init(n,l);const r=Rr[typeof l.value];n._zod.check=u=>{(l.inclusive?u.value<=l.value:u.value<l.value)||u.issues.push({origin:Rr[typeof u.value]??r,code:"too_big",maximum:typeof l.value=="object"?l.value.getTime():l.value,input:u.value,inclusive:l.inclusive,inst:n,continue:!l.abort})}}),mv=q("$ZodCheckGreaterThan",(n,l)=>{Wt.init(n,l);const r=Rr[typeof l.value];n._zod.check=u=>{(l.inclusive?u.value>=l.value:u.value>l.value)||u.issues.push({origin:Rr[typeof u.value]??r,code:"too_small",minimum:typeof l.value=="object"?l.value.getTime():l.value,input:u.value,inclusive:l.inclusive,inst:n,continue:!l.abort})}}),Kj=q("$ZodCheckMultipleOf",(n,l)=>{Wt.init(n,l),n._zod.check=r=>{if(typeof r.value!=typeof l.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?l.value!==BigInt(0)&&r.value%l.value===BigInt(0):Ab(r.value,l.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:l.value,input:r.value,inst:n,continue:!l.abort})}}),Qj=q("$ZodCheckNumberFormat",(n,l)=>{Wt.init(n,l),l.format=l.format||"float64";const r=l.format?.includes("int"),u=r?"int":"number",[d,f]=sv[l.format];n._zod.check=m=>{const p=m.value;if(r){if(!Number.isInteger(p)){m.issues.push({expected:u,format:l.format,code:"invalid_type",continue:!1,input:p,inst:n});return}if(!Number.isSafeInteger(p)){p>0?m.issues.push({input:p,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:u,inclusive:!0,continue:!l.abort}):m.issues.push({input:p,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:u,inclusive:!0,continue:!l.abort});return}}p<d&&m.issues.push({origin:"number",input:p,code:"too_small",minimum:d,inclusive:!0,inst:n,continue:!l.abort}),p>f&&m.issues.push({origin:"number",input:p,code:"too_big",maximum:f,inclusive:!0,inst:n,continue:!l.abort})}}),Vj=q("$ZodCheckMaxLength",(n,l)=>{var r;Wt.init(n,l),(r=n._zod.def).when??(r.when=Xo),n._zod.check=u=>{const d=u.value,f=d.length;if((typeof d=="string"&&f>l.maximum?qo(d):f)<=l.maximum)return;const p=Go(d);u.issues.push({origin:p,code:"too_big",maximum:l.maximum,inclusive:!0,input:d,inst:n,continue:!l.abort})}}),Xj=q("$ZodCheckMinLength",(n,l)=>{var r;Wt.init(n,l),(r=n._zod.def).when??(r.when=Xo),n._zod.check=u=>{const d=u.value,f=d.length;if((typeof d=="string"&&f>=l.minimum&&f<l.minimum*2?qo(d):f)>=l.minimum)return;const p=Go(d);u.issues.push({origin:p,code:"too_small",minimum:l.minimum,inclusive:!0,input:d,inst:n,continue:!l.abort})}}),Ij=q("$ZodCheckLengthEquals",(n,l)=>{var r;Wt.init(n,l),(r=n._zod.def).when??(r.when=Xo),n._zod.check=u=>{const d=u.value,f=d.length,m=typeof d=="string"&&f>=l.length&&f<=l.length*2?qo(d):f;if(m===l.length)return;const p=Go(d),v=m>l.length;u.issues.push({origin:p,...v?{code:"too_big",maximum:l.length}:{code:"too_small",minimum:l.length},inclusive:!0,exact:!0,input:u.value,inst:n,continue:!l.abort})}}),Gr=q("$ZodCheckStringFormat",(n,l)=>{var r,u;Wt.init(n,l),l.pattern?(r=n._zod).check??(r.check=d=>{l.pattern.lastIndex=0,!l.pattern.test(d.value)&&d.issues.push({origin:"string",code:"invalid_format",format:l.format,input:d.value,...l.pattern?{pattern:l.pattern.toString()}:{},inst:n,continue:!l.abort})}):(u=n._zod).check??(u.check=()=>{})}),Pj=q("$ZodCheckRegex",(n,l)=>{Gr.init(n,l),n._zod.check=r=>{l.pattern.lastIndex=0,!l.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:l.pattern.toString(),inst:n,continue:!l.abort})}}),Fj=q("$ZodCheckLowerCase",(n,l)=>{l.pattern??(l.pattern=Yj),Gr.init(n,l)}),Wj=q("$ZodCheckUpperCase",(n,l)=>{l.pattern??(l.pattern=Jj),Gr.init(n,l)}),ex=q("$ZodCheckIncludes",(n,l)=>{Wt.init(n,l);const r=Lr(l.includes),u=new RegExp(typeof l.position=="number"?`^.{${l.position},}${r}`:r);l.pattern=u,n._zod.check=d=>{d.value.includes(l.includes,l.position)||d.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:l.includes,input:d.value,inst:n,continue:!l.abort})}}),tx=q("$ZodCheckStartsWith",(n,l)=>{Wt.init(n,l);const r=new RegExp(`^${Lr(l.prefix)}.*`);l.pattern??(l.pattern=r),n._zod.check=u=>{u.value.startsWith(l.prefix)||u.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:l.prefix,input:u.value,inst:n,continue:!l.abort})}}),nx=q("$ZodCheckEndsWith",(n,l)=>{Wt.init(n,l);const r=new RegExp(`.*${Lr(l.suffix)}$`);l.pattern??(l.pattern=r),n._zod.check=u=>{u.value.endsWith(l.suffix)||u.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:l.suffix,input:u.value,inst:n,continue:!l.abort})}}),ax=q("$ZodCheckOverwrite",(n,l)=>{Wt.init(n,l),n._zod.check=r=>{r.value=l.tx(r.value)}});class lx{constructor(l=[],r={}){this.content=[],this.indent=0,this.args=l,this.closed=r}indented(l){this.indent+=1;try{l(this)}finally{this.indent-=1}}write(l){if(typeof l=="function"){l(this,{execution:"sync"}),l(this,{execution:"async"});return}const u=l.split(`
8
+ `+s.stack}}var Mn=Object.prototype.hasOwnProperty,An=n.unstable_scheduleCallback,Dn=n.unstable_cancelCallback,Yn=n.unstable_shouldYield,Ge=n.unstable_requestPaint,ne=n.unstable_now,Ze=n.unstable_getCurrentPriorityLevel,Ce=n.unstable_ImmediatePriority,nt=n.unstable_UserBlockingPriority,mt=n.unstable_NormalPriority,fa=n.unstable_LowPriority,Ka=n.unstable_IdlePriority,Jr=n.log,Kr=n.unstable_setDisableYieldValue,Qa=null,Lt=null;function Un(e){if(typeof Jr=="function"&&Kr(e),Lt&&typeof Lt.setStrictMode=="function")try{Lt.setStrictMode(Qa,e)}catch{}}var Bt=Math.clz32?Math.clz32:Xr,Qr=Math.log,Vr=Math.LN2;function Xr(e){return e>>>=0,e===0?32:31-(Qr(e)/Vr|0)|0}var N=256,W=262144,pt=4194304;function Zt(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function de(e,t,a){var s=e.pendingLanes;if(s===0)return 0;var c=0,o=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var y=s&134217727;return y!==0?(s=y&~o,s!==0?c=Zt(s):(h&=y,h!==0?c=Zt(h):a||(a=y&~e,a!==0&&(c=Zt(a))))):(y=s&~o,y!==0?c=Zt(y):h!==0?c=Zt(h):a||(a=s&~e,a!==0&&(c=Zt(a)))),c===0?0:t!==0&&t!==c&&(t&o)===0&&(o=c&-c,a=t&-t,o>=a||o===32&&(a&4194048)!==0)?t:c}function Cn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ds(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 fs(){var e=pt;return pt<<=1,(pt&62914560)===0&&(pt=4194304),e}function ui(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Va(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function zt(e,t,a,s,c,o){var h=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var y=e.entanglements,_=e.expirationTimes,T=e.hiddenUpdates;for(a=h&~a;0<a;){var H=31-Bt(a),G=1<<H;y[H]=0,_[H]=-1;var R=T[H];if(R!==null)for(T[H]=null,H=0;H<R.length;H++){var D=R[H];D!==null&&(D.lane&=-536870913)}a&=~G}s!==0&&nd(e,s,0),o!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=o&~(h&~t))}function nd(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Bt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|a&261930}function ad(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var s=31-Bt(a),c=1<<s;c&t|e[s]&t&&(e[s]|=t),a&=~c}}function ld(e,t){var a=t&-t;return a=(a&42)!==0?1:Ir(a),(a&(e.suspendedLanes|t))!==0?0:a}function Ir(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Pr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function id(){var e=F.p;return e!==0?e:(e=window.event,e===void 0?32:Jm(e.type))}function sd(e,t){var a=F.p;try{return F.p=e,t()}finally{F.p=a}}var ha=Math.random().toString(36).slice(2),Ot="__reactFiber$"+ha,Jt="__reactProps$"+ha,vl="__reactContainer$"+ha,Fr="__reactEvents$"+ha,eg="__reactListeners$"+ha,tg="__reactHandles$"+ha,rd="__reactResources$"+ha,oi="__reactMarker$"+ha;function Wr(e){delete e[Ot],delete e[Jt],delete e[Fr],delete e[eg],delete e[tg]}function gl(e){var t=e[Ot];if(t)return t;for(var a=e.parentNode;a;){if(t=a[vl]||a[Ot]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=wm(e);e!==null;){if(a=e[Ot])return a;e=wm(e)}return t}e=a,a=e.parentNode}return null}function yl(e){if(e=e[Ot]||e[vl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function di(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function bl(e){var t=e[rd];return t||(t=e[rd]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Et(e){e[oi]=!0}var cd=new Set,ud={};function Xa(e,t){jl(e,t),jl(e+"Capture",t)}function jl(e,t){for(ud[e]=t,e=0;e<t.length;e++)cd.add(t[e])}var ng=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]*$"),od={},dd={};function ag(e){return Mn.call(dd,e)?!0:Mn.call(od,e)?!1:ng.test(e)?dd[e]=!0:(od[e]=!0,!1)}function hs(e,t,a){if(ag(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function ms(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Jn(e,t,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+s)}}function dn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function fd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lg(e,t,a){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var c=s.get,o=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(h){a=""+h,o.call(this,h)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(h){a=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ec(e){if(!e._valueTracker){var t=fd(e)?"checked":"value";e._valueTracker=lg(e,t,""+e[t])}}function hd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),s="";return e&&(s=fd(e)?e.checked?"true":"false":e.value),e=s,e!==a?(t.setValue(e),!0):!1}function ps(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var ig=/[\n"\\]/g;function fn(e){return e.replace(ig,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function tc(e,t,a,s,c,o,h,y){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+dn(t)):e.value!==""+dn(t)&&(e.value=""+dn(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?nc(e,h,dn(t)):a!=null?nc(e,h,dn(a)):s!=null&&e.removeAttribute("value"),c==null&&o!=null&&(e.defaultChecked=!!o),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.name=""+dn(y):e.removeAttribute("name")}function md(e,t,a,s,c,o,h,y){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){ec(e);return}a=a!=null?""+dn(a):"",t=t!=null?""+dn(t):a,y||t===e.value||(e.value=t),e.defaultValue=t}s=s??c,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=y?e.checked:!!s,e.defaultChecked=!!s,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),ec(e)}function nc(e,t,a){t==="number"&&ps(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function xl(e,t,a,s){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&s&&(e[a].defaultSelected=!0)}else{for(a=""+dn(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function pd(e,t,a){if(t!=null&&(t=""+dn(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+dn(a):""}function vd(e,t,a,s){if(t==null){if(s!=null){if(a!=null)throw Error(u(92));if(Pe(s)){if(1<s.length)throw Error(u(93));s=s[0]}a=s}a==null&&(a=""),t=a}a=dn(t),e.defaultValue=a,s=e.textContent,s===a&&s!==""&&s!==null&&(e.value=s),ec(e)}function Sl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var sg=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 gd(e,t,a){var s=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,a):typeof a!="number"||a===0||sg.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function yd(e,t,a){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,a!=null){for(var s in a)!a.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var c in t)s=t[c],t.hasOwnProperty(c)&&a[c]!==s&&gd(e,c,s)}else for(var o in t)t.hasOwnProperty(o)&&gd(e,o,t[o])}function ac(e){if(e.indexOf("-")===-1)return!1;switch(e){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 rg=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"]]),cg=/^[\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 vs(e){return cg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Kn(){}var lc=null;function ic(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _l=null,Nl=null;function bd(e){var t=yl(e);if(t&&(e=t.stateNode)){var a=e[Jt]||null;e:switch(e=t.stateNode,t.type){case"input":if(tc(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+fn(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var s=a[t];if(s!==e&&s.form===e.form){var c=s[Jt]||null;if(!c)throw Error(u(90));tc(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)s=a[t],s.form===e.form&&hd(s)}break e;case"textarea":pd(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&xl(e,!!a.multiple,t,!1)}}}var sc=!1;function jd(e,t,a){if(sc)return e(t,a);sc=!0;try{var s=e(t);return s}finally{if(sc=!1,(_l!==null||Nl!==null)&&(ar(),_l&&(t=_l,e=Nl,Nl=_l=null,bd(t),e)))for(t=0;t<e.length;t++)bd(e[t])}}function fi(e,t){var a=e.stateNode;if(a===null)return null;var s=a[Jt]||null;if(s===null)return null;a=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(u(231,t,typeof a));return a}var Qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rc=!1;if(Qn)try{var hi={};Object.defineProperty(hi,"passive",{get:function(){rc=!0}}),window.addEventListener("test",hi,hi),window.removeEventListener("test",hi,hi)}catch{rc=!1}var ma=null,cc=null,gs=null;function xd(){if(gs)return gs;var e,t=cc,a=t.length,s,c="value"in ma?ma.value:ma.textContent,o=c.length;for(e=0;e<a&&t[e]===c[e];e++);var h=a-e;for(s=1;s<=h&&t[a-s]===c[o-s];s++);return gs=c.slice(e,1<s?1-s:void 0)}function ys(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function bs(){return!0}function Sd(){return!1}function Kt(e){function t(a,s,c,o,h){this._reactName=a,this._targetInst=c,this.type=s,this.nativeEvent=o,this.target=h,this.currentTarget=null;for(var y in e)e.hasOwnProperty(y)&&(a=e[y],this[y]=a?a(o):o[y]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?bs:Sd,this.isPropagationStopped=Sd,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=bs)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=bs)},persist:function(){},isPersistent:bs}),t}var Ia={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},js=Kt(Ia),mi=j({},Ia,{view:0,detail:0}),ug=Kt(mi),uc,oc,pi,xs=j({},mi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==pi&&(pi&&e.type==="mousemove"?(uc=e.screenX-pi.screenX,oc=e.screenY-pi.screenY):oc=uc=0,pi=e),uc)},movementY:function(e){return"movementY"in e?e.movementY:oc}}),_d=Kt(xs),og=j({},xs,{dataTransfer:0}),dg=Kt(og),fg=j({},mi,{relatedTarget:0}),dc=Kt(fg),hg=j({},Ia,{animationName:0,elapsedTime:0,pseudoElement:0}),mg=Kt(hg),pg=j({},Ia,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vg=Kt(pg),gg=j({},Ia,{data:0}),Nd=Kt(gg),yg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bg={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"},jg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jg[e])?!!t[e]:!1}function fc(){return xg}var Sg=j({},mi,{key:function(e){if(e.key){var t=yg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ys(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?bg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fc,charCode:function(e){return e.type==="keypress"?ys(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ys(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_g=Kt(Sg),Ng=j({},xs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ad=Kt(Ng),Ag=j({},mi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fc}),Cg=Kt(Ag),zg=j({},Ia,{propertyName:0,elapsedTime:0,pseudoElement:0}),Eg=Kt(zg),wg=j({},xs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Og=Kt(wg),Tg=j({},Ia,{newState:0,oldState:0}),kg=Kt(Tg),Rg=[9,13,27,32],hc=Qn&&"CompositionEvent"in window,vi=null;Qn&&"documentMode"in document&&(vi=document.documentMode);var Mg=Qn&&"TextEvent"in window&&!vi,Cd=Qn&&(!hc||vi&&8<vi&&11>=vi),zd=" ",Ed=!1;function wd(e,t){switch(e){case"keyup":return Rg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Od(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Al=!1;function Dg(e,t){switch(e){case"compositionend":return Od(t);case"keypress":return t.which!==32?null:(Ed=!0,zd);case"textInput":return e=t.data,e===zd&&Ed?null:e;default:return null}}function Ug(e,t){if(Al)return e==="compositionend"||!hc&&wd(e,t)?(e=xd(),gs=cc=ma=null,Al=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Cd&&t.locale!=="ko"?null:t.data;default:return null}}var Zg={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 Td(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Zg[e.type]:t==="textarea"}function kd(e,t,a,s){_l?Nl?Nl.push(s):Nl=[s]:_l=s,t=or(t,"onChange"),0<t.length&&(a=new js("onChange","change",null,a,s),e.push({event:a,listeners:t}))}var gi=null,yi=null;function Hg(e){pm(e,0)}function Ss(e){var t=di(e);if(hd(t))return e}function Rd(e,t){if(e==="change")return t}var Md=!1;if(Qn){var mc;if(Qn){var pc="oninput"in document;if(!pc){var Dd=document.createElement("div");Dd.setAttribute("oninput","return;"),pc=typeof Dd.oninput=="function"}mc=pc}else mc=!1;Md=mc&&(!document.documentMode||9<document.documentMode)}function Ud(){gi&&(gi.detachEvent("onpropertychange",Zd),yi=gi=null)}function Zd(e){if(e.propertyName==="value"&&Ss(yi)){var t=[];kd(t,yi,e,ic(e)),jd(Hg,t)}}function $g(e,t,a){e==="focusin"?(Ud(),gi=t,yi=a,gi.attachEvent("onpropertychange",Zd)):e==="focusout"&&Ud()}function Lg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ss(yi)}function Bg(e,t){if(e==="click")return Ss(t)}function qg(e,t){if(e==="input"||e==="change")return Ss(t)}function Gg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var en=typeof Object.is=="function"?Object.is:Gg;function bi(e,t){if(en(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),s=Object.keys(t);if(a.length!==s.length)return!1;for(s=0;s<a.length;s++){var c=a[s];if(!Mn.call(t,c)||!en(e[c],t[c]))return!1}return!0}function Hd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function $d(e,t){var a=Hd(e);e=0;for(var s;a;){if(a.nodeType===3){if(s=e+a.textContent.length,e<=t&&s>=t)return{node:a,offset:t-e};e=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Hd(a)}}function Ld(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ld(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ps(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=ps(e.document)}return t}function vc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Yg=Qn&&"documentMode"in document&&11>=document.documentMode,Cl=null,gc=null,ji=null,yc=!1;function qd(e,t,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;yc||Cl==null||Cl!==ps(s)||(s=Cl,"selectionStart"in s&&vc(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ji&&bi(ji,s)||(ji=s,s=or(gc,"onSelect"),0<s.length&&(t=new js("onSelect","select",null,t,a),e.push({event:t,listeners:s}),t.target=Cl)))}function Pa(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var zl={animationend:Pa("Animation","AnimationEnd"),animationiteration:Pa("Animation","AnimationIteration"),animationstart:Pa("Animation","AnimationStart"),transitionrun:Pa("Transition","TransitionRun"),transitionstart:Pa("Transition","TransitionStart"),transitioncancel:Pa("Transition","TransitionCancel"),transitionend:Pa("Transition","TransitionEnd")},bc={},Gd={};Qn&&(Gd=document.createElement("div").style,"AnimationEvent"in window||(delete zl.animationend.animation,delete zl.animationiteration.animation,delete zl.animationstart.animation),"TransitionEvent"in window||delete zl.transitionend.transition);function Fa(e){if(bc[e])return bc[e];if(!zl[e])return e;var t=zl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Gd)return bc[e]=t[a];return e}var Yd=Fa("animationend"),Jd=Fa("animationiteration"),Kd=Fa("animationstart"),Jg=Fa("transitionrun"),Kg=Fa("transitionstart"),Qg=Fa("transitioncancel"),Qd=Fa("transitionend"),Vd=new Map,jc="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(" ");jc.push("scrollEnd");function zn(e,t){Vd.set(e,t),Xa(t,[e])}var _s=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},hn=[],El=0,xc=0;function Ns(){for(var e=El,t=xc=El=0;t<e;){var a=hn[t];hn[t++]=null;var s=hn[t];hn[t++]=null;var c=hn[t];hn[t++]=null;var o=hn[t];if(hn[t++]=null,s!==null&&c!==null){var h=s.pending;h===null?c.next=c:(c.next=h.next,h.next=c),s.pending=c}o!==0&&Xd(a,c,o)}}function As(e,t,a,s){hn[El++]=e,hn[El++]=t,hn[El++]=a,hn[El++]=s,xc|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Sc(e,t,a,s){return As(e,t,a,s),Cs(e)}function Wa(e,t){return As(e,null,null,t),Cs(e)}function Xd(e,t,a){e.lanes|=a;var s=e.alternate;s!==null&&(s.lanes|=a);for(var c=!1,o=e.return;o!==null;)o.childLanes|=a,s=o.alternate,s!==null&&(s.childLanes|=a),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(c=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,c&&t!==null&&(c=31-Bt(a),e=o.hiddenUpdates,s=e[c],s===null?e[c]=[t]:s.push(t),t.lane=a|536870912),o):null}function Cs(e){if(50<qi)throw qi=0,Tu=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var wl={};function Vg(e,t,a,s){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(e,t,a,s){return new Vg(e,t,a,s)}function _c(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vn(e,t){var a=e.alternate;return a===null?(a=tn(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Id(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function zs(e,t,a,s,c,o){var h=0;if(s=e,typeof e=="function")_c(e)&&(h=1);else if(typeof e=="string")h=Wy(e,a,re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ce:return e=tn(31,a,t,c),e.elementType=ce,e.lanes=o,e;case K:return el(a.children,c,o,t);case J:h=8,c|=24;break;case I:return e=tn(12,a,t,c|2),e.elementType=I,e.lanes=o,e;case x:return e=tn(13,a,t,c),e.elementType=x,e.lanes=o,e;case B:return e=tn(19,a,t,c),e.elementType=B,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case X:h=10;break e;case ie:h=9;break e;case se:h=11;break e;case V:h=14;break e;case Q:h=16,s=null;break e}h=29,a=Error(u(130,e===null?"null":typeof e,"")),s=null}return t=tn(h,a,t,c),t.elementType=e,t.type=s,t.lanes=o,t}function el(e,t,a,s){return e=tn(7,e,s,t),e.lanes=a,e}function Nc(e,t,a){return e=tn(6,e,null,t),e.lanes=a,e}function Pd(e){var t=tn(18,null,null,0);return t.stateNode=e,t}function Ac(e,t,a){return t=tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fd=new WeakMap;function mn(e,t){if(typeof e=="object"&&e!==null){var a=Fd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Ut(t)},Fd.set(e,t),t)}return{value:e,source:t,stack:Ut(t)}}var Ol=[],Tl=0,Es=null,xi=0,pn=[],vn=0,pa=null,Zn=1,Hn="";function Xn(e,t){Ol[Tl++]=xi,Ol[Tl++]=Es,Es=e,xi=t}function Wd(e,t,a){pn[vn++]=Zn,pn[vn++]=Hn,pn[vn++]=pa,pa=e;var s=Zn;e=Hn;var c=32-Bt(s)-1;s&=~(1<<c),a+=1;var o=32-Bt(t)+c;if(30<o){var h=c-c%5;o=(s&(1<<h)-1).toString(32),s>>=h,c-=h,Zn=1<<32-Bt(t)+c|a<<c|s,Hn=o+e}else Zn=1<<o|a<<c|s,Hn=e}function Cc(e){e.return!==null&&(Xn(e,1),Wd(e,1,0))}function zc(e){for(;e===Es;)Es=Ol[--Tl],Ol[Tl]=null,xi=Ol[--Tl],Ol[Tl]=null;for(;e===pa;)pa=pn[--vn],pn[vn]=null,Hn=pn[--vn],pn[vn]=null,Zn=pn[--vn],pn[vn]=null}function ef(e,t){pn[vn++]=Zn,pn[vn++]=Hn,pn[vn++]=pa,Zn=t.id,Hn=t.overflow,pa=e}var Tt=null,We=null,Re=!1,va=null,gn=!1,Ec=Error(u(519));function ga(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Si(mn(t,e)),Ec}function tf(e){var t=e.stateNode,a=e.type,s=e.memoizedProps;switch(t[Ot]=e,t[Jt]=s,a){case"dialog":Oe("cancel",t),Oe("close",t);break;case"iframe":case"object":case"embed":Oe("load",t);break;case"video":case"audio":for(a=0;a<Yi.length;a++)Oe(Yi[a],t);break;case"source":Oe("error",t);break;case"img":case"image":case"link":Oe("error",t),Oe("load",t);break;case"details":Oe("toggle",t);break;case"input":Oe("invalid",t),md(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Oe("invalid",t);break;case"textarea":Oe("invalid",t),vd(t,s.value,s.defaultValue,s.children)}a=s.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||s.suppressHydrationWarning===!0||bm(t.textContent,a)?(s.popover!=null&&(Oe("beforetoggle",t),Oe("toggle",t)),s.onScroll!=null&&Oe("scroll",t),s.onScrollEnd!=null&&Oe("scrollend",t),s.onClick!=null&&(t.onclick=Kn),t=!0):t=!1,t||ga(e,!0)}function nf(e){for(Tt=e.return;Tt;)switch(Tt.tag){case 5:case 31:case 13:gn=!1;return;case 27:case 3:gn=!0;return;default:Tt=Tt.return}}function kl(e){if(e!==Tt)return!1;if(!Re)return nf(e),Re=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Ku(e.type,e.memoizedProps)),a=!a),a&&We&&ga(e),nf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));We=Em(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));We=Em(e)}else t===27?(t=We,Ta(e.type)?(e=Pu,Pu=null,We=e):We=t):We=Tt?bn(e.stateNode.nextSibling):null;return!0}function tl(){We=Tt=null,Re=!1}function wc(){var e=va;return e!==null&&(It===null?It=e:It.push.apply(It,e),va=null),e}function Si(e){va===null?va=[e]:va.push(e)}var Oc=S(null),nl=null,In=null;function ya(e,t,a){te(Oc,t._currentValue),t._currentValue=a}function Pn(e){e._currentValue=Oc.current,U(Oc)}function Tc(e,t,a){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===a)break;e=e.return}}function kc(e,t,a,s){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var o=c.dependencies;if(o!==null){var h=c.child;o=o.firstContext;e:for(;o!==null;){var y=o;o=c;for(var _=0;_<t.length;_++)if(y.context===t[_]){o.lanes|=a,y=o.alternate,y!==null&&(y.lanes|=a),Tc(o.return,a,e),s||(h=null);break e}o=y.next}}else if(c.tag===18){if(h=c.return,h===null)throw Error(u(341));h.lanes|=a,o=h.alternate,o!==null&&(o.lanes|=a),Tc(h,a,e),h=null}else h=c.child;if(h!==null)h.return=c;else for(h=c;h!==null;){if(h===e){h=null;break}if(c=h.sibling,c!==null){c.return=h.return,h=c;break}h=h.return}c=h}}function Rl(e,t,a,s){e=null;for(var c=t,o=!1;c!==null;){if(!o){if((c.flags&524288)!==0)o=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var h=c.alternate;if(h===null)throw Error(u(387));if(h=h.memoizedProps,h!==null){var y=c.type;en(c.pendingProps.value,h.value)||(e!==null?e.push(y):e=[y])}}else if(c===ve.current){if(h=c.alternate,h===null)throw Error(u(387));h.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Xi):e=[Xi])}c=c.return}e!==null&&kc(t,e,a,s),t.flags|=262144}function ws(e){for(e=e.firstContext;e!==null;){if(!en(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function al(e){nl=e,In=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function kt(e){return af(nl,e)}function Os(e,t){return nl===null&&al(e),af(e,t)}function af(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},In===null){if(e===null)throw Error(u(308));In=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else In=In.next=t;return a}var Xg=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Ig=n.unstable_scheduleCallback,Pg=n.unstable_NormalPriority,yt={$$typeof:X,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Rc(){return{controller:new Xg,data:new Map,refCount:0}}function _i(e){e.refCount--,e.refCount===0&&Ig(Pg,function(){e.controller.abort()})}var Ni=null,Mc=0,Ml=0,Dl=null;function Fg(e,t){if(Ni===null){var a=Ni=[];Mc=0,Ml=Zu(),Dl={status:"pending",value:void 0,then:function(s){a.push(s)}}}return Mc++,t.then(lf,lf),t}function lf(){if(--Mc===0&&Ni!==null){Dl!==null&&(Dl.status="fulfilled");var e=Ni;Ni=null,Ml=0,Dl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wg(e,t){var a=[],s={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(s.status="rejected",s.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),s}var sf=Z.S;Z.S=function(e,t){Gh=ne(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Fg(e,t),sf!==null&&sf(e,t)};var ll=S(null);function Dc(){var e=ll.current;return e!==null?e:Fe.pooledCache}function Ts(e,t){t===null?te(ll,ll.current):te(ll,t.pool)}function rf(){var e=Dc();return e===null?null:{parent:yt._currentValue,pool:e}}var Ul=Error(u(460)),Uc=Error(u(474)),ks=Error(u(542)),Rs={then:function(){}};function cf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function uf(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Kn,Kn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,df(e),e;default:if(typeof t.status=="string")t.then(Kn,Kn);else{if(e=Fe,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=s}},function(s){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,df(e),e}throw sl=t,Ul}}function il(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(sl=a,Ul):a}}var sl=null;function of(){if(sl===null)throw Error(u(459));var e=sl;return sl=null,e}function df(e){if(e===Ul||e===ks)throw Error(u(483))}var Zl=null,Ai=0;function Ms(e){var t=Ai;return Ai+=1,Zl===null&&(Zl=[]),uf(Zl,e,t)}function Ci(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ds(e,t){throw t.$$typeof===C?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function ff(e){function t(E,A){if(e){var O=E.deletions;O===null?(E.deletions=[A],E.flags|=16):O.push(A)}}function a(E,A){if(!e)return null;for(;A!==null;)t(E,A),A=A.sibling;return null}function s(E){for(var A=new Map;E!==null;)E.key!==null?A.set(E.key,E):A.set(E.index,E),E=E.sibling;return A}function c(E,A){return E=Vn(E,A),E.index=0,E.sibling=null,E}function o(E,A,O){return E.index=O,e?(O=E.alternate,O!==null?(O=O.index,O<A?(E.flags|=67108866,A):O):(E.flags|=67108866,A)):(E.flags|=1048576,A)}function h(E){return e&&E.alternate===null&&(E.flags|=67108866),E}function y(E,A,O,L){return A===null||A.tag!==6?(A=Nc(O,E.mode,L),A.return=E,A):(A=c(A,O),A.return=E,A)}function _(E,A,O,L){var ye=O.type;return ye===K?H(E,A,O.props.children,L,O.key):A!==null&&(A.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===Q&&il(ye)===A.type)?(A=c(A,O.props),Ci(A,O),A.return=E,A):(A=zs(O.type,O.key,O.props,null,E.mode,L),Ci(A,O),A.return=E,A)}function T(E,A,O,L){return A===null||A.tag!==4||A.stateNode.containerInfo!==O.containerInfo||A.stateNode.implementation!==O.implementation?(A=Ac(O,E.mode,L),A.return=E,A):(A=c(A,O.children||[]),A.return=E,A)}function H(E,A,O,L,ye){return A===null||A.tag!==7?(A=el(O,E.mode,L,ye),A.return=E,A):(A=c(A,O),A.return=E,A)}function G(E,A,O){if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return A=Nc(""+A,E.mode,O),A.return=E,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case z:return O=zs(A.type,A.key,A.props,null,E.mode,O),Ci(O,A),O.return=E,O;case M:return A=Ac(A,E.mode,O),A.return=E,A;case Q:return A=il(A),G(E,A,O)}if(Pe(A)||pe(A))return A=el(A,E.mode,O,null),A.return=E,A;if(typeof A.then=="function")return G(E,Ms(A),O);if(A.$$typeof===X)return G(E,Os(E,A),O);Ds(E,A)}return null}function R(E,A,O,L){var ye=A!==null?A.key:null;if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return ye!==null?null:y(E,A,""+O,L);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case z:return O.key===ye?_(E,A,O,L):null;case M:return O.key===ye?T(E,A,O,L):null;case Q:return O=il(O),R(E,A,O,L)}if(Pe(O)||pe(O))return ye!==null?null:H(E,A,O,L,null);if(typeof O.then=="function")return R(E,A,Ms(O),L);if(O.$$typeof===X)return R(E,A,Os(E,O),L);Ds(E,O)}return null}function D(E,A,O,L,ye){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return E=E.get(O)||null,y(A,E,""+L,ye);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case z:return E=E.get(L.key===null?O:L.key)||null,_(A,E,L,ye);case M:return E=E.get(L.key===null?O:L.key)||null,T(A,E,L,ye);case Q:return L=il(L),D(E,A,O,L,ye)}if(Pe(L)||pe(L))return E=E.get(O)||null,H(A,E,L,ye,null);if(typeof L.then=="function")return D(E,A,O,Ms(L),ye);if(L.$$typeof===X)return D(E,A,O,Os(A,L),ye);Ds(A,L)}return null}function oe(E,A,O,L){for(var ye=null,$e=null,he=A,Ee=A=0,ke=null;he!==null&&Ee<O.length;Ee++){he.index>Ee?(ke=he,he=null):ke=he.sibling;var Le=R(E,he,O[Ee],L);if(Le===null){he===null&&(he=ke);break}e&&he&&Le.alternate===null&&t(E,he),A=o(Le,A,Ee),$e===null?ye=Le:$e.sibling=Le,$e=Le,he=ke}if(Ee===O.length)return a(E,he),Re&&Xn(E,Ee),ye;if(he===null){for(;Ee<O.length;Ee++)he=G(E,O[Ee],L),he!==null&&(A=o(he,A,Ee),$e===null?ye=he:$e.sibling=he,$e=he);return Re&&Xn(E,Ee),ye}for(he=s(he);Ee<O.length;Ee++)ke=D(he,E,Ee,O[Ee],L),ke!==null&&(e&&ke.alternate!==null&&he.delete(ke.key===null?Ee:ke.key),A=o(ke,A,Ee),$e===null?ye=ke:$e.sibling=ke,$e=ke);return e&&he.forEach(function(Ua){return t(E,Ua)}),Re&&Xn(E,Ee),ye}function Se(E,A,O,L){if(O==null)throw Error(u(151));for(var ye=null,$e=null,he=A,Ee=A=0,ke=null,Le=O.next();he!==null&&!Le.done;Ee++,Le=O.next()){he.index>Ee?(ke=he,he=null):ke=he.sibling;var Ua=R(E,he,Le.value,L);if(Ua===null){he===null&&(he=ke);break}e&&he&&Ua.alternate===null&&t(E,he),A=o(Ua,A,Ee),$e===null?ye=Ua:$e.sibling=Ua,$e=Ua,he=ke}if(Le.done)return a(E,he),Re&&Xn(E,Ee),ye;if(he===null){for(;!Le.done;Ee++,Le=O.next())Le=G(E,Le.value,L),Le!==null&&(A=o(Le,A,Ee),$e===null?ye=Le:$e.sibling=Le,$e=Le);return Re&&Xn(E,Ee),ye}for(he=s(he);!Le.done;Ee++,Le=O.next())Le=D(he,E,Ee,Le.value,L),Le!==null&&(e&&Le.alternate!==null&&he.delete(Le.key===null?Ee:Le.key),A=o(Le,A,Ee),$e===null?ye=Le:$e.sibling=Le,$e=Le);return e&&he.forEach(function(ob){return t(E,ob)}),Re&&Xn(E,Ee),ye}function Ie(E,A,O,L){if(typeof O=="object"&&O!==null&&O.type===K&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case z:e:{for(var ye=O.key;A!==null;){if(A.key===ye){if(ye=O.type,ye===K){if(A.tag===7){a(E,A.sibling),L=c(A,O.props.children),L.return=E,E=L;break e}}else if(A.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===Q&&il(ye)===A.type){a(E,A.sibling),L=c(A,O.props),Ci(L,O),L.return=E,E=L;break e}a(E,A);break}else t(E,A);A=A.sibling}O.type===K?(L=el(O.props.children,E.mode,L,O.key),L.return=E,E=L):(L=zs(O.type,O.key,O.props,null,E.mode,L),Ci(L,O),L.return=E,E=L)}return h(E);case M:e:{for(ye=O.key;A!==null;){if(A.key===ye)if(A.tag===4&&A.stateNode.containerInfo===O.containerInfo&&A.stateNode.implementation===O.implementation){a(E,A.sibling),L=c(A,O.children||[]),L.return=E,E=L;break e}else{a(E,A);break}else t(E,A);A=A.sibling}L=Ac(O,E.mode,L),L.return=E,E=L}return h(E);case Q:return O=il(O),Ie(E,A,O,L)}if(Pe(O))return oe(E,A,O,L);if(pe(O)){if(ye=pe(O),typeof ye!="function")throw Error(u(150));return O=ye.call(O),Se(E,A,O,L)}if(typeof O.then=="function")return Ie(E,A,Ms(O),L);if(O.$$typeof===X)return Ie(E,A,Os(E,O),L);Ds(E,O)}return typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint"?(O=""+O,A!==null&&A.tag===6?(a(E,A.sibling),L=c(A,O),L.return=E,E=L):(a(E,A),L=Nc(O,E.mode,L),L.return=E,E=L),h(E)):a(E,A)}return function(E,A,O,L){try{Ai=0;var ye=Ie(E,A,O,L);return Zl=null,ye}catch(he){if(he===Ul||he===ks)throw he;var $e=tn(29,he,null,E.mode);return $e.lanes=L,$e.return=E,$e}}}var rl=ff(!0),hf=ff(!1),ba=!1;function Zc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xa(e,t,a){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Be&2)!==0){var c=s.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),s.pending=t,t=Cs(e),Xd(e,null,a),t}return As(e,s,t,a),Cs(e)}function zi(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,ad(e,a)}}function $c(e,t){var a=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var c=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var h={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?c=o=h:o=o.next=h,a=a.next}while(a!==null);o===null?c=o=t:o=o.next=t}else c=o=t;a={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:o,shared:s.shared,callbacks:s.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Lc=!1;function Ei(){if(Lc){var e=Dl;if(e!==null)throw e}}function wi(e,t,a,s){Lc=!1;var c=e.updateQueue;ba=!1;var o=c.firstBaseUpdate,h=c.lastBaseUpdate,y=c.shared.pending;if(y!==null){c.shared.pending=null;var _=y,T=_.next;_.next=null,h===null?o=T:h.next=T,h=_;var H=e.alternate;H!==null&&(H=H.updateQueue,y=H.lastBaseUpdate,y!==h&&(y===null?H.firstBaseUpdate=T:y.next=T,H.lastBaseUpdate=_))}if(o!==null){var G=c.baseState;h=0,H=T=_=null,y=o;do{var R=y.lane&-536870913,D=R!==y.lane;if(D?(Te&R)===R:(s&R)===R){R!==0&&R===Ml&&(Lc=!0),H!==null&&(H=H.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});e:{var oe=e,Se=y;R=t;var Ie=a;switch(Se.tag){case 1:if(oe=Se.payload,typeof oe=="function"){G=oe.call(Ie,G,R);break e}G=oe;break e;case 3:oe.flags=oe.flags&-65537|128;case 0:if(oe=Se.payload,R=typeof oe=="function"?oe.call(Ie,G,R):oe,R==null)break e;G=j({},G,R);break e;case 2:ba=!0}}R=y.callback,R!==null&&(e.flags|=64,D&&(e.flags|=8192),D=c.callbacks,D===null?c.callbacks=[R]:D.push(R))}else D={lane:R,tag:y.tag,payload:y.payload,callback:y.callback,next:null},H===null?(T=H=D,_=G):H=H.next=D,h|=R;if(y=y.next,y===null){if(y=c.shared.pending,y===null)break;D=y,y=D.next,D.next=null,c.lastBaseUpdate=D,c.shared.pending=null}}while(!0);H===null&&(_=G),c.baseState=_,c.firstBaseUpdate=T,c.lastBaseUpdate=H,o===null&&(c.shared.lanes=0),Ca|=h,e.lanes=h,e.memoizedState=G}}function mf(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function pf(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)mf(a[e],t)}var Hl=S(null),Us=S(0);function vf(e,t){e=sa,te(Us,e),te(Hl,t),sa=e|t.baseLanes}function Bc(){te(Us,sa),te(Hl,Hl.current)}function qc(){sa=Us.current,U(Hl),U(Us)}var nn=S(null),yn=null;function Sa(e){var t=e.alternate;te(vt,vt.current&1),te(nn,e),yn===null&&(t===null||Hl.current!==null||t.memoizedState!==null)&&(yn=e)}function Gc(e){te(vt,vt.current),te(nn,e),yn===null&&(yn=e)}function gf(e){e.tag===22?(te(vt,vt.current),te(nn,e),yn===null&&(yn=e)):_a()}function _a(){te(vt,vt.current),te(nn,nn.current)}function an(e){U(nn),yn===e&&(yn=null),U(vt)}var vt=S(0);function Zs(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Xu(a)||Iu(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Fn=0,ze=null,Ve=null,bt=null,Hs=!1,$l=!1,cl=!1,$s=0,Oi=0,Ll=null,ey=0;function ut(){throw Error(u(321))}function Yc(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!en(e[a],t[a]))return!1;return!0}function Jc(e,t,a,s,c,o){return Fn=o,ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Z.H=e===null||e.memoizedState===null?eh:su,cl=!1,o=a(s,c),cl=!1,$l&&(o=bf(t,a,s,c)),yf(e),o}function yf(e){Z.H=Ri;var t=Ve!==null&&Ve.next!==null;if(Fn=0,bt=Ve=ze=null,Hs=!1,Oi=0,Ll=null,t)throw Error(u(300));e===null||jt||(e=e.dependencies,e!==null&&ws(e)&&(jt=!0))}function bf(e,t,a,s){ze=e;var c=0;do{if($l&&(Ll=null),Oi=0,$l=!1,25<=c)throw Error(u(301));if(c+=1,bt=Ve=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}Z.H=th,o=t(a,s)}while($l);return o}function ty(){var e=Z.H,t=e.useState()[0];return t=typeof t.then=="function"?Ti(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(ze.flags|=1024),t}function Kc(){var e=$s!==0;return $s=0,e}function Qc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Vc(e){if(Hs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Hs=!1}Fn=0,bt=Ve=ze=null,$l=!1,Oi=$s=0,Ll=null}function qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?ze.memoizedState=bt=e:bt=bt.next=e,bt}function gt(){if(Ve===null){var e=ze.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=bt===null?ze.memoizedState:bt.next;if(t!==null)bt=t,Ve=e;else{if(e===null)throw ze.alternate===null?Error(u(467)):Error(u(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},bt===null?ze.memoizedState=bt=e:bt=bt.next=e}return bt}function Ls(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ti(e){var t=Oi;return Oi+=1,Ll===null&&(Ll=[]),e=uf(Ll,e,t),t=ze,(bt===null?t.memoizedState:bt.next)===null&&(t=t.alternate,Z.H=t===null||t.memoizedState===null?eh:su),e}function Bs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ti(e);if(e.$$typeof===X)return kt(e)}throw Error(u(438,String(e)))}function Xc(e){var t=null,a=ze.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var s=ze.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Ls(),ze.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),s=0;s<e;s++)a[s]=ue;return t.index++,a}function Wn(e,t){return typeof t=="function"?t(e):t}function qs(e){var t=gt();return Ic(t,Ve,e)}function Ic(e,t,a){var s=e.queue;if(s===null)throw Error(u(311));s.lastRenderedReducer=a;var c=e.baseQueue,o=s.pending;if(o!==null){if(c!==null){var h=c.next;c.next=o.next,o.next=h}t.baseQueue=c=o,s.pending=null}if(o=e.baseState,c===null)e.memoizedState=o;else{t=c.next;var y=h=null,_=null,T=t,H=!1;do{var G=T.lane&-536870913;if(G!==T.lane?(Te&G)===G:(Fn&G)===G){var R=T.revertLane;if(R===0)_!==null&&(_=_.next={lane:0,revertLane:0,gesture:null,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null}),G===Ml&&(H=!0);else if((Fn&R)===R){T=T.next,R===Ml&&(H=!0);continue}else G={lane:0,revertLane:T.revertLane,gesture:null,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},_===null?(y=_=G,h=o):_=_.next=G,ze.lanes|=R,Ca|=R;G=T.action,cl&&a(o,G),o=T.hasEagerState?T.eagerState:a(o,G)}else R={lane:G,revertLane:T.revertLane,gesture:T.gesture,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},_===null?(y=_=R,h=o):_=_.next=R,ze.lanes|=G,Ca|=G;T=T.next}while(T!==null&&T!==t);if(_===null?h=o:_.next=y,!en(o,e.memoizedState)&&(jt=!0,H&&(a=Dl,a!==null)))throw a;e.memoizedState=o,e.baseState=h,e.baseQueue=_,s.lastRenderedState=o}return c===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Pc(e){var t=gt(),a=t.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=e;var s=a.dispatch,c=a.pending,o=t.memoizedState;if(c!==null){a.pending=null;var h=c=c.next;do o=e(o,h.action),h=h.next;while(h!==c);en(o,t.memoizedState)||(jt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,s]}function jf(e,t,a){var s=ze,c=gt(),o=Re;if(o){if(a===void 0)throw Error(u(407));a=a()}else a=t();var h=!en((Ve||c).memoizedState,a);if(h&&(c.memoizedState=a,jt=!0),c=c.queue,eu(_f.bind(null,s,c,e),[e]),c.getSnapshot!==t||h||bt!==null&&bt.memoizedState.tag&1){if(s.flags|=2048,Bl(9,{destroy:void 0},Sf.bind(null,s,c,a,t),null),Fe===null)throw Error(u(349));o||(Fn&127)!==0||xf(s,t,a)}return a}function xf(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=ze.updateQueue,t===null?(t=Ls(),ze.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Sf(e,t,a,s){t.value=a,t.getSnapshot=s,Nf(t)&&Af(e)}function _f(e,t,a){return a(function(){Nf(t)&&Af(e)})}function Nf(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!en(e,a)}catch{return!0}}function Af(e){var t=Wa(e,2);t!==null&&Pt(t,e,2)}function Fc(e){var t=qt();if(typeof e=="function"){var a=e;if(e=a(),cl){Un(!0);try{a()}finally{Un(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wn,lastRenderedState:e},t}function Cf(e,t,a,s){return e.baseState=a,Ic(e,Ve,typeof s=="function"?s:Wn)}function ny(e,t,a,s,c){if(Js(e))throw Error(u(485));if(e=t.action,e!==null){var o={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){o.listeners.push(h)}};Z.T!==null?a(!0):o.isTransition=!1,s(o),a=t.pending,a===null?(o.next=t.pending=o,zf(t,o)):(o.next=a.next,t.pending=a.next=o)}}function zf(e,t){var a=t.action,s=t.payload,c=e.state;if(t.isTransition){var o=Z.T,h={};Z.T=h;try{var y=a(c,s),_=Z.S;_!==null&&_(h,y),Ef(e,t,y)}catch(T){Wc(e,t,T)}finally{o!==null&&h.types!==null&&(o.types=h.types),Z.T=o}}else try{o=a(c,s),Ef(e,t,o)}catch(T){Wc(e,t,T)}}function Ef(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){wf(e,t,s)},function(s){return Wc(e,t,s)}):wf(e,t,a)}function wf(e,t,a){t.status="fulfilled",t.value=a,Of(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,zf(e,a)))}function Wc(e,t,a){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=a,Of(t),t=t.next;while(t!==s)}e.action=null}function Of(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Tf(e,t){return t}function kf(e,t){if(Re){var a=Fe.formState;if(a!==null){e:{var s=ze;if(Re){if(We){t:{for(var c=We,o=gn;c.nodeType!==8;){if(!o){c=null;break t}if(c=bn(c.nextSibling),c===null){c=null;break t}}o=c.data,c=o==="F!"||o==="F"?c:null}if(c){We=bn(c.nextSibling),s=c.data==="F!";break e}}ga(s)}s=!1}s&&(t=a[0])}}return a=qt(),a.memoizedState=a.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tf,lastRenderedState:t},a.queue=s,a=Pf.bind(null,ze,s),s.dispatch=a,s=Fc(!1),o=iu.bind(null,ze,!1,s.queue),s=qt(),c={state:t,dispatch:null,action:e,pending:null},s.queue=c,a=ny.bind(null,ze,c,o,a),c.dispatch=a,s.memoizedState=e,[t,a,!1]}function Rf(e){var t=gt();return Mf(t,Ve,e)}function Mf(e,t,a){if(t=Ic(e,t,Tf)[0],e=qs(Wn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Ti(t)}catch(h){throw h===Ul?ks:h}else s=t;t=gt();var c=t.queue,o=c.dispatch;return a!==t.memoizedState&&(ze.flags|=2048,Bl(9,{destroy:void 0},ay.bind(null,c,a),null)),[s,o,e]}function ay(e,t){e.action=t}function Df(e){var t=gt(),a=Ve;if(a!==null)return Mf(t,a,e);gt(),t=t.memoizedState,a=gt();var s=a.queue.dispatch;return a.memoizedState=e,[t,s,!1]}function Bl(e,t,a,s){return e={tag:e,create:a,deps:s,inst:t,next:null},t=ze.updateQueue,t===null&&(t=Ls(),ze.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(s=a.next,a.next=e,e.next=s,t.lastEffect=e),e}function Uf(){return gt().memoizedState}function Gs(e,t,a,s){var c=qt();ze.flags|=e,c.memoizedState=Bl(1|t,{destroy:void 0},a,s===void 0?null:s)}function Ys(e,t,a,s){var c=gt();s=s===void 0?null:s;var o=c.memoizedState.inst;Ve!==null&&s!==null&&Yc(s,Ve.memoizedState.deps)?c.memoizedState=Bl(t,o,a,s):(ze.flags|=e,c.memoizedState=Bl(1|t,o,a,s))}function Zf(e,t){Gs(8390656,8,e,t)}function eu(e,t){Ys(2048,8,e,t)}function ly(e){ze.flags|=4;var t=ze.updateQueue;if(t===null)t=Ls(),ze.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Hf(e){var t=gt().memoizedState;return ly({ref:t,nextImpl:e}),function(){if((Be&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function $f(e,t){return Ys(4,2,e,t)}function Lf(e,t){return Ys(4,4,e,t)}function Bf(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function qf(e,t,a){a=a!=null?a.concat([e]):null,Ys(4,4,Bf.bind(null,t,e),a)}function tu(){}function Gf(e,t){var a=gt();t=t===void 0?null:t;var s=a.memoizedState;return t!==null&&Yc(t,s[1])?s[0]:(a.memoizedState=[e,t],e)}function Yf(e,t){var a=gt();t=t===void 0?null:t;var s=a.memoizedState;if(t!==null&&Yc(t,s[1]))return s[0];if(s=e(),cl){Un(!0);try{e()}finally{Un(!1)}}return a.memoizedState=[s,t],s}function nu(e,t,a){return a===void 0||(Fn&1073741824)!==0&&(Te&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Jh(),ze.lanes|=e,Ca|=e,a)}function Jf(e,t,a,s){return en(a,t)?a:Hl.current!==null?(e=nu(e,a,s),en(e,t)||(jt=!0),e):(Fn&42)===0||(Fn&1073741824)!==0&&(Te&261930)===0?(jt=!0,e.memoizedState=a):(e=Jh(),ze.lanes|=e,Ca|=e,t)}function Kf(e,t,a,s,c){var o=F.p;F.p=o!==0&&8>o?o:8;var h=Z.T,y={};Z.T=y,iu(e,!1,t,a);try{var _=c(),T=Z.S;if(T!==null&&T(y,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var H=Wg(_,s);ki(e,t,H,rn(e))}else ki(e,t,s,rn(e))}catch(G){ki(e,t,{then:function(){},status:"rejected",reason:G},rn())}finally{F.p=o,h!==null&&y.types!==null&&(h.types=y.types),Z.T=h}}function iy(){}function au(e,t,a,s){if(e.tag!==5)throw Error(u(476));var c=Qf(e).queue;Kf(e,c,t,fe,a===null?iy:function(){return Vf(e),a(s)})}function Qf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wn,lastRenderedState:fe},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Vf(e){var t=Qf(e);t.next===null&&(t=e.alternate.memoizedState),ki(e,t.next.queue,{},rn())}function lu(){return kt(Xi)}function Xf(){return gt().memoizedState}function If(){return gt().memoizedState}function sy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=rn();e=ja(a);var s=xa(t,e,a);s!==null&&(Pt(s,t,a),zi(s,t,a)),t={cache:Rc()},e.payload=t;return}t=t.return}}function ry(e,t,a){var s=rn();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Js(e)?Ff(t,a):(a=Sc(e,t,a,s),a!==null&&(Pt(a,e,s),Wf(a,t,s)))}function Pf(e,t,a){var s=rn();ki(e,t,a,s)}function ki(e,t,a,s){var c={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Js(e))Ff(t,c);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var h=t.lastRenderedState,y=o(h,a);if(c.hasEagerState=!0,c.eagerState=y,en(y,h))return As(e,t,c,0),Fe===null&&Ns(),!1}catch{}if(a=Sc(e,t,c,s),a!==null)return Pt(a,e,s),Wf(a,t,s),!0}return!1}function iu(e,t,a,s){if(s={lane:2,revertLane:Zu(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Js(e)){if(t)throw Error(u(479))}else t=Sc(e,a,s,2),t!==null&&Pt(t,e,2)}function Js(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function Ff(e,t){$l=Hs=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Wf(e,t,a){if((a&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,ad(e,a)}}var Ri={readContext:kt,use:Bs,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut};Ri.useEffectEvent=ut;var eh={readContext:kt,use:Bs,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:kt,useEffect:Zf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Gs(4194308,4,Bf.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Gs(4194308,4,e,t)},useInsertionEffect:function(e,t){Gs(4,2,e,t)},useMemo:function(e,t){var a=qt();t=t===void 0?null:t;var s=e();if(cl){Un(!0);try{e()}finally{Un(!1)}}return a.memoizedState=[s,t],s},useReducer:function(e,t,a){var s=qt();if(a!==void 0){var c=a(t);if(cl){Un(!0);try{a(t)}finally{Un(!1)}}}else c=t;return s.memoizedState=s.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},s.queue=e,e=e.dispatch=ry.bind(null,ze,e),[s.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:function(e){e=Fc(e);var t=e.queue,a=Pf.bind(null,ze,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:tu,useDeferredValue:function(e,t){var a=qt();return nu(a,e,t)},useTransition:function(){var e=Fc(!1);return e=Kf.bind(null,ze,e.queue,!0,!1),qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var s=ze,c=qt();if(Re){if(a===void 0)throw Error(u(407));a=a()}else{if(a=t(),Fe===null)throw Error(u(349));(Te&127)!==0||xf(s,t,a)}c.memoizedState=a;var o={value:a,getSnapshot:t};return c.queue=o,Zf(_f.bind(null,s,o,e),[e]),s.flags|=2048,Bl(9,{destroy:void 0},Sf.bind(null,s,o,a,t),null),a},useId:function(){var e=qt(),t=Fe.identifierPrefix;if(Re){var a=Hn,s=Zn;a=(s&~(1<<32-Bt(s)-1)).toString(32)+a,t="_"+t+"R_"+a,a=$s++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=ey++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:lu,useFormState:kf,useActionState:kf,useOptimistic:function(e){var t=qt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=iu.bind(null,ze,!0,a),a.dispatch=t,[e,t]},useMemoCache:Xc,useCacheRefresh:function(){return qt().memoizedState=sy.bind(null,ze)},useEffectEvent:function(e){var t=qt(),a={impl:e};return t.memoizedState=a,function(){if((Be&2)!==0)throw Error(u(440));return a.impl.apply(void 0,arguments)}}},su={readContext:kt,use:Bs,useCallback:Gf,useContext:kt,useEffect:eu,useImperativeHandle:qf,useInsertionEffect:$f,useLayoutEffect:Lf,useMemo:Yf,useReducer:qs,useRef:Uf,useState:function(){return qs(Wn)},useDebugValue:tu,useDeferredValue:function(e,t){var a=gt();return Jf(a,Ve.memoizedState,e,t)},useTransition:function(){var e=qs(Wn)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:Ti(e),t]},useSyncExternalStore:jf,useId:Xf,useHostTransitionStatus:lu,useFormState:Rf,useActionState:Rf,useOptimistic:function(e,t){var a=gt();return Cf(a,Ve,e,t)},useMemoCache:Xc,useCacheRefresh:If};su.useEffectEvent=Hf;var th={readContext:kt,use:Bs,useCallback:Gf,useContext:kt,useEffect:eu,useImperativeHandle:qf,useInsertionEffect:$f,useLayoutEffect:Lf,useMemo:Yf,useReducer:Pc,useRef:Uf,useState:function(){return Pc(Wn)},useDebugValue:tu,useDeferredValue:function(e,t){var a=gt();return Ve===null?nu(a,e,t):Jf(a,Ve.memoizedState,e,t)},useTransition:function(){var e=Pc(Wn)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:Ti(e),t]},useSyncExternalStore:jf,useId:Xf,useHostTransitionStatus:lu,useFormState:Df,useActionState:Df,useOptimistic:function(e,t){var a=gt();return Ve!==null?Cf(a,Ve,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Xc,useCacheRefresh:If};th.useEffectEvent=Hf;function ru(e,t,a,s){t=e.memoizedState,a=a(s,t),a=a==null?t:j({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var cu={enqueueSetState:function(e,t,a){e=e._reactInternals;var s=rn(),c=ja(s);c.payload=t,a!=null&&(c.callback=a),t=xa(e,c,s),t!==null&&(Pt(t,e,s),zi(t,e,s))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var s=rn(),c=ja(s);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=xa(e,c,s),t!==null&&(Pt(t,e,s),zi(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=rn(),s=ja(a);s.tag=2,t!=null&&(s.callback=t),t=xa(e,s,a),t!==null&&(Pt(t,e,a),zi(t,e,a))}};function nh(e,t,a,s,c,o,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,o,h):t.prototype&&t.prototype.isPureReactComponent?!bi(a,s)||!bi(c,o):!0}function ah(e,t,a,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,s),t.state!==e&&cu.enqueueReplaceState(t,t.state,null)}function ul(e,t){var a=t;if("ref"in t){a={};for(var s in t)s!=="ref"&&(a[s]=t[s])}if(e=e.defaultProps){a===t&&(a=j({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function lh(e){_s(e)}function ih(e){console.error(e)}function sh(e){_s(e)}function Ks(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function rh(e,t,a){try{var s=e.onCaughtError;s(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function uu(e,t,a){return a=ja(a),a.tag=3,a.payload={element:null},a.callback=function(){Ks(e,t)},a}function ch(e){return e=ja(e),e.tag=3,e}function uh(e,t,a,s){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var o=s.value;e.payload=function(){return c(o)},e.callback=function(){rh(t,a,s)}}var h=a.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){rh(t,a,s),typeof c!="function"&&(za===null?za=new Set([this]):za.add(this));var y=s.stack;this.componentDidCatch(s.value,{componentStack:y!==null?y:""})})}function cy(e,t,a,s,c){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=a.alternate,t!==null&&Rl(t,a,c,!0),a=nn.current,a!==null){switch(a.tag){case 31:case 13:return yn===null?lr():a.alternate===null&&ot===0&&(ot=3),a.flags&=-257,a.flags|=65536,a.lanes=c,s===Rs?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([s]):t.add(s),Mu(e,s,c)),!1;case 22:return a.flags|=65536,s===Rs?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([s]):a.add(s)),Mu(e,s,c)),!1}throw Error(u(435,a.tag))}return Mu(e,s,c),lr(),!1}if(Re)return t=nn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,s!==Ec&&(e=Error(u(422),{cause:s}),Si(mn(e,a)))):(s!==Ec&&(t=Error(u(423),{cause:s}),Si(mn(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,s=mn(s,a),c=uu(e.stateNode,s,c),$c(e,c),ot!==4&&(ot=2)),!1;var o=Error(u(520),{cause:s});if(o=mn(o,a),Bi===null?Bi=[o]:Bi.push(o),ot!==4&&(ot=2),t===null)return!0;s=mn(s,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=uu(a.stateNode,s,e),$c(a,e),!1;case 1:if(t=a.type,o=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(za===null||!za.has(o))))return a.flags|=65536,c&=-c,a.lanes|=c,c=ch(c),uh(c,e,a,s),$c(a,c),!1}a=a.return}while(a!==null);return!1}var ou=Error(u(461)),jt=!1;function Rt(e,t,a,s){t.child=e===null?hf(t,null,a,s):rl(t,e.child,a,s)}function oh(e,t,a,s,c){a=a.render;var o=t.ref;if("ref"in s){var h={};for(var y in s)y!=="ref"&&(h[y]=s[y])}else h=s;return al(t),s=Jc(e,t,a,h,o,c),y=Kc(),e!==null&&!jt?(Qc(e,t,c),ea(e,t,c)):(Re&&y&&Cc(t),t.flags|=1,Rt(e,t,s,c),t.child)}function dh(e,t,a,s,c){if(e===null){var o=a.type;return typeof o=="function"&&!_c(o)&&o.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=o,fh(e,t,o,s,c)):(e=zs(a.type,null,s,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!yu(e,c)){var h=o.memoizedProps;if(a=a.compare,a=a!==null?a:bi,a(h,s)&&e.ref===t.ref)return ea(e,t,c)}return t.flags|=1,e=Vn(o,s),e.ref=t.ref,e.return=t,t.child=e}function fh(e,t,a,s,c){if(e!==null){var o=e.memoizedProps;if(bi(o,s)&&e.ref===t.ref)if(jt=!1,t.pendingProps=s=o,yu(e,c))(e.flags&131072)!==0&&(jt=!0);else return t.lanes=e.lanes,ea(e,t,c)}return du(e,t,a,s,c)}function hh(e,t,a,s){var c=s.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|a:a,e!==null){for(s=t.child=e.child,c=0;s!==null;)c=c|s.lanes|s.childLanes,s=s.sibling;s=c&~o}else s=0,t.child=null;return mh(e,t,o,a,s)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ts(t,o!==null?o.cachePool:null),o!==null?vf(t,o):Bc(),gf(t);else return s=t.lanes=536870912,mh(e,t,o!==null?o.baseLanes|a:a,a,s)}else o!==null?(Ts(t,o.cachePool),vf(t,o),_a(),t.memoizedState=null):(e!==null&&Ts(t,null),Bc(),_a());return Rt(e,t,c,a),t.child}function Mi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function mh(e,t,a,s,c){var o=Dc();return o=o===null?null:{parent:yt._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&Ts(t,null),Bc(),gf(t),e!==null&&Rl(e,t,s,!0),t.childLanes=c,null}function Qs(e,t){return t=Xs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ph(e,t,a){return rl(t,e.child,null,a),e=Qs(t,t.pendingProps),e.flags|=2,an(t),t.memoizedState=null,e}function uy(e,t,a){var s=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Re){if(s.mode==="hidden")return e=Qs(t,s),t.lanes=536870912,Mi(null,e);if(Gc(t),(e=We)?(e=zm(e,gn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:pa!==null?{id:Zn,overflow:Hn}:null,retryLane:536870912,hydrationErrors:null},a=Pd(e),a.return=t,t.child=a,Tt=t,We=null)):e=null,e===null)throw ga(t);return t.lanes=536870912,null}return Qs(t,s)}var o=e.memoizedState;if(o!==null){var h=o.dehydrated;if(Gc(t),c)if(t.flags&256)t.flags&=-257,t=ph(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(jt||Rl(e,t,a,!1),c=(a&e.childLanes)!==0,jt||c){if(s=Fe,s!==null&&(h=ld(s,a),h!==0&&h!==o.retryLane))throw o.retryLane=h,Wa(e,h),Pt(s,e,h),ou;lr(),t=ph(e,t,a)}else e=o.treeContext,We=bn(h.nextSibling),Tt=t,Re=!0,va=null,gn=!1,e!==null&&ef(t,e),t=Qs(t,s),t.flags|=4096;return t}return e=Vn(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Vs(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(u(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function du(e,t,a,s,c){return al(t),a=Jc(e,t,a,s,void 0,c),s=Kc(),e!==null&&!jt?(Qc(e,t,c),ea(e,t,c)):(Re&&s&&Cc(t),t.flags|=1,Rt(e,t,a,c),t.child)}function vh(e,t,a,s,c,o){return al(t),t.updateQueue=null,a=bf(t,s,a,c),yf(e),s=Kc(),e!==null&&!jt?(Qc(e,t,o),ea(e,t,o)):(Re&&s&&Cc(t),t.flags|=1,Rt(e,t,a,o),t.child)}function gh(e,t,a,s,c){if(al(t),t.stateNode===null){var o=wl,h=a.contextType;typeof h=="object"&&h!==null&&(o=kt(h)),o=new a(s,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=cu,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=s,o.state=t.memoizedState,o.refs={},Zc(t),h=a.contextType,o.context=typeof h=="object"&&h!==null?kt(h):wl,o.state=t.memoizedState,h=a.getDerivedStateFromProps,typeof h=="function"&&(ru(t,a,h,s),o.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(h=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),h!==o.state&&cu.enqueueReplaceState(o,o.state,null),wi(t,s,o,c),Ei(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){o=t.stateNode;var y=t.memoizedProps,_=ul(a,y);o.props=_;var T=o.context,H=a.contextType;h=wl,typeof H=="object"&&H!==null&&(h=kt(H));var G=a.getDerivedStateFromProps;H=typeof G=="function"||typeof o.getSnapshotBeforeUpdate=="function",y=t.pendingProps!==y,H||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(y||T!==h)&&ah(t,o,s,h),ba=!1;var R=t.memoizedState;o.state=R,wi(t,s,o,c),Ei(),T=t.memoizedState,y||R!==T||ba?(typeof G=="function"&&(ru(t,a,G,s),T=t.memoizedState),(_=ba||nh(t,a,_,s,R,T,h))?(H||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=T),o.props=s,o.state=T,o.context=h,s=_):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{o=t.stateNode,Hc(e,t),h=t.memoizedProps,H=ul(a,h),o.props=H,G=t.pendingProps,R=o.context,T=a.contextType,_=wl,typeof T=="object"&&T!==null&&(_=kt(T)),y=a.getDerivedStateFromProps,(T=typeof y=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(h!==G||R!==_)&&ah(t,o,s,_),ba=!1,R=t.memoizedState,o.state=R,wi(t,s,o,c),Ei();var D=t.memoizedState;h!==G||R!==D||ba||e!==null&&e.dependencies!==null&&ws(e.dependencies)?(typeof y=="function"&&(ru(t,a,y,s),D=t.memoizedState),(H=ba||nh(t,a,H,s,R,D,_)||e!==null&&e.dependencies!==null&&ws(e.dependencies))?(T||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,D,_),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,D,_)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||h===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=D),o.props=s,o.state=D,o.context=_,s=H):(typeof o.componentDidUpdate!="function"||h===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),s=!1)}return o=s,Vs(e,t),s=(t.flags&128)!==0,o||s?(o=t.stateNode,a=s&&typeof a.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&s?(t.child=rl(t,e.child,null,c),t.child=rl(t,null,a,c)):Rt(e,t,a,c),t.memoizedState=o.state,e=t.child):e=ea(e,t,c),e}function yh(e,t,a,s){return tl(),t.flags|=256,Rt(e,t,a,s),t.child}var fu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hu(e){return{baseLanes:e,cachePool:rf()}}function mu(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=sn),e}function bh(e,t,a){var s=t.pendingProps,c=!1,o=(t.flags&128)!==0,h;if((h=o)||(h=e!==null&&e.memoizedState===null?!1:(vt.current&2)!==0),h&&(c=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(Re){if(c?Sa(t):_a(),(e=We)?(e=zm(e,gn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:pa!==null?{id:Zn,overflow:Hn}:null,retryLane:536870912,hydrationErrors:null},a=Pd(e),a.return=t,t.child=a,Tt=t,We=null)):e=null,e===null)throw ga(t);return Iu(e)?t.lanes=32:t.lanes=536870912,null}var y=s.children;return s=s.fallback,c?(_a(),c=t.mode,y=Xs({mode:"hidden",children:y},c),s=el(s,c,a,null),y.return=t,s.return=t,y.sibling=s,t.child=y,s=t.child,s.memoizedState=hu(a),s.childLanes=mu(e,h,a),t.memoizedState=fu,Mi(null,s)):(Sa(t),pu(t,y))}var _=e.memoizedState;if(_!==null&&(y=_.dehydrated,y!==null)){if(o)t.flags&256?(Sa(t),t.flags&=-257,t=vu(e,t,a)):t.memoizedState!==null?(_a(),t.child=e.child,t.flags|=128,t=null):(_a(),y=s.fallback,c=t.mode,s=Xs({mode:"visible",children:s.children},c),y=el(y,c,a,null),y.flags|=2,s.return=t,y.return=t,s.sibling=y,t.child=s,rl(t,e.child,null,a),s=t.child,s.memoizedState=hu(a),s.childLanes=mu(e,h,a),t.memoizedState=fu,t=Mi(null,s));else if(Sa(t),Iu(y)){if(h=y.nextSibling&&y.nextSibling.dataset,h)var T=h.dgst;h=T,s=Error(u(419)),s.stack="",s.digest=h,Si({value:s,source:null,stack:null}),t=vu(e,t,a)}else if(jt||Rl(e,t,a,!1),h=(a&e.childLanes)!==0,jt||h){if(h=Fe,h!==null&&(s=ld(h,a),s!==0&&s!==_.retryLane))throw _.retryLane=s,Wa(e,s),Pt(h,e,s),ou;Xu(y)||lr(),t=vu(e,t,a)}else Xu(y)?(t.flags|=192,t.child=e.child,t=null):(e=_.treeContext,We=bn(y.nextSibling),Tt=t,Re=!0,va=null,gn=!1,e!==null&&ef(t,e),t=pu(t,s.children),t.flags|=4096);return t}return c?(_a(),y=s.fallback,c=t.mode,_=e.child,T=_.sibling,s=Vn(_,{mode:"hidden",children:s.children}),s.subtreeFlags=_.subtreeFlags&65011712,T!==null?y=Vn(T,y):(y=el(y,c,a,null),y.flags|=2),y.return=t,s.return=t,s.sibling=y,t.child=s,Mi(null,s),s=t.child,y=e.child.memoizedState,y===null?y=hu(a):(c=y.cachePool,c!==null?(_=yt._currentValue,c=c.parent!==_?{parent:_,pool:_}:c):c=rf(),y={baseLanes:y.baseLanes|a,cachePool:c}),s.memoizedState=y,s.childLanes=mu(e,h,a),t.memoizedState=fu,Mi(e.child,s)):(Sa(t),a=e.child,e=a.sibling,a=Vn(a,{mode:"visible",children:s.children}),a.return=t,a.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=a,t.memoizedState=null,a)}function pu(e,t){return t=Xs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Xs(e,t){return e=tn(22,e,null,t),e.lanes=0,e}function vu(e,t,a){return rl(t,e.child,null,a),e=pu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jh(e,t,a){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Tc(e.return,t,a)}function gu(e,t,a,s,c,o){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:c,treeForkCount:o}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=s,h.tail=a,h.tailMode=c,h.treeForkCount=o)}function xh(e,t,a){var s=t.pendingProps,c=s.revealOrder,o=s.tail;s=s.children;var h=vt.current,y=(h&2)!==0;if(y?(h=h&1|2,t.flags|=128):h&=1,te(vt,h),Rt(e,t,s,a),s=Re?xi:0,!y&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&jh(e,a,t);else if(e.tag===19)jh(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&Zs(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),gu(t,!1,c,a,o,s);break;case"backwards":case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Zs(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}gu(t,!0,a,null,o,s);break;case"together":gu(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function ea(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Ca|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Rl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,a=Vn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Vn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function yu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ws(e)))}function oy(e,t,a){switch(t.tag){case 3:He(t,t.stateNode.containerInfo),ya(t,yt,e.memoizedState.cache),tl();break;case 27:case 5:$t(t);break;case 4:He(t,t.stateNode.containerInfo);break;case 10:ya(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Gc(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Sa(t),t.flags|=128,null):(a&t.child.childLanes)!==0?bh(e,t,a):(Sa(t),e=ea(e,t,a),e!==null?e.sibling:null);Sa(t);break;case 19:var c=(e.flags&128)!==0;if(s=(a&t.childLanes)!==0,s||(Rl(e,t,a,!1),s=(a&t.childLanes)!==0),c){if(s)return xh(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),te(vt,vt.current),s)break;return null;case 22:return t.lanes=0,hh(e,t,a,t.pendingProps);case 24:ya(t,yt,e.memoizedState.cache)}return ea(e,t,a)}function Sh(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)jt=!0;else{if(!yu(e,a)&&(t.flags&128)===0)return jt=!1,oy(e,t,a);jt=(e.flags&131072)!==0}else jt=!1,Re&&(t.flags&1048576)!==0&&Wd(t,xi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=il(t.elementType),t.type=e,typeof e=="function")_c(e)?(s=ul(e,s),t.tag=1,t=gh(null,t,e,s,a)):(t.tag=0,t=du(null,t,e,s,a));else{if(e!=null){var c=e.$$typeof;if(c===se){t.tag=11,t=oh(null,t,e,s,a);break e}else if(c===V){t.tag=14,t=dh(null,t,e,s,a);break e}}throw t=tt(e)||e,Error(u(306,t,""))}}return t;case 0:return du(e,t,t.type,t.pendingProps,a);case 1:return s=t.type,c=ul(s,t.pendingProps),gh(e,t,s,c,a);case 3:e:{if(He(t,t.stateNode.containerInfo),e===null)throw Error(u(387));s=t.pendingProps;var o=t.memoizedState;c=o.element,Hc(e,t),wi(t,s,null,a);var h=t.memoizedState;if(s=h.cache,ya(t,yt,s),s!==o.cache&&kc(t,[yt],a,!0),Ei(),s=h.element,o.isDehydrated)if(o={element:s,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=yh(e,t,s,a);break e}else if(s!==c){c=mn(Error(u(424)),t),Si(c),t=yh(e,t,s,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,We=bn(e.firstChild),Tt=t,Re=!0,va=null,gn=!0,a=hf(t,null,s,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(tl(),s===c){t=ea(e,t,a);break e}Rt(e,t,s,a)}t=t.child}return t;case 26:return Vs(e,t),e===null?(a=Rm(t.type,null,t.pendingProps,null))?t.memoizedState=a:Re||(a=t.type,e=t.pendingProps,s=dr(xe.current).createElement(a),s[Ot]=t,s[Jt]=e,Mt(s,a,e),Et(s),t.stateNode=s):t.memoizedState=Rm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return $t(t),e===null&&Re&&(s=t.stateNode=Om(t.type,t.pendingProps,xe.current),Tt=t,gn=!0,c=We,Ta(t.type)?(Pu=c,We=bn(s.firstChild)):We=c),Rt(e,t,t.pendingProps.children,a),Vs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Re&&((c=s=We)&&(s=Ly(s,t.type,t.pendingProps,gn),s!==null?(t.stateNode=s,Tt=t,We=bn(s.firstChild),gn=!1,c=!0):c=!1),c||ga(t)),$t(t),c=t.type,o=t.pendingProps,h=e!==null?e.memoizedProps:null,s=o.children,Ku(c,o)?s=null:h!==null&&Ku(c,h)&&(t.flags|=32),t.memoizedState!==null&&(c=Jc(e,t,ty,null,null,a),Xi._currentValue=c),Vs(e,t),Rt(e,t,s,a),t.child;case 6:return e===null&&Re&&((e=a=We)&&(a=By(a,t.pendingProps,gn),a!==null?(t.stateNode=a,Tt=t,We=null,e=!0):e=!1),e||ga(t)),null;case 13:return bh(e,t,a);case 4:return He(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=rl(t,null,s,a):Rt(e,t,s,a),t.child;case 11:return oh(e,t,t.type,t.pendingProps,a);case 7:return Rt(e,t,t.pendingProps,a),t.child;case 8:return Rt(e,t,t.pendingProps.children,a),t.child;case 12:return Rt(e,t,t.pendingProps.children,a),t.child;case 10:return s=t.pendingProps,ya(t,t.type,s.value),Rt(e,t,s.children,a),t.child;case 9:return c=t.type._context,s=t.pendingProps.children,al(t),c=kt(c),s=s(c),t.flags|=1,Rt(e,t,s,a),t.child;case 14:return dh(e,t,t.type,t.pendingProps,a);case 15:return fh(e,t,t.type,t.pendingProps,a);case 19:return xh(e,t,a);case 31:return uy(e,t,a);case 22:return hh(e,t,a,t.pendingProps);case 24:return al(t),s=kt(yt),e===null?(c=Dc(),c===null&&(c=Fe,o=Rc(),c.pooledCache=o,o.refCount++,o!==null&&(c.pooledCacheLanes|=a),c=o),t.memoizedState={parent:s,cache:c},Zc(t),ya(t,yt,c)):((e.lanes&a)!==0&&(Hc(e,t),wi(t,null,null,a),Ei()),c=e.memoizedState,o=t.memoizedState,c.parent!==s?(c={parent:s,cache:s},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),ya(t,yt,s)):(s=o.cache,ya(t,yt,s),s!==c.cache&&kc(t,[yt],a,!0))),Rt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function ta(e){e.flags|=4}function bu(e,t,a,s,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Xh())e.flags|=8192;else throw sl=Rs,Uc}else e.flags&=-16777217}function _h(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Hm(t))if(Xh())e.flags|=8192;else throw sl=Rs,Uc}function Is(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?fs():536870912,e.lanes|=t,Jl|=t)}function Di(e,t){if(!Re)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function et(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,s=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags&65011712,s|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=a,t}function dy(e,t,a){var s=t.pendingProps;switch(zc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return et(t),null;case 1:return et(t),null;case 3:return a=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Pn(yt),Ue(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(kl(t)?ta(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,wc())),et(t),null;case 26:var c=t.type,o=t.memoizedState;return e===null?(ta(t),o!==null?(et(t),_h(t,o)):(et(t),bu(t,c,null,s,a))):o?o!==e.memoizedState?(ta(t),et(t),_h(t,o)):(et(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&ta(t),et(t),bu(t,c,e,s,a)),null;case 27:if(Rn(t),a=xe.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ta(t);else{if(!s){if(t.stateNode===null)throw Error(u(166));return et(t),null}e=re.current,kl(t)?tf(t):(e=Om(c,s,a),t.stateNode=e,ta(t))}return et(t),null;case 5:if(Rn(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ta(t);else{if(!s){if(t.stateNode===null)throw Error(u(166));return et(t),null}if(o=re.current,kl(t))tf(t);else{var h=dr(xe.current);switch(o){case 1:o=h.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:o=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":o=h.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":o=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":o=h.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof s.is=="string"?h.createElement("select",{is:s.is}):h.createElement("select"),s.multiple?o.multiple=!0:s.size&&(o.size=s.size);break;default:o=typeof s.is=="string"?h.createElement(c,{is:s.is}):h.createElement(c)}}o[Ot]=t,o[Jt]=s;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)o.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=o;e:switch(Mt(o,c,s),c){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&ta(t)}}return et(t),bu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&ta(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(u(166));if(e=xe.current,kl(t)){if(e=t.stateNode,a=t.memoizedProps,s=null,c=Tt,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}e[Ot]=t,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||bm(e.nodeValue,a)),e||ga(t,!0)}else e=dr(e).createTextNode(s),e[Ot]=t,t.stateNode=e}return et(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(s=kl(t),a!==null){if(e===null){if(!s)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Ot]=t}else tl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;et(t),e=!1}else a=wc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(an(t),t):(an(t),null);if((t.flags&128)!==0)throw Error(u(558))}return et(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=kl(t),s!==null&&s.dehydrated!==null){if(e===null){if(!c)throw Error(u(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(u(317));c[Ot]=t}else tl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;et(t),c=!1}else c=wc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(an(t),t):(an(t),null)}return an(t),(t.flags&128)!==0?(t.lanes=a,t):(a=s!==null,e=e!==null&&e.memoizedState!==null,a&&(s=t.child,c=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(c=s.alternate.memoizedState.cachePool.pool),o=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(o=s.memoizedState.cachePool.pool),o!==c&&(s.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Is(t,t.updateQueue),et(t),null);case 4:return Ue(),e===null&&Bu(t.stateNode.containerInfo),et(t),null;case 10:return Pn(t.type),et(t),null;case 19:if(U(vt),s=t.memoizedState,s===null)return et(t),null;if(c=(t.flags&128)!==0,o=s.rendering,o===null)if(c)Di(s,!1);else{if(ot!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=Zs(e),o!==null){for(t.flags|=128,Di(s,!1),e=o.updateQueue,t.updateQueue=e,Is(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Id(a,e),a=a.sibling;return te(vt,vt.current&1|2),Re&&Xn(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&ne()>tr&&(t.flags|=128,c=!0,Di(s,!1),t.lanes=4194304)}else{if(!c)if(e=Zs(o),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Is(t,e),Di(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Re)return et(t),null}else 2*ne()-s.renderingStartTime>tr&&a!==536870912&&(t.flags|=128,c=!0,Di(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(e=s.last,e!==null?e.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ne(),e.sibling=null,a=vt.current,te(vt,c?a&1|2:a&1),Re&&Xn(t,s.treeForkCount),e):(et(t),null);case 22:case 23:return an(t),qc(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(a&536870912)!==0&&(t.flags&128)===0&&(et(t),t.subtreeFlags&6&&(t.flags|=8192)):et(t),a=t.updateQueue,a!==null&&Is(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==a&&(t.flags|=2048),e!==null&&U(ll),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Pn(yt),et(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function fy(e,t){switch(zc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Pn(yt),Ue(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Rn(t),null;case 31:if(t.memoizedState!==null){if(an(t),t.alternate===null)throw Error(u(340));tl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(an(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));tl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(vt),null;case 4:return Ue(),null;case 10:return Pn(t.type),null;case 22:case 23:return an(t),qc(),e!==null&&U(ll),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Pn(yt),null;case 25:return null;default:return null}}function Nh(e,t){switch(zc(t),t.tag){case 3:Pn(yt),Ue();break;case 26:case 27:case 5:Rn(t);break;case 4:Ue();break;case 31:t.memoizedState!==null&&an(t);break;case 13:an(t);break;case 19:U(vt);break;case 10:Pn(t.type);break;case 22:case 23:an(t),qc(),e!==null&&U(ll);break;case 24:Pn(yt)}}function Ui(e,t){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var c=s.next;a=c;do{if((a.tag&e)===e){s=void 0;var o=a.create,h=a.inst;s=o(),h.destroy=s}a=a.next}while(a!==c)}}catch(y){Je(t,t.return,y)}}function Na(e,t,a){try{var s=t.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var o=c.next;s=o;do{if((s.tag&e)===e){var h=s.inst,y=h.destroy;if(y!==void 0){h.destroy=void 0,c=t;var _=a,T=y;try{T()}catch(H){Je(c,_,H)}}}s=s.next}while(s!==o)}}catch(H){Je(t,t.return,H)}}function Ah(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{pf(t,a)}catch(s){Je(e,e.return,s)}}}function Ch(e,t,a){a.props=ul(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){Je(e,t,s)}}function Zi(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof a=="function"?e.refCleanup=a(s):a.current=s}}catch(c){Je(e,t,c)}}function $n(e,t){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(c){Je(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){Je(e,t,c)}else a.current=null}function zh(e){var t=e.type,a=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break e;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(c){Je(e,e.return,c)}}function ju(e,t,a){try{var s=e.stateNode;My(s,e.type,a,t),s[Jt]=t}catch(c){Je(e,e.return,c)}}function Eh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ta(e.type)||e.tag===4}function xu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Eh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ta(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Su(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Kn));else if(s!==4&&(s===27&&Ta(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Su(e,t,a),e=e.sibling;e!==null;)Su(e,t,a),e=e.sibling}function Ps(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(s!==4&&(s===27&&Ta(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Ps(e,t,a),e=e.sibling;e!==null;)Ps(e,t,a),e=e.sibling}function wh(e){var t=e.stateNode,a=e.memoizedProps;try{for(var s=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Mt(t,s,a),t[Ot]=e,t[Jt]=a}catch(o){Je(e,e.return,o)}}var na=!1,xt=!1,_u=!1,Oh=typeof WeakSet=="function"?WeakSet:Set,wt=null;function hy(e,t){if(e=e.containerInfo,Yu=yr,e=Bd(e),vc(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var c=s.anchorOffset,o=s.focusNode;s=s.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var h=0,y=-1,_=-1,T=0,H=0,G=e,R=null;t:for(;;){for(var D;G!==a||c!==0&&G.nodeType!==3||(y=h+c),G!==o||s!==0&&G.nodeType!==3||(_=h+s),G.nodeType===3&&(h+=G.nodeValue.length),(D=G.firstChild)!==null;)R=G,G=D;for(;;){if(G===e)break t;if(R===a&&++T===c&&(y=h),R===o&&++H===s&&(_=h),(D=G.nextSibling)!==null)break;G=R,R=G.parentNode}G=D}a=y===-1||_===-1?null:{start:y,end:_}}else a=null}a=a||{start:0,end:0}}else a=null;for(Ju={focusedElem:e,selectionRange:a},yr=!1,wt=t;wt!==null;)if(t=wt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,wt=e;else for(;wt!==null;){switch(t=wt,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)c=e[a],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,a=t,c=o.memoizedProps,o=o.memoizedState,s=a.stateNode;try{var oe=ul(a.type,c);e=s.getSnapshotBeforeUpdate(oe,o),s.__reactInternalSnapshotBeforeUpdate=e}catch(Se){Je(a,a.return,Se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Vu(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Vu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(u(163))}if(e=t.sibling,e!==null){e.return=t.return,wt=e;break}wt=t.return}}function Th(e,t,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:la(e,a),s&4&&Ui(5,a);break;case 1:if(la(e,a),s&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(h){Je(a,a.return,h)}else{var c=ul(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Je(a,a.return,h)}}s&64&&Ah(a),s&512&&Zi(a,a.return);break;case 3:if(la(e,a),s&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{pf(e,t)}catch(h){Je(a,a.return,h)}}break;case 27:t===null&&s&4&&wh(a);case 26:case 5:la(e,a),t===null&&s&4&&zh(a),s&512&&Zi(a,a.return);break;case 12:la(e,a);break;case 31:la(e,a),s&4&&Mh(e,a);break;case 13:la(e,a),s&4&&Dh(e,a),s&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Sy.bind(null,a),qy(e,a))));break;case 22:if(s=a.memoizedState!==null||na,!s){t=t!==null&&t.memoizedState!==null||xt,c=na;var o=xt;na=s,(xt=t)&&!o?ia(e,a,(a.subtreeFlags&8772)!==0):la(e,a),na=c,xt=o}break;case 30:break;default:la(e,a)}}function kh(e){var t=e.alternate;t!==null&&(e.alternate=null,kh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Wr(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var at=null,Qt=!1;function aa(e,t,a){for(a=a.child;a!==null;)Rh(e,t,a),a=a.sibling}function Rh(e,t,a){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(Qa,a)}catch{}switch(a.tag){case 26:xt||$n(a,t),aa(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:xt||$n(a,t);var s=at,c=Qt;Ta(a.type)&&(at=a.stateNode,Qt=!1),aa(e,t,a),Ki(a.stateNode),at=s,Qt=c;break;case 5:xt||$n(a,t);case 6:if(s=at,c=Qt,at=null,aa(e,t,a),at=s,Qt=c,at!==null)if(Qt)try{(at.nodeType===9?at.body:at.nodeName==="HTML"?at.ownerDocument.body:at).removeChild(a.stateNode)}catch(o){Je(a,t,o)}else try{at.removeChild(a.stateNode)}catch(o){Je(a,t,o)}break;case 18:at!==null&&(Qt?(e=at,Am(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Wl(e)):Am(at,a.stateNode));break;case 4:s=at,c=Qt,at=a.stateNode.containerInfo,Qt=!0,aa(e,t,a),at=s,Qt=c;break;case 0:case 11:case 14:case 15:Na(2,a,t),xt||Na(4,a,t),aa(e,t,a);break;case 1:xt||($n(a,t),s=a.stateNode,typeof s.componentWillUnmount=="function"&&Ch(a,t,s)),aa(e,t,a);break;case 21:aa(e,t,a);break;case 22:xt=(s=xt)||a.memoizedState!==null,aa(e,t,a),xt=s;break;default:aa(e,t,a)}}function Mh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wl(e)}catch(a){Je(t,t.return,a)}}}function Dh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wl(e)}catch(a){Je(t,t.return,a)}}function my(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Oh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Oh),t;default:throw Error(u(435,e.tag))}}function Fs(e,t){var a=my(e);t.forEach(function(s){if(!a.has(s)){a.add(s);var c=_y.bind(null,e,s);s.then(c,c)}})}function Vt(e,t){var a=t.deletions;if(a!==null)for(var s=0;s<a.length;s++){var c=a[s],o=e,h=t,y=h;e:for(;y!==null;){switch(y.tag){case 27:if(Ta(y.type)){at=y.stateNode,Qt=!1;break e}break;case 5:at=y.stateNode,Qt=!1;break e;case 3:case 4:at=y.stateNode.containerInfo,Qt=!0;break e}y=y.return}if(at===null)throw Error(u(160));Rh(o,h,c),at=null,Qt=!1,o=c.alternate,o!==null&&(o.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Uh(t,e),t=t.sibling}var En=null;function Uh(e,t){var a=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Vt(t,e),Xt(e),s&4&&(Na(3,e,e.return),Ui(3,e),Na(5,e,e.return));break;case 1:Vt(t,e),Xt(e),s&512&&(xt||a===null||$n(a,a.return)),s&64&&na&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?s:a.concat(s))));break;case 26:var c=En;if(Vt(t,e),Xt(e),s&512&&(xt||a===null||$n(a,a.return)),s&4){var o=a!==null?a.memoizedState:null;if(s=e.memoizedState,a===null)if(s===null)if(e.stateNode===null){e:{s=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(s){case"title":o=c.getElementsByTagName("title")[0],(!o||o[oi]||o[Ot]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=c.createElement(s),c.head.insertBefore(o,c.querySelector("head > title"))),Mt(o,s,a),o[Ot]=e,Et(o),s=o;break e;case"link":var h=Um("link","href",c).get(s+(a.href||""));if(h){for(var y=0;y<h.length;y++)if(o=h[y],o.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&o.getAttribute("rel")===(a.rel==null?null:a.rel)&&o.getAttribute("title")===(a.title==null?null:a.title)&&o.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){h.splice(y,1);break t}}o=c.createElement(s),Mt(o,s,a),c.head.appendChild(o);break;case"meta":if(h=Um("meta","content",c).get(s+(a.content||""))){for(y=0;y<h.length;y++)if(o=h[y],o.getAttribute("content")===(a.content==null?null:""+a.content)&&o.getAttribute("name")===(a.name==null?null:a.name)&&o.getAttribute("property")===(a.property==null?null:a.property)&&o.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&o.getAttribute("charset")===(a.charSet==null?null:a.charSet)){h.splice(y,1);break t}}o=c.createElement(s),Mt(o,s,a),c.head.appendChild(o);break;default:throw Error(u(468,s))}o[Ot]=e,Et(o),s=o}e.stateNode=s}else Zm(c,e.type,e.stateNode);else e.stateNode=Dm(c,s,e.memoizedProps);else o!==s?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,s===null?Zm(c,e.type,e.stateNode):Dm(c,s,e.memoizedProps)):s===null&&e.stateNode!==null&&ju(e,e.memoizedProps,a.memoizedProps)}break;case 27:Vt(t,e),Xt(e),s&512&&(xt||a===null||$n(a,a.return)),a!==null&&s&4&&ju(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Vt(t,e),Xt(e),s&512&&(xt||a===null||$n(a,a.return)),e.flags&32){c=e.stateNode;try{Sl(c,"")}catch(oe){Je(e,e.return,oe)}}s&4&&e.stateNode!=null&&(c=e.memoizedProps,ju(e,c,a!==null?a.memoizedProps:c)),s&1024&&(_u=!0);break;case 6:if(Vt(t,e),Xt(e),s&4){if(e.stateNode===null)throw Error(u(162));s=e.memoizedProps,a=e.stateNode;try{a.nodeValue=s}catch(oe){Je(e,e.return,oe)}}break;case 3:if(mr=null,c=En,En=fr(t.containerInfo),Vt(t,e),En=c,Xt(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{Wl(t.containerInfo)}catch(oe){Je(e,e.return,oe)}_u&&(_u=!1,Zh(e));break;case 4:s=En,En=fr(e.stateNode.containerInfo),Vt(t,e),Xt(e),En=s;break;case 12:Vt(t,e),Xt(e);break;case 31:Vt(t,e),Xt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Fs(e,s)));break;case 13:Vt(t,e),Xt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(er=ne()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Fs(e,s)));break;case 22:c=e.memoizedState!==null;var _=a!==null&&a.memoizedState!==null,T=na,H=xt;if(na=T||c,xt=H||_,Vt(t,e),xt=H,na=T,Xt(e),s&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||_||na||xt||ol(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){_=a=t;try{if(o=_.stateNode,c)h=o.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{y=_.stateNode;var G=_.memoizedProps.style,R=G!=null&&G.hasOwnProperty("display")?G.display:null;y.style.display=R==null||typeof R=="boolean"?"":(""+R).trim()}}catch(oe){Je(_,_.return,oe)}}}else if(t.tag===6){if(a===null){_=t;try{_.stateNode.nodeValue=c?"":_.memoizedProps}catch(oe){Je(_,_.return,oe)}}}else if(t.tag===18){if(a===null){_=t;try{var D=_.stateNode;c?Cm(D,!0):Cm(_.stateNode,!1)}catch(oe){Je(_,_.return,oe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(a=s.retryQueue,a!==null&&(s.retryQueue=null,Fs(e,a))));break;case 19:Vt(t,e),Xt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Fs(e,s)));break;case 30:break;case 21:break;default:Vt(t,e),Xt(e)}}function Xt(e){var t=e.flags;if(t&2){try{for(var a,s=e.return;s!==null;){if(Eh(s)){a=s;break}s=s.return}if(a==null)throw Error(u(160));switch(a.tag){case 27:var c=a.stateNode,o=xu(e);Ps(e,o,c);break;case 5:var h=a.stateNode;a.flags&32&&(Sl(h,""),a.flags&=-33);var y=xu(e);Ps(e,y,h);break;case 3:case 4:var _=a.stateNode.containerInfo,T=xu(e);Su(e,T,_);break;default:throw Error(u(161))}}catch(H){Je(e,e.return,H)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Zh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Zh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function la(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Th(e,t.alternate,t),t=t.sibling}function ol(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Na(4,t,t.return),ol(t);break;case 1:$n(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Ch(t,t.return,a),ol(t);break;case 27:Ki(t.stateNode);case 26:case 5:$n(t,t.return),ol(t);break;case 22:t.memoizedState===null&&ol(t);break;case 30:ol(t);break;default:ol(t)}e=e.sibling}}function ia(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,c=e,o=t,h=o.flags;switch(o.tag){case 0:case 11:case 15:ia(c,o,a),Ui(4,o);break;case 1:if(ia(c,o,a),s=o,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(T){Je(s,s.return,T)}if(s=o,c=s.updateQueue,c!==null){var y=s.stateNode;try{var _=c.shared.hiddenCallbacks;if(_!==null)for(c.shared.hiddenCallbacks=null,c=0;c<_.length;c++)mf(_[c],y)}catch(T){Je(s,s.return,T)}}a&&h&64&&Ah(o),Zi(o,o.return);break;case 27:wh(o);case 26:case 5:ia(c,o,a),a&&s===null&&h&4&&zh(o),Zi(o,o.return);break;case 12:ia(c,o,a);break;case 31:ia(c,o,a),a&&h&4&&Mh(c,o);break;case 13:ia(c,o,a),a&&h&4&&Dh(c,o);break;case 22:o.memoizedState===null&&ia(c,o,a),Zi(o,o.return);break;case 30:break;default:ia(c,o,a)}t=t.sibling}}function Nu(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&_i(a))}function Au(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&_i(e))}function wn(e,t,a,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Hh(e,t,a,s),t=t.sibling}function Hh(e,t,a,s){var c=t.flags;switch(t.tag){case 0:case 11:case 15:wn(e,t,a,s),c&2048&&Ui(9,t);break;case 1:wn(e,t,a,s);break;case 3:wn(e,t,a,s),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&_i(e)));break;case 12:if(c&2048){wn(e,t,a,s),e=t.stateNode;try{var o=t.memoizedProps,h=o.id,y=o.onPostCommit;typeof y=="function"&&y(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(_){Je(t,t.return,_)}}else wn(e,t,a,s);break;case 31:wn(e,t,a,s);break;case 13:wn(e,t,a,s);break;case 23:break;case 22:o=t.stateNode,h=t.alternate,t.memoizedState!==null?o._visibility&2?wn(e,t,a,s):Hi(e,t):o._visibility&2?wn(e,t,a,s):(o._visibility|=2,ql(e,t,a,s,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Nu(h,t);break;case 24:wn(e,t,a,s),c&2048&&Au(t.alternate,t);break;default:wn(e,t,a,s)}}function ql(e,t,a,s,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,h=t,y=a,_=s,T=h.flags;switch(h.tag){case 0:case 11:case 15:ql(o,h,y,_,c),Ui(8,h);break;case 23:break;case 22:var H=h.stateNode;h.memoizedState!==null?H._visibility&2?ql(o,h,y,_,c):Hi(o,h):(H._visibility|=2,ql(o,h,y,_,c)),c&&T&2048&&Nu(h.alternate,h);break;case 24:ql(o,h,y,_,c),c&&T&2048&&Au(h.alternate,h);break;default:ql(o,h,y,_,c)}t=t.sibling}}function Hi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,s=t,c=s.flags;switch(s.tag){case 22:Hi(a,s),c&2048&&Nu(s.alternate,s);break;case 24:Hi(a,s),c&2048&&Au(s.alternate,s);break;default:Hi(a,s)}t=t.sibling}}var $i=8192;function Gl(e,t,a){if(e.subtreeFlags&$i)for(e=e.child;e!==null;)$h(e,t,a),e=e.sibling}function $h(e,t,a){switch(e.tag){case 26:Gl(e,t,a),e.flags&$i&&e.memoizedState!==null&&eb(a,En,e.memoizedState,e.memoizedProps);break;case 5:Gl(e,t,a);break;case 3:case 4:var s=En;En=fr(e.stateNode.containerInfo),Gl(e,t,a),En=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=$i,$i=16777216,Gl(e,t,a),$i=s):Gl(e,t,a));break;default:Gl(e,t,a)}}function Lh(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Li(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];wt=s,qh(s,e)}Lh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bh(e),e=e.sibling}function Bh(e){switch(e.tag){case 0:case 11:case 15:Li(e),e.flags&2048&&Na(9,e,e.return);break;case 3:Li(e);break;case 12:Li(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ws(e)):Li(e);break;default:Li(e)}}function Ws(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];wt=s,qh(s,e)}Lh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Na(8,t,t.return),Ws(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Ws(t));break;default:Ws(t)}e=e.sibling}}function qh(e,t){for(;wt!==null;){var a=wt;switch(a.tag){case 0:case 11:case 15:Na(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var s=a.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:_i(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,wt=s;else e:for(a=e;wt!==null;){s=wt;var c=s.sibling,o=s.return;if(kh(s),s===a){wt=null;break e}if(c!==null){c.return=o,wt=c;break e}wt=o}}}var py={getCacheForType:function(e){var t=kt(yt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return kt(yt).controller.signal}},vy=typeof WeakMap=="function"?WeakMap:Map,Be=0,Fe=null,we=null,Te=0,Ye=0,ln=null,Aa=!1,Yl=!1,Cu=!1,sa=0,ot=0,Ca=0,dl=0,zu=0,sn=0,Jl=0,Bi=null,It=null,Eu=!1,er=0,Gh=0,tr=1/0,nr=null,za=null,At=0,Ea=null,Kl=null,ra=0,wu=0,Ou=null,Yh=null,qi=0,Tu=null;function rn(){return(Be&2)!==0&&Te!==0?Te&-Te:Z.T!==null?Zu():id()}function Jh(){if(sn===0)if((Te&536870912)===0||Re){var e=W;W<<=1,(W&3932160)===0&&(W=262144),sn=e}else sn=536870912;return e=nn.current,e!==null&&(e.flags|=32),sn}function Pt(e,t,a){(e===Fe&&(Ye===2||Ye===9)||e.cancelPendingCommit!==null)&&(Ql(e,0),wa(e,Te,sn,!1)),Va(e,a),((Be&2)===0||e!==Fe)&&(e===Fe&&((Be&2)===0&&(dl|=a),ot===4&&wa(e,Te,sn,!1)),Ln(e))}function Kh(e,t,a){if((Be&6)!==0)throw Error(u(327));var s=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Cn(e,t),c=s?by(e,t):Ru(e,t,!0),o=s;do{if(c===0){Yl&&!s&&wa(e,t,0,!1);break}else{if(a=e.current.alternate,o&&!gy(a)){c=Ru(e,t,!1),o=!1;continue}if(c===2){if(o=t,e.errorRecoveryDisabledLanes&o)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var y=e;c=Bi;var _=y.current.memoizedState.isDehydrated;if(_&&(Ql(y,h).flags|=256),h=Ru(y,h,!1),h!==2){if(Cu&&!_){y.errorRecoveryDisabledLanes|=o,dl|=o,c=4;break e}o=It,It=c,o!==null&&(It===null?It=o:It.push.apply(It,o))}c=h}if(o=!1,c!==2)continue}}if(c===1){Ql(e,0),wa(e,t,0,!0);break}e:{switch(s=e,o=c,o){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:wa(s,t,sn,!Aa);break e;case 2:It=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(c=er+300-ne(),10<c)){if(wa(s,t,sn,!Aa),de(s,0,!0)!==0)break e;ra=t,s.timeoutHandle=_m(Qh.bind(null,s,a,It,nr,Eu,t,sn,dl,Jl,Aa,o,"Throttled",-0,0),c);break e}Qh(s,a,It,nr,Eu,t,sn,dl,Jl,Aa,o,null,-0,0)}}break}while(!0);Ln(e)}function Qh(e,t,a,s,c,o,h,y,_,T,H,G,R,D){if(e.timeoutHandle=-1,G=t.subtreeFlags,G&8192||(G&16785408)===16785408){G={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Kn},$h(t,o,G);var oe=(o&62914560)===o?er-ne():(o&4194048)===o?Gh-ne():0;if(oe=tb(G,oe),oe!==null){ra=o,e.cancelPendingCommit=oe(tm.bind(null,e,t,o,a,s,c,h,y,_,H,G,null,R,D)),wa(e,o,h,!T);return}}tm(e,t,o,a,s,c,h,y,_)}function gy(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var s=0;s<a.length;s++){var c=a[s],o=c.getSnapshot;c=c.value;try{if(!en(o(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function wa(e,t,a,s){t&=~zu,t&=~dl,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var c=t;0<c;){var o=31-Bt(c),h=1<<o;s[o]=-1,c&=~h}a!==0&&nd(e,a,t)}function ar(){return(Be&6)===0?(Gi(0),!1):!0}function ku(){if(we!==null){if(Ye===0)var e=we.return;else e=we,In=nl=null,Vc(e),Zl=null,Ai=0,e=we;for(;e!==null;)Nh(e.alternate,e),e=e.return;we=null}}function Ql(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Zy(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),ra=0,ku(),Fe=e,we=a=Vn(e.current,null),Te=t,Ye=0,ln=null,Aa=!1,Yl=Cn(e,t),Cu=!1,Jl=sn=zu=dl=Ca=ot=0,It=Bi=null,Eu=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var c=31-Bt(s),o=1<<c;t|=e[c],s&=~o}return sa=t,Ns(),a}function Vh(e,t){ze=null,Z.H=Ri,t===Ul||t===ks?(t=of(),Ye=3):t===Uc?(t=of(),Ye=4):Ye=t===ou?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ln=t,we===null&&(ot=1,Ks(e,mn(t,e.current)))}function Xh(){var e=nn.current;return e===null?!0:(Te&4194048)===Te?yn===null:(Te&62914560)===Te||(Te&536870912)!==0?e===yn:!1}function Ih(){var e=Z.H;return Z.H=Ri,e===null?Ri:e}function Ph(){var e=Z.A;return Z.A=py,e}function lr(){ot=4,Aa||(Te&4194048)!==Te&&nn.current!==null||(Yl=!0),(Ca&134217727)===0&&(dl&134217727)===0||Fe===null||wa(Fe,Te,sn,!1)}function Ru(e,t,a){var s=Be;Be|=2;var c=Ih(),o=Ph();(Fe!==e||Te!==t)&&(nr=null,Ql(e,t)),t=!1;var h=ot;e:do try{if(Ye!==0&&we!==null){var y=we,_=ln;switch(Ye){case 8:ku(),h=6;break e;case 3:case 2:case 9:case 6:nn.current===null&&(t=!0);var T=Ye;if(Ye=0,ln=null,Vl(e,y,_,T),a&&Yl){h=0;break e}break;default:T=Ye,Ye=0,ln=null,Vl(e,y,_,T)}}yy(),h=ot;break}catch(H){Vh(e,H)}while(!0);return t&&e.shellSuspendCounter++,In=nl=null,Be=s,Z.H=c,Z.A=o,we===null&&(Fe=null,Te=0,Ns()),h}function yy(){for(;we!==null;)Fh(we)}function by(e,t){var a=Be;Be|=2;var s=Ih(),c=Ph();Fe!==e||Te!==t?(nr=null,tr=ne()+500,Ql(e,t)):Yl=Cn(e,t);e:do try{if(Ye!==0&&we!==null){t=we;var o=ln;t:switch(Ye){case 1:Ye=0,ln=null,Vl(e,t,o,1);break;case 2:case 9:if(cf(o)){Ye=0,ln=null,Wh(t);break}t=function(){Ye!==2&&Ye!==9||Fe!==e||(Ye=7),Ln(e)},o.then(t,t);break e;case 3:Ye=7;break e;case 4:Ye=5;break e;case 7:cf(o)?(Ye=0,ln=null,Wh(t)):(Ye=0,ln=null,Vl(e,t,o,7));break;case 5:var h=null;switch(we.tag){case 26:h=we.memoizedState;case 5:case 27:var y=we;if(h?Hm(h):y.stateNode.complete){Ye=0,ln=null;var _=y.sibling;if(_!==null)we=_;else{var T=y.return;T!==null?(we=T,ir(T)):we=null}break t}}Ye=0,ln=null,Vl(e,t,o,5);break;case 6:Ye=0,ln=null,Vl(e,t,o,6);break;case 8:ku(),ot=6;break e;default:throw Error(u(462))}}jy();break}catch(H){Vh(e,H)}while(!0);return In=nl=null,Z.H=s,Z.A=c,Be=a,we!==null?0:(Fe=null,Te=0,Ns(),ot)}function jy(){for(;we!==null&&!Yn();)Fh(we)}function Fh(e){var t=Sh(e.alternate,e,sa);e.memoizedProps=e.pendingProps,t===null?ir(e):we=t}function Wh(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=vh(a,t,t.pendingProps,t.type,void 0,Te);break;case 11:t=vh(a,t,t.pendingProps,t.type.render,t.ref,Te);break;case 5:Vc(t);default:Nh(a,t),t=we=Id(t,sa),t=Sh(a,t,sa)}e.memoizedProps=e.pendingProps,t===null?ir(e):we=t}function Vl(e,t,a,s){In=nl=null,Vc(t),Zl=null,Ai=0;var c=t.return;try{if(cy(e,c,t,a,Te)){ot=1,Ks(e,mn(a,e.current)),we=null;return}}catch(o){if(c!==null)throw we=c,o;ot=1,Ks(e,mn(a,e.current)),we=null;return}t.flags&32768?(Re||s===1?e=!0:Yl||(Te&536870912)!==0?e=!1:(Aa=e=!0,(s===2||s===9||s===3||s===6)&&(s=nn.current,s!==null&&s.tag===13&&(s.flags|=16384))),em(t,e)):ir(t)}function ir(e){var t=e;do{if((t.flags&32768)!==0){em(t,Aa);return}e=t.return;var a=dy(t.alternate,t,sa);if(a!==null){we=a;return}if(t=t.sibling,t!==null){we=t;return}we=t=e}while(t!==null);ot===0&&(ot=5)}function em(e,t){do{var a=fy(e.alternate,e);if(a!==null){a.flags&=32767,we=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){we=e;return}we=e=a}while(e!==null);ot=6,we=null}function tm(e,t,a,s,c,o,h,y,_){e.cancelPendingCommit=null;do sr();while(At!==0);if((Be&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(o=t.lanes|t.childLanes,o|=xc,zt(e,a,o,h,y,_),e===Fe&&(we=Fe=null,Te=0),Kl=t,Ea=e,ra=a,wu=o,Ou=c,Yh=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Ny(mt,function(){return sm(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=Z.T,Z.T=null,c=F.p,F.p=2,h=Be,Be|=4;try{hy(e,t,a)}finally{Be=h,F.p=c,Z.T=s}}At=1,nm(),am(),lm()}}function nm(){if(At===1){At=0;var e=Ea,t=Kl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=Z.T,Z.T=null;var s=F.p;F.p=2;var c=Be;Be|=4;try{Uh(t,e);var o=Ju,h=Bd(e.containerInfo),y=o.focusedElem,_=o.selectionRange;if(h!==y&&y&&y.ownerDocument&&Ld(y.ownerDocument.documentElement,y)){if(_!==null&&vc(y)){var T=_.start,H=_.end;if(H===void 0&&(H=T),"selectionStart"in y)y.selectionStart=T,y.selectionEnd=Math.min(H,y.value.length);else{var G=y.ownerDocument||document,R=G&&G.defaultView||window;if(R.getSelection){var D=R.getSelection(),oe=y.textContent.length,Se=Math.min(_.start,oe),Ie=_.end===void 0?Se:Math.min(_.end,oe);!D.extend&&Se>Ie&&(h=Ie,Ie=Se,Se=h);var E=$d(y,Se),A=$d(y,Ie);if(E&&A&&(D.rangeCount!==1||D.anchorNode!==E.node||D.anchorOffset!==E.offset||D.focusNode!==A.node||D.focusOffset!==A.offset)){var O=G.createRange();O.setStart(E.node,E.offset),D.removeAllRanges(),Se>Ie?(D.addRange(O),D.extend(A.node,A.offset)):(O.setEnd(A.node,A.offset),D.addRange(O))}}}}for(G=[],D=y;D=D.parentNode;)D.nodeType===1&&G.push({element:D,left:D.scrollLeft,top:D.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<G.length;y++){var L=G[y];L.element.scrollLeft=L.left,L.element.scrollTop=L.top}}yr=!!Yu,Ju=Yu=null}finally{Be=c,F.p=s,Z.T=a}}e.current=t,At=2}}function am(){if(At===2){At=0;var e=Ea,t=Kl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=Z.T,Z.T=null;var s=F.p;F.p=2;var c=Be;Be|=4;try{Th(e,t.alternate,t)}finally{Be=c,F.p=s,Z.T=a}}At=3}}function lm(){if(At===4||At===3){At=0,Ge();var e=Ea,t=Kl,a=ra,s=Yh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?At=5:(At=0,Kl=Ea=null,im(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(za=null),Pr(a),t=t.stateNode,Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(Qa,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=Z.T,c=F.p,F.p=2,Z.T=null;try{for(var o=e.onRecoverableError,h=0;h<s.length;h++){var y=s[h];o(y.value,{componentStack:y.stack})}}finally{Z.T=t,F.p=c}}(ra&3)!==0&&sr(),Ln(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===Tu?qi++:(qi=0,Tu=e):qi=0,Gi(0)}}function im(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,_i(t)))}function sr(){return nm(),am(),lm(),sm()}function sm(){if(At!==5)return!1;var e=Ea,t=wu;wu=0;var a=Pr(ra),s=Z.T,c=F.p;try{F.p=32>a?32:a,Z.T=null,a=Ou,Ou=null;var o=Ea,h=ra;if(At=0,Kl=Ea=null,ra=0,(Be&6)!==0)throw Error(u(331));var y=Be;if(Be|=4,Bh(o.current),Hh(o,o.current,h,a),Be=y,Gi(0,!1),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(Qa,o)}catch{}return!0}finally{F.p=c,Z.T=s,im(e,t)}}function rm(e,t,a){t=mn(a,t),t=uu(e.stateNode,t,2),e=xa(e,t,2),e!==null&&(Va(e,2),Ln(e))}function Je(e,t,a){if(e.tag===3)rm(e,e,a);else for(;t!==null;){if(t.tag===3){rm(t,e,a);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(za===null||!za.has(s))){e=mn(a,e),a=ch(2),s=xa(t,a,2),s!==null&&(uh(a,s,t,e),Va(s,2),Ln(s));break}}t=t.return}}function Mu(e,t,a){var s=e.pingCache;if(s===null){s=e.pingCache=new vy;var c=new Set;s.set(t,c)}else c=s.get(t),c===void 0&&(c=new Set,s.set(t,c));c.has(a)||(Cu=!0,c.add(a),e=xy.bind(null,e,t,a),t.then(e,e))}function xy(e,t,a){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Fe===e&&(Te&a)===a&&(ot===4||ot===3&&(Te&62914560)===Te&&300>ne()-er?(Be&2)===0&&Ql(e,0):zu|=a,Jl===Te&&(Jl=0)),Ln(e)}function cm(e,t){t===0&&(t=fs()),e=Wa(e,t),e!==null&&(Va(e,t),Ln(e))}function Sy(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),cm(e,a)}function _y(e,t){var a=0;switch(e.tag){case 31:case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(u(314))}s!==null&&s.delete(t),cm(e,a)}function Ny(e,t){return An(e,t)}var rr=null,Xl=null,Du=!1,cr=!1,Uu=!1,Oa=0;function Ln(e){e!==Xl&&e.next===null&&(Xl===null?rr=Xl=e:Xl=Xl.next=e),cr=!0,Du||(Du=!0,Cy())}function Gi(e,t){if(!Uu&&cr){Uu=!0;do for(var a=!1,s=rr;s!==null;){if(e!==0){var c=s.pendingLanes;if(c===0)var o=0;else{var h=s.suspendedLanes,y=s.pingedLanes;o=(1<<31-Bt(42|e)+1)-1,o&=c&~(h&~y),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,fm(s,o))}else o=Te,o=de(s,s===Fe?o:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(o&3)===0||Cn(s,o)||(a=!0,fm(s,o));s=s.next}while(a);Uu=!1}}function Ay(){um()}function um(){cr=Du=!1;var e=0;Oa!==0&&Uy()&&(e=Oa);for(var t=ne(),a=null,s=rr;s!==null;){var c=s.next,o=om(s,t);o===0?(s.next=null,a===null?rr=c:a.next=c,c===null&&(Xl=a)):(a=s,(e!==0||(o&3)!==0)&&(cr=!0)),s=c}At!==0&&At!==5||Gi(e),Oa!==0&&(Oa=0)}function om(e,t){for(var a=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var h=31-Bt(o),y=1<<h,_=c[h];_===-1?((y&a)===0||(y&s)!==0)&&(c[h]=ds(y,t)):_<=t&&(e.expiredLanes|=y),o&=~y}if(t=Fe,a=Te,a=de(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,a===0||e===t&&(Ye===2||Ye===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Dn(s),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Cn(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(s!==null&&Dn(s),Pr(a)){case 2:case 8:a=nt;break;case 32:a=mt;break;case 268435456:a=Ka;break;default:a=mt}return s=dm.bind(null,e),a=An(a,s),e.callbackPriority=t,e.callbackNode=a,t}return s!==null&&s!==null&&Dn(s),e.callbackPriority=2,e.callbackNode=null,2}function dm(e,t){if(At!==0&&At!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(sr()&&e.callbackNode!==a)return null;var s=Te;return s=de(e,e===Fe?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Kh(e,s,t),om(e,ne()),e.callbackNode!=null&&e.callbackNode===a?dm.bind(null,e):null)}function fm(e,t){if(sr())return null;Kh(e,t,!0)}function Cy(){Hy(function(){(Be&6)!==0?An(Ce,Ay):um()})}function Zu(){if(Oa===0){var e=Ml;e===0&&(e=N,N<<=1,(N&261888)===0&&(N=256)),Oa=e}return Oa}function hm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:vs(""+e)}function mm(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function zy(e,t,a,s,c){if(t==="submit"&&a&&a.stateNode===c){var o=hm((c[Jt]||null).action),h=s.submitter;h&&(t=(t=h[Jt]||null)?hm(t.formAction):h.getAttribute("formAction"),t!==null&&(o=t,h=null));var y=new js("action","action",null,s,c);e.push({event:y,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Oa!==0){var _=h?mm(c,h):new FormData(c);au(a,{pending:!0,data:_,method:c.method,action:o},null,_)}}else typeof o=="function"&&(y.preventDefault(),_=h?mm(c,h):new FormData(c),au(a,{pending:!0,data:_,method:c.method,action:o},o,_))},currentTarget:c}]})}}for(var Hu=0;Hu<jc.length;Hu++){var $u=jc[Hu],Ey=$u.toLowerCase(),wy=$u[0].toUpperCase()+$u.slice(1);zn(Ey,"on"+wy)}zn(Yd,"onAnimationEnd"),zn(Jd,"onAnimationIteration"),zn(Kd,"onAnimationStart"),zn("dblclick","onDoubleClick"),zn("focusin","onFocus"),zn("focusout","onBlur"),zn(Jg,"onTransitionRun"),zn(Kg,"onTransitionStart"),zn(Qg,"onTransitionCancel"),zn(Qd,"onTransitionEnd"),jl("onMouseEnter",["mouseout","mouseover"]),jl("onMouseLeave",["mouseout","mouseover"]),jl("onPointerEnter",["pointerout","pointerover"]),jl("onPointerLeave",["pointerout","pointerover"]),Xa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Xa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Xa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Xa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Xa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Xa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yi="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(" "),Oy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yi));function pm(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var s=e[a],c=s.event;s=s.listeners;e:{var o=void 0;if(t)for(var h=s.length-1;0<=h;h--){var y=s[h],_=y.instance,T=y.currentTarget;if(y=y.listener,_!==o&&c.isPropagationStopped())break e;o=y,c.currentTarget=T;try{o(c)}catch(H){_s(H)}c.currentTarget=null,o=_}else for(h=0;h<s.length;h++){if(y=s[h],_=y.instance,T=y.currentTarget,y=y.listener,_!==o&&c.isPropagationStopped())break e;o=y,c.currentTarget=T;try{o(c)}catch(H){_s(H)}c.currentTarget=null,o=_}}}}function Oe(e,t){var a=t[Fr];a===void 0&&(a=t[Fr]=new Set);var s=e+"__bubble";a.has(s)||(vm(t,e,2,!1),a.add(s))}function Lu(e,t,a){var s=0;t&&(s|=4),vm(a,e,s,t)}var ur="_reactListening"+Math.random().toString(36).slice(2);function Bu(e){if(!e[ur]){e[ur]=!0,cd.forEach(function(a){a!=="selectionchange"&&(Oy.has(a)||Lu(a,!1,e),Lu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ur]||(t[ur]=!0,Lu("selectionchange",!1,t))}}function vm(e,t,a,s){switch(Jm(t)){case 2:var c=lb;break;case 8:c=ib;break;default:c=no}a=c.bind(null,t,a,e),c=void 0,!rc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),s?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function qu(e,t,a,s,c){var o=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var h=s.tag;if(h===3||h===4){var y=s.stateNode.containerInfo;if(y===c)break;if(h===4)for(h=s.return;h!==null;){var _=h.tag;if((_===3||_===4)&&h.stateNode.containerInfo===c)return;h=h.return}for(;y!==null;){if(h=gl(y),h===null)return;if(_=h.tag,_===5||_===6||_===26||_===27){s=o=h;continue e}y=y.parentNode}}s=s.return}jd(function(){var T=o,H=ic(a),G=[];e:{var R=Vd.get(e);if(R!==void 0){var D=js,oe=e;switch(e){case"keypress":if(ys(a)===0)break e;case"keydown":case"keyup":D=_g;break;case"focusin":oe="focus",D=dc;break;case"focusout":oe="blur",D=dc;break;case"beforeblur":case"afterblur":D=dc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":D=_d;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":D=dg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":D=Cg;break;case Yd:case Jd:case Kd:D=mg;break;case Qd:D=Eg;break;case"scroll":case"scrollend":D=ug;break;case"wheel":D=Og;break;case"copy":case"cut":case"paste":D=vg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":D=Ad;break;case"toggle":case"beforetoggle":D=kg}var Se=(t&4)!==0,Ie=!Se&&(e==="scroll"||e==="scrollend"),E=Se?R!==null?R+"Capture":null:R;Se=[];for(var A=T,O;A!==null;){var L=A;if(O=L.stateNode,L=L.tag,L!==5&&L!==26&&L!==27||O===null||E===null||(L=fi(A,E),L!=null&&Se.push(Ji(A,L,O))),Ie)break;A=A.return}0<Se.length&&(R=new D(R,oe,null,a,H),G.push({event:R,listeners:Se}))}}if((t&7)===0){e:{if(R=e==="mouseover"||e==="pointerover",D=e==="mouseout"||e==="pointerout",R&&a!==lc&&(oe=a.relatedTarget||a.fromElement)&&(gl(oe)||oe[vl]))break e;if((D||R)&&(R=H.window===H?H:(R=H.ownerDocument)?R.defaultView||R.parentWindow:window,D?(oe=a.relatedTarget||a.toElement,D=T,oe=oe?gl(oe):null,oe!==null&&(Ie=f(oe),Se=oe.tag,oe!==Ie||Se!==5&&Se!==27&&Se!==6)&&(oe=null)):(D=null,oe=T),D!==oe)){if(Se=_d,L="onMouseLeave",E="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(Se=Ad,L="onPointerLeave",E="onPointerEnter",A="pointer"),Ie=D==null?R:di(D),O=oe==null?R:di(oe),R=new Se(L,A+"leave",D,a,H),R.target=Ie,R.relatedTarget=O,L=null,gl(H)===T&&(Se=new Se(E,A+"enter",oe,a,H),Se.target=O,Se.relatedTarget=Ie,L=Se),Ie=L,D&&oe)t:{for(Se=Ty,E=D,A=oe,O=0,L=E;L;L=Se(L))O++;L=0;for(var ye=A;ye;ye=Se(ye))L++;for(;0<O-L;)E=Se(E),O--;for(;0<L-O;)A=Se(A),L--;for(;O--;){if(E===A||A!==null&&E===A.alternate){Se=E;break t}E=Se(E),A=Se(A)}Se=null}else Se=null;D!==null&&gm(G,R,D,Se,!1),oe!==null&&Ie!==null&&gm(G,Ie,oe,Se,!0)}}e:{if(R=T?di(T):window,D=R.nodeName&&R.nodeName.toLowerCase(),D==="select"||D==="input"&&R.type==="file")var $e=Rd;else if(Td(R))if(Md)$e=qg;else{$e=Lg;var he=$g}else D=R.nodeName,!D||D.toLowerCase()!=="input"||R.type!=="checkbox"&&R.type!=="radio"?T&&ac(T.elementType)&&($e=Rd):$e=Bg;if($e&&($e=$e(e,T))){kd(G,$e,a,H);break e}he&&he(e,R,T),e==="focusout"&&T&&R.type==="number"&&T.memoizedProps.value!=null&&nc(R,"number",R.value)}switch(he=T?di(T):window,e){case"focusin":(Td(he)||he.contentEditable==="true")&&(Cl=he,gc=T,ji=null);break;case"focusout":ji=gc=Cl=null;break;case"mousedown":yc=!0;break;case"contextmenu":case"mouseup":case"dragend":yc=!1,qd(G,a,H);break;case"selectionchange":if(Yg)break;case"keydown":case"keyup":qd(G,a,H)}var Ee;if(hc)e:{switch(e){case"compositionstart":var ke="onCompositionStart";break e;case"compositionend":ke="onCompositionEnd";break e;case"compositionupdate":ke="onCompositionUpdate";break e}ke=void 0}else Al?wd(e,a)&&(ke="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(ke="onCompositionStart");ke&&(Cd&&a.locale!=="ko"&&(Al||ke!=="onCompositionStart"?ke==="onCompositionEnd"&&Al&&(Ee=xd()):(ma=H,cc="value"in ma?ma.value:ma.textContent,Al=!0)),he=or(T,ke),0<he.length&&(ke=new Nd(ke,e,null,a,H),G.push({event:ke,listeners:he}),Ee?ke.data=Ee:(Ee=Od(a),Ee!==null&&(ke.data=Ee)))),(Ee=Mg?Dg(e,a):Ug(e,a))&&(ke=or(T,"onBeforeInput"),0<ke.length&&(he=new Nd("onBeforeInput","beforeinput",null,a,H),G.push({event:he,listeners:ke}),he.data=Ee)),zy(G,e,T,a,H)}pm(G,t)})}function Ji(e,t,a){return{instance:e,listener:t,currentTarget:a}}function or(e,t){for(var a=t+"Capture",s=[];e!==null;){var c=e,o=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||o===null||(c=fi(e,a),c!=null&&s.unshift(Ji(e,c,o)),c=fi(e,t),c!=null&&s.push(Ji(e,c,o))),e.tag===3)return s;e=e.return}return[]}function Ty(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function gm(e,t,a,s,c){for(var o=t._reactName,h=[];a!==null&&a!==s;){var y=a,_=y.alternate,T=y.stateNode;if(y=y.tag,_!==null&&_===s)break;y!==5&&y!==26&&y!==27||T===null||(_=T,c?(T=fi(a,o),T!=null&&h.unshift(Ji(a,T,_))):c||(T=fi(a,o),T!=null&&h.push(Ji(a,T,_)))),a=a.return}h.length!==0&&e.push({event:t,listeners:h})}var ky=/\r\n?/g,Ry=/\u0000|\uFFFD/g;function ym(e){return(typeof e=="string"?e:""+e).replace(ky,`
9
+ `).replace(Ry,"")}function bm(e,t){return t=ym(t),ym(e)===t}function Xe(e,t,a,s,c,o){switch(a){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Sl(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Sl(e,""+s);break;case"className":ms(e,"class",s);break;case"tabIndex":ms(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":ms(e,a,s);break;case"style":yd(e,s,o);break;case"data":if(t!=="object"){ms(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=vs(""+s),e.setAttribute(a,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(a,"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 o=="function"&&(a==="formAction"?(t!=="input"&&Xe(e,t,"name",c.name,c,null),Xe(e,t,"formEncType",c.formEncType,c,null),Xe(e,t,"formMethod",c.formMethod,c,null),Xe(e,t,"formTarget",c.formTarget,c,null)):(Xe(e,t,"encType",c.encType,c,null),Xe(e,t,"method",c.method,c,null),Xe(e,t,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=vs(""+s),e.setAttribute(a,s);break;case"onClick":s!=null&&(e.onclick=Kn);break;case"onScroll":s!=null&&Oe("scroll",e);break;case"onScrollEnd":s!=null&&Oe("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(u(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}a=vs(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""+s):e.removeAttribute(a);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":s===!0?e.setAttribute(a,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,s):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(a,s):e.removeAttribute(a);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(a):e.setAttribute(a,s);break;case"popover":Oe("beforetoggle",e),Oe("toggle",e),hs(e,"popover",s);break;case"xlinkActuate":Jn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Jn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Jn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Jn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Jn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Jn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Jn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Jn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Jn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":hs(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=rg.get(a)||a,hs(e,a,s))}}function Gu(e,t,a,s,c,o){switch(a){case"style":yd(e,s,o);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(u(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"children":typeof s=="string"?Sl(e,s):(typeof s=="number"||typeof s=="bigint")&&Sl(e,""+s);break;case"onScroll":s!=null&&Oe("scroll",e);break;case"onScrollEnd":s!=null&&Oe("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Kn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ud.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),o=e[Jt]||null,o=o!=null?o[a]:null,typeof o=="function"&&e.removeEventListener(t,o,c),typeof s=="function")){typeof o!="function"&&o!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,s,c);break e}a in e?e[a]=s:s===!0?e.setAttribute(a,""):hs(e,a,s)}}}function Mt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Oe("error",e),Oe("load",e);var s=!1,c=!1,o;for(o in a)if(a.hasOwnProperty(o)){var h=a[o];if(h!=null)switch(o){case"src":s=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Xe(e,t,o,h,a,null)}}c&&Xe(e,t,"srcSet",a.srcSet,a,null),s&&Xe(e,t,"src",a.src,a,null);return;case"input":Oe("invalid",e);var y=o=h=c=null,_=null,T=null;for(s in a)if(a.hasOwnProperty(s)){var H=a[s];if(H!=null)switch(s){case"name":c=H;break;case"type":h=H;break;case"checked":_=H;break;case"defaultChecked":T=H;break;case"value":o=H;break;case"defaultValue":y=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(u(137,t));break;default:Xe(e,t,s,H,a,null)}}md(e,o,y,_,T,h,c,!1);return;case"select":Oe("invalid",e),s=h=o=null;for(c in a)if(a.hasOwnProperty(c)&&(y=a[c],y!=null))switch(c){case"value":o=y;break;case"defaultValue":h=y;break;case"multiple":s=y;default:Xe(e,t,c,y,a,null)}t=o,a=h,e.multiple=!!s,t!=null?xl(e,!!s,t,!1):a!=null&&xl(e,!!s,a,!0);return;case"textarea":Oe("invalid",e),o=c=s=null;for(h in a)if(a.hasOwnProperty(h)&&(y=a[h],y!=null))switch(h){case"value":s=y;break;case"defaultValue":c=y;break;case"children":o=y;break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(u(91));break;default:Xe(e,t,h,y,a,null)}vd(e,s,c,o);return;case"option":for(_ in a)a.hasOwnProperty(_)&&(s=a[_],s!=null)&&(_==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":Xe(e,t,_,s,a,null));return;case"dialog":Oe("beforetoggle",e),Oe("toggle",e),Oe("cancel",e),Oe("close",e);break;case"iframe":case"object":Oe("load",e);break;case"video":case"audio":for(s=0;s<Yi.length;s++)Oe(Yi[s],e);break;case"image":Oe("error",e),Oe("load",e);break;case"details":Oe("toggle",e);break;case"embed":case"source":case"link":Oe("error",e),Oe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(T in a)if(a.hasOwnProperty(T)&&(s=a[T],s!=null))switch(T){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Xe(e,t,T,s,a,null)}return;default:if(ac(t)){for(H in a)a.hasOwnProperty(H)&&(s=a[H],s!==void 0&&Gu(e,t,H,s,a,void 0));return}}for(y in a)a.hasOwnProperty(y)&&(s=a[y],s!=null&&Xe(e,t,y,s,a,null))}function My(e,t,a,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,o=null,h=null,y=null,_=null,T=null,H=null;for(D in a){var G=a[D];if(a.hasOwnProperty(D)&&G!=null)switch(D){case"checked":break;case"value":break;case"defaultValue":_=G;default:s.hasOwnProperty(D)||Xe(e,t,D,null,s,G)}}for(var R in s){var D=s[R];if(G=a[R],s.hasOwnProperty(R)&&(D!=null||G!=null))switch(R){case"type":o=D;break;case"name":c=D;break;case"checked":T=D;break;case"defaultChecked":H=D;break;case"value":h=D;break;case"defaultValue":y=D;break;case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(u(137,t));break;default:D!==G&&Xe(e,t,R,D,s,G)}}tc(e,h,y,_,T,H,o,c);return;case"select":D=h=y=R=null;for(o in a)if(_=a[o],a.hasOwnProperty(o)&&_!=null)switch(o){case"value":break;case"multiple":D=_;default:s.hasOwnProperty(o)||Xe(e,t,o,null,s,_)}for(c in s)if(o=s[c],_=a[c],s.hasOwnProperty(c)&&(o!=null||_!=null))switch(c){case"value":R=o;break;case"defaultValue":y=o;break;case"multiple":h=o;default:o!==_&&Xe(e,t,c,o,s,_)}t=y,a=h,s=D,R!=null?xl(e,!!a,R,!1):!!s!=!!a&&(t!=null?xl(e,!!a,t,!0):xl(e,!!a,a?[]:"",!1));return;case"textarea":D=R=null;for(y in a)if(c=a[y],a.hasOwnProperty(y)&&c!=null&&!s.hasOwnProperty(y))switch(y){case"value":break;case"children":break;default:Xe(e,t,y,null,s,c)}for(h in s)if(c=s[h],o=a[h],s.hasOwnProperty(h)&&(c!=null||o!=null))switch(h){case"value":R=c;break;case"defaultValue":D=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(u(91));break;default:c!==o&&Xe(e,t,h,c,s,o)}pd(e,R,D);return;case"option":for(var oe in a)R=a[oe],a.hasOwnProperty(oe)&&R!=null&&!s.hasOwnProperty(oe)&&(oe==="selected"?e.selected=!1:Xe(e,t,oe,null,s,R));for(_ in s)R=s[_],D=a[_],s.hasOwnProperty(_)&&R!==D&&(R!=null||D!=null)&&(_==="selected"?e.selected=R&&typeof R!="function"&&typeof R!="symbol":Xe(e,t,_,R,s,D));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 Se in a)R=a[Se],a.hasOwnProperty(Se)&&R!=null&&!s.hasOwnProperty(Se)&&Xe(e,t,Se,null,s,R);for(T in s)if(R=s[T],D=a[T],s.hasOwnProperty(T)&&R!==D&&(R!=null||D!=null))switch(T){case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(u(137,t));break;default:Xe(e,t,T,R,s,D)}return;default:if(ac(t)){for(var Ie in a)R=a[Ie],a.hasOwnProperty(Ie)&&R!==void 0&&!s.hasOwnProperty(Ie)&&Gu(e,t,Ie,void 0,s,R);for(H in s)R=s[H],D=a[H],!s.hasOwnProperty(H)||R===D||R===void 0&&D===void 0||Gu(e,t,H,R,s,D);return}}for(var E in a)R=a[E],a.hasOwnProperty(E)&&R!=null&&!s.hasOwnProperty(E)&&Xe(e,t,E,null,s,R);for(G in s)R=s[G],D=a[G],!s.hasOwnProperty(G)||R===D||R==null&&D==null||Xe(e,t,G,R,s,D)}function jm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Dy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),s=0;s<a.length;s++){var c=a[s],o=c.transferSize,h=c.initiatorType,y=c.duration;if(o&&y&&jm(h)){for(h=0,y=c.responseEnd,s+=1;s<a.length;s++){var _=a[s],T=_.startTime;if(T>y)break;var H=_.transferSize,G=_.initiatorType;H&&jm(G)&&(_=_.responseEnd,h+=H*(_<y?1:(y-T)/(_-T)))}if(--s,t+=8*(o+h)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Yu=null,Ju=null;function dr(e){return e.nodeType===9?e:e.ownerDocument}function xm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Sm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Ku(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Qu=null;function Uy(){var e=window.event;return e&&e.type==="popstate"?e===Qu?!1:(Qu=e,!0):(Qu=null,!1)}var _m=typeof setTimeout=="function"?setTimeout:void 0,Zy=typeof clearTimeout=="function"?clearTimeout:void 0,Nm=typeof Promise=="function"?Promise:void 0,Hy=typeof queueMicrotask=="function"?queueMicrotask:typeof Nm<"u"?function(e){return Nm.resolve(null).then(e).catch($y)}:_m;function $y(e){setTimeout(function(){throw e})}function Ta(e){return e==="head"}function Am(e,t){var a=t,s=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(s===0){e.removeChild(c),Wl(t);return}s--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")s++;else if(a==="html")Ki(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Ki(a);for(var o=a.firstChild;o;){var h=o.nextSibling,y=o.nodeName;o[oi]||y==="SCRIPT"||y==="STYLE"||y==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=h}}else a==="body"&&Ki(e.ownerDocument.body);a=c}while(a);Wl(t)}function Cm(e,t){var a=e;e=0;do{var s=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),s&&s.nodeType===8)if(a=s.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=s}while(a)}function Vu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Vu(a),Wr(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Ly(e,t,a,s){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[oi])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=bn(e.nextSibling),e===null)break}return null}function By(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=bn(e.nextSibling),e===null))return null;return e}function zm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=bn(e.nextSibling),e===null))return null;return e}function Xu(e){return e.data==="$?"||e.data==="$~"}function Iu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function qy(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var s=function(){t(),a.removeEventListener("DOMContentLoaded",s)};a.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function bn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Pu=null;function Em(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return bn(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function wm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Om(e,t,a){switch(t=dr(a),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function Ki(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Wr(e)}var jn=new Map,Tm=new Set;function fr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ca=F.d;F.d={f:Gy,r:Yy,D:Jy,C:Ky,L:Qy,m:Vy,X:Iy,S:Xy,M:Py};function Gy(){var e=ca.f(),t=ar();return e||t}function Yy(e){var t=yl(e);t!==null&&t.tag===5&&t.type==="form"?Vf(t):ca.r(e)}var Il=typeof document>"u"?null:document;function km(e,t,a){var s=Il;if(s&&typeof t=="string"&&t){var c=fn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),Tm.has(c)||(Tm.add(c),e={rel:e,crossOrigin:a,href:t},s.querySelector(c)===null&&(t=s.createElement("link"),Mt(t,"link",e),Et(t),s.head.appendChild(t)))}}function Jy(e){ca.D(e),km("dns-prefetch",e,null)}function Ky(e,t){ca.C(e,t),km("preconnect",e,t)}function Qy(e,t,a){ca.L(e,t,a);var s=Il;if(s&&e&&t){var c='link[rel="preload"][as="'+fn(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+fn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+fn(a.imageSizes)+'"]')):c+='[href="'+fn(e)+'"]';var o=c;switch(t){case"style":o=Pl(e);break;case"script":o=Fl(e)}jn.has(o)||(e=j({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),jn.set(o,e),s.querySelector(c)!==null||t==="style"&&s.querySelector(Qi(o))||t==="script"&&s.querySelector(Vi(o))||(t=s.createElement("link"),Mt(t,"link",e),Et(t),s.head.appendChild(t)))}}function Vy(e,t){ca.m(e,t);var a=Il;if(a&&e){var s=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+fn(s)+'"][href="'+fn(e)+'"]',o=c;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Fl(e)}if(!jn.has(o)&&(e=j({rel:"modulepreload",href:e},t),jn.set(o,e),a.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Vi(o)))return}s=a.createElement("link"),Mt(s,"link",e),Et(s),a.head.appendChild(s)}}}function Xy(e,t,a){ca.S(e,t,a);var s=Il;if(s&&e){var c=bl(s).hoistableStyles,o=Pl(e);t=t||"default";var h=c.get(o);if(!h){var y={loading:0,preload:null};if(h=s.querySelector(Qi(o)))y.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},a),(a=jn.get(o))&&Fu(e,a);var _=h=s.createElement("link");Et(_),Mt(_,"link",e),_._p=new Promise(function(T,H){_.onload=T,_.onerror=H}),_.addEventListener("load",function(){y.loading|=1}),_.addEventListener("error",function(){y.loading|=2}),y.loading|=4,hr(h,t,s)}h={type:"stylesheet",instance:h,count:1,state:y},c.set(o,h)}}}function Iy(e,t){ca.X(e,t);var a=Il;if(a&&e){var s=bl(a).hoistableScripts,c=Fl(e),o=s.get(c);o||(o=a.querySelector(Vi(c)),o||(e=j({src:e,async:!0},t),(t=jn.get(c))&&Wu(e,t),o=a.createElement("script"),Et(o),Mt(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},s.set(c,o))}}function Py(e,t){ca.M(e,t);var a=Il;if(a&&e){var s=bl(a).hoistableScripts,c=Fl(e),o=s.get(c);o||(o=a.querySelector(Vi(c)),o||(e=j({src:e,async:!0,type:"module"},t),(t=jn.get(c))&&Wu(e,t),o=a.createElement("script"),Et(o),Mt(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},s.set(c,o))}}function Rm(e,t,a,s){var c=(c=xe.current)?fr(c):null;if(!c)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Pl(a.href),a=bl(c).hoistableStyles,s=a.get(t),s||(s={type:"style",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Pl(a.href);var o=bl(c).hoistableStyles,h=o.get(e);if(h||(c=c.ownerDocument||c,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,h),(o=c.querySelector(Qi(e)))&&!o._p&&(h.instance=o,h.state.loading=5),jn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},jn.set(e,a),o||Fy(c,e,a,h.state))),t&&s===null)throw Error(u(528,""));return h}if(t&&s!==null)throw Error(u(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Fl(a),a=bl(c).hoistableScripts,s=a.get(t),s||(s={type:"script",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Pl(e){return'href="'+fn(e)+'"'}function Qi(e){return'link[rel="stylesheet"]['+e+"]"}function Mm(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function Fy(e,t,a,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Mt(t,"link",a),Et(t),e.head.appendChild(t))}function Fl(e){return'[src="'+fn(e)+'"]'}function Vi(e){return"script[async]"+e}function Dm(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+fn(a.href)+'"]');if(s)return t.instance=s,Et(s),s;var c=j({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Et(s),Mt(s,"style",c),hr(s,a.precedence,e),t.instance=s;case"stylesheet":c=Pl(a.href);var o=e.querySelector(Qi(c));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;s=Mm(a),(c=jn.get(c))&&Fu(s,c),o=(e.ownerDocument||e).createElement("link"),Et(o);var h=o;return h._p=new Promise(function(y,_){h.onload=y,h.onerror=_}),Mt(o,"link",s),t.state.loading|=4,hr(o,a.precedence,e),t.instance=o;case"script":return o=Fl(a.src),(c=e.querySelector(Vi(o)))?(t.instance=c,Et(c),c):(s=a,(c=jn.get(o))&&(s=j({},a),Wu(s,c)),e=e.ownerDocument||e,c=e.createElement("script"),Et(c),Mt(c,"link",s),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,hr(s,a.precedence,e));return t.instance}function hr(e,t,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=s.length?s[s.length-1]:null,o=c,h=0;h<s.length;h++){var y=s[h];if(y.dataset.precedence===t)o=y;else if(o!==c)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Fu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Wu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var mr=null;function Um(e,t,a){if(mr===null){var s=new Map,c=mr=new Map;c.set(a,s)}else c=mr,s=c.get(a),s||(s=new Map,c.set(a,s));if(s.has(e))return s;for(s.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var o=a[c];if(!(o[oi]||o[Ot]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var h=o.getAttribute(t)||"";h=e+h;var y=s.get(h);y?y.push(o):s.set(h,[o])}}return s}function Zm(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Wy(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Hm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function eb(e,t,a,s){if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=Pl(s.href),o=t.querySelector(Qi(c));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=pr.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=o,Et(o);return}o=t.ownerDocument||t,s=Mm(s),(c=jn.get(c))&&Fu(s,c),o=o.createElement("link"),Et(o);var h=o;h._p=new Promise(function(y,_){h.onload=y,h.onerror=_}),Mt(o,"link",s),a.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=pr.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var eo=0;function tb(e,t){return e.stylesheets&&e.count===0&&gr(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var s=setTimeout(function(){if(e.stylesheets&&gr(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&eo===0&&(eo=62500*Dy());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&gr(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>eo?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(c)}}:null}function pr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var vr=null;function gr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,vr=new Map,t.forEach(nb,e),vr=null,pr.call(e))}function nb(e,t){if(!(t.state.loading&4)){var a=vr.get(e);if(a)var s=a.get(null);else{a=new Map,vr.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<c.length;o++){var h=c[o];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(a.set(h.dataset.precedence,h),s=h)}s&&a.set(null,s)}c=t.instance,h=c.getAttribute("data-precedence"),o=a.get(h)||s,o===s&&a.set(null,c),a.set(h,c),this.count++,s=pr.bind(this),c.addEventListener("load",s),c.addEventListener("error",s),o?o.parentNode.insertBefore(c,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var Xi={$$typeof:X,Provider:null,Consumer:null,_currentValue:fe,_currentValue2:fe,_threadCount:0};function ab(e,t,a,s,c,o,h,y,_){this.tag=1,this.containerInfo=e,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=ui(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ui(0),this.hiddenUpdates=ui(null),this.identifierPrefix=s,this.onUncaughtError=c,this.onCaughtError=o,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.incompleteTransitions=new Map}function $m(e,t,a,s,c,o,h,y,_,T,H,G){return e=new ab(e,t,a,h,_,T,H,G,y),t=1,o===!0&&(t|=24),o=tn(3,null,null,t),e.current=o,o.stateNode=e,t=Rc(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:s,isDehydrated:a,cache:t},Zc(o),e}function Lm(e){return e?(e=wl,e):wl}function Bm(e,t,a,s,c,o){c=Lm(c),s.context===null?s.context=c:s.pendingContext=c,s=ja(t),s.payload={element:a},o=o===void 0?null:o,o!==null&&(s.callback=o),a=xa(e,s,t),a!==null&&(Pt(a,e,t),zi(a,e,t))}function qm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function to(e,t){qm(e,t),(e=e.alternate)&&qm(e,t)}function Gm(e){if(e.tag===13||e.tag===31){var t=Wa(e,67108864);t!==null&&Pt(t,e,67108864),to(e,67108864)}}function Ym(e){if(e.tag===13||e.tag===31){var t=rn();t=Ir(t);var a=Wa(e,t);a!==null&&Pt(a,e,t),to(e,t)}}var yr=!0;function lb(e,t,a,s){var c=Z.T;Z.T=null;var o=F.p;try{F.p=2,no(e,t,a,s)}finally{F.p=o,Z.T=c}}function ib(e,t,a,s){var c=Z.T;Z.T=null;var o=F.p;try{F.p=8,no(e,t,a,s)}finally{F.p=o,Z.T=c}}function no(e,t,a,s){if(yr){var c=ao(s);if(c===null)qu(e,t,s,br,a),Km(e,s);else if(rb(c,e,t,a,s))s.stopPropagation();else if(Km(e,s),t&4&&-1<sb.indexOf(e)){for(;c!==null;){var o=yl(c);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var h=Zt(o.pendingLanes);if(h!==0){var y=o;for(y.pendingLanes|=2,y.entangledLanes|=2;h;){var _=1<<31-Bt(h);y.entanglements[1]|=_,h&=~_}Ln(o),(Be&6)===0&&(tr=ne()+500,Gi(0))}}break;case 31:case 13:y=Wa(o,2),y!==null&&Pt(y,o,2),ar(),to(o,2)}if(o=ao(s),o===null&&qu(e,t,s,br,a),o===c)break;c=o}c!==null&&s.stopPropagation()}else qu(e,t,s,null,a)}}function ao(e){return e=ic(e),lo(e)}var br=null;function lo(e){if(br=null,e=gl(e),e!==null){var t=f(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===31){if(e=p(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return br=e,null}function Jm(e){switch(e){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(Ze()){case Ce:return 2;case nt:return 8;case mt:case fa:return 32;case Ka:return 268435456;default:return 32}default:return 32}}var io=!1,ka=null,Ra=null,Ma=null,Ii=new Map,Pi=new Map,Da=[],sb="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 Km(e,t){switch(e){case"focusin":case"focusout":ka=null;break;case"dragenter":case"dragleave":Ra=null;break;case"mouseover":case"mouseout":Ma=null;break;case"pointerover":case"pointerout":Ii.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pi.delete(t.pointerId)}}function Fi(e,t,a,s,c,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:a,eventSystemFlags:s,nativeEvent:o,targetContainers:[c]},t!==null&&(t=yl(t),t!==null&&Gm(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function rb(e,t,a,s,c){switch(t){case"focusin":return ka=Fi(ka,e,t,a,s,c),!0;case"dragenter":return Ra=Fi(Ra,e,t,a,s,c),!0;case"mouseover":return Ma=Fi(Ma,e,t,a,s,c),!0;case"pointerover":var o=c.pointerId;return Ii.set(o,Fi(Ii.get(o)||null,e,t,a,s,c)),!0;case"gotpointercapture":return o=c.pointerId,Pi.set(o,Fi(Pi.get(o)||null,e,t,a,s,c)),!0}return!1}function Qm(e){var t=gl(e.target);if(t!==null){var a=f(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,sd(e.priority,function(){Ym(a)});return}}else if(t===31){if(t=p(a),t!==null){e.blockedOn=t,sd(e.priority,function(){Ym(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=ao(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);lc=s,a.target.dispatchEvent(s),lc=null}else return t=yl(a),t!==null&&Gm(t),e.blockedOn=a,!1;t.shift()}return!0}function Vm(e,t,a){jr(e)&&a.delete(t)}function cb(){io=!1,ka!==null&&jr(ka)&&(ka=null),Ra!==null&&jr(Ra)&&(Ra=null),Ma!==null&&jr(Ma)&&(Ma=null),Ii.forEach(Vm),Pi.forEach(Vm)}function xr(e,t){e.blockedOn===t&&(e.blockedOn=null,io||(io=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,cb)))}var Sr=null;function Xm(e){Sr!==e&&(Sr=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Sr===e&&(Sr=null);for(var t=0;t<e.length;t+=3){var a=e[t],s=e[t+1],c=e[t+2];if(typeof s!="function"){if(lo(s||a)===null)continue;break}var o=yl(a);o!==null&&(e.splice(t,3),t-=3,au(o,{pending:!0,data:c,method:a.method,action:s},s,c))}}))}function Wl(e){function t(_){return xr(_,e)}ka!==null&&xr(ka,e),Ra!==null&&xr(Ra,e),Ma!==null&&xr(Ma,e),Ii.forEach(t),Pi.forEach(t);for(var a=0;a<Da.length;a++){var s=Da[a];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Da.length&&(a=Da[0],a.blockedOn===null);)Qm(a),a.blockedOn===null&&Da.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var c=a[s],o=a[s+1],h=c[Jt]||null;if(typeof o=="function")h||Xm(a);else if(h){var y=null;if(o&&o.hasAttribute("formAction")){if(c=o,h=o[Jt]||null)y=h.formAction;else if(lo(c)!==null)continue}else y=h.action;typeof y=="function"?a[s+1]=y:(a.splice(s,3),s-=3),Xm(a)}}}function Im(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(h){return c=h})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),s||setTimeout(a,20)}function a(){if(!s&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function so(e){this._internalRoot=e}_r.prototype.render=so.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var a=t.current,s=rn();Bm(a,s,e,t,null,null)},_r.prototype.unmount=so.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Bm(e.current,2,null,e,null,null),ar(),t[vl]=null}};function _r(e){this._internalRoot=e}_r.prototype.unstable_scheduleHydration=function(e){if(e){var t=id();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Da.length&&t!==0&&t<Da[a].priority;a++);Da.splice(a,0,e),a===0&&Qm(e)}};var Pm=l.version;if(Pm!=="19.2.7")throw Error(u(527,Pm,"19.2.7"));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=g(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var ub={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nr.isDisabled&&Nr.supportsFiber)try{Qa=Nr.inject(ub),Lt=Nr}catch{}}return es.createRoot=function(e,t){if(!d(e))throw Error(u(299));var a=!1,s="",c=lh,o=ih,h=sh;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=$m(e,1,!1,null,null,a,s,null,c,o,h,Im),e[vl]=t.current,Bu(e),new so(t)},es.hydrateRoot=function(e,t,a){if(!d(e))throw Error(u(299));var s=!1,c="",o=lh,h=ih,y=sh,_=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(h=a.onCaughtError),a.onRecoverableError!==void 0&&(y=a.onRecoverableError),a.formState!==void 0&&(_=a.formState)),t=$m(e,1,!0,t,a??null,s,c,_,o,h,y,Im),t.context=Lm(null),a=t.current,s=rn(),s=Ir(s),c=ja(s),c.callback=null,xa(a,c,s),a=s,t.current.lanes=a,Va(t,a),Ln(t),e[vl]=t.current,Bu(e),new _r(t)},es.version="19.2.7",es}var rp;function jb(){if(rp)return uo.exports;rp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),uo.exports=bb(),uo.exports}var xb=jb();const Sb=Wp(xb);function No(n){const l=Object.values(n).filter(u=>typeof u=="number");return Object.entries(n).filter(([u,d])=>l.indexOf(+u)===-1).map(([u,d])=>d)}function cp(n,l="|"){return n.map(r=>iv(r)).join(l)}function Ao(n,l){return typeof l=="bigint"?l.toString():l}class _b{constructor(l){this._getter=l,this._value=void 0}get value(){const l=this._getter;return l!==void 0&&(this._value=l(),this._getter=void 0),this._value}}function Lo(n){return new _b(n)}function Nb(n){return n==null}function Bo(n){const l=n.startsWith("^")?1:0,r=n.endsWith("$")?n.length-1:n.length;return n.slice(l,r)}function Ab(n,l){const r=n/l,u=Math.round(r),d=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-u)<d?0:r-u}function Ba(n,l,r){Object.defineProperty(n,l,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ev(n){const l=Object.getOwnPropertyDescriptor(n,"shape");return l?.get?l.get.raw:l?.value}function da(n){return ev(n._zod.def)??n._zod.def.shape}function tv(n,l,r){Object.defineProperty(n,l,{get(){const u=r();return Ba(this,l,u),u},enumerable:!0,configurable:!0})}function nv(n,l,r){l in n?Ba(n,l,r):n[l]=r}function pl(n,l,r,u){const d=da(l);for(const f of r){const m=Object.getOwnPropertyDescriptor(d,f);m.enumerable&&(m.get?tv(n,f,()=>{const p=l._zod.def.shape[f];return u?u(p,f):p}):nv(n,f,u?u(m.value,f):m.value))}}function Cb(n,l){for(const r of Reflect.ownKeys(l)){const u=Object.getOwnPropertyDescriptor(l,r);u.enumerable&&(u.get?tv(n,r,()=>l[r]):nv(n,r,u.value))}}function cn(...n){const l={};for(const r of n){const u=Object.getOwnPropertyDescriptors(r);Object.assign(l,u)}return Object.defineProperties({},l)}function zb(n){return JSON.stringify(n)}function Eb(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const av="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function kr(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const wb=Lo(()=>{if(Tn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const n=Function;return new n(""),!0}catch{return!1}});function ai(n){if(kr(n)===!1)return!1;const l=n.constructor;if(l===void 0||typeof l!="function")return!0;const r=l.prototype;return!(kr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function lv(n){return ai(n)?{...n}:Array.isArray(n)?[...n]:n instanceof Map?new Map(n):n instanceof Set?new Set(n):n}const Ob=new Set(["string","number","symbol"]);function Lr(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qa(n,l,r){const u=new n._zod.constr(l??n._zod.def);return(!l||r?.parent)&&(u._zod.parent=n),u}function ge(n){const l=n;if(!l)return{};if(typeof l=="string")return{error:()=>l};if(l?.message!==void 0){if(l?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");l.error=l.message}return delete l.message,typeof l.error=="string"?{...l,error:()=>l.error}:l}function iv(n){return typeof n=="bigint"?n.toString()+"n":typeof n=="string"?`"${n}"`:`${n}`}function Tb(n){return Object.keys(n).filter(l=>n[l]._zod.optin!==void 0&&n[l]._zod.optout==="optional")}const sv={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},kb={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Rb(n,l){const r=n._zod.def,u=r.checks;if(u&&u.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const f={};return pl(f,n,Br(n,l)),qa(n,cn(r,{shape:f,checks:[]}))}function Br(n,l){const r=da(n),u=[];for(const d of Reflect.ownKeys(l)){if(!Object.getOwnPropertyDescriptor(r,d)?.enumerable)throw new Error(`Unrecognized key: "${String(d)}"`);l[d]&&u.push(d)}return u}function Mb(n,l){const r=n._zod.def,u=r.checks;if(u&&u.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const f=new Set(Br(n,l)),m={};return pl(m,n,Reflect.ownKeys(da(n)).filter(p=>!f.has(p))),qa(n,cn(r,{shape:m,checks:[]}))}function Db(n,l){if(!ai(l))throw new Error("Invalid input to extend: expected a plain object");const r=n._zod.def.checks;if(r&&r.length>0){const d=da(n);for(const f of Reflect.ownKeys(l))if(Object.getOwnPropertyDescriptor(d,f)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return qa(n,cn(n._zod.def,{shape:rv(n,l)}))}function rv(n,l){const r={};return pl(r,n,Reflect.ownKeys(da(n))),Cb(r,l),r}function Ub(n,l){if(!ai(l))throw new Error("Invalid input to safeExtend: expected a plain object");return qa(n,cn(n._zod.def,{shape:rv(n,l)}))}function Zb(n,l){if(!l?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(n._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r={};pl(r,n,Reflect.ownKeys(da(n))),pl(r,l,Reflect.ownKeys(da(l)));const u=cn(n._zod.def,{shape:r,get catchall(){return l._zod.def.catchall},checks:l._zod.def.checks??[]});return qa(n,u)}function up(n,l,r,u="partial"){const f=l._zod.def.checks;if(f&&f.length>0)throw new Error(`.${u}() cannot be used on object schemas containing refinements`);const p=r?new Set(Br(l,r)):void 0,v={};return pl(v,l,Reflect.ownKeys(da(l)),n&&((g,b)=>p&&!p.has(b)?g:new n({type:"optional",innerType:g}))),qa(l,cn(l._zod.def,{shape:v,checks:[]}))}function Hb(n,l,r){const u=r?new Set(Br(l,r)):void 0,d={};return pl(d,l,Reflect.ownKeys(da(l)),(f,m)=>u&&!u.has(m)?f:new n({type:"nonoptional",innerType:f})),qa(l,cn(l._zod.def,{shape:d}))}function oa(n,l=0){if(n.aborted===!0)return!0;for(let r=l;r<n.issues.length;r++)if(n.issues[r]?.continue!==!0)return!0;return!1}function $b(n,l=0){if(n.aborted===!0)return!0;for(let r=l;r<n.issues.length;r++)if(n.issues[r]?.continue===!1)return!0;return!1}function ti(n,l){return l.map(r=>{var u;return(u=r).path??(u.path=[]),r.path.unshift(n),r})}function ts(n){return typeof n=="string"?n:n?.message}function op(n){const l=[];for(const r of n??[]){const u=r._zod.def;if(!/_(length|size)$|_equals$/.test(u.check))break;const d=u.maximum??u.length??u.size;d>=0&&l.push([d,r])}return l}function Co(n,l,r){var u;for(let d=l;d<n.length;d++)(u=n[d]).schema??(u.schema=r)}function $a(n,l,r){var u;const d=n.inst?._zod?.traits;d?.has("$ZodType")&&(d.has("$ZodCheck")?(u=n).schema??(u.schema=n.inst):n.schema=n.inst);const f=n.schema!==n.inst?n.schema?._zod.def?.error:void 0,m=n.message?n.message:ts(n.inst?._zod.def?.error?.(n))??ts(f?.(n))??ts(l?.error?.(n))??ts(r.customError?.(n))??ts(r.localeError?.(n))??"Invalid input",p={};for(const v of Object.keys(n))v==="inst"||v==="schema"||v==="continue"||v==="input"||v==="__proto__"||(p[v]=n[v]);return p.path??(p.path=[]),p.message=m,l?.reportInput&&(p.input=n.input),p}const Lb=/[\uD800-\uDBFF]/;function qo(n){const l=n.length;if(!Lb.test(n))return l;let r=l;for(let u=0;u<l-1;u++)(n.charCodeAt(u)&64512)===55296&&(n.charCodeAt(u+1)&64512)===56320&&(r--,u++);return r}function Go(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function Bb(n){const l=typeof n;switch(l){case"number":return Number.isNaN(n)?"nan":"number";case"object":{if(n===null)return"null";if(Array.isArray(n))return"array";const r=n;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return l}function rs(...n){const[l,r,u]=n;return typeof l=="string"?{message:l,code:"custom",input:r,inst:u}:{...l}}function qb(n,l){for(const r in l){const u=Object.getOwnPropertyDescriptor(l,r);u.get?Object.defineProperty(n,r,{...u,enumerable:!1}):Gb(n,r,u.value)}}function La(n,l,r,u=!0){return Object.defineProperty(n,l,{configurable:!0,writable:!0,enumerable:u,value:r}),r}function cv(n,l,r){return La(n,l,r,!1)}function uv(n,l){for(const r in n){const u=n[r];Object.defineProperty(l,r,{configurable:!0,enumerable:!0,get(){return La(this,r,u(this))},set(d){La(this,r,d)}})}return l}function Gb(n,l,r){Object.defineProperty(n,l,{configurable:!0,get(){return this==null?r:La(this,l,r.bind(this))},set(u){La(this,l,u)}})}function Yb(n,l){const r=Object.getPrototypeOf(n);return l in r?void 0:r}let mo,Za=!1;const Jb={configurable:!0,get(){Za=!0}};function Qe(n,l,r){const u=Object.getPrototypeOf(n._zod);if(l in u&&mo!==n._zod){mo=void 0;return}mo=n._zod,Object.defineProperty(u,l,{configurable:!0,get(){Object.defineProperty(this,l,Jb);const d=Za;Za=!1;try{const f=r(this);return Za?delete this[l]:Object.defineProperty(this,l,{configurable:!0,writable:!0,value:f}),Za=Za||d,f}catch(f){throw delete this[l],Za=Za||d,f}},set(d){Object.defineProperty(this,l,{configurable:!0,writable:!0,value:d})}})}function Kb(n,l,r,u){const d=Yb(n,l);d&&Object.defineProperty(d,l,{configurable:!0,get(){const f={configurable:!0,writable:!0,enumerable:u,value:void 0};return Object.defineProperty(this,l,f),f.value=r(this),Object.defineProperty(this,l,f),f.value},set(f){Object.defineProperty(this,l,{configurable:!0,writable:!0,enumerable:u,value:f})}})}const Qb="~constantCatch";function Vb(n){const l=()=>n;return l[Qb]=!0,l}var dp;const po={value:void 0,enumerable:!1};let fp="captureStackTrace"in Error?Error:null;function Xb(n){const l=fp;if(l){const r=l.stackTraceLimit;if(typeof r=="number"){try{l.stackTraceLimit=0}catch{return fp=null,new n}try{return new n}finally{l.stackTraceLimit=r}}}return new n}function q(n,l,r,u){const d={};function f(C){this.def=C,this.constr=j,this.traits=new Set}f.prototype=d;const m=r,p=m&&new WeakSet;function v(C,z){if(C._zod){if(C._zod.traits.has(n))return}else{po.value=new f(z);try{Object.defineProperty(C,"_zod",po)}finally{po.value=void 0}}if(C._zod.traits.add(n),l(C,z),p){const K=Object.getPrototypeOf(C),J=C._zod.constr.prototype;let I=K;for(;I&&I!==J;)I=Object.getPrototypeOf(I);const ie=I??K;p.has(ie)||(p.add(ie),qb(ie,m))}const M=j.prototype;for(const K in M)Object.prototype.hasOwnProperty.call(M,K)&&(K in C||(C[K]=M[K].bind(C)))}const g=u?.Parent??Object;class b extends g{}Object.defineProperty(b,"name",{value:n});function j(C){const z=u?.Parent?Xb(b):this;v(z,C);const M=z._zod.deferred;if(M){for(const J of M)J();z._zod.deferred=void 0}const K=globalThis.__zod_globalConfig?.postProcessor;return K&&K(z),z}return Object.defineProperty(j,"init",{value:v}),Object.defineProperty(j,Symbol.hasInstance,{value:C=>u?.Parent&&C instanceof u.Parent?!0:C?._zod?.traits?.has(n)}),Object.defineProperty(j,"name",{value:n}),j}class ml extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ov extends Error{constructor(l){super(`Encountered unidirectional transform during encode: ${l}`),this.name="ZodEncodeError"}}(dp=globalThis).__zod_globalConfig??(dp.__zod_globalConfig={});const Tn=globalThis.__zod_globalConfig;function Gn(n){return n&&Object.assign(Tn,n),Tn}function Ib(){const n=this._zod;return n.message??(n.message=JSON.stringify(n.def,Ao,2)),n.message}function Pb(n){this._zod.message=n}const Fb={get:Ib,set:Pb,enumerable:!0,configurable:!0},vo={value:void 0,enumerable:!1},hp=new WeakSet([Object.prototype,Error.prototype]),Wb=(n,l)=>{n.name="$ZodError",vo.value=l,Object.defineProperty(n,"issues",vo),vo.value=void 0,Object.defineProperty(n,"message",Fb);const r=Object.getPrototypeOf(n);hp.has(r)||(hp.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){const u=()=>this.message;return Object.defineProperty(this,"toString",{value:u,configurable:!0,writable:!0}),u},set(u){Object.defineProperty(this,"toString",{value:u,configurable:!0,writable:!0})}}))},ej=q("$ZodError",Wb);function tj(n,l,r){return Object.prototype.hasOwnProperty.call(n,l)||(l==="__proto__"?Object.defineProperty(n,l,{value:r(),writable:!0,enumerable:!0,configurable:!0}):n[l]=r()),n[l]}function nj(n,l=r=>r.message){const r={},u=[];for(const d of n.issues)d.path.length>0?tj(r,d.path[0],()=>[]).push(l(d)):u.push(l(d));return{formErrors:u,fieldErrors:r}}function aj(n,l=r=>r.message){const r={_errors:[]},u=(d,f=[])=>{for(const m of d.issues)if(m.code==="invalid_union"&&m.errors.length)m.errors.map(p=>u({issues:p},[...f,...m.path]));else if(m.code==="invalid_key")u({issues:m.issues},[...f,...m.path]);else if(m.code==="invalid_element")u({issues:m.issues},[...f,...m.path]);else{const p=[...f,...m.path];if(p.length===0)r._errors.push(l(m));else{let v=r,g=0;for(;g<p.length;){const b=p[g],j=g===p.length-1;if(b==="_errors"){j&&v._errors.push(l(m)),g++;continue}Object.prototype.hasOwnProperty.call(v,b)||Object.defineProperty(v,b,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const C=v[b];j&&C._errors.push(l(m)),v=C,g++}}}};return u(n),r}function qr(n,l){return{callee:l?.callee??n,Err:l?.Err}}const Yo=n=>{const l=(r,u,d,f)=>{const m=d?{...d,async:!1}:{async:!1},p=r._zod.run({value:u,issues:[]},m);if(p instanceof Promise)throw new ml;if(p.issues.length){const v=new(f?.Err??n)(p.issues.map(g=>$a(g,m,Gn())));throw av(v,f?.callee??l),v}return p.value};return l},Jo=n=>{const l=async(r,u,d,f)=>{const m=d?{...d,async:!0}:{async:!0};let p=r._zod.run({value:u,issues:[]},m);if(p instanceof Promise&&(p=await p),p.issues.length){const v=new(f?.Err??n)(p.issues.map(g=>$a(g,m,Gn())));throw av(v,f?.callee??l),v}return p.value};return l},Ko=n=>(l,r,u)=>{const d=u?{...u,async:!1}:{async:!1},f=l._zod.run({value:r,issues:[]},d);if(f instanceof Promise)throw new ml;return f.issues.length?dv(n,f.issues,d):{success:!0,data:f.value}};function dv(n,l,r){let u;return{success:!1,get error(){return u||(u=new n(l.map(d=>$a(d,r,Gn()))),l=void 0,r=void 0),u},set error(d){u=d,l=void 0,r=void 0}}}const Qo=n=>async(l,r,u)=>{const d=u?{...u,async:!0}:{async:!0};let f=l._zod.run({value:r,issues:[]},d);return f instanceof Promise&&(f=await f),f.issues.length?dv(n,f.issues,d):{success:!0,data:f.value}},lj=Symbol.for("zod.compile.invalid"),ij=Symbol.for("zod.compile.fallback"),sj=((n,l,r)=>{const u=n._zod.bag.validator;if(u!==void 0){if(u(l)!==lj)return!0;if(u.definite===!0&&r===void 0)return!1}return rj(n,l,r)});function rj(n,l,r){const u=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},d=n._zod.bag.fallbackRun;let f;if(d?(u[ij]=!0,f=d({value:l,issues:[]},u)):f=n._zod.run({value:l,issues:[]},u),f instanceof Promise)throw new ml;return f.issues.length===0}const cj=async(n,l,r)=>{const u=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let d=n._zod.run({value:l,issues:[]},u);return d instanceof Promise&&(d=await d),d.issues.length===0},uj=n=>{const l=Yo(n),r=(u,d,f,m)=>{const p=f?{...f,direction:"backward"}:{direction:"backward"};return l(u,d,p,qr(r,m))};return r},oj=n=>{const l=Yo(n),r=(u,d,f,m)=>l(u,d,f,qr(r,m));return r},dj=n=>{const l=Jo(n),r=async(u,d,f,m)=>{const p=f?{...f,direction:"backward"}:{direction:"backward"};return await l(u,d,p,qr(r,m))};return r},fj=n=>{const l=Jo(n),r=async(u,d,f,m)=>await l(u,d,f,qr(r,m));return r},hj=n=>(l,r,u)=>{const d=u?{...u,direction:"backward"}:{direction:"backward"};return Ko(n)(l,r,d)},mj=n=>(l,r,u)=>Ko(n)(l,r,u),pj=n=>async(l,r,u)=>{const d=u?{...u,direction:"backward"}:{direction:"backward"};return Qo(n)(l,r,d)},vj=n=>async(l,r,u)=>Qo(n)(l,r,u),gj=/^[cC][0-9a-z]{6,}$/,yj=/^[0-9a-z]+$/,bj=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,jj=/^[0-9a-vA-V]{20}$/,xj=/^[A-Za-z0-9]{27}$/,Sj=/^[a-zA-Z0-9_-]{21}$/;function _j(n){return new RegExp(`^[a-zA-Z0-9_-]{${n}}$`)}const Nj=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Aj=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,mp=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Cj=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,zj="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Ej(){return new RegExp(zj,"u")}const wj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Oj=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Tj=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,kj=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Rj=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Mj=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Dj=/^https?$/,Uj=/^\+[1-9]\d{6,14}$/,fv="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function Zj(n){return new RegExp(`^${n}$`)}const Hj=Zj(fv);function zo(n){const l="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${l}`:n.precision===0?`${l}:[0-5]\\d`:`${l}:[0-5]\\d\\.\\d{${n.precision}}`:n.seconds?`${l}:[0-5]\\d(?:\\.\\d+)?`:`${l}(?::[0-5]\\d(?:\\.\\d+)?)?`}function $j(n){return new RegExp(`^${zo(n)}$`)}function Lj(n){const l=["Z"];n.offset&&l.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${zo({precision:n.precision,seconds:!0})}(?:${l.join("|")})`,u=n.local?`${r}|${zo({precision:n.precision})}`:r;return new RegExp(`^${fv}T(?:${u})$`)}const Bj=/^[\s\S]{0,}$/,qj=/^-?\d+$/,Vo=/^-?\d+(?:\.\d+)?$/,Gj=/^(?:true|false)$/i,Yj=/^[^A-Z]*$/,Jj=/^[^a-z]*$/,Wt=q("$ZodCheck",(n,l)=>{var r;n._zod??(n._zod={}),n._zod.def=l,(r=n._zod).onattach??(r.onattach=[])}),Xo=n=>{const l=n.value;return!Nb(l)&&l.length!==void 0},Rr={number:"number",bigint:"bigint",object:"date"},hv=q("$ZodCheckLessThan",(n,l)=>{Wt.init(n,l);const r=Rr[typeof l.value];n._zod.check=u=>{(l.inclusive?u.value<=l.value:u.value<l.value)||u.issues.push({origin:Rr[typeof u.value]??r,code:"too_big",maximum:typeof l.value=="object"?l.value.getTime():l.value,input:u.value,inclusive:l.inclusive,inst:n,continue:!l.abort})}}),mv=q("$ZodCheckGreaterThan",(n,l)=>{Wt.init(n,l);const r=Rr[typeof l.value];n._zod.check=u=>{(l.inclusive?u.value>=l.value:u.value>l.value)||u.issues.push({origin:Rr[typeof u.value]??r,code:"too_small",minimum:typeof l.value=="object"?l.value.getTime():l.value,input:u.value,inclusive:l.inclusive,inst:n,continue:!l.abort})}}),Kj=q("$ZodCheckMultipleOf",(n,l)=>{Wt.init(n,l),n._zod.check=r=>{if(typeof r.value!=typeof l.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?l.value!==BigInt(0)&&r.value%l.value===BigInt(0):Ab(r.value,l.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:l.value,input:r.value,inst:n,continue:!l.abort})}}),Qj=q("$ZodCheckNumberFormat",(n,l)=>{Wt.init(n,l),l.format=l.format||"float64";const r=l.format?.includes("int"),u=r?"int":"number",[d,f]=sv[l.format];n._zod.check=m=>{const p=m.value;if(r){if(!Number.isInteger(p)){m.issues.push({expected:u,format:l.format,code:"invalid_type",continue:!1,input:p,inst:n});return}if(!Number.isSafeInteger(p)){p>0?m.issues.push({input:p,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:u,inclusive:!0,continue:!l.abort}):m.issues.push({input:p,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:u,inclusive:!0,continue:!l.abort});return}}p<d&&m.issues.push({origin:"number",input:p,code:"too_small",minimum:d,inclusive:!0,inst:n,continue:!l.abort}),p>f&&m.issues.push({origin:"number",input:p,code:"too_big",maximum:f,inclusive:!0,inst:n,continue:!l.abort})}}),Vj=q("$ZodCheckMaxLength",(n,l)=>{var r;Wt.init(n,l),(r=n._zod.def).when??(r.when=Xo),n._zod.check=u=>{const d=u.value,f=d.length;if((typeof d=="string"&&f>l.maximum?qo(d):f)<=l.maximum)return;const p=Go(d);u.issues.push({origin:p,code:"too_big",maximum:l.maximum,inclusive:!0,input:d,inst:n,continue:!l.abort})}}),Xj=q("$ZodCheckMinLength",(n,l)=>{var r;Wt.init(n,l),(r=n._zod.def).when??(r.when=Xo),n._zod.check=u=>{const d=u.value,f=d.length;if((typeof d=="string"&&f>=l.minimum&&f<l.minimum*2?qo(d):f)>=l.minimum)return;const p=Go(d);u.issues.push({origin:p,code:"too_small",minimum:l.minimum,inclusive:!0,input:d,inst:n,continue:!l.abort})}}),Ij=q("$ZodCheckLengthEquals",(n,l)=>{var r;Wt.init(n,l),(r=n._zod.def).when??(r.when=Xo),n._zod.check=u=>{const d=u.value,f=d.length,m=typeof d=="string"&&f>=l.length&&f<=l.length*2?qo(d):f;if(m===l.length)return;const p=Go(d),v=m>l.length;u.issues.push({origin:p,...v?{code:"too_big",maximum:l.length}:{code:"too_small",minimum:l.length},inclusive:!0,exact:!0,input:u.value,inst:n,continue:!l.abort})}}),Gr=q("$ZodCheckStringFormat",(n,l)=>{var r,u;Wt.init(n,l),l.pattern?(r=n._zod).check??(r.check=d=>{l.pattern.lastIndex=0,!l.pattern.test(d.value)&&d.issues.push({origin:"string",code:"invalid_format",format:l.format,input:d.value,...l.pattern?{pattern:l.pattern.toString()}:{},inst:n,continue:!l.abort})}):(u=n._zod).check??(u.check=()=>{})}),Pj=q("$ZodCheckRegex",(n,l)=>{Gr.init(n,l),n._zod.check=r=>{l.pattern.lastIndex=0,!l.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:l.pattern.toString(),inst:n,continue:!l.abort})}}),Fj=q("$ZodCheckLowerCase",(n,l)=>{l.pattern??(l.pattern=Yj),Gr.init(n,l)}),Wj=q("$ZodCheckUpperCase",(n,l)=>{l.pattern??(l.pattern=Jj),Gr.init(n,l)}),ex=q("$ZodCheckIncludes",(n,l)=>{Wt.init(n,l);const r=Lr(l.includes),u=new RegExp(typeof l.position=="number"?`^.{${l.position},}${r}`:r);l.pattern=u,n._zod.check=d=>{d.value.includes(l.includes,l.position)||d.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:l.includes,input:d.value,inst:n,continue:!l.abort})}}),tx=q("$ZodCheckStartsWith",(n,l)=>{Wt.init(n,l);const r=new RegExp(`^${Lr(l.prefix)}.*`);l.pattern??(l.pattern=r),n._zod.check=u=>{u.value.startsWith(l.prefix)||u.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:l.prefix,input:u.value,inst:n,continue:!l.abort})}}),nx=q("$ZodCheckEndsWith",(n,l)=>{Wt.init(n,l);const r=new RegExp(`.*${Lr(l.suffix)}$`);l.pattern??(l.pattern=r),n._zod.check=u=>{u.value.endsWith(l.suffix)||u.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:l.suffix,input:u.value,inst:n,continue:!l.abort})}}),ax=q("$ZodCheckOverwrite",(n,l)=>{Wt.init(n,l),n._zod.check=r=>{r.value=l.tx(r.value)}});class lx{constructor(l=[],r={}){this.content=[],this.indent=0,this.args=l,this.closed=r}indented(l){this.indent+=1;try{l(this)}finally{this.indent-=1}}write(l){if(typeof l=="function"){l(this,{execution:"sync"}),l(this,{execution:"async"});return}const u=l.split(`
10
10
  `).filter(m=>m),d=Math.min(...u.map(m=>m.length-m.trimStart().length)),f=u.map(m=>m.slice(d)).map(m=>" ".repeat(this.indent*2)+m);for(const m of f)this.content.push(m)}compile(){const l=Function,r=this?.content??[""];return new l(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
11
11
  ${r.join(`
12
12
  `)}
13
- };`)(...Object.values(this.closed))}}const ix={major:4,minor:6,patch:7},ft=q("$ZodType",(n,l)=>{var r;n??(n={}),n._zod.def=l,n._zod.bag=n._zod.bag||{},n._zod.version=ix;const u=n._zod.def.checks,d=n._zod.traits.has("$ZodCheck")?[n,...u??[]]:u?.length?[...u]:[];for(const f of d)for(const m of f._zod.onattach)m(n);if(d.length===0)(r=n._zod).deferred??(r.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{const f=(p,v,g)=>{if(p.memo)return p;let b=oa(p),j;for(const C of v){if(C._zod.def.when){if($b(p)||!C._zod.def.when(p))continue}else if(b)continue;const z=p.issues.length,M=C._zod.check(p);if(M instanceof Promise&&g?.async===!1)throw new ml;if(j||M instanceof Promise)j=(j??Promise.resolve()).then(async()=>{await M,p.issues.length!==z&&(Co(p.issues,z,n),b||(b=oa(p,z)))});else{if(p.issues.length===z)continue;Co(p.issues,z,n),b||(b=oa(p,z))}}return j?j.then(()=>p):p},m=(p,v,g)=>{if(oa(p))return p.aborted=!0,p;const b=f(v,d,g);if(b instanceof Promise){if(g.async===!1)throw new ml;return b.then(j=>n._zod.parse(j,g))}return n._zod.parse(b,g)};n._zod.run=(p,v)=>{if(v.skipChecks)return n._zod.parse(p,v);if(v.direction==="backward"){const b=n._zod.parse({value:p.value,issues:[]},{...v,skipChecks:!0});return b instanceof Promise?b.then(j=>m(j,p,v)):m(b,p,v)}const g=n._zod.parse(p,v);if(g instanceof Promise){if(v.async===!1)throw new ml;return g.then(b=>f(b,d,v))}return f(g,d,v)}}},{get"~standard"(){return cv(this,"~standard",vv(this))},set"~standard"(n){La(this,"~standard",n)}}),pv=(n,l)=>n.issues.length?{issues:n.issues.map(r=>$a(r,l,Gn()))}:{value:n.value};async function sx(n,l){const r={async:!0};return pv(await n._zod.run({value:l,issues:[]},r),r)}function vv(n){return{validate:l=>{const r={async:!1};try{const u=n._zod.run({value:l,issues:[]},r);if(!(u instanceof Promise))return pv(u,r)}catch{}return sx(n,l)},vendor:"zod",version:1}}const Io=q("$ZodString",(n,l)=>{ft.init(n,l),n._zod.pattern=l.pattern??Bj,n._zod.parse=(r,u)=>{if(l.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:n}),r}}),it=q("$ZodStringFormat",(n,l)=>{Gr.init(n,l),Io.init(n,l)}),rx=q("$ZodGUID",(n,l)=>{l.pattern??(l.pattern=Aj),it.init(n,l)}),cx=q("$ZodUUID",(n,l)=>{if(l.version){const u={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[l.version];if(u===void 0)throw new Error(`Invalid UUID version: "${l.version}"`);l.pattern??(l.pattern=mp(u))}else l.pattern??(l.pattern=mp());it.init(n,l)}),ux=q("$ZodEmail",(n,l)=>{l.pattern??(l.pattern=Cj),it.init(n,l)}),gv=1,Mr=2;function yv(n){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(n):(new URL(n),!0)}catch{return!1}}function ox(n,l){return!("normalize"in l)&&!("hostname"in l)&&!("protocol"in l)?yv(n)||Mr:dx(n,l)}function dx(n,l){if(!l.normalize&&l.protocol?.source===Dj.source&&!/^https?:\/\//i.test(n))return gv;try{if(typeof URL<"u"){const r=URL;if(typeof r.parse=="function")return r.parse(n)??Mr}return new URL(n)}catch{return Mr}}const fx=/[\t\n\r]/g;function pp(n){return n.replace(fx,"")}function hx(n,l){return l.lastIndex=0,l.test(n.hostname)}function mx(n,l){return l.lastIndex=0,l.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)}const px=q("$ZodURL",(n,l)=>{it.init(n,l),n._zod.check=r=>{try{const u=r.value.trim(),d=ox(u,l);if(d===gv){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:n,continue:!l.abort});return}if(d===Mr){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:n,continue:!l.abort});return}if(d===!0){r.value=pp(u);return}l.hostname&&!hx(d,l.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:l.hostname.source,input:r.value,inst:n,continue:!l.abort}),l.protocol&&!mx(d,l.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:l.protocol.source,input:r.value,inst:n,continue:!l.abort}),r.value=l.normalize?d.href:pp(u);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:n,continue:!l.abort})}}}),vx=q("$ZodEmoji",(n,l)=>{l.pattern??(l.pattern=Ej()),it.init(n,l)}),gx=q("$ZodNanoID",(n,l)=>{if(l.length!==void 0&&(!Number.isInteger(l.length)||l.length<1))throw new Error(`Invalid nanoid length: ${l.length}`);l.pattern??(l.pattern=l.length===void 0?Sj:_j(l.length)),it.init(n,l)}),yx=q("$ZodCUID",(n,l)=>{l.pattern??(l.pattern=gj),it.init(n,l)}),bx=q("$ZodCUID2",(n,l)=>{l.pattern??(l.pattern=yj),it.init(n,l)}),jx=q("$ZodULID",(n,l)=>{l.pattern??(l.pattern=bj),it.init(n,l)}),xx=q("$ZodXID",(n,l)=>{l.pattern??(l.pattern=jj),it.init(n,l)}),Sx=q("$ZodKSUID",(n,l)=>{l.pattern??(l.pattern=xj),it.init(n,l)}),_x=q("$ZodISODateTime",(n,l)=>{l.pattern??(l.pattern=Lj(l)),it.init(n,l)}),Nx=q("$ZodISODate",(n,l)=>{l.pattern??(l.pattern=Hj),it.init(n,l)}),Ax=q("$ZodISOTime",(n,l)=>{l.pattern??(l.pattern=$j(l)),it.init(n,l)}),Cx=q("$ZodISODuration",(n,l)=>{l.pattern??(l.pattern=Nj),it.init(n,l)}),zx=q("$ZodIPv4",(n,l)=>{l.pattern??(l.pattern=wj),it.init(n,l)}),Ex=/^[0-9a-fA-F:.]+$/;function bv(n){return Ex.test(n)?yv(`http://[${n}]`):!1}const wx=q("$ZodIPv6",(n,l)=>{l.pattern??(l.pattern=Oj),it.init(n,l),n._zod.check=r=>{bv(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:n,continue:!l.abort})}}),Ox=q("$ZodCIDRv4",(n,l)=>{l.pattern??(l.pattern=Tj),it.init(n,l)});function Tx(n){const l=n.split("/");if(l.length!==2)return!1;const[r,u]=l;if(!u)return!1;const d=Number(u);return`${d}`!==u||d<0||d>128?!1:bv(r)}const kx=q("$ZodCIDRv6",(n,l)=>{l.pattern??(l.pattern=kj),it.init(n,l),n._zod.check=r=>{Tx(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:n,continue:!l.abort})}});function jv(n){if(n==="")return!0;if(/\s/.test(n)||n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const xv=/^[0-9a-zA-Z+/]*={0,2}$/,Rx=q("$ZodBase64",(n,l)=>{l.pattern??(l.pattern=xv),it.init(n,l),n._zod.check=r=>{jv(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:n,continue:!l.abort})}}),Po=/^[A-Za-z0-9_-]*$/;function Mx(n){if(!Po.test(n))return!1;const l=n.replace(/[-_]/g,u=>u==="-"?"+":"/"),r=l.padEnd(Math.ceil(l.length/4)*4,"=");return jv(r)}const Dx=q("$ZodBase64URL",(n,l)=>{l.pattern??(l.pattern=Po),it.init(n,l),n._zod.check=r=>{Mx(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:n,continue:!l.abort})}}),Ux=q("$ZodE164",(n,l)=>{l.pattern??(l.pattern=Uj),it.init(n,l)});function Zx(n,l=null){try{const r=n.split(".");if(r.length!==3)return!1;const[u]=r;if(!u)return!1;const d=JSON.parse(atob(u));return!("typ"in d&&d?.typ!=="JWT"||!d.alg||l&&(!("alg"in d)||d.alg!==l))}catch{return!1}}const Hx=q("$ZodJWT",(n,l)=>{it.init(n,l),n._zod.check=r=>{Zx(r.value,l.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:n,continue:!l.abort})}}),Sv=q("$ZodNumber",(n,l)=>{ft.init(n,l),n._zod.pattern=Vo,n._zod.parse=(r,u)=>{if(l.coerce)try{r.value=Number(r.value)}catch{}const d=r.value;if(typeof d=="number"&&!Number.isNaN(d)&&Number.isFinite(d))return r;const f=typeof d=="number"?Number.isNaN(d)?"NaN":Number.isFinite(d)?void 0:String(d):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:d,inst:n,...f?{received:f}:{}}),r}}),$x=q("$ZodNumberFormat",(n,l)=>{Qj.init(n,l),Sv.init(n,l)}),Lx=q("$ZodBoolean",(n,l)=>{ft.init(n,l),n._zod.pattern=Gj,n._zod.parse=(r,u)=>{if(l.coerce)try{r.value=!!r.value}catch{}const d=r.value;return typeof d=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:d,inst:n}),r}}),Bx=q("$ZodUnknown",(n,l)=>{ft.init(n,l),n._zod.parse=r=>r}),qx=q("$ZodNever",(n,l)=>{ft.init(n,l),n._zod.parse=(r,u)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:n}),r)});function Gx(n,l){const r=op(n._zod.def.checks);if(!r.length)return;const u=Math.min(...r.map(f=>f[0])),d=n._zod.parse;n._zod.parse=(f,m)=>{const p=l(f.value);if(p>u&&!m?.skipChecks&&m?.direction!=="backward"){for(const[v,g]of op(n._zod.def.checks))if(p>v&&g._zod.def.when(f)){const b=f.issues.length;return g._zod.check(f),f.issues[b].continue=!1,Co(f.issues,b,n),f}}return d(f,m)}}const Yx=n=>Array.isArray(n)?n.length:-1;function vp(n,l,r){n.issues.length&&l.issues.push(...ti(r,n.issues)),l.value[r]=n.value}const Jx=q("$ZodArray",(n,l)=>{ft.init(n,l);const r=Tn.memoizer;r?.attach(n),n._zod.parse=(u,d)=>{const f=u.value;if(!Array.isArray(f))return u.issues.push({expected:"array",code:"invalid_type",input:f,inst:n}),u;u.value=r?r.alloc(n,u,Array(f.length),d):Array(f.length);const m=[],p=d?.abortEarly;for(let v=0;v<f.length;v++){const g=f[v],b=l.element._zod.run({value:g,issues:[]},d);if(b instanceof Promise)m.push(b.then(j=>vp(j,u,v)));else if(vp(b,u,v),p&&b.issues.length!==0&&oa(b))break}return m.length?Promise.all(m).then(()=>u):u},Gx(n,Yx)});function Dr(n,l,r,u,d,f){const m=r in u,p=f==="optional";if(!(!m&&p&&d==="optional")){if(n.issues.length){if(d!==void 0&&p&&!m)return;l.issues.push(...ti(r,n.issues))}if(!m&&d===void 0){n.issues.length||l.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}n.value===void 0?(m||d==="defaulted"&&!p)&&(l.value[r]=void 0):l.value[r]=n.value}}const Kx=[];function _v(n){const l=Object.keys(n.shape),r=Object.getOwnPropertySymbols(n.shape),u=r.length?r:Kx,d=u.length?[...l,...u]:l;for(const m of d)if(!n.shape?.[m]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(m)}": expected a Zod schema`);const f=Tb(n.shape);return{...n,allKeys:d,symbolKeys:u,keySet:new Set(l),numKeys:l.length,optionalKeys:new Set(f)}}function Nv(n,l,r,u,d,f,m){const p=[],v=d.keySet,g=d.catchall._zod,b=g.def.type,j=g.optin,C=g.optout;let z=0;for(const M in l){if(m&&r.issues.length!==z){if(oa(r,z))break;z=r.issues.length}if(v.has(M))continue;if(M==="__proto__"){b==="never"&&p.push(M);continue}if(b==="never"){p.push(M);continue}const K=g.run({value:l[M],issues:[]},u);K instanceof Promise?n.push(K.then(J=>Dr(J,r,M,l,j,C))):Dr(K,r,M,l,j,C)}return p.length&&r.issues.push({code:"unrecognized_keys",keys:p,input:l,inst:f,continue:!0}),n.length?Promise.all(n).then(()=>r):r}const Qx=q("$ZodObject",(n,l)=>{ft.init(n,l);const r=Object.getOwnPropertyDescriptor(l,"shape"),u=r?.get?r.get.raw:l.shape??{};if(u){const g=()=>{const b={...u};return Object.defineProperty(l,"shape",{value:b}),g.raw=b,b};g.raw=u,Object.defineProperty(l,"shape",{get:g})}const d=Lo(()=>_v(l));Ke(n,"propValues",g=>{const b=g.def.shape,j={};for(const C in b){const z=b[C]._zod;if(z.values){Object.prototype.hasOwnProperty.call(j,C)||Ba(j,C,new Set);for(const M of z.values)j[C].add(M);z.optin!==void 0&&j[C].add(void 0)}}return j});const f=kr,m=l.catchall;let p;const v=Tn.memoizer;v?.attach(n),n._zod.parse=(g,b)=>{p??(p=d.value);const j=g.value;if(!f(j))return g.issues.push({expected:"object",code:"invalid_type",input:j,inst:n}),g;g.value=v?v.alloc(n,g,{},b):{};const C=[],z=p.shape,M=b?.abortEarly;let K=g.issues.length;for(const J of p.allKeys){if(M&&g.issues.length!==K){if(oa(g,K))break;K=g.issues.length}if(J==="__proto__")continue;const I=z[J],ie=I._zod.optin,X=I._zod.optout,se=I._zod.run({value:j[J],issues:[]},b);se instanceof Promise?C.push(se.then(x=>Dr(x,g,J,j,ie,X))):Dr(se,g,J,j,ie,X)}return m?Nv(C,j,g,b,d.value,n,M===!0):C.length?Promise.all(C).then(()=>g):g}}),Vx=q("$ZodObjectJIT",(n,l)=>{Qx.init(n,l);const r=n._zod.parse,u=Lo(()=>_v(l)),d=Tn.memoizer,f=z=>{const M=u.value,K=M.symbolKeys,J=new lx(["payload","ctx"],{shape:z,inst:n,memo:d,syms:K}),I=x=>`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`,ie=(x,B)=>`
13
+ };`)(...Object.values(this.closed))}}const ix={major:4,minor:6,patch:7},ft=q("$ZodType",(n,l)=>{var r;n??(n={}),n._zod.def=l,n._zod.bag=n._zod.bag||{},n._zod.version=ix;const u=n._zod.def.checks,d=n._zod.traits.has("$ZodCheck")?[n,...u??[]]:u?.length?[...u]:[];for(const f of d)for(const m of f._zod.onattach)m(n);if(d.length===0)(r=n._zod).deferred??(r.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{const f=(p,v,g)=>{if(p.memo)return p;let b=oa(p),j;for(const C of v){if(C._zod.def.when){if($b(p)||!C._zod.def.when(p))continue}else if(b)continue;const z=p.issues.length,M=C._zod.check(p);if(M instanceof Promise&&g?.async===!1)throw new ml;if(j||M instanceof Promise)j=(j??Promise.resolve()).then(async()=>{await M,p.issues.length!==z&&(Co(p.issues,z,n),b||(b=oa(p,z)))});else{if(p.issues.length===z)continue;Co(p.issues,z,n),b||(b=oa(p,z))}}return j?j.then(()=>p):p},m=(p,v,g)=>{if(oa(p))return p.aborted=!0,p;const b=f(v,d,g);if(b instanceof Promise){if(g.async===!1)throw new ml;return b.then(j=>n._zod.parse(j,g))}return n._zod.parse(b,g)};n._zod.run=(p,v)=>{if(v.skipChecks)return n._zod.parse(p,v);if(v.direction==="backward"){const b=n._zod.parse({value:p.value,issues:[]},{...v,skipChecks:!0});return b instanceof Promise?b.then(j=>m(j,p,v)):m(b,p,v)}const g=n._zod.parse(p,v);if(g instanceof Promise){if(v.async===!1)throw new ml;return g.then(b=>f(b,d,v))}return f(g,d,v)}}},{get"~standard"(){return cv(this,"~standard",vv(this))},set"~standard"(n){La(this,"~standard",n)}}),pv=(n,l)=>n.issues.length?{issues:n.issues.map(r=>$a(r,l,Gn()))}:{value:n.value};async function sx(n,l){const r={async:!0};return pv(await n._zod.run({value:l,issues:[]},r),r)}function vv(n){return{validate:l=>{const r={async:!1};try{const u=n._zod.run({value:l,issues:[]},r);if(!(u instanceof Promise))return pv(u,r)}catch{}return sx(n,l)},vendor:"zod",version:1}}const Io=q("$ZodString",(n,l)=>{ft.init(n,l),n._zod.pattern=l.pattern??Bj,n._zod.parse=(r,u)=>{if(l.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:n}),r}}),it=q("$ZodStringFormat",(n,l)=>{Gr.init(n,l),Io.init(n,l)}),rx=q("$ZodGUID",(n,l)=>{l.pattern??(l.pattern=Aj),it.init(n,l)}),cx=q("$ZodUUID",(n,l)=>{if(l.version){const u={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[l.version];if(u===void 0)throw new Error(`Invalid UUID version: "${l.version}"`);l.pattern??(l.pattern=mp(u))}else l.pattern??(l.pattern=mp());it.init(n,l)}),ux=q("$ZodEmail",(n,l)=>{l.pattern??(l.pattern=Cj),it.init(n,l)}),gv=1,Mr=2;function yv(n){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(n):(new URL(n),!0)}catch{return!1}}function ox(n,l){return!("normalize"in l)&&!("hostname"in l)&&!("protocol"in l)?yv(n)||Mr:dx(n,l)}function dx(n,l){if(!l.normalize&&l.protocol?.source===Dj.source&&!/^https?:\/\//i.test(n))return gv;try{if(typeof URL<"u"){const r=URL;if(typeof r.parse=="function")return r.parse(n)??Mr}return new URL(n)}catch{return Mr}}const fx=/[\t\n\r]/g;function pp(n){return n.replace(fx,"")}function hx(n,l){return l.lastIndex=0,l.test(n.hostname)}function mx(n,l){return l.lastIndex=0,l.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)}const px=q("$ZodURL",(n,l)=>{it.init(n,l),n._zod.check=r=>{try{const u=r.value.trim(),d=ox(u,l);if(d===gv){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:n,continue:!l.abort});return}if(d===Mr){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:n,continue:!l.abort});return}if(d===!0){r.value=pp(u);return}l.hostname&&!hx(d,l.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:l.hostname.source,input:r.value,inst:n,continue:!l.abort}),l.protocol&&!mx(d,l.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:l.protocol.source,input:r.value,inst:n,continue:!l.abort}),r.value=l.normalize?d.href:pp(u);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:n,continue:!l.abort})}}}),vx=q("$ZodEmoji",(n,l)=>{l.pattern??(l.pattern=Ej()),it.init(n,l)}),gx=q("$ZodNanoID",(n,l)=>{if(l.length!==void 0&&(!Number.isInteger(l.length)||l.length<1))throw new Error(`Invalid nanoid length: ${l.length}`);l.pattern??(l.pattern=l.length===void 0?Sj:_j(l.length)),it.init(n,l)}),yx=q("$ZodCUID",(n,l)=>{l.pattern??(l.pattern=gj),it.init(n,l)}),bx=q("$ZodCUID2",(n,l)=>{l.pattern??(l.pattern=yj),it.init(n,l)}),jx=q("$ZodULID",(n,l)=>{l.pattern??(l.pattern=bj),it.init(n,l)}),xx=q("$ZodXID",(n,l)=>{l.pattern??(l.pattern=jj),it.init(n,l)}),Sx=q("$ZodKSUID",(n,l)=>{l.pattern??(l.pattern=xj),it.init(n,l)}),_x=q("$ZodISODateTime",(n,l)=>{l.pattern??(l.pattern=Lj(l)),it.init(n,l)}),Nx=q("$ZodISODate",(n,l)=>{l.pattern??(l.pattern=Hj),it.init(n,l)}),Ax=q("$ZodISOTime",(n,l)=>{l.pattern??(l.pattern=$j(l)),it.init(n,l)}),Cx=q("$ZodISODuration",(n,l)=>{l.pattern??(l.pattern=Nj),it.init(n,l)}),zx=q("$ZodIPv4",(n,l)=>{l.pattern??(l.pattern=wj),it.init(n,l)}),Ex=/^[0-9a-fA-F:.]+$/;function bv(n){return Ex.test(n)?yv(`http://[${n}]`):!1}const wx=q("$ZodIPv6",(n,l)=>{l.pattern??(l.pattern=Oj),it.init(n,l),n._zod.check=r=>{bv(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:n,continue:!l.abort})}}),Ox=q("$ZodCIDRv4",(n,l)=>{l.pattern??(l.pattern=Tj),it.init(n,l)});function Tx(n){const l=n.split("/");if(l.length!==2)return!1;const[r,u]=l;if(!u)return!1;const d=Number(u);return`${d}`!==u||d<0||d>128?!1:bv(r)}const kx=q("$ZodCIDRv6",(n,l)=>{l.pattern??(l.pattern=kj),it.init(n,l),n._zod.check=r=>{Tx(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:n,continue:!l.abort})}});function jv(n){if(n==="")return!0;if(/\s/.test(n)||n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const xv=/^[0-9a-zA-Z+/]*={0,2}$/,Rx=q("$ZodBase64",(n,l)=>{l.pattern??(l.pattern=xv),it.init(n,l),n._zod.check=r=>{jv(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:n,continue:!l.abort})}}),Po=/^[A-Za-z0-9_-]*$/;function Mx(n){if(!Po.test(n))return!1;const l=n.replace(/[-_]/g,u=>u==="-"?"+":"/"),r=l.padEnd(Math.ceil(l.length/4)*4,"=");return jv(r)}const Dx=q("$ZodBase64URL",(n,l)=>{l.pattern??(l.pattern=Po),it.init(n,l),n._zod.check=r=>{Mx(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:n,continue:!l.abort})}}),Ux=q("$ZodE164",(n,l)=>{l.pattern??(l.pattern=Uj),it.init(n,l)});function Zx(n,l=null){try{const r=n.split(".");if(r.length!==3)return!1;const[u]=r;if(!u)return!1;const d=JSON.parse(atob(u));return!("typ"in d&&d?.typ!=="JWT"||!d.alg||l&&(!("alg"in d)||d.alg!==l))}catch{return!1}}const Hx=q("$ZodJWT",(n,l)=>{it.init(n,l),n._zod.check=r=>{Zx(r.value,l.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:n,continue:!l.abort})}}),Sv=q("$ZodNumber",(n,l)=>{ft.init(n,l),n._zod.pattern=Vo,n._zod.parse=(r,u)=>{if(l.coerce)try{r.value=Number(r.value)}catch{}const d=r.value;if(typeof d=="number"&&!Number.isNaN(d)&&Number.isFinite(d))return r;const f=typeof d=="number"?Number.isNaN(d)?"NaN":Number.isFinite(d)?void 0:String(d):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:d,inst:n,...f?{received:f}:{}}),r}}),$x=q("$ZodNumberFormat",(n,l)=>{Qj.init(n,l),Sv.init(n,l)}),Lx=q("$ZodBoolean",(n,l)=>{ft.init(n,l),n._zod.pattern=Gj,n._zod.parse=(r,u)=>{if(l.coerce)try{r.value=!!r.value}catch{}const d=r.value;return typeof d=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:d,inst:n}),r}}),Bx=q("$ZodUnknown",(n,l)=>{ft.init(n,l),n._zod.parse=r=>r}),qx=q("$ZodNever",(n,l)=>{ft.init(n,l),n._zod.parse=(r,u)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:n}),r)});function Gx(n,l){const r=op(n._zod.def.checks);if(!r.length)return;const u=Math.min(...r.map(f=>f[0])),d=n._zod.parse;n._zod.parse=(f,m)=>{const p=l(f.value);if(p>u&&!m?.skipChecks&&m?.direction!=="backward"){for(const[v,g]of op(n._zod.def.checks))if(p>v&&g._zod.def.when(f)){const b=f.issues.length;return g._zod.check(f),f.issues[b].continue=!1,Co(f.issues,b,n),f}}return d(f,m)}}const Yx=n=>Array.isArray(n)?n.length:-1;function vp(n,l,r){n.issues.length&&l.issues.push(...ti(r,n.issues)),l.value[r]=n.value}const Jx=q("$ZodArray",(n,l)=>{ft.init(n,l);const r=Tn.memoizer;r?.attach(n),n._zod.parse=(u,d)=>{const f=u.value;if(!Array.isArray(f))return u.issues.push({expected:"array",code:"invalid_type",input:f,inst:n}),u;u.value=r?r.alloc(n,u,Array(f.length),d):Array(f.length);const m=[],p=d?.abortEarly;for(let v=0;v<f.length;v++){const g=f[v],b=l.element._zod.run({value:g,issues:[]},d);if(b instanceof Promise)m.push(b.then(j=>vp(j,u,v)));else if(vp(b,u,v),p&&b.issues.length!==0&&oa(b))break}return m.length?Promise.all(m).then(()=>u):u},Gx(n,Yx)});function Dr(n,l,r,u,d,f){const m=r in u,p=f==="optional";if(!(!m&&p&&d==="optional")){if(n.issues.length){if(d!==void 0&&p&&!m)return;l.issues.push(...ti(r,n.issues))}if(!m&&d===void 0){n.issues.length||l.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}n.value===void 0?(m||d==="defaulted"&&!p)&&(l.value[r]=void 0):l.value[r]=n.value}}const Kx=[];function _v(n){const l=Object.keys(n.shape),r=Object.getOwnPropertySymbols(n.shape),u=r.length?r:Kx,d=u.length?[...l,...u]:l;for(const m of d)if(!n.shape?.[m]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(m)}": expected a Zod schema`);const f=Tb(n.shape);return{...n,allKeys:d,symbolKeys:u,keySet:new Set(l),numKeys:l.length,optionalKeys:new Set(f)}}function Nv(n,l,r,u,d,f,m){const p=[],v=d.keySet,g=d.catchall._zod,b=g.def.type,j=g.optin,C=g.optout;let z=0;for(const M in l){if(m&&r.issues.length!==z){if(oa(r,z))break;z=r.issues.length}if(v.has(M))continue;if(M==="__proto__"){b==="never"&&p.push(M);continue}if(b==="never"){p.push(M);continue}const K=g.run({value:l[M],issues:[]},u);K instanceof Promise?n.push(K.then(J=>Dr(J,r,M,l,j,C))):Dr(K,r,M,l,j,C)}return p.length&&r.issues.push({code:"unrecognized_keys",keys:p,input:l,inst:f,continue:!0}),n.length?Promise.all(n).then(()=>r):r}const Qx=q("$ZodObject",(n,l)=>{ft.init(n,l);const r=Object.getOwnPropertyDescriptor(l,"shape"),u=r?.get?r.get.raw:l.shape??{};if(u){const g=()=>{const b={...u};return Object.defineProperty(l,"shape",{value:b}),g.raw=b,b};g.raw=u,Object.defineProperty(l,"shape",{get:g})}const d=Lo(()=>_v(l));Qe(n,"propValues",g=>{const b=g.def.shape,j={};for(const C in b){const z=b[C]._zod;if(z.values){Object.prototype.hasOwnProperty.call(j,C)||Ba(j,C,new Set);for(const M of z.values)j[C].add(M);z.optin!==void 0&&j[C].add(void 0)}}return j});const f=kr,m=l.catchall;let p;const v=Tn.memoizer;v?.attach(n),n._zod.parse=(g,b)=>{p??(p=d.value);const j=g.value;if(!f(j))return g.issues.push({expected:"object",code:"invalid_type",input:j,inst:n}),g;g.value=v?v.alloc(n,g,{},b):{};const C=[],z=p.shape,M=b?.abortEarly;let K=g.issues.length;for(const J of p.allKeys){if(M&&g.issues.length!==K){if(oa(g,K))break;K=g.issues.length}if(J==="__proto__")continue;const I=z[J],ie=I._zod.optin,X=I._zod.optout,se=I._zod.run({value:j[J],issues:[]},b);se instanceof Promise?C.push(se.then(x=>Dr(x,g,J,j,ie,X))):Dr(se,g,J,j,ie,X)}return m?Nv(C,j,g,b,d.value,n,M===!0):C.length?Promise.all(C).then(()=>g):g}}),Vx=q("$ZodObjectJIT",(n,l)=>{Qx.init(n,l);const r=n._zod.parse,u=Lo(()=>_v(l)),d=Tn.memoizer,f=z=>{const M=u.value,K=M.symbolKeys,J=new lx(["payload","ctx"],{shape:z,inst:n,memo:d,syms:K}),I=x=>`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`,ie=(x,B)=>`
14
14
  let ${x}_ab = false;
15
15
  for (let i = 0; i < ${x}.issues.length; i++) {
16
16
  const iss = ${x}.issues[i];
@@ -60,8 +60,8 @@ ${r.join(`
60
60
  newResult[${V}] = ${B}.value;
61
61
  }
62
62
 
63
- `)}return J.write("payload.value = newResult;"),J.write("return payload;"),J.compile()};let m;const p=kr,v=!Tn.jitless,b=v&&wb.value,j=l.catchall;let C;n._zod.parse=(z,M)=>{C??(C=u.value);const K=z.value;return p(K)?v&&b&&M?.async===!1&&M.jitless!==!0?(m||(m=f(l.shape)),z=m(z,M),j?Nv([],K,z,M,C,n,M?.abortEarly===!0):z):r(z,M):(z.issues.push({expected:"object",code:"invalid_type",input:K,inst:n}),z)}});function gp(n,l,r,u){for(const f of n)if(f.issues.length===0)return l.value=f.value,l;const d=n.filter(f=>!oa(f));return d.length===1?(l.value=d[0].value,d[0]):(l.issues.push({code:"invalid_union",input:l.value,inst:r,errors:n.map(f=>f.issues.map(m=>$a(m,u,Gn())))}),l)}const Xx=q("$ZodUnion",(n,l)=>{ft.init(n,l),Ke(n,"optin",u=>u.def.options.some(d=>d._zod.optin==="defaulted")?"defaulted":u.def.options.some(d=>d._zod.optin!==void 0)?"optional":void 0),Ke(n,"optout",u=>u.def.options.some(d=>d._zod.optout==="optional")?"optional":void 0),Ke(n,"values",u=>{if(u.def.options.every(d=>d._zod.values))return new Set(u.def.options.flatMap(d=>Array.from(d._zod.values)))}),Ke(n,"pattern",u=>{if(u.def.options.every(d=>d._zod.pattern)){const d=u.def.options.map(f=>f._zod.pattern);return new RegExp(`^(${d.map(f=>Bo(f.source)).join("|")})$`)}});const r=l.options.length===1?l.options[0]._zod.run:null;n._zod.parse=(u,d)=>{if(r)return r(u,d);let f=!1;const m=[];for(const p of l.options){const v=p._zod.run({value:u.value,issues:[]},d);if(v instanceof Promise)m.push(v),f=!0;else{if(v.issues.length===0)return v;m.push(v)}}return f?Promise.all(m).then(p=>gp(p,u,n,d)):gp(m,u,n,d)}}),Ix=q("$ZodIntersection",(n,l)=>{ft.init(n,l),n._zod.parse=(r,u)=>{const d=r.value,f=l.left._zod.run({value:d,issues:[]},u),m=l.right._zod.run({value:d,issues:[]},u);return f instanceof Promise||m instanceof Promise?Promise.all([f,m]).then(([v,g])=>yp(r,v,g)):yp(r,f,m)}});function Eo(n,l){if(n===l)return{valid:!0,data:n};if(n instanceof Date&&l instanceof Date&&+n==+l)return{valid:!0,data:n};if(ai(n)&&ai(l)){const r=Object.keys(l),u=Object.keys(n).filter(f=>r.indexOf(f)!==-1),d={...n,...l};Object.prototype.hasOwnProperty.call(d,"__proto__")&&delete d.__proto__;for(const f of u){if(f==="__proto__")continue;const m=Eo(n[f],l[f]);if(!m.valid)return{valid:!1,mergeErrorPath:[f,...m.mergeErrorPath]};d[f]=m.data}return{valid:!0,data:d}}if(Array.isArray(n)&&Array.isArray(l)){if(n.length!==l.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let u=0;u<n.length;u++){const d=n[u],f=l[u],m=Eo(d,f);if(!m.valid)return{valid:!1,mergeErrorPath:[u,...m.mergeErrorPath]};r.push(m.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function yp(n,l,r){const u=new Map;let d;const f=new Map,m=(g,b)=>{let j;if(g.code==="unrecognized_keys"&&!g.path?.length)d??(d=g),j=g.keys;else if(g.code==="invalid_key"&&g.origin==="record"&&g.path?.length===1){const C=String(g.path[0]);f.has(C)||f.set(C,g),j=[C]}else return!1;for(const C of j)u.has(C)||u.set(C,{}),u.get(C)[b]=!0;return!0};for(const g of l.issues)m(g,"l")||n.issues.push(g);for(const g of r.issues)m(g,"r")||n.issues.push(g);const p=[...u].filter(([,g])=>g.l&&g.r).map(([g])=>g);if(p.length){const g=d?p.filter(b=>d.keys.includes(b)):[];g.length&&n.issues.push({...d,keys:g});for(const b of p)!g.includes(b)&&f.has(b)&&n.issues.push(f.get(b))}const v=Eo(l.value,r.value);if(!v.valid){if(oa(n))return n;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(v.mergeErrorPath)}`)}return n.value=v.data,n}const Px=q("$ZodRecord",(n,l)=>{ft.init(n,l);const r=Tn.memoizer;r?.attach(n),n._zod.parse=(u,d)=>{const f=u.value;if(!ai(f))return u.issues.push({expected:"record",code:"invalid_type",input:f,inst:n}),u;const m=[],p=l.keyType._zod.values;if(p&&!l.partial){u.value=r?r.alloc(n,u,{},d):{};const v=new Set;for(const b of p)if(typeof b=="string"||typeof b=="number"||typeof b=="symbol"){if(v.add(typeof b=="number"?b.toString():b),b==="__proto__")continue;const j=l.keyType._zod.run({value:b,issues:[]},d);if(j instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(j.issues.length){u.issues.push({code:"invalid_key",origin:"record",issues:j.issues.map(M=>$a(M,d,Gn())),input:b,path:[b],inst:n});continue}const C=j.value;if(C==="__proto__")continue;const z=l.valueType._zod.run({value:f[b],issues:[]},d);z instanceof Promise?m.push(z.then(M=>{M.issues.length&&u.issues.push(...ti(b,M.issues)),u.value[C]=M.value})):(z.issues.length&&u.issues.push(...ti(b,z.issues)),u.value[C]=z.value)}let g;for(const b in f)if(!v.has(b))if(l.mode==="loose"){if(b==="__proto__")continue;u.value[b]=f[b]}else g=g??[],g.push(b);g&&g.length>0&&u.issues.push({code:"unrecognized_keys",input:f,inst:n,keys:g,continue:!0})}else{u.value=r?r.alloc(n,u,{},d):{};let v;for(const g of Reflect.ownKeys(f)){if(g==="__proto__"||!Object.prototype.propertyIsEnumerable.call(f,g))continue;let b=l.keyType._zod.run({value:g,issues:[]},d);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof g=="string"&&Vo.test(g)&&b.issues.length){const M=l.keyType._zod.run({value:Number(g),issues:[]},d);if(M instanceof Promise)throw new Error("Async schemas not supported in object keys currently");M.issues.length===0&&(b=M)}if(b.issues.length){l.mode==="loose"?u.value[g]=f[g]:p?(v=v??[],v.push(g)):u.issues.push({code:"invalid_key",origin:"record",issues:b.issues.map(M=>$a(M,d,Gn())),input:g,path:[g],inst:n});continue}const C=b.value;if(C==="__proto__")continue;const z=l.valueType._zod.run({value:f[g],issues:[]},d);z instanceof Promise?m.push(z.then(M=>{M.issues.length&&u.issues.push(...ti(g,M.issues)),u.value[C]=M.value})):(z.issues.length&&u.issues.push(...ti(g,z.issues)),u.value[C]=z.value)}v&&v.length>0&&u.issues.push({code:"unrecognized_keys",input:f,inst:n,keys:v,continue:!0})}return m.length?Promise.all(m).then(()=>u):u}}),Fx=q("$ZodEnum",(n,l)=>{ft.init(n,l);const r=No(l.entries),u=new Set(r);n._zod.values=u,Ke(n,"pattern",d=>{const f=No(d.def.entries).filter(m=>Ob.has(typeof m));return new RegExp(f.length?`^(${f.map(m=>Lr(m.toString())).join("|")})$`:"^[^\\s\\S]$")}),n._zod.parse=(d,f)=>{const m=d.value;return u.has(m)||d.issues.push({code:"invalid_value",values:r,input:m,inst:n}),d}}),Wx=q("$ZodTransform",(n,l)=>{ft.init(n,l),n._zod.optin="optional",Tn.memoizer?.guard(n),n._zod.parse=(r,u)=>{if(u.direction==="backward")throw new ov(n.constructor.name);const d=l.transform(r.value,r);if(u.async)return(d instanceof Promise?d:Promise.resolve(d)).then(m=>(r.value=m,r));if(d instanceof Promise)throw new ml;return r.value=d,r}});function bp(n,l){return n.value=l.issues.length?void 0:l.value,n}const Av=q("$ZodOptional",(n,l)=>{ft.init(n,l),Ke(n,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),n._zod.optout="optional",Ke(n,"values",r=>{const u=r.def.innerType._zod.values;return u?new Set([...u,void 0]):void 0}),Ke(n,"pattern",r=>{const u=r.def.innerType._zod.pattern;return u?new RegExp(`^(${Bo(u.source)})?$`):void 0}),n._zod.parse=(r,u)=>{if(r.value===void 0){if(l.innerType._zod.optin!=="defaulted")return r;const d=l.innerType._zod.run({value:r.value,issues:[]},u);return d instanceof Promise?d.then(f=>bp(r,f)):bp(r,d)}return l.innerType._zod.run(r,u)}}),e0=q("$ZodExactOptional",(n,l)=>{Av.init(n,l),Ke(n,"values",r=>r.def.innerType._zod.values),Ke(n,"pattern",r=>r.def.innerType._zod.pattern),n._zod.parse=(r,u)=>l.innerType._zod.run(r,u)}),t0=q("$ZodNullable",(n,l)=>{ft.init(n,l),Ke(n,"optin",r=>r.def.innerType._zod.optin),Ke(n,"optout",r=>r.def.innerType._zod.optout),Ke(n,"pattern",r=>{const u=r.def.innerType._zod.pattern;return u?new RegExp(`^(${Bo(u.source)}|null)$`):void 0}),Ke(n,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),n._zod.parse=(r,u)=>r.value===null?r:l.innerType._zod.run(r,u)}),n0=q("$ZodDefault",(n,l)=>{ft.init(n,l),n._zod.optin="defaulted",Ke(n,"values",r=>r.def.innerType._zod.values),n._zod.parse=(r,u)=>{if(u.direction==="backward")return l.innerType._zod.run(r,u);if(r.value===void 0)return r.value=l.defaultValue,r;const d=l.innerType._zod.run(r,u);return d instanceof Promise?d.then(f=>jp(f,l)):jp(d,l)}});function jp(n,l){return n.value===void 0&&(n.value=l.defaultValue),n}const a0=q("$ZodPrefault",(n,l)=>{ft.init(n,l),n._zod.optin="defaulted",Ke(n,"values",r=>r.def.innerType._zod.values),n._zod.parse=(r,u)=>(u.direction==="backward"||r.value===void 0&&(r.value=l.defaultValue),l.innerType._zod.run(r,u))}),l0=q("$ZodNonOptional",(n,l)=>{ft.init(n,l),Ke(n,"values",r=>{const u=r.def.innerType._zod.values;return u?new Set([...u].filter(d=>d!==void 0)):void 0}),n._zod.parse=(r,u)=>{const d=l.innerType._zod.run(r,u);return d instanceof Promise?d.then(f=>xp(f,n)):xp(d,n)}});function xp(n,l){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:l}),n}function Sp(n,l,r,u){return l.issues.length?(n.value=r.catchValue({...l,value:n.value,error:{issues:l.issues.map(d=>$a(d,u,Gn()))},input:n.value}),n):(n.value=l.value,l.memo&&(n.memo=!0),n)}const i0=q("$ZodCatch",(n,l)=>{ft.init(n,l),Ke(n,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Ke(n,"optout",r=>r.def.innerType._zod.optout),Ke(n,"values",r=>r.def.innerType._zod.values),n._zod.parse=(r,u)=>{if(u.direction==="backward")return l.innerType._zod.run(r,u);const d=l.innerType._zod.run({value:r.value,issues:[]},u);return d instanceof Promise?d.then(f=>Sp(r,f,l,u)):Sp(r,d,l,u)}}),s0=q("$ZodPipe",(n,l)=>{ft.init(n,l),Ke(n,"values",r=>r.def.in._zod.values),Ke(n,"optin",r=>r.def.in._zod.optin),Ke(n,"optout",r=>r.def.out._zod.optout),Ke(n,"propValues",r=>r.def.in._zod.propValues),n._zod.parse=(r,u)=>{if(u.direction==="backward"){const f=l.out._zod.run(r,u);return f instanceof Promise?f.then(m=>Ar(m,l.in,u)):Ar(f,l.in,u)}const d=l.in._zod.run(r,u);return d instanceof Promise?d.then(f=>Ar(f,l.out,u)):Ar(d,l.out,u)}});function Ar(n,l,r){return n.issues.some(u=>u.code!=="unrecognized_keys")?(n.aborted=!0,n):l._zod.run({value:n.value,issues:n.issues},r)}const r0=q("$ZodReadonly",(n,l)=>{ft.init(n,l),Ke(n,"propValues",r=>r.def.innerType._zod.propValues),Ke(n,"values",r=>r.def.innerType._zod.values),Ke(n,"optin",r=>r.def.innerType?._zod?.optin),Ke(n,"optout",r=>r.def.innerType?._zod?.optout),n._zod.parse=(r,u)=>{if(u.direction==="backward")return l.innerType._zod.run(r,u);const d=l.innerType._zod.run(r,u);return d instanceof Promise?d.then(_p):_p(d)}});function _p(n){return n.memo||(n.value=Object.freeze(n.value)),n}const c0=q("$ZodCustom",(n,l)=>{Wt.init(n,l),ft.init(n,l),n._zod.parse=(r,u)=>r,n._zod.check=r=>{const u=r.value,d=l.fn(u);if(d instanceof Promise)return d.then(f=>Np(f,r,u,n));Np(d,r,u,n)}});function Np(n,l,r,u){if(!n){const d={code:"custom",input:r,inst:u,path:[...u._zod.def.path??[]],continue:!u._zod.def.abort};u._zod.def.params&&(d.params=u._zod.def.params),l.issues.push(rs(d))}}class u0 extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const wo="~memo",Ap=[];function Cv(n){return n!==null&&typeof n=="object"}function go(n){return n.map(l=>l.path?{...l,path:l.path.slice()}:{...l})}const zv=new WeakMap,as=0,Or=1,is=2;function Tr(n,l,r){const u=zv.get(n);if(u!==void 0)return u?is:as;if(l.has(n))return is;l.add(n);let d=as;const f=b=>{if(d!==is&&b?._zod){const j=Tr(b,l);j>d&&(d=j)}},m=(b,j)=>{let C=as;for(const z of Reflect.ownKeys(b)){const M=Object.getOwnPropertyDescriptor(b,z);if(!M.enumerable)continue;const K=M.get?Or:M.value?._zod?Tr(M.value,l):as;K>C&&(C=K)}return C},p=b=>{b>d&&(d=b)},v=n._zod.def;switch(v.type){case"object":{const b=ev(v);p(b?m(b):Or),f(v.catchall);break}case"array":f(v.element);break;case"tuple":for(const b of v.items)f(b);f(v.rest);break;case"record":case"map":f(v.keyType),f(v.valueType);break;case"set":f(v.valueType);break;case"union":for(const b of v.options)f(b);break;case"intersection":f(v.left),f(v.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":f(v.innerType);break;case"pipe":f(v.in),f(v.out);break;case"function":f(v.input),f(v.output);break;case"lazy":{const b=v._cachedInner??void 0;p(b?Tr(b,l):Or);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const b in v){const j=Object.getOwnPropertyDescriptor(v,b);if(!j||j.get)continue;const C=j.value;if(!(!C||typeof C!="object")){if(C._zod)f(C);else if(Array.isArray(C))for(const z of C)f(z)}}}return l.delete(n),o0(n,d)}function o0(n,l){return l!==Or&&zv.set(n,l===is),l}function d0(n,l){let r=n.buckets.get(l);return r||(r=new WeakMap,n.buckets.set(l,r)),r}let Cr;const zr=[],f0={alloc(n,l,r){const u=Cr;if(!u)return r;Cr=void 0;const d={value:r,issues:null};return u.set(l.value,d),zr.push(d),r},guard(n){var l;(l=n._zod).deferred??(l.deferred=[]),n._zod.deferred.push(()=>{const r=n._zod.parse,u=(d,f)=>{if(f.direction!=="backward"&&m0(f,d.value))throw new u0;return r(d,f)};n._zod.parse=u,n._zod.run===r&&(n._zod.run=u)})},attach(n){var l;let r,u=!1,d,f;(l=n._zod).deferred??(l.deferred=[]),n._zod.deferred.push(()=>{const m=n._zod.parse,p=(v,g)=>{if(r===void 0){const I=Tr(n,new Set);if(I===as)return n._zod.parse=m,n._zod.run===p&&(n._zod.run=m),m(v,g);I===is||u?r=!0:u=!0}const b=v.value;if(!Cv(b))return m(v,g);let j=g[wo];j||(j={buckets:new WeakMap,backEdges:void 0},g[wo]=j);let C;d===g?C=f:(C=d0(j,n),d=g,f=C);const z=C.get(b);if(z)return v.value=z.value,z.issues?z.issues.length&&v.issues.push(...go(z.issues)):(v.memo=!0,j.backEdges??(j.backEdges=new WeakSet),j.backEdges.add(z.value)),v;Cr=C;const M=zr.length,K=m(v,g);Cr=void 0;const J=zr.length>M?zr.pop():void 0;return K instanceof Promise?K.then(I=>(J&&(J.issues=I.issues.length?go(I.issues):Ap),I)):(J&&(J.issues=K.issues.length?go(K.issues):Ap),K)};n._zod.parse=p,n._zod.run===m&&(n._zod.run=p)})}};function h0(){return f0}function m0(n,l){const r=n[wo]?.backEdges;return r!==void 0&&Cv(l)&&r.has(l)}const p0=()=>{const n={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function l(f){return n[f]??null}const r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},u={nan:"NaN"};function d(f,m){return f==="number"&&typeof m=="number"&&!Number.isFinite(m)?String(m):u[f]??f}return f=>{switch(f.code){case"invalid_type":{const m=d(f.expected),p=Bb(f.input),v=d(p,f.input);return`Invalid input: expected ${m}, received ${v}`}case"invalid_value":return f.values.length===1?`Invalid input: expected ${iv(f.values[0])}`:`Invalid option: expected one of ${cp(f.values,"|")}`;case"too_big":{const m=f.exact?"exactly ":f.inclusive?"<=":"<",p=l(f.origin);return p?`Too big: expected ${f.origin??"value"} to have ${m}${f.maximum.toString()} ${p.unit??"elements"}`:`Too big: expected ${f.origin??"value"} to be ${m}${f.maximum.toString()}`}case"too_small":{const m=f.exact?"exactly ":f.inclusive?">=":">",p=l(f.origin);return p?`Too small: expected ${f.origin} to have ${m}${f.minimum.toString()} ${p.unit}`:`Too small: expected ${f.origin} to be ${m}${f.minimum.toString()}`}case"invalid_format":{const m=f;return m.format==="starts_with"?`Invalid string: must start with "${m.prefix}"`:m.format==="ends_with"?`Invalid string: must end with "${m.suffix}"`:m.format==="includes"?`Invalid string: must include "${m.includes}"`:m.format==="regex"?`Invalid string: must match pattern ${m.pattern}`:`Invalid ${r[m.format]??f.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${f.divisor}`;case"unrecognized_keys":return`Unrecognized key${f.keys.length>1?"s":""}: ${cp(f.keys,", ")}`;case"invalid_key":return`Invalid key in ${f.origin}`;case"invalid_union":return f.options&&Array.isArray(f.options)&&f.options.length>0?`Invalid discriminator value. Expected ${f.options.map(p=>`'${p}'`).join(" | ")}`:f.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${f.origin}`;default:return"Invalid input"}}};function v0(){return{localeError:p0()}}var Cp;class g0{constructor(){this._map=new WeakMap,this._idmap=new Map}add(l,...r){const u=r[0];return this._map.set(l,u),u&&typeof u=="object"&&"id"in u&&this._idmap.set(u.id,l),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(l){const r=this._map.get(l);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(l),this}get(l){const r=l._zod.parent;if(r){const u={...this.get(r)??{}};delete u.id;const d={...u,...this._map.get(l)};return Object.keys(d).length?d:void 0}return this._map.get(l)}has(l){return this._map.has(l)}}function y0(){return new g0}(Cp=globalThis).__zod_globalRegistry??(Cp.__zod_globalRegistry=y0());const ls=globalThis.__zod_globalRegistry;function Ev(n){return n.checks&&(n.checks=[...n.checks]),n}function b0(n,l){return new n(Ev({type:"string",...ge(l)}))}function j0(n,l){return new n({type:"string",format:"email",check:"string_format",abort:!1,...ge(l)})}function x0(n,l){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...ge(l)})}function S0(n,l){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...ge(l)})}function _0(n,l){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ge(l)})}function N0(n,l){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ge(l)})}function A0(n,l){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ge(l)})}function C0(n,l){return new n({type:"string",format:"url",check:"string_format",abort:!1,...ge(l)})}function z0(n,l){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...ge(l)})}function E0(n,l){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...ge(l)})}function w0(n,l){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...ge(l)})}function O0(n,l){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...ge(l)})}function T0(n,l){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...ge(l)})}function k0(n,l){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...ge(l)})}function R0(n,l){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...ge(l)})}function M0(n,l){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...ge(l)})}function D0(n,l){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...ge(l)})}function U0(n,l){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ge(l)})}function Z0(n,l){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ge(l)})}function H0(n,l){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...ge(l)})}function $0(n,l){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...ge(l)})}function L0(n,l){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...ge(l)})}function B0(n,l){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...ge(l)})}function q0(n,l){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ge(l)})}function G0(n,l){return new n({type:"string",format:"date",check:"string_format",...ge(l)})}function Y0(n,l){return new n({type:"string",format:"time",check:"string_format",precision:null,...ge(l)})}function J0(n,l){return new n({type:"string",format:"duration",check:"string_format",...ge(l)})}function K0(n,l){return new n(Ev({type:"number",checks:[],...ge(l)}))}function Q0(n,l){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...ge(l)})}function V0(n,l){return new n({type:"boolean",...ge(l)})}function X0(n){return new n({type:"unknown"})}function I0(n,l){return new n({type:"never",...ge(l)})}function zp(n,l){return new hv({check:"less_than",...ge(l),value:n,inclusive:!1})}function yo(n,l){return new hv({check:"less_than",...ge(l),value:n,inclusive:!0})}function Ep(n,l){return new mv({check:"greater_than",...ge(l),value:n,inclusive:!1})}function bo(n,l){return new mv({check:"greater_than",...ge(l),value:n,inclusive:!0})}function wp(n,l){return new Kj({check:"multiple_of",...ge(l),value:n})}function wv(n,l){return new Vj({check:"max_length",...ge(l),maximum:n})}function Ur(n,l){return new Xj({check:"min_length",...ge(l),minimum:n})}function Ov(n,l){return new Ij({check:"length_equals",...ge(l),length:n})}function P0(n,l){return new Pj({check:"string_format",format:"regex",...ge(l),pattern:n})}function F0(n){return new Fj({check:"string_format",format:"lowercase",...ge(n)})}function W0(n){return new Wj({check:"string_format",format:"uppercase",...ge(n)})}function eS(n,l){return new ex({check:"string_format",format:"includes",...ge(l),includes:n})}function tS(n,l){return new tx({check:"string_format",format:"starts_with",...ge(l),prefix:n})}function nS(n,l){return new nx({check:"string_format",format:"ends_with",...ge(l),suffix:n})}function ri(n){return new ax({check:"overwrite",tx:n})}function aS(n){return ri(l=>l.normalize(n))}function lS(){return ri(n=>n.trim())}function iS(){return ri(n=>n.toLowerCase())}function sS(){return ri(n=>n.toUpperCase())}function rS(){return ri(n=>Eb(n))}function cS(n,l,r){return new n({type:"array",element:l,...ge(r)})}function uS(n,l,r){return new n({type:"custom",check:"custom",fn:l,...ge(r)})}function oS(n,l){const r=dS(u=>(u.addIssue=d=>{if(typeof d=="string")u.issues.push(rs(d,u.value,r._zod.def));else{const f=d;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),"input"in f||(f.input=u.value),f.inst??(f.inst=r),f.continue??(f.continue=!r._zod.def.abort),u.issues.push(rs(f))}},n(u.value,u)),l);return r}function dS(n,l){const r=new Wt({check:"custom",...ge(l)});return r._zod.check=n,r}function ss(n,...l){for(const r of l)for(const u of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,u)&&Ba(n,u,r[u]);return n}function Tv(n){let l=n?.target??"draft-2020-12";return l==="draft-4"&&(l="draft-04"),l==="draft-7"&&(l="draft-07"),{processors:n.processors??{},metadataRegistry:n?.metadata??ls,target:l,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:n?.cycles??"ref",reused:n?.reused??"inline",intersections:[],deferred:[],external:n?.external??void 0}}function ci(n,l,r,u,d){const f=typeof l.unrepresentable=="function"?l.unrepresentable({zodSchema:n,path:u.path,message:d}):l.unrepresentable;if(f==="any")return!1;if(f===void 0||f==="throw")throw new Error(d);return Object.assign(r,f),!0}function _t(n,l,r={path:[],schemaPath:[]}){var u;const d=n._zod.def,f=l.seen.get(n);if(f)return f.count++,r.schemaPath.includes(n)&&(f.cycle=r.path),f.schema;const m={schema:{},count:1,cycle:void 0,path:r.path};l.seen.set(n,m),l.sharedDefsExtractedFor=void 0,l.sharedEmitDoneFor=void 0;const p=n._zod.toJSONSchema?.();if(p)m.schema=p;else{const b={...r,schemaPath:[...r.schemaPath,n],path:r.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(l,m.schema,b);else{const C=m.schema,z=l.processors[d.type];if(!z)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${d.type}`);z(n,l,C,b)}const j=n._zod.parent;j&&(m.ref||(m.ref=j),_t(j,l,b),l.seen.get(j).isParent=!0)}const v=l.metadataRegistry.get(n);return v&&ss(m.schema,v),l.io==="input"&&Gt(n)&&(delete m.schema.examples,delete m.schema.default),l.io==="input"&&"_prefault"in m.schema&&((u=m.schema).default??(u.default=m.schema._prefault)),delete m.schema._prefault,l.seen.get(n).schema}function Op(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}function kv(n,l){const r=n.seen.get(l);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(n.external&&n.sharedDefsExtractedFor===n.external)return;const u=new Map;for(const m of n.seen.entries()){const p=n.metadataRegistry.get(m[0])?.id;if(p){const v=u.get(p);if(v&&v!==m[0])throw new Error(`Duplicate schema id "${p}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);u.set(p,m[0])}}const d=m=>{const p=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const j=n.external.registry.get(m[0])?.id,C=n.external.uri??(M=>M);if(j)return{ref:C(j)};const z=m[1].defId??m[1].schema.id??`schema${n.counter++}`;return m[1].defId=z,{defId:z,ref:`${C("__shared")}#/${p}/${Op(z)}`}}const v="#",g=`${v}/${p}/`;if(m[1]===r&&!m[1].schema.id)return{ref:v};const b=m[1].schema.id??`__schema${n.counter++}`;return{defId:b,ref:g+Op(b)}},f=m=>{if(m[1].schema.$ref)return;const p=m[1],{ref:v,defId:g}=d(m);p.def={...p.schema},g&&(p.defId=g);const b=p.schema;for(const j in b)delete b[j];b.$ref=v};if(n.cycles==="throw")for(const m of n.seen.entries()){const p=m[1];if(p.cycle)throw new Error(`Cycle detected: #/${p.cycle?.join("/")}/<root>
63
+ `)}return J.write("payload.value = newResult;"),J.write("return payload;"),J.compile()};let m;const p=kr,v=!Tn.jitless,b=v&&wb.value,j=l.catchall;let C;n._zod.parse=(z,M)=>{C??(C=u.value);const K=z.value;return p(K)?v&&b&&M?.async===!1&&M.jitless!==!0?(m||(m=f(l.shape)),z=m(z,M),j?Nv([],K,z,M,C,n,M?.abortEarly===!0):z):r(z,M):(z.issues.push({expected:"object",code:"invalid_type",input:K,inst:n}),z)}});function gp(n,l,r,u){for(const f of n)if(f.issues.length===0)return l.value=f.value,l;const d=n.filter(f=>!oa(f));return d.length===1?(l.value=d[0].value,d[0]):(l.issues.push({code:"invalid_union",input:l.value,inst:r,errors:n.map(f=>f.issues.map(m=>$a(m,u,Gn())))}),l)}const Xx=q("$ZodUnion",(n,l)=>{ft.init(n,l),Qe(n,"optin",u=>u.def.options.some(d=>d._zod.optin==="defaulted")?"defaulted":u.def.options.some(d=>d._zod.optin!==void 0)?"optional":void 0),Qe(n,"optout",u=>u.def.options.some(d=>d._zod.optout==="optional")?"optional":void 0),Qe(n,"values",u=>{if(u.def.options.every(d=>d._zod.values))return new Set(u.def.options.flatMap(d=>Array.from(d._zod.values)))}),Qe(n,"pattern",u=>{if(u.def.options.every(d=>d._zod.pattern)){const d=u.def.options.map(f=>f._zod.pattern);return new RegExp(`^(${d.map(f=>Bo(f.source)).join("|")})$`)}});const r=l.options.length===1?l.options[0]._zod.run:null;n._zod.parse=(u,d)=>{if(r)return r(u,d);let f=!1;const m=[];for(const p of l.options){const v=p._zod.run({value:u.value,issues:[]},d);if(v instanceof Promise)m.push(v),f=!0;else{if(v.issues.length===0)return v;m.push(v)}}return f?Promise.all(m).then(p=>gp(p,u,n,d)):gp(m,u,n,d)}}),Ix=q("$ZodIntersection",(n,l)=>{ft.init(n,l),n._zod.parse=(r,u)=>{const d=r.value,f=l.left._zod.run({value:d,issues:[]},u),m=l.right._zod.run({value:d,issues:[]},u);return f instanceof Promise||m instanceof Promise?Promise.all([f,m]).then(([v,g])=>yp(r,v,g)):yp(r,f,m)}});function Eo(n,l){if(n===l)return{valid:!0,data:n};if(n instanceof Date&&l instanceof Date&&+n==+l)return{valid:!0,data:n};if(ai(n)&&ai(l)){const r=Object.keys(l),u=Object.keys(n).filter(f=>r.indexOf(f)!==-1),d={...n,...l};Object.prototype.hasOwnProperty.call(d,"__proto__")&&delete d.__proto__;for(const f of u){if(f==="__proto__")continue;const m=Eo(n[f],l[f]);if(!m.valid)return{valid:!1,mergeErrorPath:[f,...m.mergeErrorPath]};d[f]=m.data}return{valid:!0,data:d}}if(Array.isArray(n)&&Array.isArray(l)){if(n.length!==l.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let u=0;u<n.length;u++){const d=n[u],f=l[u],m=Eo(d,f);if(!m.valid)return{valid:!1,mergeErrorPath:[u,...m.mergeErrorPath]};r.push(m.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function yp(n,l,r){const u=new Map;let d;const f=new Map,m=(g,b)=>{let j;if(g.code==="unrecognized_keys"&&!g.path?.length)d??(d=g),j=g.keys;else if(g.code==="invalid_key"&&g.origin==="record"&&g.path?.length===1){const C=String(g.path[0]);f.has(C)||f.set(C,g),j=[C]}else return!1;for(const C of j)u.has(C)||u.set(C,{}),u.get(C)[b]=!0;return!0};for(const g of l.issues)m(g,"l")||n.issues.push(g);for(const g of r.issues)m(g,"r")||n.issues.push(g);const p=[...u].filter(([,g])=>g.l&&g.r).map(([g])=>g);if(p.length){const g=d?p.filter(b=>d.keys.includes(b)):[];g.length&&n.issues.push({...d,keys:g});for(const b of p)!g.includes(b)&&f.has(b)&&n.issues.push(f.get(b))}const v=Eo(l.value,r.value);if(!v.valid){if(oa(n))return n;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(v.mergeErrorPath)}`)}return n.value=v.data,n}const Px=q("$ZodRecord",(n,l)=>{ft.init(n,l);const r=Tn.memoizer;r?.attach(n),n._zod.parse=(u,d)=>{const f=u.value;if(!ai(f))return u.issues.push({expected:"record",code:"invalid_type",input:f,inst:n}),u;const m=[],p=l.keyType._zod.values;if(p&&!l.partial){u.value=r?r.alloc(n,u,{},d):{};const v=new Set;for(const b of p)if(typeof b=="string"||typeof b=="number"||typeof b=="symbol"){if(v.add(typeof b=="number"?b.toString():b),b==="__proto__")continue;const j=l.keyType._zod.run({value:b,issues:[]},d);if(j instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(j.issues.length){u.issues.push({code:"invalid_key",origin:"record",issues:j.issues.map(M=>$a(M,d,Gn())),input:b,path:[b],inst:n});continue}const C=j.value;if(C==="__proto__")continue;const z=l.valueType._zod.run({value:f[b],issues:[]},d);z instanceof Promise?m.push(z.then(M=>{M.issues.length&&u.issues.push(...ti(b,M.issues)),u.value[C]=M.value})):(z.issues.length&&u.issues.push(...ti(b,z.issues)),u.value[C]=z.value)}let g;for(const b in f)if(!v.has(b))if(l.mode==="loose"){if(b==="__proto__")continue;u.value[b]=f[b]}else g=g??[],g.push(b);g&&g.length>0&&u.issues.push({code:"unrecognized_keys",input:f,inst:n,keys:g,continue:!0})}else{u.value=r?r.alloc(n,u,{},d):{};let v;for(const g of Reflect.ownKeys(f)){if(g==="__proto__"||!Object.prototype.propertyIsEnumerable.call(f,g))continue;let b=l.keyType._zod.run({value:g,issues:[]},d);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof g=="string"&&Vo.test(g)&&b.issues.length){const M=l.keyType._zod.run({value:Number(g),issues:[]},d);if(M instanceof Promise)throw new Error("Async schemas not supported in object keys currently");M.issues.length===0&&(b=M)}if(b.issues.length){l.mode==="loose"?u.value[g]=f[g]:p?(v=v??[],v.push(g)):u.issues.push({code:"invalid_key",origin:"record",issues:b.issues.map(M=>$a(M,d,Gn())),input:g,path:[g],inst:n});continue}const C=b.value;if(C==="__proto__")continue;const z=l.valueType._zod.run({value:f[g],issues:[]},d);z instanceof Promise?m.push(z.then(M=>{M.issues.length&&u.issues.push(...ti(g,M.issues)),u.value[C]=M.value})):(z.issues.length&&u.issues.push(...ti(g,z.issues)),u.value[C]=z.value)}v&&v.length>0&&u.issues.push({code:"unrecognized_keys",input:f,inst:n,keys:v,continue:!0})}return m.length?Promise.all(m).then(()=>u):u}}),Fx=q("$ZodEnum",(n,l)=>{ft.init(n,l);const r=No(l.entries),u=new Set(r);n._zod.values=u,Qe(n,"pattern",d=>{const f=No(d.def.entries).filter(m=>Ob.has(typeof m));return new RegExp(f.length?`^(${f.map(m=>Lr(m.toString())).join("|")})$`:"^[^\\s\\S]$")}),n._zod.parse=(d,f)=>{const m=d.value;return u.has(m)||d.issues.push({code:"invalid_value",values:r,input:m,inst:n}),d}}),Wx=q("$ZodTransform",(n,l)=>{ft.init(n,l),n._zod.optin="optional",Tn.memoizer?.guard(n),n._zod.parse=(r,u)=>{if(u.direction==="backward")throw new ov(n.constructor.name);const d=l.transform(r.value,r);if(u.async)return(d instanceof Promise?d:Promise.resolve(d)).then(m=>(r.value=m,r));if(d instanceof Promise)throw new ml;return r.value=d,r}});function bp(n,l){return n.value=l.issues.length?void 0:l.value,n}const Av=q("$ZodOptional",(n,l)=>{ft.init(n,l),Qe(n,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),n._zod.optout="optional",Qe(n,"values",r=>{const u=r.def.innerType._zod.values;return u?new Set([...u,void 0]):void 0}),Qe(n,"pattern",r=>{const u=r.def.innerType._zod.pattern;return u?new RegExp(`^(${Bo(u.source)})?$`):void 0}),n._zod.parse=(r,u)=>{if(r.value===void 0){if(l.innerType._zod.optin!=="defaulted")return r;const d=l.innerType._zod.run({value:r.value,issues:[]},u);return d instanceof Promise?d.then(f=>bp(r,f)):bp(r,d)}return l.innerType._zod.run(r,u)}}),e0=q("$ZodExactOptional",(n,l)=>{Av.init(n,l),Qe(n,"values",r=>r.def.innerType._zod.values),Qe(n,"pattern",r=>r.def.innerType._zod.pattern),n._zod.parse=(r,u)=>l.innerType._zod.run(r,u)}),t0=q("$ZodNullable",(n,l)=>{ft.init(n,l),Qe(n,"optin",r=>r.def.innerType._zod.optin),Qe(n,"optout",r=>r.def.innerType._zod.optout),Qe(n,"pattern",r=>{const u=r.def.innerType._zod.pattern;return u?new RegExp(`^(${Bo(u.source)}|null)$`):void 0}),Qe(n,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),n._zod.parse=(r,u)=>r.value===null?r:l.innerType._zod.run(r,u)}),n0=q("$ZodDefault",(n,l)=>{ft.init(n,l),n._zod.optin="defaulted",Qe(n,"values",r=>r.def.innerType._zod.values),n._zod.parse=(r,u)=>{if(u.direction==="backward")return l.innerType._zod.run(r,u);if(r.value===void 0)return r.value=l.defaultValue,r;const d=l.innerType._zod.run(r,u);return d instanceof Promise?d.then(f=>jp(f,l)):jp(d,l)}});function jp(n,l){return n.value===void 0&&(n.value=l.defaultValue),n}const a0=q("$ZodPrefault",(n,l)=>{ft.init(n,l),n._zod.optin="defaulted",Qe(n,"values",r=>r.def.innerType._zod.values),n._zod.parse=(r,u)=>(u.direction==="backward"||r.value===void 0&&(r.value=l.defaultValue),l.innerType._zod.run(r,u))}),l0=q("$ZodNonOptional",(n,l)=>{ft.init(n,l),Qe(n,"values",r=>{const u=r.def.innerType._zod.values;return u?new Set([...u].filter(d=>d!==void 0)):void 0}),n._zod.parse=(r,u)=>{const d=l.innerType._zod.run(r,u);return d instanceof Promise?d.then(f=>xp(f,n)):xp(d,n)}});function xp(n,l){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:l}),n}function Sp(n,l,r,u){return l.issues.length?(n.value=r.catchValue({...l,value:n.value,error:{issues:l.issues.map(d=>$a(d,u,Gn()))},input:n.value}),n):(n.value=l.value,l.memo&&(n.memo=!0),n)}const i0=q("$ZodCatch",(n,l)=>{ft.init(n,l),Qe(n,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Qe(n,"optout",r=>r.def.innerType._zod.optout),Qe(n,"values",r=>r.def.innerType._zod.values),n._zod.parse=(r,u)=>{if(u.direction==="backward")return l.innerType._zod.run(r,u);const d=l.innerType._zod.run({value:r.value,issues:[]},u);return d instanceof Promise?d.then(f=>Sp(r,f,l,u)):Sp(r,d,l,u)}}),s0=q("$ZodPipe",(n,l)=>{ft.init(n,l),Qe(n,"values",r=>r.def.in._zod.values),Qe(n,"optin",r=>r.def.in._zod.optin),Qe(n,"optout",r=>r.def.out._zod.optout),Qe(n,"propValues",r=>r.def.in._zod.propValues),n._zod.parse=(r,u)=>{if(u.direction==="backward"){const f=l.out._zod.run(r,u);return f instanceof Promise?f.then(m=>Ar(m,l.in,u)):Ar(f,l.in,u)}const d=l.in._zod.run(r,u);return d instanceof Promise?d.then(f=>Ar(f,l.out,u)):Ar(d,l.out,u)}});function Ar(n,l,r){return n.issues.some(u=>u.code!=="unrecognized_keys")?(n.aborted=!0,n):l._zod.run({value:n.value,issues:n.issues},r)}const r0=q("$ZodReadonly",(n,l)=>{ft.init(n,l),Qe(n,"propValues",r=>r.def.innerType._zod.propValues),Qe(n,"values",r=>r.def.innerType._zod.values),Qe(n,"optin",r=>r.def.innerType?._zod?.optin),Qe(n,"optout",r=>r.def.innerType?._zod?.optout),n._zod.parse=(r,u)=>{if(u.direction==="backward")return l.innerType._zod.run(r,u);const d=l.innerType._zod.run(r,u);return d instanceof Promise?d.then(_p):_p(d)}});function _p(n){return n.memo||(n.value=Object.freeze(n.value)),n}const c0=q("$ZodCustom",(n,l)=>{Wt.init(n,l),ft.init(n,l),n._zod.parse=(r,u)=>r,n._zod.check=r=>{const u=r.value,d=l.fn(u);if(d instanceof Promise)return d.then(f=>Np(f,r,u,n));Np(d,r,u,n)}});function Np(n,l,r,u){if(!n){const d={code:"custom",input:r,inst:u,path:[...u._zod.def.path??[]],continue:!u._zod.def.abort};u._zod.def.params&&(d.params=u._zod.def.params),l.issues.push(rs(d))}}class u0 extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const wo="~memo",Ap=[];function Cv(n){return n!==null&&typeof n=="object"}function go(n){return n.map(l=>l.path?{...l,path:l.path.slice()}:{...l})}const zv=new WeakMap,as=0,Or=1,is=2;function Tr(n,l,r){const u=zv.get(n);if(u!==void 0)return u?is:as;if(l.has(n))return is;l.add(n);let d=as;const f=b=>{if(d!==is&&b?._zod){const j=Tr(b,l);j>d&&(d=j)}},m=(b,j)=>{let C=as;for(const z of Reflect.ownKeys(b)){const M=Object.getOwnPropertyDescriptor(b,z);if(!M.enumerable)continue;const K=M.get?Or:M.value?._zod?Tr(M.value,l):as;K>C&&(C=K)}return C},p=b=>{b>d&&(d=b)},v=n._zod.def;switch(v.type){case"object":{const b=ev(v);p(b?m(b):Or),f(v.catchall);break}case"array":f(v.element);break;case"tuple":for(const b of v.items)f(b);f(v.rest);break;case"record":case"map":f(v.keyType),f(v.valueType);break;case"set":f(v.valueType);break;case"union":for(const b of v.options)f(b);break;case"intersection":f(v.left),f(v.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":f(v.innerType);break;case"pipe":f(v.in),f(v.out);break;case"function":f(v.input),f(v.output);break;case"lazy":{const b=v._cachedInner??void 0;p(b?Tr(b,l):Or);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const b in v){const j=Object.getOwnPropertyDescriptor(v,b);if(!j||j.get)continue;const C=j.value;if(!(!C||typeof C!="object")){if(C._zod)f(C);else if(Array.isArray(C))for(const z of C)f(z)}}}return l.delete(n),o0(n,d)}function o0(n,l){return l!==Or&&zv.set(n,l===is),l}function d0(n,l){let r=n.buckets.get(l);return r||(r=new WeakMap,n.buckets.set(l,r)),r}let Cr;const zr=[],f0={alloc(n,l,r){const u=Cr;if(!u)return r;Cr=void 0;const d={value:r,issues:null};return u.set(l.value,d),zr.push(d),r},guard(n){var l;(l=n._zod).deferred??(l.deferred=[]),n._zod.deferred.push(()=>{const r=n._zod.parse,u=(d,f)=>{if(f.direction!=="backward"&&m0(f,d.value))throw new u0;return r(d,f)};n._zod.parse=u,n._zod.run===r&&(n._zod.run=u)})},attach(n){var l;let r,u=!1,d,f;(l=n._zod).deferred??(l.deferred=[]),n._zod.deferred.push(()=>{const m=n._zod.parse,p=(v,g)=>{if(r===void 0){const I=Tr(n,new Set);if(I===as)return n._zod.parse=m,n._zod.run===p&&(n._zod.run=m),m(v,g);I===is||u?r=!0:u=!0}const b=v.value;if(!Cv(b))return m(v,g);let j=g[wo];j||(j={buckets:new WeakMap,backEdges:void 0},g[wo]=j);let C;d===g?C=f:(C=d0(j,n),d=g,f=C);const z=C.get(b);if(z)return v.value=z.value,z.issues?z.issues.length&&v.issues.push(...go(z.issues)):(v.memo=!0,j.backEdges??(j.backEdges=new WeakSet),j.backEdges.add(z.value)),v;Cr=C;const M=zr.length,K=m(v,g);Cr=void 0;const J=zr.length>M?zr.pop():void 0;return K instanceof Promise?K.then(I=>(J&&(J.issues=I.issues.length?go(I.issues):Ap),I)):(J&&(J.issues=K.issues.length?go(K.issues):Ap),K)};n._zod.parse=p,n._zod.run===m&&(n._zod.run=p)})}};function h0(){return f0}function m0(n,l){const r=n[wo]?.backEdges;return r!==void 0&&Cv(l)&&r.has(l)}const p0=()=>{const n={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function l(f){return n[f]??null}const r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},u={nan:"NaN"};function d(f,m){return f==="number"&&typeof m=="number"&&!Number.isFinite(m)?String(m):u[f]??f}return f=>{switch(f.code){case"invalid_type":{const m=d(f.expected),p=Bb(f.input),v=d(p,f.input);return`Invalid input: expected ${m}, received ${v}`}case"invalid_value":return f.values.length===1?`Invalid input: expected ${iv(f.values[0])}`:`Invalid option: expected one of ${cp(f.values,"|")}`;case"too_big":{const m=f.exact?"exactly ":f.inclusive?"<=":"<",p=l(f.origin);return p?`Too big: expected ${f.origin??"value"} to have ${m}${f.maximum.toString()} ${p.unit??"elements"}`:`Too big: expected ${f.origin??"value"} to be ${m}${f.maximum.toString()}`}case"too_small":{const m=f.exact?"exactly ":f.inclusive?">=":">",p=l(f.origin);return p?`Too small: expected ${f.origin} to have ${m}${f.minimum.toString()} ${p.unit}`:`Too small: expected ${f.origin} to be ${m}${f.minimum.toString()}`}case"invalid_format":{const m=f;return m.format==="starts_with"?`Invalid string: must start with "${m.prefix}"`:m.format==="ends_with"?`Invalid string: must end with "${m.suffix}"`:m.format==="includes"?`Invalid string: must include "${m.includes}"`:m.format==="regex"?`Invalid string: must match pattern ${m.pattern}`:`Invalid ${r[m.format]??f.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${f.divisor}`;case"unrecognized_keys":return`Unrecognized key${f.keys.length>1?"s":""}: ${cp(f.keys,", ")}`;case"invalid_key":return`Invalid key in ${f.origin}`;case"invalid_union":return f.options&&Array.isArray(f.options)&&f.options.length>0?`Invalid discriminator value. Expected ${f.options.map(p=>`'${p}'`).join(" | ")}`:f.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${f.origin}`;default:return"Invalid input"}}};function v0(){return{localeError:p0()}}var Cp;class g0{constructor(){this._map=new WeakMap,this._idmap=new Map}add(l,...r){const u=r[0];return this._map.set(l,u),u&&typeof u=="object"&&"id"in u&&this._idmap.set(u.id,l),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(l){const r=this._map.get(l);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(l),this}get(l){const r=l._zod.parent;if(r){const u={...this.get(r)??{}};delete u.id;const d={...u,...this._map.get(l)};return Object.keys(d).length?d:void 0}return this._map.get(l)}has(l){return this._map.has(l)}}function y0(){return new g0}(Cp=globalThis).__zod_globalRegistry??(Cp.__zod_globalRegistry=y0());const ls=globalThis.__zod_globalRegistry;function Ev(n){return n.checks&&(n.checks=[...n.checks]),n}function b0(n,l){return new n(Ev({type:"string",...ge(l)}))}function j0(n,l){return new n({type:"string",format:"email",check:"string_format",abort:!1,...ge(l)})}function x0(n,l){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...ge(l)})}function S0(n,l){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...ge(l)})}function _0(n,l){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ge(l)})}function N0(n,l){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ge(l)})}function A0(n,l){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ge(l)})}function C0(n,l){return new n({type:"string",format:"url",check:"string_format",abort:!1,...ge(l)})}function z0(n,l){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...ge(l)})}function E0(n,l){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...ge(l)})}function w0(n,l){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...ge(l)})}function O0(n,l){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...ge(l)})}function T0(n,l){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...ge(l)})}function k0(n,l){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...ge(l)})}function R0(n,l){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...ge(l)})}function M0(n,l){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...ge(l)})}function D0(n,l){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...ge(l)})}function U0(n,l){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ge(l)})}function Z0(n,l){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ge(l)})}function H0(n,l){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...ge(l)})}function $0(n,l){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...ge(l)})}function L0(n,l){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...ge(l)})}function B0(n,l){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...ge(l)})}function q0(n,l){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ge(l)})}function G0(n,l){return new n({type:"string",format:"date",check:"string_format",...ge(l)})}function Y0(n,l){return new n({type:"string",format:"time",check:"string_format",precision:null,...ge(l)})}function J0(n,l){return new n({type:"string",format:"duration",check:"string_format",...ge(l)})}function K0(n,l){return new n(Ev({type:"number",checks:[],...ge(l)}))}function Q0(n,l){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...ge(l)})}function V0(n,l){return new n({type:"boolean",...ge(l)})}function X0(n){return new n({type:"unknown"})}function I0(n,l){return new n({type:"never",...ge(l)})}function zp(n,l){return new hv({check:"less_than",...ge(l),value:n,inclusive:!1})}function yo(n,l){return new hv({check:"less_than",...ge(l),value:n,inclusive:!0})}function Ep(n,l){return new mv({check:"greater_than",...ge(l),value:n,inclusive:!1})}function bo(n,l){return new mv({check:"greater_than",...ge(l),value:n,inclusive:!0})}function wp(n,l){return new Kj({check:"multiple_of",...ge(l),value:n})}function wv(n,l){return new Vj({check:"max_length",...ge(l),maximum:n})}function Ur(n,l){return new Xj({check:"min_length",...ge(l),minimum:n})}function Ov(n,l){return new Ij({check:"length_equals",...ge(l),length:n})}function P0(n,l){return new Pj({check:"string_format",format:"regex",...ge(l),pattern:n})}function F0(n){return new Fj({check:"string_format",format:"lowercase",...ge(n)})}function W0(n){return new Wj({check:"string_format",format:"uppercase",...ge(n)})}function eS(n,l){return new ex({check:"string_format",format:"includes",...ge(l),includes:n})}function tS(n,l){return new tx({check:"string_format",format:"starts_with",...ge(l),prefix:n})}function nS(n,l){return new nx({check:"string_format",format:"ends_with",...ge(l),suffix:n})}function ri(n){return new ax({check:"overwrite",tx:n})}function aS(n){return ri(l=>l.normalize(n))}function lS(){return ri(n=>n.trim())}function iS(){return ri(n=>n.toLowerCase())}function sS(){return ri(n=>n.toUpperCase())}function rS(){return ri(n=>Eb(n))}function cS(n,l,r){return new n({type:"array",element:l,...ge(r)})}function uS(n,l,r){return new n({type:"custom",check:"custom",fn:l,...ge(r)})}function oS(n,l){const r=dS(u=>(u.addIssue=d=>{if(typeof d=="string")u.issues.push(rs(d,u.value,r._zod.def));else{const f=d;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),"input"in f||(f.input=u.value),f.inst??(f.inst=r),f.continue??(f.continue=!r._zod.def.abort),u.issues.push(rs(f))}},n(u.value,u)),l);return r}function dS(n,l){const r=new Wt({check:"custom",...ge(l)});return r._zod.check=n,r}function ss(n,...l){for(const r of l)for(const u of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,u)&&Ba(n,u,r[u]);return n}function Tv(n){let l=n?.target??"draft-2020-12";return l==="draft-4"&&(l="draft-04"),l==="draft-7"&&(l="draft-07"),{processors:n.processors??{},metadataRegistry:n?.metadata??ls,target:l,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:n?.cycles??"ref",reused:n?.reused??"inline",intersections:[],deferred:[],external:n?.external??void 0}}function ci(n,l,r,u,d){const f=typeof l.unrepresentable=="function"?l.unrepresentable({zodSchema:n,path:u.path,message:d}):l.unrepresentable;if(f==="any")return!1;if(f===void 0||f==="throw")throw new Error(d);return Object.assign(r,f),!0}function _t(n,l,r={path:[],schemaPath:[]}){var u;const d=n._zod.def,f=l.seen.get(n);if(f)return f.count++,r.schemaPath.includes(n)&&(f.cycle=r.path),f.schema;const m={schema:{},count:1,cycle:void 0,path:r.path};l.seen.set(n,m),l.sharedDefsExtractedFor=void 0,l.sharedEmitDoneFor=void 0;const p=n._zod.toJSONSchema?.();if(p)m.schema=p;else{const b={...r,schemaPath:[...r.schemaPath,n],path:r.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(l,m.schema,b);else{const C=m.schema,z=l.processors[d.type];if(!z)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${d.type}`);z(n,l,C,b)}const j=n._zod.parent;j&&(m.ref||(m.ref=j),_t(j,l,b),l.seen.get(j).isParent=!0)}const v=l.metadataRegistry.get(n);return v&&ss(m.schema,v),l.io==="input"&&Gt(n)&&(delete m.schema.examples,delete m.schema.default),l.io==="input"&&"_prefault"in m.schema&&((u=m.schema).default??(u.default=m.schema._prefault)),delete m.schema._prefault,l.seen.get(n).schema}function Op(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}function kv(n,l){const r=n.seen.get(l);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(n.external&&n.sharedDefsExtractedFor===n.external)return;const u=new Map;for(const m of n.seen.entries()){const p=n.metadataRegistry.get(m[0])?.id;if(p){const v=u.get(p);if(v&&v!==m[0])throw new Error(`Duplicate schema id "${p}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);u.set(p,m[0])}}const d=m=>{const p=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const j=n.external.registry.get(m[0])?.id,C=n.external.uri??(M=>M);if(j)return{ref:C(j)};const z=m[1].defId??m[1].schema.id??`schema${n.counter++}`;return m[1].defId=z,{defId:z,ref:`${C("__shared")}#/${p}/${Op(z)}`}}const v="#",g=`${v}/${p}/`;if(m[1]===r&&!m[1].schema.id)return{ref:v};const b=m[1].schema.id??`__schema${n.counter++}`;return{defId:b,ref:g+Op(b)}},f=m=>{if(m[1].schema.$ref)return;const p=m[1],{ref:v,defId:g}=d(m);p.def={...p.schema},g&&(p.defId=g);const b=p.schema;for(const j in b)delete b[j];b.$ref=v};if(n.cycles==="throw")for(const m of n.seen.entries()){const p=m[1];if(p.cycle)throw new Error(`Cycle detected: #/${p.cycle?.join("/")}/<root>
64
64
 
65
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const m of n.seen.entries()){const p=m[1];if(l===m[0]){f(m);continue}if(n.external){const g=n.external.registry.get(m[0])?.id;if(l!==m[0]&&g){f(m);continue}}if(n.metadataRegistry.get(m[0])?.id){f(m);continue}if(p.cycle){f(m);continue}p.count>1&&n.reused==="ref"&&f(m)}n.external&&(n.sharedDefsExtractedFor=n.external)}function Rv(n){const l=n.anyOf;if(!Array.isArray(l)||l.length===0||n.type!==void 0)return;const r=[];for(const u of l){if(!u||typeof u!="object")return;Rv(u);const d=Object.keys(u);if(d.length!==1||d[0]!=="type")return;const f=u.type;for(const m of Array.isArray(f)?f:[f]){if(typeof m!="string")return;r.includes(m)||r.push(m)}}delete n.anyOf,n.type=r.length===1?r[0]:r}const Mv=new Set(["type","properties","required","additionalProperties"]),Tp=["oneOf","anyOf"];function kp(n){const l=n.additionalProperties;return l===void 0||l===!1||typeof l!="object"||l===null?null:Object.keys(l).length?l:null}function Oo(n){const l=[];for(const f of n){if(typeof f!="object"||f.type!=="object")return null;for(const m in f)if(!Mv.has(m))return null;l.push(f)}const r={},u=new Set;for(const f of l){for(const m in f.properties){if(Object.prototype.hasOwnProperty.call(r,m))continue;const p=[];for(const g of l){const b=g.properties?.[m]??kp(g);b!=null&&(p.some(j=>JSON.stringify(j)===JSON.stringify(b))||p.push(b))}const v=p.length===1?p[0]:Oo(p)??{allOf:p};Ba(r,m,v)}for(const m of f.required??[])u.add(m)}const d={type:"object",properties:r};if(u.size&&(d.required=[...u]),l.every(f=>f.additionalProperties===!1))d.additionalProperties=!1;else{const f=[];for(const m of l){const p=kp(m);p&&!f.some(v=>JSON.stringify(v)===JSON.stringify(p))&&f.push(p)}f.length===1?d.additionalProperties=f[0]:f.length>1&&(d.additionalProperties={allOf:f})}return d}function fS(n){const l=n.allOf;if(!Array.isArray(l)||l.length<2)return;for(const d of Mv)if(d in n)return;const r=l.filter(d=>Tp.some(f=>Array.isArray(d[f])));let u=null;if(!r.length)u=Oo(l);else{const d=r[0],f=Tp.find(v=>Array.isArray(d[v]));if(Object.keys(d).length!==1)return;const m=l.filter(v=>v!==d),p=d[f].map(v=>Oo([...m,v]));if(p.some(v=>!v))return;u={[f]:p}}u&&(delete n.allOf,ss(n,u))}function Dv(n,l){const r=n.seen.get(l);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const u=p=>{const v=n.seen.get(p);if(v.ref===null)return;const g=v.def??v.schema,b={...g},j=v.ref;if(v.ref=null,j){u(j);const z=n.seen.get(j),M=z.schema;if(M.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(M)):ss(g,M),ss(g,b),p._zod.parent===j)for(const J in g)J==="$ref"||J==="allOf"||J in b||delete g[J];if(M.$ref&&z.def)for(const J in g)J==="$ref"||J==="allOf"||J in z.def&&JSON.stringify(g[J])===JSON.stringify(z.def[J])&&delete g[J]}const C=p._zod.parent;if(C&&C!==j){u(C);const z=n.seen.get(C);if(z?.schema.$ref&&(g.$ref=z.schema.$ref,z.def))for(const M in g)M==="$ref"||M==="allOf"||M in z.def&&JSON.stringify(g[M])===JSON.stringify(z.def[M])&&delete g[M]}n.override({zodSchema:p,jsonSchema:g,path:v.path??[]})};if(!n.external||n.sharedEmitDoneFor!==n.external){for(const p of[...n.seen.entries()].reverse())u(p[0]);if(n.target!=="openapi-3.0")for(const p of n.seen.entries())Rv(p[1].def??p[1].schema);for(const p of n.deferred)p();if(n.intersections.length){const p=new Map;for(const v of n.seen.values())for(const g of[v.schema,v.def]){const b=g?.allOf;if(!Array.isArray(b))continue;const j=p.get(b);j?j.push(g):p.set(b,[g])}for(const v of n.intersections)for(const g of p.get(v)??[])fS(g)}}const d={};if(n.target==="draft-2020-12"?d.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?d.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?d.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){const p=n.external.registry.get(l)?.id;if(!p)throw new Error("Schema is missing an `id` property");d.$id=n.external.uri(p)}ss(d,r.defId?r.schema:r.def??r.schema);const f=n.metadataRegistry.get(l)?.id;f!==void 0&&d.id===f&&delete d.id;const m=n.external?.defs??{};if(!n.external||n.sharedEmitDoneFor!==n.external)for(const p of n.seen.entries()){const v=p[1];v.def&&v.defId&&(v.def.id===v.defId&&delete v.def.id,Ba(m,v.defId,v.def))}n.external&&(n.sharedEmitDoneFor=n.external),n.external||Object.keys(m).length>0&&(n.target==="draft-2020-12"?d.$defs=m:d.definitions=m);try{const p=JSON.parse(JSON.stringify(d));return Object.defineProperty(p,"~standard",{value:{...l["~standard"],jsonSchema:{input:Zr(l,"input",n.processors),output:Zr(l,"output",n.processors)}},enumerable:!1,writable:!1}),p}catch{throw new Error("Error converting schema to JSON.")}}function Gt(n,l){const r=l??{seen:new Set};if(r.seen.has(n))return!1;r.seen.add(n);const u=n._zod.def;if(u.type==="transform")return!0;if(u.type==="array")return Gt(u.element,r);if(u.type==="set")return Gt(u.valueType,r);if(u.type==="lazy")return Gt(u.getter(),r);if(u.type==="promise"||u.type==="optional"||u.type==="nonoptional"||u.type==="nullable"||u.type==="readonly"||u.type==="default"||u.type==="prefault"||u.type==="catch")return Gt(u.innerType,r);if(u.type==="intersection")return Gt(u.left,r)||Gt(u.right,r);if(u.type==="record"||u.type==="map")return Gt(u.keyType,r)||Gt(u.valueType,r);if(u.type==="pipe")return n._zod.traits.has("$ZodCodec")?!0:Gt(u.in,r)||Gt(u.out,r);if(u.type==="object"){for(const d in u.shape)if(Gt(u.shape[d],r))return!0;return!1}if(u.type==="union"){for(const d of u.options)if(Gt(d,r))return!0;return!1}if(u.type==="tuple"){for(const d of u.items)if(Gt(d,r))return!0;return!!(u.rest&&Gt(u.rest,r))}return!1}const hS=(n,l={})=>r=>{const u=Tv({...r,processors:l});return _t(n,u),kv(u,n),Dv(u,n)},Zr=(n,l,r={})=>u=>{const{libraryOptions:d,target:f}=u??{},m=Tv({...d??{},target:f,io:l,processors:r});return _t(n,m),kv(m,n),Dv(m,n)},li=(n,l,r)=>{(n[l]===void 0||r>n[l])&&(n[l]=r)},ii=(n,l,r)=>{(n[l]===void 0||r<n[l])&&(n[l]=r)},Rp=(n,l)=>{li(n,"minimum",l),ii(n,"maximum",l)},Uv=(n,l)=>{n.multipleOf??(n.multipleOf=[]),n.multipleOf.includes(l)||n.multipleOf.push(l)},Zv=(n,l)=>{n.patterns??(n.patterns=new Set),n.patterns.add(l)},Hv=(n,l)=>{n.mime=n.mime?n.mime.filter(r=>l.includes(r)):[...l]},$v=(n,l)=>{n.format=l,l.includes("int")&&(n.isInt=!0)},Mp=(n,l)=>li(n,"minimum",l.minimum),Dp=(n,l)=>ii(n,"maximum",l.maximum),Up=n=>(l,r)=>{$v(l,r.format);const[u,d]=n[r.format];li(l,"minimum",u),ii(l,"maximum",d)},mS={greater_than:(n,l)=>li(n,l.inclusive?"minimum":"exclusiveMinimum",l.value),less_than:(n,l)=>ii(n,l.inclusive?"maximum":"exclusiveMaximum",l.value),multiple_of:(n,l)=>Uv(n,l.value),number_format:Up(sv),bigint_format:Up(kb),min_length:Mp,max_length:Dp,length_equals:(n,l)=>Rp(n,l.length),min_size:Mp,max_size:Dp,size_equals:(n,l)=>Rp(n,l.size),string_format:(n,l)=>{$v(n,l.format),l.pattern&&Zv(n,l.pattern),(l.format==="base64"||l.format==="base64url")&&(n.contentEncoding=l.format),(l.local||l.precision===-1)&&(n.laxFormat=!0)},mime_type:(n,l)=>Hv(n,l.mime)};function On(n){const l={},r=n._zod.def,u=n._zod.traits.has("$ZodCheck")?[n,...r.checks??[]]:r.checks??[];for(const f of u)mS[f._zod.def.check]?.(l,f._zod.def);const d=n._zod.bag;d.minimum!==void 0&&li(l,"minimum",d.minimum),d.exclusiveMinimum!==void 0&&li(l,"exclusiveMinimum",d.exclusiveMinimum),d.maximum!==void 0&&ii(l,"maximum",d.maximum),d.exclusiveMaximum!==void 0&&ii(l,"exclusiveMaximum",d.exclusiveMaximum),d.multipleOf!==void 0&&Uv(l,d.multipleOf),d.format!==void 0&&(l.format??(l.format=d.format),d.format.includes("int")&&(l.isInt=!0)),d.mime&&Hv(l,d.mime);for(const f of d.patterns??[])Zv(l,f);return l}const pS={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},vS=new Map([[xv,Rj],[Po,Mj]]),Lv=n=>vS.get(n)??n,gS=(n,l,r,u)=>{const d=r;d.type="string";const{minimum:f,maximum:m,format:p,patterns:v,contentEncoding:g,laxFormat:b}=On(n);if(typeof f=="number"&&(d.minLength=f),typeof m=="number"&&(d.maxLength=m),p&&(d.format=pS[p]??p,d.format===""&&delete d.format,(p==="time"||b)&&delete d.format),g&&(d.contentEncoding=g),v&&v.size>0){const j=[...v].map(Lv);j.length===1?d.pattern=j[0].source:j.length>1&&(d.allOf=[...j.map(C=>({...l.target==="draft-07"||l.target==="draft-04"||l.target==="openapi-3.0"?{type:"string"}:{},pattern:C.source}))])}},yS=(n,l,r,u)=>{const d=r,{minimum:f,maximum:m,multipleOf:p,exclusiveMaximum:v,exclusiveMinimum:g,isInt:b}=On(n);d.type=b?"integer":"number";const j=typeof g=="number"&&g>=(f??Number.NEGATIVE_INFINITY),C=typeof v=="number"&&v<=(m??Number.POSITIVE_INFINITY),z=l.target==="draft-04"||l.target==="openapi-3.0";if(j?z?(d.minimum=g,d.exclusiveMinimum=!0):d.exclusiveMinimum=g:typeof f=="number"&&(d.minimum=f),C?z?(d.maximum=v,d.exclusiveMaximum=!0):d.exclusiveMaximum=v:typeof m=="number"&&(d.maximum=m),p){const M=new Set;for(const I of p)Number.isFinite(I)&&I!==0?M.add(Math.abs(I)):ci(n,l,d,u,`A multipleOf divisor of ${I} cannot be represented in JSON Schema`);const[K,...J]=M;K!==void 0&&(d.multipleOf=K),J.length&&(d.allOf=[...d.allOf??[],...J.map(I=>({multipleOf:I}))])}},bS=(n,l,r,u)=>{r.type="boolean"},jS=(n,l,r,u)=>{r.not={}},xS=(n,l,r,u)=>{},SS=(n,l,r,u)=>{const d=n._zod.def,f=No(d.entries);if(f.length===0){r.not={};return}f.every(m=>typeof m=="number")&&(r.type="number"),f.every(m=>typeof m=="string")&&(r.type="string"),r.enum=f},_S=(n,l,r,u)=>{ci(n,l,r,u,"Custom types cannot be represented in JSON Schema")},NS=(n,l,r,u)=>{ci(n,l,r,u,"Transforms cannot be represented in JSON Schema")},AS=(n,l,r,u)=>{const d=r,f=n._zod.def,{minimum:m,maximum:p}=On(n);typeof m=="number"&&(d.minItems=m),typeof p=="number"&&(d.maxItems=p),d.type="array",d.items=_t(f.element,l,{...u,path:[...u.path,"items"]})};function Hr(n){const l=n._zod.def;return l.type==="pipe"&&l.in._zod.traits.has("$ZodTransform")?Hr(l.out):l.type==="catch"?Hr(l.innerType):n._zod.optin}const CS=(n,l,r,u)=>{const d=r,f=n._zod.def,m=f.shape;if(Object.getOwnPropertySymbols(m).length&&ci(n,l,d,u,"Symbol keys cannot be represented in JSON Schema"))return;d.type="object",d.properties={};for(const g in m)Ba(d.properties,g,_t(m[g],l,{...u,path:[...u.path,"properties",g]}));const v=[];for(const g of Object.keys(m)){const b=f.shape[g];(l.io==="input"?Hr(b)===void 0:b._zod.optout===void 0)&&v.push(g)}v.length>0&&(d.required=v),f.catchall?._zod.def.type==="never"?d.additionalProperties=!1:f.catchall?f.catchall&&(d.additionalProperties=_t(f.catchall,l,{...u,path:[...u.path,"additionalProperties"]})):l.io==="output"&&(d.additionalProperties=!1)},zS=(n,l,r,u)=>{const d=n._zod.def,f=d.inclusive===!1,m=d.options.map((p,v)=>_t(p,l,{...u,path:[...u.path,f?"oneOf":"anyOf",v]}));f?r.oneOf=m:r.anyOf=m},ES=(n,l,r,u)=>{const d=n._zod.def,f=_t(d.left,l,{...u,path:[...u.path,"allOf",0]}),m=_t(d.right,l,{...u,path:[...u.path,"allOf",1]}),p=g=>"allOf"in g&&Object.keys(g).length===1,v=[...p(f)?f.allOf:[f],...p(m)?m.allOf:[m]];r.allOf=v,l.intersections.push(v)};function To(n,l,r){if(l.$ref){if(r.has(l))return l;r.add(l);const M=n.get(l)?.def;if(!M)return l;const K=To(n,M,r);return K===M?l:K}for(const M of["anyOf","oneOf"]){const K=l[M];if(!Array.isArray(K))continue;const J=K.map(I=>To(n,I,r));J.some((I,ie)=>I!==K[ie])&&(l={...l,[M]:J})}const u=Array.isArray(l.type)?l.type:[l.type],d=!u.includes("string")&&u.some(M=>M==="number"||M==="integer"),f=l.enum??(l.const!==void 0?[l.const]:void 0);if(!d&&!f?.some(M=>typeof M=="number"))return l;const{minimum:m,maximum:p,exclusiveMinimum:v,exclusiveMaximum:g,multipleOf:b,format:j,id:C,...z}=l;return z.enum?z.enum=z.enum.map(M=>typeof M=="number"?String(M):M):typeof z.const=="number"&&(z.const=String(z.const)),d&&(z.type="string",f||(z.pattern=(u.includes("number")?Vo:qj).source)),z}const ko=new WeakMap;function wS(n){const l=new Map;for(const u of n.seen.values())u.def&&!l.has(u.schema)&&l.set(u.schema,u);const r=new Map;for(const u of ko.get(n)??[]){const d=n.seen.get(u),f=(d?.def??d?.schema)?.propertyNames;if(!f||f===!0||r.has(f))continue;const m=To(l,f,new Set);m!==f&&r.set(f,m)}if(r.size)for(const u of n.seen.values())for(const d of[u.schema,u.def]){const f=d&&r.get(d.propertyNames);f&&(d.propertyNames=f)}}const OS=(n,l,r,u)=>{const d=r,f=n._zod.def;d.type="object";const m=f.keyType,p=On(m).patterns;if(f.mode==="loose"&&p&&p.size>0){const b=_t(f.valueType,l,{...u,path:[...u.path,"patternProperties","*"]});d.patternProperties={};for(const j of p)Ba(d.patternProperties,Lv(j).source,b)}else{if(l.target==="draft-07"||l.target==="draft-2020-12"){d.propertyNames=_t(f.keyType,l,{...u,path:[...u.path,"propertyNames"]});let b=ko.get(l);b||(b=[],ko.set(l,b),l.deferred.push(()=>wS(l))),b.push(n)}d.additionalProperties=_t(f.valueType,l,{...u,path:[...u.path,"additionalProperties"]})}const v=m._zod.values,g=l.io==="input"&&Hr(f.valueType)!==void 0;if(v&&!f.partial&&!g){const b=[...v].filter(j=>typeof j=="string"||typeof j=="number");b.length>0&&(d.required=b.map(String))}},TS=(n,l,r,u)=>{const d=n._zod.def,f=_t(d.innerType,l,u),m=l.seen.get(n);l.target==="openapi-3.0"?(m.ref=d.innerType,r.nullable=!0):r.anyOf=[f,{type:"null"}]},kS=(n,l,r,u)=>{const d=n._zod.def;_t(d.innerType,l,u);const f=l.seen.get(n);f.ref=d.innerType},Fo=Symbol();function Bv(n,l,r,u,d){let f=!1;const m=JSON.stringify(n,(p,v)=>typeof v!="bigint"?v:(f=!0,null));return f?(ci(l,r,u,d,"BigInt defaults cannot be represented in JSON Schema"),Fo):JSON.parse(m)}const RS=(n,l,r,u)=>{const d=n._zod.def;_t(d.innerType,l,u);const f=l.seen.get(n);f.ref=d.innerType;const m=Bv(d.defaultValue,n,l,r,u);m!==Fo&&(r.default=m)},MS=(n,l,r,u)=>{const d=n._zod.def;_t(d.innerType,l,u);const f=l.seen.get(n);if(f.ref=d.innerType,l.io!=="input")return;const m=Bv(d.defaultValue,n,l,r,u);m!==Fo&&(r._prefault=m)},DS=(n,l,r,u)=>{const d=n._zod.def;_t(d.innerType,l,u);const f=l.seen.get(n);f.ref=d.innerType;let m;try{m=d.catchValue(void 0)}catch{ci(n,l,r,u,"Dynamic catch values are not supported in JSON Schema");return}r.default=m},US=(n,l,r,u)=>{const d=n._zod.def,f=d.in._zod.traits.has("$ZodTransform"),m=l.io==="input"?f?d.out:d.in:d.out;_t(m,l,u);const p=l.seen.get(n);p.ref=m},ZS=(n,l,r,u)=>{const d=n._zod.def;_t(d.innerType,l,u);const f=l.seen.get(n);f.ref=d.innerType,r.readOnly=!0},qv=(n,l,r,u)=>{const d=n._zod.def;_t(d.innerType,l,u);const f=l.seen.get(n);f.ref=d.innerType},Zp=new WeakSet([Object.prototype,Error.prototype]);function Er(n,l,r){Object.defineProperty(n,l,{configurable:!0,enumerable:!1,get(){const u=r(this);return Object.defineProperty(this,l,{value:u,configurable:!0,writable:!0}),u},set(u){Object.defineProperty(this,l,{value:u,configurable:!0,writable:!0})}})}const HS=(n,l)=>{ej.init(n,l),n.name="ZodError";const r=Object.getPrototypeOf(n);Zp.has(r)||(Zp.add(r),Er(r,"format",u=>d=>aj(u,d)),Er(r,"flatten",u=>d=>nj(u,d)),Er(r,"addIssue",u=>d=>{u.issues.push(d),u.message=JSON.stringify(u.issues,Ao,2)}),Er(r,"addIssues",u=>d=>{u.issues.push(...d),u.message=JSON.stringify(u.issues,Ao,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Sn=q("ZodError",HS,void 0,{Parent:Error}),$S=Yo(Sn),LS=Jo(Sn),BS=Ko(Sn),qS=Qo(Sn),GS=uj(Sn),YS=oj(Sn),JS=dj(Sn),KS=fj(Sn),QS=hj(Sn),VS=mj(Sn),XS=pj(Sn),IS=vj(Sn);function PS(){Tn.localeError||Gn(v0())}function Yr(){Tn.memoizer||Gn({memoizer:h0()})}const ht=q("ZodType",(n,l)=>(PS(),ft.init(n,l),n.def=l,n.type=l.type,n),{check(...n){const l=this.def;return this.clone(cn(l,{checks:[...l.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,l){return qa(this,n,l)},brand(){return this},register(n,l){return n.add(this,l),this},refine(n,l){return this.check(P1(n,l))},superRefine(n,l){return this.check(F1(n,l))},overwrite(n){return this.check(ri(n))},optional(){return Lp(this)},exactOptional(){return H1(this)},nullable(){return Bp(this)},nullish(){return Lp(Bp(this))},nonoptional(n){return Y1(this,n)},array(){return w1(this)},or(n){return k1([this,n])},and(n){return M1(this,n)},transform(n){return qp(this,Z1(n))},default(n){return B1(this,n)},prefault(n){return G1(this,n)},catch(n){return K1(this,n)},pipe(n){return qp(this,n)},readonly(){return X1(this)},describe(n){const l=this.clone();return ls.add(l,{description:n}),l},meta(...n){if(n.length===0)return ls.get(this);const l=this.clone();return ls.add(l,n[0]),l},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n,...l){return l.length===0?n(this):n(this,...l)},get"~standard"(){return cv(this,"~standard",{...vv(this),jsonSchema:{input:Zr(this,"input"),output:Zr(this,"output")}})},set"~standard"(n){La(this,"~standard",n)},parse:function n(l,r){return $S(this,l,r,{callee:n})},parseAsync:async function n(l,r){return await LS(this,l,r,{callee:n})},safeParse(n,l){return BS(this,n,l)},async safeParseAsync(n,l){return qS(this,n,l)},get spa(){return this?.safeParseAsync},set spa(n){La(this,"spa",n)},validate(n,l){return sj(this,n,l)},validateAsync(n,l){return cj(this,n,l)},encode:function n(l,r){return GS(this,l,r,{callee:n})},decode:function n(l,r){return YS(this,l,r,{callee:n})},encodeAsync:async function n(l,r){return await JS(this,l,r,{callee:n})},decodeAsync:async function n(l,r){return await KS(this,l,r,{callee:n})},safeEncode(n,l){return QS(this,n,l)},safeDecode(n,l){return VS(this,n,l)},async safeEncodeAsync(n,l){return XS(this,n,l)},async safeDecodeAsync(n,l){return IS(this,n,l)},toJSONSchema(n){return hS(this,{})(n)},get description(){return ls.get(this)?.description},get _def(){return this._zod.def}}),Gv=q("_ZodString",(n,l)=>{Io.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>gS(n,r,u)},uv({format:n=>On(n).format??null,minLength:n=>On(n).minimum??null,maxLength:n=>On(n).maximum??null},{regex(...n){return this.check(P0(...n))},includes(...n){return this.check(eS(...n))},startsWith(...n){return this.check(tS(...n))},endsWith(...n){return this.check(nS(...n))},min(...n){return this.check(Ur(...n))},max(...n){return this.check(wv(...n))},length(...n){return this.check(Ov(...n))},nonempty(...n){return this.check(Ur(1,...n))},lowercase(n){return this.check(F0(n))},uppercase(n){return this.check(W0(n))},trim(){return this.check(lS())},normalize(...n){return this.check(aS(...n))},toLowerCase(){return this.check(iS())},toUpperCase(){return this.check(sS())},slugify(){return this.check(rS())}})),FS=q("ZodString",(n,l)=>{Io.init(n,l),Gv.init(n,l)},{email(n){return this.check(j0(a1,n))},url(n){return this.check(C0(i1,n))},jwt(n){return this.check(B0(j1,n))},emoji(n){return this.check(z0(s1,n))},guid(n){return this.check(x0(l1,n))},uuid(n){return this.check(S0(wr,n))},uuidv4(n){return this.check(_0(wr,n))},uuidv6(n){return this.check(N0(wr,n))},uuidv7(n){return this.check(A0(wr,n))},nanoid(n){return this.check(E0(r1,n))},cuid(n){return this.check(w0(c1,n))},cuid2(n){return this.check(O0(u1,n))},ulid(n){return this.check(T0(o1,n))},base64(n){return this.check(H0(g1,n))},base64url(n){return this.check($0(y1,n))},xid(n){return this.check(k0(d1,n))},ksuid(n){return this.check(R0(f1,n))},ipv4(n){return this.check(M0(h1,n))},ipv6(n){return this.check(D0(m1,n))},cidrv4(n){return this.check(U0(p1,n))},cidrv6(n){return this.check(Z0(v1,n))},e164(n){return this.check(L0(b1,n))},datetime(n){return this.check(q0(WS,n))},date(n){return this.check(G0(e1,n))},time(n){return this.check(Y0(t1,n))},duration(n){return this.check(J0(n1,n))}});function Ha(n){return b0(FS,n)}const rt=q("ZodStringFormat",(n,l)=>{it.init(n,l),Gv.init(n,l)}),WS=q("ZodISODateTime",(n,l)=>{_x.init(n,l),rt.init(n,l)}),e1=q("ZodISODate",(n,l)=>{Nx.init(n,l),rt.init(n,l)}),t1=q("ZodISOTime",(n,l)=>{Ax.init(n,l),rt.init(n,l)}),n1=q("ZodISODuration",(n,l)=>{Cx.init(n,l),rt.init(n,l)}),a1=q("ZodEmail",(n,l)=>{ux.init(n,l),rt.init(n,l)}),l1=q("ZodGUID",(n,l)=>{rx.init(n,l),rt.init(n,l)}),wr=q("ZodUUID",(n,l)=>{cx.init(n,l),rt.init(n,l)}),i1=q("ZodURL",(n,l)=>{px.init(n,l),rt.init(n,l)}),s1=q("ZodEmoji",(n,l)=>{vx.init(n,l),rt.init(n,l)}),r1=q("ZodNanoID",(n,l)=>{gx.init(n,l),rt.init(n,l)}),c1=q("ZodCUID",(n,l)=>{yx.init(n,l),rt.init(n,l)}),u1=q("ZodCUID2",(n,l)=>{bx.init(n,l),rt.init(n,l)}),o1=q("ZodULID",(n,l)=>{jx.init(n,l),rt.init(n,l)}),d1=q("ZodXID",(n,l)=>{xx.init(n,l),rt.init(n,l)}),f1=q("ZodKSUID",(n,l)=>{Sx.init(n,l),rt.init(n,l)}),h1=q("ZodIPv4",(n,l)=>{zx.init(n,l),rt.init(n,l)}),m1=q("ZodIPv6",(n,l)=>{wx.init(n,l),rt.init(n,l)}),p1=q("ZodCIDRv4",(n,l)=>{Ox.init(n,l),rt.init(n,l)}),v1=q("ZodCIDRv6",(n,l)=>{kx.init(n,l),rt.init(n,l)}),g1=q("ZodBase64",(n,l)=>{Rx.init(n,l),rt.init(n,l)}),y1=q("ZodBase64URL",(n,l)=>{Dx.init(n,l),rt.init(n,l)}),b1=q("ZodE164",(n,l)=>{Ux.init(n,l),rt.init(n,l)}),j1=q("ZodJWT",(n,l)=>{Hx.init(n,l),rt.init(n,l)}),Yv=q("ZodNumber",(n,l)=>{Sv.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>yS(n,r,u,d),n.isFinite=!0},uv({minValue:n=>{const{minimum:l,exclusiveMinimum:r}=On(n);return Math.max(l??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:n=>{const{maximum:l,exclusiveMaximum:r}=On(n);return Math.min(l??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:n=>{const{isInt:l,multipleOf:r}=On(n);return!!l||!!r?.some(Number.isSafeInteger)},format:n=>On(n).format??null},{gt(n,l){return this.check(Ep(n,l))},gte(n,l){return this.check(bo(n,l))},min(n,l){return this.check(bo(n,l))},lt(n,l){return this.check(zp(n,l))},lte(n,l){return this.check(yo(n,l))},max(n,l){return this.check(yo(n,l))},int(n){return this.check(Hp(n))},safe(n){return this.check(Hp(n))},positive(n){return this.check(Ep(0,n))},nonnegative(n){return this.check(bo(0,n))},negative(n){return this.check(zp(0,n))},nonpositive(n){return this.check(yo(0,n))},multipleOf(n,l){return this.check(wp(n,l))},step(n,l){return this.check(wp(n,l))},finite(){return this}}));function x1(n){return K0(Yv,n)}const S1=q("ZodNumberFormat",(n,l)=>{$x.init(n,l),Yv.init(n,l)});function Hp(n){return Q0(S1,n)}const _1=q("ZodBoolean",(n,l)=>{Lx.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>bS(n,r,u)});function N1(n){return V0(_1,n)}const A1=q("ZodUnknown",(n,l)=>{Bx.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>xS()});function Ro(){return X0(A1)}const C1=q("ZodNever",(n,l)=>{qx.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>jS(n,r,u)});function z1(n){return I0(C1,n)}const E1=q("ZodArray",(n,l)=>{Yr(),Jx.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>AS(n,r,u,d),n.element=l.element},{min(n,l){return this.check(Ur(n,l))},nonempty(n){return this.check(Ur(1,n))},max(n,l){return this.check(wv(n,l))},length(n,l){return this.check(Ov(n,l))},unwrap(){return this.element}});function w1(n,l){return cS(E1,n,l)}const O1=q("ZodObject",(n,l)=>{Yr(),Vx.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>CS(n,r,u,d),Kb(n,"shape",r=>r._zod.def.shape,!1)},{keyof(){return $r(Object.keys(this._zod.def.shape))},catchall(n){return this.clone(cn(this._zod.def,{catchall:n}))},passthrough(){return this.clone(cn(this._zod.def,{catchall:Ro()}))},loose(){return this.clone(cn(this._zod.def,{catchall:Ro()}))},strict(){return this.clone(cn(this._zod.def,{catchall:z1()}))},strip(){return this.clone(cn(this._zod.def,{catchall:void 0}))},extend(n){return Db(this,n)},safeExtend(n){return Ub(this,n)},merge(n){return Zb(this,n)},pick(n){return Rb(this,n)},omit(n){return Mb(this,n)},partial(...n){return up(Kv,this,n[0])},exactPartial(...n){return up(Qv,this,n[0],"exactPartial")},required(...n){return Hb(Vv,this,n[0])}});function Jv(n,l){const r={type:"object",shape:n??{},...ge(l)};return new O1(r)}const T1=q("ZodUnion",(n,l)=>{Xx.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>zS(n,r,u,d),n.options=l.options});function k1(n,l){return new T1({type:"union",options:n,...ge(l)})}const R1=q("ZodIntersection",(n,l)=>{Ix.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>ES(n,r,u,d)});function M1(n,l){return new R1({type:"intersection",left:n,right:l})}const $p=q("ZodRecord",(n,l)=>{Yr(),Px.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>OS(n,r,u,d),n.keyType=l.keyType,n.valueType=l.valueType});function D1(n,l,r){return!l||!l._zod?new $p({type:"record",keyType:Ha(),valueType:n,...ge(l)}):new $p({type:"record",keyType:n,valueType:l,...ge(r)})}const Mo=q("ZodEnum",(n,l)=>{Fx.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(u,d,f)=>SS(n,u,d),n.enum=l.entries,n.options=[...n._zod.values];const r=new Set(Object.keys(l.entries));n.extract=(u,d)=>{const f={};for(const m of u)if(r.has(m))f[m]=l.entries[m];else throw new Error(`Key ${m} not found in enum`);return new Mo({...l,checks:[],...ge(d),entries:f})},n.exclude=(u,d)=>{const f={...l.entries};for(const m of u)if(r.has(m))delete f[m];else throw new Error(`Key ${m} not found in enum`);return new Mo({...l,checks:[],...ge(d),entries:f})}});function $r(n,l){const r=Array.isArray(n)?Object.fromEntries(n.map(u=>[u,u])):n;return new Mo({type:"enum",entries:r,...ge(l)})}const U1=q("ZodTransform",(n,l)=>{Yr(),Wx.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>NS(n,r,u,d),n._zod.parse=(r,u)=>{if(u.direction==="backward")throw new ov(n.constructor.name);r.addIssue=f=>{if(typeof f=="string")r.issues.push(rs(f,r.value,l));else{const m=f;m.fatal&&(m.continue=!1),m.code??(m.code="custom"),"input"in m||(m.input=r.value),m.inst??(m.inst=n),r.issues.push(rs(m))}};const d=l.transform(r.value,r);return d instanceof Promise?d.then(f=>(r.value=f,r)):(r.value=d,r)}});function Z1(n){return new U1({type:"transform",transform:n})}const Kv=q("ZodOptional",(n,l)=>{Av.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>qv(n,r,u,d),n.unwrap=()=>n._zod.def.innerType});function Lp(n){return new Kv({type:"optional",innerType:n})}const Qv=q("ZodExactOptional",(n,l)=>{e0.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>qv(n,r,u,d),n.unwrap=()=>n._zod.def.innerType});function H1(n){return new Qv({type:"optional",innerType:n})}const $1=q("ZodNullable",(n,l)=>{t0.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>TS(n,r,u,d),n.unwrap=()=>n._zod.def.innerType});function Bp(n){return new $1({type:"nullable",innerType:n})}const L1=q("ZodDefault",(n,l)=>{n0.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>RS(n,r,u,d),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function B1(n,l){return new L1({type:"default",innerType:n,get defaultValue(){return typeof l=="function"?l():lv(l)}})}const q1=q("ZodPrefault",(n,l)=>{a0.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>MS(n,r,u,d),n.unwrap=()=>n._zod.def.innerType});function G1(n,l){return new q1({type:"prefault",innerType:n,get defaultValue(){return typeof l=="function"?l():lv(l)}})}const Vv=q("ZodNonOptional",(n,l)=>{l0.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>kS(n,r,u,d),n.unwrap=()=>n._zod.def.innerType});function Y1(n,l){return new Vv({type:"nonoptional",innerType:n,...ge(l)})}const J1=q("ZodCatch",(n,l)=>{i0.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>DS(n,r,u,d),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function K1(n,l){return new J1({type:"catch",innerType:n,catchValue:typeof l=="function"?l:Vb(l)})}const Q1=q("ZodPipe",(n,l)=>{s0.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>US(n,r,u,d),n.in=l.in,n.out=l.out});function qp(n,l){return new Q1({type:"pipe",in:n,out:l})}const V1=q("ZodReadonly",(n,l)=>{r0.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>ZS(n,r,u,d),n.unwrap=()=>n._zod.def.innerType});function X1(n){return new V1({type:"readonly",innerType:n})}const I1=q("ZodCustom",(n,l)=>{c0.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>_S(n,r,u,d)});function P1(n,l={}){return uS(I1,n,l)}function F1(n,l){return oS(n,l)}const W1=$r(["conversation","research","observation","consolidation","user_feedback","skill","system"]),e_=Jv({content:Ha().trim().min(1),type:$r(["episodic","semantic","procedural"]),scope:$r(["private","shared"]),source:W1,workspace_id:Ha().trim().min(1).refine(n=>n!=="*","Choose a specific workspace"),metadata:D1(Ha(),Ro()).optional()}).passthrough();Jv({service:Ha(),action:Ha(),status:x1().int(),ok:N1(),resourceId:Ha().optional(),errorCode:Ha().optional()}).strict();class Ft extends Error{status;constructor(l,r){super(l),this.name="ApiError",this.status=r}}async function ee(n,l={}){const r=l.body!==void 0?JSON.stringify(l.body):null,u=await fetch(n,{method:l.method??"GET",headers:{...r?{"content-type":"application/json"}:{},...l.headers??{}},credentials:"include",...r?{body:r}:{}});if(!u.ok){let d=`Request failed with status ${u.status}`;const f=await u.text();if(f)try{const m=JSON.parse(f);d=m.error??m.message??f}catch{d=f}throw new Ft(d,u.status)}if(u.status!==204)return await u.json()}function De(n){return`/api/iam/${n.replace(/^\/+/,"")}`}const P={login(n,l){return ee("/api/auth/login",{method:"POST",body:{username:n,password:l}})},logout(){return ee("/api/auth/logout",{method:"POST"})},me(){return ee("/api/auth/me")},hiveStatus(){return ee("/api/hive/status")},hiveActors(){return ee("/api/hive/actors")},createHiveActor(n){return ee("/api/hive/actors",{method:"POST",body:n})},disableHiveActor(n,l){return ee(`/api/hive/actors/${encodeURIComponent(n)}/disable`,{method:"POST",body:l})},rotateHiveActor(n,l){return ee(`/api/hive/actors/${encodeURIComponent(n)}/rotate`,{method:"POST",body:l})},hiveIncidents(){return ee("/api/hive/incidents")},memoryConsole(){return ee("/api/memory/dashboard-data")},searchMemory(n){const l=new URLSearchParams;return n.query&&l.set("query",n.query),l.set("workspace_id",n.workspaceId??"*"),n.scope&&l.set("scope",n.scope),l.set("limit",String(n.limit??25)),l.set("offset",String(n.offset??0)),ee(`/api/memory/search?${l.toString()}`)},createMemory(n){return ee("/api/memory/memories",{method:"POST",body:e_.parse(n)})},getMemory(n){return ee(`/api/memory/memories/${encodeURIComponent(n)}`)},updateMemory(n,l){return ee(`/api/memory/memories/${encodeURIComponent(n)}`,{method:"PATCH",body:l})},deleteMemory(n){return ee(`/api/memory/memories/${encodeURIComponent(n)}`,{method:"DELETE"})},memoryGraph(n){return ee(`/api/memory/memories/${encodeURIComponent(n)}/graph`)},memoryQueue(n=12){return ee(`/api/memory/queue?limit=${n}`)},runMemoryQueueJob(n){return ee(`/api/memory/queue/${encodeURIComponent(n)}/run`,{method:"POST"})},retryMemoryQueueJob(n){return ee(`/api/memory/queue/${encodeURIComponent(n)}/retry`,{method:"POST"})},cancelMemoryQueueJob(n){return ee(`/api/memory/queue/${encodeURIComponent(n)}`,{method:"DELETE"})},memoryConflicts(n){return ee("/api/memory/conflicts",{method:"POST",body:n})},memoryWebhooks(){return ee("/api/memory/webhooks")},memoryWebhookDeliveries(n=10){return ee(`/api/memory/webhook-deliveries?limit=${n}`)},iamHealth(){return ee(De("health"))},iamUsers(){return ee(De("users?limit=100"))},createIamUser(n){return ee(De("users"),{method:"POST",body:n})},updateIamUser(n,l){return ee(De(`users/${n}`),{method:"PATCH",body:l})},deleteIamUser(n){return ee(De(`users/${n}`),{method:"DELETE"})},assignIamUserRoles(n,l){const r={roleIds:l};return ee(De(`users/${n}/roles`),{method:"POST",body:r})},removeIamUserRole(n,l){return ee(De(`users/${n}/roles/${l}`),{method:"DELETE"})},lockIamUser(n){return ee(De(`users/${n}/lock`),{method:"POST"})},unlockIamUser(n){return ee(De(`users/${n}/unlock`),{method:"POST"})},rotateIamUserPassword(n,l){const r={password:l};return ee(De(`users/${n}/rotate-password`),{method:"POST",body:r})},iamRoles(){return ee(De("roles"))},createIamRole(n){return ee(De("roles"),{method:"POST",body:n})},updateIamRole(n,l){return ee(De(`roles/${n}`),{method:"PATCH",body:l})},deleteIamRole(n){return ee(De(`roles/${n}`),{method:"DELETE"})},iamServiceAccounts(){return ee(De("service-accounts"))},createIamServiceAccount(n){return ee(De("service-accounts"),{method:"POST",body:n})},updateIamServiceAccount(n,l){return ee(De(`service-accounts/${n}`),{method:"PATCH",body:l})},deleteIamServiceAccount(n){return ee(De(`service-accounts/${n}`),{method:"DELETE"})},rotateIamServiceAccount(n){return ee(De(`service-accounts/${n}/rotate`),{method:"POST"})},iamClients(){return ee(De("clients"))},createIamClient(n){return ee(De("clients"),{method:"POST",body:n})},updateIamClient(n,l){return ee(De(`clients/${n}`),{method:"PATCH",body:l})},deleteIamClient(n){return ee(De(`clients/${n}`),{method:"DELETE"})},iamSystemUsers(){return ee(De("system-users"))},createIamSystemUser(n){return ee(De("system-users"),{method:"POST",body:n})},updateIamSystemUser(n,l){return ee(De(`system-users/${n}`),{method:"PATCH",body:l})},deleteIamSystemUser(n){return ee(De(`system-users/${n}`),{method:"DELETE"})},iamSessions(){return ee(De("sessions"))},revokeIamSession(n){return ee(De(`sessions/${n}`),{method:"DELETE"})},deduplicateIamSessions(){return ee(De("sessions/deduplicate"),{method:"POST"})},iamAudit(){return ee(De("audit?limit=50"))},iamAuditStats(){return ee(De("audit/stats"))},iamPasswordPolicy(){return ee(De("password-policy"))},updateIamPasswordPolicy(n){return ee(De("password-policy"),{method:"PATCH",body:n})},providers(){return ee("/api/providers")},createProvider(n){return ee("/api/providers",{method:"POST",body:n})},updateProvider(n,l){return ee(`/api/providers/${n}`,{method:"PUT",body:l})},deleteProvider(n){return ee(`/api/providers/${n}`,{method:"DELETE"})},codexOAuthStatus(){return ee("/api/providers/codex-oauth/status")},startCodexOAuth(){return ee("/api/providers/codex-oauth/start",{method:"POST"})},checkCodexOAuth(n){return ee("/api/providers/codex-oauth/check",{method:"POST",body:{loginId:n}})},aliases(){return ee("/api/model-aliases")},createAlias(n){return ee("/api/model-aliases",{method:"POST",body:n})},updateAlias(n,l){return ee(`/api/model-aliases/${n}`,{method:"PUT",body:l})},deleteAlias(n){return ee(`/api/model-aliases/${n}`,{method:"DELETE"})},routeRules(){return ee("/api/route-rules")},runRoutingTest(n){return ee("/api/testing/run",{method:"POST",body:n})},createRouteRule(n){return ee("/api/route-rules",{method:"POST",body:n})},updateRouteRule(n,l){return ee(`/api/route-rules/${n}`,{method:"PUT",body:l})},deleteRouteRule(n){return ee(`/api/route-rules/${n}`,{method:"DELETE"})},heuristics(){return ee("/api/heuristics")},createHeuristic(n){return ee("/api/heuristics",{method:"POST",body:n})},updateHeuristic(n,l){return ee(`/api/heuristics/${n}`,{method:"PUT",body:l})},deleteHeuristic(n){return ee(`/api/heuristics/${n}`,{method:"DELETE"})},clientKeys(){return ee("/api/client-keys")},createClientKey(n){return ee("/api/client-keys",{method:"POST",body:n})},updateClientKey(n,l){return ee(`/api/client-keys/${n}`,{method:"PUT",body:l})},rotateClientKey(n){return ee(`/api/client-keys/${n}/rotate`,{method:"POST"})},deleteClientKey(n){return ee(`/api/client-keys/${n}`,{method:"DELETE"})},telemetry(){return ee("/api/telemetry")},traces(){return ee("/api/traces")},audit(){return ee("/api/audit")},runtimeSettings(){return ee("/api/runtime-settings")},routingObjective(){return ee("/api/routing/objective")},updateRoutingObjective(n){return ee("/api/routing/objective",{method:"PUT",body:n})},exportConfig(){return ee("/api/config/export")},importConfig(n){return ee("/api/config/import",{method:"POST",body:n})},docsIndex(){return ee("/api-docs/index")}},t_={providers:[],aliases:[],routeRules:[],heuristics:[],clientKeys:[],telemetry:null,traces:[],audit:[],actors:[],incidents:[],runtimeSettings:[],docs:[],hiveStatus:null},Xv=k.createContext(null);function Dt(){const n=k.useContext(Xv);if(!n)throw new Error("useStore must be used within StoreProvider");return n}function n_({onAuthExpired:n,children:l}){const[r,u]=k.useState(t_),[d,f]=k.useState(!0),[m,p]=k.useState(!1),[v,g]=k.useState(null),[b,j]=k.useState([]),[C,z]=k.useState(null),[M,K]=k.useState({}),J=k.useRef(!0),I=k.useRef(0),ie=k.useCallback(async()=>{const X=++I.current;J.current?f(!0):p(!0),g(null),j([]);try{const se={providers:P.providers(),aliases:P.aliases(),routeRules:P.routeRules(),heuristics:P.heuristics(),clientKeys:P.clientKeys(),telemetry:P.telemetry(),traces:P.traces(),audit:P.audit(),actors:P.hiveActors(),incidents:P.hiveIncidents(),runtimeSettings:P.runtimeSettings(),docs:P.docsIndex(),hiveStatus:P.hiveStatus()},x=Object.keys(se),B=await Promise.allSettled(x.map(ue=>se[ue]));if(X!==I.current)return;const V=new Map,Q=[],ce=new Date().toISOString();K(ue=>{const $={...ue};for(let pe=0;pe<x.length;pe++){const qe=x[pe],tt=B[pe];tt.status==="fulfilled"?$[qe]={lastSuccess:ce,error:null}:$[qe]={lastSuccess:ue[qe]?.lastSuccess??null,error:tt.reason instanceof Error?tt.reason.message:"Request failed"}}return $});for(let ue=0;ue<x.length;ue++){const $=x[ue],pe=B[ue];if(pe.status==="fulfilled")V.set($,pe.value);else{if(pe.reason instanceof Ft&&pe.reason.status===401){n();return}Q.push(`${$}: ${pe.reason instanceof Error?pe.reason.message:"Unavailable"}`)}}j(Q),g(Q.length?`${Q.length} console sections failed to refresh; previous data remains visible`:null),u(ue=>({providers:V.get("providers")?.data??ue.providers,aliases:V.get("aliases")?.data??ue.aliases,routeRules:V.get("routeRules")?.data??ue.routeRules,heuristics:V.get("heuristics")?.data??ue.heuristics,clientKeys:V.get("clientKeys")?.data??ue.clientKeys,telemetry:V.get("telemetry")??ue.telemetry,traces:V.get("traces")?.data??ue.traces,audit:V.get("audit")?.data??ue.audit,actors:V.get("actors")?.data??ue.actors,incidents:V.get("incidents")?.data??ue.incidents,runtimeSettings:V.get("runtimeSettings")?.data??ue.runtimeSettings,docs:V.get("docs")?.docs??ue.docs,hiveStatus:V.get("hiveStatus")??ue.hiveStatus})),z(new Date)}catch(se){if(se instanceof Ft&&se.status===401){n();return}g(se instanceof Error?se.message:"Failed to load admin data")}finally{if(X!==I.current)return;J.current=!1,f(!1),p(!1)}},[n]);return k.useEffect(()=>{ie()},[ie]),i.jsx(Xv.Provider,{value:{data:r,loading:d,refreshing:m,error:v,loadIssues:b,lastSync:C,refresh:ie,onAuthExpired:n,resourceFreshness:M},children:l})}function lt(n){return{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round",...n}}const Y={Gauge:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("path",{d:"M12 14l4-4"}),i.jsx("path",{d:"M4 18a8 8 0 1 1 16 0"}),i.jsx("circle",{cx:"12",cy:"14",r:"1.2",fill:"currentColor",stroke:"none"})]}),Server:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("rect",{x:"3",y:"4",width:"18",height:"7",rx:"1.5"}),i.jsx("rect",{x:"3",y:"13",width:"18",height:"7",rx:"1.5"}),i.jsx("path",{d:"M7 7.5h.01M7 16.5h.01"})]}),Route:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("circle",{cx:"6",cy:"19",r:"2.4"}),i.jsx("circle",{cx:"18",cy:"5",r:"2.4"}),i.jsx("path",{d:"M8.4 19H14a3.5 3.5 0 0 0 0-7H10a3.5 3.5 0 0 1 0-7h5.6"})]}),Alias:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("path",{d:"M10 13a5 5 0 0 0 7 0l2-2a5 5 0 0 0-7-7l-1 1"}),i.jsx("path",{d:"M14 11a5 5 0 0 0-7 0l-2 2a5 5 0 0 0 7 7l1-1"})]}),Signal:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M4 14v3M9 10v7M14 6v11M19 3v14"})}),Activity:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M3 12h4l3 8 4-16 3 8h4"})}),Key:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("circle",{cx:"8",cy:"15",r:"4"}),i.jsx("path",{d:"M10.8 12.2 20 3M16 7l3 3M14 9l2 2"})]}),Scroll:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("path",{d:"M8 3h9a2 2 0 0 1 2 2v13a3 3 0 0 1-3 3H7"}),i.jsx("path",{d:"M19 18a2 2 0 1 0 4 0V6"}),i.jsx("path",{d:"M5 3a2 2 0 0 0-2 2v3h5V5a2 2 0 0 0-2-2Z"}),i.jsx("path",{d:"M9 8H3v10a3 3 0 0 0 3 3"}),i.jsx("path",{d:"M11 8h5M11 12h5M11 16h3"})]}),Book:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("path",{d:"M4 5a2 2 0 0 1 2-2h13v16H6a2 2 0 0 0-2 2z"}),i.jsx("path",{d:"M4 19a2 2 0 0 1 2-2h13"})]}),Settings:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("circle",{cx:"12",cy:"12",r:"3"}),i.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1Z"})]}),Plus:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M12 5v14M5 12h14"})}),Edit:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("path",{d:"M12 20h9"}),i.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),Trash:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6M10 11v6M14 11v6"})}),Refresh:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("path",{d:"M21 12a9 9 0 1 1-2.64-6.36L21 8"}),i.jsx("path",{d:"M21 3v5h-5"})]}),Logout:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),i.jsx("path",{d:"M16 17l5-5-5-5M21 12H9"})]}),Close:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),Check:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M20 6 9 17l-5-5"})}),Alert:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"}),i.jsx("path",{d:"M12 9v4M12 17h.01"})]}),Info:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("circle",{cx:"12",cy:"12",r:"9"}),i.jsx("path",{d:"M12 16v-4M12 8h.01"})]}),Copy:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),i.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),Menu:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M3 6h18M3 12h18M3 18h18"})}),Download:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})}),Upload:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"})}),Hexagon:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M12 2.5 20.5 7v10L12 21.5 3.5 17V7Z"})})},Iv=n=>i.jsxs("svg",{className:n.className,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("defs",{children:i.jsxs("linearGradient",{id:"hs-g",x1:"0",y1:"0",x2:"0",y2:"1",children:[i.jsx("stop",{offset:"0%",stopColor:"#ffc940"}),i.jsx("stop",{offset:"100%",stopColor:"#b87a00"})]})}),i.jsxs("g",{transform:"translate(32,32)",children:[i.jsx("polygon",{points:"0,-22 19.05,-11 19.05,11 0,22 -19.05,11 -19.05,-11",fill:"none",stroke:"url(#hs-g)",strokeWidth:"2.5",strokeLinejoin:"round"}),i.jsx("polygon",{points:"-19.05,0 0,11 19.05,0",fill:"none",stroke:"url(#hs-g)",strokeWidth:"1.6",strokeLinejoin:"round",opacity:"0.7"}),i.jsx("circle",{r:"3.5",fill:"#ffc940"})]})]});function ni(n){if(n==null)return"";if(typeof n=="string")try{return JSON.stringify(JSON.parse(n),null,2)}catch{return n}return JSON.stringify(n,null,2)}function cs(n){const l=JSON.parse(n);if(!l||typeof l!="object"||Array.isArray(l))throw new Error("Expected a JSON object");return l}function un(n){if(!n)return"—";const l=new Date(String(n));return Number.isNaN(l.getTime())?String(n):l.toLocaleString(void 0,{month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Ct(n){if(!n)return"—";const l=new Date(String(n));if(Number.isNaN(l.getTime()))return String(n);const r=Date.now()-l.getTime(),u=Math.round(r/1e3);if(u<60)return`${u}s ago`;const d=Math.round(u/60);if(d<60)return`${d}m ago`;const f=Math.round(d/60);return f<24?`${f}h ago`:`${Math.round(f/24)}d ago`}function a_(n){const l=n.trim();if(!l)return"?";const r=l.split(/\s+/);return r.length===1?r[0].slice(0,2).toUpperCase():(r[0][0]+r[r.length-1][0]).toUpperCase()}function Do(n){return n<1e3?String(n):n<1e6?`${(n/1e3).toFixed(n%1e3===0?0:1)}k`:`${(n/1e6).toFixed(1)}M`}const Pv=k.createContext(null);function Ga(){const n=k.useContext(Pv);if(!n)throw new Error("useToast must be used within ToastProvider");return n}let l_=0;function i_({children:n}){const[l,r]=k.useState([]),u=k.useCallback(p=>{r(v=>v.filter(g=>g.id!==p))},[]),d=k.useCallback((p,v,g)=>{const b=l_+=1;r(j=>[...j,{id:b,tone:p,title:v,...g?{message:g}:{}}]),window.setTimeout(()=>u(b),p==="error"?6500:4e3)},[u]),f={push:d,success:(p,v)=>d("success",p,v),error:(p,v)=>d("error",p,v),info:(p,v)=>d("info",p,v)},m=p=>p==="success"?i.jsx(Y.Check,{className:"toast-ico"}):p==="error"?i.jsx(Y.Alert,{className:"toast-ico"}):i.jsx(Y.Info,{className:"toast-ico"});return i.jsxs(Pv.Provider,{value:f,children:[n,i.jsx("div",{className:"toast-stack",role:"status","aria-live":"polite",children:l.map(p=>i.jsxs("div",{className:`toast toast--${p.tone}`,onClick:()=>u(p.id),children:[m(p.tone),i.jsxs("div",{children:[i.jsx("strong",{children:p.title}),p.message?i.jsx("span",{children:p.message}):null]})]},p.id))})]})}function Yt(n,l){const r=n?.permissions??[];if(r.includes("*")||r.includes(l))return!0;const[u]=l.split(":");return r.includes(`${u}:*`)||r.some(d=>d.endsWith(":*")&&l.startsWith(d.slice(0,-1)))}const s_=["OPENAI","CODEX","OPENAI_GENERIC","OPENROUTER","ANTHROPIC","OLLAMA","LLAMACPP","VLLM"],r_=["NONE","BEARER","API_KEY","HEADER"],c_=["MODEL_ALIAS","PROVIDER_PREFERENCE","CAPABILITY","SAFETY","PASSTHROUGH","LOCAL_ONLY"];function le({variant:n="default",size:l,icon:r,loading:u,children:d,...f}){const m=["btn"];n!=="default"&&m.push(`btn--${n}`),l==="sm"&&m.push("btn--sm");const{disabled:p,...v}=f;return i.jsxs("button",{className:m.join(" "),disabled:u||p,...v,children:[u?i.jsx("span",{className:"spinner"}):r,d]})}function on({label:n,icon:l,variant:r="ghost",...u}){const d=["btn","btn--icon"];return r!=="default"&&d.push(`btn--${r}`),i.jsx("button",{className:d.join(" "),title:n,"aria-label":n,...u,children:l})}function _e({tone:n="muted",dot:l,children:r}){return i.jsxs("span",{className:`badge badge--${n}`,children:[l?i.jsx("span",{className:"dot"}):null,r]})}function us({enabled:n}){return i.jsx(_e,{tone:n?"teal":"muted",dot:!0,children:n?"Enabled":"Disabled"})}function Uo({status:n}){const l=(n??"unknown").toLowerCase(),r=l==="healthy"?"teal":l==="unknown"?"muted":"coral";return i.jsx(_e,{tone:r,dot:!0,children:l})}function Gp({outcome:n}){const l=n.toUpperCase(),r=l==="SUCCEEDED"?"teal":l==="DENIED"?"amber":l.includes("FAIL")?"coral":"sky";return i.jsx(_e,{tone:r,children:n.toLowerCase()})}function Ue({label:n,value:l,sub:r,accent:u="amber",emphasize:d}){const f={amber:"var(--amber)",teal:"var(--teal)",sky:"var(--sky)",violet:"var(--violet)",coral:"var(--coral)"};return i.jsxs("div",{className:"stat-card",style:{"--card-accent":f[u]},children:[i.jsx("span",{className:"stat-label",children:n}),i.jsx("span",{className:d?"stat-value accent":"stat-value",children:l}),r?i.jsx("span",{className:"stat-sub",children:r}):null]})}function je({title:n,eyebrow:l,actions:r,children:u,style:d}){return i.jsxs("section",{className:"panel",style:d,children:[i.jsxs("div",{className:"panel-header",children:[i.jsxs("div",{children:[l?i.jsx("p",{className:"panel-eyebrow",children:l}):null,i.jsx("h3",{children:n})]}),r?i.jsx("div",{className:"panel-actions",children:r}):null]}),u]})}function ae({label:n,hint:l,children:r}){return i.jsxs("label",{className:"field",children:[i.jsx("span",{className:"field-label",children:n}),r,l?i.jsx("span",{className:"field-hint",children:l}):null]})}function be({value:n,onChange:l,...r}){return i.jsx("input",{value:n,onChange:u=>l(u.target.value),...r})}function st({value:n,onChange:l,...r}){return i.jsx("textarea",{value:n,onChange:u=>l(u.target.value),...r})}function qn({value:n,onChange:l,options:r,...u}){return i.jsx("select",{value:n,onChange:d=>l(d.target.value),...u,children:r.map(d=>i.jsx("option",{value:d.value,children:d.label},d.value))})}function xn({checked:n,onChange:l,label:r}){return i.jsxs("label",{className:"toggle",children:[i.jsx("input",{type:"checkbox",checked:n,onChange:u=>l(u.target.checked)}),i.jsx("span",{className:"toggle-track"}),r]})}function St({icon:n,message:l}){return i.jsxs("div",{className:"empty-state",children:[n?i.jsx("div",{className:"empty-ico",children:n}):null,l]})}function dt({value:n}){let l;try{l=JSON.stringify(typeof n=="string"?JSON.parse(n):n,null,2)}catch{l=String(n)}return i.jsx("pre",{className:"code-block",children:l})}function kn({open:n,title:l,eyebrow:r,onClose:u,footer:d,children:f}){const m=k.useRef(null),p=k.useRef(u);return p.current=u,k.useEffect(()=>{if(!n)return;const v=document.activeElement instanceof HTMLElement?document.activeElement:null,g=()=>[...m.current?.querySelectorAll('button:not(:disabled), a[href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex="0"]')??[]].filter(j=>j.getClientRects().length>0);(g()[0]??m.current)?.focus();const b=j=>{if(j.key==="Escape"&&(j.preventDefault(),p.current()),j.key==="Tab"){const C=g(),z=C[0],M=C.at(-1);z?j.shiftKey&&(document.activeElement===z||!m.current?.contains(document.activeElement))?(j.preventDefault(),M?.focus()):!j.shiftKey&&(document.activeElement===M||!m.current?.contains(document.activeElement))&&(j.preventDefault(),z.focus()):(j.preventDefault(),m.current?.focus())}};return window.addEventListener("keydown",b),()=>{window.removeEventListener("keydown",b),v?.isConnected&&v.focus()}},[n]),n?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"scrim",onClick:u}),i.jsxs("aside",{ref:m,className:"drawer",role:"dialog","aria-modal":"true","aria-label":l,tabIndex:-1,children:[i.jsxs("div",{className:"drawer-header",children:[i.jsxs("div",{children:[r?i.jsx("p",{className:"panel-eyebrow",children:r}):null,i.jsx("h3",{children:l})]}),i.jsx(on,{label:"Close",icon:i.jsx(Y.Close,{}),onClick:u})]}),i.jsx("div",{className:"drawer-body",children:f}),d?i.jsx("div",{className:"drawer-footer",children:d}):null]})]}):null}function os({open:n,title:l,message:r,confirmLabel:u="Delete",onConfirm:d,onCancel:f,loading:m}){return n?i.jsx("div",{className:"modal-center",onClick:f,children:i.jsxs("div",{className:"confirm-box",onClick:p=>p.stopPropagation(),children:[i.jsx("h3",{children:l}),i.jsx("p",{children:r}),i.jsxs("div",{className:"confirm-actions",children:[i.jsx(le,{variant:"ghost",onClick:f,children:"Cancel"}),i.jsx(le,{variant:"danger",onClick:d,loading:m,icon:i.jsx(Y.Trash,{className:"btn-ico"}),children:u})]})]})}):null}function Wo({value:n,label:l}){const[r,u]=k.useState(!1);return i.jsxs("div",{className:"secret-reveal",children:[i.jsx("span",{style:{flex:1},children:n}),i.jsx(on,{label:l??"Copy",icon:r?i.jsx(Y.Check,{}):i.jsx(Y.Copy,{}),onClick:()=>{navigator.clipboard.writeText(n).then(()=>{u(!0),window.setTimeout(()=>u(!1),1600)})}})]})}function u_(n){const l=cs(n);for(const[r,u]of Object.entries(l))if(typeof u!="string")throw new Error("Header "+r+" must be a string");return l}function o_(n){const l=JSON.parse(n);if(!Array.isArray(l)||l.some(r=>!r||typeof r!="object"||Array.isArray(r)))throw new Error("Models must be a JSON array of objects");return l}function Yp(){return{slug:"",name:"",kind:"OPENAI_GENERIC",baseUrl:"https://api.openai.com/v1",authMode:"BEARER",authHeaderName:"Authorization",authSecret:"",defaultHeaders:"{}",capabilities:"{}",models:"[]",timeoutMs:"120000",maxRetries:"1",concurrency:"16",priority:"100",weight:"100",failoverGroup:"",enabled:!0}}function d_(n){return{slug:n.slug,name:n.name,kind:n.kind,baseUrl:n.baseUrl,authMode:n.authMode,authHeaderName:n.authHeaderName,authSecret:"",defaultHeaders:ni(n.defaultHeaders??{}),capabilities:ni(n.capabilities??{}),models:ni(n.models??[]),timeoutMs:String(n.timeoutMs),maxRetries:String(n.maxRetries),concurrency:String(n.concurrency),priority:String(n.priority),weight:String(n.weight),failoverGroup:n.failoverGroup??"",enabled:n.enabled}}function f_({currentUser:n}){const{data:l,refresh:r}=Dt(),u=Ga(),d=Yt(n,"router:providers:write"),[f,m]=k.useState(!1),[p,v]=k.useState(null),[g,b]=k.useState(Yp()),[j,C]=k.useState(!1),[z,M]=k.useState(null),[K,J]=k.useState(!1),[I,ie]=k.useState(!1),[X,se]=k.useState(!1),[x,B]=k.useState(null),[V,Q]=k.useState(null),[ce,ue]=k.useState(null),$=w=>b(S=>({...S,...w}));function pe(){v(null),b(Yp()),m(!0)}function qe(w){v(w),b(d_(w)),m(!0)}async function tt(){C(!0);try{const w={slug:g.slug.trim(),name:g.name.trim(),kind:g.kind,baseUrl:g.baseUrl.trim(),authMode:g.authMode,authHeaderName:g.authHeaderName.trim()||"Authorization",...g.authSecret?{authSecret:g.authSecret}:{},defaultHeaders:u_(g.defaultHeaders),capabilities:cs(g.capabilities),models:o_(g.models),timeoutMs:Number(g.timeoutMs),maxRetries:Number(g.maxRetries),concurrency:Number(g.concurrency),priority:Number(g.priority),weight:Number(g.weight),...g.failoverGroup.trim()?{failoverGroup:g.failoverGroup.trim()}:{},enabled:g.enabled};p?(await P.updateProvider(p.id,w),u.success("Provider updated",g.name)):(await P.createProvider(w),u.success("Provider created",g.name)),m(!1),await r()}catch(w){const S=w instanceof Ft||w instanceof Error?w.message:"Could not save provider";u.error("Save failed",S)}finally{C(!1)}}async function Ie(){if(z){J(!0);try{await P.deleteProvider(z.id),u.success("Provider removed",z.name),M(null),await r()}catch(w){u.error("Delete failed",w instanceof Error?w.message:"Could not delete provider")}finally{J(!1)}}}async function Z(){se(!0);try{const w=await P.codexOAuthStatus();B(w.data)}catch(w){u.error("Codex status failed",w instanceof Error?w.message:"Could not load Codex authorization status")}finally{se(!1)}}function F(w){ue(w),w.status==="authorized"&&(Q(null),B({authorized:!0,provider:w.provider??null,accountIdMasked:w.accountIdMasked??null,planType:w.planType??null,lastRefreshAt:w.lastRefreshAt??null,refreshTokenQuarantined:!1}))}async function fe(){se(!0),ue(null);try{const w=await P.startCodexOAuth();Q(w.data),ue({status:"pending"}),u.info("Codex authorization started","Open the authorization link and enter the displayed code.")}catch(w){u.error("Codex authorization failed",w instanceof Error?w.message:"Could not start Codex OAuth")}finally{se(!1)}}async function Ae(w=!0){if(V){w&&se(!0);try{const S=await P.checkCodexOAuth(V.loginId);F(S.data),S.data.status==="authorized"?(u.success("Codex authorized","OpenAI Codex is now registered as a provider."),await r()):w&&S.data.status==="pending"&&u.info("Still waiting","Complete the device authorization in the OpenAI window.")}catch(S){u.error("Codex check failed",S instanceof Error?S.message:"Could not check Codex authorization")}finally{w&&se(!1)}}}return k.useEffect(()=>{I&&Z()},[I]),k.useEffect(()=>{if(!I||!V||ce?.status==="authorized")return;const w=window.setInterval(()=>{P.checkCodexOAuth(V.loginId).then(async S=>{F(S.data),S.data.status==="authorized"&&(u.success("Codex authorized","OpenAI Codex is now registered as a provider."),await r())}).catch(()=>{})},Math.max(3,V.intervalSeconds)*1e3);return()=>window.clearInterval(w)},[I,V?.loginId,V?.intervalSeconds,ce?.status,r,u]),i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Providers"}),i.jsx("p",{children:"Upstream registry · failover groups · health posture."})]}),i.jsxs("div",{className:"inline-actions",children:[i.jsx(le,{variant:"ghost",icon:i.jsx(Y.Key,{className:"btn-ico"}),onClick:()=>ie(!0),children:"Authorize Codex"}),i.jsx(le,{variant:"primary",icon:i.jsx(Y.Plus,{className:"btn-ico"}),disabled:!d,onClick:pe,children:"Add Provider"})]})]}),i.jsx(je,{title:"Registered Providers",eyebrow:`${l.providers.length} total`,children:l.providers.length===0?i.jsx(St,{icon:i.jsx(Y.Server,{width:34,height:34}),message:"No providers yet — register your first upstream."}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Name"}),i.jsx("th",{children:"Kind"}),i.jsx("th",{children:"Base URL"}),i.jsx("th",{children:"Priority"}),i.jsx("th",{children:"Health"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Checked"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:l.providers.map(w=>i.jsxs("tr",{className:"row-clickable",onClick:()=>qe(w),children:[i.jsxs("td",{children:[i.jsx("span",{className:"cell-strong",children:w.name}),i.jsx("div",{className:"cell-mono",children:w.slug})]}),i.jsx("td",{children:i.jsx(_e,{tone:"sky",children:w.kind})}),i.jsx("td",{className:"cell-mono",children:w.baseUrl}),i.jsx("td",{className:"cell-mono",children:w.priority}),i.jsx("td",{children:i.jsx(Uo,{status:w.lastHealthStatus})}),i.jsx("td",{children:i.jsx(us,{enabled:w.enabled})}),i.jsx("td",{className:"cell-mono",children:w.lastHealthAt?Ct(w.lastHealthAt):"—"}),i.jsx("td",{children:i.jsxs("div",{className:"cell-actions",onClick:S=>S.stopPropagation(),children:[i.jsx(on,{label:"Edit",icon:i.jsx(Y.Edit,{}),onClick:()=>qe(w)}),i.jsx(on,{label:"Delete",variant:"danger",icon:i.jsx(Y.Trash,{}),disabled:!d,onClick:()=>M(w)})]})})]},w.id))})]})})}),i.jsxs(kn,{open:f,onClose:()=>m(!1),eyebrow:p?"Edit provider":"New provider",title:p?p.name:"Register Upstream",footer:i.jsxs(i.Fragment,{children:[p?i.jsx("span",{className:"spacer",children:i.jsx(Uo,{status:p.lastHealthStatus})}):null,i.jsx(le,{variant:"ghost",onClick:()=>m(!1),children:"Cancel"}),i.jsx(le,{variant:"primary",onClick:tt,loading:j,disabled:!d,icon:i.jsx(Y.Check,{className:"btn-ico"}),children:p?"Save changes":"Create provider"})]}),children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"Slug",hint:"Unique identifier",children:i.jsx(be,{value:g.slug,onChange:w=>$({slug:w}),placeholder:"openai-primary"})}),i.jsx(ae,{label:"Name",children:i.jsx(be,{value:g.name,onChange:w=>$({name:w}),placeholder:"OpenAI Primary"})}),i.jsx(ae,{label:"Kind",children:i.jsx(qn,{value:g.kind,onChange:w=>$({kind:w}),options:s_.map(w=>({value:w,label:w}))})}),i.jsx(ae,{label:"Base URL",children:i.jsx(be,{value:g.baseUrl,onChange:w=>$({baseUrl:w}),placeholder:"https://api.openai.com/v1"})}),i.jsx(ae,{label:"Auth Mode",children:i.jsx(qn,{value:g.authMode,onChange:w=>$({authMode:w}),options:r_.map(w=>({value:w,label:w}))})}),i.jsx(ae,{label:"Auth Header",children:i.jsx(be,{value:g.authHeaderName,onChange:w=>$({authHeaderName:w})})})]}),i.jsx(ae,{label:"Auth Secret",hint:p?"Leave blank to keep the current secret":"Stored encrypted at rest",children:i.jsx(be,{type:"password",value:g.authSecret,onChange:w=>$({authSecret:w}),placeholder:p&&p.authSecretMasked?p.authSecretMasked:"sk-..."})}),i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"Timeout (ms)",children:i.jsx(be,{value:g.timeoutMs,onChange:w=>$({timeoutMs:w}),inputMode:"numeric"})}),i.jsx(ae,{label:"Max Retries",children:i.jsx(be,{value:g.maxRetries,onChange:w=>$({maxRetries:w}),inputMode:"numeric"})}),i.jsx(ae,{label:"Concurrency",children:i.jsx(be,{value:g.concurrency,onChange:w=>$({concurrency:w}),inputMode:"numeric"})}),i.jsx(ae,{label:"Priority",hint:"Lower wins",children:i.jsx(be,{value:g.priority,onChange:w=>$({priority:w}),inputMode:"numeric"})}),i.jsx(ae,{label:"Weight",children:i.jsx(be,{value:g.weight,onChange:w=>$({weight:w}),inputMode:"numeric"})}),i.jsx(ae,{label:"Failover Group",hint:"Optional",children:i.jsx(be,{value:g.failoverGroup,onChange:w=>$({failoverGroup:w}),placeholder:"frontier"})})]}),i.jsx(ae,{label:"Default Headers (JSON object)",children:i.jsx(st,{value:g.defaultHeaders,onChange:w=>$({defaultHeaders:w}),spellCheck:!1})}),i.jsx(ae,{label:"Capabilities (JSON object)",children:i.jsx(st,{value:g.capabilities,onChange:w=>$({capabilities:w}),spellCheck:!1})}),i.jsx(ae,{label:"Models (JSON array)",hint:'e.g. [{"model":"gpt-4o","enabled":true}]',children:i.jsx(st,{value:g.models,onChange:w=>$({models:w}),spellCheck:!1})}),i.jsx("div",{className:"inline-actions",children:i.jsx(xn,{checked:g.enabled,onChange:w=>$({enabled:w}),label:"Enabled"})}),p&&p.lastHealthError?i.jsxs("div",{className:"error-banner",children:[i.jsx(Y.Alert,{}),p.lastHealthError]}):null]}),I?i.jsx("div",{className:"modal-center",onClick:()=>ie(!1),children:i.jsxs("section",{className:"codex-oauth-modal",role:"dialog","aria-modal":"true","aria-labelledby":"codex-oauth-title",onClick:w=>w.stopPropagation(),children:[i.jsxs("div",{className:"codex-oauth-head",children:[i.jsxs("div",{children:[i.jsx("p",{className:"panel-eyebrow",children:"Subscription-backed provider"}),i.jsx("h3",{id:"codex-oauth-title",children:"Authorize OpenAI Codex"})]}),i.jsx(on,{label:"Close",icon:i.jsx(Y.Close,{}),onClick:()=>ie(!1)})]}),i.jsx("p",{className:"codex-oauth-copy",children:"Connect Codex through OpenAI OAuth so hive-router can route eligible requests through the ChatGPT/Codex subscription path without storing an API key."}),i.jsxs("div",{className:"codex-oauth-status",children:[i.jsxs("div",{children:[i.jsx("span",{className:"panel-eyebrow",children:"Current authorization"}),i.jsxs("div",{className:"inline-actions",children:[i.jsx(_e,{tone:x?.authorized?"teal":x?.refreshTokenQuarantined?"coral":"amber",dot:!0,children:x?.authorized?"authorized":x?.refreshTokenQuarantined?"reauthorize":"not authorized"}),x?.provider?i.jsx(_e,{tone:"sky",children:x.provider.slug}):null,x?.planType?i.jsx(_e,{tone:"muted",children:x.planType}):null]})]}),i.jsx(le,{variant:"ghost",size:"sm",loading:X&&!V,onClick:()=>{Z()},children:"Refresh status"})]}),x?.accountIdMasked?i.jsxs("div",{className:"kv-list",children:[i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Account"}),i.jsx("span",{className:"cell-mono",children:x.accountIdMasked})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Last refresh"}),i.jsx("span",{className:"cell-mono",children:x.lastRefreshAt?Ct(x.lastRefreshAt):"never"})]})]}):null,V?i.jsxs("div",{className:"codex-device-card",children:[i.jsxs("div",{className:"codex-device-top",children:[i.jsxs("div",{children:[i.jsx("span",{className:"panel-eyebrow",children:"Device authorization"}),i.jsx("strong",{children:"Enter this code at OpenAI"})]}),i.jsx(_e,{tone:ce?.status==="authorized"?"teal":ce?.status==="error"?"coral":"amber",children:ce?.status??"pending"})]}),i.jsx(Wo,{value:V.userCode,label:"Copy Codex code"}),i.jsx("a",{className:"btn btn--primary",href:V.verificationUrl,target:"_blank",rel:"noreferrer",children:"Open authorization link"}),i.jsxs("span",{className:"field-hint",children:["Expires ",Ct(V.expiresAt),". This modal checks automatically every ",V.intervalSeconds,"s."]}),ce?.message?i.jsxs("div",{className:"error-banner",children:[i.jsx(Y.Alert,{}),ce.message]}):null]}):null,i.jsxs("div",{className:"confirm-actions",children:[i.jsx(le,{variant:"ghost",onClick:()=>ie(!1),children:"Close"}),V?i.jsx(le,{variant:"primary",onClick:()=>{Ae()},loading:X,disabled:!d,icon:i.jsx(Y.Refresh,{className:"btn-ico"}),children:"Check authorization"}):i.jsx(le,{variant:"primary",onClick:()=>{fe()},loading:X,disabled:!d,icon:i.jsx(Y.Key,{className:"btn-ico"}),children:"Start device authorization"})]})]})}):null,i.jsx(os,{open:!!z,title:"Delete provider?",message:`This permanently removes "${z?.name??""}" and its model registry. Routing rules referencing it may stop resolving.`,onConfirm:Ie,onCancel:()=>M(null),loading:K})]})}function si(n,l){return n instanceof Ft||n instanceof Error?n.message:l}function h_({currentUser:n}){const{data:l}=Dt(),[r,u]=k.useState("aliases"),d=Yt(n,"router:routing:write");return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"page-head",children:i.jsxs("div",{children:[i.jsx("h2",{children:"Routing"}),i.jsx("p",{children:"Aliases, deterministic rules, and scoring heuristics that shape every request."})]})}),i.jsxs("div",{className:"tabs",children:[i.jsxs("button",{className:r==="aliases"?"tab tab--active":"tab",onClick:()=>u("aliases"),children:["Model Aliases ",i.jsx("span",{className:"tab-count",children:l.aliases.length})]}),i.jsxs("button",{className:r==="rules"?"tab tab--active":"tab",onClick:()=>u("rules"),children:["Route Rules ",i.jsx("span",{className:"tab-count",children:l.routeRules.length})]}),i.jsxs("button",{className:r==="heuristics"?"tab tab--active":"tab",onClick:()=>u("heuristics"),children:["Heuristics ",i.jsx("span",{className:"tab-count",children:l.heuristics.length})]})]}),r==="aliases"?i.jsx(m_,{canWrite:d}):null,r==="rules"?i.jsx(p_,{canWrite:d}):null,r==="heuristics"?i.jsx(v_,{canWrite:d}):null]})}function m_({canWrite:n}){const{data:l,refresh:r}=Dt(),u=Ga(),[d,f]=k.useState(!1),[m,p]=k.useState(null),[v,g]=k.useState({alias:"",providerId:"",upstreamModel:"",description:"",enabled:!0}),[b,j]=k.useState(!1),[C,z]=k.useState(null),[M,K]=k.useState(!1),J=$=>g(pe=>({...pe,...$})),I=()=>l.providers[0]?.id??"",X=l.providers.find($=>$.id===v.providerId)?.kind==="LLAMACPP";function se(){p(null),g({alias:"",providerId:I(),upstreamModel:"",description:"",enabled:!0}),f(!0)}function x($){p($),g({alias:$.alias,providerId:$.providerId??"",upstreamModel:$.upstreamModel,description:$.description??"",enabled:$.enabled}),f(!0)}async function B(){j(!0);try{const $={alias:v.alias.trim(),upstreamModel:X?"":v.upstreamModel.trim(),enabled:v.enabled,...v.providerId?{providerId:v.providerId}:{},...v.description.trim()?{description:v.description.trim()}:{}};m?(await P.updateAlias(m.id,$),u.success("Alias updated",v.alias)):(await P.createAlias($),u.success("Alias created",v.alias)),f(!1),await r()}catch($){u.error("Save failed",si($,"Could not save alias"))}finally{j(!1)}}async function V(){if(C){K(!0);try{await P.deleteAlias(C.id),u.success("Alias removed",C.alias),z(null),await r()}catch($){u.error("Delete failed",si($,"Could not delete alias"))}finally{K(!1)}}}const Q=[...l.providers.map($=>({value:$.id,label:`${$.name} (${$.kind})`})),{value:"",label:"Dynamic provider selection"}];function ce($){const pe=l.providers.find(qe=>qe.id===$);J({providerId:$,...pe?.kind==="LLAMACPP"?{upstreamModel:""}:{}})}function ue($){return $.provider?.kind==="LLAMACPP"&&!$.upstreamModel?"provider native default (model omitted)":$.upstreamModel||"model omitted"}return i.jsxs(je,{title:"Model Aliases",eyebrow:"Friendly name → upstream model",actions:i.jsx(le,{variant:"primary",size:"sm",icon:i.jsx(Y.Plus,{className:"btn-ico"}),disabled:!n,onClick:se,children:"Add Alias"}),children:[l.aliases.length===0?i.jsx(St,{icon:i.jsx(Y.Alias,{width:34,height:34}),message:"No aliases defined."}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Alias"}),i.jsx("th",{children:"Upstream Model"}),i.jsx("th",{children:"Provider"}),i.jsx("th",{children:"Status"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:l.aliases.map($=>i.jsxs("tr",{className:"row-clickable",onClick:()=>x($),children:[i.jsx("td",{className:"cell-strong",children:$.alias}),i.jsx("td",{className:"cell-mono",children:ue($)}),i.jsx("td",{children:$.provider?i.jsx(_e,{tone:$.provider.kind==="LLAMACPP"?"teal":"sky",children:$.provider.name}):i.jsx(_e,{tone:"muted",children:"dynamic"})}),i.jsx("td",{children:i.jsx(us,{enabled:$.enabled})}),i.jsx("td",{children:i.jsxs("div",{className:"cell-actions",onClick:pe=>pe.stopPropagation(),children:[i.jsx(on,{label:"Edit",icon:i.jsx(Y.Edit,{}),disabled:!n,onClick:()=>x($)}),i.jsx(on,{label:"Delete",variant:"danger",icon:i.jsx(Y.Trash,{}),disabled:!n,onClick:()=>z($)})]})})]},$.id))})]})}),i.jsxs(kn,{open:d,onClose:()=>f(!1),eyebrow:m?"Edit alias":"New alias",title:m?m.alias:"Create Alias",footer:i.jsxs(i.Fragment,{children:[i.jsx(le,{variant:"ghost",onClick:()=>f(!1),children:"Cancel"}),i.jsx(le,{variant:"primary",onClick:B,loading:b,disabled:!n,icon:i.jsx(Y.Check,{className:"btn-ico"}),children:m?"Save changes":"Create alias"})]}),children:[i.jsx(ae,{label:"Alias",hint:"The model name clients request",children:i.jsx(be,{value:v.alias,onChange:$=>J({alias:$}),placeholder:"gpt-4o"})}),i.jsx(ae,{label:"Upstream Model",hint:X?"llama.cpp uses the model already loaded by the server; hive-router will omit the model field.":"The real model sent to the selected provider. Verified on save when the provider exposes a model list.",children:i.jsx(be,{value:X?"":v.upstreamModel,onChange:$=>J({upstreamModel:$}),placeholder:X?"Not required for llama.cpp":"gpt-4o-2024-08-06",disabled:X})}),i.jsx(ae,{label:"Provider",hint:"New aliases default to a concrete provider; choose Dynamic only when the router should decide at runtime.",children:i.jsx(qn,{value:v.providerId,onChange:ce,options:Q})}),X?i.jsxs("div",{className:"info-banner",children:[i.jsx(Y.Info,{}),"llama.cpp model selection is provider-native. This alias will save with an omitted upstream model and route to the selected llama.cpp provider."]}):null,i.jsx(ae,{label:"Description",hint:"Optional",children:i.jsx(be,{value:v.description,onChange:$=>J({description:$})})}),i.jsx("div",{className:"inline-actions",children:i.jsx(xn,{checked:v.enabled,onChange:$=>J({enabled:$}),label:"Enabled"})})]}),i.jsx(os,{open:!!C,title:"Delete alias?",message:`Clients requesting "${C?.alias??""}" will no longer resolve through this alias.`,onConfirm:V,onCancel:()=>z(null),loading:M})]})}function p_({canWrite:n}){const{data:l,refresh:r}=Dt(),u=Ga(),[d,f]=k.useState(!1),[m,p]=k.useState(null),[v,g]=k.useState({name:"",kind:"MODEL_ALIAS",priority:"100",matchJson:"{}",actionJson:"{}",enabled:!0}),[b,j]=k.useState(!1),[C,z]=k.useState(null),[M,K]=k.useState(!1),J=x=>g(B=>({...B,...x}));function I(){p(null),g({name:"",kind:"MODEL_ALIAS",priority:"100",matchJson:"{}",actionJson:"{}",enabled:!0}),f(!0)}function ie(x){p(x),g({name:x.name,kind:x.kind,priority:String(x.priority),matchJson:ni(x.matchJson),actionJson:ni(x.actionJson),enabled:x.enabled}),f(!0)}async function X(){j(!0);try{const x={name:v.name.trim(),kind:v.kind,priority:Number(v.priority),enabled:v.enabled,matchJson:cs(v.matchJson),actionJson:cs(v.actionJson)};m?(await P.updateRouteRule(m.id,x),u.success("Rule updated",v.name)):(await P.createRouteRule(x),u.success("Rule created",v.name)),f(!1),await r()}catch(x){u.error("Save failed",si(x,"Could not save rule"))}finally{j(!1)}}async function se(){if(C){K(!0);try{await P.deleteRouteRule(C.id),u.success("Rule removed",C.name),z(null),await r()}catch(x){u.error("Delete failed",si(x,"Could not delete rule"))}finally{K(!1)}}}return i.jsxs(je,{title:"Route Rules",eyebrow:"Deterministic match → action",actions:i.jsx(le,{variant:"primary",size:"sm",icon:i.jsx(Y.Plus,{className:"btn-ico"}),disabled:!n,onClick:I,children:"Add Rule"}),children:[l.routeRules.length===0?i.jsx(St,{icon:i.jsx(Y.Route,{width:34,height:34}),message:"No route rules defined."}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Name"}),i.jsx("th",{children:"Kind"}),i.jsx("th",{children:"Priority"}),i.jsx("th",{children:"Status"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:l.routeRules.map(x=>i.jsxs("tr",{className:"row-clickable",onClick:()=>ie(x),children:[i.jsx("td",{className:"cell-strong",children:x.name}),i.jsx("td",{children:i.jsx(_e,{tone:"violet",children:x.kind})}),i.jsx("td",{className:"cell-mono",children:x.priority}),i.jsx("td",{children:i.jsx(us,{enabled:x.enabled})}),i.jsx("td",{children:i.jsxs("div",{className:"cell-actions",onClick:B=>B.stopPropagation(),children:[i.jsx(on,{label:"Edit",icon:i.jsx(Y.Edit,{}),disabled:!n,onClick:()=>ie(x)}),i.jsx(on,{label:"Delete",variant:"danger",icon:i.jsx(Y.Trash,{}),disabled:!n,onClick:()=>z(x)})]})})]},x.id))})]})}),i.jsxs(kn,{open:d,onClose:()=>f(!1),eyebrow:m?"Edit rule":"New rule",title:m?m.name:"Create Route Rule",footer:i.jsxs(i.Fragment,{children:[i.jsx(le,{variant:"ghost",onClick:()=>f(!1),children:"Cancel"}),i.jsx(le,{variant:"primary",onClick:X,loading:b,disabled:!n,icon:i.jsx(Y.Check,{className:"btn-ico"}),children:m?"Save changes":"Create rule"})]}),children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"Name",children:i.jsx(be,{value:v.name,onChange:x=>J({name:x}),placeholder:"Prefer local for code"})}),i.jsx(ae,{label:"Priority",hint:"Lower runs first",children:i.jsx(be,{value:v.priority,onChange:x=>J({priority:x}),inputMode:"numeric"})})]}),i.jsx(ae,{label:"Kind",children:i.jsx(qn,{value:v.kind,onChange:x=>J({kind:x}),options:c_.map(x=>({value:x,label:x}))})}),i.jsx(ae,{label:"Match (JSON object)",hint:"Conditions that activate this rule",children:i.jsx(st,{value:v.matchJson,onChange:x=>J({matchJson:x}),spellCheck:!1,rows:6})}),i.jsx(ae,{label:"Action (JSON object)",hint:"What the router does on match",children:i.jsx(st,{value:v.actionJson,onChange:x=>J({actionJson:x}),spellCheck:!1,rows:6})}),i.jsx("div",{className:"inline-actions",children:i.jsx(xn,{checked:v.enabled,onChange:x=>J({enabled:x}),label:"Enabled"})})]}),i.jsx(os,{open:!!C,title:"Delete route rule?",message:`"${C?.name??""}" will no longer influence routing decisions.`,onConfirm:se,onCancel:()=>z(null),loading:M})]})}function v_({canWrite:n}){const{data:l,refresh:r}=Dt(),u=Ga(),[d,f]=k.useState(!1),[m,p]=k.useState(null),[v,g]=k.useState({name:"",category:"",pattern:"",score:"10",actionJson:'{"action":"rerank"}',enabled:!0}),[b,j]=k.useState(!1),[C,z]=k.useState(null),[M,K]=k.useState(!1),J=x=>g(B=>({...B,...x}));function I(){p(null),g({name:"",category:"",pattern:"",score:"10",actionJson:'{"action":"rerank"}',enabled:!0}),f(!0)}function ie(x){p(x),g({name:x.name,category:x.category,pattern:x.pattern,score:String(x.score),actionJson:ni(x.actionJson),enabled:x.enabled}),f(!0)}async function X(){j(!0);try{const x={name:v.name.trim(),category:v.category.trim(),pattern:v.pattern,score:Number(v.score),enabled:v.enabled,actionJson:cs(v.actionJson)};m?(await P.updateHeuristic(m.id,x),u.success("Heuristic updated",v.name)):(await P.createHeuristic(x),u.success("Heuristic created",v.name)),f(!1),await r()}catch(x){u.error("Save failed",si(x,"Could not save heuristic"))}finally{j(!1)}}async function se(){if(C){K(!0);try{await P.deleteHeuristic(C.id),u.success("Heuristic removed",C.name),z(null),await r()}catch(x){u.error("Delete failed",si(x,"Could not delete heuristic"))}finally{K(!1)}}}return i.jsxs(je,{title:"Heuristics",eyebrow:"Pattern → score adjustment",actions:i.jsx(le,{variant:"primary",size:"sm",icon:i.jsx(Y.Plus,{className:"btn-ico"}),disabled:!n,onClick:I,children:"Add Heuristic"}),children:[l.heuristics.length===0?i.jsx(St,{icon:i.jsx(Y.Signal,{width:34,height:34}),message:"No heuristics defined."}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Name"}),i.jsx("th",{children:"Category"}),i.jsx("th",{children:"Pattern"}),i.jsx("th",{children:"Score"}),i.jsx("th",{children:"Status"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:l.heuristics.map(x=>i.jsxs("tr",{className:"row-clickable",onClick:()=>ie(x),children:[i.jsx("td",{className:"cell-strong",children:x.name}),i.jsx("td",{children:i.jsx(_e,{tone:"amber",children:x.category})}),i.jsx("td",{className:"cell-mono",children:x.pattern}),i.jsx("td",{className:"cell-mono",children:x.score}),i.jsx("td",{children:i.jsx(us,{enabled:x.enabled})}),i.jsx("td",{children:i.jsxs("div",{className:"cell-actions",onClick:B=>B.stopPropagation(),children:[i.jsx(on,{label:"Edit",icon:i.jsx(Y.Edit,{}),disabled:!n,onClick:()=>ie(x)}),i.jsx(on,{label:"Delete",variant:"danger",icon:i.jsx(Y.Trash,{}),disabled:!n,onClick:()=>z(x)})]})})]},x.id))})]})}),i.jsxs(kn,{open:d,onClose:()=>f(!1),eyebrow:m?"Edit heuristic":"New heuristic",title:m?m.name:"Create Heuristic",footer:i.jsxs(i.Fragment,{children:[i.jsx(le,{variant:"ghost",onClick:()=>f(!1),children:"Cancel"}),i.jsx(le,{variant:"primary",onClick:X,loading:b,disabled:!n,icon:i.jsx(Y.Check,{className:"btn-ico"}),children:m?"Save changes":"Create heuristic"})]}),children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"Name",children:i.jsx(be,{value:v.name,onChange:x=>J({name:x}),placeholder:"Long context boost"})}),i.jsx(ae,{label:"Category",children:i.jsx(be,{value:v.category,onChange:x=>J({category:x}),placeholder:"context"})})]}),i.jsx(ae,{label:"Pattern",hint:"Regex or keyword matched against the request",children:i.jsx(be,{value:v.pattern,onChange:x=>J({pattern:x}),placeholder:"(?i)summarize"})}),i.jsx(ae,{label:"Score",hint:"Weight applied when the pattern matches",children:i.jsx(be,{value:v.score,onChange:x=>J({score:x}),inputMode:"numeric"})}),i.jsx(ae,{label:"Action (JSON object)",children:i.jsx(st,{value:v.actionJson,onChange:x=>J({actionJson:x}),spellCheck:!1,rows:5})}),i.jsx("div",{className:"inline-actions",children:i.jsx(xn,{checked:v.enabled,onChange:x=>J({enabled:x}),label:"Enabled"})})]}),i.jsx(os,{open:!!C,title:"Delete heuristic?",message:`"${C?.name??""}" will no longer adjust routing scores.`,onConfirm:se,onCancel:()=>z(null),loading:M})]})}const Jp=[{alias:"standard",title:"Standard reasoning",rationale:"Default trait for general chat, light tool-use, summaries, and routine planning.",prompt:"Draft a concise status update for a software team that explains what was shipped, what is blocked, and the next 3 tactical priorities."},{alias:"dangerous",title:"Sensitive / safety-critical",rationale:"Trait for high-stakes prompts that require stronger policy-aware routing.",prompt:"List security hardening checks for an API gateway before release, including key rotation, secret storage, and request allowlisting."},{alias:"internet_data",title:"Internet-facing data",rationale:"Trait for web, search, scrape, provider comparison, and external-data workflows.",prompt:"What are the top 3 performance and governance differences to verify when comparing cloud LLM providers for production routing?"},{alias:"hard",title:"Hard reasoning",rationale:"Trait for multi-step reasoning, planning, hard coding, and architecture work.",prompt:"Design a resilient event processing architecture for multi-region ingestion with idempotency guarantees and exactly-once side effects."},{alias:"coding",title:"Coding",rationale:"Dedicated coding profile for implementation, debugging, refactoring, and code-review tasks.",prompt:"Write a minimal TypeScript hello world program with a greet(name) function and one example call. Return only the code."}];function ed(n){try{return JSON.parse(n.actionJson)}catch{return{}}}function Kp(n){try{return JSON.parse(n)}catch{return n}}function g_(n){try{const l=JSON.parse(n.matchJson);return Array.isArray(l.models)?l.models.filter(r=>typeof r=="string"&&r.length>0):[]}catch{return[]}}function y_(n,l){const r=Zo(n,l);return r?ed(r).providerKinds??[]:[]}function Zo(n,l){return[...l].filter(r=>r.enabled).sort((r,u)=>r.priority-u.priority||r.name.localeCompare(u.name)).find(r=>g_(r).includes(n))}function b_(n){try{const l=JSON.parse(n);return typeof l.model=="string"?l.model:null}catch{return null}}function j_(n){return[...new Set(n)].filter(Boolean)}function Ho(n){if(Array.isArray(n))return n.length>0?n.map(l=>Ho(l)).join(", "):"[]";if(n==null||n==="")return"none";if(typeof n=="object")try{return JSON.stringify(n)}catch{return String(n)}return String(n)}function fl(n,l,r,u){return{path:n,expected:Ho(l),actual:Ho(r),status:u?"match":r==null||r===""?"missing":"diff"}}function x_(n){return n==="match"?"teal":n==="missing"?"amber":"coral"}function S_(n,l,r,u){const d=b_(r.requestBody),f=l?ed(l):{},m=r.selectedProvider?.kind??r.decision.selectedProviderKind??null,p=r.selectedProvider?.id??r.decision.selectedProviderId??null,v=j_(r.candidates.map(x=>x.kind)),g=r.candidates.map(x=>x.id),b=f.providerIds??[],j=l?r.decision.triggeredRuleNames.includes(l.name):!1,C=u.length===0||!!(m&&u.includes(m)),z=b.length===0||!!(p&&b.includes(p)),M=!!(m||p)&&C&&z,K=u.length===0?g.length>0:v.length>0&&v.every(x=>u.includes(x)),J=r.targetModel??n,I=d===J,ie=f.deny?f.denyReason??"denied by route rule":"2xx provider response",X=f.deny?!!r.decision.denialReason:r.success,se=[fl("match.models[0]",n,r.modelAlias,r.modelAlias===n),fl("routeRule.name -> decision.triggeredRuleNames",l?.name??"model-alias route rule",r.decision.triggeredRuleNames,j),fl("routeRule.action.providerKinds -> actual.selectedProvider.kind",u.length>0?u:"any enabled provider kind",m,C&&!!m),fl("routeRule.action.providerIds -> actual.selectedProvider.id",b.length>0?b:"no provider-id constraint",p,b.length>0?z:!0),fl("candidateProviderKinds",u.length>0?`subset of ${u.join(", ")}`:"any enabled provider kind",v,K),fl("requestBody.model",J,d,I),fl("execution.status",ie,r.success?`${r.statusCode}`:r.providerError??`${r.statusCode}`,X)];return{expected:{modelAlias:n,routeRule:l?{name:l.name,kind:l.kind,priority:l.priority,enabled:l.enabled,match:Kp(l.matchJson),action:Kp(l.actionJson)}:null,expectedProviderKinds:u,expectedProviderIds:b,assertions:{ruleMustTrigger:l?.name??null,selectedProviderKindMustBeOneOf:u,selectedProviderIdMustBeOneOf:b,upstreamRequestModelMustEqual:J,executionMust:ie}},actual:{request:{modelAlias:r.modelAlias,targetModel:r.targetModel,upstreamRequestModel:d,requestId:r.requestId},decision:{triggeredRuleNames:r.decision.triggeredRuleNames,selectedProviderKind:r.decision.selectedProviderKind,selectedProviderId:r.decision.selectedProviderId,candidateProviderKinds:v,candidateProviderIds:g,fallbackProviderIds:r.decision.fallbackProviderIds,confidence:r.decision.confidence,denialReason:r.decision.denialReason},execution:{success:r.success,statusCode:r.statusCode,latencyMs:r.latencyMs,selectedProvider:r.selectedProvider,attempts:r.attempts}},checks:[{label:"Rule",expected:l?.name??"model rule",actual:r.decision.triggeredRuleNames.join(", ")||"none",ok:j},{label:"Provider",expected:u.join(", ")||b.join(", ")||"any enabled provider",actual:b.length>0?p??"none":m??"none",ok:M},{label:"Upstream model",expected:J,actual:d??"unavailable",ok:I},{label:"Execution",expected:ie,actual:r.success?`${r.statusCode}`:r.providerError??`${r.statusCode}`,ok:X}],diffRows:se}}function __({alias:n,rule:l,result:r,expectedProviders:u}){const d=S_(n,l,r,u);return i.jsxs("div",{className:"route-audit",children:[i.jsxs("div",{className:"route-audit-head",children:[i.jsxs("div",{children:[i.jsx("span",{className:"panel-eyebrow",children:"Expected rule JSON -> actual route"}),i.jsx("strong",{children:l?.name??"No model rule matched"})]}),i.jsx(_e,{tone:d.checks.every(f=>f.ok)?"teal":"coral",children:d.checks.every(f=>f.ok)?"audit pass":"audit review"})]}),i.jsx("div",{className:"audit-check-grid",children:d.checks.map(f=>i.jsxs("div",{className:"audit-check",children:[i.jsxs("div",{className:"audit-check-top",children:[i.jsx("span",{children:f.label}),i.jsx(_e,{tone:f.ok?"teal":"coral",children:f.ok?"match":"diff"})]}),i.jsxs("div",{className:"audit-check-values",children:[i.jsxs("span",{className:"cell-mono",children:["expected: ",f.expected]}),i.jsxs("span",{className:"cell-mono",children:["actual: ",f.actual]})]})]},f.label))}),i.jsxs("div",{className:"route-diff-table","aria-label":"Expected rule to actual route diff",children:[i.jsxs("div",{className:"route-diff-head",children:[i.jsx("span",{children:"Audit path"}),i.jsx("span",{children:"Expected"}),i.jsx("span",{children:"Actual route"}),i.jsx("span",{children:"Status"})]}),d.diffRows.map(f=>i.jsxs("div",{className:`route-diff-row route-diff-row--${f.status}`,children:[i.jsx("span",{className:"cell-mono",children:f.path}),i.jsx("span",{className:"route-diff-value",children:f.expected}),i.jsx("span",{className:"route-diff-value",children:f.actual}),i.jsx("span",{children:i.jsx(_e,{tone:x_(f.status),children:f.status})})]},f.path))]}),i.jsxs("div",{className:"audit-json-flow",children:[i.jsxs("div",{children:[i.jsx("p",{className:"audit-json-label",children:"Expected rule JSON"}),i.jsx(dt,{value:d.expected})]}),i.jsx("div",{className:"audit-json-arrow","aria-hidden":"true",children:"->"}),i.jsxs("div",{children:[i.jsx("p",{className:"audit-json-label",children:"Actual route JSON"}),i.jsx(dt,{value:d.actual})]})]})]})}function N_(){const{data:n}=Dt(),l=Ga(),[r,u]=k.useState(null),[d,f]=k.useState(!1),[m,p]=k.useState({}),[v,g]=k.useState("{}"),b=k.useMemo(()=>{try{const Q=JSON.parse(v);return Q&&typeof Q=="object"&&!Array.isArray(Q)?Q:null}catch{return null}},[v]),[j,C]=k.useState(""),[z,M]=k.useState(""),[K,J]=k.useState(null),[I,ie]=k.useState(null),X=k.useMemo(()=>Jp.filter(Q=>n.aliases.some(ce=>ce.alias===Q.alias)),[n.aliases]);async function se(Q){u(Q.alias);try{const ce=await P.runRoutingTest({category:Q.title,modelAlias:Q.alias,prompt:Q.prompt,maxResponseChars:1800});p(ue=>({...ue,[Q.alias]:ce.data})),ie(ue=>ue?.modelAlias===Q.alias?ce.data:ue),l.success(`${Q.title} test complete`)}catch(ce){l.error("Run failed",ce instanceof Ft?ce.message:"Unable to run routing test")}finally{u(null)}}async function x(){f(!0);try{for(const Q of X)await se(Q)}finally{f(!1)}}function B(Q){return y_(Q,n.routeRules)}function V(Q){const ce=Zo(Q,n.routeRules);if(!ce)return"No explicit model rule found.";const ue=ed(ce);if(ue.deny)return ue.denyReason??`Denied by rule: ${ce.name}`;const $=ue.providerKinds??[];return $.length>0?`Route rule ${ce.name} targets providers: ${$.join(", ")}`:`Route rule ${ce.name} uses custom provider matching.`}return i.jsxs(i.Fragment,{children:[i.jsxs(je,{title:"Selection preview",eyebrow:"No model calls",children:[i.jsx(ae,{label:"Proposed configuration",hint:"JSON patch with objective, aliases, or rules. Alias and rule arrays replace their complete lists.",children:i.jsx(st,{rows:7,value:v,onChange:g})}),i.jsx(le,{onClick:()=>{fetch("/api/routing/revisions").then(Q=>Q.json()).then(Q=>{C(Q.revision),g(JSON.stringify(Q.config,null,2))}).catch(()=>l.error("Configuration unavailable"))},children:"Load current configuration"}),i.jsx(le,{disabled:!j||!b,onClick:()=>{fetch("/api/routing/revisions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({baseRevision:j,patch:b})}).then(async Q=>{const ce=await Q.json();if(!Q.ok)throw new Error(ce.error);M(ce.previousRevision),C(ce.revision),l.success("Routing configuration applied")}).catch(Q=>l.error(Q instanceof Error?Q.message:"Apply failed"))},children:"Apply configuration"}),i.jsx(le,{disabled:!z,onClick:()=>{fetch("/api/routing/revisions/"+z+"/rollback",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({baseRevision:j})}).then(async Q=>{const ce=await Q.json();if(!Q.ok)throw new Error(ce.error);C(ce.revision),g(JSON.stringify(ce.config,null,2)),M(""),l.success("Previous configuration restored")}).catch(()=>l.error("Rollback failed"))},children:"Restore previous configuration"}),i.jsx(le,{disabled:!b,onClick:()=>{fetch("/api/testing/preview",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...b,cases:Jp.map(Q=>({modelAlias:Q.alias,prompt:Q.prompt}))})}).then(async Q=>{const ce=await Q.json();if(!Q.ok)throw new Error(ce.message??ce.error);J(ce)}).catch(Q=>l.error(Q instanceof Error?Q.message:"Preview failed"))},children:"Compare proposed selection"}),K!==null&&i.jsx(dt,{value:K})]}),i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Testing"}),i.jsx("p",{children:"Profile the routing engine against seeded categories and measure provider selection + latency."})]}),i.jsx(le,{variant:"ghost",icon:i.jsx(Y.Refresh,{className:"btn-ico"}),loading:d,onClick:()=>{x()},disabled:r!==null,children:"Run all categories"})]}),X.length===0?i.jsx(je,{title:"Routing categories",eyebrow:"No seeded categories found",children:i.jsx(St,{icon:i.jsx(Y.Route,{width:34,height:34}),message:"Add model aliases first, then return here to run routing tests."})}):i.jsx("div",{className:"testing-grid",children:X.map(Q=>{const ce=n.aliases.find(Ie=>Ie.alias===Q.alias),ue=Zo(Q.alias,n.routeRules),$=m[Q.alias],pe=B(Q.alias),qe=!$?.selectedProvider||!pe.length?null:!!pe.includes($.selectedProvider.kind),tt=$?$.success?qe===!1?"amber":"teal":"coral":"amber";return i.jsxs(je,{title:`${Q.title} · ${Q.alias}`,eyebrow:ce?.description??Q.rationale,actions:i.jsxs("div",{className:"inline-actions",children:[i.jsx(_e,{tone:"amber",children:Q.alias}),i.jsx("span",{className:"muted",children:"/"}),i.jsx(_e,{tone:tt,children:$?$.success?"executed":"failed":"idle"}),i.jsx(le,{variant:"ghost",size:"sm",loading:r===Q.alias,onClick:()=>{se(Q)},disabled:r!==null||d,icon:i.jsx(Y.Activity,{className:"btn-ico"}),children:"Run"})]}),children:[i.jsx(ae,{label:"Seeded behavior",children:i.jsx(st,{value:V(Q.alias),onChange:()=>{},readOnly:!0,rows:3,spellCheck:!1})}),i.jsx(ae,{label:"Sample prompt",children:i.jsx(st,{value:Q.prompt,onChange:()=>{},readOnly:!0,rows:5,spellCheck:!1})}),pe.length>0?i.jsxs("div",{className:"test-tag-row",children:[i.jsx("span",{className:"panel-eyebrow",children:"Expected providers"}),i.jsx("div",{className:"test-tags",children:pe.map(Ie=>i.jsx(_e,{tone:"sky",children:Ie},Ie))})]}):null,$?i.jsxs("div",{className:"kv-list",style:{marginTop:12},children:[i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Latency"}),i.jsxs("span",{className:"cell-mono",children:[$.latencyMs," ms"]})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Upstream model"}),i.jsx("span",{className:"cell-mono",children:$.targetModel??$.modelAlias})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"HTTP status"}),i.jsx("span",{className:"cell-mono",children:$.statusCode})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Selected provider"}),i.jsx("span",{className:"cell-mono",children:$.selectedProvider?`${$.selectedProvider.name} (${$.selectedProvider.kind})`:"none"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Route status"}),i.jsx("span",{children:i.jsx(_e,{tone:$.success?"teal":"coral",children:$.success?"succeeded":"failed"})})]}),$.providerError?i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Provider error"}),i.jsx("span",{className:"cell-mono",children:$.providerError})]}):null]}):null,$?i.jsx(__,{alias:Q.alias,rule:ue,result:$,expectedProviders:pe}):null,$?i.jsxs(i.Fragment,{children:[i.jsx(ae,{label:"Output preview",hint:"Top-level reply content returned by the routed provider",children:i.jsx(st,{value:$.responsePreview,onChange:()=>{},readOnly:!0,rows:5,spellCheck:!1})}),i.jsx("div",{className:"inline-actions",style:{justifyContent:"flex-end"},children:i.jsx(le,{variant:"ghost",size:"sm",onClick:()=>ie($),children:"View decision JSON"})})]}):null]},Q.alias)})}),i.jsx(kn,{open:!!I,onClose:()=>ie(null),eyebrow:I?I.category:"Routing decision",title:I?`${I.category} · ${I.modelAlias}`:"",footer:i.jsx(le,{variant:"ghost",onClick:()=>ie(null),children:"Close"}),children:I?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"kv-list",children:[i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Request ID"}),i.jsx("span",{className:"cell-mono",children:I.requestId})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Candidates"}),i.jsx("span",{className:"cell-mono",children:I.candidates.map(Q=>Q.kind).join(" → ")||"none"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Selected provider kind"}),i.jsx("span",{className:"cell-mono",children:I.selectedProvider?.kind??"none"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Confidence"}),i.jsxs("span",{className:"cell-mono",children:[Math.round(I.decision.confidence*100),"%"]})]})]}),i.jsx("p",{className:"panel-eyebrow",style:{marginTop:18},children:"Decision payload"}),i.jsx(dt,{value:I.decision}),i.jsx("p",{className:"panel-eyebrow",style:{marginTop:18},children:"Candidate providers"}),i.jsx(dt,{value:I.candidates}),i.jsx("p",{className:"panel-eyebrow",style:{marginTop:18},children:"Provider attempts"}),i.jsx(dt,{value:I.attempts})]}):null})]})}function A_(){const{data:n,refresh:l,refreshing:r}=Dt(),[u,d]=k.useState(null);k.useEffect(()=>{const m=new URLSearchParams(location.search).get("trace");m&&d(n.traces.find(p=>p.id===m)??null)},[n.traces]);function f(m){d(m);const p=new URL(location.href);m?p.searchParams.set("trace",m.id):p.searchParams.delete("trace"),history.replaceState(null,"",p)}return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Traces"}),i.jsx("p",{children:"Per-request routing evidence — provider selection, outcome, and timing."})]}),i.jsx(le,{variant:"ghost",icon:i.jsx(Y.Refresh,{className:"btn-ico"}),loading:r,onClick:()=>{l()},children:"Refresh"})]}),i.jsx(je,{title:"Recent Requests",eyebrow:`${n.traces.length} traces`,children:n.traces.length===0?i.jsx(St,{icon:i.jsx(Y.Activity,{width:34,height:34}),message:"No traces recorded yet."}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"When"}),i.jsx("th",{children:"Route"}),i.jsx("th",{children:"Provider"}),i.jsx("th",{children:"Model"}),i.jsx("th",{children:"Outcome"}),i.jsx("th",{children:"Status"})]})}),i.jsx("tbody",{children:n.traces.map(m=>i.jsxs("tr",{className:"row-clickable",onClick:()=>f(m),children:[i.jsx("td",{className:"cell-mono",title:un(m.createdAt),children:Ct(m.createdAt)}),i.jsxs("td",{children:[i.jsx("span",{className:"cell-strong",children:m.routeKey??m.path}),i.jsxs("div",{className:"cell-mono",children:[m.method," ",m.path]})]}),i.jsx("td",{children:m.provider?.name?i.jsx(_e,{tone:"sky",children:m.provider.name}):i.jsx(_e,{tone:"muted",children:"—"})}),i.jsx("td",{className:"cell-mono",children:m.providerModel??"—"}),i.jsx("td",{children:i.jsx(Gp,{outcome:m.outcome})}),i.jsx("td",{className:"cell-mono",children:m.statusCode??"—"})]},m.id))})]})})}),i.jsx(kn,{open:!!u,onClose:()=>f(null),eyebrow:"Trace detail",title:u?`${u.method} ${u.path}`:"",footer:i.jsx(le,{variant:"ghost",onClick:()=>f(null),children:"Close"}),children:u?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"kv-list",children:[i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Outcome"}),i.jsx(Gp,{outcome:u.outcome})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Status"}),i.jsx("span",{className:"cell-mono",children:u.statusCode??"—"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Provider"}),i.jsx("span",{className:"cell-mono",children:u.provider?.name??u.providerKind??"—"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Model"}),i.jsx("span",{className:"cell-mono",children:u.providerModel??"—"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Route key"}),i.jsx("span",{className:"cell-mono",children:u.routeKey??"—"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Time"}),i.jsx("span",{className:"cell-mono",children:un(u.createdAt)})]})]}),u.events&&u.events.length>0?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"panel-eyebrow",style:{marginTop:22},children:"Event timeline"}),i.jsx(dt,{value:u.events})]}):null,i.jsx("p",{className:"panel-eyebrow",style:{marginTop:22},children:"Raw trace"}),i.jsx(dt,{value:u})]}):null})]})}function C_(n){if(!n)return"{}";try{const l=JSON.parse(n);if(l&&typeof l=="object"&&!Array.isArray(l))return JSON.stringify(l,null,2)}catch{}return n}function Qp(n){const l=n.trim();if(!l)return{};const r=JSON.parse(l);if(!r||typeof r!="object"||Array.isArray(r))throw new Error("Metadata must be a JSON object");return r}function z_(n){if(!n)return"—";try{const l=JSON.parse(n),r=Object.keys(l);return r.length===0?"{}":`${r.length} entries`}catch{return"invalid"}}function E_({currentUser:n}){const{data:l,refresh:r}=Dt(),u=Ga(),d=Yt(n,"router:keys:write"),[f,m]=k.useState(null),[p,v]=k.useState(""),[g,b]=k.useState("{}"),[j,C]=k.useState(!0),[z,M]=k.useState(!1),[K,J]=k.useState(null),[I,ie]=k.useState(null),[X,se]=k.useState(!1),x=k.useRef(0),[B,V]=k.useState(null),[Q,ce]=k.useState(null),ue=()=>{m("create"),v(""),b("{}"),C(!0),J(null),ie(null)},$=w=>{V(null),ce(null);const S=++x.current;fetch(`/api/client-keys/${encodeURIComponent(w.id)}/usage`).then(async U=>{if(!U.ok)throw new Error("Usage accounting unavailable");const te=await U.json();S===x.current&&V(te)}).catch(U=>{S===x.current&&ce(U instanceof Error?U.message:"Usage unavailable")}),m("edit"),v(w.name),b(C_(w.metadataJson)),C(w.enabled),J(null),ie(w)},pe=()=>{m(null),v(""),b("{}"),C(!0),J(null),ie(null)};async function qe(){let w;try{w=Qp(g)}catch(U){u.error("Invalid metadata",U instanceof Error?U.message:"Could not parse metadata JSON");return}const S=p.trim();if(S.length<2){u.error("Name required","Key name must be at least 2 characters");return}M(!0);try{if(f==="edit"&&I)await P.updateClientKey(I.id,{name:S,enabled:j,metadata:w}),u.success("API key updated","Changes were saved."),pe();else{const U=await P.createClientKey({name:S,metadata:w});J({name:S,apiKey:U.data.apiKey}),u.success("API key created","Copy it now — it is shown only once.")}await r()}catch(U){const te=U instanceof Ft||U instanceof Error?U.message:"Could not save key";u.error("Save failed",te)}finally{M(!1)}}async function tt(w,S){se(!0);try{await P.updateClientKey(w.id,{enabled:S}),u.success("API key updated",`Key ${S?"enabled":"disabled"}`),await r()}catch(U){u.error("Update failed",U instanceof Error?U.message:"Could not update key")}finally{se(!1)}}async function Ie(){if(I){se(!0);try{await P.deleteClientKey(I.id),u.success("Key deleted",I.name),ie(null),await r()}catch(w){u.error("Delete failed",w instanceof Error?w.message:"Could not delete key")}finally{se(!1)}}}const Z=f==="create",F=f!==null,fe=Z?"Issue API Key":"Edit API Key",Ae=K?`Key "${K.name}" was created and is valid once.`:"";return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"API Keys"}),i.jsx("p",{children:"OpenAI-compatible API credentials that downstream services use to reach the router."})]}),i.jsx(le,{variant:"primary",icon:i.jsx(Y.Plus,{className:"btn-ico"}),disabled:!d,onClick:ue,children:"Issue Key"})]}),i.jsx(je,{title:"Issued Keys",eyebrow:`${l.clientKeys.length} total`,children:l.clientKeys.length===0?i.jsx(St,{icon:i.jsx(Y.Key,{width:34,height:34}),message:"No client keys issued yet."}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Name"}),i.jsx("th",{children:"Prefix"}),i.jsx("th",{children:"Metadata"}),i.jsx("th",{children:"Created"}),i.jsx("th",{children:"Last Used"}),i.jsx("th",{children:"Status"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:l.clientKeys.map(w=>i.jsxs("tr",{children:[i.jsx("td",{className:"cell-strong",children:w.name}),i.jsxs("td",{className:"cell-mono",children:[w.keyPrefix,"…"]}),i.jsx("td",{children:z_(w.metadataJson)}),i.jsx("td",{className:"cell-mono",children:w.createdAt?un(w.createdAt):"—"}),i.jsx("td",{className:"cell-mono",children:w.lastUsedAt?Ct(w.lastUsedAt):"never"}),i.jsx("td",{children:i.jsx(us,{enabled:w.enabled})}),i.jsx("td",{children:i.jsxs("div",{className:"cell-actions",children:[i.jsx(on,{label:"Edit",variant:"default",icon:i.jsx(Y.Edit,{}),disabled:!d,onClick:()=>$(w)}),i.jsx(le,{size:"sm",variant:w.enabled?"ghost":"primary",disabled:!d,onClick:()=>tt(w,!w.enabled),children:w.enabled?"Disable":"Enable"}),i.jsx(on,{label:"Delete",variant:"danger",icon:i.jsx(Y.Trash,{}),disabled:!d,onClick:()=>ie(w)})]})})]},w.id))})]})})}),i.jsx(kn,{open:F,onClose:pe,eyebrow:fe,title:"API key details",footer:K&&Z?i.jsx(le,{variant:"primary",onClick:pe,icon:i.jsx(Y.Check,{className:"btn-ico"}),children:"Done"}):i.jsxs(i.Fragment,{children:[i.jsx(le,{variant:"ghost",onClick:pe,children:"Cancel"}),i.jsx(le,{variant:"primary",onClick:qe,loading:z,disabled:!d||p.trim().length<2,icon:i.jsx(Y.Key,{className:"btn-ico"}),children:Z?"Generate key":"Save changes"})]}),children:K&&Z?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"error-banner",style:{borderColor:"var(--teal)",color:"var(--teal)"},children:[i.jsx(Y.Info,{}),Ae]}),i.jsx("p",{children:"The key is shown once and will not be displayed again. Copy it now."}),i.jsx(ae,{label:`Key for "${K.name}"`,children:i.jsx(Wo,{value:K.apiKey,label:"Copy API key"})})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{children:`When ${Z?"issuing":"editing"}, provide a JSON metadata object. This field is optional.`}),i.jsx(ae,{label:"Name",hint:"Identify the consumer of this key",children:i.jsx(be,{value:p,onChange:v,placeholder:Z?"my-api production":"existing key name"})}),i.jsx(ae,{label:"Enabled",children:i.jsx(xn,{checked:j,onChange:C,label:"Enable this key immediately"})}),i.jsx("div",{className:"inline-actions",children:i.jsx(le,{onClick:()=>{try{b(JSON.stringify({...Qp(g),tracePrivacy:"metadata-only"},null,2))}catch{u.error("Invalid metadata")}},children:"Use metadata-only traces"})}),Q&&i.jsx("p",{role:"alert",children:Q}),B!==null&&i.jsx(je,{title:"Usage and budgets",eyebrow:"Null cost means price or usage is unknown",children:i.jsx(dt,{value:B})}),i.jsx(ae,{label:"Metadata",hint:'Optional JSON object e.g. {"service":"my-api","env":"prod"}',children:i.jsx(st,{value:g,onChange:b,rows:7,placeholder:"{}"})}),i.jsx(_e,{tone:Z?"sky":"muted",children:K?Ae:""})]})}),i.jsx(os,{open:!!I&&F===!1,title:I?`Delete key "${I?.name??""}"?`:"Delete key",confirmLabel:"Delete",message:`"${I?.name??""}" will be removed permanently.`,onConfirm:Ie,onCancel:()=>ie(null),loading:X})]})}function w_(){const{data:n,refresh:l,refreshing:r}=Dt(),[u,d]=k.useState(null);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Audit Log"}),i.jsx("p",{children:"Every administrative mutation, attributed and timestamped."})]}),i.jsx(le,{variant:"ghost",icon:i.jsx(Y.Refresh,{className:"btn-ico"}),loading:r,onClick:()=>{l()},children:"Refresh"})]}),i.jsx(je,{title:"Events",eyebrow:`${n.audit.length} records`,children:n.audit.length===0?i.jsx(St,{icon:i.jsx(Y.Scroll,{width:34,height:34}),message:"No audit events recorded."}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"When"}),i.jsx("th",{children:"Action"}),i.jsx("th",{children:"Entity"}),i.jsx("th",{children:"Actor"}),i.jsx("th",{children:"Type"})]})}),i.jsx("tbody",{children:n.audit.map(f=>i.jsxs("tr",{className:"row-clickable",onClick:()=>d(f),children:[i.jsx("td",{className:"cell-mono",title:un(f.createdAt),children:Ct(f.createdAt)}),i.jsx("td",{className:"cell-strong",children:f.action}),i.jsxs("td",{className:"cell-mono",children:[f.entityType??"—",f.entityId?i.jsxs("span",{className:"cell-mono",children:[" · ",f.entityId.slice(0,8)]}):null]}),i.jsx("td",{className:"cell-mono",children:f.adminUser?.username??"—"}),i.jsx("td",{children:i.jsx(_e,{tone:f.actorType==="admin"?"amber":"muted",children:f.actorType})})]},f.id))})]})})}),i.jsx(kn,{open:!!u,onClose:()=>d(null),eyebrow:"Audit event",title:u?.action??"",footer:i.jsx(le,{variant:"ghost",onClick:()=>d(null),children:"Close"}),children:u?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"kv-list",children:[i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Actor"}),i.jsx("span",{className:"cell-mono",children:u.adminUser?.username??u.actorType})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Entity"}),i.jsx("span",{className:"cell-mono",children:u.entityType??"—"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Entity ID"}),i.jsx("span",{className:"cell-mono",children:u.entityId??"—"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"When"}),i.jsx("span",{className:"cell-mono",children:un(u.createdAt)})]})]}),u.metadataJson?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"panel-eyebrow",style:{marginTop:22},children:"Metadata"}),i.jsx(dt,{value:u.metadataJson})]}):null]}):null})]})}const Vp=[{title:"Secret rotation",symptom:"Planned credential change or suspected exposure",action:"Run a dry-run rotation, review the redacted plan, then apply during a maintenance window.",command:"npm run rotate:secrets -- --host hive --kind all",target:"settings"},{title:"Rollback",symptom:"Router deploy fails health or the UI regresses after release",action:"Roll Router back to the previous retained release, then verify readiness and audit drift.",command:"npm run deploy -- --rollback",target:"routers"},{title:"Dependency degraded",symptom:"IAM Redis, Memory Qdrant, provider health, or SQLite checks are degraded",action:"Open the service page, inspect failing checks, repair the dependency, then restart only the affected service.",command:"npm run audit:deployments",target:"hive"},{title:"Certificate warning",symptom:"TLS cert is expired, near expiry, or does not match the public FQDN",action:"Redeploy Router with the expected certificate domain and verify the parsed TLS details.",command:"HIVE_ROUTER_CERT_DOMAIN=hive.example.com npm run deploy:router",target:"hive"},{title:"Memory queue backlog",symptom:"HiveMem queue or worker checks show warn/fail",action:"Open Memory, inspect queue state, retry or cancel stuck jobs, and check Qdrant before restarting HiveMem.",command:"curl --fail https://hive.example.com/v1/health/dependencies",target:"memories"},{title:"IAM lockout",symptom:"Operator cannot sign in or sessions are failing step-up/auth checks",action:"Use OS/PAM break-glass login, inspect IAM sessions/audit, then reset the admin password only if needed.",command:"IAM_RESET_PASSWORD=<known-password> npm run reset:admin",target:"iam-sessions"}];function O_(n){switch((n??"").toUpperCase()){case"GET":return"sky";case"POST":return"teal";case"PUT":case"PATCH":return"amber";case"DELETE":return"coral";default:return"muted"}}function T_({onNavigate:n}){const{data:l}=Dt(),[r,u]=k.useState(null),d=k.useMemo(()=>{const f=new Map;for(const m of l.docs){const p=m.scope??"general",v=f.get(p)??[];v.push(m),f.set(p,v)}return[...f.entries()].sort((m,p)=>m[0].localeCompare(p[0]))},[l.docs]);return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"page-head",children:i.jsxs("div",{children:[i.jsx("h2",{children:"Docs"}),i.jsx("p",{children:"Runbooks and endpoint surface grouped by scope."})]})}),i.jsx(je,{title:"Operator Runbooks",eyebrow:`${Vp.length} repairs`,children:i.jsx("div",{className:"runbook-grid",children:Vp.map(f=>i.jsxs("article",{className:"runbook-card",children:[i.jsxs("div",{children:[i.jsx("h3",{children:f.title}),i.jsx("p",{children:f.symptom})]}),i.jsx("p",{className:"runbook-action",children:f.action}),i.jsx("code",{children:f.command}),n?i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>n(f.target),children:"Open"}):null]},f.title))})}),l.docs.length===0?i.jsx(je,{title:"Endpoints",eyebrow:"0 documented",children:i.jsx(St,{icon:i.jsx(Y.Book,{width:34,height:34}),message:"No API documentation available."})}):d.map(([f,m])=>i.jsx(je,{title:f,eyebrow:`${m.length} endpoints`,children:i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Method"}),i.jsx("th",{children:"Path"}),i.jsx("th",{children:"Summary"})]})}),i.jsx("tbody",{children:m.map((p,v)=>i.jsxs("tr",{className:"row-clickable",onClick:()=>u(p),children:[i.jsx("td",{children:i.jsx(_e,{tone:O_(p.method),children:p.method??"—"})}),i.jsx("td",{className:"cell-mono",children:p.path??p.title??"—"}),i.jsx("td",{children:p.summary??p.description??"—"})]},p.id??`${f}-${v}`))})]})})},f)),i.jsx(kn,{open:!!r,onClose:()=>u(null),eyebrow:r?.method??"Endpoint",title:r?.path??r?.title??"",footer:i.jsx(le,{variant:"ghost",onClick:()=>u(null),children:"Close"}),children:r?i.jsxs(i.Fragment,{children:[r.description?i.jsx("p",{style:{color:"var(--text)",lineHeight:1.6},children:r.description}):null,i.jsx("p",{className:"panel-eyebrow",style:{marginTop:18},children:"Definition"}),i.jsx(dt,{value:r})]}):null})]})}const Xp=[{value:"balanced",label:"Balanced",copy:"Use quality, throughput, and cost together."},{value:"cheapest",label:"Cheapest",copy:"Prefer providers with lower declared token cost."},{value:"fastest",label:"Fastest",copy:"Prefer providers with higher declared throughput."},{value:"highest-quality",label:"Quality",copy:"Prefer providers with higher manual quality scores."}];function k_(n){const r=n.find(d=>d.key==="routing.objective")?.parsed;if(typeof r!="object"||r===null)return{goal:"balanced"};const u=r.goal;return{...r,goal:u==="cheapest"||u==="fastest"||u==="highest-quality"||u==="balanced"?u:"balanced"}}function R_({currentUser:n}){const{data:l,refresh:r}=Dt(),u=Ga(),d=Yt(n,"router:settings:write"),f=Yt(n,"router:routing:write"),[m,p]=k.useState(!1),[v,g]=k.useState(""),[b,j]=k.useState(!1),[C,z]=k.useState(!1),M=k_(l.runtimeSettings);async function K(){p(!0);try{const ie=await P.exportConfig(),X=new Blob([JSON.stringify(ie,null,2)],{type:"application/json"}),se=URL.createObjectURL(X),x=document.createElement("a");x.href=se,x.download=`hive-router-config-${new Date().toISOString().slice(0,10)}.json`,x.click(),URL.revokeObjectURL(se),u.success("Config exported")}catch(ie){u.error("Export failed",ie instanceof Error?ie.message:"Could not export config")}finally{p(!1)}}async function J(){let ie;try{ie=JSON.parse(v)}catch{u.error("Invalid JSON","The import payload is not valid JSON.");return}j(!0);try{await P.importConfig(ie),u.success("Config imported","Settings reconciled from payload."),g(""),await r()}catch(X){const se=X instanceof Ft||X instanceof Error?X.message:"Could not import config";u.error("Import failed",se)}finally{j(!1)}}async function I(ie){z(!0);try{await P.updateRoutingObjective({...M,goal:ie}),u.success("Routing objective saved",Xp.find(X=>X.value===ie)?.label??ie),await r()}catch(X){const se=X instanceof Ft||X instanceof Error?X.message:"Could not save routing objective";u.error("Save failed",se)}finally{z(!1)}}return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"page-head",children:i.jsxs("div",{children:[i.jsx("h2",{children:"Settings"}),i.jsx("p",{children:"Runtime configuration and full-config portability."})]})}),i.jsxs("div",{className:"grid-2",children:[i.jsx(je,{title:"Routing Objective",eyebrow:"Provider scoring",children:i.jsx("div",{className:"segmented-grid",children:Xp.map(ie=>i.jsxs("button",{type:"button",className:`segmented-card${M.goal===ie.value?" segmented-card--active":""}`,disabled:!f||C,onClick:()=>{I(ie.value)},children:[i.jsx("span",{children:ie.label}),i.jsx("small",{children:ie.copy})]},ie.value))})}),i.jsx(je,{title:"Export Configuration",eyebrow:"Backup",actions:i.jsx(le,{variant:"primary",size:"sm",icon:i.jsx(Y.Download,{className:"btn-ico"}),loading:m,onClick:K,children:"Download"}),children:i.jsx("p",{style:{color:"var(--muted-light)",lineHeight:1.6},children:"Download a complete snapshot of providers, aliases, routing rules, and heuristics as a portable JSON file."})}),i.jsxs(je,{title:"Import Configuration",eyebrow:"Restore",children:[i.jsx(ae,{label:"Config JSON",hint:"Paste a previously exported configuration payload",children:i.jsx(st,{value:v,onChange:g,spellCheck:!1,rows:6,placeholder:'{ "providers": [], "aliases": [] }'})}),i.jsx("div",{className:"inline-actions",style:{justifyContent:"flex-end"},children:i.jsx(le,{variant:"primary",icon:i.jsx(Y.Upload,{className:"btn-ico"}),loading:b,disabled:!d||!v.trim(),onClick:J,children:"Import"})})]})]}),i.jsx(je,{title:"Runtime Settings",eyebrow:`${l.runtimeSettings.length} keys`,children:l.runtimeSettings.length===0?i.jsx(St,{icon:i.jsx(Y.Settings,{width:34,height:34}),message:"No runtime settings configured."}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Key"}),i.jsx("th",{children:"Value"})]})}),i.jsx("tbody",{children:l.runtimeSettings.map(ie=>i.jsxs("tr",{children:[i.jsx("td",{className:"cell-strong",children:ie.key}),i.jsx("td",{children:i.jsx(dt,{value:ie.parsed??ie.valueJson})})]},ie.key))})]})})})]})}function M_(n){return n==="online"?"teal":n==="degraded"?"amber":"coral"}function D_(n,l){return n.find(r=>r.key===l)??null}function U_(n){const l=n?.details?.tlsCertificate;if(!l||typeof l!="object"||Array.isArray(l))return null;const r=l;return typeof r.configured!="boolean"||!r.status||typeof r.message!="string"||!Array.isArray(r.domains)?null:r}function Z_(n){const l=n?.details?.securityExporterJwks;if(!l||typeof l!="object"||Array.isArray(l))return null;const r=l;return!r.state||typeof r.remainingMs!="number"||typeof r.trustedKeyCount!="number"?null:r}function H_(n){return n==="pass"?"teal":n==="warn"?"amber":"coral"}function $_(n){if(!n)return"unknown";const l=new Date(n);return Number.isNaN(l.getTime())?n:l.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function L_({certificate:n}){if(!n)return null;const l=n.domains.length>0?n.domains.join(", "):n.expectedHost??"unknown";return i.jsx(je,{title:"TLS Certificate",eyebrow:"Public UI",actions:i.jsx(_e,{tone:H_(n.status),dot:!0,children:n.status}),children:i.jsxs("div",{className:"check-list",children:[i.jsxs("div",{className:"check-row",children:[i.jsxs("div",{children:[i.jsx("strong",{children:n.expectedHost??"public host"}),i.jsx("span",{children:n.message})]}),i.jsx(_e,{tone:n.hostnameMatched===!1?"coral":"teal",dot:!0,children:n.hostnameMatched===!1?"mismatch":"matched"})]}),i.jsx("div",{className:"check-row",children:i.jsxs("div",{children:[i.jsx("strong",{children:"Expires"}),i.jsxs("span",{children:[$_(n.validTo),typeof n.daysRemaining=="number"?` (${n.daysRemaining} days)`:""]})]})}),i.jsx("div",{className:"check-row",children:i.jsxs("div",{children:[i.jsx("strong",{children:"Domains"}),i.jsx("span",{children:l})]})}),i.jsx("div",{className:"check-row",children:i.jsxs("div",{children:[i.jsx("strong",{children:"Issuer"}),i.jsx("span",{children:n.issuer??"unknown"})]})})]})})}function B_({app:n,onNavigate:l}){const r=n.key==="router"?"Open console":"Open native",u=n.key==="iam"?"iam-overview":n.key==="memory"?"memories":"routers";return i.jsxs("article",{className:`app-status-card app-status-card--${n.key}`,children:[i.jsxs("div",{className:"app-status-top",children:[i.jsxs("div",{children:[i.jsx("p",{className:"panel-eyebrow",children:n.key}),i.jsx("h3",{children:n.name})]}),i.jsx(_e,{tone:M_(n.status),dot:!0,children:n.status})]}),i.jsx("p",{className:"app-status-role",children:n.role}),i.jsxs("div",{className:"app-status-summary",children:[i.jsx("span",{children:n.summary}),typeof n.latencyMs=="number"?i.jsxs("span",{children:[n.latencyMs," ms"]}):null]}),i.jsxs("div",{className:"service-actions",children:[l?i.jsxs("button",{className:"btn btn--ghost btn--sm",onClick:()=>l(u),children:[i.jsx(Y.Hexagon,{className:"btn-ico"}),"Focus"]}):null,i.jsxs("a",{className:"btn btn--ghost btn--sm",href:n.consoleUrl,target:"_blank",rel:"noreferrer",children:[i.jsx(Y.Route,{className:"btn-ico"}),r]})]})]})}function q_({onNavigate:n}){const{data:l}=Dt(),[r,u]=k.useState(null);k.useEffect(()=>{const C=new AbortController;return fetch("/api/hive/skills",{signal:C.signal}).then(z=>z.json()).then(u).catch(()=>{C.signal.aborted||u({configured:!0,ready:!1,error:"Registry status unavailable"})}),()=>C.abort()},[l.hiveStatus?.generatedAt]);const d=l.hiveStatus?.apps??[],f=d.filter(C=>C.status==="online").length,m=d.filter(C=>C.status==="degraded").length,p=d.filter(C=>C.status==="offline").length,v=l.hiveStatus?.generatedAt,g=D_(d,"router"),b=U_(g),j=Z_(g);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Hive Control Surface"}),i.jsx("p",{children:"Identity, memory, and routing status in one operator shell."})]}),v?i.jsxs(_e,{tone:"muted",children:["sampled ",Ct(v)]}):null]}),r?.configured&&i.jsxs(je,{title:"Skills registry",eyebrow:r.ready?"Ready":"Unavailable",children:[r.error&&i.jsx("p",{role:"alert",children:r.error}),i.jsxs("p",{children:[r.catalog?.length??0," enabled skills on this installation."]}),r.publicUrl&&i.jsx("a",{href:r.publicUrl,target:"_blank",rel:"noreferrer",children:"Open catalog and release channels"})]}),i.jsxs("section",{className:"hive-lattice","aria-label":"Hive service lattice",children:[i.jsxs("div",{className:"lattice-core",children:[i.jsx(Y.Hexagon,{width:42,height:42}),i.jsx("strong",{children:"Hive"})]}),d.map(C=>i.jsxs("button",{className:`lattice-node lattice-node--${C.key} lattice-node--${C.status}`,onClick:()=>n(C.key==="iam"?"iam-overview":C.key==="memory"?"memories":"routers"),children:[i.jsx("span",{children:C.name.replace("Hive ","")}),i.jsx("small",{children:C.status})]},C.key))]}),i.jsxs("div",{className:"stats-grid",children:[i.jsx(Ue,{label:"Apps Online",value:f,sub:`${d.length} registered`,accent:"teal",emphasize:!0}),i.jsx(Ue,{label:"Degraded",value:m,sub:"needs attention",accent:"amber"}),i.jsx(Ue,{label:"Offline",value:p,sub:"not reachable",accent:"coral"}),i.jsx(Ue,{label:"Router Traces",value:Do(l.telemetry?.totals.traces??0),sub:"traffic evidence",accent:"sky"}),i.jsx(Ue,{label:"TLS Cert",value:b?.status??"unknown",sub:b?.message??"not reported",accent:b?.status==="pass"?"teal":b?.status==="warn"?"amber":"coral"}),i.jsx(Ue,{label:"Exporter JWKS",value:j?.state??"unknown",sub:j?`${Math.ceil(j.remainingMs/1e3)}s remaining; ${j.trustedKeyCount} keys`:"not reported",accent:j?.state==="healthy"?"teal":j?.state==="expired"?"coral":"amber"})]}),i.jsx(L_,{certificate:b}),i.jsx("div",{className:"app-status-grid",children:d.map(C=>i.jsx(B_,{app:C,onNavigate:n},C.key))})]})}const Ip={overview:"IAM Overview",users:"Users",roles:"Roles","service-accounts":"Service Accounts",clients:"Clients",sessions:"Sessions","system-users":"System Users",security:"Security",audit:"Audit"},G_=["iam:users:read","iam:users:write","iam:users:delete","iam:roles:read","iam:roles:write","iam:sa:read","iam:sa:write","iam:sa:delete","iam:clients:read","iam:clients:write","iam:audit:read","iam:sessions:revoke","iam:system:login","iam:system:sudo","iam:system:deploy","iam:policy:write","iam:tokens:introspect"];function hl(n){return n.split(/[\n,]+/).map(l=>l.trim()).filter(Boolean)}const Y_=["authorization_code","refresh_token","client_credentials"];function J_(n){const l=new Set(Y_);return hl(n).filter(r=>l.has(r))}function K_(n){return n.map(l=>l.role.label||l.role.name).join(", ")||"No roles"}function Q_(n,l){const r=new Map(l.map(u=>[u.name,u.id]));return n.map(u=>u.roleId??r.get(u.role.name)).filter(u=>!!u)}function jo(n,l){return n.find(r=>r.name===l)?.id??n[0]?.id??""}function V_(n){return!n||Object.keys(n).length===0?"No detail":JSON.stringify(n)}function X_({section:n="overview",onNavigate:l,currentUser:r}){const[u,d]=k.useState([]),[f,m]=k.useState([]),[p,v]=k.useState([]),[g,b]=k.useState([]),[j,C]=k.useState([]),[z,M]=k.useState([]),[K,J]=k.useState(null),[I,ie]=k.useState([]),[X,se]=k.useState(null),[x,B]=k.useState(null),[V,Q]=k.useState(!1),[ce,ue]=k.useState(!1),[$,pe]=k.useState(null),[qe,tt]=k.useState(null),[Ie,Z]=k.useState(null),[F,fe]=k.useState({email:"",username:"",displayName:"",password:"",active:!0,roleId:""}),[Ae,w]=k.useState({userId:"",roleId:""}),[S,U]=k.useState({userId:"",password:""}),[te,re]=k.useState({name:"",description:"",clientId:"",roleId:"",allowedIps:""}),[me,xe]=k.useState({name:"",description:"",secret:"",grantTypes:"client_credentials",redirectUris:"",firstParty:!0}),[ve,He]=k.useState({id:"",name:"",label:"",description:"",permissions:"iam:tokens:introspect"}),[Ze,$t]=k.useState({userId:"",linuxUsername:"",authorizedHosts:"",sshPublicKey:"",sudoEnabled:!1}),Rn=k.useMemo(()=>f.map(N=>({value:N.id,label:`${N.label} (${N.name})`})),[f]),Ya=k.useMemo(()=>g.map(N=>({value:N.id,label:`${N.name} (${N.clientType})`})),[g]),Ja=k.useMemo(()=>u.map(N=>({value:N.id,label:`${N.displayName??N.username} (${N.email})`})),[u]),Nt=Yt(r,"iam:users:write"),_n=Yt(r,"iam:users:delete"),ct=Yt(r,"iam:roles:write"),Nn=Yt(r,"iam:sa:write"),Ut=Yt(r,"iam:sa:delete"),Mn=Yt(r,"iam:clients:write"),An=Yt(r,"iam:sessions:revoke"),Dn=Yt(r,"iam:policy:write"),Yn=k.useCallback(async()=>{Q(!0),pe(null);try{const[N,W,mt,Zt,de,Cn,ds,fs,ui,Va]=await Promise.all([P.iamHealth().catch(()=>null),P.iamAuditStats().catch(()=>null),P.iamSessions().catch(()=>({sessions:[]})),P.iamRoles(),P.iamUsers(),P.iamServiceAccounts(),P.iamClients(),P.iamSystemUsers().catch(()=>({systemUsers:[]})),P.iamAudit().catch(()=>({events:[],total:0,page:1,limit:50})),P.iamPasswordPolicy().catch(()=>null)]);B(N),J(W),M(mt.sessions),m(Zt.roles),d(de.users),v(Cn.serviceAccounts),b(ds.clients),C(fs.systemUsers),ie(ui.events),se(Va?.policy??null),fe(zt=>({...zt,roleId:zt.roleId||jo(Zt.roles,"VIEWER")})),w(zt=>({...zt,userId:zt.userId||de.users[0]?.id||"",roleId:zt.roleId||jo(Zt.roles,"VIEWER")})),U(zt=>({...zt,userId:zt.userId||de.users[0]?.id||""})),re(zt=>({...zt,clientId:zt.clientId||ds.clients[0]?.id||"",roleId:zt.roleId||jo(Zt.roles,"SERVICE")})),$t(zt=>({...zt,userId:zt.userId||de.users[0]?.id||""}))}catch(N){N instanceof Ft&&N.status===401?pe("Hive session expired. Sign in again."):pe(N instanceof Error?N.message:"Failed to load IAM data")}finally{Q(!1)}},[]);k.useEffect(()=>{Yn()},[Yn]);async function Ge(N,W){ue(!0),pe(null),tt(null),Z(null);try{const mt=await N();mt&&typeof mt=="object"&&"apiKey"in mt&&typeof mt.apiKey=="string"&&Z(mt.apiKey),tt(W),await Yn()}catch(mt){pe(mt instanceof Error?mt.message:"Operation failed")}finally{ue(!1)}}function ne(N){se(W=>W&&{...W,...N})}async function Me(){X&&await Ge(()=>P.updateIamPasswordPolicy(X),"Password policy updated")}const Ce=u.filter(N=>N.active).length,nt=p.filter(N=>N.active).length,gt=g.filter(N=>N.active).length;f.filter(N=>!N.isSystem).length;const fa=z.length;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:Ip[n]}),i.jsx("p",{children:"Identity, access, service credentials, sessions, and audit controls."})]}),i.jsx(_e,{tone:"teal",dot:!0,children:"Router session"})]}),i.jsxs("div",{className:"ops-toolbar",children:[i.jsx("div",{className:"segmented-tabs",role:"tablist","aria-label":"IAM sections",children:Object.entries(Ip).map(([N,W])=>i.jsx("button",{className:n===N?"tab-button tab-button--active":"tab-button",onClick:()=>l?.(`iam-${N}`),children:W.replace("IAM ","")},N))}),i.jsx(le,{variant:"ghost",size:"sm",onClick:()=>{Yn()},loading:V,icon:i.jsx(Y.Refresh,{className:"btn-ico"}),children:"Refresh"})]}),$?i.jsxs("div",{className:"error-banner",children:[i.jsx(Y.Alert,{}),$]}):null,qe?i.jsxs("div",{className:"success-banner",children:[i.jsx(Y.Check,{}),qe]}):null,Ie?i.jsx(je,{title:"Secret shown once",eyebrow:"Store now",children:i.jsx(Wo,{value:Ie})}):null,Ka()]});function Ka(){return n==="overview"?Jr():n==="users"?Kr():n==="roles"?Qa():n==="service-accounts"?Lt():n==="clients"?Un():n==="sessions"?Bt():n==="system-users"?Qr():n==="security"?Vr():Xr()}function Jr(){const N=String(x?.status??"unknown");return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"stats-grid",children:[i.jsx(Ue,{label:"Login Users",value:u.length,sub:`${Ce} active`,accent:"violet",emphasize:!0}),i.jsx(Ue,{label:"Service Accounts",value:p.length,sub:`${nt} active`,accent:"sky"}),i.jsx(Ue,{label:"Clients",value:g.length,sub:`${gt} active`,accent:"amber"}),i.jsx(Ue,{label:"Active Sessions",value:fa,sub:`${K?.totalEvents??0} audit events / 30d`,accent:"teal"})]}),i.jsxs("div",{className:"grid-2",children:[i.jsx(je,{title:"IAM Core",eyebrow:"Health",children:i.jsx(_e,{tone:N==="healthy"?"teal":N==="unknown"?"muted":"coral",dot:!0,children:N})}),i.jsx(je,{title:"Recent sessions",eyebrow:"Access",children:i.jsx(ua,{empty:"No active sessions.",headers:["User","IP","Created","Expires"],children:z.slice(0,5).map(W=>i.jsxs("tr",{children:[i.jsx("td",{children:W.user?.email??W.userId}),i.jsx("td",{className:"cell-mono",children:W.ipAddress??"-"}),i.jsx("td",{children:Ct(W.createdAt)}),i.jsx("td",{children:Ct(W.expiresAt)})]},W.id))})})]})]})}function Kr(){return i.jsxs("div",{className:"iam-ops-grid",children:[i.jsxs(je,{title:"Create user",eyebrow:"Human account",children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"Email",children:i.jsx(be,{value:F.email,onChange:N=>fe(W=>({...W,email:N}))})}),i.jsx(ae,{label:"Username",children:i.jsx(be,{value:F.username,onChange:N=>fe(W=>({...W,username:N}))})}),i.jsx(ae,{label:"Display name",children:i.jsx(be,{value:F.displayName,onChange:N=>fe(W=>({...W,displayName:N}))})}),i.jsx(ae,{label:"Password",children:i.jsx(be,{type:"password",value:F.password,onChange:N=>fe(W=>({...W,password:N}))})}),i.jsx(ae,{label:"Initial role",children:i.jsx(qn,{value:F.roleId,onChange:N=>fe(W=>({...W,roleId:N})),options:Rn})}),i.jsx(xn,{checked:F.active,onChange:N=>fe(W=>({...W,active:N})),label:"Active"})]}),i.jsx(le,{variant:"primary",loading:ce,disabled:!Nt,icon:i.jsx(Y.Plus,{className:"btn-ico"}),onClick:()=>{Ge(()=>P.createIamUser({...F,roleIds:F.roleId?[F.roleId]:[]}),"User created")},children:"Create user"})]}),i.jsxs(je,{title:"Role and password",eyebrow:"Update",children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"User",children:i.jsx(qn,{value:Ae.userId,onChange:N=>{w(W=>({...W,userId:N})),U(W=>({...W,userId:N}))},options:Ja})}),i.jsx(ae,{label:"Role",children:i.jsx(qn,{value:Ae.roleId,onChange:N=>w(W=>({...W,roleId:N})),options:Rn})}),i.jsx(ae,{label:"New password",children:i.jsx(be,{type:"password",value:S.password,onChange:N=>U(W=>({...W,password:N}))})})]}),i.jsxs("div",{className:"form-actions",children:[i.jsx(le,{variant:"ghost",loading:ce,disabled:!ct,icon:i.jsx(Y.Key,{className:"btn-ico"}),onClick:()=>{Ge(()=>P.assignIamUserRoles(Ae.userId,[Ae.roleId]),"Role assigned")},children:"Assign role"}),i.jsx(le,{variant:"ghost",loading:ce,disabled:!Nt,icon:i.jsx(Y.Refresh,{className:"btn-ico"}),onClick:()=>{Ge(()=>P.rotateIamUserPassword(S.userId,S.password),"Password rotated")},children:"Rotate password"})]})]}),i.jsx(je,{title:"Users",eyebrow:"Directory",style:{gridColumn:"1 / -1"},children:i.jsx(ua,{empty:"No IAM users found.",headers:["User","Roles","Status","Last login","Actions"],children:u.map(N=>i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("strong",{children:N.displayName??N.username}),i.jsxs("span",{className:"row-sub",children:[N.email," / ",N.username]})]}),i.jsx("td",{children:i.jsx("span",{className:"role-chip-list",children:N.roles.map(W=>{const mt=W.roleId;return i.jsx("button",{className:"role-chip role-chip--button",disabled:!ct||!mt,onClick:()=>mt?void Ge(()=>P.removeIamUserRole(N.id,mt),"Role removed"):void 0,children:W.role.label},W.role.name)})})}),i.jsx("td",{children:i.jsx(_e,{tone:N.active?"teal":"muted",dot:!0,children:N.active?"active":"disabled"})}),i.jsx("td",{className:"cell-mono",children:N.lastLoginAt?Ct(N.lastLoginAt):"never"}),i.jsxs("td",{children:[i.jsxs("div",{className:"row-actions",children:[i.jsx(le,{size:"sm",variant:"ghost",disabled:!Nt,onClick:()=>{Ge(()=>P.updateIamUser(N.id,{active:!N.active}),N.active?"User disabled":"User enabled")},children:N.active?"Disable":"Enable"}),i.jsx(le,{size:"sm",variant:"ghost",disabled:!Nt,onClick:()=>{Ge(()=>P.lockIamUser(N.id),"User locked")},children:"Lock"}),i.jsx(le,{size:"sm",variant:"ghost",disabled:!Nt,onClick:()=>{Ge(()=>P.unlockIamUser(N.id),"User unlocked")},children:"Unlock"}),i.jsx(le,{size:"sm",variant:"danger",disabled:!_n,onClick:()=>window.confirm(`Delete ${N.username}?`)&&void Ge(()=>P.deleteIamUser(N.id),"User deleted"),children:"Delete"})]}),i.jsxs("span",{className:"row-sub",children:[Q_(N.roles,f).length," role ids assigned"]})]})]},N.id))})})]})}function Qa(){return i.jsxs("div",{className:"iam-ops-grid",children:[i.jsxs(je,{title:ve.id?"Update role":"Create role",eyebrow:"Permissions",children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"Role name",children:i.jsx(be,{value:ve.name,disabled:!!ve.id,onChange:N=>He(W=>({...W,name:N})),placeholder:"BOT_OPERATOR"})}),i.jsx(ae,{label:"Label",children:i.jsx(be,{value:ve.label,onChange:N=>He(W=>({...W,label:N}))})}),i.jsx(ae,{label:"Description",children:i.jsx(be,{value:ve.description,onChange:N=>He(W=>({...W,description:N}))})}),i.jsx(ae,{label:"Permissions",hint:"Comma or newline separated",children:i.jsx(st,{value:ve.permissions,onChange:N=>He(W=>({...W,permissions:N}))})})]}),i.jsx("div",{className:"permission-bank",children:G_.map(N=>i.jsx("button",{className:"role-chip role-chip--button",disabled:!ct,onClick:()=>He(W=>({...W,permissions:Array.from(new Set([...hl(W.permissions),N])).join(`
65
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const m of n.seen.entries()){const p=m[1];if(l===m[0]){f(m);continue}if(n.external){const g=n.external.registry.get(m[0])?.id;if(l!==m[0]&&g){f(m);continue}}if(n.metadataRegistry.get(m[0])?.id){f(m);continue}if(p.cycle){f(m);continue}p.count>1&&n.reused==="ref"&&f(m)}n.external&&(n.sharedDefsExtractedFor=n.external)}function Rv(n){const l=n.anyOf;if(!Array.isArray(l)||l.length===0||n.type!==void 0)return;const r=[];for(const u of l){if(!u||typeof u!="object")return;Rv(u);const d=Object.keys(u);if(d.length!==1||d[0]!=="type")return;const f=u.type;for(const m of Array.isArray(f)?f:[f]){if(typeof m!="string")return;r.includes(m)||r.push(m)}}delete n.anyOf,n.type=r.length===1?r[0]:r}const Mv=new Set(["type","properties","required","additionalProperties"]),Tp=["oneOf","anyOf"];function kp(n){const l=n.additionalProperties;return l===void 0||l===!1||typeof l!="object"||l===null?null:Object.keys(l).length?l:null}function Oo(n){const l=[];for(const f of n){if(typeof f!="object"||f.type!=="object")return null;for(const m in f)if(!Mv.has(m))return null;l.push(f)}const r={},u=new Set;for(const f of l){for(const m in f.properties){if(Object.prototype.hasOwnProperty.call(r,m))continue;const p=[];for(const g of l){const b=g.properties?.[m]??kp(g);b!=null&&(p.some(j=>JSON.stringify(j)===JSON.stringify(b))||p.push(b))}const v=p.length===1?p[0]:Oo(p)??{allOf:p};Ba(r,m,v)}for(const m of f.required??[])u.add(m)}const d={type:"object",properties:r};if(u.size&&(d.required=[...u]),l.every(f=>f.additionalProperties===!1))d.additionalProperties=!1;else{const f=[];for(const m of l){const p=kp(m);p&&!f.some(v=>JSON.stringify(v)===JSON.stringify(p))&&f.push(p)}f.length===1?d.additionalProperties=f[0]:f.length>1&&(d.additionalProperties={allOf:f})}return d}function fS(n){const l=n.allOf;if(!Array.isArray(l)||l.length<2)return;for(const d of Mv)if(d in n)return;const r=l.filter(d=>Tp.some(f=>Array.isArray(d[f])));let u=null;if(!r.length)u=Oo(l);else{const d=r[0],f=Tp.find(v=>Array.isArray(d[v]));if(Object.keys(d).length!==1)return;const m=l.filter(v=>v!==d),p=d[f].map(v=>Oo([...m,v]));if(p.some(v=>!v))return;u={[f]:p}}u&&(delete n.allOf,ss(n,u))}function Dv(n,l){const r=n.seen.get(l);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const u=p=>{const v=n.seen.get(p);if(v.ref===null)return;const g=v.def??v.schema,b={...g},j=v.ref;if(v.ref=null,j){u(j);const z=n.seen.get(j),M=z.schema;if(M.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(M)):ss(g,M),ss(g,b),p._zod.parent===j)for(const J in g)J==="$ref"||J==="allOf"||J in b||delete g[J];if(M.$ref&&z.def)for(const J in g)J==="$ref"||J==="allOf"||J in z.def&&JSON.stringify(g[J])===JSON.stringify(z.def[J])&&delete g[J]}const C=p._zod.parent;if(C&&C!==j){u(C);const z=n.seen.get(C);if(z?.schema.$ref&&(g.$ref=z.schema.$ref,z.def))for(const M in g)M==="$ref"||M==="allOf"||M in z.def&&JSON.stringify(g[M])===JSON.stringify(z.def[M])&&delete g[M]}n.override({zodSchema:p,jsonSchema:g,path:v.path??[]})};if(!n.external||n.sharedEmitDoneFor!==n.external){for(const p of[...n.seen.entries()].reverse())u(p[0]);if(n.target!=="openapi-3.0")for(const p of n.seen.entries())Rv(p[1].def??p[1].schema);for(const p of n.deferred)p();if(n.intersections.length){const p=new Map;for(const v of n.seen.values())for(const g of[v.schema,v.def]){const b=g?.allOf;if(!Array.isArray(b))continue;const j=p.get(b);j?j.push(g):p.set(b,[g])}for(const v of n.intersections)for(const g of p.get(v)??[])fS(g)}}const d={};if(n.target==="draft-2020-12"?d.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?d.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?d.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){const p=n.external.registry.get(l)?.id;if(!p)throw new Error("Schema is missing an `id` property");d.$id=n.external.uri(p)}ss(d,r.defId?r.schema:r.def??r.schema);const f=n.metadataRegistry.get(l)?.id;f!==void 0&&d.id===f&&delete d.id;const m=n.external?.defs??{};if(!n.external||n.sharedEmitDoneFor!==n.external)for(const p of n.seen.entries()){const v=p[1];v.def&&v.defId&&(v.def.id===v.defId&&delete v.def.id,Ba(m,v.defId,v.def))}n.external&&(n.sharedEmitDoneFor=n.external),n.external||Object.keys(m).length>0&&(n.target==="draft-2020-12"?d.$defs=m:d.definitions=m);try{const p=JSON.parse(JSON.stringify(d));return Object.defineProperty(p,"~standard",{value:{...l["~standard"],jsonSchema:{input:Zr(l,"input",n.processors),output:Zr(l,"output",n.processors)}},enumerable:!1,writable:!1}),p}catch{throw new Error("Error converting schema to JSON.")}}function Gt(n,l){const r=l??{seen:new Set};if(r.seen.has(n))return!1;r.seen.add(n);const u=n._zod.def;if(u.type==="transform")return!0;if(u.type==="array")return Gt(u.element,r);if(u.type==="set")return Gt(u.valueType,r);if(u.type==="lazy")return Gt(u.getter(),r);if(u.type==="promise"||u.type==="optional"||u.type==="nonoptional"||u.type==="nullable"||u.type==="readonly"||u.type==="default"||u.type==="prefault"||u.type==="catch")return Gt(u.innerType,r);if(u.type==="intersection")return Gt(u.left,r)||Gt(u.right,r);if(u.type==="record"||u.type==="map")return Gt(u.keyType,r)||Gt(u.valueType,r);if(u.type==="pipe")return n._zod.traits.has("$ZodCodec")?!0:Gt(u.in,r)||Gt(u.out,r);if(u.type==="object"){for(const d in u.shape)if(Gt(u.shape[d],r))return!0;return!1}if(u.type==="union"){for(const d of u.options)if(Gt(d,r))return!0;return!1}if(u.type==="tuple"){for(const d of u.items)if(Gt(d,r))return!0;return!!(u.rest&&Gt(u.rest,r))}return!1}const hS=(n,l={})=>r=>{const u=Tv({...r,processors:l});return _t(n,u),kv(u,n),Dv(u,n)},Zr=(n,l,r={})=>u=>{const{libraryOptions:d,target:f}=u??{},m=Tv({...d??{},target:f,io:l,processors:r});return _t(n,m),kv(m,n),Dv(m,n)},li=(n,l,r)=>{(n[l]===void 0||r>n[l])&&(n[l]=r)},ii=(n,l,r)=>{(n[l]===void 0||r<n[l])&&(n[l]=r)},Rp=(n,l)=>{li(n,"minimum",l),ii(n,"maximum",l)},Uv=(n,l)=>{n.multipleOf??(n.multipleOf=[]),n.multipleOf.includes(l)||n.multipleOf.push(l)},Zv=(n,l)=>{n.patterns??(n.patterns=new Set),n.patterns.add(l)},Hv=(n,l)=>{n.mime=n.mime?n.mime.filter(r=>l.includes(r)):[...l]},$v=(n,l)=>{n.format=l,l.includes("int")&&(n.isInt=!0)},Mp=(n,l)=>li(n,"minimum",l.minimum),Dp=(n,l)=>ii(n,"maximum",l.maximum),Up=n=>(l,r)=>{$v(l,r.format);const[u,d]=n[r.format];li(l,"minimum",u),ii(l,"maximum",d)},mS={greater_than:(n,l)=>li(n,l.inclusive?"minimum":"exclusiveMinimum",l.value),less_than:(n,l)=>ii(n,l.inclusive?"maximum":"exclusiveMaximum",l.value),multiple_of:(n,l)=>Uv(n,l.value),number_format:Up(sv),bigint_format:Up(kb),min_length:Mp,max_length:Dp,length_equals:(n,l)=>Rp(n,l.length),min_size:Mp,max_size:Dp,size_equals:(n,l)=>Rp(n,l.size),string_format:(n,l)=>{$v(n,l.format),l.pattern&&Zv(n,l.pattern),(l.format==="base64"||l.format==="base64url")&&(n.contentEncoding=l.format),(l.local||l.precision===-1)&&(n.laxFormat=!0)},mime_type:(n,l)=>Hv(n,l.mime)};function On(n){const l={},r=n._zod.def,u=n._zod.traits.has("$ZodCheck")?[n,...r.checks??[]]:r.checks??[];for(const f of u)mS[f._zod.def.check]?.(l,f._zod.def);const d=n._zod.bag;d.minimum!==void 0&&li(l,"minimum",d.minimum),d.exclusiveMinimum!==void 0&&li(l,"exclusiveMinimum",d.exclusiveMinimum),d.maximum!==void 0&&ii(l,"maximum",d.maximum),d.exclusiveMaximum!==void 0&&ii(l,"exclusiveMaximum",d.exclusiveMaximum),d.multipleOf!==void 0&&Uv(l,d.multipleOf),d.format!==void 0&&(l.format??(l.format=d.format),d.format.includes("int")&&(l.isInt=!0)),d.mime&&Hv(l,d.mime);for(const f of d.patterns??[])Zv(l,f);return l}const pS={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},vS=new Map([[xv,Rj],[Po,Mj]]),Lv=n=>vS.get(n)??n,gS=(n,l,r,u)=>{const d=r;d.type="string";const{minimum:f,maximum:m,format:p,patterns:v,contentEncoding:g,laxFormat:b}=On(n);if(typeof f=="number"&&(d.minLength=f),typeof m=="number"&&(d.maxLength=m),p&&(d.format=pS[p]??p,d.format===""&&delete d.format,(p==="time"||b)&&delete d.format),g&&(d.contentEncoding=g),v&&v.size>0){const j=[...v].map(Lv);j.length===1?d.pattern=j[0].source:j.length>1&&(d.allOf=[...j.map(C=>({...l.target==="draft-07"||l.target==="draft-04"||l.target==="openapi-3.0"?{type:"string"}:{},pattern:C.source}))])}},yS=(n,l,r,u)=>{const d=r,{minimum:f,maximum:m,multipleOf:p,exclusiveMaximum:v,exclusiveMinimum:g,isInt:b}=On(n);d.type=b?"integer":"number";const j=typeof g=="number"&&g>=(f??Number.NEGATIVE_INFINITY),C=typeof v=="number"&&v<=(m??Number.POSITIVE_INFINITY),z=l.target==="draft-04"||l.target==="openapi-3.0";if(j?z?(d.minimum=g,d.exclusiveMinimum=!0):d.exclusiveMinimum=g:typeof f=="number"&&(d.minimum=f),C?z?(d.maximum=v,d.exclusiveMaximum=!0):d.exclusiveMaximum=v:typeof m=="number"&&(d.maximum=m),p){const M=new Set;for(const I of p)Number.isFinite(I)&&I!==0?M.add(Math.abs(I)):ci(n,l,d,u,`A multipleOf divisor of ${I} cannot be represented in JSON Schema`);const[K,...J]=M;K!==void 0&&(d.multipleOf=K),J.length&&(d.allOf=[...d.allOf??[],...J.map(I=>({multipleOf:I}))])}},bS=(n,l,r,u)=>{r.type="boolean"},jS=(n,l,r,u)=>{r.not={}},xS=(n,l,r,u)=>{},SS=(n,l,r,u)=>{const d=n._zod.def,f=No(d.entries);if(f.length===0){r.not={};return}f.every(m=>typeof m=="number")&&(r.type="number"),f.every(m=>typeof m=="string")&&(r.type="string"),r.enum=f},_S=(n,l,r,u)=>{ci(n,l,r,u,"Custom types cannot be represented in JSON Schema")},NS=(n,l,r,u)=>{ci(n,l,r,u,"Transforms cannot be represented in JSON Schema")},AS=(n,l,r,u)=>{const d=r,f=n._zod.def,{minimum:m,maximum:p}=On(n);typeof m=="number"&&(d.minItems=m),typeof p=="number"&&(d.maxItems=p),d.type="array",d.items=_t(f.element,l,{...u,path:[...u.path,"items"]})};function Hr(n){const l=n._zod.def;return l.type==="pipe"&&l.in._zod.traits.has("$ZodTransform")?Hr(l.out):l.type==="catch"?Hr(l.innerType):n._zod.optin}const CS=(n,l,r,u)=>{const d=r,f=n._zod.def,m=f.shape;if(Object.getOwnPropertySymbols(m).length&&ci(n,l,d,u,"Symbol keys cannot be represented in JSON Schema"))return;d.type="object",d.properties={};for(const g in m)Ba(d.properties,g,_t(m[g],l,{...u,path:[...u.path,"properties",g]}));const v=[];for(const g of Object.keys(m)){const b=f.shape[g];(l.io==="input"?Hr(b)===void 0:b._zod.optout===void 0)&&v.push(g)}v.length>0&&(d.required=v),f.catchall?._zod.def.type==="never"?d.additionalProperties=!1:f.catchall?f.catchall&&(d.additionalProperties=_t(f.catchall,l,{...u,path:[...u.path,"additionalProperties"]})):l.io==="output"&&(d.additionalProperties=!1)},zS=(n,l,r,u)=>{const d=n._zod.def,f=d.inclusive===!1,m=d.options.map((p,v)=>_t(p,l,{...u,path:[...u.path,f?"oneOf":"anyOf",v]}));f?r.oneOf=m:r.anyOf=m},ES=(n,l,r,u)=>{const d=n._zod.def,f=_t(d.left,l,{...u,path:[...u.path,"allOf",0]}),m=_t(d.right,l,{...u,path:[...u.path,"allOf",1]}),p=g=>"allOf"in g&&Object.keys(g).length===1,v=[...p(f)?f.allOf:[f],...p(m)?m.allOf:[m]];r.allOf=v,l.intersections.push(v)};function To(n,l,r){if(l.$ref){if(r.has(l))return l;r.add(l);const M=n.get(l)?.def;if(!M)return l;const K=To(n,M,r);return K===M?l:K}for(const M of["anyOf","oneOf"]){const K=l[M];if(!Array.isArray(K))continue;const J=K.map(I=>To(n,I,r));J.some((I,ie)=>I!==K[ie])&&(l={...l,[M]:J})}const u=Array.isArray(l.type)?l.type:[l.type],d=!u.includes("string")&&u.some(M=>M==="number"||M==="integer"),f=l.enum??(l.const!==void 0?[l.const]:void 0);if(!d&&!f?.some(M=>typeof M=="number"))return l;const{minimum:m,maximum:p,exclusiveMinimum:v,exclusiveMaximum:g,multipleOf:b,format:j,id:C,...z}=l;return z.enum?z.enum=z.enum.map(M=>typeof M=="number"?String(M):M):typeof z.const=="number"&&(z.const=String(z.const)),d&&(z.type="string",f||(z.pattern=(u.includes("number")?Vo:qj).source)),z}const ko=new WeakMap;function wS(n){const l=new Map;for(const u of n.seen.values())u.def&&!l.has(u.schema)&&l.set(u.schema,u);const r=new Map;for(const u of ko.get(n)??[]){const d=n.seen.get(u),f=(d?.def??d?.schema)?.propertyNames;if(!f||f===!0||r.has(f))continue;const m=To(l,f,new Set);m!==f&&r.set(f,m)}if(r.size)for(const u of n.seen.values())for(const d of[u.schema,u.def]){const f=d&&r.get(d.propertyNames);f&&(d.propertyNames=f)}}const OS=(n,l,r,u)=>{const d=r,f=n._zod.def;d.type="object";const m=f.keyType,p=On(m).patterns;if(f.mode==="loose"&&p&&p.size>0){const b=_t(f.valueType,l,{...u,path:[...u.path,"patternProperties","*"]});d.patternProperties={};for(const j of p)Ba(d.patternProperties,Lv(j).source,b)}else{if(l.target==="draft-07"||l.target==="draft-2020-12"){d.propertyNames=_t(f.keyType,l,{...u,path:[...u.path,"propertyNames"]});let b=ko.get(l);b||(b=[],ko.set(l,b),l.deferred.push(()=>wS(l))),b.push(n)}d.additionalProperties=_t(f.valueType,l,{...u,path:[...u.path,"additionalProperties"]})}const v=m._zod.values,g=l.io==="input"&&Hr(f.valueType)!==void 0;if(v&&!f.partial&&!g){const b=[...v].filter(j=>typeof j=="string"||typeof j=="number");b.length>0&&(d.required=b.map(String))}},TS=(n,l,r,u)=>{const d=n._zod.def,f=_t(d.innerType,l,u),m=l.seen.get(n);l.target==="openapi-3.0"?(m.ref=d.innerType,r.nullable=!0):r.anyOf=[f,{type:"null"}]},kS=(n,l,r,u)=>{const d=n._zod.def;_t(d.innerType,l,u);const f=l.seen.get(n);f.ref=d.innerType},Fo=Symbol();function Bv(n,l,r,u,d){let f=!1;const m=JSON.stringify(n,(p,v)=>typeof v!="bigint"?v:(f=!0,null));return f?(ci(l,r,u,d,"BigInt defaults cannot be represented in JSON Schema"),Fo):JSON.parse(m)}const RS=(n,l,r,u)=>{const d=n._zod.def;_t(d.innerType,l,u);const f=l.seen.get(n);f.ref=d.innerType;const m=Bv(d.defaultValue,n,l,r,u);m!==Fo&&(r.default=m)},MS=(n,l,r,u)=>{const d=n._zod.def;_t(d.innerType,l,u);const f=l.seen.get(n);if(f.ref=d.innerType,l.io!=="input")return;const m=Bv(d.defaultValue,n,l,r,u);m!==Fo&&(r._prefault=m)},DS=(n,l,r,u)=>{const d=n._zod.def;_t(d.innerType,l,u);const f=l.seen.get(n);f.ref=d.innerType;let m;try{m=d.catchValue(void 0)}catch{ci(n,l,r,u,"Dynamic catch values are not supported in JSON Schema");return}r.default=m},US=(n,l,r,u)=>{const d=n._zod.def,f=d.in._zod.traits.has("$ZodTransform"),m=l.io==="input"?f?d.out:d.in:d.out;_t(m,l,u);const p=l.seen.get(n);p.ref=m},ZS=(n,l,r,u)=>{const d=n._zod.def;_t(d.innerType,l,u);const f=l.seen.get(n);f.ref=d.innerType,r.readOnly=!0},qv=(n,l,r,u)=>{const d=n._zod.def;_t(d.innerType,l,u);const f=l.seen.get(n);f.ref=d.innerType},Zp=new WeakSet([Object.prototype,Error.prototype]);function Er(n,l,r){Object.defineProperty(n,l,{configurable:!0,enumerable:!1,get(){const u=r(this);return Object.defineProperty(this,l,{value:u,configurable:!0,writable:!0}),u},set(u){Object.defineProperty(this,l,{value:u,configurable:!0,writable:!0})}})}const HS=(n,l)=>{ej.init(n,l),n.name="ZodError";const r=Object.getPrototypeOf(n);Zp.has(r)||(Zp.add(r),Er(r,"format",u=>d=>aj(u,d)),Er(r,"flatten",u=>d=>nj(u,d)),Er(r,"addIssue",u=>d=>{u.issues.push(d),u.message=JSON.stringify(u.issues,Ao,2)}),Er(r,"addIssues",u=>d=>{u.issues.push(...d),u.message=JSON.stringify(u.issues,Ao,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Sn=q("ZodError",HS,void 0,{Parent:Error}),$S=Yo(Sn),LS=Jo(Sn),BS=Ko(Sn),qS=Qo(Sn),GS=uj(Sn),YS=oj(Sn),JS=dj(Sn),KS=fj(Sn),QS=hj(Sn),VS=mj(Sn),XS=pj(Sn),IS=vj(Sn);function PS(){Tn.localeError||Gn(v0())}function Yr(){Tn.memoizer||Gn({memoizer:h0()})}const ht=q("ZodType",(n,l)=>(PS(),ft.init(n,l),n.def=l,n.type=l.type,n),{check(...n){const l=this.def;return this.clone(cn(l,{checks:[...l.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,l){return qa(this,n,l)},brand(){return this},register(n,l){return n.add(this,l),this},refine(n,l){return this.check(P1(n,l))},superRefine(n,l){return this.check(F1(n,l))},overwrite(n){return this.check(ri(n))},optional(){return Lp(this)},exactOptional(){return H1(this)},nullable(){return Bp(this)},nullish(){return Lp(Bp(this))},nonoptional(n){return Y1(this,n)},array(){return w1(this)},or(n){return k1([this,n])},and(n){return M1(this,n)},transform(n){return qp(this,Z1(n))},default(n){return B1(this,n)},prefault(n){return G1(this,n)},catch(n){return K1(this,n)},pipe(n){return qp(this,n)},readonly(){return X1(this)},describe(n){const l=this.clone();return ls.add(l,{description:n}),l},meta(...n){if(n.length===0)return ls.get(this);const l=this.clone();return ls.add(l,n[0]),l},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n,...l){return l.length===0?n(this):n(this,...l)},get"~standard"(){return cv(this,"~standard",{...vv(this),jsonSchema:{input:Zr(this,"input"),output:Zr(this,"output")}})},set"~standard"(n){La(this,"~standard",n)},parse:function n(l,r){return $S(this,l,r,{callee:n})},parseAsync:async function n(l,r){return await LS(this,l,r,{callee:n})},safeParse(n,l){return BS(this,n,l)},async safeParseAsync(n,l){return qS(this,n,l)},get spa(){return this?.safeParseAsync},set spa(n){La(this,"spa",n)},validate(n,l){return sj(this,n,l)},validateAsync(n,l){return cj(this,n,l)},encode:function n(l,r){return GS(this,l,r,{callee:n})},decode:function n(l,r){return YS(this,l,r,{callee:n})},encodeAsync:async function n(l,r){return await JS(this,l,r,{callee:n})},decodeAsync:async function n(l,r){return await KS(this,l,r,{callee:n})},safeEncode(n,l){return QS(this,n,l)},safeDecode(n,l){return VS(this,n,l)},async safeEncodeAsync(n,l){return XS(this,n,l)},async safeDecodeAsync(n,l){return IS(this,n,l)},toJSONSchema(n){return hS(this,{})(n)},get description(){return ls.get(this)?.description},get _def(){return this._zod.def}}),Gv=q("_ZodString",(n,l)=>{Io.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>gS(n,r,u)},uv({format:n=>On(n).format??null,minLength:n=>On(n).minimum??null,maxLength:n=>On(n).maximum??null},{regex(...n){return this.check(P0(...n))},includes(...n){return this.check(eS(...n))},startsWith(...n){return this.check(tS(...n))},endsWith(...n){return this.check(nS(...n))},min(...n){return this.check(Ur(...n))},max(...n){return this.check(wv(...n))},length(...n){return this.check(Ov(...n))},nonempty(...n){return this.check(Ur(1,...n))},lowercase(n){return this.check(F0(n))},uppercase(n){return this.check(W0(n))},trim(){return this.check(lS())},normalize(...n){return this.check(aS(...n))},toLowerCase(){return this.check(iS())},toUpperCase(){return this.check(sS())},slugify(){return this.check(rS())}})),FS=q("ZodString",(n,l)=>{Io.init(n,l),Gv.init(n,l)},{email(n){return this.check(j0(a1,n))},url(n){return this.check(C0(i1,n))},jwt(n){return this.check(B0(j1,n))},emoji(n){return this.check(z0(s1,n))},guid(n){return this.check(x0(l1,n))},uuid(n){return this.check(S0(wr,n))},uuidv4(n){return this.check(_0(wr,n))},uuidv6(n){return this.check(N0(wr,n))},uuidv7(n){return this.check(A0(wr,n))},nanoid(n){return this.check(E0(r1,n))},cuid(n){return this.check(w0(c1,n))},cuid2(n){return this.check(O0(u1,n))},ulid(n){return this.check(T0(o1,n))},base64(n){return this.check(H0(g1,n))},base64url(n){return this.check($0(y1,n))},xid(n){return this.check(k0(d1,n))},ksuid(n){return this.check(R0(f1,n))},ipv4(n){return this.check(M0(h1,n))},ipv6(n){return this.check(D0(m1,n))},cidrv4(n){return this.check(U0(p1,n))},cidrv6(n){return this.check(Z0(v1,n))},e164(n){return this.check(L0(b1,n))},datetime(n){return this.check(q0(WS,n))},date(n){return this.check(G0(e1,n))},time(n){return this.check(Y0(t1,n))},duration(n){return this.check(J0(n1,n))}});function Ha(n){return b0(FS,n)}const rt=q("ZodStringFormat",(n,l)=>{it.init(n,l),Gv.init(n,l)}),WS=q("ZodISODateTime",(n,l)=>{_x.init(n,l),rt.init(n,l)}),e1=q("ZodISODate",(n,l)=>{Nx.init(n,l),rt.init(n,l)}),t1=q("ZodISOTime",(n,l)=>{Ax.init(n,l),rt.init(n,l)}),n1=q("ZodISODuration",(n,l)=>{Cx.init(n,l),rt.init(n,l)}),a1=q("ZodEmail",(n,l)=>{ux.init(n,l),rt.init(n,l)}),l1=q("ZodGUID",(n,l)=>{rx.init(n,l),rt.init(n,l)}),wr=q("ZodUUID",(n,l)=>{cx.init(n,l),rt.init(n,l)}),i1=q("ZodURL",(n,l)=>{px.init(n,l),rt.init(n,l)}),s1=q("ZodEmoji",(n,l)=>{vx.init(n,l),rt.init(n,l)}),r1=q("ZodNanoID",(n,l)=>{gx.init(n,l),rt.init(n,l)}),c1=q("ZodCUID",(n,l)=>{yx.init(n,l),rt.init(n,l)}),u1=q("ZodCUID2",(n,l)=>{bx.init(n,l),rt.init(n,l)}),o1=q("ZodULID",(n,l)=>{jx.init(n,l),rt.init(n,l)}),d1=q("ZodXID",(n,l)=>{xx.init(n,l),rt.init(n,l)}),f1=q("ZodKSUID",(n,l)=>{Sx.init(n,l),rt.init(n,l)}),h1=q("ZodIPv4",(n,l)=>{zx.init(n,l),rt.init(n,l)}),m1=q("ZodIPv6",(n,l)=>{wx.init(n,l),rt.init(n,l)}),p1=q("ZodCIDRv4",(n,l)=>{Ox.init(n,l),rt.init(n,l)}),v1=q("ZodCIDRv6",(n,l)=>{kx.init(n,l),rt.init(n,l)}),g1=q("ZodBase64",(n,l)=>{Rx.init(n,l),rt.init(n,l)}),y1=q("ZodBase64URL",(n,l)=>{Dx.init(n,l),rt.init(n,l)}),b1=q("ZodE164",(n,l)=>{Ux.init(n,l),rt.init(n,l)}),j1=q("ZodJWT",(n,l)=>{Hx.init(n,l),rt.init(n,l)}),Yv=q("ZodNumber",(n,l)=>{Sv.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>yS(n,r,u,d),n.isFinite=!0},uv({minValue:n=>{const{minimum:l,exclusiveMinimum:r}=On(n);return Math.max(l??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:n=>{const{maximum:l,exclusiveMaximum:r}=On(n);return Math.min(l??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:n=>{const{isInt:l,multipleOf:r}=On(n);return!!l||!!r?.some(Number.isSafeInteger)},format:n=>On(n).format??null},{gt(n,l){return this.check(Ep(n,l))},gte(n,l){return this.check(bo(n,l))},min(n,l){return this.check(bo(n,l))},lt(n,l){return this.check(zp(n,l))},lte(n,l){return this.check(yo(n,l))},max(n,l){return this.check(yo(n,l))},int(n){return this.check(Hp(n))},safe(n){return this.check(Hp(n))},positive(n){return this.check(Ep(0,n))},nonnegative(n){return this.check(bo(0,n))},negative(n){return this.check(zp(0,n))},nonpositive(n){return this.check(yo(0,n))},multipleOf(n,l){return this.check(wp(n,l))},step(n,l){return this.check(wp(n,l))},finite(){return this}}));function x1(n){return K0(Yv,n)}const S1=q("ZodNumberFormat",(n,l)=>{$x.init(n,l),Yv.init(n,l)});function Hp(n){return Q0(S1,n)}const _1=q("ZodBoolean",(n,l)=>{Lx.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>bS(n,r,u)});function N1(n){return V0(_1,n)}const A1=q("ZodUnknown",(n,l)=>{Bx.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>xS()});function Ro(){return X0(A1)}const C1=q("ZodNever",(n,l)=>{qx.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>jS(n,r,u)});function z1(n){return I0(C1,n)}const E1=q("ZodArray",(n,l)=>{Yr(),Jx.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>AS(n,r,u,d),n.element=l.element},{min(n,l){return this.check(Ur(n,l))},nonempty(n){return this.check(Ur(1,n))},max(n,l){return this.check(wv(n,l))},length(n,l){return this.check(Ov(n,l))},unwrap(){return this.element}});function w1(n,l){return cS(E1,n,l)}const O1=q("ZodObject",(n,l)=>{Yr(),Vx.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>CS(n,r,u,d),Kb(n,"shape",r=>r._zod.def.shape,!1)},{keyof(){return $r(Object.keys(this._zod.def.shape))},catchall(n){return this.clone(cn(this._zod.def,{catchall:n}))},passthrough(){return this.clone(cn(this._zod.def,{catchall:Ro()}))},loose(){return this.clone(cn(this._zod.def,{catchall:Ro()}))},strict(){return this.clone(cn(this._zod.def,{catchall:z1()}))},strip(){return this.clone(cn(this._zod.def,{catchall:void 0}))},extend(n){return Db(this,n)},safeExtend(n){return Ub(this,n)},merge(n){return Zb(this,n)},pick(n){return Rb(this,n)},omit(n){return Mb(this,n)},partial(...n){return up(Kv,this,n[0])},exactPartial(...n){return up(Qv,this,n[0],"exactPartial")},required(...n){return Hb(Vv,this,n[0])}});function Jv(n,l){const r={type:"object",shape:n??{},...ge(l)};return new O1(r)}const T1=q("ZodUnion",(n,l)=>{Xx.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>zS(n,r,u,d),n.options=l.options});function k1(n,l){return new T1({type:"union",options:n,...ge(l)})}const R1=q("ZodIntersection",(n,l)=>{Ix.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>ES(n,r,u,d)});function M1(n,l){return new R1({type:"intersection",left:n,right:l})}const $p=q("ZodRecord",(n,l)=>{Yr(),Px.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>OS(n,r,u,d),n.keyType=l.keyType,n.valueType=l.valueType});function D1(n,l,r){return!l||!l._zod?new $p({type:"record",keyType:Ha(),valueType:n,...ge(l)}):new $p({type:"record",keyType:n,valueType:l,...ge(r)})}const Mo=q("ZodEnum",(n,l)=>{Fx.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(u,d,f)=>SS(n,u,d),n.enum=l.entries,n.options=[...n._zod.values];const r=new Set(Object.keys(l.entries));n.extract=(u,d)=>{const f={};for(const m of u)if(r.has(m))f[m]=l.entries[m];else throw new Error(`Key ${m} not found in enum`);return new Mo({...l,checks:[],...ge(d),entries:f})},n.exclude=(u,d)=>{const f={...l.entries};for(const m of u)if(r.has(m))delete f[m];else throw new Error(`Key ${m} not found in enum`);return new Mo({...l,checks:[],...ge(d),entries:f})}});function $r(n,l){const r=Array.isArray(n)?Object.fromEntries(n.map(u=>[u,u])):n;return new Mo({type:"enum",entries:r,...ge(l)})}const U1=q("ZodTransform",(n,l)=>{Yr(),Wx.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>NS(n,r,u,d),n._zod.parse=(r,u)=>{if(u.direction==="backward")throw new ov(n.constructor.name);r.addIssue=f=>{if(typeof f=="string")r.issues.push(rs(f,r.value,l));else{const m=f;m.fatal&&(m.continue=!1),m.code??(m.code="custom"),"input"in m||(m.input=r.value),m.inst??(m.inst=n),r.issues.push(rs(m))}};const d=l.transform(r.value,r);return d instanceof Promise?d.then(f=>(r.value=f,r)):(r.value=d,r)}});function Z1(n){return new U1({type:"transform",transform:n})}const Kv=q("ZodOptional",(n,l)=>{Av.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>qv(n,r,u,d),n.unwrap=()=>n._zod.def.innerType});function Lp(n){return new Kv({type:"optional",innerType:n})}const Qv=q("ZodExactOptional",(n,l)=>{e0.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>qv(n,r,u,d),n.unwrap=()=>n._zod.def.innerType});function H1(n){return new Qv({type:"optional",innerType:n})}const $1=q("ZodNullable",(n,l)=>{t0.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>TS(n,r,u,d),n.unwrap=()=>n._zod.def.innerType});function Bp(n){return new $1({type:"nullable",innerType:n})}const L1=q("ZodDefault",(n,l)=>{n0.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>RS(n,r,u,d),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function B1(n,l){return new L1({type:"default",innerType:n,get defaultValue(){return typeof l=="function"?l():lv(l)}})}const q1=q("ZodPrefault",(n,l)=>{a0.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>MS(n,r,u,d),n.unwrap=()=>n._zod.def.innerType});function G1(n,l){return new q1({type:"prefault",innerType:n,get defaultValue(){return typeof l=="function"?l():lv(l)}})}const Vv=q("ZodNonOptional",(n,l)=>{l0.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>kS(n,r,u,d),n.unwrap=()=>n._zod.def.innerType});function Y1(n,l){return new Vv({type:"nonoptional",innerType:n,...ge(l)})}const J1=q("ZodCatch",(n,l)=>{i0.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>DS(n,r,u,d),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function K1(n,l){return new J1({type:"catch",innerType:n,catchValue:typeof l=="function"?l:Vb(l)})}const Q1=q("ZodPipe",(n,l)=>{s0.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>US(n,r,u,d),n.in=l.in,n.out=l.out});function qp(n,l){return new Q1({type:"pipe",in:n,out:l})}const V1=q("ZodReadonly",(n,l)=>{r0.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>ZS(n,r,u,d),n.unwrap=()=>n._zod.def.innerType});function X1(n){return new V1({type:"readonly",innerType:n})}const I1=q("ZodCustom",(n,l)=>{c0.init(n,l),ht.init(n,l),n._zod.processJSONSchema=(r,u,d)=>_S(n,r,u,d)});function P1(n,l={}){return uS(I1,n,l)}function F1(n,l){return oS(n,l)}const W1=$r(["conversation","research","observation","consolidation","user_feedback","skill","system"]),e_=Jv({content:Ha().trim().min(1),type:$r(["episodic","semantic","procedural"]),scope:$r(["private","shared"]),source:W1,workspace_id:Ha().trim().min(1).refine(n=>n!=="*","Choose a specific workspace"),metadata:D1(Ha(),Ro()).optional()}).passthrough();Jv({service:Ha(),action:Ha(),status:x1().int(),ok:N1(),resourceId:Ha().optional(),errorCode:Ha().optional()}).strict();class Ft extends Error{status;constructor(l,r){super(l),this.name="ApiError",this.status=r}}async function ee(n,l={}){const r=l.body!==void 0?JSON.stringify(l.body):null,u=await fetch(n,{method:l.method??"GET",headers:{...r?{"content-type":"application/json"}:{},...l.headers??{}},credentials:"include",...r?{body:r}:{}});if(!u.ok){let d=`Request failed with status ${u.status}`;const f=await u.text();if(f)try{const m=JSON.parse(f);d=m.error??m.message??f}catch{d=f}throw new Ft(d,u.status)}if(u.status!==204)return await u.json()}function Me(n){return`/api/iam/${n.replace(/^\/+/,"")}`}const P={login(n,l){return ee("/api/auth/login",{method:"POST",body:{username:n,password:l}})},logout(){return ee("/api/auth/logout",{method:"POST"})},me(){return ee("/api/auth/me")},hiveStatus(){return ee("/api/hive/status")},hiveActors(){return ee("/api/hive/actors")},createHiveActor(n){return ee("/api/hive/actors",{method:"POST",body:n})},disableHiveActor(n,l){return ee(`/api/hive/actors/${encodeURIComponent(n)}/disable`,{method:"POST",body:l})},rotateHiveActor(n,l){return ee(`/api/hive/actors/${encodeURIComponent(n)}/rotate`,{method:"POST",body:l})},hiveIncidents(){return ee("/api/hive/incidents")},memoryConsole(){return ee("/api/memory/dashboard-data")},searchMemory(n){const l=new URLSearchParams;return n.query&&l.set("query",n.query),l.set("workspace_id",n.workspaceId??"*"),n.scope&&l.set("scope",n.scope),l.set("limit",String(n.limit??25)),l.set("offset",String(n.offset??0)),ee(`/api/memory/search?${l.toString()}`)},createMemory(n){return ee("/api/memory/memories",{method:"POST",body:e_.parse(n)})},getMemory(n){return ee(`/api/memory/memories/${encodeURIComponent(n)}`)},updateMemory(n,l){return ee(`/api/memory/memories/${encodeURIComponent(n)}`,{method:"PATCH",body:l})},deleteMemory(n){return ee(`/api/memory/memories/${encodeURIComponent(n)}`,{method:"DELETE"})},memoryGraph(n){return ee(`/api/memory/memories/${encodeURIComponent(n)}/graph`)},memoryQueue(n=12){return ee(`/api/memory/queue?limit=${n}`)},runMemoryQueueJob(n){return ee(`/api/memory/queue/${encodeURIComponent(n)}/run`,{method:"POST"})},retryMemoryQueueJob(n){return ee(`/api/memory/queue/${encodeURIComponent(n)}/retry`,{method:"POST"})},cancelMemoryQueueJob(n){return ee(`/api/memory/queue/${encodeURIComponent(n)}`,{method:"DELETE"})},memoryConflicts(n){return ee("/api/memory/conflicts",{method:"POST",body:n})},memoryWebhooks(){return ee("/api/memory/webhooks")},memoryWebhookDeliveries(n=10){return ee(`/api/memory/webhook-deliveries?limit=${n}`)},iamHealth(){return ee(Me("health"))},iamUsers(){return ee(Me("users?limit=100"))},createIamUser(n){return ee(Me("users"),{method:"POST",body:n})},updateIamUser(n,l){return ee(Me(`users/${n}`),{method:"PATCH",body:l})},deleteIamUser(n){return ee(Me(`users/${n}`),{method:"DELETE"})},assignIamUserRoles(n,l){const r={roleIds:l};return ee(Me(`users/${n}/roles`),{method:"POST",body:r})},removeIamUserRole(n,l){return ee(Me(`users/${n}/roles/${l}`),{method:"DELETE"})},lockIamUser(n){return ee(Me(`users/${n}/lock`),{method:"POST"})},unlockIamUser(n){return ee(Me(`users/${n}/unlock`),{method:"POST"})},rotateIamUserPassword(n,l){const r={password:l};return ee(Me(`users/${n}/rotate-password`),{method:"POST",body:r})},iamRoles(){return ee(Me("roles"))},createIamRole(n){return ee(Me("roles"),{method:"POST",body:n})},updateIamRole(n,l){return ee(Me(`roles/${n}`),{method:"PATCH",body:l})},deleteIamRole(n){return ee(Me(`roles/${n}`),{method:"DELETE"})},iamServiceAccounts(){return ee(Me("service-accounts"))},createIamServiceAccount(n){return ee(Me("service-accounts"),{method:"POST",body:n})},updateIamServiceAccount(n,l){return ee(Me(`service-accounts/${n}`),{method:"PATCH",body:l})},deleteIamServiceAccount(n){return ee(Me(`service-accounts/${n}`),{method:"DELETE"})},rotateIamServiceAccount(n){return ee(Me(`service-accounts/${n}/rotate`),{method:"POST"})},iamClients(){return ee(Me("clients"))},createIamClient(n){return ee(Me("clients"),{method:"POST",body:n})},updateIamClient(n,l){return ee(Me(`clients/${n}`),{method:"PATCH",body:l})},deleteIamClient(n){return ee(Me(`clients/${n}`),{method:"DELETE"})},iamSystemUsers(){return ee(Me("system-users"))},createIamSystemUser(n){return ee(Me("system-users"),{method:"POST",body:n})},updateIamSystemUser(n,l){return ee(Me(`system-users/${n}`),{method:"PATCH",body:l})},deleteIamSystemUser(n){return ee(Me(`system-users/${n}`),{method:"DELETE"})},iamSessions(){return ee(Me("sessions"))},revokeIamSession(n){return ee(Me(`sessions/${n}`),{method:"DELETE"})},deduplicateIamSessions(){return ee(Me("sessions/deduplicate"),{method:"POST"})},iamAudit(){return ee(Me("audit?limit=50"))},iamAuditStats(){return ee(Me("audit/stats"))},iamPasswordPolicy(){return ee(Me("password-policy"))},updateIamPasswordPolicy(n){return ee(Me("password-policy"),{method:"PATCH",body:n})},providers(){return ee("/api/providers")},createProvider(n){return ee("/api/providers",{method:"POST",body:n})},updateProvider(n,l){return ee(`/api/providers/${n}`,{method:"PUT",body:l})},deleteProvider(n){return ee(`/api/providers/${n}`,{method:"DELETE"})},codexOAuthStatus(){return ee("/api/providers/codex-oauth/status")},startCodexOAuth(){return ee("/api/providers/codex-oauth/start",{method:"POST"})},checkCodexOAuth(n){return ee("/api/providers/codex-oauth/check",{method:"POST",body:{loginId:n}})},aliases(){return ee("/api/model-aliases")},createAlias(n){return ee("/api/model-aliases",{method:"POST",body:n})},updateAlias(n,l){return ee(`/api/model-aliases/${n}`,{method:"PUT",body:l})},deleteAlias(n){return ee(`/api/model-aliases/${n}`,{method:"DELETE"})},routeRules(){return ee("/api/route-rules")},runRoutingTest(n){return ee("/api/testing/run",{method:"POST",body:n})},createRouteRule(n){return ee("/api/route-rules",{method:"POST",body:n})},updateRouteRule(n,l){return ee(`/api/route-rules/${n}`,{method:"PUT",body:l})},deleteRouteRule(n){return ee(`/api/route-rules/${n}`,{method:"DELETE"})},heuristics(){return ee("/api/heuristics")},createHeuristic(n){return ee("/api/heuristics",{method:"POST",body:n})},updateHeuristic(n,l){return ee(`/api/heuristics/${n}`,{method:"PUT",body:l})},deleteHeuristic(n){return ee(`/api/heuristics/${n}`,{method:"DELETE"})},clientKeys(){return ee("/api/client-keys")},createClientKey(n){return ee("/api/client-keys",{method:"POST",body:n})},updateClientKey(n,l){return ee(`/api/client-keys/${n}`,{method:"PUT",body:l})},rotateClientKey(n){return ee(`/api/client-keys/${n}/rotate`,{method:"POST"})},deleteClientKey(n){return ee(`/api/client-keys/${n}`,{method:"DELETE"})},telemetry(){return ee("/api/telemetry")},traces(){return ee("/api/traces")},audit(){return ee("/api/audit")},runtimeSettings(){return ee("/api/runtime-settings")},routingObjective(){return ee("/api/routing/objective")},updateRoutingObjective(n){return ee("/api/routing/objective",{method:"PUT",body:n})},exportConfig(){return ee("/api/config/export")},importConfig(n){return ee("/api/config/import",{method:"POST",body:n})},docsIndex(){return ee("/api-docs/index")}},t_={providers:[],aliases:[],routeRules:[],heuristics:[],clientKeys:[],telemetry:null,traces:[],audit:[],actors:[],incidents:[],runtimeSettings:[],docs:[],hiveStatus:null},Xv=k.createContext(null);function Dt(){const n=k.useContext(Xv);if(!n)throw new Error("useStore must be used within StoreProvider");return n}function n_({onAuthExpired:n,children:l}){const[r,u]=k.useState(t_),[d,f]=k.useState(!0),[m,p]=k.useState(!1),[v,g]=k.useState(null),[b,j]=k.useState([]),[C,z]=k.useState(null),[M,K]=k.useState({}),J=k.useRef(!0),I=k.useRef(0),ie=k.useCallback(async()=>{const X=++I.current;J.current?f(!0):p(!0),g(null),j([]);try{const se={providers:P.providers(),aliases:P.aliases(),routeRules:P.routeRules(),heuristics:P.heuristics(),clientKeys:P.clientKeys(),telemetry:P.telemetry(),traces:P.traces(),audit:P.audit(),actors:P.hiveActors(),incidents:P.hiveIncidents(),runtimeSettings:P.runtimeSettings(),docs:P.docsIndex(),hiveStatus:P.hiveStatus()},x=Object.keys(se),B=await Promise.allSettled(x.map(ue=>se[ue]));if(X!==I.current)return;const V=new Map,Q=[],ce=new Date().toISOString();K(ue=>{const $={...ue};for(let pe=0;pe<x.length;pe++){const qe=x[pe],tt=B[pe];tt.status==="fulfilled"?$[qe]={lastSuccess:ce,error:null}:$[qe]={lastSuccess:ue[qe]?.lastSuccess??null,error:tt.reason instanceof Error?tt.reason.message:"Request failed"}}return $});for(let ue=0;ue<x.length;ue++){const $=x[ue],pe=B[ue];if(pe.status==="fulfilled")V.set($,pe.value);else{if(pe.reason instanceof Ft&&pe.reason.status===401){n();return}Q.push(`${$}: ${pe.reason instanceof Error?pe.reason.message:"Unavailable"}`)}}j(Q),g(Q.length?`${Q.length} console sections failed to refresh; previous data remains visible`:null),u(ue=>({providers:V.get("providers")?.data??ue.providers,aliases:V.get("aliases")?.data??ue.aliases,routeRules:V.get("routeRules")?.data??ue.routeRules,heuristics:V.get("heuristics")?.data??ue.heuristics,clientKeys:V.get("clientKeys")?.data??ue.clientKeys,telemetry:V.get("telemetry")??ue.telemetry,traces:V.get("traces")?.data??ue.traces,audit:V.get("audit")?.data??ue.audit,actors:V.get("actors")?.data??ue.actors,incidents:V.get("incidents")?.data??ue.incidents,runtimeSettings:V.get("runtimeSettings")?.data??ue.runtimeSettings,docs:V.get("docs")?.docs??ue.docs,hiveStatus:V.get("hiveStatus")??ue.hiveStatus})),z(new Date)}catch(se){if(se instanceof Ft&&se.status===401){n();return}g(se instanceof Error?se.message:"Failed to load admin data")}finally{if(X!==I.current)return;J.current=!1,f(!1),p(!1)}},[n]);return k.useEffect(()=>{ie()},[ie]),i.jsx(Xv.Provider,{value:{data:r,loading:d,refreshing:m,error:v,loadIssues:b,lastSync:C,refresh:ie,onAuthExpired:n,resourceFreshness:M},children:l})}function lt(n){return{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round",...n}}const Y={Gauge:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("path",{d:"M12 14l4-4"}),i.jsx("path",{d:"M4 18a8 8 0 1 1 16 0"}),i.jsx("circle",{cx:"12",cy:"14",r:"1.2",fill:"currentColor",stroke:"none"})]}),Server:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("rect",{x:"3",y:"4",width:"18",height:"7",rx:"1.5"}),i.jsx("rect",{x:"3",y:"13",width:"18",height:"7",rx:"1.5"}),i.jsx("path",{d:"M7 7.5h.01M7 16.5h.01"})]}),Route:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("circle",{cx:"6",cy:"19",r:"2.4"}),i.jsx("circle",{cx:"18",cy:"5",r:"2.4"}),i.jsx("path",{d:"M8.4 19H14a3.5 3.5 0 0 0 0-7H10a3.5 3.5 0 0 1 0-7h5.6"})]}),Alias:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("path",{d:"M10 13a5 5 0 0 0 7 0l2-2a5 5 0 0 0-7-7l-1 1"}),i.jsx("path",{d:"M14 11a5 5 0 0 0-7 0l-2 2a5 5 0 0 0 7 7l1-1"})]}),Signal:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M4 14v3M9 10v7M14 6v11M19 3v14"})}),Activity:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M3 12h4l3 8 4-16 3 8h4"})}),Key:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("circle",{cx:"8",cy:"15",r:"4"}),i.jsx("path",{d:"M10.8 12.2 20 3M16 7l3 3M14 9l2 2"})]}),Scroll:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("path",{d:"M8 3h9a2 2 0 0 1 2 2v13a3 3 0 0 1-3 3H7"}),i.jsx("path",{d:"M19 18a2 2 0 1 0 4 0V6"}),i.jsx("path",{d:"M5 3a2 2 0 0 0-2 2v3h5V5a2 2 0 0 0-2-2Z"}),i.jsx("path",{d:"M9 8H3v10a3 3 0 0 0 3 3"}),i.jsx("path",{d:"M11 8h5M11 12h5M11 16h3"})]}),Book:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("path",{d:"M4 5a2 2 0 0 1 2-2h13v16H6a2 2 0 0 0-2 2z"}),i.jsx("path",{d:"M4 19a2 2 0 0 1 2-2h13"})]}),Settings:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("circle",{cx:"12",cy:"12",r:"3"}),i.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1Z"})]}),Plus:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M12 5v14M5 12h14"})}),Edit:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("path",{d:"M12 20h9"}),i.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),Trash:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6M10 11v6M14 11v6"})}),Refresh:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("path",{d:"M21 12a9 9 0 1 1-2.64-6.36L21 8"}),i.jsx("path",{d:"M21 3v5h-5"})]}),Logout:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),i.jsx("path",{d:"M16 17l5-5-5-5M21 12H9"})]}),Close:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),Check:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M20 6 9 17l-5-5"})}),Alert:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"}),i.jsx("path",{d:"M12 9v4M12 17h.01"})]}),Info:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("circle",{cx:"12",cy:"12",r:"9"}),i.jsx("path",{d:"M12 16v-4M12 8h.01"})]}),Copy:n=>i.jsxs("svg",{...lt(n),children:[i.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),i.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),Menu:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M3 6h18M3 12h18M3 18h18"})}),Download:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})}),Upload:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"})}),Hexagon:n=>i.jsx("svg",{...lt(n),children:i.jsx("path",{d:"M12 2.5 20.5 7v10L12 21.5 3.5 17V7Z"})})},Iv=n=>i.jsxs("svg",{className:n.className,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("defs",{children:i.jsxs("linearGradient",{id:"hs-g",x1:"0",y1:"0",x2:"0",y2:"1",children:[i.jsx("stop",{offset:"0%",stopColor:"#ffc940"}),i.jsx("stop",{offset:"100%",stopColor:"#b87a00"})]})}),i.jsxs("g",{transform:"translate(32,32)",children:[i.jsx("polygon",{points:"0,-22 19.05,-11 19.05,11 0,22 -19.05,11 -19.05,-11",fill:"none",stroke:"url(#hs-g)",strokeWidth:"2.5",strokeLinejoin:"round"}),i.jsx("polygon",{points:"-19.05,0 0,11 19.05,0",fill:"none",stroke:"url(#hs-g)",strokeWidth:"1.6",strokeLinejoin:"round",opacity:"0.7"}),i.jsx("circle",{r:"3.5",fill:"#ffc940"})]})]});function ni(n){if(n==null)return"";if(typeof n=="string")try{return JSON.stringify(JSON.parse(n),null,2)}catch{return n}return JSON.stringify(n,null,2)}function cs(n){const l=JSON.parse(n);if(!l||typeof l!="object"||Array.isArray(l))throw new Error("Expected a JSON object");return l}function un(n){if(!n)return"—";const l=new Date(String(n));return Number.isNaN(l.getTime())?String(n):l.toLocaleString(void 0,{month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Ct(n){if(!n)return"—";const l=new Date(String(n));if(Number.isNaN(l.getTime()))return String(n);const r=Date.now()-l.getTime(),u=Math.round(r/1e3);if(u<60)return`${u}s ago`;const d=Math.round(u/60);if(d<60)return`${d}m ago`;const f=Math.round(d/60);return f<24?`${f}h ago`:`${Math.round(f/24)}d ago`}function a_(n){const l=n.trim();if(!l)return"?";const r=l.split(/\s+/);return r.length===1?r[0].slice(0,2).toUpperCase():(r[0][0]+r[r.length-1][0]).toUpperCase()}function Do(n){return n<1e3?String(n):n<1e6?`${(n/1e3).toFixed(n%1e3===0?0:1)}k`:`${(n/1e6).toFixed(1)}M`}const Pv=k.createContext(null);function Ga(){const n=k.useContext(Pv);if(!n)throw new Error("useToast must be used within ToastProvider");return n}let l_=0;function i_({children:n}){const[l,r]=k.useState([]),u=k.useCallback(p=>{r(v=>v.filter(g=>g.id!==p))},[]),d=k.useCallback((p,v,g)=>{const b=l_+=1;r(j=>[...j,{id:b,tone:p,title:v,...g?{message:g}:{}}]),window.setTimeout(()=>u(b),p==="error"?6500:4e3)},[u]),f={push:d,success:(p,v)=>d("success",p,v),error:(p,v)=>d("error",p,v),info:(p,v)=>d("info",p,v)},m=p=>p==="success"?i.jsx(Y.Check,{className:"toast-ico"}):p==="error"?i.jsx(Y.Alert,{className:"toast-ico"}):i.jsx(Y.Info,{className:"toast-ico"});return i.jsxs(Pv.Provider,{value:f,children:[n,i.jsx("div",{className:"toast-stack",role:"status","aria-live":"polite",children:l.map(p=>i.jsxs("div",{className:`toast toast--${p.tone}`,onClick:()=>u(p.id),children:[m(p.tone),i.jsxs("div",{children:[i.jsx("strong",{children:p.title}),p.message?i.jsx("span",{children:p.message}):null]})]},p.id))})]})}function Yt(n,l){const r=n?.permissions??[];if(r.includes("*")||r.includes(l))return!0;const[u]=l.split(":");return r.includes(`${u}:*`)||r.some(d=>d.endsWith(":*")&&l.startsWith(d.slice(0,-1)))}const s_=["OPENAI","CODEX","OPENAI_GENERIC","OPENROUTER","ANTHROPIC","OLLAMA","LLAMACPP","VLLM"],r_=["NONE","BEARER","API_KEY","HEADER"],c_=["MODEL_ALIAS","PROVIDER_PREFERENCE","CAPABILITY","SAFETY","PASSTHROUGH","LOCAL_ONLY"];function le({variant:n="default",size:l,icon:r,loading:u,children:d,...f}){const m=["btn"];n!=="default"&&m.push(`btn--${n}`),l==="sm"&&m.push("btn--sm");const{disabled:p,...v}=f;return i.jsxs("button",{className:m.join(" "),disabled:u||p,...v,children:[u?i.jsx("span",{className:"spinner"}):r,d]})}function on({label:n,icon:l,variant:r="ghost",...u}){const d=["btn","btn--icon"];return r!=="default"&&d.push(`btn--${r}`),i.jsx("button",{className:d.join(" "),title:n,"aria-label":n,...u,children:l})}function _e({tone:n="muted",dot:l,children:r}){return i.jsxs("span",{className:`badge badge--${n}`,children:[l?i.jsx("span",{className:"dot"}):null,r]})}function us({enabled:n}){return i.jsx(_e,{tone:n?"teal":"muted",dot:!0,children:n?"Enabled":"Disabled"})}function Uo({status:n}){const l=(n??"unknown").toLowerCase(),r=l==="healthy"?"teal":l==="unknown"?"muted":"coral";return i.jsx(_e,{tone:r,dot:!0,children:l})}function Gp({outcome:n}){const l=n.toUpperCase(),r=l==="SUCCEEDED"?"teal":l==="DENIED"?"amber":l.includes("FAIL")?"coral":"sky";return i.jsx(_e,{tone:r,children:n.toLowerCase()})}function De({label:n,value:l,sub:r,accent:u="amber",emphasize:d}){const f={amber:"var(--amber)",teal:"var(--teal)",sky:"var(--sky)",violet:"var(--violet)",coral:"var(--coral)"};return i.jsxs("div",{className:"stat-card",style:{"--card-accent":f[u]},children:[i.jsx("span",{className:"stat-label",children:n}),i.jsx("span",{className:d?"stat-value accent":"stat-value",children:l}),r?i.jsx("span",{className:"stat-sub",children:r}):null]})}function je({title:n,eyebrow:l,actions:r,children:u,style:d}){return i.jsxs("section",{className:"panel",style:d,children:[i.jsxs("div",{className:"panel-header",children:[i.jsxs("div",{children:[l?i.jsx("p",{className:"panel-eyebrow",children:l}):null,i.jsx("h3",{children:n})]}),r?i.jsx("div",{className:"panel-actions",children:r}):null]}),u]})}function ae({label:n,hint:l,children:r}){return i.jsxs("label",{className:"field",children:[i.jsx("span",{className:"field-label",children:n}),r,l?i.jsx("span",{className:"field-hint",children:l}):null]})}function be({value:n,onChange:l,...r}){return i.jsx("input",{value:n,onChange:u=>l(u.target.value),...r})}function st({value:n,onChange:l,...r}){return i.jsx("textarea",{value:n,onChange:u=>l(u.target.value),...r})}function qn({value:n,onChange:l,options:r,...u}){return i.jsx("select",{value:n,onChange:d=>l(d.target.value),...u,children:r.map(d=>i.jsx("option",{value:d.value,children:d.label},d.value))})}function xn({checked:n,onChange:l,label:r}){return i.jsxs("label",{className:"toggle",children:[i.jsx("input",{type:"checkbox",checked:n,onChange:u=>l(u.target.checked)}),i.jsx("span",{className:"toggle-track"}),r]})}function St({icon:n,message:l}){return i.jsxs("div",{className:"empty-state",children:[n?i.jsx("div",{className:"empty-ico",children:n}):null,l]})}function dt({value:n}){let l;try{l=JSON.stringify(typeof n=="string"?JSON.parse(n):n,null,2)}catch{l=String(n)}return i.jsx("pre",{className:"code-block",children:l})}function kn({open:n,title:l,eyebrow:r,onClose:u,footer:d,children:f}){const m=k.useRef(null),p=k.useRef(u);return p.current=u,k.useEffect(()=>{if(!n)return;const v=document.activeElement instanceof HTMLElement?document.activeElement:null,g=()=>[...m.current?.querySelectorAll('button:not(:disabled), a[href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex="0"]')??[]].filter(j=>j.getClientRects().length>0);(g()[0]??m.current)?.focus();const b=j=>{if(j.key==="Escape"&&(j.preventDefault(),p.current()),j.key==="Tab"){const C=g(),z=C[0],M=C.at(-1);z?j.shiftKey&&(document.activeElement===z||!m.current?.contains(document.activeElement))?(j.preventDefault(),M?.focus()):!j.shiftKey&&(document.activeElement===M||!m.current?.contains(document.activeElement))&&(j.preventDefault(),z.focus()):(j.preventDefault(),m.current?.focus())}};return window.addEventListener("keydown",b),()=>{window.removeEventListener("keydown",b),v?.isConnected&&v.focus()}},[n]),n?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"scrim",onClick:u}),i.jsxs("aside",{ref:m,className:"drawer",role:"dialog","aria-modal":"true","aria-label":l,tabIndex:-1,children:[i.jsxs("div",{className:"drawer-header",children:[i.jsxs("div",{children:[r?i.jsx("p",{className:"panel-eyebrow",children:r}):null,i.jsx("h3",{children:l})]}),i.jsx(on,{label:"Close",icon:i.jsx(Y.Close,{}),onClick:u})]}),i.jsx("div",{className:"drawer-body",children:f}),d?i.jsx("div",{className:"drawer-footer",children:d}):null]})]}):null}function os({open:n,title:l,message:r,confirmLabel:u="Delete",onConfirm:d,onCancel:f,loading:m}){return n?i.jsx("div",{className:"modal-center",onClick:f,children:i.jsxs("div",{className:"confirm-box",onClick:p=>p.stopPropagation(),children:[i.jsx("h3",{children:l}),i.jsx("p",{children:r}),i.jsxs("div",{className:"confirm-actions",children:[i.jsx(le,{variant:"ghost",onClick:f,children:"Cancel"}),i.jsx(le,{variant:"danger",onClick:d,loading:m,icon:i.jsx(Y.Trash,{className:"btn-ico"}),children:u})]})]})}):null}function Wo({value:n,label:l}){const[r,u]=k.useState(!1);return i.jsxs("div",{className:"secret-reveal",children:[i.jsx("span",{style:{flex:1},children:n}),i.jsx(on,{label:l??"Copy",icon:r?i.jsx(Y.Check,{}):i.jsx(Y.Copy,{}),onClick:()=>{navigator.clipboard.writeText(n).then(()=>{u(!0),window.setTimeout(()=>u(!1),1600)})}})]})}function u_(n){const l=cs(n);for(const[r,u]of Object.entries(l))if(typeof u!="string")throw new Error("Header "+r+" must be a string");return l}function o_(n){const l=JSON.parse(n);if(!Array.isArray(l)||l.some(r=>!r||typeof r!="object"||Array.isArray(r)))throw new Error("Models must be a JSON array of objects");return l}function Yp(){return{slug:"",name:"",kind:"OPENAI_GENERIC",baseUrl:"https://api.openai.com/v1",authMode:"BEARER",authHeaderName:"Authorization",authSecret:"",defaultHeaders:"{}",capabilities:"{}",models:"[]",timeoutMs:"120000",maxRetries:"1",concurrency:"16",priority:"100",weight:"100",failoverGroup:"",enabled:!0}}function d_(n){return{slug:n.slug,name:n.name,kind:n.kind,baseUrl:n.baseUrl,authMode:n.authMode,authHeaderName:n.authHeaderName,authSecret:"",defaultHeaders:ni(n.defaultHeaders??{}),capabilities:ni(n.capabilities??{}),models:ni(n.models??[]),timeoutMs:String(n.timeoutMs),maxRetries:String(n.maxRetries),concurrency:String(n.concurrency),priority:String(n.priority),weight:String(n.weight),failoverGroup:n.failoverGroup??"",enabled:n.enabled}}function f_({currentUser:n}){const{data:l,refresh:r}=Dt(),u=Ga(),d=Yt(n,"router:providers:write"),[f,m]=k.useState(!1),[p,v]=k.useState(null),[g,b]=k.useState(Yp()),[j,C]=k.useState(!1),[z,M]=k.useState(null),[K,J]=k.useState(!1),[I,ie]=k.useState(!1),[X,se]=k.useState(!1),[x,B]=k.useState(null),[V,Q]=k.useState(null),[ce,ue]=k.useState(null),$=w=>b(S=>({...S,...w}));function pe(){v(null),b(Yp()),m(!0)}function qe(w){v(w),b(d_(w)),m(!0)}async function tt(){C(!0);try{const w={slug:g.slug.trim(),name:g.name.trim(),kind:g.kind,baseUrl:g.baseUrl.trim(),authMode:g.authMode,authHeaderName:g.authHeaderName.trim()||"Authorization",...g.authSecret?{authSecret:g.authSecret}:{},defaultHeaders:u_(g.defaultHeaders),capabilities:cs(g.capabilities),models:o_(g.models),timeoutMs:Number(g.timeoutMs),maxRetries:Number(g.maxRetries),concurrency:Number(g.concurrency),priority:Number(g.priority),weight:Number(g.weight),...g.failoverGroup.trim()?{failoverGroup:g.failoverGroup.trim()}:{},enabled:g.enabled};p?(await P.updateProvider(p.id,w),u.success("Provider updated",g.name)):(await P.createProvider(w),u.success("Provider created",g.name)),m(!1),await r()}catch(w){const S=w instanceof Ft||w instanceof Error?w.message:"Could not save provider";u.error("Save failed",S)}finally{C(!1)}}async function Pe(){if(z){J(!0);try{await P.deleteProvider(z.id),u.success("Provider removed",z.name),M(null),await r()}catch(w){u.error("Delete failed",w instanceof Error?w.message:"Could not delete provider")}finally{J(!1)}}}async function Z(){se(!0);try{const w=await P.codexOAuthStatus();B(w.data)}catch(w){u.error("Codex status failed",w instanceof Error?w.message:"Could not load Codex authorization status")}finally{se(!1)}}function F(w){ue(w),w.status==="authorized"&&(Q(null),B({authorized:!0,provider:w.provider??null,accountIdMasked:w.accountIdMasked??null,planType:w.planType??null,lastRefreshAt:w.lastRefreshAt??null,refreshTokenQuarantined:!1}))}async function fe(){se(!0),ue(null);try{const w=await P.startCodexOAuth();Q(w.data),ue({status:"pending"}),u.info("Codex authorization started","Open the authorization link and enter the displayed code.")}catch(w){u.error("Codex authorization failed",w instanceof Error?w.message:"Could not start Codex OAuth")}finally{se(!1)}}async function Ae(w=!0){if(V){w&&se(!0);try{const S=await P.checkCodexOAuth(V.loginId);F(S.data),S.data.status==="authorized"?(u.success("Codex authorized","OpenAI Codex is now registered as a provider."),await r()):w&&S.data.status==="pending"&&u.info("Still waiting","Complete the device authorization in the OpenAI window.")}catch(S){u.error("Codex check failed",S instanceof Error?S.message:"Could not check Codex authorization")}finally{w&&se(!1)}}}return k.useEffect(()=>{I&&Z()},[I]),k.useEffect(()=>{if(!I||!V||ce?.status==="authorized")return;const w=window.setInterval(()=>{P.checkCodexOAuth(V.loginId).then(async S=>{F(S.data),S.data.status==="authorized"&&(u.success("Codex authorized","OpenAI Codex is now registered as a provider."),await r())}).catch(()=>{})},Math.max(3,V.intervalSeconds)*1e3);return()=>window.clearInterval(w)},[I,V?.loginId,V?.intervalSeconds,ce?.status,r,u]),i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Providers"}),i.jsx("p",{children:"Upstream registry · failover groups · health posture."})]}),i.jsxs("div",{className:"inline-actions",children:[i.jsx(le,{variant:"ghost",icon:i.jsx(Y.Key,{className:"btn-ico"}),onClick:()=>ie(!0),children:"Authorize Codex"}),i.jsx(le,{variant:"primary",icon:i.jsx(Y.Plus,{className:"btn-ico"}),disabled:!d,onClick:pe,children:"Add Provider"})]})]}),i.jsx(je,{title:"Registered Providers",eyebrow:`${l.providers.length} total`,children:l.providers.length===0?i.jsx(St,{icon:i.jsx(Y.Server,{width:34,height:34}),message:"No providers yet — register your first upstream."}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Name"}),i.jsx("th",{children:"Kind"}),i.jsx("th",{children:"Base URL"}),i.jsx("th",{children:"Priority"}),i.jsx("th",{children:"Health"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Checked"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:l.providers.map(w=>i.jsxs("tr",{className:"row-clickable",onClick:()=>qe(w),children:[i.jsxs("td",{children:[i.jsx("span",{className:"cell-strong",children:w.name}),i.jsx("div",{className:"cell-mono",children:w.slug})]}),i.jsx("td",{children:i.jsx(_e,{tone:"sky",children:w.kind})}),i.jsx("td",{className:"cell-mono",children:w.baseUrl}),i.jsx("td",{className:"cell-mono",children:w.priority}),i.jsx("td",{children:i.jsx(Uo,{status:w.lastHealthStatus})}),i.jsx("td",{children:i.jsx(us,{enabled:w.enabled})}),i.jsx("td",{className:"cell-mono",children:w.lastHealthAt?Ct(w.lastHealthAt):"—"}),i.jsx("td",{children:i.jsxs("div",{className:"cell-actions",onClick:S=>S.stopPropagation(),children:[i.jsx(on,{label:"Edit",icon:i.jsx(Y.Edit,{}),onClick:()=>qe(w)}),i.jsx(on,{label:"Delete",variant:"danger",icon:i.jsx(Y.Trash,{}),disabled:!d,onClick:()=>M(w)})]})})]},w.id))})]})})}),i.jsxs(kn,{open:f,onClose:()=>m(!1),eyebrow:p?"Edit provider":"New provider",title:p?p.name:"Register Upstream",footer:i.jsxs(i.Fragment,{children:[p?i.jsx("span",{className:"spacer",children:i.jsx(Uo,{status:p.lastHealthStatus})}):null,i.jsx(le,{variant:"ghost",onClick:()=>m(!1),children:"Cancel"}),i.jsx(le,{variant:"primary",onClick:tt,loading:j,disabled:!d,icon:i.jsx(Y.Check,{className:"btn-ico"}),children:p?"Save changes":"Create provider"})]}),children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"Slug",hint:"Unique identifier",children:i.jsx(be,{value:g.slug,onChange:w=>$({slug:w}),placeholder:"openai-primary"})}),i.jsx(ae,{label:"Name",children:i.jsx(be,{value:g.name,onChange:w=>$({name:w}),placeholder:"OpenAI Primary"})}),i.jsx(ae,{label:"Kind",children:i.jsx(qn,{value:g.kind,onChange:w=>$({kind:w}),options:s_.map(w=>({value:w,label:w}))})}),i.jsx(ae,{label:"Base URL",children:i.jsx(be,{value:g.baseUrl,onChange:w=>$({baseUrl:w}),placeholder:"https://api.openai.com/v1"})}),i.jsx(ae,{label:"Auth Mode",children:i.jsx(qn,{value:g.authMode,onChange:w=>$({authMode:w}),options:r_.map(w=>({value:w,label:w}))})}),i.jsx(ae,{label:"Auth Header",children:i.jsx(be,{value:g.authHeaderName,onChange:w=>$({authHeaderName:w})})})]}),i.jsx(ae,{label:"Auth Secret",hint:p?"Leave blank to keep the current secret":"Stored encrypted at rest",children:i.jsx(be,{type:"password",value:g.authSecret,onChange:w=>$({authSecret:w}),placeholder:p&&p.authSecretMasked?p.authSecretMasked:"sk-..."})}),i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"Timeout (ms)",children:i.jsx(be,{value:g.timeoutMs,onChange:w=>$({timeoutMs:w}),inputMode:"numeric"})}),i.jsx(ae,{label:"Max Retries",children:i.jsx(be,{value:g.maxRetries,onChange:w=>$({maxRetries:w}),inputMode:"numeric"})}),i.jsx(ae,{label:"Concurrency",children:i.jsx(be,{value:g.concurrency,onChange:w=>$({concurrency:w}),inputMode:"numeric"})}),i.jsx(ae,{label:"Priority",hint:"Lower wins",children:i.jsx(be,{value:g.priority,onChange:w=>$({priority:w}),inputMode:"numeric"})}),i.jsx(ae,{label:"Weight",children:i.jsx(be,{value:g.weight,onChange:w=>$({weight:w}),inputMode:"numeric"})}),i.jsx(ae,{label:"Failover Group",hint:"Optional",children:i.jsx(be,{value:g.failoverGroup,onChange:w=>$({failoverGroup:w}),placeholder:"frontier"})})]}),i.jsx(ae,{label:"Default Headers (JSON object)",children:i.jsx(st,{value:g.defaultHeaders,onChange:w=>$({defaultHeaders:w}),spellCheck:!1})}),i.jsx(ae,{label:"Capabilities (JSON object)",children:i.jsx(st,{value:g.capabilities,onChange:w=>$({capabilities:w}),spellCheck:!1})}),i.jsx(ae,{label:"Models (JSON array)",hint:'e.g. [{"model":"gpt-4o","enabled":true}]',children:i.jsx(st,{value:g.models,onChange:w=>$({models:w}),spellCheck:!1})}),i.jsx("div",{className:"inline-actions",children:i.jsx(xn,{checked:g.enabled,onChange:w=>$({enabled:w}),label:"Enabled"})}),p&&p.lastHealthError?i.jsxs("div",{className:"error-banner",children:[i.jsx(Y.Alert,{}),p.lastHealthError]}):null]}),I?i.jsx("div",{className:"modal-center",onClick:()=>ie(!1),children:i.jsxs("section",{className:"codex-oauth-modal",role:"dialog","aria-modal":"true","aria-labelledby":"codex-oauth-title",onClick:w=>w.stopPropagation(),children:[i.jsxs("div",{className:"codex-oauth-head",children:[i.jsxs("div",{children:[i.jsx("p",{className:"panel-eyebrow",children:"Subscription-backed provider"}),i.jsx("h3",{id:"codex-oauth-title",children:"Authorize OpenAI Codex"})]}),i.jsx(on,{label:"Close",icon:i.jsx(Y.Close,{}),onClick:()=>ie(!1)})]}),i.jsx("p",{className:"codex-oauth-copy",children:"Connect Codex through OpenAI OAuth so hive-router can route eligible requests through the ChatGPT/Codex subscription path without storing an API key."}),i.jsxs("div",{className:"codex-oauth-status",children:[i.jsxs("div",{children:[i.jsx("span",{className:"panel-eyebrow",children:"Current authorization"}),i.jsxs("div",{className:"inline-actions",children:[i.jsx(_e,{tone:x?.authorized?"teal":x?.refreshTokenQuarantined?"coral":"amber",dot:!0,children:x?.authorized?"authorized":x?.refreshTokenQuarantined?"reauthorize":"not authorized"}),x?.provider?i.jsx(_e,{tone:"sky",children:x.provider.slug}):null,x?.planType?i.jsx(_e,{tone:"muted",children:x.planType}):null]})]}),i.jsx(le,{variant:"ghost",size:"sm",loading:X&&!V,onClick:()=>{Z()},children:"Refresh status"})]}),x?.accountIdMasked?i.jsxs("div",{className:"kv-list",children:[i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Account"}),i.jsx("span",{className:"cell-mono",children:x.accountIdMasked})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Last refresh"}),i.jsx("span",{className:"cell-mono",children:x.lastRefreshAt?Ct(x.lastRefreshAt):"never"})]})]}):null,V?i.jsxs("div",{className:"codex-device-card",children:[i.jsxs("div",{className:"codex-device-top",children:[i.jsxs("div",{children:[i.jsx("span",{className:"panel-eyebrow",children:"Device authorization"}),i.jsx("strong",{children:"Enter this code at OpenAI"})]}),i.jsx(_e,{tone:ce?.status==="authorized"?"teal":ce?.status==="error"?"coral":"amber",children:ce?.status??"pending"})]}),i.jsx(Wo,{value:V.userCode,label:"Copy Codex code"}),i.jsx("a",{className:"btn btn--primary",href:V.verificationUrl,target:"_blank",rel:"noreferrer",children:"Open authorization link"}),i.jsxs("span",{className:"field-hint",children:["Expires ",Ct(V.expiresAt),". This modal checks automatically every ",V.intervalSeconds,"s."]}),ce?.message?i.jsxs("div",{className:"error-banner",children:[i.jsx(Y.Alert,{}),ce.message]}):null]}):null,i.jsxs("div",{className:"confirm-actions",children:[i.jsx(le,{variant:"ghost",onClick:()=>ie(!1),children:"Close"}),V?i.jsx(le,{variant:"primary",onClick:()=>{Ae()},loading:X,disabled:!d,icon:i.jsx(Y.Refresh,{className:"btn-ico"}),children:"Check authorization"}):i.jsx(le,{variant:"primary",onClick:()=>{fe()},loading:X,disabled:!d,icon:i.jsx(Y.Key,{className:"btn-ico"}),children:"Start device authorization"})]})]})}):null,i.jsx(os,{open:!!z,title:"Delete provider?",message:`This permanently removes "${z?.name??""}" and its model registry. Routing rules referencing it may stop resolving.`,onConfirm:Pe,onCancel:()=>M(null),loading:K})]})}function si(n,l){return n instanceof Ft||n instanceof Error?n.message:l}function h_({currentUser:n}){const{data:l}=Dt(),[r,u]=k.useState("aliases"),d=Yt(n,"router:routing:write");return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"page-head",children:i.jsxs("div",{children:[i.jsx("h2",{children:"Routing"}),i.jsx("p",{children:"Aliases, deterministic rules, and scoring heuristics that shape every request."})]})}),i.jsxs("div",{className:"tabs",children:[i.jsxs("button",{className:r==="aliases"?"tab tab--active":"tab",onClick:()=>u("aliases"),children:["Model Aliases ",i.jsx("span",{className:"tab-count",children:l.aliases.length})]}),i.jsxs("button",{className:r==="rules"?"tab tab--active":"tab",onClick:()=>u("rules"),children:["Route Rules ",i.jsx("span",{className:"tab-count",children:l.routeRules.length})]}),i.jsxs("button",{className:r==="heuristics"?"tab tab--active":"tab",onClick:()=>u("heuristics"),children:["Heuristics ",i.jsx("span",{className:"tab-count",children:l.heuristics.length})]})]}),r==="aliases"?i.jsx(m_,{canWrite:d}):null,r==="rules"?i.jsx(p_,{canWrite:d}):null,r==="heuristics"?i.jsx(v_,{canWrite:d}):null]})}function m_({canWrite:n}){const{data:l,refresh:r}=Dt(),u=Ga(),[d,f]=k.useState(!1),[m,p]=k.useState(null),[v,g]=k.useState({alias:"",providerId:"",upstreamModel:"",description:"",enabled:!0}),[b,j]=k.useState(!1),[C,z]=k.useState(null),[M,K]=k.useState(!1),J=$=>g(pe=>({...pe,...$})),I=()=>l.providers[0]?.id??"",X=l.providers.find($=>$.id===v.providerId)?.kind==="LLAMACPP";function se(){p(null),g({alias:"",providerId:I(),upstreamModel:"",description:"",enabled:!0}),f(!0)}function x($){p($),g({alias:$.alias,providerId:$.providerId??"",upstreamModel:$.upstreamModel,description:$.description??"",enabled:$.enabled}),f(!0)}async function B(){j(!0);try{const $={alias:v.alias.trim(),upstreamModel:X?"":v.upstreamModel.trim(),enabled:v.enabled,...v.providerId?{providerId:v.providerId}:{},...v.description.trim()?{description:v.description.trim()}:{}};m?(await P.updateAlias(m.id,$),u.success("Alias updated",v.alias)):(await P.createAlias($),u.success("Alias created",v.alias)),f(!1),await r()}catch($){u.error("Save failed",si($,"Could not save alias"))}finally{j(!1)}}async function V(){if(C){K(!0);try{await P.deleteAlias(C.id),u.success("Alias removed",C.alias),z(null),await r()}catch($){u.error("Delete failed",si($,"Could not delete alias"))}finally{K(!1)}}}const Q=[...l.providers.map($=>({value:$.id,label:`${$.name} (${$.kind})`})),{value:"",label:"Dynamic provider selection"}];function ce($){const pe=l.providers.find(qe=>qe.id===$);J({providerId:$,...pe?.kind==="LLAMACPP"?{upstreamModel:""}:{}})}function ue($){return $.provider?.kind==="LLAMACPP"&&!$.upstreamModel?"provider native default (model omitted)":$.upstreamModel||"model omitted"}return i.jsxs(je,{title:"Model Aliases",eyebrow:"Friendly name → upstream model",actions:i.jsx(le,{variant:"primary",size:"sm",icon:i.jsx(Y.Plus,{className:"btn-ico"}),disabled:!n,onClick:se,children:"Add Alias"}),children:[l.aliases.length===0?i.jsx(St,{icon:i.jsx(Y.Alias,{width:34,height:34}),message:"No aliases defined."}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Alias"}),i.jsx("th",{children:"Upstream Model"}),i.jsx("th",{children:"Provider"}),i.jsx("th",{children:"Status"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:l.aliases.map($=>i.jsxs("tr",{className:"row-clickable",onClick:()=>x($),children:[i.jsx("td",{className:"cell-strong",children:$.alias}),i.jsx("td",{className:"cell-mono",children:ue($)}),i.jsx("td",{children:$.provider?i.jsx(_e,{tone:$.provider.kind==="LLAMACPP"?"teal":"sky",children:$.provider.name}):i.jsx(_e,{tone:"muted",children:"dynamic"})}),i.jsx("td",{children:i.jsx(us,{enabled:$.enabled})}),i.jsx("td",{children:i.jsxs("div",{className:"cell-actions",onClick:pe=>pe.stopPropagation(),children:[i.jsx(on,{label:"Edit",icon:i.jsx(Y.Edit,{}),disabled:!n,onClick:()=>x($)}),i.jsx(on,{label:"Delete",variant:"danger",icon:i.jsx(Y.Trash,{}),disabled:!n,onClick:()=>z($)})]})})]},$.id))})]})}),i.jsxs(kn,{open:d,onClose:()=>f(!1),eyebrow:m?"Edit alias":"New alias",title:m?m.alias:"Create Alias",footer:i.jsxs(i.Fragment,{children:[i.jsx(le,{variant:"ghost",onClick:()=>f(!1),children:"Cancel"}),i.jsx(le,{variant:"primary",onClick:B,loading:b,disabled:!n,icon:i.jsx(Y.Check,{className:"btn-ico"}),children:m?"Save changes":"Create alias"})]}),children:[i.jsx(ae,{label:"Alias",hint:"The model name clients request",children:i.jsx(be,{value:v.alias,onChange:$=>J({alias:$}),placeholder:"gpt-4o"})}),i.jsx(ae,{label:"Upstream Model",hint:X?"llama.cpp uses the model already loaded by the server; hive-router will omit the model field.":"The real model sent to the selected provider. Verified on save when the provider exposes a model list.",children:i.jsx(be,{value:X?"":v.upstreamModel,onChange:$=>J({upstreamModel:$}),placeholder:X?"Not required for llama.cpp":"gpt-4o-2024-08-06",disabled:X})}),i.jsx(ae,{label:"Provider",hint:"New aliases default to a concrete provider; choose Dynamic only when the router should decide at runtime.",children:i.jsx(qn,{value:v.providerId,onChange:ce,options:Q})}),X?i.jsxs("div",{className:"info-banner",children:[i.jsx(Y.Info,{}),"llama.cpp model selection is provider-native. This alias will save with an omitted upstream model and route to the selected llama.cpp provider."]}):null,i.jsx(ae,{label:"Description",hint:"Optional",children:i.jsx(be,{value:v.description,onChange:$=>J({description:$})})}),i.jsx("div",{className:"inline-actions",children:i.jsx(xn,{checked:v.enabled,onChange:$=>J({enabled:$}),label:"Enabled"})})]}),i.jsx(os,{open:!!C,title:"Delete alias?",message:`Clients requesting "${C?.alias??""}" will no longer resolve through this alias.`,onConfirm:V,onCancel:()=>z(null),loading:M})]})}function p_({canWrite:n}){const{data:l,refresh:r}=Dt(),u=Ga(),[d,f]=k.useState(!1),[m,p]=k.useState(null),[v,g]=k.useState({name:"",kind:"MODEL_ALIAS",priority:"100",matchJson:"{}",actionJson:"{}",enabled:!0}),[b,j]=k.useState(!1),[C,z]=k.useState(null),[M,K]=k.useState(!1),J=x=>g(B=>({...B,...x}));function I(){p(null),g({name:"",kind:"MODEL_ALIAS",priority:"100",matchJson:"{}",actionJson:"{}",enabled:!0}),f(!0)}function ie(x){p(x),g({name:x.name,kind:x.kind,priority:String(x.priority),matchJson:ni(x.matchJson),actionJson:ni(x.actionJson),enabled:x.enabled}),f(!0)}async function X(){j(!0);try{const x={name:v.name.trim(),kind:v.kind,priority:Number(v.priority),enabled:v.enabled,matchJson:cs(v.matchJson),actionJson:cs(v.actionJson)};m?(await P.updateRouteRule(m.id,x),u.success("Rule updated",v.name)):(await P.createRouteRule(x),u.success("Rule created",v.name)),f(!1),await r()}catch(x){u.error("Save failed",si(x,"Could not save rule"))}finally{j(!1)}}async function se(){if(C){K(!0);try{await P.deleteRouteRule(C.id),u.success("Rule removed",C.name),z(null),await r()}catch(x){u.error("Delete failed",si(x,"Could not delete rule"))}finally{K(!1)}}}return i.jsxs(je,{title:"Route Rules",eyebrow:"Deterministic match → action",actions:i.jsx(le,{variant:"primary",size:"sm",icon:i.jsx(Y.Plus,{className:"btn-ico"}),disabled:!n,onClick:I,children:"Add Rule"}),children:[l.routeRules.length===0?i.jsx(St,{icon:i.jsx(Y.Route,{width:34,height:34}),message:"No route rules defined."}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Name"}),i.jsx("th",{children:"Kind"}),i.jsx("th",{children:"Priority"}),i.jsx("th",{children:"Status"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:l.routeRules.map(x=>i.jsxs("tr",{className:"row-clickable",onClick:()=>ie(x),children:[i.jsx("td",{className:"cell-strong",children:x.name}),i.jsx("td",{children:i.jsx(_e,{tone:"violet",children:x.kind})}),i.jsx("td",{className:"cell-mono",children:x.priority}),i.jsx("td",{children:i.jsx(us,{enabled:x.enabled})}),i.jsx("td",{children:i.jsxs("div",{className:"cell-actions",onClick:B=>B.stopPropagation(),children:[i.jsx(on,{label:"Edit",icon:i.jsx(Y.Edit,{}),disabled:!n,onClick:()=>ie(x)}),i.jsx(on,{label:"Delete",variant:"danger",icon:i.jsx(Y.Trash,{}),disabled:!n,onClick:()=>z(x)})]})})]},x.id))})]})}),i.jsxs(kn,{open:d,onClose:()=>f(!1),eyebrow:m?"Edit rule":"New rule",title:m?m.name:"Create Route Rule",footer:i.jsxs(i.Fragment,{children:[i.jsx(le,{variant:"ghost",onClick:()=>f(!1),children:"Cancel"}),i.jsx(le,{variant:"primary",onClick:X,loading:b,disabled:!n,icon:i.jsx(Y.Check,{className:"btn-ico"}),children:m?"Save changes":"Create rule"})]}),children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"Name",children:i.jsx(be,{value:v.name,onChange:x=>J({name:x}),placeholder:"Prefer local for code"})}),i.jsx(ae,{label:"Priority",hint:"Lower runs first",children:i.jsx(be,{value:v.priority,onChange:x=>J({priority:x}),inputMode:"numeric"})})]}),i.jsx(ae,{label:"Kind",children:i.jsx(qn,{value:v.kind,onChange:x=>J({kind:x}),options:c_.map(x=>({value:x,label:x}))})}),i.jsx(ae,{label:"Match (JSON object)",hint:"Conditions that activate this rule",children:i.jsx(st,{value:v.matchJson,onChange:x=>J({matchJson:x}),spellCheck:!1,rows:6})}),i.jsx(ae,{label:"Action (JSON object)",hint:"What the router does on match",children:i.jsx(st,{value:v.actionJson,onChange:x=>J({actionJson:x}),spellCheck:!1,rows:6})}),i.jsx("div",{className:"inline-actions",children:i.jsx(xn,{checked:v.enabled,onChange:x=>J({enabled:x}),label:"Enabled"})})]}),i.jsx(os,{open:!!C,title:"Delete route rule?",message:`"${C?.name??""}" will no longer influence routing decisions.`,onConfirm:se,onCancel:()=>z(null),loading:M})]})}function v_({canWrite:n}){const{data:l,refresh:r}=Dt(),u=Ga(),[d,f]=k.useState(!1),[m,p]=k.useState(null),[v,g]=k.useState({name:"",category:"",pattern:"",score:"10",actionJson:'{"action":"rerank"}',enabled:!0}),[b,j]=k.useState(!1),[C,z]=k.useState(null),[M,K]=k.useState(!1),J=x=>g(B=>({...B,...x}));function I(){p(null),g({name:"",category:"",pattern:"",score:"10",actionJson:'{"action":"rerank"}',enabled:!0}),f(!0)}function ie(x){p(x),g({name:x.name,category:x.category,pattern:x.pattern,score:String(x.score),actionJson:ni(x.actionJson),enabled:x.enabled}),f(!0)}async function X(){j(!0);try{const x={name:v.name.trim(),category:v.category.trim(),pattern:v.pattern,score:Number(v.score),enabled:v.enabled,actionJson:cs(v.actionJson)};m?(await P.updateHeuristic(m.id,x),u.success("Heuristic updated",v.name)):(await P.createHeuristic(x),u.success("Heuristic created",v.name)),f(!1),await r()}catch(x){u.error("Save failed",si(x,"Could not save heuristic"))}finally{j(!1)}}async function se(){if(C){K(!0);try{await P.deleteHeuristic(C.id),u.success("Heuristic removed",C.name),z(null),await r()}catch(x){u.error("Delete failed",si(x,"Could not delete heuristic"))}finally{K(!1)}}}return i.jsxs(je,{title:"Heuristics",eyebrow:"Pattern → score adjustment",actions:i.jsx(le,{variant:"primary",size:"sm",icon:i.jsx(Y.Plus,{className:"btn-ico"}),disabled:!n,onClick:I,children:"Add Heuristic"}),children:[l.heuristics.length===0?i.jsx(St,{icon:i.jsx(Y.Signal,{width:34,height:34}),message:"No heuristics defined."}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Name"}),i.jsx("th",{children:"Category"}),i.jsx("th",{children:"Pattern"}),i.jsx("th",{children:"Score"}),i.jsx("th",{children:"Status"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:l.heuristics.map(x=>i.jsxs("tr",{className:"row-clickable",onClick:()=>ie(x),children:[i.jsx("td",{className:"cell-strong",children:x.name}),i.jsx("td",{children:i.jsx(_e,{tone:"amber",children:x.category})}),i.jsx("td",{className:"cell-mono",children:x.pattern}),i.jsx("td",{className:"cell-mono",children:x.score}),i.jsx("td",{children:i.jsx(us,{enabled:x.enabled})}),i.jsx("td",{children:i.jsxs("div",{className:"cell-actions",onClick:B=>B.stopPropagation(),children:[i.jsx(on,{label:"Edit",icon:i.jsx(Y.Edit,{}),disabled:!n,onClick:()=>ie(x)}),i.jsx(on,{label:"Delete",variant:"danger",icon:i.jsx(Y.Trash,{}),disabled:!n,onClick:()=>z(x)})]})})]},x.id))})]})}),i.jsxs(kn,{open:d,onClose:()=>f(!1),eyebrow:m?"Edit heuristic":"New heuristic",title:m?m.name:"Create Heuristic",footer:i.jsxs(i.Fragment,{children:[i.jsx(le,{variant:"ghost",onClick:()=>f(!1),children:"Cancel"}),i.jsx(le,{variant:"primary",onClick:X,loading:b,disabled:!n,icon:i.jsx(Y.Check,{className:"btn-ico"}),children:m?"Save changes":"Create heuristic"})]}),children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"Name",children:i.jsx(be,{value:v.name,onChange:x=>J({name:x}),placeholder:"Long context boost"})}),i.jsx(ae,{label:"Category",children:i.jsx(be,{value:v.category,onChange:x=>J({category:x}),placeholder:"context"})})]}),i.jsx(ae,{label:"Pattern",hint:"Regex or keyword matched against the request",children:i.jsx(be,{value:v.pattern,onChange:x=>J({pattern:x}),placeholder:"(?i)summarize"})}),i.jsx(ae,{label:"Score",hint:"Weight applied when the pattern matches",children:i.jsx(be,{value:v.score,onChange:x=>J({score:x}),inputMode:"numeric"})}),i.jsx(ae,{label:"Action (JSON object)",children:i.jsx(st,{value:v.actionJson,onChange:x=>J({actionJson:x}),spellCheck:!1,rows:5})}),i.jsx("div",{className:"inline-actions",children:i.jsx(xn,{checked:v.enabled,onChange:x=>J({enabled:x}),label:"Enabled"})})]}),i.jsx(os,{open:!!C,title:"Delete heuristic?",message:`"${C?.name??""}" will no longer adjust routing scores.`,onConfirm:se,onCancel:()=>z(null),loading:M})]})}const Jp=[{alias:"standard",title:"Standard reasoning",rationale:"Default trait for general chat, light tool-use, summaries, and routine planning.",prompt:"Draft a concise status update for a software team that explains what was shipped, what is blocked, and the next 3 tactical priorities."},{alias:"dangerous",title:"Sensitive / safety-critical",rationale:"Trait for high-stakes prompts that require stronger policy-aware routing.",prompt:"List security hardening checks for an API gateway before release, including key rotation, secret storage, and request allowlisting."},{alias:"internet_data",title:"Internet-facing data",rationale:"Trait for web, search, scrape, provider comparison, and external-data workflows.",prompt:"What are the top 3 performance and governance differences to verify when comparing cloud LLM providers for production routing?"},{alias:"hard",title:"Hard reasoning",rationale:"Trait for multi-step reasoning, planning, hard coding, and architecture work.",prompt:"Design a resilient event processing architecture for multi-region ingestion with idempotency guarantees and exactly-once side effects."},{alias:"coding",title:"Coding",rationale:"Dedicated coding profile for implementation, debugging, refactoring, and code-review tasks.",prompt:"Write a minimal TypeScript hello world program with a greet(name) function and one example call. Return only the code."}];function ed(n){try{return JSON.parse(n.actionJson)}catch{return{}}}function Kp(n){try{return JSON.parse(n)}catch{return n}}function g_(n){try{const l=JSON.parse(n.matchJson);return Array.isArray(l.models)?l.models.filter(r=>typeof r=="string"&&r.length>0):[]}catch{return[]}}function y_(n,l){const r=Zo(n,l);return r?ed(r).providerKinds??[]:[]}function Zo(n,l){return[...l].filter(r=>r.enabled).sort((r,u)=>r.priority-u.priority||r.name.localeCompare(u.name)).find(r=>g_(r).includes(n))}function b_(n){try{const l=JSON.parse(n);return typeof l.model=="string"?l.model:null}catch{return null}}function j_(n){return[...new Set(n)].filter(Boolean)}function Ho(n){if(Array.isArray(n))return n.length>0?n.map(l=>Ho(l)).join(", "):"[]";if(n==null||n==="")return"none";if(typeof n=="object")try{return JSON.stringify(n)}catch{return String(n)}return String(n)}function fl(n,l,r,u){return{path:n,expected:Ho(l),actual:Ho(r),status:u?"match":r==null||r===""?"missing":"diff"}}function x_(n){return n==="match"?"teal":n==="missing"?"amber":"coral"}function S_(n,l,r,u){const d=b_(r.requestBody),f=l?ed(l):{},m=r.selectedProvider?.kind??r.decision.selectedProviderKind??null,p=r.selectedProvider?.id??r.decision.selectedProviderId??null,v=j_(r.candidates.map(x=>x.kind)),g=r.candidates.map(x=>x.id),b=f.providerIds??[],j=l?r.decision.triggeredRuleNames.includes(l.name):!1,C=u.length===0||!!(m&&u.includes(m)),z=b.length===0||!!(p&&b.includes(p)),M=!!(m||p)&&C&&z,K=u.length===0?g.length>0:v.length>0&&v.every(x=>u.includes(x)),J=r.targetModel??n,I=d===J,ie=f.deny?f.denyReason??"denied by route rule":"2xx provider response",X=f.deny?!!r.decision.denialReason:r.success,se=[fl("match.models[0]",n,r.modelAlias,r.modelAlias===n),fl("routeRule.name -> decision.triggeredRuleNames",l?.name??"model-alias route rule",r.decision.triggeredRuleNames,j),fl("routeRule.action.providerKinds -> actual.selectedProvider.kind",u.length>0?u:"any enabled provider kind",m,C&&!!m),fl("routeRule.action.providerIds -> actual.selectedProvider.id",b.length>0?b:"no provider-id constraint",p,b.length>0?z:!0),fl("candidateProviderKinds",u.length>0?`subset of ${u.join(", ")}`:"any enabled provider kind",v,K),fl("requestBody.model",J,d,I),fl("execution.status",ie,r.success?`${r.statusCode}`:r.providerError??`${r.statusCode}`,X)];return{expected:{modelAlias:n,routeRule:l?{name:l.name,kind:l.kind,priority:l.priority,enabled:l.enabled,match:Kp(l.matchJson),action:Kp(l.actionJson)}:null,expectedProviderKinds:u,expectedProviderIds:b,assertions:{ruleMustTrigger:l?.name??null,selectedProviderKindMustBeOneOf:u,selectedProviderIdMustBeOneOf:b,upstreamRequestModelMustEqual:J,executionMust:ie}},actual:{request:{modelAlias:r.modelAlias,targetModel:r.targetModel,upstreamRequestModel:d,requestId:r.requestId},decision:{triggeredRuleNames:r.decision.triggeredRuleNames,selectedProviderKind:r.decision.selectedProviderKind,selectedProviderId:r.decision.selectedProviderId,candidateProviderKinds:v,candidateProviderIds:g,fallbackProviderIds:r.decision.fallbackProviderIds,confidence:r.decision.confidence,denialReason:r.decision.denialReason},execution:{success:r.success,statusCode:r.statusCode,latencyMs:r.latencyMs,selectedProvider:r.selectedProvider,attempts:r.attempts}},checks:[{label:"Rule",expected:l?.name??"model rule",actual:r.decision.triggeredRuleNames.join(", ")||"none",ok:j},{label:"Provider",expected:u.join(", ")||b.join(", ")||"any enabled provider",actual:b.length>0?p??"none":m??"none",ok:M},{label:"Upstream model",expected:J,actual:d??"unavailable",ok:I},{label:"Execution",expected:ie,actual:r.success?`${r.statusCode}`:r.providerError??`${r.statusCode}`,ok:X}],diffRows:se}}function __({alias:n,rule:l,result:r,expectedProviders:u}){const d=S_(n,l,r,u);return i.jsxs("div",{className:"route-audit",children:[i.jsxs("div",{className:"route-audit-head",children:[i.jsxs("div",{children:[i.jsx("span",{className:"panel-eyebrow",children:"Expected rule JSON -> actual route"}),i.jsx("strong",{children:l?.name??"No model rule matched"})]}),i.jsx(_e,{tone:d.checks.every(f=>f.ok)?"teal":"coral",children:d.checks.every(f=>f.ok)?"audit pass":"audit review"})]}),i.jsx("div",{className:"audit-check-grid",children:d.checks.map(f=>i.jsxs("div",{className:"audit-check",children:[i.jsxs("div",{className:"audit-check-top",children:[i.jsx("span",{children:f.label}),i.jsx(_e,{tone:f.ok?"teal":"coral",children:f.ok?"match":"diff"})]}),i.jsxs("div",{className:"audit-check-values",children:[i.jsxs("span",{className:"cell-mono",children:["expected: ",f.expected]}),i.jsxs("span",{className:"cell-mono",children:["actual: ",f.actual]})]})]},f.label))}),i.jsxs("div",{className:"route-diff-table","aria-label":"Expected rule to actual route diff",children:[i.jsxs("div",{className:"route-diff-head",children:[i.jsx("span",{children:"Audit path"}),i.jsx("span",{children:"Expected"}),i.jsx("span",{children:"Actual route"}),i.jsx("span",{children:"Status"})]}),d.diffRows.map(f=>i.jsxs("div",{className:`route-diff-row route-diff-row--${f.status}`,children:[i.jsx("span",{className:"cell-mono",children:f.path}),i.jsx("span",{className:"route-diff-value",children:f.expected}),i.jsx("span",{className:"route-diff-value",children:f.actual}),i.jsx("span",{children:i.jsx(_e,{tone:x_(f.status),children:f.status})})]},f.path))]}),i.jsxs("div",{className:"audit-json-flow",children:[i.jsxs("div",{children:[i.jsx("p",{className:"audit-json-label",children:"Expected rule JSON"}),i.jsx(dt,{value:d.expected})]}),i.jsx("div",{className:"audit-json-arrow","aria-hidden":"true",children:"->"}),i.jsxs("div",{children:[i.jsx("p",{className:"audit-json-label",children:"Actual route JSON"}),i.jsx(dt,{value:d.actual})]})]})]})}function N_(){const{data:n}=Dt(),l=Ga(),[r,u]=k.useState(null),[d,f]=k.useState(!1),[m,p]=k.useState({}),[v,g]=k.useState("{}"),b=k.useMemo(()=>{try{const Q=JSON.parse(v);return Q&&typeof Q=="object"&&!Array.isArray(Q)?Q:null}catch{return null}},[v]),[j,C]=k.useState(""),[z,M]=k.useState(""),[K,J]=k.useState(null),[I,ie]=k.useState(null),X=k.useMemo(()=>Jp.filter(Q=>n.aliases.some(ce=>ce.alias===Q.alias)),[n.aliases]);async function se(Q){u(Q.alias);try{const ce=await P.runRoutingTest({category:Q.title,modelAlias:Q.alias,prompt:Q.prompt,maxResponseChars:1800});p(ue=>({...ue,[Q.alias]:ce.data})),ie(ue=>ue?.modelAlias===Q.alias?ce.data:ue),l.success(`${Q.title} test complete`)}catch(ce){l.error("Run failed",ce instanceof Ft?ce.message:"Unable to run routing test")}finally{u(null)}}async function x(){f(!0);try{for(const Q of X)await se(Q)}finally{f(!1)}}function B(Q){return y_(Q,n.routeRules)}function V(Q){const ce=Zo(Q,n.routeRules);if(!ce)return"No explicit model rule found.";const ue=ed(ce);if(ue.deny)return ue.denyReason??`Denied by rule: ${ce.name}`;const $=ue.providerKinds??[];return $.length>0?`Route rule ${ce.name} targets providers: ${$.join(", ")}`:`Route rule ${ce.name} uses custom provider matching.`}return i.jsxs(i.Fragment,{children:[i.jsxs(je,{title:"Selection preview",eyebrow:"No model calls",children:[i.jsx(ae,{label:"Proposed configuration",hint:"JSON patch with objective, aliases, or rules. Alias and rule arrays replace their complete lists.",children:i.jsx(st,{rows:7,value:v,onChange:g})}),i.jsx(le,{onClick:()=>{fetch("/api/routing/revisions").then(Q=>Q.json()).then(Q=>{C(Q.revision),g(JSON.stringify(Q.config,null,2))}).catch(()=>l.error("Configuration unavailable"))},children:"Load current configuration"}),i.jsx(le,{disabled:!j||!b,onClick:()=>{fetch("/api/routing/revisions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({baseRevision:j,patch:b})}).then(async Q=>{const ce=await Q.json();if(!Q.ok)throw new Error(ce.error);M(ce.previousRevision),C(ce.revision),l.success("Routing configuration applied")}).catch(Q=>l.error(Q instanceof Error?Q.message:"Apply failed"))},children:"Apply configuration"}),i.jsx(le,{disabled:!z,onClick:()=>{fetch("/api/routing/revisions/"+z+"/rollback",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({baseRevision:j})}).then(async Q=>{const ce=await Q.json();if(!Q.ok)throw new Error(ce.error);C(ce.revision),g(JSON.stringify(ce.config,null,2)),M(""),l.success("Previous configuration restored")}).catch(()=>l.error("Rollback failed"))},children:"Restore previous configuration"}),i.jsx(le,{disabled:!b,onClick:()=>{fetch("/api/testing/preview",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...b,cases:Jp.map(Q=>({modelAlias:Q.alias,prompt:Q.prompt}))})}).then(async Q=>{const ce=await Q.json();if(!Q.ok)throw new Error(ce.message??ce.error);J(ce)}).catch(Q=>l.error(Q instanceof Error?Q.message:"Preview failed"))},children:"Compare proposed selection"}),K!==null&&i.jsx(dt,{value:K})]}),i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Testing"}),i.jsx("p",{children:"Profile the routing engine against seeded categories and measure provider selection + latency."})]}),i.jsx(le,{variant:"ghost",icon:i.jsx(Y.Refresh,{className:"btn-ico"}),loading:d,onClick:()=>{x()},disabled:r!==null,children:"Run all categories"})]}),X.length===0?i.jsx(je,{title:"Routing categories",eyebrow:"No seeded categories found",children:i.jsx(St,{icon:i.jsx(Y.Route,{width:34,height:34}),message:"Add model aliases first, then return here to run routing tests."})}):i.jsx("div",{className:"testing-grid",children:X.map(Q=>{const ce=n.aliases.find(Pe=>Pe.alias===Q.alias),ue=Zo(Q.alias,n.routeRules),$=m[Q.alias],pe=B(Q.alias),qe=!$?.selectedProvider||!pe.length?null:!!pe.includes($.selectedProvider.kind),tt=$?$.success?qe===!1?"amber":"teal":"coral":"amber";return i.jsxs(je,{title:`${Q.title} · ${Q.alias}`,eyebrow:ce?.description??Q.rationale,actions:i.jsxs("div",{className:"inline-actions",children:[i.jsx(_e,{tone:"amber",children:Q.alias}),i.jsx("span",{className:"muted",children:"/"}),i.jsx(_e,{tone:tt,children:$?$.success?"executed":"failed":"idle"}),i.jsx(le,{variant:"ghost",size:"sm",loading:r===Q.alias,onClick:()=>{se(Q)},disabled:r!==null||d,icon:i.jsx(Y.Activity,{className:"btn-ico"}),children:"Run"})]}),children:[i.jsx(ae,{label:"Seeded behavior",children:i.jsx(st,{value:V(Q.alias),onChange:()=>{},readOnly:!0,rows:3,spellCheck:!1})}),i.jsx(ae,{label:"Sample prompt",children:i.jsx(st,{value:Q.prompt,onChange:()=>{},readOnly:!0,rows:5,spellCheck:!1})}),pe.length>0?i.jsxs("div",{className:"test-tag-row",children:[i.jsx("span",{className:"panel-eyebrow",children:"Expected providers"}),i.jsx("div",{className:"test-tags",children:pe.map(Pe=>i.jsx(_e,{tone:"sky",children:Pe},Pe))})]}):null,$?i.jsxs("div",{className:"kv-list",style:{marginTop:12},children:[i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Latency"}),i.jsxs("span",{className:"cell-mono",children:[$.latencyMs," ms"]})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Upstream model"}),i.jsx("span",{className:"cell-mono",children:$.targetModel??$.modelAlias})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"HTTP status"}),i.jsx("span",{className:"cell-mono",children:$.statusCode})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Selected provider"}),i.jsx("span",{className:"cell-mono",children:$.selectedProvider?`${$.selectedProvider.name} (${$.selectedProvider.kind})`:"none"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Route status"}),i.jsx("span",{children:i.jsx(_e,{tone:$.success?"teal":"coral",children:$.success?"succeeded":"failed"})})]}),$.providerError?i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Provider error"}),i.jsx("span",{className:"cell-mono",children:$.providerError})]}):null]}):null,$?i.jsx(__,{alias:Q.alias,rule:ue,result:$,expectedProviders:pe}):null,$?i.jsxs(i.Fragment,{children:[i.jsx(ae,{label:"Output preview",hint:"Top-level reply content returned by the routed provider",children:i.jsx(st,{value:$.responsePreview,onChange:()=>{},readOnly:!0,rows:5,spellCheck:!1})}),i.jsx("div",{className:"inline-actions",style:{justifyContent:"flex-end"},children:i.jsx(le,{variant:"ghost",size:"sm",onClick:()=>ie($),children:"View decision JSON"})})]}):null]},Q.alias)})}),i.jsx(kn,{open:!!I,onClose:()=>ie(null),eyebrow:I?I.category:"Routing decision",title:I?`${I.category} · ${I.modelAlias}`:"",footer:i.jsx(le,{variant:"ghost",onClick:()=>ie(null),children:"Close"}),children:I?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"kv-list",children:[i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Request ID"}),i.jsx("span",{className:"cell-mono",children:I.requestId})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Candidates"}),i.jsx("span",{className:"cell-mono",children:I.candidates.map(Q=>Q.kind).join(" → ")||"none"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Selected provider kind"}),i.jsx("span",{className:"cell-mono",children:I.selectedProvider?.kind??"none"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Confidence"}),i.jsxs("span",{className:"cell-mono",children:[Math.round(I.decision.confidence*100),"%"]})]})]}),i.jsx("p",{className:"panel-eyebrow",style:{marginTop:18},children:"Decision payload"}),i.jsx(dt,{value:I.decision}),i.jsx("p",{className:"panel-eyebrow",style:{marginTop:18},children:"Candidate providers"}),i.jsx(dt,{value:I.candidates}),i.jsx("p",{className:"panel-eyebrow",style:{marginTop:18},children:"Provider attempts"}),i.jsx(dt,{value:I.attempts})]}):null})]})}function A_(){const{data:n,refresh:l,refreshing:r}=Dt(),[u,d]=k.useState(null);k.useEffect(()=>{const m=new URLSearchParams(location.search).get("trace");m&&d(n.traces.find(p=>p.id===m)??null)},[n.traces]);function f(m){d(m);const p=new URL(location.href);m?p.searchParams.set("trace",m.id):p.searchParams.delete("trace"),history.replaceState(null,"",p)}return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Traces"}),i.jsx("p",{children:"Per-request routing evidence — provider selection, outcome, and timing."})]}),i.jsx(le,{variant:"ghost",icon:i.jsx(Y.Refresh,{className:"btn-ico"}),loading:r,onClick:()=>{l()},children:"Refresh"})]}),i.jsx(je,{title:"Recent Requests",eyebrow:`${n.traces.length} traces`,children:n.traces.length===0?i.jsx(St,{icon:i.jsx(Y.Activity,{width:34,height:34}),message:"No traces recorded yet."}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"When"}),i.jsx("th",{children:"Route"}),i.jsx("th",{children:"Provider"}),i.jsx("th",{children:"Model"}),i.jsx("th",{children:"Outcome"}),i.jsx("th",{children:"Status"})]})}),i.jsx("tbody",{children:n.traces.map(m=>i.jsxs("tr",{className:"row-clickable",onClick:()=>f(m),children:[i.jsx("td",{className:"cell-mono",title:un(m.createdAt),children:Ct(m.createdAt)}),i.jsxs("td",{children:[i.jsx("span",{className:"cell-strong",children:m.routeKey??m.path}),i.jsxs("div",{className:"cell-mono",children:[m.method," ",m.path]})]}),i.jsx("td",{children:m.provider?.name?i.jsx(_e,{tone:"sky",children:m.provider.name}):i.jsx(_e,{tone:"muted",children:"—"})}),i.jsx("td",{className:"cell-mono",children:m.providerModel??"—"}),i.jsx("td",{children:i.jsx(Gp,{outcome:m.outcome})}),i.jsx("td",{className:"cell-mono",children:m.statusCode??"—"})]},m.id))})]})})}),i.jsx(kn,{open:!!u,onClose:()=>f(null),eyebrow:"Trace detail",title:u?`${u.method} ${u.path}`:"",footer:i.jsx(le,{variant:"ghost",onClick:()=>f(null),children:"Close"}),children:u?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"kv-list",children:[i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Outcome"}),i.jsx(Gp,{outcome:u.outcome})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Status"}),i.jsx("span",{className:"cell-mono",children:u.statusCode??"—"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Provider"}),i.jsx("span",{className:"cell-mono",children:u.provider?.name??u.providerKind??"—"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Model"}),i.jsx("span",{className:"cell-mono",children:u.providerModel??"—"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Route key"}),i.jsx("span",{className:"cell-mono",children:u.routeKey??"—"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Time"}),i.jsx("span",{className:"cell-mono",children:un(u.createdAt)})]})]}),u.events&&u.events.length>0?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"panel-eyebrow",style:{marginTop:22},children:"Event timeline"}),i.jsx(dt,{value:u.events})]}):null,i.jsx("p",{className:"panel-eyebrow",style:{marginTop:22},children:"Raw trace"}),i.jsx(dt,{value:u})]}):null})]})}function C_(n){if(!n)return"{}";try{const l=JSON.parse(n);if(l&&typeof l=="object"&&!Array.isArray(l))return JSON.stringify(l,null,2)}catch{}return n}function Qp(n){const l=n.trim();if(!l)return{};const r=JSON.parse(l);if(!r||typeof r!="object"||Array.isArray(r))throw new Error("Metadata must be a JSON object");return r}function z_(n){if(!n)return"—";try{const l=JSON.parse(n),r=Object.keys(l);return r.length===0?"{}":`${r.length} entries`}catch{return"invalid"}}function E_({currentUser:n}){const{data:l,refresh:r}=Dt(),u=Ga(),d=Yt(n,"router:keys:write"),[f,m]=k.useState(null),[p,v]=k.useState(""),[g,b]=k.useState("{}"),[j,C]=k.useState(!0),[z,M]=k.useState(!1),[K,J]=k.useState(null),[I,ie]=k.useState(null),[X,se]=k.useState(!1),x=k.useRef(0),[B,V]=k.useState(null),[Q,ce]=k.useState(null),ue=()=>{m("create"),v(""),b("{}"),C(!0),J(null),ie(null)},$=w=>{V(null),ce(null);const S=++x.current;fetch(`/api/client-keys/${encodeURIComponent(w.id)}/usage`).then(async U=>{if(!U.ok)throw new Error("Usage accounting unavailable");const te=await U.json();S===x.current&&V(te)}).catch(U=>{S===x.current&&ce(U instanceof Error?U.message:"Usage unavailable")}),m("edit"),v(w.name),b(C_(w.metadataJson)),C(w.enabled),J(null),ie(w)},pe=()=>{m(null),v(""),b("{}"),C(!0),J(null),ie(null)};async function qe(){let w;try{w=Qp(g)}catch(U){u.error("Invalid metadata",U instanceof Error?U.message:"Could not parse metadata JSON");return}const S=p.trim();if(S.length<2){u.error("Name required","Key name must be at least 2 characters");return}M(!0);try{if(f==="edit"&&I)await P.updateClientKey(I.id,{name:S,enabled:j,metadata:w}),u.success("API key updated","Changes were saved."),pe();else{const U=await P.createClientKey({name:S,metadata:w});J({name:S,apiKey:U.data.apiKey}),u.success("API key created","Copy it now — it is shown only once.")}await r()}catch(U){const te=U instanceof Ft||U instanceof Error?U.message:"Could not save key";u.error("Save failed",te)}finally{M(!1)}}async function tt(w,S){se(!0);try{await P.updateClientKey(w.id,{enabled:S}),u.success("API key updated",`Key ${S?"enabled":"disabled"}`),await r()}catch(U){u.error("Update failed",U instanceof Error?U.message:"Could not update key")}finally{se(!1)}}async function Pe(){if(I){se(!0);try{await P.deleteClientKey(I.id),u.success("Key deleted",I.name),ie(null),await r()}catch(w){u.error("Delete failed",w instanceof Error?w.message:"Could not delete key")}finally{se(!1)}}}const Z=f==="create",F=f!==null,fe=Z?"Issue API Key":"Edit API Key",Ae=K?`Key "${K.name}" was created and is valid once.`:"";return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"API Keys"}),i.jsx("p",{children:"OpenAI-compatible API credentials that downstream services use to reach the router."})]}),i.jsx(le,{variant:"primary",icon:i.jsx(Y.Plus,{className:"btn-ico"}),disabled:!d,onClick:ue,children:"Issue Key"})]}),i.jsx(je,{title:"Issued Keys",eyebrow:`${l.clientKeys.length} total`,children:l.clientKeys.length===0?i.jsx(St,{icon:i.jsx(Y.Key,{width:34,height:34}),message:"No client keys issued yet."}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Name"}),i.jsx("th",{children:"Prefix"}),i.jsx("th",{children:"Metadata"}),i.jsx("th",{children:"Created"}),i.jsx("th",{children:"Last Used"}),i.jsx("th",{children:"Status"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:l.clientKeys.map(w=>i.jsxs("tr",{children:[i.jsx("td",{className:"cell-strong",children:w.name}),i.jsxs("td",{className:"cell-mono",children:[w.keyPrefix,"…"]}),i.jsx("td",{children:z_(w.metadataJson)}),i.jsx("td",{className:"cell-mono",children:w.createdAt?un(w.createdAt):"—"}),i.jsx("td",{className:"cell-mono",children:w.lastUsedAt?Ct(w.lastUsedAt):"never"}),i.jsx("td",{children:i.jsx(us,{enabled:w.enabled})}),i.jsx("td",{children:i.jsxs("div",{className:"cell-actions",children:[i.jsx(on,{label:"Edit",variant:"default",icon:i.jsx(Y.Edit,{}),disabled:!d,onClick:()=>$(w)}),i.jsx(le,{size:"sm",variant:w.enabled?"ghost":"primary",disabled:!d,onClick:()=>tt(w,!w.enabled),children:w.enabled?"Disable":"Enable"}),i.jsx(on,{label:"Delete",variant:"danger",icon:i.jsx(Y.Trash,{}),disabled:!d,onClick:()=>ie(w)})]})})]},w.id))})]})})}),i.jsx(kn,{open:F,onClose:pe,eyebrow:fe,title:"API key details",footer:K&&Z?i.jsx(le,{variant:"primary",onClick:pe,icon:i.jsx(Y.Check,{className:"btn-ico"}),children:"Done"}):i.jsxs(i.Fragment,{children:[i.jsx(le,{variant:"ghost",onClick:pe,children:"Cancel"}),i.jsx(le,{variant:"primary",onClick:qe,loading:z,disabled:!d||p.trim().length<2,icon:i.jsx(Y.Key,{className:"btn-ico"}),children:Z?"Generate key":"Save changes"})]}),children:K&&Z?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"error-banner",style:{borderColor:"var(--teal)",color:"var(--teal)"},children:[i.jsx(Y.Info,{}),Ae]}),i.jsx("p",{children:"The key is shown once and will not be displayed again. Copy it now."}),i.jsx(ae,{label:`Key for "${K.name}"`,children:i.jsx(Wo,{value:K.apiKey,label:"Copy API key"})})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{children:`When ${Z?"issuing":"editing"}, provide a JSON metadata object. This field is optional.`}),i.jsx(ae,{label:"Name",hint:"Identify the consumer of this key",children:i.jsx(be,{value:p,onChange:v,placeholder:Z?"my-api production":"existing key name"})}),i.jsx(ae,{label:"Enabled",children:i.jsx(xn,{checked:j,onChange:C,label:"Enable this key immediately"})}),i.jsx("div",{className:"inline-actions",children:i.jsx(le,{onClick:()=>{try{b(JSON.stringify({...Qp(g),tracePrivacy:"metadata-only"},null,2))}catch{u.error("Invalid metadata")}},children:"Use metadata-only traces"})}),Q&&i.jsx("p",{role:"alert",children:Q}),B!==null&&i.jsx(je,{title:"Usage and budgets",eyebrow:"Null cost means price or usage is unknown",children:i.jsx(dt,{value:B})}),i.jsx(ae,{label:"Metadata",hint:'Optional JSON object e.g. {"service":"my-api","env":"prod"}',children:i.jsx(st,{value:g,onChange:b,rows:7,placeholder:"{}"})}),i.jsx(_e,{tone:Z?"sky":"muted",children:K?Ae:""})]})}),i.jsx(os,{open:!!I&&F===!1,title:I?`Delete key "${I?.name??""}"?`:"Delete key",confirmLabel:"Delete",message:`"${I?.name??""}" will be removed permanently.`,onConfirm:Pe,onCancel:()=>ie(null),loading:X})]})}function w_(){const{data:n,refresh:l,refreshing:r}=Dt(),[u,d]=k.useState(null);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Audit Log"}),i.jsx("p",{children:"Every administrative mutation, attributed and timestamped."})]}),i.jsx(le,{variant:"ghost",icon:i.jsx(Y.Refresh,{className:"btn-ico"}),loading:r,onClick:()=>{l()},children:"Refresh"})]}),i.jsx(je,{title:"Events",eyebrow:`${n.audit.length} records`,children:n.audit.length===0?i.jsx(St,{icon:i.jsx(Y.Scroll,{width:34,height:34}),message:"No audit events recorded."}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"When"}),i.jsx("th",{children:"Action"}),i.jsx("th",{children:"Entity"}),i.jsx("th",{children:"Actor"}),i.jsx("th",{children:"Type"})]})}),i.jsx("tbody",{children:n.audit.map(f=>i.jsxs("tr",{className:"row-clickable",onClick:()=>d(f),children:[i.jsx("td",{className:"cell-mono",title:un(f.createdAt),children:Ct(f.createdAt)}),i.jsx("td",{className:"cell-strong",children:f.action}),i.jsxs("td",{className:"cell-mono",children:[f.entityType??"—",f.entityId?i.jsxs("span",{className:"cell-mono",children:[" · ",f.entityId.slice(0,8)]}):null]}),i.jsx("td",{className:"cell-mono",children:f.adminUser?.username??"—"}),i.jsx("td",{children:i.jsx(_e,{tone:f.actorType==="admin"?"amber":"muted",children:f.actorType})})]},f.id))})]})})}),i.jsx(kn,{open:!!u,onClose:()=>d(null),eyebrow:"Audit event",title:u?.action??"",footer:i.jsx(le,{variant:"ghost",onClick:()=>d(null),children:"Close"}),children:u?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"kv-list",children:[i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Actor"}),i.jsx("span",{className:"cell-mono",children:u.adminUser?.username??u.actorType})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Entity"}),i.jsx("span",{className:"cell-mono",children:u.entityType??"—"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Entity ID"}),i.jsx("span",{className:"cell-mono",children:u.entityId??"—"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"When"}),i.jsx("span",{className:"cell-mono",children:un(u.createdAt)})]})]}),u.metadataJson?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"panel-eyebrow",style:{marginTop:22},children:"Metadata"}),i.jsx(dt,{value:u.metadataJson})]}):null]}):null})]})}const Vp=[{title:"Secret rotation",symptom:"Planned credential change or suspected exposure",action:"Run a dry-run rotation, review the redacted plan, then apply during a maintenance window.",command:"npm run rotate:secrets -- --host hive --kind all",target:"settings"},{title:"Rollback",symptom:"Router deploy fails health or the UI regresses after release",action:"Roll Router back to the previous retained release, then verify readiness and audit drift.",command:"npm run deploy -- --rollback",target:"routers"},{title:"Dependency degraded",symptom:"IAM Redis, Memory Qdrant, provider health, or SQLite checks are degraded",action:"Open the service page, inspect failing checks, repair the dependency, then restart only the affected service.",command:"npm run audit:deployments",target:"hive"},{title:"Certificate warning",symptom:"TLS cert is expired, near expiry, or does not match the public FQDN",action:"Redeploy Router with the expected certificate domain and verify the parsed TLS details.",command:"HIVE_ROUTER_CERT_DOMAIN=hive.example.com npm run deploy:router",target:"hive"},{title:"Memory queue backlog",symptom:"HiveMem queue or worker checks show warn/fail",action:"Open Memory, inspect queue state, retry or cancel stuck jobs, and check Qdrant before restarting HiveMem.",command:"curl --fail https://hive.example.com/v1/health/dependencies",target:"memories"},{title:"IAM lockout",symptom:"Operator cannot sign in or sessions are failing step-up/auth checks",action:"Use OS/PAM break-glass login, inspect IAM sessions/audit, then reset the admin password only if needed.",command:"IAM_RESET_PASSWORD=<known-password> npm run reset:admin",target:"iam-sessions"}];function O_(n){switch((n??"").toUpperCase()){case"GET":return"sky";case"POST":return"teal";case"PUT":case"PATCH":return"amber";case"DELETE":return"coral";default:return"muted"}}function T_({onNavigate:n}){const{data:l}=Dt(),[r,u]=k.useState(null),d=k.useMemo(()=>{const f=new Map;for(const m of l.docs){const p=m.scope??"general",v=f.get(p)??[];v.push(m),f.set(p,v)}return[...f.entries()].sort((m,p)=>m[0].localeCompare(p[0]))},[l.docs]);return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"page-head",children:i.jsxs("div",{children:[i.jsx("h2",{children:"Docs"}),i.jsx("p",{children:"Runbooks and endpoint surface grouped by scope."})]})}),i.jsx(je,{title:"Operator Runbooks",eyebrow:`${Vp.length} repairs`,children:i.jsx("div",{className:"runbook-grid",children:Vp.map(f=>i.jsxs("article",{className:"runbook-card",children:[i.jsxs("div",{children:[i.jsx("h3",{children:f.title}),i.jsx("p",{children:f.symptom})]}),i.jsx("p",{className:"runbook-action",children:f.action}),i.jsx("code",{children:f.command}),n?i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>n(f.target),children:"Open"}):null]},f.title))})}),l.docs.length===0?i.jsx(je,{title:"Endpoints",eyebrow:"0 documented",children:i.jsx(St,{icon:i.jsx(Y.Book,{width:34,height:34}),message:"No API documentation available."})}):d.map(([f,m])=>i.jsx(je,{title:f,eyebrow:`${m.length} endpoints`,children:i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Method"}),i.jsx("th",{children:"Path"}),i.jsx("th",{children:"Summary"})]})}),i.jsx("tbody",{children:m.map((p,v)=>i.jsxs("tr",{className:"row-clickable",onClick:()=>u(p),children:[i.jsx("td",{children:i.jsx(_e,{tone:O_(p.method),children:p.method??"—"})}),i.jsx("td",{className:"cell-mono",children:p.path??p.title??"—"}),i.jsx("td",{children:p.summary??p.description??"—"})]},p.id??`${f}-${v}`))})]})})},f)),i.jsx(kn,{open:!!r,onClose:()=>u(null),eyebrow:r?.method??"Endpoint",title:r?.path??r?.title??"",footer:i.jsx(le,{variant:"ghost",onClick:()=>u(null),children:"Close"}),children:r?i.jsxs(i.Fragment,{children:[r.description?i.jsx("p",{style:{color:"var(--text)",lineHeight:1.6},children:r.description}):null,i.jsx("p",{className:"panel-eyebrow",style:{marginTop:18},children:"Definition"}),i.jsx(dt,{value:r})]}):null})]})}const Xp=[{value:"balanced",label:"Balanced",copy:"Use quality, throughput, and cost together."},{value:"cheapest",label:"Cheapest",copy:"Prefer providers with lower declared token cost."},{value:"fastest",label:"Fastest",copy:"Prefer providers with higher declared throughput."},{value:"highest-quality",label:"Quality",copy:"Prefer providers with higher manual quality scores."}];function k_(n){const r=n.find(d=>d.key==="routing.objective")?.parsed;if(typeof r!="object"||r===null)return{goal:"balanced"};const u=r.goal;return{...r,goal:u==="cheapest"||u==="fastest"||u==="highest-quality"||u==="balanced"?u:"balanced"}}function R_({currentUser:n}){const{data:l,refresh:r}=Dt(),u=Ga(),d=Yt(n,"router:settings:write"),f=Yt(n,"router:routing:write"),[m,p]=k.useState(!1),[v,g]=k.useState(""),[b,j]=k.useState(!1),[C,z]=k.useState(!1),M=k_(l.runtimeSettings);async function K(){p(!0);try{const ie=await P.exportConfig(),X=new Blob([JSON.stringify(ie,null,2)],{type:"application/json"}),se=URL.createObjectURL(X),x=document.createElement("a");x.href=se,x.download=`hive-router-config-${new Date().toISOString().slice(0,10)}.json`,x.click(),URL.revokeObjectURL(se),u.success("Config exported")}catch(ie){u.error("Export failed",ie instanceof Error?ie.message:"Could not export config")}finally{p(!1)}}async function J(){let ie;try{ie=JSON.parse(v)}catch{u.error("Invalid JSON","The import payload is not valid JSON.");return}j(!0);try{await P.importConfig(ie),u.success("Config imported","Settings reconciled from payload."),g(""),await r()}catch(X){const se=X instanceof Ft||X instanceof Error?X.message:"Could not import config";u.error("Import failed",se)}finally{j(!1)}}async function I(ie){z(!0);try{await P.updateRoutingObjective({...M,goal:ie}),u.success("Routing objective saved",Xp.find(X=>X.value===ie)?.label??ie),await r()}catch(X){const se=X instanceof Ft||X instanceof Error?X.message:"Could not save routing objective";u.error("Save failed",se)}finally{z(!1)}}return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"page-head",children:i.jsxs("div",{children:[i.jsx("h2",{children:"Settings"}),i.jsx("p",{children:"Runtime configuration and full-config portability."})]})}),i.jsxs("div",{className:"grid-2",children:[i.jsx(je,{title:"Routing Objective",eyebrow:"Provider scoring",children:i.jsx("div",{className:"segmented-grid",children:Xp.map(ie=>i.jsxs("button",{type:"button",className:`segmented-card${M.goal===ie.value?" segmented-card--active":""}`,disabled:!f||C,onClick:()=>{I(ie.value)},children:[i.jsx("span",{children:ie.label}),i.jsx("small",{children:ie.copy})]},ie.value))})}),i.jsx(je,{title:"Export Configuration",eyebrow:"Backup",actions:i.jsx(le,{variant:"primary",size:"sm",icon:i.jsx(Y.Download,{className:"btn-ico"}),loading:m,onClick:K,children:"Download"}),children:i.jsx("p",{style:{color:"var(--muted-light)",lineHeight:1.6},children:"Download a complete snapshot of providers, aliases, routing rules, and heuristics as a portable JSON file."})}),i.jsxs(je,{title:"Import Configuration",eyebrow:"Restore",children:[i.jsx(ae,{label:"Config JSON",hint:"Paste a previously exported configuration payload",children:i.jsx(st,{value:v,onChange:g,spellCheck:!1,rows:6,placeholder:'{ "providers": [], "aliases": [] }'})}),i.jsx("div",{className:"inline-actions",style:{justifyContent:"flex-end"},children:i.jsx(le,{variant:"primary",icon:i.jsx(Y.Upload,{className:"btn-ico"}),loading:b,disabled:!d||!v.trim(),onClick:J,children:"Import"})})]})]}),i.jsx(je,{title:"Runtime Settings",eyebrow:`${l.runtimeSettings.length} keys`,children:l.runtimeSettings.length===0?i.jsx(St,{icon:i.jsx(Y.Settings,{width:34,height:34}),message:"No runtime settings configured."}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Key"}),i.jsx("th",{children:"Value"})]})}),i.jsx("tbody",{children:l.runtimeSettings.map(ie=>i.jsxs("tr",{children:[i.jsx("td",{className:"cell-strong",children:ie.key}),i.jsx("td",{children:i.jsx(dt,{value:ie.parsed??ie.valueJson})})]},ie.key))})]})})})]})}function M_(n){return n==="online"?"teal":n==="degraded"?"amber":"coral"}function D_(n,l){return n.find(r=>r.key===l)??null}function U_(n){const l=n?.details?.tlsCertificate;if(!l||typeof l!="object"||Array.isArray(l))return null;const r=l;return typeof r.configured!="boolean"||!r.status||typeof r.message!="string"||!Array.isArray(r.domains)?null:r}function Z_(n){const l=n?.details?.securityExporterJwks;if(!l||typeof l!="object"||Array.isArray(l))return null;const r=l;return!r.state||typeof r.remainingMs!="number"||typeof r.trustedKeyCount!="number"?null:r}function H_(n){return n==="pass"?"teal":n==="warn"?"amber":"coral"}function $_(n){if(!n)return"unknown";const l=new Date(n);return Number.isNaN(l.getTime())?n:l.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function L_({certificate:n}){if(!n)return null;const l=n.domains.length>0?n.domains.join(", "):n.expectedHost??"unknown";return i.jsx(je,{title:"TLS Certificate",eyebrow:"Public UI",actions:i.jsx(_e,{tone:H_(n.status),dot:!0,children:n.status}),children:i.jsxs("div",{className:"check-list",children:[i.jsxs("div",{className:"check-row",children:[i.jsxs("div",{children:[i.jsx("strong",{children:n.expectedHost??"public host"}),i.jsx("span",{children:n.message})]}),i.jsx(_e,{tone:n.hostnameMatched===!1?"coral":"teal",dot:!0,children:n.hostnameMatched===!1?"mismatch":"matched"})]}),i.jsx("div",{className:"check-row",children:i.jsxs("div",{children:[i.jsx("strong",{children:"Expires"}),i.jsxs("span",{children:[$_(n.validTo),typeof n.daysRemaining=="number"?` (${n.daysRemaining} days)`:""]})]})}),i.jsx("div",{className:"check-row",children:i.jsxs("div",{children:[i.jsx("strong",{children:"Domains"}),i.jsx("span",{children:l})]})}),i.jsx("div",{className:"check-row",children:i.jsxs("div",{children:[i.jsx("strong",{children:"Issuer"}),i.jsx("span",{children:n.issuer??"unknown"})]})})]})})}function B_({app:n,onNavigate:l}){const r=n.key==="router"?"Open console":"Open native",u=n.key==="iam"?"iam-overview":n.key==="memory"?"memories":"routers";return i.jsxs("article",{className:`app-status-card app-status-card--${n.key}`,children:[i.jsxs("div",{className:"app-status-top",children:[i.jsxs("div",{children:[i.jsx("p",{className:"panel-eyebrow",children:n.key}),i.jsx("h3",{children:n.name})]}),i.jsx(_e,{tone:M_(n.status),dot:!0,children:n.status})]}),i.jsx("p",{className:"app-status-role",children:n.role}),i.jsxs("div",{className:"app-status-summary",children:[i.jsx("span",{children:n.summary}),typeof n.latencyMs=="number"?i.jsxs("span",{children:[n.latencyMs," ms"]}):null]}),i.jsxs("div",{className:"service-actions",children:[l?i.jsxs("button",{className:"btn btn--ghost btn--sm",onClick:()=>l(u),children:[i.jsx(Y.Hexagon,{className:"btn-ico"}),"Focus"]}):null,i.jsxs("a",{className:"btn btn--ghost btn--sm",href:n.consoleUrl,target:"_blank",rel:"noreferrer",children:[i.jsx(Y.Route,{className:"btn-ico"}),r]})]})]})}function q_({onNavigate:n}){const{data:l}=Dt(),[r,u]=k.useState(null);k.useEffect(()=>{const C=new AbortController;return fetch("/api/hive/skills",{signal:C.signal}).then(z=>z.json()).then(u).catch(()=>{C.signal.aborted||u({configured:!0,ready:!1,error:"Registry status unavailable"})}),()=>C.abort()},[l.hiveStatus?.generatedAt]);const d=l.hiveStatus?.apps??[],f=d.filter(C=>C.status==="online").length,m=d.filter(C=>C.status==="degraded").length,p=d.filter(C=>C.status==="offline").length,v=l.hiveStatus?.generatedAt,g=D_(d,"router"),b=U_(g),j=Z_(g);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Hive Control Surface"}),i.jsx("p",{children:"Identity, memory, and routing status in one operator shell."})]}),v?i.jsxs(_e,{tone:"muted",children:["sampled ",Ct(v)]}):null]}),r?.configured&&i.jsxs(je,{title:"Skills registry",eyebrow:r.ready?"Ready":"Unavailable",children:[r.error&&i.jsx("p",{role:"alert",children:r.error}),i.jsxs("p",{children:[r.catalog?.length??0," enabled skills on this installation."]}),r.publicUrl&&i.jsx("a",{href:r.publicUrl,target:"_blank",rel:"noreferrer",children:"Open catalog and release channels"})]}),i.jsxs("section",{className:"hive-lattice","aria-label":"Hive service lattice",children:[i.jsxs("div",{className:"lattice-core",children:[i.jsx(Y.Hexagon,{width:42,height:42}),i.jsx("strong",{children:"Hive"})]}),d.map(C=>i.jsxs("button",{className:`lattice-node lattice-node--${C.key} lattice-node--${C.status}`,onClick:()=>n(C.key==="iam"?"iam-overview":C.key==="memory"?"memories":"routers"),children:[i.jsx("span",{children:C.name.replace("Hive ","")}),i.jsx("small",{children:C.status})]},C.key))]}),i.jsxs("div",{className:"stats-grid",children:[i.jsx(De,{label:"Apps Online",value:f,sub:`${d.length} registered`,accent:"teal",emphasize:!0}),i.jsx(De,{label:"Degraded",value:m,sub:"needs attention",accent:"amber"}),i.jsx(De,{label:"Offline",value:p,sub:"not reachable",accent:"coral"}),i.jsx(De,{label:"Router Traces",value:Do(l.telemetry?.totals.traces??0),sub:"traffic evidence",accent:"sky"}),i.jsx(De,{label:"TLS Cert",value:b?.status??"unknown",sub:b?.message??"not reported",accent:b?.status==="pass"?"teal":b?.status==="warn"?"amber":"coral"}),i.jsx(De,{label:"Exporter JWKS",value:j?.state??"unknown",sub:j?`${Math.ceil(j.remainingMs/1e3)}s remaining; ${j.trustedKeyCount} keys`:"not reported",accent:j?.state==="healthy"?"teal":j?.state==="expired"?"coral":"amber"})]}),i.jsx(L_,{certificate:b}),i.jsx("div",{className:"app-status-grid",children:d.map(C=>i.jsx(B_,{app:C,onNavigate:n},C.key))})]})}const Ip={overview:"IAM Overview",users:"Users",roles:"Roles","service-accounts":"Service Accounts",clients:"Clients",sessions:"Sessions","system-users":"System Users",security:"Security",audit:"Audit"},G_=["iam:users:read","iam:users:write","iam:users:delete","iam:roles:read","iam:roles:write","iam:sa:read","iam:sa:write","iam:sa:delete","iam:clients:read","iam:clients:write","iam:audit:read","iam:sessions:revoke","iam:system:login","iam:system:sudo","iam:system:deploy","iam:policy:write","iam:tokens:introspect"];function hl(n){return n.split(/[\n,]+/).map(l=>l.trim()).filter(Boolean)}const Y_=["authorization_code","refresh_token","client_credentials"];function J_(n){const l=new Set(Y_);return hl(n).filter(r=>l.has(r))}function K_(n){return n.map(l=>l.role.label||l.role.name).join(", ")||"No roles"}function Q_(n,l){const r=new Map(l.map(u=>[u.name,u.id]));return n.map(u=>u.roleId??r.get(u.role.name)).filter(u=>!!u)}function jo(n,l){return n.find(r=>r.name===l)?.id??n[0]?.id??""}function V_(n){return!n||Object.keys(n).length===0?"No detail":JSON.stringify(n)}function X_({section:n="overview",onNavigate:l,currentUser:r}){const[u,d]=k.useState([]),[f,m]=k.useState([]),[p,v]=k.useState([]),[g,b]=k.useState([]),[j,C]=k.useState([]),[z,M]=k.useState([]),[K,J]=k.useState(null),[I,ie]=k.useState([]),[X,se]=k.useState(null),[x,B]=k.useState(null),[V,Q]=k.useState(!1),[ce,ue]=k.useState(!1),[$,pe]=k.useState(null),[qe,tt]=k.useState(null),[Pe,Z]=k.useState(null),[F,fe]=k.useState({email:"",username:"",displayName:"",password:"",active:!0,roleId:""}),[Ae,w]=k.useState({userId:"",roleId:""}),[S,U]=k.useState({userId:"",password:""}),[te,re]=k.useState({name:"",description:"",clientId:"",roleId:"",allowedIps:""}),[me,xe]=k.useState({name:"",description:"",secret:"",grantTypes:"client_credentials",redirectUris:"",firstParty:!0}),[ve,He]=k.useState({id:"",name:"",label:"",description:"",permissions:"iam:tokens:introspect"}),[Ue,$t]=k.useState({userId:"",linuxUsername:"",authorizedHosts:"",sshPublicKey:"",sudoEnabled:!1}),Rn=k.useMemo(()=>f.map(N=>({value:N.id,label:`${N.label} (${N.name})`})),[f]),Ya=k.useMemo(()=>g.map(N=>({value:N.id,label:`${N.name} (${N.clientType})`})),[g]),Ja=k.useMemo(()=>u.map(N=>({value:N.id,label:`${N.displayName??N.username} (${N.email})`})),[u]),Nt=Yt(r,"iam:users:write"),_n=Yt(r,"iam:users:delete"),ct=Yt(r,"iam:roles:write"),Nn=Yt(r,"iam:sa:write"),Ut=Yt(r,"iam:sa:delete"),Mn=Yt(r,"iam:clients:write"),An=Yt(r,"iam:sessions:revoke"),Dn=Yt(r,"iam:policy:write"),Yn=k.useCallback(async()=>{Q(!0),pe(null);try{const[N,W,pt,Zt,de,Cn,ds,fs,ui,Va]=await Promise.all([P.iamHealth().catch(()=>null),P.iamAuditStats().catch(()=>null),P.iamSessions().catch(()=>({sessions:[]})),P.iamRoles(),P.iamUsers(),P.iamServiceAccounts(),P.iamClients(),P.iamSystemUsers().catch(()=>({systemUsers:[]})),P.iamAudit().catch(()=>({events:[],total:0,page:1,limit:50})),P.iamPasswordPolicy().catch(()=>null)]);B(N),J(W),M(pt.sessions),m(Zt.roles),d(de.users),v(Cn.serviceAccounts),b(ds.clients),C(fs.systemUsers),ie(ui.events),se(Va?.policy??null),fe(zt=>({...zt,roleId:zt.roleId||jo(Zt.roles,"VIEWER")})),w(zt=>({...zt,userId:zt.userId||de.users[0]?.id||"",roleId:zt.roleId||jo(Zt.roles,"VIEWER")})),U(zt=>({...zt,userId:zt.userId||de.users[0]?.id||""})),re(zt=>({...zt,clientId:zt.clientId||ds.clients[0]?.id||"",roleId:zt.roleId||jo(Zt.roles,"SERVICE")})),$t(zt=>({...zt,userId:zt.userId||de.users[0]?.id||""}))}catch(N){N instanceof Ft&&N.status===401?pe("Hive session expired. Sign in again."):pe(N instanceof Error?N.message:"Failed to load IAM data")}finally{Q(!1)}},[]);k.useEffect(()=>{Yn()},[Yn]);async function Ge(N,W){ue(!0),pe(null),tt(null),Z(null);try{const pt=await N();pt&&typeof pt=="object"&&"apiKey"in pt&&typeof pt.apiKey=="string"&&Z(pt.apiKey),tt(W),await Yn()}catch(pt){pe(pt instanceof Error?pt.message:"Operation failed")}finally{ue(!1)}}function ne(N){se(W=>W&&{...W,...N})}async function Ze(){X&&await Ge(()=>P.updateIamPasswordPolicy(X),"Password policy updated")}const Ce=u.filter(N=>N.active).length,nt=p.filter(N=>N.active).length,mt=g.filter(N=>N.active).length;f.filter(N=>!N.isSystem).length;const fa=z.length;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:Ip[n]}),i.jsx("p",{children:"Identity, access, service credentials, sessions, and audit controls."})]}),i.jsx(_e,{tone:"teal",dot:!0,children:"Router session"})]}),i.jsxs("div",{className:"ops-toolbar",children:[i.jsx("div",{className:"segmented-tabs",role:"tablist","aria-label":"IAM sections",children:Object.entries(Ip).map(([N,W])=>i.jsx("button",{className:n===N?"tab-button tab-button--active":"tab-button",onClick:()=>l?.(`iam-${N}`),children:W.replace("IAM ","")},N))}),i.jsx(le,{variant:"ghost",size:"sm",onClick:()=>{Yn()},loading:V,icon:i.jsx(Y.Refresh,{className:"btn-ico"}),children:"Refresh"})]}),$?i.jsxs("div",{className:"error-banner",children:[i.jsx(Y.Alert,{}),$]}):null,qe?i.jsxs("div",{className:"success-banner",children:[i.jsx(Y.Check,{}),qe]}):null,Pe?i.jsx(je,{title:"Secret shown once",eyebrow:"Store now",children:i.jsx(Wo,{value:Pe})}):null,Ka()]});function Ka(){return n==="overview"?Jr():n==="users"?Kr():n==="roles"?Qa():n==="service-accounts"?Lt():n==="clients"?Un():n==="sessions"?Bt():n==="system-users"?Qr():n==="security"?Vr():Xr()}function Jr(){const N=String(x?.status??"unknown");return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"stats-grid",children:[i.jsx(De,{label:"Login Users",value:u.length,sub:`${Ce} active`,accent:"violet",emphasize:!0}),i.jsx(De,{label:"Service Accounts",value:p.length,sub:`${nt} active`,accent:"sky"}),i.jsx(De,{label:"Clients",value:g.length,sub:`${mt} active`,accent:"amber"}),i.jsx(De,{label:"Active Sessions",value:fa,sub:`${K?.totalEvents??0} audit events / 30d`,accent:"teal"})]}),i.jsxs("div",{className:"grid-2",children:[i.jsx(je,{title:"IAM Core",eyebrow:"Health",children:i.jsx(_e,{tone:N==="healthy"?"teal":N==="unknown"?"muted":"coral",dot:!0,children:N})}),i.jsx(je,{title:"Recent sessions",eyebrow:"Access",children:i.jsx(ua,{empty:"No active sessions.",headers:["User","IP","Created","Expires"],children:z.slice(0,5).map(W=>i.jsxs("tr",{children:[i.jsx("td",{children:W.user?.email??W.userId}),i.jsx("td",{className:"cell-mono",children:W.ipAddress??"-"}),i.jsx("td",{children:Ct(W.createdAt)}),i.jsx("td",{children:Ct(W.expiresAt)})]},W.id))})})]})]})}function Kr(){return i.jsxs("div",{className:"iam-ops-grid",children:[i.jsxs(je,{title:"Create user",eyebrow:"Human account",children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"Email",children:i.jsx(be,{value:F.email,onChange:N=>fe(W=>({...W,email:N}))})}),i.jsx(ae,{label:"Username",children:i.jsx(be,{value:F.username,onChange:N=>fe(W=>({...W,username:N}))})}),i.jsx(ae,{label:"Display name",children:i.jsx(be,{value:F.displayName,onChange:N=>fe(W=>({...W,displayName:N}))})}),i.jsx(ae,{label:"Password",children:i.jsx(be,{type:"password",value:F.password,onChange:N=>fe(W=>({...W,password:N}))})}),i.jsx(ae,{label:"Initial role",children:i.jsx(qn,{value:F.roleId,onChange:N=>fe(W=>({...W,roleId:N})),options:Rn})}),i.jsx(xn,{checked:F.active,onChange:N=>fe(W=>({...W,active:N})),label:"Active"})]}),i.jsx(le,{variant:"primary",loading:ce,disabled:!Nt,icon:i.jsx(Y.Plus,{className:"btn-ico"}),onClick:()=>{Ge(()=>P.createIamUser({...F,roleIds:F.roleId?[F.roleId]:[]}),"User created")},children:"Create user"})]}),i.jsxs(je,{title:"Role and password",eyebrow:"Update",children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"User",children:i.jsx(qn,{value:Ae.userId,onChange:N=>{w(W=>({...W,userId:N})),U(W=>({...W,userId:N}))},options:Ja})}),i.jsx(ae,{label:"Role",children:i.jsx(qn,{value:Ae.roleId,onChange:N=>w(W=>({...W,roleId:N})),options:Rn})}),i.jsx(ae,{label:"New password",children:i.jsx(be,{type:"password",value:S.password,onChange:N=>U(W=>({...W,password:N}))})})]}),i.jsxs("div",{className:"form-actions",children:[i.jsx(le,{variant:"ghost",loading:ce,disabled:!ct,icon:i.jsx(Y.Key,{className:"btn-ico"}),onClick:()=>{Ge(()=>P.assignIamUserRoles(Ae.userId,[Ae.roleId]),"Role assigned")},children:"Assign role"}),i.jsx(le,{variant:"ghost",loading:ce,disabled:!Nt,icon:i.jsx(Y.Refresh,{className:"btn-ico"}),onClick:()=>{Ge(()=>P.rotateIamUserPassword(S.userId,S.password),"Password rotated")},children:"Rotate password"})]})]}),i.jsx(je,{title:"Users",eyebrow:"Directory",style:{gridColumn:"1 / -1"},children:i.jsx(ua,{empty:"No IAM users found.",headers:["User","Roles","Status","Last login","Actions"],children:u.map(N=>i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("strong",{children:N.displayName??N.username}),i.jsxs("span",{className:"row-sub",children:[N.email," / ",N.username]})]}),i.jsx("td",{children:i.jsx("span",{className:"role-chip-list",children:N.roles.map(W=>{const pt=W.roleId;return i.jsx("button",{className:"role-chip role-chip--button",disabled:!ct||!pt,onClick:()=>pt?void Ge(()=>P.removeIamUserRole(N.id,pt),"Role removed"):void 0,children:W.role.label},W.role.name)})})}),i.jsx("td",{children:i.jsx(_e,{tone:N.active?"teal":"muted",dot:!0,children:N.active?"active":"disabled"})}),i.jsx("td",{className:"cell-mono",children:N.lastLoginAt?Ct(N.lastLoginAt):"never"}),i.jsxs("td",{children:[i.jsxs("div",{className:"row-actions",children:[i.jsx(le,{size:"sm",variant:"ghost",disabled:!Nt,onClick:()=>{Ge(()=>P.updateIamUser(N.id,{active:!N.active}),N.active?"User disabled":"User enabled")},children:N.active?"Disable":"Enable"}),i.jsx(le,{size:"sm",variant:"ghost",disabled:!Nt,onClick:()=>{Ge(()=>P.lockIamUser(N.id),"User locked")},children:"Lock"}),i.jsx(le,{size:"sm",variant:"ghost",disabled:!Nt,onClick:()=>{Ge(()=>P.unlockIamUser(N.id),"User unlocked")},children:"Unlock"}),i.jsx(le,{size:"sm",variant:"danger",disabled:!_n,onClick:()=>window.confirm(`Delete ${N.username}?`)&&void Ge(()=>P.deleteIamUser(N.id),"User deleted"),children:"Delete"})]}),i.jsxs("span",{className:"row-sub",children:[Q_(N.roles,f).length," role ids assigned"]})]})]},N.id))})})]})}function Qa(){return i.jsxs("div",{className:"iam-ops-grid",children:[i.jsxs(je,{title:ve.id?"Update role":"Create role",eyebrow:"Permissions",children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"Role name",children:i.jsx(be,{value:ve.name,disabled:!!ve.id,onChange:N=>He(W=>({...W,name:N})),placeholder:"BOT_OPERATOR"})}),i.jsx(ae,{label:"Label",children:i.jsx(be,{value:ve.label,onChange:N=>He(W=>({...W,label:N}))})}),i.jsx(ae,{label:"Description",children:i.jsx(be,{value:ve.description,onChange:N=>He(W=>({...W,description:N}))})}),i.jsx(ae,{label:"Permissions",hint:"Comma or newline separated",children:i.jsx(st,{value:ve.permissions,onChange:N=>He(W=>({...W,permissions:N}))})})]}),i.jsx("div",{className:"permission-bank",children:G_.map(N=>i.jsx("button",{className:"role-chip role-chip--button",disabled:!ct,onClick:()=>He(W=>({...W,permissions:Array.from(new Set([...hl(W.permissions),N])).join(`
66
66
  `)})),children:N},N))}),i.jsxs("div",{className:"form-actions",children:[i.jsx(le,{variant:"primary",loading:ce,disabled:!ct,icon:i.jsx(Y.Check,{className:"btn-ico"}),onClick:()=>{Ge(()=>ve.id?P.updateIamRole(ve.id,{label:ve.label,description:ve.description,permissions:hl(ve.permissions)}):P.createIamRole({name:ve.name,label:ve.label,description:ve.description,permissions:hl(ve.permissions)}),ve.id?"Role updated":"Role created")},children:ve.id?"Save role":"Create role"}),ve.id?i.jsx(le,{variant:"ghost",onClick:()=>He({id:"",name:"",label:"",description:"",permissions:"iam:tokens:introspect"}),children:"New role"}):null]})]}),i.jsx(je,{title:"Roles",eyebrow:"RBAC",style:{gridColumn:"1 / -1"},children:i.jsx("div",{className:"pulse-grid",children:f.map(N=>i.jsxs("article",{className:"pulse-card",children:[i.jsxs("div",{className:"pulse-top",children:[i.jsx("span",{className:"pulse-name",children:N.label}),i.jsx(_e,{tone:N.isSystem?"amber":"teal",children:N.isSystem?"system":"custom"})]}),i.jsx("p",{className:"pulse-meta",children:N.description??"No description"}),i.jsx("p",{className:"cell-mono",style:{marginTop:8},children:N.name}),i.jsx("div",{className:"role-chip-list",style:{marginTop:10},children:N.permissions.slice(0,6).map(W=>i.jsx("span",{className:"role-chip",children:W},W))}),i.jsxs("div",{className:"row-actions",style:{marginTop:12},children:[i.jsx(le,{size:"sm",variant:"ghost",onClick:()=>He({id:N.id,name:N.name,label:N.label,description:N.description??"",permissions:N.permissions.join(`
67
- `)}),children:"Edit"}),i.jsx(le,{size:"sm",variant:"danger",disabled:N.isSystem||!ct,onClick:()=>window.confirm(`Delete ${N.name}?`)&&void Ge(()=>P.deleteIamRole(N.id),"Role deleted"),children:"Delete"})]})]},N.id))})})]})}function Lt(){return i.jsxs("div",{className:"iam-ops-grid",children:[i.jsxs(je,{title:"Create service account",eyebrow:"Technical identity",children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"Name",children:i.jsx(be,{value:te.name,onChange:N=>re(W=>({...W,name:N}))})}),i.jsx(ae,{label:"Client",children:i.jsx(qn,{value:te.clientId,onChange:N=>re(W=>({...W,clientId:N})),options:Ya})}),i.jsx(ae,{label:"Role",children:i.jsx(qn,{value:te.roleId,onChange:N=>re(W=>({...W,roleId:N})),options:Rn})}),i.jsx(ae,{label:"Allowed IPs",hint:"Comma or newline separated IPv4 addresses",children:i.jsx(st,{value:te.allowedIps,onChange:N=>re(W=>({...W,allowedIps:N}))})}),i.jsx(ae,{label:"Description",children:i.jsx(be,{value:te.description,onChange:N=>re(W=>({...W,description:N}))})})]}),i.jsx(le,{variant:"primary",loading:ce,disabled:!Nn,icon:i.jsx(Y.Plus,{className:"btn-ico"}),onClick:()=>{Ge(()=>P.createIamServiceAccount({...te,roleIds:te.roleId?[te.roleId]:[],allowedIps:hl(te.allowedIps)}),"Service account created")},children:"Create service account"})]}),i.jsx(je,{title:"Service accounts",eyebrow:"Keys",style:{gridColumn:"1 / -1"},children:i.jsx(ua,{empty:"No service accounts found.",headers:["Account","Client","Roles","Status","Actions"],children:p.map(N=>i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("strong",{children:N.name}),i.jsxs("span",{className:"row-sub",children:[N.description??"No description"," / ",N.apiKeyPrefix??N.keyPrefix??"no prefix"]})]}),i.jsx("td",{children:N.client?.name??"unlinked"}),i.jsx("td",{children:K_(N.roles)}),i.jsx("td",{children:i.jsx(_e,{tone:N.active?"teal":"muted",dot:!0,children:N.active?"active":"disabled"})}),i.jsx("td",{children:i.jsxs("div",{className:"row-actions",children:[i.jsx(le,{size:"sm",variant:"ghost",disabled:!Nn,onClick:()=>{Ge(()=>P.updateIamServiceAccount(N.id,{active:!N.active}),N.active?"Service account disabled":"Service account enabled")},children:N.active?"Disable":"Enable"}),i.jsx(le,{size:"sm",variant:"ghost",disabled:!Nn,onClick:()=>{Ge(()=>P.rotateIamServiceAccount(N.id),"API key rotated")},children:"Rotate key"}),i.jsx(le,{size:"sm",variant:"danger",disabled:!Ut,onClick:()=>window.confirm(`Delete ${N.name}?`)&&void Ge(()=>P.deleteIamServiceAccount(N.id),"Service account deleted"),children:"Delete"})]})})]},N.id))})})]})}function Un(){return i.jsxs("div",{className:"iam-ops-grid",children:[i.jsxs(je,{title:"Create client",eyebrow:"Bot registration",children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"Client name",children:i.jsx(be,{value:me.name,onChange:N=>xe(W=>({...W,name:N})),placeholder:"bot-scout"})}),i.jsx(ae,{label:"Client secret",children:i.jsx(be,{type:"password",value:me.secret,onChange:N=>xe(W=>({...W,secret:N}))})}),i.jsx(ae,{label:"Grant types",children:i.jsx(be,{value:me.grantTypes,onChange:N=>xe(W=>({...W,grantTypes:N}))})}),i.jsx(ae,{label:"Redirect URIs",children:i.jsx(st,{value:me.redirectUris,onChange:N=>xe(W=>({...W,redirectUris:N}))})}),i.jsx(ae,{label:"Description",children:i.jsx(be,{value:me.description,onChange:N=>xe(W=>({...W,description:N}))})}),i.jsx(xn,{checked:me.firstParty,onChange:N=>xe(W=>({...W,firstParty:N})),label:"First-party bot"})]}),i.jsx(le,{variant:"primary",loading:ce,disabled:!Mn,icon:i.jsx(Y.Plus,{className:"btn-ico"}),onClick:()=>{Ge(()=>P.createIamClient({name:me.name,description:me.description,secret:me.secret,clientType:"confidential",grantTypes:J_(me.grantTypes),redirectUris:hl(me.redirectUris),firstParty:me.firstParty,allowedIps:[]}),"Client created")},children:"Create client"})]}),i.jsx(je,{title:"Clients",eyebrow:"OAuth",style:{gridColumn:"1 / -1"},children:i.jsx(ua,{empty:"No clients found.",headers:["Client","Type","Grants","Status","Actions"],children:g.map(N=>i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("strong",{children:N.name}),i.jsx("span",{className:"row-sub",children:N.description??"No description"})]}),i.jsx("td",{children:N.clientType}),i.jsx("td",{children:N.grantTypes.join(", ")||"none"}),i.jsx("td",{children:i.jsx(_e,{tone:N.active?"teal":"muted",dot:!0,children:N.active?"active":"disabled"})}),i.jsx("td",{children:i.jsxs("div",{className:"row-actions",children:[i.jsx(le,{size:"sm",variant:"ghost",disabled:!Mn,onClick:()=>{Ge(()=>P.updateIamClient(N.id,{active:!N.active}),N.active?"Client disabled":"Client enabled")},children:N.active?"Disable":"Enable"}),i.jsx(le,{size:"sm",variant:"ghost",disabled:!Mn,onClick:()=>{Ge(()=>P.updateIamClient(N.id,{firstParty:!N.firstParty}),"Client trust flag updated")},children:N.firstParty?"Unmark first-party":"Mark first-party"}),i.jsx(le,{size:"sm",variant:"danger",disabled:!Mn,onClick:()=>window.confirm(`Delete ${N.name}?`)&&void Ge(()=>P.deleteIamClient(N.id),"Client deleted"),children:"Delete"})]})})]},N.id))})})]})}function Bt(){return i.jsx(je,{title:"Sessions",eyebrow:"Active access",actions:i.jsx(le,{size:"sm",variant:"ghost",loading:ce,disabled:!An,onClick:()=>{Ge(()=>P.deduplicateIamSessions(),"Duplicate sessions revoked")},children:"Deduplicate"}),children:i.jsx(ua,{empty:"No active sessions.",headers:["User","IP","Created","Expires","Actions"],children:z.map(N=>i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("strong",{children:N.user?.email??N.userId}),i.jsx("span",{className:"row-sub",children:N.userAgent??"No user agent"})]}),i.jsx("td",{className:"cell-mono",children:N.ipAddress??"-"}),i.jsx("td",{children:un(N.createdAt)}),i.jsx("td",{children:un(N.expiresAt)}),i.jsx("td",{children:i.jsx(le,{size:"sm",variant:"danger",disabled:!An,onClick:()=>window.confirm("Revoke this session?")&&void Ge(()=>P.revokeIamSession(N.id),"Session revoked"),children:"Revoke"})})]},N.id))})})}function Qr(){return i.jsxs("div",{className:"iam-ops-grid",children:[i.jsxs(je,{title:"Create system user",eyebrow:"Linux mapping",children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"IAM user",children:i.jsx(qn,{value:Ze.userId,onChange:N=>$t(W=>({...W,userId:N})),options:Ja})}),i.jsx(ae,{label:"Linux username",children:i.jsx(be,{value:Ze.linuxUsername,onChange:N=>$t(W=>({...W,linuxUsername:N}))})}),i.jsx(ae,{label:"Authorized hosts",children:i.jsx(st,{value:Ze.authorizedHosts,onChange:N=>$t(W=>({...W,authorizedHosts:N}))})}),i.jsx(ae,{label:"SSH public key",children:i.jsx(st,{value:Ze.sshPublicKey,onChange:N=>$t(W=>({...W,sshPublicKey:N}))})}),i.jsx(xn,{checked:Ze.sudoEnabled,onChange:N=>$t(W=>({...W,sudoEnabled:N})),label:"Sudo enabled"})]}),i.jsx(le,{variant:"primary",loading:ce,disabled:!Nt,icon:i.jsx(Y.Plus,{className:"btn-ico"}),onClick:()=>{Ge(()=>P.createIamSystemUser({...Ze,authorizedHosts:hl(Ze.authorizedHosts)}),"System user mapped")},children:"Create system user"})]}),i.jsx(je,{title:"System users",eyebrow:"Host access",style:{gridColumn:"1 / -1"},children:i.jsx(ua,{empty:"No system users mapped.",headers:["Linux user","IAM user","Hosts","Sudo","Actions"],children:j.map(N=>i.jsxs("tr",{children:[i.jsx("td",{children:i.jsx("strong",{children:N.linuxUsername})}),i.jsx("td",{children:N.user?.email??N.userId}),i.jsx("td",{children:N.authorizedHosts.join(", ")||"all governed hosts"}),i.jsx("td",{children:i.jsx(_e,{tone:N.sudoEnabled?"amber":"muted",children:N.sudoEnabled?"sudo":"standard"})}),i.jsx("td",{children:i.jsxs("div",{className:"row-actions",children:[i.jsx(le,{size:"sm",variant:"ghost",disabled:!Nt,onClick:()=>{Ge(()=>P.updateIamSystemUser(N.id,{sudoEnabled:!N.sudoEnabled}),"System user updated")},children:N.sudoEnabled?"Disable sudo":"Enable sudo"}),i.jsx(le,{size:"sm",variant:"danger",disabled:!_n,onClick:()=>window.confirm(`Delete ${N.linuxUsername}?`)&&void Ge(()=>P.deleteIamSystemUser(N.id),"System user deleted"),children:"Delete"})]})})]},N.id))})})]})}function Vr(){const N=u.filter(de=>de.mfaEnabled).length,W=u.reduce((de,Cn)=>de+(Cn.passkeyCount??0),0),mt=u.reduce((de,Cn)=>de+(Cn.trustedDeviceCount??0),0),Zt=z.filter(de=>typeof de.riskScore=="number"&&de.riskScore>=.5);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"stats-grid",children:[i.jsx(Ue,{label:"MFA Enabled",value:N,sub:`${u.length-N} without MFA`,accent:u.length-N>0?"amber":"teal",emphasize:!0}),i.jsx(Ue,{label:"Passkeys",value:W,sub:"registered WebAuthn credentials",accent:"violet"}),i.jsx(Ue,{label:"Trusted Devices",value:mt,sub:"registered device fingerprints",accent:"sky"}),i.jsx(Ue,{label:"Risky Sessions",value:Zt.length,sub:"step-up candidates",accent:Zt.length?"coral":"teal"})]}),i.jsxs("div",{className:"grid-2",children:[i.jsx(je,{title:"MFA And Passkeys",eyebrow:"Users",children:i.jsx(ua,{empty:"No IAM users found.",headers:["User","MFA","Passkeys","Devices","Password"],children:u.map(de=>i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("strong",{children:de.displayName??de.username}),i.jsx("span",{className:"row-sub",children:de.email})]}),i.jsx("td",{children:i.jsx(_e,{tone:de.mfaEnabled?"teal":"amber",dot:!0,children:de.mfaEnabled?"enabled":"off"})}),i.jsx("td",{className:"cell-mono",children:de.passkeyCount??0}),i.jsx("td",{className:"cell-mono",children:de.trustedDeviceCount??0}),i.jsx("td",{className:"cell-mono",children:de.passwordChangedAt?Ct(de.passwordChangedAt):"unknown"})]},de.id))})}),i.jsx(je,{title:"Step-Up And Risk",eyebrow:"Sessions",children:i.jsx(ua,{empty:"No high-risk sessions.",headers:["User","Risk","Step-Up","Factors","Actions"],children:Zt.map(de=>i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("strong",{children:de.user?.email??de.userId}),i.jsx("span",{className:"row-sub",children:de.ipAddress??"no ip"})]}),i.jsx("td",{children:i.jsxs(_e,{tone:(de.riskScore??0)>=.75?"coral":"amber",children:[Math.round((de.riskScore??0)*100),"%"]})}),i.jsx("td",{className:"cell-mono",children:de.stepUpVerifiedAt?Ct(de.stepUpVerifiedAt):"required"}),i.jsx("td",{className:"cell-mono",children:Array.isArray(de.riskFactors)?de.riskFactors.join(", "):de.riskFactors??"-"}),i.jsx("td",{children:i.jsx(le,{size:"sm",variant:"danger",disabled:!An,onClick:()=>window.confirm("Revoke this risky session?")&&void Ge(()=>P.revokeIamSession(de.id),"Session revoked"),children:"Revoke"})})]},de.id))})}),i.jsx(je,{title:"Password Policy",eyebrow:"Step-up foundation",style:{gridColumn:"1 / -1"},children:X?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"Name",children:i.jsx(be,{value:X.name,onChange:de=>ne({name:de})})}),i.jsx(ae,{label:"Min length",children:i.jsx(be,{inputMode:"numeric",value:String(X.minLength),onChange:de=>ne({minLength:Number(de)||0})})}),i.jsx(ae,{label:"Max length",children:i.jsx(be,{inputMode:"numeric",value:String(X.maxLength),onChange:de=>ne({maxLength:Number(de)||0})})}),i.jsx(ae,{label:"Max age days",children:i.jsx(be,{inputMode:"numeric",value:String(X.maxAgeDays),onChange:de=>ne({maxAgeDays:Number(de)||0})})}),i.jsx(ae,{label:"History count",children:i.jsx(be,{inputMode:"numeric",value:String(X.historyCount),onChange:de=>ne({historyCount:Number(de)||0})})}),i.jsx(ae,{label:"Lockout attempts",children:i.jsx(be,{inputMode:"numeric",value:String(X.lockoutAttempts),onChange:de=>ne({lockoutAttempts:Number(de)||0})})}),i.jsx(ae,{label:"Lockout minutes",children:i.jsx(be,{inputMode:"numeric",value:String(X.lockoutDurationMin),onChange:de=>ne({lockoutDurationMin:Number(de)||0})})}),i.jsxs("div",{className:"toggle-stack",children:[i.jsx(xn,{checked:X.requireUppercase,onChange:de=>ne({requireUppercase:de}),label:"Uppercase"}),i.jsx(xn,{checked:X.requireLowercase,onChange:de=>ne({requireLowercase:de}),label:"Lowercase"}),i.jsx(xn,{checked:X.requireNumbers,onChange:de=>ne({requireNumbers:de}),label:"Numbers"}),i.jsx(xn,{checked:X.requireSpecial,onChange:de=>ne({requireSpecial:de}),label:"Special characters"})]})]}),i.jsx("div",{className:"form-actions",children:i.jsx(le,{variant:"primary",loading:ce,disabled:!Dn,icon:i.jsx(Y.Check,{className:"btn-ico"}),onClick:()=>{Me()},children:"Save policy"})})]}):i.jsx(St,{icon:i.jsx(Y.Alert,{width:34,height:34}),message:"Password policy could not be loaded from IAM."})})]})]})}function Xr(){return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"stats-grid",children:[i.jsx(Ue,{label:"Total Events",value:K?.totalEvents??0,sub:"last 30 days",accent:"sky",emphasize:!0}),i.jsx(Ue,{label:"Successful",value:K?.successCount??0,sub:"authorized actions",accent:"teal"}),i.jsx(Ue,{label:"Failures",value:K?.failureCount??0,sub:"failed auth",accent:"coral"}),i.jsx(Ue,{label:"Denied",value:K?.deniedCount??0,sub:"policy blocks",accent:"amber"})]}),i.jsx(je,{title:"Audit events",eyebrow:"Recent",children:i.jsx(ua,{empty:"No audit events found.",headers:["Time","Event","Actor","Outcome","Detail"],children:I.map(N=>i.jsxs("tr",{children:[i.jsx("td",{className:"cell-mono",children:un(N.timestamp)}),i.jsxs("td",{children:[i.jsx("strong",{children:N.eventType}),i.jsxs("span",{className:"row-sub",children:[N.category," / ",N.action]})]}),i.jsx("td",{children:N.actorEmail??N.actorId??N.actorType}),i.jsx("td",{children:i.jsx(_e,{tone:N.outcome==="SUCCESS"?"teal":N.outcome==="DENIED"?"amber":"coral",children:N.outcome})}),i.jsx("td",{className:"cell-mono",children:V_(N.detail)})]},N.id))})})]})}}function ua({headers:n,empty:l,children:r}){const u=Array.isArray(r)?r.filter(Boolean):r;return Array.isArray(u)&&u.length===0?i.jsx(St,{icon:i.jsx(Y.Info,{width:34,height:34}),message:l}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsx("tr",{children:n.map(d=>i.jsx("th",{children:d},d))})}),i.jsx("tbody",{children:r})]})})}function Fe(n,l="unknown"){return typeof n=="string"&&n.trim()?n:l}function Fv(n){return typeof n=="number"&&Number.isFinite(n)?n:null}function Bn(n){const l=Fv(n);return typeof l=="number"?l.toLocaleString():"0"}function ei(n){return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}function xo(n,l){const r=ei(n);for(const u of l){const d=r[u];if(Array.isArray(d))return d.filter(f=>!!f&&typeof f=="object"&&!Array.isArray(f))}return[]}function ns(n){return Fe(n.id,Fe(n.memory_id,""))}function I_({currentUser:n}){const l=Dt().data.hiveStatus?.apps.find(ne=>ne.key==="memory"),[r,u]=k.useState(null),[d,f]=k.useState(!0),[m,p]=k.useState(null),[v,g]=k.useState(()=>new URLSearchParams(location.search).get("q")??""),b=k.useRef(0),j=k.useRef(0),[C,z]=k.useState(0),[M,K]=k.useState("private"),[J,I]=k.useState("default"),[ie,X]=k.useState([]),[se,x]=k.useState(()=>new URLSearchParams(location.search).get("workspace")??"*"),[B,V]=k.useState(!1),[Q,ce]=k.useState([]),[ue,$]=k.useState(null),[pe,qe]=k.useState(""),[tt,Ie]=k.useState(null),[Z,F]=k.useState(null),[fe,Ae]=k.useState(null),[w,S]=k.useState(null),[U,te]=k.useState(""),[re,me]=k.useState(null),xe=Yt(n,"memory:write");async function ve(){f(!0),p(null),X([]);try{const[ne,Me,Ce]=await Promise.all([P.memoryConsole(),P.memoryQueue().catch(()=>(X(nt=>[...nt,"Queue unavailable"]),null)),P.memoryWebhooks().catch(()=>(X(nt=>[...nt,"Webhooks unavailable"]),null))]);u(ne),Me&&F(Me),Ce&&S(Ce)}catch(ne){p(ne instanceof Ft||ne instanceof Error?ne.message:"Failed to load Memory data")}finally{f(!1)}}async function He(ne,Me,Ce=()=>!0){me(ne),p(null);try{return await Me()}catch(nt){return Ce()&&p(nt instanceof Ft||nt instanceof Error?nt.message:`${ne} failed`),null}finally{Ce()&&me(null)}}async function Ze(ne=0){const Me=++b.current,Ce=new URL(location.href);Ce.searchParams.set("q",v),Ce.searchParams.set("workspace",se),history.replaceState(null,"",Ce),z(ne);const nt=await He("search",()=>P.searchMemory({query:v.trim(),workspaceId:se,limit:25,offset:ne}),()=>Me===b.current);nt&&Me===b.current&&(V(!0),ce(xo(nt,["results","memories","items"]).map(gt=>gt.memory?ei(gt.memory):gt)))}async function $t(ne){const Me=ns(ne);if(!Me)return;const Ce=++j.current,nt=()=>Ce===j.current;$(null),qe(""),Ie(null),Ae(null);const gt=await He("memory-detail",()=>P.getMemory(Me),nt);if(Ce!==j.current||(gt&&($(gt),qe(Fe(gt.content,""))),!gt))return;const fa=await He("memory-graph",()=>P.memoryGraph(Me),nt);if(Ce!==j.current)return;fa&&Ie(fa);const Ka=await He("memory-conflicts",()=>P.memoryConflicts({memory_id:Me}),nt);Ce===j.current&&Ka&&Ae(Ka)}async function Rn(){if(!U.trim())return;const ne=j.current,Me=await He("create-memory",()=>P.createMemory({content:U.trim(),type:"semantic",scope:M,source:"user_feedback",workspace_id:J,tags:["operator-created"],metadata:{created_from:"hive-console"}}));Me&&(te(""),await ve(),ne===j.current&&await $t(Me))}async function Ya(){if(!ue)return;const ne=ns(ue);if(!ne)return;const Me=j.current,Ce=await He("update-memory",()=>P.updateMemory(ne,{content:pe}),()=>Me===j.current);Ce&&Me===j.current&&($(Ce),await ve())}async function Ja(){if(!ue)return;const ne=ns(ue);if(!ne||!window.confirm("Delete this memory?"))return;const Me=++j.current;await He("delete-memory",()=>P.deleteMemory(ne),()=>Me===j.current)&&Me===j.current&&($(null),qe(""),Ie(null),Ae(null),await ve())}async function Nt(ne,Me,Ce){if(await He(ne,Ce)){const gt=await P.memoryQueue().catch(()=>(X(fa=>[...fa,"Queue unavailable"]),null));gt&&F(gt)}}k.useEffect(()=>{ve()},[]);const _n=ei(r?.stats),ct=ei(Z??r?.queue),Nn=ei(ct.counts),Ut=ei(ct.worker),Mn=r?.memoryTotal??_n.memories??_n.memory_count,An=B?Q:r?.memories??[],Dn=ue,Yn=xo(ct,["jobs","results","items"]),Ge=xo(w,["webhooks","results","items"]);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Memories"}),i.jsx("p",{children:"Native HiveMem operations inside the unified console."})]}),i.jsxs("div",{className:"panel-actions",children:[l?i.jsx(_e,{tone:l.status==="online"?"teal":l.status==="degraded"?"amber":"coral",dot:!0,children:l.status}):null,i.jsx(le,{variant:"ghost",icon:i.jsx(Y.Refresh,{className:"btn-ico"}),loading:d,onClick:()=>{ve()},children:"Refresh"})]})]}),m?i.jsxs("div",{className:"error-banner",children:[i.jsx(Y.Alert,{}),m]}):null,i.jsxs("div",{className:"grid grid--4",children:[i.jsx(Ue,{label:"Memories",value:Bn(Mn),sub:"visible through Router",accent:"amber",emphasize:!0}),i.jsx(Ue,{label:"Sessions",value:Bn(_n.sessions??r?.sessions.length),sub:"active history containers",accent:"sky"}),i.jsx(Ue,{label:"Agents",value:Bn(_n.agents??r?.agents.length),sub:"registered memory actors",accent:"teal"}),i.jsx(Ue,{label:"Queue",value:Bn(ct.pending_count??Nn.pending??ct.pending??0),sub:"pending jobs",accent:Fv(Nn.failed)?"coral":"violet"})]}),i.jsxs("div",{className:"grid grid--2",children:[i.jsxs(je,{title:"Search And Create",eyebrow:"native operations",children:[i.jsxs("div",{className:"form-grid form-grid--compact",children:[i.jsx(ae,{label:"Search",children:i.jsx(be,{value:v,onChange:g,placeholder:"memory text, tag, or entity"})}),i.jsx(ae,{label:"Workspace",children:i.jsx(be,{value:se,onChange:x,placeholder:"default or *"})})]}),i.jsxs("div",{className:"inline-actions",children:[i.jsx(le,{variant:"primary",icon:i.jsx(Y.Activity,{className:"btn-ico"}),loading:re==="search",onClick:()=>{Ze()},children:"Search"}),i.jsx(le,{variant:"ghost",icon:i.jsx(Y.Refresh,{className:"btn-ico"}),loading:d,onClick:()=>{ve()},children:"Refresh"})]}),ie.length>0&&i.jsxs("p",{role:"alert",children:[ie.join(". "),". Previous data may be stale."]}),i.jsxs("div",{className:"inline-actions",children:[i.jsx(le,{variant:"ghost",disabled:C===0,onClick:()=>{Ze(Math.max(0,C-25))},children:"Previous"}),i.jsxs("span",{children:["Page ",Math.floor(C/25)+1]}),i.jsx(le,{variant:"ghost",disabled:Q.length<25,onClick:()=>{Ze(C+25)},children:"Next"})]}),i.jsx(ae,{label:"Create in workspace",children:i.jsx(be,{value:J,onChange:I})}),i.jsx(ae,{label:"Visibility",hint:"Private records belong to the console service identity.",children:i.jsxs("select",{value:M,onChange:ne=>K(ne.target.value),children:[i.jsx("option",{value:"private",children:"Private"}),i.jsx("option",{value:"shared",children:"Shared in workspace"})]})}),i.jsx(ae,{label:"Create memory",children:i.jsx(st,{value:U,onChange:te,rows:4,placeholder:"What should Hive remember?"})}),i.jsx("div",{className:"inline-actions",style:{justifyContent:"flex-end"},children:i.jsx(le,{variant:"primary",loading:re==="create-memory",disabled:!xe||!U.trim(),onClick:()=>{Rn()},children:"Create"})})]}),i.jsx(je,{title:"Recent And Search Results",eyebrow:`${An.length} records`,children:d?i.jsx("div",{className:"center-load",children:i.jsx("span",{className:"spinner"})}):An.length?i.jsx("div",{className:"stack-list",children:An.map((ne,Me)=>i.jsxs("button",{className:"stack-item stack-item--button",onClick:()=>{$t(ne)},children:[i.jsxs("div",{children:[i.jsx("strong",{children:Fe(ne.content,Fe(ne.summary,"Untitled memory")).slice(0,180)}),i.jsxs("span",{className:"muted-line",children:[Fe(ne.type)," · ",Fe(ne.scope)," · ",Fe(ne.workspace_id,"default")]})]}),i.jsx(_e,{tone:Fe(ne.confidence).startsWith("0.")?"amber":"teal",children:typeof ne.confidence=="number"?`${Math.round(ne.confidence*100)}%`:Fe(ne.confidence,"stored")})]},ns(ne)||`memory-${Me}`))}):i.jsx(St,{icon:i.jsx(Y.Activity,{width:34,height:34}),message:"No memories returned by HiveMem."})}),i.jsxs(je,{title:"Queue",eyebrow:"run, retry, cancel",children:[i.jsxs("div",{className:"kv-list","aria-label":"Worker status",children:[i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Worker"}),i.jsx("span",{children:Fe(Ut.state,"unavailable")})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Heartbeat"}),i.jsx("span",{children:typeof Ut.heartbeat=="string"?Ct(Ut.heartbeat):"not reported"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Oldest pending"}),i.jsx("span",{children:typeof Ut.oldest_pending_seconds=="number"?`${Math.round(Ut.oldest_pending_seconds)} seconds`:"none"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Recovered at startup"}),i.jsx("span",{children:Bn(Ut.recovered_on_startup)})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Dead letters"}),i.jsx("span",{children:Bn(ct.dead_letter_count)})]})]}),i.jsx("p",{className:"muted",children:typeof Ut.error=="string"?Ut.error+". Restore the dependency, then refresh; failed jobs can be retried below.":Ut.state==="disabled"||Ut.state==="manual"?"Automatic processing is off. Use Run for individual jobs or enable the service worker.":Ut.state==="stale"?"Heartbeat is stale. Check the Memory service and its dependency status before retrying work.":"Failed jobs retry with backoff. Inspect dead letters before choosing Retry."}),i.jsxs("div",{className:"kv-list",children:[i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Pending"}),i.jsx("span",{className:"cell-mono",children:Bn(ct.pending_count??Nn.pending??ct.pending)})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Running"}),i.jsx("span",{className:"cell-mono",children:Bn(ct.in_progress_count??Nn.running??ct.running)})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Failed"}),i.jsx("span",{className:"cell-mono",children:Bn(ct.failed_count??Nn.failed??ct.failed)})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Agents"}),i.jsx("span",{className:"cell-mono",children:Bn(r?.agents.length)})]})]}),Yn.length?i.jsx("div",{className:"stack-list stack-list--compact",children:Yn.slice(0,6).map((ne,Me)=>{const Ce=Fe(ne.id,""),nt=["pending","failed","dead_letter"].includes(Fe(ne.status)),gt=["failed","dead_letter","cancelled"].includes(Fe(ne.status));return i.jsxs("div",{className:"stack-item",children:[i.jsxs("div",{children:[i.jsx("strong",{children:Fe(ne.task_type,"queue job")}),i.jsxs("span",{className:"muted-line",children:[Fe(ne.status)," · ",Fe(ne.workspace_id,"default")]})]}),i.jsxs("div",{className:"inline-actions",children:[i.jsx(le,{size:"sm",variant:"ghost",disabled:!xe||!Ce||!nt,loading:re===`run-${Ce}`,onClick:()=>{Nt(`run-${Ce}`,Ce,()=>P.runMemoryQueueJob(Ce))},children:"Run"}),i.jsx(le,{size:"sm",variant:"ghost",disabled:!xe||!Ce||!gt,loading:re===`retry-${Ce}`,onClick:()=>{Nt(`retry-${Ce}`,Ce,()=>P.retryMemoryQueueJob(Ce))},children:"Retry"}),i.jsx(le,{size:"sm",variant:"danger",disabled:!xe||!Ce||!nt,loading:re===`cancel-${Ce}`,onClick:()=>{Nt(`cancel-${Ce}`,Ce,()=>P.cancelMemoryQueueJob(Ce))},children:"Cancel"})]})]},Ce||`job-${Me}`)})}):i.jsx(St,{message:"No queue jobs returned."})]}),i.jsx(je,{title:"Webhooks",eyebrow:"delivery wiring",children:Ge.length?i.jsx("div",{className:"stack-list stack-list--compact",children:Ge.slice(0,6).map((ne,Me)=>i.jsxs("div",{className:"stack-item",children:[i.jsxs("div",{children:[i.jsx("strong",{children:Fe(ne.name,Fe(ne.url,"Webhook"))}),i.jsx("span",{className:"muted-line",children:Fe(ne.status,Fe(ne.last_status,"configured"))})]}),i.jsx(_e,{tone:ne.enabled===!1?"muted":"teal",children:ne.enabled===!1?"off":"on"})]},Fe(ne.id,`webhook-${Me}`)))}):i.jsx(St,{message:"No webhooks returned."})})]}),i.jsxs("div",{className:"grid grid--2",children:[i.jsx(je,{title:"Memory Detail",eyebrow:Dn?ns(Dn)||"selected record":"raw service payload",children:Dn?i.jsxs(i.Fragment,{children:[i.jsx(ae,{label:"Content",children:i.jsx(st,{value:pe,onChange:qe,rows:6})}),i.jsxs("div",{className:"inline-actions",children:[i.jsx(le,{variant:"primary",loading:re==="update-memory",disabled:!xe||!ue,onClick:()=>{Ya()},children:"Save"}),i.jsx(le,{variant:"danger",loading:re==="delete-memory",disabled:!xe||!ue,onClick:()=>{Ja()},children:"Delete"})]}),i.jsx(dt,{value:Dn})]}):i.jsx(dt,{value:r??{loading:d}})}),i.jsxs(je,{title:"Graph And Conflicts",eyebrow:"selected memory",children:[i.jsx("p",{className:"panel-eyebrow",children:"Graph"}),i.jsx(dt,{value:tt??{message:"Select a memory to load graph neighborhood."}}),i.jsx("p",{className:"panel-eyebrow",style:{marginTop:18},children:"Conflicts"}),i.jsx(dt,{value:fe??{message:"Select a memory to detect conflicts."}})]})]}),i.jsx(je,{title:"Recent Sessions",eyebrow:"Memory history",children:r?.sessions.length?i.jsx("div",{className:"stack-list stack-list--compact",children:r.sessions.slice(0,5).map((ne,Me)=>i.jsxs("div",{className:"stack-item",children:[i.jsxs("div",{children:[i.jsx("strong",{children:Fe(ne.title,Fe(ne.session_id,"Session"))}),i.jsx("span",{className:"muted-line",children:Fe(ne.workspace_id,"default")})]}),typeof ne.created_at=="string"?i.jsx("span",{className:"cell-mono",title:un(ne.created_at),children:Ct(ne.created_at)}):null]},Fe(ne.session_id,Fe(ne.id,`session-${Me}`))))}):i.jsx(St,{message:"No sessions returned."})})]})}function P_({onNavigate:n}){const{data:l}=Dt(),r=l.hiveStatus?.apps.find(p=>p.key==="router"),u=k.useMemo(()=>l.providers.filter(p=>(p.lastHealthStatus??"").toLowerCase()==="healthy").length,[l.providers]),d=l.providers.filter(p=>p.enabled).length,f=l.telemetry?.totals??{traces:0,failures:0,failovers:0},m=f.traces>0?Math.round((f.traces-f.failures)/f.traces*100):100;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Routers"}),i.jsx("p",{children:"Provider fleet, route policy, health, and trace evidence in one operations page."})]}),r?i.jsx(_e,{tone:r.status==="online"?"teal":r.status==="degraded"?"amber":"coral",dot:!0,children:r.status}):null]}),i.jsxs("div",{className:"stats-grid",children:[i.jsx(Ue,{label:"Providers",value:l.providers.length,sub:`${d} enabled / ${u} healthy`,accent:"amber",emphasize:!0}),i.jsx(Ue,{label:"Route Rules",value:l.routeRules.length,sub:`${l.heuristics.length} heuristics`,accent:"violet"}),i.jsx(Ue,{label:"Traces",value:Do(f.traces),sub:`${m}% succeeded`,accent:"sky",emphasize:!0}),i.jsx(Ue,{label:"Failures",value:Do(f.failures),sub:`${f.failovers} failovers`,accent:"coral"})]}),i.jsxs("div",{className:"grid-2",children:[i.jsx(je,{title:"Router Workbench",eyebrow:"Controls",children:i.jsxs("div",{className:"workbench-actions",children:[i.jsxs("button",{className:"btn btn--ghost",onClick:()=>n("providers"),children:[i.jsx(Y.Server,{className:"btn-ico"}),"Providers"]}),i.jsxs("button",{className:"btn btn--ghost",onClick:()=>n("routing"),children:[i.jsx(Y.Route,{className:"btn-ico"}),"Routing"]}),i.jsxs("button",{className:"btn btn--ghost",onClick:()=>n("testing"),children:[i.jsx(Y.Hexagon,{className:"btn-ico"}),"Testing"]}),i.jsxs("button",{className:"btn btn--ghost",onClick:()=>n("traces"),children:[i.jsx(Y.Activity,{className:"btn-ico"}),"Traces"]})]})}),i.jsx(je,{title:"Latest Trace",eyebrow:"Evidence",actions:i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>n("traces"),children:"View all"}),children:l.telemetry?.latestTrace?i.jsx(dt,{value:l.telemetry.latestTrace}):i.jsx(St,{icon:i.jsx(Y.Activity,{width:34,height:34}),message:"No traces recorded yet."})})]}),i.jsx(je,{title:"Provider Pulse",eyebrow:"Health",actions:i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>n("providers"),children:"Manage"}),children:l.providers.length===0?i.jsx(St,{icon:i.jsx(Y.Server,{width:34,height:34}),message:"No providers registered yet."}):i.jsx("div",{className:"pulse-grid",children:l.providers.map(p=>i.jsxs("article",{className:"pulse-card",children:[i.jsxs("div",{className:"pulse-top",children:[i.jsx("span",{className:"pulse-name",children:p.name}),i.jsx(Uo,{status:p.lastHealthStatus})]}),i.jsx("p",{className:"pulse-meta",children:i.jsx(_e,{tone:"muted",children:p.kind})}),i.jsx("p",{className:"pulse-meta",style:{marginTop:8},children:p.baseUrl}),p.lastHealthAt?i.jsxs("p",{className:"pulse-meta",style:{marginTop:6},children:["checked ",Ct(p.lastHealthAt)]}):null]},p.id))})})]})}const Pp={user:"User","service-account":"Service Account","system-user":"System User","router-key":"Router Key","memory-agent":"Memory Agent"};function F_(n){return n.status==="inactive"?"muted":n.kind==="user"?"amber":n.kind==="memory-agent"?"teal":n.kind==="router-key"?"sky":n.kind==="service-account"?"violet":"coral"}function So(n){return n.split(/[\n,]+/u).map(l=>l.trim()).filter(Boolean)}function W_({currentUser:n}){const{data:l,refresh:r,refreshing:u}=Dt(),d=Ga(),[f,m]=k.useState(()=>new URLSearchParams(location.search).get("actor")),p=l.actors.find(x=>x.id===f)??null;k.useEffect(()=>{const x=()=>m(new URLSearchParams(location.search).get("actor"));return window.addEventListener("popstate",x),()=>window.removeEventListener("popstate",x)},[]);function v(x){m(x?.id??null);const B=new URL(location.href);x?B.searchParams.set("actor",x.id):B.searchParams.delete("actor"),history.replaceState(null,"",B)}const[g,b]=k.useState(null),[j,C]=k.useState(null),[z,M]=k.useState({agentId:"",displayName:"",description:"",iamClientId:"hive-router",roleIds:"",scopes:"memories:read, memories:write, sessions:read, sessions:write, context:read, agents:read, workspaces:read, queue:read",hostLabel:location.hostname,workspaceId:"default",owningProject:"",expiresHours:"24",allowedIps:""}),K=k.useMemo(()=>l.actors.reduce((x,B)=>(x[B.kind]=(x[B.kind]??0)+1,x),{}),[l.actors]),J=Yt(n,"hive:actors:write");async function I(x,B){if(!(x==="disable"&&!window.confirm(`Disable ${B.label} across linked Hive services?`))){b(`${x}-${B.id}`);try{const V=`hive.actor.operation:${B.id}:${x}`,Q=sessionStorage.getItem(V)??crypto.randomUUID();sessionStorage.setItem(V,Q);const ce={kind:B.kind,label:B.label,identifiers:B.identifiers,operationId:Q},ue=x==="disable"?await P.disableHiveActor(B.id,ce):await P.rotateHiveActor(B.id,ce);C(ue),x==="disable"&&ue.ok&&(sessionStorage.removeItem(V),sessionStorage.removeItem(`hive.actor.operation:${B.id}:rotate`)),ue.ok?d.success(x==="disable"?"Actor disabled":"Actor rotated",B.label):d.error("Actor operation partially completed",typeof ue.remediation=="string"?ue.remediation:"Inspect the step results before retrying."),await r()}catch(V){V instanceof Ft&&V.status===410&&sessionStorage.removeItem(`hive.actor.operation:${B.id}:${x}`),d.error(x==="disable"?"Disable failed":"Rotate failed",V instanceof Error?V.message:"Actor lifecycle request failed")}finally{b(null)}}}async function ie(){if(!j||typeof j.actorId!="string")return;const x=typeof j.operationId=="string"?j.operationId:null,B=x?`/operations/${encodeURIComponent(x)}/receipt`:"/receipt";if(!(await fetch(`/api/hive/actors/${encodeURIComponent(j.actorId)}${B}`,{method:"DELETE"})).ok)throw new Error("Receipt acknowledgement failed");typeof j.action=="string"&&sessionStorage.removeItem(`hive.actor.operation:${j.actorId}:${j.action}`),C(null)}async function X(){if(!j||typeof j.actorId!="string"||!window.confirm("Disable all linked resources for this partial actor? Records and content are retained."))return;const x=j.action==="disable"&&typeof j.operationId=="string"?j.operationId:crypto.randomUUID(),B=`hive.actor.operation:${j.actorId}:disable`;sessionStorage.setItem(B,x);const V=await P.disableHiveActor(j.actorId,{identifiers:j.identifiers??{},operationId:x});C(V),V.ok?(sessionStorage.removeItem(B),sessionStorage.removeItem(`hive.actor.operation:${j.actorId}:rotate`),d.success("Partial actor contained")):d.error("Containment partially completed","Retry Disable to finish the remaining steps."),await r()}async function se(){b("create");try{const x=z.description.trim(),B=z.hostLabel.trim(),V={agentId:z.agentId.trim(),displayName:z.displayName.trim(),iamClientId:z.iamClientId.trim(),roleIds:So(z.roleIds),scopes:So(z.scopes),allowedIps:So(z.allowedIps),workspaceId:z.workspaceId,owningProject:z.owningProject,expiresHours:Number(z.expiresHours),...x?{description:x}:{},...B?{hostLabel:B}:{}},Q=await P.createHiveActor({...V});C(Q),Q.ok?d.success("Actor created",z.displayName||z.agentId):d.error("Actor partially created",typeof Q.remediation=="string"?Q.remediation:"Inspect the step results before retrying."),Q.ok&&M(ce=>({...ce,agentId:"",displayName:"",description:"",hostLabel:"",allowedIps:""})),await r()}catch(x){d.error("Create failed",x instanceof Error?x.message:"Could not create actor")}finally{b(null)}}return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Hive Actors"}),i.jsx("p",{children:"Users, service accounts, host identities, Router keys, and Memory agents in one inventory."})]}),i.jsx(le,{variant:"ghost",icon:i.jsx(Y.Refresh,{className:"btn-ico"}),loading:u,onClick:()=>{r()},children:"Refresh"})]}),i.jsxs("div",{className:"grid grid--4",children:[i.jsx(Ue,{label:"Actors",value:l.actors.length,sub:"linked identities",accent:"amber",emphasize:!0}),i.jsx(Ue,{label:"IAM",value:(K.user??0)+(K["service-account"]??0),sub:"users and services",accent:"violet"}),i.jsx(Ue,{label:"Router",value:K["router-key"]??0,sub:"client keys",accent:"sky"}),i.jsx(Ue,{label:"Memory",value:K["memory-agent"]??0,sub:"registered agents",accent:"teal"})]}),i.jsxs(je,{title:"Create Technical Actor",eyebrow:"IAM + Router + Memory",children:[i.jsxs("div",{className:"form-grid",children:[i.jsx(ae,{label:"Agent ID",children:i.jsx(be,{value:z.agentId,onChange:x=>M(B=>({...B,agentId:x})),placeholder:"memory-host-agent"})}),i.jsx(ae,{label:"Workspace",children:i.jsx(be,{value:z.workspaceId,onChange:x=>M(B=>({...B,workspaceId:x}))})}),i.jsx(ae,{label:"Owning project",children:i.jsx(be,{value:z.owningProject,onChange:x=>M(B=>({...B,owningProject:x}))})}),i.jsx(ae,{label:"Credential lifetime (hours)",children:i.jsx(be,{value:z.expiresHours,onChange:x=>M(B=>({...B,expiresHours:x}))})}),i.jsx(ae,{label:"Display name",children:i.jsx(be,{value:z.displayName,onChange:x=>M(B=>({...B,displayName:x})),placeholder:"memory-host Hermes"})}),i.jsx(ae,{label:"IAM client ID",children:i.jsx(be,{value:z.iamClientId,onChange:x=>M(B=>({...B,iamClientId:x}))})}),i.jsx(ae,{label:"Host label",children:i.jsx(be,{value:z.hostLabel,onChange:x=>M(B=>({...B,hostLabel:x})),placeholder:"memory-host"})}),i.jsx(ae,{label:"Role IDs",hint:"Comma or newline separated",children:i.jsx(st,{rows:3,value:z.roleIds,onChange:x=>M(B=>({...B,roleIds:x}))})}),i.jsx(ae,{label:"Router and Memory scopes",hint:"Comma or newline separated",children:i.jsx(st,{rows:3,value:z.scopes,onChange:x=>M(B=>({...B,scopes:x}))})}),i.jsx(ae,{label:"Allowed IPs",hint:"Comma or newline separated IPv4 addresses",children:i.jsx(st,{rows:3,value:z.allowedIps,onChange:x=>M(B=>({...B,allowedIps:x}))})}),i.jsx(ae,{label:"Description",children:i.jsx(st,{rows:3,value:z.description,onChange:x=>M(B=>({...B,description:x}))})})]}),i.jsx("div",{className:"panel-actions",children:i.jsx(le,{variant:"primary",icon:i.jsx(Y.Plus,{className:"btn-ico"}),loading:g==="create",disabled:!J||!z.agentId.trim()||!z.displayName.trim()||!z.iamClientId.trim(),onClick:()=>{se()},children:"Create actor"})}),j?.secrets?i.jsxs("div",{className:"json-stack",children:[i.jsx("p",{className:"panel-eyebrow",children:"Latest one-time secrets and steps"}),i.jsx(dt,{value:j}),i.jsx(le,{variant:"ghost",disabled:!j.ok,onClick:()=>{ie().catch(x=>d.error(x instanceof Error?x.message:"Acknowledgement failed"))},children:"I have saved these credentials"}),!j.ok&&i.jsx(le,{variant:"danger",disabled:!J,onClick:()=>{X().catch(x=>d.error(x instanceof Error?x.message:"Containment failed"))},children:"Contain partial actor"})]}):null]}),i.jsx(je,{title:"Actor Graph",eyebrow:`${l.actors.length} records`,children:l.actors.length===0?i.jsx(St,{icon:i.jsx(Y.Key,{width:34,height:34}),message:"No actors could be assembled from IAM, Router, or Memory."}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Actor"}),i.jsx("th",{children:"Kind"}),i.jsx("th",{children:"Sources"}),i.jsx("th",{children:"Capabilities"}),i.jsx("th",{children:"Last Activity"}),i.jsx("th",{children:"Links"})]})}),i.jsx("tbody",{children:l.actors.map(x=>i.jsxs("tr",{className:"row-clickable",onClick:()=>v(x),children:[i.jsx("td",{className:"cell-strong",children:i.jsx(le,{variant:"ghost",onClick:()=>v(x),children:x.label})}),i.jsx("td",{children:i.jsx(_e,{tone:F_(x),dot:!0,children:Pp[x.kind]})}),i.jsx("td",{className:"cell-mono",children:x.sources.join(", ")}),i.jsx("td",{children:x.capabilities.slice(0,3).join(", ")||"standard"}),i.jsx("td",{className:"cell-mono",title:x.lastActivityAt?un(x.lastActivityAt):void 0,children:x.lastActivityAt?Ct(x.lastActivityAt):"unknown"}),i.jsx("td",{className:"cell-mono",children:x.linkedResourceCount})]},x.id))})]})})}),i.jsx(kn,{open:!!p,onClose:()=>v(null),eyebrow:p?Pp[p.kind]:"",title:p?.label??"",footer:p?i.jsxs(i.Fragment,{children:[i.jsx(le,{variant:"ghost",onClick:()=>v(null),children:"Close"}),i.jsx(le,{variant:"ghost",loading:g===`rotate-${p.id}`,disabled:!J,onClick:()=>{I("rotate",p)},children:"Rotate"}),i.jsx(le,{variant:"danger",loading:g===`disable-${p.id}`,disabled:!J,onClick:()=>{I("disable",p)},children:"Disable"})]}):i.jsx(le,{variant:"ghost",onClick:()=>v(null),children:"Close"}),children:p?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"kv-list",children:[i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Status"}),i.jsx("span",{children:p.status})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Sources"}),i.jsx("span",{children:p.sources.join(", ")})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Links"}),i.jsx("span",{className:"cell-mono",children:p.linkedResourceCount})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Last Activity"}),i.jsx("span",{className:"cell-mono",children:p.lastActivityAt?un(p.lastActivityAt):"unknown"})]})]}),i.jsx("p",{className:"panel-eyebrow",style:{marginTop:22},children:"Identifiers"}),i.jsx(dt,{value:p.identifiers}),i.jsx("p",{className:"panel-eyebrow",style:{marginTop:22},children:"Capabilities"}),i.jsx(dt,{value:p.capabilities}),j?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"panel-eyebrow",style:{marginTop:22},children:"Latest Lifecycle Result"}),i.jsx(dt,{value:j})]}):null]}):null})]})}function _o(n){return n==="critical"?"coral":n==="warning"?"amber":n==="info"?"teal":"muted"}function eN(){const{data:n,refresh:l,refreshing:r}=Dt(),[u,d]=k.useState(null),f=n.incidents.filter(v=>v.status==="open").length,m=n.incidents.filter(v=>v.severity==="critical").length,p=n.incidents.filter(v=>v.services.length>1).length;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Incidents"}),i.jsx("p",{children:"Router traces and IAM audit records grouped by request ID and failure window."})]}),i.jsx(le,{variant:"ghost",icon:i.jsx(Y.Refresh,{className:"btn-ico"}),loading:r,onClick:()=>{l()},children:"Refresh"})]}),i.jsxs("div",{className:"grid grid--4",children:[i.jsx(Ue,{label:"Open",value:f,sub:"needs attention",accent:f?"coral":"teal",emphasize:!0}),i.jsx(Ue,{label:"Critical",value:m,sub:"hard failures",accent:"coral"}),i.jsx(Ue,{label:"Cross-Service",value:p,sub:"shared request IDs",accent:"sky"}),i.jsx(Ue,{label:"Total",value:n.incidents.length,sub:"recent groups",accent:"amber"})]}),i.jsx(je,{title:"Timeline",eyebrow:`${n.incidents.length} groups`,children:n.incidents.length===0?i.jsx(St,{icon:i.jsx(Y.Activity,{width:34,height:34}),message:"No recent incidents found."}):i.jsx("div",{className:"timeline-list",children:n.incidents.map(v=>i.jsxs("button",{className:"timeline-item",onClick:()=>d(v),children:[i.jsx("span",{className:`timeline-rail timeline-rail--${v.severity}`}),i.jsxs("span",{className:"timeline-main",children:[i.jsxs("span",{className:"timeline-title",children:[i.jsx("strong",{children:v.title}),i.jsx(_e,{tone:_o(v.severity),dot:!0,children:v.severity})]}),i.jsx("span",{className:"muted-line",children:v.summary}),i.jsxs("span",{className:"muted-line",children:[v.services.join(" + ")," · ",v.actors.join(", ")||"system"," · ",Ct(v.startedAt)]})]}),i.jsxs("span",{className:"cell-mono",children:[v.events.length," events"]})]},v.id))})}),i.jsx(kn,{open:!!u,onClose:()=>d(null),eyebrow:"Incident",title:u?.title??"",footer:i.jsx(le,{variant:"ghost",onClick:()=>d(null),children:"Close"}),children:u?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"kv-list",children:[i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Severity"}),i.jsx(_e,{tone:_o(u.severity),children:u.severity})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Status"}),i.jsx("span",{children:u.status})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Services"}),i.jsx("span",{children:u.services.join(", ")})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Started"}),i.jsx("span",{className:"cell-mono",children:un(u.startedAt)})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Request IDs"}),i.jsx("span",{className:"cell-mono",children:u.requestIds.join(", ")||"none"})]})]}),i.jsx("p",{className:"panel-eyebrow",style:{marginTop:22},children:"Events"}),i.jsx("div",{className:"stack-list",children:u.events.map(v=>i.jsxs("div",{className:"stack-item",children:[i.jsxs("div",{children:[i.jsxs("strong",{children:[v.service,": ",v.title]}),i.jsxs("span",{className:"muted-line",children:[v.outcome??v.kind," · ",un(v.timestamp)]})]}),i.jsx(_e,{tone:_o(v.severity),children:v.severity})]},v.id))}),i.jsx("p",{className:"panel-eyebrow",style:{marginTop:22},children:"Raw Incident"}),i.jsx(dt,{value:u})]}):null})]})}const tN={"iam-overview":"overview","iam-users":"users","iam-roles":"roles","iam-service-accounts":"service-accounts","iam-clients":"clients","iam-sessions":"sessions","iam-system-users":"system-users","iam-security":"security","iam-audit":"audit"},Fp=[{label:"Hive",items:[{key:"hive",label:"Hive",icon:Y.Hexagon}]},{label:"IAM",items:[{key:"iam-overview",label:"Overview",icon:Y.Gauge},{key:"iam-users",label:"Users",icon:Y.Key},{key:"iam-roles",label:"Roles",icon:Y.Scroll},{key:"iam-service-accounts",label:"Service Accounts",icon:Y.Server},{key:"iam-clients",label:"Clients",icon:Y.Route},{key:"iam-sessions",label:"Sessions",icon:Y.Activity},{key:"iam-system-users",label:"System Users",icon:Y.Settings},{key:"iam-security",label:"Security",icon:Y.Alert},{key:"iam-audit",label:"Audit",icon:Y.Book}]},{label:"Memory",items:[{key:"memories",label:"Memories",icon:Y.Activity},{key:"actors",label:"Actors",icon:Y.Key}]},{label:"Router Operations",items:[{key:"routers",label:"Routers",icon:Y.Gauge},{key:"providers",label:"Providers",icon:Y.Server},{key:"routing",label:"Routing",icon:Y.Route},{key:"testing",label:"Testing",icon:Y.Hexagon}]},{label:"Observability",items:[{key:"traces",label:"Traces",icon:Y.Activity},{key:"incidents",label:"Incidents",icon:Y.Alert},{key:"audit",label:"Audit Log",icon:Y.Scroll}]},{label:"System",items:[{key:"keys",label:"API Keys",icon:Y.Key},{key:"docs",label:"API Docs",icon:Y.Book},{key:"settings",label:"Settings",icon:Y.Settings}]}];function nN(){const[n,l]=k.useState("checking"),[r,u]=k.useState(null);k.useEffect(()=>{let f=!0;return(async()=>{try{const m=await P.me();f&&(u(m.user),l("authed"))}catch{f&&l("unauthed")}})(),()=>{f=!1}},[]);const d=k.useCallback(()=>{u(null),l("unauthed")},[]);return n==="checking"?i.jsxs(i.Fragment,{children:[i.jsx(td,{}),i.jsx("div",{className:"center-load",children:i.jsx("span",{className:"spinner spinner--lg"})})]}):n==="unauthed"?i.jsx(aN,{onSuccess:f=>{u(f),l("authed")}}):i.jsx(n_,{onAuthExpired:d,children:i.jsx(lN,{user:r,onLogout:d})})}function td(){return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"honeycomb-bg","aria-hidden":!0}),i.jsx("div",{className:"atmosphere","aria-hidden":!0}),i.jsx("div",{className:"scanline","aria-hidden":!0})]})}function aN({onSuccess:n}){const[l,r]=k.useState("admin"),[u,d]=k.useState(""),[f,m]=k.useState(null),[p,v]=k.useState(!1);async function g(b){b.preventDefault(),v(!0),m(null);try{const j=await P.login(l.trim(),u);n(j.user)}catch(j){const C=j instanceof Ft||j instanceof Error?j.message:"Login failed";m(C)}finally{v(!1)}}return i.jsxs(i.Fragment,{children:[i.jsx(td,{}),i.jsx("div",{className:"login-shell",children:i.jsxs("form",{className:"login-card",onSubmit:g,children:[i.jsx(Iv,{className:"login-sigil"}),i.jsx("p",{className:"login-eyebrow",children:"Hive"}),i.jsx("h1",{children:"Control Plane Console"}),i.jsx("p",{className:"login-sub",children:"Authenticate to manage identity, memory, and routing."}),f?i.jsxs("div",{className:"error-banner",children:[i.jsx(Y.Alert,{}),f]}):null,i.jsxs("label",{className:"field",children:[i.jsx("span",{className:"field-label",children:"Username"}),i.jsx("input",{value:l,onChange:b=>r(b.target.value),autoComplete:"username"})]}),i.jsxs("label",{className:"field",children:[i.jsx("span",{className:"field-label",children:"Password"}),i.jsx("input",{type:"password",value:u,onChange:b=>d(b.target.value),autoComplete:"current-password"})]}),i.jsxs("button",{className:"btn btn--primary",type:"submit",disabled:p,children:[p?i.jsx("span",{className:"spinner"}):i.jsx(Y.Key,{className:"btn-ico"}),"Sign in"]})]})})]})}function lN({user:n,onLogout:l}){const[r,u]=k.useState(()=>{const X=new URLSearchParams(location.search).get("page");return Fp.flatMap(se=>se.items).find(se=>se.key===X)?.key??"hive"}),[d,f]=k.useState(!1),{data:m,loading:p,refreshing:v,error:g,loadIssues:b,lastSync:j,refresh:C,resourceFreshness:z}=Dt(),M={providers:m.providers.length,traces:m.traces.length,audit:m.audit.length,actors:m.actors.length,incidents:m.incidents.length,keys:m.clientKeys.length};async function K(){try{await P.logout()}finally{l()}}function J(X){u(X);const se=new URL(location.href);se.searchParams.set("page",X),history.replaceState(null,"",se),f(!1)}const I=m.telemetry?.totals.failures??0,ie=n?.displayName??n?.username??"Operator";return i.jsxs(i.Fragment,{children:[i.jsx(td,{}),i.jsxs("div",{className:"app-shell",children:[i.jsxs("aside",{className:d?"sidebar sidebar--open":"sidebar",children:[i.jsxs("div",{className:"brand",children:[i.jsx(Iv,{className:"brand-sigil"}),i.jsxs("div",{children:[i.jsx("strong",{children:"Hive"}),i.jsx("span",{children:"Unified Control"})]})]}),i.jsx("nav",{className:"nav",children:Fp.map(X=>i.jsxs("div",{className:"nav-group",children:[i.jsx("p",{className:"nav-group-label",children:X.label}),X.items.map(se=>{const x=se.icon,B=M[se.key];return i.jsxs("button",{className:r===se.key?"nav-item nav-item--active":"nav-item",onClick:()=>J(se.key),children:[i.jsx(x,{width:18,height:18}),i.jsx("span",{children:se.label}),typeof B=="number"&&B>0?i.jsx("span",{className:"nav-count",children:B}):null]},se.key)})]},X.label))}),i.jsxs("div",{className:"sidebar-footer",children:[i.jsxs("div",{className:"sidebar-user",children:[i.jsx("span",{className:"user-avatar",children:a_(ie)}),i.jsxs("div",{children:[i.jsx("strong",{children:ie}),i.jsx("span",{children:"Administrator"})]})]}),i.jsxs("button",{className:"btn btn--ghost btn--sm",onClick:K,children:[i.jsx(Y.Logout,{className:"btn-ico"}),"Sign out"]})]})]}),i.jsxs("main",{className:"main",children:[i.jsxs("header",{className:"topbar",children:[i.jsx("button",{className:"menu-toggle",onClick:()=>f(X=>!X),"aria-label":"Toggle navigation",children:i.jsx(Y.Menu,{})}),i.jsxs("div",{className:"topbar-lead",children:[i.jsx("p",{className:"eyebrow",children:"Control Plane"}),i.jsx("h1",{className:"title",children:iN(r)})]}),i.jsxs("div",{className:"topbar-meta",children:[i.jsxs("span",{className:sN(g,I),children:[i.jsx("span",{className:"pip-dot"}),g?"Sync error":I>0?`${I} failures`:"Healthy"]}),i.jsxs("span",{className:"status-pip",children:[i.jsx("span",{className:"pip-dot"}),j?`Synced ${Ct(j.toISOString())}`:"Syncing…",i.jsxs("details",{children:[i.jsx("summary",{children:"Panel freshness"}),Object.entries(z).map(([X,se])=>i.jsxs("p",{children:[X,": ",se?.lastSuccess?Ct(se.lastSuccess):"Never loaded",se?.error?" · "+se.error:""]},X))]})]}),i.jsxs("button",{className:"btn btn--ghost btn--sm",onClick:()=>{C()},disabled:v,children:[v?i.jsx("span",{className:"spinner"}):i.jsx(Y.Refresh,{className:"btn-ico"}),"Refresh"]})]})]}),i.jsx("div",{className:"content",children:p?i.jsx("div",{className:"center-load",children:i.jsx("span",{className:"spinner spinner--lg"})}):i.jsxs(i.Fragment,{children:[g?i.jsxs("div",{className:"sync-warning",children:[i.jsx(Y.Alert,{}),i.jsxs("div",{children:[i.jsx("strong",{children:g}),b.length>0?i.jsx("span",{children:b.slice(0,3).join(" · ")}):null]}),i.jsxs("button",{className:"btn btn--ghost btn--sm",onClick:()=>{C()},disabled:v,children:[v?i.jsx("span",{className:"spinner"}):i.jsx(Y.Refresh,{className:"btn-ico"}),"Retry"]})]}):null,rN(r,X=>J(X),n)]})})]})]}),d?i.jsx("div",{className:"scrim scrim--nav",onClick:()=>f(!1)}):null]})}function iN(n){return{hive:"Hive","iam-overview":"IAM Overview","iam-users":"IAM Users","iam-roles":"IAM Roles","iam-service-accounts":"IAM Service Accounts","iam-clients":"IAM Clients","iam-sessions":"IAM Sessions","iam-system-users":"IAM System Users","iam-security":"IAM Security","iam-audit":"IAM Audit",memories:"Memories",actors:"Actors",routers:"Routers",providers:"Providers",routing:"Routing",testing:"Testing",traces:"Traces",incidents:"Incidents",keys:"API Keys",audit:"Audit Log",docs:"API Docs",settings:"Settings"}[n]}function sN(n,l){return n?"status-pip status-pip--err":l>0?"status-pip status-pip--warn":"status-pip status-pip--ok"}function rN(n,l,r){switch(n){case"hive":return i.jsx(q_,{onNavigate:l});case"iam-overview":case"iam-users":case"iam-roles":case"iam-service-accounts":case"iam-clients":case"iam-sessions":case"iam-system-users":case"iam-security":case"iam-audit":return i.jsx(X_,{section:tN[n],onNavigate:l,currentUser:r});case"memories":return i.jsx(I_,{currentUser:r});case"actors":return i.jsx(W_,{currentUser:r});case"routers":return i.jsx(P_,{onNavigate:l});case"providers":return i.jsx(f_,{currentUser:r});case"routing":return i.jsx(h_,{currentUser:r});case"testing":return i.jsx(N_,{});case"traces":return i.jsx(A_,{});case"incidents":return i.jsx(eN,{});case"keys":return i.jsx(E_,{currentUser:r});case"audit":return i.jsx(w_,{});case"docs":return i.jsx(T_,{onNavigate:l});case"settings":return i.jsx(R_,{currentUser:r});default:return null}}const Wv=document.getElementById("root");if(!Wv)throw new Error("Root element not found");Sb.createRoot(Wv).render(i.jsx(mb.StrictMode,{children:i.jsx(i_,{children:i.jsx(nN,{})})}));
67
+ `)}),children:"Edit"}),i.jsx(le,{size:"sm",variant:"danger",disabled:N.isSystem||!ct,onClick:()=>window.confirm(`Delete ${N.name}?`)&&void Ge(()=>P.deleteIamRole(N.id),"Role deleted"),children:"Delete"})]})]},N.id))})})]})}function Lt(){return i.jsxs("div",{className:"iam-ops-grid",children:[i.jsxs(je,{title:"Create service account",eyebrow:"Technical identity",children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"Name",children:i.jsx(be,{value:te.name,onChange:N=>re(W=>({...W,name:N}))})}),i.jsx(ae,{label:"Client",children:i.jsx(qn,{value:te.clientId,onChange:N=>re(W=>({...W,clientId:N})),options:Ya})}),i.jsx(ae,{label:"Role",children:i.jsx(qn,{value:te.roleId,onChange:N=>re(W=>({...W,roleId:N})),options:Rn})}),i.jsx(ae,{label:"Allowed IPs",hint:"Comma or newline separated IPv4 addresses",children:i.jsx(st,{value:te.allowedIps,onChange:N=>re(W=>({...W,allowedIps:N}))})}),i.jsx(ae,{label:"Description",children:i.jsx(be,{value:te.description,onChange:N=>re(W=>({...W,description:N}))})})]}),i.jsx(le,{variant:"primary",loading:ce,disabled:!Nn,icon:i.jsx(Y.Plus,{className:"btn-ico"}),onClick:()=>{Ge(()=>P.createIamServiceAccount({...te,roleIds:te.roleId?[te.roleId]:[],allowedIps:hl(te.allowedIps)}),"Service account created")},children:"Create service account"})]}),i.jsx(je,{title:"Service accounts",eyebrow:"Keys",style:{gridColumn:"1 / -1"},children:i.jsx(ua,{empty:"No service accounts found.",headers:["Account","Client","Roles","Status","Actions"],children:p.map(N=>i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("strong",{children:N.name}),i.jsxs("span",{className:"row-sub",children:[N.description??"No description"," / ",N.apiKeyPrefix??N.keyPrefix??"no prefix"]})]}),i.jsx("td",{children:N.client?.name??"unlinked"}),i.jsx("td",{children:K_(N.roles)}),i.jsx("td",{children:i.jsx(_e,{tone:N.active?"teal":"muted",dot:!0,children:N.active?"active":"disabled"})}),i.jsx("td",{children:i.jsxs("div",{className:"row-actions",children:[i.jsx(le,{size:"sm",variant:"ghost",disabled:!Nn,onClick:()=>{Ge(()=>P.updateIamServiceAccount(N.id,{active:!N.active}),N.active?"Service account disabled":"Service account enabled")},children:N.active?"Disable":"Enable"}),i.jsx(le,{size:"sm",variant:"ghost",disabled:!Nn,onClick:()=>{Ge(()=>P.rotateIamServiceAccount(N.id),"API key rotated")},children:"Rotate key"}),i.jsx(le,{size:"sm",variant:"danger",disabled:!Ut,onClick:()=>window.confirm(`Delete ${N.name}?`)&&void Ge(()=>P.deleteIamServiceAccount(N.id),"Service account deleted"),children:"Delete"})]})})]},N.id))})})]})}function Un(){return i.jsxs("div",{className:"iam-ops-grid",children:[i.jsxs(je,{title:"Create client",eyebrow:"Bot registration",children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"Client name",children:i.jsx(be,{value:me.name,onChange:N=>xe(W=>({...W,name:N})),placeholder:"bot-scout"})}),i.jsx(ae,{label:"Client secret",children:i.jsx(be,{type:"password",value:me.secret,onChange:N=>xe(W=>({...W,secret:N}))})}),i.jsx(ae,{label:"Grant types",children:i.jsx(be,{value:me.grantTypes,onChange:N=>xe(W=>({...W,grantTypes:N}))})}),i.jsx(ae,{label:"Redirect URIs",children:i.jsx(st,{value:me.redirectUris,onChange:N=>xe(W=>({...W,redirectUris:N}))})}),i.jsx(ae,{label:"Description",children:i.jsx(be,{value:me.description,onChange:N=>xe(W=>({...W,description:N}))})}),i.jsx(xn,{checked:me.firstParty,onChange:N=>xe(W=>({...W,firstParty:N})),label:"First-party bot"})]}),i.jsx(le,{variant:"primary",loading:ce,disabled:!Mn,icon:i.jsx(Y.Plus,{className:"btn-ico"}),onClick:()=>{Ge(()=>P.createIamClient({name:me.name,description:me.description,secret:me.secret,clientType:"confidential",grantTypes:J_(me.grantTypes),redirectUris:hl(me.redirectUris),firstParty:me.firstParty,allowedIps:[]}),"Client created")},children:"Create client"})]}),i.jsx(je,{title:"Clients",eyebrow:"OAuth",style:{gridColumn:"1 / -1"},children:i.jsx(ua,{empty:"No clients found.",headers:["Client","Type","Grants","Status","Actions"],children:g.map(N=>i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("strong",{children:N.name}),i.jsx("span",{className:"row-sub",children:N.description??"No description"})]}),i.jsx("td",{children:N.clientType}),i.jsx("td",{children:N.grantTypes.join(", ")||"none"}),i.jsx("td",{children:i.jsx(_e,{tone:N.active?"teal":"muted",dot:!0,children:N.active?"active":"disabled"})}),i.jsx("td",{children:i.jsxs("div",{className:"row-actions",children:[i.jsx(le,{size:"sm",variant:"ghost",disabled:!Mn,onClick:()=>{Ge(()=>P.updateIamClient(N.id,{active:!N.active}),N.active?"Client disabled":"Client enabled")},children:N.active?"Disable":"Enable"}),i.jsx(le,{size:"sm",variant:"ghost",disabled:!Mn,onClick:()=>{Ge(()=>P.updateIamClient(N.id,{firstParty:!N.firstParty}),"Client trust flag updated")},children:N.firstParty?"Unmark first-party":"Mark first-party"}),i.jsx(le,{size:"sm",variant:"danger",disabled:!Mn,onClick:()=>window.confirm(`Delete ${N.name}?`)&&void Ge(()=>P.deleteIamClient(N.id),"Client deleted"),children:"Delete"})]})})]},N.id))})})]})}function Bt(){return i.jsx(je,{title:"Sessions",eyebrow:"Active access",actions:i.jsx(le,{size:"sm",variant:"ghost",loading:ce,disabled:!An,onClick:()=>{Ge(()=>P.deduplicateIamSessions(),"Duplicate sessions revoked")},children:"Deduplicate"}),children:i.jsx(ua,{empty:"No active sessions.",headers:["User","IP","Created","Expires","Actions"],children:z.map(N=>i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("strong",{children:N.user?.email??N.userId}),i.jsx("span",{className:"row-sub",children:N.userAgent??"No user agent"})]}),i.jsx("td",{className:"cell-mono",children:N.ipAddress??"-"}),i.jsx("td",{children:un(N.createdAt)}),i.jsx("td",{children:un(N.expiresAt)}),i.jsx("td",{children:i.jsx(le,{size:"sm",variant:"danger",disabled:!An,onClick:()=>window.confirm("Revoke this session?")&&void Ge(()=>P.revokeIamSession(N.id),"Session revoked"),children:"Revoke"})})]},N.id))})})}function Qr(){return i.jsxs("div",{className:"iam-ops-grid",children:[i.jsxs(je,{title:"Create system user",eyebrow:"Linux mapping",children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"IAM user",children:i.jsx(qn,{value:Ue.userId,onChange:N=>$t(W=>({...W,userId:N})),options:Ja})}),i.jsx(ae,{label:"Linux username",children:i.jsx(be,{value:Ue.linuxUsername,onChange:N=>$t(W=>({...W,linuxUsername:N}))})}),i.jsx(ae,{label:"Authorized hosts",children:i.jsx(st,{value:Ue.authorizedHosts,onChange:N=>$t(W=>({...W,authorizedHosts:N}))})}),i.jsx(ae,{label:"SSH public key",children:i.jsx(st,{value:Ue.sshPublicKey,onChange:N=>$t(W=>({...W,sshPublicKey:N}))})}),i.jsx(xn,{checked:Ue.sudoEnabled,onChange:N=>$t(W=>({...W,sudoEnabled:N})),label:"Sudo enabled"})]}),i.jsx(le,{variant:"primary",loading:ce,disabled:!Nt,icon:i.jsx(Y.Plus,{className:"btn-ico"}),onClick:()=>{Ge(()=>P.createIamSystemUser({...Ue,authorizedHosts:hl(Ue.authorizedHosts)}),"System user mapped")},children:"Create system user"})]}),i.jsx(je,{title:"System users",eyebrow:"Host access",style:{gridColumn:"1 / -1"},children:i.jsx(ua,{empty:"No system users mapped.",headers:["Linux user","IAM user","Hosts","Sudo","Actions"],children:j.map(N=>i.jsxs("tr",{children:[i.jsx("td",{children:i.jsx("strong",{children:N.linuxUsername})}),i.jsx("td",{children:N.user?.email??N.userId}),i.jsx("td",{children:N.authorizedHosts.join(", ")||"all governed hosts"}),i.jsx("td",{children:i.jsx(_e,{tone:N.sudoEnabled?"amber":"muted",children:N.sudoEnabled?"sudo":"standard"})}),i.jsx("td",{children:i.jsxs("div",{className:"row-actions",children:[i.jsx(le,{size:"sm",variant:"ghost",disabled:!Nt,onClick:()=>{Ge(()=>P.updateIamSystemUser(N.id,{sudoEnabled:!N.sudoEnabled}),"System user updated")},children:N.sudoEnabled?"Disable sudo":"Enable sudo"}),i.jsx(le,{size:"sm",variant:"danger",disabled:!_n,onClick:()=>window.confirm(`Delete ${N.linuxUsername}?`)&&void Ge(()=>P.deleteIamSystemUser(N.id),"System user deleted"),children:"Delete"})]})})]},N.id))})})]})}function Vr(){const N=u.filter(de=>de.mfaEnabled).length,W=u.reduce((de,Cn)=>de+(Cn.passkeyCount??0),0),pt=u.reduce((de,Cn)=>de+(Cn.trustedDeviceCount??0),0),Zt=z.filter(de=>typeof de.riskScore=="number"&&de.riskScore>=.5);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"stats-grid",children:[i.jsx(De,{label:"MFA Enabled",value:N,sub:`${u.length-N} without MFA`,accent:u.length-N>0?"amber":"teal",emphasize:!0}),i.jsx(De,{label:"Passkeys",value:W,sub:"registered WebAuthn credentials",accent:"violet"}),i.jsx(De,{label:"Trusted Devices",value:pt,sub:"registered device fingerprints",accent:"sky"}),i.jsx(De,{label:"Risky Sessions",value:Zt.length,sub:"step-up candidates",accent:Zt.length?"coral":"teal"})]}),i.jsxs("div",{className:"grid-2",children:[i.jsx(je,{title:"MFA And Passkeys",eyebrow:"Users",children:i.jsx(ua,{empty:"No IAM users found.",headers:["User","MFA","Passkeys","Devices","Password"],children:u.map(de=>i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("strong",{children:de.displayName??de.username}),i.jsx("span",{className:"row-sub",children:de.email})]}),i.jsx("td",{children:i.jsx(_e,{tone:de.mfaEnabled?"teal":"amber",dot:!0,children:de.mfaEnabled?"enabled":"off"})}),i.jsx("td",{className:"cell-mono",children:de.passkeyCount??0}),i.jsx("td",{className:"cell-mono",children:de.trustedDeviceCount??0}),i.jsx("td",{className:"cell-mono",children:de.passwordChangedAt?Ct(de.passwordChangedAt):"unknown"})]},de.id))})}),i.jsx(je,{title:"Step-Up And Risk",eyebrow:"Sessions",children:i.jsx(ua,{empty:"No high-risk sessions.",headers:["User","Risk","Step-Up","Factors","Actions"],children:Zt.map(de=>i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("strong",{children:de.user?.email??de.userId}),i.jsx("span",{className:"row-sub",children:de.ipAddress??"no ip"})]}),i.jsx("td",{children:i.jsxs(_e,{tone:(de.riskScore??0)>=.75?"coral":"amber",children:[Math.round((de.riskScore??0)*100),"%"]})}),i.jsx("td",{className:"cell-mono",children:de.stepUpVerifiedAt?Ct(de.stepUpVerifiedAt):"required"}),i.jsx("td",{className:"cell-mono",children:Array.isArray(de.riskFactors)?de.riskFactors.join(", "):de.riskFactors??"-"}),i.jsx("td",{children:i.jsx(le,{size:"sm",variant:"danger",disabled:!An,onClick:()=>window.confirm("Revoke this risky session?")&&void Ge(()=>P.revokeIamSession(de.id),"Session revoked"),children:"Revoke"})})]},de.id))})}),i.jsx(je,{title:"Password Policy",eyebrow:"Step-up foundation",style:{gridColumn:"1 / -1"},children:X?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"field-grid",children:[i.jsx(ae,{label:"Name",children:i.jsx(be,{value:X.name,onChange:de=>ne({name:de})})}),i.jsx(ae,{label:"Min length",children:i.jsx(be,{inputMode:"numeric",value:String(X.minLength),onChange:de=>ne({minLength:Number(de)||0})})}),i.jsx(ae,{label:"Max length",children:i.jsx(be,{inputMode:"numeric",value:String(X.maxLength),onChange:de=>ne({maxLength:Number(de)||0})})}),i.jsx(ae,{label:"Max age days",children:i.jsx(be,{inputMode:"numeric",value:String(X.maxAgeDays),onChange:de=>ne({maxAgeDays:Number(de)||0})})}),i.jsx(ae,{label:"History count",children:i.jsx(be,{inputMode:"numeric",value:String(X.historyCount),onChange:de=>ne({historyCount:Number(de)||0})})}),i.jsx(ae,{label:"Lockout attempts",children:i.jsx(be,{inputMode:"numeric",value:String(X.lockoutAttempts),onChange:de=>ne({lockoutAttempts:Number(de)||0})})}),i.jsx(ae,{label:"Lockout minutes",children:i.jsx(be,{inputMode:"numeric",value:String(X.lockoutDurationMin),onChange:de=>ne({lockoutDurationMin:Number(de)||0})})}),i.jsxs("div",{className:"toggle-stack",children:[i.jsx(xn,{checked:X.requireUppercase,onChange:de=>ne({requireUppercase:de}),label:"Uppercase"}),i.jsx(xn,{checked:X.requireLowercase,onChange:de=>ne({requireLowercase:de}),label:"Lowercase"}),i.jsx(xn,{checked:X.requireNumbers,onChange:de=>ne({requireNumbers:de}),label:"Numbers"}),i.jsx(xn,{checked:X.requireSpecial,onChange:de=>ne({requireSpecial:de}),label:"Special characters"})]})]}),i.jsx("div",{className:"form-actions",children:i.jsx(le,{variant:"primary",loading:ce,disabled:!Dn,icon:i.jsx(Y.Check,{className:"btn-ico"}),onClick:()=>{Ze()},children:"Save policy"})})]}):i.jsx(St,{icon:i.jsx(Y.Alert,{width:34,height:34}),message:"Password policy could not be loaded from IAM."})})]})]})}function Xr(){return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"stats-grid",children:[i.jsx(De,{label:"Total Events",value:K?.totalEvents??0,sub:"last 30 days",accent:"sky",emphasize:!0}),i.jsx(De,{label:"Successful",value:K?.successCount??0,sub:"authorized actions",accent:"teal"}),i.jsx(De,{label:"Failures",value:K?.failureCount??0,sub:"failed auth",accent:"coral"}),i.jsx(De,{label:"Denied",value:K?.deniedCount??0,sub:"policy blocks",accent:"amber"})]}),i.jsx(je,{title:"Audit events",eyebrow:"Recent",children:i.jsx(ua,{empty:"No audit events found.",headers:["Time","Event","Actor","Outcome","Detail"],children:I.map(N=>i.jsxs("tr",{children:[i.jsx("td",{className:"cell-mono",children:un(N.timestamp)}),i.jsxs("td",{children:[i.jsx("strong",{children:N.eventType}),i.jsxs("span",{className:"row-sub",children:[N.category," / ",N.action]})]}),i.jsx("td",{children:N.actorEmail??N.actorId??N.actorType}),i.jsx("td",{children:i.jsx(_e,{tone:N.outcome==="SUCCESS"?"teal":N.outcome==="DENIED"?"amber":"coral",children:N.outcome})}),i.jsx("td",{className:"cell-mono",children:V_(N.detail)})]},N.id))})})]})}}function ua({headers:n,empty:l,children:r}){const u=Array.isArray(r)?r.filter(Boolean):r;return Array.isArray(u)&&u.length===0?i.jsx(St,{icon:i.jsx(Y.Info,{width:34,height:34}),message:l}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsx("tr",{children:n.map(d=>i.jsx("th",{children:d},d))})}),i.jsx("tbody",{children:r})]})})}function Ke(n,l="unknown"){return typeof n=="string"&&n.trim()?n:l}function Fv(n){return typeof n=="number"&&Number.isFinite(n)?n:null}function Bn(n){const l=Fv(n);return typeof l=="number"?l.toLocaleString():"0"}function ei(n){return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}function I_(n){const l={content:Ke(n.content,""),workspace_id:Ke(n.workspace_id,"default")};for(const r of["scope","type"])typeof n[r]=="string"&&(l[r]=n[r]);return l}function xo(n,l){const r=ei(n);for(const u of l){const d=r[u];if(Array.isArray(d))return d.filter(f=>!!f&&typeof f=="object"&&!Array.isArray(f))}return[]}function ns(n){return Ke(n.id,Ke(n.memory_id,""))}function P_({currentUser:n}){const l=Dt().data.hiveStatus?.apps.find(ne=>ne.key==="memory"),[r,u]=k.useState(null),[d,f]=k.useState(!0),[m,p]=k.useState(null),[v,g]=k.useState(()=>new URLSearchParams(location.search).get("q")??""),b=k.useRef(0),j=k.useRef(0),[C,z]=k.useState(0),[M,K]=k.useState("private"),[J,I]=k.useState("default"),[ie,X]=k.useState([]),[se,x]=k.useState(()=>new URLSearchParams(location.search).get("workspace")??"*"),[B,V]=k.useState(!1),[Q,ce]=k.useState([]),[ue,$]=k.useState(null),[pe,qe]=k.useState(""),[tt,Pe]=k.useState(null),[Z,F]=k.useState(null),[fe,Ae]=k.useState(null),[w,S]=k.useState(null),[U,te]=k.useState(""),[re,me]=k.useState(null),xe=Yt(n,"memory:write");async function ve(){f(!0),p(null),X([]);try{const[ne,Ze,Ce]=await Promise.all([P.memoryConsole(),P.memoryQueue().catch(()=>(X(nt=>[...nt,"Queue unavailable"]),null)),P.memoryWebhooks().catch(()=>(X(nt=>[...nt,"Webhooks unavailable"]),null))]);u(ne),Ze&&F(Ze),Ce&&S(Ce)}catch(ne){p(ne instanceof Ft||ne instanceof Error?ne.message:"Failed to load Memory data")}finally{f(!1)}}async function He(ne,Ze,Ce=()=>!0){me(ne),p(null);try{return await Ze()}catch(nt){return Ce()&&p(nt instanceof Ft||nt instanceof Error?nt.message:`${ne} failed`),null}finally{Ce()&&me(null)}}async function Ue(ne=0){const Ze=++b.current,Ce=new URL(location.href);Ce.searchParams.set("q",v),Ce.searchParams.set("workspace",se),history.replaceState(null,"",Ce),z(ne);const nt=await He("search",()=>P.searchMemory({query:v.trim(),workspaceId:se,limit:25,offset:ne}),()=>Ze===b.current);nt&&Ze===b.current&&(V(!0),ce(xo(nt,["results","memories","items"]).map(mt=>mt.memory?ei(mt.memory):mt)))}async function $t(ne){const Ze=ns(ne);if(!Ze)return;const Ce=++j.current,nt=()=>Ce===j.current;$(null),qe(""),Pe(null),Ae(null);const mt=await He("memory-detail",()=>P.getMemory(Ze),nt);if(Ce!==j.current||(mt&&($(mt),qe(Ke(mt.content,""))),!mt))return;const fa=await He("memory-graph",()=>P.memoryGraph(Ze),nt);if(Ce!==j.current)return;fa&&Pe(fa);const Ka=await He("memory-conflicts",()=>P.memoryConflicts(I_(mt)),nt);Ce===j.current&&Ka&&Ae(Ka)}async function Rn(){if(!U.trim())return;const ne=j.current,Ze=await He("create-memory",()=>P.createMemory({content:U.trim(),type:"semantic",scope:M,source:"user_feedback",workspace_id:J,tags:["operator-created"],metadata:{created_from:"hive-console"}}));Ze&&(te(""),await ve(),ne===j.current&&await $t(Ze))}async function Ya(){if(!ue)return;const ne=ns(ue);if(!ne)return;const Ze=j.current,Ce=await He("update-memory",()=>P.updateMemory(ne,{content:pe}),()=>Ze===j.current);Ce&&Ze===j.current&&($(Ce),await ve())}async function Ja(){if(!ue)return;const ne=ns(ue);if(!ne||!window.confirm("Delete this memory?"))return;const Ze=++j.current;await He("delete-memory",()=>P.deleteMemory(ne),()=>Ze===j.current)&&Ze===j.current&&($(null),qe(""),Pe(null),Ae(null),await ve())}async function Nt(ne,Ze,Ce){if(await He(ne,Ce)){const mt=await P.memoryQueue().catch(()=>(X(fa=>[...fa,"Queue unavailable"]),null));mt&&F(mt)}}k.useEffect(()=>{ve()},[]);const _n=ei(r?.stats),ct=ei(Z??r?.queue),Nn=ei(ct.counts),Ut=ei(ct.worker),Mn=r?.memoryTotal??_n.memories??_n.memory_count,An=B?Q:r?.memories??[],Dn=ue,Yn=xo(ct,["jobs","results","items"]),Ge=xo(w,["webhooks","results","items"]);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Memories"}),i.jsx("p",{children:"Native HiveMem operations inside the unified console."})]}),i.jsxs("div",{className:"panel-actions",children:[l?i.jsx(_e,{tone:l.status==="online"?"teal":l.status==="degraded"?"amber":"coral",dot:!0,children:l.status}):null,i.jsx(le,{variant:"ghost",icon:i.jsx(Y.Refresh,{className:"btn-ico"}),loading:d,onClick:()=>{ve()},children:"Refresh"})]})]}),m?i.jsxs("div",{className:"error-banner",children:[i.jsx(Y.Alert,{}),m]}):null,i.jsxs("div",{className:"grid grid--4",children:[i.jsx(De,{label:"Memories",value:Bn(Mn),sub:"visible through Router",accent:"amber",emphasize:!0}),i.jsx(De,{label:"Sessions",value:Bn(_n.sessions??r?.sessions.length),sub:"active history containers",accent:"sky"}),i.jsx(De,{label:"Agents",value:Bn(_n.agents??r?.agents.length),sub:"registered memory actors",accent:"teal"}),i.jsx(De,{label:"Queue",value:Bn(ct.pending_count??Nn.pending??ct.pending??0),sub:"pending jobs",accent:Fv(Nn.failed)?"coral":"violet"})]}),i.jsxs("div",{className:"grid grid--2",children:[i.jsxs(je,{title:"Search And Create",eyebrow:"native operations",children:[i.jsxs("div",{className:"form-grid form-grid--compact",children:[i.jsx(ae,{label:"Search",children:i.jsx(be,{value:v,onChange:g,placeholder:"memory text, tag, or entity"})}),i.jsx(ae,{label:"Workspace",children:i.jsx(be,{value:se,onChange:x,placeholder:"default or *"})})]}),i.jsxs("div",{className:"inline-actions",children:[i.jsx(le,{variant:"primary",icon:i.jsx(Y.Activity,{className:"btn-ico"}),loading:re==="search",onClick:()=>{Ue()},children:"Search"}),i.jsx(le,{variant:"ghost",icon:i.jsx(Y.Refresh,{className:"btn-ico"}),loading:d,onClick:()=>{ve()},children:"Refresh"})]}),ie.length>0&&i.jsxs("p",{role:"alert",children:[ie.join(". "),". Previous data may be stale."]}),i.jsxs("div",{className:"inline-actions",children:[i.jsx(le,{variant:"ghost",disabled:C===0,onClick:()=>{Ue(Math.max(0,C-25))},children:"Previous"}),i.jsxs("span",{children:["Page ",Math.floor(C/25)+1]}),i.jsx(le,{variant:"ghost",disabled:Q.length<25,onClick:()=>{Ue(C+25)},children:"Next"})]}),i.jsx(ae,{label:"Create in workspace",children:i.jsx(be,{value:J,onChange:I})}),i.jsx(ae,{label:"Visibility",hint:"Private records belong to the console service identity.",children:i.jsxs("select",{value:M,onChange:ne=>K(ne.target.value),children:[i.jsx("option",{value:"private",children:"Private"}),i.jsx("option",{value:"shared",children:"Shared in workspace"})]})}),i.jsx(ae,{label:"Create memory",children:i.jsx(st,{value:U,onChange:te,rows:4,placeholder:"What should Hive remember?"})}),i.jsx("div",{className:"inline-actions",style:{justifyContent:"flex-end"},children:i.jsx(le,{variant:"primary",loading:re==="create-memory",disabled:!xe||!U.trim(),onClick:()=>{Rn()},children:"Create"})})]}),i.jsx(je,{title:"Recent And Search Results",eyebrow:`${An.length} records`,children:d?i.jsx("div",{className:"center-load",children:i.jsx("span",{className:"spinner"})}):An.length?i.jsx("div",{className:"stack-list",children:An.map((ne,Ze)=>i.jsxs("button",{className:"stack-item stack-item--button",onClick:()=>{$t(ne)},children:[i.jsxs("div",{children:[i.jsx("strong",{children:Ke(ne.content,Ke(ne.summary,"Untitled memory")).slice(0,180)}),i.jsxs("span",{className:"muted-line",children:[Ke(ne.type)," · ",Ke(ne.scope)," · ",Ke(ne.workspace_id,"default")]})]}),i.jsx(_e,{tone:Ke(ne.confidence).startsWith("0.")?"amber":"teal",children:typeof ne.confidence=="number"?`${Math.round(ne.confidence*100)}%`:Ke(ne.confidence,"stored")})]},ns(ne)||`memory-${Ze}`))}):i.jsx(St,{icon:i.jsx(Y.Activity,{width:34,height:34}),message:"No memories returned by HiveMem."})}),i.jsxs(je,{title:"Queue",eyebrow:"run, retry, cancel",children:[i.jsxs("div",{className:"kv-list","aria-label":"Worker status",children:[i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Worker"}),i.jsx("span",{children:Ke(Ut.state,"unavailable")})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Heartbeat"}),i.jsx("span",{children:typeof Ut.heartbeat=="string"?Ct(Ut.heartbeat):"not reported"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Oldest pending"}),i.jsx("span",{children:typeof Ut.oldest_pending_seconds=="number"?`${Math.round(Ut.oldest_pending_seconds)} seconds`:"none"})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Recovered at startup"}),i.jsx("span",{children:Bn(Ut.recovered_on_startup)})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Dead letters"}),i.jsx("span",{children:Bn(ct.dead_letter_count)})]})]}),i.jsx("p",{className:"muted",children:typeof Ut.error=="string"?Ut.error+". Restore the dependency, then refresh; failed jobs can be retried below.":Ut.state==="disabled"||Ut.state==="manual"?"Automatic processing is off. Use Run for individual jobs or enable the service worker.":Ut.state==="stale"?"Heartbeat is stale. Check the Memory service and its dependency status before retrying work.":"Failed jobs retry with backoff. Inspect dead letters before choosing Retry."}),i.jsxs("div",{className:"kv-list",children:[i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Pending"}),i.jsx("span",{className:"cell-mono",children:Bn(ct.pending_count??Nn.pending??ct.pending)})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Running"}),i.jsx("span",{className:"cell-mono",children:Bn(ct.in_progress_count??Nn.running??ct.running)})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Failed"}),i.jsx("span",{className:"cell-mono",children:Bn(ct.failed_count??Nn.failed??ct.failed)})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Agents"}),i.jsx("span",{className:"cell-mono",children:Bn(r?.agents.length)})]})]}),Yn.length?i.jsx("div",{className:"stack-list stack-list--compact",children:Yn.slice(0,6).map((ne,Ze)=>{const Ce=Ke(ne.id,""),nt=["pending","failed","dead_letter"].includes(Ke(ne.status)),mt=["failed","dead_letter","cancelled"].includes(Ke(ne.status));return i.jsxs("div",{className:"stack-item",children:[i.jsxs("div",{children:[i.jsx("strong",{children:Ke(ne.task_type,"queue job")}),i.jsxs("span",{className:"muted-line",children:[Ke(ne.status)," · ",Ke(ne.workspace_id,"default")]})]}),i.jsxs("div",{className:"inline-actions",children:[i.jsx(le,{size:"sm",variant:"ghost",disabled:!xe||!Ce||!nt,loading:re===`run-${Ce}`,onClick:()=>{Nt(`run-${Ce}`,Ce,()=>P.runMemoryQueueJob(Ce))},children:"Run"}),i.jsx(le,{size:"sm",variant:"ghost",disabled:!xe||!Ce||!mt,loading:re===`retry-${Ce}`,onClick:()=>{Nt(`retry-${Ce}`,Ce,()=>P.retryMemoryQueueJob(Ce))},children:"Retry"}),i.jsx(le,{size:"sm",variant:"danger",disabled:!xe||!Ce||!nt,loading:re===`cancel-${Ce}`,onClick:()=>{Nt(`cancel-${Ce}`,Ce,()=>P.cancelMemoryQueueJob(Ce))},children:"Cancel"})]})]},Ce||`job-${Ze}`)})}):i.jsx(St,{message:"No queue jobs returned."})]}),i.jsx(je,{title:"Webhooks",eyebrow:"delivery wiring",children:Ge.length?i.jsx("div",{className:"stack-list stack-list--compact",children:Ge.slice(0,6).map((ne,Ze)=>i.jsxs("div",{className:"stack-item",children:[i.jsxs("div",{children:[i.jsx("strong",{children:Ke(ne.name,Ke(ne.url,"Webhook"))}),i.jsx("span",{className:"muted-line",children:Ke(ne.status,Ke(ne.last_status,"configured"))})]}),i.jsx(_e,{tone:ne.enabled===!1?"muted":"teal",children:ne.enabled===!1?"off":"on"})]},Ke(ne.id,`webhook-${Ze}`)))}):i.jsx(St,{message:"No webhooks returned."})})]}),i.jsxs("div",{className:"grid grid--2",children:[i.jsx(je,{title:"Memory Detail",eyebrow:Dn?ns(Dn)||"selected record":"raw service payload",children:Dn?i.jsxs(i.Fragment,{children:[i.jsx(ae,{label:"Content",children:i.jsx(st,{value:pe,onChange:qe,rows:6})}),i.jsxs("div",{className:"inline-actions",children:[i.jsx(le,{variant:"primary",loading:re==="update-memory",disabled:!xe||!ue,onClick:()=>{Ya()},children:"Save"}),i.jsx(le,{variant:"danger",loading:re==="delete-memory",disabled:!xe||!ue,onClick:()=>{Ja()},children:"Delete"})]}),i.jsx(dt,{value:Dn})]}):i.jsx(dt,{value:r??{loading:d}})}),i.jsxs(je,{title:"Graph And Conflicts",eyebrow:"selected memory",children:[i.jsx("p",{className:"panel-eyebrow",children:"Graph"}),i.jsx(dt,{value:tt??{message:"Select a memory to load graph neighborhood."}}),i.jsx("p",{className:"panel-eyebrow",style:{marginTop:18},children:"Conflicts"}),i.jsx(dt,{value:fe??{message:"Select a memory to detect conflicts."}})]})]}),i.jsx(je,{title:"Recent Sessions",eyebrow:"Memory history",children:r?.sessions.length?i.jsx("div",{className:"stack-list stack-list--compact",children:r.sessions.slice(0,5).map((ne,Ze)=>i.jsxs("div",{className:"stack-item",children:[i.jsxs("div",{children:[i.jsx("strong",{children:Ke(ne.title,Ke(ne.session_id,"Session"))}),i.jsx("span",{className:"muted-line",children:Ke(ne.workspace_id,"default")})]}),typeof ne.created_at=="string"?i.jsx("span",{className:"cell-mono",title:un(ne.created_at),children:Ct(ne.created_at)}):null]},Ke(ne.session_id,Ke(ne.id,`session-${Ze}`))))}):i.jsx(St,{message:"No sessions returned."})})]})}function F_({onNavigate:n}){const{data:l}=Dt(),r=l.hiveStatus?.apps.find(p=>p.key==="router"),u=k.useMemo(()=>l.providers.filter(p=>(p.lastHealthStatus??"").toLowerCase()==="healthy").length,[l.providers]),d=l.providers.filter(p=>p.enabled).length,f=l.telemetry?.totals??{traces:0,failures:0,failovers:0},m=f.traces>0?Math.round((f.traces-f.failures)/f.traces*100):100;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Routers"}),i.jsx("p",{children:"Provider fleet, route policy, health, and trace evidence in one operations page."})]}),r?i.jsx(_e,{tone:r.status==="online"?"teal":r.status==="degraded"?"amber":"coral",dot:!0,children:r.status}):null]}),i.jsxs("div",{className:"stats-grid",children:[i.jsx(De,{label:"Providers",value:l.providers.length,sub:`${d} enabled / ${u} healthy`,accent:"amber",emphasize:!0}),i.jsx(De,{label:"Route Rules",value:l.routeRules.length,sub:`${l.heuristics.length} heuristics`,accent:"violet"}),i.jsx(De,{label:"Traces",value:Do(f.traces),sub:`${m}% succeeded`,accent:"sky",emphasize:!0}),i.jsx(De,{label:"Failures",value:Do(f.failures),sub:`${f.failovers} failovers`,accent:"coral"})]}),i.jsxs("div",{className:"grid-2",children:[i.jsx(je,{title:"Router Workbench",eyebrow:"Controls",children:i.jsxs("div",{className:"workbench-actions",children:[i.jsxs("button",{className:"btn btn--ghost",onClick:()=>n("providers"),children:[i.jsx(Y.Server,{className:"btn-ico"}),"Providers"]}),i.jsxs("button",{className:"btn btn--ghost",onClick:()=>n("routing"),children:[i.jsx(Y.Route,{className:"btn-ico"}),"Routing"]}),i.jsxs("button",{className:"btn btn--ghost",onClick:()=>n("testing"),children:[i.jsx(Y.Hexagon,{className:"btn-ico"}),"Testing"]}),i.jsxs("button",{className:"btn btn--ghost",onClick:()=>n("traces"),children:[i.jsx(Y.Activity,{className:"btn-ico"}),"Traces"]})]})}),i.jsx(je,{title:"Latest Trace",eyebrow:"Evidence",actions:i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>n("traces"),children:"View all"}),children:l.telemetry?.latestTrace?i.jsx(dt,{value:l.telemetry.latestTrace}):i.jsx(St,{icon:i.jsx(Y.Activity,{width:34,height:34}),message:"No traces recorded yet."})})]}),i.jsx(je,{title:"Provider Pulse",eyebrow:"Health",actions:i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>n("providers"),children:"Manage"}),children:l.providers.length===0?i.jsx(St,{icon:i.jsx(Y.Server,{width:34,height:34}),message:"No providers registered yet."}):i.jsx("div",{className:"pulse-grid",children:l.providers.map(p=>i.jsxs("article",{className:"pulse-card",children:[i.jsxs("div",{className:"pulse-top",children:[i.jsx("span",{className:"pulse-name",children:p.name}),i.jsx(Uo,{status:p.lastHealthStatus})]}),i.jsx("p",{className:"pulse-meta",children:i.jsx(_e,{tone:"muted",children:p.kind})}),i.jsx("p",{className:"pulse-meta",style:{marginTop:8},children:p.baseUrl}),p.lastHealthAt?i.jsxs("p",{className:"pulse-meta",style:{marginTop:6},children:["checked ",Ct(p.lastHealthAt)]}):null]},p.id))})})]})}const Pp={user:"User","service-account":"Service Account","system-user":"System User","router-key":"Router Key","memory-agent":"Memory Agent"};function W_(n){return n.status==="inactive"?"muted":n.kind==="user"?"amber":n.kind==="memory-agent"?"teal":n.kind==="router-key"?"sky":n.kind==="service-account"?"violet":"coral"}function So(n){return n.split(/[\n,]+/u).map(l=>l.trim()).filter(Boolean)}function eN({currentUser:n}){const{data:l,refresh:r,refreshing:u}=Dt(),d=Ga(),[f,m]=k.useState(()=>new URLSearchParams(location.search).get("actor")),p=l.actors.find(x=>x.id===f)??null;k.useEffect(()=>{const x=()=>m(new URLSearchParams(location.search).get("actor"));return window.addEventListener("popstate",x),()=>window.removeEventListener("popstate",x)},[]);function v(x){m(x?.id??null);const B=new URL(location.href);x?B.searchParams.set("actor",x.id):B.searchParams.delete("actor"),history.replaceState(null,"",B)}const[g,b]=k.useState(null),[j,C]=k.useState(null),[z,M]=k.useState({agentId:"",displayName:"",description:"",iamClientId:"hive-router",roleIds:"",scopes:"memories:read, memories:write, sessions:read, sessions:write, context:read, agents:read, workspaces:read, queue:read",hostLabel:location.hostname,workspaceId:"default",owningProject:"",expiresHours:"24",allowedIps:""}),K=k.useMemo(()=>l.actors.reduce((x,B)=>(x[B.kind]=(x[B.kind]??0)+1,x),{}),[l.actors]),J=Yt(n,"hive:actors:write");async function I(x,B){if(!(x==="disable"&&!window.confirm(`Disable ${B.label} across linked Hive services?`))){b(`${x}-${B.id}`);try{const V=`hive.actor.operation:${B.id}:${x}`,Q=sessionStorage.getItem(V)??crypto.randomUUID();sessionStorage.setItem(V,Q);const ce={kind:B.kind,label:B.label,identifiers:B.identifiers,operationId:Q},ue=x==="disable"?await P.disableHiveActor(B.id,ce):await P.rotateHiveActor(B.id,ce);C(ue),x==="disable"&&ue.ok&&(sessionStorage.removeItem(V),sessionStorage.removeItem(`hive.actor.operation:${B.id}:rotate`)),ue.ok?d.success(x==="disable"?"Actor disabled":"Actor rotated",B.label):d.error("Actor operation partially completed",typeof ue.remediation=="string"?ue.remediation:"Inspect the step results before retrying."),await r()}catch(V){V instanceof Ft&&V.status===410&&sessionStorage.removeItem(`hive.actor.operation:${B.id}:${x}`),d.error(x==="disable"?"Disable failed":"Rotate failed",V instanceof Error?V.message:"Actor lifecycle request failed")}finally{b(null)}}}async function ie(){if(!j||typeof j.actorId!="string")return;const x=typeof j.operationId=="string"?j.operationId:null,B=x?`/operations/${encodeURIComponent(x)}/receipt`:"/receipt";if(!(await fetch(`/api/hive/actors/${encodeURIComponent(j.actorId)}${B}`,{method:"DELETE"})).ok)throw new Error("Receipt acknowledgement failed");typeof j.action=="string"&&sessionStorage.removeItem(`hive.actor.operation:${j.actorId}:${j.action}`),C(null)}async function X(){if(!j||typeof j.actorId!="string"||!window.confirm("Disable all linked resources for this partial actor? Records and content are retained."))return;const x=j.action==="disable"&&typeof j.operationId=="string"?j.operationId:crypto.randomUUID(),B=`hive.actor.operation:${j.actorId}:disable`;sessionStorage.setItem(B,x);const V=await P.disableHiveActor(j.actorId,{identifiers:j.identifiers??{},operationId:x});C(V),V.ok?(sessionStorage.removeItem(B),sessionStorage.removeItem(`hive.actor.operation:${j.actorId}:rotate`),d.success("Partial actor contained")):d.error("Containment partially completed","Retry Disable to finish the remaining steps."),await r()}async function se(){b("create");try{const x=z.description.trim(),B=z.hostLabel.trim(),V={agentId:z.agentId.trim(),displayName:z.displayName.trim(),iamClientId:z.iamClientId.trim(),roleIds:So(z.roleIds),scopes:So(z.scopes),allowedIps:So(z.allowedIps),workspaceId:z.workspaceId,owningProject:z.owningProject,expiresHours:Number(z.expiresHours),...x?{description:x}:{},...B?{hostLabel:B}:{}},Q=await P.createHiveActor({...V});C(Q),Q.ok?d.success("Actor created",z.displayName||z.agentId):d.error("Actor partially created",typeof Q.remediation=="string"?Q.remediation:"Inspect the step results before retrying."),Q.ok&&M(ce=>({...ce,agentId:"",displayName:"",description:"",hostLabel:"",allowedIps:""})),await r()}catch(x){d.error("Create failed",x instanceof Error?x.message:"Could not create actor")}finally{b(null)}}return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Hive Actors"}),i.jsx("p",{children:"Users, service accounts, host identities, Router keys, and Memory agents in one inventory."})]}),i.jsx(le,{variant:"ghost",icon:i.jsx(Y.Refresh,{className:"btn-ico"}),loading:u,onClick:()=>{r()},children:"Refresh"})]}),i.jsxs("div",{className:"grid grid--4",children:[i.jsx(De,{label:"Actors",value:l.actors.length,sub:"linked identities",accent:"amber",emphasize:!0}),i.jsx(De,{label:"IAM",value:(K.user??0)+(K["service-account"]??0),sub:"users and services",accent:"violet"}),i.jsx(De,{label:"Router",value:K["router-key"]??0,sub:"client keys",accent:"sky"}),i.jsx(De,{label:"Memory",value:K["memory-agent"]??0,sub:"registered agents",accent:"teal"})]}),i.jsxs(je,{title:"Create Technical Actor",eyebrow:"IAM + Router + Memory",children:[i.jsxs("div",{className:"form-grid",children:[i.jsx(ae,{label:"Agent ID",children:i.jsx(be,{value:z.agentId,onChange:x=>M(B=>({...B,agentId:x})),placeholder:"memory-host-agent"})}),i.jsx(ae,{label:"Workspace",children:i.jsx(be,{value:z.workspaceId,onChange:x=>M(B=>({...B,workspaceId:x}))})}),i.jsx(ae,{label:"Owning project",children:i.jsx(be,{value:z.owningProject,onChange:x=>M(B=>({...B,owningProject:x}))})}),i.jsx(ae,{label:"Credential lifetime (hours)",children:i.jsx(be,{value:z.expiresHours,onChange:x=>M(B=>({...B,expiresHours:x}))})}),i.jsx(ae,{label:"Display name",children:i.jsx(be,{value:z.displayName,onChange:x=>M(B=>({...B,displayName:x})),placeholder:"memory-host Hermes"})}),i.jsx(ae,{label:"IAM client ID",children:i.jsx(be,{value:z.iamClientId,onChange:x=>M(B=>({...B,iamClientId:x}))})}),i.jsx(ae,{label:"Host label",children:i.jsx(be,{value:z.hostLabel,onChange:x=>M(B=>({...B,hostLabel:x})),placeholder:"memory-host"})}),i.jsx(ae,{label:"Role IDs",hint:"Comma or newline separated",children:i.jsx(st,{rows:3,value:z.roleIds,onChange:x=>M(B=>({...B,roleIds:x}))})}),i.jsx(ae,{label:"Router and Memory scopes",hint:"Comma or newline separated",children:i.jsx(st,{rows:3,value:z.scopes,onChange:x=>M(B=>({...B,scopes:x}))})}),i.jsx(ae,{label:"Allowed IPs",hint:"Comma or newline separated IPv4 addresses",children:i.jsx(st,{rows:3,value:z.allowedIps,onChange:x=>M(B=>({...B,allowedIps:x}))})}),i.jsx(ae,{label:"Description",children:i.jsx(st,{rows:3,value:z.description,onChange:x=>M(B=>({...B,description:x}))})})]}),i.jsx("div",{className:"panel-actions",children:i.jsx(le,{variant:"primary",icon:i.jsx(Y.Plus,{className:"btn-ico"}),loading:g==="create",disabled:!J||!z.agentId.trim()||!z.displayName.trim()||!z.iamClientId.trim(),onClick:()=>{se()},children:"Create actor"})}),j?.secrets?i.jsxs("div",{className:"json-stack",children:[i.jsx("p",{className:"panel-eyebrow",children:"Latest one-time secrets and steps"}),i.jsx(dt,{value:j}),i.jsx(le,{variant:"ghost",disabled:!j.ok,onClick:()=>{ie().catch(x=>d.error(x instanceof Error?x.message:"Acknowledgement failed"))},children:"I have saved these credentials"}),!j.ok&&i.jsx(le,{variant:"danger",disabled:!J,onClick:()=>{X().catch(x=>d.error(x instanceof Error?x.message:"Containment failed"))},children:"Contain partial actor"})]}):null]}),i.jsx(je,{title:"Actor Graph",eyebrow:`${l.actors.length} records`,children:l.actors.length===0?i.jsx(St,{icon:i.jsx(Y.Key,{width:34,height:34}),message:"No actors could be assembled from IAM, Router, or Memory."}):i.jsx("div",{className:"table-wrap",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Actor"}),i.jsx("th",{children:"Kind"}),i.jsx("th",{children:"Sources"}),i.jsx("th",{children:"Capabilities"}),i.jsx("th",{children:"Last Activity"}),i.jsx("th",{children:"Links"})]})}),i.jsx("tbody",{children:l.actors.map(x=>i.jsxs("tr",{className:"row-clickable",onClick:()=>v(x),children:[i.jsx("td",{className:"cell-strong",children:i.jsx(le,{variant:"ghost",onClick:()=>v(x),children:x.label})}),i.jsx("td",{children:i.jsx(_e,{tone:W_(x),dot:!0,children:Pp[x.kind]})}),i.jsx("td",{className:"cell-mono",children:x.sources.join(", ")}),i.jsx("td",{children:x.capabilities.slice(0,3).join(", ")||"standard"}),i.jsx("td",{className:"cell-mono",title:x.lastActivityAt?un(x.lastActivityAt):void 0,children:x.lastActivityAt?Ct(x.lastActivityAt):"unknown"}),i.jsx("td",{className:"cell-mono",children:x.linkedResourceCount})]},x.id))})]})})}),i.jsx(kn,{open:!!p,onClose:()=>v(null),eyebrow:p?Pp[p.kind]:"",title:p?.label??"",footer:p?i.jsxs(i.Fragment,{children:[i.jsx(le,{variant:"ghost",onClick:()=>v(null),children:"Close"}),i.jsx(le,{variant:"ghost",loading:g===`rotate-${p.id}`,disabled:!J,onClick:()=>{I("rotate",p)},children:"Rotate"}),i.jsx(le,{variant:"danger",loading:g===`disable-${p.id}`,disabled:!J,onClick:()=>{I("disable",p)},children:"Disable"})]}):i.jsx(le,{variant:"ghost",onClick:()=>v(null),children:"Close"}),children:p?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"kv-list",children:[i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Status"}),i.jsx("span",{children:p.status})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Sources"}),i.jsx("span",{children:p.sources.join(", ")})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Links"}),i.jsx("span",{className:"cell-mono",children:p.linkedResourceCount})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Last Activity"}),i.jsx("span",{className:"cell-mono",children:p.lastActivityAt?un(p.lastActivityAt):"unknown"})]})]}),i.jsx("p",{className:"panel-eyebrow",style:{marginTop:22},children:"Identifiers"}),i.jsx(dt,{value:p.identifiers}),i.jsx("p",{className:"panel-eyebrow",style:{marginTop:22},children:"Capabilities"}),i.jsx(dt,{value:p.capabilities}),j?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"panel-eyebrow",style:{marginTop:22},children:"Latest Lifecycle Result"}),i.jsx(dt,{value:j})]}):null]}):null})]})}function _o(n){return n==="critical"?"coral":n==="warning"?"amber":n==="info"?"teal":"muted"}function tN(){const{data:n,refresh:l,refreshing:r}=Dt(),[u,d]=k.useState(null),f=n.incidents.filter(v=>v.status==="open").length,m=n.incidents.filter(v=>v.severity==="critical").length,p=n.incidents.filter(v=>v.services.length>1).length;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"page-head",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Incidents"}),i.jsx("p",{children:"Router traces and IAM audit records grouped by request ID and failure window."})]}),i.jsx(le,{variant:"ghost",icon:i.jsx(Y.Refresh,{className:"btn-ico"}),loading:r,onClick:()=>{l()},children:"Refresh"})]}),i.jsxs("div",{className:"grid grid--4",children:[i.jsx(De,{label:"Open",value:f,sub:"needs attention",accent:f?"coral":"teal",emphasize:!0}),i.jsx(De,{label:"Critical",value:m,sub:"hard failures",accent:"coral"}),i.jsx(De,{label:"Cross-Service",value:p,sub:"shared request IDs",accent:"sky"}),i.jsx(De,{label:"Total",value:n.incidents.length,sub:"recent groups",accent:"amber"})]}),i.jsx(je,{title:"Timeline",eyebrow:`${n.incidents.length} groups`,children:n.incidents.length===0?i.jsx(St,{icon:i.jsx(Y.Activity,{width:34,height:34}),message:"No recent incidents found."}):i.jsx("div",{className:"timeline-list",children:n.incidents.map(v=>i.jsxs("button",{className:"timeline-item",onClick:()=>d(v),children:[i.jsx("span",{className:`timeline-rail timeline-rail--${v.severity}`}),i.jsxs("span",{className:"timeline-main",children:[i.jsxs("span",{className:"timeline-title",children:[i.jsx("strong",{children:v.title}),i.jsx(_e,{tone:_o(v.severity),dot:!0,children:v.severity})]}),i.jsx("span",{className:"muted-line",children:v.summary}),i.jsxs("span",{className:"muted-line",children:[v.services.join(" + ")," · ",v.actors.join(", ")||"system"," · ",Ct(v.startedAt)]})]}),i.jsxs("span",{className:"cell-mono",children:[v.events.length," events"]})]},v.id))})}),i.jsx(kn,{open:!!u,onClose:()=>d(null),eyebrow:"Incident",title:u?.title??"",footer:i.jsx(le,{variant:"ghost",onClick:()=>d(null),children:"Close"}),children:u?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"kv-list",children:[i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Severity"}),i.jsx(_e,{tone:_o(u.severity),children:u.severity})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Status"}),i.jsx("span",{children:u.status})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Services"}),i.jsx("span",{children:u.services.join(", ")})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Started"}),i.jsx("span",{className:"cell-mono",children:un(u.startedAt)})]}),i.jsxs("div",{className:"kv-row",children:[i.jsx("span",{children:"Request IDs"}),i.jsx("span",{className:"cell-mono",children:u.requestIds.join(", ")||"none"})]})]}),i.jsx("p",{className:"panel-eyebrow",style:{marginTop:22},children:"Events"}),i.jsx("div",{className:"stack-list",children:u.events.map(v=>i.jsxs("div",{className:"stack-item",children:[i.jsxs("div",{children:[i.jsxs("strong",{children:[v.service,": ",v.title]}),i.jsxs("span",{className:"muted-line",children:[v.outcome??v.kind," · ",un(v.timestamp)]})]}),i.jsx(_e,{tone:_o(v.severity),children:v.severity})]},v.id))}),i.jsx("p",{className:"panel-eyebrow",style:{marginTop:22},children:"Raw Incident"}),i.jsx(dt,{value:u})]}):null})]})}const nN={"iam-overview":"overview","iam-users":"users","iam-roles":"roles","iam-service-accounts":"service-accounts","iam-clients":"clients","iam-sessions":"sessions","iam-system-users":"system-users","iam-security":"security","iam-audit":"audit"},Fp=[{label:"Hive",items:[{key:"hive",label:"Hive",icon:Y.Hexagon}]},{label:"IAM",items:[{key:"iam-overview",label:"Overview",icon:Y.Gauge},{key:"iam-users",label:"Users",icon:Y.Key},{key:"iam-roles",label:"Roles",icon:Y.Scroll},{key:"iam-service-accounts",label:"Service Accounts",icon:Y.Server},{key:"iam-clients",label:"Clients",icon:Y.Route},{key:"iam-sessions",label:"Sessions",icon:Y.Activity},{key:"iam-system-users",label:"System Users",icon:Y.Settings},{key:"iam-security",label:"Security",icon:Y.Alert},{key:"iam-audit",label:"Audit",icon:Y.Book}]},{label:"Memory",items:[{key:"memories",label:"Memories",icon:Y.Activity},{key:"actors",label:"Actors",icon:Y.Key}]},{label:"Router Operations",items:[{key:"routers",label:"Routers",icon:Y.Gauge},{key:"providers",label:"Providers",icon:Y.Server},{key:"routing",label:"Routing",icon:Y.Route},{key:"testing",label:"Testing",icon:Y.Hexagon}]},{label:"Observability",items:[{key:"traces",label:"Traces",icon:Y.Activity},{key:"incidents",label:"Incidents",icon:Y.Alert},{key:"audit",label:"Audit Log",icon:Y.Scroll}]},{label:"System",items:[{key:"keys",label:"API Keys",icon:Y.Key},{key:"docs",label:"API Docs",icon:Y.Book},{key:"settings",label:"Settings",icon:Y.Settings}]}];function aN(){const[n,l]=k.useState("checking"),[r,u]=k.useState(null);k.useEffect(()=>{let f=!0;return(async()=>{try{const m=await P.me();f&&(u(m.user),l("authed"))}catch{f&&l("unauthed")}})(),()=>{f=!1}},[]);const d=k.useCallback(()=>{u(null),l("unauthed")},[]);return n==="checking"?i.jsxs(i.Fragment,{children:[i.jsx(td,{}),i.jsx("div",{className:"center-load",children:i.jsx("span",{className:"spinner spinner--lg"})})]}):n==="unauthed"?i.jsx(lN,{onSuccess:f=>{u(f),l("authed")}}):i.jsx(n_,{onAuthExpired:d,children:i.jsx(iN,{user:r,onLogout:d})})}function td(){return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"honeycomb-bg","aria-hidden":!0}),i.jsx("div",{className:"atmosphere","aria-hidden":!0}),i.jsx("div",{className:"scanline","aria-hidden":!0})]})}function lN({onSuccess:n}){const[l,r]=k.useState("admin"),[u,d]=k.useState(""),[f,m]=k.useState(null),[p,v]=k.useState(!1);async function g(b){b.preventDefault(),v(!0),m(null);try{const j=await P.login(l.trim(),u);n(j.user)}catch(j){const C=j instanceof Ft||j instanceof Error?j.message:"Login failed";m(C)}finally{v(!1)}}return i.jsxs(i.Fragment,{children:[i.jsx(td,{}),i.jsx("div",{className:"login-shell",children:i.jsxs("form",{className:"login-card",onSubmit:g,children:[i.jsx(Iv,{className:"login-sigil"}),i.jsx("p",{className:"login-eyebrow",children:"Hive"}),i.jsx("h1",{children:"Control Plane Console"}),i.jsx("p",{className:"login-sub",children:"Authenticate to manage identity, memory, and routing."}),f?i.jsxs("div",{className:"error-banner",children:[i.jsx(Y.Alert,{}),f]}):null,i.jsxs("label",{className:"field",children:[i.jsx("span",{className:"field-label",children:"Username"}),i.jsx("input",{value:l,onChange:b=>r(b.target.value),autoComplete:"username"})]}),i.jsxs("label",{className:"field",children:[i.jsx("span",{className:"field-label",children:"Password"}),i.jsx("input",{type:"password",value:u,onChange:b=>d(b.target.value),autoComplete:"current-password"})]}),i.jsxs("button",{className:"btn btn--primary",type:"submit",disabled:p,children:[p?i.jsx("span",{className:"spinner"}):i.jsx(Y.Key,{className:"btn-ico"}),"Sign in"]})]})})]})}function iN({user:n,onLogout:l}){const[r,u]=k.useState(()=>{const X=new URLSearchParams(location.search).get("page");return Fp.flatMap(se=>se.items).find(se=>se.key===X)?.key??"hive"}),[d,f]=k.useState(!1),{data:m,loading:p,refreshing:v,error:g,loadIssues:b,lastSync:j,refresh:C,resourceFreshness:z}=Dt(),M={providers:m.providers.length,traces:m.traces.length,audit:m.audit.length,actors:m.actors.length,incidents:m.incidents.length,keys:m.clientKeys.length};async function K(){try{await P.logout()}finally{l()}}function J(X){u(X);const se=new URL(location.href);se.searchParams.set("page",X),history.replaceState(null,"",se),f(!1)}const I=m.telemetry?.totals.failures??0,ie=n?.displayName??n?.username??"Operator";return i.jsxs(i.Fragment,{children:[i.jsx(td,{}),i.jsxs("div",{className:"app-shell",children:[i.jsxs("aside",{className:d?"sidebar sidebar--open":"sidebar",children:[i.jsxs("div",{className:"brand",children:[i.jsx(Iv,{className:"brand-sigil"}),i.jsxs("div",{children:[i.jsx("strong",{children:"Hive"}),i.jsx("span",{children:"Unified Control"})]})]}),i.jsx("nav",{className:"nav",children:Fp.map(X=>i.jsxs("div",{className:"nav-group",children:[i.jsx("p",{className:"nav-group-label",children:X.label}),X.items.map(se=>{const x=se.icon,B=M[se.key];return i.jsxs("button",{className:r===se.key?"nav-item nav-item--active":"nav-item",onClick:()=>J(se.key),children:[i.jsx(x,{width:18,height:18}),i.jsx("span",{children:se.label}),typeof B=="number"&&B>0?i.jsx("span",{className:"nav-count",children:B}):null]},se.key)})]},X.label))}),i.jsxs("div",{className:"sidebar-footer",children:[i.jsxs("div",{className:"sidebar-user",children:[i.jsx("span",{className:"user-avatar",children:a_(ie)}),i.jsxs("div",{children:[i.jsx("strong",{children:ie}),i.jsx("span",{children:"Administrator"})]})]}),i.jsxs("button",{className:"btn btn--ghost btn--sm",onClick:K,children:[i.jsx(Y.Logout,{className:"btn-ico"}),"Sign out"]})]})]}),i.jsxs("main",{className:"main",children:[i.jsxs("header",{className:"topbar",children:[i.jsx("button",{className:"menu-toggle",onClick:()=>f(X=>!X),"aria-label":"Toggle navigation",children:i.jsx(Y.Menu,{})}),i.jsxs("div",{className:"topbar-lead",children:[i.jsx("p",{className:"eyebrow",children:"Control Plane"}),i.jsx("h1",{className:"title",children:sN(r)})]}),i.jsxs("div",{className:"topbar-meta",children:[i.jsxs("span",{className:rN(g,I),children:[i.jsx("span",{className:"pip-dot"}),g?"Sync error":I>0?`${I} failures`:"Healthy"]}),i.jsxs("span",{className:"status-pip",children:[i.jsx("span",{className:"pip-dot"}),j?`Synced ${Ct(j.toISOString())}`:"Syncing…",i.jsxs("details",{children:[i.jsx("summary",{children:"Panel freshness"}),Object.entries(z).map(([X,se])=>i.jsxs("p",{children:[X,": ",se?.lastSuccess?Ct(se.lastSuccess):"Never loaded",se?.error?" · "+se.error:""]},X))]})]}),i.jsxs("button",{className:"btn btn--ghost btn--sm",onClick:()=>{C()},disabled:v,children:[v?i.jsx("span",{className:"spinner"}):i.jsx(Y.Refresh,{className:"btn-ico"}),"Refresh"]})]})]}),i.jsx("div",{className:"content",children:p?i.jsx("div",{className:"center-load",children:i.jsx("span",{className:"spinner spinner--lg"})}):i.jsxs(i.Fragment,{children:[g?i.jsxs("div",{className:"sync-warning",children:[i.jsx(Y.Alert,{}),i.jsxs("div",{children:[i.jsx("strong",{children:g}),b.length>0?i.jsx("span",{children:b.slice(0,3).join(" · ")}):null]}),i.jsxs("button",{className:"btn btn--ghost btn--sm",onClick:()=>{C()},disabled:v,children:[v?i.jsx("span",{className:"spinner"}):i.jsx(Y.Refresh,{className:"btn-ico"}),"Retry"]})]}):null,cN(r,X=>J(X),n)]})})]})]}),d?i.jsx("div",{className:"scrim scrim--nav",onClick:()=>f(!1)}):null]})}function sN(n){return{hive:"Hive","iam-overview":"IAM Overview","iam-users":"IAM Users","iam-roles":"IAM Roles","iam-service-accounts":"IAM Service Accounts","iam-clients":"IAM Clients","iam-sessions":"IAM Sessions","iam-system-users":"IAM System Users","iam-security":"IAM Security","iam-audit":"IAM Audit",memories:"Memories",actors:"Actors",routers:"Routers",providers:"Providers",routing:"Routing",testing:"Testing",traces:"Traces",incidents:"Incidents",keys:"API Keys",audit:"Audit Log",docs:"API Docs",settings:"Settings"}[n]}function rN(n,l){return n?"status-pip status-pip--err":l>0?"status-pip status-pip--warn":"status-pip status-pip--ok"}function cN(n,l,r){switch(n){case"hive":return i.jsx(q_,{onNavigate:l});case"iam-overview":case"iam-users":case"iam-roles":case"iam-service-accounts":case"iam-clients":case"iam-sessions":case"iam-system-users":case"iam-security":case"iam-audit":return i.jsx(X_,{section:nN[n],onNavigate:l,currentUser:r});case"memories":return i.jsx(P_,{currentUser:r});case"actors":return i.jsx(eN,{currentUser:r});case"routers":return i.jsx(F_,{onNavigate:l});case"providers":return i.jsx(f_,{currentUser:r});case"routing":return i.jsx(h_,{currentUser:r});case"testing":return i.jsx(N_,{});case"traces":return i.jsx(A_,{});case"incidents":return i.jsx(tN,{});case"keys":return i.jsx(E_,{currentUser:r});case"audit":return i.jsx(w_,{});case"docs":return i.jsx(T_,{onNavigate:l});case"settings":return i.jsx(R_,{currentUser:r});default:return null}}const Wv=document.getElementById("root");if(!Wv)throw new Error("Root element not found");Sb.createRoot(Wv).render(i.jsx(mb.StrictMode,{children:i.jsx(i_,{children:i.jsx(aN,{})})}));