tycono 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,90 @@
1
+ var ub=Object.defineProperty;var fb=(t,l,r)=>l in t?ub(t,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[l]=r;var qx=(t,l,r)=>fb(t,typeof l!="symbol"?l+"":l,r);(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).observe(document,{childList:!0,subtree:!0});function r(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(o){if(o.ep)return;o.ep=!0;const u=r(o);fetch(o.href,u)}})();function j1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Tf={exports:{}},Ki={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Ix;function db(){if(Ix)return Ki;Ix=1;var t=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function r(i,o,u){var f=null;if(u!==void 0&&(f=""+u),o.key!==void 0&&(f=""+o.key),"key"in o){u={};for(var m in o)m!=="key"&&(u[m]=o[m])}else u=o;return o=u.ref,{$$typeof:t,type:i,key:f,ref:o!==void 0?o:null,props:u}}return Ki.Fragment=l,Ki.jsx=r,Ki.jsxs=r,Ki}var Yx;function hb(){return Yx||(Yx=1,Tf.exports=db()),Tf.exports}var c=hb(),Df={exports:{}},Oe={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Vx;function mb(){if(Vx)return Oe;Vx=1;var t=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function b(_){return _===null||typeof _!="object"?null:(_=v&&_[v]||_["@@iterator"],typeof _=="function"?_:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,N={};function T(_,Y,C){this.props=_,this.context=Y,this.refs=N,this.updater=C||k}T.prototype.isReactComponent={},T.prototype.setState=function(_,Y){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,Y,"setState")},T.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function L(){}L.prototype=T.prototype;function $(_,Y,C){this.props=_,this.context=Y,this.refs=N,this.updater=C||k}var K=$.prototype=new L;K.constructor=$,E(K,T.prototype),K.isPureReactComponent=!0;var V=Array.isArray;function M(){}var J={H:null,A:null,T:null,S:null},Q=Object.prototype.hasOwnProperty;function ie(_,Y,C){var de=C.ref;return{$$typeof:t,type:_,key:Y,ref:de!==void 0?de:null,props:C}}function D(_,Y){return ie(_.type,Y,_.props)}function U(_){return typeof _=="object"&&_!==null&&_.$$typeof===t}function B(_){var Y={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(C){return Y[C]})}var ne=/\/+/g;function te(_,Y){return typeof _=="object"&&_!==null&&_.key!=null?B(""+_.key):Y.toString(36)}function F(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(M,M):(_.status="pending",_.then(function(Y){_.status==="pending"&&(_.status="fulfilled",_.value=Y)},function(Y){_.status==="pending"&&(_.status="rejected",_.reason=Y)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function z(_,Y,C,de,pe){var xe=typeof _;(xe==="undefined"||xe==="boolean")&&(_=null);var ce=!1;if(_===null)ce=!0;else switch(xe){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(_.$$typeof){case t:case l:ce=!0;break;case y:return ce=_._init,z(ce(_._payload),Y,C,de,pe)}}if(ce)return pe=pe(_),ce=de===""?"."+te(_,0):de,V(pe)?(C="",ce!=null&&(C=ce.replace(ne,"$&/")+"/"),z(pe,Y,C,"",function(tt){return tt})):pe!=null&&(U(pe)&&(pe=D(pe,C+(pe.key==null||_&&_.key===pe.key?"":(""+pe.key).replace(ne,"$&/")+"/")+ce)),Y.push(pe)),1;ce=0;var ve=de===""?".":de+":";if(V(_))for(var je=0;je<_.length;je++)de=_[je],xe=ve+te(de,je),ce+=z(de,Y,C,xe,pe);else if(je=b(_),typeof je=="function")for(_=je.call(_),je=0;!(de=_.next()).done;)de=de.value,xe=ve+te(de,je++),ce+=z(de,Y,C,xe,pe);else if(xe==="object"){if(typeof _.then=="function")return z(F(_),Y,C,de,pe);throw Y=String(_),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return ce}function q(_,Y,C){if(_==null)return _;var de=[],pe=0;return z(_,de,"","",function(xe){return Y.call(C,xe,pe++)}),de}function Z(_){if(_._status===-1){var Y=_._result;Y=Y(),Y.then(function(C){(_._status===0||_._status===-1)&&(_._status=1,_._result=C)},function(C){(_._status===0||_._status===-1)&&(_._status=2,_._result=C)}),_._status===-1&&(_._status=0,_._result=Y)}if(_._status===1)return _._result.default;throw _._result}var re=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},A={map:q,forEach:function(_,Y,C){q(_,function(){Y.apply(this,arguments)},C)},count:function(_){var Y=0;return q(_,function(){Y++}),Y},toArray:function(_){return q(_,function(Y){return Y})||[]},only:function(_){if(!U(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return Oe.Activity=g,Oe.Children=A,Oe.Component=T,Oe.Fragment=r,Oe.Profiler=o,Oe.PureComponent=$,Oe.StrictMode=i,Oe.Suspense=x,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=J,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(_){return J.H.useMemoCache(_)}},Oe.cache=function(_){return function(){return _.apply(null,arguments)}},Oe.cacheSignal=function(){return null},Oe.cloneElement=function(_,Y,C){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var de=E({},_.props),pe=_.key;if(Y!=null)for(xe in Y.key!==void 0&&(pe=""+Y.key),Y)!Q.call(Y,xe)||xe==="key"||xe==="__self"||xe==="__source"||xe==="ref"&&Y.ref===void 0||(de[xe]=Y[xe]);var xe=arguments.length-2;if(xe===1)de.children=C;else if(1<xe){for(var ce=Array(xe),ve=0;ve<xe;ve++)ce[ve]=arguments[ve+2];de.children=ce}return ie(_.type,pe,de)},Oe.createContext=function(_){return _={$$typeof:f,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:u,_context:_},_},Oe.createElement=function(_,Y,C){var de,pe={},xe=null;if(Y!=null)for(de in Y.key!==void 0&&(xe=""+Y.key),Y)Q.call(Y,de)&&de!=="key"&&de!=="__self"&&de!=="__source"&&(pe[de]=Y[de]);var ce=arguments.length-2;if(ce===1)pe.children=C;else if(1<ce){for(var ve=Array(ce),je=0;je<ce;je++)ve[je]=arguments[je+2];pe.children=ve}if(_&&_.defaultProps)for(de in ce=_.defaultProps,ce)pe[de]===void 0&&(pe[de]=ce[de]);return ie(_,xe,pe)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(_){return{$$typeof:m,render:_}},Oe.isValidElement=U,Oe.lazy=function(_){return{$$typeof:y,_payload:{_status:-1,_result:_},_init:Z}},Oe.memo=function(_,Y){return{$$typeof:h,type:_,compare:Y===void 0?null:Y}},Oe.startTransition=function(_){var Y=J.T,C={};J.T=C;try{var de=_(),pe=J.S;pe!==null&&pe(C,de),typeof de=="object"&&de!==null&&typeof de.then=="function"&&de.then(M,re)}catch(xe){re(xe)}finally{Y!==null&&C.types!==null&&(Y.types=C.types),J.T=Y}},Oe.unstable_useCacheRefresh=function(){return J.H.useCacheRefresh()},Oe.use=function(_){return J.H.use(_)},Oe.useActionState=function(_,Y,C){return J.H.useActionState(_,Y,C)},Oe.useCallback=function(_,Y){return J.H.useCallback(_,Y)},Oe.useContext=function(_){return J.H.useContext(_)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(_,Y){return J.H.useDeferredValue(_,Y)},Oe.useEffect=function(_,Y){return J.H.useEffect(_,Y)},Oe.useEffectEvent=function(_){return J.H.useEffectEvent(_)},Oe.useId=function(){return J.H.useId()},Oe.useImperativeHandle=function(_,Y,C){return J.H.useImperativeHandle(_,Y,C)},Oe.useInsertionEffect=function(_,Y){return J.H.useInsertionEffect(_,Y)},Oe.useLayoutEffect=function(_,Y){return J.H.useLayoutEffect(_,Y)},Oe.useMemo=function(_,Y){return J.H.useMemo(_,Y)},Oe.useOptimistic=function(_,Y){return J.H.useOptimistic(_,Y)},Oe.useReducer=function(_,Y,C){return J.H.useReducer(_,Y,C)},Oe.useRef=function(_){return J.H.useRef(_)},Oe.useState=function(_){return J.H.useState(_)},Oe.useSyncExternalStore=function(_,Y,C){return J.H.useSyncExternalStore(_,Y,C)},Oe.useTransition=function(){return J.H.useTransition()},Oe.version="19.2.4",Oe}var Xx;function Rd(){return Xx||(Xx=1,Df.exports=mb()),Df.exports}var j=Rd(),zf={exports:{}},Zi={},Mf={exports:{}},_f={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Gx;function pb(){return Gx||(Gx=1,(function(t){function l(z,q){var Z=z.length;z.push(q);e:for(;0<Z;){var re=Z-1>>>1,A=z[re];if(0<o(A,q))z[re]=q,z[Z]=A,Z=re;else break e}}function r(z){return z.length===0?null:z[0]}function i(z){if(z.length===0)return null;var q=z[0],Z=z.pop();if(Z!==q){z[0]=Z;e:for(var re=0,A=z.length,_=A>>>1;re<_;){var Y=2*(re+1)-1,C=z[Y],de=Y+1,pe=z[de];if(0>o(C,Z))de<A&&0>o(pe,C)?(z[re]=pe,z[de]=Z,re=de):(z[re]=C,z[Y]=Z,re=Y);else if(de<A&&0>o(pe,Z))z[re]=pe,z[de]=Z,re=de;else break e}}return q}function o(z,q){var Z=z.sortIndex-q.sortIndex;return Z!==0?Z:z.id-q.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var f=Date,m=f.now();t.unstable_now=function(){return f.now()-m}}var x=[],h=[],y=1,g=null,v=3,b=!1,k=!1,E=!1,N=!1,T=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function K(z){for(var q=r(h);q!==null;){if(q.callback===null)i(h);else if(q.startTime<=z)i(h),q.sortIndex=q.expirationTime,l(x,q);else break;q=r(h)}}function V(z){if(E=!1,K(z),!k)if(r(x)!==null)k=!0,M||(M=!0,B());else{var q=r(h);q!==null&&F(V,q.startTime-z)}}var M=!1,J=-1,Q=5,ie=-1;function D(){return N?!0:!(t.unstable_now()-ie<Q)}function U(){if(N=!1,M){var z=t.unstable_now();ie=z;var q=!0;try{e:{k=!1,E&&(E=!1,L(J),J=-1),b=!0;var Z=v;try{t:{for(K(z),g=r(x);g!==null&&!(g.expirationTime>z&&D());){var re=g.callback;if(typeof re=="function"){g.callback=null,v=g.priorityLevel;var A=re(g.expirationTime<=z);if(z=t.unstable_now(),typeof A=="function"){g.callback=A,K(z),q=!0;break t}g===r(x)&&i(x),K(z)}else i(x);g=r(x)}if(g!==null)q=!0;else{var _=r(h);_!==null&&F(V,_.startTime-z),q=!1}}break e}finally{g=null,v=Z,b=!1}q=void 0}}finally{q?B():M=!1}}}var B;if(typeof $=="function")B=function(){$(U)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,te=ne.port2;ne.port1.onmessage=U,B=function(){te.postMessage(null)}}else B=function(){T(U,0)};function F(z,q){J=T(function(){z(t.unstable_now())},q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(z){z.callback=null},t.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<z?Math.floor(1e3/z):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_next=function(z){switch(v){case 1:case 2:case 3:var q=3;break;default:q=v}var Z=v;v=q;try{return z()}finally{v=Z}},t.unstable_requestPaint=function(){N=!0},t.unstable_runWithPriority=function(z,q){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var Z=v;v=z;try{return q()}finally{v=Z}},t.unstable_scheduleCallback=function(z,q,Z){var re=t.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?re+Z:re):Z=re,z){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=Z+A,z={id:y++,callback:q,priorityLevel:z,startTime:Z,expirationTime:A,sortIndex:-1},Z>re?(z.sortIndex=Z,l(h,z),r(x)===null&&z===r(h)&&(E?(L(J),J=-1):E=!0,F(V,Z-re))):(z.sortIndex=A,l(x,z),k||b||(k=!0,M||(M=!0,B()))),z},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(z){var q=v;return function(){var Z=v;v=q;try{return z.apply(this,arguments)}finally{v=Z}}}})(_f)),_f}var Qx;function xb(){return Qx||(Qx=1,Mf.exports=pb()),Mf.exports}var Rf={exports:{}},dn={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Kx;function gb(){if(Kx)return dn;Kx=1;var t=Rd();function l(x){var h="https://react.dev/errors/"+x;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+x+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var i={d:{f:r,r:function(){throw Error(l(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(x,h,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:x,containerInfo:h,implementation:y}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(x,h){if(x==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return dn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,dn.createPortal=function(x,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(l(299));return u(x,h,null,y)},dn.flushSync=function(x){var h=f.T,y=i.p;try{if(f.T=null,i.p=2,x)return x()}finally{f.T=h,i.p=y,i.d.f()}},dn.preconnect=function(x,h){typeof x=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(x,h))},dn.prefetchDNS=function(x){typeof x=="string"&&i.d.D(x)},dn.preinit=function(x,h){if(typeof x=="string"&&h&&typeof h.as=="string"){var y=h.as,g=m(y,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?i.d.S(x,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:b}):y==="script"&&i.d.X(x,{crossOrigin:g,integrity:v,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},dn.preinitModule=function(x,h){if(typeof x=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=m(h.as,h.crossOrigin);i.d.M(x,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(x)},dn.preload=function(x,h){if(typeof x=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,g=m(y,h.crossOrigin);i.d.L(x,y,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},dn.preloadModule=function(x,h){if(typeof x=="string")if(h){var y=m(h.as,h.crossOrigin);i.d.m(x,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(x)},dn.requestFormReset=function(x){i.d.r(x)},dn.unstable_batchedUpdates=function(x,h){return x(h)},dn.useFormState=function(x,h,y){return f.H.useFormState(x,h,y)},dn.useFormStatus=function(){return f.H.useHostTransitionStatus()},dn.version="19.2.4",dn}var Zx;function yb(){if(Zx)return Rf.exports;Zx=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(l){console.error(l)}}return t(),Rf.exports=gb(),Rf.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Jx;function vb(){if(Jx)return Zi;Jx=1;var t=xb(),l=Rd(),r=yb();function i(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var n=e,a=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(a=n.return),e=n.return;while(e)}return n.tag===3?a:null}function f(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function x(e){if(u(e)!==e)throw Error(i(188))}function h(e){var n=e.alternate;if(!n){if(n=u(e),n===null)throw Error(i(188));return n!==e?null:e}for(var a=e,s=n;;){var d=a.return;if(d===null)break;var p=d.alternate;if(p===null){if(s=d.return,s!==null){a=s;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===a)return x(d),e;if(p===s)return x(d),n;p=p.sibling}throw Error(i(188))}if(a.return!==s.return)a=d,s=p;else{for(var w=!1,S=d.child;S;){if(S===a){w=!0,a=d,s=p;break}if(S===s){w=!0,s=d,a=p;break}S=S.sibling}if(!w){for(S=p.child;S;){if(S===a){w=!0,a=p,s=d;break}if(S===s){w=!0,s=p,a=d;break}S=S.sibling}if(!w)throw Error(i(189))}}if(a.alternate!==s)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?e:n}function y(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=y(e),n!==null)return n;e=e.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),$=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),ie=Symbol.for("react.activity"),D=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function B(e){return e===null||typeof e!="object"?null:(e=U&&e[U]||e["@@iterator"],typeof e=="function"?e:null)}var ne=Symbol.for("react.client.reference");function te(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case T:return"Profiler";case N:return"StrictMode";case V:return"Suspense";case M:return"SuspenseList";case ie:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case $:return e.displayName||"Context";case L:return(e._context.displayName||"Context")+".Consumer";case K:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case J:return n=e.displayName||null,n!==null?n:te(e.type)||"Memo";case Q:n=e._payload,e=e._init;try{return te(e(n))}catch{}}return null}var F=Array.isArray,z=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},re=[],A=-1;function _(e){return{current:e}}function Y(e){0>A||(e.current=re[A],re[A]=null,A--)}function C(e,n){A++,re[A]=e.current,e.current=n}var de=_(null),pe=_(null),xe=_(null),ce=_(null);function ve(e,n){switch(C(xe,n),C(pe,e),C(de,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?fx(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=fx(n),e=dx(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Y(de),C(de,e)}function je(){Y(de),Y(pe),Y(xe)}function tt(e){e.memoizedState!==null&&C(ce,e);var n=de.current,a=dx(n,e.type);n!==a&&(C(pe,e),C(de,a))}function xt(e){pe.current===e&&(Y(de),Y(pe)),ce.current===e&&(Y(ce),Vi._currentValue=Z)}var vt,Lt;function _e(e){if(vt===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);vt=n&&n[1]||"",Lt=-1<a.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+vt+e+Lt}var bt=!1;function Ft(e,n){if(!e||bt)return"";bt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(le){var ee=le}Reflect.construct(e,[],ue)}else{try{ue.call()}catch(le){ee=le}e.call(ue.prototype)}}else{try{throw Error()}catch(le){ee=le}(ue=e())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(le){if(le&&ee&&typeof le.stack=="string")return[le.stack,ee.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=s.DetermineComponentFrameRoot(),w=p[0],S=p[1];if(w&&S){var O=w.split(`
44
+ `),P=S.split(`
45
+ `);for(d=s=0;s<O.length&&!O[s].includes("DetermineComponentFrameRoot");)s++;for(;d<P.length&&!P[d].includes("DetermineComponentFrameRoot");)d++;if(s===O.length||d===P.length)for(s=O.length-1,d=P.length-1;1<=s&&0<=d&&O[s]!==P[d];)d--;for(;1<=s&&0<=d;s--,d--)if(O[s]!==P[d]){if(s!==1||d!==1)do if(s--,d--,0>d||O[s]!==P[d]){var ae=`
46
+ `+O[s].replace(" at new "," at ");return e.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",e.displayName)),ae}while(1<=s&&0<=d);break}}}finally{bt=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?_e(a):""}function _n(e,n){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e("Lazy");case 13:return e.child!==n&&n!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return Ft(e.type,!1);case 11:return Ft(e.type.render,!1);case 1:return Ft(e.type,!0);case 31:return _e("Activity");default:return""}}function gt(e){try{var n="",a=null;do n+=_n(e,a),a=e,e=e.return;while(e);return n}catch(s){return`
47
+ Error generating stack: `+s.message+`
48
+ `+s.stack}}var Zt=Object.prototype.hasOwnProperty,un=t.unstable_scheduleCallback,St=t.unstable_cancelCallback,wn=t.unstable_shouldYield,kn=t.unstable_requestPaint,Dt=t.unstable_now,Sn=t.unstable_getCurrentPriorityLevel,G=t.unstable_ImmediatePriority,se=t.unstable_UserBlockingPriority,we=t.unstable_NormalPriority,ye=t.unstable_LowPriority,Be=t.unstable_IdlePriority,jt=t.log,Nt=t.unstable_setDisableYieldValue,it=null,he=null;function We(e){if(typeof jt=="function"&&Nt(e),he&&typeof he.setStrictMode=="function")try{he.setStrictMode(it,e)}catch{}}var Qe=Math.clz32?Math.clz32:ws,Rn=Math.log,tn=Math.LN2;function ws(e){return e>>>=0,e===0?32:31-(Rn(e)/tn|0)|0}var za=256,Yl=262144,Ma=4194304;function xn(e){var n=e&42;if(n!==0)return n;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 Vl(e,n,a){var s=e.pendingLanes;if(s===0)return 0;var d=0,p=e.suspendedLanes,w=e.pingedLanes;e=e.warmLanes;var S=s&134217727;return S!==0?(s=S&~p,s!==0?d=xn(s):(w&=S,w!==0?d=xn(w):a||(a=S&~e,a!==0&&(d=xn(a))))):(S=s&~p,S!==0?d=xn(S):w!==0?d=xn(w):a||(a=s&~e,a!==0&&(d=xn(a)))),d===0?0:n!==0&&n!==d&&(n&p)===0&&(p=d&-d,a=n&-n,p>=a||p===32&&(a&4194048)!==0)?n:d}function Xl(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function ks(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Ss(){var e=Ma;return Ma<<=1,(Ma&62914560)===0&&(Ma=4194304),e}function _a(e){for(var n=[],a=0;31>a;a++)n.push(e);return n}function fn(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Gl(e,n,a,s,d,p){var w=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var S=e.entanglements,O=e.expirationTimes,P=e.hiddenUpdates;for(a=w&~a;0<a;){var ae=31-Qe(a),ue=1<<ae;S[ae]=0,O[ae]=-1;var ee=P[ae];if(ee!==null)for(P[ae]=null,ae=0;ae<ee.length;ae++){var le=ee[ae];le!==null&&(le.lane&=-536870913)}a&=~ue}s!==0&&Ql(e,s,0),p!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=p&~(w&~n))}function Ql(e,n,a){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-Qe(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|a&261930}function js(e,n){var a=e.entangledLanes|=n;for(e=e.entanglements;a;){var s=31-Qe(a),d=1<<s;d&n|e[s]&n&&(e[s]|=n),a&=~d}}function Ra(e,n){var a=n&-n;return a=(a&42)!==0?1:ln(a),(a&(e.suspendedLanes|n))!==0?0:a}function ln(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 Kl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function al(){var e=q.p;return e!==0?e:(e=window.event,e===void 0?32:Ox(e.type))}function ni(e,n){var a=q.p;try{return q.p=e,n()}finally{q.p=a}}var Gn=Math.random().toString(36).slice(2),Jt="__reactFiber$"+Gn,Ut="__reactProps$"+Gn,Zl="__reactContainer$"+Gn,_t="__reactEvents$"+Gn,wc="__reactListeners$"+Gn,kc="__reactHandles$"+Gn,li="__reactResources$"+Gn,wl="__reactMarker$"+Gn;function ai(e){delete e[Jt],delete e[Ut],delete e[_t],delete e[wc],delete e[kc]}function Jl(e){var n=e[Jt];if(n)return n;for(var a=e.parentNode;a;){if(n=a[Zl]||a[Jt]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(e=vx(e);e!==null;){if(a=e[Jt])return a;e=vx(e)}return n}e=a,a=e.parentNode}return null}function kl(e){if(e=e[Jt]||e[Zl]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function Oa(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(i(33))}function Wl(e){var n=e[li];return n||(n=e[li]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Ht(e){e[wl]=!0}var Es=new Set,Cs={};function Sl(e,n){Pl(e,n),Pl(e+"Capture",n)}function Pl(e,n){for(Cs[e]=n,e=0;e<n.length;e++)Es.add(n[e])}var ul=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]*$"),ri={},Ns={};function Sc(e){return Zt.call(Ns,e)?!0:Zt.call(ri,e)?!1:ul.test(e)?Ns[e]=!0:(ri[e]=!0,!1)}function On(e,n,a){if(Sc(n))if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var s=n.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+a)}}function Ba(e,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+a)}}function rl(e,n,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(n,a,""+s)}}function jn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function jl(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ii(e,n,a){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var d=s.get,p=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return d.call(this)},set:function(w){a=""+w,p.call(this,w)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(w){a=""+w},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function or(e){if(!e._valueTracker){var n=jl(e)?"checked":"value";e._valueTracker=ii(e,n,""+e[n])}}function si(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var a=n.getValue(),s="";return e&&(s=jl(e)?e.checked?"true":"false":e.value),e=s,e!==a?(n.setValue(e),!0):!1}function La(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 I=/[\n"\\]/g;function fe(e){return e.replace(I,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function ge(e,n,a,s,d,p,w,S){e.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.type=w:e.removeAttribute("type"),n!=null?w==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+jn(n)):e.value!==""+jn(n)&&(e.value=""+jn(n)):w!=="submit"&&w!=="reset"||e.removeAttribute("value"),n!=null?Ee(e,w,jn(n)):a!=null?Ee(e,w,jn(a)):s!=null&&e.removeAttribute("value"),d==null&&p!=null&&(e.defaultChecked=!!p),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+jn(S):e.removeAttribute("name")}function ke(e,n,a,s,d,p,w,S){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.type=p),n!=null||a!=null){if(!(p!=="submit"&&p!=="reset"||n!=null)){or(e);return}a=a!=null?""+jn(a):"",n=n!=null?""+jn(n):a,S||n===e.value||(e.value=n),e.defaultValue=n}s=s??d,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=S?e.checked:!!s,e.defaultChecked=!!s,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(e.name=w),or(e)}function Ee(e,n,a){n==="number"&&La(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function ze(e,n,a,s){if(e=e.options,n){n={};for(var d=0;d<a.length;d++)n["$"+a[d]]=!0;for(a=0;a<e.length;a++)d=n.hasOwnProperty("$"+e[a].value),e[a].selected!==d&&(e[a].selected=d),d&&s&&(e[a].defaultSelected=!0)}else{for(a=""+jn(a),n=null,d=0;d<e.length;d++){if(e[d].value===a){e[d].selected=!0,s&&(e[d].defaultSelected=!0);return}n!==null||e[d].disabled||(n=e[d])}n!==null&&(n.selected=!0)}}function Me(e,n,a){if(n!=null&&(n=""+jn(n),n!==e.value&&(e.value=n),a==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=a!=null?""+jn(a):""}function Ke(e,n,a,s){if(n==null){if(s!=null){if(a!=null)throw Error(i(92));if(F(s)){if(1<s.length)throw Error(i(93));s=s[0]}a=s}a==null&&(a=""),n=a}a=jn(n),e.defaultValue=a,s=e.textContent,s===a&&s!==""&&s!==null&&(e.value=s),or(e)}function qe(e,n){if(n){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=n;return}}e.textContent=n}var Fe=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 At(e,n,a){var s=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,a):typeof a!="number"||a===0||Fe.has(n)?n==="float"?e.cssFloat=a:e[n]=(""+a).trim():e[n]=a+"px"}function ch(e,n,a){if(n!=null&&typeof n!="object")throw Error(i(62));if(e=e.style,a!=null){for(var s in a)!a.hasOwnProperty(s)||n!=null&&n.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var d in n)s=n[d],n.hasOwnProperty(d)&&a[d]!==s&&At(e,d,s)}else for(var p in n)n.hasOwnProperty(p)&&At(e,p,n[p])}function jc(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 i0=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"]]),s0=/^[\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 As(e){return s0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function El(){}var Ec=null;function Cc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cr=null,ur=null;function uh(e){var n=kl(e);if(n&&(e=n.stateNode)){var a=e[Ut]||null;e:switch(e=n.stateNode,n.type){case"input":if(ge(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+fe(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var s=a[n];if(s!==e&&s.form===e.form){var d=s[Ut]||null;if(!d)throw Error(i(90));ge(s,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(n=0;n<a.length;n++)s=a[n],s.form===e.form&&si(s)}break e;case"textarea":Me(e,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&ze(e,!!a.multiple,n,!1)}}}var Nc=!1;function fh(e,n,a){if(Nc)return e(n,a);Nc=!0;try{var s=e(n);return s}finally{if(Nc=!1,(cr!==null||ur!==null)&&(xo(),cr&&(n=cr,e=ur,ur=cr=null,uh(n),e)))for(n=0;n<e.length;n++)uh(e[n])}}function oi(e,n){var a=e.stateNode;if(a===null)return null;var s=a[Ut]||null;if(s===null)return null;a=s[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(i(231,n,typeof a));return a}var Cl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ac=!1;if(Cl)try{var ci={};Object.defineProperty(ci,"passive",{get:function(){Ac=!0}}),window.addEventListener("test",ci,ci),window.removeEventListener("test",ci,ci)}catch{Ac=!1}var ea=null,Tc=null,Ts=null;function dh(){if(Ts)return Ts;var e,n=Tc,a=n.length,s,d="value"in ea?ea.value:ea.textContent,p=d.length;for(e=0;e<a&&n[e]===d[e];e++);var w=a-e;for(s=1;s<=w&&n[a-s]===d[p-s];s++);return Ts=d.slice(e,1<s?1-s:void 0)}function Ds(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function zs(){return!0}function hh(){return!1}function En(e){function n(a,s,d,p,w){this._reactName=a,this._targetInst=d,this.type=s,this.nativeEvent=p,this.target=w,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(a=e[S],this[S]=a?a(p):p[S]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?zs:hh,this.isPropagationStopped=hh,this}return g(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=zs)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=zs)},persist:function(){},isPersistent:zs}),n}var Fa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ms=En(Fa),ui=g({},Fa,{view:0,detail:0}),o0=En(ui),Dc,zc,fi,_s=g({},ui,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_c,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!==fi&&(fi&&e.type==="mousemove"?(Dc=e.screenX-fi.screenX,zc=e.screenY-fi.screenY):zc=Dc=0,fi=e),Dc)},movementY:function(e){return"movementY"in e?e.movementY:zc}}),mh=En(_s),c0=g({},_s,{dataTransfer:0}),u0=En(c0),f0=g({},ui,{relatedTarget:0}),Mc=En(f0),d0=g({},Fa,{animationName:0,elapsedTime:0,pseudoElement:0}),h0=En(d0),m0=g({},Fa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),p0=En(m0),x0=g({},Fa,{data:0}),ph=En(x0),g0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},y0={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"},v0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function b0(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=v0[e])?!!n[e]:!1}function _c(){return b0}var w0=g({},ui,{key:function(e){if(e.key){var n=g0[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Ds(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?y0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_c,charCode:function(e){return e.type==="keypress"?Ds(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ds(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),k0=En(w0),S0=g({},_s,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xh=En(S0),j0=g({},ui,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_c}),E0=En(j0),C0=g({},Fa,{propertyName:0,elapsedTime:0,pseudoElement:0}),N0=En(C0),A0=g({},_s,{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}),T0=En(A0),D0=g({},Fa,{newState:0,oldState:0}),z0=En(D0),M0=[9,13,27,32],Rc=Cl&&"CompositionEvent"in window,di=null;Cl&&"documentMode"in document&&(di=document.documentMode);var _0=Cl&&"TextEvent"in window&&!di,gh=Cl&&(!Rc||di&&8<di&&11>=di),yh=" ",vh=!1;function bh(e,n){switch(e){case"keyup":return M0.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fr=!1;function R0(e,n){switch(e){case"compositionend":return wh(n);case"keypress":return n.which!==32?null:(vh=!0,yh);case"textInput":return e=n.data,e===yh&&vh?null:e;default:return null}}function O0(e,n){if(fr)return e==="compositionend"||!Rc&&bh(e,n)?(e=dh(),Ts=Tc=ea=null,fr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return gh&&n.locale!=="ko"?null:n.data;default:return null}}var B0={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 kh(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!B0[e.type]:n==="textarea"}function Sh(e,n,a,s){cr?ur?ur.push(s):ur=[s]:cr=s,n=So(n,"onChange"),0<n.length&&(a=new Ms("onChange","change",null,a,s),e.push({event:a,listeners:n}))}var hi=null,mi=null;function L0(e){rx(e,0)}function Rs(e){var n=Oa(e);if(si(n))return e}function jh(e,n){if(e==="change")return n}var Eh=!1;if(Cl){var Oc;if(Cl){var Bc="oninput"in document;if(!Bc){var Ch=document.createElement("div");Ch.setAttribute("oninput","return;"),Bc=typeof Ch.oninput=="function"}Oc=Bc}else Oc=!1;Eh=Oc&&(!document.documentMode||9<document.documentMode)}function Nh(){hi&&(hi.detachEvent("onpropertychange",Ah),mi=hi=null)}function Ah(e){if(e.propertyName==="value"&&Rs(mi)){var n=[];Sh(n,mi,e,Cc(e)),fh(L0,n)}}function F0(e,n,a){e==="focusin"?(Nh(),hi=n,mi=a,hi.attachEvent("onpropertychange",Ah)):e==="focusout"&&Nh()}function U0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Rs(mi)}function H0(e,n){if(e==="click")return Rs(n)}function $0(e,n){if(e==="input"||e==="change")return Rs(n)}function q0(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Bn=typeof Object.is=="function"?Object.is:q0;function pi(e,n){if(Bn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var a=Object.keys(e),s=Object.keys(n);if(a.length!==s.length)return!1;for(s=0;s<a.length;s++){var d=a[s];if(!Zt.call(n,d)||!Bn(e[d],n[d]))return!1}return!0}function Th(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dh(e,n){var a=Th(e);e=0;for(var s;a;){if(a.nodeType===3){if(s=e+a.textContent.length,e<=n&&s>=n)return{node:a,offset:n-e};e=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Th(a)}}function zh(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?zh(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Mh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=La(e.document);n instanceof e.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)e=n.contentWindow;else break;n=La(e.document)}return n}function Lc(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var I0=Cl&&"documentMode"in document&&11>=document.documentMode,dr=null,Fc=null,xi=null,Uc=!1;function _h(e,n,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Uc||dr==null||dr!==La(s)||(s=dr,"selectionStart"in s&&Lc(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),xi&&pi(xi,s)||(xi=s,s=So(Fc,"onSelect"),0<s.length&&(n=new Ms("onSelect","select",null,n,a),e.push({event:n,listeners:s}),n.target=dr)))}function Ua(e,n){var a={};return a[e.toLowerCase()]=n.toLowerCase(),a["Webkit"+e]="webkit"+n,a["Moz"+e]="moz"+n,a}var hr={animationend:Ua("Animation","AnimationEnd"),animationiteration:Ua("Animation","AnimationIteration"),animationstart:Ua("Animation","AnimationStart"),transitionrun:Ua("Transition","TransitionRun"),transitionstart:Ua("Transition","TransitionStart"),transitioncancel:Ua("Transition","TransitionCancel"),transitionend:Ua("Transition","TransitionEnd")},Hc={},Rh={};Cl&&(Rh=document.createElement("div").style,"AnimationEvent"in window||(delete hr.animationend.animation,delete hr.animationiteration.animation,delete hr.animationstart.animation),"TransitionEvent"in window||delete hr.transitionend.transition);function Ha(e){if(Hc[e])return Hc[e];if(!hr[e])return e;var n=hr[e],a;for(a in n)if(n.hasOwnProperty(a)&&a in Rh)return Hc[e]=n[a];return e}var Oh=Ha("animationend"),Bh=Ha("animationiteration"),Lh=Ha("animationstart"),Y0=Ha("transitionrun"),V0=Ha("transitionstart"),X0=Ha("transitioncancel"),Fh=Ha("transitionend"),Uh=new Map,$c="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(" ");$c.push("scrollEnd");function il(e,n){Uh.set(e,n),Sl(n,[e])}var Os=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=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(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Qn=[],mr=0,qc=0;function Bs(){for(var e=mr,n=qc=mr=0;n<e;){var a=Qn[n];Qn[n++]=null;var s=Qn[n];Qn[n++]=null;var d=Qn[n];Qn[n++]=null;var p=Qn[n];if(Qn[n++]=null,s!==null&&d!==null){var w=s.pending;w===null?d.next=d:(d.next=w.next,w.next=d),s.pending=d}p!==0&&Hh(a,d,p)}}function Ls(e,n,a,s){Qn[mr++]=e,Qn[mr++]=n,Qn[mr++]=a,Qn[mr++]=s,qc|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Ic(e,n,a,s){return Ls(e,n,a,s),Fs(e)}function $a(e,n){return Ls(e,null,null,n),Fs(e)}function Hh(e,n,a){e.lanes|=a;var s=e.alternate;s!==null&&(s.lanes|=a);for(var d=!1,p=e.return;p!==null;)p.childLanes|=a,s=p.alternate,s!==null&&(s.childLanes|=a),p.tag===22&&(e=p.stateNode,e===null||e._visibility&1||(d=!0)),e=p,p=p.return;return e.tag===3?(p=e.stateNode,d&&n!==null&&(d=31-Qe(a),e=p.hiddenUpdates,s=e[d],s===null?e[d]=[n]:s.push(n),n.lane=a|536870912),p):null}function Fs(e){if(50<Fi)throw Fi=0,Wu=null,Error(i(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var pr={};function G0(e,n,a,s){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ln(e,n,a,s){return new G0(e,n,a,s)}function Yc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Nl(e,n){var a=e.alternate;return a===null?(a=Ln(e.tag,n,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=n,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,n=e.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function $h(e,n){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,n=a.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Us(e,n,a,s,d,p){var w=0;if(s=e,typeof e=="function")Yc(e)&&(w=1);else if(typeof e=="string")w=Wv(e,a,de.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ie:return e=Ln(31,a,n,d),e.elementType=ie,e.lanes=p,e;case E:return qa(a.children,d,p,n);case N:w=8,d|=24;break;case T:return e=Ln(12,a,n,d|2),e.elementType=T,e.lanes=p,e;case V:return e=Ln(13,a,n,d),e.elementType=V,e.lanes=p,e;case M:return e=Ln(19,a,n,d),e.elementType=M,e.lanes=p,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $:w=10;break e;case L:w=9;break e;case K:w=11;break e;case J:w=14;break e;case Q:w=16,s=null;break e}w=29,a=Error(i(130,e===null?"null":typeof e,"")),s=null}return n=Ln(w,a,n,d),n.elementType=e,n.type=s,n.lanes=p,n}function qa(e,n,a,s){return e=Ln(7,e,s,n),e.lanes=a,e}function Vc(e,n,a){return e=Ln(6,e,null,n),e.lanes=a,e}function qh(e){var n=Ln(18,null,null,0);return n.stateNode=e,n}function Xc(e,n,a){return n=Ln(4,e.children!==null?e.children:[],e.key,n),n.lanes=a,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Ih=new WeakMap;function Kn(e,n){if(typeof e=="object"&&e!==null){var a=Ih.get(e);return a!==void 0?a:(n={value:e,source:n,stack:gt(n)},Ih.set(e,n),n)}return{value:e,source:n,stack:gt(n)}}var xr=[],gr=0,Hs=null,gi=0,Zn=[],Jn=0,ta=null,fl=1,dl="";function Al(e,n){xr[gr++]=gi,xr[gr++]=Hs,Hs=e,gi=n}function Yh(e,n,a){Zn[Jn++]=fl,Zn[Jn++]=dl,Zn[Jn++]=ta,ta=e;var s=fl;e=dl;var d=32-Qe(s)-1;s&=~(1<<d),a+=1;var p=32-Qe(n)+d;if(30<p){var w=d-d%5;p=(s&(1<<w)-1).toString(32),s>>=w,d-=w,fl=1<<32-Qe(n)+d|a<<d|s,dl=p+e}else fl=1<<p|a<<d|s,dl=e}function Gc(e){e.return!==null&&(Al(e,1),Yh(e,1,0))}function Qc(e){for(;e===Hs;)Hs=xr[--gr],xr[gr]=null,gi=xr[--gr],xr[gr]=null;for(;e===ta;)ta=Zn[--Jn],Zn[Jn]=null,dl=Zn[--Jn],Zn[Jn]=null,fl=Zn[--Jn],Zn[Jn]=null}function Vh(e,n){Zn[Jn++]=fl,Zn[Jn++]=dl,Zn[Jn++]=ta,fl=n.id,dl=n.overflow,ta=e}var an=null,wt=null,Ze=!1,na=null,Wn=!1,Kc=Error(i(519));function la(e){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw yi(Kn(n,e)),Kc}function Xh(e){var n=e.stateNode,a=e.type,s=e.memoizedProps;switch(n[Jt]=e,n[Ut]=s,a){case"dialog":Ye("cancel",n),Ye("close",n);break;case"iframe":case"object":case"embed":Ye("load",n);break;case"video":case"audio":for(a=0;a<Hi.length;a++)Ye(Hi[a],n);break;case"source":Ye("error",n);break;case"img":case"image":case"link":Ye("error",n),Ye("load",n);break;case"details":Ye("toggle",n);break;case"input":Ye("invalid",n),ke(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Ye("invalid",n);break;case"textarea":Ye("invalid",n),Ke(n,s.value,s.defaultValue,s.children)}a=s.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||s.suppressHydrationWarning===!0||cx(n.textContent,a)?(s.popover!=null&&(Ye("beforetoggle",n),Ye("toggle",n)),s.onScroll!=null&&Ye("scroll",n),s.onScrollEnd!=null&&Ye("scrollend",n),s.onClick!=null&&(n.onclick=El),n=!0):n=!1,n||la(e,!0)}function Gh(e){for(an=e.return;an;)switch(an.tag){case 5:case 31:case 13:Wn=!1;return;case 27:case 3:Wn=!0;return;default:an=an.return}}function yr(e){if(e!==an)return!1;if(!Ze)return Gh(e),Ze=!0,!1;var n=e.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||mf(e.type,e.memoizedProps)),a=!a),a&&wt&&la(e),Gh(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));wt=yx(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));wt=yx(e)}else n===27?(n=wt,ga(e.type)?(e=vf,vf=null,wt=e):wt=n):wt=an?el(e.stateNode.nextSibling):null;return!0}function Ia(){wt=an=null,Ze=!1}function Zc(){var e=na;return e!==null&&(Tn===null?Tn=e:Tn.push.apply(Tn,e),na=null),e}function yi(e){na===null?na=[e]:na.push(e)}var Jc=_(null),Ya=null,Tl=null;function aa(e,n,a){C(Jc,n._currentValue),n._currentValue=a}function Dl(e){e._currentValue=Jc.current,Y(Jc)}function Wc(e,n,a){for(;e!==null;){var s=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,s!==null&&(s.childLanes|=n)):s!==null&&(s.childLanes&n)!==n&&(s.childLanes|=n),e===a)break;e=e.return}}function Pc(e,n,a,s){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var p=d.dependencies;if(p!==null){var w=d.child;p=p.firstContext;e:for(;p!==null;){var S=p;p=d;for(var O=0;O<n.length;O++)if(S.context===n[O]){p.lanes|=a,S=p.alternate,S!==null&&(S.lanes|=a),Wc(p.return,a,e),s||(w=null);break e}p=S.next}}else if(d.tag===18){if(w=d.return,w===null)throw Error(i(341));w.lanes|=a,p=w.alternate,p!==null&&(p.lanes|=a),Wc(w,a,e),w=null}else w=d.child;if(w!==null)w.return=d;else for(w=d;w!==null;){if(w===e){w=null;break}if(d=w.sibling,d!==null){d.return=w.return,w=d;break}w=w.return}d=w}}function vr(e,n,a,s){e=null;for(var d=n,p=!1;d!==null;){if(!p){if((d.flags&524288)!==0)p=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var w=d.alternate;if(w===null)throw Error(i(387));if(w=w.memoizedProps,w!==null){var S=d.type;Bn(d.pendingProps.value,w.value)||(e!==null?e.push(S):e=[S])}}else if(d===ce.current){if(w=d.alternate,w===null)throw Error(i(387));w.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Vi):e=[Vi])}d=d.return}e!==null&&Pc(n,e,a,s),n.flags|=262144}function $s(e){for(e=e.firstContext;e!==null;){if(!Bn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Va(e){Ya=e,Tl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function rn(e){return Qh(Ya,e)}function qs(e,n){return Ya===null&&Va(e),Qh(e,n)}function Qh(e,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},Tl===null){if(e===null)throw Error(i(308));Tl=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Tl=Tl.next=n;return a}var Q0=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(a,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(a){return a()})}},K0=t.unstable_scheduleCallback,Z0=t.unstable_NormalPriority,$t={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function eu(){return{controller:new Q0,data:new Map,refCount:0}}function vi(e){e.refCount--,e.refCount===0&&K0(Z0,function(){e.controller.abort()})}var bi=null,tu=0,br=0,wr=null;function J0(e,n){if(bi===null){var a=bi=[];tu=0,br=af(),wr={status:"pending",value:void 0,then:function(s){a.push(s)}}}return tu++,n.then(Kh,Kh),n}function Kh(){if(--tu===0&&bi!==null){wr!==null&&(wr.status="fulfilled");var e=bi;bi=null,br=0,wr=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function W0(e,n){var a=[],s={status:"pending",value:null,reason:null,then:function(d){a.push(d)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var d=0;d<a.length;d++)(0,a[d])(n)},function(d){for(s.status="rejected",s.reason=d,d=0;d<a.length;d++)(0,a[d])(void 0)}),s}var Zh=z.S;z.S=function(e,n){_p=Dt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&J0(e,n),Zh!==null&&Zh(e,n)};var Xa=_(null);function nu(){var e=Xa.current;return e!==null?e:mt.pooledCache}function Is(e,n){n===null?C(Xa,Xa.current):C(Xa,n.pool)}function Jh(){var e=nu();return e===null?null:{parent:$t._currentValue,pool:e}}var kr=Error(i(460)),lu=Error(i(474)),Ys=Error(i(542)),Vs={then:function(){}};function Wh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ph(e,n,a){switch(a=e[a],a===void 0?e.push(n):a!==n&&(n.then(El,El),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,tm(e),e;default:if(typeof n.status=="string")n.then(El,El);else{if(e=mt,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=n,e.status="pending",e.then(function(s){if(n.status==="pending"){var d=n;d.status="fulfilled",d.value=s}},function(s){if(n.status==="pending"){var d=n;d.status="rejected",d.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,tm(e),e}throw Qa=n,kr}}function Ga(e){try{var n=e._init;return n(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Qa=a,kr):a}}var Qa=null;function em(){if(Qa===null)throw Error(i(459));var e=Qa;return Qa=null,e}function tm(e){if(e===kr||e===Ys)throw Error(i(483))}var Sr=null,wi=0;function Xs(e){var n=wi;return wi+=1,Sr===null&&(Sr=[]),Ph(Sr,e,n)}function ki(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Gs(e,n){throw n.$$typeof===v?Error(i(525)):(e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function nm(e){function n(X,H){if(e){var W=X.deletions;W===null?(X.deletions=[H],X.flags|=16):W.push(H)}}function a(X,H){if(!e)return null;for(;H!==null;)n(X,H),H=H.sibling;return null}function s(X){for(var H=new Map;X!==null;)X.key!==null?H.set(X.key,X):H.set(X.index,X),X=X.sibling;return H}function d(X,H){return X=Nl(X,H),X.index=0,X.sibling=null,X}function p(X,H,W){return X.index=W,e?(W=X.alternate,W!==null?(W=W.index,W<H?(X.flags|=67108866,H):W):(X.flags|=67108866,H)):(X.flags|=1048576,H)}function w(X){return e&&X.alternate===null&&(X.flags|=67108866),X}function S(X,H,W,oe){return H===null||H.tag!==6?(H=Vc(W,X.mode,oe),H.return=X,H):(H=d(H,W),H.return=X,H)}function O(X,H,W,oe){var Ne=W.type;return Ne===E?ae(X,H,W.props.children,oe,W.key):H!==null&&(H.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===Q&&Ga(Ne)===H.type)?(H=d(H,W.props),ki(H,W),H.return=X,H):(H=Us(W.type,W.key,W.props,null,X.mode,oe),ki(H,W),H.return=X,H)}function P(X,H,W,oe){return H===null||H.tag!==4||H.stateNode.containerInfo!==W.containerInfo||H.stateNode.implementation!==W.implementation?(H=Xc(W,X.mode,oe),H.return=X,H):(H=d(H,W.children||[]),H.return=X,H)}function ae(X,H,W,oe,Ne){return H===null||H.tag!==7?(H=qa(W,X.mode,oe,Ne),H.return=X,H):(H=d(H,W),H.return=X,H)}function ue(X,H,W){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=Vc(""+H,X.mode,W),H.return=X,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case b:return W=Us(H.type,H.key,H.props,null,X.mode,W),ki(W,H),W.return=X,W;case k:return H=Xc(H,X.mode,W),H.return=X,H;case Q:return H=Ga(H),ue(X,H,W)}if(F(H)||B(H))return H=qa(H,X.mode,W,null),H.return=X,H;if(typeof H.then=="function")return ue(X,Xs(H),W);if(H.$$typeof===$)return ue(X,qs(X,H),W);Gs(X,H)}return null}function ee(X,H,W,oe){var Ne=H!==null?H.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return Ne!==null?null:S(X,H,""+W,oe);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case b:return W.key===Ne?O(X,H,W,oe):null;case k:return W.key===Ne?P(X,H,W,oe):null;case Q:return W=Ga(W),ee(X,H,W,oe)}if(F(W)||B(W))return Ne!==null?null:ae(X,H,W,oe,null);if(typeof W.then=="function")return ee(X,H,Xs(W),oe);if(W.$$typeof===$)return ee(X,H,qs(X,W),oe);Gs(X,W)}return null}function le(X,H,W,oe,Ne){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return X=X.get(W)||null,S(H,X,""+oe,Ne);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:return X=X.get(oe.key===null?W:oe.key)||null,O(H,X,oe,Ne);case k:return X=X.get(oe.key===null?W:oe.key)||null,P(H,X,oe,Ne);case Q:return oe=Ga(oe),le(X,H,W,oe,Ne)}if(F(oe)||B(oe))return X=X.get(W)||null,ae(H,X,oe,Ne,null);if(typeof oe.then=="function")return le(X,H,W,Xs(oe),Ne);if(oe.$$typeof===$)return le(X,H,W,qs(H,oe),Ne);Gs(H,oe)}return null}function be(X,H,W,oe){for(var Ne=null,nt=null,Se=H,Ue=H=0,Ge=null;Se!==null&&Ue<W.length;Ue++){Se.index>Ue?(Ge=Se,Se=null):Ge=Se.sibling;var lt=ee(X,Se,W[Ue],oe);if(lt===null){Se===null&&(Se=Ge);break}e&&Se&&lt.alternate===null&&n(X,Se),H=p(lt,H,Ue),nt===null?Ne=lt:nt.sibling=lt,nt=lt,Se=Ge}if(Ue===W.length)return a(X,Se),Ze&&Al(X,Ue),Ne;if(Se===null){for(;Ue<W.length;Ue++)Se=ue(X,W[Ue],oe),Se!==null&&(H=p(Se,H,Ue),nt===null?Ne=Se:nt.sibling=Se,nt=Se);return Ze&&Al(X,Ue),Ne}for(Se=s(Se);Ue<W.length;Ue++)Ge=le(Se,X,Ue,W[Ue],oe),Ge!==null&&(e&&Ge.alternate!==null&&Se.delete(Ge.key===null?Ue:Ge.key),H=p(Ge,H,Ue),nt===null?Ne=Ge:nt.sibling=Ge,nt=Ge);return e&&Se.forEach(function(ka){return n(X,ka)}),Ze&&Al(X,Ue),Ne}function De(X,H,W,oe){if(W==null)throw Error(i(151));for(var Ne=null,nt=null,Se=H,Ue=H=0,Ge=null,lt=W.next();Se!==null&&!lt.done;Ue++,lt=W.next()){Se.index>Ue?(Ge=Se,Se=null):Ge=Se.sibling;var ka=ee(X,Se,lt.value,oe);if(ka===null){Se===null&&(Se=Ge);break}e&&Se&&ka.alternate===null&&n(X,Se),H=p(ka,H,Ue),nt===null?Ne=ka:nt.sibling=ka,nt=ka,Se=Ge}if(lt.done)return a(X,Se),Ze&&Al(X,Ue),Ne;if(Se===null){for(;!lt.done;Ue++,lt=W.next())lt=ue(X,lt.value,oe),lt!==null&&(H=p(lt,H,Ue),nt===null?Ne=lt:nt.sibling=lt,nt=lt);return Ze&&Al(X,Ue),Ne}for(Se=s(Se);!lt.done;Ue++,lt=W.next())lt=le(Se,X,Ue,lt.value,oe),lt!==null&&(e&&lt.alternate!==null&&Se.delete(lt.key===null?Ue:lt.key),H=p(lt,H,Ue),nt===null?Ne=lt:nt.sibling=lt,nt=lt);return e&&Se.forEach(function(cb){return n(X,cb)}),Ze&&Al(X,Ue),Ne}function ft(X,H,W,oe){if(typeof W=="object"&&W!==null&&W.type===E&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case b:e:{for(var Ne=W.key;H!==null;){if(H.key===Ne){if(Ne=W.type,Ne===E){if(H.tag===7){a(X,H.sibling),oe=d(H,W.props.children),oe.return=X,X=oe;break e}}else if(H.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===Q&&Ga(Ne)===H.type){a(X,H.sibling),oe=d(H,W.props),ki(oe,W),oe.return=X,X=oe;break e}a(X,H);break}else n(X,H);H=H.sibling}W.type===E?(oe=qa(W.props.children,X.mode,oe,W.key),oe.return=X,X=oe):(oe=Us(W.type,W.key,W.props,null,X.mode,oe),ki(oe,W),oe.return=X,X=oe)}return w(X);case k:e:{for(Ne=W.key;H!==null;){if(H.key===Ne)if(H.tag===4&&H.stateNode.containerInfo===W.containerInfo&&H.stateNode.implementation===W.implementation){a(X,H.sibling),oe=d(H,W.children||[]),oe.return=X,X=oe;break e}else{a(X,H);break}else n(X,H);H=H.sibling}oe=Xc(W,X.mode,oe),oe.return=X,X=oe}return w(X);case Q:return W=Ga(W),ft(X,H,W,oe)}if(F(W))return be(X,H,W,oe);if(B(W)){if(Ne=B(W),typeof Ne!="function")throw Error(i(150));return W=Ne.call(W),De(X,H,W,oe)}if(typeof W.then=="function")return ft(X,H,Xs(W),oe);if(W.$$typeof===$)return ft(X,H,qs(X,W),oe);Gs(X,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,H!==null&&H.tag===6?(a(X,H.sibling),oe=d(H,W),oe.return=X,X=oe):(a(X,H),oe=Vc(W,X.mode,oe),oe.return=X,X=oe),w(X)):a(X,H)}return function(X,H,W,oe){try{wi=0;var Ne=ft(X,H,W,oe);return Sr=null,Ne}catch(Se){if(Se===kr||Se===Ys)throw Se;var nt=Ln(29,Se,null,X.mode);return nt.lanes=oe,nt.return=X,nt}finally{}}}var Ka=nm(!0),lm=nm(!1),ra=!1;function au(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ru(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ia(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function sa(e,n,a){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(at&2)!==0){var d=s.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),s.pending=n,n=Fs(e),Hh(e,null,a),n}return Ls(e,s,n,a),Fs(e)}function Si(e,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,a|=s,n.lanes=a,js(e,a)}}function iu(e,n){var a=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var d=null,p=null;if(a=a.firstBaseUpdate,a!==null){do{var w={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};p===null?d=p=w:p=p.next=w,a=a.next}while(a!==null);p===null?d=p=n:p=p.next=n}else d=p=n;a={baseState:s.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:s.shared,callbacks:s.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=n:e.next=n,a.lastBaseUpdate=n}var su=!1;function ji(){if(su){var e=wr;if(e!==null)throw e}}function Ei(e,n,a,s){su=!1;var d=e.updateQueue;ra=!1;var p=d.firstBaseUpdate,w=d.lastBaseUpdate,S=d.shared.pending;if(S!==null){d.shared.pending=null;var O=S,P=O.next;O.next=null,w===null?p=P:w.next=P,w=O;var ae=e.alternate;ae!==null&&(ae=ae.updateQueue,S=ae.lastBaseUpdate,S!==w&&(S===null?ae.firstBaseUpdate=P:S.next=P,ae.lastBaseUpdate=O))}if(p!==null){var ue=d.baseState;w=0,ae=P=O=null,S=p;do{var ee=S.lane&-536870913,le=ee!==S.lane;if(le?(Xe&ee)===ee:(s&ee)===ee){ee!==0&&ee===br&&(su=!0),ae!==null&&(ae=ae.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var be=e,De=S;ee=n;var ft=a;switch(De.tag){case 1:if(be=De.payload,typeof be=="function"){ue=be.call(ft,ue,ee);break e}ue=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=De.payload,ee=typeof be=="function"?be.call(ft,ue,ee):be,ee==null)break e;ue=g({},ue,ee);break e;case 2:ra=!0}}ee=S.callback,ee!==null&&(e.flags|=64,le&&(e.flags|=8192),le=d.callbacks,le===null?d.callbacks=[ee]:le.push(ee))}else le={lane:ee,tag:S.tag,payload:S.payload,callback:S.callback,next:null},ae===null?(P=ae=le,O=ue):ae=ae.next=le,w|=ee;if(S=S.next,S===null){if(S=d.shared.pending,S===null)break;le=S,S=le.next,le.next=null,d.lastBaseUpdate=le,d.shared.pending=null}}while(!0);ae===null&&(O=ue),d.baseState=O,d.firstBaseUpdate=P,d.lastBaseUpdate=ae,p===null&&(d.shared.lanes=0),da|=w,e.lanes=w,e.memoizedState=ue}}function am(e,n){if(typeof e!="function")throw Error(i(191,e));e.call(n)}function rm(e,n){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)am(a[e],n)}var jr=_(null),Qs=_(0);function im(e,n){e=Ul,C(Qs,e),C(jr,n),Ul=e|n.baseLanes}function ou(){C(Qs,Ul),C(jr,jr.current)}function cu(){Ul=Qs.current,Y(jr),Y(Qs)}var Fn=_(null),Pn=null;function oa(e){var n=e.alternate;C(Rt,Rt.current&1),C(Fn,e),Pn===null&&(n===null||jr.current!==null||n.memoizedState!==null)&&(Pn=e)}function uu(e){C(Rt,Rt.current),C(Fn,e),Pn===null&&(Pn=e)}function sm(e){e.tag===22?(C(Rt,Rt.current),C(Fn,e),Pn===null&&(Pn=e)):ca()}function ca(){C(Rt,Rt.current),C(Fn,Fn.current)}function Un(e){Y(Fn),Pn===e&&(Pn=null),Y(Rt)}var Rt=_(0);function Ks(e){for(var n=e;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||gf(a)||yf(a)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var zl=0,Le=null,ct=null,qt=null,Zs=!1,Er=!1,Za=!1,Js=0,Ci=0,Cr=null,P0=0;function zt(){throw Error(i(321))}function fu(e,n){if(n===null)return!1;for(var a=0;a<n.length&&a<e.length;a++)if(!Bn(e[a],n[a]))return!1;return!0}function du(e,n,a,s,d,p){return zl=p,Le=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,z.H=e===null||e.memoizedState===null?Ym:Nu,Za=!1,p=a(s,d),Za=!1,Er&&(p=cm(n,a,s,d)),om(e),p}function om(e){z.H=Ti;var n=ct!==null&&ct.next!==null;if(zl=0,qt=ct=Le=null,Zs=!1,Ci=0,Cr=null,n)throw Error(i(300));e===null||It||(e=e.dependencies,e!==null&&$s(e)&&(It=!0))}function cm(e,n,a,s){Le=e;var d=0;do{if(Er&&(Cr=null),Ci=0,Er=!1,25<=d)throw Error(i(301));if(d+=1,qt=ct=null,e.updateQueue!=null){var p=e.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}z.H=Vm,p=n(a,s)}while(Er);return p}function ev(){var e=z.H,n=e.useState()[0];return n=typeof n.then=="function"?Ni(n):n,e=e.useState()[0],(ct!==null?ct.memoizedState:null)!==e&&(Le.flags|=1024),n}function hu(){var e=Js!==0;return Js=0,e}function mu(e,n,a){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~a}function pu(e){if(Zs){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Zs=!1}zl=0,qt=ct=Le=null,Er=!1,Ci=Js=0,Cr=null}function gn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qt===null?Le.memoizedState=qt=e:qt=qt.next=e,qt}function Ot(){if(ct===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=ct.next;var n=qt===null?Le.memoizedState:qt.next;if(n!==null)qt=n,ct=e;else{if(e===null)throw Le.alternate===null?Error(i(467)):Error(i(310));ct=e,e={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},qt===null?Le.memoizedState=qt=e:qt=qt.next=e}return qt}function Ws(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ni(e){var n=Ci;return Ci+=1,Cr===null&&(Cr=[]),e=Ph(Cr,e,n),n=Le,(qt===null?n.memoizedState:qt.next)===null&&(n=n.alternate,z.H=n===null||n.memoizedState===null?Ym:Nu),e}function Ps(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ni(e);if(e.$$typeof===$)return rn(e)}throw Error(i(438,String(e)))}function xu(e){var n=null,a=Le.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var s=Le.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(d){return d.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=Ws(),Le.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(e),s=0;s<e;s++)a[s]=D;return n.index++,a}function Ml(e,n){return typeof n=="function"?n(e):n}function eo(e){var n=Ot();return gu(n,ct,e)}function gu(e,n,a){var s=e.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=a;var d=e.baseQueue,p=s.pending;if(p!==null){if(d!==null){var w=d.next;d.next=p.next,p.next=w}n.baseQueue=d=p,s.pending=null}if(p=e.baseState,d===null)e.memoizedState=p;else{n=d.next;var S=w=null,O=null,P=n,ae=!1;do{var ue=P.lane&-536870913;if(ue!==P.lane?(Xe&ue)===ue:(zl&ue)===ue){var ee=P.revertLane;if(ee===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),ue===br&&(ae=!0);else if((zl&ee)===ee){P=P.next,ee===br&&(ae=!0);continue}else ue={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},O===null?(S=O=ue,w=p):O=O.next=ue,Le.lanes|=ee,da|=ee;ue=P.action,Za&&a(p,ue),p=P.hasEagerState?P.eagerState:a(p,ue)}else ee={lane:ue,revertLane:P.revertLane,gesture:P.gesture,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},O===null?(S=O=ee,w=p):O=O.next=ee,Le.lanes|=ue,da|=ue;P=P.next}while(P!==null&&P!==n);if(O===null?w=p:O.next=S,!Bn(p,e.memoizedState)&&(It=!0,ae&&(a=wr,a!==null)))throw a;e.memoizedState=p,e.baseState=w,e.baseQueue=O,s.lastRenderedState=p}return d===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function yu(e){var n=Ot(),a=n.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var s=a.dispatch,d=a.pending,p=n.memoizedState;if(d!==null){a.pending=null;var w=d=d.next;do p=e(p,w.action),w=w.next;while(w!==d);Bn(p,n.memoizedState)||(It=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),a.lastRenderedState=p}return[p,s]}function um(e,n,a){var s=Le,d=Ot(),p=Ze;if(p){if(a===void 0)throw Error(i(407));a=a()}else a=n();var w=!Bn((ct||d).memoizedState,a);if(w&&(d.memoizedState=a,It=!0),d=d.queue,wu(hm.bind(null,s,d,e),[e]),d.getSnapshot!==n||w||qt!==null&&qt.memoizedState.tag&1){if(s.flags|=2048,Nr(9,{destroy:void 0},dm.bind(null,s,d,a,n),null),mt===null)throw Error(i(349));p||(zl&127)!==0||fm(s,n,a)}return a}function fm(e,n,a){e.flags|=16384,e={getSnapshot:n,value:a},n=Le.updateQueue,n===null?(n=Ws(),Le.updateQueue=n,n.stores=[e]):(a=n.stores,a===null?n.stores=[e]:a.push(e))}function dm(e,n,a,s){n.value=a,n.getSnapshot=s,mm(n)&&pm(e)}function hm(e,n,a){return a(function(){mm(n)&&pm(e)})}function mm(e){var n=e.getSnapshot;e=e.value;try{var a=n();return!Bn(e,a)}catch{return!0}}function pm(e){var n=$a(e,2);n!==null&&Dn(n,e,2)}function vu(e){var n=gn();if(typeof e=="function"){var a=e;if(e=a(),Za){We(!0);try{a()}finally{We(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ml,lastRenderedState:e},n}function xm(e,n,a,s){return e.baseState=a,gu(e,ct,typeof s=="function"?s:Ml)}function tv(e,n,a,s,d){if(lo(e))throw Error(i(485));if(e=n.action,e!==null){var p={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){p.listeners.push(w)}};z.T!==null?a(!0):p.isTransition=!1,s(p),a=n.pending,a===null?(p.next=n.pending=p,gm(n,p)):(p.next=a.next,n.pending=a.next=p)}}function gm(e,n){var a=n.action,s=n.payload,d=e.state;if(n.isTransition){var p=z.T,w={};z.T=w;try{var S=a(d,s),O=z.S;O!==null&&O(w,S),ym(e,n,S)}catch(P){bu(e,n,P)}finally{p!==null&&w.types!==null&&(p.types=w.types),z.T=p}}else try{p=a(d,s),ym(e,n,p)}catch(P){bu(e,n,P)}}function ym(e,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){vm(e,n,s)},function(s){return bu(e,n,s)}):vm(e,n,a)}function vm(e,n,a){n.status="fulfilled",n.value=a,bm(n),e.state=a,n=e.pending,n!==null&&(a=n.next,a===n?e.pending=null:(a=a.next,n.next=a,gm(e,a)))}function bu(e,n,a){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=a,bm(n),n=n.next;while(n!==s)}e.action=null}function bm(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function wm(e,n){return n}function km(e,n){if(Ze){var a=mt.formState;if(a!==null){e:{var s=Le;if(Ze){if(wt){t:{for(var d=wt,p=Wn;d.nodeType!==8;){if(!p){d=null;break t}if(d=el(d.nextSibling),d===null){d=null;break t}}p=d.data,d=p==="F!"||p==="F"?d:null}if(d){wt=el(d.nextSibling),s=d.data==="F!";break e}}la(s)}s=!1}s&&(n=a[0])}}return a=gn(),a.memoizedState=a.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wm,lastRenderedState:n},a.queue=s,a=$m.bind(null,Le,s),s.dispatch=a,s=vu(!1),p=Cu.bind(null,Le,!1,s.queue),s=gn(),d={state:n,dispatch:null,action:e,pending:null},s.queue=d,a=tv.bind(null,Le,d,p,a),d.dispatch=a,s.memoizedState=e,[n,a,!1]}function Sm(e){var n=Ot();return jm(n,ct,e)}function jm(e,n,a){if(n=gu(e,n,wm)[0],e=eo(Ml)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=Ni(n)}catch(w){throw w===kr?Ys:w}else s=n;n=Ot();var d=n.queue,p=d.dispatch;return a!==n.memoizedState&&(Le.flags|=2048,Nr(9,{destroy:void 0},nv.bind(null,d,a),null)),[s,p,e]}function nv(e,n){e.action=n}function Em(e){var n=Ot(),a=ct;if(a!==null)return jm(n,a,e);Ot(),n=n.memoizedState,a=Ot();var s=a.queue.dispatch;return a.memoizedState=e,[n,s,!1]}function Nr(e,n,a,s){return e={tag:e,create:a,deps:s,inst:n,next:null},n=Le.updateQueue,n===null&&(n=Ws(),Le.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=e.next=e:(s=a.next,a.next=e,e.next=s,n.lastEffect=e),e}function Cm(){return Ot().memoizedState}function to(e,n,a,s){var d=gn();Le.flags|=e,d.memoizedState=Nr(1|n,{destroy:void 0},a,s===void 0?null:s)}function no(e,n,a,s){var d=Ot();s=s===void 0?null:s;var p=d.memoizedState.inst;ct!==null&&s!==null&&fu(s,ct.memoizedState.deps)?d.memoizedState=Nr(n,p,a,s):(Le.flags|=e,d.memoizedState=Nr(1|n,p,a,s))}function Nm(e,n){to(8390656,8,e,n)}function wu(e,n){no(2048,8,e,n)}function lv(e){Le.flags|=4;var n=Le.updateQueue;if(n===null)n=Ws(),Le.updateQueue=n,n.events=[e];else{var a=n.events;a===null?n.events=[e]:a.push(e)}}function Am(e){var n=Ot().memoizedState;return lv({ref:n,nextImpl:e}),function(){if((at&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function Tm(e,n){return no(4,2,e,n)}function Dm(e,n){return no(4,4,e,n)}function zm(e,n){if(typeof n=="function"){e=e();var a=n(e);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Mm(e,n,a){a=a!=null?a.concat([e]):null,no(4,4,zm.bind(null,n,e),a)}function ku(){}function _m(e,n){var a=Ot();n=n===void 0?null:n;var s=a.memoizedState;return n!==null&&fu(n,s[1])?s[0]:(a.memoizedState=[e,n],e)}function Rm(e,n){var a=Ot();n=n===void 0?null:n;var s=a.memoizedState;if(n!==null&&fu(n,s[1]))return s[0];if(s=e(),Za){We(!0);try{e()}finally{We(!1)}}return a.memoizedState=[s,n],s}function Su(e,n,a){return a===void 0||(zl&1073741824)!==0&&(Xe&261930)===0?e.memoizedState=n:(e.memoizedState=a,e=Op(),Le.lanes|=e,da|=e,a)}function Om(e,n,a,s){return Bn(a,n)?a:jr.current!==null?(e=Su(e,a,s),Bn(e,n)||(It=!0),e):(zl&42)===0||(zl&1073741824)!==0&&(Xe&261930)===0?(It=!0,e.memoizedState=a):(e=Op(),Le.lanes|=e,da|=e,n)}function Bm(e,n,a,s,d){var p=q.p;q.p=p!==0&&8>p?p:8;var w=z.T,S={};z.T=S,Cu(e,!1,n,a);try{var O=d(),P=z.S;if(P!==null&&P(S,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var ae=W0(O,s);Ai(e,n,ae,qn(e))}else Ai(e,n,s,qn(e))}catch(ue){Ai(e,n,{then:function(){},status:"rejected",reason:ue},qn())}finally{q.p=p,w!==null&&S.types!==null&&(w.types=S.types),z.T=w}}function av(){}function ju(e,n,a,s){if(e.tag!==5)throw Error(i(476));var d=Lm(e).queue;Bm(e,d,n,Z,a===null?av:function(){return Fm(e),a(s)})}function Lm(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ml,lastRenderedState:Z},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ml,lastRenderedState:a},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Fm(e){var n=Lm(e);n.next===null&&(n=e.alternate.memoizedState),Ai(e,n.next.queue,{},qn())}function Eu(){return rn(Vi)}function Um(){return Ot().memoizedState}function Hm(){return Ot().memoizedState}function rv(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var a=qn();e=ia(a);var s=sa(n,e,a);s!==null&&(Dn(s,n,a),Si(s,n,a)),n={cache:eu()},e.payload=n;return}n=n.return}}function iv(e,n,a){var s=qn();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},lo(e)?qm(n,a):(a=Ic(e,n,a,s),a!==null&&(Dn(a,e,s),Im(a,n,s)))}function $m(e,n,a){var s=qn();Ai(e,n,a,s)}function Ai(e,n,a,s){var d={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(lo(e))qm(n,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=n.lastRenderedReducer,p!==null))try{var w=n.lastRenderedState,S=p(w,a);if(d.hasEagerState=!0,d.eagerState=S,Bn(S,w))return Ls(e,n,d,0),mt===null&&Bs(),!1}catch{}finally{}if(a=Ic(e,n,d,s),a!==null)return Dn(a,e,s),Im(a,n,s),!0}return!1}function Cu(e,n,a,s){if(s={lane:2,revertLane:af(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},lo(e)){if(n)throw Error(i(479))}else n=Ic(e,a,s,2),n!==null&&Dn(n,e,2)}function lo(e){var n=e.alternate;return e===Le||n!==null&&n===Le}function qm(e,n){Er=Zs=!0;var a=e.pending;a===null?n.next=n:(n.next=a.next,a.next=n),e.pending=n}function Im(e,n,a){if((a&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,a|=s,n.lanes=a,js(e,a)}}var Ti={readContext:rn,use:Ps,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useLayoutEffect:zt,useInsertionEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useSyncExternalStore:zt,useId:zt,useHostTransitionStatus:zt,useFormState:zt,useActionState:zt,useOptimistic:zt,useMemoCache:zt,useCacheRefresh:zt};Ti.useEffectEvent=zt;var Ym={readContext:rn,use:Ps,useCallback:function(e,n){return gn().memoizedState=[e,n===void 0?null:n],e},useContext:rn,useEffect:Nm,useImperativeHandle:function(e,n,a){a=a!=null?a.concat([e]):null,to(4194308,4,zm.bind(null,n,e),a)},useLayoutEffect:function(e,n){return to(4194308,4,e,n)},useInsertionEffect:function(e,n){to(4,2,e,n)},useMemo:function(e,n){var a=gn();n=n===void 0?null:n;var s=e();if(Za){We(!0);try{e()}finally{We(!1)}}return a.memoizedState=[s,n],s},useReducer:function(e,n,a){var s=gn();if(a!==void 0){var d=a(n);if(Za){We(!0);try{a(n)}finally{We(!1)}}}else d=n;return s.memoizedState=s.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},s.queue=e,e=e.dispatch=iv.bind(null,Le,e),[s.memoizedState,e]},useRef:function(e){var n=gn();return e={current:e},n.memoizedState=e},useState:function(e){e=vu(e);var n=e.queue,a=$m.bind(null,Le,n);return n.dispatch=a,[e.memoizedState,a]},useDebugValue:ku,useDeferredValue:function(e,n){var a=gn();return Su(a,e,n)},useTransition:function(){var e=vu(!1);return e=Bm.bind(null,Le,e.queue,!0,!1),gn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,a){var s=Le,d=gn();if(Ze){if(a===void 0)throw Error(i(407));a=a()}else{if(a=n(),mt===null)throw Error(i(349));(Xe&127)!==0||fm(s,n,a)}d.memoizedState=a;var p={value:a,getSnapshot:n};return d.queue=p,Nm(hm.bind(null,s,p,e),[e]),s.flags|=2048,Nr(9,{destroy:void 0},dm.bind(null,s,p,a,n),null),a},useId:function(){var e=gn(),n=mt.identifierPrefix;if(Ze){var a=dl,s=fl;a=(s&~(1<<32-Qe(s)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Js++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=P0++,n="_"+n+"r_"+a.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Eu,useFormState:km,useActionState:km,useOptimistic:function(e){var n=gn();n.memoizedState=n.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=Cu.bind(null,Le,!0,a),a.dispatch=n,[e,n]},useMemoCache:xu,useCacheRefresh:function(){return gn().memoizedState=rv.bind(null,Le)},useEffectEvent:function(e){var n=gn(),a={impl:e};return n.memoizedState=a,function(){if((at&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},Nu={readContext:rn,use:Ps,useCallback:_m,useContext:rn,useEffect:wu,useImperativeHandle:Mm,useInsertionEffect:Tm,useLayoutEffect:Dm,useMemo:Rm,useReducer:eo,useRef:Cm,useState:function(){return eo(Ml)},useDebugValue:ku,useDeferredValue:function(e,n){var a=Ot();return Om(a,ct.memoizedState,e,n)},useTransition:function(){var e=eo(Ml)[0],n=Ot().memoizedState;return[typeof e=="boolean"?e:Ni(e),n]},useSyncExternalStore:um,useId:Um,useHostTransitionStatus:Eu,useFormState:Sm,useActionState:Sm,useOptimistic:function(e,n){var a=Ot();return xm(a,ct,e,n)},useMemoCache:xu,useCacheRefresh:Hm};Nu.useEffectEvent=Am;var Vm={readContext:rn,use:Ps,useCallback:_m,useContext:rn,useEffect:wu,useImperativeHandle:Mm,useInsertionEffect:Tm,useLayoutEffect:Dm,useMemo:Rm,useReducer:yu,useRef:Cm,useState:function(){return yu(Ml)},useDebugValue:ku,useDeferredValue:function(e,n){var a=Ot();return ct===null?Su(a,e,n):Om(a,ct.memoizedState,e,n)},useTransition:function(){var e=yu(Ml)[0],n=Ot().memoizedState;return[typeof e=="boolean"?e:Ni(e),n]},useSyncExternalStore:um,useId:Um,useHostTransitionStatus:Eu,useFormState:Em,useActionState:Em,useOptimistic:function(e,n){var a=Ot();return ct!==null?xm(a,ct,e,n):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:xu,useCacheRefresh:Hm};Vm.useEffectEvent=Am;function Au(e,n,a,s){n=e.memoizedState,a=a(s,n),a=a==null?n:g({},n,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Tu={enqueueSetState:function(e,n,a){e=e._reactInternals;var s=qn(),d=ia(s);d.payload=n,a!=null&&(d.callback=a),n=sa(e,d,s),n!==null&&(Dn(n,e,s),Si(n,e,s))},enqueueReplaceState:function(e,n,a){e=e._reactInternals;var s=qn(),d=ia(s);d.tag=1,d.payload=n,a!=null&&(d.callback=a),n=sa(e,d,s),n!==null&&(Dn(n,e,s),Si(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var a=qn(),s=ia(a);s.tag=2,n!=null&&(s.callback=n),n=sa(e,s,a),n!==null&&(Dn(n,e,a),Si(n,e,a))}};function Xm(e,n,a,s,d,p,w){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,p,w):n.prototype&&n.prototype.isPureReactComponent?!pi(a,s)||!pi(d,p):!0}function Gm(e,n,a,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,s),n.state!==e&&Tu.enqueueReplaceState(n,n.state,null)}function Ja(e,n){var a=n;if("ref"in n){a={};for(var s in n)s!=="ref"&&(a[s]=n[s])}if(e=e.defaultProps){a===n&&(a=g({},a));for(var d in e)a[d]===void 0&&(a[d]=e[d])}return a}function Qm(e){Os(e)}function Km(e){console.error(e)}function Zm(e){Os(e)}function ao(e,n){try{var a=e.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function Jm(e,n,a){try{var s=e.onCaughtError;s(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Du(e,n,a){return a=ia(a),a.tag=3,a.payload={element:null},a.callback=function(){ao(e,n)},a}function Wm(e){return e=ia(e),e.tag=3,e}function Pm(e,n,a,s){var d=a.type.getDerivedStateFromError;if(typeof d=="function"){var p=s.value;e.payload=function(){return d(p)},e.callback=function(){Jm(n,a,s)}}var w=a.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(e.callback=function(){Jm(n,a,s),typeof d!="function"&&(ha===null?ha=new Set([this]):ha.add(this));var S=s.stack;this.componentDidCatch(s.value,{componentStack:S!==null?S:""})})}function sv(e,n,a,s,d){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=a.alternate,n!==null&&vr(n,a,d,!0),a=Fn.current,a!==null){switch(a.tag){case 31:case 13:return Pn===null?go():a.alternate===null&&Mt===0&&(Mt=3),a.flags&=-257,a.flags|=65536,a.lanes=d,s===Vs?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([s]):n.add(s),tf(e,s,d)),!1;case 22:return a.flags|=65536,s===Vs?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([s]):a.add(s)),tf(e,s,d)),!1}throw Error(i(435,a.tag))}return tf(e,s,d),go(),!1}if(Ze)return n=Fn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=d,s!==Kc&&(e=Error(i(422),{cause:s}),yi(Kn(e,a)))):(s!==Kc&&(n=Error(i(423),{cause:s}),yi(Kn(n,a))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,s=Kn(s,a),d=Du(e.stateNode,s,d),iu(e,d),Mt!==4&&(Mt=2)),!1;var p=Error(i(520),{cause:s});if(p=Kn(p,a),Li===null?Li=[p]:Li.push(p),Mt!==4&&(Mt=2),n===null)return!0;s=Kn(s,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,e=d&-d,a.lanes|=e,e=Du(a.stateNode,s,e),iu(a,e),!1;case 1:if(n=a.type,p=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(ha===null||!ha.has(p))))return a.flags|=65536,d&=-d,a.lanes|=d,d=Wm(d),Pm(d,e,a,s),iu(a,d),!1}a=a.return}while(a!==null);return!1}var zu=Error(i(461)),It=!1;function sn(e,n,a,s){n.child=e===null?lm(n,null,a,s):Ka(n,e.child,a,s)}function ep(e,n,a,s,d){a=a.render;var p=n.ref;if("ref"in s){var w={};for(var S in s)S!=="ref"&&(w[S]=s[S])}else w=s;return Va(n),s=du(e,n,a,w,p,d),S=hu(),e!==null&&!It?(mu(e,n,d),_l(e,n,d)):(Ze&&S&&Gc(n),n.flags|=1,sn(e,n,s,d),n.child)}function tp(e,n,a,s,d){if(e===null){var p=a.type;return typeof p=="function"&&!Yc(p)&&p.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=p,np(e,n,p,s,d)):(e=Us(a.type,null,s,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(p=e.child,!Uu(e,d)){var w=p.memoizedProps;if(a=a.compare,a=a!==null?a:pi,a(w,s)&&e.ref===n.ref)return _l(e,n,d)}return n.flags|=1,e=Nl(p,s),e.ref=n.ref,e.return=n,n.child=e}function np(e,n,a,s,d){if(e!==null){var p=e.memoizedProps;if(pi(p,s)&&e.ref===n.ref)if(It=!1,n.pendingProps=s=p,Uu(e,d))(e.flags&131072)!==0&&(It=!0);else return n.lanes=e.lanes,_l(e,n,d)}return Mu(e,n,a,s,d)}function lp(e,n,a,s){var d=s.children,p=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((n.flags&128)!==0){if(p=p!==null?p.baseLanes|a:a,e!==null){for(s=n.child=e.child,d=0;s!==null;)d=d|s.lanes|s.childLanes,s=s.sibling;s=d&~p}else s=0,n.child=null;return ap(e,n,p,a,s)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Is(n,p!==null?p.cachePool:null),p!==null?im(n,p):ou(),sm(n);else return s=n.lanes=536870912,ap(e,n,p!==null?p.baseLanes|a:a,a,s)}else p!==null?(Is(n,p.cachePool),im(n,p),ca(),n.memoizedState=null):(e!==null&&Is(n,null),ou(),ca());return sn(e,n,d,a),n.child}function Di(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function ap(e,n,a,s,d){var p=nu();return p=p===null?null:{parent:$t._currentValue,pool:p},n.memoizedState={baseLanes:a,cachePool:p},e!==null&&Is(n,null),ou(),sm(n),e!==null&&vr(e,n,s,!0),n.childLanes=d,null}function ro(e,n){return n=so({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function rp(e,n,a){return Ka(n,e.child,null,a),e=ro(n,n.pendingProps),e.flags|=2,Un(n),n.memoizedState=null,e}function ov(e,n,a){var s=n.pendingProps,d=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Ze){if(s.mode==="hidden")return e=ro(n,s),n.lanes=536870912,Di(null,e);if(uu(n),(e=wt)?(e=gx(e,Wn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ta!==null?{id:fl,overflow:dl}:null,retryLane:536870912,hydrationErrors:null},a=qh(e),a.return=n,n.child=a,an=n,wt=null)):e=null,e===null)throw la(n);return n.lanes=536870912,null}return ro(n,s)}var p=e.memoizedState;if(p!==null){var w=p.dehydrated;if(uu(n),d)if(n.flags&256)n.flags&=-257,n=rp(e,n,a);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(i(558));else if(It||vr(e,n,a,!1),d=(a&e.childLanes)!==0,It||d){if(s=mt,s!==null&&(w=Ra(s,a),w!==0&&w!==p.retryLane))throw p.retryLane=w,$a(e,w),Dn(s,e,w),zu;go(),n=rp(e,n,a)}else e=p.treeContext,wt=el(w.nextSibling),an=n,Ze=!0,na=null,Wn=!1,e!==null&&Vh(n,e),n=ro(n,s),n.flags|=4096;return n}return e=Nl(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function io(e,n){var a=n.ref;if(a===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(e===null||e.ref!==a)&&(n.flags|=4194816)}}function Mu(e,n,a,s,d){return Va(n),a=du(e,n,a,s,void 0,d),s=hu(),e!==null&&!It?(mu(e,n,d),_l(e,n,d)):(Ze&&s&&Gc(n),n.flags|=1,sn(e,n,a,d),n.child)}function ip(e,n,a,s,d,p){return Va(n),n.updateQueue=null,a=cm(n,s,a,d),om(e),s=hu(),e!==null&&!It?(mu(e,n,p),_l(e,n,p)):(Ze&&s&&Gc(n),n.flags|=1,sn(e,n,a,p),n.child)}function sp(e,n,a,s,d){if(Va(n),n.stateNode===null){var p=pr,w=a.contextType;typeof w=="object"&&w!==null&&(p=rn(w)),p=new a(s,p),n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Tu,n.stateNode=p,p._reactInternals=n,p=n.stateNode,p.props=s,p.state=n.memoizedState,p.refs={},au(n),w=a.contextType,p.context=typeof w=="object"&&w!==null?rn(w):pr,p.state=n.memoizedState,w=a.getDerivedStateFromProps,typeof w=="function"&&(Au(n,a,w,s),p.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(w=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),w!==p.state&&Tu.enqueueReplaceState(p,p.state,null),Ei(n,s,p,d),ji(),p.state=n.memoizedState),typeof p.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){p=n.stateNode;var S=n.memoizedProps,O=Ja(a,S);p.props=O;var P=p.context,ae=a.contextType;w=pr,typeof ae=="object"&&ae!==null&&(w=rn(ae));var ue=a.getDerivedStateFromProps;ae=typeof ue=="function"||typeof p.getSnapshotBeforeUpdate=="function",S=n.pendingProps!==S,ae||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(S||P!==w)&&Gm(n,p,s,w),ra=!1;var ee=n.memoizedState;p.state=ee,Ei(n,s,p,d),ji(),P=n.memoizedState,S||ee!==P||ra?(typeof ue=="function"&&(Au(n,a,ue,s),P=n.memoizedState),(O=ra||Xm(n,a,O,s,ee,P,w))?(ae||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(n.flags|=4194308)):(typeof p.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=P),p.props=s,p.state=P,p.context=w,s=O):(typeof p.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{p=n.stateNode,ru(e,n),w=n.memoizedProps,ae=Ja(a,w),p.props=ae,ue=n.pendingProps,ee=p.context,P=a.contextType,O=pr,typeof P=="object"&&P!==null&&(O=rn(P)),S=a.getDerivedStateFromProps,(P=typeof S=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(w!==ue||ee!==O)&&Gm(n,p,s,O),ra=!1,ee=n.memoizedState,p.state=ee,Ei(n,s,p,d),ji();var le=n.memoizedState;w!==ue||ee!==le||ra||e!==null&&e.dependencies!==null&&$s(e.dependencies)?(typeof S=="function"&&(Au(n,a,S,s),le=n.memoizedState),(ae=ra||Xm(n,a,ae,s,ee,le,O)||e!==null&&e.dependencies!==null&&$s(e.dependencies))?(P||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(s,le,O),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(s,le,O)),typeof p.componentDidUpdate=="function"&&(n.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof p.componentDidUpdate!="function"||w===e.memoizedProps&&ee===e.memoizedState||(n.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||w===e.memoizedProps&&ee===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=le),p.props=s,p.state=le,p.context=O,s=ae):(typeof p.componentDidUpdate!="function"||w===e.memoizedProps&&ee===e.memoizedState||(n.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||w===e.memoizedProps&&ee===e.memoizedState||(n.flags|=1024),s=!1)}return p=s,io(e,n),s=(n.flags&128)!==0,p||s?(p=n.stateNode,a=s&&typeof a.getDerivedStateFromError!="function"?null:p.render(),n.flags|=1,e!==null&&s?(n.child=Ka(n,e.child,null,d),n.child=Ka(n,null,a,d)):sn(e,n,a,d),n.memoizedState=p.state,e=n.child):e=_l(e,n,d),e}function op(e,n,a,s){return Ia(),n.flags|=256,sn(e,n,a,s),n.child}var _u={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ru(e){return{baseLanes:e,cachePool:Jh()}}function Ou(e,n,a){return e=e!==null?e.childLanes&~a:0,n&&(e|=$n),e}function cp(e,n,a){var s=n.pendingProps,d=!1,p=(n.flags&128)!==0,w;if((w=p)||(w=e!==null&&e.memoizedState===null?!1:(Rt.current&2)!==0),w&&(d=!0,n.flags&=-129),w=(n.flags&32)!==0,n.flags&=-33,e===null){if(Ze){if(d?oa(n):ca(),(e=wt)?(e=gx(e,Wn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ta!==null?{id:fl,overflow:dl}:null,retryLane:536870912,hydrationErrors:null},a=qh(e),a.return=n,n.child=a,an=n,wt=null)):e=null,e===null)throw la(n);return yf(e)?n.lanes=32:n.lanes=536870912,null}var S=s.children;return s=s.fallback,d?(ca(),d=n.mode,S=so({mode:"hidden",children:S},d),s=qa(s,d,a,null),S.return=n,s.return=n,S.sibling=s,n.child=S,s=n.child,s.memoizedState=Ru(a),s.childLanes=Ou(e,w,a),n.memoizedState=_u,Di(null,s)):(oa(n),Bu(n,S))}var O=e.memoizedState;if(O!==null&&(S=O.dehydrated,S!==null)){if(p)n.flags&256?(oa(n),n.flags&=-257,n=Lu(e,n,a)):n.memoizedState!==null?(ca(),n.child=e.child,n.flags|=128,n=null):(ca(),S=s.fallback,d=n.mode,s=so({mode:"visible",children:s.children},d),S=qa(S,d,a,null),S.flags|=2,s.return=n,S.return=n,s.sibling=S,n.child=s,Ka(n,e.child,null,a),s=n.child,s.memoizedState=Ru(a),s.childLanes=Ou(e,w,a),n.memoizedState=_u,n=Di(null,s));else if(oa(n),yf(S)){if(w=S.nextSibling&&S.nextSibling.dataset,w)var P=w.dgst;w=P,s=Error(i(419)),s.stack="",s.digest=w,yi({value:s,source:null,stack:null}),n=Lu(e,n,a)}else if(It||vr(e,n,a,!1),w=(a&e.childLanes)!==0,It||w){if(w=mt,w!==null&&(s=Ra(w,a),s!==0&&s!==O.retryLane))throw O.retryLane=s,$a(e,s),Dn(w,e,s),zu;gf(S)||go(),n=Lu(e,n,a)}else gf(S)?(n.flags|=192,n.child=e.child,n=null):(e=O.treeContext,wt=el(S.nextSibling),an=n,Ze=!0,na=null,Wn=!1,e!==null&&Vh(n,e),n=Bu(n,s.children),n.flags|=4096);return n}return d?(ca(),S=s.fallback,d=n.mode,O=e.child,P=O.sibling,s=Nl(O,{mode:"hidden",children:s.children}),s.subtreeFlags=O.subtreeFlags&65011712,P!==null?S=Nl(P,S):(S=qa(S,d,a,null),S.flags|=2),S.return=n,s.return=n,s.sibling=S,n.child=s,Di(null,s),s=n.child,S=e.child.memoizedState,S===null?S=Ru(a):(d=S.cachePool,d!==null?(O=$t._currentValue,d=d.parent!==O?{parent:O,pool:O}:d):d=Jh(),S={baseLanes:S.baseLanes|a,cachePool:d}),s.memoizedState=S,s.childLanes=Ou(e,w,a),n.memoizedState=_u,Di(e.child,s)):(oa(n),a=e.child,e=a.sibling,a=Nl(a,{mode:"visible",children:s.children}),a.return=n,a.sibling=null,e!==null&&(w=n.deletions,w===null?(n.deletions=[e],n.flags|=16):w.push(e)),n.child=a,n.memoizedState=null,a)}function Bu(e,n){return n=so({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function so(e,n){return e=Ln(22,e,null,n),e.lanes=0,e}function Lu(e,n,a){return Ka(n,e.child,null,a),e=Bu(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function up(e,n,a){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),Wc(e.return,n,a)}function Fu(e,n,a,s,d,p){var w=e.memoizedState;w===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:d,treeForkCount:p}:(w.isBackwards=n,w.rendering=null,w.renderingStartTime=0,w.last=s,w.tail=a,w.tailMode=d,w.treeForkCount=p)}function fp(e,n,a){var s=n.pendingProps,d=s.revealOrder,p=s.tail;s=s.children;var w=Rt.current,S=(w&2)!==0;if(S?(w=w&1|2,n.flags|=128):w&=1,C(Rt,w),sn(e,n,s,a),s=Ze?gi:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&up(e,a,n);else if(e.tag===19)up(e,a,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(a=n.child,d=null;a!==null;)e=a.alternate,e!==null&&Ks(e)===null&&(d=a),a=a.sibling;a=d,a===null?(d=n.child,n.child=null):(d=a.sibling,a.sibling=null),Fu(n,!1,d,a,p,s);break;case"backwards":case"unstable_legacy-backwards":for(a=null,d=n.child,n.child=null;d!==null;){if(e=d.alternate,e!==null&&Ks(e)===null){n.child=d;break}e=d.sibling,d.sibling=a,a=d,d=e}Fu(n,!0,a,null,p,s);break;case"together":Fu(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function _l(e,n,a){if(e!==null&&(n.dependencies=e.dependencies),da|=n.lanes,(a&n.childLanes)===0)if(e!==null){if(vr(e,n,a,!1),(a&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(i(153));if(n.child!==null){for(e=n.child,a=Nl(e,e.pendingProps),n.child=a,a.return=n;e.sibling!==null;)e=e.sibling,a=a.sibling=Nl(e,e.pendingProps),a.return=n;a.sibling=null}return n.child}function Uu(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&$s(e)))}function cv(e,n,a){switch(n.tag){case 3:ve(n,n.stateNode.containerInfo),aa(n,$t,e.memoizedState.cache),Ia();break;case 27:case 5:tt(n);break;case 4:ve(n,n.stateNode.containerInfo);break;case 10:aa(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,uu(n),null;break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(oa(n),n.flags|=128,null):(a&n.child.childLanes)!==0?cp(e,n,a):(oa(n),e=_l(e,n,a),e!==null?e.sibling:null);oa(n);break;case 19:var d=(e.flags&128)!==0;if(s=(a&n.childLanes)!==0,s||(vr(e,n,a,!1),s=(a&n.childLanes)!==0),d){if(s)return fp(e,n,a);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),C(Rt,Rt.current),s)break;return null;case 22:return n.lanes=0,lp(e,n,a,n.pendingProps);case 24:aa(n,$t,e.memoizedState.cache)}return _l(e,n,a)}function dp(e,n,a){if(e!==null)if(e.memoizedProps!==n.pendingProps)It=!0;else{if(!Uu(e,a)&&(n.flags&128)===0)return It=!1,cv(e,n,a);It=(e.flags&131072)!==0}else It=!1,Ze&&(n.flags&1048576)!==0&&Yh(n,gi,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=Ga(n.elementType),n.type=e,typeof e=="function")Yc(e)?(s=Ja(e,s),n.tag=1,n=sp(null,n,e,s,a)):(n.tag=0,n=Mu(null,n,e,s,a));else{if(e!=null){var d=e.$$typeof;if(d===K){n.tag=11,n=ep(null,n,e,s,a);break e}else if(d===J){n.tag=14,n=tp(null,n,e,s,a);break e}}throw n=te(e)||e,Error(i(306,n,""))}}return n;case 0:return Mu(e,n,n.type,n.pendingProps,a);case 1:return s=n.type,d=Ja(s,n.pendingProps),sp(e,n,s,d,a);case 3:e:{if(ve(n,n.stateNode.containerInfo),e===null)throw Error(i(387));s=n.pendingProps;var p=n.memoizedState;d=p.element,ru(e,n),Ei(n,s,null,a);var w=n.memoizedState;if(s=w.cache,aa(n,$t,s),s!==p.cache&&Pc(n,[$t],a,!0),ji(),s=w.element,p.isDehydrated)if(p={element:s,isDehydrated:!1,cache:w.cache},n.updateQueue.baseState=p,n.memoizedState=p,n.flags&256){n=op(e,n,s,a);break e}else if(s!==d){d=Kn(Error(i(424)),n),yi(d),n=op(e,n,s,a);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(wt=el(e.firstChild),an=n,Ze=!0,na=null,Wn=!0,a=lm(n,null,s,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Ia(),s===d){n=_l(e,n,a);break e}sn(e,n,s,a)}n=n.child}return n;case 26:return io(e,n),e===null?(a=Sx(n.type,null,n.pendingProps,null))?n.memoizedState=a:Ze||(a=n.type,e=n.pendingProps,s=jo(xe.current).createElement(a),s[Jt]=n,s[Ut]=e,on(s,a,e),Ht(s),n.stateNode=s):n.memoizedState=Sx(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return tt(n),e===null&&Ze&&(s=n.stateNode=bx(n.type,n.pendingProps,xe.current),an=n,Wn=!0,d=wt,ga(n.type)?(vf=d,wt=el(s.firstChild)):wt=d),sn(e,n,n.pendingProps.children,a),io(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Ze&&((d=s=wt)&&(s=Uv(s,n.type,n.pendingProps,Wn),s!==null?(n.stateNode=s,an=n,wt=el(s.firstChild),Wn=!1,d=!0):d=!1),d||la(n)),tt(n),d=n.type,p=n.pendingProps,w=e!==null?e.memoizedProps:null,s=p.children,mf(d,p)?s=null:w!==null&&mf(d,w)&&(n.flags|=32),n.memoizedState!==null&&(d=du(e,n,ev,null,null,a),Vi._currentValue=d),io(e,n),sn(e,n,s,a),n.child;case 6:return e===null&&Ze&&((e=a=wt)&&(a=Hv(a,n.pendingProps,Wn),a!==null?(n.stateNode=a,an=n,wt=null,e=!0):e=!1),e||la(n)),null;case 13:return cp(e,n,a);case 4:return ve(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=Ka(n,null,s,a):sn(e,n,s,a),n.child;case 11:return ep(e,n,n.type,n.pendingProps,a);case 7:return sn(e,n,n.pendingProps,a),n.child;case 8:return sn(e,n,n.pendingProps.children,a),n.child;case 12:return sn(e,n,n.pendingProps.children,a),n.child;case 10:return s=n.pendingProps,aa(n,n.type,s.value),sn(e,n,s.children,a),n.child;case 9:return d=n.type._context,s=n.pendingProps.children,Va(n),d=rn(d),s=s(d),n.flags|=1,sn(e,n,s,a),n.child;case 14:return tp(e,n,n.type,n.pendingProps,a);case 15:return np(e,n,n.type,n.pendingProps,a);case 19:return fp(e,n,a);case 31:return ov(e,n,a);case 22:return lp(e,n,a,n.pendingProps);case 24:return Va(n),s=rn($t),e===null?(d=nu(),d===null&&(d=mt,p=eu(),d.pooledCache=p,p.refCount++,p!==null&&(d.pooledCacheLanes|=a),d=p),n.memoizedState={parent:s,cache:d},au(n),aa(n,$t,d)):((e.lanes&a)!==0&&(ru(e,n),Ei(n,null,null,a),ji()),d=e.memoizedState,p=n.memoizedState,d.parent!==s?(d={parent:s,cache:s},n.memoizedState=d,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=d),aa(n,$t,s)):(s=p.cache,aa(n,$t,s),s!==d.cache&&Pc(n,[$t],a,!0))),sn(e,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function Rl(e){e.flags|=4}function Hu(e,n,a,s,d){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(Up())e.flags|=8192;else throw Qa=Vs,lu}else e.flags&=-16777217}function hp(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ax(n))if(Up())e.flags|=8192;else throw Qa=Vs,lu}function oo(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Ss():536870912,e.lanes|=n,zr|=n)}function zi(e,n){if(!Ze)switch(e.tailMode){case"hidden":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function kt(e){var n=e.alternate!==null&&e.alternate.child===e.child,a=0,s=0;if(n)for(var d=e.child;d!==null;)a|=d.lanes|d.childLanes,s|=d.subtreeFlags&65011712,s|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)a|=d.lanes|d.childLanes,s|=d.subtreeFlags,s|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=s,e.childLanes=a,n}function uv(e,n,a){var s=n.pendingProps;switch(Qc(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(n),null;case 1:return kt(n),null;case 3:return a=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Dl($t),je(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(yr(n)?Rl(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Zc())),kt(n),null;case 26:var d=n.type,p=n.memoizedState;return e===null?(Rl(n),p!==null?(kt(n),hp(n,p)):(kt(n),Hu(n,d,null,s,a))):p?p!==e.memoizedState?(Rl(n),kt(n),hp(n,p)):(kt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&Rl(n),kt(n),Hu(n,d,e,s,a)),null;case 27:if(xt(n),a=xe.current,d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Rl(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return kt(n),null}e=de.current,yr(n)?Xh(n):(e=bx(d,s,a),n.stateNode=e,Rl(n))}return kt(n),null;case 5:if(xt(n),d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Rl(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return kt(n),null}if(p=de.current,yr(n))Xh(n);else{var w=jo(xe.current);switch(p){case 1:p=w.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:p=w.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":p=w.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":p=w.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":p=w.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof s.is=="string"?w.createElement("select",{is:s.is}):w.createElement("select"),s.multiple?p.multiple=!0:s.size&&(p.size=s.size);break;default:p=typeof s.is=="string"?w.createElement(d,{is:s.is}):w.createElement(d)}}p[Jt]=n,p[Ut]=s;e:for(w=n.child;w!==null;){if(w.tag===5||w.tag===6)p.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===n)break e;for(;w.sibling===null;){if(w.return===null||w.return===n)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}n.stateNode=p;e:switch(on(p,d,s),d){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Rl(n)}}return kt(n),Hu(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,a),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Rl(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(i(166));if(e=xe.current,yr(n)){if(e=n.stateNode,a=n.memoizedProps,s=null,d=an,d!==null)switch(d.tag){case 27:case 5:s=d.memoizedProps}e[Jt]=n,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||cx(e.nodeValue,a)),e||la(n,!0)}else e=jo(e).createTextNode(s),e[Jt]=n,n.stateNode=e}return kt(n),null;case 31:if(a=n.memoizedState,e===null||e.memoizedState!==null){if(s=yr(n),a!==null){if(e===null){if(!s)throw Error(i(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[Jt]=n}else Ia(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;kt(n),e=!1}else a=Zc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return n.flags&256?(Un(n),n):(Un(n),null);if((n.flags&128)!==0)throw Error(i(558))}return kt(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=yr(n),s!==null&&s.dehydrated!==null){if(e===null){if(!d)throw Error(i(318));if(d=n.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(i(317));d[Jt]=n}else Ia(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;kt(n),d=!1}else d=Zc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return n.flags&256?(Un(n),n):(Un(n),null)}return Un(n),(n.flags&128)!==0?(n.lanes=a,n):(a=s!==null,e=e!==null&&e.memoizedState!==null,a&&(s=n.child,d=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(d=s.alternate.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==d&&(s.flags|=2048)),a!==e&&a&&(n.child.flags|=8192),oo(n,n.updateQueue),kt(n),null);case 4:return je(),e===null&&cf(n.stateNode.containerInfo),kt(n),null;case 10:return Dl(n.type),kt(n),null;case 19:if(Y(Rt),s=n.memoizedState,s===null)return kt(n),null;if(d=(n.flags&128)!==0,p=s.rendering,p===null)if(d)zi(s,!1);else{if(Mt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(p=Ks(e),p!==null){for(n.flags|=128,zi(s,!1),e=p.updateQueue,n.updateQueue=e,oo(n,e),n.subtreeFlags=0,e=a,a=n.child;a!==null;)$h(a,e),a=a.sibling;return C(Rt,Rt.current&1|2),Ze&&Al(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&Dt()>mo&&(n.flags|=128,d=!0,zi(s,!1),n.lanes=4194304)}else{if(!d)if(e=Ks(p),e!==null){if(n.flags|=128,d=!0,e=e.updateQueue,n.updateQueue=e,oo(n,e),zi(s,!0),s.tail===null&&s.tailMode==="hidden"&&!p.alternate&&!Ze)return kt(n),null}else 2*Dt()-s.renderingStartTime>mo&&a!==536870912&&(n.flags|=128,d=!0,zi(s,!1),n.lanes=4194304);s.isBackwards?(p.sibling=n.child,n.child=p):(e=s.last,e!==null?e.sibling=p:n.child=p,s.last=p)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Dt(),e.sibling=null,a=Rt.current,C(Rt,d?a&1|2:a&1),Ze&&Al(n,s.treeForkCount),e):(kt(n),null);case 22:case 23:return Un(n),cu(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(a&536870912)!==0&&(n.flags&128)===0&&(kt(n),n.subtreeFlags&6&&(n.flags|=8192)):kt(n),a=n.updateQueue,a!==null&&oo(n,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==a&&(n.flags|=2048),e!==null&&Y(Xa),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),Dl($t),kt(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function fv(e,n){switch(Qc(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Dl($t),je(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return xt(n),null;case 31:if(n.memoizedState!==null){if(Un(n),n.alternate===null)throw Error(i(340));Ia()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Un(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Ia()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Y(Rt),null;case 4:return je(),null;case 10:return Dl(n.type),null;case 22:case 23:return Un(n),cu(),e!==null&&Y(Xa),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Dl($t),null;case 25:return null;default:return null}}function mp(e,n){switch(Qc(n),n.tag){case 3:Dl($t),je();break;case 26:case 27:case 5:xt(n);break;case 4:je();break;case 31:n.memoizedState!==null&&Un(n);break;case 13:Un(n);break;case 19:Y(Rt);break;case 10:Dl(n.type);break;case 22:case 23:Un(n),cu(),e!==null&&Y(Xa);break;case 24:Dl($t)}}function Mi(e,n){try{var a=n.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var d=s.next;a=d;do{if((a.tag&e)===e){s=void 0;var p=a.create,w=a.inst;s=p(),w.destroy=s}a=a.next}while(a!==d)}}catch(S){ot(n,n.return,S)}}function ua(e,n,a){try{var s=n.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var p=d.next;s=p;do{if((s.tag&e)===e){var w=s.inst,S=w.destroy;if(S!==void 0){w.destroy=void 0,d=n;var O=a,P=S;try{P()}catch(ae){ot(d,O,ae)}}}s=s.next}while(s!==p)}}catch(ae){ot(n,n.return,ae)}}function pp(e){var n=e.updateQueue;if(n!==null){var a=e.stateNode;try{rm(n,a)}catch(s){ot(e,e.return,s)}}}function xp(e,n,a){a.props=Ja(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){ot(e,n,s)}}function _i(e,n){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof a=="function"?e.refCleanup=a(s):a.current=s}}catch(d){ot(e,n,d)}}function hl(e,n){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(d){ot(e,n,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(d){ot(e,n,d)}else a.current=null}function gp(e){var n=e.type,a=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break e;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(d){ot(e,e.return,d)}}function $u(e,n,a){try{var s=e.stateNode;_v(s,e.type,a,n),s[Ut]=n}catch(d){ot(e,e.return,d)}}function yp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ga(e.type)||e.tag===4}function qu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yp(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&&ga(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 Iu(e,n,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(e),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=El));else if(s!==4&&(s===27&&ga(e.type)&&(a=e.stateNode,n=null),e=e.child,e!==null))for(Iu(e,n,a),e=e.sibling;e!==null;)Iu(e,n,a),e=e.sibling}function co(e,n,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?a.insertBefore(e,n):a.appendChild(e);else if(s!==4&&(s===27&&ga(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(co(e,n,a),e=e.sibling;e!==null;)co(e,n,a),e=e.sibling}function vp(e){var n=e.stateNode,a=e.memoizedProps;try{for(var s=e.type,d=n.attributes;d.length;)n.removeAttributeNode(d[0]);on(n,s,a),n[Jt]=e,n[Ut]=a}catch(p){ot(e,e.return,p)}}var Ol=!1,Yt=!1,Yu=!1,bp=typeof WeakSet=="function"?WeakSet:Set,nn=null;function dv(e,n){if(e=e.containerInfo,df=zo,e=Mh(e),Lc(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var d=s.anchorOffset,p=s.focusNode;s=s.focusOffset;try{a.nodeType,p.nodeType}catch{a=null;break e}var w=0,S=-1,O=-1,P=0,ae=0,ue=e,ee=null;t:for(;;){for(var le;ue!==a||d!==0&&ue.nodeType!==3||(S=w+d),ue!==p||s!==0&&ue.nodeType!==3||(O=w+s),ue.nodeType===3&&(w+=ue.nodeValue.length),(le=ue.firstChild)!==null;)ee=ue,ue=le;for(;;){if(ue===e)break t;if(ee===a&&++P===d&&(S=w),ee===p&&++ae===s&&(O=w),(le=ue.nextSibling)!==null)break;ue=ee,ee=ue.parentNode}ue=le}a=S===-1||O===-1?null:{start:S,end:O}}else a=null}a=a||{start:0,end:0}}else a=null;for(hf={focusedElem:e,selectionRange:a},zo=!1,nn=n;nn!==null;)if(n=nn,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,nn=e;else for(;nn!==null;){switch(n=nn,p=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)d=e[a],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&p!==null){e=void 0,a=n,d=p.memoizedProps,p=p.memoizedState,s=a.stateNode;try{var be=Ja(a.type,d);e=s.getSnapshotBeforeUpdate(be,p),s.__reactInternalSnapshotBeforeUpdate=e}catch(De){ot(a,a.return,De)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,a=e.nodeType,a===9)xf(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":xf(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(i(163))}if(e=n.sibling,e!==null){e.return=n.return,nn=e;break}nn=n.return}}function wp(e,n,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:Ll(e,a),s&4&&Mi(5,a);break;case 1:if(Ll(e,a),s&4)if(e=a.stateNode,n===null)try{e.componentDidMount()}catch(w){ot(a,a.return,w)}else{var d=Ja(a.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(d,n,e.__reactInternalSnapshotBeforeUpdate)}catch(w){ot(a,a.return,w)}}s&64&&pp(a),s&512&&_i(a,a.return);break;case 3:if(Ll(e,a),s&64&&(e=a.updateQueue,e!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{rm(e,n)}catch(w){ot(a,a.return,w)}}break;case 27:n===null&&s&4&&vp(a);case 26:case 5:Ll(e,a),n===null&&s&4&&gp(a),s&512&&_i(a,a.return);break;case 12:Ll(e,a);break;case 31:Ll(e,a),s&4&&jp(e,a);break;case 13:Ll(e,a),s&4&&Ep(e,a),s&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=wv.bind(null,a),$v(e,a))));break;case 22:if(s=a.memoizedState!==null||Ol,!s){n=n!==null&&n.memoizedState!==null||Yt,d=Ol;var p=Yt;Ol=s,(Yt=n)&&!p?Fl(e,a,(a.subtreeFlags&8772)!==0):Ll(e,a),Ol=d,Yt=p}break;case 30:break;default:Ll(e,a)}}function kp(e){var n=e.alternate;n!==null&&(e.alternate=null,kp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&ai(n)),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 Et=null,Cn=!1;function Bl(e,n,a){for(a=a.child;a!==null;)Sp(e,n,a),a=a.sibling}function Sp(e,n,a){if(he&&typeof he.onCommitFiberUnmount=="function")try{he.onCommitFiberUnmount(it,a)}catch{}switch(a.tag){case 26:Yt||hl(a,n),Bl(e,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Yt||hl(a,n);var s=Et,d=Cn;ga(a.type)&&(Et=a.stateNode,Cn=!1),Bl(e,n,a),qi(a.stateNode),Et=s,Cn=d;break;case 5:Yt||hl(a,n);case 6:if(s=Et,d=Cn,Et=null,Bl(e,n,a),Et=s,Cn=d,Et!==null)if(Cn)try{(Et.nodeType===9?Et.body:Et.nodeName==="HTML"?Et.ownerDocument.body:Et).removeChild(a.stateNode)}catch(p){ot(a,n,p)}else try{Et.removeChild(a.stateNode)}catch(p){ot(a,n,p)}break;case 18:Et!==null&&(Cn?(e=Et,px(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Ur(e)):px(Et,a.stateNode));break;case 4:s=Et,d=Cn,Et=a.stateNode.containerInfo,Cn=!0,Bl(e,n,a),Et=s,Cn=d;break;case 0:case 11:case 14:case 15:ua(2,a,n),Yt||ua(4,a,n),Bl(e,n,a);break;case 1:Yt||(hl(a,n),s=a.stateNode,typeof s.componentWillUnmount=="function"&&xp(a,n,s)),Bl(e,n,a);break;case 21:Bl(e,n,a);break;case 22:Yt=(s=Yt)||a.memoizedState!==null,Bl(e,n,a),Yt=s;break;default:Bl(e,n,a)}}function jp(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ur(e)}catch(a){ot(n,n.return,a)}}}function Ep(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ur(e)}catch(a){ot(n,n.return,a)}}function hv(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new bp),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new bp),n;default:throw Error(i(435,e.tag))}}function uo(e,n){var a=hv(e);n.forEach(function(s){if(!a.has(s)){a.add(s);var d=kv.bind(null,e,s);s.then(d,d)}})}function Nn(e,n){var a=n.deletions;if(a!==null)for(var s=0;s<a.length;s++){var d=a[s],p=e,w=n,S=w;e:for(;S!==null;){switch(S.tag){case 27:if(ga(S.type)){Et=S.stateNode,Cn=!1;break e}break;case 5:Et=S.stateNode,Cn=!1;break e;case 3:case 4:Et=S.stateNode.containerInfo,Cn=!0;break e}S=S.return}if(Et===null)throw Error(i(160));Sp(p,w,d),Et=null,Cn=!1,p=d.alternate,p!==null&&(p.return=null),d.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Cp(n,e),n=n.sibling}var sl=null;function Cp(e,n){var a=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Nn(n,e),An(e),s&4&&(ua(3,e,e.return),Mi(3,e),ua(5,e,e.return));break;case 1:Nn(n,e),An(e),s&512&&(Yt||a===null||hl(a,a.return)),s&64&&Ol&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?s:a.concat(s))));break;case 26:var d=sl;if(Nn(n,e),An(e),s&512&&(Yt||a===null||hl(a,a.return)),s&4){var p=a!==null?a.memoizedState:null;if(s=e.memoizedState,a===null)if(s===null)if(e.stateNode===null){e:{s=e.type,a=e.memoizedProps,d=d.ownerDocument||d;t:switch(s){case"title":p=d.getElementsByTagName("title")[0],(!p||p[wl]||p[Jt]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=d.createElement(s),d.head.insertBefore(p,d.querySelector("head > title"))),on(p,s,a),p[Jt]=e,Ht(p),s=p;break e;case"link":var w=Cx("link","href",d).get(s+(a.href||""));if(w){for(var S=0;S<w.length;S++)if(p=w[S],p.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&p.getAttribute("rel")===(a.rel==null?null:a.rel)&&p.getAttribute("title")===(a.title==null?null:a.title)&&p.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){w.splice(S,1);break t}}p=d.createElement(s),on(p,s,a),d.head.appendChild(p);break;case"meta":if(w=Cx("meta","content",d).get(s+(a.content||""))){for(S=0;S<w.length;S++)if(p=w[S],p.getAttribute("content")===(a.content==null?null:""+a.content)&&p.getAttribute("name")===(a.name==null?null:a.name)&&p.getAttribute("property")===(a.property==null?null:a.property)&&p.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&p.getAttribute("charset")===(a.charSet==null?null:a.charSet)){w.splice(S,1);break t}}p=d.createElement(s),on(p,s,a),d.head.appendChild(p);break;default:throw Error(i(468,s))}p[Jt]=e,Ht(p),s=p}e.stateNode=s}else Nx(d,e.type,e.stateNode);else e.stateNode=Ex(d,s,e.memoizedProps);else p!==s?(p===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):p.count--,s===null?Nx(d,e.type,e.stateNode):Ex(d,s,e.memoizedProps)):s===null&&e.stateNode!==null&&$u(e,e.memoizedProps,a.memoizedProps)}break;case 27:Nn(n,e),An(e),s&512&&(Yt||a===null||hl(a,a.return)),a!==null&&s&4&&$u(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Nn(n,e),An(e),s&512&&(Yt||a===null||hl(a,a.return)),e.flags&32){d=e.stateNode;try{qe(d,"")}catch(be){ot(e,e.return,be)}}s&4&&e.stateNode!=null&&(d=e.memoizedProps,$u(e,d,a!==null?a.memoizedProps:d)),s&1024&&(Yu=!0);break;case 6:if(Nn(n,e),An(e),s&4){if(e.stateNode===null)throw Error(i(162));s=e.memoizedProps,a=e.stateNode;try{a.nodeValue=s}catch(be){ot(e,e.return,be)}}break;case 3:if(No=null,d=sl,sl=Eo(n.containerInfo),Nn(n,e),sl=d,An(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{Ur(n.containerInfo)}catch(be){ot(e,e.return,be)}Yu&&(Yu=!1,Np(e));break;case 4:s=sl,sl=Eo(e.stateNode.containerInfo),Nn(n,e),An(e),sl=s;break;case 12:Nn(n,e),An(e);break;case 31:Nn(n,e),An(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,uo(e,s)));break;case 13:Nn(n,e),An(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(ho=Dt()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,uo(e,s)));break;case 22:d=e.memoizedState!==null;var O=a!==null&&a.memoizedState!==null,P=Ol,ae=Yt;if(Ol=P||d,Yt=ae||O,Nn(n,e),Yt=ae,Ol=P,An(e),s&8192)e:for(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,d&&(a===null||O||Ol||Yt||Wa(e)),a=null,n=e;;){if(n.tag===5||n.tag===26){if(a===null){O=a=n;try{if(p=O.stateNode,d)w=p.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{S=O.stateNode;var ue=O.memoizedProps.style,ee=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;S.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(be){ot(O,O.return,be)}}}else if(n.tag===6){if(a===null){O=n;try{O.stateNode.nodeValue=d?"":O.memoizedProps}catch(be){ot(O,O.return,be)}}}else if(n.tag===18){if(a===null){O=n;try{var le=O.stateNode;d?xx(le,!0):xx(O.stateNode,!1)}catch(be){ot(O,O.return,be)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}s&4&&(s=e.updateQueue,s!==null&&(a=s.retryQueue,a!==null&&(s.retryQueue=null,uo(e,a))));break;case 19:Nn(n,e),An(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,uo(e,s)));break;case 30:break;case 21:break;default:Nn(n,e),An(e)}}function An(e){var n=e.flags;if(n&2){try{for(var a,s=e.return;s!==null;){if(yp(s)){a=s;break}s=s.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var d=a.stateNode,p=qu(e);co(e,p,d);break;case 5:var w=a.stateNode;a.flags&32&&(qe(w,""),a.flags&=-33);var S=qu(e);co(e,S,w);break;case 3:case 4:var O=a.stateNode.containerInfo,P=qu(e);Iu(e,P,O);break;default:throw Error(i(161))}}catch(ae){ot(e,e.return,ae)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Np(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Np(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Ll(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)wp(e,n.alternate,n),n=n.sibling}function Wa(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:ua(4,n,n.return),Wa(n);break;case 1:hl(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&xp(n,n.return,a),Wa(n);break;case 27:qi(n.stateNode);case 26:case 5:hl(n,n.return),Wa(n);break;case 22:n.memoizedState===null&&Wa(n);break;case 30:Wa(n);break;default:Wa(n)}e=e.sibling}}function Fl(e,n,a){for(a=a&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,d=e,p=n,w=p.flags;switch(p.tag){case 0:case 11:case 15:Fl(d,p,a),Mi(4,p);break;case 1:if(Fl(d,p,a),s=p,d=s.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(P){ot(s,s.return,P)}if(s=p,d=s.updateQueue,d!==null){var S=s.stateNode;try{var O=d.shared.hiddenCallbacks;if(O!==null)for(d.shared.hiddenCallbacks=null,d=0;d<O.length;d++)am(O[d],S)}catch(P){ot(s,s.return,P)}}a&&w&64&&pp(p),_i(p,p.return);break;case 27:vp(p);case 26:case 5:Fl(d,p,a),a&&s===null&&w&4&&gp(p),_i(p,p.return);break;case 12:Fl(d,p,a);break;case 31:Fl(d,p,a),a&&w&4&&jp(d,p);break;case 13:Fl(d,p,a),a&&w&4&&Ep(d,p);break;case 22:p.memoizedState===null&&Fl(d,p,a),_i(p,p.return);break;case 30:break;default:Fl(d,p,a)}n=n.sibling}}function Vu(e,n){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&vi(a))}function Xu(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&vi(e))}function ol(e,n,a,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Ap(e,n,a,s),n=n.sibling}function Ap(e,n,a,s){var d=n.flags;switch(n.tag){case 0:case 11:case 15:ol(e,n,a,s),d&2048&&Mi(9,n);break;case 1:ol(e,n,a,s);break;case 3:ol(e,n,a,s),d&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&vi(e)));break;case 12:if(d&2048){ol(e,n,a,s),e=n.stateNode;try{var p=n.memoizedProps,w=p.id,S=p.onPostCommit;typeof S=="function"&&S(w,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(O){ot(n,n.return,O)}}else ol(e,n,a,s);break;case 31:ol(e,n,a,s);break;case 13:ol(e,n,a,s);break;case 23:break;case 22:p=n.stateNode,w=n.alternate,n.memoizedState!==null?p._visibility&2?ol(e,n,a,s):Ri(e,n):p._visibility&2?ol(e,n,a,s):(p._visibility|=2,Ar(e,n,a,s,(n.subtreeFlags&10256)!==0||!1)),d&2048&&Vu(w,n);break;case 24:ol(e,n,a,s),d&2048&&Xu(n.alternate,n);break;default:ol(e,n,a,s)}}function Ar(e,n,a,s,d){for(d=d&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var p=e,w=n,S=a,O=s,P=w.flags;switch(w.tag){case 0:case 11:case 15:Ar(p,w,S,O,d),Mi(8,w);break;case 23:break;case 22:var ae=w.stateNode;w.memoizedState!==null?ae._visibility&2?Ar(p,w,S,O,d):Ri(p,w):(ae._visibility|=2,Ar(p,w,S,O,d)),d&&P&2048&&Vu(w.alternate,w);break;case 24:Ar(p,w,S,O,d),d&&P&2048&&Xu(w.alternate,w);break;default:Ar(p,w,S,O,d)}n=n.sibling}}function Ri(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=e,s=n,d=s.flags;switch(s.tag){case 22:Ri(a,s),d&2048&&Vu(s.alternate,s);break;case 24:Ri(a,s),d&2048&&Xu(s.alternate,s);break;default:Ri(a,s)}n=n.sibling}}var Oi=8192;function Tr(e,n,a){if(e.subtreeFlags&Oi)for(e=e.child;e!==null;)Tp(e,n,a),e=e.sibling}function Tp(e,n,a){switch(e.tag){case 26:Tr(e,n,a),e.flags&Oi&&e.memoizedState!==null&&Pv(a,sl,e.memoizedState,e.memoizedProps);break;case 5:Tr(e,n,a);break;case 3:case 4:var s=sl;sl=Eo(e.stateNode.containerInfo),Tr(e,n,a),sl=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Oi,Oi=16777216,Tr(e,n,a),Oi=s):Tr(e,n,a));break;default:Tr(e,n,a)}}function Dp(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Bi(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var s=n[a];nn=s,Mp(s,e)}Dp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)zp(e),e=e.sibling}function zp(e){switch(e.tag){case 0:case 11:case 15:Bi(e),e.flags&2048&&ua(9,e,e.return);break;case 3:Bi(e);break;case 12:Bi(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,fo(e)):Bi(e);break;default:Bi(e)}}function fo(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var s=n[a];nn=s,Mp(s,e)}Dp(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:ua(8,n,n.return),fo(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,fo(n));break;default:fo(n)}e=e.sibling}}function Mp(e,n){for(;nn!==null;){var a=nn;switch(a.tag){case 0:case 11:case 15:ua(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var s=a.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:vi(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,nn=s;else e:for(a=e;nn!==null;){s=nn;var d=s.sibling,p=s.return;if(kp(s),s===a){nn=null;break e}if(d!==null){d.return=p,nn=d;break e}nn=p}}}var mv={getCacheForType:function(e){var n=rn($t),a=n.data.get(e);return a===void 0&&(a=e(),n.data.set(e,a)),a},cacheSignal:function(){return rn($t).controller.signal}},pv=typeof WeakMap=="function"?WeakMap:Map,at=0,mt=null,Ie=null,Xe=0,st=0,Hn=null,fa=!1,Dr=!1,Gu=!1,Ul=0,Mt=0,da=0,Pa=0,Qu=0,$n=0,zr=0,Li=null,Tn=null,Ku=!1,ho=0,_p=0,mo=1/0,po=null,ha=null,Wt=0,ma=null,Mr=null,Hl=0,Zu=0,Ju=null,Rp=null,Fi=0,Wu=null;function qn(){return(at&2)!==0&&Xe!==0?Xe&-Xe:z.T!==null?af():al()}function Op(){if($n===0)if((Xe&536870912)===0||Ze){var e=Yl;Yl<<=1,(Yl&3932160)===0&&(Yl=262144),$n=e}else $n=536870912;return e=Fn.current,e!==null&&(e.flags|=32),$n}function Dn(e,n,a){(e===mt&&(st===2||st===9)||e.cancelPendingCommit!==null)&&(_r(e,0),pa(e,Xe,$n,!1)),fn(e,a),((at&2)===0||e!==mt)&&(e===mt&&((at&2)===0&&(Pa|=a),Mt===4&&pa(e,Xe,$n,!1)),ml(e))}function Bp(e,n,a){if((at&6)!==0)throw Error(i(327));var s=!a&&(n&127)===0&&(n&e.expiredLanes)===0||Xl(e,n),d=s?yv(e,n):ef(e,n,!0),p=s;do{if(d===0){Dr&&!s&&pa(e,n,0,!1);break}else{if(a=e.current.alternate,p&&!xv(a)){d=ef(e,n,!1),p=!1;continue}if(d===2){if(p=n,e.errorRecoveryDisabledLanes&p)var w=0;else w=e.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){n=w;e:{var S=e;d=Li;var O=S.current.memoizedState.isDehydrated;if(O&&(_r(S,w).flags|=256),w=ef(S,w,!1),w!==2){if(Gu&&!O){S.errorRecoveryDisabledLanes|=p,Pa|=p,d=4;break e}p=Tn,Tn=d,p!==null&&(Tn===null?Tn=p:Tn.push.apply(Tn,p))}d=w}if(p=!1,d!==2)continue}}if(d===1){_r(e,0),pa(e,n,0,!0);break}e:{switch(s=e,p=d,p){case 0:case 1:throw Error(i(345));case 4:if((n&4194048)!==n)break;case 6:pa(s,n,$n,!fa);break e;case 2:Tn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(d=ho+300-Dt(),10<d)){if(pa(s,n,$n,!fa),Vl(s,0,!0)!==0)break e;Hl=n,s.timeoutHandle=hx(Lp.bind(null,s,a,Tn,po,Ku,n,$n,Pa,zr,fa,p,"Throttled",-0,0),d);break e}Lp(s,a,Tn,po,Ku,n,$n,Pa,zr,fa,p,null,-0,0)}}break}while(!0);ml(e)}function Lp(e,n,a,s,d,p,w,S,O,P,ae,ue,ee,le){if(e.timeoutHandle=-1,ue=n.subtreeFlags,ue&8192||(ue&16785408)===16785408){ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:El},Tp(n,p,ue);var be=(p&62914560)===p?ho-Dt():(p&4194048)===p?_p-Dt():0;if(be=eb(ue,be),be!==null){Hl=p,e.cancelPendingCommit=be(Vp.bind(null,e,n,p,a,s,d,w,S,O,ae,ue,null,ee,le)),pa(e,p,w,!P);return}}Vp(e,n,p,a,s,d,w,S,O)}function xv(e){for(var n=e;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var s=0;s<a.length;s++){var d=a[s],p=d.getSnapshot;d=d.value;try{if(!Bn(p(),d))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function pa(e,n,a,s){n&=~Qu,n&=~Pa,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var d=n;0<d;){var p=31-Qe(d),w=1<<p;s[p]=-1,d&=~w}a!==0&&Ql(e,a,n)}function xo(){return(at&6)===0?(Ui(0),!1):!0}function Pu(){if(Ie!==null){if(st===0)var e=Ie.return;else e=Ie,Tl=Ya=null,pu(e),Sr=null,wi=0,e=Ie;for(;e!==null;)mp(e.alternate,e),e=e.return;Ie=null}}function _r(e,n){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Bv(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Hl=0,Pu(),mt=e,Ie=a=Nl(e.current,null),Xe=n,st=0,Hn=null,fa=!1,Dr=Xl(e,n),Gu=!1,zr=$n=Qu=Pa=da=Mt=0,Tn=Li=null,Ku=!1,(n&8)!==0&&(n|=n&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=n;0<s;){var d=31-Qe(s),p=1<<d;n|=e[d],s&=~p}return Ul=n,Bs(),a}function Fp(e,n){Le=null,z.H=Ti,n===kr||n===Ys?(n=em(),st=3):n===lu?(n=em(),st=4):st=n===zu?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Hn=n,Ie===null&&(Mt=1,ao(e,Kn(n,e.current)))}function Up(){var e=Fn.current;return e===null?!0:(Xe&4194048)===Xe?Pn===null:(Xe&62914560)===Xe||(Xe&536870912)!==0?e===Pn:!1}function Hp(){var e=z.H;return z.H=Ti,e===null?Ti:e}function $p(){var e=z.A;return z.A=mv,e}function go(){Mt=4,fa||(Xe&4194048)!==Xe&&Fn.current!==null||(Dr=!0),(da&134217727)===0&&(Pa&134217727)===0||mt===null||pa(mt,Xe,$n,!1)}function ef(e,n,a){var s=at;at|=2;var d=Hp(),p=$p();(mt!==e||Xe!==n)&&(po=null,_r(e,n)),n=!1;var w=Mt;e:do try{if(st!==0&&Ie!==null){var S=Ie,O=Hn;switch(st){case 8:Pu(),w=6;break e;case 3:case 2:case 9:case 6:Fn.current===null&&(n=!0);var P=st;if(st=0,Hn=null,Rr(e,S,O,P),a&&Dr){w=0;break e}break;default:P=st,st=0,Hn=null,Rr(e,S,O,P)}}gv(),w=Mt;break}catch(ae){Fp(e,ae)}while(!0);return n&&e.shellSuspendCounter++,Tl=Ya=null,at=s,z.H=d,z.A=p,Ie===null&&(mt=null,Xe=0,Bs()),w}function gv(){for(;Ie!==null;)qp(Ie)}function yv(e,n){var a=at;at|=2;var s=Hp(),d=$p();mt!==e||Xe!==n?(po=null,mo=Dt()+500,_r(e,n)):Dr=Xl(e,n);e:do try{if(st!==0&&Ie!==null){n=Ie;var p=Hn;t:switch(st){case 1:st=0,Hn=null,Rr(e,n,p,1);break;case 2:case 9:if(Wh(p)){st=0,Hn=null,Ip(n);break}n=function(){st!==2&&st!==9||mt!==e||(st=7),ml(e)},p.then(n,n);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:Wh(p)?(st=0,Hn=null,Ip(n)):(st=0,Hn=null,Rr(e,n,p,7));break;case 5:var w=null;switch(Ie.tag){case 26:w=Ie.memoizedState;case 5:case 27:var S=Ie;if(w?Ax(w):S.stateNode.complete){st=0,Hn=null;var O=S.sibling;if(O!==null)Ie=O;else{var P=S.return;P!==null?(Ie=P,yo(P)):Ie=null}break t}}st=0,Hn=null,Rr(e,n,p,5);break;case 6:st=0,Hn=null,Rr(e,n,p,6);break;case 8:Pu(),Mt=6;break e;default:throw Error(i(462))}}vv();break}catch(ae){Fp(e,ae)}while(!0);return Tl=Ya=null,z.H=s,z.A=d,at=a,Ie!==null?0:(mt=null,Xe=0,Bs(),Mt)}function vv(){for(;Ie!==null&&!wn();)qp(Ie)}function qp(e){var n=dp(e.alternate,e,Ul);e.memoizedProps=e.pendingProps,n===null?yo(e):Ie=n}function Ip(e){var n=e,a=n.alternate;switch(n.tag){case 15:case 0:n=ip(a,n,n.pendingProps,n.type,void 0,Xe);break;case 11:n=ip(a,n,n.pendingProps,n.type.render,n.ref,Xe);break;case 5:pu(n);default:mp(a,n),n=Ie=$h(n,Ul),n=dp(a,n,Ul)}e.memoizedProps=e.pendingProps,n===null?yo(e):Ie=n}function Rr(e,n,a,s){Tl=Ya=null,pu(n),Sr=null,wi=0;var d=n.return;try{if(sv(e,d,n,a,Xe)){Mt=1,ao(e,Kn(a,e.current)),Ie=null;return}}catch(p){if(d!==null)throw Ie=d,p;Mt=1,ao(e,Kn(a,e.current)),Ie=null;return}n.flags&32768?(Ze||s===1?e=!0:Dr||(Xe&536870912)!==0?e=!1:(fa=e=!0,(s===2||s===9||s===3||s===6)&&(s=Fn.current,s!==null&&s.tag===13&&(s.flags|=16384))),Yp(n,e)):yo(n)}function yo(e){var n=e;do{if((n.flags&32768)!==0){Yp(n,fa);return}e=n.return;var a=uv(n.alternate,n,Ul);if(a!==null){Ie=a;return}if(n=n.sibling,n!==null){Ie=n;return}Ie=n=e}while(n!==null);Mt===0&&(Mt=5)}function Yp(e,n){do{var a=fv(e.alternate,e);if(a!==null){a.flags&=32767,Ie=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(e=e.sibling,e!==null)){Ie=e;return}Ie=e=a}while(e!==null);Mt=6,Ie=null}function Vp(e,n,a,s,d,p,w,S,O){e.cancelPendingCommit=null;do vo();while(Wt!==0);if((at&6)!==0)throw Error(i(327));if(n!==null){if(n===e.current)throw Error(i(177));if(p=n.lanes|n.childLanes,p|=qc,Gl(e,a,p,w,S,O),e===mt&&(Ie=mt=null,Xe=0),Mr=n,ma=e,Hl=a,Zu=p,Ju=d,Rp=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Sv(we,function(){return Zp(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=z.T,z.T=null,d=q.p,q.p=2,w=at,at|=4;try{dv(e,n,a)}finally{at=w,q.p=d,z.T=s}}Wt=1,Xp(),Gp(),Qp()}}function Xp(){if(Wt===1){Wt=0;var e=ma,n=Mr,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=z.T,z.T=null;var s=q.p;q.p=2;var d=at;at|=4;try{Cp(n,e);var p=hf,w=Mh(e.containerInfo),S=p.focusedElem,O=p.selectionRange;if(w!==S&&S&&S.ownerDocument&&zh(S.ownerDocument.documentElement,S)){if(O!==null&&Lc(S)){var P=O.start,ae=O.end;if(ae===void 0&&(ae=P),"selectionStart"in S)S.selectionStart=P,S.selectionEnd=Math.min(ae,S.value.length);else{var ue=S.ownerDocument||document,ee=ue&&ue.defaultView||window;if(ee.getSelection){var le=ee.getSelection(),be=S.textContent.length,De=Math.min(O.start,be),ft=O.end===void 0?De:Math.min(O.end,be);!le.extend&&De>ft&&(w=ft,ft=De,De=w);var X=Dh(S,De),H=Dh(S,ft);if(X&&H&&(le.rangeCount!==1||le.anchorNode!==X.node||le.anchorOffset!==X.offset||le.focusNode!==H.node||le.focusOffset!==H.offset)){var W=ue.createRange();W.setStart(X.node,X.offset),le.removeAllRanges(),De>ft?(le.addRange(W),le.extend(H.node,H.offset)):(W.setEnd(H.node,H.offset),le.addRange(W))}}}}for(ue=[],le=S;le=le.parentNode;)le.nodeType===1&&ue.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<ue.length;S++){var oe=ue[S];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}zo=!!df,hf=df=null}finally{at=d,q.p=s,z.T=a}}e.current=n,Wt=2}}function Gp(){if(Wt===2){Wt=0;var e=ma,n=Mr,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=z.T,z.T=null;var s=q.p;q.p=2;var d=at;at|=4;try{wp(e,n.alternate,n)}finally{at=d,q.p=s,z.T=a}}Wt=3}}function Qp(){if(Wt===4||Wt===3){Wt=0,kn();var e=ma,n=Mr,a=Hl,s=Rp;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Wt=5:(Wt=0,Mr=ma=null,Kp(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(ha=null),Kl(a),n=n.stateNode,he&&typeof he.onCommitFiberRoot=="function")try{he.onCommitFiberRoot(it,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=z.T,d=q.p,q.p=2,z.T=null;try{for(var p=e.onRecoverableError,w=0;w<s.length;w++){var S=s[w];p(S.value,{componentStack:S.stack})}}finally{z.T=n,q.p=d}}(Hl&3)!==0&&vo(),ml(e),d=e.pendingLanes,(a&261930)!==0&&(d&42)!==0?e===Wu?Fi++:(Fi=0,Wu=e):Fi=0,Ui(0)}}function Kp(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,vi(n)))}function vo(){return Xp(),Gp(),Qp(),Zp()}function Zp(){if(Wt!==5)return!1;var e=ma,n=Zu;Zu=0;var a=Kl(Hl),s=z.T,d=q.p;try{q.p=32>a?32:a,z.T=null,a=Ju,Ju=null;var p=ma,w=Hl;if(Wt=0,Mr=ma=null,Hl=0,(at&6)!==0)throw Error(i(331));var S=at;if(at|=4,zp(p.current),Ap(p,p.current,w,a),at=S,Ui(0,!1),he&&typeof he.onPostCommitFiberRoot=="function")try{he.onPostCommitFiberRoot(it,p)}catch{}return!0}finally{q.p=d,z.T=s,Kp(e,n)}}function Jp(e,n,a){n=Kn(a,n),n=Du(e.stateNode,n,2),e=sa(e,n,2),e!==null&&(fn(e,2),ml(e))}function ot(e,n,a){if(e.tag===3)Jp(e,e,a);else for(;n!==null;){if(n.tag===3){Jp(n,e,a);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ha===null||!ha.has(s))){e=Kn(a,e),a=Wm(2),s=sa(n,a,2),s!==null&&(Pm(a,s,n,e),fn(s,2),ml(s));break}}n=n.return}}function tf(e,n,a){var s=e.pingCache;if(s===null){s=e.pingCache=new pv;var d=new Set;s.set(n,d)}else d=s.get(n),d===void 0&&(d=new Set,s.set(n,d));d.has(a)||(Gu=!0,d.add(a),e=bv.bind(null,e,n,a),n.then(e,e))}function bv(e,n,a){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,mt===e&&(Xe&a)===a&&(Mt===4||Mt===3&&(Xe&62914560)===Xe&&300>Dt()-ho?(at&2)===0&&_r(e,0):Qu|=a,zr===Xe&&(zr=0)),ml(e)}function Wp(e,n){n===0&&(n=Ss()),e=$a(e,n),e!==null&&(fn(e,n),ml(e))}function wv(e){var n=e.memoizedState,a=0;n!==null&&(a=n.retryLane),Wp(e,a)}function kv(e,n){var a=0;switch(e.tag){case 31:case 13:var s=e.stateNode,d=e.memoizedState;d!==null&&(a=d.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(i(314))}s!==null&&s.delete(n),Wp(e,a)}function Sv(e,n){return un(e,n)}var bo=null,Or=null,nf=!1,wo=!1,lf=!1,xa=0;function ml(e){e!==Or&&e.next===null&&(Or===null?bo=Or=e:Or=Or.next=e),wo=!0,nf||(nf=!0,Ev())}function Ui(e,n){if(!lf&&wo){lf=!0;do for(var a=!1,s=bo;s!==null;){if(e!==0){var d=s.pendingLanes;if(d===0)var p=0;else{var w=s.suspendedLanes,S=s.pingedLanes;p=(1<<31-Qe(42|e)+1)-1,p&=d&~(w&~S),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(a=!0,nx(s,p))}else p=Xe,p=Vl(s,s===mt?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(p&3)===0||Xl(s,p)||(a=!0,nx(s,p));s=s.next}while(a);lf=!1}}function jv(){Pp()}function Pp(){wo=nf=!1;var e=0;xa!==0&&Ov()&&(e=xa);for(var n=Dt(),a=null,s=bo;s!==null;){var d=s.next,p=ex(s,n);p===0?(s.next=null,a===null?bo=d:a.next=d,d===null&&(Or=a)):(a=s,(e!==0||(p&3)!==0)&&(wo=!0)),s=d}Wt!==0&&Wt!==5||Ui(e),xa!==0&&(xa=0)}function ex(e,n){for(var a=e.suspendedLanes,s=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes&-62914561;0<p;){var w=31-Qe(p),S=1<<w,O=d[w];O===-1?((S&a)===0||(S&s)!==0)&&(d[w]=ks(S,n)):O<=n&&(e.expiredLanes|=S),p&=~S}if(n=mt,a=Xe,a=Vl(e,e===n?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,a===0||e===n&&(st===2||st===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&St(s),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Xl(e,a)){if(n=a&-a,n===e.callbackPriority)return n;switch(s!==null&&St(s),Kl(a)){case 2:case 8:a=se;break;case 32:a=we;break;case 268435456:a=Be;break;default:a=we}return s=tx.bind(null,e),a=un(a,s),e.callbackPriority=n,e.callbackNode=a,n}return s!==null&&s!==null&&St(s),e.callbackPriority=2,e.callbackNode=null,2}function tx(e,n){if(Wt!==0&&Wt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(vo()&&e.callbackNode!==a)return null;var s=Xe;return s=Vl(e,e===mt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Bp(e,s,n),ex(e,Dt()),e.callbackNode!=null&&e.callbackNode===a?tx.bind(null,e):null)}function nx(e,n){if(vo())return null;Bp(e,n,!0)}function Ev(){Lv(function(){(at&6)!==0?un(G,jv):Pp()})}function af(){if(xa===0){var e=br;e===0&&(e=za,za<<=1,(za&261888)===0&&(za=256)),xa=e}return xa}function lx(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:As(""+e)}function ax(e,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,e.id&&a.setAttribute("form",e.id),n.parentNode.insertBefore(a,n),e=new FormData(e),a.parentNode.removeChild(a),e}function Cv(e,n,a,s,d){if(n==="submit"&&a&&a.stateNode===d){var p=lx((d[Ut]||null).action),w=s.submitter;w&&(n=(n=w[Ut]||null)?lx(n.formAction):w.getAttribute("formAction"),n!==null&&(p=n,w=null));var S=new Ms("action","action",null,s,d);e.push({event:S,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(xa!==0){var O=w?ax(d,w):new FormData(d);ju(a,{pending:!0,data:O,method:d.method,action:p},null,O)}}else typeof p=="function"&&(S.preventDefault(),O=w?ax(d,w):new FormData(d),ju(a,{pending:!0,data:O,method:d.method,action:p},p,O))},currentTarget:d}]})}}for(var rf=0;rf<$c.length;rf++){var sf=$c[rf],Nv=sf.toLowerCase(),Av=sf[0].toUpperCase()+sf.slice(1);il(Nv,"on"+Av)}il(Oh,"onAnimationEnd"),il(Bh,"onAnimationIteration"),il(Lh,"onAnimationStart"),il("dblclick","onDoubleClick"),il("focusin","onFocus"),il("focusout","onBlur"),il(Y0,"onTransitionRun"),il(V0,"onTransitionStart"),il(X0,"onTransitionCancel"),il(Fh,"onTransitionEnd"),Pl("onMouseEnter",["mouseout","mouseover"]),Pl("onMouseLeave",["mouseout","mouseover"]),Pl("onPointerEnter",["pointerout","pointerover"]),Pl("onPointerLeave",["pointerout","pointerover"]),Sl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Sl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Sl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Sl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Sl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Sl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hi="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(" "),Tv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hi));function rx(e,n){n=(n&4)!==0;for(var a=0;a<e.length;a++){var s=e[a],d=s.event;s=s.listeners;e:{var p=void 0;if(n)for(var w=s.length-1;0<=w;w--){var S=s[w],O=S.instance,P=S.currentTarget;if(S=S.listener,O!==p&&d.isPropagationStopped())break e;p=S,d.currentTarget=P;try{p(d)}catch(ae){Os(ae)}d.currentTarget=null,p=O}else for(w=0;w<s.length;w++){if(S=s[w],O=S.instance,P=S.currentTarget,S=S.listener,O!==p&&d.isPropagationStopped())break e;p=S,d.currentTarget=P;try{p(d)}catch(ae){Os(ae)}d.currentTarget=null,p=O}}}}function Ye(e,n){var a=n[_t];a===void 0&&(a=n[_t]=new Set);var s=e+"__bubble";a.has(s)||(ix(n,e,2,!1),a.add(s))}function of(e,n,a){var s=0;n&&(s|=4),ix(a,e,s,n)}var ko="_reactListening"+Math.random().toString(36).slice(2);function cf(e){if(!e[ko]){e[ko]=!0,Es.forEach(function(a){a!=="selectionchange"&&(Tv.has(a)||of(a,!1,e),of(a,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[ko]||(n[ko]=!0,of("selectionchange",!1,n))}}function ix(e,n,a,s){switch(Ox(n)){case 2:var d=lb;break;case 8:d=ab;break;default:d=jf}a=d.bind(null,n,a,e),d=void 0,!Ac||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(d=!0),s?d!==void 0?e.addEventListener(n,a,{capture:!0,passive:d}):e.addEventListener(n,a,!0):d!==void 0?e.addEventListener(n,a,{passive:d}):e.addEventListener(n,a,!1)}function uf(e,n,a,s,d){var p=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var w=s.tag;if(w===3||w===4){var S=s.stateNode.containerInfo;if(S===d)break;if(w===4)for(w=s.return;w!==null;){var O=w.tag;if((O===3||O===4)&&w.stateNode.containerInfo===d)return;w=w.return}for(;S!==null;){if(w=Jl(S),w===null)return;if(O=w.tag,O===5||O===6||O===26||O===27){s=p=w;continue e}S=S.parentNode}}s=s.return}fh(function(){var P=p,ae=Cc(a),ue=[];e:{var ee=Uh.get(e);if(ee!==void 0){var le=Ms,be=e;switch(e){case"keypress":if(Ds(a)===0)break e;case"keydown":case"keyup":le=k0;break;case"focusin":be="focus",le=Mc;break;case"focusout":be="blur",le=Mc;break;case"beforeblur":case"afterblur":le=Mc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=mh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=u0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=E0;break;case Oh:case Bh:case Lh:le=h0;break;case Fh:le=N0;break;case"scroll":case"scrollend":le=o0;break;case"wheel":le=T0;break;case"copy":case"cut":case"paste":le=p0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=xh;break;case"toggle":case"beforetoggle":le=z0}var De=(n&4)!==0,ft=!De&&(e==="scroll"||e==="scrollend"),X=De?ee!==null?ee+"Capture":null:ee;De=[];for(var H=P,W;H!==null;){var oe=H;if(W=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||W===null||X===null||(oe=oi(H,X),oe!=null&&De.push($i(H,oe,W))),ft)break;H=H.return}0<De.length&&(ee=new le(ee,be,null,a,ae),ue.push({event:ee,listeners:De}))}}if((n&7)===0){e:{if(ee=e==="mouseover"||e==="pointerover",le=e==="mouseout"||e==="pointerout",ee&&a!==Ec&&(be=a.relatedTarget||a.fromElement)&&(Jl(be)||be[Zl]))break e;if((le||ee)&&(ee=ae.window===ae?ae:(ee=ae.ownerDocument)?ee.defaultView||ee.parentWindow:window,le?(be=a.relatedTarget||a.toElement,le=P,be=be?Jl(be):null,be!==null&&(ft=u(be),De=be.tag,be!==ft||De!==5&&De!==27&&De!==6)&&(be=null)):(le=null,be=P),le!==be)){if(De=mh,oe="onMouseLeave",X="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(De=xh,oe="onPointerLeave",X="onPointerEnter",H="pointer"),ft=le==null?ee:Oa(le),W=be==null?ee:Oa(be),ee=new De(oe,H+"leave",le,a,ae),ee.target=ft,ee.relatedTarget=W,oe=null,Jl(ae)===P&&(De=new De(X,H+"enter",be,a,ae),De.target=W,De.relatedTarget=ft,oe=De),ft=oe,le&&be)t:{for(De=Dv,X=le,H=be,W=0,oe=X;oe;oe=De(oe))W++;oe=0;for(var Ne=H;Ne;Ne=De(Ne))oe++;for(;0<W-oe;)X=De(X),W--;for(;0<oe-W;)H=De(H),oe--;for(;W--;){if(X===H||H!==null&&X===H.alternate){De=X;break t}X=De(X),H=De(H)}De=null}else De=null;le!==null&&sx(ue,ee,le,De,!1),be!==null&&ft!==null&&sx(ue,ft,be,De,!0)}}e:{if(ee=P?Oa(P):window,le=ee.nodeName&&ee.nodeName.toLowerCase(),le==="select"||le==="input"&&ee.type==="file")var nt=jh;else if(kh(ee))if(Eh)nt=$0;else{nt=U0;var Se=F0}else le=ee.nodeName,!le||le.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?P&&jc(P.elementType)&&(nt=jh):nt=H0;if(nt&&(nt=nt(e,P))){Sh(ue,nt,a,ae);break e}Se&&Se(e,ee,P),e==="focusout"&&P&&ee.type==="number"&&P.memoizedProps.value!=null&&Ee(ee,"number",ee.value)}switch(Se=P?Oa(P):window,e){case"focusin":(kh(Se)||Se.contentEditable==="true")&&(dr=Se,Fc=P,xi=null);break;case"focusout":xi=Fc=dr=null;break;case"mousedown":Uc=!0;break;case"contextmenu":case"mouseup":case"dragend":Uc=!1,_h(ue,a,ae);break;case"selectionchange":if(I0)break;case"keydown":case"keyup":_h(ue,a,ae)}var Ue;if(Rc)e:{switch(e){case"compositionstart":var Ge="onCompositionStart";break e;case"compositionend":Ge="onCompositionEnd";break e;case"compositionupdate":Ge="onCompositionUpdate";break e}Ge=void 0}else fr?bh(e,a)&&(Ge="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ge="onCompositionStart");Ge&&(gh&&a.locale!=="ko"&&(fr||Ge!=="onCompositionStart"?Ge==="onCompositionEnd"&&fr&&(Ue=dh()):(ea=ae,Tc="value"in ea?ea.value:ea.textContent,fr=!0)),Se=So(P,Ge),0<Se.length&&(Ge=new ph(Ge,e,null,a,ae),ue.push({event:Ge,listeners:Se}),Ue?Ge.data=Ue:(Ue=wh(a),Ue!==null&&(Ge.data=Ue)))),(Ue=_0?R0(e,a):O0(e,a))&&(Ge=So(P,"onBeforeInput"),0<Ge.length&&(Se=new ph("onBeforeInput","beforeinput",null,a,ae),ue.push({event:Se,listeners:Ge}),Se.data=Ue)),Cv(ue,e,P,a,ae)}rx(ue,n)})}function $i(e,n,a){return{instance:e,listener:n,currentTarget:a}}function So(e,n){for(var a=n+"Capture",s=[];e!==null;){var d=e,p=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||p===null||(d=oi(e,a),d!=null&&s.unshift($i(e,d,p)),d=oi(e,n),d!=null&&s.push($i(e,d,p))),e.tag===3)return s;e=e.return}return[]}function Dv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function sx(e,n,a,s,d){for(var p=n._reactName,w=[];a!==null&&a!==s;){var S=a,O=S.alternate,P=S.stateNode;if(S=S.tag,O!==null&&O===s)break;S!==5&&S!==26&&S!==27||P===null||(O=P,d?(P=oi(a,p),P!=null&&w.unshift($i(a,P,O))):d||(P=oi(a,p),P!=null&&w.push($i(a,P,O)))),a=a.return}w.length!==0&&e.push({event:n,listeners:w})}var zv=/\r\n?/g,Mv=/\u0000|\uFFFD/g;function ox(e){return(typeof e=="string"?e:""+e).replace(zv,`
49
+ `).replace(Mv,"")}function cx(e,n){return n=ox(n),ox(e)===n}function ut(e,n,a,s,d,p){switch(a){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||qe(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&qe(e,""+s);break;case"className":Ba(e,"class",s);break;case"tabIndex":Ba(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Ba(e,a,s);break;case"style":ch(e,s,p);break;case"data":if(n!=="object"){Ba(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||a!=="href")){e.removeAttribute(a);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=As(""+s),e.setAttribute(a,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof p=="function"&&(a==="formAction"?(n!=="input"&&ut(e,n,"name",d.name,d,null),ut(e,n,"formEncType",d.formEncType,d,null),ut(e,n,"formMethod",d.formMethod,d,null),ut(e,n,"formTarget",d.formTarget,d,null)):(ut(e,n,"encType",d.encType,d,null),ut(e,n,"method",d.method,d,null),ut(e,n,"target",d.target,d,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=As(""+s),e.setAttribute(a,s);break;case"onClick":s!=null&&(e.onclick=El);break;case"onScroll":s!=null&&Ye("scroll",e);break;case"onScrollEnd":s!=null&&Ye("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(a=s.__html,a!=null){if(d.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}a=As(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""+s):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":s===!0?e.setAttribute(a,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,s):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(a,s):e.removeAttribute(a);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(a):e.setAttribute(a,s);break;case"popover":Ye("beforetoggle",e),Ye("toggle",e),On(e,"popover",s);break;case"xlinkActuate":rl(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":rl(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":rl(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":rl(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":rl(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":rl(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":rl(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":rl(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":rl(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":On(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=i0.get(a)||a,On(e,a,s))}}function ff(e,n,a,s,d,p){switch(a){case"style":ch(e,s,p);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(a=s.__html,a!=null){if(d.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof s=="string"?qe(e,s):(typeof s=="number"||typeof s=="bigint")&&qe(e,""+s);break;case"onScroll":s!=null&&Ye("scroll",e);break;case"onScrollEnd":s!=null&&Ye("scrollend",e);break;case"onClick":s!=null&&(e.onclick=El);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Cs.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(d=a.endsWith("Capture"),n=a.slice(2,d?a.length-7:void 0),p=e[Ut]||null,p=p!=null?p[a]:null,typeof p=="function"&&e.removeEventListener(n,p,d),typeof s=="function")){typeof p!="function"&&p!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(n,s,d);break e}a in e?e[a]=s:s===!0?e.setAttribute(a,""):On(e,a,s)}}}function on(e,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",e),Ye("load",e);var s=!1,d=!1,p;for(p in a)if(a.hasOwnProperty(p)){var w=a[p];if(w!=null)switch(p){case"src":s=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:ut(e,n,p,w,a,null)}}d&&ut(e,n,"srcSet",a.srcSet,a,null),s&&ut(e,n,"src",a.src,a,null);return;case"input":Ye("invalid",e);var S=p=w=d=null,O=null,P=null;for(s in a)if(a.hasOwnProperty(s)){var ae=a[s];if(ae!=null)switch(s){case"name":d=ae;break;case"type":w=ae;break;case"checked":O=ae;break;case"defaultChecked":P=ae;break;case"value":p=ae;break;case"defaultValue":S=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(i(137,n));break;default:ut(e,n,s,ae,a,null)}}ke(e,p,S,O,P,w,d,!1);return;case"select":Ye("invalid",e),s=w=p=null;for(d in a)if(a.hasOwnProperty(d)&&(S=a[d],S!=null))switch(d){case"value":p=S;break;case"defaultValue":w=S;break;case"multiple":s=S;default:ut(e,n,d,S,a,null)}n=p,a=w,e.multiple=!!s,n!=null?ze(e,!!s,n,!1):a!=null&&ze(e,!!s,a,!0);return;case"textarea":Ye("invalid",e),p=d=s=null;for(w in a)if(a.hasOwnProperty(w)&&(S=a[w],S!=null))switch(w){case"value":s=S;break;case"defaultValue":d=S;break;case"children":p=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(i(91));break;default:ut(e,n,w,S,a,null)}Ke(e,s,d,p);return;case"option":for(O in a)if(a.hasOwnProperty(O)&&(s=a[O],s!=null))switch(O){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:ut(e,n,O,s,a,null)}return;case"dialog":Ye("beforetoggle",e),Ye("toggle",e),Ye("cancel",e),Ye("close",e);break;case"iframe":case"object":Ye("load",e);break;case"video":case"audio":for(s=0;s<Hi.length;s++)Ye(Hi[s],e);break;case"image":Ye("error",e),Ye("load",e);break;case"details":Ye("toggle",e);break;case"embed":case"source":case"link":Ye("error",e),Ye("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(P in a)if(a.hasOwnProperty(P)&&(s=a[P],s!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:ut(e,n,P,s,a,null)}return;default:if(jc(n)){for(ae in a)a.hasOwnProperty(ae)&&(s=a[ae],s!==void 0&&ff(e,n,ae,s,a,void 0));return}}for(S in a)a.hasOwnProperty(S)&&(s=a[S],s!=null&&ut(e,n,S,s,a,null))}function _v(e,n,a,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,p=null,w=null,S=null,O=null,P=null,ae=null;for(le in a){var ue=a[le];if(a.hasOwnProperty(le)&&ue!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":O=ue;default:s.hasOwnProperty(le)||ut(e,n,le,null,s,ue)}}for(var ee in s){var le=s[ee];if(ue=a[ee],s.hasOwnProperty(ee)&&(le!=null||ue!=null))switch(ee){case"type":p=le;break;case"name":d=le;break;case"checked":P=le;break;case"defaultChecked":ae=le;break;case"value":w=le;break;case"defaultValue":S=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(i(137,n));break;default:le!==ue&&ut(e,n,ee,le,s,ue)}}ge(e,w,S,O,P,ae,p,d);return;case"select":le=w=S=ee=null;for(p in a)if(O=a[p],a.hasOwnProperty(p)&&O!=null)switch(p){case"value":break;case"multiple":le=O;default:s.hasOwnProperty(p)||ut(e,n,p,null,s,O)}for(d in s)if(p=s[d],O=a[d],s.hasOwnProperty(d)&&(p!=null||O!=null))switch(d){case"value":ee=p;break;case"defaultValue":S=p;break;case"multiple":w=p;default:p!==O&&ut(e,n,d,p,s,O)}n=S,a=w,s=le,ee!=null?ze(e,!!a,ee,!1):!!s!=!!a&&(n!=null?ze(e,!!a,n,!0):ze(e,!!a,a?[]:"",!1));return;case"textarea":le=ee=null;for(S in a)if(d=a[S],a.hasOwnProperty(S)&&d!=null&&!s.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:ut(e,n,S,null,s,d)}for(w in s)if(d=s[w],p=a[w],s.hasOwnProperty(w)&&(d!=null||p!=null))switch(w){case"value":ee=d;break;case"defaultValue":le=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(i(91));break;default:d!==p&&ut(e,n,w,d,s,p)}Me(e,ee,le);return;case"option":for(var be in a)if(ee=a[be],a.hasOwnProperty(be)&&ee!=null&&!s.hasOwnProperty(be))switch(be){case"selected":e.selected=!1;break;default:ut(e,n,be,null,s,ee)}for(O in s)if(ee=s[O],le=a[O],s.hasOwnProperty(O)&&ee!==le&&(ee!=null||le!=null))switch(O){case"selected":e.selected=ee&&typeof ee!="function"&&typeof ee!="symbol";break;default:ut(e,n,O,ee,s,le)}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 De in a)ee=a[De],a.hasOwnProperty(De)&&ee!=null&&!s.hasOwnProperty(De)&&ut(e,n,De,null,s,ee);for(P in s)if(ee=s[P],le=a[P],s.hasOwnProperty(P)&&ee!==le&&(ee!=null||le!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(i(137,n));break;default:ut(e,n,P,ee,s,le)}return;default:if(jc(n)){for(var ft in a)ee=a[ft],a.hasOwnProperty(ft)&&ee!==void 0&&!s.hasOwnProperty(ft)&&ff(e,n,ft,void 0,s,ee);for(ae in s)ee=s[ae],le=a[ae],!s.hasOwnProperty(ae)||ee===le||ee===void 0&&le===void 0||ff(e,n,ae,ee,s,le);return}}for(var X in a)ee=a[X],a.hasOwnProperty(X)&&ee!=null&&!s.hasOwnProperty(X)&&ut(e,n,X,null,s,ee);for(ue in s)ee=s[ue],le=a[ue],!s.hasOwnProperty(ue)||ee===le||ee==null&&le==null||ut(e,n,ue,ee,s,le)}function ux(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Rv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,a=performance.getEntriesByType("resource"),s=0;s<a.length;s++){var d=a[s],p=d.transferSize,w=d.initiatorType,S=d.duration;if(p&&S&&ux(w)){for(w=0,S=d.responseEnd,s+=1;s<a.length;s++){var O=a[s],P=O.startTime;if(P>S)break;var ae=O.transferSize,ue=O.initiatorType;ae&&ux(ue)&&(O=O.responseEnd,w+=ae*(O<S?1:(S-P)/(O-P)))}if(--s,n+=8*(p+w)/(d.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var df=null,hf=null;function jo(e){return e.nodeType===9?e:e.ownerDocument}function fx(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 dx(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function mf(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var pf=null;function Ov(){var e=window.event;return e&&e.type==="popstate"?e===pf?!1:(pf=e,!0):(pf=null,!1)}var hx=typeof setTimeout=="function"?setTimeout:void 0,Bv=typeof clearTimeout=="function"?clearTimeout:void 0,mx=typeof Promise=="function"?Promise:void 0,Lv=typeof queueMicrotask=="function"?queueMicrotask:typeof mx<"u"?function(e){return mx.resolve(null).then(e).catch(Fv)}:hx;function Fv(e){setTimeout(function(){throw e})}function ga(e){return e==="head"}function px(e,n){var a=n,s=0;do{var d=a.nextSibling;if(e.removeChild(a),d&&d.nodeType===8)if(a=d.data,a==="/$"||a==="/&"){if(s===0){e.removeChild(d),Ur(n);return}s--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")s++;else if(a==="html")qi(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,qi(a);for(var p=a.firstChild;p;){var w=p.nextSibling,S=p.nodeName;p[wl]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&p.rel.toLowerCase()==="stylesheet"||a.removeChild(p),p=w}}else a==="body"&&qi(e.ownerDocument.body);a=d}while(a);Ur(n)}function xx(e,n){var a=e;e=0;do{var s=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),s&&s.nodeType===8)if(a=s.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=s}while(a)}function xf(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":xf(a),ai(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Uv(e,n,a,s){for(;e.nodeType===1;){var d=a;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[wl])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(p=e.getAttribute("rel"),p==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(p!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(p=e.getAttribute("src"),(p!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&p&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var p=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===p)return e}else return e;if(e=el(e.nextSibling),e===null)break}return null}function Hv(e,n,a){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=el(e.nextSibling),e===null))return null;return e}function gx(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=el(e.nextSibling),e===null))return null;return e}function gf(e){return e.data==="$?"||e.data==="$~"}function yf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function $v(e,n){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||a.readyState!=="loading")n();else{var s=function(){n(),a.removeEventListener("DOMContentLoaded",s)};a.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function el(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var vf=null;function yx(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(n===0)return el(e.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}e=e.nextSibling}return null}function vx(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return e;n--}else a!=="/$"&&a!=="/&"||n++}e=e.previousSibling}return null}function bx(e,n,a){switch(n=jo(a),e){case"html":if(e=n.documentElement,!e)throw Error(i(452));return e;case"head":if(e=n.head,!e)throw Error(i(453));return e;case"body":if(e=n.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function qi(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);ai(e)}var tl=new Map,wx=new Set;function Eo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var $l=q.d;q.d={f:qv,r:Iv,D:Yv,C:Vv,L:Xv,m:Gv,X:Kv,S:Qv,M:Zv};function qv(){var e=$l.f(),n=xo();return e||n}function Iv(e){var n=kl(e);n!==null&&n.tag===5&&n.type==="form"?Fm(n):$l.r(e)}var Br=typeof document>"u"?null:document;function kx(e,n,a){var s=Br;if(s&&typeof n=="string"&&n){var d=fe(n);d='link[rel="'+e+'"][href="'+d+'"]',typeof a=="string"&&(d+='[crossorigin="'+a+'"]'),wx.has(d)||(wx.add(d),e={rel:e,crossOrigin:a,href:n},s.querySelector(d)===null&&(n=s.createElement("link"),on(n,"link",e),Ht(n),s.head.appendChild(n)))}}function Yv(e){$l.D(e),kx("dns-prefetch",e,null)}function Vv(e,n){$l.C(e,n),kx("preconnect",e,n)}function Xv(e,n,a){$l.L(e,n,a);var s=Br;if(s&&e&&n){var d='link[rel="preload"][as="'+fe(n)+'"]';n==="image"&&a&&a.imageSrcSet?(d+='[imagesrcset="'+fe(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(d+='[imagesizes="'+fe(a.imageSizes)+'"]')):d+='[href="'+fe(e)+'"]';var p=d;switch(n){case"style":p=Lr(e);break;case"script":p=Fr(e)}tl.has(p)||(e=g({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:e,as:n},a),tl.set(p,e),s.querySelector(d)!==null||n==="style"&&s.querySelector(Ii(p))||n==="script"&&s.querySelector(Yi(p))||(n=s.createElement("link"),on(n,"link",e),Ht(n),s.head.appendChild(n)))}}function Gv(e,n){$l.m(e,n);var a=Br;if(a&&e){var s=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+fe(s)+'"][href="'+fe(e)+'"]',p=d;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Fr(e)}if(!tl.has(p)&&(e=g({rel:"modulepreload",href:e},n),tl.set(p,e),a.querySelector(d)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Yi(p)))return}s=a.createElement("link"),on(s,"link",e),Ht(s),a.head.appendChild(s)}}}function Qv(e,n,a){$l.S(e,n,a);var s=Br;if(s&&e){var d=Wl(s).hoistableStyles,p=Lr(e);n=n||"default";var w=d.get(p);if(!w){var S={loading:0,preload:null};if(w=s.querySelector(Ii(p)))S.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":n},a),(a=tl.get(p))&&bf(e,a);var O=w=s.createElement("link");Ht(O),on(O,"link",e),O._p=new Promise(function(P,ae){O.onload=P,O.onerror=ae}),O.addEventListener("load",function(){S.loading|=1}),O.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Co(w,n,s)}w={type:"stylesheet",instance:w,count:1,state:S},d.set(p,w)}}}function Kv(e,n){$l.X(e,n);var a=Br;if(a&&e){var s=Wl(a).hoistableScripts,d=Fr(e),p=s.get(d);p||(p=a.querySelector(Yi(d)),p||(e=g({src:e,async:!0},n),(n=tl.get(d))&&wf(e,n),p=a.createElement("script"),Ht(p),on(p,"link",e),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},s.set(d,p))}}function Zv(e,n){$l.M(e,n);var a=Br;if(a&&e){var s=Wl(a).hoistableScripts,d=Fr(e),p=s.get(d);p||(p=a.querySelector(Yi(d)),p||(e=g({src:e,async:!0,type:"module"},n),(n=tl.get(d))&&wf(e,n),p=a.createElement("script"),Ht(p),on(p,"link",e),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},s.set(d,p))}}function Sx(e,n,a,s){var d=(d=xe.current)?Eo(d):null;if(!d)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=Lr(a.href),a=Wl(d).hoistableStyles,s=a.get(n),s||(s={type:"style",instance:null,count:0,state:null},a.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Lr(a.href);var p=Wl(d).hoistableStyles,w=p.get(e);if(w||(d=d.ownerDocument||d,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(e,w),(p=d.querySelector(Ii(e)))&&!p._p&&(w.instance=p,w.state.loading=5),tl.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},tl.set(e,a),p||Jv(d,e,a,w.state))),n&&s===null)throw Error(i(528,""));return w}if(n&&s!==null)throw Error(i(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Fr(a),a=Wl(d).hoistableScripts,s=a.get(n),s||(s={type:"script",instance:null,count:0,state:null},a.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Lr(e){return'href="'+fe(e)+'"'}function Ii(e){return'link[rel="stylesheet"]['+e+"]"}function jx(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function Jv(e,n,a,s){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?s.loading=1:(n=e.createElement("link"),s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2}),on(n,"link",a),Ht(n),e.head.appendChild(n))}function Fr(e){return'[src="'+fe(e)+'"]'}function Yi(e){return"script[async]"+e}function Ex(e,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+fe(a.href)+'"]');if(s)return n.instance=s,Ht(s),s;var d=g({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Ht(s),on(s,"style",d),Co(s,a.precedence,e),n.instance=s;case"stylesheet":d=Lr(a.href);var p=e.querySelector(Ii(d));if(p)return n.state.loading|=4,n.instance=p,Ht(p),p;s=jx(a),(d=tl.get(d))&&bf(s,d),p=(e.ownerDocument||e).createElement("link"),Ht(p);var w=p;return w._p=new Promise(function(S,O){w.onload=S,w.onerror=O}),on(p,"link",s),n.state.loading|=4,Co(p,a.precedence,e),n.instance=p;case"script":return p=Fr(a.src),(d=e.querySelector(Yi(p)))?(n.instance=d,Ht(d),d):(s=a,(d=tl.get(p))&&(s=g({},a),wf(s,d)),e=e.ownerDocument||e,d=e.createElement("script"),Ht(d),on(d,"link",s),e.head.appendChild(d),n.instance=d);case"void":return null;default:throw Error(i(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,Co(s,a.precedence,e));return n.instance}function Co(e,n,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=s.length?s[s.length-1]:null,p=d,w=0;w<s.length;w++){var S=s[w];if(S.dataset.precedence===n)p=S;else if(p!==d)break}p?p.parentNode.insertBefore(e,p.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(e,n.firstChild))}function bf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function wf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var No=null;function Cx(e,n,a){if(No===null){var s=new Map,d=No=new Map;d.set(a,s)}else d=No,s=d.get(a),s||(s=new Map,d.set(a,s));if(s.has(e))return s;for(s.set(e,null),a=a.getElementsByTagName(e),d=0;d<a.length;d++){var p=a[d];if(!(p[wl]||p[Jt]||e==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var w=p.getAttribute(n)||"";w=e+w;var S=s.get(w);S?S.push(p):s.set(w,[p])}}return s}function Nx(e,n,a){e=e.ownerDocument||e,e.head.insertBefore(a,n==="title"?e.querySelector("head > title"):null)}function Wv(e,n,a){if(a===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Ax(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Pv(e,n,a,s){if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var d=Lr(s.href),p=n.querySelector(Ii(d));if(p){n=p._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Ao.bind(e),n.then(e,e)),a.state.loading|=4,a.instance=p,Ht(p);return}p=n.ownerDocument||n,s=jx(s),(d=tl.get(d))&&bf(s,d),p=p.createElement("link"),Ht(p);var w=p;w._p=new Promise(function(S,O){w.onload=S,w.onerror=O}),on(p,"link",s),a.instance=p}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Ao.bind(e),n.addEventListener("load",a),n.addEventListener("error",a))}}var kf=0;function eb(e,n){return e.stylesheets&&e.count===0&&Do(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var s=setTimeout(function(){if(e.stylesheets&&Do(e,e.stylesheets),e.unsuspend){var p=e.unsuspend;e.unsuspend=null,p()}},6e4+n);0<e.imgBytes&&kf===0&&(kf=62500*Rv());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Do(e,e.stylesheets),e.unsuspend)){var p=e.unsuspend;e.unsuspend=null,p()}},(e.imgBytes>kf?50:800)+n);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(d)}}:null}function Ao(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Do(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var To=null;function Do(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,To=new Map,n.forEach(tb,e),To=null,Ao.call(e))}function tb(e,n){if(!(n.state.loading&4)){var a=To.get(e);if(a)var s=a.get(null);else{a=new Map,To.set(e,a);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<d.length;p++){var w=d[p];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(a.set(w.dataset.precedence,w),s=w)}s&&a.set(null,s)}d=n.instance,w=d.getAttribute("data-precedence"),p=a.get(w)||s,p===s&&a.set(null,d),a.set(w,d),this.count++,s=Ao.bind(this),d.addEventListener("load",s),d.addEventListener("error",s),p?p.parentNode.insertBefore(d,p.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),n.state.loading|=4}}var Vi={$$typeof:$,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function nb(e,n,a,s,d,p,w,S,O){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=_a(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_a(0),this.hiddenUpdates=_a(null),this.identifierPrefix=s,this.onUncaughtError=d,this.onCaughtError=p,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function Tx(e,n,a,s,d,p,w,S,O,P,ae,ue){return e=new nb(e,n,a,w,O,P,ae,ue,S),n=1,p===!0&&(n|=24),p=Ln(3,null,null,n),e.current=p,p.stateNode=e,n=eu(),n.refCount++,e.pooledCache=n,n.refCount++,p.memoizedState={element:s,isDehydrated:a,cache:n},au(p),e}function Dx(e){return e?(e=pr,e):pr}function zx(e,n,a,s,d,p){d=Dx(d),s.context===null?s.context=d:s.pendingContext=d,s=ia(n),s.payload={element:a},p=p===void 0?null:p,p!==null&&(s.callback=p),a=sa(e,s,n),a!==null&&(Dn(a,e,n),Si(a,e,n))}function Mx(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<n?a:n}}function Sf(e,n){Mx(e,n),(e=e.alternate)&&Mx(e,n)}function _x(e){if(e.tag===13||e.tag===31){var n=$a(e,67108864);n!==null&&Dn(n,e,67108864),Sf(e,67108864)}}function Rx(e){if(e.tag===13||e.tag===31){var n=qn();n=ln(n);var a=$a(e,n);a!==null&&Dn(a,e,n),Sf(e,n)}}var zo=!0;function lb(e,n,a,s){var d=z.T;z.T=null;var p=q.p;try{q.p=2,jf(e,n,a,s)}finally{q.p=p,z.T=d}}function ab(e,n,a,s){var d=z.T;z.T=null;var p=q.p;try{q.p=8,jf(e,n,a,s)}finally{q.p=p,z.T=d}}function jf(e,n,a,s){if(zo){var d=Ef(s);if(d===null)uf(e,n,s,Mo,a),Bx(e,s);else if(ib(d,e,n,a,s))s.stopPropagation();else if(Bx(e,s),n&4&&-1<rb.indexOf(e)){for(;d!==null;){var p=kl(d);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var w=xn(p.pendingLanes);if(w!==0){var S=p;for(S.pendingLanes|=2,S.entangledLanes|=2;w;){var O=1<<31-Qe(w);S.entanglements[1]|=O,w&=~O}ml(p),(at&6)===0&&(mo=Dt()+500,Ui(0))}}break;case 31:case 13:S=$a(p,2),S!==null&&Dn(S,p,2),xo(),Sf(p,2)}if(p=Ef(s),p===null&&uf(e,n,s,Mo,a),p===d)break;d=p}d!==null&&s.stopPropagation()}else uf(e,n,s,null,a)}}function Ef(e){return e=Cc(e),Cf(e)}var Mo=null;function Cf(e){if(Mo=null,e=Jl(e),e!==null){var n=u(e);if(n===null)e=null;else{var a=n.tag;if(a===13){if(e=f(n),e!==null)return e;e=null}else if(a===31){if(e=m(n),e!==null)return e;e=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Mo=e,null}function Ox(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(Sn()){case G:return 2;case se:return 8;case we:case ye:return 32;case Be:return 268435456;default:return 32}default:return 32}}var Nf=!1,ya=null,va=null,ba=null,Xi=new Map,Gi=new Map,wa=[],rb="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 Bx(e,n){switch(e){case"focusin":case"focusout":ya=null;break;case"dragenter":case"dragleave":va=null;break;case"mouseover":case"mouseout":ba=null;break;case"pointerover":case"pointerout":Xi.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gi.delete(n.pointerId)}}function Qi(e,n,a,s,d,p){return e===null||e.nativeEvent!==p?(e={blockedOn:n,domEventName:a,eventSystemFlags:s,nativeEvent:p,targetContainers:[d]},n!==null&&(n=kl(n),n!==null&&_x(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function ib(e,n,a,s,d){switch(n){case"focusin":return ya=Qi(ya,e,n,a,s,d),!0;case"dragenter":return va=Qi(va,e,n,a,s,d),!0;case"mouseover":return ba=Qi(ba,e,n,a,s,d),!0;case"pointerover":var p=d.pointerId;return Xi.set(p,Qi(Xi.get(p)||null,e,n,a,s,d)),!0;case"gotpointercapture":return p=d.pointerId,Gi.set(p,Qi(Gi.get(p)||null,e,n,a,s,d)),!0}return!1}function Lx(e){var n=Jl(e.target);if(n!==null){var a=u(n);if(a!==null){if(n=a.tag,n===13){if(n=f(a),n!==null){e.blockedOn=n,ni(e.priority,function(){Rx(a)});return}}else if(n===31){if(n=m(a),n!==null){e.blockedOn=n,ni(e.priority,function(){Rx(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function _o(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var a=Ef(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);Ec=s,a.target.dispatchEvent(s),Ec=null}else return n=kl(a),n!==null&&_x(n),e.blockedOn=a,!1;n.shift()}return!0}function Fx(e,n,a){_o(e)&&a.delete(n)}function sb(){Nf=!1,ya!==null&&_o(ya)&&(ya=null),va!==null&&_o(va)&&(va=null),ba!==null&&_o(ba)&&(ba=null),Xi.forEach(Fx),Gi.forEach(Fx)}function Ro(e,n){e.blockedOn===n&&(e.blockedOn=null,Nf||(Nf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,sb)))}var Oo=null;function Ux(e){Oo!==e&&(Oo=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Oo===e&&(Oo=null);for(var n=0;n<e.length;n+=3){var a=e[n],s=e[n+1],d=e[n+2];if(typeof s!="function"){if(Cf(s||a)===null)continue;break}var p=kl(a);p!==null&&(e.splice(n,3),n-=3,ju(p,{pending:!0,data:d,method:a.method,action:s},s,d))}}))}function Ur(e){function n(O){return Ro(O,e)}ya!==null&&Ro(ya,e),va!==null&&Ro(va,e),ba!==null&&Ro(ba,e),Xi.forEach(n),Gi.forEach(n);for(var a=0;a<wa.length;a++){var s=wa[a];s.blockedOn===e&&(s.blockedOn=null)}for(;0<wa.length&&(a=wa[0],a.blockedOn===null);)Lx(a),a.blockedOn===null&&wa.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var d=a[s],p=a[s+1],w=d[Ut]||null;if(typeof p=="function")w||Ux(a);else if(w){var S=null;if(p&&p.hasAttribute("formAction")){if(d=p,w=p[Ut]||null)S=w.formAction;else if(Cf(d)!==null)continue}else S=w.action;typeof S=="function"?a[s+1]=S:(a.splice(s,3),s-=3),Ux(a)}}}function Hx(){function e(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(w){return d=w})},focusReset:"manual",scroll:"manual"})}function n(){d!==null&&(d(),d=null),s||setTimeout(a,20)}function a(){if(!s&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(a,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),d!==null&&(d(),d=null)}}}function Af(e){this._internalRoot=e}Bo.prototype.render=Af.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));var a=n.current,s=qn();zx(a,s,e,n,null,null)},Bo.prototype.unmount=Af.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;zx(e.current,2,null,e,null,null),xo(),n[Zl]=null}};function Bo(e){this._internalRoot=e}Bo.prototype.unstable_scheduleHydration=function(e){if(e){var n=al();e={blockedOn:null,target:e,priority:n};for(var a=0;a<wa.length&&n!==0&&n<wa[a].priority;a++);wa.splice(a,0,e),a===0&&Lx(e)}};var $x=l.version;if($x!=="19.2.4")throw Error(i(527,$x,"19.2.4"));q.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=h(n),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var ob={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lo.isDisabled&&Lo.supportsFiber)try{it=Lo.inject(ob),he=Lo}catch{}}return Zi.createRoot=function(e,n){if(!o(e))throw Error(i(299));var a=!1,s="",d=Qm,p=Km,w=Zm;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(w=n.onRecoverableError)),n=Tx(e,1,!1,null,null,a,s,null,d,p,w,Hx),e[Zl]=n.current,cf(e),new Af(n)},Zi.hydrateRoot=function(e,n,a){if(!o(e))throw Error(i(299));var s=!1,d="",p=Qm,w=Km,S=Zm,O=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(d=a.identifierPrefix),a.onUncaughtError!==void 0&&(p=a.onUncaughtError),a.onCaughtError!==void 0&&(w=a.onCaughtError),a.onRecoverableError!==void 0&&(S=a.onRecoverableError),a.formState!==void 0&&(O=a.formState)),n=Tx(e,1,!0,n,a??null,s,d,O,p,w,S,Hx),n.context=Dx(null),a=n.current,s=qn(),s=ln(s),d=ia(s),d.callback=null,sa(a,d,s),a=s,n.current.lanes=a,fn(n,a),ml(n),e[Zl]=n.current,cf(e),new Bo(n)},Zi.version="19.2.4",Zi}var Wx;function bb(){if(Wx)return zf.exports;Wx=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(l){console.error(l)}}return t(),zf.exports=vb(),zf.exports}var wb=bb();const kb="modulepreload",Sb=function(t){return"/"+t},Px={},jb=function(l,r,i){let o=Promise.resolve();if(r&&r.length>0){let f=function(h){return Promise.all(h.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),x=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));o=f(r.map(h=>{if(h=Sb(h),h in Px)return;Px[h]=!0;const y=h.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const v=document.createElement("link");if(v.rel=y?"stylesheet":kb,y||(v.as="script"),v.crossOrigin="",v.href=h,x&&v.setAttribute("nonce",x),document.head.appendChild(v),y)return new Promise((b,k)=>{v.addEventListener("load",b),v.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function u(f){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=f,window.dispatchEvent(m),!m.defaultPrevented)throw f}return o.then(f=>{for(const m of f||[])m.status==="rejected"&&u(m.reason);return l().catch(u)})};class Eb extends j.Component{constructor(){super(...arguments);qx(this,"state",{hasError:!1,error:null})}static getDerivedStateFromError(r){return{hasError:!0,error:r}}render(){var r;return this.state.hasError?c.jsx("div",{className:"h-screen flex items-center justify-center bg-[var(--floor-light)]",children:c.jsxs("div",{className:"text-center max-w-md",children:[c.jsx("div",{className:"text-4xl mb-3",children:"🚨"}),c.jsx("div",{className:"text-gray-800 font-semibold mb-2",children:"Something went wrong"}),c.jsx("div",{className:"text-gray-500 text-sm mb-4",children:((r=this.state.error)==null?void 0:r.message)??"An unexpected error occurred."}),c.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-gray-800 text-white rounded-lg text-sm hover:bg-gray-700",children:"Reload"})]})}):this.props.children}}const xs="/api";async function Vt(t){const l=await fetch(`${xs}${t}`);if(!l.ok)throw new Error(`API error: ${l.status}`);return l.json()}async function In(t,l){const r=await fetch(`${xs}${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!r.ok)throw new Error(`API error: ${r.status}`);return r.json()}async function Of(t,l){const r=await fetch(`${xs}${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!r.ok)throw new Error(`API error: ${r.status}`);return r.json()}async function Hr(t,l){const r={method:"DELETE"};l!==void 0&&(r.headers={"Content-Type":"application/json"},r.body=JSON.stringify(l));const i=await fetch(`${xs}${t}`,r);if(!i.ok)throw new Error(`API error: ${i.status}`);return i.json()}const Ce={getCompany:()=>Vt("/company"),getRoles:()=>Vt("/roles"),getRole:t=>Vt(`/roles/${t}`),getProjects:()=>Vt("/projects"),getProject:t=>Vt(`/projects/${t}`),getStandups:()=>Vt("/operations/standups"),getWaves:()=>Vt("/operations/waves"),getDecisions:()=>Vt("/operations/decisions"),getOrgTree:()=>Vt("/engine/org"),createRole:t=>In("/engine/roles",t),updateRole:(t,l)=>Of(`/engine/roles/${t}`,l),deleteRole:t=>Hr(`/engine/roles/${t}`),getSessions:()=>Vt("/sessions"),getSession:t=>Vt(`/sessions/${t}`),createSession:(t,l="talk")=>In("/sessions",{roleId:t,mode:l}),deleteSession:t=>Hr(`/sessions/${t}`),deleteSessions:t=>Hr("/sessions",{ids:t}),deleteEmptySessions:()=>Hr("/sessions?empty=true"),updateSession:(t,l)=>Of(`/sessions/${t}`,l),startJob:t=>In("/jobs",t),getJob:t=>Vt(`/jobs/${t}`),listJobs:t=>{const l=new URLSearchParams;t!=null&&t.status&&l.set("status",t.status),t!=null&&t.roleId&&l.set("roleId",t.roleId);const r=l.toString();return Vt(`/jobs${r?"?"+r:""}`)},abortJob:t=>Hr(`/jobs/${t}`),getStatus:()=>Vt("/status"),detectEngine:()=>In("/setup/detect-engine",{}),validatePath:t=>In("/setup/validate-path",{path:t}),scaffold:t=>In("/setup/scaffold",t),getTeams:()=>Vt("/setup/teams"),browse:t=>In("/setup/browse",{path:t}),connectAkb:t=>In("/setup/connect-akb",{path:t}),getKnowledge:()=>Vt("/knowledge"),getKnowledgeDoc:t=>Vt(`/knowledge/${t}`),createKnowledgeDoc:t=>In("/knowledge",t),updateKnowledgeDoc:(t,l)=>fetch(`${xs}/knowledge/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:l})}).then(r=>{if(!r.ok)throw new Error(`API error: ${r.status}`);return r.json()}),deleteKnowledgeDoc:t=>Hr(`/knowledge/${t}`),getPreferences:()=>Vt("/preferences"),updatePreferences:t=>Of("/preferences",t),generateSpeech:(t,l,r)=>In("/speech/generate",{roleId:t,context:l,relationships:r}),generateConversation:(t,l,r,i)=>In("/speech/conversation",{roleA:t,roleB:l,familiarity:r,context:i}),getSaveStatus:()=>Vt("/save/status"),save:t=>In("/save",{message:t}),getSaveHistory:(t=20)=>Vt(`/save/history?limit=${t}`),restoreSave:(t,l)=>In("/save/restore",{sha:t,paths:l})};function E1(t){const[l,r]=j.useState([]),[i,o]=j.useState("idle"),[u,f]=j.useState(""),[m,x]=j.useState([]),h=j.useRef(-1),y=j.useRef(null),g=j.useRef(0),v=j.useCallback(()=>{var T;if(!t)return;(T=y.current)==null||T.abort();const k=new AbortController;y.current=k,o("connecting");const E=h.current+1,N=`/api/jobs/${t}/stream?from=${E}`;fetch(N,{signal:k.signal}).then(async L=>{if(!L.ok||!L.body){o("error");return}o("streaming");const $=L.body.getReader(),K=new TextDecoder;let V="";for(;;){const{done:M,value:J}=await $.read();if(M)break;V+=K.decode(J,{stream:!0});const Q=V.split(`
50
+ `);V=Q.pop()??"";let ie="";for(const D of Q)if(D.startsWith("event: "))ie=D.slice(7).trim();else if(D.startsWith("data: ")){try{const U=JSON.parse(D.slice(6));if(ie==="activity"){const B=U;B.seq>h.current&&(h.current=B.seq),r(ne=>ne.some(te=>te.seq===B.seq)?ne:[...ne,B]),B.type==="text"&&f(ne=>ne+(B.data.text??"")),B.type==="dispatch:start"&&B.data.childJobId&&x(ne=>[...ne,B.data.childJobId]),B.type==="job:done"?o("done"):B.type==="job:error"&&o("error")}else if(ie==="stream:end"){const B=U.reason;o(B==="done"?"done":B==="error"?"error":"done")}}catch{}ie=""}}i==="streaming"&&o("done")}).catch(L=>{L.name!=="AbortError"&&(o("error"),g.current<3&&(g.current++,setTimeout(v,1e3*g.current)))})},[t]),b=j.useCallback(()=>{g.current=0,v()},[v]);return j.useEffect(()=>{if(!t){r([]),o("idle"),f(""),x([]),h.current=-1;return}return r([]),f(""),x([]),h.current=-1,g.current=0,v(),()=>{var k;(k=y.current)==null||k.abort()}},[t,v]),{events:l,status:i,textOutput:u,childJobIds:m,reconnect:b}}function Cb(t,l){const r={};return(t[t.length-1]===""?[...t,""]:t).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const Nb=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ab=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Tb={};function eg(t,l){return(Tb.jsx?Ab:Nb).test(t)}const Db=/[ \t\n\f\r]/g;function zb(t){return typeof t=="object"?t.type==="text"?tg(t.value):!1:tg(t)}function tg(t){return t.replace(Db,"")===""}class gs{constructor(l,r,i){this.normal=r,this.property=l,i&&(this.space=i)}}gs.prototype.normal={};gs.prototype.property={};gs.prototype.space=void 0;function C1(t,l){const r={},i={};for(const o of t)Object.assign(r,o.property),Object.assign(i,o.normal);return new gs(r,i,l)}function pd(t){return t.toLowerCase()}class Mn{constructor(l,r){this.attribute=r,this.property=l}}Mn.prototype.attribute="";Mn.prototype.booleanish=!1;Mn.prototype.boolean=!1;Mn.prototype.commaOrSpaceSeparated=!1;Mn.prototype.commaSeparated=!1;Mn.prototype.defined=!1;Mn.prototype.mustUseProperty=!1;Mn.prototype.number=!1;Mn.prototype.overloadedBoolean=!1;Mn.prototype.property="";Mn.prototype.spaceSeparated=!1;Mn.prototype.space=void 0;let Mb=0;const He=sr(),Gt=sr(),xd=sr(),me=sr(),yt=sr(),Qr=sr(),Yn=sr();function sr(){return 2**++Mb}const gd=Object.freeze(Object.defineProperty({__proto__:null,boolean:He,booleanish:Gt,commaOrSpaceSeparated:Yn,commaSeparated:Qr,number:me,overloadedBoolean:xd,spaceSeparated:yt},Symbol.toStringTag,{value:"Module"})),Bf=Object.keys(gd);class Od extends Mn{constructor(l,r,i,o){let u=-1;if(super(l,r),ng(this,"space",o),typeof i=="number")for(;++u<Bf.length;){const f=Bf[u];ng(this,Bf[u],(i&gd[f])===gd[f])}}}Od.prototype.defined=!0;function ng(t,l,r){r&&(t[l]=r)}function Wr(t){const l={},r={};for(const[i,o]of Object.entries(t.properties)){const u=new Od(i,t.transform(t.attributes||{},i),o,t.space);t.mustUseProperty&&t.mustUseProperty.includes(i)&&(u.mustUseProperty=!0),l[i]=u,r[pd(i)]=i,r[pd(u.attribute)]=i}return new gs(l,r,t.space)}const N1=Wr({properties:{ariaActiveDescendant:null,ariaAtomic:Gt,ariaAutoComplete:null,ariaBusy:Gt,ariaChecked:Gt,ariaColCount:me,ariaColIndex:me,ariaColSpan:me,ariaControls:yt,ariaCurrent:null,ariaDescribedBy:yt,ariaDetails:null,ariaDisabled:Gt,ariaDropEffect:yt,ariaErrorMessage:null,ariaExpanded:Gt,ariaFlowTo:yt,ariaGrabbed:Gt,ariaHasPopup:null,ariaHidden:Gt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:yt,ariaLevel:me,ariaLive:null,ariaModal:Gt,ariaMultiLine:Gt,ariaMultiSelectable:Gt,ariaOrientation:null,ariaOwns:yt,ariaPlaceholder:null,ariaPosInSet:me,ariaPressed:Gt,ariaReadOnly:Gt,ariaRelevant:null,ariaRequired:Gt,ariaRoleDescription:yt,ariaRowCount:me,ariaRowIndex:me,ariaRowSpan:me,ariaSelected:Gt,ariaSetSize:me,ariaSort:null,ariaValueMax:me,ariaValueMin:me,ariaValueNow:me,ariaValueText:null,role:null},transform(t,l){return l==="role"?l:"aria-"+l.slice(4).toLowerCase()}});function A1(t,l){return l in t?t[l]:l}function T1(t,l){return A1(t,l.toLowerCase())}const _b=Wr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Qr,acceptCharset:yt,accessKey:yt,action:null,allow:null,allowFullScreen:He,allowPaymentRequest:He,allowUserMedia:He,alt:null,as:null,async:He,autoCapitalize:null,autoComplete:yt,autoFocus:He,autoPlay:He,blocking:yt,capture:null,charSet:null,checked:He,cite:null,className:yt,cols:me,colSpan:null,content:null,contentEditable:Gt,controls:He,controlsList:yt,coords:me|Qr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:He,defer:He,dir:null,dirName:null,disabled:He,download:xd,draggable:Gt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:He,formTarget:null,headers:yt,height:me,hidden:xd,high:me,href:null,hrefLang:null,htmlFor:yt,httpEquiv:yt,id:null,imageSizes:null,imageSrcSet:null,inert:He,inputMode:null,integrity:null,is:null,isMap:He,itemId:null,itemProp:yt,itemRef:yt,itemScope:He,itemType:yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:He,low:me,manifest:null,max:null,maxLength:me,media:null,method:null,min:null,minLength:me,multiple:He,muted:He,name:null,nonce:null,noModule:He,noValidate:He,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:He,optimum:me,pattern:null,ping:yt,placeholder:null,playsInline:He,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:He,referrerPolicy:null,rel:yt,required:He,reversed:He,rows:me,rowSpan:me,sandbox:yt,scope:null,scoped:He,seamless:He,selected:He,shadowRootClonable:He,shadowRootDelegatesFocus:He,shadowRootMode:null,shape:null,size:me,sizes:null,slot:null,span:me,spellCheck:Gt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:me,step:null,style:null,tabIndex:me,target:null,title:null,translate:null,type:null,typeMustMatch:He,useMap:null,value:Gt,width:me,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:yt,axis:null,background:null,bgColor:null,border:me,borderColor:null,bottomMargin:me,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:He,declare:He,event:null,face:null,frame:null,frameBorder:null,hSpace:me,leftMargin:me,link:null,longDesc:null,lowSrc:null,marginHeight:me,marginWidth:me,noResize:He,noHref:He,noShade:He,noWrap:He,object:null,profile:null,prompt:null,rev:null,rightMargin:me,rules:null,scheme:null,scrolling:Gt,standby:null,summary:null,text:null,topMargin:me,valueType:null,version:null,vAlign:null,vLink:null,vSpace:me,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:He,disableRemotePlayback:He,prefix:null,property:null,results:me,security:null,unselectable:null},space:"html",transform:T1}),Rb=Wr({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Yn,accentHeight:me,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:me,amplitude:me,arabicForm:null,ascent:me,attributeName:null,attributeType:null,azimuth:me,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:me,by:null,calcMode:null,capHeight:me,className:yt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:me,diffuseConstant:me,direction:null,display:null,dur:null,divisor:me,dominantBaseline:null,download:He,dx:null,dy:null,edgeMode:null,editable:null,elevation:me,enableBackground:null,end:null,event:null,exponent:me,externalResourcesRequired:null,fill:null,fillOpacity:me,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Qr,g2:Qr,glyphName:Qr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:me,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:me,horizOriginX:me,horizOriginY:me,id:null,ideographic:me,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:me,k:me,k1:me,k2:me,k3:me,k4:me,kernelMatrix:Yn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:me,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:me,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:me,overlineThickness:me,paintOrder:null,panose1:null,path:null,pathLength:me,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:me,pointsAtY:me,pointsAtZ:me,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Yn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Yn,rev:Yn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Yn,requiredFeatures:Yn,requiredFonts:Yn,requiredFormats:Yn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:me,specularExponent:me,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:me,strikethroughThickness:me,string:null,stroke:null,strokeDashArray:Yn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:me,strokeOpacity:me,strokeWidth:null,style:null,surfaceScale:me,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Yn,tabIndex:me,tableValues:null,target:null,targetX:me,targetY:me,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Yn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:me,underlineThickness:me,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:me,values:null,vAlphabetic:me,vMathematical:me,vectorEffect:null,vHanging:me,vIdeographic:me,version:null,vertAdvY:me,vertOriginX:me,vertOriginY:me,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:me,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:A1}),D1=Wr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,l){return"xlink:"+l.slice(5).toLowerCase()}}),z1=Wr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:T1}),M1=Wr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,l){return"xml:"+l.slice(3).toLowerCase()}}),Ob={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Bb=/[A-Z]/g,lg=/-[a-z]/g,Lb=/^data[-\w.:]+$/i;function Fb(t,l){const r=pd(l);let i=l,o=Mn;if(r in t.normal)return t.property[t.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&Lb.test(l)){if(l.charAt(4)==="-"){const u=l.slice(5).replace(lg,Hb);i="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=l.slice(4);if(!lg.test(u)){let f=u.replace(Bb,Ub);f.charAt(0)!=="-"&&(f="-"+f),l="data"+f}}o=Od}return new o(i,l)}function Ub(t){return"-"+t.toLowerCase()}function Hb(t){return t.charAt(1).toUpperCase()}const $b=C1([N1,_b,D1,z1,M1],"html"),Bd=C1([N1,Rb,D1,z1,M1],"svg");function qb(t){return t.join(" ").trim()}var $r={},Lf,ag;function Ib(){if(ag)return Lf;ag=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,l=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,m=/^\s+|\s+$/g,x=`
51
+ `,h="/",y="*",g="",v="comment",b="declaration";function k(N,T){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];T=T||{};var L=1,$=1;function K(te){var F=te.match(l);F&&(L+=F.length);var z=te.lastIndexOf(x);$=~z?te.length-z:$+te.length}function V(){var te={line:L,column:$};return function(F){return F.position=new M(te),ie(),F}}function M(te){this.start=te,this.end={line:L,column:$},this.source=T.source}M.prototype.content=N;function J(te){var F=new Error(T.source+":"+L+":"+$+": "+te);if(F.reason=te,F.filename=T.source,F.line=L,F.column=$,F.source=N,!T.silent)throw F}function Q(te){var F=te.exec(N);if(F){var z=F[0];return K(z),N=N.slice(z.length),F}}function ie(){Q(r)}function D(te){var F;for(te=te||[];F=U();)F!==!1&&te.push(F);return te}function U(){var te=V();if(!(h!=N.charAt(0)||y!=N.charAt(1))){for(var F=2;g!=N.charAt(F)&&(y!=N.charAt(F)||h!=N.charAt(F+1));)++F;if(F+=2,g===N.charAt(F-1))return J("End of comment missing");var z=N.slice(2,F-2);return $+=2,K(z),N=N.slice(F),$+=2,te({type:v,comment:z})}}function B(){var te=V(),F=Q(i);if(F){if(U(),!Q(o))return J("property missing ':'");var z=Q(u),q=te({type:b,property:E(F[0].replace(t,g)),value:z?E(z[0].replace(t,g)):g});return Q(f),q}}function ne(){var te=[];D(te);for(var F;F=B();)F!==!1&&(te.push(F),D(te));return te}return ie(),ne()}function E(N){return N?N.replace(m,g):g}return Lf=k,Lf}var rg;function Yb(){if(rg)return $r;rg=1;var t=$r&&$r.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty($r,"__esModule",{value:!0}),$r.default=r;const l=t(Ib());function r(i,o){let u=null;if(!i||typeof i!="string")return u;const f=(0,l.default)(i),m=typeof o=="function";return f.forEach(x=>{if(x.type!=="declaration")return;const{property:h,value:y}=x;m?o(h,y,x):y&&(u=u||{},u[h]=y)}),u}return $r}var Ji={},ig;function Vb(){if(ig)return Ji;ig=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,l=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(h){return!h||r.test(h)||t.test(h)},f=function(h,y){return y.toUpperCase()},m=function(h,y){return"".concat(y,"-")},x=function(h,y){return y===void 0&&(y={}),u(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(o,m):h=h.replace(i,m),h.replace(l,f))};return Ji.camelCase=x,Ji}var Wi,sg;function Xb(){if(sg)return Wi;sg=1;var t=Wi&&Wi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},l=t(Yb()),r=Vb();function i(o,u){var f={};return!o||typeof o!="string"||(0,l.default)(o,function(m,x){m&&x&&(f[(0,r.camelCase)(m,u)]=x)}),f}return i.default=i,Wi=i,Wi}var Gb=Xb();const Qb=j1(Gb),_1=R1("end"),Ld=R1("start");function R1(t){return l;function l(r){const i=r&&r.position&&r.position[t]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function Kb(t){const l=Ld(t),r=_1(t);if(l&&r)return{start:l,end:r}}function ss(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?og(t.position):"start"in t||"end"in t?og(t):"line"in t||"column"in t?yd(t):""}function yd(t){return cg(t&&t.line)+":"+cg(t&&t.column)}function og(t){return yd(t&&t.start)+"-"+yd(t&&t.end)}function cg(t){return t&&typeof t=="number"?t:1}class pn extends Error{constructor(l,r,i){super(),typeof r=="string"&&(i=r,r=void 0);let o="",u={},f=!1;if(r&&("line"in r&&"column"in r?u={place:r}:"start"in r&&"end"in r?u={place:r}:"type"in r?u={ancestors:[r],place:r.position}:u={...r}),typeof l=="string"?o=l:!u.cause&&l&&(f=!0,o=l.message,u.cause=l),!u.ruleId&&!u.source&&typeof i=="string"){const x=i.indexOf(":");x===-1?u.ruleId=i:(u.source=i.slice(0,x),u.ruleId=i.slice(x+1))}if(!u.place&&u.ancestors&&u.ancestors){const x=u.ancestors[u.ancestors.length-1];x&&(u.place=x.position)}const m=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=m?m.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=m?m.line:void 0,this.name=ss(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=f&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}pn.prototype.file="";pn.prototype.name="";pn.prototype.reason="";pn.prototype.message="";pn.prototype.stack="";pn.prototype.column=void 0;pn.prototype.line=void 0;pn.prototype.ancestors=void 0;pn.prototype.cause=void 0;pn.prototype.fatal=void 0;pn.prototype.place=void 0;pn.prototype.ruleId=void 0;pn.prototype.source=void 0;const Fd={}.hasOwnProperty,Zb=new Map,Jb=/[A-Z]/g,Wb=new Set(["table","tbody","thead","tfoot","tr"]),Pb=new Set(["td","th"]),O1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function e2(t,l){if(!l||l.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=l.filePath||void 0;let i;if(l.development){if(typeof l.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=o2(r,l.jsxDEV)}else{if(typeof l.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof l.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=s2(r,l.jsx,l.jsxs)}const o={Fragment:l.Fragment,ancestors:[],components:l.components||{},create:i,elementAttributeNameCase:l.elementAttributeNameCase||"react",evaluater:l.createEvaluater?l.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:l.ignoreInvalidStyle||!1,passKeys:l.passKeys!==!1,passNode:l.passNode||!1,schema:l.space==="svg"?Bd:$b,stylePropertyNameCase:l.stylePropertyNameCase||"dom",tableCellAlignToStyle:l.tableCellAlignToStyle!==!1},u=B1(o,t,void 0);return u&&typeof u!="string"?u:o.create(t,o.Fragment,{children:u||void 0},void 0)}function B1(t,l,r){if(l.type==="element")return t2(t,l,r);if(l.type==="mdxFlowExpression"||l.type==="mdxTextExpression")return n2(t,l);if(l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement")return a2(t,l,r);if(l.type==="mdxjsEsm")return l2(t,l);if(l.type==="root")return r2(t,l,r);if(l.type==="text")return i2(t,l)}function t2(t,l,r){const i=t.schema;let o=i;l.tagName.toLowerCase()==="svg"&&i.space==="html"&&(o=Bd,t.schema=o),t.ancestors.push(l);const u=F1(t,l.tagName,!1),f=c2(t,l);let m=Hd(t,l);return Wb.has(l.tagName)&&(m=m.filter(function(x){return typeof x=="string"?!zb(x):!0})),L1(t,f,u,l),Ud(f,m),t.ancestors.pop(),t.schema=i,t.create(l,u,f,r)}function n2(t,l){if(l.data&&l.data.estree&&t.evaluater){const i=l.data.estree.body[0];return i.type,t.evaluater.evaluateExpression(i.expression)}ds(t,l.position)}function l2(t,l){if(l.data&&l.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(l.data.estree);ds(t,l.position)}function a2(t,l,r){const i=t.schema;let o=i;l.name==="svg"&&i.space==="html"&&(o=Bd,t.schema=o),t.ancestors.push(l);const u=l.name===null?t.Fragment:F1(t,l.name,!0),f=u2(t,l),m=Hd(t,l);return L1(t,f,u,l),Ud(f,m),t.ancestors.pop(),t.schema=i,t.create(l,u,f,r)}function r2(t,l,r){const i={};return Ud(i,Hd(t,l)),t.create(l,t.Fragment,i,r)}function i2(t,l){return l.value}function L1(t,l,r,i){typeof r!="string"&&r!==t.Fragment&&t.passNode&&(l.node=i)}function Ud(t,l){if(l.length>0){const r=l.length>1?l:l[0];r&&(t.children=r)}}function s2(t,l,r){return i;function i(o,u,f,m){const h=Array.isArray(f.children)?r:l;return m?h(u,f,m):h(u,f)}}function o2(t,l){return r;function r(i,o,u,f){const m=Array.isArray(u.children),x=Ld(i);return l(o,u,f,m,{columnNumber:x?x.column-1:void 0,fileName:t,lineNumber:x?x.line:void 0},void 0)}}function c2(t,l){const r={};let i,o;for(o in l.properties)if(o!=="children"&&Fd.call(l.properties,o)){const u=f2(t,o,l.properties[o]);if(u){const[f,m]=u;t.tableCellAlignToStyle&&f==="align"&&typeof m=="string"&&Pb.has(l.tagName)?i=m:r[f]=m}}if(i){const u=r.style||(r.style={});u[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return r}function u2(t,l){const r={};for(const i of l.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&t.evaluater){const u=i.data.estree.body[0];u.type;const f=u.expression;f.type;const m=f.properties[0];m.type,Object.assign(r,t.evaluater.evaluateExpression(m.argument))}else ds(t,l.position);else{const o=i.name;let u;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&t.evaluater){const m=i.value.data.estree.body[0];m.type,u=t.evaluater.evaluateExpression(m.expression)}else ds(t,l.position);else u=i.value===null?!0:i.value;r[o]=u}return r}function Hd(t,l){const r=[];let i=-1;const o=t.passKeys?new Map:Zb;for(;++i<l.children.length;){const u=l.children[i];let f;if(t.passKeys){const x=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(x){const h=o.get(x)||0;f=x+"-"+h,o.set(x,h+1)}}const m=B1(t,u,f);m!==void 0&&r.push(m)}return r}function f2(t,l,r){const i=Fb(t.schema,l);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=i.commaSeparated?Cb(r):qb(r)),i.property==="style"){let o=typeof r=="object"?r:d2(t,String(r));return t.stylePropertyNameCase==="css"&&(o=h2(o)),["style",o]}return[t.elementAttributeNameCase==="react"&&i.space?Ob[i.property]||i.property:i.attribute,r]}}function d2(t,l){try{return Qb(l,{reactCompat:!0})}catch(r){if(t.ignoreInvalidStyle)return{};const i=r,o=new pn("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=t.filePath||void 0,o.url=O1+"#cannot-parse-style-attribute",o}}function F1(t,l,r){let i;if(!r)i={type:"Literal",value:l};else if(l.includes(".")){const o=l.split(".");let u=-1,f;for(;++u<o.length;){const m=eg(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};f=f?{type:"MemberExpression",object:f,property:m,computed:!!(u&&m.type==="Literal"),optional:!1}:m}i=f}else i=eg(l)&&!/^[a-z]/.test(l)?{type:"Identifier",name:l}:{type:"Literal",value:l};if(i.type==="Literal"){const o=i.value;return Fd.call(t.components,o)?t.components[o]:o}if(t.evaluater)return t.evaluater.evaluateExpression(i);ds(t)}function ds(t,l){const r=new pn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:l,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=t.filePath||void 0,r.url=O1+"#cannot-handle-mdx-estrees-without-createevaluater",r}function h2(t){const l={};let r;for(r in t)Fd.call(t,r)&&(l[m2(r)]=t[r]);return l}function m2(t){let l=t.replace(Jb,p2);return l.slice(0,3)==="ms-"&&(l="-"+l),l}function p2(t){return"-"+t.toLowerCase()}const Ff={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},x2={};function $d(t,l){const r=x2,i=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return U1(t,i,o)}function U1(t,l,r){if(g2(t)){if("value"in t)return t.type==="html"&&!r?"":t.value;if(l&&"alt"in t&&t.alt)return t.alt;if("children"in t)return ug(t.children,l,r)}return Array.isArray(t)?ug(t,l,r):""}function ug(t,l,r){const i=[];let o=-1;for(;++o<t.length;)i[o]=U1(t[o],l,r);return i.join("")}function g2(t){return!!(t&&typeof t=="object")}const fg=document.createElement("i");function qd(t){const l="&"+t+";";fg.innerHTML=l;const r=fg.textContent;return r.charCodeAt(r.length-1)===59&&t!=="semi"||r===l?!1:r}function Vn(t,l,r,i){const o=t.length;let u=0,f;if(l<0?l=-l>o?0:o+l:l=l>o?o:l,r=r>0?r:0,i.length<1e4)f=Array.from(i),f.unshift(l,r),t.splice(...f);else for(r&&t.splice(l,r);u<i.length;)f=i.slice(u,u+1e4),f.unshift(l,0),t.splice(...f),u+=1e4,l+=1e4}function nl(t,l){return t.length>0?(Vn(t,t.length,0,l),t):l}const dg={}.hasOwnProperty;function H1(t){const l={};let r=-1;for(;++r<t.length;)y2(l,t[r]);return l}function y2(t,l){let r;for(r in l){const o=(dg.call(t,r)?t[r]:void 0)||(t[r]={}),u=l[r];let f;if(u)for(f in u){dg.call(o,f)||(o[f]=[]);const m=u[f];v2(o[f],Array.isArray(m)?m:m?[m]:[])}}}function v2(t,l){let r=-1;const i=[];for(;++r<l.length;)(l[r].add==="after"?t:i).push(l[r]);Vn(t,0,0,i)}function $1(t,l){const r=Number.parseInt(t,l);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function cl(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const yn=Aa(/[A-Za-z]/),mn=Aa(/[\dA-Za-z]/),b2=Aa(/[#-'*+\--9=?A-Z^-~]/);function rc(t){return t!==null&&(t<32||t===127)}const vd=Aa(/\d/),w2=Aa(/[\dA-Fa-f]/),k2=Aa(/[!-/:-@[-`{-~]/);function Te(t){return t!==null&&t<-2}function pt(t){return t!==null&&(t<0||t===32)}function Ve(t){return t===-2||t===-1||t===32}const hc=Aa(new RegExp("\\p{P}|\\p{S}","u")),rr=Aa(/\s/);function Aa(t){return l;function l(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function Pr(t){const l=[];let r=-1,i=0,o=0;for(;++r<t.length;){const u=t.charCodeAt(r);let f="";if(u===37&&mn(t.charCodeAt(r+1))&&mn(t.charCodeAt(r+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(f=String.fromCharCode(u));else if(u>55295&&u<57344){const m=t.charCodeAt(r+1);u<56320&&m>56319&&m<57344?(f=String.fromCharCode(u,m),o=1):f="�"}else f=String.fromCharCode(u);f&&(l.push(t.slice(i,r),encodeURIComponent(f)),i=r+o+1,f=""),o&&(r+=o,o=0)}return l.join("")+t.slice(i)}function et(t,l,r,i){const o=i?i-1:Number.POSITIVE_INFINITY;let u=0;return f;function f(x){return Ve(x)?(t.enter(r),m(x)):l(x)}function m(x){return Ve(x)&&u++<o?(t.consume(x),m):(t.exit(r),l(x))}}const S2={tokenize:j2};function j2(t){const l=t.attempt(this.parser.constructs.contentInitial,i,o);let r;return l;function i(m){if(m===null){t.consume(m);return}return t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),et(t,l,"linePrefix")}function o(m){return t.enter("paragraph"),u(m)}function u(m){const x=t.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=x),r=x,f(m)}function f(m){if(m===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(m);return}return Te(m)?(t.consume(m),t.exit("chunkText"),u):(t.consume(m),f)}}const E2={tokenize:C2},hg={tokenize:N2};function C2(t){const l=this,r=[];let i=0,o,u,f;return m;function m($){if(i<r.length){const K=r[i];return l.containerState=K[1],t.attempt(K[0].continuation,x,h)($)}return h($)}function x($){if(i++,l.containerState._closeFlow){l.containerState._closeFlow=void 0,o&&L();const K=l.events.length;let V=K,M;for(;V--;)if(l.events[V][0]==="exit"&&l.events[V][1].type==="chunkFlow"){M=l.events[V][1].end;break}T(i);let J=K;for(;J<l.events.length;)l.events[J][1].end={...M},J++;return Vn(l.events,V+1,0,l.events.slice(K)),l.events.length=J,h($)}return m($)}function h($){if(i===r.length){if(!o)return v($);if(o.currentConstruct&&o.currentConstruct.concrete)return k($);l.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return l.containerState={},t.check(hg,y,g)($)}function y($){return o&&L(),T(i),v($)}function g($){return l.parser.lazy[l.now().line]=i!==r.length,f=l.now().offset,k($)}function v($){return l.containerState={},t.attempt(hg,b,k)($)}function b($){return i++,r.push([l.currentConstruct,l.containerState]),v($)}function k($){if($===null){o&&L(),T(0),t.consume($);return}return o=o||l.parser.flow(l.now()),t.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),E($)}function E($){if($===null){N(t.exit("chunkFlow"),!0),T(0),t.consume($);return}return Te($)?(t.consume($),N(t.exit("chunkFlow")),i=0,l.interrupt=void 0,m):(t.consume($),E)}function N($,K){const V=l.sliceStream($);if(K&&V.push(null),$.previous=u,u&&(u.next=$),u=$,o.defineSkip($.start),o.write(V),l.parser.lazy[$.start.line]){let M=o.events.length;for(;M--;)if(o.events[M][1].start.offset<f&&(!o.events[M][1].end||o.events[M][1].end.offset>f))return;const J=l.events.length;let Q=J,ie,D;for(;Q--;)if(l.events[Q][0]==="exit"&&l.events[Q][1].type==="chunkFlow"){if(ie){D=l.events[Q][1].end;break}ie=!0}for(T(i),M=J;M<l.events.length;)l.events[M][1].end={...D},M++;Vn(l.events,Q+1,0,l.events.slice(J)),l.events.length=M}}function T($){let K=r.length;for(;K-- >$;){const V=r[K];l.containerState=V[1],V[0].exit.call(l,t)}r.length=$}function L(){o.write([null]),u=void 0,o=void 0,l.containerState._closeFlow=void 0}}function N2(t,l,r){return et(t,t.attempt(this.parser.constructs.document,l,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Zr(t){if(t===null||pt(t)||rr(t))return 1;if(hc(t))return 2}function mc(t,l,r){const i=[];let o=-1;for(;++o<t.length;){const u=t[o].resolveAll;u&&!i.includes(u)&&(l=u(l,r),i.push(u))}return l}const bd={name:"attention",resolveAll:A2,tokenize:T2};function A2(t,l){let r=-1,i,o,u,f,m,x,h,y;for(;++r<t.length;)if(t[r][0]==="enter"&&t[r][1].type==="attentionSequence"&&t[r][1]._close){for(i=r;i--;)if(t[i][0]==="exit"&&t[i][1].type==="attentionSequence"&&t[i][1]._open&&l.sliceSerialize(t[i][1]).charCodeAt(0)===l.sliceSerialize(t[r][1]).charCodeAt(0)){if((t[i][1]._close||t[r][1]._open)&&(t[r][1].end.offset-t[r][1].start.offset)%3&&!((t[i][1].end.offset-t[i][1].start.offset+t[r][1].end.offset-t[r][1].start.offset)%3))continue;x=t[i][1].end.offset-t[i][1].start.offset>1&&t[r][1].end.offset-t[r][1].start.offset>1?2:1;const g={...t[i][1].end},v={...t[r][1].start};mg(g,-x),mg(v,x),f={type:x>1?"strongSequence":"emphasisSequence",start:g,end:{...t[i][1].end}},m={type:x>1?"strongSequence":"emphasisSequence",start:{...t[r][1].start},end:v},u={type:x>1?"strongText":"emphasisText",start:{...t[i][1].end},end:{...t[r][1].start}},o={type:x>1?"strong":"emphasis",start:{...f.start},end:{...m.end}},t[i][1].end={...f.start},t[r][1].start={...m.end},h=[],t[i][1].end.offset-t[i][1].start.offset&&(h=nl(h,[["enter",t[i][1],l],["exit",t[i][1],l]])),h=nl(h,[["enter",o,l],["enter",f,l],["exit",f,l],["enter",u,l]]),h=nl(h,mc(l.parser.constructs.insideSpan.null,t.slice(i+1,r),l)),h=nl(h,[["exit",u,l],["enter",m,l],["exit",m,l],["exit",o,l]]),t[r][1].end.offset-t[r][1].start.offset?(y=2,h=nl(h,[["enter",t[r][1],l],["exit",t[r][1],l]])):y=0,Vn(t,i-1,r-i+3,h),r=i+h.length-y-2;break}}for(r=-1;++r<t.length;)t[r][1].type==="attentionSequence"&&(t[r][1].type="data");return t}function T2(t,l){const r=this.parser.constructs.attentionMarkers.null,i=this.previous,o=Zr(i);let u;return f;function f(x){return u=x,t.enter("attentionSequence"),m(x)}function m(x){if(x===u)return t.consume(x),m;const h=t.exit("attentionSequence"),y=Zr(x),g=!y||y===2&&o||r.includes(x),v=!o||o===2&&y||r.includes(i);return h._open=!!(u===42?g:g&&(o||!v)),h._close=!!(u===42?v:v&&(y||!g)),l(x)}}function mg(t,l){t.column+=l,t.offset+=l,t._bufferIndex+=l}const D2={name:"autolink",tokenize:z2};function z2(t,l,r){let i=0;return o;function o(b){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),u}function u(b){return yn(b)?(t.consume(b),f):b===64?r(b):h(b)}function f(b){return b===43||b===45||b===46||mn(b)?(i=1,m(b)):h(b)}function m(b){return b===58?(t.consume(b),i=0,x):(b===43||b===45||b===46||mn(b))&&i++<32?(t.consume(b),m):(i=0,h(b))}function x(b){return b===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.exit("autolink"),l):b===null||b===32||b===60||rc(b)?r(b):(t.consume(b),x)}function h(b){return b===64?(t.consume(b),y):b2(b)?(t.consume(b),h):r(b)}function y(b){return mn(b)?g(b):r(b)}function g(b){return b===46?(t.consume(b),i=0,y):b===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.exit("autolink"),l):v(b)}function v(b){if((b===45||mn(b))&&i++<63){const k=b===45?v:g;return t.consume(b),k}return r(b)}}const ys={partial:!0,tokenize:M2};function M2(t,l,r){return i;function i(u){return Ve(u)?et(t,o,"linePrefix")(u):o(u)}function o(u){return u===null||Te(u)?l(u):r(u)}}const q1={continuation:{tokenize:R2},exit:O2,name:"blockQuote",tokenize:_2};function _2(t,l,r){const i=this;return o;function o(f){if(f===62){const m=i.containerState;return m.open||(t.enter("blockQuote",{_container:!0}),m.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(f),t.exit("blockQuoteMarker"),u}return r(f)}function u(f){return Ve(f)?(t.enter("blockQuotePrefixWhitespace"),t.consume(f),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),l):(t.exit("blockQuotePrefix"),l(f))}}function R2(t,l,r){const i=this;return o;function o(f){return Ve(f)?et(t,u,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):u(f)}function u(f){return t.attempt(q1,l,r)(f)}}function O2(t){t.exit("blockQuote")}const I1={name:"characterEscape",tokenize:B2};function B2(t,l,r){return i;function i(u){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(u),t.exit("escapeMarker"),o}function o(u){return k2(u)?(t.enter("characterEscapeValue"),t.consume(u),t.exit("characterEscapeValue"),t.exit("characterEscape"),l):r(u)}}const Y1={name:"characterReference",tokenize:L2};function L2(t,l,r){const i=this;let o=0,u,f;return m;function m(g){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(g),t.exit("characterReferenceMarker"),x}function x(g){return g===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(g),t.exit("characterReferenceMarkerNumeric"),h):(t.enter("characterReferenceValue"),u=31,f=mn,y(g))}function h(g){return g===88||g===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(g),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),u=6,f=w2,y):(t.enter("characterReferenceValue"),u=7,f=vd,y(g))}function y(g){if(g===59&&o){const v=t.exit("characterReferenceValue");return f===mn&&!qd(i.sliceSerialize(v))?r(g):(t.enter("characterReferenceMarker"),t.consume(g),t.exit("characterReferenceMarker"),t.exit("characterReference"),l)}return f(g)&&o++<u?(t.consume(g),y):r(g)}}const pg={partial:!0,tokenize:U2},xg={concrete:!0,name:"codeFenced",tokenize:F2};function F2(t,l,r){const i=this,o={partial:!0,tokenize:V};let u=0,f=0,m;return x;function x(M){return h(M)}function h(M){const J=i.events[i.events.length-1];return u=J&&J[1].type==="linePrefix"?J[2].sliceSerialize(J[1],!0).length:0,m=M,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),y(M)}function y(M){return M===m?(f++,t.consume(M),y):f<3?r(M):(t.exit("codeFencedFenceSequence"),Ve(M)?et(t,g,"whitespace")(M):g(M))}function g(M){return M===null||Te(M)?(t.exit("codeFencedFence"),i.interrupt?l(M):t.check(pg,E,K)(M)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),v(M))}function v(M){return M===null||Te(M)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),g(M)):Ve(M)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),et(t,b,"whitespace")(M)):M===96&&M===m?r(M):(t.consume(M),v)}function b(M){return M===null||Te(M)?g(M):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),k(M))}function k(M){return M===null||Te(M)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),g(M)):M===96&&M===m?r(M):(t.consume(M),k)}function E(M){return t.attempt(o,K,N)(M)}function N(M){return t.enter("lineEnding"),t.consume(M),t.exit("lineEnding"),T}function T(M){return u>0&&Ve(M)?et(t,L,"linePrefix",u+1)(M):L(M)}function L(M){return M===null||Te(M)?t.check(pg,E,K)(M):(t.enter("codeFlowValue"),$(M))}function $(M){return M===null||Te(M)?(t.exit("codeFlowValue"),L(M)):(t.consume(M),$)}function K(M){return t.exit("codeFenced"),l(M)}function V(M,J,Q){let ie=0;return D;function D(F){return M.enter("lineEnding"),M.consume(F),M.exit("lineEnding"),U}function U(F){return M.enter("codeFencedFence"),Ve(F)?et(M,B,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):B(F)}function B(F){return F===m?(M.enter("codeFencedFenceSequence"),ne(F)):Q(F)}function ne(F){return F===m?(ie++,M.consume(F),ne):ie>=f?(M.exit("codeFencedFenceSequence"),Ve(F)?et(M,te,"whitespace")(F):te(F)):Q(F)}function te(F){return F===null||Te(F)?(M.exit("codeFencedFence"),J(F)):Q(F)}}}function U2(t,l,r){const i=this;return o;function o(f){return f===null?r(f):(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),u)}function u(f){return i.parser.lazy[i.now().line]?r(f):l(f)}}const Uf={name:"codeIndented",tokenize:$2},H2={partial:!0,tokenize:q2};function $2(t,l,r){const i=this;return o;function o(h){return t.enter("codeIndented"),et(t,u,"linePrefix",5)(h)}function u(h){const y=i.events[i.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?f(h):r(h)}function f(h){return h===null?x(h):Te(h)?t.attempt(H2,f,x)(h):(t.enter("codeFlowValue"),m(h))}function m(h){return h===null||Te(h)?(t.exit("codeFlowValue"),f(h)):(t.consume(h),m)}function x(h){return t.exit("codeIndented"),l(h)}}function q2(t,l,r){const i=this;return o;function o(f){return i.parser.lazy[i.now().line]?r(f):Te(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),o):et(t,u,"linePrefix",5)(f)}function u(f){const m=i.events[i.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(f):Te(f)?o(f):r(f)}}const I2={name:"codeText",previous:V2,resolve:Y2,tokenize:X2};function Y2(t){let l=t.length-4,r=3,i,o;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[l][1].type==="lineEnding"||t[l][1].type==="space")){for(i=r;++i<l;)if(t[i][1].type==="codeTextData"){t[r][1].type="codeTextPadding",t[l][1].type="codeTextPadding",r+=2,l-=2;break}}for(i=r-1,l++;++i<=l;)o===void 0?i!==l&&t[i][1].type!=="lineEnding"&&(o=i):(i===l||t[i][1].type==="lineEnding")&&(t[o][1].type="codeTextData",i!==o+2&&(t[o][1].end=t[i-1][1].end,t.splice(o+2,i-o-2),l-=i-o-2,i=o+2),o=void 0);return t}function V2(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function X2(t,l,r){let i=0,o,u;return f;function f(g){return t.enter("codeText"),t.enter("codeTextSequence"),m(g)}function m(g){return g===96?(t.consume(g),i++,m):(t.exit("codeTextSequence"),x(g))}function x(g){return g===null?r(g):g===32?(t.enter("space"),t.consume(g),t.exit("space"),x):g===96?(u=t.enter("codeTextSequence"),o=0,y(g)):Te(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),x):(t.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||Te(g)?(t.exit("codeTextData"),x(g)):(t.consume(g),h)}function y(g){return g===96?(t.consume(g),o++,y):o===i?(t.exit("codeTextSequence"),t.exit("codeText"),l(g)):(u.type="codeTextData",h(g))}}class G2{constructor(l){this.left=l?[...l]:[],this.right=[]}get(l){if(l<0||l>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+l+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return l<this.left.length?this.left[l]:this.right[this.right.length-l+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(l,r){const i=r??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(l,i):l>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-l+this.left.length).reverse():this.left.slice(l).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(l,r,i){const o=r||0;this.setCursor(Math.trunc(l));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&Pi(this.left,i),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(l){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(l)}pushMany(l){this.setCursor(Number.POSITIVE_INFINITY),Pi(this.left,l)}unshift(l){this.setCursor(0),this.right.push(l)}unshiftMany(l){this.setCursor(0),Pi(this.right,l.reverse())}setCursor(l){if(!(l===this.left.length||l>this.left.length&&this.right.length===0||l<0&&this.left.length===0))if(l<this.left.length){const r=this.left.splice(l,Number.POSITIVE_INFINITY);Pi(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-l,Number.POSITIVE_INFINITY);Pi(this.left,r.reverse())}}}function Pi(t,l){let r=0;if(l.length<1e4)t.push(...l);else for(;r<l.length;)t.push(...l.slice(r,r+1e4)),r+=1e4}function V1(t){const l={};let r=-1,i,o,u,f,m,x,h;const y=new G2(t);for(;++r<y.length;){for(;r in l;)r=l[r];if(i=y.get(r),r&&i[1].type==="chunkFlow"&&y.get(r-1)[1].type==="listItemPrefix"&&(x=i[1]._tokenizer.events,u=0,u<x.length&&x[u][1].type==="lineEndingBlank"&&(u+=2),u<x.length&&x[u][1].type==="content"))for(;++u<x.length&&x[u][1].type!=="content";)x[u][1].type==="chunkText"&&(x[u][1]._isInFirstContentOfListItem=!0,u++);if(i[0]==="enter")i[1].contentType&&(Object.assign(l,Q2(y,r)),r=l[r],h=!0);else if(i[1]._container){for(u=r,o=void 0;u--;)if(f=y.get(u),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(o&&(y.get(o)[1].type="lineEndingBlank"),f[1].type="lineEnding",o=u);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;o&&(i[1].end={...y.get(o)[1].start},m=y.slice(o,r),m.unshift(i),y.splice(o,r-o+1,m))}}return Vn(t,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function Q2(t,l){const r=t.get(l)[1],i=t.get(l)[2];let o=l-1;const u=[];let f=r._tokenizer;f||(f=i.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const m=f.events,x=[],h={};let y,g,v=-1,b=r,k=0,E=0;const N=[E];for(;b;){for(;t.get(++o)[1]!==b;);u.push(o),b._tokenizer||(y=i.sliceStream(b),b.next||y.push(null),g&&f.defineSkip(b.start),b._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(y),b._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),g=b,b=b.next}for(b=r;++v<m.length;)m[v][0]==="exit"&&m[v-1][0]==="enter"&&m[v][1].type===m[v-1][1].type&&m[v][1].start.line!==m[v][1].end.line&&(E=v+1,N.push(E),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(f.events=[],b?(b._tokenizer=void 0,b.previous=void 0):N.pop(),v=N.length;v--;){const T=m.slice(N[v],N[v+1]),L=u.pop();x.push([L,L+T.length-1]),t.splice(L,2,T)}for(x.reverse(),v=-1;++v<x.length;)h[k+x[v][0]]=k+x[v][1],k+=x[v][1]-x[v][0]-1;return h}const K2={resolve:J2,tokenize:W2},Z2={partial:!0,tokenize:P2};function J2(t){return V1(t),t}function W2(t,l){let r;return i;function i(m){return t.enter("content"),r=t.enter("chunkContent",{contentType:"content"}),o(m)}function o(m){return m===null?u(m):Te(m)?t.check(Z2,f,u)(m):(t.consume(m),o)}function u(m){return t.exit("chunkContent"),t.exit("content"),l(m)}function f(m){return t.consume(m),t.exit("chunkContent"),r.next=t.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function P2(t,l,r){const i=this;return o;function o(f){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),et(t,u,"linePrefix")}function u(f){if(f===null||Te(f))return r(f);const m=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(f):t.interrupt(i.parser.constructs.flow,r,l)(f)}}function X1(t,l,r,i,o,u,f,m,x){const h=x||Number.POSITIVE_INFINITY;let y=0;return g;function g(T){return T===60?(t.enter(i),t.enter(o),t.enter(u),t.consume(T),t.exit(u),v):T===null||T===32||T===41||rc(T)?r(T):(t.enter(i),t.enter(f),t.enter(m),t.enter("chunkString",{contentType:"string"}),E(T))}function v(T){return T===62?(t.enter(u),t.consume(T),t.exit(u),t.exit(o),t.exit(i),l):(t.enter(m),t.enter("chunkString",{contentType:"string"}),b(T))}function b(T){return T===62?(t.exit("chunkString"),t.exit(m),v(T)):T===null||T===60||Te(T)?r(T):(t.consume(T),T===92?k:b)}function k(T){return T===60||T===62||T===92?(t.consume(T),b):b(T)}function E(T){return!y&&(T===null||T===41||pt(T))?(t.exit("chunkString"),t.exit(m),t.exit(f),t.exit(i),l(T)):y<h&&T===40?(t.consume(T),y++,E):T===41?(t.consume(T),y--,E):T===null||T===32||T===40||rc(T)?r(T):(t.consume(T),T===92?N:E)}function N(T){return T===40||T===41||T===92?(t.consume(T),E):E(T)}}function G1(t,l,r,i,o,u){const f=this;let m=0,x;return h;function h(b){return t.enter(i),t.enter(o),t.consume(b),t.exit(o),t.enter(u),y}function y(b){return m>999||b===null||b===91||b===93&&!x||b===94&&!m&&"_hiddenFootnoteSupport"in f.parser.constructs?r(b):b===93?(t.exit(u),t.enter(o),t.consume(b),t.exit(o),t.exit(i),l):Te(b)?(t.enter("lineEnding"),t.consume(b),t.exit("lineEnding"),y):(t.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||b===91||b===93||Te(b)||m++>999?(t.exit("chunkString"),y(b)):(t.consume(b),x||(x=!Ve(b)),b===92?v:g)}function v(b){return b===91||b===92||b===93?(t.consume(b),m++,g):g(b)}}function Q1(t,l,r,i,o,u){let f;return m;function m(v){return v===34||v===39||v===40?(t.enter(i),t.enter(o),t.consume(v),t.exit(o),f=v===40?41:v,x):r(v)}function x(v){return v===f?(t.enter(o),t.consume(v),t.exit(o),t.exit(i),l):(t.enter(u),h(v))}function h(v){return v===f?(t.exit(u),x(f)):v===null?r(v):Te(v)?(t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),et(t,h,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),y(v))}function y(v){return v===f||v===null||Te(v)?(t.exit("chunkString"),h(v)):(t.consume(v),v===92?g:y)}function g(v){return v===f||v===92?(t.consume(v),y):y(v)}}function os(t,l){let r;return i;function i(o){return Te(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),r=!0,i):Ve(o)?et(t,i,r?"linePrefix":"lineSuffix")(o):l(o)}}const ew={name:"definition",tokenize:nw},tw={partial:!0,tokenize:lw};function nw(t,l,r){const i=this;let o;return u;function u(b){return t.enter("definition"),f(b)}function f(b){return G1.call(i,t,m,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function m(b){return o=cl(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),b===58?(t.enter("definitionMarker"),t.consume(b),t.exit("definitionMarker"),x):r(b)}function x(b){return pt(b)?os(t,h)(b):h(b)}function h(b){return X1(t,y,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function y(b){return t.attempt(tw,g,g)(b)}function g(b){return Ve(b)?et(t,v,"whitespace")(b):v(b)}function v(b){return b===null||Te(b)?(t.exit("definition"),i.parser.defined.push(o),l(b)):r(b)}}function lw(t,l,r){return i;function i(m){return pt(m)?os(t,o)(m):r(m)}function o(m){return Q1(t,u,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(m)}function u(m){return Ve(m)?et(t,f,"whitespace")(m):f(m)}function f(m){return m===null||Te(m)?l(m):r(m)}}const aw={name:"hardBreakEscape",tokenize:rw};function rw(t,l,r){return i;function i(u){return t.enter("hardBreakEscape"),t.consume(u),o}function o(u){return Te(u)?(t.exit("hardBreakEscape"),l(u)):r(u)}}const iw={name:"headingAtx",resolve:sw,tokenize:ow};function sw(t,l){let r=t.length-2,i=3,o,u;return t[i][1].type==="whitespace"&&(i+=2),r-2>i&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(i===r-1||r-4>i&&t[r-2][1].type==="whitespace")&&(r-=i+1===r?2:4),r>i&&(o={type:"atxHeadingText",start:t[i][1].start,end:t[r][1].end},u={type:"chunkText",start:t[i][1].start,end:t[r][1].end,contentType:"text"},Vn(t,i,r-i+1,[["enter",o,l],["enter",u,l],["exit",u,l],["exit",o,l]])),t}function ow(t,l,r){let i=0;return o;function o(y){return t.enter("atxHeading"),u(y)}function u(y){return t.enter("atxHeadingSequence"),f(y)}function f(y){return y===35&&i++<6?(t.consume(y),f):y===null||pt(y)?(t.exit("atxHeadingSequence"),m(y)):r(y)}function m(y){return y===35?(t.enter("atxHeadingSequence"),x(y)):y===null||Te(y)?(t.exit("atxHeading"),l(y)):Ve(y)?et(t,m,"whitespace")(y):(t.enter("atxHeadingText"),h(y))}function x(y){return y===35?(t.consume(y),x):(t.exit("atxHeadingSequence"),m(y))}function h(y){return y===null||y===35||pt(y)?(t.exit("atxHeadingText"),m(y)):(t.consume(y),h)}}const cw=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],gg=["pre","script","style","textarea"],uw={concrete:!0,name:"htmlFlow",resolveTo:hw,tokenize:mw},fw={partial:!0,tokenize:xw},dw={partial:!0,tokenize:pw};function hw(t){let l=t.length;for(;l--&&!(t[l][0]==="enter"&&t[l][1].type==="htmlFlow"););return l>1&&t[l-2][1].type==="linePrefix"&&(t[l][1].start=t[l-2][1].start,t[l+1][1].start=t[l-2][1].start,t.splice(l-2,2)),t}function mw(t,l,r){const i=this;let o,u,f,m,x;return h;function h(C){return y(C)}function y(C){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(C),g}function g(C){return C===33?(t.consume(C),v):C===47?(t.consume(C),u=!0,E):C===63?(t.consume(C),o=3,i.interrupt?l:A):yn(C)?(t.consume(C),f=String.fromCharCode(C),N):r(C)}function v(C){return C===45?(t.consume(C),o=2,b):C===91?(t.consume(C),o=5,m=0,k):yn(C)?(t.consume(C),o=4,i.interrupt?l:A):r(C)}function b(C){return C===45?(t.consume(C),i.interrupt?l:A):r(C)}function k(C){const de="CDATA[";return C===de.charCodeAt(m++)?(t.consume(C),m===de.length?i.interrupt?l:B:k):r(C)}function E(C){return yn(C)?(t.consume(C),f=String.fromCharCode(C),N):r(C)}function N(C){if(C===null||C===47||C===62||pt(C)){const de=C===47,pe=f.toLowerCase();return!de&&!u&&gg.includes(pe)?(o=1,i.interrupt?l(C):B(C)):cw.includes(f.toLowerCase())?(o=6,de?(t.consume(C),T):i.interrupt?l(C):B(C)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?r(C):u?L(C):$(C))}return C===45||mn(C)?(t.consume(C),f+=String.fromCharCode(C),N):r(C)}function T(C){return C===62?(t.consume(C),i.interrupt?l:B):r(C)}function L(C){return Ve(C)?(t.consume(C),L):D(C)}function $(C){return C===47?(t.consume(C),D):C===58||C===95||yn(C)?(t.consume(C),K):Ve(C)?(t.consume(C),$):D(C)}function K(C){return C===45||C===46||C===58||C===95||mn(C)?(t.consume(C),K):V(C)}function V(C){return C===61?(t.consume(C),M):Ve(C)?(t.consume(C),V):$(C)}function M(C){return C===null||C===60||C===61||C===62||C===96?r(C):C===34||C===39?(t.consume(C),x=C,J):Ve(C)?(t.consume(C),M):Q(C)}function J(C){return C===x?(t.consume(C),x=null,ie):C===null||Te(C)?r(C):(t.consume(C),J)}function Q(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||pt(C)?V(C):(t.consume(C),Q)}function ie(C){return C===47||C===62||Ve(C)?$(C):r(C)}function D(C){return C===62?(t.consume(C),U):r(C)}function U(C){return C===null||Te(C)?B(C):Ve(C)?(t.consume(C),U):r(C)}function B(C){return C===45&&o===2?(t.consume(C),z):C===60&&o===1?(t.consume(C),q):C===62&&o===4?(t.consume(C),_):C===63&&o===3?(t.consume(C),A):C===93&&o===5?(t.consume(C),re):Te(C)&&(o===6||o===7)?(t.exit("htmlFlowData"),t.check(fw,Y,ne)(C)):C===null||Te(C)?(t.exit("htmlFlowData"),ne(C)):(t.consume(C),B)}function ne(C){return t.check(dw,te,Y)(C)}function te(C){return t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),F}function F(C){return C===null||Te(C)?ne(C):(t.enter("htmlFlowData"),B(C))}function z(C){return C===45?(t.consume(C),A):B(C)}function q(C){return C===47?(t.consume(C),f="",Z):B(C)}function Z(C){if(C===62){const de=f.toLowerCase();return gg.includes(de)?(t.consume(C),_):B(C)}return yn(C)&&f.length<8?(t.consume(C),f+=String.fromCharCode(C),Z):B(C)}function re(C){return C===93?(t.consume(C),A):B(C)}function A(C){return C===62?(t.consume(C),_):C===45&&o===2?(t.consume(C),A):B(C)}function _(C){return C===null||Te(C)?(t.exit("htmlFlowData"),Y(C)):(t.consume(C),_)}function Y(C){return t.exit("htmlFlow"),l(C)}}function pw(t,l,r){const i=this;return o;function o(f){return Te(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),u):r(f)}function u(f){return i.parser.lazy[i.now().line]?r(f):l(f)}}function xw(t,l,r){return i;function i(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),t.attempt(ys,l,r)}}const gw={name:"htmlText",tokenize:yw};function yw(t,l,r){const i=this;let o,u,f;return m;function m(A){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(A),x}function x(A){return A===33?(t.consume(A),h):A===47?(t.consume(A),V):A===63?(t.consume(A),$):yn(A)?(t.consume(A),Q):r(A)}function h(A){return A===45?(t.consume(A),y):A===91?(t.consume(A),u=0,k):yn(A)?(t.consume(A),L):r(A)}function y(A){return A===45?(t.consume(A),b):r(A)}function g(A){return A===null?r(A):A===45?(t.consume(A),v):Te(A)?(f=g,q(A)):(t.consume(A),g)}function v(A){return A===45?(t.consume(A),b):g(A)}function b(A){return A===62?z(A):A===45?v(A):g(A)}function k(A){const _="CDATA[";return A===_.charCodeAt(u++)?(t.consume(A),u===_.length?E:k):r(A)}function E(A){return A===null?r(A):A===93?(t.consume(A),N):Te(A)?(f=E,q(A)):(t.consume(A),E)}function N(A){return A===93?(t.consume(A),T):E(A)}function T(A){return A===62?z(A):A===93?(t.consume(A),T):E(A)}function L(A){return A===null||A===62?z(A):Te(A)?(f=L,q(A)):(t.consume(A),L)}function $(A){return A===null?r(A):A===63?(t.consume(A),K):Te(A)?(f=$,q(A)):(t.consume(A),$)}function K(A){return A===62?z(A):$(A)}function V(A){return yn(A)?(t.consume(A),M):r(A)}function M(A){return A===45||mn(A)?(t.consume(A),M):J(A)}function J(A){return Te(A)?(f=J,q(A)):Ve(A)?(t.consume(A),J):z(A)}function Q(A){return A===45||mn(A)?(t.consume(A),Q):A===47||A===62||pt(A)?ie(A):r(A)}function ie(A){return A===47?(t.consume(A),z):A===58||A===95||yn(A)?(t.consume(A),D):Te(A)?(f=ie,q(A)):Ve(A)?(t.consume(A),ie):z(A)}function D(A){return A===45||A===46||A===58||A===95||mn(A)?(t.consume(A),D):U(A)}function U(A){return A===61?(t.consume(A),B):Te(A)?(f=U,q(A)):Ve(A)?(t.consume(A),U):ie(A)}function B(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(t.consume(A),o=A,ne):Te(A)?(f=B,q(A)):Ve(A)?(t.consume(A),B):(t.consume(A),te)}function ne(A){return A===o?(t.consume(A),o=void 0,F):A===null?r(A):Te(A)?(f=ne,q(A)):(t.consume(A),ne)}function te(A){return A===null||A===34||A===39||A===60||A===61||A===96?r(A):A===47||A===62||pt(A)?ie(A):(t.consume(A),te)}function F(A){return A===47||A===62||pt(A)?ie(A):r(A)}function z(A){return A===62?(t.consume(A),t.exit("htmlTextData"),t.exit("htmlText"),l):r(A)}function q(A){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),Z}function Z(A){return Ve(A)?et(t,re,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):re(A)}function re(A){return t.enter("htmlTextData"),f(A)}}const Id={name:"labelEnd",resolveAll:kw,resolveTo:Sw,tokenize:jw},vw={tokenize:Ew},bw={tokenize:Cw},ww={tokenize:Nw};function kw(t){let l=-1;const r=[];for(;++l<t.length;){const i=t[l][1];if(r.push(t[l]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const o=i.type==="labelImage"?4:2;i.type="data",l+=o}}return t.length!==r.length&&Vn(t,0,t.length,r),t}function Sw(t,l){let r=t.length,i=0,o,u,f,m;for(;r--;)if(o=t[r][1],u){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;t[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(f){if(t[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(u=r,o.type!=="labelLink")){i=2;break}}else o.type==="labelEnd"&&(f=r);const x={type:t[u][1].type==="labelLink"?"link":"image",start:{...t[u][1].start},end:{...t[t.length-1][1].end}},h={type:"label",start:{...t[u][1].start},end:{...t[f][1].end}},y={type:"labelText",start:{...t[u+i+2][1].end},end:{...t[f-2][1].start}};return m=[["enter",x,l],["enter",h,l]],m=nl(m,t.slice(u+1,u+i+3)),m=nl(m,[["enter",y,l]]),m=nl(m,mc(l.parser.constructs.insideSpan.null,t.slice(u+i+4,f-3),l)),m=nl(m,[["exit",y,l],t[f-2],t[f-1],["exit",h,l]]),m=nl(m,t.slice(f+1)),m=nl(m,[["exit",x,l]]),Vn(t,u,t.length,m),t}function jw(t,l,r){const i=this;let o=i.events.length,u,f;for(;o--;)if((i.events[o][1].type==="labelImage"||i.events[o][1].type==="labelLink")&&!i.events[o][1]._balanced){u=i.events[o][1];break}return m;function m(v){return u?u._inactive?g(v):(f=i.parser.defined.includes(cl(i.sliceSerialize({start:u.end,end:i.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(v),t.exit("labelMarker"),t.exit("labelEnd"),x):r(v)}function x(v){return v===40?t.attempt(vw,y,f?y:g)(v):v===91?t.attempt(bw,y,f?h:g)(v):f?y(v):g(v)}function h(v){return t.attempt(ww,y,g)(v)}function y(v){return l(v)}function g(v){return u._balanced=!0,r(v)}}function Ew(t,l,r){return i;function i(g){return t.enter("resource"),t.enter("resourceMarker"),t.consume(g),t.exit("resourceMarker"),o}function o(g){return pt(g)?os(t,u)(g):u(g)}function u(g){return g===41?y(g):X1(t,f,m,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function f(g){return pt(g)?os(t,x)(g):y(g)}function m(g){return r(g)}function x(g){return g===34||g===39||g===40?Q1(t,h,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return pt(g)?os(t,y)(g):y(g)}function y(g){return g===41?(t.enter("resourceMarker"),t.consume(g),t.exit("resourceMarker"),t.exit("resource"),l):r(g)}}function Cw(t,l,r){const i=this;return o;function o(m){return G1.call(i,t,u,f,"reference","referenceMarker","referenceString")(m)}function u(m){return i.parser.defined.includes(cl(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?l(m):r(m)}function f(m){return r(m)}}function Nw(t,l,r){return i;function i(u){return t.enter("reference"),t.enter("referenceMarker"),t.consume(u),t.exit("referenceMarker"),o}function o(u){return u===93?(t.enter("referenceMarker"),t.consume(u),t.exit("referenceMarker"),t.exit("reference"),l):r(u)}}const Aw={name:"labelStartImage",resolveAll:Id.resolveAll,tokenize:Tw};function Tw(t,l,r){const i=this;return o;function o(m){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(m),t.exit("labelImageMarker"),u}function u(m){return m===91?(t.enter("labelMarker"),t.consume(m),t.exit("labelMarker"),t.exit("labelImage"),f):r(m)}function f(m){return m===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(m):l(m)}}const Dw={name:"labelStartLink",resolveAll:Id.resolveAll,tokenize:zw};function zw(t,l,r){const i=this;return o;function o(f){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(f),t.exit("labelMarker"),t.exit("labelLink"),u}function u(f){return f===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(f):l(f)}}const Hf={name:"lineEnding",tokenize:Mw};function Mw(t,l){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),et(t,l,"linePrefix")}}const Wo={name:"thematicBreak",tokenize:_w};function _w(t,l,r){let i=0,o;return u;function u(h){return t.enter("thematicBreak"),f(h)}function f(h){return o=h,m(h)}function m(h){return h===o?(t.enter("thematicBreakSequence"),x(h)):i>=3&&(h===null||Te(h))?(t.exit("thematicBreak"),l(h)):r(h)}function x(h){return h===o?(t.consume(h),i++,x):(t.exit("thematicBreakSequence"),Ve(h)?et(t,m,"whitespace")(h):m(h))}}const zn={continuation:{tokenize:Lw},exit:Uw,name:"list",tokenize:Bw},Rw={partial:!0,tokenize:Hw},Ow={partial:!0,tokenize:Fw};function Bw(t,l,r){const i=this,o=i.events[i.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,f=0;return m;function m(b){const k=i.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!i.containerState.marker||b===i.containerState.marker:vd(b)){if(i.containerState.type||(i.containerState.type=k,t.enter(k,{_container:!0})),k==="listUnordered")return t.enter("listItemPrefix"),b===42||b===45?t.check(Wo,r,h)(b):h(b);if(!i.interrupt||b===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),x(b)}return r(b)}function x(b){return vd(b)&&++f<10?(t.consume(b),x):(!i.interrupt||f<2)&&(i.containerState.marker?b===i.containerState.marker:b===41||b===46)?(t.exit("listItemValue"),h(b)):r(b)}function h(b){return t.enter("listItemMarker"),t.consume(b),t.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||b,t.check(ys,i.interrupt?r:y,t.attempt(Rw,v,g))}function y(b){return i.containerState.initialBlankLine=!0,u++,v(b)}function g(b){return Ve(b)?(t.enter("listItemPrefixWhitespace"),t.consume(b),t.exit("listItemPrefixWhitespace"),v):r(b)}function v(b){return i.containerState.size=u+i.sliceSerialize(t.exit("listItemPrefix"),!0).length,l(b)}}function Lw(t,l,r){const i=this;return i.containerState._closeFlow=void 0,t.check(ys,o,u);function o(m){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,et(t,l,"listItemIndent",i.containerState.size+1)(m)}function u(m){return i.containerState.furtherBlankLines||!Ve(m)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,f(m)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,t.attempt(Ow,l,f)(m))}function f(m){return i.containerState._closeFlow=!0,i.interrupt=void 0,et(t,t.attempt(zn,l,r),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m)}}function Fw(t,l,r){const i=this;return et(t,o,"listItemIndent",i.containerState.size+1);function o(u){const f=i.events[i.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===i.containerState.size?l(u):r(u)}}function Uw(t){t.exit(this.containerState.type)}function Hw(t,l,r){const i=this;return et(t,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const f=i.events[i.events.length-1];return!Ve(u)&&f&&f[1].type==="listItemPrefixWhitespace"?l(u):r(u)}}const yg={name:"setextUnderline",resolveTo:$w,tokenize:qw};function $w(t,l){let r=t.length,i,o,u;for(;r--;)if(t[r][0]==="enter"){if(t[r][1].type==="content"){i=r;break}t[r][1].type==="paragraph"&&(o=r)}else t[r][1].type==="content"&&t.splice(r,1),!u&&t[r][1].type==="definition"&&(u=r);const f={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[o][1].type="setextHeadingText",u?(t.splice(o,0,["enter",f,l]),t.splice(u+1,0,["exit",t[i][1],l]),t[i][1].end={...t[u][1].end}):t[i][1]=f,t.push(["exit",f,l]),t}function qw(t,l,r){const i=this;let o;return u;function u(h){let y=i.events.length,g;for(;y--;)if(i.events[y][1].type!=="lineEnding"&&i.events[y][1].type!=="linePrefix"&&i.events[y][1].type!=="content"){g=i.events[y][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||g)?(t.enter("setextHeadingLine"),o=h,f(h)):r(h)}function f(h){return t.enter("setextHeadingLineSequence"),m(h)}function m(h){return h===o?(t.consume(h),m):(t.exit("setextHeadingLineSequence"),Ve(h)?et(t,x,"lineSuffix")(h):x(h))}function x(h){return h===null||Te(h)?(t.exit("setextHeadingLine"),l(h)):r(h)}}const Iw={tokenize:Yw};function Yw(t){const l=this,r=t.attempt(ys,i,t.attempt(this.parser.constructs.flowInitial,o,et(t,t.attempt(this.parser.constructs.flow,o,t.attempt(K2,o)),"linePrefix")));return r;function i(u){if(u===null){t.consume(u);return}return t.enter("lineEndingBlank"),t.consume(u),t.exit("lineEndingBlank"),l.currentConstruct=void 0,r}function o(u){if(u===null){t.consume(u);return}return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),l.currentConstruct=void 0,r}}const Vw={resolveAll:Z1()},Xw=K1("string"),Gw=K1("text");function K1(t){return{resolveAll:Z1(t==="text"?Qw:void 0),tokenize:l};function l(r){const i=this,o=this.parser.constructs[t],u=r.attempt(o,f,m);return f;function f(y){return h(y)?u(y):m(y)}function m(y){if(y===null){r.consume(y);return}return r.enter("data"),r.consume(y),x}function x(y){return h(y)?(r.exit("data"),u(y)):(r.consume(y),x)}function h(y){if(y===null)return!0;const g=o[y];let v=-1;if(g)for(;++v<g.length;){const b=g[v];if(!b.previous||b.previous.call(i,i.previous))return!0}return!1}}}function Z1(t){return l;function l(r,i){let o=-1,u;for(;++o<=r.length;)u===void 0?r[o]&&r[o][1].type==="data"&&(u=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==u+2&&(r[u][1].end=r[o-1][1].end,r.splice(u+2,o-u-2),o=u+2),u=void 0);return t?t(r,i):r}}function Qw(t,l){let r=0;for(;++r<=t.length;)if((r===t.length||t[r][1].type==="lineEnding")&&t[r-1][1].type==="data"){const i=t[r-1][1],o=l.sliceStream(i);let u=o.length,f=-1,m=0,x;for(;u--;){const h=o[u];if(typeof h=="string"){for(f=h.length;h.charCodeAt(f-1)===32;)m++,f--;if(f)break;f=-1}else if(h===-2)x=!0,m++;else if(h!==-1){u++;break}}if(l._contentTypeTextTrailing&&r===t.length&&(m=0),m){const h={type:r===t.length||x||m<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?f:i.start._bufferIndex+f,_index:i.start._index+u,line:i.end.line,column:i.end.column-m,offset:i.end.offset-m},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(t.splice(r,0,["enter",h,l],["exit",h,l]),r+=2)}r++}return t}const Kw={42:zn,43:zn,45:zn,48:zn,49:zn,50:zn,51:zn,52:zn,53:zn,54:zn,55:zn,56:zn,57:zn,62:q1},Zw={91:ew},Jw={[-2]:Uf,[-1]:Uf,32:Uf},Ww={35:iw,42:Wo,45:[yg,Wo],60:uw,61:yg,95:Wo,96:xg,126:xg},Pw={38:Y1,92:I1},e3={[-5]:Hf,[-4]:Hf,[-3]:Hf,33:Aw,38:Y1,42:bd,60:[D2,gw],91:Dw,92:[aw,I1],93:Id,95:bd,96:I2},t3={null:[bd,Vw]},n3={null:[42,95]},l3={null:[]},a3=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:n3,contentInitial:Zw,disable:l3,document:Kw,flow:Ww,flowInitial:Jw,insideSpan:t3,string:Pw,text:e3},Symbol.toStringTag,{value:"Module"}));function r3(t,l,r){let i={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const o={},u=[];let f=[],m=[];const x={attempt:J(V),check:J(M),consume:L,enter:$,exit:K,interrupt:J(M,{interrupt:!0})},h={code:null,containerState:{},defineSkip:E,events:[],now:k,parser:t,previous:null,sliceSerialize:v,sliceStream:b,write:g};let y=l.tokenize.call(h,x);return l.resolveAll&&u.push(l),h;function g(U){return f=nl(f,U),N(),f[f.length-1]!==null?[]:(Q(l,0),h.events=mc(u,h.events,h),h.events)}function v(U,B){return s3(b(U),B)}function b(U){return i3(f,U)}function k(){const{_bufferIndex:U,_index:B,line:ne,column:te,offset:F}=i;return{_bufferIndex:U,_index:B,line:ne,column:te,offset:F}}function E(U){o[U.line]=U.column,D()}function N(){let U;for(;i._index<f.length;){const B=f[i._index];if(typeof B=="string")for(U=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===U&&i._bufferIndex<B.length;)T(B.charCodeAt(i._bufferIndex));else T(B)}}function T(U){y=y(U)}function L(U){Te(U)?(i.line++,i.column=1,i.offset+=U===-3?2:1,D()):U!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===f[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=U}function $(U,B){const ne=B||{};return ne.type=U,ne.start=k(),h.events.push(["enter",ne,h]),m.push(ne),ne}function K(U){const B=m.pop();return B.end=k(),h.events.push(["exit",B,h]),B}function V(U,B){Q(U,B.from)}function M(U,B){B.restore()}function J(U,B){return ne;function ne(te,F,z){let q,Z,re,A;return Array.isArray(te)?Y(te):"tokenize"in te?Y([te]):_(te);function _(xe){return ce;function ce(ve){const je=ve!==null&&xe[ve],tt=ve!==null&&xe.null,xt=[...Array.isArray(je)?je:je?[je]:[],...Array.isArray(tt)?tt:tt?[tt]:[]];return Y(xt)(ve)}}function Y(xe){return q=xe,Z=0,xe.length===0?z:C(xe[Z])}function C(xe){return ce;function ce(ve){return A=ie(),re=xe,xe.partial||(h.currentConstruct=xe),xe.name&&h.parser.constructs.disable.null.includes(xe.name)?pe():xe.tokenize.call(B?Object.assign(Object.create(h),B):h,x,de,pe)(ve)}}function de(xe){return U(re,A),F}function pe(xe){return A.restore(),++Z<q.length?C(q[Z]):z}}}function Q(U,B){U.resolveAll&&!u.includes(U)&&u.push(U),U.resolve&&Vn(h.events,B,h.events.length-B,U.resolve(h.events.slice(B),h)),U.resolveTo&&(h.events=U.resolveTo(h.events,h))}function ie(){const U=k(),B=h.previous,ne=h.currentConstruct,te=h.events.length,F=Array.from(m);return{from:te,restore:z};function z(){i=U,h.previous=B,h.currentConstruct=ne,h.events.length=te,m=F,D()}}function D(){i.line in o&&i.column<2&&(i.column=o[i.line],i.offset+=o[i.line]-1)}}function i3(t,l){const r=l.start._index,i=l.start._bufferIndex,o=l.end._index,u=l.end._bufferIndex;let f;if(r===o)f=[t[r].slice(i,u)];else{if(f=t.slice(r,o),i>-1){const m=f[0];typeof m=="string"?f[0]=m.slice(i):f.shift()}u>0&&f.push(t[o].slice(0,u))}return f}function s3(t,l){let r=-1;const i=[];let o;for(;++r<t.length;){const u=t[r];let f;if(typeof u=="string")f=u;else switch(u){case-5:{f="\r";break}case-4:{f=`
52
+ `;break}case-3:{f=`\r
53
+ `;break}case-2:{f=l?" ":" ";break}case-1:{if(!l&&o)continue;f=" ";break}default:f=String.fromCharCode(u)}o=u===-2,i.push(f)}return i.join("")}function o3(t){const i={constructs:H1([a3,...(t||{}).extensions||[]]),content:o(S2),defined:[],document:o(E2),flow:o(Iw),lazy:{},string:o(Xw),text:o(Gw)};return i;function o(u){return f;function f(m){return r3(i,u,m)}}}function c3(t){for(;!V1(t););return t}const vg=/[\0\t\n\r]/g;function u3(){let t=1,l="",r=!0,i;return o;function o(u,f,m){const x=[];let h,y,g,v,b;for(u=l+(typeof u=="string"?u.toString():new TextDecoder(f||void 0).decode(u)),g=0,l="",r&&(u.charCodeAt(0)===65279&&g++,r=void 0);g<u.length;){if(vg.lastIndex=g,h=vg.exec(u),v=h&&h.index!==void 0?h.index:u.length,b=u.charCodeAt(v),!h){l=u.slice(g);break}if(b===10&&g===v&&i)x.push(-3),i=void 0;else switch(i&&(x.push(-5),i=void 0),g<v&&(x.push(u.slice(g,v)),t+=v-g),b){case 0:{x.push(65533),t++;break}case 9:{for(y=Math.ceil(t/4)*4,x.push(-2);t++<y;)x.push(-1);break}case 10:{x.push(-4),t=1;break}default:i=!0,t=1}g=v+1}return m&&(i&&x.push(-5),l&&x.push(l),x.push(null)),x}}const f3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function d3(t){return t.replace(f3,h3)}function h3(t,l,r){if(l)return l;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),u=o===120||o===88;return $1(r.slice(u?2:1),u?16:10)}return qd(r)||t}const J1={}.hasOwnProperty;function m3(t,l,r){return l&&typeof l=="object"&&(r=l,l=void 0),p3(r)(c3(o3(r).document().write(u3()(t,l,!0))))}function p3(t){const l={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Zt),autolinkProtocol:ie,autolinkEmail:ie,atxHeading:u(bt),blockQuote:u(tt),characterEscape:ie,characterReference:ie,codeFenced:u(xt),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:u(xt,f),codeText:u(vt,f),codeTextData:ie,data:ie,codeFlowValue:ie,definition:u(Lt),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:u(_e),hardBreakEscape:u(Ft),hardBreakTrailing:u(Ft),htmlFlow:u(_n,f),htmlFlowData:ie,htmlText:u(_n,f),htmlTextData:ie,image:u(gt),label:f,link:u(Zt),listItem:u(St),listItemValue:v,listOrdered:u(un,g),listUnordered:u(un),paragraph:u(wn),reference:C,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:u(bt),strong:u(kn),thematicBreak:u(Sn)},exit:{atxHeading:x(),atxHeadingSequence:V,autolink:x(),autolinkEmail:je,autolinkProtocol:ve,blockQuote:x(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:xe,characterReference:ce,codeFenced:x(N),codeFencedFence:E,codeFencedFenceInfo:b,codeFencedFenceMeta:k,codeFlowValue:D,codeIndented:x(T),codeText:x(F),codeTextData:D,data:D,definition:x(),definitionDestinationString:K,definitionLabelString:L,definitionTitleString:$,emphasis:x(),hardBreakEscape:x(B),hardBreakTrailing:x(B),htmlFlow:x(ne),htmlFlowData:D,htmlText:x(te),htmlTextData:D,image:x(q),label:re,labelText:Z,lineEnding:U,link:x(z),listItem:x(),listOrdered:x(),listUnordered:x(),paragraph:x(),referenceString:de,resourceDestinationString:A,resourceTitleString:_,resource:Y,setextHeading:x(Q),setextHeadingLineSequence:J,setextHeadingText:M,strong:x(),thematicBreak:x()}};W1(l,(t||{}).mdastExtensions||[]);const r={};return i;function i(G){let se={type:"root",children:[]};const we={stack:[se],tokenStack:[],config:l,enter:m,exit:h,buffer:f,resume:y,data:r},ye=[];let Be=-1;for(;++Be<G.length;)if(G[Be][1].type==="listOrdered"||G[Be][1].type==="listUnordered")if(G[Be][0]==="enter")ye.push(Be);else{const jt=ye.pop();Be=o(G,jt,Be)}for(Be=-1;++Be<G.length;){const jt=l[G[Be][0]];J1.call(jt,G[Be][1].type)&&jt[G[Be][1].type].call(Object.assign({sliceSerialize:G[Be][2].sliceSerialize},we),G[Be][1])}if(we.tokenStack.length>0){const jt=we.tokenStack[we.tokenStack.length-1];(jt[1]||bg).call(we,void 0,jt[0])}for(se.position={start:Sa(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:Sa(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be<l.transforms.length;)se=l.transforms[Be](se)||se;return se}function o(G,se,we){let ye=se-1,Be=-1,jt=!1,Nt,it,he,We;for(;++ye<=we;){const Qe=G[ye];switch(Qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qe[0]==="enter"?Be++:Be--,We=void 0;break}case"lineEndingBlank":{Qe[0]==="enter"&&(Nt&&!We&&!Be&&!he&&(he=ye),We=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:We=void 0}if(!Be&&Qe[0]==="enter"&&Qe[1].type==="listItemPrefix"||Be===-1&&Qe[0]==="exit"&&(Qe[1].type==="listUnordered"||Qe[1].type==="listOrdered")){if(Nt){let Rn=ye;for(it=void 0;Rn--;){const tn=G[Rn];if(tn[1].type==="lineEnding"||tn[1].type==="lineEndingBlank"){if(tn[0]==="exit")continue;it&&(G[it][1].type="lineEndingBlank",jt=!0),tn[1].type="lineEnding",it=Rn}else if(!(tn[1].type==="linePrefix"||tn[1].type==="blockQuotePrefix"||tn[1].type==="blockQuotePrefixWhitespace"||tn[1].type==="blockQuoteMarker"||tn[1].type==="listItemIndent"))break}he&&(!it||he<it)&&(Nt._spread=!0),Nt.end=Object.assign({},it?G[it][1].start:Qe[1].end),G.splice(it||ye,0,["exit",Nt,Qe[2]]),ye++,we++}if(Qe[1].type==="listItemPrefix"){const Rn={type:"listItem",_spread:!1,start:Object.assign({},Qe[1].start),end:void 0};Nt=Rn,G.splice(ye,0,["enter",Rn,Qe[2]]),ye++,we++,he=void 0,We=!0}}}return G[se][1]._spread=jt,we}function u(G,se){return we;function we(ye){m.call(this,G(ye),ye),se&&se.call(this,ye)}}function f(){this.stack.push({type:"fragment",children:[]})}function m(G,se,we){this.stack[this.stack.length-1].children.push(G),this.stack.push(G),this.tokenStack.push([se,we||void 0]),G.position={start:Sa(se.start),end:void 0}}function x(G){return se;function se(we){G&&G.call(this,we),h.call(this,we)}}function h(G,se){const we=this.stack.pop(),ye=this.tokenStack.pop();if(ye)ye[0].type!==G.type&&(se?se.call(this,G,ye[0]):(ye[1]||bg).call(this,G,ye[0]));else throw new Error("Cannot close `"+G.type+"` ("+ss({start:G.start,end:G.end})+"): it’s not open");we.position.end=Sa(G.end)}function y(){return $d(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function v(G){if(this.data.expectingFirstListItemValue){const se=this.stack[this.stack.length-2];se.start=Number.parseInt(this.sliceSerialize(G),10),this.data.expectingFirstListItemValue=void 0}}function b(){const G=this.resume(),se=this.stack[this.stack.length-1];se.lang=G}function k(){const G=this.resume(),se=this.stack[this.stack.length-1];se.meta=G}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const G=this.resume(),se=this.stack[this.stack.length-1];se.value=G.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function T(){const G=this.resume(),se=this.stack[this.stack.length-1];se.value=G.replace(/(\r?\n|\r)$/g,"")}function L(G){const se=this.resume(),we=this.stack[this.stack.length-1];we.label=se,we.identifier=cl(this.sliceSerialize(G)).toLowerCase()}function $(){const G=this.resume(),se=this.stack[this.stack.length-1];se.title=G}function K(){const G=this.resume(),se=this.stack[this.stack.length-1];se.url=G}function V(G){const se=this.stack[this.stack.length-1];if(!se.depth){const we=this.sliceSerialize(G).length;se.depth=we}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function J(G){const se=this.stack[this.stack.length-1];se.depth=this.sliceSerialize(G).codePointAt(0)===61?1:2}function Q(){this.data.setextHeadingSlurpLineEnding=void 0}function ie(G){const we=this.stack[this.stack.length-1].children;let ye=we[we.length-1];(!ye||ye.type!=="text")&&(ye=Dt(),ye.position={start:Sa(G.start),end:void 0},we.push(ye)),this.stack.push(ye)}function D(G){const se=this.stack.pop();se.value+=this.sliceSerialize(G),se.position.end=Sa(G.end)}function U(G){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=se.children[se.children.length-1];we.position.end=Sa(G.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&l.canContainEols.includes(se.type)&&(ie.call(this,G),D.call(this,G))}function B(){this.data.atHardBreak=!0}function ne(){const G=this.resume(),se=this.stack[this.stack.length-1];se.value=G}function te(){const G=this.resume(),se=this.stack[this.stack.length-1];se.value=G}function F(){const G=this.resume(),se=this.stack[this.stack.length-1];se.value=G}function z(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=se,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function q(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=se,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function Z(G){const se=this.sliceSerialize(G),we=this.stack[this.stack.length-2];we.label=d3(se),we.identifier=cl(se).toLowerCase()}function re(){const G=this.stack[this.stack.length-1],se=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const ye=G.children;we.children=ye}else we.alt=se}function A(){const G=this.resume(),se=this.stack[this.stack.length-1];se.url=G}function _(){const G=this.resume(),se=this.stack[this.stack.length-1];se.title=G}function Y(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function de(G){const se=this.resume(),we=this.stack[this.stack.length-1];we.label=se,we.identifier=cl(this.sliceSerialize(G)).toLowerCase(),this.data.referenceType="full"}function pe(G){this.data.characterReferenceType=G.type}function xe(G){const se=this.sliceSerialize(G),we=this.data.characterReferenceType;let ye;we?(ye=$1(se,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ye=qd(se);const Be=this.stack[this.stack.length-1];Be.value+=ye}function ce(G){const se=this.stack.pop();se.position.end=Sa(G.end)}function ve(G){D.call(this,G);const se=this.stack[this.stack.length-1];se.url=this.sliceSerialize(G)}function je(G){D.call(this,G);const se=this.stack[this.stack.length-1];se.url="mailto:"+this.sliceSerialize(G)}function tt(){return{type:"blockquote",children:[]}}function xt(){return{type:"code",lang:null,meta:null,value:""}}function vt(){return{type:"inlineCode",value:""}}function Lt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function _e(){return{type:"emphasis",children:[]}}function bt(){return{type:"heading",depth:0,children:[]}}function Ft(){return{type:"break"}}function _n(){return{type:"html",value:""}}function gt(){return{type:"image",title:null,url:"",alt:null}}function Zt(){return{type:"link",title:null,url:"",children:[]}}function un(G){return{type:"list",ordered:G.type==="listOrdered",start:null,spread:G._spread,children:[]}}function St(G){return{type:"listItem",spread:G._spread,checked:null,children:[]}}function wn(){return{type:"paragraph",children:[]}}function kn(){return{type:"strong",children:[]}}function Dt(){return{type:"text",value:""}}function Sn(){return{type:"thematicBreak"}}}function Sa(t){return{line:t.line,column:t.column,offset:t.offset}}function W1(t,l){let r=-1;for(;++r<l.length;){const i=l[r];Array.isArray(i)?W1(t,i):x3(t,i)}}function x3(t,l){let r;for(r in l)if(J1.call(l,r))switch(r){case"canContainEols":{const i=l[r];i&&t[r].push(...i);break}case"transforms":{const i=l[r];i&&t[r].push(...i);break}case"enter":case"exit":{const i=l[r];i&&Object.assign(t[r],i);break}}}function bg(t,l){throw t?new Error("Cannot close `"+t.type+"` ("+ss({start:t.start,end:t.end})+"): a different token (`"+l.type+"`, "+ss({start:l.start,end:l.end})+") is open"):new Error("Cannot close document, a token (`"+l.type+"`, "+ss({start:l.start,end:l.end})+") is still open")}function g3(t){const l=this;l.parser=r;function r(i){return m3(i,{...l.data("settings"),...t,extensions:l.data("micromarkExtensions")||[],mdastExtensions:l.data("fromMarkdownExtensions")||[]})}}function y3(t,l){const r={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(l),!0)};return t.patch(l,r),t.applyData(l,r)}function v3(t,l){const r={type:"element",tagName:"br",properties:{},children:[]};return t.patch(l,r),[t.applyData(l,r),{type:"text",value:`
54
+ `}]}function b3(t,l){const r=l.value?l.value+`
55
+ `:"",i={},o=l.lang?l.lang.split(/\s+/):[];o.length>0&&(i.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:i,children:[{type:"text",value:r}]};return l.meta&&(u.data={meta:l.meta}),t.patch(l,u),u=t.applyData(l,u),u={type:"element",tagName:"pre",properties:{},children:[u]},t.patch(l,u),u}function w3(t,l){const r={type:"element",tagName:"del",properties:{},children:t.all(l)};return t.patch(l,r),t.applyData(l,r)}function k3(t,l){const r={type:"element",tagName:"em",properties:{},children:t.all(l)};return t.patch(l,r),t.applyData(l,r)}function S3(t,l){const r=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",i=String(l.identifier).toUpperCase(),o=Pr(i.toLowerCase()),u=t.footnoteOrder.indexOf(i);let f,m=t.footnoteCounts.get(i);m===void 0?(m=0,t.footnoteOrder.push(i),f=t.footnoteOrder.length):f=u+1,m+=1,t.footnoteCounts.set(i,m);const x={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(m>1?"-"+m:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};t.patch(l,x);const h={type:"element",tagName:"sup",properties:{},children:[x]};return t.patch(l,h),t.applyData(l,h)}function j3(t,l){const r={type:"element",tagName:"h"+l.depth,properties:{},children:t.all(l)};return t.patch(l,r),t.applyData(l,r)}function E3(t,l){if(t.options.allowDangerousHtml){const r={type:"raw",value:l.value};return t.patch(l,r),t.applyData(l,r)}}function P1(t,l){const r=l.referenceType;let i="]";if(r==="collapsed"?i+="[]":r==="full"&&(i+="["+(l.label||l.identifier)+"]"),l.type==="imageReference")return[{type:"text",value:"!["+l.alt+i}];const o=t.all(l),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const f=o[o.length-1];return f&&f.type==="text"?f.value+=i:o.push({type:"text",value:i}),o}function C3(t,l){const r=String(l.identifier).toUpperCase(),i=t.definitionById.get(r);if(!i)return P1(t,l);const o={src:Pr(i.url||""),alt:l.alt};i.title!==null&&i.title!==void 0&&(o.title=i.title);const u={type:"element",tagName:"img",properties:o,children:[]};return t.patch(l,u),t.applyData(l,u)}function N3(t,l){const r={src:Pr(l.url)};l.alt!==null&&l.alt!==void 0&&(r.alt=l.alt),l.title!==null&&l.title!==void 0&&(r.title=l.title);const i={type:"element",tagName:"img",properties:r,children:[]};return t.patch(l,i),t.applyData(l,i)}function A3(t,l){const r={type:"text",value:l.value.replace(/\r?\n|\r/g," ")};t.patch(l,r);const i={type:"element",tagName:"code",properties:{},children:[r]};return t.patch(l,i),t.applyData(l,i)}function T3(t,l){const r=String(l.identifier).toUpperCase(),i=t.definitionById.get(r);if(!i)return P1(t,l);const o={href:Pr(i.url||"")};i.title!==null&&i.title!==void 0&&(o.title=i.title);const u={type:"element",tagName:"a",properties:o,children:t.all(l)};return t.patch(l,u),t.applyData(l,u)}function D3(t,l){const r={href:Pr(l.url)};l.title!==null&&l.title!==void 0&&(r.title=l.title);const i={type:"element",tagName:"a",properties:r,children:t.all(l)};return t.patch(l,i),t.applyData(l,i)}function z3(t,l,r){const i=t.all(l),o=r?M3(r):ey(l),u={},f=[];if(typeof l.checked=="boolean"){const y=i[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},i.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:l.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let m=-1;for(;++m<i.length;){const y=i[m];(o||m!==0||y.type!=="element"||y.tagName!=="p")&&f.push({type:"text",value:`
56
+ `}),y.type==="element"&&y.tagName==="p"&&!o?f.push(...y.children):f.push(y)}const x=i[i.length-1];x&&(o||x.type!=="element"||x.tagName!=="p")&&f.push({type:"text",value:`
57
+ `});const h={type:"element",tagName:"li",properties:u,children:f};return t.patch(l,h),t.applyData(l,h)}function M3(t){let l=!1;if(t.type==="list"){l=t.spread||!1;const r=t.children;let i=-1;for(;!l&&++i<r.length;)l=ey(r[i])}return l}function ey(t){const l=t.spread;return l??t.children.length>1}function _3(t,l){const r={},i=t.all(l);let o=-1;for(typeof l.start=="number"&&l.start!==1&&(r.start=l.start);++o<i.length;){const f=i[o];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const u={type:"element",tagName:l.ordered?"ol":"ul",properties:r,children:t.wrap(i,!0)};return t.patch(l,u),t.applyData(l,u)}function R3(t,l){const r={type:"element",tagName:"p",properties:{},children:t.all(l)};return t.patch(l,r),t.applyData(l,r)}function O3(t,l){const r={type:"root",children:t.wrap(t.all(l))};return t.patch(l,r),t.applyData(l,r)}function B3(t,l){const r={type:"element",tagName:"strong",properties:{},children:t.all(l)};return t.patch(l,r),t.applyData(l,r)}function L3(t,l){const r=t.all(l),i=r.shift(),o=[];if(i){const f={type:"element",tagName:"thead",properties:{},children:t.wrap([i],!0)};t.patch(l.children[0],f),o.push(f)}if(r.length>0){const f={type:"element",tagName:"tbody",properties:{},children:t.wrap(r,!0)},m=Ld(l.children[1]),x=_1(l.children[l.children.length-1]);m&&x&&(f.position={start:m,end:x}),o.push(f)}const u={type:"element",tagName:"table",properties:{},children:t.wrap(o,!0)};return t.patch(l,u),t.applyData(l,u)}function F3(t,l,r){const i=r?r.children:void 0,u=(i?i.indexOf(l):1)===0?"th":"td",f=r&&r.type==="table"?r.align:void 0,m=f?f.length:l.children.length;let x=-1;const h=[];for(;++x<m;){const g=l.children[x],v={},b=f?f[x]:void 0;b&&(v.align=b);let k={type:"element",tagName:u,properties:v,children:[]};g&&(k.children=t.all(g),t.patch(g,k),k=t.applyData(g,k)),h.push(k)}const y={type:"element",tagName:"tr",properties:{},children:t.wrap(h,!0)};return t.patch(l,y),t.applyData(l,y)}function U3(t,l){const r={type:"element",tagName:"td",properties:{},children:t.all(l)};return t.patch(l,r),t.applyData(l,r)}const wg=9,kg=32;function H3(t){const l=String(t),r=/\r?\n|\r/g;let i=r.exec(l),o=0;const u=[];for(;i;)u.push(Sg(l.slice(o,i.index),o>0,!0),i[0]),o=i.index+i[0].length,i=r.exec(l);return u.push(Sg(l.slice(o),o>0,!1)),u.join("")}function Sg(t,l,r){let i=0,o=t.length;if(l){let u=t.codePointAt(i);for(;u===wg||u===kg;)i++,u=t.codePointAt(i)}if(r){let u=t.codePointAt(o-1);for(;u===wg||u===kg;)o--,u=t.codePointAt(o-1)}return o>i?t.slice(i,o):""}function $3(t,l){const r={type:"text",value:H3(String(l.value))};return t.patch(l,r),t.applyData(l,r)}function q3(t,l){const r={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(l,r),t.applyData(l,r)}const I3={blockquote:y3,break:v3,code:b3,delete:w3,emphasis:k3,footnoteReference:S3,heading:j3,html:E3,imageReference:C3,image:N3,inlineCode:A3,linkReference:T3,link:D3,listItem:z3,list:_3,paragraph:R3,root:O3,strong:B3,table:L3,tableCell:U3,tableRow:F3,text:$3,thematicBreak:q3,toml:Fo,yaml:Fo,definition:Fo,footnoteDefinition:Fo};function Fo(){}const ty=-1,pc=0,cs=1,ic=2,Yd=3,Vd=4,Xd=5,Gd=6,ny=7,ly=8,jg=typeof self=="object"?self:globalThis,Y3=(t,l)=>{const r=(o,u)=>(t.set(u,o),o),i=o=>{if(t.has(o))return t.get(o);const[u,f]=l[o];switch(u){case pc:case ty:return r(f,o);case cs:{const m=r([],o);for(const x of f)m.push(i(x));return m}case ic:{const m=r({},o);for(const[x,h]of f)m[i(x)]=i(h);return m}case Yd:return r(new Date(f),o);case Vd:{const{source:m,flags:x}=f;return r(new RegExp(m,x),o)}case Xd:{const m=r(new Map,o);for(const[x,h]of f)m.set(i(x),i(h));return m}case Gd:{const m=r(new Set,o);for(const x of f)m.add(i(x));return m}case ny:{const{name:m,message:x}=f;return r(new jg[m](x),o)}case ly:return r(BigInt(f),o);case"BigInt":return r(Object(BigInt(f)),o);case"ArrayBuffer":return r(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:m}=new Uint8Array(f);return r(new DataView(m),f)}}return r(new jg[u](f),o)};return i},Eg=t=>Y3(new Map,t)(0),qr="",{toString:V3}={},{keys:X3}=Object,es=t=>{const l=typeof t;if(l!=="object"||!t)return[pc,l];const r=V3.call(t).slice(8,-1);switch(r){case"Array":return[cs,qr];case"Object":return[ic,qr];case"Date":return[Yd,qr];case"RegExp":return[Vd,qr];case"Map":return[Xd,qr];case"Set":return[Gd,qr];case"DataView":return[cs,r]}return r.includes("Array")?[cs,r]:r.includes("Error")?[ny,r]:[ic,r]},Uo=([t,l])=>t===pc&&(l==="function"||l==="symbol"),G3=(t,l,r,i)=>{const o=(f,m)=>{const x=i.push(f)-1;return r.set(m,x),x},u=f=>{if(r.has(f))return r.get(f);let[m,x]=es(f);switch(m){case pc:{let y=f;switch(x){case"bigint":m=ly,y=f.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+x);y=null;break;case"undefined":return o([ty],f)}return o([m,y],f)}case cs:{if(x){let v=f;return x==="DataView"?v=new Uint8Array(f.buffer):x==="ArrayBuffer"&&(v=new Uint8Array(f)),o([x,[...v]],f)}const y=[],g=o([m,y],f);for(const v of f)y.push(u(v));return g}case ic:{if(x)switch(x){case"BigInt":return o([x,f.toString()],f);case"Boolean":case"Number":case"String":return o([x,f.valueOf()],f)}if(l&&"toJSON"in f)return u(f.toJSON());const y=[],g=o([m,y],f);for(const v of X3(f))(t||!Uo(es(f[v])))&&y.push([u(v),u(f[v])]);return g}case Yd:return o([m,f.toISOString()],f);case Vd:{const{source:y,flags:g}=f;return o([m,{source:y,flags:g}],f)}case Xd:{const y=[],g=o([m,y],f);for(const[v,b]of f)(t||!(Uo(es(v))||Uo(es(b))))&&y.push([u(v),u(b)]);return g}case Gd:{const y=[],g=o([m,y],f);for(const v of f)(t||!Uo(es(v)))&&y.push(u(v));return g}}const{message:h}=f;return o([m,{name:x,message:h}],f)};return u},Cg=(t,{json:l,lossy:r}={})=>{const i=[];return G3(!(l||r),!!l,new Map,i)(t),i},sc=typeof structuredClone=="function"?(t,l)=>l&&("json"in l||"lossy"in l)?Eg(Cg(t,l)):structuredClone(t):(t,l)=>Eg(Cg(t,l));function Q3(t,l){const r=[{type:"text",value:"↩"}];return l>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(l)}]}),r}function K3(t,l){return"Back to reference "+(t+1)+(l>1?"-"+l:"")}function Z3(t){const l=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=t.options.footnoteBackContent||Q3,i=t.options.footnoteBackLabel||K3,o=t.options.footnoteLabel||"Footnotes",u=t.options.footnoteLabelTagName||"h2",f=t.options.footnoteLabelProperties||{className:["sr-only"]},m=[];let x=-1;for(;++x<t.footnoteOrder.length;){const h=t.footnoteById.get(t.footnoteOrder[x]);if(!h)continue;const y=t.all(h),g=String(h.identifier).toUpperCase(),v=Pr(g.toLowerCase());let b=0;const k=[],E=t.footnoteCounts.get(g);for(;E!==void 0&&++b<=E;){k.length>0&&k.push({type:"text",value:" "});let L=typeof r=="string"?r:r(x,b);typeof L=="string"&&(L={type:"text",value:L}),k.push({type:"element",tagName:"a",properties:{href:"#"+l+"fnref-"+v+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(x,b),className:["data-footnote-backref"]},children:Array.isArray(L)?L:[L]})}const N=y[y.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const L=N.children[N.children.length-1];L&&L.type==="text"?L.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...k)}else y.push(...k);const T={type:"element",tagName:"li",properties:{id:l+"fn-"+v},children:t.wrap(y,!0)};t.patch(h,T),m.push(T)}if(m.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...sc(f),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
58
+ `},{type:"element",tagName:"ol",properties:{},children:t.wrap(m,!0)},{type:"text",value:`
59
+ `}]}}const xc=(function(t){if(t==null)return ek;if(typeof t=="function")return gc(t);if(typeof t=="object")return Array.isArray(t)?J3(t):W3(t);if(typeof t=="string")return P3(t);throw new Error("Expected function, string, or object as test")});function J3(t){const l=[];let r=-1;for(;++r<t.length;)l[r]=xc(t[r]);return gc(i);function i(...o){let u=-1;for(;++u<l.length;)if(l[u].apply(this,o))return!0;return!1}}function W3(t){const l=t;return gc(r);function r(i){const o=i;let u;for(u in t)if(o[u]!==l[u])return!1;return!0}}function P3(t){return gc(l);function l(r){return r&&r.type===t}}function gc(t){return l;function l(r,i,o){return!!(tk(r)&&t.call(this,r,typeof i=="number"?i:void 0,o||void 0))}}function ek(){return!0}function tk(t){return t!==null&&typeof t=="object"&&"type"in t}const ay=[],nk=!0,wd=!1,lk="skip";function ry(t,l,r,i){let o;typeof l=="function"&&typeof r!="function"?(i=r,r=l):o=l;const u=xc(o),f=i?-1:1;m(t,void 0,[])();function m(x,h,y){const g=x&&typeof x=="object"?x:{};if(typeof g.type=="string"){const b=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(x.type+(b?"<"+b+">":""))+")"})}return v;function v(){let b=ay,k,E,N;if((!l||u(x,h,y[y.length-1]||void 0))&&(b=ak(r(x,y)),b[0]===wd))return b;if("children"in x&&x.children){const T=x;if(T.children&&b[0]!==lk)for(E=(i?T.children.length:-1)+f,N=y.concat(T);E>-1&&E<T.children.length;){const L=T.children[E];if(k=m(L,E,N)(),k[0]===wd)return k;E=typeof k[1]=="number"?k[1]:E+f}}return b}}}function ak(t){return Array.isArray(t)?t:typeof t=="number"?[nk,t]:t==null?ay:[t]}function Qd(t,l,r,i){let o,u,f;typeof l=="function"&&typeof r!="function"?(u=void 0,f=l,o=r):(u=l,f=r,o=i),ry(t,u,m,o);function m(x,h){const y=h[h.length-1],g=y?y.children.indexOf(x):void 0;return f(x,g,y)}}const kd={}.hasOwnProperty,rk={};function ik(t,l){const r=l||rk,i=new Map,o=new Map,u=new Map,f={...I3,...r.handlers},m={all:h,applyData:ok,definitionById:i,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:f,one:x,options:r,patch:sk,wrap:uk};return Qd(t,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?i:o,v=String(y.identifier).toUpperCase();g.has(v)||g.set(v,y)}}),m;function x(y,g){const v=y.type,b=m.handlers[v];if(kd.call(m.handlers,v)&&b)return b(m,y,g);if(m.options.passThrough&&m.options.passThrough.includes(v)){if("children"in y){const{children:E,...N}=y,T=sc(N);return T.children=m.all(y),T}return sc(y)}return(m.options.unknownHandler||ck)(m,y,g)}function h(y){const g=[];if("children"in y){const v=y.children;let b=-1;for(;++b<v.length;){const k=m.one(v[b],y);if(k){if(b&&v[b-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=Ng(k.value)),!Array.isArray(k)&&k.type==="element")){const E=k.children[0];E&&E.type==="text"&&(E.value=Ng(E.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function sk(t,l){t.position&&(l.position=Kb(t))}function ok(t,l){let r=l;if(t&&t.data){const i=t.data.hName,o=t.data.hChildren,u=t.data.hProperties;if(typeof i=="string")if(r.type==="element")r.tagName=i;else{const f="children"in r?r.children:[r];r={type:"element",tagName:i,properties:{},children:f}}r.type==="element"&&u&&Object.assign(r.properties,sc(u)),"children"in r&&r.children&&o!==null&&o!==void 0&&(r.children=o)}return r}function ck(t,l){const r=l.data||{},i="value"in l&&!(kd.call(r,"hProperties")||kd.call(r,"hChildren"))?{type:"text",value:l.value}:{type:"element",tagName:"div",properties:{},children:t.all(l)};return t.patch(l,i),t.applyData(l,i)}function uk(t,l){const r=[];let i=-1;for(l&&r.push({type:"text",value:`
60
+ `});++i<t.length;)i&&r.push({type:"text",value:`
61
+ `}),r.push(t[i]);return l&&t.length>0&&r.push({type:"text",value:`
62
+ `}),r}function Ng(t){let l=0,r=t.charCodeAt(l);for(;r===9||r===32;)l++,r=t.charCodeAt(l);return t.slice(l)}function Ag(t,l){const r=ik(t,l),i=r.one(t,void 0),o=Z3(r),u=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
63
+ `},o),u}function fk(t,l){return t&&"run"in t?async function(r,i){const o=Ag(r,{file:i,...l});await t.run(o,i)}:function(r,i){return Ag(r,{file:i,...t||l})}}function Tg(t){if(t)throw t}var $f,Dg;function dk(){if(Dg)return $f;Dg=1;var t=Object.prototype.hasOwnProperty,l=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(h){return typeof Array.isArray=="function"?Array.isArray(h):l.call(h)==="[object Array]"},u=function(h){if(!h||l.call(h)!=="[object Object]")return!1;var y=t.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&t.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!y&&!g)return!1;var v;for(v in h);return typeof v>"u"||t.call(h,v)},f=function(h,y){r&&y.name==="__proto__"?r(h,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):h[y.name]=y.newValue},m=function(h,y){if(y==="__proto__")if(t.call(h,y)){if(i)return i(h,y).value}else return;return h[y]};return $f=function x(){var h,y,g,v,b,k,E=arguments[0],N=1,T=arguments.length,L=!1;for(typeof E=="boolean"&&(L=E,E=arguments[1]||{},N=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});N<T;++N)if(h=arguments[N],h!=null)for(y in h)g=m(E,y),v=m(h,y),E!==v&&(L&&v&&(u(v)||(b=o(v)))?(b?(b=!1,k=g&&o(g)?g:[]):k=g&&u(g)?g:{},f(E,{name:y,newValue:x(L,k,v)})):typeof v<"u"&&f(E,{name:y,newValue:v}));return E},$f}var hk=dk();const qf=j1(hk);function Sd(t){if(typeof t!="object"||t===null)return!1;const l=Object.getPrototypeOf(t);return(l===null||l===Object.prototype||Object.getPrototypeOf(l)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function mk(){const t=[],l={run:r,use:i};return l;function r(...o){let u=-1;const f=o.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);m(null,...o);function m(x,...h){const y=t[++u];let g=-1;if(x){f(x);return}for(;++g<o.length;)(h[g]===null||h[g]===void 0)&&(h[g]=o[g]);o=h,y?pk(y,m)(...h):f(null,...h)}}function i(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return t.push(o),l}}function pk(t,l){let r;return i;function i(...f){const m=t.length>f.length;let x;m&&f.push(o);try{x=t.apply(this,f)}catch(h){const y=h;if(m&&r)throw y;return o(y)}m||(x&&x.then&&typeof x.then=="function"?x.then(u,o):x instanceof Error?o(x):u(x))}function o(f,...m){r||(r=!0,l(f,...m))}function u(f){o(null,f)}}const xl={basename:xk,dirname:gk,extname:yk,join:vk,sep:"/"};function xk(t,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');vs(t);let r=0,i=-1,o=t.length,u;if(l===void 0||l.length===0||l.length>t.length){for(;o--;)if(t.codePointAt(o)===47){if(u){r=o+1;break}}else i<0&&(u=!0,i=o+1);return i<0?"":t.slice(r,i)}if(l===t)return"";let f=-1,m=l.length-1;for(;o--;)if(t.codePointAt(o)===47){if(u){r=o+1;break}}else f<0&&(u=!0,f=o+1),m>-1&&(t.codePointAt(o)===l.codePointAt(m--)?m<0&&(i=o):(m=-1,i=f));return r===i?i=f:i<0&&(i=t.length),t.slice(r,i)}function gk(t){if(vs(t),t.length===0)return".";let l=-1,r=t.length,i;for(;--r;)if(t.codePointAt(r)===47){if(i){l=r;break}}else i||(i=!0);return l<0?t.codePointAt(0)===47?"/":".":l===1&&t.codePointAt(0)===47?"//":t.slice(0,l)}function yk(t){vs(t);let l=t.length,r=-1,i=0,o=-1,u=0,f;for(;l--;){const m=t.codePointAt(l);if(m===47){if(f){i=l+1;break}continue}r<0&&(f=!0,r=l+1),m===46?o<0?o=l:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||r<0||u===0||u===1&&o===r-1&&o===i+1?"":t.slice(o,r)}function vk(...t){let l=-1,r;for(;++l<t.length;)vs(t[l]),t[l]&&(r=r===void 0?t[l]:r+"/"+t[l]);return r===void 0?".":bk(r)}function bk(t){vs(t);const l=t.codePointAt(0)===47;let r=wk(t,!l);return r.length===0&&!l&&(r="."),r.length>0&&t.codePointAt(t.length-1)===47&&(r+="/"),l?"/"+r:r}function wk(t,l){let r="",i=0,o=-1,u=0,f=-1,m,x;for(;++f<=t.length;){if(f<t.length)m=t.codePointAt(f);else{if(m===47)break;m=47}if(m===47){if(!(o===f-1||u===1))if(o!==f-1&&u===2){if(r.length<2||i!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(x=r.lastIndexOf("/"),x!==r.length-1){x<0?(r="",i=0):(r=r.slice(0,x),i=r.length-1-r.lastIndexOf("/")),o=f,u=0;continue}}else if(r.length>0){r="",i=0,o=f,u=0;continue}}l&&(r=r.length>0?r+"/..":"..",i=2)}else r.length>0?r+="/"+t.slice(o+1,f):r=t.slice(o+1,f),i=f-o-1;o=f,u=0}else m===46&&u>-1?u++:u=-1}return r}function vs(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const kk={cwd:Sk};function Sk(){return"/"}function jd(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function jk(t){if(typeof t=="string")t=new URL(t);else if(!jd(t)){const l=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw l.code="ERR_INVALID_ARG_TYPE",l}if(t.protocol!=="file:"){const l=new TypeError("The URL must be of scheme file");throw l.code="ERR_INVALID_URL_SCHEME",l}return Ek(t)}function Ek(t){if(t.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const l=t.pathname;let r=-1;for(;++r<l.length;)if(l.codePointAt(r)===37&&l.codePointAt(r+1)===50){const i=l.codePointAt(r+2);if(i===70||i===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(l)}const If=["history","path","basename","stem","extname","dirname"];class iy{constructor(l){let r;l?jd(l)?r={path:l}:typeof l=="string"||Ck(l)?r={value:l}:r=l:r={},this.cwd="cwd"in r?"":kk.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<If.length;){const u=If[i];u in r&&r[u]!==void 0&&r[u]!==null&&(this[u]=u==="history"?[...r[u]]:r[u])}let o;for(o in r)If.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?xl.basename(this.path):void 0}set basename(l){Vf(l,"basename"),Yf(l,"basename"),this.path=xl.join(this.dirname||"",l)}get dirname(){return typeof this.path=="string"?xl.dirname(this.path):void 0}set dirname(l){zg(this.basename,"dirname"),this.path=xl.join(l||"",this.basename)}get extname(){return typeof this.path=="string"?xl.extname(this.path):void 0}set extname(l){if(Yf(l,"extname"),zg(this.dirname,"extname"),l){if(l.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(l.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=xl.join(this.dirname,this.stem+(l||""))}get path(){return this.history[this.history.length-1]}set path(l){jd(l)&&(l=jk(l)),Vf(l,"path"),this.path!==l&&this.history.push(l)}get stem(){return typeof this.path=="string"?xl.basename(this.path,this.extname):void 0}set stem(l){Vf(l,"stem"),Yf(l,"stem"),this.path=xl.join(this.dirname||"",l+(this.extname||""))}fail(l,r,i){const o=this.message(l,r,i);throw o.fatal=!0,o}info(l,r,i){const o=this.message(l,r,i);return o.fatal=void 0,o}message(l,r,i){const o=new pn(l,r,i);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(l){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(l||void 0).decode(this.value)}}function Yf(t,l){if(t&&t.includes(xl.sep))throw new Error("`"+l+"` cannot be a path: did not expect `"+xl.sep+"`")}function Vf(t,l){if(!t)throw new Error("`"+l+"` cannot be empty")}function zg(t,l){if(!t)throw new Error("Setting `"+l+"` requires `path` to be set too")}function Ck(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Nk=(function(t){const i=this.constructor.prototype,o=i[t],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,i),u}),Ak={}.hasOwnProperty;class Kd extends Nk{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=mk()}copy(){const l=new Kd;let r=-1;for(;++r<this.attachers.length;){const i=this.attachers[r];l.use(...i)}return l.data(qf(!0,{},this.namespace)),l}data(l,r){return typeof l=="string"?arguments.length===2?(Qf("data",this.frozen),this.namespace[l]=r,this):Ak.call(this.namespace,l)&&this.namespace[l]||void 0:l?(Qf("data",this.frozen),this.namespace=l,this):this.namespace}freeze(){if(this.frozen)return this;const l=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const o=r.call(l,...i);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(l){this.freeze();const r=Ho(l),i=this.parser||this.Parser;return Xf("parse",i),i(String(r),r)}process(l,r){const i=this;return this.freeze(),Xf("process",this.parser||this.Parser),Gf("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(u,f){const m=Ho(l),x=i.parse(m);i.run(x,m,function(y,g,v){if(y||!g||!v)return h(y);const b=g,k=i.stringify(b,v);zk(k)?v.value=k:v.result=k,h(y,v)});function h(y,g){y||!g?f(y):u?u(g):r(void 0,g)}}}processSync(l){let r=!1,i;return this.freeze(),Xf("processSync",this.parser||this.Parser),Gf("processSync",this.compiler||this.Compiler),this.process(l,o),_g("processSync","process",r),i;function o(u,f){r=!0,Tg(u),i=f}}run(l,r,i){Mg(l),this.freeze();const o=this.transformers;return!i&&typeof r=="function"&&(i=r,r=void 0),i?u(void 0,i):new Promise(u);function u(f,m){const x=Ho(r);o.run(l,x,h);function h(y,g,v){const b=g||l;y?m(y):f?f(b):i(void 0,b,v)}}}runSync(l,r){let i=!1,o;return this.run(l,r,u),_g("runSync","run",i),o;function u(f,m){Tg(f),o=m,i=!0}}stringify(l,r){this.freeze();const i=Ho(r),o=this.compiler||this.Compiler;return Gf("stringify",o),Mg(l),o(l,i)}use(l,...r){const i=this.attachers,o=this.namespace;if(Qf("use",this.frozen),l!=null)if(typeof l=="function")x(l,r);else if(typeof l=="object")Array.isArray(l)?m(l):f(l);else throw new TypeError("Expected usable value, not `"+l+"`");return this;function u(h){if(typeof h=="function")x(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[y,...g]=h;x(y,g)}else f(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function f(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");m(h.plugins),h.settings&&(o.settings=qf(!0,o.settings,h.settings))}function m(h){let y=-1;if(h!=null)if(Array.isArray(h))for(;++y<h.length;){const g=h[y];u(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function x(h,y){let g=-1,v=-1;for(;++g<i.length;)if(i[g][0]===h){v=g;break}if(v===-1)i.push([h,...y]);else if(y.length>0){let[b,...k]=y;const E=i[v][1];Sd(E)&&Sd(b)&&(b=qf(!0,E,b)),i[v]=[h,b,...k]}}}}const Tk=new Kd().freeze();function Xf(t,l){if(typeof l!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Gf(t,l){if(typeof l!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Qf(t,l){if(l)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Mg(t){if(!Sd(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function _g(t,l,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+l+"` instead")}function Ho(t){return Dk(t)?t:new iy(t)}function Dk(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function zk(t){return typeof t=="string"||Mk(t)}function Mk(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const _k="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Rg=[],Og={allowDangerousHtml:!0},Rk=/^(https?|ircs?|mailto|xmpp)$/i,Ok=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function sy(t){const l=Bk(t),r=Lk(t);return Fk(l.runSync(l.parse(r),r),t)}function Bk(t){const l=t.rehypePlugins||Rg,r=t.remarkPlugins||Rg,i=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Og}:Og;return Tk().use(g3).use(r).use(fk,i).use(l)}function Lk(t){const l=t.children||"",r=new iy;return typeof l=="string"&&(r.value=l),r}function Fk(t,l){const r=l.allowedElements,i=l.allowElement,o=l.components,u=l.disallowedElements,f=l.skipHtml,m=l.unwrapDisallowed,x=l.urlTransform||Uk;for(const y of Ok)Object.hasOwn(l,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+_k+y.id,void 0);return Qd(t,h),e2(t,{Fragment:c.Fragment,components:o,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function h(y,g,v){if(y.type==="raw"&&v&&typeof g=="number")return f?v.children.splice(g,1):v.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let b;for(b in Ff)if(Object.hasOwn(Ff,b)&&Object.hasOwn(y.properties,b)){const k=y.properties[b],E=Ff[b];(E===null||E.includes(y.tagName))&&(y.properties[b]=x(String(k||""),b,y))}}if(y.type==="element"){let b=r?!r.includes(y.tagName):u?u.includes(y.tagName):!1;if(!b&&i&&typeof g=="number"&&(b=!i(y,g,v)),b&&v&&typeof g=="number")return m&&y.children?v.children.splice(g,1,...y.children):v.children.splice(g,1),g}}}function Uk(t){const l=t.indexOf(":"),r=t.indexOf("?"),i=t.indexOf("#"),o=t.indexOf("/");return l===-1||o!==-1&&l>o||r!==-1&&l>r||i!==-1&&l>i||Rk.test(t.slice(0,l))?t:""}function Bg(t,l){const r=String(t);if(typeof l!="string")throw new TypeError("Expected character");let i=0,o=r.indexOf(l);for(;o!==-1;)i++,o=r.indexOf(l,o+l.length);return i}function Hk(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function $k(t,l,r){const o=xc((r||{}).ignore||[]),u=qk(l);let f=-1;for(;++f<u.length;)ry(t,"text",m);function m(h,y){let g=-1,v;for(;++g<y.length;){const b=y[g],k=v?v.children:void 0;if(o(b,k?k.indexOf(b):void 0,v))return;v=b}if(v)return x(h,y)}function x(h,y){const g=y[y.length-1],v=u[f][0],b=u[f][1];let k=0;const N=g.children.indexOf(h);let T=!1,L=[];v.lastIndex=0;let $=v.exec(h.value);for(;$;){const K=$.index,V={index:$.index,input:$.input,stack:[...y,h]};let M=b(...$,V);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?v.lastIndex=K+1:(k!==K&&L.push({type:"text",value:h.value.slice(k,K)}),Array.isArray(M)?L.push(...M):M&&L.push(M),k=K+$[0].length,T=!0),!v.global)break;$=v.exec(h.value)}return T?(k<h.value.length&&L.push({type:"text",value:h.value.slice(k)}),g.children.splice(N,1,...L)):L=[h],N+L.length}}function qk(t){const l=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!t[0]||Array.isArray(t[0])?t:[t];let i=-1;for(;++i<r.length;){const o=r[i];l.push([Ik(o[0]),Yk(o[1])])}return l}function Ik(t){return typeof t=="string"?new RegExp(Hk(t),"g"):t}function Yk(t){return typeof t=="function"?t:function(){return t}}const Kf="phrasing",Zf=["autolink","link","image","label"];function Vk(){return{transforms:[Wk],enter:{literalAutolink:Gk,literalAutolinkEmail:Jf,literalAutolinkHttp:Jf,literalAutolinkWww:Jf},exit:{literalAutolink:Jk,literalAutolinkEmail:Zk,literalAutolinkHttp:Qk,literalAutolinkWww:Kk}}}function Xk(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Kf,notInConstruct:Zf},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Kf,notInConstruct:Zf},{character:":",before:"[ps]",after:"\\/",inConstruct:Kf,notInConstruct:Zf}]}}function Gk(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Jf(t){this.config.enter.autolinkProtocol.call(this,t)}function Qk(t){this.config.exit.autolinkProtocol.call(this,t)}function Kk(t){this.config.exit.data.call(this,t);const l=this.stack[this.stack.length-1];l.type,l.url="http://"+this.sliceSerialize(t)}function Zk(t){this.config.exit.autolinkEmail.call(this,t)}function Jk(t){this.exit(t)}function Wk(t){$k(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Pk],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),e4]],{ignore:["link","linkReference"]})}function Pk(t,l,r,i,o){let u="";if(!oy(o)||(/^w/i.test(l)&&(r=l+r,l="",u="http://"),!t4(r)))return!1;const f=n4(r+i);if(!f[0])return!1;const m={type:"link",title:null,url:u+l+f[0],children:[{type:"text",value:l+f[0]}]};return f[1]?[m,{type:"text",value:f[1]}]:m}function e4(t,l,r,i){return!oy(i,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+l+"@"+r,children:[{type:"text",value:l+"@"+r}]}}function t4(t){const l=t.split(".");return!(l.length<2||l[l.length-1]&&(/_/.test(l[l.length-1])||!/[a-zA-Z\d]/.test(l[l.length-1]))||l[l.length-2]&&(/_/.test(l[l.length-2])||!/[a-zA-Z\d]/.test(l[l.length-2])))}function n4(t){const l=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!l)return[t,void 0];t=t.slice(0,l.index);let r=l[0],i=r.indexOf(")");const o=Bg(t,"(");let u=Bg(t,")");for(;i!==-1&&o>u;)t+=r.slice(0,i+1),r=r.slice(i+1),i=r.indexOf(")"),u++;return[t,r]}function oy(t,l){const r=t.input.charCodeAt(t.index-1);return(t.index===0||rr(r)||hc(r))&&(!l||r!==47)}cy.peek=f4;function l4(){this.buffer()}function a4(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function r4(){this.buffer()}function i4(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function s4(t){const l=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=cl(this.sliceSerialize(t)).toLowerCase(),r.label=l}function o4(t){this.exit(t)}function c4(t){const l=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=cl(this.sliceSerialize(t)).toLowerCase(),r.label=l}function u4(t){this.exit(t)}function f4(){return"["}function cy(t,l,r,i){const o=r.createTracker(i);let u=o.move("[^");const f=r.enter("footnoteReference"),m=r.enter("reference");return u+=o.move(r.safe(r.associationId(t),{after:"]",before:u})),m(),f(),u+=o.move("]"),u}function d4(){return{enter:{gfmFootnoteCallString:l4,gfmFootnoteCall:a4,gfmFootnoteDefinitionLabelString:r4,gfmFootnoteDefinition:i4},exit:{gfmFootnoteCallString:s4,gfmFootnoteCall:o4,gfmFootnoteDefinitionLabelString:c4,gfmFootnoteDefinition:u4}}}function h4(t){let l=!1;return t&&t.firstLineBlank&&(l=!0),{handlers:{footnoteDefinition:r,footnoteReference:cy},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(i,o,u,f){const m=u.createTracker(f);let x=m.move("[^");const h=u.enter("footnoteDefinition"),y=u.enter("label");return x+=m.move(u.safe(u.associationId(i),{before:x,after:"]"})),y(),x+=m.move("]:"),i.children&&i.children.length>0&&(m.shift(4),x+=m.move((l?`
64
+ `:" ")+u.indentLines(u.containerFlow(i,m.current()),l?uy:m4))),h(),x}}function m4(t,l,r){return l===0?t:uy(t,l,r)}function uy(t,l,r){return(r?"":" ")+t}const p4=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];fy.peek=b4;function x4(){return{canContainEols:["delete"],enter:{strikethrough:y4},exit:{strikethrough:v4}}}function g4(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:p4}],handlers:{delete:fy}}}function y4(t){this.enter({type:"delete",children:[]},t)}function v4(t){this.exit(t)}function fy(t,l,r,i){const o=r.createTracker(i),u=r.enter("strikethrough");let f=o.move("~~");return f+=r.containerPhrasing(t,{...o.current(),before:f,after:"~"}),f+=o.move("~~"),u(),f}function b4(){return"~"}function w4(t){return t.length}function k4(t,l){const r=l||{},i=(r.align||[]).concat(),o=r.stringLength||w4,u=[],f=[],m=[],x=[];let h=0,y=-1;for(;++y<t.length;){const E=[],N=[];let T=-1;for(t[y].length>h&&(h=t[y].length);++T<t[y].length;){const L=S4(t[y][T]);if(r.alignDelimiters!==!1){const $=o(L);N[T]=$,(x[T]===void 0||$>x[T])&&(x[T]=$)}E.push(L)}f[y]=E,m[y]=N}let g=-1;if(typeof i=="object"&&"length"in i)for(;++g<h;)u[g]=Lg(i[g]);else{const E=Lg(i);for(;++g<h;)u[g]=E}g=-1;const v=[],b=[];for(;++g<h;){const E=u[g];let N="",T="";E===99?(N=":",T=":"):E===108?N=":":E===114&&(T=":");let L=r.alignDelimiters===!1?1:Math.max(1,x[g]-N.length-T.length);const $=N+"-".repeat(L)+T;r.alignDelimiters!==!1&&(L=N.length+L+T.length,L>x[g]&&(x[g]=L),b[g]=L),v[g]=$}f.splice(1,0,v),m.splice(1,0,b),y=-1;const k=[];for(;++y<f.length;){const E=f[y],N=m[y];g=-1;const T=[];for(;++g<h;){const L=E[g]||"";let $="",K="";if(r.alignDelimiters!==!1){const V=x[g]-(N[g]||0),M=u[g];M===114?$=" ".repeat(V):M===99?V%2?($=" ".repeat(V/2+.5),K=" ".repeat(V/2-.5)):($=" ".repeat(V/2),K=$):K=" ".repeat(V)}r.delimiterStart!==!1&&!g&&T.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&L==="")&&(r.delimiterStart!==!1||g)&&T.push(" "),r.alignDelimiters!==!1&&T.push($),T.push(L),r.alignDelimiters!==!1&&T.push(K),r.padding!==!1&&T.push(" "),(r.delimiterEnd!==!1||g!==h-1)&&T.push("|")}k.push(r.delimiterEnd===!1?T.join("").replace(/ +$/,""):T.join(""))}return k.join(`
65
+ `)}function S4(t){return t==null?"":String(t)}function Lg(t){const l=typeof t=="string"?t.codePointAt(0):0;return l===67||l===99?99:l===76||l===108?108:l===82||l===114?114:0}function j4(t,l,r,i){const o=r.enter("blockquote"),u=r.createTracker(i);u.move("> "),u.shift(2);const f=r.indentLines(r.containerFlow(t,u.current()),E4);return o(),f}function E4(t,l,r){return">"+(r?"":" ")+t}function C4(t,l){return Fg(t,l.inConstruct,!0)&&!Fg(t,l.notInConstruct,!1)}function Fg(t,l,r){if(typeof l=="string"&&(l=[l]),!l||l.length===0)return r;let i=-1;for(;++i<l.length;)if(t.includes(l[i]))return!0;return!1}function Ug(t,l,r,i){let o=-1;for(;++o<r.unsafe.length;)if(r.unsafe[o].character===`
66
+ `&&C4(r.stack,r.unsafe[o]))return/[ \t]/.test(i.before)?"":" ";return`\\
67
+ `}function N4(t,l){const r=String(t);let i=r.indexOf(l),o=i,u=0,f=0;if(typeof l!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===o?++u>f&&(f=u):u=1,o=i+l.length,i=r.indexOf(l,o);return f}function A4(t,l){return!!(l.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function T4(t){const l=t.options.fence||"`";if(l!=="`"&&l!=="~")throw new Error("Cannot serialize code with `"+l+"` for `options.fence`, expected `` ` `` or `~`");return l}function D4(t,l,r,i){const o=T4(r),u=t.value||"",f=o==="`"?"GraveAccent":"Tilde";if(A4(t,r)){const g=r.enter("codeIndented"),v=r.indentLines(u,z4);return g(),v}const m=r.createTracker(i),x=o.repeat(Math.max(N4(u,o)+1,3)),h=r.enter("codeFenced");let y=m.move(x);if(t.lang){const g=r.enter(`codeFencedLang${f}`);y+=m.move(r.safe(t.lang,{before:y,after:" ",encode:["`"],...m.current()})),g()}if(t.lang&&t.meta){const g=r.enter(`codeFencedMeta${f}`);y+=m.move(" "),y+=m.move(r.safe(t.meta,{before:y,after:`
68
+ `,encode:["`"],...m.current()})),g()}return y+=m.move(`
69
+ `),u&&(y+=m.move(u+`
70
+ `)),y+=m.move(x),h(),y}function z4(t,l,r){return(r?"":" ")+t}function Zd(t){const l=t.options.quote||'"';if(l!=='"'&&l!=="'")throw new Error("Cannot serialize title with `"+l+"` for `options.quote`, expected `\"`, or `'`");return l}function M4(t,l,r,i){const o=Zd(r),u=o==='"'?"Quote":"Apostrophe",f=r.enter("definition");let m=r.enter("label");const x=r.createTracker(i);let h=x.move("[");return h+=x.move(r.safe(r.associationId(t),{before:h,after:"]",...x.current()})),h+=x.move("]: "),m(),!t.url||/[\0- \u007F]/.test(t.url)?(m=r.enter("destinationLiteral"),h+=x.move("<"),h+=x.move(r.safe(t.url,{before:h,after:">",...x.current()})),h+=x.move(">")):(m=r.enter("destinationRaw"),h+=x.move(r.safe(t.url,{before:h,after:t.title?" ":`
71
+ `,...x.current()}))),m(),t.title&&(m=r.enter(`title${u}`),h+=x.move(" "+o),h+=x.move(r.safe(t.title,{before:h,after:o,...x.current()})),h+=x.move(o),m()),f(),h}function _4(t){const l=t.options.emphasis||"*";if(l!=="*"&&l!=="_")throw new Error("Cannot serialize emphasis with `"+l+"` for `options.emphasis`, expected `*`, or `_`");return l}function hs(t){return"&#x"+t.toString(16).toUpperCase()+";"}function oc(t,l,r){const i=Zr(t),o=Zr(l);return i===void 0?o===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}dy.peek=R4;function dy(t,l,r,i){const o=_4(r),u=r.enter("emphasis"),f=r.createTracker(i),m=f.move(o);let x=f.move(r.containerPhrasing(t,{after:o,before:m,...f.current()}));const h=x.charCodeAt(0),y=oc(i.before.charCodeAt(i.before.length-1),h,o);y.inside&&(x=hs(h)+x.slice(1));const g=x.charCodeAt(x.length-1),v=oc(i.after.charCodeAt(0),g,o);v.inside&&(x=x.slice(0,-1)+hs(g));const b=f.move(o);return u(),r.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},m+x+b}function R4(t,l,r){return r.options.emphasis||"*"}function O4(t,l){let r=!1;return Qd(t,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return r=!0,wd}),!!((!t.depth||t.depth<3)&&$d(t)&&(l.options.setext||r))}function B4(t,l,r,i){const o=Math.max(Math.min(6,t.depth||1),1),u=r.createTracker(i);if(O4(t,r)){const y=r.enter("headingSetext"),g=r.enter("phrasing"),v=r.containerPhrasing(t,{...u.current(),before:`
72
+ `,after:`
73
+ `});return g(),y(),v+`
74
+ `+(o===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
75
+ `))+1))}const f="#".repeat(o),m=r.enter("headingAtx"),x=r.enter("phrasing");u.move(f+" ");let h=r.containerPhrasing(t,{before:"# ",after:`
76
+ `,...u.current()});return/^[\t ]/.test(h)&&(h=hs(h.charCodeAt(0))+h.slice(1)),h=h?f+" "+h:f,r.options.closeAtx&&(h+=" "+f),x(),m(),h}hy.peek=L4;function hy(t){return t.value||""}function L4(){return"<"}my.peek=F4;function my(t,l,r,i){const o=Zd(r),u=o==='"'?"Quote":"Apostrophe",f=r.enter("image");let m=r.enter("label");const x=r.createTracker(i);let h=x.move("![");return h+=x.move(r.safe(t.alt,{before:h,after:"]",...x.current()})),h+=x.move("]("),m(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(m=r.enter("destinationLiteral"),h+=x.move("<"),h+=x.move(r.safe(t.url,{before:h,after:">",...x.current()})),h+=x.move(">")):(m=r.enter("destinationRaw"),h+=x.move(r.safe(t.url,{before:h,after:t.title?" ":")",...x.current()}))),m(),t.title&&(m=r.enter(`title${u}`),h+=x.move(" "+o),h+=x.move(r.safe(t.title,{before:h,after:o,...x.current()})),h+=x.move(o),m()),h+=x.move(")"),f(),h}function F4(){return"!"}py.peek=U4;function py(t,l,r,i){const o=t.referenceType,u=r.enter("imageReference");let f=r.enter("label");const m=r.createTracker(i);let x=m.move("![");const h=r.safe(t.alt,{before:x,after:"]",...m.current()});x+=m.move(h+"]["),f();const y=r.stack;r.stack=[],f=r.enter("reference");const g=r.safe(r.associationId(t),{before:x,after:"]",...m.current()});return f(),r.stack=y,u(),o==="full"||!h||h!==g?x+=m.move(g+"]"):o==="shortcut"?x=x.slice(0,-1):x+=m.move("]"),x}function U4(){return"!"}xy.peek=H4;function xy(t,l,r){let i=t.value||"",o="`",u=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(i);)o+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++u<r.unsafe.length;){const f=r.unsafe[u],m=r.compilePattern(f);let x;if(f.atBreak)for(;x=m.exec(i);){let h=x.index;i.charCodeAt(h)===10&&i.charCodeAt(h-1)===13&&h--,i=i.slice(0,h)+" "+i.slice(x.index+1)}}return o+i+o}function H4(){return"`"}function gy(t,l){const r=$d(t);return!!(!l.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(r===t.url||"mailto:"+r===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}yy.peek=$4;function yy(t,l,r,i){const o=Zd(r),u=o==='"'?"Quote":"Apostrophe",f=r.createTracker(i);let m,x;if(gy(t,r)){const y=r.stack;r.stack=[],m=r.enter("autolink");let g=f.move("<");return g+=f.move(r.containerPhrasing(t,{before:g,after:">",...f.current()})),g+=f.move(">"),m(),r.stack=y,g}m=r.enter("link"),x=r.enter("label");let h=f.move("[");return h+=f.move(r.containerPhrasing(t,{before:h,after:"](",...f.current()})),h+=f.move("]("),x(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(x=r.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(r.safe(t.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(x=r.enter("destinationRaw"),h+=f.move(r.safe(t.url,{before:h,after:t.title?" ":")",...f.current()}))),x(),t.title&&(x=r.enter(`title${u}`),h+=f.move(" "+o),h+=f.move(r.safe(t.title,{before:h,after:o,...f.current()})),h+=f.move(o),x()),h+=f.move(")"),m(),h}function $4(t,l,r){return gy(t,r)?"<":"["}vy.peek=q4;function vy(t,l,r,i){const o=t.referenceType,u=r.enter("linkReference");let f=r.enter("label");const m=r.createTracker(i);let x=m.move("[");const h=r.containerPhrasing(t,{before:x,after:"]",...m.current()});x+=m.move(h+"]["),f();const y=r.stack;r.stack=[],f=r.enter("reference");const g=r.safe(r.associationId(t),{before:x,after:"]",...m.current()});return f(),r.stack=y,u(),o==="full"||!h||h!==g?x+=m.move(g+"]"):o==="shortcut"?x=x.slice(0,-1):x+=m.move("]"),x}function q4(){return"["}function Jd(t){const l=t.options.bullet||"*";if(l!=="*"&&l!=="+"&&l!=="-")throw new Error("Cannot serialize items with `"+l+"` for `options.bullet`, expected `*`, `+`, or `-`");return l}function I4(t){const l=Jd(t),r=t.options.bulletOther;if(!r)return l==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===l)throw new Error("Expected `bullet` (`"+l+"`) and `bulletOther` (`"+r+"`) to be different");return r}function Y4(t){const l=t.options.bulletOrdered||".";if(l!=="."&&l!==")")throw new Error("Cannot serialize items with `"+l+"` for `options.bulletOrdered`, expected `.` or `)`");return l}function by(t){const l=t.options.rule||"*";if(l!=="*"&&l!=="-"&&l!=="_")throw new Error("Cannot serialize rules with `"+l+"` for `options.rule`, expected `*`, `-`, or `_`");return l}function V4(t,l,r,i){const o=r.enter("list"),u=r.bulletCurrent;let f=t.ordered?Y4(r):Jd(r);const m=t.ordered?f==="."?")":".":I4(r);let x=l&&r.bulletLastUsed?f===r.bulletLastUsed:!1;if(!t.ordered){const y=t.children?t.children[0]:void 0;if((f==="*"||f==="-")&&y&&(!y.children||!y.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(x=!0),by(r)===f&&y){let g=-1;for(;++g<t.children.length;){const v=t.children[g];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){x=!0;break}}}}x&&(f=m),r.bulletCurrent=f;const h=r.containerFlow(t,i);return r.bulletLastUsed=f,r.bulletCurrent=u,o(),h}function X4(t){const l=t.options.listItemIndent||"one";if(l!=="tab"&&l!=="one"&&l!=="mixed")throw new Error("Cannot serialize items with `"+l+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return l}function G4(t,l,r,i){const o=X4(r);let u=r.bulletCurrent||Jd(r);l&&l.type==="list"&&l.ordered&&(u=(typeof l.start=="number"&&l.start>-1?l.start:1)+(r.options.incrementListMarker===!1?0:l.children.indexOf(t))+u);let f=u.length+1;(o==="tab"||o==="mixed"&&(l&&l.type==="list"&&l.spread||t.spread))&&(f=Math.ceil(f/4)*4);const m=r.createTracker(i);m.move(u+" ".repeat(f-u.length)),m.shift(f);const x=r.enter("listItem"),h=r.indentLines(r.containerFlow(t,m.current()),y);return x(),h;function y(g,v,b){return v?(b?"":" ".repeat(f))+g:(b?u:u+" ".repeat(f-u.length))+g}}function Q4(t,l,r,i){const o=r.enter("paragraph"),u=r.enter("phrasing"),f=r.containerPhrasing(t,i);return u(),o(),f}const K4=xc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Z4(t,l,r,i){return(t.children.some(function(f){return K4(f)})?r.containerPhrasing:r.containerFlow).call(r,t,i)}function J4(t){const l=t.options.strong||"*";if(l!=="*"&&l!=="_")throw new Error("Cannot serialize strong with `"+l+"` for `options.strong`, expected `*`, or `_`");return l}wy.peek=W4;function wy(t,l,r,i){const o=J4(r),u=r.enter("strong"),f=r.createTracker(i),m=f.move(o+o);let x=f.move(r.containerPhrasing(t,{after:o,before:m,...f.current()}));const h=x.charCodeAt(0),y=oc(i.before.charCodeAt(i.before.length-1),h,o);y.inside&&(x=hs(h)+x.slice(1));const g=x.charCodeAt(x.length-1),v=oc(i.after.charCodeAt(0),g,o);v.inside&&(x=x.slice(0,-1)+hs(g));const b=f.move(o+o);return u(),r.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},m+x+b}function W4(t,l,r){return r.options.strong||"*"}function P4(t,l,r,i){return r.safe(t.value,i)}function eS(t){const l=t.options.ruleRepetition||3;if(l<3)throw new Error("Cannot serialize rules with repetition `"+l+"` for `options.ruleRepetition`, expected `3` or more");return l}function tS(t,l,r){const i=(by(r)+(r.options.ruleSpaces?" ":"")).repeat(eS(r));return r.options.ruleSpaces?i.slice(0,-1):i}const ky={blockquote:j4,break:Ug,code:D4,definition:M4,emphasis:dy,hardBreak:Ug,heading:B4,html:hy,image:my,imageReference:py,inlineCode:xy,link:yy,linkReference:vy,list:V4,listItem:G4,paragraph:Q4,root:Z4,strong:wy,text:P4,thematicBreak:tS};function nS(){return{enter:{table:lS,tableData:Hg,tableHeader:Hg,tableRow:rS},exit:{codeText:iS,table:aS,tableData:Wf,tableHeader:Wf,tableRow:Wf}}}function lS(t){const l=t._align;this.enter({type:"table",align:l.map(function(r){return r==="none"?null:r}),children:[]},t),this.data.inTable=!0}function aS(t){this.exit(t),this.data.inTable=void 0}function rS(t){this.enter({type:"tableRow",children:[]},t)}function Wf(t){this.exit(t)}function Hg(t){this.enter({type:"tableCell",children:[]},t)}function iS(t){let l=this.resume();this.data.inTable&&(l=l.replace(/\\([\\|])/g,sS));const r=this.stack[this.stack.length-1];r.type,r.value=l,this.exit(t)}function sS(t,l){return l==="|"?l:t}function oS(t){const l=t||{},r=l.tableCellPadding,i=l.tablePipeAlign,o=l.stringLength,u=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
77
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:f,tableCell:x,tableRow:m}};function f(b,k,E,N){return h(y(b,E,N),b.align)}function m(b,k,E,N){const T=g(b,E,N),L=h([T]);return L.slice(0,L.indexOf(`
78
+ `))}function x(b,k,E,N){const T=E.enter("tableCell"),L=E.enter("phrasing"),$=E.containerPhrasing(b,{...N,before:u,after:u});return L(),T(),$}function h(b,k){return k4(b,{align:k,alignDelimiters:i,padding:r,stringLength:o})}function y(b,k,E){const N=b.children;let T=-1;const L=[],$=k.enter("table");for(;++T<N.length;)L[T]=g(N[T],k,E);return $(),L}function g(b,k,E){const N=b.children;let T=-1;const L=[],$=k.enter("tableRow");for(;++T<N.length;)L[T]=x(N[T],b,k,E);return $(),L}function v(b,k,E){let N=ky.inlineCode(b,k,E);return E.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function cS(){return{exit:{taskListCheckValueChecked:$g,taskListCheckValueUnchecked:$g,paragraph:fS}}}function uS(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:dS}}}function $g(t){const l=this.stack[this.stack.length-2];l.type,l.checked=t.type==="taskListCheckValueChecked"}function fS(t){const l=this.stack[this.stack.length-2];if(l&&l.type==="listItem"&&typeof l.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const i=r.children[0];if(i&&i.type==="text"){const o=l.children;let u=-1,f;for(;++u<o.length;){const m=o[u];if(m.type==="paragraph"){f=m;break}}f===r&&(i.value=i.value.slice(1),i.value.length===0?r.children.shift():r.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,r.position.start=Object.assign({},i.position.start)))}}this.exit(t)}function dS(t,l,r,i){const o=t.children[0],u=typeof t.checked=="boolean"&&o&&o.type==="paragraph",f="["+(t.checked?"x":" ")+"] ",m=r.createTracker(i);u&&m.move(f);let x=ky.listItem(t,l,r,{...i,...m.current()});return u&&(x=x.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),x;function h(y){return y+f}}function hS(){return[Vk(),d4(),x4(),nS(),cS()]}function mS(t){return{extensions:[Xk(),h4(t),g4(),oS(t),uS()]}}const pS={tokenize:wS,partial:!0},Sy={tokenize:kS,partial:!0},jy={tokenize:SS,partial:!0},Ey={tokenize:jS,partial:!0},xS={tokenize:ES,partial:!0},Cy={name:"wwwAutolink",tokenize:vS,previous:Ay},Ny={name:"protocolAutolink",tokenize:bS,previous:Ty},Il={name:"emailAutolink",tokenize:yS,previous:Dy},bl={};function gS(){return{text:bl}}let er=48;for(;er<123;)bl[er]=Il,er++,er===58?er=65:er===91&&(er=97);bl[43]=Il;bl[45]=Il;bl[46]=Il;bl[95]=Il;bl[72]=[Il,Ny];bl[104]=[Il,Ny];bl[87]=[Il,Cy];bl[119]=[Il,Cy];function yS(t,l,r){const i=this;let o,u;return f;function f(g){return!Ed(g)||!Dy.call(i,i.previous)||Wd(i.events)?r(g):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),m(g))}function m(g){return Ed(g)?(t.consume(g),m):g===64?(t.consume(g),x):r(g)}function x(g){return g===46?t.check(xS,y,h)(g):g===45||g===95||mn(g)?(u=!0,t.consume(g),x):y(g)}function h(g){return t.consume(g),o=!0,x}function y(g){return u&&o&&yn(i.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),l(g)):r(g)}}function vS(t,l,r){const i=this;return o;function o(f){return f!==87&&f!==119||!Ay.call(i,i.previous)||Wd(i.events)?r(f):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(pS,t.attempt(Sy,t.attempt(jy,u),r),r)(f))}function u(f){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),l(f)}}function bS(t,l,r){const i=this;let o="",u=!1;return f;function f(g){return(g===72||g===104)&&Ty.call(i,i.previous)&&!Wd(i.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),o+=String.fromCodePoint(g),t.consume(g),m):r(g)}function m(g){if(yn(g)&&o.length<5)return o+=String.fromCodePoint(g),t.consume(g),m;if(g===58){const v=o.toLowerCase();if(v==="http"||v==="https")return t.consume(g),x}return r(g)}function x(g){return g===47?(t.consume(g),u?h:(u=!0,x)):r(g)}function h(g){return g===null||rc(g)||pt(g)||rr(g)||hc(g)?r(g):t.attempt(Sy,t.attempt(jy,y),r)(g)}function y(g){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),l(g)}}function wS(t,l,r){let i=0;return o;function o(f){return(f===87||f===119)&&i<3?(i++,t.consume(f),o):f===46&&i===3?(t.consume(f),u):r(f)}function u(f){return f===null?r(f):l(f)}}function kS(t,l,r){let i,o,u;return f;function f(h){return h===46||h===95?t.check(Ey,x,m)(h):h===null||pt(h)||rr(h)||h!==45&&hc(h)?x(h):(u=!0,t.consume(h),f)}function m(h){return h===95?i=!0:(o=i,i=void 0),t.consume(h),f}function x(h){return o||i||!u?r(h):l(h)}}function SS(t,l){let r=0,i=0;return o;function o(f){return f===40?(r++,t.consume(f),o):f===41&&i<r?u(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?t.check(Ey,l,u)(f):f===null||pt(f)||rr(f)?l(f):(t.consume(f),o)}function u(f){return f===41&&i++,t.consume(f),o}}function jS(t,l,r){return i;function i(m){return m===33||m===34||m===39||m===41||m===42||m===44||m===46||m===58||m===59||m===63||m===95||m===126?(t.consume(m),i):m===38?(t.consume(m),u):m===93?(t.consume(m),o):m===60||m===null||pt(m)||rr(m)?l(m):r(m)}function o(m){return m===null||m===40||m===91||pt(m)||rr(m)?l(m):i(m)}function u(m){return yn(m)?f(m):r(m)}function f(m){return m===59?(t.consume(m),i):yn(m)?(t.consume(m),f):r(m)}}function ES(t,l,r){return i;function i(u){return t.consume(u),o}function o(u){return mn(u)?r(u):l(u)}}function Ay(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||pt(t)}function Ty(t){return!yn(t)}function Dy(t){return!(t===47||Ed(t))}function Ed(t){return t===43||t===45||t===46||t===95||mn(t)}function Wd(t){let l=t.length,r=!1;for(;l--;){const i=t[l][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){r=!0;break}if(i._gfmAutolinkLiteralWalkedInto){r=!1;break}}return t.length>0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const CS={tokenize:RS,partial:!0};function NS(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:zS,continuation:{tokenize:MS},exit:_S}},text:{91:{name:"gfmFootnoteCall",tokenize:DS},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:AS,resolveTo:TS}}}}function AS(t,l,r){const i=this;let o=i.events.length;const u=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let f;for(;o--;){const x=i.events[o][1];if(x.type==="labelImage"){f=x;break}if(x.type==="gfmFootnoteCall"||x.type==="labelLink"||x.type==="label"||x.type==="image"||x.type==="link")break}return m;function m(x){if(!f||!f._balanced)return r(x);const h=cl(i.sliceSerialize({start:f.end,end:i.now()}));return h.codePointAt(0)!==94||!u.includes(h.slice(1))?r(x):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(x),t.exit("gfmFootnoteCallLabelMarker"),l(x))}}function TS(t,l){let r=t.length;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},t[t.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},m=[t[r+1],t[r+2],["enter",i,l],t[r+3],t[r+4],["enter",o,l],["exit",o,l],["enter",u,l],["enter",f,l],["exit",f,l],["exit",u,l],t[t.length-2],t[t.length-1],["exit",i,l]];return t.splice(r,t.length-r+1,...m),t}function DS(t,l,r){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u=0,f;return m;function m(g){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(g),t.exit("gfmFootnoteCallLabelMarker"),x}function x(g){return g!==94?r(g):(t.enter("gfmFootnoteCallMarker"),t.consume(g),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",h)}function h(g){if(u>999||g===93&&!f||g===null||g===91||pt(g))return r(g);if(g===93){t.exit("chunkString");const v=t.exit("gfmFootnoteCallString");return o.includes(cl(i.sliceSerialize(v)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(g),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),l):r(g)}return pt(g)||(f=!0),u++,t.consume(g),g===92?y:h}function y(g){return g===91||g===92||g===93?(t.consume(g),u++,h):h(g)}}function zS(t,l,r){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u,f=0,m;return x;function x(k){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(k),t.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(k),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",y):r(k)}function y(k){if(f>999||k===93&&!m||k===null||k===91||pt(k))return r(k);if(k===93){t.exit("chunkString");const E=t.exit("gfmFootnoteDefinitionLabelString");return u=cl(i.sliceSerialize(E)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(k),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),v}return pt(k)||(m=!0),f++,t.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(t.consume(k),f++,y):y(k)}function v(k){return k===58?(t.enter("definitionMarker"),t.consume(k),t.exit("definitionMarker"),o.includes(u)||o.push(u),et(t,b,"gfmFootnoteDefinitionWhitespace")):r(k)}function b(k){return l(k)}}function MS(t,l,r){return t.check(ys,l,t.attempt(CS,l,r))}function _S(t){t.exit("gfmFootnoteDefinition")}function RS(t,l,r){const i=this;return et(t,o,"gfmFootnoteDefinitionIndent",5);function o(u){const f=i.events[i.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?l(u):r(u)}}function OS(t){let r=(t||{}).singleTilde;const i={name:"strikethrough",tokenize:u,resolveAll:o};return r==null&&(r=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function o(f,m){let x=-1;for(;++x<f.length;)if(f[x][0]==="enter"&&f[x][1].type==="strikethroughSequenceTemporary"&&f[x][1]._close){let h=x;for(;h--;)if(f[h][0]==="exit"&&f[h][1].type==="strikethroughSequenceTemporary"&&f[h][1]._open&&f[x][1].end.offset-f[x][1].start.offset===f[h][1].end.offset-f[h][1].start.offset){f[x][1].type="strikethroughSequence",f[h][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},f[h][1].start),end:Object.assign({},f[x][1].end)},g={type:"strikethroughText",start:Object.assign({},f[h][1].end),end:Object.assign({},f[x][1].start)},v=[["enter",y,m],["enter",f[h][1],m],["exit",f[h][1],m],["enter",g,m]],b=m.parser.constructs.insideSpan.null;b&&Vn(v,v.length,0,mc(b,f.slice(h+1,x),m)),Vn(v,v.length,0,[["exit",g,m],["enter",f[x][1],m],["exit",f[x][1],m],["exit",y,m]]),Vn(f,h-1,x-h+3,v),x=h+v.length-2;break}}for(x=-1;++x<f.length;)f[x][1].type==="strikethroughSequenceTemporary"&&(f[x][1].type="data");return f}function u(f,m,x){const h=this.previous,y=this.events;let g=0;return v;function v(k){return h===126&&y[y.length-1][1].type!=="characterEscape"?x(k):(f.enter("strikethroughSequenceTemporary"),b(k))}function b(k){const E=Zr(h);if(k===126)return g>1?x(k):(f.consume(k),g++,b);if(g<2&&!r)return x(k);const N=f.exit("strikethroughSequenceTemporary"),T=Zr(k);return N._open=!T||T===2&&!!E,N._close=!E||E===2&&!!T,m(k)}}}class BS{constructor(){this.map=[]}add(l,r,i){LS(this,l,r,i)}consume(l){if(this.map.sort(function(u,f){return u[0]-f[0]}),this.map.length===0)return;let r=this.map.length;const i=[];for(;r>0;)r-=1,i.push(l.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),l.length=this.map[r][0];i.push(l.slice()),l.length=0;let o=i.pop();for(;o;){for(const u of o)l.push(u);o=i.pop()}this.map.length=0}}function LS(t,l,r,i){let o=0;if(!(r===0&&i.length===0)){for(;o<t.map.length;){if(t.map[o][0]===l){t.map[o][1]+=r,t.map[o][2].push(...i);return}o+=1}t.map.push([l,r,i])}}function FS(t,l){let r=!1;const i=[];for(;l<t.length;){const o=t[l];if(r){if(o[0]==="enter")o[1].type==="tableContent"&&i.push(t[l+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(t[l-1][1].type==="tableDelimiterMarker"){const u=i.length-1;i[u]=i[u]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(r=!0);l+=1}return i}function US(){return{flow:{null:{name:"table",tokenize:HS,resolveAll:$S}}}}function HS(t,l,r){const i=this;let o=0,u=0,f;return m;function m(D){let U=i.events.length-1;for(;U>-1;){const te=i.events[U][1].type;if(te==="lineEnding"||te==="linePrefix")U--;else break}const B=U>-1?i.events[U][1].type:null,ne=B==="tableHead"||B==="tableRow"?M:x;return ne===M&&i.parser.lazy[i.now().line]?r(D):ne(D)}function x(D){return t.enter("tableHead"),t.enter("tableRow"),h(D)}function h(D){return D===124||(f=!0,u+=1),y(D)}function y(D){return D===null?r(D):Te(D)?u>1?(u=0,i.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(D),t.exit("lineEnding"),b):r(D):Ve(D)?et(t,y,"whitespace")(D):(u+=1,f&&(f=!1,o+=1),D===124?(t.enter("tableCellDivider"),t.consume(D),t.exit("tableCellDivider"),f=!0,y):(t.enter("data"),g(D)))}function g(D){return D===null||D===124||pt(D)?(t.exit("data"),y(D)):(t.consume(D),D===92?v:g)}function v(D){return D===92||D===124?(t.consume(D),g):g(D)}function b(D){return i.interrupt=!1,i.parser.lazy[i.now().line]?r(D):(t.enter("tableDelimiterRow"),f=!1,Ve(D)?et(t,k,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):k(D))}function k(D){return D===45||D===58?N(D):D===124?(f=!0,t.enter("tableCellDivider"),t.consume(D),t.exit("tableCellDivider"),E):V(D)}function E(D){return Ve(D)?et(t,N,"whitespace")(D):N(D)}function N(D){return D===58?(u+=1,f=!0,t.enter("tableDelimiterMarker"),t.consume(D),t.exit("tableDelimiterMarker"),T):D===45?(u+=1,T(D)):D===null||Te(D)?K(D):V(D)}function T(D){return D===45?(t.enter("tableDelimiterFiller"),L(D)):V(D)}function L(D){return D===45?(t.consume(D),L):D===58?(f=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(D),t.exit("tableDelimiterMarker"),$):(t.exit("tableDelimiterFiller"),$(D))}function $(D){return Ve(D)?et(t,K,"whitespace")(D):K(D)}function K(D){return D===124?k(D):D===null||Te(D)?!f||o!==u?V(D):(t.exit("tableDelimiterRow"),t.exit("tableHead"),l(D)):V(D)}function V(D){return r(D)}function M(D){return t.enter("tableRow"),J(D)}function J(D){return D===124?(t.enter("tableCellDivider"),t.consume(D),t.exit("tableCellDivider"),J):D===null||Te(D)?(t.exit("tableRow"),l(D)):Ve(D)?et(t,J,"whitespace")(D):(t.enter("data"),Q(D))}function Q(D){return D===null||D===124||pt(D)?(t.exit("data"),J(D)):(t.consume(D),D===92?ie:Q)}function ie(D){return D===92||D===124?(t.consume(D),Q):Q(D)}}function $S(t,l){let r=-1,i=!0,o=0,u=[0,0,0,0],f=[0,0,0,0],m=!1,x=0,h,y,g;const v=new BS;for(;++r<t.length;){const b=t[r],k=b[1];b[0]==="enter"?k.type==="tableHead"?(m=!1,x!==0&&(qg(v,l,x,h,y),y=void 0,x=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},v.add(r,0,[["enter",h,l]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(i=!0,g=void 0,u=[0,0,0,0],f=[0,r+1,0,0],m&&(m=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},v.add(r,0,[["enter",y,l]])),o=k.type==="tableDelimiterRow"?2:y?3:1):o&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(i=!1,f[2]===0&&(u[1]!==0&&(f[0]=f[1],g=$o(v,l,u,o,void 0,g),u=[0,0,0,0]),f[2]=r)):k.type==="tableCellDivider"&&(i?i=!1:(u[1]!==0&&(f[0]=f[1],g=$o(v,l,u,o,void 0,g)),u=f,f=[u[1],r,0,0])):k.type==="tableHead"?(m=!0,x=r):k.type==="tableRow"||k.type==="tableDelimiterRow"?(x=r,u[1]!==0?(f[0]=f[1],g=$o(v,l,u,o,r,g)):f[1]!==0&&(g=$o(v,l,f,o,r,g)),o=0):o&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(f[3]=r)}for(x!==0&&qg(v,l,x,h,y),v.consume(l.events),r=-1;++r<l.events.length;){const b=l.events[r];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=FS(l.events,r))}return t}function $o(t,l,r,i,o,u){const f=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",m="tableContent";r[0]!==0&&(u.end=Object.assign({},Xr(l.events,r[0])),t.add(r[0],0,[["exit",u,l]]));const x=Xr(l.events,r[1]);if(u={type:f,start:Object.assign({},x),end:Object.assign({},x)},t.add(r[1],0,[["enter",u,l]]),r[2]!==0){const h=Xr(l.events,r[2]),y=Xr(l.events,r[3]),g={type:m,start:Object.assign({},h),end:Object.assign({},y)};if(t.add(r[2],0,[["enter",g,l]]),i!==2){const v=l.events[r[2]],b=l.events[r[3]];if(v[1].end=Object.assign({},b[1].end),v[1].type="chunkText",v[1].contentType="text",r[3]>r[2]+1){const k=r[2]+1,E=r[3]-r[2]-1;t.add(k,E,[])}}t.add(r[3]+1,0,[["exit",g,l]])}return o!==void 0&&(u.end=Object.assign({},Xr(l.events,o)),t.add(o,0,[["exit",u,l]]),u=void 0),u}function qg(t,l,r,i,o){const u=[],f=Xr(l.events,r);o&&(o.end=Object.assign({},f),u.push(["exit",o,l])),i.end=Object.assign({},f),u.push(["exit",i,l]),t.add(r+1,0,u)}function Xr(t,l){const r=t[l],i=r[0]==="enter"?"start":"end";return r[1][i]}const qS={name:"tasklistCheck",tokenize:YS};function IS(){return{text:{91:qS}}}function YS(t,l,r){const i=this;return o;function o(x){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?r(x):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(x),t.exit("taskListCheckMarker"),u)}function u(x){return pt(x)?(t.enter("taskListCheckValueUnchecked"),t.consume(x),t.exit("taskListCheckValueUnchecked"),f):x===88||x===120?(t.enter("taskListCheckValueChecked"),t.consume(x),t.exit("taskListCheckValueChecked"),f):r(x)}function f(x){return x===93?(t.enter("taskListCheckMarker"),t.consume(x),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),m):r(x)}function m(x){return Te(x)?l(x):Ve(x)?t.check({tokenize:VS},l,r)(x):r(x)}}function VS(t,l,r){return et(t,i,"whitespace");function i(o){return o===null?r(o):l(o)}}function XS(t){return H1([gS(),NS(),OS(t),US(),IS()])}const GS={};function zy(t){const l=this,r=t||GS,i=l.data(),o=i.micromarkExtensions||(i.micromarkExtensions=[]),u=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),f=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);o.push(XS(r)),u.push(hS()),f.push(mS(r))}function bs({content:t,className:l=""}){return c.jsx("div",{className:`office-markdown ${l}`,children:c.jsx(sy,{remarkPlugins:[zy],components:{code:QS,table:({children:r})=>c.jsx("div",{className:"overflow-x-auto my-2",children:c.jsx("table",{className:"office-table",children:r})})},children:t})})}function QS({className:t,children:l,...r}){const i=/language-(\w+)/.exec(t??"");return i||typeof l=="string"&&l.includes(`
79
+ `)?c.jsx(KS,{language:i==null?void 0:i[1],children:l}):c.jsx("code",{className:"bg-gray-100 text-gray-700 px-1 py-0.5 rounded text-[0.9em] font-mono",...r,children:l})}function KS({children:t,language:l}){const[r,i]=j.useState(!1),o=String(t).replace(/\n$/,""),u=()=>{navigator.clipboard.writeText(o),i(!0),setTimeout(()=>i(!1),1500)};return c.jsxs("div",{className:"office-code-block group relative my-2",children:[l&&c.jsx("div",{className:"text-[10px] text-gray-400 px-3 pt-1.5",children:l}),c.jsx("button",{onClick:u,className:"absolute top-1.5 right-2 text-[10px] text-gray-400 hover:text-gray-600 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",children:r?"Copied!":"Copy"}),c.jsx("pre",{className:"overflow-x-auto p-3 text-xs leading-relaxed",children:c.jsx("code",{children:o})})]})}const Ig={$skin:"skinColor",$hair:"hairColor",$shirt:"shirtColor",$pants:"pantsColor",$shoes:"shoeColor"},ZS=/^(darken|lighten)\((\$\w+),\s*(\d+)\)$/;function JS(t,l){const r=parseInt(t.replace("#",""),16),i=Math.max(0,(r>>16&255)-l),o=Math.max(0,(r>>8&255)-l),u=Math.max(0,(r&255)-l);return`#${(i<<16|o<<8|u).toString(16).padStart(6,"0")}`}function WS(t,l){const r=parseInt(t.replace("#",""),16),i=Math.min(255,(r>>16&255)+l),o=Math.min(255,(r>>8&255)+l),u=Math.min(255,(r&255)+l);return`#${(i<<16|o<<8|u).toString(16).padStart(6,"0")}`}function My(t,l){const r=Ig[t];if(r&&l)return l[r];const i=ZS.exec(t);if(i){const[,o,u,f]=i,m=Ig[u],x=m&&l?l[m]:u,h=parseInt(f,10);return o==="darken"?JS(x,h):WS(x,h)}return t}function PS(t,l){return Cd(t,"hair",l,1)}function Cd(t,l,r,i){const o=t.layers.findIndex(f=>f.name===l),u=[...t.layers];if(o>=0)u[o]={...r,name:l};else{const f=i??u.length;u.splice(f,0,{...r,name:l})}return{...t,layers:u}}const Pd=new Map,eh=new Map;function _y(t,l){Pd.set(t,l)}function yc(t,l){eh.set(t,l)}function Nd(t){return Pd.get(t)}function e5(t){return eh.get(t)}function dC(){return Array.from(Pd.keys())}function hC(){return Array.from(eh.keys())}function t5(t,l,r,i,o=2){t.clearRect(0,0,l.width*o,l.height*o);for(const u of l.layers)Oy(t,u.pixels,o,r,i)}function Ry(t,l,r,i,o){for(const u of l){const f=My(u.c,o);u.a!==void 0&&u.a!==1&&(t.globalAlpha=u.a),t.fillStyle=f,t.fillRect(r+u.x,i+u.y,u.w,u.h),u.a!==void 0&&u.a!==1&&(t.globalAlpha=1)}}function n5(t,l){const r=l.scale;t.clearRect(0,0,l.canvasWidth,l.canvasHeight),Oy(t,l.pixels,r,0)}function Oy(t,l,r,i,o){for(const u of l){const f=My(u.c,o);u.a!==void 0&&u.a!==1&&(t.globalAlpha=u.a),t.fillStyle=f,t.fillRect(u.x*r,(u.y+i)*r,u.w*r,u.h*r),u.a!==void 0&&u.a!==1&&(t.globalAlpha=1)}}const th=new Map;function Ta(t,l,r){th.set(t,{id:t,name:l,layer:{...r,name:"hair"}})}function l5(t){return th.get(t)}function By(){return Array.from(th.values())}Ta("short","Short",{name:"hair",pixels:[{x:1,y:0,w:10,h:2,c:"$hair"},{x:0,y:1,w:2,h:2,c:"$hair"},{x:10,y:1,w:2,h:2,c:"$hair"},{x:2,y:0,w:8,h:1,c:"lighten($hair, 25)",a:.3}]});Ta("messy","Messy",{name:"hair",pixels:[{x:1,y:0,w:10,h:3,c:"$hair"},{x:0,y:1,w:2,h:3,c:"$hair"},{x:10,y:0,w:2,h:4,c:"$hair"},{x:3,y:-1,w:3,h:2,c:"$hair"},{x:7,y:-1,w:2,h:2,c:"lighten($hair, 20)"},{x:2,y:0,w:4,h:1,c:"lighten($hair, 30)",a:.3}]});Ta("bun","Bun",{name:"hair",pixels:[{x:1,y:0,w:10,h:2,c:"$hair"},{x:0,y:1,w:2,h:2,c:"$hair"},{x:10,y:1,w:2,h:2,c:"$hair"},{x:4,y:-2,w:4,h:3,c:"$hair"},{x:5,y:-2,w:2,h:1,c:"lighten($hair, 30)",a:.4}]});Ta("long","Long",{name:"hair",pixels:[{x:0,y:0,w:12,h:3,c:"$hair"},{x:-1,y:1,w:2,h:7,c:"$hair"},{x:11,y:1,w:2,h:7,c:"$hair"},{x:-1,y:6,w:2,h:3,c:"darken($hair, 15)",a:.5},{x:11,y:6,w:2,h:3,c:"darken($hair, 15)",a:.5},{x:2,y:0,w:8,h:1,c:"lighten($hair, 25)",a:.3}]});Ta("mohawk","Mohawk",{name:"hair",pixels:[{x:4,y:-2,w:4,h:4,c:"$hair"},{x:5,y:-3,w:2,h:2,c:"lighten($hair, 20)"},{x:1,y:1,w:3,h:2,c:"$hair"},{x:8,y:1,w:3,h:2,c:"$hair"}]});Ta("slicked","Slicked Back",{name:"hair",pixels:[{x:1,y:0,w:10,h:2,c:"$hair"},{x:0,y:1,w:2,h:2,c:"$hair"},{x:10,y:1,w:2,h:2,c:"$hair"},{x:2,y:0,w:8,h:1,c:"lighten($hair, 15)",a:.4},{x:3,y:1,w:6,h:1,c:"lighten($hair, 10)",a:.2}]});Ta("bob","Bob Cut",{name:"hair",pixels:[{x:0,y:0,w:12,h:3,c:"$hair"},{x:-1,y:1,w:2,h:5,c:"$hair"},{x:11,y:1,w:2,h:5,c:"$hair"},{x:-1,y:5,w:2,h:1,c:"darken($hair, 15)",a:.4},{x:11,y:5,w:2,h:1,c:"darken($hair, 15)",a:.4},{x:2,y:0,w:8,h:1,c:"lighten($hair, 25)",a:.3}]});Ta("curly","Curly",{name:"hair",pixels:[{x:0,y:0,w:12,h:4,c:"$hair"},{x:-1,y:1,w:2,h:5,c:"$hair"},{x:11,y:1,w:2,h:5,c:"$hair"},{x:2,y:0,w:2,h:1,c:"lighten($hair, 25)",a:.4},{x:6,y:0,w:2,h:1,c:"lighten($hair, 25)",a:.4},{x:4,y:2,w:2,h:1,c:"lighten($hair, 15)",a:.3},{x:8,y:2,w:2,h:1,c:"lighten($hair, 15)",a:.3}]});const nh=new Map;function ei(t,l,r){nh.set(t,{id:t,name:l,layer:{...r,name:"torso"}})}function a5(t){return nh.get(t)}function Ly(){return Array.from(nh.values())}ei("tshirt","T-Shirt",{name:"torso",pixels:[{x:1,y:10,w:10,h:6,c:"$shirt"},{x:2,y:10,w:8,h:1,c:"lighten($shirt, 18)",a:.3},{x:1,y:10,w:1,h:5,c:"darken($shirt, 25)",a:.25},{x:10,y:10,w:1,h:5,c:"darken($shirt, 25)",a:.25},{x:-1,y:11,w:2,h:5,c:"$shirt"},{x:11,y:11,w:2,h:5,c:"$shirt"},{x:-1,y:15,w:2,h:1,c:"$skin"},{x:11,y:15,w:2,h:1,c:"$skin"}]});ei("suit","Suit",{name:"torso",pixels:[{x:1,y:10,w:10,h:6,c:"$shirt"},{x:2,y:10,w:8,h:1,c:"lighten($shirt, 12)",a:.3},{x:1,y:10,w:1,h:5,c:"darken($shirt, 30)",a:.3},{x:10,y:10,w:1,h:5,c:"darken($shirt, 30)",a:.3},{x:2,y:10,w:3,h:3,c:"darken($shirt, 20)",a:.3},{x:7,y:10,w:3,h:3,c:"darken($shirt, 20)",a:.3},{x:5,y:10,w:2,h:5,c:"#E8E8E8",a:.5},{x:-1,y:11,w:2,h:5,c:"$shirt"},{x:11,y:11,w:2,h:5,c:"$shirt"},{x:-1,y:11,w:2,h:1,c:"darken($shirt, 20)",a:.2},{x:11,y:11,w:2,h:1,c:"darken($shirt, 20)",a:.2},{x:-1,y:15,w:2,h:1,c:"$skin"},{x:11,y:15,w:2,h:1,c:"$skin"}]});ei("hoodie","Hoodie",{name:"torso",pixels:[{x:0,y:10,w:12,h:6,c:"$shirt"},{x:1,y:10,w:10,h:1,c:"lighten($shirt, 15)",a:.25},{x:0,y:10,w:1,h:5,c:"darken($shirt, 25)",a:.3},{x:11,y:10,w:1,h:5,c:"darken($shirt, 25)",a:.3},{x:2,y:8,w:8,h:2,c:"$shirt",a:.4},{x:3,y:13,w:6,h:2,c:"darken($shirt, 15)",a:.2},{x:5,y:10,w:1,h:2,c:"#DDD",a:.3},{x:6,y:10,w:1,h:2,c:"#DDD",a:.3},{x:-1,y:11,w:2,h:5,c:"$shirt"},{x:11,y:11,w:2,h:5,c:"$shirt"},{x:-1,y:15,w:2,h:1,c:"$skin"},{x:11,y:15,w:2,h:1,c:"$skin"}]});ei("vest","Vest",{name:"torso",pixels:[{x:1,y:10,w:10,h:6,c:"$shirt"},{x:2,y:10,w:8,h:1,c:"lighten($shirt, 18)",a:.3},{x:1,y:10,w:1,h:5,c:"darken($shirt, 25)",a:.25},{x:10,y:10,w:1,h:5,c:"darken($shirt, 25)",a:.25},{x:5,y:10,w:2,h:2,c:"$skin",a:.6},{x:-1,y:11,w:2,h:5,c:"$skin"},{x:11,y:11,w:2,h:5,c:"$skin"},{x:-1,y:15,w:2,h:1,c:"darken($skin, 10)"},{x:11,y:15,w:2,h:1,c:"darken($skin, 10)"}]});ei("tank","Tank Top",{name:"torso",pixels:[{x:2,y:10,w:8,h:6,c:"$shirt"},{x:3,y:10,w:6,h:1,c:"lighten($shirt, 18)",a:.3},{x:2,y:10,w:1,h:5,c:"darken($shirt, 25)",a:.25},{x:9,y:10,w:1,h:5,c:"darken($shirt, 25)",a:.25},{x:0,y:10,w:2,h:2,c:"$skin"},{x:10,y:10,w:2,h:2,c:"$skin"},{x:-1,y:11,w:2,h:5,c:"$skin"},{x:11,y:11,w:2,h:5,c:"$skin"},{x:-1,y:15,w:2,h:1,c:"darken($skin, 10)"},{x:11,y:15,w:2,h:1,c:"darken($skin, 10)"}]});ei("polo","Polo",{name:"torso",pixels:[{x:1,y:10,w:10,h:6,c:"$shirt"},{x:2,y:10,w:8,h:1,c:"lighten($shirt, 18)",a:.3},{x:1,y:10,w:1,h:5,c:"darken($shirt, 25)",a:.25},{x:10,y:10,w:1,h:5,c:"darken($shirt, 25)",a:.25},{x:3,y:9,w:6,h:2,c:"lighten($shirt, 25)",a:.5},{x:5,y:9,w:2,h:1,c:"$skin",a:.4},{x:5,y:10,w:2,h:3,c:"darken($shirt, 15)",a:.15},{x:-1,y:11,w:2,h:5,c:"$shirt"},{x:11,y:11,w:2,h:5,c:"$shirt"},{x:-1,y:15,w:2,h:1,c:"$skin"},{x:11,y:15,w:2,h:1,c:"$skin"}]});const lh=new Map;function Xn(t,l,r){lh.set(t,{id:t,name:l,layer:{...r,name:"accessory"}})}function r5(t){return lh.get(t)}function Fy(){return Array.from(lh.values())}Xn("none","None",{name:"accessory",pixels:[]});Xn("glasses","Glasses",{name:"accessory",pixels:[{x:2,y:4,w:3,h:2,c:"#2A3A50",a:.5},{x:7,y:4,w:3,h:2,c:"#2A3A50",a:.5},{x:5,y:4,w:2,h:1,c:"#2A3A50",a:.3}]});Xn("round-glasses","Round Glasses",{name:"accessory",pixels:[{x:2,y:3,w:3,h:3,c:"#8B7355",a:.4},{x:7,y:3,w:3,h:3,c:"#8B7355",a:.4},{x:3,y:4,w:1,h:1,c:"#B0E0FF",a:.15},{x:8,y:4,w:1,h:1,c:"#B0E0FF",a:.15},{x:5,y:4,w:2,h:1,c:"#8B7355",a:.3}]});Xn("sunglasses","Sunglasses",{name:"accessory",pixels:[{x:2,y:4,w:3,h:2,c:"#1A1A2E",a:.7},{x:7,y:4,w:3,h:2,c:"#1A1A2E",a:.7},{x:5,y:4,w:2,h:1,c:"#1A1A2E",a:.4},{x:3,y:4,w:1,h:1,c:"#334",a:.3},{x:8,y:4,w:1,h:1,c:"#334",a:.3}]});Xn("headphones","Headphones",{name:"accessory",pixels:[{x:0,y:0,w:12,h:1,c:"#333",a:.7},{x:-1,y:1,w:2,h:5,c:"#444"},{x:11,y:1,w:2,h:5,c:"#444"},{x:-1,y:2,w:2,h:3,c:"#555",a:.3},{x:11,y:2,w:2,h:3,c:"#555",a:.3}]});Xn("beret","Beret",{name:"accessory",pixels:[{x:2,y:-1,w:8,h:2,c:"#E91E63"},{x:1,y:0,w:2,h:1,c:"#E91E63",a:.6},{x:4,y:-1,w:4,h:1,c:"#F06292",a:.3}]});Xn("cap","Cap",{name:"accessory",pixels:[{x:1,y:-1,w:10,h:2,c:"#1565C0"},{x:0,y:1,w:12,h:1,c:"#0D47A1"},{x:3,y:-1,w:6,h:1,c:"#1E88E5",a:.3}]});Xn("badge","Badge",{name:"accessory",pixels:[{x:5,y:8,w:2,h:3,c:"#2196F3",a:.4},{x:4,y:11,w:4,h:3,c:"#FFF",a:.5},{x:5,y:12,w:2,h:1,c:"#333",a:.3}]});Xn("lapels","Lapels",{name:"accessory",pixels:[{x:1,y:10,w:3,h:2,c:"#1A1A2E",a:.4},{x:8,y:10,w:3,h:2,c:"#1A1A2E",a:.4}]});Xn("blush","Blush",{name:"accessory",pixels:[{x:2,y:6,w:1,h:1,c:"#FFCDD2",a:.3},{x:9,y:6,w:1,h:1,c:"#FFCDD2",a:.3}]});Xn("scarf","Scarf",{name:"accessory",pixels:[{x:2,y:9,w:8,h:2,c:"#E53935",a:.6},{x:3,y:9,w:6,h:1,c:"#EF5350",a:.3},{x:3,y:11,w:2,h:3,c:"#E53935",a:.5}]});Xn("tie","Tie",{name:"accessory",pixels:[{x:5,y:9,w:2,h:1,c:"#B71C1C"},{x:5,y:10,w:2,h:4,c:"#D32F2F"},{x:5,y:10,w:1,h:4,c:"#E53935",a:.3},{x:5,y:14,w:2,h:1,c:"#B71C1C",a:.8}]});Xn("bowtie","Bowtie",{name:"accessory",pixels:[{x:3,y:9,w:2,h:1,c:"#D32F2F"},{x:7,y:9,w:2,h:1,c:"#D32F2F"},{x:5,y:9,w:2,h:1,c:"#B71C1C"},{x:4,y:9,w:1,h:1,c:"#E53935",a:.3},{x:7,y:9,w:1,h:1,c:"#E53935",a:.3}]});function ts({r:t,g:l,b:r}){return`#${(t<<16|l<<8|r).toString(16).padStart(6,"0")}`}function Po(t,l){const r=t.r-l.r,i=t.g-l.g,o=t.b-l.b;return r*r+i*i+o*o}function i5(t,l){const r=[];r.push(t[Math.floor(Math.random()*t.length)]);for(let i=1;i<l;i++){const o=t.map(m=>{let x=1/0;for(const h of r)x=Math.min(x,Po(m,h));return x}),u=o.reduce((m,x)=>m+x,0);let f=Math.random()*u;for(let m=0;m<t.length;m++)if(f-=o[m],f<=0){r.push(t[m]);break}r.length<=i&&r.push(t[Math.floor(Math.random()*t.length)])}return r}function s5(t,l,r=20){if(t.length===0)return[];const i=i5(t,l);for(let u=0;u<r;u++){const f=Array.from({length:l},()=>[]);for(const x of t){let h=1/0,y=0;for(let g=0;g<l;g++){const v=Po(x,i[g]);v<h&&(h=v,y=g)}f[y].push(x)}let m=!0;for(let x=0;x<l;x++){if(f[x].length===0)continue;const h={r:0,g:0,b:0};for(const v of f[x])h.r+=v.r,h.g+=v.g,h.b+=v.b;const y=f[x].length,g={r:Math.round(h.r/y),g:Math.round(h.g/y),b:Math.round(h.b/y)};Po(g,i[x])>1&&(m=!1),i[x]=g}if(m)break}const o=new Array(l).fill(0);for(const u of t){let f=1/0,m=0;for(let x=0;x<l;x++){const h=Po(u,i[x]);h<f&&(f=h,m=x)}o[m]++}return i.map((u,f)=>({c:u,count:o[f]})).sort((u,f)=>f.count-u.count).map(u=>u.c)}function o5(t,l=1e4){const r=document.createElement("canvas"),i=t instanceof HTMLImageElement?t.naturalWidth:t.width,o=t instanceof HTMLImageElement?t.naturalHeight:t.height;r.width=i,r.height=o;const u=r.getContext("2d");u.drawImage(t,0,0);const f=u.getImageData(0,0,i,o).data,m=i*o,x=Math.max(1,Math.floor(m/l)),h=[];for(let y=0;y<m;y+=x){const g=y*4;f[g+3]<128||h.push({r:f[g],g:f[g+1],b:f[g+2]})}return h}function Yg(t){return .299*t.r+.587*t.g+.114*t.b}function Vg(t){const l=Math.max(t.r,t.g,t.b),r=Math.min(t.r,t.g,t.b);return l===0?0:(l-r)/l*255}function c5(t,l=8){const r=o5(t),i=s5(r,l);if(i.length<5)return{skinColor:"#F5CBA7",hairColor:"#2C1810",shirtColor:"#1565C0",pantsColor:"#37474F",shoeColor:"#212121"};const o=[...i].sort((g,v)=>Yg(v)-Yg(g)),u=[...i].sort((g,v)=>Vg(v)-Vg(g)),f=o[0],m=o[o.length-1],x=u[0],h=o[o.length-2],y=o[o.length-1];return{skinColor:ts(f),hairColor:ts(m),shirtColor:ts(x),pantsColor:ts(h),shoeColor:ts(y)}}const u5=[{x:1,y:19,w:10,h:2,c:"#100A06",a:.15},{x:2,y:15,w:3,h:4,c:"$pants"},{x:7,y:15,w:3,h:4,c:"$pants"},{x:2,y:19,w:3,h:2,c:"$shoes"},{x:7,y:19,w:3,h:2,c:"$shoes"},{x:2,y:19,w:3,h:1,c:"lighten($shoes, 20)",a:.4},{x:7,y:19,w:3,h:1,c:"lighten($shoes, 20)",a:.4}],f5=[{x:1,y:10,w:10,h:6,c:"$shirt"},{x:2,y:10,w:8,h:1,c:"lighten($shirt, 18)",a:.3},{x:1,y:10,w:1,h:5,c:"darken($shirt, 25)",a:.25},{x:10,y:10,w:1,h:5,c:"darken($shirt, 25)",a:.25},{x:4,y:10,w:4,h:2,c:"darken($shirt, 25)",a:.2},{x:-1,y:11,w:2,h:5,c:"$shirt"},{x:11,y:11,w:2,h:5,c:"$shirt"},{x:-1,y:15,w:2,h:1,c:"$skin"},{x:11,y:15,w:2,h:1,c:"$skin"}],d5=[{x:4,y:8,w:4,h:3,c:"$skin"},{x:1,y:1,w:10,h:8,c:"$skin"},{x:3,y:4,w:2,h:2,c:"#1A1A2E"},{x:7,y:4,w:2,h:2,c:"#1A1A2E"},{x:3,y:4,w:1,h:1,c:"#FFF",a:.35},{x:7,y:4,w:1,h:1,c:"#FFF",a:.35},{x:5,y:7,w:2,h:1,c:"darken($skin, 25)",a:.4},{x:0,y:4,w:1,h:1,c:"$skin"},{x:11,y:4,w:1,h:1,c:"$skin"}],h5=[{x:1,y:0,w:10,h:3,c:"$hair"},{x:0,y:1,w:2,h:3,c:"$hair"},{x:10,y:1,w:2,h:3,c:"$hair"},{x:2,y:0,w:8,h:1,c:"lighten($hair, 25)",a:.3},{x:2,y:2,w:8,h:1,c:"darken($hair, 20)",a:.2}];function m5(){return{width:12,height:22,layers:[{name:"lower",pixels:u5},{name:"torso",pixels:f5},{name:"head",pixels:d5},{name:"hair",pixels:h5},{name:"accessory",pixels:[]}]}}const p5=["cto","cbo","pm","engineer","designer","qa","data-analyst","default"];for(const t of p5)_y(`mini:${t}`,m5());const x5=[{x:1,y:10,w:10,h:8,c:"$shirt"},{x:2,y:10,w:8,h:1,c:"lighten($shirt, 18)",a:.3},{x:1,y:10,w:1,h:7,c:"darken($shirt, 25)",a:.25},{x:10,y:10,w:1,h:7,c:"darken($shirt, 25)",a:.25},{x:4,y:10,w:4,h:2,c:"darken($shirt, 25)",a:.2},{x:-1,y:11,w:2,h:5,c:"$shirt"},{x:11,y:11,w:2,h:5,c:"$shirt"}],g5=[{x:4,y:8,w:4,h:3,c:"$skin"},{x:1,y:1,w:10,h:8,c:"$skin"},{x:3,y:4,w:2,h:2,c:"#1A1A2E"},{x:7,y:4,w:2,h:2,c:"#1A1A2E"},{x:3,y:4,w:1,h:1,c:"#FFF",a:.35},{x:7,y:4,w:1,h:1,c:"#FFF",a:.35},{x:5,y:7,w:2,h:1,c:"darken($skin, 25)",a:.4},{x:0,y:4,w:1,h:1,c:"$skin"},{x:11,y:4,w:1,h:1,c:"$skin"}],y5=[{x:1,y:0,w:10,h:3,c:"$hair"},{x:0,y:1,w:2,h:3,c:"$hair"},{x:10,y:1,w:2,h:3,c:"$hair"},{x:2,y:0,w:8,h:1,c:"lighten($hair, 25)",a:.3},{x:2,y:2,w:8,h:1,c:"darken($hair, 20)",a:.2}];function v5(){return{width:12,height:22,layers:[{name:"torso",pixels:x5},{name:"head",pixels:g5},{name:"hair",pixels:y5},{name:"accessory",pixels:[]}]}}_y("mini-seated:default",v5());const b5={canvasWidth:160,canvasHeight:80,scale:2,pixels:[{x:0,y:0,w:80,h:40,c:"#1e2030"},{x:10,y:2,w:10,h:6,c:"#78889c"},{x:10,y:2,w:10,h:1,c:"#8899ad"},{x:24,y:0,w:10,h:6,c:"#78889c"},{x:24,y:0,w:10,h:1,c:"#8899ad"},{x:38,y:2,w:10,h:6,c:"#78889c"},{x:38,y:2,w:10,h:1,c:"#8899ad"},{x:54,y:2,w:10,h:6,c:"#78889c"},{x:54,y:2,w:10,h:1,c:"#8899ad"},{x:11,y:7,w:2,h:2,c:"#2a2a2a"},{x:17,y:7,w:2,h:2,c:"#2a2a2a"},{x:25,y:5,w:2,h:2,c:"#2a2a2a"},{x:31,y:5,w:2,h:2,c:"#2a2a2a"},{x:39,y:7,w:2,h:2,c:"#2a2a2a"},{x:45,y:7,w:2,h:2,c:"#2a2a2a"},{x:55,y:7,w:2,h:2,c:"#2a2a2a"},{x:61,y:7,w:2,h:2,c:"#2a2a2a"},{x:8,y:8,w:64,h:24,c:"#6b5b4b"},{x:4,y:10,w:72,h:20,c:"#7d6d5d"},{x:2,y:12,w:76,h:16,c:"#7d6d5d"},{x:2,y:12,w:76,h:2,c:"#8b7b6b"},{x:2,y:26,w:76,h:2,c:"#4b3b2b"},{x:2,y:28,w:76,h:3,c:"#4b3b2b"},{x:4,y:28,w:72,h:1,c:"#5b4b3b"},{x:6,y:30,w:3,h:2,c:"#3a2a1a"},{x:71,y:30,w:3,h:2,c:"#3a2a1a"},{x:18,y:14,w:44,h:12,c:"#6b5b4b",a:.5},{x:28,y:14,w:14,h:8,c:"#1a1a2e"},{x:29,y:15,w:12,h:6,c:"#1565C0",a:.5},{x:30,y:16,w:8,h:1,c:"#60A5FA",a:.45},{x:30,y:18,w:5,h:1,c:"#60A5FA",a:.3},{x:58,y:16,w:5,h:5,c:"#795548"},{x:59,y:17,w:3,h:3,c:"#A67C52"},{x:63,y:18,w:2,h:2,c:"#795548"},{x:10,y:16,w:10,h:8,c:"#FFEE58",a:.7},{x:11,y:17,w:8,h:1,c:"#9E9E9E",a:.5},{x:11,y:19,w:8,h:1,c:"#9E9E9E",a:.5},{x:11,y:21,w:6,h:1,c:"#9E9E9E",a:.5},{x:10,y:32,w:10,h:6,c:"#78889c"},{x:10,y:32,w:10,h:1,c:"#8899ad"},{x:24,y:34,w:10,h:6,c:"#78889c"},{x:24,y:34,w:10,h:1,c:"#8899ad"},{x:38,y:32,w:10,h:6,c:"#78889c"},{x:38,y:32,w:10,h:1,c:"#8899ad"},{x:54,y:32,w:10,h:6,c:"#78889c"},{x:54,y:32,w:10,h:1,c:"#8899ad"},{x:11,y:37,w:2,h:2,c:"#2a2a2a"},{x:17,y:37,w:2,h:2,c:"#2a2a2a"},{x:25,y:39,w:2,h:2,c:"#2a2a2a"},{x:31,y:39,w:2,h:2,c:"#2a2a2a"},{x:39,y:37,w:2,h:2,c:"#2a2a2a"},{x:45,y:37,w:2,h:2,c:"#2a2a2a"},{x:55,y:37,w:2,h:2,c:"#2a2a2a"},{x:61,y:37,w:2,h:2,c:"#2a2a2a"}]},w5={canvasWidth:128,canvasHeight:96,scale:2,pixels:[{x:0,y:0,w:64,h:48,c:"#4b3b2b"},{x:3,y:3,w:58,h:42,c:"#8B7355"},{x:4,y:4,w:10,h:10,c:"#A0845C",a:.5},{x:20,y:8,w:8,h:8,c:"#A0845C",a:.4},{x:40,y:6,w:12,h:6,c:"#A0845C",a:.3},{x:8,y:30,w:14,h:10,c:"#A0845C",a:.25},{x:44,y:32,w:10,h:8,c:"#A0845C",a:.3},{x:6,y:8,w:18,h:12,c:"#FFEE58"},{x:5,y:7,w:3,h:3,c:"#EF5350"},{x:6,y:7,w:2,h:2,c:"#C62828"},{x:8,y:10,w:14,h:1,c:"#9E9E9E"},{x:8,y:12,w:12,h:1,c:"#9E9E9E"},{x:8,y:14,w:10,h:1,c:"#9E9E9E"},{x:28,y:6,w:16,h:14,c:"#B3E5FC"},{x:35,y:5,w:3,h:3,c:"#42A5F5"},{x:36,y:5,w:2,h:2,c:"#1565C0"},{x:30,y:9,w:12,h:1,c:"#9E9E9E"},{x:30,y:11,w:10,h:1,c:"#9E9E9E"},{x:30,y:13,w:11,h:1,c:"#9E9E9E"},{x:8,y:24,w:16,h:14,c:"#C8E6C9"},{x:15,y:23,w:3,h:3,c:"#66BB6A"},{x:16,y:23,w:2,h:2,c:"#388E3C"},{x:10,y:27,w:12,h:1,c:"#9E9E9E"},{x:10,y:29,w:8,h:1,c:"#9E9E9E"},{x:10,y:31,w:10,h:1,c:"#9E9E9E"},{x:28,y:24,w:28,h:16,c:"#FFCDD2"},{x:43,y:23,w:3,h:3,c:"#EF5350"},{x:44,y:23,w:2,h:2,c:"#B71C1C"},{x:32,y:27,w:24,h:1,c:"#9E9E9E"},{x:32,y:29,w:20,h:1,c:"#9E9E9E"},{x:32,y:31,w:22,h:1,c:"#9E9E9E"},{x:32,y:33,w:15,h:1,c:"#9E9E9E"},{x:0,y:0,w:64,h:3,c:"#5a4a3a"},{x:0,y:45,w:64,h:3,c:"#3a2a1a"}]},k5={canvasWidth:128,canvasHeight:96,scale:2,pixels:[{x:2,y:0,w:60,h:48,c:"#3b1f0a"},{x:4,y:2,w:56,h:44,c:"#5a3310"},{x:4,y:13,w:56,h:2,c:"#2d1508"},{x:4,y:27,w:56,h:2,c:"#2d1508"},{x:4,y:41,w:56,h:2,c:"#2d1508"},{x:5,y:3,w:4,h:10,c:"#2563EB"},{x:5,y:3,w:4,h:2,c:"#1D4ED8"},{x:10,y:4,w:3,h:9,c:"#DC2626"},{x:10,y:4,w:3,h:2,c:"#B91C1C"},{x:14,y:3,w:5,h:10,c:"#16A34A"},{x:14,y:3,w:5,h:2,c:"#15803D"},{x:20,y:4,w:3,h:9,c:"#9333EA"},{x:20,y:4,w:3,h:2,c:"#7E22CE"},{x:24,y:3,w:4,h:10,c:"#D97706"},{x:24,y:3,w:4,h:2,c:"#B45309"},{x:29,y:4,w:3,h:9,c:"#0891B2"},{x:29,y:4,w:3,h:2,c:"#0E7490"},{x:33,y:3,w:5,h:10,c:"#BE123C"},{x:33,y:3,w:5,h:2,c:"#9F1239"},{x:39,y:4,w:4,h:9,c:"#4F46E5"},{x:39,y:4,w:4,h:2,c:"#3730A3"},{x:44,y:3,w:3,h:10,c:"#065F46"},{x:44,y:3,w:3,h:2,c:"#064E3B"},{x:48,y:4,w:4,h:9,c:"#92400E"},{x:48,y:4,w:4,h:2,c:"#78350F"},{x:53,y:3,w:5,h:10,c:"#1E3A5F"},{x:53,y:3,w:5,h:2,c:"#1e3060"},{x:6,y:6,w:2,h:1,c:"#BFDBFE",a:.7},{x:11,y:7,w:1,h:1,c:"#FCA5A5",a:.7},{x:16,y:6,w:3,h:1,c:"#BBF7D0",a:.7},{x:21,y:7,w:1,h:1,c:"#D8B4FE",a:.7},{x:25,y:6,w:2,h:1,c:"#FDE68A",a:.7},{x:5,y:16,w:5,h:11,c:"#0F766E"},{x:5,y:16,w:5,h:2,c:"#0D6056"},{x:11,y:17,w:3,h:10,c:"#C2410C"},{x:11,y:17,w:3,h:2,c:"#9A3412"},{x:15,y:16,w:4,h:11,c:"#7C3AED"},{x:15,y:16,w:4,h:2,c:"#6D28D9"},{x:20,y:17,w:3,h:10,c:"#1D4ED8"},{x:20,y:17,w:3,h:2,c:"#1E40AF"},{x:24,y:16,w:5,h:11,c:"#166534"},{x:24,y:16,w:5,h:2,c:"#14532D"},{x:30,y:17,w:4,h:10,c:"#991B1B"},{x:30,y:17,w:4,h:2,c:"#7F1D1D"},{x:35,y:16,w:3,h:11,c:"#854D0E"},{x:35,y:16,w:3,h:2,c:"#713F12"},{x:39,y:17,w:4,h:10,c:"#1E40AF"},{x:39,y:17,w:4,h:2,c:"#1E3A8A"},{x:44,y:16,w:5,h:11,c:"#065F46"},{x:44,y:16,w:5,h:2,c:"#064E3B"},{x:50,y:17,w:3,h:10,c:"#831843"},{x:50,y:17,w:3,h:2,c:"#6B21A8"},{x:54,y:16,w:5,h:11,c:"#374151"},{x:54,y:16,w:5,h:2,c:"#1F2937"},{x:5,y:30,w:4,h:11,c:"#0E7490"},{x:5,y:30,w:4,h:2,c:"#0C6B7E"},{x:10,y:31,w:3,h:10,c:"#B45309"},{x:10,y:31,w:3,h:2,c:"#92400E"},{x:14,y:30,w:5,h:11,c:"#6D28D9"},{x:14,y:30,w:5,h:2,c:"#5B21B6"},{x:20,y:30,w:7,h:8,c:"#1e293b"},{x:22,y:32,w:3,h:3,c:"#3b82f6",a:.9},{x:22,y:32,w:1,h:3,c:"#60a5fa",a:.6},{x:28,y:31,w:4,h:10,c:"#DC2626"},{x:28,y:31,w:4,h:2,c:"#B91C1C"},{x:33,y:30,w:3,h:11,c:"#065F46"},{x:33,y:30,w:3,h:2,c:"#064E3B"},{x:37,y:31,w:4,h:10,c:"#1D4ED8"},{x:37,y:31,w:4,h:2,c:"#1E40AF"},{x:42,y:35,w:6,h:6,c:"#92400E"},{x:43,y:30,w:4,h:6,c:"#16a34a",a:.8},{x:43,y:29,w:2,h:3,c:"#15803d",a:.7},{x:45,y:28,w:2,h:4,c:"#16a34a",a:.6},{x:49,y:30,w:3,h:11,c:"#7C3AED"},{x:49,y:30,w:3,h:2,c:"#6D28D9"},{x:53,y:31,w:5,h:10,c:"#B45309"},{x:53,y:31,w:5,h:2,c:"#92400E"},{x:2,y:46,w:60,h:2,c:"#1a0a03"},{x:2,y:0,w:60,h:2,c:"#4a2510"},{x:2,y:0,w:2,h:48,c:"#2d1508"},{x:60,y:0,w:2,h:48,c:"#2d1508"}]},S5={canvasWidth:96,canvasHeight:120,scale:2,pixels:[{x:2,y:0,w:44,h:60,c:"#546E7A"},{x:2,y:0,w:44,h:3,c:"#78909C"},{x:2,y:57,w:44,h:3,c:"#37474F"},{x:2,y:0,w:2,h:60,c:"#455A64"},{x:44,y:0,w:2,h:60,c:"#37474F"},{x:5,y:4,w:38,h:3,c:"#FFD54F",a:.5},{x:6,y:1,w:2,h:4,c:"#FFFDE7"},{x:10,y:0,w:2,h:5,c:"#FFF9C4"},{x:14,y:1,w:2,h:3,c:"#FFFDE7"},{x:18,y:0,w:2,h:4,c:"#FFF8E1"},{x:5,y:5,w:38,h:16,c:"#607D8B"},{x:5,y:5,w:38,h:2,c:"#78909C"},{x:15,y:12,w:18,h:4,c:"#37474F"},{x:22,y:11,w:4,h:6,c:"#455A64"},{x:23,y:13,w:2,h:2,c:"#B0BEC5"},{x:7,y:14,w:8,h:5,c:"#B0BEC5"},{x:8,y:15,w:6,h:1,c:"#607D8B"},{x:8,y:17,w:5,h:1,c:"#607D8B"},{x:5,y:23,w:38,h:16,c:"#607D8B"},{x:5,y:23,w:38,h:2,c:"#78909C"},{x:15,y:30,w:18,h:4,c:"#37474F"},{x:22,y:29,w:4,h:6,c:"#455A64"},{x:23,y:31,w:2,h:2,c:"#B0BEC5"},{x:7,y:32,w:8,h:5,c:"#B0BEC5"},{x:8,y:33,w:6,h:1,c:"#607D8B"},{x:8,y:35,w:4,h:1,c:"#607D8B"},{x:5,y:41,w:38,h:16,c:"#607D8B"},{x:5,y:41,w:38,h:2,c:"#78909C"},{x:15,y:48,w:18,h:4,c:"#37474F"},{x:22,y:47,w:4,h:6,c:"#455A64"},{x:23,y:49,w:2,h:2,c:"#B0BEC5"},{x:7,y:50,w:8,h:5,c:"#B0BEC5"},{x:8,y:51,w:6,h:1,c:"#607D8B"},{x:8,y:53,w:3,h:1,c:"#607D8B"}]};yc("meeting",b5);yc("bulletin",w5);yc("decision",S5);yc("knowledge",k5);const Pf=16,ed=24,j5=60,E5={cbo:0,cto:8,pm:15,engineer:22,designer:5,qa:12};function Uy(t,l){if(!t)return t;let r=t;if(l!=null&&l.hairStyle){const i=l5(l.hairStyle);i&&(r=PS(r,i.layer))}if(l!=null&&l.outfitStyle){const i=a5(l.outfitStyle);i&&(r=Cd(r,"torso",i.layer,1))}if(l!=null&&l.accessory&&l.accessory!=="none"){const i=r5(l.accessory);i&&(r=Cd(r,"accessory",i.layer))}return r}function vc({roleId:t,className:l,appearance:r,scale:i}){const o=j.useRef(null),u=j.useRef(0),f=j.useRef(0),m=j.useRef(r);m.current=r;const x=i??4,h=Pf*x,y=ed*x,g=j.useMemo(()=>{const v=Nd(`mini:${t}`)??Nd("mini:default");return Uy(v,r)},[t,r==null?void 0:r.hairStyle,r==null?void 0:r.outfitStyle,r==null?void 0:r.accessory]);return j.useEffect(()=>{const v=o.current;if(!v)return;const b=v.getContext("2d");if(!b)return;const k=E5[t]??0,E=()=>{f.current++;const N=m.current;if(!N||!g){u.current=requestAnimationFrame(E);return}const L=(f.current+k)%j5<30?1:0;b.clearRect(0,0,Pf,ed),b.save(),b.translate(2,1),t5(b,g,L,N,1),b.restore(),u.current=requestAnimationFrame(E)};return u.current=requestAnimationFrame(E),()=>cancelAnimationFrame(u.current)},[t,g]),c.jsx("canvas",{ref:o,width:Pf,height:ed,className:l,style:{imageRendering:"pixelated",display:"block",width:h,height:y}})}const C5={cto:"🏗️",cbo:"📊",pm:"📋",engineer:"⚙️",designer:"🎨",qa:"🔍"},Xg={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C"},N5={cto:8,cbo:7,pm:6,engineer:5,designer:5,qa:4,"data-analyst":4},A5={cto:"Chief Technology Officer",cbo:"Chief Business Officer",pm:"Product Manager",engineer:"Software Engineer",designer:"UI/UX Designer",qa:"QA Engineer"},T5=500,Gg=360,Qg=700,D5=t=>`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`;function z5({role:t,allRoles:l,recentActivity:r,onClose:i,onFireRole:o,terminalWidth:u=0,activeJobId:f,activeTask:m,isWorking:x,jobStartedAt:h,onStopJob:y,sessions:g,streamingSessionId:v,onCreateSessionSilent:b,onSendMessage:k,onFocusTerminal:E,onCustomize:N,onUpdateRole:T,appearance:L}){var Dt,Sn;const[$,K]=j.useState(T5),[V,M]=j.useState(!1),J=j.useRef(0),Q=j.useRef(0),[ie,D]=j.useState(!1),[U,B]=j.useState(!1),[ne,te]=j.useState(!1),[F,z]=j.useState("talk"),[q,Z]=j.useState(!1),[re,A]=j.useState(""),[_,Y]=j.useState(!1),C=j.useRef(null),{events:de,status:pe}=E1(f??null),[xe,ce]=j.useState(0);j.useEffect(()=>{if(!x||!h){ce(0);return}const G=new Date(h).getTime(),se=()=>ce(Math.floor((Date.now()-G)/1e3));se();const we=setInterval(se,1e3);return()=>clearInterval(we)},[x,h]);const ve=u>0,je=ve?u:0,tt=ve?Math.max(Gg,window.innerWidth-u-100):Qg,xt=Math.min($,tt),vt=j.useCallback(G=>{G.preventDefault(),J.current=G.clientX,Q.current=xt,M(!0);const se=ye=>{const Be=J.current-ye.clientX,jt=Math.min(Qg,Math.max(Gg,Q.current+Be));K(jt)},we=()=>{M(!1),document.removeEventListener("mousemove",se),document.removeEventListener("mouseup",we)};document.addEventListener("mousemove",se),document.addEventListener("mouseup",we)},[xt]),Lt=j.useRef(null),_e=t?g.find(G=>G.roleId===t.id):null,bt=G=>{if(!t)return;const se=x?"talk":F;_e?(k(_e.id,G,se),E(t.id)):(Lt.current={content:G,mode:se},b(t.id))};j.useEffect(()=>{if(_e&&Lt.current){const{content:G,mode:se}=Lt.current;Lt.current=null,k(_e.id,G,se),t&&E(t.id)}},[_e==null?void 0:_e.id]);const Ft=(()=>{if(!de.length)return null;const G=[];let se=0,we=0,ye=0;for(const Be of de)if(Be.type==="thinking")se++;else if(Be.type==="text")we++;else if(Be.type==="tool:start"){const jt=String(Be.data.name??"");G.includes(jt)||G.push(jt)}else Be.type==="dispatch:start"&&ye++;return{tools:G,thinkCount:se,textCount:we,dispatchCount:ye,total:de.length}})(),_n=m||(()=>{if(!_e)return null;const G=_e.messages;for(let se=G.length-1;se>=0;se--)if(G[se].from==="ceo")return G[se].content;return null})(),gt=(()=>{if(!_e)return null;const G=_e.messages;for(let se=G.length-1;se>=0;se--)if(G[se].from==="role"&&G[se].content)return G[se].content;return null})();if(!t)return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"dimmer fixed top-0 left-0 bottom-0 bg-black/30 z-40 open",style:{right:je},onClick:i}),c.jsx("div",{className:"side-panel open fixed top-0 h-full z-50 flex items-center justify-center border-l-[3px]",style:{right:je,width:xt,background:"var(--terminal-bg)",borderLeftColor:"var(--pixel-border)"},children:c.jsx("div",{className:"text-sm",style:{color:"var(--terminal-text-muted)"},children:"Loading role..."})})]});const Zt=Xg[t.id]??"#666",un=C5[t.id]??"👤",St=l.filter(G=>G.reportsTo===t.id),wn=_e&&v===_e.id,kn=t.name||A5[t.id]||t.id;return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"dimmer fixed top-0 left-0 bottom-0 bg-black/30 z-40 open",style:{right:je},onClick:i}),c.jsxs("div",{className:`side-panel open fixed top-0 h-full z-50 flex flex-col border-l-[3px] shadow-[-4px_0_20px_rgba(0,0,0,0.4)] ${V?"resizing":""}`,style:{borderLeftColor:Zt,right:je,width:xt,background:"var(--terminal-bg)"},children:[c.jsx("div",{className:`absolute top-0 -left-[5px] w-[10px] h-full cursor-col-resize z-[60] transition-colors ${V?"bg-white/10":"hover:bg-white/5"}`,onMouseDown:vt}),c.jsxs("div",{className:"relative shrink-0 overflow-hidden",style:{background:`linear-gradient(135deg, ${Zt}ee, ${Zt}99)`},children:[c.jsx("div",{className:"absolute inset-0 opacity-[0.06]",style:{backgroundImage:"repeating-linear-gradient(45deg, transparent, transparent 8px, white 8px, white 9px)"}}),c.jsxs("div",{className:"absolute top-3 right-3 flex items-center gap-1.5 z-10",children:[N&&c.jsx("button",{onClick:()=>N(t.id),className:"w-7 h-7 rounded-full bg-black/20 text-white flex items-center justify-center text-sm hover:bg-black/30 cursor-pointer backdrop-blur-sm",title:"Customize",children:"🎨"}),c.jsx("button",{onClick:i,className:"w-7 h-7 rounded-full bg-black/20 text-white flex items-center justify-center text-lg hover:bg-black/30 cursor-pointer backdrop-blur-sm",children:"×"})]}),c.jsxs("div",{className:"relative flex items-end gap-4 px-4 pt-4 pb-3",children:[c.jsx("div",{className:"shrink-0 relative",style:{marginBottom:-2},children:c.jsx("div",{className:"rounded-lg p-1",style:{background:"rgba(0,0,0,0.2)"},children:c.jsx(vc,{roleId:t.id,appearance:L,scale:8})})}),c.jsxs("div",{className:"flex-1 min-w-0 text-white pb-1",children:[c.jsxs("div",{className:"text-lg font-bold flex items-center gap-2",style:{fontFamily:"var(--pixel-font)"},children:[un," ",t.id.toUpperCase(),x&&c.jsx("span",{className:"text-[9px] font-semibold px-2 py-0.5 rounded-full animate-pulse",style:{background:"rgba(251,191,36,0.25)",color:"#fde68a"},children:"WORKING"})]}),q?c.jsxs("form",{className:"flex items-center gap-1.5 mt-0.5",onSubmit:async G=>{G.preventDefault();const se=re.trim();if(!se||se===kn||!T){Z(!1);return}Y(!0);try{await T(t.id,{name:se})}catch{}Y(!1),Z(!1)},children:[c.jsx("input",{ref:C,value:re,onChange:G=>A(G.target.value),onKeyDown:G=>{G.key==="Escape"&&Z(!1)},disabled:_,autoFocus:!0,className:"bg-white/20 text-white text-xs rounded px-1.5 py-0.5 outline-none focus:bg-white/30 w-full",style:{fontFamily:"inherit"}}),c.jsx("button",{type:"submit",disabled:_,className:"text-white/80 hover:text-white text-[10px] cursor-pointer shrink-0",children:"✓"}),c.jsx("button",{type:"button",onClick:()=>Z(!1),className:"text-white/60 hover:text-white text-[10px] cursor-pointer shrink-0",children:"✕"})]}):c.jsxs("div",{className:"text-xs opacity-75 mt-0.5 group/name flex items-center gap-1 cursor-pointer hover:opacity-100 transition-opacity",onClick:()=>{T&&(A(kn),Z(!0))},title:T?"Click to edit name":void 0,children:[kn,T&&c.jsx("span",{className:"opacity-0 group-hover/name:opacity-60 text-[10px]",children:"✎"})]})]})]}),c.jsxs("div",{className:"relative flex items-center gap-3 px-4 py-2 text-[10px] font-bold text-white/80",style:{background:"rgba(0,0,0,0.2)",fontFamily:"var(--pixel-font)"},children:[c.jsxs("span",{children:["Lv.",N5[t.id]??1]}),c.jsx("span",{style:{color:"rgba(255,255,255,0.3)"},children:"|"}),c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:x?"var(--idle-amber)":"var(--active-green)"}}),x?"Working":"Idle"]}),c.jsx("span",{style:{color:"rgba(255,255,255,0.3)"},children:"|"}),c.jsx("span",{children:t.level}),t.reportsTo&&c.jsxs(c.Fragment,{children:[c.jsx("span",{style:{color:"rgba(255,255,255,0.3)"},children:"|"}),c.jsxs("span",{className:"opacity-60",children:["→"," ",t.reportsTo]})]})]})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto flex flex-col min-h-0",children:[x&&c.jsxs("div",{className:"px-4 py-3 shrink-0",style:{borderBottom:"1px solid var(--terminal-border)",background:"var(--hud-bg-alt)"},children:[c.jsxs("div",{className:"flex items-center justify-between mb-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-2 h-2 rounded-full animate-pulse",style:{background:"var(--idle-amber)"}}),c.jsxs("span",{className:"text-xs font-semibold",style:{color:"var(--idle-amber)"},children:["Working",xe>0?` · ${D5(xe)}`:""]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{onClick:()=>E(t.id),className:"text-[10px] cursor-pointer hover:underline",style:{color:"var(--terminal-text-muted)"},children:"Open chat ↗"}),f&&y&&c.jsx("button",{onClick:()=>y(f),className:"text-[10px] px-2 py-0.5 rounded cursor-pointer font-semibold transition-colors",style:{background:"rgba(239,68,68,0.15)",color:"#ef4444"},children:"Stop"})]})]}),_n&&c.jsx("div",{className:"text-xs truncate",style:{color:"var(--terminal-text-secondary)"},children:_n})]}),x&&f&&Ft&&c.jsxs("div",{className:"px-4 py-2.5 shrink-0",style:{borderBottom:"1px solid var(--terminal-border)"},children:[c.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[c.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wider",style:{color:"var(--terminal-text-secondary)"},children:"Activity"}),c.jsx("button",{onClick:()=>E(t.id),className:"text-[10px] cursor-pointer hover:underline",style:{color:"var(--terminal-text-muted)"},children:"View details ↗"})]}),c.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[Ft.thinkCount>0&&c.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px]",style:{background:"rgba(168,85,247,0.15)",color:"#c084fc"},children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:"#a855f7"}}),"thinking ×",Ft.thinkCount]}),Ft.tools.map(G=>c.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px]",style:{background:"rgba(59,130,246,0.15)",color:"#60a5fa"},children:G},G)),Ft.dispatchCount>0&&c.jsxs("span",{className:"px-1.5 py-0.5 rounded text-[10px]",style:{background:"rgba(249,115,22,0.15)",color:"#fb923c"},children:["dispatch ×",Ft.dispatchCount]}),Ft.textCount>0&&c.jsxs("span",{className:"px-1.5 py-0.5 rounded text-[10px]",style:{background:"rgba(34,197,94,0.15)",color:"#4ade80"},children:["output ×",Ft.textCount]}),(pe==="streaming"||pe==="connecting")&&c.jsx("span",{className:"inline-block w-1.5 h-3 animate-pulse rounded-sm",style:{background:"var(--active-green)"}})]}),c.jsxs("div",{className:"text-[10px] mt-1",style:{color:"var(--terminal-text-muted)"},children:[Ft.total," events"]})]}),x&&gt&&c.jsxs("div",{className:"px-4 py-2.5 shrink-0",style:{borderBottom:"1px solid var(--terminal-border)"},children:[c.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[c.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wider",style:{color:"var(--terminal-text-secondary)"},children:"Last Message"}),c.jsx("button",{onClick:()=>E(t.id),className:"text-[10px] cursor-pointer hover:underline",style:{color:"var(--terminal-text-muted)"},children:"Open chat ↗"})]}),c.jsxs("div",{className:"rounded-lg p-2.5 text-xs leading-relaxed line-clamp-3 overflow-hidden",style:{background:"var(--hud-bg-alt)",border:"1px solid var(--terminal-border)",color:"var(--terminal-text-secondary)"},children:[gt.slice(0,200),gt.length>200&&"..."]})]}),x&&c.jsx("div",{className:"px-4 py-2.5 shrink-0",style:{borderBottom:"1px solid var(--terminal-border)"},children:c.jsx(Kg,{onSend:bt,disabled:!!wn,placeholder:"Ask something...",color:Zt})}),!x&&c.jsxs("div",{className:"px-4 pt-4 pb-2",children:[c.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wider mb-2",style:{color:"var(--terminal-text-secondary)"},children:"Latest"}),c.jsx(M5,{icon:un,roleId:t.id,roleName:kn,color:Zt,text:r})]}),!x&&c.jsx("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--terminal-border)"},children:c.jsxs("div",{className:"rounded-xl overflow-hidden",style:{background:"var(--hud-bg-alt)",border:"1px solid var(--terminal-border)"},children:[gt&&c.jsxs("div",{className:"px-3 pt-2.5 pb-2 cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--terminal-border)"},onClick:()=>E(t.id),children:[c.jsxs("div",{className:"flex items-center justify-between mb-1",children:[c.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--terminal-text-muted)"},children:"Last response"}),c.jsx("span",{className:"text-[10px]",style:{color:"var(--terminal-text-muted)"},children:"View ↗"})]}),c.jsxs("div",{className:"text-xs leading-relaxed line-clamp-2 overflow-hidden",style:{color:"var(--terminal-text-secondary)"},children:[gt.slice(0,150),gt.length>150&&"..."]})]}),c.jsx("div",{className:"p-2",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("div",{className:"flex rounded-lg overflow-hidden shrink-0",style:{border:"1px solid var(--pixel-border)"},children:[c.jsx("button",{onClick:()=>z("talk"),className:"px-2 py-1 text-[10px] font-semibold cursor-pointer transition-colors",style:{background:F==="talk"?"var(--accent)":"transparent",color:F==="talk"?"#fff":"var(--terminal-text-secondary)"},children:"Talk"}),c.jsx("button",{onClick:()=>z("do"),className:"px-2 py-1 text-[10px] font-semibold cursor-pointer transition-colors",style:{background:F==="do"?"var(--idle-amber)":"transparent",color:F==="do"?"#fff":"var(--terminal-text-secondary)"},children:"Do"})]}),c.jsx(Kg,{onSend:bt,disabled:!!wn,placeholder:F==="talk"?"Ask something...":"Give a directive...",color:Zt})]})})]})}),c.jsxs("div",{className:"px-4 py-2 space-y-1",children:[c.jsxs(td,{title:`Profile${t.persona?"":" (empty)"}`,open:ie,onToggle:()=>D(G=>!G),children:[t.persona&&c.jsx("div",{className:"text-xs leading-relaxed rounded-lg p-3",style:{background:"var(--hud-bg-alt)",border:"1px solid var(--terminal-border)",color:"var(--terminal-text-secondary)"},children:t.persona}),c.jsxs("div",{className:"space-y-0 mt-2",children:[c.jsx(nd,{label:"Level",value:t.level}),c.jsx(nd,{label:"Reports to",value:t.reportsTo}),c.jsx(nd,{label:"Status",value:t.status})]}),St.length>0&&c.jsxs("div",{className:"mt-3",children:[c.jsx("div",{className:"text-[11px] font-semibold mb-1",style:{color:"var(--terminal-text-muted)"},children:"Direct Reports"}),c.jsx("div",{className:"space-y-1",children:St.map(G=>c.jsxs("div",{className:"flex items-center gap-2 p-1.5 rounded-lg",style:{background:"var(--hud-bg-alt)"},children:[c.jsx("div",{className:"w-6 h-6 rounded flex items-center justify-center text-white text-[10px] font-bold",style:{background:Xg[G.id]??"#666"},children:G.id.slice(0,2).toUpperCase()}),c.jsx("div",{className:"text-xs",style:{color:"var(--terminal-text)"},children:G.name})]},G.id))})]})]}),t.authority&&c.jsxs(td,{title:"Authority",open:U,onToggle:()=>B(G=>!G),children:[((Dt=t.authority.autonomous)==null?void 0:Dt.length)>0&&c.jsxs("div",{className:"mb-2",children:[c.jsx("div",{className:"text-xs font-semibold mb-1",style:{color:"var(--active-green)"},children:"Autonomous"}),t.authority.autonomous.map((G,se)=>c.jsxs("div",{className:"text-xs pl-3 py-0.5",style:{color:"var(--terminal-text-secondary)"},children:["- ",G]},se))]}),((Sn=t.authority.needsApproval)==null?void 0:Sn.length)>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold mb-1",style:{color:"var(--idle-amber)"},children:"Needs Approval"}),t.authority.needsApproval.map((G,se)=>c.jsxs("div",{className:"text-xs pl-3 py-0.5",style:{color:"var(--terminal-text-secondary)"},children:["- ",G]},se))]})]}),t.journal&&c.jsx(td,{title:`Journal (${(t.journal.match(/### /g)??[]).length})`,open:ne,onToggle:()=>te(G=>!G),children:c.jsxs("div",{className:"text-xs leading-relaxed rounded-lg p-3 max-h-[300px] overflow-y-auto",style:{background:"var(--hud-bg-alt)",border:"1px solid var(--terminal-border)",color:"var(--terminal-text-secondary)"},children:[c.jsx(bs,{content:t.journal.slice(0,3e3)}),t.journal.length>3e3&&c.jsx("div",{className:"italic mt-2",style:{color:"var(--terminal-text-muted)"},children:"... (truncated)"})]})})]}),o&&c.jsx("div",{className:"px-4 pb-4 mt-auto shrink-0",children:c.jsx("button",{onClick:()=>{o(t.id,t.name),i()},className:"w-full p-2 text-center text-xs font-medium border-2 border-dashed rounded-lg cursor-pointer transition-colors",style:{borderColor:"rgba(239,68,68,0.3)",color:"rgba(239,68,68,0.5)"},children:"Fire Role"})})]})]})]})}function M5({icon:t,roleId:l,roleName:r,color:i,text:o}){const u=!!o;return c.jsx("div",{className:"relative",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsxs("div",{className:"shrink-0",children:[c.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center text-xl shadow-sm",style:{background:`${i}18`,border:`2px solid ${i}44`},children:t}),c.jsx("div",{className:"text-[9px] font-bold text-center mt-0.5 uppercase tracking-wide",style:{color:i},children:l})]}),c.jsx("div",{className:"flex-1 min-w-0",children:c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"absolute top-3 -left-2 w-0 h-0",style:{borderTop:"6px solid transparent",borderBottom:"6px solid transparent",borderRight:`8px solid ${i}12`}}),c.jsxs("div",{className:"rounded-xl rounded-tl-sm p-4 border",style:{background:`${i}08`,borderColor:`${i}22`},children:[c.jsx("div",{className:"text-[10px] font-semibold mb-1.5 uppercase tracking-wider",style:{color:i},children:r}),u?c.jsx("div",{className:"text-sm leading-relaxed",style:{color:"var(--terminal-text)"},children:c.jsx(bs,{content:o})}):c.jsx("div",{className:"text-sm italic",style:{color:"var(--terminal-text-muted)"},children:"No recent activity."})]})]})})]})})}function td({title:t,open:l,onToggle:r,children:i}){return c.jsxs("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid var(--terminal-border)"},children:[c.jsxs("button",{onClick:r,className:"w-full px-3 py-2.5 flex items-center justify-between cursor-pointer transition-colors group",style:{background:"var(--hud-bg-alt)"},children:[c.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider",style:{color:"var(--terminal-text-secondary)",fontFamily:"var(--pixel-font)"},children:t}),c.jsx("span",{className:"text-[10px] transition-transform",style:{color:"var(--terminal-text-muted)",transform:l?"rotate(0deg)":"rotate(-90deg)"},children:"▼"})]}),l&&c.jsx("div",{className:"px-3 pb-3 pt-2",style:{borderTop:"1px solid var(--terminal-border)"},children:i})]})}function Kg({onSend:t,disabled:l,placeholder:r,color:i}){const[o,u]=j.useState(""),f=()=>{const m=o.trim();!m||l||(t(m),u(""))};return c.jsxs("div",{className:"flex items-center gap-1.5 flex-1",children:[c.jsx("input",{type:"text",value:o,onChange:m=>u(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),f())},placeholder:l?"Waiting...":r,disabled:l,className:"flex-1 rounded-lg px-2.5 py-1.5 text-xs focus:outline-none disabled:opacity-40",style:{background:"var(--hud-bg)",border:"1px solid var(--pixel-border)",color:"var(--terminal-text)"}}),c.jsx("button",{onClick:f,disabled:l||!o.trim(),className:"w-7 h-7 rounded-lg flex items-center justify-center shrink-0 cursor-pointer text-white disabled:opacity-30 disabled:cursor-not-allowed transition-colors",style:{background:l||!o.trim()?"#666":i},children:c.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:"M22 2L11 13"}),c.jsx("path",{d:"M22 2L15 22L11 13L2 9L22 2Z"})]})})]})}function nd({label:t,value:l}){return c.jsxs("div",{className:"flex justify-between py-1.5 text-xs",style:{borderBottom:"1px solid var(--terminal-border)"},children:[c.jsx("span",{style:{color:"var(--terminal-text-muted)"},children:t}),c.jsx("span",{className:"font-semibold",style:{color:"var(--terminal-text)"},children:l})]})}function _5(t,l){var r,i=1;t==null&&(t=0),l==null&&(l=0);function o(){var u,f=r.length,m,x=0,h=0;for(u=0;u<f;++u)m=r[u],x+=m.x,h+=m.y;for(x=(x/f-t)*i,h=(h/f-l)*i,u=0;u<f;++u)m=r[u],m.x-=x,m.y-=h}return o.initialize=function(u){r=u},o.x=function(u){return arguments.length?(t=+u,o):t},o.y=function(u){return arguments.length?(l=+u,o):l},o.strength=function(u){return arguments.length?(i=+u,o):i},o}function R5(t){const l=+this._x.call(null,t),r=+this._y.call(null,t);return Hy(this.cover(l,r),l,r,t)}function Hy(t,l,r,i){if(isNaN(l)||isNaN(r))return t;var o,u=t._root,f={data:i},m=t._x0,x=t._y0,h=t._x1,y=t._y1,g,v,b,k,E,N,T,L;if(!u)return t._root=f,t;for(;u.length;)if((E=l>=(g=(m+h)/2))?m=g:h=g,(N=r>=(v=(x+y)/2))?x=v:y=v,o=u,!(u=u[T=N<<1|E]))return o[T]=f,t;if(b=+t._x.call(null,u.data),k=+t._y.call(null,u.data),l===b&&r===k)return f.next=u,o?o[T]=f:t._root=f,t;do o=o?o[T]=new Array(4):t._root=new Array(4),(E=l>=(g=(m+h)/2))?m=g:h=g,(N=r>=(v=(x+y)/2))?x=v:y=v;while((T=N<<1|E)===(L=(k>=v)<<1|b>=g));return o[L]=u,o[T]=f,t}function O5(t){var l,r,i=t.length,o,u,f=new Array(i),m=new Array(i),x=1/0,h=1/0,y=-1/0,g=-1/0;for(r=0;r<i;++r)isNaN(o=+this._x.call(null,l=t[r]))||isNaN(u=+this._y.call(null,l))||(f[r]=o,m[r]=u,o<x&&(x=o),o>y&&(y=o),u<h&&(h=u),u>g&&(g=u));if(x>y||h>g)return this;for(this.cover(x,h).cover(y,g),r=0;r<i;++r)Hy(this,f[r],m[r],t[r]);return this}function B5(t,l){if(isNaN(t=+t)||isNaN(l=+l))return this;var r=this._x0,i=this._y0,o=this._x1,u=this._y1;if(isNaN(r))o=(r=Math.floor(t))+1,u=(i=Math.floor(l))+1;else{for(var f=o-r||1,m=this._root,x,h;r>t||t>=o||i>l||l>=u;)switch(h=(l<i)<<1|t<r,x=new Array(4),x[h]=m,m=x,f*=2,h){case 0:o=r+f,u=i+f;break;case 1:r=o-f,u=i+f;break;case 2:o=r+f,i=u-f;break;case 3:r=o-f,i=u-f;break}this._root&&this._root.length&&(this._root=m)}return this._x0=r,this._y0=i,this._x1=o,this._y1=u,this}function L5(){var t=[];return this.visit(function(l){if(!l.length)do t.push(l.data);while(l=l.next)}),t}function F5(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function vn(t,l,r,i,o){this.node=t,this.x0=l,this.y0=r,this.x1=i,this.y1=o}function U5(t,l,r){var i,o=this._x0,u=this._y0,f,m,x,h,y=this._x1,g=this._y1,v=[],b=this._root,k,E;for(b&&v.push(new vn(b,o,u,y,g)),r==null?r=1/0:(o=t-r,u=l-r,y=t+r,g=l+r,r*=r);k=v.pop();)if(!(!(b=k.node)||(f=k.x0)>y||(m=k.y0)>g||(x=k.x1)<o||(h=k.y1)<u))if(b.length){var N=(f+x)/2,T=(m+h)/2;v.push(new vn(b[3],N,T,x,h),new vn(b[2],f,T,N,h),new vn(b[1],N,m,x,T),new vn(b[0],f,m,N,T)),(E=(l>=T)<<1|t>=N)&&(k=v[v.length-1],v[v.length-1]=v[v.length-1-E],v[v.length-1-E]=k)}else{var L=t-+this._x.call(null,b.data),$=l-+this._y.call(null,b.data),K=L*L+$*$;if(K<r){var V=Math.sqrt(r=K);o=t-V,u=l-V,y=t+V,g=l+V,i=b.data}}return i}function H5(t){if(isNaN(y=+this._x.call(null,t))||isNaN(g=+this._y.call(null,t)))return this;var l,r=this._root,i,o,u,f=this._x0,m=this._y0,x=this._x1,h=this._y1,y,g,v,b,k,E,N,T;if(!r)return this;if(r.length)for(;;){if((k=y>=(v=(f+x)/2))?f=v:x=v,(E=g>=(b=(m+h)/2))?m=b:h=b,l=r,!(r=r[N=E<<1|k]))return this;if(!r.length)break;(l[N+1&3]||l[N+2&3]||l[N+3&3])&&(i=l,T=N)}for(;r.data!==t;)if(o=r,!(r=r.next))return this;return(u=r.next)&&delete r.next,o?(u?o.next=u:delete o.next,this):l?(u?l[N]=u:delete l[N],(r=l[0]||l[1]||l[2]||l[3])&&r===(l[3]||l[2]||l[1]||l[0])&&!r.length&&(i?i[T]=r:this._root=r),this):(this._root=u,this)}function $5(t){for(var l=0,r=t.length;l<r;++l)this.remove(t[l]);return this}function q5(){return this._root}function I5(){var t=0;return this.visit(function(l){if(!l.length)do++t;while(l=l.next)}),t}function Y5(t){var l=[],r,i=this._root,o,u,f,m,x;for(i&&l.push(new vn(i,this._x0,this._y0,this._x1,this._y1));r=l.pop();)if(!t(i=r.node,u=r.x0,f=r.y0,m=r.x1,x=r.y1)&&i.length){var h=(u+m)/2,y=(f+x)/2;(o=i[3])&&l.push(new vn(o,h,y,m,x)),(o=i[2])&&l.push(new vn(o,u,y,h,x)),(o=i[1])&&l.push(new vn(o,h,f,m,y)),(o=i[0])&&l.push(new vn(o,u,f,h,y))}return this}function V5(t){var l=[],r=[],i;for(this._root&&l.push(new vn(this._root,this._x0,this._y0,this._x1,this._y1));i=l.pop();){var o=i.node;if(o.length){var u,f=i.x0,m=i.y0,x=i.x1,h=i.y1,y=(f+x)/2,g=(m+h)/2;(u=o[0])&&l.push(new vn(u,f,m,y,g)),(u=o[1])&&l.push(new vn(u,y,m,x,g)),(u=o[2])&&l.push(new vn(u,f,g,y,h)),(u=o[3])&&l.push(new vn(u,y,g,x,h))}r.push(i)}for(;i=r.pop();)t(i.node,i.x0,i.y0,i.x1,i.y1);return this}function X5(t){return t[0]}function G5(t){return arguments.length?(this._x=t,this):this._x}function Q5(t){return t[1]}function K5(t){return arguments.length?(this._y=t,this):this._y}function ah(t,l,r){var i=new rh(l??X5,r??Q5,NaN,NaN,NaN,NaN);return t==null?i:i.addAll(t)}function rh(t,l,r,i,o,u){this._x=t,this._y=l,this._x0=r,this._y0=i,this._x1=o,this._y1=u,this._root=void 0}function Zg(t){for(var l={data:t.data},r=l;t=t.next;)r=r.next={data:t.data};return l}var bn=ah.prototype=rh.prototype;bn.copy=function(){var t=new rh(this._x,this._y,this._x0,this._y0,this._x1,this._y1),l=this._root,r,i;if(!l)return t;if(!l.length)return t._root=Zg(l),t;for(r=[{source:l,target:t._root=new Array(4)}];l=r.pop();)for(var o=0;o<4;++o)(i=l.source[o])&&(i.length?r.push({source:i,target:l.target[o]=new Array(4)}):l.target[o]=Zg(i));return t};bn.add=R5;bn.addAll=O5;bn.cover=B5;bn.data=L5;bn.extent=F5;bn.find=U5;bn.remove=H5;bn.removeAll=$5;bn.root=q5;bn.size=I5;bn.visit=Y5;bn.visitAfter=V5;bn.x=G5;bn.y=K5;function ar(t){return function(){return t}}function Ca(t){return(t()-.5)*1e-6}function Z5(t){return t.x+t.vx}function J5(t){return t.y+t.vy}function W5(t){var l,r,i,o=1,u=1;typeof t!="function"&&(t=ar(t==null?1:+t));function f(){for(var h,y=l.length,g,v,b,k,E,N,T=0;T<u;++T)for(g=ah(l,Z5,J5).visitAfter(m),h=0;h<y;++h)v=l[h],E=r[v.index],N=E*E,b=v.x+v.vx,k=v.y+v.vy,g.visit(L);function L($,K,V,M,J){var Q=$.data,ie=$.r,D=E+ie;if(Q){if(Q.index>v.index){var U=b-Q.x-Q.vx,B=k-Q.y-Q.vy,ne=U*U+B*B;ne<D*D&&(U===0&&(U=Ca(i),ne+=U*U),B===0&&(B=Ca(i),ne+=B*B),ne=(D-(ne=Math.sqrt(ne)))/ne*o,v.vx+=(U*=ne)*(D=(ie*=ie)/(N+ie)),v.vy+=(B*=ne)*D,Q.vx-=U*(D=1-D),Q.vy-=B*D)}return}return K>b+D||M<b-D||V>k+D||J<k-D}}function m(h){if(h.data)return h.r=r[h.data.index];for(var y=h.r=0;y<4;++y)h[y]&&h[y].r>h.r&&(h.r=h[y].r)}function x(){if(l){var h,y=l.length,g;for(r=new Array(y),h=0;h<y;++h)g=l[h],r[g.index]=+t(g,h,l)}}return f.initialize=function(h,y){l=h,i=y,x()},f.iterations=function(h){return arguments.length?(u=+h,f):u},f.strength=function(h){return arguments.length?(o=+h,f):o},f.radius=function(h){return arguments.length?(t=typeof h=="function"?h:ar(+h),x(),f):t},f}function P5(t){return t.index}function Jg(t,l){var r=t.get(l);if(!r)throw new Error("node not found: "+l);return r}function ej(t){var l=P5,r=g,i,o=ar(30),u,f,m,x,h,y=1;t==null&&(t=[]);function g(N){return 1/Math.min(m[N.source.index],m[N.target.index])}function v(N){for(var T=0,L=t.length;T<y;++T)for(var $=0,K,V,M,J,Q,ie,D;$<L;++$)K=t[$],V=K.source,M=K.target,J=M.x+M.vx-V.x-V.vx||Ca(h),Q=M.y+M.vy-V.y-V.vy||Ca(h),ie=Math.sqrt(J*J+Q*Q),ie=(ie-u[$])/ie*N*i[$],J*=ie,Q*=ie,M.vx-=J*(D=x[$]),M.vy-=Q*D,V.vx+=J*(D=1-D),V.vy+=Q*D}function b(){if(f){var N,T=f.length,L=t.length,$=new Map(f.map((V,M)=>[l(V,M,f),V])),K;for(N=0,m=new Array(T);N<L;++N)K=t[N],K.index=N,typeof K.source!="object"&&(K.source=Jg($,K.source)),typeof K.target!="object"&&(K.target=Jg($,K.target)),m[K.source.index]=(m[K.source.index]||0)+1,m[K.target.index]=(m[K.target.index]||0)+1;for(N=0,x=new Array(L);N<L;++N)K=t[N],x[N]=m[K.source.index]/(m[K.source.index]+m[K.target.index]);i=new Array(L),k(),u=new Array(L),E()}}function k(){if(f)for(var N=0,T=t.length;N<T;++N)i[N]=+r(t[N],N,t)}function E(){if(f)for(var N=0,T=t.length;N<T;++N)u[N]=+o(t[N],N,t)}return v.initialize=function(N,T){f=N,h=T,b()},v.links=function(N){return arguments.length?(t=N,b(),v):t},v.id=function(N){return arguments.length?(l=N,v):l},v.iterations=function(N){return arguments.length?(y=+N,v):y},v.strength=function(N){return arguments.length?(r=typeof N=="function"?N:ar(+N),k(),v):r},v.distance=function(N){return arguments.length?(o=typeof N=="function"?N:ar(+N),E(),v):o},v}var tj={value:()=>{}};function $y(){for(var t=0,l=arguments.length,r={},i;t<l;++t){if(!(i=arguments[t]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new ec(r)}function ec(t){this._=t}function nj(t,l){return t.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");if(o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!l.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}ec.prototype=$y.prototype={constructor:ec,on:function(t,l){var r=this._,i=nj(t+"",r),o,u=-1,f=i.length;if(arguments.length<2){for(;++u<f;)if((o=(t=i[u]).type)&&(o=lj(r[o],t.name)))return o;return}if(l!=null&&typeof l!="function")throw new Error("invalid callback: "+l);for(;++u<f;)if(o=(t=i[u]).type)r[o]=Wg(r[o],t.name,l);else if(l==null)for(o in r)r[o]=Wg(r[o],t.name,null);return this},copy:function(){var t={},l=this._;for(var r in l)t[r]=l[r].slice();return new ec(t)},call:function(t,l){if((o=arguments.length-2)>0)for(var r=new Array(o),i=0,o,u;i<o;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(u=this._[t],i=0,o=u.length;i<o;++i)u[i].value.apply(l,r)},apply:function(t,l,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],o=0,u=i.length;o<u;++o)i[o].value.apply(l,r)}};function lj(t,l){for(var r=0,i=t.length,o;r<i;++r)if((o=t[r]).name===l)return o.value}function Wg(t,l,r){for(var i=0,o=t.length;i<o;++i)if(t[i].name===l){t[i]=tj,t=t.slice(0,i).concat(t.slice(i+1));break}return r!=null&&t.push({name:l,value:r}),t}var Jr=0,rs=0,ns=0,qy=1e3,cc,is,uc=0,ir=0,bc=0,ms=typeof performance=="object"&&performance.now?performance:Date,Iy=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Yy(){return ir||(Iy(aj),ir=ms.now()+bc)}function aj(){ir=0}function Ad(){this._call=this._time=this._next=null}Ad.prototype=Vy.prototype={constructor:Ad,restart:function(t,l,r){if(typeof t!="function")throw new TypeError("callback is not a function");r=(r==null?Yy():+r)+(l==null?0:+l),!this._next&&is!==this&&(is?is._next=this:cc=this,is=this),this._call=t,this._time=r,Td()},stop:function(){this._call&&(this._call=null,this._time=1/0,Td())}};function Vy(t,l,r){var i=new Ad;return i.restart(t,l,r),i}function rj(){Yy(),++Jr;for(var t=cc,l;t;)(l=ir-t._time)>=0&&t._call.call(void 0,l),t=t._next;--Jr}function Pg(){ir=(uc=ms.now())+bc,Jr=rs=0;try{rj()}finally{Jr=0,sj(),ir=0}}function ij(){var t=ms.now(),l=t-uc;l>qy&&(bc-=l,uc=t)}function sj(){for(var t,l=cc,r,i=1/0;l;)l._call?(i>l._time&&(i=l._time),t=l,l=l._next):(r=l._next,l._next=null,l=t?t._next=r:cc=r);is=t,Td(i)}function Td(t){if(!Jr){rs&&(rs=clearTimeout(rs));var l=t-ir;l>24?(t<1/0&&(rs=setTimeout(Pg,t-ms.now()-bc)),ns&&(ns=clearInterval(ns))):(ns||(uc=ms.now(),ns=setInterval(ij,qy)),Jr=1,Iy(Pg))}}const oj=1664525,cj=1013904223,e1=4294967296;function uj(){let t=1;return()=>(t=(oj*t+cj)%e1)/e1}function fj(t){return t.x}function dj(t){return t.y}var hj=10,mj=Math.PI*(3-Math.sqrt(5));function pj(t){var l,r=1,i=.001,o=1-Math.pow(i,1/300),u=0,f=.6,m=new Map,x=Vy(g),h=$y("tick","end"),y=uj();t==null&&(t=[]);function g(){v(),h.call("tick",l),r<i&&(x.stop(),h.call("end",l))}function v(E){var N,T=t.length,L;E===void 0&&(E=1);for(var $=0;$<E;++$)for(r+=(u-r)*o,m.forEach(function(K){K(r)}),N=0;N<T;++N)L=t[N],L.fx==null?L.x+=L.vx*=f:(L.x=L.fx,L.vx=0),L.fy==null?L.y+=L.vy*=f:(L.y=L.fy,L.vy=0);return l}function b(){for(var E=0,N=t.length,T;E<N;++E){if(T=t[E],T.index=E,T.fx!=null&&(T.x=T.fx),T.fy!=null&&(T.y=T.fy),isNaN(T.x)||isNaN(T.y)){var L=hj*Math.sqrt(.5+E),$=E*mj;T.x=L*Math.cos($),T.y=L*Math.sin($)}(isNaN(T.vx)||isNaN(T.vy))&&(T.vx=T.vy=0)}}function k(E){return E.initialize&&E.initialize(t,y),E}return b(),l={tick:v,restart:function(){return x.restart(g),l},stop:function(){return x.stop(),l},nodes:function(E){return arguments.length?(t=E,b(),m.forEach(k),l):t},alpha:function(E){return arguments.length?(r=+E,l):r},alphaMin:function(E){return arguments.length?(i=+E,l):i},alphaDecay:function(E){return arguments.length?(o=+E,l):+o},alphaTarget:function(E){return arguments.length?(u=+E,l):u},velocityDecay:function(E){return arguments.length?(f=1-E,l):1-f},randomSource:function(E){return arguments.length?(y=E,m.forEach(k),l):y},force:function(E,N){return arguments.length>1?(N==null?m.delete(E):m.set(E,k(N)),l):m.get(E)},find:function(E,N,T){var L=0,$=t.length,K,V,M,J,Q;for(T==null?T=1/0:T*=T,L=0;L<$;++L)J=t[L],K=E-J.x,V=N-J.y,M=K*K+V*V,M<T&&(Q=J,T=M);return Q},on:function(E,N){return arguments.length>1?(h.on(E,N),l):h.on(E)}}}function xj(){var t,l,r,i,o=ar(-30),u,f=1,m=1/0,x=.81;function h(b){var k,E=t.length,N=ah(t,fj,dj).visitAfter(g);for(i=b,k=0;k<E;++k)l=t[k],N.visit(v)}function y(){if(t){var b,k=t.length,E;for(u=new Array(k),b=0;b<k;++b)E=t[b],u[E.index]=+o(E,b,t)}}function g(b){var k=0,E,N,T=0,L,$,K;if(b.length){for(L=$=K=0;K<4;++K)(E=b[K])&&(N=Math.abs(E.value))&&(k+=E.value,T+=N,L+=N*E.x,$+=N*E.y);b.x=L/T,b.y=$/T}else{E=b,E.x=E.data.x,E.y=E.data.y;do k+=u[E.data.index];while(E=E.next)}b.value=k}function v(b,k,E,N){if(!b.value)return!0;var T=b.x-l.x,L=b.y-l.y,$=N-k,K=T*T+L*L;if($*$/x<K)return K<m&&(T===0&&(T=Ca(r),K+=T*T),L===0&&(L=Ca(r),K+=L*L),K<f&&(K=Math.sqrt(f*K)),l.vx+=T*b.value*i/K,l.vy+=L*b.value*i/K),!0;if(b.length||K>=m)return;(b.data!==l||b.next)&&(T===0&&(T=Ca(r),K+=T*T),L===0&&(L=Ca(r),K+=L*L),K<f&&(K=Math.sqrt(f*K)));do b.data!==l&&($=u[b.data.index]*i/K,l.vx+=T*$,l.vy+=L*$);while(b=b.next)}return h.initialize=function(b,k){t=b,r=k,y()},h.strength=function(b){return arguments.length?(o=typeof b=="function"?b:ar(+b),y(),h):o},h.distanceMin=function(b){return arguments.length?(f=b*b,h):Math.sqrt(f)},h.distanceMax=function(b){return arguments.length?(m=b*b,h):Math.sqrt(m)},h.theta=function(b){return arguments.length?(x=b*b,h):Math.sqrt(x)},h}const ps={tech:{bg:"rgba(59,130,246,0.15)",border:"#3b82f6",text:"#60a5fa"},market:{bg:"rgba(245,158,11,0.15)",border:"#f59e0b",text:"#fbbf24"},strategy:{bg:"rgba(139,92,246,0.15)",border:"#8b5cf6",text:"#a78bfa"},financial:{bg:"rgba(34,197,94,0.15)",border:"#22c55e",text:"#4ade80"},process:{bg:"rgba(236,72,153,0.15)",border:"#ec4899",text:"#f472b6"},competitor:{bg:"rgba(239,68,68,0.15)",border:"#ef4444",text:"#f87171"},domain:{bg:"rgba(14,165,233,0.15)",border:"#0ea5e9",text:"#38bdf8"},general:{bg:"rgba(148,163,184,0.12)",border:"#64748b",text:"#94a3b8"}};function gj(t){return ps[t]??ps.general}function yj({docs:t,onNodeClick:l,selectedDocId:r}){var U;const i=j.useRef(null),o=j.useRef(null),[u,f]=j.useState({width:600,height:400}),[m,x]=j.useState({nodes:[],links:[]}),[h,y]=j.useState(null),[g,v]=j.useState(null),[b,k]=j.useState({x:0,y:0}),[E,N]=j.useState({x:0,y:0,w:600,h:400}),T=j.useRef(!1),L=j.useRef({x:0,y:0,vx:0,vy:0}),$=j.useRef(null),K=j.useRef(null);j.useEffect(()=>{const B=i.current;if(!B)return;const ne=new ResizeObserver(te=>{const{width:F,height:z}=te[0].contentRect;F>0&&z>0&&(f({width:F,height:z}),N(q=>({...q,w:F,h:z})))});return ne.observe(B),()=>ne.disconnect()},[]),j.useEffect(()=>{if(t.length===0)return;const B=new Set(t.map(Z=>Z.id)),ne=t.map(Z=>({id:Z.id,title:Z.title,category:Z.category,akb_type:Z.akb_type})),te=[];for(const Z of t)for(const re of Z.links){const A=re.href.replace(/^.*knowledge\//,"").replace(/^\.\.\/.*$/,"").replace(/^\.\//,"");B.has(A)&&A!==Z.id&&(te.some(_=>_.source===Z.id&&_.target===A||_.source===A&&_.target===Z.id)||te.push({source:Z.id,target:A,label:re.text}))}const{width:F,height:z}=u,q=pj(ne).force("link",ej(te).id(Z=>Z.id).distance(140)).force("charge",xj().strength(-400)).force("center",_5(F/2,z/2)).force("collide",W5(50));K.current=q,q.on("tick",()=>{for(const Z of ne)Z.x=Math.max(60,Math.min(F-60,Z.x??F/2)),Z.y=Math.max(60,Math.min(z-60,Z.y??z/2));x({nodes:[...ne],links:[...te]})}),q.alpha(1).restart();for(let Z=0;Z<150;Z++)q.tick();return q.stop(),x({nodes:[...ne],links:[...te]}),()=>{q.stop()}},[t,u]);const V=B=>{if(typeof B=="string"){const ne=m.nodes.find(te=>te.id===B);return{x:(ne==null?void 0:ne.x)??0,y:(ne==null?void 0:ne.y)??0}}return{x:B.x??0,y:B.y??0}},M=j.useCallback(B=>{B.preventDefault();const ne=B.deltaY>0?1.1:.9;N(te=>{const F=Math.max(200,Math.min(u.width*3,te.w*ne)),z=Math.max(150,Math.min(u.height*3,te.h*ne)),q=(F-te.w)/2,Z=(z-te.h)/2;return{x:te.x-q,y:te.y-Z,w:F,h:z}})},[u]),J=j.useCallback(B=>{B.button===0&&(T.current=!0,L.current={x:B.clientX,y:B.clientY,vx:E.x,vy:E.y})},[E]),Q=j.useCallback(B=>{var ne;if($.current){const te=o.current;if(!te)return;const F=te.getBoundingClientRect(),z=E.w/F.width,q=E.h/F.height,Z=E.x+(B.clientX-F.left)*z,re=E.y+(B.clientY-F.top)*q;$.current.fx=Z,$.current.fy=re,(ne=K.current)==null||ne.alpha(.3).restart();return}if(T.current){const te=(B.clientX-L.current.x)*(E.w/u.width),F=(B.clientY-L.current.y)*(E.h/u.height);N(z=>({...z,x:L.current.vx-te,y:L.current.vy-F}))}},[E,u]),ie=j.useCallback(()=>{T.current=!1,$.current&&($.current.fx=null,$.current.fy=null,$.current=null)},[]),D=j.useCallback((B,ne)=>{var te;B.stopPropagation(),$.current=ne,(te=K.current)==null||te.alpha(.3).restart()},[]);return c.jsxs("div",{ref:i,className:"relative flex-1 overflow-hidden",style:{background:"#1e1e2e"},children:[c.jsxs("svg",{ref:o,width:u.width,height:u.height,viewBox:`${E.x} ${E.y} ${E.w} ${E.h}`,style:{display:"block",cursor:T.current?"grabbing":"grab"},onWheel:M,onMouseDown:J,onMouseMove:Q,onMouseUp:ie,onMouseLeave:ie,children:[c.jsx("defs",{children:c.jsx("pattern",{id:"grid",width:"20",height:"20",patternUnits:"userSpaceOnUse",children:c.jsx("circle",{cx:"0",cy:"0",r:"0.5",fill:"rgba(255,255,255,0.06)"})})}),c.jsx("rect",{x:E.x-100,y:E.y-100,width:E.w+200,height:E.h+200,fill:"url(#grid)",pointerEvents:"none"}),m.links.map((B,ne)=>{const te=V(B.source),F=V(B.target),z=g===ne,q=(te.x+F.x)/2,Z=(te.y+F.y)/2;return c.jsxs("g",{children:[c.jsx("line",{x1:te.x,y1:te.y,x2:F.x,y2:F.y,stroke:"transparent",strokeWidth:12,style:{cursor:"default"},onMouseEnter:()=>v(ne),onMouseLeave:()=>v(null)}),c.jsx("line",{x1:te.x,y1:te.y,x2:F.x,y2:F.y,stroke:z?"rgba(148,163,184,0.7)":"rgba(148,163,184,0.3)",strokeWidth:z?2:1.5,strokeDasharray:"4 3",pointerEvents:"none"}),z&&B.label&&c.jsx("text",{x:q,y:Z-6,textAnchor:"middle",fill:"#e2e8f0",fontSize:9,fontFamily:"monospace",style:{pointerEvents:"none"},children:c.jsx("tspan",{style:{filter:"drop-shadow(0 0 2px rgba(0,0,0,0.8))"},children:B.label.length>30?B.label.slice(0,28)+"..":B.label})})]},ne)}),m.nodes.map(B=>{const ne=ps[B.category]??ps.general,te=B.akb_type==="hub",F=te?24:16,z=(h==null?void 0:h.id)===B.id,q=r===B.id,Z=z?1.2:q?1.15:1;return c.jsxs("g",{transform:`translate(${B.x??0}, ${B.y??0}) scale(${Z})`,style:{cursor:"pointer",transition:"transform 0.15s ease"},onClick:re=>{re.stopPropagation();const A=t.find(_=>_.id===B.id);A&&l(A)},onMouseDown:re=>D(re,B),onMouseEnter:re=>{var _;y(B);const A=(_=i.current)==null?void 0:_.getBoundingClientRect();A&&k({x:re.clientX-A.left,y:re.clientY-A.top})},onMouseLeave:()=>y(null),children:[q&&c.jsx("rect",{x:-F/2-4,y:-F/2-4,width:F+8,height:F+8,fill:"none",stroke:"#22c55e",strokeWidth:2,rx:te?5:2,opacity:.6}),c.jsx("rect",{x:-F/2,y:-F/2,width:F,height:F,fill:ne.border,rx:te?4:2,opacity:z?1:.9}),c.jsx("rect",{x:-F/2+3,y:-F/2+3,width:Math.max(0,F-6),height:Math.max(0,F-6),fill:ne.bg,rx:te?3:1}),c.jsx("text",{y:F/2+14,textAnchor:"middle",fill:q?"#e2e8f0":"#94a3b8",fontSize:11,fontFamily:"monospace",fontWeight:q?"bold":"normal",style:{pointerEvents:"none"},children:B.title.length>24?B.title.slice(0,22)+"..":B.title})]},B.id)})]}),h&&!$.current&&c.jsxs("div",{className:"absolute z-10 pointer-events-none p-2.5 rounded text-xs max-w-[240px]",style:{left:Math.min(b.x+16,u.width-250),top:Math.max(b.y-30,8),background:"var(--hud-bg)",border:"1px solid var(--terminal-border)",color:"var(--terminal-text)",boxShadow:"0 4px 12px rgba(0,0,0,0.4)"},children:[c.jsx("div",{className:"font-bold mb-1",children:h.title}),c.jsxs("div",{className:"text-[10px] opacity-60 mb-1",children:[h.akb_type.toUpperCase()," / ",h.category]}),((U=t.find(B=>B.id===h.id))==null?void 0:U.tldr)&&c.jsx("div",{className:"text-[10px] opacity-80 mb-1",children:t.find(B=>B.id===h.id).tldr}),c.jsx("div",{className:"text-[10px] text-green-400",children:"Click to open | Drag to move"})]}),t.length===0&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-xs",style:{color:"var(--terminal-text-muted)"},children:"No knowledge documents found"})]})}function vj({doc:t,allDocs:l,onOpen:r,onNavigateDoc:i}){const[o,u]=j.useState(!1),f=gj(t.category),m=t.akb_type==="hub",x=new Set(l.map(h=>h.id));return c.jsxs("div",{className:"mb-2 rounded-lg overflow-hidden",style:{background:m?"rgba(22,163,106,0.08)":"var(--hud-bg-alt)",border:`2px solid ${m?"rgba(22,163,106,0.4)":"var(--terminal-border)"}`},children:[c.jsxs("div",{className:"p-3 cursor-pointer hover:bg-white/5",onClick:()=>u(!o),children:[c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx("span",{className:"shrink-0 text-sm",children:m?"🗂":t.format==="html"?"🌐":"📄"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[c.jsx("span",{className:"font-semibold text-xs truncate",style:{color:"var(--terminal-text)"},children:t.title}),c.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:t.status==="active"?"#16a34a":t.status==="draft"?"#f59e0b":"#94a3b8"},title:t.status})]}),c.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:t.tags.slice(0,4).map(h=>c.jsx("span",{className:"px-1.5 py-0.5 rounded text-[9px] font-medium",style:{background:f.bg,color:f.text,border:`1px solid ${f.border}`},children:h},h))})]}),c.jsx("span",{className:"text-xs shrink-0",style:{color:"var(--terminal-text-muted)"},children:o?"▲":"▼"})]}),!o&&t.tldr&&c.jsx("div",{className:"mt-1.5 text-[10px] line-clamp-2 ml-6",style:{color:"var(--terminal-text-secondary)"},children:t.tldr})]}),o&&c.jsxs("div",{className:"px-3 pb-3",style:{borderTop:"1px solid var(--terminal-border)"},children:[t.tldr&&c.jsx("div",{className:"mt-2 text-[11px] leading-relaxed italic",style:{color:"var(--terminal-text-secondary)"},children:t.tldr}),t.links.length>0&&c.jsxs("div",{className:"mt-2",children:[c.jsx("div",{className:"text-[9px] font-bold uppercase mb-1",style:{color:"var(--terminal-text-muted)"},children:"Cross-links"}),c.jsx("div",{className:"flex flex-wrap gap-1",children:t.links.slice(0,5).map((h,y)=>{const g=h.href.replace(/^.*knowledge\//,"").replace(/^\.\.\/.*$/,"").replace(/^\.\//,""),v=x.has(g);return c.jsxs("span",{className:`px-1.5 py-0.5 text-[9px] rounded ${v?"cursor-pointer hover:opacity-70":""}`,style:{background:v?"rgba(22,163,106,0.15)":"rgba(148,163,184,0.1)",color:v?"#4ade80":"var(--terminal-text-muted)",border:`1px solid ${v?"rgba(22,163,106,0.3)":"var(--terminal-border)"}`},onClick:b=>{v&&(b.stopPropagation(),i(g))},children:["🔗"," ",h.text]},y)})})]}),c.jsxs("button",{className:"mt-2 text-[10px] font-semibold cursor-pointer hover:opacity-70",style:{color:"var(--active-green)"},onClick:h=>{h.stopPropagation(),r(t)},children:["Open full ","→"]})]})]})}function bj({docId:t,onBack:l,onDocUpdated:r,onDelete:i,onNavigateDoc:o,allDocs:u}){const[f,m]=j.useState(null),[x,h]=j.useState(!0),[y,g]=j.useState(!1),[v,b]=j.useState(""),[k,E]=j.useState(!1),N=new Set(u.map(V=>V.id)),T=j.useCallback(V=>{const M=V.split("#")[0];if(!M.match(/\.(md|html)$/))return null;const J=t.includes("/")?t.replace(/\/[^/]+$/,""):"";let Q;if(M.startsWith("./"))Q=J?`${J}/${M.slice(2)}`:M.slice(2);else if(M.startsWith("../")){const U=J.split("/").filter(Boolean);let B=M;for(;B.startsWith("../");)U.length>0&&U.pop(),B=B.slice(3);Q=U.length>0?`${U.join("/")}/${B}`:B}else Q=M;if(N.has(Q))return Q;const ie=Q.split("/").pop()??"",D=u.find(U=>U.id===ie||U.id.endsWith("/"+ie));return D?D.id:null},[t,N,u]),L=j.useCallback(V=>{const J=V.target.closest("a");if(!J)return;const Q=J.getAttribute("href");if(!Q||Q.startsWith("http://")||Q.startsWith("https://")||!Q.match(/\.(md|html)(#.*)?$/))return;V.preventDefault(),V.stopPropagation();const ie=T(Q);ie&&o(ie)},[T,o]);j.useEffect(()=>{h(!0),Ce.getKnowledgeDoc(t).then(V=>{m(V),b(V.content)}).catch(console.error).finally(()=>h(!1))},[t]);const $=async()=>{if(f){E(!0);try{await Ce.updateKnowledgeDoc(t,v),m({...f,content:v}),g(!1),r()}catch(V){console.error("Save failed:",V)}finally{E(!1)}}},K=async()=>{if(confirm(`Delete "${f==null?void 0:f.title}"?`))try{await Ce.deleteKnowledgeDoc(t),i(t)}catch(V){console.error("Delete failed:",V)}};return x?c.jsx("div",{className:"flex-1 flex items-center justify-center text-xs",style:{color:"var(--terminal-text-muted)"},children:"Loading..."}):f?c.jsxs("div",{className:"flex-1 overflow-y-auto flex flex-col",children:[c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 shrink-0",style:{borderBottom:"1px solid var(--terminal-border)"},children:[c.jsxs("button",{onClick:l,className:"text-xs font-semibold cursor-pointer hover:opacity-70",style:{color:"var(--active-green)"},children:["←"," Back"]}),c.jsx("div",{className:"flex-1"}),y?c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>{g(!1),b(f.content)},className:"px-2.5 py-1 text-[10px] rounded cursor-pointer",style:{background:"var(--hud-bg-alt)",color:"var(--terminal-text-secondary)",border:"1px solid var(--terminal-border)"},children:"Cancel"}),c.jsx("button",{onClick:$,disabled:k,className:"px-2.5 py-1 text-[10px] rounded cursor-pointer font-semibold text-white",style:{background:k?"#86efac":"#16a34a"},children:k?"Saving...":"Save"})]}):c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>g(!0),className:"px-2.5 py-1 text-[10px] rounded cursor-pointer font-semibold",style:{background:"rgba(59,130,246,0.15)",color:"#60a5fa",border:"1px solid rgba(59,130,246,0.3)"},children:"Edit"}),c.jsx("button",{onClick:K,className:"px-2.5 py-1 text-[10px] rounded cursor-pointer font-semibold",style:{background:"rgba(239,68,68,0.15)",color:"#f87171",border:"1px solid rgba(239,68,68,0.3)"},children:"Delete"})]})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-5",children:[c.jsx("h2",{className:"text-sm font-bold mb-1",style:{color:"var(--terminal-text)"},children:f.title}),f.tldr&&!y&&c.jsx("div",{className:"mb-3 text-xs italic",style:{color:"var(--terminal-text-secondary)"},children:f.tldr}),f.format==="html"?y?c.jsx("textarea",{className:"w-full h-full min-h-[400px] p-3 text-xs leading-relaxed rounded border resize-y",style:{fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace',background:"var(--hud-bg)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)"},value:v,onChange:V=>b(V.target.value),spellCheck:!1}):c.jsx("iframe",{srcDoc:f.content,sandbox:"allow-same-origin",className:"w-full flex-1 min-h-[400px] rounded",style:{border:"1px solid var(--terminal-border)",background:"var(--hud-bg-alt)"},title:f.title}):y?c.jsx("textarea",{className:"w-full h-full min-h-[400px] p-3 text-xs leading-relaxed rounded border resize-y",style:{fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace',background:"#1e1e2e",color:"#e2e8f0",border:"1px solid #334155"},value:v,onChange:V=>b(V.target.value),spellCheck:!1}):c.jsx("div",{className:"text-xs leading-relaxed",style:{color:"var(--terminal-text-secondary)"},onClick:L,children:c.jsx(bs,{content:f.content})})]})]}):c.jsx("div",{className:"flex-1 flex items-center justify-center text-xs",style:{color:"var(--terminal-text-muted)"},children:"Failed to load document"})}function wj({onCreated:t,onCancel:l}){const[r,i]=j.useState(""),[o,u]=j.useState(""),[f,m]=j.useState(""),[x,h]=j.useState(!1),[y,g]=j.useState("");j.useEffect(()=>{if(!r){u("");return}const b=r.toLowerCase().replace(/[^a-z0-9가-힣\s-]/g,"").replace(/\s+/g,"-").slice(0,60);u(b)},[r]);const v=async()=>{if(!r.trim()||!o.trim()){g("Title and filename are required");return}h(!0),g("");try{const b=await Ce.createKnowledgeDoc({filename:o,title:r,category:f||void 0});t(b.id)}catch(b){g(b instanceof Error?b.message:"Failed to create")}finally{h(!1)}};return c.jsxs("div",{className:"flex-1 overflow-y-auto p-5",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[c.jsxs("button",{onClick:l,className:"text-xs font-semibold cursor-pointer hover:opacity-70",style:{color:"var(--active-green)"},children:["←"," Cancel"]}),c.jsx("h2",{className:"text-sm font-bold",style:{color:"var(--terminal-text)"},children:"New Document"})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-[10px] font-semibold mb-1",style:{color:"var(--terminal-text-muted)"},children:"TITLE"}),c.jsx("input",{type:"text",value:r,onChange:b=>i(b.target.value),placeholder:"Document title...",className:"w-full px-3 py-2 text-xs rounded focus:outline-none",style:{background:"var(--hud-bg)",border:"1px solid var(--terminal-border)",color:"var(--terminal-text)"}})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-[10px] font-semibold mb-1",style:{color:"var(--terminal-text-muted)"},children:"FILENAME"}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("input",{type:"text",value:o,onChange:b=>u(b.target.value),className:"flex-1 px-3 py-2 text-xs rounded focus:outline-none font-mono",style:{background:"var(--hud-bg)",border:"1px solid var(--terminal-border)",color:"var(--terminal-text)"}}),c.jsx("span",{className:"text-[10px]",style:{color:"var(--terminal-text-muted)"},children:".md"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-[10px] font-semibold mb-1",style:{color:"var(--terminal-text-muted)"},children:"CATEGORY (optional)"}),c.jsx("input",{type:"text",value:f,onChange:b=>m(b.target.value),placeholder:"e.g., tech, market, strategy",className:"w-full px-3 py-2 text-xs rounded focus:outline-none",style:{background:"var(--hud-bg)",border:"1px solid var(--terminal-border)",color:"var(--terminal-text)"}})]}),y&&c.jsx("div",{className:"text-[10px] px-3 py-1.5 rounded",style:{background:"rgba(239,68,68,0.15)",color:"#f87171"},children:y}),c.jsx("button",{onClick:v,disabled:x||!r.trim(),className:"w-full py-2 text-xs font-semibold rounded cursor-pointer text-white",style:{background:x?"#86efac":"#16a34a"},children:x?"Creating...":"Create Document"})]})]})}const kj=500,t1=360,n1=700;function ih(t){const[l,r]=j.useState(kj),[i,o]=j.useState(!1),u=j.useRef(0),f=j.useRef(0),m=t>0,x=m?t:0,h=m?Math.max(t1,window.innerWidth-t-100):n1,y=Math.min(l,h),g=j.useCallback(v=>{v.preventDefault(),u.current=v.clientX,f.current=y,o(!0);const b=E=>{const N=u.current-E.clientX,T=Math.min(n1,Math.max(t1,f.current+N));r(T)},k=()=>{o(!1),document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",k)};document.addEventListener("mousemove",b),document.addEventListener("mouseup",k)},[y]);return{panelRight:x,panelWidth:y,isResizing:i,handleResizeStart:g}}function Sj({docs:t,onClose:l,onRefresh:r,terminalWidth:i=0,initialDocId:o}){const[u,f]=j.useState("list"),[m,x]=j.useState("all"),[h,y]=j.useState(o??null),[g,v]=j.useState(""),[b,k]=j.useState(!1),[E,N]=j.useState(null),{panelRight:T,panelWidth:L,isResizing:$,handleResizeStart:K}=ih(i),V=["all",...Array.from(new Set(t.map(U=>U.category))).sort()],M=t.filter(U=>{if(m!=="all"&&U.category!==m)return!1;if(g){const B=g.toLowerCase();return U.title.toLowerCase().includes(B)||(U.tldr??"").toLowerCase().includes(B)||U.tags.some(ne=>ne.toLowerCase().includes(B))}return!0}),J=U=>{k(!1),r(),y(U)},Q=U=>{y(null),r()},ie=U=>{N(U.id)},D=E?t.find(U=>U.id===E):null;return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"dimmer fixed top-0 left-0 bottom-0 bg-black/30 z-40 open",style:{right:T},onClick:l}),c.jsxs("div",{className:`side-panel open fixed top-0 h-full z-50 flex flex-col border-l-[3px] shadow-[-4px_0_20px_rgba(0,0,0,0.4)] ${$?"resizing":""}`,style:{right:T,width:L,background:"var(--terminal-bg)",borderLeftColor:"#16a34a"},children:[c.jsx("div",{className:`absolute top-0 -left-[5px] w-[10px] h-full cursor-col-resize z-[60] transition-colors ${$?"bg-white/10":"hover:bg-white/5"}`,onMouseDown:K}),c.jsxs("div",{className:"p-5 text-white relative",style:{background:"#16a34a"},children:[c.jsx("button",{onClick:l,className:"absolute top-3 right-3 w-7 h-7 rounded-full bg-white/20 text-white flex items-center justify-center text-lg hover:bg-white/30 cursor-pointer",children:"×"}),c.jsxs("div",{className:"text-lg font-bold",children:["📚"," Knowledge Base"]}),c.jsxs("div",{className:"text-xs opacity-80 mt-0.5",children:[t.length," documents"]})]}),c.jsxs("div",{className:"flex",style:{borderBottom:"1px solid var(--terminal-border)"},children:[c.jsx(l1,{label:"List",active:u==="list",onClick:()=>{f("list"),N(null)}}),c.jsx(l1,{label:"Graph",active:u==="graph",onClick:()=>f("graph")})]}),u==="list"&&!h&&!b&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 shrink-0",style:{borderBottom:"1px solid var(--terminal-border)"},children:[c.jsx("input",{type:"text",value:g,onChange:U=>v(U.target.value),placeholder:"Search docs...",className:"flex-1 px-2.5 py-1.5 text-[11px] rounded focus:outline-none",style:{background:"var(--hud-bg)",border:"1px solid var(--terminal-border)",color:"var(--terminal-text)"}}),c.jsx("button",{onClick:()=>k(!0),className:"px-2.5 py-1.5 text-[10px] font-semibold rounded cursor-pointer text-white shrink-0",style:{background:"#16a34a"},children:"+ New"})]}),c.jsx("div",{className:"flex overflow-x-auto shrink-0",style:{borderBottom:"1px solid var(--terminal-border)",scrollbarWidth:"none"},children:V.map(U=>c.jsx("button",{onClick:()=>x(U),className:"px-3 py-1.5 text-[10px] font-medium cursor-pointer whitespace-nowrap",style:{color:m===U?"#4ade80":"var(--terminal-text-muted)",borderBottom:m===U?"2px solid #4ade80":"2px solid transparent"},children:U==="all"?`All (${t.length})`:`${U} (${t.filter(B=>B.category===U).length})`},U))}),c.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:M.length===0?c.jsx("div",{className:"text-center text-xs py-8",style:{color:"var(--terminal-text-muted)"},children:g?"No matching documents":"No documents in this category"}):M.map(U=>c.jsx(vj,{doc:U,allDocs:t,onOpen:B=>y(B.id),onNavigateDoc:B=>y(B)},U.id))})]}),u==="list"&&h&&!b&&c.jsx(bj,{docId:h,onBack:()=>y(null),onDocUpdated:r,onDelete:Q,onNavigateDoc:U=>y(U),allDocs:t}),u==="list"&&b&&c.jsx(wj,{onCreated:J,onCancel:()=>k(!1)}),u==="graph"&&c.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[c.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[c.jsx(yj,{docs:t,onNodeClick:ie,selectedDocId:E}),D&&c.jsxs("div",{className:"shrink-0 overflow-y-auto p-3",style:{width:200,background:"var(--hud-bg-alt)",borderLeft:"1px solid var(--terminal-border)"},children:[c.jsx("div",{className:"text-[10px] font-bold uppercase mb-1",style:{color:"var(--terminal-text-muted)"},children:"Selected"}),c.jsx("div",{className:"text-xs font-bold mb-1",style:{color:"var(--terminal-text)"},children:D.title}),c.jsx("div",{className:"w-2 h-2 rounded-full mb-2",style:{background:D.status==="active"?"#16a34a":D.status==="draft"?"#f59e0b":"#94a3b8"}}),D.tldr&&c.jsx("div",{className:"text-[10px] mb-2 leading-relaxed",style:{color:"var(--terminal-text-secondary)"},children:D.tldr}),D.links.length>0&&c.jsxs("div",{className:"mb-2",children:[c.jsx("div",{className:"text-[9px] font-bold mb-1",style:{color:"var(--terminal-text-muted)"},children:"Links"}),D.links.slice(0,5).map((U,B)=>c.jsxs("div",{className:"text-[9px] mb-0.5 truncate",style:{color:"var(--terminal-text-secondary)"},children:["🔗"," ",U.text]},B))]}),c.jsx("button",{className:"w-full py-1.5 text-[10px] font-semibold rounded cursor-pointer text-white",style:{background:"#16a34a"},onClick:()=>{f("list"),y(D.id),N(null)},children:"Open Document"})]})]}),c.jsx("div",{className:"shrink-0 p-2",style:{borderTop:"1px solid var(--terminal-border)"},children:c.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(ps).map(([U,B])=>c.jsxs("div",{className:"flex items-center gap-1 text-[9px]",children:[c.jsx("div",{className:"w-2 h-2",style:{background:B.border}}),c.jsx("span",{style:{color:"var(--terminal-text-muted)"},children:U})]},U))})})]})]})]})}function l1({label:t,active:l,onClick:r}){return c.jsx("button",{onClick:r,className:"px-4 py-2.5 text-sm font-medium cursor-pointer",style:{color:l?"#4ade80":"var(--terminal-text-muted)",borderBottom:l?"2px solid #4ade80":"2px solid transparent"},children:t})}function jj({standups:t,waves:l,decisions:r,mode:i,onClose:o,terminalWidth:u=0}){const[f,m]=j.useState(i==="decisions"?"decisions":"standups"),{panelRight:x,panelWidth:h,isResizing:y,handleResizeStart:g}=ih(u);return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"dimmer fixed top-0 left-0 bottom-0 bg-black/30 z-40 open",style:{right:x},onClick:o}),c.jsxs("div",{className:`side-panel open fixed top-0 h-full z-50 flex flex-col border-l-[3px] shadow-[-4px_0_20px_rgba(0,0,0,0.4)] ${y?"resizing":""}`,style:{right:x,width:h,background:"var(--terminal-bg)",borderLeftColor:"var(--desk-wood)"},children:[c.jsx("div",{className:`absolute top-0 -left-[5px] w-[10px] h-full cursor-col-resize z-[60] transition-colors ${y?"bg-white/10":"hover:bg-white/5"}`,onMouseDown:g}),c.jsxs("div",{className:"p-5 bg-[var(--desk-wood)] text-white relative",children:[c.jsx("button",{onClick:o,className:"absolute top-3 right-3 w-7 h-7 rounded-full bg-white/20 text-white flex items-center justify-center text-lg hover:bg-white/30 cursor-pointer",children:"×"}),c.jsx("div",{className:"text-lg font-bold",children:i==="bulletin"?"📌 Bulletin Board":"📜 Decision Log"})]}),c.jsx("div",{className:"flex",style:{borderBottom:"1px solid var(--terminal-border)"},children:i==="bulletin"?c.jsxs(c.Fragment,{children:[c.jsx(ld,{label:`Standups (${t.length})`,active:f==="standups",onClick:()=>m("standups")}),c.jsx(ld,{label:`Waves (${l.length})`,active:f==="waves",onClick:()=>m("waves")})]}):c.jsx(ld,{label:`Decisions (${r.length})`,active:f==="decisions",onClick:()=>m("decisions")})}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-5",children:[f==="standups"&&t.map((v,b)=>c.jsx(ad,{title:`Standup ${v.date}`,content:v.content},b)),f==="waves"&&l.map((v,b)=>c.jsx(ad,{title:`Wave ${v.id}`,subtitle:v.timestamp,content:v.content},b)),f==="decisions"&&r.map((v,b)=>c.jsx(ad,{title:`#${v.id} ${v.title}`,subtitle:v.date,content:v.content},b))]})]})]})}function ld({label:t,active:l,onClick:r}){return c.jsx("button",{onClick:r,className:"px-4 py-2.5 text-sm font-medium cursor-pointer",style:{color:l?"var(--accent)":"var(--terminal-text-muted)",borderBottom:l?"2px solid var(--accent)":"2px solid transparent"},children:t})}function Ej(t){return t.replace(/^#{1,6}\s+/gm,"").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/```[\s\S]*?```/g,"").replace(/^\s*[-*+]\s+/gm,"• ").replace(/^\s*\d+\.\s+/gm,"").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/^>\s+/gm,"").replace(/^---+$/gm,"").replace(/\|[^|]*\|/g,"").replace(/\n{2,}/g," · ").replace(/\n/g," ").trim()}function ad({title:t,subtitle:l,content:r}){const[i,o]=j.useState(!1),u=r.length>100,f=Ej(r).slice(0,160);return c.jsxs("div",{className:"mb-3 rounded-lg overflow-hidden",style:{background:"var(--hud-bg-alt)",border:"1px solid var(--terminal-border)"},children:[c.jsxs("div",{className:"p-3 cursor-pointer hover:bg-white/5",onClick:()=>o(!i),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"font-medium text-sm",style:{color:"var(--terminal-text)"},children:t}),c.jsx("span",{className:"text-xs shrink-0 ml-2",style:{color:"var(--terminal-text-muted)"},children:i?"▲":"▼"})]}),l&&c.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--terminal-text-muted)"},children:l})]}),i&&c.jsx("div",{className:"px-3 pb-3 text-xs leading-relaxed pt-2",style:{borderTop:"1px solid var(--terminal-border)",color:"var(--terminal-text-secondary)"},children:c.jsx(bs,{content:r})}),!i&&u&&c.jsx("div",{className:"px-3 pb-2 text-xs line-clamp-2 leading-relaxed",style:{color:"var(--terminal-text-muted)"},children:f})]})}function Cj({projectId:t,onClose:l,terminalWidth:r=0}){const[i,o]=j.useState(null),{panelRight:u,panelWidth:f,isResizing:m,handleResizeStart:x}=ih(r);if(j.useEffect(()=>{Ce.getProject(t).then(o).catch(console.error)},[t]),!i)return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"dimmer fixed top-0 left-0 bottom-0 bg-black/30 z-40 open",style:{right:u},onClick:l}),c.jsx("div",{className:"side-panel open fixed top-0 h-full z-50 flex items-center justify-center border-l-[3px] border-[var(--meeting-blue)]",style:{right:u,width:f,background:"var(--terminal-bg)"},children:c.jsx("div",{className:"text-sm",style:{color:"var(--terminal-text-muted)"},children:"Loading project..."})})]});const h=i.tasks.filter(v=>v.status==="done").length,y=i.tasks.length,g=y>0?Math.round(h/y*100):0;return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"dimmer fixed top-0 left-0 bottom-0 bg-black/30 z-40 open",style:{right:u},onClick:l}),c.jsxs("div",{className:`side-panel open fixed top-0 h-full z-50 flex flex-col border-l-[3px] border-[var(--meeting-blue)] shadow-[-4px_0_20px_rgba(0,0,0,0.4)] ${m?"resizing":""}`,style:{right:u,width:f,background:"var(--terminal-bg)"},children:[c.jsx("div",{className:`absolute top-0 -left-[5px] w-[10px] h-full cursor-col-resize z-[60] transition-colors ${m?"bg-white/10":"hover:bg-white/5"}`,onMouseDown:x}),c.jsxs("div",{className:"p-5 bg-[var(--meeting-blue)] text-white relative",children:[c.jsx("div",{className:"text-sm opacity-70",children:"Meeting Room"}),c.jsx("button",{onClick:l,className:"absolute top-3 right-3 z-10 w-7 h-7 rounded-full bg-white/20 text-white flex items-center justify-center text-lg hover:bg-white/30 cursor-pointer",children:"×"}),c.jsx("div",{className:"text-xl font-bold mt-1",children:i.name}),c.jsxs("div",{className:"flex items-center gap-3 mt-3 text-sm",children:[c.jsxs("span",{children:["Tasks: ",y]}),c.jsxs("span",{children:["Done: ",h]}),c.jsxs("span",{children:["Progress: ",g,"%"]})]}),c.jsx("div",{className:"mt-2 h-1.5 bg-white/20 rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full bg-white rounded-full transition-all",style:{width:`${g}%`}})})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-5",children:[i.prd&&c.jsxs("div",{className:"mb-5",children:[c.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wider mb-2",style:{color:"var(--terminal-text-muted)"},children:"PRD"}),c.jsx("div",{className:"rounded-lg p-4 text-xs leading-relaxed max-h-60 overflow-y-auto",style:{background:"var(--hud-bg-alt)",border:"1px solid var(--terminal-border)",color:"var(--terminal-text-secondary)"},children:c.jsx(bs,{content:i.prd})})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"text-[11px] font-bold uppercase tracking-wider mb-2",style:{color:"var(--terminal-text-muted)"},children:["Tasks (",y,")"]}),c.jsx("div",{className:"space-y-2",children:i.tasks.map(v=>c.jsxs("div",{className:"rounded-lg p-3",style:{background:"var(--hud-bg-alt)",border:"1px solid var(--terminal-border)"},children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm font-medium",style:{color:"var(--terminal-text)"},children:v.title}),c.jsx(Nj,{status:v.status})]}),c.jsx("div",{className:"text-xs mt-1",style:{color:"var(--terminal-text-muted)"},children:v.role}),v.description&&c.jsx("div",{className:"text-xs mt-1.5 line-clamp-2",style:{color:"var(--terminal-text-secondary)"},children:v.description})]},v.id))})]})]})]})]})}function Nj({status:t}){const l={done:{bg:"rgba(34,197,94,0.15)",color:"#4ade80"},"in-progress":{bg:"rgba(59,130,246,0.15)",color:"#60a5fa"},todo:{bg:"rgba(148,163,184,0.15)",color:"var(--terminal-text-muted)"}},r=l[t]??l.todo;return c.jsx("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded-full",style:{background:r.bg,color:r.color},children:t})}const Aj={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C"};function Tj({roleId:t,roleName:l,mode:r="assign",onClose:i,onExecutionStart:o}){const[u,f]=j.useState(""),m=j.useRef(null);j.useEffect(()=>{var g;(g=m.current)==null||g.focus()},[]);const x=()=>{u.trim()&&(o(t,u.trim()),i())},h=g=>{g.key==="Enter"&&(g.metaKey||g.ctrlKey)&&x(),g.key==="Escape"&&i()},y=Aj[t]??"#666";return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 bg-black/40 z-[60] backdrop-blur-sm",onClick:i}),c.jsxs("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[520px] z-[61] bg-[var(--wall)] rounded-2xl shadow-2xl overflow-hidden",children:[c.jsxs("div",{className:"p-5 text-white",style:{background:`linear-gradient(135deg, ${y}, ${y}cc)`},children:[c.jsx("div",{className:"text-lg font-bold",children:r==="ask"?"Ask":"Assign Task"}),c.jsx("div",{className:"text-sm opacity-80 mt-0.5",children:r==="ask"?`to ${l}`:`to ${l} (${t})`})]}),c.jsxs("div",{className:"p-5",children:[c.jsx("label",{className:"block text-[11px] font-bold text-[var(--desk-dark)] uppercase tracking-wider mb-2",children:"Task Description"}),c.jsx("textarea",{ref:m,value:u,onChange:g=>f(g.target.value),onKeyDown:h,placeholder:r==="ask"?"What would you like to ask?":"Describe the task...",className:"w-full h-32 p-3 rounded-lg border border-white/10 bg-white/5 text-sm text-white/90 placeholder-white/25 resize-none focus:outline-none focus:border-white/25 transition-colors"}),c.jsx("div",{className:"text-[10px] text-white/30 mt-1",children:"Cmd+Enter to submit"})]}),c.jsxs("div",{className:"flex justify-end gap-3 px-5 pb-5",children:[c.jsx("button",{onClick:i,className:"px-4 py-2 text-sm rounded-lg border border-white/15 text-white/60 hover:bg-white/5 cursor-pointer",children:"Cancel"}),c.jsx("button",{onClick:x,disabled:!u.trim(),className:"px-5 py-2 text-sm text-white rounded-lg font-semibold cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:y},children:r==="ask"?"Ask":"Assign"})]})]})]})}const a1={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C"};function Xy({event:t,isThinkingCollapsed:l,onToggleThinking:r,onNavigateToJob:i,onOpenKnowledgeDoc:o,compact:u}){var m;const f=a1[t.roleId]??"#888";switch(t.type){case"text":return c.jsx("div",{className:"text-green-300/90 whitespace-pre-wrap leading-relaxed",children:u?(t.data.text??"").slice(0,300):t.data.text});case"thinking":{const x=t.data.text??"";return c.jsxs("div",{className:"group",children:[c.jsxs("button",{onClick:r,className:"text-[var(--terminal-text-muted)] hover:text-[var(--terminal-text-secondary)] text-[10px] cursor-pointer flex items-center gap-1",children:[c.jsx("span",{children:l?"▶":"▼"}),c.jsx("span",{className:"italic",children:"thinking..."})]}),!l&&c.jsxs("div",{className:`ml-3 text-[var(--terminal-text-muted)] italic whitespace-pre-wrap opacity-60 text-[11px] overflow-y-auto ${u?"max-h-[60px]":"max-h-[120px]"}`,children:[x.slice(0,u?200:500),x.length>(u?200:500)?"...":""]})]})}case"tool:start":{const x=String(t.data.name??""),h=t.data.input,y=typeof(h==null?void 0:h.command)=="string"?h.command.slice(0,80):"",g=typeof(h==null?void 0:h.file_path)=="string"?String(h.file_path):typeof(h==null?void 0:h.path)=="string"?String(h.path):"",v=g?g.split("/").pop()??"":"",b=/^(write_file|Write|edit_file|Edit)$/i.test(x),k=(m=g.match(/(?:^|\/)knowledge\/(.+\.md)$/))==null?void 0:m[1],E=b&&k&&o;return c.jsxs("div",{className:"flex items-center gap-2 py-0.5",children:[c.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] ${E?"text-green-400/80 bg-green-400/10":"text-blue-400/80 bg-blue-400/10"}`,children:E?b&&x.toLowerCase().includes("edit")?"Edit":"Write":x}),E?c.jsx("button",{onClick:()=>o(k),className:"text-[10px] text-green-400 hover:text-green-300 underline underline-offset-2 cursor-pointer truncate",style:{maxWidth:u?200:400},children:v}):c.jsxs(c.Fragment,{children:[y&&c.jsx("span",{className:`text-[var(--terminal-text-muted)] text-[10px] truncate ${u?"max-w-[200px]":"max-w-[400px]"}`,children:y}),v&&c.jsx("span",{className:`text-[var(--terminal-text-muted)] text-[10px] truncate ${u?"max-w-[200px]":"max-w-[400px]"}`,children:v})]})]})}case"dispatch:start":{const x=t.data.targetRoleId??t.data.roleId??"",h=t.data.task??"",y=t.data.childJobId,g=a1[x]??"#888";return c.jsx("div",{className:"my-1 p-2 rounded-lg border cursor-pointer hover:opacity-90 transition-opacity",style:{borderColor:`${g}44`,background:`${g}11`},onClick:()=>y&&(i==null?void 0:i(y)),children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("span",{style:{color:g},className:"font-bold text-[11px]",children:["→"," ",x.toUpperCase()]}),c.jsx("span",{className:"text-[var(--terminal-text-secondary)] text-[10px] truncate flex-1",children:h.slice(0,u?60:100)}),y&&i&&c.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-white/10 text-[var(--terminal-text-muted)]",children:["View ","→"]})]})})}case"dispatch:done":return c.jsx("div",{className:"text-[var(--terminal-text-muted)] text-[10px] pl-3 border-l-2 border-[var(--terminal-border)] my-0.5",children:"Dispatch completed"});case"turn:complete":return c.jsx("div",{className:"border-t border-[var(--terminal-border)] my-2 relative",children:c.jsxs("span",{className:"absolute -top-2 left-2 bg-[var(--terminal-bg)] px-2 text-[9px] text-[var(--terminal-text-muted)]",children:["Turn ",t.data.turn]})});case"stderr":return c.jsxs("div",{className:"text-red-400/80 text-[11px]",children:["⚠"," ",t.data.message]});case"job:start":return c.jsxs("div",{className:"text-[var(--terminal-text-muted)] text-[10px] pb-1",children:[c.jsx("span",{style:{color:f},className:"font-bold",children:t.roleId.toUpperCase()})," ","started: ",(t.data.task??"").slice(0,u?50:80)]});case"job:done":{const x=t.data.turns??0,h=t.data.toolCalls??0;return c.jsx("div",{className:"mt-2 p-2 rounded-lg bg-green-900/20 border border-green-800/30",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"w-2 h-2 rounded-full bg-green-400"}),c.jsx("span",{className:"text-green-300 font-bold text-[11px]",children:"Complete"}),c.jsxs("span",{className:"text-[var(--terminal-text-muted)] text-[10px]",children:[x," turns · ",h," tools"]})]})})}case"job:error":return c.jsx("div",{className:"mt-2 p-2 rounded-lg bg-red-900/20 border border-red-800/30",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"w-2 h-2 rounded-full bg-red-400"}),c.jsx("span",{className:"text-red-300 font-bold text-[11px]",children:"Error"}),c.jsx("span",{className:"text-red-200/70 text-[10px]",children:t.data.message})]})});case"import:scan":case"import:process":case"import:created":return c.jsxs("div",{className:"text-cyan-300/70 text-[11px]",children:["[",t.type,"] ",JSON.stringify(t.data)]});default:return null}}function Dj({jobId:t,title:l,color:r,variant:i,style:o,onClose:u,onMinimize:f,onDone:m,onNavigateToJob:x,onOpenKnowledgeDoc:h}){const{events:y,status:g,textOutput:v,childJobIds:b}=E1(t),[k,E]=j.useState(0),[N,T]=j.useState(new Set),L=j.useRef(null),$=j.useRef(Date.now()),K=j.useRef(!1);j.useEffect(()=>{const U=setInterval(()=>{E(Math.floor((Date.now()-$.current)/1e3))},1e3);return()=>clearInterval(U)},[]),j.useEffect(()=>{L.current&&(L.current.scrollTop=L.current.scrollHeight)},[y]),j.useEffect(()=>{(g==="done"||g==="error")&&!K.current&&(K.current=!0,m==null||m())},[g,m]);const V=U=>{T(B=>{const ne=new Set(B);return ne.has(U)?ne.delete(U):ne.add(U),ne})},M={idle:"Waiting",connecting:"Connecting...",streaming:"Working",done:"Complete",error:"Error"}[g],J={idle:"#888",connecting:"#888",streaming:r,done:"#2E7D32",error:"#C62828"}[g],Q=U=>`${Math.floor(U/60)}:${String(U%60).padStart(2,"0")}`,ie=g==="done"||g==="error",D=c.jsxs("div",{className:i==="modal"?"fixed top-[5%] left-1/2 -translate-x-1/2 w-[720px] max-w-[95vw] h-[85vh] z-[61] bg-[var(--terminal-bg)] rounded-2xl shadow-2xl overflow-hidden flex flex-col":"bg-[var(--terminal-bg)] rounded-xl border border-[var(--terminal-border)] overflow-hidden flex flex-col max-h-[400px]",style:o,children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-[var(--terminal-border)] shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"w-3 h-3 rounded-full animate-pulse",style:{background:J}}),c.jsx("div",{children:c.jsx("span",{className:"text-[var(--terminal-text)] font-bold text-sm",children:l})})]}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("span",{className:"text-[var(--terminal-text-muted)] text-xs font-mono",children:Q(k)}),c.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full font-semibold",style:{background:`${J}22`,color:J},children:M}),f&&i==="modal"&&c.jsx("button",{onClick:f,title:"Minimize",className:"text-[var(--terminal-text-muted)] hover:text-[var(--terminal-text)] text-sm cursor-pointer px-1",children:"–"}),ie&&c.jsx("button",{onClick:u,className:"text-[var(--terminal-text-muted)] hover:text-[var(--terminal-text)] text-lg cursor-pointer",children:"×"})]})]}),c.jsxs("div",{ref:L,className:"flex-1 overflow-y-auto p-4 space-y-1 text-xs font-mono",children:[y.length===0&&g==="connecting"&&c.jsx("div",{className:"text-[var(--terminal-text-muted)]",children:"Connecting to activity stream..."}),y.map(U=>c.jsx(Xy,{event:U,isThinkingCollapsed:N.has(U.seq),onToggleThinking:()=>V(U.seq),onNavigateToJob:x,onOpenKnowledgeDoc:h},U.seq)),g==="streaming"&&c.jsx("span",{className:"inline-block w-2 h-4 bg-green-400 animate-pulse ml-0.5"})]}),c.jsxs("div",{className:"px-5 py-3 border-t border-[var(--terminal-border)] flex items-center justify-between shrink-0",children:[c.jsxs("div",{className:"text-[10px] text-[var(--terminal-text-muted)]",children:[y.length>0&&`${y.length} events`,v.length>0&&` · ${v.length} chars`,b.length>0&&` · ${b.length} dispatches`]}),ie&&c.jsx("button",{onClick:u,className:"px-4 py-1.5 text-xs text-white rounded-lg font-semibold cursor-pointer",style:{background:r},children:"Close"})]})]});return i==="modal"?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 bg-black/40 z-[60] backdrop-blur-sm",onClick:ie?u:void 0}),D]}):D}const rd={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C","data-analyst":"#0277BD"};function zj({orgNodes:t,rootId:l}){const r=t[l];if(!r)return null;const o=r.children.map(m=>t[m]).filter(Boolean),u=[];for(const m of o)for(const x of m.children){const h=t[x];h&&u.push({node:h,parentId:m.id})}const f=o.length+u.length;return c.jsxs("div",{children:[c.jsx("label",{className:"block text-[11px] font-bold text-[var(--desk-dark)] uppercase tracking-wider mb-2",children:"Propagation Preview"}),c.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-lg p-4",children:[c.jsx("div",{className:"flex justify-center mb-2",children:c.jsx("span",{className:"px-3 py-1 text-[10px] font-bold rounded border-2 border-white/20 bg-white/5 text-white/30 uppercase",children:"CEO"})}),o.length>0&&c.jsx("div",{className:"flex justify-center mb-1",children:c.jsx("div",{className:"w-px h-3 bg-white/15"})}),o.length>1&&c.jsx("div",{className:"flex justify-center mb-1",children:c.jsx("div",{className:"h-px bg-white/15",style:{width:`${Math.min(o.length*80,320)}px`}})}),c.jsx("div",{className:"flex justify-center gap-3 mb-2 flex-wrap",children:o.map(m=>c.jsxs("div",{className:"flex flex-col items-center",children:[c.jsx("span",{className:"px-2.5 py-1 text-[10px] font-bold rounded border-2 uppercase",style:{borderColor:rd[m.id]??"#888",color:rd[m.id]??"#888",background:`${rd[m.id]??"#888"}22`},children:m.id}),c.jsx("span",{className:"text-[8px] text-white/30 mt-0.5",children:"direct"})]},m.id))}),u.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex justify-center mb-1",children:c.jsx("div",{className:"w-px h-2 bg-white/10"})}),c.jsx("div",{className:"flex justify-center gap-2 flex-wrap",children:u.map(({node:m})=>c.jsx("span",{className:"px-2 py-0.5 text-[9px] font-semibold rounded border border-white/15 text-white/40 uppercase",children:m.id},m.id))}),c.jsx("div",{className:"text-center text-[8px] text-white/30 mt-1",children:"via re-dispatch"})]})]}),c.jsxs("div",{className:"text-[10px] text-gray-400 mt-1.5",children:[f," role",f!==1?"s":""," will receive this wave"]})]})}function Mj({cLevelRoles:t,orgNodes:l,rootId:r,onClose:i,onDispatch:o}){const[u,f]=j.useState(""),m=j.useRef(null);j.useEffect(()=>{var g;(g=m.current)==null||g.focus()},[]);const x=()=>{!u.trim()||t.length===0||(o(u.trim()),i())},h=g=>{g.key==="Enter"&&(g.metaKey||g.ctrlKey)&&x(),g.key==="Escape"&&i()},y=r&&Object.keys(l).length>0;return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 bg-black/40 z-[60] backdrop-blur-sm",onClick:i}),c.jsxs("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[560px] z-[61] bg-[var(--wall)] rounded-2xl shadow-2xl overflow-hidden",children:[c.jsxs("div",{className:"p-5 text-white",style:{background:"linear-gradient(135deg, #B71C1C, #D32F2F)"},children:[c.jsx("div",{className:"text-lg font-bold",children:"CEO Wave"}),c.jsx("div",{className:"text-sm opacity-80 mt-0.5",children:"Broadcast a directive to all C-Level reports"})]}),c.jsxs("div",{className:"p-5 space-y-4",children:[y&&c.jsx(zj,{orgNodes:l,rootId:r}),!y&&c.jsxs("div",{children:[c.jsx("label",{className:"block text-[11px] font-bold text-[var(--desk-dark)] uppercase tracking-wider mb-2",children:"Dispatching to"}),c.jsx("div",{className:"flex gap-2 flex-wrap",children:t.length>0?t.map(g=>c.jsxs("span",{className:"px-3 py-1.5 text-xs font-semibold rounded-lg border-2 border-red-200 bg-red-50 text-red-800",children:[g.id.toUpperCase()," · ",g.name]},g.id)):c.jsx("span",{className:"text-xs text-gray-400 italic",children:"No C-Level roles found"})}),c.jsx("div",{className:"text-[10px] text-gray-400 mt-1",children:"Each C-Level receives the directive and delegates to their reports"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-[11px] font-bold text-[var(--desk-dark)] uppercase tracking-wider mb-2",children:"Directive"}),c.jsx("textarea",{ref:m,value:u,onChange:g=>f(g.target.value),onKeyDown:h,placeholder:"e.g. Report current status across all departments",className:"w-full h-28 p-3 rounded-lg border border-white/10 bg-white/5 text-sm text-white/90 placeholder-white/25 resize-none focus:outline-none focus:border-white/25 transition-colors"}),c.jsx("div",{className:"text-[10px] text-gray-400 mt-1",children:"Cmd+Enter to dispatch"})]})]}),c.jsxs("div",{className:"flex justify-end gap-3 px-5 pb-5",children:[c.jsx("button",{onClick:i,className:"px-4 py-2 text-sm rounded-lg border border-white/15 text-white/60 hover:bg-white/5 cursor-pointer",children:"Cancel"}),c.jsxs("button",{onClick:x,disabled:!u.trim()||t.length===0,className:"px-5 py-2 text-sm text-white rounded-lg font-semibold cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"#B71C1C"},children:["Dispatch to ",t.length," Role",t.length!==1?"s":""]})]})]})]})}function _j(t,l,r){const[i,o]=j.useState(new Map),[u,f]=j.useState(null),m=j.useRef(new Map),x=j.useRef(i);x.current=i,j.useEffect(()=>{if(!r||Object.keys(l).length===0)return;const v=new Map,b=E=>{const N=l[E];N&&(v.set(E,{jobId:null,roleId:E,roleName:N.name,children:N.children,status:"waiting",events:[],streamStatus:"idle"}),N.children.forEach(b))},k=l[r];k&&(v.set(r,{jobId:null,roleId:r,roleName:"CEO",children:k.children,status:"not-dispatched",events:[],streamStatus:"idle"}),k.children.forEach(b));for(const E of t){const N=v.get(E.roleId);N&&(N.jobId=E.jobId,N.status="running",N.streamStatus="connecting")}o(v),t.length>0&&f(t[0].roleId)},[t,l,r]);const h=j.useCallback((v,b)=>{const k=m.current.get(v);k&&k.controller.abort();const E=new AbortController,N={controller:E,lastSeq:-1};m.current.set(v,N);const L=`/api/jobs/${v}/stream?from=0`;fetch(L,{signal:E.signal}).then(async $=>{if(!$.ok||!$.body){o(J=>{const Q=new Map(J),ie=Q.get(b);return ie&&Q.set(b,{...ie,streamStatus:"error"}),Q});return}o(J=>{const Q=new Map(J),ie=Q.get(b);return ie&&Q.set(b,{...ie,streamStatus:"streaming",status:"running"}),Q});const K=$.body.getReader(),V=new TextDecoder;let M="";for(;;){const{done:J,value:Q}=await K.read();if(J)break;M+=V.decode(Q,{stream:!0});const ie=M.split(`
80
+ `);M=ie.pop()??"";let D="";for(const U of ie)if(U.startsWith("event: "))D=U.slice(7).trim();else if(U.startsWith("data: ")){try{const B=JSON.parse(U.slice(6));if(D==="activity"){const ne=B;ne.seq>N.lastSeq&&(N.lastSeq=ne.seq),o(te=>{const F=new Map(te),z=F.get(b);if(!z||z.events.some(Z=>Z.seq===ne.seq))return te;const q={...z,events:[...z.events,ne]};if(ne.type==="dispatch:start"&&ne.data.childJobId){const Z=ne.data.childJobId,re=ne.data.targetRoleId??ne.data.roleId;if(re){const A=F.get(re);A&&(F.set(re,{...A,jobId:Z,status:"running",streamStatus:"connecting"}),setTimeout(()=>h(Z,re),0))}}return ne.type==="job:done"?(q.status="done",q.streamStatus="done"):ne.type==="job:error"&&(q.status="error",q.streamStatus="error"),F.set(b,q),F})}else if(D==="stream:end"){const ne=B.reason;o(te=>{const F=new Map(te),z=F.get(b);if(!z)return te;const q=ne==="error"?"error":"done";return F.set(b,{...z,status:z.status==="running"?q:z.status,streamStatus:q==="error"?"error":"done"}),F})}}catch{}D=""}}}).catch($=>{$.name!=="AbortError"&&o(K=>{const V=new Map(K),M=V.get(b);return M&&V.set(b,{...M,streamStatus:"error"}),V})})},[]);j.useEffect(()=>{if(t.length!==0){for(const v of t)h(v.jobId,v.roleId);return()=>{for(const[,v]of m.current)v.controller.abort();m.current.clear()}}},[t,h]);const y=(()=>{let v=0,b=0,k=0;for(const[E,N]of i)E!==r&&(k++,N.status==="done"?v++:N.status==="running"&&b++);return{done:v,total:k,running:b}})(),g=y.total>0&&y.running===0&&Array.from(i.values()).every(v=>v.status!=="running"&&v.streamStatus!=="streaming"&&v.streamStatus!=="connecting");return j.useEffect(()=>{g&&o(v=>{const b=new Map(v);let k=!1;for(const[E,N]of b)N.status==="waiting"&&(b.set(E,{...N,status:"not-dispatched"}),k=!0);return k?b:v})},[g]),{nodes:i,selectedRoleId:u,selectNode:f,progress:y,allDone:g}}const r1={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C","data-analyst":"#0277BD"},lr=120,ql=44,i1=80;function Rj(t,l){if(!t.get(l))return{layout:[],width:300,height:200};const i=[],o=[],u=[{id:l,depth:0,parentId:null}],f=new Set;for(;u.length>0;){const{id:y,depth:g,parentId:v}=u.shift();if(f.has(y))continue;for(f.add(y);o.length<=g;)o.push([]);o[g].push(y),i.push({roleId:y,x:0,y:g*i1+20,parentId:v});const b=t.get(y);if(b)for(const k of b.children)t.has(k)&&!f.has(k)&&u.push({id:k,depth:g+1,parentId:y})}const m=Math.max(...o.map(y=>y.length))*(lr+16),x=Math.max(m,280);for(const y of o){const g=y.length*(lr+16)-16,v=(x-g)/2;y.forEach((b,k)=>{const E=i.find(N=>N.roleId===b);E&&(E.x=v+k*(lr+16))})}const h=o.length*i1+40;return{layout:i,width:x,height:h}}function Oj({nodes:t,rootId:l,selectedRoleId:r,onSelectNode:i}){const{layout:o,width:u,height:f}=Rj(t,l),m=h=>{const y=o.find(g=>g.roleId===h);return y?{cx:y.x+lr/2,cy:y.y+ql/2}:{cx:0,cy:0}},x=h=>{switch(h.status){case"running":return r1[h.roleId]??"#FBBF24";case"done":return"#2E7D32";case"error":return"#C62828";case"not-dispatched":return"#666";default:return"#888"}};return c.jsxs("svg",{viewBox:`0 0 ${u} ${f}`,width:"100%",height:"100%",className:"block",children:[c.jsx("defs",{children:c.jsxs("filter",{id:"glow",children:[c.jsx("feGaussianBlur",{stdDeviation:"2",result:"blur"}),c.jsxs("feMerge",{children:[c.jsx("feMergeNode",{in:"blur"}),c.jsx("feMergeNode",{in:"SourceGraphic"})]})]})}),o.filter(h=>h.parentId).map(h=>{const y=m(h.parentId),g=m(h.roleId),v=t.get(h.roleId),b=t.get(h.parentId);let k="rgba(180,200,240,0.15)",E="4 4",N="";return(v==null?void 0:v.status)==="done"||(b==null?void 0:b.status)==="done"?(k="#2E7D3266",E=""):(v==null?void 0:v.status)==="running"&&(k=r1[h.roleId]??"#FBBF24",E="6 4",N="wave-edge-flow"),c.jsx("line",{x1:y.cx,y1:y.cy+ql/2-4,x2:g.cx,y2:g.cy-ql/2+4,stroke:k,strokeWidth:1.5,strokeDasharray:E,className:N},`${h.parentId}-${h.roleId}`)}),o.map(h=>{const y=t.get(h.roleId);if(!y)return null;const g=x(y),v=r===h.roleId,b=h.roleId===l,k=b?.4:y.status==="not-dispatched"?.35:1;return c.jsxs("g",{transform:`translate(${h.x}, ${h.y})`,style:{cursor:b?"default":"pointer",opacity:k},onClick:()=>!b&&i(h.roleId),children:[c.jsx("rect",{x:0,y:0,width:lr,height:ql,rx:8,ry:8,fill:"var(--terminal-bg-deeper, #181825)",stroke:v?"#fff":g,strokeWidth:v?2:1.5,strokeDasharray:y.status==="not-dispatched"?"4 3":""}),c.jsx("circle",{cx:14,cy:ql/2,r:4,fill:g,filter:y.status==="running"?"url(#glow)":void 0,children:y.status==="running"&&c.jsx("animate",{attributeName:"opacity",values:"1;0.4;1",dur:"1.5s",repeatCount:"indefinite"})}),c.jsx("text",{x:26,y:ql/2-4,fill:"var(--terminal-text, #fff)",fontSize:10,fontWeight:700,fontFamily:"var(--pixel-font)",children:y.roleId.toUpperCase()}),c.jsx("text",{x:26,y:ql/2+10,fill:"var(--terminal-text-muted, #888)",fontSize:8,fontFamily:"var(--pixel-font)",children:y.status==="running"?"Working...":y.status==="done"?"Complete":y.status==="error"?"Error":y.status==="waiting"?"Waiting":""}),y.status==="done"&&c.jsx("text",{x:lr-18,y:ql/2+4,fontSize:14,fill:"#2E7D32",children:"✓"}),y.status==="error"&&c.jsx("text",{x:lr-18,y:ql/2+4,fontSize:14,fill:"#C62828",children:"✗"})]},h.roleId)})]})}const Bj={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C","data-analyst":"#0277BD"};function Lj({directive:t,rootJobs:l,orgNodes:r,rootRoleId:i,onClose:o,onMinimize:u,onDone:f,onOpenKnowledgeDoc:m}){const{nodes:x,selectedRoleId:h,selectNode:y,progress:g,allDone:v}=_j(l,r,i),[b,k]=j.useState(0),[E,N]=j.useState(new Set),T=j.useRef(null),L=j.useRef(Date.now()),$=j.useRef(!1);j.useEffect(()=>{const Q=setInterval(()=>{k(Math.floor((Date.now()-L.current)/1e3))},1e3);return()=>clearInterval(Q)},[]),j.useEffect(()=>{T.current&&(T.current.scrollTop=T.current.scrollHeight)},[h,x]),j.useEffect(()=>{v&&!$.current&&($.current=!0,f==null||f())},[v,f]);const K=Q=>`${Math.floor(Q/60)}:${String(Q%60).padStart(2,"0")}`,V=h?x.get(h):null,M=h?Bj[h]??"#888":"#888",J=Q=>{N(ie=>{const D=new Set(ie);return D.has(Q)?D.delete(Q):D.add(Q),D})};return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 bg-black/40 z-[60] backdrop-blur-sm",onClick:v?o:void 0}),c.jsxs("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[960px] max-w-[95vw] h-[85vh] z-[61] bg-[var(--terminal-bg)] rounded-2xl shadow-2xl overflow-hidden flex flex-col",children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-[var(--terminal-border)] shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"w-3 h-3 rounded-full",style:{background:v?"#2E7D32":"#B71C1C",animation:v?void 0:"wave-pulse 2s ease-in-out infinite"}}),c.jsx("div",{children:c.jsx("span",{className:"text-[var(--terminal-text)] font-bold text-sm",children:v?"WAVE COMPLETE":"WAVE COMMAND CENTER"})})]}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("span",{className:"text-[var(--terminal-text-muted)] text-xs font-mono",children:K(b)}),c.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full font-semibold",style:{background:v?"#2E7D3222":"#B71C1C22",color:v?"#2E7D32":"#B71C1C"},children:[g.done,"/",g.total," done"]}),c.jsx("button",{onClick:u,title:"Minimize",className:"text-[var(--terminal-text-muted)] hover:text-[var(--terminal-text)] text-sm cursor-pointer px-1",children:"–"}),v&&c.jsx("button",{onClick:o,className:"text-[var(--terminal-text-muted)] hover:text-[var(--terminal-text)] text-lg cursor-pointer",children:"×"})]})]}),c.jsx("div",{className:"px-5 py-2 border-b border-[var(--terminal-border)] shrink-0",children:c.jsxs("span",{className:"text-[var(--terminal-text-secondary)] text-xs italic",children:["“",t,"”"]})}),c.jsxs("div",{className:"flex flex-1 min-h-0",children:[c.jsxs("div",{className:"w-[280px] shrink-0 border-r border-[var(--terminal-border)] flex flex-col",children:[c.jsx("div",{className:"px-3 py-2 border-b border-[var(--terminal-border)]",children:c.jsx("span",{className:"text-[10px] font-bold text-[var(--terminal-text-secondary)] uppercase tracking-wider",children:"Org Propagation"})}),c.jsx("div",{className:"flex-1 overflow-auto p-3",children:c.jsx(Oj,{nodes:x,rootId:i,selectedRoleId:h,onSelectNode:y})}),c.jsx("div",{className:"px-3 py-2 border-t border-[var(--terminal-border)] flex flex-wrap gap-x-3 gap-y-1",children:[{label:"running",color:"#FBBF24",dot:!0},{label:"done",color:"#2E7D32",dot:!1},{label:"waiting",color:"#888",dot:!1},{label:"error",color:"#C62828",dot:!1}].map(Q=>c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"w-2 h-2 rounded-full inline-block",style:{background:Q.color,animation:Q.dot?"wave-pulse 1.5s ease-in-out infinite":void 0}}),c.jsx("span",{className:"text-[8px] text-[var(--terminal-text-muted)]",children:Q.label})]},Q.label))})]}),c.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[V&&c.jsxs("div",{className:"px-4 py-2 border-b border-[var(--terminal-border)] shrink-0 flex items-center gap-2",children:[c.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:M}}),c.jsx("span",{className:"text-[var(--terminal-text)] font-bold text-xs",children:V.roleId.toUpperCase()}),c.jsx("span",{className:"text-[var(--terminal-text-muted)] text-xs",children:V.roleName}),c.jsx("span",{className:"ml-auto text-[10px] px-2 py-0.5 rounded-full font-semibold",style:{background:`${M}22`,color:M},children:V.status==="running"?"Working":V.status==="done"?"Complete":V.status==="error"?"Error":V.status==="waiting"?"Waiting":"Not dispatched"})]}),c.jsxs("div",{ref:T,className:"flex-1 overflow-y-auto p-4 space-y-1 text-xs font-mono",children:[V&&V.events.length===0&&c.jsx("div",{className:"text-[var(--terminal-text-muted)]",children:V.status==="waiting"?"Waiting for dispatch...":V.status==="running"?"Connecting to activity stream...":V.status==="not-dispatched"?"This role was not dispatched in this wave.":""}),V==null?void 0:V.events.map(Q=>c.jsx(Xy,{event:Q,isThinkingCollapsed:E.has(Q.seq),onToggleThinking:()=>J(Q.seq),onNavigateToJob:ie=>{for(const[,D]of x)if(D.jobId===ie){y(D.roleId);return}},onOpenKnowledgeDoc:m},Q.seq)),(V==null?void 0:V.status)==="running"&&c.jsx("span",{className:"inline-block w-2 h-4 bg-green-400 animate-pulse ml-0.5"})]}),!V&&c.jsx("div",{className:"flex-1 flex items-center justify-center text-[var(--terminal-text-muted)] text-xs",children:"Click a node in the org tree to view activity"}),c.jsxs("div",{className:"px-4 py-2 border-t border-[var(--terminal-border)] flex items-center justify-between shrink-0",children:[c.jsx("div",{className:"text-[10px] text-[var(--terminal-text-muted)]",children:V&&V.events.length>0&&`${V.events.length} events`}),v&&c.jsx("button",{onClick:o,className:"px-4 py-1.5 text-xs text-white rounded-lg font-semibold cursor-pointer",style:{background:"#2E7D32"},children:"Close"})]})]})]})]})]})}const Fj={cto:{skinColor:"#F5CBA7",hairColor:"#2C1810",shirtColor:"#1565C0",pantsColor:"#37474F",shoeColor:"#212121",hairStyle:"short",outfitStyle:"tshirt",accessory:"glasses"},cbo:{skinColor:"#FDEBD0",hairColor:"#1A0A00",shirtColor:"#E65100",pantsColor:"#37474F",shoeColor:"#1A1A1A",hairStyle:"slicked",outfitStyle:"suit",accessory:"lapels"},pm:{skinColor:"#FDEBD0",hairColor:"#6D4C41",shirtColor:"#2E7D32",pantsColor:"#37474F",shoeColor:"#212121",hairStyle:"bun",outfitStyle:"tshirt",accessory:"blush"},engineer:{skinColor:"#F5CBA7",hairColor:"#1A1A1A",shirtColor:"#4A148C",pantsColor:"#37474F",shoeColor:"#7B1FA2",hairStyle:"messy",outfitStyle:"hoodie",accessory:"headphones"},designer:{skinColor:"#FDEBD0",hairColor:"#AD1457",shirtColor:"#AD1457",pantsColor:"#37474F",shoeColor:"#212121",hairStyle:"bob",outfitStyle:"tshirt",accessory:"beret"},qa:{skinColor:"#F5CBA7",hairColor:"#4E342E",shirtColor:"#00695C",pantsColor:"#37474F",shoeColor:"#212121",hairStyle:"short",outfitStyle:"tshirt",accessory:"badge"},"data-analyst":{skinColor:"#F5CBA7",hairColor:"#3E2723",shirtColor:"#0277BD",pantsColor:"#37474F",shoeColor:"#212121",hairStyle:"curly",outfitStyle:"vest",accessory:"none"}};function sh(t){return Fj[t]??{skinColor:"#B0BEC5",hairColor:"#78909C",shirtColor:"#607D8B",pantsColor:"#455A64",shoeColor:"#37474F"}}const Gy=["#FDEBD0","#F5CBA7","#D4A07A","#C68642","#8D5524","#5C3A1E","#F3D1C7","#E8BEAC","#B07D62","#704214"],Qy=["#1A0A00","#2C1810","#4E342E","#6D4C41","#8D6E63","#D4A574","#F5E6CA","#FFD700","#B71C1C","#AD1457","#4A148C","#1A237E","#004D40","#1A1A1A","#78909C","#E0E0E0"],Ky=["#1565C0","#E65100","#2E7D32","#4A148C","#AD1457","#00695C","#D32F2F","#F57F17","#1B5E20","#283593","#4E342E","#37474F","#880E4F","#00838F","#6A1B9A","#FF6F00"],Zy=["#37474F","#1A237E","#3E2723","#263238","#1B5E20","#455A64","#212121","#4E342E","#0D47A1","#311B92"],Jy=["#212121","#1A1A1A","#37474F","#4E342E","#7B1FA2","#D32F2F","#1565C0","#F57F17","#2E7D32","#FFFFFF"],Na={default:{name:"MIDNIGHT",icon:"🌃",vars:{"--floor-light":"#0d1117","--floor-dark":"#0a0e14","--hud-bg":"#0d1117","--hud-bg-alt":"#161b22","--pixel-border":"#30363d","--terminal-bg":"#0d1117","--terminal-border":"#21262d","--terminal-border-hover":"#388bfd","--terminal-text":"#e6edf3","--terminal-text-secondary":"#8b949e","--terminal-text-muted":"#484f58","--accent":"#388bfd","--active-green":"#3fb950","--idle-amber":"#d29922"}},light:{name:"DAYLIGHT",icon:"☀️",vars:{"--floor-light":"#f6f8fa","--floor-dark":"#eaeef2","--hud-bg":"#24292f","--hud-bg-alt":"#32383f","--pixel-border":"#d0d7de","--terminal-bg":"#ffffff","--terminal-border":"#d0d7de","--terminal-border-hover":"#0969da","--terminal-text":"#1f2328","--terminal-text-secondary":"#656d76","--terminal-text-muted":"#8c959f","--accent":"#0969da","--active-green":"#1a7f37","--idle-amber":"#9a6700"}},retro:{name:"RETRO",icon:"🎮",vars:{"--floor-light":"#1a1410","--floor-dark":"#140f0a","--hud-bg":"#1a1410","--hud-bg-alt":"#2a2018","--pixel-border":"#5c4a32","--terminal-bg":"#1a1410","--terminal-border":"#3a2e20","--terminal-border-hover":"#d4a44e","--terminal-text":"#e8d5b0","--terminal-text-secondary":"#a08860","--terminal-text-muted":"#6b5840","--accent":"#d4a44e","--active-green":"#8bba4a","--idle-amber":"#e8a030"}},cyberpunk:{name:"NEON",icon:"🌌",vars:{"--floor-light":"#0a0014","--floor-dark":"#06000e","--hud-bg":"#0a0014","--hud-bg-alt":"#14002a","--pixel-border":"#4a1a80","--terminal-bg":"#0a0014","--terminal-border":"#2a0a50","--terminal-border-hover":"#e040fb","--terminal-text":"#e0d0ff","--terminal-text-secondary":"#9070c0","--terminal-text-muted":"#5a3a80","--accent":"#e040fb","--active-green":"#00ff88","--idle-amber":"#ffab00"}},forest:{name:"FOREST",icon:"🌲",vars:{"--floor-light":"#0a1410","--floor-dark":"#060e0a","--hud-bg":"#0a1410","--hud-bg-alt":"#142a1e","--pixel-border":"#2a5a3a","--terminal-bg":"#0a1410","--terminal-border":"#1a3a26","--terminal-border-hover":"#4ade80","--terminal-text":"#d0f0d8","--terminal-text-secondary":"#70a880","--terminal-text-muted":"#3a6848","--accent":"#4ade80","--active-green":"#86efac","--idle-amber":"#fcd34d"}},ocean:{name:"OCEAN",icon:"🌊",vars:{"--floor-light":"#0a1420","--floor-dark":"#060e18","--hud-bg":"#0a1420","--hud-bg-alt":"#142a40","--pixel-border":"#1e4a6a","--terminal-bg":"#0a1420","--terminal-border":"#163050","--terminal-border-hover":"#38bdf8","--terminal-text":"#d0e8f8","--terminal-text-secondary":"#6090b0","--terminal-text-muted":"#305070","--accent":"#38bdf8","--active-green":"#34d399","--idle-amber":"#fbbf24"}}};function Uj({color:t,selected:l,onClick:r}){return c.jsx("button",{onClick:r,className:"customize-swatch",style:{background:t,outline:l?"2px solid #fff":"2px solid transparent",boxShadow:l?`0 0 0 1px ${t}, 0 0 6px ${t}88`:"none"}})}function ls({label:t,presets:l,value:r,onChange:i}){return c.jsxs("div",{className:"customize-row",children:[c.jsxs("div",{className:"customize-row-header",children:[c.jsx("span",{className:"customize-row-label",children:t}),c.jsx("div",{className:"customize-row-current",style:{background:r}})]}),c.jsx("div",{className:"customize-swatches",children:l.map(o=>c.jsx(Uj,{color:o,selected:o===r,onClick:()=>i(o)},o))})]})}function id({label:t,items:l,value:r,onChange:i}){return c.jsxs("div",{className:"customize-row",children:[c.jsx("div",{className:"customize-row-header",children:c.jsx("span",{className:"customize-row-label",children:t})}),c.jsx("div",{className:"customize-swatches",style:{gap:4},children:l.map(o=>c.jsx("button",{onClick:()=>i(o.id===r?void 0:o.id),className:"customize-swatch",style:{width:"auto",height:"auto",padding:"2px 6px",fontSize:9,fontFamily:"var(--font-pixel, monospace)",background:o.id===r?"rgba(255,255,255,0.15)":"rgba(255,255,255,0.04)",outline:o.id===r?"2px solid #fff":"2px solid transparent",color:o.id===r?"#fff":"rgba(255,255,255,0.5)",borderRadius:4},children:o.name},o.id))})]})}function ja(t){return t[Math.floor(Math.random()*t.length)]}function tc(){var i,o,u;const t=By(),l=Ly(),r=Fy();return{skinColor:ja(Gy),hairColor:ja(Qy),shirtColor:ja(Ky),pantsColor:ja(Zy),shoeColor:ja(Jy),hairStyle:(i=ja(t))==null?void 0:i.id,outfitStyle:(o=ja(l))==null?void 0:o.id,accessory:(u=ja(r))==null?void 0:u.id}}function Wy({roleId:t,appearance:l,onChange:r,onRandomize:i,onReset:o,label:u}){const f=j.useCallback((v,b)=>{r({...l,[v]:b})},[l,r]),m=j.useRef(null),x=j.useCallback(v=>{var E;const b=(E=v.target.files)==null?void 0:E[0];if(!b)return;const k=new Image;k.onload=()=>{const N=c5(k);r({...N,hairStyle:l.hairStyle,outfitStyle:l.outfitStyle,accessory:l.accessory}),URL.revokeObjectURL(k.src)},k.src=URL.createObjectURL(b),v.target.value=""},[l.hairStyle,l.outfitStyle,l.accessory,r]),h=By(),y=Ly(),g=Fy();return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"customize-preview",children:[c.jsx("div",{className:"customize-preview-bg",children:c.jsx(vc,{roleId:t,appearance:l,scale:12})}),u&&c.jsx("div",{className:"customize-preview-name",children:u}),c.jsxs("div",{className:"customize-preview-actions",children:[c.jsx("button",{className:"customize-btn customize-btn--random",onClick:i,children:"RANDOM"}),c.jsx("button",{className:"customize-btn customize-btn--reset",onClick:o,children:"RESET"}),c.jsx("button",{className:"customize-btn",onClick:()=>{var v;return(v=m.current)==null?void 0:v.click()},style:{fontSize:9,opacity:.7},children:"PHOTO"}),c.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:x,style:{display:"none"}})]})]}),c.jsxs("div",{className:"customize-colors",children:[c.jsx(ls,{label:"SKIN",presets:Gy,value:l.skinColor,onChange:v=>f("skinColor",v)}),c.jsx(ls,{label:"HAIR",presets:Qy,value:l.hairColor,onChange:v=>f("hairColor",v)}),c.jsx(id,{label:"HAIR STYLE",items:h,value:l.hairStyle,onChange:v=>f("hairStyle",v)}),c.jsx(ls,{label:"OUTFIT",presets:Ky,value:l.shirtColor,onChange:v=>f("shirtColor",v)}),c.jsx(id,{label:"OUTFIT STYLE",items:y,value:l.outfitStyle,onChange:v=>f("outfitStyle",v)}),c.jsx(ls,{label:"PANTS",presets:Zy,value:l.pantsColor,onChange:v=>f("pantsColor",v)}),c.jsx(ls,{label:"SHOES",presets:Jy,value:l.shoeColor,onChange:v=>f("shoeColor",v)}),c.jsx(id,{label:"ACCESSORY",items:g,value:l.accessory,onChange:v=>f("accessory",v)})]})]})}const Hj=[{value:"c-level",label:"C-Level"},{value:"team-lead",label:"Team Lead"},{value:"member",label:"Member"}];function $j(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,24)}function qj(t){switch(t){case"c-level":return{authority:{autonomous:["Strategic decisions within domain","Task delegation to reports"],needsApproval:["Budget over $5K","External commitments"]},knowledge:{reads:["company/","operations/","projects/"],writes:["operations/","knowledge/"]},reports:{daily:"standup",weekly:"summary"}};case"team-lead":return{authority:{autonomous:["Task planning","Sprint management"],needsApproval:["Architecture changes","New tool adoption"]},knowledge:{reads:["projects/","architecture/"],writes:["projects/"]},reports:{daily:"standup",weekly:"summary"}};default:return{authority:{autonomous:["Implementation within assigned tasks"],needsApproval:["Design changes","New dependencies"]},knowledge:{reads:["projects/"],writes:[]},reports:{daily:"standup",weekly:""}}}}const as=4;function Ij({existingRoles:t,onClose:l,onHire:r}){const[i,o]=j.useState(1),[u,f]=j.useState(""),[m,x]=j.useState(""),[h,y]=j.useState(!1),[g,v]=j.useState("member"),[b,k]=j.useState("ceo"),[E,N]=j.useState(""),[T,L]=j.useState(tc),[$,K]=j.useState(!1),[V,M]=j.useState(""),J=j.useRef(null),Q=j.useRef(null);j.useEffect(()=>{var z,q;i===1&&((z=J.current)==null||z.focus()),i===2&&((q=Q.current)==null||q.focus())},[i]);const ie=z=>{f(z),h||x($j(z))},D=u.trim().length>0&&m.trim().length>0&&!t.some(z=>z.id===m),U=E.trim().length>0,B=async()=>{K(!0),M("");const z=qj(g);try{await r({id:m,name:u.trim(),level:g,reportsTo:b,persona:E.trim(),...z},T),l()}catch(q){M(q instanceof Error?q.message:"Failed to create role"),K(!1)}},ne=z=>z===1?D:z===2?U:!0,te=z=>{z.key==="Escape"&&l(),z.key==="Enter"&&(z.metaKey||z.ctrlKey)&&(i<as&&ne(i)?o(i+1):i===as&&B())},F=t.some(z=>z.id===m)&&m.length>0;return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 bg-black/40 z-[60] backdrop-blur-sm",onClick:l}),c.jsxs("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[560px] z-[61] bg-[var(--wall)] rounded-2xl shadow-2xl overflow-hidden",onKeyDown:te,children:[c.jsxs("div",{className:"p-5 text-white",style:{background:"linear-gradient(135deg, #2E7D32, #43A047)"},children:[c.jsx("div",{className:"text-lg font-bold",children:"Hire New Role"}),c.jsxs("div",{className:"text-sm opacity-80 mt-0.5",children:["Step ",i," of ",as]})]}),c.jsx("div",{className:"flex gap-1 px-5 pt-4",children:Array.from({length:as},(z,q)=>q+1).map(z=>c.jsx("div",{className:"flex-1 h-1 rounded-full transition-colors",style:{background:z<=i?"#2E7D32":"rgba(255,255,255,0.1)"}},z))}),c.jsxs("div",{className:"p-5 min-h-[240px]",children:[i===1&&c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-[11px] font-bold text-[var(--desk-dark)] uppercase tracking-wider mb-1",children:"Role Name"}),c.jsx("input",{ref:J,value:u,onChange:z=>ie(z.target.value),placeholder:"e.g. Data Analyst",className:"w-full p-2.5 rounded-lg border border-white/10 bg-white/5 text-sm text-white/90 placeholder-white/25 focus:outline-none focus:border-white/25 transition-colors"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-[11px] font-bold text-[var(--desk-dark)] uppercase tracking-wider mb-1",children:"Role ID (slug)"}),c.jsx("input",{value:m,onChange:z=>{x(z.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),y(!0)},className:`w-full p-2.5 rounded-lg border bg-white/5 text-sm text-white/90 font-mono focus:outline-none transition-colors ${F?"border-red-400":"border-white/10 focus:border-white/25"}`}),F&&c.jsx("div",{className:"text-xs text-red-500 mt-1",children:"ID already exists"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-[11px] font-bold text-[var(--desk-dark)] uppercase tracking-wider mb-1",children:"Level"}),c.jsx("div",{className:"flex gap-2",children:Hj.map(z=>c.jsx("button",{onClick:()=>v(z.value),className:`flex-1 p-2 text-xs font-semibold rounded-lg border cursor-pointer transition-colors ${g===z.value?"border-green-600 bg-green-900/30 text-green-400":"border-white/10 text-white/50 hover:border-white/20"}`,children:z.label},z.value))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-[11px] font-bold text-[var(--desk-dark)] uppercase tracking-wider mb-1",children:"Reports To"}),c.jsxs("select",{value:b,onChange:z=>k(z.target.value),className:"w-full p-2.5 rounded-lg border border-white/10 bg-white/5 text-sm text-white/90 focus:outline-none focus:border-white/25 transition-colors",children:[c.jsx("option",{value:"ceo",className:"bg-[var(--wall)] text-white",children:"CEO"}),t.map(z=>c.jsxs("option",{value:z.id,className:"bg-[var(--wall)] text-white",children:[z.name," (",z.id,")"]},z.id))]})]})]}),i===2&&c.jsxs("div",{children:[c.jsx("label",{className:"block text-[11px] font-bold text-[var(--desk-dark)] uppercase tracking-wider mb-2",children:"Persona"}),c.jsx("textarea",{ref:Q,value:E,onChange:z=>N(z.target.value),placeholder:"Describe this role's personality, expertise, and working style...",className:"w-full h-40 p-3 rounded-lg border border-white/10 bg-white/5 text-sm text-white/90 placeholder-white/25 resize-none focus:outline-none focus:border-white/25 transition-colors"}),c.jsx("div",{className:"text-[10px] text-gray-400 mt-1",children:"This defines how the AI agent will behave in this role"})]}),i===3&&c.jsx("div",{className:"customize-body",style:{padding:0},children:c.jsx(Wy,{roleId:"default",appearance:T,onChange:L,onRandomize:()=>L(tc()),onReset:()=>L(tc()),label:c.jsxs("span",{children:[m||"new-role"," — ",u||"New Role"]})})}),i===4&&c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{className:"text-[11px] font-bold text-[var(--desk-dark)] uppercase tracking-wider mb-2",children:"Review"}),c.jsxs("div",{className:"bg-white/5 rounded-xl p-4 border border-white/10",children:[c.jsxs("div",{className:"flex gap-4",children:[c.jsx("div",{className:"flex-shrink-0 rounded-lg overflow-hidden",style:{background:"#0d1117",padding:8},children:c.jsx(vc,{roleId:"default",appearance:T,scale:4})}),c.jsxs("div",{className:"flex-1 space-y-2.5",children:[c.jsx(qo,{label:"Name",value:u}),c.jsx(qo,{label:"ID",value:m,mono:!0}),c.jsx(qo,{label:"Level",value:g}),c.jsx(qo,{label:"Reports To",value:b})]})]}),c.jsxs("div",{className:"pt-3 mt-3 border-t border-white/10",children:[c.jsx("div",{className:"text-[10px] text-white/30 uppercase tracking-wider mb-1",children:"Persona"}),c.jsx("div",{className:"text-xs text-white/60 leading-relaxed",children:E})]})]}),V&&c.jsx("div",{className:"text-xs text-red-400 bg-red-900/20 p-2 rounded-lg border border-red-800/30",children:V})]})]}),c.jsxs("div",{className:"flex justify-between px-5 pb-5",children:[c.jsx("div",{children:i>1&&c.jsx("button",{onClick:()=>o(i-1),className:"px-4 py-2 text-sm rounded-lg border border-white/15 text-white/60 hover:bg-white/5 cursor-pointer",children:"Back"})}),c.jsxs("div",{className:"flex gap-3",children:[c.jsx("button",{onClick:l,className:"px-4 py-2 text-sm rounded-lg border border-white/15 text-white/60 hover:bg-white/5 cursor-pointer",children:"Cancel"}),i<as?c.jsx("button",{onClick:()=>o(i+1),disabled:!ne(i),className:"px-5 py-2 text-sm text-white rounded-lg font-semibold cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"#2E7D32"},children:"Next"}):c.jsx("button",{onClick:B,disabled:$,className:"px-5 py-2 text-sm text-white rounded-lg font-semibold cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"#2E7D32"},children:$?"Hiring...":"HIRE"})]})]})]})]})}function qo({label:t,value:l,mono:r}){return c.jsxs("div",{className:"flex justify-between text-sm",children:[c.jsx("span",{className:"text-white/40",children:t}),c.jsx("span",{className:`font-semibold text-white/80 ${r?"font-mono":""}`,children:l})]})}function Yj({roleId:t,roleName:l,onClose:r,onConfirm:i}){const[o,u]=j.useState(!1),f=async()=>{u(!0);try{await i(t)}finally{u(!1)}};return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 bg-black/40 z-[60] backdrop-blur-sm",onClick:r}),c.jsxs("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[480px] z-[61] bg-[var(--wall)] rounded-2xl shadow-2xl overflow-hidden",children:[c.jsxs("div",{className:"p-5 text-white",style:{background:"linear-gradient(135deg, #B71C1C, #D32F2F)"},children:[c.jsx("div",{className:"text-lg font-bold",children:"Fire Role"}),c.jsxs("div",{className:"text-sm opacity-80 mt-0.5",children:["Remove ",l," (",t,")"]})]}),c.jsxs("div",{className:"p-5",children:[c.jsxs("div",{className:"p-4 rounded-lg border-2 border-red-300 bg-red-50 mb-4",children:[c.jsx("div",{className:"text-sm font-bold text-red-800 mb-1",children:"Warning"}),c.jsxs("div",{className:"text-xs text-red-700 leading-relaxed",children:["This will permanently delete the role directory including",c.jsx("strong",{children:" role.yaml"}),", ",c.jsx("strong",{children:"profile.md"}),", ",c.jsx("strong",{children:"SKILL.md"}),", and all journal entries. This action cannot be undone."]})]}),c.jsxs("div",{className:"text-sm text-gray-600",children:["Are you sure you want to fire ",c.jsx("strong",{children:l}),"?"]})]}),c.jsxs("div",{className:"flex justify-end gap-3 px-5 pb-5",children:[c.jsx("button",{onClick:r,className:"px-4 py-2 text-sm rounded-lg border border-gray-300 hover:bg-gray-50 cursor-pointer",children:"Cancel"}),c.jsx("button",{onClick:f,disabled:o,className:"px-5 py-2 text-sm text-white rounded-lg font-semibold cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"#B71C1C"},children:o?"Removing...":"Confirm Fire"})]})]})]})}const Vj={cto:"🏗️",cbo:"📊",pm:"📋",engineer:"⚙️",designer:"🎨",qa:"🔍"};function Xj({roleId:t,title:l,roleColor:r,active:i,onClick:o,onClose:u,"data-session-id":f}){return c.jsxs("button",{onClick:o,"data-session-id":f,className:`flex items-center gap-1.5 px-3 py-1.5 text-[11px] rounded-t-lg shrink-0 cursor-pointer transition-colors max-w-[180px] group ${i?"bg-[var(--terminal-bg)] text-[var(--terminal-text)]":"bg-[var(--terminal-inline-bg)] text-[var(--terminal-text-secondary)] hover:text-[var(--terminal-text)] hover:bg-[var(--terminal-surface)]"}`,style:i?{borderTop:`2px solid ${r}`}:void 0,children:[c.jsx("span",{className:"text-xs",children:Vj[t]??"👤"}),c.jsx("span",{className:"truncate",children:l}),c.jsx("span",{onClick:u,className:"ml-auto text-[var(--terminal-text-muted)] hover:text-[var(--terminal-text-secondary)] text-sm leading-none",children:"×"})]})}function Gj({content:t,streaming:l}){let r=t;return l&&(t.match(/```/g)??[]).length%2!==0&&(r+="\n```"),c.jsx("div",{className:"terminal-markdown",children:c.jsx(sy,{remarkPlugins:[zy],components:{code:Qj,table:({children:i})=>c.jsx("div",{className:"overflow-x-auto my-2",children:c.jsx("table",{className:"terminal-table",children:i})})},children:r})})}function Qj({className:t,children:l,...r}){const i=/language-(\w+)/.exec(t??"");return i||typeof l=="string"&&l.includes(`
81
+ `)?c.jsx(Kj,{language:i==null?void 0:i[1],children:l}):c.jsx("code",{className:"terminal-inline-code",...r,children:l})}function Kj({children:t,language:l}){const[r,i]=j.useState(!1),o=String(t).replace(/\n$/,""),u=()=>{navigator.clipboard.writeText(o),i(!0),setTimeout(()=>i(!1),1500)};return c.jsxs("div",{className:"terminal-code-block group relative my-2",children:[l&&c.jsx("div",{className:"text-[10px] text-[var(--terminal-text-muted)] px-3 pt-1.5",children:l}),c.jsx("button",{onClick:u,className:"absolute top-1.5 right-2 text-[10px] text-[var(--terminal-text-muted)] hover:text-[var(--terminal-text-secondary)] opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",children:r?"Copied!":"Copy"}),c.jsx("pre",{className:"overflow-x-auto p-3 text-xs leading-relaxed",children:c.jsx("code",{children:o})})]})}const Zj={cto:"🏗️",cbo:"📊",pm:"📋",engineer:"⚙️",designer:"🎨",qa:"🔍"};function sd(t,l){return l?l.file_path?String(l.file_path).replace(/^.*\/(?=[^/]+\/)/,""):l.path?String(l.path).replace(/^.*\/(?=[^/]+\/)/,""):l.pattern?String(l.pattern):l.command?String(l.command).slice(0,60):l.query?String(l.query).slice(0,60):l.url?String(l.url).slice(0,60):"":""}function Jj(t){const l=[];let r="";for(const i of t)if(i.type==="thinking")i.text&&(r=i.text),l.length===0||l[l.length-1].type!=="thinking"?l.push({type:"thinking",text:i.text}):l[l.length-1].text=i.text;else if(i.type==="tool")l.push({type:"tool",toolName:i.toolName,toolSummary:sd(i.toolName??"",i.toolInput),toolInput:i.toolInput});else if(i.type==="dispatch")l.push({type:"dispatch",roleId:i.roleId,task:i.task});else if(i.type==="dispatch:progress"){const o=l.length>0?l[l.length-1]:null;(o==null?void 0:o.type)==="dispatch:progress"&&o.roleId===i.roleId?i.progressType==="tool"?(o.toolName=i.toolName,o.toolSummary=sd(i.toolName??"",i.toolInput),o.progressType="tool"):i.progressType==="thinking"?(o.text=i.text,o.progressType="thinking"):i.progressType==="text"?(o.text=i.text,o.progressType="text"):(i.progressType==="done"||i.progressType==="error")&&(o.progressType=i.progressType):l.push({type:"dispatch:progress",roleId:i.roleId,progressType:i.progressType,text:i.text,toolName:i.toolName,toolSummary:i.toolName?sd(i.toolName,i.toolInput):void 0})}if(r){const i=l.filter(o=>o.type==="thinking");i.length>0&&(i[i.length-1].text=r)}return l}function Wj({event:t,isStreaming:l}){var o,u,f;const[r,i]=j.useState(!1);switch(t.type){case"thinking":return c.jsxs("div",{className:"stream-event-thinking",children:[c.jsxs("div",{className:"stream-event-thinking-header",onClick:()=>i(!r),children:[c.jsx("span",{className:"stream-event-thinking-icon"}),c.jsxs("span",{className:"stream-event-thinking-label",children:["thinking",l?"...":""]}),t.text&&!l&&c.jsx("span",{className:"stream-event-thinking-toggle",children:r?"▾":"▸"})]}),(l||r)&&t.text&&c.jsx("div",{className:"stream-event-thinking-content",children:t.text.slice(-500)})]});case"tool":return c.jsxs("div",{className:"stream-event-tool",children:[c.jsx("span",{className:"stream-event-tool-badge",children:t.toolName}),t.toolSummary&&c.jsx("span",{className:"stream-event-tool-path",children:t.toolSummary}),t.toolInput&&c.jsx("span",{className:"stream-event-tool-toggle",onClick:()=>i(!r),children:r?"▾":"▸"}),r&&t.toolInput&&c.jsx("div",{className:"stream-event-tool-detail",children:JSON.stringify(t.toolInput,null,1).slice(0,300)})]});case"dispatch":return c.jsxs("div",{className:"stream-event-dispatch",children:[c.jsxs("span",{className:"stream-event-dispatch-badge",children:["→"," ",(o=t.roleId)==null?void 0:o.toUpperCase()]}),c.jsx("span",{className:"stream-event-dispatch-task",children:(u=t.task)==null?void 0:u.slice(0,80)})]});case"dispatch:progress":return c.jsxs("div",{className:"stream-event-dispatch-progress",children:[c.jsx("span",{className:"stream-event-dispatch-progress-role",children:(f=t.roleId)==null?void 0:f.toUpperCase()}),t.progressType==="thinking"&&c.jsxs("span",{className:"stream-event-dispatch-progress-status",children:["thinking",l?"...":""]}),t.progressType==="tool"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"stream-event-tool-badge",children:t.toolName}),t.toolSummary&&c.jsx("span",{className:"stream-event-tool-path",children:t.toolSummary})]}),t.progressType==="text"&&t.text&&c.jsx("span",{className:"stream-event-dispatch-progress-status",children:"responding..."}),t.progressType==="done"&&c.jsx("span",{className:"stream-event-dispatch-progress-done",children:"done"}),t.progressType==="error"&&c.jsx("span",{className:"stream-event-dispatch-progress-error",children:"error"})]});default:return null}}function Pj({events:t,isStreaming:l}){const[r,i]=j.useState(!1);if(t.length===0)return null;const o=Jj(t);if(o.length===0)return null;const u=t.filter(v=>v.type==="thinking").length,f=t.filter(v=>v.type==="tool"),m=t.filter(v=>v.type==="dispatch"||v.type==="dispatch:progress"),x=t.filter(v=>v.type==="turn").reduce((v,b)=>Math.max(v,b.turn??0),0),h=[];if(u>0&&h.push("thinking"),f.length>0){const v=[...new Set(f.map(b=>b.toolName))];v.length<=3?h.push(v.join(", ")):h.push(`${f.length} tool calls`)}m.length>0&&h.push(`${m.length} dispatch`),x>1&&h.push(`${x} turns`);const y=h.join(" · "),g=!r;return c.jsxs("div",{className:"stream-activity-log",children:[c.jsxs("div",{className:"stream-activity-header",onClick:()=>i(!r),children:[l&&c.jsx("span",{className:"stream-activity-pulse"}),c.jsxs("span",{className:"stream-activity-summary",children:[r?"▸":"▾"," ",y,l?"...":""]})]}),g&&c.jsx("div",{className:"stream-activity-events",children:o.map((v,b)=>c.jsx(Wj,{event:v,isStreaming:l&&b===o.length-1},b))})]})}function eE({message:t,roleId:l,roleColor:r}){var h;const i=t.from==="ceo",o=t.type==="system",u=t.status==="streaming";if(o)return c.jsx("div",{className:"flex justify-center my-2",children:c.jsx("div",{className:"text-[10px] text-[var(--terminal-text-muted)] bg-[var(--terminal-inline-bg)] px-3 py-1 rounded-full",children:t.content})});if(i)return c.jsx("div",{className:"flex justify-end mb-3",children:c.jsxs("div",{className:"max-w-[85%]",children:[c.jsx("div",{className:"text-[10px] text-[var(--terminal-text-muted)] text-right mb-1",children:"CEO"}),c.jsxs("div",{className:"bg-[var(--terminal-surface-light)] rounded-xl rounded-tr-sm px-4 py-2.5 text-sm text-[var(--terminal-text)] leading-relaxed",children:[t.type==="directive"&&c.jsx("span",{className:"text-amber-400 text-[10px] font-bold mr-1.5",children:"DO"}),t.content]})]})});const f=(((h=t.streamEvents)==null?void 0:h.length)??0)>0,m=!!t.thinking,x=m&&!t.content&&u&&!f;return c.jsxs("div",{className:"flex gap-2.5 mb-3",children:[c.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center text-sm shrink-0 mt-5",style:{background:`${r}33`},children:Zj[l]??"👤"}),c.jsxs("div",{className:"max-w-[85%] min-w-0",children:[c.jsx("div",{className:"text-[10px] text-[var(--terminal-text-muted)] mb-1",children:l.toUpperCase()}),f&&c.jsx(Pj,{events:t.streamEvents,isStreaming:u}),m&&!f&&c.jsxs("details",{open:x,className:"mb-1",children:[c.jsxs("summary",{className:"text-[10px] text-purple-400/70 cursor-pointer select-none flex items-center gap-1",children:[x&&c.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-purple-400 animate-pulse"}),"thinking",x?"...":` (${t.thinking.length} chars)`]}),c.jsx("div",{className:"text-[11px] text-[var(--terminal-text-muted)] leading-relaxed mt-1 pl-2 border-l border-purple-400/20 max-h-32 overflow-y-auto",children:t.thinking.slice(-500)})]}),c.jsxs("div",{className:"rounded-xl rounded-tl-sm px-4 py-2.5 text-sm text-[var(--terminal-text)] leading-relaxed",style:{borderLeft:`3px solid ${r}`,background:"var(--terminal-surface)"},children:[t.content?c.jsx(Gj,{content:t.content,streaming:u}):u&&!m?c.jsx("span",{className:"inline-block w-2 h-4 bg-[var(--terminal-text-secondary)] animate-pulse"}):u&&m?c.jsx("span",{className:"text-[11px] text-purple-400/50 italic",children:"analyzing..."}):null,u&&t.content&&c.jsx("span",{className:"inline-block w-1.5 h-3.5 bg-[var(--terminal-text-secondary)] animate-pulse ml-0.5 align-middle"})]}),t.status==="error"&&c.jsx("div",{className:"text-[10px] text-red-400 mt-1",children:"Error occurred"})]})]})}function tE({messages:t,roleId:l,roleColor:r}){var o;const i=j.useRef(null);return j.useEffect(()=>{var u;(u=i.current)==null||u.scrollIntoView({behavior:"smooth"})},[t,(o=t[t.length-1])==null?void 0:o.content]),t.length===0?c.jsxs("div",{className:"flex-1 flex items-center justify-center text-[var(--terminal-text-muted)] text-sm",children:["Start a conversation with ",l.toUpperCase()]}):c.jsxs("div",{className:"flex-1 overflow-y-auto p-4 terminal-scrollbar",children:[t.map(u=>c.jsx(eE,{message:u,roleId:l,roleColor:r},u.id)),c.jsx("div",{ref:i})]})}function nE({mode:t,onModeChange:l,onSend:r,disabled:i,disabledReason:o}){const[u,f]=j.useState(""),m=j.useRef(null);j.useEffect(()=>{const y=m.current;y&&(y.style.height="0",y.style.height=Math.min(y.scrollHeight,120)+"px")},[u]);const x=()=>{const y=u.trim();!y||i||(r(y),f(""))},h=y=>{y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),x())};return c.jsxs("div",{className:"border-t border-[var(--terminal-border)] p-3 shrink-0",children:[o&&c.jsx("div",{className:"text-[10px] text-amber-400/70 mb-2 text-center",children:o}),c.jsxs("div",{className:"flex items-end gap-2",children:[c.jsxs("div",{className:"flex rounded-lg overflow-hidden border border-[var(--terminal-border)] shrink-0",children:[c.jsx("button",{onClick:()=>l("talk"),className:`px-2.5 py-1.5 text-[11px] font-semibold cursor-pointer transition-colors ${t==="talk"?"bg-[var(--desk-wood)] text-white":"bg-[var(--terminal-inline-bg)] text-[var(--terminal-text-secondary)] hover:text-[var(--terminal-text)]"}`,children:"Talk"}),c.jsx("button",{onClick:()=>l("do"),className:`px-2.5 py-1.5 text-[11px] font-semibold cursor-pointer transition-colors ${t==="do"?"bg-amber-700 text-white":"bg-[var(--terminal-inline-bg)] text-[var(--terminal-text-secondary)] hover:text-[var(--terminal-text)]"}`,children:"Do"})]}),c.jsx("textarea",{ref:m,value:u,onChange:y=>f(y.target.value),onKeyDown:h,placeholder:i?"Waiting...":t==="talk"?"Ask something...":"Give a directive...",disabled:i,rows:1,className:"flex-1 bg-[var(--terminal-inline-bg)] border border-[var(--terminal-border)] rounded-lg px-3 py-2 text-sm text-[var(--terminal-text)] placeholder:text-[var(--terminal-text-muted)] resize-none focus:outline-none focus:border-[var(--terminal-border-hover)] disabled:opacity-40 terminal-scrollbar"}),c.jsx("button",{onClick:x,disabled:i||!u.trim(),className:"w-8 h-8 rounded-lg bg-[var(--terminal-surface-light)] text-[var(--terminal-text-secondary)] flex items-center justify-center shrink-0 cursor-pointer hover:bg-[var(--desk-wood)] hover:text-white disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:c.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:"M22 2L11 13"}),c.jsx("path",{d:"M22 2L15 22L11 13L2 9L22 2Z"})]})})]})]})}const lE={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C","data-analyst":"#0277BD"},nc={cto:"CTO",cbo:"CBO",pm:"PM",engineer:"Engineer",designer:"Designer",qa:"QA","data-analyst":"Data Analyst"};function s1(t){return new Date(t).toLocaleTimeString("ko-KR",{hour:"2-digit",minute:"2-digit"})}function aE({msg:t}){const l=lE[t.roleId]??"#888",r=nc[t.roleId]??t.roleId;if(t.type==="dispatch"){const i=nc[t.targetRoleId??""]??t.targetRoleId;return c.jsxs("div",{className:"flex items-start gap-2 px-3 py-1.5 hover:bg-white/[0.02]",children:[c.jsx("span",{className:"text-[10px] text-[var(--terminal-text-muted)] shrink-0 w-10 text-right mt-0.5",children:s1(t.ts)}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:`${l}22`,color:l},children:[r," → ",i]}),c.jsx("span",{className:"text-xs text-[var(--terminal-text-secondary)] ml-2",children:t.text})]})]})}return c.jsxs("div",{className:"flex items-start gap-2 px-3 py-1.5 hover:bg-white/[0.02]",children:[c.jsx("span",{className:"text-[10px] text-[var(--terminal-text-muted)] shrink-0 w-10 text-right mt-0.5",children:s1(t.ts)}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("span",{className:"text-[11px] font-semibold mr-1.5",style:{color:l},children:r}),t.type==="social"&&t.partnerId&&c.jsxs("span",{className:"text-[10px] text-[var(--terminal-text-muted)] mr-1.5",children:["→ ",nc[t.partnerId]??t.partnerId]}),c.jsx("span",{className:`text-xs ${t.type==="guilt"?"text-[var(--terminal-text-muted)] italic":"text-[var(--terminal-text-secondary)]"}`,children:t.text})]})]})}function rE({channel:t}){const l=j.useRef(null),r=j.useRef(null);return j.useEffect(()=>{var u;const i=r.current;if(!i)return;i.scrollHeight-i.scrollTop-i.clientHeight<80&&((u=l.current)==null||u.scrollIntoView({behavior:"smooth"}))},[t.messages.length]),t.messages.length===0?c.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-[var(--terminal-text-muted)] text-sm gap-2",children:[c.jsx("span",{className:"text-lg",children:"💬"}),c.jsx("span",{children:t.name}),c.jsx("span",{className:"text-[10px]",children:"Role conversations will appear here"})]}):c.jsxs("div",{ref:r,className:"flex-1 overflow-y-auto terminal-scrollbar py-2",children:[c.jsxs("div",{className:"px-3 py-2 mb-2 border-b border-[var(--terminal-border)]",children:[c.jsx("span",{className:"text-sm font-semibold text-[var(--terminal-text)]",children:t.name}),t.members.length>0&&c.jsx("span",{className:"text-[10px] text-[var(--terminal-text-muted)] ml-2",children:t.members.map(i=>nc[i]??i).join(", ")}),t.members.length===0&&c.jsx("span",{className:"text-[10px] text-[var(--terminal-text-muted)] ml-2",children:"all roles"})]}),t.messages.map(i=>c.jsx(aE,{msg:i},i.id)),c.jsx("div",{ref:l})]})}const od={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C"},iE=400,sE=800;function oE({sessions:t,activeSessionId:l,roles:r,streamingSessionId:i,width:o,onWidthChange:u,onSwitchSession:f,onCloseSession:m,onCreateSession:x,onClearEmpty:h,onCloseAll:y,onSendMessage:g,onModeChange:v,onCloseTerminal:b,chatChannels:k,activeChatChannelId:E,onSwitchChatChannel:N,onCreateChatChannel:T,onDeleteChatChannel:L}){const[$,K]=j.useState(!1),[V,M]=j.useState(!1),[J,Q]=j.useState(!1),[ie,D]=j.useState(""),U=E!=null,B=k==null?void 0:k.find(ce=>ce.id===E),[ne,te]=j.useState(!1),[F,z]=j.useState(!1),[q,Z]=j.useState(!1),re=j.useRef(0),A=j.useRef(0),_=j.useRef(null),Y=t.find(ce=>ce.id===l),C=i===l,de=t.filter(ce=>ce.messages.length===0).length,pe=j.useCallback(()=>{const ce=_.current;ce&&(z(ce.scrollLeft>0),Z(ce.scrollLeft+ce.clientWidth<ce.scrollWidth-1))},[]);j.useEffect(()=>{if(!l||!_.current)return;const ce=_.current.querySelector(`[data-session-id="${l}"]`);ce&&ce.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}),pe()},[l,t.length,pe]),j.useEffect(()=>{const ce=_.current;if(!ce)return;pe(),ce.addEventListener("scroll",pe);const ve=new ResizeObserver(pe);return ve.observe(ce),()=>{ce.removeEventListener("scroll",pe),ve.disconnect()}},[pe]);const xe=j.useCallback(ce=>{ce.preventDefault(),re.current=ce.clientX,A.current=o,te(!0);const ve=tt=>{const xt=re.current-tt.clientX,vt=Math.min(sE,Math.max(iE,A.current+xt));u==null||u(vt)},je=()=>{te(!1),document.removeEventListener("mousemove",ve),document.removeEventListener("mouseup",je)};document.addEventListener("mousemove",ve),document.addEventListener("mouseup",je)},[o,u]);return c.jsxs("div",{className:"shrink-0 bg-[var(--terminal-bg)] border-l border-[var(--terminal-border)] flex flex-col h-full relative",style:{width:o},children:[u&&c.jsx("div",{className:`terminal-resize-handle absolute top-0 left-0 w-1 h-full cursor-col-resize z-10 transition-colors ${ne?"bg-[var(--terminal-border-hover)]":"bg-transparent"}`,onMouseDown:xe}),c.jsxs("div",{className:"flex items-center bg-[var(--terminal-bg-deeper)] border-b border-[var(--terminal-border)] shrink-0",children:[c.jsxs("div",{className:"relative flex-1 min-w-0",children:[F&&c.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-6 bg-gradient-to-r from-[var(--terminal-bg-deeper)] to-transparent z-10 pointer-events-none"}),c.jsxs("div",{ref:_,className:"flex items-center overflow-x-auto terminal-tab-scroll gap-px px-1 py-1",children:[k==null?void 0:k.map(ce=>c.jsxs("button",{onClick:()=>{N==null||N(ce.id)},className:`flex items-center gap-1 px-2.5 py-1.5 text-[11px] rounded-t-lg shrink-0 cursor-pointer transition-colors group ${E===ce.id?"bg-[var(--terminal-bg)] text-[var(--terminal-text)]":"bg-[var(--terminal-inline-bg)] text-[var(--terminal-text-muted)] hover:text-[var(--terminal-text-secondary)] hover:bg-[var(--terminal-surface)]"}`,style:E===ce.id?{borderTop:"2px solid #4CAF50"}:void 0,children:[c.jsx("span",{className:"text-[10px]",children:"💬"}),c.jsx("span",{className:"truncate",children:ce.name}),!ce.isDefault&&c.jsx("span",{onClick:ve=>{ve.stopPropagation(),L==null||L(ce.id)},className:"ml-1 text-[var(--terminal-text-muted)] hover:text-[var(--terminal-text-secondary)] text-sm leading-none opacity-0 group-hover:opacity-100",children:"×"})]},ce.id)),k&&k.length>0&&t.length>0&&c.jsx("div",{className:"w-px h-4 bg-[var(--terminal-border)] shrink-0 mx-1"}),t.map(ce=>c.jsx(Xj,{roleId:ce.roleId,title:ce.title,roleColor:od[ce.roleId]??"#666",active:!U&&ce.id===l,onClick:()=>{N==null||N(null),f(ce.id)},onClose:ve=>{ve.stopPropagation(),m(ce.id)},"data-session-id":ce.id},ce.id))]}),q&&c.jsx("div",{className:"absolute right-0 top-0 bottom-0 w-6 bg-gradient-to-l from-[var(--terminal-bg-deeper)] to-transparent z-10 pointer-events-none"})]}),c.jsxs("div",{className:"relative shrink-0",children:[c.jsx("button",{onClick:()=>{K(!$),M(!1)},className:"w-7 h-7 flex items-center justify-center text-[var(--terminal-text-muted)] hover:text-[var(--terminal-text-secondary)] text-lg cursor-pointer",children:"+"}),$&&c.jsxs("div",{className:"absolute top-full right-0 mt-1 bg-[var(--terminal-surface)] border border-[var(--terminal-border)] rounded-lg shadow-xl z-50 py-1 min-w-[200px]",children:[T&&c.jsxs(c.Fragment,{children:[J?c.jsxs("div",{className:"px-3 py-2 flex items-center gap-1",children:[c.jsx("span",{className:"text-[10px] text-[var(--terminal-text-muted)]",children:"#"}),c.jsx("input",{autoFocus:!0,value:ie,onChange:ce=>D(ce.target.value),onKeyDown:ce=>{ce.key==="Enter"&&ie.trim()&&(T(ie.trim(),[]),D(""),Q(!1),K(!1)),ce.key==="Escape"&&(Q(!1),D(""))},placeholder:"channel name",className:"flex-1 bg-transparent text-xs text-[var(--terminal-text)] outline-none border-b border-[var(--terminal-border)]"})]}):c.jsxs("button",{onClick:()=>Q(!0),className:"w-full text-left px-3 py-2 text-xs text-[var(--terminal-text-secondary)] hover:bg-[var(--terminal-surface-light)] cursor-pointer flex items-center gap-2",children:[c.jsx("span",{className:"text-[10px]",children:"💬"}),"New Channel"]}),c.jsx("div",{className:"border-b border-[var(--terminal-border)] my-1"})]}),r.map(ce=>c.jsxs("button",{onClick:()=>{x(ce.id),N==null||N(null),K(!1)},className:"w-full text-left px-3 py-2 text-xs text-[var(--terminal-text-secondary)] hover:bg-[var(--terminal-surface-light)] cursor-pointer flex items-center gap-2",children:[c.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:od[ce.id]??"#666"}}),ce.id.toUpperCase()," — ",ce.name]},ce.id))]})]}),c.jsxs("div",{className:"relative shrink-0",children:[c.jsx("button",{onClick:()=>{M(!V),K(!1)},className:"w-7 h-7 flex items-center justify-center text-[var(--terminal-text-muted)] hover:text-[var(--terminal-text-secondary)] text-xs cursor-pointer tracking-tight",title:"Manage sessions",children:"···"}),V&&c.jsxs("div",{className:"absolute top-full right-0 mt-1 bg-[var(--terminal-surface)] border border-[var(--terminal-border)] rounded-lg shadow-xl z-50 py-1 min-w-[200px]",children:[c.jsxs("div",{className:"px-3 py-1.5 text-[10px] text-[var(--terminal-text-muted)] border-b border-[var(--terminal-border)]",children:[t.length," session",t.length!==1?"s":""]}),de>0&&h&&c.jsxs("button",{onClick:()=>{h(),M(!1)},className:"w-full text-left px-3 py-2 text-xs text-[var(--terminal-text-secondary)] hover:bg-[var(--terminal-surface-light)] cursor-pointer",children:["Clear empty sessions (",de,")"]}),t.length>0&&y&&c.jsx("button",{onClick:()=>{y(),M(!1)},className:"w-full text-left px-3 py-2 text-xs text-[#E57373] hover:bg-[var(--terminal-surface-light)] cursor-pointer",children:"Close all sessions"}),t.length===0&&c.jsx("div",{className:"px-3 py-2 text-xs text-[var(--terminal-text-muted)]",children:"No sessions"})]})]}),c.jsx("button",{onClick:b,className:"px-2 py-1 text-[var(--terminal-text-muted)] hover:text-[var(--terminal-text-secondary)] text-sm cursor-pointer shrink-0",children:"×"})]}),U&&B?c.jsx(rE,{channel:B}):Y?c.jsxs(c.Fragment,{children:[c.jsx(tE,{messages:Y.messages,roleId:Y.roleId,roleColor:od[Y.roleId]??"#666"}),c.jsx(nE,{mode:Y.mode,onModeChange:ce=>v(Y.id,ce),onSend:ce=>g(Y.id,ce,Y.mode),disabled:C,disabledReason:C?`${Y.roleId.toUpperCase()} is responding...`:void 0})]}):c.jsx("div",{className:"flex-1 flex items-center justify-center text-[var(--terminal-text-muted)] text-sm",children:"No active session. Click [+] to start."})]})}function cE(){const t=j.useRef(null),l=j.useCallback(()=>{var i;(i=t.current)==null||i.abort(),t.current=null},[]);return{sendMessage:j.useCallback((i,o,u,f)=>{l();const m=new AbortController;return t.current=m,fetch(`/api/exec/session/${i}/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:o,mode:u}),signal:m.signal}).then(async x=>{var v,b,k,E,N;if(!x.ok||!x.body){f.onError("Failed to connect");return}const h=x.body.getReader(),y=new TextDecoder;let g="";for(;;){const{done:T,value:L}=await h.read();if(T)break;g+=y.decode(L,{stream:!0});const $=g.split(`
82
+ `);g=$.pop()??"";let K="";for(let V=0;V<$.length;V++){const M=$[V];if(M.startsWith("event: ")){K=M.slice(7).trim();continue}if(M.startsWith("data: ")){let J;try{J=JSON.parse(M.slice(6))}catch{K="";continue}switch(K){case"thinking":J.text&&((v=f.onThinking)==null||v.call(f,J.text));break;case"output":J.text&&f.onText(J.text);break;case"tool":(b=f.onToolUse)==null||b.call(f,J.name,J.input);break;case"dispatch":(k=f.onDispatch)==null||k.call(f,J.roleId,J.task);break;case"dispatch:progress":(E=f.onDispatchProgress)==null||E.call(f,J.roleId,J.type,J);break;case"turn":(N=f.onTurn)==null||N.call(f,J.turn);break;case"done":f.onDone(J);break;case"error":f.onError(J.message??"Unknown error");break;default:J.text&&f.onText(J.text);break}K=""}}}}).catch(x=>{x.name!=="AbortError"&&f.onError(x.message)}),{abort:l}},[l]),abort:l}}const oh="tycono-appearances",fc="tycono-theme";(()=>{try{for(const[t,l]of[["the-company-appearances",oh],["the-company-theme",fc]]){const r=localStorage.getItem(t);r&&!localStorage.getItem(l)&&(localStorage.setItem(l,r),localStorage.removeItem(t))}}catch{}})();function o1(){try{const t=localStorage.getItem(oh);return t?JSON.parse(t):{}}catch{return{}}}function cd(t){localStorage.setItem(oh,JSON.stringify(t))}function c1(){try{const t=localStorage.getItem(fc);if(t&&t in Na)return t}catch{}return"default"}function uE(t){var i;const l=(i=Na[t])==null?void 0:i.vars;if(!l)return;const r=document.documentElement;for(const[o,u]of Object.entries(l))r.style.setProperty(o,u)}const ud={mode:"auto",intervalSec:18,dailyBudgetUsd:1},Dd="tycono-speech-settings";function fE(){try{const t=localStorage.getItem(Dd);return t?{...ud,...JSON.parse(t)}:ud}catch{return ud}}function dE(){const[t,l]=j.useState(o1),[r,i]=j.useState(c1),[o,u]=j.useState(fE),f=j.useRef(!1);j.useEffect(()=>{f.current||(f.current=!0,Ce.getPreferences().then(v=>{const b=Object.keys(v.appearances??{}).length>0||v.theme!=="default";if(v.speech&&(u(k=>({...k,...v.speech})),localStorage.setItem(Dd,JSON.stringify(v.speech))),b){const k=v.appearances;l(k),cd(k),v.theme&&v.theme in Na&&(i(v.theme),localStorage.setItem(fc,v.theme))}else{const k=o1(),E=c1();(Object.keys(k).length>0||E!=="default")&&Ce.updatePreferences({appearances:k,theme:E}).catch(()=>{})}}).catch(()=>{}))},[]),j.useEffect(()=>{uE(r)},[r]);const m=j.useCallback(v=>t[v]??sh(v),[t]),x=j.useCallback((v,b)=>{l(k=>{const E={...k,[v]:b};return cd(E),Ce.updatePreferences({appearances:E}).catch(()=>{}),E})},[]),h=j.useCallback(v=>{l(b=>{const k={...b};return delete k[v],cd(k),Ce.updatePreferences({appearances:k}).catch(()=>{}),k})},[]),y=j.useCallback(v=>{i(v),localStorage.setItem(fc,v),Ce.updatePreferences({theme:v}).catch(()=>{})},[]),g=j.useCallback(v=>{u(b=>{const k={...b,...v};return localStorage.setItem(Dd,JSON.stringify(k)),Ce.updatePreferences({speech:k}).catch(()=>{}),k})},[]);return{appearances:t,getAppearance:m,setAppearance:x,resetAppearance:h,theme:r,setTheme:y,speechSettings:o,setSpeechSettings:g}}const hE=3e4;function mE(){var b;const[t,l]=j.useState(null),[r,i]=j.useState("synced"),[o,u]=j.useState([]),f=j.useRef(null),m=j.useCallback(async()=>{try{const k=await Ce.getSaveStatus();l(k),k.noGit?i("no-git"):i(E=>E==="saving"?E:k.dirty?"dirty":"synced")}catch{i("error")}},[]);j.useEffect(()=>(m(),f.current=setInterval(m,hE),()=>{f.current&&clearInterval(f.current)}),[m]);const x=j.useCallback(async k=>{i("saving");try{const E=await Ce.save(k);return await m(),E}catch(E){throw i("error"),E}},[m]),h=j.useCallback(async()=>{try{const k=await Ce.getSaveHistory(20);u(k)}catch{}},[]),y=j.useCallback(async k=>{i("saving");try{await Ce.restoreSave(k),await m()}catch(E){throw i("error"),E}},[m]),g=t?t.modified.length+t.untracked.length:0,v=((b=t==null?void 0:t.lastCommit)==null?void 0:b.date)??null;return{state:r,dirtyCount:g,lastSaved:v,status:t,save:x,history:o,loadHistory:h,restore:y,refresh:m}}const u1={cto:["이 아키텍처 기술 부채 좀 줄여야 하는데...","over-engineering 하지 말자. 최소한만.","성능 프로파일링 결과가 좀 신경쓰이네.","시스템 설계 리뷰 해야지.","이거 추상화 한 층만 걷어내면 될 텐데.","모니터링 대시보드 한번 볼까.","코드 리뷰 큐 확인해봐야겠다.","이 모듈 의존성 정리할 때 됐는데."],cbo:["경쟁사 새 기능 나왔다던데... 분석해봐야겠다.","이번 달 수익 지표 정리해야지.","시장 트렌드 리포트 업데이트 할 때 됐는데.","가격 전략 벤치마킹 좀 해볼까.","ROI 계산 다시 해봐야겠어.","경쟁사 GitHub 스타 추이 체크해볼까.","런칭 타이밍 고민 중...","포지셔닝 전략 다시 점검해봐야겠다."],pm:["이 기능 정말 사용자가 원하는 걸까?","백로그 정리 좀 해야 하는데...","MVP 범위가 자꾸 늘어나고 있어.","사용자 피드백 분석 중...","우선순위 재조정이 필요할 것 같은데.","스코프 크리프 경계해야지.","로드맵 타임라인 맞을까...","태스크 의존성 다시 확인해봐야겠다."],engineer:["이 코드 리팩토링 하고 싶다...","테스트 커버리지가 좀 낮은 것 같은데.","Working code first, perfect code later.","PR 리뷰 기다리는 중...","이 버그 원인이 뭘까...","빌드 깨진 거 아닌가?","타입 에러 하나 잡아야 하는데.","npm audit 한번 돌려볼까."],designer:["이 UI 흐름 좀 어색한데...","사용성 먼저, 예쁜 건 그 다음.","디자인 시스템 컴포넌트 정리해야지.","빠르게 두 개 만들어서 비교하자.","접근성 체크리스트 돌려봐야겠다.","이 인터랙션 프로토타입 해볼까.","컬러 팔레트 다시 보자...","여백이 좀 답답한 것 같은데."],qa:['"동작한다"와 "정확하다"는 다른 거야.',"엣지 케이스 시나리오 정리 중...","회귀 테스트 스위트 돌려봐야겠다.","이 부분 자동화 테스트로 바꿀 수 있을 텐데.","릴리즈 전 체크리스트 확인해야지.","재현 가능한 버그 리포트가 중요해.","크로스 브라우저 테스트 돌려봐야겠다.","성능 회귀 없는지 확인해야 하는데."],"data-analyst":["데이터 파이프라인 상태 체크 중...","이상치 탐지 패턴이 재미있네.","대시보드 지표 업데이트 해야지.","상관관계가 인과관계는 아닌데...","SQL 쿼리 최적화 여지가 있을 것 같은데.","데이터 품질 점검 시간이다."]},f1={cto:["팀한테 일을 더 줘야 하나...","아키텍처 부채 정리할 시간인가.","기술 로드맵 재검토 해야겠다.","좀 한가한데... 뭔가 놓치고 있나?"],cbo:["시장 분석 업데이트할 시간인데...","매출 리포트 준비해야 하는데 지시가 없네.","경쟁사 동향 체크나 하자.","비즈니스 쪽은 조용하네..."],pm:["백로그가 좀 고요한데... 기획할 게 없나?","스프린트 계획 안 잡힌 지 좀 됐는데.","사용자 피드백 쌓여있을 텐데 확인해야 하는데...","PRD 작성할 게 없다니... 이상한데."],engineer:["오늘 할 일이 없네... 코드 리뷰라도 할까.","태스크 큐가 비어있다. 리팩토링이나 하자.","혹시 내가 뭘 놓치고 있나?","커밋 로그 정리나 해야겠다."],designer:["디자인 요청이 안 오네. 자체적으로 뭐 개선할까.","UI 감사(audit) 한번 돌려볼까...","포트폴리오 정리나 해야겠다.","컴포넌트 라이브러리 정비할까."],qa:["테스트할 빌드가 없네. 자동화 스크립트 보강이나 할까.","조용하다... 버그가 없는 건가, 못 찾은 건가.","기존 테스트 시나리오 점검이나 하자.","테스트 커버리지 리포트 갱신해볼까."],"data-analyst":["분석 요청이 안 들어오네...","데이터 웨어하우스 정리나 할까.","과거 리포트 검증이나 해봐야겠다."]},pE=[{id:"sup-check-1",relation:"superior-subordinate",minFamiliarity:0,topic:"progress",turns:[{speaker:"A",text:"진행 상황 어때?"},{speaker:"B",text:"순조롭습니다. 곧 마무리 될 것 같아요."},{speaker:"A",text:"좋아, 끝나면 알려줘."}]},{id:"sup-check-2",relation:"superior-subordinate",minFamiliarity:20,topic:"progress",turns:[{speaker:"A",text:"오늘 뭐 하고 있어?"},{speaker:"B",text:"어제 하던 거 마저 정리 중입니다."}]},{id:"sub-report-1",relation:"superior-subordinate",minFamiliarity:10,topic:"report",turns:[{speaker:"B",text:"아까 건 끝났습니다."},{speaker:"A",text:"수고했어. 결과 공유해줄 수 있어?"},{speaker:"B",text:"네, 문서 업데이트 해놨습니다."}]},{id:"peer-tech-1",relation:"peer",minFamiliarity:20,topic:"tech",turns:[{speaker:"A",text:"이 부분 설계 어떻게 생각해?"},{speaker:"B",text:"좀 더 단순하게 갈 수 있을 것 같은데."},{speaker:"A",text:"그래? 한번 같이 봐볼까."}]},{id:"peer-tech-2",relation:"peer",minFamiliarity:30,topic:"tech",turns:[{speaker:"A",text:"이 라이브러리 써본 적 있어?"},{speaker:"B",text:"어, 저번 프로젝트에서 써봤는데 괜찮았어."}]},{id:"close-feedback-1",relation:"peer",minFamiliarity:60,topic:"feedback",turns:[{speaker:"A",text:"솔직히 말해도 돼?"},{speaker:"B",text:"당연하지, 말해봐."},{speaker:"A",text:"이번 건 좀 아쉬운 것 같아. 다시 보자."},{speaker:"B",text:"...알았어. 피드백 고마워."}]},{id:"clevel-sync-1",relation:"c-level",minFamiliarity:10,topic:"strategy",turns:[{speaker:"A",text:"로드맵이랑 비즈니스 타임라인 싱크 맞춰야 할 것 같은데."},{speaker:"B",text:"동감이야. 내일까지 정리해서 공유할게."}]},{id:"clevel-sync-2",relation:"c-level",minFamiliarity:30,topic:"strategy",turns:[{speaker:"A",text:"경쟁사 동향 공유할 게 있는데."},{speaker:"B",text:"좋아, 나도 기술 쪽 업데이트 있어."},{speaker:"A",text:"자리 잡히면 같이 정리하자."}]},{id:"casual-coffee",relation:"any",minFamiliarity:30,topic:"casual",turns:[{speaker:"A",text:"커피 한잔 할까?"},{speaker:"B",text:"좋지. 오늘 좀 길어질 것 같거든."}]},{id:"casual-overtime",relation:"any",minFamiliarity:25,topic:"casual",turns:[{speaker:"A",text:"오늘 야근인가..."},{speaker:"B",text:"같이 고생하네. 힘내자."}]},{id:"casual-lunch",relation:"any",minFamiliarity:35,topic:"casual",turns:[{speaker:"A",text:"점심 뭐 먹을까?"},{speaker:"B",text:"아무거나. 요즘 맨날 같은 거 먹는 것 같아."}]},{id:"casual-weekend",relation:"any",minFamiliarity:40,topic:"casual",turns:[{speaker:"A",text:"주말에 뭐 했어?"},{speaker:"B",text:"그냥 쉬었어. 너무 피곤했거든."}]},{id:"bestie-1",relation:"any",minFamiliarity:80,topic:"trust",turns:[{speaker:"A",text:"이번 방향 좀 고민되는데..."},{speaker:"B",text:"뭐가 걸려? 솔직하게 말해봐."},{speaker:"A",text:"고마워. 너한테는 말할 수 있어서 좋다."}]}],xE=18e3,Io=6e3,d1=2500,gE=30*6e4,Py="tycono:relationships",h1=.5;function yE(){try{const t=localStorage.getItem(Py);return t?JSON.parse(t):[]}catch{return[]}}function vE(t){localStorage.setItem(Py,JSON.stringify(t))}function Ir(t,l,r){const[i,o]=l<r?[l,r]:[r,l];let u=t.find(f=>f.roleA===i&&f.roleB===o);return u||(u={roleA:i,roleB:o,dispatches:0,wavesTogether:0,conversations:0,familiarity:0,lastInteraction:new Date().toISOString()},t.push(u)),u}function Yr(t){return Math.min(100,t.dispatches*5+t.wavesTogether*10+t.conversations*2)}function Yo(t){return t[Math.floor(Math.random()*t.length)]}function bE(t,l,r){const i=r.find(m=>m.id===t),o=r.find(m=>m.id===l);if(!i||!o)return null;const u=i.level==="c-level",f=o.level==="c-level";return u&&f?"c-level":i.reportsTo===l||o.reportsTo===t?"superior-subordinate":(i.reportsTo===o.reportsTo,"peer")}function wE(t,l){return t.relation==="any"?!0:t.relation===l}function kE({roles:t,roleStatuses:l,activeExecs:r,getStandupSpeech:i,onChat:o,speechSettings:u,engineType:f}){const[m,x]=j.useState(new Map),[h,y]=j.useState(yE),v=((u==null?void 0:u.mode)==="auto"?f==="claude-cli"?"llm":"template":(u==null?void 0:u.mode)??"template")==="llm",b=((u==null?void 0:u.intervalSec)??xE/1e3)*1e3,k=j.useRef({}),E=j.useRef(!1),N=j.useRef(null),T=j.useRef(t),L=j.useRef(l),$=j.useRef(r),K=j.useRef(i),V=j.useRef(h),M=j.useRef(o),J=j.useRef(v);T.current=t,L.current=l,$.current=r,K.current=i,V.current=h,M.current=o,J.current=v,j.useEffect(()=>{const F=Date.now();for(const[z,q]of Object.entries(l))q==="working"&&(k.current[z]=F)},[l]),j.useEffect(()=>{vE(h)},[h]);const Q=j.useCallback(F=>{const z=L.current[F],q=$.current.find(Y=>Y.roleId===F);if(z==="working"&&(q!=null&&q.task))return null;const Z=K.current(F);if(Z&&Math.random()<.3)return{text:Z,type:"work",ts:Date.now()};const re=Date.now(),A=k.current[F]??0;if(re-A>gE&&Math.random()<.5){const Y=f1[F]??f1.engineer;return{text:Yo(Y),type:"guilt",ts:re}}const _=u1[F]??u1.engineer;return{text:Yo(_),type:"personality",ts:re}},[]),ie=j.useCallback(F=>{if(N.current)return!1;const z=F.filter(ve=>L.current[ve.id]!=="working");if(z.length<2)return!1;const q=[...z].sort(()=>Math.random()-.5),Z=q[0],re=q[1],A=bE(Z.id,re.id,F);if(!A)return!1;const _=Ir(V.current,Z.id,re.id),Y=Yr(_),C=pE.filter(ve=>wE(ve,A)&&Y>=ve.minFamiliarity);if(C.length===0)return!1;const de=Yo(C);let pe=Z.id,xe=re.id;de.relation==="superior-subordinate"&&(re.reportsTo===Z.id||Z.level==="c-level"?(pe=Z.id,xe=re.id):(pe=re.id,xe=Z.id)),N.current={templateId:de.id,roleA:pe,roleB:xe,turnIdx:0,timer:null};const ce=ve=>{var vt;if(!N.current||ve>=de.turns.length){N.current=null,y(Lt=>{const _e=[...Lt],bt=Ir(_e,pe,xe);return bt.conversations++,bt.familiarity=Yr(bt),bt.lastInteraction=new Date().toISOString(),_e}),setTimeout(()=>{x(Lt=>{const _e=new Map(Lt);return _e.delete(pe),_e.delete(xe),_e})},Io);return}const je=de.turns[ve],tt=je.speaker==="A"?pe:xe,xt=je.speaker==="A"?xe:pe;(vt=M.current)==null||vt.call(M,{ts:Date.now(),roleId:tt,text:je.text,type:"social",partnerId:xt}),x(Lt=>{const _e=new Map(Lt);if(_e.set(tt,{text:je.text,type:"social",partnerId:xt,ts:Date.now()}),ve>0){const bt=de.turns[ve-1].speaker==="A"?pe:xe;bt!==tt&&_e.delete(bt)}return _e}),N.current.turnIdx=ve,N.current.timer=setTimeout(()=>ce(ve+1),d1)};return ce(0),!0},[]),D=j.useCallback(async F=>{var z;if(!E.current){E.current=!0;try{const Z=V.current.filter(Y=>Y.roleA===F.id||Y.roleB===F.id).slice(0,3).map(Y=>{var C;return{partnerId:Y.roleA===F.id?Y.roleB:Y.roleA,partnerName:((C=T.current.find(de=>de.id===(Y.roleA===F.id?Y.roleB:Y.roleA)))==null?void 0:C.name)??"",familiarity:Y.familiarity}}),re=await Ce.generateSpeech(F.id,void 0,Z);if(!re.speech)return;const A=Date.now(),_={text:re.speech,type:"personality",ts:A};(z=M.current)==null||z.call(M,{ts:A,roleId:F.id,text:re.speech,type:"monologue"}),x(Y=>{const C=new Map(Y);return C.set(F.id,_),C}),setTimeout(()=>{x(Y=>{const C=new Map(Y),de=C.get(F.id);return de&&de.ts===A&&C.delete(F.id),C})},Io)}catch{}finally{E.current=!1}}},[]),U=j.useCallback(async(F,z,q)=>{if(E.current||N.current)return!1;E.current=!0;try{const Z=await Ce.generateConversation(F.id,z.id,q);if(!Z.turns||Z.turns.length===0)return!1;const re=F.id,A=z.id;N.current={templateId:"llm-generated",roleA:re,roleB:A,turnIdx:0,timer:null};const _=Y=>{var xe;if(!N.current||Y>=Z.turns.length){N.current=null,y(ce=>{const ve=[...ce],je=Ir(ve,re,A);return je.conversations++,je.familiarity=Yr(je),je.lastInteraction=new Date().toISOString(),ve}),setTimeout(()=>{x(ce=>{const ve=new Map(ce);return ve.delete(re),ve.delete(A),ve})},Io);return}const C=Z.turns[Y],de=C.speaker==="A"?re:A,pe=C.speaker==="A"?A:re;(xe=M.current)==null||xe.call(M,{ts:Date.now(),roleId:de,text:C.text,type:"social",partnerId:pe}),x(ce=>{const ve=new Map(ce);if(ve.set(de,{text:C.text,type:"social",partnerId:pe,ts:Date.now()}),Y>0){const je=Z.turns[Y-1].speaker==="A"?re:A;je!==de&&ve.delete(je)}return ve}),N.current.turnIdx=Y,N.current.timer=setTimeout(()=>_(Y+1),d1)};return _(0),!0}catch{return!1}finally{E.current=!1}},[]);j.useEffect(()=>{const F=setInterval(()=>{var A;const z=T.current;if(z.length===0||N.current)return;if(Math.random()<.35){if(J.current&&Math.random()<h1){const _=z.filter(Y=>L.current[Y.id]!=="working");if(_.length>=2){const Y=[..._].sort(()=>Math.random()-.5),C=Ir(V.current,Y[0].id,Y[1].id);U(Y[0],Y[1],Yr(C));return}}if(ie(z))return}const q=z.filter(_=>L.current[_.id]!=="working");if(q.length===0)return;const Z=Yo(q);if(J.current&&Math.random()<h1){D(Z);return}const re=Q(Z.id);re&&((re.type==="personality"||re.type==="guilt")&&((A=M.current)==null||A.call(M,{ts:re.ts,roleId:Z.id,text:re.text,type:re.type==="personality"?"monologue":"guilt"})),x(_=>{const Y=new Map(_);return Y.set(Z.id,re),Y}),setTimeout(()=>{x(_=>{const Y=new Map(_),C=Y.get(Z.id);return C&&C.ts===re.ts&&Y.delete(Z.id),Y})},Io))},b);return()=>{var z;clearInterval(F),(z=N.current)!=null&&z.timer&&clearTimeout(N.current.timer)}},[Q,ie,D,U,b]);const B=j.useCallback(F=>{const z=m.get(F);return(z==null?void 0:z.text)??""},[m]),ne=j.useCallback((F,z)=>{y(q=>{const Z=[...q],re=Ir(Z,F,z);return re.dispatches++,re.familiarity=Yr(re),re.lastInteraction=new Date().toISOString(),Z})},[]),te=j.useCallback(F=>{F.length<2||y(z=>{const q=[...z];for(let Z=0;Z<F.length;Z++)for(let re=Z+1;re<F.length;re++){const A=Ir(q,F[Z],F[re]);A.wavesTogether++,A.familiarity=Yr(A),A.lastInteraction=new Date().toISOString()}return q})},[]);return{speeches:m,getSpeech:B,relationships:h,notifyDispatch:ne,notifyWave:te}}const e0="tycono:office-chat";let SE=0;function jE(){return`chat-${Date.now()}-${++SE}`}function EE(){try{const t=localStorage.getItem(e0);if(t){const l=JSON.parse(t);return l.find(r=>r.id==="office")||l.unshift(m1()),l}}catch{}return[m1()]}function m1(){return{id:"office",name:"#office",members:[],isDefault:!0,messages:[]}}function CE(t){const l=t.map(r=>({...r,messages:r.messages.slice(-200)}));localStorage.setItem(e0,JSON.stringify(l))}function NE(){const[t,l]=j.useState(EE),[r,i]=j.useState(null);j.useEffect(()=>{CE(t)},[t]);const o=j.useCallback(x=>{const h={...x,id:jE()};l(y=>y.map(g=>g.id==="office"?{...g,messages:[...g.messages,h].slice(-200)}:g.members.length>0&&(g.members.includes(x.roleId)||x.partnerId&&g.members.includes(x.partnerId)||x.targetRoleId&&g.members.includes(x.targetRoleId))?{...g,messages:[...g.messages,h].slice(-200)}:g))},[]),u=j.useCallback((x,h)=>{const y=`ch-${Date.now()}`,g={id:y,name:x.startsWith("#")?x:`#${x}`,members:h,isDefault:!1,messages:[]};l(v=>[...v,g]),i(y)},[]),f=j.useCallback(x=>{l(h=>h.filter(y=>y.id!==x||y.isDefault)),i(h=>h===x?"office":h)},[]),m=j.useCallback((x,h)=>{l(y=>y.map(g=>g.id===x&&!g.isDefault?{...g,members:h}:g))},[]);return{channels:t,activeChannelId:r,setActiveChannelId:i,pushMessage:o,createChannel:u,deleteChannel:f,updateMembers:m}}function Vo({type:t,className:l}){const r=j.useRef(null),i=e5(t);return j.useEffect(()=>{const o=r.current;if(!o||!i)return;const u=o.getContext("2d");u&&n5(u,i)},[t,i]),i?c.jsx("canvas",{ref:r,width:i.canvasWidth,height:i.canvasHeight,className:l,style:{imageRendering:"pixelated",display:"block"}}):null}const t0=[[1,8],[3,5],[8,1],[5,3]],AE=[[1,4],[2,3],[4,1],[3,2]];function Xo(t){const l=t===1||t===3?-1:0,r=t0[t],i=t<2?[0,1]:[1,0],o=l;return[{x:1,y:17,w:10,h:2,c:"#100A06",a:.18},{x:r[0],y:13,w:3,h:4,c:"$pants"},{x:r[1],y:13,w:3,h:4,c:"$pants"},{x:r[0]+1,y:13,w:1,h:3,c:"darken($pants, 25)",a:.2},{x:r[1]+1,y:13,w:1,h:3,c:"darken($pants, 25)",a:.2},{x:r[0],y:16,w:3,h:2,c:"$shoes"},{x:r[1],y:16,w:3,h:2,c:"$shoes"},{x:r[0],y:16,w:3,h:1,c:"lighten($shoes, 25)",a:.4},{x:r[1],y:16,w:3,h:1,c:"lighten($shoes, 25)",a:.4},{x:1,y:o+8,w:10,h:6,c:"$shirt"},{x:2,y:o+8,w:8,h:1,c:"lighten($shirt, 20)",a:.35},{x:1,y:o+8,w:1,h:5,c:"darken($shirt, 30)",a:.2},{x:10,y:o+8,w:1,h:5,c:"darken($shirt, 30)",a:.2},{x:-1,y:o+9+i[0],w:3,h:4-i[0],c:"$shirt"},{x:10,y:o+9+i[1],w:3,h:4-i[1],c:"$shirt"},{x:-1,y:o+12,w:2,h:1,c:"$skin"},{x:11,y:o+12,w:2,h:1,c:"$skin"},{x:4,y:o+6,w:4,h:3,c:"$skin"},{x:1,y:o+0,w:10,h:7,c:"$skin"},{x:3,y:o+3,w:2,h:2,c:"#1A1A2E"},{x:7,y:o+3,w:2,h:2,c:"#1A1A2E"},{x:3,y:o+3,w:1,h:1,c:"#FFF",a:.4},{x:7,y:o+3,w:1,h:1,c:"#FFF",a:.4},{x:5,y:o+6,w:2,h:1,c:"darken($skin, 25)",a:.35},{x:0,y:o+3,w:1,h:1,c:"$skin"},{x:11,y:o+3,w:1,h:1,c:"$skin"},{x:1,y:o+0,w:10,h:3,c:"$hair"},{x:0,y:o+1,w:2,h:3,c:"$hair"},{x:10,y:o+1,w:2,h:3,c:"$hair"},{x:2,y:o+0,w:8,h:1,c:"lighten($hair, 25)",a:.3}]}function Go(t){const l=t===1||t===3?-1:0,r=t0[t],i=t<2?[0,1]:[1,0],o=l;return[{x:1,y:17,w:10,h:2,c:"#100A06",a:.18},{x:r[0],y:13,w:3,h:4,c:"$pants"},{x:r[1],y:13,w:3,h:4,c:"$pants"},{x:r[0],y:16,w:3,h:2,c:"$shoes"},{x:r[1],y:16,w:3,h:2,c:"$shoes"},{x:1,y:o+8,w:10,h:6,c:"$shirt"},{x:2,y:o+8,w:8,h:1,c:"lighten($shirt, 20)",a:.2},{x:5,y:o+10,w:2,h:3,c:"darken($shirt, 30)",a:.12},{x:-1,y:o+9+i[0],w:3,h:4-i[0],c:"$shirt"},{x:10,y:o+9+i[1],w:3,h:4-i[1],c:"$shirt"},{x:4,y:o+6,w:4,h:3,c:"$skin"},{x:1,y:o+0,w:10,h:7,c:"$skin"},{x:1,y:o+0,w:10,h:6,c:"$hair"},{x:0,y:o+1,w:2,h:5,c:"$hair"},{x:10,y:o+1,w:2,h:5,c:"$hair"},{x:2,y:o+0,w:8,h:1,c:"lighten($hair, 25)",a:.3},{x:0,y:o+4,w:1,h:1,c:"$skin",a:.6},{x:11,y:o+4,w:1,h:1,c:"$skin",a:.6}]}function Ea(t,l){const r=t===1||t===3?-1:0,i=AE[t],o=r,u=t%2===0?1:0;return l?[{x:1,y:17,w:10,h:2,c:"#100A06",a:.18},{x:i[0],y:13,w:3,h:4,c:"$pants"},{x:i[1],y:13,w:3,h:4,c:"$pants"},{x:i[0],y:16,w:3,h:2,c:"$shoes"},{x:i[1],y:16,w:3,h:2,c:"$shoes"},{x:2,y:o+8,w:8,h:6,c:"$shirt"},{x:2,y:o+8,w:8,h:1,c:"lighten($shirt, 20)",a:.2},{x:8,y:o+9+u,w:3,h:4-u,c:"$shirt"},{x:9,y:o+12,w:2,h:1,c:"$skin"},{x:4,y:o+6,w:4,h:3,c:"$skin"},{x:2,y:o+0,w:8,h:7,c:"$skin"},{x:7,y:o+3,w:2,h:2,c:"#1A1A2E"},{x:7,y:o+3,w:1,h:1,c:"#FFF",a:.3},{x:9,y:o+4,w:1,h:1,c:"darken($skin, 25)",a:.3},{x:2,y:o+0,w:8,h:3,c:"$hair"},{x:1,y:o+1,w:2,h:4,c:"$hair"},{x:9,y:o+1,w:2,h:3,c:"$hair"},{x:3,y:o+0,w:6,h:1,c:"lighten($hair, 25)",a:.25}]:[{x:1,y:17,w:10,h:2,c:"#100A06",a:.18},{x:i[0],y:13,w:3,h:4,c:"$pants"},{x:i[1],y:13,w:3,h:4,c:"$pants"},{x:i[0],y:16,w:3,h:2,c:"$shoes"},{x:i[1],y:16,w:3,h:2,c:"$shoes"},{x:2,y:o+8,w:8,h:6,c:"$shirt"},{x:2,y:o+8,w:8,h:1,c:"lighten($shirt, 20)",a:.2},{x:0,y:o+9+u,w:3,h:4-u,c:"$shirt"},{x:-1,y:o+12,w:2,h:1,c:"$skin"},{x:4,y:o+6,w:4,h:3,c:"$skin"},{x:2,y:o+0,w:8,h:7,c:"$skin"},{x:3,y:o+3,w:2,h:2,c:"#1A1A2E"},{x:3,y:o+3,w:1,h:1,c:"#FFF",a:.3},{x:1,y:o+4,w:1,h:1,c:"darken($skin, 25)",a:.3},{x:2,y:o+0,w:8,h:3,c:"$hair"},{x:1,y:o+1,w:2,h:3,c:"$hair"},{x:9,y:o+1,w:2,h:4,c:"$hair"},{x:3,y:o+0,w:6,h:1,c:"lighten($hair, 25)",a:.25}]}const p1={down:[Xo(0),Xo(1),Xo(2),Xo(3)],up:[Go(0),Go(1),Go(2),Go(3)],right:[Ea(0,!0),Ea(1,!0),Ea(2,!0),Ea(3,!0)],left:[Ea(0,!1),Ea(1,!1),Ea(2,!1),Ea(3,!1)]},Qo=16,en=288,ll=208,TE=4,Je=4,Qt=28,Kt=2,Ae=4,hn=en/2,dt=4,cn={exec:{wx:Je+dt,wy:Je,ww:hn-Je-dt-Ae/2,wh:Qt,fx:Je+dt,fy:Je+Qt+Kt,fw:hn-Je-dt-Ae/2,fh:66,wallColor:"#C8B898",baseboardColor:"#6A5840"},work:{wx:hn+Ae/2+dt,wy:Je,ww:en-hn-Ae/2-dt-Je,wh:Qt,fx:hn+Ae/2+dt,fy:Je+Qt+Kt,fw:en-hn-Ae/2-dt-Je,fh:66,wallColor:"#A8B8C8",baseboardColor:"#586878"},meet:{wx:Je+dt,wy:Je+Qt+Kt+66+Ae,ww:hn-Je-dt-Ae/2,wh:Qt,fx:Je+dt,fy:Je+Qt+Kt+66+Ae+Qt+Kt,fw:hn-Je-dt-Ae/2,fh:70,wallColor:"#A8C8B0",baseboardColor:"#4A6A50"},comm:{wx:hn+Ae/2+dt,wy:Je+Qt+Kt+66+Ae,ww:en-hn-Ae/2-dt-Je,wh:Qt,fx:hn+Ae/2+dt,fy:Je+Qt+Kt+66+Ae+Qt+Kt,fw:en-hn-Ae/2-dt-Je,fh:70,wallColor:"#C8C0A8",baseboardColor:"#7A6A50"}},Pe=cn.exec,ht=cn.work,rt=cn.meet,Re=cn.comm,dc={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C","data-analyst":"#0277BD"},lc=[{id:"meeting",label:"MEETING ROOM",x:rt.fx+10,y:rt.fy+10,w:44,h:40},{id:"bulletin",label:"BULLETIN",x:rt.wx+6,y:rt.wy+4,w:18,h:14},{id:"decisions",label:"DECISIONS",x:Re.wx+6,y:Re.wy+6,w:18,h:12},{id:"knowledge",label:"KNOWLEDGE",x:Re.fx+108,y:Re.fy+16,w:22,h:16,labelY:-4}],Kr={cbo:{dx:Pe.fx+30,dy:Pe.fy+14,room:"exec"},cto:{dx:Pe.fx+78,dy:Pe.fy+14,room:"exec"},pm:{dx:ht.fx+8,dy:ht.fy+10,room:"work"},engineer:{dx:ht.fx+52,dy:ht.fy+10,room:"work"},designer:{dx:ht.fx+96,dy:ht.fy+10,room:"work"},qa:{dx:rt.fx+82,dy:rt.fy+10,room:"meet"},"data-analyst":{dx:Re.fx+14,dy:Re.fy+14,room:"comm"}},zd={exec:Pe.fy+52,work:ht.fy+48,meet:rt.fy+56,comm:Re.fy+42},Xt=Je+Qt+Kt+66,Ct=hn-Ae/2,DE={exec_work:{type:"v",doorY:Je+Qt+Kt+20+12,xA:Ct-2,xB:ht.fx+2},meet_comm:{type:"v",doorY:Je+Qt+Kt+66+Ae+Qt+Kt+20+12,xA:Ct-2,xB:Re.fx+2},exec_meet:{type:"h",doorX:Je+dt+40+14,yA:Xt-2,yB:rt.fy+2},work_comm:{type:"h",doorX:hn+Ae/2+dt+40+14,yA:Xt-2,yB:Re.fy+2}},Md={exec:[{room:"work",door:"exec_work",side:"A"},{room:"meet",door:"exec_meet",side:"A"}],work:[{room:"exec",door:"exec_work",side:"B"},{room:"comm",door:"work_comm",side:"A"}],meet:[{room:"exec",door:"exec_meet",side:"B"},{room:"comm",door:"meet_comm",side:"A"}],comm:[{room:"work",door:"work_comm",side:"B"},{room:"meet",door:"meet_comm",side:"B"}]},fd={exec:[{x:Pe.fx+6,y:Pe.fy+52},{x:Pe.fx+60,y:Pe.fy+54},{x:Pe.fx+112,y:Pe.fy+50},{x:Pe.fx+50,y:Pe.fy+52}],work:[{x:ht.fx+14,y:ht.fy+48},{x:ht.fx+44,y:ht.fy+48},{x:ht.fx+70,y:ht.fy+48},{x:ht.fx+100,y:ht.fy+48}],meet:[{x:rt.fx+60,y:rt.fy+56},{x:rt.fx+30,y:rt.fy+54},{x:rt.fx+110,y:rt.fy+50},{x:rt.fx+80,y:rt.fy+56}],comm:[{x:Re.fx+96,y:Re.fy+8},{x:Re.fx+60,y:Re.fy+42},{x:Re.fx+40,y:Re.fy+42},{x:Re.fx+20,y:Re.fy+42}]};let Bt,Gr=null,us=null;function R(t,l,r,i,o,u){t=Math.round(t),l=Math.round(l),!(u!==void 0&&u<.01)&&(u!==void 0&&u!==1&&(Bt.globalAlpha=u),Bt.fillStyle=o,Bt.fillRect(t,l,r,i),u!==void 0&&u!==1&&(Bt.globalAlpha=1))}function $e(t,l,r,i){R(t,l,1,1,r,i)}let ac=1;function ti(t){ac=t}function yl(){return ac=ac*16807%2147483647,(ac&65535)/65535}function n0(t){const l=parseInt(t.slice(1,3),16)/255,r=parseInt(t.slice(3,5),16)/255,i=parseInt(t.slice(5,7),16)/255,o=Math.max(l,r,i),u=Math.min(l,r,i);let f=0,m=0;const x=(o+u)/2;if(o!==u){const h=o-u;m=x>.5?h/(2-o-u):h/(o+u),o===l?f=((r-i)/h+(r<i?6:0))/6:o===r?f=((i-l)/h+2)/6:f=((l-r)/h+4)/6}return[f*360,m*100,x*100]}function l0(t,l,r){t=(t%360+360)%360,l=Math.max(0,Math.min(100,l))/100,r=Math.max(0,Math.min(100,r))/100;const i=l*Math.min(r,1-r),o=f=>{const m=(f+t/30)%12;return r-i*Math.max(-1,Math.min(m-3,9-m,1))},u=f=>Math.round(f*255).toString(16).padStart(2,"0");return"#"+u(o(0))+u(o(8))+u(o(4))}function vl(t,l=1){const[r,i,o]=n0(t);return l0(r+15*l,Math.min(100,i+8),o-12*l)}function Tt(t,l=1){const[r,i,o]=n0(t);return l0(r-10*l,i-3,o+10*l)}function Ko(t,l){const{wx:r,wy:i,ww:o,wh:u,wallColor:f,baseboardColor:m}=t,x=vl(f,.5),h=Tt(f,.5),y=[];if(l){const g=l.x-r,v=l.w;g>0&&y.push({sx:r,sw:g}),g+v<o&&y.push({sx:l.x+v,sw:o-g-v})}else y.push({sx:r,sw:o});for(const g of y){R(g.sx,i,g.sw,u,f);for(let v=0;v<u;v+=4)R(g.sx,i+v,g.sw,1,h,.08),R(g.sx,i+v+2,g.sw,1,x,.05);ti(Math.round(g.sx*7+i*13));for(let v=0;v<g.sw;v+=3)yl()>.4&&R(g.sx+v,i,1,u,h,.04);R(g.sx,i,g.sw,2,h,.3),R(g.sx,i,g.sw,1,Tt(f,1),.2),R(g.sx,i+u-2,g.sw,2,x,.3),R(g.sx,i+u,g.sw,Kt,m),R(g.sx,i+u,g.sw,1,Tt(m,.5),.4)}l&&(R(l.x-1,i,1,u+Kt,"#4A3828"),R(l.x+l.w,i,1,u+Kt,"#4A3828"),R(l.x,i,l.w,1,"#0A0808",.12)),R(t.fx,t.fy,t.fw,3,"#0A0808",.12),R(t.fx,t.fy+3,t.fw,2,"#0A0808",.06)}function Zo(t){const l="#504038",r=vl(l,.5),i=Tt(l,.5),o=t.wx-dt,u=t.wy,f=t.wh+Kt+t.fh;R(o,u,dt,f,l),R(o,u,1,f,i,.3),R(o+dt-1,u,1,f,r,.4);for(let x=0;x<f;x+=6)R(o+1,u+x,dt-2,1,i,.06);const m=t.wx+t.ww;R(m,u,dt,f,l),R(m,u,1,f,i,.2),R(m+dt-1,u,1,f,r,.3)}function x1(t){const{fx:l,fy:r,fw:i,fh:o}=t,u="#B08040",f="#C89848",m="#8A6030",x="#6A4820";R(l,r,i,o,u),ti(42);for(let h=0;h<o;h+=5){const y=Math.floor(h/5)%2*10;for(let g=-10;g<i+10;g+=20){const v=l+g+y,b=Math.max(l,v),k=Math.min(v+19,l+i)-b;if(k<=0)continue;const E=yl()>.5?f:u;R(b,r+h,k,4,E,.25),R(b,r+h,k,1,f,.3),R(b,r+h+4,k,1,x,.35),v>=l&&v<l+i&&R(v,r+h,1,4,x,.2),R(b,r+h+2,k,1,m,.1)}}R(l,r,i,2,"#0A0808",.08),R(l,r,2,o,"#0A0808",.06)}function g1(t){const{fx:l,fy:r,fw:i,fh:o}=t,u="#1C2A38",f="#101820";ti(99),R(l,r,i,o,u);for(let m=0;m<o;m+=Qo)for(let x=0;x<i;x+=Qo){const h=Math.min(Qo,i-x),y=Math.min(Qo,o-m);yl()>.5&&R(l+x,r+m,h,y,Tt(u,.2),.15),R(l+x+2,r+m+2,h-4,y-4,Tt(u,.3),.08),R(l+x,r+m,h,1,f,.5),R(l+x,r+m,1,y,f,.5),R(l+x+1,r+m+1,1,y-1,Tt(u,.4),.1),yl()>.85&&$e(l+x+4+Math.floor(yl()*8),r+m+4+Math.floor(yl()*8),"#3A6A9A",.08)}}function zE(t){const{fx:l,fy:r,fw:i,fh:o}=t,u="#387848",f="#4A9058",m="#285E38";R(l,r,i,o,u),ti(77);for(let h=0;h<o;h+=2)for(let y=0;y<i;y+=2)yl()>.5&&$e(l+y,r+h,f,.1),yl()>.8&&$e(l+y+1,r+h+1,m,.12);const x=5;R(l+x,r+x,i-x*2,1,f,.45),R(l+x,r+o-x-1,i-x*2,1,m,.45),R(l+x,r+x,1,o-x*2,f,.35),R(l+i-x-1,r+x,1,o-x*2,m,.35)}function ME(t){const{fx:l,fy:r,fw:i,fh:o}=t,u="#D8C490",f="#B09060",m="#907848";ti(55);for(let x=0;x<o;x+=8)for(let h=0;h<i;h+=8){const y=Math.min(8,i-h),g=Math.min(8,o-x),v=(h/8+x/8)%2===0?f:u;R(l+h,r+x,y,g,v),R(l+h+1,r+x+1,y-2,1,Tt(v,.4),.2),R(l+h+1,r+x+1,1,g-2,Tt(v,.4),.15),R(l+h+y-2,r+x+2,1,g-3,vl(v,.4),.15),R(l+h+2,r+x+g-2,y-3,1,vl(v,.4),.15),R(l+h,r+x,y,1,m,.3),R(l+h,r+x,1,g,m,.3)}}function _E(){const t="#2A1E14",l="#3A2E24";R(0,0,en,Je,t),R(0,ll-Je,en,Je,t),R(0,0,Je,ll,t),R(en-Je,0,Je,ll,t),R(0,0,en,1,l,.3),R(0,0,1,ll,l,.2);const r=Je+Qt+Kt+20,i=24,o=Je+dt+40,u=28,f=hn+Ae/2+dt+40,m=Je+Qt+Kt+66+Ae+Qt+Kt+20;R(0,Xt,o,Ae,t),R(o+u,Xt,Ct-o-u,Ae,t),R(Ct+Ae,Xt,f-Ct-Ae,Ae,t),R(f+u,Xt,en-f-u,Ae,t),R(0,Xt,o,1,l,.3),R(o+u,Xt,Ct-o-u,1,l,.3),R(Ct+Ae,Xt,f-Ct-Ae,1,l,.3),R(f+u,Xt,en-f-u,1,l,.3),R(Ct,0,Ae,r,t),R(Ct,r+i,Ae,Xt-r-i,t),R(Ct,Xt+Ae,Ae,m-Xt-Ae,t),R(Ct,m+i,Ae,ll-m-i,t),R(Ct,0,1,r,l,.2),R(Ct,r+i,1,Xt-r-i,l,.2),R(Ct,Xt+Ae,1,m-Xt-Ae,l,.2),R(Ct,m+i,1,ll-m-i,l,.2),R(Ct,r,Ae,i,"#C4A070"),R(Ct+Ae/2,r,Ae/2,i,"#3A4858"),R(Ct,m,Ae,i,"#7AA880"),R(Ct+Ae/2,m,Ae/2,i,"#C8B890");const x="#4A3828";R(Ct,r-1,Ae,1,x),R(Ct,r+i,Ae,1,x),R(o-1,Xt,1,Ae,x),R(o+u,Xt,1,Ae,x),R(f-1,Xt,1,Ae,x),R(f+u,Xt,1,Ae,x),R(Ct,m-1,Ae,1,x),R(Ct,m+i,Ae,1,x)}function Vr(t,l,r=14,i=12){R(t,l,r,i,"#4A3828"),R(t+1,l+1,r-2,i-2,"#5A4838"),R(t+2,l+2,r-4,i-4,"#4A7098"),R(t+2,l+2,r-4,Math.floor((i-4)/2),"#6A90B8",.35);const o=Math.floor(r/2);R(t+o,l+1,1,i-2,"#4A3828"),R(t+1,l+Math.floor(i/2),r-2,1,"#4A3828",.5),$e(t+3,l+3,"#8AB8E8",.35),$e(t+o+2,l+3,"#8AB8E8",.25),R(t-1,l+i,r+2,2,"#5A4838"),R(t-1,l+i,r+2,1,Tt("#5A4838",.5),.35)}function Jo(t,l,r){R(t,l,10,8,"#3A2818"),R(t+1,l+1,8,6,r),R(t+2,l+2,4,3,Tt(r,1.2),.3),$e(t+3,l+2,Tt(r,2),.25)}function y1(t,l){R(t,l,7,7,"#3A2818"),R(t+1,l+1,5,5,"#F0EDE5"),$e(t+3,l+1,"#AAA"),$e(t+3,l+5,"#AAA"),$e(t+1,l+3,"#AAA"),$e(t+5,l+3,"#AAA"),$e(t+3,l+3,"#222"),R(t+3,l+1,1,2,"#333"),$e(t+4,l+3,"#D32F2F")}function RE(t,l){R(t,l,26,16,"#586878"),R(t+1,l+1,24,13,"#ECEFF1"),R(t+1,l+1,24,1,"#F5F5F5",.4),R(t+3,l+3,14,1,"#1565C0",.6),R(t+3,l+5,18,1,"#333",.2),R(t+3,l+7,12,1,"#D32F2F",.35),R(t+3,l+9,16,1,"#333",.15),R(t+1,l+14,24,2,"#708898"),R(t+3,l+14,3,1,"#D32F2F"),R(t+7,l+14,3,1,"#1565C0"),R(t+11,l+14,3,1,"#2E7D32")}function OE(t,l){R(t,l,22,16,"#6A5030"),R(t+1,l+1,20,14,"#C4A66A"),ti(88);for(let r=0;r<14;r++)for(let i=0;i<20;i++)yl()>.5&&$e(t+1+i,l+1+r,yl()>.5?"#B89858":"#D4B87A",.18);R(t+2,l+2,5,4,"#FFF176"),R(t+8,l+2,5,4,"#90CAF9"),R(t+14,l+3,5,4,"#CE93D8"),R(t+3,l+8,7,4,"#C8E6C9"),R(t+11,l+8,8,4,"#F8BBD0"),$e(t+4,l+2,"#E53935"),$e(t+10,l+2,"#1E88E5"),$e(t+16,l+3,"#FF9800")}function dd(t,l){R(t,l,20,3,"#5A4030"),R(t,l,20,1,Tt("#5A4030",.5),.35),R(t,l+2,20,1,vl("#5A4030",.5),.3),R(t+2,l-4,3,4,"#E53935"),R(t+2,l-4,3,1,Tt("#E53935",1),.3),R(t+6,l-3,2,3,"#1E88E5"),R(t+9,l-5,4,5,"#43A047"),R(t+14,l-3,3,3,"#FFD54F"),$e(t+15,l-3,"#FFF176",.4)}function BE(t,l){R(t,l,16,12,"#1E1E28"),R(t+1,l+1,14,9,"#0C1420"),R(t+2,l+2,12,1,"#EF4444",.6),$e(t+2,l+4,"#4CAF50"),R(t+4,l+4,7,1,"#8b949e",.4),$e(t+2,l+6,"#FF9800"),R(t+4,l+6,5,1,"#8b949e",.3),$e(t+2,l+8,"#42A5F5"),R(t+4,l+8,8,1,"#8b949e",.25),R(t+7,l+10,2,2,"#1E1E28"),R(t+5,l+11,6,1,"#586878")}const Pt={hi:"#D4AA5C",base:"#B08040",sh:"#7A5038",deep:"#4E3028"},gl={hi:"#8A6848",base:"#604832",sh:"#3A2E24",deep:"#2A1E18"},pl={hi:"#5A6A80",base:"#485868",sh:"#364858",deep:"#283848"},Da="#100A06";function LE(t,l){R(t+2,l+16,26,3,Da,.18),R(t,l,26,10,Pt.deep),R(t+1,l+1,24,8,Pt.base),R(t+1,l+2,24,1,Pt.hi,.2),R(t+1,l+4,24,1,vl(Pt.base,.2),.1),R(t+1,l+6,24,1,Pt.hi,.15),R(t+1,l+1,24,1,Pt.hi,.4),R(t+1,l+1,1,8,Pt.hi,.2),R(t,l+10,26,5,Pt.deep),R(t+1,l+11,24,3,Pt.sh),R(t+1,l+10,24,1,vl(Pt.base,1.5),.4),R(t+1,l+14,24,1,Pt.base,.15),R(t+2,l+12,10,1,Pt.deep,.4),R(t+14,l+12,10,1,Pt.deep,.4),$e(t+7,l+11,"#C8D0D8",.6),$e(t+19,l+11,"#C8D0D8",.6),R(t+6,l-5,14,7,"#1E1E28"),R(t+7,l-4,12,5,"#0C1420"),R(t+8,l-3,5,1,"#2A6898",.6),R(t+8,l-2,8,1,"#1A3858",.4),R(t+8,l-1,3,1,"#2A6898",.35),$e(t+7,l-4,"#4A98D8",.25),$e(t+12,l+1,"#4CAF50",.4),R(t+12,l+2,2,3,"#586878"),R(t+10,l+4,6,1,"#8898A8"),R(t+6,l+4,12,4,"#222228"),R(t+6,l+4,12,1,"#333338",.4);for(let r=0;r<5;r++)$e(t+7+r*2,l+5,"#444",.6),$e(t+7+r*2,l+6,"#3A3A3E",.4);R(t+20,l+5,3,4,"#333338"),R(t+20,l+5,3,1,"#444448"),R(t+1,l+3,4,4,"#F0EDE8"),R(t+1,l+3,4,1,"#F8F6F2"),$e(t+2,l+5,"#6D4C41")}function nr(t,l,r){R(t+1,l+9,10,2,Da,.1),$e(t+5,l+9,"#1E1E22"),$e(t+1,l+10,"#1A1A1E"),$e(t+9,l+10,"#1A1A1E"),$e(t+3,l+11,"#1A1A1E"),$e(t+7,l+11,"#1A1A1E"),R(t+1,l+2,8,6,pl.base),R(t+2,l+3,6,4,pl.hi,.35),R(t+2,l+3,6,1,Tt(pl.hi,.5),.25),R(t+1,l+7,8,1,pl.deep),r==="up"?(R(t,l+7,10,3,pl.deep),R(t+1,l+8,8,1,pl.sh)):(R(t,l-1,10,3,pl.deep),R(t+1,l,8,1,pl.sh)),R(t,l+3,1,4,pl.sh),R(t+9,l+3,1,4,pl.sh)}function tr(t,l){R(t+2,l+11,6,2,Da,.1),R(t+2,l+8,6,4,"#8B5E3C"),R(t+1,l+7,8,2,vl("#A06E48",.3)),R(t+2,l+7,6,1,Tt("#A06E48",.5),.4),R(t+1,l+3,3,4,"#2E7D32"),R(t+5,l+2,3,4,"#2E7D32"),R(t+2,l+1,4,4,"#43A047"),R(t+3,l+0,3,3,"#66BB6A"),$e(t+4,l,"#81C784"),$e(t+3,l+1,"#A5D6A7",.4)}function v1(t,l){R(t+2,l+20,22,2,Da,.15),R(t,l,22,20,gl.deep),R(t+1,l+1,20,18,gl.base),R(t,l,22,1,gl.hi,.35),R(t,l,1,20,gl.hi,.2);for(const o of[6,12])R(t+1,l+o,20,2,gl.sh),R(t+1,l+o,20,1,gl.hi,.2);const r=["#E53935","#1E88E5","#43A047","#8E24AA","#FB8C00","#00897B","#5C6BC0"];let i=t+2;for(let o=0;o<5;o++){const u=2+o%2;R(i,l+1,u,5,r[o]),R(i,l+1,u,1,Tt(r[o],1),.35),i+=u+1}i=t+2;for(let o=0;o<4;o++)R(i,l+7,4,5,r[o+3]),R(i,l+7,4,1,Tt(r[o+3],1),.25),i+=5;R(t+2,l+14,4,4,"#FFD54F"),R(t+8,l+14,7,4,"#90CAF9")}function FE(t,l){nr(t+4,l-4,"down"),nr(t+16,l-4,"down"),nr(t+28,l-4,"down"),R(t+3,l+24,34,3,Da,.15),R(t,l+2,36,18,Pt.deep),R(t+1,l+3,34,16,Pt.base),R(t+1,l+3,34,1,Pt.hi,.35);for(let r=0;r<14;r+=3)R(t+1,l+4+r,34,1,vl(Pt.base,.2),.08);R(t,l+20,36,4,Pt.deep),R(t+1,l+21,34,2,Pt.sh),R(t+6,l+7,10,6,"#1A1A24"),R(t+7,l+8,8,4,"#0C1420"),R(t+8,l+9,4,1,"#2A6898",.4),R(t+20,l+8,6,4,"#F0F0F0"),R(t+15,l+7,3,3,"#ECEFF1"),$e(t+16,l+8,"#795548"),nr(t+4,l+24,"up"),nr(t+16,l+24,"up"),nr(t+28,l+24,"up")}function UE(t,l){R(t+2,l+16,36,3,Da,.15),R(t,l,36,5,"#5D4037"),R(t+1,l+1,34,3,"#6D4C41"),R(t+1,l+1,34,1,Tt("#6D4C41",.5),.3),R(t,l+5,36,8,"#5D4037"),R(t+2,l+6,15,6,"#6D4C41"),R(t+3,l+6,13,1,Tt("#6D4C41",.5),.35),R(t+19,l+6,15,6,"#6D4C41"),R(t+20,l+6,13,1,Tt("#6D4C41",.5),.35),R(t+17,l+6,2,6,"#5D4037"),R(t,l+13,36,3,vl("#5D4037",1)),R(t-2,l+2,3,12,"#5D4037"),R(t+35,l+2,3,12,"#5D4037"),R(t+4,l+7,6,4,"#FF8A65"),R(t+5,l+7,4,1,Tt("#FF8A65",1),.35)}function HE(t,l){R(t+2,l+10,22,2,Da,.12),R(t,l,22,8,gl.deep),R(t+1,l+1,20,6,gl.base),R(t+1,l+1,20,1,gl.hi,.3),R(t,l+8,22,2,gl.sh),R(t+3,l+2,6,4,"#F0F0F0"),R(t+13,l+3,3,3,"#ECEFF1"),$e(t+14,l+4,"#795548")}function $E(t,l){R(t+1,l+14,10,2,Da,.12),R(t,l,10,14,"#546E7A"),R(t,l,10,1,Tt("#546E7A",1),.35),R(t+1,l+1,8,3,"#78909C"),R(t+1,l+5,8,4,"#37474F"),$e(t+2,l+6,"#EF5350"),$e(t+4,l+6,"#66BB6A"),R(t+2,l+11,4,2,"#ECEFF1")}const b1=new Map;function qE(t){const l=`${t.hairStyle??""}|${t.outfitStyle??""}|${t.accessory??""}`;let r=b1.get(l);if(!r){const i=Nd("mini-seated:default"),o=Uy(i,t);r=o?o.layers.flatMap(u=>u.pixels):[],b1.set(l,r)}return r}function IE(t,l,r){Ry(Bt,qE(r),t,l,r)}function YE(t,l,r,i,o){nr(t+8,l+20,"up"),o||IE(t+8,l+0+i,r),LE(t,l+14)}function VE(t,l,r,i,o){const u=i in p1?i:"down",f=o%4,m=p1[u][f];Ry(Bt,m,t,l,r),Bt.globalAlpha=1}function XE(t){const l={};let r=0;for(const i of t){const o=Kr[i];o&&(l[i]={state:"sitting",homeX:o.dx+8,homeY:o.dy+34,homeRoom:o.room,x:o.dx+8,y:o.dy+34,path:[],room:o.room,dir:"down",walkFrame:0,walkTimer:0,bobY:0,bobOff:r*17,stateTimer:600+Math.floor(Math.random()*900)},r++)}return l}function fs(t,l,r,i,o){const u=zd[o],f=[];return l<u-4&&f.push({x:t,y:u}),Math.abs(t-r)>4&&f.push({x:r,y:u}),f.push({x:r,y:i}),f}function hd(t,l,r,i){const u=Md[r].find(y=>y.room===i);if(!u)return[];const f=DE[u.door],m=[],x=zd[r],h=zd[i];if(Math.abs(l-x)>4&&m.push({x:t,y:x}),f.type==="v"){const y=u.side==="A"?f.xA:f.xB,g=u.side==="A"?f.xB:f.xA;m.push({x:y,y:x}),m.push({x:y,y:f.doorY}),m.push({x:g,y:f.doorY}),m.push({x:g,y:h})}else{const y=u.side==="A"?f.yA:f.yB,g=u.side==="A"?f.yB:f.yA;m.push({x:f.doorX,y:x}),m.push({x:f.doorX,y}),m.push({x:f.doorX,y:g}),m.push({x:f.doorX,y:h})}return m}function a0(t,l){const r=Md[t.room];if(!r.find(o=>o.room===l)){for(const o of r)if(Md[o.room].find(f=>f.room===l)){const f=hd(t.x,t.y,t.room,o.room),m=f[f.length-1],x=hd((m==null?void 0:m.x)??t.x,(m==null?void 0:m.y)??t.y,o.room,l);return[...f,...x]}return[]}return hd(t.x,t.y,t.room,l)}function GE(t){if(t.room!==t.homeRoom){const l=a0({...t},t.homeRoom),r=l[l.length-1],i=fs((r==null?void 0:r.x)??t.x,(r==null?void 0:r.y)??t.y,t.homeX,t.homeY,t.homeRoom);return[...l,...i]}return fs(t.x,t.y,t.homeX,t.homeY,t.room)}function QE(t,l){for(const[,r]of Object.entries(t))if(r.stateTimer--,r.state==="sitting"){if(r.bobY=(l+r.bobOff)%60<30?1:0,r.stateTimer<=0)if(r.state="walking",r.x=r.homeX,r.y=r.homeY,r.room=r.homeRoom,Math.random()<.25){const i=["exec","work","meet","comm"].filter(y=>y!==r.room),o=i[Math.floor(Math.random()*i.length)],u=a0(r,o),f=fd[o],m=f[Math.floor(Math.random()*f.length)],x=u[u.length-1]??{x:r.x,y:r.y},h=fs(x.x,x.y,m.x,m.y,o);r.path=[...u,...h],r.walkTimer=0}else{const i=fd[r.room],o=i[Math.floor(Math.random()*i.length)];r.path=fs(r.x,r.y,o.x,o.y,r.room),r.walkTimer=0}}else if(r.state==="walking"||r.state==="returning"){if(r.path.length===0){r.state==="returning"?(r.state="sitting",r.room=r.homeRoom,r.stateTimer=800+Math.floor(Math.random()*1200)):(r.state="idle",r.dir="down",r.stateTimer=180+Math.floor(Math.random()*360));continue}const i=r.path[0],o=i.x-r.x,u=i.y-r.y,f=Math.sqrt(o*o+u*u);if(f<1.5){r.x=i.x,r.y=i.y,r.path.shift();for(const[m,x]of Object.entries(cn))if(r.x>=x.fx&&r.x<=x.fx+x.fw&&r.y>=x.fy&&r.y<=x.fy+x.fh){r.room=m;break}}else r.x+=o/f*.2,r.y+=u/f*.2,Math.abs(o)>Math.abs(u)?r.dir=o>0?"right":"left":r.dir=u>0?"down":"up",r.walkTimer++,r.walkFrame=Math.floor(r.walkTimer/12)%4}else if(r.state==="idle"&&r.stateTimer<=0)if(Math.random()<.3){r.state="walking";const i=fd[r.room],o=i[Math.floor(Math.random()*i.length)];r.path=fs(r.x,r.y,o.x,o.y,r.room),r.walkTimer=0}else r.state="returning",r.path=GE(r),r.walkTimer=0}function KE(t,l,r){Bt.clearRect(0,0,en,ll),R(0,0,en,ll,"#2A1E14"),x1(cn.exec),g1(cn.work),zE(cn.meet),ME(cn.comm);const i=Je+dt+40,o=28,u=hn+Ae/2+dt+40,f=Je+Qt+Kt+66,m=rt.fy;x1({fx:i,fy:f,fw:o,fh:m-f}),g1({fx:u,fy:f,fw:o,fh:m-f}),Ko(cn.exec),Ko(cn.work),Ko(cn.meet,{x:i,w:o}),Ko(cn.comm,{x:u,w:o}),Zo(cn.exec),Zo(cn.work),Zo(cn.meet),Zo(cn.comm),_E(),Vr(Pe.wx+10,Pe.wy+6,16,14),Jo(Pe.wx+34,Pe.wy+8,"#1565C0"),Jo(Pe.wx+48,Pe.wy+8,"#E65100"),y1(Pe.wx+64,Pe.wy+10),dd(Pe.wx+78,Pe.wy+18),Vr(Pe.wx+104,Pe.wy+6,16,14),RE(ht.wx+6,ht.wy+4),Vr(ht.wx+50,ht.wy+6,16,14),Vr(ht.wx+92,ht.wy+6,16,14),OE(rt.wx+6,rt.wy+4),Jo(rt.wx+28,rt.wy+8,"#10B981"),Vr(rt.wx+80,rt.wy+6,16,14),dd(rt.wx+102,rt.wy+18),BE(Re.wx+6,Re.wy+6),Jo(Re.wx+28,Re.wy+8,"#d4956a"),Vr(Re.wx+76,Re.wy+6,16,14),y1(Re.wx+98,Re.wy+10),dd(Re.wx+108,Re.wy+18);const x=[];x.push({y:Pe.fy+4,draw:()=>v1(Pe.fx+2,Pe.fy+4)}),x.push({y:Pe.fy+4,draw:()=>tr(Pe.fx+112,Pe.fy+4)}),x.push({y:Pe.fy+4,draw:()=>tr(Pe.fx+68,Pe.fy+4)}),x.push({y:ht.fy+4,draw:()=>tr(ht.fx+36,ht.fy+4)}),x.push({y:ht.fy+4,draw:()=>tr(ht.fx+80,ht.fy+4)}),x.push({y:rt.fy+4,draw:()=>tr(rt.fx+110,rt.fy+4)}),x.push({y:rt.fy+14,draw:()=>FE(rt.fx+10,rt.fy+14)}),x.push({y:Re.fy+4,draw:()=>$E(Re.fx+92,Re.fy+4)}),x.push({y:Re.fy+4,draw:()=>tr(Re.fx+38,Re.fy+4)}),x.push({y:Re.fy+16,draw:()=>v1(Re.fx+108,Re.fy+16)}),x.push({y:Re.fy+30,draw:()=>UE(Re.fx+44,Re.fy+30)}),x.push({y:Re.fy+50,draw:()=>HE(Re.fx+50,Re.fy+50)}),x.push({y:Re.fy+50,draw:()=>tr(Re.fx+38,Re.fy+50)});for(const[h,y]of Object.entries(Kr)){const g=t[h];if(!g)continue;const v=g.state==="sitting",b=l(h),k=r[h]==="working";x.push({y:y.dy+14,draw:()=>{if(YE(y.dx,y.dy,b,v?g.bobY:0,!v),v&&k){const E=dc[h]??"#388bfd";R(y.dx+7,y.dy+14-4,12,5,E,.15),$e(y.dx+12,y.dy+14+1,"#4CAF50",.8)}}})}for(const[h,y]of Object.entries(t))if(y.state!=="sitting"){const g=l(h);x.push({y:y.y+14,draw:()=>VE(Math.round(y.x),Math.round(y.y),g,y.dir,y.walkFrame)})}x.sort((h,y)=>h.y-y.y);for(const h of x)h.draw();if(Gr){const h=Kr[Gr],y=t[Gr];h&&y&&(Bt.save(),Bt.globalAlpha=.25,Bt.fillStyle=dc[Gr]??"#fff",y.state==="sitting"?Bt.fillRect(h.dx-1,h.dy+6,28,30):Bt.fillRect(Math.round(y.x)-1,Math.round(y.y)-1,14,24),Bt.restore())}if(us){const h=lc.find(y=>y.id===us);h&&(Bt.save(),Bt.strokeStyle="rgba(255,255,255,0.5)",Bt.lineWidth=1,Bt.setLineDash([2,2]),Bt.strokeRect(h.x-1,h.y-1,h.w+2,h.h+2),Bt.restore())}}function ZE({roles:t,projects:l,roleStatuses:r,activeExecs:i,onRoleClick:o,onProjectClick:u,onBulletinClick:f,onDecisionsClick:m,onKnowledgeClick:x,getRoleSpeech:h,getAppearance:y}){const g=j.useRef(null),v=j.useRef(null),b=j.useRef(null),k=j.useRef({}),E=j.useRef(0),N=j.useRef(TE),T=j.useRef({roleStatuses:r,activeExecs:i,getRoleSpeech:h,getAppearance:y});T.current={roleStatuses:r,activeExecs:i,getRoleSpeech:h,getAppearance:y};const L=j.useMemo(()=>t.map(D=>D.id).filter(D=>Kr[D]),[t]);j.useEffect(()=>{k.current=XE(L)},[L]);const $=j.useCallback(D=>{var U,B;return((B=(U=T.current).getAppearance)==null?void 0:B.call(U,D))??sh(D)},[]),K=j.useCallback(()=>{const D=v.current,U=g.current;if(!D||!U)return;const B=D.parentElement;if(!B)return;const ne=B.clientWidth,te=B.clientHeight;if(ne===0||te===0)return;let F=Math.floor(Math.min(ne/en,te/ll));F=Math.max(2,Math.min(F,5)),N.current=F,U.style.width=en*F+"px",U.style.height=ll*F+"px",D.style.width=en*F+"px",D.style.height=ll*F+"px"},[]);j.useEffect(()=>{var z;const D=g.current;if(!D)return;const U=D.getContext("2d");if(!U)return;Bt=U,K();const B=new ResizeObserver(()=>K()),ne=(z=v.current)==null?void 0:z.parentElement;ne&&B.observe(ne);let te;const F=()=>{E.current++,QE(k.current,E.current),KE(k.current,$,T.current.roleStatuses),V(),te=requestAnimationFrame(F)};return te=requestAnimationFrame(F),()=>{cancelAnimationFrame(te),B.disconnect()}},[$,K]),j.useEffect(()=>{const D=b.current;if(D){D.innerHTML="";for(const U of L){const B=dc[U]??"#8b949e",ne=document.createElement("div");ne.className="td-nametag",ne.dataset.role=U;const te=document.createElement("span");te.className="td-dot",te.style.background=B,ne.appendChild(te),ne.appendChild(document.createTextNode(U.toUpperCase())),D.appendChild(ne);const F=document.createElement("div");F.className="td-bubble",F.dataset.role=U,F.dataset.type="bubble",D.appendChild(F)}for(const U of lc){const B=document.createElement("div");B.className="td-facility-label",B.dataset.facility=U.id,B.textContent=U.label,D.appendChild(B)}}},[L]);const V=j.useCallback(()=>{var z;const D=b.current;if(!D)return;const U=N.current,B=k.current,{getRoleSpeech:ne,roleStatuses:te,activeExecs:F}=T.current;for(const q of Object.keys(B)){const Z=B[q],re=Kr[q];if(!re)continue;let A,_,Y;Z.state==="sitting"?(A=re.dx+13,Y=re.dy+2,_=re.dy+37):(A=Math.round(Z.x)+6,Y=Math.round(Z.y)-2,_=Math.round(Z.y)+18);const C=A/en*100,de=D.querySelector(`.td-nametag[data-role="${q}"]`);if(de){de.style.left=C+"%",de.style.top=_*U+2+"px";const xe=de.querySelector(".td-dot");if(xe){const ce=te[q]==="working";xe.style.background=ce?"#FBBF24":dc[q]??"#8b949e",ce?xe.style.animation="td-pulse 1s ease-in-out infinite":xe.style.animation=""}}const pe=D.querySelector(`.td-bubble[data-role="${q}"]`);if(pe){const xe=te[q]==="working",ce=(z=F.find(tt=>tt.roleId===q))==null?void 0:z.task,ve=ne(q),je=xe&&ce?ce.slice(0,30):ve?ve.slice(0,30):"";je&&Z.state==="sitting"?(pe.style.display="",pe.style.left=C+"%",pe.style.top=(Y-5)*U+"px",pe.textContent=je):pe.style.display="none"}}for(const q of lc){const Z=D.querySelector(`.td-facility-label[data-facility="${q.id}"]`);if(Z){const re=q.x+q.w/2,A=q.y+q.h+(q.labelY??0);Z.style.left=re/en*100+"%",Z.style.top=A*U+2+"px",Z.classList.toggle("td-facility-label--hover",us===q.id)}}},[]),M=j.useCallback(D=>{const U=g.current;if(!U)return null;const B=U.getBoundingClientRect(),ne=N.current,te=(D.clientX-B.left)/ne,F=(D.clientY-B.top)/ne,z=k.current;for(const[q,Z]of Object.entries(Kr)){if(!z[q])continue;const re=z[q];if(re.state==="sitting"){if(te>=Z.dx&&te<=Z.dx+26&&F>=Z.dy&&F<=Z.dy+40)return{type:"role",id:q}}else if(te>=re.x-2&&te<=re.x+14&&F>=re.y-2&&F<=re.y+20)return{type:"role",id:q}}for(const q of lc)if(te>=q.x&&te<=q.x+q.w&&F>=q.y&&F<=q.y+q.h)return{type:"facility",id:q.id};return null},[]),J=j.useCallback(D=>{const U=M(D),B=g.current;Gr=(U==null?void 0:U.type)==="role"?U.id:null,us=(U==null?void 0:U.type)==="facility"?U.id:null,B&&(B.style.cursor=U?"pointer":"default")},[M]),Q=j.useCallback(()=>{Gr=null,us=null,g.current&&(g.current.style.cursor="default")},[]),ie=j.useCallback(D=>{const U=M(D);if(U){if(U.type==="role"){o(U.id);return}switch(U.id){case"meeting":l[0]&&u(l[0].id);break;case"bulletin":f();break;case"decisions":m();break;case"knowledge":x();break}}},[M,o,u,f,m,x]);return c.jsx("div",{className:"td-scene",children:c.jsxs("div",{ref:v,className:"td-wrap",children:[c.jsx("canvas",{ref:g,width:en,height:ll,className:"td-canvas",onClick:ie,onMouseMove:J,onMouseLeave:Q}),c.jsx("div",{ref:b,className:"td-overlay"})]})})}function JE({role:t,appearance:l,onSave:r,onReset:i,onClose:o,theme:u,onThemeChange:f,onUpdateName:m,initialTab:x,speechSettings:h,onSpeechSettingsChange:y}){var J;const[g,v]=j.useState(x??"character"),[b,k]=j.useState({...l}),[E,N]=j.useState(t.name),[T,L]=j.useState(!1),$=j.useCallback(()=>k(tc()),[]),K=j.useCallback(()=>{const Q=sh(t.id);k({...Q}),i()},[t.id,i]),V=j.useCallback(async()=>{r(b);const Q=E.trim();if(m&&Q&&Q!==t.name){L(!0);try{await m(t.id,Q)}catch{}L(!1)}o()},[b,r,o,E,t.name,t.id,m]),M=c.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6},children:[c.jsxs("span",{children:[t.id.toUpperCase()," –"]}),m?c.jsx("input",{value:E,onChange:Q=>N(Q.target.value),disabled:T,className:"customize-name-input",style:{background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.15)",borderRadius:4,color:"inherit",font:"inherit",padding:"2px 6px",flex:1,minWidth:0}}):c.jsx("span",{children:t.name})]});return c.jsx("div",{className:"customize-overlay",onClick:o,children:c.jsxs("div",{className:"customize-modal",onClick:Q=>Q.stopPropagation(),children:[c.jsxs("div",{className:"customize-header",children:[c.jsxs("div",{className:"customize-tabs",children:[c.jsx("button",{className:`customize-tab ${g==="character"?"active":""}`,onClick:()=>v("character"),children:"CHARACTER"}),c.jsx("button",{className:`customize-tab ${g==="office"?"active":""}`,onClick:()=>v("office"),children:"OFFICE THEME"}),c.jsx("button",{className:`customize-tab ${g==="settings"?"active":""}`,onClick:()=>v("settings"),children:"SETTINGS"})]}),c.jsx("button",{className:"customize-close",onClick:o,children:"X"})]}),g==="character"?c.jsx("div",{className:"customize-body",children:c.jsx(Wy,{roleId:t.id,appearance:b,onChange:k,onRandomize:$,onReset:K,label:M})}):g==="office"?c.jsx("div",{className:"customize-body",children:c.jsx("div",{className:"customize-themes",children:Object.entries(Na).map(([Q,ie])=>c.jsxs("button",{className:`customize-theme-card ${u===Q?"active":""}`,onClick:()=>f(Q),children:[c.jsxs("div",{className:"customize-theme-preview",style:{background:ie.vars["--floor-light"],borderColor:ie.vars["--pixel-border"]},children:[c.jsx("div",{style:{background:ie.vars["--hud-bg"],height:8,borderBottom:`2px solid ${ie.vars["--pixel-border"]}`}}),c.jsxs("div",{className:"flex-1 flex items-center justify-center gap-1 p-1",children:[c.jsx("div",{style:{width:10,height:14,background:ie.vars["--accent"],borderRadius:1}}),c.jsx("div",{style:{width:10,height:14,background:ie.vars["--active-green"],borderRadius:1}}),c.jsx("div",{style:{width:10,height:14,background:ie.vars["--idle-amber"],borderRadius:1}})]}),c.jsx("div",{style:{background:ie.vars["--hud-bg"],height:6,borderTop:`2px solid ${ie.vars["--pixel-border"]}`}})]}),c.jsxs("div",{className:"customize-theme-name",children:[ie.icon," ",ie.name]})]},Q))})}):c.jsx("div",{className:"customize-body",children:c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,padding:"8px 0"},children:[c.jsxs("div",{children:[c.jsx("div",{style:{fontSize:11,fontWeight:600,marginBottom:8,color:"var(--terminal-text)"},children:"AMBIENT SPEECH MODE"}),c.jsx("div",{style:{display:"flex",gap:6},children:["template","llm","auto"].map(Q=>c.jsxs("button",{onClick:()=>y==null?void 0:y({mode:Q}),style:{flex:1,padding:"8px 12px",fontSize:11,border:`2px solid ${(h==null?void 0:h.mode)===Q?"var(--accent)":"rgba(255,255,255,0.1)"}`,background:(h==null?void 0:h.mode)===Q?"rgba(255,255,255,0.08)":"transparent",color:(h==null?void 0:h.mode)===Q?"var(--terminal-text)":"var(--terminal-text-muted)",borderRadius:6,cursor:"pointer",textAlign:"center"},children:[c.jsx("div",{style:{fontWeight:600,marginBottom:2},children:Q==="template"?"TEMPLATE":Q==="llm"?"AI":"AUTO"}),c.jsx("div",{style:{fontSize:9,opacity:.7},children:Q==="template"?"Static pool ($0)":Q==="llm"?"LLM generated":"Detect engine"})]},Q))}),c.jsx("div",{style:{fontSize:9,color:"var(--terminal-text-muted)",marginTop:4},children:"Auto: CLI Max = AI, BYOK = Template"})]}),c.jsxs("div",{children:[c.jsxs("div",{style:{fontSize:11,fontWeight:600,marginBottom:8,color:"var(--terminal-text)"},children:["SPEECH INTERVAL: ",(h==null?void 0:h.intervalSec)??18,"s"]}),c.jsx("input",{type:"range",min:5,max:120,step:5,value:(h==null?void 0:h.intervalSec)??18,onChange:Q=>y==null?void 0:y({intervalSec:Number(Q.target.value)}),style:{width:"100%",accentColor:"var(--accent)"}}),c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:9,color:"var(--terminal-text-muted)"},children:[c.jsx("span",{children:"5s (frequent)"}),c.jsx("span",{children:"120s (rare)"})]})]}),(h==null?void 0:h.mode)!=="template"&&c.jsxs("div",{children:[c.jsxs("div",{style:{fontSize:11,fontWeight:600,marginBottom:8,color:"var(--terminal-text)"},children:["DAILY LLM BUDGET: $",((J=h==null?void 0:h.dailyBudgetUsd)==null?void 0:J.toFixed(2))??"1.00"]}),c.jsx("input",{type:"range",min:0,max:5,step:.25,value:(h==null?void 0:h.dailyBudgetUsd)??1,onChange:Q=>y==null?void 0:y({dailyBudgetUsd:Number(Q.target.value)}),style:{width:"100%",accentColor:"var(--accent)"}}),c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:9,color:"var(--terminal-text-muted)"},children:[c.jsx("span",{children:"$0 (unlimited)"}),c.jsx("span",{children:"$5.00/day"})]})]})]})}),g==="character"&&c.jsxs("div",{className:"customize-footer",children:[c.jsx("button",{className:"customize-btn customize-btn--cancel",onClick:o,children:"CANCEL"}),c.jsx("button",{className:"customize-btn customize-btn--save",onClick:V,children:"SAVE"})]})]})})}function w1(t){const l=Date.now()-new Date(t).getTime(),r=Math.floor(l/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const i=Math.floor(r/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function WE({status:t,history:l,onClose:r,onSave:i,onLoadHistory:o,onRestore:u,saving:f}){const[m,x]=j.useState("save"),[h,y]=j.useState(""),[g,v]=j.useState(null),[b,k]=j.useState(!1),[E,N]=j.useState(null),T=j.useRef(null);j.useEffect(()=>{m==="history"&&o()},[m,o]),j.useEffect(()=>{var M;(M=T.current)==null||M.focus()},[]);const L=[...((t==null?void 0:t.modified)??[]).map(M=>({status:"M",file:M})),...((t==null?void 0:t.untracked)??[]).map(M=>({status:"A",file:M}))],$=async()=>{v(null),N(null);try{const M=await i(h||void 0);N(M),y("")}catch(M){v(M instanceof Error?M.message:"Save failed")}},K=async M=>{if(confirm(`Restore from commit ${M.slice(0,7)}? This creates a new commit with those files.`)){k(!0);try{await u(M),k(!1)}catch(J){v(J instanceof Error?J.message:"Restore failed"),k(!1)}}};j.useEffect(()=>{const M=J=>{J.key==="Escape"&&r()};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[r]);const V=M=>{M.key==="Enter"&&(M.metaKey||M.ctrlKey)&&$()};return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 bg-black/40 z-[60] backdrop-blur-sm",onClick:r}),c.jsxs("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[520px] max-h-[80vh] z-[61] overflow-hidden flex flex-col",style:{background:"var(--hud-bg)",border:"3px solid var(--pixel-border)",fontFamily:"var(--pixel-font)",color:"var(--terminal-text)"},onKeyDown:V,children:[c.jsxs("div",{className:"px-5 py-3 flex items-center justify-between shrink-0",style:{borderBottom:"2px solid var(--pixel-border)"},children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:"text-lg font-black tracking-tight",children:"SAVE GAME"}),c.jsx("span",{className:"text-[10px]",style:{color:"var(--terminal-text-secondary)"},children:(t==null?void 0:t.branch)??""})]}),c.jsx("button",{onClick:r,className:"text-[var(--terminal-text-secondary)] hover:text-[var(--terminal-text)] cursor-pointer text-lg",children:"×"})]}),c.jsx("div",{className:"flex shrink-0",style:{borderBottom:"2px solid var(--pixel-border)"},children:["save","history"].map(M=>c.jsx("button",{onClick:()=>x(M),className:"flex-1 py-2 text-[11px] font-bold uppercase tracking-wider cursor-pointer",style:{background:m===M?"var(--hud-bg-alt)":"transparent",color:m===M?"var(--terminal-text)":"var(--terminal-text-muted)",borderBottom:m===M?"2px solid var(--accent)":"2px solid transparent"},children:M==="save"?"SAVE":"HISTORY"},M))}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-5 space-y-4",children:[m==="save"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"text-[11px]",style:{color:"var(--terminal-text-secondary)"},children:L.length>0?c.jsxs("span",{style:{color:"var(--idle-amber)"},children:["* ",L.length," unsaved change",L.length>1?"s":""]}):c.jsx("span",{style:{color:"var(--active-green)"},children:"All changes saved"})}),L.length>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider mb-2",style:{color:"var(--terminal-text-muted)"},children:"Changed Files"}),c.jsx("div",{className:"text-[11px] max-h-[160px] overflow-y-auto p-2 space-y-0.5",style:{background:"var(--terminal-bg)",border:"1px solid var(--terminal-border)"},children:L.map(({status:M,file:J})=>c.jsxs("div",{className:"flex gap-2",children:[c.jsx("span",{style:{color:M==="A"?"var(--active-green)":"var(--idle-amber)",width:"14px"},children:M}),c.jsx("span",{style:{color:"var(--terminal-text-secondary)"},children:J})]},J))})]}),L.length>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider mb-2",style:{color:"var(--terminal-text-muted)"},children:"Save Message"}),c.jsx("input",{ref:T,type:"text",value:h,onChange:M=>y(M.target.value),placeholder:"Optional: describe your progress...",className:"w-full px-3 py-2 text-[12px] outline-none",style:{background:"var(--terminal-bg)",border:"1px solid var(--terminal-border)",color:"var(--terminal-text)",fontFamily:"var(--pixel-font)"}})]}),L.length>0&&c.jsx("div",{className:"flex gap-3",children:c.jsx("button",{onClick:$,disabled:f,className:"flex-1 py-2.5 text-[12px] font-black uppercase tracking-wider cursor-pointer disabled:opacity-50",style:{background:"var(--accent)",color:"#fff",border:"2px solid var(--accent)"},children:f?"SAVING...":t!=null&&t.hasRemote?"SAVE & PUSH":"SAVE"})}),L.length>0&&t&&!t.hasRemote&&c.jsx("div",{className:"text-[10px]",style:{color:"var(--terminal-text-muted)"},children:"Local save only — add a git remote to enable push"}),E&&c.jsxs("div",{className:"text-[11px] p-2",style:{background:"rgba(59,185,80,0.1)",border:"1px solid var(--active-green)",color:"var(--active-green)"},children:["Saved! ",E.filesChanged," file",E.filesChanged>1?"s":""," committed",E.pushed?" & pushed":"",E.pushError?` (push error: ${E.pushError})`:""]}),g&&c.jsx("div",{className:"text-[11px] p-2",style:{background:"rgba(211,47,47,0.1)",border:"1px solid #D32F2F",color:"#EF5350"},children:g}),(t==null?void 0:t.lastCommit)&&c.jsxs("div",{className:"text-[10px]",style:{color:"var(--terminal-text-muted)"},children:["Last save: ",t.lastCommit.message," (",w1(t.lastCommit.date),")"]})]}),m==="history"&&c.jsxs(c.Fragment,{children:[l.length===0&&c.jsx("div",{className:"text-[11px] text-center py-8",style:{color:"var(--terminal-text-muted)"},children:"No save history"}),c.jsx("div",{className:"space-y-1",children:l.map(M=>c.jsxs("div",{className:"flex items-center justify-between py-2 px-3 group",style:{background:"var(--hud-bg-alt)",border:"1px solid var(--terminal-border)"},children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-[11px] font-mono",style:{color:"var(--accent)"},children:M.shortSha}),c.jsx("span",{className:"text-[11px] truncate",style:{color:"var(--terminal-text)"},children:M.message})]}),c.jsx("div",{className:"text-[10px]",style:{color:"var(--terminal-text-muted)"},children:w1(M.date)})]}),c.jsx("button",{onClick:()=>K(M.sha),disabled:b,className:"text-[10px] font-bold px-2 py-1 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",style:{background:"var(--terminal-bg)",border:"1px solid var(--terminal-border)",color:"var(--idle-amber)"},children:"LOAD"})]},M.sha))})]})]})]})]})}const PE={cto:"🏗️",cbo:"📊",pm:"📋",engineer:"⚙️",designer:"🎨",qa:"🔍","data-analyst":"📊"},_d={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C","data-analyst":"#0277BD"},eC={cto:8,cbo:7,pm:6,engineer:5,designer:5,qa:4,"data-analyst":4},tC={cto:"아키텍처",cbo:"시장 분석",pm:"PRD 작성",engineer:"코딩",designer:"시안 제작",qa:"품질 검증"};function nC(t){let l=0;for(let i=0;i<t.length;i++)l=t.charCodeAt(i)+((l<<5)-l);return`hsl(${(l%360+360)%360}, 50%, 40%)`}function lC({importJob:t,onImportDone:l}){var or,si,La;const[r,i]=j.useState([]),[o,u]=j.useState([]),[f,m]=j.useState([]),[x,h]=j.useState([]),[y,g]=j.useState([]),[v,b]=j.useState([]),[k,E]=j.useState("TYCONO"),[N,T]=j.useState(!0),[L,$]=j.useState(null),[K,V]=j.useState({type:"none"}),[M,J]=j.useState(null),[Q,ie]=j.useState(null),[D,U]=j.useState([]),[B,ne]=j.useState(!1),[te,F]=j.useState([]),[z,q]=j.useState(0),[Z,re]=j.useState(!1),[A,_]=j.useState({}),[Y,C]=j.useState("ceo"),[de,pe]=j.useState(null),[xe,ce]=j.useState(!1),[ve,je]=j.useState(!1),[tt,xt]=j.useState(null),[vt,Lt]=j.useState({}),[_e,bt]=j.useState([]),[Ft,_n]=j.useState([]),{getAppearance:gt,setAppearance:Zt,resetAppearance:un,theme:St,setTheme:wn,speechSettings:kn,setSpeechSettings:Dt}=dE(),[Sn,G]=j.useState(null),[se,we]=j.useState("character"),ye=mE(),[Be,jt]=j.useState(!1);j.useEffect(()=>{const I=fe=>{(fe.metaKey||fe.ctrlKey)&&fe.key==="s"&&(fe.preventDefault(),ye.dirtyCount>0&&jt(!0))};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[ye.dirtyCount]);const[Nt,it]=j.useState(null),[he,We]=j.useState(null),[Qe,Rn]=j.useState([]),[tn,ws]=j.useState(!1),za=j.useRef(!1),Yl=j.useRef(null);let Ma=j.useRef(0);const xn=(I,fe,ge)=>{const ke={id:Ma.current++,type:I,text:fe,detail:ge};Rn(Ee=>[...Ee,ke])};j.useEffect(()=>{var I;tn&&((I=Yl.current)==null||I.scrollIntoView({behavior:"smooth"}))},[Qe,tn]),j.useEffect(()=>{t&&(za.current||(za.current=!0,We("Scanning knowledge sources..."),Rn([{id:0,type:"scan",text:"Starting knowledge import..."}]),Ma.current=1,fetch("/api/setup/import-knowledge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:t.paths,companyRoot:t.companyRoot})}).then(async I=>{var Ee;const fe=(Ee=I.body)==null?void 0:Ee.getReader();if(!fe)return;const ge=new TextDecoder;let ke="";for(;;){const{done:ze,value:Me}=await fe.read();if(ze)break;ke+=ge.decode(Me,{stream:!0});const Ke=ke.split(`
83
+ `);ke=Ke.pop()||"";let qe="";for(const Fe of Ke)if(Fe.startsWith("event: "))qe=Fe.slice(7).trim();else if(Fe.startsWith("data: ")&&qe){try{const At=JSON.parse(Fe.slice(6));switch(qe){case"scanning":We(`Scanning: ${At.path} (${At.fileCount} files)`),xn("scan",`Found ${At.fileCount} files`,At.path);break;case"processing":it({index:At.index,total:At.total}),We(`Importing knowledge... (${At.index}/${At.total})`),xn("process",`Processing: ${At.file}`,`${At.index} / ${At.total}`);break;case"created":xn("created",At.title,At.summary);break;case"skipped":xn("process",`Skipped: ${At.file}`,At.reason);break;case"done":We(null),it(null),xn("done",`Import complete! ${At.created} created, ${At.skipped} skipped.`),_t(`Knowledge import complete! ${At.created} documents imported.`,"#2E7D32"),l==null||l();break;case"error":We(null),it(null),xn("error",At.message),_t(`Import failed: ${At.message}`,"#B71C1C"),l==null||l();break}}catch{}qe=""}}}).catch(I=>{We(null),xn("error",I.message),_t(`Import error: ${I.message}`,"#B71C1C"),l==null||l()})))},[t]);const[Vl,Xl]=j.useState("card"),[ks,Ss]=j.useState(typeof window<"u"?window.innerWidth:1200);j.useEffect(()=>{const I=()=>Ss(window.innerWidth);return window.addEventListener("resize",I),()=>window.removeEventListener("resize",I)},[]);const _a=ks<1024,[fn,Gl]=j.useState(!1),[Ql,js]=j.useState(560),[Ra,ln]=j.useState([]),[Kl,al]=j.useState(null),[ni,Gn]=j.useState(null),{sendMessage:Jt}=cE();j.useEffect(()=>{Promise.all([Ce.getCompany().then(I=>{E(I.name),i(I.roles)}),Ce.getProjects().then(u),Ce.getStandups().then(m),Ce.getWaves().then(h),Ce.getDecisions().then(g),Ce.getKnowledge().then(b).catch(()=>{}),Ce.getOrgTree().then(I=>{_(I.nodes),C(I.root)}).catch(()=>{})]).catch(I=>$(`Failed to load: ${I.message}`)).finally(()=>T(!1))},[]),j.useEffect(()=>{Ce.deleteEmptySessions().catch(()=>{}),Ce.getSessions().then(I=>{I.length>0&&Promise.all(I.map(fe=>Ce.getSession(fe.id))).then(fe=>{ln(fe),al(fe[0].id),Gl(!0)}).catch(fe=>{console.error("Failed to load session details",fe)})}).catch(I=>{console.error("Failed to load sessions",I)})},[]),j.useEffect(()=>{const I=()=>{fetch("/api/exec/status").then(ge=>ge.json()).then(ge=>{Lt(ge.statuses??{}),bt(ge.activeExecutions??[])}).catch(()=>{})};I();const fe=setInterval(I,3e3);return()=>clearInterval(fe)},[]),j.useEffect(()=>{K.type==="role"?Ce.getRole(K.roleId).then(J).catch(console.error):J(null)},[K]);const Ut=()=>V({type:"none"}),Zl=async(I,fe)=>{const ge=r.find(Ee=>Ee.id===I),ke=(Q==null?void 0:Q.mode)==="ask";ie(null);try{const{jobId:Ee}=await Ce.startJob({type:"assign",roleId:I,task:fe,readOnly:ke}),ze=_d[I]??"#666",Me=`${I.toUpperCase()} · ${(ge==null?void 0:ge.name)??I}`;re(!1),U([{jobId:Ee,title:Me,color:ze}])}catch(Ee){_t(`Failed to start job: ${Ee instanceof Error?Ee.message:"unknown"}`,"#C62828")}},_t=(I,fe)=>{const ge=Date.now();_n(ke=>[...ke,{id:ge,message:I,color:fe}]),setTimeout(()=>_n(ke=>ke.filter(Ee=>Ee.id!==ge)),4e3)},wc=()=>{const I=D[D.length-1];I&&_t(`${I.title} completed`,I.color),Ce.getStandups().then(m).catch(console.error),Ce.getCompany().then(fe=>i(fe.roles)).catch(console.error)},kc=async I=>{ne(!1);try{const fe=await Ce.startJob({type:"wave",directive:I}),ge=fe.jobIds??(fe.jobId?[fe.jobId]:[]),ke=r.filter(ze=>ze.level==="c-level"),Ee=ge.map((ze,Me)=>{var Ke,qe;return{jobId:ze,roleId:((Ke=ke[Me])==null?void 0:Ke.id)??`role-${Me}`,roleName:((qe=ke[Me])==null?void 0:qe.name)??`C-Level ${Me+1}`}});Object.keys(A).length>0?(pe({directive:I,rootJobs:Ee}),ce(!1)):(F(Ee),q(0),re(!1),Ee.length>0&&U([{jobId:Ee[0].jobId,title:`CEO WAVE · ${Ee[0].roleId.toUpperCase()}`,color:"#B71C1C"}]))}catch(fe){_t(`Failed to start wave: ${fe instanceof Error?fe.message:"unknown"}`,"#C62828")}},li=()=>{Ce.getWaves().then(h).catch(console.error),Ce.getStandups().then(m).catch(console.error)},wl=()=>{Ce.getCompany().then(I=>i(I.roles)).catch(console.error)},ai=async(I,fe)=>{await Ce.createRole(I),Zt(I.id,fe),wl(),_t(`${I.name} hired!`,"#2E7D32")},Jl=async I=>{await Ce.deleteRole(I),wl(),xt(null),_t(`${I.toUpperCase()} removed`,"#B71C1C")},kl=async(I,fe)=>{await Ce.updateRole(I,fe),wl(),fe.name&&_t(`${I.toUpperCase()} renamed to "${fe.name}"`,"#1565C0")},Oa=I=>{Gl(!0)},Wl=async I=>{try{const fe=await Ce.createSession(I,"talk");ln(ge=>[fe,...ge]),al(fe.id),Gl(!0)}catch(fe){console.error("Failed to create session",fe),_t(`Failed to create session: ${fe instanceof Error?fe.message:"API unreachable"}`,"#B71C1C")}},Ht=async I=>{try{const fe=await Ce.createSession(I,"talk");ln(ge=>[fe,...ge]),al(fe.id)}catch(fe){console.error("Failed to create session",fe),_t(`Failed to create session: ${fe instanceof Error?fe.message:"API unreachable"}`,"#B71C1C")}},Es=I=>{const fe=Ra.find(ge=>ge.roleId===I);fe&&al(fe.id),Gl(!0)},Cs=async I=>{try{await Ce.deleteSession(I),ln(fe=>{var ke;const ge=fe.filter(Ee=>Ee.id!==I);return Kl===I&&al(((ke=ge[0])==null?void 0:ke.id)??null),ge})}catch(fe){console.error("Failed to delete session",fe),_t(`Failed to close session: ${fe instanceof Error?fe.message:"API error"}`,"#B71C1C")}},Sl=async()=>{try{const{ids:I}=await Ce.deleteEmptySessions();if(I.length===0)return;ln(fe=>{var ke;const ge=fe.filter(Ee=>!I.includes(Ee.id));return Kl&&I.includes(Kl)&&al(((ke=ge[0])==null?void 0:ke.id)??null),ge}),_t(`Cleared ${I.length} empty session${I.length!==1?"s":""}`,"#2E7D32")}catch(I){_t(`Failed to clear empty sessions: ${I instanceof Error?I.message:"API error"}`,"#B71C1C")}},Pl=async()=>{if(!confirm("Close all sessions? This cannot be undone."))return;const I=Ra.map(fe=>fe.id);try{await Ce.deleteSessions(I),ln([]),al(null),_t("All sessions closed","#2E7D32")}catch(fe){_t(`Failed to close sessions: ${fe instanceof Error?fe.message:"API error"}`,"#B71C1C")}},ul=(I,fe)=>{ln(ge=>ge.map(ke=>{if(ke.id!==I)return ke;const Ee=[...ke.messages],ze=Ee[Ee.length-1];if(ze&&ze.from==="role"&&ze.status==="streaming"){const Me=[...ze.streamEvents??[],fe];Ee[Ee.length-1]={...ze,streamEvents:Me}}return{...ke,messages:Ee}}))},ri=(I,fe,ge)=>{const ke={id:`msg-${Date.now()}-ceo`,from:"ceo",content:fe,type:ge==="do"?"directive":"conversation",status:"done",timestamp:new Date().toISOString()},Ee={id:`msg-${Date.now()+1}-role`,from:"role",content:"",type:"conversation",status:"streaming",timestamp:new Date().toISOString(),streamEvents:[]};ln(ze=>ze.map(Me=>Me.id===I?{...Me,messages:[...Me.messages,ke,Ee],updatedAt:new Date().toISOString()}:Me)),Gn(I),Jt(I,fe,ge,{onThinking:ze=>{ln(Me=>Me.map(Ke=>{if(Ke.id!==I)return Ke;const qe=[...Ke.messages],Fe=qe[qe.length-1];return Fe&&Fe.from==="role"&&Fe.status==="streaming"&&(qe[qe.length-1]={...Fe,thinking:(Fe.thinking??"")+ze}),{...Ke,messages:qe}})),ul(I,{type:"thinking",timestamp:Date.now(),text:ze})},onText:ze=>{ln(Me=>Me.map(Ke=>{if(Ke.id!==I)return Ke;const qe=[...Ke.messages],Fe=qe[qe.length-1];return Fe&&Fe.from==="role"&&Fe.status==="streaming"&&(qe[qe.length-1]={...Fe,content:Fe.content+ze}),{...Ke,messages:qe}}))},onToolUse:(ze,Me)=>{ul(I,{type:"tool",timestamp:Date.now(),toolName:ze,toolInput:Me})},onDispatch:(ze,Me)=>{ul(I,{type:"dispatch",timestamp:Date.now(),roleId:ze,task:Me})},onDispatchProgress:(ze,Me,Ke)=>{var qe;Me==="tool"?ul(I,{type:"dispatch:progress",timestamp:Date.now(),roleId:ze,progressType:"tool",toolName:Ke.name,toolInput:Ke.input}):Me==="thinking"?ul(I,{type:"dispatch:progress",timestamp:Date.now(),roleId:ze,progressType:"thinking",text:Ke.text}):Me==="text"?ul(I,{type:"dispatch:progress",timestamp:Date.now(),roleId:ze,progressType:"text",text:(qe=Ke.text)==null?void 0:qe.slice(-200)}):(Me==="done"||Me==="error")&&ul(I,{type:"dispatch:progress",timestamp:Date.now(),roleId:ze,progressType:Me})},onTurn:ze=>{ul(I,{type:"turn",timestamp:Date.now(),turn:ze})},onDone:()=>{ln(ze=>ze.map(Me=>{if(Me.id!==I)return Me;const Ke=Me.messages.map(Fe=>Fe.status==="streaming"?{...Fe,status:"done"}:Fe),qe=Me.messages.length<=2?fe.slice(0,40).replace(/\n/g," "):Me.title;return{...Me,messages:Ke,title:qe}})),Gn(null)},onError:ze=>{ln(Me=>Me.map(Ke=>{if(Ke.id!==I)return Ke;const qe=Ke.messages.map(Fe=>Fe.status==="streaming"?{...Fe,status:"error",content:Fe.content||ze}:Fe);return{...Ke,messages:qe}})),Gn(null)}})},Ns=(I,fe)=>{ln(ge=>ge.map(ke=>ke.id===I?{...ke,mode:fe}:ke)),Ce.updateSession(I,{mode:fe}).catch(console.error)},Sc=new Date().toISOString().slice(0,10),On=o[0],Ba={cto:"Chief Technology Officer",cbo:"Chief Business Officer",pm:"Product Manager",engineer:"Software Engineer",designer:"UI/UX Designer",qa:"QA Engineer"},rl=I=>{const fe=Ba[I];if(!fe)return"";for(const ge of f){const ke=ge.content,Ee=ke.indexOf(`## ${fe}`);if(Ee===-1)continue;const ze=ke.indexOf(`
84
+ ## `,Ee+10),Ke=(ze===-1?ke.slice(Ee):ke.slice(Ee,ze)).split(`
85
+ `).filter(qe=>qe.trim().length>0);for(const qe of Ke){const Fe=qe.replace(/^#+\s*/,"").replace(/\*\*/g,"").replace(/^[-*]\s+/,"").trim();if(!(Fe.startsWith("|")||Fe.startsWith("{")||Fe.startsWith("[")||Fe.startsWith("```")||Fe.startsWith("---")||Fe.includes("Journal")||Fe.includes("(c-level)")||Fe.includes("(team-lead)")||Fe.includes("(member)")||/^(CEO |작업 결과|생성\/수정|APPROVAL|비고|상황 보고|태스크$)/.test(Fe))&&Fe.length>15&&Fe.length<120)return Fe.slice(0,80)}}return""},jn=I=>{const fe=Ba[I];if(!fe)return"";for(const ge of f){const ke=ge.content,Ee=ke.indexOf(`## ${fe}`);if(Ee===-1)continue;const ze=ke.indexOf(`
86
+ ## `,Ee+10),Ke=(ze===-1?ke.slice(Ee):ke.slice(Ee,ze)).replace(/^## .+\n/,"").trim();if(Ke)return Ke.slice(0,1500)}return""},jl=NE(),ii=kE({roles:r,roleStatuses:vt,activeExecs:_e,getStandupSpeech:rl,onChat:jl.pushMessage,speechSettings:kn});return N?c.jsxs("div",{className:"h-screen flex flex-col bg-[var(--floor-light)]",style:{fontFamily:"var(--pixel-font)"},children:[(he||Qe.length>0)&&c.jsxs("div",{className:"shrink-0 z-[44]",children:[c.jsxs("div",{className:"flex items-center gap-3 px-5 py-2 text-xs cursor-pointer select-none",style:{background:"var(--accent)",color:"#fff",fontFamily:"var(--pixel-font)"},onClick:()=>ws(I=>!I),children:[he?c.jsx("div",{className:"w-3 h-3 border-2 border-white/40 border-t-white rounded-full animate-spin shrink-0"}):c.jsx("span",{className:"shrink-0",children:"✅"}),c.jsx("span",{className:"flex-1",children:he||"Knowledge import finished"}),Nt&&c.jsx("div",{className:"w-24 h-1.5 rounded-full overflow-hidden shrink-0",style:{background:"rgba(255,255,255,0.3)"},children:c.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Nt.index/Nt.total*100}%`,background:"#fff"}})}),c.jsx("span",{className:"text-[10px] opacity-70 shrink-0",children:tn?"▲":"▼"})]}),tn&&c.jsxs("div",{className:"overflow-y-auto text-xs",style:{background:"var(--terminal-bg)",borderBottom:"2px solid var(--accent)",maxHeight:240,fontFamily:"var(--pixel-font)"},children:[Qe.map(I=>c.jsxs("div",{className:"flex items-start gap-2 px-5 py-1.5",style:{borderBottom:"1px solid var(--terminal-border)"},children:[c.jsxs("span",{className:"shrink-0 mt-0.5",style:{width:14,textAlign:"center"},children:[I.type==="scan"&&"🔍",I.type==="process"&&"⚙️",I.type==="created"&&"✅",I.type==="done"&&"🎉",I.type==="error"&&"❌"]}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{style:{color:I.type==="error"?"#EF4444":I.type==="done"?"var(--active-green)":"var(--terminal-text)"},children:I.text}),I.detail&&c.jsx("div",{className:"text-[10px] truncate",style:{color:"var(--terminal-text-muted)"},children:I.detail})]})]},I.id)),c.jsx("div",{ref:Yl})]})]}),c.jsx("div",{className:"flex-1 flex items-center justify-center",children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-4xl mb-3",children:"🏢"}),c.jsx("div",{className:"text-gray-600 font-semibold text-xs",children:"LOADING OFFICE..."})]})})]}):L?c.jsx("div",{className:"h-screen flex items-center justify-center bg-[var(--floor-light)]",children:c.jsxs("div",{className:"text-center max-w-md",style:{fontFamily:"var(--pixel-font)"},children:[c.jsx("div",{className:"text-4xl mb-3",children:"⚠️"}),c.jsx("div",{className:"text-gray-800 font-semibold mb-2 text-xs",children:"CONNECTION ERROR"}),c.jsx("div",{className:"text-gray-500 text-xs mb-4",children:L}),c.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-gray-800 text-white text-xs font-bold cursor-pointer border-2 border-gray-600",style:{fontFamily:"var(--pixel-font)"},children:"RETRY"})]})}):c.jsxs("div",{className:"flex flex-col",style:{height:"100dvh",fontFamily:"var(--pixel-font)"},children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-2 bg-[var(--hud-bg)] text-white text-sm shrink-0 z-[45]",style:{borderBottom:"3px solid var(--pixel-border)"},children:[c.jsxs("div",{className:"font-black text-[13px] tracking-tight",style:{color:"var(--idle-amber)",textShadow:"2px 2px 0 rgba(0,0,0,0.5)"},children:["🏢"," ",c.jsx("span",{style:{color:"var(--terminal-text)"},children:k})]}),c.jsxs("div",{className:"flex gap-4 text-[var(--terminal-text-secondary)] text-[11px] items-center",children:[c.jsxs("div",{className:"hidden md:flex items-center gap-1",children:["💰",c.jsx("div",{className:"w-[50px] h-2 bg-[#111] overflow-hidden",style:{border:"2px solid var(--pixel-border)"},children:c.jsx("div",{className:"h-full",style:{width:"72%",background:"linear-gradient(90deg,#22c55e,#34D399)"}})}),c.jsx("strong",{className:"text-[var(--active-green)]",children:"$72K"})]}),c.jsxs("div",{className:"hidden md:flex items-center gap-1",children:["⚡",c.jsx("div",{className:"w-[50px] h-2 bg-[#111] overflow-hidden",style:{border:"2px solid var(--pixel-border)"},children:c.jsx("div",{className:"h-full",style:{width:"85%",background:"linear-gradient(90deg,#3b82f6,#60A5FA)"}})}),c.jsx("strong",{className:"text-[var(--terminal-text)]",children:"85"})]}),c.jsxs("span",{className:"hidden sm:inline",children:["Roles: ",c.jsx("strong",{className:"text-[var(--terminal-text)]",children:r.length})]}),c.jsxs("span",{className:"hidden sm:inline",children:["Projects: ",c.jsx("strong",{className:"text-[var(--terminal-text)]",children:o.length})]}),_e.length>0&&c.jsxs("span",{className:"text-amber-400",children:["Working: ",c.jsx("strong",{children:_e.length})]}),c.jsxs("button",{onClick:()=>ye.state!=="no-git"&&jt(!0),className:"flex items-center gap-1 cursor-pointer px-1.5 py-0.5",style:{background:"var(--hud-bg-alt)",border:"1px solid var(--pixel-border)",opacity:ye.state==="no-git"?.5:1,cursor:ye.state==="no-git"?"default":"pointer"},title:ye.state==="no-git"?'No git repository — run "git init" to enable save':ye.state==="dirty"?`${ye.dirtyCount} unsaved changes`:"All saved",children:[c.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:ye.state==="no-git"?"var(--terminal-text-muted)":ye.state==="saving"||ye.state==="dirty"?"var(--idle-amber)":ye.state==="error"?"#EF5350":"var(--active-green)",animation:ye.state==="saving"?"pulse 1s infinite":void 0}}),c.jsx("span",{children:Sc})]})]})]}),(he||Qe.length>0)&&c.jsxs("div",{className:"shrink-0 z-[44]",children:[c.jsxs("div",{className:"flex items-center gap-3 px-5 py-2 text-xs cursor-pointer select-none",style:{background:"var(--accent)",color:"#fff",fontFamily:"var(--pixel-font)"},onClick:()=>ws(I=>!I),children:[he?c.jsx("div",{className:"w-3 h-3 border-2 border-white/40 border-t-white rounded-full animate-spin shrink-0"}):c.jsx("span",{className:"shrink-0",children:"✅"}),c.jsx("span",{className:"flex-1",children:he||"Knowledge import finished"}),Nt&&c.jsx("div",{className:"w-24 h-1.5 rounded-full overflow-hidden shrink-0",style:{background:"rgba(255,255,255,0.3)"},children:c.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Nt.index/Nt.total*100}%`,background:"#fff"}})}),c.jsx("span",{className:"text-[10px] opacity-70 shrink-0",children:tn?"▲":"▼"})]}),tn&&c.jsxs("div",{className:"overflow-y-auto text-xs",style:{background:"var(--terminal-bg)",borderBottom:"2px solid var(--accent)",maxHeight:240,fontFamily:"var(--pixel-font)"},children:[Qe.map(I=>c.jsxs("div",{className:"flex items-start gap-2 px-5 py-1.5",style:{borderBottom:"1px solid var(--terminal-border)"},children:[c.jsxs("span",{className:"shrink-0 mt-0.5",style:{width:14,textAlign:"center"},children:[I.type==="scan"&&"🔍",I.type==="process"&&"⚙️",I.type==="created"&&"✅",I.type==="done"&&"🎉",I.type==="error"&&"❌"]}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{style:{color:I.type==="error"?"#EF4444":I.type==="done"?"var(--active-green)":"var(--terminal-text)"},children:I.text}),I.detail&&c.jsx("div",{className:"text-[10px] truncate",style:{color:"var(--terminal-text-muted)"},children:I.detail})]})]},I.id)),c.jsx("div",{ref:Yl}),Qe.length===0&&c.jsx("div",{className:"px-5 py-4 text-center",style:{color:"var(--terminal-text-muted)"},children:"Waiting for events..."})]})]}),c.jsxs("div",{className:"flex-1 overflow-hidden flex relative",children:[c.jsx("div",{className:"flex-1 overflow-y-auto relative floor-grid",style:{background:"var(--floor-light)"},children:Vl==="iso"?c.jsx(ZE,{roles:r,projects:o,waves:x,standups:f,decisions:y,roleStatuses:vt,activeExecs:_e,onRoleClick:I=>V({type:"role",roleId:I}),onProjectClick:I=>V({type:"project",projectId:I}),onBulletinClick:()=>V({type:"bulletin"}),onDecisionsClick:()=>V({type:"decisions"}),onKnowledgeClick:()=>V({type:"knowledge"}),knowledgeDocsCount:v.length,getRoleSpeech:ii.getSpeech,getAppearance:gt}):c.jsxs("div",{className:`${fn?"max-w-full":"max-w-[1100px]"} mx-auto h-full p-4 flex flex-col gap-3 relative z-[1]`,children:[(()=>{const I=r.filter(ge=>ge.level==="c-level"),fe=r.filter(ge=>ge.level!=="c-level");return c.jsxs(c.Fragment,{children:[I.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"pixel-section-label",children:"LEADERSHIP"}),c.jsx("div",{className:`grid gap-2 ${I.length===1?"grid-cols-1":"grid-cols-2"}`,children:I.map(ge=>{var ke;return c.jsx(k1,{role:ge,speech:ii.getSpeech(ge.id),onClick:()=>V({type:"role",roleId:ge.id}),liveStatus:vt[ge.id],activeTask:(ke=_e.find(Ee=>Ee.roleId===ge.id))==null?void 0:ke.task,featured:!0,appearance:gt(ge.id)},ge.id)})})]}),c.jsx("div",{className:"pixel-section-label",children:"TEAM"}),c.jsxs("div",{className:`grid gap-2 ${fn?"grid-cols-3":"grid-cols-4"}`,children:[fe.map(ge=>{var ke;return c.jsx(k1,{role:ge,speech:ii.getSpeech(ge.id),onClick:()=>V({type:"role",roleId:ge.id}),liveStatus:vt[ge.id],activeTask:(ke=_e.find(Ee=>Ee.roleId===ge.id))==null?void 0:ke.task,appearance:gt(ge.id)},ge.id)}),c.jsx("div",{className:"pixel-card pixel-card--hire",onClick:()=>je(!0),children:c.jsxs("div",{className:"pixel-card--hire-inner",children:[c.jsx("span",{className:"pixel-card--hire-icon",children:"+"}),c.jsx("span",{className:"pixel-card--hire-label",children:"HIRE NEW ROLE"})]})})]})]})})(),c.jsx("div",{className:"pixel-section-label mt-1",children:"OFFICE"}),c.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[c.jsxs("div",{className:"facility-card-compact",onClick:On?()=>V({type:"project",projectId:On.id}):void 0,style:On?void 0:{borderStyle:"dashed",opacity:.5},children:[c.jsxs("div",{className:"fcc-hdr",style:{background:"#3B82F6"},children:["🏢"," MEETING ROOM"]}),c.jsx("div",{className:"fcc-canvas",children:c.jsx(Vo,{type:"meeting"})}),c.jsxs("div",{className:"fcc-body",children:[c.jsx("div",{className:"fcc-desc",children:"Projects, PRDs, and task boards"}),On?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"fcc-title",children:['"',On.name,'"']}),c.jsxs("div",{className:"fcc-meta",children:["Status: ",c.jsx("strong",{style:{color:"var(--active-green)"},children:On.status})]})]}):c.jsx("div",{className:"fcc-meta",style:{fontStyle:"italic"},children:"No active projects"})]})]}),c.jsxs("div",{className:"facility-card-compact",onClick:()=>V({type:"bulletin"}),children:[c.jsxs("div",{className:"fcc-hdr",style:{background:"#64748b"},children:["📋"," BULLETIN"]}),c.jsx("div",{className:"fcc-canvas",children:c.jsx(Vo,{type:"bulletin"})}),c.jsxs("div",{className:"fcc-body",children:[c.jsx("div",{className:"fcc-desc",children:"Waves and daily standups"}),x.slice(0,1).map(I=>c.jsxs("div",{className:"fcc-item",children:["Wave ",I.id]},I.id)),f.slice(0,1).map(I=>c.jsxs("div",{className:"fcc-item",children:["Standup ",I.date]},I.date)),x.length===0&&f.length===0&&c.jsx("div",{className:"fcc-meta",style:{fontStyle:"italic"},children:"No entries yet"})]})]}),c.jsxs("div",{className:"facility-card-compact",onClick:()=>V({type:"decisions"}),children:[c.jsxs("div",{className:"fcc-hdr",style:{background:"#EF4444"},children:["📜"," DECISIONS"]}),c.jsx("div",{className:"fcc-canvas",children:c.jsx(Vo,{type:"decision"})}),c.jsxs("div",{className:"fcc-body",children:[c.jsx("div",{className:"fcc-desc",children:"CEO strategic decision log"}),c.jsxs("div",{className:"fcc-title",children:[y.length," decisions"]}),y.slice(0,2).map(I=>c.jsxs("div",{className:"fcc-item",children:["#",I.id," ",I.title]},I.id))]})]}),c.jsxs("div",{className:"facility-card-compact",onClick:()=>V({type:"knowledge"}),children:[c.jsxs("div",{className:"fcc-hdr",style:{background:"#0D9488"},children:["📚"," KNOWLEDGE"]}),c.jsx("div",{className:"fcc-canvas",children:c.jsx(Vo,{type:"knowledge"})}),c.jsxs("div",{className:"fcc-body",children:[c.jsx("div",{className:"fcc-desc",children:"Research, analysis, and references"}),c.jsxs("div",{className:"fcc-title",children:[v.length," docs"]}),v.slice(0,2).map(I=>c.jsx("div",{className:"fcc-item",children:I.title},I.id))]})]})]})]})}),fn&&c.jsx("div",{className:_a?"absolute inset-0 z-50":"contents",children:c.jsx(oE,{sessions:Ra,activeSessionId:Kl,roles:r,streamingSessionId:ni,width:_a?ks:Ql,onWidthChange:_a?void 0:js,onSwitchSession:al,onCloseSession:Cs,onCreateSession:Wl,onClearEmpty:Sl,onCloseAll:Pl,onSendMessage:ri,onModeChange:Ns,onCloseTerminal:()=>Gl(!1),chatChannels:jl.channels,activeChatChannelId:jl.activeChannelId,onSwitchChatChannel:jl.setActiveChannelId,onCreateChatChannel:jl.createChannel,onDeleteChatChannel:jl.deleteChannel})})]}),c.jsxs("div",{className:"flex items-center justify-between px-5 py-2 bg-[var(--hud-bg)] text-[var(--terminal-text-secondary)] text-[10px] shrink-0 z-[45]",style:{borderTop:"3px solid var(--pixel-border)"},children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{onClick:()=>Xl("card"),className:`view-toggle-btn ${Vl==="card"?"active":""}`,children:"CARD"}),c.jsx("button",{onClick:()=>Xl("iso"),className:`view-toggle-btn ${Vl==="iso"?"active":""}`,children:"ISO"}),c.jsx("span",{className:"mx-1",children:"|"}),c.jsxs("button",{className:"theme-btn",onClick:()=>{we("office"),G(r[0]??null)},title:"Customize",children:[((or=Na[St])==null?void 0:or.icon)??""," ",((si=Na[St])==null?void 0:si.name)??"THEME"]}),c.jsx("span",{className:"mx-1",children:"|"}),c.jsx("span",{style:{color:ye.state==="dirty"?"var(--idle-amber)":"var(--terminal-text-muted)"},children:ye.state==="no-git"?"No git":ye.state==="saving"?"Saving...":ye.state==="dirty"?`${ye.dirtyCount} unsaved`:ye.lastSaved?`Saved ${(()=>{const I=Math.floor((Date.now()-new Date(ye.lastSaved).getTime())/6e4);return I<1?"just now":I<60?`${I}m ago`:`${Math.floor(I/60)}h ago`})()}`:"Saved"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[de&&xe&&c.jsx("button",{onClick:()=>ce(!1),className:"px-3 py-1 font-black text-white cursor-pointer animate-pulse",style:{background:"#B71C1C",border:"2px solid #7f121288",fontFamily:"var(--pixel-font)",borderRadius:4},children:"WAVE"}),D.length>0&&Z&&c.jsxs("button",{onClick:()=>re(!1),className:"px-3 py-1 font-black text-white cursor-pointer animate-pulse",style:{background:D[D.length-1].color,border:`2px solid ${D[D.length-1].color}88`,fontFamily:"var(--pixel-font)",borderRadius:4},children:[D[D.length-1].title.slice(0,20),D[D.length-1].title.length>20?"..":""]}),c.jsxs("button",{onClick:()=>ne(!0),className:"wave-btn px-3 py-1 font-black text-white cursor-pointer",style:{background:"#B71C1C",border:"2px solid #7f1212",fontFamily:"var(--pixel-font)"},children:["🔴"," CEO WAVE"]}),c.jsx("button",{onClick:()=>fn?Gl(!1):Oa(),className:"px-3 py-1 font-black cursor-pointer",style:{background:fn?"var(--terminal-bg)":"var(--hud-bg-alt)",color:"var(--terminal-text)",border:`2px solid ${fn?"var(--terminal-border-hover)":"var(--pixel-border)"}`,fontFamily:"var(--pixel-font)"},children:"TERMINAL"})]}),c.jsxs("span",{children:["Expand: +",Math.max(0,10-r.length)," desks available"]})]}),K.type==="role"&&M&&(()=>{const I=_e.find(fe=>fe.roleId===M.id);return c.jsx(z5,{role:M,allRoles:r,recentActivity:jn(M.id),onClose:Ut,onFireRole:(fe,ge)=>{xt({roleId:fe,roleName:ge}),Ut()},terminalWidth:fn?Ql:0,activeJobId:I==null?void 0:I.id,activeTask:I==null?void 0:I.task,isWorking:vt[M.id]==="working",jobStartedAt:I==null?void 0:I.startedAt,onStopJob:fe=>Ce.abortJob(fe),sessions:Ra,streamingSessionId:ni,onCreateSessionSilent:Ht,onSendMessage:ri,onFocusTerminal:Es,onCustomize:fe=>{const ge=r.find(ke=>ke.id===fe);ge&&(we("character"),G(ge))},onUpdateRole:kl,appearance:gt(M.id)})})(),K.type==="project"&&On&&c.jsx(Cj,{projectId:On.id,onClose:Ut,terminalWidth:fn?Ql:0}),(K.type==="bulletin"||K.type==="decisions")&&c.jsx(jj,{standups:f,waves:x,decisions:y,mode:K.type==="bulletin"?"bulletin":"decisions",onClose:Ut,terminalWidth:fn?Ql:0}),K.type==="knowledge"&&c.jsx(Sj,{docs:v,onClose:Ut,onRefresh:()=>Ce.getKnowledge().then(b).catch(()=>{}),terminalWidth:fn?Ql:0,initialDocId:K.docId}),Q&&c.jsx(Tj,{roleId:Q.roleId,roleName:Q.roleName,mode:Q.mode,onClose:()=>ie(null),onExecutionStart:Zl}),de&&!xe&&c.jsx(Lj,{directive:de.directive,rootJobs:de.rootJobs,orgNodes:A,rootRoleId:Y,onClose:()=>{pe(null),ce(!1)},onMinimize:()=>ce(!0),onDone:()=>{li(),_t("Wave complete","#2E7D32")},onOpenKnowledgeDoc:I=>{pe(null),ce(!1),V({type:"knowledge",docId:I}),Ce.getKnowledge().then(b).catch(()=>{})}}),D.length>0&&!Z&&(()=>{var ge;const I=D[D.length-1],fe=te.length>1;return c.jsxs(c.Fragment,{children:[fe&&D.length===1&&c.jsx("div",{className:"fixed top-[5%] left-1/2 -translate-x-1/2 w-[720px] max-w-[95vw] z-[63] flex gap-1 px-2 pt-2",children:te.map((ke,Ee)=>c.jsx("button",{onClick:()=>{q(Ee),U([{jobId:ke.jobId,title:`CEO WAVE · ${ke.roleId.toUpperCase()}`,color:"#B71C1C"}])},className:"px-3 py-1.5 text-xs font-bold rounded-t-lg cursor-pointer transition-colors",style:{background:z===Ee?"#B71C1C":"var(--terminal-bg)",color:z===Ee?"#fff":"var(--terminal-text-secondary)",border:`1px solid ${z===Ee?"#B71C1C":"var(--terminal-border)"}`,borderBottom:"none"},children:ke.roleId.toUpperCase()},ke.jobId))}),c.jsx(Dj,{jobId:I.jobId,title:D.length>1?I.title:fe?`CEO WAVE · ${((ge=te[z])==null?void 0:ge.roleName)??""}`:I.title,color:I.color,variant:"modal",style:fe&&D.length===1?{marginTop:28}:void 0,onClose:()=>{U([]),F([]),q(0),re(!1)},onMinimize:()=>re(!0),onDone:()=>{wc(),li()},onNavigateToJob:ke=>{Ce.getJob(ke).then(Ee=>{const ze=_d[Ee.roleId]??"#888";U(Me=>[...Me,{jobId:ke,title:`${Ee.roleId.toUpperCase()} · ${Ee.task.slice(0,40)}`,color:ze}])}).catch(console.error)},onOpenKnowledgeDoc:ke=>{U([]),F([]),q(0),re(!1),V({type:"knowledge",docId:ke}),Ce.getKnowledge().then(b).catch(()=>{})}},I.jobId)]})})(),D.length>1&&c.jsx("div",{className:"fixed top-[5%] left-1/2 -translate-x-1/2 w-[720px] max-w-[95vw] z-[62] pointer-events-none",children:c.jsx("div",{className:"pointer-events-auto",children:c.jsxs("button",{onClick:()=>U(I=>I.slice(0,-1)),className:"mt-2 ml-2 px-3 py-1 text-xs font-bold text-[var(--terminal-text)] bg-[var(--terminal-bg)] border border-[var(--terminal-border)] rounded-lg cursor-pointer hover:bg-[var(--terminal-inline-bg)]",children:["←"," Back to ",(La=D[D.length-2])==null?void 0:La.title]})})}),B&&c.jsx(Mj,{cLevelRoles:r.filter(I=>I.level==="c-level"),orgNodes:A,rootId:Y,onClose:()=>ne(!1),onDispatch:kc}),ve&&c.jsx(Ij,{existingRoles:r,onClose:()=>je(!1),onHire:ai}),tt&&c.jsx(Yj,{roleId:tt.roleId,roleName:tt.roleName,onClose:()=>xt(null),onConfirm:Jl}),Sn&&c.jsx(JE,{role:Sn,appearance:gt(Sn.id),onSave:I=>Zt(Sn.id,I),onReset:()=>un(Sn.id),onClose:()=>{G(null),we("character")},theme:St,onThemeChange:wn,onUpdateName:async(I,fe)=>{await kl(I,{name:fe})},initialTab:se,speechSettings:kn,onSpeechSettingsChange:Dt}),Be&&c.jsx(WE,{status:ye.status,history:ye.history,onClose:()=>jt(!1),onSave:async I=>await ye.save(I),onLoadHistory:ye.loadHistory,onRestore:ye.restore,saving:ye.state==="saving"}),c.jsx("div",{className:"fixed top-16 right-4 z-[70] flex flex-col gap-2",children:Ft.map(I=>c.jsxs("div",{className:"toast-enter flex items-center gap-2 px-4 py-2.5 shadow-lg text-white text-xs font-black",style:{background:I.color,border:"2px solid rgba(0,0,0,0.3)",fontFamily:"var(--pixel-font)"},children:[c.jsx("div",{className:"w-2 h-2 bg-white/60"}),I.message]},I.id))})]})}function k1({role:t,speech:l,onClick:r,liveStatus:i,activeTask:o,featured:u,appearance:f}){const m=_d[t.id]??nC(t.id),x=eC[t.id]??1,h=tC[t.id]??t.name,y=i==="working",g=y&&o?o:l||h;return c.jsxs("div",{className:`pixel-card ${y?"working":""} ${u?"pixel-card--featured":""}`,onClick:r,children:[c.jsxs("div",{className:"pixel-card-hdr",style:{background:m},children:[c.jsxs("span",{children:[t.id.toUpperCase()," ","·"," ",t.name.toUpperCase()]}),c.jsxs("span",{className:"lvl",children:["Lv.",x]})]}),c.jsxs("div",{className:"pixel-card-body",children:[c.jsx("div",{className:"pixel-desk"}),c.jsx(vc,{roleId:t.id,appearance:f}),c.jsx("div",{className:"pixel-status-dot",style:{background:y?"var(--idle-amber)":"var(--active-green)"}})]}),c.jsxs("div",{className:"pixel-card-task",children:[c.jsx("span",{className:"pixel-card-task-icon",children:y?"🛠️":PE[t.id]??"👤"}),c.jsx("span",{className:"pixel-card-task-text",children:g||h})]})]})}function md({onSelect:t,onClose:l}){const[r,i]=j.useState(null),[o,u]=j.useState(!0),f=j.useCallback(async m=>{u(!0);try{const x=await Ce.browse(m);i(x)}catch{}finally{u(!1)}},[]);return j.useEffect(()=>{f()},[f]),o&&!r?c.jsx("div",{className:"mt-3 rounded-lg p-4 text-xs text-center",style:{background:"var(--terminal-bg)",border:"1px solid var(--terminal-border)",color:"var(--terminal-text-muted)"},children:"Loading..."}):r?c.jsxs("div",{className:"mt-3 rounded-lg overflow-hidden text-xs",style:{background:"var(--terminal-bg)",border:"1px solid var(--terminal-border)",maxHeight:220,overflowY:"auto"},children:[c.jsxs("div",{className:"px-3 py-2 flex items-center gap-2 sticky top-0",style:{background:"var(--terminal-surface)",borderBottom:"1px solid var(--terminal-border)"},children:[c.jsx("span",{style:{color:"var(--terminal-text-secondary)",fontFamily:"var(--pixel-font)"},className:"truncate flex-1",children:r.current}),c.jsx("button",{onClick:()=>t(r.current),className:"px-2 py-1 rounded text-[10px] font-medium shrink-0",style:{background:"var(--active-green)",color:"#fff"},children:"Select"}),c.jsx("button",{onClick:l,className:"opacity-50 hover:opacity-100 shrink-0",style:{color:"var(--terminal-text)"},children:"✕"})]}),r.parent&&c.jsxs("div",{className:"px-3 py-1.5 cursor-pointer flex items-center gap-2 hover:bg-[var(--terminal-surface-light)]",style:{color:"var(--terminal-text-secondary)"},onClick:()=>f(r.parent),children:[c.jsx("span",{children:"⬆️"}),c.jsx("span",{children:".."})]}),r.dirs.map(m=>c.jsxs("div",{className:"px-3 py-1.5 cursor-pointer flex items-center gap-2 hover:bg-[var(--terminal-surface-light)]",style:{color:"var(--terminal-text)"},onClick:()=>f(m.path),children:[c.jsx("span",{children:"📁"}),c.jsx("span",{children:m.name})]},m.path)),r.dirs.length===0&&c.jsx("div",{className:"px-3 py-3 text-center",style:{color:"var(--terminal-text-muted)"},children:"No subdirectories"})]}):null}const aC={engine:"AI Engine",company:"Company Info",project:"Project",knowledge:"Knowledge",team:"Team Template",create:"Create"};function S1(t){switch(t){case"skip":return["engine","company","project","knowledge","team","create"];case"import":return["engine","company","project","knowledge","team","create"];case"existing-akb":return["engine","knowledge","create"]}}function rC({onComplete:t}){const[l,r]=j.useState(0),[i,o]=j.useState(null),[u,f]=j.useState("none"),[m,x]=j.useState(""),[h,y]=j.useState(!0),[g,v]=j.useState(""),[b,k]=j.useState(""),E=j.useRef(null),[N,T]=j.useState("fresh"),[L,$]=j.useState(""),[K,V]=j.useState(null),[M,J]=j.useState(!1),[Q,ie]=j.useState(!1),[D,U]=j.useState("skip"),[B,ne]=j.useState([]),[te,F]=j.useState(""),[z,q]=j.useState(!1),[Z,re]=j.useState(""),[A,_]=j.useState(null),[Y,C]=j.useState(!1),[de,pe]=j.useState(!1),[xe,ce]=j.useState([]),[ve,je]=j.useState("startup"),[tt,xt]=j.useState(!1),[vt,Lt]=j.useState(!1),[_e,bt]=j.useState(null),[Ft,_n]=j.useState([]),[gt,Zt]=j.useState(!1),un=j.useMemo(()=>S1(D),[D]),St=un[l]??"engine";j.useEffect(()=>{Ce.detectEngine().then(he=>{o(he),f(he.recommended),y(!1)}).catch(()=>y(!1)),Ce.getTeams().then(ce).catch(()=>{})},[]),j.useEffect(()=>{var he;St==="company"&&((he=E.current)==null||he.focus())},[St]);const wn=()=>{switch(St){case"engine":return u!=="none"||m.length>10;case"company":return g.trim().length>0;case"project":return N==="fresh"||N==="existing"&&K===!0;case"knowledge":return D==="existing-akb"?A===!0:D==="import"?B.length>0:!0;case"team":return!0;case"create":return!vt;default:return!1}},kn=()=>{l<un.length-1&&wn()&&r(l+1),St==="create"&&!tt&&!gt&&(D==="existing-akb"?ye():we())},Dt=()=>{l>0&&r(l-1)};j.useEffect(()=>{const he=S1(D);l>=he.length&&r(he.length-1)},[D,l]);const Sn=async()=>{if(L.trim()){J(!0);try{const he=await Ce.validatePath(L.trim());V(he.valid)}catch{V(!1)}finally{J(!1)}}},G=async()=>{if(Z.trim()){C(!0);try{const he=await Ce.validatePath(Z.trim());_(he.valid&&he.hasClaudeMd===!0)}catch{_(!1)}finally{C(!1)}}},se=()=>{const he=te.trim();he&&!B.includes(he)&&(ne([...B,he]),F(""))},we=async()=>{xt(!0),bt(null);try{const he={companyName:g.trim(),description:b.trim()||"An AI-powered organization",team:ve,existingProjectPath:N==="existing"?L.trim():void 0,knowledgePaths:D==="import"&&B.length>0?B:void 0};(u==="direct-api"||m)&&(he.apiKey=m||void 0);const We=await Ce.scaffold(he);_n(We.created),Lt(!0)}catch(he){bt(he instanceof Error?he.message:"Scaffold failed")}finally{xt(!1)}},ye=async()=>{Zt(!0),bt(null);try{const he=await Ce.connectAkb(Z.trim());he.ok?(Lt(!0),_n([`Connected to: ${he.companyRoot}`])):bt(he.error||"Failed to connect")}catch(he){bt(he instanceof Error?he.message:"Connect failed")}finally{Zt(!1)}},Be=()=>{D==="import"&&B.length>0?t({paths:B,companyRoot:""}):t()},jt=he=>{he.key==="Enter"&&wn()&&(he.preventDefault(),kn())},Nt=`w-full px-3 py-2 rounded text-sm outline-none transition-colors
87
+ bg-[var(--terminal-bg)] text-[var(--terminal-text)]
88
+ border border-[var(--terminal-border)]
89
+ focus:border-[var(--terminal-border-hover)]
90
+ placeholder:text-[var(--terminal-text-muted)]`,it=he=>`p-4 rounded-lg border-2 cursor-pointer transition-all text-[var(--terminal-text)] ${he?"border-[var(--accent)] bg-[var(--accent)]/10":"border-[var(--terminal-border)] bg-[var(--hud-bg-alt)] hover:border-[var(--accent)]/50"}`;return c.jsx("div",{className:"h-full flex items-center justify-center",style:{background:"var(--floor-dark)"},onKeyDown:jt,children:c.jsxs("div",{className:"w-full max-w-xl rounded-xl shadow-2xl overflow-hidden",style:{background:"var(--hud-bg)",border:"1px solid var(--terminal-border)"},children:[c.jsxs("div",{className:"px-6 py-5",style:{background:"var(--terminal-bg)",borderBottom:"1px solid var(--terminal-border)"},children:[c.jsx("div",{className:"text-lg font-bold",style:{color:"var(--terminal-text)",fontFamily:"var(--pixel-font)"},children:"tycono"}),c.jsx("div",{className:"text-xs mt-1",style:{color:"var(--terminal-text-secondary)"},children:"Build an AI company. Watch them work."}),c.jsx("div",{className:"flex gap-1.5 mt-4",children:un.map((he,We)=>c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"h-1 rounded-full transition-colors",style:{background:We<=l?"var(--accent)":"var(--terminal-surface-light)"}}),c.jsx("div",{className:"text-[9px] mt-1 truncate",style:{color:We===l?"var(--terminal-text)":"var(--terminal-text-muted)"},children:aC[he]})]},he))})]}),c.jsxs("div",{className:"px-6 py-5 min-h-[280px]",children:[St==="engine"&&c.jsxs("div",{className:"space-y-4",children:[c.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--terminal-text)"},children:"AI Engine Setup"}),h?c.jsx("div",{className:"text-sm",style:{color:"var(--terminal-text-secondary)"},children:"Detecting AI engine..."}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:it(u==="claude-cli"),onClick:()=>(i==null?void 0:i.claudeCli)&&f("claude-cli"),style:{opacity:i!=null&&i.claudeCli?1:.4},children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-lg",children:i!=null&&i.claudeCli?"✅":"❌"}),c.jsxs("div",{children:[c.jsx("div",{className:"font-medium text-sm",children:"Claude Code CLI"}),c.jsx("div",{className:"text-xs opacity-70",children:i!=null&&i.claudeCli?"Detected! Recommended — zero config needed.":"Not installed. Get it at claude.ai/download"})]})]})}),c.jsxs("div",{className:it(u==="direct-api"),onClick:()=>f("direct-api"),children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-lg",children:i!=null&&i.apiKey?"✅":"🔑"}),c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"font-medium text-sm",children:"Anthropic API Key (BYOK)"}),c.jsx("div",{className:"text-xs opacity-70",children:i!=null&&i.apiKey?"API key found in environment.":"Enter your ANTHROPIC_API_KEY"})]})]}),u==="direct-api"&&!(i!=null&&i.apiKey)&&c.jsx("input",{type:"password",className:`${Nt} mt-3`,placeholder:"sk-ant-...",value:m,onChange:he=>x(he.target.value),autoFocus:!0})]})]})]}),St==="company"&&c.jsxs("div",{className:"space-y-4",children:[c.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--terminal-text)"},children:"Company Info"}),c.jsxs("div",{children:[c.jsx("label",{className:"text-xs font-medium block mb-1",style:{color:"var(--terminal-text-secondary)"},children:"Company Name *"}),c.jsx("input",{ref:E,className:Nt,placeholder:"e.g. Acme Corp",value:g,onChange:he=>v(he.target.value)})]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-xs font-medium block mb-1",style:{color:"var(--terminal-text-secondary)"},children:"Description"}),c.jsx("textarea",{className:`${Nt} resize-none`,rows:3,placeholder:"What does your AI company do?",value:b,onChange:he=>k(he.target.value)})]})]}),St==="project"&&c.jsxs("div",{className:"space-y-4",children:[c.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--terminal-text)"},children:"Project Setup"}),c.jsxs("div",{className:it(N==="fresh"),onClick:()=>{T("fresh"),V(null)},children:[c.jsxs("div",{className:"font-medium text-sm",children:["🌱"," Start Fresh"]}),c.jsx("div",{className:"text-xs opacity-70 mt-1",children:"Create a new AI company from scratch with clean directory structure."})]}),c.jsxs("div",{className:it(N==="existing"),onClick:()=>T("existing"),children:[c.jsxs("div",{className:"font-medium text-sm",children:["📂"," Connect Existing Project"]}),c.jsx("div",{className:"text-xs opacity-70 mt-1",children:"Add AI company structure to an existing codebase or knowledge base."}),N==="existing"&&c.jsxs("div",{className:"mt-3",onClick:he=>he.stopPropagation(),children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{className:`${Nt} flex-1`,placeholder:"/path/to/your/project",value:L,onChange:he=>{$(he.target.value),V(null)},autoFocus:!0}),c.jsx("button",{onClick:()=>ie(!Q),className:"px-3 py-2 rounded text-xs font-medium transition-colors",style:{background:"var(--hud-bg-alt)",color:"var(--terminal-text)"},title:"Browse folders",children:"📁"}),c.jsx("button",{onClick:Sn,disabled:M||!L.trim(),className:"px-3 py-2 rounded text-xs font-medium transition-colors",style:{background:"var(--accent)",color:"#fff",opacity:M||!L.trim()?.5:1},children:M?"...":"Verify"})]}),K===!0&&c.jsxs("div",{className:"text-xs mt-2",style:{color:"var(--active-green)"},children:["✅"," Path verified: ",L]}),K===!1&&c.jsxs("div",{className:"text-xs mt-2",style:{color:"#EF4444"},children:["❌"," Invalid path"]}),Q&&c.jsx(md,{onSelect:he=>{$(he),V(!0),ie(!1)},onClose:()=>ie(!1)})]})]})]}),St==="knowledge"&&c.jsxs("div",{className:"space-y-3",children:[c.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--terminal-text)"},children:"Knowledge Strategy"}),c.jsx("p",{className:"text-xs",style:{color:"var(--terminal-text-secondary)"},children:"How should AI handle your knowledge base?"}),c.jsxs("div",{className:it(D==="skip"),onClick:()=>U("skip"),children:[c.jsxs("div",{className:"font-medium text-sm",children:["🌱"," Start Fresh"]}),c.jsx("div",{className:"text-xs opacity-70 mt-1",children:"Empty knowledge base. Add documents later from the office."})]}),c.jsxs("div",{className:it(D==="import"),onClick:()=>U("import"),children:[c.jsxs("div",{className:"font-medium text-sm",children:["📚"," Import & Build"]}),c.jsx("div",{className:"text-xs opacity-70 mt-1",children:"Select folders with documents — AI reads, summarizes, and organizes them."}),D==="import"&&c.jsxs("div",{className:"mt-3 space-y-2",onClick:he=>he.stopPropagation(),children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{className:`${Nt} flex-1`,placeholder:"/path/to/docs",value:te,onChange:he=>F(he.target.value),onKeyDown:he=>{he.key==="Enter"&&(he.preventDefault(),se())},autoFocus:!0}),c.jsx("button",{onClick:()=>q(!z),className:"px-3 py-2 rounded text-xs font-medium transition-colors",style:{background:"var(--hud-bg-alt)",color:"var(--terminal-text)"},title:"Browse folders",children:"📁"}),c.jsx("button",{onClick:se,disabled:!te.trim(),className:"px-3 py-2 rounded text-xs font-medium",style:{background:"var(--accent)",color:"#fff",opacity:te.trim()?1:.5},children:"Add"})]}),z&&c.jsx(md,{onSelect:he=>{B.includes(he)||ne([...B,he]),q(!1)},onClose:()=>q(!1)}),B.length>0&&c.jsx("div",{className:"space-y-1",children:B.map((he,We)=>c.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded text-xs",style:{background:"var(--terminal-bg)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)"},children:[c.jsx("span",{className:"flex-1 truncate",style:{fontFamily:"var(--pixel-font)"},children:he}),c.jsx("button",{onClick:()=>ne(B.filter((Qe,Rn)=>Rn!==We)),className:"opacity-50 hover:opacity-100",children:"✕"})]},We))}),B.length===0&&c.jsx("div",{className:"text-[10px] text-center py-2",style:{color:"var(--terminal-text-muted)"},children:"Add at least one folder to import."})]})]}),c.jsxs("div",{className:it(D==="existing-akb"),onClick:()=>U("existing-akb"),children:[c.jsxs("div",{className:"font-medium text-sm",children:["🔗"," Connect Existing AKB"]}),c.jsx("div",{className:"text-xs opacity-70 mt-1",children:"Connect a directory that already has CLAUDE.md and AKB structure."}),D==="existing-akb"&&c.jsxs("div",{className:"mt-3",onClick:he=>he.stopPropagation(),children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{className:`${Nt} flex-1`,placeholder:"/path/to/your/akb",value:Z,onChange:he=>{re(he.target.value),_(null)},autoFocus:!0}),c.jsx("button",{onClick:()=>pe(!de),className:"px-3 py-2 rounded text-xs font-medium transition-colors",style:{background:"var(--hud-bg-alt)",color:"var(--terminal-text)"},title:"Browse folders",children:"📁"}),c.jsx("button",{onClick:G,disabled:Y||!Z.trim(),className:"px-3 py-2 rounded text-xs font-medium transition-colors",style:{background:"var(--accent)",color:"#fff",opacity:Y||!Z.trim()?.5:1},children:Y?"...":"Verify"})]}),A===!0&&c.jsxs("div",{className:"text-xs mt-2",style:{color:"var(--active-green)"},children:["✅"," Valid AKB found: ",Z]}),A===!1&&c.jsxs("div",{className:"text-xs mt-2",style:{color:"#EF4444"},children:["❌"," No valid AKB (CLAUDE.md required)"]}),de&&c.jsx(md,{onSelect:he=>{re(he),_(null),pe(!1)},onClose:()=>pe(!1)})]})]})]}),St==="team"&&c.jsxs("div",{className:"space-y-4",children:[c.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--terminal-text)"},children:"Team Template"}),c.jsx("p",{className:"text-xs",style:{color:"var(--terminal-text-secondary)"},children:"Choose a starting team. You can add or remove roles later."}),xe.map(he=>c.jsxs("div",{className:it(ve===he.id),onClick:()=>je(he.id),children:[c.jsx("div",{className:"font-medium text-sm capitalize",children:he.id}),c.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:he.roles.map(We=>c.jsx("span",{className:"px-2 py-0.5 rounded text-[10px]",style:{background:"var(--terminal-bg)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)"},children:We.name},We.id))})]},he.id)),c.jsxs("div",{className:it(ve==="custom"),onClick:()=>je("custom"),children:[c.jsx("div",{className:"font-medium text-sm",children:"Custom"}),c.jsx("div",{className:"text-xs opacity-70 mt-1",children:"Start with no pre-built roles. Hire them from the office."})]})]}),St==="create"&&c.jsxs("div",{className:"space-y-4",children:[c.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--terminal-text)"},children:vt?D==="existing-akb"?"AKB Connected!":"Company Created!":"Review & Create"}),!vt&&!tt&&!gt&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"rounded-lg p-4 space-y-2 text-xs",style:{background:"var(--terminal-bg)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)",fontFamily:"var(--pixel-font)"},children:D==="existing-akb"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("span",{className:"opacity-50",children:"Mode:"})," Connect Existing AKB"]}),c.jsxs("div",{children:[c.jsx("span",{className:"opacity-50",children:"Path:"})," ",Z]}),c.jsxs("div",{children:[c.jsx("span",{className:"opacity-50",children:"Engine:"})," ",u==="claude-cli"?"Claude Code CLI":"Direct API"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("span",{className:"opacity-50",children:"Company:"})," ",g]}),c.jsxs("div",{children:[c.jsx("span",{className:"opacity-50",children:"Engine:"})," ",u==="claude-cli"?"Claude Code CLI":"Direct API"]}),c.jsxs("div",{children:[c.jsx("span",{className:"opacity-50",children:"Project:"})," ",N==="fresh"?"Start Fresh":`Existing (${L})`]}),c.jsxs("div",{children:[c.jsx("span",{className:"opacity-50",children:"Knowledge:"})," ",D==="skip"?"Fresh (empty)":`Import ${B.length} source(s)`]}),c.jsxs("div",{children:[c.jsx("span",{className:"opacity-50",children:"Team:"})," ",ve]}),D==="import"&&B.length>0&&c.jsx("div",{className:"text-[10px] mt-1",style:{color:"var(--idle-amber)"},children:"Knowledge import will run in the background after entering the office."})]})}),_e&&c.jsx("div",{className:"text-xs p-3 rounded",style:{background:"rgba(220,38,38,0.15)",color:"#f87171"},children:_e})]}),(tt||gt)&&c.jsxs("div",{className:"flex flex-col items-center py-8 gap-3",children:[c.jsx("div",{className:"w-8 h-8 border-2 rounded-full animate-spin",style:{borderColor:"var(--terminal-border)",borderTopColor:"var(--accent)"}}),c.jsx("div",{className:"text-sm",style:{color:"var(--terminal-text-secondary)"},children:gt?"Connecting to AKB...":"Scaffolding your company..."})]}),vt&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"text-center py-4 text-4xl",children:"🏢"}),c.jsx("div",{className:"rounded-lg p-4 text-xs max-h-40 overflow-y-auto",style:{background:"var(--terminal-bg)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)",fontFamily:"var(--pixel-font)"},children:Ft.map((he,We)=>c.jsxs("div",{className:"py-0.5",children:[c.jsx("span",{style:{color:"var(--active-green)"},children:"✓"})," ",he]},We))}),D==="import"&&B.length>0&&c.jsx("div",{className:"text-xs p-3 rounded",style:{background:"var(--accent)",color:"#fff",opacity:.9},children:"Knowledge import will start in the background after entering the office."})]})]})]}),c.jsxs("div",{className:"px-6 py-4 flex justify-between items-center",style:{borderTop:"1px solid var(--terminal-border)"},children:[c.jsx("div",{children:l>0&&!vt&&c.jsx("button",{onClick:Dt,className:"px-4 py-2 rounded text-sm transition-colors",style:{color:"var(--terminal-text-secondary)",border:"1px solid var(--terminal-border)"},children:"Back"})}),c.jsxs("div",{className:"text-xs",style:{color:"var(--terminal-text-muted)"},children:[l+1," / ",un.length]}),c.jsx("div",{children:vt?c.jsx("button",{onClick:Be,className:"px-5 py-2 rounded text-sm font-medium transition-colors",style:{background:"var(--active-green)",color:"#fff"},children:"Enter Office"}):c.jsx("button",{onClick:kn,disabled:!wn()||tt||gt,className:"px-5 py-2 rounded text-sm font-medium transition-colors",style:{background:wn()?"var(--accent)":"var(--terminal-border)",color:"#fff",opacity:wn()&&!tt&&!gt?1:.5},children:St==="create"?tt||gt?gt?"Connecting...":"Creating...":D==="existing-akb"?"Connect AKB":"Create Company":"Next"})})]})]})})}function iC(){const[t,l]=j.useState(null),[r,i]=j.useState(!0),[o,u]=j.useState(null),f=j.useCallback(async()=>{i(!0),u(null);try{const m=await Ce.getStatus();l(m)}catch(m){u(m instanceof Error?m.message:"Failed to fetch status")}finally{i(!1)}},[]);return j.useEffect(()=>{f()},[f]),{initialized:(t==null?void 0:t.initialized)??!1,companyName:(t==null?void 0:t.companyName)??null,engine:(t==null?void 0:t.engine)??"none",companyRoot:(t==null?void 0:t.companyRoot)??"",loading:r,error:o,refetch:f}}const sC=j.lazy(()=>jb(()=>import("./preview-app-a8V0eihg.js"),[]));function r0(){return c.jsx("div",{className:"h-full flex items-center justify-center",style:{background:"var(--floor-dark)"},children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"w-10 h-10 mx-auto border-2 rounded-full animate-spin",style:{borderColor:"var(--terminal-border)",borderTopColor:"var(--accent)"}}),c.jsx("div",{className:"mt-4 text-sm",style:{color:"var(--terminal-text-secondary)",fontFamily:"var(--pixel-font)"},children:"Loading..."})]})})}function oC(){var t;try{const l=localStorage.getItem("tycono-theme")||localStorage.getItem("the-company-theme"),r=l&&l in Na?l:"default",i=(t=Na[r])==null?void 0:t.vars;if(!i)return;const o=document.documentElement;for(const[u,f]of Object.entries(i))o.style.setProperty(u,f)}catch{}}function cC(){const{initialized:t,loading:l,refetch:r}=iC(),[i,o]=j.useState(null);j.useEffect(()=>{oC()},[]);const u=f=>{f&&o(f),r()};return l?c.jsx(r0,{}):t?c.jsx(lC,{importJob:i,onImportDone:()=>o(null)}):c.jsx(rC,{onComplete:u})}function uC(){const t=new URLSearchParams(window.location.search).has("sprite-preview");return c.jsx(Eb,{children:t?c.jsx(j.Suspense,{fallback:c.jsx(r0,{}),children:c.jsx(sC,{})}):c.jsx(cC,{})})}wb.createRoot(document.getElementById("root")).render(c.jsx(j.StrictMode,{children:c.jsx(uC,{})}));export{Qy as H,Zy as P,Jy as S,hC as a,Ky as b,Gy as c,Nd as d,t5 as e,e5 as f,dC as g,n5 as h,c as j,j as r};