tycono 0.1.4 → 0.1.6
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.
- package/package.json +1 -1
- package/src/api/package.json +4 -5
- package/src/api/src/create-server.ts +57 -49
- package/src/api/src/engine/context-assembler.ts +46 -20
- package/src/api/src/engine/llm-adapter.ts +73 -0
- package/src/api/src/engine/runners/claude-cli.ts +8 -2
- package/src/api/src/routes/cost.ts +98 -0
- package/src/api/src/routes/execute.ts +16 -9
- package/src/api/src/routes/setup.ts +33 -4
- package/src/api/src/routes/speech.ts +129 -18
- package/src/api/src/services/company-config.ts +1 -0
- package/src/api/src/services/job-manager.ts +8 -0
- package/src/api/src/services/preferences.ts +13 -0
- package/src/web/dist/assets/index-CM-X2pR7.css +1 -0
- package/src/web/dist/assets/index-N0j2q1cx.js +95 -0
- package/src/web/dist/assets/{preview-app-BfI2OYf_.js → preview-app-DgPZuBe8.js} +1 -1
- package/src/web/dist/index.html +2 -2
- package/templates/CLAUDE.md.tmpl +77 -0
- package/src/web/dist/assets/index-B4rY32WN.css +0 -1
- package/src/web/dist/assets/index-Bd-J16OH.js +0 -90
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
var fb=Object.defineProperty;var db=(t,l,r)=>l in t?fb(t,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[l]=r;var qx=(t,l,r)=>db(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 k1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Af={exports:{}},Qi={};/**
|
|
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 hb(){if(Ix)return Qi;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 Qi.Fragment=l,Qi.jsx=r,Qi.jsxs=r,Qi}var Yx;function mb(){return Yx||(Yx=1,Af.exports=hb()),Af.exports}var c=mb(),Tf={exports:{}},_e={};/**
|
|
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 pb(){if(Vx)return _e;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,A={};function N(_,ee,C){this.props=_,this.context=ee,this.refs=A,this.updater=C||k}N.prototype.isReactComponent={},N.prototype.setState=function(_,ee){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,_,ee,"setState")},N.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function L(){}L.prototype=N.prototype;function H(_,ee,C){this.props=_,this.context=ee,this.refs=A,this.updater=C||k}var Y=H.prototype=new L;Y.constructor=H,E(Y,N.prototype),Y.isPureReactComponent=!0;var U=Array.isArray;function D(){}var V={H:null,A:null,T:null,S:null},q=Object.prototype.hasOwnProperty;function te(_,ee,C){var fe=C.ref;return{$$typeof:t,type:_,key:ee,ref:fe!==void 0?fe:null,props:C}}function T(_,ee){return te(_.type,ee,_.props)}function F(_){return typeof _=="object"&&_!==null&&_.$$typeof===t}function R(_){var ee={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(C){return ee[C]})}var W=/\/+/g;function X(_,ee){return typeof _=="object"&&_!==null&&_.key!=null?R(""+_.key):ee.toString(36)}function G(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(D,D):(_.status="pending",_.then(function(ee){_.status==="pending"&&(_.status="fulfilled",_.value=ee)},function(ee){_.status==="pending"&&(_.status="rejected",_.reason=ee)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function M(_,ee,C,fe,ve){var ye=typeof _;(ye==="undefined"||ye==="boolean")&&(_=null);var ke=!1;if(_===null)ke=!0;else switch(ye){case"bigint":case"string":case"number":ke=!0;break;case"object":switch(_.$$typeof){case t:case l:ke=!0;break;case y:return ke=_._init,M(ke(_._payload),ee,C,fe,ve)}}if(ke)return ve=ve(_),ke=fe===""?"."+X(_,0):fe,U(ve)?(C="",ke!=null&&(C=ke.replace(W,"$&/")+"/"),M(ve,ee,C,"",function(qe){return qe})):ve!=null&&(F(ve)&&(ve=T(ve,C+(ve.key==null||_&&_.key===ve.key?"":(""+ve.key).replace(W,"$&/")+"/")+ke)),ee.push(ve)),1;ke=0;var He=fe===""?".":fe+":";if(U(_))for(var de=0;de<_.length;de++)fe=_[de],ye=He+X(fe,de),ke+=M(fe,ee,C,ye,ve);else if(de=b(_),typeof de=="function")for(_=de.call(_),de=0;!(fe=_.next()).done;)fe=fe.value,ye=He+X(fe,de++),ke+=M(fe,ee,C,ye,ve);else if(ye==="object"){if(typeof _.then=="function")return M(G(_),ee,C,fe,ve);throw ee=String(_),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.")}return ke}function Q(_,ee,C){if(_==null)return _;var fe=[],ve=0;return M(_,fe,"","",function(ye){return ee.call(C,ye,ve++)}),fe}function ne(_){if(_._status===-1){var ee=_._result;ee=ee(),ee.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=ee)}if(_._status===1)return _._result.default;throw _._result}var pe=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ee=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(ee))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},z={map:Q,forEach:function(_,ee,C){Q(_,function(){ee.apply(this,arguments)},C)},count:function(_){var ee=0;return Q(_,function(){ee++}),ee},toArray:function(_){return Q(_,function(ee){return ee})||[]},only:function(_){if(!F(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return _e.Activity=g,_e.Children=z,_e.Component=N,_e.Fragment=r,_e.Profiler=o,_e.PureComponent=H,_e.StrictMode=i,_e.Suspense=x,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,_e.__COMPILER_RUNTIME={__proto__:null,c:function(_){return V.H.useMemoCache(_)}},_e.cache=function(_){return function(){return _.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(_,ee,C){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var fe=E({},_.props),ve=_.key;if(ee!=null)for(ye in ee.key!==void 0&&(ve=""+ee.key),ee)!q.call(ee,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&ee.ref===void 0||(fe[ye]=ee[ye]);var ye=arguments.length-2;if(ye===1)fe.children=C;else if(1<ye){for(var ke=Array(ye),He=0;He<ye;He++)ke[He]=arguments[He+2];fe.children=ke}return te(_.type,ve,fe)},_e.createContext=function(_){return _={$$typeof:f,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:u,_context:_},_},_e.createElement=function(_,ee,C){var fe,ve={},ye=null;if(ee!=null)for(fe in ee.key!==void 0&&(ye=""+ee.key),ee)q.call(ee,fe)&&fe!=="key"&&fe!=="__self"&&fe!=="__source"&&(ve[fe]=ee[fe]);var ke=arguments.length-2;if(ke===1)ve.children=C;else if(1<ke){for(var He=Array(ke),de=0;de<ke;de++)He[de]=arguments[de+2];ve.children=He}if(_&&_.defaultProps)for(fe in ke=_.defaultProps,ke)ve[fe]===void 0&&(ve[fe]=ke[fe]);return te(_,ye,ve)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(_){return{$$typeof:m,render:_}},_e.isValidElement=F,_e.lazy=function(_){return{$$typeof:y,_payload:{_status:-1,_result:_},_init:ne}},_e.memo=function(_,ee){return{$$typeof:h,type:_,compare:ee===void 0?null:ee}},_e.startTransition=function(_){var ee=V.T,C={};V.T=C;try{var fe=_(),ve=V.S;ve!==null&&ve(C,fe),typeof fe=="object"&&fe!==null&&typeof fe.then=="function"&&fe.then(D,pe)}catch(ye){pe(ye)}finally{ee!==null&&C.types!==null&&(ee.types=C.types),V.T=ee}},_e.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},_e.use=function(_){return V.H.use(_)},_e.useActionState=function(_,ee,C){return V.H.useActionState(_,ee,C)},_e.useCallback=function(_,ee){return V.H.useCallback(_,ee)},_e.useContext=function(_){return V.H.useContext(_)},_e.useDebugValue=function(){},_e.useDeferredValue=function(_,ee){return V.H.useDeferredValue(_,ee)},_e.useEffect=function(_,ee){return V.H.useEffect(_,ee)},_e.useEffectEvent=function(_){return V.H.useEffectEvent(_)},_e.useId=function(){return V.H.useId()},_e.useImperativeHandle=function(_,ee,C){return V.H.useImperativeHandle(_,ee,C)},_e.useInsertionEffect=function(_,ee){return V.H.useInsertionEffect(_,ee)},_e.useLayoutEffect=function(_,ee){return V.H.useLayoutEffect(_,ee)},_e.useMemo=function(_,ee){return V.H.useMemo(_,ee)},_e.useOptimistic=function(_,ee){return V.H.useOptimistic(_,ee)},_e.useReducer=function(_,ee,C){return V.H.useReducer(_,ee,C)},_e.useRef=function(_){return V.H.useRef(_)},_e.useState=function(_){return V.H.useState(_)},_e.useSyncExternalStore=function(_,ee,C){return V.H.useSyncExternalStore(_,ee,C)},_e.useTransition=function(){return V.H.useTransition()},_e.version="19.2.4",_e}var Xx;function _d(){return Xx||(Xx=1,Tf.exports=pb()),Tf.exports}var S=_d(),Df={exports:{}},Ki={},zf={exports:{}},Mf={};/**
|
|
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 xb(){return Gx||(Gx=1,(function(t){function l(M,Q){var ne=M.length;M.push(Q);e:for(;0<ne;){var pe=ne-1>>>1,z=M[pe];if(0<o(z,Q))M[pe]=Q,M[ne]=z,ne=pe;else break e}}function r(M){return M.length===0?null:M[0]}function i(M){if(M.length===0)return null;var Q=M[0],ne=M.pop();if(ne!==Q){M[0]=ne;e:for(var pe=0,z=M.length,_=z>>>1;pe<_;){var ee=2*(pe+1)-1,C=M[ee],fe=ee+1,ve=M[fe];if(0>o(C,ne))fe<z&&0>o(ve,C)?(M[pe]=ve,M[fe]=ne,pe=fe):(M[pe]=C,M[ee]=ne,pe=ee);else if(fe<z&&0>o(ve,ne))M[pe]=ve,M[fe]=ne,pe=fe;else break e}}return Q}function o(M,Q){var ne=M.sortIndex-Q.sortIndex;return ne!==0?ne:M.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,A=!1,N=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;function Y(M){for(var Q=r(h);Q!==null;){if(Q.callback===null)i(h);else if(Q.startTime<=M)i(h),Q.sortIndex=Q.expirationTime,l(x,Q);else break;Q=r(h)}}function U(M){if(E=!1,Y(M),!k)if(r(x)!==null)k=!0,D||(D=!0,R());else{var Q=r(h);Q!==null&&G(U,Q.startTime-M)}}var D=!1,V=-1,q=5,te=-1;function T(){return A?!0:!(t.unstable_now()-te<q)}function F(){if(A=!1,D){var M=t.unstable_now();te=M;var Q=!0;try{e:{k=!1,E&&(E=!1,L(V),V=-1),b=!0;var ne=v;try{t:{for(Y(M),g=r(x);g!==null&&!(g.expirationTime>M&&T());){var pe=g.callback;if(typeof pe=="function"){g.callback=null,v=g.priorityLevel;var z=pe(g.expirationTime<=M);if(M=t.unstable_now(),typeof z=="function"){g.callback=z,Y(M),Q=!0;break t}g===r(x)&&i(x),Y(M)}else i(x);g=r(x)}if(g!==null)Q=!0;else{var _=r(h);_!==null&&G(U,_.startTime-M),Q=!1}}break e}finally{g=null,v=ne,b=!1}Q=void 0}}finally{Q?R():D=!1}}}var R;if(typeof H=="function")R=function(){H(F)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,X=W.port2;W.port1.onmessage=F,R=function(){X.postMessage(null)}}else R=function(){N(F,0)};function G(M,Q){V=N(function(){M(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(M){M.callback=null},t.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<M?Math.floor(1e3/M):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_next=function(M){switch(v){case 1:case 2:case 3:var Q=3;break;default:Q=v}var ne=v;v=Q;try{return M()}finally{v=ne}},t.unstable_requestPaint=function(){A=!0},t.unstable_runWithPriority=function(M,Q){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var ne=v;v=M;try{return Q()}finally{v=ne}},t.unstable_scheduleCallback=function(M,Q,ne){var pe=t.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?pe+ne:pe):ne=pe,M){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=ne+z,M={id:y++,callback:Q,priorityLevel:M,startTime:ne,expirationTime:z,sortIndex:-1},ne>pe?(M.sortIndex=ne,l(h,M),r(x)===null&&M===r(h)&&(E?(L(V),V=-1):E=!0,G(U,ne-pe))):(M.sortIndex=z,l(x,M),k||b||(k=!0,D||(D=!0,R()))),M},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(M){var Q=v;return function(){var ne=v;v=Q;try{return M.apply(this,arguments)}finally{v=ne}}}})(Mf)),Mf}var Qx;function gb(){return Qx||(Qx=1,zf.exports=xb()),zf.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 yb(){if(Kx)return dn;Kx=1;var t=_d();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 vb(){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=yb(),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 bb(){if(Jx)return Ki;Jx=1;var t=gb(),l=_d(),r=vb();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,j=d.child;j;){if(j===a){w=!0,a=d,s=p;break}if(j===s){w=!0,s=d,a=p;break}j=j.sibling}if(!w){for(j=p.child;j;){if(j===a){w=!0,a=p,s=d;break}if(j===s){w=!0,s=p,a=d;break}j=j.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"),A=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),H=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),T=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function R(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var W=Symbol.for("react.client.reference");function X(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===W?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case N:return"Profiler";case A:return"StrictMode";case U:return"Suspense";case D:return"SuspenseList";case te:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case H:return e.displayName||"Context";case L:return(e._context.displayName||"Context")+".Consumer";case Y:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return n=e.displayName||null,n!==null?n:X(e.type)||"Memo";case q:n=e._payload,e=e._init;try{return X(e(n))}catch{}}return null}var G=Array.isArray,M=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,ne={pending:!1,data:null,method:null,action:null},pe=[],z=-1;function _(e){return{current:e}}function ee(e){0>z||(e.current=pe[z],pe[z]=null,z--)}function C(e,n){z++,pe[z]=e.current,e.current=n}var fe=_(null),ve=_(null),ye=_(null),ke=_(null);function He(e,n){switch(C(ye,n),C(ve,e),C(fe,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}}ee(fe),C(fe,e)}function de(){ee(fe),ee(ve),ee(ye)}function qe(e){e.memoizedState!==null&&C(ke,e);var n=fe.current,a=dx(n,e.type);n!==a&&(C(ve,e),C(fe,a))}function Tt(e){ve.current===e&&(ee(fe),ee(ve)),ke.current===e&&(ee(ke),Yi._currentValue=ne)}var vt,Rn;function ut(e){if(vt===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);vt=n&&n[1]||"",Rn=-1<a.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+vt+e+Rn}var cn=!1;function xn(e,n){if(!e||cn)return"";cn=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(le){var P=le}Reflect.construct(e,[],oe)}else{try{oe.call()}catch(le){P=le}e.call(oe.prototype)}}else{try{throw Error()}catch(le){P=le}(oe=e())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(le){if(le&&P&&typeof le.stack=="string")return[le.stack,P.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],j=p[1];if(w&&j){var B=w.split(`
|
|
44
|
-
`),J=j.split(`
|
|
45
|
-
`);for(d=s=0;s<B.length&&!B[s].includes("DetermineComponentFrameRoot");)s++;for(;d<J.length&&!J[d].includes("DetermineComponentFrameRoot");)d++;if(s===B.length||d===J.length)for(s=B.length-1,d=J.length-1;1<=s&&0<=d&&B[s]!==J[d];)d--;for(;1<=s&&0<=d;s--,d--)if(B[s]!==J[d]){if(s!==1||d!==1)do if(s--,d--,0>d||B[s]!==J[d]){var re=`
|
|
46
|
-
`+B[s].replace(" at new "," at ");return e.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",e.displayName)),re}while(1<=s&&0<=d);break}}}finally{cn=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?ut(a):""}function St(e,n){switch(e.tag){case 26:case 27:case 5:return ut(e.type);case 16:return ut("Lazy");case 13:return e.child!==n&&n!==null?ut("Suspense Fallback"):ut("Suspense");case 19:return ut("SuspenseList");case 0:case 15:return xn(e.type,!1);case 11:return xn(e.type.render,!1);case 1:return xn(e.type,!0);case 31:return ut("Activity");default:return""}}function Dt(e){try{var n="",a=null;do n+=St(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,ft=t.unstable_cancelCallback,Pt=t.unstable_shouldYield,Xn=t.unstable_requestPaint,Mt=t.unstable_now,Sn=t.unstable_getCurrentPriorityLevel,ae=t.unstable_ImmediatePriority,me=t.unstable_UserBlockingPriority,Ee=t.unstable_NormalPriority,ie=t.unstable_LowPriority,xe=t.unstable_IdlePriority,rt=t.log,nt=t.unstable_setDisableYieldValue,Be=null,ue=null;function Qe(e){if(typeof rt=="function"&&nt(e),ue&&typeof ue.setStrictMode=="function")try{ue.setStrictMode(Be,e)}catch{}}var Ie=Math.clz32?Math.clz32:vs,_n=Math.log,en=Math.LN2;function vs(e){return e>>>=0,e===0?32:31-(_n(e)/en|0)|0}var za=256,Yl=262144,Ma=4194304;function gn(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 j=s&134217727;return j!==0?(s=j&~p,s!==0?d=gn(s):(w&=j,w!==0?d=gn(w):a||(a=j&~e,a!==0&&(d=gn(a))))):(j=s&~p,j!==0?d=gn(j):w!==0?d=gn(w):a||(a=s&~e,a!==0&&(d=gn(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 bs(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 ws(){var e=Ma;return Ma<<=1,(Ma&62914560)===0&&(Ma=4194304),e}function Ra(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 j=e.entanglements,B=e.expirationTimes,J=e.hiddenUpdates;for(a=w&~a;0<a;){var re=31-Ie(a),oe=1<<re;j[re]=0,B[re]=-1;var P=J[re];if(P!==null)for(J[re]=null,re=0;re<P.length;re++){var le=P[re];le!==null&&(le.lane&=-536870913)}a&=~oe}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-Ie(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|a&261930}function ks(e,n){var a=e.entangledLanes|=n;for(e=e.entanglements;a;){var s=31-Ie(a),d=1<<s;d&n|e[s]&n&&(e[s]|=n),a&=~d}}function _a(e,n){var a=n&-n;return a=(a&42)!==0?1:nn(a),(a&(e.suspendedLanes|n))!==0?0:a}function nn(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 rl(){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),Kt="__reactFiber$"+Gn,Ft="__reactProps$"+Gn,Zl="__reactContainer$"+Gn,Ot="__reactEvents$"+Gn,bc="__reactListeners$"+Gn,wc="__reactHandles$"+Gn,li="__reactResources$"+Gn,kl="__reactMarker$"+Gn;function ai(e){delete e[Kt],delete e[Ft],delete e[Ot],delete e[bc],delete e[wc]}function Jl(e){var n=e[Kt];if(n)return n;for(var a=e.parentNode;a;){if(n=a[Zl]||a[Kt]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(e=vx(e);e!==null;){if(a=e[Kt])return a;e=vx(e)}return n}e=a,a=e.parentNode}return null}function Sl(e){if(e=e[Kt]||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 Ut(e){e[kl]=!0}var Ss=new Set,js={};function jl(e,n){Pl(e,n),Pl(e+"Capture",n)}function Pl(e,n){for(js[e]=n,e=0;e<n.length;e++)Ss.add(n[e])}var fl=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={},Es={};function kc(e){return zt.call(Es,e)?!0:zt.call(ri,e)?!1:fl.test(e)?Es[e]=!0:(ri[e]=!0,!1)}function On(e,n,a){if(kc(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 il(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 yn(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function La(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 cr(e){if(!e._valueTracker){var n=yn(e)?"checked":"value";e._valueTracker=La(e,n,""+e[n])}}function ii(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var a=n.getValue(),s="";return e&&(s=yn(e)?e.checked?"true":"false":e.value),e=s,e!==a?(n.setValue(e),!0):!1}function Fa(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 ce(e){return e.replace(I,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function ge(e,n,a,s,d,p,w,j){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?je(e,w,jn(n)):a!=null?je(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"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+jn(j):e.removeAttribute("name")}function we(e,n,a,s,d,p,w,j){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)){cr(e);return}a=a!=null?""+jn(a):"",n=n!=null?""+jn(n):a,j||n===e.value||(e.value=n),e.defaultValue=n}s=s??d,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=j?e.checked:!!s,e.defaultChecked=!!s,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(e.name=w),cr(e)}function je(e,n,a){n==="number"&&Fa(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Ae(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 Je(e,n,a,s){if(n==null){if(s!=null){if(a!=null)throw Error(i(92));if(G(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),cr(e)}function Ye(e,n){if(n){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=n;return}}e.textContent=n}var Le=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 Nt(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||Le.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&&Nt(e,d,s)}else for(var p in n)n.hasOwnProperty(p)&&Nt(e,p,n[p])}function Sc(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 s0=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"]]),o0=/^[\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 Cs(e){return o0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function El(){}var jc=null;function Ec(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ur=null,fr=null;function uh(e){var n=Sl(e);if(n&&(e=n.stateNode)){var a=e[Ft]||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="'+ce(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var s=a[n];if(s!==e&&s.form===e.form){var d=s[Ft]||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&&ii(s)}break e;case"textarea":Me(e,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&Ae(e,!!a.multiple,n,!1)}}}var Cc=!1;function fh(e,n,a){if(Cc)return e(n,a);Cc=!0;try{var s=e(n);return s}finally{if(Cc=!1,(ur!==null||fr!==null)&&(mo(),ur&&(n=ur,e=fr,fr=ur=null,uh(n),e)))for(n=0;n<e.length;n++)uh(e[n])}}function si(e,n){var a=e.stateNode;if(a===null)return null;var s=a[Ft]||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"),Nc=!1;if(Cl)try{var oi={};Object.defineProperty(oi,"passive",{get:function(){Nc=!0}}),window.addEventListener("test",oi,oi),window.removeEventListener("test",oi,oi)}catch{Nc=!1}var ea=null,Ac=null,Ns=null;function dh(){if(Ns)return Ns;var e,n=Ac,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 Ns=d.slice(e,1<s?1-s:void 0)}function As(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 Ts(){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 j in e)e.hasOwnProperty(j)&&(a=e[j],this[j]=a?a(p):p[j]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Ts: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=Ts)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ts)},persist:function(){},isPersistent:Ts}),n}var Ua={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ds=En(Ua),ci=g({},Ua,{view:0,detail:0}),c0=En(ci),Tc,Dc,ui,zs=g({},ci,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mc,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!==ui&&(ui&&e.type==="mousemove"?(Tc=e.screenX-ui.screenX,Dc=e.screenY-ui.screenY):Dc=Tc=0,ui=e),Tc)},movementY:function(e){return"movementY"in e?e.movementY:Dc}}),mh=En(zs),u0=g({},zs,{dataTransfer:0}),f0=En(u0),d0=g({},ci,{relatedTarget:0}),zc=En(d0),h0=g({},Ua,{animationName:0,elapsedTime:0,pseudoElement:0}),m0=En(h0),p0=g({},Ua,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),x0=En(p0),g0=g({},Ua,{data:0}),ph=En(g0),y0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},v0={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"},b0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function w0(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=b0[e])?!!n[e]:!1}function Mc(){return w0}var k0=g({},ci,{key:function(e){if(e.key){var n=y0[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=As(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?v0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mc,charCode:function(e){return e.type==="keypress"?As(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?As(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),S0=En(k0),j0=g({},zs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xh=En(j0),E0=g({},ci,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mc}),C0=En(E0),N0=g({},Ua,{propertyName:0,elapsedTime:0,pseudoElement:0}),A0=En(N0),T0=g({},zs,{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}),D0=En(T0),z0=g({},Ua,{newState:0,oldState:0}),M0=En(z0),R0=[9,13,27,32],Rc=Cl&&"CompositionEvent"in window,fi=null;Cl&&"documentMode"in document&&(fi=document.documentMode);var _0=Cl&&"TextEvent"in window&&!fi,gh=Cl&&(!Rc||fi&&8<fi&&11>=fi),yh=" ",vh=!1;function bh(e,n){switch(e){case"keyup":return R0.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 dr=!1;function O0(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 B0(e,n){if(dr)return e==="compositionend"||!Rc&&bh(e,n)?(e=dh(),Ns=Ac=ea=null,dr=!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 L0={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"?!!L0[e.type]:n==="textarea"}function Sh(e,n,a,s){ur?fr?fr.push(s):fr=[s]:ur=s,n=wo(n,"onChange"),0<n.length&&(a=new Ds("onChange","change",null,a,s),e.push({event:a,listeners:n}))}var di=null,hi=null;function F0(e){rx(e,0)}function Ms(e){var n=Oa(e);if(ii(n))return e}function jh(e,n){if(e==="change")return n}var Eh=!1;if(Cl){var _c;if(Cl){var Oc="oninput"in document;if(!Oc){var Ch=document.createElement("div");Ch.setAttribute("oninput","return;"),Oc=typeof Ch.oninput=="function"}_c=Oc}else _c=!1;Eh=_c&&(!document.documentMode||9<document.documentMode)}function Nh(){di&&(di.detachEvent("onpropertychange",Ah),hi=di=null)}function Ah(e){if(e.propertyName==="value"&&Ms(hi)){var n=[];Sh(n,hi,e,Ec(e)),fh(F0,n)}}function U0(e,n,a){e==="focusin"?(Nh(),di=n,hi=a,di.attachEvent("onpropertychange",Ah)):e==="focusout"&&Nh()}function H0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ms(hi)}function $0(e,n){if(e==="click")return Ms(n)}function q0(e,n){if(e==="input"||e==="change")return Ms(n)}function I0(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Bn=typeof Object.is=="function"?Object.is:I0;function mi(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=Fa(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=Fa(e.document)}return n}function Bc(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 Y0=Cl&&"documentMode"in document&&11>=document.documentMode,hr=null,Lc=null,pi=null,Fc=!1;function Rh(e,n,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Fc||hr==null||hr!==Fa(s)||(s=hr,"selectionStart"in s&&Bc(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}),pi&&mi(pi,s)||(pi=s,s=wo(Lc,"onSelect"),0<s.length&&(n=new Ds("onSelect","select",null,n,a),e.push({event:n,listeners:s}),n.target=hr)))}function Ha(e,n){var a={};return a[e.toLowerCase()]=n.toLowerCase(),a["Webkit"+e]="webkit"+n,a["Moz"+e]="moz"+n,a}var mr={animationend:Ha("Animation","AnimationEnd"),animationiteration:Ha("Animation","AnimationIteration"),animationstart:Ha("Animation","AnimationStart"),transitionrun:Ha("Transition","TransitionRun"),transitionstart:Ha("Transition","TransitionStart"),transitioncancel:Ha("Transition","TransitionCancel"),transitionend:Ha("Transition","TransitionEnd")},Uc={},_h={};Cl&&(_h=document.createElement("div").style,"AnimationEvent"in window||(delete mr.animationend.animation,delete mr.animationiteration.animation,delete mr.animationstart.animation),"TransitionEvent"in window||delete mr.transitionend.transition);function $a(e){if(Uc[e])return Uc[e];if(!mr[e])return e;var n=mr[e],a;for(a in n)if(n.hasOwnProperty(a)&&a in _h)return Uc[e]=n[a];return e}var Oh=$a("animationend"),Bh=$a("animationiteration"),Lh=$a("animationstart"),V0=$a("transitionrun"),X0=$a("transitionstart"),G0=$a("transitioncancel"),Fh=$a("transitionend"),Uh=new Map,Hc="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(" ");Hc.push("scrollEnd");function sl(e,n){Uh.set(e,n),jl(n,[e])}var Rs=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=[],pr=0,$c=0;function _s(){for(var e=pr,n=$c=pr=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 Os(e,n,a,s){Qn[pr++]=e,Qn[pr++]=n,Qn[pr++]=a,Qn[pr++]=s,$c|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function qc(e,n,a,s){return Os(e,n,a,s),Bs(e)}function qa(e,n){return Os(e,null,null,n),Bs(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-Ie(a),e=p.hiddenUpdates,s=e[d],s===null?e[d]=[n]:s.push(n),n.lane=a|536870912),p):null}function Bs(e){if(50<Li)throw Li=0,Ju=null,Error(i(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var xr={};function Q0(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 Q0(e,n,a,s)}function Ic(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 Ls(e,n,a,s,d,p){var w=0;if(s=e,typeof e=="function")Ic(e)&&(w=1);else if(typeof e=="string")w=Pv(e,a,fe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case te:return e=Ln(31,a,n,d),e.elementType=te,e.lanes=p,e;case E:return Ia(a.children,d,p,n);case A:w=8,d|=24;break;case N:return e=Ln(12,a,n,d|2),e.elementType=N,e.lanes=p,e;case U:return e=Ln(13,a,n,d),e.elementType=U,e.lanes=p,e;case D:return e=Ln(19,a,n,d),e.elementType=D,e.lanes=p,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case H:w=10;break e;case L:w=9;break e;case Y:w=11;break e;case V: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 Ia(e,n,a,s){return e=Ln(7,e,s,n),e.lanes=a,e}function Yc(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 Vc(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:Dt(n)},Ih.set(e,n),n)}return{value:e,source:n,stack:Dt(n)}}var gr=[],yr=0,Fs=null,xi=0,Zn=[],Jn=0,ta=null,dl=1,hl="";function Al(e,n){gr[yr++]=xi,gr[yr++]=Fs,Fs=e,xi=n}function Yh(e,n,a){Zn[Jn++]=dl,Zn[Jn++]=hl,Zn[Jn++]=ta,ta=e;var s=dl;e=hl;var d=32-Ie(s)-1;s&=~(1<<d),a+=1;var p=32-Ie(n)+d;if(30<p){var w=d-d%5;p=(s&(1<<w)-1).toString(32),s>>=w,d-=w,dl=1<<32-Ie(n)+d|a<<d|s,hl=p+e}else dl=1<<p|a<<d|s,hl=e}function Xc(e){e.return!==null&&(Al(e,1),Yh(e,1,0))}function Gc(e){for(;e===Fs;)Fs=gr[--yr],gr[yr]=null,xi=gr[--yr],gr[yr]=null;for(;e===ta;)ta=Zn[--Jn],Zn[Jn]=null,hl=Zn[--Jn],Zn[Jn]=null,dl=Zn[--Jn],Zn[Jn]=null}function Vh(e,n){Zn[Jn++]=dl,Zn[Jn++]=hl,Zn[Jn++]=ta,dl=n.id,hl=n.overflow,ta=e}var ln=null,wt=null,We=!1,na=null,Wn=!1,Qc=Error(i(519));function la(e){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw gi(Kn(n,e)),Qc}function Xh(e){var n=e.stateNode,a=e.type,s=e.memoizedProps;switch(n[Kt]=e,n[Ft]=s,a){case"dialog":Xe("cancel",n),Xe("close",n);break;case"iframe":case"object":case"embed":Xe("load",n);break;case"video":case"audio":for(a=0;a<Ui.length;a++)Xe(Ui[a],n);break;case"source":Xe("error",n);break;case"img":case"image":case"link":Xe("error",n),Xe("load",n);break;case"details":Xe("toggle",n);break;case"input":Xe("invalid",n),we(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Xe("invalid",n);break;case"textarea":Xe("invalid",n),Je(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&&(Xe("beforetoggle",n),Xe("toggle",n)),s.onScroll!=null&&Xe("scroll",n),s.onScrollEnd!=null&&Xe("scrollend",n),s.onClick!=null&&(n.onclick=El),n=!0):n=!1,n||la(e,!0)}function Gh(e){for(ln=e.return;ln;)switch(ln.tag){case 5:case 31:case 13:Wn=!1;return;case 27:case 3:Wn=!0;return;default:ln=ln.return}}function vr(e){if(e!==ln)return!1;if(!We)return Gh(e),We=!0,!1;var n=e.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||hf(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=yf,yf=null,wt=e):wt=n):wt=ln?el(e.stateNode.nextSibling):null;return!0}function Ya(){wt=ln=null,We=!1}function Kc(){var e=na;return e!==null&&(Tn===null?Tn=e:Tn.push.apply(Tn,e),na=null),e}function gi(e){na===null?na=[e]:na.push(e)}var Zc=_(null),Va=null,Tl=null;function aa(e,n,a){C(Zc,n._currentValue),n._currentValue=a}function Dl(e){e._currentValue=Zc.current,ee(Zc)}function Jc(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 Wc(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 j=p;p=d;for(var B=0;B<n.length;B++)if(j.context===n[B]){p.lanes|=a,j=p.alternate,j!==null&&(j.lanes|=a),Jc(p.return,a,e),s||(w=null);break e}p=j.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),Jc(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 br(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 j=d.type;Bn(d.pendingProps.value,w.value)||(e!==null?e.push(j):e=[j])}}else if(d===ke.current){if(w=d.alternate,w===null)throw Error(i(387));w.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Yi):e=[Yi])}d=d.return}e!==null&&Wc(n,e,a,s),n.flags|=262144}function Us(e){for(e=e.firstContext;e!==null;){if(!Bn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Xa(e){Va=e,Tl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function an(e){return Qh(Va,e)}function Hs(e,n){return Va===null&&Xa(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 K0=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()})}},Z0=t.unstable_scheduleCallback,J0=t.unstable_NormalPriority,Ht={$$typeof:H,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pc(){return{controller:new K0,data:new Map,refCount:0}}function yi(e){e.refCount--,e.refCount===0&&Z0(J0,function(){e.controller.abort()})}var vi=null,eu=0,wr=0,kr=null;function W0(e,n){if(vi===null){var a=vi=[];eu=0,wr=lf(),kr={status:"pending",value:void 0,then:function(s){a.push(s)}}}return eu++,n.then(Kh,Kh),n}function Kh(){if(--eu===0&&vi!==null){kr!==null&&(kr.status="fulfilled");var e=vi;vi=null,wr=0,kr=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function P0(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=M.S;M.S=function(e,n){Rp=Mt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&W0(e,n),Zh!==null&&Zh(e,n)};var Ga=_(null);function tu(){var e=Ga.current;return e!==null?e:gt.pooledCache}function $s(e,n){n===null?C(Ga,Ga.current):C(Ga,n.pool)}function Jh(){var e=tu();return e===null?null:{parent:Ht._currentValue,pool:e}}var Sr=Error(i(460)),nu=Error(i(474)),qs=Error(i(542)),Is={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=gt,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 Ka=n,Sr}}function Qa(e){try{var n=e._init;return n(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Ka=a,Sr):a}}var Ka=null;function em(){if(Ka===null)throw Error(i(459));var e=Ka;return Ka=null,e}function tm(e){if(e===Sr||e===qs)throw Error(i(483))}var jr=null,bi=0;function Ys(e){var n=bi;return bi+=1,jr===null&&(jr=[]),Ph(jr,e,n)}function wi(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Vs(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(K,$){if(e){var Z=K.deletions;Z===null?(K.deletions=[$],K.flags|=16):Z.push($)}}function a(K,$){if(!e)return null;for(;$!==null;)n(K,$),$=$.sibling;return null}function s(K){for(var $=new Map;K!==null;)K.key!==null?$.set(K.key,K):$.set(K.index,K),K=K.sibling;return $}function d(K,$){return K=Nl(K,$),K.index=0,K.sibling=null,K}function p(K,$,Z){return K.index=Z,e?(Z=K.alternate,Z!==null?(Z=Z.index,Z<$?(K.flags|=67108866,$):Z):(K.flags|=67108866,$)):(K.flags|=1048576,$)}function w(K){return e&&K.alternate===null&&(K.flags|=67108866),K}function j(K,$,Z,se){return $===null||$.tag!==6?($=Yc(Z,K.mode,se),$.return=K,$):($=d($,Z),$.return=K,$)}function B(K,$,Z,se){var Ne=Z.type;return Ne===E?re(K,$,Z.props.children,se,Z.key):$!==null&&($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===q&&Qa(Ne)===$.type)?($=d($,Z.props),wi($,Z),$.return=K,$):($=Ls(Z.type,Z.key,Z.props,null,K.mode,se),wi($,Z),$.return=K,$)}function J(K,$,Z,se){return $===null||$.tag!==4||$.stateNode.containerInfo!==Z.containerInfo||$.stateNode.implementation!==Z.implementation?($=Vc(Z,K.mode,se),$.return=K,$):($=d($,Z.children||[]),$.return=K,$)}function re(K,$,Z,se,Ne){return $===null||$.tag!==7?($=Ia(Z,K.mode,se,Ne),$.return=K,$):($=d($,Z),$.return=K,$)}function oe(K,$,Z){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Yc(""+$,K.mode,Z),$.return=K,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case b:return Z=Ls($.type,$.key,$.props,null,K.mode,Z),wi(Z,$),Z.return=K,Z;case k:return $=Vc($,K.mode,Z),$.return=K,$;case q:return $=Qa($),oe(K,$,Z)}if(G($)||R($))return $=Ia($,K.mode,Z,null),$.return=K,$;if(typeof $.then=="function")return oe(K,Ys($),Z);if($.$$typeof===H)return oe(K,Hs(K,$),Z);Vs(K,$)}return null}function P(K,$,Z,se){var Ne=$!==null?$.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Ne!==null?null:j(K,$,""+Z,se);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:return Z.key===Ne?B(K,$,Z,se):null;case k:return Z.key===Ne?J(K,$,Z,se):null;case q:return Z=Qa(Z),P(K,$,Z,se)}if(G(Z)||R(Z))return Ne!==null?null:re(K,$,Z,se,null);if(typeof Z.then=="function")return P(K,$,Ys(Z),se);if(Z.$$typeof===H)return P(K,$,Hs(K,Z),se);Vs(K,Z)}return null}function le(K,$,Z,se,Ne){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return K=K.get(Z)||null,j($,K,""+se,Ne);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case b:return K=K.get(se.key===null?Z:se.key)||null,B($,K,se,Ne);case k:return K=K.get(se.key===null?Z:se.key)||null,J($,K,se,Ne);case q:return se=Qa(se),le(K,$,Z,se,Ne)}if(G(se)||R(se))return K=K.get(Z)||null,re($,K,se,Ne,null);if(typeof se.then=="function")return le(K,$,Z,Ys(se),Ne);if(se.$$typeof===H)return le(K,$,Z,Hs($,se),Ne);Vs($,se)}return null}function be(K,$,Z,se){for(var Ne=null,lt=null,Se=$,Fe=$=0,Ze=null;Se!==null&&Fe<Z.length;Fe++){Se.index>Fe?(Ze=Se,Se=null):Ze=Se.sibling;var at=P(K,Se,Z[Fe],se);if(at===null){Se===null&&(Se=Ze);break}e&&Se&&at.alternate===null&&n(K,Se),$=p(at,$,Fe),lt===null?Ne=at:lt.sibling=at,lt=at,Se=Ze}if(Fe===Z.length)return a(K,Se),We&&Al(K,Fe),Ne;if(Se===null){for(;Fe<Z.length;Fe++)Se=oe(K,Z[Fe],se),Se!==null&&($=p(Se,$,Fe),lt===null?Ne=Se:lt.sibling=Se,lt=Se);return We&&Al(K,Fe),Ne}for(Se=s(Se);Fe<Z.length;Fe++)Ze=le(Se,K,Fe,Z[Fe],se),Ze!==null&&(e&&Ze.alternate!==null&&Se.delete(Ze.key===null?Fe:Ze.key),$=p(Ze,$,Fe),lt===null?Ne=Ze:lt.sibling=Ze,lt=Ze);return e&&Se.forEach(function(ka){return n(K,ka)}),We&&Al(K,Fe),Ne}function ze(K,$,Z,se){if(Z==null)throw Error(i(151));for(var Ne=null,lt=null,Se=$,Fe=$=0,Ze=null,at=Z.next();Se!==null&&!at.done;Fe++,at=Z.next()){Se.index>Fe?(Ze=Se,Se=null):Ze=Se.sibling;var ka=P(K,Se,at.value,se);if(ka===null){Se===null&&(Se=Ze);break}e&&Se&&ka.alternate===null&&n(K,Se),$=p(ka,$,Fe),lt===null?Ne=ka:lt.sibling=ka,lt=ka,Se=Ze}if(at.done)return a(K,Se),We&&Al(K,Fe),Ne;if(Se===null){for(;!at.done;Fe++,at=Z.next())at=oe(K,at.value,se),at!==null&&($=p(at,$,Fe),lt===null?Ne=at:lt.sibling=at,lt=at);return We&&Al(K,Fe),Ne}for(Se=s(Se);!at.done;Fe++,at=Z.next())at=le(Se,K,Fe,at.value,se),at!==null&&(e&&at.alternate!==null&&Se.delete(at.key===null?Fe:at.key),$=p(at,$,Fe),lt===null?Ne=at:lt.sibling=at,lt=at);return e&&Se.forEach(function(ub){return n(K,ub)}),We&&Al(K,Fe),Ne}function mt(K,$,Z,se){if(typeof Z=="object"&&Z!==null&&Z.type===E&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:e:{for(var Ne=Z.key;$!==null;){if($.key===Ne){if(Ne=Z.type,Ne===E){if($.tag===7){a(K,$.sibling),se=d($,Z.props.children),se.return=K,K=se;break e}}else if($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===q&&Qa(Ne)===$.type){a(K,$.sibling),se=d($,Z.props),wi(se,Z),se.return=K,K=se;break e}a(K,$);break}else n(K,$);$=$.sibling}Z.type===E?(se=Ia(Z.props.children,K.mode,se,Z.key),se.return=K,K=se):(se=Ls(Z.type,Z.key,Z.props,null,K.mode,se),wi(se,Z),se.return=K,K=se)}return w(K);case k:e:{for(Ne=Z.key;$!==null;){if($.key===Ne)if($.tag===4&&$.stateNode.containerInfo===Z.containerInfo&&$.stateNode.implementation===Z.implementation){a(K,$.sibling),se=d($,Z.children||[]),se.return=K,K=se;break e}else{a(K,$);break}else n(K,$);$=$.sibling}se=Vc(Z,K.mode,se),se.return=K,K=se}return w(K);case q:return Z=Qa(Z),mt(K,$,Z,se)}if(G(Z))return be(K,$,Z,se);if(R(Z)){if(Ne=R(Z),typeof Ne!="function")throw Error(i(150));return Z=Ne.call(Z),ze(K,$,Z,se)}if(typeof Z.then=="function")return mt(K,$,Ys(Z),se);if(Z.$$typeof===H)return mt(K,$,Hs(K,Z),se);Vs(K,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,$!==null&&$.tag===6?(a(K,$.sibling),se=d($,Z),se.return=K,K=se):(a(K,$),se=Yc(Z,K.mode,se),se.return=K,K=se),w(K)):a(K,$)}return function(K,$,Z,se){try{bi=0;var Ne=mt(K,$,Z,se);return jr=null,Ne}catch(Se){if(Se===Sr||Se===qs)throw Se;var lt=Ln(29,Se,null,K.mode);return lt.lanes=se,lt.return=K,lt}finally{}}}var Za=nm(!0),lm=nm(!1),ra=!1;function lu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function au(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,(it&2)!==0){var d=s.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),s.pending=n,n=Bs(e),Hh(e,null,a),n}return Os(e,s,n,a),Bs(e)}function ki(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,ks(e,a)}}function ru(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 iu=!1;function Si(){if(iu){var e=kr;if(e!==null)throw e}}function ji(e,n,a,s){iu=!1;var d=e.updateQueue;ra=!1;var p=d.firstBaseUpdate,w=d.lastBaseUpdate,j=d.shared.pending;if(j!==null){d.shared.pending=null;var B=j,J=B.next;B.next=null,w===null?p=J:w.next=J,w=B;var re=e.alternate;re!==null&&(re=re.updateQueue,j=re.lastBaseUpdate,j!==w&&(j===null?re.firstBaseUpdate=J:j.next=J,re.lastBaseUpdate=B))}if(p!==null){var oe=d.baseState;w=0,re=J=B=null,j=p;do{var P=j.lane&-536870913,le=P!==j.lane;if(le?(Ke&P)===P:(s&P)===P){P!==0&&P===wr&&(iu=!0),re!==null&&(re=re.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var be=e,ze=j;P=n;var mt=a;switch(ze.tag){case 1:if(be=ze.payload,typeof be=="function"){oe=be.call(mt,oe,P);break e}oe=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=ze.payload,P=typeof be=="function"?be.call(mt,oe,P):be,P==null)break e;oe=g({},oe,P);break e;case 2:ra=!0}}P=j.callback,P!==null&&(e.flags|=64,le&&(e.flags|=8192),le=d.callbacks,le===null?d.callbacks=[P]:le.push(P))}else le={lane:P,tag:j.tag,payload:j.payload,callback:j.callback,next:null},re===null?(J=re=le,B=oe):re=re.next=le,w|=P;if(j=j.next,j===null){if(j=d.shared.pending,j===null)break;le=j,j=le.next,le.next=null,d.lastBaseUpdate=le,d.shared.pending=null}}while(!0);re===null&&(B=oe),d.baseState=B,d.firstBaseUpdate=J,d.lastBaseUpdate=re,p===null&&(d.shared.lanes=0),da|=w,e.lanes=w,e.memoizedState=oe}}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 Er=_(null),Xs=_(0);function im(e,n){e=Ul,C(Xs,e),C(Er,n),Ul=e|n.baseLanes}function su(){C(Xs,Ul),C(Er,Er.current)}function ou(){Ul=Xs.current,ee(Er),ee(Xs)}var Fn=_(null),Pn=null;function oa(e){var n=e.alternate;C(Bt,Bt.current&1),C(Fn,e),Pn===null&&(n===null||Er.current!==null||n.memoizedState!==null)&&(Pn=e)}function cu(e){C(Bt,Bt.current),C(Fn,e),Pn===null&&(Pn=e)}function sm(e){e.tag===22?(C(Bt,Bt.current),C(Fn,e),Pn===null&&(Pn=e)):ca()}function ca(){C(Bt,Bt.current),C(Fn,Fn.current)}function Un(e){ee(Fn),Pn===e&&(Pn=null),ee(Bt)}var Bt=_(0);function Gs(e){for(var n=e;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||xf(a)||gf(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,Oe=null,dt=null,$t=null,Qs=!1,Cr=!1,Ja=!1,Ks=0,Ei=0,Nr=null,ev=0;function Rt(){throw Error(i(321))}function uu(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 fu(e,n,a,s,d,p){return zl=p,Oe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,M.H=e===null||e.memoizedState===null?Ym:Cu,Ja=!1,p=a(s,d),Ja=!1,Cr&&(p=cm(n,a,s,d)),om(e),p}function om(e){M.H=Ai;var n=dt!==null&&dt.next!==null;if(zl=0,$t=dt=Oe=null,Qs=!1,Ei=0,Nr=null,n)throw Error(i(300));e===null||qt||(e=e.dependencies,e!==null&&Us(e)&&(qt=!0))}function cm(e,n,a,s){Oe=e;var d=0;do{if(Cr&&(Nr=null),Ei=0,Cr=!1,25<=d)throw Error(i(301));if(d+=1,$t=dt=null,e.updateQueue!=null){var p=e.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}M.H=Vm,p=n(a,s)}while(Cr);return p}function tv(){var e=M.H,n=e.useState()[0];return n=typeof n.then=="function"?Ci(n):n,e=e.useState()[0],(dt!==null?dt.memoizedState:null)!==e&&(Oe.flags|=1024),n}function du(){var e=Ks!==0;return Ks=0,e}function hu(e,n,a){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~a}function mu(e){if(Qs){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Qs=!1}zl=0,$t=dt=Oe=null,Cr=!1,Ei=Ks=0,Nr=null}function vn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Oe.memoizedState=$t=e:$t=$t.next=e,$t}function Lt(){if(dt===null){var e=Oe.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var n=$t===null?Oe.memoizedState:$t.next;if(n!==null)$t=n,dt=e;else{if(e===null)throw Oe.alternate===null?Error(i(467)):Error(i(310));dt=e,e={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},$t===null?Oe.memoizedState=$t=e:$t=$t.next=e}return $t}function Zs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ci(e){var n=Ei;return Ei+=1,Nr===null&&(Nr=[]),e=Ph(Nr,e,n),n=Oe,($t===null?n.memoizedState:$t.next)===null&&(n=n.alternate,M.H=n===null||n.memoizedState===null?Ym:Cu),e}function Js(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ci(e);if(e.$$typeof===H)return an(e)}throw Error(i(438,String(e)))}function pu(e){var n=null,a=Oe.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var s=Oe.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=Zs(),Oe.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]=T;return n.index++,a}function Ml(e,n){return typeof n=="function"?n(e):n}function Ws(e){var n=Lt();return xu(n,dt,e)}function xu(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 j=w=null,B=null,J=n,re=!1;do{var oe=J.lane&-536870913;if(oe!==J.lane?(Ke&oe)===oe:(zl&oe)===oe){var P=J.revertLane;if(P===0)B!==null&&(B=B.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),oe===wr&&(re=!0);else if((zl&P)===P){J=J.next,P===wr&&(re=!0);continue}else oe={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},B===null?(j=B=oe,w=p):B=B.next=oe,Oe.lanes|=P,da|=P;oe=J.action,Ja&&a(p,oe),p=J.hasEagerState?J.eagerState:a(p,oe)}else P={lane:oe,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},B===null?(j=B=P,w=p):B=B.next=P,Oe.lanes|=oe,da|=oe;J=J.next}while(J!==null&&J!==n);if(B===null?w=p:B.next=j,!Bn(p,e.memoizedState)&&(qt=!0,re&&(a=kr,a!==null)))throw a;e.memoizedState=p,e.baseState=w,e.baseQueue=B,s.lastRenderedState=p}return d===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function gu(e){var n=Lt(),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)||(qt=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),a.lastRenderedState=p}return[p,s]}function um(e,n,a){var s=Oe,d=Lt(),p=We;if(p){if(a===void 0)throw Error(i(407));a=a()}else a=n();var w=!Bn((dt||d).memoizedState,a);if(w&&(d.memoizedState=a,qt=!0),d=d.queue,bu(hm.bind(null,s,d,e),[e]),d.getSnapshot!==n||w||$t!==null&&$t.memoizedState.tag&1){if(s.flags|=2048,Ar(9,{destroy:void 0},dm.bind(null,s,d,a,n),null),gt===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=Oe.updateQueue,n===null?(n=Zs(),Oe.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=qa(e,2);n!==null&&Dn(n,e,2)}function yu(e){var n=vn();if(typeof e=="function"){var a=e;if(e=a(),Ja){Qe(!0);try{a()}finally{Qe(!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,xu(e,dt,typeof s=="function"?s:Ml)}function nv(e,n,a,s,d){if(to(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)}};M.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=M.T,w={};M.T=w;try{var j=a(d,s),B=M.S;B!==null&&B(w,j),ym(e,n,j)}catch(J){vu(e,n,J)}finally{p!==null&&w.types!==null&&(p.types=w.types),M.T=p}}else try{p=a(d,s),ym(e,n,p)}catch(J){vu(e,n,J)}}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 vu(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 vu(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(We){var a=gt.formState;if(a!==null){e:{var s=Oe;if(We){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=vn(),a.memoizedState=a.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wm,lastRenderedState:n},a.queue=s,a=$m.bind(null,Oe,s),s.dispatch=a,s=yu(!1),p=Eu.bind(null,Oe,!1,s.queue),s=vn(),d={state:n,dispatch:null,action:e,pending:null},s.queue=d,a=nv.bind(null,Oe,d,p,a),d.dispatch=a,s.memoizedState=e,[n,a,!1]}function Sm(e){var n=Lt();return jm(n,dt,e)}function jm(e,n,a){if(n=xu(e,n,wm)[0],e=Ws(Ml)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=Ci(n)}catch(w){throw w===Sr?qs:w}else s=n;n=Lt();var d=n.queue,p=d.dispatch;return a!==n.memoizedState&&(Oe.flags|=2048,Ar(9,{destroy:void 0},lv.bind(null,d,a),null)),[s,p,e]}function lv(e,n){e.action=n}function Em(e){var n=Lt(),a=dt;if(a!==null)return jm(n,a,e);Lt(),n=n.memoizedState,a=Lt();var s=a.queue.dispatch;return a.memoizedState=e,[n,s,!1]}function Ar(e,n,a,s){return e={tag:e,create:a,deps:s,inst:n,next:null},n=Oe.updateQueue,n===null&&(n=Zs(),Oe.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 Lt().memoizedState}function Ps(e,n,a,s){var d=vn();Oe.flags|=e,d.memoizedState=Ar(1|n,{destroy:void 0},a,s===void 0?null:s)}function eo(e,n,a,s){var d=Lt();s=s===void 0?null:s;var p=d.memoizedState.inst;dt!==null&&s!==null&&uu(s,dt.memoizedState.deps)?d.memoizedState=Ar(n,p,a,s):(Oe.flags|=e,d.memoizedState=Ar(1|n,p,a,s))}function Nm(e,n){Ps(8390656,8,e,n)}function bu(e,n){eo(2048,8,e,n)}function av(e){Oe.flags|=4;var n=Oe.updateQueue;if(n===null)n=Zs(),Oe.updateQueue=n,n.events=[e];else{var a=n.events;a===null?n.events=[e]:a.push(e)}}function Am(e){var n=Lt().memoizedState;return av({ref:n,nextImpl:e}),function(){if((it&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function Tm(e,n){return eo(4,2,e,n)}function Dm(e,n){return eo(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,eo(4,4,zm.bind(null,n,e),a)}function wu(){}function Rm(e,n){var a=Lt();n=n===void 0?null:n;var s=a.memoizedState;return n!==null&&uu(n,s[1])?s[0]:(a.memoizedState=[e,n],e)}function _m(e,n){var a=Lt();n=n===void 0?null:n;var s=a.memoizedState;if(n!==null&&uu(n,s[1]))return s[0];if(s=e(),Ja){Qe(!0);try{e()}finally{Qe(!1)}}return a.memoizedState=[s,n],s}function ku(e,n,a){return a===void 0||(zl&1073741824)!==0&&(Ke&261930)===0?e.memoizedState=n:(e.memoizedState=a,e=Op(),Oe.lanes|=e,da|=e,a)}function Om(e,n,a,s){return Bn(a,n)?a:Er.current!==null?(e=ku(e,a,s),Bn(e,n)||(qt=!0),e):(zl&42)===0||(zl&1073741824)!==0&&(Ke&261930)===0?(qt=!0,e.memoizedState=a):(e=Op(),Oe.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=M.T,j={};M.T=j,Eu(e,!1,n,a);try{var B=d(),J=M.S;if(J!==null&&J(j,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var re=P0(B,s);Ni(e,n,re,qn(e))}else Ni(e,n,s,qn(e))}catch(oe){Ni(e,n,{then:function(){},status:"rejected",reason:oe},qn())}finally{Q.p=p,w!==null&&j.types!==null&&(w.types=j.types),M.T=w}}function rv(){}function Su(e,n,a,s){if(e.tag!==5)throw Error(i(476));var d=Lm(e).queue;Bm(e,d,n,ne,a===null?rv:function(){return Fm(e),a(s)})}function Lm(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ml,lastRenderedState:ne},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),Ni(e,n.next.queue,{},qn())}function ju(){return an(Yi)}function Um(){return Lt().memoizedState}function Hm(){return Lt().memoizedState}function iv(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),ki(s,n,a)),n={cache:Pc()},e.payload=n;return}n=n.return}}function sv(e,n,a){var s=qn();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},to(e)?qm(n,a):(a=qc(e,n,a,s),a!==null&&(Dn(a,e,s),Im(a,n,s)))}function $m(e,n,a){var s=qn();Ni(e,n,a,s)}function Ni(e,n,a,s){var d={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(to(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,j=p(w,a);if(d.hasEagerState=!0,d.eagerState=j,Bn(j,w))return Os(e,n,d,0),gt===null&&_s(),!1}catch{}finally{}if(a=qc(e,n,d,s),a!==null)return Dn(a,e,s),Im(a,n,s),!0}return!1}function Eu(e,n,a,s){if(s={lane:2,revertLane:lf(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},to(e)){if(n)throw Error(i(479))}else n=qc(e,a,s,2),n!==null&&Dn(n,e,2)}function to(e){var n=e.alternate;return e===Oe||n!==null&&n===Oe}function qm(e,n){Cr=Qs=!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,ks(e,a)}}var Ai={readContext:an,use:Js,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useLayoutEffect:Rt,useInsertionEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useSyncExternalStore:Rt,useId:Rt,useHostTransitionStatus:Rt,useFormState:Rt,useActionState:Rt,useOptimistic:Rt,useMemoCache:Rt,useCacheRefresh:Rt};Ai.useEffectEvent=Rt;var Ym={readContext:an,use:Js,useCallback:function(e,n){return vn().memoizedState=[e,n===void 0?null:n],e},useContext:an,useEffect:Nm,useImperativeHandle:function(e,n,a){a=a!=null?a.concat([e]):null,Ps(4194308,4,zm.bind(null,n,e),a)},useLayoutEffect:function(e,n){return Ps(4194308,4,e,n)},useInsertionEffect:function(e,n){Ps(4,2,e,n)},useMemo:function(e,n){var a=vn();n=n===void 0?null:n;var s=e();if(Ja){Qe(!0);try{e()}finally{Qe(!1)}}return a.memoizedState=[s,n],s},useReducer:function(e,n,a){var s=vn();if(a!==void 0){var d=a(n);if(Ja){Qe(!0);try{a(n)}finally{Qe(!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=sv.bind(null,Oe,e),[s.memoizedState,e]},useRef:function(e){var n=vn();return e={current:e},n.memoizedState=e},useState:function(e){e=yu(e);var n=e.queue,a=$m.bind(null,Oe,n);return n.dispatch=a,[e.memoizedState,a]},useDebugValue:wu,useDeferredValue:function(e,n){var a=vn();return ku(a,e,n)},useTransition:function(){var e=yu(!1);return e=Bm.bind(null,Oe,e.queue,!0,!1),vn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,a){var s=Oe,d=vn();if(We){if(a===void 0)throw Error(i(407));a=a()}else{if(a=n(),gt===null)throw Error(i(349));(Ke&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,Ar(9,{destroy:void 0},dm.bind(null,s,p,a,n),null),a},useId:function(){var e=vn(),n=gt.identifierPrefix;if(We){var a=hl,s=dl;a=(s&~(1<<32-Ie(s)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Ks++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=ev++,n="_"+n+"r_"+a.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:ju,useFormState:km,useActionState:km,useOptimistic:function(e){var n=vn();n.memoizedState=n.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=Eu.bind(null,Oe,!0,a),a.dispatch=n,[e,n]},useMemoCache:pu,useCacheRefresh:function(){return vn().memoizedState=iv.bind(null,Oe)},useEffectEvent:function(e){var n=vn(),a={impl:e};return n.memoizedState=a,function(){if((it&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},Cu={readContext:an,use:Js,useCallback:Rm,useContext:an,useEffect:bu,useImperativeHandle:Mm,useInsertionEffect:Tm,useLayoutEffect:Dm,useMemo:_m,useReducer:Ws,useRef:Cm,useState:function(){return Ws(Ml)},useDebugValue:wu,useDeferredValue:function(e,n){var a=Lt();return Om(a,dt.memoizedState,e,n)},useTransition:function(){var e=Ws(Ml)[0],n=Lt().memoizedState;return[typeof e=="boolean"?e:Ci(e),n]},useSyncExternalStore:um,useId:Um,useHostTransitionStatus:ju,useFormState:Sm,useActionState:Sm,useOptimistic:function(e,n){var a=Lt();return xm(a,dt,e,n)},useMemoCache:pu,useCacheRefresh:Hm};Cu.useEffectEvent=Am;var Vm={readContext:an,use:Js,useCallback:Rm,useContext:an,useEffect:bu,useImperativeHandle:Mm,useInsertionEffect:Tm,useLayoutEffect:Dm,useMemo:_m,useReducer:gu,useRef:Cm,useState:function(){return gu(Ml)},useDebugValue:wu,useDeferredValue:function(e,n){var a=Lt();return dt===null?ku(a,e,n):Om(a,dt.memoizedState,e,n)},useTransition:function(){var e=gu(Ml)[0],n=Lt().memoizedState;return[typeof e=="boolean"?e:Ci(e),n]},useSyncExternalStore:um,useId:Um,useHostTransitionStatus:ju,useFormState:Em,useActionState:Em,useOptimistic:function(e,n){var a=Lt();return dt!==null?xm(a,dt,e,n):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:pu,useCacheRefresh:Hm};Vm.useEffectEvent=Am;function Nu(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 Au={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),ki(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),ki(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),ki(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?!mi(a,s)||!mi(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&&Au.enqueueReplaceState(n,n.state,null)}function Wa(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){Rs(e)}function Km(e){console.error(e)}function Zm(e){Rs(e)}function no(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 Tu(e,n,a){return a=ia(a),a.tag=3,a.payload={element:null},a.callback=function(){no(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 j=s.stack;this.componentDidCatch(s.value,{componentStack:j!==null?j:""})})}function ov(e,n,a,s,d){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=a.alternate,n!==null&&br(n,a,d,!0),a=Fn.current,a!==null){switch(a.tag){case 31:case 13:return Pn===null?po():a.alternate===null&&_t===0&&(_t=3),a.flags&=-257,a.flags|=65536,a.lanes=d,s===Is?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([s]):n.add(s),ef(e,s,d)),!1;case 22:return a.flags|=65536,s===Is?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)),ef(e,s,d)),!1}throw Error(i(435,a.tag))}return ef(e,s,d),po(),!1}if(We)return n=Fn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=d,s!==Qc&&(e=Error(i(422),{cause:s}),gi(Kn(e,a)))):(s!==Qc&&(n=Error(i(423),{cause:s}),gi(Kn(n,a))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,s=Kn(s,a),d=Tu(e.stateNode,s,d),ru(e,d),_t!==4&&(_t=2)),!1;var p=Error(i(520),{cause:s});if(p=Kn(p,a),Bi===null?Bi=[p]:Bi.push(p),_t!==4&&(_t=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=Tu(a.stateNode,s,e),ru(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),ru(a,d),!1}a=a.return}while(a!==null);return!1}var Du=Error(i(461)),qt=!1;function rn(e,n,a,s){n.child=e===null?lm(n,null,a,s):Za(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 j in s)j!=="ref"&&(w[j]=s[j])}else w=s;return Xa(n),s=fu(e,n,a,w,p,d),j=du(),e!==null&&!qt?(hu(e,n,d),Rl(e,n,d)):(We&&j&&Xc(n),n.flags|=1,rn(e,n,s,d),n.child)}function tp(e,n,a,s,d){if(e===null){var p=a.type;return typeof p=="function"&&!Ic(p)&&p.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=p,np(e,n,p,s,d)):(e=Ls(a.type,null,s,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(p=e.child,!Fu(e,d)){var w=p.memoizedProps;if(a=a.compare,a=a!==null?a:mi,a(w,s)&&e.ref===n.ref)return Rl(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(mi(p,s)&&e.ref===n.ref)if(qt=!1,n.pendingProps=s=p,Fu(e,d))(e.flags&131072)!==0&&(qt=!0);else return n.lanes=e.lanes,Rl(e,n,d)}return zu(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&&$s(n,p!==null?p.cachePool:null),p!==null?im(n,p):su(),sm(n);else return s=n.lanes=536870912,ap(e,n,p!==null?p.baseLanes|a:a,a,s)}else p!==null?($s(n,p.cachePool),im(n,p),ca(),n.memoizedState=null):(e!==null&&$s(n,null),su(),ca());return rn(e,n,d,a),n.child}function Ti(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=tu();return p=p===null?null:{parent:Ht._currentValue,pool:p},n.memoizedState={baseLanes:a,cachePool:p},e!==null&&$s(n,null),su(),sm(n),e!==null&&br(e,n,s,!0),n.childLanes=d,null}function lo(e,n){return n=ro({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 Za(n,e.child,null,a),e=lo(n,n.pendingProps),e.flags|=2,Un(n),n.memoizedState=null,e}function cv(e,n,a){var s=n.pendingProps,d=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(We){if(s.mode==="hidden")return e=lo(n,s),n.lanes=536870912,Ti(null,e);if(cu(n),(e=wt)?(e=gx(e,Wn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ta!==null?{id:dl,overflow:hl}:null,retryLane:536870912,hydrationErrors:null},a=qh(e),a.return=n,n.child=a,ln=n,wt=null)):e=null,e===null)throw la(n);return n.lanes=536870912,null}return lo(n,s)}var p=e.memoizedState;if(p!==null){var w=p.dehydrated;if(cu(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(qt||br(e,n,a,!1),d=(a&e.childLanes)!==0,qt||d){if(s=gt,s!==null&&(w=_a(s,a),w!==0&&w!==p.retryLane))throw p.retryLane=w,qa(e,w),Dn(s,e,w),Du;po(),n=rp(e,n,a)}else e=p.treeContext,wt=el(w.nextSibling),ln=n,We=!0,na=null,Wn=!1,e!==null&&Vh(n,e),n=lo(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 ao(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 zu(e,n,a,s,d){return Xa(n),a=fu(e,n,a,s,void 0,d),s=du(),e!==null&&!qt?(hu(e,n,d),Rl(e,n,d)):(We&&s&&Xc(n),n.flags|=1,rn(e,n,a,d),n.child)}function ip(e,n,a,s,d,p){return Xa(n),n.updateQueue=null,a=cm(n,s,a,d),om(e),s=du(),e!==null&&!qt?(hu(e,n,p),Rl(e,n,p)):(We&&s&&Xc(n),n.flags|=1,rn(e,n,a,p),n.child)}function sp(e,n,a,s,d){if(Xa(n),n.stateNode===null){var p=xr,w=a.contextType;typeof w=="object"&&w!==null&&(p=an(w)),p=new a(s,p),n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Au,n.stateNode=p,p._reactInternals=n,p=n.stateNode,p.props=s,p.state=n.memoizedState,p.refs={},lu(n),w=a.contextType,p.context=typeof w=="object"&&w!==null?an(w):xr,p.state=n.memoizedState,w=a.getDerivedStateFromProps,typeof w=="function"&&(Nu(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&&Au.enqueueReplaceState(p,p.state,null),ji(n,s,p,d),Si(),p.state=n.memoizedState),typeof p.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){p=n.stateNode;var j=n.memoizedProps,B=Wa(a,j);p.props=B;var J=p.context,re=a.contextType;w=xr,typeof re=="object"&&re!==null&&(w=an(re));var oe=a.getDerivedStateFromProps;re=typeof oe=="function"||typeof p.getSnapshotBeforeUpdate=="function",j=n.pendingProps!==j,re||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(j||J!==w)&&Gm(n,p,s,w),ra=!1;var P=n.memoizedState;p.state=P,ji(n,s,p,d),Si(),J=n.memoizedState,j||P!==J||ra?(typeof oe=="function"&&(Nu(n,a,oe,s),J=n.memoizedState),(B=ra||Xm(n,a,B,s,P,J,w))?(re||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=J),p.props=s,p.state=J,p.context=w,s=B):(typeof p.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{p=n.stateNode,au(e,n),w=n.memoizedProps,re=Wa(a,w),p.props=re,oe=n.pendingProps,P=p.context,J=a.contextType,B=xr,typeof J=="object"&&J!==null&&(B=an(J)),j=a.getDerivedStateFromProps,(J=typeof j=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(w!==oe||P!==B)&&Gm(n,p,s,B),ra=!1,P=n.memoizedState,p.state=P,ji(n,s,p,d),Si();var le=n.memoizedState;w!==oe||P!==le||ra||e!==null&&e.dependencies!==null&&Us(e.dependencies)?(typeof j=="function"&&(Nu(n,a,j,s),le=n.memoizedState),(re=ra||Xm(n,a,re,s,P,le,B)||e!==null&&e.dependencies!==null&&Us(e.dependencies))?(J||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(s,le,B),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(s,le,B)),typeof p.componentDidUpdate=="function"&&(n.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof p.componentDidUpdate!="function"||w===e.memoizedProps&&P===e.memoizedState||(n.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||w===e.memoizedProps&&P===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=le),p.props=s,p.state=le,p.context=B,s=re):(typeof p.componentDidUpdate!="function"||w===e.memoizedProps&&P===e.memoizedState||(n.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||w===e.memoizedProps&&P===e.memoizedState||(n.flags|=1024),s=!1)}return p=s,ao(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=Za(n,e.child,null,d),n.child=Za(n,null,a,d)):rn(e,n,a,d),n.memoizedState=p.state,e=n.child):e=Rl(e,n,d),e}function op(e,n,a,s){return Ya(),n.flags|=256,rn(e,n,a,s),n.child}var Mu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ru(e){return{baseLanes:e,cachePool:Jh()}}function _u(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:(Bt.current&2)!==0),w&&(d=!0,n.flags&=-129),w=(n.flags&32)!==0,n.flags&=-33,e===null){if(We){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:dl,overflow:hl}:null,retryLane:536870912,hydrationErrors:null},a=qh(e),a.return=n,n.child=a,ln=n,wt=null)):e=null,e===null)throw la(n);return gf(e)?n.lanes=32:n.lanes=536870912,null}var j=s.children;return s=s.fallback,d?(ca(),d=n.mode,j=ro({mode:"hidden",children:j},d),s=Ia(s,d,a,null),j.return=n,s.return=n,j.sibling=s,n.child=j,s=n.child,s.memoizedState=Ru(a),s.childLanes=_u(e,w,a),n.memoizedState=Mu,Ti(null,s)):(oa(n),Ou(n,j))}var B=e.memoizedState;if(B!==null&&(j=B.dehydrated,j!==null)){if(p)n.flags&256?(oa(n),n.flags&=-257,n=Bu(e,n,a)):n.memoizedState!==null?(ca(),n.child=e.child,n.flags|=128,n=null):(ca(),j=s.fallback,d=n.mode,s=ro({mode:"visible",children:s.children},d),j=Ia(j,d,a,null),j.flags|=2,s.return=n,j.return=n,s.sibling=j,n.child=s,Za(n,e.child,null,a),s=n.child,s.memoizedState=Ru(a),s.childLanes=_u(e,w,a),n.memoizedState=Mu,n=Ti(null,s));else if(oa(n),gf(j)){if(w=j.nextSibling&&j.nextSibling.dataset,w)var J=w.dgst;w=J,s=Error(i(419)),s.stack="",s.digest=w,gi({value:s,source:null,stack:null}),n=Bu(e,n,a)}else if(qt||br(e,n,a,!1),w=(a&e.childLanes)!==0,qt||w){if(w=gt,w!==null&&(s=_a(w,a),s!==0&&s!==B.retryLane))throw B.retryLane=s,qa(e,s),Dn(w,e,s),Du;xf(j)||po(),n=Bu(e,n,a)}else xf(j)?(n.flags|=192,n.child=e.child,n=null):(e=B.treeContext,wt=el(j.nextSibling),ln=n,We=!0,na=null,Wn=!1,e!==null&&Vh(n,e),n=Ou(n,s.children),n.flags|=4096);return n}return d?(ca(),j=s.fallback,d=n.mode,B=e.child,J=B.sibling,s=Nl(B,{mode:"hidden",children:s.children}),s.subtreeFlags=B.subtreeFlags&65011712,J!==null?j=Nl(J,j):(j=Ia(j,d,a,null),j.flags|=2),j.return=n,s.return=n,s.sibling=j,n.child=s,Ti(null,s),s=n.child,j=e.child.memoizedState,j===null?j=Ru(a):(d=j.cachePool,d!==null?(B=Ht._currentValue,d=d.parent!==B?{parent:B,pool:B}:d):d=Jh(),j={baseLanes:j.baseLanes|a,cachePool:d}),s.memoizedState=j,s.childLanes=_u(e,w,a),n.memoizedState=Mu,Ti(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 Ou(e,n){return n=ro({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function ro(e,n){return e=Ln(22,e,null,n),e.lanes=0,e}function Bu(e,n,a){return Za(n,e.child,null,a),e=Ou(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),Jc(e.return,n,a)}function Lu(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=Bt.current,j=(w&2)!==0;if(j?(w=w&1|2,n.flags|=128):w&=1,C(Bt,w),rn(e,n,s,a),s=We?xi:0,!j&&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&&Gs(e)===null&&(d=a),a=a.sibling;a=d,a===null?(d=n.child,n.child=null):(d=a.sibling,a.sibling=null),Lu(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&&Gs(e)===null){n.child=d;break}e=d.sibling,d.sibling=a,a=d,d=e}Lu(n,!0,a,null,p,s);break;case"together":Lu(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function Rl(e,n,a){if(e!==null&&(n.dependencies=e.dependencies),da|=n.lanes,(a&n.childLanes)===0)if(e!==null){if(br(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 Fu(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Us(e)))}function uv(e,n,a){switch(n.tag){case 3:He(n,n.stateNode.containerInfo),aa(n,Ht,e.memoizedState.cache),Ya();break;case 27:case 5:qe(n);break;case 4:He(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,cu(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=Rl(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||(br(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(Bt,Bt.current),s)break;return null;case 22:return n.lanes=0,lp(e,n,a,n.pendingProps);case 24:aa(n,Ht,e.memoizedState.cache)}return Rl(e,n,a)}function dp(e,n,a){if(e!==null)if(e.memoizedProps!==n.pendingProps)qt=!0;else{if(!Fu(e,a)&&(n.flags&128)===0)return qt=!1,uv(e,n,a);qt=(e.flags&131072)!==0}else qt=!1,We&&(n.flags&1048576)!==0&&Yh(n,xi,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=Qa(n.elementType),n.type=e,typeof e=="function")Ic(e)?(s=Wa(e,s),n.tag=1,n=sp(null,n,e,s,a)):(n.tag=0,n=zu(null,n,e,s,a));else{if(e!=null){var d=e.$$typeof;if(d===Y){n.tag=11,n=ep(null,n,e,s,a);break e}else if(d===V){n.tag=14,n=tp(null,n,e,s,a);break e}}throw n=X(e)||e,Error(i(306,n,""))}}return n;case 0:return zu(e,n,n.type,n.pendingProps,a);case 1:return s=n.type,d=Wa(s,n.pendingProps),sp(e,n,s,d,a);case 3:e:{if(He(n,n.stateNode.containerInfo),e===null)throw Error(i(387));s=n.pendingProps;var p=n.memoizedState;d=p.element,au(e,n),ji(n,s,null,a);var w=n.memoizedState;if(s=w.cache,aa(n,Ht,s),s!==p.cache&&Wc(n,[Ht],a,!0),Si(),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),gi(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),ln=n,We=!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(Ya(),s===d){n=Rl(e,n,a);break e}rn(e,n,s,a)}n=n.child}return n;case 26:return ao(e,n),e===null?(a=Sx(n.type,null,n.pendingProps,null))?n.memoizedState=a:We||(a=n.type,e=n.pendingProps,s=ko(ye.current).createElement(a),s[Kt]=n,s[Ft]=e,sn(s,a,e),Ut(s),n.stateNode=s):n.memoizedState=Sx(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return qe(n),e===null&&We&&(s=n.stateNode=bx(n.type,n.pendingProps,ye.current),ln=n,Wn=!0,d=wt,ga(n.type)?(yf=d,wt=el(s.firstChild)):wt=d),rn(e,n,n.pendingProps.children,a),ao(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&We&&((d=s=wt)&&(s=Hv(s,n.type,n.pendingProps,Wn),s!==null?(n.stateNode=s,ln=n,wt=el(s.firstChild),Wn=!1,d=!0):d=!1),d||la(n)),qe(n),d=n.type,p=n.pendingProps,w=e!==null?e.memoizedProps:null,s=p.children,hf(d,p)?s=null:w!==null&&hf(d,w)&&(n.flags|=32),n.memoizedState!==null&&(d=fu(e,n,tv,null,null,a),Yi._currentValue=d),ao(e,n),rn(e,n,s,a),n.child;case 6:return e===null&&We&&((e=a=wt)&&(a=$v(a,n.pendingProps,Wn),a!==null?(n.stateNode=a,ln=n,wt=null,e=!0):e=!1),e||la(n)),null;case 13:return cp(e,n,a);case 4:return He(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=Za(n,null,s,a):rn(e,n,s,a),n.child;case 11:return ep(e,n,n.type,n.pendingProps,a);case 7:return rn(e,n,n.pendingProps,a),n.child;case 8:return rn(e,n,n.pendingProps.children,a),n.child;case 12:return rn(e,n,n.pendingProps.children,a),n.child;case 10:return s=n.pendingProps,aa(n,n.type,s.value),rn(e,n,s.children,a),n.child;case 9:return d=n.type._context,s=n.pendingProps.children,Xa(n),d=an(d),s=s(d),n.flags|=1,rn(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 cv(e,n,a);case 22:return lp(e,n,a,n.pendingProps);case 24:return Xa(n),s=an(Ht),e===null?(d=tu(),d===null&&(d=gt,p=Pc(),d.pooledCache=p,p.refCount++,p!==null&&(d.pooledCacheLanes|=a),d=p),n.memoizedState={parent:s,cache:d},lu(n),aa(n,Ht,d)):((e.lanes&a)!==0&&(au(e,n),ji(n,null,null,a),Si()),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,Ht,s)):(s=p.cache,aa(n,Ht,s),s!==d.cache&&Wc(n,[Ht],a,!0))),rn(e,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function _l(e){e.flags|=4}function Uu(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 Ka=Is,nu}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 Ka=Is,nu}function io(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?ws():536870912,e.lanes|=n,Mr|=n)}function Di(e,n){if(!We)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 fv(e,n,a){var s=n.pendingProps;switch(Gc(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(Ht),de(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(vr(n)?_l(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Kc())),kt(n),null;case 26:var d=n.type,p=n.memoizedState;return e===null?(_l(n),p!==null?(kt(n),hp(n,p)):(kt(n),Uu(n,d,null,s,a))):p?p!==e.memoizedState?(_l(n),kt(n),hp(n,p)):(kt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&_l(n),kt(n),Uu(n,d,e,s,a)),null;case 27:if(Tt(n),a=ye.current,d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&_l(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return kt(n),null}e=fe.current,vr(n)?Xh(n):(e=bx(d,s,a),n.stateNode=e,_l(n))}return kt(n),null;case 5:if(Tt(n),d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&_l(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return kt(n),null}if(p=fe.current,vr(n))Xh(n);else{var w=ko(ye.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[Kt]=n,p[Ft]=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(sn(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&&_l(n)}}return kt(n),Uu(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,a),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&_l(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(i(166));if(e=ye.current,vr(n)){if(e=n.stateNode,a=n.memoizedProps,s=null,d=ln,d!==null)switch(d.tag){case 27:case 5:s=d.memoizedProps}e[Kt]=n,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||cx(e.nodeValue,a)),e||la(n,!0)}else e=ko(e).createTextNode(s),e[Kt]=n,n.stateNode=e}return kt(n),null;case 31:if(a=n.memoizedState,e===null||e.memoizedState!==null){if(s=vr(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[Kt]=n}else Ya(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;kt(n),e=!1}else a=Kc(),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=vr(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[Kt]=n}else Ya(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;kt(n),d=!1}else d=Kc(),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),io(n,n.updateQueue),kt(n),null);case 4:return de(),e===null&&of(n.stateNode.containerInfo),kt(n),null;case 10:return Dl(n.type),kt(n),null;case 19:if(ee(Bt),s=n.memoizedState,s===null)return kt(n),null;if(d=(n.flags&128)!==0,p=s.rendering,p===null)if(d)Di(s,!1);else{if(_t!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(p=Gs(e),p!==null){for(n.flags|=128,Di(s,!1),e=p.updateQueue,n.updateQueue=e,io(n,e),n.subtreeFlags=0,e=a,a=n.child;a!==null;)$h(a,e),a=a.sibling;return C(Bt,Bt.current&1|2),We&&Al(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&Mt()>fo&&(n.flags|=128,d=!0,Di(s,!1),n.lanes=4194304)}else{if(!d)if(e=Gs(p),e!==null){if(n.flags|=128,d=!0,e=e.updateQueue,n.updateQueue=e,io(n,e),Di(s,!0),s.tail===null&&s.tailMode==="hidden"&&!p.alternate&&!We)return kt(n),null}else 2*Mt()-s.renderingStartTime>fo&&a!==536870912&&(n.flags|=128,d=!0,Di(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=Mt(),e.sibling=null,a=Bt.current,C(Bt,d?a&1|2:a&1),We&&Al(n,s.treeForkCount),e):(kt(n),null);case 22:case 23:return Un(n),ou(),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&&io(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&&ee(Ga),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),Dl(Ht),kt(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function dv(e,n){switch(Gc(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Dl(Ht),de(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Tt(n),null;case 31:if(n.memoizedState!==null){if(Un(n),n.alternate===null)throw Error(i(340));Ya()}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));Ya()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return ee(Bt),null;case 4:return de(),null;case 10:return Dl(n.type),null;case 22:case 23:return Un(n),ou(),e!==null&&ee(Ga),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Dl(Ht),null;case 25:return null;default:return null}}function mp(e,n){switch(Gc(n),n.tag){case 3:Dl(Ht),de();break;case 26:case 27:case 5:Tt(n);break;case 4:de();break;case 31:n.memoizedState!==null&&Un(n);break;case 13:Un(n);break;case 19:ee(Bt);break;case 10:Dl(n.type);break;case 22:case 23:Un(n),ou(),e!==null&&ee(Ga);break;case 24:Dl(Ht)}}function zi(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(j){ct(n,n.return,j)}}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,j=w.destroy;if(j!==void 0){w.destroy=void 0,d=n;var B=a,J=j;try{J()}catch(re){ct(d,B,re)}}}s=s.next}while(s!==p)}}catch(re){ct(n,n.return,re)}}function pp(e){var n=e.updateQueue;if(n!==null){var a=e.stateNode;try{rm(n,a)}catch(s){ct(e,e.return,s)}}}function xp(e,n,a){a.props=Wa(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){ct(e,n,s)}}function Mi(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){ct(e,n,d)}}function ml(e,n){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(d){ct(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){ct(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){ct(e,e.return,d)}}function Hu(e,n,a){try{var s=e.stateNode;_v(s,e.type,a,n),s[Ft]=n}catch(d){ct(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 $u(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 qu(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(qu(e,n,a),e=e.sibling;e!==null;)qu(e,n,a),e=e.sibling}function so(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(so(e,n,a),e=e.sibling;e!==null;)so(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]);sn(n,s,a),n[Kt]=e,n[Ft]=a}catch(p){ct(e,e.return,p)}}var Ol=!1,It=!1,Iu=!1,bp=typeof WeakSet=="function"?WeakSet:Set,tn=null;function hv(e,n){if(e=e.containerInfo,ff=To,e=Mh(e),Bc(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,j=-1,B=-1,J=0,re=0,oe=e,P=null;t:for(;;){for(var le;oe!==a||d!==0&&oe.nodeType!==3||(j=w+d),oe!==p||s!==0&&oe.nodeType!==3||(B=w+s),oe.nodeType===3&&(w+=oe.nodeValue.length),(le=oe.firstChild)!==null;)P=oe,oe=le;for(;;){if(oe===e)break t;if(P===a&&++J===d&&(j=w),P===p&&++re===s&&(B=w),(le=oe.nextSibling)!==null)break;oe=P,P=oe.parentNode}oe=le}a=j===-1||B===-1?null:{start:j,end:B}}else a=null}a=a||{start:0,end:0}}else a=null;for(df={focusedElem:e,selectionRange:a},To=!1,tn=n;tn!==null;)if(n=tn,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,tn=e;else for(;tn!==null;){switch(n=tn,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=Wa(a.type,d);e=s.getSnapshotBeforeUpdate(be,p),s.__reactInternalSnapshotBeforeUpdate=e}catch(ze){ct(a,a.return,ze)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,a=e.nodeType,a===9)pf(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":pf(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,tn=e;break}tn=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&&zi(5,a);break;case 1:if(Ll(e,a),s&4)if(e=a.stateNode,n===null)try{e.componentDidMount()}catch(w){ct(a,a.return,w)}else{var d=Wa(a.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(d,n,e.__reactInternalSnapshotBeforeUpdate)}catch(w){ct(a,a.return,w)}}s&64&&pp(a),s&512&&Mi(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){ct(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&&Mi(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=kv.bind(null,a),qv(e,a))));break;case 22:if(s=a.memoizedState!==null||Ol,!s){n=n!==null&&n.memoizedState!==null||It,d=Ol;var p=It;Ol=s,(It=n)&&!p?Fl(e,a,(a.subtreeFlags&8772)!==0):Ll(e,a),Ol=d,It=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 jt=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(ue&&typeof ue.onCommitFiberUnmount=="function")try{ue.onCommitFiberUnmount(Be,a)}catch{}switch(a.tag){case 26:It||ml(a,n),Bl(e,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:It||ml(a,n);var s=jt,d=Cn;ga(a.type)&&(jt=a.stateNode,Cn=!1),Bl(e,n,a),$i(a.stateNode),jt=s,Cn=d;break;case 5:It||ml(a,n);case 6:if(s=jt,d=Cn,jt=null,Bl(e,n,a),jt=s,Cn=d,jt!==null)if(Cn)try{(jt.nodeType===9?jt.body:jt.nodeName==="HTML"?jt.ownerDocument.body:jt).removeChild(a.stateNode)}catch(p){ct(a,n,p)}else try{jt.removeChild(a.stateNode)}catch(p){ct(a,n,p)}break;case 18:jt!==null&&(Cn?(e=jt,px(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Hr(e)):px(jt,a.stateNode));break;case 4:s=jt,d=Cn,jt=a.stateNode.containerInfo,Cn=!0,Bl(e,n,a),jt=s,Cn=d;break;case 0:case 11:case 14:case 15:ua(2,a,n),It||ua(4,a,n),Bl(e,n,a);break;case 1:It||(ml(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:It=(s=It)||a.memoizedState!==null,Bl(e,n,a),It=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{Hr(e)}catch(a){ct(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{Hr(e)}catch(a){ct(n,n.return,a)}}function mv(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 oo(e,n){var a=mv(e);n.forEach(function(s){if(!a.has(s)){a.add(s);var d=Sv.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,j=w;e:for(;j!==null;){switch(j.tag){case 27:if(ga(j.type)){jt=j.stateNode,Cn=!1;break e}break;case 5:jt=j.stateNode,Cn=!1;break e;case 3:case 4:jt=j.stateNode.containerInfo,Cn=!0;break e}j=j.return}if(jt===null)throw Error(i(160));Sp(p,w,d),jt=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 ol=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),zi(3,e),ua(5,e,e.return));break;case 1:Nn(n,e),An(e),s&512&&(It||a===null||ml(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=ol;if(Nn(n,e),An(e),s&512&&(It||a===null||ml(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[kl]||p[Kt]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=d.createElement(s),d.head.insertBefore(p,d.querySelector("head > title"))),sn(p,s,a),p[Kt]=e,Ut(p),s=p;break e;case"link":var w=Cx("link","href",d).get(s+(a.href||""));if(w){for(var j=0;j<w.length;j++)if(p=w[j],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(j,1);break t}}p=d.createElement(s),sn(p,s,a),d.head.appendChild(p);break;case"meta":if(w=Cx("meta","content",d).get(s+(a.content||""))){for(j=0;j<w.length;j++)if(p=w[j],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(j,1);break t}}p=d.createElement(s),sn(p,s,a),d.head.appendChild(p);break;default:throw Error(i(468,s))}p[Kt]=e,Ut(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&&Hu(e,e.memoizedProps,a.memoizedProps)}break;case 27:Nn(n,e),An(e),s&512&&(It||a===null||ml(a,a.return)),a!==null&&s&4&&Hu(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Nn(n,e),An(e),s&512&&(It||a===null||ml(a,a.return)),e.flags&32){d=e.stateNode;try{Ye(d,"")}catch(be){ct(e,e.return,be)}}s&4&&e.stateNode!=null&&(d=e.memoizedProps,Hu(e,d,a!==null?a.memoizedProps:d)),s&1024&&(Iu=!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){ct(e,e.return,be)}}break;case 3:if(Eo=null,d=ol,ol=So(n.containerInfo),Nn(n,e),ol=d,An(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{Hr(n.containerInfo)}catch(be){ct(e,e.return,be)}Iu&&(Iu=!1,Np(e));break;case 4:s=ol,ol=So(e.stateNode.containerInfo),Nn(n,e),An(e),ol=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,oo(e,s)));break;case 13:Nn(n,e),An(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(uo=Mt()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,oo(e,s)));break;case 22:d=e.memoizedState!==null;var B=a!==null&&a.memoizedState!==null,J=Ol,re=It;if(Ol=J||d,It=re||B,Nn(n,e),It=re,Ol=J,An(e),s&8192)e:for(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,d&&(a===null||B||Ol||It||Pa(e)),a=null,n=e;;){if(n.tag===5||n.tag===26){if(a===null){B=a=n;try{if(p=B.stateNode,d)w=p.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{j=B.stateNode;var oe=B.memoizedProps.style,P=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;j.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(be){ct(B,B.return,be)}}}else if(n.tag===6){if(a===null){B=n;try{B.stateNode.nodeValue=d?"":B.memoizedProps}catch(be){ct(B,B.return,be)}}}else if(n.tag===18){if(a===null){B=n;try{var le=B.stateNode;d?xx(le,!0):xx(B.stateNode,!1)}catch(be){ct(B,B.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,oo(e,a))));break;case 19:Nn(n,e),An(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,oo(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=$u(e);so(e,p,d);break;case 5:var w=a.stateNode;a.flags&32&&(Ye(w,""),a.flags&=-33);var j=$u(e);so(e,j,w);break;case 3:case 4:var B=a.stateNode.containerInfo,J=$u(e);qu(e,J,B);break;default:throw Error(i(161))}}catch(re){ct(e,e.return,re)}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 Pa(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),Pa(n);break;case 1:ml(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&xp(n,n.return,a),Pa(n);break;case 27:$i(n.stateNode);case 26:case 5:ml(n,n.return),Pa(n);break;case 22:n.memoizedState===null&&Pa(n);break;case 30:Pa(n);break;default:Pa(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),zi(4,p);break;case 1:if(Fl(d,p,a),s=p,d=s.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(J){ct(s,s.return,J)}if(s=p,d=s.updateQueue,d!==null){var j=s.stateNode;try{var B=d.shared.hiddenCallbacks;if(B!==null)for(d.shared.hiddenCallbacks=null,d=0;d<B.length;d++)am(B[d],j)}catch(J){ct(s,s.return,J)}}a&&w&64&&pp(p),Mi(p,p.return);break;case 27:vp(p);case 26:case 5:Fl(d,p,a),a&&s===null&&w&4&&gp(p),Mi(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),Mi(p,p.return);break;case 30:break;default:Fl(d,p,a)}n=n.sibling}}function Yu(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&&yi(a))}function Vu(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&yi(e))}function cl(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:cl(e,n,a,s),d&2048&&zi(9,n);break;case 1:cl(e,n,a,s);break;case 3:cl(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&&yi(e)));break;case 12:if(d&2048){cl(e,n,a,s),e=n.stateNode;try{var p=n.memoizedProps,w=p.id,j=p.onPostCommit;typeof j=="function"&&j(w,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(B){ct(n,n.return,B)}}else cl(e,n,a,s);break;case 31:cl(e,n,a,s);break;case 13:cl(e,n,a,s);break;case 23:break;case 22:p=n.stateNode,w=n.alternate,n.memoizedState!==null?p._visibility&2?cl(e,n,a,s):Ri(e,n):p._visibility&2?cl(e,n,a,s):(p._visibility|=2,Tr(e,n,a,s,(n.subtreeFlags&10256)!==0||!1)),d&2048&&Yu(w,n);break;case 24:cl(e,n,a,s),d&2048&&Vu(n.alternate,n);break;default:cl(e,n,a,s)}}function Tr(e,n,a,s,d){for(d=d&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var p=e,w=n,j=a,B=s,J=w.flags;switch(w.tag){case 0:case 11:case 15:Tr(p,w,j,B,d),zi(8,w);break;case 23:break;case 22:var re=w.stateNode;w.memoizedState!==null?re._visibility&2?Tr(p,w,j,B,d):Ri(p,w):(re._visibility|=2,Tr(p,w,j,B,d)),d&&J&2048&&Yu(w.alternate,w);break;case 24:Tr(p,w,j,B,d),d&&J&2048&&Vu(w.alternate,w);break;default:Tr(p,w,j,B,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&&Yu(s.alternate,s);break;case 24:Ri(a,s),d&2048&&Vu(s.alternate,s);break;default:Ri(a,s)}n=n.sibling}}var _i=8192;function Dr(e,n,a){if(e.subtreeFlags&_i)for(e=e.child;e!==null;)Tp(e,n,a),e=e.sibling}function Tp(e,n,a){switch(e.tag){case 26:Dr(e,n,a),e.flags&_i&&e.memoizedState!==null&&eb(a,ol,e.memoizedState,e.memoizedProps);break;case 5:Dr(e,n,a);break;case 3:case 4:var s=ol;ol=So(e.stateNode.containerInfo),Dr(e,n,a),ol=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=_i,_i=16777216,Dr(e,n,a),_i=s):Dr(e,n,a));break;default:Dr(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 Oi(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];tn=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:Oi(e),e.flags&2048&&ua(9,e,e.return);break;case 3:Oi(e);break;case 12:Oi(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,co(e)):Oi(e);break;default:Oi(e)}}function co(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];tn=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),co(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,co(n));break;default:co(n)}e=e.sibling}}function Mp(e,n){for(;tn!==null;){var a=tn;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:yi(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,tn=s;else e:for(a=e;tn!==null;){s=tn;var d=s.sibling,p=s.return;if(kp(s),s===a){tn=null;break e}if(d!==null){d.return=p,tn=d;break e}tn=p}}}var pv={getCacheForType:function(e){var n=an(Ht),a=n.data.get(e);return a===void 0&&(a=e(),n.data.set(e,a)),a},cacheSignal:function(){return an(Ht).controller.signal}},xv=typeof WeakMap=="function"?WeakMap:Map,it=0,gt=null,Ve=null,Ke=0,ot=0,Hn=null,fa=!1,zr=!1,Xu=!1,Ul=0,_t=0,da=0,er=0,Gu=0,$n=0,Mr=0,Bi=null,Tn=null,Qu=!1,uo=0,Rp=0,fo=1/0,ho=null,ha=null,Zt=0,ma=null,Rr=null,Hl=0,Ku=0,Zu=null,_p=null,Li=0,Ju=null;function qn(){return(it&2)!==0&&Ke!==0?Ke&-Ke:M.T!==null?lf():rl()}function Op(){if($n===0)if((Ke&536870912)===0||We){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===gt&&(ot===2||ot===9)||e.cancelPendingCommit!==null)&&(_r(e,0),pa(e,Ke,$n,!1)),fn(e,a),((it&2)===0||e!==gt)&&(e===gt&&((it&2)===0&&(er|=a),_t===4&&pa(e,Ke,$n,!1)),pl(e))}function Bp(e,n,a){if((it&6)!==0)throw Error(i(327));var s=!a&&(n&127)===0&&(n&e.expiredLanes)===0||Xl(e,n),d=s?vv(e,n):Pu(e,n,!0),p=s;do{if(d===0){zr&&!s&&pa(e,n,0,!1);break}else{if(a=e.current.alternate,p&&!gv(a)){d=Pu(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 j=e;d=Bi;var B=j.current.memoizedState.isDehydrated;if(B&&(_r(j,w).flags|=256),w=Pu(j,w,!1),w!==2){if(Xu&&!B){j.errorRecoveryDisabledLanes|=p,er|=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=uo+300-Mt(),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,ho,Qu,n,$n,er,Mr,fa,p,"Throttled",-0,0),d);break e}Lp(s,a,Tn,ho,Qu,n,$n,er,Mr,fa,p,null,-0,0)}}break}while(!0);pl(e)}function Lp(e,n,a,s,d,p,w,j,B,J,re,oe,P,le){if(e.timeoutHandle=-1,oe=n.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:El},Tp(n,p,oe);var be=(p&62914560)===p?uo-Mt():(p&4194048)===p?Rp-Mt():0;if(be=tb(oe,be),be!==null){Hl=p,e.cancelPendingCommit=be(Vp.bind(null,e,n,p,a,s,d,w,j,B,re,oe,null,P,le)),pa(e,p,w,!J);return}}Vp(e,n,p,a,s,d,w,j,B)}function gv(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&=~Gu,n&=~er,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var d=n;0<d;){var p=31-Ie(d),w=1<<p;s[p]=-1,d&=~w}a!==0&&Ql(e,a,n)}function mo(){return(it&6)===0?(Fi(0),!1):!0}function Wu(){if(Ve!==null){if(ot===0)var e=Ve.return;else e=Ve,Tl=Va=null,mu(e),jr=null,bi=0,e=Ve;for(;e!==null;)mp(e.alternate,e),e=e.return;Ve=null}}function _r(e,n){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Lv(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Hl=0,Wu(),gt=e,Ve=a=Nl(e.current,null),Ke=n,ot=0,Hn=null,fa=!1,zr=Xl(e,n),Xu=!1,Mr=$n=Gu=er=da=_t=0,Tn=Bi=null,Qu=!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-Ie(s),p=1<<d;n|=e[d],s&=~p}return Ul=n,_s(),a}function Fp(e,n){Oe=null,M.H=Ai,n===Sr||n===qs?(n=em(),ot=3):n===nu?(n=em(),ot=4):ot=n===Du?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Hn=n,Ve===null&&(_t=1,no(e,Kn(n,e.current)))}function Up(){var e=Fn.current;return e===null?!0:(Ke&4194048)===Ke?Pn===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?e===Pn:!1}function Hp(){var e=M.H;return M.H=Ai,e===null?Ai:e}function $p(){var e=M.A;return M.A=pv,e}function po(){_t=4,fa||(Ke&4194048)!==Ke&&Fn.current!==null||(zr=!0),(da&134217727)===0&&(er&134217727)===0||gt===null||pa(gt,Ke,$n,!1)}function Pu(e,n,a){var s=it;it|=2;var d=Hp(),p=$p();(gt!==e||Ke!==n)&&(ho=null,_r(e,n)),n=!1;var w=_t;e:do try{if(ot!==0&&Ve!==null){var j=Ve,B=Hn;switch(ot){case 8:Wu(),w=6;break e;case 3:case 2:case 9:case 6:Fn.current===null&&(n=!0);var J=ot;if(ot=0,Hn=null,Or(e,j,B,J),a&&zr){w=0;break e}break;default:J=ot,ot=0,Hn=null,Or(e,j,B,J)}}yv(),w=_t;break}catch(re){Fp(e,re)}while(!0);return n&&e.shellSuspendCounter++,Tl=Va=null,it=s,M.H=d,M.A=p,Ve===null&&(gt=null,Ke=0,_s()),w}function yv(){for(;Ve!==null;)qp(Ve)}function vv(e,n){var a=it;it|=2;var s=Hp(),d=$p();gt!==e||Ke!==n?(ho=null,fo=Mt()+500,_r(e,n)):zr=Xl(e,n);e:do try{if(ot!==0&&Ve!==null){n=Ve;var p=Hn;t:switch(ot){case 1:ot=0,Hn=null,Or(e,n,p,1);break;case 2:case 9:if(Wh(p)){ot=0,Hn=null,Ip(n);break}n=function(){ot!==2&&ot!==9||gt!==e||(ot=7),pl(e)},p.then(n,n);break e;case 3:ot=7;break e;case 4:ot=5;break e;case 7:Wh(p)?(ot=0,Hn=null,Ip(n)):(ot=0,Hn=null,Or(e,n,p,7));break;case 5:var w=null;switch(Ve.tag){case 26:w=Ve.memoizedState;case 5:case 27:var j=Ve;if(w?Ax(w):j.stateNode.complete){ot=0,Hn=null;var B=j.sibling;if(B!==null)Ve=B;else{var J=j.return;J!==null?(Ve=J,xo(J)):Ve=null}break t}}ot=0,Hn=null,Or(e,n,p,5);break;case 6:ot=0,Hn=null,Or(e,n,p,6);break;case 8:Wu(),_t=6;break e;default:throw Error(i(462))}}bv();break}catch(re){Fp(e,re)}while(!0);return Tl=Va=null,M.H=s,M.A=d,it=a,Ve!==null?0:(gt=null,Ke=0,_s(),_t)}function bv(){for(;Ve!==null&&!Pt();)qp(Ve)}function qp(e){var n=dp(e.alternate,e,Ul);e.memoizedProps=e.pendingProps,n===null?xo(e):Ve=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,Ke);break;case 11:n=ip(a,n,n.pendingProps,n.type.render,n.ref,Ke);break;case 5:mu(n);default:mp(a,n),n=Ve=$h(n,Ul),n=dp(a,n,Ul)}e.memoizedProps=e.pendingProps,n===null?xo(e):Ve=n}function Or(e,n,a,s){Tl=Va=null,mu(n),jr=null,bi=0;var d=n.return;try{if(ov(e,d,n,a,Ke)){_t=1,no(e,Kn(a,e.current)),Ve=null;return}}catch(p){if(d!==null)throw Ve=d,p;_t=1,no(e,Kn(a,e.current)),Ve=null;return}n.flags&32768?(We||s===1?e=!0:zr||(Ke&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)):xo(n)}function xo(e){var n=e;do{if((n.flags&32768)!==0){Yp(n,fa);return}e=n.return;var a=fv(n.alternate,n,Ul);if(a!==null){Ve=a;return}if(n=n.sibling,n!==null){Ve=n;return}Ve=n=e}while(n!==null);_t===0&&(_t=5)}function Yp(e,n){do{var a=dv(e.alternate,e);if(a!==null){a.flags&=32767,Ve=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(e=e.sibling,e!==null)){Ve=e;return}Ve=e=a}while(e!==null);_t=6,Ve=null}function Vp(e,n,a,s,d,p,w,j,B){e.cancelPendingCommit=null;do go();while(Zt!==0);if((it&6)!==0)throw Error(i(327));if(n!==null){if(n===e.current)throw Error(i(177));if(p=n.lanes|n.childLanes,p|=$c,Gl(e,a,p,w,j,B),e===gt&&(Ve=gt=null,Ke=0),Rr=n,ma=e,Hl=a,Ku=p,Zu=d,_p=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,jv(Ee,function(){return Zp(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=M.T,M.T=null,d=Q.p,Q.p=2,w=it,it|=4;try{hv(e,n,a)}finally{it=w,Q.p=d,M.T=s}}Zt=1,Xp(),Gp(),Qp()}}function Xp(){if(Zt===1){Zt=0;var e=ma,n=Rr,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=M.T,M.T=null;var s=Q.p;Q.p=2;var d=it;it|=4;try{Cp(n,e);var p=df,w=Mh(e.containerInfo),j=p.focusedElem,B=p.selectionRange;if(w!==j&&j&&j.ownerDocument&&zh(j.ownerDocument.documentElement,j)){if(B!==null&&Bc(j)){var J=B.start,re=B.end;if(re===void 0&&(re=J),"selectionStart"in j)j.selectionStart=J,j.selectionEnd=Math.min(re,j.value.length);else{var oe=j.ownerDocument||document,P=oe&&oe.defaultView||window;if(P.getSelection){var le=P.getSelection(),be=j.textContent.length,ze=Math.min(B.start,be),mt=B.end===void 0?ze:Math.min(B.end,be);!le.extend&&ze>mt&&(w=mt,mt=ze,ze=w);var K=Dh(j,ze),$=Dh(j,mt);if(K&&$&&(le.rangeCount!==1||le.anchorNode!==K.node||le.anchorOffset!==K.offset||le.focusNode!==$.node||le.focusOffset!==$.offset)){var Z=oe.createRange();Z.setStart(K.node,K.offset),le.removeAllRanges(),ze>mt?(le.addRange(Z),le.extend($.node,$.offset)):(Z.setEnd($.node,$.offset),le.addRange(Z))}}}}for(oe=[],le=j;le=le.parentNode;)le.nodeType===1&&oe.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<oe.length;j++){var se=oe[j];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}To=!!ff,df=ff=null}finally{it=d,Q.p=s,M.T=a}}e.current=n,Zt=2}}function Gp(){if(Zt===2){Zt=0;var e=ma,n=Rr,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=M.T,M.T=null;var s=Q.p;Q.p=2;var d=it;it|=4;try{wp(e,n.alternate,n)}finally{it=d,Q.p=s,M.T=a}}Zt=3}}function Qp(){if(Zt===4||Zt===3){Zt=0,Xn();var e=ma,n=Rr,a=Hl,s=_p;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Zt=5:(Zt=0,Rr=ma=null,Kp(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(ha=null),Kl(a),n=n.stateNode,ue&&typeof ue.onCommitFiberRoot=="function")try{ue.onCommitFiberRoot(Be,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=M.T,d=Q.p,Q.p=2,M.T=null;try{for(var p=e.onRecoverableError,w=0;w<s.length;w++){var j=s[w];p(j.value,{componentStack:j.stack})}}finally{M.T=n,Q.p=d}}(Hl&3)!==0&&go(),pl(e),d=e.pendingLanes,(a&261930)!==0&&(d&42)!==0?e===Ju?Li++:(Li=0,Ju=e):Li=0,Fi(0)}}function Kp(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,yi(n)))}function go(){return Xp(),Gp(),Qp(),Zp()}function Zp(){if(Zt!==5)return!1;var e=ma,n=Ku;Ku=0;var a=Kl(Hl),s=M.T,d=Q.p;try{Q.p=32>a?32:a,M.T=null,a=Zu,Zu=null;var p=ma,w=Hl;if(Zt=0,Rr=ma=null,Hl=0,(it&6)!==0)throw Error(i(331));var j=it;if(it|=4,zp(p.current),Ap(p,p.current,w,a),it=j,Fi(0,!1),ue&&typeof ue.onPostCommitFiberRoot=="function")try{ue.onPostCommitFiberRoot(Be,p)}catch{}return!0}finally{Q.p=d,M.T=s,Kp(e,n)}}function Jp(e,n,a){n=Kn(a,n),n=Tu(e.stateNode,n,2),e=sa(e,n,2),e!==null&&(fn(e,2),pl(e))}function ct(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),pl(s));break}}n=n.return}}function ef(e,n,a){var s=e.pingCache;if(s===null){s=e.pingCache=new xv;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)||(Xu=!0,d.add(a),e=wv.bind(null,e,n,a),n.then(e,e))}function wv(e,n,a){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,gt===e&&(Ke&a)===a&&(_t===4||_t===3&&(Ke&62914560)===Ke&&300>Mt()-uo?(it&2)===0&&_r(e,0):Gu|=a,Mr===Ke&&(Mr=0)),pl(e)}function Wp(e,n){n===0&&(n=ws()),e=qa(e,n),e!==null&&(fn(e,n),pl(e))}function kv(e){var n=e.memoizedState,a=0;n!==null&&(a=n.retryLane),Wp(e,a)}function Sv(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 jv(e,n){return un(e,n)}var yo=null,Br=null,tf=!1,vo=!1,nf=!1,xa=0;function pl(e){e!==Br&&e.next===null&&(Br===null?yo=Br=e:Br=Br.next=e),vo=!0,tf||(tf=!0,Cv())}function Fi(e,n){if(!nf&&vo){nf=!0;do for(var a=!1,s=yo;s!==null;){if(e!==0){var d=s.pendingLanes;if(d===0)var p=0;else{var w=s.suspendedLanes,j=s.pingedLanes;p=(1<<31-Ie(42|e)+1)-1,p&=d&~(w&~j),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(a=!0,nx(s,p))}else p=Ke,p=Vl(s,s===gt?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(p&3)===0||Xl(s,p)||(a=!0,nx(s,p));s=s.next}while(a);nf=!1}}function Ev(){Pp()}function Pp(){vo=tf=!1;var e=0;xa!==0&&Bv()&&(e=xa);for(var n=Mt(),a=null,s=yo;s!==null;){var d=s.next,p=ex(s,n);p===0?(s.next=null,a===null?yo=d:a.next=d,d===null&&(Br=a)):(a=s,(e!==0||(p&3)!==0)&&(vo=!0)),s=d}Zt!==0&&Zt!==5||Fi(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-Ie(p),j=1<<w,B=d[w];B===-1?((j&a)===0||(j&s)!==0)&&(d[w]=bs(j,n)):B<=n&&(e.expiredLanes|=j),p&=~j}if(n=gt,a=Ke,a=Vl(e,e===n?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,a===0||e===n&&(ot===2||ot===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&ft(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&&ft(s),Kl(a)){case 2:case 8:a=me;break;case 32:a=Ee;break;case 268435456:a=xe;break;default:a=Ee}return s=tx.bind(null,e),a=un(a,s),e.callbackPriority=n,e.callbackNode=a,n}return s!==null&&s!==null&&ft(s),e.callbackPriority=2,e.callbackNode=null,2}function tx(e,n){if(Zt!==0&&Zt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(go()&&e.callbackNode!==a)return null;var s=Ke;return s=Vl(e,e===gt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Bp(e,s,n),ex(e,Mt()),e.callbackNode!=null&&e.callbackNode===a?tx.bind(null,e):null)}function nx(e,n){if(go())return null;Bp(e,n,!0)}function Cv(){Fv(function(){(it&6)!==0?un(ae,Ev):Pp()})}function lf(){if(xa===0){var e=wr;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:Cs(""+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 Nv(e,n,a,s,d){if(n==="submit"&&a&&a.stateNode===d){var p=lx((d[Ft]||null).action),w=s.submitter;w&&(n=(n=w[Ft]||null)?lx(n.formAction):w.getAttribute("formAction"),n!==null&&(p=n,w=null));var j=new Ds("action","action",null,s,d);e.push({event:j,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(xa!==0){var B=w?ax(d,w):new FormData(d);Su(a,{pending:!0,data:B,method:d.method,action:p},null,B)}}else typeof p=="function"&&(j.preventDefault(),B=w?ax(d,w):new FormData(d),Su(a,{pending:!0,data:B,method:d.method,action:p},p,B))},currentTarget:d}]})}}for(var af=0;af<Hc.length;af++){var rf=Hc[af],Av=rf.toLowerCase(),Tv=rf[0].toUpperCase()+rf.slice(1);sl(Av,"on"+Tv)}sl(Oh,"onAnimationEnd"),sl(Bh,"onAnimationIteration"),sl(Lh,"onAnimationStart"),sl("dblclick","onDoubleClick"),sl("focusin","onFocus"),sl("focusout","onBlur"),sl(V0,"onTransitionRun"),sl(X0,"onTransitionStart"),sl(G0,"onTransitionCancel"),sl(Fh,"onTransitionEnd"),Pl("onMouseEnter",["mouseout","mouseover"]),Pl("onMouseLeave",["mouseout","mouseover"]),Pl("onPointerEnter",["pointerout","pointerover"]),Pl("onPointerLeave",["pointerout","pointerover"]),jl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),jl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),jl("onBeforeInput",["compositionend","keypress","textInput","paste"]),jl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),jl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),jl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ui="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(" "),Dv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ui));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 j=s[w],B=j.instance,J=j.currentTarget;if(j=j.listener,B!==p&&d.isPropagationStopped())break e;p=j,d.currentTarget=J;try{p(d)}catch(re){Rs(re)}d.currentTarget=null,p=B}else for(w=0;w<s.length;w++){if(j=s[w],B=j.instance,J=j.currentTarget,j=j.listener,B!==p&&d.isPropagationStopped())break e;p=j,d.currentTarget=J;try{p(d)}catch(re){Rs(re)}d.currentTarget=null,p=B}}}}function Xe(e,n){var a=n[Ot];a===void 0&&(a=n[Ot]=new Set);var s=e+"__bubble";a.has(s)||(ix(n,e,2,!1),a.add(s))}function sf(e,n,a){var s=0;n&&(s|=4),ix(a,e,s,n)}var bo="_reactListening"+Math.random().toString(36).slice(2);function of(e){if(!e[bo]){e[bo]=!0,Ss.forEach(function(a){a!=="selectionchange"&&(Dv.has(a)||sf(a,!1,e),sf(a,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[bo]||(n[bo]=!0,sf("selectionchange",!1,n))}}function ix(e,n,a,s){switch(Ox(n)){case 2:var d=ab;break;case 8:d=rb;break;default:d=Sf}a=d.bind(null,n,a,e),d=void 0,!Nc||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 cf(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 j=s.stateNode.containerInfo;if(j===d)break;if(w===4)for(w=s.return;w!==null;){var B=w.tag;if((B===3||B===4)&&w.stateNode.containerInfo===d)return;w=w.return}for(;j!==null;){if(w=Jl(j),w===null)return;if(B=w.tag,B===5||B===6||B===26||B===27){s=p=w;continue e}j=j.parentNode}}s=s.return}fh(function(){var J=p,re=Ec(a),oe=[];e:{var P=Uh.get(e);if(P!==void 0){var le=Ds,be=e;switch(e){case"keypress":if(As(a)===0)break e;case"keydown":case"keyup":le=S0;break;case"focusin":be="focus",le=zc;break;case"focusout":be="blur",le=zc;break;case"beforeblur":case"afterblur":le=zc;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=f0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=C0;break;case Oh:case Bh:case Lh:le=m0;break;case Fh:le=A0;break;case"scroll":case"scrollend":le=c0;break;case"wheel":le=D0;break;case"copy":case"cut":case"paste":le=x0;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=M0}var ze=(n&4)!==0,mt=!ze&&(e==="scroll"||e==="scrollend"),K=ze?P!==null?P+"Capture":null:P;ze=[];for(var $=J,Z;$!==null;){var se=$;if(Z=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||Z===null||K===null||(se=si($,K),se!=null&&ze.push(Hi($,se,Z))),mt)break;$=$.return}0<ze.length&&(P=new le(P,be,null,a,re),oe.push({event:P,listeners:ze}))}}if((n&7)===0){e:{if(P=e==="mouseover"||e==="pointerover",le=e==="mouseout"||e==="pointerout",P&&a!==jc&&(be=a.relatedTarget||a.fromElement)&&(Jl(be)||be[Zl]))break e;if((le||P)&&(P=re.window===re?re:(P=re.ownerDocument)?P.defaultView||P.parentWindow:window,le?(be=a.relatedTarget||a.toElement,le=J,be=be?Jl(be):null,be!==null&&(mt=u(be),ze=be.tag,be!==mt||ze!==5&&ze!==27&&ze!==6)&&(be=null)):(le=null,be=J),le!==be)){if(ze=mh,se="onMouseLeave",K="onMouseEnter",$="mouse",(e==="pointerout"||e==="pointerover")&&(ze=xh,se="onPointerLeave",K="onPointerEnter",$="pointer"),mt=le==null?P:Oa(le),Z=be==null?P:Oa(be),P=new ze(se,$+"leave",le,a,re),P.target=mt,P.relatedTarget=Z,se=null,Jl(re)===J&&(ze=new ze(K,$+"enter",be,a,re),ze.target=Z,ze.relatedTarget=mt,se=ze),mt=se,le&&be)t:{for(ze=zv,K=le,$=be,Z=0,se=K;se;se=ze(se))Z++;se=0;for(var Ne=$;Ne;Ne=ze(Ne))se++;for(;0<Z-se;)K=ze(K),Z--;for(;0<se-Z;)$=ze($),se--;for(;Z--;){if(K===$||$!==null&&K===$.alternate){ze=K;break t}K=ze(K),$=ze($)}ze=null}else ze=null;le!==null&&sx(oe,P,le,ze,!1),be!==null&&mt!==null&&sx(oe,mt,be,ze,!0)}}e:{if(P=J?Oa(J):window,le=P.nodeName&&P.nodeName.toLowerCase(),le==="select"||le==="input"&&P.type==="file")var lt=jh;else if(kh(P))if(Eh)lt=q0;else{lt=H0;var Se=U0}else le=P.nodeName,!le||le.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?J&&Sc(J.elementType)&&(lt=jh):lt=$0;if(lt&&(lt=lt(e,J))){Sh(oe,lt,a,re);break e}Se&&Se(e,P,J),e==="focusout"&&J&&P.type==="number"&&J.memoizedProps.value!=null&&je(P,"number",P.value)}switch(Se=J?Oa(J):window,e){case"focusin":(kh(Se)||Se.contentEditable==="true")&&(hr=Se,Lc=J,pi=null);break;case"focusout":pi=Lc=hr=null;break;case"mousedown":Fc=!0;break;case"contextmenu":case"mouseup":case"dragend":Fc=!1,Rh(oe,a,re);break;case"selectionchange":if(Y0)break;case"keydown":case"keyup":Rh(oe,a,re)}var Fe;if(Rc)e:{switch(e){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else dr?bh(e,a)&&(Ze="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ze="onCompositionStart");Ze&&(gh&&a.locale!=="ko"&&(dr||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&dr&&(Fe=dh()):(ea=re,Ac="value"in ea?ea.value:ea.textContent,dr=!0)),Se=wo(J,Ze),0<Se.length&&(Ze=new ph(Ze,e,null,a,re),oe.push({event:Ze,listeners:Se}),Fe?Ze.data=Fe:(Fe=wh(a),Fe!==null&&(Ze.data=Fe)))),(Fe=_0?O0(e,a):B0(e,a))&&(Ze=wo(J,"onBeforeInput"),0<Ze.length&&(Se=new ph("onBeforeInput","beforeinput",null,a,re),oe.push({event:Se,listeners:Ze}),Se.data=Fe)),Nv(oe,e,J,a,re)}rx(oe,n)})}function Hi(e,n,a){return{instance:e,listener:n,currentTarget:a}}function wo(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=si(e,a),d!=null&&s.unshift(Hi(e,d,p)),d=si(e,n),d!=null&&s.push(Hi(e,d,p))),e.tag===3)return s;e=e.return}return[]}function zv(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 j=a,B=j.alternate,J=j.stateNode;if(j=j.tag,B!==null&&B===s)break;j!==5&&j!==26&&j!==27||J===null||(B=J,d?(J=si(a,p),J!=null&&w.unshift(Hi(a,J,B))):d||(J=si(a,p),J!=null&&w.push(Hi(a,J,B)))),a=a.return}w.length!==0&&e.push({event:n,listeners:w})}var Mv=/\r\n?/g,Rv=/\u0000|\uFFFD/g;function ox(e){return(typeof e=="string"?e:""+e).replace(Mv,`
|
|
49
|
-
`).replace(Rv,"")}function cx(e,n){return n=ox(n),ox(e)===n}function ht(e,n,a,s,d,p){switch(a){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||Ye(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&Ye(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=Cs(""+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"&&ht(e,n,"name",d.name,d,null),ht(e,n,"formEncType",d.formEncType,d,null),ht(e,n,"formMethod",d.formMethod,d,null),ht(e,n,"formTarget",d.formTarget,d,null)):(ht(e,n,"encType",d.encType,d,null),ht(e,n,"method",d.method,d,null),ht(e,n,"target",d.target,d,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=Cs(""+s),e.setAttribute(a,s);break;case"onClick":s!=null&&(e.onclick=El);break;case"onScroll":s!=null&&Xe("scroll",e);break;case"onScrollEnd":s!=null&&Xe("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=Cs(""+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":Xe("beforetoggle",e),Xe("toggle",e),On(e,"popover",s);break;case"xlinkActuate":il(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":il(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":il(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":il(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":il(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":il(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":il(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":il(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":il(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=s0.get(a)||a,On(e,a,s))}}function uf(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"?Ye(e,s):(typeof s=="number"||typeof s=="bigint")&&Ye(e,""+s);break;case"onScroll":s!=null&&Xe("scroll",e);break;case"onScrollEnd":s!=null&&Xe("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(!js.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[Ft]||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 sn(e,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Xe("error",e),Xe("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:ht(e,n,p,w,a,null)}}d&&ht(e,n,"srcSet",a.srcSet,a,null),s&&ht(e,n,"src",a.src,a,null);return;case"input":Xe("invalid",e);var j=p=w=d=null,B=null,J=null;for(s in a)if(a.hasOwnProperty(s)){var re=a[s];if(re!=null)switch(s){case"name":d=re;break;case"type":w=re;break;case"checked":B=re;break;case"defaultChecked":J=re;break;case"value":p=re;break;case"defaultValue":j=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(i(137,n));break;default:ht(e,n,s,re,a,null)}}we(e,p,j,B,J,w,d,!1);return;case"select":Xe("invalid",e),s=w=p=null;for(d in a)if(a.hasOwnProperty(d)&&(j=a[d],j!=null))switch(d){case"value":p=j;break;case"defaultValue":w=j;break;case"multiple":s=j;default:ht(e,n,d,j,a,null)}n=p,a=w,e.multiple=!!s,n!=null?Ae(e,!!s,n,!1):a!=null&&Ae(e,!!s,a,!0);return;case"textarea":Xe("invalid",e),p=d=s=null;for(w in a)if(a.hasOwnProperty(w)&&(j=a[w],j!=null))switch(w){case"value":s=j;break;case"defaultValue":d=j;break;case"children":p=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(i(91));break;default:ht(e,n,w,j,a,null)}Je(e,s,d,p);return;case"option":for(B in a)if(a.hasOwnProperty(B)&&(s=a[B],s!=null))switch(B){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:ht(e,n,B,s,a,null)}return;case"dialog":Xe("beforetoggle",e),Xe("toggle",e),Xe("cancel",e),Xe("close",e);break;case"iframe":case"object":Xe("load",e);break;case"video":case"audio":for(s=0;s<Ui.length;s++)Xe(Ui[s],e);break;case"image":Xe("error",e),Xe("load",e);break;case"details":Xe("toggle",e);break;case"embed":case"source":case"link":Xe("error",e),Xe("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(J in a)if(a.hasOwnProperty(J)&&(s=a[J],s!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:ht(e,n,J,s,a,null)}return;default:if(Sc(n)){for(re in a)a.hasOwnProperty(re)&&(s=a[re],s!==void 0&&uf(e,n,re,s,a,void 0));return}}for(j in a)a.hasOwnProperty(j)&&(s=a[j],s!=null&&ht(e,n,j,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,j=null,B=null,J=null,re=null;for(le in a){var oe=a[le];if(a.hasOwnProperty(le)&&oe!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":B=oe;default:s.hasOwnProperty(le)||ht(e,n,le,null,s,oe)}}for(var P in s){var le=s[P];if(oe=a[P],s.hasOwnProperty(P)&&(le!=null||oe!=null))switch(P){case"type":p=le;break;case"name":d=le;break;case"checked":J=le;break;case"defaultChecked":re=le;break;case"value":w=le;break;case"defaultValue":j=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(i(137,n));break;default:le!==oe&&ht(e,n,P,le,s,oe)}}ge(e,w,j,B,J,re,p,d);return;case"select":le=w=j=P=null;for(p in a)if(B=a[p],a.hasOwnProperty(p)&&B!=null)switch(p){case"value":break;case"multiple":le=B;default:s.hasOwnProperty(p)||ht(e,n,p,null,s,B)}for(d in s)if(p=s[d],B=a[d],s.hasOwnProperty(d)&&(p!=null||B!=null))switch(d){case"value":P=p;break;case"defaultValue":j=p;break;case"multiple":w=p;default:p!==B&&ht(e,n,d,p,s,B)}n=j,a=w,s=le,P!=null?Ae(e,!!a,P,!1):!!s!=!!a&&(n!=null?Ae(e,!!a,n,!0):Ae(e,!!a,a?[]:"",!1));return;case"textarea":le=P=null;for(j in a)if(d=a[j],a.hasOwnProperty(j)&&d!=null&&!s.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:ht(e,n,j,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":P=d;break;case"defaultValue":le=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(i(91));break;default:d!==p&&ht(e,n,w,d,s,p)}Me(e,P,le);return;case"option":for(var be in a)if(P=a[be],a.hasOwnProperty(be)&&P!=null&&!s.hasOwnProperty(be))switch(be){case"selected":e.selected=!1;break;default:ht(e,n,be,null,s,P)}for(B in s)if(P=s[B],le=a[B],s.hasOwnProperty(B)&&P!==le&&(P!=null||le!=null))switch(B){case"selected":e.selected=P&&typeof P!="function"&&typeof P!="symbol";break;default:ht(e,n,B,P,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 ze in a)P=a[ze],a.hasOwnProperty(ze)&&P!=null&&!s.hasOwnProperty(ze)&&ht(e,n,ze,null,s,P);for(J in s)if(P=s[J],le=a[J],s.hasOwnProperty(J)&&P!==le&&(P!=null||le!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(i(137,n));break;default:ht(e,n,J,P,s,le)}return;default:if(Sc(n)){for(var mt in a)P=a[mt],a.hasOwnProperty(mt)&&P!==void 0&&!s.hasOwnProperty(mt)&&uf(e,n,mt,void 0,s,P);for(re in s)P=s[re],le=a[re],!s.hasOwnProperty(re)||P===le||P===void 0&&le===void 0||uf(e,n,re,P,s,le);return}}for(var K in a)P=a[K],a.hasOwnProperty(K)&&P!=null&&!s.hasOwnProperty(K)&&ht(e,n,K,null,s,P);for(oe in s)P=s[oe],le=a[oe],!s.hasOwnProperty(oe)||P===le||P==null&&le==null||ht(e,n,oe,P,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 Ov(){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,j=d.duration;if(p&&j&&ux(w)){for(w=0,j=d.responseEnd,s+=1;s<a.length;s++){var B=a[s],J=B.startTime;if(J>j)break;var re=B.transferSize,oe=B.initiatorType;re&&ux(oe)&&(B=B.responseEnd,w+=re*(B<j?1:(j-J)/(B-J)))}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 ff=null,df=null;function ko(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 hf(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 mf=null;function Bv(){var e=window.event;return e&&e.type==="popstate"?e===mf?!1:(mf=e,!0):(mf=null,!1)}var hx=typeof setTimeout=="function"?setTimeout:void 0,Lv=typeof clearTimeout=="function"?clearTimeout:void 0,mx=typeof Promise=="function"?Promise:void 0,Fv=typeof queueMicrotask=="function"?queueMicrotask:typeof mx<"u"?function(e){return mx.resolve(null).then(e).catch(Uv)}:hx;function Uv(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),Hr(n);return}s--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")s++;else if(a==="html")$i(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,$i(a);for(var p=a.firstChild;p;){var w=p.nextSibling,j=p.nodeName;p[kl]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&p.rel.toLowerCase()==="stylesheet"||a.removeChild(p),p=w}}else a==="body"&&$i(e.ownerDocument.body);a=d}while(a);Hr(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 pf(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":pf(a),ai(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Hv(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[kl])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 $v(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 xf(e){return e.data==="$?"||e.data==="$~"}function gf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function qv(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 yf=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=ko(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 $i(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);ai(e)}var tl=new Map,wx=new Set;function So(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var $l=Q.d;Q.d={f:Iv,r:Yv,D:Vv,C:Xv,L:Gv,m:Qv,X:Zv,S:Kv,M:Jv};function Iv(){var e=$l.f(),n=mo();return e||n}function Yv(e){var n=Sl(e);n!==null&&n.tag===5&&n.type==="form"?Fm(n):$l.r(e)}var Lr=typeof document>"u"?null:document;function kx(e,n,a){var s=Lr;if(s&&typeof n=="string"&&n){var d=ce(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"),sn(n,"link",e),Ut(n),s.head.appendChild(n)))}}function Vv(e){$l.D(e),kx("dns-prefetch",e,null)}function Xv(e,n){$l.C(e,n),kx("preconnect",e,n)}function Gv(e,n,a){$l.L(e,n,a);var s=Lr;if(s&&e&&n){var d='link[rel="preload"][as="'+ce(n)+'"]';n==="image"&&a&&a.imageSrcSet?(d+='[imagesrcset="'+ce(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(d+='[imagesizes="'+ce(a.imageSizes)+'"]')):d+='[href="'+ce(e)+'"]';var p=d;switch(n){case"style":p=Fr(e);break;case"script":p=Ur(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(qi(p))||n==="script"&&s.querySelector(Ii(p))||(n=s.createElement("link"),sn(n,"link",e),Ut(n),s.head.appendChild(n)))}}function Qv(e,n){$l.m(e,n);var a=Lr;if(a&&e){var s=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+ce(s)+'"][href="'+ce(e)+'"]',p=d;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Ur(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(Ii(p)))return}s=a.createElement("link"),sn(s,"link",e),Ut(s),a.head.appendChild(s)}}}function Kv(e,n,a){$l.S(e,n,a);var s=Lr;if(s&&e){var d=Wl(s).hoistableStyles,p=Fr(e);n=n||"default";var w=d.get(p);if(!w){var j={loading:0,preload:null};if(w=s.querySelector(qi(p)))j.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":n},a),(a=tl.get(p))&&vf(e,a);var B=w=s.createElement("link");Ut(B),sn(B,"link",e),B._p=new Promise(function(J,re){B.onload=J,B.onerror=re}),B.addEventListener("load",function(){j.loading|=1}),B.addEventListener("error",function(){j.loading|=2}),j.loading|=4,jo(w,n,s)}w={type:"stylesheet",instance:w,count:1,state:j},d.set(p,w)}}}function Zv(e,n){$l.X(e,n);var a=Lr;if(a&&e){var s=Wl(a).hoistableScripts,d=Ur(e),p=s.get(d);p||(p=a.querySelector(Ii(d)),p||(e=g({src:e,async:!0},n),(n=tl.get(d))&&bf(e,n),p=a.createElement("script"),Ut(p),sn(p,"link",e),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},s.set(d,p))}}function Jv(e,n){$l.M(e,n);var a=Lr;if(a&&e){var s=Wl(a).hoistableScripts,d=Ur(e),p=s.get(d);p||(p=a.querySelector(Ii(d)),p||(e=g({src:e,async:!0,type:"module"},n),(n=tl.get(d))&&bf(e,n),p=a.createElement("script"),Ut(p),sn(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=ye.current)?So(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=Fr(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=Fr(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(qi(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||Wv(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=Ur(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 Fr(e){return'href="'+ce(e)+'"'}function qi(e){return'link[rel="stylesheet"]['+e+"]"}function jx(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function Wv(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}),sn(n,"link",a),Ut(n),e.head.appendChild(n))}function Ur(e){return'[src="'+ce(e)+'"]'}function Ii(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~="'+ce(a.href)+'"]');if(s)return n.instance=s,Ut(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"),Ut(s),sn(s,"style",d),jo(s,a.precedence,e),n.instance=s;case"stylesheet":d=Fr(a.href);var p=e.querySelector(qi(d));if(p)return n.state.loading|=4,n.instance=p,Ut(p),p;s=jx(a),(d=tl.get(d))&&vf(s,d),p=(e.ownerDocument||e).createElement("link"),Ut(p);var w=p;return w._p=new Promise(function(j,B){w.onload=j,w.onerror=B}),sn(p,"link",s),n.state.loading|=4,jo(p,a.precedence,e),n.instance=p;case"script":return p=Ur(a.src),(d=e.querySelector(Ii(p)))?(n.instance=d,Ut(d),d):(s=a,(d=tl.get(p))&&(s=g({},a),bf(s,d)),e=e.ownerDocument||e,d=e.createElement("script"),Ut(d),sn(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,jo(s,a.precedence,e));return n.instance}function jo(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 j=s[w];if(j.dataset.precedence===n)p=j;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 vf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function bf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Eo=null;function Cx(e,n,a){if(Eo===null){var s=new Map,d=Eo=new Map;d.set(a,s)}else d=Eo,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[kl]||p[Kt]||e==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var w=p.getAttribute(n)||"";w=e+w;var j=s.get(w);j?j.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 Pv(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 eb(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=Fr(s.href),p=n.querySelector(qi(d));if(p){n=p._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Co.bind(e),n.then(e,e)),a.state.loading|=4,a.instance=p,Ut(p);return}p=n.ownerDocument||n,s=jx(s),(d=tl.get(d))&&vf(s,d),p=p.createElement("link"),Ut(p);var w=p;w._p=new Promise(function(j,B){w.onload=j,w.onerror=B}),sn(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=Co.bind(e),n.addEventListener("load",a),n.addEventListener("error",a))}}var wf=0;function tb(e,n){return e.stylesheets&&e.count===0&&Ao(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var s=setTimeout(function(){if(e.stylesheets&&Ao(e,e.stylesheets),e.unsuspend){var p=e.unsuspend;e.unsuspend=null,p()}},6e4+n);0<e.imgBytes&&wf===0&&(wf=62500*Ov());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ao(e,e.stylesheets),e.unsuspend)){var p=e.unsuspend;e.unsuspend=null,p()}},(e.imgBytes>wf?50:800)+n);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(d)}}:null}function Co(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ao(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var No=null;function Ao(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,No=new Map,n.forEach(nb,e),No=null,Co.call(e))}function nb(e,n){if(!(n.state.loading&4)){var a=No.get(e);if(a)var s=a.get(null);else{a=new Map,No.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=Co.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 Yi={$$typeof:H,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function lb(e,n,a,s,d,p,w,j,B){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=Ra(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ra(0),this.hiddenUpdates=Ra(null),this.identifierPrefix=s,this.onUncaughtError=d,this.onCaughtError=p,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.incompleteTransitions=new Map}function Tx(e,n,a,s,d,p,w,j,B,J,re,oe){return e=new lb(e,n,a,w,B,J,re,oe,j),n=1,p===!0&&(n|=24),p=Ln(3,null,null,n),e.current=p,p.stateNode=e,n=Pc(),n.refCount++,e.pooledCache=n,n.refCount++,p.memoizedState={element:s,isDehydrated:a,cache:n},lu(p),e}function Dx(e){return e?(e=xr,e):xr}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),ki(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 kf(e,n){Mx(e,n),(e=e.alternate)&&Mx(e,n)}function Rx(e){if(e.tag===13||e.tag===31){var n=qa(e,67108864);n!==null&&Dn(n,e,67108864),kf(e,67108864)}}function _x(e){if(e.tag===13||e.tag===31){var n=qn();n=nn(n);var a=qa(e,n);a!==null&&Dn(a,e,n),kf(e,n)}}var To=!0;function ab(e,n,a,s){var d=M.T;M.T=null;var p=Q.p;try{Q.p=2,Sf(e,n,a,s)}finally{Q.p=p,M.T=d}}function rb(e,n,a,s){var d=M.T;M.T=null;var p=Q.p;try{Q.p=8,Sf(e,n,a,s)}finally{Q.p=p,M.T=d}}function Sf(e,n,a,s){if(To){var d=jf(s);if(d===null)cf(e,n,s,Do,a),Bx(e,s);else if(sb(d,e,n,a,s))s.stopPropagation();else if(Bx(e,s),n&4&&-1<ib.indexOf(e)){for(;d!==null;){var p=Sl(d);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var w=gn(p.pendingLanes);if(w!==0){var j=p;for(j.pendingLanes|=2,j.entangledLanes|=2;w;){var B=1<<31-Ie(w);j.entanglements[1]|=B,w&=~B}pl(p),(it&6)===0&&(fo=Mt()+500,Fi(0))}}break;case 31:case 13:j=qa(p,2),j!==null&&Dn(j,p,2),mo(),kf(p,2)}if(p=jf(s),p===null&&cf(e,n,s,Do,a),p===d)break;d=p}d!==null&&s.stopPropagation()}else cf(e,n,s,null,a)}}function jf(e){return e=Ec(e),Ef(e)}var Do=null;function Ef(e){if(Do=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 Do=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 ae:return 2;case me:return 8;case Ee:case ie:return 32;case xe:return 268435456;default:return 32}default:return 32}}var Cf=!1,ya=null,va=null,ba=null,Vi=new Map,Xi=new Map,wa=[],ib="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":Vi.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xi.delete(n.pointerId)}}function Gi(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=Sl(n),n!==null&&Rx(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function sb(e,n,a,s,d){switch(n){case"focusin":return ya=Gi(ya,e,n,a,s,d),!0;case"dragenter":return va=Gi(va,e,n,a,s,d),!0;case"mouseover":return ba=Gi(ba,e,n,a,s,d),!0;case"pointerover":var p=d.pointerId;return Vi.set(p,Gi(Vi.get(p)||null,e,n,a,s,d)),!0;case"gotpointercapture":return p=d.pointerId,Xi.set(p,Gi(Xi.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(){_x(a)});return}}else if(n===31){if(n=m(a),n!==null){e.blockedOn=n,ni(e.priority,function(){_x(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 zo(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var a=jf(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);jc=s,a.target.dispatchEvent(s),jc=null}else return n=Sl(a),n!==null&&Rx(n),e.blockedOn=a,!1;n.shift()}return!0}function Fx(e,n,a){zo(e)&&a.delete(n)}function ob(){Cf=!1,ya!==null&&zo(ya)&&(ya=null),va!==null&&zo(va)&&(va=null),ba!==null&&zo(ba)&&(ba=null),Vi.forEach(Fx),Xi.forEach(Fx)}function Mo(e,n){e.blockedOn===n&&(e.blockedOn=null,Cf||(Cf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,ob)))}var Ro=null;function Ux(e){Ro!==e&&(Ro=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ro===e&&(Ro=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(Ef(s||a)===null)continue;break}var p=Sl(a);p!==null&&(e.splice(n,3),n-=3,Su(p,{pending:!0,data:d,method:a.method,action:s},s,d))}}))}function Hr(e){function n(B){return Mo(B,e)}ya!==null&&Mo(ya,e),va!==null&&Mo(va,e),ba!==null&&Mo(ba,e),Vi.forEach(n),Xi.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[Ft]||null;if(typeof p=="function")w||Ux(a);else if(w){var j=null;if(p&&p.hasAttribute("formAction")){if(d=p,w=p[Ft]||null)j=w.formAction;else if(Ef(d)!==null)continue}else j=w.action;typeof j=="function"?a[s+1]=j:(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 Nf(e){this._internalRoot=e}_o.prototype.render=Nf.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)},_o.prototype.unmount=Nf.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),mo(),n[Zl]=null}};function _o(e){this._internalRoot=e}_o.prototype.unstable_scheduleHydration=function(e){if(e){var n=rl();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 cb={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Oo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Oo.isDisabled&&Oo.supportsFiber)try{Be=Oo.inject(cb),ue=Oo}catch{}}return Ki.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,of(e),new Nf(n)},Ki.hydrateRoot=function(e,n,a){if(!o(e))throw Error(i(299));var s=!1,d="",p=Qm,w=Km,j=Zm,B=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&&(j=a.onRecoverableError),a.formState!==void 0&&(B=a.formState)),n=Tx(e,1,!0,n,a??null,s,d,B,p,w,j,Hx),n.context=Dx(null),a=n.current,s=qn(),s=nn(s),d=ia(s),d.callback=null,sa(a,d,s),a=s,n.current.lanes=a,fn(n,a),pl(n),e[Zl]=n.current,of(e),new _o(n)},Ki.version="19.2.4",Ki}var Wx;function wb(){if(Wx)return Df.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(),Df.exports=bb(),Df.exports}var kb=wb();const Sb="modulepreload",jb=function(t){return"/"+t},Px={},Eb=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=jb(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":Sb,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 Cb extends S.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 ms="/api";async function Yt(t){const l=await fetch(`${ms}${t}`);if(!l.ok)throw new Error(`API error: ${l.status}`);return l.json()}async function nl(t,l){const r=await fetch(`${ms}${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 _f(t,l){const r=await fetch(`${ms}${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 $r(t,l){const r={method:"DELETE"};l!==void 0&&(r.headers={"Content-Type":"application/json"},r.body=JSON.stringify(l));const i=await fetch(`${ms}${t}`,r);if(!i.ok)throw new Error(`API error: ${i.status}`);return i.json()}const Ce={getCompany:()=>Yt("/company"),getRoles:()=>Yt("/roles"),getRole:t=>Yt(`/roles/${t}`),getProjects:()=>Yt("/projects"),getProject:t=>Yt(`/projects/${t}`),getStandups:()=>Yt("/operations/standups"),getWaves:()=>Yt("/operations/waves"),getDecisions:()=>Yt("/operations/decisions"),getOrgTree:()=>Yt("/engine/org"),createRole:t=>nl("/engine/roles",t),updateRole:(t,l)=>_f(`/engine/roles/${t}`,l),deleteRole:t=>$r(`/engine/roles/${t}`),getSessions:()=>Yt("/sessions"),getSession:t=>Yt(`/sessions/${t}`),createSession:(t,l="talk")=>nl("/sessions",{roleId:t,mode:l}),deleteSession:t=>$r(`/sessions/${t}`),deleteSessions:t=>$r("/sessions",{ids:t}),deleteEmptySessions:()=>$r("/sessions?empty=true"),updateSession:(t,l)=>_f(`/sessions/${t}`,l),startJob:t=>nl("/jobs",t),getJob:t=>Yt(`/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 Yt(`/jobs${r?"?"+r:""}`)},abortJob:t=>$r(`/jobs/${t}`),getStatus:()=>Yt("/status"),detectEngine:()=>nl("/setup/detect-engine",{}),validatePath:t=>nl("/setup/validate-path",{path:t}),scaffold:t=>nl("/setup/scaffold",t),getTeams:()=>Yt("/setup/teams"),browse:t=>nl("/setup/browse",{path:t}),connectAkb:t=>nl("/setup/connect-akb",{path:t}),getKnowledge:()=>Yt("/knowledge"),getKnowledgeDoc:t=>Yt(`/knowledge/${t}`),createKnowledgeDoc:t=>nl("/knowledge",t),updateKnowledgeDoc:(t,l)=>fetch(`${ms}/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=>$r(`/knowledge/${t}`),getPreferences:()=>Yt("/preferences"),updatePreferences:t=>_f("/preferences",t),chatInChannel:t=>nl("/speech/chat",t),getSaveStatus:()=>Yt("/save/status"),save:t=>nl("/save",{message:t}),getSaveHistory:(t=20)=>Yt(`/save/history?limit=${t}`),restoreSave:(t,l)=>nl("/save/restore",{sha:t,paths:l})};function S1(t){const[l,r]=S.useState([]),[i,o]=S.useState("idle"),[u,f]=S.useState(""),[m,x]=S.useState([]),h=S.useRef(-1),y=S.useRef(null),g=S.useRef(0),v=S.useCallback(()=>{var N;if(!t)return;(N=y.current)==null||N.abort();const k=new AbortController;y.current=k,o("connecting");const E=h.current+1,A=`/api/jobs/${t}/stream?from=${E}`;fetch(A,{signal:k.signal}).then(async L=>{if(!L.ok||!L.body){o("error");return}o("streaming");const H=L.body.getReader(),Y=new TextDecoder;let U="";for(;;){const{done:D,value:V}=await H.read();if(D)break;U+=Y.decode(V,{stream:!0});const q=U.split(`
|
|
50
|
-
`);U=q.pop()??"";let te="";for(const T of q)if(T.startsWith("event: "))te=T.slice(7).trim();else if(T.startsWith("data: ")){try{const F=JSON.parse(T.slice(6));if(te==="activity"){const R=F;R.seq>h.current&&(h.current=R.seq),r(W=>W.some(X=>X.seq===R.seq)?W:[...W,R]),R.type==="text"&&f(W=>W+(R.data.text??"")),R.type==="dispatch:start"&&R.data.childJobId&&x(W=>[...W,R.data.childJobId]),R.type==="job:done"?o("done"):R.type==="job:error"&&o("error")}else if(te==="stream:end"){const R=F.reason;o(R==="done"?"done":R==="error"?"error":"done")}}catch{}te=""}}i==="streaming"&&o("done")}).catch(L=>{L.name!=="AbortError"&&(o("error"),g.current<3&&(g.current++,setTimeout(v,1e3*g.current)))})},[t]),b=S.useCallback(()=>{g.current=0,v()},[v]);return S.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 Nb(t,l){const r={};return(t[t.length-1]===""?[...t,""]:t).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const Ab=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Tb=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Db={};function eg(t,l){return(Db.jsx?Tb:Ab).test(t)}const zb=/[ \t\n\f\r]/g;function Mb(t){return typeof t=="object"?t.type==="text"?tg(t.value):!1:tg(t)}function tg(t){return t.replace(zb,"")===""}class ps{constructor(l,r,i){this.normal=r,this.property=l,i&&(this.space=i)}}ps.prototype.normal={};ps.prototype.property={};ps.prototype.space=void 0;function j1(t,l){const r={},i={};for(const o of t)Object.assign(r,o.property),Object.assign(i,o.normal);return new ps(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 Rb=0;const Ue=or(),Xt=or(),xd=or(),he=or(),bt=or(),Qr=or(),In=or();function or(){return 2**++Rb}const gd=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:Xt,commaOrSpaceSeparated:In,commaSeparated:Qr,number:he,overloadedBoolean:xd,spaceSeparated:bt},Symbol.toStringTag,{value:"Module"})),Of=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<Of.length;){const f=Of[u];ng(this,Of[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 ps(l,r,t.space)}const E1=Wr({properties:{ariaActiveDescendant:null,ariaAtomic:Xt,ariaAutoComplete:null,ariaBusy:Xt,ariaChecked:Xt,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:bt,ariaCurrent:null,ariaDescribedBy:bt,ariaDetails:null,ariaDisabled:Xt,ariaDropEffect:bt,ariaErrorMessage:null,ariaExpanded:Xt,ariaFlowTo:bt,ariaGrabbed:Xt,ariaHasPopup:null,ariaHidden:Xt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:bt,ariaLevel:he,ariaLive:null,ariaModal:Xt,ariaMultiLine:Xt,ariaMultiSelectable:Xt,ariaOrientation:null,ariaOwns:bt,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:Xt,ariaReadOnly:Xt,ariaRelevant:null,ariaRequired:Xt,ariaRoleDescription:bt,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:Xt,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(t,l){return l==="role"?l:"aria-"+l.slice(4).toLowerCase()}});function C1(t,l){return l in t?t[l]:l}function N1(t,l){return C1(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:bt,accessKey:bt,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:bt,autoFocus:Ue,autoPlay:Ue,blocking:bt,capture:null,charSet:null,checked:Ue,cite:null,className:bt,cols:he,colSpan:null,content:null,contentEditable:Xt,controls:Ue,controlsList:bt,coords:he|Qr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:xd,draggable:Xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:bt,height:he,hidden:xd,high:he,href:null,hrefLang:null,htmlFor:bt,httpEquiv:bt,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:bt,itemRef:bt,itemScope:Ue,itemType:bt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,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:Ue,optimum:he,pattern:null,ping:bt,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:bt,required:Ue,reversed:Ue,rows:he,rowSpan:he,sandbox:bt,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:Xt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:Xt,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:bt,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:Xt,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ue,disableRemotePlayback:Ue,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:N1}),Ob=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:In,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:bt,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:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,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:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:In,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,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:he,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:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:bt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:In,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:In,rev:In,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:In,requiredFeatures:In,requiredFonts:In,requiredFormats:In,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:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:In,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:In,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:In,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:C1}),A1=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()}}),T1=Wr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:N1}),D1=Wr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,l){return"xml:"+l.slice(3).toLowerCase()}}),Bb={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"},Lb=/[A-Z]/g,lg=/-[a-z]/g,Fb=/^data[-\w.:]+$/i;function Ub(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"&&Fb.test(l)){if(l.charAt(4)==="-"){const u=l.slice(5).replace(lg,$b);i="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=l.slice(4);if(!lg.test(u)){let f=u.replace(Lb,Hb);f.charAt(0)!=="-"&&(f="-"+f),l="data"+f}}o=Od}return new o(i,l)}function Hb(t){return"-"+t.toLowerCase()}function $b(t){return t.charAt(1).toUpperCase()}const qb=j1([E1,_b,A1,T1,D1],"html"),Bd=j1([E1,Ob,A1,T1,D1],"svg");function Ib(t){return t.join(" ").trim()}var qr={},Bf,ag;function Yb(){if(ag)return Bf;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(A,N){if(typeof A!="string")throw new TypeError("First argument must be a string");if(!A)return[];N=N||{};var L=1,H=1;function Y(X){var G=X.match(l);G&&(L+=G.length);var M=X.lastIndexOf(x);H=~M?X.length-M:H+X.length}function U(){var X={line:L,column:H};return function(G){return G.position=new D(X),te(),G}}function D(X){this.start=X,this.end={line:L,column:H},this.source=N.source}D.prototype.content=A;function V(X){var G=new Error(N.source+":"+L+":"+H+": "+X);if(G.reason=X,G.filename=N.source,G.line=L,G.column=H,G.source=A,!N.silent)throw G}function q(X){var G=X.exec(A);if(G){var M=G[0];return Y(M),A=A.slice(M.length),G}}function te(){q(r)}function T(X){var G;for(X=X||[];G=F();)G!==!1&&X.push(G);return X}function F(){var X=U();if(!(h!=A.charAt(0)||y!=A.charAt(1))){for(var G=2;g!=A.charAt(G)&&(y!=A.charAt(G)||h!=A.charAt(G+1));)++G;if(G+=2,g===A.charAt(G-1))return V("End of comment missing");var M=A.slice(2,G-2);return H+=2,Y(M),A=A.slice(G),H+=2,X({type:v,comment:M})}}function R(){var X=U(),G=q(i);if(G){if(F(),!q(o))return V("property missing ':'");var M=q(u),Q=X({type:b,property:E(G[0].replace(t,g)),value:M?E(M[0].replace(t,g)):g});return q(f),Q}}function W(){var X=[];T(X);for(var G;G=R();)G!==!1&&(X.push(G),T(X));return X}return te(),W()}function E(A){return A?A.replace(m,g):g}return Bf=k,Bf}var rg;function Vb(){if(rg)return qr;rg=1;var t=qr&&qr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(qr,"__esModule",{value:!0}),qr.default=r;const l=t(Yb());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 qr}var Zi={},ig;function Xb(){if(ig)return Zi;ig=1,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.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 Zi.camelCase=x,Zi}var Ji,sg;function Gb(){if(sg)return Ji;sg=1;var t=Ji&&Ji.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},l=t(Vb()),r=Xb();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,Ji=i,Ji}var Qb=Gb();const Kb=k1(Qb),z1=M1("end"),Ld=M1("start");function M1(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 Zb(t){const l=Ld(t),r=z1(t);if(l&&r)return{start:l,end:r}}function is(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=is(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,Jb=new Map,Wb=/[A-Z]/g,Pb=new Set(["table","tbody","thead","tfoot","tr"]),e2=new Set(["td","th"]),R1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function t2(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=c2(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=o2(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:qb,stylePropertyNameCase:l.stylePropertyNameCase||"dom",tableCellAlignToStyle:l.tableCellAlignToStyle!==!1},u=_1(o,t,void 0);return u&&typeof u!="string"?u:o.create(t,o.Fragment,{children:u||void 0},void 0)}function _1(t,l,r){if(l.type==="element")return n2(t,l,r);if(l.type==="mdxFlowExpression"||l.type==="mdxTextExpression")return l2(t,l);if(l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement")return r2(t,l,r);if(l.type==="mdxjsEsm")return a2(t,l);if(l.type==="root")return i2(t,l,r);if(l.type==="text")return s2(t,l)}function n2(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=B1(t,l.tagName,!1),f=u2(t,l);let m=Hd(t,l);return Pb.has(l.tagName)&&(m=m.filter(function(x){return typeof x=="string"?!Mb(x):!0})),O1(t,f,u,l),Ud(f,m),t.ancestors.pop(),t.schema=i,t.create(l,u,f,r)}function l2(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)}us(t,l.position)}function a2(t,l){if(l.data&&l.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(l.data.estree);us(t,l.position)}function r2(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:B1(t,l.name,!0),f=f2(t,l),m=Hd(t,l);return O1(t,f,u,l),Ud(f,m),t.ancestors.pop(),t.schema=i,t.create(l,u,f,r)}function i2(t,l,r){const i={};return Ud(i,Hd(t,l)),t.create(l,t.Fragment,i,r)}function s2(t,l){return l.value}function O1(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 o2(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 c2(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 u2(t,l){const r={};let i,o;for(o in l.properties)if(o!=="children"&&Fd.call(l.properties,o)){const u=d2(t,o,l.properties[o]);if(u){const[f,m]=u;t.tableCellAlignToStyle&&f==="align"&&typeof m=="string"&&e2.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 f2(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 us(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 us(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:Jb;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=_1(t,u,f);m!==void 0&&r.push(m)}return r}function d2(t,l,r){const i=Ub(t.schema,l);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=i.commaSeparated?Nb(r):Ib(r)),i.property==="style"){let o=typeof r=="object"?r:h2(t,String(r));return t.stylePropertyNameCase==="css"&&(o=m2(o)),["style",o]}return[t.elementAttributeNameCase==="react"&&i.space?Bb[i.property]||i.property:i.attribute,r]}}function h2(t,l){try{return Kb(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=R1+"#cannot-parse-style-attribute",o}}function B1(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);us(t)}function us(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=R1+"#cannot-handle-mdx-estrees-without-createevaluater",r}function m2(t){const l={};let r;for(r in t)Fd.call(t,r)&&(l[p2(r)]=t[r]);return l}function p2(t){let l=t.replace(Wb,x2);return l.slice(0,3)==="ms-"&&(l="-"+l),l}function x2(t){return"-"+t.toLowerCase()}const Lf={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"]},g2={};function $d(t,l){const r=g2,i=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return L1(t,i,o)}function L1(t,l,r){if(y2(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]=L1(t[o],l,r);return i.join("")}function y2(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 Yn(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 ll(t,l){return t.length>0?(Yn(t,t.length,0,l),t):l}const dg={}.hasOwnProperty;function F1(t){const l={};let r=-1;for(;++r<t.length;)v2(l,t[r]);return l}function v2(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];b2(o[f],Array.isArray(m)?m:m?[m]:[])}}}function b2(t,l){let r=-1;const i=[];for(;++r<l.length;)(l[r].add==="after"?t:i).push(l[r]);Yn(t,0,0,i)}function U1(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 ul(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const bn=Aa(/[A-Za-z]/),mn=Aa(/[\dA-Za-z]/),w2=Aa(/[#-'*+\--9=?A-Z^-~]/);function ac(t){return t!==null&&(t<32||t===127)}const vd=Aa(/\d/),k2=Aa(/[\dA-Fa-f]/),S2=Aa(/[!-/:-@[-`{-~]/);function De(t){return t!==null&&t<-2}function yt(t){return t!==null&&(t<0||t===32)}function Ge(t){return t===-2||t===-1||t===32}const dc=Aa(new RegExp("\\p{P}|\\p{S}","u")),ir=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 tt(t,l,r,i){const o=i?i-1:Number.POSITIVE_INFINITY;let u=0;return f;function f(x){return Ge(x)?(t.enter(r),m(x)):l(x)}function m(x){return Ge(x)&&u++<o?(t.consume(x),m):(t.exit(r),l(x))}}const j2={tokenize:E2};function E2(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"),tt(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 De(m)?(t.consume(m),t.exit("chunkText"),u):(t.consume(m),f)}}const C2={tokenize:N2},hg={tokenize:A2};function N2(t){const l=this,r=[];let i=0,o,u,f;return m;function m(H){if(i<r.length){const Y=r[i];return l.containerState=Y[1],t.attempt(Y[0].continuation,x,h)(H)}return h(H)}function x(H){if(i++,l.containerState._closeFlow){l.containerState._closeFlow=void 0,o&&L();const Y=l.events.length;let U=Y,D;for(;U--;)if(l.events[U][0]==="exit"&&l.events[U][1].type==="chunkFlow"){D=l.events[U][1].end;break}N(i);let V=Y;for(;V<l.events.length;)l.events[V][1].end={...D},V++;return Yn(l.events,U+1,0,l.events.slice(Y)),l.events.length=V,h(H)}return m(H)}function h(H){if(i===r.length){if(!o)return v(H);if(o.currentConstruct&&o.currentConstruct.concrete)return k(H);l.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return l.containerState={},t.check(hg,y,g)(H)}function y(H){return o&&L(),N(i),v(H)}function g(H){return l.parser.lazy[l.now().line]=i!==r.length,f=l.now().offset,k(H)}function v(H){return l.containerState={},t.attempt(hg,b,k)(H)}function b(H){return i++,r.push([l.currentConstruct,l.containerState]),v(H)}function k(H){if(H===null){o&&L(),N(0),t.consume(H);return}return o=o||l.parser.flow(l.now()),t.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),E(H)}function E(H){if(H===null){A(t.exit("chunkFlow"),!0),N(0),t.consume(H);return}return De(H)?(t.consume(H),A(t.exit("chunkFlow")),i=0,l.interrupt=void 0,m):(t.consume(H),E)}function A(H,Y){const U=l.sliceStream(H);if(Y&&U.push(null),H.previous=u,u&&(u.next=H),u=H,o.defineSkip(H.start),o.write(U),l.parser.lazy[H.start.line]){let D=o.events.length;for(;D--;)if(o.events[D][1].start.offset<f&&(!o.events[D][1].end||o.events[D][1].end.offset>f))return;const V=l.events.length;let q=V,te,T;for(;q--;)if(l.events[q][0]==="exit"&&l.events[q][1].type==="chunkFlow"){if(te){T=l.events[q][1].end;break}te=!0}for(N(i),D=V;D<l.events.length;)l.events[D][1].end={...T},D++;Yn(l.events,q+1,0,l.events.slice(V)),l.events.length=D}}function N(H){let Y=r.length;for(;Y-- >H;){const U=r[Y];l.containerState=U[1],U[0].exit.call(l,t)}r.length=H}function L(){o.write([null]),u=void 0,o=void 0,l.containerState._closeFlow=void 0}}function A2(t,l,r){return tt(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||yt(t)||ir(t))return 1;if(dc(t))return 2}function hc(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:T2,tokenize:D2};function T2(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=ll(h,[["enter",t[i][1],l],["exit",t[i][1],l]])),h=ll(h,[["enter",o,l],["enter",f,l],["exit",f,l],["enter",u,l]]),h=ll(h,hc(l.parser.constructs.insideSpan.null,t.slice(i+1,r),l)),h=ll(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=ll(h,[["enter",t[r][1],l],["exit",t[r][1],l]])):y=0,Yn(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 D2(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 z2={name:"autolink",tokenize:M2};function M2(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 bn(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||ac(b)?r(b):(t.consume(b),x)}function h(b){return b===64?(t.consume(b),y):w2(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 xs={partial:!0,tokenize:R2};function R2(t,l,r){return i;function i(u){return Ge(u)?tt(t,o,"linePrefix")(u):o(u)}function o(u){return u===null||De(u)?l(u):r(u)}}const H1={continuation:{tokenize:O2},exit:B2,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 Ge(f)?(t.enter("blockQuotePrefixWhitespace"),t.consume(f),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),l):(t.exit("blockQuotePrefix"),l(f))}}function O2(t,l,r){const i=this;return o;function o(f){return Ge(f)?tt(t,u,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):u(f)}function u(f){return t.attempt(H1,l,r)(f)}}function B2(t){t.exit("blockQuote")}const $1={name:"characterEscape",tokenize:L2};function L2(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 S2(u)?(t.enter("characterEscapeValue"),t.consume(u),t.exit("characterEscapeValue"),t.exit("characterEscape"),l):r(u)}}const q1={name:"characterReference",tokenize:F2};function F2(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=k2,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:H2},xg={concrete:!0,name:"codeFenced",tokenize:U2};function U2(t,l,r){const i=this,o={partial:!0,tokenize:U};let u=0,f=0,m;return x;function x(D){return h(D)}function h(D){const V=i.events[i.events.length-1];return u=V&&V[1].type==="linePrefix"?V[2].sliceSerialize(V[1],!0).length:0,m=D,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),y(D)}function y(D){return D===m?(f++,t.consume(D),y):f<3?r(D):(t.exit("codeFencedFenceSequence"),Ge(D)?tt(t,g,"whitespace")(D):g(D))}function g(D){return D===null||De(D)?(t.exit("codeFencedFence"),i.interrupt?l(D):t.check(pg,E,Y)(D)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),v(D))}function v(D){return D===null||De(D)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),g(D)):Ge(D)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),tt(t,b,"whitespace")(D)):D===96&&D===m?r(D):(t.consume(D),v)}function b(D){return D===null||De(D)?g(D):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),k(D))}function k(D){return D===null||De(D)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),g(D)):D===96&&D===m?r(D):(t.consume(D),k)}function E(D){return t.attempt(o,Y,A)(D)}function A(D){return t.enter("lineEnding"),t.consume(D),t.exit("lineEnding"),N}function N(D){return u>0&&Ge(D)?tt(t,L,"linePrefix",u+1)(D):L(D)}function L(D){return D===null||De(D)?t.check(pg,E,Y)(D):(t.enter("codeFlowValue"),H(D))}function H(D){return D===null||De(D)?(t.exit("codeFlowValue"),L(D)):(t.consume(D),H)}function Y(D){return t.exit("codeFenced"),l(D)}function U(D,V,q){let te=0;return T;function T(G){return D.enter("lineEnding"),D.consume(G),D.exit("lineEnding"),F}function F(G){return D.enter("codeFencedFence"),Ge(G)?tt(D,R,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):R(G)}function R(G){return G===m?(D.enter("codeFencedFenceSequence"),W(G)):q(G)}function W(G){return G===m?(te++,D.consume(G),W):te>=f?(D.exit("codeFencedFenceSequence"),Ge(G)?tt(D,X,"whitespace")(G):X(G)):q(G)}function X(G){return G===null||De(G)?(D.exit("codeFencedFence"),V(G)):q(G)}}}function H2(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 Ff={name:"codeIndented",tokenize:q2},$2={partial:!0,tokenize:I2};function q2(t,l,r){const i=this;return o;function o(h){return t.enter("codeIndented"),tt(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):De(h)?t.attempt($2,f,x)(h):(t.enter("codeFlowValue"),m(h))}function m(h){return h===null||De(h)?(t.exit("codeFlowValue"),f(h)):(t.consume(h),m)}function x(h){return t.exit("codeIndented"),l(h)}}function I2(t,l,r){const i=this;return o;function o(f){return i.parser.lazy[i.now().line]?r(f):De(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),o):tt(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):De(f)?o(f):r(f)}}const Y2={name:"codeText",previous:X2,resolve:V2,tokenize:G2};function V2(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 X2(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function G2(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)):De(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||De(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 Q2{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&&Wi(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),Wi(this.left,l)}unshift(l){this.setCursor(0),this.right.push(l)}unshiftMany(l){this.setCursor(0),Wi(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);Wi(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-l,Number.POSITIVE_INFINITY);Wi(this.left,r.reverse())}}}function Wi(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 I1(t){const l={};let r=-1,i,o,u,f,m,x,h;const y=new Q2(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,K2(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 Yn(t,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function K2(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 A=[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,A.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):A.pop(),v=A.length;v--;){const N=m.slice(A[v],A[v+1]),L=u.pop();x.push([L,L+N.length-1]),t.splice(L,2,N)}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 Z2={resolve:W2,tokenize:P2},J2={partial:!0,tokenize:ew};function W2(t){return I1(t),t}function P2(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):De(m)?t.check(J2,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 ew(t,l,r){const i=this;return o;function o(f){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),tt(t,u,"linePrefix")}function u(f){if(f===null||De(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 Y1(t,l,r,i,o,u,f,m,x){const h=x||Number.POSITIVE_INFINITY;let y=0;return g;function g(N){return N===60?(t.enter(i),t.enter(o),t.enter(u),t.consume(N),t.exit(u),v):N===null||N===32||N===41||ac(N)?r(N):(t.enter(i),t.enter(f),t.enter(m),t.enter("chunkString",{contentType:"string"}),E(N))}function v(N){return N===62?(t.enter(u),t.consume(N),t.exit(u),t.exit(o),t.exit(i),l):(t.enter(m),t.enter("chunkString",{contentType:"string"}),b(N))}function b(N){return N===62?(t.exit("chunkString"),t.exit(m),v(N)):N===null||N===60||De(N)?r(N):(t.consume(N),N===92?k:b)}function k(N){return N===60||N===62||N===92?(t.consume(N),b):b(N)}function E(N){return!y&&(N===null||N===41||yt(N))?(t.exit("chunkString"),t.exit(m),t.exit(f),t.exit(i),l(N)):y<h&&N===40?(t.consume(N),y++,E):N===41?(t.consume(N),y--,E):N===null||N===32||N===40||ac(N)?r(N):(t.consume(N),N===92?A:E)}function A(N){return N===40||N===41||N===92?(t.consume(N),E):E(N)}}function V1(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):De(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||De(b)||m++>999?(t.exit("chunkString"),y(b)):(t.consume(b),x||(x=!Ge(b)),b===92?v:g)}function v(b){return b===91||b===92||b===93?(t.consume(b),m++,g):g(b)}}function X1(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):De(v)?(t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),tt(t,h,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),y(v))}function y(v){return v===f||v===null||De(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 ss(t,l){let r;return i;function i(o){return De(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),r=!0,i):Ge(o)?tt(t,i,r?"linePrefix":"lineSuffix")(o):l(o)}}const tw={name:"definition",tokenize:lw},nw={partial:!0,tokenize:aw};function lw(t,l,r){const i=this;let o;return u;function u(b){return t.enter("definition"),f(b)}function f(b){return V1.call(i,t,m,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function m(b){return o=ul(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 yt(b)?ss(t,h)(b):h(b)}function h(b){return Y1(t,y,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function y(b){return t.attempt(nw,g,g)(b)}function g(b){return Ge(b)?tt(t,v,"whitespace")(b):v(b)}function v(b){return b===null||De(b)?(t.exit("definition"),i.parser.defined.push(o),l(b)):r(b)}}function aw(t,l,r){return i;function i(m){return yt(m)?ss(t,o)(m):r(m)}function o(m){return X1(t,u,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(m)}function u(m){return Ge(m)?tt(t,f,"whitespace")(m):f(m)}function f(m){return m===null||De(m)?l(m):r(m)}}const rw={name:"hardBreakEscape",tokenize:iw};function iw(t,l,r){return i;function i(u){return t.enter("hardBreakEscape"),t.consume(u),o}function o(u){return De(u)?(t.exit("hardBreakEscape"),l(u)):r(u)}}const sw={name:"headingAtx",resolve:ow,tokenize:cw};function ow(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"},Yn(t,i,r-i+1,[["enter",o,l],["enter",u,l],["exit",u,l],["exit",o,l]])),t}function cw(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||yt(y)?(t.exit("atxHeadingSequence"),m(y)):r(y)}function m(y){return y===35?(t.enter("atxHeadingSequence"),x(y)):y===null||De(y)?(t.exit("atxHeading"),l(y)):Ge(y)?tt(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||yt(y)?(t.exit("atxHeadingText"),m(y)):(t.consume(y),h)}}const uw=["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"],fw={concrete:!0,name:"htmlFlow",resolveTo:mw,tokenize:pw},dw={partial:!0,tokenize:gw},hw={partial:!0,tokenize:xw};function mw(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 pw(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:z):bn(C)?(t.consume(C),f=String.fromCharCode(C),A):r(C)}function v(C){return C===45?(t.consume(C),o=2,b):C===91?(t.consume(C),o=5,m=0,k):bn(C)?(t.consume(C),o=4,i.interrupt?l:z):r(C)}function b(C){return C===45?(t.consume(C),i.interrupt?l:z):r(C)}function k(C){const fe="CDATA[";return C===fe.charCodeAt(m++)?(t.consume(C),m===fe.length?i.interrupt?l:R:k):r(C)}function E(C){return bn(C)?(t.consume(C),f=String.fromCharCode(C),A):r(C)}function A(C){if(C===null||C===47||C===62||yt(C)){const fe=C===47,ve=f.toLowerCase();return!fe&&!u&&gg.includes(ve)?(o=1,i.interrupt?l(C):R(C)):uw.includes(f.toLowerCase())?(o=6,fe?(t.consume(C),N):i.interrupt?l(C):R(C)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?r(C):u?L(C):H(C))}return C===45||mn(C)?(t.consume(C),f+=String.fromCharCode(C),A):r(C)}function N(C){return C===62?(t.consume(C),i.interrupt?l:R):r(C)}function L(C){return Ge(C)?(t.consume(C),L):T(C)}function H(C){return C===47?(t.consume(C),T):C===58||C===95||bn(C)?(t.consume(C),Y):Ge(C)?(t.consume(C),H):T(C)}function Y(C){return C===45||C===46||C===58||C===95||mn(C)?(t.consume(C),Y):U(C)}function U(C){return C===61?(t.consume(C),D):Ge(C)?(t.consume(C),U):H(C)}function D(C){return C===null||C===60||C===61||C===62||C===96?r(C):C===34||C===39?(t.consume(C),x=C,V):Ge(C)?(t.consume(C),D):q(C)}function V(C){return C===x?(t.consume(C),x=null,te):C===null||De(C)?r(C):(t.consume(C),V)}function q(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||yt(C)?U(C):(t.consume(C),q)}function te(C){return C===47||C===62||Ge(C)?H(C):r(C)}function T(C){return C===62?(t.consume(C),F):r(C)}function F(C){return C===null||De(C)?R(C):Ge(C)?(t.consume(C),F):r(C)}function R(C){return C===45&&o===2?(t.consume(C),M):C===60&&o===1?(t.consume(C),Q):C===62&&o===4?(t.consume(C),_):C===63&&o===3?(t.consume(C),z):C===93&&o===5?(t.consume(C),pe):De(C)&&(o===6||o===7)?(t.exit("htmlFlowData"),t.check(dw,ee,W)(C)):C===null||De(C)?(t.exit("htmlFlowData"),W(C)):(t.consume(C),R)}function W(C){return t.check(hw,X,ee)(C)}function X(C){return t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),G}function G(C){return C===null||De(C)?W(C):(t.enter("htmlFlowData"),R(C))}function M(C){return C===45?(t.consume(C),z):R(C)}function Q(C){return C===47?(t.consume(C),f="",ne):R(C)}function ne(C){if(C===62){const fe=f.toLowerCase();return gg.includes(fe)?(t.consume(C),_):R(C)}return bn(C)&&f.length<8?(t.consume(C),f+=String.fromCharCode(C),ne):R(C)}function pe(C){return C===93?(t.consume(C),z):R(C)}function z(C){return C===62?(t.consume(C),_):C===45&&o===2?(t.consume(C),z):R(C)}function _(C){return C===null||De(C)?(t.exit("htmlFlowData"),ee(C)):(t.consume(C),_)}function ee(C){return t.exit("htmlFlow"),l(C)}}function xw(t,l,r){const i=this;return o;function o(f){return De(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 gw(t,l,r){return i;function i(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),t.attempt(xs,l,r)}}const yw={name:"htmlText",tokenize:vw};function vw(t,l,r){const i=this;let o,u,f;return m;function m(z){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(z),x}function x(z){return z===33?(t.consume(z),h):z===47?(t.consume(z),U):z===63?(t.consume(z),H):bn(z)?(t.consume(z),q):r(z)}function h(z){return z===45?(t.consume(z),y):z===91?(t.consume(z),u=0,k):bn(z)?(t.consume(z),L):r(z)}function y(z){return z===45?(t.consume(z),b):r(z)}function g(z){return z===null?r(z):z===45?(t.consume(z),v):De(z)?(f=g,Q(z)):(t.consume(z),g)}function v(z){return z===45?(t.consume(z),b):g(z)}function b(z){return z===62?M(z):z===45?v(z):g(z)}function k(z){const _="CDATA[";return z===_.charCodeAt(u++)?(t.consume(z),u===_.length?E:k):r(z)}function E(z){return z===null?r(z):z===93?(t.consume(z),A):De(z)?(f=E,Q(z)):(t.consume(z),E)}function A(z){return z===93?(t.consume(z),N):E(z)}function N(z){return z===62?M(z):z===93?(t.consume(z),N):E(z)}function L(z){return z===null||z===62?M(z):De(z)?(f=L,Q(z)):(t.consume(z),L)}function H(z){return z===null?r(z):z===63?(t.consume(z),Y):De(z)?(f=H,Q(z)):(t.consume(z),H)}function Y(z){return z===62?M(z):H(z)}function U(z){return bn(z)?(t.consume(z),D):r(z)}function D(z){return z===45||mn(z)?(t.consume(z),D):V(z)}function V(z){return De(z)?(f=V,Q(z)):Ge(z)?(t.consume(z),V):M(z)}function q(z){return z===45||mn(z)?(t.consume(z),q):z===47||z===62||yt(z)?te(z):r(z)}function te(z){return z===47?(t.consume(z),M):z===58||z===95||bn(z)?(t.consume(z),T):De(z)?(f=te,Q(z)):Ge(z)?(t.consume(z),te):M(z)}function T(z){return z===45||z===46||z===58||z===95||mn(z)?(t.consume(z),T):F(z)}function F(z){return z===61?(t.consume(z),R):De(z)?(f=F,Q(z)):Ge(z)?(t.consume(z),F):te(z)}function R(z){return z===null||z===60||z===61||z===62||z===96?r(z):z===34||z===39?(t.consume(z),o=z,W):De(z)?(f=R,Q(z)):Ge(z)?(t.consume(z),R):(t.consume(z),X)}function W(z){return z===o?(t.consume(z),o=void 0,G):z===null?r(z):De(z)?(f=W,Q(z)):(t.consume(z),W)}function X(z){return z===null||z===34||z===39||z===60||z===61||z===96?r(z):z===47||z===62||yt(z)?te(z):(t.consume(z),X)}function G(z){return z===47||z===62||yt(z)?te(z):r(z)}function M(z){return z===62?(t.consume(z),t.exit("htmlTextData"),t.exit("htmlText"),l):r(z)}function Q(z){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(z),t.exit("lineEnding"),ne}function ne(z){return Ge(z)?tt(t,pe,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):pe(z)}function pe(z){return t.enter("htmlTextData"),f(z)}}const Id={name:"labelEnd",resolveAll:Sw,resolveTo:jw,tokenize:Ew},bw={tokenize:Cw},ww={tokenize:Nw},kw={tokenize:Aw};function Sw(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&&Yn(t,0,t.length,r),t}function jw(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=ll(m,t.slice(u+1,u+i+3)),m=ll(m,[["enter",y,l]]),m=ll(m,hc(l.parser.constructs.insideSpan.null,t.slice(u+i+4,f-3),l)),m=ll(m,[["exit",y,l],t[f-2],t[f-1],["exit",h,l]]),m=ll(m,t.slice(f+1)),m=ll(m,[["exit",x,l]]),Yn(t,u,t.length,m),t}function Ew(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(ul(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(bw,y,f?y:g)(v):v===91?t.attempt(ww,y,f?h:g)(v):f?y(v):g(v)}function h(v){return t.attempt(kw,y,g)(v)}function y(v){return l(v)}function g(v){return u._balanced=!0,r(v)}}function Cw(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 yt(g)?ss(t,u)(g):u(g)}function u(g){return g===41?y(g):Y1(t,f,m,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function f(g){return yt(g)?ss(t,x)(g):y(g)}function m(g){return r(g)}function x(g){return g===34||g===39||g===40?X1(t,h,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return yt(g)?ss(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 Nw(t,l,r){const i=this;return o;function o(m){return V1.call(i,t,u,f,"reference","referenceMarker","referenceString")(m)}function u(m){return i.parser.defined.includes(ul(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?l(m):r(m)}function f(m){return r(m)}}function Aw(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 Tw={name:"labelStartImage",resolveAll:Id.resolveAll,tokenize:Dw};function Dw(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 zw={name:"labelStartLink",resolveAll:Id.resolveAll,tokenize:Mw};function Mw(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 Uf={name:"lineEnding",tokenize:Rw};function Rw(t,l){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),tt(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||De(h))?(t.exit("thematicBreak"),l(h)):r(h)}function x(h){return h===o?(t.consume(h),i++,x):(t.exit("thematicBreakSequence"),Ge(h)?tt(t,m,"whitespace")(h):m(h))}}const zn={continuation:{tokenize:Fw},exit:Hw,name:"list",tokenize:Lw},Ow={partial:!0,tokenize:$w},Bw={partial:!0,tokenize:Uw};function Lw(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(xs,i.interrupt?r:y,t.attempt(Ow,v,g))}function y(b){return i.containerState.initialBlankLine=!0,u++,v(b)}function g(b){return Ge(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 Fw(t,l,r){const i=this;return i.containerState._closeFlow=void 0,t.check(xs,o,u);function o(m){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,tt(t,l,"listItemIndent",i.containerState.size+1)(m)}function u(m){return i.containerState.furtherBlankLines||!Ge(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(Bw,l,f)(m))}function f(m){return i.containerState._closeFlow=!0,i.interrupt=void 0,tt(t,t.attempt(zn,l,r),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m)}}function Uw(t,l,r){const i=this;return tt(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 Hw(t){t.exit(this.containerState.type)}function $w(t,l,r){const i=this;return tt(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!Ge(u)&&f&&f[1].type==="listItemPrefixWhitespace"?l(u):r(u)}}const yg={name:"setextUnderline",resolveTo:qw,tokenize:Iw};function qw(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 Iw(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"),Ge(h)?tt(t,x,"lineSuffix")(h):x(h))}function x(h){return h===null||De(h)?(t.exit("setextHeadingLine"),l(h)):r(h)}}const Yw={tokenize:Vw};function Vw(t){const l=this,r=t.attempt(xs,i,t.attempt(this.parser.constructs.flowInitial,o,tt(t,t.attempt(this.parser.constructs.flow,o,t.attempt(Z2,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 Xw={resolveAll:Q1()},Gw=G1("string"),Qw=G1("text");function G1(t){return{resolveAll:Q1(t==="text"?Kw: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 Q1(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 Kw(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 Zw={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:H1},Jw={91:tw},Ww={[-2]:Ff,[-1]:Ff,32:Ff},Pw={35:sw,42:Wo,45:[yg,Wo],60:fw,61:yg,95:Wo,96:xg,126:xg},e3={38:q1,92:$1},t3={[-5]:Uf,[-4]:Uf,[-3]:Uf,33:Tw,38:q1,42:bd,60:[z2,yw],91:zw,92:[rw,$1],93:Id,95:bd,96:Y2},n3={null:[bd,Xw]},l3={null:[42,95]},a3={null:[]},r3=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:l3,contentInitial:Jw,disable:a3,document:Zw,flow:Pw,flowInitial:Ww,insideSpan:n3,string:e3,text:t3},Symbol.toStringTag,{value:"Module"}));function i3(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:V(U),check:V(D),consume:L,enter:H,exit:Y,interrupt:V(D,{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(F){return f=ll(f,F),A(),f[f.length-1]!==null?[]:(q(l,0),h.events=hc(u,h.events,h),h.events)}function v(F,R){return o3(b(F),R)}function b(F){return s3(f,F)}function k(){const{_bufferIndex:F,_index:R,line:W,column:X,offset:G}=i;return{_bufferIndex:F,_index:R,line:W,column:X,offset:G}}function E(F){o[F.line]=F.column,T()}function A(){let F;for(;i._index<f.length;){const R=f[i._index];if(typeof R=="string")for(F=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===F&&i._bufferIndex<R.length;)N(R.charCodeAt(i._bufferIndex));else N(R)}}function N(F){y=y(F)}function L(F){De(F)?(i.line++,i.column=1,i.offset+=F===-3?2:1,T()):F!==-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=F}function H(F,R){const W=R||{};return W.type=F,W.start=k(),h.events.push(["enter",W,h]),m.push(W),W}function Y(F){const R=m.pop();return R.end=k(),h.events.push(["exit",R,h]),R}function U(F,R){q(F,R.from)}function D(F,R){R.restore()}function V(F,R){return W;function W(X,G,M){let Q,ne,pe,z;return Array.isArray(X)?ee(X):"tokenize"in X?ee([X]):_(X);function _(ye){return ke;function ke(He){const de=He!==null&&ye[He],qe=He!==null&&ye.null,Tt=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(qe)?qe:qe?[qe]:[]];return ee(Tt)(He)}}function ee(ye){return Q=ye,ne=0,ye.length===0?M:C(ye[ne])}function C(ye){return ke;function ke(He){return z=te(),pe=ye,ye.partial||(h.currentConstruct=ye),ye.name&&h.parser.constructs.disable.null.includes(ye.name)?ve():ye.tokenize.call(R?Object.assign(Object.create(h),R):h,x,fe,ve)(He)}}function fe(ye){return F(pe,z),G}function ve(ye){return z.restore(),++ne<Q.length?C(Q[ne]):M}}}function q(F,R){F.resolveAll&&!u.includes(F)&&u.push(F),F.resolve&&Yn(h.events,R,h.events.length-R,F.resolve(h.events.slice(R),h)),F.resolveTo&&(h.events=F.resolveTo(h.events,h))}function te(){const F=k(),R=h.previous,W=h.currentConstruct,X=h.events.length,G=Array.from(m);return{from:X,restore:M};function M(){i=F,h.previous=R,h.currentConstruct=W,h.events.length=X,m=G,T()}}function T(){i.line in o&&i.column<2&&(i.column=o[i.line],i.offset+=o[i.line]-1)}}function s3(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 o3(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 c3(t){const i={constructs:F1([r3,...(t||{}).extensions||[]]),content:o(j2),defined:[],document:o(C2),flow:o(Yw),lazy:{},string:o(Gw),text:o(Qw)};return i;function o(u){return f;function f(m){return i3(i,u,m)}}}function u3(t){for(;!I1(t););return t}const vg=/[\0\t\n\r]/g;function f3(){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 d3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function h3(t){return t.replace(d3,m3)}function m3(t,l,r){if(l)return l;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),u=o===120||o===88;return U1(r.slice(u?2:1),u?16:10)}return qd(r)||t}const K1={}.hasOwnProperty;function p3(t,l,r){return l&&typeof l=="object"&&(r=l,l=void 0),x3(r)(u3(c3(r).document().write(f3()(t,l,!0))))}function x3(t){const l={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(zt),autolinkProtocol:te,autolinkEmail:te,atxHeading:u(cn),blockQuote:u(qe),characterEscape:te,characterReference:te,codeFenced:u(Tt),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:u(Tt,f),codeText:u(vt,f),codeTextData:te,data:te,codeFlowValue:te,definition:u(Rn),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:u(ut),hardBreakEscape:u(xn),hardBreakTrailing:u(xn),htmlFlow:u(St,f),htmlFlowData:te,htmlText:u(St,f),htmlTextData:te,image:u(Dt),label:f,link:u(zt),listItem:u(ft),listItemValue:v,listOrdered:u(un,g),listUnordered:u(un),paragraph:u(Pt),reference:C,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:u(cn),strong:u(Xn),thematicBreak:u(Sn)},exit:{atxHeading:x(),atxHeadingSequence:U,autolink:x(),autolinkEmail:de,autolinkProtocol:He,blockQuote:x(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:ye,characterReference:ke,codeFenced:x(A),codeFencedFence:E,codeFencedFenceInfo:b,codeFencedFenceMeta:k,codeFlowValue:T,codeIndented:x(N),codeText:x(G),codeTextData:T,data:T,definition:x(),definitionDestinationString:Y,definitionLabelString:L,definitionTitleString:H,emphasis:x(),hardBreakEscape:x(R),hardBreakTrailing:x(R),htmlFlow:x(W),htmlFlowData:T,htmlText:x(X),htmlTextData:T,image:x(Q),label:pe,labelText:ne,lineEnding:F,link:x(M),listItem:x(),listOrdered:x(),listUnordered:x(),paragraph:x(),referenceString:fe,resourceDestinationString:z,resourceTitleString:_,resource:ee,setextHeading:x(q),setextHeadingLineSequence:V,setextHeadingText:D,strong:x(),thematicBreak:x()}};Z1(l,(t||{}).mdastExtensions||[]);const r={};return i;function i(ae){let me={type:"root",children:[]};const Ee={stack:[me],tokenStack:[],config:l,enter:m,exit:h,buffer:f,resume:y,data:r},ie=[];let xe=-1;for(;++xe<ae.length;)if(ae[xe][1].type==="listOrdered"||ae[xe][1].type==="listUnordered")if(ae[xe][0]==="enter")ie.push(xe);else{const rt=ie.pop();xe=o(ae,rt,xe)}for(xe=-1;++xe<ae.length;){const rt=l[ae[xe][0]];K1.call(rt,ae[xe][1].type)&&rt[ae[xe][1].type].call(Object.assign({sliceSerialize:ae[xe][2].sliceSerialize},Ee),ae[xe][1])}if(Ee.tokenStack.length>0){const rt=Ee.tokenStack[Ee.tokenStack.length-1];(rt[1]||bg).call(Ee,void 0,rt[0])}for(me.position={start:Sa(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:Sa(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},xe=-1;++xe<l.transforms.length;)me=l.transforms[xe](me)||me;return me}function o(ae,me,Ee){let ie=me-1,xe=-1,rt=!1,nt,Be,ue,Qe;for(;++ie<=Ee;){const Ie=ae[ie];switch(Ie[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ie[0]==="enter"?xe++:xe--,Qe=void 0;break}case"lineEndingBlank":{Ie[0]==="enter"&&(nt&&!Qe&&!xe&&!ue&&(ue=ie),Qe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Qe=void 0}if(!xe&&Ie[0]==="enter"&&Ie[1].type==="listItemPrefix"||xe===-1&&Ie[0]==="exit"&&(Ie[1].type==="listUnordered"||Ie[1].type==="listOrdered")){if(nt){let _n=ie;for(Be=void 0;_n--;){const en=ae[_n];if(en[1].type==="lineEnding"||en[1].type==="lineEndingBlank"){if(en[0]==="exit")continue;Be&&(ae[Be][1].type="lineEndingBlank",rt=!0),en[1].type="lineEnding",Be=_n}else if(!(en[1].type==="linePrefix"||en[1].type==="blockQuotePrefix"||en[1].type==="blockQuotePrefixWhitespace"||en[1].type==="blockQuoteMarker"||en[1].type==="listItemIndent"))break}ue&&(!Be||ue<Be)&&(nt._spread=!0),nt.end=Object.assign({},Be?ae[Be][1].start:Ie[1].end),ae.splice(Be||ie,0,["exit",nt,Ie[2]]),ie++,Ee++}if(Ie[1].type==="listItemPrefix"){const _n={type:"listItem",_spread:!1,start:Object.assign({},Ie[1].start),end:void 0};nt=_n,ae.splice(ie,0,["enter",_n,Ie[2]]),ie++,Ee++,ue=void 0,Qe=!0}}}return ae[me][1]._spread=rt,Ee}function u(ae,me){return Ee;function Ee(ie){m.call(this,ae(ie),ie),me&&me.call(this,ie)}}function f(){this.stack.push({type:"fragment",children:[]})}function m(ae,me,Ee){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([me,Ee||void 0]),ae.position={start:Sa(me.start),end:void 0}}function x(ae){return me;function me(Ee){ae&&ae.call(this,Ee),h.call(this,Ee)}}function h(ae,me){const Ee=this.stack.pop(),ie=this.tokenStack.pop();if(ie)ie[0].type!==ae.type&&(me?me.call(this,ae,ie[0]):(ie[1]||bg).call(this,ae,ie[0]));else throw new Error("Cannot close `"+ae.type+"` ("+is({start:ae.start,end:ae.end})+"): it’s not open");Ee.position.end=Sa(ae.end)}function y(){return $d(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function v(ae){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.lang=ae}function k(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.meta=ae}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function A(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.value=ae.replace(/(\r?\n|\r)$/g,"")}function L(ae){const me=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=me,Ee.identifier=ul(this.sliceSerialize(ae)).toLowerCase()}function H(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.title=ae}function Y(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.url=ae}function U(ae){const me=this.stack[this.stack.length-1];if(!me.depth){const Ee=this.sliceSerialize(ae).length;me.depth=Ee}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function V(ae){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function q(){this.data.setextHeadingSlurpLineEnding=void 0}function te(ae){const Ee=this.stack[this.stack.length-1].children;let ie=Ee[Ee.length-1];(!ie||ie.type!=="text")&&(ie=Mt(),ie.position={start:Sa(ae.start),end:void 0},Ee.push(ie)),this.stack.push(ie)}function T(ae){const me=this.stack.pop();me.value+=this.sliceSerialize(ae),me.position.end=Sa(ae.end)}function F(ae){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=me.children[me.children.length-1];Ee.position.end=Sa(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&l.canContainEols.includes(me.type)&&(te.call(this,ae),T.call(this,ae))}function R(){this.data.atHardBreak=!0}function W(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.value=ae}function X(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.value=ae}function G(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.value=ae}function M(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=me,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function Q(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=me,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function ne(ae){const me=this.sliceSerialize(ae),Ee=this.stack[this.stack.length-2];Ee.label=h3(me),Ee.identifier=ul(me).toLowerCase()}function pe(){const ae=this.stack[this.stack.length-1],me=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const ie=ae.children;Ee.children=ie}else Ee.alt=me}function z(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.url=ae}function _(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.title=ae}function ee(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function fe(ae){const me=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=me,Ee.identifier=ul(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function ve(ae){this.data.characterReferenceType=ae.type}function ye(ae){const me=this.sliceSerialize(ae),Ee=this.data.characterReferenceType;let ie;Ee?(ie=U1(me,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ie=qd(me);const xe=this.stack[this.stack.length-1];xe.value+=ie}function ke(ae){const me=this.stack.pop();me.position.end=Sa(ae.end)}function He(ae){T.call(this,ae);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(ae)}function de(ae){T.call(this,ae);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(ae)}function qe(){return{type:"blockquote",children:[]}}function Tt(){return{type:"code",lang:null,meta:null,value:""}}function vt(){return{type:"inlineCode",value:""}}function Rn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ut(){return{type:"emphasis",children:[]}}function cn(){return{type:"heading",depth:0,children:[]}}function xn(){return{type:"break"}}function St(){return{type:"html",value:""}}function Dt(){return{type:"image",title:null,url:"",alt:null}}function zt(){return{type:"link",title:null,url:"",children:[]}}function un(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function ft(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function Pt(){return{type:"paragraph",children:[]}}function Xn(){return{type:"strong",children:[]}}function Mt(){return{type:"text",value:""}}function Sn(){return{type:"thematicBreak"}}}function Sa(t){return{line:t.line,column:t.column,offset:t.offset}}function Z1(t,l){let r=-1;for(;++r<l.length;){const i=l[r];Array.isArray(i)?Z1(t,i):g3(t,i)}}function g3(t,l){let r;for(r in l)if(K1.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+"` ("+is({start:t.start,end:t.end})+"): a different token (`"+l.type+"`, "+is({start:l.start,end:l.end})+") is open"):new Error("Cannot close document, a token (`"+l.type+"`, "+is({start:l.start,end:l.end})+") is still open")}function y3(t){const l=this;l.parser=r;function r(i){return p3(i,{...l.data("settings"),...t,extensions:l.data("micromarkExtensions")||[],mdastExtensions:l.data("fromMarkdownExtensions")||[]})}}function v3(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 b3(t,l){const r={type:"element",tagName:"br",properties:{},children:[]};return t.patch(l,r),[t.applyData(l,r),{type:"text",value:`
|
|
54
|
-
`}]}function w3(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 k3(t,l){const r={type:"element",tagName:"del",properties:{},children:t.all(l)};return t.patch(l,r),t.applyData(l,r)}function S3(t,l){const r={type:"element",tagName:"em",properties:{},children:t.all(l)};return t.patch(l,r),t.applyData(l,r)}function j3(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 E3(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 C3(t,l){if(t.options.allowDangerousHtml){const r={type:"raw",value:l.value};return t.patch(l,r),t.applyData(l,r)}}function J1(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 N3(t,l){const r=String(l.identifier).toUpperCase(),i=t.definitionById.get(r);if(!i)return J1(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 A3(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 T3(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 D3(t,l){const r=String(l.identifier).toUpperCase(),i=t.definitionById.get(r);if(!i)return J1(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 z3(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 M3(t,l,r){const i=t.all(l),o=r?R3(r):W1(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 R3(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=W1(r[i])}return l}function W1(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 O3(t,l){const r={type:"element",tagName:"p",properties:{},children:t.all(l)};return t.patch(l,r),t.applyData(l,r)}function B3(t,l){const r={type:"root",children:t.wrap(t.all(l))};return t.patch(l,r),t.applyData(l,r)}function L3(t,l){const r={type:"element",tagName:"strong",properties:{},children:t.all(l)};return t.patch(l,r),t.applyData(l,r)}function F3(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=z1(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 U3(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 H3(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 $3(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 q3(t,l){const r={type:"text",value:$3(String(l.value))};return t.patch(l,r),t.applyData(l,r)}function I3(t,l){const r={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(l,r),t.applyData(l,r)}const Y3={blockquote:v3,break:b3,code:w3,delete:k3,emphasis:S3,footnoteReference:j3,heading:E3,html:C3,imageReference:N3,image:A3,inlineCode:T3,linkReference:D3,link:z3,listItem:M3,list:_3,paragraph:O3,root:B3,strong:L3,table:F3,tableCell:H3,tableRow:U3,text:q3,thematicBreak:I3,toml:Bo,yaml:Bo,definition:Bo,footnoteDefinition:Bo};function Bo(){}const P1=-1,mc=0,os=1,rc=2,Yd=3,Vd=4,Xd=5,Gd=6,ey=7,ty=8,jg=typeof self=="object"?self:globalThis,V3=(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 mc:case P1:return r(f,o);case os:{const m=r([],o);for(const x of f)m.push(i(x));return m}case rc:{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 ey:{const{name:m,message:x}=f;return r(new jg[m](x),o)}case ty: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=>V3(new Map,t)(0),Ir="",{toString:X3}={},{keys:G3}=Object,Pi=t=>{const l=typeof t;if(l!=="object"||!t)return[mc,l];const r=X3.call(t).slice(8,-1);switch(r){case"Array":return[os,Ir];case"Object":return[rc,Ir];case"Date":return[Yd,Ir];case"RegExp":return[Vd,Ir];case"Map":return[Xd,Ir];case"Set":return[Gd,Ir];case"DataView":return[os,r]}return r.includes("Array")?[os,r]:r.includes("Error")?[ey,r]:[rc,r]},Lo=([t,l])=>t===mc&&(l==="function"||l==="symbol"),Q3=(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]=Pi(f);switch(m){case mc:{let y=f;switch(x){case"bigint":m=ty,y=f.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+x);y=null;break;case"undefined":return o([P1],f)}return o([m,y],f)}case os:{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 rc:{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 G3(f))(t||!Lo(Pi(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||!(Lo(Pi(v))||Lo(Pi(b))))&&y.push([u(v),u(b)]);return g}case Gd:{const y=[],g=o([m,y],f);for(const v of f)(t||!Lo(Pi(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 Q3(!(l||r),!!l,new Map,i)(t),i},ic=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 K3(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 Z3(t,l){return"Back to reference "+(t+1)+(l>1?"-"+l:"")}function J3(t){const l=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=t.options.footnoteBackContent||K3,i=t.options.footnoteBackLabel||Z3,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 A=y[y.length-1];if(A&&A.type==="element"&&A.tagName==="p"){const L=A.children[A.children.length-1];L&&L.type==="text"?L.value+=" ":A.children.push({type:"text",value:" "}),A.children.push(...k)}else y.push(...k);const N={type:"element",tagName:"li",properties:{id:l+"fn-"+v},children:t.wrap(y,!0)};t.patch(h,N),m.push(N)}if(m.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...ic(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 pc=(function(t){if(t==null)return tk;if(typeof t=="function")return xc(t);if(typeof t=="object")return Array.isArray(t)?W3(t):P3(t);if(typeof t=="string")return ek(t);throw new Error("Expected function, string, or object as test")});function W3(t){const l=[];let r=-1;for(;++r<t.length;)l[r]=pc(t[r]);return xc(i);function i(...o){let u=-1;for(;++u<l.length;)if(l[u].apply(this,o))return!0;return!1}}function P3(t){const l=t;return xc(r);function r(i){const o=i;let u;for(u in t)if(o[u]!==l[u])return!1;return!0}}function ek(t){return xc(l);function l(r){return r&&r.type===t}}function xc(t){return l;function l(r,i,o){return!!(nk(r)&&t.call(this,r,typeof i=="number"?i:void 0,o||void 0))}}function tk(){return!0}function nk(t){return t!==null&&typeof t=="object"&&"type"in t}const ny=[],lk=!0,wd=!1,ak="skip";function ly(t,l,r,i){let o;typeof l=="function"&&typeof r!="function"?(i=r,r=l):o=l;const u=pc(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=ny,k,E,A;if((!l||u(x,h,y[y.length-1]||void 0))&&(b=rk(r(x,y)),b[0]===wd))return b;if("children"in x&&x.children){const N=x;if(N.children&&b[0]!==ak)for(E=(i?N.children.length:-1)+f,A=y.concat(N);E>-1&&E<N.children.length;){const L=N.children[E];if(k=m(L,E,A)(),k[0]===wd)return k;E=typeof k[1]=="number"?k[1]:E+f}}return b}}}function rk(t){return Array.isArray(t)?t:typeof t=="number"?[lk,t]:t==null?ny:[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),ly(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,ik={};function sk(t,l){const r=l||ik,i=new Map,o=new Map,u=new Map,f={...Y3,...r.handlers},m={all:h,applyData:ck,definitionById:i,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:f,one:x,options:r,patch:ok,wrap:fk};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,...A}=y,N=ic(A);return N.children=m.all(y),N}return ic(y)}return(m.options.unknownHandler||uk)(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 ok(t,l){t.position&&(l.position=Zb(t))}function ck(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,ic(u)),"children"in r&&r.children&&o!==null&&o!==void 0&&(r.children=o)}return r}function uk(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 fk(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=sk(t,l),i=r.one(t,void 0),o=J3(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 dk(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 Hf,Dg;function hk(){if(Dg)return Hf;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 Hf=function x(){var h,y,g,v,b,k,E=arguments[0],A=1,N=arguments.length,L=!1;for(typeof E=="boolean"&&(L=E,E=arguments[1]||{},A=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});A<N;++A)if(h=arguments[A],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},Hf}var mk=hk();const $f=k1(mk);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 pk(){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?xk(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 xk(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 gl={basename:gk,dirname:yk,extname:vk,join:bk,sep:"/"};function gk(t,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');gs(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 yk(t){if(gs(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 vk(t){gs(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 bk(...t){let l=-1,r;for(;++l<t.length;)gs(t[l]),t[l]&&(r=r===void 0?t[l]:r+"/"+t[l]);return r===void 0?".":wk(r)}function wk(t){gs(t);const l=t.codePointAt(0)===47;let r=kk(t,!l);return r.length===0&&!l&&(r="."),r.length>0&&t.codePointAt(t.length-1)===47&&(r+="/"),l?"/"+r:r}function kk(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 gs(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Sk={cwd:jk};function jk(){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 Ek(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 Ck(t)}function Ck(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 qf=["history","path","basename","stem","extname","dirname"];class ay{constructor(l){let r;l?jd(l)?r={path:l}:typeof l=="string"||Nk(l)?r={value:l}:r=l:r={},this.cwd="cwd"in r?"":Sk.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<qf.length;){const u=qf[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)qf.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?gl.basename(this.path):void 0}set basename(l){Yf(l,"basename"),If(l,"basename"),this.path=gl.join(this.dirname||"",l)}get dirname(){return typeof this.path=="string"?gl.dirname(this.path):void 0}set dirname(l){zg(this.basename,"dirname"),this.path=gl.join(l||"",this.basename)}get extname(){return typeof this.path=="string"?gl.extname(this.path):void 0}set extname(l){if(If(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=gl.join(this.dirname,this.stem+(l||""))}get path(){return this.history[this.history.length-1]}set path(l){jd(l)&&(l=Ek(l)),Yf(l,"path"),this.path!==l&&this.history.push(l)}get stem(){return typeof this.path=="string"?gl.basename(this.path,this.extname):void 0}set stem(l){Yf(l,"stem"),If(l,"stem"),this.path=gl.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 If(t,l){if(t&&t.includes(gl.sep))throw new Error("`"+l+"` cannot be a path: did not expect `"+gl.sep+"`")}function Yf(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 Nk(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Ak=(function(t){const i=this.constructor.prototype,o=i[t],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,i),u}),Tk={}.hasOwnProperty;class Kd extends Ak{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=pk()}copy(){const l=new Kd;let r=-1;for(;++r<this.attachers.length;){const i=this.attachers[r];l.use(...i)}return l.data($f(!0,{},this.namespace)),l}data(l,r){return typeof l=="string"?arguments.length===2?(Gf("data",this.frozen),this.namespace[l]=r,this):Tk.call(this.namespace,l)&&this.namespace[l]||void 0:l?(Gf("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=Fo(l),i=this.parser||this.Parser;return Vf("parse",i),i(String(r),r)}process(l,r){const i=this;return this.freeze(),Vf("process",this.parser||this.Parser),Xf("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(u,f){const m=Fo(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);Mk(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(),Vf("processSync",this.parser||this.Parser),Xf("processSync",this.compiler||this.Compiler),this.process(l,o),Rg("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=Fo(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),Rg("runSync","run",i),o;function u(f,m){Tg(f),o=m,i=!0}}stringify(l,r){this.freeze();const i=Fo(r),o=this.compiler||this.Compiler;return Xf("stringify",o),Mg(l),o(l,i)}use(l,...r){const i=this.attachers,o=this.namespace;if(Gf("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=$f(!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=$f(!0,E,b)),i[v]=[h,b,...k]}}}}const Dk=new Kd().freeze();function Vf(t,l){if(typeof l!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Xf(t,l){if(typeof l!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Gf(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 Rg(t,l,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+l+"` instead")}function Fo(t){return zk(t)?t:new ay(t)}function zk(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function Mk(t){return typeof t=="string"||Rk(t)}function Rk(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const _k="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",_g=[],Og={allowDangerousHtml:!0},Ok=/^(https?|ircs?|mailto|xmpp)$/i,Bk=[{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 ry(t){const l=Lk(t),r=Fk(t);return Uk(l.runSync(l.parse(r),r),t)}function Lk(t){const l=t.rehypePlugins||_g,r=t.remarkPlugins||_g,i=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Og}:Og;return Dk().use(y3).use(r).use(dk,i).use(l)}function Fk(t){const l=t.children||"",r=new ay;return typeof l=="string"&&(r.value=l),r}function Uk(t,l){const r=l.allowedElements,i=l.allowElement,o=l.components,u=l.disallowedElements,f=l.skipHtml,m=l.unwrapDisallowed,x=l.urlTransform||Hk;for(const y of Bk)Object.hasOwn(l,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+_k+y.id,void 0);return Qd(t,h),t2(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 Lf)if(Object.hasOwn(Lf,b)&&Object.hasOwn(y.properties,b)){const k=y.properties[b],E=Lf[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 Hk(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||Ok.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 $k(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function qk(t,l,r){const o=pc((r||{}).ignore||[]),u=Ik(l);let f=-1;for(;++f<u.length;)ly(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 A=g.children.indexOf(h);let N=!1,L=[];v.lastIndex=0;let H=v.exec(h.value);for(;H;){const Y=H.index,U={index:H.index,input:H.input,stack:[...y,h]};let D=b(...H,U);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?v.lastIndex=Y+1:(k!==Y&&L.push({type:"text",value:h.value.slice(k,Y)}),Array.isArray(D)?L.push(...D):D&&L.push(D),k=Y+H[0].length,N=!0),!v.global)break;H=v.exec(h.value)}return N?(k<h.value.length&&L.push({type:"text",value:h.value.slice(k)}),g.children.splice(A,1,...L)):L=[h],A+L.length}}function Ik(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([Yk(o[0]),Vk(o[1])])}return l}function Yk(t){return typeof t=="string"?new RegExp($k(t),"g"):t}function Vk(t){return typeof t=="function"?t:function(){return t}}const Qf="phrasing",Kf=["autolink","link","image","label"];function Xk(){return{transforms:[Pk],enter:{literalAutolink:Qk,literalAutolinkEmail:Zf,literalAutolinkHttp:Zf,literalAutolinkWww:Zf},exit:{literalAutolink:Wk,literalAutolinkEmail:Jk,literalAutolinkHttp:Kk,literalAutolinkWww:Zk}}}function Gk(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Qf,notInConstruct:Kf},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Qf,notInConstruct:Kf},{character:":",before:"[ps]",after:"\\/",inConstruct:Qf,notInConstruct:Kf}]}}function Qk(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Zf(t){this.config.enter.autolinkProtocol.call(this,t)}function Kk(t){this.config.exit.autolinkProtocol.call(this,t)}function Zk(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 Jk(t){this.config.exit.autolinkEmail.call(this,t)}function Wk(t){this.exit(t)}function Pk(t){qk(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,e4],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),t4]],{ignore:["link","linkReference"]})}function e4(t,l,r,i,o){let u="";if(!iy(o)||(/^w/i.test(l)&&(r=l+r,l="",u="http://"),!n4(r)))return!1;const f=l4(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 t4(t,l,r,i){return!iy(i,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+l+"@"+r,children:[{type:"text",value:l+"@"+r}]}}function n4(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 l4(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 iy(t,l){const r=t.input.charCodeAt(t.index-1);return(t.index===0||ir(r)||dc(r))&&(!l||r!==47)}sy.peek=d4;function a4(){this.buffer()}function r4(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function i4(){this.buffer()}function s4(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function o4(t){const l=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=ul(this.sliceSerialize(t)).toLowerCase(),r.label=l}function c4(t){this.exit(t)}function u4(t){const l=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=ul(this.sliceSerialize(t)).toLowerCase(),r.label=l}function f4(t){this.exit(t)}function d4(){return"["}function sy(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 h4(){return{enter:{gfmFootnoteCallString:a4,gfmFootnoteCall:r4,gfmFootnoteDefinitionLabelString:i4,gfmFootnoteDefinition:s4},exit:{gfmFootnoteCallString:o4,gfmFootnoteCall:c4,gfmFootnoteDefinitionLabelString:u4,gfmFootnoteDefinition:f4}}}function m4(t){let l=!1;return t&&t.firstLineBlank&&(l=!0),{handlers:{footnoteDefinition:r,footnoteReference:sy},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?oy:p4))),h(),x}}function p4(t,l,r){return l===0?t:oy(t,l,r)}function oy(t,l,r){return(r?"":" ")+t}const x4=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];cy.peek=w4;function g4(){return{canContainEols:["delete"],enter:{strikethrough:v4},exit:{strikethrough:b4}}}function y4(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:x4}],handlers:{delete:cy}}}function v4(t){this.enter({type:"delete",children:[]},t)}function b4(t){this.exit(t)}function cy(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 w4(){return"~"}function k4(t){return t.length}function S4(t,l){const r=l||{},i=(r.align||[]).concat(),o=r.stringLength||k4,u=[],f=[],m=[],x=[];let h=0,y=-1;for(;++y<t.length;){const E=[],A=[];let N=-1;for(t[y].length>h&&(h=t[y].length);++N<t[y].length;){const L=j4(t[y][N]);if(r.alignDelimiters!==!1){const H=o(L);A[N]=H,(x[N]===void 0||H>x[N])&&(x[N]=H)}E.push(L)}f[y]=E,m[y]=A}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 A="",N="";E===99?(A=":",N=":"):E===108?A=":":E===114&&(N=":");let L=r.alignDelimiters===!1?1:Math.max(1,x[g]-A.length-N.length);const H=A+"-".repeat(L)+N;r.alignDelimiters!==!1&&(L=A.length+L+N.length,L>x[g]&&(x[g]=L),b[g]=L),v[g]=H}f.splice(1,0,v),m.splice(1,0,b),y=-1;const k=[];for(;++y<f.length;){const E=f[y],A=m[y];g=-1;const N=[];for(;++g<h;){const L=E[g]||"";let H="",Y="";if(r.alignDelimiters!==!1){const U=x[g]-(A[g]||0),D=u[g];D===114?H=" ".repeat(U):D===99?U%2?(H=" ".repeat(U/2+.5),Y=" ".repeat(U/2-.5)):(H=" ".repeat(U/2),Y=H):Y=" ".repeat(U)}r.delimiterStart!==!1&&!g&&N.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&L==="")&&(r.delimiterStart!==!1||g)&&N.push(" "),r.alignDelimiters!==!1&&N.push(H),N.push(L),r.alignDelimiters!==!1&&N.push(Y),r.padding!==!1&&N.push(" "),(r.delimiterEnd!==!1||g!==h-1)&&N.push("|")}k.push(r.delimiterEnd===!1?N.join("").replace(/ +$/,""):N.join(""))}return k.join(`
|
|
65
|
-
`)}function j4(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 E4(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()),C4);return o(),f}function C4(t,l,r){return">"+(r?"":" ")+t}function N4(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
|
-
`&&N4(r.stack,r.unsafe[o]))return/[ \t]/.test(i.before)?"":" ";return`\\
|
|
67
|
-
`}function A4(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 T4(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 D4(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 z4(t,l,r,i){const o=D4(r),u=t.value||"",f=o==="`"?"GraveAccent":"Tilde";if(T4(t,r)){const g=r.enter("codeIndented"),v=r.indentLines(u,M4);return g(),v}const m=r.createTracker(i),x=o.repeat(Math.max(A4(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 M4(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 R4(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 fs(t){return"&#x"+t.toString(16).toUpperCase()+";"}function sc(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}}uy.peek=O4;function uy(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=sc(i.before.charCodeAt(i.before.length-1),h,o);y.inside&&(x=fs(h)+x.slice(1));const g=x.charCodeAt(x.length-1),v=sc(i.after.charCodeAt(0),g,o);v.inside&&(x=x.slice(0,-1)+fs(g));const b=f.move(o);return u(),r.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},m+x+b}function O4(t,l,r){return r.options.emphasis||"*"}function B4(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 L4(t,l,r,i){const o=Math.max(Math.min(6,t.depth||1),1),u=r.createTracker(i);if(B4(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=fs(h.charCodeAt(0))+h.slice(1)),h=h?f+" "+h:f,r.options.closeAtx&&(h+=" "+f),x(),m(),h}fy.peek=F4;function fy(t){return t.value||""}function F4(){return"<"}dy.peek=U4;function dy(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 U4(){return"!"}hy.peek=H4;function hy(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 H4(){return"!"}my.peek=$4;function my(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 $4(){return"`"}function py(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))}xy.peek=q4;function xy(t,l,r,i){const o=Zd(r),u=o==='"'?"Quote":"Apostrophe",f=r.createTracker(i);let m,x;if(py(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 q4(t,l,r){return py(t,r)?"<":"["}gy.peek=I4;function gy(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 I4(){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 Y4(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 V4(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 yy(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 X4(t,l,r,i){const o=r.enter("list"),u=r.bulletCurrent;let f=t.ordered?V4(r):Jd(r);const m=t.ordered?f==="."?")":".":Y4(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),yy(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 G4(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 Q4(t,l,r,i){const o=G4(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 K4(t,l,r,i){const o=r.enter("paragraph"),u=r.enter("phrasing"),f=r.containerPhrasing(t,i);return u(),o(),f}const Z4=pc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function J4(t,l,r,i){return(t.children.some(function(f){return Z4(f)})?r.containerPhrasing:r.containerFlow).call(r,t,i)}function W4(t){const l=t.options.strong||"*";if(l!=="*"&&l!=="_")throw new Error("Cannot serialize strong with `"+l+"` for `options.strong`, expected `*`, or `_`");return l}vy.peek=P4;function vy(t,l,r,i){const o=W4(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=sc(i.before.charCodeAt(i.before.length-1),h,o);y.inside&&(x=fs(h)+x.slice(1));const g=x.charCodeAt(x.length-1),v=sc(i.after.charCodeAt(0),g,o);v.inside&&(x=x.slice(0,-1)+fs(g));const b=f.move(o+o);return u(),r.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},m+x+b}function P4(t,l,r){return r.options.strong||"*"}function eS(t,l,r,i){return r.safe(t.value,i)}function tS(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 nS(t,l,r){const i=(yy(r)+(r.options.ruleSpaces?" ":"")).repeat(tS(r));return r.options.ruleSpaces?i.slice(0,-1):i}const by={blockquote:E4,break:Ug,code:z4,definition:R4,emphasis:uy,hardBreak:Ug,heading:L4,html:fy,image:dy,imageReference:hy,inlineCode:my,link:xy,linkReference:gy,list:X4,listItem:Q4,paragraph:K4,root:J4,strong:vy,text:eS,thematicBreak:nS};function lS(){return{enter:{table:aS,tableData:Hg,tableHeader:Hg,tableRow:iS},exit:{codeText:sS,table:rS,tableData:Jf,tableHeader:Jf,tableRow:Jf}}}function aS(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 rS(t){this.exit(t),this.data.inTable=void 0}function iS(t){this.enter({type:"tableRow",children:[]},t)}function Jf(t){this.exit(t)}function Hg(t){this.enter({type:"tableCell",children:[]},t)}function sS(t){let l=this.resume();this.data.inTable&&(l=l.replace(/\\([\\|])/g,oS));const r=this.stack[this.stack.length-1];r.type,r.value=l,this.exit(t)}function oS(t,l){return l==="|"?l:t}function cS(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,A){return h(y(b,E,A),b.align)}function m(b,k,E,A){const N=g(b,E,A),L=h([N]);return L.slice(0,L.indexOf(`
|
|
78
|
-
`))}function x(b,k,E,A){const N=E.enter("tableCell"),L=E.enter("phrasing"),H=E.containerPhrasing(b,{...A,before:u,after:u});return L(),N(),H}function h(b,k){return S4(b,{align:k,alignDelimiters:i,padding:r,stringLength:o})}function y(b,k,E){const A=b.children;let N=-1;const L=[],H=k.enter("table");for(;++N<A.length;)L[N]=g(A[N],k,E);return H(),L}function g(b,k,E){const A=b.children;let N=-1;const L=[],H=k.enter("tableRow");for(;++N<A.length;)L[N]=x(A[N],b,k,E);return H(),L}function v(b,k,E){let A=by.inlineCode(b,k,E);return E.stack.includes("tableCell")&&(A=A.replace(/\|/g,"\\$&")),A}}function uS(){return{exit:{taskListCheckValueChecked:$g,taskListCheckValueUnchecked:$g,paragraph:dS}}}function fS(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:hS}}}function $g(t){const l=this.stack[this.stack.length-2];l.type,l.checked=t.type==="taskListCheckValueChecked"}function dS(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 hS(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=by.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 mS(){return[Xk(),h4(),g4(),lS(),uS()]}function pS(t){return{extensions:[Gk(),m4(t),y4(),cS(t),fS()]}}const xS={tokenize:kS,partial:!0},wy={tokenize:SS,partial:!0},ky={tokenize:jS,partial:!0},Sy={tokenize:ES,partial:!0},gS={tokenize:CS,partial:!0},jy={name:"wwwAutolink",tokenize:bS,previous:Cy},Ey={name:"protocolAutolink",tokenize:wS,previous:Ny},Il={name:"emailAutolink",tokenize:vS,previous:Ay},wl={};function yS(){return{text:wl}}let tr=48;for(;tr<123;)wl[tr]=Il,tr++,tr===58?tr=65:tr===91&&(tr=97);wl[43]=Il;wl[45]=Il;wl[46]=Il;wl[95]=Il;wl[72]=[Il,Ey];wl[104]=[Il,Ey];wl[87]=[Il,jy];wl[119]=[Il,jy];function vS(t,l,r){const i=this;let o,u;return f;function f(g){return!Ed(g)||!Ay.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(gS,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&&bn(i.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),l(g)):r(g)}}function bS(t,l,r){const i=this;return o;function o(f){return f!==87&&f!==119||!Cy.call(i,i.previous)||Wd(i.events)?r(f):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(xS,t.attempt(wy,t.attempt(ky,u),r),r)(f))}function u(f){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),l(f)}}function wS(t,l,r){const i=this;let o="",u=!1;return f;function f(g){return(g===72||g===104)&&Ny.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(bn(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||ac(g)||yt(g)||ir(g)||dc(g)?r(g):t.attempt(wy,t.attempt(ky,y),r)(g)}function y(g){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),l(g)}}function kS(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 SS(t,l,r){let i,o,u;return f;function f(h){return h===46||h===95?t.check(Sy,x,m)(h):h===null||yt(h)||ir(h)||h!==45&&dc(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 jS(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(Sy,l,u)(f):f===null||yt(f)||ir(f)?l(f):(t.consume(f),o)}function u(f){return f===41&&i++,t.consume(f),o}}function ES(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||yt(m)||ir(m)?l(m):r(m)}function o(m){return m===null||m===40||m===91||yt(m)||ir(m)?l(m):i(m)}function u(m){return bn(m)?f(m):r(m)}function f(m){return m===59?(t.consume(m),i):bn(m)?(t.consume(m),f):r(m)}}function CS(t,l,r){return i;function i(u){return t.consume(u),o}function o(u){return mn(u)?r(u):l(u)}}function Cy(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||yt(t)}function Ny(t){return!bn(t)}function Ay(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 NS={tokenize:OS,partial:!0};function AS(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:MS,continuation:{tokenize:RS},exit:_S}},text:{91:{name:"gfmFootnoteCall",tokenize:zS},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:TS,resolveTo:DS}}}}function TS(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=ul(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 DS(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 zS(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||yt(g))return r(g);if(g===93){t.exit("chunkString");const v=t.exit("gfmFootnoteCallString");return o.includes(ul(i.sliceSerialize(v)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(g),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),l):r(g)}return yt(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 MS(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||yt(k))return r(k);if(k===93){t.exit("chunkString");const E=t.exit("gfmFootnoteDefinitionLabelString");return u=ul(i.sliceSerialize(E)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(k),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),v}return yt(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),tt(t,b,"gfmFootnoteDefinitionWhitespace")):r(k)}function b(k){return l(k)}}function RS(t,l,r){return t.check(xs,l,t.attempt(NS,l,r))}function _S(t){t.exit("gfmFootnoteDefinition")}function OS(t,l,r){const i=this;return tt(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 BS(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&&Yn(v,v.length,0,hc(b,f.slice(h+1,x),m)),Yn(v,v.length,0,[["exit",g,m],["enter",f[x][1],m],["exit",f[x][1],m],["exit",y,m]]),Yn(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 A=f.exit("strikethroughSequenceTemporary"),N=Zr(k);return A._open=!N||N===2&&!!E,A._close=!E||E===2&&!!N,m(k)}}}class LS{constructor(){this.map=[]}add(l,r,i){FS(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 FS(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 US(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 HS(){return{flow:{null:{name:"table",tokenize:$S,resolveAll:qS}}}}function $S(t,l,r){const i=this;let o=0,u=0,f;return m;function m(T){let F=i.events.length-1;for(;F>-1;){const X=i.events[F][1].type;if(X==="lineEnding"||X==="linePrefix")F--;else break}const R=F>-1?i.events[F][1].type:null,W=R==="tableHead"||R==="tableRow"?D:x;return W===D&&i.parser.lazy[i.now().line]?r(T):W(T)}function x(T){return t.enter("tableHead"),t.enter("tableRow"),h(T)}function h(T){return T===124||(f=!0,u+=1),y(T)}function y(T){return T===null?r(T):De(T)?u>1?(u=0,i.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(T),t.exit("lineEnding"),b):r(T):Ge(T)?tt(t,y,"whitespace")(T):(u+=1,f&&(f=!1,o+=1),T===124?(t.enter("tableCellDivider"),t.consume(T),t.exit("tableCellDivider"),f=!0,y):(t.enter("data"),g(T)))}function g(T){return T===null||T===124||yt(T)?(t.exit("data"),y(T)):(t.consume(T),T===92?v:g)}function v(T){return T===92||T===124?(t.consume(T),g):g(T)}function b(T){return i.interrupt=!1,i.parser.lazy[i.now().line]?r(T):(t.enter("tableDelimiterRow"),f=!1,Ge(T)?tt(t,k,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):k(T))}function k(T){return T===45||T===58?A(T):T===124?(f=!0,t.enter("tableCellDivider"),t.consume(T),t.exit("tableCellDivider"),E):U(T)}function E(T){return Ge(T)?tt(t,A,"whitespace")(T):A(T)}function A(T){return T===58?(u+=1,f=!0,t.enter("tableDelimiterMarker"),t.consume(T),t.exit("tableDelimiterMarker"),N):T===45?(u+=1,N(T)):T===null||De(T)?Y(T):U(T)}function N(T){return T===45?(t.enter("tableDelimiterFiller"),L(T)):U(T)}function L(T){return T===45?(t.consume(T),L):T===58?(f=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(T),t.exit("tableDelimiterMarker"),H):(t.exit("tableDelimiterFiller"),H(T))}function H(T){return Ge(T)?tt(t,Y,"whitespace")(T):Y(T)}function Y(T){return T===124?k(T):T===null||De(T)?!f||o!==u?U(T):(t.exit("tableDelimiterRow"),t.exit("tableHead"),l(T)):U(T)}function U(T){return r(T)}function D(T){return t.enter("tableRow"),V(T)}function V(T){return T===124?(t.enter("tableCellDivider"),t.consume(T),t.exit("tableCellDivider"),V):T===null||De(T)?(t.exit("tableRow"),l(T)):Ge(T)?tt(t,V,"whitespace")(T):(t.enter("data"),q(T))}function q(T){return T===null||T===124||yt(T)?(t.exit("data"),V(T)):(t.consume(T),T===92?te:q)}function te(T){return T===92||T===124?(t.consume(T),q):q(T)}}function qS(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 LS;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=Uo(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=Uo(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=Uo(v,l,u,o,r,g)):f[1]!==0&&(g=Uo(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=US(l.events,r))}return t}function Uo(t,l,r,i,o,u){const f=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",m="tableContent";r[0]!==0&&(u.end=Object.assign({},Vr(l.events,r[0])),t.add(r[0],0,[["exit",u,l]]));const x=Vr(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=Vr(l.events,r[2]),y=Vr(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({},Vr(l.events,o)),t.add(o,0,[["exit",u,l]]),u=void 0),u}function qg(t,l,r,i,o){const u=[],f=Vr(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 Vr(t,l){const r=t[l],i=r[0]==="enter"?"start":"end";return r[1][i]}const IS={name:"tasklistCheck",tokenize:VS};function YS(){return{text:{91:IS}}}function VS(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 yt(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 De(x)?l(x):Ge(x)?t.check({tokenize:XS},l,r)(x):r(x)}}function XS(t,l,r){return tt(t,i,"whitespace");function i(o){return o===null?r(o):l(o)}}function GS(t){return F1([yS(),AS(),BS(t),HS(),YS()])}const QS={};function Ty(t){const l=this,r=t||QS,i=l.data(),o=i.micromarkExtensions||(i.micromarkExtensions=[]),u=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),f=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);o.push(GS(r)),u.push(mS()),f.push(pS(r))}function ys({content:t,className:l=""}){return c.jsx("div",{className:`office-markdown ${l}`,children:c.jsx(ry,{remarkPlugins:[Ty],components:{code:KS,table:({children:r})=>c.jsx("div",{className:"overflow-x-auto my-2",children:c.jsx("table",{className:"office-table",children:r})})},children:t})})}function KS({className:t,children:l,...r}){const i=/language-(\w+)/.exec(t??"");return i||typeof l=="string"&&l.includes(`
|
|
79
|
-
`)?c.jsx(ZS,{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 ZS({children:t,language:l}){const[r,i]=S.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"},JS=/^(darken|lighten)\((\$\w+),\s*(\d+)\)$/;function WS(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 PS(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 Dy(t,l){const r=Ig[t];if(r&&l)return l[r];const i=JS.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"?WS(x,h):PS(x,h)}return t}function e5(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 zy(t,l){Pd.set(t,l)}function gc(t,l){eh.set(t,l)}function Nd(t){return Pd.get(t)}function t5(t){return eh.get(t)}function vC(){return Array.from(Pd.keys())}function bC(){return Array.from(eh.keys())}function n5(t,l,r,i,o=2){t.clearRect(0,0,l.width*o,l.height*o);for(const u of l.layers)Ry(t,u.pixels,o,r,i)}function My(t,l,r,i,o){for(const u of l){const f=Dy(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 l5(t,l){const r=l.scale;t.clearRect(0,0,l.canvasWidth,l.canvasHeight),Ry(t,l.pixels,r,0)}function Ry(t,l,r,i,o){for(const u of l){const f=Dy(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 a5(t){return th.get(t)}function _y(){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 r5(t){return nh.get(t)}function Oy(){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 Vn(t,l,r){lh.set(t,{id:t,name:l,layer:{...r,name:"accessory"}})}function i5(t){return lh.get(t)}function By(){return Array.from(lh.values())}Vn("none","None",{name:"accessory",pixels:[]});Vn("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}]});Vn("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}]});Vn("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}]});Vn("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}]});Vn("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}]});Vn("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}]});Vn("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}]});Vn("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}]});Vn("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}]});Vn("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}]});Vn("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}]});Vn("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 es({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 s5(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 o5(t,l,r=20){if(t.length===0)return[];const i=s5(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 c5(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 u5(t,l=8){const r=c5(t),i=o5(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:es(f),hairColor:es(m),shirtColor:es(x),pantsColor:es(h),shoeColor:es(y)}}const f5=[{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}],d5=[{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"}],h5=[{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"}],m5=[{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 p5(){return{width:12,height:22,layers:[{name:"lower",pixels:f5},{name:"torso",pixels:d5},{name:"head",pixels:h5},{name:"hair",pixels:m5},{name:"accessory",pixels:[]}]}}const x5=["cto","cbo","pm","engineer","designer","qa","data-analyst","default"];for(const t of x5)zy(`mini:${t}`,p5());const g5=[{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"}],y5=[{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"}],v5=[{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 b5(){return{width:12,height:22,layers:[{name:"torso",pixels:g5},{name:"head",pixels:y5},{name:"hair",pixels:v5},{name:"accessory",pixels:[]}]}}zy("mini-seated:default",b5());const w5={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"}]},k5={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"}]},S5={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"}]},j5={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"}]};gc("meeting",w5);gc("bulletin",k5);gc("decision",j5);gc("knowledge",S5);const Wf=16,Pf=24,E5=60,C5={cbo:0,cto:8,pm:15,engineer:22,designer:5,qa:12};function Ly(t,l){if(!t)return t;let r=t;if(l!=null&&l.hairStyle){const i=a5(l.hairStyle);i&&(r=e5(r,i.layer))}if(l!=null&&l.outfitStyle){const i=r5(l.outfitStyle);i&&(r=Cd(r,"torso",i.layer,1))}if(l!=null&&l.accessory&&l.accessory!=="none"){const i=i5(l.accessory);i&&(r=Cd(r,"accessory",i.layer))}return r}function yc({roleId:t,className:l,appearance:r,scale:i}){const o=S.useRef(null),u=S.useRef(0),f=S.useRef(0),m=S.useRef(r);m.current=r;const x=i??4,h=Wf*x,y=Pf*x,g=S.useMemo(()=>{const v=Nd(`mini:${t}`)??Nd("mini:default");return Ly(v,r)},[t,r==null?void 0:r.hairStyle,r==null?void 0:r.outfitStyle,r==null?void 0:r.accessory]);return S.useEffect(()=>{const v=o.current;if(!v)return;const b=v.getContext("2d");if(!b)return;const k=C5[t]??0,E=()=>{f.current++;const A=m.current;if(!A||!g){u.current=requestAnimationFrame(E);return}const L=(f.current+k)%E5<30?1:0;b.clearRect(0,0,Wf,Pf),b.save(),b.translate(2,1),n5(b,g,L,A,1),b.restore(),u.current=requestAnimationFrame(E)};return u.current=requestAnimationFrame(E),()=>cancelAnimationFrame(u.current)},[t,g]),c.jsx("canvas",{ref:o,width:Wf,height:Pf,className:l,style:{imageRendering:"pixelated",display:"block",width:h,height:y}})}const N5={cto:"🏗️",cbo:"📊",pm:"📋",engineer:"⚙️",designer:"🎨",qa:"🔍"},ed={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C"},A5={cto:8,cbo:7,pm:6,engineer:5,designer:5,qa:4,"data-analyst":4},T5={cto:"Chief Technology Officer",cbo:"Chief Business Officer",pm:"Product Manager",engineer:"Software Engineer",designer:"UI/UX Designer",qa:"QA Engineer"},D5=500,Xg=360,Gg=700,z5=t=>`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`;function M5({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:A,onUpdateRole:N,appearance:L,relationships:H}){var me,Ee;const[Y,U]=S.useState(D5),[D,V]=S.useState(!1),q=S.useRef(0),te=S.useRef(0),[T,F]=S.useState(!1),[R,W]=S.useState(!1),[X,G]=S.useState(!1),[M,Q]=S.useState(!1),[ne,pe]=S.useState("talk"),[z,_]=S.useState(!1),[ee,C]=S.useState(""),[fe,ve]=S.useState(!1),ye=S.useRef(null),{events:ke,status:He}=S1(f??null),[de,qe]=S.useState(0);S.useEffect(()=>{if(!x||!h){qe(0);return}const ie=new Date(h).getTime(),xe=()=>qe(Math.floor((Date.now()-ie)/1e3));xe();const rt=setInterval(xe,1e3);return()=>clearInterval(rt)},[x,h]);const Tt=u>0,vt=Tt?u:0,Rn=Tt?Math.max(Xg,window.innerWidth-u-100):Gg,ut=Math.min(Y,Rn),cn=S.useCallback(ie=>{ie.preventDefault(),q.current=ie.clientX,te.current=ut,V(!0);const xe=nt=>{const Be=q.current-nt.clientX,ue=Math.min(Gg,Math.max(Xg,te.current+Be));U(ue)},rt=()=>{V(!1),document.removeEventListener("mousemove",xe),document.removeEventListener("mouseup",rt)};document.addEventListener("mousemove",xe),document.addEventListener("mouseup",rt)},[ut]),xn=S.useRef(null),St=t?g.find(ie=>ie.roleId===t.id):null,Dt=ie=>{if(!t)return;const xe=x?"talk":ne;St?(k(St.id,ie,xe),E(t.id)):(xn.current={content:ie,mode:xe},b(t.id))};S.useEffect(()=>{if(St&&xn.current){const{content:ie,mode:xe}=xn.current;xn.current=null,k(St.id,ie,xe),t&&E(t.id)}},[St==null?void 0:St.id]);const zt=(()=>{if(!ke.length)return null;const ie=[];let xe=0,rt=0,nt=0;for(const Be of ke)if(Be.type==="thinking")xe++;else if(Be.type==="text")rt++;else if(Be.type==="tool:start"){const ue=String(Be.data.name??"");ie.includes(ue)||ie.push(ue)}else Be.type==="dispatch:start"&&nt++;return{tools:ie,thinkCount:xe,textCount:rt,dispatchCount:nt,total:ke.length}})(),un=m||(()=>{if(!St)return null;const ie=St.messages;for(let xe=ie.length-1;xe>=0;xe--)if(ie[xe].from==="ceo")return ie[xe].content;return null})(),ft=(()=>{if(!St)return null;const ie=St.messages;for(let xe=ie.length-1;xe>=0;xe--)if(ie[xe].from==="role"&&ie[xe].content)return ie[xe].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:vt},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:vt,width:ut,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 Pt=ed[t.id]??"#666",Xn=N5[t.id]??"👤",Mt=l.filter(ie=>ie.reportsTo===t.id),Sn=St&&v===St.id,ae=t.name||T5[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:vt},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)] ${D?"resizing":""}`,style:{borderLeftColor:Pt,right:vt,width:ut,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 ${D?"bg-white/10":"hover:bg-white/5"}`,onMouseDown:cn}),c.jsxs("div",{className:"relative shrink-0 overflow-hidden",style:{background:`linear-gradient(135deg, ${Pt}ee, ${Pt}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:[A&&c.jsx("button",{onClick:()=>A(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(yc,{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:[Xn," ",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"})]}),z?c.jsxs("form",{className:"flex items-center gap-1.5 mt-0.5",onSubmit:async ie=>{ie.preventDefault();const xe=ee.trim();if(!xe||xe===ae||!N){_(!1);return}ve(!0);try{await N(t.id,{name:xe})}catch{}ve(!1),_(!1)},children:[c.jsx("input",{ref:ye,value:ee,onChange:ie=>C(ie.target.value),onKeyDown:ie=>{ie.key==="Escape"&&_(!1)},disabled:fe,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:fe,className:"text-white/80 hover:text-white text-[10px] cursor-pointer shrink-0",children:"✓"}),c.jsx("button",{type:"button",onClick:()=>_(!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:()=>{N&&(C(ae),_(!0))},title:N?"Click to edit name":void 0,children:[ae,N&&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.",A5[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",de>0?` · ${z5(de)}`:""]})]}),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"})]})]}),un&&c.jsx("div",{className:"text-xs truncate",style:{color:"var(--terminal-text-secondary)"},children:un})]}),x&&f&&zt&&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:[zt.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 ×",zt.thinkCount]}),zt.tools.map(ie=>c.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px]",style:{background:"rgba(59,130,246,0.15)",color:"#60a5fa"},children:ie},ie)),zt.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 ×",zt.dispatchCount]}),zt.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 ×",zt.textCount]}),(He==="streaming"||He==="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:[zt.total," events"]})]}),x&&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:"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:[ft.slice(0,200),ft.length>200&&"..."]})]}),x&&c.jsx("div",{className:"px-4 py-2.5 shrink-0",style:{borderBottom:"1px solid var(--terminal-border)"},children:c.jsx(Qg,{onSend:Dt,disabled:!!Sn,placeholder:"Ask something...",color:Pt})}),!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(R5,{icon:Xn,roleId:t.id,roleName:ae,color:Pt,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:[ft&&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:[ft.slice(0,150),ft.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:()=>pe("talk"),className:"px-2 py-1 text-[10px] font-semibold cursor-pointer transition-colors",style:{background:ne==="talk"?"var(--accent)":"transparent",color:ne==="talk"?"#fff":"var(--terminal-text-secondary)"},children:"Talk"}),c.jsx("button",{onClick:()=>pe("do"),className:"px-2 py-1 text-[10px] font-semibold cursor-pointer transition-colors",style:{background:ne==="do"?"var(--idle-amber)":"transparent",color:ne==="do"?"#fff":"var(--terminal-text-secondary)"},children:"Do"})]}),c.jsx(Qg,{onSend:Dt,disabled:!!Sn,placeholder:ne==="talk"?"Ask something...":"Give a directive...",color:Pt})]})})]})}),c.jsxs("div",{className:"px-4 py-2 space-y-1",children:[c.jsxs(Ho,{title:`Profile${t.persona?"":" (empty)"}`,open:T,onToggle:()=>F(ie=>!ie),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(td,{label:"Level",value:t.level}),c.jsx(td,{label:"Reports to",value:t.reportsTo}),c.jsx(td,{label:"Status",value:t.status})]}),Mt.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:Mt.map(ie=>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:ed[ie.id]??"#666"},children:ie.id.slice(0,2).toUpperCase()}),c.jsx("div",{className:"text-xs",style:{color:"var(--terminal-text)"},children:ie.name})]},ie.id))})]})]}),t.authority&&c.jsxs(Ho,{title:"Authority",open:R,onToggle:()=>W(ie=>!ie),children:[((me=t.authority.autonomous)==null?void 0:me.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((ie,xe)=>c.jsxs("div",{className:"text-xs pl-3 py-0.5",style:{color:"var(--terminal-text-secondary)"},children:["- ",ie]},xe))]}),((Ee=t.authority.needsApproval)==null?void 0:Ee.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((ie,xe)=>c.jsxs("div",{className:"text-xs pl-3 py-0.5",style:{color:"var(--terminal-text-secondary)"},children:["- ",ie]},xe))]})]}),t&&H&&(()=>{const ie=H.filter(xe=>xe.roleA===t.id||xe.roleB===t.id).filter(xe=>xe.familiarity>0).sort((xe,rt)=>rt.familiarity-xe.familiarity);return ie.length===0?null:c.jsx(Ho,{title:`Relationships (${ie.length})`,open:X,onToggle:()=>G(xe=>!xe),children:c.jsx("div",{className:"space-y-1.5",children:ie.map((xe,rt)=>{const nt=xe.roleA===t.id?xe.roleB:xe.roleA,Be=l.find(Ie=>Ie.id===nt),ue=xe.familiarity>=80?"Best Partner":xe.familiarity>=50?"Friend":xe.familiarity>=20?"Colleague":"Acquaintance",Qe=xe.familiarity>=80?"#4CAF50":xe.familiarity>=50?"#2196F3":xe.familiarity>=20?"#FF9800":"#9E9E9E";return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-xs w-20 truncate",style:{color:ed[nt]??"var(--terminal-text-secondary)"},children:(Be==null?void 0:Be.name)??nt}),c.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-white/10",children:c.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${xe.familiarity}%`,background:Qe}})}),c.jsx("span",{className:"text-[10px] w-16 text-right",style:{color:"var(--terminal-text-muted)"},children:ue})]},rt)})})})})(),t.journal&&c.jsx(Ho,{title:`Journal (${(t.journal.match(/### /g)??[]).length})`,open:M,onToggle:()=>Q(ie=>!ie),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(ys,{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 R5({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(ys,{content:o})}):c.jsx("div",{className:"text-sm italic",style:{color:"var(--terminal-text-muted)"},children:"No recent activity."})]})]})})]})})}function Ho({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 Qg({onSend:t,disabled:l,placeholder:r,color:i}){const[o,u]=S.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 td({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 O5(t){const l=+this._x.call(null,t),r=+this._y.call(null,t);return Fy(this.cover(l,r),l,r,t)}function Fy(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,A,N,L;if(!u)return t._root=f,t;for(;u.length;)if((E=l>=(g=(m+h)/2))?m=g:h=g,(A=r>=(v=(x+y)/2))?x=v:y=v,o=u,!(u=u[N=A<<1|E]))return o[N]=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[N]=f:t._root=f,t;do o=o?o[N]=new Array(4):t._root=new Array(4),(E=l>=(g=(m+h)/2))?m=g:h=g,(A=r>=(v=(x+y)/2))?x=v:y=v;while((N=A<<1|E)===(L=(k>=v)<<1|b>=g));return o[L]=u,o[N]=f,t}function B5(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)Fy(this,f[r],m[r],t[r]);return this}function L5(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 F5(){var t=[];return this.visit(function(l){if(!l.length)do t.push(l.data);while(l=l.next)}),t}function U5(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 wn(t,l,r,i,o){this.node=t,this.x0=l,this.y0=r,this.x1=i,this.y1=o}function H5(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 wn(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 A=(f+x)/2,N=(m+h)/2;v.push(new wn(b[3],A,N,x,h),new wn(b[2],f,N,A,h),new wn(b[1],A,m,x,N),new wn(b[0],f,m,A,N)),(E=(l>=N)<<1|t>=A)&&(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),H=l-+this._y.call(null,b.data),Y=L*L+H*H;if(Y<r){var U=Math.sqrt(r=Y);o=t-U,u=l-U,y=t+U,g=l+U,i=b.data}}return i}function $5(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,A,N;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[A=E<<1|k]))return this;if(!r.length)break;(l[A+1&3]||l[A+2&3]||l[A+3&3])&&(i=l,N=A)}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[A]=u:delete l[A],(r=l[0]||l[1]||l[2]||l[3])&&r===(l[3]||l[2]||l[1]||l[0])&&!r.length&&(i?i[N]=r:this._root=r),this):(this._root=u,this)}function q5(t){for(var l=0,r=t.length;l<r;++l)this.remove(t[l]);return this}function I5(){return this._root}function Y5(){var t=0;return this.visit(function(l){if(!l.length)do++t;while(l=l.next)}),t}function V5(t){var l=[],r,i=this._root,o,u,f,m,x;for(i&&l.push(new wn(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 wn(o,h,y,m,x)),(o=i[2])&&l.push(new wn(o,u,y,h,x)),(o=i[1])&&l.push(new wn(o,h,f,m,y)),(o=i[0])&&l.push(new wn(o,u,f,h,y))}return this}function X5(t){var l=[],r=[],i;for(this._root&&l.push(new wn(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 wn(u,f,m,y,g)),(u=o[1])&&l.push(new wn(u,y,m,x,g)),(u=o[2])&&l.push(new wn(u,f,g,y,h)),(u=o[3])&&l.push(new wn(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 G5(t){return t[0]}function Q5(t){return arguments.length?(this._x=t,this):this._x}function K5(t){return t[1]}function Z5(t){return arguments.length?(this._y=t,this):this._y}function ah(t,l,r){var i=new rh(l??G5,r??K5,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 Kg(t){for(var l={data:t.data},r=l;t=t.next;)r=r.next={data:t.data};return l}var kn=ah.prototype=rh.prototype;kn.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=Kg(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]=Kg(i));return t};kn.add=O5;kn.addAll=B5;kn.cover=L5;kn.data=F5;kn.extent=U5;kn.find=H5;kn.remove=$5;kn.removeAll=q5;kn.root=I5;kn.size=Y5;kn.visit=V5;kn.visitAfter=X5;kn.x=Q5;kn.y=Z5;function rr(t){return function(){return t}}function Ca(t){return(t()-.5)*1e-6}function J5(t){return t.x+t.vx}function W5(t){return t.y+t.vy}function P5(t){var l,r,i,o=1,u=1;typeof t!="function"&&(t=rr(t==null?1:+t));function f(){for(var h,y=l.length,g,v,b,k,E,A,N=0;N<u;++N)for(g=ah(l,J5,W5).visitAfter(m),h=0;h<y;++h)v=l[h],E=r[v.index],A=E*E,b=v.x+v.vx,k=v.y+v.vy,g.visit(L);function L(H,Y,U,D,V){var q=H.data,te=H.r,T=E+te;if(q){if(q.index>v.index){var F=b-q.x-q.vx,R=k-q.y-q.vy,W=F*F+R*R;W<T*T&&(F===0&&(F=Ca(i),W+=F*F),R===0&&(R=Ca(i),W+=R*R),W=(T-(W=Math.sqrt(W)))/W*o,v.vx+=(F*=W)*(T=(te*=te)/(A+te)),v.vy+=(R*=W)*T,q.vx-=F*(T=1-T),q.vy-=R*T)}return}return Y>b+T||D<b-T||U>k+T||V<k-T}}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:rr(+h),x(),f):t},f}function ej(t){return t.index}function Zg(t,l){var r=t.get(l);if(!r)throw new Error("node not found: "+l);return r}function tj(t){var l=ej,r=g,i,o=rr(30),u,f,m,x,h,y=1;t==null&&(t=[]);function g(A){return 1/Math.min(m[A.source.index],m[A.target.index])}function v(A){for(var N=0,L=t.length;N<y;++N)for(var H=0,Y,U,D,V,q,te,T;H<L;++H)Y=t[H],U=Y.source,D=Y.target,V=D.x+D.vx-U.x-U.vx||Ca(h),q=D.y+D.vy-U.y-U.vy||Ca(h),te=Math.sqrt(V*V+q*q),te=(te-u[H])/te*A*i[H],V*=te,q*=te,D.vx-=V*(T=x[H]),D.vy-=q*T,U.vx+=V*(T=1-T),U.vy+=q*T}function b(){if(f){var A,N=f.length,L=t.length,H=new Map(f.map((U,D)=>[l(U,D,f),U])),Y;for(A=0,m=new Array(N);A<L;++A)Y=t[A],Y.index=A,typeof Y.source!="object"&&(Y.source=Zg(H,Y.source)),typeof Y.target!="object"&&(Y.target=Zg(H,Y.target)),m[Y.source.index]=(m[Y.source.index]||0)+1,m[Y.target.index]=(m[Y.target.index]||0)+1;for(A=0,x=new Array(L);A<L;++A)Y=t[A],x[A]=m[Y.source.index]/(m[Y.source.index]+m[Y.target.index]);i=new Array(L),k(),u=new Array(L),E()}}function k(){if(f)for(var A=0,N=t.length;A<N;++A)i[A]=+r(t[A],A,t)}function E(){if(f)for(var A=0,N=t.length;A<N;++A)u[A]=+o(t[A],A,t)}return v.initialize=function(A,N){f=A,h=N,b()},v.links=function(A){return arguments.length?(t=A,b(),v):t},v.id=function(A){return arguments.length?(l=A,v):l},v.iterations=function(A){return arguments.length?(y=+A,v):y},v.strength=function(A){return arguments.length?(r=typeof A=="function"?A:rr(+A),k(),v):r},v.distance=function(A){return arguments.length?(o=typeof A=="function"?A:rr(+A),E(),v):o},v}var nj={value:()=>{}};function Uy(){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 lj(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=Uy.prototype={constructor:ec,on:function(t,l){var r=this._,i=lj(t+"",r),o,u=-1,f=i.length;if(arguments.length<2){for(;++u<f;)if((o=(t=i[u]).type)&&(o=aj(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]=Jg(r[o],t.name,l);else if(l==null)for(o in r)r[o]=Jg(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 aj(t,l){for(var r=0,i=t.length,o;r<i;++r)if((o=t[r]).name===l)return o.value}function Jg(t,l,r){for(var i=0,o=t.length;i<o;++i)if(t[i].name===l){t[i]=nj,t=t.slice(0,i).concat(t.slice(i+1));break}return r!=null&&t.push({name:l,value:r}),t}var Jr=0,as=0,ts=0,Hy=1e3,oc,rs,cc=0,sr=0,vc=0,ds=typeof performance=="object"&&performance.now?performance:Date,$y=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function qy(){return sr||($y(rj),sr=ds.now()+vc)}function rj(){sr=0}function Ad(){this._call=this._time=this._next=null}Ad.prototype=Iy.prototype={constructor:Ad,restart:function(t,l,r){if(typeof t!="function")throw new TypeError("callback is not a function");r=(r==null?qy():+r)+(l==null?0:+l),!this._next&&rs!==this&&(rs?rs._next=this:oc=this,rs=this),this._call=t,this._time=r,Td()},stop:function(){this._call&&(this._call=null,this._time=1/0,Td())}};function Iy(t,l,r){var i=new Ad;return i.restart(t,l,r),i}function ij(){qy(),++Jr;for(var t=oc,l;t;)(l=sr-t._time)>=0&&t._call.call(void 0,l),t=t._next;--Jr}function Wg(){sr=(cc=ds.now())+vc,Jr=as=0;try{ij()}finally{Jr=0,oj(),sr=0}}function sj(){var t=ds.now(),l=t-cc;l>Hy&&(vc-=l,cc=t)}function oj(){for(var t,l=oc,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:oc=r);rs=t,Td(i)}function Td(t){if(!Jr){as&&(as=clearTimeout(as));var l=t-sr;l>24?(t<1/0&&(as=setTimeout(Wg,t-ds.now()-vc)),ts&&(ts=clearInterval(ts))):(ts||(cc=ds.now(),ts=setInterval(sj,Hy)),Jr=1,$y(Wg))}}const cj=1664525,uj=1013904223,Pg=4294967296;function fj(){let t=1;return()=>(t=(cj*t+uj)%Pg)/Pg}function dj(t){return t.x}function hj(t){return t.y}var mj=10,pj=Math.PI*(3-Math.sqrt(5));function xj(t){var l,r=1,i=.001,o=1-Math.pow(i,1/300),u=0,f=.6,m=new Map,x=Iy(g),h=Uy("tick","end"),y=fj();t==null&&(t=[]);function g(){v(),h.call("tick",l),r<i&&(x.stop(),h.call("end",l))}function v(E){var A,N=t.length,L;E===void 0&&(E=1);for(var H=0;H<E;++H)for(r+=(u-r)*o,m.forEach(function(Y){Y(r)}),A=0;A<N;++A)L=t[A],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,A=t.length,N;E<A;++E){if(N=t[E],N.index=E,N.fx!=null&&(N.x=N.fx),N.fy!=null&&(N.y=N.fy),isNaN(N.x)||isNaN(N.y)){var L=mj*Math.sqrt(.5+E),H=E*pj;N.x=L*Math.cos(H),N.y=L*Math.sin(H)}(isNaN(N.vx)||isNaN(N.vy))&&(N.vx=N.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,A){return arguments.length>1?(A==null?m.delete(E):m.set(E,k(A)),l):m.get(E)},find:function(E,A,N){var L=0,H=t.length,Y,U,D,V,q;for(N==null?N=1/0:N*=N,L=0;L<H;++L)V=t[L],Y=E-V.x,U=A-V.y,D=Y*Y+U*U,D<N&&(q=V,N=D);return q},on:function(E,A){return arguments.length>1?(h.on(E,A),l):h.on(E)}}}function gj(){var t,l,r,i,o=rr(-30),u,f=1,m=1/0,x=.81;function h(b){var k,E=t.length,A=ah(t,dj,hj).visitAfter(g);for(i=b,k=0;k<E;++k)l=t[k],A.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,A,N=0,L,H,Y;if(b.length){for(L=H=Y=0;Y<4;++Y)(E=b[Y])&&(A=Math.abs(E.value))&&(k+=E.value,N+=A,L+=A*E.x,H+=A*E.y);b.x=L/N,b.y=H/N}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,A){if(!b.value)return!0;var N=b.x-l.x,L=b.y-l.y,H=A-k,Y=N*N+L*L;if(H*H/x<Y)return Y<m&&(N===0&&(N=Ca(r),Y+=N*N),L===0&&(L=Ca(r),Y+=L*L),Y<f&&(Y=Math.sqrt(f*Y)),l.vx+=N*b.value*i/Y,l.vy+=L*b.value*i/Y),!0;if(b.length||Y>=m)return;(b.data!==l||b.next)&&(N===0&&(N=Ca(r),Y+=N*N),L===0&&(L=Ca(r),Y+=L*L),Y<f&&(Y=Math.sqrt(f*Y)));do b.data!==l&&(H=u[b.data.index]*i/Y,l.vx+=N*H,l.vy+=L*H);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:rr(+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 hs={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 yj(t){return hs[t]??hs.general}function vj({docs:t,onNodeClick:l,selectedDocId:r}){var F;const i=S.useRef(null),o=S.useRef(null),[u,f]=S.useState({width:600,height:400}),[m,x]=S.useState({nodes:[],links:[]}),[h,y]=S.useState(null),[g,v]=S.useState(null),[b,k]=S.useState({x:0,y:0}),[E,A]=S.useState({x:0,y:0,w:600,h:400}),N=S.useRef(!1),L=S.useRef({x:0,y:0,vx:0,vy:0}),H=S.useRef(null),Y=S.useRef(null);S.useEffect(()=>{const R=i.current;if(!R)return;const W=new ResizeObserver(X=>{const{width:G,height:M}=X[0].contentRect;G>0&&M>0&&(f({width:G,height:M}),A(Q=>({...Q,w:G,h:M})))});return W.observe(R),()=>W.disconnect()},[]),S.useEffect(()=>{if(t.length===0)return;const R=new Set(t.map(ne=>ne.id)),W=t.map(ne=>({id:ne.id,title:ne.title,category:ne.category,akb_type:ne.akb_type})),X=[];for(const ne of t)for(const pe of ne.links){const z=pe.href.replace(/^.*knowledge\//,"").replace(/^\.\.\/.*$/,"").replace(/^\.\//,"");R.has(z)&&z!==ne.id&&(X.some(_=>_.source===ne.id&&_.target===z||_.source===z&&_.target===ne.id)||X.push({source:ne.id,target:z,label:pe.text}))}const{width:G,height:M}=u,Q=xj(W).force("link",tj(X).id(ne=>ne.id).distance(140)).force("charge",gj().strength(-400)).force("center",_5(G/2,M/2)).force("collide",P5(50));Y.current=Q,Q.on("tick",()=>{for(const ne of W)ne.x=Math.max(60,Math.min(G-60,ne.x??G/2)),ne.y=Math.max(60,Math.min(M-60,ne.y??M/2));x({nodes:[...W],links:[...X]})}),Q.alpha(1).restart();for(let ne=0;ne<150;ne++)Q.tick();return Q.stop(),x({nodes:[...W],links:[...X]}),()=>{Q.stop()}},[t,u]);const U=R=>{if(typeof R=="string"){const W=m.nodes.find(X=>X.id===R);return{x:(W==null?void 0:W.x)??0,y:(W==null?void 0:W.y)??0}}return{x:R.x??0,y:R.y??0}},D=S.useCallback(R=>{R.preventDefault();const W=R.deltaY>0?1.1:.9;A(X=>{const G=Math.max(200,Math.min(u.width*3,X.w*W)),M=Math.max(150,Math.min(u.height*3,X.h*W)),Q=(G-X.w)/2,ne=(M-X.h)/2;return{x:X.x-Q,y:X.y-ne,w:G,h:M}})},[u]),V=S.useCallback(R=>{R.button===0&&(N.current=!0,L.current={x:R.clientX,y:R.clientY,vx:E.x,vy:E.y})},[E]),q=S.useCallback(R=>{var W;if(H.current){const X=o.current;if(!X)return;const G=X.getBoundingClientRect(),M=E.w/G.width,Q=E.h/G.height,ne=E.x+(R.clientX-G.left)*M,pe=E.y+(R.clientY-G.top)*Q;H.current.fx=ne,H.current.fy=pe,(W=Y.current)==null||W.alpha(.3).restart();return}if(N.current){const X=(R.clientX-L.current.x)*(E.w/u.width),G=(R.clientY-L.current.y)*(E.h/u.height);A(M=>({...M,x:L.current.vx-X,y:L.current.vy-G}))}},[E,u]),te=S.useCallback(()=>{N.current=!1,H.current&&(H.current.fx=null,H.current.fy=null,H.current=null)},[]),T=S.useCallback((R,W)=>{var X;R.stopPropagation(),H.current=W,(X=Y.current)==null||X.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:N.current?"grabbing":"grab"},onWheel:D,onMouseDown:V,onMouseMove:q,onMouseUp:te,onMouseLeave:te,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((R,W)=>{const X=U(R.source),G=U(R.target),M=g===W,Q=(X.x+G.x)/2,ne=(X.y+G.y)/2;return c.jsxs("g",{children:[c.jsx("line",{x1:X.x,y1:X.y,x2:G.x,y2:G.y,stroke:"transparent",strokeWidth:12,style:{cursor:"default"},onMouseEnter:()=>v(W),onMouseLeave:()=>v(null)}),c.jsx("line",{x1:X.x,y1:X.y,x2:G.x,y2:G.y,stroke:M?"rgba(148,163,184,0.7)":"rgba(148,163,184,0.3)",strokeWidth:M?2:1.5,strokeDasharray:"4 3",pointerEvents:"none"}),M&&R.label&&c.jsx("text",{x:Q,y:ne-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:R.label.length>30?R.label.slice(0,28)+"..":R.label})})]},W)}),m.nodes.map(R=>{const W=hs[R.category]??hs.general,X=R.akb_type==="hub",G=X?24:16,M=(h==null?void 0:h.id)===R.id,Q=r===R.id,ne=M?1.2:Q?1.15:1;return c.jsxs("g",{transform:`translate(${R.x??0}, ${R.y??0}) scale(${ne})`,style:{cursor:"pointer",transition:"transform 0.15s ease"},onClick:pe=>{pe.stopPropagation();const z=t.find(_=>_.id===R.id);z&&l(z)},onMouseDown:pe=>T(pe,R),onMouseEnter:pe=>{var _;y(R);const z=(_=i.current)==null?void 0:_.getBoundingClientRect();z&&k({x:pe.clientX-z.left,y:pe.clientY-z.top})},onMouseLeave:()=>y(null),children:[Q&&c.jsx("rect",{x:-G/2-4,y:-G/2-4,width:G+8,height:G+8,fill:"none",stroke:"#22c55e",strokeWidth:2,rx:X?5:2,opacity:.6}),c.jsx("rect",{x:-G/2,y:-G/2,width:G,height:G,fill:W.border,rx:X?4:2,opacity:M?1:.9}),c.jsx("rect",{x:-G/2+3,y:-G/2+3,width:Math.max(0,G-6),height:Math.max(0,G-6),fill:W.bg,rx:X?3:1}),c.jsx("text",{y:G/2+14,textAnchor:"middle",fill:Q?"#e2e8f0":"#94a3b8",fontSize:11,fontFamily:"monospace",fontWeight:Q?"bold":"normal",style:{pointerEvents:"none"},children:R.title.length>24?R.title.slice(0,22)+"..":R.title})]},R.id)})]}),h&&!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]}),((F=t.find(R=>R.id===h.id))==null?void 0:F.tldr)&&c.jsx("div",{className:"text-[10px] opacity-80 mb-1",children:t.find(R=>R.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 bj({doc:t,allDocs:l,onOpen:r,onNavigateDoc:i}){const[o,u]=S.useState(!1),f=yj(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 wj({docId:t,onBack:l,onDocUpdated:r,onDelete:i,onNavigateDoc:o,allDocs:u}){const[f,m]=S.useState(null),[x,h]=S.useState(!0),[y,g]=S.useState(!1),[v,b]=S.useState(""),[k,E]=S.useState(!1),A=new Set(u.map(U=>U.id)),N=S.useCallback(U=>{const D=U.split("#")[0];if(!D.match(/\.(md|html)$/))return null;const V=t.includes("/")?t.replace(/\/[^/]+$/,""):"";let q;if(D.startsWith("./"))q=V?`${V}/${D.slice(2)}`:D.slice(2);else if(D.startsWith("../")){const F=V.split("/").filter(Boolean);let R=D;for(;R.startsWith("../");)F.length>0&&F.pop(),R=R.slice(3);q=F.length>0?`${F.join("/")}/${R}`:R}else q=D;if(A.has(q))return q;const te=q.split("/").pop()??"",T=u.find(F=>F.id===te||F.id.endsWith("/"+te));return T?T.id:null},[t,A,u]),L=S.useCallback(U=>{const V=U.target.closest("a");if(!V)return;const q=V.getAttribute("href");if(!q||q.startsWith("http://")||q.startsWith("https://")||!q.match(/\.(md|html)(#.*)?$/))return;U.preventDefault(),U.stopPropagation();const te=N(q);te&&o(te)},[N,o]);S.useEffect(()=>{h(!0),Ce.getKnowledgeDoc(t).then(U=>{m(U),b(U.content)}).catch(console.error).finally(()=>h(!1))},[t]);const H=async()=>{if(f){E(!0);try{await Ce.updateKnowledgeDoc(t,v),m({...f,content:v}),g(!1),r()}catch(U){console.error("Save failed:",U)}finally{E(!1)}}},Y=async()=>{if(confirm(`Delete "${f==null?void 0:f.title}"?`))try{await Ce.deleteKnowledgeDoc(t),i(t)}catch(U){console.error("Delete failed:",U)}};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:H,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:Y,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:U=>b(U.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:U=>b(U.target.value),spellCheck:!1}):c.jsx("div",{className:"text-xs leading-relaxed",style:{color:"var(--terminal-text-secondary)"},onClick:L,children:c.jsx(ys,{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 kj({onCreated:t,onCancel:l}){const[r,i]=S.useState(""),[o,u]=S.useState(""),[f,m]=S.useState(""),[x,h]=S.useState(!1),[y,g]=S.useState("");S.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 Sj=500,e1=360,t1=700;function ih(t){const[l,r]=S.useState(Sj),[i,o]=S.useState(!1),u=S.useRef(0),f=S.useRef(0),m=t>0,x=m?t:0,h=m?Math.max(e1,window.innerWidth-t-100):t1,y=Math.min(l,h),g=S.useCallback(v=>{v.preventDefault(),u.current=v.clientX,f.current=y,o(!0);const b=E=>{const A=u.current-E.clientX,N=Math.min(t1,Math.max(e1,f.current+A));r(N)},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 jj({docs:t,onClose:l,onRefresh:r,terminalWidth:i=0,initialDocId:o}){const[u,f]=S.useState("list"),[m,x]=S.useState("all"),[h,y]=S.useState(o??null),[g,v]=S.useState(""),[b,k]=S.useState(!1),[E,A]=S.useState(null),{panelRight:N,panelWidth:L,isResizing:H,handleResizeStart:Y}=ih(i),U=["all",...Array.from(new Set(t.map(F=>F.category))).sort()],D=t.filter(F=>{if(m!=="all"&&F.category!==m)return!1;if(g){const R=g.toLowerCase();return F.title.toLowerCase().includes(R)||(F.tldr??"").toLowerCase().includes(R)||F.tags.some(W=>W.toLowerCase().includes(R))}return!0}),V=F=>{k(!1),r(),y(F)},q=F=>{y(null),r()},te=F=>{A(F.id)},T=E?t.find(F=>F.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:N},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)] ${H?"resizing":""}`,style:{right:N,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 ${H?"bg-white/10":"hover:bg-white/5"}`,onMouseDown:Y}),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(n1,{label:"List",active:u==="list",onClick:()=>{f("list"),A(null)}}),c.jsx(n1,{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:F=>v(F.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:U.map(F=>c.jsx("button",{onClick:()=>x(F),className:"px-3 py-1.5 text-[10px] font-medium cursor-pointer whitespace-nowrap",style:{color:m===F?"#4ade80":"var(--terminal-text-muted)",borderBottom:m===F?"2px solid #4ade80":"2px solid transparent"},children:F==="all"?`All (${t.length})`:`${F} (${t.filter(R=>R.category===F).length})`},F))}),c.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:D.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"}):D.map(F=>c.jsx(bj,{doc:F,allDocs:t,onOpen:R=>y(R.id),onNavigateDoc:R=>y(R)},F.id))})]}),u==="list"&&h&&!b&&c.jsx(wj,{docId:h,onBack:()=>y(null),onDocUpdated:r,onDelete:q,onNavigateDoc:F=>y(F),allDocs:t}),u==="list"&&b&&c.jsx(kj,{onCreated:V,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(vj,{docs:t,onNodeClick:te,selectedDocId:E}),T&&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:T.title}),c.jsx("div",{className:"w-2 h-2 rounded-full mb-2",style:{background:T.status==="active"?"#16a34a":T.status==="draft"?"#f59e0b":"#94a3b8"}}),T.tldr&&c.jsx("div",{className:"text-[10px] mb-2 leading-relaxed",style:{color:"var(--terminal-text-secondary)"},children:T.tldr}),T.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"}),T.links.slice(0,5).map((F,R)=>c.jsxs("div",{className:"text-[9px] mb-0.5 truncate",style:{color:"var(--terminal-text-secondary)"},children:["🔗"," ",F.text]},R))]}),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(T.id),A(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(hs).map(([F,R])=>c.jsxs("div",{className:"flex items-center gap-1 text-[9px]",children:[c.jsx("div",{className:"w-2 h-2",style:{background:R.border}}),c.jsx("span",{style:{color:"var(--terminal-text-muted)"},children:F})]},F))})})]})]})]})}function n1({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 Ej({standups:t,waves:l,decisions:r,mode:i,onClose:o,terminalWidth:u=0}){const[f,m]=S.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(nd,{label:`Standups (${t.length})`,active:f==="standups",onClick:()=>m("standups")}),c.jsx(nd,{label:`Waves (${l.length})`,active:f==="waves",onClick:()=>m("waves")})]}):c.jsx(nd,{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(ld,{title:`Standup ${v.date}`,content:v.content},b)),f==="waves"&&l.map((v,b)=>c.jsx(ld,{title:`Wave ${v.id}`,subtitle:v.timestamp,content:v.content},b)),f==="decisions"&&r.map((v,b)=>c.jsx(ld,{title:`#${v.id} ${v.title}`,subtitle:v.date,content:v.content},b))]})]})]})}function nd({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 Cj(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 ld({title:t,subtitle:l,content:r}){const[i,o]=S.useState(!1),u=r.length>100,f=Cj(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(ys,{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 Nj({projectId:t,onClose:l,terminalWidth:r=0}){const[i,o]=S.useState(null),{panelRight:u,panelWidth:f,isResizing:m,handleResizeStart:x}=ih(r);if(S.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(ys,{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(Aj,{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 Aj({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 Tj={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C"};function Dj({roleId:t,roleName:l,mode:r="assign",onClose:i,onExecutionStart:o}){const[u,f]=S.useState(""),m=S.useRef(null);S.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=Tj[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 l1={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C"};function Yy({event:t,isThinkingCollapsed:l,onToggleThinking:r,onNavigateToJob:i,onOpenKnowledgeDoc:o,compact:u}){var m;const f=l1[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=l1[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 zj({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}=S1(t),[k,E]=S.useState(0),[A,N]=S.useState(new Set),L=S.useRef(null),H=S.useRef(Date.now()),Y=S.useRef(!1);S.useEffect(()=>{const F=setInterval(()=>{E(Math.floor((Date.now()-H.current)/1e3))},1e3);return()=>clearInterval(F)},[]),S.useEffect(()=>{L.current&&(L.current.scrollTop=L.current.scrollHeight)},[y]),S.useEffect(()=>{(g==="done"||g==="error")&&!Y.current&&(Y.current=!0,m==null||m())},[g,m]);const U=F=>{N(R=>{const W=new Set(R);return W.has(F)?W.delete(F):W.add(F),W})},D={idle:"Waiting",connecting:"Connecting...",streaming:"Working",done:"Complete",error:"Error"}[g],V={idle:"#888",connecting:"#888",streaming:r,done:"#2E7D32",error:"#C62828"}[g],q=F=>`${Math.floor(F/60)}:${String(F%60).padStart(2,"0")}`,te=g==="done"||g==="error",T=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:V}}),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:`${V}22`,color:V},children:D}),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:"–"}),te&&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(F=>c.jsx(Yy,{event:F,isThinkingCollapsed:A.has(F.seq),onToggleThinking:()=>U(F.seq),onNavigateToJob:x,onOpenKnowledgeDoc:h},F.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`]}),te&&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:te?u:void 0}),T]}):T}const ad={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C","data-analyst":"#0277BD"};function Mj({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:ad[m.id]??"#888",color:ad[m.id]??"#888",background:`${ad[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 Rj({cLevelRoles:t,orgNodes:l,rootId:r,onClose:i,onDispatch:o}){const[u,f]=S.useState(""),m=S.useRef(null);S.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(Mj,{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]=S.useState(new Map),[u,f]=S.useState(null),m=S.useRef(new Map),x=S.useRef(i);x.current=i,S.useEffect(()=>{if(!r||Object.keys(l).length===0)return;const v=new Map,b=E=>{const A=l[E];A&&(v.set(E,{jobId:null,roleId:E,roleName:A.name,children:A.children,status:"waiting",events:[],streamStatus:"idle"}),A.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 A=v.get(E.roleId);A&&(A.jobId=E.jobId,A.status="running",A.streamStatus="connecting")}o(v),t.length>0&&f(t[0].roleId)},[t,l,r]);const h=S.useCallback((v,b)=>{const k=m.current.get(v);k&&k.controller.abort();const E=new AbortController,A={controller:E,lastSeq:-1};m.current.set(v,A);const L=`/api/jobs/${v}/stream?from=0`;fetch(L,{signal:E.signal}).then(async H=>{if(!H.ok||!H.body){o(V=>{const q=new Map(V),te=q.get(b);return te&&q.set(b,{...te,streamStatus:"error"}),q});return}o(V=>{const q=new Map(V),te=q.get(b);return te&&q.set(b,{...te,streamStatus:"streaming",status:"running"}),q});const Y=H.body.getReader(),U=new TextDecoder;let D="";for(;;){const{done:V,value:q}=await Y.read();if(V)break;D+=U.decode(q,{stream:!0});const te=D.split(`
|
|
80
|
-
`);D=te.pop()??"";let T="";for(const F of te)if(F.startsWith("event: "))T=F.slice(7).trim();else if(F.startsWith("data: ")){try{const R=JSON.parse(F.slice(6));if(T==="activity"){const W=R;W.seq>A.lastSeq&&(A.lastSeq=W.seq),o(X=>{const G=new Map(X),M=G.get(b);if(!M||M.events.some(ne=>ne.seq===W.seq))return X;const Q={...M,events:[...M.events,W]};if(W.type==="dispatch:start"&&W.data.childJobId){const ne=W.data.childJobId,pe=W.data.targetRoleId??W.data.roleId;if(pe){const z=G.get(pe);z&&(G.set(pe,{...z,jobId:ne,status:"running",streamStatus:"connecting"}),setTimeout(()=>h(ne,pe),0))}}return W.type==="job:done"?(Q.status="done",Q.streamStatus="done"):W.type==="job:error"&&(Q.status="error",Q.streamStatus="error"),G.set(b,Q),G})}else if(T==="stream:end"){const W=R.reason;o(X=>{const G=new Map(X),M=G.get(b);if(!M)return X;const Q=W==="error"?"error":"done";return G.set(b,{...M,status:M.status==="running"?Q:M.status,streamStatus:Q==="error"?"error":"done"}),G})}}catch{}T=""}}}).catch(H=>{H.name!=="AbortError"&&o(Y=>{const U=new Map(Y),D=U.get(b);return D&&U.set(b,{...D,streamStatus:"error"}),U})})},[]);S.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,A]of i)E!==r&&(k++,A.status==="done"?v++:A.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 S.useEffect(()=>{g&&o(v=>{const b=new Map(v);let k=!1;for(const[E,A]of b)A.status==="waiting"&&(b.set(E,{...A,status:"not-dispatched"}),k=!0);return k?b:v})},[g]),{nodes:i,selectedRoleId:u,selectNode:f,progress:y,allDone:g}}const a1={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C","data-analyst":"#0277BD"},ar=120,ql=44,r1=80;function Oj(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*r1+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))*(ar+16),x=Math.max(m,280);for(const y of o){const g=y.length*(ar+16)-16,v=(x-g)/2;y.forEach((b,k)=>{const E=i.find(A=>A.roleId===b);E&&(E.x=v+k*(ar+16))})}const h=o.length*r1+40;return{layout:i,width:x,height:h}}function Bj({nodes:t,rootId:l,selectedRoleId:r,onSelectNode:i}){const{layout:o,width:u,height:f}=Oj(t,l),m=h=>{const y=o.find(g=>g.roleId===h);return y?{cx:y.x+ar/2,cy:y.y+ql/2}:{cx:0,cy:0}},x=h=>{switch(h.status){case"running":return a1[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",A="";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=a1[h.roleId]??"#FBBF24",E="6 4",A="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:A},`${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:ar,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:ar-18,y:ql/2+4,fontSize:14,fill:"#2E7D32",children:"✓"}),y.status==="error"&&c.jsx("text",{x:ar-18,y:ql/2+4,fontSize:14,fill:"#C62828",children:"✗"})]},h.roleId)})]})}const Lj={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C","data-analyst":"#0277BD"};function Fj({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]=S.useState(0),[E,A]=S.useState(new Set),N=S.useRef(null),L=S.useRef(Date.now()),H=S.useRef(!1);S.useEffect(()=>{const q=setInterval(()=>{k(Math.floor((Date.now()-L.current)/1e3))},1e3);return()=>clearInterval(q)},[]),S.useEffect(()=>{N.current&&(N.current.scrollTop=N.current.scrollHeight)},[h,x]),S.useEffect(()=>{v&&!H.current&&(H.current=!0,f==null||f())},[v,f]);const Y=q=>`${Math.floor(q/60)}:${String(q%60).padStart(2,"0")}`,U=h?x.get(h):null,D=h?Lj[h]??"#888":"#888",V=q=>{A(te=>{const T=new Set(te);return T.has(q)?T.delete(q):T.add(q),T})};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:Y(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(Bj,{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:[U&&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:D}}),c.jsx("span",{className:"text-[var(--terminal-text)] font-bold text-xs",children:U.roleId.toUpperCase()}),c.jsx("span",{className:"text-[var(--terminal-text-muted)] text-xs",children:U.roleName}),c.jsx("span",{className:"ml-auto text-[10px] px-2 py-0.5 rounded-full font-semibold",style:{background:`${D}22`,color:D},children:U.status==="running"?"Working":U.status==="done"?"Complete":U.status==="error"?"Error":U.status==="waiting"?"Waiting":"Not dispatched"})]}),c.jsxs("div",{ref:N,className:"flex-1 overflow-y-auto p-4 space-y-1 text-xs font-mono",children:[U&&U.events.length===0&&c.jsx("div",{className:"text-[var(--terminal-text-muted)]",children:U.status==="waiting"?"Waiting for dispatch...":U.status==="running"?"Connecting to activity stream...":U.status==="not-dispatched"?"This role was not dispatched in this wave.":""}),U==null?void 0:U.events.map(q=>c.jsx(Yy,{event:q,isThinkingCollapsed:E.has(q.seq),onToggleThinking:()=>V(q.seq),onNavigateToJob:te=>{for(const[,T]of x)if(T.jobId===te){y(T.roleId);return}},onOpenKnowledgeDoc:m},q.seq)),(U==null?void 0:U.status)==="running"&&c.jsx("span",{className:"inline-block w-2 h-4 bg-green-400 animate-pulse ml-0.5"})]}),!U&&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:U&&U.events.length>0&&`${U.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 Uj={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 Uj[t]??{skinColor:"#B0BEC5",hairColor:"#78909C",shirtColor:"#607D8B",pantsColor:"#455A64",shoeColor:"#37474F"}}const Vy=["#FDEBD0","#F5CBA7","#D4A07A","#C68642","#8D5524","#5C3A1E","#F3D1C7","#E8BEAC","#B07D62","#704214"],Xy=["#1A0A00","#2C1810","#4E342E","#6D4C41","#8D6E63","#D4A574","#F5E6CA","#FFD700","#B71C1C","#AD1457","#4A148C","#1A237E","#004D40","#1A1A1A","#78909C","#E0E0E0"],Gy=["#1565C0","#E65100","#2E7D32","#4A148C","#AD1457","#00695C","#D32F2F","#F57F17","#1B5E20","#283593","#4E342E","#37474F","#880E4F","#00838F","#6A1B9A","#FF6F00"],Qy=["#37474F","#1A237E","#3E2723","#263238","#1B5E20","#455A64","#212121","#4E342E","#0D47A1","#311B92"],Ky=["#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 Hj({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 ns({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(Hj,{color:o,selected:o===r,onClick:()=>i(o)},o))})]})}function rd({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 id({label:t,active:l,onClick:r}){return c.jsx("button",{onClick:r,style:{flex:1,padding:"6px 0",fontSize:10,fontFamily:"var(--font-pixel, monospace)",fontWeight:"bold",letterSpacing:1,background:l?"rgba(255,255,255,0.08)":"transparent",color:l?"#fff":"rgba(255,255,255,0.35)",border:"none",borderBottom:l?"2px solid #3B82F6":"2px solid transparent",cursor:"pointer",transition:"all 0.15s"},children:t})}function ja(t){return t[Math.floor(Math.random()*t.length)]}function tc(){var i,o,u;const t=_y(),l=Oy(),r=By();return{skinColor:ja(Vy),hairColor:ja(Xy),shirtColor:ja(Gy),pantsColor:ja(Qy),shoeColor:ja(Ky),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 Zy({roleId:t,appearance:l,onChange:r,onRandomize:i,onReset:o,label:u}){const[f,m]=S.useState("look"),x=S.useCallback((k,E)=>{r({...l,[k]:E})},[l,r]),h=S.useRef(null),y=S.useCallback(k=>{var N;const E=(N=k.target.files)==null?void 0:N[0];if(!E)return;const A=new Image;A.onload=()=>{const L=u5(A);r({...L,hairStyle:l.hairStyle,outfitStyle:l.outfitStyle,accessory:l.accessory}),URL.revokeObjectURL(A.src)},A.src=URL.createObjectURL(E),k.target.value=""},[l.hairStyle,l.outfitStyle,l.accessory,r]),g=_y(),v=Oy(),b=By();return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"customize-preview",children:[c.jsx("div",{className:"customize-preview-bg",children:c.jsx(yc,{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 k;return(k=h.current)==null?void 0:k.click()},style:{fontSize:9,opacity:.7},children:"PHOTO"}),c.jsx("input",{ref:h,type:"file",accept:"image/*",onChange:y,style:{display:"none"}})]})]}),c.jsxs("div",{className:"customize-colors",children:[c.jsxs("div",{style:{display:"flex",borderBottom:"1px solid rgba(255,255,255,0.06)",marginBottom:4},children:[c.jsx(id,{label:"LOOK",active:f==="look",onClick:()=>m("look")}),c.jsx(id,{label:"OUTFIT",active:f==="outfit",onClick:()=>m("outfit")}),c.jsx(id,{label:"ACCESSORY",active:f==="accessory",onClick:()=>m("accessory")})]}),f==="look"&&c.jsxs(c.Fragment,{children:[c.jsx(ns,{label:"SKIN",presets:Vy,value:l.skinColor,onChange:k=>x("skinColor",k)}),c.jsx(ns,{label:"HAIR COLOR",presets:Xy,value:l.hairColor,onChange:k=>x("hairColor",k)}),c.jsx(rd,{label:"HAIR STYLE",items:g,value:l.hairStyle,onChange:k=>x("hairStyle",k)})]}),f==="outfit"&&c.jsxs(c.Fragment,{children:[c.jsx(rd,{label:"STYLE",items:v,value:l.outfitStyle,onChange:k=>x("outfitStyle",k)}),c.jsx(ns,{label:"TOP",presets:Gy,value:l.shirtColor,onChange:k=>x("shirtColor",k)}),c.jsx(ns,{label:"PANTS",presets:Qy,value:l.pantsColor,onChange:k=>x("pantsColor",k)}),c.jsx(ns,{label:"SHOES",presets:Ky,value:l.shoeColor,onChange:k=>x("shoeColor",k)})]}),f==="accessory"&&c.jsxs(c.Fragment,{children:[c.jsx(rd,{label:"ACCESSORY",items:b,value:l.accessory,onChange:k=>x("accessory",k)}),c.jsx("div",{style:{marginTop:12,padding:"8px 10px",background:"rgba(255,255,255,0.03)",borderRadius:6,border:"1px dashed rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.25)",fontSize:9,fontFamily:"var(--font-pixel, monospace)",textAlign:"center"},children:"More accessories coming soon"})]})]})]})}const $j=[{value:"c-level",label:"C-Level"},{value:"team-lead",label:"Team Lead"},{value:"member",label:"Member"}];function qj(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,24)}function Ij(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 ls=4;function Yj({existingRoles:t,onClose:l,onHire:r}){const[i,o]=S.useState(1),[u,f]=S.useState(""),[m,x]=S.useState(""),[h,y]=S.useState(!1),[g,v]=S.useState("member"),[b,k]=S.useState("ceo"),[E,A]=S.useState(""),[N,L]=S.useState(tc),[H,Y]=S.useState(!1),[U,D]=S.useState(""),V=S.useRef(null),q=S.useRef(null);S.useEffect(()=>{var M,Q;i===1&&((M=V.current)==null||M.focus()),i===2&&((Q=q.current)==null||Q.focus())},[i]);const te=M=>{f(M),h||x(qj(M))},T=u.trim().length>0&&m.trim().length>0&&!t.some(M=>M.id===m),F=E.trim().length>0,R=async()=>{Y(!0),D("");const M=Ij(g);try{await r({id:m,name:u.trim(),level:g,reportsTo:b,persona:E.trim(),...M},N),l()}catch(Q){D(Q instanceof Error?Q.message:"Failed to create role"),Y(!1)}},W=M=>M===1?T:M===2?F:!0,X=M=>{M.key==="Escape"&&l(),M.key==="Enter"&&(M.metaKey||M.ctrlKey)&&(i<ls&&W(i)?o(i+1):i===ls&&R())},G=t.some(M=>M.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:X,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 ",ls]})]}),c.jsx("div",{className:"flex gap-1 px-5 pt-4",children:Array.from({length:ls},(M,Q)=>Q+1).map(M=>c.jsx("div",{className:"flex-1 h-1 rounded-full transition-colors",style:{background:M<=i?"#2E7D32":"rgba(255,255,255,0.1)"}},M))}),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:V,value:u,onChange:M=>te(M.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:M=>{x(M.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 ${G?"border-red-400":"border-white/10 focus:border-white/25"}`}),G&&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:$j.map(M=>c.jsx("button",{onClick:()=>v(M.value),className:`flex-1 p-2 text-xs font-semibold rounded-lg border cursor-pointer transition-colors ${g===M.value?"border-green-600 bg-green-900/30 text-green-400":"border-white/10 text-white/50 hover:border-white/20"}`,children:M.label},M.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:M=>k(M.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(M=>c.jsxs("option",{value:M.id,className:"bg-[var(--wall)] text-white",children:[M.name," (",M.id,")"]},M.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:M=>A(M.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(Zy,{roleId:"default",appearance:N,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(yc,{roleId:"default",appearance:N,scale:4})}),c.jsxs("div",{className:"flex-1 space-y-2.5",children:[c.jsx($o,{label:"Name",value:u}),c.jsx($o,{label:"ID",value:m,mono:!0}),c.jsx($o,{label:"Level",value:g}),c.jsx($o,{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})]})]}),U&&c.jsx("div",{className:"text-xs text-red-400 bg-red-900/20 p-2 rounded-lg border border-red-800/30",children:U})]})]}),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<ls?c.jsx("button",{onClick:()=>o(i+1),disabled:!W(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:R,disabled:H,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:H?"Hiring...":"HIRE"})]})]})]})]})}function $o({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 Vj({roleId:t,roleName:l,onClose:r,onConfirm:i}){const[o,u]=S.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 Xj={cto:"🏗️",cbo:"📊",pm:"📋",engineer:"⚙️",designer:"🎨",qa:"🔍"};function Gj({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:Xj[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 Qj({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(ry,{remarkPlugins:[Ty],components:{code:Kj,table:({children:i})=>c.jsx("div",{className:"overflow-x-auto my-2",children:c.jsx("table",{className:"terminal-table",children:i})})},children:r})})}function Kj({className:t,children:l,...r}){const i=/language-(\w+)/.exec(t??"");return i||typeof l=="string"&&l.includes(`
|
|
81
|
-
`)?c.jsx(Zj,{language:i==null?void 0:i[1],children:l}):c.jsx("code",{className:"terminal-inline-code",...r,children:l})}function Zj({children:t,language:l}){const[r,i]=S.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 Jj={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 Wj(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 Pj({event:t,isStreaming:l}){var o,u,f;const[r,i]=S.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 eE({events:t,isStreaming:l}){const[r,i]=S.useState(!1);if(t.length===0)return null;const o=Wj(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(Pj,{event:v,isStreaming:l&&b===o.length-1},b))})]})}function tE({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:Jj[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(eE,{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(Qj,{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 nE({messages:t,roleId:l,roleColor:r}){var o;const i=S.useRef(null);return S.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(tE,{message:u,roleId:l,roleColor:r},u.id)),c.jsx("div",{ref:i})]})}function lE({mode:t,onModeChange:l,onSend:r,disabled:i,disabledReason:o}){const[u,f]=S.useState(""),m=S.useRef(null);S.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 aE={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C","data-analyst":"#0277BD"},Jy={cto:"CTO",cbo:"CBO",pm:"PM",engineer:"Engineer",designer:"Designer",qa:"QA","data-analyst":"Data Analyst"};function i1(t){return new Date(t).toLocaleTimeString("ko-KR",{hour:"2-digit",minute:"2-digit"})}function rE({msg:t}){const l=aE[t.roleId]??"#888",r=Jy[t.roleId]??t.roleId;if(t.type==="dispatch"){const i=t.text.includes("WAVE"),o=t.text.includes("completed")||t.text.includes("완료"),u=i?"📡":o?"✓":"→",f=o?"text-green-400/70":"text-[var(--terminal-text-muted)]";return c.jsxs("div",{className:"flex items-start gap-2 px-3 py-1 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:i1(t.ts)}),c.jsx("span",{className:"text-[10px] shrink-0 mt-0.5",children:u}),c.jsx("span",{className:`text-[11px] ${f}`,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:i1(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}),c.jsx("span",{className:"text-xs text-[var(--terminal-text-secondary)]",children:t.text})]})]})}function iE({channel:t,allRoles:l,onUpdateMembers:r}){const i=S.useRef(null),o=S.useRef(null);if(S.useEffect(()=>{var h;const m=o.current;if(!m)return;m.scrollHeight-m.scrollTop-m.clientHeight<80&&((h=i.current)==null||h.scrollIntoView({behavior:"smooth"}))},[t.messages.length]),t.messages.length===0)return 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"})]});const[u,f]=S.useState(!1);return c.jsxs("div",{ref:o,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)] flex items-center gap-2",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)]",children:t.members.map(m=>Jy[m]??m).join(", ")}),t.members.length===0&&c.jsx("span",{className:"text-[10px] text-[var(--terminal-text-muted)]",children:t.isDefault?"system logs":"no members"}),!t.isDefault&&l&&r&&c.jsx("button",{className:"ml-auto text-[10px] px-2 py-0.5 rounded bg-white/5 hover:bg-white/10 text-[var(--terminal-text-muted)]",onClick:()=>f(!u),children:u?"Done":"Invite"})]}),u&&!t.isDefault&&l&&r&&c.jsx("div",{className:"px-3 pb-2 mb-2 border-b border-[var(--terminal-border)]",children:c.jsx("div",{className:"flex flex-wrap gap-1",children:l.map(m=>{const x=t.members.includes(m.id);return c.jsxs("button",{className:`text-[10px] px-2 py-1 rounded ${x?"bg-white/15 text-[var(--terminal-text)]":"bg-white/5 text-[var(--terminal-text-muted)]"}`,onClick:()=>{const h=x?t.members.filter(y=>y!==m.id):[...t.members,m.id];r(t.id,h)},children:[x?"✓ ":"",m.name]},m.id)})})}),t.messages.map(m=>c.jsx(rE,{msg:m},m.id)),c.jsx("div",{ref:i})]})}const od={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C"},sE=400,oE=800;function cE({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:A,onCreateChatChannel:N,onDeleteChatChannel:L,onUpdateChatMembers:H,unreadChannels:Y}){const[U,D]=S.useState(!1),[V,q]=S.useState(!1),[te,T]=S.useState(!1),[F,R]=S.useState(""),W=E!=null,X=k==null?void 0:k.find(de=>de.id===E),[G,M]=S.useState(!1),[Q,ne]=S.useState(!1),[pe,z]=S.useState(!1),_=S.useRef(0),ee=S.useRef(0),C=S.useRef(null),fe=t.find(de=>de.id===l),ve=i===l,ye=t.filter(de=>de.messages.length===0).length,ke=S.useCallback(()=>{const de=C.current;de&&(ne(de.scrollLeft>0),z(de.scrollLeft+de.clientWidth<de.scrollWidth-1))},[]);S.useEffect(()=>{if(!l||!C.current)return;const de=C.current.querySelector(`[data-session-id="${l}"]`);de&&de.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}),ke()},[l,t.length,ke]),S.useEffect(()=>{const de=C.current;if(!de)return;ke(),de.addEventListener("scroll",ke);const qe=new ResizeObserver(ke);return qe.observe(de),()=>{de.removeEventListener("scroll",ke),qe.disconnect()}},[ke]);const He=S.useCallback(de=>{de.preventDefault(),_.current=de.clientX,ee.current=o,M(!0);const qe=vt=>{const Rn=_.current-vt.clientX,ut=Math.min(oE,Math.max(sE,ee.current+Rn));u==null||u(ut)},Tt=()=>{M(!1),document.removeEventListener("mousemove",qe),document.removeEventListener("mouseup",Tt)};document.addEventListener("mousemove",qe),document.addEventListener("mouseup",Tt)},[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 ${G?"bg-[var(--terminal-border-hover)]":"bg-transparent"}`,onMouseDown:He}),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:[Q&&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:C,className:"flex items-center overflow-x-auto terminal-tab-scroll gap-px px-1 py-1",children:[k==null?void 0:k.map(de=>c.jsxs("button",{onClick:()=>{A==null||A(de.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===de.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===de.id?{borderTop:"2px solid #4CAF50"}:void 0,children:[c.jsx("span",{className:"text-[10px]",children:"💬"}),c.jsx("span",{className:"truncate",children:de.name}),(Y==null?void 0:Y.has(de.id))&&E!==de.id&&c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400 shrink-0"}),!de.isDefault&&c.jsx("span",{onClick:qe=>{qe.stopPropagation(),L==null||L(de.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:"×"})]},de.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(de=>c.jsx(Gj,{roleId:de.roleId,title:de.title,roleColor:od[de.roleId]??"#666",active:!W&&de.id===l,onClick:()=>{A==null||A(null),f(de.id)},onClose:qe=>{qe.stopPropagation(),m(de.id)},"data-session-id":de.id},de.id))]}),pe&&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:()=>{D(!U),q(!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:"+"}),U&&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:[N&&c.jsxs(c.Fragment,{children:[te?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:F,onChange:de=>R(de.target.value),onKeyDown:de=>{de.key==="Enter"&&F.trim()&&(N(F.trim(),[]),R(""),T(!1),D(!1)),de.key==="Escape"&&(T(!1),R(""))},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:()=>T(!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(de=>c.jsxs("button",{onClick:()=>{x(de.id),A==null||A(null),D(!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[de.id]??"#666"}}),de.id.toUpperCase()," — ",de.name]},de.id))]})]}),c.jsxs("div",{className:"relative shrink-0",children:[c.jsx("button",{onClick:()=>{q(!V),D(!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":""]}),ye>0&&h&&c.jsxs("button",{onClick:()=>{h(),q(!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 (",ye,")"]}),t.length>0&&y&&c.jsx("button",{onClick:()=>{y(),q(!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:"×"})]}),W&&X?c.jsx(iE,{channel:X,allRoles:r,onUpdateMembers:H}):fe?c.jsxs(c.Fragment,{children:[c.jsx(nE,{messages:fe.messages,roleId:fe.roleId,roleColor:od[fe.roleId]??"#666"}),c.jsx(lE,{mode:fe.mode,onModeChange:de=>v(fe.id,de),onSend:de=>g(fe.id,de,fe.mode),disabled:ve,disabledReason:ve?`${fe.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 uE(){const t=S.useRef(null),l=S.useCallback(()=>{var i;(i=t.current)==null||i.abort(),t.current=null},[]);return{sendMessage:S.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,A;if(!x.ok||!x.body){f.onError("Failed to connect");return}const h=x.body.getReader(),y=new TextDecoder;let g="";for(;;){const{done:N,value:L}=await h.read();if(N)break;g+=y.decode(L,{stream:!0});const H=g.split(`
|
|
82
|
-
`);g=H.pop()??"";let Y="";for(let U=0;U<H.length;U++){const D=H[U];if(D.startsWith("event: ")){Y=D.slice(7).trim();continue}if(D.startsWith("data: ")){let V;try{V=JSON.parse(D.slice(6))}catch{Y="";continue}switch(Y){case"thinking":V.text&&((v=f.onThinking)==null||v.call(f,V.text));break;case"output":V.text&&f.onText(V.text);break;case"tool":(b=f.onToolUse)==null||b.call(f,V.name,V.input);break;case"dispatch":(k=f.onDispatch)==null||k.call(f,V.roleId,V.task);break;case"dispatch:progress":(E=f.onDispatchProgress)==null||E.call(f,V.roleId,V.type,V);break;case"turn":(A=f.onTurn)==null||A.call(f,V.turn);break;case"done":f.onDone(V);break;case"error":f.onError(V.message??"Unknown error");break;default:V.text&&f.onText(V.text);break}Y=""}}}}).catch(x=>{x.name!=="AbortError"&&f.onError(x.message)}),{abort:l}},[l]),abort:l}}const oh="tycono-appearances",uc="tycono-theme";(()=>{try{for(const[t,l]of[["the-company-appearances",oh],["the-company-theme",uc]]){const r=localStorage.getItem(t);r&&!localStorage.getItem(l)&&(localStorage.setItem(l,r),localStorage.removeItem(t))}}catch{}})();function s1(){try{const t=localStorage.getItem(oh);return t?JSON.parse(t):{}}catch{return{}}}function cd(t){localStorage.setItem(oh,JSON.stringify(t))}function o1(){try{const t=localStorage.getItem(uc);if(t&&t in Na)return t}catch{}return"default"}function fE(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 dE(){try{const t=localStorage.getItem(Dd);return t?{...ud,...JSON.parse(t)}:ud}catch{return ud}}function hE(){const[t,l]=S.useState(s1),[r,i]=S.useState(o1),[o,u]=S.useState(dE),f=S.useRef(!1);S.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(uc,v.theme))}else{const k=s1(),E=o1();(Object.keys(k).length>0||E!=="default")&&Ce.updatePreferences({appearances:k,theme:E}).catch(()=>{})}}).catch(()=>{}))},[]),S.useEffect(()=>{fE(r)},[r]);const m=S.useCallback(v=>t[v]??sh(v),[t]),x=S.useCallback((v,b)=>{l(k=>{const E={...k,[v]:b};return cd(E),Ce.updatePreferences({appearances:E}).catch(()=>{}),E})},[]),h=S.useCallback(v=>{l(b=>{const k={...b};return delete k[v],cd(k),Ce.updatePreferences({appearances:k}).catch(()=>{}),k})},[]),y=S.useCallback(v=>{i(v),localStorage.setItem(uc,v),Ce.updatePreferences({theme:v}).catch(()=>{})},[]),g=S.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 mE=3e4;function pE(){var b;const[t,l]=S.useState(null),[r,i]=S.useState("synced"),[o,u]=S.useState([]),f=S.useRef(null),m=S.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")}},[]);S.useEffect(()=>(m(),f.current=setInterval(m,mE),()=>{f.current&&clearInterval(f.current)}),[m]);const x=S.useCallback(async k=>{i("saving");try{const E=await Ce.save(k);return await m(),E}catch(E){throw i("error"),E}},[m]),h=S.useCallback(async()=>{try{const k=await Ce.getSaveHistory(20);u(k)}catch{}},[]),y=S.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 c1={cto:["이 아키텍처 기술 부채 좀 줄여야 하는데...","over-engineering 하지 말자. 최소한만.","성능 프로파일링 결과가 좀 신경쓰이네.","시스템 설계 리뷰 해야지.","이거 추상화 한 층만 걷어내면 될 텐데.","모니터링 대시보드 한번 볼까.","코드 리뷰 큐 확인해봐야겠다.","이 모듈 의존성 정리할 때 됐는데."],cbo:["경쟁사 새 기능 나왔다던데... 분석해봐야겠다.","이번 달 수익 지표 정리해야지.","시장 트렌드 리포트 업데이트 할 때 됐는데.","가격 전략 벤치마킹 좀 해볼까.","ROI 계산 다시 해봐야겠어.","경쟁사 GitHub 스타 추이 체크해볼까.","런칭 타이밍 고민 중...","포지셔닝 전략 다시 점검해봐야겠다."],pm:["이 기능 정말 사용자가 원하는 걸까?","백로그 정리 좀 해야 하는데...","MVP 범위가 자꾸 늘어나고 있어.","사용자 피드백 분석 중...","우선순위 재조정이 필요할 것 같은데.","스코프 크리프 경계해야지.","로드맵 타임라인 맞을까...","태스크 의존성 다시 확인해봐야겠다."],engineer:["이 코드 리팩토링 하고 싶다...","테스트 커버리지가 좀 낮은 것 같은데.","Working code first, perfect code later.","PR 리뷰 기다리는 중...","이 버그 원인이 뭘까...","빌드 깨진 거 아닌가?","타입 에러 하나 잡아야 하는데.","npm audit 한번 돌려볼까."],designer:["이 UI 흐름 좀 어색한데...","사용성 먼저, 예쁜 건 그 다음.","디자인 시스템 컴포넌트 정리해야지.","빠르게 두 개 만들어서 비교하자.","접근성 체크리스트 돌려봐야겠다.","이 인터랙션 프로토타입 해볼까.","컬러 팔레트 다시 보자...","여백이 좀 답답한 것 같은데."],qa:['"동작한다"와 "정확하다"는 다른 거야.',"엣지 케이스 시나리오 정리 중...","회귀 테스트 스위트 돌려봐야겠다.","이 부분 자동화 테스트로 바꿀 수 있을 텐데.","릴리즈 전 체크리스트 확인해야지.","재현 가능한 버그 리포트가 중요해.","크로스 브라우저 테스트 돌려봐야겠다.","성능 회귀 없는지 확인해야 하는데."],"data-analyst":["데이터 파이프라인 상태 체크 중...","이상치 탐지 패턴이 재미있네.","대시보드 지표 업데이트 해야지.","상관관계가 인과관계는 아닌데...","SQL 쿼리 최적화 여지가 있을 것 같은데.","데이터 품질 점검 시간이다."]},u1={cto:["팀한테 일을 더 줘야 하나...","아키텍처 부채 정리할 시간인가.","기술 로드맵 재검토 해야겠다.","좀 한가한데... 뭔가 놓치고 있나?"],cbo:["시장 분석 업데이트할 시간인데...","매출 리포트 준비해야 하는데 지시가 없네.","경쟁사 동향 체크나 하자.","비즈니스 쪽은 조용하네..."],pm:["백로그가 좀 고요한데... 기획할 게 없나?","스프린트 계획 안 잡힌 지 좀 됐는데.","사용자 피드백 쌓여있을 텐데 확인해야 하는데...","PRD 작성할 게 없다니... 이상한데."],engineer:["오늘 할 일이 없네... 코드 리뷰라도 할까.","태스크 큐가 비어있다. 리팩토링이나 하자.","혹시 내가 뭘 놓치고 있나?","커밋 로그 정리나 해야겠다."],designer:["디자인 요청이 안 오네. 자체적으로 뭐 개선할까.","UI 감사(audit) 한번 돌려볼까...","포트폴리오 정리나 해야겠다.","컴포넌트 라이브러리 정비할까."],qa:["테스트할 빌드가 없네. 자동화 스크립트 보강이나 할까.","조용하다... 버그가 없는 건가, 못 찾은 건가.","기존 테스트 시나리오 점검이나 하자.","테스트 커버리지 리포트 갱신해볼까."],"data-analyst":["분석 요청이 안 들어오네...","데이터 웨어하우스 정리나 할까.","과거 리포트 검증이나 해봐야겠다."]},xE=[{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:"고마워. 너한테는 말할 수 있어서 좋다."}]}],gE=18e3,f1=6e3,yE=2500,vE=30*6e4,Wy="tycono:relationships";function bE(){try{const t=localStorage.getItem(Wy);return t?JSON.parse(t):[]}catch{return[]}}function wE(t){localStorage.setItem(Wy,JSON.stringify(t))}function qo(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 Io(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 kE(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 SE(t,l){return t.relation==="any"?!0:t.relation===l}function jE({roles:t,roleStatuses:l,activeExecs:r,getStandupSpeech:i}){const[o,u]=S.useState(new Map),[f,m]=S.useState(bE),x=S.useRef({}),h=S.useRef(null),y=S.useRef(t),g=S.useRef(l),v=S.useRef(r),b=S.useRef(i),k=S.useRef(f);y.current=t,g.current=l,v.current=r,b.current=i,k.current=f,S.useEffect(()=>{const Y=Date.now();for(const[U,D]of Object.entries(l))D==="working"&&(x.current[U]=Y)},[l]),S.useEffect(()=>{wE(f)},[f]);const E=S.useCallback(Y=>{const U=g.current[Y],D=v.current.find(F=>F.roleId===Y);if(U==="working"&&(D!=null&&D.task))return null;const V=b.current(Y);if(V&&Math.random()<.3)return{text:V,type:"work",ts:Date.now()};const q=Date.now(),te=x.current[Y]??0;if(q-te>vE&&Math.random()<.5){const F=u1[Y]??u1.engineer;return{text:Yo(F),type:"guilt",ts:q}}const T=c1[Y]??c1.engineer;return{text:Yo(T),type:"personality",ts:q}},[]),A=S.useCallback(Y=>{if(h.current)return!1;const U=Y.filter(Q=>g.current[Q.id]!=="working");if(U.length<2)return!1;const D=[...U].sort(()=>Math.random()-.5),V=D[0],q=D[1],te=kE(V.id,q.id,Y);if(!te)return!1;const T=qo(k.current,V.id,q.id),F=Io(T),R=xE.filter(Q=>SE(Q,te)&&F>=Q.minFamiliarity);if(R.length===0)return!1;const W=Yo(R);let X=V.id,G=q.id;W.relation==="superior-subordinate"&&(q.reportsTo===V.id||V.level==="c-level"?(X=V.id,G=q.id):(X=q.id,G=V.id)),h.current={templateId:W.id,roleA:X,roleB:G,turnIdx:0,timer:null};const M=Q=>{if(!h.current||Q>=W.turns.length){h.current=null,m(_=>{const ee=[..._],C=qo(ee,X,G);return C.conversations++,C.familiarity=Io(C),C.lastInteraction=new Date().toISOString(),ee}),setTimeout(()=>{u(_=>{const ee=new Map(_);return ee.delete(X),ee.delete(G),ee})},f1);return}const ne=W.turns[Q],pe=ne.speaker==="A"?X:G,z=ne.speaker==="A"?G:X;u(_=>{const ee=new Map(_);if(ee.set(pe,{text:ne.text,type:"social",partnerId:z,ts:Date.now()}),Q>0){const C=W.turns[Q-1].speaker==="A"?X:G;C!==pe&&ee.delete(C)}return ee}),h.current.turnIdx=Q,h.current.timer=setTimeout(()=>M(Q+1),yE)};return M(0),!0},[]);S.useEffect(()=>{const Y=setInterval(()=>{const U=y.current;if(U.length===0||h.current||Math.random()<.35&&A(U))return;const D=U.filter(te=>g.current[te.id]!=="working");if(D.length===0)return;const V=Yo(D),q=E(V.id);q&&(u(te=>{const T=new Map(te);return T.set(V.id,q),T}),setTimeout(()=>{u(te=>{const T=new Map(te),F=T.get(V.id);return F&&F.ts===q.ts&&T.delete(V.id),T})},f1))},gE);return()=>{var U;clearInterval(Y),(U=h.current)!=null&&U.timer&&clearTimeout(h.current.timer)}},[E,A]);const N=S.useCallback(Y=>{const U=o.get(Y);return(U==null?void 0:U.text)??""},[o]),L=S.useCallback((Y,U)=>{m(D=>{const V=[...D],q=qo(V,Y,U);return q.dispatches++,q.familiarity=Io(q),q.lastInteraction=new Date().toISOString(),V})},[]),H=S.useCallback(Y=>{Y.length<2||m(U=>{const D=[...U];for(let V=0;V<Y.length;V++)for(let q=V+1;q<Y.length;q++){const te=qo(D,Y[V],Y[q]);te.wavesTogether++,te.familiarity=Io(te),te.lastInteraction=new Date().toISOString()}return D})},[]);return{speeches:o,getSpeech:N,relationships:f,notifyDispatch:L,notifyWave:H}}const Py="tycono:office-chat";let EE=0;function CE(){return`chat-${Date.now()}-${++EE}`}function NE(){try{const t=localStorage.getItem(Py);if(t){const l=JSON.parse(t);return l.find(r=>r.id==="office")||l.unshift(d1()),l}}catch{}return[d1()]}function d1(){return{id:"office",name:"#office",members:[],isDefault:!0,messages:[]}}function AE(t){const l=t.map(r=>({...r,messages:r.messages.slice(-200)}));localStorage.setItem(Py,JSON.stringify(l))}function TE(){const[t,l]=S.useState(NE),[r,i]=S.useState(null),[o,u]=S.useState(new Set);S.useEffect(()=>{AE(t)},[t]);const f=S.useCallback(g=>{i(g),g&&u(v=>{const b=new Set(v);return b.delete(g),b})},[]),m=S.useCallback(g=>{const v={...g,id:CE()};l(b=>{const k=b.map(E=>E.id==="office"?g.type==="dispatch"?{...E,messages:[...E.messages,v].slice(-200)}:E:E.members.length>0&&E.members.includes(g.roleId)?{...E,messages:[...E.messages,v].slice(-200)}:E);return u(E=>{const A=new Set(E);for(const N of k){const L=b.find(H=>H.id===N.id);L&&N.messages.length>L.messages.length&&A.add(N.id)}return A}),k})},[]),x=S.useCallback((g,v)=>{const b=`ch-${Date.now()}`,k={id:b,name:g.startsWith("#")?g:`#${g}`,members:v,isDefault:!1,messages:[]};l(E=>[...E,k]),i(b)},[]),h=S.useCallback(g=>{l(v=>v.filter(b=>b.id!==g||b.isDefault)),i(v=>v===g?"office":v)},[]),y=S.useCallback((g,v)=>{l(b=>b.map(k=>k.id===g&&!k.isDefault?{...k,members:v}:k))},[]);return{channels:t,activeChannelId:r,setActiveChannelId:f,pushMessage:m,createChannel:x,deleteChannel:h,updateMembers:y,unreadChannels:o}}const DE=45e3,zE=3e3,ME=3,RE=20;function _E({roles:t,roleStatuses:l,activeExecs:r,channels:i,relationships:o,pushMessage:u,speechSettings:f,engineType:m}){const h=((f==null?void 0:f.mode)==="auto"?"template":(f==null?void 0:f.mode)??"template")==="llm",y=((f==null?void 0:f.intervalSec)??DE/1e3)*1e3,g=S.useRef(t),v=S.useRef(l),b=S.useRef(r),k=S.useRef(i),E=S.useRef(o),A=S.useRef(u),N=S.useRef(0),L=S.useRef(!1);g.current=t,v.current=l,b.current=r,k.current=i,E.current=o,A.current=u;const H=S.useCallback(async(U,D)=>{if(L.current)return!1;L.current=!0;try{if(!g.current.find(X=>X.id===U))return!1;const q=D.messages.slice(-RE).map(X=>({roleId:X.roleId,text:X.text,ts:X.ts})),te=g.current.filter(X=>D.members.includes(X.id)),T=E.current.filter(X=>X.roleA===U||X.roleB===U).map(X=>({partnerId:X.roleA===U?X.roleB:X.roleA,familiarity:X.familiarity})),F=b.current.find(X=>X.roleId===U),R=F?{currentTask:F.task,taskProgress:null}:{currentTask:null,taskProgress:null},W=await Ce.chatInChannel({channelId:D.name.replace("#",""),roleId:U,history:q,members:te.map(X=>({id:X.id,name:X.name,level:X.level})),relationships:T,workContext:R});return W.message?(A.current({ts:Date.now(),roleId:U,text:W.message,type:"chat"}),!0):!1}catch{return!1}finally{L.current=!1}},[]),Y=S.useCallback(async(U,D)=>{if(N.current>=ME){N.current=0;return}const V=U.members.filter(te=>te!==D&&v.current[te]!=="working");if(V.length===0){N.current=0;return}const q=V[Math.floor(Math.random()*V.length)];if(Math.random()>.6){N.current=0;return}setTimeout(async()=>{N.current++;const te=k.current.find(F=>F.id===U.id);if(!te)return;await H(q,te)?Y(te,q):N.current=0},zE+Math.random()*2e3)},[H]);S.useEffect(()=>{if(!h)return;const U=setInterval(async()=>{const D=g.current;if(D.length===0||L.current)return;const V=D.filter(R=>v.current[R.id]!=="working");if(V.length===0)return;const q=V[Math.floor(Math.random()*V.length)],te=k.current.filter(R=>!R.isDefault&&R.members.includes(q.id));if(te.length===0)return;const T=te[Math.floor(Math.random()*te.length)];N.current=0,await H(q.id,T)&&Y(T,q.id)},y);return()=>clearInterval(U)},[h,y,H,Y])}function Vo({type:t,className:l}){const r=S.useRef(null),i=t5(t);return S.useEffect(()=>{const o=r.current;if(!o||!i)return;const u=o.getContext("2d");u&&l5(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 e0=[[1,8],[3,5],[8,1],[5,3]],OE=[[1,4],[2,3],[4,1],[3,2]];function Xo(t){const l=t===1||t===3?-1:0,r=e0[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=e0[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=OE[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 h1={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,Wt=288,al=208,BE=4,Pe=4,Gt=28,Qt=2,Te=4,hn=Wt/2,pt=4,on={exec:{wx:Pe+pt,wy:Pe,ww:hn-Pe-pt-Te/2,wh:Gt,fx:Pe+pt,fy:Pe+Gt+Qt,fw:hn-Pe-pt-Te/2,fh:66,wallColor:"#C8B898",baseboardColor:"#6A5840"},work:{wx:hn+Te/2+pt,wy:Pe,ww:Wt-hn-Te/2-pt-Pe,wh:Gt,fx:hn+Te/2+pt,fy:Pe+Gt+Qt,fw:Wt-hn-Te/2-pt-Pe,fh:66,wallColor:"#A8B8C8",baseboardColor:"#586878"},meet:{wx:Pe+pt,wy:Pe+Gt+Qt+66+Te,ww:hn-Pe-pt-Te/2,wh:Gt,fx:Pe+pt,fy:Pe+Gt+Qt+66+Te+Gt+Qt,fw:hn-Pe-pt-Te/2,fh:70,wallColor:"#A8C8B0",baseboardColor:"#4A6A50"},comm:{wx:hn+Te/2+pt,wy:Pe+Gt+Qt+66+Te,ww:Wt-hn-Te/2-pt-Pe,wh:Gt,fx:hn+Te/2+pt,fy:Pe+Gt+Qt+66+Te+Gt+Qt,fw:Wt-hn-Te/2-pt-Pe,fh:70,wallColor:"#C8C0A8",baseboardColor:"#7A6A50"}},et=on.exec,xt=on.work,st=on.meet,Re=on.comm,fc={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C","data-analyst":"#0277BD"},nc=[{id:"meeting",label:"MEETING",icon:"🏢",color:"#3B82F6",dx:st.fx+10,dy:st.fy+14,pw:44,ph:40},{id:"bulletin",label:"BULLETIN",icon:"📋",color:"#F59E0B",dx:st.wx+6,dy:st.wy+4,pw:22,ph:16},{id:"decisions",label:"DECISIONS",icon:"📜",color:"#EF4444",dx:Re.wx+6,dy:Re.wy+6,pw:16,ph:12},{id:"knowledge",label:"KNOWLEDGE",icon:"📚",color:"#10B981",dx:Re.fx+108,dy:Re.fy+16,pw:22,ph:22}];function t0(t){return{x:t.dx,y:t.dy,w:t.pw,h:t.ph}}function n0(t){return{cx:t.dx+t.pw/2,botY:t.dy+t.ph}}const Kr={cbo:{dx:et.fx+30,dy:et.fy+14,room:"exec"},cto:{dx:et.fx+78,dy:et.fy+14,room:"exec"},pm:{dx:xt.fx+8,dy:xt.fy+10,room:"work"},engineer:{dx:xt.fx+52,dy:xt.fy+10,room:"work"},designer:{dx:xt.fx+96,dy:xt.fy+10,room:"work"},qa:{dx:st.fx+82,dy:st.fy+10,room:"meet"},"data-analyst":{dx:Re.fx+14,dy:Re.fy+14,room:"comm"}},zd={exec:et.fy+52,work:xt.fy+48,meet:st.fy+56,comm:Re.fy+42},Vt=Pe+Gt+Qt+66,Et=hn-Te/2,LE={exec_work:{type:"v",doorY:Pe+Gt+Qt+20+12,xA:Et-2,xB:xt.fx+2},meet_comm:{type:"v",doorY:Pe+Gt+Qt+66+Te+Gt+Qt+20+12,xA:Et-2,xB:Re.fx+2},exec_meet:{type:"h",doorX:Pe+pt+40+14,yA:Vt-2,yB:st.fy+2},work_comm:{type:"h",doorX:hn+Te/2+pt+40+14,yA:Vt-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:et.fx+6,y:et.fy+52},{x:et.fx+60,y:et.fy+54},{x:et.fx+112,y:et.fy+50},{x:et.fx+50,y:et.fy+52}],work:[{x:xt.fx+14,y:xt.fy+48},{x:xt.fx+44,y:xt.fy+48},{x:xt.fx+70,y:xt.fy+48},{x:xt.fx+100,y:xt.fy+48}],meet:[{x:st.fx+60,y:st.fy+56},{x:st.fx+30,y:st.fy+54},{x:st.fx+110,y:st.fy+50},{x:st.fx+80,y:st.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 Ct,Gr=null,Xr=null;function O(t,l,r,i,o,u){t=Math.round(t),l=Math.round(l),!(u!==void 0&&u<.01)&&(u!==void 0&&u!==1&&(Ct.globalAlpha=u),Ct.fillStyle=o,Ct.fillRect(t,l,r,i),u!==void 0&&u!==1&&(Ct.globalAlpha=1))}function $e(t,l,r,i){O(t,l,1,1,r,i)}let lc=1;function ti(t){lc=t}function vl(){return lc=lc*16807%2147483647,(lc&65535)/65535}function l0(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 a0(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 bl(t,l=1){const[r,i,o]=l0(t);return a0(r+15*l,Math.min(100,i+8),o-12*l)}function At(t,l=1){const[r,i,o]=l0(t);return a0(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=bl(f,.5),h=At(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){O(g.sx,i,g.sw,u,f);for(let v=0;v<u;v+=4)O(g.sx,i+v,g.sw,1,h,.08),O(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)vl()>.4&&O(g.sx+v,i,1,u,h,.04);O(g.sx,i,g.sw,2,h,.3),O(g.sx,i,g.sw,1,At(f,1),.2),O(g.sx,i+u-2,g.sw,2,x,.3),O(g.sx,i+u,g.sw,Qt,m),O(g.sx,i+u,g.sw,1,At(m,.5),.4)}l&&(O(l.x-1,i,1,u+Qt,"#4A3828"),O(l.x+l.w,i,1,u+Qt,"#4A3828"),O(l.x,i,l.w,1,"#0A0808",.12)),O(t.fx,t.fy,t.fw,3,"#0A0808",.12),O(t.fx,t.fy+3,t.fw,2,"#0A0808",.06)}function Zo(t){const l="#504038",r=bl(l,.5),i=At(l,.5),o=t.wx-pt,u=t.wy,f=t.wh+Qt+t.fh;O(o,u,pt,f,l),O(o,u,1,f,i,.3),O(o+pt-1,u,1,f,r,.4);for(let x=0;x<f;x+=6)O(o+1,u+x,pt-2,1,i,.06);const m=t.wx+t.ww;O(m,u,pt,f,l),O(m,u,1,f,i,.2),O(m+pt-1,u,1,f,r,.3)}function m1(t){const{fx:l,fy:r,fw:i,fh:o}=t,u="#B08040",f="#C89848",m="#8A6030",x="#6A4820";O(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=vl()>.5?f:u;O(b,r+h,k,4,E,.25),O(b,r+h,k,1,f,.3),O(b,r+h+4,k,1,x,.35),v>=l&&v<l+i&&O(v,r+h,1,4,x,.2),O(b,r+h+2,k,1,m,.1)}}O(l,r,i,2,"#0A0808",.08),O(l,r,2,o,"#0A0808",.06)}function p1(t){const{fx:l,fy:r,fw:i,fh:o}=t,u="#1C2A38",f="#101820";ti(99),O(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);vl()>.5&&O(l+x,r+m,h,y,At(u,.2),.15),O(l+x+2,r+m+2,h-4,y-4,At(u,.3),.08),O(l+x,r+m,h,1,f,.5),O(l+x,r+m,1,y,f,.5),O(l+x+1,r+m+1,1,y-1,At(u,.4),.1),vl()>.85&&$e(l+x+4+Math.floor(vl()*8),r+m+4+Math.floor(vl()*8),"#3A6A9A",.08)}}function FE(t){const{fx:l,fy:r,fw:i,fh:o}=t,u="#387848",f="#4A9058",m="#285E38";O(l,r,i,o,u),ti(77);for(let h=0;h<o;h+=2)for(let y=0;y<i;y+=2)vl()>.5&&$e(l+y,r+h,f,.1),vl()>.8&&$e(l+y+1,r+h+1,m,.12);const x=5;O(l+x,r+x,i-x*2,1,f,.45),O(l+x,r+o-x-1,i-x*2,1,m,.45),O(l+x,r+x,1,o-x*2,f,.35),O(l+i-x-1,r+x,1,o-x*2,m,.35)}function UE(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;O(l+h,r+x,y,g,v),O(l+h+1,r+x+1,y-2,1,At(v,.4),.2),O(l+h+1,r+x+1,1,g-2,At(v,.4),.15),O(l+h+y-2,r+x+2,1,g-3,bl(v,.4),.15),O(l+h+2,r+x+g-2,y-3,1,bl(v,.4),.15),O(l+h,r+x,y,1,m,.3),O(l+h,r+x,1,g,m,.3)}}function HE(){const t="#2A1E14",l="#3A2E24";O(0,0,Wt,Pe,t),O(0,al-Pe,Wt,Pe,t),O(0,0,Pe,al,t),O(Wt-Pe,0,Pe,al,t),O(0,0,Wt,1,l,.3),O(0,0,1,al,l,.2);const r=Pe+Gt+Qt+20,i=24,o=Pe+pt+40,u=28,f=hn+Te/2+pt+40,m=Pe+Gt+Qt+66+Te+Gt+Qt+20;O(0,Vt,o,Te,t),O(o+u,Vt,Et-o-u,Te,t),O(Et+Te,Vt,f-Et-Te,Te,t),O(f+u,Vt,Wt-f-u,Te,t),O(0,Vt,o,1,l,.3),O(o+u,Vt,Et-o-u,1,l,.3),O(Et+Te,Vt,f-Et-Te,1,l,.3),O(f+u,Vt,Wt-f-u,1,l,.3),O(Et,0,Te,r,t),O(Et,r+i,Te,Vt-r-i,t),O(Et,Vt+Te,Te,m-Vt-Te,t),O(Et,m+i,Te,al-m-i,t),O(Et,0,1,r,l,.2),O(Et,r+i,1,Vt-r-i,l,.2),O(Et,Vt+Te,1,m-Vt-Te,l,.2),O(Et,m+i,1,al-m-i,l,.2),O(Et,r,Te,i,"#C4A070"),O(Et+Te/2,r,Te/2,i,"#3A4858"),O(Et,m,Te,i,"#7AA880"),O(Et+Te/2,m,Te/2,i,"#C8B890");const x="#4A3828";O(Et,r-1,Te,1,x),O(Et,r+i,Te,1,x),O(o-1,Vt,1,Te,x),O(o+u,Vt,1,Te,x),O(f-1,Vt,1,Te,x),O(f+u,Vt,1,Te,x),O(Et,m-1,Te,1,x),O(Et,m+i,Te,1,x)}function Yr(t,l,r=14,i=12){O(t,l,r,i,"#4A3828"),O(t+1,l+1,r-2,i-2,"#5A4838"),O(t+2,l+2,r-4,i-4,"#4A7098"),O(t+2,l+2,r-4,Math.floor((i-4)/2),"#6A90B8",.35);const o=Math.floor(r/2);O(t+o,l+1,1,i-2,"#4A3828"),O(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),O(t-1,l+i,r+2,2,"#5A4838"),O(t-1,l+i,r+2,1,At("#5A4838",.5),.35)}function Jo(t,l,r){O(t,l,10,8,"#3A2818"),O(t+1,l+1,8,6,r),O(t+2,l+2,4,3,At(r,1.2),.3),$e(t+3,l+2,At(r,2),.25)}function x1(t,l){O(t,l,7,7,"#3A2818"),O(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"),O(t+3,l+1,1,2,"#333"),$e(t+4,l+3,"#D32F2F")}function $E(t,l){O(t,l,26,16,"#586878"),O(t+1,l+1,24,13,"#ECEFF1"),O(t+1,l+1,24,1,"#F5F5F5",.4),O(t+3,l+3,14,1,"#1565C0",.6),O(t+3,l+5,18,1,"#333",.2),O(t+3,l+7,12,1,"#D32F2F",.35),O(t+3,l+9,16,1,"#333",.15),O(t+1,l+14,24,2,"#708898"),O(t+3,l+14,3,1,"#D32F2F"),O(t+7,l+14,3,1,"#1565C0"),O(t+11,l+14,3,1,"#2E7D32")}function qE(t,l){O(t,l,22,16,"#6A5030"),O(t+1,l+1,20,14,"#C4A66A"),ti(88);for(let r=0;r<14;r++)for(let i=0;i<20;i++)vl()>.5&&$e(t+1+i,l+1+r,vl()>.5?"#B89858":"#D4B87A",.18);O(t+2,l+2,5,4,"#FFF176"),O(t+8,l+2,5,4,"#90CAF9"),O(t+14,l+3,5,4,"#CE93D8"),O(t+3,l+8,7,4,"#C8E6C9"),O(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){O(t,l,20,3,"#5A4030"),O(t,l,20,1,At("#5A4030",.5),.35),O(t,l+2,20,1,bl("#5A4030",.5),.3),O(t+2,l-4,3,4,"#E53935"),O(t+2,l-4,3,1,At("#E53935",1),.3),O(t+6,l-3,2,3,"#1E88E5"),O(t+9,l-5,4,5,"#43A047"),O(t+14,l-3,3,3,"#FFD54F"),$e(t+15,l-3,"#FFF176",.4)}function IE(t,l){O(t,l,16,12,"#1E1E28"),O(t+1,l+1,14,9,"#0C1420"),O(t+2,l+2,12,1,"#EF4444",.6),$e(t+2,l+4,"#4CAF50"),O(t+4,l+4,7,1,"#8b949e",.4),$e(t+2,l+6,"#FF9800"),O(t+4,l+6,5,1,"#8b949e",.3),$e(t+2,l+8,"#42A5F5"),O(t+4,l+8,8,1,"#8b949e",.25),O(t+7,l+10,2,2,"#1E1E28"),O(t+5,l+11,6,1,"#586878")}const Jt={hi:"#D4AA5C",base:"#B08040",sh:"#7A5038",deep:"#4E3028"},yl={hi:"#8A6848",base:"#604832",sh:"#3A2E24",deep:"#2A1E18"},xl={hi:"#5A6A80",base:"#485868",sh:"#364858",deep:"#283848"},Da="#100A06";function YE(t,l){O(t+2,l+16,26,3,Da,.18),O(t,l,26,10,Jt.deep),O(t+1,l+1,24,8,Jt.base),O(t+1,l+2,24,1,Jt.hi,.2),O(t+1,l+4,24,1,bl(Jt.base,.2),.1),O(t+1,l+6,24,1,Jt.hi,.15),O(t+1,l+1,24,1,Jt.hi,.4),O(t+1,l+1,1,8,Jt.hi,.2),O(t,l+10,26,5,Jt.deep),O(t+1,l+11,24,3,Jt.sh),O(t+1,l+10,24,1,bl(Jt.base,1.5),.4),O(t+1,l+14,24,1,Jt.base,.15),O(t+2,l+12,10,1,Jt.deep,.4),O(t+14,l+12,10,1,Jt.deep,.4),$e(t+7,l+11,"#C8D0D8",.6),$e(t+19,l+11,"#C8D0D8",.6),O(t+6,l-5,14,7,"#1E1E28"),O(t+7,l-4,12,5,"#0C1420"),O(t+8,l-3,5,1,"#2A6898",.6),O(t+8,l-2,8,1,"#1A3858",.4),O(t+8,l-1,3,1,"#2A6898",.35),$e(t+7,l-4,"#4A98D8",.25),$e(t+12,l+1,"#4CAF50",.4),O(t+12,l+2,2,3,"#586878"),O(t+10,l+4,6,1,"#8898A8"),O(t+6,l+4,12,4,"#222228"),O(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);O(t+20,l+5,3,4,"#333338"),O(t+20,l+5,3,1,"#444448"),O(t+1,l+3,4,4,"#F0EDE8"),O(t+1,l+3,4,1,"#F8F6F2"),$e(t+2,l+5,"#6D4C41")}function lr(t,l,r){O(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"),O(t+1,l+2,8,6,xl.base),O(t+2,l+3,6,4,xl.hi,.35),O(t+2,l+3,6,1,At(xl.hi,.5),.25),O(t+1,l+7,8,1,xl.deep),r==="up"?(O(t,l+7,10,3,xl.deep),O(t+1,l+8,8,1,xl.sh)):(O(t,l-1,10,3,xl.deep),O(t+1,l,8,1,xl.sh)),O(t,l+3,1,4,xl.sh),O(t+9,l+3,1,4,xl.sh)}function nr(t,l){O(t+2,l+11,6,2,Da,.1),O(t+2,l+8,6,4,"#8B5E3C"),O(t+1,l+7,8,2,bl("#A06E48",.3)),O(t+2,l+7,6,1,At("#A06E48",.5),.4),O(t+1,l+3,3,4,"#2E7D32"),O(t+5,l+2,3,4,"#2E7D32"),O(t+2,l+1,4,4,"#43A047"),O(t+3,l+0,3,3,"#66BB6A"),$e(t+4,l,"#81C784"),$e(t+3,l+1,"#A5D6A7",.4)}function g1(t,l,r){O(t+2,l+20,22,2,Da,.15),O(t,l,22,20,yl.deep),O(t+1,l+1,20,18,yl.base),O(t,l,22,1,yl.hi,.35),O(t,l,1,20,yl.hi,.2);for(const u of[6,12])O(t+1,l+u,20,2,yl.sh),O(t+1,l+u,20,1,yl.hi,.2);const i=["#E53935","#1E88E5","#43A047","#8E24AA","#FB8C00","#00897B","#5C6BC0"];let o=t+2;for(let u=0;u<5;u++){const f=2+u%2;O(o,l+1,f,5,i[u]),O(o,l+1,f,1,At(i[u],1),.35),o+=f+1}o=t+2;for(let u=0;u<4;u++)O(o,l+7,4,5,i[u+3]),O(o,l+7,4,1,At(i[u+3],1),.25),o+=5;O(t+2,l+14,4,4,"#FFD54F"),O(t+8,l+14,7,4,"#90CAF9"),r&&O(t,l-1,22,1,r,.7)}function VE(t,l){lr(t+4,l-4,"down"),lr(t+16,l-4,"down"),lr(t+28,l-4,"down"),O(t+3,l+24,34,3,Da,.15),O(t,l+2,36,18,Jt.deep),O(t+1,l+3,34,16,Jt.base),O(t+1,l+3,34,1,Jt.hi,.35);for(let r=0;r<14;r+=3)O(t+1,l+4+r,34,1,bl(Jt.base,.2),.08);O(t,l+20,36,4,Jt.deep),O(t+1,l+21,34,2,Jt.sh),O(t+6,l+7,10,6,"#1A1A24"),O(t+7,l+8,8,4,"#0C1420"),O(t+8,l+9,4,1,"#2A6898",.4),O(t+20,l+8,6,4,"#F0F0F0"),O(t+15,l+7,3,3,"#ECEFF1"),$e(t+16,l+8,"#795548"),lr(t+4,l+24,"up"),lr(t+16,l+24,"up"),lr(t+28,l+24,"up")}function XE(t,l){O(t+2,l+16,36,3,Da,.15),O(t,l,36,5,"#5D4037"),O(t+1,l+1,34,3,"#6D4C41"),O(t+1,l+1,34,1,At("#6D4C41",.5),.3),O(t,l+5,36,8,"#5D4037"),O(t+2,l+6,15,6,"#6D4C41"),O(t+3,l+6,13,1,At("#6D4C41",.5),.35),O(t+19,l+6,15,6,"#6D4C41"),O(t+20,l+6,13,1,At("#6D4C41",.5),.35),O(t+17,l+6,2,6,"#5D4037"),O(t,l+13,36,3,bl("#5D4037",1)),O(t-2,l+2,3,12,"#5D4037"),O(t+35,l+2,3,12,"#5D4037"),O(t+4,l+7,6,4,"#FF8A65"),O(t+5,l+7,4,1,At("#FF8A65",1),.35)}function GE(t,l){O(t+2,l+10,22,2,Da,.12),O(t,l,22,8,yl.deep),O(t+1,l+1,20,6,yl.base),O(t+1,l+1,20,1,yl.hi,.3),O(t,l+8,22,2,yl.sh),O(t+3,l+2,6,4,"#F0F0F0"),O(t+13,l+3,3,3,"#ECEFF1"),$e(t+14,l+4,"#795548")}function QE(t,l){O(t+1,l+14,10,2,Da,.12),O(t,l,10,14,"#546E7A"),O(t,l,10,1,At("#546E7A",1),.35),O(t+1,l+1,8,3,"#78909C"),O(t+1,l+5,8,4,"#37474F"),$e(t+2,l+6,"#EF5350"),$e(t+4,l+6,"#66BB6A"),O(t+2,l+11,4,2,"#ECEFF1")}const y1=new Map;function KE(t){const l=`${t.hairStyle??""}|${t.outfitStyle??""}|${t.accessory??""}`;let r=y1.get(l);if(!r){const i=Nd("mini-seated:default"),o=Ly(i,t);r=o?o.layers.flatMap(u=>u.pixels):[],y1.set(l,r)}return r}function ZE(t,l,r){My(Ct,KE(r),t,l,r)}function JE(t,l,r,i,o){lr(t+8,l+20,"up"),o||ZE(t+8,l+0+i,r),YE(t,l+14)}function WE(t,l,r,i,o){const u=i in h1?i:"down",f=o%4,m=h1[u][f];My(Ct,m,t,l,r),Ct.globalAlpha=1}function PE(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 cs(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=LE[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 r0(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 eC(t){if(t.room!==t.homeRoom){const l=r0({...t},t.homeRoom),r=l[l.length-1],i=cs((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 cs(t.x,t.y,t.homeX,t.homeY,t.room)}function tC(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=r0(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=cs(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=cs(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(on))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=cs(r.x,r.y,o.x,o.y,r.room),r.walkTimer=0}else r.state="returning",r.path=eC(r),r.walkTimer=0}function nC(t,l,r){Ct.clearRect(0,0,Wt,al),O(0,0,Wt,al,"#2A1E14"),m1(on.exec),p1(on.work),FE(on.meet),UE(on.comm);const i=Pe+pt+40,o=28,u=hn+Te/2+pt+40,f=Pe+Gt+Qt+66,m=st.fy;m1({fx:i,fy:f,fw:o,fh:m-f}),p1({fx:u,fy:f,fw:o,fh:m-f}),Ko(on.exec),Ko(on.work),Ko(on.meet,{x:i,w:o}),Ko(on.comm,{x:u,w:o}),Zo(on.exec),Zo(on.work),Zo(on.meet),Zo(on.comm),HE(),Yr(et.wx+10,et.wy+6,16,14),Jo(et.wx+34,et.wy+8,"#1565C0"),Jo(et.wx+48,et.wy+8,"#E65100"),x1(et.wx+64,et.wy+10),dd(et.wx+78,et.wy+18),Yr(et.wx+104,et.wy+6,16,14),$E(xt.wx+6,xt.wy+4),Yr(xt.wx+50,xt.wy+6,16,14),Yr(xt.wx+92,xt.wy+6,16,14),qE(st.wx+6,st.wy+4),Jo(st.wx+28,st.wy+8,"#10B981"),Yr(st.wx+80,st.wy+6,16,14),dd(st.wx+102,st.wy+18),IE(Re.wx+6,Re.wy+6),Jo(Re.wx+28,Re.wy+8,"#d4956a"),Yr(Re.wx+76,Re.wy+6,16,14),x1(Re.wx+98,Re.wy+10),dd(Re.wx+108,Re.wy+18);const x=[];x.push({y:et.fy+4,draw:()=>g1(et.fx+2,et.fy+4)}),x.push({y:et.fy+4,draw:()=>nr(et.fx+112,et.fy+4)}),x.push({y:et.fy+4,draw:()=>nr(et.fx+68,et.fy+4)}),x.push({y:xt.fy+4,draw:()=>nr(xt.fx+36,xt.fy+4)}),x.push({y:xt.fy+4,draw:()=>nr(xt.fx+80,xt.fy+4)}),x.push({y:st.fy+4,draw:()=>nr(st.fx+110,st.fy+4)}),x.push({y:st.fy+14,draw:()=>VE(st.fx+10,st.fy+14)}),x.push({y:Re.fy+4,draw:()=>QE(Re.fx+92,Re.fy+4)}),x.push({y:Re.fy+4,draw:()=>nr(Re.fx+38,Re.fy+4)}),x.push({y:Re.fy+16,draw:()=>g1(Re.fx+108,Re.fy+16,"#10B981")}),x.push({y:Re.fy+30,draw:()=>XE(Re.fx+44,Re.fy+30)}),x.push({y:Re.fy+50,draw:()=>GE(Re.fx+50,Re.fy+50)}),x.push({y:Re.fy+50,draw:()=>nr(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(JE(y.dx,y.dy,b,v?g.bobY:0,!v),v&&k){const E=fc[h]??"#388bfd";O(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:()=>WE(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();for(const h of nc){const y=Xr===h.id,g=n0(h);if(Ct.save(),Ct.globalAlpha=y?.9:.5,Ct.fillStyle=h.color,Ct.fillRect(g.cx-1,g.botY-2,3,3),y){const v=t0(h);Ct.globalAlpha=.3,Ct.strokeStyle=h.color,Ct.lineWidth=1,Ct.strokeRect(v.x-1,v.y-1,v.w+2,v.h+2)}Ct.restore()}if(Gr){const h=Kr[Gr],y=t[Gr];h&&y&&(Ct.save(),Ct.globalAlpha=.25,Ct.fillStyle=fc[Gr]??"#fff",y.state==="sitting"?Ct.fillRect(h.dx-1,h.dy+6,28,30):Ct.fillRect(Math.round(y.x)-1,Math.round(y.y)-1,14,24),Ct.restore())}}function lC({roles:t,projects:l,roleStatuses:r,activeExecs:i,onRoleClick:o,onProjectClick:u,onBulletinClick:f,onDecisionsClick:m,onKnowledgeClick:x,getRoleSpeech:h,getAppearance:y}){const g=S.useRef(null),v=S.useRef(null),b=S.useRef(null),k=S.useRef({}),E=S.useRef(0),A=S.useRef(BE),N=S.useRef({roleStatuses:r,activeExecs:i,getRoleSpeech:h,getAppearance:y});N.current={roleStatuses:r,activeExecs:i,getRoleSpeech:h,getAppearance:y};const L=S.useMemo(()=>t.map(T=>T.id).filter(T=>Kr[T]),[t]);S.useEffect(()=>{k.current=PE(L)},[L]);const H=S.useCallback(T=>{var F,R;return((R=(F=N.current).getAppearance)==null?void 0:R.call(F,T))??sh(T)},[]),Y=S.useCallback(()=>{const T=v.current,F=g.current;if(!T||!F)return;const R=T.parentElement;if(!R)return;const W=R.clientWidth,X=R.clientHeight;if(W===0||X===0)return;let G=Math.floor(Math.min(W/Wt,X/al));G=Math.max(2,Math.min(G,5)),A.current=G,F.style.width=Wt*G+"px",F.style.height=al*G+"px",T.style.width=Wt*G+"px",T.style.height=al*G+"px"},[]);S.useEffect(()=>{var M;const T=g.current;if(!T)return;const F=T.getContext("2d");if(!F)return;Ct=F,Y();const R=new ResizeObserver(()=>Y()),W=(M=v.current)==null?void 0:M.parentElement;W&&R.observe(W);let X;const G=()=>{E.current++,tC(k.current,E.current),nC(k.current,H,N.current.roleStatuses),U(),X=requestAnimationFrame(G)};return X=requestAnimationFrame(G),()=>{cancelAnimationFrame(X),R.disconnect()}},[H,Y]),S.useEffect(()=>{const T=b.current;if(!T)return;T.innerHTML="";for(const R of L){const W=fc[R]??"#8b949e",X=document.createElement("div");X.className="td-nametag",X.dataset.role=R;const G=document.createElement("span");G.className="td-dot",G.style.background=W,X.appendChild(G),X.appendChild(document.createTextNode(R.toUpperCase())),T.appendChild(X);const M=document.createElement("div");M.className="td-bubble",M.dataset.role=R,M.dataset.type="bubble",T.appendChild(M)}const F={meeting:()=>{const R=l[0];R?u(R.id):f()},bulletin:f,decisions:m,knowledge:x};for(const R of nc){const W=document.createElement("div");W.className="td-facility-label",W.dataset.facility=R.id,W.textContent=`${R.icon} ${R.label}`,W.style.borderColor=`${R.color}44`;const X=F[R.id];X&&W.addEventListener("click",X),W.addEventListener("mouseenter",()=>{Xr=R.id}),W.addEventListener("mouseleave",()=>{Xr=null}),T.appendChild(W)}},[L,l,u,f,m,x]);const U=S.useCallback(()=>{var M;const T=b.current;if(!T)return;const F=A.current,R=k.current,{getRoleSpeech:W,roleStatuses:X,activeExecs:G}=N.current;for(const Q of Object.keys(R)){const ne=R[Q],pe=Kr[Q];if(!pe)continue;let z,_,ee;ne.state==="sitting"?(z=pe.dx+13,ee=pe.dy+2,_=pe.dy+37):(z=Math.round(ne.x)+6,ee=Math.round(ne.y)-2,_=Math.round(ne.y)+18);const C=z/Wt*100,fe=T.querySelector(`.td-nametag[data-role="${Q}"]`);if(fe){fe.style.left=C+"%",fe.style.top=_*F+2+"px";const ye=fe.querySelector(".td-dot");if(ye){const ke=X[Q]==="working";ye.style.background=ke?"#FBBF24":fc[Q]??"#8b949e",ke?ye.style.animation="td-pulse 1s ease-in-out infinite":ye.style.animation=""}}const ve=T.querySelector(`.td-bubble[data-role="${Q}"]`);if(ve){const ye=X[Q]==="working",ke=(M=G.find(qe=>qe.roleId===Q))==null?void 0:M.task,He=W(Q),de=ye&&ke?ke.slice(0,30):He?He.slice(0,30):"";de&&ne.state==="sitting"?(ve.style.display="",ve.style.left=C+"%",ve.style.top=(ee-5)*F+"px",ve.textContent=de):ve.style.display="none"}}for(const Q of nc){const ne=T.querySelector(`.td-facility-label[data-facility="${Q.id}"]`);if(ne){const pe=n0(Q);ne.style.left=pe.cx/Wt*100+"%",ne.style.top=pe.botY*F+2+"px",ne.classList.toggle("td-facility-label--hover",Xr===Q.id)}}},[]),D=S.useCallback(T=>{const F=g.current;if(!F)return null;const R=F.getBoundingClientRect(),W=A.current,X=(T.clientX-R.left)/W,G=(T.clientY-R.top)/W,M=k.current;for(const[Q,ne]of Object.entries(Kr)){if(!M[Q])continue;const pe=M[Q];if(pe.state==="sitting"){if(X>=ne.dx&&X<=ne.dx+26&&G>=ne.dy&&G<=ne.dy+40)return{type:"role",id:Q}}else if(X>=pe.x-2&&X<=pe.x+14&&G>=pe.y-2&&G<=pe.y+20)return{type:"role",id:Q}}for(const Q of nc){const ne=t0(Q);if(X>=ne.x&&X<=ne.x+ne.w&&G>=ne.y&&G<=ne.y+ne.h)return{type:"facility",id:Q.id}}return null},[]),V=S.useCallback(T=>{const F=D(T),R=g.current;Gr=(F==null?void 0:F.type)==="role"?F.id:null,Xr=(F==null?void 0:F.type)==="facility"?F.id:null,R&&(R.style.cursor=F?"pointer":"default")},[D]),q=S.useCallback(()=>{Gr=null,Xr=null,g.current&&(g.current.style.cursor="default")},[]),te=S.useCallback(T=>{const F=D(T);if(F){if(F.type==="role"){o(F.id);return}switch(F.id){case"meeting":{const R=l[0];R?u(R.id):f();break}case"bulletin":f();break;case"decisions":m();break;case"knowledge":x();break}}},[D,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:Wt,height:al,className:"td-canvas",onClick:te,onMouseMove:V,onMouseLeave:q}),c.jsx("div",{ref:b,className:"td-overlay"})]})})}function aC({role:t,appearance:l,onSave:r,onReset:i,onClose:o,theme:u,onThemeChange:f,onUpdateName:m,initialTab:x,speechSettings:h,onSpeechSettingsChange:y}){var V;const[g,v]=S.useState(x??"character"),[b,k]=S.useState({...l}),[E,A]=S.useState(t.name),[N,L]=S.useState(!1),H=S.useCallback(()=>k(tc()),[]),Y=S.useCallback(()=>{const q=sh(t.id);k({...q}),i()},[t.id,i]),U=S.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]),D=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=>A(q.target.value),disabled:N,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(Zy,{roleId:t.id,appearance:b,onChange:k,onRandomize:H,onReset:Y,label:D})}):g==="office"?c.jsx("div",{className:"customize-body",children:c.jsx("div",{className:"customize-themes",children:Object.entries(Na).map(([q,te])=>c.jsxs("button",{className:`customize-theme-card ${u===q?"active":""}`,onClick:()=>f(q),children:[c.jsxs("div",{className:"customize-theme-preview",style:{background:te.vars["--floor-light"],borderColor:te.vars["--pixel-border"]},children:[c.jsx("div",{style:{background:te.vars["--hud-bg"],height:8,borderBottom:`2px solid ${te.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:te.vars["--accent"],borderRadius:1}}),c.jsx("div",{style:{width:10,height:14,background:te.vars["--active-green"],borderRadius:1}}),c.jsx("div",{style:{width:10,height:14,background:te.vars["--idle-amber"],borderRadius:1}})]}),c.jsx("div",{style:{background:te.vars["--hud-bg"],height:6,borderTop:`2px solid ${te.vars["--pixel-border"]}`}})]}),c.jsxs("div",{className:"customize-theme-name",children:[te.icon," ",te.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: $",((V=h==null?void 0:h.dailyBudgetUsd)==null?void 0:V.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:U,children:"SAVE"})]})]})})}function v1(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 rC({status:t,history:l,onClose:r,onSave:i,onLoadHistory:o,onRestore:u,saving:f}){const[m,x]=S.useState("save"),[h,y]=S.useState(""),[g,v]=S.useState(null),[b,k]=S.useState(!1),[E,A]=S.useState(null),N=S.useRef(null);S.useEffect(()=>{m==="history"&&o()},[m,o]),S.useEffect(()=>{var D;(D=N.current)==null||D.focus()},[]);const L=[...((t==null?void 0:t.modified)??[]).map(D=>({status:"M",file:D})),...((t==null?void 0:t.untracked)??[]).map(D=>({status:"A",file:D}))],H=async()=>{v(null),A(null);try{const D=await i(h||void 0);A(D),y("")}catch(D){v(D instanceof Error?D.message:"Save failed")}},Y=async D=>{if(confirm(`Restore from commit ${D.slice(0,7)}? This creates a new commit with those files.`)){k(!0);try{await u(D),k(!1)}catch(V){v(V instanceof Error?V.message:"Restore failed"),k(!1)}}};S.useEffect(()=>{const D=V=>{V.key==="Escape"&&r()};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[r]);const U=D=>{D.key==="Enter"&&(D.metaKey||D.ctrlKey)&&H()};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:U,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(D=>c.jsx("button",{onClick:()=>x(D),className:"flex-1 py-2 text-[11px] font-bold uppercase tracking-wider cursor-pointer",style:{background:m===D?"var(--hud-bg-alt)":"transparent",color:m===D?"var(--terminal-text)":"var(--terminal-text-muted)",borderBottom:m===D?"2px solid var(--accent)":"2px solid transparent"},children:D==="save"?"SAVE":"HISTORY"},D))}),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:D,file:V})=>c.jsxs("div",{className:"flex gap-2",children:[c.jsx("span",{style:{color:D==="A"?"var(--active-green)":"var(--idle-amber)",width:"14px"},children:D}),c.jsx("span",{style:{color:"var(--terminal-text-secondary)"},children:V})]},V))})]}),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:N,type:"text",value:h,onChange:D=>y(D.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:H,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," (",v1(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(D=>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:D.shortSha}),c.jsx("span",{className:"text-[11px] truncate",style:{color:"var(--terminal-text)"},children:D.message})]}),c.jsx("div",{className:"text-[10px]",style:{color:"var(--terminal-text-muted)"},children:v1(D.date)})]}),c.jsx("button",{onClick:()=>Y(D.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"})]},D.sha))})]})]})]})]})}const iC={cto:"🏗️",cbo:"📊",pm:"📋",engineer:"⚙️",designer:"🎨",qa:"🔍","data-analyst":"📊"},Rd={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C","data-analyst":"#0277BD"},sC={cto:8,cbo:7,pm:6,engineer:5,designer:5,qa:4,"data-analyst":4},oC={cto:"아키텍처",cbo:"시장 분석",pm:"PRD 작성",engineer:"코딩",designer:"시안 제작",qa:"품질 검증"};function cC(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 uC({importJob:t,onImportDone:l}){var cr,ii,Fa;const[r,i]=S.useState([]),[o,u]=S.useState([]),[f,m]=S.useState([]),[x,h]=S.useState([]),[y,g]=S.useState([]),[v,b]=S.useState([]),[k,E]=S.useState("TYCONO"),[A,N]=S.useState(!0),[L,H]=S.useState(null),[Y,U]=S.useState({type:"none"}),[D,V]=S.useState(null),[q,te]=S.useState(null),[T,F]=S.useState([]),[R,W]=S.useState(!1),[X,G]=S.useState([]),[M,Q]=S.useState(0),[ne,pe]=S.useState(!1),[z,_]=S.useState({}),[ee,C]=S.useState("ceo"),[fe,ve]=S.useState(null),[ye,ke]=S.useState(!1),[He,de]=S.useState(!1),[qe,Tt]=S.useState(null),[vt,Rn]=S.useState({}),[ut,cn]=S.useState([]),[xn,St]=S.useState([]),{getAppearance:Dt,setAppearance:zt,resetAppearance:un,theme:ft,setTheme:Pt,speechSettings:Xn,setSpeechSettings:Mt}=hE(),[Sn,ae]=S.useState(null),[me,Ee]=S.useState("character"),ie=pE(),[xe,rt]=S.useState(!1);S.useEffect(()=>{const I=ce=>{(ce.metaKey||ce.ctrlKey)&&ce.key==="s"&&(ce.preventDefault(),ie.dirtyCount>0&&rt(!0))};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[ie.dirtyCount]);const[nt,Be]=S.useState(null),[ue,Qe]=S.useState(null),[Ie,_n]=S.useState([]),[en,vs]=S.useState(!1),za=S.useRef(!1),Yl=S.useRef(null);let Ma=S.useRef(0);const gn=(I,ce,ge)=>{const we={id:Ma.current++,type:I,text:ce,detail:ge};_n(je=>[...je,we])};S.useEffect(()=>{var I;en&&((I=Yl.current)==null||I.scrollIntoView({behavior:"smooth"}))},[Ie,en]),S.useEffect(()=>{t&&(za.current||(za.current=!0,Qe("Scanning knowledge sources..."),_n([{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 je;const ce=(je=I.body)==null?void 0:je.getReader();if(!ce)return;const ge=new TextDecoder;let we="";for(;;){const{done:Ae,value:Me}=await ce.read();if(Ae)break;we+=ge.decode(Me,{stream:!0});const Je=we.split(`
|
|
83
|
-
`);we=Je.pop()||"";let Ye="";for(const Le of Je)if(Le.startsWith("event: "))Ye=Le.slice(7).trim();else if(Le.startsWith("data: ")&&Ye){try{const Nt=JSON.parse(Le.slice(6));switch(Ye){case"scanning":Qe(`Scanning: ${Nt.path} (${Nt.fileCount} files)`),gn("scan",`Found ${Nt.fileCount} files`,Nt.path);break;case"processing":Be({index:Nt.index,total:Nt.total}),Qe(`Importing knowledge... (${Nt.index}/${Nt.total})`),gn("process",`Processing: ${Nt.file}`,`${Nt.index} / ${Nt.total}`);break;case"created":gn("created",Nt.title,Nt.summary);break;case"skipped":gn("process",`Skipped: ${Nt.file}`,Nt.reason);break;case"done":Qe(null),Be(null),gn("done",`Import complete! ${Nt.created} created, ${Nt.skipped} skipped.`),Ot(`Knowledge import complete! ${Nt.created} documents imported.`,"#2E7D32"),l==null||l();break;case"error":Qe(null),Be(null),gn("error",Nt.message),Ot(`Import failed: ${Nt.message}`,"#B71C1C"),l==null||l();break}}catch{}Ye=""}}}).catch(I=>{Qe(null),gn("error",I.message),Ot(`Import error: ${I.message}`,"#B71C1C"),l==null||l()})))},[t]);const[Vl,Xl]=S.useState("card"),[bs,ws]=S.useState(typeof window<"u"?window.innerWidth:1200);S.useEffect(()=>{const I=()=>ws(window.innerWidth);return window.addEventListener("resize",I),()=>window.removeEventListener("resize",I)},[]);const Ra=bs<1024,[fn,Gl]=S.useState(!1),[Ql,ks]=S.useState(560),[_a,nn]=S.useState([]),[Kl,rl]=S.useState(null),[ni,Gn]=S.useState(null),{sendMessage:Kt}=uE();S.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=>H(`Failed to load: ${I.message}`)).finally(()=>N(!1))},[]),S.useEffect(()=>{Ce.deleteEmptySessions().catch(()=>{}),Ce.getSessions().then(I=>{I.length>0&&Promise.all(I.map(ce=>Ce.getSession(ce.id))).then(ce=>{nn(ce),rl(ce[0].id),Gl(!0)}).catch(ce=>{console.error("Failed to load session details",ce)})}).catch(I=>{console.error("Failed to load sessions",I)})},[]),S.useEffect(()=>{const I=()=>{fetch("/api/exec/status").then(ge=>ge.json()).then(ge=>{Rn(ge.statuses??{}),cn(ge.activeExecutions??[])}).catch(()=>{})};I();const ce=setInterval(I,3e3);return()=>clearInterval(ce)},[]),S.useEffect(()=>{Y.type==="role"?Ce.getRole(Y.roleId).then(V).catch(console.error):V(null)},[Y]);const Ft=()=>U({type:"none"}),Zl=async(I,ce)=>{const ge=r.find(je=>je.id===I),we=(q==null?void 0:q.mode)==="ask";te(null);try{const{jobId:je}=await Ce.startJob({type:"assign",roleId:I,task:ce,readOnly:we}),Ae=Rd[I]??"#666",Me=`${I.toUpperCase()} · ${(ge==null?void 0:ge.name)??I}`;pe(!1),F([{jobId:je,title:Me,color:Ae}]),yn.pushMessage({ts:Date.now(),roleId:"ceo",text:`[CEO → ${(ge==null?void 0:ge.name)??I}] ${we?"Ask":"Assign"}: ${ce}`,type:"dispatch",targetRoleId:I})}catch(je){Ot(`Failed to start job: ${je instanceof Error?je.message:"unknown"}`,"#C62828")}},Ot=(I,ce)=>{const ge=Date.now();St(we=>[...we,{id:ge,message:I,color:ce}]),setTimeout(()=>St(we=>we.filter(je=>je.id!==ge)),4e3)},bc=()=>{var ce;const I=T[T.length-1];I&&(Ot(`${I.title} completed`,I.color),yn.pushMessage({ts:Date.now(),roleId:((ce=I.title.split(" · ")[0])==null?void 0:ce.toLowerCase())??"unknown",text:`[${I.title}] Job completed`,type:"dispatch"})),Ce.getStandups().then(m).catch(console.error),Ce.getCompany().then(ge=>i(ge.roles)).catch(console.error)},wc=async I=>{W(!1);try{const ce=await Ce.startJob({type:"wave",directive:I}),ge=ce.jobIds??(ce.jobId?[ce.jobId]:[]),we=r.filter(Ae=>Ae.level==="c-level"),je=ge.map((Ae,Me)=>{var Je,Ye;return{jobId:Ae,roleId:((Je=we[Me])==null?void 0:Je.id)??`role-${Me}`,roleName:((Ye=we[Me])==null?void 0:Ye.name)??`C-Level ${Me+1}`}});yn.pushMessage({ts:Date.now(),roleId:"ceo",text:`[CEO WAVE] "${I}" → ${je.map(Ae=>Ae.roleName).join(", ")}`,type:"dispatch"}),Object.keys(z).length>0?(ve({directive:I,rootJobs:je}),ke(!1)):(G(je),Q(0),pe(!1),je.length>0&&F([{jobId:je[0].jobId,title:`CEO WAVE · ${je[0].roleId.toUpperCase()}`,color:"#B71C1C"}]))}catch(ce){Ot(`Failed to start wave: ${ce instanceof Error?ce.message:"unknown"}`,"#C62828")}},li=()=>{Ce.getWaves().then(h).catch(console.error),Ce.getStandups().then(m).catch(console.error)},kl=()=>{Ce.getCompany().then(I=>i(I.roles)).catch(console.error)},ai=async(I,ce)=>{await Ce.createRole(I),zt(I.id,ce),kl(),Ot(`${I.name} hired!`,"#2E7D32")},Jl=async I=>{await Ce.deleteRole(I),kl(),Tt(null),Ot(`${I.toUpperCase()} removed`,"#B71C1C")},Sl=async(I,ce)=>{await Ce.updateRole(I,ce),kl(),ce.name&&Ot(`${I.toUpperCase()} renamed to "${ce.name}"`,"#1565C0")},Oa=I=>{Gl(!0)},Wl=async I=>{try{const ce=await Ce.createSession(I,"talk");nn(ge=>[ce,...ge]),rl(ce.id),Gl(!0)}catch(ce){console.error("Failed to create session",ce),Ot(`Failed to create session: ${ce instanceof Error?ce.message:"API unreachable"}`,"#B71C1C")}},Ut=async I=>{try{const ce=await Ce.createSession(I,"talk");nn(ge=>[ce,...ge]),rl(ce.id)}catch(ce){console.error("Failed to create session",ce),Ot(`Failed to create session: ${ce instanceof Error?ce.message:"API unreachable"}`,"#B71C1C")}},Ss=I=>{const ce=_a.find(ge=>ge.roleId===I);ce&&rl(ce.id),Gl(!0)},js=async I=>{try{await Ce.deleteSession(I),nn(ce=>{var we;const ge=ce.filter(je=>je.id!==I);return Kl===I&&rl(((we=ge[0])==null?void 0:we.id)??null),ge})}catch(ce){console.error("Failed to delete session",ce),Ot(`Failed to close session: ${ce instanceof Error?ce.message:"API error"}`,"#B71C1C")}},jl=async()=>{try{const{ids:I}=await Ce.deleteEmptySessions();if(I.length===0)return;nn(ce=>{var we;const ge=ce.filter(je=>!I.includes(je.id));return Kl&&I.includes(Kl)&&rl(((we=ge[0])==null?void 0:we.id)??null),ge}),Ot(`Cleared ${I.length} empty session${I.length!==1?"s":""}`,"#2E7D32")}catch(I){Ot(`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=_a.map(ce=>ce.id);try{await Ce.deleteSessions(I),nn([]),rl(null),Ot("All sessions closed","#2E7D32")}catch(ce){Ot(`Failed to close sessions: ${ce instanceof Error?ce.message:"API error"}`,"#B71C1C")}},fl=(I,ce)=>{nn(ge=>ge.map(we=>{if(we.id!==I)return we;const je=[...we.messages],Ae=je[je.length-1];if(Ae&&Ae.from==="role"&&Ae.status==="streaming"){const Me=[...Ae.streamEvents??[],ce];je[je.length-1]={...Ae,streamEvents:Me}}return{...we,messages:je}}))},ri=(I,ce,ge)=>{const we={id:`msg-${Date.now()}-ceo`,from:"ceo",content:ce,type:ge==="do"?"directive":"conversation",status:"done",timestamp:new Date().toISOString()},je={id:`msg-${Date.now()+1}-role`,from:"role",content:"",type:"conversation",status:"streaming",timestamp:new Date().toISOString(),streamEvents:[]};nn(Ae=>Ae.map(Me=>Me.id===I?{...Me,messages:[...Me.messages,we,je],updatedAt:new Date().toISOString()}:Me)),Gn(I),Kt(I,ce,ge,{onThinking:Ae=>{nn(Me=>Me.map(Je=>{if(Je.id!==I)return Je;const Ye=[...Je.messages],Le=Ye[Ye.length-1];return Le&&Le.from==="role"&&Le.status==="streaming"&&(Ye[Ye.length-1]={...Le,thinking:(Le.thinking??"")+Ae}),{...Je,messages:Ye}})),fl(I,{type:"thinking",timestamp:Date.now(),text:Ae})},onText:Ae=>{nn(Me=>Me.map(Je=>{if(Je.id!==I)return Je;const Ye=[...Je.messages],Le=Ye[Ye.length-1];return Le&&Le.from==="role"&&Le.status==="streaming"&&(Ye[Ye.length-1]={...Le,content:Le.content+Ae}),{...Je,messages:Ye}}))},onToolUse:(Ae,Me)=>{fl(I,{type:"tool",timestamp:Date.now(),toolName:Ae,toolInput:Me})},onDispatch:(Ae,Me)=>{fl(I,{type:"dispatch",timestamp:Date.now(),roleId:Ae,task:Me})},onDispatchProgress:(Ae,Me,Je)=>{var Ye;Me==="tool"?fl(I,{type:"dispatch:progress",timestamp:Date.now(),roleId:Ae,progressType:"tool",toolName:Je.name,toolInput:Je.input}):Me==="thinking"?fl(I,{type:"dispatch:progress",timestamp:Date.now(),roleId:Ae,progressType:"thinking",text:Je.text}):Me==="text"?fl(I,{type:"dispatch:progress",timestamp:Date.now(),roleId:Ae,progressType:"text",text:(Ye=Je.text)==null?void 0:Ye.slice(-200)}):(Me==="done"||Me==="error")&&fl(I,{type:"dispatch:progress",timestamp:Date.now(),roleId:Ae,progressType:Me})},onTurn:Ae=>{fl(I,{type:"turn",timestamp:Date.now(),turn:Ae})},onDone:()=>{nn(Ae=>Ae.map(Me=>{if(Me.id!==I)return Me;const Je=Me.messages.map(Le=>Le.status==="streaming"?{...Le,status:"done"}:Le),Ye=Me.messages.length<=2?ce.slice(0,40).replace(/\n/g," "):Me.title;return{...Me,messages:Je,title:Ye}})),Gn(null)},onError:Ae=>{nn(Me=>Me.map(Je=>{if(Je.id!==I)return Je;const Ye=Je.messages.map(Le=>Le.status==="streaming"?{...Le,status:"error",content:Le.content||Ae}:Le);return{...Je,messages:Ye}})),Gn(null)}})},Es=(I,ce)=>{nn(ge=>ge.map(we=>we.id===I?{...we,mode:ce}:we)),Ce.updateSession(I,{mode:ce}).catch(console.error)},kc=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"},il=I=>{const ce=Ba[I];if(!ce)return"";for(const ge of f){const we=ge.content,je=we.indexOf(`## ${ce}`);if(je===-1)continue;const Ae=we.indexOf(`
|
|
84
|
-
## `,je+10),Je=(Ae===-1?we.slice(je):we.slice(je,Ae)).split(`
|
|
85
|
-
`).filter(Ye=>Ye.trim().length>0);for(const Ye of Je){const Le=Ye.replace(/^#+\s*/,"").replace(/\*\*/g,"").replace(/^[-*]\s+/,"").trim();if(!(Le.startsWith("|")||Le.startsWith("{")||Le.startsWith("[")||Le.startsWith("```")||Le.startsWith("---")||Le.includes("Journal")||Le.includes("(c-level)")||Le.includes("(team-lead)")||Le.includes("(member)")||/^(CEO |작업 결과|생성\/수정|APPROVAL|비고|상황 보고|태스크$)/.test(Le))&&Le.length>15&&Le.length<120)return Le.slice(0,80)}}return""},jn=I=>{const ce=Ba[I];if(!ce)return"";for(const ge of f){const we=ge.content,je=we.indexOf(`## ${ce}`);if(je===-1)continue;const Ae=we.indexOf(`
|
|
86
|
-
## `,je+10),Je=(Ae===-1?we.slice(je):we.slice(je,Ae)).replace(/^## .+\n/,"").trim();if(Je)return Je.slice(0,1500)}return""},yn=TE(),La=jE({roles:r,roleStatuses:vt,activeExecs:ut,getStandupSpeech:il});return _E({roles:r,roleStatuses:vt,activeExecs:ut,channels:yn.channels,relationships:La.relationships,pushMessage:yn.pushMessage,speechSettings:Xn,engineType:void 0}),A?c.jsxs("div",{className:"h-screen flex flex-col bg-[var(--floor-light)]",style:{fontFamily:"var(--pixel-font)"},children:[(ue||Ie.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:()=>vs(I=>!I),children:[ue?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:ue||"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:en?"▲":"▼"})]}),en&&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:[Ie.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})]}),ut.length>0&&c.jsxs("span",{className:"text-amber-400",children:["Working: ",c.jsx("strong",{children:ut.length})]}),c.jsxs("button",{onClick:()=>ie.state!=="no-git"&&rt(!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:ie.state==="no-git"?.5:1,cursor:ie.state==="no-git"?"default":"pointer"},title:ie.state==="no-git"?'No git repository — run "git init" to enable save':ie.state==="dirty"?`${ie.dirtyCount} unsaved changes`:"All saved",children:[c.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:ie.state==="no-git"?"var(--terminal-text-muted)":ie.state==="saving"||ie.state==="dirty"?"var(--idle-amber)":ie.state==="error"?"#EF5350":"var(--active-green)",animation:ie.state==="saving"?"pulse 1s infinite":void 0}}),c.jsx("span",{children:kc})]})]})]}),(ue||Ie.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:()=>vs(I=>!I),children:[ue?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:ue||"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:en?"▲":"▼"})]}),en&&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:[Ie.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}),Ie.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(lC,{roles:r,projects:o,waves:x,standups:f,decisions:y,roleStatuses:vt,activeExecs:ut,onRoleClick:I=>U({type:"role",roleId:I}),onProjectClick:I=>U({type:"project",projectId:I}),onBulletinClick:()=>U({type:"bulletin"}),onDecisionsClick:()=>U({type:"decisions"}),onKnowledgeClick:()=>U({type:"knowledge"}),knowledgeDocsCount:v.length,getRoleSpeech:La.getSpeech,getAppearance:Dt}):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"),ce=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 we;return c.jsx(b1,{role:ge,speech:La.getSpeech(ge.id),onClick:()=>U({type:"role",roleId:ge.id}),liveStatus:vt[ge.id],activeTask:(we=ut.find(je=>je.roleId===ge.id))==null?void 0:we.task,featured:!0,appearance:Dt(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:[ce.map(ge=>{var we;return c.jsx(b1,{role:ge,speech:La.getSpeech(ge.id),onClick:()=>U({type:"role",roleId:ge.id}),liveStatus:vt[ge.id],activeTask:(we=ut.find(je=>je.roleId===ge.id))==null?void 0:we.task,appearance:Dt(ge.id)},ge.id)}),c.jsx("div",{className:"pixel-card pixel-card--hire",onClick:()=>de(!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?()=>U({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:()=>U({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:()=>U({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:()=>U({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:Ra?"absolute inset-0 z-50":"contents",children:c.jsx(cE,{sessions:_a,activeSessionId:Kl,roles:r,streamingSessionId:ni,width:Ra?bs:Ql,onWidthChange:Ra?void 0:ks,onSwitchSession:rl,onCloseSession:js,onCreateSession:Wl,onClearEmpty:jl,onCloseAll:Pl,onSendMessage:ri,onModeChange:Es,onCloseTerminal:()=>Gl(!1),chatChannels:yn.channels,activeChatChannelId:yn.activeChannelId,onSwitchChatChannel:yn.setActiveChannelId,onCreateChatChannel:yn.createChannel,onDeleteChatChannel:yn.deleteChannel,onUpdateChatMembers:yn.updateMembers,unreadChannels:yn.unreadChannels})})]}),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:()=>{Ee("office"),ae(r[0]??null)},title:"Customize",children:[((cr=Na[ft])==null?void 0:cr.icon)??""," ",((ii=Na[ft])==null?void 0:ii.name)??"THEME"]}),c.jsx("span",{className:"mx-1",children:"|"}),c.jsx("span",{style:{color:ie.state==="dirty"?"var(--idle-amber)":"var(--terminal-text-muted)"},children:ie.state==="no-git"?"No git":ie.state==="saving"?"Saving...":ie.state==="dirty"?`${ie.dirtyCount} unsaved`:ie.lastSaved?`Saved ${(()=>{const I=Math.floor((Date.now()-new Date(ie.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:[fe&&ye&&c.jsx("button",{onClick:()=>ke(!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"}),T.length>0&&ne&&c.jsxs("button",{onClick:()=>pe(!1),className:"px-3 py-1 font-black text-white cursor-pointer animate-pulse",style:{background:T[T.length-1].color,border:`2px solid ${T[T.length-1].color}88`,fontFamily:"var(--pixel-font)",borderRadius:4},children:[T[T.length-1].title.slice(0,20),T[T.length-1].title.length>20?"..":""]}),c.jsxs("button",{onClick:()=>W(!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"]})]}),Y.type==="role"&&D&&(()=>{const I=ut.find(ce=>ce.roleId===D.id);return c.jsx(M5,{role:D,allRoles:r,recentActivity:jn(D.id),onClose:Ft,onFireRole:(ce,ge)=>{Tt({roleId:ce,roleName:ge}),Ft()},terminalWidth:fn?Ql:0,activeJobId:I==null?void 0:I.id,activeTask:I==null?void 0:I.task,isWorking:vt[D.id]==="working",jobStartedAt:I==null?void 0:I.startedAt,onStopJob:ce=>Ce.abortJob(ce),sessions:_a,streamingSessionId:ni,onCreateSessionSilent:Ut,onSendMessage:ri,onFocusTerminal:Ss,onCustomize:ce=>{const ge=r.find(we=>we.id===ce);ge&&(Ee("character"),ae(ge))},onUpdateRole:Sl,appearance:Dt(D.id),relationships:La.relationships})})(),Y.type==="project"&&On&&c.jsx(Nj,{projectId:On.id,onClose:Ft,terminalWidth:fn?Ql:0}),(Y.type==="bulletin"||Y.type==="decisions")&&c.jsx(Ej,{standups:f,waves:x,decisions:y,mode:Y.type==="bulletin"?"bulletin":"decisions",onClose:Ft,terminalWidth:fn?Ql:0}),Y.type==="knowledge"&&c.jsx(jj,{docs:v,onClose:Ft,onRefresh:()=>Ce.getKnowledge().then(b).catch(()=>{}),terminalWidth:fn?Ql:0,initialDocId:Y.docId}),q&&c.jsx(Dj,{roleId:q.roleId,roleName:q.roleName,mode:q.mode,onClose:()=>te(null),onExecutionStart:Zl}),fe&&!ye&&c.jsx(Fj,{directive:fe.directive,rootJobs:fe.rootJobs,orgNodes:z,rootRoleId:ee,onClose:()=>{ve(null),ke(!1)},onMinimize:()=>ke(!0),onDone:()=>{li(),Ot("Wave complete","#2E7D32")},onOpenKnowledgeDoc:I=>{ve(null),ke(!1),U({type:"knowledge",docId:I}),Ce.getKnowledge().then(b).catch(()=>{})}}),T.length>0&&!ne&&(()=>{var ge;const I=T[T.length-1],ce=X.length>1;return c.jsxs(c.Fragment,{children:[ce&&T.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:X.map((we,je)=>c.jsx("button",{onClick:()=>{Q(je),F([{jobId:we.jobId,title:`CEO WAVE · ${we.roleId.toUpperCase()}`,color:"#B71C1C"}])},className:"px-3 py-1.5 text-xs font-bold rounded-t-lg cursor-pointer transition-colors",style:{background:M===je?"#B71C1C":"var(--terminal-bg)",color:M===je?"#fff":"var(--terminal-text-secondary)",border:`1px solid ${M===je?"#B71C1C":"var(--terminal-border)"}`,borderBottom:"none"},children:we.roleId.toUpperCase()},we.jobId))}),c.jsx(zj,{jobId:I.jobId,title:T.length>1?I.title:ce?`CEO WAVE · ${((ge=X[M])==null?void 0:ge.roleName)??""}`:I.title,color:I.color,variant:"modal",style:ce&&T.length===1?{marginTop:28}:void 0,onClose:()=>{F([]),G([]),Q(0),pe(!1)},onMinimize:()=>pe(!0),onDone:()=>{bc(),li()},onNavigateToJob:we=>{Ce.getJob(we).then(je=>{const Ae=Rd[je.roleId]??"#888";F(Me=>[...Me,{jobId:we,title:`${je.roleId.toUpperCase()} · ${je.task.slice(0,40)}`,color:Ae}])}).catch(console.error)},onOpenKnowledgeDoc:we=>{F([]),G([]),Q(0),pe(!1),U({type:"knowledge",docId:we}),Ce.getKnowledge().then(b).catch(()=>{})}},I.jobId)]})})(),T.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:()=>F(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 ",(Fa=T[T.length-2])==null?void 0:Fa.title]})})}),R&&c.jsx(Rj,{cLevelRoles:r.filter(I=>I.level==="c-level"),orgNodes:z,rootId:ee,onClose:()=>W(!1),onDispatch:wc}),He&&c.jsx(Yj,{existingRoles:r,onClose:()=>de(!1),onHire:ai}),qe&&c.jsx(Vj,{roleId:qe.roleId,roleName:qe.roleName,onClose:()=>Tt(null),onConfirm:Jl}),Sn&&c.jsx(aC,{role:Sn,appearance:Dt(Sn.id),onSave:I=>zt(Sn.id,I),onReset:()=>un(Sn.id),onClose:()=>{ae(null),Ee("character")},theme:ft,onThemeChange:Pt,onUpdateName:async(I,ce)=>{await Sl(I,{name:ce})},initialTab:me,speechSettings:Xn,onSpeechSettingsChange:Mt}),xe&&c.jsx(rC,{status:ie.status,history:ie.history,onClose:()=>rt(!1),onSave:async I=>await ie.save(I),onLoadHistory:ie.loadHistory,onRestore:ie.restore,saving:ie.state==="saving"}),c.jsx("div",{className:"fixed top-16 right-4 z-[70] flex flex-col gap-2",children:xn.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 b1({role:t,speech:l,onClick:r,liveStatus:i,activeTask:o,featured:u,appearance:f}){const m=Rd[t.id]??cC(t.id),x=sC[t.id]??1,h=oC[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(yc,{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?"🛠️":iC[t.id]??"👤"}),c.jsx("span",{className:"pixel-card-task-text",children:g||h})]})]})}function md({onSelect:t,onClose:l}){const[r,i]=S.useState(null),[o,u]=S.useState(!0),f=S.useCallback(async m=>{u(!0);try{const x=await Ce.browse(m);i(x)}catch{}finally{u(!1)}},[]);return S.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 fC={engine:"AI Engine",company:"Company Info",project:"Project",knowledge:"Knowledge",team:"Team Template",create:"Create"};function w1(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 dC({onComplete:t}){const[l,r]=S.useState(0),[i,o]=S.useState(null),[u,f]=S.useState("none"),[m,x]=S.useState(""),[h,y]=S.useState(!0),[g,v]=S.useState(""),[b,k]=S.useState(""),E=S.useRef(null),[A,N]=S.useState("fresh"),[L,H]=S.useState(""),[Y,U]=S.useState(null),[D,V]=S.useState(!1),[q,te]=S.useState(!1),[T,F]=S.useState("skip"),[R,W]=S.useState([]),[X,G]=S.useState(""),[M,Q]=S.useState(!1),[ne,pe]=S.useState(""),[z,_]=S.useState(null),[ee,C]=S.useState(!1),[fe,ve]=S.useState(!1),[ye,ke]=S.useState([]),[He,de]=S.useState("startup"),[qe,Tt]=S.useState(!1),[vt,Rn]=S.useState(!1),[ut,cn]=S.useState(null),[xn,St]=S.useState([]),[Dt,zt]=S.useState(!1),un=S.useMemo(()=>w1(T),[T]),ft=un[l]??"engine";S.useEffect(()=>{Ce.detectEngine().then(ue=>{o(ue),f(ue.recommended),y(!1)}).catch(()=>y(!1)),Ce.getTeams().then(ke).catch(()=>{})},[]),S.useEffect(()=>{var ue;ft==="company"&&((ue=E.current)==null||ue.focus())},[ft]);const Pt=()=>{switch(ft){case"engine":return u!=="none"||m.length>10;case"company":return g.trim().length>0;case"project":return A==="fresh"||A==="existing"&&Y===!0;case"knowledge":return T==="existing-akb"?z===!0:T==="import"?R.length>0:!0;case"team":return!0;case"create":return!vt;default:return!1}},Xn=()=>{l<un.length-1&&Pt()&&r(l+1),ft==="create"&&!qe&&!Dt&&(T==="existing-akb"?ie():Ee())},Mt=()=>{l>0&&r(l-1)};S.useEffect(()=>{const ue=w1(T);l>=ue.length&&r(ue.length-1)},[T,l]);const Sn=async()=>{if(L.trim()){V(!0);try{const ue=await Ce.validatePath(L.trim());U(ue.valid)}catch{U(!1)}finally{V(!1)}}},ae=async()=>{if(ne.trim()){C(!0);try{const ue=await Ce.validatePath(ne.trim());_(ue.valid&&ue.hasClaudeMd===!0)}catch{_(!1)}finally{C(!1)}}},me=()=>{const ue=X.trim();ue&&!R.includes(ue)&&(W([...R,ue]),G(""))},Ee=async()=>{Tt(!0),cn(null);try{const ue={companyName:g.trim(),description:b.trim()||"An AI-powered organization",team:He,existingProjectPath:A==="existing"?L.trim():void 0,knowledgePaths:T==="import"&&R.length>0?R:void 0};(u==="direct-api"||m)&&(ue.apiKey=m||void 0);const Qe=await Ce.scaffold(ue);St(Qe.created),Rn(!0)}catch(ue){cn(ue instanceof Error?ue.message:"Scaffold failed")}finally{Tt(!1)}},ie=async()=>{zt(!0),cn(null);try{const ue=await Ce.connectAkb(ne.trim());ue.ok?(Rn(!0),St([`Connected to: ${ue.companyRoot}`])):cn(ue.error||"Failed to connect")}catch(ue){cn(ue instanceof Error?ue.message:"Connect failed")}finally{zt(!1)}},xe=()=>{T==="import"&&R.length>0?t({paths:R,companyRoot:""}):t()},rt=ue=>{ue.key==="Enter"&&Pt()&&(ue.preventDefault(),Xn())},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)]`,Be=ue=>`p-4 rounded-lg border-2 cursor-pointer transition-all text-[var(--terminal-text)] ${ue?"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:rt,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((ue,Qe)=>c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"h-1 rounded-full transition-colors",style:{background:Qe<=l?"var(--accent)":"var(--terminal-surface-light)"}}),c.jsx("div",{className:"text-[9px] mt-1 truncate",style:{color:Qe===l?"var(--terminal-text)":"var(--terminal-text-muted)"},children:fC[ue]})]},ue))})]}),c.jsxs("div",{className:"px-6 py-5 min-h-[280px]",children:[ft==="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:Be(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:Be(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:ue=>x(ue.target.value),autoFocus:!0})]})]})]}),ft==="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:ue=>v(ue.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:ue=>k(ue.target.value)})]})]}),ft==="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:Be(A==="fresh"),onClick:()=>{N("fresh"),U(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:Be(A==="existing"),onClick:()=>N("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."}),A==="existing"&&c.jsxs("div",{className:"mt-3",onClick:ue=>ue.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:ue=>{H(ue.target.value),U(null)},autoFocus:!0}),c.jsx("button",{onClick:()=>te(!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:D||!L.trim(),className:"px-3 py-2 rounded text-xs font-medium transition-colors",style:{background:"var(--accent)",color:"#fff",opacity:D||!L.trim()?.5:1},children:D?"...":"Verify"})]}),Y===!0&&c.jsxs("div",{className:"text-xs mt-2",style:{color:"var(--active-green)"},children:["✅"," Path verified: ",L]}),Y===!1&&c.jsxs("div",{className:"text-xs mt-2",style:{color:"#EF4444"},children:["❌"," Invalid path"]}),q&&c.jsx(md,{onSelect:ue=>{H(ue),U(!0),te(!1)},onClose:()=>te(!1)})]})]})]}),ft==="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:Be(T==="skip"),onClick:()=>F("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:Be(T==="import"),onClick:()=>F("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."}),T==="import"&&c.jsxs("div",{className:"mt-3 space-y-2",onClick:ue=>ue.stopPropagation(),children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{className:`${nt} flex-1`,placeholder:"/path/to/docs",value:X,onChange:ue=>G(ue.target.value),onKeyDown:ue=>{ue.key==="Enter"&&(ue.preventDefault(),me())},autoFocus:!0}),c.jsx("button",{onClick:()=>Q(!M),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:me,disabled:!X.trim(),className:"px-3 py-2 rounded text-xs font-medium",style:{background:"var(--accent)",color:"#fff",opacity:X.trim()?1:.5},children:"Add"})]}),M&&c.jsx(md,{onSelect:ue=>{R.includes(ue)||W([...R,ue]),Q(!1)},onClose:()=>Q(!1)}),R.length>0&&c.jsx("div",{className:"space-y-1",children:R.map((ue,Qe)=>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:ue}),c.jsx("button",{onClick:()=>W(R.filter((Ie,_n)=>_n!==Qe)),className:"opacity-50 hover:opacity-100",children:"✕"})]},Qe))}),R.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:Be(T==="existing-akb"),onClick:()=>F("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."}),T==="existing-akb"&&c.jsxs("div",{className:"mt-3",onClick:ue=>ue.stopPropagation(),children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{className:`${nt} flex-1`,placeholder:"/path/to/your/akb",value:ne,onChange:ue=>{pe(ue.target.value),_(null)},autoFocus:!0}),c.jsx("button",{onClick:()=>ve(!fe),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:ae,disabled:ee||!ne.trim(),className:"px-3 py-2 rounded text-xs font-medium transition-colors",style:{background:"var(--accent)",color:"#fff",opacity:ee||!ne.trim()?.5:1},children:ee?"...":"Verify"})]}),z===!0&&c.jsxs("div",{className:"text-xs mt-2",style:{color:"var(--active-green)"},children:["✅"," Valid AKB found: ",ne]}),z===!1&&c.jsxs("div",{className:"text-xs mt-2",style:{color:"#EF4444"},children:["❌"," No valid AKB (CLAUDE.md required)"]}),fe&&c.jsx(md,{onSelect:ue=>{pe(ue),_(null),ve(!1)},onClose:()=>ve(!1)})]})]})]}),ft==="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."}),ye.map(ue=>c.jsxs("div",{className:Be(He===ue.id),onClick:()=>de(ue.id),children:[c.jsx("div",{className:"font-medium text-sm capitalize",children:ue.id}),c.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:ue.roles.map(Qe=>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:Qe.name},Qe.id))})]},ue.id)),c.jsxs("div",{className:Be(He==="custom"),onClick:()=>de("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."})]})]}),ft==="create"&&c.jsxs("div",{className:"space-y-4",children:[c.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--terminal-text)"},children:vt?T==="existing-akb"?"AKB Connected!":"Company Created!":"Review & Create"}),!vt&&!qe&&!Dt&&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:T==="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:"})," ",ne]}),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:"})," ",A==="fresh"?"Start Fresh":`Existing (${L})`]}),c.jsxs("div",{children:[c.jsx("span",{className:"opacity-50",children:"Knowledge:"})," ",T==="skip"?"Fresh (empty)":`Import ${R.length} source(s)`]}),c.jsxs("div",{children:[c.jsx("span",{className:"opacity-50",children:"Team:"})," ",He]}),T==="import"&&R.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."})]})}),ut&&c.jsx("div",{className:"text-xs p-3 rounded",style:{background:"rgba(220,38,38,0.15)",color:"#f87171"},children:ut})]}),(qe||Dt)&&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:Dt?"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:xn.map((ue,Qe)=>c.jsxs("div",{className:"py-0.5",children:[c.jsx("span",{style:{color:"var(--active-green)"},children:"✓"})," ",ue]},Qe))}),T==="import"&&R.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:Mt,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:xe,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:Xn,disabled:!Pt()||qe||Dt,className:"px-5 py-2 rounded text-sm font-medium transition-colors",style:{background:Pt()?"var(--accent)":"var(--terminal-border)",color:"#fff",opacity:Pt()&&!qe&&!Dt?1:.5},children:ft==="create"?qe||Dt?Dt?"Connecting...":"Creating...":T==="existing-akb"?"Connect AKB":"Create Company":"Next"})})]})]})})}function hC(){const[t,l]=S.useState(null),[r,i]=S.useState(!0),[o,u]=S.useState(null),f=S.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 S.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 mC=S.lazy(()=>Eb(()=>import("./preview-app-BfI2OYf_.js"),[]));function i0(){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 pC(){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 xC(){const{initialized:t,loading:l,refetch:r}=hC(),[i,o]=S.useState(null);S.useEffect(()=>{pC()},[]);const u=f=>{f&&o(f),r()};return l?c.jsx(i0,{}):t?c.jsx(uC,{importJob:i,onImportDone:()=>o(null)}):c.jsx(dC,{onComplete:u})}function gC(){const t=new URLSearchParams(window.location.search).has("sprite-preview");return c.jsx(Cb,{children:t?c.jsx(S.Suspense,{fallback:c.jsx(i0,{}),children:c.jsx(mC,{})}):c.jsx(xC,{})})}kb.createRoot(document.getElementById("root")).render(c.jsx(S.StrictMode,{children:c.jsx(gC,{})}));export{Xy as H,Qy as P,Ky as S,bC as a,Gy as b,Vy as c,Nd as d,n5 as e,t5 as f,vC as g,l5 as h,c as j,S as r};
|