Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
fix(admin): dashboard API keys mint scoped through mintLegacyToken, revoke by id
garrytandb0b55b0d880
diff --git a/admin/dist/assets/index-BIUmQPmn.js b/admin/dist/assets/index-KW-GcSja.jssimilarity index 76%rename from admin/dist/assets/index-BIUmQPmn.jsrename to admin/dist/assets/index-KW-GcSja.jsindex 0acda55ed1..3bf461abaf 100644--- a/admin/dist/assets/index-BIUmQPmn.js+++ b/admin/dist/assets/index-KW-GcSja.js@@ -1,4 +1,4 @@-(function(){const S=document.createElement("link").relList;if(S&&S.supports&&S.supports("modulepreload"))return;for(const E of document.querySelectorAll('link[rel="modulepreload"]'))o(E);new MutationObserver(E=>{for(const _ of E)if(_.type==="childList")for(const q of _.addedNodes)q.tagName==="LINK"&&q.rel==="modulepreload"&&o(q)}).observe(document,{childList:!0,subtree:!0});function b(E){const _={};return E.integrity&&(_.integrity=E.integrity),E.referrerPolicy&&(_.referrerPolicy=E.referrerPolicy),E.crossOrigin==="use-credentials"?_.credentials="include":E.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function o(E){if(E.ep)return;E.ep=!0;const _=b(E);fetch(E.href,_)}})();function wd(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var rs={exports:{}},Tn={};/**+(function(){const x=document.createElement("link").relList;if(x&&x.supports&&x.supports("modulepreload"))return;for(const E of document.querySelectorAll('link[rel="modulepreload"]'))o(E);new MutationObserver(E=>{for(const _ of E)if(_.type==="childList")for(const q of _.addedNodes)q.tagName==="LINK"&&q.rel==="modulepreload"&&o(q)}).observe(document,{childList:!0,subtree:!0});function b(E){const _={};return E.integrity&&(_.integrity=E.integrity),E.referrerPolicy&&(_.referrerPolicy=E.referrerPolicy),E.crossOrigin==="use-credentials"?_.credentials="include":E.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function o(E){if(E.ep)return;E.ep=!0;const _=b(E);fetch(E.href,_)}})();function wd(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var rs={exports:{}},Tn={};/*** @license React* react-jsx-runtime.production.js*@@ -6,7 +6,7 @@** This source code is licensed under the MIT license found in the* LICENSE file in the root directory of this source tree.- */var Ad;function gy(){if(Ad)return Tn;Ad=1;var s=Symbol.for("react.transitional.element"),S=Symbol.for("react.fragment");function b(o,E,_){var q=null;if(_!==void 0&&(q=""+_),E.key!==void 0&&(q=""+E.key),"key"in E){_={};for(var H in E)H!=="key"&&(_[H]=E[H])}else _=E;return E=_.ref,{$$typeof:s,type:o,key:q,ref:E!==void 0?E:null,props:_}}return Tn.Fragment=S,Tn.jsx=b,Tn.jsxs=b,Tn}var _d;function py(){return _d||(_d=1,rs.exports=gy()),rs.exports}var i=py(),ds={exports:{}},I={};/**+ */var Ad;function gy(){if(Ad)return Tn;Ad=1;var s=Symbol.for("react.transitional.element"),x=Symbol.for("react.fragment");function b(o,E,_){var q=null;if(_!==void 0&&(q=""+_),E.key!==void 0&&(q=""+E.key),"key"in E){_={};for(var H in E)H!=="key"&&(_[H]=E[H])}else _=E;return E=_.ref,{$$typeof:s,type:o,key:q,ref:E!==void 0?E:null,props:_}}return Tn.Fragment=x,Tn.jsx=b,Tn.jsxs=b,Tn}var _d;function py(){return _d||(_d=1,rs.exports=gy()),rs.exports}var i=py(),ds={exports:{}},I={};/*** @license React* react.production.js*@@ -14,7 +14,7 @@** This source code is licensed under the MIT license found in the* LICENSE file in the root directory of this source tree.- */var zd;function by(){if(zd)return I;zd=1;var s=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),q=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),U=Symbol.iterator;function L(m){return m===null||typeof m!="object"?null:(m=U&&m[U]||m["@@iterator"],typeof m=="function"?m:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Z=Object.assign,W={};function ae(m,D,B){this.props=m,this.context=D,this.refs=W,this.updater=B||w}ae.prototype.isReactComponent={},ae.prototype.setState=function(m,D){if(typeof m!="object"&&typeof m!="function"&&m!=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,m,D,"setState")},ae.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function $(){}$.prototype=ae.prototype;function le(m,D,B){this.props=m,this.context=D,this.refs=W,this.updater=B||w}var ne=le.prototype=new $;ne.constructor=le,Z(ne,ae.prototype),ne.isPureReactComponent=!0;var xe=Array.isArray;function k(){}var V={H:null,A:null,T:null,S:null},Se=Object.prototype.hasOwnProperty;function je(m,D,B){var X=B.ref;return{$$typeof:s,type:m,key:D,ref:X!==void 0?X:null,props:B}}function se(m,D){return je(m.type,D,m.props)}function F(m){return typeof m=="object"&&m!==null&&m.$$typeof===s}function de(m){var D={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(B){return D[B]})}var Ge=/\/+/g;function Ce(m,D){return typeof m=="object"&&m!==null&&m.key!=null?de(""+m.key):D.toString(36)}function Ze(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(k,k):(m.status="pending",m.then(function(D){m.status==="pending"&&(m.status="fulfilled",m.value=D)},function(D){m.status==="pending"&&(m.status="rejected",m.reason=D)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function j(m,D,B,X,P){var ue=typeof m;(ue==="undefined"||ue==="boolean")&&(m=null);var ve=!1;if(m===null)ve=!0;else switch(ue){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(m.$$typeof){case s:case S:ve=!0;break;case O:return ve=m._init,j(ve(m._payload),D,B,X,P)}}if(ve)return P=P(m),ve=X===""?"."+Ce(m,0):X,xe(P)?(B="",ve!=null&&(B=ve.replace(Ge,"$&/")+"/"),j(P,D,B,"",function(Na){return Na})):P!=null&&(F(P)&&(P=se(P,B+(P.key==null||m&&m.key===P.key?"":(""+P.key).replace(Ge,"$&/")+"/")+ve)),D.push(P)),1;ve=0;var et=X===""?".":X+":";if(xe(m))for(var He=0;He<m.length;He++)X=m[He],ue=et+Ce(X,He),ve+=j(X,D,B,ue,P);else if(He=L(m),typeof He=="function")for(m=He.call(m),He=0;!(X=m.next()).done;)X=X.value,ue=et+Ce(X,He++),ve+=j(X,D,B,ue,P);else if(ue==="object"){if(typeof m.then=="function")return j(Ze(m),D,B,X,P);throw D=String(m),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return ve}function N(m,D,B){if(m==null)return m;var X=[],P=0;return j(m,X,"","",function(ue){return D.call(B,ue,P++)}),X}function Y(m){if(m._status===-1){var D=m._result;D=D(),D.then(function(B){(m._status===0||m._status===-1)&&(m._status=1,m._result=B)},function(B){(m._status===0||m._status===-1)&&(m._status=2,m._result=B)}),m._status===-1&&(m._status=0,m._result=D)}if(m._status===1)return m._result.default;throw m._result}var Te=typeof reportError=="function"?reportError:function(m){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof m=="object"&&m!==null&&typeof m.message=="string"?String(m.message):String(m),error:m});if(!window.dispatchEvent(D))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",m);return}console.error(m)},ze={map:N,forEach:function(m,D,B){N(m,function(){D.apply(this,arguments)},B)},count:function(m){var D=0;return N(m,function(){D++}),D},toArray:function(m){return N(m,function(D){return D})||[]},only:function(m){if(!F(m))throw Error("React.Children.only expected to receive a single React element child.");return m}};return I.Activity=R,I.Children=ze,I.Component=ae,I.Fragment=b,I.Profiler=E,I.PureComponent=le,I.StrictMode=o,I.Suspense=A,I.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,I.__COMPILER_RUNTIME={__proto__:null,c:function(m){return V.H.useMemoCache(m)}},I.cache=function(m){return function(){return m.apply(null,arguments)}},I.cacheSignal=function(){return null},I.cloneElement=function(m,D,B){if(m==null)throw Error("The argument must be a React element, but you passed "+m+".");var X=Z({},m.props),P=m.key;if(D!=null)for(ue in D.key!==void 0&&(P=""+D.key),D)!Se.call(D,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&D.ref===void 0||(X[ue]=D[ue]);var ue=arguments.length-2;if(ue===1)X.children=B;else if(1<ue){for(var ve=Array(ue),et=0;et<ue;et++)ve[et]=arguments[et+2];X.children=ve}return je(m.type,P,X)},I.createContext=function(m){return m={$$typeof:q,_currentValue:m,_currentValue2:m,_threadCount:0,Provider:null,Consumer:null},m.Provider=m,m.Consumer={$$typeof:_,_context:m},m},I.createElement=function(m,D,B){var X,P={},ue=null;if(D!=null)for(X in D.key!==void 0&&(ue=""+D.key),D)Se.call(D,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(P[X]=D[X]);var ve=arguments.length-2;if(ve===1)P.children=B;else if(1<ve){for(var et=Array(ve),He=0;He<ve;He++)et[He]=arguments[He+2];P.children=et}if(m&&m.defaultProps)for(X in ve=m.defaultProps,ve)P[X]===void 0&&(P[X]=ve[X]);return je(m,ue,P)},I.createRef=function(){return{current:null}},I.forwardRef=function(m){return{$$typeof:H,render:m}},I.isValidElement=F,I.lazy=function(m){return{$$typeof:O,_payload:{_status:-1,_result:m},_init:Y}},I.memo=function(m,D){return{$$typeof:d,type:m,compare:D===void 0?null:D}},I.startTransition=function(m){var D=V.T,B={};V.T=B;try{var X=m(),P=V.S;P!==null&&P(B,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(k,Te)}catch(ue){Te(ue)}finally{D!==null&&B.types!==null&&(D.types=B.types),V.T=D}},I.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},I.use=function(m){return V.H.use(m)},I.useActionState=function(m,D,B){return V.H.useActionState(m,D,B)},I.useCallback=function(m,D){return V.H.useCallback(m,D)},I.useContext=function(m){return V.H.useContext(m)},I.useDebugValue=function(){},I.useDeferredValue=function(m,D){return V.H.useDeferredValue(m,D)},I.useEffect=function(m,D){return V.H.useEffect(m,D)},I.useEffectEvent=function(m){return V.H.useEffectEvent(m)},I.useId=function(){return V.H.useId()},I.useImperativeHandle=function(m,D,B){return V.H.useImperativeHandle(m,D,B)},I.useInsertionEffect=function(m,D){return V.H.useInsertionEffect(m,D)},I.useLayoutEffect=function(m,D){return V.H.useLayoutEffect(m,D)},I.useMemo=function(m,D){return V.H.useMemo(m,D)},I.useOptimistic=function(m,D){return V.H.useOptimistic(m,D)},I.useReducer=function(m,D,B){return V.H.useReducer(m,D,B)},I.useRef=function(m){return V.H.useRef(m)},I.useState=function(m){return V.H.useState(m)},I.useSyncExternalStore=function(m,D,B){return V.H.useSyncExternalStore(m,D,B)},I.useTransition=function(){return V.H.useTransition()},I.version="19.2.5",I}var Od;function xs(){return Od||(Od=1,ds.exports=by()),ds.exports}var M=xs();const Xd=wd(M);var hs={exports:{}},En={},ms={exports:{}},ys={};/**+ */var zd;function by(){if(zd)return I;zd=1;var s=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),q=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),R=Symbol.iterator;function Q(m){return m===null||typeof m!="object"?null:(m=R&&m[R]||m["@@iterator"],typeof m=="function"?m:null)}var G={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Z=Object.assign,W={};function ae(m,M,B){this.props=m,this.context=M,this.refs=W,this.updater=B||G}ae.prototype.isReactComponent={},ae.prototype.setState=function(m,M){if(typeof m!="object"&&typeof m!="function"&&m!=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,m,M,"setState")},ae.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function $(){}$.prototype=ae.prototype;function le(m,M,B){this.props=m,this.context=M,this.refs=W,this.updater=B||G}var ne=le.prototype=new $;ne.constructor=le,Z(ne,ae.prototype),ne.isPureReactComponent=!0;var xe=Array.isArray;function k(){}var V={H:null,A:null,T:null,S:null},Se=Object.prototype.hasOwnProperty;function je(m,M,B){var X=B.ref;return{$$typeof:s,type:m,key:M,ref:X!==void 0?X:null,props:B}}function se(m,M){return je(m.type,M,m.props)}function F(m){return typeof m=="object"&&m!==null&&m.$$typeof===s}function de(m){var M={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(B){return M[B]})}var Ge=/\/+/g;function Ce(m,M){return typeof m=="object"&&m!==null&&m.key!=null?de(""+m.key):M.toString(36)}function Ze(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(k,k):(m.status="pending",m.then(function(M){m.status==="pending"&&(m.status="fulfilled",m.value=M)},function(M){m.status==="pending"&&(m.status="rejected",m.reason=M)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function j(m,M,B,X,P){var ue=typeof m;(ue==="undefined"||ue==="boolean")&&(m=null);var ve=!1;if(m===null)ve=!0;else switch(ue){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(m.$$typeof){case s:case x:ve=!0;break;case D:return ve=m._init,j(ve(m._payload),M,B,X,P)}}if(ve)return P=P(m),ve=X===""?"."+Ce(m,0):X,xe(P)?(B="",ve!=null&&(B=ve.replace(Ge,"$&/")+"/"),j(P,M,B,"",function(Na){return Na})):P!=null&&(F(P)&&(P=se(P,B+(P.key==null||m&&m.key===P.key?"":(""+P.key).replace(Ge,"$&/")+"/")+ve)),M.push(P)),1;ve=0;var et=X===""?".":X+":";if(xe(m))for(var He=0;He<m.length;He++)X=m[He],ue=et+Ce(X,He),ve+=j(X,M,B,ue,P);else if(He=Q(m),typeof He=="function")for(m=He.call(m),He=0;!(X=m.next()).done;)X=X.value,ue=et+Ce(X,He++),ve+=j(X,M,B,ue,P);else if(ue==="object"){if(typeof m.then=="function")return j(Ze(m),M,B,X,P);throw M=String(m),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.")}return ve}function N(m,M,B){if(m==null)return m;var X=[],P=0;return j(m,X,"","",function(ue){return M.call(B,ue,P++)}),X}function Y(m){if(m._status===-1){var M=m._result;M=M(),M.then(function(B){(m._status===0||m._status===-1)&&(m._status=1,m._result=B)},function(B){(m._status===0||m._status===-1)&&(m._status=2,m._result=B)}),m._status===-1&&(m._status=0,m._result=M)}if(m._status===1)return m._result.default;throw m._result}var Te=typeof reportError=="function"?reportError:function(m){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var M=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof m=="object"&&m!==null&&typeof m.message=="string"?String(m.message):String(m),error:m});if(!window.dispatchEvent(M))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",m);return}console.error(m)},ze={map:N,forEach:function(m,M,B){N(m,function(){M.apply(this,arguments)},B)},count:function(m){var M=0;return N(m,function(){M++}),M},toArray:function(m){return N(m,function(M){return M})||[]},only:function(m){if(!F(m))throw Error("React.Children.only expected to receive a single React element child.");return m}};return I.Activity=O,I.Children=ze,I.Component=ae,I.Fragment=b,I.Profiler=E,I.PureComponent=le,I.StrictMode=o,I.Suspense=A,I.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,I.__COMPILER_RUNTIME={__proto__:null,c:function(m){return V.H.useMemoCache(m)}},I.cache=function(m){return function(){return m.apply(null,arguments)}},I.cacheSignal=function(){return null},I.cloneElement=function(m,M,B){if(m==null)throw Error("The argument must be a React element, but you passed "+m+".");var X=Z({},m.props),P=m.key;if(M!=null)for(ue in M.key!==void 0&&(P=""+M.key),M)!Se.call(M,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&M.ref===void 0||(X[ue]=M[ue]);var ue=arguments.length-2;if(ue===1)X.children=B;else if(1<ue){for(var ve=Array(ue),et=0;et<ue;et++)ve[et]=arguments[et+2];X.children=ve}return je(m.type,P,X)},I.createContext=function(m){return m={$$typeof:q,_currentValue:m,_currentValue2:m,_threadCount:0,Provider:null,Consumer:null},m.Provider=m,m.Consumer={$$typeof:_,_context:m},m},I.createElement=function(m,M,B){var X,P={},ue=null;if(M!=null)for(X in M.key!==void 0&&(ue=""+M.key),M)Se.call(M,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(P[X]=M[X]);var ve=arguments.length-2;if(ve===1)P.children=B;else if(1<ve){for(var et=Array(ve),He=0;He<ve;He++)et[He]=arguments[He+2];P.children=et}if(m&&m.defaultProps)for(X in ve=m.defaultProps,ve)P[X]===void 0&&(P[X]=ve[X]);return je(m,ue,P)},I.createRef=function(){return{current:null}},I.forwardRef=function(m){return{$$typeof:H,render:m}},I.isValidElement=F,I.lazy=function(m){return{$$typeof:D,_payload:{_status:-1,_result:m},_init:Y}},I.memo=function(m,M){return{$$typeof:d,type:m,compare:M===void 0?null:M}},I.startTransition=function(m){var M=V.T,B={};V.T=B;try{var X=m(),P=V.S;P!==null&&P(B,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(k,Te)}catch(ue){Te(ue)}finally{M!==null&&B.types!==null&&(M.types=B.types),V.T=M}},I.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},I.use=function(m){return V.H.use(m)},I.useActionState=function(m,M,B){return V.H.useActionState(m,M,B)},I.useCallback=function(m,M){return V.H.useCallback(m,M)},I.useContext=function(m){return V.H.useContext(m)},I.useDebugValue=function(){},I.useDeferredValue=function(m,M){return V.H.useDeferredValue(m,M)},I.useEffect=function(m,M){return V.H.useEffect(m,M)},I.useEffectEvent=function(m){return V.H.useEffectEvent(m)},I.useId=function(){return V.H.useId()},I.useImperativeHandle=function(m,M,B){return V.H.useImperativeHandle(m,M,B)},I.useInsertionEffect=function(m,M){return V.H.useInsertionEffect(m,M)},I.useLayoutEffect=function(m,M){return V.H.useLayoutEffect(m,M)},I.useMemo=function(m,M){return V.H.useMemo(m,M)},I.useOptimistic=function(m,M){return V.H.useOptimistic(m,M)},I.useReducer=function(m,M,B){return V.H.useReducer(m,M,B)},I.useRef=function(m){return V.H.useRef(m)},I.useState=function(m){return V.H.useState(m)},I.useSyncExternalStore=function(m,M,B){return V.H.useSyncExternalStore(m,M,B)},I.useTransition=function(){return V.H.useTransition()},I.version="19.2.5",I}var Od;function xs(){return Od||(Od=1,ds.exports=by()),ds.exports}var U=xs();const Xd=wd(U);var hs={exports:{}},En={},ms={exports:{}},ys={};/*** @license React* scheduler.production.js*@@ -22,7 +22,7 @@** This source code is licensed under the MIT license found in the* LICENSE file in the root directory of this source tree.- */var Nd;function xy(){return Nd||(Nd=1,(function(s){function S(j,N){var Y=j.length;j.push(N);e:for(;0<Y;){var Te=Y-1>>>1,ze=j[Te];if(0<E(ze,N))j[Te]=N,j[Y]=ze,Y=Te;else break e}}function b(j){return j.length===0?null:j[0]}function o(j){if(j.length===0)return null;var N=j[0],Y=j.pop();if(Y!==N){j[0]=Y;e:for(var Te=0,ze=j.length,m=ze>>>1;Te<m;){var D=2*(Te+1)-1,B=j[D],X=D+1,P=j[X];if(0>E(B,Y))X<ze&&0>E(P,B)?(j[Te]=P,j[X]=Y,Te=X):(j[Te]=B,j[D]=Y,Te=D);else if(X<ze&&0>E(P,Y))j[Te]=P,j[X]=Y,Te=X;else break e}}return N}function E(j,N){var Y=j.sortIndex-N.sortIndex;return Y!==0?Y:j.id-N.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var _=performance;s.unstable_now=function(){return _.now()}}else{var q=Date,H=q.now();s.unstable_now=function(){return q.now()-H}}var A=[],d=[],O=1,R=null,U=3,L=!1,w=!1,Z=!1,W=!1,ae=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,le=typeof setImmediate<"u"?setImmediate:null;function ne(j){for(var N=b(d);N!==null;){if(N.callback===null)o(d);else if(N.startTime<=j)o(d),N.sortIndex=N.expirationTime,S(A,N);else break;N=b(d)}}function xe(j){if(Z=!1,ne(j),!w)if(b(A)!==null)w=!0,k||(k=!0,de());else{var N=b(d);N!==null&&Ze(xe,N.startTime-j)}}var k=!1,V=-1,Se=5,je=-1;function se(){return W?!0:!(s.unstable_now()-je<Se)}function F(){if(W=!1,k){var j=s.unstable_now();je=j;var N=!0;try{e:{w=!1,Z&&(Z=!1,$(V),V=-1),L=!0;var Y=U;try{t:{for(ne(j),R=b(A);R!==null&&!(R.expirationTime>j&&se());){var Te=R.callback;if(typeof Te=="function"){R.callback=null,U=R.priorityLevel;var ze=Te(R.expirationTime<=j);if(j=s.unstable_now(),typeof ze=="function"){R.callback=ze,ne(j),N=!0;break t}R===b(A)&&o(A),ne(j)}else o(A);R=b(A)}if(R!==null)N=!0;else{var m=b(d);m!==null&&Ze(xe,m.startTime-j),N=!1}}break e}finally{R=null,U=Y,L=!1}N=void 0}}finally{N?de():k=!1}}}var de;if(typeof le=="function")de=function(){le(F)};else if(typeof MessageChannel<"u"){var Ge=new MessageChannel,Ce=Ge.port2;Ge.port1.onmessage=F,de=function(){Ce.postMessage(null)}}else de=function(){ae(F,0)};function Ze(j,N){V=ae(function(){j(s.unstable_now())},N)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(j){j.callback=null},s.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Se=0<j?Math.floor(1e3/j):5},s.unstable_getCurrentPriorityLevel=function(){return U},s.unstable_next=function(j){switch(U){case 1:case 2:case 3:var N=3;break;default:N=U}var Y=U;U=N;try{return j()}finally{U=Y}},s.unstable_requestPaint=function(){W=!0},s.unstable_runWithPriority=function(j,N){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var Y=U;U=j;try{return N()}finally{U=Y}},s.unstable_scheduleCallback=function(j,N,Y){var Te=s.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?Te+Y:Te):Y=Te,j){case 1:var ze=-1;break;case 2:ze=250;break;case 5:ze=1073741823;break;case 4:ze=1e4;break;default:ze=5e3}return ze=Y+ze,j={id:O++,callback:N,priorityLevel:j,startTime:Y,expirationTime:ze,sortIndex:-1},Y>Te?(j.sortIndex=Y,S(d,j),b(A)===null&&j===b(d)&&(Z?($(V),V=-1):Z=!0,Ze(xe,Y-Te))):(j.sortIndex=ze,S(A,j),w||L||(w=!0,k||(k=!0,de()))),j},s.unstable_shouldYield=se,s.unstable_wrapCallback=function(j){var N=U;return function(){var Y=U;U=N;try{return j.apply(this,arguments)}finally{U=Y}}}})(ys)),ys}var Cd;function Sy(){return Cd||(Cd=1,ms.exports=xy()),ms.exports}var vs={exports:{}},Pe={};/**+ */var Nd;function xy(){return Nd||(Nd=1,(function(s){function x(j,N){var Y=j.length;j.push(N);e:for(;0<Y;){var Te=Y-1>>>1,ze=j[Te];if(0<E(ze,N))j[Te]=N,j[Y]=ze,Y=Te;else break e}}function b(j){return j.length===0?null:j[0]}function o(j){if(j.length===0)return null;var N=j[0],Y=j.pop();if(Y!==N){j[0]=Y;e:for(var Te=0,ze=j.length,m=ze>>>1;Te<m;){var M=2*(Te+1)-1,B=j[M],X=M+1,P=j[X];if(0>E(B,Y))X<ze&&0>E(P,B)?(j[Te]=P,j[X]=Y,Te=X):(j[Te]=B,j[M]=Y,Te=M);else if(X<ze&&0>E(P,Y))j[Te]=P,j[X]=Y,Te=X;else break e}}return N}function E(j,N){var Y=j.sortIndex-N.sortIndex;return Y!==0?Y:j.id-N.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var _=performance;s.unstable_now=function(){return _.now()}}else{var q=Date,H=q.now();s.unstable_now=function(){return q.now()-H}}var A=[],d=[],D=1,O=null,R=3,Q=!1,G=!1,Z=!1,W=!1,ae=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,le=typeof setImmediate<"u"?setImmediate:null;function ne(j){for(var N=b(d);N!==null;){if(N.callback===null)o(d);else if(N.startTime<=j)o(d),N.sortIndex=N.expirationTime,x(A,N);else break;N=b(d)}}function xe(j){if(Z=!1,ne(j),!G)if(b(A)!==null)G=!0,k||(k=!0,de());else{var N=b(d);N!==null&&Ze(xe,N.startTime-j)}}var k=!1,V=-1,Se=5,je=-1;function se(){return W?!0:!(s.unstable_now()-je<Se)}function F(){if(W=!1,k){var j=s.unstable_now();je=j;var N=!0;try{e:{G=!1,Z&&(Z=!1,$(V),V=-1),Q=!0;var Y=R;try{t:{for(ne(j),O=b(A);O!==null&&!(O.expirationTime>j&&se());){var Te=O.callback;if(typeof Te=="function"){O.callback=null,R=O.priorityLevel;var ze=Te(O.expirationTime<=j);if(j=s.unstable_now(),typeof ze=="function"){O.callback=ze,ne(j),N=!0;break t}O===b(A)&&o(A),ne(j)}else o(A);O=b(A)}if(O!==null)N=!0;else{var m=b(d);m!==null&&Ze(xe,m.startTime-j),N=!1}}break e}finally{O=null,R=Y,Q=!1}N=void 0}}finally{N?de():k=!1}}}var de;if(typeof le=="function")de=function(){le(F)};else if(typeof MessageChannel<"u"){var Ge=new MessageChannel,Ce=Ge.port2;Ge.port1.onmessage=F,de=function(){Ce.postMessage(null)}}else de=function(){ae(F,0)};function Ze(j,N){V=ae(function(){j(s.unstable_now())},N)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(j){j.callback=null},s.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Se=0<j?Math.floor(1e3/j):5},s.unstable_getCurrentPriorityLevel=function(){return R},s.unstable_next=function(j){switch(R){case 1:case 2:case 3:var N=3;break;default:N=R}var Y=R;R=N;try{return j()}finally{R=Y}},s.unstable_requestPaint=function(){W=!0},s.unstable_runWithPriority=function(j,N){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var Y=R;R=j;try{return N()}finally{R=Y}},s.unstable_scheduleCallback=function(j,N,Y){var Te=s.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?Te+Y:Te):Y=Te,j){case 1:var ze=-1;break;case 2:ze=250;break;case 5:ze=1073741823;break;case 4:ze=1e4;break;default:ze=5e3}return ze=Y+ze,j={id:D++,callback:N,priorityLevel:j,startTime:Y,expirationTime:ze,sortIndex:-1},Y>Te?(j.sortIndex=Y,x(d,j),b(A)===null&&j===b(d)&&(Z?($(V),V=-1):Z=!0,Ze(xe,Y-Te))):(j.sortIndex=ze,x(A,j),G||Q||(G=!0,k||(k=!0,de()))),j},s.unstable_shouldYield=se,s.unstable_wrapCallback=function(j){var N=R;return function(){var Y=R;R=N;try{return j.apply(this,arguments)}finally{R=Y}}}})(ys)),ys}var Cd;function Sy(){return Cd||(Cd=1,ms.exports=xy()),ms.exports}var vs={exports:{}},Pe={};/*** @license React* react-dom.production.js*@@ -30,7 +30,7 @@** This source code is licensed under the MIT license found in the* LICENSE file in the root directory of this source tree.- */var Dd;function jy(){if(Dd)return Pe;Dd=1;var s=xs();function S(A){var d="https://react.dev/errors/"+A;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var O=2;O<arguments.length;O++)d+="&args[]="+encodeURIComponent(arguments[O])}return"Minified React error #"+A+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function b(){}var o={d:{f:b,r:function(){throw Error(S(522))},D:b,C:b,L:b,m:b,X:b,S:b,M:b},p:0,findDOMNode:null},E=Symbol.for("react.portal");function _(A,d,O){var R=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:E,key:R==null?null:""+R,children:A,containerInfo:d,implementation:O}}var q=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function H(A,d){if(A==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Pe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Pe.createPortal=function(A,d){var O=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(S(299));return _(A,d,null,O)},Pe.flushSync=function(A){var d=q.T,O=o.p;try{if(q.T=null,o.p=2,A)return A()}finally{q.T=d,o.p=O,o.d.f()}},Pe.preconnect=function(A,d){typeof A=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,o.d.C(A,d))},Pe.prefetchDNS=function(A){typeof A=="string"&&o.d.D(A)},Pe.preinit=function(A,d){if(typeof A=="string"&&d&&typeof d.as=="string"){var O=d.as,R=H(O,d.crossOrigin),U=typeof d.integrity=="string"?d.integrity:void 0,L=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;O==="style"?o.d.S(A,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:R,integrity:U,fetchPriority:L}):O==="script"&&o.d.X(A,{crossOrigin:R,integrity:U,fetchPriority:L,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Pe.preinitModule=function(A,d){if(typeof A=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var O=H(d.as,d.crossOrigin);o.d.M(A,{crossOrigin:O,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&o.d.M(A)},Pe.preload=function(A,d){if(typeof A=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var O=d.as,R=H(O,d.crossOrigin);o.d.L(A,O,{crossOrigin:R,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Pe.preloadModule=function(A,d){if(typeof A=="string")if(d){var O=H(d.as,d.crossOrigin);o.d.m(A,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:O,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else o.d.m(A)},Pe.requestFormReset=function(A){o.d.r(A)},Pe.unstable_batchedUpdates=function(A,d){return A(d)},Pe.useFormState=function(A,d,O){return q.H.useFormState(A,d,O)},Pe.useFormStatus=function(){return q.H.useHostTransitionStatus()},Pe.version="19.2.5",Pe}var Md;function Ty(){if(Md)return vs.exports;Md=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(S){console.error(S)}}return s(),vs.exports=jy(),vs.exports}/**+ */var Dd;function jy(){if(Dd)return Pe;Dd=1;var s=xs();function x(A){var d="https://react.dev/errors/"+A;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var D=2;D<arguments.length;D++)d+="&args[]="+encodeURIComponent(arguments[D])}return"Minified React error #"+A+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function b(){}var o={d:{f:b,r:function(){throw Error(x(522))},D:b,C:b,L:b,m:b,X:b,S:b,M:b},p:0,findDOMNode:null},E=Symbol.for("react.portal");function _(A,d,D){var O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:E,key:O==null?null:""+O,children:A,containerInfo:d,implementation:D}}var q=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function H(A,d){if(A==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Pe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Pe.createPortal=function(A,d){var D=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(x(299));return _(A,d,null,D)},Pe.flushSync=function(A){var d=q.T,D=o.p;try{if(q.T=null,o.p=2,A)return A()}finally{q.T=d,o.p=D,o.d.f()}},Pe.preconnect=function(A,d){typeof A=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,o.d.C(A,d))},Pe.prefetchDNS=function(A){typeof A=="string"&&o.d.D(A)},Pe.preinit=function(A,d){if(typeof A=="string"&&d&&typeof d.as=="string"){var D=d.as,O=H(D,d.crossOrigin),R=typeof d.integrity=="string"?d.integrity:void 0,Q=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;D==="style"?o.d.S(A,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:O,integrity:R,fetchPriority:Q}):D==="script"&&o.d.X(A,{crossOrigin:O,integrity:R,fetchPriority:Q,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Pe.preinitModule=function(A,d){if(typeof A=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var D=H(d.as,d.crossOrigin);o.d.M(A,{crossOrigin:D,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&o.d.M(A)},Pe.preload=function(A,d){if(typeof A=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var D=d.as,O=H(D,d.crossOrigin);o.d.L(A,D,{crossOrigin:O,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Pe.preloadModule=function(A,d){if(typeof A=="string")if(d){var D=H(d.as,d.crossOrigin);o.d.m(A,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:D,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else o.d.m(A)},Pe.requestFormReset=function(A){o.d.r(A)},Pe.unstable_batchedUpdates=function(A,d){return A(d)},Pe.useFormState=function(A,d,D){return q.H.useFormState(A,d,D)},Pe.useFormStatus=function(){return q.H.useHostTransitionStatus()},Pe.version="19.2.5",Pe}var Md;function Ty(){if(Md)return vs.exports;Md=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(x){console.error(x)}}return s(),vs.exports=jy(),vs.exports}/*** @license React* react-dom-client.production.js*@@ -38,17 +38,17 @@** This source code is licensed under the MIT license found in the* LICENSE file in the root directory of this source tree.- */var Rd;function Ey(){if(Rd)return En;Rd=1;var s=Sy(),S=xs(),b=Ty();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}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 E(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function _(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function q(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 H(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 A(e){if(_(e)!==e)throw Error(o(188))}function d(e){var t=e.alternate;if(!t){if(t=_(e),t===null)throw Error(o(188));return t!==e?null:e}for(var l=e,a=t;;){var n=l.return;if(n===null)break;var u=n.alternate;if(u===null){if(a=n.return,a!==null){l=a;continue}break}if(n.child===u.child){for(u=n.child;u;){if(u===l)return A(n),e;if(u===a)return A(n),t;u=u.sibling}throw Error(o(188))}if(l.return!==a.return)l=n,a=u;else{for(var c=!1,f=n.child;f;){if(f===l){c=!0,l=n,a=u;break}if(f===a){c=!0,a=n,l=u;break}f=f.sibling}if(!c){for(f=u.child;f;){if(f===l){c=!0,l=u,a=n;break}if(f===a){c=!0,a=u,l=n;break}f=f.sibling}if(!c)throw Error(o(189))}}if(l.alternate!==a)throw Error(o(190))}if(l.tag!==3)throw Error(o(188));return l.stateNode.current===l?e:t}function O(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=O(e),t!==null)return t;e=e.sibling}return null}var R=Object.assign,U=Symbol.for("react.element"),L=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),Z=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),ae=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),le=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),xe=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),Se=Symbol.for("react.lazy"),je=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function de(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var Ge=Symbol.for("react.client.reference");function Ce(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ge?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Z:return"Fragment";case ae:return"Profiler";case W:return"StrictMode";case xe:return"Suspense";case k:return"SuspenseList";case je:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case le:return e.displayName||"Context";case $:return(e._context.displayName||"Context")+".Consumer";case ne: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:Ce(e.type)||"Memo";case Se:t=e._payload,e=e._init;try{return Ce(e(t))}catch{}}return null}var Ze=Array.isArray,j=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=b.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},Te=[],ze=-1;function m(e){return{current:e}}function D(e){0>ze||(e.current=Te[ze],Te[ze]=null,ze--)}function B(e,t){ze++,Te[ze]=e.current,e.current=t}var X=m(null),P=m(null),ue=m(null),ve=m(null);function et(e,t){switch(B(ue,t),B(P,e),B(X,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?kr(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=kr(t),e=Wr(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}D(X),B(X,e)}function He(){D(X),D(P),D(ue)}function Na(e){e.memoizedState!==null&&B(ve,e);var t=X.current,l=Wr(t,e.type);t!==l&&(B(P,e),B(X,l))}function zn(e){P.current===e&&(D(X),D(P)),ve.current===e&&(D(ve),bn._currentValue=Y)}var Ju,js;function Al(e){if(Ju===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Ju=t&&t[1]||"",js=-1<l.stack.indexOf(`+ */var Rd;function Ey(){if(Rd)return En;Rd=1;var s=Sy(),x=xs(),b=Ty();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}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 E(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function _(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function q(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 H(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 A(e){if(_(e)!==e)throw Error(o(188))}function d(e){var t=e.alternate;if(!t){if(t=_(e),t===null)throw Error(o(188));return t!==e?null:e}for(var l=e,a=t;;){var n=l.return;if(n===null)break;var u=n.alternate;if(u===null){if(a=n.return,a!==null){l=a;continue}break}if(n.child===u.child){for(u=n.child;u;){if(u===l)return A(n),e;if(u===a)return A(n),t;u=u.sibling}throw Error(o(188))}if(l.return!==a.return)l=n,a=u;else{for(var c=!1,f=n.child;f;){if(f===l){c=!0,l=n,a=u;break}if(f===a){c=!0,a=n,l=u;break}f=f.sibling}if(!c){for(f=u.child;f;){if(f===l){c=!0,l=u,a=n;break}if(f===a){c=!0,a=u,l=n;break}f=f.sibling}if(!c)throw Error(o(189))}}if(l.alternate!==a)throw Error(o(190))}if(l.tag!==3)throw Error(o(188));return l.stateNode.current===l?e:t}function D(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=D(e),t!==null)return t;e=e.sibling}return null}var O=Object.assign,R=Symbol.for("react.element"),Q=Symbol.for("react.transitional.element"),G=Symbol.for("react.portal"),Z=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),ae=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),le=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),xe=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),Se=Symbol.for("react.lazy"),je=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function de(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var Ge=Symbol.for("react.client.reference");function Ce(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ge?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Z:return"Fragment";case ae:return"Profiler";case W:return"StrictMode";case xe:return"Suspense";case k:return"SuspenseList";case je:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case G:return"Portal";case le:return e.displayName||"Context";case $:return(e._context.displayName||"Context")+".Consumer";case ne: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:Ce(e.type)||"Memo";case Se:t=e._payload,e=e._init;try{return Ce(e(t))}catch{}}return null}var Ze=Array.isArray,j=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=b.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},Te=[],ze=-1;function m(e){return{current:e}}function M(e){0>ze||(e.current=Te[ze],Te[ze]=null,ze--)}function B(e,t){ze++,Te[ze]=e.current,e.current=t}var X=m(null),P=m(null),ue=m(null),ve=m(null);function et(e,t){switch(B(ue,t),B(P,e),B(X,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?kr(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=kr(t),e=Wr(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}M(X),B(X,e)}function He(){M(X),M(P),M(ue)}function Na(e){e.memoizedState!==null&&B(ve,e);var t=X.current,l=Wr(t,e.type);t!==l&&(B(P,e),B(X,l))}function zn(e){P.current===e&&(M(X),M(P)),ve.current===e&&(M(ve),bn._currentValue=Y)}var Ju,js;function Al(e){if(Ju===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Ju=t&&t[1]||"",js=-1<l.stack.indexOf(`at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`-`+Ju+e+js}var ku=!1;function Wu(e,t){if(!e||ku)return"";ku=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var C=function(){throw Error()};if(Object.defineProperty(C.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(C,[])}catch(x){var p=x}Reflect.construct(e,[],C)}else{try{C.call()}catch(x){p=x}e.call(C.prototype)}}else{try{throw Error()}catch(x){p=x}(C=e())&&typeof C.catch=="function"&&C.catch(function(){})}}catch(x){if(x&&p&&typeof x.stack=="string")return[x.stack,p.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),c=u[0],f=u[1];if(c&&f){var r=c.split(`+`+Ju+e+js}var ku=!1;function Wu(e,t){if(!e||ku)return"";ku=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var C=function(){throw Error()};if(Object.defineProperty(C.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(C,[])}catch(S){var p=S}Reflect.construct(e,[],C)}else{try{C.call()}catch(S){p=S}e.call(C.prototype)}}else{try{throw Error()}catch(S){p=S}(C=e())&&typeof C.catch=="function"&&C.catch(function(){})}}catch(S){if(S&&p&&typeof S.stack=="string")return[S.stack,p.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),c=u[0],f=u[1];if(c&&f){var r=c.split(``),g=f.split(``);for(n=a=0;a<r.length&&!r[a].includes("DetermineComponentFrameRoot");)a++;for(;n<g.length&&!g[n].includes("DetermineComponentFrameRoot");)n++;if(a===r.length||n===g.length)for(a=r.length-1,n=g.length-1;1<=a&&0<=n&&r[a]!==g[n];)n--;for(;1<=a&&0<=n;a--,n--)if(r[a]!==g[n]){if(a!==1||n!==1)do if(a--,n--,0>n||r[a]!==g[n]){var T=``+r[a].replace(" at new "," at ");return e.displayName&&T.includes("<anonymous>")&&(T=T.replace("<anonymous>",e.displayName)),T}while(1<=a&&0<=n);break}}}finally{ku=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Al(l):""}function kd(e,t){switch(e.tag){case 26:case 27:case 5:return Al(e.type);case 16:return Al("Lazy");case 13:return e.child!==t&&t!==null?Al("Suspense Fallback"):Al("Suspense");case 19:return Al("SuspenseList");case 0:case 15:return Wu(e.type,!1);case 11:return Wu(e.type.render,!1);case 1:return Wu(e.type,!0);case 31:return Al("Activity");default:return""}}function Ts(e){try{var t="",l=null;do t+=kd(e,l),l=e,e=e.return;while(e);return t}catch(a){return`Error generating stack: `+a.message+`-`+a.stack}}var $u=Object.prototype.hasOwnProperty,Fu=s.unstable_scheduleCallback,Iu=s.unstable_cancelCallback,Wd=s.unstable_shouldYield,$d=s.unstable_requestPaint,ft=s.unstable_now,Fd=s.unstable_getCurrentPriorityLevel,Es=s.unstable_ImmediatePriority,As=s.unstable_UserBlockingPriority,On=s.unstable_NormalPriority,Id=s.unstable_LowPriority,_s=s.unstable_IdlePriority,Pd=s.log,eh=s.unstable_setDisableYieldValue,Ca=null,ot=null;function el(e){if(typeof Pd=="function"&&eh(e),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(Ca,e)}catch{}}var rt=Math.clz32?Math.clz32:ah,th=Math.log,lh=Math.LN2;function ah(e){return e>>>=0,e===0?32:31-(th(e)/lh|0)|0}var Nn=256,Cn=262144,Dn=4194304;function _l(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 Mn(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var n=0,u=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var f=a&134217727;return f!==0?(a=f&~u,a!==0?n=_l(a):(c&=f,c!==0?n=_l(c):l||(l=f&~e,l!==0&&(n=_l(l))))):(f=a&~u,f!==0?n=_l(f):c!==0?n=_l(c):l||(l=a&~e,l!==0&&(n=_l(l)))),n===0?0:t!==0&&t!==n&&(t&u)===0&&(u=n&-n,l=t&-t,u>=l||u===32&&(l&4194048)!==0)?t:n}function Da(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nh(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 zs(){var e=Dn;return Dn<<=1,(Dn&62914560)===0&&(Dn=4194304),e}function Pu(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Ma(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function uh(e,t,l,a,n,u){var c=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var f=e.entanglements,r=e.expirationTimes,g=e.hiddenUpdates;for(l=c&~l;0<l;){var T=31-rt(l),C=1<<T;f[T]=0,r[T]=-1;var p=g[T];if(p!==null)for(g[T]=null,T=0;T<p.length;T++){var x=p[T];x!==null&&(x.lane&=-536870913)}l&=~C}a!==0&&Os(e,a,0),u!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=u&~(c&~t))}function Os(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-rt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function Ns(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-rt(l),n=1<<a;n&t|e[a]&t&&(e[a]|=t),l&=~n}}function Cs(e,t){var l=t&-t;return l=(l&42)!==0?1:ei(l),(l&(e.suspendedLanes|t))!==0?0:l}function ei(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 ti(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ds(){var e=N.p;return e!==0?e:(e=window.event,e===void 0?32:pd(e.type))}function Ms(e,t){var l=N.p;try{return N.p=e,t()}finally{N.p=l}}var tl=Math.random().toString(36).slice(2),ke="__reactFiber$"+tl,lt="__reactProps$"+tl,Zl="__reactContainer$"+tl,li="__reactEvents$"+tl,ih="__reactListeners$"+tl,ch="__reactHandles$"+tl,Rs="__reactResources$"+tl,Ra="__reactMarker$"+tl;function ai(e){delete e[ke],delete e[lt],delete e[li],delete e[ih],delete e[ch]}function Vl(e){var t=e[ke];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Zl]||l[ke]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=ld(e);e!==null;){if(l=e[ke])return l;e=ld(e)}return t}e=l,l=e.parentNode}return null}function Kl(e){if(e=e[ke]||e[Zl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ua(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Jl(e){var t=e[Rs];return t||(t=e[Rs]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ke(e){e[Ra]=!0}var Us=new Set,qs={};function zl(e,t){kl(e,t),kl(e+"Capture",t)}function kl(e,t){for(qs[e]=t,e=0;e<t.length;e++)Us.add(t[e])}var sh=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]*$"),Hs={},Bs={};function fh(e){return $u.call(Bs,e)?!0:$u.call(Hs,e)?!1:sh.test(e)?Bs[e]=!0:(Hs[e]=!0,!1)}function Rn(e,t,l){if(fh(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function Un(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function Ht(e,t,l,a){if(a===null)e.removeAttribute(l);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+a)}}function bt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ys(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function oh(e,t,l){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var n=a.get,u=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(c){l=""+c,u.call(this,c)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(c){l=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ni(e){if(!e._valueTracker){var t=Ys(e)?"checked":"value";e._valueTracker=oh(e,t,""+e[t])}}function Gs(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=Ys(e)?e.checked?"true":"false":e.value),e=a,e!==l?(t.setValue(e),!0):!1}function qn(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 rh=/[\n"\\]/g;function xt(e){return e.replace(rh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ui(e,t,l,a,n,u,c,f){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),t!=null?c==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+bt(t)):e.value!==""+bt(t)&&(e.value=""+bt(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?ii(e,c,bt(t)):l!=null?ii(e,c,bt(l)):a!=null&&e.removeAttribute("value"),n==null&&u!=null&&(e.defaultChecked=!!u),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.name=""+bt(f):e.removeAttribute("name")}function ws(e,t,l,a,n,u,c,f){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||l!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){ni(e);return}l=l!=null?""+bt(l):"",t=t!=null?""+bt(t):l,f||t===e.value||(e.value=t),e.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=f?e.checked:!!a,e.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),ni(e)}function ii(e,t,l){t==="number"&&qn(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Wl(e,t,l,a){if(e=e.options,t){t={};for(var n=0;n<l.length;n++)t["$"+l[n]]=!0;for(l=0;l<e.length;l++)n=t.hasOwnProperty("$"+e[l].value),e[l].selected!==n&&(e[l].selected=n),n&&a&&(e[l].defaultSelected=!0)}else{for(l=""+bt(l),t=null,n=0;n<e.length;n++){if(e[n].value===l){e[n].selected=!0,a&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function Xs(e,t,l){if(t!=null&&(t=""+bt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+bt(l):""}function Qs(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(o(92));if(Ze(a)){if(1<a.length)throw Error(o(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=bt(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),ni(e)}function $l(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var dh=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 Ls(e,t,l){var a=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,l):typeof l!="number"||l===0||dh.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Zs(e,t,l){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,l!=null){for(var a in l)!l.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var n in t)a=t[n],t.hasOwnProperty(n)&&l[n]!==a&&Ls(e,n,a)}else for(var u in t)t.hasOwnProperty(u)&&Ls(e,u,t[u])}function ci(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 hh=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"]]),mh=/^[\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 Hn(e){return mh.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Bt(){}var si=null;function fi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fl=null,Il=null;function Vs(e){var t=Kl(e);if(t&&(e=t.stateNode)){var l=e[lt]||null;e:switch(e=t.stateNode,t.type){case"input":if(ui(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+xt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var n=a[lt]||null;if(!n)throw Error(o(90));ui(a,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<l.length;t++)a=l[t],a.form===e.form&&Gs(a)}break e;case"textarea":Xs(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Wl(e,!!l.multiple,t,!1)}}}var oi=!1;function Ks(e,t,l){if(oi)return e(t,l);oi=!0;try{var a=e(t);return a}finally{if(oi=!1,(Fl!==null||Il!==null)&&(Tu(),Fl&&(t=Fl,e=Il,Il=Fl=null,Vs(t),e)))for(t=0;t<e.length;t++)Vs(e[t])}}function qa(e,t){var l=e.stateNode;if(l===null)return null;var a=l[lt]||null;if(a===null)return null;l=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(o(231,t,typeof l));return l}var Yt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ri=!1;if(Yt)try{var Ha={};Object.defineProperty(Ha,"passive",{get:function(){ri=!0}}),window.addEventListener("test",Ha,Ha),window.removeEventListener("test",Ha,Ha)}catch{ri=!1}var ll=null,di=null,Bn=null;function Js(){if(Bn)return Bn;var e,t=di,l=t.length,a,n="value"in ll?ll.value:ll.textContent,u=n.length;for(e=0;e<l&&t[e]===n[e];e++);var c=l-e;for(a=1;a<=c&&t[l-a]===n[u-a];a++);return Bn=n.slice(e,1<a?1-a:void 0)}function Yn(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 Gn(){return!0}function ks(){return!1}function at(e){function t(l,a,n,u,c){this._reactName=l,this._targetInst=n,this.type=a,this.nativeEvent=u,this.target=c,this.currentTarget=null;for(var f in e)e.hasOwnProperty(f)&&(l=e[f],this[f]=l?l(u):u[f]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?Gn:ks,this.isPropagationStopped=ks,this}return R(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Gn)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Gn)},persist:function(){},isPersistent:Gn}),t}var Ol={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wn=at(Ol),Ba=R({},Ol,{view:0,detail:0}),yh=at(Ba),hi,mi,Ya,Xn=R({},Ba,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vi,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!==Ya&&(Ya&&e.type==="mousemove"?(hi=e.screenX-Ya.screenX,mi=e.screenY-Ya.screenY):mi=hi=0,Ya=e),hi)},movementY:function(e){return"movementY"in e?e.movementY:mi}}),Ws=at(Xn),vh=R({},Xn,{dataTransfer:0}),gh=at(vh),ph=R({},Ba,{relatedTarget:0}),yi=at(ph),bh=R({},Ol,{animationName:0,elapsedTime:0,pseudoElement:0}),xh=at(bh),Sh=R({},Ol,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),jh=at(Sh),Th=R({},Ol,{data:0}),$s=at(Th),Eh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ah={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"},_h={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=_h[e])?!!t[e]:!1}function vi(){return zh}var Oh=R({},Ba,{key:function(e){if(e.key){var t=Eh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ah[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vi,charCode:function(e){return e.type==="keypress"?Yn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Nh=at(Oh),Ch=R({},Xn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fs=at(Ch),Dh=R({},Ba,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vi}),Mh=at(Dh),Rh=R({},Ol,{propertyName:0,elapsedTime:0,pseudoElement:0}),Uh=at(Rh),qh=R({},Xn,{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}),Hh=at(qh),Bh=R({},Ol,{newState:0,oldState:0}),Yh=at(Bh),Gh=[9,13,27,32],gi=Yt&&"CompositionEvent"in window,Ga=null;Yt&&"documentMode"in document&&(Ga=document.documentMode);var wh=Yt&&"TextEvent"in window&&!Ga,Is=Yt&&(!gi||Ga&&8<Ga&&11>=Ga),Ps=" ",ef=!1;function tf(e,t){switch(e){case"keyup":return Gh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pl=!1;function Xh(e,t){switch(e){case"compositionend":return lf(t);case"keypress":return t.which!==32?null:(ef=!0,Ps);case"textInput":return e=t.data,e===Ps&&ef?null:e;default:return null}}function Qh(e,t){if(Pl)return e==="compositionend"||!gi&&tf(e,t)?(e=Js(),Bn=di=ll=null,Pl=!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 Is&&t.locale!=="ko"?null:t.data;default:return null}}var Lh={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 af(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lh[e.type]:t==="textarea"}function nf(e,t,l,a){Fl?Il?Il.push(a):Il=[a]:Fl=a,t=Cu(t,"onChange"),0<t.length&&(l=new wn("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var wa=null,Xa=null;function Zh(e){Qr(e,0)}function Qn(e){var t=Ua(e);if(Gs(t))return e}function uf(e,t){if(e==="change")return t}var cf=!1;if(Yt){var pi;if(Yt){var bi="oninput"in document;if(!bi){var sf=document.createElement("div");sf.setAttribute("oninput","return;"),bi=typeof sf.oninput=="function"}pi=bi}else pi=!1;cf=pi&&(!document.documentMode||9<document.documentMode)}function ff(){wa&&(wa.detachEvent("onpropertychange",of),Xa=wa=null)}function of(e){if(e.propertyName==="value"&&Qn(Xa)){var t=[];nf(t,Xa,e,fi(e)),Ks(Zh,t)}}function Vh(e,t,l){e==="focusin"?(ff(),wa=t,Xa=l,wa.attachEvent("onpropertychange",of)):e==="focusout"&&ff()}function Kh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Qn(Xa)}function Jh(e,t){if(e==="click")return Qn(t)}function kh(e,t){if(e==="input"||e==="change")return Qn(t)}function Wh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dt=typeof Object.is=="function"?Object.is:Wh;function Qa(e,t){if(dt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),a=Object.keys(t);if(l.length!==a.length)return!1;for(a=0;a<l.length;a++){var n=l[a];if(!$u.call(t,n)||!dt(e[n],t[n]))return!1}return!0}function rf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function df(e,t){var l=rf(e);e=0;for(var a;l;){if(l.nodeType===3){if(a=e+l.textContent.length,e<=t&&a>=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=rf(l)}}function hf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qn(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=qn(e.document)}return t}function xi(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 $h=Yt&&"documentMode"in document&&11>=document.documentMode,ea=null,Si=null,La=null,ji=!1;function yf(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;ji||ea==null||ea!==qn(a)||(a=ea,"selectionStart"in a&&xi(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),La&&Qa(La,a)||(La=a,a=Cu(Si,"onSelect"),0<a.length&&(t=new wn("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=ea)))}function Nl(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var ta={animationend:Nl("Animation","AnimationEnd"),animationiteration:Nl("Animation","AnimationIteration"),animationstart:Nl("Animation","AnimationStart"),transitionrun:Nl("Transition","TransitionRun"),transitionstart:Nl("Transition","TransitionStart"),transitioncancel:Nl("Transition","TransitionCancel"),transitionend:Nl("Transition","TransitionEnd")},Ti={},vf={};Yt&&(vf=document.createElement("div").style,"AnimationEvent"in window||(delete ta.animationend.animation,delete ta.animationiteration.animation,delete ta.animationstart.animation),"TransitionEvent"in window||delete ta.transitionend.transition);function Cl(e){if(Ti[e])return Ti[e];if(!ta[e])return e;var t=ta[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in vf)return Ti[e]=t[l];return e}var gf=Cl("animationend"),pf=Cl("animationiteration"),bf=Cl("animationstart"),Fh=Cl("transitionrun"),Ih=Cl("transitionstart"),Ph=Cl("transitioncancel"),xf=Cl("transitionend"),Sf=new Map,Ei="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(" ");Ei.push("scrollEnd");function Nt(e,t){Sf.set(e,t),zl(t,[e])}var Ln=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)},St=[],la=0,Ai=0;function Zn(){for(var e=la,t=Ai=la=0;t<e;){var l=St[t];St[t++]=null;var a=St[t];St[t++]=null;var n=St[t];St[t++]=null;var u=St[t];if(St[t++]=null,a!==null&&n!==null){var c=a.pending;c===null?n.next=n:(n.next=c.next,c.next=n),a.pending=n}u!==0&&jf(l,n,u)}}function Vn(e,t,l,a){St[la++]=e,St[la++]=t,St[la++]=l,St[la++]=a,Ai|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function _i(e,t,l,a){return Vn(e,t,l,a),Kn(e)}function Dl(e,t){return Vn(e,null,null,t),Kn(e)}function jf(e,t,l){e.lanes|=l;var a=e.alternate;a!==null&&(a.lanes|=l);for(var n=!1,u=e.return;u!==null;)u.childLanes|=l,a=u.alternate,a!==null&&(a.childLanes|=l),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(n=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,n&&t!==null&&(n=31-rt(l),e=u.hiddenUpdates,a=e[n],a===null?e[n]=[t]:a.push(t),t.lane=l|536870912),u):null}function Kn(e){if(50<dn)throw dn=0,qc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var aa={};function em(e,t,l,a){this.tag=e,this.key=l,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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ht(e,t,l,a){return new em(e,t,l,a)}function zi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Gt(e,t){var l=e.alternate;return l===null?(l=ht(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Tf(e,t){e.flags&=65011714;var l=e.alternate;return l===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=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Jn(e,t,l,a,n,u){var c=0;if(a=e,typeof e=="function")zi(e)&&(c=1);else if(typeof e=="string")c=uy(e,l,X.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case je:return e=ht(31,l,t,n),e.elementType=je,e.lanes=u,e;case Z:return Ml(l.children,n,u,t);case W:c=8,n|=24;break;case ae:return e=ht(12,l,t,n|2),e.elementType=ae,e.lanes=u,e;case xe:return e=ht(13,l,t,n),e.elementType=xe,e.lanes=u,e;case k:return e=ht(19,l,t,n),e.elementType=k,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case le:c=10;break e;case $:c=9;break e;case ne:c=11;break e;case V:c=14;break e;case Se:c=16,a=null;break e}c=29,l=Error(o(130,e===null?"null":typeof e,"")),a=null}return t=ht(c,l,t,n),t.elementType=e,t.type=a,t.lanes=u,t}function Ml(e,t,l,a){return e=ht(7,e,a,t),e.lanes=l,e}function Oi(e,t,l){return e=ht(6,e,null,t),e.lanes=l,e}function Ef(e){var t=ht(18,null,null,0);return t.stateNode=e,t}function Ni(e,t,l){return t=ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Af=new WeakMap;function jt(e,t){if(typeof e=="object"&&e!==null){var l=Af.get(e);return l!==void 0?l:(t={value:e,source:t,stack:Ts(t)},Af.set(e,t),t)}return{value:e,source:t,stack:Ts(t)}}var na=[],ua=0,kn=null,Za=0,Tt=[],Et=0,al=null,Mt=1,Rt="";function wt(e,t){na[ua++]=Za,na[ua++]=kn,kn=e,Za=t}function _f(e,t,l){Tt[Et++]=Mt,Tt[Et++]=Rt,Tt[Et++]=al,al=e;var a=Mt;e=Rt;var n=32-rt(a)-1;a&=~(1<<n),l+=1;var u=32-rt(t)+n;if(30<u){var c=n-n%5;u=(a&(1<<c)-1).toString(32),a>>=c,n-=c,Mt=1<<32-rt(t)+n|l<<n|a,Rt=u+e}else Mt=1<<u|l<<n|a,Rt=e}function Ci(e){e.return!==null&&(wt(e,1),_f(e,1,0))}function Di(e){for(;e===kn;)kn=na[--ua],na[ua]=null,Za=na[--ua],na[ua]=null;for(;e===al;)al=Tt[--Et],Tt[Et]=null,Rt=Tt[--Et],Tt[Et]=null,Mt=Tt[--Et],Tt[Et]=null}function zf(e,t){Tt[Et++]=Mt,Tt[Et++]=Rt,Tt[Et++]=al,Mt=t.id,Rt=t.overflow,al=e}var We=null,De=null,re=!1,nl=null,At=!1,Mi=Error(o(519));function ul(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Va(jt(t,e)),Mi}function Of(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[ke]=e,t[lt]=a,l){case"dialog":ce("cancel",t),ce("close",t);break;case"iframe":case"object":case"embed":ce("load",t);break;case"video":case"audio":for(l=0;l<mn.length;l++)ce(mn[l],t);break;case"source":ce("error",t);break;case"img":case"image":case"link":ce("error",t),ce("load",t);break;case"details":ce("toggle",t);break;case"input":ce("invalid",t),ws(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":ce("invalid",t);break;case"textarea":ce("invalid",t),Qs(t,a.value,a.defaultValue,a.children)}l=a.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||a.suppressHydrationWarning===!0||Kr(t.textContent,l)?(a.popover!=null&&(ce("beforetoggle",t),ce("toggle",t)),a.onScroll!=null&&ce("scroll",t),a.onScrollEnd!=null&&ce("scrollend",t),a.onClick!=null&&(t.onclick=Bt),t=!0):t=!1,t||ul(e,!0)}function Nf(e){for(We=e.return;We;)switch(We.tag){case 5:case 31:case 13:At=!1;return;case 27:case 3:At=!0;return;default:We=We.return}}function ia(e){if(e!==We)return!1;if(!re)return Nf(e),re=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||$c(e.type,e.memoizedProps)),l=!l),l&&De&&ul(e),Nf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));De=td(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));De=td(e)}else t===27?(t=De,bl(e.type)?(e=ts,ts=null,De=e):De=t):De=We?zt(e.stateNode.nextSibling):null;return!0}function Rl(){De=We=null,re=!1}function Ri(){var e=nl;return e!==null&&(ct===null?ct=e:ct.push.apply(ct,e),nl=null),e}function Va(e){nl===null?nl=[e]:nl.push(e)}var Ui=m(null),Ul=null,Xt=null;function il(e,t,l){B(Ui,t._currentValue),t._currentValue=l}function Qt(e){e._currentValue=Ui.current,D(Ui)}function qi(e,t,l){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===l)break;e=e.return}}function Hi(e,t,l,a){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var u=n.dependencies;if(u!==null){var c=n.child;u=u.firstContext;e:for(;u!==null;){var f=u;u=n;for(var r=0;r<t.length;r++)if(f.context===t[r]){u.lanes|=l,f=u.alternate,f!==null&&(f.lanes|=l),qi(u.return,l,e),a||(c=null);break e}u=f.next}}else if(n.tag===18){if(c=n.return,c===null)throw Error(o(341));c.lanes|=l,u=c.alternate,u!==null&&(u.lanes|=l),qi(c,l,e),c=null}else c=n.child;if(c!==null)c.return=n;else for(c=n;c!==null;){if(c===e){c=null;break}if(n=c.sibling,n!==null){n.return=c.return,c=n;break}c=c.return}n=c}}function ca(e,t,l,a){e=null;for(var n=t,u=!1;n!==null;){if(!u){if((n.flags&524288)!==0)u=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var c=n.alternate;if(c===null)throw Error(o(387));if(c=c.memoizedProps,c!==null){var f=n.type;dt(n.pendingProps.value,c.value)||(e!==null?e.push(f):e=[f])}}else if(n===ve.current){if(c=n.alternate,c===null)throw Error(o(387));c.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(bn):e=[bn])}n=n.return}e!==null&&Hi(t,e,l,a),t.flags|=262144}function Wn(e){for(e=e.firstContext;e!==null;){if(!dt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ql(e){Ul=e,Xt=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $e(e){return Cf(Ul,e)}function $n(e,t){return Ul===null&&ql(e),Cf(e,t)}function Cf(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},Xt===null){if(e===null)throw Error(o(308));Xt=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xt=Xt.next=t;return l}var tm=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},lm=s.unstable_scheduleCallback,am=s.unstable_NormalPriority,we={$$typeof:le,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bi(){return{controller:new tm,data:new Map,refCount:0}}function Ka(e){e.refCount--,e.refCount===0&&lm(am,function(){e.controller.abort()})}var Ja=null,Yi=0,sa=0,fa=null;function nm(e,t){if(Ja===null){var l=Ja=[];Yi=0,sa=Xc(),fa={status:"pending",value:void 0,then:function(a){l.push(a)}}}return Yi++,t.then(Df,Df),t}function Df(){if(--Yi===0&&Ja!==null){fa!==null&&(fa.status="fulfilled");var e=Ja;Ja=null,sa=0,fa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function um(e,t){var l=[],a={status:"pending",value:null,reason:null,then:function(n){l.push(n)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var n=0;n<l.length;n++)(0,l[n])(t)},function(n){for(a.status="rejected",a.reason=n,n=0;n<l.length;n++)(0,l[n])(void 0)}),a}var Mf=j.S;j.S=function(e,t){vr=ft(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&nm(e,t),Mf!==null&&Mf(e,t)};var Hl=m(null);function Gi(){var e=Hl.current;return e!==null?e:Oe.pooledCache}function Fn(e,t){t===null?B(Hl,Hl.current):B(Hl,t.pool)}function Rf(){var e=Gi();return e===null?null:{parent:we._currentValue,pool:e}}var oa=Error(o(460)),wi=Error(o(474)),In=Error(o(542)),Pn={then:function(){}};function Uf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function qf(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(Bt,Bt),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bf(e),e;default:if(typeof t.status=="string")t.then(Bt,Bt);else{if(e=Oe,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=a}},function(a){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bf(e),e}throw Yl=t,oa}}function Bl(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Yl=l,oa):l}}var Yl=null;function Hf(){if(Yl===null)throw Error(o(459));var e=Yl;return Yl=null,e}function Bf(e){if(e===oa||e===In)throw Error(o(483))}var ra=null,ka=0;function eu(e){var t=ka;return ka+=1,ra===null&&(ra=[]),qf(ra,e,t)}function Wa(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function tu(e,t){throw t.$$typeof===U?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Yf(e){function t(y,h){if(e){var v=y.deletions;v===null?(y.deletions=[h],y.flags|=16):v.push(h)}}function l(y,h){if(!e)return null;for(;h!==null;)t(y,h),h=h.sibling;return null}function a(y){for(var h=new Map;y!==null;)y.key!==null?h.set(y.key,y):h.set(y.index,y),y=y.sibling;return h}function n(y,h){return y=Gt(y,h),y.index=0,y.sibling=null,y}function u(y,h,v){return y.index=v,e?(v=y.alternate,v!==null?(v=v.index,v<h?(y.flags|=67108866,h):v):(y.flags|=67108866,h)):(y.flags|=1048576,h)}function c(y){return e&&y.alternate===null&&(y.flags|=67108866),y}function f(y,h,v,z){return h===null||h.tag!==6?(h=Oi(v,y.mode,z),h.return=y,h):(h=n(h,v),h.return=y,h)}function r(y,h,v,z){var K=v.type;return K===Z?T(y,h,v.props.children,z,v.key):h!==null&&(h.elementType===K||typeof K=="object"&&K!==null&&K.$$typeof===Se&&Bl(K)===h.type)?(h=n(h,v.props),Wa(h,v),h.return=y,h):(h=Jn(v.type,v.key,v.props,null,y.mode,z),Wa(h,v),h.return=y,h)}function g(y,h,v,z){return h===null||h.tag!==4||h.stateNode.containerInfo!==v.containerInfo||h.stateNode.implementation!==v.implementation?(h=Ni(v,y.mode,z),h.return=y,h):(h=n(h,v.children||[]),h.return=y,h)}function T(y,h,v,z,K){return h===null||h.tag!==7?(h=Ml(v,y.mode,z,K),h.return=y,h):(h=n(h,v),h.return=y,h)}function C(y,h,v){if(typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint")return h=Oi(""+h,y.mode,v),h.return=y,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case L:return v=Jn(h.type,h.key,h.props,null,y.mode,v),Wa(v,h),v.return=y,v;case w:return h=Ni(h,y.mode,v),h.return=y,h;case Se:return h=Bl(h),C(y,h,v)}if(Ze(h)||de(h))return h=Ml(h,y.mode,v,null),h.return=y,h;if(typeof h.then=="function")return C(y,eu(h),v);if(h.$$typeof===le)return C(y,$n(y,h),v);tu(y,h)}return null}function p(y,h,v,z){var K=h!==null?h.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return K!==null?null:f(y,h,""+v,z);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case L:return v.key===K?r(y,h,v,z):null;case w:return v.key===K?g(y,h,v,z):null;case Se:return v=Bl(v),p(y,h,v,z)}if(Ze(v)||de(v))return K!==null?null:T(y,h,v,z,null);if(typeof v.then=="function")return p(y,h,eu(v),z);if(v.$$typeof===le)return p(y,h,$n(y,v),z);tu(y,v)}return null}function x(y,h,v,z,K){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return y=y.get(v)||null,f(h,y,""+z,K);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case L:return y=y.get(z.key===null?v:z.key)||null,r(h,y,z,K);case w:return y=y.get(z.key===null?v:z.key)||null,g(h,y,z,K);case Se:return z=Bl(z),x(y,h,v,z,K)}if(Ze(z)||de(z))return y=y.get(v)||null,T(h,y,z,K,null);if(typeof z.then=="function")return x(y,h,v,eu(z),K);if(z.$$typeof===le)return x(y,h,v,$n(h,z),K);tu(h,z)}return null}function G(y,h,v,z){for(var K=null,he=null,Q=h,te=h=0,oe=null;Q!==null&&te<v.length;te++){Q.index>te?(oe=Q,Q=null):oe=Q.sibling;var me=p(y,Q,v[te],z);if(me===null){Q===null&&(Q=oe);break}e&&Q&&me.alternate===null&&t(y,Q),h=u(me,h,te),he===null?K=me:he.sibling=me,he=me,Q=oe}if(te===v.length)return l(y,Q),re&&wt(y,te),K;if(Q===null){for(;te<v.length;te++)Q=C(y,v[te],z),Q!==null&&(h=u(Q,h,te),he===null?K=Q:he.sibling=Q,he=Q);return re&&wt(y,te),K}for(Q=a(Q);te<v.length;te++)oe=x(Q,y,te,v[te],z),oe!==null&&(e&&oe.alternate!==null&&Q.delete(oe.key===null?te:oe.key),h=u(oe,h,te),he===null?K=oe:he.sibling=oe,he=oe);return e&&Q.forEach(function(El){return t(y,El)}),re&&wt(y,te),K}function J(y,h,v,z){if(v==null)throw Error(o(151));for(var K=null,he=null,Q=h,te=h=0,oe=null,me=v.next();Q!==null&&!me.done;te++,me=v.next()){Q.index>te?(oe=Q,Q=null):oe=Q.sibling;var El=p(y,Q,me.value,z);if(El===null){Q===null&&(Q=oe);break}e&&Q&&El.alternate===null&&t(y,Q),h=u(El,h,te),he===null?K=El:he.sibling=El,he=El,Q=oe}if(me.done)return l(y,Q),re&&wt(y,te),K;if(Q===null){for(;!me.done;te++,me=v.next())me=C(y,me.value,z),me!==null&&(h=u(me,h,te),he===null?K=me:he.sibling=me,he=me);return re&&wt(y,te),K}for(Q=a(Q);!me.done;te++,me=v.next())me=x(Q,y,te,me.value,z),me!==null&&(e&&me.alternate!==null&&Q.delete(me.key===null?te:me.key),h=u(me,h,te),he===null?K=me:he.sibling=me,he=me);return e&&Q.forEach(function(vy){return t(y,vy)}),re&&wt(y,te),K}function _e(y,h,v,z){if(typeof v=="object"&&v!==null&&v.type===Z&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case L:e:{for(var K=v.key;h!==null;){if(h.key===K){if(K=v.type,K===Z){if(h.tag===7){l(y,h.sibling),z=n(h,v.props.children),z.return=y,y=z;break e}}else if(h.elementType===K||typeof K=="object"&&K!==null&&K.$$typeof===Se&&Bl(K)===h.type){l(y,h.sibling),z=n(h,v.props),Wa(z,v),z.return=y,y=z;break e}l(y,h);break}else t(y,h);h=h.sibling}v.type===Z?(z=Ml(v.props.children,y.mode,z,v.key),z.return=y,y=z):(z=Jn(v.type,v.key,v.props,null,y.mode,z),Wa(z,v),z.return=y,y=z)}return c(y);case w:e:{for(K=v.key;h!==null;){if(h.key===K)if(h.tag===4&&h.stateNode.containerInfo===v.containerInfo&&h.stateNode.implementation===v.implementation){l(y,h.sibling),z=n(h,v.children||[]),z.return=y,y=z;break e}else{l(y,h);break}else t(y,h);h=h.sibling}z=Ni(v,y.mode,z),z.return=y,y=z}return c(y);case Se:return v=Bl(v),_e(y,h,v,z)}if(Ze(v))return G(y,h,v,z);if(de(v)){if(K=de(v),typeof K!="function")throw Error(o(150));return v=K.call(v),J(y,h,v,z)}if(typeof v.then=="function")return _e(y,h,eu(v),z);if(v.$$typeof===le)return _e(y,h,$n(y,v),z);tu(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,h!==null&&h.tag===6?(l(y,h.sibling),z=n(h,v),z.return=y,y=z):(l(y,h),z=Oi(v,y.mode,z),z.return=y,y=z),c(y)):l(y,h)}return function(y,h,v,z){try{ka=0;var K=_e(y,h,v,z);return ra=null,K}catch(Q){if(Q===oa||Q===In)throw Q;var he=ht(29,Q,null,y.mode);return he.lanes=z,he.return=y,he}finally{}}}var Gl=Yf(!0),Gf=Yf(!1),cl=!1;function Xi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qi(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 sl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function fl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ye&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=Kn(e),jf(e,null,l),t}return Vn(e,a,t,l),Kn(e)}function $a(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Ns(e,l)}}function Li(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,u=null;if(l=l.firstBaseUpdate,l!==null){do{var c={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};u===null?n=u=c:u=u.next=c,l=l.next}while(l!==null);u===null?n=u=t:u=u.next=t}else n=u=t;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Zi=!1;function Fa(){if(Zi){var e=fa;if(e!==null)throw e}}function Ia(e,t,l,a){Zi=!1;var n=e.updateQueue;cl=!1;var u=n.firstBaseUpdate,c=n.lastBaseUpdate,f=n.shared.pending;if(f!==null){n.shared.pending=null;var r=f,g=r.next;r.next=null,c===null?u=g:c.next=g,c=r;var T=e.alternate;T!==null&&(T=T.updateQueue,f=T.lastBaseUpdate,f!==c&&(f===null?T.firstBaseUpdate=g:f.next=g,T.lastBaseUpdate=r))}if(u!==null){var C=n.baseState;c=0,T=g=r=null,f=u;do{var p=f.lane&-536870913,x=p!==f.lane;if(x?(fe&p)===p:(a&p)===p){p!==0&&p===sa&&(Zi=!0),T!==null&&(T=T.next={lane:0,tag:f.tag,payload:f.payload,callback:null,next:null});e:{var G=e,J=f;p=t;var _e=l;switch(J.tag){case 1:if(G=J.payload,typeof G=="function"){C=G.call(_e,C,p);break e}C=G;break e;case 3:G.flags=G.flags&-65537|128;case 0:if(G=J.payload,p=typeof G=="function"?G.call(_e,C,p):G,p==null)break e;C=R({},C,p);break e;case 2:cl=!0}}p=f.callback,p!==null&&(e.flags|=64,x&&(e.flags|=8192),x=n.callbacks,x===null?n.callbacks=[p]:x.push(p))}else x={lane:p,tag:f.tag,payload:f.payload,callback:f.callback,next:null},T===null?(g=T=x,r=C):T=T.next=x,c|=p;if(f=f.next,f===null){if(f=n.shared.pending,f===null)break;x=f,f=x.next,x.next=null,n.lastBaseUpdate=x,n.shared.pending=null}}while(!0);T===null&&(r=C),n.baseState=r,n.firstBaseUpdate=g,n.lastBaseUpdate=T,u===null&&(n.shared.lanes=0),ml|=c,e.lanes=c,e.memoizedState=C}}function wf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Xf(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)wf(l[e],t)}var da=m(null),lu=m(0);function Qf(e,t){e=Ft,B(lu,e),B(da,t),Ft=e|t.baseLanes}function Vi(){B(lu,Ft),B(da,da.current)}function Ki(){Ft=lu.current,D(da),D(lu)}var mt=m(null),_t=null;function ol(e){var t=e.alternate;B(Be,Be.current&1),B(mt,e),_t===null&&(t===null||da.current!==null||t.memoizedState!==null)&&(_t=e)}function Ji(e){B(Be,Be.current),B(mt,e),_t===null&&(_t=e)}function Lf(e){e.tag===22?(B(Be,Be.current),B(mt,e),_t===null&&(_t=e)):rl()}function rl(){B(Be,Be.current),B(mt,mt.current)}function yt(e){D(mt),_t===e&&(_t=null),D(Be)}var Be=m(0);function au(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Pc(l)||es(l)))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 Lt=0,ee=null,Ee=null,Xe=null,nu=!1,ha=!1,wl=!1,uu=0,Pa=0,ma=null,im=0;function Ue(){throw Error(o(321))}function ki(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!dt(e[l],t[l]))return!1;return!0}function Wi(e,t,l,a,n,u){return Lt=u,ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?zo:oc,wl=!1,u=l(a,n),wl=!1,ha&&(u=Vf(t,l,a,n)),Zf(e),u}function Zf(e){j.H=ln;var t=Ee!==null&&Ee.next!==null;if(Lt=0,Xe=Ee=ee=null,nu=!1,Pa=0,ma=null,t)throw Error(o(300));e===null||Qe||(e=e.dependencies,e!==null&&Wn(e)&&(Qe=!0))}function Vf(e,t,l,a){ee=e;var n=0;do{if(ha&&(ma=null),Pa=0,ha=!1,25<=n)throw Error(o(301));if(n+=1,Xe=Ee=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}j.H=Oo,u=t(l,a)}while(ha);return u}function cm(){var e=j.H,t=e.useState()[0];return t=typeof t.then=="function"?en(t):t,e=e.useState()[0],(Ee!==null?Ee.memoizedState:null)!==e&&(ee.flags|=1024),t}function $i(){var e=uu!==0;return uu=0,e}function Fi(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function Ii(e){if(nu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}nu=!1}Lt=0,Xe=Ee=ee=null,ha=!1,Pa=uu=0,ma=null}function tt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?ee.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Ye(){if(Ee===null){var e=ee.alternate;e=e!==null?e.memoizedState:null}else e=Ee.next;var t=Xe===null?ee.memoizedState:Xe.next;if(t!==null)Xe=t,Ee=e;else{if(e===null)throw ee.alternate===null?Error(o(467)):Error(o(310));Ee=e,e={memoizedState:Ee.memoizedState,baseState:Ee.baseState,baseQueue:Ee.baseQueue,queue:Ee.queue,next:null},Xe===null?ee.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function iu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function en(e){var t=Pa;return Pa+=1,ma===null&&(ma=[]),e=qf(ma,e,t),t=ee,(Xe===null?t.memoizedState:Xe.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?zo:oc),e}function cu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return en(e);if(e.$$typeof===le)return $e(e)}throw Error(o(438,String(e)))}function Pi(e){var t=null,l=ee.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=ee.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=iu(),ee.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),a=0;a<e;a++)l[a]=se;return t.index++,l}function Zt(e,t){return typeof t=="function"?t(e):t}function su(e){var t=Ye();return ec(t,Ee,e)}function ec(e,t,l){var a=e.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=l;var n=e.baseQueue,u=a.pending;if(u!==null){if(n!==null){var c=n.next;n.next=u.next,u.next=c}t.baseQueue=n=u,a.pending=null}if(u=e.baseState,n===null)e.memoizedState=u;else{t=n.next;var f=c=null,r=null,g=t,T=!1;do{var C=g.lane&-536870913;if(C!==g.lane?(fe&C)===C:(Lt&C)===C){var p=g.revertLane;if(p===0)r!==null&&(r=r.next={lane:0,revertLane:0,gesture:null,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null}),C===sa&&(T=!0);else if((Lt&p)===p){g=g.next,p===sa&&(T=!0);continue}else C={lane:0,revertLane:g.revertLane,gesture:null,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null},r===null?(f=r=C,c=u):r=r.next=C,ee.lanes|=p,ml|=p;C=g.action,wl&&l(u,C),u=g.hasEagerState?g.eagerState:l(u,C)}else p={lane:C,revertLane:g.revertLane,gesture:g.gesture,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null},r===null?(f=r=p,c=u):r=r.next=p,ee.lanes|=C,ml|=C;g=g.next}while(g!==null&&g!==t);if(r===null?c=u:r.next=f,!dt(u,e.memoizedState)&&(Qe=!0,T&&(l=fa,l!==null)))throw l;e.memoizedState=u,e.baseState=c,e.baseQueue=r,a.lastRenderedState=u}return n===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function tc(e){var t=Ye(),l=t.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=e;var a=l.dispatch,n=l.pending,u=t.memoizedState;if(n!==null){l.pending=null;var c=n=n.next;do u=e(u,c.action),c=c.next;while(c!==n);dt(u,t.memoizedState)||(Qe=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),l.lastRenderedState=u}return[u,a]}function Kf(e,t,l){var a=ee,n=Ye(),u=re;if(u){if(l===void 0)throw Error(o(407));l=l()}else l=t();var c=!dt((Ee||n).memoizedState,l);if(c&&(n.memoizedState=l,Qe=!0),n=n.queue,nc(Wf.bind(null,a,n,e),[e]),n.getSnapshot!==t||c||Xe!==null&&Xe.memoizedState.tag&1){if(a.flags|=2048,ya(9,{destroy:void 0},kf.bind(null,a,n,l,t),null),Oe===null)throw Error(o(349));u||(Lt&127)!==0||Jf(a,t,l)}return l}function Jf(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=ee.updateQueue,t===null?(t=iu(),ee.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function kf(e,t,l,a){t.value=l,t.getSnapshot=a,$f(t)&&Ff(e)}function Wf(e,t,l){return l(function(){$f(t)&&Ff(e)})}function $f(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!dt(e,l)}catch{return!0}}function Ff(e){var t=Dl(e,2);t!==null&&st(t,e,2)}function lc(e){var t=tt();if(typeof e=="function"){var l=e;if(e=l(),wl){el(!0);try{l()}finally{el(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:e},t}function If(e,t,l,a){return e.baseState=l,ec(e,Ee,typeof a=="function"?a:Zt)}function sm(e,t,l,a,n){if(ru(e))throw Error(o(485));if(e=t.action,e!==null){var u={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(c){u.listeners.push(c)}};j.T!==null?l(!0):u.isTransition=!1,a(u),l=t.pending,l===null?(u.next=t.pending=u,Pf(t,u)):(u.next=l.next,t.pending=l.next=u)}}function Pf(e,t){var l=t.action,a=t.payload,n=e.state;if(t.isTransition){var u=j.T,c={};j.T=c;try{var f=l(n,a),r=j.S;r!==null&&r(c,f),eo(e,t,f)}catch(g){ac(e,t,g)}finally{u!==null&&c.types!==null&&(u.types=c.types),j.T=u}}else try{u=l(n,a),eo(e,t,u)}catch(g){ac(e,t,g)}}function eo(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){to(e,t,a)},function(a){return ac(e,t,a)}):to(e,t,l)}function to(e,t,l){t.status="fulfilled",t.value=l,lo(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Pf(e,l)))}function ac(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,lo(t),t=t.next;while(t!==a)}e.action=null}function lo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ao(e,t){return t}function no(e,t){if(re){var l=Oe.formState;if(l!==null){e:{var a=ee;if(re){if(De){t:{for(var n=De,u=At;n.nodeType!==8;){if(!u){n=null;break t}if(n=zt(n.nextSibling),n===null){n=null;break t}}u=n.data,n=u==="F!"||u==="F"?n:null}if(n){De=zt(n.nextSibling),a=n.data==="F!";break e}}ul(a)}a=!1}a&&(t=l[0])}}return l=tt(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ao,lastRenderedState:t},l.queue=a,l=Eo.bind(null,ee,a),a.dispatch=l,a=lc(!1),u=fc.bind(null,ee,!1,a.queue),a=tt(),n={state:t,dispatch:null,action:e,pending:null},a.queue=n,l=sm.bind(null,ee,n,u,l),n.dispatch=l,a.memoizedState=e,[t,l,!1]}function uo(e){var t=Ye();return io(t,Ee,e)}function io(e,t,l){if(t=ec(e,t,ao)[0],e=su(Zt)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=en(t)}catch(c){throw c===oa?In:c}else a=t;t=Ye();var n=t.queue,u=n.dispatch;return l!==t.memoizedState&&(ee.flags|=2048,ya(9,{destroy:void 0},fm.bind(null,n,l),null)),[a,u,e]}function fm(e,t){e.action=t}function co(e){var t=Ye(),l=Ee;if(l!==null)return io(t,l,e);Ye(),t=t.memoizedState,l=Ye();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function ya(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=ee.updateQueue,t===null&&(t=iu(),ee.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(a=l.next,l.next=e,e.next=a,t.lastEffect=e),e}function so(){return Ye().memoizedState}function fu(e,t,l,a){var n=tt();ee.flags|=e,n.memoizedState=ya(1|t,{destroy:void 0},l,a===void 0?null:a)}function ou(e,t,l,a){var n=Ye();a=a===void 0?null:a;var u=n.memoizedState.inst;Ee!==null&&a!==null&&ki(a,Ee.memoizedState.deps)?n.memoizedState=ya(t,u,l,a):(ee.flags|=e,n.memoizedState=ya(1|t,u,l,a))}function fo(e,t){fu(8390656,8,e,t)}function nc(e,t){ou(2048,8,e,t)}function om(e){ee.flags|=4;var t=ee.updateQueue;if(t===null)t=iu(),ee.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function oo(e){var t=Ye().memoizedState;return om({ref:t,nextImpl:e}),function(){if((ye&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function ro(e,t){return ou(4,2,e,t)}function ho(e,t){return ou(4,4,e,t)}function mo(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function yo(e,t,l){l=l!=null?l.concat([e]):null,ou(4,4,mo.bind(null,t,e),l)}function uc(){}function vo(e,t){var l=Ye();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&ki(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function go(e,t){var l=Ye();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&ki(t,a[1]))return a[0];if(a=e(),wl){el(!0);try{e()}finally{el(!1)}}return l.memoizedState=[a,t],a}function ic(e,t,l){return l===void 0||(Lt&1073741824)!==0&&(fe&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=pr(),ee.lanes|=e,ml|=e,l)}function po(e,t,l,a){return dt(l,t)?l:da.current!==null?(e=ic(e,l,a),dt(e,t)||(Qe=!0),e):(Lt&42)===0||(Lt&1073741824)!==0&&(fe&261930)===0?(Qe=!0,e.memoizedState=l):(e=pr(),ee.lanes|=e,ml|=e,t)}function bo(e,t,l,a,n){var u=N.p;N.p=u!==0&&8>u?u:8;var c=j.T,f={};j.T=f,fc(e,!1,t,l);try{var r=n(),g=j.S;if(g!==null&&g(f,r),r!==null&&typeof r=="object"&&typeof r.then=="function"){var T=um(r,a);tn(e,t,T,pt(e))}else tn(e,t,a,pt(e))}catch(C){tn(e,t,{then:function(){},status:"rejected",reason:C},pt())}finally{N.p=u,c!==null&&f.types!==null&&(c.types=f.types),j.T=c}}function rm(){}function cc(e,t,l,a){if(e.tag!==5)throw Error(o(476));var n=xo(e).queue;bo(e,n,t,Y,l===null?rm:function(){return So(e),l(a)})}function xo(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:Y},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function So(e){var t=xo(e);t.next===null&&(t=e.alternate.memoizedState),tn(e,t.next.queue,{},pt())}function sc(){return $e(bn)}function jo(){return Ye().memoizedState}function To(){return Ye().memoizedState}function dm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=pt();e=sl(l);var a=fl(t,e,l);a!==null&&(st(a,t,l),$a(a,t,l)),t={cache:Bi()},e.payload=t;return}t=t.return}}function hm(e,t,l){var a=pt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ru(e)?Ao(t,l):(l=_i(e,t,l,a),l!==null&&(st(l,e,a),_o(l,t,a)))}function Eo(e,t,l){var a=pt();tn(e,t,l,a)}function tn(e,t,l,a){var n={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ru(e))Ao(t,n);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var c=t.lastRenderedState,f=u(c,l);if(n.hasEagerState=!0,n.eagerState=f,dt(f,c))return Vn(e,t,n,0),Oe===null&&Zn(),!1}catch{}finally{}if(l=_i(e,t,n,a),l!==null)return st(l,e,a),_o(l,t,a),!0}return!1}function fc(e,t,l,a){if(a={lane:2,revertLane:Xc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ru(e)){if(t)throw Error(o(479))}else t=_i(e,l,a,2),t!==null&&st(t,e,2)}function ru(e){var t=e.alternate;return e===ee||t!==null&&t===ee}function Ao(e,t){ha=nu=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function _o(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Ns(e,l)}}var ln={readContext:$e,use:cu,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useLayoutEffect:Ue,useInsertionEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useSyncExternalStore:Ue,useId:Ue,useHostTransitionStatus:Ue,useFormState:Ue,useActionState:Ue,useOptimistic:Ue,useMemoCache:Ue,useCacheRefresh:Ue};ln.useEffectEvent=Ue;var zo={readContext:$e,use:cu,useCallback:function(e,t){return tt().memoizedState=[e,t===void 0?null:t],e},useContext:$e,useEffect:fo,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,fu(4194308,4,mo.bind(null,t,e),l)},useLayoutEffect:function(e,t){return fu(4194308,4,e,t)},useInsertionEffect:function(e,t){fu(4,2,e,t)},useMemo:function(e,t){var l=tt();t=t===void 0?null:t;var a=e();if(wl){el(!0);try{e()}finally{el(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=tt();if(l!==void 0){var n=l(t);if(wl){el(!0);try{l(t)}finally{el(!1)}}}else n=t;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=hm.bind(null,ee,e),[a.memoizedState,e]},useRef:function(e){var t=tt();return e={current:e},t.memoizedState=e},useState:function(e){e=lc(e);var t=e.queue,l=Eo.bind(null,ee,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:uc,useDeferredValue:function(e,t){var l=tt();return ic(l,e,t)},useTransition:function(){var e=lc(!1);return e=bo.bind(null,ee,e.queue,!0,!1),tt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=ee,n=tt();if(re){if(l===void 0)throw Error(o(407));l=l()}else{if(l=t(),Oe===null)throw Error(o(349));(fe&127)!==0||Jf(a,t,l)}n.memoizedState=l;var u={value:l,getSnapshot:t};return n.queue=u,fo(Wf.bind(null,a,u,e),[e]),a.flags|=2048,ya(9,{destroy:void 0},kf.bind(null,a,u,l,t),null),l},useId:function(){var e=tt(),t=Oe.identifierPrefix;if(re){var l=Rt,a=Mt;l=(a&~(1<<32-rt(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=uu++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=im++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:sc,useFormState:no,useActionState:no,useOptimistic:function(e){var t=tt();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=fc.bind(null,ee,!0,l),l.dispatch=t,[e,t]},useMemoCache:Pi,useCacheRefresh:function(){return tt().memoizedState=dm.bind(null,ee)},useEffectEvent:function(e){var t=tt(),l={impl:e};return t.memoizedState=l,function(){if((ye&2)!==0)throw Error(o(440));return l.impl.apply(void 0,arguments)}}},oc={readContext:$e,use:cu,useCallback:vo,useContext:$e,useEffect:nc,useImperativeHandle:yo,useInsertionEffect:ro,useLayoutEffect:ho,useMemo:go,useReducer:su,useRef:so,useState:function(){return su(Zt)},useDebugValue:uc,useDeferredValue:function(e,t){var l=Ye();return po(l,Ee.memoizedState,e,t)},useTransition:function(){var e=su(Zt)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:en(e),t]},useSyncExternalStore:Kf,useId:jo,useHostTransitionStatus:sc,useFormState:uo,useActionState:uo,useOptimistic:function(e,t){var l=Ye();return If(l,Ee,e,t)},useMemoCache:Pi,useCacheRefresh:To};oc.useEffectEvent=oo;var Oo={readContext:$e,use:cu,useCallback:vo,useContext:$e,useEffect:nc,useImperativeHandle:yo,useInsertionEffect:ro,useLayoutEffect:ho,useMemo:go,useReducer:tc,useRef:so,useState:function(){return tc(Zt)},useDebugValue:uc,useDeferredValue:function(e,t){var l=Ye();return Ee===null?ic(l,e,t):po(l,Ee.memoizedState,e,t)},useTransition:function(){var e=tc(Zt)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:en(e),t]},useSyncExternalStore:Kf,useId:jo,useHostTransitionStatus:sc,useFormState:co,useActionState:co,useOptimistic:function(e,t){var l=Ye();return Ee!==null?If(l,Ee,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Pi,useCacheRefresh:To};Oo.useEffectEvent=oo;function rc(e,t,l,a){t=e.memoizedState,l=l(a,t),l=l==null?t:R({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var dc={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=pt(),n=sl(a);n.payload=t,l!=null&&(n.callback=l),t=fl(e,n,a),t!==null&&(st(t,e,a),$a(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=pt(),n=sl(a);n.tag=1,n.payload=t,l!=null&&(n.callback=l),t=fl(e,n,a),t!==null&&(st(t,e,a),$a(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=pt(),a=sl(l);a.tag=2,t!=null&&(a.callback=t),t=fl(e,a,l),t!==null&&(st(t,e,l),$a(t,e,l))}};function No(e,t,l,a,n,u,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,u,c):t.prototype&&t.prototype.isPureReactComponent?!Qa(l,a)||!Qa(n,u):!0}function Co(e,t,l,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,a),t.state!==e&&dc.enqueueReplaceState(t,t.state,null)}function Xl(e,t){var l=t;if("ref"in t){l={};for(var a in t)a!=="ref"&&(l[a]=t[a])}if(e=e.defaultProps){l===t&&(l=R({},l));for(var n in e)l[n]===void 0&&(l[n]=e[n])}return l}function Do(e){Ln(e)}function Mo(e){console.error(e)}function Ro(e){Ln(e)}function du(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Uo(e,t,l){try{var a=e.onCaughtError;a(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function hc(e,t,l){return l=sl(l),l.tag=3,l.payload={element:null},l.callback=function(){du(e,t)},l}function qo(e){return e=sl(e),e.tag=3,e}function Ho(e,t,l,a){var n=l.type.getDerivedStateFromError;if(typeof n=="function"){var u=a.value;e.payload=function(){return n(u)},e.callback=function(){Uo(t,l,a)}}var c=l.stateNode;c!==null&&typeof c.componentDidCatch=="function"&&(e.callback=function(){Uo(t,l,a),typeof n!="function"&&(yl===null?yl=new Set([this]):yl.add(this));var f=a.stack;this.componentDidCatch(a.value,{componentStack:f!==null?f:""})})}function mm(e,t,l,a,n){if(l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=l.alternate,t!==null&&ca(t,l,n,!0),l=mt.current,l!==null){switch(l.tag){case 31:case 13:return _t===null?Eu():l.alternate===null&&qe===0&&(qe=3),l.flags&=-257,l.flags|=65536,l.lanes=n,a===Pn?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),Yc(e,a,n)),!1;case 22:return l.flags|=65536,a===Pn?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([a]):l.add(a)),Yc(e,a,n)),!1}throw Error(o(435,l.tag))}return Yc(e,a,n),Eu(),!1}if(re)return t=mt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,a!==Mi&&(e=Error(o(422),{cause:a}),Va(jt(e,l)))):(a!==Mi&&(t=Error(o(423),{cause:a}),Va(jt(t,l))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,a=jt(a,l),n=hc(e.stateNode,a,n),Li(e,n),qe!==4&&(qe=2)),!1;var u=Error(o(520),{cause:a});if(u=jt(u,l),rn===null?rn=[u]:rn.push(u),qe!==4&&(qe=2),t===null)return!0;a=jt(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=n&-n,l.lanes|=e,e=hc(l.stateNode,a,e),Li(l,e),!1;case 1:if(t=l.type,u=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(yl===null||!yl.has(u))))return l.flags|=65536,n&=-n,l.lanes|=n,n=qo(n),Ho(n,e,l,a),Li(l,n),!1}l=l.return}while(l!==null);return!1}var mc=Error(o(461)),Qe=!1;function Fe(e,t,l,a){t.child=e===null?Gf(t,null,l,a):Gl(t,e.child,l,a)}function Bo(e,t,l,a,n){l=l.render;var u=t.ref;if("ref"in a){var c={};for(var f in a)f!=="ref"&&(c[f]=a[f])}else c=a;return ql(t),a=Wi(e,t,l,c,u,n),f=$i(),e!==null&&!Qe?(Fi(e,t,n),Vt(e,t,n)):(re&&f&&Ci(t),t.flags|=1,Fe(e,t,a,n),t.child)}function Yo(e,t,l,a,n){if(e===null){var u=l.type;return typeof u=="function"&&!zi(u)&&u.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=u,Go(e,t,u,a,n)):(e=Jn(l.type,null,a,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!jc(e,n)){var c=u.memoizedProps;if(l=l.compare,l=l!==null?l:Qa,l(c,a)&&e.ref===t.ref)return Vt(e,t,n)}return t.flags|=1,e=Gt(u,a),e.ref=t.ref,e.return=t,t.child=e}function Go(e,t,l,a,n){if(e!==null){var u=e.memoizedProps;if(Qa(u,a)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=a=u,jc(e,n))(e.flags&131072)!==0&&(Qe=!0);else return t.lanes=e.lanes,Vt(e,t,n)}return yc(e,t,l,a,n)}function wo(e,t,l,a){var n=a.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|l:l,e!==null){for(a=t.child=e.child,n=0;a!==null;)n=n|a.lanes|a.childLanes,a=a.sibling;a=n&~u}else a=0,t.child=null;return Xo(e,t,u,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fn(t,u!==null?u.cachePool:null),u!==null?Qf(t,u):Vi(),Lf(t);else return a=t.lanes=536870912,Xo(e,t,u!==null?u.baseLanes|l:l,l,a)}else u!==null?(Fn(t,u.cachePool),Qf(t,u),rl(),t.memoizedState=null):(e!==null&&Fn(t,null),Vi(),rl());return Fe(e,t,n,l),t.child}function an(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Xo(e,t,l,a,n){var u=Gi();return u=u===null?null:{parent:we._currentValue,pool:u},t.memoizedState={baseLanes:l,cachePool:u},e!==null&&Fn(t,null),Vi(),Lf(t),e!==null&&ca(e,t,a,!0),t.childLanes=n,null}function hu(e,t){return t=yu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Qo(e,t,l){return Gl(t,e.child,null,l),e=hu(t,t.pendingProps),e.flags|=2,yt(t),t.memoizedState=null,e}function ym(e,t,l){var a=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(re){if(a.mode==="hidden")return e=hu(t,a),t.lanes=536870912,an(null,e);if(Ji(t),(e=De)?(e=ed(e,At),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:al!==null?{id:Mt,overflow:Rt}:null,retryLane:536870912,hydrationErrors:null},l=Ef(e),l.return=t,t.child=l,We=t,De=null)):e=null,e===null)throw ul(t);return t.lanes=536870912,null}return hu(t,a)}var u=e.memoizedState;if(u!==null){var c=u.dehydrated;if(Ji(t),n)if(t.flags&256)t.flags&=-257,t=Qo(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Qe||ca(e,t,l,!1),n=(l&e.childLanes)!==0,Qe||n){if(a=Oe,a!==null&&(c=Cs(a,l),c!==0&&c!==u.retryLane))throw u.retryLane=c,Dl(e,c),st(a,e,c),mc;Eu(),t=Qo(e,t,l)}else e=u.treeContext,De=zt(c.nextSibling),We=t,re=!0,nl=null,At=!1,e!==null&&zf(t,e),t=hu(t,a),t.flags|=4096;return t}return e=Gt(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function mu(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(o(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function yc(e,t,l,a,n){return ql(t),l=Wi(e,t,l,a,void 0,n),a=$i(),e!==null&&!Qe?(Fi(e,t,n),Vt(e,t,n)):(re&&a&&Ci(t),t.flags|=1,Fe(e,t,l,n),t.child)}function Lo(e,t,l,a,n,u){return ql(t),t.updateQueue=null,l=Vf(t,a,l,n),Zf(e),a=$i(),e!==null&&!Qe?(Fi(e,t,u),Vt(e,t,u)):(re&&a&&Ci(t),t.flags|=1,Fe(e,t,l,u),t.child)}function Zo(e,t,l,a,n){if(ql(t),t.stateNode===null){var u=aa,c=l.contextType;typeof c=="object"&&c!==null&&(u=$e(c)),u=new l(a,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=dc,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=a,u.state=t.memoizedState,u.refs={},Xi(t),c=l.contextType,u.context=typeof c=="object"&&c!==null?$e(c):aa,u.state=t.memoizedState,c=l.getDerivedStateFromProps,typeof c=="function"&&(rc(t,l,c,a),u.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(c=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),c!==u.state&&dc.enqueueReplaceState(u,u.state,null),Ia(t,a,u,n),Fa(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){u=t.stateNode;var f=t.memoizedProps,r=Xl(l,f);u.props=r;var g=u.context,T=l.contextType;c=aa,typeof T=="object"&&T!==null&&(c=$e(T));var C=l.getDerivedStateFromProps;T=typeof C=="function"||typeof u.getSnapshotBeforeUpdate=="function",f=t.pendingProps!==f,T||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(f||g!==c)&&Co(t,u,a,c),cl=!1;var p=t.memoizedState;u.state=p,Ia(t,a,u,n),Fa(),g=t.memoizedState,f||p!==g||cl?(typeof C=="function"&&(rc(t,l,C,a),g=t.memoizedState),(r=cl||No(t,l,r,a,p,g,c))?(T||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=g),u.props=a,u.state=g,u.context=c,a=r):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{u=t.stateNode,Qi(e,t),c=t.memoizedProps,T=Xl(l,c),u.props=T,C=t.pendingProps,p=u.context,g=l.contextType,r=aa,typeof g=="object"&&g!==null&&(r=$e(g)),f=l.getDerivedStateFromProps,(g=typeof f=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(c!==C||p!==r)&&Co(t,u,a,r),cl=!1,p=t.memoizedState,u.state=p,Ia(t,a,u,n),Fa();var x=t.memoizedState;c!==C||p!==x||cl||e!==null&&e.dependencies!==null&&Wn(e.dependencies)?(typeof f=="function"&&(rc(t,l,f,a),x=t.memoizedState),(T=cl||No(t,l,T,a,p,x,r)||e!==null&&e.dependencies!==null&&Wn(e.dependencies))?(g||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(a,x,r),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(a,x,r)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=x),u.props=a,u.state=x,u.context=r,a=T):(typeof u.componentDidUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),a=!1)}return u=a,mu(e,t),a=(t.flags&128)!==0,u||a?(u=t.stateNode,l=a&&typeof l.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&a?(t.child=Gl(t,e.child,null,n),t.child=Gl(t,null,l,n)):Fe(e,t,l,n),t.memoizedState=u.state,e=t.child):e=Vt(e,t,n),e}function Vo(e,t,l,a){return Rl(),t.flags|=256,Fe(e,t,l,a),t.child}var vc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:Rf()}}function pc(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=gt),e}function Ko(e,t,l){var a=t.pendingProps,n=!1,u=(t.flags&128)!==0,c;if((c=u)||(c=e!==null&&e.memoizedState===null?!1:(Be.current&2)!==0),c&&(n=!0,t.flags&=-129),c=(t.flags&32)!==0,t.flags&=-33,e===null){if(re){if(n?ol(t):rl(),(e=De)?(e=ed(e,At),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:al!==null?{id:Mt,overflow:Rt}:null,retryLane:536870912,hydrationErrors:null},l=Ef(e),l.return=t,t.child=l,We=t,De=null)):e=null,e===null)throw ul(t);return es(e)?t.lanes=32:t.lanes=536870912,null}var f=a.children;return a=a.fallback,n?(rl(),n=t.mode,f=yu({mode:"hidden",children:f},n),a=Ml(a,n,l,null),f.return=t,a.return=t,f.sibling=a,t.child=f,a=t.child,a.memoizedState=gc(l),a.childLanes=pc(e,c,l),t.memoizedState=vc,an(null,a)):(ol(t),bc(t,f))}var r=e.memoizedState;if(r!==null&&(f=r.dehydrated,f!==null)){if(u)t.flags&256?(ol(t),t.flags&=-257,t=xc(e,t,l)):t.memoizedState!==null?(rl(),t.child=e.child,t.flags|=128,t=null):(rl(),f=a.fallback,n=t.mode,a=yu({mode:"visible",children:a.children},n),f=Ml(f,n,l,null),f.flags|=2,a.return=t,f.return=t,a.sibling=f,t.child=a,Gl(t,e.child,null,l),a=t.child,a.memoizedState=gc(l),a.childLanes=pc(e,c,l),t.memoizedState=vc,t=an(null,a));else if(ol(t),es(f)){if(c=f.nextSibling&&f.nextSibling.dataset,c)var g=c.dgst;c=g,a=Error(o(419)),a.stack="",a.digest=c,Va({value:a,source:null,stack:null}),t=xc(e,t,l)}else if(Qe||ca(e,t,l,!1),c=(l&e.childLanes)!==0,Qe||c){if(c=Oe,c!==null&&(a=Cs(c,l),a!==0&&a!==r.retryLane))throw r.retryLane=a,Dl(e,a),st(c,e,a),mc;Pc(f)||Eu(),t=xc(e,t,l)}else Pc(f)?(t.flags|=192,t.child=e.child,t=null):(e=r.treeContext,De=zt(f.nextSibling),We=t,re=!0,nl=null,At=!1,e!==null&&zf(t,e),t=bc(t,a.children),t.flags|=4096);return t}return n?(rl(),f=a.fallback,n=t.mode,r=e.child,g=r.sibling,a=Gt(r,{mode:"hidden",children:a.children}),a.subtreeFlags=r.subtreeFlags&65011712,g!==null?f=Gt(g,f):(f=Ml(f,n,l,null),f.flags|=2),f.return=t,a.return=t,a.sibling=f,t.child=a,an(null,a),a=t.child,f=e.child.memoizedState,f===null?f=gc(l):(n=f.cachePool,n!==null?(r=we._currentValue,n=n.parent!==r?{parent:r,pool:r}:n):n=Rf(),f={baseLanes:f.baseLanes|l,cachePool:n}),a.memoizedState=f,a.childLanes=pc(e,c,l),t.memoizedState=vc,an(e.child,a)):(ol(t),l=e.child,e=l.sibling,l=Gt(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(c=t.deletions,c===null?(t.deletions=[e],t.flags|=16):c.push(e)),t.child=l,t.memoizedState=null,l)}function bc(e,t){return t=yu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function yu(e,t){return e=ht(22,e,null,t),e.lanes=0,e}function xc(e,t,l){return Gl(t,e.child,null,l),e=bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Jo(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),qi(e.return,t,l)}function Sc(e,t,l,a,n,u){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:n,treeForkCount:u}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=a,c.tail=l,c.tailMode=n,c.treeForkCount=u)}function ko(e,t,l){var a=t.pendingProps,n=a.revealOrder,u=a.tail;a=a.children;var c=Be.current,f=(c&2)!==0;if(f?(c=c&1|2,t.flags|=128):c&=1,B(Be,c),Fe(e,t,a,l),a=re?Za:0,!f&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Jo(e,l,t);else if(e.tag===19)Jo(e,l,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(n){case"forwards":for(l=t.child,n=null;l!==null;)e=l.alternate,e!==null&&au(e)===null&&(n=l),l=l.sibling;l=n,l===null?(n=t.child,t.child=null):(n=l.sibling,l.sibling=null),Sc(t,!1,n,l,u,a);break;case"backwards":case"unstable_legacy-backwards":for(l=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&au(e)===null){t.child=n;break}e=n.sibling,n.sibling=l,l=n,n=e}Sc(t,!0,l,null,u,a);break;case"together":Sc(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Vt(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),ml|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(ca(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,l=Gt(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=Gt(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function jc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Wn(e)))}function vm(e,t,l){switch(t.tag){case 3:et(t,t.stateNode.containerInfo),il(t,we,e.memoizedState.cache),Rl();break;case 27:case 5:Na(t);break;case 4:et(t,t.stateNode.containerInfo);break;case 10:il(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ji(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(ol(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Ko(e,t,l):(ol(t),e=Vt(e,t,l),e!==null?e.sibling:null);ol(t);break;case 19:var n=(e.flags&128)!==0;if(a=(l&t.childLanes)!==0,a||(ca(e,t,l,!1),a=(l&t.childLanes)!==0),n){if(a)return ko(e,t,l);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),B(Be,Be.current),a)break;return null;case 22:return t.lanes=0,wo(e,t,l,t.pendingProps);case 24:il(t,we,e.memoizedState.cache)}return Vt(e,t,l)}function Wo(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qe=!0;else{if(!jc(e,l)&&(t.flags&128)===0)return Qe=!1,vm(e,t,l);Qe=(e.flags&131072)!==0}else Qe=!1,re&&(t.flags&1048576)!==0&&_f(t,Za,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Bl(t.elementType),t.type=e,typeof e=="function")zi(e)?(a=Xl(e,a),t.tag=1,t=Zo(null,t,e,a,l)):(t.tag=0,t=yc(null,t,e,a,l));else{if(e!=null){var n=e.$$typeof;if(n===ne){t.tag=11,t=Bo(null,t,e,a,l);break e}else if(n===V){t.tag=14,t=Yo(null,t,e,a,l);break e}}throw t=Ce(e)||e,Error(o(306,t,""))}}return t;case 0:return yc(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,n=Xl(a,t.pendingProps),Zo(e,t,a,n,l);case 3:e:{if(et(t,t.stateNode.containerInfo),e===null)throw Error(o(387));a=t.pendingProps;var u=t.memoizedState;n=u.element,Qi(e,t),Ia(t,a,null,l);var c=t.memoizedState;if(a=c.cache,il(t,we,a),a!==u.cache&&Hi(t,[we],l,!0),Fa(),a=c.element,u.isDehydrated)if(u={element:a,isDehydrated:!1,cache:c.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=Vo(e,t,a,l);break e}else if(a!==n){n=jt(Error(o(424)),t),Va(n),t=Vo(e,t,a,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(De=zt(e.firstChild),We=t,re=!0,nl=null,At=!0,l=Gf(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Rl(),a===n){t=Vt(e,t,l);break e}Fe(e,t,a,l)}t=t.child}return t;case 26:return mu(e,t),e===null?(l=id(t.type,null,t.pendingProps,null))?t.memoizedState=l:re||(l=t.type,e=t.pendingProps,a=Du(ue.current).createElement(l),a[ke]=t,a[lt]=e,Ie(a,l,e),Ke(a),t.stateNode=a):t.memoizedState=id(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Na(t),e===null&&re&&(a=t.stateNode=ad(t.type,t.pendingProps,ue.current),We=t,At=!0,n=De,bl(t.type)?(ts=n,De=zt(a.firstChild)):De=n),Fe(e,t,t.pendingProps.children,l),mu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&re&&((n=a=De)&&(a=Km(a,t.type,t.pendingProps,At),a!==null?(t.stateNode=a,We=t,De=zt(a.firstChild),At=!1,n=!0):n=!1),n||ul(t)),Na(t),n=t.type,u=t.pendingProps,c=e!==null?e.memoizedProps:null,a=u.children,$c(n,u)?a=null:c!==null&&$c(n,c)&&(t.flags|=32),t.memoizedState!==null&&(n=Wi(e,t,cm,null,null,l),bn._currentValue=n),mu(e,t),Fe(e,t,a,l),t.child;case 6:return e===null&&re&&((e=l=De)&&(l=Jm(l,t.pendingProps,At),l!==null?(t.stateNode=l,We=t,De=null,e=!0):e=!1),e||ul(t)),null;case 13:return Ko(e,t,l);case 4:return et(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Gl(t,null,a,l):Fe(e,t,a,l),t.child;case 11:return Bo(e,t,t.type,t.pendingProps,l);case 7:return Fe(e,t,t.pendingProps,l),t.child;case 8:return Fe(e,t,t.pendingProps.children,l),t.child;case 12:return Fe(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,il(t,t.type,a.value),Fe(e,t,a.children,l),t.child;case 9:return n=t.type._context,a=t.pendingProps.children,ql(t),n=$e(n),a=a(n),t.flags|=1,Fe(e,t,a,l),t.child;case 14:return Yo(e,t,t.type,t.pendingProps,l);case 15:return Go(e,t,t.type,t.pendingProps,l);case 19:return ko(e,t,l);case 31:return ym(e,t,l);case 22:return wo(e,t,l,t.pendingProps);case 24:return ql(t),a=$e(we),e===null?(n=Gi(),n===null&&(n=Oe,u=Bi(),n.pooledCache=u,u.refCount++,u!==null&&(n.pooledCacheLanes|=l),n=u),t.memoizedState={parent:a,cache:n},Xi(t),il(t,we,n)):((e.lanes&l)!==0&&(Qi(e,t),Ia(t,null,null,l),Fa()),n=e.memoizedState,u=t.memoizedState,n.parent!==a?(n={parent:a,cache:a},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),il(t,we,a)):(a=u.cache,il(t,we,a),a!==n.cache&&Hi(t,[we],l,!0))),Fe(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Kt(e){e.flags|=4}function Tc(e,t,l,a,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(jr())e.flags|=8192;else throw Yl=Pn,wi}else e.flags&=-16777217}function $o(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!rd(t))if(jr())e.flags|=8192;else throw Yl=Pn,wi}function vu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?zs():536870912,e.lanes|=t,ba|=t)}function nn(e,t){if(!re)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Me(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,a=0;if(t)for(var n=e.child;n!==null;)l|=n.lanes|n.childLanes,a|=n.subtreeFlags&65011712,a|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)l|=n.lanes|n.childLanes,a|=n.subtreeFlags,a|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=a,e.childLanes=l,t}function gm(e,t,l){var a=t.pendingProps;switch(Di(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Me(t),null;case 1:return Me(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Qt(we),He(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(ia(t)?Kt(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ri())),Me(t),null;case 26:var n=t.type,u=t.memoizedState;return e===null?(Kt(t),u!==null?(Me(t),$o(t,u)):(Me(t),Tc(t,n,null,a,l))):u?u!==e.memoizedState?(Kt(t),Me(t),$o(t,u)):(Me(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&Kt(t),Me(t),Tc(t,n,e,a,l)),null;case 27:if(zn(t),l=ue.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Kt(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Me(t),null}e=X.current,ia(t)?Of(t):(e=ad(n,a,l),t.stateNode=e,Kt(t))}return Me(t),null;case 5:if(zn(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Kt(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Me(t),null}if(u=X.current,ia(t))Of(t);else{var c=Du(ue.current);switch(u){case 1:u=c.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:u=c.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":u=c.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":u=c.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":u=c.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?c.createElement(n,{is:a.is}):c.createElement(n)}}u[ke]=t,u[lt]=a;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)u.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=u;e:switch(Ie(u,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Kt(t)}}return Me(t),Tc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Kt(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(e=ue.current,ia(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,n=We,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[ke]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||Kr(e.nodeValue,l)),e||ul(t,!0)}else e=Du(e).createTextNode(a),e[ke]=t,t.stateNode=e}return Me(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=ia(t),l!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[ke]=t}else Rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Me(t),e=!1}else l=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(yt(t),t):(yt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Me(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=ia(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(o(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));n[ke]=t}else Rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Me(t),n=!1}else n=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(yt(t),t):(yt(t),null)}return yt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==n&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),vu(t,t.updateQueue),Me(t),null);case 4:return He(),e===null&&Vc(t.stateNode.containerInfo),Me(t),null;case 10:return Qt(t.type),Me(t),null;case 19:if(D(Be),a=t.memoizedState,a===null)return Me(t),null;if(n=(t.flags&128)!==0,u=a.rendering,u===null)if(n)nn(a,!1);else{if(qe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=au(e),u!==null){for(t.flags|=128,nn(a,!1),e=u.updateQueue,t.updateQueue=e,vu(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Tf(l,e),l=l.sibling;return B(Be,Be.current&1|2),re&&wt(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&ft()>Su&&(t.flags|=128,n=!0,nn(a,!1),t.lanes=4194304)}else{if(!n)if(e=au(u),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,vu(t,e),nn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!re)return Me(t),null}else 2*ft()-a.renderingStartTime>Su&&l!==536870912&&(t.flags|=128,n=!0,nn(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(e=a.last,e!==null?e.sibling=u:t.child=u,a.last=u)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ft(),e.sibling=null,l=Be.current,B(Be,n?l&1|2:l&1),re&&wt(t,a.treeForkCount),e):(Me(t),null);case 22:case 23:return yt(t),Ki(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(Me(t),t.subtreeFlags&6&&(t.flags|=8192)):Me(t),l=t.updateQueue,l!==null&&vu(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&D(Hl),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Qt(we),Me(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function pm(e,t){switch(Di(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qt(we),He(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return zn(t),null;case 31:if(t.memoizedState!==null){if(yt(t),t.alternate===null)throw Error(o(340));Rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(yt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return D(Be),null;case 4:return He(),null;case 10:return Qt(t.type),null;case 22:case 23:return yt(t),Ki(),e!==null&&D(Hl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qt(we),null;case 25:return null;default:return null}}function Fo(e,t){switch(Di(t),t.tag){case 3:Qt(we),He();break;case 26:case 27:case 5:zn(t);break;case 4:He();break;case 31:t.memoizedState!==null&&yt(t);break;case 13:yt(t);break;case 19:D(Be);break;case 10:Qt(t.type);break;case 22:case 23:yt(t),Ki(),e!==null&&D(Hl);break;case 24:Qt(we)}}function un(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&e)===e){a=void 0;var u=l.create,c=l.inst;a=u(),c.destroy=a}l=l.next}while(l!==n)}}catch(f){pe(t,t.return,f)}}function dl(e,t,l){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&e)===e){var c=a.inst,f=c.destroy;if(f!==void 0){c.destroy=void 0,n=t;var r=l,g=f;try{g()}catch(T){pe(n,r,T)}}}a=a.next}while(a!==u)}}catch(T){pe(t,t.return,T)}}function Io(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Xf(t,l)}catch(a){pe(e,e.return,a)}}}function Po(e,t,l){l.props=Xl(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){pe(e,t,a)}}function cn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(n){pe(e,t,n)}}function Ut(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){pe(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){pe(e,t,n)}else l.current=null}function er(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){pe(e,e.return,n)}}function Ec(e,t,l){try{var a=e.stateNode;wm(a,e.type,l,t),a[lt]=t}catch(n){pe(e,e.return,n)}}function tr(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&bl(e.type)||e.tag===4}function Ac(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tr(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&&bl(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 _c(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Bt));else if(a!==4&&(a===27&&bl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(_c(e,t,l),e=e.sibling;e!==null;)_c(e,t,l),e=e.sibling}function gu(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&bl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(gu(e,t,l),e=e.sibling;e!==null;)gu(e,t,l),e=e.sibling}function lr(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Ie(t,a,l),t[ke]=e,t[lt]=l}catch(u){pe(e,e.return,u)}}var Jt=!1,Le=!1,zc=!1,ar=typeof WeakSet=="function"?WeakSet:Set,Je=null;function bm(e,t){if(e=e.containerInfo,kc=Yu,e=mf(e),xi(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{l.nodeType,u.nodeType}catch{l=null;break e}var c=0,f=-1,r=-1,g=0,T=0,C=e,p=null;t:for(;;){for(var x;C!==l||n!==0&&C.nodeType!==3||(f=c+n),C!==u||a!==0&&C.nodeType!==3||(r=c+a),C.nodeType===3&&(c+=C.nodeValue.length),(x=C.firstChild)!==null;)p=C,C=x;for(;;){if(C===e)break t;if(p===l&&++g===n&&(f=c),p===u&&++T===a&&(r=c),(x=C.nextSibling)!==null)break;C=p,p=C.parentNode}C=x}l=f===-1||r===-1?null:{start:f,end:r}}else l=null}l=l||{start:0,end:0}}else l=null;for(Wc={focusedElem:e,selectionRange:l},Yu=!1,Je=t;Je!==null;)if(t=Je,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Je=e;else for(;Je!==null;){switch(t=Je,u=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(l=0;l<e.length;l++)n=e[l],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,l=t,n=u.memoizedProps,u=u.memoizedState,a=l.stateNode;try{var G=Xl(l.type,n);e=a.getSnapshotBeforeUpdate(G,u),a.__reactInternalSnapshotBeforeUpdate=e}catch(J){pe(l,l.return,J)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)Ic(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ic(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(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Je=e;break}Je=t.return}}function nr(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:Wt(e,l),a&4&&un(5,l);break;case 1:if(Wt(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(c){pe(l,l.return,c)}else{var n=Xl(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(c){pe(l,l.return,c)}}a&64&&Io(l),a&512&&cn(l,l.return);break;case 3:if(Wt(e,l),a&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{Xf(e,t)}catch(c){pe(l,l.return,c)}}break;case 27:t===null&&a&4&&lr(l);case 26:case 5:Wt(e,l),t===null&&a&4&&er(l),a&512&&cn(l,l.return);break;case 12:Wt(e,l);break;case 31:Wt(e,l),a&4&&cr(e,l);break;case 13:Wt(e,l),a&4&&sr(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Om.bind(null,l),km(e,l))));break;case 22:if(a=l.memoizedState!==null||Jt,!a){t=t!==null&&t.memoizedState!==null||Le,n=Jt;var u=Le;Jt=a,(Le=t)&&!u?$t(e,l,(l.subtreeFlags&8772)!==0):Wt(e,l),Jt=n,Le=u}break;case 30:break;default:Wt(e,l)}}function ur(e){var t=e.alternate;t!==null&&(e.alternate=null,ur(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ai(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 Re=null,nt=!1;function kt(e,t,l){for(l=l.child;l!==null;)ir(e,t,l),l=l.sibling}function ir(e,t,l){if(ot&&typeof ot.onCommitFiberUnmount=="function")try{ot.onCommitFiberUnmount(Ca,l)}catch{}switch(l.tag){case 26:Le||Ut(l,t),kt(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Le||Ut(l,t);var a=Re,n=nt;bl(l.type)&&(Re=l.stateNode,nt=!1),kt(e,t,l),vn(l.stateNode),Re=a,nt=n;break;case 5:Le||Ut(l,t);case 6:if(a=Re,n=nt,Re=null,kt(e,t,l),Re=a,nt=n,Re!==null)if(nt)try{(Re.nodeType===9?Re.body:Re.nodeName==="HTML"?Re.ownerDocument.body:Re).removeChild(l.stateNode)}catch(u){pe(l,t,u)}else try{Re.removeChild(l.stateNode)}catch(u){pe(l,t,u)}break;case 18:Re!==null&&(nt?(e=Re,Ir(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),za(e)):Ir(Re,l.stateNode));break;case 4:a=Re,n=nt,Re=l.stateNode.containerInfo,nt=!0,kt(e,t,l),Re=a,nt=n;break;case 0:case 11:case 14:case 15:dl(2,l,t),Le||dl(4,l,t),kt(e,t,l);break;case 1:Le||(Ut(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&Po(l,t,a)),kt(e,t,l);break;case 21:kt(e,t,l);break;case 22:Le=(a=Le)||l.memoizedState!==null,kt(e,t,l),Le=a;break;default:kt(e,t,l)}}function cr(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{za(e)}catch(l){pe(t,t.return,l)}}}function sr(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{za(e)}catch(l){pe(t,t.return,l)}}function xm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ar),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ar),t;default:throw Error(o(435,e.tag))}}function pu(e,t){var l=xm(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var n=Nm.bind(null,e,a);a.then(n,n)}})}function ut(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var n=l[a],u=e,c=t,f=c;e:for(;f!==null;){switch(f.tag){case 27:if(bl(f.type)){Re=f.stateNode,nt=!1;break e}break;case 5:Re=f.stateNode,nt=!1;break e;case 3:case 4:Re=f.stateNode.containerInfo,nt=!0;break e}f=f.return}if(Re===null)throw Error(o(160));ir(u,c,n),Re=null,nt=!1,u=n.alternate,u!==null&&(u.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fr(t,e),t=t.sibling}var Ct=null;function fr(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ut(t,e),it(e),a&4&&(dl(3,e,e.return),un(3,e),dl(5,e,e.return));break;case 1:ut(t,e),it(e),a&512&&(Le||l===null||Ut(l,l.return)),a&64&&Jt&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?a:l.concat(a))));break;case 26:var n=Ct;if(ut(t,e),it(e),a&512&&(Le||l===null||Ut(l,l.return)),a&4){var u=l!==null?l.memoizedState:null;if(a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null){e:{a=e.type,l=e.memoizedProps,n=n.ownerDocument||n;t:switch(a){case"title":u=n.getElementsByTagName("title")[0],(!u||u[Ra]||u[ke]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=n.createElement(a),n.head.insertBefore(u,n.querySelector("head > title"))),Ie(u,a,l),u[ke]=e,Ke(u),a=u;break e;case"link":var c=fd("link","href",n).get(a+(l.href||""));if(c){for(var f=0;f<c.length;f++)if(u=c[f],u.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&u.getAttribute("rel")===(l.rel==null?null:l.rel)&&u.getAttribute("title")===(l.title==null?null:l.title)&&u.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){c.splice(f,1);break t}}u=n.createElement(a),Ie(u,a,l),n.head.appendChild(u);break;case"meta":if(c=fd("meta","content",n).get(a+(l.content||""))){for(f=0;f<c.length;f++)if(u=c[f],u.getAttribute("content")===(l.content==null?null:""+l.content)&&u.getAttribute("name")===(l.name==null?null:l.name)&&u.getAttribute("property")===(l.property==null?null:l.property)&&u.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&u.getAttribute("charset")===(l.charSet==null?null:l.charSet)){c.splice(f,1);break t}}u=n.createElement(a),Ie(u,a,l),n.head.appendChild(u);break;default:throw Error(o(468,a))}u[ke]=e,Ke(u),a=u}e.stateNode=a}else od(n,e.type,e.stateNode);else e.stateNode=sd(n,a,e.memoizedProps);else u!==a?(u===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):u.count--,a===null?od(n,e.type,e.stateNode):sd(n,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Ec(e,e.memoizedProps,l.memoizedProps)}break;case 27:ut(t,e),it(e),a&512&&(Le||l===null||Ut(l,l.return)),l!==null&&a&4&&Ec(e,e.memoizedProps,l.memoizedProps);break;case 5:if(ut(t,e),it(e),a&512&&(Le||l===null||Ut(l,l.return)),e.flags&32){n=e.stateNode;try{$l(n,"")}catch(G){pe(e,e.return,G)}}a&4&&e.stateNode!=null&&(n=e.memoizedProps,Ec(e,n,l!==null?l.memoizedProps:n)),a&1024&&(zc=!0);break;case 6:if(ut(t,e),it(e),a&4){if(e.stateNode===null)throw Error(o(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(G){pe(e,e.return,G)}}break;case 3:if(Uu=null,n=Ct,Ct=Mu(t.containerInfo),ut(t,e),Ct=n,it(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{za(t.containerInfo)}catch(G){pe(e,e.return,G)}zc&&(zc=!1,or(e));break;case 4:a=Ct,Ct=Mu(e.stateNode.containerInfo),ut(t,e),it(e),Ct=a;break;case 12:ut(t,e),it(e);break;case 31:ut(t,e),it(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pu(e,a)));break;case 13:ut(t,e),it(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(xu=ft()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pu(e,a)));break;case 22:n=e.memoizedState!==null;var r=l!==null&&l.memoizedState!==null,g=Jt,T=Le;if(Jt=g||n,Le=T||r,ut(t,e),Le=T,Jt=g,it(e),a&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(l===null||r||Jt||Le||Ql(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){r=l=t;try{if(u=r.stateNode,n)c=u.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none";else{f=r.stateNode;var C=r.memoizedProps.style,p=C!=null&&C.hasOwnProperty("display")?C.display:null;f.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(G){pe(r,r.return,G)}}}else if(t.tag===6){if(l===null){r=t;try{r.stateNode.nodeValue=n?"":r.memoizedProps}catch(G){pe(r,r.return,G)}}}else if(t.tag===18){if(l===null){r=t;try{var x=r.stateNode;n?Pr(x,!0):Pr(r.stateNode,!1)}catch(G){pe(r,r.return,G)}}}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;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(l=a.retryQueue,l!==null&&(a.retryQueue=null,pu(e,l))));break;case 19:ut(t,e),it(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pu(e,a)));break;case 30:break;case 21:break;default:ut(t,e),it(e)}}function it(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(tr(a)){l=a;break}a=a.return}if(l==null)throw Error(o(160));switch(l.tag){case 27:var n=l.stateNode,u=Ac(e);gu(e,u,n);break;case 5:var c=l.stateNode;l.flags&32&&($l(c,""),l.flags&=-33);var f=Ac(e);gu(e,f,c);break;case 3:case 4:var r=l.stateNode.containerInfo,g=Ac(e);_c(e,g,r);break;default:throw Error(o(161))}}catch(T){pe(e,e.return,T)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function or(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;or(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Wt(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)nr(e,t.alternate,t),t=t.sibling}function Ql(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:dl(4,t,t.return),Ql(t);break;case 1:Ut(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Po(t,t.return,l),Ql(t);break;case 27:vn(t.stateNode);case 26:case 5:Ut(t,t.return),Ql(t);break;case 22:t.memoizedState===null&&Ql(t);break;case 30:Ql(t);break;default:Ql(t)}e=e.sibling}}function $t(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,n=e,u=t,c=u.flags;switch(u.tag){case 0:case 11:case 15:$t(n,u,l),un(4,u);break;case 1:if($t(n,u,l),a=u,n=a.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(g){pe(a,a.return,g)}if(a=u,n=a.updateQueue,n!==null){var f=a.stateNode;try{var r=n.shared.hiddenCallbacks;if(r!==null)for(n.shared.hiddenCallbacks=null,n=0;n<r.length;n++)wf(r[n],f)}catch(g){pe(a,a.return,g)}}l&&c&64&&Io(u),cn(u,u.return);break;case 27:lr(u);case 26:case 5:$t(n,u,l),l&&a===null&&c&4&&er(u),cn(u,u.return);break;case 12:$t(n,u,l);break;case 31:$t(n,u,l),l&&c&4&&cr(n,u);break;case 13:$t(n,u,l),l&&c&4&&sr(n,u);break;case 22:u.memoizedState===null&&$t(n,u,l),cn(u,u.return);break;case 30:break;default:$t(n,u,l)}t=t.sibling}}function Oc(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Ka(l))}function Nc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ka(e))}function Dt(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)rr(e,t,l,a),t=t.sibling}function rr(e,t,l,a){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Dt(e,t,l,a),n&2048&&un(9,t);break;case 1:Dt(e,t,l,a);break;case 3:Dt(e,t,l,a),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ka(e)));break;case 12:if(n&2048){Dt(e,t,l,a),e=t.stateNode;try{var u=t.memoizedProps,c=u.id,f=u.onPostCommit;typeof f=="function"&&f(c,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(r){pe(t,t.return,r)}}else Dt(e,t,l,a);break;case 31:Dt(e,t,l,a);break;case 13:Dt(e,t,l,a);break;case 23:break;case 22:u=t.stateNode,c=t.alternate,t.memoizedState!==null?u._visibility&2?Dt(e,t,l,a):sn(e,t):u._visibility&2?Dt(e,t,l,a):(u._visibility|=2,va(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),n&2048&&Oc(c,t);break;case 24:Dt(e,t,l,a),n&2048&&Nc(t.alternate,t);break;default:Dt(e,t,l,a)}}function va(e,t,l,a,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,c=t,f=l,r=a,g=c.flags;switch(c.tag){case 0:case 11:case 15:va(u,c,f,r,n),un(8,c);break;case 23:break;case 22:var T=c.stateNode;c.memoizedState!==null?T._visibility&2?va(u,c,f,r,n):sn(u,c):(T._visibility|=2,va(u,c,f,r,n)),n&&g&2048&&Oc(c.alternate,c);break;case 24:va(u,c,f,r,n),n&&g&2048&&Nc(c.alternate,c);break;default:va(u,c,f,r,n)}t=t.sibling}}function sn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,a=t,n=a.flags;switch(a.tag){case 22:sn(l,a),n&2048&&Oc(a.alternate,a);break;case 24:sn(l,a),n&2048&&Nc(a.alternate,a);break;default:sn(l,a)}t=t.sibling}}var fn=8192;function ga(e,t,l){if(e.subtreeFlags&fn)for(e=e.child;e!==null;)dr(e,t,l),e=e.sibling}function dr(e,t,l){switch(e.tag){case 26:ga(e,t,l),e.flags&fn&&e.memoizedState!==null&&iy(l,Ct,e.memoizedState,e.memoizedProps);break;case 5:ga(e,t,l);break;case 3:case 4:var a=Ct;Ct=Mu(e.stateNode.containerInfo),ga(e,t,l),Ct=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=fn,fn=16777216,ga(e,t,l),fn=a):ga(e,t,l));break;default:ga(e,t,l)}}function hr(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 on(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];Je=a,yr(a,e)}hr(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)mr(e),e=e.sibling}function mr(e){switch(e.tag){case 0:case 11:case 15:on(e),e.flags&2048&&dl(9,e,e.return);break;case 3:on(e);break;case 12:on(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,bu(e)):on(e);break;default:on(e)}}function bu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];Je=a,yr(a,e)}hr(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:dl(8,t,t.return),bu(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,bu(t));break;default:bu(t)}e=e.sibling}}function yr(e,t){for(;Je!==null;){var l=Je;switch(l.tag){case 0:case 11:case 15:dl(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var a=l.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Ka(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,Je=a;else e:for(l=e;Je!==null;){a=Je;var n=a.sibling,u=a.return;if(ur(a),a===l){Je=null;break e}if(n!==null){n.return=u,Je=n;break e}Je=u}}}var Sm={getCacheForType:function(e){var t=$e(we),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return $e(we).controller.signal}},jm=typeof WeakMap=="function"?WeakMap:Map,ye=0,Oe=null,ie=null,fe=0,ge=0,vt=null,hl=!1,pa=!1,Cc=!1,Ft=0,qe=0,ml=0,Ll=0,Dc=0,gt=0,ba=0,rn=null,ct=null,Mc=!1,xu=0,vr=0,Su=1/0,ju=null,yl=null,Ve=0,vl=null,xa=null,It=0,Rc=0,Uc=null,gr=null,dn=0,qc=null;function pt(){return(ye&2)!==0&&fe!==0?fe&-fe:j.T!==null?Xc():Ds()}function pr(){if(gt===0)if((fe&536870912)===0||re){var e=Cn;Cn<<=1,(Cn&3932160)===0&&(Cn=262144),gt=e}else gt=536870912;return e=mt.current,e!==null&&(e.flags|=32),gt}function st(e,t,l){(e===Oe&&(ge===2||ge===9)||e.cancelPendingCommit!==null)&&(Sa(e,0),gl(e,fe,gt,!1)),Ma(e,l),((ye&2)===0||e!==Oe)&&(e===Oe&&((ye&2)===0&&(Ll|=l),qe===4&&gl(e,fe,gt,!1)),qt(e))}function br(e,t,l){if((ye&6)!==0)throw Error(o(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||Da(e,t),n=a?Am(e,t):Bc(e,t,!0),u=a;do{if(n===0){pa&&!a&&gl(e,t,0,!1);break}else{if(l=e.current.alternate,u&&!Tm(l)){n=Bc(e,t,!1),u=!1;continue}if(n===2){if(u=t,e.errorRecoveryDisabledLanes&u)var c=0;else c=e.pendingLanes&-536870913,c=c!==0?c:c&536870912?536870912:0;if(c!==0){t=c;e:{var f=e;n=rn;var r=f.current.memoizedState.isDehydrated;if(r&&(Sa(f,c).flags|=256),c=Bc(f,c,!1),c!==2){if(Cc&&!r){f.errorRecoveryDisabledLanes|=u,Ll|=u,n=4;break e}u=ct,ct=n,u!==null&&(ct===null?ct=u:ct.push.apply(ct,u))}n=c}if(u=!1,n!==2)continue}}if(n===1){Sa(e,0),gl(e,t,0,!0);break}e:{switch(a=e,u=n,u){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:gl(a,t,gt,!hl);break e;case 2:ct=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(n=xu+300-ft(),10<n)){if(gl(a,t,gt,!hl),Mn(a,0,!0)!==0)break e;It=t,a.timeoutHandle=$r(xr.bind(null,a,l,ct,ju,Mc,t,gt,Ll,ba,hl,u,"Throttled",-0,0),n);break e}xr(a,l,ct,ju,Mc,t,gt,Ll,ba,hl,u,null,-0,0)}}break}while(!0);qt(e)}function xr(e,t,l,a,n,u,c,f,r,g,T,C,p,x){if(e.timeoutHandle=-1,C=t.subtreeFlags,C&8192||(C&16785408)===16785408){C={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Bt},dr(t,u,C);var G=(u&62914560)===u?xu-ft():(u&4194048)===u?vr-ft():0;if(G=cy(C,G),G!==null){It=u,e.cancelPendingCommit=G(Or.bind(null,e,t,u,l,a,n,c,f,r,T,C,null,p,x)),gl(e,u,c,!g);return}}Or(e,t,u,l,a,n,c,f,r)}function Tm(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var a=0;a<l.length;a++){var n=l[a],u=n.getSnapshot;n=n.value;try{if(!dt(u(),n))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;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 gl(e,t,l,a){t&=~Dc,t&=~Ll,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var n=t;0<n;){var u=31-rt(n),c=1<<u;a[u]=-1,n&=~c}l!==0&&Os(e,l,t)}function Tu(){return(ye&6)===0?(hn(0),!1):!0}function Hc(){if(ie!==null){if(ge===0)var e=ie.return;else e=ie,Xt=Ul=null,Ii(e),ra=null,ka=0,e=ie;for(;e!==null;)Fo(e.alternate,e),e=e.return;ie=null}}function Sa(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Lm(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),It=0,Hc(),Oe=e,ie=l=Gt(e.current,null),fe=t,ge=0,vt=null,hl=!1,pa=Da(e,t),Cc=!1,ba=gt=Dc=Ll=ml=qe=0,ct=rn=null,Mc=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var n=31-rt(a),u=1<<n;t|=e[n],a&=~u}return Ft=t,Zn(),l}function Sr(e,t){ee=null,j.H=ln,t===oa||t===In?(t=Hf(),ge=3):t===wi?(t=Hf(),ge=4):ge=t===mc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,vt=t,ie===null&&(qe=1,du(e,jt(t,e.current)))}function jr(){var e=mt.current;return e===null?!0:(fe&4194048)===fe?_t===null:(fe&62914560)===fe||(fe&536870912)!==0?e===_t:!1}function Tr(){var e=j.H;return j.H=ln,e===null?ln:e}function Er(){var e=j.A;return j.A=Sm,e}function Eu(){qe=4,hl||(fe&4194048)!==fe&&mt.current!==null||(pa=!0),(ml&134217727)===0&&(Ll&134217727)===0||Oe===null||gl(Oe,fe,gt,!1)}function Bc(e,t,l){var a=ye;ye|=2;var n=Tr(),u=Er();(Oe!==e||fe!==t)&&(ju=null,Sa(e,t)),t=!1;var c=qe;e:do try{if(ge!==0&&ie!==null){var f=ie,r=vt;switch(ge){case 8:Hc(),c=6;break e;case 3:case 2:case 9:case 6:mt.current===null&&(t=!0);var g=ge;if(ge=0,vt=null,ja(e,f,r,g),l&&pa){c=0;break e}break;default:g=ge,ge=0,vt=null,ja(e,f,r,g)}}Em(),c=qe;break}catch(T){Sr(e,T)}while(!0);return t&&e.shellSuspendCounter++,Xt=Ul=null,ye=a,j.H=n,j.A=u,ie===null&&(Oe=null,fe=0,Zn()),c}function Em(){for(;ie!==null;)Ar(ie)}function Am(e,t){var l=ye;ye|=2;var a=Tr(),n=Er();Oe!==e||fe!==t?(ju=null,Su=ft()+500,Sa(e,t)):pa=Da(e,t);e:do try{if(ge!==0&&ie!==null){t=ie;var u=vt;t:switch(ge){case 1:ge=0,vt=null,ja(e,t,u,1);break;case 2:case 9:if(Uf(u)){ge=0,vt=null,_r(t);break}t=function(){ge!==2&&ge!==9||Oe!==e||(ge=7),qt(e)},u.then(t,t);break e;case 3:ge=7;break e;case 4:ge=5;break e;case 7:Uf(u)?(ge=0,vt=null,_r(t)):(ge=0,vt=null,ja(e,t,u,7));break;case 5:var c=null;switch(ie.tag){case 26:c=ie.memoizedState;case 5:case 27:var f=ie;if(c?rd(c):f.stateNode.complete){ge=0,vt=null;var r=f.sibling;if(r!==null)ie=r;else{var g=f.return;g!==null?(ie=g,Au(g)):ie=null}break t}}ge=0,vt=null,ja(e,t,u,5);break;case 6:ge=0,vt=null,ja(e,t,u,6);break;case 8:Hc(),qe=6;break e;default:throw Error(o(462))}}_m();break}catch(T){Sr(e,T)}while(!0);return Xt=Ul=null,j.H=a,j.A=n,ye=l,ie!==null?0:(Oe=null,fe=0,Zn(),qe)}function _m(){for(;ie!==null&&!Wd();)Ar(ie)}function Ar(e){var t=Wo(e.alternate,e,Ft);e.memoizedProps=e.pendingProps,t===null?Au(e):ie=t}function _r(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Lo(l,t,t.pendingProps,t.type,void 0,fe);break;case 11:t=Lo(l,t,t.pendingProps,t.type.render,t.ref,fe);break;case 5:Ii(t);default:Fo(l,t),t=ie=Tf(t,Ft),t=Wo(l,t,Ft)}e.memoizedProps=e.pendingProps,t===null?Au(e):ie=t}function ja(e,t,l,a){Xt=Ul=null,Ii(t),ra=null,ka=0;var n=t.return;try{if(mm(e,n,t,l,fe)){qe=1,du(e,jt(l,e.current)),ie=null;return}}catch(u){if(n!==null)throw ie=n,u;qe=1,du(e,jt(l,e.current)),ie=null;return}t.flags&32768?(re||a===1?e=!0:pa||(fe&536870912)!==0?e=!1:(hl=e=!0,(a===2||a===9||a===3||a===6)&&(a=mt.current,a!==null&&a.tag===13&&(a.flags|=16384))),zr(t,e)):Au(t)}function Au(e){var t=e;do{if((t.flags&32768)!==0){zr(t,hl);return}e=t.return;var l=gm(t.alternate,t,Ft);if(l!==null){ie=l;return}if(t=t.sibling,t!==null){ie=t;return}ie=t=e}while(t!==null);qe===0&&(qe=5)}function zr(e,t){do{var l=pm(e.alternate,e);if(l!==null){l.flags&=32767,ie=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){ie=e;return}ie=e=l}while(e!==null);qe=6,ie=null}function Or(e,t,l,a,n,u,c,f,r){e.cancelPendingCommit=null;do _u();while(Ve!==0);if((ye&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(u=t.lanes|t.childLanes,u|=Ai,uh(e,l,u,c,f,r),e===Oe&&(ie=Oe=null,fe=0),xa=t,vl=e,It=l,Rc=u,Uc=n,gr=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Cm(On,function(){return Rr(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=j.T,j.T=null,n=N.p,N.p=2,c=ye,ye|=4;try{bm(e,t,l)}finally{ye=c,N.p=n,j.T=a}}Ve=1,Nr(),Cr(),Dr()}}function Nr(){if(Ve===1){Ve=0;var e=vl,t=xa,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=j.T,j.T=null;var a=N.p;N.p=2;var n=ye;ye|=4;try{fr(t,e);var u=Wc,c=mf(e.containerInfo),f=u.focusedElem,r=u.selectionRange;if(c!==f&&f&&f.ownerDocument&&hf(f.ownerDocument.documentElement,f)){if(r!==null&&xi(f)){var g=r.start,T=r.end;if(T===void 0&&(T=g),"selectionStart"in f)f.selectionStart=g,f.selectionEnd=Math.min(T,f.value.length);else{var C=f.ownerDocument||document,p=C&&C.defaultView||window;if(p.getSelection){var x=p.getSelection(),G=f.textContent.length,J=Math.min(r.start,G),_e=r.end===void 0?J:Math.min(r.end,G);!x.extend&&J>_e&&(c=_e,_e=J,J=c);var y=df(f,J),h=df(f,_e);if(y&&h&&(x.rangeCount!==1||x.anchorNode!==y.node||x.anchorOffset!==y.offset||x.focusNode!==h.node||x.focusOffset!==h.offset)){var v=C.createRange();v.setStart(y.node,y.offset),x.removeAllRanges(),J>_e?(x.addRange(v),x.extend(h.node,h.offset)):(v.setEnd(h.node,h.offset),x.addRange(v))}}}}for(C=[],x=f;x=x.parentNode;)x.nodeType===1&&C.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<C.length;f++){var z=C[f];z.element.scrollLeft=z.left,z.element.scrollTop=z.top}}Yu=!!kc,Wc=kc=null}finally{ye=n,N.p=a,j.T=l}}e.current=t,Ve=2}}function Cr(){if(Ve===2){Ve=0;var e=vl,t=xa,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=j.T,j.T=null;var a=N.p;N.p=2;var n=ye;ye|=4;try{nr(e,t.alternate,t)}finally{ye=n,N.p=a,j.T=l}}Ve=3}}function Dr(){if(Ve===4||Ve===3){Ve=0,$d();var e=vl,t=xa,l=It,a=gr;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ve=5:(Ve=0,xa=vl=null,Mr(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(yl=null),ti(l),t=t.stateNode,ot&&typeof ot.onCommitFiberRoot=="function")try{ot.onCommitFiberRoot(Ca,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=j.T,n=N.p,N.p=2,j.T=null;try{for(var u=e.onRecoverableError,c=0;c<a.length;c++){var f=a[c];u(f.value,{componentStack:f.stack})}}finally{j.T=t,N.p=n}}(It&3)!==0&&_u(),qt(e),n=e.pendingLanes,(l&261930)!==0&&(n&42)!==0?e===qc?dn++:(dn=0,qc=e):dn=0,hn(0)}}function Mr(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ka(t)))}function _u(){return Nr(),Cr(),Dr(),Rr()}function Rr(){if(Ve!==5)return!1;var e=vl,t=Rc;Rc=0;var l=ti(It),a=j.T,n=N.p;try{N.p=32>l?32:l,j.T=null,l=Uc,Uc=null;var u=vl,c=It;if(Ve=0,xa=vl=null,It=0,(ye&6)!==0)throw Error(o(331));var f=ye;if(ye|=4,mr(u.current),rr(u,u.current,c,l),ye=f,hn(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(Ca,u)}catch{}return!0}finally{N.p=n,j.T=a,Mr(e,t)}}function Ur(e,t,l){t=jt(l,t),t=hc(e.stateNode,t,2),e=fl(e,t,2),e!==null&&(Ma(e,2),qt(e))}function pe(e,t,l){if(e.tag===3)Ur(e,e,l);else for(;t!==null;){if(t.tag===3){Ur(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(yl===null||!yl.has(a))){e=jt(l,e),l=qo(2),a=fl(t,l,2),a!==null&&(Ho(l,a,t,e),Ma(a,2),qt(a));break}}t=t.return}}function Yc(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new jm;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(l)||(Cc=!0,n.add(l),e=zm.bind(null,e,t,l),t.then(e,e))}function zm(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Oe===e&&(fe&l)===l&&(qe===4||qe===3&&(fe&62914560)===fe&&300>ft()-xu?(ye&2)===0&&Sa(e,0):Dc|=l,ba===fe&&(ba=0)),qt(e)}function qr(e,t){t===0&&(t=zs()),e=Dl(e,t),e!==null&&(Ma(e,t),qt(e))}function Om(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),qr(e,l)}function Nm(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),qr(e,l)}function Cm(e,t){return Fu(e,t)}var zu=null,Ta=null,Gc=!1,Ou=!1,wc=!1,pl=0;function qt(e){e!==Ta&&e.next===null&&(Ta===null?zu=Ta=e:Ta=Ta.next=e),Ou=!0,Gc||(Gc=!0,Mm())}function hn(e,t){if(!wc&&Ou){wc=!0;do for(var l=!1,a=zu;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var u=0;else{var c=a.suspendedLanes,f=a.pingedLanes;u=(1<<31-rt(42|e)+1)-1,u&=n&~(c&~f),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(l=!0,Gr(a,u))}else u=fe,u=Mn(a,a===Oe?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Da(a,u)||(l=!0,Gr(a,u));a=a.next}while(l);wc=!1}}function Dm(){Hr()}function Hr(){Ou=Gc=!1;var e=0;pl!==0&&Qm()&&(e=pl);for(var t=ft(),l=null,a=zu;a!==null;){var n=a.next,u=Br(a,t);u===0?(a.next=null,l===null?zu=n:l.next=n,n===null&&(Ta=l)):(l=a,(e!==0||(u&3)!==0)&&(Ou=!0)),a=n}Ve!==0&&Ve!==5||hn(e),pl!==0&&(pl=0)}function Br(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var c=31-rt(u),f=1<<c,r=n[c];r===-1?((f&l)===0||(f&a)!==0)&&(n[c]=nh(f,t)):r<=t&&(e.expiredLanes|=f),u&=~f}if(t=Oe,l=fe,l=Mn(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(ge===2||ge===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Iu(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Da(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&Iu(a),ti(l)){case 2:case 8:l=As;break;case 32:l=On;break;case 268435456:l=_s;break;default:l=On}return a=Yr.bind(null,e),l=Fu(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&Iu(a),e.callbackPriority=2,e.callbackNode=null,2}function Yr(e,t){if(Ve!==0&&Ve!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(_u()&&e.callbackNode!==l)return null;var a=fe;return a=Mn(e,e===Oe?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(br(e,a,t),Br(e,ft()),e.callbackNode!=null&&e.callbackNode===l?Yr.bind(null,e):null)}function Gr(e,t){if(_u())return null;br(e,t,!0)}function Mm(){Zm(function(){(ye&6)!==0?Fu(Es,Dm):Hr()})}function Xc(){if(pl===0){var e=sa;e===0&&(e=Nn,Nn<<=1,(Nn&261888)===0&&(Nn=256)),pl=e}return pl}function wr(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Hn(""+e)}function Xr(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function Rm(e,t,l,a,n){if(t==="submit"&&l&&l.stateNode===n){var u=wr((n[lt]||null).action),c=a.submitter;c&&(t=(t=c[lt]||null)?wr(t.formAction):c.getAttribute("formAction"),t!==null&&(u=t,c=null));var f=new wn("action","action",null,a,n);e.push({event:f,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(pl!==0){var r=c?Xr(n,c):new FormData(n);cc(l,{pending:!0,data:r,method:n.method,action:u},null,r)}}else typeof u=="function"&&(f.preventDefault(),r=c?Xr(n,c):new FormData(n),cc(l,{pending:!0,data:r,method:n.method,action:u},u,r))},currentTarget:n}]})}}for(var Qc=0;Qc<Ei.length;Qc++){var Lc=Ei[Qc],Um=Lc.toLowerCase(),qm=Lc[0].toUpperCase()+Lc.slice(1);Nt(Um,"on"+qm)}Nt(gf,"onAnimationEnd"),Nt(pf,"onAnimationIteration"),Nt(bf,"onAnimationStart"),Nt("dblclick","onDoubleClick"),Nt("focusin","onFocus"),Nt("focusout","onBlur"),Nt(Fh,"onTransitionRun"),Nt(Ih,"onTransitionStart"),Nt(Ph,"onTransitionCancel"),Nt(xf,"onTransitionEnd"),kl("onMouseEnter",["mouseout","mouseover"]),kl("onMouseLeave",["mouseout","mouseover"]),kl("onPointerEnter",["pointerout","pointerover"]),kl("onPointerLeave",["pointerout","pointerover"]),zl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),zl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),zl("onBeforeInput",["compositionend","keypress","textInput","paste"]),zl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),zl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),zl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mn="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(" "),Hm=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(mn));function Qr(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var a=e[l],n=a.event;a=a.listeners;e:{var u=void 0;if(t)for(var c=a.length-1;0<=c;c--){var f=a[c],r=f.instance,g=f.currentTarget;if(f=f.listener,r!==u&&n.isPropagationStopped())break e;u=f,n.currentTarget=g;try{u(n)}catch(T){Ln(T)}n.currentTarget=null,u=r}else for(c=0;c<a.length;c++){if(f=a[c],r=f.instance,g=f.currentTarget,f=f.listener,r!==u&&n.isPropagationStopped())break e;u=f,n.currentTarget=g;try{u(n)}catch(T){Ln(T)}n.currentTarget=null,u=r}}}}function ce(e,t){var l=t[li];l===void 0&&(l=t[li]=new Set);var a=e+"__bubble";l.has(a)||(Lr(t,e,2,!1),l.add(a))}function Zc(e,t,l){var a=0;t&&(a|=4),Lr(l,e,a,t)}var Nu="_reactListening"+Math.random().toString(36).slice(2);function Vc(e){if(!e[Nu]){e[Nu]=!0,Us.forEach(function(l){l!=="selectionchange"&&(Hm.has(l)||Zc(l,!1,e),Zc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Nu]||(t[Nu]=!0,Zc("selectionchange",!1,t))}}function Lr(e,t,l,a){switch(pd(t)){case 2:var n=oy;break;case 8:n=ry;break;default:n=is}l=n.bind(null,t,l,e),n=void 0,!ri||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),a?n!==void 0?e.addEventListener(t,l,{capture:!0,passive:n}):e.addEventListener(t,l,!0):n!==void 0?e.addEventListener(t,l,{passive:n}):e.addEventListener(t,l,!1)}function Kc(e,t,l,a,n){var u=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var c=a.tag;if(c===3||c===4){var f=a.stateNode.containerInfo;if(f===n)break;if(c===4)for(c=a.return;c!==null;){var r=c.tag;if((r===3||r===4)&&c.stateNode.containerInfo===n)return;c=c.return}for(;f!==null;){if(c=Vl(f),c===null)return;if(r=c.tag,r===5||r===6||r===26||r===27){a=u=c;continue e}f=f.parentNode}}a=a.return}Ks(function(){var g=u,T=fi(l),C=[];e:{var p=Sf.get(e);if(p!==void 0){var x=wn,G=e;switch(e){case"keypress":if(Yn(l)===0)break e;case"keydown":case"keyup":x=Nh;break;case"focusin":G="focus",x=yi;break;case"focusout":G="blur",x=yi;break;case"beforeblur":case"afterblur":x=yi;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":x=Ws;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=gh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=Mh;break;case gf:case pf:case bf:x=xh;break;case xf:x=Uh;break;case"scroll":case"scrollend":x=yh;break;case"wheel":x=Hh;break;case"copy":case"cut":case"paste":x=jh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Fs;break;case"toggle":case"beforetoggle":x=Yh}var J=(t&4)!==0,_e=!J&&(e==="scroll"||e==="scrollend"),y=J?p!==null?p+"Capture":null:p;J=[];for(var h=g,v;h!==null;){var z=h;if(v=z.stateNode,z=z.tag,z!==5&&z!==26&&z!==27||v===null||y===null||(z=qa(h,y),z!=null&&J.push(yn(h,z,v))),_e)break;h=h.return}0<J.length&&(p=new x(p,G,null,l,T),C.push({event:p,listeners:J}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",p&&l!==si&&(G=l.relatedTarget||l.fromElement)&&(Vl(G)||G[Zl]))break e;if((x||p)&&(p=T.window===T?T:(p=T.ownerDocument)?p.defaultView||p.parentWindow:window,x?(G=l.relatedTarget||l.toElement,x=g,G=G?Vl(G):null,G!==null&&(_e=_(G),J=G.tag,G!==_e||J!==5&&J!==27&&J!==6)&&(G=null)):(x=null,G=g),x!==G)){if(J=Ws,z="onMouseLeave",y="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(J=Fs,z="onPointerLeave",y="onPointerEnter",h="pointer"),_e=x==null?p:Ua(x),v=G==null?p:Ua(G),p=new J(z,h+"leave",x,l,T),p.target=_e,p.relatedTarget=v,z=null,Vl(T)===g&&(J=new J(y,h+"enter",G,l,T),J.target=v,J.relatedTarget=_e,z=J),_e=z,x&&G)t:{for(J=Bm,y=x,h=G,v=0,z=y;z;z=J(z))v++;z=0;for(var K=h;K;K=J(K))z++;for(;0<v-z;)y=J(y),v--;for(;0<z-v;)h=J(h),z--;for(;v--;){if(y===h||h!==null&&y===h.alternate){J=y;break t}y=J(y),h=J(h)}J=null}else J=null;x!==null&&Zr(C,p,x,J,!1),G!==null&&_e!==null&&Zr(C,_e,G,J,!0)}}e:{if(p=g?Ua(g):window,x=p.nodeName&&p.nodeName.toLowerCase(),x==="select"||x==="input"&&p.type==="file")var he=uf;else if(af(p))if(cf)he=kh;else{he=Kh;var Q=Vh}else x=p.nodeName,!x||x.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?g&&ci(g.elementType)&&(he=uf):he=Jh;if(he&&(he=he(e,g))){nf(C,he,l,T);break e}Q&&Q(e,p,g),e==="focusout"&&g&&p.type==="number"&&g.memoizedProps.value!=null&&ii(p,"number",p.value)}switch(Q=g?Ua(g):window,e){case"focusin":(af(Q)||Q.contentEditable==="true")&&(ea=Q,Si=g,La=null);break;case"focusout":La=Si=ea=null;break;case"mousedown":ji=!0;break;case"contextmenu":case"mouseup":case"dragend":ji=!1,yf(C,l,T);break;case"selectionchange":if($h)break;case"keydown":case"keyup":yf(C,l,T)}var te;if(gi)e:{switch(e){case"compositionstart":var oe="onCompositionStart";break e;case"compositionend":oe="onCompositionEnd";break e;case"compositionupdate":oe="onCompositionUpdate";break e}oe=void 0}else Pl?tf(e,l)&&(oe="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(oe="onCompositionStart");oe&&(Is&&l.locale!=="ko"&&(Pl||oe!=="onCompositionStart"?oe==="onCompositionEnd"&&Pl&&(te=Js()):(ll=T,di="value"in ll?ll.value:ll.textContent,Pl=!0)),Q=Cu(g,oe),0<Q.length&&(oe=new $s(oe,e,null,l,T),C.push({event:oe,listeners:Q}),te?oe.data=te:(te=lf(l),te!==null&&(oe.data=te)))),(te=wh?Xh(e,l):Qh(e,l))&&(oe=Cu(g,"onBeforeInput"),0<oe.length&&(Q=new $s("onBeforeInput","beforeinput",null,l,T),C.push({event:Q,listeners:oe}),Q.data=te)),Rm(C,e,g,l,T)}Qr(C,t)})}function yn(e,t,l){return{instance:e,listener:t,currentTarget:l}}function Cu(e,t){for(var l=t+"Capture",a=[];e!==null;){var n=e,u=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||u===null||(n=qa(e,l),n!=null&&a.unshift(yn(e,n,u)),n=qa(e,t),n!=null&&a.push(yn(e,n,u))),e.tag===3)return a;e=e.return}return[]}function Bm(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zr(e,t,l,a,n){for(var u=t._reactName,c=[];l!==null&&l!==a;){var f=l,r=f.alternate,g=f.stateNode;if(f=f.tag,r!==null&&r===a)break;f!==5&&f!==26&&f!==27||g===null||(r=g,n?(g=qa(l,u),g!=null&&c.unshift(yn(l,g,r))):n||(g=qa(l,u),g!=null&&c.push(yn(l,g,r)))),l=l.return}c.length!==0&&e.push({event:t,listeners:c})}var Ym=/\r\n?/g,Gm=/\u0000|\uFFFD/g;function Vr(e){return(typeof e=="string"?e:""+e).replace(Ym,`-`).replace(Gm,"")}function Kr(e,t){return t=Vr(t),Vr(e)===t}function Ae(e,t,l,a,n,u){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||$l(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&$l(e,""+a);break;case"className":Un(e,"class",a);break;case"tabIndex":Un(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Un(e,l,a);break;case"style":Zs(e,a,u);break;case"data":if(t!=="object"){Un(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Hn(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(l,"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 u=="function"&&(l==="formAction"?(t!=="input"&&Ae(e,t,"name",n.name,n,null),Ae(e,t,"formEncType",n.formEncType,n,null),Ae(e,t,"formMethod",n.formMethod,n,null),Ae(e,t,"formTarget",n.formTarget,n,null)):(Ae(e,t,"encType",n.encType,n,null),Ae(e,t,"method",n.method,n,null),Ae(e,t,"target",n.target,n,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Hn(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=Bt);break;case"onScroll":a!=null&&ce("scroll",e);break;case"onScrollEnd":a!=null&&ce("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}l=Hn(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""+a):e.removeAttribute(l);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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":a===!0?e.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,a):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(l,a):e.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(l):e.setAttribute(l,a);break;case"popover":ce("beforetoggle",e),ce("toggle",e),Rn(e,"popover",a);break;case"xlinkActuate":Ht(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Ht(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Ht(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Ht(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Ht(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Ht(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Ht(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Ht(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Ht(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Rn(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=hh.get(l)||l,Rn(e,l,a))}}function Jc(e,t,l,a,n,u){switch(l){case"style":Zs(e,a,u);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"children":typeof a=="string"?$l(e,a):(typeof a=="number"||typeof a=="bigint")&&$l(e,""+a);break;case"onScroll":a!=null&&ce("scroll",e);break;case"onScrollEnd":a!=null&&ce("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Bt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qs.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(n=l.endsWith("Capture"),t=l.slice(2,n?l.length-7:void 0),u=e[lt]||null,u=u!=null?u[l]:null,typeof u=="function"&&e.removeEventListener(t,u,n),typeof a=="function")){typeof u!="function"&&u!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,a,n);break e}l in e?e[l]=a:a===!0?e.setAttribute(l,""):Rn(e,l,a)}}}function Ie(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ce("error",e),ce("load",e);var a=!1,n=!1,u;for(u in l)if(l.hasOwnProperty(u)){var c=l[u];if(c!=null)switch(u){case"src":a=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ae(e,t,u,c,l,null)}}n&&Ae(e,t,"srcSet",l.srcSet,l,null),a&&Ae(e,t,"src",l.src,l,null);return;case"input":ce("invalid",e);var f=u=c=n=null,r=null,g=null;for(a in l)if(l.hasOwnProperty(a)){var T=l[a];if(T!=null)switch(a){case"name":n=T;break;case"type":c=T;break;case"checked":r=T;break;case"defaultChecked":g=T;break;case"value":u=T;break;case"defaultValue":f=T;break;case"children":case"dangerouslySetInnerHTML":if(T!=null)throw Error(o(137,t));break;default:Ae(e,t,a,T,l,null)}}ws(e,u,f,r,g,c,n,!1);return;case"select":ce("invalid",e),a=c=u=null;for(n in l)if(l.hasOwnProperty(n)&&(f=l[n],f!=null))switch(n){case"value":u=f;break;case"defaultValue":c=f;break;case"multiple":a=f;default:Ae(e,t,n,f,l,null)}t=u,l=c,e.multiple=!!a,t!=null?Wl(e,!!a,t,!1):l!=null&&Wl(e,!!a,l,!0);return;case"textarea":ce("invalid",e),u=n=a=null;for(c in l)if(l.hasOwnProperty(c)&&(f=l[c],f!=null))switch(c){case"value":a=f;break;case"defaultValue":n=f;break;case"children":u=f;break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(o(91));break;default:Ae(e,t,c,f,l,null)}Qs(e,a,n,u);return;case"option":for(r in l)if(l.hasOwnProperty(r)&&(a=l[r],a!=null))switch(r){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Ae(e,t,r,a,l,null)}return;case"dialog":ce("beforetoggle",e),ce("toggle",e),ce("cancel",e),ce("close",e);break;case"iframe":case"object":ce("load",e);break;case"video":case"audio":for(a=0;a<mn.length;a++)ce(mn[a],e);break;case"image":ce("error",e),ce("load",e);break;case"details":ce("toggle",e);break;case"embed":case"source":case"link":ce("error",e),ce("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(g in l)if(l.hasOwnProperty(g)&&(a=l[g],a!=null))switch(g){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ae(e,t,g,a,l,null)}return;default:if(ci(t)){for(T in l)l.hasOwnProperty(T)&&(a=l[T],a!==void 0&&Jc(e,t,T,a,l,void 0));return}}for(f in l)l.hasOwnProperty(f)&&(a=l[f],a!=null&&Ae(e,t,f,a,l,null))}function wm(e,t,l,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,u=null,c=null,f=null,r=null,g=null,T=null;for(x in l){var C=l[x];if(l.hasOwnProperty(x)&&C!=null)switch(x){case"checked":break;case"value":break;case"defaultValue":r=C;default:a.hasOwnProperty(x)||Ae(e,t,x,null,a,C)}}for(var p in a){var x=a[p];if(C=l[p],a.hasOwnProperty(p)&&(x!=null||C!=null))switch(p){case"type":u=x;break;case"name":n=x;break;case"checked":g=x;break;case"defaultChecked":T=x;break;case"value":c=x;break;case"defaultValue":f=x;break;case"children":case"dangerouslySetInnerHTML":if(x!=null)throw Error(o(137,t));break;default:x!==C&&Ae(e,t,p,x,a,C)}}ui(e,c,f,r,g,T,u,n);return;case"select":x=c=f=p=null;for(u in l)if(r=l[u],l.hasOwnProperty(u)&&r!=null)switch(u){case"value":break;case"multiple":x=r;default:a.hasOwnProperty(u)||Ae(e,t,u,null,a,r)}for(n in a)if(u=a[n],r=l[n],a.hasOwnProperty(n)&&(u!=null||r!=null))switch(n){case"value":p=u;break;case"defaultValue":f=u;break;case"multiple":c=u;default:u!==r&&Ae(e,t,n,u,a,r)}t=f,l=c,a=x,p!=null?Wl(e,!!l,p,!1):!!a!=!!l&&(t!=null?Wl(e,!!l,t,!0):Wl(e,!!l,l?[]:"",!1));return;case"textarea":x=p=null;for(f in l)if(n=l[f],l.hasOwnProperty(f)&&n!=null&&!a.hasOwnProperty(f))switch(f){case"value":break;case"children":break;default:Ae(e,t,f,null,a,n)}for(c in a)if(n=a[c],u=l[c],a.hasOwnProperty(c)&&(n!=null||u!=null))switch(c){case"value":p=n;break;case"defaultValue":x=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(o(91));break;default:n!==u&&Ae(e,t,c,n,a,u)}Xs(e,p,x);return;case"option":for(var G in l)if(p=l[G],l.hasOwnProperty(G)&&p!=null&&!a.hasOwnProperty(G))switch(G){case"selected":e.selected=!1;break;default:Ae(e,t,G,null,a,p)}for(r in a)if(p=a[r],x=l[r],a.hasOwnProperty(r)&&p!==x&&(p!=null||x!=null))switch(r){case"selected":e.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Ae(e,t,r,p,a,x)}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 J in l)p=l[J],l.hasOwnProperty(J)&&p!=null&&!a.hasOwnProperty(J)&&Ae(e,t,J,null,a,p);for(g in a)if(p=a[g],x=l[g],a.hasOwnProperty(g)&&p!==x&&(p!=null||x!=null))switch(g){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(o(137,t));break;default:Ae(e,t,g,p,a,x)}return;default:if(ci(t)){for(var _e in l)p=l[_e],l.hasOwnProperty(_e)&&p!==void 0&&!a.hasOwnProperty(_e)&&Jc(e,t,_e,void 0,a,p);for(T in a)p=a[T],x=l[T],!a.hasOwnProperty(T)||p===x||p===void 0&&x===void 0||Jc(e,t,T,p,a,x);return}}for(var y in l)p=l[y],l.hasOwnProperty(y)&&p!=null&&!a.hasOwnProperty(y)&&Ae(e,t,y,null,a,p);for(C in a)p=a[C],x=l[C],!a.hasOwnProperty(C)||p===x||p==null&&x==null||Ae(e,t,C,p,a,x)}function Jr(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Xm(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),a=0;a<l.length;a++){var n=l[a],u=n.transferSize,c=n.initiatorType,f=n.duration;if(u&&f&&Jr(c)){for(c=0,f=n.responseEnd,a+=1;a<l.length;a++){var r=l[a],g=r.startTime;if(g>f)break;var T=r.transferSize,C=r.initiatorType;T&&Jr(C)&&(r=r.responseEnd,c+=T*(r<f?1:(f-g)/(r-g)))}if(--a,t+=8*(u+c)/(n.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 kc=null,Wc=null;function Du(e){return e.nodeType===9?e:e.ownerDocument}function kr(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 Wr(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 $c(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 Fc=null;function Qm(){var e=window.event;return e&&e.type==="popstate"?e===Fc?!1:(Fc=e,!0):(Fc=null,!1)}var $r=typeof setTimeout=="function"?setTimeout:void 0,Lm=typeof clearTimeout=="function"?clearTimeout:void 0,Fr=typeof Promise=="function"?Promise:void 0,Zm=typeof queueMicrotask=="function"?queueMicrotask:typeof Fr<"u"?function(e){return Fr.resolve(null).then(e).catch(Vm)}:$r;function Vm(e){setTimeout(function(){throw e})}function bl(e){return e==="head"}function Ir(e,t){var l=t,a=0;do{var n=l.nextSibling;if(e.removeChild(l),n&&n.nodeType===8)if(l=n.data,l==="/$"||l==="/&"){if(a===0){e.removeChild(n),za(t);return}a--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")a++;else if(l==="html")vn(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,vn(l);for(var u=l.firstChild;u;){var c=u.nextSibling,f=u.nodeName;u[Ra]||f==="SCRIPT"||f==="STYLE"||f==="LINK"&&u.rel.toLowerCase()==="stylesheet"||l.removeChild(u),u=c}}else l==="body"&&vn(e.ownerDocument.body);l=n}while(l);za(t)}function Pr(e,t){var l=e;e=0;do{var a=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),a&&a.nodeType===8)if(l=a.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=a}while(l)}function Ic(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Ic(l),ai(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Km(e,t,l,a){for(;e.nodeType===1;){var n=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Ra])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=zt(e.nextSibling),e===null)break}return null}function Jm(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=zt(e.nextSibling),e===null))return null;return e}function ed(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=zt(e.nextSibling),e===null))return null;return e}function Pc(e){return e.data==="$?"||e.data==="$~"}function es(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function km(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var a=function(){t(),l.removeEventListener("DOMContentLoaded",a)};l.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function zt(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 ts=null;function td(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return zt(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function ld(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function ad(e,t,l){switch(t=Du(l),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function vn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ai(e)}var Ot=new Map,nd=new Set;function Mu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Pt=N.d;N.d={f:Wm,r:$m,D:Fm,C:Im,L:Pm,m:ey,X:ly,S:ty,M:ay};function Wm(){var e=Pt.f(),t=Tu();return e||t}function $m(e){var t=Kl(e);t!==null&&t.tag===5&&t.type==="form"?So(t):Pt.r(e)}var Ea=typeof document>"u"?null:document;function ud(e,t,l){var a=Ea;if(a&&typeof t=="string"&&t){var n=xt(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),nd.has(n)||(nd.add(n),e={rel:e,crossOrigin:l,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),Ie(t,"link",e),Ke(t),a.head.appendChild(t)))}}function Fm(e){Pt.D(e),ud("dns-prefetch",e,null)}function Im(e,t){Pt.C(e,t),ud("preconnect",e,t)}function Pm(e,t,l){Pt.L(e,t,l);var a=Ea;if(a&&e&&t){var n='link[rel="preload"][as="'+xt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+xt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+xt(l.imageSizes)+'"]')):n+='[href="'+xt(e)+'"]';var u=n;switch(t){case"style":u=Aa(e);break;case"script":u=_a(e)}Ot.has(u)||(e=R({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Ot.set(u,e),a.querySelector(n)!==null||t==="style"&&a.querySelector(gn(u))||t==="script"&&a.querySelector(pn(u))||(t=a.createElement("link"),Ie(t,"link",e),Ke(t),a.head.appendChild(t)))}}function ey(e,t){Pt.m(e,t);var l=Ea;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+xt(a)+'"][href="'+xt(e)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=_a(e)}if(!Ot.has(u)&&(e=R({rel:"modulepreload",href:e},t),Ot.set(u,e),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(pn(u)))return}a=l.createElement("link"),Ie(a,"link",e),Ke(a),l.head.appendChild(a)}}}function ty(e,t,l){Pt.S(e,t,l);var a=Ea;if(a&&e){var n=Jl(a).hoistableStyles,u=Aa(e);t=t||"default";var c=n.get(u);if(!c){var f={loading:0,preload:null};if(c=a.querySelector(gn(u)))f.loading=5;else{e=R({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Ot.get(u))&&ls(e,l);var r=c=a.createElement("link");Ke(r),Ie(r,"link",e),r._p=new Promise(function(g,T){r.onload=g,r.onerror=T}),r.addEventListener("load",function(){f.loading|=1}),r.addEventListener("error",function(){f.loading|=2}),f.loading|=4,Ru(c,t,a)}c={type:"stylesheet",instance:c,count:1,state:f},n.set(u,c)}}}function ly(e,t){Pt.X(e,t);var l=Ea;if(l&&e){var a=Jl(l).hoistableScripts,n=_a(e),u=a.get(n);u||(u=l.querySelector(pn(n)),u||(e=R({src:e,async:!0},t),(t=Ot.get(n))&&as(e,t),u=l.createElement("script"),Ke(u),Ie(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function ay(e,t){Pt.M(e,t);var l=Ea;if(l&&e){var a=Jl(l).hoistableScripts,n=_a(e),u=a.get(n);u||(u=l.querySelector(pn(n)),u||(e=R({src:e,async:!0,type:"module"},t),(t=Ot.get(n))&&as(e,t),u=l.createElement("script"),Ke(u),Ie(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function id(e,t,l,a){var n=(n=ue.current)?Mu(n):null;if(!n)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Aa(l.href),l=Jl(n).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Aa(l.href);var u=Jl(n).hoistableStyles,c=u.get(e);if(c||(n=n.ownerDocument||n,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,c),(u=n.querySelector(gn(e)))&&!u._p&&(c.instance=u,c.state.loading=5),Ot.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Ot.set(e,l),u||ny(n,e,l,c.state))),t&&a===null)throw Error(o(528,""));return c}if(t&&a!==null)throw Error(o(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=_a(l),l=Jl(n).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Aa(e){return'href="'+xt(e)+'"'}function gn(e){return'link[rel="stylesheet"]['+e+"]"}function cd(e){return R({},e,{"data-precedence":e.precedence,precedence:null})}function ny(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),Ie(t,"link",l),Ke(t),e.head.appendChild(t))}function _a(e){return'[src="'+xt(e)+'"]'}function pn(e){return"script[async]"+e}function sd(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+xt(l.href)+'"]');if(a)return t.instance=a,Ke(a),a;var n=R({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Ke(a),Ie(a,"style",n),Ru(a,l.precedence,e),t.instance=a;case"stylesheet":n=Aa(l.href);var u=e.querySelector(gn(n));if(u)return t.state.loading|=4,t.instance=u,Ke(u),u;a=cd(l),(n=Ot.get(n))&&ls(a,n),u=(e.ownerDocument||e).createElement("link"),Ke(u);var c=u;return c._p=new Promise(function(f,r){c.onload=f,c.onerror=r}),Ie(u,"link",a),t.state.loading|=4,Ru(u,l.precedence,e),t.instance=u;case"script":return u=_a(l.src),(n=e.querySelector(pn(u)))?(t.instance=n,Ke(n),n):(a=l,(n=Ot.get(u))&&(a=R({},l),as(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),Ke(n),Ie(n,"link",a),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Ru(a,l.precedence,e));return t.instance}function Ru(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,c=0;c<a.length;c++){var f=a[c];if(f.dataset.precedence===t)u=f;else if(u!==n)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function ls(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function as(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Uu=null;function fd(e,t,l){if(Uu===null){var a=new Map,n=Uu=new Map;n.set(l,a)}else n=Uu,a=n.get(l),a||(a=new Map,n.set(l,a));if(a.has(e))return a;for(a.set(e,null),l=l.getElementsByTagName(e),n=0;n<l.length;n++){var u=l[n];if(!(u[Ra]||u[ke]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var c=u.getAttribute(t)||"";c=e+c;var f=a.get(c);f?f.push(u):a.set(c,[u])}}return a}function od(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function uy(e,t,l){if(l===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;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!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 rd(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function iy(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var n=Aa(a.href),u=t.querySelector(gn(n));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=qu.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=u,Ke(u);return}u=t.ownerDocument||t,a=cd(a),(n=Ot.get(n))&&ls(a,n),u=u.createElement("link"),Ke(u);var c=u;c._p=new Promise(function(f,r){c.onload=f,c.onerror=r}),Ie(u,"link",a),l.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=qu.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var ns=0;function cy(e,t){return e.stylesheets&&e.count===0&&Bu(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&Bu(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&ns===0&&(ns=62500*Xm());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bu(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>ns?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function qu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Hu=null;function Bu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Hu=new Map,t.forEach(sy,e),Hu=null,qu.call(e))}function sy(e,t){if(!(t.state.loading&4)){var l=Hu.get(e);if(l)var a=l.get(null);else{l=new Map,Hu.set(e,l);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<n.length;u++){var c=n[u];(c.nodeName==="LINK"||c.getAttribute("media")!=="not all")&&(l.set(c.dataset.precedence,c),a=c)}a&&l.set(null,a)}n=t.instance,c=n.getAttribute("data-precedence"),u=l.get(c)||a,u===a&&l.set(null,n),l.set(c,n),this.count++,a=qu.bind(this),n.addEventListener("load",a),n.addEventListener("error",a),u?u.parentNode.insertBefore(n,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var bn={$$typeof:le,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function fy(e,t,l,a,n,u,c,f,r){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=Pu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pu(0),this.hiddenUpdates=Pu(null),this.identifierPrefix=a,this.onUncaughtError=n,this.onCaughtError=u,this.onRecoverableError=c,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=r,this.incompleteTransitions=new Map}function dd(e,t,l,a,n,u,c,f,r,g,T,C){return e=new fy(e,t,l,c,r,g,T,C,f),t=1,u===!0&&(t|=24),u=ht(3,null,null,t),e.current=u,u.stateNode=e,t=Bi(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:a,isDehydrated:l,cache:t},Xi(u),e}function hd(e){return e?(e=aa,e):aa}function md(e,t,l,a,n,u){n=hd(n),a.context===null?a.context=n:a.pendingContext=n,a=sl(t),a.payload={element:l},u=u===void 0?null:u,u!==null&&(a.callback=u),l=fl(e,a,t),l!==null&&(st(l,e,t),$a(l,e,t))}function yd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function us(e,t){yd(e,t),(e=e.alternate)&&yd(e,t)}function vd(e){if(e.tag===13||e.tag===31){var t=Dl(e,67108864);t!==null&&st(t,e,67108864),us(e,67108864)}}function gd(e){if(e.tag===13||e.tag===31){var t=pt();t=ei(t);var l=Dl(e,t);l!==null&&st(l,e,t),us(e,t)}}var Yu=!0;function oy(e,t,l,a){var n=j.T;j.T=null;var u=N.p;try{N.p=2,is(e,t,l,a)}finally{N.p=u,j.T=n}}function ry(e,t,l,a){var n=j.T;j.T=null;var u=N.p;try{N.p=8,is(e,t,l,a)}finally{N.p=u,j.T=n}}function is(e,t,l,a){if(Yu){var n=cs(a);if(n===null)Kc(e,t,a,Gu,l),bd(e,a);else if(hy(n,e,t,l,a))a.stopPropagation();else if(bd(e,a),t&4&&-1<dy.indexOf(e)){for(;n!==null;){var u=Kl(n);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var c=_l(u.pendingLanes);if(c!==0){var f=u;for(f.pendingLanes|=2,f.entangledLanes|=2;c;){var r=1<<31-rt(c);f.entanglements[1]|=r,c&=~r}qt(u),(ye&6)===0&&(Su=ft()+500,hn(0))}}break;case 31:case 13:f=Dl(u,2),f!==null&&st(f,u,2),Tu(),us(u,2)}if(u=cs(a),u===null&&Kc(e,t,a,Gu,l),u===n)break;n=u}n!==null&&a.stopPropagation()}else Kc(e,t,a,null,l)}}function cs(e){return e=fi(e),ss(e)}var Gu=null;function ss(e){if(Gu=null,e=Vl(e),e!==null){var t=_(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=q(t),e!==null)return e;e=null}else if(l===31){if(e=H(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Gu=e,null}function pd(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(Fd()){case Es:return 2;case As:return 8;case On:case Id:return 32;case _s:return 268435456;default:return 32}default:return 32}}var fs=!1,xl=null,Sl=null,jl=null,xn=new Map,Sn=new Map,Tl=[],dy="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 bd(e,t){switch(e){case"focusin":case"focusout":xl=null;break;case"dragenter":case"dragleave":Sl=null;break;case"mouseover":case"mouseout":jl=null;break;case"pointerover":case"pointerout":xn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sn.delete(t.pointerId)}}function jn(e,t,l,a,n,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:l,eventSystemFlags:a,nativeEvent:u,targetContainers:[n]},t!==null&&(t=Kl(t),t!==null&&vd(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function hy(e,t,l,a,n){switch(t){case"focusin":return xl=jn(xl,e,t,l,a,n),!0;case"dragenter":return Sl=jn(Sl,e,t,l,a,n),!0;case"mouseover":return jl=jn(jl,e,t,l,a,n),!0;case"pointerover":var u=n.pointerId;return xn.set(u,jn(xn.get(u)||null,e,t,l,a,n)),!0;case"gotpointercapture":return u=n.pointerId,Sn.set(u,jn(Sn.get(u)||null,e,t,l,a,n)),!0}return!1}function xd(e){var t=Vl(e.target);if(t!==null){var l=_(t);if(l!==null){if(t=l.tag,t===13){if(t=q(l),t!==null){e.blockedOn=t,Ms(e.priority,function(){gd(l)});return}}else if(t===31){if(t=H(l),t!==null){e.blockedOn=t,Ms(e.priority,function(){gd(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function wu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=cs(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);si=a,l.target.dispatchEvent(a),si=null}else return t=Kl(l),t!==null&&vd(t),e.blockedOn=l,!1;t.shift()}return!0}function Sd(e,t,l){wu(e)&&l.delete(t)}function my(){fs=!1,xl!==null&&wu(xl)&&(xl=null),Sl!==null&&wu(Sl)&&(Sl=null),jl!==null&&wu(jl)&&(jl=null),xn.forEach(Sd),Sn.forEach(Sd)}function Xu(e,t){e.blockedOn===t&&(e.blockedOn=null,fs||(fs=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,my)))}var Qu=null;function jd(e){Qu!==e&&(Qu=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Qu===e&&(Qu=null);for(var t=0;t<e.length;t+=3){var l=e[t],a=e[t+1],n=e[t+2];if(typeof a!="function"){if(ss(a||l)===null)continue;break}var u=Kl(l);u!==null&&(e.splice(t,3),t-=3,cc(u,{pending:!0,data:n,method:l.method,action:a},a,n))}}))}function za(e){function t(r){return Xu(r,e)}xl!==null&&Xu(xl,e),Sl!==null&&Xu(Sl,e),jl!==null&&Xu(jl,e),xn.forEach(t),Sn.forEach(t);for(var l=0;l<Tl.length;l++){var a=Tl[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Tl.length&&(l=Tl[0],l.blockedOn===null);)xd(l),l.blockedOn===null&&Tl.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(a=0;a<l.length;a+=3){var n=l[a],u=l[a+1],c=n[lt]||null;if(typeof u=="function")c||jd(l);else if(c){var f=null;if(u&&u.hasAttribute("formAction")){if(n=u,c=u[lt]||null)f=c.formAction;else if(ss(n)!==null)continue}else f=c.action;typeof f=="function"?l[a+1]=f:(l.splice(a,3),a-=3),jd(l)}}}function Td(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(c){return n=c})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),a||setTimeout(l,20)}function l(){if(!a&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,n=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),n!==null&&(n(),n=null)}}}function os(e){this._internalRoot=e}Lu.prototype.render=os.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var l=t.current,a=pt();md(l,a,e,t,null,null)},Lu.prototype.unmount=os.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;md(e.current,2,null,e,null,null),Tu(),t[Zl]=null}};function Lu(e){this._internalRoot=e}Lu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ds();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Tl.length&&t!==0&&t<Tl[l].priority;l++);Tl.splice(l,0,e),l===0&&xd(e)}};var Ed=S.version;if(Ed!=="19.2.5")throw Error(o(527,Ed,"19.2.5"));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=d(t),e=e!==null?O(e):null,e=e===null?null:e.stateNode,e};var yy={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zu.isDisabled&&Zu.supportsFiber)try{Ca=Zu.inject(yy),ot=Zu}catch{}}return En.createRoot=function(e,t){if(!E(e))throw Error(o(299));var l=!1,a="",n=Do,u=Mo,c=Ro;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=dd(e,1,!1,null,null,l,a,null,n,u,c,Td),e[Zl]=t.current,Vc(e),new os(t)},En.hydrateRoot=function(e,t,l){if(!E(e))throw Error(o(299));var a=!1,n="",u=Do,c=Mo,f=Ro,r=null;return l!=null&&(l.unstable_strictMode===!0&&(a=!0),l.identifierPrefix!==void 0&&(n=l.identifierPrefix),l.onUncaughtError!==void 0&&(u=l.onUncaughtError),l.onCaughtError!==void 0&&(c=l.onCaughtError),l.onRecoverableError!==void 0&&(f=l.onRecoverableError),l.formState!==void 0&&(r=l.formState)),t=dd(e,1,!0,t,l??null,a,n,r,u,c,f,Td),t.context=hd(null),l=t.current,a=pt(),a=ei(a),n=sl(a),n.callback=null,fl(l,n,a),l=a,t.current.lanes=l,Ma(t,l),qt(t),e[Zl]=t.current,Vc(e),new Lu(t)},En.version="19.2.5",En}var Ud;function Ay(){if(Ud)return hs.exports;Ud=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(S){console.error(S)}}return s(),hs.exports=Ey(),hs.exports}var _y=Ay();const zy=wd(_y),Qd="";class An extends Error{constructor(S,b,o){super(S),this.status=b,this.outcome=o}}function Ss(s){return s instanceof An?s.outcome?s.outcome==="unknown":s.status>=500||s.status===408:!0}async function Ne(s,S){const b=await fetch(`${Qd}${s}`,{...S,credentials:"same-origin",headers:{"Content-Type":"application/json",...S==null?void 0:S.headers}});if(!b.ok){const o=await b.json().catch(()=>null);b.status===401&&(window.location.hash="#login");const E=b.status===429?` Wait ${b.headers.get("retry-after")||"60"} seconds before retrying.`:"",_=typeof(o==null?void 0:o.message)=="string"?o.message:typeof(o==null?void 0:o.error)=="string"?o.error:`HTTP ${b.status}`,q=typeof(o==null?void 0:o.next_action)=="string"?` ${o.next_action}`:"",H=(o==null?void 0:o.outcome)==="unknown"||(o==null?void 0:o.outcome)==="failed"?o.outcome:void 0;throw new An(_+q+E,b.status,H)}return b.json()}async function Oy(s){const S=await fetch(`${Qd}${s}`,{credentials:"same-origin"});if(S.status===401)throw window.location.hash="#login",new Error("Unauthorized");if(!S.ok)throw new Error(`HTTP ${S.status}`);return S.text()}const be={oauthRequest:s=>Ne(`/admin/api/oauth-requests/${encodeURIComponent(s)}`),decideOAuthRequest:(s,S,b)=>Ne(`/admin/api/oauth-requests/${encodeURIComponent(s)}`,{method:"POST",body:JSON.stringify({decision:S,csrf:b})}),login:s=>Ne("/admin/login",{method:"POST",body:JSON.stringify({token:s})}),signOutEverywhere:()=>Ne("/admin/api/sign-out-everywhere",{method:"POST"}),stats:()=>Ne("/admin/api/stats"),health:()=>Ne("/admin/api/health-indicators"),agents:()=>Ne("/admin/api/agents"),agentsSpend:()=>Ne("/admin/api/agents/spend"),sources:()=>Ne("/admin/api/sources"),grantCatalog:()=>Ne("/admin/api/grant-catalog"),clientGrant:s=>Ne(`/admin/api/grants/${encodeURIComponent(s)}`),clientDetails:s=>Ne(`/admin/api/clients/${encodeURIComponent(s)}`),clientSetup:(s,S,b)=>{const o=new URLSearchParams({harness:S});return b&&o.set("flow",b),Ne(`/admin/api/clients/${encodeURIComponent(s)}/setup?${o}`)},clientLifecycle:(s,S)=>Ne(`/admin/api/clients/${encodeURIComponent(s)}/lifecycle`,{method:"POST",body:JSON.stringify(S)}),registerClient:s=>Ne("/admin/api/register-client",{method:"POST",body:JSON.stringify(s)}),recoverClient:(s,S,b)=>Ne("/admin/api/recover-client",{method:"POST",body:JSON.stringify({clientId:s,harness:S,flow:b})}),updateClientGrant:(s,S)=>Ne("/admin/api/rescope-client",{method:"POST",body:JSON.stringify({...S,clientId:s})}),requests:(s=1,S="")=>Ne(`/admin/api/requests?page=${s}${S}`),apiKeys:()=>Ne("/admin/api/api-keys"),createApiKey(s){return Ne("/admin/api/api-keys",{method:"POST",body:JSON.stringify({name:s})})},revokeApiKey(s){return Ne("/admin/api/api-keys/revoke",{method:"POST",body:JSON.stringify({name:s})})},updateClientTtl:(s,S)=>Ne("/admin/api/update-client-ttl",{method:"POST",body:JSON.stringify({clientId:s,tokenTtl:S})}),rescopeClient:(s,S,b)=>Ne("/admin/api/rescope-client",{method:"POST",body:JSON.stringify({clientId:s,sourceId:S,federatedRead:b})}),revokeClient:s=>Ne("/admin/api/revoke-client",{method:"POST",body:JSON.stringify({clientId:s})}),calibrationProfile:s=>Ne(`/admin/api/calibration/profile${s?`?holder=${encodeURIComponent(s)}`:""}`),calibrationChart:(s,S)=>Oy(`/admin/api/calibration/charts/${encodeURIComponent(s)}${S?`?holder=${encodeURIComponent(S)}`:""}`),jobsWatch:()=>Ne("/admin/api/jobs/watch")},ps="gbrain.pending-oauth-request",qd=s=>s!==null&&/^[a-f0-9]{64}$/.test(s);function Ku(){const s=new URL(window.location.href).searchParams.get("oauth_request");if(qd(s)){try{window.sessionStorage.setItem(ps,s)}catch{}return s}try{const S=window.sessionStorage.getItem(ps);if(qd(S))return S}catch{}}function Hd(){try{window.sessionStorage.removeItem(ps)}catch{}const s=new URL(window.location.href);s.searchParams.delete("oauth_request"),window.history.replaceState(null,"",s)}function Ny(s,S){const b=S?` --oauth-request ${S}`:"";return`Give me an owner admin login link for ${s}. On the brain host, run gbrain mcp admin login-link --url ${s}${b} using its protected owner credential. Deliver the single-use link privately and do not open it before I do.`}function Cy({onLogin:s}){const[S,b]=M.useState(""),[o,E]=M.useState(""),[_,q]=M.useState(!1),[H,A]=M.useState(!1),[d,O]=M.useState(""),[R,U]=M.useState(),[L,w]=M.useState(""),[Z,W]=M.useState(0),ae=Ku(),$=R?Ny(R,ae):void 0;M.useEffect(()=>{let ne=!0;const xe=new AbortController,k=setTimeout(()=>xe.abort(),1e4);return U(void 0),w(""),A(!1),fetch("/.well-known/gbrain",{credentials:"omit",redirect:"error",cache:"no-store",signal:xe.signal}).then(async V=>{if(!V.ok)throw new Error("Server discovery is unavailable.");const Se=await V.json();if(typeof(Se==null?void 0:Se.endpoint)!="string")throw new Error("Server discovery has no MCP endpoint.");const je=new URL(Se.endpoint);if(!["https:","http:"].includes(je.protocol)||je.username||je.password||je.search||je.hash||je.pathname!=="/mcp")throw new Error("Server discovery returned an invalid MCP endpoint.");ne&&U(je.toString())}).catch(()=>{ne&&w("The configured MCP endpoint could not be discovered. Ask the brain host administrator to check the server’s configured public URL. You can still sign in with the owner credential below.")}).finally(()=>clearTimeout(k)),()=>{ne=!1,clearTimeout(k),xe.abort()}},[Z]);const le=async ne=>{ne.preventDefault(),E(""),q(!0);try{await be.login(S),b(""),s()}catch(xe){E(xe instanceof An&&xe.status===401?"The owner bootstrap credential was not accepted. An OAuth access token or client secret cannot log into this dashboard. Ask the brain host administrator for a fresh login link.":xe instanceof Error?xe.message:"Could not reach the owner login service. Check the server and retry.")}finally{q(!1)}};return i.jsx("div",{className:"login-page",children:i.jsxs("section",{className:"login-box","aria-labelledby":"owner-login-title",style:{maxWidth:560},children:[i.jsx("h1",{id:"owner-login-title",className:"login-logo",children:"GBrain owner login"}),i.jsx("p",{style:{marginBottom:16},children:"Ask the agent that administers the brain host for a login link. Ordinary MCP clients cannot create owner login links, even with an admin scope."}),ae&&i.jsx("p",{role:"status",style:{marginBottom:16},children:"A client connection is waiting for owner approval. The prompt below preserves that request when you open the login link in another browser or tab."}),$&&i.jsxs(i.Fragment,{children:[i.jsx("label",{htmlFor:"owner-login-prompt",children:"Prompt for the host administrator"}),i.jsx("textarea",{id:"owner-login-prompt",rows:7,readOnly:!0,value:$,style:{fontFamily:"var(--font-mono)",fontSize:12}}),i.jsx("button",{type:"button",className:"btn btn-secondary",style:{marginTop:8},onClick:()=>{O(""),navigator.clipboard.writeText($).then(()=>A(!0)).catch(()=>O("Clipboard unavailable. Select and copy the prompt above."))},children:H?"Prompt copied":"Copy owner login prompt"})]}),!$&&!L&&i.jsx("p",{role:"status",children:"Discovering the server’s configured MCP endpoint…"}),L&&i.jsxs("p",{role:"alert",children:[L," ",i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>W(ne=>ne+1),children:"Retry server discovery"})]}),d&&i.jsx("p",{role:"alert",children:d}),i.jsx("p",{className:"grant-help",style:{margin:"12px 0 20px"},children:"Login links expire after five minutes and can be used once. A client’s PKCE sign-in requests access to memory; owner login approves that request."}),i.jsxs("details",{children:[i.jsx("summary",{style:{cursor:"pointer"},children:"Sign in with the owner bootstrap credential"}),i.jsxs("form",{onSubmit:le,style:{marginTop:12},children:[i.jsx("label",{htmlFor:"owner-bootstrap-token",children:"Owner bootstrap credential"}),i.jsx("input",{id:"owner-bootstrap-token",type:"password",autoComplete:"off",value:S,disabled:_,onChange:ne=>b(ne.target.value)}),i.jsx("button",{type:"submit",className:"btn btn-primary",style:{width:"100%",marginTop:12},disabled:_||!S.trim(),children:_?"Signing in…":"Sign in as owner"}),o&&i.jsx("p",{role:"alert",className:"login-error",children:o})]})]})]})})}function Dy(){const[s,S]=M.useState({connected_agents:0,requests_today:0,active_tokens:0}),[b,o]=M.useState({expiring_soon:0,error_rate:"0%"}),[E,_]=M.useState([]),[q,H]=M.useState("connecting"),A=M.useRef(null);M.useEffect(()=>{be.stats().then(S).catch(()=>{}),be.health().then(o).catch(()=>{});const O=new EventSource("/admin/events",{withCredentials:!0});A.current=O,O.onopen=()=>H("connected"),O.onmessage=U=>{try{const L=JSON.parse(U.data);_(w=>[L,...w].slice(0,50))}catch{}},O.onerror=()=>{H("disconnected"),setTimeout(()=>{H("connecting"),O.close()},3e3)};const R=setInterval(()=>{be.stats().then(S).catch(()=>{}),be.health().then(o).catch(()=>{})},3e4);return()=>{O.close(),clearInterval(R)}},[]);const d=O=>{const R=Date.now()-new Date(O).getTime();return R<6e4?`${Math.floor(R/1e3)}s ago`:R<36e5?`${Math.floor(R/6e4)} min ago`:`${Math.floor(R/36e5)}h ago`};return i.jsxs(i.Fragment,{children:[i.jsx("h1",{className:"page-title",children:"Dashboard"}),i.jsxs("div",{style:{display:"flex",gap:24},children:[i.jsxs("div",{style:{flex:1},children:[i.jsxs("div",{className:"metrics",children:[i.jsxs("div",{className:"metric",children:[i.jsx("div",{className:"metric-value",children:s.connected_agents}),i.jsx("div",{className:"metric-label",children:"Connected Agents"})]}),i.jsxs("div",{className:"metric",children:[i.jsx("div",{className:"metric-value",children:s.requests_today}),i.jsx("div",{className:"metric-label",children:"Requests Today"})]}),i.jsxs("div",{className:"metric",children:[i.jsx("div",{className:"metric-value",children:s.active_tokens}),i.jsx("div",{className:"metric-label",children:"Active Tokens"})]})]}),i.jsxs("h2",{className:"section-title",children:["Live Activity",i.jsx("span",{style:{marginLeft:8,fontSize:10,color:q==="connected"?"var(--success)":q==="connecting"?"var(--warning)":"var(--error)"},children:q==="connected"?"● connected":q==="connecting"?"● connecting...":"● disconnected"})]}),i.jsx("div",{className:"feed",children:E.length===0?i.jsx("div",{className:"feed-empty",children:q==="connected"?"No requests yet. Agents will appear when they connect.":"Connecting..."}):i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Agent"}),i.jsx("th",{children:"Operation"}),i.jsx("th",{children:"Scopes"}),i.jsx("th",{children:"Latency"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Time"})]})}),i.jsx("tbody",{children:E.map((O,R)=>i.jsxs("tr",{children:[i.jsx("td",{className:"mono",children:O.agent}),i.jsx("td",{className:"mono",children:O.operation}),i.jsx("td",{children:O.scopes.split(",").map(U=>i.jsx("span",{className:`badge badge-${U.trim()}`,style:{marginRight:4},children:U.trim()},U))}),i.jsxs("td",{className:"mono",children:[O.latency_ms," ms"]}),i.jsx("td",{children:i.jsx("span",{className:`badge badge-${O.status}`,children:O.status})}),i.jsx("td",{style:{color:"var(--text-secondary)"},children:d(O.timestamp)})]},R))})]})})]}),i.jsxs("div",{style:{width:220},children:[i.jsx("h2",{className:"section-title",children:"Token Health"}),i.jsxs("div",{className:"health-panel",children:[i.jsxs("div",{className:"health-row",children:[i.jsx("span",{style:{color:"var(--warning)"},children:"Expiring Soon"}),i.jsx("span",{className:"mono",children:b.expiring_soon})]}),i.jsxs("div",{className:"health-row",children:[i.jsx("span",{style:{color:"var(--error)"},children:"Error Rate"}),i.jsx("span",{className:"mono",children:b.error_rate})]})]})]})]})]})}const Oa=s=>s.split(/[\s,]+/).filter(Boolean);function bs(s){var S,b,o;return{profile:(s==null?void 0:s.profile)??"memory-writer",applyProfile:!s,source:(s==null?void 0:s.sourceId)??"default",reads:(s==null?void 0:s.federatedRead)??["default"],scopes:(s==null?void 0:s.scopes.join(" "))??"",directPrefixes:((S=s==null?void 0:s.boundSlugPrefixes)==null?void 0:S.join(`+`+a.stack}}var $u=Object.prototype.hasOwnProperty,Fu=s.unstable_scheduleCallback,Iu=s.unstable_cancelCallback,Wd=s.unstable_shouldYield,$d=s.unstable_requestPaint,ft=s.unstable_now,Fd=s.unstable_getCurrentPriorityLevel,Es=s.unstable_ImmediatePriority,As=s.unstable_UserBlockingPriority,On=s.unstable_NormalPriority,Id=s.unstable_LowPriority,_s=s.unstable_IdlePriority,Pd=s.log,eh=s.unstable_setDisableYieldValue,Ca=null,ot=null;function el(e){if(typeof Pd=="function"&&eh(e),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(Ca,e)}catch{}}var rt=Math.clz32?Math.clz32:ah,th=Math.log,lh=Math.LN2;function ah(e){return e>>>=0,e===0?32:31-(th(e)/lh|0)|0}var Nn=256,Cn=262144,Dn=4194304;function _l(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 Mn(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var n=0,u=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var f=a&134217727;return f!==0?(a=f&~u,a!==0?n=_l(a):(c&=f,c!==0?n=_l(c):l||(l=f&~e,l!==0&&(n=_l(l))))):(f=a&~u,f!==0?n=_l(f):c!==0?n=_l(c):l||(l=a&~e,l!==0&&(n=_l(l)))),n===0?0:t!==0&&t!==n&&(t&u)===0&&(u=n&-n,l=t&-t,u>=l||u===32&&(l&4194048)!==0)?t:n}function Da(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nh(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 zs(){var e=Dn;return Dn<<=1,(Dn&62914560)===0&&(Dn=4194304),e}function Pu(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Ma(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function uh(e,t,l,a,n,u){var c=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var f=e.entanglements,r=e.expirationTimes,g=e.hiddenUpdates;for(l=c&~l;0<l;){var T=31-rt(l),C=1<<T;f[T]=0,r[T]=-1;var p=g[T];if(p!==null)for(g[T]=null,T=0;T<p.length;T++){var S=p[T];S!==null&&(S.lane&=-536870913)}l&=~C}a!==0&&Os(e,a,0),u!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=u&~(c&~t))}function Os(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-rt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function Ns(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-rt(l),n=1<<a;n&t|e[a]&t&&(e[a]|=t),l&=~n}}function Cs(e,t){var l=t&-t;return l=(l&42)!==0?1:ei(l),(l&(e.suspendedLanes|t))!==0?0:l}function ei(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 ti(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ds(){var e=N.p;return e!==0?e:(e=window.event,e===void 0?32:pd(e.type))}function Ms(e,t){var l=N.p;try{return N.p=e,t()}finally{N.p=l}}var tl=Math.random().toString(36).slice(2),ke="__reactFiber$"+tl,lt="__reactProps$"+tl,Zl="__reactContainer$"+tl,li="__reactEvents$"+tl,ih="__reactListeners$"+tl,ch="__reactHandles$"+tl,Rs="__reactResources$"+tl,Ra="__reactMarker$"+tl;function ai(e){delete e[ke],delete e[lt],delete e[li],delete e[ih],delete e[ch]}function Vl(e){var t=e[ke];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Zl]||l[ke]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=ld(e);e!==null;){if(l=e[ke])return l;e=ld(e)}return t}e=l,l=e.parentNode}return null}function Kl(e){if(e=e[ke]||e[Zl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ua(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Jl(e){var t=e[Rs];return t||(t=e[Rs]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ke(e){e[Ra]=!0}var Us=new Set,qs={};function zl(e,t){kl(e,t),kl(e+"Capture",t)}function kl(e,t){for(qs[e]=t,e=0;e<t.length;e++)Us.add(t[e])}var sh=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]*$"),Hs={},Bs={};function fh(e){return $u.call(Bs,e)?!0:$u.call(Hs,e)?!1:sh.test(e)?Bs[e]=!0:(Hs[e]=!0,!1)}function Rn(e,t,l){if(fh(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function Un(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function Ht(e,t,l,a){if(a===null)e.removeAttribute(l);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+a)}}function bt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ys(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function oh(e,t,l){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var n=a.get,u=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(c){l=""+c,u.call(this,c)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(c){l=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ni(e){if(!e._valueTracker){var t=Ys(e)?"checked":"value";e._valueTracker=oh(e,t,""+e[t])}}function Gs(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=Ys(e)?e.checked?"true":"false":e.value),e=a,e!==l?(t.setValue(e),!0):!1}function qn(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 rh=/[\n"\\]/g;function xt(e){return e.replace(rh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ui(e,t,l,a,n,u,c,f){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),t!=null?c==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+bt(t)):e.value!==""+bt(t)&&(e.value=""+bt(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?ii(e,c,bt(t)):l!=null?ii(e,c,bt(l)):a!=null&&e.removeAttribute("value"),n==null&&u!=null&&(e.defaultChecked=!!u),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.name=""+bt(f):e.removeAttribute("name")}function ws(e,t,l,a,n,u,c,f){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||l!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){ni(e);return}l=l!=null?""+bt(l):"",t=t!=null?""+bt(t):l,f||t===e.value||(e.value=t),e.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=f?e.checked:!!a,e.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),ni(e)}function ii(e,t,l){t==="number"&&qn(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Wl(e,t,l,a){if(e=e.options,t){t={};for(var n=0;n<l.length;n++)t["$"+l[n]]=!0;for(l=0;l<e.length;l++)n=t.hasOwnProperty("$"+e[l].value),e[l].selected!==n&&(e[l].selected=n),n&&a&&(e[l].defaultSelected=!0)}else{for(l=""+bt(l),t=null,n=0;n<e.length;n++){if(e[n].value===l){e[n].selected=!0,a&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function Xs(e,t,l){if(t!=null&&(t=""+bt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+bt(l):""}function Qs(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(o(92));if(Ze(a)){if(1<a.length)throw Error(o(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=bt(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),ni(e)}function $l(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var dh=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 Ls(e,t,l){var a=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,l):typeof l!="number"||l===0||dh.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Zs(e,t,l){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,l!=null){for(var a in l)!l.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var n in t)a=t[n],t.hasOwnProperty(n)&&l[n]!==a&&Ls(e,n,a)}else for(var u in t)t.hasOwnProperty(u)&&Ls(e,u,t[u])}function ci(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 hh=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"]]),mh=/^[\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 Hn(e){return mh.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Bt(){}var si=null;function fi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fl=null,Il=null;function Vs(e){var t=Kl(e);if(t&&(e=t.stateNode)){var l=e[lt]||null;e:switch(e=t.stateNode,t.type){case"input":if(ui(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+xt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var n=a[lt]||null;if(!n)throw Error(o(90));ui(a,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<l.length;t++)a=l[t],a.form===e.form&&Gs(a)}break e;case"textarea":Xs(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Wl(e,!!l.multiple,t,!1)}}}var oi=!1;function Ks(e,t,l){if(oi)return e(t,l);oi=!0;try{var a=e(t);return a}finally{if(oi=!1,(Fl!==null||Il!==null)&&(Tu(),Fl&&(t=Fl,e=Il,Il=Fl=null,Vs(t),e)))for(t=0;t<e.length;t++)Vs(e[t])}}function qa(e,t){var l=e.stateNode;if(l===null)return null;var a=l[lt]||null;if(a===null)return null;l=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(o(231,t,typeof l));return l}var Yt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ri=!1;if(Yt)try{var Ha={};Object.defineProperty(Ha,"passive",{get:function(){ri=!0}}),window.addEventListener("test",Ha,Ha),window.removeEventListener("test",Ha,Ha)}catch{ri=!1}var ll=null,di=null,Bn=null;function Js(){if(Bn)return Bn;var e,t=di,l=t.length,a,n="value"in ll?ll.value:ll.textContent,u=n.length;for(e=0;e<l&&t[e]===n[e];e++);var c=l-e;for(a=1;a<=c&&t[l-a]===n[u-a];a++);return Bn=n.slice(e,1<a?1-a:void 0)}function Yn(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 Gn(){return!0}function ks(){return!1}function at(e){function t(l,a,n,u,c){this._reactName=l,this._targetInst=n,this.type=a,this.nativeEvent=u,this.target=c,this.currentTarget=null;for(var f in e)e.hasOwnProperty(f)&&(l=e[f],this[f]=l?l(u):u[f]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?Gn:ks,this.isPropagationStopped=ks,this}return O(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Gn)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Gn)},persist:function(){},isPersistent:Gn}),t}var Ol={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wn=at(Ol),Ba=O({},Ol,{view:0,detail:0}),yh=at(Ba),hi,mi,Ya,Xn=O({},Ba,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vi,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!==Ya&&(Ya&&e.type==="mousemove"?(hi=e.screenX-Ya.screenX,mi=e.screenY-Ya.screenY):mi=hi=0,Ya=e),hi)},movementY:function(e){return"movementY"in e?e.movementY:mi}}),Ws=at(Xn),vh=O({},Xn,{dataTransfer:0}),gh=at(vh),ph=O({},Ba,{relatedTarget:0}),yi=at(ph),bh=O({},Ol,{animationName:0,elapsedTime:0,pseudoElement:0}),xh=at(bh),Sh=O({},Ol,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),jh=at(Sh),Th=O({},Ol,{data:0}),$s=at(Th),Eh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ah={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"},_h={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=_h[e])?!!t[e]:!1}function vi(){return zh}var Oh=O({},Ba,{key:function(e){if(e.key){var t=Eh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ah[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vi,charCode:function(e){return e.type==="keypress"?Yn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Nh=at(Oh),Ch=O({},Xn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fs=at(Ch),Dh=O({},Ba,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vi}),Mh=at(Dh),Rh=O({},Ol,{propertyName:0,elapsedTime:0,pseudoElement:0}),Uh=at(Rh),qh=O({},Xn,{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}),Hh=at(qh),Bh=O({},Ol,{newState:0,oldState:0}),Yh=at(Bh),Gh=[9,13,27,32],gi=Yt&&"CompositionEvent"in window,Ga=null;Yt&&"documentMode"in document&&(Ga=document.documentMode);var wh=Yt&&"TextEvent"in window&&!Ga,Is=Yt&&(!gi||Ga&&8<Ga&&11>=Ga),Ps=" ",ef=!1;function tf(e,t){switch(e){case"keyup":return Gh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pl=!1;function Xh(e,t){switch(e){case"compositionend":return lf(t);case"keypress":return t.which!==32?null:(ef=!0,Ps);case"textInput":return e=t.data,e===Ps&&ef?null:e;default:return null}}function Qh(e,t){if(Pl)return e==="compositionend"||!gi&&tf(e,t)?(e=Js(),Bn=di=ll=null,Pl=!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 Is&&t.locale!=="ko"?null:t.data;default:return null}}var Lh={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 af(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lh[e.type]:t==="textarea"}function nf(e,t,l,a){Fl?Il?Il.push(a):Il=[a]:Fl=a,t=Cu(t,"onChange"),0<t.length&&(l=new wn("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var wa=null,Xa=null;function Zh(e){Qr(e,0)}function Qn(e){var t=Ua(e);if(Gs(t))return e}function uf(e,t){if(e==="change")return t}var cf=!1;if(Yt){var pi;if(Yt){var bi="oninput"in document;if(!bi){var sf=document.createElement("div");sf.setAttribute("oninput","return;"),bi=typeof sf.oninput=="function"}pi=bi}else pi=!1;cf=pi&&(!document.documentMode||9<document.documentMode)}function ff(){wa&&(wa.detachEvent("onpropertychange",of),Xa=wa=null)}function of(e){if(e.propertyName==="value"&&Qn(Xa)){var t=[];nf(t,Xa,e,fi(e)),Ks(Zh,t)}}function Vh(e,t,l){e==="focusin"?(ff(),wa=t,Xa=l,wa.attachEvent("onpropertychange",of)):e==="focusout"&&ff()}function Kh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Qn(Xa)}function Jh(e,t){if(e==="click")return Qn(t)}function kh(e,t){if(e==="input"||e==="change")return Qn(t)}function Wh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dt=typeof Object.is=="function"?Object.is:Wh;function Qa(e,t){if(dt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),a=Object.keys(t);if(l.length!==a.length)return!1;for(a=0;a<l.length;a++){var n=l[a];if(!$u.call(t,n)||!dt(e[n],t[n]))return!1}return!0}function rf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function df(e,t){var l=rf(e);e=0;for(var a;l;){if(l.nodeType===3){if(a=e+l.textContent.length,e<=t&&a>=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=rf(l)}}function hf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qn(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=qn(e.document)}return t}function xi(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 $h=Yt&&"documentMode"in document&&11>=document.documentMode,ea=null,Si=null,La=null,ji=!1;function yf(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;ji||ea==null||ea!==qn(a)||(a=ea,"selectionStart"in a&&xi(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),La&&Qa(La,a)||(La=a,a=Cu(Si,"onSelect"),0<a.length&&(t=new wn("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=ea)))}function Nl(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var ta={animationend:Nl("Animation","AnimationEnd"),animationiteration:Nl("Animation","AnimationIteration"),animationstart:Nl("Animation","AnimationStart"),transitionrun:Nl("Transition","TransitionRun"),transitionstart:Nl("Transition","TransitionStart"),transitioncancel:Nl("Transition","TransitionCancel"),transitionend:Nl("Transition","TransitionEnd")},Ti={},vf={};Yt&&(vf=document.createElement("div").style,"AnimationEvent"in window||(delete ta.animationend.animation,delete ta.animationiteration.animation,delete ta.animationstart.animation),"TransitionEvent"in window||delete ta.transitionend.transition);function Cl(e){if(Ti[e])return Ti[e];if(!ta[e])return e;var t=ta[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in vf)return Ti[e]=t[l];return e}var gf=Cl("animationend"),pf=Cl("animationiteration"),bf=Cl("animationstart"),Fh=Cl("transitionrun"),Ih=Cl("transitionstart"),Ph=Cl("transitioncancel"),xf=Cl("transitionend"),Sf=new Map,Ei="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(" ");Ei.push("scrollEnd");function Nt(e,t){Sf.set(e,t),zl(t,[e])}var Ln=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)},St=[],la=0,Ai=0;function Zn(){for(var e=la,t=Ai=la=0;t<e;){var l=St[t];St[t++]=null;var a=St[t];St[t++]=null;var n=St[t];St[t++]=null;var u=St[t];if(St[t++]=null,a!==null&&n!==null){var c=a.pending;c===null?n.next=n:(n.next=c.next,c.next=n),a.pending=n}u!==0&&jf(l,n,u)}}function Vn(e,t,l,a){St[la++]=e,St[la++]=t,St[la++]=l,St[la++]=a,Ai|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function _i(e,t,l,a){return Vn(e,t,l,a),Kn(e)}function Dl(e,t){return Vn(e,null,null,t),Kn(e)}function jf(e,t,l){e.lanes|=l;var a=e.alternate;a!==null&&(a.lanes|=l);for(var n=!1,u=e.return;u!==null;)u.childLanes|=l,a=u.alternate,a!==null&&(a.childLanes|=l),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(n=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,n&&t!==null&&(n=31-rt(l),e=u.hiddenUpdates,a=e[n],a===null?e[n]=[t]:a.push(t),t.lane=l|536870912),u):null}function Kn(e){if(50<dn)throw dn=0,qc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var aa={};function em(e,t,l,a){this.tag=e,this.key=l,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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ht(e,t,l,a){return new em(e,t,l,a)}function zi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Gt(e,t){var l=e.alternate;return l===null?(l=ht(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Tf(e,t){e.flags&=65011714;var l=e.alternate;return l===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=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Jn(e,t,l,a,n,u){var c=0;if(a=e,typeof e=="function")zi(e)&&(c=1);else if(typeof e=="string")c=uy(e,l,X.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case je:return e=ht(31,l,t,n),e.elementType=je,e.lanes=u,e;case Z:return Ml(l.children,n,u,t);case W:c=8,n|=24;break;case ae:return e=ht(12,l,t,n|2),e.elementType=ae,e.lanes=u,e;case xe:return e=ht(13,l,t,n),e.elementType=xe,e.lanes=u,e;case k:return e=ht(19,l,t,n),e.elementType=k,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case le:c=10;break e;case $:c=9;break e;case ne:c=11;break e;case V:c=14;break e;case Se:c=16,a=null;break e}c=29,l=Error(o(130,e===null?"null":typeof e,"")),a=null}return t=ht(c,l,t,n),t.elementType=e,t.type=a,t.lanes=u,t}function Ml(e,t,l,a){return e=ht(7,e,a,t),e.lanes=l,e}function Oi(e,t,l){return e=ht(6,e,null,t),e.lanes=l,e}function Ef(e){var t=ht(18,null,null,0);return t.stateNode=e,t}function Ni(e,t,l){return t=ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Af=new WeakMap;function jt(e,t){if(typeof e=="object"&&e!==null){var l=Af.get(e);return l!==void 0?l:(t={value:e,source:t,stack:Ts(t)},Af.set(e,t),t)}return{value:e,source:t,stack:Ts(t)}}var na=[],ua=0,kn=null,Za=0,Tt=[],Et=0,al=null,Mt=1,Rt="";function wt(e,t){na[ua++]=Za,na[ua++]=kn,kn=e,Za=t}function _f(e,t,l){Tt[Et++]=Mt,Tt[Et++]=Rt,Tt[Et++]=al,al=e;var a=Mt;e=Rt;var n=32-rt(a)-1;a&=~(1<<n),l+=1;var u=32-rt(t)+n;if(30<u){var c=n-n%5;u=(a&(1<<c)-1).toString(32),a>>=c,n-=c,Mt=1<<32-rt(t)+n|l<<n|a,Rt=u+e}else Mt=1<<u|l<<n|a,Rt=e}function Ci(e){e.return!==null&&(wt(e,1),_f(e,1,0))}function Di(e){for(;e===kn;)kn=na[--ua],na[ua]=null,Za=na[--ua],na[ua]=null;for(;e===al;)al=Tt[--Et],Tt[Et]=null,Rt=Tt[--Et],Tt[Et]=null,Mt=Tt[--Et],Tt[Et]=null}function zf(e,t){Tt[Et++]=Mt,Tt[Et++]=Rt,Tt[Et++]=al,Mt=t.id,Rt=t.overflow,al=e}var We=null,De=null,re=!1,nl=null,At=!1,Mi=Error(o(519));function ul(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Va(jt(t,e)),Mi}function Of(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[ke]=e,t[lt]=a,l){case"dialog":ce("cancel",t),ce("close",t);break;case"iframe":case"object":case"embed":ce("load",t);break;case"video":case"audio":for(l=0;l<mn.length;l++)ce(mn[l],t);break;case"source":ce("error",t);break;case"img":case"image":case"link":ce("error",t),ce("load",t);break;case"details":ce("toggle",t);break;case"input":ce("invalid",t),ws(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":ce("invalid",t);break;case"textarea":ce("invalid",t),Qs(t,a.value,a.defaultValue,a.children)}l=a.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||a.suppressHydrationWarning===!0||Kr(t.textContent,l)?(a.popover!=null&&(ce("beforetoggle",t),ce("toggle",t)),a.onScroll!=null&&ce("scroll",t),a.onScrollEnd!=null&&ce("scrollend",t),a.onClick!=null&&(t.onclick=Bt),t=!0):t=!1,t||ul(e,!0)}function Nf(e){for(We=e.return;We;)switch(We.tag){case 5:case 31:case 13:At=!1;return;case 27:case 3:At=!0;return;default:We=We.return}}function ia(e){if(e!==We)return!1;if(!re)return Nf(e),re=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||$c(e.type,e.memoizedProps)),l=!l),l&&De&&ul(e),Nf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));De=td(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));De=td(e)}else t===27?(t=De,bl(e.type)?(e=ts,ts=null,De=e):De=t):De=We?zt(e.stateNode.nextSibling):null;return!0}function Rl(){De=We=null,re=!1}function Ri(){var e=nl;return e!==null&&(ct===null?ct=e:ct.push.apply(ct,e),nl=null),e}function Va(e){nl===null?nl=[e]:nl.push(e)}var Ui=m(null),Ul=null,Xt=null;function il(e,t,l){B(Ui,t._currentValue),t._currentValue=l}function Qt(e){e._currentValue=Ui.current,M(Ui)}function qi(e,t,l){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===l)break;e=e.return}}function Hi(e,t,l,a){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var u=n.dependencies;if(u!==null){var c=n.child;u=u.firstContext;e:for(;u!==null;){var f=u;u=n;for(var r=0;r<t.length;r++)if(f.context===t[r]){u.lanes|=l,f=u.alternate,f!==null&&(f.lanes|=l),qi(u.return,l,e),a||(c=null);break e}u=f.next}}else if(n.tag===18){if(c=n.return,c===null)throw Error(o(341));c.lanes|=l,u=c.alternate,u!==null&&(u.lanes|=l),qi(c,l,e),c=null}else c=n.child;if(c!==null)c.return=n;else for(c=n;c!==null;){if(c===e){c=null;break}if(n=c.sibling,n!==null){n.return=c.return,c=n;break}c=c.return}n=c}}function ca(e,t,l,a){e=null;for(var n=t,u=!1;n!==null;){if(!u){if((n.flags&524288)!==0)u=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var c=n.alternate;if(c===null)throw Error(o(387));if(c=c.memoizedProps,c!==null){var f=n.type;dt(n.pendingProps.value,c.value)||(e!==null?e.push(f):e=[f])}}else if(n===ve.current){if(c=n.alternate,c===null)throw Error(o(387));c.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(bn):e=[bn])}n=n.return}e!==null&&Hi(t,e,l,a),t.flags|=262144}function Wn(e){for(e=e.firstContext;e!==null;){if(!dt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ql(e){Ul=e,Xt=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $e(e){return Cf(Ul,e)}function $n(e,t){return Ul===null&&ql(e),Cf(e,t)}function Cf(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},Xt===null){if(e===null)throw Error(o(308));Xt=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xt=Xt.next=t;return l}var tm=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},lm=s.unstable_scheduleCallback,am=s.unstable_NormalPriority,we={$$typeof:le,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bi(){return{controller:new tm,data:new Map,refCount:0}}function Ka(e){e.refCount--,e.refCount===0&&lm(am,function(){e.controller.abort()})}var Ja=null,Yi=0,sa=0,fa=null;function nm(e,t){if(Ja===null){var l=Ja=[];Yi=0,sa=Xc(),fa={status:"pending",value:void 0,then:function(a){l.push(a)}}}return Yi++,t.then(Df,Df),t}function Df(){if(--Yi===0&&Ja!==null){fa!==null&&(fa.status="fulfilled");var e=Ja;Ja=null,sa=0,fa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function um(e,t){var l=[],a={status:"pending",value:null,reason:null,then:function(n){l.push(n)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var n=0;n<l.length;n++)(0,l[n])(t)},function(n){for(a.status="rejected",a.reason=n,n=0;n<l.length;n++)(0,l[n])(void 0)}),a}var Mf=j.S;j.S=function(e,t){vr=ft(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&nm(e,t),Mf!==null&&Mf(e,t)};var Hl=m(null);function Gi(){var e=Hl.current;return e!==null?e:Oe.pooledCache}function Fn(e,t){t===null?B(Hl,Hl.current):B(Hl,t.pool)}function Rf(){var e=Gi();return e===null?null:{parent:we._currentValue,pool:e}}var oa=Error(o(460)),wi=Error(o(474)),In=Error(o(542)),Pn={then:function(){}};function Uf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function qf(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(Bt,Bt),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bf(e),e;default:if(typeof t.status=="string")t.then(Bt,Bt);else{if(e=Oe,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=a}},function(a){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bf(e),e}throw Yl=t,oa}}function Bl(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Yl=l,oa):l}}var Yl=null;function Hf(){if(Yl===null)throw Error(o(459));var e=Yl;return Yl=null,e}function Bf(e){if(e===oa||e===In)throw Error(o(483))}var ra=null,ka=0;function eu(e){var t=ka;return ka+=1,ra===null&&(ra=[]),qf(ra,e,t)}function Wa(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function tu(e,t){throw t.$$typeof===R?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Yf(e){function t(y,h){if(e){var v=y.deletions;v===null?(y.deletions=[h],y.flags|=16):v.push(h)}}function l(y,h){if(!e)return null;for(;h!==null;)t(y,h),h=h.sibling;return null}function a(y){for(var h=new Map;y!==null;)y.key!==null?h.set(y.key,y):h.set(y.index,y),y=y.sibling;return h}function n(y,h){return y=Gt(y,h),y.index=0,y.sibling=null,y}function u(y,h,v){return y.index=v,e?(v=y.alternate,v!==null?(v=v.index,v<h?(y.flags|=67108866,h):v):(y.flags|=67108866,h)):(y.flags|=1048576,h)}function c(y){return e&&y.alternate===null&&(y.flags|=67108866),y}function f(y,h,v,z){return h===null||h.tag!==6?(h=Oi(v,y.mode,z),h.return=y,h):(h=n(h,v),h.return=y,h)}function r(y,h,v,z){var K=v.type;return K===Z?T(y,h,v.props.children,z,v.key):h!==null&&(h.elementType===K||typeof K=="object"&&K!==null&&K.$$typeof===Se&&Bl(K)===h.type)?(h=n(h,v.props),Wa(h,v),h.return=y,h):(h=Jn(v.type,v.key,v.props,null,y.mode,z),Wa(h,v),h.return=y,h)}function g(y,h,v,z){return h===null||h.tag!==4||h.stateNode.containerInfo!==v.containerInfo||h.stateNode.implementation!==v.implementation?(h=Ni(v,y.mode,z),h.return=y,h):(h=n(h,v.children||[]),h.return=y,h)}function T(y,h,v,z,K){return h===null||h.tag!==7?(h=Ml(v,y.mode,z,K),h.return=y,h):(h=n(h,v),h.return=y,h)}function C(y,h,v){if(typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint")return h=Oi(""+h,y.mode,v),h.return=y,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Q:return v=Jn(h.type,h.key,h.props,null,y.mode,v),Wa(v,h),v.return=y,v;case G:return h=Ni(h,y.mode,v),h.return=y,h;case Se:return h=Bl(h),C(y,h,v)}if(Ze(h)||de(h))return h=Ml(h,y.mode,v,null),h.return=y,h;if(typeof h.then=="function")return C(y,eu(h),v);if(h.$$typeof===le)return C(y,$n(y,h),v);tu(y,h)}return null}function p(y,h,v,z){var K=h!==null?h.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return K!==null?null:f(y,h,""+v,z);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Q:return v.key===K?r(y,h,v,z):null;case G:return v.key===K?g(y,h,v,z):null;case Se:return v=Bl(v),p(y,h,v,z)}if(Ze(v)||de(v))return K!==null?null:T(y,h,v,z,null);if(typeof v.then=="function")return p(y,h,eu(v),z);if(v.$$typeof===le)return p(y,h,$n(y,v),z);tu(y,v)}return null}function S(y,h,v,z,K){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return y=y.get(v)||null,f(h,y,""+z,K);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case Q:return y=y.get(z.key===null?v:z.key)||null,r(h,y,z,K);case G:return y=y.get(z.key===null?v:z.key)||null,g(h,y,z,K);case Se:return z=Bl(z),S(y,h,v,z,K)}if(Ze(z)||de(z))return y=y.get(v)||null,T(h,y,z,K,null);if(typeof z.then=="function")return S(y,h,v,eu(z),K);if(z.$$typeof===le)return S(y,h,v,$n(h,z),K);tu(h,z)}return null}function w(y,h,v,z){for(var K=null,he=null,L=h,te=h=0,oe=null;L!==null&&te<v.length;te++){L.index>te?(oe=L,L=null):oe=L.sibling;var me=p(y,L,v[te],z);if(me===null){L===null&&(L=oe);break}e&&L&&me.alternate===null&&t(y,L),h=u(me,h,te),he===null?K=me:he.sibling=me,he=me,L=oe}if(te===v.length)return l(y,L),re&&wt(y,te),K;if(L===null){for(;te<v.length;te++)L=C(y,v[te],z),L!==null&&(h=u(L,h,te),he===null?K=L:he.sibling=L,he=L);return re&&wt(y,te),K}for(L=a(L);te<v.length;te++)oe=S(L,y,te,v[te],z),oe!==null&&(e&&oe.alternate!==null&&L.delete(oe.key===null?te:oe.key),h=u(oe,h,te),he===null?K=oe:he.sibling=oe,he=oe);return e&&L.forEach(function(El){return t(y,El)}),re&&wt(y,te),K}function J(y,h,v,z){if(v==null)throw Error(o(151));for(var K=null,he=null,L=h,te=h=0,oe=null,me=v.next();L!==null&&!me.done;te++,me=v.next()){L.index>te?(oe=L,L=null):oe=L.sibling;var El=p(y,L,me.value,z);if(El===null){L===null&&(L=oe);break}e&&L&&El.alternate===null&&t(y,L),h=u(El,h,te),he===null?K=El:he.sibling=El,he=El,L=oe}if(me.done)return l(y,L),re&&wt(y,te),K;if(L===null){for(;!me.done;te++,me=v.next())me=C(y,me.value,z),me!==null&&(h=u(me,h,te),he===null?K=me:he.sibling=me,he=me);return re&&wt(y,te),K}for(L=a(L);!me.done;te++,me=v.next())me=S(L,y,te,me.value,z),me!==null&&(e&&me.alternate!==null&&L.delete(me.key===null?te:me.key),h=u(me,h,te),he===null?K=me:he.sibling=me,he=me);return e&&L.forEach(function(vy){return t(y,vy)}),re&&wt(y,te),K}function _e(y,h,v,z){if(typeof v=="object"&&v!==null&&v.type===Z&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Q:e:{for(var K=v.key;h!==null;){if(h.key===K){if(K=v.type,K===Z){if(h.tag===7){l(y,h.sibling),z=n(h,v.props.children),z.return=y,y=z;break e}}else if(h.elementType===K||typeof K=="object"&&K!==null&&K.$$typeof===Se&&Bl(K)===h.type){l(y,h.sibling),z=n(h,v.props),Wa(z,v),z.return=y,y=z;break e}l(y,h);break}else t(y,h);h=h.sibling}v.type===Z?(z=Ml(v.props.children,y.mode,z,v.key),z.return=y,y=z):(z=Jn(v.type,v.key,v.props,null,y.mode,z),Wa(z,v),z.return=y,y=z)}return c(y);case G:e:{for(K=v.key;h!==null;){if(h.key===K)if(h.tag===4&&h.stateNode.containerInfo===v.containerInfo&&h.stateNode.implementation===v.implementation){l(y,h.sibling),z=n(h,v.children||[]),z.return=y,y=z;break e}else{l(y,h);break}else t(y,h);h=h.sibling}z=Ni(v,y.mode,z),z.return=y,y=z}return c(y);case Se:return v=Bl(v),_e(y,h,v,z)}if(Ze(v))return w(y,h,v,z);if(de(v)){if(K=de(v),typeof K!="function")throw Error(o(150));return v=K.call(v),J(y,h,v,z)}if(typeof v.then=="function")return _e(y,h,eu(v),z);if(v.$$typeof===le)return _e(y,h,$n(y,v),z);tu(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,h!==null&&h.tag===6?(l(y,h.sibling),z=n(h,v),z.return=y,y=z):(l(y,h),z=Oi(v,y.mode,z),z.return=y,y=z),c(y)):l(y,h)}return function(y,h,v,z){try{ka=0;var K=_e(y,h,v,z);return ra=null,K}catch(L){if(L===oa||L===In)throw L;var he=ht(29,L,null,y.mode);return he.lanes=z,he.return=y,he}finally{}}}var Gl=Yf(!0),Gf=Yf(!1),cl=!1;function Xi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qi(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 sl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function fl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ye&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=Kn(e),jf(e,null,l),t}return Vn(e,a,t,l),Kn(e)}function $a(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Ns(e,l)}}function Li(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,u=null;if(l=l.firstBaseUpdate,l!==null){do{var c={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};u===null?n=u=c:u=u.next=c,l=l.next}while(l!==null);u===null?n=u=t:u=u.next=t}else n=u=t;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Zi=!1;function Fa(){if(Zi){var e=fa;if(e!==null)throw e}}function Ia(e,t,l,a){Zi=!1;var n=e.updateQueue;cl=!1;var u=n.firstBaseUpdate,c=n.lastBaseUpdate,f=n.shared.pending;if(f!==null){n.shared.pending=null;var r=f,g=r.next;r.next=null,c===null?u=g:c.next=g,c=r;var T=e.alternate;T!==null&&(T=T.updateQueue,f=T.lastBaseUpdate,f!==c&&(f===null?T.firstBaseUpdate=g:f.next=g,T.lastBaseUpdate=r))}if(u!==null){var C=n.baseState;c=0,T=g=r=null,f=u;do{var p=f.lane&-536870913,S=p!==f.lane;if(S?(fe&p)===p:(a&p)===p){p!==0&&p===sa&&(Zi=!0),T!==null&&(T=T.next={lane:0,tag:f.tag,payload:f.payload,callback:null,next:null});e:{var w=e,J=f;p=t;var _e=l;switch(J.tag){case 1:if(w=J.payload,typeof w=="function"){C=w.call(_e,C,p);break e}C=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=J.payload,p=typeof w=="function"?w.call(_e,C,p):w,p==null)break e;C=O({},C,p);break e;case 2:cl=!0}}p=f.callback,p!==null&&(e.flags|=64,S&&(e.flags|=8192),S=n.callbacks,S===null?n.callbacks=[p]:S.push(p))}else S={lane:p,tag:f.tag,payload:f.payload,callback:f.callback,next:null},T===null?(g=T=S,r=C):T=T.next=S,c|=p;if(f=f.next,f===null){if(f=n.shared.pending,f===null)break;S=f,f=S.next,S.next=null,n.lastBaseUpdate=S,n.shared.pending=null}}while(!0);T===null&&(r=C),n.baseState=r,n.firstBaseUpdate=g,n.lastBaseUpdate=T,u===null&&(n.shared.lanes=0),ml|=c,e.lanes=c,e.memoizedState=C}}function wf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Xf(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)wf(l[e],t)}var da=m(null),lu=m(0);function Qf(e,t){e=Ft,B(lu,e),B(da,t),Ft=e|t.baseLanes}function Vi(){B(lu,Ft),B(da,da.current)}function Ki(){Ft=lu.current,M(da),M(lu)}var mt=m(null),_t=null;function ol(e){var t=e.alternate;B(Be,Be.current&1),B(mt,e),_t===null&&(t===null||da.current!==null||t.memoizedState!==null)&&(_t=e)}function Ji(e){B(Be,Be.current),B(mt,e),_t===null&&(_t=e)}function Lf(e){e.tag===22?(B(Be,Be.current),B(mt,e),_t===null&&(_t=e)):rl()}function rl(){B(Be,Be.current),B(mt,mt.current)}function yt(e){M(mt),_t===e&&(_t=null),M(Be)}var Be=m(0);function au(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Pc(l)||es(l)))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 Lt=0,ee=null,Ee=null,Xe=null,nu=!1,ha=!1,wl=!1,uu=0,Pa=0,ma=null,im=0;function Ue(){throw Error(o(321))}function ki(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!dt(e[l],t[l]))return!1;return!0}function Wi(e,t,l,a,n,u){return Lt=u,ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?zo:oc,wl=!1,u=l(a,n),wl=!1,ha&&(u=Vf(t,l,a,n)),Zf(e),u}function Zf(e){j.H=ln;var t=Ee!==null&&Ee.next!==null;if(Lt=0,Xe=Ee=ee=null,nu=!1,Pa=0,ma=null,t)throw Error(o(300));e===null||Qe||(e=e.dependencies,e!==null&&Wn(e)&&(Qe=!0))}function Vf(e,t,l,a){ee=e;var n=0;do{if(ha&&(ma=null),Pa=0,ha=!1,25<=n)throw Error(o(301));if(n+=1,Xe=Ee=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}j.H=Oo,u=t(l,a)}while(ha);return u}function cm(){var e=j.H,t=e.useState()[0];return t=typeof t.then=="function"?en(t):t,e=e.useState()[0],(Ee!==null?Ee.memoizedState:null)!==e&&(ee.flags|=1024),t}function $i(){var e=uu!==0;return uu=0,e}function Fi(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function Ii(e){if(nu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}nu=!1}Lt=0,Xe=Ee=ee=null,ha=!1,Pa=uu=0,ma=null}function tt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?ee.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Ye(){if(Ee===null){var e=ee.alternate;e=e!==null?e.memoizedState:null}else e=Ee.next;var t=Xe===null?ee.memoizedState:Xe.next;if(t!==null)Xe=t,Ee=e;else{if(e===null)throw ee.alternate===null?Error(o(467)):Error(o(310));Ee=e,e={memoizedState:Ee.memoizedState,baseState:Ee.baseState,baseQueue:Ee.baseQueue,queue:Ee.queue,next:null},Xe===null?ee.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function iu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function en(e){var t=Pa;return Pa+=1,ma===null&&(ma=[]),e=qf(ma,e,t),t=ee,(Xe===null?t.memoizedState:Xe.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?zo:oc),e}function cu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return en(e);if(e.$$typeof===le)return $e(e)}throw Error(o(438,String(e)))}function Pi(e){var t=null,l=ee.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=ee.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=iu(),ee.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),a=0;a<e;a++)l[a]=se;return t.index++,l}function Zt(e,t){return typeof t=="function"?t(e):t}function su(e){var t=Ye();return ec(t,Ee,e)}function ec(e,t,l){var a=e.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=l;var n=e.baseQueue,u=a.pending;if(u!==null){if(n!==null){var c=n.next;n.next=u.next,u.next=c}t.baseQueue=n=u,a.pending=null}if(u=e.baseState,n===null)e.memoizedState=u;else{t=n.next;var f=c=null,r=null,g=t,T=!1;do{var C=g.lane&-536870913;if(C!==g.lane?(fe&C)===C:(Lt&C)===C){var p=g.revertLane;if(p===0)r!==null&&(r=r.next={lane:0,revertLane:0,gesture:null,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null}),C===sa&&(T=!0);else if((Lt&p)===p){g=g.next,p===sa&&(T=!0);continue}else C={lane:0,revertLane:g.revertLane,gesture:null,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null},r===null?(f=r=C,c=u):r=r.next=C,ee.lanes|=p,ml|=p;C=g.action,wl&&l(u,C),u=g.hasEagerState?g.eagerState:l(u,C)}else p={lane:C,revertLane:g.revertLane,gesture:g.gesture,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null},r===null?(f=r=p,c=u):r=r.next=p,ee.lanes|=C,ml|=C;g=g.next}while(g!==null&&g!==t);if(r===null?c=u:r.next=f,!dt(u,e.memoizedState)&&(Qe=!0,T&&(l=fa,l!==null)))throw l;e.memoizedState=u,e.baseState=c,e.baseQueue=r,a.lastRenderedState=u}return n===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function tc(e){var t=Ye(),l=t.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=e;var a=l.dispatch,n=l.pending,u=t.memoizedState;if(n!==null){l.pending=null;var c=n=n.next;do u=e(u,c.action),c=c.next;while(c!==n);dt(u,t.memoizedState)||(Qe=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),l.lastRenderedState=u}return[u,a]}function Kf(e,t,l){var a=ee,n=Ye(),u=re;if(u){if(l===void 0)throw Error(o(407));l=l()}else l=t();var c=!dt((Ee||n).memoizedState,l);if(c&&(n.memoizedState=l,Qe=!0),n=n.queue,nc(Wf.bind(null,a,n,e),[e]),n.getSnapshot!==t||c||Xe!==null&&Xe.memoizedState.tag&1){if(a.flags|=2048,ya(9,{destroy:void 0},kf.bind(null,a,n,l,t),null),Oe===null)throw Error(o(349));u||(Lt&127)!==0||Jf(a,t,l)}return l}function Jf(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=ee.updateQueue,t===null?(t=iu(),ee.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function kf(e,t,l,a){t.value=l,t.getSnapshot=a,$f(t)&&Ff(e)}function Wf(e,t,l){return l(function(){$f(t)&&Ff(e)})}function $f(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!dt(e,l)}catch{return!0}}function Ff(e){var t=Dl(e,2);t!==null&&st(t,e,2)}function lc(e){var t=tt();if(typeof e=="function"){var l=e;if(e=l(),wl){el(!0);try{l()}finally{el(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:e},t}function If(e,t,l,a){return e.baseState=l,ec(e,Ee,typeof a=="function"?a:Zt)}function sm(e,t,l,a,n){if(ru(e))throw Error(o(485));if(e=t.action,e!==null){var u={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(c){u.listeners.push(c)}};j.T!==null?l(!0):u.isTransition=!1,a(u),l=t.pending,l===null?(u.next=t.pending=u,Pf(t,u)):(u.next=l.next,t.pending=l.next=u)}}function Pf(e,t){var l=t.action,a=t.payload,n=e.state;if(t.isTransition){var u=j.T,c={};j.T=c;try{var f=l(n,a),r=j.S;r!==null&&r(c,f),eo(e,t,f)}catch(g){ac(e,t,g)}finally{u!==null&&c.types!==null&&(u.types=c.types),j.T=u}}else try{u=l(n,a),eo(e,t,u)}catch(g){ac(e,t,g)}}function eo(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){to(e,t,a)},function(a){return ac(e,t,a)}):to(e,t,l)}function to(e,t,l){t.status="fulfilled",t.value=l,lo(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Pf(e,l)))}function ac(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,lo(t),t=t.next;while(t!==a)}e.action=null}function lo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ao(e,t){return t}function no(e,t){if(re){var l=Oe.formState;if(l!==null){e:{var a=ee;if(re){if(De){t:{for(var n=De,u=At;n.nodeType!==8;){if(!u){n=null;break t}if(n=zt(n.nextSibling),n===null){n=null;break t}}u=n.data,n=u==="F!"||u==="F"?n:null}if(n){De=zt(n.nextSibling),a=n.data==="F!";break e}}ul(a)}a=!1}a&&(t=l[0])}}return l=tt(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ao,lastRenderedState:t},l.queue=a,l=Eo.bind(null,ee,a),a.dispatch=l,a=lc(!1),u=fc.bind(null,ee,!1,a.queue),a=tt(),n={state:t,dispatch:null,action:e,pending:null},a.queue=n,l=sm.bind(null,ee,n,u,l),n.dispatch=l,a.memoizedState=e,[t,l,!1]}function uo(e){var t=Ye();return io(t,Ee,e)}function io(e,t,l){if(t=ec(e,t,ao)[0],e=su(Zt)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=en(t)}catch(c){throw c===oa?In:c}else a=t;t=Ye();var n=t.queue,u=n.dispatch;return l!==t.memoizedState&&(ee.flags|=2048,ya(9,{destroy:void 0},fm.bind(null,n,l),null)),[a,u,e]}function fm(e,t){e.action=t}function co(e){var t=Ye(),l=Ee;if(l!==null)return io(t,l,e);Ye(),t=t.memoizedState,l=Ye();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function ya(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=ee.updateQueue,t===null&&(t=iu(),ee.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(a=l.next,l.next=e,e.next=a,t.lastEffect=e),e}function so(){return Ye().memoizedState}function fu(e,t,l,a){var n=tt();ee.flags|=e,n.memoizedState=ya(1|t,{destroy:void 0},l,a===void 0?null:a)}function ou(e,t,l,a){var n=Ye();a=a===void 0?null:a;var u=n.memoizedState.inst;Ee!==null&&a!==null&&ki(a,Ee.memoizedState.deps)?n.memoizedState=ya(t,u,l,a):(ee.flags|=e,n.memoizedState=ya(1|t,u,l,a))}function fo(e,t){fu(8390656,8,e,t)}function nc(e,t){ou(2048,8,e,t)}function om(e){ee.flags|=4;var t=ee.updateQueue;if(t===null)t=iu(),ee.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function oo(e){var t=Ye().memoizedState;return om({ref:t,nextImpl:e}),function(){if((ye&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function ro(e,t){return ou(4,2,e,t)}function ho(e,t){return ou(4,4,e,t)}function mo(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function yo(e,t,l){l=l!=null?l.concat([e]):null,ou(4,4,mo.bind(null,t,e),l)}function uc(){}function vo(e,t){var l=Ye();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&ki(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function go(e,t){var l=Ye();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&ki(t,a[1]))return a[0];if(a=e(),wl){el(!0);try{e()}finally{el(!1)}}return l.memoizedState=[a,t],a}function ic(e,t,l){return l===void 0||(Lt&1073741824)!==0&&(fe&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=pr(),ee.lanes|=e,ml|=e,l)}function po(e,t,l,a){return dt(l,t)?l:da.current!==null?(e=ic(e,l,a),dt(e,t)||(Qe=!0),e):(Lt&42)===0||(Lt&1073741824)!==0&&(fe&261930)===0?(Qe=!0,e.memoizedState=l):(e=pr(),ee.lanes|=e,ml|=e,t)}function bo(e,t,l,a,n){var u=N.p;N.p=u!==0&&8>u?u:8;var c=j.T,f={};j.T=f,fc(e,!1,t,l);try{var r=n(),g=j.S;if(g!==null&&g(f,r),r!==null&&typeof r=="object"&&typeof r.then=="function"){var T=um(r,a);tn(e,t,T,pt(e))}else tn(e,t,a,pt(e))}catch(C){tn(e,t,{then:function(){},status:"rejected",reason:C},pt())}finally{N.p=u,c!==null&&f.types!==null&&(c.types=f.types),j.T=c}}function rm(){}function cc(e,t,l,a){if(e.tag!==5)throw Error(o(476));var n=xo(e).queue;bo(e,n,t,Y,l===null?rm:function(){return So(e),l(a)})}function xo(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:Y},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function So(e){var t=xo(e);t.next===null&&(t=e.alternate.memoizedState),tn(e,t.next.queue,{},pt())}function sc(){return $e(bn)}function jo(){return Ye().memoizedState}function To(){return Ye().memoizedState}function dm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=pt();e=sl(l);var a=fl(t,e,l);a!==null&&(st(a,t,l),$a(a,t,l)),t={cache:Bi()},e.payload=t;return}t=t.return}}function hm(e,t,l){var a=pt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ru(e)?Ao(t,l):(l=_i(e,t,l,a),l!==null&&(st(l,e,a),_o(l,t,a)))}function Eo(e,t,l){var a=pt();tn(e,t,l,a)}function tn(e,t,l,a){var n={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ru(e))Ao(t,n);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var c=t.lastRenderedState,f=u(c,l);if(n.hasEagerState=!0,n.eagerState=f,dt(f,c))return Vn(e,t,n,0),Oe===null&&Zn(),!1}catch{}finally{}if(l=_i(e,t,n,a),l!==null)return st(l,e,a),_o(l,t,a),!0}return!1}function fc(e,t,l,a){if(a={lane:2,revertLane:Xc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ru(e)){if(t)throw Error(o(479))}else t=_i(e,l,a,2),t!==null&&st(t,e,2)}function ru(e){var t=e.alternate;return e===ee||t!==null&&t===ee}function Ao(e,t){ha=nu=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function _o(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Ns(e,l)}}var ln={readContext:$e,use:cu,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useLayoutEffect:Ue,useInsertionEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useSyncExternalStore:Ue,useId:Ue,useHostTransitionStatus:Ue,useFormState:Ue,useActionState:Ue,useOptimistic:Ue,useMemoCache:Ue,useCacheRefresh:Ue};ln.useEffectEvent=Ue;var zo={readContext:$e,use:cu,useCallback:function(e,t){return tt().memoizedState=[e,t===void 0?null:t],e},useContext:$e,useEffect:fo,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,fu(4194308,4,mo.bind(null,t,e),l)},useLayoutEffect:function(e,t){return fu(4194308,4,e,t)},useInsertionEffect:function(e,t){fu(4,2,e,t)},useMemo:function(e,t){var l=tt();t=t===void 0?null:t;var a=e();if(wl){el(!0);try{e()}finally{el(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=tt();if(l!==void 0){var n=l(t);if(wl){el(!0);try{l(t)}finally{el(!1)}}}else n=t;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=hm.bind(null,ee,e),[a.memoizedState,e]},useRef:function(e){var t=tt();return e={current:e},t.memoizedState=e},useState:function(e){e=lc(e);var t=e.queue,l=Eo.bind(null,ee,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:uc,useDeferredValue:function(e,t){var l=tt();return ic(l,e,t)},useTransition:function(){var e=lc(!1);return e=bo.bind(null,ee,e.queue,!0,!1),tt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=ee,n=tt();if(re){if(l===void 0)throw Error(o(407));l=l()}else{if(l=t(),Oe===null)throw Error(o(349));(fe&127)!==0||Jf(a,t,l)}n.memoizedState=l;var u={value:l,getSnapshot:t};return n.queue=u,fo(Wf.bind(null,a,u,e),[e]),a.flags|=2048,ya(9,{destroy:void 0},kf.bind(null,a,u,l,t),null),l},useId:function(){var e=tt(),t=Oe.identifierPrefix;if(re){var l=Rt,a=Mt;l=(a&~(1<<32-rt(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=uu++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=im++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:sc,useFormState:no,useActionState:no,useOptimistic:function(e){var t=tt();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=fc.bind(null,ee,!0,l),l.dispatch=t,[e,t]},useMemoCache:Pi,useCacheRefresh:function(){return tt().memoizedState=dm.bind(null,ee)},useEffectEvent:function(e){var t=tt(),l={impl:e};return t.memoizedState=l,function(){if((ye&2)!==0)throw Error(o(440));return l.impl.apply(void 0,arguments)}}},oc={readContext:$e,use:cu,useCallback:vo,useContext:$e,useEffect:nc,useImperativeHandle:yo,useInsertionEffect:ro,useLayoutEffect:ho,useMemo:go,useReducer:su,useRef:so,useState:function(){return su(Zt)},useDebugValue:uc,useDeferredValue:function(e,t){var l=Ye();return po(l,Ee.memoizedState,e,t)},useTransition:function(){var e=su(Zt)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:en(e),t]},useSyncExternalStore:Kf,useId:jo,useHostTransitionStatus:sc,useFormState:uo,useActionState:uo,useOptimistic:function(e,t){var l=Ye();return If(l,Ee,e,t)},useMemoCache:Pi,useCacheRefresh:To};oc.useEffectEvent=oo;var Oo={readContext:$e,use:cu,useCallback:vo,useContext:$e,useEffect:nc,useImperativeHandle:yo,useInsertionEffect:ro,useLayoutEffect:ho,useMemo:go,useReducer:tc,useRef:so,useState:function(){return tc(Zt)},useDebugValue:uc,useDeferredValue:function(e,t){var l=Ye();return Ee===null?ic(l,e,t):po(l,Ee.memoizedState,e,t)},useTransition:function(){var e=tc(Zt)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:en(e),t]},useSyncExternalStore:Kf,useId:jo,useHostTransitionStatus:sc,useFormState:co,useActionState:co,useOptimistic:function(e,t){var l=Ye();return Ee!==null?If(l,Ee,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Pi,useCacheRefresh:To};Oo.useEffectEvent=oo;function rc(e,t,l,a){t=e.memoizedState,l=l(a,t),l=l==null?t:O({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var dc={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=pt(),n=sl(a);n.payload=t,l!=null&&(n.callback=l),t=fl(e,n,a),t!==null&&(st(t,e,a),$a(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=pt(),n=sl(a);n.tag=1,n.payload=t,l!=null&&(n.callback=l),t=fl(e,n,a),t!==null&&(st(t,e,a),$a(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=pt(),a=sl(l);a.tag=2,t!=null&&(a.callback=t),t=fl(e,a,l),t!==null&&(st(t,e,l),$a(t,e,l))}};function No(e,t,l,a,n,u,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,u,c):t.prototype&&t.prototype.isPureReactComponent?!Qa(l,a)||!Qa(n,u):!0}function Co(e,t,l,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,a),t.state!==e&&dc.enqueueReplaceState(t,t.state,null)}function Xl(e,t){var l=t;if("ref"in t){l={};for(var a in t)a!=="ref"&&(l[a]=t[a])}if(e=e.defaultProps){l===t&&(l=O({},l));for(var n in e)l[n]===void 0&&(l[n]=e[n])}return l}function Do(e){Ln(e)}function Mo(e){console.error(e)}function Ro(e){Ln(e)}function du(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Uo(e,t,l){try{var a=e.onCaughtError;a(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function hc(e,t,l){return l=sl(l),l.tag=3,l.payload={element:null},l.callback=function(){du(e,t)},l}function qo(e){return e=sl(e),e.tag=3,e}function Ho(e,t,l,a){var n=l.type.getDerivedStateFromError;if(typeof n=="function"){var u=a.value;e.payload=function(){return n(u)},e.callback=function(){Uo(t,l,a)}}var c=l.stateNode;c!==null&&typeof c.componentDidCatch=="function"&&(e.callback=function(){Uo(t,l,a),typeof n!="function"&&(yl===null?yl=new Set([this]):yl.add(this));var f=a.stack;this.componentDidCatch(a.value,{componentStack:f!==null?f:""})})}function mm(e,t,l,a,n){if(l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=l.alternate,t!==null&&ca(t,l,n,!0),l=mt.current,l!==null){switch(l.tag){case 31:case 13:return _t===null?Eu():l.alternate===null&&qe===0&&(qe=3),l.flags&=-257,l.flags|=65536,l.lanes=n,a===Pn?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),Yc(e,a,n)),!1;case 22:return l.flags|=65536,a===Pn?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([a]):l.add(a)),Yc(e,a,n)),!1}throw Error(o(435,l.tag))}return Yc(e,a,n),Eu(),!1}if(re)return t=mt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,a!==Mi&&(e=Error(o(422),{cause:a}),Va(jt(e,l)))):(a!==Mi&&(t=Error(o(423),{cause:a}),Va(jt(t,l))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,a=jt(a,l),n=hc(e.stateNode,a,n),Li(e,n),qe!==4&&(qe=2)),!1;var u=Error(o(520),{cause:a});if(u=jt(u,l),rn===null?rn=[u]:rn.push(u),qe!==4&&(qe=2),t===null)return!0;a=jt(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=n&-n,l.lanes|=e,e=hc(l.stateNode,a,e),Li(l,e),!1;case 1:if(t=l.type,u=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(yl===null||!yl.has(u))))return l.flags|=65536,n&=-n,l.lanes|=n,n=qo(n),Ho(n,e,l,a),Li(l,n),!1}l=l.return}while(l!==null);return!1}var mc=Error(o(461)),Qe=!1;function Fe(e,t,l,a){t.child=e===null?Gf(t,null,l,a):Gl(t,e.child,l,a)}function Bo(e,t,l,a,n){l=l.render;var u=t.ref;if("ref"in a){var c={};for(var f in a)f!=="ref"&&(c[f]=a[f])}else c=a;return ql(t),a=Wi(e,t,l,c,u,n),f=$i(),e!==null&&!Qe?(Fi(e,t,n),Vt(e,t,n)):(re&&f&&Ci(t),t.flags|=1,Fe(e,t,a,n),t.child)}function Yo(e,t,l,a,n){if(e===null){var u=l.type;return typeof u=="function"&&!zi(u)&&u.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=u,Go(e,t,u,a,n)):(e=Jn(l.type,null,a,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!jc(e,n)){var c=u.memoizedProps;if(l=l.compare,l=l!==null?l:Qa,l(c,a)&&e.ref===t.ref)return Vt(e,t,n)}return t.flags|=1,e=Gt(u,a),e.ref=t.ref,e.return=t,t.child=e}function Go(e,t,l,a,n){if(e!==null){var u=e.memoizedProps;if(Qa(u,a)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=a=u,jc(e,n))(e.flags&131072)!==0&&(Qe=!0);else return t.lanes=e.lanes,Vt(e,t,n)}return yc(e,t,l,a,n)}function wo(e,t,l,a){var n=a.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|l:l,e!==null){for(a=t.child=e.child,n=0;a!==null;)n=n|a.lanes|a.childLanes,a=a.sibling;a=n&~u}else a=0,t.child=null;return Xo(e,t,u,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fn(t,u!==null?u.cachePool:null),u!==null?Qf(t,u):Vi(),Lf(t);else return a=t.lanes=536870912,Xo(e,t,u!==null?u.baseLanes|l:l,l,a)}else u!==null?(Fn(t,u.cachePool),Qf(t,u),rl(),t.memoizedState=null):(e!==null&&Fn(t,null),Vi(),rl());return Fe(e,t,n,l),t.child}function an(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Xo(e,t,l,a,n){var u=Gi();return u=u===null?null:{parent:we._currentValue,pool:u},t.memoizedState={baseLanes:l,cachePool:u},e!==null&&Fn(t,null),Vi(),Lf(t),e!==null&&ca(e,t,a,!0),t.childLanes=n,null}function hu(e,t){return t=yu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Qo(e,t,l){return Gl(t,e.child,null,l),e=hu(t,t.pendingProps),e.flags|=2,yt(t),t.memoizedState=null,e}function ym(e,t,l){var a=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(re){if(a.mode==="hidden")return e=hu(t,a),t.lanes=536870912,an(null,e);if(Ji(t),(e=De)?(e=ed(e,At),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:al!==null?{id:Mt,overflow:Rt}:null,retryLane:536870912,hydrationErrors:null},l=Ef(e),l.return=t,t.child=l,We=t,De=null)):e=null,e===null)throw ul(t);return t.lanes=536870912,null}return hu(t,a)}var u=e.memoizedState;if(u!==null){var c=u.dehydrated;if(Ji(t),n)if(t.flags&256)t.flags&=-257,t=Qo(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Qe||ca(e,t,l,!1),n=(l&e.childLanes)!==0,Qe||n){if(a=Oe,a!==null&&(c=Cs(a,l),c!==0&&c!==u.retryLane))throw u.retryLane=c,Dl(e,c),st(a,e,c),mc;Eu(),t=Qo(e,t,l)}else e=u.treeContext,De=zt(c.nextSibling),We=t,re=!0,nl=null,At=!1,e!==null&&zf(t,e),t=hu(t,a),t.flags|=4096;return t}return e=Gt(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function mu(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(o(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function yc(e,t,l,a,n){return ql(t),l=Wi(e,t,l,a,void 0,n),a=$i(),e!==null&&!Qe?(Fi(e,t,n),Vt(e,t,n)):(re&&a&&Ci(t),t.flags|=1,Fe(e,t,l,n),t.child)}function Lo(e,t,l,a,n,u){return ql(t),t.updateQueue=null,l=Vf(t,a,l,n),Zf(e),a=$i(),e!==null&&!Qe?(Fi(e,t,u),Vt(e,t,u)):(re&&a&&Ci(t),t.flags|=1,Fe(e,t,l,u),t.child)}function Zo(e,t,l,a,n){if(ql(t),t.stateNode===null){var u=aa,c=l.contextType;typeof c=="object"&&c!==null&&(u=$e(c)),u=new l(a,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=dc,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=a,u.state=t.memoizedState,u.refs={},Xi(t),c=l.contextType,u.context=typeof c=="object"&&c!==null?$e(c):aa,u.state=t.memoizedState,c=l.getDerivedStateFromProps,typeof c=="function"&&(rc(t,l,c,a),u.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(c=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),c!==u.state&&dc.enqueueReplaceState(u,u.state,null),Ia(t,a,u,n),Fa(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){u=t.stateNode;var f=t.memoizedProps,r=Xl(l,f);u.props=r;var g=u.context,T=l.contextType;c=aa,typeof T=="object"&&T!==null&&(c=$e(T));var C=l.getDerivedStateFromProps;T=typeof C=="function"||typeof u.getSnapshotBeforeUpdate=="function",f=t.pendingProps!==f,T||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(f||g!==c)&&Co(t,u,a,c),cl=!1;var p=t.memoizedState;u.state=p,Ia(t,a,u,n),Fa(),g=t.memoizedState,f||p!==g||cl?(typeof C=="function"&&(rc(t,l,C,a),g=t.memoizedState),(r=cl||No(t,l,r,a,p,g,c))?(T||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=g),u.props=a,u.state=g,u.context=c,a=r):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{u=t.stateNode,Qi(e,t),c=t.memoizedProps,T=Xl(l,c),u.props=T,C=t.pendingProps,p=u.context,g=l.contextType,r=aa,typeof g=="object"&&g!==null&&(r=$e(g)),f=l.getDerivedStateFromProps,(g=typeof f=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(c!==C||p!==r)&&Co(t,u,a,r),cl=!1,p=t.memoizedState,u.state=p,Ia(t,a,u,n),Fa();var S=t.memoizedState;c!==C||p!==S||cl||e!==null&&e.dependencies!==null&&Wn(e.dependencies)?(typeof f=="function"&&(rc(t,l,f,a),S=t.memoizedState),(T=cl||No(t,l,T,a,p,S,r)||e!==null&&e.dependencies!==null&&Wn(e.dependencies))?(g||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(a,S,r),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(a,S,r)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=S),u.props=a,u.state=S,u.context=r,a=T):(typeof u.componentDidUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),a=!1)}return u=a,mu(e,t),a=(t.flags&128)!==0,u||a?(u=t.stateNode,l=a&&typeof l.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&a?(t.child=Gl(t,e.child,null,n),t.child=Gl(t,null,l,n)):Fe(e,t,l,n),t.memoizedState=u.state,e=t.child):e=Vt(e,t,n),e}function Vo(e,t,l,a){return Rl(),t.flags|=256,Fe(e,t,l,a),t.child}var vc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:Rf()}}function pc(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=gt),e}function Ko(e,t,l){var a=t.pendingProps,n=!1,u=(t.flags&128)!==0,c;if((c=u)||(c=e!==null&&e.memoizedState===null?!1:(Be.current&2)!==0),c&&(n=!0,t.flags&=-129),c=(t.flags&32)!==0,t.flags&=-33,e===null){if(re){if(n?ol(t):rl(),(e=De)?(e=ed(e,At),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:al!==null?{id:Mt,overflow:Rt}:null,retryLane:536870912,hydrationErrors:null},l=Ef(e),l.return=t,t.child=l,We=t,De=null)):e=null,e===null)throw ul(t);return es(e)?t.lanes=32:t.lanes=536870912,null}var f=a.children;return a=a.fallback,n?(rl(),n=t.mode,f=yu({mode:"hidden",children:f},n),a=Ml(a,n,l,null),f.return=t,a.return=t,f.sibling=a,t.child=f,a=t.child,a.memoizedState=gc(l),a.childLanes=pc(e,c,l),t.memoizedState=vc,an(null,a)):(ol(t),bc(t,f))}var r=e.memoizedState;if(r!==null&&(f=r.dehydrated,f!==null)){if(u)t.flags&256?(ol(t),t.flags&=-257,t=xc(e,t,l)):t.memoizedState!==null?(rl(),t.child=e.child,t.flags|=128,t=null):(rl(),f=a.fallback,n=t.mode,a=yu({mode:"visible",children:a.children},n),f=Ml(f,n,l,null),f.flags|=2,a.return=t,f.return=t,a.sibling=f,t.child=a,Gl(t,e.child,null,l),a=t.child,a.memoizedState=gc(l),a.childLanes=pc(e,c,l),t.memoizedState=vc,t=an(null,a));else if(ol(t),es(f)){if(c=f.nextSibling&&f.nextSibling.dataset,c)var g=c.dgst;c=g,a=Error(o(419)),a.stack="",a.digest=c,Va({value:a,source:null,stack:null}),t=xc(e,t,l)}else if(Qe||ca(e,t,l,!1),c=(l&e.childLanes)!==0,Qe||c){if(c=Oe,c!==null&&(a=Cs(c,l),a!==0&&a!==r.retryLane))throw r.retryLane=a,Dl(e,a),st(c,e,a),mc;Pc(f)||Eu(),t=xc(e,t,l)}else Pc(f)?(t.flags|=192,t.child=e.child,t=null):(e=r.treeContext,De=zt(f.nextSibling),We=t,re=!0,nl=null,At=!1,e!==null&&zf(t,e),t=bc(t,a.children),t.flags|=4096);return t}return n?(rl(),f=a.fallback,n=t.mode,r=e.child,g=r.sibling,a=Gt(r,{mode:"hidden",children:a.children}),a.subtreeFlags=r.subtreeFlags&65011712,g!==null?f=Gt(g,f):(f=Ml(f,n,l,null),f.flags|=2),f.return=t,a.return=t,a.sibling=f,t.child=a,an(null,a),a=t.child,f=e.child.memoizedState,f===null?f=gc(l):(n=f.cachePool,n!==null?(r=we._currentValue,n=n.parent!==r?{parent:r,pool:r}:n):n=Rf(),f={baseLanes:f.baseLanes|l,cachePool:n}),a.memoizedState=f,a.childLanes=pc(e,c,l),t.memoizedState=vc,an(e.child,a)):(ol(t),l=e.child,e=l.sibling,l=Gt(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(c=t.deletions,c===null?(t.deletions=[e],t.flags|=16):c.push(e)),t.child=l,t.memoizedState=null,l)}function bc(e,t){return t=yu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function yu(e,t){return e=ht(22,e,null,t),e.lanes=0,e}function xc(e,t,l){return Gl(t,e.child,null,l),e=bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Jo(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),qi(e.return,t,l)}function Sc(e,t,l,a,n,u){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:n,treeForkCount:u}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=a,c.tail=l,c.tailMode=n,c.treeForkCount=u)}function ko(e,t,l){var a=t.pendingProps,n=a.revealOrder,u=a.tail;a=a.children;var c=Be.current,f=(c&2)!==0;if(f?(c=c&1|2,t.flags|=128):c&=1,B(Be,c),Fe(e,t,a,l),a=re?Za:0,!f&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Jo(e,l,t);else if(e.tag===19)Jo(e,l,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(n){case"forwards":for(l=t.child,n=null;l!==null;)e=l.alternate,e!==null&&au(e)===null&&(n=l),l=l.sibling;l=n,l===null?(n=t.child,t.child=null):(n=l.sibling,l.sibling=null),Sc(t,!1,n,l,u,a);break;case"backwards":case"unstable_legacy-backwards":for(l=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&au(e)===null){t.child=n;break}e=n.sibling,n.sibling=l,l=n,n=e}Sc(t,!0,l,null,u,a);break;case"together":Sc(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Vt(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),ml|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(ca(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,l=Gt(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=Gt(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function jc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Wn(e)))}function vm(e,t,l){switch(t.tag){case 3:et(t,t.stateNode.containerInfo),il(t,we,e.memoizedState.cache),Rl();break;case 27:case 5:Na(t);break;case 4:et(t,t.stateNode.containerInfo);break;case 10:il(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ji(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(ol(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Ko(e,t,l):(ol(t),e=Vt(e,t,l),e!==null?e.sibling:null);ol(t);break;case 19:var n=(e.flags&128)!==0;if(a=(l&t.childLanes)!==0,a||(ca(e,t,l,!1),a=(l&t.childLanes)!==0),n){if(a)return ko(e,t,l);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),B(Be,Be.current),a)break;return null;case 22:return t.lanes=0,wo(e,t,l,t.pendingProps);case 24:il(t,we,e.memoizedState.cache)}return Vt(e,t,l)}function Wo(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qe=!0;else{if(!jc(e,l)&&(t.flags&128)===0)return Qe=!1,vm(e,t,l);Qe=(e.flags&131072)!==0}else Qe=!1,re&&(t.flags&1048576)!==0&&_f(t,Za,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Bl(t.elementType),t.type=e,typeof e=="function")zi(e)?(a=Xl(e,a),t.tag=1,t=Zo(null,t,e,a,l)):(t.tag=0,t=yc(null,t,e,a,l));else{if(e!=null){var n=e.$$typeof;if(n===ne){t.tag=11,t=Bo(null,t,e,a,l);break e}else if(n===V){t.tag=14,t=Yo(null,t,e,a,l);break e}}throw t=Ce(e)||e,Error(o(306,t,""))}}return t;case 0:return yc(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,n=Xl(a,t.pendingProps),Zo(e,t,a,n,l);case 3:e:{if(et(t,t.stateNode.containerInfo),e===null)throw Error(o(387));a=t.pendingProps;var u=t.memoizedState;n=u.element,Qi(e,t),Ia(t,a,null,l);var c=t.memoizedState;if(a=c.cache,il(t,we,a),a!==u.cache&&Hi(t,[we],l,!0),Fa(),a=c.element,u.isDehydrated)if(u={element:a,isDehydrated:!1,cache:c.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=Vo(e,t,a,l);break e}else if(a!==n){n=jt(Error(o(424)),t),Va(n),t=Vo(e,t,a,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(De=zt(e.firstChild),We=t,re=!0,nl=null,At=!0,l=Gf(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Rl(),a===n){t=Vt(e,t,l);break e}Fe(e,t,a,l)}t=t.child}return t;case 26:return mu(e,t),e===null?(l=id(t.type,null,t.pendingProps,null))?t.memoizedState=l:re||(l=t.type,e=t.pendingProps,a=Du(ue.current).createElement(l),a[ke]=t,a[lt]=e,Ie(a,l,e),Ke(a),t.stateNode=a):t.memoizedState=id(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Na(t),e===null&&re&&(a=t.stateNode=ad(t.type,t.pendingProps,ue.current),We=t,At=!0,n=De,bl(t.type)?(ts=n,De=zt(a.firstChild)):De=n),Fe(e,t,t.pendingProps.children,l),mu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&re&&((n=a=De)&&(a=Km(a,t.type,t.pendingProps,At),a!==null?(t.stateNode=a,We=t,De=zt(a.firstChild),At=!1,n=!0):n=!1),n||ul(t)),Na(t),n=t.type,u=t.pendingProps,c=e!==null?e.memoizedProps:null,a=u.children,$c(n,u)?a=null:c!==null&&$c(n,c)&&(t.flags|=32),t.memoizedState!==null&&(n=Wi(e,t,cm,null,null,l),bn._currentValue=n),mu(e,t),Fe(e,t,a,l),t.child;case 6:return e===null&&re&&((e=l=De)&&(l=Jm(l,t.pendingProps,At),l!==null?(t.stateNode=l,We=t,De=null,e=!0):e=!1),e||ul(t)),null;case 13:return Ko(e,t,l);case 4:return et(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Gl(t,null,a,l):Fe(e,t,a,l),t.child;case 11:return Bo(e,t,t.type,t.pendingProps,l);case 7:return Fe(e,t,t.pendingProps,l),t.child;case 8:return Fe(e,t,t.pendingProps.children,l),t.child;case 12:return Fe(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,il(t,t.type,a.value),Fe(e,t,a.children,l),t.child;case 9:return n=t.type._context,a=t.pendingProps.children,ql(t),n=$e(n),a=a(n),t.flags|=1,Fe(e,t,a,l),t.child;case 14:return Yo(e,t,t.type,t.pendingProps,l);case 15:return Go(e,t,t.type,t.pendingProps,l);case 19:return ko(e,t,l);case 31:return ym(e,t,l);case 22:return wo(e,t,l,t.pendingProps);case 24:return ql(t),a=$e(we),e===null?(n=Gi(),n===null&&(n=Oe,u=Bi(),n.pooledCache=u,u.refCount++,u!==null&&(n.pooledCacheLanes|=l),n=u),t.memoizedState={parent:a,cache:n},Xi(t),il(t,we,n)):((e.lanes&l)!==0&&(Qi(e,t),Ia(t,null,null,l),Fa()),n=e.memoizedState,u=t.memoizedState,n.parent!==a?(n={parent:a,cache:a},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),il(t,we,a)):(a=u.cache,il(t,we,a),a!==n.cache&&Hi(t,[we],l,!0))),Fe(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Kt(e){e.flags|=4}function Tc(e,t,l,a,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(jr())e.flags|=8192;else throw Yl=Pn,wi}else e.flags&=-16777217}function $o(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!rd(t))if(jr())e.flags|=8192;else throw Yl=Pn,wi}function vu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?zs():536870912,e.lanes|=t,ba|=t)}function nn(e,t){if(!re)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Me(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,a=0;if(t)for(var n=e.child;n!==null;)l|=n.lanes|n.childLanes,a|=n.subtreeFlags&65011712,a|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)l|=n.lanes|n.childLanes,a|=n.subtreeFlags,a|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=a,e.childLanes=l,t}function gm(e,t,l){var a=t.pendingProps;switch(Di(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Me(t),null;case 1:return Me(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Qt(we),He(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(ia(t)?Kt(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ri())),Me(t),null;case 26:var n=t.type,u=t.memoizedState;return e===null?(Kt(t),u!==null?(Me(t),$o(t,u)):(Me(t),Tc(t,n,null,a,l))):u?u!==e.memoizedState?(Kt(t),Me(t),$o(t,u)):(Me(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&Kt(t),Me(t),Tc(t,n,e,a,l)),null;case 27:if(zn(t),l=ue.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Kt(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Me(t),null}e=X.current,ia(t)?Of(t):(e=ad(n,a,l),t.stateNode=e,Kt(t))}return Me(t),null;case 5:if(zn(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Kt(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Me(t),null}if(u=X.current,ia(t))Of(t);else{var c=Du(ue.current);switch(u){case 1:u=c.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:u=c.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":u=c.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":u=c.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":u=c.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?c.createElement(n,{is:a.is}):c.createElement(n)}}u[ke]=t,u[lt]=a;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)u.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=u;e:switch(Ie(u,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Kt(t)}}return Me(t),Tc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Kt(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(e=ue.current,ia(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,n=We,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[ke]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||Kr(e.nodeValue,l)),e||ul(t,!0)}else e=Du(e).createTextNode(a),e[ke]=t,t.stateNode=e}return Me(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=ia(t),l!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[ke]=t}else Rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Me(t),e=!1}else l=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(yt(t),t):(yt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Me(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=ia(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(o(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));n[ke]=t}else Rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Me(t),n=!1}else n=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(yt(t),t):(yt(t),null)}return yt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==n&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),vu(t,t.updateQueue),Me(t),null);case 4:return He(),e===null&&Vc(t.stateNode.containerInfo),Me(t),null;case 10:return Qt(t.type),Me(t),null;case 19:if(M(Be),a=t.memoizedState,a===null)return Me(t),null;if(n=(t.flags&128)!==0,u=a.rendering,u===null)if(n)nn(a,!1);else{if(qe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=au(e),u!==null){for(t.flags|=128,nn(a,!1),e=u.updateQueue,t.updateQueue=e,vu(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Tf(l,e),l=l.sibling;return B(Be,Be.current&1|2),re&&wt(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&ft()>Su&&(t.flags|=128,n=!0,nn(a,!1),t.lanes=4194304)}else{if(!n)if(e=au(u),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,vu(t,e),nn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!re)return Me(t),null}else 2*ft()-a.renderingStartTime>Su&&l!==536870912&&(t.flags|=128,n=!0,nn(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(e=a.last,e!==null?e.sibling=u:t.child=u,a.last=u)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ft(),e.sibling=null,l=Be.current,B(Be,n?l&1|2:l&1),re&&wt(t,a.treeForkCount),e):(Me(t),null);case 22:case 23:return yt(t),Ki(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(Me(t),t.subtreeFlags&6&&(t.flags|=8192)):Me(t),l=t.updateQueue,l!==null&&vu(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&M(Hl),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Qt(we),Me(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function pm(e,t){switch(Di(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qt(we),He(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return zn(t),null;case 31:if(t.memoizedState!==null){if(yt(t),t.alternate===null)throw Error(o(340));Rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(yt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return M(Be),null;case 4:return He(),null;case 10:return Qt(t.type),null;case 22:case 23:return yt(t),Ki(),e!==null&&M(Hl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qt(we),null;case 25:return null;default:return null}}function Fo(e,t){switch(Di(t),t.tag){case 3:Qt(we),He();break;case 26:case 27:case 5:zn(t);break;case 4:He();break;case 31:t.memoizedState!==null&&yt(t);break;case 13:yt(t);break;case 19:M(Be);break;case 10:Qt(t.type);break;case 22:case 23:yt(t),Ki(),e!==null&&M(Hl);break;case 24:Qt(we)}}function un(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&e)===e){a=void 0;var u=l.create,c=l.inst;a=u(),c.destroy=a}l=l.next}while(l!==n)}}catch(f){pe(t,t.return,f)}}function dl(e,t,l){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&e)===e){var c=a.inst,f=c.destroy;if(f!==void 0){c.destroy=void 0,n=t;var r=l,g=f;try{g()}catch(T){pe(n,r,T)}}}a=a.next}while(a!==u)}}catch(T){pe(t,t.return,T)}}function Io(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Xf(t,l)}catch(a){pe(e,e.return,a)}}}function Po(e,t,l){l.props=Xl(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){pe(e,t,a)}}function cn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(n){pe(e,t,n)}}function Ut(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){pe(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){pe(e,t,n)}else l.current=null}function er(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){pe(e,e.return,n)}}function Ec(e,t,l){try{var a=e.stateNode;wm(a,e.type,l,t),a[lt]=t}catch(n){pe(e,e.return,n)}}function tr(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&bl(e.type)||e.tag===4}function Ac(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tr(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&&bl(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 _c(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Bt));else if(a!==4&&(a===27&&bl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(_c(e,t,l),e=e.sibling;e!==null;)_c(e,t,l),e=e.sibling}function gu(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&bl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(gu(e,t,l),e=e.sibling;e!==null;)gu(e,t,l),e=e.sibling}function lr(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Ie(t,a,l),t[ke]=e,t[lt]=l}catch(u){pe(e,e.return,u)}}var Jt=!1,Le=!1,zc=!1,ar=typeof WeakSet=="function"?WeakSet:Set,Je=null;function bm(e,t){if(e=e.containerInfo,kc=Yu,e=mf(e),xi(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{l.nodeType,u.nodeType}catch{l=null;break e}var c=0,f=-1,r=-1,g=0,T=0,C=e,p=null;t:for(;;){for(var S;C!==l||n!==0&&C.nodeType!==3||(f=c+n),C!==u||a!==0&&C.nodeType!==3||(r=c+a),C.nodeType===3&&(c+=C.nodeValue.length),(S=C.firstChild)!==null;)p=C,C=S;for(;;){if(C===e)break t;if(p===l&&++g===n&&(f=c),p===u&&++T===a&&(r=c),(S=C.nextSibling)!==null)break;C=p,p=C.parentNode}C=S}l=f===-1||r===-1?null:{start:f,end:r}}else l=null}l=l||{start:0,end:0}}else l=null;for(Wc={focusedElem:e,selectionRange:l},Yu=!1,Je=t;Je!==null;)if(t=Je,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Je=e;else for(;Je!==null;){switch(t=Je,u=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(l=0;l<e.length;l++)n=e[l],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,l=t,n=u.memoizedProps,u=u.memoizedState,a=l.stateNode;try{var w=Xl(l.type,n);e=a.getSnapshotBeforeUpdate(w,u),a.__reactInternalSnapshotBeforeUpdate=e}catch(J){pe(l,l.return,J)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)Ic(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ic(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(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Je=e;break}Je=t.return}}function nr(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:Wt(e,l),a&4&&un(5,l);break;case 1:if(Wt(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(c){pe(l,l.return,c)}else{var n=Xl(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(c){pe(l,l.return,c)}}a&64&&Io(l),a&512&&cn(l,l.return);break;case 3:if(Wt(e,l),a&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{Xf(e,t)}catch(c){pe(l,l.return,c)}}break;case 27:t===null&&a&4&&lr(l);case 26:case 5:Wt(e,l),t===null&&a&4&&er(l),a&512&&cn(l,l.return);break;case 12:Wt(e,l);break;case 31:Wt(e,l),a&4&&cr(e,l);break;case 13:Wt(e,l),a&4&&sr(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Om.bind(null,l),km(e,l))));break;case 22:if(a=l.memoizedState!==null||Jt,!a){t=t!==null&&t.memoizedState!==null||Le,n=Jt;var u=Le;Jt=a,(Le=t)&&!u?$t(e,l,(l.subtreeFlags&8772)!==0):Wt(e,l),Jt=n,Le=u}break;case 30:break;default:Wt(e,l)}}function ur(e){var t=e.alternate;t!==null&&(e.alternate=null,ur(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ai(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 Re=null,nt=!1;function kt(e,t,l){for(l=l.child;l!==null;)ir(e,t,l),l=l.sibling}function ir(e,t,l){if(ot&&typeof ot.onCommitFiberUnmount=="function")try{ot.onCommitFiberUnmount(Ca,l)}catch{}switch(l.tag){case 26:Le||Ut(l,t),kt(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Le||Ut(l,t);var a=Re,n=nt;bl(l.type)&&(Re=l.stateNode,nt=!1),kt(e,t,l),vn(l.stateNode),Re=a,nt=n;break;case 5:Le||Ut(l,t);case 6:if(a=Re,n=nt,Re=null,kt(e,t,l),Re=a,nt=n,Re!==null)if(nt)try{(Re.nodeType===9?Re.body:Re.nodeName==="HTML"?Re.ownerDocument.body:Re).removeChild(l.stateNode)}catch(u){pe(l,t,u)}else try{Re.removeChild(l.stateNode)}catch(u){pe(l,t,u)}break;case 18:Re!==null&&(nt?(e=Re,Ir(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),za(e)):Ir(Re,l.stateNode));break;case 4:a=Re,n=nt,Re=l.stateNode.containerInfo,nt=!0,kt(e,t,l),Re=a,nt=n;break;case 0:case 11:case 14:case 15:dl(2,l,t),Le||dl(4,l,t),kt(e,t,l);break;case 1:Le||(Ut(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&Po(l,t,a)),kt(e,t,l);break;case 21:kt(e,t,l);break;case 22:Le=(a=Le)||l.memoizedState!==null,kt(e,t,l),Le=a;break;default:kt(e,t,l)}}function cr(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{za(e)}catch(l){pe(t,t.return,l)}}}function sr(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{za(e)}catch(l){pe(t,t.return,l)}}function xm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ar),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ar),t;default:throw Error(o(435,e.tag))}}function pu(e,t){var l=xm(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var n=Nm.bind(null,e,a);a.then(n,n)}})}function ut(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var n=l[a],u=e,c=t,f=c;e:for(;f!==null;){switch(f.tag){case 27:if(bl(f.type)){Re=f.stateNode,nt=!1;break e}break;case 5:Re=f.stateNode,nt=!1;break e;case 3:case 4:Re=f.stateNode.containerInfo,nt=!0;break e}f=f.return}if(Re===null)throw Error(o(160));ir(u,c,n),Re=null,nt=!1,u=n.alternate,u!==null&&(u.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fr(t,e),t=t.sibling}var Ct=null;function fr(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ut(t,e),it(e),a&4&&(dl(3,e,e.return),un(3,e),dl(5,e,e.return));break;case 1:ut(t,e),it(e),a&512&&(Le||l===null||Ut(l,l.return)),a&64&&Jt&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?a:l.concat(a))));break;case 26:var n=Ct;if(ut(t,e),it(e),a&512&&(Le||l===null||Ut(l,l.return)),a&4){var u=l!==null?l.memoizedState:null;if(a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null){e:{a=e.type,l=e.memoizedProps,n=n.ownerDocument||n;t:switch(a){case"title":u=n.getElementsByTagName("title")[0],(!u||u[Ra]||u[ke]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=n.createElement(a),n.head.insertBefore(u,n.querySelector("head > title"))),Ie(u,a,l),u[ke]=e,Ke(u),a=u;break e;case"link":var c=fd("link","href",n).get(a+(l.href||""));if(c){for(var f=0;f<c.length;f++)if(u=c[f],u.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&u.getAttribute("rel")===(l.rel==null?null:l.rel)&&u.getAttribute("title")===(l.title==null?null:l.title)&&u.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){c.splice(f,1);break t}}u=n.createElement(a),Ie(u,a,l),n.head.appendChild(u);break;case"meta":if(c=fd("meta","content",n).get(a+(l.content||""))){for(f=0;f<c.length;f++)if(u=c[f],u.getAttribute("content")===(l.content==null?null:""+l.content)&&u.getAttribute("name")===(l.name==null?null:l.name)&&u.getAttribute("property")===(l.property==null?null:l.property)&&u.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&u.getAttribute("charset")===(l.charSet==null?null:l.charSet)){c.splice(f,1);break t}}u=n.createElement(a),Ie(u,a,l),n.head.appendChild(u);break;default:throw Error(o(468,a))}u[ke]=e,Ke(u),a=u}e.stateNode=a}else od(n,e.type,e.stateNode);else e.stateNode=sd(n,a,e.memoizedProps);else u!==a?(u===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):u.count--,a===null?od(n,e.type,e.stateNode):sd(n,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Ec(e,e.memoizedProps,l.memoizedProps)}break;case 27:ut(t,e),it(e),a&512&&(Le||l===null||Ut(l,l.return)),l!==null&&a&4&&Ec(e,e.memoizedProps,l.memoizedProps);break;case 5:if(ut(t,e),it(e),a&512&&(Le||l===null||Ut(l,l.return)),e.flags&32){n=e.stateNode;try{$l(n,"")}catch(w){pe(e,e.return,w)}}a&4&&e.stateNode!=null&&(n=e.memoizedProps,Ec(e,n,l!==null?l.memoizedProps:n)),a&1024&&(zc=!0);break;case 6:if(ut(t,e),it(e),a&4){if(e.stateNode===null)throw Error(o(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(w){pe(e,e.return,w)}}break;case 3:if(Uu=null,n=Ct,Ct=Mu(t.containerInfo),ut(t,e),Ct=n,it(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{za(t.containerInfo)}catch(w){pe(e,e.return,w)}zc&&(zc=!1,or(e));break;case 4:a=Ct,Ct=Mu(e.stateNode.containerInfo),ut(t,e),it(e),Ct=a;break;case 12:ut(t,e),it(e);break;case 31:ut(t,e),it(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pu(e,a)));break;case 13:ut(t,e),it(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(xu=ft()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pu(e,a)));break;case 22:n=e.memoizedState!==null;var r=l!==null&&l.memoizedState!==null,g=Jt,T=Le;if(Jt=g||n,Le=T||r,ut(t,e),Le=T,Jt=g,it(e),a&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(l===null||r||Jt||Le||Ql(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){r=l=t;try{if(u=r.stateNode,n)c=u.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none";else{f=r.stateNode;var C=r.memoizedProps.style,p=C!=null&&C.hasOwnProperty("display")?C.display:null;f.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(w){pe(r,r.return,w)}}}else if(t.tag===6){if(l===null){r=t;try{r.stateNode.nodeValue=n?"":r.memoizedProps}catch(w){pe(r,r.return,w)}}}else if(t.tag===18){if(l===null){r=t;try{var S=r.stateNode;n?Pr(S,!0):Pr(r.stateNode,!1)}catch(w){pe(r,r.return,w)}}}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;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(l=a.retryQueue,l!==null&&(a.retryQueue=null,pu(e,l))));break;case 19:ut(t,e),it(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pu(e,a)));break;case 30:break;case 21:break;default:ut(t,e),it(e)}}function it(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(tr(a)){l=a;break}a=a.return}if(l==null)throw Error(o(160));switch(l.tag){case 27:var n=l.stateNode,u=Ac(e);gu(e,u,n);break;case 5:var c=l.stateNode;l.flags&32&&($l(c,""),l.flags&=-33);var f=Ac(e);gu(e,f,c);break;case 3:case 4:var r=l.stateNode.containerInfo,g=Ac(e);_c(e,g,r);break;default:throw Error(o(161))}}catch(T){pe(e,e.return,T)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function or(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;or(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Wt(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)nr(e,t.alternate,t),t=t.sibling}function Ql(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:dl(4,t,t.return),Ql(t);break;case 1:Ut(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Po(t,t.return,l),Ql(t);break;case 27:vn(t.stateNode);case 26:case 5:Ut(t,t.return),Ql(t);break;case 22:t.memoizedState===null&&Ql(t);break;case 30:Ql(t);break;default:Ql(t)}e=e.sibling}}function $t(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,n=e,u=t,c=u.flags;switch(u.tag){case 0:case 11:case 15:$t(n,u,l),un(4,u);break;case 1:if($t(n,u,l),a=u,n=a.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(g){pe(a,a.return,g)}if(a=u,n=a.updateQueue,n!==null){var f=a.stateNode;try{var r=n.shared.hiddenCallbacks;if(r!==null)for(n.shared.hiddenCallbacks=null,n=0;n<r.length;n++)wf(r[n],f)}catch(g){pe(a,a.return,g)}}l&&c&64&&Io(u),cn(u,u.return);break;case 27:lr(u);case 26:case 5:$t(n,u,l),l&&a===null&&c&4&&er(u),cn(u,u.return);break;case 12:$t(n,u,l);break;case 31:$t(n,u,l),l&&c&4&&cr(n,u);break;case 13:$t(n,u,l),l&&c&4&&sr(n,u);break;case 22:u.memoizedState===null&&$t(n,u,l),cn(u,u.return);break;case 30:break;default:$t(n,u,l)}t=t.sibling}}function Oc(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Ka(l))}function Nc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ka(e))}function Dt(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)rr(e,t,l,a),t=t.sibling}function rr(e,t,l,a){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Dt(e,t,l,a),n&2048&&un(9,t);break;case 1:Dt(e,t,l,a);break;case 3:Dt(e,t,l,a),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ka(e)));break;case 12:if(n&2048){Dt(e,t,l,a),e=t.stateNode;try{var u=t.memoizedProps,c=u.id,f=u.onPostCommit;typeof f=="function"&&f(c,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(r){pe(t,t.return,r)}}else Dt(e,t,l,a);break;case 31:Dt(e,t,l,a);break;case 13:Dt(e,t,l,a);break;case 23:break;case 22:u=t.stateNode,c=t.alternate,t.memoizedState!==null?u._visibility&2?Dt(e,t,l,a):sn(e,t):u._visibility&2?Dt(e,t,l,a):(u._visibility|=2,va(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),n&2048&&Oc(c,t);break;case 24:Dt(e,t,l,a),n&2048&&Nc(t.alternate,t);break;default:Dt(e,t,l,a)}}function va(e,t,l,a,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,c=t,f=l,r=a,g=c.flags;switch(c.tag){case 0:case 11:case 15:va(u,c,f,r,n),un(8,c);break;case 23:break;case 22:var T=c.stateNode;c.memoizedState!==null?T._visibility&2?va(u,c,f,r,n):sn(u,c):(T._visibility|=2,va(u,c,f,r,n)),n&&g&2048&&Oc(c.alternate,c);break;case 24:va(u,c,f,r,n),n&&g&2048&&Nc(c.alternate,c);break;default:va(u,c,f,r,n)}t=t.sibling}}function sn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,a=t,n=a.flags;switch(a.tag){case 22:sn(l,a),n&2048&&Oc(a.alternate,a);break;case 24:sn(l,a),n&2048&&Nc(a.alternate,a);break;default:sn(l,a)}t=t.sibling}}var fn=8192;function ga(e,t,l){if(e.subtreeFlags&fn)for(e=e.child;e!==null;)dr(e,t,l),e=e.sibling}function dr(e,t,l){switch(e.tag){case 26:ga(e,t,l),e.flags&fn&&e.memoizedState!==null&&iy(l,Ct,e.memoizedState,e.memoizedProps);break;case 5:ga(e,t,l);break;case 3:case 4:var a=Ct;Ct=Mu(e.stateNode.containerInfo),ga(e,t,l),Ct=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=fn,fn=16777216,ga(e,t,l),fn=a):ga(e,t,l));break;default:ga(e,t,l)}}function hr(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 on(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];Je=a,yr(a,e)}hr(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)mr(e),e=e.sibling}function mr(e){switch(e.tag){case 0:case 11:case 15:on(e),e.flags&2048&&dl(9,e,e.return);break;case 3:on(e);break;case 12:on(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,bu(e)):on(e);break;default:on(e)}}function bu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];Je=a,yr(a,e)}hr(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:dl(8,t,t.return),bu(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,bu(t));break;default:bu(t)}e=e.sibling}}function yr(e,t){for(;Je!==null;){var l=Je;switch(l.tag){case 0:case 11:case 15:dl(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var a=l.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Ka(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,Je=a;else e:for(l=e;Je!==null;){a=Je;var n=a.sibling,u=a.return;if(ur(a),a===l){Je=null;break e}if(n!==null){n.return=u,Je=n;break e}Je=u}}}var Sm={getCacheForType:function(e){var t=$e(we),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return $e(we).controller.signal}},jm=typeof WeakMap=="function"?WeakMap:Map,ye=0,Oe=null,ie=null,fe=0,ge=0,vt=null,hl=!1,pa=!1,Cc=!1,Ft=0,qe=0,ml=0,Ll=0,Dc=0,gt=0,ba=0,rn=null,ct=null,Mc=!1,xu=0,vr=0,Su=1/0,ju=null,yl=null,Ve=0,vl=null,xa=null,It=0,Rc=0,Uc=null,gr=null,dn=0,qc=null;function pt(){return(ye&2)!==0&&fe!==0?fe&-fe:j.T!==null?Xc():Ds()}function pr(){if(gt===0)if((fe&536870912)===0||re){var e=Cn;Cn<<=1,(Cn&3932160)===0&&(Cn=262144),gt=e}else gt=536870912;return e=mt.current,e!==null&&(e.flags|=32),gt}function st(e,t,l){(e===Oe&&(ge===2||ge===9)||e.cancelPendingCommit!==null)&&(Sa(e,0),gl(e,fe,gt,!1)),Ma(e,l),((ye&2)===0||e!==Oe)&&(e===Oe&&((ye&2)===0&&(Ll|=l),qe===4&&gl(e,fe,gt,!1)),qt(e))}function br(e,t,l){if((ye&6)!==0)throw Error(o(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||Da(e,t),n=a?Am(e,t):Bc(e,t,!0),u=a;do{if(n===0){pa&&!a&&gl(e,t,0,!1);break}else{if(l=e.current.alternate,u&&!Tm(l)){n=Bc(e,t,!1),u=!1;continue}if(n===2){if(u=t,e.errorRecoveryDisabledLanes&u)var c=0;else c=e.pendingLanes&-536870913,c=c!==0?c:c&536870912?536870912:0;if(c!==0){t=c;e:{var f=e;n=rn;var r=f.current.memoizedState.isDehydrated;if(r&&(Sa(f,c).flags|=256),c=Bc(f,c,!1),c!==2){if(Cc&&!r){f.errorRecoveryDisabledLanes|=u,Ll|=u,n=4;break e}u=ct,ct=n,u!==null&&(ct===null?ct=u:ct.push.apply(ct,u))}n=c}if(u=!1,n!==2)continue}}if(n===1){Sa(e,0),gl(e,t,0,!0);break}e:{switch(a=e,u=n,u){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:gl(a,t,gt,!hl);break e;case 2:ct=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(n=xu+300-ft(),10<n)){if(gl(a,t,gt,!hl),Mn(a,0,!0)!==0)break e;It=t,a.timeoutHandle=$r(xr.bind(null,a,l,ct,ju,Mc,t,gt,Ll,ba,hl,u,"Throttled",-0,0),n);break e}xr(a,l,ct,ju,Mc,t,gt,Ll,ba,hl,u,null,-0,0)}}break}while(!0);qt(e)}function xr(e,t,l,a,n,u,c,f,r,g,T,C,p,S){if(e.timeoutHandle=-1,C=t.subtreeFlags,C&8192||(C&16785408)===16785408){C={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Bt},dr(t,u,C);var w=(u&62914560)===u?xu-ft():(u&4194048)===u?vr-ft():0;if(w=cy(C,w),w!==null){It=u,e.cancelPendingCommit=w(Or.bind(null,e,t,u,l,a,n,c,f,r,T,C,null,p,S)),gl(e,u,c,!g);return}}Or(e,t,u,l,a,n,c,f,r)}function Tm(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var a=0;a<l.length;a++){var n=l[a],u=n.getSnapshot;n=n.value;try{if(!dt(u(),n))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;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 gl(e,t,l,a){t&=~Dc,t&=~Ll,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var n=t;0<n;){var u=31-rt(n),c=1<<u;a[u]=-1,n&=~c}l!==0&&Os(e,l,t)}function Tu(){return(ye&6)===0?(hn(0),!1):!0}function Hc(){if(ie!==null){if(ge===0)var e=ie.return;else e=ie,Xt=Ul=null,Ii(e),ra=null,ka=0,e=ie;for(;e!==null;)Fo(e.alternate,e),e=e.return;ie=null}}function Sa(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Lm(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),It=0,Hc(),Oe=e,ie=l=Gt(e.current,null),fe=t,ge=0,vt=null,hl=!1,pa=Da(e,t),Cc=!1,ba=gt=Dc=Ll=ml=qe=0,ct=rn=null,Mc=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var n=31-rt(a),u=1<<n;t|=e[n],a&=~u}return Ft=t,Zn(),l}function Sr(e,t){ee=null,j.H=ln,t===oa||t===In?(t=Hf(),ge=3):t===wi?(t=Hf(),ge=4):ge=t===mc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,vt=t,ie===null&&(qe=1,du(e,jt(t,e.current)))}function jr(){var e=mt.current;return e===null?!0:(fe&4194048)===fe?_t===null:(fe&62914560)===fe||(fe&536870912)!==0?e===_t:!1}function Tr(){var e=j.H;return j.H=ln,e===null?ln:e}function Er(){var e=j.A;return j.A=Sm,e}function Eu(){qe=4,hl||(fe&4194048)!==fe&&mt.current!==null||(pa=!0),(ml&134217727)===0&&(Ll&134217727)===0||Oe===null||gl(Oe,fe,gt,!1)}function Bc(e,t,l){var a=ye;ye|=2;var n=Tr(),u=Er();(Oe!==e||fe!==t)&&(ju=null,Sa(e,t)),t=!1;var c=qe;e:do try{if(ge!==0&&ie!==null){var f=ie,r=vt;switch(ge){case 8:Hc(),c=6;break e;case 3:case 2:case 9:case 6:mt.current===null&&(t=!0);var g=ge;if(ge=0,vt=null,ja(e,f,r,g),l&&pa){c=0;break e}break;default:g=ge,ge=0,vt=null,ja(e,f,r,g)}}Em(),c=qe;break}catch(T){Sr(e,T)}while(!0);return t&&e.shellSuspendCounter++,Xt=Ul=null,ye=a,j.H=n,j.A=u,ie===null&&(Oe=null,fe=0,Zn()),c}function Em(){for(;ie!==null;)Ar(ie)}function Am(e,t){var l=ye;ye|=2;var a=Tr(),n=Er();Oe!==e||fe!==t?(ju=null,Su=ft()+500,Sa(e,t)):pa=Da(e,t);e:do try{if(ge!==0&&ie!==null){t=ie;var u=vt;t:switch(ge){case 1:ge=0,vt=null,ja(e,t,u,1);break;case 2:case 9:if(Uf(u)){ge=0,vt=null,_r(t);break}t=function(){ge!==2&&ge!==9||Oe!==e||(ge=7),qt(e)},u.then(t,t);break e;case 3:ge=7;break e;case 4:ge=5;break e;case 7:Uf(u)?(ge=0,vt=null,_r(t)):(ge=0,vt=null,ja(e,t,u,7));break;case 5:var c=null;switch(ie.tag){case 26:c=ie.memoizedState;case 5:case 27:var f=ie;if(c?rd(c):f.stateNode.complete){ge=0,vt=null;var r=f.sibling;if(r!==null)ie=r;else{var g=f.return;g!==null?(ie=g,Au(g)):ie=null}break t}}ge=0,vt=null,ja(e,t,u,5);break;case 6:ge=0,vt=null,ja(e,t,u,6);break;case 8:Hc(),qe=6;break e;default:throw Error(o(462))}}_m();break}catch(T){Sr(e,T)}while(!0);return Xt=Ul=null,j.H=a,j.A=n,ye=l,ie!==null?0:(Oe=null,fe=0,Zn(),qe)}function _m(){for(;ie!==null&&!Wd();)Ar(ie)}function Ar(e){var t=Wo(e.alternate,e,Ft);e.memoizedProps=e.pendingProps,t===null?Au(e):ie=t}function _r(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Lo(l,t,t.pendingProps,t.type,void 0,fe);break;case 11:t=Lo(l,t,t.pendingProps,t.type.render,t.ref,fe);break;case 5:Ii(t);default:Fo(l,t),t=ie=Tf(t,Ft),t=Wo(l,t,Ft)}e.memoizedProps=e.pendingProps,t===null?Au(e):ie=t}function ja(e,t,l,a){Xt=Ul=null,Ii(t),ra=null,ka=0;var n=t.return;try{if(mm(e,n,t,l,fe)){qe=1,du(e,jt(l,e.current)),ie=null;return}}catch(u){if(n!==null)throw ie=n,u;qe=1,du(e,jt(l,e.current)),ie=null;return}t.flags&32768?(re||a===1?e=!0:pa||(fe&536870912)!==0?e=!1:(hl=e=!0,(a===2||a===9||a===3||a===6)&&(a=mt.current,a!==null&&a.tag===13&&(a.flags|=16384))),zr(t,e)):Au(t)}function Au(e){var t=e;do{if((t.flags&32768)!==0){zr(t,hl);return}e=t.return;var l=gm(t.alternate,t,Ft);if(l!==null){ie=l;return}if(t=t.sibling,t!==null){ie=t;return}ie=t=e}while(t!==null);qe===0&&(qe=5)}function zr(e,t){do{var l=pm(e.alternate,e);if(l!==null){l.flags&=32767,ie=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){ie=e;return}ie=e=l}while(e!==null);qe=6,ie=null}function Or(e,t,l,a,n,u,c,f,r){e.cancelPendingCommit=null;do _u();while(Ve!==0);if((ye&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(u=t.lanes|t.childLanes,u|=Ai,uh(e,l,u,c,f,r),e===Oe&&(ie=Oe=null,fe=0),xa=t,vl=e,It=l,Rc=u,Uc=n,gr=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Cm(On,function(){return Rr(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=j.T,j.T=null,n=N.p,N.p=2,c=ye,ye|=4;try{bm(e,t,l)}finally{ye=c,N.p=n,j.T=a}}Ve=1,Nr(),Cr(),Dr()}}function Nr(){if(Ve===1){Ve=0;var e=vl,t=xa,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=j.T,j.T=null;var a=N.p;N.p=2;var n=ye;ye|=4;try{fr(t,e);var u=Wc,c=mf(e.containerInfo),f=u.focusedElem,r=u.selectionRange;if(c!==f&&f&&f.ownerDocument&&hf(f.ownerDocument.documentElement,f)){if(r!==null&&xi(f)){var g=r.start,T=r.end;if(T===void 0&&(T=g),"selectionStart"in f)f.selectionStart=g,f.selectionEnd=Math.min(T,f.value.length);else{var C=f.ownerDocument||document,p=C&&C.defaultView||window;if(p.getSelection){var S=p.getSelection(),w=f.textContent.length,J=Math.min(r.start,w),_e=r.end===void 0?J:Math.min(r.end,w);!S.extend&&J>_e&&(c=_e,_e=J,J=c);var y=df(f,J),h=df(f,_e);if(y&&h&&(S.rangeCount!==1||S.anchorNode!==y.node||S.anchorOffset!==y.offset||S.focusNode!==h.node||S.focusOffset!==h.offset)){var v=C.createRange();v.setStart(y.node,y.offset),S.removeAllRanges(),J>_e?(S.addRange(v),S.extend(h.node,h.offset)):(v.setEnd(h.node,h.offset),S.addRange(v))}}}}for(C=[],S=f;S=S.parentNode;)S.nodeType===1&&C.push({element:S,left:S.scrollLeft,top:S.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<C.length;f++){var z=C[f];z.element.scrollLeft=z.left,z.element.scrollTop=z.top}}Yu=!!kc,Wc=kc=null}finally{ye=n,N.p=a,j.T=l}}e.current=t,Ve=2}}function Cr(){if(Ve===2){Ve=0;var e=vl,t=xa,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=j.T,j.T=null;var a=N.p;N.p=2;var n=ye;ye|=4;try{nr(e,t.alternate,t)}finally{ye=n,N.p=a,j.T=l}}Ve=3}}function Dr(){if(Ve===4||Ve===3){Ve=0,$d();var e=vl,t=xa,l=It,a=gr;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ve=5:(Ve=0,xa=vl=null,Mr(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(yl=null),ti(l),t=t.stateNode,ot&&typeof ot.onCommitFiberRoot=="function")try{ot.onCommitFiberRoot(Ca,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=j.T,n=N.p,N.p=2,j.T=null;try{for(var u=e.onRecoverableError,c=0;c<a.length;c++){var f=a[c];u(f.value,{componentStack:f.stack})}}finally{j.T=t,N.p=n}}(It&3)!==0&&_u(),qt(e),n=e.pendingLanes,(l&261930)!==0&&(n&42)!==0?e===qc?dn++:(dn=0,qc=e):dn=0,hn(0)}}function Mr(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ka(t)))}function _u(){return Nr(),Cr(),Dr(),Rr()}function Rr(){if(Ve!==5)return!1;var e=vl,t=Rc;Rc=0;var l=ti(It),a=j.T,n=N.p;try{N.p=32>l?32:l,j.T=null,l=Uc,Uc=null;var u=vl,c=It;if(Ve=0,xa=vl=null,It=0,(ye&6)!==0)throw Error(o(331));var f=ye;if(ye|=4,mr(u.current),rr(u,u.current,c,l),ye=f,hn(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(Ca,u)}catch{}return!0}finally{N.p=n,j.T=a,Mr(e,t)}}function Ur(e,t,l){t=jt(l,t),t=hc(e.stateNode,t,2),e=fl(e,t,2),e!==null&&(Ma(e,2),qt(e))}function pe(e,t,l){if(e.tag===3)Ur(e,e,l);else for(;t!==null;){if(t.tag===3){Ur(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(yl===null||!yl.has(a))){e=jt(l,e),l=qo(2),a=fl(t,l,2),a!==null&&(Ho(l,a,t,e),Ma(a,2),qt(a));break}}t=t.return}}function Yc(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new jm;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(l)||(Cc=!0,n.add(l),e=zm.bind(null,e,t,l),t.then(e,e))}function zm(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Oe===e&&(fe&l)===l&&(qe===4||qe===3&&(fe&62914560)===fe&&300>ft()-xu?(ye&2)===0&&Sa(e,0):Dc|=l,ba===fe&&(ba=0)),qt(e)}function qr(e,t){t===0&&(t=zs()),e=Dl(e,t),e!==null&&(Ma(e,t),qt(e))}function Om(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),qr(e,l)}function Nm(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),qr(e,l)}function Cm(e,t){return Fu(e,t)}var zu=null,Ta=null,Gc=!1,Ou=!1,wc=!1,pl=0;function qt(e){e!==Ta&&e.next===null&&(Ta===null?zu=Ta=e:Ta=Ta.next=e),Ou=!0,Gc||(Gc=!0,Mm())}function hn(e,t){if(!wc&&Ou){wc=!0;do for(var l=!1,a=zu;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var u=0;else{var c=a.suspendedLanes,f=a.pingedLanes;u=(1<<31-rt(42|e)+1)-1,u&=n&~(c&~f),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(l=!0,Gr(a,u))}else u=fe,u=Mn(a,a===Oe?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Da(a,u)||(l=!0,Gr(a,u));a=a.next}while(l);wc=!1}}function Dm(){Hr()}function Hr(){Ou=Gc=!1;var e=0;pl!==0&&Qm()&&(e=pl);for(var t=ft(),l=null,a=zu;a!==null;){var n=a.next,u=Br(a,t);u===0?(a.next=null,l===null?zu=n:l.next=n,n===null&&(Ta=l)):(l=a,(e!==0||(u&3)!==0)&&(Ou=!0)),a=n}Ve!==0&&Ve!==5||hn(e),pl!==0&&(pl=0)}function Br(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var c=31-rt(u),f=1<<c,r=n[c];r===-1?((f&l)===0||(f&a)!==0)&&(n[c]=nh(f,t)):r<=t&&(e.expiredLanes|=f),u&=~f}if(t=Oe,l=fe,l=Mn(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(ge===2||ge===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Iu(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Da(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&Iu(a),ti(l)){case 2:case 8:l=As;break;case 32:l=On;break;case 268435456:l=_s;break;default:l=On}return a=Yr.bind(null,e),l=Fu(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&Iu(a),e.callbackPriority=2,e.callbackNode=null,2}function Yr(e,t){if(Ve!==0&&Ve!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(_u()&&e.callbackNode!==l)return null;var a=fe;return a=Mn(e,e===Oe?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(br(e,a,t),Br(e,ft()),e.callbackNode!=null&&e.callbackNode===l?Yr.bind(null,e):null)}function Gr(e,t){if(_u())return null;br(e,t,!0)}function Mm(){Zm(function(){(ye&6)!==0?Fu(Es,Dm):Hr()})}function Xc(){if(pl===0){var e=sa;e===0&&(e=Nn,Nn<<=1,(Nn&261888)===0&&(Nn=256)),pl=e}return pl}function wr(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Hn(""+e)}function Xr(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function Rm(e,t,l,a,n){if(t==="submit"&&l&&l.stateNode===n){var u=wr((n[lt]||null).action),c=a.submitter;c&&(t=(t=c[lt]||null)?wr(t.formAction):c.getAttribute("formAction"),t!==null&&(u=t,c=null));var f=new wn("action","action",null,a,n);e.push({event:f,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(pl!==0){var r=c?Xr(n,c):new FormData(n);cc(l,{pending:!0,data:r,method:n.method,action:u},null,r)}}else typeof u=="function"&&(f.preventDefault(),r=c?Xr(n,c):new FormData(n),cc(l,{pending:!0,data:r,method:n.method,action:u},u,r))},currentTarget:n}]})}}for(var Qc=0;Qc<Ei.length;Qc++){var Lc=Ei[Qc],Um=Lc.toLowerCase(),qm=Lc[0].toUpperCase()+Lc.slice(1);Nt(Um,"on"+qm)}Nt(gf,"onAnimationEnd"),Nt(pf,"onAnimationIteration"),Nt(bf,"onAnimationStart"),Nt("dblclick","onDoubleClick"),Nt("focusin","onFocus"),Nt("focusout","onBlur"),Nt(Fh,"onTransitionRun"),Nt(Ih,"onTransitionStart"),Nt(Ph,"onTransitionCancel"),Nt(xf,"onTransitionEnd"),kl("onMouseEnter",["mouseout","mouseover"]),kl("onMouseLeave",["mouseout","mouseover"]),kl("onPointerEnter",["pointerout","pointerover"]),kl("onPointerLeave",["pointerout","pointerover"]),zl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),zl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),zl("onBeforeInput",["compositionend","keypress","textInput","paste"]),zl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),zl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),zl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mn="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(" "),Hm=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(mn));function Qr(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var a=e[l],n=a.event;a=a.listeners;e:{var u=void 0;if(t)for(var c=a.length-1;0<=c;c--){var f=a[c],r=f.instance,g=f.currentTarget;if(f=f.listener,r!==u&&n.isPropagationStopped())break e;u=f,n.currentTarget=g;try{u(n)}catch(T){Ln(T)}n.currentTarget=null,u=r}else for(c=0;c<a.length;c++){if(f=a[c],r=f.instance,g=f.currentTarget,f=f.listener,r!==u&&n.isPropagationStopped())break e;u=f,n.currentTarget=g;try{u(n)}catch(T){Ln(T)}n.currentTarget=null,u=r}}}}function ce(e,t){var l=t[li];l===void 0&&(l=t[li]=new Set);var a=e+"__bubble";l.has(a)||(Lr(t,e,2,!1),l.add(a))}function Zc(e,t,l){var a=0;t&&(a|=4),Lr(l,e,a,t)}var Nu="_reactListening"+Math.random().toString(36).slice(2);function Vc(e){if(!e[Nu]){e[Nu]=!0,Us.forEach(function(l){l!=="selectionchange"&&(Hm.has(l)||Zc(l,!1,e),Zc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Nu]||(t[Nu]=!0,Zc("selectionchange",!1,t))}}function Lr(e,t,l,a){switch(pd(t)){case 2:var n=oy;break;case 8:n=ry;break;default:n=is}l=n.bind(null,t,l,e),n=void 0,!ri||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),a?n!==void 0?e.addEventListener(t,l,{capture:!0,passive:n}):e.addEventListener(t,l,!0):n!==void 0?e.addEventListener(t,l,{passive:n}):e.addEventListener(t,l,!1)}function Kc(e,t,l,a,n){var u=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var c=a.tag;if(c===3||c===4){var f=a.stateNode.containerInfo;if(f===n)break;if(c===4)for(c=a.return;c!==null;){var r=c.tag;if((r===3||r===4)&&c.stateNode.containerInfo===n)return;c=c.return}for(;f!==null;){if(c=Vl(f),c===null)return;if(r=c.tag,r===5||r===6||r===26||r===27){a=u=c;continue e}f=f.parentNode}}a=a.return}Ks(function(){var g=u,T=fi(l),C=[];e:{var p=Sf.get(e);if(p!==void 0){var S=wn,w=e;switch(e){case"keypress":if(Yn(l)===0)break e;case"keydown":case"keyup":S=Nh;break;case"focusin":w="focus",S=yi;break;case"focusout":w="blur",S=yi;break;case"beforeblur":case"afterblur":S=yi;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":S=Ws;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":S=gh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":S=Mh;break;case gf:case pf:case bf:S=xh;break;case xf:S=Uh;break;case"scroll":case"scrollend":S=yh;break;case"wheel":S=Hh;break;case"copy":case"cut":case"paste":S=jh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":S=Fs;break;case"toggle":case"beforetoggle":S=Yh}var J=(t&4)!==0,_e=!J&&(e==="scroll"||e==="scrollend"),y=J?p!==null?p+"Capture":null:p;J=[];for(var h=g,v;h!==null;){var z=h;if(v=z.stateNode,z=z.tag,z!==5&&z!==26&&z!==27||v===null||y===null||(z=qa(h,y),z!=null&&J.push(yn(h,z,v))),_e)break;h=h.return}0<J.length&&(p=new S(p,w,null,l,T),C.push({event:p,listeners:J}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",S=e==="mouseout"||e==="pointerout",p&&l!==si&&(w=l.relatedTarget||l.fromElement)&&(Vl(w)||w[Zl]))break e;if((S||p)&&(p=T.window===T?T:(p=T.ownerDocument)?p.defaultView||p.parentWindow:window,S?(w=l.relatedTarget||l.toElement,S=g,w=w?Vl(w):null,w!==null&&(_e=_(w),J=w.tag,w!==_e||J!==5&&J!==27&&J!==6)&&(w=null)):(S=null,w=g),S!==w)){if(J=Ws,z="onMouseLeave",y="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(J=Fs,z="onPointerLeave",y="onPointerEnter",h="pointer"),_e=S==null?p:Ua(S),v=w==null?p:Ua(w),p=new J(z,h+"leave",S,l,T),p.target=_e,p.relatedTarget=v,z=null,Vl(T)===g&&(J=new J(y,h+"enter",w,l,T),J.target=v,J.relatedTarget=_e,z=J),_e=z,S&&w)t:{for(J=Bm,y=S,h=w,v=0,z=y;z;z=J(z))v++;z=0;for(var K=h;K;K=J(K))z++;for(;0<v-z;)y=J(y),v--;for(;0<z-v;)h=J(h),z--;for(;v--;){if(y===h||h!==null&&y===h.alternate){J=y;break t}y=J(y),h=J(h)}J=null}else J=null;S!==null&&Zr(C,p,S,J,!1),w!==null&&_e!==null&&Zr(C,_e,w,J,!0)}}e:{if(p=g?Ua(g):window,S=p.nodeName&&p.nodeName.toLowerCase(),S==="select"||S==="input"&&p.type==="file")var he=uf;else if(af(p))if(cf)he=kh;else{he=Kh;var L=Vh}else S=p.nodeName,!S||S.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?g&&ci(g.elementType)&&(he=uf):he=Jh;if(he&&(he=he(e,g))){nf(C,he,l,T);break e}L&&L(e,p,g),e==="focusout"&&g&&p.type==="number"&&g.memoizedProps.value!=null&&ii(p,"number",p.value)}switch(L=g?Ua(g):window,e){case"focusin":(af(L)||L.contentEditable==="true")&&(ea=L,Si=g,La=null);break;case"focusout":La=Si=ea=null;break;case"mousedown":ji=!0;break;case"contextmenu":case"mouseup":case"dragend":ji=!1,yf(C,l,T);break;case"selectionchange":if($h)break;case"keydown":case"keyup":yf(C,l,T)}var te;if(gi)e:{switch(e){case"compositionstart":var oe="onCompositionStart";break e;case"compositionend":oe="onCompositionEnd";break e;case"compositionupdate":oe="onCompositionUpdate";break e}oe=void 0}else Pl?tf(e,l)&&(oe="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(oe="onCompositionStart");oe&&(Is&&l.locale!=="ko"&&(Pl||oe!=="onCompositionStart"?oe==="onCompositionEnd"&&Pl&&(te=Js()):(ll=T,di="value"in ll?ll.value:ll.textContent,Pl=!0)),L=Cu(g,oe),0<L.length&&(oe=new $s(oe,e,null,l,T),C.push({event:oe,listeners:L}),te?oe.data=te:(te=lf(l),te!==null&&(oe.data=te)))),(te=wh?Xh(e,l):Qh(e,l))&&(oe=Cu(g,"onBeforeInput"),0<oe.length&&(L=new $s("onBeforeInput","beforeinput",null,l,T),C.push({event:L,listeners:oe}),L.data=te)),Rm(C,e,g,l,T)}Qr(C,t)})}function yn(e,t,l){return{instance:e,listener:t,currentTarget:l}}function Cu(e,t){for(var l=t+"Capture",a=[];e!==null;){var n=e,u=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||u===null||(n=qa(e,l),n!=null&&a.unshift(yn(e,n,u)),n=qa(e,t),n!=null&&a.push(yn(e,n,u))),e.tag===3)return a;e=e.return}return[]}function Bm(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zr(e,t,l,a,n){for(var u=t._reactName,c=[];l!==null&&l!==a;){var f=l,r=f.alternate,g=f.stateNode;if(f=f.tag,r!==null&&r===a)break;f!==5&&f!==26&&f!==27||g===null||(r=g,n?(g=qa(l,u),g!=null&&c.unshift(yn(l,g,r))):n||(g=qa(l,u),g!=null&&c.push(yn(l,g,r)))),l=l.return}c.length!==0&&e.push({event:t,listeners:c})}var Ym=/\r\n?/g,Gm=/\u0000|\uFFFD/g;function Vr(e){return(typeof e=="string"?e:""+e).replace(Ym,`+`).replace(Gm,"")}function Kr(e,t){return t=Vr(t),Vr(e)===t}function Ae(e,t,l,a,n,u){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||$l(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&$l(e,""+a);break;case"className":Un(e,"class",a);break;case"tabIndex":Un(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Un(e,l,a);break;case"style":Zs(e,a,u);break;case"data":if(t!=="object"){Un(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Hn(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(l,"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 u=="function"&&(l==="formAction"?(t!=="input"&&Ae(e,t,"name",n.name,n,null),Ae(e,t,"formEncType",n.formEncType,n,null),Ae(e,t,"formMethod",n.formMethod,n,null),Ae(e,t,"formTarget",n.formTarget,n,null)):(Ae(e,t,"encType",n.encType,n,null),Ae(e,t,"method",n.method,n,null),Ae(e,t,"target",n.target,n,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Hn(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=Bt);break;case"onScroll":a!=null&&ce("scroll",e);break;case"onScrollEnd":a!=null&&ce("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}l=Hn(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""+a):e.removeAttribute(l);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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":a===!0?e.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,a):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(l,a):e.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(l):e.setAttribute(l,a);break;case"popover":ce("beforetoggle",e),ce("toggle",e),Rn(e,"popover",a);break;case"xlinkActuate":Ht(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Ht(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Ht(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Ht(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Ht(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Ht(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Ht(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Ht(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Ht(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Rn(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=hh.get(l)||l,Rn(e,l,a))}}function Jc(e,t,l,a,n,u){switch(l){case"style":Zs(e,a,u);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"children":typeof a=="string"?$l(e,a):(typeof a=="number"||typeof a=="bigint")&&$l(e,""+a);break;case"onScroll":a!=null&&ce("scroll",e);break;case"onScrollEnd":a!=null&&ce("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Bt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qs.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(n=l.endsWith("Capture"),t=l.slice(2,n?l.length-7:void 0),u=e[lt]||null,u=u!=null?u[l]:null,typeof u=="function"&&e.removeEventListener(t,u,n),typeof a=="function")){typeof u!="function"&&u!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,a,n);break e}l in e?e[l]=a:a===!0?e.setAttribute(l,""):Rn(e,l,a)}}}function Ie(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ce("error",e),ce("load",e);var a=!1,n=!1,u;for(u in l)if(l.hasOwnProperty(u)){var c=l[u];if(c!=null)switch(u){case"src":a=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ae(e,t,u,c,l,null)}}n&&Ae(e,t,"srcSet",l.srcSet,l,null),a&&Ae(e,t,"src",l.src,l,null);return;case"input":ce("invalid",e);var f=u=c=n=null,r=null,g=null;for(a in l)if(l.hasOwnProperty(a)){var T=l[a];if(T!=null)switch(a){case"name":n=T;break;case"type":c=T;break;case"checked":r=T;break;case"defaultChecked":g=T;break;case"value":u=T;break;case"defaultValue":f=T;break;case"children":case"dangerouslySetInnerHTML":if(T!=null)throw Error(o(137,t));break;default:Ae(e,t,a,T,l,null)}}ws(e,u,f,r,g,c,n,!1);return;case"select":ce("invalid",e),a=c=u=null;for(n in l)if(l.hasOwnProperty(n)&&(f=l[n],f!=null))switch(n){case"value":u=f;break;case"defaultValue":c=f;break;case"multiple":a=f;default:Ae(e,t,n,f,l,null)}t=u,l=c,e.multiple=!!a,t!=null?Wl(e,!!a,t,!1):l!=null&&Wl(e,!!a,l,!0);return;case"textarea":ce("invalid",e),u=n=a=null;for(c in l)if(l.hasOwnProperty(c)&&(f=l[c],f!=null))switch(c){case"value":a=f;break;case"defaultValue":n=f;break;case"children":u=f;break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(o(91));break;default:Ae(e,t,c,f,l,null)}Qs(e,a,n,u);return;case"option":for(r in l)if(l.hasOwnProperty(r)&&(a=l[r],a!=null))switch(r){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Ae(e,t,r,a,l,null)}return;case"dialog":ce("beforetoggle",e),ce("toggle",e),ce("cancel",e),ce("close",e);break;case"iframe":case"object":ce("load",e);break;case"video":case"audio":for(a=0;a<mn.length;a++)ce(mn[a],e);break;case"image":ce("error",e),ce("load",e);break;case"details":ce("toggle",e);break;case"embed":case"source":case"link":ce("error",e),ce("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(g in l)if(l.hasOwnProperty(g)&&(a=l[g],a!=null))switch(g){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ae(e,t,g,a,l,null)}return;default:if(ci(t)){for(T in l)l.hasOwnProperty(T)&&(a=l[T],a!==void 0&&Jc(e,t,T,a,l,void 0));return}}for(f in l)l.hasOwnProperty(f)&&(a=l[f],a!=null&&Ae(e,t,f,a,l,null))}function wm(e,t,l,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,u=null,c=null,f=null,r=null,g=null,T=null;for(S in l){var C=l[S];if(l.hasOwnProperty(S)&&C!=null)switch(S){case"checked":break;case"value":break;case"defaultValue":r=C;default:a.hasOwnProperty(S)||Ae(e,t,S,null,a,C)}}for(var p in a){var S=a[p];if(C=l[p],a.hasOwnProperty(p)&&(S!=null||C!=null))switch(p){case"type":u=S;break;case"name":n=S;break;case"checked":g=S;break;case"defaultChecked":T=S;break;case"value":c=S;break;case"defaultValue":f=S;break;case"children":case"dangerouslySetInnerHTML":if(S!=null)throw Error(o(137,t));break;default:S!==C&&Ae(e,t,p,S,a,C)}}ui(e,c,f,r,g,T,u,n);return;case"select":S=c=f=p=null;for(u in l)if(r=l[u],l.hasOwnProperty(u)&&r!=null)switch(u){case"value":break;case"multiple":S=r;default:a.hasOwnProperty(u)||Ae(e,t,u,null,a,r)}for(n in a)if(u=a[n],r=l[n],a.hasOwnProperty(n)&&(u!=null||r!=null))switch(n){case"value":p=u;break;case"defaultValue":f=u;break;case"multiple":c=u;default:u!==r&&Ae(e,t,n,u,a,r)}t=f,l=c,a=S,p!=null?Wl(e,!!l,p,!1):!!a!=!!l&&(t!=null?Wl(e,!!l,t,!0):Wl(e,!!l,l?[]:"",!1));return;case"textarea":S=p=null;for(f in l)if(n=l[f],l.hasOwnProperty(f)&&n!=null&&!a.hasOwnProperty(f))switch(f){case"value":break;case"children":break;default:Ae(e,t,f,null,a,n)}for(c in a)if(n=a[c],u=l[c],a.hasOwnProperty(c)&&(n!=null||u!=null))switch(c){case"value":p=n;break;case"defaultValue":S=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(o(91));break;default:n!==u&&Ae(e,t,c,n,a,u)}Xs(e,p,S);return;case"option":for(var w in l)if(p=l[w],l.hasOwnProperty(w)&&p!=null&&!a.hasOwnProperty(w))switch(w){case"selected":e.selected=!1;break;default:Ae(e,t,w,null,a,p)}for(r in a)if(p=a[r],S=l[r],a.hasOwnProperty(r)&&p!==S&&(p!=null||S!=null))switch(r){case"selected":e.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Ae(e,t,r,p,a,S)}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 J in l)p=l[J],l.hasOwnProperty(J)&&p!=null&&!a.hasOwnProperty(J)&&Ae(e,t,J,null,a,p);for(g in a)if(p=a[g],S=l[g],a.hasOwnProperty(g)&&p!==S&&(p!=null||S!=null))switch(g){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(o(137,t));break;default:Ae(e,t,g,p,a,S)}return;default:if(ci(t)){for(var _e in l)p=l[_e],l.hasOwnProperty(_e)&&p!==void 0&&!a.hasOwnProperty(_e)&&Jc(e,t,_e,void 0,a,p);for(T in a)p=a[T],S=l[T],!a.hasOwnProperty(T)||p===S||p===void 0&&S===void 0||Jc(e,t,T,p,a,S);return}}for(var y in l)p=l[y],l.hasOwnProperty(y)&&p!=null&&!a.hasOwnProperty(y)&&Ae(e,t,y,null,a,p);for(C in a)p=a[C],S=l[C],!a.hasOwnProperty(C)||p===S||p==null&&S==null||Ae(e,t,C,p,a,S)}function Jr(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Xm(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),a=0;a<l.length;a++){var n=l[a],u=n.transferSize,c=n.initiatorType,f=n.duration;if(u&&f&&Jr(c)){for(c=0,f=n.responseEnd,a+=1;a<l.length;a++){var r=l[a],g=r.startTime;if(g>f)break;var T=r.transferSize,C=r.initiatorType;T&&Jr(C)&&(r=r.responseEnd,c+=T*(r<f?1:(f-g)/(r-g)))}if(--a,t+=8*(u+c)/(n.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 kc=null,Wc=null;function Du(e){return e.nodeType===9?e:e.ownerDocument}function kr(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 Wr(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 $c(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 Fc=null;function Qm(){var e=window.event;return e&&e.type==="popstate"?e===Fc?!1:(Fc=e,!0):(Fc=null,!1)}var $r=typeof setTimeout=="function"?setTimeout:void 0,Lm=typeof clearTimeout=="function"?clearTimeout:void 0,Fr=typeof Promise=="function"?Promise:void 0,Zm=typeof queueMicrotask=="function"?queueMicrotask:typeof Fr<"u"?function(e){return Fr.resolve(null).then(e).catch(Vm)}:$r;function Vm(e){setTimeout(function(){throw e})}function bl(e){return e==="head"}function Ir(e,t){var l=t,a=0;do{var n=l.nextSibling;if(e.removeChild(l),n&&n.nodeType===8)if(l=n.data,l==="/$"||l==="/&"){if(a===0){e.removeChild(n),za(t);return}a--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")a++;else if(l==="html")vn(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,vn(l);for(var u=l.firstChild;u;){var c=u.nextSibling,f=u.nodeName;u[Ra]||f==="SCRIPT"||f==="STYLE"||f==="LINK"&&u.rel.toLowerCase()==="stylesheet"||l.removeChild(u),u=c}}else l==="body"&&vn(e.ownerDocument.body);l=n}while(l);za(t)}function Pr(e,t){var l=e;e=0;do{var a=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),a&&a.nodeType===8)if(l=a.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=a}while(l)}function Ic(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Ic(l),ai(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Km(e,t,l,a){for(;e.nodeType===1;){var n=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Ra])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=zt(e.nextSibling),e===null)break}return null}function Jm(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=zt(e.nextSibling),e===null))return null;return e}function ed(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=zt(e.nextSibling),e===null))return null;return e}function Pc(e){return e.data==="$?"||e.data==="$~"}function es(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function km(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var a=function(){t(),l.removeEventListener("DOMContentLoaded",a)};l.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function zt(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 ts=null;function td(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return zt(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function ld(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function ad(e,t,l){switch(t=Du(l),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function vn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ai(e)}var Ot=new Map,nd=new Set;function Mu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Pt=N.d;N.d={f:Wm,r:$m,D:Fm,C:Im,L:Pm,m:ey,X:ly,S:ty,M:ay};function Wm(){var e=Pt.f(),t=Tu();return e||t}function $m(e){var t=Kl(e);t!==null&&t.tag===5&&t.type==="form"?So(t):Pt.r(e)}var Ea=typeof document>"u"?null:document;function ud(e,t,l){var a=Ea;if(a&&typeof t=="string"&&t){var n=xt(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),nd.has(n)||(nd.add(n),e={rel:e,crossOrigin:l,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),Ie(t,"link",e),Ke(t),a.head.appendChild(t)))}}function Fm(e){Pt.D(e),ud("dns-prefetch",e,null)}function Im(e,t){Pt.C(e,t),ud("preconnect",e,t)}function Pm(e,t,l){Pt.L(e,t,l);var a=Ea;if(a&&e&&t){var n='link[rel="preload"][as="'+xt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+xt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+xt(l.imageSizes)+'"]')):n+='[href="'+xt(e)+'"]';var u=n;switch(t){case"style":u=Aa(e);break;case"script":u=_a(e)}Ot.has(u)||(e=O({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Ot.set(u,e),a.querySelector(n)!==null||t==="style"&&a.querySelector(gn(u))||t==="script"&&a.querySelector(pn(u))||(t=a.createElement("link"),Ie(t,"link",e),Ke(t),a.head.appendChild(t)))}}function ey(e,t){Pt.m(e,t);var l=Ea;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+xt(a)+'"][href="'+xt(e)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=_a(e)}if(!Ot.has(u)&&(e=O({rel:"modulepreload",href:e},t),Ot.set(u,e),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(pn(u)))return}a=l.createElement("link"),Ie(a,"link",e),Ke(a),l.head.appendChild(a)}}}function ty(e,t,l){Pt.S(e,t,l);var a=Ea;if(a&&e){var n=Jl(a).hoistableStyles,u=Aa(e);t=t||"default";var c=n.get(u);if(!c){var f={loading:0,preload:null};if(c=a.querySelector(gn(u)))f.loading=5;else{e=O({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Ot.get(u))&&ls(e,l);var r=c=a.createElement("link");Ke(r),Ie(r,"link",e),r._p=new Promise(function(g,T){r.onload=g,r.onerror=T}),r.addEventListener("load",function(){f.loading|=1}),r.addEventListener("error",function(){f.loading|=2}),f.loading|=4,Ru(c,t,a)}c={type:"stylesheet",instance:c,count:1,state:f},n.set(u,c)}}}function ly(e,t){Pt.X(e,t);var l=Ea;if(l&&e){var a=Jl(l).hoistableScripts,n=_a(e),u=a.get(n);u||(u=l.querySelector(pn(n)),u||(e=O({src:e,async:!0},t),(t=Ot.get(n))&&as(e,t),u=l.createElement("script"),Ke(u),Ie(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function ay(e,t){Pt.M(e,t);var l=Ea;if(l&&e){var a=Jl(l).hoistableScripts,n=_a(e),u=a.get(n);u||(u=l.querySelector(pn(n)),u||(e=O({src:e,async:!0,type:"module"},t),(t=Ot.get(n))&&as(e,t),u=l.createElement("script"),Ke(u),Ie(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function id(e,t,l,a){var n=(n=ue.current)?Mu(n):null;if(!n)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Aa(l.href),l=Jl(n).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Aa(l.href);var u=Jl(n).hoistableStyles,c=u.get(e);if(c||(n=n.ownerDocument||n,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,c),(u=n.querySelector(gn(e)))&&!u._p&&(c.instance=u,c.state.loading=5),Ot.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Ot.set(e,l),u||ny(n,e,l,c.state))),t&&a===null)throw Error(o(528,""));return c}if(t&&a!==null)throw Error(o(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=_a(l),l=Jl(n).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Aa(e){return'href="'+xt(e)+'"'}function gn(e){return'link[rel="stylesheet"]['+e+"]"}function cd(e){return O({},e,{"data-precedence":e.precedence,precedence:null})}function ny(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),Ie(t,"link",l),Ke(t),e.head.appendChild(t))}function _a(e){return'[src="'+xt(e)+'"]'}function pn(e){return"script[async]"+e}function sd(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+xt(l.href)+'"]');if(a)return t.instance=a,Ke(a),a;var n=O({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Ke(a),Ie(a,"style",n),Ru(a,l.precedence,e),t.instance=a;case"stylesheet":n=Aa(l.href);var u=e.querySelector(gn(n));if(u)return t.state.loading|=4,t.instance=u,Ke(u),u;a=cd(l),(n=Ot.get(n))&&ls(a,n),u=(e.ownerDocument||e).createElement("link"),Ke(u);var c=u;return c._p=new Promise(function(f,r){c.onload=f,c.onerror=r}),Ie(u,"link",a),t.state.loading|=4,Ru(u,l.precedence,e),t.instance=u;case"script":return u=_a(l.src),(n=e.querySelector(pn(u)))?(t.instance=n,Ke(n),n):(a=l,(n=Ot.get(u))&&(a=O({},l),as(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),Ke(n),Ie(n,"link",a),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Ru(a,l.precedence,e));return t.instance}function Ru(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,c=0;c<a.length;c++){var f=a[c];if(f.dataset.precedence===t)u=f;else if(u!==n)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function ls(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function as(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Uu=null;function fd(e,t,l){if(Uu===null){var a=new Map,n=Uu=new Map;n.set(l,a)}else n=Uu,a=n.get(l),a||(a=new Map,n.set(l,a));if(a.has(e))return a;for(a.set(e,null),l=l.getElementsByTagName(e),n=0;n<l.length;n++){var u=l[n];if(!(u[Ra]||u[ke]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var c=u.getAttribute(t)||"";c=e+c;var f=a.get(c);f?f.push(u):a.set(c,[u])}}return a}function od(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function uy(e,t,l){if(l===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;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!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 rd(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function iy(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var n=Aa(a.href),u=t.querySelector(gn(n));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=qu.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=u,Ke(u);return}u=t.ownerDocument||t,a=cd(a),(n=Ot.get(n))&&ls(a,n),u=u.createElement("link"),Ke(u);var c=u;c._p=new Promise(function(f,r){c.onload=f,c.onerror=r}),Ie(u,"link",a),l.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=qu.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var ns=0;function cy(e,t){return e.stylesheets&&e.count===0&&Bu(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&Bu(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&ns===0&&(ns=62500*Xm());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bu(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>ns?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function qu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Hu=null;function Bu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Hu=new Map,t.forEach(sy,e),Hu=null,qu.call(e))}function sy(e,t){if(!(t.state.loading&4)){var l=Hu.get(e);if(l)var a=l.get(null);else{l=new Map,Hu.set(e,l);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<n.length;u++){var c=n[u];(c.nodeName==="LINK"||c.getAttribute("media")!=="not all")&&(l.set(c.dataset.precedence,c),a=c)}a&&l.set(null,a)}n=t.instance,c=n.getAttribute("data-precedence"),u=l.get(c)||a,u===a&&l.set(null,n),l.set(c,n),this.count++,a=qu.bind(this),n.addEventListener("load",a),n.addEventListener("error",a),u?u.parentNode.insertBefore(n,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var bn={$$typeof:le,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function fy(e,t,l,a,n,u,c,f,r){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=Pu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pu(0),this.hiddenUpdates=Pu(null),this.identifierPrefix=a,this.onUncaughtError=n,this.onCaughtError=u,this.onRecoverableError=c,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=r,this.incompleteTransitions=new Map}function dd(e,t,l,a,n,u,c,f,r,g,T,C){return e=new fy(e,t,l,c,r,g,T,C,f),t=1,u===!0&&(t|=24),u=ht(3,null,null,t),e.current=u,u.stateNode=e,t=Bi(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:a,isDehydrated:l,cache:t},Xi(u),e}function hd(e){return e?(e=aa,e):aa}function md(e,t,l,a,n,u){n=hd(n),a.context===null?a.context=n:a.pendingContext=n,a=sl(t),a.payload={element:l},u=u===void 0?null:u,u!==null&&(a.callback=u),l=fl(e,a,t),l!==null&&(st(l,e,t),$a(l,e,t))}function yd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function us(e,t){yd(e,t),(e=e.alternate)&&yd(e,t)}function vd(e){if(e.tag===13||e.tag===31){var t=Dl(e,67108864);t!==null&&st(t,e,67108864),us(e,67108864)}}function gd(e){if(e.tag===13||e.tag===31){var t=pt();t=ei(t);var l=Dl(e,t);l!==null&&st(l,e,t),us(e,t)}}var Yu=!0;function oy(e,t,l,a){var n=j.T;j.T=null;var u=N.p;try{N.p=2,is(e,t,l,a)}finally{N.p=u,j.T=n}}function ry(e,t,l,a){var n=j.T;j.T=null;var u=N.p;try{N.p=8,is(e,t,l,a)}finally{N.p=u,j.T=n}}function is(e,t,l,a){if(Yu){var n=cs(a);if(n===null)Kc(e,t,a,Gu,l),bd(e,a);else if(hy(n,e,t,l,a))a.stopPropagation();else if(bd(e,a),t&4&&-1<dy.indexOf(e)){for(;n!==null;){var u=Kl(n);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var c=_l(u.pendingLanes);if(c!==0){var f=u;for(f.pendingLanes|=2,f.entangledLanes|=2;c;){var r=1<<31-rt(c);f.entanglements[1]|=r,c&=~r}qt(u),(ye&6)===0&&(Su=ft()+500,hn(0))}}break;case 31:case 13:f=Dl(u,2),f!==null&&st(f,u,2),Tu(),us(u,2)}if(u=cs(a),u===null&&Kc(e,t,a,Gu,l),u===n)break;n=u}n!==null&&a.stopPropagation()}else Kc(e,t,a,null,l)}}function cs(e){return e=fi(e),ss(e)}var Gu=null;function ss(e){if(Gu=null,e=Vl(e),e!==null){var t=_(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=q(t),e!==null)return e;e=null}else if(l===31){if(e=H(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Gu=e,null}function pd(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(Fd()){case Es:return 2;case As:return 8;case On:case Id:return 32;case _s:return 268435456;default:return 32}default:return 32}}var fs=!1,xl=null,Sl=null,jl=null,xn=new Map,Sn=new Map,Tl=[],dy="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 bd(e,t){switch(e){case"focusin":case"focusout":xl=null;break;case"dragenter":case"dragleave":Sl=null;break;case"mouseover":case"mouseout":jl=null;break;case"pointerover":case"pointerout":xn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sn.delete(t.pointerId)}}function jn(e,t,l,a,n,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:l,eventSystemFlags:a,nativeEvent:u,targetContainers:[n]},t!==null&&(t=Kl(t),t!==null&&vd(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function hy(e,t,l,a,n){switch(t){case"focusin":return xl=jn(xl,e,t,l,a,n),!0;case"dragenter":return Sl=jn(Sl,e,t,l,a,n),!0;case"mouseover":return jl=jn(jl,e,t,l,a,n),!0;case"pointerover":var u=n.pointerId;return xn.set(u,jn(xn.get(u)||null,e,t,l,a,n)),!0;case"gotpointercapture":return u=n.pointerId,Sn.set(u,jn(Sn.get(u)||null,e,t,l,a,n)),!0}return!1}function xd(e){var t=Vl(e.target);if(t!==null){var l=_(t);if(l!==null){if(t=l.tag,t===13){if(t=q(l),t!==null){e.blockedOn=t,Ms(e.priority,function(){gd(l)});return}}else if(t===31){if(t=H(l),t!==null){e.blockedOn=t,Ms(e.priority,function(){gd(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function wu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=cs(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);si=a,l.target.dispatchEvent(a),si=null}else return t=Kl(l),t!==null&&vd(t),e.blockedOn=l,!1;t.shift()}return!0}function Sd(e,t,l){wu(e)&&l.delete(t)}function my(){fs=!1,xl!==null&&wu(xl)&&(xl=null),Sl!==null&&wu(Sl)&&(Sl=null),jl!==null&&wu(jl)&&(jl=null),xn.forEach(Sd),Sn.forEach(Sd)}function Xu(e,t){e.blockedOn===t&&(e.blockedOn=null,fs||(fs=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,my)))}var Qu=null;function jd(e){Qu!==e&&(Qu=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Qu===e&&(Qu=null);for(var t=0;t<e.length;t+=3){var l=e[t],a=e[t+1],n=e[t+2];if(typeof a!="function"){if(ss(a||l)===null)continue;break}var u=Kl(l);u!==null&&(e.splice(t,3),t-=3,cc(u,{pending:!0,data:n,method:l.method,action:a},a,n))}}))}function za(e){function t(r){return Xu(r,e)}xl!==null&&Xu(xl,e),Sl!==null&&Xu(Sl,e),jl!==null&&Xu(jl,e),xn.forEach(t),Sn.forEach(t);for(var l=0;l<Tl.length;l++){var a=Tl[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Tl.length&&(l=Tl[0],l.blockedOn===null);)xd(l),l.blockedOn===null&&Tl.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(a=0;a<l.length;a+=3){var n=l[a],u=l[a+1],c=n[lt]||null;if(typeof u=="function")c||jd(l);else if(c){var f=null;if(u&&u.hasAttribute("formAction")){if(n=u,c=u[lt]||null)f=c.formAction;else if(ss(n)!==null)continue}else f=c.action;typeof f=="function"?l[a+1]=f:(l.splice(a,3),a-=3),jd(l)}}}function Td(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(c){return n=c})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),a||setTimeout(l,20)}function l(){if(!a&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,n=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),n!==null&&(n(),n=null)}}}function os(e){this._internalRoot=e}Lu.prototype.render=os.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var l=t.current,a=pt();md(l,a,e,t,null,null)},Lu.prototype.unmount=os.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;md(e.current,2,null,e,null,null),Tu(),t[Zl]=null}};function Lu(e){this._internalRoot=e}Lu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ds();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Tl.length&&t!==0&&t<Tl[l].priority;l++);Tl.splice(l,0,e),l===0&&xd(e)}};var Ed=x.version;if(Ed!=="19.2.5")throw Error(o(527,Ed,"19.2.5"));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=d(t),e=e!==null?D(e):null,e=e===null?null:e.stateNode,e};var yy={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zu.isDisabled&&Zu.supportsFiber)try{Ca=Zu.inject(yy),ot=Zu}catch{}}return En.createRoot=function(e,t){if(!E(e))throw Error(o(299));var l=!1,a="",n=Do,u=Mo,c=Ro;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=dd(e,1,!1,null,null,l,a,null,n,u,c,Td),e[Zl]=t.current,Vc(e),new os(t)},En.hydrateRoot=function(e,t,l){if(!E(e))throw Error(o(299));var a=!1,n="",u=Do,c=Mo,f=Ro,r=null;return l!=null&&(l.unstable_strictMode===!0&&(a=!0),l.identifierPrefix!==void 0&&(n=l.identifierPrefix),l.onUncaughtError!==void 0&&(u=l.onUncaughtError),l.onCaughtError!==void 0&&(c=l.onCaughtError),l.onRecoverableError!==void 0&&(f=l.onRecoverableError),l.formState!==void 0&&(r=l.formState)),t=dd(e,1,!0,t,l??null,a,n,r,u,c,f,Td),t.context=hd(null),l=t.current,a=pt(),a=ei(a),n=sl(a),n.callback=null,fl(l,n,a),l=a,t.current.lanes=l,Ma(t,l),qt(t),e[Zl]=t.current,Vc(e),new Lu(t)},En.version="19.2.5",En}var Ud;function Ay(){if(Ud)return hs.exports;Ud=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(x){console.error(x)}}return s(),hs.exports=Ey(),hs.exports}var _y=Ay();const zy=wd(_y),Qd="";class An extends Error{constructor(x,b,o){super(x),this.status=b,this.outcome=o}}function Ss(s){return s instanceof An?s.outcome?s.outcome==="unknown":s.status>=500||s.status===408:!0}async function Ne(s,x){const b=await fetch(`${Qd}${s}`,{...x,credentials:"same-origin",headers:{"Content-Type":"application/json",...x==null?void 0:x.headers}});if(!b.ok){const o=await b.json().catch(()=>null);b.status===401&&(window.location.hash="#login");const E=b.status===429?` Wait ${b.headers.get("retry-after")||"60"} seconds before retrying.`:"",_=typeof(o==null?void 0:o.message)=="string"?o.message:typeof(o==null?void 0:o.error)=="string"?o.error:`HTTP ${b.status}`,q=typeof(o==null?void 0:o.next_action)=="string"?` ${o.next_action}`:"",H=(o==null?void 0:o.outcome)==="unknown"||(o==null?void 0:o.outcome)==="failed"?o.outcome:void 0;throw new An(_+q+E,b.status,H)}return b.json()}async function Oy(s){const x=await fetch(`${Qd}${s}`,{credentials:"same-origin"});if(x.status===401)throw window.location.hash="#login",new Error("Unauthorized");if(!x.ok)throw new Error(`HTTP ${x.status}`);return x.text()}const be={oauthRequest:s=>Ne(`/admin/api/oauth-requests/${encodeURIComponent(s)}`),decideOAuthRequest:(s,x,b)=>Ne(`/admin/api/oauth-requests/${encodeURIComponent(s)}`,{method:"POST",body:JSON.stringify({decision:x,csrf:b})}),login:s=>Ne("/admin/login",{method:"POST",body:JSON.stringify({token:s})}),signOutEverywhere:()=>Ne("/admin/api/sign-out-everywhere",{method:"POST"}),stats:()=>Ne("/admin/api/stats"),health:()=>Ne("/admin/api/health-indicators"),agents:()=>Ne("/admin/api/agents"),agentsSpend:()=>Ne("/admin/api/agents/spend"),sources:()=>Ne("/admin/api/sources"),grantCatalog:()=>Ne("/admin/api/grant-catalog"),clientGrant:s=>Ne(`/admin/api/grants/${encodeURIComponent(s)}`),clientDetails:s=>Ne(`/admin/api/clients/${encodeURIComponent(s)}`),clientSetup:(s,x,b)=>{const o=new URLSearchParams({harness:x});return b&&o.set("flow",b),Ne(`/admin/api/clients/${encodeURIComponent(s)}/setup?${o}`)},clientLifecycle:(s,x)=>Ne(`/admin/api/clients/${encodeURIComponent(s)}/lifecycle`,{method:"POST",body:JSON.stringify(x)}),registerClient:s=>Ne("/admin/api/register-client",{method:"POST",body:JSON.stringify(s)}),recoverClient:(s,x,b)=>Ne("/admin/api/recover-client",{method:"POST",body:JSON.stringify({clientId:s,harness:x,flow:b})}),updateClientGrant:(s,x)=>Ne("/admin/api/rescope-client",{method:"POST",body:JSON.stringify({...x,clientId:s})}),requests:(s=1,x="")=>Ne(`/admin/api/requests?page=${s}${x}`),apiKeys:()=>Ne("/admin/api/api-keys"),createApiKey(s,x){return Ne("/admin/api/api-keys",{method:"POST",body:JSON.stringify({name:s,scopes:x})})},revokeApiKey(s){return Ne("/admin/api/api-keys/revoke",{method:"POST",body:JSON.stringify({id:s})})},updateClientTtl:(s,x)=>Ne("/admin/api/update-client-ttl",{method:"POST",body:JSON.stringify({clientId:s,tokenTtl:x})}),rescopeClient:(s,x,b)=>Ne("/admin/api/rescope-client",{method:"POST",body:JSON.stringify({clientId:s,sourceId:x,federatedRead:b})}),revokeClient:s=>Ne("/admin/api/revoke-client",{method:"POST",body:JSON.stringify({clientId:s})}),calibrationProfile:s=>Ne(`/admin/api/calibration/profile${s?`?holder=${encodeURIComponent(s)}`:""}`),calibrationChart:(s,x)=>Oy(`/admin/api/calibration/charts/${encodeURIComponent(s)}${x?`?holder=${encodeURIComponent(x)}`:""}`),jobsWatch:()=>Ne("/admin/api/jobs/watch")},ps="gbrain.pending-oauth-request",qd=s=>s!==null&&/^[a-f0-9]{64}$/.test(s);function Ku(){const s=new URL(window.location.href).searchParams.get("oauth_request");if(qd(s)){try{window.sessionStorage.setItem(ps,s)}catch{}return s}try{const x=window.sessionStorage.getItem(ps);if(qd(x))return x}catch{}}function Hd(){try{window.sessionStorage.removeItem(ps)}catch{}const s=new URL(window.location.href);s.searchParams.delete("oauth_request"),window.history.replaceState(null,"",s)}function Ny(s,x){const b=x?` --oauth-request ${x}`:"";return`Give me an owner admin login link for ${s}. On the brain host, run gbrain mcp admin login-link --url ${s}${b} using its protected owner credential. Deliver the single-use link privately and do not open it before I do.`}function Cy({onLogin:s}){const[x,b]=U.useState(""),[o,E]=U.useState(""),[_,q]=U.useState(!1),[H,A]=U.useState(!1),[d,D]=U.useState(""),[O,R]=U.useState(),[Q,G]=U.useState(""),[Z,W]=U.useState(0),ae=Ku(),$=O?Ny(O,ae):void 0;U.useEffect(()=>{let ne=!0;const xe=new AbortController,k=setTimeout(()=>xe.abort(),1e4);return R(void 0),G(""),A(!1),fetch("/.well-known/gbrain",{credentials:"omit",redirect:"error",cache:"no-store",signal:xe.signal}).then(async V=>{if(!V.ok)throw new Error("Server discovery is unavailable.");const Se=await V.json();if(typeof(Se==null?void 0:Se.endpoint)!="string")throw new Error("Server discovery has no MCP endpoint.");const je=new URL(Se.endpoint);if(!["https:","http:"].includes(je.protocol)||je.username||je.password||je.search||je.hash||je.pathname!=="/mcp")throw new Error("Server discovery returned an invalid MCP endpoint.");ne&&R(je.toString())}).catch(()=>{ne&&G("The configured MCP endpoint could not be discovered. Ask the brain host administrator to check the server’s configured public URL. You can still sign in with the owner credential below.")}).finally(()=>clearTimeout(k)),()=>{ne=!1,clearTimeout(k),xe.abort()}},[Z]);const le=async ne=>{ne.preventDefault(),E(""),q(!0);try{await be.login(x),b(""),s()}catch(xe){E(xe instanceof An&&xe.status===401?"The owner bootstrap credential was not accepted. An OAuth access token or client secret cannot log into this dashboard. Ask the brain host administrator for a fresh login link.":xe instanceof Error?xe.message:"Could not reach the owner login service. Check the server and retry.")}finally{q(!1)}};return i.jsx("div",{className:"login-page",children:i.jsxs("section",{className:"login-box","aria-labelledby":"owner-login-title",style:{maxWidth:560},children:[i.jsx("h1",{id:"owner-login-title",className:"login-logo",children:"GBrain owner login"}),i.jsx("p",{style:{marginBottom:16},children:"Ask the agent that administers the brain host for a login link. Ordinary MCP clients cannot create owner login links, even with an admin scope."}),ae&&i.jsx("p",{role:"status",style:{marginBottom:16},children:"A client connection is waiting for owner approval. The prompt below preserves that request when you open the login link in another browser or tab."}),$&&i.jsxs(i.Fragment,{children:[i.jsx("label",{htmlFor:"owner-login-prompt",children:"Prompt for the host administrator"}),i.jsx("textarea",{id:"owner-login-prompt",rows:7,readOnly:!0,value:$,style:{fontFamily:"var(--font-mono)",fontSize:12}}),i.jsx("button",{type:"button",className:"btn btn-secondary",style:{marginTop:8},onClick:()=>{D(""),navigator.clipboard.writeText($).then(()=>A(!0)).catch(()=>D("Clipboard unavailable. Select and copy the prompt above."))},children:H?"Prompt copied":"Copy owner login prompt"})]}),!$&&!Q&&i.jsx("p",{role:"status",children:"Discovering the server’s configured MCP endpoint…"}),Q&&i.jsxs("p",{role:"alert",children:[Q," ",i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>W(ne=>ne+1),children:"Retry server discovery"})]}),d&&i.jsx("p",{role:"alert",children:d}),i.jsx("p",{className:"grant-help",style:{margin:"12px 0 20px"},children:"Login links expire after five minutes and can be used once. A client’s PKCE sign-in requests access to memory; owner login approves that request."}),i.jsxs("details",{children:[i.jsx("summary",{style:{cursor:"pointer"},children:"Sign in with the owner bootstrap credential"}),i.jsxs("form",{onSubmit:le,style:{marginTop:12},children:[i.jsx("label",{htmlFor:"owner-bootstrap-token",children:"Owner bootstrap credential"}),i.jsx("input",{id:"owner-bootstrap-token",type:"password",autoComplete:"off",value:x,disabled:_,onChange:ne=>b(ne.target.value)}),i.jsx("button",{type:"submit",className:"btn btn-primary",style:{width:"100%",marginTop:12},disabled:_||!x.trim(),children:_?"Signing in…":"Sign in as owner"}),o&&i.jsx("p",{role:"alert",className:"login-error",children:o})]})]})]})})}function Dy(){const[s,x]=U.useState({connected_agents:0,requests_today:0,active_tokens:0}),[b,o]=U.useState({expiring_soon:0,error_rate:"0%"}),[E,_]=U.useState([]),[q,H]=U.useState("connecting"),A=U.useRef(null);U.useEffect(()=>{be.stats().then(x).catch(()=>{}),be.health().then(o).catch(()=>{});const D=new EventSource("/admin/events",{withCredentials:!0});A.current=D,D.onopen=()=>H("connected"),D.onmessage=R=>{try{const Q=JSON.parse(R.data);_(G=>[Q,...G].slice(0,50))}catch{}},D.onerror=()=>{H("disconnected"),setTimeout(()=>{H("connecting"),D.close()},3e3)};const O=setInterval(()=>{be.stats().then(x).catch(()=>{}),be.health().then(o).catch(()=>{})},3e4);return()=>{D.close(),clearInterval(O)}},[]);const d=D=>{const O=Date.now()-new Date(D).getTime();return O<6e4?`${Math.floor(O/1e3)}s ago`:O<36e5?`${Math.floor(O/6e4)} min ago`:`${Math.floor(O/36e5)}h ago`};return i.jsxs(i.Fragment,{children:[i.jsx("h1",{className:"page-title",children:"Dashboard"}),i.jsxs("div",{style:{display:"flex",gap:24},children:[i.jsxs("div",{style:{flex:1},children:[i.jsxs("div",{className:"metrics",children:[i.jsxs("div",{className:"metric",children:[i.jsx("div",{className:"metric-value",children:s.connected_agents}),i.jsx("div",{className:"metric-label",children:"Connected Agents"})]}),i.jsxs("div",{className:"metric",children:[i.jsx("div",{className:"metric-value",children:s.requests_today}),i.jsx("div",{className:"metric-label",children:"Requests Today"})]}),i.jsxs("div",{className:"metric",children:[i.jsx("div",{className:"metric-value",children:s.active_tokens}),i.jsx("div",{className:"metric-label",children:"Active Tokens"})]})]}),i.jsxs("h2",{className:"section-title",children:["Live Activity",i.jsx("span",{style:{marginLeft:8,fontSize:10,color:q==="connected"?"var(--success)":q==="connecting"?"var(--warning)":"var(--error)"},children:q==="connected"?"● connected":q==="connecting"?"● connecting...":"● disconnected"})]}),i.jsx("div",{className:"feed",children:E.length===0?i.jsx("div",{className:"feed-empty",children:q==="connected"?"No requests yet. Agents will appear when they connect.":"Connecting..."}):i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Agent"}),i.jsx("th",{children:"Operation"}),i.jsx("th",{children:"Scopes"}),i.jsx("th",{children:"Latency"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Time"})]})}),i.jsx("tbody",{children:E.map((D,O)=>i.jsxs("tr",{children:[i.jsx("td",{className:"mono",children:D.agent}),i.jsx("td",{className:"mono",children:D.operation}),i.jsx("td",{children:D.scopes.split(",").map(R=>i.jsx("span",{className:`badge badge-${R.trim()}`,style:{marginRight:4},children:R.trim()},R))}),i.jsxs("td",{className:"mono",children:[D.latency_ms," ms"]}),i.jsx("td",{children:i.jsx("span",{className:`badge badge-${D.status}`,children:D.status})}),i.jsx("td",{style:{color:"var(--text-secondary)"},children:d(D.timestamp)})]},O))})]})})]}),i.jsxs("div",{style:{width:220},children:[i.jsx("h2",{className:"section-title",children:"Token Health"}),i.jsxs("div",{className:"health-panel",children:[i.jsxs("div",{className:"health-row",children:[i.jsx("span",{style:{color:"var(--warning)"},children:"Expiring Soon"}),i.jsx("span",{className:"mono",children:b.expiring_soon})]}),i.jsxs("div",{className:"health-row",children:[i.jsx("span",{style:{color:"var(--error)"},children:"Error Rate"}),i.jsx("span",{className:"mono",children:b.error_rate})]})]})]})]})]})}const Oa=s=>s.split(/[\s,]+/).filter(Boolean);function bs(s){var x,b,o;return{profile:(s==null?void 0:s.profile)??"memory-writer",applyProfile:!s,source:(s==null?void 0:s.sourceId)??"default",reads:(s==null?void 0:s.federatedRead)??["default"],scopes:(s==null?void 0:s.scopes.join(" "))??"",directPrefixes:((x=s==null?void 0:s.boundSlugPrefixes)==null?void 0:x.join(``))??"",tools:(s==null?void 0:s.boundTools)??[],namespace:(s==null?void 0:s.delegatedNamespace)??"job",delegatedPrefixes:((b=s==null?void 0:s.delegatedSlugPrefixes)==null?void 0:b.join(``))??"",concurrency:String((s==null?void 0:s.boundMaxConcurrent)??1),budget:(s==null?void 0:s.budgetUsdPerDay)??"unlimited",ttl:s?String(s.tokenTtlSeconds??0):"3600",surface:(s==null?void 0:s.surface)??"starter",operationSnapshot:((o=s==null?void 0:s.allowedOperations)==null?void 0:o.join(`-`))??"",editOperations:!1}}function Ld(s){const S=s.scopes?Oa(s.scopes).includes("agent"):["full","delegating-agent"].includes(s.profile);return{...s.applyProfile?{profile:s.profile}:{},sourceId:s.source,federatedRead:s.reads,boundSlugPrefixes:s.directPrefixes.trim()?Oa(s.directPrefixes):null,...s.scopes.trim()?{scopes:Oa(s.scopes)}:{},...s.editOperations?{allowedOperations:Oa(s.operationSnapshot)}:{},...S?{boundTools:s.tools,boundSourceId:s.source,delegatedNamespace:s.namespace,delegatedSlugPrefixes:s.namespace==="job"?null:Oa(s.delegatedPrefixes)}:{},boundMaxConcurrent:Number(s.concurrency),budgetUsdPerDay:s.budget==="unlimited"?null:s.budget,tokenTtl:s.ttl==="0"?null:Number(s.ttl),surface:s.surface==="default"?null:s.surface}}function Zd(s){return{...s.profile?{profile:s.profile}:{},scopes:s.scopes,sourceId:s.sourceId,federatedRead:s.federatedRead,boundSlugPrefixes:s.boundSlugPrefixes,allowedOperations:s.allowedOperations,boundTools:s.boundTools,boundSourceId:s.boundSourceId,boundBrainId:s.boundBrainId,delegatedNamespace:s.delegatedNamespace,delegatedSlugPrefixes:s.delegatedSlugPrefixes,boundMaxConcurrent:s.boundMaxConcurrent,budgetUsdPerDay:s.budgetUsdPerDay,tokenTtlSeconds:s.tokenTtlSeconds,surface:s.surface}}function Vd({draft:s,setDraft:S,sources:b,catalog:o,existing:E=!1}){const _=(d,O)=>S({...s,[d]:O}),q=new Set(b.map(d=>d.id)),H=s.scopes?Oa(s.scopes).includes("agent"):["full","delegating-agent"].includes(s.profile),A={marginBottom:14};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:A,children:[i.jsx("label",{htmlFor:"grant-profile",children:"Permission profile"}),i.jsx("select",{id:"grant-profile",value:s.profile,onChange:d=>S({...s,profile:d.target.value,applyProfile:!0,scopes:"",editOperations:!1,surface:["operator","full"].includes(d.target.value)?"full":"starter"}),children:o.profiles.map(d=>i.jsx("option",{children:d},d))}),i.jsx("p",{className:"grant-help",children:"Memory writer lets this agent recall, save, correct, and withdraw memory. Delegating profiles also allow selected server tools to run jobs."}),E&&i.jsxs("label",{className:"checkbox-label",children:[i.jsx("input",{type:"checkbox",checked:s.applyProfile,onChange:d=>_("applyProfile",d.target.checked)}),"Apply this profile's current operation snapshot"]})]}),i.jsxs("div",{style:A,children:[i.jsx("label",{htmlFor:"grant-source",children:"Primary / write source"}),i.jsxs("select",{id:"grant-source",value:s.source,onChange:d=>_("source",d.target.value),children:[!q.has(s.source)&&i.jsxs("option",{value:s.source,children:[s.source," · unavailable"]}),b.map(d=>i.jsxs("option",{value:d.id,children:[d.name," (",d.id,")"]},d.id))]})]}),i.jsxs("fieldset",{style:{border:0,padding:0,margin:"0 0 14px"},children:[i.jsx("legend",{children:"Readable sources"}),[...b,...s.reads.filter(d=>!q.has(d)).map(d=>({id:d,name:`${d} · unavailable`}))].map(d=>i.jsxs("label",{className:"checkbox-label",children:[i.jsx("input",{type:"checkbox",checked:s.reads.includes(d.id),onChange:O=>_("reads",O.target.checked?[...s.reads,d.id]:s.reads.filter(R=>R!==d.id))}),d.name]},d.id))]}),i.jsxs("div",{style:A,children:[i.jsx("label",{htmlFor:"grant-direct-prefixes",children:"Direct write prefixes (one per line)"}),i.jsx("textarea",{id:"grant-direct-prefixes",rows:2,value:s.directPrefixes,onChange:d=>_("directPrefixes",d.target.value),placeholder:"work-example/"}),i.jsx("p",{className:"grant-help",children:"Blank grants the whole primary source. Coding agent requires an explicit prefix."})]}),H&&i.jsxs("fieldset",{style:{border:"1px solid var(--border)",padding:12,marginBottom:14},children:[i.jsx("legend",{children:"Delegated jobs"}),i.jsx("p",{className:"grant-help",children:"Choose every tool explicitly. Jobs stay in the primary source; existing jobs retain their original limits."}),i.jsx("div",{className:"checkbox-group",style:{maxHeight:180,overflowY:"auto"},children:[...new Set([...o.delegatedTools,...s.tools])].map(d=>i.jsxs("label",{className:"checkbox-label",children:[i.jsx("input",{type:"checkbox",checked:s.tools.includes(d),onChange:O=>_("tools",O.target.checked?[...s.tools,d]:s.tools.filter(R=>R!==d))}),d,o.delegatedTools.includes(d)?"":" · unavailable"]},d))}),i.jsx("label",{htmlFor:"grant-namespace",children:"Delegated write namespace"}),i.jsxs("select",{id:"grant-namespace",value:s.namespace,onChange:d=>_("namespace",d.target.value),children:[i.jsx("option",{value:"job",children:"Each job's own wiki/agents/ directory"}),i.jsx("option",{value:"prefixes",children:"Explicit prefixes"})]}),s.namespace==="prefixes"&&i.jsx("textarea",{"aria-label":"Delegated prefixes",rows:2,value:s.delegatedPrefixes,onChange:d=>_("delegatedPrefixes",d.target.value),placeholder:"work-example/"})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12,...A},children:[i.jsxs("div",{children:[i.jsx("label",{htmlFor:"grant-concurrency",children:"Concurrent jobs"}),i.jsx("input",{id:"grant-concurrency",type:"number",min:1,step:1,value:s.concurrency,onChange:d=>_("concurrency",d.target.value)})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"grant-budget",children:"Daily delegated spend (USD)"}),i.jsx("input",{id:"grant-budget",value:s.budget,onChange:d=>_("budget",d.target.value),placeholder:"unlimited"}),i.jsx("p",{className:"grant-help",children:"Use unlimited for no spending cap, or an amount such as 2.50."})]})]}),i.jsxs("div",{style:A,children:[i.jsx("label",{htmlFor:"grant-ttl",children:"Future access token lifetime (seconds)"}),i.jsx("input",{id:"grant-ttl",type:"number",min:0,max:7776e3,step:1,value:s.ttl,onChange:d=>_("ttl",d.target.value)}),i.jsx("p",{className:"grant-help",children:"Renewable: 3600 (1 hour). Static bearer: 2592000 (30 days). 0 uses the server default. Existing tokens keep their expiry."})]}),i.jsxs("details",{style:A,children:[i.jsx("summary",{children:"Advanced permissions"}),i.jsx("label",{htmlFor:"grant-scopes",children:"Scope override"}),i.jsx("input",{id:"grant-scopes",value:s.scopes,onChange:d=>_("scopes",d.target.value),placeholder:"Use profile scopes"}),i.jsx("p",{className:"grant-help",children:"Scopes allow eligible brain operations. Admin does not grant owner dashboard access or delegation."}),i.jsx("label",{htmlFor:"grant-surface",children:"Visible tool catalog"}),i.jsx("select",{id:"grant-surface",value:s.surface,onChange:d=>_("surface",d.target.value),children:["verbs","starter","full","default"].map(d=>i.jsx("option",{children:d},d))}),i.jsx("p",{className:"grant-help",children:"Full shows all eligible tools; it does not grant additional authority."}),i.jsxs("label",{className:"checkbox-label",children:[i.jsx("input",{type:"checkbox",checked:s.editOperations,onChange:d=>_("editOperations",d.target.checked)}),"Replace operation authority snapshot"]}),s.editOperations&&i.jsxs(i.Fragment,{children:[i.jsx("textarea",{"aria-label":"Allowed operations",rows:5,value:s.operationSnapshot,onChange:d=>_("operationSnapshot",d.target.value)}),i.jsx("p",{className:"grant-help",children:"One operation name per line. An empty list denies every operation, including delegated tools."})]})]})]})}const My=[["Profile","profile"],["Scopes","scopes"],["Write source","sourceId"],["Readable sources","federatedRead"],["Direct prefixes","boundSlugPrefixes"],["Visible catalog","surface"],["Operation authority","allowedOperations"],["Delegated tools","boundTools"],["Delegated source","boundSourceId"],["Delegated brain","boundBrainId"],["Delegated namespace","delegatedNamespace"],["Delegated prefixes","delegatedSlugPrefixes"],["Concurrent jobs","boundMaxConcurrent"],["Daily USD cap","budgetUsdPerDay"],["Future token TTL","tokenTtlSeconds"]];function Ry(s,S){return s===null?S==="budgetUsdPerDay"?"Unlimited":S==="allowedOperations"?"Legacy scope-based catalog":"Unset":Array.isArray(s)?s.join(", ")||"(none)":String(s)}function Bd({grant:s,field:S}){const b=s[S];return S==="allowedOperations"&&Array.isArray(b)&&b.length>8?i.jsxs("details",{children:[i.jsxs("summary",{children:[b.length," operations · inspect list"]}),i.jsx("div",{style:{maxHeight:160,overflowY:"auto",marginTop:8},children:b.join(", ")})]}):i.jsx(i.Fragment,{children:Ry(b,S)})}function Kd({preview:s}){return i.jsxs("div",{"aria-live":"polite",style:{margin:"16px 0"},children:[i.jsx("h3",{children:"Review permissions"}),i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Permission"}),s.before&&i.jsx("th",{children:"Current"}),i.jsx("th",{children:"Proposed"})]})}),i.jsx("tbody",{children:My.filter(([,S])=>!s.before||JSON.stringify(s.before[S])!==JSON.stringify(s.after[S])).map(([S,b])=>i.jsxs("tr",{children:[i.jsx("th",{children:S}),s.before&&i.jsx("td",{style:{overflowWrap:"anywhere",maxWidth:200},children:i.jsx(Bd,{grant:s.before,field:b})}),i.jsx("td",{style:{overflowWrap:"anywhere",maxWidth:280},children:i.jsx(Bd,{grant:s.after,field:b})})]},b))})]})}),i.jsx("p",{className:"grant-help",children:s.tokenImplications})]})}function Uy({clientId:s,sources:S,sourcesReady:b=!0,onRescoped:o}){const[E,_]=M.useState(),[q,H]=M.useState(),[A,d]=M.useState(),[O,R]=M.useState(),[U,L]=M.useState(""),[w,Z]=M.useState(!1),[W,ae]=M.useState(!1),[$,le]=M.useState(!1),ne=async(k=!1)=>{Z(!0),ae(!1);try{const[V,Se]=await Promise.all([be.clientGrant(s),be.grantCatalog()]);_(V.grant),H(bs(V.grant)),d(Se),R(void 0),L(""),le(!1),k&&o(V.grant)}finally{Z(!1)}};M.useEffect(()=>{ne().catch(k=>L(k.message))},[s]);const xe=async()=>{if(!(!q||!E||!b||$)){Z(!0),L(""),ae(!1);try{const k=await be.updateClientGrant(s,{...O?Zd(O.after):Ld(q),expectedRevision:E.revision,dryRun:!O});O?(_(k.after),H(bs(k.after)),R(void 0),ae(!0),o(k.after)):R(k)}catch(k){const V=!!O&&Ss(k);le(V||k instanceof An&&k.status===409),R(void 0),L(`${k instanceof Error?k.message:"Grant update failed."}${V?" The change may have completed. Reload the current grant before editing permissions again.":""}`)}finally{Z(!1)}}};return i.jsxs("section",{children:[i.jsx("div",{className:"section-title",children:"Permissions"}),E&&i.jsxs("p",{className:"grant-help",children:["Revision ",E.revision,". Review source access, direct tools, and delegated work independently."]}),E&&i.jsx(qy,{clientId:s,revision:E.revision}),!!(E!=null&&E.repairReasons.length)&&i.jsxs("p",{role:"status",style:{color:"var(--warning)"},children:["Delegation needs repair: ",E.repairReasons.join(", "),". Review and explicitly grant the missing bindings below."]}),!b&&i.jsx("p",{role:"alert",children:"Current sources are unavailable. Retry sources before editing permissions."}),i.jsx("fieldset",{disabled:w||!b||$,style:{border:0,padding:0},children:q&&A&&i.jsx(Vd,{draft:q,catalog:A,sources:S,existing:!0,setDraft:k=>{H(k),R(void 0),ae(!1)}})}),U&&i.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[U," ",i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:w,onClick:()=>void ne(!0).catch(k=>L(k.message)),children:"Reload current grant"})]}),O&&i.jsx(Kd,{preview:O}),W&&i.jsx("p",{role:"status",children:"Permissions saved. Credentials are unchanged."}),i.jsx("button",{type:"button",className:"btn btn-primary",disabled:w||!q||!A||!b||$,onClick:()=>void xe(),children:w?"Checking…":O?"Apply reviewed changes":"Preview changes"})]})}function qy({clientId:s,revision:S}){const[b,o]=M.useState(),[E,_]=M.useState(!1);return M.useEffect(()=>{let q=!0;const H=()=>void be.agentsSpend().then(d=>{q&&(o(d.find(O=>O.client_id===s)),_(!1))}).catch(()=>{q&&_(!0)});H();const A=setInterval(H,2e4);return()=>{q=!1,clearInterval(A)}},[s,S]),E?i.jsx("p",{role:"status",children:"Delegated spend is unavailable. Reload to check before starting more work."}):b?i.jsxs("div",{style:{border:"1px solid var(--border)",padding:12,marginBottom:14},children:[i.jsx("strong",{children:"Delegated work"}),i.jsxs("p",{children:[b.inflight_count," unfinished jobs · Daily cap: ",b.cap_usd_per_day===null?"Unlimited":`$${b.cap_usd_per_day.toFixed(2)}`]}),i.jsxs("p",{className:"grant-help",children:["Recorded today: $",(b.spent_cents_today/100).toFixed(2),". Known outstanding reservations: $",(b.pending_cents/100).toFixed(2),", including overdue calls from earlier days."]}),b.unknown_count>0&&i.jsxs("p",{role:"status",style:{color:"var(--warning)"},children:[b.unknown_count," unresolved calls have an unknown cost. The known amounts above do not bound total liability; a finite cap refuses further calls until reconciliation."]})]}):null}function Hy(s,S){const b=URL.createObjectURL(new Blob([JSON.stringify(s,null,2)],{type:"application/json"})),o=document.createElement("a");o.href=b,o.download=S,o.click(),URL.revokeObjectURL(b)}function Jd({clientId:s,grantTypes:S,revoked:b=!1,grantRevision:o}){const[E,_]=M.useState("generic"),q=S.includes("authorization_code")&&S.includes("client_credentials"),[H,A]=M.useState(q?"":S.includes("authorization_code")?"authorization-code":"client-credentials"),[d,O]=M.useState(),[R,U]=M.useState(),[L,w]=M.useState([]),[Z,W]=M.useState(""),[ae,$]=M.useState(!1),[le,ne]=M.useState(!1),[xe,k]=M.useState(!1),[V,Se]=M.useState(0);M.useEffect(()=>{if(b)return;let se=!0;if(U(void 0),w([]),W(""),ne(!1),k(!1),!!H)return Promise.all([be.clientSetup(s,E,H),be.grantCatalog()]).then(([F,de])=>{se&&(U(F.setup),w(F.instructions),O(de))}).catch(F=>{se&&W(F instanceof Error?F.message:"Setup instructions are unavailable.")}),()=>{se=!1}},[s,E,H,b,o,V]);const je=async()=>{if(R){$(!0),W("");try{const se=await be.recoverClient(s,E,H),F=H==="authorization-code"?se.oauthSetup:se.credentials;if(!F)throw new Error("No matching setup file was returned. Ask the host administrator to inspect this client’s credential delivery.");Hy(F,`${s}-${H==="authorization-code"?"oauth-setup":"credentials"}.json`),ne(!0)}catch(se){W(se instanceof Error?se.message:"Download failed. Existing permissions are unchanged.")}finally{$(!1)}}};return i.jsxs("section",{"aria-labelledby":"client-setup-title",children:[i.jsx("h3",{id:"client-setup-title",className:"section-title",children:"Set up this client"}),b?i.jsx("p",{children:"This client is revoked. Register a new client to connect another harness."}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"grant-help",children:"Registration grants access. Configure the intended harness, then verify an actual memory round trip there."}),i.jsx("label",{htmlFor:"setup-harness",children:"Harness"}),i.jsxs("select",{id:"setup-harness",value:E,onChange:se=>_(se.target.value),disabled:ae,children:[!d&&i.jsx("option",{value:"generic",children:"Generic MCP client"}),d==null?void 0:d.harnesses.map(se=>i.jsx("option",{value:se.id,children:se.label},se.id))]}),q&&i.jsxs(i.Fragment,{children:[i.jsx("label",{htmlFor:"setup-flow",children:"Connection flow"}),i.jsxs("select",{id:"setup-flow",value:H,onChange:se=>A(se.target.value),disabled:ae,children:[i.jsx("option",{value:"",children:"Choose the flow supported by your harness"}),i.jsx("option",{value:"authorization-code",children:"Browser sign-in with PKCE"}),i.jsx("option",{value:"client-credentials",children:"Machine credentials"})]})]}),R&&i.jsxs(i.Fragment,{children:[i.jsxs("dl",{className:"oauth-consent-details",style:{marginTop:16},children:[i.jsx("dt",{children:"MCP URL"}),i.jsx("dd",{children:i.jsx("code",{children:R.mcp_url})}),i.jsx("dt",{children:"OAuth issuer"}),i.jsx("dd",{children:i.jsx("code",{children:R.issuer_url})}),i.jsx("dt",{children:"Client ID"}),i.jsx("dd",{children:i.jsx("code",{children:R.client.client_id})}),i.jsx("dt",{children:"Scopes"}),i.jsx("dd",{children:R.scopes.join(" ")||"None"}),i.jsx("dt",{children:"Authentication"}),i.jsx("dd",{children:R.client.token_endpoint_auth_method==="none"?"Public client — PKCE, no client secret":R.client.token_endpoint_auth_method}),R.flow==="authorization-code"&&i.jsxs(i.Fragment,{children:[i.jsx("dt",{children:"Redirect URIs"}),i.jsx("dd",{children:R.client.redirect_uris.map(se=>i.jsx("div",{children:i.jsx("code",{children:se})},se))})]})]}),i.jsx("ol",{children:L.map((se,F)=>i.jsx("li",{style:{marginBottom:8,overflowWrap:"anywhere"},children:se},F))}),i.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginTop:16},children:[i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>{navigator.clipboard.writeText(L.join(`-`)).then(()=>k(!0)).catch(()=>W("Clipboard unavailable. Select and copy the instructions above."))},children:xe?"Instructions copied":"Copy setup instructions"}),i.jsx("button",{type:"button",className:"btn btn-primary",disabled:ae,onClick:()=>void je(),children:ae?"Preparing download…":R.flow==="authorization-code"?"Download OAuth setup":"Download credentials"})]}),i.jsx("p",{className:"grant-help",children:"Keep downloaded files private. Set permissions to 0600 on the target computer. A setup download does not verify the harness."})]}),!H&&i.jsx("p",{role:"status",children:"This client supports both flows. Choose one before requesting setup instructions."}),H&&!R&&!Z&&i.jsx("p",{role:"status",children:"Loading setup instructions…"}),le&&i.jsx("p",{role:"status",children:"Setup file delivered to your browser. Harness verification is still required."}),Z&&i.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[Z," ",i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:ae,onClick:()=>Se(se=>se+1),children:"Retry setup"})]})]})]})}const gs={"invalidate-tokens":"Invalidate tokens",revoke:"Revoke client",delete:"Delete client"};function By({clientId:s,name:S,revoked:b,onChanged:o,onBusyChange:E}){const[_,q]=M.useState(),[H,A]=M.useState(!1),[d,O]=M.useState(""),[R,U]=M.useState(!1),L=async Z=>{A(!0),O(""),q(void 0);try{q(await be.clientLifecycle(s,{action:Z,dryRun:!0}))}catch(W){O(W instanceof Error?W.message:"Could not preview this action. Retry after checking the client.")}finally{A(!1)}},w=async()=>{if(_){A(!0),E==null||E(!0),O("");try{await be.clientLifecycle(s,{action:_.action,dryRun:!1,yes:!0,expectedRevision:_.before.revision}),o()}catch(Z){const W=Ss(Z);O(`${Z instanceof Error?Z.message:"Request failed."} ${W?"The action may have completed. Reload the client and inspect its current state before requesting another action.":"The request was refused. Review a fresh preview before applying an action."}`),U(W),q(void 0)}finally{A(!1),E==null||E(!1)}}};return i.jsxs("section",{"aria-labelledby":"client-lifecycle-title",style:{marginTop:28},children:[i.jsx("h3",{id:"client-lifecycle-title",className:"section-title",children:"Client access"}),i.jsx("p",{className:"grant-help",children:"Invalidating tokens keeps the client and its secret. Revoking ends access and keeps a visible registration. Deleting removes the registration. Memory and audit history remain."}),!_&&i.jsx("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:["invalidate-tokens","revoke","delete"].filter(Z=>!b||Z==="delete").map(Z=>i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:H||R,onClick:()=>void L(Z),children:gs[Z]},Z))}),_&&i.jsxs("div",{"aria-live":"polite",style:{border:"1px solid var(--border)",padding:16},children:[i.jsxs("h4",{style:{margin:"0 0 12px"},children:[gs[_.action],": ",S]}),i.jsxs("p",{children:[i.jsx("code",{children:s})," · Revision ",_.before.revision]}),i.jsx("ul",{children:(Array.isArray(_.consequences)?_.consequences:[_.consequences]).map((Z,W)=>i.jsx("li",{children:Z},W))}),i.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:16},children:[i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:H,onClick:()=>q(void 0),children:"Cancel"}),i.jsx("button",{type:"button",className:"btn btn-danger",disabled:H,onClick:()=>void w(),children:H?"Applying…":`Confirm ${gs[_.action].toLowerCase()}`})]})]}),d&&i.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[d," ",R&&i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:o,children:"Reload client list"})]})]})}function _n({title:s,titleId:S,children:b,onClose:o,busy:E=!1,drawer:_=!1}){const q=M.useRef(null),H=M.useRef(o);H.current=o;const A=M.useRef(E);A.current=E;const[d]=M.useState(()=>document.activeElement instanceof HTMLElement?document.activeElement:null);return M.useEffect(()=>{const O=q.current;if(!O)return;(O.querySelector("[data-autofocus]")??O).focus();const R=U=>{if(U.key==="Escape"&&(U.preventDefault(),A.current||H.current()),U.key!=="Tab")return;const L=[...O.querySelectorAll('button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href], summary, [tabindex="0"]')].filter(W=>W.getClientRects().length>0&&!W.closest("fieldset:disabled")),w=L[0],Z=L[L.length-1];if(!w){U.preventDefault(),O.focus();return}U.shiftKey&&(document.activeElement===w||document.activeElement===O)?(U.preventDefault(),Z.focus()):!U.shiftKey&&(document.activeElement===Z||document.activeElement===O)&&(U.preventDefault(),w.focus())};return O.addEventListener("keydown",R),()=>{O.removeEventListener("keydown",R),d!=null&&d.isConnected&&d.focus()}},[d]),i.jsx("div",{className:_?"drawer-overlay":"modal-overlay",onClick:()=>{E||o()},children:i.jsxs("div",{ref:q,role:"dialog","aria-modal":"true","aria-labelledby":S,"aria-busy":E,tabIndex:-1,className:_?"drawer":"modal",onClick:O=>O.stopPropagation(),style:_?{width:"min(640px, 95vw)"}:{maxWidth:760,width:"92vw",minWidth:0,maxHeight:"90vh",overflowY:"auto"},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16,alignItems:"start",marginBottom:20},children:[i.jsx("h2",{id:S,className:"modal-title",style:{margin:0},children:s}),i.jsx("button",{type:"button",className:"btn btn-secondary","aria-label":`Close ${s}`,disabled:E,onClick:o,children:"Close"})]}),b]})})}function Yy(s){const S=s.kind!=="machine",b=S?s.redirectUris.split(`-`).map(o=>o.trim()).filter(Boolean):[];if(S&&!b.length)throw new Error("Enter the exact redirect URI from your MCP client settings, one per line.");for(const o of b)try{new URL(o)}catch{throw new Error("Each redirect URI must be a complete URI. Copy it exactly from your MCP client settings.")}return{grantTypes:S?["authorization_code","refresh_token"]:["client_credentials"],redirectUris:b,tokenEndpointAuthMethod:s.kind==="public-pkce"?"none":s.kind==="machine"?"client_secret_post":s.confidentialMethod}}function Gy(s){const S=Math.floor((Date.now()-s.getTime())/1e3);return S<60?"just now":S<3600?Math.floor(S/60)+"m ago":S<86400?Math.floor(S/3600)+"h ago":Math.floor(S/86400)+"d ago"}function wy(){const[s,S]=M.useState([]),[b,o]=M.useState([]),[E,_]=M.useState(!1),[q,H]=M.useState(!1),[A,d]=M.useState(""),[O,R]=M.useState(""),[U,L]=M.useState(!0),[w,Z]=M.useState(!0),[W,ae]=M.useState(!1),[$,le]=M.useState(!1),[ne,xe]=M.useState(),[k,V]=M.useState(),[Se,je]=M.useState(!1),[se,F]=M.useState(),de=M.useRef(0),Ge=M.useRef(0),Ce=async()=>{const N=++de.current;L(!0);try{const Y=await be.agents();if(N!==de.current)return;S(Y),_(!0),d("")}catch(Y){N===de.current&&d(Y instanceof Error?Y.message:"Clients are unavailable.")}finally{N===de.current&&L(!1)}},Ze=async()=>{const N=++Ge.current;Z(!0);try{const Y=await be.sources();if(N!==Ge.current)return;o(Y),H(!0),R("")}catch(Y){N===Ge.current&&(H(!1),R(Y instanceof Error?Y.message:"Sources are unavailable."))}finally{N===Ge.current&&Z(!1)}};M.useEffect(()=>(Ce(),Ze(),()=>{de.current++,Ge.current++}),[]);const j=s.filter(N=>!W||N.status!=="revoked");return i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12,flexWrap:"wrap",alignItems:"center",marginBottom:24},children:[i.jsx("h1",{className:"page-title",style:{marginBottom:0},children:"Agents"}),i.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[i.jsxs("label",{className:"checkbox-label",children:[i.jsx("input",{type:"checkbox",checked:W,onChange:N=>ae(N.target.checked)}),"Hide revoked"]}),i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:U,onClick:()=>void Ce(),children:"Refresh clients"}),i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>je(!0),children:"+ API Key"}),i.jsx("button",{type:"button",className:"btn btn-primary",disabled:!q||!b.length||w,onClick:()=>le(!0),children:"+ OAuth Client"})]})]}),i.jsx("p",{className:"grant-help",style:{marginBottom:16},children:"Owner administration uses this dashboard’s login. An OAuth client’s admin scope allows eligible brain operations; it does not open this dashboard."}),A&&i.jsxs("p",{role:"alert",style:{marginBottom:16,color:"var(--error)"},children:[E?"Showing previously loaded clients. ":"Could not load clients. ",A," ",i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:U,onClick:()=>void Ce(),children:"Retry clients"})]}),O&&i.jsxs("p",{role:"alert",style:{marginBottom:16,color:"var(--error)"},children:["Could not load current sources. Registration and permission changes are unavailable. ",O," ",i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:w,onClick:()=>void Ze(),children:"Retry sources"})]}),!O&&!q&&i.jsx("p",{role:"status",children:"Loading sources before registration…"}),q&&!b.length&&i.jsx("p",{role:"status",children:"No active sources are available. Add or unarchive a source on the host before registering a client."}),!E&&!A&&i.jsx("p",{role:"status",children:"Loading clients…"}),E&&!s.length&&i.jsx("p",{style:{textAlign:"center",padding:48},children:"No clients registered. Register a client to grant access to a harness."}),E&&s.length>0&&!j.length&&i.jsx("p",{style:{textAlign:"center",padding:48},children:"All clients are revoked. Uncheck “Hide revoked” to view them."}),j.length>0&&i.jsxs("div",{style:{overflowX:"auto"},children:[i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Name"}),i.jsx("th",{children:"Type"}),i.jsx("th",{children:"Scopes"}),i.jsx("th",{children:"Sources"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Requests"}),i.jsx("th",{children:"Last used"})]})}),i.jsx("tbody",{children:j.map(N=>i.jsxs("tr",{onClick:()=>V(N),style:{cursor:"pointer"},children:[i.jsx("td",{children:i.jsx("button",{type:"button",className:"client-name-button",onClick:Y=>{Y.stopPropagation(),V(N)},children:N.name||N.client_name})}),i.jsx("td",{children:i.jsx("span",{className:"badge "+(N.auth_type==="oauth"?"badge-read":"badge-write"),children:N.auth_type==="oauth"?"OAuth":"API key"})}),i.jsx("td",{children:(N.scope||"").split(" ").filter(Boolean).map(Y=>i.jsx("span",{className:"badge badge-"+Y,style:{marginRight:4},children:Y},Y))}),i.jsx("td",{children:N.auth_type==="oauth"?(N.source_id||"none")+" · "+(N.federated_read||[]).length+" readable":"Unscoped"}),i.jsx("td",{children:i.jsx("span",{className:"badge "+(N.status==="active"?"badge-success":"badge-danger"),children:N.status})}),i.jsxs("td",{children:[N.requests_today||0,i.jsxs("span",{style:{color:"var(--text-muted)"},children:[" / ",N.total_requests||0]})]}),i.jsx("td",{children:N.last_used_at?Gy(new Date(N.last_used_at)):"Never"})]},N.auth_type+":"+N.id))})]}),i.jsxs("p",{className:"grant-help",style:{marginTop:12},children:[s.filter(N=>N.status==="active").length," active / ",s.length," total"]})]}),$&&i.jsx(Xy,{sources:b,sourcesReady:q,onClose:()=>le(!1),onRegistered:N=>{le(!1),xe(N),Ce()}}),ne&&i.jsxs(_n,{title:"Client registered",titleId:"registered-client-title",onClose:()=>xe(void 0),children:[i.jsxs("p",{role:"status",style:{marginBottom:16},children:[ne.name," is registered. Its harness connection has not been verified."]}),i.jsx(Jd,{clientId:ne.clientId,grantTypes:ne.grantTypes})]}),k&&i.jsx(Qy,{agent:k,sources:b,sourcesReady:q,onClose:()=>V(void 0),onChanged:()=>{V(void 0),Ce()},onRescoped:N=>{V(Y=>Y&&{...Y,source_id:N.sourceId,federated_read:N.federatedRead,scope:N.scopes.join(" "),token_ttl:N.tokenTtlSeconds}),Ce()}},k.id),Se&&i.jsx(Ly,{onClose:()=>je(!1),onCreated:N=>{je(!1),F(N),Ce()}}),se&&i.jsx(Zy,{token:se,onClose:()=>F(void 0)})]})}function Xy({sources:s,sourcesReady:S,onClose:b,onRegistered:o}){const[E,_]=M.useState(""),[q,H]=M.useState(()=>bs()),[A,d]=M.useState({kind:"machine",redirectUris:"",confidentialMethod:"client_secret_post"}),[O,R]=M.useState(),[U,L]=M.useState(""),[w,Z]=M.useState(),[W,ae]=M.useState(!1),[$,le]=M.useState(""),[ne,xe]=M.useState(),[k,V]=M.useState(!1),Se=()=>{L(""),be.grantCatalog().then(R).catch(F=>L(F instanceof Error?F.message:"Permission catalog unavailable."))};M.useEffect(Se,[]);const je=F=>{d(F),Z(void 0)},se=async F=>{if(F.preventDefault(),!(!S||!O||k)){if(!E.trim()){le("Enter a client name.");return}ae(!0),le("");try{const de=(w==null?void 0:w.oauth)??Yy(A),Ge=(w==null?void 0:w.name)??E.trim(),Ce=await be.registerClient({...w?Zd(w.grant.after):Ld(q),...de,name:Ge,dryRun:!w});w?o({clientId:Ce.clientId,name:Ge,grantTypes:de.grantTypes}):Z({grant:Ce,oauth:de,name:Ge})}catch(de){le(de instanceof Error?de.message:"Registration failed.");const Ge=!!w&&Ss(de);if(V(Ge),w&&(Ge||de instanceof An&&de.status===409))try{const Ce=(await be.agents()).filter(Ze=>Ze.auth_type==="oauth"&&Ze.status==="active"&&(Ze.name||Ze.client_name)===w.name);Ce.length===1&&(xe({clientId:Ce[0].id||Ce[0].client_id,name:w.name,grantTypes:Ce[0].grant_types}),V(!0))}catch{}Z(void 0)}finally{ae(!1)}}};return i.jsx(_n,{title:"Register OAuth client",titleId:"register-client-title",onClose:b,busy:W,children:i.jsxs("form",{onSubmit:se,children:[i.jsxs("fieldset",{disabled:W||k,style:{border:0,padding:0},children:[i.jsx("label",{htmlFor:"agent-name",children:"Client name"}),i.jsx("input",{id:"agent-name","data-autofocus":!0,value:E,placeholder:"agent-example",onChange:F=>{_(F.target.value),Z(void 0)}}),i.jsx("label",{htmlFor:"oauth-connection-kind",style:{marginTop:16},children:"Connection type"}),i.jsxs("select",{id:"oauth-connection-kind",value:A.kind,onChange:F=>je({...A,kind:F.target.value}),children:[i.jsx("option",{value:"machine",children:"Machine credentials"}),i.jsx("option",{value:"public-pkce",children:"Browser sign-in: public client with PKCE"}),i.jsx("option",{value:"confidential-pkce",children:"Browser sign-in: confidential client with PKCE"})]}),i.jsx("p",{className:"grant-help",children:"Choose the method required by your MCP client. Browser sign-in requires the owner’s approval. Public clients use PKCE without a client secret."}),A.kind!=="machine"&&i.jsxs(i.Fragment,{children:[i.jsx("label",{htmlFor:"oauth-redirect-uris",children:"Exact redirect URIs (one per line)"}),i.jsx("textarea",{id:"oauth-redirect-uris",rows:3,value:A.redirectUris,onChange:F=>je({...A,redirectUris:F.target.value}),placeholder:"https://client.example.com/oauth/callback"}),i.jsx("p",{className:"grant-help",children:"Copy these from the client’s OAuth settings. Keep the complete path and query. GBrain uses S256 PKCE."})]}),A.kind==="confidential-pkce"&&i.jsxs(i.Fragment,{children:[i.jsx("label",{htmlFor:"oauth-client-auth",children:"Client secret authentication"}),i.jsxs("select",{id:"oauth-client-auth",value:A.confidentialMethod,onChange:F=>je({...A,confidentialMethod:F.target.value}),children:[i.jsx("option",{value:"client_secret_post",children:"client_secret_post (request body)"}),i.jsx("option",{value:"client_secret_basic",children:"client_secret_basic (HTTP Basic)"})]})]}),A.kind==="machine"&&i.jsx("p",{className:"grant-help",children:"Machine handoffs use client_secret_post to renew their access tokens."}),i.jsx("div",{style:{marginTop:24},children:O&&i.jsx(Vd,{draft:q,setDraft:F=>{H(F),Z(void 0)},catalog:O,sources:s})})]}),U&&i.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[U," ",i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:Se,children:"Retry permissions"})]}),!S&&i.jsx("p",{role:"alert",children:"Current sources are unavailable. Close this form and retry sources before registration."}),w&&i.jsxs(i.Fragment,{children:[i.jsx(Kd,{preview:w.grant}),i.jsxs("div",{"aria-live":"polite",children:[i.jsx("h3",{children:"Review connection"}),i.jsxs("dl",{className:"oauth-consent-details",children:[i.jsx("dt",{children:"Client name"}),i.jsx("dd",{children:w.name}),i.jsx("dt",{children:"Grant types"}),i.jsx("dd",{children:w.oauth.grantTypes.join(", ")}),i.jsx("dt",{children:"Authentication"}),i.jsx("dd",{children:w.oauth.tokenEndpointAuthMethod}),w.oauth.redirectUris.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("dt",{children:"Exact redirect URIs"}),i.jsx("dd",{children:w.oauth.redirectUris.map(F=>i.jsx("div",{children:i.jsx("code",{children:F})},F))})]})]})]})]}),$&&i.jsx("p",{role:"alert",style:{color:"var(--error)",margin:"16px 0"},children:$}),ne&&i.jsxs("div",{role:"status",children:[i.jsxs("p",{children:["A client named ",ne.name," is registered. Open its setup instructions and recover its existing download."]}),i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>o(ne),children:"Open existing client setup"})]}),k&&!ne&&i.jsx("p",{role:"status",children:"Registration may have completed. Close this form and refresh clients before trying again. No automatic retry was made."}),i.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"flex-end",marginTop:20},children:[i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:W,onClick:b,children:"Cancel"}),i.jsx("button",{type:"submit",className:"btn btn-primary",disabled:W||!O||!S||k,children:W?"Checking…":w?"Register with reviewed permissions":"Preview permissions"})]})]})})}function Qy({agent:s,sources:S,sourcesReady:b,onClose:o,onChanged:E,onRescoped:_}){const q=s.id||s.client_id||"",H=s.name||s.client_name||q,[A,d]=M.useState(),[O,R]=M.useState(""),[U,L]=M.useState(0),[w,Z]=M.useState(!1),[W,ae]=M.useState(!1);return M.useEffect(()=>{if(s.auth_type!=="oauth")return;let $=!0;return R(""),be.clientDetails(q).then(le=>{$&&d(le)}).catch(le=>{$&&R(le instanceof Error?le.message:"Client details unavailable.")}),()=>{$=!1}},[q,s.auth_type,U]),i.jsxs(_n,{title:H,titleId:"client-details-title",onClose:o,drawer:!0,busy:W,children:[i.jsx("span",{className:"badge "+(s.status==="active"?"badge-success":"badge-danger"),children:s.status}),i.jsxs("dl",{className:"oauth-consent-details",style:{marginTop:16},children:[i.jsx("dt",{children:"Client ID"}),i.jsx("dd",{children:i.jsx("code",{children:q})}),i.jsx("dt",{children:"Scopes"}),i.jsx("dd",{children:s.scope||"None"}),i.jsx("dt",{children:"Registered"}),i.jsx("dd",{children:new Date(s.created_at).toLocaleString()}),i.jsx("dt",{children:"Token lifetime"}),i.jsx("dd",{children:s.token_ttl?s.token_ttl+" seconds":"Server default (future tokens)"}),A&&i.jsxs(i.Fragment,{children:[i.jsx("dt",{children:"Grant types"}),i.jsx("dd",{children:A.client.grant_types.join(", ")}),i.jsx("dt",{children:"Authentication"}),i.jsx("dd",{children:A.client.token_endpoint_auth_method})]})]}),s.auth_type==="oauth"?i.jsxs(i.Fragment,{children:[O&&i.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[O," ",i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>L($=>$+1),children:"Retry client details"})]}),!A&&!O&&i.jsx("p",{role:"status",children:"Loading client details…"}),A&&i.jsxs(i.Fragment,{children:[i.jsx(Jd,{clientId:q,grantTypes:A.client.grant_types,revoked:s.status==="revoked",grantRevision:A.grant.revision}),s.status==="active"&&i.jsxs("details",{style:{marginTop:24},children:[i.jsx("summary",{style:{cursor:"pointer",fontWeight:600},children:"Edit access levels"}),i.jsx(Uy,{clientId:q,sources:S,sourcesReady:b,onRescoped:$=>{d(le=>le&&{...le,grant:$}),_($)}})]}),i.jsx(By,{clientId:q,name:H,revoked:s.status==="revoked",onChanged:E,onBusyChange:ae})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("h3",{className:"section-title",children:"API key"}),i.jsx("p",{children:"Use this key as a bearer token in a client that supports static authentication. Its value is available only in the original private handoff."}),s.status==="active"&&i.jsxs("div",{style:{marginTop:20},children:[w?i.jsxs(i.Fragment,{children:[i.jsxs("p",{children:["Revoke all active API keys named ",H,"? Keys with the same name will stop working. Memory remains."]}),i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:W,onClick:()=>Z(!1),children:"Cancel"})," ",i.jsx("button",{type:"button",className:"btn btn-danger",disabled:W,onClick:()=>{ae(!0),be.revokeApiKey(H).then(E).catch($=>R($ instanceof Error?$.message:"Revoke failed. Refresh the client list before retrying.")).finally(()=>ae(!1))},children:"Confirm revoke"})]}):i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>Z(!0),children:"Revoke API key"}),O&&i.jsx("p",{role:"alert",children:O})]})]})]})}function Ly({onClose:s,onCreated:S}){const[b,o]=M.useState(""),[E,_]=M.useState(!1),[q,H]=M.useState(""),A=async d=>{if(d.preventDefault(),!b.trim()){H("Enter a key name.");return}_(!0),H("");try{const O=await be.createApiKey(b.trim());S({name:O.name,token:O.token})}catch(O){H(O instanceof Error?O.message:"Key creation failed. Inspect the clients list before retrying.")}finally{_(!1)}};return i.jsx(_n,{title:"Create API key",titleId:"create-api-key-title",onClose:s,busy:E,children:i.jsxs("form",{onSubmit:A,children:[i.jsx("p",{className:"grant-help",children:"API keys created here allow full read, write, and admin brain operations. Choose an OAuth client for scoped access. This key cannot log into the owner dashboard."}),i.jsx("label",{htmlFor:"api-key-name",children:"Key name"}),i.jsx("input",{id:"api-key-name","data-autofocus":!0,value:b,disabled:E,onChange:d=>o(d.target.value)}),q&&i.jsx("p",{role:"alert",children:q}),i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:12,marginTop:20},children:[i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:E,onClick:s,children:"Cancel"}),i.jsx("button",{type:"submit",className:"btn btn-primary",disabled:E,children:E?"Creating…":"Create key"})]})]})})}function Zy({token:s,onClose:S}){const[b,o]=M.useState(!1),[E,_]=M.useState("");return i.jsxs(_n,{title:"API key created",titleId:"api-key-created-title",onClose:S,children:[i.jsx("p",{children:s.name}),i.jsx("label",{htmlFor:"new-api-key",children:"Bearer token"}),i.jsx("textarea",{id:"new-api-key",rows:3,readOnly:!0,value:s.token}),i.jsx("p",{className:"grant-help",children:"Save this token privately now. It will not be shown again. A key’s creation does not verify your harness connection."}),i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>{navigator.clipboard.writeText(s.token).then(()=>o(!0)).catch(()=>_("Clipboard unavailable. Select and copy the token above."))},children:b?"Copied":"Copy token"}),E&&i.jsx("p",{role:"alert",children:E}),i.jsx("button",{type:"button",className:"btn btn-primary",style:{marginLeft:12},onClick:S,children:"Done"})]})}function Vy(){const[s,S]=M.useState({rows:[],total:0,page:1,pages:1}),[b,o]=M.useState(1),[E,_]=M.useState("all"),[q,H]=M.useState(null);M.useEffect(()=>{A(b)},[b,E]);const A=U=>{const L=E!=="all"?`&agent=${encodeURIComponent(E)}`:"";be.requests(U,L).then(S).catch(()=>{})},d=U=>{const L=Date.now()-new Date(U).getTime();return L<6e4?`${Math.floor(L/1e3)}s ago`:L<36e5?`${Math.floor(L/6e4)} min ago`:L<864e5?`${Math.floor(L/36e5)}h ago`:new Date(U).toLocaleDateString()},O=U=>{if(!U)return null;const{query:L,slug:w,partial:Z,limit:W,...ae}=U,$=[];return L&&$.push(`"${L}"`),w&&$.push(w),Z&&$.push(`~${Z}`),W&&$.push(`limit=${W}`),Object.keys(ae).length>0&&$.push(`+${Object.keys(ae).length} params`),$.join(" ")},R=new Map;return s.rows.forEach(U=>{U.token_name&&R.set(U.token_name,U.agent_name||U.token_name)}),i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24},children:[i.jsx("h1",{className:"page-title",style:{marginBottom:0},children:"Request Log"}),i.jsxs("select",{value:E,onChange:U=>{_(U.target.value),o(1)},style:{background:"var(--bg-secondary)",color:"var(--text-primary)",border:"1px solid var(--border)",borderRadius:6,padding:"4px 8px",fontSize:13},children:[i.jsx("option",{value:"all",children:"All agents"}),[...R.entries()].map(([U,L])=>i.jsx("option",{value:U,children:L},U))]})]}),s.rows.length===0?i.jsx("div",{style:{textAlign:"center",padding:48,color:"var(--text-muted)"},children:"No requests yet."}):i.jsxs(i.Fragment,{children:[i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Time"}),i.jsx("th",{children:"Agent"}),i.jsx("th",{children:"Operation"}),i.jsx("th",{children:"Params"}),i.jsx("th",{children:"Latency"}),i.jsx("th",{children:"Status"})]})}),i.jsx("tbody",{children:s.rows.map(U=>i.jsxs(Xd.Fragment,{children:[i.jsxs("tr",{onClick:()=>H(q===U.id?null:U.id),style:{cursor:"pointer"},children:[i.jsx("td",{style:{color:"var(--text-secondary)",whiteSpace:"nowrap"},children:d(U.created_at)}),i.jsx("td",{children:i.jsx("a",{style:{color:"var(--text-link, #88aaff)",cursor:"pointer",textDecoration:"none",fontWeight:500},onClick:L=>{L.stopPropagation(),_(U.token_name),o(1)},children:U.agent_name||U.token_name})}),i.jsx("td",{className:"mono",children:U.operation}),i.jsx("td",{style:{color:"var(--text-secondary)",fontSize:12,maxWidth:200,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:O(U.params)}),i.jsxs("td",{className:"mono",children:[U.latency_ms,"ms"]}),i.jsx("td",{children:i.jsx("span",{className:`badge badge-${U.status}`,children:U.status})})]}),q===U.id&&i.jsx("tr",{children:i.jsx("td",{colSpan:6,style:{background:"var(--bg-secondary, #0f0f1a)",padding:16},children:i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"100px 1fr",gap:"6px 12px",fontSize:13},children:[i.jsx("span",{style:{color:"var(--text-muted)"},children:"Time"}),i.jsx("span",{children:new Date(U.created_at).toLocaleString()}),i.jsx("span",{style:{color:"var(--text-muted)"},children:"Agent"}),i.jsx("span",{className:"mono",children:U.token_name}),i.jsx("span",{style:{color:"var(--text-muted)"},children:"Operation"}),i.jsx("span",{className:"mono",children:U.operation}),i.jsx("span",{style:{color:"var(--text-muted)"},children:"Latency"}),i.jsxs("span",{children:[U.latency_ms,"ms"]}),U.params&&i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{color:"var(--text-muted)"},children:"Params"}),i.jsx("pre",{className:"mono",style:{margin:0,whiteSpace:"pre-wrap",fontSize:12},children:JSON.stringify(U.params,null,2)})]}),U.error_message&&i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{color:"var(--error, #ff6b6b)"},children:"Error"}),i.jsx("span",{style:{color:"var(--error, #ff6b6b)"},children:U.error_message})]})]})})})]},U.id))})]}),i.jsxs("div",{className:"pagination",children:[i.jsxs("span",{children:["Page ",s.page," of ",s.pages," (",s.total," total)"]}),i.jsxs("div",{style:{display:"flex",gap:8},children:[i.jsx("button",{disabled:s.page<=1,onClick:()=>o(U=>U-1),children:"Previous"}),i.jsx("button",{disabled:s.page>=s.pages,onClick:()=>o(U=>U+1),children:"Next"})]})]})]})]})}function Ky({markup:s}){return i.jsx("div",{style:{width:"100%",overflow:"auto"},dangerouslySetInnerHTML:{__html:s}})}function Vu({type:s,ariaLabel:S}){const[b,o]=M.useState(""),[E,_]=M.useState("");return M.useEffect(()=>{let q=!1;return be.calibrationChart(s).then(H=>{q||o(H)}).catch(H=>{q||_(H.message??"fetch failed")}),()=>{q=!0}},[s]),E?i.jsxs("div",{style:{padding:16,color:"var(--error)"},role:"alert",children:[S,": ",E]}):b?i.jsx(Ky,{markup:b}):i.jsxs("div",{style:{padding:16,color:"var(--text-muted)"},children:[S," loading..."]})}function Jy(){const[s,S]=M.useState(null),[b,o]=M.useState(!0),[E,_]=M.useState("");if(M.useEffect(()=>{be.calibrationProfile().then(A=>{S(A),o(!1)}).catch(A=>{_(A.message??"fetch failed"),o(!1)})},[]),b)return i.jsx("div",{style:{padding:24,color:"var(--text-secondary)"},children:"Loading calibration profile…"});if(E)return i.jsxs("div",{style:{padding:24,color:"var(--error)"},role:"alert",children:["Could not load calibration profile: ",E]});if(!s)return i.jsxs("div",{style:{padding:24,maxWidth:700},children:[i.jsx("h1",{style:{marginBottom:16},children:"Calibration"}),i.jsx("p",{style:{color:"var(--text-secondary)"},children:"No calibration profile yet. Builds after 5+ resolved takes."}),i.jsx("pre",{style:{background:"var(--bg-secondary)",padding:12,borderRadius:4,color:"var(--text-primary)",marginTop:12,fontFamily:"var(--font-mono)"},children:"gbrain dream --phase calibration_profile"})]});const q=new Date(s.generated_at),H=Math.floor((Date.now()-q.getTime())/(1e3*60*60*24));return i.jsxs("div",{style:{padding:32,maxWidth:720},children:[i.jsx("h1",{style:{marginBottom:8},children:"Calibration"}),i.jsxs("div",{style:{color:"var(--text-muted)",fontSize:13,marginBottom:24},children:["Holder: ",s.holder," · ","Updated ",H===0?"today":`${H}d ago`,s.published&&" · published",s.grade_completion<.9&&` · ~${Math.round(s.grade_completion*100)}% graded`,!s.voice_gate_passed&&" · voice gate fell back to template"]}),i.jsx("section",{style:{marginBottom:32},children:i.jsx(Vu,{type:"brier-trend",ariaLabel:"Brier trend"})}),i.jsxs("section",{style:{marginBottom:32},children:[i.jsx("h2",{style:{fontSize:14,color:"var(--text-secondary)",marginBottom:12,fontWeight:400},children:"Pattern statements"}),i.jsx(Vu,{type:"pattern-statements",ariaLabel:"Pattern statements"})]}),i.jsx("section",{style:{marginBottom:32},children:i.jsx(Vu,{type:"domain-bars",ariaLabel:"Per-domain accuracy"})}),i.jsx("section",{style:{marginBottom:32},children:i.jsx(Vu,{type:"abandoned-threads",ariaLabel:"Abandoned threads"})}),s.active_bias_tags.length>0&&i.jsxs("section",{style:{marginBottom:32,color:"var(--text-muted)",fontSize:13},children:["Active bias tags: ",s.active_bias_tags.join(", ")]})]})}function ky(s){return s===0?"var(--accent-success, #2ea043)":s>=100?"var(--accent-danger, #f85149)":"var(--accent-warn, #d29922)"}function Yd(s){return`$${(s/100).toFixed(2)}`}function Wy(){const[s,S]=M.useState(null),[b,o]=M.useState(null);if(M.useEffect(()=>{let _=!0,q=null;const H=async()=>{try{const A=await be.jobsWatch();_&&(S(A),o(null))}catch(A){_&&o(A instanceof Error?A.message:String(A))}_&&(q=setTimeout(H,1e3))};return H(),()=>{_=!1,q&&clearTimeout(q)}},[]),b)return i.jsxs("div",{style:{padding:24,color:"var(--accent-danger, #f85149)"},children:[i.jsx("h2",{children:"Jobs Watch — error"}),i.jsx("pre",{style:{whiteSpace:"pre-wrap"},children:b})]});if(!s)return i.jsx("div",{style:{padding:24,color:"var(--text-muted, #777)"},children:"Loading jobs watch…"});const E=new Date(s.ts_ms).toLocaleTimeString();return i.jsxs("div",{style:{padding:24,fontFamily:'var(--font-mono, "JetBrains Mono", monospace)'},children:[i.jsxs("h1",{style:{fontSize:18,marginBottom:4},children:["Jobs Watch",i.jsxs("span",{style:{marginLeft:12,color:"var(--text-muted, #777)",fontSize:12,fontWeight:"normal"},children:["updated ",E]})]}),i.jsxs("section",{style:{marginTop:24},children:[i.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Queue"}),i.jsxs("div",{children:["waiting=",i.jsx("b",{children:s.queue_health.waiting})," ","active=",i.jsx("b",{children:s.queue_health.active})," ","stalled=",i.jsx("b",{style:{color:s.queue_health.stalled>0?"var(--accent-warn, #d29922)":void 0},children:s.queue_health.stalled})]})]}),s.by_type.length>0&&i.jsxs("section",{style:{marginTop:24},children:[i.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"By type (24h)"}),i.jsxs("table",{style:{borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{color:"var(--text-muted, #777)",fontSize:12},children:[i.jsx("th",{style:{textAlign:"left",padding:"4px 12px 4px 0"},children:"name"}),i.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"total"}),i.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"done"}),i.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"fail"}),i.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"dead"})]})}),i.jsx("tbody",{children:s.by_type.slice(0,6).map(_=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"4px 12px 4px 0"},children:_.name}),i.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:_.total}),i.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:_.completed}),i.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:_.failed}),i.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:_.dead})]},_.name))})]})]}),i.jsxs("section",{style:{marginTop:24},children:[i.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Lease pressure (1h)"}),i.jsxs("div",{style:{color:ky(s.lease_pressure_1h)},children:[s.lease_pressure_1h," bounce",s.lease_pressure_1h===1?"":"s"]})]}),s.top_errors.length>0&&i.jsxs("section",{style:{marginTop:24},children:[i.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Top errors (24h)"}),i.jsx("table",{style:{borderCollapse:"collapse"},children:i.jsx("tbody",{children:s.top_errors.slice(0,5).map(_=>i.jsxs("tr",{children:[i.jsxs("td",{style:{textAlign:"right",padding:"4px 12px 4px 0",color:"var(--text-muted, #777)"},children:[_.count,"×"]}),i.jsx("td",{style:{padding:"4px 12px 4px 0"},children:_.cluster})]},_.cluster))})})]}),s.budget_owners.length>0&&i.jsxs("section",{style:{marginTop:24},children:[i.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Budget owners"}),i.jsxs("table",{style:{borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{color:"var(--text-muted, #777)",fontSize:12},children:[i.jsx("th",{style:{textAlign:"left",padding:"4px 12px 4px 0"},children:"owner"}),i.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"spent"}),i.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"remaining"})]})}),i.jsx("tbody",{children:s.budget_owners.slice(0,5).map(_=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"4px 12px 4px 0"},children:_.owner_id}),i.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:Yd(_.total_spent_cents)}),i.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:Yd(_.remaining_cents)})]},_.owner_id))})]})]})]})}function $y(){var H,A;const[s,S]=M.useState(),[b,o]=M.useState(""),[E,_]=M.useState(!1);M.useEffect(()=>{let d=!0;const O=Ku();if(!O){o("No pending authorization request. Restart the connection from your client.");return}return be.oauthRequest(O).then(R=>{d&&S(R)}).catch(R=>{d&&o(R.message)}),()=>{d=!1}},[]);const q=async d=>{if(!(!s||E)){_(!0),o("");try{const O=await be.decideOAuthRequest(s.id,d,s.csrf);Hd(),window.location.assign(O.redirectUrl)}catch(O){o(O instanceof Error?O.message:"Approval failed. Restart the connection from your client."),S(void 0),_(!1)}}};return i.jsxs("section",{"aria-labelledby":"consent-title",style:{maxWidth:760},children:[i.jsx("h1",{id:"consent-title",children:"Approve client access"}),i.jsx("p",{style:{color:"var(--text-secondary)",margin:"16px 0"},children:"Only approve a connection you initiated. These permissions let the client act on your brain."}),b&&i.jsx("div",{role:"alert",className:"login-error",style:{marginBottom:16},children:b}),!s&&!b&&i.jsx("p",{role:"status",children:"Loading authorization request…"}),s&&i.jsxs(i.Fragment,{children:[i.jsxs("dl",{className:"oauth-consent-details",children:[i.jsx("dt",{children:"Client"}),i.jsx("dd",{children:s.clientName}),i.jsx("dt",{children:"Client ID"}),i.jsx("dd",{children:i.jsx("code",{children:s.clientId})}),i.jsx("dt",{children:"Redirect destination"}),i.jsx("dd",{children:i.jsx("code",{children:s.redirectUri})}),i.jsx("dt",{children:"Permissions"}),i.jsx("dd",{children:s.scopes.length?s.scopes.map(d=>i.jsx("span",{className:`badge ${d.includes("admin")?"badge-error":""}`,style:{marginRight:8},children:d},d)):"No permissions"}),i.jsx("dt",{children:"Administrative brain operations"}),i.jsx("dd",{children:s.scopes.some(d=>d==="admin")?"Eligible operations within the grant below. This does not grant owner dashboard access.":s.scopes.some(d=>d.endsWith("_admin"))?"The named administrative brain operations. This does not grant owner dashboard access.":"None"}),i.jsx("dt",{children:"Allowed operations"}),i.jsx("dd",{children:s.allowedOperations===null?"All operations permitted by these scopes and the server policy":s.allowedOperations.join(", ")||"None"}),i.jsx("dt",{children:"Write paths"}),i.jsx("dd",{children:s.boundSlugPrefixes===null?"Within the granted source":s.boundSlugPrefixes.join(", ")||"None"}),s.scopes.includes("agent")&&i.jsxs(i.Fragment,{children:[i.jsx("dt",{children:"Delegated tools"}),i.jsx("dd",{children:((H=s.delegatedTools)==null?void 0:H.join(", "))||"None"}),i.jsx("dt",{children:"Delegated write paths"}),i.jsx("dd",{children:s.delegatedNamespace==="job"?"A separate namespace for each job":((A=s.delegatedSlugPrefixes)==null?void 0:A.join(", "))||"None"})]}),i.jsx("dt",{children:"Write source"}),i.jsx("dd",{children:s.sourceId??"Not configured"}),i.jsx("dt",{children:"Read sources"}),i.jsx("dd",{children:s.allowedSources.length?s.allowedSources.join(", "):s.sourceId??"Not configured"}),i.jsx("dt",{children:"Resource"}),i.jsx("dd",{children:i.jsx("code",{children:s.resource??"No resource binding requested"})}),i.jsx("dt",{children:"Request expires"}),i.jsx("dd",{children:new Date(s.expiresAt).toLocaleTimeString()})]}),i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:12,marginTop:24},children:[i.jsx("button",{className:"btn",disabled:E,onClick:()=>q("deny"),children:"Deny"}),i.jsx("button",{className:"btn btn-primary",disabled:E,onClick:()=>q("approve"),children:E?"Completing request…":"Approve access"})]})]}),b&&i.jsx("button",{className:"btn",onClick:()=>{Hd(),window.location.hash="agents"},children:"Return to agents"})]})}function Gd(){const s=window.location.hash.replace("#","")||"dashboard";return Ku()&&s==="dashboard"?"oauth-consent":["login","dashboard","agents","log","calibration","jobs","oauth-consent"].includes(s)?s:"dashboard"}function Fy(){const[s,S]=M.useState(Gd);M.useEffect(()=>{const E=()=>S(Gd());return window.addEventListener("hashchange",E),()=>window.removeEventListener("hashchange",E)},[]);const b=E=>{window.location.hash=E,S(E)};if(s==="login")return i.jsx(Cy,{onLogin:()=>b(Ku()?"oauth-consent":"dashboard")});const o=async()=>{if(confirm("Sign out every active admin session, including other browsers and tabs? Each one will need to re-authenticate via a fresh magic link.")){try{await be.signOutEverywhere()}catch{}b("login")}};return i.jsxs("div",{className:"app",children:[i.jsxs("nav",{className:"sidebar",children:[i.jsx("div",{className:"sidebar-logo",children:"GBrain"}),i.jsxs("div",{className:"sidebar-nav",children:[i.jsx("a",{className:`nav-item ${s==="dashboard"?"active":""}`,onClick:()=>b("dashboard"),children:"Dashboard"}),i.jsx("a",{className:`nav-item ${s==="agents"?"active":""}`,onClick:()=>b("agents"),children:"Agents"}),i.jsx("a",{className:`nav-item ${s==="log"?"active":""}`,onClick:()=>b("log"),children:"Request Log"}),i.jsx("a",{className:`nav-item ${s==="calibration"?"active":""}`,onClick:()=>b("calibration"),children:"Calibration"}),i.jsx("a",{className:`nav-item ${s==="jobs"?"active":""}`,onClick:()=>b("jobs"),children:"Jobs Watch"})]}),i.jsx("div",{style:{marginTop:"auto",padding:"16px 12px",borderTop:"1px solid var(--border)"},children:i.jsx("button",{onClick:o,style:{background:"transparent",border:"1px solid var(--border)",color:"var(--text-secondary)",padding:"6px 10px",borderRadius:6,fontSize:12,cursor:"pointer",width:"100%"},title:"Revoke every active admin session — every browser, every tab",children:"Sign out everywhere"})})]}),i.jsxs("main",{className:"main",children:[s==="dashboard"&&i.jsx(Dy,{}),s==="agents"&&i.jsx(wy,{}),s==="log"&&i.jsx(Vy,{}),s==="calibration"&&i.jsx(Jy,{}),s==="jobs"&&i.jsx(Wy,{}),s==="oauth-consent"&&i.jsx($y,{})]})]})}zy.createRoot(document.getElementById("root")).render(i.jsx(Xd.StrictMode,{children:i.jsx(Fy,{})}));+`))??"",editOperations:!1}}function Ld(s){const x=s.scopes?Oa(s.scopes).includes("agent"):["full","delegating-agent"].includes(s.profile);return{...s.applyProfile?{profile:s.profile}:{},sourceId:s.source,federatedRead:s.reads,boundSlugPrefixes:s.directPrefixes.trim()?Oa(s.directPrefixes):null,...s.scopes.trim()?{scopes:Oa(s.scopes)}:{},...s.editOperations?{allowedOperations:Oa(s.operationSnapshot)}:{},...x?{boundTools:s.tools,boundSourceId:s.source,delegatedNamespace:s.namespace,delegatedSlugPrefixes:s.namespace==="job"?null:Oa(s.delegatedPrefixes)}:{},boundMaxConcurrent:Number(s.concurrency),budgetUsdPerDay:s.budget==="unlimited"?null:s.budget,tokenTtl:s.ttl==="0"?null:Number(s.ttl),surface:s.surface==="default"?null:s.surface}}function Zd(s){return{...s.profile?{profile:s.profile}:{},scopes:s.scopes,sourceId:s.sourceId,federatedRead:s.federatedRead,boundSlugPrefixes:s.boundSlugPrefixes,allowedOperations:s.allowedOperations,boundTools:s.boundTools,boundSourceId:s.boundSourceId,boundBrainId:s.boundBrainId,delegatedNamespace:s.delegatedNamespace,delegatedSlugPrefixes:s.delegatedSlugPrefixes,boundMaxConcurrent:s.boundMaxConcurrent,budgetUsdPerDay:s.budgetUsdPerDay,tokenTtlSeconds:s.tokenTtlSeconds,surface:s.surface}}function Vd({draft:s,setDraft:x,sources:b,catalog:o,existing:E=!1}){const _=(d,D)=>x({...s,[d]:D}),q=new Set(b.map(d=>d.id)),H=s.scopes?Oa(s.scopes).includes("agent"):["full","delegating-agent"].includes(s.profile),A={marginBottom:14};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:A,children:[i.jsx("label",{htmlFor:"grant-profile",children:"Permission profile"}),i.jsx("select",{id:"grant-profile",value:s.profile,onChange:d=>x({...s,profile:d.target.value,applyProfile:!0,scopes:"",editOperations:!1,surface:["operator","full"].includes(d.target.value)?"full":"starter"}),children:o.profiles.map(d=>i.jsx("option",{children:d},d))}),i.jsx("p",{className:"grant-help",children:"Memory writer lets this agent recall, save, correct, and withdraw memory. Delegating profiles also allow selected server tools to run jobs."}),E&&i.jsxs("label",{className:"checkbox-label",children:[i.jsx("input",{type:"checkbox",checked:s.applyProfile,onChange:d=>_("applyProfile",d.target.checked)}),"Apply this profile's current operation snapshot"]})]}),i.jsxs("div",{style:A,children:[i.jsx("label",{htmlFor:"grant-source",children:"Primary / write source"}),i.jsxs("select",{id:"grant-source",value:s.source,onChange:d=>_("source",d.target.value),children:[!q.has(s.source)&&i.jsxs("option",{value:s.source,children:[s.source," · unavailable"]}),b.map(d=>i.jsxs("option",{value:d.id,children:[d.name," (",d.id,")"]},d.id))]})]}),i.jsxs("fieldset",{style:{border:0,padding:0,margin:"0 0 14px"},children:[i.jsx("legend",{children:"Readable sources"}),[...b,...s.reads.filter(d=>!q.has(d)).map(d=>({id:d,name:`${d} · unavailable`}))].map(d=>i.jsxs("label",{className:"checkbox-label",children:[i.jsx("input",{type:"checkbox",checked:s.reads.includes(d.id),onChange:D=>_("reads",D.target.checked?[...s.reads,d.id]:s.reads.filter(O=>O!==d.id))}),d.name]},d.id))]}),i.jsxs("div",{style:A,children:[i.jsx("label",{htmlFor:"grant-direct-prefixes",children:"Direct write prefixes (one per line)"}),i.jsx("textarea",{id:"grant-direct-prefixes",rows:2,value:s.directPrefixes,onChange:d=>_("directPrefixes",d.target.value),placeholder:"work-example/"}),i.jsx("p",{className:"grant-help",children:"Blank grants the whole primary source. Coding agent requires an explicit prefix."})]}),H&&i.jsxs("fieldset",{style:{border:"1px solid var(--border)",padding:12,marginBottom:14},children:[i.jsx("legend",{children:"Delegated jobs"}),i.jsx("p",{className:"grant-help",children:"Choose every tool explicitly. Jobs stay in the primary source; existing jobs retain their original limits."}),i.jsx("div",{className:"checkbox-group",style:{maxHeight:180,overflowY:"auto"},children:[...new Set([...o.delegatedTools,...s.tools])].map(d=>i.jsxs("label",{className:"checkbox-label",children:[i.jsx("input",{type:"checkbox",checked:s.tools.includes(d),onChange:D=>_("tools",D.target.checked?[...s.tools,d]:s.tools.filter(O=>O!==d))}),d,o.delegatedTools.includes(d)?"":" · unavailable"]},d))}),i.jsx("label",{htmlFor:"grant-namespace",children:"Delegated write namespace"}),i.jsxs("select",{id:"grant-namespace",value:s.namespace,onChange:d=>_("namespace",d.target.value),children:[i.jsx("option",{value:"job",children:"Each job's own wiki/agents/ directory"}),i.jsx("option",{value:"prefixes",children:"Explicit prefixes"})]}),s.namespace==="prefixes"&&i.jsx("textarea",{"aria-label":"Delegated prefixes",rows:2,value:s.delegatedPrefixes,onChange:d=>_("delegatedPrefixes",d.target.value),placeholder:"work-example/"})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12,...A},children:[i.jsxs("div",{children:[i.jsx("label",{htmlFor:"grant-concurrency",children:"Concurrent jobs"}),i.jsx("input",{id:"grant-concurrency",type:"number",min:1,step:1,value:s.concurrency,onChange:d=>_("concurrency",d.target.value)})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"grant-budget",children:"Daily delegated spend (USD)"}),i.jsx("input",{id:"grant-budget",value:s.budget,onChange:d=>_("budget",d.target.value),placeholder:"unlimited"}),i.jsx("p",{className:"grant-help",children:"Use unlimited for no spending cap, or an amount such as 2.50."})]})]}),i.jsxs("div",{style:A,children:[i.jsx("label",{htmlFor:"grant-ttl",children:"Future access token lifetime (seconds)"}),i.jsx("input",{id:"grant-ttl",type:"number",min:0,max:7776e3,step:1,value:s.ttl,onChange:d=>_("ttl",d.target.value)}),i.jsx("p",{className:"grant-help",children:"Renewable: 3600 (1 hour). Static bearer: 2592000 (30 days). 0 uses the server default. Existing tokens keep their expiry."})]}),i.jsxs("details",{style:A,children:[i.jsx("summary",{children:"Advanced permissions"}),i.jsx("label",{htmlFor:"grant-scopes",children:"Scope override"}),i.jsx("input",{id:"grant-scopes",value:s.scopes,onChange:d=>_("scopes",d.target.value),placeholder:"Use profile scopes"}),i.jsx("p",{className:"grant-help",children:"Scopes allow eligible brain operations. Admin does not grant owner dashboard access or delegation."}),i.jsx("label",{htmlFor:"grant-surface",children:"Visible tool catalog"}),i.jsx("select",{id:"grant-surface",value:s.surface,onChange:d=>_("surface",d.target.value),children:["verbs","starter","full","default"].map(d=>i.jsx("option",{children:d},d))}),i.jsx("p",{className:"grant-help",children:"Full shows all eligible tools; it does not grant additional authority."}),i.jsxs("label",{className:"checkbox-label",children:[i.jsx("input",{type:"checkbox",checked:s.editOperations,onChange:d=>_("editOperations",d.target.checked)}),"Replace operation authority snapshot"]}),s.editOperations&&i.jsxs(i.Fragment,{children:[i.jsx("textarea",{"aria-label":"Allowed operations",rows:5,value:s.operationSnapshot,onChange:d=>_("operationSnapshot",d.target.value)}),i.jsx("p",{className:"grant-help",children:"One operation name per line. An empty list denies every operation, including delegated tools."})]})]})]})}const My=[["Profile","profile"],["Scopes","scopes"],["Write source","sourceId"],["Readable sources","federatedRead"],["Direct prefixes","boundSlugPrefixes"],["Visible catalog","surface"],["Operation authority","allowedOperations"],["Delegated tools","boundTools"],["Delegated source","boundSourceId"],["Delegated brain","boundBrainId"],["Delegated namespace","delegatedNamespace"],["Delegated prefixes","delegatedSlugPrefixes"],["Concurrent jobs","boundMaxConcurrent"],["Daily USD cap","budgetUsdPerDay"],["Future token TTL","tokenTtlSeconds"]];function Ry(s,x){return s===null?x==="budgetUsdPerDay"?"Unlimited":x==="allowedOperations"?"Legacy scope-based catalog":"Unset":Array.isArray(s)?s.join(", ")||"(none)":String(s)}function Bd({grant:s,field:x}){const b=s[x];return x==="allowedOperations"&&Array.isArray(b)&&b.length>8?i.jsxs("details",{children:[i.jsxs("summary",{children:[b.length," operations · inspect list"]}),i.jsx("div",{style:{maxHeight:160,overflowY:"auto",marginTop:8},children:b.join(", ")})]}):i.jsx(i.Fragment,{children:Ry(b,x)})}function Kd({preview:s}){return i.jsxs("div",{"aria-live":"polite",style:{margin:"16px 0"},children:[i.jsx("h3",{children:"Review permissions"}),i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Permission"}),s.before&&i.jsx("th",{children:"Current"}),i.jsx("th",{children:"Proposed"})]})}),i.jsx("tbody",{children:My.filter(([,x])=>!s.before||JSON.stringify(s.before[x])!==JSON.stringify(s.after[x])).map(([x,b])=>i.jsxs("tr",{children:[i.jsx("th",{children:x}),s.before&&i.jsx("td",{style:{overflowWrap:"anywhere",maxWidth:200},children:i.jsx(Bd,{grant:s.before,field:b})}),i.jsx("td",{style:{overflowWrap:"anywhere",maxWidth:280},children:i.jsx(Bd,{grant:s.after,field:b})})]},b))})]})}),i.jsx("p",{className:"grant-help",children:s.tokenImplications})]})}function Uy({clientId:s,sources:x,sourcesReady:b=!0,onRescoped:o}){const[E,_]=U.useState(),[q,H]=U.useState(),[A,d]=U.useState(),[D,O]=U.useState(),[R,Q]=U.useState(""),[G,Z]=U.useState(!1),[W,ae]=U.useState(!1),[$,le]=U.useState(!1),ne=async(k=!1)=>{Z(!0),ae(!1);try{const[V,Se]=await Promise.all([be.clientGrant(s),be.grantCatalog()]);_(V.grant),H(bs(V.grant)),d(Se),O(void 0),Q(""),le(!1),k&&o(V.grant)}finally{Z(!1)}};U.useEffect(()=>{ne().catch(k=>Q(k.message))},[s]);const xe=async()=>{if(!(!q||!E||!b||$)){Z(!0),Q(""),ae(!1);try{const k=await be.updateClientGrant(s,{...D?Zd(D.after):Ld(q),expectedRevision:E.revision,dryRun:!D});D?(_(k.after),H(bs(k.after)),O(void 0),ae(!0),o(k.after)):O(k)}catch(k){const V=!!D&&Ss(k);le(V||k instanceof An&&k.status===409),O(void 0),Q(`${k instanceof Error?k.message:"Grant update failed."}${V?" The change may have completed. Reload the current grant before editing permissions again.":""}`)}finally{Z(!1)}}};return i.jsxs("section",{children:[i.jsx("div",{className:"section-title",children:"Permissions"}),E&&i.jsxs("p",{className:"grant-help",children:["Revision ",E.revision,". Review source access, direct tools, and delegated work independently."]}),E&&i.jsx(qy,{clientId:s,revision:E.revision}),!!(E!=null&&E.repairReasons.length)&&i.jsxs("p",{role:"status",style:{color:"var(--warning)"},children:["Delegation needs repair: ",E.repairReasons.join(", "),". Review and explicitly grant the missing bindings below."]}),!b&&i.jsx("p",{role:"alert",children:"Current sources are unavailable. Retry sources before editing permissions."}),i.jsx("fieldset",{disabled:G||!b||$,style:{border:0,padding:0},children:q&&A&&i.jsx(Vd,{draft:q,catalog:A,sources:x,existing:!0,setDraft:k=>{H(k),O(void 0),ae(!1)}})}),R&&i.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[R," ",i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:G,onClick:()=>void ne(!0).catch(k=>Q(k.message)),children:"Reload current grant"})]}),D&&i.jsx(Kd,{preview:D}),W&&i.jsx("p",{role:"status",children:"Permissions saved. Credentials are unchanged."}),i.jsx("button",{type:"button",className:"btn btn-primary",disabled:G||!q||!A||!b||$,onClick:()=>void xe(),children:G?"Checking…":D?"Apply reviewed changes":"Preview changes"})]})}function qy({clientId:s,revision:x}){const[b,o]=U.useState(),[E,_]=U.useState(!1);return U.useEffect(()=>{let q=!0;const H=()=>void be.agentsSpend().then(d=>{q&&(o(d.find(D=>D.client_id===s)),_(!1))}).catch(()=>{q&&_(!0)});H();const A=setInterval(H,2e4);return()=>{q=!1,clearInterval(A)}},[s,x]),E?i.jsx("p",{role:"status",children:"Delegated spend is unavailable. Reload to check before starting more work."}):b?i.jsxs("div",{style:{border:"1px solid var(--border)",padding:12,marginBottom:14},children:[i.jsx("strong",{children:"Delegated work"}),i.jsxs("p",{children:[b.inflight_count," unfinished jobs · Daily cap: ",b.cap_usd_per_day===null?"Unlimited":`$${b.cap_usd_per_day.toFixed(2)}`]}),i.jsxs("p",{className:"grant-help",children:["Recorded today: $",(b.spent_cents_today/100).toFixed(2),". Known outstanding reservations: $",(b.pending_cents/100).toFixed(2),", including overdue calls from earlier days."]}),b.unknown_count>0&&i.jsxs("p",{role:"status",style:{color:"var(--warning)"},children:[b.unknown_count," unresolved calls have an unknown cost. The known amounts above do not bound total liability; a finite cap refuses further calls until reconciliation."]})]}):null}function Hy(s,x){const b=URL.createObjectURL(new Blob([JSON.stringify(s,null,2)],{type:"application/json"})),o=document.createElement("a");o.href=b,o.download=x,o.click(),URL.revokeObjectURL(b)}function Jd({clientId:s,grantTypes:x,revoked:b=!1,grantRevision:o}){const[E,_]=U.useState("generic"),q=x.includes("authorization_code")&&x.includes("client_credentials"),[H,A]=U.useState(q?"":x.includes("authorization_code")?"authorization-code":"client-credentials"),[d,D]=U.useState(),[O,R]=U.useState(),[Q,G]=U.useState([]),[Z,W]=U.useState(""),[ae,$]=U.useState(!1),[le,ne]=U.useState(!1),[xe,k]=U.useState(!1),[V,Se]=U.useState(0);U.useEffect(()=>{if(b)return;let se=!0;if(R(void 0),G([]),W(""),ne(!1),k(!1),!!H)return Promise.all([be.clientSetup(s,E,H),be.grantCatalog()]).then(([F,de])=>{se&&(R(F.setup),G(F.instructions),D(de))}).catch(F=>{se&&W(F instanceof Error?F.message:"Setup instructions are unavailable.")}),()=>{se=!1}},[s,E,H,b,o,V]);const je=async()=>{if(O){$(!0),W("");try{const se=await be.recoverClient(s,E,H),F=H==="authorization-code"?se.oauthSetup:se.credentials;if(!F)throw new Error("No matching setup file was returned. Ask the host administrator to inspect this client’s credential delivery.");Hy(F,`${s}-${H==="authorization-code"?"oauth-setup":"credentials"}.json`),ne(!0)}catch(se){W(se instanceof Error?se.message:"Download failed. Existing permissions are unchanged.")}finally{$(!1)}}};return i.jsxs("section",{"aria-labelledby":"client-setup-title",children:[i.jsx("h3",{id:"client-setup-title",className:"section-title",children:"Set up this client"}),b?i.jsx("p",{children:"This client is revoked. Register a new client to connect another harness."}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"grant-help",children:"Registration grants access. Configure the intended harness, then verify an actual memory round trip there."}),i.jsx("label",{htmlFor:"setup-harness",children:"Harness"}),i.jsxs("select",{id:"setup-harness",value:E,onChange:se=>_(se.target.value),disabled:ae,children:[!d&&i.jsx("option",{value:"generic",children:"Generic MCP client"}),d==null?void 0:d.harnesses.map(se=>i.jsx("option",{value:se.id,children:se.label},se.id))]}),q&&i.jsxs(i.Fragment,{children:[i.jsx("label",{htmlFor:"setup-flow",children:"Connection flow"}),i.jsxs("select",{id:"setup-flow",value:H,onChange:se=>A(se.target.value),disabled:ae,children:[i.jsx("option",{value:"",children:"Choose the flow supported by your harness"}),i.jsx("option",{value:"authorization-code",children:"Browser sign-in with PKCE"}),i.jsx("option",{value:"client-credentials",children:"Machine credentials"})]})]}),O&&i.jsxs(i.Fragment,{children:[i.jsxs("dl",{className:"oauth-consent-details",style:{marginTop:16},children:[i.jsx("dt",{children:"MCP URL"}),i.jsx("dd",{children:i.jsx("code",{children:O.mcp_url})}),i.jsx("dt",{children:"OAuth issuer"}),i.jsx("dd",{children:i.jsx("code",{children:O.issuer_url})}),i.jsx("dt",{children:"Client ID"}),i.jsx("dd",{children:i.jsx("code",{children:O.client.client_id})}),i.jsx("dt",{children:"Scopes"}),i.jsx("dd",{children:O.scopes.join(" ")||"None"}),i.jsx("dt",{children:"Authentication"}),i.jsx("dd",{children:O.client.token_endpoint_auth_method==="none"?"Public client — PKCE, no client secret":O.client.token_endpoint_auth_method}),O.flow==="authorization-code"&&i.jsxs(i.Fragment,{children:[i.jsx("dt",{children:"Redirect URIs"}),i.jsx("dd",{children:O.client.redirect_uris.map(se=>i.jsx("div",{children:i.jsx("code",{children:se})},se))})]})]}),i.jsx("ol",{children:Q.map((se,F)=>i.jsx("li",{style:{marginBottom:8,overflowWrap:"anywhere"},children:se},F))}),i.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginTop:16},children:[i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>{navigator.clipboard.writeText(Q.join(`+`)).then(()=>k(!0)).catch(()=>W("Clipboard unavailable. Select and copy the instructions above."))},children:xe?"Instructions copied":"Copy setup instructions"}),i.jsx("button",{type:"button",className:"btn btn-primary",disabled:ae,onClick:()=>void je(),children:ae?"Preparing download…":O.flow==="authorization-code"?"Download OAuth setup":"Download credentials"})]}),i.jsx("p",{className:"grant-help",children:"Keep downloaded files private. Set permissions to 0600 on the target computer. A setup download does not verify the harness."})]}),!H&&i.jsx("p",{role:"status",children:"This client supports both flows. Choose one before requesting setup instructions."}),H&&!O&&!Z&&i.jsx("p",{role:"status",children:"Loading setup instructions…"}),le&&i.jsx("p",{role:"status",children:"Setup file delivered to your browser. Harness verification is still required."}),Z&&i.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[Z," ",i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:ae,onClick:()=>Se(se=>se+1),children:"Retry setup"})]})]})]})}const gs={"invalidate-tokens":"Invalidate tokens",revoke:"Revoke client",delete:"Delete client"};function By({clientId:s,name:x,revoked:b,onChanged:o,onBusyChange:E}){const[_,q]=U.useState(),[H,A]=U.useState(!1),[d,D]=U.useState(""),[O,R]=U.useState(!1),Q=async Z=>{A(!0),D(""),q(void 0);try{q(await be.clientLifecycle(s,{action:Z,dryRun:!0}))}catch(W){D(W instanceof Error?W.message:"Could not preview this action. Retry after checking the client.")}finally{A(!1)}},G=async()=>{if(_){A(!0),E==null||E(!0),D("");try{await be.clientLifecycle(s,{action:_.action,dryRun:!1,yes:!0,expectedRevision:_.before.revision}),o()}catch(Z){const W=Ss(Z);D(`${Z instanceof Error?Z.message:"Request failed."} ${W?"The action may have completed. Reload the client and inspect its current state before requesting another action.":"The request was refused. Review a fresh preview before applying an action."}`),R(W),q(void 0)}finally{A(!1),E==null||E(!1)}}};return i.jsxs("section",{"aria-labelledby":"client-lifecycle-title",style:{marginTop:28},children:[i.jsx("h3",{id:"client-lifecycle-title",className:"section-title",children:"Client access"}),i.jsx("p",{className:"grant-help",children:"Invalidating tokens keeps the client and its secret. Revoking ends access and keeps a visible registration. Deleting removes the registration. Memory and audit history remain."}),!_&&i.jsx("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:["invalidate-tokens","revoke","delete"].filter(Z=>!b||Z==="delete").map(Z=>i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:H||O,onClick:()=>void Q(Z),children:gs[Z]},Z))}),_&&i.jsxs("div",{"aria-live":"polite",style:{border:"1px solid var(--border)",padding:16},children:[i.jsxs("h4",{style:{margin:"0 0 12px"},children:[gs[_.action],": ",x]}),i.jsxs("p",{children:[i.jsx("code",{children:s})," · Revision ",_.before.revision]}),i.jsx("ul",{children:(Array.isArray(_.consequences)?_.consequences:[_.consequences]).map((Z,W)=>i.jsx("li",{children:Z},W))}),i.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:16},children:[i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:H,onClick:()=>q(void 0),children:"Cancel"}),i.jsx("button",{type:"button",className:"btn btn-danger",disabled:H,onClick:()=>void G(),children:H?"Applying…":`Confirm ${gs[_.action].toLowerCase()}`})]})]}),d&&i.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[d," ",O&&i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:o,children:"Reload client list"})]})]})}function _n({title:s,titleId:x,children:b,onClose:o,busy:E=!1,drawer:_=!1}){const q=U.useRef(null),H=U.useRef(o);H.current=o;const A=U.useRef(E);A.current=E;const[d]=U.useState(()=>document.activeElement instanceof HTMLElement?document.activeElement:null);return U.useEffect(()=>{const D=q.current;if(!D)return;(D.querySelector("[data-autofocus]")??D).focus();const O=R=>{if(R.key==="Escape"&&(R.preventDefault(),A.current||H.current()),R.key!=="Tab")return;const Q=[...D.querySelectorAll('button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href], summary, [tabindex="0"]')].filter(W=>W.getClientRects().length>0&&!W.closest("fieldset:disabled")),G=Q[0],Z=Q[Q.length-1];if(!G){R.preventDefault(),D.focus();return}R.shiftKey&&(document.activeElement===G||document.activeElement===D)?(R.preventDefault(),Z.focus()):!R.shiftKey&&(document.activeElement===Z||document.activeElement===D)&&(R.preventDefault(),G.focus())};return D.addEventListener("keydown",O),()=>{D.removeEventListener("keydown",O),d!=null&&d.isConnected&&d.focus()}},[d]),i.jsx("div",{className:_?"drawer-overlay":"modal-overlay",onClick:()=>{E||o()},children:i.jsxs("div",{ref:q,role:"dialog","aria-modal":"true","aria-labelledby":x,"aria-busy":E,tabIndex:-1,className:_?"drawer":"modal",onClick:D=>D.stopPropagation(),style:_?{width:"min(640px, 95vw)"}:{maxWidth:760,width:"92vw",minWidth:0,maxHeight:"90vh",overflowY:"auto"},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16,alignItems:"start",marginBottom:20},children:[i.jsx("h2",{id:x,className:"modal-title",style:{margin:0},children:s}),i.jsx("button",{type:"button",className:"btn btn-secondary","aria-label":`Close ${s}`,disabled:E,onClick:o,children:"Close"})]}),b]})})}function Yy(s){const x=s.kind!=="machine",b=x?s.redirectUris.split(`+`).map(o=>o.trim()).filter(Boolean):[];if(x&&!b.length)throw new Error("Enter the exact redirect URI from your MCP client settings, one per line.");for(const o of b)try{new URL(o)}catch{throw new Error("Each redirect URI must be a complete URI. Copy it exactly from your MCP client settings.")}return{grantTypes:x?["authorization_code","refresh_token"]:["client_credentials"],redirectUris:b,tokenEndpointAuthMethod:s.kind==="public-pkce"?"none":s.kind==="machine"?"client_secret_post":s.confidentialMethod}}function Gy(s){const x=Math.floor((Date.now()-s.getTime())/1e3);return x<60?"just now":x<3600?Math.floor(x/60)+"m ago":x<86400?Math.floor(x/3600)+"h ago":Math.floor(x/86400)+"d ago"}function wy(){const[s,x]=U.useState([]),[b,o]=U.useState([]),[E,_]=U.useState(!1),[q,H]=U.useState(!1),[A,d]=U.useState(""),[D,O]=U.useState(""),[R,Q]=U.useState(!0),[G,Z]=U.useState(!0),[W,ae]=U.useState(!1),[$,le]=U.useState(!1),[ne,xe]=U.useState(),[k,V]=U.useState(),[Se,je]=U.useState(!1),[se,F]=U.useState(),de=U.useRef(0),Ge=U.useRef(0),Ce=async()=>{const N=++de.current;Q(!0);try{const Y=await be.agents();if(N!==de.current)return;x(Y),_(!0),d("")}catch(Y){N===de.current&&d(Y instanceof Error?Y.message:"Clients are unavailable.")}finally{N===de.current&&Q(!1)}},Ze=async()=>{const N=++Ge.current;Z(!0);try{const Y=await be.sources();if(N!==Ge.current)return;o(Y),H(!0),O("")}catch(Y){N===Ge.current&&(H(!1),O(Y instanceof Error?Y.message:"Sources are unavailable."))}finally{N===Ge.current&&Z(!1)}};U.useEffect(()=>(Ce(),Ze(),()=>{de.current++,Ge.current++}),[]);const j=s.filter(N=>!W||N.status!=="revoked");return i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12,flexWrap:"wrap",alignItems:"center",marginBottom:24},children:[i.jsx("h1",{className:"page-title",style:{marginBottom:0},children:"Agents"}),i.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[i.jsxs("label",{className:"checkbox-label",children:[i.jsx("input",{type:"checkbox",checked:W,onChange:N=>ae(N.target.checked)}),"Hide revoked"]}),i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:R,onClick:()=>void Ce(),children:"Refresh clients"}),i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>je(!0),children:"+ API Key"}),i.jsx("button",{type:"button",className:"btn btn-primary",disabled:!q||!b.length||G,onClick:()=>le(!0),children:"+ OAuth Client"})]})]}),i.jsx("p",{className:"grant-help",style:{marginBottom:16},children:"Owner administration uses this dashboard’s login. An OAuth client’s admin scope allows eligible brain operations; it does not open this dashboard."}),A&&i.jsxs("p",{role:"alert",style:{marginBottom:16,color:"var(--error)"},children:[E?"Showing previously loaded clients. ":"Could not load clients. ",A," ",i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:R,onClick:()=>void Ce(),children:"Retry clients"})]}),D&&i.jsxs("p",{role:"alert",style:{marginBottom:16,color:"var(--error)"},children:["Could not load current sources. Registration and permission changes are unavailable. ",D," ",i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:G,onClick:()=>void Ze(),children:"Retry sources"})]}),!D&&!q&&i.jsx("p",{role:"status",children:"Loading sources before registration…"}),q&&!b.length&&i.jsx("p",{role:"status",children:"No active sources are available. Add or unarchive a source on the host before registering a client."}),!E&&!A&&i.jsx("p",{role:"status",children:"Loading clients…"}),E&&!s.length&&i.jsx("p",{style:{textAlign:"center",padding:48},children:"No clients registered. Register a client to grant access to a harness."}),E&&s.length>0&&!j.length&&i.jsx("p",{style:{textAlign:"center",padding:48},children:"All clients are revoked. Uncheck “Hide revoked” to view them."}),j.length>0&&i.jsxs("div",{style:{overflowX:"auto"},children:[i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Name"}),i.jsx("th",{children:"Type"}),i.jsx("th",{children:"Scopes"}),i.jsx("th",{children:"Sources"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Requests"}),i.jsx("th",{children:"Last used"})]})}),i.jsx("tbody",{children:j.map(N=>i.jsxs("tr",{onClick:()=>V(N),style:{cursor:"pointer"},children:[i.jsx("td",{children:i.jsx("button",{type:"button",className:"client-name-button",onClick:Y=>{Y.stopPropagation(),V(N)},children:N.name||N.client_name})}),i.jsx("td",{children:i.jsx("span",{className:"badge "+(N.auth_type==="oauth"?"badge-read":"badge-write"),children:N.auth_type==="oauth"?"OAuth":"API key"})}),i.jsx("td",{children:(N.scope||"").split(" ").filter(Boolean).map(Y=>i.jsx("span",{className:"badge badge-"+Y,style:{marginRight:4},children:Y},Y))}),i.jsx("td",{children:N.auth_type==="oauth"?(N.source_id||"none")+" · "+(N.federated_read||[]).length+" readable":"Unscoped"}),i.jsx("td",{children:i.jsx("span",{className:"badge "+(N.status==="active"?"badge-success":"badge-danger"),children:N.status})}),i.jsxs("td",{children:[N.requests_today||0,i.jsxs("span",{style:{color:"var(--text-muted)"},children:[" / ",N.total_requests||0]})]}),i.jsx("td",{children:N.last_used_at?Gy(new Date(N.last_used_at)):"Never"})]},N.auth_type+":"+N.id))})]}),i.jsxs("p",{className:"grant-help",style:{marginTop:12},children:[s.filter(N=>N.status==="active").length," active / ",s.length," total"]})]}),$&&i.jsx(Xy,{sources:b,sourcesReady:q,onClose:()=>le(!1),onRegistered:N=>{le(!1),xe(N),Ce()}}),ne&&i.jsxs(_n,{title:"Client registered",titleId:"registered-client-title",onClose:()=>xe(void 0),children:[i.jsxs("p",{role:"status",style:{marginBottom:16},children:[ne.name," is registered. Its harness connection has not been verified."]}),i.jsx(Jd,{clientId:ne.clientId,grantTypes:ne.grantTypes})]}),k&&i.jsx(Qy,{agent:k,sources:b,sourcesReady:q,onClose:()=>V(void 0),onChanged:()=>{V(void 0),Ce()},onRescoped:N=>{V(Y=>Y&&{...Y,source_id:N.sourceId,federated_read:N.federatedRead,scope:N.scopes.join(" "),token_ttl:N.tokenTtlSeconds}),Ce()}},k.id),Se&&i.jsx(Zy,{onClose:()=>je(!1),onCreated:N=>{je(!1),F(N),Ce()}}),se&&i.jsx(Vy,{token:se,onClose:()=>F(void 0)})]})}function Xy({sources:s,sourcesReady:x,onClose:b,onRegistered:o}){const[E,_]=U.useState(""),[q,H]=U.useState(()=>bs()),[A,d]=U.useState({kind:"machine",redirectUris:"",confidentialMethod:"client_secret_post"}),[D,O]=U.useState(),[R,Q]=U.useState(""),[G,Z]=U.useState(),[W,ae]=U.useState(!1),[$,le]=U.useState(""),[ne,xe]=U.useState(),[k,V]=U.useState(!1),Se=()=>{Q(""),be.grantCatalog().then(O).catch(F=>Q(F instanceof Error?F.message:"Permission catalog unavailable."))};U.useEffect(Se,[]);const je=F=>{d(F),Z(void 0)},se=async F=>{if(F.preventDefault(),!(!x||!D||k)){if(!E.trim()){le("Enter a client name.");return}ae(!0),le("");try{const de=(G==null?void 0:G.oauth)??Yy(A),Ge=(G==null?void 0:G.name)??E.trim(),Ce=await be.registerClient({...G?Zd(G.grant.after):Ld(q),...de,name:Ge,dryRun:!G});G?o({clientId:Ce.clientId,name:Ge,grantTypes:de.grantTypes}):Z({grant:Ce,oauth:de,name:Ge})}catch(de){le(de instanceof Error?de.message:"Registration failed.");const Ge=!!G&&Ss(de);if(V(Ge),G&&(Ge||de instanceof An&&de.status===409))try{const Ce=(await be.agents()).filter(Ze=>Ze.auth_type==="oauth"&&Ze.status==="active"&&(Ze.name||Ze.client_name)===G.name);Ce.length===1&&(xe({clientId:Ce[0].id||Ce[0].client_id,name:G.name,grantTypes:Ce[0].grant_types}),V(!0))}catch{}Z(void 0)}finally{ae(!1)}}};return i.jsx(_n,{title:"Register OAuth client",titleId:"register-client-title",onClose:b,busy:W,children:i.jsxs("form",{onSubmit:se,children:[i.jsxs("fieldset",{disabled:W||k,style:{border:0,padding:0},children:[i.jsx("label",{htmlFor:"agent-name",children:"Client name"}),i.jsx("input",{id:"agent-name","data-autofocus":!0,value:E,placeholder:"agent-example",onChange:F=>{_(F.target.value),Z(void 0)}}),i.jsx("label",{htmlFor:"oauth-connection-kind",style:{marginTop:16},children:"Connection type"}),i.jsxs("select",{id:"oauth-connection-kind",value:A.kind,onChange:F=>je({...A,kind:F.target.value}),children:[i.jsx("option",{value:"machine",children:"Machine credentials"}),i.jsx("option",{value:"public-pkce",children:"Browser sign-in: public client with PKCE"}),i.jsx("option",{value:"confidential-pkce",children:"Browser sign-in: confidential client with PKCE"})]}),i.jsx("p",{className:"grant-help",children:"Choose the method required by your MCP client. Browser sign-in requires the owner’s approval. Public clients use PKCE without a client secret."}),A.kind!=="machine"&&i.jsxs(i.Fragment,{children:[i.jsx("label",{htmlFor:"oauth-redirect-uris",children:"Exact redirect URIs (one per line)"}),i.jsx("textarea",{id:"oauth-redirect-uris",rows:3,value:A.redirectUris,onChange:F=>je({...A,redirectUris:F.target.value}),placeholder:"https://client.example.com/oauth/callback"}),i.jsx("p",{className:"grant-help",children:"Copy these from the client’s OAuth settings. Keep the complete path and query. GBrain uses S256 PKCE."})]}),A.kind==="confidential-pkce"&&i.jsxs(i.Fragment,{children:[i.jsx("label",{htmlFor:"oauth-client-auth",children:"Client secret authentication"}),i.jsxs("select",{id:"oauth-client-auth",value:A.confidentialMethod,onChange:F=>je({...A,confidentialMethod:F.target.value}),children:[i.jsx("option",{value:"client_secret_post",children:"client_secret_post (request body)"}),i.jsx("option",{value:"client_secret_basic",children:"client_secret_basic (HTTP Basic)"})]})]}),A.kind==="machine"&&i.jsx("p",{className:"grant-help",children:"Machine handoffs use client_secret_post to renew their access tokens."}),i.jsx("div",{style:{marginTop:24},children:D&&i.jsx(Vd,{draft:q,setDraft:F=>{H(F),Z(void 0)},catalog:D,sources:s})})]}),R&&i.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[R," ",i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:Se,children:"Retry permissions"})]}),!x&&i.jsx("p",{role:"alert",children:"Current sources are unavailable. Close this form and retry sources before registration."}),G&&i.jsxs(i.Fragment,{children:[i.jsx(Kd,{preview:G.grant}),i.jsxs("div",{"aria-live":"polite",children:[i.jsx("h3",{children:"Review connection"}),i.jsxs("dl",{className:"oauth-consent-details",children:[i.jsx("dt",{children:"Client name"}),i.jsx("dd",{children:G.name}),i.jsx("dt",{children:"Grant types"}),i.jsx("dd",{children:G.oauth.grantTypes.join(", ")}),i.jsx("dt",{children:"Authentication"}),i.jsx("dd",{children:G.oauth.tokenEndpointAuthMethod}),G.oauth.redirectUris.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("dt",{children:"Exact redirect URIs"}),i.jsx("dd",{children:G.oauth.redirectUris.map(F=>i.jsx("div",{children:i.jsx("code",{children:F})},F))})]})]})]})]}),$&&i.jsx("p",{role:"alert",style:{color:"var(--error)",margin:"16px 0"},children:$}),ne&&i.jsxs("div",{role:"status",children:[i.jsxs("p",{children:["A client named ",ne.name," is registered. Open its setup instructions and recover its existing download."]}),i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>o(ne),children:"Open existing client setup"})]}),k&&!ne&&i.jsx("p",{role:"status",children:"Registration may have completed. Close this form and refresh clients before trying again. No automatic retry was made."}),i.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"flex-end",marginTop:20},children:[i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:W,onClick:b,children:"Cancel"}),i.jsx("button",{type:"submit",className:"btn btn-primary",disabled:W||!D||!x||k,children:W?"Checking…":G?"Register with reviewed permissions":"Preview permissions"})]})]})})}function Qy({agent:s,sources:x,sourcesReady:b,onClose:o,onChanged:E,onRescoped:_}){const q=s.id||s.client_id||"",H=s.name||s.client_name||q,[A,d]=U.useState(),[D,O]=U.useState(""),[R,Q]=U.useState(0),[G,Z]=U.useState(!1),[W,ae]=U.useState(!1);return U.useEffect(()=>{if(s.auth_type!=="oauth")return;let $=!0;return O(""),be.clientDetails(q).then(le=>{$&&d(le)}).catch(le=>{$&&O(le instanceof Error?le.message:"Client details unavailable.")}),()=>{$=!1}},[q,s.auth_type,R]),i.jsxs(_n,{title:H,titleId:"client-details-title",onClose:o,drawer:!0,busy:W,children:[i.jsx("span",{className:"badge "+(s.status==="active"?"badge-success":"badge-danger"),children:s.status}),i.jsxs("dl",{className:"oauth-consent-details",style:{marginTop:16},children:[i.jsx("dt",{children:"Client ID"}),i.jsx("dd",{children:i.jsx("code",{children:q})}),i.jsx("dt",{children:"Scopes"}),i.jsx("dd",{children:s.scope||"None"}),i.jsx("dt",{children:"Registered"}),i.jsx("dd",{children:new Date(s.created_at).toLocaleString()}),i.jsx("dt",{children:"Token lifetime"}),i.jsx("dd",{children:s.token_ttl?s.token_ttl+" seconds":"Server default (future tokens)"}),A&&i.jsxs(i.Fragment,{children:[i.jsx("dt",{children:"Grant types"}),i.jsx("dd",{children:A.client.grant_types.join(", ")}),i.jsx("dt",{children:"Authentication"}),i.jsx("dd",{children:A.client.token_endpoint_auth_method})]})]}),s.auth_type==="oauth"?i.jsxs(i.Fragment,{children:[D&&i.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[D," ",i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>Q($=>$+1),children:"Retry client details"})]}),!A&&!D&&i.jsx("p",{role:"status",children:"Loading client details…"}),A&&i.jsxs(i.Fragment,{children:[i.jsx(Jd,{clientId:q,grantTypes:A.client.grant_types,revoked:s.status==="revoked",grantRevision:A.grant.revision}),s.status==="active"&&i.jsxs("details",{style:{marginTop:24},children:[i.jsx("summary",{style:{cursor:"pointer",fontWeight:600},children:"Edit access levels"}),i.jsx(Uy,{clientId:q,sources:x,sourcesReady:b,onRescoped:$=>{d(le=>le&&{...le,grant:$}),_($)}})]}),i.jsx(By,{clientId:q,name:H,revoked:s.status==="revoked",onChanged:E,onBusyChange:ae})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("h3",{className:"section-title",children:"API key"}),i.jsx("p",{children:"Use this key as a bearer token in a client that supports static authentication. Its value is available only in the original private handoff."}),s.status==="active"&&i.jsxs("div",{style:{marginTop:20},children:[G?i.jsxs(i.Fragment,{children:[i.jsxs("p",{children:["Revoke the API key ",H," (",q,")? Only this key stops working. Memory remains."]}),i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:W,onClick:()=>Z(!1),children:"Cancel"})," ",i.jsx("button",{type:"button",className:"btn btn-danger",disabled:W,onClick:()=>{ae(!0),be.revokeApiKey(q).then(E).catch($=>O($ instanceof Error?$.message:"Revoke failed. Refresh the client list before retrying.")).finally(()=>ae(!1))},children:"Confirm revoke"})]}):i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>Z(!0),children:"Revoke API key"}),D&&i.jsx("p",{role:"alert",children:D})]})]})]})}const Ly=[{id:"read",label:"Read",help:"Search and read memory."},{id:"write",label:"Write",help:"Add and edit memory."},{id:"admin",label:"Admin",help:"Brain administration operations. Grant only to fully trusted clients."}];function Zy({onClose:s,onCreated:x}){const[b,o]=U.useState(""),[E,_]=U.useState(!1),[q,H]=U.useState(""),[A,d]=U.useState(["read","write"]),D=async O=>{if(O.preventDefault(),!b.trim()){H("Enter a key name.");return}if(A.length===0){H("Choose at least one access level.");return}_(!0),H("");try{const R=await be.createApiKey(b.trim(),A);x({name:R.name,token:R.token})}catch(R){H(R instanceof Error?R.message:"Key creation failed. Inspect the clients list before retrying.")}finally{_(!1)}};return i.jsx(_n,{title:"Create API key",titleId:"create-api-key-title",onClose:s,busy:E,children:i.jsxs("form",{onSubmit:D,children:[i.jsx("p",{className:"grant-help",children:"API keys default to read and write. Admin is granted only when you check it. Choose an OAuth client for per-source or per-operation access. This key cannot log into the owner dashboard."}),i.jsx("label",{htmlFor:"api-key-name",children:"Key name"}),i.jsx("input",{id:"api-key-name","data-autofocus":!0,value:b,maxLength:128,disabled:E,onChange:O=>o(O.target.value)}),i.jsxs("fieldset",{style:{marginTop:16},children:[i.jsx("legend",{children:"Access levels"}),Ly.map(O=>i.jsxs("label",{style:{display:"block"},children:[i.jsx("input",{type:"checkbox",checked:A.includes(O.id),disabled:E,onChange:R=>d(Q=>R.target.checked?[...Q,O.id]:Q.filter(G=>G!==O.id))})," ",O.label," ",i.jsx("span",{className:"grant-help",children:O.help})]},O.id))]}),q&&i.jsx("p",{role:"alert",children:q}),i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:12,marginTop:20},children:[i.jsx("button",{type:"button",className:"btn btn-secondary",disabled:E,onClick:s,children:"Cancel"}),i.jsx("button",{type:"submit",className:"btn btn-primary",disabled:E,children:E?"Creating…":"Create key"})]})]})})}function Vy({token:s,onClose:x}){const[b,o]=U.useState(!1),[E,_]=U.useState("");return i.jsxs(_n,{title:"API key created",titleId:"api-key-created-title",onClose:x,children:[i.jsx("p",{children:s.name}),i.jsx("label",{htmlFor:"new-api-key",children:"Bearer token"}),i.jsx("textarea",{id:"new-api-key",rows:3,readOnly:!0,value:s.token}),i.jsx("p",{className:"grant-help",children:"Save this token privately now. It will not be shown again. A key’s creation does not verify your harness connection."}),i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>{navigator.clipboard.writeText(s.token).then(()=>o(!0)).catch(()=>_("Clipboard unavailable. Select and copy the token above."))},children:b?"Copied":"Copy token"}),E&&i.jsx("p",{role:"alert",children:E}),i.jsx("button",{type:"button",className:"btn btn-primary",style:{marginLeft:12},onClick:x,children:"Done"})]})}function Ky(){const[s,x]=U.useState({rows:[],total:0,page:1,pages:1}),[b,o]=U.useState(1),[E,_]=U.useState("all"),[q,H]=U.useState(null);U.useEffect(()=>{A(b)},[b,E]);const A=R=>{const Q=E!=="all"?`&agent=${encodeURIComponent(E)}`:"";be.requests(R,Q).then(x).catch(()=>{})},d=R=>{const Q=Date.now()-new Date(R).getTime();return Q<6e4?`${Math.floor(Q/1e3)}s ago`:Q<36e5?`${Math.floor(Q/6e4)} min ago`:Q<864e5?`${Math.floor(Q/36e5)}h ago`:new Date(R).toLocaleDateString()},D=R=>{if(!R)return null;const{query:Q,slug:G,partial:Z,limit:W,...ae}=R,$=[];return Q&&$.push(`"${Q}"`),G&&$.push(G),Z&&$.push(`~${Z}`),W&&$.push(`limit=${W}`),Object.keys(ae).length>0&&$.push(`+${Object.keys(ae).length} params`),$.join(" ")},O=new Map;return s.rows.forEach(R=>{R.token_name&&O.set(R.token_name,R.agent_name||R.token_name)}),i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24},children:[i.jsx("h1",{className:"page-title",style:{marginBottom:0},children:"Request Log"}),i.jsxs("select",{value:E,onChange:R=>{_(R.target.value),o(1)},style:{background:"var(--bg-secondary)",color:"var(--text-primary)",border:"1px solid var(--border)",borderRadius:6,padding:"4px 8px",fontSize:13},children:[i.jsx("option",{value:"all",children:"All agents"}),[...O.entries()].map(([R,Q])=>i.jsx("option",{value:R,children:Q},R))]})]}),s.rows.length===0?i.jsx("div",{style:{textAlign:"center",padding:48,color:"var(--text-muted)"},children:"No requests yet."}):i.jsxs(i.Fragment,{children:[i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Time"}),i.jsx("th",{children:"Agent"}),i.jsx("th",{children:"Operation"}),i.jsx("th",{children:"Params"}),i.jsx("th",{children:"Latency"}),i.jsx("th",{children:"Status"})]})}),i.jsx("tbody",{children:s.rows.map(R=>i.jsxs(Xd.Fragment,{children:[i.jsxs("tr",{onClick:()=>H(q===R.id?null:R.id),style:{cursor:"pointer"},children:[i.jsx("td",{style:{color:"var(--text-secondary)",whiteSpace:"nowrap"},children:d(R.created_at)}),i.jsx("td",{children:i.jsx("a",{style:{color:"var(--text-link, #88aaff)",cursor:"pointer",textDecoration:"none",fontWeight:500},onClick:Q=>{Q.stopPropagation(),_(R.token_name),o(1)},children:R.agent_name||R.token_name})}),i.jsx("td",{className:"mono",children:R.operation}),i.jsx("td",{style:{color:"var(--text-secondary)",fontSize:12,maxWidth:200,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:D(R.params)}),i.jsxs("td",{className:"mono",children:[R.latency_ms,"ms"]}),i.jsx("td",{children:i.jsx("span",{className:`badge badge-${R.status}`,children:R.status})})]}),q===R.id&&i.jsx("tr",{children:i.jsx("td",{colSpan:6,style:{background:"var(--bg-secondary, #0f0f1a)",padding:16},children:i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"100px 1fr",gap:"6px 12px",fontSize:13},children:[i.jsx("span",{style:{color:"var(--text-muted)"},children:"Time"}),i.jsx("span",{children:new Date(R.created_at).toLocaleString()}),i.jsx("span",{style:{color:"var(--text-muted)"},children:"Agent"}),i.jsx("span",{className:"mono",children:R.token_name}),i.jsx("span",{style:{color:"var(--text-muted)"},children:"Operation"}),i.jsx("span",{className:"mono",children:R.operation}),i.jsx("span",{style:{color:"var(--text-muted)"},children:"Latency"}),i.jsxs("span",{children:[R.latency_ms,"ms"]}),R.params&&i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{color:"var(--text-muted)"},children:"Params"}),i.jsx("pre",{className:"mono",style:{margin:0,whiteSpace:"pre-wrap",fontSize:12},children:JSON.stringify(R.params,null,2)})]}),R.error_message&&i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{color:"var(--error, #ff6b6b)"},children:"Error"}),i.jsx("span",{style:{color:"var(--error, #ff6b6b)"},children:R.error_message})]})]})})})]},R.id))})]}),i.jsxs("div",{className:"pagination",children:[i.jsxs("span",{children:["Page ",s.page," of ",s.pages," (",s.total," total)"]}),i.jsxs("div",{style:{display:"flex",gap:8},children:[i.jsx("button",{disabled:s.page<=1,onClick:()=>o(R=>R-1),children:"Previous"}),i.jsx("button",{disabled:s.page>=s.pages,onClick:()=>o(R=>R+1),children:"Next"})]})]})]})]})}function Jy({markup:s}){return i.jsx("div",{style:{width:"100%",overflow:"auto"},dangerouslySetInnerHTML:{__html:s}})}function Vu({type:s,ariaLabel:x}){const[b,o]=U.useState(""),[E,_]=U.useState("");return U.useEffect(()=>{let q=!1;return be.calibrationChart(s).then(H=>{q||o(H)}).catch(H=>{q||_(H.message??"fetch failed")}),()=>{q=!0}},[s]),E?i.jsxs("div",{style:{padding:16,color:"var(--error)"},role:"alert",children:[x,": ",E]}):b?i.jsx(Jy,{markup:b}):i.jsxs("div",{style:{padding:16,color:"var(--text-muted)"},children:[x," loading..."]})}function ky(){const[s,x]=U.useState(null),[b,o]=U.useState(!0),[E,_]=U.useState("");if(U.useEffect(()=>{be.calibrationProfile().then(A=>{x(A),o(!1)}).catch(A=>{_(A.message??"fetch failed"),o(!1)})},[]),b)return i.jsx("div",{style:{padding:24,color:"var(--text-secondary)"},children:"Loading calibration profile…"});if(E)return i.jsxs("div",{style:{padding:24,color:"var(--error)"},role:"alert",children:["Could not load calibration profile: ",E]});if(!s)return i.jsxs("div",{style:{padding:24,maxWidth:700},children:[i.jsx("h1",{style:{marginBottom:16},children:"Calibration"}),i.jsx("p",{style:{color:"var(--text-secondary)"},children:"No calibration profile yet. Builds after 5+ resolved takes."}),i.jsx("pre",{style:{background:"var(--bg-secondary)",padding:12,borderRadius:4,color:"var(--text-primary)",marginTop:12,fontFamily:"var(--font-mono)"},children:"gbrain dream --phase calibration_profile"})]});const q=new Date(s.generated_at),H=Math.floor((Date.now()-q.getTime())/(1e3*60*60*24));return i.jsxs("div",{style:{padding:32,maxWidth:720},children:[i.jsx("h1",{style:{marginBottom:8},children:"Calibration"}),i.jsxs("div",{style:{color:"var(--text-muted)",fontSize:13,marginBottom:24},children:["Holder: ",s.holder," · ","Updated ",H===0?"today":`${H}d ago`,s.published&&" · published",s.grade_completion<.9&&` · ~${Math.round(s.grade_completion*100)}% graded`,!s.voice_gate_passed&&" · voice gate fell back to template"]}),i.jsx("section",{style:{marginBottom:32},children:i.jsx(Vu,{type:"brier-trend",ariaLabel:"Brier trend"})}),i.jsxs("section",{style:{marginBottom:32},children:[i.jsx("h2",{style:{fontSize:14,color:"var(--text-secondary)",marginBottom:12,fontWeight:400},children:"Pattern statements"}),i.jsx(Vu,{type:"pattern-statements",ariaLabel:"Pattern statements"})]}),i.jsx("section",{style:{marginBottom:32},children:i.jsx(Vu,{type:"domain-bars",ariaLabel:"Per-domain accuracy"})}),i.jsx("section",{style:{marginBottom:32},children:i.jsx(Vu,{type:"abandoned-threads",ariaLabel:"Abandoned threads"})}),s.active_bias_tags.length>0&&i.jsxs("section",{style:{marginBottom:32,color:"var(--text-muted)",fontSize:13},children:["Active bias tags: ",s.active_bias_tags.join(", ")]})]})}function Wy(s){return s===0?"var(--accent-success, #2ea043)":s>=100?"var(--accent-danger, #f85149)":"var(--accent-warn, #d29922)"}function Yd(s){return`$${(s/100).toFixed(2)}`}function $y(){const[s,x]=U.useState(null),[b,o]=U.useState(null);if(U.useEffect(()=>{let _=!0,q=null;const H=async()=>{try{const A=await be.jobsWatch();_&&(x(A),o(null))}catch(A){_&&o(A instanceof Error?A.message:String(A))}_&&(q=setTimeout(H,1e3))};return H(),()=>{_=!1,q&&clearTimeout(q)}},[]),b)return i.jsxs("div",{style:{padding:24,color:"var(--accent-danger, #f85149)"},children:[i.jsx("h2",{children:"Jobs Watch — error"}),i.jsx("pre",{style:{whiteSpace:"pre-wrap"},children:b})]});if(!s)return i.jsx("div",{style:{padding:24,color:"var(--text-muted, #777)"},children:"Loading jobs watch…"});const E=new Date(s.ts_ms).toLocaleTimeString();return i.jsxs("div",{style:{padding:24,fontFamily:'var(--font-mono, "JetBrains Mono", monospace)'},children:[i.jsxs("h1",{style:{fontSize:18,marginBottom:4},children:["Jobs Watch",i.jsxs("span",{style:{marginLeft:12,color:"var(--text-muted, #777)",fontSize:12,fontWeight:"normal"},children:["updated ",E]})]}),i.jsxs("section",{style:{marginTop:24},children:[i.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Queue"}),i.jsxs("div",{children:["waiting=",i.jsx("b",{children:s.queue_health.waiting})," ","active=",i.jsx("b",{children:s.queue_health.active})," ","stalled=",i.jsx("b",{style:{color:s.queue_health.stalled>0?"var(--accent-warn, #d29922)":void 0},children:s.queue_health.stalled})]})]}),s.by_type.length>0&&i.jsxs("section",{style:{marginTop:24},children:[i.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"By type (24h)"}),i.jsxs("table",{style:{borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{color:"var(--text-muted, #777)",fontSize:12},children:[i.jsx("th",{style:{textAlign:"left",padding:"4px 12px 4px 0"},children:"name"}),i.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"total"}),i.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"done"}),i.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"fail"}),i.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"dead"})]})}),i.jsx("tbody",{children:s.by_type.slice(0,6).map(_=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"4px 12px 4px 0"},children:_.name}),i.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:_.total}),i.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:_.completed}),i.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:_.failed}),i.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:_.dead})]},_.name))})]})]}),i.jsxs("section",{style:{marginTop:24},children:[i.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Lease pressure (1h)"}),i.jsxs("div",{style:{color:Wy(s.lease_pressure_1h)},children:[s.lease_pressure_1h," bounce",s.lease_pressure_1h===1?"":"s"]})]}),s.top_errors.length>0&&i.jsxs("section",{style:{marginTop:24},children:[i.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Top errors (24h)"}),i.jsx("table",{style:{borderCollapse:"collapse"},children:i.jsx("tbody",{children:s.top_errors.slice(0,5).map(_=>i.jsxs("tr",{children:[i.jsxs("td",{style:{textAlign:"right",padding:"4px 12px 4px 0",color:"var(--text-muted, #777)"},children:[_.count,"×"]}),i.jsx("td",{style:{padding:"4px 12px 4px 0"},children:_.cluster})]},_.cluster))})})]}),s.budget_owners.length>0&&i.jsxs("section",{style:{marginTop:24},children:[i.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Budget owners"}),i.jsxs("table",{style:{borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{color:"var(--text-muted, #777)",fontSize:12},children:[i.jsx("th",{style:{textAlign:"left",padding:"4px 12px 4px 0"},children:"owner"}),i.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"spent"}),i.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"remaining"})]})}),i.jsx("tbody",{children:s.budget_owners.slice(0,5).map(_=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"4px 12px 4px 0"},children:_.owner_id}),i.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:Yd(_.total_spent_cents)}),i.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:Yd(_.remaining_cents)})]},_.owner_id))})]})]})]})}function Fy(){var H,A;const[s,x]=U.useState(),[b,o]=U.useState(""),[E,_]=U.useState(!1);U.useEffect(()=>{let d=!0;const D=Ku();if(!D){o("No pending authorization request. Restart the connection from your client.");return}return be.oauthRequest(D).then(O=>{d&&x(O)}).catch(O=>{d&&o(O.message)}),()=>{d=!1}},[]);const q=async d=>{if(!(!s||E)){_(!0),o("");try{const D=await be.decideOAuthRequest(s.id,d,s.csrf);Hd(),window.location.assign(D.redirectUrl)}catch(D){o(D instanceof Error?D.message:"Approval failed. Restart the connection from your client."),x(void 0),_(!1)}}};return i.jsxs("section",{"aria-labelledby":"consent-title",style:{maxWidth:760},children:[i.jsx("h1",{id:"consent-title",children:"Approve client access"}),i.jsx("p",{style:{color:"var(--text-secondary)",margin:"16px 0"},children:"Only approve a connection you initiated. These permissions let the client act on your brain."}),b&&i.jsx("div",{role:"alert",className:"login-error",style:{marginBottom:16},children:b}),!s&&!b&&i.jsx("p",{role:"status",children:"Loading authorization request…"}),s&&i.jsxs(i.Fragment,{children:[i.jsxs("dl",{className:"oauth-consent-details",children:[i.jsx("dt",{children:"Client"}),i.jsx("dd",{children:s.clientName}),i.jsx("dt",{children:"Client ID"}),i.jsx("dd",{children:i.jsx("code",{children:s.clientId})}),i.jsx("dt",{children:"Redirect destination"}),i.jsx("dd",{children:i.jsx("code",{children:s.redirectUri})}),i.jsx("dt",{children:"Permissions"}),i.jsx("dd",{children:s.scopes.length?s.scopes.map(d=>i.jsx("span",{className:`badge ${d.includes("admin")?"badge-error":""}`,style:{marginRight:8},children:d},d)):"No permissions"}),i.jsx("dt",{children:"Administrative brain operations"}),i.jsx("dd",{children:s.scopes.some(d=>d==="admin")?"Eligible operations within the grant below. This does not grant owner dashboard access.":s.scopes.some(d=>d.endsWith("_admin"))?"The named administrative brain operations. This does not grant owner dashboard access.":"None"}),i.jsx("dt",{children:"Allowed operations"}),i.jsx("dd",{children:s.allowedOperations===null?"All operations permitted by these scopes and the server policy":s.allowedOperations.join(", ")||"None"}),i.jsx("dt",{children:"Write paths"}),i.jsx("dd",{children:s.boundSlugPrefixes===null?"Within the granted source":s.boundSlugPrefixes.join(", ")||"None"}),s.scopes.includes("agent")&&i.jsxs(i.Fragment,{children:[i.jsx("dt",{children:"Delegated tools"}),i.jsx("dd",{children:((H=s.delegatedTools)==null?void 0:H.join(", "))||"None"}),i.jsx("dt",{children:"Delegated write paths"}),i.jsx("dd",{children:s.delegatedNamespace==="job"?"A separate namespace for each job":((A=s.delegatedSlugPrefixes)==null?void 0:A.join(", "))||"None"})]}),i.jsx("dt",{children:"Write source"}),i.jsx("dd",{children:s.sourceId??"Not configured"}),i.jsx("dt",{children:"Read sources"}),i.jsx("dd",{children:s.allowedSources.length?s.allowedSources.join(", "):s.sourceId??"Not configured"}),i.jsx("dt",{children:"Resource"}),i.jsx("dd",{children:i.jsx("code",{children:s.resource??"No resource binding requested"})}),i.jsx("dt",{children:"Request expires"}),i.jsx("dd",{children:new Date(s.expiresAt).toLocaleTimeString()})]}),i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:12,marginTop:24},children:[i.jsx("button",{className:"btn",disabled:E,onClick:()=>q("deny"),children:"Deny"}),i.jsx("button",{className:"btn btn-primary",disabled:E,onClick:()=>q("approve"),children:E?"Completing request…":"Approve access"})]})]}),b&&i.jsx("button",{className:"btn",onClick:()=>{Hd(),window.location.hash="agents"},children:"Return to agents"})]})}function Gd(){const s=window.location.hash.replace("#","")||"dashboard";return Ku()&&s==="dashboard"?"oauth-consent":["login","dashboard","agents","log","calibration","jobs","oauth-consent"].includes(s)?s:"dashboard"}function Iy(){const[s,x]=U.useState(Gd);U.useEffect(()=>{const E=()=>x(Gd());return window.addEventListener("hashchange",E),()=>window.removeEventListener("hashchange",E)},[]);const b=E=>{window.location.hash=E,x(E)};if(s==="login")return i.jsx(Cy,{onLogin:()=>b(Ku()?"oauth-consent":"dashboard")});const o=async()=>{if(confirm("Sign out every active admin session, including other browsers and tabs? Each one will need to re-authenticate via a fresh magic link.")){try{await be.signOutEverywhere()}catch{}b("login")}};return i.jsxs("div",{className:"app",children:[i.jsxs("nav",{className:"sidebar",children:[i.jsx("div",{className:"sidebar-logo",children:"GBrain"}),i.jsxs("div",{className:"sidebar-nav",children:[i.jsx("a",{className:`nav-item ${s==="dashboard"?"active":""}`,onClick:()=>b("dashboard"),children:"Dashboard"}),i.jsx("a",{className:`nav-item ${s==="agents"?"active":""}`,onClick:()=>b("agents"),children:"Agents"}),i.jsx("a",{className:`nav-item ${s==="log"?"active":""}`,onClick:()=>b("log"),children:"Request Log"}),i.jsx("a",{className:`nav-item ${s==="calibration"?"active":""}`,onClick:()=>b("calibration"),children:"Calibration"}),i.jsx("a",{className:`nav-item ${s==="jobs"?"active":""}`,onClick:()=>b("jobs"),children:"Jobs Watch"})]}),i.jsx("div",{style:{marginTop:"auto",padding:"16px 12px",borderTop:"1px solid var(--border)"},children:i.jsx("button",{onClick:o,style:{background:"transparent",border:"1px solid var(--border)",color:"var(--text-secondary)",padding:"6px 10px",borderRadius:6,fontSize:12,cursor:"pointer",width:"100%"},title:"Revoke every active admin session — every browser, every tab",children:"Sign out everywhere"})})]}),i.jsxs("main",{className:"main",children:[s==="dashboard"&&i.jsx(Dy,{}),s==="agents"&&i.jsx(wy,{}),s==="log"&&i.jsx(Ky,{}),s==="calibration"&&i.jsx(ky,{}),s==="jobs"&&i.jsx($y,{}),s==="oauth-consent"&&i.jsx(Fy,{})]})]})}zy.createRoot(document.getElementById("root")).render(i.jsx(Xd.StrictMode,{children:i.jsx(Iy,{})}));diff --git a/admin/dist/index.html b/admin/dist/index.htmlindex 28784ecfb8..23e435e3a3 100644--- a/admin/dist/index.html+++ b/admin/dist/index.html@@ -7,7 +7,7 @@<link rel="preconnect" href="https://fonts.googleapis.com" /><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /><link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />- <script type="module" crossorigin src="/admin/assets/index-BIUmQPmn.js"></script>+ <script type="module" crossorigin src="/admin/assets/index-KW-GcSja.js"></script><link rel="stylesheet" crossorigin href="/admin/assets/index-BB8hJoAN.css"></head><body>diff --git a/admin/src/api.ts b/admin/src/api.tsindex f750bf9d77..357a8ec99c 100644--- a/admin/src/api.ts+++ b/admin/src/api.ts@@ -68,11 +68,11 @@ export const api = {updateClientGrant: (clientId: string, body: Record<string, unknown>) => apiFetch('/admin/api/rescope-client', { method: 'POST', body: JSON.stringify({ ...body, clientId }) }),requests: (page = 1, qs = '') => apiFetch(`/admin/api/requests?page=${page}${qs}`),apiKeys: () => apiFetch('/admin/api/api-keys'),- createApiKey(keyName: string) {- return apiFetch('/admin/api/api-keys', { method: 'POST', body: JSON.stringify({ name: keyName }) });+ createApiKey(keyName: string, scopes: string[]) {+ return apiFetch('/admin/api/api-keys', { method: 'POST', body: JSON.stringify({ name: keyName, scopes }) });},- revokeApiKey(keyName: string) {- return apiFetch('/admin/api/api-keys/revoke', { method: 'POST', body: JSON.stringify({ name: keyName }) });+ revokeApiKey(id: string) {+ return apiFetch('/admin/api/api-keys/revoke', { method: 'POST', body: JSON.stringify({ id }) });},updateClientTtl: (clientId: string, tokenTtl: number | null) => apiFetch('/admin/api/update-client-ttl', { method: 'POST', body: JSON.stringify({ clientId, tokenTtl }) }),rescopeClient: (clientId: string, sourceId: string, federatedRead: string[]) =>diff --git a/admin/src/pages/Agents.tsx b/admin/src/pages/Agents.tsxindex 101b49e451..5568ff4513 100644--- a/admin/src/pages/Agents.tsx+++ b/admin/src/pages/Agents.tsx@@ -207,9 +207,9 @@ function AgentDrawer({ agent, sources, sourcesReady, onClose, onChanged, onResco<h3 className="section-title">API key</h3><p>Use this key as a bearer token in a client that supports static authentication. Its value is available only in the original private handoff.</p>{agent.status === 'active' && <div style={{ marginTop: 20 }}>{!confirmApiKeyRevoke ? <button type="button" className="btn btn-secondary" onClick={() => setConfirmApiKeyRevoke(true)}>Revoke API key</button> : <>- <p>Revoke all active API keys named {name}? Keys with the same name will stop working. Memory remains.</p>+ <p>Revoke the API key {name} ({clientId})? Only this key stops working. Memory remains.</p><button type="button" className="btn btn-secondary" disabled={busy} onClick={() => setConfirmApiKeyRevoke(false)}>Cancel</button>{' '}- <button type="button" className="btn btn-danger" disabled={busy} onClick={() => { setBusy(true); void api.revokeApiKey(name).then(onChanged).catch(cause => setError(cause instanceof Error ? cause.message : 'Revoke failed. Refresh the client list before retrying.')).finally(() => setBusy(false)); }}>Confirm revoke</button>+ <button type="button" className="btn btn-danger" disabled={busy} onClick={() => { setBusy(true); void api.revokeApiKey(clientId).then(onChanged).catch(cause => setError(cause instanceof Error ? cause.message : 'Revoke failed. Refresh the client list before retrying.')).finally(() => setBusy(false)); }}>Confirm revoke</button></>}{error && <p role="alert">{error}</p>}</div>}@@ -217,18 +217,32 @@ function AgentDrawer({ agent, sources, sourcesReady, onClose, onChanged, onResco</Dialog>;}+const API_KEY_SCOPES = [+ { id: 'read', label: 'Read', help: 'Search and read memory.' },+ { id: 'write', label: 'Write', help: 'Add and edit memory.' },+ { id: 'admin', label: 'Admin', help: 'Brain administration operations. Grant only to fully trusted clients.' },+] as const;+function ApiKeyCreateModal({ onClose, onCreated }: { onClose: () => void; onCreated: (result: { name: string; token: string }) => void }) {const [name, setName] = useState(''); const [busy, setBusy] = useState(false); const [error, setError] = useState('');+ const [scopes, setScopes] = useState<string[]>(['read', 'write']);const submit = async (event: FormEvent) => {event.preventDefault(); if (!name.trim()) { setError('Enter a key name.'); return; }+ if (scopes.length === 0) { setError('Choose at least one access level.'); return; }setBusy(true); setError('');- try { const result = await api.createApiKey(name.trim()); onCreated({ name: result.name, token: result.token }); }+ try { const result = await api.createApiKey(name.trim(), scopes); onCreated({ name: result.name, token: result.token }); }catch (cause) { setError(cause instanceof Error ? cause.message : 'Key creation failed. Inspect the clients list before retrying.'); }finally { setBusy(false); }};return <Dialog title="Create API key" titleId="create-api-key-title" onClose={onClose} busy={busy}><form onSubmit={submit}>- <p className="grant-help">API keys created here allow full read, write, and admin brain operations. Choose an OAuth client for scoped access. This key cannot log into the owner dashboard.</p>- <label htmlFor="api-key-name">Key name</label><input id="api-key-name" data-autofocus value={name} disabled={busy} onChange={event => setName(event.target.value)} />+ <p className="grant-help">API keys default to read and write. Admin is granted only when you check it. Choose an OAuth client for per-source or per-operation access. This key cannot log into the owner dashboard.</p>+ <label htmlFor="api-key-name">Key name</label><input id="api-key-name" data-autofocus value={name} maxLength={128} disabled={busy} onChange={event => setName(event.target.value)} />+ <fieldset style={{ marginTop: 16 }}><legend>Access levels</legend>+ {API_KEY_SCOPES.map(scope => <label key={scope.id} style={{ display: 'block' }}>+ <input type="checkbox" checked={scopes.includes(scope.id)} disabled={busy} onChange={event => setScopes(current => event.target.checked ? [...current, scope.id] : current.filter(s => s !== scope.id))} />{' '}+ {scope.label} <span className="grant-help">{scope.help}</span>+ </label>)}+ </fieldset>{error && <p role="alert">{error}</p>}<div style={{ display: 'flex', justifyContent: 'flex-end', gap: 12, marginTop: 20 }}><button type="button" className="btn btn-secondary" disabled={busy} onClick={onClose}>Cancel</button><button type="submit" className="btn btn-primary" disabled={busy}>{busy ? 'Creating…' : 'Create key'}</button></div></form></Dialog>;diff --git a/docs/architecture/key-files/security.md b/docs/architecture/key-files/security.mdindex 71b319c786..c500619ad1 100644--- a/docs/architecture/key-files/security.md+++ b/docs/architecture/key-files/security.md@@ -10,6 +10,7 @@ Current behavior and load-bearing invariants; history belongs in Git and CHANGEL- `src/core/grants/` — canonical OAuth client grant model shared by CLI, admin HTTP, provisioning, and worker admission. `model.ts` validates active sources, independent direct/delegated fences, explicit reviewed tools, namespaces, concurrency, spend, and TTL; `host`/`current` brain aliases normalize to the serving brain (`null`), while other IDs need independently verified host identity. `profiles.ts` snapshots current eligible operation names for six explicit profiles; new defaults are renewable 1 hour (static 30 days), concurrency 1, and unlimited delegated spend. `allowed_operations = NULL` preserves legacy scope-based behavior; a new profile missing its snapshot fails closed. `service.ts` locks the client, checks `grant_revision`, and commits the grant, secret-free audit, and original ceilings for pending/active legacy jobs atomically; stale edits fail, repeated repair is a no-op, and repair preserves populated limits. Issued scopes intersect live scopes on access and refresh; source/path/operation/delegation changes are live, newly added scopes require new issuance, and TTL changes do not rewrite existing expiry. `migration.ts` splits legacy fences and removes only invalid `agent` grants with repair reasons; it loads registry validation lazily only after locking existing delegated clients, so empty engine imports and cold migrations do not register unrelated background sinks. This justified engine-live import is line-marked; constraints still install when no clients exist. F3 one grant shape: `model.ts` also holds `PrincipalGrant` (`GrantSources` = `default` | `scalar` | `federated` | `none`), `grantFromTokenRow` (unmigrated `source_grant IS NULL` rows read through lane F's JSONB parsers; unified rows read the `access_tokens` grant columns and any axis whose `permissions` mirror disagrees evaluates deny-all and is listed in `drift`), `authSourcesFromGrant` (the AuthInfo source fields every token reader uses: both HTTP transports, publication `authority.ts`, job admission, shared-skill membership and policy), `grantFromClient`, `validatePrincipalGrant` (tokens may hold `none`; clients refuse it with `client_sources_none_unsupported`) and `permissionsMirror`. `access-token-schema.ts` is the column fragment (migration `f3_access_token_grants`). `legacy-token.ts` is the token grant editor behind `gbrain auth rescope --token` (aliases `rescope-token`, `permissions set-takes-holders`): one `FOR UPDATE` transaction that writes the columns, bumps `grant_revision` (`--if-version` compare-and-set) and rewrites `permissions` as a mirror with every other key preserved; `none` = explicit empty list; refresh previews and widens only by named operations; a drifted token refuses edits until `--adopt-permissions` or `--adopt-columns`; `migrateLegacyTokens` (`--migrate-legacy`) writes the columns for every unmigrated token without changing a grant and skips malformed JSONB; `resolveRescopeTarget` refuses a bare name that matches a token and a client. `cli.ts` splits `auth rescope` targets and maps the unified client flags onto `auth rescope-client`'s patch. An explicit empty `permissions.source_id` decodes (`parseLegacyTokenScope` in `src/core/legacy-token-scope.ts`) to the `NO_SOURCES` sentinel, which `sourceScopeOpts`, the dispatch fence (`enforceBoundClientOpAllowList`, `fence=no_source_grant`), `submissionAuthority` and `POST /ingest` refuse and publication reauthorization rejects; it never regains the `default` floor. `schema.ts` supplies migration147/bootstrap columns and invariants for both engines. SQL JSON passes through `text::jsonb` for driver parity. Tests: `test/client-grants.test.ts`, OAuth compatibility suites, and `test/e2e/client-grants.test.ts` (Postgres CAS, job ceilings, and actual HTTP preview/edit).- `src/core/grants/lifecycle.ts` + `src/commands/serve-http-clients.ts` — owner-authenticated client inspection, setup, export and lifecycle endpoints. Token invalidation/revoke/delete lock the OAuth client row, require reviewed revisions and explicit application, and commit an audit record atomically. Deletion records a tombstone while preserving request history and spending reservations/settlement; missing clients become terminal delegated denials while transient lookup failures remain retryable.+- `src/commands/serve-http-api-keys.ts` — owner-dashboard legacy API keys (`/admin/api/api-keys`). Mint validates the request (`parseApiKeyMintRequest`: name 1-128 printable characters, registered scopes, active source ids, holder grammar) and goes through `mintLegacyToken`, so keys are born on the unified grant columns; omitted fields take the `gbrain auth create` defaults (scopes `read,write`, never `admin` unless listed; no source grant; holders `['world']`), reported in `defaults_applied` beside the effective grant. Refusals are `invalid_params` agent envelopes with `why` and a `fix`; nothing is minted. The token appears only in the mint response, never in logs or SSE. The list returns ids, scopes, sources and holders through `grantFromTokenRow`; revoke takes the row id (`revokeLegacyTokenById`) and refuses a name. Pinned by `test/serve-http-api-keys.test.ts`.- `src/core/guarded-http.ts` + `src/core/ssrf-validate.ts` — DNS answer classification, validated-address connections with original TLS/HTTP hostname and port, shared deadline/redirect policy, header-only probes, and bounded gzip/deflate/Brotli decoding. Ambient proxies fail closed with restart guidance. Consumers: URL reachability, remote images, and HTTP integration checks. Real TLS fixtures run on Bun 1.4.0 and 1.4.2.diff --git a/docs/mcp/ADMIN.md b/docs/mcp/ADMIN.mdindex 51c2a968c0..acd31d9b7c 100644--- a/docs/mcp/ADMIN.md+++ b/docs/mcp/ADMIN.md@@ -220,6 +220,54 @@ requests. Added scopes require a fresh token; refresh cannot widen the originaltoken's scope ceiling. Native OAuth clients must reconnect and obtain freshowner approval. TTL changes affect future tokens only.+## Dashboard API keys++**Say to your agent:** *"Make a read-only API key for my notes app."* The+agent mints it from the dashboard's **+ API Key** form or runs+`gbrain auth create notes-app --scopes read` on the brain host.++The dashboard form and `POST /admin/api/api-keys` mint a legacy bearer token+with the same grant shape as `gbrain auth create`. The request body takes:++| Field | Default when omitted | Accepted values |+| --- | --- | --- |+| `name` | required | 1-128 printable characters; names need not be unique |+| `scopes` | `read,write` | a non-empty list of registered scopes; `admin` only when listed |+| `sources` | no source grant (the `auth create` default) | active source ids; the first is the write source |+| `takes_holders` | `world` | `world`, `brain`, `people/<slug>`, `companies/<slug>` or a bare slug |++The response carries the token once, the key `id`, the effective grant+(`scopes_applied`, `sources_applied`, `takes_holders_applied`) and+`defaults_applied`, the fields that took their defaults. An unknown scope,+source or holder, or a bad name, refuses with `invalid_params` and mints+nothing; the message lists the valid values. The plaintext token is never+written to request logs or the live activity feed.++```bash+curl -s -X POST "$BRAIN/admin/api/api-keys" -H 'content-type: application/json' \+ --cookie "$ADMIN_COOKIE" -d '{"name":"notes-app","scopes":["read"]}'+# the gbrain auth create equivalent on the brain host:+gbrain auth create notes-app --scopes read --takes-holders world+```++`GET /admin/api/api-keys` lists every key with its `id`, `status`, `scopes`,+`sources` and `takes_holders`. `POST /admin/api/api-keys/revoke` takes+`{"id": "<key id>"}` and revokes exactly that key; a same-name sibling keeps+working. The CLI equivalent is `gbrain auth revoke --id <id>`.++### Tokens without scopes++A token minted without scopes (every dashboard key before scopes were+required, and `gbrain auth create` without `--scopes`) holds full read, write+and admin access. `gbrain doctor` warns `legacy_token_null_scope` with the+count and, per token, the command that narrows it+(`details.tokens: [{id, name, argv}]`). Narrowing removes admin operations from+that key, so ask the user first:++```bash+gbrain auth rescope --id TOKEN_ID --scopes read,write+```+## Legacy token grants**Say to your agent:** *"Let the hosted token read the workspace source too."*diff --git a/src/admin-embedded.ts b/src/admin-embedded.tsindex 2ad718cee1..ce4729c06e 100644--- a/src/admin-embedded.ts+++ b/src/admin-embedded.ts@@ -1,6 +1,6 @@// AUTO-GENERATED — do not edit by hand.// Run `bun run scripts/build-admin-embedded.ts` to regenerate.-// Source: admin/dist/ at 2026-09-24.+// Source: admin/dist/ at 2026-10-04.//// Bun resolves the file: imports to a path that works at runtime even// inside a compiled binary (`bun build --compile`). The manifest maps@@ -9,7 +9,7 @@// @ts-ignore — type: 'file' is Bun ESM, not in lib.d.tsimport A_0_assets_index_BB8hJoAN_css from '../admin/dist/assets/index-BB8hJoAN.css' with { type: 'file' };// @ts-ignore — type: 'file' is Bun ESM, not in lib.d.ts-import A_1_assets_index_BIUmQPmn_js from '../admin/dist/assets/index-BIUmQPmn.js' with { type: 'file' };+import A_1_assets_index_KW_GcSja_js from '../admin/dist/assets/index-KW-GcSja.js' with { type: 'file' };// @ts-ignore — type: 'file' is Bun ESM, not in lib.d.tsimport A_2_index_html from '../admin/dist/index.html' with { type: 'file' };@@ -20,7 +20,7 @@ export interface AdminAsset {export const ADMIN_ASSETS: Record<string, AdminAsset> = {"/admin/assets/index-BB8hJoAN.css": { path: A_0_assets_index_BB8hJoAN_css as unknown as string, mime: "text/css; charset=utf-8" },- "/admin/assets/index-BIUmQPmn.js": { path: A_1_assets_index_BIUmQPmn_js as unknown as string, mime: "application/javascript; charset=utf-8" },+ "/admin/assets/index-KW-GcSja.js": { path: A_1_assets_index_KW_GcSja_js as unknown as string, mime: "application/javascript; charset=utf-8" },"/admin/index.html": { path: A_2_index_html as unknown as string, mime: "text/html; charset=utf-8" },};diff --git a/src/commands/doctor/checks/legacy-token-grants.ts b/src/commands/doctor/checks/legacy-token-grants.tsindex a2bcc8ab06..99f64d1793 100644--- a/src/commands/doctor/checks/legacy-token-grants.ts+++ b/src/commands/doctor/checks/legacy-token-grants.ts@@ -9,12 +9,20 @@* `legacy_token_grant_drift` (warn): migrated tokens whose `permissions`* mirror disagrees with the grant columns (an older gbrain edited the JSONB).* Each drifted axis denies every request until the operator picks a side.+ *+ * `legacy_token_null_scope` (warn): active tokens minted without scopes+ * (`scopes IS NULL`), which grandfather to read+write+admin. Each token gets+ * its own `gbrain auth rescope --id <id> --scopes read,write` command; the+ * check's `fix` asks the user before narrowing the first one.*/+import type { Action } from '../../../core/agent-output.ts';import { grantFromTokenRow, type LegacyGrantAxis } from '../../../core/grants/model.ts';import type { Check } from '../../doctor.ts';+import { doctorVerify } from '../check-fix.ts';import { connectedEngine, type DoctorContext, type DoctorEntry } from '../context.ts';const DOCS = 'docs/mcp/ADMIN.md#legacy-token-grants';+const NULL_SCOPE_DOCS = 'docs/mcp/ADMIN.md#tokens-without-scopes';async function runLegacyTokenGrants(ctx: DoctorContext): Promise<Check[]> {const checks: Check[] = [];@@ -22,9 +30,11 @@ async function runLegacyTokenGrants(ctx: DoctorContext): Promise<Check[]> {'SELECT * FROM access_tokens WHERE revoked_at IS NULL ORDER BY created_at, id');const legacy: Array<{ name: string; id: string; malformed: boolean }> = [];const drift: Array<{ name: string; id: string; axes: LegacyGrantAxis[] }> = [];+ const nullScope: Array<{ name: string; id: string; argv: string[] }> = [];for (const row of rows) {const grant = grantFromTokenRow(row);const entry = { name: String(row.name), id: String(row.id) };+ if (row.scopes == null) nullScope.push({ ...entry, argv: ['gbrain', 'auth', 'rescope', '--id', entry.id, '--scopes', 'read,write'] });if (grant.shape === 'legacy_permissions') legacy.push({ ...entry, malformed: grant.permissionsMalformed });if (grant.drift.length) drift.push({ ...entry, axes: grant.drift });}@@ -51,11 +61,30 @@ async function runLegacyTokenGrants(ctx: DoctorContext): Promise<Check[]> {+ `${drift.length > 5 ? `; and ${drift.length - 5} more in details.drift` : ''}. See ${DOCS}.`,details: { drift, docs: DOCS },});+ const first = nullScope[0];+ const fix: Action | undefined = first && {+ argv: first.argv, consent: ['credentials'], actor: 'agent', requires_exclusive: false, docs: NULL_SCOPE_DOCS, verify: doctorVerify('legacy_token_null_scope'),+ why: 'A token minted without scopes is grandfathered to read+write+admin; narrowing it to read,write removes admin operations from that key.',+ user_message: `${nullScope.length} API key(s) have full read, write and admin access because they were created without scopes`+ + ` (first: ${first.name}). Narrow each to read and write? A client that needs admin operations would lose them.`,+ };+ checks.push({+ name: 'legacy_token_null_scope',+ status: nullScope.length ? 'warn' : 'ok',+ message: nullScope.length === 0+ ? 'Every active legacy token has explicit scopes.'+ : `${nullScope.length} active legacy token(s) have no scopes, so they hold full read+write+admin access (grandfathered). `+ + 'Ask the user, then narrow each: '+ + nullScope.slice(0, 5).map(t => `${t.name}: ${t.argv.join(' ')}`).join('; ')+ + `${nullScope.length > 5 ? `; and ${nullScope.length - 5} more in details.tokens` : ''}. See ${NULL_SCOPE_DOCS}.`,+ details: { null_scope_count: nullScope.length, tokens: nullScope, docs: NULL_SCOPE_DOCS },+ ...(fix ? { fix } : {}),+ });return checks;}export const legacyTokenGrantsEntry: DoctorEntry = {name: 'legacy_token_grant_shape',- emits: ['legacy_token_grant_shape', 'legacy_token_grant_drift'],+ emits: ['legacy_token_grant_shape', 'legacy_token_grant_drift', 'legacy_token_null_scope'],run: runLegacyTokenGrants,};diff --git a/src/commands/serve-http-admin-api.ts b/src/commands/serve-http-admin-api.tsindex cc2b122bfe..87e05530af 100644--- a/src/commands/serve-http-admin-api.ts+++ b/src/commands/serve-http-admin-api.ts@@ -13,6 +13,7 @@ import { rescopeClientGrant } from '../core/grants/service.ts';import { resolveOwnerHolder } from '../core/owner-holder.ts';import { sqlQueryForEngine } from '../core/sql-query.ts';import { VERSION } from '../version.ts';+import { mountAdminApiKeys } from './serve-http-api-keys.ts';import { mountAdminClients } from './serve-http-clients.ts';import { mountAdminRegistration } from './serve-http-registration.ts';import { parseAdminGrantRequest, grantHttpStatus, GRANT_TOKEN_IMPLICATIONS, mountAdminGrantDiscovery, mountAdminGrantEdits } from './serve-http-grants.ts';@@ -575,45 +576,7 @@ function mountAdminKeyApi(app: Express, ctx: ServeHttpContext): void {}});- // Legacy API keys (access_tokens table)- app.get('/admin/api/api-keys', requireAdmin, async (_req: Request, res: Response) => {- try {- const keys = await sql`- SELECT id, name, created_at, last_used_at,- CASE WHEN revoked_at IS NOT NULL THEN 'revoked' ELSE 'active' END as status- FROM access_tokens ORDER BY created_at DESC- `;- res.json(keys);- } catch (e) {- res.status(503).json({ error: 'service_unavailable' });- }- });-- app.post('/admin/api/api-keys', requireAdmin, express.json(), async (req: Request, res: Response) => {- try {- const { name } = req.body;- if (!name) { res.status(400).json({ error: 'Name required' }); return; }- const { generateToken, hashToken } = await import('../core/utils.ts');- const token = generateToken('gbrain_');- const hash = hashToken(token);- const id = (await import('crypto')).randomUUID();- await sql`INSERT INTO access_tokens (id, name, token_hash) VALUES (${id}, ${name}, ${hash})`;- res.json({ name, token, id });- } catch (e) {- res.status(500).json({ error: e instanceof Error ? e.message : 'Failed to create API key' });- }- });-- app.post('/admin/api/api-keys/revoke', requireAdmin, express.json(), async (req: Request, res: Response) => {- try {- const { name } = req.body;- if (!name) { res.status(400).json({ error: 'Name required' }); return; }- await sql`UPDATE access_tokens SET revoked_at = now() WHERE name = ${name} AND revoked_at IS NULL`;- res.json({ revoked: true });- } catch (e) {- res.status(500).json({ error: e instanceof Error ? e.message : 'Revoke failed' });- }- });+ mountAdminApiKeys(app, requireAdmin, engine);}function mountAdminClientApi(app: Express, ctx: ServeHttpContext): void {diff --git a/src/commands/serve-http-api-keys.ts b/src/commands/serve-http-api-keys.tsnew file mode 100644index 0000000000..b11649d540--- /dev/null+++ b/src/commands/serve-http-api-keys.ts@@ -0,0 +1,169 @@+/**+ * Owner-dashboard legacy API keys for `gbrain serve --http`+ * (`/admin/api/api-keys`): list, mint and revoke.+ *+ * Mint goes through `mintLegacyToken` (the same grant shape as+ * `gbrain auth create`): scopes default to `read,write` and `admin` is minted+ * only when requested; sources are checked against active source ids; takes+ * holders against the holder grammar. The response reports the effective+ * grant and which defaults applied. The plaintext token appears only in the+ * mint response body: nothing here logs it or broadcasts it over SSE.+ * Revoke is by row id (names are not unique).+ */+import express, { type Express, type Request, type RequestHandler, type Response } from 'express';+import type { BrainEngine } from '../core/engine.ts';+import { cliRenderContext, toAgentError, type Action } from '../core/agent-output.ts';+import { grantFromTokenRow } from '../core/grants/model.ts';+import { opError } from '../core/ops/contract.ts';+import { sqlQueryForEngine } from '../core/sql-query.ts';+import { ALLOWED_SCOPES_LIST, isScope } from '../core/scope.ts';+import { isValidSourceId } from '../core/source-id.ts';+import { isValidHolder } from '../core/takes-fence.ts';+import { mintLegacyToken, revokeLegacyTokenById, TOKEN_ID_RE } from '../core/token-mint.ts';++export const API_KEY_NAME_MAX = 128;+export const API_KEY_DEFAULT_SCOPES: readonly string[] = ['read', 'write'];+export const API_KEY_DEFAULT_TAKES_HOLDERS: readonly string[] = ['world'];+const DOCS = 'docs/mcp/ADMIN.md#dashboard-api-keys';++export interface ApiKeyMintRequest {+ name: string;+ scopes: string[];+ /** undefined = no source grant (the `gbrain auth create` default). */+ sources?: string[];+ takesHolders: string[];+ defaultsApplied: Array<'scopes' | 'sources' | 'takes_holders'>;+}++function listParam(value: unknown): string[] | undefined | null {+ if (value === undefined || value === null) return undefined;+ if (typeof value === 'string') return [...new Set(value.split(/[\s,]+/).filter(Boolean))];+ if (Array.isArray(value) && value.every(v => typeof v === 'string')) return [...new Set(value.map(v => v.trim()).filter(Boolean))];+ return null;+}++const listAction = (why: string): Action => ({ argv: ['gbrain', 'auth', 'list'], consent: [], actor: 'host_admin', why, requires_exclusive: false, docs: DOCS });++function invalid(message: string, suggestion: string, why: string, fix: Action) {+ return opError('invalid_params', message, suggestion, { why, fix, docs: DOCS, reason: 'api_key_request_invalid' });+}++/** Validate a dashboard mint request and apply the `gbrain auth create` defaults; throws `invalid_params`. */+export async function parseApiKeyMintRequest(engine: BrainEngine, body: unknown): Promise<ApiKeyMintRequest> {+ const raw = (body && typeof body === 'object' ? body : {}) as Record<string, unknown>;+ const name = typeof raw.name === 'string' ? raw.name.trim() : '';+ const createFix = (args: string[], why: string): Action => ({+ argv: ['gbrain', 'auth', 'create', name || 'api-key', ...args], consent: ['credentials'], actor: 'host_admin', why,+ verify: { argv: ['gbrain', 'auth', 'list'] }, requires_exclusive: false, docs: DOCS,+ });+ if (!name || name.length > API_KEY_NAME_MAX || /[\u0000-\u001f\u007f]/.test(name)) {+ throw invalid(`API key name must be 1-${API_KEY_NAME_MAX} printable characters.`,+ `Resubmit with a short printable name (at most ${API_KEY_NAME_MAX} characters).`,+ 'The name labels the key in the dashboard, request logs and gbrain auth list.',+ listAction('Lists existing key names so the new one can be told apart.'));+ }+ const defaultsApplied: ApiKeyMintRequest['defaultsApplied'] = [];+ const scopesParam = listParam(raw.scopes);+ const valid = ALLOWED_SCOPES_LIST.join(', ');+ if (scopesParam === null || (scopesParam !== undefined && scopesParam.length === 0)) {+ throw invalid(`scopes must be a non-empty list of: ${valid}.`, `Resubmit with scopes from: ${valid} (omit scopes for read,write).`,+ 'An empty or non-list scope grant would mint a key that can do nothing.', createFix(['--scopes', 'read,write'], 'Mints the same key with the default read,write scopes.'));+ }+ const unknown = (scopesParam ?? []).filter(s => !isScope(s));+ if (unknown.length) {+ throw invalid(`Unknown scope ${unknown.map(s => JSON.stringify(s)).join(', ')}. Valid scopes: ${valid}.`,+ `Resubmit with scopes from: ${valid}.`, 'A misspelled scope is refused at mint time so it never mints a key with a different grant than asked.',+ createFix(['--scopes', 'read,write'], 'Mints the same key with the default read,write scopes.'));+ }+ const scopes = scopesParam ?? (defaultsApplied.push('scopes'), [...API_KEY_DEFAULT_SCOPES]);++ const sourcesParam = listParam(raw.sources);+ if (sourcesParam === null || (sourcesParam !== undefined && (sourcesParam.length === 0 || sourcesParam.some(id => !isValidSourceId(id))))) {+ throw invalid('sources must be a non-empty list of source ids (omit it for the default grant).',+ 'Resubmit with source ids from gbrain sources list, or omit sources.', 'Each source id names a repository in this brain; the first one is the write source.',+ { argv: ['gbrain', 'sources', 'list'], consent: [], actor: 'host_admin', why: 'Lists the source ids this brain serves.', requires_exclusive: false, docs: DOCS });+ }+ if (sourcesParam) {+ const rows = await engine.executeRaw<{ id: string }>('SELECT id FROM sources WHERE id = ANY($1::text[]) AND archived IS NOT TRUE', [sourcesParam]);+ const active = new Set(rows.map(r => r.id));+ const missing = sourcesParam.filter(id => !active.has(id));+ if (missing.length) {+ throw invalid(`Unknown or archived source: ${missing.join(', ')}.`, 'Resubmit with active source ids from gbrain sources list.',+ 'A key can only be granted sources this brain serves.',+ { argv: ['gbrain', 'sources', 'list'], consent: [], actor: 'host_admin', why: 'Lists the active source ids.', requires_exclusive: false, docs: DOCS });+ }+ } else defaultsApplied.push('sources');++ const holdersParam = listParam(raw.takes_holders);+ if (holdersParam === null || (holdersParam !== undefined && (holdersParam.length === 0 || holdersParam.some(h => !isValidHolder(h))))) {+ throw invalid('takes_holders must be a non-empty list of holders: world, brain, people/<slug>, companies/<slug> or a bare slug.',+ 'Resubmit with valid takes holders, or omit takes_holders for the default world.', 'Takes holders decide whose private takes the key can read.',+ createFix(['--takes-holders', 'world'], 'Mints the same key with the default world takes holder.'));+ }+ const takesHolders = holdersParam ?? (defaultsApplied.push('takes_holders'), [...API_KEY_DEFAULT_TAKES_HOLDERS]);+ return { name, scopes, ...(sourcesParam ? { sources: sourcesParam } : {}), takesHolders, defaultsApplied };+}++function grantView(row: Record<string, unknown>) {+ const grant = grantFromTokenRow(row);+ const s = grant.sources;+ return {+ scopes: grant.scopes,+ scopes_grandfathered: row.scopes == null,+ sources: s.kind === 'default' ? 'default' : s.kind === 'none' ? [] : s.kind === 'scalar' ? [s.writeSource] : [...s.readSources],+ takes_holders: grant.takesHolders ?? ['world'],+ };+}++const sendError = (res: Response, status: number, e: unknown) =>+ res.status(status).json(toAgentError(e, { transport: 'http', command: 'admin api-keys', render: cliRenderContext({ transport: 'http' }) }));++export function mountAdminApiKeys(app: Express, requireAdmin: RequestHandler, engine: BrainEngine): void {+ app.get('/admin/api/api-keys', requireAdmin, async (_req: Request, res: Response) => {+ try {+ const rows = await engine.executeRaw<Record<string, unknown>>('SELECT * FROM access_tokens ORDER BY created_at DESC, id');+ res.json(rows.map(row => ({+ id: String(row.id), name: row.name, created_at: row.created_at, last_used_at: row.last_used_at,+ status: row.revoked_at != null ? 'revoked' : 'active', ...grantView(row),+ })));+ } catch {+ res.status(503).json({ error: 'service_unavailable' });+ }+ });++ app.post('/admin/api/api-keys', requireAdmin, express.json(), async (req: Request, res: Response) => {+ let request: ApiKeyMintRequest;+ try {+ request = await parseApiKeyMintRequest(engine, req.body);+ } catch (e) {+ sendError(res, 400, e);+ return;+ }+ try {+ const minted = await mintLegacyToken(engine, { name: request.name, scopes: request.scopes, takesHolders: request.takesHolders, ...(request.sources ? { sourceGrant: request.sources } : {}) });+ res.json({+ id: minted.id, name: minted.name, token: minted.token,+ scopes_applied: request.scopes,+ sources_applied: request.sources ?? 'default',+ takes_holders_applied: request.takesHolders,+ defaults_applied: request.defaultsApplied,+ });+ } catch {+ res.status(500).json({ error: 'api_key_mint_failed', message: 'API key creation failed. Inspect the key list before retrying.' });+ }+ });++ app.post('/admin/api/api-keys/revoke', requireAdmin, express.json(), async (req: Request, res: Response) => {+ const id = typeof req.body?.id === 'string' ? req.body.id : '';+ if (!TOKEN_ID_RE.test(id)) {+ sendError(res, 400, invalid('Revoke takes the key id (a UUID from the key list), not its name.', 'Resubmit with the id field from GET /admin/api/api-keys.',+ 'Key names are not unique; revoking by name could cut off other keys that share it.', listAction('Lists every key with its id.')));+ return;+ }+ try {+ res.json({ id, revoked: await revokeLegacyTokenById(sqlQueryForEngine(engine), id) });+ } catch {+ res.status(500).json({ error: 'api_key_revoke_failed', message: 'Revoke failed. Refresh the key list before retrying.' });+ }+ });+}diff --git a/src/core/doctor-categories.ts b/src/core/doctor-categories.tsindex a3d3ec27b3..926b733e00 100644--- a/src/core/doctor-categories.ts+++ b/src/core/doctor-categories.ts@@ -253,6 +253,8 @@ export const OPS_CHECK_NAMES: ReadonlySet<string> = new Set([// F3: legacy tokens on the JSONB-only grant shape (info) and grant drift (warn).'legacy_token_grant_shape','legacy_token_grant_drift',+ // Lane E: tokens minted without scopes (grandfathered read+write+admin).+ 'legacy_token_null_scope','reranker_health','rls','rls_event_trigger',diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.jsonindex 22c4a12451..51c163a8b8 100644--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json@@ -1115,6 +1115,17 @@"name": "legacy_token_grant_drift","status": "ok"},+ {+ "category": "ops",+ "details": {+ "docs": "docs/mcp/ADMIN.md#legacy-token-grants",+ "null_scope_count": 0,+ "tokens": []+ },+ "message": "Every active legacy token has explicit scopes.",+ "name": "legacy_token_null_scope",+ "status": "ok"+ },{"category": "brain","message": "No image assets indexed yet",diff --git a/test/fixtures/goldens/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.jsonindex 153d996111..38e1bf0ad0 100644--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json@@ -1203,6 +1203,17 @@"name": "legacy_token_grant_drift","status": "ok"},+ {+ "category": "ops",+ "details": {+ "docs": "docs/mcp/ADMIN.md#legacy-token-grants",+ "null_scope_count": 0,+ "tokens": []+ },+ "message": "Every active legacy token has explicit scopes.",+ "name": "legacy_token_null_scope",+ "status": "ok"+ },{"category": "brain","message": "No image assets indexed yet",diff --git a/test/fixtures/goldens/doctor/registry-build-checks.json b/test/fixtures/goldens/doctor/registry-build-checks.jsonindex ff1428fea1..f1bdc109d8 100644--- a/test/fixtures/goldens/doctor/registry-build-checks.json+++ b/test/fixtures/goldens/doctor/registry-build-checks.json@@ -549,6 +549,10 @@"category": "ops","name": "legacy_token_grant_drift"},+ {+ "category": "ops",+ "name": "legacy_token_null_scope"+ },{"category": "ops","name": "index_audit"diff --git a/test/serve-http-api-keys.test.ts b/test/serve-http-api-keys.test.tsnew file mode 100644index 0000000000..ae407c72a9--- /dev/null+++ b/test/serve-http-api-keys.test.ts@@ -0,0 +1,166 @@+/**+ * Owner-dashboard API keys (`/admin/api/api-keys`, Lane E P0).+ *+ * Protects: a dashboard mint goes through mintLegacyToken with explicit scopes+ * (default read,write; admin only on request) and the unified grant columns;+ * the minted key is refused an op outside its scopes on the real /mcp path;+ * unknown scopes, sources and holders are refused with invalid_params naming+ * the valid values; the response reports the defaults it applied; revoke is+ * by id and leaves a same-name sibling active; the list returns ids and+ * scopes; doctor counts NULL-scope (grandfathered full-access) tokens with a+ * per-token rescope command.+ */+import { afterAll, beforeAll, describe, expect, test } from 'bun:test';+import express from 'express';+import type { Server } from 'node:http';+import { PGLiteEngine } from '../src/core/pglite-engine.ts';+import { mountAdminApiKeys } from '../src/commands/serve-http-api-keys.ts';+import { legacyTokenGrantsEntry } from '../src/commands/doctor/checks/legacy-token-grants.ts';+import type { DoctorContext } from '../src/commands/doctor/context.ts';+import { startHttpTransport } from '../src/mcp/http-transport.ts';+import { RateLimiter } from '../src/mcp/rate-limit.ts';+import { disposePersistenceConsumer } from '../src/core/persistence/service.ts';+import { generateToken, hashToken } from '../src/core/utils.ts';++let engine: PGLiteEngine;+let server: Server;+let base: string;++beforeAll(async () => {+ engine = new PGLiteEngine();+ await engine.connect({});+ await engine.initSchema();+ await engine.executeRaw("INSERT INTO sources(id,name) VALUES('team-a','team-a') ON CONFLICT DO NOTHING");+ await engine.putPage('notes/keys', { type: 'note', title: 'Keys', compiled_truth: 'api-key-marker prose', timeline: '', frontmatter: {} }, { sourceId: 'default' });+ const app = express();+ mountAdminApiKeys(app, (_req, _res, next) => next(), engine);+ server = app.listen(0, '127.0.0.1');+ base = `http://127.0.0.1:${(server.address() as { port: number }).port}`;+}, 120_000);++afterAll(async () => {+ server.closeAllConnections();+ await new Promise<void>(r => server.close(() => r()));+ await disposePersistenceConsumer(engine);+ await engine.disconnect();+});++const post = async (path: string, body: unknown) => {+ const res = await fetch(`${base}${path}`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) });+ return { status: res.status, body: await res.json() as any };+};+const rowOf = async (id: string) => (await engine.executeRaw<Record<string, unknown>>('SELECT * FROM access_tokens WHERE id = $1::uuid', [id]))[0];++async function doctor() {+ const checks = await legacyTokenGrantsEntry.run({ engine } as unknown as DoctorContext);+ if (!Array.isArray(checks)) throw new Error('doctor entry stopped');+ return Object.fromEntries(checks.map(c => [c.name, c]));+}++async function callMcp(token: string, name: string, args: Record<string, unknown>) {+ const mcp = await startHttpTransport({ port: 0, engine, surface: 'full', limiters: {+ ip: new RateLimiter({ limit: 10_000, windowMs: 60_000, lruCap: 100 }), token: new RateLimiter({ limit: 10_000, windowMs: 60_000, lruCap: 100 }) } });+ try {+ const response = await fetch(`http://127.0.0.1:${mcp.port}/mcp`, { method: 'POST',+ headers: { authorization: `Bearer ${token}`, 'content-type': 'application/json', accept: 'application/json, text/event-stream' },+ body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'tools/call', params: { name, arguments: args } }) });+ const body = await response.json() as { result: { isError?: boolean; content: Array<{ text: string }> } };+ return body.result;+ } finally { mcp.stop?.(true); }+}++describe('dashboard mint', () => {+ test('defaults to read,write (never admin), lands on the unified columns and reports the defaults it applied', async () => {+ const { status, body } = await post('/admin/api/api-keys', { name: 'dash-default' });+ expect(status).toBe(200);+ expect(body).toMatchObject({ name: 'dash-default', scopes_applied: ['read', 'write'], sources_applied: 'default',+ takes_holders_applied: ['world'], defaults_applied: ['scopes', 'sources', 'takes_holders'] });+ expect(body.token).toStartWith('gbrain_');+ const row = await rowOf(body.id);+ expect(row.scopes).toEqual(['read', 'write']);+ expect(row).toMatchObject({ source_grant: 'default', takes_holders: ['world'], grant_revision: 1 });+ });++ test('a dashboard-minted key carries the requested scopes and is refused an op outside them', async () => {+ const { body } = await post('/admin/api/api-keys', { name: 'dash-reader', scopes: ['read'] });+ expect(body.scopes_applied).toEqual(['read']);+ expect(body.defaults_applied).toEqual(['sources', 'takes_holders']);+ const read = await callMcp(body.token, 'get_page', { slug: 'notes/keys' });+ expect(read.isError).toBeFalsy();+ for (const [op, args] of [['put_page', { slug: 'notes/keys-2', content: 'x' }], ['get_stats', {}]] as const) {+ const denied = await callMcp(body.token, op, { ...args });+ expect(denied.isError).toBe(true);+ expect(JSON.parse(denied.content[0].text)).toMatchObject({ code: 'insufficient_scope' });+ }+ }, 120_000);++ test('admin is minted only when requested explicitly', async () => {+ const { body } = await post('/admin/api/api-keys', { name: 'dash-admin', scopes: ['read', 'write', 'admin'] });+ expect(body.scopes_applied).toEqual(['read', 'write', 'admin']);+ expect((await rowOf(body.id)).scopes).toEqual(['read', 'write', 'admin']);+ });++ test('sources and takes holders are validated and stored', async () => {+ const { status, body } = await post('/admin/api/api-keys', { name: 'dash-team', sources: ['team-a', 'default'], takes_holders: ['world', 'people/alice-example'] });+ expect(status).toBe(200);+ expect(body).toMatchObject({ sources_applied: ['team-a', 'default'], takes_holders_applied: ['world', 'people/alice-example'], defaults_applied: ['scopes'] });+ expect(await rowOf(body.id)).toMatchObject({ source_grant: 'federated', source_id: 'team-a', federated_read: ['team-a', 'default'], takes_holders: ['world', 'people/alice-example'] });+ });++ test('refuses unknown scopes, sources, holders and bad names with invalid_params and a fix', async () => {+ const before = (await engine.executeRaw<{ n: number }>('SELECT count(*)::int AS n FROM access_tokens'))[0].n;+ const scope = await post('/admin/api/api-keys', { name: 'dash-typo', scopes: ['read', 'wrtie'] });+ expect(scope.status).toBe(400);+ expect(scope.body).toMatchObject({ code: 'invalid_params', reason: 'api_key_request_invalid', contract_version: 1 });+ expect(scope.body.message).toContain('"wrtie"');+ expect(scope.body.message).toContain('read, ');+ expect(scope.body.why).toBeTruthy();+ expect(scope.body.fix.argv).toEqual(['gbrain', 'auth', 'create', 'dash-typo', '--scopes', 'read,write']);+ for (const bad of [{ name: 'dash-x', scopes: [] }, { name: 'dash-x', sources: ['nope'] }, { name: 'dash-x', sources: ['../x'] },+ { name: 'dash-x', takes_holders: ['Not A Holder'] }, { name: '' }, { name: 'x'.repeat(129) }, { name: 'dash-x', scopes: 7 }]) {+ const res = await post('/admin/api/api-keys', bad);+ expect(res.status).toBe(400);+ expect(res.body.code).toBe('invalid_params');+ expect(res.body.fix?.argv?.length).toBeGreaterThan(0);+ }+ const after = (await engine.executeRaw<{ n: number }>('SELECT count(*)::int AS n FROM access_tokens'))[0].n;+ expect(after).toBe(before);+ });+});++describe('dashboard list and revoke', () => {+ test('two keys sharing a name: revoke one by id, the sibling keeps working', async () => {+ const a = (await post('/admin/api/api-keys', { name: 'dash-twin' })).body;+ const b = (await post('/admin/api/api-keys', { name: 'dash-twin' })).body;+ const byName = await post('/admin/api/api-keys/revoke', { name: 'dash-twin' });+ expect(byName.status).toBe(400);+ expect(byName.body.code).toBe('invalid_params');+ expect((await rowOf(a.id)).revoked_at).toBeNull();+ const revoked = await post('/admin/api/api-keys/revoke', { id: a.id });+ expect(revoked.body).toEqual({ id: a.id, revoked: true });+ expect((await rowOf(a.id)).revoked_at).not.toBeNull();+ expect((await rowOf(b.id)).revoked_at).toBeNull();+ expect((await post('/admin/api/api-keys/revoke', { id: a.id })).body.revoked).toBe(false);+ const list = await (await fetch(`${base}/admin/api/api-keys`)).json() as any[];+ expect(list.find(k => k.id === a.id)).toMatchObject({ name: 'dash-twin', status: 'revoked', scopes: ['read', 'write'] });+ expect(list.find(k => k.id === b.id)).toMatchObject({ name: 'dash-twin', status: 'active', scopes: ['read', 'write'], sources: 'default', takes_holders: ['world'], scopes_grandfathered: false });+ expect(JSON.stringify(list)).not.toContain(a.token);+ });+});++describe('doctor legacy_token_null_scope', () => {+ test('counts NULL-scope tokens with a per-token rescope command and an ask-first fix', async () => {+ const name = 'pre-fix-dashboard-key';+ const [legacy] = await engine.executeRaw<{ id: string }>('INSERT INTO access_tokens (name, token_hash) VALUES ($1, $2) RETURNING id', [name, hashToken(generateToken('gbrain_'))]);+ const check = (await doctor()).legacy_token_null_scope;+ expect(check.status).toBe('warn');+ const tokens = check.details?.tokens as Array<{ id: string; name: string; argv: string[] }>;+ expect(tokens).toContainEqual({ id: legacy.id, name, argv: ['gbrain', 'auth', 'rescope', '--id', legacy.id, '--scopes', 'read,write'] });+ expect(check.fix).toMatchObject({ consent: ['credentials'], actor: 'agent' });+ expect((check.fix as { user_message?: string }).user_message).toContain('full read, write and admin');+ await engine.executeRaw("UPDATE access_tokens SET scopes = '{read,write}' WHERE id = $1::uuid", [legacy.id]);+ const after = (await doctor()).legacy_token_null_scope;+ expect(after.status).toBe('ok');+ expect(after.details?.null_scope_count).toBe(0);+ });+});