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.
@@ -0,0 +1,95 @@
1
+ var xb=Object.defineProperty;var pb=(t,l,a)=>l in t?xb(t,l,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[l]=a;var qp=(t,l,a)=>pb(t,typeof l!="symbol"?l+"":l,a);(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 a(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=a(o);fetch(o.href,u)}})();function E0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _f={exports:{}},Zi={};/**
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 Xp;function yb(){if(Xp)return Zi;Xp=1;var t=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function a(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 Zi.Fragment=l,Zi.jsx=a,Zi.jsxs=a,Zi}var Vp;function gb(){return Vp||(Vp=1,_f.exports=yb()),_f.exports}var c=gb(),Ff={exports:{}},He={};/**
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 Gp;function bb(){if(Gp)return He;Gp=1;var t=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),a=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"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function v(T){return T===null||typeof T!="object"?null:(T=b&&T[b]||T["@@iterator"],typeof T=="function"?T:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,N={};function E(T,X,A){this.props=T,this.context=X,this.refs=N,this.updater=A||k}E.prototype.isReactComponent={},E.prototype.setState=function(T,X){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,X,"setState")},E.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function _(){}_.prototype=E.prototype;function $(T,X,A){this.props=T,this.context=X,this.refs=N,this.updater=A||k}var O=$.prototype=new _;O.constructor=$,S(O,E.prototype),O.isPureReactComponent=!0;var B=Array.isArray;function M(){}var q={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function P(T,X,A){var se=A.ref;return{$$typeof:t,type:T,key:X,ref:se!==void 0?se:null,props:A}}function z(T,X){return P(T.type,X,T.props)}function U(T){return typeof T=="object"&&T!==null&&T.$$typeof===t}function L(T){var X={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(A){return X[A]})}var ee=/\/+/g;function ne(T,X){return typeof T=="object"&&T!==null&&T.key!=null?L(""+T.key):X.toString(36)}function V(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(M,M):(T.status="pending",T.then(function(X){T.status==="pending"&&(T.status="fulfilled",T.value=X)},function(X){T.status==="pending"&&(T.status="rejected",T.reason=X)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function Y(T,X,A,se,de){var he=typeof T;(he==="undefined"||he==="boolean")&&(T=null);var we=!1;if(T===null)we=!0;else switch(he){case"bigint":case"string":case"number":we=!0;break;case"object":switch(T.$$typeof){case t:case l:we=!0;break;case g:return we=T._init,Y(we(T._payload),X,A,se,de)}}if(we)return de=de(T),we=se===""?"."+ne(T,0):se,B(de)?(A="",we!=null&&(A=we.replace(ee,"$&/")+"/"),Y(de,X,A,"",function(pe){return pe})):de!=null&&(U(de)&&(de=z(de,A+(de.key==null||T&&T.key===de.key?"":(""+de.key).replace(ee,"$&/")+"/")+we)),X.push(de)),1;we=0;var Ce=se===""?".":se+":";if(B(T))for(var Oe=0;Oe<T.length;Oe++)se=T[Oe],he=Ce+ne(se,Oe),we+=Y(se,X,A,he,de);else if(Oe=v(T),typeof Oe=="function")for(T=Oe.call(T),Oe=0;!(se=T.next()).done;)se=se.value,he=Ce+ne(se,Oe++),we+=Y(se,X,A,he,de);else if(he==="object"){if(typeof T.then=="function")return Y(V(T),X,A,se,de);throw X=String(T),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return we}function Q(T,X,A){if(T==null)return T;var se=[],de=0;return Y(T,se,"","",function(he){return X.call(A,he,de++)}),se}function re(T){if(T._status===-1){var X=T._result;X=X(),X.then(function(A){(T._status===0||T._status===-1)&&(T._status=1,T._result=A)},function(A){(T._status===0||T._status===-1)&&(T._status=2,T._result=A)}),T._status===-1&&(T._status=0,T._result=X)}if(T._status===1)return T._result.default;throw T._result}var ae=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},D={map:Q,forEach:function(T,X,A){Q(T,function(){X.apply(this,arguments)},A)},count:function(T){var X=0;return Q(T,function(){X++}),X},toArray:function(T){return Q(T,function(X){return X})||[]},only:function(T){if(!U(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return He.Activity=y,He.Children=D,He.Component=E,He.Fragment=a,He.Profiler=o,He.PureComponent=$,He.StrictMode=i,He.Suspense=p,He.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=q,He.__COMPILER_RUNTIME={__proto__:null,c:function(T){return q.H.useMemoCache(T)}},He.cache=function(T){return function(){return T.apply(null,arguments)}},He.cacheSignal=function(){return null},He.cloneElement=function(T,X,A){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var se=S({},T.props),de=T.key;if(X!=null)for(he in X.key!==void 0&&(de=""+X.key),X)!G.call(X,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&X.ref===void 0||(se[he]=X[he]);var he=arguments.length-2;if(he===1)se.children=A;else if(1<he){for(var we=Array(he),Ce=0;Ce<he;Ce++)we[Ce]=arguments[Ce+2];se.children=we}return P(T.type,de,se)},He.createContext=function(T){return T={$$typeof:f,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:u,_context:T},T},He.createElement=function(T,X,A){var se,de={},he=null;if(X!=null)for(se in X.key!==void 0&&(he=""+X.key),X)G.call(X,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(de[se]=X[se]);var we=arguments.length-2;if(we===1)de.children=A;else if(1<we){for(var Ce=Array(we),Oe=0;Oe<we;Oe++)Ce[Oe]=arguments[Oe+2];de.children=Ce}if(T&&T.defaultProps)for(se in we=T.defaultProps,we)de[se]===void 0&&(de[se]=we[se]);return P(T,he,de)},He.createRef=function(){return{current:null}},He.forwardRef=function(T){return{$$typeof:m,render:T}},He.isValidElement=U,He.lazy=function(T){return{$$typeof:g,_payload:{_status:-1,_result:T},_init:re}},He.memo=function(T,X){return{$$typeof:h,type:T,compare:X===void 0?null:X}},He.startTransition=function(T){var X=q.T,A={};q.T=A;try{var se=T(),de=q.S;de!==null&&de(A,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(M,ae)}catch(he){ae(he)}finally{X!==null&&A.types!==null&&(X.types=A.types),q.T=X}},He.unstable_useCacheRefresh=function(){return q.H.useCacheRefresh()},He.use=function(T){return q.H.use(T)},He.useActionState=function(T,X,A){return q.H.useActionState(T,X,A)},He.useCallback=function(T,X){return q.H.useCallback(T,X)},He.useContext=function(T){return q.H.useContext(T)},He.useDebugValue=function(){},He.useDeferredValue=function(T,X){return q.H.useDeferredValue(T,X)},He.useEffect=function(T,X){return q.H.useEffect(T,X)},He.useEffectEvent=function(T){return q.H.useEffectEvent(T)},He.useId=function(){return q.H.useId()},He.useImperativeHandle=function(T,X,A){return q.H.useImperativeHandle(T,X,A)},He.useInsertionEffect=function(T,X){return q.H.useInsertionEffect(T,X)},He.useLayoutEffect=function(T,X){return q.H.useLayoutEffect(T,X)},He.useMemo=function(T,X){return q.H.useMemo(T,X)},He.useOptimistic=function(T,X){return q.H.useOptimistic(T,X)},He.useReducer=function(T,X,A){return q.H.useReducer(T,X,A)},He.useRef=function(T){return q.H.useRef(T)},He.useState=function(T){return q.H.useState(T)},He.useSyncExternalStore=function(T,X,A){return q.H.useSyncExternalStore(T,X,A)},He.useTransition=function(){return q.H.useTransition()},He.version="19.2.4",He}var Kp;function Ld(){return Kp||(Kp=1,Ff.exports=bb()),Ff.exports}var j=Ld(),Rf={exports:{}},Wi={},Of={exports:{}},Bf={};/**
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 Qp;function vb(){return Qp||(Qp=1,(function(t){function l(Y,Q){var re=Y.length;Y.push(Q);e:for(;0<re;){var ae=re-1>>>1,D=Y[ae];if(0<o(D,Q))Y[ae]=Q,Y[re]=D,re=ae;else break e}}function a(Y){return Y.length===0?null:Y[0]}function i(Y){if(Y.length===0)return null;var Q=Y[0],re=Y.pop();if(re!==Q){Y[0]=re;e:for(var ae=0,D=Y.length,T=D>>>1;ae<T;){var X=2*(ae+1)-1,A=Y[X],se=X+1,de=Y[se];if(0>o(A,re))se<D&&0>o(de,A)?(Y[ae]=de,Y[se]=re,ae=se):(Y[ae]=A,Y[X]=re,ae=X);else if(se<D&&0>o(de,re))Y[ae]=de,Y[se]=re,ae=se;else break e}}return Q}function o(Y,Q){var re=Y.sortIndex-Q.sortIndex;return re!==0?re:Y.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 p=[],h=[],g=1,y=null,b=3,v=!1,k=!1,S=!1,N=!1,E=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function O(Y){for(var Q=a(h);Q!==null;){if(Q.callback===null)i(h);else if(Q.startTime<=Y)i(h),Q.sortIndex=Q.expirationTime,l(p,Q);else break;Q=a(h)}}function B(Y){if(S=!1,O(Y),!k)if(a(p)!==null)k=!0,M||(M=!0,L());else{var Q=a(h);Q!==null&&V(B,Q.startTime-Y)}}var M=!1,q=-1,G=5,P=-1;function z(){return N?!0:!(t.unstable_now()-P<G)}function U(){if(N=!1,M){var Y=t.unstable_now();P=Y;var Q=!0;try{e:{k=!1,S&&(S=!1,_(q),q=-1),v=!0;var re=b;try{t:{for(O(Y),y=a(p);y!==null&&!(y.expirationTime>Y&&z());){var ae=y.callback;if(typeof ae=="function"){y.callback=null,b=y.priorityLevel;var D=ae(y.expirationTime<=Y);if(Y=t.unstable_now(),typeof D=="function"){y.callback=D,O(Y),Q=!0;break t}y===a(p)&&i(p),O(Y)}else i(p);y=a(p)}if(y!==null)Q=!0;else{var T=a(h);T!==null&&V(B,T.startTime-Y),Q=!1}}break e}finally{y=null,b=re,v=!1}Q=void 0}}finally{Q?L():M=!1}}}var L;if(typeof $=="function")L=function(){$(U)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,ne=ee.port2;ee.port1.onmessage=U,L=function(){ne.postMessage(null)}}else L=function(){E(U,0)};function V(Y,Q){q=E(function(){Y(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(Y){Y.callback=null},t.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<Y?Math.floor(1e3/Y):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_next=function(Y){switch(b){case 1:case 2:case 3:var Q=3;break;default:Q=b}var re=b;b=Q;try{return Y()}finally{b=re}},t.unstable_requestPaint=function(){N=!0},t.unstable_runWithPriority=function(Y,Q){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var re=b;b=Y;try{return Q()}finally{b=re}},t.unstable_scheduleCallback=function(Y,Q,re){var ae=t.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?ae+re:ae):re=ae,Y){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=re+D,Y={id:g++,callback:Q,priorityLevel:Y,startTime:re,expirationTime:D,sortIndex:-1},re>ae?(Y.sortIndex=re,l(h,Y),a(p)===null&&Y===a(h)&&(S?(_(q),q=-1):S=!0,V(B,re-ae))):(Y.sortIndex=D,l(p,Y),k||v||(k=!0,M||(M=!0,L()))),Y},t.unstable_shouldYield=z,t.unstable_wrapCallback=function(Y){var Q=b;return function(){var re=b;b=Q;try{return Y.apply(this,arguments)}finally{b=re}}}})(Bf)),Bf}var Zp;function wb(){return Zp||(Zp=1,Of.exports=vb()),Of.exports}var $f={exports:{}},cn={};/**
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 Wp;function kb(){if(Wp)return cn;Wp=1;var t=Ld();function l(p){var h="https://react.dev/errors/"+p;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+p+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var i={d:{f:a,r:function(){throw Error(l(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(p,h,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:""+y,children:p,containerInfo:h,implementation:g}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,h){if(p==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,cn.createPortal=function(p,h){var g=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(p,h,null,g)},cn.flushSync=function(p){var h=f.T,g=i.p;try{if(f.T=null,i.p=2,p)return p()}finally{f.T=h,i.p=g,i.d.f()}},cn.preconnect=function(p,h){typeof p=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(p,h))},cn.prefetchDNS=function(p){typeof p=="string"&&i.d.D(p)},cn.preinit=function(p,h){if(typeof p=="string"&&h&&typeof h.as=="string"){var g=h.as,y=m(g,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,v=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?i.d.S(p,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:v}):g==="script"&&i.d.X(p,{crossOrigin:y,integrity:b,fetchPriority:v,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},cn.preinitModule=function(p,h){if(typeof p=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=m(h.as,h.crossOrigin);i.d.M(p,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(p)},cn.preload=function(p,h){if(typeof p=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,y=m(g,h.crossOrigin);i.d.L(p,g,{crossOrigin:y,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})}},cn.preloadModule=function(p,h){if(typeof p=="string")if(h){var g=m(h.as,h.crossOrigin);i.d.m(p,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(p)},cn.requestFormReset=function(p){i.d.r(p)},cn.unstable_batchedUpdates=function(p,h){return p(h)},cn.useFormState=function(p,h,g){return f.H.useFormState(p,h,g)},cn.useFormStatus=function(){return f.H.useHostTransitionStatus()},cn.version="19.2.4",cn}var Jp;function Sb(){if(Jp)return $f.exports;Jp=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(),$f.exports=kb(),$f.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 Pp;function jb(){if(Pp)return Wi;Pp=1;var t=wb(),l=Ld(),a=Sb();function i(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r])}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,r=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(r=n.return),e=n.return;while(e)}return n.tag===3?r: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 p(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 r=e,s=n;;){var d=r.return;if(d===null)break;var x=d.alternate;if(x===null){if(s=d.return,s!==null){r=s;continue}break}if(d.child===x.child){for(x=d.child;x;){if(x===r)return p(d),e;if(x===s)return p(d),n;x=x.sibling}throw Error(i(188))}if(r.return!==s.return)r=d,s=x;else{for(var w=!1,C=d.child;C;){if(C===r){w=!0,r=d,s=x;break}if(C===s){w=!0,s=d,r=x;break}C=C.sibling}if(!w){for(C=x.child;C;){if(C===r){w=!0,r=x,s=d;break}if(C===s){w=!0,s=x,r=d;break}C=C.sibling}if(!w)throw Error(i(189))}}if(r.alternate!==s)throw Error(i(190))}if(r.tag!==3)throw Error(i(188));return r.stateNode.current===r?e:n}function g(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=g(e),n!==null)return n;e=e.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),$=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function L(e){return e===null||typeof e!="object"?null:(e=U&&e[U]||e["@@iterator"],typeof e=="function"?e:null)}var ee=Symbol.for("react.client.reference");function ne(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case E:return"Profiler";case N:return"StrictMode";case B:return"Suspense";case M:return"SuspenseList";case P:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case $:return e.displayName||"Context";case _:return(e._context.displayName||"Context")+".Consumer";case O:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case q:return n=e.displayName||null,n!==null?n:ne(e.type)||"Memo";case G:n=e._payload,e=e._init;try{return ne(e(n))}catch{}}return null}var V=Array.isArray,Y=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ae=[],D=-1;function T(e){return{current:e}}function X(e){0>D||(e.current=ae[D],ae[D]=null,D--)}function A(e,n){D++,ae[D]=e.current,e.current=n}var se=T(null),de=T(null),he=T(null),we=T(null);function Ce(e,n){switch(A(he,n),A(de,e),A(se,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?hp(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=hp(n),e=mp(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}X(se),A(se,e)}function Oe(){X(se),X(de),X(he)}function pe(e){e.memoizedState!==null&&A(we,e);var n=se.current,r=mp(n,e.type);n!==r&&(A(de,e),A(se,r))}function Ke(e){de.current===e&&(X(se),X(de)),we.current===e&&(X(we),Vi._currentValue=re)}var lt,me;function Ee(e){if(lt===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);lt=n&&n[1]||"",me=-1<r.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+lt+e+me}var qe=!1;function Mt(e,n){if(!e||qe)return"";qe=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(te){var J=te}Reflect.construct(e,[],ce)}else{try{ce.call()}catch(te){J=te}e.call(ce.prototype)}}else{try{throw Error()}catch(te){J=te}(ce=e())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(te){if(te&&J&&typeof te.stack=="string")return[te.stack,J.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 x=s.DetermineComponentFrameRoot(),w=x[0],C=x[1];if(w&&C){var R=w.split(`
44
+ `),W=C.split(`
45
+ `);for(d=s=0;s<R.length&&!R[s].includes("DetermineComponentFrameRoot");)s++;for(;d<W.length&&!W[d].includes("DetermineComponentFrameRoot");)d++;if(s===R.length||d===W.length)for(s=R.length-1,d=W.length-1;1<=s&&0<=d&&R[s]!==W[d];)d--;for(;1<=s&&0<=d;s--,d--)if(R[s]!==W[d]){if(s!==1||d!==1)do if(s--,d--,0>d||R[s]!==W[d]){var ie=`
46
+ `+R[s].replace(" at new "," at ");return e.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",e.displayName)),ie}while(1<=s&&0<=d);break}}}finally{qe=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?Ee(r):""}function mt(e,n){switch(e.tag){case 26:case 27:case 5:return Ee(e.type);case 16:return Ee("Lazy");case 13:return e.child!==n&&n!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return Mt(e.type,!1);case 11:return Mt(e.type.render,!1);case 1:return Mt(e.type,!0);case 31:return Ee("Activity");default:return""}}function Yt(e){try{var n="",r=null;do n+=mt(e,r),r=e,e=e.return;while(e);return n}catch(s){return`
47
+ Error generating stack: `+s.message+`
48
+ `+s.stack}}var _t=Object.prototype.hasOwnProperty,on=t.unstable_scheduleCallback,Ct=t.unstable_cancelCallback,Ot=t.unstable_shouldYield,Ln=t.unstable_requestPaint,Bt=t.unstable_now,Hn=t.unstable_getCurrentPriorityLevel,le=t.unstable_ImmediatePriority,ye=t.unstable_UserBlockingPriority,Te=t.unstable_NormalPriority,xe=t.unstable_LowPriority,be=t.unstable_IdlePriority,rt=t.log,xt=t.unstable_setDisableYieldValue,Xe=null,ue=null;function De(e){if(typeof rt=="function"&&xt(e),ue&&typeof ue.setStrictMode=="function")try{ue.setStrictMode(Xe,e)}catch{}}var it=Math.clz32?Math.clz32:ti,gn=Math.log,en=Math.LN2;function ti(e){return e>>>=0,e===0?32:31-(gn(e)/en|0)|0}var Jn=256,Pn=262144,el=4194304;function ol(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 tl(e,n,r){var s=e.pendingLanes;if(s===0)return 0;var d=0,x=e.suspendedLanes,w=e.pingedLanes;e=e.warmLanes;var C=s&134217727;return C!==0?(s=C&~x,s!==0?d=ol(s):(w&=C,w!==0?d=ol(w):r||(r=C&~e,r!==0&&(d=ol(r))))):(C=s&~x,C!==0?d=ol(C):w!==0?d=ol(w):r||(r=s&~e,r!==0&&(d=ol(r)))),d===0?0:n!==0&&n!==d&&(n&x)===0&&(x=d&-d,r=n&-n,x>=r||x===32&&(r&4194048)!==0)?n:d}function Gl(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function Es(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 lr(){var e=el;return el<<=1,(el&62914560)===0&&(el=4194304),e}function ar(e){for(var n=[],r=0;31>r;r++)n.push(e);return n}function An(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ni(e,n,r,s,d,x){var w=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var C=e.entanglements,R=e.expirationTimes,W=e.hiddenUpdates;for(r=w&~r;0<r;){var ie=31-it(r),ce=1<<ie;C[ie]=0,R[ie]=-1;var J=W[ie];if(J!==null)for(W[ie]=null,ie=0;ie<J.length;ie++){var te=J[ie];te!==null&&(te.lane&=-536870913)}r&=~ce}s!==0&&li(e,s,0),x!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=x&~(w&~n))}function li(e,n,r){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-it(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|r&261930}function ai(e,n){var r=e.entangledLanes|=n;for(e=e.entanglements;r;){var s=31-it(r),d=1<<s;d&n|e[s]&n&&(e[s]|=n),r&=~d}}function Cs(e,n){var r=n&-n;return r=(r&42)!==0?1:Da(r),(r&(e.suspendedLanes|n))!==0?0:r}function Da(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 bn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Sl(){var e=Q.p;return e!==0?e:(e=window.event,e===void 0?32:Bp(e.type))}function Kl(e,n){var r=Q.p;try{return Q.p=e,n()}finally{Q.p=r}}var cl=Math.random().toString(36).slice(2),$t="__reactFiber$"+cl,pt="__reactProps$"+cl,nl="__reactContainer$"+cl,Dn="__reactEvents$"+cl,Ns="__reactListeners$"+cl,ri="__reactHandles$"+cl,As="__reactResources$"+cl,ll="__reactMarker$"+cl;function ii(e){delete e[$t],delete e[pt],delete e[Dn],delete e[Ns],delete e[ri]}function Tt(e){var n=e[$t];if(n)return n;for(var r=e.parentNode;r;){if(n=r[nl]||r[$t]){if(r=n.alternate,n.child!==null||r!==null&&r.child!==null)for(e=wp(e);e!==null;){if(r=e[$t])return r;e=wp(e)}return n}e=r,r=e.parentNode}return null}function Ql(e){if(e=e[$t]||e[nl]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function Ta(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(i(33))}function jl(e){var n=e[As];return n||(n=e[As]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Lt(e){e[ll]=!0}var Ds=new Set,Ts={};function ul(e,n){Zl(e,n),Zl(e+"Capture",n)}function Zl(e,n){for(Ts[e]=n,e=0;e<n.length;e++)Ds.add(n[e])}var Ec=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]*$"),zs={},Ms={};function Cc(e){return _t.call(Ms,e)?!0:_t.call(zs,e)?!1:Ec.test(e)?Ms[e]=!0:(zs[e]=!0,!1)}function rr(e,n,r){if(Cc(n))if(r===null)e.removeAttribute(n);else{switch(typeof r){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,""+r)}}function ir(e,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+r)}}function tn(e,n,r,s){if(s===null)e.removeAttribute(r);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(n,r,""+s)}}function hn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _s(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Nc(e,n,r){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,x=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return d.call(this)},set:function(w){r=""+w,x.call(this,w)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return r},setValue:function(w){r=""+w},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Un(e){if(!e._valueTracker){var n=_s(e)?"checked":"value";e._valueTracker=Nc(e,n,""+e[n])}}function si(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),s="";return e&&(s=_s(e)?e.checked?"true":"false":e.value),e=s,e!==r?(n.setValue(e),!0):!1}function sr(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 Ac=/[\n"\\]/g;function yt(e){return e.replace(Ac,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function El(e,n,r,s,d,x,w,C){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=""+hn(n)):e.value!==""+hn(n)&&(e.value=""+hn(n)):w!=="submit"&&w!=="reset"||e.removeAttribute("value"),n!=null?or(e,w,hn(n)):r!=null?or(e,w,hn(r)):s!=null&&e.removeAttribute("value"),d==null&&x!=null&&(e.defaultChecked=!!x),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?e.name=""+hn(C):e.removeAttribute("name")}function oi(e,n,r,s,d,x,w,C){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.type=x),n!=null||r!=null){if(!(x!=="submit"&&x!=="reset"||n!=null)){Un(e);return}r=r!=null?""+hn(r):"",n=n!=null?""+hn(n):r,C||n===e.value||(e.value=n),e.defaultValue=n}s=s??d,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=C?e.checked:!!s,e.defaultChecked=!!s,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(e.name=w),Un(e)}function or(e,n,r){n==="number"&&sr(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function Cl(e,n,r,s){if(e=e.options,n){n={};for(var d=0;d<r.length;d++)n["$"+r[d]]=!0;for(r=0;r<e.length;r++)d=n.hasOwnProperty("$"+e[r].value),e[r].selected!==d&&(e[r].selected=d),d&&s&&(e[r].defaultSelected=!0)}else{for(r=""+hn(r),n=null,d=0;d<e.length;d++){if(e[d].value===r){e[d].selected=!0,s&&(e[d].defaultSelected=!0);return}n!==null||e[d].disabled||(n=e[d])}n!==null&&(n.selected=!0)}}function H(e,n,r){if(n!=null&&(n=""+hn(n),n!==e.value&&(e.value=n),r==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=r!=null?""+hn(r):""}function fe(e,n,r,s){if(n==null){if(s!=null){if(r!=null)throw Error(i(92));if(V(s)){if(1<s.length)throw Error(i(93));s=s[0]}r=s}r==null&&(r=""),n=r}r=hn(n),e.defaultValue=r,s=e.textContent,s===r&&s!==""&&s!==null&&(e.value=s),Un(e)}function ve(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var Se=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 ke(e,n,r){var s=n.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,r):typeof r!="number"||r===0||Se.has(n)?n==="float"?e.cssFloat=r:e[n]=(""+r).trim():e[n]=r+"px"}function Me(e,n,r){if(n!=null&&typeof n!="object")throw Error(i(62));if(e=e.style,r!=null){for(var s in r)!r.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)&&r[d]!==s&&ke(e,d,s)}else for(var x in n)n.hasOwnProperty(x)&&ke(e,x,n[x])}function Be(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 Je=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"]]),st=/^[\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 Le(e){return st.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ht(){}var Dc=null;function Tc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cr=null,ur=null;function dh(e){var n=Ql(e);if(n&&(e=n.stateNode)){var r=e[pt]||null;e:switch(e=n.stateNode,n.type){case"input":if(El(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),n=r.name,r.type==="radio"&&n!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+yt(""+n)+'"][type="radio"]'),n=0;n<r.length;n++){var s=r[n];if(s!==e&&s.form===e.form){var d=s[pt]||null;if(!d)throw Error(i(90));El(s,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(n=0;n<r.length;n++)s=r[n],s.form===e.form&&si(s)}break e;case"textarea":H(e,r.value,r.defaultValue);break e;case"select":n=r.value,n!=null&&Cl(e,!!r.multiple,n,!1)}}}var zc=!1;function hh(e,n,r){if(zc)return e(n,r);zc=!0;try{var s=e(n);return s}finally{if(zc=!1,(cr!==null||ur!==null)&&(wo(),cr&&(n=cr,e=ur,ur=cr=null,dh(n),e)))for(n=0;n<e.length;n++)dh(e[n])}}function ci(e,n){var r=e.stateNode;if(r===null)return null;var s=r[pt]||null;if(s===null)return null;r=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(r&&typeof r!="function")throw Error(i(231,n,typeof r));return r}var Nl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mc=!1;if(Nl)try{var ui={};Object.defineProperty(ui,"passive",{get:function(){Mc=!0}}),window.addEventListener("test",ui,ui),window.removeEventListener("test",ui,ui)}catch{Mc=!1}var Wl=null,_c=null,Fs=null;function mh(){if(Fs)return Fs;var e,n=_c,r=n.length,s,d="value"in Wl?Wl.value:Wl.textContent,x=d.length;for(e=0;e<r&&n[e]===d[e];e++);var w=r-e;for(s=1;s<=w&&n[r-s]===d[x-s];s++);return Fs=d.slice(e,1<s?1-s:void 0)}function Rs(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 Os(){return!0}function xh(){return!1}function vn(e){function n(r,s,d,x,w){this._reactName=r,this._targetInst=d,this.type=s,this.nativeEvent=x,this.target=w,this.currentTarget=null;for(var C in e)e.hasOwnProperty(C)&&(r=e[C],this[C]=r?r(x):x[C]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Os:xh,this.isPropagationStopped=xh,this}return y(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Os)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Os)},persist:function(){},isPersistent:Os}),n}var za={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bs=vn(za),fi=y({},za,{view:0,detail:0}),hg=vn(fi),Fc,Rc,di,$s=y({},fi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bc,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!==di&&(di&&e.type==="mousemove"?(Fc=e.screenX-di.screenX,Rc=e.screenY-di.screenY):Rc=Fc=0,di=e),Fc)},movementY:function(e){return"movementY"in e?e.movementY:Rc}}),ph=vn($s),mg=y({},$s,{dataTransfer:0}),xg=vn(mg),pg=y({},fi,{relatedTarget:0}),Oc=vn(pg),yg=y({},za,{animationName:0,elapsedTime:0,pseudoElement:0}),gg=vn(yg),bg=y({},za,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vg=vn(bg),wg=y({},za,{data:0}),yh=vn(wg),kg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sg={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},jg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Eg(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=jg[e])?!!n[e]:!1}function Bc(){return Eg}var Cg=y({},fi,{key:function(e){if(e.key){var n=kg[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Rs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Sg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bc,charCode:function(e){return e.type==="keypress"?Rs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Rs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ng=vn(Cg),Ag=y({},$s,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gh=vn(Ag),Dg=y({},fi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bc}),Tg=vn(Dg),zg=y({},za,{propertyName:0,elapsedTime:0,pseudoElement:0}),Mg=vn(zg),_g=y({},$s,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Fg=vn(_g),Rg=y({},za,{newState:0,oldState:0}),Og=vn(Rg),Bg=[9,13,27,32],$c=Nl&&"CompositionEvent"in window,hi=null;Nl&&"documentMode"in document&&(hi=document.documentMode);var $g=Nl&&"TextEvent"in window&&!hi,bh=Nl&&(!$c||hi&&8<hi&&11>=hi),vh=" ",wh=!1;function kh(e,n){switch(e){case"keyup":return Bg.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fr=!1;function Lg(e,n){switch(e){case"compositionend":return Sh(n);case"keypress":return n.which!==32?null:(wh=!0,vh);case"textInput":return e=n.data,e===vh&&wh?null:e;default:return null}}function Hg(e,n){if(fr)return e==="compositionend"||!$c&&kh(e,n)?(e=mh(),Fs=_c=Wl=null,fr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return bh&&n.locale!=="ko"?null:n.data;default:return null}}var Ug={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 jh(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!Ug[e.type]:n==="textarea"}function Eh(e,n,r,s){cr?ur?ur.push(s):ur=[s]:cr=s,n=Ao(n,"onChange"),0<n.length&&(r=new Bs("onChange","change",null,r,s),e.push({event:r,listeners:n}))}var mi=null,xi=null;function Yg(e){sp(e,0)}function Ls(e){var n=Ta(e);if(si(n))return e}function Ch(e,n){if(e==="change")return n}var Nh=!1;if(Nl){var Lc;if(Nl){var Hc="oninput"in document;if(!Hc){var Ah=document.createElement("div");Ah.setAttribute("oninput","return;"),Hc=typeof Ah.oninput=="function"}Lc=Hc}else Lc=!1;Nh=Lc&&(!document.documentMode||9<document.documentMode)}function Dh(){mi&&(mi.detachEvent("onpropertychange",Th),xi=mi=null)}function Th(e){if(e.propertyName==="value"&&Ls(xi)){var n=[];Eh(n,xi,e,Tc(e)),hh(Yg,n)}}function Ig(e,n,r){e==="focusin"?(Dh(),mi=n,xi=r,mi.attachEvent("onpropertychange",Th)):e==="focusout"&&Dh()}function qg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ls(xi)}function Xg(e,n){if(e==="click")return Ls(n)}function Vg(e,n){if(e==="input"||e==="change")return Ls(n)}function Gg(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Tn=typeof Object.is=="function"?Object.is:Gg;function pi(e,n){if(Tn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var r=Object.keys(e),s=Object.keys(n);if(r.length!==s.length)return!1;for(s=0;s<r.length;s++){var d=r[s];if(!_t.call(n,d)||!Tn(e[d],n[d]))return!1}return!0}function zh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mh(e,n){var r=zh(e);e=0;for(var s;r;){if(r.nodeType===3){if(s=e+r.textContent.length,e<=n&&s>=n)return{node:r,offset:n-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=zh(r)}}function _h(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?_h(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Fh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=sr(e.document);n instanceof e.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)e=n.contentWindow;else break;n=sr(e.document)}return n}function Uc(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 Kg=Nl&&"documentMode"in document&&11>=document.documentMode,dr=null,Yc=null,yi=null,Ic=!1;function Rh(e,n,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ic||dr==null||dr!==sr(s)||(s=dr,"selectionStart"in s&&Uc(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}),yi&&pi(yi,s)||(yi=s,s=Ao(Yc,"onSelect"),0<s.length&&(n=new Bs("onSelect","select",null,n,r),e.push({event:n,listeners:s}),n.target=dr)))}function Ma(e,n){var r={};return r[e.toLowerCase()]=n.toLowerCase(),r["Webkit"+e]="webkit"+n,r["Moz"+e]="moz"+n,r}var hr={animationend:Ma("Animation","AnimationEnd"),animationiteration:Ma("Animation","AnimationIteration"),animationstart:Ma("Animation","AnimationStart"),transitionrun:Ma("Transition","TransitionRun"),transitionstart:Ma("Transition","TransitionStart"),transitioncancel:Ma("Transition","TransitionCancel"),transitionend:Ma("Transition","TransitionEnd")},qc={},Oh={};Nl&&(Oh=document.createElement("div").style,"AnimationEvent"in window||(delete hr.animationend.animation,delete hr.animationiteration.animation,delete hr.animationstart.animation),"TransitionEvent"in window||delete hr.transitionend.transition);function _a(e){if(qc[e])return qc[e];if(!hr[e])return e;var n=hr[e],r;for(r in n)if(n.hasOwnProperty(r)&&r in Oh)return qc[e]=n[r];return e}var Bh=_a("animationend"),$h=_a("animationiteration"),Lh=_a("animationstart"),Qg=_a("transitionrun"),Zg=_a("transitionstart"),Wg=_a("transitioncancel"),Hh=_a("transitionend"),Uh=new Map,Xc="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(" ");Xc.push("scrollEnd");function al(e,n){Uh.set(e,n),ul(n,[e])}var Hs=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)},Yn=[],mr=0,Vc=0;function Us(){for(var e=mr,n=Vc=mr=0;n<e;){var r=Yn[n];Yn[n++]=null;var s=Yn[n];Yn[n++]=null;var d=Yn[n];Yn[n++]=null;var x=Yn[n];if(Yn[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}x!==0&&Yh(r,d,x)}}function Ys(e,n,r,s){Yn[mr++]=e,Yn[mr++]=n,Yn[mr++]=r,Yn[mr++]=s,Vc|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Gc(e,n,r,s){return Ys(e,n,r,s),Is(e)}function Fa(e,n){return Ys(e,null,null,n),Is(e)}function Yh(e,n,r){e.lanes|=r;var s=e.alternate;s!==null&&(s.lanes|=r);for(var d=!1,x=e.return;x!==null;)x.childLanes|=r,s=x.alternate,s!==null&&(s.childLanes|=r),x.tag===22&&(e=x.stateNode,e===null||e._visibility&1||(d=!0)),e=x,x=x.return;return e.tag===3?(x=e.stateNode,d&&n!==null&&(d=31-it(r),e=x.hiddenUpdates,s=e[d],s===null?e[d]=[n]:s.push(n),n.lane=r|536870912),x):null}function Is(e){if(50<Li)throw Li=0,nf=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 Jg(e,n,r,s){this.tag=e,this.key=r,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 zn(e,n,r,s){return new Jg(e,n,r,s)}function Kc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Al(e,n){var r=e.alternate;return r===null?(r=zn(e.tag,n,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=n,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,n=e.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Ih(e,n){e.flags&=65011714;var r=e.alternate;return r===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=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,n=r.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function qs(e,n,r,s,d,x){var w=0;if(s=e,typeof e=="function")Kc(e)&&(w=1);else if(typeof e=="string")w=lb(e,r,se.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case P:return e=zn(31,r,n,d),e.elementType=P,e.lanes=x,e;case S:return Ra(r.children,d,x,n);case N:w=8,d|=24;break;case E:return e=zn(12,r,n,d|2),e.elementType=E,e.lanes=x,e;case B:return e=zn(13,r,n,d),e.elementType=B,e.lanes=x,e;case M:return e=zn(19,r,n,d),e.elementType=M,e.lanes=x,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $:w=10;break e;case _:w=9;break e;case O:w=11;break e;case q:w=14;break e;case G:w=16,s=null;break e}w=29,r=Error(i(130,e===null?"null":typeof e,"")),s=null}return n=zn(w,r,n,d),n.elementType=e,n.type=s,n.lanes=x,n}function Ra(e,n,r,s){return e=zn(7,e,s,n),e.lanes=r,e}function Qc(e,n,r){return e=zn(6,e,null,n),e.lanes=r,e}function qh(e){var n=zn(18,null,null,0);return n.stateNode=e,n}function Zc(e,n,r){return n=zn(4,e.children!==null?e.children:[],e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Xh=new WeakMap;function In(e,n){if(typeof e=="object"&&e!==null){var r=Xh.get(e);return r!==void 0?r:(n={value:e,source:n,stack:Yt(n)},Xh.set(e,n),n)}return{value:e,source:n,stack:Yt(n)}}var pr=[],yr=0,Xs=null,gi=0,qn=[],Xn=0,Jl=null,fl=1,dl="";function Dl(e,n){pr[yr++]=gi,pr[yr++]=Xs,Xs=e,gi=n}function Vh(e,n,r){qn[Xn++]=fl,qn[Xn++]=dl,qn[Xn++]=Jl,Jl=e;var s=fl;e=dl;var d=32-it(s)-1;s&=~(1<<d),r+=1;var x=32-it(n)+d;if(30<x){var w=d-d%5;x=(s&(1<<w)-1).toString(32),s>>=w,d-=w,fl=1<<32-it(n)+d|r<<d|s,dl=x+e}else fl=1<<x|r<<d|s,dl=e}function Wc(e){e.return!==null&&(Dl(e,1),Vh(e,1,0))}function Jc(e){for(;e===Xs;)Xs=pr[--yr],pr[yr]=null,gi=pr[--yr],pr[yr]=null;for(;e===Jl;)Jl=qn[--Xn],qn[Xn]=null,dl=qn[--Xn],qn[Xn]=null,fl=qn[--Xn],qn[Xn]=null}function Gh(e,n){qn[Xn++]=fl,qn[Xn++]=dl,qn[Xn++]=Jl,fl=n.id,dl=n.overflow,Jl=e}var ln=null,At=null,nt=!1,Pl=null,Vn=!1,Pc=Error(i(519));function ea(e){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bi(In(n,e)),Pc}function Kh(e){var n=e.stateNode,r=e.type,s=e.memoizedProps;switch(n[$t]=e,n[pt]=s,r){case"dialog":Ze("cancel",n),Ze("close",n);break;case"iframe":case"object":case"embed":Ze("load",n);break;case"video":case"audio":for(r=0;r<Ui.length;r++)Ze(Ui[r],n);break;case"source":Ze("error",n);break;case"img":case"image":case"link":Ze("error",n),Ze("load",n);break;case"details":Ze("toggle",n);break;case"input":Ze("invalid",n),oi(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Ze("invalid",n);break;case"textarea":Ze("invalid",n),fe(n,s.value,s.defaultValue,s.children)}r=s.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||n.textContent===""+r||s.suppressHydrationWarning===!0||fp(n.textContent,r)?(s.popover!=null&&(Ze("beforetoggle",n),Ze("toggle",n)),s.onScroll!=null&&Ze("scroll",n),s.onScrollEnd!=null&&Ze("scrollend",n),s.onClick!=null&&(n.onclick=ht),n=!0):n=!1,n||ea(e,!0)}function Qh(e){for(ln=e.return;ln;)switch(ln.tag){case 5:case 31:case 13:Vn=!1;return;case 27:case 3:Vn=!0;return;default:ln=ln.return}}function gr(e){if(e!==ln)return!1;if(!nt)return Qh(e),nt=!0,!1;var n=e.tag,r;if((r=n!==3&&n!==27)&&((r=n===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||gf(e.type,e.memoizedProps)),r=!r),r&&At&&ea(e),Qh(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));At=vp(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));At=vp(e)}else n===27?(n=At,ma(e.type)?(e=Sf,Sf=null,At=e):At=n):At=ln?Kn(e.stateNode.nextSibling):null;return!0}function Oa(){At=ln=null,nt=!1}function eu(){var e=Pl;return e!==null&&(jn===null?jn=e:jn.push.apply(jn,e),Pl=null),e}function bi(e){Pl===null?Pl=[e]:Pl.push(e)}var tu=T(null),Ba=null,Tl=null;function ta(e,n,r){A(tu,n._currentValue),n._currentValue=r}function zl(e){e._currentValue=tu.current,X(tu)}function nu(e,n,r){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===r)break;e=e.return}}function lu(e,n,r,s){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var x=d.dependencies;if(x!==null){var w=d.child;x=x.firstContext;e:for(;x!==null;){var C=x;x=d;for(var R=0;R<n.length;R++)if(C.context===n[R]){x.lanes|=r,C=x.alternate,C!==null&&(C.lanes|=r),nu(x.return,r,e),s||(w=null);break e}x=C.next}}else if(d.tag===18){if(w=d.return,w===null)throw Error(i(341));w.lanes|=r,x=w.alternate,x!==null&&(x.lanes|=r),nu(w,r,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,r,s){e=null;for(var d=n,x=!1;d!==null;){if(!x){if((d.flags&524288)!==0)x=!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 C=d.type;Tn(d.pendingProps.value,w.value)||(e!==null?e.push(C):e=[C])}}else if(d===we.current){if(w=d.alternate,w===null)throw Error(i(387));w.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Vi):e=[Vi])}d=d.return}e!==null&&lu(n,e,r,s),n.flags|=262144}function Vs(e){for(e=e.firstContext;e!==null;){if(!Tn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function $a(e){Ba=e,Tl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function an(e){return Zh(Ba,e)}function Gs(e,n){return Ba===null&&$a(e),Zh(e,n)}function Zh(e,n){var r=n._currentValue;if(n={context:n,memoizedValue:r,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 r}var Pg=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(r,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(r){return r()})}},e2=t.unstable_scheduleCallback,t2=t.unstable_NormalPriority,Vt={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function au(){return{controller:new Pg,data:new Map,refCount:0}}function vi(e){e.refCount--,e.refCount===0&&e2(t2,function(){e.controller.abort()})}var wi=null,ru=0,vr=0,wr=null;function n2(e,n){if(wi===null){var r=wi=[];ru=0,vr=cf(),wr={status:"pending",value:void 0,then:function(s){r.push(s)}}}return ru++,n.then(Wh,Wh),n}function Wh(){if(--ru===0&&wi!==null){wr!==null&&(wr.status="fulfilled");var e=wi;wi=null,vr=0,wr=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function l2(e,n){var r=[],s={status:"pending",value:null,reason:null,then:function(d){r.push(d)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var d=0;d<r.length;d++)(0,r[d])(n)},function(d){for(s.status="rejected",s.reason=d,d=0;d<r.length;d++)(0,r[d])(void 0)}),s}var Jh=Y.S;Y.S=function(e,n){Rx=Bt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n2(e,n),Jh!==null&&Jh(e,n)};var La=T(null);function iu(){var e=La.current;return e!==null?e:jt.pooledCache}function Ks(e,n){n===null?A(La,La.current):A(La,n.pool)}function Ph(){var e=iu();return e===null?null:{parent:Vt._currentValue,pool:e}}var kr=Error(i(460)),su=Error(i(474)),Qs=Error(i(542)),Zs={then:function(){}};function em(e){return e=e.status,e==="fulfilled"||e==="rejected"}function tm(e,n,r){switch(r=e[r],r===void 0?e.push(n):r!==n&&(n.then(ht,ht),n=r),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,lm(e),e;default:if(typeof n.status=="string")n.then(ht,ht);else{if(e=jt,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,lm(e),e}throw Ua=n,kr}}function Ha(e){try{var n=e._init;return n(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Ua=r,kr):r}}var Ua=null;function nm(){if(Ua===null)throw Error(i(459));var e=Ua;return Ua=null,e}function lm(e){if(e===kr||e===Qs)throw Error(i(483))}var Sr=null,ki=0;function Ws(e){var n=ki;return ki+=1,Sr===null&&(Sr=[]),tm(Sr,e,n)}function Si(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Js(e,n){throw n.$$typeof===b?Error(i(525)):(e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function am(e){function n(K,I){if(e){var Z=K.deletions;Z===null?(K.deletions=[I],K.flags|=16):Z.push(I)}}function r(K,I){if(!e)return null;for(;I!==null;)n(K,I),I=I.sibling;return null}function s(K){for(var I=new Map;K!==null;)K.key!==null?I.set(K.key,K):I.set(K.index,K),K=K.sibling;return I}function d(K,I){return K=Al(K,I),K.index=0,K.sibling=null,K}function x(K,I,Z){return K.index=Z,e?(Z=K.alternate,Z!==null?(Z=Z.index,Z<I?(K.flags|=67108866,I):Z):(K.flags|=67108866,I)):(K.flags|=1048576,I)}function w(K){return e&&K.alternate===null&&(K.flags|=67108866),K}function C(K,I,Z,oe){return I===null||I.tag!==6?(I=Qc(Z,K.mode,oe),I.return=K,I):(I=d(I,Z),I.return=K,I)}function R(K,I,Z,oe){var ze=Z.type;return ze===S?ie(K,I,Z.props.children,oe,Z.key):I!==null&&(I.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===G&&Ha(ze)===I.type)?(I=d(I,Z.props),Si(I,Z),I.return=K,I):(I=qs(Z.type,Z.key,Z.props,null,K.mode,oe),Si(I,Z),I.return=K,I)}function W(K,I,Z,oe){return I===null||I.tag!==4||I.stateNode.containerInfo!==Z.containerInfo||I.stateNode.implementation!==Z.implementation?(I=Zc(Z,K.mode,oe),I.return=K,I):(I=d(I,Z.children||[]),I.return=K,I)}function ie(K,I,Z,oe,ze){return I===null||I.tag!==7?(I=Ra(Z,K.mode,oe,ze),I.return=K,I):(I=d(I,Z),I.return=K,I)}function ce(K,I,Z){if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return I=Qc(""+I,K.mode,Z),I.return=K,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case v:return Z=qs(I.type,I.key,I.props,null,K.mode,Z),Si(Z,I),Z.return=K,Z;case k:return I=Zc(I,K.mode,Z),I.return=K,I;case G:return I=Ha(I),ce(K,I,Z)}if(V(I)||L(I))return I=Ra(I,K.mode,Z,null),I.return=K,I;if(typeof I.then=="function")return ce(K,Ws(I),Z);if(I.$$typeof===$)return ce(K,Gs(K,I),Z);Js(K,I)}return null}function J(K,I,Z,oe){var ze=I!==null?I.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return ze!==null?null:C(K,I,""+Z,oe);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case v:return Z.key===ze?R(K,I,Z,oe):null;case k:return Z.key===ze?W(K,I,Z,oe):null;case G:return Z=Ha(Z),J(K,I,Z,oe)}if(V(Z)||L(Z))return ze!==null?null:ie(K,I,Z,oe,null);if(typeof Z.then=="function")return J(K,I,Ws(Z),oe);if(Z.$$typeof===$)return J(K,I,Gs(K,Z),oe);Js(K,Z)}return null}function te(K,I,Z,oe,ze){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return K=K.get(Z)||null,C(I,K,""+oe,ze);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case v:return K=K.get(oe.key===null?Z:oe.key)||null,R(I,K,oe,ze);case k:return K=K.get(oe.key===null?Z:oe.key)||null,W(I,K,oe,ze);case G:return oe=Ha(oe),te(K,I,Z,oe,ze)}if(V(oe)||L(oe))return K=K.get(Z)||null,ie(I,K,oe,ze,null);if(typeof oe.then=="function")return te(K,I,Z,Ws(oe),ze);if(oe.$$typeof===$)return te(K,I,Z,Gs(I,oe),ze);Js(I,oe)}return null}function je(K,I,Z,oe){for(var ze=null,ot=null,Ne=I,Ye=I=0,et=null;Ne!==null&&Ye<Z.length;Ye++){Ne.index>Ye?(et=Ne,Ne=null):et=Ne.sibling;var ct=J(K,Ne,Z[Ye],oe);if(ct===null){Ne===null&&(Ne=et);break}e&&Ne&&ct.alternate===null&&n(K,Ne),I=x(ct,I,Ye),ot===null?ze=ct:ot.sibling=ct,ot=ct,Ne=et}if(Ye===Z.length)return r(K,Ne),nt&&Dl(K,Ye),ze;if(Ne===null){for(;Ye<Z.length;Ye++)Ne=ce(K,Z[Ye],oe),Ne!==null&&(I=x(Ne,I,Ye),ot===null?ze=Ne:ot.sibling=Ne,ot=Ne);return nt&&Dl(K,Ye),ze}for(Ne=s(Ne);Ye<Z.length;Ye++)et=te(Ne,K,Ye,Z[Ye],oe),et!==null&&(e&&et.alternate!==null&&Ne.delete(et.key===null?Ye:et.key),I=x(et,I,Ye),ot===null?ze=et:ot.sibling=et,ot=et);return e&&Ne.forEach(function(ba){return n(K,ba)}),nt&&Dl(K,Ye),ze}function Fe(K,I,Z,oe){if(Z==null)throw Error(i(151));for(var ze=null,ot=null,Ne=I,Ye=I=0,et=null,ct=Z.next();Ne!==null&&!ct.done;Ye++,ct=Z.next()){Ne.index>Ye?(et=Ne,Ne=null):et=Ne.sibling;var ba=J(K,Ne,ct.value,oe);if(ba===null){Ne===null&&(Ne=et);break}e&&Ne&&ba.alternate===null&&n(K,Ne),I=x(ba,I,Ye),ot===null?ze=ba:ot.sibling=ba,ot=ba,Ne=et}if(ct.done)return r(K,Ne),nt&&Dl(K,Ye),ze;if(Ne===null){for(;!ct.done;Ye++,ct=Z.next())ct=ce(K,ct.value,oe),ct!==null&&(I=x(ct,I,Ye),ot===null?ze=ct:ot.sibling=ct,ot=ct);return nt&&Dl(K,Ye),ze}for(Ne=s(Ne);!ct.done;Ye++,ct=Z.next())ct=te(Ne,K,Ye,ct.value,oe),ct!==null&&(e&&ct.alternate!==null&&Ne.delete(ct.key===null?Ye:ct.key),I=x(ct,I,Ye),ot===null?ze=ct:ot.sibling=ct,ot=ct);return e&&Ne.forEach(function(mb){return n(K,mb)}),nt&&Dl(K,Ye),ze}function kt(K,I,Z,oe){if(typeof Z=="object"&&Z!==null&&Z.type===S&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case v:e:{for(var ze=Z.key;I!==null;){if(I.key===ze){if(ze=Z.type,ze===S){if(I.tag===7){r(K,I.sibling),oe=d(I,Z.props.children),oe.return=K,K=oe;break e}}else if(I.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===G&&Ha(ze)===I.type){r(K,I.sibling),oe=d(I,Z.props),Si(oe,Z),oe.return=K,K=oe;break e}r(K,I);break}else n(K,I);I=I.sibling}Z.type===S?(oe=Ra(Z.props.children,K.mode,oe,Z.key),oe.return=K,K=oe):(oe=qs(Z.type,Z.key,Z.props,null,K.mode,oe),Si(oe,Z),oe.return=K,K=oe)}return w(K);case k:e:{for(ze=Z.key;I!==null;){if(I.key===ze)if(I.tag===4&&I.stateNode.containerInfo===Z.containerInfo&&I.stateNode.implementation===Z.implementation){r(K,I.sibling),oe=d(I,Z.children||[]),oe.return=K,K=oe;break e}else{r(K,I);break}else n(K,I);I=I.sibling}oe=Zc(Z,K.mode,oe),oe.return=K,K=oe}return w(K);case G:return Z=Ha(Z),kt(K,I,Z,oe)}if(V(Z))return je(K,I,Z,oe);if(L(Z)){if(ze=L(Z),typeof ze!="function")throw Error(i(150));return Z=ze.call(Z),Fe(K,I,Z,oe)}if(typeof Z.then=="function")return kt(K,I,Ws(Z),oe);if(Z.$$typeof===$)return kt(K,I,Gs(K,Z),oe);Js(K,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,I!==null&&I.tag===6?(r(K,I.sibling),oe=d(I,Z),oe.return=K,K=oe):(r(K,I),oe=Qc(Z,K.mode,oe),oe.return=K,K=oe),w(K)):r(K,I)}return function(K,I,Z,oe){try{ki=0;var ze=kt(K,I,Z,oe);return Sr=null,ze}catch(Ne){if(Ne===kr||Ne===Qs)throw Ne;var ot=zn(29,Ne,null,K.mode);return ot.lanes=oe,ot.return=K,ot}finally{}}}var Ya=am(!0),rm=am(!1),na=!1;function ou(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function cu(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 la(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function aa(e,n,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(ft&2)!==0){var d=s.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),s.pending=n,n=Is(e),Yh(e,null,r),n}return Ys(e,s,n,r),Is(e)}function ji(e,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,r|=s,n.lanes=r,ai(e,r)}}function uu(e,n){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var d=null,x=null;if(r=r.firstBaseUpdate,r!==null){do{var w={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};x===null?d=x=w:x=x.next=w,r=r.next}while(r!==null);x===null?d=x=n:x=x.next=n}else d=x=n;r={baseState:s.baseState,firstBaseUpdate:d,lastBaseUpdate:x,shared:s.shared,callbacks:s.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=n:e.next=n,r.lastBaseUpdate=n}var fu=!1;function Ei(){if(fu){var e=wr;if(e!==null)throw e}}function Ci(e,n,r,s){fu=!1;var d=e.updateQueue;na=!1;var x=d.firstBaseUpdate,w=d.lastBaseUpdate,C=d.shared.pending;if(C!==null){d.shared.pending=null;var R=C,W=R.next;R.next=null,w===null?x=W:w.next=W,w=R;var ie=e.alternate;ie!==null&&(ie=ie.updateQueue,C=ie.lastBaseUpdate,C!==w&&(C===null?ie.firstBaseUpdate=W:C.next=W,ie.lastBaseUpdate=R))}if(x!==null){var ce=d.baseState;w=0,ie=W=R=null,C=x;do{var J=C.lane&-536870913,te=J!==C.lane;if(te?(Pe&J)===J:(s&J)===J){J!==0&&J===vr&&(fu=!0),ie!==null&&(ie=ie.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var je=e,Fe=C;J=n;var kt=r;switch(Fe.tag){case 1:if(je=Fe.payload,typeof je=="function"){ce=je.call(kt,ce,J);break e}ce=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=Fe.payload,J=typeof je=="function"?je.call(kt,ce,J):je,J==null)break e;ce=y({},ce,J);break e;case 2:na=!0}}J=C.callback,J!==null&&(e.flags|=64,te&&(e.flags|=8192),te=d.callbacks,te===null?d.callbacks=[J]:te.push(J))}else te={lane:J,tag:C.tag,payload:C.payload,callback:C.callback,next:null},ie===null?(W=ie=te,R=ce):ie=ie.next=te,w|=J;if(C=C.next,C===null){if(C=d.shared.pending,C===null)break;te=C,C=te.next,te.next=null,d.lastBaseUpdate=te,d.shared.pending=null}}while(!0);ie===null&&(R=ce),d.baseState=R,d.firstBaseUpdate=W,d.lastBaseUpdate=ie,x===null&&(d.shared.lanes=0),ca|=w,e.lanes=w,e.memoizedState=ce}}function im(e,n){if(typeof e!="function")throw Error(i(191,e));e.call(n)}function sm(e,n){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)im(r[e],n)}var jr=T(null),Ps=T(0);function om(e,n){e=Hl,A(Ps,e),A(jr,n),Hl=e|n.baseLanes}function du(){A(Ps,Hl),A(jr,jr.current)}function hu(){Hl=Ps.current,X(jr),X(Ps)}var Mn=T(null),Gn=null;function ra(e){var n=e.alternate;A(It,It.current&1),A(Mn,e),Gn===null&&(n===null||jr.current!==null||n.memoizedState!==null)&&(Gn=e)}function mu(e){A(It,It.current),A(Mn,e),Gn===null&&(Gn=e)}function cm(e){e.tag===22?(A(It,It.current),A(Mn,e),Gn===null&&(Gn=e)):ia()}function ia(){A(It,It.current),A(Mn,Mn.current)}function _n(e){X(Mn),Gn===e&&(Gn=null),X(It)}var It=T(0);function eo(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||wf(r)||kf(r)))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 Ml=0,Ue=null,vt=null,Gt=null,to=!1,Er=!1,Ia=!1,no=0,Ni=0,Cr=null,a2=0;function Ht(){throw Error(i(321))}function xu(e,n){if(n===null)return!1;for(var r=0;r<n.length&&r<e.length;r++)if(!Tn(e[r],n[r]))return!1;return!0}function pu(e,n,r,s,d,x){return Ml=x,Ue=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,Y.H=e===null||e.memoizedState===null?Vm:zu,Ia=!1,x=r(s,d),Ia=!1,Er&&(x=fm(n,r,s,d)),um(e),x}function um(e){Y.H=Ti;var n=vt!==null&&vt.next!==null;if(Ml=0,Gt=vt=Ue=null,to=!1,Ni=0,Cr=null,n)throw Error(i(300));e===null||Kt||(e=e.dependencies,e!==null&&Vs(e)&&(Kt=!0))}function fm(e,n,r,s){Ue=e;var d=0;do{if(Er&&(Cr=null),Ni=0,Er=!1,25<=d)throw Error(i(301));if(d+=1,Gt=vt=null,e.updateQueue!=null){var x=e.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}Y.H=Gm,x=n(r,s)}while(Er);return x}function r2(){var e=Y.H,n=e.useState()[0];return n=typeof n.then=="function"?Ai(n):n,e=e.useState()[0],(vt!==null?vt.memoizedState:null)!==e&&(Ue.flags|=1024),n}function yu(){var e=no!==0;return no=0,e}function gu(e,n,r){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~r}function bu(e){if(to){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}to=!1}Ml=0,Gt=vt=Ue=null,Er=!1,Ni=no=0,Cr=null}function mn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gt===null?Ue.memoizedState=Gt=e:Gt=Gt.next=e,Gt}function qt(){if(vt===null){var e=Ue.alternate;e=e!==null?e.memoizedState:null}else e=vt.next;var n=Gt===null?Ue.memoizedState:Gt.next;if(n!==null)Gt=n,vt=e;else{if(e===null)throw Ue.alternate===null?Error(i(467)):Error(i(310));vt=e,e={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},Gt===null?Ue.memoizedState=Gt=e:Gt=Gt.next=e}return Gt}function lo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ai(e){var n=Ni;return Ni+=1,Cr===null&&(Cr=[]),e=tm(Cr,e,n),n=Ue,(Gt===null?n.memoizedState:Gt.next)===null&&(n=n.alternate,Y.H=n===null||n.memoizedState===null?Vm:zu),e}function ao(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ai(e);if(e.$$typeof===$)return an(e)}throw Error(i(438,String(e)))}function vu(e){var n=null,r=Ue.updateQueue;if(r!==null&&(n=r.memoCache),n==null){var s=Ue.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}),r===null&&(r=lo(),Ue.updateQueue=r),r.memoCache=n,r=n.data[n.index],r===void 0)for(r=n.data[n.index]=Array(e),s=0;s<e;s++)r[s]=z;return n.index++,r}function _l(e,n){return typeof n=="function"?n(e):n}function ro(e){var n=qt();return wu(n,vt,e)}function wu(e,n,r){var s=e.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=r;var d=e.baseQueue,x=s.pending;if(x!==null){if(d!==null){var w=d.next;d.next=x.next,x.next=w}n.baseQueue=d=x,s.pending=null}if(x=e.baseState,d===null)e.memoizedState=x;else{n=d.next;var C=w=null,R=null,W=n,ie=!1;do{var ce=W.lane&-536870913;if(ce!==W.lane?(Pe&ce)===ce:(Ml&ce)===ce){var J=W.revertLane;if(J===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),ce===vr&&(ie=!0);else if((Ml&J)===J){W=W.next,J===vr&&(ie=!0);continue}else ce={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},R===null?(C=R=ce,w=x):R=R.next=ce,Ue.lanes|=J,ca|=J;ce=W.action,Ia&&r(x,ce),x=W.hasEagerState?W.eagerState:r(x,ce)}else J={lane:ce,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},R===null?(C=R=J,w=x):R=R.next=J,Ue.lanes|=ce,ca|=ce;W=W.next}while(W!==null&&W!==n);if(R===null?w=x:R.next=C,!Tn(x,e.memoizedState)&&(Kt=!0,ie&&(r=wr,r!==null)))throw r;e.memoizedState=x,e.baseState=w,e.baseQueue=R,s.lastRenderedState=x}return d===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function ku(e){var n=qt(),r=n.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=e;var s=r.dispatch,d=r.pending,x=n.memoizedState;if(d!==null){r.pending=null;var w=d=d.next;do x=e(x,w.action),w=w.next;while(w!==d);Tn(x,n.memoizedState)||(Kt=!0),n.memoizedState=x,n.baseQueue===null&&(n.baseState=x),r.lastRenderedState=x}return[x,s]}function dm(e,n,r){var s=Ue,d=qt(),x=nt;if(x){if(r===void 0)throw Error(i(407));r=r()}else r=n();var w=!Tn((vt||d).memoizedState,r);if(w&&(d.memoizedState=r,Kt=!0),d=d.queue,Eu(xm.bind(null,s,d,e),[e]),d.getSnapshot!==n||w||Gt!==null&&Gt.memoizedState.tag&1){if(s.flags|=2048,Nr(9,{destroy:void 0},mm.bind(null,s,d,r,n),null),jt===null)throw Error(i(349));x||(Ml&127)!==0||hm(s,n,r)}return r}function hm(e,n,r){e.flags|=16384,e={getSnapshot:n,value:r},n=Ue.updateQueue,n===null?(n=lo(),Ue.updateQueue=n,n.stores=[e]):(r=n.stores,r===null?n.stores=[e]:r.push(e))}function mm(e,n,r,s){n.value=r,n.getSnapshot=s,pm(n)&&ym(e)}function xm(e,n,r){return r(function(){pm(n)&&ym(e)})}function pm(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!Tn(e,r)}catch{return!0}}function ym(e){var n=Fa(e,2);n!==null&&En(n,e,2)}function Su(e){var n=mn();if(typeof e=="function"){var r=e;if(e=r(),Ia){De(!0);try{r()}finally{De(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_l,lastRenderedState:e},n}function gm(e,n,r,s){return e.baseState=r,wu(e,vt,typeof s=="function"?s:_l)}function i2(e,n,r,s,d){if(oo(e))throw Error(i(485));if(e=n.action,e!==null){var x={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){x.listeners.push(w)}};Y.T!==null?r(!0):x.isTransition=!1,s(x),r=n.pending,r===null?(x.next=n.pending=x,bm(n,x)):(x.next=r.next,n.pending=r.next=x)}}function bm(e,n){var r=n.action,s=n.payload,d=e.state;if(n.isTransition){var x=Y.T,w={};Y.T=w;try{var C=r(d,s),R=Y.S;R!==null&&R(w,C),vm(e,n,C)}catch(W){ju(e,n,W)}finally{x!==null&&w.types!==null&&(x.types=w.types),Y.T=x}}else try{x=r(d,s),vm(e,n,x)}catch(W){ju(e,n,W)}}function vm(e,n,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(s){wm(e,n,s)},function(s){return ju(e,n,s)}):wm(e,n,r)}function wm(e,n,r){n.status="fulfilled",n.value=r,km(n),e.state=r,n=e.pending,n!==null&&(r=n.next,r===n?e.pending=null:(r=r.next,n.next=r,bm(e,r)))}function ju(e,n,r){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=r,km(n),n=n.next;while(n!==s)}e.action=null}function km(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Sm(e,n){return n}function jm(e,n){if(nt){var r=jt.formState;if(r!==null){e:{var s=Ue;if(nt){if(At){t:{for(var d=At,x=Vn;d.nodeType!==8;){if(!x){d=null;break t}if(d=Kn(d.nextSibling),d===null){d=null;break t}}x=d.data,d=x==="F!"||x==="F"?d:null}if(d){At=Kn(d.nextSibling),s=d.data==="F!";break e}}ea(s)}s=!1}s&&(n=r[0])}}return r=mn(),r.memoizedState=r.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sm,lastRenderedState:n},r.queue=s,r=Im.bind(null,Ue,s),s.dispatch=r,s=Su(!1),x=Tu.bind(null,Ue,!1,s.queue),s=mn(),d={state:n,dispatch:null,action:e,pending:null},s.queue=d,r=i2.bind(null,Ue,d,x,r),d.dispatch=r,s.memoizedState=e,[n,r,!1]}function Em(e){var n=qt();return Cm(n,vt,e)}function Cm(e,n,r){if(n=wu(e,n,Sm)[0],e=ro(_l)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=Ai(n)}catch(w){throw w===kr?Qs:w}else s=n;n=qt();var d=n.queue,x=d.dispatch;return r!==n.memoizedState&&(Ue.flags|=2048,Nr(9,{destroy:void 0},s2.bind(null,d,r),null)),[s,x,e]}function s2(e,n){e.action=n}function Nm(e){var n=qt(),r=vt;if(r!==null)return Cm(n,r,e);qt(),n=n.memoizedState,r=qt();var s=r.queue.dispatch;return r.memoizedState=e,[n,s,!1]}function Nr(e,n,r,s){return e={tag:e,create:r,deps:s,inst:n,next:null},n=Ue.updateQueue,n===null&&(n=lo(),Ue.updateQueue=n),r=n.lastEffect,r===null?n.lastEffect=e.next=e:(s=r.next,r.next=e,e.next=s,n.lastEffect=e),e}function Am(){return qt().memoizedState}function io(e,n,r,s){var d=mn();Ue.flags|=e,d.memoizedState=Nr(1|n,{destroy:void 0},r,s===void 0?null:s)}function so(e,n,r,s){var d=qt();s=s===void 0?null:s;var x=d.memoizedState.inst;vt!==null&&s!==null&&xu(s,vt.memoizedState.deps)?d.memoizedState=Nr(n,x,r,s):(Ue.flags|=e,d.memoizedState=Nr(1|n,x,r,s))}function Dm(e,n){io(8390656,8,e,n)}function Eu(e,n){so(2048,8,e,n)}function o2(e){Ue.flags|=4;var n=Ue.updateQueue;if(n===null)n=lo(),Ue.updateQueue=n,n.events=[e];else{var r=n.events;r===null?n.events=[e]:r.push(e)}}function Tm(e){var n=qt().memoizedState;return o2({ref:n,nextImpl:e}),function(){if((ft&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function zm(e,n){return so(4,2,e,n)}function Mm(e,n){return so(4,4,e,n)}function _m(e,n){if(typeof n=="function"){e=e();var r=n(e);return function(){typeof r=="function"?r():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Fm(e,n,r){r=r!=null?r.concat([e]):null,so(4,4,_m.bind(null,n,e),r)}function Cu(){}function Rm(e,n){var r=qt();n=n===void 0?null:n;var s=r.memoizedState;return n!==null&&xu(n,s[1])?s[0]:(r.memoizedState=[e,n],e)}function Om(e,n){var r=qt();n=n===void 0?null:n;var s=r.memoizedState;if(n!==null&&xu(n,s[1]))return s[0];if(s=e(),Ia){De(!0);try{e()}finally{De(!1)}}return r.memoizedState=[s,n],s}function Nu(e,n,r){return r===void 0||(Ml&1073741824)!==0&&(Pe&261930)===0?e.memoizedState=n:(e.memoizedState=r,e=Bx(),Ue.lanes|=e,ca|=e,r)}function Bm(e,n,r,s){return Tn(r,n)?r:jr.current!==null?(e=Nu(e,r,s),Tn(e,n)||(Kt=!0),e):(Ml&42)===0||(Ml&1073741824)!==0&&(Pe&261930)===0?(Kt=!0,e.memoizedState=r):(e=Bx(),Ue.lanes|=e,ca|=e,n)}function $m(e,n,r,s,d){var x=Q.p;Q.p=x!==0&&8>x?x:8;var w=Y.T,C={};Y.T=C,Tu(e,!1,n,r);try{var R=d(),W=Y.S;if(W!==null&&W(C,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var ie=l2(R,s);Di(e,n,ie,On(e))}else Di(e,n,s,On(e))}catch(ce){Di(e,n,{then:function(){},status:"rejected",reason:ce},On())}finally{Q.p=x,w!==null&&C.types!==null&&(w.types=C.types),Y.T=w}}function c2(){}function Au(e,n,r,s){if(e.tag!==5)throw Error(i(476));var d=Lm(e).queue;$m(e,d,n,re,r===null?c2:function(){return Hm(e),r(s)})}function Lm(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_l,lastRenderedState:re},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_l,lastRenderedState:r},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Hm(e){var n=Lm(e);n.next===null&&(n=e.alternate.memoizedState),Di(e,n.next.queue,{},On())}function Du(){return an(Vi)}function Um(){return qt().memoizedState}function Ym(){return qt().memoizedState}function u2(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var r=On();e=la(r);var s=aa(n,e,r);s!==null&&(En(s,n,r),ji(s,n,r)),n={cache:au()},e.payload=n;return}n=n.return}}function f2(e,n,r){var s=On();r={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},oo(e)?qm(n,r):(r=Gc(e,n,r,s),r!==null&&(En(r,e,s),Xm(r,n,s)))}function Im(e,n,r){var s=On();Di(e,n,r,s)}function Di(e,n,r,s){var d={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(oo(e))qm(n,d);else{var x=e.alternate;if(e.lanes===0&&(x===null||x.lanes===0)&&(x=n.lastRenderedReducer,x!==null))try{var w=n.lastRenderedState,C=x(w,r);if(d.hasEagerState=!0,d.eagerState=C,Tn(C,w))return Ys(e,n,d,0),jt===null&&Us(),!1}catch{}finally{}if(r=Gc(e,n,d,s),r!==null)return En(r,e,s),Xm(r,n,s),!0}return!1}function Tu(e,n,r,s){if(s={lane:2,revertLane:cf(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},oo(e)){if(n)throw Error(i(479))}else n=Gc(e,r,s,2),n!==null&&En(n,e,2)}function oo(e){var n=e.alternate;return e===Ue||n!==null&&n===Ue}function qm(e,n){Er=to=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function Xm(e,n,r){if((r&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,r|=s,n.lanes=r,ai(e,r)}}var Ti={readContext:an,use:ao,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht,useHostTransitionStatus:Ht,useFormState:Ht,useActionState:Ht,useOptimistic:Ht,useMemoCache:Ht,useCacheRefresh:Ht};Ti.useEffectEvent=Ht;var Vm={readContext:an,use:ao,useCallback:function(e,n){return mn().memoizedState=[e,n===void 0?null:n],e},useContext:an,useEffect:Dm,useImperativeHandle:function(e,n,r){r=r!=null?r.concat([e]):null,io(4194308,4,_m.bind(null,n,e),r)},useLayoutEffect:function(e,n){return io(4194308,4,e,n)},useInsertionEffect:function(e,n){io(4,2,e,n)},useMemo:function(e,n){var r=mn();n=n===void 0?null:n;var s=e();if(Ia){De(!0);try{e()}finally{De(!1)}}return r.memoizedState=[s,n],s},useReducer:function(e,n,r){var s=mn();if(r!==void 0){var d=r(n);if(Ia){De(!0);try{r(n)}finally{De(!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=f2.bind(null,Ue,e),[s.memoizedState,e]},useRef:function(e){var n=mn();return e={current:e},n.memoizedState=e},useState:function(e){e=Su(e);var n=e.queue,r=Im.bind(null,Ue,n);return n.dispatch=r,[e.memoizedState,r]},useDebugValue:Cu,useDeferredValue:function(e,n){var r=mn();return Nu(r,e,n)},useTransition:function(){var e=Su(!1);return e=$m.bind(null,Ue,e.queue,!0,!1),mn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,r){var s=Ue,d=mn();if(nt){if(r===void 0)throw Error(i(407));r=r()}else{if(r=n(),jt===null)throw Error(i(349));(Pe&127)!==0||hm(s,n,r)}d.memoizedState=r;var x={value:r,getSnapshot:n};return d.queue=x,Dm(xm.bind(null,s,x,e),[e]),s.flags|=2048,Nr(9,{destroy:void 0},mm.bind(null,s,x,r,n),null),r},useId:function(){var e=mn(),n=jt.identifierPrefix;if(nt){var r=dl,s=fl;r=(s&~(1<<32-it(s)-1)).toString(32)+r,n="_"+n+"R_"+r,r=no++,0<r&&(n+="H"+r.toString(32)),n+="_"}else r=a2++,n="_"+n+"r_"+r.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Du,useFormState:jm,useActionState:jm,useOptimistic:function(e){var n=mn();n.memoizedState=n.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=r,n=Tu.bind(null,Ue,!0,r),r.dispatch=n,[e,n]},useMemoCache:vu,useCacheRefresh:function(){return mn().memoizedState=u2.bind(null,Ue)},useEffectEvent:function(e){var n=mn(),r={impl:e};return n.memoizedState=r,function(){if((ft&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}},zu={readContext:an,use:ao,useCallback:Rm,useContext:an,useEffect:Eu,useImperativeHandle:Fm,useInsertionEffect:zm,useLayoutEffect:Mm,useMemo:Om,useReducer:ro,useRef:Am,useState:function(){return ro(_l)},useDebugValue:Cu,useDeferredValue:function(e,n){var r=qt();return Bm(r,vt.memoizedState,e,n)},useTransition:function(){var e=ro(_l)[0],n=qt().memoizedState;return[typeof e=="boolean"?e:Ai(e),n]},useSyncExternalStore:dm,useId:Um,useHostTransitionStatus:Du,useFormState:Em,useActionState:Em,useOptimistic:function(e,n){var r=qt();return gm(r,vt,e,n)},useMemoCache:vu,useCacheRefresh:Ym};zu.useEffectEvent=Tm;var Gm={readContext:an,use:ao,useCallback:Rm,useContext:an,useEffect:Eu,useImperativeHandle:Fm,useInsertionEffect:zm,useLayoutEffect:Mm,useMemo:Om,useReducer:ku,useRef:Am,useState:function(){return ku(_l)},useDebugValue:Cu,useDeferredValue:function(e,n){var r=qt();return vt===null?Nu(r,e,n):Bm(r,vt.memoizedState,e,n)},useTransition:function(){var e=ku(_l)[0],n=qt().memoizedState;return[typeof e=="boolean"?e:Ai(e),n]},useSyncExternalStore:dm,useId:Um,useHostTransitionStatus:Du,useFormState:Nm,useActionState:Nm,useOptimistic:function(e,n){var r=qt();return vt!==null?gm(r,vt,e,n):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:vu,useCacheRefresh:Ym};Gm.useEffectEvent=Tm;function Mu(e,n,r,s){n=e.memoizedState,r=r(s,n),r=r==null?n:y({},n,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var _u={enqueueSetState:function(e,n,r){e=e._reactInternals;var s=On(),d=la(s);d.payload=n,r!=null&&(d.callback=r),n=aa(e,d,s),n!==null&&(En(n,e,s),ji(n,e,s))},enqueueReplaceState:function(e,n,r){e=e._reactInternals;var s=On(),d=la(s);d.tag=1,d.payload=n,r!=null&&(d.callback=r),n=aa(e,d,s),n!==null&&(En(n,e,s),ji(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var r=On(),s=la(r);s.tag=2,n!=null&&(s.callback=n),n=aa(e,s,r),n!==null&&(En(n,e,r),ji(n,e,r))}};function Km(e,n,r,s,d,x,w){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,x,w):n.prototype&&n.prototype.isPureReactComponent?!pi(r,s)||!pi(d,x):!0}function Qm(e,n,r,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(r,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(r,s),n.state!==e&&_u.enqueueReplaceState(n,n.state,null)}function qa(e,n){var r=n;if("ref"in n){r={};for(var s in n)s!=="ref"&&(r[s]=n[s])}if(e=e.defaultProps){r===n&&(r=y({},r));for(var d in e)r[d]===void 0&&(r[d]=e[d])}return r}function Zm(e){Hs(e)}function Wm(e){console.error(e)}function Jm(e){Hs(e)}function co(e,n){try{var r=e.onUncaughtError;r(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function Pm(e,n,r){try{var s=e.onCaughtError;s(r.value,{componentStack:r.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Fu(e,n,r){return r=la(r),r.tag=3,r.payload={element:null},r.callback=function(){co(e,n)},r}function ex(e){return e=la(e),e.tag=3,e}function tx(e,n,r,s){var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var x=s.value;e.payload=function(){return d(x)},e.callback=function(){Pm(n,r,s)}}var w=r.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(e.callback=function(){Pm(n,r,s),typeof d!="function"&&(ua===null?ua=new Set([this]):ua.add(this));var C=s.stack;this.componentDidCatch(s.value,{componentStack:C!==null?C:""})})}function d2(e,n,r,s,d){if(r.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=r.alternate,n!==null&&br(n,r,d,!0),r=Mn.current,r!==null){switch(r.tag){case 31:case 13:return Gn===null?ko():r.alternate===null&&Ut===0&&(Ut=3),r.flags&=-257,r.flags|=65536,r.lanes=d,s===Zs?r.flags|=16384:(n=r.updateQueue,n===null?r.updateQueue=new Set([s]):n.add(s),rf(e,s,d)),!1;case 22:return r.flags|=65536,s===Zs?r.flags|=16384:(n=r.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},r.updateQueue=n):(r=n.retryQueue,r===null?n.retryQueue=new Set([s]):r.add(s)),rf(e,s,d)),!1}throw Error(i(435,r.tag))}return rf(e,s,d),ko(),!1}if(nt)return n=Mn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=d,s!==Pc&&(e=Error(i(422),{cause:s}),bi(In(e,r)))):(s!==Pc&&(n=Error(i(423),{cause:s}),bi(In(n,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,s=In(s,r),d=Fu(e.stateNode,s,d),uu(e,d),Ut!==4&&(Ut=2)),!1;var x=Error(i(520),{cause:s});if(x=In(x,r),$i===null?$i=[x]:$i.push(x),Ut!==4&&(Ut=2),n===null)return!0;s=In(s,r),r=n;do{switch(r.tag){case 3:return r.flags|=65536,e=d&-d,r.lanes|=e,e=Fu(r.stateNode,s,e),uu(r,e),!1;case 1:if(n=r.type,x=r.stateNode,(r.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(ua===null||!ua.has(x))))return r.flags|=65536,d&=-d,r.lanes|=d,d=ex(d),tx(d,e,r,s),uu(r,d),!1}r=r.return}while(r!==null);return!1}var Ru=Error(i(461)),Kt=!1;function rn(e,n,r,s){n.child=e===null?rm(n,null,r,s):Ya(n,e.child,r,s)}function nx(e,n,r,s,d){r=r.render;var x=n.ref;if("ref"in s){var w={};for(var C in s)C!=="ref"&&(w[C]=s[C])}else w=s;return $a(n),s=pu(e,n,r,w,x,d),C=yu(),e!==null&&!Kt?(gu(e,n,d),Fl(e,n,d)):(nt&&C&&Wc(n),n.flags|=1,rn(e,n,s,d),n.child)}function lx(e,n,r,s,d){if(e===null){var x=r.type;return typeof x=="function"&&!Kc(x)&&x.defaultProps===void 0&&r.compare===null?(n.tag=15,n.type=x,ax(e,n,x,s,d)):(e=qs(r.type,null,s,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(x=e.child,!Iu(e,d)){var w=x.memoizedProps;if(r=r.compare,r=r!==null?r:pi,r(w,s)&&e.ref===n.ref)return Fl(e,n,d)}return n.flags|=1,e=Al(x,s),e.ref=n.ref,e.return=n,n.child=e}function ax(e,n,r,s,d){if(e!==null){var x=e.memoizedProps;if(pi(x,s)&&e.ref===n.ref)if(Kt=!1,n.pendingProps=s=x,Iu(e,d))(e.flags&131072)!==0&&(Kt=!0);else return n.lanes=e.lanes,Fl(e,n,d)}return Ou(e,n,r,s,d)}function rx(e,n,r,s){var d=s.children,x=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(x=x!==null?x.baseLanes|r:r,e!==null){for(s=n.child=e.child,d=0;s!==null;)d=d|s.lanes|s.childLanes,s=s.sibling;s=d&~x}else s=0,n.child=null;return ix(e,n,x,r,s)}if((r&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ks(n,x!==null?x.cachePool:null),x!==null?om(n,x):du(),cm(n);else return s=n.lanes=536870912,ix(e,n,x!==null?x.baseLanes|r:r,r,s)}else x!==null?(Ks(n,x.cachePool),om(n,x),ia(),n.memoizedState=null):(e!==null&&Ks(n,null),du(),ia());return rn(e,n,d,r),n.child}function zi(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function ix(e,n,r,s,d){var x=iu();return x=x===null?null:{parent:Vt._currentValue,pool:x},n.memoizedState={baseLanes:r,cachePool:x},e!==null&&Ks(n,null),du(),cm(n),e!==null&&br(e,n,s,!0),n.childLanes=d,null}function uo(e,n){return n=ho({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function sx(e,n,r){return Ya(n,e.child,null,r),e=uo(n,n.pendingProps),e.flags|=2,_n(n),n.memoizedState=null,e}function h2(e,n,r){var s=n.pendingProps,d=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(nt){if(s.mode==="hidden")return e=uo(n,s),n.lanes=536870912,zi(null,e);if(mu(n),(e=At)?(e=bp(e,Vn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Jl!==null?{id:fl,overflow:dl}:null,retryLane:536870912,hydrationErrors:null},r=qh(e),r.return=n,n.child=r,ln=n,At=null)):e=null,e===null)throw ea(n);return n.lanes=536870912,null}return uo(n,s)}var x=e.memoizedState;if(x!==null){var w=x.dehydrated;if(mu(n),d)if(n.flags&256)n.flags&=-257,n=sx(e,n,r);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(i(558));else if(Kt||br(e,n,r,!1),d=(r&e.childLanes)!==0,Kt||d){if(s=jt,s!==null&&(w=Cs(s,r),w!==0&&w!==x.retryLane))throw x.retryLane=w,Fa(e,w),En(s,e,w),Ru;ko(),n=sx(e,n,r)}else e=x.treeContext,At=Kn(w.nextSibling),ln=n,nt=!0,Pl=null,Vn=!1,e!==null&&Gh(n,e),n=uo(n,s),n.flags|=4096;return n}return e=Al(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function fo(e,n){var r=n.ref;if(r===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(i(284));(e===null||e.ref!==r)&&(n.flags|=4194816)}}function Ou(e,n,r,s,d){return $a(n),r=pu(e,n,r,s,void 0,d),s=yu(),e!==null&&!Kt?(gu(e,n,d),Fl(e,n,d)):(nt&&s&&Wc(n),n.flags|=1,rn(e,n,r,d),n.child)}function ox(e,n,r,s,d,x){return $a(n),n.updateQueue=null,r=fm(n,s,r,d),um(e),s=yu(),e!==null&&!Kt?(gu(e,n,x),Fl(e,n,x)):(nt&&s&&Wc(n),n.flags|=1,rn(e,n,r,x),n.child)}function cx(e,n,r,s,d){if($a(n),n.stateNode===null){var x=xr,w=r.contextType;typeof w=="object"&&w!==null&&(x=an(w)),x=new r(s,x),n.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=_u,n.stateNode=x,x._reactInternals=n,x=n.stateNode,x.props=s,x.state=n.memoizedState,x.refs={},ou(n),w=r.contextType,x.context=typeof w=="object"&&w!==null?an(w):xr,x.state=n.memoizedState,w=r.getDerivedStateFromProps,typeof w=="function"&&(Mu(n,r,w,s),x.state=n.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(w=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),w!==x.state&&_u.enqueueReplaceState(x,x.state,null),Ci(n,s,x,d),Ei(),x.state=n.memoizedState),typeof x.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){x=n.stateNode;var C=n.memoizedProps,R=qa(r,C);x.props=R;var W=x.context,ie=r.contextType;w=xr,typeof ie=="object"&&ie!==null&&(w=an(ie));var ce=r.getDerivedStateFromProps;ie=typeof ce=="function"||typeof x.getSnapshotBeforeUpdate=="function",C=n.pendingProps!==C,ie||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(C||W!==w)&&Qm(n,x,s,w),na=!1;var J=n.memoizedState;x.state=J,Ci(n,s,x,d),Ei(),W=n.memoizedState,C||J!==W||na?(typeof ce=="function"&&(Mu(n,r,ce,s),W=n.memoizedState),(R=na||Km(n,r,R,s,J,W,w))?(ie||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(n.flags|=4194308)):(typeof x.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=W),x.props=s,x.state=W,x.context=w,s=R):(typeof x.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{x=n.stateNode,cu(e,n),w=n.memoizedProps,ie=qa(r,w),x.props=ie,ce=n.pendingProps,J=x.context,W=r.contextType,R=xr,typeof W=="object"&&W!==null&&(R=an(W)),C=r.getDerivedStateFromProps,(W=typeof C=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(w!==ce||J!==R)&&Qm(n,x,s,R),na=!1,J=n.memoizedState,x.state=J,Ci(n,s,x,d),Ei();var te=n.memoizedState;w!==ce||J!==te||na||e!==null&&e.dependencies!==null&&Vs(e.dependencies)?(typeof C=="function"&&(Mu(n,r,C,s),te=n.memoizedState),(ie=na||Km(n,r,ie,s,J,te,R)||e!==null&&e.dependencies!==null&&Vs(e.dependencies))?(W||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(s,te,R),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(s,te,R)),typeof x.componentDidUpdate=="function"&&(n.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof x.componentDidUpdate!="function"||w===e.memoizedProps&&J===e.memoizedState||(n.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||w===e.memoizedProps&&J===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=te),x.props=s,x.state=te,x.context=R,s=ie):(typeof x.componentDidUpdate!="function"||w===e.memoizedProps&&J===e.memoizedState||(n.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||w===e.memoizedProps&&J===e.memoizedState||(n.flags|=1024),s=!1)}return x=s,fo(e,n),s=(n.flags&128)!==0,x||s?(x=n.stateNode,r=s&&typeof r.getDerivedStateFromError!="function"?null:x.render(),n.flags|=1,e!==null&&s?(n.child=Ya(n,e.child,null,d),n.child=Ya(n,null,r,d)):rn(e,n,r,d),n.memoizedState=x.state,e=n.child):e=Fl(e,n,d),e}function ux(e,n,r,s){return Oa(),n.flags|=256,rn(e,n,r,s),n.child}var Bu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $u(e){return{baseLanes:e,cachePool:Ph()}}function Lu(e,n,r){return e=e!==null?e.childLanes&~r:0,n&&(e|=Rn),e}function fx(e,n,r){var s=n.pendingProps,d=!1,x=(n.flags&128)!==0,w;if((w=x)||(w=e!==null&&e.memoizedState===null?!1:(It.current&2)!==0),w&&(d=!0,n.flags&=-129),w=(n.flags&32)!==0,n.flags&=-33,e===null){if(nt){if(d?ra(n):ia(),(e=At)?(e=bp(e,Vn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Jl!==null?{id:fl,overflow:dl}:null,retryLane:536870912,hydrationErrors:null},r=qh(e),r.return=n,n.child=r,ln=n,At=null)):e=null,e===null)throw ea(n);return kf(e)?n.lanes=32:n.lanes=536870912,null}var C=s.children;return s=s.fallback,d?(ia(),d=n.mode,C=ho({mode:"hidden",children:C},d),s=Ra(s,d,r,null),C.return=n,s.return=n,C.sibling=s,n.child=C,s=n.child,s.memoizedState=$u(r),s.childLanes=Lu(e,w,r),n.memoizedState=Bu,zi(null,s)):(ra(n),Hu(n,C))}var R=e.memoizedState;if(R!==null&&(C=R.dehydrated,C!==null)){if(x)n.flags&256?(ra(n),n.flags&=-257,n=Uu(e,n,r)):n.memoizedState!==null?(ia(),n.child=e.child,n.flags|=128,n=null):(ia(),C=s.fallback,d=n.mode,s=ho({mode:"visible",children:s.children},d),C=Ra(C,d,r,null),C.flags|=2,s.return=n,C.return=n,s.sibling=C,n.child=s,Ya(n,e.child,null,r),s=n.child,s.memoizedState=$u(r),s.childLanes=Lu(e,w,r),n.memoizedState=Bu,n=zi(null,s));else if(ra(n),kf(C)){if(w=C.nextSibling&&C.nextSibling.dataset,w)var W=w.dgst;w=W,s=Error(i(419)),s.stack="",s.digest=w,bi({value:s,source:null,stack:null}),n=Uu(e,n,r)}else if(Kt||br(e,n,r,!1),w=(r&e.childLanes)!==0,Kt||w){if(w=jt,w!==null&&(s=Cs(w,r),s!==0&&s!==R.retryLane))throw R.retryLane=s,Fa(e,s),En(w,e,s),Ru;wf(C)||ko(),n=Uu(e,n,r)}else wf(C)?(n.flags|=192,n.child=e.child,n=null):(e=R.treeContext,At=Kn(C.nextSibling),ln=n,nt=!0,Pl=null,Vn=!1,e!==null&&Gh(n,e),n=Hu(n,s.children),n.flags|=4096);return n}return d?(ia(),C=s.fallback,d=n.mode,R=e.child,W=R.sibling,s=Al(R,{mode:"hidden",children:s.children}),s.subtreeFlags=R.subtreeFlags&65011712,W!==null?C=Al(W,C):(C=Ra(C,d,r,null),C.flags|=2),C.return=n,s.return=n,s.sibling=C,n.child=s,zi(null,s),s=n.child,C=e.child.memoizedState,C===null?C=$u(r):(d=C.cachePool,d!==null?(R=Vt._currentValue,d=d.parent!==R?{parent:R,pool:R}:d):d=Ph(),C={baseLanes:C.baseLanes|r,cachePool:d}),s.memoizedState=C,s.childLanes=Lu(e,w,r),n.memoizedState=Bu,zi(e.child,s)):(ra(n),r=e.child,e=r.sibling,r=Al(r,{mode:"visible",children:s.children}),r.return=n,r.sibling=null,e!==null&&(w=n.deletions,w===null?(n.deletions=[e],n.flags|=16):w.push(e)),n.child=r,n.memoizedState=null,r)}function Hu(e,n){return n=ho({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function ho(e,n){return e=zn(22,e,null,n),e.lanes=0,e}function Uu(e,n,r){return Ya(n,e.child,null,r),e=Hu(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function dx(e,n,r){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),nu(e.return,n,r)}function Yu(e,n,r,s,d,x){var w=e.memoizedState;w===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:r,tailMode:d,treeForkCount:x}:(w.isBackwards=n,w.rendering=null,w.renderingStartTime=0,w.last=s,w.tail=r,w.tailMode=d,w.treeForkCount=x)}function hx(e,n,r){var s=n.pendingProps,d=s.revealOrder,x=s.tail;s=s.children;var w=It.current,C=(w&2)!==0;if(C?(w=w&1|2,n.flags|=128):w&=1,A(It,w),rn(e,n,s,r),s=nt?gi:0,!C&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dx(e,r,n);else if(e.tag===19)dx(e,r,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(r=n.child,d=null;r!==null;)e=r.alternate,e!==null&&eo(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=n.child,n.child=null):(d=r.sibling,r.sibling=null),Yu(n,!1,d,r,x,s);break;case"backwards":case"unstable_legacy-backwards":for(r=null,d=n.child,n.child=null;d!==null;){if(e=d.alternate,e!==null&&eo(e)===null){n.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}Yu(n,!0,r,null,x,s);break;case"together":Yu(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function Fl(e,n,r){if(e!==null&&(n.dependencies=e.dependencies),ca|=n.lanes,(r&n.childLanes)===0)if(e!==null){if(br(e,n,r,!1),(r&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,r=Al(e,e.pendingProps),n.child=r,r.return=n;e.sibling!==null;)e=e.sibling,r=r.sibling=Al(e,e.pendingProps),r.return=n;r.sibling=null}return n.child}function Iu(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Vs(e)))}function m2(e,n,r){switch(n.tag){case 3:Ce(n,n.stateNode.containerInfo),ta(n,Vt,e.memoizedState.cache),Oa();break;case 27:case 5:pe(n);break;case 4:Ce(n,n.stateNode.containerInfo);break;case 10:ta(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,mu(n),null;break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(ra(n),n.flags|=128,null):(r&n.child.childLanes)!==0?fx(e,n,r):(ra(n),e=Fl(e,n,r),e!==null?e.sibling:null);ra(n);break;case 19:var d=(e.flags&128)!==0;if(s=(r&n.childLanes)!==0,s||(br(e,n,r,!1),s=(r&n.childLanes)!==0),d){if(s)return hx(e,n,r);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),A(It,It.current),s)break;return null;case 22:return n.lanes=0,rx(e,n,r,n.pendingProps);case 24:ta(n,Vt,e.memoizedState.cache)}return Fl(e,n,r)}function mx(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps)Kt=!0;else{if(!Iu(e,r)&&(n.flags&128)===0)return Kt=!1,m2(e,n,r);Kt=(e.flags&131072)!==0}else Kt=!1,nt&&(n.flags&1048576)!==0&&Vh(n,gi,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=Ha(n.elementType),n.type=e,typeof e=="function")Kc(e)?(s=qa(e,s),n.tag=1,n=cx(null,n,e,s,r)):(n.tag=0,n=Ou(null,n,e,s,r));else{if(e!=null){var d=e.$$typeof;if(d===O){n.tag=11,n=nx(null,n,e,s,r);break e}else if(d===q){n.tag=14,n=lx(null,n,e,s,r);break e}}throw n=ne(e)||e,Error(i(306,n,""))}}return n;case 0:return Ou(e,n,n.type,n.pendingProps,r);case 1:return s=n.type,d=qa(s,n.pendingProps),cx(e,n,s,d,r);case 3:e:{if(Ce(n,n.stateNode.containerInfo),e===null)throw Error(i(387));s=n.pendingProps;var x=n.memoizedState;d=x.element,cu(e,n),Ci(n,s,null,r);var w=n.memoizedState;if(s=w.cache,ta(n,Vt,s),s!==x.cache&&lu(n,[Vt],r,!0),Ei(),s=w.element,x.isDehydrated)if(x={element:s,isDehydrated:!1,cache:w.cache},n.updateQueue.baseState=x,n.memoizedState=x,n.flags&256){n=ux(e,n,s,r);break e}else if(s!==d){d=In(Error(i(424)),n),bi(d),n=ux(e,n,s,r);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(At=Kn(e.firstChild),ln=n,nt=!0,Pl=null,Vn=!0,r=rm(n,null,s,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(Oa(),s===d){n=Fl(e,n,r);break e}rn(e,n,s,r)}n=n.child}return n;case 26:return fo(e,n),e===null?(r=Ep(n.type,null,n.pendingProps,null))?n.memoizedState=r:nt||(r=n.type,e=n.pendingProps,s=Do(he.current).createElement(r),s[$t]=n,s[pt]=e,sn(s,r,e),Lt(s),n.stateNode=s):n.memoizedState=Ep(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return pe(n),e===null&&nt&&(s=n.stateNode=kp(n.type,n.pendingProps,he.current),ln=n,Vn=!0,d=At,ma(n.type)?(Sf=d,At=Kn(s.firstChild)):At=d),rn(e,n,n.pendingProps.children,r),fo(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&nt&&((d=s=At)&&(s=q2(s,n.type,n.pendingProps,Vn),s!==null?(n.stateNode=s,ln=n,At=Kn(s.firstChild),Vn=!1,d=!0):d=!1),d||ea(n)),pe(n),d=n.type,x=n.pendingProps,w=e!==null?e.memoizedProps:null,s=x.children,gf(d,x)?s=null:w!==null&&gf(d,w)&&(n.flags|=32),n.memoizedState!==null&&(d=pu(e,n,r2,null,null,r),Vi._currentValue=d),fo(e,n),rn(e,n,s,r),n.child;case 6:return e===null&&nt&&((e=r=At)&&(r=X2(r,n.pendingProps,Vn),r!==null?(n.stateNode=r,ln=n,At=null,e=!0):e=!1),e||ea(n)),null;case 13:return fx(e,n,r);case 4:return Ce(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=Ya(n,null,s,r):rn(e,n,s,r),n.child;case 11:return nx(e,n,n.type,n.pendingProps,r);case 7:return rn(e,n,n.pendingProps,r),n.child;case 8:return rn(e,n,n.pendingProps.children,r),n.child;case 12:return rn(e,n,n.pendingProps.children,r),n.child;case 10:return s=n.pendingProps,ta(n,n.type,s.value),rn(e,n,s.children,r),n.child;case 9:return d=n.type._context,s=n.pendingProps.children,$a(n),d=an(d),s=s(d),n.flags|=1,rn(e,n,s,r),n.child;case 14:return lx(e,n,n.type,n.pendingProps,r);case 15:return ax(e,n,n.type,n.pendingProps,r);case 19:return hx(e,n,r);case 31:return h2(e,n,r);case 22:return rx(e,n,r,n.pendingProps);case 24:return $a(n),s=an(Vt),e===null?(d=iu(),d===null&&(d=jt,x=au(),d.pooledCache=x,x.refCount++,x!==null&&(d.pooledCacheLanes|=r),d=x),n.memoizedState={parent:s,cache:d},ou(n),ta(n,Vt,d)):((e.lanes&r)!==0&&(cu(e,n),Ci(n,null,null,r),Ei()),d=e.memoizedState,x=n.memoizedState,d.parent!==s?(d={parent:s,cache:s},n.memoizedState=d,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=d),ta(n,Vt,s)):(s=x.cache,ta(n,Vt,s),s!==d.cache&&lu(n,[Vt],r,!0))),rn(e,n,n.pendingProps.children,r),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function Rl(e){e.flags|=4}function qu(e,n,r,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(Ux())e.flags|=8192;else throw Ua=Zs,su}else e.flags&=-16777217}function xx(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Tp(n))if(Ux())e.flags|=8192;else throw Ua=Zs,su}function mo(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?lr():536870912,e.lanes|=n,zr|=n)}function Mi(e,n){if(!nt)switch(e.tailMode){case"hidden":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Dt(e){var n=e.alternate!==null&&e.alternate.child===e.child,r=0,s=0;if(n)for(var d=e.child;d!==null;)r|=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;)r|=d.lanes|d.childLanes,s|=d.subtreeFlags,s|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=s,e.childLanes=r,n}function x2(e,n,r){var s=n.pendingProps;switch(Jc(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dt(n),null;case 1:return Dt(n),null;case 3:return r=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),zl(Vt),Oe(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(gr(n)?Rl(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,eu())),Dt(n),null;case 26:var d=n.type,x=n.memoizedState;return e===null?(Rl(n),x!==null?(Dt(n),xx(n,x)):(Dt(n),qu(n,d,null,s,r))):x?x!==e.memoizedState?(Rl(n),Dt(n),xx(n,x)):(Dt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&Rl(n),Dt(n),qu(n,d,e,s,r)),null;case 27:if(Ke(n),r=he.current,d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Rl(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return Dt(n),null}e=se.current,gr(n)?Kh(n):(e=kp(d,s,r),n.stateNode=e,Rl(n))}return Dt(n),null;case 5:if(Ke(n),d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Rl(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return Dt(n),null}if(x=se.current,gr(n))Kh(n);else{var w=Do(he.current);switch(x){case 1:x=w.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:x=w.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":x=w.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":x=w.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":x=w.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof s.is=="string"?w.createElement("select",{is:s.is}):w.createElement("select"),s.multiple?x.multiple=!0:s.size&&(x.size=s.size);break;default:x=typeof s.is=="string"?w.createElement(d,{is:s.is}):w.createElement(d)}}x[$t]=n,x[pt]=s;e:for(w=n.child;w!==null;){if(w.tag===5||w.tag===6)x.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=x;e:switch(sn(x,d,s),d){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Rl(n)}}return Dt(n),qu(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,r),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Rl(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(i(166));if(e=he.current,gr(n)){if(e=n.stateNode,r=n.memoizedProps,s=null,d=ln,d!==null)switch(d.tag){case 27:case 5:s=d.memoizedProps}e[$t]=n,e=!!(e.nodeValue===r||s!==null&&s.suppressHydrationWarning===!0||fp(e.nodeValue,r)),e||ea(n,!0)}else e=Do(e).createTextNode(s),e[$t]=n,n.stateNode=e}return Dt(n),null;case 31:if(r=n.memoizedState,e===null||e.memoizedState!==null){if(s=gr(n),r!==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[$t]=n}else Oa(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Dt(n),e=!1}else r=eu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return n.flags&256?(_n(n),n):(_n(n),null);if((n.flags&128)!==0)throw Error(i(558))}return Dt(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=gr(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[$t]=n}else Oa(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Dt(n),d=!1}else d=eu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return n.flags&256?(_n(n),n):(_n(n),null)}return _n(n),(n.flags&128)!==0?(n.lanes=r,n):(r=s!==null,e=e!==null&&e.memoizedState!==null,r&&(s=n.child,d=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(d=s.alternate.memoizedState.cachePool.pool),x=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(x=s.memoizedState.cachePool.pool),x!==d&&(s.flags|=2048)),r!==e&&r&&(n.child.flags|=8192),mo(n,n.updateQueue),Dt(n),null);case 4:return Oe(),e===null&&hf(n.stateNode.containerInfo),Dt(n),null;case 10:return zl(n.type),Dt(n),null;case 19:if(X(It),s=n.memoizedState,s===null)return Dt(n),null;if(d=(n.flags&128)!==0,x=s.rendering,x===null)if(d)Mi(s,!1);else{if(Ut!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(x=eo(e),x!==null){for(n.flags|=128,Mi(s,!1),e=x.updateQueue,n.updateQueue=e,mo(n,e),n.subtreeFlags=0,e=r,r=n.child;r!==null;)Ih(r,e),r=r.sibling;return A(It,It.current&1|2),nt&&Dl(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&Bt()>bo&&(n.flags|=128,d=!0,Mi(s,!1),n.lanes=4194304)}else{if(!d)if(e=eo(x),e!==null){if(n.flags|=128,d=!0,e=e.updateQueue,n.updateQueue=e,mo(n,e),Mi(s,!0),s.tail===null&&s.tailMode==="hidden"&&!x.alternate&&!nt)return Dt(n),null}else 2*Bt()-s.renderingStartTime>bo&&r!==536870912&&(n.flags|=128,d=!0,Mi(s,!1),n.lanes=4194304);s.isBackwards?(x.sibling=n.child,n.child=x):(e=s.last,e!==null?e.sibling=x:n.child=x,s.last=x)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Bt(),e.sibling=null,r=It.current,A(It,d?r&1|2:r&1),nt&&Dl(n,s.treeForkCount),e):(Dt(n),null);case 22:case 23:return _n(n),hu(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(r&536870912)!==0&&(n.flags&128)===0&&(Dt(n),n.subtreeFlags&6&&(n.flags|=8192)):Dt(n),r=n.updateQueue,r!==null&&mo(n,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==r&&(n.flags|=2048),e!==null&&X(La),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),zl(Vt),Dt(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function p2(e,n){switch(Jc(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return zl(Vt),Oe(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Ke(n),null;case 31:if(n.memoizedState!==null){if(_n(n),n.alternate===null)throw Error(i(340));Oa()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(_n(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Oa()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return X(It),null;case 4:return Oe(),null;case 10:return zl(n.type),null;case 22:case 23:return _n(n),hu(),e!==null&&X(La),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return zl(Vt),null;case 25:return null;default:return null}}function px(e,n){switch(Jc(n),n.tag){case 3:zl(Vt),Oe();break;case 26:case 27:case 5:Ke(n);break;case 4:Oe();break;case 31:n.memoizedState!==null&&_n(n);break;case 13:_n(n);break;case 19:X(It);break;case 10:zl(n.type);break;case 22:case 23:_n(n),hu(),e!==null&&X(La);break;case 24:zl(Vt)}}function _i(e,n){try{var r=n.updateQueue,s=r!==null?r.lastEffect:null;if(s!==null){var d=s.next;r=d;do{if((r.tag&e)===e){s=void 0;var x=r.create,w=r.inst;s=x(),w.destroy=s}r=r.next}while(r!==d)}}catch(C){bt(n,n.return,C)}}function sa(e,n,r){try{var s=n.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var x=d.next;s=x;do{if((s.tag&e)===e){var w=s.inst,C=w.destroy;if(C!==void 0){w.destroy=void 0,d=n;var R=r,W=C;try{W()}catch(ie){bt(d,R,ie)}}}s=s.next}while(s!==x)}}catch(ie){bt(n,n.return,ie)}}function yx(e){var n=e.updateQueue;if(n!==null){var r=e.stateNode;try{sm(n,r)}catch(s){bt(e,e.return,s)}}}function gx(e,n,r){r.props=qa(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(s){bt(e,n,s)}}function Fi(e,n){try{var r=e.ref;if(r!==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 r=="function"?e.refCleanup=r(s):r.current=s}}catch(d){bt(e,n,d)}}function hl(e,n){var r=e.ref,s=e.refCleanup;if(r!==null)if(typeof s=="function")try{s()}catch(d){bt(e,n,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(d){bt(e,n,d)}else r.current=null}function bx(e){var n=e.type,r=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&s.focus();break e;case"img":r.src?s.src=r.src:r.srcSet&&(s.srcset=r.srcSet)}}catch(d){bt(e,e.return,d)}}function Xu(e,n,r){try{var s=e.stateNode;$2(s,e.type,r,n),s[pt]=n}catch(d){bt(e,e.return,d)}}function vx(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ma(e.type)||e.tag===4}function Vu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vx(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&&ma(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 Gu(e,n,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(e),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=ht));else if(s!==4&&(s===27&&ma(e.type)&&(r=e.stateNode,n=null),e=e.child,e!==null))for(Gu(e,n,r),e=e.sibling;e!==null;)Gu(e,n,r),e=e.sibling}function xo(e,n,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?r.insertBefore(e,n):r.appendChild(e);else if(s!==4&&(s===27&&ma(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(xo(e,n,r),e=e.sibling;e!==null;)xo(e,n,r),e=e.sibling}function wx(e){var n=e.stateNode,r=e.memoizedProps;try{for(var s=e.type,d=n.attributes;d.length;)n.removeAttributeNode(d[0]);sn(n,s,r),n[$t]=e,n[pt]=r}catch(x){bt(e,e.return,x)}}var Ol=!1,Qt=!1,Ku=!1,kx=typeof WeakSet=="function"?WeakSet:Set,nn=null;function y2(e,n){if(e=e.containerInfo,pf=Oo,e=Fh(e),Uc(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var s=r.getSelection&&r.getSelection();if(s&&s.rangeCount!==0){r=s.anchorNode;var d=s.anchorOffset,x=s.focusNode;s=s.focusOffset;try{r.nodeType,x.nodeType}catch{r=null;break e}var w=0,C=-1,R=-1,W=0,ie=0,ce=e,J=null;t:for(;;){for(var te;ce!==r||d!==0&&ce.nodeType!==3||(C=w+d),ce!==x||s!==0&&ce.nodeType!==3||(R=w+s),ce.nodeType===3&&(w+=ce.nodeValue.length),(te=ce.firstChild)!==null;)J=ce,ce=te;for(;;){if(ce===e)break t;if(J===r&&++W===d&&(C=w),J===x&&++ie===s&&(R=w),(te=ce.nextSibling)!==null)break;ce=J,J=ce.parentNode}ce=te}r=C===-1||R===-1?null:{start:C,end:R}}else r=null}r=r||{start:0,end:0}}else r=null;for(yf={focusedElem:e,selectionRange:r},Oo=!1,nn=n;nn!==null;)if(n=nn,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,nn=e;else for(;nn!==null;){switch(n=nn,x=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(r=0;r<e.length;r++)d=e[r],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&x!==null){e=void 0,r=n,d=x.memoizedProps,x=x.memoizedState,s=r.stateNode;try{var je=qa(r.type,d);e=s.getSnapshotBeforeUpdate(je,x),s.__reactInternalSnapshotBeforeUpdate=e}catch(Fe){bt(r,r.return,Fe)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,r=e.nodeType,r===9)vf(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":vf(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=n.sibling,e!==null){e.return=n.return,nn=e;break}nn=n.return}}function Sx(e,n,r){var s=r.flags;switch(r.tag){case 0:case 11:case 15:$l(e,r),s&4&&_i(5,r);break;case 1:if($l(e,r),s&4)if(e=r.stateNode,n===null)try{e.componentDidMount()}catch(w){bt(r,r.return,w)}else{var d=qa(r.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(d,n,e.__reactInternalSnapshotBeforeUpdate)}catch(w){bt(r,r.return,w)}}s&64&&yx(r),s&512&&Fi(r,r.return);break;case 3:if($l(e,r),s&64&&(e=r.updateQueue,e!==null)){if(n=null,r.child!==null)switch(r.child.tag){case 27:case 5:n=r.child.stateNode;break;case 1:n=r.child.stateNode}try{sm(e,n)}catch(w){bt(r,r.return,w)}}break;case 27:n===null&&s&4&&wx(r);case 26:case 5:$l(e,r),n===null&&s&4&&bx(r),s&512&&Fi(r,r.return);break;case 12:$l(e,r);break;case 31:$l(e,r),s&4&&Cx(e,r);break;case 13:$l(e,r),s&4&&Nx(e,r),s&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=C2.bind(null,r),V2(e,r))));break;case 22:if(s=r.memoizedState!==null||Ol,!s){n=n!==null&&n.memoizedState!==null||Qt,d=Ol;var x=Qt;Ol=s,(Qt=n)&&!x?Ll(e,r,(r.subtreeFlags&8772)!==0):$l(e,r),Ol=d,Qt=x}break;case 30:break;default:$l(e,r)}}function jx(e){var n=e.alternate;n!==null&&(e.alternate=null,jx(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&ii(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 zt=null,wn=!1;function Bl(e,n,r){for(r=r.child;r!==null;)Ex(e,n,r),r=r.sibling}function Ex(e,n,r){if(ue&&typeof ue.onCommitFiberUnmount=="function")try{ue.onCommitFiberUnmount(Xe,r)}catch{}switch(r.tag){case 26:Qt||hl(r,n),Bl(e,n,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:Qt||hl(r,n);var s=zt,d=wn;ma(r.type)&&(zt=r.stateNode,wn=!1),Bl(e,n,r),Ii(r.stateNode),zt=s,wn=d;break;case 5:Qt||hl(r,n);case 6:if(s=zt,d=wn,zt=null,Bl(e,n,r),zt=s,wn=d,zt!==null)if(wn)try{(zt.nodeType===9?zt.body:zt.nodeName==="HTML"?zt.ownerDocument.body:zt).removeChild(r.stateNode)}catch(x){bt(r,n,x)}else try{zt.removeChild(r.stateNode)}catch(x){bt(r,n,x)}break;case 18:zt!==null&&(wn?(e=zt,yp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Lr(e)):yp(zt,r.stateNode));break;case 4:s=zt,d=wn,zt=r.stateNode.containerInfo,wn=!0,Bl(e,n,r),zt=s,wn=d;break;case 0:case 11:case 14:case 15:sa(2,r,n),Qt||sa(4,r,n),Bl(e,n,r);break;case 1:Qt||(hl(r,n),s=r.stateNode,typeof s.componentWillUnmount=="function"&&gx(r,n,s)),Bl(e,n,r);break;case 21:Bl(e,n,r);break;case 22:Qt=(s=Qt)||r.memoizedState!==null,Bl(e,n,r),Qt=s;break;default:Bl(e,n,r)}}function Cx(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Lr(e)}catch(r){bt(n,n.return,r)}}}function Nx(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Lr(e)}catch(r){bt(n,n.return,r)}}function g2(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new kx),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new kx),n;default:throw Error(i(435,e.tag))}}function po(e,n){var r=g2(e);n.forEach(function(s){if(!r.has(s)){r.add(s);var d=N2.bind(null,e,s);s.then(d,d)}})}function kn(e,n){var r=n.deletions;if(r!==null)for(var s=0;s<r.length;s++){var d=r[s],x=e,w=n,C=w;e:for(;C!==null;){switch(C.tag){case 27:if(ma(C.type)){zt=C.stateNode,wn=!1;break e}break;case 5:zt=C.stateNode,wn=!1;break e;case 3:case 4:zt=C.stateNode.containerInfo,wn=!0;break e}C=C.return}if(zt===null)throw Error(i(160));Ex(x,w,d),zt=null,wn=!1,x=d.alternate,x!==null&&(x.return=null),d.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Ax(n,e),n=n.sibling}var rl=null;function Ax(e,n){var r=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:kn(n,e),Sn(e),s&4&&(sa(3,e,e.return),_i(3,e),sa(5,e,e.return));break;case 1:kn(n,e),Sn(e),s&512&&(Qt||r===null||hl(r,r.return)),s&64&&Ol&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?s:r.concat(s))));break;case 26:var d=rl;if(kn(n,e),Sn(e),s&512&&(Qt||r===null||hl(r,r.return)),s&4){var x=r!==null?r.memoizedState:null;if(s=e.memoizedState,r===null)if(s===null)if(e.stateNode===null){e:{s=e.type,r=e.memoizedProps,d=d.ownerDocument||d;t:switch(s){case"title":x=d.getElementsByTagName("title")[0],(!x||x[ll]||x[$t]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=d.createElement(s),d.head.insertBefore(x,d.querySelector("head > title"))),sn(x,s,r),x[$t]=e,Lt(x),s=x;break e;case"link":var w=Ap("link","href",d).get(s+(r.href||""));if(w){for(var C=0;C<w.length;C++)if(x=w[C],x.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&x.getAttribute("rel")===(r.rel==null?null:r.rel)&&x.getAttribute("title")===(r.title==null?null:r.title)&&x.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){w.splice(C,1);break t}}x=d.createElement(s),sn(x,s,r),d.head.appendChild(x);break;case"meta":if(w=Ap("meta","content",d).get(s+(r.content||""))){for(C=0;C<w.length;C++)if(x=w[C],x.getAttribute("content")===(r.content==null?null:""+r.content)&&x.getAttribute("name")===(r.name==null?null:r.name)&&x.getAttribute("property")===(r.property==null?null:r.property)&&x.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&x.getAttribute("charset")===(r.charSet==null?null:r.charSet)){w.splice(C,1);break t}}x=d.createElement(s),sn(x,s,r),d.head.appendChild(x);break;default:throw Error(i(468,s))}x[$t]=e,Lt(x),s=x}e.stateNode=s}else Dp(d,e.type,e.stateNode);else e.stateNode=Np(d,s,e.memoizedProps);else x!==s?(x===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):x.count--,s===null?Dp(d,e.type,e.stateNode):Np(d,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Xu(e,e.memoizedProps,r.memoizedProps)}break;case 27:kn(n,e),Sn(e),s&512&&(Qt||r===null||hl(r,r.return)),r!==null&&s&4&&Xu(e,e.memoizedProps,r.memoizedProps);break;case 5:if(kn(n,e),Sn(e),s&512&&(Qt||r===null||hl(r,r.return)),e.flags&32){d=e.stateNode;try{ve(d,"")}catch(je){bt(e,e.return,je)}}s&4&&e.stateNode!=null&&(d=e.memoizedProps,Xu(e,d,r!==null?r.memoizedProps:d)),s&1024&&(Ku=!0);break;case 6:if(kn(n,e),Sn(e),s&4){if(e.stateNode===null)throw Error(i(162));s=e.memoizedProps,r=e.stateNode;try{r.nodeValue=s}catch(je){bt(e,e.return,je)}}break;case 3:if(Mo=null,d=rl,rl=To(n.containerInfo),kn(n,e),rl=d,Sn(e),s&4&&r!==null&&r.memoizedState.isDehydrated)try{Lr(n.containerInfo)}catch(je){bt(e,e.return,je)}Ku&&(Ku=!1,Dx(e));break;case 4:s=rl,rl=To(e.stateNode.containerInfo),kn(n,e),Sn(e),rl=s;break;case 12:kn(n,e),Sn(e);break;case 31:kn(n,e),Sn(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,po(e,s)));break;case 13:kn(n,e),Sn(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(go=Bt()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,po(e,s)));break;case 22:d=e.memoizedState!==null;var R=r!==null&&r.memoizedState!==null,W=Ol,ie=Qt;if(Ol=W||d,Qt=ie||R,kn(n,e),Qt=ie,Ol=W,Sn(e),s&8192)e:for(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,d&&(r===null||R||Ol||Qt||Xa(e)),r=null,n=e;;){if(n.tag===5||n.tag===26){if(r===null){R=r=n;try{if(x=R.stateNode,d)w=x.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{C=R.stateNode;var ce=R.memoizedProps.style,J=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;C.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(je){bt(R,R.return,je)}}}else if(n.tag===6){if(r===null){R=n;try{R.stateNode.nodeValue=d?"":R.memoizedProps}catch(je){bt(R,R.return,je)}}}else if(n.tag===18){if(r===null){R=n;try{var te=R.stateNode;d?gp(te,!0):gp(R.stateNode,!1)}catch(je){bt(R,R.return,je)}}}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;r===n&&(r=null),n=n.return}r===n&&(r=null),n.sibling.return=n.return,n=n.sibling}s&4&&(s=e.updateQueue,s!==null&&(r=s.retryQueue,r!==null&&(s.retryQueue=null,po(e,r))));break;case 19:kn(n,e),Sn(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,po(e,s)));break;case 30:break;case 21:break;default:kn(n,e),Sn(e)}}function Sn(e){var n=e.flags;if(n&2){try{for(var r,s=e.return;s!==null;){if(vx(s)){r=s;break}s=s.return}if(r==null)throw Error(i(160));switch(r.tag){case 27:var d=r.stateNode,x=Vu(e);xo(e,x,d);break;case 5:var w=r.stateNode;r.flags&32&&(ve(w,""),r.flags&=-33);var C=Vu(e);xo(e,C,w);break;case 3:case 4:var R=r.stateNode.containerInfo,W=Vu(e);Gu(e,W,R);break;default:throw Error(i(161))}}catch(ie){bt(e,e.return,ie)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Dx(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Dx(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function $l(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Sx(e,n.alternate,n),n=n.sibling}function Xa(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:sa(4,n,n.return),Xa(n);break;case 1:hl(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&gx(n,n.return,r),Xa(n);break;case 27:Ii(n.stateNode);case 26:case 5:hl(n,n.return),Xa(n);break;case 22:n.memoizedState===null&&Xa(n);break;case 30:Xa(n);break;default:Xa(n)}e=e.sibling}}function Ll(e,n,r){for(r=r&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,d=e,x=n,w=x.flags;switch(x.tag){case 0:case 11:case 15:Ll(d,x,r),_i(4,x);break;case 1:if(Ll(d,x,r),s=x,d=s.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(W){bt(s,s.return,W)}if(s=x,d=s.updateQueue,d!==null){var C=s.stateNode;try{var R=d.shared.hiddenCallbacks;if(R!==null)for(d.shared.hiddenCallbacks=null,d=0;d<R.length;d++)im(R[d],C)}catch(W){bt(s,s.return,W)}}r&&w&64&&yx(x),Fi(x,x.return);break;case 27:wx(x);case 26:case 5:Ll(d,x,r),r&&s===null&&w&4&&bx(x),Fi(x,x.return);break;case 12:Ll(d,x,r);break;case 31:Ll(d,x,r),r&&w&4&&Cx(d,x);break;case 13:Ll(d,x,r),r&&w&4&&Nx(d,x);break;case 22:x.memoizedState===null&&Ll(d,x,r),Fi(x,x.return);break;case 30:break;default:Ll(d,x,r)}n=n.sibling}}function Qu(e,n){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&vi(r))}function Zu(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&vi(e))}function il(e,n,r,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Tx(e,n,r,s),n=n.sibling}function Tx(e,n,r,s){var d=n.flags;switch(n.tag){case 0:case 11:case 15:il(e,n,r,s),d&2048&&_i(9,n);break;case 1:il(e,n,r,s);break;case 3:il(e,n,r,s),d&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&vi(e)));break;case 12:if(d&2048){il(e,n,r,s),e=n.stateNode;try{var x=n.memoizedProps,w=x.id,C=x.onPostCommit;typeof C=="function"&&C(w,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){bt(n,n.return,R)}}else il(e,n,r,s);break;case 31:il(e,n,r,s);break;case 13:il(e,n,r,s);break;case 23:break;case 22:x=n.stateNode,w=n.alternate,n.memoizedState!==null?x._visibility&2?il(e,n,r,s):Ri(e,n):x._visibility&2?il(e,n,r,s):(x._visibility|=2,Ar(e,n,r,s,(n.subtreeFlags&10256)!==0||!1)),d&2048&&Qu(w,n);break;case 24:il(e,n,r,s),d&2048&&Zu(n.alternate,n);break;default:il(e,n,r,s)}}function Ar(e,n,r,s,d){for(d=d&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var x=e,w=n,C=r,R=s,W=w.flags;switch(w.tag){case 0:case 11:case 15:Ar(x,w,C,R,d),_i(8,w);break;case 23:break;case 22:var ie=w.stateNode;w.memoizedState!==null?ie._visibility&2?Ar(x,w,C,R,d):Ri(x,w):(ie._visibility|=2,Ar(x,w,C,R,d)),d&&W&2048&&Qu(w.alternate,w);break;case 24:Ar(x,w,C,R,d),d&&W&2048&&Zu(w.alternate,w);break;default:Ar(x,w,C,R,d)}n=n.sibling}}function Ri(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var r=e,s=n,d=s.flags;switch(s.tag){case 22:Ri(r,s),d&2048&&Qu(s.alternate,s);break;case 24:Ri(r,s),d&2048&&Zu(s.alternate,s);break;default:Ri(r,s)}n=n.sibling}}var Oi=8192;function Dr(e,n,r){if(e.subtreeFlags&Oi)for(e=e.child;e!==null;)zx(e,n,r),e=e.sibling}function zx(e,n,r){switch(e.tag){case 26:Dr(e,n,r),e.flags&Oi&&e.memoizedState!==null&&ab(r,rl,e.memoizedState,e.memoizedProps);break;case 5:Dr(e,n,r);break;case 3:case 4:var s=rl;rl=To(e.stateNode.containerInfo),Dr(e,n,r),rl=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Oi,Oi=16777216,Dr(e,n,r),Oi=s):Dr(e,n,r));break;default:Dr(e,n,r)}}function Mx(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Bi(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];nn=s,Fx(s,e)}Mx(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)_x(e),e=e.sibling}function _x(e){switch(e.tag){case 0:case 11:case 15:Bi(e),e.flags&2048&&sa(9,e,e.return);break;case 3:Bi(e);break;case 12:Bi(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,yo(e)):Bi(e);break;default:Bi(e)}}function yo(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];nn=s,Fx(s,e)}Mx(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:sa(8,n,n.return),yo(n);break;case 22:r=n.stateNode,r._visibility&2&&(r._visibility&=-3,yo(n));break;default:yo(n)}e=e.sibling}}function Fx(e,n){for(;nn!==null;){var r=nn;switch(r.tag){case 0:case 11:case 15:sa(8,r,n);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var s=r.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:vi(r.memoizedState.cache)}if(s=r.child,s!==null)s.return=r,nn=s;else e:for(r=e;nn!==null;){s=nn;var d=s.sibling,x=s.return;if(jx(s),s===r){nn=null;break e}if(d!==null){d.return=x,nn=d;break e}nn=x}}}var b2={getCacheForType:function(e){var n=an(Vt),r=n.data.get(e);return r===void 0&&(r=e(),n.data.set(e,r)),r},cacheSignal:function(){return an(Vt).controller.signal}},v2=typeof WeakMap=="function"?WeakMap:Map,ft=0,jt=null,Qe=null,Pe=0,gt=0,Fn=null,oa=!1,Tr=!1,Wu=!1,Hl=0,Ut=0,ca=0,Va=0,Ju=0,Rn=0,zr=0,$i=null,jn=null,Pu=!1,go=0,Rx=0,bo=1/0,vo=null,ua=null,Wt=0,fa=null,Mr=null,Ul=0,ef=0,tf=null,Ox=null,Li=0,nf=null;function On(){return(ft&2)!==0&&Pe!==0?Pe&-Pe:Y.T!==null?cf():Sl()}function Bx(){if(Rn===0)if((Pe&536870912)===0||nt){var e=Pn;Pn<<=1,(Pn&3932160)===0&&(Pn=262144),Rn=e}else Rn=536870912;return e=Mn.current,e!==null&&(e.flags|=32),Rn}function En(e,n,r){(e===jt&&(gt===2||gt===9)||e.cancelPendingCommit!==null)&&(_r(e,0),da(e,Pe,Rn,!1)),An(e,r),((ft&2)===0||e!==jt)&&(e===jt&&((ft&2)===0&&(Va|=r),Ut===4&&da(e,Pe,Rn,!1)),ml(e))}function $x(e,n,r){if((ft&6)!==0)throw Error(i(327));var s=!r&&(n&127)===0&&(n&e.expiredLanes)===0||Gl(e,n),d=s?S2(e,n):af(e,n,!0),x=s;do{if(d===0){Tr&&!s&&da(e,n,0,!1);break}else{if(r=e.current.alternate,x&&!w2(r)){d=af(e,n,!1),x=!1;continue}if(d===2){if(x=n,e.errorRecoveryDisabledLanes&x)var w=0;else w=e.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){n=w;e:{var C=e;d=$i;var R=C.current.memoizedState.isDehydrated;if(R&&(_r(C,w).flags|=256),w=af(C,w,!1),w!==2){if(Wu&&!R){C.errorRecoveryDisabledLanes|=x,Va|=x,d=4;break e}x=jn,jn=d,x!==null&&(jn===null?jn=x:jn.push.apply(jn,x))}d=w}if(x=!1,d!==2)continue}}if(d===1){_r(e,0),da(e,n,0,!0);break}e:{switch(s=e,x=d,x){case 0:case 1:throw Error(i(345));case 4:if((n&4194048)!==n)break;case 6:da(s,n,Rn,!oa);break e;case 2:jn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(d=go+300-Bt(),10<d)){if(da(s,n,Rn,!oa),tl(s,0,!0)!==0)break e;Ul=n,s.timeoutHandle=xp(Lx.bind(null,s,r,jn,vo,Pu,n,Rn,Va,zr,oa,x,"Throttled",-0,0),d);break e}Lx(s,r,jn,vo,Pu,n,Rn,Va,zr,oa,x,null,-0,0)}}break}while(!0);ml(e)}function Lx(e,n,r,s,d,x,w,C,R,W,ie,ce,J,te){if(e.timeoutHandle=-1,ce=n.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ht},zx(n,x,ce);var je=(x&62914560)===x?go-Bt():(x&4194048)===x?Rx-Bt():0;if(je=rb(ce,je),je!==null){Ul=x,e.cancelPendingCommit=je(Gx.bind(null,e,n,x,r,s,d,w,C,R,ie,ce,null,J,te)),da(e,x,w,!W);return}}Gx(e,n,x,r,s,d,w,C,R)}function w2(e){for(var n=e;;){var r=n.tag;if((r===0||r===11||r===15)&&n.flags&16384&&(r=n.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var s=0;s<r.length;s++){var d=r[s],x=d.getSnapshot;d=d.value;try{if(!Tn(x(),d))return!1}catch{return!1}}if(r=n.child,n.subtreeFlags&16384&&r!==null)r.return=n,n=r;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 da(e,n,r,s){n&=~Ju,n&=~Va,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var d=n;0<d;){var x=31-it(d),w=1<<x;s[x]=-1,d&=~w}r!==0&&li(e,r,n)}function wo(){return(ft&6)===0?(Hi(0),!1):!0}function lf(){if(Qe!==null){if(gt===0)var e=Qe.return;else e=Qe,Tl=Ba=null,bu(e),Sr=null,ki=0,e=Qe;for(;e!==null;)px(e.alternate,e),e=e.return;Qe=null}}function _r(e,n){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,U2(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),Ul=0,lf(),jt=e,Qe=r=Al(e.current,null),Pe=n,gt=0,Fn=null,oa=!1,Tr=Gl(e,n),Wu=!1,zr=Rn=Ju=Va=ca=Ut=0,jn=$i=null,Pu=!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-it(s),x=1<<d;n|=e[d],s&=~x}return Hl=n,Us(),r}function Hx(e,n){Ue=null,Y.H=Ti,n===kr||n===Qs?(n=nm(),gt=3):n===su?(n=nm(),gt=4):gt=n===Ru?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Fn=n,Qe===null&&(Ut=1,co(e,In(n,e.current)))}function Ux(){var e=Mn.current;return e===null?!0:(Pe&4194048)===Pe?Gn===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?e===Gn:!1}function Yx(){var e=Y.H;return Y.H=Ti,e===null?Ti:e}function Ix(){var e=Y.A;return Y.A=b2,e}function ko(){Ut=4,oa||(Pe&4194048)!==Pe&&Mn.current!==null||(Tr=!0),(ca&134217727)===0&&(Va&134217727)===0||jt===null||da(jt,Pe,Rn,!1)}function af(e,n,r){var s=ft;ft|=2;var d=Yx(),x=Ix();(jt!==e||Pe!==n)&&(vo=null,_r(e,n)),n=!1;var w=Ut;e:do try{if(gt!==0&&Qe!==null){var C=Qe,R=Fn;switch(gt){case 8:lf(),w=6;break e;case 3:case 2:case 9:case 6:Mn.current===null&&(n=!0);var W=gt;if(gt=0,Fn=null,Fr(e,C,R,W),r&&Tr){w=0;break e}break;default:W=gt,gt=0,Fn=null,Fr(e,C,R,W)}}k2(),w=Ut;break}catch(ie){Hx(e,ie)}while(!0);return n&&e.shellSuspendCounter++,Tl=Ba=null,ft=s,Y.H=d,Y.A=x,Qe===null&&(jt=null,Pe=0,Us()),w}function k2(){for(;Qe!==null;)qx(Qe)}function S2(e,n){var r=ft;ft|=2;var s=Yx(),d=Ix();jt!==e||Pe!==n?(vo=null,bo=Bt()+500,_r(e,n)):Tr=Gl(e,n);e:do try{if(gt!==0&&Qe!==null){n=Qe;var x=Fn;t:switch(gt){case 1:gt=0,Fn=null,Fr(e,n,x,1);break;case 2:case 9:if(em(x)){gt=0,Fn=null,Xx(n);break}n=function(){gt!==2&&gt!==9||jt!==e||(gt=7),ml(e)},x.then(n,n);break e;case 3:gt=7;break e;case 4:gt=5;break e;case 7:em(x)?(gt=0,Fn=null,Xx(n)):(gt=0,Fn=null,Fr(e,n,x,7));break;case 5:var w=null;switch(Qe.tag){case 26:w=Qe.memoizedState;case 5:case 27:var C=Qe;if(w?Tp(w):C.stateNode.complete){gt=0,Fn=null;var R=C.sibling;if(R!==null)Qe=R;else{var W=C.return;W!==null?(Qe=W,So(W)):Qe=null}break t}}gt=0,Fn=null,Fr(e,n,x,5);break;case 6:gt=0,Fn=null,Fr(e,n,x,6);break;case 8:lf(),Ut=6;break e;default:throw Error(i(462))}}j2();break}catch(ie){Hx(e,ie)}while(!0);return Tl=Ba=null,Y.H=s,Y.A=d,ft=r,Qe!==null?0:(jt=null,Pe=0,Us(),Ut)}function j2(){for(;Qe!==null&&!Ot();)qx(Qe)}function qx(e){var n=mx(e.alternate,e,Hl);e.memoizedProps=e.pendingProps,n===null?So(e):Qe=n}function Xx(e){var n=e,r=n.alternate;switch(n.tag){case 15:case 0:n=ox(r,n,n.pendingProps,n.type,void 0,Pe);break;case 11:n=ox(r,n,n.pendingProps,n.type.render,n.ref,Pe);break;case 5:bu(n);default:px(r,n),n=Qe=Ih(n,Hl),n=mx(r,n,Hl)}e.memoizedProps=e.pendingProps,n===null?So(e):Qe=n}function Fr(e,n,r,s){Tl=Ba=null,bu(n),Sr=null,ki=0;var d=n.return;try{if(d2(e,d,n,r,Pe)){Ut=1,co(e,In(r,e.current)),Qe=null;return}}catch(x){if(d!==null)throw Qe=d,x;Ut=1,co(e,In(r,e.current)),Qe=null;return}n.flags&32768?(nt||s===1?e=!0:Tr||(Pe&536870912)!==0?e=!1:(oa=e=!0,(s===2||s===9||s===3||s===6)&&(s=Mn.current,s!==null&&s.tag===13&&(s.flags|=16384))),Vx(n,e)):So(n)}function So(e){var n=e;do{if((n.flags&32768)!==0){Vx(n,oa);return}e=n.return;var r=x2(n.alternate,n,Hl);if(r!==null){Qe=r;return}if(n=n.sibling,n!==null){Qe=n;return}Qe=n=e}while(n!==null);Ut===0&&(Ut=5)}function Vx(e,n){do{var r=p2(e.alternate,e);if(r!==null){r.flags&=32767,Qe=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!n&&(e=e.sibling,e!==null)){Qe=e;return}Qe=e=r}while(e!==null);Ut=6,Qe=null}function Gx(e,n,r,s,d,x,w,C,R){e.cancelPendingCommit=null;do jo();while(Wt!==0);if((ft&6)!==0)throw Error(i(327));if(n!==null){if(n===e.current)throw Error(i(177));if(x=n.lanes|n.childLanes,x|=Vc,ni(e,r,x,w,C,R),e===jt&&(Qe=jt=null,Pe=0),Mr=n,fa=e,Ul=r,ef=x,tf=d,Ox=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,A2(Te,function(){return Jx(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=Y.T,Y.T=null,d=Q.p,Q.p=2,w=ft,ft|=4;try{y2(e,n,r)}finally{ft=w,Q.p=d,Y.T=s}}Wt=1,Kx(),Qx(),Zx()}}function Kx(){if(Wt===1){Wt=0;var e=fa,n=Mr,r=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||r){r=Y.T,Y.T=null;var s=Q.p;Q.p=2;var d=ft;ft|=4;try{Ax(n,e);var x=yf,w=Fh(e.containerInfo),C=x.focusedElem,R=x.selectionRange;if(w!==C&&C&&C.ownerDocument&&_h(C.ownerDocument.documentElement,C)){if(R!==null&&Uc(C)){var W=R.start,ie=R.end;if(ie===void 0&&(ie=W),"selectionStart"in C)C.selectionStart=W,C.selectionEnd=Math.min(ie,C.value.length);else{var ce=C.ownerDocument||document,J=ce&&ce.defaultView||window;if(J.getSelection){var te=J.getSelection(),je=C.textContent.length,Fe=Math.min(R.start,je),kt=R.end===void 0?Fe:Math.min(R.end,je);!te.extend&&Fe>kt&&(w=kt,kt=Fe,Fe=w);var K=Mh(C,Fe),I=Mh(C,kt);if(K&&I&&(te.rangeCount!==1||te.anchorNode!==K.node||te.anchorOffset!==K.offset||te.focusNode!==I.node||te.focusOffset!==I.offset)){var Z=ce.createRange();Z.setStart(K.node,K.offset),te.removeAllRanges(),Fe>kt?(te.addRange(Z),te.extend(I.node,I.offset)):(Z.setEnd(I.node,I.offset),te.addRange(Z))}}}}for(ce=[],te=C;te=te.parentNode;)te.nodeType===1&&ce.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<ce.length;C++){var oe=ce[C];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Oo=!!pf,yf=pf=null}finally{ft=d,Q.p=s,Y.T=r}}e.current=n,Wt=2}}function Qx(){if(Wt===2){Wt=0;var e=fa,n=Mr,r=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||r){r=Y.T,Y.T=null;var s=Q.p;Q.p=2;var d=ft;ft|=4;try{Sx(e,n.alternate,n)}finally{ft=d,Q.p=s,Y.T=r}}Wt=3}}function Zx(){if(Wt===4||Wt===3){Wt=0,Ln();var e=fa,n=Mr,r=Ul,s=Ox;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Wt=5:(Wt=0,Mr=fa=null,Wx(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(ua=null),bn(r),n=n.stateNode,ue&&typeof ue.onCommitFiberRoot=="function")try{ue.onCommitFiberRoot(Xe,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=Y.T,d=Q.p,Q.p=2,Y.T=null;try{for(var x=e.onRecoverableError,w=0;w<s.length;w++){var C=s[w];x(C.value,{componentStack:C.stack})}}finally{Y.T=n,Q.p=d}}(Ul&3)!==0&&jo(),ml(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===nf?Li++:(Li=0,nf=e):Li=0,Hi(0)}}function Wx(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,vi(n)))}function jo(){return Kx(),Qx(),Zx(),Jx()}function Jx(){if(Wt!==5)return!1;var e=fa,n=ef;ef=0;var r=bn(Ul),s=Y.T,d=Q.p;try{Q.p=32>r?32:r,Y.T=null,r=tf,tf=null;var x=fa,w=Ul;if(Wt=0,Mr=fa=null,Ul=0,(ft&6)!==0)throw Error(i(331));var C=ft;if(ft|=4,_x(x.current),Tx(x,x.current,w,r),ft=C,Hi(0,!1),ue&&typeof ue.onPostCommitFiberRoot=="function")try{ue.onPostCommitFiberRoot(Xe,x)}catch{}return!0}finally{Q.p=d,Y.T=s,Wx(e,n)}}function Px(e,n,r){n=In(r,n),n=Fu(e.stateNode,n,2),e=aa(e,n,2),e!==null&&(An(e,2),ml(e))}function bt(e,n,r){if(e.tag===3)Px(e,e,r);else for(;n!==null;){if(n.tag===3){Px(n,e,r);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ua===null||!ua.has(s))){e=In(r,e),r=ex(2),s=aa(n,r,2),s!==null&&(tx(r,s,n,e),An(s,2),ml(s));break}}n=n.return}}function rf(e,n,r){var s=e.pingCache;if(s===null){s=e.pingCache=new v2;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(r)||(Wu=!0,d.add(r),e=E2.bind(null,e,n,r),n.then(e,e))}function E2(e,n,r){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,jt===e&&(Pe&r)===r&&(Ut===4||Ut===3&&(Pe&62914560)===Pe&&300>Bt()-go?(ft&2)===0&&_r(e,0):Ju|=r,zr===Pe&&(zr=0)),ml(e)}function ep(e,n){n===0&&(n=lr()),e=Fa(e,n),e!==null&&(An(e,n),ml(e))}function C2(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),ep(e,r)}function N2(e,n){var r=0;switch(e.tag){case 31:case 13:var s=e.stateNode,d=e.memoizedState;d!==null&&(r=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),ep(e,r)}function A2(e,n){return on(e,n)}var Eo=null,Rr=null,sf=!1,Co=!1,of=!1,ha=0;function ml(e){e!==Rr&&e.next===null&&(Rr===null?Eo=Rr=e:Rr=Rr.next=e),Co=!0,sf||(sf=!0,T2())}function Hi(e,n){if(!of&&Co){of=!0;do for(var r=!1,s=Eo;s!==null;){if(e!==0){var d=s.pendingLanes;if(d===0)var x=0;else{var w=s.suspendedLanes,C=s.pingedLanes;x=(1<<31-it(42|e)+1)-1,x&=d&~(w&~C),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(r=!0,ap(s,x))}else x=Pe,x=tl(s,s===jt?x:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(x&3)===0||Gl(s,x)||(r=!0,ap(s,x));s=s.next}while(r);of=!1}}function D2(){tp()}function tp(){Co=sf=!1;var e=0;ha!==0&&H2()&&(e=ha);for(var n=Bt(),r=null,s=Eo;s!==null;){var d=s.next,x=np(s,n);x===0?(s.next=null,r===null?Eo=d:r.next=d,d===null&&(Rr=r)):(r=s,(e!==0||(x&3)!==0)&&(Co=!0)),s=d}Wt!==0&&Wt!==5||Hi(e),ha!==0&&(ha=0)}function np(e,n){for(var r=e.suspendedLanes,s=e.pingedLanes,d=e.expirationTimes,x=e.pendingLanes&-62914561;0<x;){var w=31-it(x),C=1<<w,R=d[w];R===-1?((C&r)===0||(C&s)!==0)&&(d[w]=Es(C,n)):R<=n&&(e.expiredLanes|=C),x&=~C}if(n=jt,r=Pe,r=tl(e,e===n?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,r===0||e===n&&(gt===2||gt===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Ct(s),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Gl(e,r)){if(n=r&-r,n===e.callbackPriority)return n;switch(s!==null&&Ct(s),bn(r)){case 2:case 8:r=ye;break;case 32:r=Te;break;case 268435456:r=be;break;default:r=Te}return s=lp.bind(null,e),r=on(r,s),e.callbackPriority=n,e.callbackNode=r,n}return s!==null&&s!==null&&Ct(s),e.callbackPriority=2,e.callbackNode=null,2}function lp(e,n){if(Wt!==0&&Wt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(jo()&&e.callbackNode!==r)return null;var s=Pe;return s=tl(e,e===jt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:($x(e,s,n),np(e,Bt()),e.callbackNode!=null&&e.callbackNode===r?lp.bind(null,e):null)}function ap(e,n){if(jo())return null;$x(e,n,!0)}function T2(){Y2(function(){(ft&6)!==0?on(le,D2):tp()})}function cf(){if(ha===0){var e=vr;e===0&&(e=Jn,Jn<<=1,(Jn&261888)===0&&(Jn=256)),ha=e}return ha}function rp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Le(""+e)}function ip(e,n){var r=n.ownerDocument.createElement("input");return r.name=n.name,r.value=n.value,e.id&&r.setAttribute("form",e.id),n.parentNode.insertBefore(r,n),e=new FormData(e),r.parentNode.removeChild(r),e}function z2(e,n,r,s,d){if(n==="submit"&&r&&r.stateNode===d){var x=rp((d[pt]||null).action),w=s.submitter;w&&(n=(n=w[pt]||null)?rp(n.formAction):w.getAttribute("formAction"),n!==null&&(x=n,w=null));var C=new Bs("action","action",null,s,d);e.push({event:C,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(ha!==0){var R=w?ip(d,w):new FormData(d);Au(r,{pending:!0,data:R,method:d.method,action:x},null,R)}}else typeof x=="function"&&(C.preventDefault(),R=w?ip(d,w):new FormData(d),Au(r,{pending:!0,data:R,method:d.method,action:x},x,R))},currentTarget:d}]})}}for(var uf=0;uf<Xc.length;uf++){var ff=Xc[uf],M2=ff.toLowerCase(),_2=ff[0].toUpperCase()+ff.slice(1);al(M2,"on"+_2)}al(Bh,"onAnimationEnd"),al($h,"onAnimationIteration"),al(Lh,"onAnimationStart"),al("dblclick","onDoubleClick"),al("focusin","onFocus"),al("focusout","onBlur"),al(Qg,"onTransitionRun"),al(Zg,"onTransitionStart"),al(Wg,"onTransitionCancel"),al(Hh,"onTransitionEnd"),Zl("onMouseEnter",["mouseout","mouseover"]),Zl("onMouseLeave",["mouseout","mouseover"]),Zl("onPointerEnter",["pointerout","pointerover"]),Zl("onPointerLeave",["pointerout","pointerover"]),ul("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ul("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ul("onBeforeInput",["compositionend","keypress","textInput","paste"]),ul("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ul("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ul("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(" "),F2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ui));function sp(e,n){n=(n&4)!==0;for(var r=0;r<e.length;r++){var s=e[r],d=s.event;s=s.listeners;e:{var x=void 0;if(n)for(var w=s.length-1;0<=w;w--){var C=s[w],R=C.instance,W=C.currentTarget;if(C=C.listener,R!==x&&d.isPropagationStopped())break e;x=C,d.currentTarget=W;try{x(d)}catch(ie){Hs(ie)}d.currentTarget=null,x=R}else for(w=0;w<s.length;w++){if(C=s[w],R=C.instance,W=C.currentTarget,C=C.listener,R!==x&&d.isPropagationStopped())break e;x=C,d.currentTarget=W;try{x(d)}catch(ie){Hs(ie)}d.currentTarget=null,x=R}}}}function Ze(e,n){var r=n[Dn];r===void 0&&(r=n[Dn]=new Set);var s=e+"__bubble";r.has(s)||(op(n,e,2,!1),r.add(s))}function df(e,n,r){var s=0;n&&(s|=4),op(r,e,s,n)}var No="_reactListening"+Math.random().toString(36).slice(2);function hf(e){if(!e[No]){e[No]=!0,Ds.forEach(function(r){r!=="selectionchange"&&(F2.has(r)||df(r,!1,e),df(r,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[No]||(n[No]=!0,df("selectionchange",!1,n))}}function op(e,n,r,s){switch(Bp(n)){case 2:var d=ob;break;case 8:d=cb;break;default:d=Af}r=d.bind(null,n,r,e),d=void 0,!Mc||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(d=!0),s?d!==void 0?e.addEventListener(n,r,{capture:!0,passive:d}):e.addEventListener(n,r,!0):d!==void 0?e.addEventListener(n,r,{passive:d}):e.addEventListener(n,r,!1)}function mf(e,n,r,s,d){var x=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 C=s.stateNode.containerInfo;if(C===d)break;if(w===4)for(w=s.return;w!==null;){var R=w.tag;if((R===3||R===4)&&w.stateNode.containerInfo===d)return;w=w.return}for(;C!==null;){if(w=Tt(C),w===null)return;if(R=w.tag,R===5||R===6||R===26||R===27){s=x=w;continue e}C=C.parentNode}}s=s.return}hh(function(){var W=x,ie=Tc(r),ce=[];e:{var J=Uh.get(e);if(J!==void 0){var te=Bs,je=e;switch(e){case"keypress":if(Rs(r)===0)break e;case"keydown":case"keyup":te=Ng;break;case"focusin":je="focus",te=Oc;break;case"focusout":je="blur",te=Oc;break;case"beforeblur":case"afterblur":te=Oc;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=ph;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=xg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=Tg;break;case Bh:case $h:case Lh:te=gg;break;case Hh:te=Mg;break;case"scroll":case"scrollend":te=hg;break;case"wheel":te=Fg;break;case"copy":case"cut":case"paste":te=vg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=gh;break;case"toggle":case"beforetoggle":te=Og}var Fe=(n&4)!==0,kt=!Fe&&(e==="scroll"||e==="scrollend"),K=Fe?J!==null?J+"Capture":null:J;Fe=[];for(var I=W,Z;I!==null;){var oe=I;if(Z=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Z===null||K===null||(oe=ci(I,K),oe!=null&&Fe.push(Yi(I,oe,Z))),kt)break;I=I.return}0<Fe.length&&(J=new te(J,je,null,r,ie),ce.push({event:J,listeners:Fe}))}}if((n&7)===0){e:{if(J=e==="mouseover"||e==="pointerover",te=e==="mouseout"||e==="pointerout",J&&r!==Dc&&(je=r.relatedTarget||r.fromElement)&&(Tt(je)||je[nl]))break e;if((te||J)&&(J=ie.window===ie?ie:(J=ie.ownerDocument)?J.defaultView||J.parentWindow:window,te?(je=r.relatedTarget||r.toElement,te=W,je=je?Tt(je):null,je!==null&&(kt=u(je),Fe=je.tag,je!==kt||Fe!==5&&Fe!==27&&Fe!==6)&&(je=null)):(te=null,je=W),te!==je)){if(Fe=ph,oe="onMouseLeave",K="onMouseEnter",I="mouse",(e==="pointerout"||e==="pointerover")&&(Fe=gh,oe="onPointerLeave",K="onPointerEnter",I="pointer"),kt=te==null?J:Ta(te),Z=je==null?J:Ta(je),J=new Fe(oe,I+"leave",te,r,ie),J.target=kt,J.relatedTarget=Z,oe=null,Tt(ie)===W&&(Fe=new Fe(K,I+"enter",je,r,ie),Fe.target=Z,Fe.relatedTarget=kt,oe=Fe),kt=oe,te&&je)t:{for(Fe=R2,K=te,I=je,Z=0,oe=K;oe;oe=Fe(oe))Z++;oe=0;for(var ze=I;ze;ze=Fe(ze))oe++;for(;0<Z-oe;)K=Fe(K),Z--;for(;0<oe-Z;)I=Fe(I),oe--;for(;Z--;){if(K===I||I!==null&&K===I.alternate){Fe=K;break t}K=Fe(K),I=Fe(I)}Fe=null}else Fe=null;te!==null&&cp(ce,J,te,Fe,!1),je!==null&&kt!==null&&cp(ce,kt,je,Fe,!0)}}e:{if(J=W?Ta(W):window,te=J.nodeName&&J.nodeName.toLowerCase(),te==="select"||te==="input"&&J.type==="file")var ot=Ch;else if(jh(J))if(Nh)ot=Vg;else{ot=qg;var Ne=Ig}else te=J.nodeName,!te||te.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?W&&Be(W.elementType)&&(ot=Ch):ot=Xg;if(ot&&(ot=ot(e,W))){Eh(ce,ot,r,ie);break e}Ne&&Ne(e,J,W),e==="focusout"&&W&&J.type==="number"&&W.memoizedProps.value!=null&&or(J,"number",J.value)}switch(Ne=W?Ta(W):window,e){case"focusin":(jh(Ne)||Ne.contentEditable==="true")&&(dr=Ne,Yc=W,yi=null);break;case"focusout":yi=Yc=dr=null;break;case"mousedown":Ic=!0;break;case"contextmenu":case"mouseup":case"dragend":Ic=!1,Rh(ce,r,ie);break;case"selectionchange":if(Kg)break;case"keydown":case"keyup":Rh(ce,r,ie)}var Ye;if($c)e:{switch(e){case"compositionstart":var et="onCompositionStart";break e;case"compositionend":et="onCompositionEnd";break e;case"compositionupdate":et="onCompositionUpdate";break e}et=void 0}else fr?kh(e,r)&&(et="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(et="onCompositionStart");et&&(bh&&r.locale!=="ko"&&(fr||et!=="onCompositionStart"?et==="onCompositionEnd"&&fr&&(Ye=mh()):(Wl=ie,_c="value"in Wl?Wl.value:Wl.textContent,fr=!0)),Ne=Ao(W,et),0<Ne.length&&(et=new yh(et,e,null,r,ie),ce.push({event:et,listeners:Ne}),Ye?et.data=Ye:(Ye=Sh(r),Ye!==null&&(et.data=Ye)))),(Ye=$g?Lg(e,r):Hg(e,r))&&(et=Ao(W,"onBeforeInput"),0<et.length&&(Ne=new yh("onBeforeInput","beforeinput",null,r,ie),ce.push({event:Ne,listeners:et}),Ne.data=Ye)),z2(ce,e,W,r,ie)}sp(ce,n)})}function Yi(e,n,r){return{instance:e,listener:n,currentTarget:r}}function Ao(e,n){for(var r=n+"Capture",s=[];e!==null;){var d=e,x=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||x===null||(d=ci(e,r),d!=null&&s.unshift(Yi(e,d,x)),d=ci(e,n),d!=null&&s.push(Yi(e,d,x))),e.tag===3)return s;e=e.return}return[]}function R2(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function cp(e,n,r,s,d){for(var x=n._reactName,w=[];r!==null&&r!==s;){var C=r,R=C.alternate,W=C.stateNode;if(C=C.tag,R!==null&&R===s)break;C!==5&&C!==26&&C!==27||W===null||(R=W,d?(W=ci(r,x),W!=null&&w.unshift(Yi(r,W,R))):d||(W=ci(r,x),W!=null&&w.push(Yi(r,W,R)))),r=r.return}w.length!==0&&e.push({event:n,listeners:w})}var O2=/\r\n?/g,B2=/\u0000|\uFFFD/g;function up(e){return(typeof e=="string"?e:""+e).replace(O2,`
49
+ `).replace(B2,"")}function fp(e,n){return n=up(n),up(e)===n}function wt(e,n,r,s,d,x){switch(r){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||ve(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&ve(e,""+s);break;case"className":ir(e,"class",s);break;case"tabIndex":ir(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":ir(e,r,s);break;case"style":Me(e,s,x);break;case"data":if(n!=="object"){ir(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||r!=="href")){e.removeAttribute(r);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(r);break}s=Le(""+s),e.setAttribute(r,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(r,"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 x=="function"&&(r==="formAction"?(n!=="input"&&wt(e,n,"name",d.name,d,null),wt(e,n,"formEncType",d.formEncType,d,null),wt(e,n,"formMethod",d.formMethod,d,null),wt(e,n,"formTarget",d.formTarget,d,null)):(wt(e,n,"encType",d.encType,d,null),wt(e,n,"method",d.method,d,null),wt(e,n,"target",d.target,d,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(r);break}s=Le(""+s),e.setAttribute(r,s);break;case"onClick":s!=null&&(e.onclick=ht);break;case"onScroll":s!=null&&Ze("scroll",e);break;case"onScrollEnd":s!=null&&Ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(r=s.__html,r!=null){if(d.children!=null)throw Error(i(60));e.innerHTML=r}}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}r=Le(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);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(r,""+s):e.removeAttribute(r);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(r,""):e.removeAttribute(r);break;case"capture":case"download":s===!0?e.setAttribute(r,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(r,s):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(r,s):e.removeAttribute(r);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(r):e.setAttribute(r,s);break;case"popover":Ze("beforetoggle",e),Ze("toggle",e),rr(e,"popover",s);break;case"xlinkActuate":tn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":tn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":tn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":tn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":tn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":tn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":tn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":tn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":tn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":rr(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=Je.get(r)||r,rr(e,r,s))}}function xf(e,n,r,s,d,x){switch(r){case"style":Me(e,s,x);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(r=s.__html,r!=null){if(d.children!=null)throw Error(i(60));e.innerHTML=r}}break;case"children":typeof s=="string"?ve(e,s):(typeof s=="number"||typeof s=="bigint")&&ve(e,""+s);break;case"onScroll":s!=null&&Ze("scroll",e);break;case"onScrollEnd":s!=null&&Ze("scrollend",e);break;case"onClick":s!=null&&(e.onclick=ht);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ts.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(d=r.endsWith("Capture"),n=r.slice(2,d?r.length-7:void 0),x=e[pt]||null,x=x!=null?x[r]:null,typeof x=="function"&&e.removeEventListener(n,x,d),typeof s=="function")){typeof x!="function"&&x!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(n,s,d);break e}r in e?e[r]=s:s===!0?e.setAttribute(r,""):rr(e,r,s)}}}function sn(e,n,r){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",e),Ze("load",e);var s=!1,d=!1,x;for(x in r)if(r.hasOwnProperty(x)){var w=r[x];if(w!=null)switch(x){case"src":s=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:wt(e,n,x,w,r,null)}}d&&wt(e,n,"srcSet",r.srcSet,r,null),s&&wt(e,n,"src",r.src,r,null);return;case"input":Ze("invalid",e);var C=x=w=d=null,R=null,W=null;for(s in r)if(r.hasOwnProperty(s)){var ie=r[s];if(ie!=null)switch(s){case"name":d=ie;break;case"type":w=ie;break;case"checked":R=ie;break;case"defaultChecked":W=ie;break;case"value":x=ie;break;case"defaultValue":C=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(i(137,n));break;default:wt(e,n,s,ie,r,null)}}oi(e,x,C,R,W,w,d,!1);return;case"select":Ze("invalid",e),s=w=x=null;for(d in r)if(r.hasOwnProperty(d)&&(C=r[d],C!=null))switch(d){case"value":x=C;break;case"defaultValue":w=C;break;case"multiple":s=C;default:wt(e,n,d,C,r,null)}n=x,r=w,e.multiple=!!s,n!=null?Cl(e,!!s,n,!1):r!=null&&Cl(e,!!s,r,!0);return;case"textarea":Ze("invalid",e),x=d=s=null;for(w in r)if(r.hasOwnProperty(w)&&(C=r[w],C!=null))switch(w){case"value":s=C;break;case"defaultValue":d=C;break;case"children":x=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(i(91));break;default:wt(e,n,w,C,r,null)}fe(e,s,d,x);return;case"option":for(R in r)if(r.hasOwnProperty(R)&&(s=r[R],s!=null))switch(R){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:wt(e,n,R,s,r,null)}return;case"dialog":Ze("beforetoggle",e),Ze("toggle",e),Ze("cancel",e),Ze("close",e);break;case"iframe":case"object":Ze("load",e);break;case"video":case"audio":for(s=0;s<Ui.length;s++)Ze(Ui[s],e);break;case"image":Ze("error",e),Ze("load",e);break;case"details":Ze("toggle",e);break;case"embed":case"source":case"link":Ze("error",e),Ze("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(W in r)if(r.hasOwnProperty(W)&&(s=r[W],s!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:wt(e,n,W,s,r,null)}return;default:if(Be(n)){for(ie in r)r.hasOwnProperty(ie)&&(s=r[ie],s!==void 0&&xf(e,n,ie,s,r,void 0));return}}for(C in r)r.hasOwnProperty(C)&&(s=r[C],s!=null&&wt(e,n,C,s,r,null))}function $2(e,n,r,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,x=null,w=null,C=null,R=null,W=null,ie=null;for(te in r){var ce=r[te];if(r.hasOwnProperty(te)&&ce!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":R=ce;default:s.hasOwnProperty(te)||wt(e,n,te,null,s,ce)}}for(var J in s){var te=s[J];if(ce=r[J],s.hasOwnProperty(J)&&(te!=null||ce!=null))switch(J){case"type":x=te;break;case"name":d=te;break;case"checked":W=te;break;case"defaultChecked":ie=te;break;case"value":w=te;break;case"defaultValue":C=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(i(137,n));break;default:te!==ce&&wt(e,n,J,te,s,ce)}}El(e,w,C,R,W,ie,x,d);return;case"select":te=w=C=J=null;for(x in r)if(R=r[x],r.hasOwnProperty(x)&&R!=null)switch(x){case"value":break;case"multiple":te=R;default:s.hasOwnProperty(x)||wt(e,n,x,null,s,R)}for(d in s)if(x=s[d],R=r[d],s.hasOwnProperty(d)&&(x!=null||R!=null))switch(d){case"value":J=x;break;case"defaultValue":C=x;break;case"multiple":w=x;default:x!==R&&wt(e,n,d,x,s,R)}n=C,r=w,s=te,J!=null?Cl(e,!!r,J,!1):!!s!=!!r&&(n!=null?Cl(e,!!r,n,!0):Cl(e,!!r,r?[]:"",!1));return;case"textarea":te=J=null;for(C in r)if(d=r[C],r.hasOwnProperty(C)&&d!=null&&!s.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:wt(e,n,C,null,s,d)}for(w in s)if(d=s[w],x=r[w],s.hasOwnProperty(w)&&(d!=null||x!=null))switch(w){case"value":J=d;break;case"defaultValue":te=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(i(91));break;default:d!==x&&wt(e,n,w,d,s,x)}H(e,J,te);return;case"option":for(var je in r)if(J=r[je],r.hasOwnProperty(je)&&J!=null&&!s.hasOwnProperty(je))switch(je){case"selected":e.selected=!1;break;default:wt(e,n,je,null,s,J)}for(R in s)if(J=s[R],te=r[R],s.hasOwnProperty(R)&&J!==te&&(J!=null||te!=null))switch(R){case"selected":e.selected=J&&typeof J!="function"&&typeof J!="symbol";break;default:wt(e,n,R,J,s,te)}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 Fe in r)J=r[Fe],r.hasOwnProperty(Fe)&&J!=null&&!s.hasOwnProperty(Fe)&&wt(e,n,Fe,null,s,J);for(W in s)if(J=s[W],te=r[W],s.hasOwnProperty(W)&&J!==te&&(J!=null||te!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(i(137,n));break;default:wt(e,n,W,J,s,te)}return;default:if(Be(n)){for(var kt in r)J=r[kt],r.hasOwnProperty(kt)&&J!==void 0&&!s.hasOwnProperty(kt)&&xf(e,n,kt,void 0,s,J);for(ie in s)J=s[ie],te=r[ie],!s.hasOwnProperty(ie)||J===te||J===void 0&&te===void 0||xf(e,n,ie,J,s,te);return}}for(var K in r)J=r[K],r.hasOwnProperty(K)&&J!=null&&!s.hasOwnProperty(K)&&wt(e,n,K,null,s,J);for(ce in s)J=s[ce],te=r[ce],!s.hasOwnProperty(ce)||J===te||J==null&&te==null||wt(e,n,ce,J,s,te)}function dp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function L2(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,r=performance.getEntriesByType("resource"),s=0;s<r.length;s++){var d=r[s],x=d.transferSize,w=d.initiatorType,C=d.duration;if(x&&C&&dp(w)){for(w=0,C=d.responseEnd,s+=1;s<r.length;s++){var R=r[s],W=R.startTime;if(W>C)break;var ie=R.transferSize,ce=R.initiatorType;ie&&dp(ce)&&(R=R.responseEnd,w+=ie*(R<C?1:(C-W)/(R-W)))}if(--s,n+=8*(x+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 pf=null,yf=null;function Do(e){return e.nodeType===9?e:e.ownerDocument}function hp(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 mp(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 gf(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 bf=null;function H2(){var e=window.event;return e&&e.type==="popstate"?e===bf?!1:(bf=e,!0):(bf=null,!1)}var xp=typeof setTimeout=="function"?setTimeout:void 0,U2=typeof clearTimeout=="function"?clearTimeout:void 0,pp=typeof Promise=="function"?Promise:void 0,Y2=typeof queueMicrotask=="function"?queueMicrotask:typeof pp<"u"?function(e){return pp.resolve(null).then(e).catch(I2)}:xp;function I2(e){setTimeout(function(){throw e})}function ma(e){return e==="head"}function yp(e,n){var r=n,s=0;do{var d=r.nextSibling;if(e.removeChild(r),d&&d.nodeType===8)if(r=d.data,r==="/$"||r==="/&"){if(s===0){e.removeChild(d),Lr(n);return}s--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")s++;else if(r==="html")Ii(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Ii(r);for(var x=r.firstChild;x;){var w=x.nextSibling,C=x.nodeName;x[ll]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&x.rel.toLowerCase()==="stylesheet"||r.removeChild(x),x=w}}else r==="body"&&Ii(e.ownerDocument.body);r=d}while(r);Lr(n)}function gp(e,n){var r=e;e=0;do{var s=r.nextSibling;if(r.nodeType===1?n?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(n?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=s}while(r)}function vf(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var r=n;switch(n=n.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":vf(r),ii(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function q2(e,n,r,s){for(;e.nodeType===1;){var d=r;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[ll])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(x=e.getAttribute("rel"),x==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(x!==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(x=e.getAttribute("src"),(x!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&x&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var x=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===x)return e}else return e;if(e=Kn(e.nextSibling),e===null)break}return null}function X2(e,n,r){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=Kn(e.nextSibling),e===null))return null;return e}function bp(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Kn(e.nextSibling),e===null))return null;return e}function wf(e){return e.data==="$?"||e.data==="$~"}function kf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function V2(e,n){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||r.readyState!=="loading")n();else{var s=function(){n(),r.removeEventListener("DOMContentLoaded",s)};r.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Kn(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 Sf=null;function vp(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(n===0)return Kn(e.nextSibling);n--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||n++}e=e.nextSibling}return null}function wp(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(n===0)return e;n--}else r!=="/$"&&r!=="/&"||n++}e=e.previousSibling}return null}function kp(e,n,r){switch(n=Do(r),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 Ii(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);ii(e)}var Qn=new Map,Sp=new Set;function To(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Yl=Q.d;Q.d={f:G2,r:K2,D:Q2,C:Z2,L:W2,m:J2,X:eb,S:P2,M:tb};function G2(){var e=Yl.f(),n=wo();return e||n}function K2(e){var n=Ql(e);n!==null&&n.tag===5&&n.type==="form"?Hm(n):Yl.r(e)}var Or=typeof document>"u"?null:document;function jp(e,n,r){var s=Or;if(s&&typeof n=="string"&&n){var d=yt(n);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),Sp.has(d)||(Sp.add(d),e={rel:e,crossOrigin:r,href:n},s.querySelector(d)===null&&(n=s.createElement("link"),sn(n,"link",e),Lt(n),s.head.appendChild(n)))}}function Q2(e){Yl.D(e),jp("dns-prefetch",e,null)}function Z2(e,n){Yl.C(e,n),jp("preconnect",e,n)}function W2(e,n,r){Yl.L(e,n,r);var s=Or;if(s&&e&&n){var d='link[rel="preload"][as="'+yt(n)+'"]';n==="image"&&r&&r.imageSrcSet?(d+='[imagesrcset="'+yt(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(d+='[imagesizes="'+yt(r.imageSizes)+'"]')):d+='[href="'+yt(e)+'"]';var x=d;switch(n){case"style":x=Br(e);break;case"script":x=$r(e)}Qn.has(x)||(e=y({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:e,as:n},r),Qn.set(x,e),s.querySelector(d)!==null||n==="style"&&s.querySelector(qi(x))||n==="script"&&s.querySelector(Xi(x))||(n=s.createElement("link"),sn(n,"link",e),Lt(n),s.head.appendChild(n)))}}function J2(e,n){Yl.m(e,n);var r=Or;if(r&&e){var s=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+yt(s)+'"][href="'+yt(e)+'"]',x=d;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=$r(e)}if(!Qn.has(x)&&(e=y({rel:"modulepreload",href:e},n),Qn.set(x,e),r.querySelector(d)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Xi(x)))return}s=r.createElement("link"),sn(s,"link",e),Lt(s),r.head.appendChild(s)}}}function P2(e,n,r){Yl.S(e,n,r);var s=Or;if(s&&e){var d=jl(s).hoistableStyles,x=Br(e);n=n||"default";var w=d.get(x);if(!w){var C={loading:0,preload:null};if(w=s.querySelector(qi(x)))C.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":n},r),(r=Qn.get(x))&&jf(e,r);var R=w=s.createElement("link");Lt(R),sn(R,"link",e),R._p=new Promise(function(W,ie){R.onload=W,R.onerror=ie}),R.addEventListener("load",function(){C.loading|=1}),R.addEventListener("error",function(){C.loading|=2}),C.loading|=4,zo(w,n,s)}w={type:"stylesheet",instance:w,count:1,state:C},d.set(x,w)}}}function eb(e,n){Yl.X(e,n);var r=Or;if(r&&e){var s=jl(r).hoistableScripts,d=$r(e),x=s.get(d);x||(x=r.querySelector(Xi(d)),x||(e=y({src:e,async:!0},n),(n=Qn.get(d))&&Ef(e,n),x=r.createElement("script"),Lt(x),sn(x,"link",e),r.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},s.set(d,x))}}function tb(e,n){Yl.M(e,n);var r=Or;if(r&&e){var s=jl(r).hoistableScripts,d=$r(e),x=s.get(d);x||(x=r.querySelector(Xi(d)),x||(e=y({src:e,async:!0,type:"module"},n),(n=Qn.get(d))&&Ef(e,n),x=r.createElement("script"),Lt(x),sn(x,"link",e),r.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},s.set(d,x))}}function Ep(e,n,r,s){var d=(d=he.current)?To(d):null;if(!d)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=Br(r.href),r=jl(d).hoistableStyles,s=r.get(n),s||(s={type:"style",instance:null,count:0,state:null},r.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Br(r.href);var x=jl(d).hoistableStyles,w=x.get(e);if(w||(d=d.ownerDocument||d,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(e,w),(x=d.querySelector(qi(e)))&&!x._p&&(w.instance=x,w.state.loading=5),Qn.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Qn.set(e,r),x||nb(d,e,r,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=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=$r(r),r=jl(d).hoistableScripts,s=r.get(n),s||(s={type:"script",instance:null,count:0,state:null},r.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Br(e){return'href="'+yt(e)+'"'}function qi(e){return'link[rel="stylesheet"]['+e+"]"}function Cp(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function nb(e,n,r,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",r),Lt(n),e.head.appendChild(n))}function $r(e){return'[src="'+yt(e)+'"]'}function Xi(e){return"script[async]"+e}function Np(e,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+yt(r.href)+'"]');if(s)return n.instance=s,Lt(s),s;var d=y({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Lt(s),sn(s,"style",d),zo(s,r.precedence,e),n.instance=s;case"stylesheet":d=Br(r.href);var x=e.querySelector(qi(d));if(x)return n.state.loading|=4,n.instance=x,Lt(x),x;s=Cp(r),(d=Qn.get(d))&&jf(s,d),x=(e.ownerDocument||e).createElement("link"),Lt(x);var w=x;return w._p=new Promise(function(C,R){w.onload=C,w.onerror=R}),sn(x,"link",s),n.state.loading|=4,zo(x,r.precedence,e),n.instance=x;case"script":return x=$r(r.src),(d=e.querySelector(Xi(x)))?(n.instance=d,Lt(d),d):(s=r,(d=Qn.get(x))&&(s=y({},r),Ef(s,d)),e=e.ownerDocument||e,d=e.createElement("script"),Lt(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,zo(s,r.precedence,e));return n.instance}function zo(e,n,r){for(var s=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=s.length?s[s.length-1]:null,x=d,w=0;w<s.length;w++){var C=s[w];if(C.dataset.precedence===n)x=C;else if(x!==d)break}x?x.parentNode.insertBefore(e,x.nextSibling):(n=r.nodeType===9?r.head:r,n.insertBefore(e,n.firstChild))}function jf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Ef(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Mo=null;function Ap(e,n,r){if(Mo===null){var s=new Map,d=Mo=new Map;d.set(r,s)}else d=Mo,s=d.get(r),s||(s=new Map,d.set(r,s));if(s.has(e))return s;for(s.set(e,null),r=r.getElementsByTagName(e),d=0;d<r.length;d++){var x=r[d];if(!(x[ll]||x[$t]||e==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var w=x.getAttribute(n)||"";w=e+w;var C=s.get(w);C?C.push(x):s.set(w,[x])}}return s}function Dp(e,n,r){e=e.ownerDocument||e,e.head.insertBefore(r,n==="title"?e.querySelector("head > title"):null)}function lb(e,n,r){if(r===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 Tp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function ab(e,n,r,s){if(r.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var d=Br(s.href),x=n.querySelector(qi(d));if(x){n=x._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=_o.bind(e),n.then(e,e)),r.state.loading|=4,r.instance=x,Lt(x);return}x=n.ownerDocument||n,s=Cp(s),(d=Qn.get(d))&&jf(s,d),x=x.createElement("link"),Lt(x);var w=x;w._p=new Promise(function(C,R){w.onload=C,w.onerror=R}),sn(x,"link",s),r.instance=x}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=_o.bind(e),n.addEventListener("load",r),n.addEventListener("error",r))}}var Cf=0;function rb(e,n){return e.stylesheets&&e.count===0&&Ro(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var s=setTimeout(function(){if(e.stylesheets&&Ro(e,e.stylesheets),e.unsuspend){var x=e.unsuspend;e.unsuspend=null,x()}},6e4+n);0<e.imgBytes&&Cf===0&&(Cf=62500*L2());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ro(e,e.stylesheets),e.unsuspend)){var x=e.unsuspend;e.unsuspend=null,x()}},(e.imgBytes>Cf?50:800)+n);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(d)}}:null}function _o(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ro(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Fo=null;function Ro(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Fo=new Map,n.forEach(ib,e),Fo=null,_o.call(e))}function ib(e,n){if(!(n.state.loading&4)){var r=Fo.get(e);if(r)var s=r.get(null);else{r=new Map,Fo.set(e,r);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<d.length;x++){var w=d[x];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(r.set(w.dataset.precedence,w),s=w)}s&&r.set(null,s)}d=n.instance,w=d.getAttribute("data-precedence"),x=r.get(w)||s,x===s&&r.set(null,d),r.set(w,d),this.count++,s=_o.bind(this),d.addEventListener("load",s),d.addEventListener("error",s),x?x.parentNode.insertBefore(d,x.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),n.state.loading|=4}}var Vi={$$typeof:$,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function sb(e,n,r,s,d,x,w,C,R){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ar(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ar(0),this.hiddenUpdates=ar(null),this.identifierPrefix=s,this.onUncaughtError=d,this.onCaughtError=x,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function zp(e,n,r,s,d,x,w,C,R,W,ie,ce){return e=new sb(e,n,r,w,R,W,ie,ce,C),n=1,x===!0&&(n|=24),x=zn(3,null,null,n),e.current=x,x.stateNode=e,n=au(),n.refCount++,e.pooledCache=n,n.refCount++,x.memoizedState={element:s,isDehydrated:r,cache:n},ou(x),e}function Mp(e){return e?(e=xr,e):xr}function _p(e,n,r,s,d,x){d=Mp(d),s.context===null?s.context=d:s.pendingContext=d,s=la(n),s.payload={element:r},x=x===void 0?null:x,x!==null&&(s.callback=x),r=aa(e,s,n),r!==null&&(En(r,e,n),ji(r,e,n))}function Fp(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<n?r:n}}function Nf(e,n){Fp(e,n),(e=e.alternate)&&Fp(e,n)}function Rp(e){if(e.tag===13||e.tag===31){var n=Fa(e,67108864);n!==null&&En(n,e,67108864),Nf(e,67108864)}}function Op(e){if(e.tag===13||e.tag===31){var n=On();n=Da(n);var r=Fa(e,n);r!==null&&En(r,e,n),Nf(e,n)}}var Oo=!0;function ob(e,n,r,s){var d=Y.T;Y.T=null;var x=Q.p;try{Q.p=2,Af(e,n,r,s)}finally{Q.p=x,Y.T=d}}function cb(e,n,r,s){var d=Y.T;Y.T=null;var x=Q.p;try{Q.p=8,Af(e,n,r,s)}finally{Q.p=x,Y.T=d}}function Af(e,n,r,s){if(Oo){var d=Df(s);if(d===null)mf(e,n,s,Bo,r),$p(e,s);else if(fb(d,e,n,r,s))s.stopPropagation();else if($p(e,s),n&4&&-1<ub.indexOf(e)){for(;d!==null;){var x=Ql(d);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var w=ol(x.pendingLanes);if(w!==0){var C=x;for(C.pendingLanes|=2,C.entangledLanes|=2;w;){var R=1<<31-it(w);C.entanglements[1]|=R,w&=~R}ml(x),(ft&6)===0&&(bo=Bt()+500,Hi(0))}}break;case 31:case 13:C=Fa(x,2),C!==null&&En(C,x,2),wo(),Nf(x,2)}if(x=Df(s),x===null&&mf(e,n,s,Bo,r),x===d)break;d=x}d!==null&&s.stopPropagation()}else mf(e,n,s,null,r)}}function Df(e){return e=Tc(e),Tf(e)}var Bo=null;function Tf(e){if(Bo=null,e=Tt(e),e!==null){var n=u(e);if(n===null)e=null;else{var r=n.tag;if(r===13){if(e=f(n),e!==null)return e;e=null}else if(r===31){if(e=m(n),e!==null)return e;e=null}else if(r===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Bo=e,null}function Bp(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(Hn()){case le:return 2;case ye:return 8;case Te:case xe:return 32;case be:return 268435456;default:return 32}default:return 32}}var zf=!1,xa=null,pa=null,ya=null,Gi=new Map,Ki=new Map,ga=[],ub="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 $p(e,n){switch(e){case"focusin":case"focusout":xa=null;break;case"dragenter":case"dragleave":pa=null;break;case"mouseover":case"mouseout":ya=null;break;case"pointerover":case"pointerout":Gi.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ki.delete(n.pointerId)}}function Qi(e,n,r,s,d,x){return e===null||e.nativeEvent!==x?(e={blockedOn:n,domEventName:r,eventSystemFlags:s,nativeEvent:x,targetContainers:[d]},n!==null&&(n=Ql(n),n!==null&&Rp(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function fb(e,n,r,s,d){switch(n){case"focusin":return xa=Qi(xa,e,n,r,s,d),!0;case"dragenter":return pa=Qi(pa,e,n,r,s,d),!0;case"mouseover":return ya=Qi(ya,e,n,r,s,d),!0;case"pointerover":var x=d.pointerId;return Gi.set(x,Qi(Gi.get(x)||null,e,n,r,s,d)),!0;case"gotpointercapture":return x=d.pointerId,Ki.set(x,Qi(Ki.get(x)||null,e,n,r,s,d)),!0}return!1}function Lp(e){var n=Tt(e.target);if(n!==null){var r=u(n);if(r!==null){if(n=r.tag,n===13){if(n=f(r),n!==null){e.blockedOn=n,Kl(e.priority,function(){Op(r)});return}}else if(n===31){if(n=m(r),n!==null){e.blockedOn=n,Kl(e.priority,function(){Op(r)});return}}else if(n===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function $o(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var r=Df(e.nativeEvent);if(r===null){r=e.nativeEvent;var s=new r.constructor(r.type,r);Dc=s,r.target.dispatchEvent(s),Dc=null}else return n=Ql(r),n!==null&&Rp(n),e.blockedOn=r,!1;n.shift()}return!0}function Hp(e,n,r){$o(e)&&r.delete(n)}function db(){zf=!1,xa!==null&&$o(xa)&&(xa=null),pa!==null&&$o(pa)&&(pa=null),ya!==null&&$o(ya)&&(ya=null),Gi.forEach(Hp),Ki.forEach(Hp)}function Lo(e,n){e.blockedOn===n&&(e.blockedOn=null,zf||(zf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,db)))}var Ho=null;function Up(e){Ho!==e&&(Ho=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ho===e&&(Ho=null);for(var n=0;n<e.length;n+=3){var r=e[n],s=e[n+1],d=e[n+2];if(typeof s!="function"){if(Tf(s||r)===null)continue;break}var x=Ql(r);x!==null&&(e.splice(n,3),n-=3,Au(x,{pending:!0,data:d,method:r.method,action:s},s,d))}}))}function Lr(e){function n(R){return Lo(R,e)}xa!==null&&Lo(xa,e),pa!==null&&Lo(pa,e),ya!==null&&Lo(ya,e),Gi.forEach(n),Ki.forEach(n);for(var r=0;r<ga.length;r++){var s=ga[r];s.blockedOn===e&&(s.blockedOn=null)}for(;0<ga.length&&(r=ga[0],r.blockedOn===null);)Lp(r),r.blockedOn===null&&ga.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(s=0;s<r.length;s+=3){var d=r[s],x=r[s+1],w=d[pt]||null;if(typeof x=="function")w||Up(r);else if(w){var C=null;if(x&&x.hasAttribute("formAction")){if(d=x,w=x[pt]||null)C=w.formAction;else if(Tf(d)!==null)continue}else C=w.action;typeof C=="function"?r[s+1]=C:(r.splice(s,3),s-=3),Up(r)}}}function Yp(){function e(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(w){return d=w})},focusReset:"manual",scroll:"manual"})}function n(){d!==null&&(d(),d=null),s||setTimeout(r,20)}function r(){if(!s&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.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(r,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),d!==null&&(d(),d=null)}}}function Mf(e){this._internalRoot=e}Uo.prototype.render=Mf.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));var r=n.current,s=On();_p(r,s,e,n,null,null)},Uo.prototype.unmount=Mf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;_p(e.current,2,null,e,null,null),wo(),n[nl]=null}};function Uo(e){this._internalRoot=e}Uo.prototype.unstable_scheduleHydration=function(e){if(e){var n=Sl();e={blockedOn:null,target:e,priority:n};for(var r=0;r<ga.length&&n!==0&&n<ga[r].priority;r++);ga.splice(r,0,e),r===0&&Lp(e)}};var Ip=l.version;if(Ip!=="19.2.4")throw Error(i(527,Ip,"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?g(e):null,e=e===null?null:e.stateNode,e};var hb={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Y,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yo.isDisabled&&Yo.supportsFiber)try{Xe=Yo.inject(hb),ue=Yo}catch{}}return Wi.createRoot=function(e,n){if(!o(e))throw Error(i(299));var r=!1,s="",d=Zm,x=Wm,w=Jm;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(x=n.onCaughtError),n.onRecoverableError!==void 0&&(w=n.onRecoverableError)),n=zp(e,1,!1,null,null,r,s,null,d,x,w,Yp),e[nl]=n.current,hf(e),new Mf(n)},Wi.hydrateRoot=function(e,n,r){if(!o(e))throw Error(i(299));var s=!1,d="",x=Zm,w=Wm,C=Jm,R=null;return r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(x=r.onUncaughtError),r.onCaughtError!==void 0&&(w=r.onCaughtError),r.onRecoverableError!==void 0&&(C=r.onRecoverableError),r.formState!==void 0&&(R=r.formState)),n=zp(e,1,!0,n,r??null,s,d,R,x,w,C,Yp),n.context=Mp(null),r=n.current,s=On(),s=Da(s),d=la(s),d.callback=null,aa(r,d,s),r=s,n.current.lanes=r,An(n,r),ml(n),e[nl]=n.current,hf(e),new Uo(n)},Wi.version="19.2.4",Wi}var e1;function Eb(){if(e1)return Rf.exports;e1=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=jb(),Rf.exports}var Cb=Eb();const Nb="modulepreload",Ab=function(t){return"/"+t},t1={},Db=function(l,a,i){let o=Promise.resolve();if(a&&a.length>0){let f=function(h){return Promise.all(h.map(g=>Promise.resolve(g).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),p=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));o=f(a.map(h=>{if(h=Ab(h),h in t1)return;t1[h]=!0;const g=h.endsWith(".css"),y=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${y}`))return;const b=document.createElement("link");if(b.rel=g?"stylesheet":Nb,g||(b.as="script"),b.crossOrigin="",b.href=h,p&&b.setAttribute("nonce",p),document.head.appendChild(b),g)return new Promise((v,k)=>{b.addEventListener("load",v),b.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 Tb extends j.Component{constructor(){super(...arguments);qp(this,"state",{hasError:!1,error:null})}static getDerivedStateFromError(a){return{hasError:!0,error:a}}render(){var a;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:((a=this.state.error)==null?void 0:a.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 vs="/api";async function Xt(t){const l=await fetch(`${vs}${t}`);if(!l.ok)throw new Error(`API error: ${l.status}`);return l.json()}async function Zn(t,l){const a=await fetch(`${vs}${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!a.ok)throw new Error(`API error: ${a.status}`);return a.json()}async function Lf(t,l){const a=await fetch(`${vs}${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!a.ok)throw new Error(`API error: ${a.status}`);return a.json()}async function Hr(t,l){const a={method:"DELETE"};l!==void 0&&(a.headers={"Content-Type":"application/json"},a.body=JSON.stringify(l));const i=await fetch(`${vs}${t}`,a);if(!i.ok)throw new Error(`API error: ${i.status}`);return i.json()}const Ae={getCompany:()=>Xt("/company"),getRoles:()=>Xt("/roles"),getRole:t=>Xt(`/roles/${t}`),getProjects:()=>Xt("/projects"),getProject:t=>Xt(`/projects/${t}`),getStandups:()=>Xt("/operations/standups"),getWaves:()=>Xt("/operations/waves"),getDecisions:()=>Xt("/operations/decisions"),getOrgTree:()=>Xt("/engine/org"),getSkills:()=>Xt("/skills"),createRole:t=>Zn("/engine/roles",t),updateRole:(t,l)=>Lf(`/engine/roles/${t}`,l),deleteRole:t=>Hr(`/engine/roles/${t}`),getSessions:()=>Xt("/sessions"),getSession:t=>Xt(`/sessions/${t}`),createSession:(t,l="talk")=>Zn("/sessions",{roleId:t,mode:l}),deleteSession:t=>Hr(`/sessions/${t}`),deleteSessions:t=>Hr("/sessions",{ids:t}),deleteEmptySessions:()=>Hr("/sessions?empty=true"),updateSession:(t,l)=>Lf(`/sessions/${t}`,l),startJob:t=>Zn("/jobs",t),getJob:t=>Xt(`/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 a=l.toString();return Xt(`/jobs${a?"?"+a:""}`)},abortJob:t=>Hr(`/jobs/${t}`),getStatus:()=>Xt("/status"),detectEngine:()=>Zn("/setup/detect-engine",{}),validatePath:t=>Zn("/setup/validate-path",{path:t}),scaffold:t=>Zn("/setup/scaffold",t),getTeams:()=>Xt("/setup/teams"),browse:t=>Zn("/setup/browse",{path:t}),connectAkb:t=>Zn("/setup/connect-akb",{path:t}),getKnowledge:()=>Xt("/knowledge"),getKnowledgeDoc:t=>Xt(`/knowledge/${t}`),createKnowledgeDoc:t=>Zn("/knowledge",t),updateKnowledgeDoc:(t,l)=>fetch(`${vs}/knowledge/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:l})}).then(a=>{if(!a.ok)throw new Error(`API error: ${a.status}`);return a.json()}),deleteKnowledgeDoc:t=>Hr(`/knowledge/${t}`),getPreferences:()=>Xt("/preferences"),updatePreferences:t=>Lf("/preferences",t),chatInChannel:t=>Zn("/speech/chat",t),getSaveStatus:()=>Xt("/save/status"),save:t=>Zn("/save",{message:t}),getSaveHistory:(t=20)=>Xt(`/save/history?limit=${t}`),restoreSave:(t,l)=>Zn("/save/restore",{sha:t,paths:l})};function C0(t){const[l,a]=j.useState([]),[i,o]=j.useState("idle"),[u,f]=j.useState(""),[m,p]=j.useState([]),h=j.useRef(-1),g=j.useRef(null),y=j.useRef(0),b=j.useCallback(()=>{var E;if(!t)return;(E=g.current)==null||E.abort();const k=new AbortController;g.current=k,o("connecting");const S=h.current+1,N=`/api/jobs/${t}/stream?from=${S}`;fetch(N,{signal:k.signal}).then(async _=>{if(!_.ok||!_.body){o("error");return}o("streaming");const $=_.body.getReader(),O=new TextDecoder;let B="";for(;;){const{done:M,value:q}=await $.read();if(M)break;B+=O.decode(q,{stream:!0});const G=B.split(`
50
+ `);B=G.pop()??"";let P="";for(const z of G)if(z.startsWith("event: "))P=z.slice(7).trim();else if(z.startsWith("data: ")){try{const U=JSON.parse(z.slice(6));if(P==="activity"){const L=U;L.seq>h.current&&(h.current=L.seq),a(ee=>ee.some(ne=>ne.seq===L.seq)?ee:[...ee,L]),L.type==="text"&&f(ee=>ee+(L.data.text??"")),L.type==="dispatch:start"&&L.data.childJobId&&p(ee=>[...ee,L.data.childJobId]),L.type==="job:done"?o("done"):L.type==="job:error"&&o("error")}else if(P==="stream:end"){const L=U.reason;o(L==="done"?"done":L==="error"?"error":"done")}}catch{}P=""}}i==="streaming"&&o("done")}).catch(_=>{_.name!=="AbortError"&&(o("error"),y.current<3&&(y.current++,setTimeout(b,1e3*y.current)))})},[t]),v=j.useCallback(()=>{y.current=0,b()},[b]);return j.useEffect(()=>{if(!t){a([]),o("idle"),f(""),p([]),h.current=-1;return}return a([]),f(""),p([]),h.current=-1,y.current=0,b(),()=>{var k;(k=g.current)==null||k.abort()}},[t,b]),{events:l,status:i,textOutput:u,childJobIds:m,reconnect:v}}function zb(t,l){const a={};return(t[t.length-1]===""?[...t,""]:t).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const Mb=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_b=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Fb={};function n1(t,l){return(Fb.jsx?_b:Mb).test(t)}const Rb=/[ \t\n\f\r]/g;function Ob(t){return typeof t=="object"?t.type==="text"?l1(t.value):!1:l1(t)}function l1(t){return t.replace(Rb,"")===""}class ws{constructor(l,a,i){this.normal=a,this.property=l,i&&(this.space=i)}}ws.prototype.normal={};ws.prototype.property={};ws.prototype.space=void 0;function N0(t,l){const a={},i={};for(const o of t)Object.assign(a,o.property),Object.assign(i,o.normal);return new ws(a,i,l)}function wd(t){return t.toLowerCase()}class Nn{constructor(l,a){this.attribute=a,this.property=l}}Nn.prototype.attribute="";Nn.prototype.booleanish=!1;Nn.prototype.boolean=!1;Nn.prototype.commaOrSpaceSeparated=!1;Nn.prototype.commaSeparated=!1;Nn.prototype.defined=!1;Nn.prototype.mustUseProperty=!1;Nn.prototype.number=!1;Nn.prototype.overloadedBoolean=!1;Nn.prototype.property="";Nn.prototype.spaceSeparated=!1;Nn.prototype.space=void 0;let Bb=0;const Ie=nr(),Zt=nr(),kd=nr(),ge=nr(),Nt=nr(),Vr=nr(),Bn=nr();function nr(){return 2**++Bb}const Sd=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Zt,commaOrSpaceSeparated:Bn,commaSeparated:Vr,number:ge,overloadedBoolean:kd,spaceSeparated:Nt},Symbol.toStringTag,{value:"Module"})),Hf=Object.keys(Sd);class Hd extends Nn{constructor(l,a,i,o){let u=-1;if(super(l,a),a1(this,"space",o),typeof i=="number")for(;++u<Hf.length;){const f=Hf[u];a1(this,Hf[u],(i&Sd[f])===Sd[f])}}}Hd.prototype.defined=!0;function a1(t,l,a){a&&(t[l]=a)}function Jr(t){const l={},a={};for(const[i,o]of Object.entries(t.properties)){const u=new Hd(i,t.transform(t.attributes||{},i),o,t.space);t.mustUseProperty&&t.mustUseProperty.includes(i)&&(u.mustUseProperty=!0),l[i]=u,a[wd(i)]=i,a[wd(u.attribute)]=i}return new ws(l,a,t.space)}const A0=Jr({properties:{ariaActiveDescendant:null,ariaAtomic:Zt,ariaAutoComplete:null,ariaBusy:Zt,ariaChecked:Zt,ariaColCount:ge,ariaColIndex:ge,ariaColSpan:ge,ariaControls:Nt,ariaCurrent:null,ariaDescribedBy:Nt,ariaDetails:null,ariaDisabled:Zt,ariaDropEffect:Nt,ariaErrorMessage:null,ariaExpanded:Zt,ariaFlowTo:Nt,ariaGrabbed:Zt,ariaHasPopup:null,ariaHidden:Zt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Nt,ariaLevel:ge,ariaLive:null,ariaModal:Zt,ariaMultiLine:Zt,ariaMultiSelectable:Zt,ariaOrientation:null,ariaOwns:Nt,ariaPlaceholder:null,ariaPosInSet:ge,ariaPressed:Zt,ariaReadOnly:Zt,ariaRelevant:null,ariaRequired:Zt,ariaRoleDescription:Nt,ariaRowCount:ge,ariaRowIndex:ge,ariaRowSpan:ge,ariaSelected:Zt,ariaSetSize:ge,ariaSort:null,ariaValueMax:ge,ariaValueMin:ge,ariaValueNow:ge,ariaValueText:null,role:null},transform(t,l){return l==="role"?l:"aria-"+l.slice(4).toLowerCase()}});function D0(t,l){return l in t?t[l]:l}function T0(t,l){return D0(t,l.toLowerCase())}const $b=Jr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Vr,acceptCharset:Nt,accessKey:Nt,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:Nt,autoFocus:Ie,autoPlay:Ie,blocking:Nt,capture:null,charSet:null,checked:Ie,cite:null,className:Nt,cols:ge,colSpan:null,content:null,contentEditable:Zt,controls:Ie,controlsList:Nt,coords:ge|Vr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:kd,draggable:Zt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:Nt,height:ge,hidden:kd,high:ge,href:null,hrefLang:null,htmlFor:Nt,httpEquiv:Nt,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:Nt,itemRef:Nt,itemScope:Ie,itemType:Nt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:ge,manifest:null,max:null,maxLength:ge,media:null,method:null,min:null,minLength:ge,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,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:Ie,optimum:ge,pattern:null,ping:Nt,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:Nt,required:Ie,reversed:Ie,rows:ge,rowSpan:ge,sandbox:Nt,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shape:null,size:ge,sizes:null,slot:null,span:ge,spellCheck:Zt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ge,step:null,style:null,tabIndex:ge,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Zt,width:ge,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Nt,axis:null,background:null,bgColor:null,border:ge,borderColor:null,bottomMargin:ge,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:ge,leftMargin:ge,link:null,longDesc:null,lowSrc:null,marginHeight:ge,marginWidth:ge,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:ge,rules:null,scheme:null,scrolling:Zt,standby:null,summary:null,text:null,topMargin:ge,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ge,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ie,disableRemotePlayback:Ie,prefix:null,property:null,results:ge,security:null,unselectable:null},space:"html",transform:T0}),Lb=Jr({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:Bn,accentHeight:ge,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ge,amplitude:ge,arabicForm:null,ascent:ge,attributeName:null,attributeType:null,azimuth:ge,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ge,by:null,calcMode:null,capHeight:ge,className:Nt,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:ge,diffuseConstant:ge,direction:null,display:null,dur:null,divisor:ge,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:ge,enableBackground:null,end:null,event:null,exponent:ge,externalResourcesRequired:null,fill:null,fillOpacity:ge,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:Vr,g2:Vr,glyphName:Vr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ge,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ge,horizOriginX:ge,horizOriginY:ge,id:null,ideographic:ge,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ge,k:ge,k1:ge,k2:ge,k3:ge,k4:ge,kernelMatrix:Bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ge,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:ge,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:ge,overlineThickness:ge,paintOrder:null,panose1:null,path:null,pathLength:ge,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Nt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ge,pointsAtY:ge,pointsAtZ:ge,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Bn,rev:Bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Bn,requiredFeatures:Bn,requiredFonts:Bn,requiredFormats:Bn,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:ge,specularExponent:ge,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ge,strikethroughThickness:ge,string:null,stroke:null,strokeDashArray:Bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ge,strokeOpacity:ge,strokeWidth:null,style:null,surfaceScale:ge,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Bn,tabIndex:ge,tableValues:null,target:null,targetX:ge,targetY:ge,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ge,underlineThickness:ge,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ge,values:null,vAlphabetic:ge,vMathematical:ge,vectorEffect:null,vHanging:ge,vIdeographic:ge,version:null,vertAdvY:ge,vertOriginX:ge,vertOriginY:ge,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ge,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:D0}),z0=Jr({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()}}),M0=Jr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:T0}),_0=Jr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,l){return"xml:"+l.slice(3).toLowerCase()}}),Hb={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"},Ub=/[A-Z]/g,r1=/-[a-z]/g,Yb=/^data[-\w.:]+$/i;function Ib(t,l){const a=wd(l);let i=l,o=Nn;if(a in t.normal)return t.property[t.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&Yb.test(l)){if(l.charAt(4)==="-"){const u=l.slice(5).replace(r1,Xb);i="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=l.slice(4);if(!r1.test(u)){let f=u.replace(Ub,qb);f.charAt(0)!=="-"&&(f="-"+f),l="data"+f}}o=Hd}return new o(i,l)}function qb(t){return"-"+t.toLowerCase()}function Xb(t){return t.charAt(1).toUpperCase()}const Vb=N0([A0,$b,z0,M0,_0],"html"),Ud=N0([A0,Lb,z0,M0,_0],"svg");function Gb(t){return t.join(" ").trim()}var Ur={},Uf,i1;function Kb(){if(i1)return Uf;i1=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,l=/\n/g,a=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,m=/^\s+|\s+$/g,p=`
51
+ `,h="/",g="*",y="",b="comment",v="declaration";function k(N,E){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];E=E||{};var _=1,$=1;function O(ne){var V=ne.match(l);V&&(_+=V.length);var Y=ne.lastIndexOf(p);$=~Y?ne.length-Y:$+ne.length}function B(){var ne={line:_,column:$};return function(V){return V.position=new M(ne),P(),V}}function M(ne){this.start=ne,this.end={line:_,column:$},this.source=E.source}M.prototype.content=N;function q(ne){var V=new Error(E.source+":"+_+":"+$+": "+ne);if(V.reason=ne,V.filename=E.source,V.line=_,V.column=$,V.source=N,!E.silent)throw V}function G(ne){var V=ne.exec(N);if(V){var Y=V[0];return O(Y),N=N.slice(Y.length),V}}function P(){G(a)}function z(ne){var V;for(ne=ne||[];V=U();)V!==!1&&ne.push(V);return ne}function U(){var ne=B();if(!(h!=N.charAt(0)||g!=N.charAt(1))){for(var V=2;y!=N.charAt(V)&&(g!=N.charAt(V)||h!=N.charAt(V+1));)++V;if(V+=2,y===N.charAt(V-1))return q("End of comment missing");var Y=N.slice(2,V-2);return $+=2,O(Y),N=N.slice(V),$+=2,ne({type:b,comment:Y})}}function L(){var ne=B(),V=G(i);if(V){if(U(),!G(o))return q("property missing ':'");var Y=G(u),Q=ne({type:v,property:S(V[0].replace(t,y)),value:Y?S(Y[0].replace(t,y)):y});return G(f),Q}}function ee(){var ne=[];z(ne);for(var V;V=L();)V!==!1&&(ne.push(V),z(ne));return ne}return P(),ee()}function S(N){return N?N.replace(m,y):y}return Uf=k,Uf}var s1;function Qb(){if(s1)return Ur;s1=1;var t=Ur&&Ur.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.default=a;const l=t(Kb());function a(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(p=>{if(p.type!=="declaration")return;const{property:h,value:g}=p;m?o(h,g,p):g&&(u=u||{},u[h]=g)}),u}return Ur}var Ji={},o1;function Zb(){if(o1)return Ji;o1=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,l=/-([a-z])/g,a=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(h){return!h||a.test(h)||t.test(h)},f=function(h,g){return g.toUpperCase()},m=function(h,g){return"".concat(g,"-")},p=function(h,g){return g===void 0&&(g={}),u(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(o,m):h=h.replace(i,m),h.replace(l,f))};return Ji.camelCase=p,Ji}var Pi,c1;function Wb(){if(c1)return Pi;c1=1;var t=Pi&&Pi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},l=t(Qb()),a=Zb();function i(o,u){var f={};return!o||typeof o!="string"||(0,l.default)(o,function(m,p){m&&p&&(f[(0,a.camelCase)(m,u)]=p)}),f}return i.default=i,Pi=i,Pi}var Jb=Wb();const Pb=E0(Jb),F0=R0("end"),Yd=R0("start");function R0(t){return l;function l(a){const i=a&&a.position&&a.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 ev(t){const l=Yd(t),a=F0(t);if(l&&a)return{start:l,end:a}}function fs(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?u1(t.position):"start"in t||"end"in t?u1(t):"line"in t||"column"in t?jd(t):""}function jd(t){return f1(t&&t.line)+":"+f1(t&&t.column)}function u1(t){return jd(t&&t.start)+"-"+jd(t&&t.end)}function f1(t){return t&&typeof t=="number"?t:1}class dn extends Error{constructor(l,a,i){super(),typeof a=="string"&&(i=a,a=void 0);let o="",u={},f=!1;if(a&&("line"in a&&"column"in a?u={place:a}:"start"in a&&"end"in a?u={place:a}:"type"in a?u={ancestors:[a],place:a.position}:u={...a}),typeof l=="string"?o=l:!u.cause&&l&&(f=!0,o=l.message,u.cause=l),!u.ruleId&&!u.source&&typeof i=="string"){const p=i.indexOf(":");p===-1?u.ruleId=i:(u.source=i.slice(0,p),u.ruleId=i.slice(p+1))}if(!u.place&&u.ancestors&&u.ancestors){const p=u.ancestors[u.ancestors.length-1];p&&(u.place=p.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=fs(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}}dn.prototype.file="";dn.prototype.name="";dn.prototype.reason="";dn.prototype.message="";dn.prototype.stack="";dn.prototype.column=void 0;dn.prototype.line=void 0;dn.prototype.ancestors=void 0;dn.prototype.cause=void 0;dn.prototype.fatal=void 0;dn.prototype.place=void 0;dn.prototype.ruleId=void 0;dn.prototype.source=void 0;const Id={}.hasOwnProperty,tv=new Map,nv=/[A-Z]/g,lv=new Set(["table","tbody","thead","tfoot","tr"]),av=new Set(["td","th"]),O0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function rv(t,l){if(!l||l.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=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=hv(a,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=dv(a,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:a,ignoreInvalidStyle:l.ignoreInvalidStyle||!1,passKeys:l.passKeys!==!1,passNode:l.passNode||!1,schema:l.space==="svg"?Ud:Vb,stylePropertyNameCase:l.stylePropertyNameCase||"dom",tableCellAlignToStyle:l.tableCellAlignToStyle!==!1},u=B0(o,t,void 0);return u&&typeof u!="string"?u:o.create(t,o.Fragment,{children:u||void 0},void 0)}function B0(t,l,a){if(l.type==="element")return iv(t,l,a);if(l.type==="mdxFlowExpression"||l.type==="mdxTextExpression")return sv(t,l);if(l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement")return cv(t,l,a);if(l.type==="mdxjsEsm")return ov(t,l);if(l.type==="root")return uv(t,l,a);if(l.type==="text")return fv(t,l)}function iv(t,l,a){const i=t.schema;let o=i;l.tagName.toLowerCase()==="svg"&&i.space==="html"&&(o=Ud,t.schema=o),t.ancestors.push(l);const u=L0(t,l.tagName,!1),f=mv(t,l);let m=Xd(t,l);return lv.has(l.tagName)&&(m=m.filter(function(p){return typeof p=="string"?!Ob(p):!0})),$0(t,f,u,l),qd(f,m),t.ancestors.pop(),t.schema=i,t.create(l,u,f,a)}function sv(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)}xs(t,l.position)}function ov(t,l){if(l.data&&l.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(l.data.estree);xs(t,l.position)}function cv(t,l,a){const i=t.schema;let o=i;l.name==="svg"&&i.space==="html"&&(o=Ud,t.schema=o),t.ancestors.push(l);const u=l.name===null?t.Fragment:L0(t,l.name,!0),f=xv(t,l),m=Xd(t,l);return $0(t,f,u,l),qd(f,m),t.ancestors.pop(),t.schema=i,t.create(l,u,f,a)}function uv(t,l,a){const i={};return qd(i,Xd(t,l)),t.create(l,t.Fragment,i,a)}function fv(t,l){return l.value}function $0(t,l,a,i){typeof a!="string"&&a!==t.Fragment&&t.passNode&&(l.node=i)}function qd(t,l){if(l.length>0){const a=l.length>1?l:l[0];a&&(t.children=a)}}function dv(t,l,a){return i;function i(o,u,f,m){const h=Array.isArray(f.children)?a:l;return m?h(u,f,m):h(u,f)}}function hv(t,l){return a;function a(i,o,u,f){const m=Array.isArray(u.children),p=Yd(i);return l(o,u,f,m,{columnNumber:p?p.column-1:void 0,fileName:t,lineNumber:p?p.line:void 0},void 0)}}function mv(t,l){const a={};let i,o;for(o in l.properties)if(o!=="children"&&Id.call(l.properties,o)){const u=pv(t,o,l.properties[o]);if(u){const[f,m]=u;t.tableCellAlignToStyle&&f==="align"&&typeof m=="string"&&av.has(l.tagName)?i=m:a[f]=m}}if(i){const u=a.style||(a.style={});u[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return a}function xv(t,l){const a={};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(a,t.evaluater.evaluateExpression(m.argument))}else xs(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 xs(t,l.position);else u=i.value===null?!0:i.value;a[o]=u}return a}function Xd(t,l){const a=[];let i=-1;const o=t.passKeys?new Map:tv;for(;++i<l.children.length;){const u=l.children[i];let f;if(t.passKeys){const p=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(p){const h=o.get(p)||0;f=p+"-"+h,o.set(p,h+1)}}const m=B0(t,u,f);m!==void 0&&a.push(m)}return a}function pv(t,l,a){const i=Ib(t.schema,l);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=i.commaSeparated?zb(a):Gb(a)),i.property==="style"){let o=typeof a=="object"?a:yv(t,String(a));return t.stylePropertyNameCase==="css"&&(o=gv(o)),["style",o]}return[t.elementAttributeNameCase==="react"&&i.space?Hb[i.property]||i.property:i.attribute,a]}}function yv(t,l){try{return Pb(l,{reactCompat:!0})}catch(a){if(t.ignoreInvalidStyle)return{};const i=a,o=new dn("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=O0+"#cannot-parse-style-attribute",o}}function L0(t,l,a){let i;if(!a)i={type:"Literal",value:l};else if(l.includes(".")){const o=l.split(".");let u=-1,f;for(;++u<o.length;){const m=n1(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=n1(l)&&!/^[a-z]/.test(l)?{type:"Identifier",name:l}:{type:"Literal",value:l};if(i.type==="Literal"){const o=i.value;return Id.call(t.components,o)?t.components[o]:o}if(t.evaluater)return t.evaluater.evaluateExpression(i);xs(t)}function xs(t,l){const a=new dn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:l,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=t.filePath||void 0,a.url=O0+"#cannot-handle-mdx-estrees-without-createevaluater",a}function gv(t){const l={};let a;for(a in t)Id.call(t,a)&&(l[bv(a)]=t[a]);return l}function bv(t){let l=t.replace(nv,vv);return l.slice(0,3)==="ms-"&&(l="-"+l),l}function vv(t){return"-"+t.toLowerCase()}const Yf={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"]},wv={};function Vd(t,l){const a=wv,i=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,o=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return H0(t,i,o)}function H0(t,l,a){if(kv(t)){if("value"in t)return t.type==="html"&&!a?"":t.value;if(l&&"alt"in t&&t.alt)return t.alt;if("children"in t)return d1(t.children,l,a)}return Array.isArray(t)?d1(t,l,a):""}function d1(t,l,a){const i=[];let o=-1;for(;++o<t.length;)i[o]=H0(t[o],l,a);return i.join("")}function kv(t){return!!(t&&typeof t=="object")}const h1=document.createElement("i");function Gd(t){const l="&"+t+";";h1.innerHTML=l;const a=h1.textContent;return a.charCodeAt(a.length-1)===59&&t!=="semi"||a===l?!1:a}function $n(t,l,a,i){const o=t.length;let u=0,f;if(l<0?l=-l>o?0:o+l:l=l>o?o:l,a=a>0?a:0,i.length<1e4)f=Array.from(i),f.unshift(l,a),t.splice(...f);else for(a&&t.splice(l,a);u<i.length;)f=i.slice(u,u+1e4),f.unshift(l,0),t.splice(...f),u+=1e4,l+=1e4}function Wn(t,l){return t.length>0?($n(t,t.length,0,l),t):l}const m1={}.hasOwnProperty;function U0(t){const l={};let a=-1;for(;++a<t.length;)Sv(l,t[a]);return l}function Sv(t,l){let a;for(a in l){const o=(m1.call(t,a)?t[a]:void 0)||(t[a]={}),u=l[a];let f;if(u)for(f in u){m1.call(o,f)||(o[f]=[]);const m=u[f];jv(o[f],Array.isArray(m)?m:m?[m]:[])}}}function jv(t,l){let a=-1;const i=[];for(;++a<l.length;)(l[a].add==="after"?t:i).push(l[a]);$n(t,0,0,i)}function Y0(t,l){const a=Number.parseInt(t,l);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function sl(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const xn=Ca(/[A-Za-z]/),fn=Ca(/[\dA-Za-z]/),Ev=Ca(/[#-'*+\--9=?A-Z^-~]/);function sc(t){return t!==null&&(t<32||t===127)}const Ed=Ca(/\d/),Cv=Ca(/[\dA-Fa-f]/),Nv=Ca(/[!-/:-@[-`{-~]/);function _e(t){return t!==null&&t<-2}function Et(t){return t!==null&&(t<0||t===32)}function We(t){return t===-2||t===-1||t===32}const yc=Ca(new RegExp("\\p{P}|\\p{S}","u")),er=Ca(/\s/);function Ca(t){return l;function l(a){return a!==null&&a>-1&&t.test(String.fromCharCode(a))}}function Pr(t){const l=[];let a=-1,i=0,o=0;for(;++a<t.length;){const u=t.charCodeAt(a);let f="";if(u===37&&fn(t.charCodeAt(a+1))&&fn(t.charCodeAt(a+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(a+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,a),encodeURIComponent(f)),i=a+o+1,f=""),o&&(a+=o,o=0)}return l.join("")+t.slice(i)}function at(t,l,a,i){const o=i?i-1:Number.POSITIVE_INFINITY;let u=0;return f;function f(p){return We(p)?(t.enter(a),m(p)):l(p)}function m(p){return We(p)&&u++<o?(t.consume(p),m):(t.exit(a),l(p))}}const Av={tokenize:Dv};function Dv(t){const l=t.attempt(this.parser.constructs.contentInitial,i,o);let a;return l;function i(m){if(m===null){t.consume(m);return}return t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),at(t,l,"linePrefix")}function o(m){return t.enter("paragraph"),u(m)}function u(m){const p=t.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=p),a=p,f(m)}function f(m){if(m===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(m);return}return _e(m)?(t.consume(m),t.exit("chunkText"),u):(t.consume(m),f)}}const Tv={tokenize:zv},x1={tokenize:Mv};function zv(t){const l=this,a=[];let i=0,o,u,f;return m;function m($){if(i<a.length){const O=a[i];return l.containerState=O[1],t.attempt(O[0].continuation,p,h)($)}return h($)}function p($){if(i++,l.containerState._closeFlow){l.containerState._closeFlow=void 0,o&&_();const O=l.events.length;let B=O,M;for(;B--;)if(l.events[B][0]==="exit"&&l.events[B][1].type==="chunkFlow"){M=l.events[B][1].end;break}E(i);let q=O;for(;q<l.events.length;)l.events[q][1].end={...M},q++;return $n(l.events,B+1,0,l.events.slice(O)),l.events.length=q,h($)}return m($)}function h($){if(i===a.length){if(!o)return b($);if(o.currentConstruct&&o.currentConstruct.concrete)return k($);l.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return l.containerState={},t.check(x1,g,y)($)}function g($){return o&&_(),E(i),b($)}function y($){return l.parser.lazy[l.now().line]=i!==a.length,f=l.now().offset,k($)}function b($){return l.containerState={},t.attempt(x1,v,k)($)}function v($){return i++,a.push([l.currentConstruct,l.containerState]),b($)}function k($){if($===null){o&&_(),E(0),t.consume($);return}return o=o||l.parser.flow(l.now()),t.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),S($)}function S($){if($===null){N(t.exit("chunkFlow"),!0),E(0),t.consume($);return}return _e($)?(t.consume($),N(t.exit("chunkFlow")),i=0,l.interrupt=void 0,m):(t.consume($),S)}function N($,O){const B=l.sliceStream($);if(O&&B.push(null),$.previous=u,u&&(u.next=$),u=$,o.defineSkip($.start),o.write(B),l.parser.lazy[$.start.line]){let M=o.events.length;for(;M--;)if(o.events[M][1].start.offset<f&&(!o.events[M][1].end||o.events[M][1].end.offset>f))return;const q=l.events.length;let G=q,P,z;for(;G--;)if(l.events[G][0]==="exit"&&l.events[G][1].type==="chunkFlow"){if(P){z=l.events[G][1].end;break}P=!0}for(E(i),M=q;M<l.events.length;)l.events[M][1].end={...z},M++;$n(l.events,G+1,0,l.events.slice(q)),l.events.length=M}}function E($){let O=a.length;for(;O-- >$;){const B=a[O];l.containerState=B[1],B[0].exit.call(l,t)}a.length=$}function _(){o.write([null]),u=void 0,o=void 0,l.containerState._closeFlow=void 0}}function Mv(t,l,a){return at(t,t.attempt(this.parser.constructs.document,l,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Qr(t){if(t===null||Et(t)||er(t))return 1;if(yc(t))return 2}function gc(t,l,a){const i=[];let o=-1;for(;++o<t.length;){const u=t[o].resolveAll;u&&!i.includes(u)&&(l=u(l,a),i.push(u))}return l}const Cd={name:"attention",resolveAll:_v,tokenize:Fv};function _v(t,l){let a=-1,i,o,u,f,m,p,h,g;for(;++a<t.length;)if(t[a][0]==="enter"&&t[a][1].type==="attentionSequence"&&t[a][1]._close){for(i=a;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[a][1]).charCodeAt(0)){if((t[i][1]._close||t[a][1]._open)&&(t[a][1].end.offset-t[a][1].start.offset)%3&&!((t[i][1].end.offset-t[i][1].start.offset+t[a][1].end.offset-t[a][1].start.offset)%3))continue;p=t[i][1].end.offset-t[i][1].start.offset>1&&t[a][1].end.offset-t[a][1].start.offset>1?2:1;const y={...t[i][1].end},b={...t[a][1].start};p1(y,-p),p1(b,p),f={type:p>1?"strongSequence":"emphasisSequence",start:y,end:{...t[i][1].end}},m={type:p>1?"strongSequence":"emphasisSequence",start:{...t[a][1].start},end:b},u={type:p>1?"strongText":"emphasisText",start:{...t[i][1].end},end:{...t[a][1].start}},o={type:p>1?"strong":"emphasis",start:{...f.start},end:{...m.end}},t[i][1].end={...f.start},t[a][1].start={...m.end},h=[],t[i][1].end.offset-t[i][1].start.offset&&(h=Wn(h,[["enter",t[i][1],l],["exit",t[i][1],l]])),h=Wn(h,[["enter",o,l],["enter",f,l],["exit",f,l],["enter",u,l]]),h=Wn(h,gc(l.parser.constructs.insideSpan.null,t.slice(i+1,a),l)),h=Wn(h,[["exit",u,l],["enter",m,l],["exit",m,l],["exit",o,l]]),t[a][1].end.offset-t[a][1].start.offset?(g=2,h=Wn(h,[["enter",t[a][1],l],["exit",t[a][1],l]])):g=0,$n(t,i-1,a-i+3,h),a=i+h.length-g-2;break}}for(a=-1;++a<t.length;)t[a][1].type==="attentionSequence"&&(t[a][1].type="data");return t}function Fv(t,l){const a=this.parser.constructs.attentionMarkers.null,i=this.previous,o=Qr(i);let u;return f;function f(p){return u=p,t.enter("attentionSequence"),m(p)}function m(p){if(p===u)return t.consume(p),m;const h=t.exit("attentionSequence"),g=Qr(p),y=!g||g===2&&o||a.includes(p),b=!o||o===2&&g||a.includes(i);return h._open=!!(u===42?y:y&&(o||!b)),h._close=!!(u===42?b:b&&(g||!y)),l(p)}}function p1(t,l){t.column+=l,t.offset+=l,t._bufferIndex+=l}const Rv={name:"autolink",tokenize:Ov};function Ov(t,l,a){let i=0;return o;function o(v){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(v),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),u}function u(v){return xn(v)?(t.consume(v),f):v===64?a(v):h(v)}function f(v){return v===43||v===45||v===46||fn(v)?(i=1,m(v)):h(v)}function m(v){return v===58?(t.consume(v),i=0,p):(v===43||v===45||v===46||fn(v))&&i++<32?(t.consume(v),m):(i=0,h(v))}function p(v){return v===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(v),t.exit("autolinkMarker"),t.exit("autolink"),l):v===null||v===32||v===60||sc(v)?a(v):(t.consume(v),p)}function h(v){return v===64?(t.consume(v),g):Ev(v)?(t.consume(v),h):a(v)}function g(v){return fn(v)?y(v):a(v)}function y(v){return v===46?(t.consume(v),i=0,g):v===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(v),t.exit("autolinkMarker"),t.exit("autolink"),l):b(v)}function b(v){if((v===45||fn(v))&&i++<63){const k=v===45?b:y;return t.consume(v),k}return a(v)}}const ks={partial:!0,tokenize:Bv};function Bv(t,l,a){return i;function i(u){return We(u)?at(t,o,"linePrefix")(u):o(u)}function o(u){return u===null||_e(u)?l(u):a(u)}}const I0={continuation:{tokenize:Lv},exit:Hv,name:"blockQuote",tokenize:$v};function $v(t,l,a){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 a(f)}function u(f){return We(f)?(t.enter("blockQuotePrefixWhitespace"),t.consume(f),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),l):(t.exit("blockQuotePrefix"),l(f))}}function Lv(t,l,a){const i=this;return o;function o(f){return We(f)?at(t,u,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):u(f)}function u(f){return t.attempt(I0,l,a)(f)}}function Hv(t){t.exit("blockQuote")}const q0={name:"characterEscape",tokenize:Uv};function Uv(t,l,a){return i;function i(u){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(u),t.exit("escapeMarker"),o}function o(u){return Nv(u)?(t.enter("characterEscapeValue"),t.consume(u),t.exit("characterEscapeValue"),t.exit("characterEscape"),l):a(u)}}const X0={name:"characterReference",tokenize:Yv};function Yv(t,l,a){const i=this;let o=0,u,f;return m;function m(y){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(y),t.exit("characterReferenceMarker"),p}function p(y){return y===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(y),t.exit("characterReferenceMarkerNumeric"),h):(t.enter("characterReferenceValue"),u=31,f=fn,g(y))}function h(y){return y===88||y===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(y),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),u=6,f=Cv,g):(t.enter("characterReferenceValue"),u=7,f=Ed,g(y))}function g(y){if(y===59&&o){const b=t.exit("characterReferenceValue");return f===fn&&!Gd(i.sliceSerialize(b))?a(y):(t.enter("characterReferenceMarker"),t.consume(y),t.exit("characterReferenceMarker"),t.exit("characterReference"),l)}return f(y)&&o++<u?(t.consume(y),g):a(y)}}const y1={partial:!0,tokenize:qv},g1={concrete:!0,name:"codeFenced",tokenize:Iv};function Iv(t,l,a){const i=this,o={partial:!0,tokenize:B};let u=0,f=0,m;return p;function p(M){return h(M)}function h(M){const q=i.events[i.events.length-1];return u=q&&q[1].type==="linePrefix"?q[2].sliceSerialize(q[1],!0).length:0,m=M,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),g(M)}function g(M){return M===m?(f++,t.consume(M),g):f<3?a(M):(t.exit("codeFencedFenceSequence"),We(M)?at(t,y,"whitespace")(M):y(M))}function y(M){return M===null||_e(M)?(t.exit("codeFencedFence"),i.interrupt?l(M):t.check(y1,S,O)(M)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),b(M))}function b(M){return M===null||_e(M)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),y(M)):We(M)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),at(t,v,"whitespace")(M)):M===96&&M===m?a(M):(t.consume(M),b)}function v(M){return M===null||_e(M)?y(M):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),k(M))}function k(M){return M===null||_e(M)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),y(M)):M===96&&M===m?a(M):(t.consume(M),k)}function S(M){return t.attempt(o,O,N)(M)}function N(M){return t.enter("lineEnding"),t.consume(M),t.exit("lineEnding"),E}function E(M){return u>0&&We(M)?at(t,_,"linePrefix",u+1)(M):_(M)}function _(M){return M===null||_e(M)?t.check(y1,S,O)(M):(t.enter("codeFlowValue"),$(M))}function $(M){return M===null||_e(M)?(t.exit("codeFlowValue"),_(M)):(t.consume(M),$)}function O(M){return t.exit("codeFenced"),l(M)}function B(M,q,G){let P=0;return z;function z(V){return M.enter("lineEnding"),M.consume(V),M.exit("lineEnding"),U}function U(V){return M.enter("codeFencedFence"),We(V)?at(M,L,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):L(V)}function L(V){return V===m?(M.enter("codeFencedFenceSequence"),ee(V)):G(V)}function ee(V){return V===m?(P++,M.consume(V),ee):P>=f?(M.exit("codeFencedFenceSequence"),We(V)?at(M,ne,"whitespace")(V):ne(V)):G(V)}function ne(V){return V===null||_e(V)?(M.exit("codeFencedFence"),q(V)):G(V)}}}function qv(t,l,a){const i=this;return o;function o(f){return f===null?a(f):(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),u)}function u(f){return i.parser.lazy[i.now().line]?a(f):l(f)}}const If={name:"codeIndented",tokenize:Vv},Xv={partial:!0,tokenize:Gv};function Vv(t,l,a){const i=this;return o;function o(h){return t.enter("codeIndented"),at(t,u,"linePrefix",5)(h)}function u(h){const g=i.events[i.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?f(h):a(h)}function f(h){return h===null?p(h):_e(h)?t.attempt(Xv,f,p)(h):(t.enter("codeFlowValue"),m(h))}function m(h){return h===null||_e(h)?(t.exit("codeFlowValue"),f(h)):(t.consume(h),m)}function p(h){return t.exit("codeIndented"),l(h)}}function Gv(t,l,a){const i=this;return o;function o(f){return i.parser.lazy[i.now().line]?a(f):_e(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),o):at(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):_e(f)?o(f):a(f)}}const Kv={name:"codeText",previous:Zv,resolve:Qv,tokenize:Wv};function Qv(t){let l=t.length-4,a=3,i,o;if((t[a][1].type==="lineEnding"||t[a][1].type==="space")&&(t[l][1].type==="lineEnding"||t[l][1].type==="space")){for(i=a;++i<l;)if(t[i][1].type==="codeTextData"){t[a][1].type="codeTextPadding",t[l][1].type="codeTextPadding",a+=2,l-=2;break}}for(i=a-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 Zv(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Wv(t,l,a){let i=0,o,u;return f;function f(y){return t.enter("codeText"),t.enter("codeTextSequence"),m(y)}function m(y){return y===96?(t.consume(y),i++,m):(t.exit("codeTextSequence"),p(y))}function p(y){return y===null?a(y):y===32?(t.enter("space"),t.consume(y),t.exit("space"),p):y===96?(u=t.enter("codeTextSequence"),o=0,g(y)):_e(y)?(t.enter("lineEnding"),t.consume(y),t.exit("lineEnding"),p):(t.enter("codeTextData"),h(y))}function h(y){return y===null||y===32||y===96||_e(y)?(t.exit("codeTextData"),p(y)):(t.consume(y),h)}function g(y){return y===96?(t.consume(y),o++,g):o===i?(t.exit("codeTextSequence"),t.exit("codeText"),l(y)):(u.type="codeTextData",h(y))}}class Jv{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,a){const i=a??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,a,i){const o=a||0;this.setCursor(Math.trunc(l));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&es(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),es(this.left,l)}unshift(l){this.setCursor(0),this.right.push(l)}unshiftMany(l){this.setCursor(0),es(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 a=this.left.splice(l,Number.POSITIVE_INFINITY);es(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-l,Number.POSITIVE_INFINITY);es(this.left,a.reverse())}}}function es(t,l){let a=0;if(l.length<1e4)t.push(...l);else for(;a<l.length;)t.push(...l.slice(a,a+1e4)),a+=1e4}function V0(t){const l={};let a=-1,i,o,u,f,m,p,h;const g=new Jv(t);for(;++a<g.length;){for(;a in l;)a=l[a];if(i=g.get(a),a&&i[1].type==="chunkFlow"&&g.get(a-1)[1].type==="listItemPrefix"&&(p=i[1]._tokenizer.events,u=0,u<p.length&&p[u][1].type==="lineEndingBlank"&&(u+=2),u<p.length&&p[u][1].type==="content"))for(;++u<p.length&&p[u][1].type!=="content";)p[u][1].type==="chunkText"&&(p[u][1]._isInFirstContentOfListItem=!0,u++);if(i[0]==="enter")i[1].contentType&&(Object.assign(l,Pv(g,a)),a=l[a],h=!0);else if(i[1]._container){for(u=a,o=void 0;u--;)if(f=g.get(u),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(o&&(g.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={...g.get(o)[1].start},m=g.slice(o,a),m.unshift(i),g.splice(o,a-o+1,m))}}return $n(t,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function Pv(t,l){const a=t.get(l)[1],i=t.get(l)[2];let o=l-1;const u=[];let f=a._tokenizer;f||(f=i.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const m=f.events,p=[],h={};let g,y,b=-1,v=a,k=0,S=0;const N=[S];for(;v;){for(;t.get(++o)[1]!==v;);u.push(o),v._tokenizer||(g=i.sliceStream(v),v.next||g.push(null),y&&f.defineSkip(v.start),v._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(g),v._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),y=v,v=v.next}for(v=a;++b<m.length;)m[b][0]==="exit"&&m[b-1][0]==="enter"&&m[b][1].type===m[b-1][1].type&&m[b][1].start.line!==m[b][1].end.line&&(S=b+1,N.push(S),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(f.events=[],v?(v._tokenizer=void 0,v.previous=void 0):N.pop(),b=N.length;b--;){const E=m.slice(N[b],N[b+1]),_=u.pop();p.push([_,_+E.length-1]),t.splice(_,2,E)}for(p.reverse(),b=-1;++b<p.length;)h[k+p[b][0]]=k+p[b][1],k+=p[b][1]-p[b][0]-1;return h}const ew={resolve:nw,tokenize:lw},tw={partial:!0,tokenize:aw};function nw(t){return V0(t),t}function lw(t,l){let a;return i;function i(m){return t.enter("content"),a=t.enter("chunkContent",{contentType:"content"}),o(m)}function o(m){return m===null?u(m):_e(m)?t.check(tw,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"),a.next=t.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,o}}function aw(t,l,a){const i=this;return o;function o(f){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),at(t,u,"linePrefix")}function u(f){if(f===null||_e(f))return a(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,a,l)(f)}}function G0(t,l,a,i,o,u,f,m,p){const h=p||Number.POSITIVE_INFINITY;let g=0;return y;function y(E){return E===60?(t.enter(i),t.enter(o),t.enter(u),t.consume(E),t.exit(u),b):E===null||E===32||E===41||sc(E)?a(E):(t.enter(i),t.enter(f),t.enter(m),t.enter("chunkString",{contentType:"string"}),S(E))}function b(E){return E===62?(t.enter(u),t.consume(E),t.exit(u),t.exit(o),t.exit(i),l):(t.enter(m),t.enter("chunkString",{contentType:"string"}),v(E))}function v(E){return E===62?(t.exit("chunkString"),t.exit(m),b(E)):E===null||E===60||_e(E)?a(E):(t.consume(E),E===92?k:v)}function k(E){return E===60||E===62||E===92?(t.consume(E),v):v(E)}function S(E){return!g&&(E===null||E===41||Et(E))?(t.exit("chunkString"),t.exit(m),t.exit(f),t.exit(i),l(E)):g<h&&E===40?(t.consume(E),g++,S):E===41?(t.consume(E),g--,S):E===null||E===32||E===40||sc(E)?a(E):(t.consume(E),E===92?N:S)}function N(E){return E===40||E===41||E===92?(t.consume(E),S):S(E)}}function K0(t,l,a,i,o,u){const f=this;let m=0,p;return h;function h(v){return t.enter(i),t.enter(o),t.consume(v),t.exit(o),t.enter(u),g}function g(v){return m>999||v===null||v===91||v===93&&!p||v===94&&!m&&"_hiddenFootnoteSupport"in f.parser.constructs?a(v):v===93?(t.exit(u),t.enter(o),t.consume(v),t.exit(o),t.exit(i),l):_e(v)?(t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),g):(t.enter("chunkString",{contentType:"string"}),y(v))}function y(v){return v===null||v===91||v===93||_e(v)||m++>999?(t.exit("chunkString"),g(v)):(t.consume(v),p||(p=!We(v)),v===92?b:y)}function b(v){return v===91||v===92||v===93?(t.consume(v),m++,y):y(v)}}function Q0(t,l,a,i,o,u){let f;return m;function m(b){return b===34||b===39||b===40?(t.enter(i),t.enter(o),t.consume(b),t.exit(o),f=b===40?41:b,p):a(b)}function p(b){return b===f?(t.enter(o),t.consume(b),t.exit(o),t.exit(i),l):(t.enter(u),h(b))}function h(b){return b===f?(t.exit(u),p(f)):b===null?a(b):_e(b)?(t.enter("lineEnding"),t.consume(b),t.exit("lineEnding"),at(t,h,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===f||b===null||_e(b)?(t.exit("chunkString"),h(b)):(t.consume(b),b===92?y:g)}function y(b){return b===f||b===92?(t.consume(b),g):g(b)}}function ds(t,l){let a;return i;function i(o){return _e(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),a=!0,i):We(o)?at(t,i,a?"linePrefix":"lineSuffix")(o):l(o)}}const rw={name:"definition",tokenize:sw},iw={partial:!0,tokenize:ow};function sw(t,l,a){const i=this;let o;return u;function u(v){return t.enter("definition"),f(v)}function f(v){return K0.call(i,t,m,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function m(v){return o=sl(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),v===58?(t.enter("definitionMarker"),t.consume(v),t.exit("definitionMarker"),p):a(v)}function p(v){return Et(v)?ds(t,h)(v):h(v)}function h(v){return G0(t,g,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function g(v){return t.attempt(iw,y,y)(v)}function y(v){return We(v)?at(t,b,"whitespace")(v):b(v)}function b(v){return v===null||_e(v)?(t.exit("definition"),i.parser.defined.push(o),l(v)):a(v)}}function ow(t,l,a){return i;function i(m){return Et(m)?ds(t,o)(m):a(m)}function o(m){return Q0(t,u,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(m)}function u(m){return We(m)?at(t,f,"whitespace")(m):f(m)}function f(m){return m===null||_e(m)?l(m):a(m)}}const cw={name:"hardBreakEscape",tokenize:uw};function uw(t,l,a){return i;function i(u){return t.enter("hardBreakEscape"),t.consume(u),o}function o(u){return _e(u)?(t.exit("hardBreakEscape"),l(u)):a(u)}}const fw={name:"headingAtx",resolve:dw,tokenize:hw};function dw(t,l){let a=t.length-2,i=3,o,u;return t[i][1].type==="whitespace"&&(i+=2),a-2>i&&t[a][1].type==="whitespace"&&(a-=2),t[a][1].type==="atxHeadingSequence"&&(i===a-1||a-4>i&&t[a-2][1].type==="whitespace")&&(a-=i+1===a?2:4),a>i&&(o={type:"atxHeadingText",start:t[i][1].start,end:t[a][1].end},u={type:"chunkText",start:t[i][1].start,end:t[a][1].end,contentType:"text"},$n(t,i,a-i+1,[["enter",o,l],["enter",u,l],["exit",u,l],["exit",o,l]])),t}function hw(t,l,a){let i=0;return o;function o(g){return t.enter("atxHeading"),u(g)}function u(g){return t.enter("atxHeadingSequence"),f(g)}function f(g){return g===35&&i++<6?(t.consume(g),f):g===null||Et(g)?(t.exit("atxHeadingSequence"),m(g)):a(g)}function m(g){return g===35?(t.enter("atxHeadingSequence"),p(g)):g===null||_e(g)?(t.exit("atxHeading"),l(g)):We(g)?at(t,m,"whitespace")(g):(t.enter("atxHeadingText"),h(g))}function p(g){return g===35?(t.consume(g),p):(t.exit("atxHeadingSequence"),m(g))}function h(g){return g===null||g===35||Et(g)?(t.exit("atxHeadingText"),m(g)):(t.consume(g),h)}}const mw=["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"],b1=["pre","script","style","textarea"],xw={concrete:!0,name:"htmlFlow",resolveTo:gw,tokenize:bw},pw={partial:!0,tokenize:ww},yw={partial:!0,tokenize:vw};function gw(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 bw(t,l,a){const i=this;let o,u,f,m,p;return h;function h(A){return g(A)}function g(A){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(A),y}function y(A){return A===33?(t.consume(A),b):A===47?(t.consume(A),u=!0,S):A===63?(t.consume(A),o=3,i.interrupt?l:D):xn(A)?(t.consume(A),f=String.fromCharCode(A),N):a(A)}function b(A){return A===45?(t.consume(A),o=2,v):A===91?(t.consume(A),o=5,m=0,k):xn(A)?(t.consume(A),o=4,i.interrupt?l:D):a(A)}function v(A){return A===45?(t.consume(A),i.interrupt?l:D):a(A)}function k(A){const se="CDATA[";return A===se.charCodeAt(m++)?(t.consume(A),m===se.length?i.interrupt?l:L:k):a(A)}function S(A){return xn(A)?(t.consume(A),f=String.fromCharCode(A),N):a(A)}function N(A){if(A===null||A===47||A===62||Et(A)){const se=A===47,de=f.toLowerCase();return!se&&!u&&b1.includes(de)?(o=1,i.interrupt?l(A):L(A)):mw.includes(f.toLowerCase())?(o=6,se?(t.consume(A),E):i.interrupt?l(A):L(A)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?a(A):u?_(A):$(A))}return A===45||fn(A)?(t.consume(A),f+=String.fromCharCode(A),N):a(A)}function E(A){return A===62?(t.consume(A),i.interrupt?l:L):a(A)}function _(A){return We(A)?(t.consume(A),_):z(A)}function $(A){return A===47?(t.consume(A),z):A===58||A===95||xn(A)?(t.consume(A),O):We(A)?(t.consume(A),$):z(A)}function O(A){return A===45||A===46||A===58||A===95||fn(A)?(t.consume(A),O):B(A)}function B(A){return A===61?(t.consume(A),M):We(A)?(t.consume(A),B):$(A)}function M(A){return A===null||A===60||A===61||A===62||A===96?a(A):A===34||A===39?(t.consume(A),p=A,q):We(A)?(t.consume(A),M):G(A)}function q(A){return A===p?(t.consume(A),p=null,P):A===null||_e(A)?a(A):(t.consume(A),q)}function G(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||Et(A)?B(A):(t.consume(A),G)}function P(A){return A===47||A===62||We(A)?$(A):a(A)}function z(A){return A===62?(t.consume(A),U):a(A)}function U(A){return A===null||_e(A)?L(A):We(A)?(t.consume(A),U):a(A)}function L(A){return A===45&&o===2?(t.consume(A),Y):A===60&&o===1?(t.consume(A),Q):A===62&&o===4?(t.consume(A),T):A===63&&o===3?(t.consume(A),D):A===93&&o===5?(t.consume(A),ae):_e(A)&&(o===6||o===7)?(t.exit("htmlFlowData"),t.check(pw,X,ee)(A)):A===null||_e(A)?(t.exit("htmlFlowData"),ee(A)):(t.consume(A),L)}function ee(A){return t.check(yw,ne,X)(A)}function ne(A){return t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),V}function V(A){return A===null||_e(A)?ee(A):(t.enter("htmlFlowData"),L(A))}function Y(A){return A===45?(t.consume(A),D):L(A)}function Q(A){return A===47?(t.consume(A),f="",re):L(A)}function re(A){if(A===62){const se=f.toLowerCase();return b1.includes(se)?(t.consume(A),T):L(A)}return xn(A)&&f.length<8?(t.consume(A),f+=String.fromCharCode(A),re):L(A)}function ae(A){return A===93?(t.consume(A),D):L(A)}function D(A){return A===62?(t.consume(A),T):A===45&&o===2?(t.consume(A),D):L(A)}function T(A){return A===null||_e(A)?(t.exit("htmlFlowData"),X(A)):(t.consume(A),T)}function X(A){return t.exit("htmlFlow"),l(A)}}function vw(t,l,a){const i=this;return o;function o(f){return _e(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),u):a(f)}function u(f){return i.parser.lazy[i.now().line]?a(f):l(f)}}function ww(t,l,a){return i;function i(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),t.attempt(ks,l,a)}}const kw={name:"htmlText",tokenize:Sw};function Sw(t,l,a){const i=this;let o,u,f;return m;function m(D){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(D),p}function p(D){return D===33?(t.consume(D),h):D===47?(t.consume(D),B):D===63?(t.consume(D),$):xn(D)?(t.consume(D),G):a(D)}function h(D){return D===45?(t.consume(D),g):D===91?(t.consume(D),u=0,k):xn(D)?(t.consume(D),_):a(D)}function g(D){return D===45?(t.consume(D),v):a(D)}function y(D){return D===null?a(D):D===45?(t.consume(D),b):_e(D)?(f=y,Q(D)):(t.consume(D),y)}function b(D){return D===45?(t.consume(D),v):y(D)}function v(D){return D===62?Y(D):D===45?b(D):y(D)}function k(D){const T="CDATA[";return D===T.charCodeAt(u++)?(t.consume(D),u===T.length?S:k):a(D)}function S(D){return D===null?a(D):D===93?(t.consume(D),N):_e(D)?(f=S,Q(D)):(t.consume(D),S)}function N(D){return D===93?(t.consume(D),E):S(D)}function E(D){return D===62?Y(D):D===93?(t.consume(D),E):S(D)}function _(D){return D===null||D===62?Y(D):_e(D)?(f=_,Q(D)):(t.consume(D),_)}function $(D){return D===null?a(D):D===63?(t.consume(D),O):_e(D)?(f=$,Q(D)):(t.consume(D),$)}function O(D){return D===62?Y(D):$(D)}function B(D){return xn(D)?(t.consume(D),M):a(D)}function M(D){return D===45||fn(D)?(t.consume(D),M):q(D)}function q(D){return _e(D)?(f=q,Q(D)):We(D)?(t.consume(D),q):Y(D)}function G(D){return D===45||fn(D)?(t.consume(D),G):D===47||D===62||Et(D)?P(D):a(D)}function P(D){return D===47?(t.consume(D),Y):D===58||D===95||xn(D)?(t.consume(D),z):_e(D)?(f=P,Q(D)):We(D)?(t.consume(D),P):Y(D)}function z(D){return D===45||D===46||D===58||D===95||fn(D)?(t.consume(D),z):U(D)}function U(D){return D===61?(t.consume(D),L):_e(D)?(f=U,Q(D)):We(D)?(t.consume(D),U):P(D)}function L(D){return D===null||D===60||D===61||D===62||D===96?a(D):D===34||D===39?(t.consume(D),o=D,ee):_e(D)?(f=L,Q(D)):We(D)?(t.consume(D),L):(t.consume(D),ne)}function ee(D){return D===o?(t.consume(D),o=void 0,V):D===null?a(D):_e(D)?(f=ee,Q(D)):(t.consume(D),ee)}function ne(D){return D===null||D===34||D===39||D===60||D===61||D===96?a(D):D===47||D===62||Et(D)?P(D):(t.consume(D),ne)}function V(D){return D===47||D===62||Et(D)?P(D):a(D)}function Y(D){return D===62?(t.consume(D),t.exit("htmlTextData"),t.exit("htmlText"),l):a(D)}function Q(D){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(D),t.exit("lineEnding"),re}function re(D){return We(D)?at(t,ae,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):ae(D)}function ae(D){return t.enter("htmlTextData"),f(D)}}const Kd={name:"labelEnd",resolveAll:Nw,resolveTo:Aw,tokenize:Dw},jw={tokenize:Tw},Ew={tokenize:zw},Cw={tokenize:Mw};function Nw(t){let l=-1;const a=[];for(;++l<t.length;){const i=t[l][1];if(a.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!==a.length&&$n(t,0,t.length,a),t}function Aw(t,l){let a=t.length,i=0,o,u,f,m;for(;a--;)if(o=t[a][1],u){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;t[a][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(f){if(t[a][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(u=a,o.type!=="labelLink")){i=2;break}}else o.type==="labelEnd"&&(f=a);const p={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}},g={type:"labelText",start:{...t[u+i+2][1].end},end:{...t[f-2][1].start}};return m=[["enter",p,l],["enter",h,l]],m=Wn(m,t.slice(u+1,u+i+3)),m=Wn(m,[["enter",g,l]]),m=Wn(m,gc(l.parser.constructs.insideSpan.null,t.slice(u+i+4,f-3),l)),m=Wn(m,[["exit",g,l],t[f-2],t[f-1],["exit",h,l]]),m=Wn(m,t.slice(f+1)),m=Wn(m,[["exit",p,l]]),$n(t,u,t.length,m),t}function Dw(t,l,a){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(b){return u?u._inactive?y(b):(f=i.parser.defined.includes(sl(i.sliceSerialize({start:u.end,end:i.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(b),t.exit("labelMarker"),t.exit("labelEnd"),p):a(b)}function p(b){return b===40?t.attempt(jw,g,f?g:y)(b):b===91?t.attempt(Ew,g,f?h:y)(b):f?g(b):y(b)}function h(b){return t.attempt(Cw,g,y)(b)}function g(b){return l(b)}function y(b){return u._balanced=!0,a(b)}}function Tw(t,l,a){return i;function i(y){return t.enter("resource"),t.enter("resourceMarker"),t.consume(y),t.exit("resourceMarker"),o}function o(y){return Et(y)?ds(t,u)(y):u(y)}function u(y){return y===41?g(y):G0(t,f,m,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function f(y){return Et(y)?ds(t,p)(y):g(y)}function m(y){return a(y)}function p(y){return y===34||y===39||y===40?Q0(t,h,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):g(y)}function h(y){return Et(y)?ds(t,g)(y):g(y)}function g(y){return y===41?(t.enter("resourceMarker"),t.consume(y),t.exit("resourceMarker"),t.exit("resource"),l):a(y)}}function zw(t,l,a){const i=this;return o;function o(m){return K0.call(i,t,u,f,"reference","referenceMarker","referenceString")(m)}function u(m){return i.parser.defined.includes(sl(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?l(m):a(m)}function f(m){return a(m)}}function Mw(t,l,a){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):a(u)}}const _w={name:"labelStartImage",resolveAll:Kd.resolveAll,tokenize:Fw};function Fw(t,l,a){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):a(m)}function f(m){return m===94&&"_hiddenFootnoteSupport"in i.parser.constructs?a(m):l(m)}}const Rw={name:"labelStartLink",resolveAll:Kd.resolveAll,tokenize:Ow};function Ow(t,l,a){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?a(f):l(f)}}const qf={name:"lineEnding",tokenize:Bw};function Bw(t,l){return a;function a(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),at(t,l,"linePrefix")}}const tc={name:"thematicBreak",tokenize:$w};function $w(t,l,a){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"),p(h)):i>=3&&(h===null||_e(h))?(t.exit("thematicBreak"),l(h)):a(h)}function p(h){return h===o?(t.consume(h),i++,p):(t.exit("thematicBreakSequence"),We(h)?at(t,m,"whitespace")(h):m(h))}}const Cn={continuation:{tokenize:Yw},exit:qw,name:"list",tokenize:Uw},Lw={partial:!0,tokenize:Xw},Hw={partial:!0,tokenize:Iw};function Uw(t,l,a){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(v){const k=i.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!i.containerState.marker||v===i.containerState.marker:Ed(v)){if(i.containerState.type||(i.containerState.type=k,t.enter(k,{_container:!0})),k==="listUnordered")return t.enter("listItemPrefix"),v===42||v===45?t.check(tc,a,h)(v):h(v);if(!i.interrupt||v===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),p(v)}return a(v)}function p(v){return Ed(v)&&++f<10?(t.consume(v),p):(!i.interrupt||f<2)&&(i.containerState.marker?v===i.containerState.marker:v===41||v===46)?(t.exit("listItemValue"),h(v)):a(v)}function h(v){return t.enter("listItemMarker"),t.consume(v),t.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||v,t.check(ks,i.interrupt?a:g,t.attempt(Lw,b,y))}function g(v){return i.containerState.initialBlankLine=!0,u++,b(v)}function y(v){return We(v)?(t.enter("listItemPrefixWhitespace"),t.consume(v),t.exit("listItemPrefixWhitespace"),b):a(v)}function b(v){return i.containerState.size=u+i.sliceSerialize(t.exit("listItemPrefix"),!0).length,l(v)}}function Yw(t,l,a){const i=this;return i.containerState._closeFlow=void 0,t.check(ks,o,u);function o(m){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,at(t,l,"listItemIndent",i.containerState.size+1)(m)}function u(m){return i.containerState.furtherBlankLines||!We(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(Hw,l,f)(m))}function f(m){return i.containerState._closeFlow=!0,i.interrupt=void 0,at(t,t.attempt(Cn,l,a),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m)}}function Iw(t,l,a){const i=this;return at(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):a(u)}}function qw(t){t.exit(this.containerState.type)}function Xw(t,l,a){const i=this;return at(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!We(u)&&f&&f[1].type==="listItemPrefixWhitespace"?l(u):a(u)}}const v1={name:"setextUnderline",resolveTo:Vw,tokenize:Gw};function Vw(t,l){let a=t.length,i,o,u;for(;a--;)if(t[a][0]==="enter"){if(t[a][1].type==="content"){i=a;break}t[a][1].type==="paragraph"&&(o=a)}else t[a][1].type==="content"&&t.splice(a,1),!u&&t[a][1].type==="definition"&&(u=a);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 Gw(t,l,a){const i=this;let o;return u;function u(h){let g=i.events.length,y;for(;g--;)if(i.events[g][1].type!=="lineEnding"&&i.events[g][1].type!=="linePrefix"&&i.events[g][1].type!=="content"){y=i.events[g][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||y)?(t.enter("setextHeadingLine"),o=h,f(h)):a(h)}function f(h){return t.enter("setextHeadingLineSequence"),m(h)}function m(h){return h===o?(t.consume(h),m):(t.exit("setextHeadingLineSequence"),We(h)?at(t,p,"lineSuffix")(h):p(h))}function p(h){return h===null||_e(h)?(t.exit("setextHeadingLine"),l(h)):a(h)}}const Kw={tokenize:Qw};function Qw(t){const l=this,a=t.attempt(ks,i,t.attempt(this.parser.constructs.flowInitial,o,at(t,t.attempt(this.parser.constructs.flow,o,t.attempt(ew,o)),"linePrefix")));return a;function i(u){if(u===null){t.consume(u);return}return t.enter("lineEndingBlank"),t.consume(u),t.exit("lineEndingBlank"),l.currentConstruct=void 0,a}function o(u){if(u===null){t.consume(u);return}return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),l.currentConstruct=void 0,a}}const Zw={resolveAll:W0()},Ww=Z0("string"),Jw=Z0("text");function Z0(t){return{resolveAll:W0(t==="text"?Pw:void 0),tokenize:l};function l(a){const i=this,o=this.parser.constructs[t],u=a.attempt(o,f,m);return f;function f(g){return h(g)?u(g):m(g)}function m(g){if(g===null){a.consume(g);return}return a.enter("data"),a.consume(g),p}function p(g){return h(g)?(a.exit("data"),u(g)):(a.consume(g),p)}function h(g){if(g===null)return!0;const y=o[g];let b=-1;if(y)for(;++b<y.length;){const v=y[b];if(!v.previous||v.previous.call(i,i.previous))return!0}return!1}}}function W0(t){return l;function l(a,i){let o=-1,u;for(;++o<=a.length;)u===void 0?a[o]&&a[o][1].type==="data"&&(u=o,o++):(!a[o]||a[o][1].type!=="data")&&(o!==u+2&&(a[u][1].end=a[o-1][1].end,a.splice(u+2,o-u-2),o=u+2),u=void 0);return t?t(a,i):a}}function Pw(t,l){let a=0;for(;++a<=t.length;)if((a===t.length||t[a][1].type==="lineEnding")&&t[a-1][1].type==="data"){const i=t[a-1][1],o=l.sliceStream(i);let u=o.length,f=-1,m=0,p;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)p=!0,m++;else if(h!==-1){u++;break}}if(l._contentTypeTextTrailing&&a===t.length&&(m=0),m){const h={type:a===t.length||p||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(a,0,["enter",h,l],["exit",h,l]),a+=2)}a++}return t}const e5={42:Cn,43:Cn,45:Cn,48:Cn,49:Cn,50:Cn,51:Cn,52:Cn,53:Cn,54:Cn,55:Cn,56:Cn,57:Cn,62:I0},t5={91:rw},n5={[-2]:If,[-1]:If,32:If},l5={35:fw,42:tc,45:[v1,tc],60:xw,61:v1,95:tc,96:g1,126:g1},a5={38:X0,92:q0},r5={[-5]:qf,[-4]:qf,[-3]:qf,33:_w,38:X0,42:Cd,60:[Rv,kw],91:Rw,92:[cw,q0],93:Kd,95:Cd,96:Kv},i5={null:[Cd,Zw]},s5={null:[42,95]},o5={null:[]},c5=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:s5,contentInitial:t5,disable:o5,document:e5,flow:l5,flowInitial:n5,insideSpan:i5,string:a5,text:r5},Symbol.toStringTag,{value:"Module"}));function u5(t,l,a){let i={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const o={},u=[];let f=[],m=[];const p={attempt:q(B),check:q(M),consume:_,enter:$,exit:O,interrupt:q(M,{interrupt:!0})},h={code:null,containerState:{},defineSkip:S,events:[],now:k,parser:t,previous:null,sliceSerialize:b,sliceStream:v,write:y};let g=l.tokenize.call(h,p);return l.resolveAll&&u.push(l),h;function y(U){return f=Wn(f,U),N(),f[f.length-1]!==null?[]:(G(l,0),h.events=gc(u,h.events,h),h.events)}function b(U,L){return d5(v(U),L)}function v(U){return f5(f,U)}function k(){const{_bufferIndex:U,_index:L,line:ee,column:ne,offset:V}=i;return{_bufferIndex:U,_index:L,line:ee,column:ne,offset:V}}function S(U){o[U.line]=U.column,z()}function N(){let U;for(;i._index<f.length;){const L=f[i._index];if(typeof L=="string")for(U=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===U&&i._bufferIndex<L.length;)E(L.charCodeAt(i._bufferIndex));else E(L)}}function E(U){g=g(U)}function _(U){_e(U)?(i.line++,i.column=1,i.offset+=U===-3?2:1,z()):U!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===f[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=U}function $(U,L){const ee=L||{};return ee.type=U,ee.start=k(),h.events.push(["enter",ee,h]),m.push(ee),ee}function O(U){const L=m.pop();return L.end=k(),h.events.push(["exit",L,h]),L}function B(U,L){G(U,L.from)}function M(U,L){L.restore()}function q(U,L){return ee;function ee(ne,V,Y){let Q,re,ae,D;return Array.isArray(ne)?X(ne):"tokenize"in ne?X([ne]):T(ne);function T(he){return we;function we(Ce){const Oe=Ce!==null&&he[Ce],pe=Ce!==null&&he.null,Ke=[...Array.isArray(Oe)?Oe:Oe?[Oe]:[],...Array.isArray(pe)?pe:pe?[pe]:[]];return X(Ke)(Ce)}}function X(he){return Q=he,re=0,he.length===0?Y:A(he[re])}function A(he){return we;function we(Ce){return D=P(),ae=he,he.partial||(h.currentConstruct=he),he.name&&h.parser.constructs.disable.null.includes(he.name)?de():he.tokenize.call(L?Object.assign(Object.create(h),L):h,p,se,de)(Ce)}}function se(he){return U(ae,D),V}function de(he){return D.restore(),++re<Q.length?A(Q[re]):Y}}}function G(U,L){U.resolveAll&&!u.includes(U)&&u.push(U),U.resolve&&$n(h.events,L,h.events.length-L,U.resolve(h.events.slice(L),h)),U.resolveTo&&(h.events=U.resolveTo(h.events,h))}function P(){const U=k(),L=h.previous,ee=h.currentConstruct,ne=h.events.length,V=Array.from(m);return{from:ne,restore:Y};function Y(){i=U,h.previous=L,h.currentConstruct=ee,h.events.length=ne,m=V,z()}}function z(){i.line in o&&i.column<2&&(i.column=o[i.line],i.offset+=o[i.line]-1)}}function f5(t,l){const a=l.start._index,i=l.start._bufferIndex,o=l.end._index,u=l.end._bufferIndex;let f;if(a===o)f=[t[a].slice(i,u)];else{if(f=t.slice(a,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 d5(t,l){let a=-1;const i=[];let o;for(;++a<t.length;){const u=t[a];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 h5(t){const i={constructs:U0([c5,...(t||{}).extensions||[]]),content:o(Av),defined:[],document:o(Tv),flow:o(Kw),lazy:{},string:o(Ww),text:o(Jw)};return i;function o(u){return f;function f(m){return u5(i,u,m)}}}function m5(t){for(;!V0(t););return t}const w1=/[\0\t\n\r]/g;function x5(){let t=1,l="",a=!0,i;return o;function o(u,f,m){const p=[];let h,g,y,b,v;for(u=l+(typeof u=="string"?u.toString():new TextDecoder(f||void 0).decode(u)),y=0,l="",a&&(u.charCodeAt(0)===65279&&y++,a=void 0);y<u.length;){if(w1.lastIndex=y,h=w1.exec(u),b=h&&h.index!==void 0?h.index:u.length,v=u.charCodeAt(b),!h){l=u.slice(y);break}if(v===10&&y===b&&i)p.push(-3),i=void 0;else switch(i&&(p.push(-5),i=void 0),y<b&&(p.push(u.slice(y,b)),t+=b-y),v){case 0:{p.push(65533),t++;break}case 9:{for(g=Math.ceil(t/4)*4,p.push(-2);t++<g;)p.push(-1);break}case 10:{p.push(-4),t=1;break}default:i=!0,t=1}y=b+1}return m&&(i&&p.push(-5),l&&p.push(l),p.push(null)),p}}const p5=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function y5(t){return t.replace(p5,g5)}function g5(t,l,a){if(l)return l;if(a.charCodeAt(0)===35){const o=a.charCodeAt(1),u=o===120||o===88;return Y0(a.slice(u?2:1),u?16:10)}return Gd(a)||t}const J0={}.hasOwnProperty;function b5(t,l,a){return l&&typeof l=="object"&&(a=l,l=void 0),v5(a)(m5(h5(a).document().write(x5()(t,l,!0))))}function v5(t){const l={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(_t),autolinkProtocol:P,autolinkEmail:P,atxHeading:u(qe),blockQuote:u(pe),characterEscape:P,characterReference:P,codeFenced:u(Ke),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:u(Ke,f),codeText:u(lt,f),codeTextData:P,data:P,codeFlowValue:P,definition:u(me),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:u(Ee),hardBreakEscape:u(Mt),hardBreakTrailing:u(Mt),htmlFlow:u(mt,f),htmlFlowData:P,htmlText:u(mt,f),htmlTextData:P,image:u(Yt),label:f,link:u(_t),listItem:u(Ct),listItemValue:b,listOrdered:u(on,y),listUnordered:u(on),paragraph:u(Ot),reference:A,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:u(qe),strong:u(Ln),thematicBreak:u(Hn)},exit:{atxHeading:p(),atxHeadingSequence:B,autolink:p(),autolinkEmail:Oe,autolinkProtocol:Ce,blockQuote:p(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:he,characterReference:we,codeFenced:p(N),codeFencedFence:S,codeFencedFenceInfo:v,codeFencedFenceMeta:k,codeFlowValue:z,codeIndented:p(E),codeText:p(V),codeTextData:z,data:z,definition:p(),definitionDestinationString:O,definitionLabelString:_,definitionTitleString:$,emphasis:p(),hardBreakEscape:p(L),hardBreakTrailing:p(L),htmlFlow:p(ee),htmlFlowData:z,htmlText:p(ne),htmlTextData:z,image:p(Q),label:ae,labelText:re,lineEnding:U,link:p(Y),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:se,resourceDestinationString:D,resourceTitleString:T,resource:X,setextHeading:p(G),setextHeadingLineSequence:q,setextHeadingText:M,strong:p(),thematicBreak:p()}};P0(l,(t||{}).mdastExtensions||[]);const a={};return i;function i(le){let ye={type:"root",children:[]};const Te={stack:[ye],tokenStack:[],config:l,enter:m,exit:h,buffer:f,resume:g,data:a},xe=[];let be=-1;for(;++be<le.length;)if(le[be][1].type==="listOrdered"||le[be][1].type==="listUnordered")if(le[be][0]==="enter")xe.push(be);else{const rt=xe.pop();be=o(le,rt,be)}for(be=-1;++be<le.length;){const rt=l[le[be][0]];J0.call(rt,le[be][1].type)&&rt[le[be][1].type].call(Object.assign({sliceSerialize:le[be][2].sliceSerialize},Te),le[be][1])}if(Te.tokenStack.length>0){const rt=Te.tokenStack[Te.tokenStack.length-1];(rt[1]||k1).call(Te,void 0,rt[0])}for(ye.position={start:va(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:va(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},be=-1;++be<l.transforms.length;)ye=l.transforms[be](ye)||ye;return ye}function o(le,ye,Te){let xe=ye-1,be=-1,rt=!1,xt,Xe,ue,De;for(;++xe<=Te;){const it=le[xe];switch(it[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{it[0]==="enter"?be++:be--,De=void 0;break}case"lineEndingBlank":{it[0]==="enter"&&(xt&&!De&&!be&&!ue&&(ue=xe),De=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:De=void 0}if(!be&&it[0]==="enter"&&it[1].type==="listItemPrefix"||be===-1&&it[0]==="exit"&&(it[1].type==="listUnordered"||it[1].type==="listOrdered")){if(xt){let gn=xe;for(Xe=void 0;gn--;){const en=le[gn];if(en[1].type==="lineEnding"||en[1].type==="lineEndingBlank"){if(en[0]==="exit")continue;Xe&&(le[Xe][1].type="lineEndingBlank",rt=!0),en[1].type="lineEnding",Xe=gn}else if(!(en[1].type==="linePrefix"||en[1].type==="blockQuotePrefix"||en[1].type==="blockQuotePrefixWhitespace"||en[1].type==="blockQuoteMarker"||en[1].type==="listItemIndent"))break}ue&&(!Xe||ue<Xe)&&(xt._spread=!0),xt.end=Object.assign({},Xe?le[Xe][1].start:it[1].end),le.splice(Xe||xe,0,["exit",xt,it[2]]),xe++,Te++}if(it[1].type==="listItemPrefix"){const gn={type:"listItem",_spread:!1,start:Object.assign({},it[1].start),end:void 0};xt=gn,le.splice(xe,0,["enter",gn,it[2]]),xe++,Te++,ue=void 0,De=!0}}}return le[ye][1]._spread=rt,Te}function u(le,ye){return Te;function Te(xe){m.call(this,le(xe),xe),ye&&ye.call(this,xe)}}function f(){this.stack.push({type:"fragment",children:[]})}function m(le,ye,Te){this.stack[this.stack.length-1].children.push(le),this.stack.push(le),this.tokenStack.push([ye,Te||void 0]),le.position={start:va(ye.start),end:void 0}}function p(le){return ye;function ye(Te){le&&le.call(this,Te),h.call(this,Te)}}function h(le,ye){const Te=this.stack.pop(),xe=this.tokenStack.pop();if(xe)xe[0].type!==le.type&&(ye?ye.call(this,le,xe[0]):(xe[1]||k1).call(this,le,xe[0]));else throw new Error("Cannot close `"+le.type+"` ("+fs({start:le.start,end:le.end})+"): it’s not open");Te.position.end=va(le.end)}function g(){return Vd(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function b(le){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(le),10),this.data.expectingFirstListItemValue=void 0}}function v(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=le}function k(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=le}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le.replace(/(\r?\n|\r)$/g,"")}function _(le){const ye=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ye,Te.identifier=sl(this.sliceSerialize(le)).toLowerCase()}function $(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.title=le}function O(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.url=le}function B(le){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Te=this.sliceSerialize(le).length;ye.depth=Te}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function q(le){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(le).codePointAt(0)===61?1:2}function G(){this.data.setextHeadingSlurpLineEnding=void 0}function P(le){const Te=this.stack[this.stack.length-1].children;let xe=Te[Te.length-1];(!xe||xe.type!=="text")&&(xe=Bt(),xe.position={start:va(le.start),end:void 0},Te.push(xe)),this.stack.push(xe)}function z(le){const ye=this.stack.pop();ye.value+=this.sliceSerialize(le),ye.position.end=va(le.end)}function U(le){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=ye.children[ye.children.length-1];Te.position.end=va(le.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&l.canContainEols.includes(ye.type)&&(P.call(this,le),z.call(this,le))}function L(){this.data.atHardBreak=!0}function ee(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function ne(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function V(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function Y(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=ye,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function Q(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=ye,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function re(le){const ye=this.sliceSerialize(le),Te=this.stack[this.stack.length-2];Te.label=y5(ye),Te.identifier=sl(ye).toLowerCase()}function ae(){const le=this.stack[this.stack.length-1],ye=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const xe=le.children;Te.children=xe}else Te.alt=ye}function D(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.url=le}function T(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.title=le}function X(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function se(le){const ye=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ye,Te.identifier=sl(this.sliceSerialize(le)).toLowerCase(),this.data.referenceType="full"}function de(le){this.data.characterReferenceType=le.type}function he(le){const ye=this.sliceSerialize(le),Te=this.data.characterReferenceType;let xe;Te?(xe=Y0(ye,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):xe=Gd(ye);const be=this.stack[this.stack.length-1];be.value+=xe}function we(le){const ye=this.stack.pop();ye.position.end=va(le.end)}function Ce(le){z.call(this,le);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(le)}function Oe(le){z.call(this,le);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(le)}function pe(){return{type:"blockquote",children:[]}}function Ke(){return{type:"code",lang:null,meta:null,value:""}}function lt(){return{type:"inlineCode",value:""}}function me(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ee(){return{type:"emphasis",children:[]}}function qe(){return{type:"heading",depth:0,children:[]}}function Mt(){return{type:"break"}}function mt(){return{type:"html",value:""}}function Yt(){return{type:"image",title:null,url:"",alt:null}}function _t(){return{type:"link",title:null,url:"",children:[]}}function on(le){return{type:"list",ordered:le.type==="listOrdered",start:null,spread:le._spread,children:[]}}function Ct(le){return{type:"listItem",spread:le._spread,checked:null,children:[]}}function Ot(){return{type:"paragraph",children:[]}}function Ln(){return{type:"strong",children:[]}}function Bt(){return{type:"text",value:""}}function Hn(){return{type:"thematicBreak"}}}function va(t){return{line:t.line,column:t.column,offset:t.offset}}function P0(t,l){let a=-1;for(;++a<l.length;){const i=l[a];Array.isArray(i)?P0(t,i):w5(t,i)}}function w5(t,l){let a;for(a in l)if(J0.call(l,a))switch(a){case"canContainEols":{const i=l[a];i&&t[a].push(...i);break}case"transforms":{const i=l[a];i&&t[a].push(...i);break}case"enter":case"exit":{const i=l[a];i&&Object.assign(t[a],i);break}}}function k1(t,l){throw t?new Error("Cannot close `"+t.type+"` ("+fs({start:t.start,end:t.end})+"): a different token (`"+l.type+"`, "+fs({start:l.start,end:l.end})+") is open"):new Error("Cannot close document, a token (`"+l.type+"`, "+fs({start:l.start,end:l.end})+") is still open")}function k5(t){const l=this;l.parser=a;function a(i){return b5(i,{...l.data("settings"),...t,extensions:l.data("micromarkExtensions")||[],mdastExtensions:l.data("fromMarkdownExtensions")||[]})}}function S5(t,l){const a={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(l),!0)};return t.patch(l,a),t.applyData(l,a)}function j5(t,l){const a={type:"element",tagName:"br",properties:{},children:[]};return t.patch(l,a),[t.applyData(l,a),{type:"text",value:`
54
+ `}]}function E5(t,l){const a=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:a}]};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 C5(t,l){const a={type:"element",tagName:"del",properties:{},children:t.all(l)};return t.patch(l,a),t.applyData(l,a)}function N5(t,l){const a={type:"element",tagName:"em",properties:{},children:t.all(l)};return t.patch(l,a),t.applyData(l,a)}function A5(t,l){const a=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 p={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+o,id:a+"fnref-"+o+(m>1?"-"+m:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};t.patch(l,p);const h={type:"element",tagName:"sup",properties:{},children:[p]};return t.patch(l,h),t.applyData(l,h)}function D5(t,l){const a={type:"element",tagName:"h"+l.depth,properties:{},children:t.all(l)};return t.patch(l,a),t.applyData(l,a)}function T5(t,l){if(t.options.allowDangerousHtml){const a={type:"raw",value:l.value};return t.patch(l,a),t.applyData(l,a)}}function ey(t,l){const a=l.referenceType;let i="]";if(a==="collapsed"?i+="[]":a==="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 z5(t,l){const a=String(l.identifier).toUpperCase(),i=t.definitionById.get(a);if(!i)return ey(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 M5(t,l){const a={src:Pr(l.url)};l.alt!==null&&l.alt!==void 0&&(a.alt=l.alt),l.title!==null&&l.title!==void 0&&(a.title=l.title);const i={type:"element",tagName:"img",properties:a,children:[]};return t.patch(l,i),t.applyData(l,i)}function _5(t,l){const a={type:"text",value:l.value.replace(/\r?\n|\r/g," ")};t.patch(l,a);const i={type:"element",tagName:"code",properties:{},children:[a]};return t.patch(l,i),t.applyData(l,i)}function F5(t,l){const a=String(l.identifier).toUpperCase(),i=t.definitionById.get(a);if(!i)return ey(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 R5(t,l){const a={href:Pr(l.url)};l.title!==null&&l.title!==void 0&&(a.title=l.title);const i={type:"element",tagName:"a",properties:a,children:t.all(l)};return t.patch(l,i),t.applyData(l,i)}function O5(t,l,a){const i=t.all(l),o=a?B5(a):ty(l),u={},f=[];if(typeof l.checked=="boolean"){const g=i[0];let y;g&&g.type==="element"&&g.tagName==="p"?y=g:(y={type:"element",tagName:"p",properties:{},children:[]},i.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.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 g=i[m];(o||m!==0||g.type!=="element"||g.tagName!=="p")&&f.push({type:"text",value:`
56
+ `}),g.type==="element"&&g.tagName==="p"&&!o?f.push(...g.children):f.push(g)}const p=i[i.length-1];p&&(o||p.type!=="element"||p.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 B5(t){let l=!1;if(t.type==="list"){l=t.spread||!1;const a=t.children;let i=-1;for(;!l&&++i<a.length;)l=ty(a[i])}return l}function ty(t){const l=t.spread;return l??t.children.length>1}function $5(t,l){const a={},i=t.all(l);let o=-1;for(typeof l.start=="number"&&l.start!==1&&(a.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")){a.className=["contains-task-list"];break}}const u={type:"element",tagName:l.ordered?"ol":"ul",properties:a,children:t.wrap(i,!0)};return t.patch(l,u),t.applyData(l,u)}function L5(t,l){const a={type:"element",tagName:"p",properties:{},children:t.all(l)};return t.patch(l,a),t.applyData(l,a)}function H5(t,l){const a={type:"root",children:t.wrap(t.all(l))};return t.patch(l,a),t.applyData(l,a)}function U5(t,l){const a={type:"element",tagName:"strong",properties:{},children:t.all(l)};return t.patch(l,a),t.applyData(l,a)}function Y5(t,l){const a=t.all(l),i=a.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(a.length>0){const f={type:"element",tagName:"tbody",properties:{},children:t.wrap(a,!0)},m=Yd(l.children[1]),p=F0(l.children[l.children.length-1]);m&&p&&(f.position={start:m,end:p}),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 I5(t,l,a){const i=a?a.children:void 0,u=(i?i.indexOf(l):1)===0?"th":"td",f=a&&a.type==="table"?a.align:void 0,m=f?f.length:l.children.length;let p=-1;const h=[];for(;++p<m;){const y=l.children[p],b={},v=f?f[p]:void 0;v&&(b.align=v);let k={type:"element",tagName:u,properties:b,children:[]};y&&(k.children=t.all(y),t.patch(y,k),k=t.applyData(y,k)),h.push(k)}const g={type:"element",tagName:"tr",properties:{},children:t.wrap(h,!0)};return t.patch(l,g),t.applyData(l,g)}function q5(t,l){const a={type:"element",tagName:"td",properties:{},children:t.all(l)};return t.patch(l,a),t.applyData(l,a)}const S1=9,j1=32;function X5(t){const l=String(t),a=/\r?\n|\r/g;let i=a.exec(l),o=0;const u=[];for(;i;)u.push(E1(l.slice(o,i.index),o>0,!0),i[0]),o=i.index+i[0].length,i=a.exec(l);return u.push(E1(l.slice(o),o>0,!1)),u.join("")}function E1(t,l,a){let i=0,o=t.length;if(l){let u=t.codePointAt(i);for(;u===S1||u===j1;)i++,u=t.codePointAt(i)}if(a){let u=t.codePointAt(o-1);for(;u===S1||u===j1;)o--,u=t.codePointAt(o-1)}return o>i?t.slice(i,o):""}function V5(t,l){const a={type:"text",value:X5(String(l.value))};return t.patch(l,a),t.applyData(l,a)}function G5(t,l){const a={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(l,a),t.applyData(l,a)}const K5={blockquote:S5,break:j5,code:E5,delete:C5,emphasis:N5,footnoteReference:A5,heading:D5,html:T5,imageReference:z5,image:M5,inlineCode:_5,linkReference:F5,link:R5,listItem:O5,list:$5,paragraph:L5,root:H5,strong:U5,table:Y5,tableCell:q5,tableRow:I5,text:V5,thematicBreak:G5,toml:Io,yaml:Io,definition:Io,footnoteDefinition:Io};function Io(){}const ny=-1,bc=0,hs=1,oc=2,Qd=3,Zd=4,Wd=5,Jd=6,ly=7,ay=8,C1=typeof self=="object"?self:globalThis,Q5=(t,l)=>{const a=(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 bc:case ny:return a(f,o);case hs:{const m=a([],o);for(const p of f)m.push(i(p));return m}case oc:{const m=a({},o);for(const[p,h]of f)m[i(p)]=i(h);return m}case Qd:return a(new Date(f),o);case Zd:{const{source:m,flags:p}=f;return a(new RegExp(m,p),o)}case Wd:{const m=a(new Map,o);for(const[p,h]of f)m.set(i(p),i(h));return m}case Jd:{const m=a(new Set,o);for(const p of f)m.add(i(p));return m}case ly:{const{name:m,message:p}=f;return a(new C1[m](p),o)}case ay:return a(BigInt(f),o);case"BigInt":return a(Object(BigInt(f)),o);case"ArrayBuffer":return a(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:m}=new Uint8Array(f);return a(new DataView(m),f)}}return a(new C1[u](f),o)};return i},N1=t=>Q5(new Map,t)(0),Yr="",{toString:Z5}={},{keys:W5}=Object,ts=t=>{const l=typeof t;if(l!=="object"||!t)return[bc,l];const a=Z5.call(t).slice(8,-1);switch(a){case"Array":return[hs,Yr];case"Object":return[oc,Yr];case"Date":return[Qd,Yr];case"RegExp":return[Zd,Yr];case"Map":return[Wd,Yr];case"Set":return[Jd,Yr];case"DataView":return[hs,a]}return a.includes("Array")?[hs,a]:a.includes("Error")?[ly,a]:[oc,a]},qo=([t,l])=>t===bc&&(l==="function"||l==="symbol"),J5=(t,l,a,i)=>{const o=(f,m)=>{const p=i.push(f)-1;return a.set(m,p),p},u=f=>{if(a.has(f))return a.get(f);let[m,p]=ts(f);switch(m){case bc:{let g=f;switch(p){case"bigint":m=ay,g=f.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+p);g=null;break;case"undefined":return o([ny],f)}return o([m,g],f)}case hs:{if(p){let b=f;return p==="DataView"?b=new Uint8Array(f.buffer):p==="ArrayBuffer"&&(b=new Uint8Array(f)),o([p,[...b]],f)}const g=[],y=o([m,g],f);for(const b of f)g.push(u(b));return y}case oc:{if(p)switch(p){case"BigInt":return o([p,f.toString()],f);case"Boolean":case"Number":case"String":return o([p,f.valueOf()],f)}if(l&&"toJSON"in f)return u(f.toJSON());const g=[],y=o([m,g],f);for(const b of W5(f))(t||!qo(ts(f[b])))&&g.push([u(b),u(f[b])]);return y}case Qd:return o([m,f.toISOString()],f);case Zd:{const{source:g,flags:y}=f;return o([m,{source:g,flags:y}],f)}case Wd:{const g=[],y=o([m,g],f);for(const[b,v]of f)(t||!(qo(ts(b))||qo(ts(v))))&&g.push([u(b),u(v)]);return y}case Jd:{const g=[],y=o([m,g],f);for(const b of f)(t||!qo(ts(b)))&&g.push(u(b));return y}}const{message:h}=f;return o([m,{name:p,message:h}],f)};return u},A1=(t,{json:l,lossy:a}={})=>{const i=[];return J5(!(l||a),!!l,new Map,i)(t),i},cc=typeof structuredClone=="function"?(t,l)=>l&&("json"in l||"lossy"in l)?N1(A1(t,l)):structuredClone(t):(t,l)=>N1(A1(t,l));function P5(t,l){const a=[{type:"text",value:"↩"}];return l>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(l)}]}),a}function e3(t,l){return"Back to reference "+(t+1)+(l>1?"-"+l:"")}function t3(t){const l=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",a=t.options.footnoteBackContent||P5,i=t.options.footnoteBackLabel||e3,o=t.options.footnoteLabel||"Footnotes",u=t.options.footnoteLabelTagName||"h2",f=t.options.footnoteLabelProperties||{className:["sr-only"]},m=[];let p=-1;for(;++p<t.footnoteOrder.length;){const h=t.footnoteById.get(t.footnoteOrder[p]);if(!h)continue;const g=t.all(h),y=String(h.identifier).toUpperCase(),b=Pr(y.toLowerCase());let v=0;const k=[],S=t.footnoteCounts.get(y);for(;S!==void 0&&++v<=S;){k.length>0&&k.push({type:"text",value:" "});let _=typeof a=="string"?a:a(p,v);typeof _=="string"&&(_={type:"text",value:_}),k.push({type:"element",tagName:"a",properties:{href:"#"+l+"fnref-"+b+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(p,v),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const N=g[g.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const _=N.children[N.children.length-1];_&&_.type==="text"?_.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...k)}else g.push(...k);const E={type:"element",tagName:"li",properties:{id:l+"fn-"+b},children:t.wrap(g,!0)};t.patch(h,E),m.push(E)}if(m.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...cc(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 vc=(function(t){if(t==null)return r3;if(typeof t=="function")return wc(t);if(typeof t=="object")return Array.isArray(t)?n3(t):l3(t);if(typeof t=="string")return a3(t);throw new Error("Expected function, string, or object as test")});function n3(t){const l=[];let a=-1;for(;++a<t.length;)l[a]=vc(t[a]);return wc(i);function i(...o){let u=-1;for(;++u<l.length;)if(l[u].apply(this,o))return!0;return!1}}function l3(t){const l=t;return wc(a);function a(i){const o=i;let u;for(u in t)if(o[u]!==l[u])return!1;return!0}}function a3(t){return wc(l);function l(a){return a&&a.type===t}}function wc(t){return l;function l(a,i,o){return!!(i3(a)&&t.call(this,a,typeof i=="number"?i:void 0,o||void 0))}}function r3(){return!0}function i3(t){return t!==null&&typeof t=="object"&&"type"in t}const ry=[],s3=!0,Nd=!1,o3="skip";function iy(t,l,a,i){let o;typeof l=="function"&&typeof a!="function"?(i=a,a=l):o=l;const u=vc(o),f=i?-1:1;m(t,void 0,[])();function m(p,h,g){const y=p&&typeof p=="object"?p:{};if(typeof y.type=="string"){const v=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(p.type+(v?"<"+v+">":""))+")"})}return b;function b(){let v=ry,k,S,N;if((!l||u(p,h,g[g.length-1]||void 0))&&(v=c3(a(p,g)),v[0]===Nd))return v;if("children"in p&&p.children){const E=p;if(E.children&&v[0]!==o3)for(S=(i?E.children.length:-1)+f,N=g.concat(E);S>-1&&S<E.children.length;){const _=E.children[S];if(k=m(_,S,N)(),k[0]===Nd)return k;S=typeof k[1]=="number"?k[1]:S+f}}return v}}}function c3(t){return Array.isArray(t)?t:typeof t=="number"?[s3,t]:t==null?ry:[t]}function Pd(t,l,a,i){let o,u,f;typeof l=="function"&&typeof a!="function"?(u=void 0,f=l,o=a):(u=l,f=a,o=i),iy(t,u,m,o);function m(p,h){const g=h[h.length-1],y=g?g.children.indexOf(p):void 0;return f(p,y,g)}}const Ad={}.hasOwnProperty,u3={};function f3(t,l){const a=l||u3,i=new Map,o=new Map,u=new Map,f={...K5,...a.handlers},m={all:h,applyData:h3,definitionById:i,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:f,one:p,options:a,patch:d3,wrap:x3};return Pd(t,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const y=g.type==="definition"?i:o,b=String(g.identifier).toUpperCase();y.has(b)||y.set(b,g)}}),m;function p(g,y){const b=g.type,v=m.handlers[b];if(Ad.call(m.handlers,b)&&v)return v(m,g,y);if(m.options.passThrough&&m.options.passThrough.includes(b)){if("children"in g){const{children:S,...N}=g,E=cc(N);return E.children=m.all(g),E}return cc(g)}return(m.options.unknownHandler||m3)(m,g,y)}function h(g){const y=[];if("children"in g){const b=g.children;let v=-1;for(;++v<b.length;){const k=m.one(b[v],g);if(k){if(v&&b[v-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=D1(k.value)),!Array.isArray(k)&&k.type==="element")){const S=k.children[0];S&&S.type==="text"&&(S.value=D1(S.value))}Array.isArray(k)?y.push(...k):y.push(k)}}}return y}}function d3(t,l){t.position&&(l.position=ev(t))}function h3(t,l){let a=l;if(t&&t.data){const i=t.data.hName,o=t.data.hChildren,u=t.data.hProperties;if(typeof i=="string")if(a.type==="element")a.tagName=i;else{const f="children"in a?a.children:[a];a={type:"element",tagName:i,properties:{},children:f}}a.type==="element"&&u&&Object.assign(a.properties,cc(u)),"children"in a&&a.children&&o!==null&&o!==void 0&&(a.children=o)}return a}function m3(t,l){const a=l.data||{},i="value"in l&&!(Ad.call(a,"hProperties")||Ad.call(a,"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 x3(t,l){const a=[];let i=-1;for(l&&a.push({type:"text",value:`
60
+ `});++i<t.length;)i&&a.push({type:"text",value:`
61
+ `}),a.push(t[i]);return l&&t.length>0&&a.push({type:"text",value:`
62
+ `}),a}function D1(t){let l=0,a=t.charCodeAt(l);for(;a===9||a===32;)l++,a=t.charCodeAt(l);return t.slice(l)}function T1(t,l){const a=f3(t,l),i=a.one(t,void 0),o=t3(a),u=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
63
+ `},o),u}function p3(t,l){return t&&"run"in t?async function(a,i){const o=T1(a,{file:i,...l});await t.run(o,i)}:function(a,i){return T1(a,{file:i,...t||l})}}function z1(t){if(t)throw t}var Xf,M1;function y3(){if(M1)return Xf;M1=1;var t=Object.prototype.hasOwnProperty,l=Object.prototype.toString,a=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 g=t.call(h,"constructor"),y=h.constructor&&h.constructor.prototype&&t.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!y)return!1;var b;for(b in h);return typeof b>"u"||t.call(h,b)},f=function(h,g){a&&g.name==="__proto__"?a(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},m=function(h,g){if(g==="__proto__")if(t.call(h,g)){if(i)return i(h,g).value}else return;return h[g]};return Xf=function p(){var h,g,y,b,v,k,S=arguments[0],N=1,E=arguments.length,_=!1;for(typeof S=="boolean"&&(_=S,S=arguments[1]||{},N=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});N<E;++N)if(h=arguments[N],h!=null)for(g in h)y=m(S,g),b=m(h,g),S!==b&&(_&&b&&(u(b)||(v=o(b)))?(v?(v=!1,k=y&&o(y)?y:[]):k=y&&u(y)?y:{},f(S,{name:g,newValue:p(_,k,b)})):typeof b<"u"&&f(S,{name:g,newValue:b}));return S},Xf}var g3=y3();const Vf=E0(g3);function Dd(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 b3(){const t=[],l={run:a,use:i};return l;function a(...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(p,...h){const g=t[++u];let y=-1;if(p){f(p);return}for(;++y<o.length;)(h[y]===null||h[y]===void 0)&&(h[y]=o[y]);o=h,g?v3(g,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 v3(t,l){let a;return i;function i(...f){const m=t.length>f.length;let p;m&&f.push(o);try{p=t.apply(this,f)}catch(h){const g=h;if(m&&a)throw g;return o(g)}m||(p&&p.then&&typeof p.then=="function"?p.then(u,o):p instanceof Error?o(p):u(p))}function o(f,...m){a||(a=!0,l(f,...m))}function u(f){o(null,f)}}const pl={basename:w3,dirname:k3,extname:S3,join:j3,sep:"/"};function w3(t,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');Ss(t);let a=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){a=o+1;break}}else i<0&&(u=!0,i=o+1);return i<0?"":t.slice(a,i)}if(l===t)return"";let f=-1,m=l.length-1;for(;o--;)if(t.codePointAt(o)===47){if(u){a=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 a===i?i=f:i<0&&(i=t.length),t.slice(a,i)}function k3(t){if(Ss(t),t.length===0)return".";let l=-1,a=t.length,i;for(;--a;)if(t.codePointAt(a)===47){if(i){l=a;break}}else i||(i=!0);return l<0?t.codePointAt(0)===47?"/":".":l===1&&t.codePointAt(0)===47?"//":t.slice(0,l)}function S3(t){Ss(t);let l=t.length,a=-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}a<0&&(f=!0,a=l+1),m===46?o<0?o=l:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||a<0||u===0||u===1&&o===a-1&&o===i+1?"":t.slice(o,a)}function j3(...t){let l=-1,a;for(;++l<t.length;)Ss(t[l]),t[l]&&(a=a===void 0?t[l]:a+"/"+t[l]);return a===void 0?".":E3(a)}function E3(t){Ss(t);const l=t.codePointAt(0)===47;let a=C3(t,!l);return a.length===0&&!l&&(a="."),a.length>0&&t.codePointAt(t.length-1)===47&&(a+="/"),l?"/"+a:a}function C3(t,l){let a="",i=0,o=-1,u=0,f=-1,m,p;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(a.length<2||i!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(p=a.lastIndexOf("/"),p!==a.length-1){p<0?(a="",i=0):(a=a.slice(0,p),i=a.length-1-a.lastIndexOf("/")),o=f,u=0;continue}}else if(a.length>0){a="",i=0,o=f,u=0;continue}}l&&(a=a.length>0?a+"/..":"..",i=2)}else a.length>0?a+="/"+t.slice(o+1,f):a=t.slice(o+1,f),i=f-o-1;o=f,u=0}else m===46&&u>-1?u++:u=-1}return a}function Ss(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const N3={cwd:A3};function A3(){return"/"}function Td(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function D3(t){if(typeof t=="string")t=new URL(t);else if(!Td(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 T3(t)}function T3(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 a=-1;for(;++a<l.length;)if(l.codePointAt(a)===37&&l.codePointAt(a+1)===50){const i=l.codePointAt(a+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 Gf=["history","path","basename","stem","extname","dirname"];class sy{constructor(l){let a;l?Td(l)?a={path:l}:typeof l=="string"||z3(l)?a={value:l}:a=l:a={},this.cwd="cwd"in a?"":N3.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Gf.length;){const u=Gf[i];u in a&&a[u]!==void 0&&a[u]!==null&&(this[u]=u==="history"?[...a[u]]:a[u])}let o;for(o in a)Gf.includes(o)||(this[o]=a[o])}get basename(){return typeof this.path=="string"?pl.basename(this.path):void 0}set basename(l){Qf(l,"basename"),Kf(l,"basename"),this.path=pl.join(this.dirname||"",l)}get dirname(){return typeof this.path=="string"?pl.dirname(this.path):void 0}set dirname(l){_1(this.basename,"dirname"),this.path=pl.join(l||"",this.basename)}get extname(){return typeof this.path=="string"?pl.extname(this.path):void 0}set extname(l){if(Kf(l,"extname"),_1(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=pl.join(this.dirname,this.stem+(l||""))}get path(){return this.history[this.history.length-1]}set path(l){Td(l)&&(l=D3(l)),Qf(l,"path"),this.path!==l&&this.history.push(l)}get stem(){return typeof this.path=="string"?pl.basename(this.path,this.extname):void 0}set stem(l){Qf(l,"stem"),Kf(l,"stem"),this.path=pl.join(this.dirname||"",l+(this.extname||""))}fail(l,a,i){const o=this.message(l,a,i);throw o.fatal=!0,o}info(l,a,i){const o=this.message(l,a,i);return o.fatal=void 0,o}message(l,a,i){const o=new dn(l,a,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 Kf(t,l){if(t&&t.includes(pl.sep))throw new Error("`"+l+"` cannot be a path: did not expect `"+pl.sep+"`")}function Qf(t,l){if(!t)throw new Error("`"+l+"` cannot be empty")}function _1(t,l){if(!t)throw new Error("Setting `"+l+"` requires `path` to be set too")}function z3(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const M3=(function(t){const i=this.constructor.prototype,o=i[t],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,i),u}),_3={}.hasOwnProperty;class eh extends M3{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=b3()}copy(){const l=new eh;let a=-1;for(;++a<this.attachers.length;){const i=this.attachers[a];l.use(...i)}return l.data(Vf(!0,{},this.namespace)),l}data(l,a){return typeof l=="string"?arguments.length===2?(Jf("data",this.frozen),this.namespace[l]=a,this):_3.call(this.namespace,l)&&this.namespace[l]||void 0:l?(Jf("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[a,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const o=a.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 a=Xo(l),i=this.parser||this.Parser;return Zf("parse",i),i(String(a),a)}process(l,a){const i=this;return this.freeze(),Zf("process",this.parser||this.Parser),Wf("process",this.compiler||this.Compiler),a?o(void 0,a):new Promise(o);function o(u,f){const m=Xo(l),p=i.parse(m);i.run(p,m,function(g,y,b){if(g||!y||!b)return h(g);const v=y,k=i.stringify(v,b);O3(k)?b.value=k:b.result=k,h(g,b)});function h(g,y){g||!y?f(g):u?u(y):a(void 0,y)}}}processSync(l){let a=!1,i;return this.freeze(),Zf("processSync",this.parser||this.Parser),Wf("processSync",this.compiler||this.Compiler),this.process(l,o),R1("processSync","process",a),i;function o(u,f){a=!0,z1(u),i=f}}run(l,a,i){F1(l),this.freeze();const o=this.transformers;return!i&&typeof a=="function"&&(i=a,a=void 0),i?u(void 0,i):new Promise(u);function u(f,m){const p=Xo(a);o.run(l,p,h);function h(g,y,b){const v=y||l;g?m(g):f?f(v):i(void 0,v,b)}}}runSync(l,a){let i=!1,o;return this.run(l,a,u),R1("runSync","run",i),o;function u(f,m){z1(f),o=m,i=!0}}stringify(l,a){this.freeze();const i=Xo(a),o=this.compiler||this.Compiler;return Wf("stringify",o),F1(l),o(l,i)}use(l,...a){const i=this.attachers,o=this.namespace;if(Jf("use",this.frozen),l!=null)if(typeof l=="function")p(l,a);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")p(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...y]=h;p(g,y)}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=Vf(!0,o.settings,h.settings))}function m(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const y=h[g];u(y)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function p(h,g){let y=-1,b=-1;for(;++y<i.length;)if(i[y][0]===h){b=y;break}if(b===-1)i.push([h,...g]);else if(g.length>0){let[v,...k]=g;const S=i[b][1];Dd(S)&&Dd(v)&&(v=Vf(!0,S,v)),i[b]=[h,v,...k]}}}}const F3=new eh().freeze();function Zf(t,l){if(typeof l!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Wf(t,l){if(typeof l!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Jf(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 F1(t){if(!Dd(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function R1(t,l,a){if(!a)throw new Error("`"+t+"` finished async. Use `"+l+"` instead")}function Xo(t){return R3(t)?t:new sy(t)}function R3(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function O3(t){return typeof t=="string"||B3(t)}function B3(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const $3="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",O1=[],B1={allowDangerousHtml:!0},L3=/^(https?|ircs?|mailto|xmpp)$/i,H3=[{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 oy(t){const l=U3(t),a=Y3(t);return I3(l.runSync(l.parse(a),a),t)}function U3(t){const l=t.rehypePlugins||O1,a=t.remarkPlugins||O1,i=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...B1}:B1;return F3().use(k5).use(a).use(p3,i).use(l)}function Y3(t){const l=t.children||"",a=new sy;return typeof l=="string"&&(a.value=l),a}function I3(t,l){const a=l.allowedElements,i=l.allowElement,o=l.components,u=l.disallowedElements,f=l.skipHtml,m=l.unwrapDisallowed,p=l.urlTransform||q3;for(const g of H3)Object.hasOwn(l,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+$3+g.id,void 0);return Pd(t,h),rv(t,{Fragment:c.Fragment,components:o,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function h(g,y,b){if(g.type==="raw"&&b&&typeof y=="number")return f?b.children.splice(y,1):b.children[y]={type:"text",value:g.value},y;if(g.type==="element"){let v;for(v in Yf)if(Object.hasOwn(Yf,v)&&Object.hasOwn(g.properties,v)){const k=g.properties[v],S=Yf[v];(S===null||S.includes(g.tagName))&&(g.properties[v]=p(String(k||""),v,g))}}if(g.type==="element"){let v=a?!a.includes(g.tagName):u?u.includes(g.tagName):!1;if(!v&&i&&typeof y=="number"&&(v=!i(g,y,b)),v&&b&&typeof y=="number")return m&&g.children?b.children.splice(y,1,...g.children):b.children.splice(y,1),y}}}function q3(t){const l=t.indexOf(":"),a=t.indexOf("?"),i=t.indexOf("#"),o=t.indexOf("/");return l===-1||o!==-1&&l>o||a!==-1&&l>a||i!==-1&&l>i||L3.test(t.slice(0,l))?t:""}function $1(t,l){const a=String(t);if(typeof l!="string")throw new TypeError("Expected character");let i=0,o=a.indexOf(l);for(;o!==-1;)i++,o=a.indexOf(l,o+l.length);return i}function X3(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function V3(t,l,a){const o=vc((a||{}).ignore||[]),u=G3(l);let f=-1;for(;++f<u.length;)iy(t,"text",m);function m(h,g){let y=-1,b;for(;++y<g.length;){const v=g[y],k=b?b.children:void 0;if(o(v,k?k.indexOf(v):void 0,b))return;b=v}if(b)return p(h,g)}function p(h,g){const y=g[g.length-1],b=u[f][0],v=u[f][1];let k=0;const N=y.children.indexOf(h);let E=!1,_=[];b.lastIndex=0;let $=b.exec(h.value);for(;$;){const O=$.index,B={index:$.index,input:$.input,stack:[...g,h]};let M=v(...$,B);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?b.lastIndex=O+1:(k!==O&&_.push({type:"text",value:h.value.slice(k,O)}),Array.isArray(M)?_.push(...M):M&&_.push(M),k=O+$[0].length,E=!0),!b.global)break;$=b.exec(h.value)}return E?(k<h.value.length&&_.push({type:"text",value:h.value.slice(k)}),y.children.splice(N,1,..._)):_=[h],N+_.length}}function G3(t){const l=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!t[0]||Array.isArray(t[0])?t:[t];let i=-1;for(;++i<a.length;){const o=a[i];l.push([K3(o[0]),Q3(o[1])])}return l}function K3(t){return typeof t=="string"?new RegExp(X3(t),"g"):t}function Q3(t){return typeof t=="function"?t:function(){return t}}const Pf="phrasing",ed=["autolink","link","image","label"];function Z3(){return{transforms:[lk],enter:{literalAutolink:J3,literalAutolinkEmail:td,literalAutolinkHttp:td,literalAutolinkWww:td},exit:{literalAutolink:nk,literalAutolinkEmail:tk,literalAutolinkHttp:P3,literalAutolinkWww:ek}}}function W3(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Pf,notInConstruct:ed},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Pf,notInConstruct:ed},{character:":",before:"[ps]",after:"\\/",inConstruct:Pf,notInConstruct:ed}]}}function J3(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function td(t){this.config.enter.autolinkProtocol.call(this,t)}function P3(t){this.config.exit.autolinkProtocol.call(this,t)}function ek(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 tk(t){this.config.exit.autolinkEmail.call(this,t)}function nk(t){this.exit(t)}function lk(t){V3(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ak],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),rk]],{ignore:["link","linkReference"]})}function ak(t,l,a,i,o){let u="";if(!cy(o)||(/^w/i.test(l)&&(a=l+a,l="",u="http://"),!ik(a)))return!1;const f=sk(a+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 rk(t,l,a,i){return!cy(i,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+l+"@"+a,children:[{type:"text",value:l+"@"+a}]}}function ik(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 sk(t){const l=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!l)return[t,void 0];t=t.slice(0,l.index);let a=l[0],i=a.indexOf(")");const o=$1(t,"(");let u=$1(t,")");for(;i!==-1&&o>u;)t+=a.slice(0,i+1),a=a.slice(i+1),i=a.indexOf(")"),u++;return[t,a]}function cy(t,l){const a=t.input.charCodeAt(t.index-1);return(t.index===0||er(a)||yc(a))&&(!l||a!==47)}uy.peek=pk;function ok(){this.buffer()}function ck(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function uk(){this.buffer()}function fk(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function dk(t){const l=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=sl(this.sliceSerialize(t)).toLowerCase(),a.label=l}function hk(t){this.exit(t)}function mk(t){const l=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=sl(this.sliceSerialize(t)).toLowerCase(),a.label=l}function xk(t){this.exit(t)}function pk(){return"["}function uy(t,l,a,i){const o=a.createTracker(i);let u=o.move("[^");const f=a.enter("footnoteReference"),m=a.enter("reference");return u+=o.move(a.safe(a.associationId(t),{after:"]",before:u})),m(),f(),u+=o.move("]"),u}function yk(){return{enter:{gfmFootnoteCallString:ok,gfmFootnoteCall:ck,gfmFootnoteDefinitionLabelString:uk,gfmFootnoteDefinition:fk},exit:{gfmFootnoteCallString:dk,gfmFootnoteCall:hk,gfmFootnoteDefinitionLabelString:mk,gfmFootnoteDefinition:xk}}}function gk(t){let l=!1;return t&&t.firstLineBlank&&(l=!0),{handlers:{footnoteDefinition:a,footnoteReference:uy},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(i,o,u,f){const m=u.createTracker(f);let p=m.move("[^");const h=u.enter("footnoteDefinition"),g=u.enter("label");return p+=m.move(u.safe(u.associationId(i),{before:p,after:"]"})),g(),p+=m.move("]:"),i.children&&i.children.length>0&&(m.shift(4),p+=m.move((l?`
64
+ `:" ")+u.indentLines(u.containerFlow(i,m.current()),l?fy:bk))),h(),p}}function bk(t,l,a){return l===0?t:fy(t,l,a)}function fy(t,l,a){return(a?"":" ")+t}const vk=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];dy.peek=Ek;function wk(){return{canContainEols:["delete"],enter:{strikethrough:Sk},exit:{strikethrough:jk}}}function kk(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:vk}],handlers:{delete:dy}}}function Sk(t){this.enter({type:"delete",children:[]},t)}function jk(t){this.exit(t)}function dy(t,l,a,i){const o=a.createTracker(i),u=a.enter("strikethrough");let f=o.move("~~");return f+=a.containerPhrasing(t,{...o.current(),before:f,after:"~"}),f+=o.move("~~"),u(),f}function Ek(){return"~"}function Ck(t){return t.length}function Nk(t,l){const a=l||{},i=(a.align||[]).concat(),o=a.stringLength||Ck,u=[],f=[],m=[],p=[];let h=0,g=-1;for(;++g<t.length;){const S=[],N=[];let E=-1;for(t[g].length>h&&(h=t[g].length);++E<t[g].length;){const _=Ak(t[g][E]);if(a.alignDelimiters!==!1){const $=o(_);N[E]=$,(p[E]===void 0||$>p[E])&&(p[E]=$)}S.push(_)}f[g]=S,m[g]=N}let y=-1;if(typeof i=="object"&&"length"in i)for(;++y<h;)u[y]=L1(i[y]);else{const S=L1(i);for(;++y<h;)u[y]=S}y=-1;const b=[],v=[];for(;++y<h;){const S=u[y];let N="",E="";S===99?(N=":",E=":"):S===108?N=":":S===114&&(E=":");let _=a.alignDelimiters===!1?1:Math.max(1,p[y]-N.length-E.length);const $=N+"-".repeat(_)+E;a.alignDelimiters!==!1&&(_=N.length+_+E.length,_>p[y]&&(p[y]=_),v[y]=_),b[y]=$}f.splice(1,0,b),m.splice(1,0,v),g=-1;const k=[];for(;++g<f.length;){const S=f[g],N=m[g];y=-1;const E=[];for(;++y<h;){const _=S[y]||"";let $="",O="";if(a.alignDelimiters!==!1){const B=p[y]-(N[y]||0),M=u[y];M===114?$=" ".repeat(B):M===99?B%2?($=" ".repeat(B/2+.5),O=" ".repeat(B/2-.5)):($=" ".repeat(B/2),O=$):O=" ".repeat(B)}a.delimiterStart!==!1&&!y&&E.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&_==="")&&(a.delimiterStart!==!1||y)&&E.push(" "),a.alignDelimiters!==!1&&E.push($),E.push(_),a.alignDelimiters!==!1&&E.push(O),a.padding!==!1&&E.push(" "),(a.delimiterEnd!==!1||y!==h-1)&&E.push("|")}k.push(a.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return k.join(`
65
+ `)}function Ak(t){return t==null?"":String(t)}function L1(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 Dk(t,l,a,i){const o=a.enter("blockquote"),u=a.createTracker(i);u.move("> "),u.shift(2);const f=a.indentLines(a.containerFlow(t,u.current()),Tk);return o(),f}function Tk(t,l,a){return">"+(a?"":" ")+t}function zk(t,l){return H1(t,l.inConstruct,!0)&&!H1(t,l.notInConstruct,!1)}function H1(t,l,a){if(typeof l=="string"&&(l=[l]),!l||l.length===0)return a;let i=-1;for(;++i<l.length;)if(t.includes(l[i]))return!0;return!1}function U1(t,l,a,i){let o=-1;for(;++o<a.unsafe.length;)if(a.unsafe[o].character===`
66
+ `&&zk(a.stack,a.unsafe[o]))return/[ \t]/.test(i.before)?"":" ";return`\\
67
+ `}function Mk(t,l){const a=String(t);let i=a.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=a.indexOf(l,o);return f}function _k(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 Fk(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 Rk(t,l,a,i){const o=Fk(a),u=t.value||"",f=o==="`"?"GraveAccent":"Tilde";if(_k(t,a)){const y=a.enter("codeIndented"),b=a.indentLines(u,Ok);return y(),b}const m=a.createTracker(i),p=o.repeat(Math.max(Mk(u,o)+1,3)),h=a.enter("codeFenced");let g=m.move(p);if(t.lang){const y=a.enter(`codeFencedLang${f}`);g+=m.move(a.safe(t.lang,{before:g,after:" ",encode:["`"],...m.current()})),y()}if(t.lang&&t.meta){const y=a.enter(`codeFencedMeta${f}`);g+=m.move(" "),g+=m.move(a.safe(t.meta,{before:g,after:`
68
+ `,encode:["`"],...m.current()})),y()}return g+=m.move(`
69
+ `),u&&(g+=m.move(u+`
70
+ `)),g+=m.move(p),h(),g}function Ok(t,l,a){return(a?"":" ")+t}function th(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 Bk(t,l,a,i){const o=th(a),u=o==='"'?"Quote":"Apostrophe",f=a.enter("definition");let m=a.enter("label");const p=a.createTracker(i);let h=p.move("[");return h+=p.move(a.safe(a.associationId(t),{before:h,after:"]",...p.current()})),h+=p.move("]: "),m(),!t.url||/[\0- \u007F]/.test(t.url)?(m=a.enter("destinationLiteral"),h+=p.move("<"),h+=p.move(a.safe(t.url,{before:h,after:">",...p.current()})),h+=p.move(">")):(m=a.enter("destinationRaw"),h+=p.move(a.safe(t.url,{before:h,after:t.title?" ":`
71
+ `,...p.current()}))),m(),t.title&&(m=a.enter(`title${u}`),h+=p.move(" "+o),h+=p.move(a.safe(t.title,{before:h,after:o,...p.current()})),h+=p.move(o),m()),f(),h}function $k(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 ps(t){return"&#x"+t.toString(16).toUpperCase()+";"}function uc(t,l,a){const i=Qr(t),o=Qr(l);return i===void 0?o===void 0?a==="_"?{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}}hy.peek=Lk;function hy(t,l,a,i){const o=$k(a),u=a.enter("emphasis"),f=a.createTracker(i),m=f.move(o);let p=f.move(a.containerPhrasing(t,{after:o,before:m,...f.current()}));const h=p.charCodeAt(0),g=uc(i.before.charCodeAt(i.before.length-1),h,o);g.inside&&(p=ps(h)+p.slice(1));const y=p.charCodeAt(p.length-1),b=uc(i.after.charCodeAt(0),y,o);b.inside&&(p=p.slice(0,-1)+ps(y));const v=f.move(o);return u(),a.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},m+p+v}function Lk(t,l,a){return a.options.emphasis||"*"}function Hk(t,l){let a=!1;return Pd(t,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return a=!0,Nd}),!!((!t.depth||t.depth<3)&&Vd(t)&&(l.options.setext||a))}function Uk(t,l,a,i){const o=Math.max(Math.min(6,t.depth||1),1),u=a.createTracker(i);if(Hk(t,a)){const g=a.enter("headingSetext"),y=a.enter("phrasing"),b=a.containerPhrasing(t,{...u.current(),before:`
72
+ `,after:`
73
+ `});return y(),g(),b+`
74
+ `+(o===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
75
+ `))+1))}const f="#".repeat(o),m=a.enter("headingAtx"),p=a.enter("phrasing");u.move(f+" ");let h=a.containerPhrasing(t,{before:"# ",after:`
76
+ `,...u.current()});return/^[\t ]/.test(h)&&(h=ps(h.charCodeAt(0))+h.slice(1)),h=h?f+" "+h:f,a.options.closeAtx&&(h+=" "+f),p(),m(),h}my.peek=Yk;function my(t){return t.value||""}function Yk(){return"<"}xy.peek=Ik;function xy(t,l,a,i){const o=th(a),u=o==='"'?"Quote":"Apostrophe",f=a.enter("image");let m=a.enter("label");const p=a.createTracker(i);let h=p.move("![");return h+=p.move(a.safe(t.alt,{before:h,after:"]",...p.current()})),h+=p.move("]("),m(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(m=a.enter("destinationLiteral"),h+=p.move("<"),h+=p.move(a.safe(t.url,{before:h,after:">",...p.current()})),h+=p.move(">")):(m=a.enter("destinationRaw"),h+=p.move(a.safe(t.url,{before:h,after:t.title?" ":")",...p.current()}))),m(),t.title&&(m=a.enter(`title${u}`),h+=p.move(" "+o),h+=p.move(a.safe(t.title,{before:h,after:o,...p.current()})),h+=p.move(o),m()),h+=p.move(")"),f(),h}function Ik(){return"!"}py.peek=qk;function py(t,l,a,i){const o=t.referenceType,u=a.enter("imageReference");let f=a.enter("label");const m=a.createTracker(i);let p=m.move("![");const h=a.safe(t.alt,{before:p,after:"]",...m.current()});p+=m.move(h+"]["),f();const g=a.stack;a.stack=[],f=a.enter("reference");const y=a.safe(a.associationId(t),{before:p,after:"]",...m.current()});return f(),a.stack=g,u(),o==="full"||!h||h!==y?p+=m.move(y+"]"):o==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function qk(){return"!"}yy.peek=Xk;function yy(t,l,a){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<a.unsafe.length;){const f=a.unsafe[u],m=a.compilePattern(f);let p;if(f.atBreak)for(;p=m.exec(i);){let h=p.index;i.charCodeAt(h)===10&&i.charCodeAt(h-1)===13&&h--,i=i.slice(0,h)+" "+i.slice(p.index+1)}}return o+i+o}function Xk(){return"`"}function gy(t,l){const a=Vd(t);return!!(!l.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(a===t.url||"mailto:"+a===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}by.peek=Vk;function by(t,l,a,i){const o=th(a),u=o==='"'?"Quote":"Apostrophe",f=a.createTracker(i);let m,p;if(gy(t,a)){const g=a.stack;a.stack=[],m=a.enter("autolink");let y=f.move("<");return y+=f.move(a.containerPhrasing(t,{before:y,after:">",...f.current()})),y+=f.move(">"),m(),a.stack=g,y}m=a.enter("link"),p=a.enter("label");let h=f.move("[");return h+=f.move(a.containerPhrasing(t,{before:h,after:"](",...f.current()})),h+=f.move("]("),p(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(p=a.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(a.safe(t.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(p=a.enter("destinationRaw"),h+=f.move(a.safe(t.url,{before:h,after:t.title?" ":")",...f.current()}))),p(),t.title&&(p=a.enter(`title${u}`),h+=f.move(" "+o),h+=f.move(a.safe(t.title,{before:h,after:o,...f.current()})),h+=f.move(o),p()),h+=f.move(")"),m(),h}function Vk(t,l,a){return gy(t,a)?"<":"["}vy.peek=Gk;function vy(t,l,a,i){const o=t.referenceType,u=a.enter("linkReference");let f=a.enter("label");const m=a.createTracker(i);let p=m.move("[");const h=a.containerPhrasing(t,{before:p,after:"]",...m.current()});p+=m.move(h+"]["),f();const g=a.stack;a.stack=[],f=a.enter("reference");const y=a.safe(a.associationId(t),{before:p,after:"]",...m.current()});return f(),a.stack=g,u(),o==="full"||!h||h!==y?p+=m.move(y+"]"):o==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function Gk(){return"["}function nh(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 Kk(t){const l=nh(t),a=t.options.bulletOther;if(!a)return l==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===l)throw new Error("Expected `bullet` (`"+l+"`) and `bulletOther` (`"+a+"`) to be different");return a}function Qk(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 wy(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 Zk(t,l,a,i){const o=a.enter("list"),u=a.bulletCurrent;let f=t.ordered?Qk(a):nh(a);const m=t.ordered?f==="."?")":".":Kk(a);let p=l&&a.bulletLastUsed?f===a.bulletLastUsed:!1;if(!t.ordered){const g=t.children?t.children[0]:void 0;if((f==="*"||f==="-")&&g&&(!g.children||!g.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(p=!0),wy(a)===f&&g){let y=-1;for(;++y<t.children.length;){const b=t.children[y];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(f=m),a.bulletCurrent=f;const h=a.containerFlow(t,i);return a.bulletLastUsed=f,a.bulletCurrent=u,o(),h}function Wk(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 Jk(t,l,a,i){const o=Wk(a);let u=a.bulletCurrent||nh(a);l&&l.type==="list"&&l.ordered&&(u=(typeof l.start=="number"&&l.start>-1?l.start:1)+(a.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=a.createTracker(i);m.move(u+" ".repeat(f-u.length)),m.shift(f);const p=a.enter("listItem"),h=a.indentLines(a.containerFlow(t,m.current()),g);return p(),h;function g(y,b,v){return b?(v?"":" ".repeat(f))+y:(v?u:u+" ".repeat(f-u.length))+y}}function Pk(t,l,a,i){const o=a.enter("paragraph"),u=a.enter("phrasing"),f=a.containerPhrasing(t,i);return u(),o(),f}const e4=vc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function t4(t,l,a,i){return(t.children.some(function(f){return e4(f)})?a.containerPhrasing:a.containerFlow).call(a,t,i)}function n4(t){const l=t.options.strong||"*";if(l!=="*"&&l!=="_")throw new Error("Cannot serialize strong with `"+l+"` for `options.strong`, expected `*`, or `_`");return l}ky.peek=l4;function ky(t,l,a,i){const o=n4(a),u=a.enter("strong"),f=a.createTracker(i),m=f.move(o+o);let p=f.move(a.containerPhrasing(t,{after:o,before:m,...f.current()}));const h=p.charCodeAt(0),g=uc(i.before.charCodeAt(i.before.length-1),h,o);g.inside&&(p=ps(h)+p.slice(1));const y=p.charCodeAt(p.length-1),b=uc(i.after.charCodeAt(0),y,o);b.inside&&(p=p.slice(0,-1)+ps(y));const v=f.move(o+o);return u(),a.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},m+p+v}function l4(t,l,a){return a.options.strong||"*"}function a4(t,l,a,i){return a.safe(t.value,i)}function r4(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 i4(t,l,a){const i=(wy(a)+(a.options.ruleSpaces?" ":"")).repeat(r4(a));return a.options.ruleSpaces?i.slice(0,-1):i}const Sy={blockquote:Dk,break:U1,code:Rk,definition:Bk,emphasis:hy,hardBreak:U1,heading:Uk,html:my,image:xy,imageReference:py,inlineCode:yy,link:by,linkReference:vy,list:Zk,listItem:Jk,paragraph:Pk,root:t4,strong:ky,text:a4,thematicBreak:i4};function s4(){return{enter:{table:o4,tableData:Y1,tableHeader:Y1,tableRow:u4},exit:{codeText:f4,table:c4,tableData:nd,tableHeader:nd,tableRow:nd}}}function o4(t){const l=t._align;this.enter({type:"table",align:l.map(function(a){return a==="none"?null:a}),children:[]},t),this.data.inTable=!0}function c4(t){this.exit(t),this.data.inTable=void 0}function u4(t){this.enter({type:"tableRow",children:[]},t)}function nd(t){this.exit(t)}function Y1(t){this.enter({type:"tableCell",children:[]},t)}function f4(t){let l=this.resume();this.data.inTable&&(l=l.replace(/\\([\\|])/g,d4));const a=this.stack[this.stack.length-1];a.type,a.value=l,this.exit(t)}function d4(t,l){return l==="|"?l:t}function h4(t){const l=t||{},a=l.tableCellPadding,i=l.tablePipeAlign,o=l.stringLength,u=a?" ":"|";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:b,table:f,tableCell:p,tableRow:m}};function f(v,k,S,N){return h(g(v,S,N),v.align)}function m(v,k,S,N){const E=y(v,S,N),_=h([E]);return _.slice(0,_.indexOf(`
78
+ `))}function p(v,k,S,N){const E=S.enter("tableCell"),_=S.enter("phrasing"),$=S.containerPhrasing(v,{...N,before:u,after:u});return _(),E(),$}function h(v,k){return Nk(v,{align:k,alignDelimiters:i,padding:a,stringLength:o})}function g(v,k,S){const N=v.children;let E=-1;const _=[],$=k.enter("table");for(;++E<N.length;)_[E]=y(N[E],k,S);return $(),_}function y(v,k,S){const N=v.children;let E=-1;const _=[],$=k.enter("tableRow");for(;++E<N.length;)_[E]=p(N[E],v,k,S);return $(),_}function b(v,k,S){let N=Sy.inlineCode(v,k,S);return S.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function m4(){return{exit:{taskListCheckValueChecked:I1,taskListCheckValueUnchecked:I1,paragraph:p4}}}function x4(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:y4}}}function I1(t){const l=this.stack[this.stack.length-2];l.type,l.checked=t.type==="taskListCheckValueChecked"}function p4(t){const l=this.stack[this.stack.length-2];if(l&&l.type==="listItem"&&typeof l.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const i=a.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===a&&(i.value=i.value.slice(1),i.value.length===0?a.children.shift():a.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,a.position.start=Object.assign({},i.position.start)))}}this.exit(t)}function y4(t,l,a,i){const o=t.children[0],u=typeof t.checked=="boolean"&&o&&o.type==="paragraph",f="["+(t.checked?"x":" ")+"] ",m=a.createTracker(i);u&&m.move(f);let p=Sy.listItem(t,l,a,{...i,...m.current()});return u&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),p;function h(g){return g+f}}function g4(){return[Z3(),yk(),wk(),s4(),m4()]}function b4(t){return{extensions:[W3(),gk(t),kk(),h4(t),x4()]}}const v4={tokenize:C4,partial:!0},jy={tokenize:N4,partial:!0},Ey={tokenize:A4,partial:!0},Cy={tokenize:D4,partial:!0},w4={tokenize:T4,partial:!0},Ny={name:"wwwAutolink",tokenize:j4,previous:Dy},Ay={name:"protocolAutolink",tokenize:E4,previous:Ty},Vl={name:"emailAutolink",tokenize:S4,previous:zy},wl={};function k4(){return{text:wl}}let Ga=48;for(;Ga<123;)wl[Ga]=Vl,Ga++,Ga===58?Ga=65:Ga===91&&(Ga=97);wl[43]=Vl;wl[45]=Vl;wl[46]=Vl;wl[95]=Vl;wl[72]=[Vl,Ay];wl[104]=[Vl,Ay];wl[87]=[Vl,Ny];wl[119]=[Vl,Ny];function S4(t,l,a){const i=this;let o,u;return f;function f(y){return!zd(y)||!zy.call(i,i.previous)||lh(i.events)?a(y):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),m(y))}function m(y){return zd(y)?(t.consume(y),m):y===64?(t.consume(y),p):a(y)}function p(y){return y===46?t.check(w4,g,h)(y):y===45||y===95||fn(y)?(u=!0,t.consume(y),p):g(y)}function h(y){return t.consume(y),o=!0,p}function g(y){return u&&o&&xn(i.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),l(y)):a(y)}}function j4(t,l,a){const i=this;return o;function o(f){return f!==87&&f!==119||!Dy.call(i,i.previous)||lh(i.events)?a(f):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(v4,t.attempt(jy,t.attempt(Ey,u),a),a)(f))}function u(f){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),l(f)}}function E4(t,l,a){const i=this;let o="",u=!1;return f;function f(y){return(y===72||y===104)&&Ty.call(i,i.previous)&&!lh(i.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),o+=String.fromCodePoint(y),t.consume(y),m):a(y)}function m(y){if(xn(y)&&o.length<5)return o+=String.fromCodePoint(y),t.consume(y),m;if(y===58){const b=o.toLowerCase();if(b==="http"||b==="https")return t.consume(y),p}return a(y)}function p(y){return y===47?(t.consume(y),u?h:(u=!0,p)):a(y)}function h(y){return y===null||sc(y)||Et(y)||er(y)||yc(y)?a(y):t.attempt(jy,t.attempt(Ey,g),a)(y)}function g(y){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),l(y)}}function C4(t,l,a){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):a(f)}function u(f){return f===null?a(f):l(f)}}function N4(t,l,a){let i,o,u;return f;function f(h){return h===46||h===95?t.check(Cy,p,m)(h):h===null||Et(h)||er(h)||h!==45&&yc(h)?p(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 p(h){return o||i||!u?a(h):l(h)}}function A4(t,l){let a=0,i=0;return o;function o(f){return f===40?(a++,t.consume(f),o):f===41&&i<a?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(Cy,l,u)(f):f===null||Et(f)||er(f)?l(f):(t.consume(f),o)}function u(f){return f===41&&i++,t.consume(f),o}}function D4(t,l,a){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||Et(m)||er(m)?l(m):a(m)}function o(m){return m===null||m===40||m===91||Et(m)||er(m)?l(m):i(m)}function u(m){return xn(m)?f(m):a(m)}function f(m){return m===59?(t.consume(m),i):xn(m)?(t.consume(m),f):a(m)}}function T4(t,l,a){return i;function i(u){return t.consume(u),o}function o(u){return fn(u)?a(u):l(u)}}function Dy(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Et(t)}function Ty(t){return!xn(t)}function zy(t){return!(t===47||zd(t))}function zd(t){return t===43||t===45||t===46||t===95||fn(t)}function lh(t){let l=t.length,a=!1;for(;l--;){const i=t[l][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){a=!0;break}if(i._gfmAutolinkLiteralWalkedInto){a=!1;break}}return t.length>0&&!a&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const z4={tokenize:L4,partial:!0};function M4(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:O4,continuation:{tokenize:B4},exit:$4}},text:{91:{name:"gfmFootnoteCall",tokenize:R4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:_4,resolveTo:F4}}}}function _4(t,l,a){const i=this;let o=i.events.length;const u=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let f;for(;o--;){const p=i.events[o][1];if(p.type==="labelImage"){f=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return m;function m(p){if(!f||!f._balanced)return a(p);const h=sl(i.sliceSerialize({start:f.end,end:i.now()}));return h.codePointAt(0)!==94||!u.includes(h.slice(1))?a(p):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(p),t.exit("gfmFootnoteCallLabelMarker"),l(p))}}function F4(t,l){let a=t.length;for(;a--;)if(t[a][1].type==="labelImage"&&t[a][0]==="enter"){t[a][1];break}t[a+1][1].type="data",t[a+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},t[a+3][1].start),end:Object.assign({},t[t.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},t[a+3][1].end),end:Object.assign({},t[a+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[a+1],t[a+2],["enter",i,l],t[a+3],t[a+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(a,t.length-a+1,...m),t}function R4(t,l,a){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u=0,f;return m;function m(y){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(y),t.exit("gfmFootnoteCallLabelMarker"),p}function p(y){return y!==94?a(y):(t.enter("gfmFootnoteCallMarker"),t.consume(y),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",h)}function h(y){if(u>999||y===93&&!f||y===null||y===91||Et(y))return a(y);if(y===93){t.exit("chunkString");const b=t.exit("gfmFootnoteCallString");return o.includes(sl(i.sliceSerialize(b)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(y),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),l):a(y)}return Et(y)||(f=!0),u++,t.consume(y),y===92?g:h}function g(y){return y===91||y===92||y===93?(t.consume(y),u++,h):h(y)}}function O4(t,l,a){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u,f=0,m;return p;function p(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",g):a(k)}function g(k){if(f>999||k===93&&!m||k===null||k===91||Et(k))return a(k);if(k===93){t.exit("chunkString");const S=t.exit("gfmFootnoteDefinitionLabelString");return u=sl(i.sliceSerialize(S)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(k),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),b}return Et(k)||(m=!0),f++,t.consume(k),k===92?y:g}function y(k){return k===91||k===92||k===93?(t.consume(k),f++,g):g(k)}function b(k){return k===58?(t.enter("definitionMarker"),t.consume(k),t.exit("definitionMarker"),o.includes(u)||o.push(u),at(t,v,"gfmFootnoteDefinitionWhitespace")):a(k)}function v(k){return l(k)}}function B4(t,l,a){return t.check(ks,l,t.attempt(z4,l,a))}function $4(t){t.exit("gfmFootnoteDefinition")}function L4(t,l,a){const i=this;return at(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):a(u)}}function H4(t){let a=(t||{}).singleTilde;const i={name:"strikethrough",tokenize:u,resolveAll:o};return a==null&&(a=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function o(f,m){let p=-1;for(;++p<f.length;)if(f[p][0]==="enter"&&f[p][1].type==="strikethroughSequenceTemporary"&&f[p][1]._close){let h=p;for(;h--;)if(f[h][0]==="exit"&&f[h][1].type==="strikethroughSequenceTemporary"&&f[h][1]._open&&f[p][1].end.offset-f[p][1].start.offset===f[h][1].end.offset-f[h][1].start.offset){f[p][1].type="strikethroughSequence",f[h][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},f[h][1].start),end:Object.assign({},f[p][1].end)},y={type:"strikethroughText",start:Object.assign({},f[h][1].end),end:Object.assign({},f[p][1].start)},b=[["enter",g,m],["enter",f[h][1],m],["exit",f[h][1],m],["enter",y,m]],v=m.parser.constructs.insideSpan.null;v&&$n(b,b.length,0,gc(v,f.slice(h+1,p),m)),$n(b,b.length,0,[["exit",y,m],["enter",f[p][1],m],["exit",f[p][1],m],["exit",g,m]]),$n(f,h-1,p-h+3,b),p=h+b.length-2;break}}for(p=-1;++p<f.length;)f[p][1].type==="strikethroughSequenceTemporary"&&(f[p][1].type="data");return f}function u(f,m,p){const h=this.previous,g=this.events;let y=0;return b;function b(k){return h===126&&g[g.length-1][1].type!=="characterEscape"?p(k):(f.enter("strikethroughSequenceTemporary"),v(k))}function v(k){const S=Qr(h);if(k===126)return y>1?p(k):(f.consume(k),y++,v);if(y<2&&!a)return p(k);const N=f.exit("strikethroughSequenceTemporary"),E=Qr(k);return N._open=!E||E===2&&!!S,N._close=!S||S===2&&!!E,m(k)}}}class U4{constructor(){this.map=[]}add(l,a,i){Y4(this,l,a,i)}consume(l){if(this.map.sort(function(u,f){return u[0]-f[0]}),this.map.length===0)return;let a=this.map.length;const i=[];for(;a>0;)a-=1,i.push(l.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),l.length=this.map[a][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 Y4(t,l,a,i){let o=0;if(!(a===0&&i.length===0)){for(;o<t.map.length;){if(t.map[o][0]===l){t.map[o][1]+=a,t.map[o][2].push(...i);return}o+=1}t.map.push([l,a,i])}}function I4(t,l){let a=!1;const i=[];for(;l<t.length;){const o=t[l];if(a){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"&&(a=!0);l+=1}return i}function q4(){return{flow:{null:{name:"table",tokenize:X4,resolveAll:V4}}}}function X4(t,l,a){const i=this;let o=0,u=0,f;return m;function m(z){let U=i.events.length-1;for(;U>-1;){const ne=i.events[U][1].type;if(ne==="lineEnding"||ne==="linePrefix")U--;else break}const L=U>-1?i.events[U][1].type:null,ee=L==="tableHead"||L==="tableRow"?M:p;return ee===M&&i.parser.lazy[i.now().line]?a(z):ee(z)}function p(z){return t.enter("tableHead"),t.enter("tableRow"),h(z)}function h(z){return z===124||(f=!0,u+=1),g(z)}function g(z){return z===null?a(z):_e(z)?u>1?(u=0,i.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(z),t.exit("lineEnding"),v):a(z):We(z)?at(t,g,"whitespace")(z):(u+=1,f&&(f=!1,o+=1),z===124?(t.enter("tableCellDivider"),t.consume(z),t.exit("tableCellDivider"),f=!0,g):(t.enter("data"),y(z)))}function y(z){return z===null||z===124||Et(z)?(t.exit("data"),g(z)):(t.consume(z),z===92?b:y)}function b(z){return z===92||z===124?(t.consume(z),y):y(z)}function v(z){return i.interrupt=!1,i.parser.lazy[i.now().line]?a(z):(t.enter("tableDelimiterRow"),f=!1,We(z)?at(t,k,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):k(z))}function k(z){return z===45||z===58?N(z):z===124?(f=!0,t.enter("tableCellDivider"),t.consume(z),t.exit("tableCellDivider"),S):B(z)}function S(z){return We(z)?at(t,N,"whitespace")(z):N(z)}function N(z){return z===58?(u+=1,f=!0,t.enter("tableDelimiterMarker"),t.consume(z),t.exit("tableDelimiterMarker"),E):z===45?(u+=1,E(z)):z===null||_e(z)?O(z):B(z)}function E(z){return z===45?(t.enter("tableDelimiterFiller"),_(z)):B(z)}function _(z){return z===45?(t.consume(z),_):z===58?(f=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(z),t.exit("tableDelimiterMarker"),$):(t.exit("tableDelimiterFiller"),$(z))}function $(z){return We(z)?at(t,O,"whitespace")(z):O(z)}function O(z){return z===124?k(z):z===null||_e(z)?!f||o!==u?B(z):(t.exit("tableDelimiterRow"),t.exit("tableHead"),l(z)):B(z)}function B(z){return a(z)}function M(z){return t.enter("tableRow"),q(z)}function q(z){return z===124?(t.enter("tableCellDivider"),t.consume(z),t.exit("tableCellDivider"),q):z===null||_e(z)?(t.exit("tableRow"),l(z)):We(z)?at(t,q,"whitespace")(z):(t.enter("data"),G(z))}function G(z){return z===null||z===124||Et(z)?(t.exit("data"),q(z)):(t.consume(z),z===92?P:G)}function P(z){return z===92||z===124?(t.consume(z),G):G(z)}}function V4(t,l){let a=-1,i=!0,o=0,u=[0,0,0,0],f=[0,0,0,0],m=!1,p=0,h,g,y;const b=new U4;for(;++a<t.length;){const v=t[a],k=v[1];v[0]==="enter"?k.type==="tableHead"?(m=!1,p!==0&&(q1(b,l,p,h,g),g=void 0,p=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(a,0,[["enter",h,l]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(i=!0,y=void 0,u=[0,0,0,0],f=[0,a+1,0,0],m&&(m=!1,g={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(a,0,[["enter",g,l]])),o=k.type==="tableDelimiterRow"?2:g?3:1):o&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(i=!1,f[2]===0&&(u[1]!==0&&(f[0]=f[1],y=Vo(b,l,u,o,void 0,y),u=[0,0,0,0]),f[2]=a)):k.type==="tableCellDivider"&&(i?i=!1:(u[1]!==0&&(f[0]=f[1],y=Vo(b,l,u,o,void 0,y)),u=f,f=[u[1],a,0,0])):k.type==="tableHead"?(m=!0,p=a):k.type==="tableRow"||k.type==="tableDelimiterRow"?(p=a,u[1]!==0?(f[0]=f[1],y=Vo(b,l,u,o,a,y)):f[1]!==0&&(y=Vo(b,l,f,o,a,y)),o=0):o&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(f[3]=a)}for(p!==0&&q1(b,l,p,h,g),b.consume(l.events),a=-1;++a<l.events.length;){const v=l.events[a];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=I4(l.events,a))}return t}function Vo(t,l,a,i,o,u){const f=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",m="tableContent";a[0]!==0&&(u.end=Object.assign({},Ir(l.events,a[0])),t.add(a[0],0,[["exit",u,l]]));const p=Ir(l.events,a[1]);if(u={type:f,start:Object.assign({},p),end:Object.assign({},p)},t.add(a[1],0,[["enter",u,l]]),a[2]!==0){const h=Ir(l.events,a[2]),g=Ir(l.events,a[3]),y={type:m,start:Object.assign({},h),end:Object.assign({},g)};if(t.add(a[2],0,[["enter",y,l]]),i!==2){const b=l.events[a[2]],v=l.events[a[3]];if(b[1].end=Object.assign({},v[1].end),b[1].type="chunkText",b[1].contentType="text",a[3]>a[2]+1){const k=a[2]+1,S=a[3]-a[2]-1;t.add(k,S,[])}}t.add(a[3]+1,0,[["exit",y,l]])}return o!==void 0&&(u.end=Object.assign({},Ir(l.events,o)),t.add(o,0,[["exit",u,l]]),u=void 0),u}function q1(t,l,a,i,o){const u=[],f=Ir(l.events,a);o&&(o.end=Object.assign({},f),u.push(["exit",o,l])),i.end=Object.assign({},f),u.push(["exit",i,l]),t.add(a+1,0,u)}function Ir(t,l){const a=t[l],i=a[0]==="enter"?"start":"end";return a[1][i]}const G4={name:"tasklistCheck",tokenize:Q4};function K4(){return{text:{91:G4}}}function Q4(t,l,a){const i=this;return o;function o(p){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?a(p):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(p),t.exit("taskListCheckMarker"),u)}function u(p){return Et(p)?(t.enter("taskListCheckValueUnchecked"),t.consume(p),t.exit("taskListCheckValueUnchecked"),f):p===88||p===120?(t.enter("taskListCheckValueChecked"),t.consume(p),t.exit("taskListCheckValueChecked"),f):a(p)}function f(p){return p===93?(t.enter("taskListCheckMarker"),t.consume(p),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),m):a(p)}function m(p){return _e(p)?l(p):We(p)?t.check({tokenize:Z4},l,a)(p):a(p)}}function Z4(t,l,a){return at(t,i,"whitespace");function i(o){return o===null?a(o):l(o)}}function W4(t){return U0([k4(),M4(),H4(t),q4(),K4()])}const J4={};function My(t){const l=this,a=t||J4,i=l.data(),o=i.micromarkExtensions||(i.micromarkExtensions=[]),u=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),f=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);o.push(W4(a)),u.push(g4()),f.push(b4(a))}function js({content:t,className:l=""}){return c.jsx("div",{className:`office-markdown ${l}`,children:c.jsx(oy,{remarkPlugins:[My],components:{code:P4,table:({children:a})=>c.jsx("div",{className:"overflow-x-auto my-2",children:c.jsx("table",{className:"office-table",children:a})})},children:t})})}function P4({className:t,children:l,...a}){const i=/language-(\w+)/.exec(t??"");return i||typeof l=="string"&&l.includes(`
79
+ `)?c.jsx(eS,{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",...a,children:l})}function eS({children:t,language:l}){const[a,i]=j.useState(!1),o=String(t).replace(/\n$/,""),u=()=>{navigator.clipboard.writeText(o),i(!0),setTimeout(()=>i(!1),1500)};return c.jsxs("div",{className:"office-code-block group relative my-2",children:[l&&c.jsx("div",{className:"text-[10px] text-gray-400 px-3 pt-1.5",children:l}),c.jsx("button",{onClick:u,className:"absolute top-1.5 right-2 text-[10px] text-gray-400 hover:text-gray-600 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",children:a?"Copied!":"Copy"}),c.jsx("pre",{className:"overflow-x-auto p-3 text-xs leading-relaxed",children:c.jsx("code",{children:o})})]})}const X1={$skin:"skinColor",$hair:"hairColor",$shirt:"shirtColor",$pants:"pantsColor",$shoes:"shoeColor"},tS=/^(darken|lighten)\((\$\w+),\s*(\d+)\)$/;function nS(t,l){const a=parseInt(t.replace("#",""),16),i=Math.max(0,(a>>16&255)-l),o=Math.max(0,(a>>8&255)-l),u=Math.max(0,(a&255)-l);return`#${(i<<16|o<<8|u).toString(16).padStart(6,"0")}`}function lS(t,l){const a=parseInt(t.replace("#",""),16),i=Math.min(255,(a>>16&255)+l),o=Math.min(255,(a>>8&255)+l),u=Math.min(255,(a&255)+l);return`#${(i<<16|o<<8|u).toString(16).padStart(6,"0")}`}function _y(t,l){const a=X1[t];if(a&&l)return l[a];const i=tS.exec(t);if(i){const[,o,u,f]=i,m=X1[u],p=m&&l?l[m]:u,h=parseInt(f,10);return o==="darken"?nS(p,h):lS(p,h)}return t}function V1(t,l=12){return t.map(a=>({...a,x:l-a.x-a.w}))}function aS(t,l){return l==="down"?t.down:l==="up"&&t.up?t.up:l==="left"&&t.left?t.left:l==="right"&&t.right?t.right:l==="right"&&t.left?{name:t.left.name,pixels:V1(t.left.pixels)}:l==="left"&&t.right?{name:t.right.name,pixels:V1(t.right.pixels)}:t.down}function rS(t,l){return Md(t,"hair",l,1)}function Md(t,l,a,i){const o=t.layers.findIndex(f=>f.name===l),u=[...t.layers];if(o>=0)u[o]={...a,name:l};else{const f=i??u.length;u.splice(f,0,{...a,name:l})}return{...t,layers:u}}const ah=new Map,rh=new Map;function Fy(t,l){ah.set(t,l)}function kc(t,l){rh.set(t,l)}function _d(t){return ah.get(t)}function iS(t){return rh.get(t)}function HC(){return Array.from(ah.keys())}function UC(){return Array.from(rh.keys())}function sS(t,l,a,i,o=2){t.clearRect(0,0,l.width*o,l.height*o);for(const u of l.layers)Ry(t,u.pixels,o,a,i)}function Fd(t,l,a,i,o){for(const u of l){const f=_y(u.c,o);u.a!==void 0&&u.a!==1&&(t.globalAlpha=u.a),t.fillStyle=f,t.fillRect(a+u.x,i+u.y,u.w,u.h),u.a!==void 0&&u.a!==1&&(t.globalAlpha=1)}}function oS(t,l){const a=l.scale;t.clearRect(0,0,l.canvasWidth,l.canvasHeight),Ry(t,l.pixels,a,0)}function Ry(t,l,a,i,o){for(const u of l){const f=_y(u.c,o);u.a!==void 0&&u.a!==1&&(t.globalAlpha=u.a),t.fillStyle=f,t.fillRect(u.x*a,(u.y+i)*a,u.w*a,u.h*a),u.a!==void 0&&u.a!==1&&(t.globalAlpha=1)}}const fc=new Map;function Na(t,l,a){if("down"in a&&!("pixels"in a)){const o=a;fc.set(t,{id:t,name:l,layer:{...o.down,name:"hair"},directions:{down:{...o.down,name:"hair"},up:o.up?{...o.up,name:"hair"}:void 0,left:o.left?{...o.left,name:"hair"}:void 0,right:o.right?{...o.right,name:"hair"}:void 0}})}else{const o=a;fc.set(t,{id:t,name:l,layer:{...o,name:"hair"}})}}function cS(t){return fc.get(t)}function Oy(){return Array.from(fc.values())}Na("short","Short",{down:{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}]},up:{name:"hair",pixels:[{x:1,y:0,w:10,h:3,c:"$hair"},{x:0,y:1,w:2,h:2,c:"$hair"},{x:10,y:1,w:2,h:2,c:"$hair"}]},left:{name:"hair",pixels:[{x:1,y:0,w:9,h:2,c:"$hair"},{x:0,y:1,w:2,h:2,c:"$hair"},{x:2,y:0,w:6,h:1,c:"lighten($hair, 25)",a:.3}]}});Na("messy","Messy",{down:{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}]},up:{name:"hair",pixels:[{x:1,y:0,w:10,h:4,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:"$hair"}]},left:{name:"hair",pixels:[{x:1,y:0,w:9,h:3,c:"$hair"},{x:0,y:1,w:2,h:3,c:"$hair"},{x:3,y:-1,w:3,h:2,c:"$hair"},{x:2,y:0,w:4,h:1,c:"lighten($hair, 30)",a:.3}]}});Na("bun","Bun",{down:{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}]},up:{name:"hair",pixels:[{x:1,y:0,w:10,h:3,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}]},left:{name:"hair",pixels:[{x:1,y:0,w:9,h:2,c:"$hair"},{x:0,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}]}});Na("long","Long",{down:{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}]},up:{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:2,w:10,h:6,c:"$hair"},{x:2,y:6,w:8,h:2,c:"darken($hair, 10)",a:.3}]},left:{name:"hair",pixels:[{x:0,y:0,w:10,h:3,c:"$hair"},{x:-1,y:1,w:2,h:7,c:"$hair"},{x:-1,y:6,w:2,h:3,c:"darken($hair, 15)",a:.5},{x:2,y:0,w:6,h:1,c:"lighten($hair, 25)",a:.3}]}});Na("mohawk","Mohawk",{down:{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"}]},up:{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"}]},left:{name:"hair",pixels:[{x:4,y:-2,w:3,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"}]}});Na("slicked","Slicked Back",{down:{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}]},up:{name:"hair",pixels:[{x:1,y:0,w:10,h:3,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}]},left:{name:"hair",pixels:[{x:1,y:0,w:9,h:2,c:"$hair"},{x:0,y:1,w:2,h:2,c:"$hair"},{x:2,y:0,w:6,h:1,c:"lighten($hair, 15)",a:.4}]}});Na("bob","Bob Cut",{down:{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}]},up:{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:2,w:10,h:4,c:"$hair"},{x:2,y:5,w:8,h:1,c:"darken($hair, 10)",a:.3}]},left:{name:"hair",pixels:[{x:0,y:0,w:10,h:3,c:"$hair"},{x:-1,y:1,w:2,h:5,c:"$hair"},{x:-1,y:5,w:2,h:1,c:"darken($hair, 15)",a:.4},{x:2,y:0,w:6,h:1,c:"lighten($hair, 25)",a:.3}]}});Na("curly","Curly",{down:{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}]},up:{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:1,y:2,w:10,h:4,c:"$hair"},{x:3,y:1,w:2,h:1,c:"lighten($hair, 15)",a:.3},{x:7,y:1,w:2,h:1,c:"lighten($hair, 15)",a:.3}]},left:{name:"hair",pixels:[{x:0,y:0,w:10,h:4,c:"$hair"},{x:-1,y:1,w:2,h:5,c:"$hair"},{x:2,y:0,w:2,h:1,c:"lighten($hair, 25)",a:.4},{x:5,y:0,w:2,h:1,c:"lighten($hair, 25)",a:.4},{x:3,y:2,w:2,h:1,c:"lighten($hair, 15)",a:.3}]}});const dc=new Map;function kl(t,l,a){if("down"in a&&!("pixels"in a)){const o=a;dc.set(t,{id:t,name:l,layer:{...o.down,name:"torso"},directions:{down:{...o.down,name:"torso"},up:o.up?{...o.up,name:"torso"}:void 0,left:o.left?{...o.left,name:"torso"}:void 0,right:o.right?{...o.right,name:"torso"}:void 0}})}else{const o=a;dc.set(t,{id:t,name:l,layer:{...o,name:"torso"}})}}function uS(t){return dc.get(t)}function By(){return Array.from(dc.values())}kl("tshirt","T-Shirt",{down:{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"}]},up:{name:"torso",pixels:[{x:1,y:10,w:10,h:6,c:"$shirt"},{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:3,c:"darken($shirt, 10)",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"}]},left:{name:"torso",pixels:[{x:1,y:10,w:9,h:6,c:"$shirt"},{x:2,y:10,w:7,h:1,c:"lighten($shirt, 18)",a:.3},{x:1,y:10,w:1,h:5,c:"darken($shirt, 25)",a:.25},{x:-1,y:11,w:3,h:5,c:"$shirt"},{x:-1,y:15,w:3,h:1,c:"$skin"}]}});kl("suit","Suit",{down:{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"}]},up:{name:"torso",pixels:[{x:1,y:10,w:10,h:6,c:"$shirt"},{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:5,y:12,w:2,h:4,c:"darken($shirt, 10)",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"}]},left:{name:"torso",pixels:[{x:1,y:10,w:9,h:6,c:"$shirt"},{x:1,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:-1,y:11,w:3,h:5,c:"$shirt"},{x:-1,y:11,w:3,h:1,c:"darken($shirt, 20)",a:.2},{x:-1,y:15,w:3,h:1,c:"$skin"}]}});kl("hoodie","Hoodie",{down:{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"}]},up:{name:"torso",pixels:[{x:0,y:10,w:12,h:6,c:"$shirt"},{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:7,w:8,h:3,c:"$shirt",a:.5},{x:3,y:7,w:6,h:1,c:"darken($shirt, 10)",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"}]},left:{name:"torso",pixels:[{x:0,y:10,w:10,h:6,c:"$shirt"},{x:1,y:10,w:8,h:1,c:"lighten($shirt, 15)",a:.25},{x:0,y:10,w:1,h:5,c:"darken($shirt, 25)",a:.3},{x:2,y:8,w:6,h:2,c:"$shirt",a:.4},{x:-1,y:11,w:3,h:5,c:"$shirt"},{x:-1,y:15,w:3,h:1,c:"$skin"}]}});kl("vest","Vest",{down:{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)"}]},up:{name:"torso",pixels:[{x:1,y:10,w:10,h:6,c:"$shirt"},{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:"$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)"}]},left:{name:"torso",pixels:[{x:1,y:10,w:9,h:6,c:"$shirt"},{x:1,y:10,w:1,h:5,c:"darken($shirt, 25)",a:.25},{x:-1,y:11,w:3,h:5,c:"$skin"},{x:-1,y:15,w:3,h:1,c:"darken($skin, 10)"}]}});kl("tank","Tank Top",{down:{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)"}]},up:{name:"torso",pixels:[{x:2,y:10,w:8,h:6,c:"$shirt"},{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)"}]},left:{name:"torso",pixels:[{x:2,y:10,w:7,h:6,c:"$shirt"},{x:2,y:10,w:1,h:5,c:"darken($shirt, 25)",a:.25},{x:0,y:10,w:2,h:2,c:"$skin"},{x:-1,y:11,w:3,h:5,c:"$skin"},{x:-1,y:15,w:3,h:1,c:"darken($skin, 10)"}]}});kl("polo","Polo",{down:{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"}]},up:{name:"torso",pixels:[{x:1,y:10,w:10,h:6,c:"$shirt"},{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:1,c:"lighten($shirt, 25)",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:15,w:2,h:1,c:"$skin"},{x:11,y:15,w:2,h:1,c:"$skin"}]},left:{name:"torso",pixels:[{x:1,y:10,w:9,h:6,c:"$shirt"},{x:1,y:10,w:1,h:5,c:"darken($shirt, 25)",a:.25},{x:3,y:9,w:4,h:2,c:"lighten($shirt, 25)",a:.5},{x:-1,y:11,w:3,h:5,c:"$shirt"},{x:-1,y:15,w:3,h:1,c:"$skin"}]}});kl("labcoat","Lab Coat",{down:{name:"torso",pixels:[{x:4,y:10,w:4,h:5,c:"$shirt"},{x:0,y:10,w:4,h:7,c:"#F0F0F0"},{x:8,y:10,w:4,h:7,c:"#F0F0F0"},{x:1,y:10,w:10,h:1,c:"#FAFAFA"},{x:0,y:10,w:1,h:7,c:"#DDD",a:.5},{x:11,y:10,w:1,h:7,c:"#DDD",a:.5},{x:1,y:13,w:2,h:2,c:"#E0E0E0",a:.4},{x:9,y:13,w:2,h:2,c:"#E0E0E0",a:.4},{x:-1,y:11,w:2,h:5,c:"#F0F0F0"},{x:11,y:11,w:2,h:5,c:"#F0F0F0"},{x:-1,y:15,w:2,h:1,c:"$skin"},{x:11,y:15,w:2,h:1,c:"$skin"}]},up:{name:"torso",pixels:[{x:0,y:10,w:12,h:7,c:"#F0F0F0"},{x:0,y:10,w:1,h:7,c:"#DDD",a:.5},{x:11,y:10,w:1,h:7,c:"#DDD",a:.5},{x:5,y:11,w:2,h:5,c:"#E8E8E8",a:.3},{x:-1,y:11,w:2,h:5,c:"#F0F0F0"},{x:11,y:11,w:2,h:5,c:"#F0F0F0"},{x:-1,y:15,w:2,h:1,c:"$skin"},{x:11,y:15,w:2,h:1,c:"$skin"}]},left:{name:"torso",pixels:[{x:3,y:10,w:3,h:5,c:"$shirt"},{x:0,y:10,w:3,h:7,c:"#F0F0F0"},{x:6,y:10,w:4,h:7,c:"#F0F0F0"},{x:1,y:10,w:8,h:1,c:"#FAFAFA"},{x:0,y:10,w:1,h:7,c:"#DDD",a:.5},{x:1,y:13,w:2,h:2,c:"#E0E0E0",a:.4},{x:-1,y:11,w:3,h:5,c:"#F0F0F0"},{x:-1,y:15,w:3,h:1,c:"$skin"}]}});kl("overalls","Overalls",{down:{name:"torso",pixels:[{x:1,y:10,w:10,h:3,c:"$shirt"},{x:2,y:10,w:8,h:1,c:"lighten($shirt, 18)",a:.3},{x:3,y:11,w:6,h:5,c:"#3D6B99"},{x:3,y:10,w:2,h:1,c:"#3D6B99"},{x:7,y:10,w:2,h:1,c:"#3D6B99"},{x:3,y:11,w:1,h:1,c:"#FFD700",a:.6},{x:8,y:11,w:1,h:1,c:"#FFD700",a:.6},{x:1,y:13,w:2,h:3,c:"#3D6B99"},{x:9,y:13,w:2,h:3,c:"#3D6B99"},{x:5,y:13,w:2,h:2,c:"#345E87",a:.4},{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"}]},up:{name:"torso",pixels:[{x:1,y:10,w:10,h:3,c:"$shirt"},{x:3,y:10,w:2,h:1,c:"#3D6B99"},{x:7,y:10,w:2,h:1,c:"#3D6B99"},{x:1,y:13,w:10,h:3,c:"#3D6B99"},{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"}]},left:{name:"torso",pixels:[{x:1,y:10,w:9,h:3,c:"$shirt"},{x:3,y:11,w:5,h:5,c:"#3D6B99"},{x:3,y:10,w:2,h:1,c:"#3D6B99"},{x:3,y:11,w:1,h:1,c:"#FFD700",a:.6},{x:1,y:13,w:2,h:3,c:"#3D6B99"},{x:-1,y:11,w:3,h:5,c:"$shirt"},{x:-1,y:15,w:3,h:1,c:"$skin"}]}});kl("turtleneck","Turtleneck",{down:{name:"torso",pixels:[{x:1,y:10,w:10,h:6,c:"$shirt"},{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:8,w:6,h:2,c:"$shirt"},{x:4,y:8,w:4,h:1,c:"lighten($shirt, 12)",a:.3},{x:3,y:9,w:1,h:1,c:"darken($shirt, 15)",a:.2},{x:8,y:9,w:1,h:1,c:"darken($shirt, 15)",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"}]},up:{name:"torso",pixels:[{x:1,y:10,w:10,h:6,c:"$shirt"},{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:8,w:6,h:2,c:"$shirt"},{x:4,y:8,w:4,h:1,c:"lighten($shirt, 12)",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"}]},left:{name:"torso",pixels:[{x:1,y:10,w:9,h:6,c:"$shirt"},{x:1,y:10,w:1,h:5,c:"darken($shirt, 25)",a:.25},{x:3,y:8,w:4,h:2,c:"$shirt"},{x:3,y:8,w:3,h:1,c:"lighten($shirt, 12)",a:.3},{x:-1,y:11,w:3,h:5,c:"$shirt"},{x:-1,y:15,w:3,h:1,c:"$skin"}]}});kl("robe","Robe",{down:{name:"torso",pixels:[{x:0,y:10,w:12,h:7,c:"$shirt"},{x:0,y:10,w:1,h:6,c:"darken($shirt, 25)",a:.3},{x:11,y:10,w:1,h:6,c:"darken($shirt, 25)",a:.3},{x:3,y:10,w:3,h:4,c:"lighten($shirt, 15)",a:.25},{x:6,y:10,w:3,h:4,c:"darken($shirt, 10)",a:.2},{x:1,y:14,w:10,h:1,c:"darken($shirt, 35)"},{x:2,y:14,w:8,h:1,c:"darken($shirt, 25)",a:.4},{x:-2,y:11,w:3,h:5,c:"$shirt"},{x:11,y:11,w:3,h:5,c:"$shirt"},{x:-2,y:15,w:3,h:1,c:"darken($shirt, 15)",a:.3},{x:11,y:15,w:3,h:1,c:"darken($shirt, 15)",a:.3},{x:-1,y:15,w:2,h:1,c:"$skin"},{x:11,y:15,w:2,h:1,c:"$skin"}]},up:{name:"torso",pixels:[{x:0,y:10,w:12,h:7,c:"$shirt"},{x:0,y:10,w:1,h:6,c:"darken($shirt, 25)",a:.3},{x:11,y:10,w:1,h:6,c:"darken($shirt, 25)",a:.3},{x:1,y:14,w:10,h:1,c:"darken($shirt, 35)"},{x:-2,y:11,w:3,h:5,c:"$shirt"},{x:11,y:11,w:3,h:5,c:"$shirt"},{x:-2,y:15,w:3,h:1,c:"darken($shirt, 15)",a:.3},{x:11,y:15,w:3,h:1,c:"darken($shirt, 15)",a:.3},{x:-1,y:15,w:2,h:1,c:"$skin"},{x:11,y:15,w:2,h:1,c:"$skin"}]},left:{name:"torso",pixels:[{x:0,y:10,w:10,h:7,c:"$shirt"},{x:0,y:10,w:1,h:6,c:"darken($shirt, 25)",a:.3},{x:1,y:14,w:8,h:1,c:"darken($shirt, 35)"},{x:-2,y:11,w:4,h:5,c:"$shirt"},{x:-2,y:15,w:4,h:1,c:"darken($shirt, 15)",a:.3},{x:-1,y:15,w:2,h:1,c:"$skin"}]}});const ys=new Map;function dt(t,l,a){if("down"in a&&!("pixels"in a)){const o=a;ys.set(t,{id:t,name:l,layer:{...o.down,name:"accessory"},directions:{down:{...o.down,name:"accessory"},up:o.up?{...o.up,name:"accessory"}:void 0,left:o.left?{...o.left,name:"accessory"}:void 0,right:o.right?{...o.right,name:"accessory"}:void 0}})}else{const o=a;ys.set(t,{id:t,name:l,layer:{...o,name:"accessory"}})}}function fS(t){return ys.get(t)}function dS(t,l){const a=ys.get(t);if(!a)return;if(a.directions)return aS(a.directions,l);if(l==="down")return a.layer;const i=a.layer.pixels.filter(u=>u.y<2);if(i.length===0)return;const o=l==="right"?1:l==="left"?-1:0;return{name:a.layer.name,pixels:o?i.map(u=>({...u,x:u.x+o})):i}}function $y(){return Array.from(ys.values())}dt("none","None",{name:"accessory",pixels:[]});dt("glasses","Glasses",{down:{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}]},up:{name:"accessory",pixels:[{x:0,y:3,w:2,h:1,c:"#2A3A50",a:.4},{x:10,y:3,w:2,h:1,c:"#2A3A50",a:.4}]},left:{name:"accessory",pixels:[{x:2,y:4,w:3,h:2,c:"#2A3A50",a:.5},{x:5,y:4,w:6,h:1,c:"#2A3A50",a:.3}]}});dt("round-glasses","Round Glasses",{down:{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}]},up:{name:"accessory",pixels:[{x:0,y:3,w:2,h:1,c:"#8B7355",a:.3},{x:10,y:3,w:2,h:1,c:"#8B7355",a:.3}]},left:{name:"accessory",pixels:[{x:2,y:3,w:3,h:3,c:"#8B7355",a:.4},{x:3,y:4,w:1,h:1,c:"#B0E0FF",a:.15},{x:5,y:4,w:6,h:1,c:"#8B7355",a:.25}]}});dt("sunglasses","Sunglasses",{down:{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}]},up:{name:"accessory",pixels:[{x:0,y:3,w:2,h:1,c:"#1A1A2E",a:.4},{x:10,y:3,w:2,h:1,c:"#1A1A2E",a:.4}]},left:{name:"accessory",pixels:[{x:2,y:4,w:3,h:2,c:"#1A1A2E",a:.7},{x:3,y:4,w:1,h:1,c:"#334",a:.3},{x:5,y:4,w:6,h:1,c:"#1A1A2E",a:.35}]}});dt("headphones","Headphones",{down:{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}]},up:{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}]},left:{name:"accessory",pixels:[{x:1,y:0,w:10,h:1,c:"#333",a:.7},{x:-1,y:1,w:3,h:5,c:"#444"},{x:-1,y:2,w:3,h:3,c:"#555",a:.3}]}});dt("beret","Beret",{down:{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}]},up:{name:"accessory",pixels:[{x:2,y:-1,w:8,h:2,c:"#E91E63"},{x:9,y:0,w:2,h:1,c:"#E91E63",a:.6}]},left:{name:"accessory",pixels:[{x:0,y:-1,w:8,h:2,c:"#E91E63"},{x:2,y:-1,w:4,h:1,c:"#F06292",a:.3}]}});dt("cap","Cap",{down:{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}]},up:{name:"accessory",pixels:[{x:1,y:-1,w:10,h:2,c:"#1565C0"},{x:3,y:-1,w:6,h:1,c:"#1E88E5",a:.3},{x:5,y:1,w:2,h:1,c:"#0D47A1",a:.5}]},left:{name:"accessory",pixels:[{x:0,y:-1,w:9,h:2,c:"#1565C0"},{x:-2,y:1,w:6,h:1,c:"#0D47A1"},{x:2,y:-1,w:5,h:1,c:"#1E88E5",a:.3}]}});dt("badge","Badge",{down:{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}]},up:{name:"accessory",pixels:[]},left:{name:"accessory",pixels:[{x:3,y:8,w:1,h:3,c:"#2196F3",a:.4},{x:2,y:11,w:3,h:3,c:"#FFF",a:.5}]}});dt("lapels","Lapels",{down:{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}]},up:{name:"accessory",pixels:[]},left:{name:"accessory",pixels:[{x:1,y:10,w:3,h:2,c:"#1A1A2E",a:.4}]}});dt("blush","Blush",{down:{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}]},up:{name:"accessory",pixels:[]},left:{name:"accessory",pixels:[{x:2,y:6,w:1,h:1,c:"#FFCDD2",a:.3}]}});dt("scarf","Scarf",{down:{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}]},up:{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}]},left:{name:"accessory",pixels:[{x:1,y:9,w:8,h:2,c:"#E53935",a:.6},{x:2,y:9,w:5,h:1,c:"#EF5350",a:.3},{x:1,y:11,w:2,h:3,c:"#E53935",a:.5}]}});dt("tie","Tie",{down:{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}]},up:{name:"accessory",pixels:[]},left:{name:"accessory",pixels:[{x:4,y:9,w:2,h:1,c:"#B71C1C"},{x:4,y:10,w:2,h:4,c:"#D32F2F"},{x:4,y:14,w:2,h:1,c:"#B71C1C",a:.8}]}});dt("bowtie","Bowtie",{down:{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}]},up:{name:"accessory",pixels:[]},left:{name:"accessory",pixels:[{x:3,y:9,w:3,h:1,c:"#D32F2F"},{x:4,y:9,w:1,h:1,c:"#B71C1C"}]}});dt("cat-ears","Cat Ears",{down:{name:"accessory",pixels:[{x:1,y:-3,w:2,h:1,c:"#555"},{x:0,y:-2,w:3,h:1,c:"#555"},{x:0,y:-1,w:3,h:1,c:"#555"},{x:1,y:-2,w:1,h:1,c:"#FFB0C0",a:.6},{x:9,y:-3,w:2,h:1,c:"#555"},{x:9,y:-2,w:3,h:1,c:"#555"},{x:9,y:-1,w:3,h:1,c:"#555"},{x:10,y:-2,w:1,h:1,c:"#FFB0C0",a:.6}]},up:{name:"accessory",pixels:[{x:1,y:-3,w:2,h:1,c:"#555"},{x:0,y:-2,w:3,h:1,c:"#555"},{x:0,y:-1,w:3,h:1,c:"#555"},{x:9,y:-3,w:2,h:1,c:"#555"},{x:9,y:-2,w:3,h:1,c:"#555"},{x:9,y:-1,w:3,h:1,c:"#555"}]},left:{name:"accessory",pixels:[{x:2,y:-3,w:2,h:1,c:"#555"},{x:1,y:-2,w:3,h:1,c:"#555"},{x:1,y:-1,w:3,h:1,c:"#555"},{x:2,y:-2,w:1,h:1,c:"#FFB0C0",a:.6}]}});dt("bear-ears","Bear Ears",{down:{name:"accessory",pixels:[{x:0,y:-2,w:3,h:2,c:"#8B6914"},{x:1,y:-1,w:1,h:1,c:"#C4A24A",a:.5},{x:9,y:-2,w:3,h:2,c:"#8B6914"},{x:10,y:-1,w:1,h:1,c:"#C4A24A",a:.5}]},up:{name:"accessory",pixels:[{x:0,y:-2,w:3,h:2,c:"#8B6914"},{x:9,y:-2,w:3,h:2,c:"#8B6914"}]},left:{name:"accessory",pixels:[{x:1,y:-2,w:3,h:2,c:"#8B6914"},{x:2,y:-1,w:1,h:1,c:"#C4A24A",a:.5}]}});dt("bunny-ears","Bunny Ears",{down:{name:"accessory",pixels:[{x:2,y:-5,w:2,h:4,c:"#F5F5F5"},{x:2,y:-4,w:1,h:2,c:"#FFB0C0",a:.5},{x:8,y:-5,w:2,h:4,c:"#F5F5F5"},{x:9,y:-4,w:1,h:2,c:"#FFB0C0",a:.5},{x:9,y:-6,w:2,h:1,c:"#F5F5F5"}]},up:{name:"accessory",pixels:[{x:2,y:-5,w:2,h:4,c:"#F5F5F5"},{x:8,y:-5,w:2,h:4,c:"#F5F5F5"},{x:9,y:-6,w:2,h:1,c:"#F5F5F5"}]},left:{name:"accessory",pixels:[{x:3,y:-5,w:2,h:4,c:"#F5F5F5"},{x:3,y:-4,w:1,h:2,c:"#FFB0C0",a:.5},{x:4,y:-6,w:2,h:1,c:"#F5F5F5"}]}});dt("dog-nose","Dog Nose",{down:{name:"accessory",pixels:[{x:4,y:5,w:4,h:3,c:"#D2B48C",a:.5},{x:5,y:5,w:2,h:1,c:"#222"},{x:6,y:7,w:1,h:1,c:"#FF6B8A",a:.7}]},up:{name:"accessory",pixels:[]},left:{name:"accessory",pixels:[{x:0,y:5,w:4,h:2,c:"#D2B48C",a:.5},{x:0,y:5,w:2,h:1,c:"#222"},{x:1,y:7,w:1,h:1,c:"#FF6B8A",a:.7}]}});dt("fox-mask","Fox Mask",{down:{name:"accessory",pixels:[{x:0,y:-3,w:2,h:1,c:"#E65100"},{x:-1,y:-2,w:3,h:1,c:"#E65100"},{x:0,y:-1,w:3,h:1,c:"#E65100"},{x:10,y:-3,w:2,h:1,c:"#E65100"},{x:10,y:-2,w:3,h:1,c:"#E65100"},{x:9,y:-1,w:3,h:1,c:"#E65100"},{x:0,y:-2,w:1,h:1,c:"#FFF",a:.4},{x:11,y:-2,w:1,h:1,c:"#FFF",a:.4},{x:1,y:5,w:2,h:2,c:"#FFF",a:.25},{x:9,y:5,w:2,h:2,c:"#FFF",a:.25},{x:5,y:6,w:2,h:1,c:"#222",a:.6}]},up:{name:"accessory",pixels:[{x:0,y:-3,w:2,h:1,c:"#E65100"},{x:-1,y:-2,w:3,h:1,c:"#E65100"},{x:0,y:-1,w:3,h:1,c:"#E65100"},{x:10,y:-3,w:2,h:1,c:"#E65100"},{x:10,y:-2,w:3,h:1,c:"#E65100"},{x:9,y:-1,w:3,h:1,c:"#E65100"}]},left:{name:"accessory",pixels:[{x:1,y:-3,w:2,h:1,c:"#E65100"},{x:0,y:-2,w:3,h:1,c:"#E65100"},{x:1,y:-1,w:3,h:1,c:"#E65100"},{x:1,y:-2,w:1,h:1,c:"#FFF",a:.4},{x:1,y:5,w:2,h:2,c:"#FFF",a:.25},{x:1,y:6,w:2,h:1,c:"#222",a:.6}]}});dt("crown","Crown",{down:{name:"accessory",pixels:[{x:2,y:-1,w:8,h:2,c:"#FFD700"},{x:3,y:-3,w:2,h:2,c:"#FFD700"},{x:5,y:-2,w:2,h:1,c:"#FFD700"},{x:7,y:-3,w:2,h:2,c:"#FFD700"},{x:4,y:-2,w:1,h:1,c:"#E53935",a:.8},{x:6,y:-1,w:1,h:1,c:"#42A5F5",a:.8},{x:8,y:-2,w:1,h:1,c:"#66BB6A",a:.8},{x:3,y:-1,w:6,h:1,c:"#FFF",a:.15}]},up:{name:"accessory",pixels:[{x:2,y:-1,w:8,h:2,c:"#FFD700"},{x:3,y:-3,w:2,h:2,c:"#FFD700"},{x:5,y:-2,w:2,h:1,c:"#FFD700"},{x:7,y:-3,w:2,h:2,c:"#FFD700"},{x:3,y:-1,w:6,h:1,c:"#FFF",a:.15}]},left:{name:"accessory",pixels:[{x:1,y:-1,w:7,h:2,c:"#FFD700"},{x:2,y:-3,w:2,h:2,c:"#FFD700"},{x:5,y:-2,w:2,h:1,c:"#FFD700"},{x:3,y:-2,w:1,h:1,c:"#E53935",a:.8},{x:5,y:-1,w:1,h:1,c:"#42A5F5",a:.8},{x:2,y:-1,w:5,h:1,c:"#FFF",a:.15}]}});dt("halo","Halo",{down:{name:"accessory",pixels:[{x:2,y:-3,w:8,h:1,c:"#FFE082",a:.7},{x:1,y:-2,w:1,h:1,c:"#FFE082",a:.5},{x:10,y:-2,w:1,h:1,c:"#FFE082",a:.5},{x:3,y:-4,w:6,h:1,c:"#FFF9C4",a:.4},{x:3,y:-3,w:6,h:1,c:"#FFF",a:.15}]},up:{name:"accessory",pixels:[{x:2,y:-3,w:8,h:1,c:"#FFE082",a:.7},{x:1,y:-2,w:1,h:1,c:"#FFE082",a:.5},{x:10,y:-2,w:1,h:1,c:"#FFE082",a:.5},{x:3,y:-4,w:6,h:1,c:"#FFF9C4",a:.4},{x:3,y:-3,w:6,h:1,c:"#FFF",a:.15}]},left:{name:"accessory",pixels:[{x:1,y:-3,w:7,h:1,c:"#FFE082",a:.7},{x:0,y:-2,w:1,h:1,c:"#FFE082",a:.5},{x:8,y:-2,w:1,h:1,c:"#FFE082",a:.5},{x:2,y:-4,w:5,h:1,c:"#FFF9C4",a:.4},{x:2,y:-3,w:5,h:1,c:"#FFF",a:.15}]}});dt("horns","Horns",{down:{name:"accessory",pixels:[{x:1,y:-1,w:2,h:2,c:"#8B0000"},{x:0,y:-3,w:2,h:2,c:"#A00"},{x:0,y:-4,w:1,h:1,c:"#C62828"},{x:9,y:-1,w:2,h:2,c:"#8B0000"},{x:10,y:-3,w:2,h:2,c:"#A00"},{x:11,y:-4,w:1,h:1,c:"#C62828"}]},up:{name:"accessory",pixels:[{x:1,y:-1,w:2,h:2,c:"#8B0000"},{x:0,y:-3,w:2,h:2,c:"#A00"},{x:0,y:-4,w:1,h:1,c:"#C62828"},{x:9,y:-1,w:2,h:2,c:"#8B0000"},{x:10,y:-3,w:2,h:2,c:"#A00"},{x:11,y:-4,w:1,h:1,c:"#C62828"}]},left:{name:"accessory",pixels:[{x:2,y:-1,w:2,h:2,c:"#8B0000"},{x:1,y:-3,w:2,h:2,c:"#A00"},{x:1,y:-4,w:1,h:1,c:"#C62828"}]}});dt("mask","Mask",{down:{name:"accessory",pixels:[{x:1,y:3,w:10,h:3,c:"#1A1A2E",a:.75},{x:3,y:4,w:2,h:1,c:"#000",a:0},{x:7,y:4,w:2,h:1,c:"#000",a:0},{x:1,y:3,w:10,h:1,c:"#FFD700",a:.3},{x:1,y:5,w:10,h:1,c:"#FFD700",a:.2}]},up:{name:"accessory",pixels:[{x:0,y:4,w:12,h:1,c:"#1A1A2E",a:.3}]},left:{name:"accessory",pixels:[{x:1,y:3,w:6,h:3,c:"#1A1A2E",a:.75},{x:2,y:4,w:2,h:1,c:"#000",a:0},{x:1,y:3,w:6,h:1,c:"#FFD700",a:.3},{x:1,y:5,w:6,h:1,c:"#FFD700",a:.2}]}});dt("bandana","Bandana",{down:{name:"accessory",pixels:[{x:0,y:1,w:12,h:2,c:"#E53935"},{x:1,y:1,w:10,h:1,c:"#EF5350",a:.3}]},up:{name:"accessory",pixels:[{x:0,y:1,w:12,h:2,c:"#E53935"},{x:1,y:1,w:10,h:1,c:"#EF5350",a:.3},{x:11,y:2,w:2,h:2,c:"#E53935",a:.7},{x:12,y:3,w:1,h:1,c:"#C62828",a:.5}]},left:{name:"accessory",pixels:[{x:0,y:1,w:10,h:2,c:"#E53935"},{x:1,y:1,w:8,h:1,c:"#EF5350",a:.3}]}});dt("eyepatch","Eye Patch",{down:{name:"accessory",pixels:[{x:0,y:3,w:12,h:1,c:"#222",a:.5},{x:2,y:3,w:3,h:3,c:"#1A1A1A"},{x:3,y:4,w:1,h:1,c:"#333",a:.3}]},up:{name:"accessory",pixels:[{x:0,y:3,w:12,h:1,c:"#222",a:.5}]},left:{name:"accessory",pixels:[{x:0,y:3,w:10,h:1,c:"#222",a:.5},{x:1,y:3,w:3,h:3,c:"#1A1A1A"},{x:2,y:4,w:1,h:1,c:"#333",a:.3}]}});dt("cat-face","Cat Face",{down:{name:"accessory",pixels:[{x:1,y:1,w:10,h:8,c:"#555"},{x:2,y:0,w:8,h:1,c:"#555"},{x:0,y:-2,w:3,h:2,c:"#555"},{x:1,y:-3,w:2,h:1,c:"#555"},{x:9,y:-2,w:3,h:2,c:"#555"},{x:9,y:-3,w:2,h:1,c:"#555"},{x:1,y:-1,w:1,h:1,c:"#FFB0C0",a:.7},{x:10,y:-1,w:1,h:1,c:"#FFB0C0",a:.7},{x:2,y:3,w:3,h:3,c:"#222"},{x:7,y:3,w:3,h:3,c:"#222"},{x:3,y:3,w:1,h:2,c:"#4FC3F7",a:.8},{x:8,y:3,w:1,h:2,c:"#4FC3F7",a:.8},{x:3,y:4,w:1,h:1,c:"#111"},{x:8,y:4,w:1,h:1,c:"#111"},{x:5,y:5,w:2,h:1,c:"#FFB0C0"},{x:4,y:6,w:1,h:1,c:"#444",a:.6},{x:7,y:6,w:1,h:1,c:"#444",a:.6},{x:0,y:5,w:2,h:1,c:"#888",a:.4},{x:10,y:5,w:2,h:1,c:"#888",a:.4},{x:0,y:6,w:2,h:1,c:"#888",a:.3},{x:10,y:6,w:2,h:1,c:"#888",a:.3}]},up:{name:"accessory",pixels:[{x:1,y:1,w:10,h:8,c:"#555"},{x:2,y:0,w:8,h:1,c:"#555"},{x:0,y:-2,w:3,h:2,c:"#555"},{x:1,y:-3,w:2,h:1,c:"#555"},{x:9,y:-2,w:3,h:2,c:"#555"},{x:9,y:-3,w:2,h:1,c:"#555"},{x:5,y:1,w:2,h:5,c:"#4A4A4A",a:.3},{x:9,y:8,w:2,h:2,c:"#555"},{x:10,y:7,w:1,h:1,c:"#555"}]},left:{name:"accessory",pixels:[{x:1,y:1,w:9,h:8,c:"#555"},{x:2,y:0,w:7,h:1,c:"#555"},{x:2,y:-2,w:3,h:2,c:"#555"},{x:3,y:-3,w:2,h:1,c:"#555"},{x:3,y:-1,w:1,h:1,c:"#FFB0C0",a:.7},{x:2,y:3,w:3,h:3,c:"#222"},{x:3,y:3,w:1,h:2,c:"#4FC3F7",a:.8},{x:3,y:4,w:1,h:1,c:"#111"},{x:0,y:5,w:3,h:2,c:"#555"},{x:0,y:5,w:2,h:1,c:"#FFB0C0"},{x:-1,y:5,w:2,h:1,c:"#888",a:.4},{x:-1,y:6,w:2,h:1,c:"#888",a:.3}]}});dt("bear-face","Bear Face",{down:{name:"accessory",pixels:[{x:1,y:0,w:10,h:9,c:"#8B6914"},{x:2,y:-1,w:8,h:1,c:"#8B6914"},{x:0,y:-1,w:3,h:3,c:"#8B6914"},{x:9,y:-1,w:3,h:3,c:"#8B6914"},{x:1,y:0,w:1,h:1,c:"#C4A24A",a:.6},{x:10,y:0,w:1,h:1,c:"#C4A24A",a:.6},{x:3,y:5,w:6,h:4,c:"#C4A24A",a:.7},{x:3,y:3,w:2,h:2,c:"#111"},{x:7,y:3,w:2,h:2,c:"#111"},{x:3,y:3,w:1,h:1,c:"#FFF",a:.3},{x:7,y:3,w:1,h:1,c:"#FFF",a:.3},{x:5,y:5,w:2,h:1,c:"#222"},{x:5,y:7,w:2,h:1,c:"#6B4F10",a:.5}]},up:{name:"accessory",pixels:[{x:1,y:0,w:10,h:9,c:"#8B6914"},{x:2,y:-1,w:8,h:1,c:"#8B6914"},{x:0,y:-1,w:3,h:3,c:"#8B6914"},{x:9,y:-1,w:3,h:3,c:"#8B6914"},{x:1,y:0,w:1,h:1,c:"#C4A24A",a:.6},{x:10,y:0,w:1,h:1,c:"#C4A24A",a:.6},{x:5,y:1,w:2,h:5,c:"#7A5B10",a:.3}]},left:{name:"accessory",pixels:[{x:1,y:0,w:9,h:9,c:"#8B6914"},{x:2,y:-1,w:7,h:1,c:"#8B6914"},{x:0,y:-1,w:3,h:3,c:"#8B6914"},{x:0,y:0,w:1,h:1,c:"#C4A24A",a:.6},{x:0,y:4,w:3,h:4,c:"#C4A24A",a:.7},{x:3,y:3,w:2,h:2,c:"#111"},{x:3,y:3,w:1,h:1,c:"#FFF",a:.3},{x:1,y:5,w:2,h:1,c:"#222"}]}});dt("panda-face","Panda Face",{down:{name:"accessory",pixels:[{x:1,y:0,w:10,h:9,c:"#F5F5F5"},{x:2,y:-1,w:8,h:1,c:"#F5F5F5"},{x:0,y:-2,w:3,h:3,c:"#222"},{x:9,y:-2,w:3,h:3,c:"#222"},{x:2,y:2,w:3,h:4,c:"#222"},{x:7,y:2,w:3,h:4,c:"#222"},{x:3,y:3,w:1,h:2,c:"#FFF"},{x:8,y:3,w:1,h:2,c:"#FFF"},{x:3,y:4,w:1,h:1,c:"#111"},{x:8,y:4,w:1,h:1,c:"#111"},{x:5,y:6,w:2,h:1,c:"#222"},{x:5,y:7,w:1,h:1,c:"#CCC",a:.4},{x:6,y:7,w:1,h:1,c:"#CCC",a:.4}]},up:{name:"accessory",pixels:[{x:1,y:0,w:10,h:9,c:"#F5F5F5"},{x:2,y:-1,w:8,h:1,c:"#F5F5F5"},{x:0,y:-2,w:3,h:3,c:"#222"},{x:9,y:-2,w:3,h:3,c:"#222"},{x:5,y:1,w:2,h:5,c:"#EEE",a:.3}]},left:{name:"accessory",pixels:[{x:1,y:0,w:9,h:9,c:"#F5F5F5"},{x:2,y:-1,w:7,h:1,c:"#F5F5F5"},{x:0,y:-2,w:3,h:3,c:"#222"},{x:2,y:2,w:3,h:4,c:"#222"},{x:3,y:3,w:1,h:2,c:"#FFF"},{x:3,y:4,w:1,h:1,c:"#111"},{x:0,y:5,w:3,h:2,c:"#F5F5F5"},{x:1,y:6,w:1,h:1,c:"#222"}]}});dt("frog-face","Frog Face",{down:{name:"accessory",pixels:[{x:1,y:1,w:10,h:8,c:"#4CAF50"},{x:2,y:0,w:8,h:1,c:"#4CAF50"},{x:1,y:-2,w:4,h:3,c:"#4CAF50"},{x:7,y:-2,w:4,h:3,c:"#4CAF50"},{x:2,y:-1,w:2,h:2,c:"#FFF"},{x:8,y:-1,w:2,h:2,c:"#FFF"},{x:3,y:0,w:1,h:1,c:"#111"},{x:9,y:0,w:1,h:1,c:"#111"},{x:3,y:5,w:6,h:3,c:"#81C784",a:.5},{x:2,y:7,w:8,h:1,c:"#388E3C",a:.6},{x:4,y:4,w:1,h:1,c:"#388E3C",a:.5},{x:7,y:4,w:1,h:1,c:"#388E3C",a:.5},{x:1,y:5,w:2,h:1,c:"#FF8A80",a:.25},{x:9,y:5,w:2,h:1,c:"#FF8A80",a:.25}]},up:{name:"accessory",pixels:[{x:1,y:1,w:10,h:8,c:"#4CAF50"},{x:2,y:0,w:8,h:1,c:"#4CAF50"},{x:1,y:-2,w:4,h:2,c:"#4CAF50"},{x:7,y:-2,w:4,h:2,c:"#4CAF50"},{x:5,y:2,w:2,h:4,c:"#388E3C",a:.2}]},left:{name:"accessory",pixels:[{x:1,y:1,w:9,h:8,c:"#4CAF50"},{x:2,y:0,w:7,h:1,c:"#4CAF50"},{x:0,y:-2,w:4,h:3,c:"#4CAF50"},{x:1,y:-1,w:2,h:2,c:"#FFF"},{x:2,y:0,w:1,h:1,c:"#111"},{x:0,y:5,w:3,h:3,c:"#81C784",a:.5},{x:0,y:7,w:8,h:1,c:"#388E3C",a:.6},{x:1,y:5,w:1,h:1,c:"#FF8A80",a:.25}]}});dt("rabbit-face","Rabbit Face",{down:{name:"accessory",pixels:[{x:1,y:1,w:10,h:8,c:"#F5F5F5"},{x:2,y:0,w:8,h:1,c:"#F5F5F5"},{x:2,y:-6,w:3,h:6,c:"#F5F5F5"},{x:7,y:-6,w:3,h:6,c:"#F5F5F5"},{x:3,y:-5,w:1,h:4,c:"#FFB0C0",a:.6},{x:8,y:-5,w:1,h:4,c:"#FFB0C0",a:.6},{x:2,y:3,w:3,h:3,c:"#E57373",a:.7},{x:7,y:3,w:3,h:3,c:"#E57373",a:.7},{x:3,y:3,w:1,h:1,c:"#FFF",a:.4},{x:8,y:3,w:1,h:1,c:"#FFF",a:.4},{x:5,y:5,w:2,h:1,c:"#FFB0C0"},{x:5,y:6,w:1,h:1,c:"#DDD",a:.4},{x:6,y:6,w:1,h:1,c:"#DDD",a:.4},{x:0,y:4,w:2,h:3,c:"#F5F5F5",a:.6},{x:10,y:4,w:2,h:3,c:"#F5F5F5",a:.6}]},up:{name:"accessory",pixels:[{x:1,y:1,w:10,h:8,c:"#F5F5F5"},{x:2,y:0,w:8,h:1,c:"#F5F5F5"},{x:2,y:-6,w:3,h:6,c:"#F5F5F5"},{x:7,y:-6,w:3,h:6,c:"#F5F5F5"},{x:3,y:-5,w:1,h:4,c:"#FFB0C0",a:.6},{x:8,y:-5,w:1,h:4,c:"#FFB0C0",a:.6},{x:5,y:8,w:3,h:2,c:"#FFF"}]},left:{name:"accessory",pixels:[{x:1,y:1,w:9,h:8,c:"#F5F5F5"},{x:2,y:0,w:7,h:1,c:"#F5F5F5"},{x:3,y:-6,w:3,h:6,c:"#F5F5F5"},{x:4,y:-5,w:1,h:4,c:"#FFB0C0",a:.6},{x:2,y:3,w:3,h:3,c:"#E57373",a:.7},{x:3,y:3,w:1,h:1,c:"#FFF",a:.4},{x:0,y:4,w:3,h:3,c:"#F5F5F5"},{x:1,y:5,w:1,h:1,c:"#FFB0C0"},{x:0,y:4,w:2,h:3,c:"#F5F5F5",a:.6}]}});dt("dog-face","Dog Face",{down:{name:"accessory",pixels:[{x:1,y:0,w:10,h:9,c:"#D2A25C"},{x:2,y:-1,w:8,h:1,c:"#D2A25C"},{x:-1,y:1,w:3,h:6,c:"#A67B3D"},{x:10,y:1,w:3,h:6,c:"#A67B3D"},{x:3,y:5,w:6,h:4,c:"#F5E6D0",a:.8},{x:3,y:2,w:2,h:3,c:"#3E2723"},{x:7,y:2,w:2,h:3,c:"#3E2723"},{x:3,y:2,w:1,h:1,c:"#FFF",a:.4},{x:7,y:2,w:1,h:1,c:"#FFF",a:.4},{x:5,y:5,w:2,h:2,c:"#222"},{x:5,y:7,w:2,h:2,c:"#FF6B8A",a:.8},{x:5,y:7,w:1,h:1,c:"#FF8A9E",a:.4}]},up:{name:"accessory",pixels:[{x:1,y:0,w:10,h:9,c:"#D2A25C"},{x:2,y:-1,w:8,h:1,c:"#D2A25C"},{x:-1,y:1,w:3,h:6,c:"#A67B3D"},{x:10,y:1,w:3,h:6,c:"#A67B3D"},{x:5,y:0,w:2,h:6,c:"#B8883C",a:.3},{x:2,y:8,w:8,h:1,c:"#A67B3D",a:.5}]},left:{name:"accessory",pixels:[{x:1,y:0,w:9,h:9,c:"#D2A25C"},{x:2,y:-1,w:7,h:1,c:"#D2A25C"},{x:-1,y:1,w:3,h:6,c:"#A67B3D"},{x:-1,y:4,w:3,h:4,c:"#D2A25C"},{x:-1,y:5,w:2,h:3,c:"#F5E6D0",a:.8},{x:3,y:2,w:2,h:3,c:"#3E2723"},{x:3,y:2,w:1,h:1,c:"#FFF",a:.4},{x:0,y:5,w:2,h:1,c:"#222"},{x:0,y:7,w:2,h:1,c:"#FF6B8A",a:.7}]}});dt("star-glasses","Star Glasses",{down:{name:"accessory",pixels:[{x:1,y:3,w:4,h:3,c:"#FF4081",a:.6},{x:2,y:2,w:2,h:1,c:"#FF4081",a:.6},{x:2,y:6,w:2,h:1,c:"#FF4081",a:.6},{x:7,y:3,w:4,h:3,c:"#FF4081",a:.6},{x:8,y:2,w:2,h:1,c:"#FF4081",a:.6},{x:8,y:6,w:2,h:1,c:"#FF4081",a:.6},{x:5,y:4,w:2,h:1,c:"#FF4081",a:.4}]},up:{name:"accessory",pixels:[{x:0,y:3,w:2,h:1,c:"#FF4081",a:.3},{x:10,y:3,w:2,h:1,c:"#FF4081",a:.3}]},left:{name:"accessory",pixels:[{x:1,y:3,w:4,h:3,c:"#FF4081",a:.6},{x:2,y:2,w:2,h:1,c:"#FF4081",a:.6},{x:2,y:6,w:2,h:1,c:"#FF4081",a:.6},{x:5,y:4,w:6,h:1,c:"#FF4081",a:.3}]}});function ns({r:t,g:l,b:a}){return`#${(t<<16|l<<8|a).toString(16).padStart(6,"0")}`}function nc(t,l){const a=t.r-l.r,i=t.g-l.g,o=t.b-l.b;return a*a+i*i+o*o}function hS(t,l){const a=[];a.push(t[Math.floor(Math.random()*t.length)]);for(let i=1;i<l;i++){const o=t.map(m=>{let p=1/0;for(const h of a)p=Math.min(p,nc(m,h));return p}),u=o.reduce((m,p)=>m+p,0);let f=Math.random()*u;for(let m=0;m<t.length;m++)if(f-=o[m],f<=0){a.push(t[m]);break}a.length<=i&&a.push(t[Math.floor(Math.random()*t.length)])}return a}function mS(t,l,a=20){if(t.length===0)return[];const i=hS(t,l);for(let u=0;u<a;u++){const f=Array.from({length:l},()=>[]);for(const p of t){let h=1/0,g=0;for(let y=0;y<l;y++){const b=nc(p,i[y]);b<h&&(h=b,g=y)}f[g].push(p)}let m=!0;for(let p=0;p<l;p++){if(f[p].length===0)continue;const h={r:0,g:0,b:0};for(const b of f[p])h.r+=b.r,h.g+=b.g,h.b+=b.b;const g=f[p].length,y={r:Math.round(h.r/g),g:Math.round(h.g/g),b:Math.round(h.b/g)};nc(y,i[p])>1&&(m=!1),i[p]=y}if(m)break}const o=new Array(l).fill(0);for(const u of t){let f=1/0,m=0;for(let p=0;p<l;p++){const h=nc(u,i[p]);h<f&&(f=h,m=p)}o[m]++}return i.map((u,f)=>({c:u,count:o[f]})).sort((u,f)=>f.count-u.count).map(u=>u.c)}function xS(t,l=1e4){const a=document.createElement("canvas"),i=t instanceof HTMLImageElement?t.naturalWidth:t.width,o=t instanceof HTMLImageElement?t.naturalHeight:t.height;a.width=i,a.height=o;const u=a.getContext("2d");u.drawImage(t,0,0);const f=u.getImageData(0,0,i,o).data,m=i*o,p=Math.max(1,Math.floor(m/l)),h=[];for(let g=0;g<m;g+=p){const y=g*4;f[y+3]<128||h.push({r:f[y],g:f[y+1],b:f[y+2]})}return h}function G1(t){return .299*t.r+.587*t.g+.114*t.b}function K1(t){const l=Math.max(t.r,t.g,t.b),a=Math.min(t.r,t.g,t.b);return l===0?0:(l-a)/l*255}function pS(t,l=8){const a=xS(t),i=mS(a,l);if(i.length<5)return{skinColor:"#F5CBA7",hairColor:"#2C1810",shirtColor:"#1565C0",pantsColor:"#37474F",shoeColor:"#212121"};const o=[...i].sort((y,b)=>G1(b)-G1(y)),u=[...i].sort((y,b)=>K1(b)-K1(y)),f=o[0],m=o[o.length-1],p=u[0],h=o[o.length-2],g=o[o.length-1];return{skinColor:ns(f),hairColor:ns(m),shirtColor:ns(p),pantsColor:ns(h),shoeColor:ns(g)}}const yS=[{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}],gS=[{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"}],bS=[{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"}],vS=[{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 wS(){return{width:12,height:22,layers:[{name:"lower",pixels:yS},{name:"torso",pixels:gS},{name:"head",pixels:bS},{name:"hair",pixels:vS},{name:"accessory",pixels:[]}]}}const kS=["cto","cbo","pm","engineer","designer","qa","data-analyst","default"];for(const t of kS)Fy(`mini:${t}`,wS());const SS=[{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"}],jS=[{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"}],ES=[{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 CS(){return{width:12,height:22,layers:[{name:"torso",pixels:SS},{name:"head",pixels:jS},{name:"hair",pixels:ES},{name:"accessory",pixels:[]}]}}Fy("mini-seated:default",CS());const NS={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"}]},AS={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"}]},DS={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"}]},TS={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"}]};kc("meeting",NS);kc("bulletin",AS);kc("decision",TS);kc("knowledge",DS);const ld=16,ad=24,zS=60,MS={cbo:0,cto:8,pm:15,engineer:22,designer:5,qa:12};function Ly(t,l){if(!t)return t;let a=t;if(l!=null&&l.hairStyle){const i=cS(l.hairStyle);i&&(a=rS(a,i.layer))}if(l!=null&&l.outfitStyle){const i=uS(l.outfitStyle);i&&(a=Md(a,"torso",i.layer,1))}if(l!=null&&l.accessory&&l.accessory!=="none"){const i=fS(l.accessory);i&&(a=Md(a,"accessory",i.layer))}return a}function Sc({roleId:t,className:l,appearance:a,scale:i}){const o=j.useRef(null),u=j.useRef(0),f=j.useRef(0),m=j.useRef(a);m.current=a;const p=i??4,h=ld*p,g=ad*p,y=j.useMemo(()=>{const b=_d(`mini:${t}`)??_d("mini:default");return Ly(b,a)},[t,a==null?void 0:a.hairStyle,a==null?void 0:a.outfitStyle,a==null?void 0:a.accessory]);return j.useEffect(()=>{const b=o.current;if(!b)return;const v=b.getContext("2d");if(!v)return;const k=MS[t]??0,S=()=>{f.current++;const N=m.current;if(!N||!y){u.current=requestAnimationFrame(S);return}const _=(f.current+k)%zS<30?1:0;v.clearRect(0,0,ld,ad),v.save(),v.translate(2,1),sS(v,y,_,N,1),v.restore(),u.current=requestAnimationFrame(S)};return u.current=requestAnimationFrame(S),()=>cancelAnimationFrame(u.current)},[t,y]),c.jsx("canvas",{ref:o,width:ld,height:ad,className:l,style:{imageRendering:"pixelated",display:"block",width:h,height:g}})}const _S={cto:"🏗️",cbo:"📊",pm:"📋",engineer:"⚙️",designer:"🎨",qa:"🔍"},rd={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C"},FS={cto:8,cbo:7,pm:6,engineer:5,designer:5,qa:4,"data-analyst":4},RS={cto:"Chief Technology Officer",cbo:"Chief Business Officer",pm:"Product Manager",engineer:"Software Engineer",designer:"UI/UX Designer",qa:"QA Engineer"},OS=500,Q1=360,Z1=700,BS=t=>`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`;function $S({role:t,allRoles:l,recentActivity:a,onClose:i,onFireRole:o,terminalWidth:u=0,activeJobId:f,activeTask:m,isWorking:p,jobStartedAt:h,onStopJob:g,sessions:y,streamingSessionId:b,onCreateSessionSilent:v,onSendMessage:k,onFocusTerminal:S,onCustomize:N,onUpdateRole:E,appearance:_,relationships:$}){var ye,Te;const[O,B]=j.useState(OS),[M,q]=j.useState(!1),G=j.useRef(0),P=j.useRef(0),[z,U]=j.useState(!1),[L,ee]=j.useState(!1),[ne,V]=j.useState(!1),[Y,Q]=j.useState(!1),[re,ae]=j.useState("talk"),[D,T]=j.useState(!1),[X,A]=j.useState(""),[se,de]=j.useState(!1),he=j.useRef(null),{events:we,status:Ce}=C0(f??null),[Oe,pe]=j.useState(0);j.useEffect(()=>{if(!p||!h){pe(0);return}const xe=new Date(h).getTime(),be=()=>pe(Math.floor((Date.now()-xe)/1e3));be();const rt=setInterval(be,1e3);return()=>clearInterval(rt)},[p,h]);const Ke=u>0,lt=Ke?u:0,me=Ke?Math.max(Q1,window.innerWidth-u-100):Z1,Ee=Math.min(O,me),qe=j.useCallback(xe=>{xe.preventDefault(),G.current=xe.clientX,P.current=Ee,q(!0);const be=xt=>{const Xe=G.current-xt.clientX,ue=Math.min(Z1,Math.max(Q1,P.current+Xe));B(ue)},rt=()=>{q(!1),document.removeEventListener("mousemove",be),document.removeEventListener("mouseup",rt)};document.addEventListener("mousemove",be),document.addEventListener("mouseup",rt)},[Ee]),Mt=j.useRef(null),mt=t?y.find(xe=>xe.roleId===t.id):null,Yt=xe=>{if(!t)return;const be=p?"talk":re;mt?(k(mt.id,xe,be),S(t.id)):(Mt.current={content:xe,mode:be},v(t.id))};j.useEffect(()=>{if(mt&&Mt.current){const{content:xe,mode:be}=Mt.current;Mt.current=null,k(mt.id,xe,be),t&&S(t.id)}},[mt==null?void 0:mt.id]);const _t=(()=>{if(!we.length)return null;const xe=[];let be=0,rt=0,xt=0;for(const Xe of we)if(Xe.type==="thinking")be++;else if(Xe.type==="text")rt++;else if(Xe.type==="tool:start"){const ue=String(Xe.data.name??"");xe.includes(ue)||xe.push(ue)}else Xe.type==="dispatch:start"&&xt++;return{tools:xe,thinkCount:be,textCount:rt,dispatchCount:xt,total:we.length}})(),on=m||(()=>{if(!mt)return null;const xe=mt.messages;for(let be=xe.length-1;be>=0;be--)if(xe[be].from==="ceo")return xe[be].content;return null})(),Ct=(()=>{if(!mt)return null;const xe=mt.messages;for(let be=xe.length-1;be>=0;be--)if(xe[be].from==="role"&&xe[be].content)return xe[be].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:lt},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:lt,width:Ee,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 Ot=rd[t.id]??"#666",Ln=_S[t.id]??"👤",Bt=l.filter(xe=>xe.reportsTo===t.id),Hn=mt&&b===mt.id,le=t.name||RS[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:lt},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)] ${M?"resizing":""}`,style:{borderLeftColor:Ot,right:lt,width:Ee,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:qe}),c.jsxs("div",{className:"relative shrink-0 overflow-hidden",style:{background:`linear-gradient(135deg, ${Ot}ee, ${Ot}99)`},children:[c.jsx("div",{className:"absolute inset-0 opacity-[0.06]",style:{backgroundImage:"repeating-linear-gradient(45deg, transparent, transparent 8px, white 8px, white 9px)"}}),c.jsxs("div",{className:"absolute top-3 right-3 flex items-center gap-1.5 z-10",children:[N&&c.jsx("button",{onClick:()=>N(t.id),className:"w-7 h-7 rounded-full bg-black/20 text-white flex items-center justify-center text-sm hover:bg-black/30 cursor-pointer backdrop-blur-sm",title:"Customize",children:"🎨"}),c.jsx("button",{onClick:i,className:"w-7 h-7 rounded-full bg-black/20 text-white flex items-center justify-center text-lg hover:bg-black/30 cursor-pointer backdrop-blur-sm",children:"×"})]}),c.jsxs("div",{className:"relative flex items-end gap-4 px-4 pt-4 pb-3",children:[c.jsx("div",{className:"shrink-0 relative",style:{marginBottom:-2},children:c.jsx("div",{className:"rounded-lg p-1",style:{background:"rgba(0,0,0,0.2)"},children:c.jsx(Sc,{roleId:t.id,appearance:_,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:[Ln," ",t.id.toUpperCase(),p&&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"})]}),D?c.jsxs("form",{className:"flex items-center gap-1.5 mt-0.5",onSubmit:async xe=>{xe.preventDefault();const be=X.trim();if(!be||be===le||!E){T(!1);return}de(!0);try{await E(t.id,{name:be})}catch{}de(!1),T(!1)},children:[c.jsx("input",{ref:he,value:X,onChange:xe=>A(xe.target.value),onKeyDown:xe=>{xe.key==="Escape"&&T(!1)},disabled:se,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:se,className:"text-white/80 hover:text-white text-[10px] cursor-pointer shrink-0",children:"✓"}),c.jsx("button",{type:"button",onClick:()=>T(!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:()=>{E&&(A(le),T(!0))},title:E?"Click to edit name":void 0,children:[le,E&&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.",FS[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:p?"var(--idle-amber)":"var(--active-green)"}}),p?"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:[p&&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",Oe>0?` · ${BS(Oe)}`:""]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{onClick:()=>S(t.id),className:"text-[10px] cursor-pointer hover:underline",style:{color:"var(--terminal-text-muted)"},children:"Open chat ↗"}),f&&g&&c.jsx("button",{onClick:()=>g(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"})]})]}),on&&c.jsx("div",{className:"text-xs truncate",style:{color:"var(--terminal-text-secondary)"},children:on})]}),p&&f&&_t&&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:()=>S(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:[_t.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 ×",_t.thinkCount]}),_t.tools.map(xe=>c.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px]",style:{background:"rgba(59,130,246,0.15)",color:"#60a5fa"},children:xe},xe)),_t.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 ×",_t.dispatchCount]}),_t.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 ×",_t.textCount]}),(Ce==="streaming"||Ce==="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:[_t.total," events"]})]}),p&&Ct&&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:()=>S(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:[Ct.slice(0,200),Ct.length>200&&"..."]})]}),p&&c.jsx("div",{className:"px-4 py-2.5 shrink-0",style:{borderBottom:"1px solid var(--terminal-border)"},children:c.jsx(W1,{onSend:Yt,disabled:!!Hn,placeholder:"Ask something...",color:Ot})}),!p&&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(LS,{icon:Ln,roleId:t.id,roleName:le,color:Ot,text:a})]}),!p&&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:[Ct&&c.jsxs("div",{className:"px-3 pt-2.5 pb-2 cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--terminal-border)"},onClick:()=>S(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:[Ct.slice(0,150),Ct.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:()=>ae("talk"),className:"px-2 py-1 text-[10px] font-semibold cursor-pointer transition-colors",style:{background:re==="talk"?"var(--accent)":"transparent",color:re==="talk"?"#fff":"var(--terminal-text-secondary)"},children:"Talk"}),c.jsx("button",{onClick:()=>ae("do"),className:"px-2 py-1 text-[10px] font-semibold cursor-pointer transition-colors",style:{background:re==="do"?"var(--idle-amber)":"transparent",color:re==="do"?"#fff":"var(--terminal-text-secondary)"},children:"Do"})]}),c.jsx(W1,{onSend:Yt,disabled:!!Hn,placeholder:re==="talk"?"Ask something...":"Give a directive...",color:Ot})]})})]})}),c.jsxs("div",{className:"px-4 py-2 space-y-1",children:[c.jsxs(Go,{title:`Profile${t.persona?"":" (empty)"}`,open:z,onToggle:()=>U(xe=>!xe),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(id,{label:"Level",value:t.level}),c.jsx(id,{label:"Reports to",value:t.reportsTo}),c.jsx(id,{label:"Status",value:t.status})]}),Bt.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:Bt.map(xe=>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:rd[xe.id]??"#666"},children:xe.id.slice(0,2).toUpperCase()}),c.jsx("div",{className:"text-xs",style:{color:"var(--terminal-text)"},children:xe.name})]},xe.id))})]})]}),t.authority&&c.jsxs(Go,{title:"Authority",open:L,onToggle:()=>ee(xe=>!xe),children:[((ye=t.authority.autonomous)==null?void 0:ye.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((xe,be)=>c.jsxs("div",{className:"text-xs pl-3 py-0.5",style:{color:"var(--terminal-text-secondary)"},children:["- ",xe]},be))]}),((Te=t.authority.needsApproval)==null?void 0:Te.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((xe,be)=>c.jsxs("div",{className:"text-xs pl-3 py-0.5",style:{color:"var(--terminal-text-secondary)"},children:["- ",xe]},be))]})]}),t&&$&&(()=>{const xe=$.filter(be=>be.roleA===t.id||be.roleB===t.id).filter(be=>be.familiarity>0).sort((be,rt)=>rt.familiarity-be.familiarity);return xe.length===0?null:c.jsx(Go,{title:`Relationships (${xe.length})`,open:ne,onToggle:()=>V(be=>!be),children:c.jsx("div",{className:"space-y-1.5",children:xe.map((be,rt)=>{const xt=be.roleA===t.id?be.roleB:be.roleA,Xe=l.find(it=>it.id===xt),ue=be.familiarity>=80?"Best Partner":be.familiarity>=50?"Friend":be.familiarity>=20?"Colleague":"Acquaintance",De=be.familiarity>=80?"#4CAF50":be.familiarity>=50?"#2196F3":be.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:rd[xt]??"var(--terminal-text-secondary)"},children:(Xe==null?void 0:Xe.name)??xt}),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:`${be.familiarity}%`,background:De}})}),c.jsx("span",{className:"text-[10px] w-16 text-right",style:{color:"var(--terminal-text-muted)"},children:ue})]},rt)})})})})(),t.journal&&c.jsx(Go,{title:`Journal (${(t.journal.match(/### /g)??[]).length})`,open:Y,onToggle:()=>Q(xe=>!xe),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(js,{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 LS({icon:t,roleId:l,roleName:a,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:a}),u?c.jsx("div",{className:"text-sm leading-relaxed",style:{color:"var(--terminal-text)"},children:c.jsx(js,{content:o})}):c.jsx("div",{className:"text-sm italic",style:{color:"var(--terminal-text-muted)"},children:"No recent activity."})]})]})})]})})}function Go({title:t,open:l,onToggle:a,children:i}){return c.jsxs("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid var(--terminal-border)"},children:[c.jsxs("button",{onClick:a,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 W1({onSend:t,disabled:l,placeholder:a,color:i}){const[o,u]=j.useState(""),f=()=>{const m=o.trim();!m||l||(t(m),u(""))};return c.jsxs("div",{className:"flex items-center gap-1.5 flex-1",children:[c.jsx("input",{type:"text",value:o,onChange:m=>u(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),f())},placeholder:l?"Waiting...":a,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 id({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 HS(t,l){var a,i=1;t==null&&(t=0),l==null&&(l=0);function o(){var u,f=a.length,m,p=0,h=0;for(u=0;u<f;++u)m=a[u],p+=m.x,h+=m.y;for(p=(p/f-t)*i,h=(h/f-l)*i,u=0;u<f;++u)m=a[u],m.x-=p,m.y-=h}return o.initialize=function(u){a=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 US(t){const l=+this._x.call(null,t),a=+this._y.call(null,t);return Hy(this.cover(l,a),l,a,t)}function Hy(t,l,a,i){if(isNaN(l)||isNaN(a))return t;var o,u=t._root,f={data:i},m=t._x0,p=t._y0,h=t._x1,g=t._y1,y,b,v,k,S,N,E,_;if(!u)return t._root=f,t;for(;u.length;)if((S=l>=(y=(m+h)/2))?m=y:h=y,(N=a>=(b=(p+g)/2))?p=b:g=b,o=u,!(u=u[E=N<<1|S]))return o[E]=f,t;if(v=+t._x.call(null,u.data),k=+t._y.call(null,u.data),l===v&&a===k)return f.next=u,o?o[E]=f:t._root=f,t;do o=o?o[E]=new Array(4):t._root=new Array(4),(S=l>=(y=(m+h)/2))?m=y:h=y,(N=a>=(b=(p+g)/2))?p=b:g=b;while((E=N<<1|S)===(_=(k>=b)<<1|v>=y));return o[_]=u,o[E]=f,t}function YS(t){var l,a,i=t.length,o,u,f=new Array(i),m=new Array(i),p=1/0,h=1/0,g=-1/0,y=-1/0;for(a=0;a<i;++a)isNaN(o=+this._x.call(null,l=t[a]))||isNaN(u=+this._y.call(null,l))||(f[a]=o,m[a]=u,o<p&&(p=o),o>g&&(g=o),u<h&&(h=u),u>y&&(y=u));if(p>g||h>y)return this;for(this.cover(p,h).cover(g,y),a=0;a<i;++a)Hy(this,f[a],m[a],t[a]);return this}function IS(t,l){if(isNaN(t=+t)||isNaN(l=+l))return this;var a=this._x0,i=this._y0,o=this._x1,u=this._y1;if(isNaN(a))o=(a=Math.floor(t))+1,u=(i=Math.floor(l))+1;else{for(var f=o-a||1,m=this._root,p,h;a>t||t>=o||i>l||l>=u;)switch(h=(l<i)<<1|t<a,p=new Array(4),p[h]=m,m=p,f*=2,h){case 0:o=a+f,u=i+f;break;case 1:a=o-f,u=i+f;break;case 2:o=a+f,i=u-f;break;case 3:a=o-f,i=u-f;break}this._root&&this._root.length&&(this._root=m)}return this._x0=a,this._y0=i,this._x1=o,this._y1=u,this}function qS(){var t=[];return this.visit(function(l){if(!l.length)do t.push(l.data);while(l=l.next)}),t}function XS(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 pn(t,l,a,i,o){this.node=t,this.x0=l,this.y0=a,this.x1=i,this.y1=o}function VS(t,l,a){var i,o=this._x0,u=this._y0,f,m,p,h,g=this._x1,y=this._y1,b=[],v=this._root,k,S;for(v&&b.push(new pn(v,o,u,g,y)),a==null?a=1/0:(o=t-a,u=l-a,g=t+a,y=l+a,a*=a);k=b.pop();)if(!(!(v=k.node)||(f=k.x0)>g||(m=k.y0)>y||(p=k.x1)<o||(h=k.y1)<u))if(v.length){var N=(f+p)/2,E=(m+h)/2;b.push(new pn(v[3],N,E,p,h),new pn(v[2],f,E,N,h),new pn(v[1],N,m,p,E),new pn(v[0],f,m,N,E)),(S=(l>=E)<<1|t>=N)&&(k=b[b.length-1],b[b.length-1]=b[b.length-1-S],b[b.length-1-S]=k)}else{var _=t-+this._x.call(null,v.data),$=l-+this._y.call(null,v.data),O=_*_+$*$;if(O<a){var B=Math.sqrt(a=O);o=t-B,u=l-B,g=t+B,y=l+B,i=v.data}}return i}function GS(t){if(isNaN(g=+this._x.call(null,t))||isNaN(y=+this._y.call(null,t)))return this;var l,a=this._root,i,o,u,f=this._x0,m=this._y0,p=this._x1,h=this._y1,g,y,b,v,k,S,N,E;if(!a)return this;if(a.length)for(;;){if((k=g>=(b=(f+p)/2))?f=b:p=b,(S=y>=(v=(m+h)/2))?m=v:h=v,l=a,!(a=a[N=S<<1|k]))return this;if(!a.length)break;(l[N+1&3]||l[N+2&3]||l[N+3&3])&&(i=l,E=N)}for(;a.data!==t;)if(o=a,!(a=a.next))return this;return(u=a.next)&&delete a.next,o?(u?o.next=u:delete o.next,this):l?(u?l[N]=u:delete l[N],(a=l[0]||l[1]||l[2]||l[3])&&a===(l[3]||l[2]||l[1]||l[0])&&!a.length&&(i?i[E]=a:this._root=a),this):(this._root=u,this)}function KS(t){for(var l=0,a=t.length;l<a;++l)this.remove(t[l]);return this}function QS(){return this._root}function ZS(){var t=0;return this.visit(function(l){if(!l.length)do++t;while(l=l.next)}),t}function WS(t){var l=[],a,i=this._root,o,u,f,m,p;for(i&&l.push(new pn(i,this._x0,this._y0,this._x1,this._y1));a=l.pop();)if(!t(i=a.node,u=a.x0,f=a.y0,m=a.x1,p=a.y1)&&i.length){var h=(u+m)/2,g=(f+p)/2;(o=i[3])&&l.push(new pn(o,h,g,m,p)),(o=i[2])&&l.push(new pn(o,u,g,h,p)),(o=i[1])&&l.push(new pn(o,h,f,m,g)),(o=i[0])&&l.push(new pn(o,u,f,h,g))}return this}function JS(t){var l=[],a=[],i;for(this._root&&l.push(new pn(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,p=i.x1,h=i.y1,g=(f+p)/2,y=(m+h)/2;(u=o[0])&&l.push(new pn(u,f,m,g,y)),(u=o[1])&&l.push(new pn(u,g,m,p,y)),(u=o[2])&&l.push(new pn(u,f,y,g,h)),(u=o[3])&&l.push(new pn(u,g,y,p,h))}a.push(i)}for(;i=a.pop();)t(i.node,i.x0,i.y0,i.x1,i.y1);return this}function PS(t){return t[0]}function ej(t){return arguments.length?(this._x=t,this):this._x}function tj(t){return t[1]}function nj(t){return arguments.length?(this._y=t,this):this._y}function ih(t,l,a){var i=new sh(l??PS,a??tj,NaN,NaN,NaN,NaN);return t==null?i:i.addAll(t)}function sh(t,l,a,i,o,u){this._x=t,this._y=l,this._x0=a,this._y0=i,this._x1=o,this._y1=u,this._root=void 0}function J1(t){for(var l={data:t.data},a=l;t=t.next;)a=a.next={data:t.data};return l}var yn=ih.prototype=sh.prototype;yn.copy=function(){var t=new sh(this._x,this._y,this._x0,this._y0,this._x1,this._y1),l=this._root,a,i;if(!l)return t;if(!l.length)return t._root=J1(l),t;for(a=[{source:l,target:t._root=new Array(4)}];l=a.pop();)for(var o=0;o<4;++o)(i=l.source[o])&&(i.length?a.push({source:i,target:l.target[o]=new Array(4)}):l.target[o]=J1(i));return t};yn.add=US;yn.addAll=YS;yn.cover=IS;yn.data=qS;yn.extent=XS;yn.find=VS;yn.remove=GS;yn.removeAll=KS;yn.root=QS;yn.size=ZS;yn.visit=WS;yn.visitAfter=JS;yn.x=ej;yn.y=nj;function Pa(t){return function(){return t}}function ja(t){return(t()-.5)*1e-6}function lj(t){return t.x+t.vx}function aj(t){return t.y+t.vy}function rj(t){var l,a,i,o=1,u=1;typeof t!="function"&&(t=Pa(t==null?1:+t));function f(){for(var h,g=l.length,y,b,v,k,S,N,E=0;E<u;++E)for(y=ih(l,lj,aj).visitAfter(m),h=0;h<g;++h)b=l[h],S=a[b.index],N=S*S,v=b.x+b.vx,k=b.y+b.vy,y.visit(_);function _($,O,B,M,q){var G=$.data,P=$.r,z=S+P;if(G){if(G.index>b.index){var U=v-G.x-G.vx,L=k-G.y-G.vy,ee=U*U+L*L;ee<z*z&&(U===0&&(U=ja(i),ee+=U*U),L===0&&(L=ja(i),ee+=L*L),ee=(z-(ee=Math.sqrt(ee)))/ee*o,b.vx+=(U*=ee)*(z=(P*=P)/(N+P)),b.vy+=(L*=ee)*z,G.vx-=U*(z=1-z),G.vy-=L*z)}return}return O>v+z||M<v-z||B>k+z||q<k-z}}function m(h){if(h.data)return h.r=a[h.data.index];for(var g=h.r=0;g<4;++g)h[g]&&h[g].r>h.r&&(h.r=h[g].r)}function p(){if(l){var h,g=l.length,y;for(a=new Array(g),h=0;h<g;++h)y=l[h],a[y.index]=+t(y,h,l)}}return f.initialize=function(h,g){l=h,i=g,p()},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:Pa(+h),p(),f):t},f}function ij(t){return t.index}function P1(t,l){var a=t.get(l);if(!a)throw new Error("node not found: "+l);return a}function sj(t){var l=ij,a=y,i,o=Pa(30),u,f,m,p,h,g=1;t==null&&(t=[]);function y(N){return 1/Math.min(m[N.source.index],m[N.target.index])}function b(N){for(var E=0,_=t.length;E<g;++E)for(var $=0,O,B,M,q,G,P,z;$<_;++$)O=t[$],B=O.source,M=O.target,q=M.x+M.vx-B.x-B.vx||ja(h),G=M.y+M.vy-B.y-B.vy||ja(h),P=Math.sqrt(q*q+G*G),P=(P-u[$])/P*N*i[$],q*=P,G*=P,M.vx-=q*(z=p[$]),M.vy-=G*z,B.vx+=q*(z=1-z),B.vy+=G*z}function v(){if(f){var N,E=f.length,_=t.length,$=new Map(f.map((B,M)=>[l(B,M,f),B])),O;for(N=0,m=new Array(E);N<_;++N)O=t[N],O.index=N,typeof O.source!="object"&&(O.source=P1($,O.source)),typeof O.target!="object"&&(O.target=P1($,O.target)),m[O.source.index]=(m[O.source.index]||0)+1,m[O.target.index]=(m[O.target.index]||0)+1;for(N=0,p=new Array(_);N<_;++N)O=t[N],p[N]=m[O.source.index]/(m[O.source.index]+m[O.target.index]);i=new Array(_),k(),u=new Array(_),S()}}function k(){if(f)for(var N=0,E=t.length;N<E;++N)i[N]=+a(t[N],N,t)}function S(){if(f)for(var N=0,E=t.length;N<E;++N)u[N]=+o(t[N],N,t)}return b.initialize=function(N,E){f=N,h=E,v()},b.links=function(N){return arguments.length?(t=N,v(),b):t},b.id=function(N){return arguments.length?(l=N,b):l},b.iterations=function(N){return arguments.length?(g=+N,b):g},b.strength=function(N){return arguments.length?(a=typeof N=="function"?N:Pa(+N),k(),b):a},b.distance=function(N){return arguments.length?(o=typeof N=="function"?N:Pa(+N),S(),b):o},b}var oj={value:()=>{}};function Uy(){for(var t=0,l=arguments.length,a={},i;t<l;++t){if(!(i=arguments[t]+"")||i in a||/[\s.]/.test(i))throw new Error("illegal type: "+i);a[i]=[]}return new lc(a)}function lc(t){this._=t}function cj(t,l){return t.trim().split(/^|\s+/).map(function(a){var i="",o=a.indexOf(".");if(o>=0&&(i=a.slice(o+1),a=a.slice(0,o)),a&&!l.hasOwnProperty(a))throw new Error("unknown type: "+a);return{type:a,name:i}})}lc.prototype=Uy.prototype={constructor:lc,on:function(t,l){var a=this._,i=cj(t+"",a),o,u=-1,f=i.length;if(arguments.length<2){for(;++u<f;)if((o=(t=i[u]).type)&&(o=uj(a[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)a[o]=e0(a[o],t.name,l);else if(l==null)for(o in a)a[o]=e0(a[o],t.name,null);return this},copy:function(){var t={},l=this._;for(var a in l)t[a]=l[a].slice();return new lc(t)},call:function(t,l){if((o=arguments.length-2)>0)for(var a=new Array(o),i=0,o,u;i<o;++i)a[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,a)},apply:function(t,l,a){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,a)}};function uj(t,l){for(var a=0,i=t.length,o;a<i;++a)if((o=t[a]).name===l)return o.value}function e0(t,l,a){for(var i=0,o=t.length;i<o;++i)if(t[i].name===l){t[i]=oj,t=t.slice(0,i).concat(t.slice(i+1));break}return a!=null&&t.push({name:l,value:a}),t}var Zr=0,ss=0,ls=0,Yy=1e3,hc,os,mc=0,tr=0,jc=0,gs=typeof performance=="object"&&performance.now?performance:Date,Iy=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function qy(){return tr||(Iy(fj),tr=gs.now()+jc)}function fj(){tr=0}function Rd(){this._call=this._time=this._next=null}Rd.prototype=Xy.prototype={constructor:Rd,restart:function(t,l,a){if(typeof t!="function")throw new TypeError("callback is not a function");a=(a==null?qy():+a)+(l==null?0:+l),!this._next&&os!==this&&(os?os._next=this:hc=this,os=this),this._call=t,this._time=a,Od()},stop:function(){this._call&&(this._call=null,this._time=1/0,Od())}};function Xy(t,l,a){var i=new Rd;return i.restart(t,l,a),i}function dj(){qy(),++Zr;for(var t=hc,l;t;)(l=tr-t._time)>=0&&t._call.call(void 0,l),t=t._next;--Zr}function t0(){tr=(mc=gs.now())+jc,Zr=ss=0;try{dj()}finally{Zr=0,mj(),tr=0}}function hj(){var t=gs.now(),l=t-mc;l>Yy&&(jc-=l,mc=t)}function mj(){for(var t,l=hc,a,i=1/0;l;)l._call?(i>l._time&&(i=l._time),t=l,l=l._next):(a=l._next,l._next=null,l=t?t._next=a:hc=a);os=t,Od(i)}function Od(t){if(!Zr){ss&&(ss=clearTimeout(ss));var l=t-tr;l>24?(t<1/0&&(ss=setTimeout(t0,t-gs.now()-jc)),ls&&(ls=clearInterval(ls))):(ls||(mc=gs.now(),ls=setInterval(hj,Yy)),Zr=1,Iy(t0))}}const xj=1664525,pj=1013904223,n0=4294967296;function yj(){let t=1;return()=>(t=(xj*t+pj)%n0)/n0}function gj(t){return t.x}function bj(t){return t.y}var vj=10,wj=Math.PI*(3-Math.sqrt(5));function kj(t){var l,a=1,i=.001,o=1-Math.pow(i,1/300),u=0,f=.6,m=new Map,p=Xy(y),h=Uy("tick","end"),g=yj();t==null&&(t=[]);function y(){b(),h.call("tick",l),a<i&&(p.stop(),h.call("end",l))}function b(S){var N,E=t.length,_;S===void 0&&(S=1);for(var $=0;$<S;++$)for(a+=(u-a)*o,m.forEach(function(O){O(a)}),N=0;N<E;++N)_=t[N],_.fx==null?_.x+=_.vx*=f:(_.x=_.fx,_.vx=0),_.fy==null?_.y+=_.vy*=f:(_.y=_.fy,_.vy=0);return l}function v(){for(var S=0,N=t.length,E;S<N;++S){if(E=t[S],E.index=S,E.fx!=null&&(E.x=E.fx),E.fy!=null&&(E.y=E.fy),isNaN(E.x)||isNaN(E.y)){var _=vj*Math.sqrt(.5+S),$=S*wj;E.x=_*Math.cos($),E.y=_*Math.sin($)}(isNaN(E.vx)||isNaN(E.vy))&&(E.vx=E.vy=0)}}function k(S){return S.initialize&&S.initialize(t,g),S}return v(),l={tick:b,restart:function(){return p.restart(y),l},stop:function(){return p.stop(),l},nodes:function(S){return arguments.length?(t=S,v(),m.forEach(k),l):t},alpha:function(S){return arguments.length?(a=+S,l):a},alphaMin:function(S){return arguments.length?(i=+S,l):i},alphaDecay:function(S){return arguments.length?(o=+S,l):+o},alphaTarget:function(S){return arguments.length?(u=+S,l):u},velocityDecay:function(S){return arguments.length?(f=1-S,l):1-f},randomSource:function(S){return arguments.length?(g=S,m.forEach(k),l):g},force:function(S,N){return arguments.length>1?(N==null?m.delete(S):m.set(S,k(N)),l):m.get(S)},find:function(S,N,E){var _=0,$=t.length,O,B,M,q,G;for(E==null?E=1/0:E*=E,_=0;_<$;++_)q=t[_],O=S-q.x,B=N-q.y,M=O*O+B*B,M<E&&(G=q,E=M);return G},on:function(S,N){return arguments.length>1?(h.on(S,N),l):h.on(S)}}}function Sj(){var t,l,a,i,o=Pa(-30),u,f=1,m=1/0,p=.81;function h(v){var k,S=t.length,N=ih(t,gj,bj).visitAfter(y);for(i=v,k=0;k<S;++k)l=t[k],N.visit(b)}function g(){if(t){var v,k=t.length,S;for(u=new Array(k),v=0;v<k;++v)S=t[v],u[S.index]=+o(S,v,t)}}function y(v){var k=0,S,N,E=0,_,$,O;if(v.length){for(_=$=O=0;O<4;++O)(S=v[O])&&(N=Math.abs(S.value))&&(k+=S.value,E+=N,_+=N*S.x,$+=N*S.y);v.x=_/E,v.y=$/E}else{S=v,S.x=S.data.x,S.y=S.data.y;do k+=u[S.data.index];while(S=S.next)}v.value=k}function b(v,k,S,N){if(!v.value)return!0;var E=v.x-l.x,_=v.y-l.y,$=N-k,O=E*E+_*_;if($*$/p<O)return O<m&&(E===0&&(E=ja(a),O+=E*E),_===0&&(_=ja(a),O+=_*_),O<f&&(O=Math.sqrt(f*O)),l.vx+=E*v.value*i/O,l.vy+=_*v.value*i/O),!0;if(v.length||O>=m)return;(v.data!==l||v.next)&&(E===0&&(E=ja(a),O+=E*E),_===0&&(_=ja(a),O+=_*_),O<f&&(O=Math.sqrt(f*O)));do v.data!==l&&($=u[v.data.index]*i/O,l.vx+=E*$,l.vy+=_*$);while(v=v.next)}return h.initialize=function(v,k){t=v,a=k,g()},h.strength=function(v){return arguments.length?(o=typeof v=="function"?v:Pa(+v),g(),h):o},h.distanceMin=function(v){return arguments.length?(f=v*v,h):Math.sqrt(f)},h.distanceMax=function(v){return arguments.length?(m=v*v,h):Math.sqrt(m)},h.theta=function(v){return arguments.length?(p=v*v,h):Math.sqrt(p)},h}const bs={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 jj(t){return bs[t]??bs.general}function Ej({docs:t,onNodeClick:l,selectedDocId:a}){var U;const i=j.useRef(null),o=j.useRef(null),[u,f]=j.useState({width:600,height:400}),[m,p]=j.useState({nodes:[],links:[]}),[h,g]=j.useState(null),[y,b]=j.useState(null),[v,k]=j.useState({x:0,y:0}),[S,N]=j.useState({x:0,y:0,w:600,h:400}),E=j.useRef(!1),_=j.useRef({x:0,y:0,vx:0,vy:0}),$=j.useRef(null),O=j.useRef(null);j.useEffect(()=>{const L=i.current;if(!L)return;const ee=new ResizeObserver(ne=>{const{width:V,height:Y}=ne[0].contentRect;V>0&&Y>0&&(f({width:V,height:Y}),N(Q=>({...Q,w:V,h:Y})))});return ee.observe(L),()=>ee.disconnect()},[]),j.useEffect(()=>{if(t.length===0)return;const L=new Set(t.map(re=>re.id)),ee=t.map(re=>({id:re.id,title:re.title,category:re.category,akb_type:re.akb_type})),ne=[];for(const re of t)for(const ae of re.links){const D=ae.href.replace(/^.*knowledge\//,"").replace(/^\.\.\/.*$/,"").replace(/^\.\//,"");L.has(D)&&D!==re.id&&(ne.some(T=>T.source===re.id&&T.target===D||T.source===D&&T.target===re.id)||ne.push({source:re.id,target:D,label:ae.text}))}const{width:V,height:Y}=u,Q=kj(ee).force("link",sj(ne).id(re=>re.id).distance(140)).force("charge",Sj().strength(-400)).force("center",HS(V/2,Y/2)).force("collide",rj(50));O.current=Q,Q.on("tick",()=>{for(const re of ee)re.x=Math.max(60,Math.min(V-60,re.x??V/2)),re.y=Math.max(60,Math.min(Y-60,re.y??Y/2));p({nodes:[...ee],links:[...ne]})}),Q.alpha(1).restart();for(let re=0;re<150;re++)Q.tick();return Q.stop(),p({nodes:[...ee],links:[...ne]}),()=>{Q.stop()}},[t,u]);const B=L=>{if(typeof L=="string"){const ee=m.nodes.find(ne=>ne.id===L);return{x:(ee==null?void 0:ee.x)??0,y:(ee==null?void 0:ee.y)??0}}return{x:L.x??0,y:L.y??0}},M=j.useCallback(L=>{L.preventDefault();const ee=L.deltaY>0?1.1:.9;N(ne=>{const V=Math.max(200,Math.min(u.width*3,ne.w*ee)),Y=Math.max(150,Math.min(u.height*3,ne.h*ee)),Q=(V-ne.w)/2,re=(Y-ne.h)/2;return{x:ne.x-Q,y:ne.y-re,w:V,h:Y}})},[u]),q=j.useCallback(L=>{L.button===0&&(E.current=!0,_.current={x:L.clientX,y:L.clientY,vx:S.x,vy:S.y})},[S]),G=j.useCallback(L=>{var ee;if($.current){const ne=o.current;if(!ne)return;const V=ne.getBoundingClientRect(),Y=S.w/V.width,Q=S.h/V.height,re=S.x+(L.clientX-V.left)*Y,ae=S.y+(L.clientY-V.top)*Q;$.current.fx=re,$.current.fy=ae,(ee=O.current)==null||ee.alpha(.3).restart();return}if(E.current){const ne=(L.clientX-_.current.x)*(S.w/u.width),V=(L.clientY-_.current.y)*(S.h/u.height);N(Y=>({...Y,x:_.current.vx-ne,y:_.current.vy-V}))}},[S,u]),P=j.useCallback(()=>{E.current=!1,$.current&&($.current.fx=null,$.current.fy=null,$.current=null)},[]),z=j.useCallback((L,ee)=>{var ne;L.stopPropagation(),$.current=ee,(ne=O.current)==null||ne.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:`${S.x} ${S.y} ${S.w} ${S.h}`,style:{display:"block",cursor:E.current?"grabbing":"grab"},onWheel:M,onMouseDown:q,onMouseMove:G,onMouseUp:P,onMouseLeave:P,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:S.x-100,y:S.y-100,width:S.w+200,height:S.h+200,fill:"url(#grid)",pointerEvents:"none"}),m.links.map((L,ee)=>{const ne=B(L.source),V=B(L.target),Y=y===ee,Q=(ne.x+V.x)/2,re=(ne.y+V.y)/2;return c.jsxs("g",{children:[c.jsx("line",{x1:ne.x,y1:ne.y,x2:V.x,y2:V.y,stroke:"transparent",strokeWidth:12,style:{cursor:"default"},onMouseEnter:()=>b(ee),onMouseLeave:()=>b(null)}),c.jsx("line",{x1:ne.x,y1:ne.y,x2:V.x,y2:V.y,stroke:Y?"rgba(148,163,184,0.7)":"rgba(148,163,184,0.3)",strokeWidth:Y?2:1.5,strokeDasharray:"4 3",pointerEvents:"none"}),Y&&L.label&&c.jsx("text",{x:Q,y:re-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:L.label.length>30?L.label.slice(0,28)+"..":L.label})})]},ee)}),m.nodes.map(L=>{const ee=bs[L.category]??bs.general,ne=L.akb_type==="hub",V=ne?24:16,Y=(h==null?void 0:h.id)===L.id,Q=a===L.id,re=Y?1.2:Q?1.15:1;return c.jsxs("g",{transform:`translate(${L.x??0}, ${L.y??0}) scale(${re})`,style:{cursor:"pointer",transition:"transform 0.15s ease"},onClick:ae=>{ae.stopPropagation();const D=t.find(T=>T.id===L.id);D&&l(D)},onMouseDown:ae=>z(ae,L),onMouseEnter:ae=>{var T;g(L);const D=(T=i.current)==null?void 0:T.getBoundingClientRect();D&&k({x:ae.clientX-D.left,y:ae.clientY-D.top})},onMouseLeave:()=>g(null),children:[Q&&c.jsx("rect",{x:-V/2-4,y:-V/2-4,width:V+8,height:V+8,fill:"none",stroke:"#22c55e",strokeWidth:2,rx:ne?5:2,opacity:.6}),c.jsx("rect",{x:-V/2,y:-V/2,width:V,height:V,fill:ee.border,rx:ne?4:2,opacity:Y?1:.9}),c.jsx("rect",{x:-V/2+3,y:-V/2+3,width:Math.max(0,V-6),height:Math.max(0,V-6),fill:ee.bg,rx:ne?3:1}),c.jsx("text",{y:V/2+14,textAnchor:"middle",fill:Q?"#e2e8f0":"#94a3b8",fontSize:11,fontFamily:"monospace",fontWeight:Q?"bold":"normal",style:{pointerEvents:"none"},children:L.title.length>24?L.title.slice(0,22)+"..":L.title})]},L.id)})]}),h&&!$.current&&c.jsxs("div",{className:"absolute z-10 pointer-events-none p-2.5 rounded text-xs max-w-[240px]",style:{left:Math.min(v.x+16,u.width-250),top:Math.max(v.y-30,8),background:"var(--hud-bg)",border:"1px solid var(--terminal-border)",color:"var(--terminal-text)",boxShadow:"0 4px 12px rgba(0,0,0,0.4)"},children:[c.jsx("div",{className:"font-bold mb-1",children:h.title}),c.jsxs("div",{className:"text-[10px] opacity-60 mb-1",children:[h.akb_type.toUpperCase()," / ",h.category]}),((U=t.find(L=>L.id===h.id))==null?void 0:U.tldr)&&c.jsx("div",{className:"text-[10px] opacity-80 mb-1",children:t.find(L=>L.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 Cj({doc:t,allDocs:l,onOpen:a,onNavigateDoc:i}){const[o,u]=j.useState(!1),f=jj(t.category),m=t.akb_type==="hub",p=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,g)=>{const y=h.href.replace(/^.*knowledge\//,"").replace(/^\.\.\/.*$/,"").replace(/^\.\//,""),b=p.has(y);return c.jsxs("span",{className:`px-1.5 py-0.5 text-[9px] rounded ${b?"cursor-pointer hover:opacity-70":""}`,style:{background:b?"rgba(22,163,106,0.15)":"rgba(148,163,184,0.1)",color:b?"#4ade80":"var(--terminal-text-muted)",border:`1px solid ${b?"rgba(22,163,106,0.3)":"var(--terminal-border)"}`},onClick:v=>{b&&(v.stopPropagation(),i(y))},children:["🔗"," ",h.text]},g)})})]}),c.jsxs("button",{className:"mt-2 text-[10px] font-semibold cursor-pointer hover:opacity-70",style:{color:"var(--active-green)"},onClick:h=>{h.stopPropagation(),a(t)},children:["Open full ","→"]})]})]})}function Nj({docId:t,onBack:l,onDocUpdated:a,onDelete:i,onNavigateDoc:o,allDocs:u}){const[f,m]=j.useState(null),[p,h]=j.useState(!0),[g,y]=j.useState(!1),[b,v]=j.useState(""),[k,S]=j.useState(!1),N=new Set(u.map(B=>B.id)),E=j.useCallback(B=>{const M=B.split("#")[0];if(!M.match(/\.(md|html)$/))return null;const q=t.includes("/")?t.replace(/\/[^/]+$/,""):"";let G;if(M.startsWith("./"))G=q?`${q}/${M.slice(2)}`:M.slice(2);else if(M.startsWith("../")){const U=q.split("/").filter(Boolean);let L=M;for(;L.startsWith("../");)U.length>0&&U.pop(),L=L.slice(3);G=U.length>0?`${U.join("/")}/${L}`:L}else G=M;if(N.has(G))return G;const P=G.split("/").pop()??"",z=u.find(U=>U.id===P||U.id.endsWith("/"+P));return z?z.id:null},[t,N,u]),_=j.useCallback(B=>{const q=B.target.closest("a");if(!q)return;const G=q.getAttribute("href");if(!G||G.startsWith("http://")||G.startsWith("https://")||!G.match(/\.(md|html)(#.*)?$/))return;B.preventDefault(),B.stopPropagation();const P=E(G);P&&o(P)},[E,o]);j.useEffect(()=>{h(!0),Ae.getKnowledgeDoc(t).then(B=>{m(B),v(B.content)}).catch(console.error).finally(()=>h(!1))},[t]);const $=async()=>{if(f){S(!0);try{await Ae.updateKnowledgeDoc(t,b),m({...f,content:b}),y(!1),a()}catch(B){console.error("Save failed:",B)}finally{S(!1)}}},O=async()=>{if(confirm(`Delete "${f==null?void 0:f.title}"?`))try{await Ae.deleteKnowledgeDoc(t),i(t)}catch(B){console.error("Delete failed:",B)}};return p?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"}),g?c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>{y(!1),v(f.content)},className:"px-2.5 py-1 text-[10px] rounded cursor-pointer",style:{background:"var(--hud-bg-alt)",color:"var(--terminal-text-secondary)",border:"1px solid var(--terminal-border)"},children:"Cancel"}),c.jsx("button",{onClick:$,disabled:k,className:"px-2.5 py-1 text-[10px] rounded cursor-pointer font-semibold text-white",style:{background:k?"#86efac":"#16a34a"},children:k?"Saving...":"Save"})]}):c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>y(!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:O,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&&!g&&c.jsx("div",{className:"mb-3 text-xs italic",style:{color:"var(--terminal-text-secondary)"},children:f.tldr}),f.format==="html"?g?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:b,onChange:B=>v(B.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}):g?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:b,onChange:B=>v(B.target.value),spellCheck:!1}):c.jsx("div",{className:"text-xs leading-relaxed",style:{color:"var(--terminal-text-secondary)"},onClick:_,children:c.jsx(js,{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 Aj({onCreated:t,onCancel:l}){const[a,i]=j.useState(""),[o,u]=j.useState(""),[f,m]=j.useState(""),[p,h]=j.useState(!1),[g,y]=j.useState("");j.useEffect(()=>{if(!a){u("");return}const v=a.toLowerCase().replace(/[^a-z0-9가-힣\s-]/g,"").replace(/\s+/g,"-").slice(0,60);u(v)},[a]);const b=async()=>{if(!a.trim()||!o.trim()){y("Title and filename are required");return}h(!0),y("");try{const v=await Ae.createKnowledgeDoc({filename:o,title:a,category:f||void 0});t(v.id)}catch(v){y(v instanceof Error?v.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:a,onChange:v=>i(v.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:v=>u(v.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:v=>m(v.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)"}})]}),g&&c.jsx("div",{className:"text-[10px] px-3 py-1.5 rounded",style:{background:"rgba(239,68,68,0.15)",color:"#f87171"},children:g}),c.jsx("button",{onClick:b,disabled:p||!a.trim(),className:"w-full py-2 text-xs font-semibold rounded cursor-pointer text-white",style:{background:p?"#86efac":"#16a34a"},children:p?"Creating...":"Create Document"})]})]})}const Dj=500,l0=360,a0=700;function oh(t){const[l,a]=j.useState(Dj),[i,o]=j.useState(!1),u=j.useRef(0),f=j.useRef(0),m=t>0,p=m?t:0,h=m?Math.max(l0,window.innerWidth-t-100):a0,g=Math.min(l,h),y=j.useCallback(b=>{b.preventDefault(),u.current=b.clientX,f.current=g,o(!0);const v=S=>{const N=u.current-S.clientX,E=Math.min(a0,Math.max(l0,f.current+N));a(E)},k=()=>{o(!1),document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",k)};document.addEventListener("mousemove",v),document.addEventListener("mouseup",k)},[g]);return{panelRight:p,panelWidth:g,isResizing:i,handleResizeStart:y}}function Tj({docs:t,onClose:l,onRefresh:a,terminalWidth:i=0,initialDocId:o}){const[u,f]=j.useState("list"),[m,p]=j.useState("all"),[h,g]=j.useState(o??null),[y,b]=j.useState(""),[v,k]=j.useState(!1),[S,N]=j.useState(null),{panelRight:E,panelWidth:_,isResizing:$,handleResizeStart:O}=oh(i),B=["all",...Array.from(new Set(t.map(U=>U.category))).sort()],M=t.filter(U=>{if(m!=="all"&&U.category!==m)return!1;if(y){const L=y.toLowerCase();return U.title.toLowerCase().includes(L)||(U.tldr??"").toLowerCase().includes(L)||U.tags.some(ee=>ee.toLowerCase().includes(L))}return!0}),q=U=>{k(!1),a(),g(U)},G=U=>{g(null),a()},P=U=>{N(U.id)},z=S?t.find(U=>U.id===S):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:E},onClick:l}),c.jsxs("div",{className:`side-panel open fixed top-0 h-full z-50 flex flex-col border-l-[3px] shadow-[-4px_0_20px_rgba(0,0,0,0.4)] ${$?"resizing":""}`,style:{right:E,width:_,background:"var(--terminal-bg)",borderLeftColor:"#16a34a"},children:[c.jsx("div",{className:`absolute top-0 -left-[5px] w-[10px] h-full cursor-col-resize z-[60] transition-colors ${$?"bg-white/10":"hover:bg-white/5"}`,onMouseDown:O}),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(r0,{label:"List",active:u==="list",onClick:()=>{f("list"),N(null)}}),c.jsx(r0,{label:"Graph",active:u==="graph",onClick:()=>f("graph")})]}),u==="list"&&!h&&!v&&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:y,onChange:U=>b(U.target.value),placeholder:"Search docs...",className:"flex-1 px-2.5 py-1.5 text-[11px] rounded focus:outline-none",style:{background:"var(--hud-bg)",border:"1px solid var(--terminal-border)",color:"var(--terminal-text)"}}),c.jsx("button",{onClick:()=>k(!0),className:"px-2.5 py-1.5 text-[10px] font-semibold rounded cursor-pointer text-white shrink-0",style:{background:"#16a34a"},children:"+ New"})]}),c.jsx("div",{className:"flex overflow-x-auto shrink-0",style:{borderBottom:"1px solid var(--terminal-border)",scrollbarWidth:"none"},children:B.map(U=>c.jsx("button",{onClick:()=>p(U),className:"px-3 py-1.5 text-[10px] font-medium cursor-pointer whitespace-nowrap",style:{color:m===U?"#4ade80":"var(--terminal-text-muted)",borderBottom:m===U?"2px solid #4ade80":"2px solid transparent"},children:U==="all"?`All (${t.length})`:`${U} (${t.filter(L=>L.category===U).length})`},U))}),c.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:M.length===0?c.jsx("div",{className:"text-center text-xs py-8",style:{color:"var(--terminal-text-muted)"},children:y?"No matching documents":"No documents in this category"}):M.map(U=>c.jsx(Cj,{doc:U,allDocs:t,onOpen:L=>g(L.id),onNavigateDoc:L=>g(L)},U.id))})]}),u==="list"&&h&&!v&&c.jsx(Nj,{docId:h,onBack:()=>g(null),onDocUpdated:a,onDelete:G,onNavigateDoc:U=>g(U),allDocs:t}),u==="list"&&v&&c.jsx(Aj,{onCreated:q,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(Ej,{docs:t,onNodeClick:P,selectedDocId:S}),z&&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:z.title}),c.jsx("div",{className:"w-2 h-2 rounded-full mb-2",style:{background:z.status==="active"?"#16a34a":z.status==="draft"?"#f59e0b":"#94a3b8"}}),z.tldr&&c.jsx("div",{className:"text-[10px] mb-2 leading-relaxed",style:{color:"var(--terminal-text-secondary)"},children:z.tldr}),z.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"}),z.links.slice(0,5).map((U,L)=>c.jsxs("div",{className:"text-[9px] mb-0.5 truncate",style:{color:"var(--terminal-text-secondary)"},children:["🔗"," ",U.text]},L))]}),c.jsx("button",{className:"w-full py-1.5 text-[10px] font-semibold rounded cursor-pointer text-white",style:{background:"#16a34a"},onClick:()=>{f("list"),g(z.id),N(null)},children:"Open Document"})]})]}),c.jsx("div",{className:"shrink-0 p-2",style:{borderTop:"1px solid var(--terminal-border)"},children:c.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(bs).map(([U,L])=>c.jsxs("div",{className:"flex items-center gap-1 text-[9px]",children:[c.jsx("div",{className:"w-2 h-2",style:{background:L.border}}),c.jsx("span",{style:{color:"var(--terminal-text-muted)"},children:U})]},U))})})]})]})]})}function r0({label:t,active:l,onClick:a}){return c.jsx("button",{onClick:a,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 zj({standups:t,waves:l,decisions:a,mode:i,onClose:o,terminalWidth:u=0}){const[f,m]=j.useState(i==="decisions"?"decisions":"standups"),{panelRight:p,panelWidth:h,isResizing:g,handleResizeStart:y}=oh(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:p},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)] ${g?"resizing":""}`,style:{right:p,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 ${g?"bg-white/10":"hover:bg-white/5"}`,onMouseDown:y}),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(sd,{label:`Standups (${t.length})`,active:f==="standups",onClick:()=>m("standups")}),c.jsx(sd,{label:`Waves (${l.length})`,active:f==="waves",onClick:()=>m("waves")})]}):c.jsx(sd,{label:`Decisions (${a.length})`,active:f==="decisions",onClick:()=>m("decisions")})}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-5",children:[f==="standups"&&t.map((b,v)=>c.jsx(od,{title:`Standup ${b.date}`,content:b.content},v)),f==="waves"&&l.map((b,v)=>c.jsx(od,{title:`Wave ${b.id}`,subtitle:b.timestamp,content:b.content},v)),f==="decisions"&&a.map((b,v)=>c.jsx(od,{title:`#${b.id} ${b.title}`,subtitle:b.date,content:b.content},v))]})]})]})}function sd({label:t,active:l,onClick:a}){return c.jsx("button",{onClick:a,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 Mj(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 od({title:t,subtitle:l,content:a}){const[i,o]=j.useState(!1),u=a.length>100,f=Mj(a).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(js,{content:a})}),!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 _j({projectId:t,onClose:l,terminalWidth:a=0}){const[i,o]=j.useState(null),{panelRight:u,panelWidth:f,isResizing:m,handleResizeStart:p}=oh(a);if(j.useEffect(()=>{Ae.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(b=>b.status==="done").length,g=i.tasks.length,y=g>0?Math.round(h/g*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:p}),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: ",g]}),c.jsxs("span",{children:["Done: ",h]}),c.jsxs("span",{children:["Progress: ",y,"%"]})]}),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:`${y}%`}})})]}),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(js,{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 (",g,")"]}),c.jsx("div",{className:"space-y-2",children:i.tasks.map(b=>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:b.title}),c.jsx(Fj,{status:b.status})]}),c.jsx("div",{className:"text-xs mt-1",style:{color:"var(--terminal-text-muted)"},children:b.role}),b.description&&c.jsx("div",{className:"text-xs mt-1.5 line-clamp-2",style:{color:"var(--terminal-text-secondary)"},children:b.description})]},b.id))})]})]})]})]})}function Fj({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)"}},a=l[t]??l.todo;return c.jsx("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded-full",style:{background:a.bg,color:a.color},children:t})}const Rj={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C"};function Oj({roleId:t,roleName:l,mode:a="assign",onClose:i,onExecutionStart:o}){const[u,f]=j.useState(""),m=j.useRef(null);j.useEffect(()=>{var y;(y=m.current)==null||y.focus()},[]);const p=()=>{u.trim()&&(o(t,u.trim()),i())},h=y=>{y.key==="Enter"&&(y.metaKey||y.ctrlKey)&&p(),y.key==="Escape"&&i()},g=Rj[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, ${g}, ${g}cc)`},children:[c.jsx("div",{className:"text-lg font-bold",children:a==="ask"?"Ask":"Assign Task"}),c.jsx("div",{className:"text-sm opacity-80 mt-0.5",children:a==="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:y=>f(y.target.value),onKeyDown:h,placeholder:a==="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:p,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:g},children:a==="ask"?"Ask":"Assign"})]})]})]})}const i0={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C"};function Vy({event:t,isThinkingCollapsed:l,onToggleThinking:a,onNavigateToJob:i,onOpenKnowledgeDoc:o,compact:u}){var m;const f=i0[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 p=t.data.text??"";return c.jsxs("div",{className:"group",children:[c.jsxs("button",{onClick:a,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:[p.slice(0,u?200:500),p.length>(u?200:500)?"...":""]})]})}case"tool:start":{const p=String(t.data.name??""),h=t.data.input,g=typeof(h==null?void 0:h.command)=="string"?h.command.slice(0,80):"",y=typeof(h==null?void 0:h.file_path)=="string"?String(h.file_path):typeof(h==null?void 0:h.path)=="string"?String(h.path):"",b=y?y.split("/").pop()??"":"",v=/^(write_file|Write|edit_file|Edit)$/i.test(p),k=(m=y.match(/(?:^|\/)knowledge\/(.+\.md)$/))==null?void 0:m[1],S=v&&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] ${S?"text-green-400/80 bg-green-400/10":"text-blue-400/80 bg-blue-400/10"}`,children:S?v&&p.toLowerCase().includes("edit")?"Edit":"Write":p}),S?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:b}):c.jsxs(c.Fragment,{children:[g&&c.jsx("span",{className:`text-[var(--terminal-text-muted)] text-[10px] truncate ${u?"max-w-[200px]":"max-w-[400px]"}`,children:g}),b&&c.jsx("span",{className:`text-[var(--terminal-text-muted)] text-[10px] truncate ${u?"max-w-[200px]":"max-w-[400px]"}`,children:b})]})]})}case"dispatch:start":{const p=t.data.targetRoleId??t.data.roleId??"",h=t.data.task??"",g=t.data.childJobId,y=i0[p]??"#888";return c.jsx("div",{className:"my-1 p-2 rounded-lg border cursor-pointer hover:opacity-90 transition-opacity",style:{borderColor:`${y}44`,background:`${y}11`},onClick:()=>g&&(i==null?void 0:i(g)),children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("span",{style:{color:y},className:"font-bold text-[11px]",children:["→"," ",p.toUpperCase()]}),c.jsx("span",{className:"text-[var(--terminal-text-secondary)] text-[10px] truncate flex-1",children:h.slice(0,u?60:100)}),g&&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 p=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:[p," 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 Bj({jobId:t,title:l,color:a,variant:i,style:o,onClose:u,onMinimize:f,onDone:m,onNavigateToJob:p,onOpenKnowledgeDoc:h}){const{events:g,status:y,textOutput:b,childJobIds:v}=C0(t),[k,S]=j.useState(0),[N,E]=j.useState(new Set),_=j.useRef(null),$=j.useRef(Date.now()),O=j.useRef(!1);j.useEffect(()=>{const U=setInterval(()=>{S(Math.floor((Date.now()-$.current)/1e3))},1e3);return()=>clearInterval(U)},[]),j.useEffect(()=>{_.current&&(_.current.scrollTop=_.current.scrollHeight)},[g]),j.useEffect(()=>{(y==="done"||y==="error")&&!O.current&&(O.current=!0,m==null||m())},[y,m]);const B=U=>{E(L=>{const ee=new Set(L);return ee.has(U)?ee.delete(U):ee.add(U),ee})},M={idle:"Waiting",connecting:"Connecting...",streaming:"Working",done:"Complete",error:"Error"}[y],q={idle:"#888",connecting:"#888",streaming:a,done:"#2E7D32",error:"#C62828"}[y],G=U=>`${Math.floor(U/60)}:${String(U%60).padStart(2,"0")}`,P=y==="done"||y==="error",z=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:q}}),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:G(k)}),c.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full font-semibold",style:{background:`${q}22`,color:q},children:M}),f&&i==="modal"&&c.jsx("button",{onClick:f,title:"Minimize",className:"text-[var(--terminal-text-muted)] hover:text-[var(--terminal-text)] text-sm cursor-pointer px-1",children:"–"}),P&&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:_,className:"flex-1 overflow-y-auto p-4 space-y-1 text-xs font-mono",children:[g.length===0&&y==="connecting"&&c.jsx("div",{className:"text-[var(--terminal-text-muted)]",children:"Connecting to activity stream..."}),g.map(U=>c.jsx(Vy,{event:U,isThinkingCollapsed:N.has(U.seq),onToggleThinking:()=>B(U.seq),onNavigateToJob:p,onOpenKnowledgeDoc:h},U.seq)),y==="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:[g.length>0&&`${g.length} events`,b.length>0&&` · ${b.length} chars`,v.length>0&&` · ${v.length} dispatches`]}),P&&c.jsx("button",{onClick:u,className:"px-4 py-1.5 text-xs text-white rounded-lg font-semibold cursor-pointer",style:{background:a},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:P?u:void 0}),z]}):z}const cd={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C","data-analyst":"#0277BD"};function $j({orgNodes:t,rootId:l}){const a=t[l];if(!a)return null;const o=a.children.map(m=>t[m]).filter(Boolean),u=[];for(const m of o)for(const p of m.children){const h=t[p];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:cd[m.id]??"#888",color:cd[m.id]??"#888",background:`${cd[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 Lj({cLevelRoles:t,orgNodes:l,rootId:a,onClose:i,onDispatch:o}){const[u,f]=j.useState(""),m=j.useRef(null);j.useEffect(()=>{var y;(y=m.current)==null||y.focus()},[]);const p=()=>{!u.trim()||t.length===0||(o(u.trim()),i())},h=y=>{y.key==="Enter"&&(y.metaKey||y.ctrlKey)&&p(),y.key==="Escape"&&i()},g=a&&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:[g&&c.jsx($j,{orgNodes:l,rootId:a}),!g&&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(y=>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:[y.id.toUpperCase()," · ",y.name]},y.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:y=>f(y.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:p,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 Hj(t,l,a){const[i,o]=j.useState(new Map),[u,f]=j.useState(null),m=j.useRef(new Map),p=j.useRef(i);p.current=i,j.useEffect(()=>{if(!a||Object.keys(l).length===0)return;const b=new Map,v=S=>{const N=l[S];N&&(b.set(S,{jobId:null,roleId:S,roleName:N.name,children:N.children,status:"waiting",events:[],streamStatus:"idle"}),N.children.forEach(v))},k=l[a];k&&(b.set(a,{jobId:null,roleId:a,roleName:"CEO",children:k.children,status:"not-dispatched",events:[],streamStatus:"idle"}),k.children.forEach(v));for(const S of t){const N=b.get(S.roleId);N&&(N.jobId=S.jobId,N.status="running",N.streamStatus="connecting")}o(b),t.length>0&&f(t[0].roleId)},[t,l,a]);const h=j.useCallback((b,v)=>{const k=m.current.get(b);k&&k.controller.abort();const S=new AbortController,N={controller:S,lastSeq:-1};m.current.set(b,N);const _=`/api/jobs/${b}/stream?from=0`;fetch(_,{signal:S.signal}).then(async $=>{if(!$.ok||!$.body){o(q=>{const G=new Map(q),P=G.get(v);return P&&G.set(v,{...P,streamStatus:"error"}),G});return}o(q=>{const G=new Map(q),P=G.get(v);return P&&G.set(v,{...P,streamStatus:"streaming",status:"running"}),G});const O=$.body.getReader(),B=new TextDecoder;let M="";for(;;){const{done:q,value:G}=await O.read();if(q)break;M+=B.decode(G,{stream:!0});const P=M.split(`
80
+ `);M=P.pop()??"";let z="";for(const U of P)if(U.startsWith("event: "))z=U.slice(7).trim();else if(U.startsWith("data: ")){try{const L=JSON.parse(U.slice(6));if(z==="activity"){const ee=L;ee.seq>N.lastSeq&&(N.lastSeq=ee.seq),o(ne=>{const V=new Map(ne),Y=V.get(v);if(!Y||Y.events.some(re=>re.seq===ee.seq))return ne;const Q={...Y,events:[...Y.events,ee]};if(ee.type==="dispatch:start"&&ee.data.childJobId){const re=ee.data.childJobId,ae=ee.data.targetRoleId??ee.data.roleId;if(ae){const D=V.get(ae);D&&(V.set(ae,{...D,jobId:re,status:"running",streamStatus:"connecting"}),setTimeout(()=>h(re,ae),0))}}return ee.type==="job:done"?(Q.status="done",Q.streamStatus="done"):ee.type==="job:error"&&(Q.status="error",Q.streamStatus="error"),V.set(v,Q),V})}else if(z==="stream:end"){const ee=L.reason;o(ne=>{const V=new Map(ne),Y=V.get(v);if(!Y)return ne;const Q=ee==="error"?"error":"done";return V.set(v,{...Y,status:Y.status==="running"?Q:Y.status,streamStatus:Q==="error"?"error":"done"}),V})}}catch{}z=""}}}).catch($=>{$.name!=="AbortError"&&o(O=>{const B=new Map(O),M=B.get(v);return M&&B.set(v,{...M,streamStatus:"error"}),B})})},[]);j.useEffect(()=>{if(t.length!==0){for(const b of t)h(b.jobId,b.roleId);return()=>{for(const[,b]of m.current)b.controller.abort();m.current.clear()}}},[t,h]);const g=(()=>{let b=0,v=0,k=0;for(const[S,N]of i)S!==a&&(k++,N.status==="done"?b++:N.status==="running"&&v++);return{done:b,total:k,running:v}})(),y=g.total>0&&g.running===0&&Array.from(i.values()).every(b=>b.status!=="running"&&b.streamStatus!=="streaming"&&b.streamStatus!=="connecting");return j.useEffect(()=>{y&&o(b=>{const v=new Map(b);let k=!1;for(const[S,N]of v)N.status==="waiting"&&(v.set(S,{...N,status:"not-dispatched"}),k=!0);return k?v:b})},[y]),{nodes:i,selectedRoleId:u,selectNode:f,progress:g,allDone:y}}const s0={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C","data-analyst":"#0277BD"},Wa=120,Il=44,o0=80;function Uj(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:g,depth:y,parentId:b}=u.shift();if(f.has(g))continue;for(f.add(g);o.length<=y;)o.push([]);o[y].push(g),i.push({roleId:g,x:0,y:y*o0+20,parentId:b});const v=t.get(g);if(v)for(const k of v.children)t.has(k)&&!f.has(k)&&u.push({id:k,depth:y+1,parentId:g})}const m=Math.max(...o.map(g=>g.length))*(Wa+16),p=Math.max(m,280);for(const g of o){const y=g.length*(Wa+16)-16,b=(p-y)/2;g.forEach((v,k)=>{const S=i.find(N=>N.roleId===v);S&&(S.x=b+k*(Wa+16))})}const h=o.length*o0+40;return{layout:i,width:p,height:h}}function Yj({nodes:t,rootId:l,selectedRoleId:a,onSelectNode:i}){const{layout:o,width:u,height:f}=Uj(t,l),m=h=>{const g=o.find(y=>y.roleId===h);return g?{cx:g.x+Wa/2,cy:g.y+Il/2}:{cx:0,cy:0}},p=h=>{switch(h.status){case"running":return s0[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 g=m(h.parentId),y=m(h.roleId),b=t.get(h.roleId),v=t.get(h.parentId);let k="rgba(180,200,240,0.15)",S="4 4",N="";return(b==null?void 0:b.status)==="done"||(v==null?void 0:v.status)==="done"?(k="#2E7D3266",S=""):(b==null?void 0:b.status)==="running"&&(k=s0[h.roleId]??"#FBBF24",S="6 4",N="wave-edge-flow"),c.jsx("line",{x1:g.cx,y1:g.cy+Il/2-4,x2:y.cx,y2:y.cy-Il/2+4,stroke:k,strokeWidth:1.5,strokeDasharray:S,className:N},`${h.parentId}-${h.roleId}`)}),o.map(h=>{const g=t.get(h.roleId);if(!g)return null;const y=p(g),b=a===h.roleId,v=h.roleId===l,k=v?.4:g.status==="not-dispatched"?.35:1;return c.jsxs("g",{transform:`translate(${h.x}, ${h.y})`,style:{cursor:v?"default":"pointer",opacity:k},onClick:()=>!v&&i(h.roleId),children:[c.jsx("rect",{x:0,y:0,width:Wa,height:Il,rx:8,ry:8,fill:"var(--terminal-bg-deeper, #181825)",stroke:b?"#fff":y,strokeWidth:b?2:1.5,strokeDasharray:g.status==="not-dispatched"?"4 3":""}),c.jsx("circle",{cx:14,cy:Il/2,r:4,fill:y,filter:g.status==="running"?"url(#glow)":void 0,children:g.status==="running"&&c.jsx("animate",{attributeName:"opacity",values:"1;0.4;1",dur:"1.5s",repeatCount:"indefinite"})}),c.jsx("text",{x:26,y:Il/2-4,fill:"var(--terminal-text, #fff)",fontSize:10,fontWeight:700,fontFamily:"var(--pixel-font)",children:g.roleId.toUpperCase()}),c.jsx("text",{x:26,y:Il/2+10,fill:"var(--terminal-text-muted, #888)",fontSize:8,fontFamily:"var(--pixel-font)",children:g.status==="running"?"Working...":g.status==="done"?"Complete":g.status==="error"?"Error":g.status==="waiting"?"Waiting":""}),g.status==="done"&&c.jsx("text",{x:Wa-18,y:Il/2+4,fontSize:14,fill:"#2E7D32",children:"✓"}),g.status==="error"&&c.jsx("text",{x:Wa-18,y:Il/2+4,fontSize:14,fill:"#C62828",children:"✗"})]},h.roleId)})]})}const Ij={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C","data-analyst":"#0277BD"};function qj({directive:t,rootJobs:l,orgNodes:a,rootRoleId:i,onClose:o,onMinimize:u,onDone:f,onOpenKnowledgeDoc:m}){const{nodes:p,selectedRoleId:h,selectNode:g,progress:y,allDone:b}=Hj(l,a,i),[v,k]=j.useState(0),[S,N]=j.useState(new Set),E=j.useRef(null),_=j.useRef(Date.now()),$=j.useRef(!1);j.useEffect(()=>{const G=setInterval(()=>{k(Math.floor((Date.now()-_.current)/1e3))},1e3);return()=>clearInterval(G)},[]),j.useEffect(()=>{E.current&&(E.current.scrollTop=E.current.scrollHeight)},[h,p]),j.useEffect(()=>{b&&!$.current&&($.current=!0,f==null||f())},[b,f]);const O=G=>`${Math.floor(G/60)}:${String(G%60).padStart(2,"0")}`,B=h?p.get(h):null,M=h?Ij[h]??"#888":"#888",q=G=>{N(P=>{const z=new Set(P);return z.has(G)?z.delete(G):z.add(G),z})};return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 bg-black/40 z-[60] backdrop-blur-sm",onClick:b?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:b?"#2E7D32":"#B71C1C",animation:b?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:b?"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:O(v)}),c.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full font-semibold",style:{background:b?"#2E7D3222":"#B71C1C22",color:b?"#2E7D32":"#B71C1C"},children:[y.done,"/",y.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:"–"}),b&&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(Yj,{nodes:p,rootId:i,selectedRoleId:h,onSelectNode:g})}),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(G=>c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"w-2 h-2 rounded-full inline-block",style:{background:G.color,animation:G.dot?"wave-pulse 1.5s ease-in-out infinite":void 0}}),c.jsx("span",{className:"text-[8px] text-[var(--terminal-text-muted)]",children:G.label})]},G.label))})]}),c.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[B&&c.jsxs("div",{className:"px-4 py-2 border-b border-[var(--terminal-border)] shrink-0 flex items-center gap-2",children:[c.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:M}}),c.jsx("span",{className:"text-[var(--terminal-text)] font-bold text-xs",children:B.roleId.toUpperCase()}),c.jsx("span",{className:"text-[var(--terminal-text-muted)] text-xs",children:B.roleName}),c.jsx("span",{className:"ml-auto text-[10px] px-2 py-0.5 rounded-full font-semibold",style:{background:`${M}22`,color:M},children:B.status==="running"?"Working":B.status==="done"?"Complete":B.status==="error"?"Error":B.status==="waiting"?"Waiting":"Not dispatched"})]}),c.jsxs("div",{ref:E,className:"flex-1 overflow-y-auto p-4 space-y-1 text-xs font-mono",children:[B&&B.events.length===0&&c.jsx("div",{className:"text-[var(--terminal-text-muted)]",children:B.status==="waiting"?"Waiting for dispatch...":B.status==="running"?"Connecting to activity stream...":B.status==="not-dispatched"?"This role was not dispatched in this wave.":""}),B==null?void 0:B.events.map(G=>c.jsx(Vy,{event:G,isThinkingCollapsed:S.has(G.seq),onToggleThinking:()=>q(G.seq),onNavigateToJob:P=>{for(const[,z]of p)if(z.jobId===P){g(z.roleId);return}},onOpenKnowledgeDoc:m},G.seq)),(B==null?void 0:B.status)==="running"&&c.jsx("span",{className:"inline-block w-2 h-4 bg-green-400 animate-pulse ml-0.5"})]}),!B&&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:B&&B.events.length>0&&`${B.events.length} events`}),b&&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 Xj={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 ch(t){return Xj[t]??{skinColor:"#B0BEC5",hairColor:"#78909C",shirtColor:"#607D8B",pantsColor:"#455A64",shoeColor:"#37474F"}}const Gy=["#FDEBD0","#F5CBA7","#D4A07A","#C68642","#8D5524","#5C3A1E","#F3D1C7","#E8BEAC","#B07D62","#704214"],Ky=["#1A0A00","#2C1810","#4E342E","#6D4C41","#8D6E63","#D4A574","#F5E6CA","#FFD700","#B71C1C","#AD1457","#4A148C","#1A237E","#004D40","#1A1A1A","#78909C","#E0E0E0"],Qy=["#1565C0","#E65100","#2E7D32","#4A148C","#AD1457","#00695C","#D32F2F","#F57F17","#1B5E20","#283593","#4E342E","#37474F","#880E4F","#00838F","#6A1B9A","#FF6F00"],Zy=["#37474F","#1A237E","#3E2723","#263238","#1B5E20","#455A64","#212121","#4E342E","#0D47A1","#311B92"],Wy=["#212121","#1A1A1A","#37474F","#4E342E","#7B1FA2","#D32F2F","#1565C0","#F57F17","#2E7D32","#FFFFFF"],Ea={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 Vj({color:t,selected:l,onClick:a}){return c.jsx("button",{onClick:a,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 as({label:t,presets:l,value:a,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:a}})]}),c.jsx("div",{className:"customize-swatches",children:l.map(o=>c.jsx(Vj,{color:o,selected:o===a,onClick:()=>i(o)},o))})]})}function ud({label:t,items:l,value:a,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===a?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===a?"rgba(255,255,255,0.15)":"rgba(255,255,255,0.04)",outline:o.id===a?"2px solid #fff":"2px solid transparent",color:o.id===a?"#fff":"rgba(255,255,255,0.5)",borderRadius:4},children:o.name},o.id))})]})}function fd({label:t,active:l,onClick:a}){return c.jsx("button",{onClick:a,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 wa(t){return t[Math.floor(Math.random()*t.length)]}function cs(){var i,o,u;const t=Oy(),l=By(),a=$y();return{skinColor:wa(Gy),hairColor:wa(Ky),shirtColor:wa(Qy),pantsColor:wa(Zy),shoeColor:wa(Wy),hairStyle:(i=wa(t))==null?void 0:i.id,outfitStyle:(o=wa(l))==null?void 0:o.id,accessory:(u=wa(a))==null?void 0:u.id}}function Jy({roleId:t,appearance:l,onChange:a,onRandomize:i,onReset:o,label:u}){const[f,m]=j.useState("look"),p=j.useCallback((k,S)=>{a({...l,[k]:S})},[l,a]),h=j.useRef(null),g=j.useCallback(k=>{var E;const S=(E=k.target.files)==null?void 0:E[0];if(!S)return;const N=new Image;N.onload=()=>{const _=pS(N);a({..._,hairStyle:l.hairStyle,outfitStyle:l.outfitStyle,accessory:l.accessory}),URL.revokeObjectURL(N.src)},N.src=URL.createObjectURL(S),k.target.value=""},[l.hairStyle,l.outfitStyle,l.accessory,a]),y=Oy(),b=By(),v=$y();return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"customize-preview",children:[c.jsx("div",{className:"customize-preview-bg",children:c.jsx(Sc,{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:g,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(fd,{label:"LOOK",active:f==="look",onClick:()=>m("look")}),c.jsx(fd,{label:"OUTFIT",active:f==="outfit",onClick:()=>m("outfit")}),c.jsx(fd,{label:"ACCESSORY",active:f==="accessory",onClick:()=>m("accessory")})]}),f==="look"&&c.jsxs(c.Fragment,{children:[c.jsx(as,{label:"SKIN",presets:Gy,value:l.skinColor,onChange:k=>p("skinColor",k)}),c.jsx(as,{label:"HAIR COLOR",presets:Ky,value:l.hairColor,onChange:k=>p("hairColor",k)}),c.jsx(ud,{label:"HAIR STYLE",items:y,value:l.hairStyle,onChange:k=>p("hairStyle",k)})]}),f==="outfit"&&c.jsxs(c.Fragment,{children:[c.jsx(ud,{label:"STYLE",items:b,value:l.outfitStyle,onChange:k=>p("outfitStyle",k)}),c.jsx(as,{label:"TOP",presets:Qy,value:l.shirtColor,onChange:k=>p("shirtColor",k)}),c.jsx(as,{label:"PANTS",presets:Zy,value:l.pantsColor,onChange:k=>p("pantsColor",k)}),c.jsx(as,{label:"SHOES",presets:Wy,value:l.shoeColor,onChange:k=>p("shoeColor",k)})]}),f==="accessory"&&c.jsxs(c.Fragment,{children:[c.jsx(ud,{label:"ACCESSORY",items:v,value:l.accessory,onChange:k=>p("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 Gj=[{value:"c-level",label:"C-Level"},{value:"team-lead",label:"Team Lead"},{value:"member",label:"Member"}];function Py(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,24)}function c0(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 rs=4;function Kj(t,l,a){const i=t.trim();if(!i||i.startsWith("#"))return null;const o=i.split(",").map(y=>y.trim()),u=o[0];if(!u)return null;const f=Py(u),m=(o[1]||"member").toLowerCase(),p=m==="c-level"?"c-level":m==="team-lead"?"team-lead":"member",h=o[2]||"ceo";let g;return l.has(f)?g="ID already exists":a.has(f)&&(g="Duplicate ID in batch"),a.add(f),{name:u,id:f,level:p,reportsTo:h,error:g}}function Qj({existingRoles:t,onClose:l,onHire:a}){const[i,o]=j.useState("single"),[u,f]=j.useState(1),[m,p]=j.useState(""),[h,g]=j.useState(""),[y,b]=j.useState(!1),[v,k]=j.useState("member"),[S,N]=j.useState("ceo"),[E,_]=j.useState(""),[$,O]=j.useState(cs),[B,M]=j.useState(!1),[q,G]=j.useState(""),[P,z]=j.useState([]),[U,L]=j.useState(new Set),[ee,ne]=j.useState(""),[V,Y]=j.useState("input"),[Q,re]=j.useState({done:0,total:0}),ae=j.useRef(null),D=j.useRef(null),T=j.useRef(null);j.useEffect(()=>{Ae.getSkills().then(me=>z(me.filter(Ee=>Ee.installed))).catch(()=>{})},[]),j.useEffect(()=>{var me,Ee,qe;i==="single"?(u===1&&((me=ae.current)==null||me.focus()),u===2&&((Ee=D.current)==null||Ee.focus())):V==="input"&&((qe=T.current)==null||qe.focus())},[u,i,V]);const X=j.useMemo(()=>new Set(t.map(me=>me.id)),[t]),A=j.useMemo(()=>{const me=ee.split(`
81
+ `),Ee=new Set;return me.map(qe=>Kj(qe,X,Ee)).filter(qe=>qe!==null)},[ee,X]),se=A.length>0&&A.every(me=>!me.error),de=me=>{p(me),y||g(Py(me))},he=m.trim().length>0&&h.trim().length>0&&!t.some(me=>me.id===h),we=E.trim().length>0,Ce=async()=>{M(!0),G("");const me=c0(v);try{await a({id:h,name:m.trim(),level:v,reportsTo:S,persona:E.trim(),...me,skills:U.size>0?[...U]:void 0},$),l()}catch(Ee){G(Ee instanceof Error?Ee.message:"Failed to create role"),M(!1)}},Oe=me=>me===1?he:me===2?we:!0,pe=async()=>{M(!0),G(""),re({done:0,total:A.length});try{for(let me=0;me<A.length;me++){const Ee=A[me],qe=c0(Ee.level),Mt=cs(),mt=`${Ee.name}. A ${Ee.level} role reporting to ${Ee.reportsTo}.`;await a({id:Ee.id,name:Ee.name,level:Ee.level,reportsTo:Ee.reportsTo,persona:mt,...qe},Mt),re({done:me+1,total:A.length})}l()}catch(me){G(me instanceof Error?me.message:"Failed to create roles"),M(!1)}},Ke=me=>{me.key==="Escape"&&l(),me.key==="Enter"&&(me.metaKey||me.ctrlKey)&&(i==="single"?u<rs&&Oe(u)?f(u+1):u===rs&&Ce():V==="input"&&se?Y("review"):V==="review"&&pe())},lt=t.some(me=>me.id===h)&&h.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] max-h-[90vh] z-[61] bg-[var(--wall)] rounded-2xl shadow-2xl overflow-hidden flex flex-col",onKeyDown:Ke,children:[c.jsxs("div",{className:"p-5 text-white",style:{background:"linear-gradient(135deg, #2E7D32, #43A047)"},children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"text-lg font-bold",children:"Hire New Role"}),c.jsxs("div",{className:"flex bg-black/20 rounded-lg p-0.5",children:[c.jsx("button",{onClick:()=>{o("single"),G("")},className:`px-3 py-1 text-xs font-semibold rounded-md cursor-pointer transition-colors ${i==="single"?"bg-white/20 text-white":"text-white/50 hover:text-white/70"}`,children:"Single"}),c.jsx("button",{onClick:()=>{o("bulk"),G("")},className:`px-3 py-1 text-xs font-semibold rounded-md cursor-pointer transition-colors ${i==="bulk"?"bg-white/20 text-white":"text-white/50 hover:text-white/70"}`,children:"Bulk"})]})]}),c.jsx("div",{className:"text-sm opacity-80 mt-0.5",children:i==="single"?`Step ${u} of ${rs}`:V==="input"?"Enter roles, one per line":`Review ${A.length} roles`})]}),i==="single"&&c.jsx("div",{className:"flex gap-1 px-5 pt-4",children:Array.from({length:rs},(me,Ee)=>Ee+1).map(me=>c.jsx("div",{className:"flex-1 h-1 rounded-full transition-colors",style:{background:me<=u?"#2E7D32":"rgba(255,255,255,0.1)"}},me))}),c.jsx("div",{className:"p-5 min-h-[240px] overflow-y-auto flex-1",children:i==="single"?c.jsxs(c.Fragment,{children:[u===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:ae,value:m,onChange:me=>de(me.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:h,onChange:me=>{g(me.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),b(!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 ${lt?"border-red-400":"border-white/10 focus:border-white/25"}`}),lt&&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:Gj.map(me=>c.jsx("button",{onClick:()=>k(me.value),className:`flex-1 p-2 text-xs font-semibold rounded-lg border cursor-pointer transition-colors ${v===me.value?"border-green-600 bg-green-900/30 text-green-400":"border-white/10 text-white/50 hover:border-white/20"}`,children:me.label},me.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:S,onChange:me=>N(me.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(me=>c.jsxs("option",{value:me.id,className:"bg-[var(--wall)] text-white",children:[me.name," (",me.id,")"]},me.id))]})]})]}),u===2&&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-2",children:"Persona"}),c.jsx("textarea",{ref:D,value:E,onChange:me=>_(me.target.value),placeholder:"Describe this role's personality, expertise, and working style...",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-gray-400 mt-1",children:"This defines how the AI agent will behave in this role"})]}),P.length>0&&c.jsxs("div",{children:[c.jsx("label",{className:"block text-[11px] font-bold text-[var(--desk-dark)] uppercase tracking-wider mb-2",children:"Skills"}),c.jsx("div",{className:"space-y-1.5 max-h-[120px] overflow-y-auto",children:P.map(me=>c.jsxs("label",{className:"flex items-center gap-2 p-2 rounded-lg border border-white/10 bg-white/5 cursor-pointer hover:border-white/20 transition-colors",children:[c.jsx("input",{type:"checkbox",checked:U.has(me.id),onChange:()=>L(Ee=>{const qe=new Set(Ee);return qe.has(me.id)?qe.delete(me.id):qe.add(me.id),qe}),className:"accent-green-600"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"text-xs font-semibold text-white/80",children:me.name}),c.jsx("div",{className:"text-[10px] text-white/40 truncate",children:me.description})]})]},me.id))})]})]}),u===3&&c.jsx("div",{className:"customize-body",style:{padding:0},children:c.jsx(Jy,{roleId:"default",appearance:$,onChange:O,onRandomize:()=>O(cs()),onReset:()=>O(cs()),label:c.jsxs("span",{children:[h||"new-role"," — ",m||"New Role"]})})}),u===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(Sc,{roleId:"default",appearance:$,scale:4})}),c.jsxs("div",{className:"flex-1 space-y-2.5",children:[c.jsx(is,{label:"Name",value:m}),c.jsx(is,{label:"ID",value:h,mono:!0}),c.jsx(is,{label:"Level",value:v}),c.jsx(is,{label:"Reports To",value:S}),U.size>0&&c.jsx(is,{label:"Skills",value:[...U].join(", ")})]})]}),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})]})]}),q&&c.jsx("div",{className:"text-xs text-red-400 bg-red-900/20 p-2 rounded-lg border border-red-800/30",children:q})]})]}):c.jsxs(c.Fragment,{children:[V==="input"&&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-2",children:"Roles (one per line)"}),c.jsx("textarea",{ref:T,value:ee,onChange:me=>ne(me.target.value),placeholder:`Name, Level, ReportsTo
82
+ e.g.
83
+ Data Analyst
84
+ DevOps Engineer, member, cto
85
+ VP Marketing, c-level, ceo`,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 font-mono"}),c.jsx("div",{className:"text-[10px] text-gray-400 mt-1",children:"Format: Name, Level (member/team-lead/c-level), ReportsTo. Level and ReportsTo are optional."})]}),A.length>0&&c.jsxs("div",{children:[c.jsxs("div",{className:"text-[11px] font-bold text-[var(--desk-dark)] uppercase tracking-wider mb-2",children:["Preview (",A.length," role",A.length!==1?"s":"",")"]}),c.jsx("div",{className:"bg-white/5 rounded-lg border border-white/10 overflow-hidden",children:c.jsxs("table",{className:"w-full text-xs",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-white/10",children:[c.jsx("th",{className:"text-left p-2 text-white/40 font-semibold",children:"Name"}),c.jsx("th",{className:"text-left p-2 text-white/40 font-semibold",children:"ID"}),c.jsx("th",{className:"text-left p-2 text-white/40 font-semibold",children:"Level"}),c.jsx("th",{className:"text-left p-2 text-white/40 font-semibold",children:"Reports To"})]})}),c.jsx("tbody",{children:A.map((me,Ee)=>c.jsxs("tr",{className:`border-b border-white/5 ${me.error?"bg-red-900/10":""}`,children:[c.jsx("td",{className:"p-2 text-white/80",children:me.name}),c.jsx("td",{className:"p-2 text-white/60 font-mono",children:me.id}),c.jsx("td",{className:"p-2 text-white/60",children:me.level}),c.jsx("td",{className:"p-2 text-white/60",children:me.reportsTo}),me.error&&c.jsx("td",{className:"p-2 text-red-400 text-[10px]",children:me.error})]},Ee))})]})})]})]}),V==="review"&&c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"text-[11px] font-bold text-[var(--desk-dark)] uppercase tracking-wider mb-2",children:["Confirm Bulk Hire — ",A.length," roles"]}),c.jsx("div",{className:"bg-white/5 rounded-lg border border-white/10 overflow-hidden max-h-[300px] overflow-y-auto",children:c.jsxs("table",{className:"w-full text-xs",children:[c.jsx("thead",{className:"sticky top-0 bg-[var(--wall)]",children:c.jsxs("tr",{className:"border-b border-white/10",children:[c.jsx("th",{className:"text-left p-2 text-white/40 font-semibold",children:"#"}),c.jsx("th",{className:"text-left p-2 text-white/40 font-semibold",children:"Name"}),c.jsx("th",{className:"text-left p-2 text-white/40 font-semibold",children:"ID"}),c.jsx("th",{className:"text-left p-2 text-white/40 font-semibold",children:"Level"}),c.jsx("th",{className:"text-left p-2 text-white/40 font-semibold",children:"Reports To"})]})}),c.jsx("tbody",{children:A.map((me,Ee)=>c.jsxs("tr",{className:"border-b border-white/5",children:[c.jsx("td",{className:"p-2 text-white/30",children:Ee+1}),c.jsx("td",{className:"p-2 text-white/80",children:me.name}),c.jsx("td",{className:"p-2 text-white/60 font-mono",children:me.id}),c.jsx("td",{className:"p-2 text-white/60",children:me.level}),c.jsx("td",{className:"p-2 text-white/60",children:me.reportsTo})]},Ee))})]})}),B&&Q.total>0&&c.jsxs("div",{children:[c.jsxs("div",{className:"flex justify-between text-[10px] text-white/40 mb-1",children:[c.jsx("span",{children:"Hiring..."}),c.jsxs("span",{children:[Q.done,"/",Q.total]})]}),c.jsx("div",{className:"h-1.5 bg-white/10 rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Q.done/Q.total*100}%`,background:"#2E7D32"}})})]}),c.jsx("div",{className:"text-[10px] text-white/30",children:"Each role will get a random appearance and auto-generated persona. You can customize them later."}),q&&c.jsx("div",{className:"text-xs text-red-400 bg-red-900/20 p-2 rounded-lg border border-red-800/30",children:q})]})]})}),c.jsxs("div",{className:"flex justify-between px-5 pb-5",children:[c.jsxs("div",{children:[i==="single"&&u>1&&c.jsx("button",{onClick:()=>f(u-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"}),i==="bulk"&&V==="review"&&c.jsx("button",{onClick:()=>Y("input"),disabled:B,className:"px-4 py-2 text-sm rounded-lg border border-white/15 text-white/60 hover:bg-white/5 cursor-pointer disabled:opacity-40",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==="single"?u<rs?c.jsx("button",{onClick:()=>f(u+1),disabled:!Oe(u),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:Ce,disabled:B,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:B?"Hiring...":"HIRE"}):V==="input"?c.jsxs("button",{onClick:()=>Y("review"),disabled:!se,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:["Review (",A.length,")"]}):c.jsx("button",{onClick:pe,disabled:B,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:B?`Hiring ${Q.done}/${Q.total}...`:`HIRE ALL (${A.length})`})]})]})]})]})}function is({label:t,value:l,mono:a}){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 ${a?"font-mono":""}`,children:l})]})}function Zj({roleId:t,roleName:l,onClose:a,onConfirm:i}){const[o,u]=j.useState(!1),f=async()=>{u(!0);try{await i(t)}finally{u(!1)}};return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 bg-black/40 z-[60] backdrop-blur-sm",onClick:a}),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:a,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 Wj={cto:"🏗️",cbo:"📊",pm:"📋",engineer:"⚙️",designer:"🎨",qa:"🔍"};function Jj({roleId:t,title:l,roleColor:a,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 ${a}`}:void 0,children:[c.jsx("span",{className:"text-xs",children:Wj[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 Pj({content:t,streaming:l}){let a=t;return l&&(t.match(/```/g)??[]).length%2!==0&&(a+="\n```"),c.jsx("div",{className:"terminal-markdown",children:c.jsx(oy,{remarkPlugins:[My],components:{code:eE,table:({children:i})=>c.jsx("div",{className:"overflow-x-auto my-2",children:c.jsx("table",{className:"terminal-table",children:i})})},children:a})})}function eE({className:t,children:l,...a}){const i=/language-(\w+)/.exec(t??"");return i||typeof l=="string"&&l.includes(`
86
+ `)?c.jsx(tE,{language:i==null?void 0:i[1],children:l}):c.jsx("code",{className:"terminal-inline-code",...a,children:l})}function tE({children:t,language:l}){const[a,i]=j.useState(!1),o=String(t).replace(/\n$/,""),u=()=>{navigator.clipboard.writeText(o),i(!0),setTimeout(()=>i(!1),1500)};return c.jsxs("div",{className:"terminal-code-block group relative my-2",children:[l&&c.jsx("div",{className:"text-[10px] text-[var(--terminal-text-muted)] px-3 pt-1.5",children:l}),c.jsx("button",{onClick:u,className:"absolute top-1.5 right-2 text-[10px] text-[var(--terminal-text-muted)] hover:text-[var(--terminal-text-secondary)] opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",children:a?"Copied!":"Copy"}),c.jsx("pre",{className:"overflow-x-auto p-3 text-xs leading-relaxed",children:c.jsx("code",{children:o})})]})}const nE={cto:"🏗️",cbo:"📊",pm:"📋",engineer:"⚙️",designer:"🎨",qa:"🔍"};function dd(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 lE(t){const l=[];let a="";for(const i of t)if(i.type==="thinking")i.text&&(a=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:dd(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=dd(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?dd(i.toolName,i.toolInput):void 0})}if(a){const i=l.filter(o=>o.type==="thinking");i.length>0&&(i[i.length-1].text=a)}return l}function aE({event:t,isStreaming:l}){var o,u,f;const[a,i]=j.useState(!1);switch(t.type){case"thinking":return c.jsxs("div",{className:"stream-event-thinking",children:[c.jsxs("div",{className:"stream-event-thinking-header",onClick:()=>i(!a),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:a?"▾":"▸"})]}),(l||a)&&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(!a),children:a?"▾":"▸"}),a&&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 rE({events:t,isStreaming:l}){const[a,i]=j.useState(!1);if(t.length===0)return null;const o=lE(t);if(o.length===0)return null;const u=t.filter(b=>b.type==="thinking").length,f=t.filter(b=>b.type==="tool"),m=t.filter(b=>b.type==="dispatch"||b.type==="dispatch:progress"),p=t.filter(b=>b.type==="turn").reduce((b,v)=>Math.max(b,v.turn??0),0),h=[];if(u>0&&h.push("thinking"),f.length>0){const b=[...new Set(f.map(v=>v.toolName))];b.length<=3?h.push(b.join(", ")):h.push(`${f.length} tool calls`)}m.length>0&&h.push(`${m.length} dispatch`),p>1&&h.push(`${p} turns`);const g=h.join(" · "),y=!a;return c.jsxs("div",{className:"stream-activity-log",children:[c.jsxs("div",{className:"stream-activity-header",onClick:()=>i(!a),children:[l&&c.jsx("span",{className:"stream-activity-pulse"}),c.jsxs("span",{className:"stream-activity-summary",children:[a?"▸":"▾"," ",g,l?"...":""]})]}),y&&c.jsx("div",{className:"stream-activity-events",children:o.map((b,v)=>c.jsx(aE,{event:b,isStreaming:l&&v===o.length-1},v))})]})}function iE({message:t,roleId:l,roleColor:a}){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,p=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:`${a}33`},children:nE[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(rE,{events:t.streamEvents,isStreaming:u}),m&&!f&&c.jsxs("details",{open:p,className:"mb-1",children:[c.jsxs("summary",{className:"text-[10px] text-purple-400/70 cursor-pointer select-none flex items-center gap-1",children:[p&&c.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-purple-400 animate-pulse"}),"thinking",p?"...":` (${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 ${a}`,background:"var(--terminal-surface)"},children:[t.content?c.jsx(Pj,{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 sE({messages:t,roleId:l,roleColor:a}){var o;const i=j.useRef(null);return j.useEffect(()=>{var u;(u=i.current)==null||u.scrollIntoView({behavior:"smooth"})},[t,(o=t[t.length-1])==null?void 0:o.content]),t.length===0?c.jsxs("div",{className:"flex-1 flex items-center justify-center text-[var(--terminal-text-muted)] text-sm",children:["Start a conversation with ",l.toUpperCase()]}):c.jsxs("div",{className:"flex-1 overflow-y-auto p-4 terminal-scrollbar",children:[t.map(u=>c.jsx(iE,{message:u,roleId:l,roleColor:a},u.id)),c.jsx("div",{ref:i})]})}function oE({mode:t,onModeChange:l,onSend:a,disabled:i,disabledReason:o}){const[u,f]=j.useState(""),m=j.useRef(null);j.useEffect(()=>{const g=m.current;g&&(g.style.height="0",g.style.height=Math.min(g.scrollHeight,120)+"px")},[u]);const p=()=>{const g=u.trim();!g||i||(a(g),f(""))},h=g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),p())};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:g=>f(g.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:p,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 cE={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C","data-analyst":"#0277BD"},eg={cto:"CTO",cbo:"CBO",pm:"PM",engineer:"Engineer",designer:"Designer",qa:"QA","data-analyst":"Data Analyst"};function u0(t){return new Date(t).toLocaleTimeString("ko-KR",{hour:"2-digit",minute:"2-digit"})}function uE({msg:t}){const l=cE[t.roleId]??"#888",a=eg[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:u0(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:u0(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:a}),c.jsx("span",{className:"text-xs text-[var(--terminal-text-secondary)]",children:t.text})]})]})}function fE({channel:t,allRoles:l,onUpdateMembers:a,onUpdateTopic:i}){const o=j.useRef(null),u=j.useRef(null);j.useEffect(()=>{var k;const b=u.current;if(!b)return;b.scrollHeight-b.scrollTop-b.clientHeight<80&&((k=o.current)==null||k.scrollIntoView({behavior:"smooth"}))},[t.messages.length]);const[f,m]=j.useState(!1),[p,h]=j.useState(!1),[g,y]=j.useState("");return c.jsxs("div",{ref:u,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(b=>eg[b]??b).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&&a&&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:()=>m(!f),children:f?"Done":"Invite"})]}),!t.isDefault&&i&&c.jsx("div",{className:"px-3 pb-2 mb-1",children:p?c.jsx("input",{autoFocus:!0,value:g,onChange:b=>y(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(i(t.id,g.trim()),h(!1)),b.key==="Escape"&&h(!1)},onBlur:()=>{i(t.id,g.trim()),h(!1)},placeholder:"Set a topic for this channel...",className:"w-full bg-transparent text-[10px] text-[var(--terminal-text-muted)] outline-none border-b border-[var(--terminal-border)] pb-0.5"}):c.jsx("button",{onClick:()=>{y(t.topic??""),h(!0)},className:"text-[10px] text-[var(--terminal-text-muted)] hover:text-[var(--terminal-text-secondary)] cursor-pointer italic",children:t.topic||"Click to set channel topic..."})}),f&&!t.isDefault&&l&&a&&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(b=>{const v=t.members.includes(b.id);return c.jsxs("button",{className:`text-[10px] px-2 py-1 rounded ${v?"bg-white/15 text-[var(--terminal-text)]":"bg-white/5 text-[var(--terminal-text-muted)]"}`,onClick:()=>{const k=v?t.members.filter(S=>S!==b.id):[...t.members,b.id];a(t.id,k)},children:[v?"✓ ":"",b.name]},b.id)})})}),t.messages.length===0&&c.jsx("div",{className:"flex-1 flex flex-col items-center justify-center text-[var(--terminal-text-muted)] text-xs gap-1 py-8",children:c.jsx("span",{children:t.isDefault?"No dispatch events yet":"No messages yet — invite roles to start chatting"})}),t.messages.map(b=>c.jsx(uE,{msg:b},b.id)),c.jsx("div",{ref:o})]})}const hd={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C"},dE=400,hE=800;function mE({sessions:t,activeSessionId:l,roles:a,streamingSessionId:i,width:o,onWidthChange:u,onSwitchSession:f,onCloseSession:m,onCreateSession:p,onClearEmpty:h,onCloseAll:g,onSendMessage:y,onModeChange:b,onCloseTerminal:v,chatChannels:k,activeChatChannelId:S,onSwitchChatChannel:N,onCreateChatChannel:E,onDeleteChatChannel:_,onUpdateChatMembers:$,onUpdateChatTopic:O,unreadChannels:B}){const[M,q]=j.useState(!1),[G,P]=j.useState(!1),[z,U]=j.useState(!1),[L,ee]=j.useState(""),ne=S!=null,V=k==null?void 0:k.find(pe=>pe.id===S),[Y,Q]=j.useState(!1),[re,ae]=j.useState(!1),[D,T]=j.useState(!1),X=j.useRef(0),A=j.useRef(0),se=j.useRef(null),de=t.find(pe=>pe.id===l),he=i===l,we=t.filter(pe=>pe.messages.length===0).length,Ce=j.useCallback(()=>{const pe=se.current;pe&&(ae(pe.scrollLeft>0),T(pe.scrollLeft+pe.clientWidth<pe.scrollWidth-1))},[]);j.useEffect(()=>{if(!l||!se.current)return;const pe=se.current.querySelector(`[data-session-id="${l}"]`);pe&&pe.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}),Ce()},[l,t.length,Ce]),j.useEffect(()=>{const pe=se.current;if(!pe)return;Ce(),pe.addEventListener("scroll",Ce);const Ke=new ResizeObserver(Ce);return Ke.observe(pe),()=>{pe.removeEventListener("scroll",Ce),Ke.disconnect()}},[Ce]);const Oe=j.useCallback(pe=>{pe.preventDefault(),X.current=pe.clientX,A.current=o,Q(!0);const Ke=me=>{const Ee=X.current-me.clientX,qe=Math.min(hE,Math.max(dE,A.current+Ee));u==null||u(qe)},lt=()=>{Q(!1),document.removeEventListener("mousemove",Ke),document.removeEventListener("mouseup",lt)};document.addEventListener("mousemove",Ke),document.addEventListener("mouseup",lt)},[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 ${Y?"bg-[var(--terminal-border-hover)]":"bg-transparent"}`,onMouseDown:Oe}),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:[re&&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:se,className:"flex items-center overflow-x-auto terminal-tab-scroll gap-px px-1 py-1",children:[k==null?void 0:k.map(pe=>c.jsxs("button",{onClick:()=>{N==null||N(pe.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 ${S===pe.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:S===pe.id?{borderTop:"2px solid #4CAF50"}:void 0,children:[c.jsx("span",{className:"text-[10px]",children:"💬"}),c.jsx("span",{className:"truncate",children:pe.name}),(B==null?void 0:B.has(pe.id))&&S!==pe.id&&c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400 shrink-0"}),!pe.isDefault&&c.jsx("span",{onClick:Ke=>{Ke.stopPropagation(),_==null||_(pe.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:"×"})]},pe.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(pe=>c.jsx(Jj,{roleId:pe.roleId,title:pe.title,roleColor:hd[pe.roleId]??"#666",active:!ne&&pe.id===l,onClick:()=>{N==null||N(null),f(pe.id)},onClose:Ke=>{Ke.stopPropagation(),m(pe.id)},"data-session-id":pe.id},pe.id))]}),D&&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:()=>{q(!M),P(!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:"+"}),M&&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:[E&&c.jsxs(c.Fragment,{children:[z?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:L,onChange:pe=>ee(pe.target.value),onKeyDown:pe=>{pe.key==="Enter"&&L.trim()&&(E(L.trim(),[]),ee(""),U(!1),q(!1)),pe.key==="Escape"&&(U(!1),ee(""))},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:()=>U(!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"})]}),a.map(pe=>c.jsxs("button",{onClick:()=>{p(pe.id),N==null||N(null),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 flex items-center gap-2",children:[c.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:hd[pe.id]??"#666"}}),pe.id.toUpperCase()," — ",pe.name]},pe.id))]})]}),c.jsxs("div",{className:"relative shrink-0",children:[c.jsx("button",{onClick:()=>{P(!G),q(!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:"···"}),G&&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":""]}),we>0&&h&&c.jsxs("button",{onClick:()=>{h(),P(!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 (",we,")"]}),t.length>0&&g&&c.jsx("button",{onClick:()=>{g(),P(!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:v,className:"px-2 py-1 text-[var(--terminal-text-muted)] hover:text-[var(--terminal-text-secondary)] text-sm cursor-pointer shrink-0",children:"×"})]}),ne&&V?c.jsx(fE,{channel:V,allRoles:a,onUpdateMembers:$,onUpdateTopic:O}):de?c.jsxs(c.Fragment,{children:[c.jsx(sE,{messages:de.messages,roleId:de.roleId,roleColor:hd[de.roleId]??"#666"}),c.jsx(oE,{mode:de.mode,onModeChange:pe=>b(de.id,pe),onSend:pe=>y(de.id,pe,de.mode),disabled:he,disabledReason:he?`${de.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 xE(){const t=j.useRef(null),l=j.useCallback(()=>{var i;(i=t.current)==null||i.abort(),t.current=null},[]);return{sendMessage:j.useCallback((i,o,u,f)=>{l();const m=new AbortController;return t.current=m,fetch(`/api/exec/session/${i}/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:o,mode:u}),signal:m.signal}).then(async p=>{var b,v,k,S,N;if(!p.ok||!p.body){f.onError("Failed to connect");return}const h=p.body.getReader(),g=new TextDecoder;let y="";for(;;){const{done:E,value:_}=await h.read();if(E)break;y+=g.decode(_,{stream:!0});const $=y.split(`
87
+ `);y=$.pop()??"";let O="";for(let B=0;B<$.length;B++){const M=$[B];if(M.startsWith("event: ")){O=M.slice(7).trim();continue}if(M.startsWith("data: ")){let q;try{q=JSON.parse(M.slice(6))}catch{O="";continue}switch(O){case"thinking":q.text&&((b=f.onThinking)==null||b.call(f,q.text));break;case"output":q.text&&f.onText(q.text);break;case"tool":(v=f.onToolUse)==null||v.call(f,q.name,q.input);break;case"dispatch":(k=f.onDispatch)==null||k.call(f,q.roleId,q.task);break;case"dispatch:progress":(S=f.onDispatchProgress)==null||S.call(f,q.roleId,q.type,q);break;case"turn":(N=f.onTurn)==null||N.call(f,q.turn);break;case"done":f.onDone(q);break;case"error":f.onError(q.message??"Unknown error");break;default:q.text&&f.onText(q.text);break}O=""}}}}).catch(p=>{p.name!=="AbortError"&&f.onError(p.message)}),{abort:l}},[l]),abort:l}}const uh="tycono-appearances",xc="tycono-theme";(()=>{try{for(const[t,l]of[["the-company-appearances",uh],["the-company-theme",xc]]){const a=localStorage.getItem(t);a&&!localStorage.getItem(l)&&(localStorage.setItem(l,a),localStorage.removeItem(t))}}catch{}})();function f0(){try{const t=localStorage.getItem(uh);return t?JSON.parse(t):{}}catch{return{}}}function md(t){localStorage.setItem(uh,JSON.stringify(t))}function d0(){try{const t=localStorage.getItem(xc);if(t&&t in Ea)return t}catch{}return"default"}function pE(t){var i;const l=(i=Ea[t])==null?void 0:i.vars;if(!l)return;const a=document.documentElement;for(const[o,u]of Object.entries(l))a.style.setProperty(o,u)}const xd={mode:"auto",intervalSec:18,dailyBudgetUsd:1},Bd="tycono-speech-settings",pd="tycono-language";function yE(){try{const t=localStorage.getItem(Bd);return t?{...xd,...JSON.parse(t)}:xd}catch{return xd}}function gE(){const[t,l]=j.useState(f0),[a,i]=j.useState(d0),[o,u]=j.useState(yE),[f,m]=j.useState(()=>{try{return localStorage.getItem(pd)??"auto"}catch{return"auto"}}),p=j.useRef(!1);j.useEffect(()=>{p.current||(p.current=!0,Ae.getPreferences().then(S=>{const N=Object.keys(S.appearances??{}).length>0||S.theme!=="default";if(S.speech&&(u(E=>({...E,...S.speech})),localStorage.setItem(Bd,JSON.stringify(S.speech))),S.language&&(m(S.language),localStorage.setItem(pd,S.language)),N){const E=S.appearances;l(E),md(E),S.theme&&S.theme in Ea&&(i(S.theme),localStorage.setItem(xc,S.theme))}else{const E=f0(),_=d0();(Object.keys(E).length>0||_!=="default")&&Ae.updatePreferences({appearances:E,theme:_}).catch(()=>{})}}).catch(()=>{}))},[]),j.useEffect(()=>{pE(a)},[a]);const h=j.useCallback(S=>t[S]??ch(S),[t]),g=j.useCallback((S,N)=>{l(E=>{const _={...E,[S]:N};return md(_),Ae.updatePreferences({appearances:_}).catch(()=>{}),_})},[]),y=j.useCallback(S=>{l(N=>{const E={...N};return delete E[S],md(E),Ae.updatePreferences({appearances:E}).catch(()=>{}),E})},[]),b=j.useCallback(S=>{i(S),localStorage.setItem(xc,S),Ae.updatePreferences({theme:S}).catch(()=>{})},[]),v=j.useCallback(S=>{u(N=>{const E={...N,...S};return localStorage.setItem(Bd,JSON.stringify(E)),Ae.updatePreferences({speech:E}).catch(()=>{}),E})},[]),k=j.useCallback(S=>{m(S),localStorage.setItem(pd,S),Ae.updatePreferences({language:S}).catch(()=>{})},[]);return{appearances:t,getAppearance:h,setAppearance:g,resetAppearance:y,theme:a,setTheme:b,speechSettings:o,setSpeechSettings:v,language:f,setLanguage:k}}const bE=3e4;function vE(){var v;const[t,l]=j.useState(null),[a,i]=j.useState("synced"),[o,u]=j.useState([]),f=j.useRef(null),m=j.useCallback(async()=>{try{const k=await Ae.getSaveStatus();l(k),k.noGit?i("no-git"):i(S=>S==="saving"?S:k.dirty?"dirty":"synced")}catch{i("error")}},[]);j.useEffect(()=>(m(),f.current=setInterval(m,bE),()=>{f.current&&clearInterval(f.current)}),[m]);const p=j.useCallback(async k=>{i("saving");try{const S=await Ae.save(k);return await m(),S}catch(S){throw i("error"),S}},[m]),h=j.useCallback(async()=>{try{const k=await Ae.getSaveHistory(20);u(k)}catch{}},[]),g=j.useCallback(async k=>{i("saving");try{await Ae.restoreSave(k),await m()}catch(S){throw i("error"),S}},[m]),y=t?t.modified.length+t.untracked.length:0,b=((v=t==null?void 0:t.lastCommit)==null?void 0:v.date)??null;return{state:a,dirtyCount:y,lastSaved:b,status:t,save:p,history:o,loadHistory:h,restore:g,refresh:m}}const h0={cto:["Need to reduce this architecture tech debt...","Don't over-engineer. Keep it minimal.","Performance profiling results are a bit concerning.","Should do a system design review.","If I just strip one abstraction layer, it should work.","Let me check the monitoring dashboard.","Need to go through the code review queue.","It's about time to clean up these module dependencies."],cbo:["Heard the competitor launched a new feature... need to analyze.","Should compile this month's revenue metrics.","It's time to update the market trend report.","Maybe I should benchmark the pricing strategy.","Need to recalculate the ROI.","Let me check the competitor's GitHub star trends.","Thinking about launch timing...","Should re-examine the positioning strategy."],pm:["Is this feature really what users want?","Need to clean up the backlog...","MVP scope keeps expanding.","Analyzing user feedback...","Might need to re-prioritize.","Watch out for scope creep.","Will the roadmap timeline hold...","Should double-check the task dependencies."],engineer:["I want to refactor this code...","Test coverage seems a bit low.","Working code first, perfect code later.","Waiting for PR review...","What could be causing this bug...","Is the build broken?","Need to fix that one type error.","Maybe I should run npm audit."],designer:["This UI flow feels a bit awkward...","Usability first, pretty later.","Need to organize the design system components.","Let me make two quick options and compare.","Should run through the accessibility checklist.","Maybe I should prototype this interaction.","Let me revisit the color palette...","The spacing feels a bit cramped."],qa:['"Works" and "correct" are two different things.',"Organizing edge case scenarios...","Should run the regression test suite.","This part could be converted to automated tests.","Need to go through the pre-release checklist.","Reproducible bug reports are key.","Should run cross-browser tests.","Need to check for performance regressions."],"data-analyst":["Checking the data pipeline status...","Interesting outlier detection pattern.","Need to update the dashboard metrics.","Correlation isn't causation though...","Seems like there is room for SQL query optimization.","It's time for a data quality check."]},m0={cto:["Should I assign more work to the team...","It's time to clean up the architecture debt.","Need to re-examine the tech roadmap.","It's quiet... am I missing something?"],cbo:["It's time to update the market analysis...","Should be preparing the revenue report, but no directives.","Let me check on competitor movements.","It's quiet on the business side..."],pm:["Backlog is pretty quiet... nothing to plan?","It's been a while since we scheduled a sprint.","User feedback must be piling up...","No PRD to write... that's unusual."],engineer:["Nothing to do today... maybe some code reviews.","Task queue is empty. Guess I'll refactor.","Am I missing something?","Should clean up the commit log."],designer:["No design requests coming in. Should I improve something on my own?","Maybe run a UI audit...","Should organize my portfolio.","Let me tidy up the component library."],qa:["No builds to test. Let me improve the automation scripts.","It's quiet... no bugs, or just haven't found them?","Let me review the existing test scenarios.","Should update the test coverage report."],"data-analyst":["No analysis requests coming in...","Maybe I should clean up the data warehouse.","Should verify the past reports."]},wE=[{id:"sup-check-1",relation:"superior-subordinate",minFamiliarity:0,topic:"progress",turns:[{speaker:"A",text:"How's the progress?"},{speaker:"B",text:"Going well. Should be done soon."},{speaker:"A",text:"Good, let me know when it's done."}]},{id:"sup-check-2",relation:"superior-subordinate",minFamiliarity:20,topic:"progress",turns:[{speaker:"A",text:"What are you working on today?"},{speaker:"B",text:"Finishing up what I was doing yesterday."}]},{id:"sub-report-1",relation:"superior-subordinate",minFamiliarity:10,topic:"report",turns:[{speaker:"B",text:"Done with that task from earlier."},{speaker:"A",text:"Nice work. Can you share the results?"},{speaker:"B",text:"Sure, I've updated the docs."}]},{id:"peer-tech-1",relation:"peer",minFamiliarity:20,topic:"tech",turns:[{speaker:"A",text:"What do you think about this design?"},{speaker:"B",text:"I think we could go simpler."},{speaker:"A",text:"Really? Want to look at it together?"}]},{id:"peer-tech-2",relation:"peer",minFamiliarity:30,topic:"tech",turns:[{speaker:"A",text:"Have you used this library before?"},{speaker:"B",text:"Yeah, used it in the last project. It was decent."}]},{id:"close-feedback-1",relation:"peer",minFamiliarity:60,topic:"feedback",turns:[{speaker:"A",text:"Can I be honest with you?"},{speaker:"B",text:"Of course, go ahead."},{speaker:"A",text:"This one feels a bit off. Let's revisit."},{speaker:"B",text:"...Alright. Thanks for the feedback."}]},{id:"clevel-sync-1",relation:"c-level",minFamiliarity:10,topic:"strategy",turns:[{speaker:"A",text:"We need to sync the roadmap with the business timeline."},{speaker:"B",text:"Agreed. I'll have it organized and shared by tomorrow."}]},{id:"clevel-sync-2",relation:"c-level",minFamiliarity:30,topic:"strategy",turns:[{speaker:"A",text:"I have some competitor intel to share."},{speaker:"B",text:"Great, I have a tech update too."},{speaker:"A",text:"Let's sync up when you're free."}]},{id:"casual-coffee",relation:"any",minFamiliarity:30,topic:"casual",turns:[{speaker:"A",text:"Want to grab a coffee?"},{speaker:"B",text:"Sure. Feels like it's going to be a long day."}]},{id:"casual-overtime",relation:"any",minFamiliarity:25,topic:"casual",turns:[{speaker:"A",text:"Working late again..."},{speaker:"B",text:"We're in this together. Hang in there."}]},{id:"casual-lunch",relation:"any",minFamiliarity:35,topic:"casual",turns:[{speaker:"A",text:"What should we get for lunch?"},{speaker:"B",text:"Anything. Feel like we eat the same thing every day."}]},{id:"casual-weekend",relation:"any",minFamiliarity:40,topic:"casual",turns:[{speaker:"A",text:"What did you do this weekend?"},{speaker:"B",text:"Just rested. Was too tired."}]},{id:"bestie-1",relation:"any",minFamiliarity:80,topic:"trust",turns:[{speaker:"A",text:"I'm a bit unsure about this direction..."},{speaker:"B",text:"What's bothering you? Be honest."},{speaker:"A",text:"Thanks. It's nice having someone I can talk to."}]}],kE=18e3,x0=6e3,SE=2500,jE=30*6e4,tg="tycono:relationships";function EE(){try{const t=localStorage.getItem(tg);return t?JSON.parse(t):[]}catch{return[]}}function CE(t){localStorage.setItem(tg,JSON.stringify(t))}function Ko(t,l,a){const[i,o]=l<a?[l,a]:[a,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 Qo(t){return Math.min(100,t.dispatches*5+t.wavesTogether*10+t.conversations*2)}function Zo(t){return t[Math.floor(Math.random()*t.length)]}function NE(t,l,a){const i=a.find(m=>m.id===t),o=a.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 AE(t,l){return t.relation==="any"?!0:t.relation===l}function DE({roles:t,roleStatuses:l,activeExecs:a,getStandupSpeech:i}){const[o,u]=j.useState(new Map),[f,m]=j.useState(EE),p=j.useRef({}),h=j.useRef(null),g=j.useRef(t),y=j.useRef(l),b=j.useRef(a),v=j.useRef(i),k=j.useRef(f);g.current=t,y.current=l,b.current=a,v.current=i,k.current=f,j.useEffect(()=>{const O=Date.now();for(const[B,M]of Object.entries(l))M==="working"&&(p.current[B]=O)},[l]),j.useEffect(()=>{CE(f)},[f]);const S=j.useCallback(O=>{const B=y.current[O],M=b.current.find(U=>U.roleId===O);if(B==="working"&&(M!=null&&M.task))return null;const q=v.current(O);if(q&&Math.random()<.3)return{text:q,type:"work",ts:Date.now()};const G=Date.now(),P=p.current[O]??0;if(G-P>jE&&Math.random()<.5){const U=m0[O]??m0.engineer;return{text:Zo(U),type:"guilt",ts:G}}const z=h0[O]??h0.engineer;return{text:Zo(z),type:"personality",ts:G}},[]),N=j.useCallback(O=>{if(h.current)return!1;const B=O.filter(Q=>y.current[Q.id]!=="working");if(B.length<2)return!1;const M=[...B].sort(()=>Math.random()-.5),q=M[0],G=M[1],P=NE(q.id,G.id,O);if(!P)return!1;const z=Ko(k.current,q.id,G.id),U=Qo(z),L=wE.filter(Q=>AE(Q,P)&&U>=Q.minFamiliarity);if(L.length===0)return!1;const ee=Zo(L);let ne=q.id,V=G.id;ee.relation==="superior-subordinate"&&(G.reportsTo===q.id||q.level==="c-level"?(ne=q.id,V=G.id):(ne=G.id,V=q.id)),h.current={templateId:ee.id,roleA:ne,roleB:V,turnIdx:0,timer:null};const Y=Q=>{if(!h.current||Q>=ee.turns.length){h.current=null,m(T=>{const X=[...T],A=Ko(X,ne,V);return A.conversations++,A.familiarity=Qo(A),A.lastInteraction=new Date().toISOString(),X}),setTimeout(()=>{u(T=>{const X=new Map(T);return X.delete(ne),X.delete(V),X})},x0);return}const re=ee.turns[Q],ae=re.speaker==="A"?ne:V,D=re.speaker==="A"?V:ne;u(T=>{const X=new Map(T);if(X.set(ae,{text:re.text,type:"social",partnerId:D,ts:Date.now()}),Q>0){const A=ee.turns[Q-1].speaker==="A"?ne:V;A!==ae&&X.delete(A)}return X}),h.current.turnIdx=Q,h.current.timer=setTimeout(()=>Y(Q+1),SE)};return Y(0),!0},[]);j.useEffect(()=>{const O=setInterval(()=>{const B=g.current;if(B.length===0||h.current||Math.random()<.35&&N(B))return;const M=B.filter(P=>y.current[P.id]!=="working");if(M.length===0)return;const q=Zo(M),G=S(q.id);G&&(u(P=>{const z=new Map(P);return z.set(q.id,G),z}),setTimeout(()=>{u(P=>{const z=new Map(P),U=z.get(q.id);return U&&U.ts===G.ts&&z.delete(q.id),z})},x0))},kE);return()=>{var B;clearInterval(O),(B=h.current)!=null&&B.timer&&clearTimeout(h.current.timer)}},[S,N]);const E=j.useCallback(O=>{const B=o.get(O);return(B==null?void 0:B.text)??""},[o]),_=j.useCallback((O,B)=>{m(M=>{const q=[...M],G=Ko(q,O,B);return G.dispatches++,G.familiarity=Qo(G),G.lastInteraction=new Date().toISOString(),q})},[]),$=j.useCallback(O=>{O.length<2||m(B=>{const M=[...B];for(let q=0;q<O.length;q++)for(let G=q+1;G<O.length;G++){const P=Ko(M,O[q],O[G]);P.wavesTogether++,P.familiarity=Qo(P),P.lastInteraction=new Date().toISOString()}return M})},[]);return{speeches:o,getSpeech:E,relationships:f,notifyDispatch:_,notifyWave:$}}const ng="tycono:office-chat";let TE=0;function zE(){return`chat-${Date.now()}-${++TE}`}function yd(){return[{id:"general",name:"#general",members:[],isDefault:!0,messages:[],topic:"Company-wide announcements and general discussion"},{id:"watercooler",name:"#watercooler",members:[],isDefault:!0,messages:[],topic:"No managers allowed. Vent, gossip, joke around. Talk freely about work frustrations, complain about directives you disagree with, share hot takes."}]}function ME(){try{const t=localStorage.getItem(ng);if(t){const l=JSON.parse(t);if(l.find(i=>i.id==="office")&&!l.find(i=>i.id==="general")){const i=l.filter(o=>o.id!=="office");return[...yd(),...i]}const a=yd();for(const i of a)l.find(o=>o.id===i.id)||l.unshift(i);return l}}catch{}return yd()}function _E(t){const l=t.map(a=>({...a,messages:a.messages.slice(-200)}));localStorage.setItem(ng,JSON.stringify(l))}function FE(){const[t,l]=j.useState(ME),[a,i]=j.useState(null),[o,u]=j.useState(new Set);j.useEffect(()=>{_E(t)},[t]);const f=j.useCallback(v=>{i(v),v&&u(k=>{const S=new Set(k);return S.delete(v),S})},[]),m=j.useCallback(v=>{const k={...v,id:zE()};l(S=>{const N=S.map(E=>E.id==="general"?v.type==="dispatch"?{...E,messages:[...E.messages,k].slice(-200)}:E:v.channelId?E.id===v.channelId?{...E,messages:[...E.messages,k].slice(-200)}:E:E.members.length>0&&E.members.includes(v.roleId)?{...E,messages:[...E.messages,k].slice(-200)}:E);return u(E=>{const _=new Set(E);for(const $ of N){const O=S.find(B=>B.id===$.id);O&&$.messages.length>O.messages.length&&_.add($.id)}return _}),N})},[]),p=j.useCallback((v,k,S)=>{const N=`ch-${Date.now()}`,E={id:N,name:v.startsWith("#")?v:`#${v}`,members:k,isDefault:!1,messages:[],topic:S};l(_=>[..._,E]),i(N)},[]),h=j.useCallback(v=>{l(k=>k.filter(S=>S.id!==v||S.isDefault)),i(k=>k===v?"general":k)},[]),g=j.useCallback((v,k)=>{l(S=>S.map(N=>N.id===v&&!N.isDefault?{...N,members:k}:N))},[]),y=j.useCallback((v,k)=>{l(S=>S.map(N=>N.id===v&&!N.isDefault?{...N,topic:k||void 0}:N))},[]),b=j.useCallback(v=>{l(k=>k.map(S=>{if(S.id==="watercooler"){const N=v.filter(E=>E.level!=="c-level").map(E=>E.id);if(S.members.length!==N.length||!N.every(E=>S.members.includes(E)))return{...S,members:N}}return S}))},[]);return{channels:t,activeChannelId:a,setActiveChannelId:f,pushMessage:m,createChannel:p,deleteChannel:h,updateMembers:g,updateTopic:y,unreadChannels:o,syncDefaultMembers:b}}const RE=45e3,OE=3e3,BE=3,$E=20;function LE({roles:t,roleStatuses:l,activeExecs:a,channels:i,relationships:o,pushMessage:u,speechSettings:f,engineType:m,hasApiKey:p}){const g=((f==null?void 0:f.mode)==="auto"?m==="claude-cli"||m==="local"?"llm":"template":(f==null?void 0:f.mode)??"template")==="llm"&&(p!==!1||m==="claude-cli"),y=((f==null?void 0:f.intervalSec)??RE/1e3)*1e3,b=j.useRef(t),v=j.useRef(l),k=j.useRef(a),S=j.useRef(i),N=j.useRef(o),E=j.useRef(u),_=j.useRef(0),$=j.useRef(!1);b.current=t,v.current=l,k.current=a,S.current=i,N.current=o,E.current=u;const O=j.useCallback(async(M,q)=>{if($.current)return!1;$.current=!0;try{if(!b.current.find(V=>V.id===M))return!1;const P=q.messages.slice(-$E).map(V=>({roleId:V.roleId,text:V.text,ts:V.ts})),z=b.current.filter(V=>q.members.includes(V.id)),U=N.current.filter(V=>V.roleA===M||V.roleB===M).map(V=>({partnerId:V.roleA===M?V.roleB:V.roleA,familiarity:V.familiarity})),L=k.current.find(V=>V.roleId===M),ee=L?{currentTask:L.task,taskProgress:null}:{currentTask:null,taskProgress:null},ne=await Ae.chatInChannel({channelId:q.name.replace("#",""),channelTopic:q.topic,roleId:M,history:P,members:z.map(V=>({id:V.id,name:V.name,level:V.level})),relationships:U,workContext:ee});return ne.message?(E.current({ts:Date.now(),roleId:M,text:ne.message,type:"chat",channelId:q.id}),!0):!1}catch{return!1}finally{$.current=!1}},[]),B=j.useCallback(async(M,q)=>{if(_.current>=BE){_.current=0;return}const G=M.members.filter(z=>z!==q&&v.current[z]!=="working");if(G.length===0){_.current=0;return}const P=G[Math.floor(Math.random()*G.length)];if(Math.random()>.6){_.current=0;return}setTimeout(async()=>{_.current++;const z=S.current.find(L=>L.id===M.id);if(!z)return;await O(P,z)?B(z,P):_.current=0},OE+Math.random()*2e3)},[O]);j.useEffect(()=>{if(!g)return;const M=setInterval(async()=>{const q=b.current;if(q.length===0||$.current)return;const G=q.filter(ee=>v.current[ee.id]!=="working");if(G.length===0)return;const P=G[Math.floor(Math.random()*G.length)],z=S.current.filter(ee=>ee.members.length===0?!0:ee.members.includes(P.id));if(z.length===0)return;const U=z[Math.floor(Math.random()*z.length)];_.current=0,await O(P.id,U)&&B(U,P.id)},y);return()=>clearInterval(M)},[g,y,O,B])}function Wo({type:t,className:l}){const a=j.useRef(null),i=iS(t);return j.useEffect(()=>{const o=a.current;if(!o||!i)return;const u=o.getContext("2d");u&&oS(u,i)},[t,i]),i?c.jsx("canvas",{ref:a,width:i.canvasWidth,height:i.canvasHeight,className:l,style:{imageRendering:"pixelated",display:"block"}}):null}const lg=[[1,8],[3,5],[8,1],[5,3]],HE=[[1,4],[2,3],[4,1],[3,2]];function Jo(t){const l=t===1||t===3?-1:0,a=lg[t],i=t<2?[0,1]:[1,0],o=l;return[{x:1,y:17,w:10,h:2,c:"#100A06",a:.18},{x:a[0],y:13,w:3,h:4,c:"$pants"},{x:a[1],y:13,w:3,h:4,c:"$pants"},{x:a[0]+1,y:13,w:1,h:3,c:"darken($pants, 25)",a:.2},{x:a[1]+1,y:13,w:1,h:3,c:"darken($pants, 25)",a:.2},{x:a[0],y:16,w:3,h:2,c:"$shoes"},{x:a[1],y:16,w:3,h:2,c:"$shoes"},{x:a[0],y:16,w:3,h:1,c:"lighten($shoes, 25)",a:.4},{x:a[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 Po(t){const l=t===1||t===3?-1:0,a=lg[t],i=t<2?[0,1]:[1,0],o=l;return[{x:1,y:17,w:10,h:2,c:"#100A06",a:.18},{x:a[0],y:13,w:3,h:4,c:"$pants"},{x:a[1],y:13,w:3,h:4,c:"$pants"},{x:a[0],y:16,w:3,h:2,c:"$shoes"},{x:a[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 ka(t,l){const a=t===1||t===3?-1:0,i=HE[t],o=a,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 p0={down:[Jo(0),Jo(1),Jo(2),Jo(3)],up:[Po(0),Po(1),Po(2),Po(3)],right:[ka(0,!0),ka(1,!0),ka(2,!0),ka(3,!0)],left:[ka(0,!1),ka(1,!1),ka(2,!1),ka(3,!1)]},Re=4,St=28,Pt=2,tt=4,Ve=4,Xl=[{wallColor:"#C8B898",baseboardColor:"#6A5840",floorType:"wood"},{wallColor:"#A8B8C8",baseboardColor:"#586878",floorType:"dark"},{wallColor:"#A8C8B0",baseboardColor:"#4A6A50",floorType:"carpet"},{wallColor:"#C8C0A8",baseboardColor:"#7A6A50",floorType:"tile"}];function fh(t,l,a){const u=t.fy+Math.max(10,Math.floor(t.fh*.18)),f=Math.min(l,a),m=Math.ceil(l/f),p=[],h=f*28,g=t.fx+Math.max(8,Math.floor((t.fw-h)/2));for(let y=0;y<m&&p.length<l;y++){const b=Math.min(f,l-y*f);for(let v=0;v<b;v++)p.push({dx:g+v*28,dy:u+y*28,room:t.id})}return p}function UE(t){const i=Xl[0],o={id:"main",wx:Re+Ve,wy:Re,ww:160-2*(Re+Ve),wh:St,fx:Re+Ve,fy:Re+St+Pt,fw:160-2*(Re+Ve),fh:120-Re-St-Pt-Re,...i},u=fh(o,Math.min(t,6),3),f=[{id:"s-window-l",type:"window",room:"main",zone:"wall",offsetX:10,offsetY:6,windowW:16,windowH:14},{id:"s-window-r",type:"window",room:"main",zone:"wall",anchorX:"right",offsetX:-26,offsetY:6,windowW:16,windowH:14},{id:"s-clock",type:"clock",room:"main",zone:"wall",offsetX:Math.floor((160-2*(Re+Ve))/2),offsetY:10}],m=[{id:"s-plant-l",type:"plant",room:"main",zone:"floor",offsetX:4,offsetY:4},{id:"s-plant-r",type:"plant",room:"main",zone:"floor",anchorX:"right",offsetX:-8,offsetY:4}];return{preset:"S",canvasW:160,canvasH:120,rooms:{main:o},desks:u,doors:{},adjacency:{main:[]},corridorY:{main:o.fy+o.fh-12},waypoints:{main:[{x:o.fx+10,y:o.fy+o.fh-14},{x:o.fx+o.fw/2,y:o.fy+o.fh-14},{x:o.fx+o.fw-10,y:o.fy+o.fh-14}]},wallDecorations:f,furniture:m}}function YE(t){const o={id:"exec",wx:Re+Ve,wy:Re,ww:144-Re-Ve-tt/2,wh:St,fx:Re+Ve,fy:Re+St+Pt,fw:144-Re-Ve-tt/2,fh:66,...Xl[0]},u={id:"work",wx:144+tt/2+Ve,wy:Re,ww:144-tt/2-Ve-Re,wh:St,fx:144+tt/2+Ve,fy:Re+St+Pt,fw:144-tt/2-Ve-Re,fh:66,...Xl[1]},f={id:"meet",wx:Re+Ve,wy:Re+St+Pt+66+tt,ww:144-Re-Ve-tt/2,wh:St,fx:Re+Ve,fy:Re+St+Pt+66+tt+St+Pt,fw:144-Re-Ve-tt/2,fh:70,...Xl[2]},m={id:"comm",wx:144+tt/2+Ve,wy:Re+St+Pt+66+tt,ww:144-tt/2-Ve-Re,wh:St,fx:144+tt/2+Ve,fy:Re+St+Pt+66+tt+St+Pt,fw:144-tt/2-Ve-Re,fh:70,...Xl[3]},p={exec:o,work:u,meet:f,comm:m},h=[];let g=t;const y=[[o,Math.min(3,g)],[u,0]];y[1][1]=Math.min(3,g-y[0][1]);const b=[[f,0],[m,0]];let v=g-y[0][1]-y[1][1];v>0&&(b[0][1]=Math.min(2,v),v-=b[0][1]),v>0&&(b[1][1]=Math.min(2,v));for(const[M,q]of[...y,...b])q>0&&h.push(...fh(M,q,3));const k=Re+St+Pt+66,S=144-tt/2,N={exec_work:{id:"exec_work",type:"v",doorY:Re+St+Pt+20+12,xA:S-2,xB:u.fx+2},meet_comm:{id:"meet_comm",type:"v",doorY:Re+St+Pt+66+tt+St+Pt+20+12,xA:S-2,xB:m.fx+2},exec_meet:{id:"exec_meet",type:"h",doorX:Re+Ve+40+14,yA:k-2,yB:f.fy+2},work_comm:{id:"work_comm",type:"h",doorX:144+tt/2+Ve+40+14,yA:k-2,yB:m.fy+2}},E={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"}]},_={exec:o.fy+52,work:u.fy+48,meet:f.fy+56,comm:m.fy+42},$={exec:[{x:o.fx+6,y:o.fy+52},{x:o.fx+60,y:o.fy+54},{x:o.fx+112,y:o.fy+50},{x:o.fx+50,y:o.fy+52}],work:[{x:u.fx+14,y:u.fy+48},{x:u.fx+44,y:u.fy+48},{x:u.fx+70,y:u.fy+48},{x:u.fx+100,y:u.fy+48}],meet:[{x:f.fx+60,y:f.fy+56},{x:f.fx+30,y:f.fy+54},{x:f.fx+110,y:f.fy+50},{x:f.fx+80,y:f.fy+56}],comm:[{x:m.fx+96,y:m.fy+8},{x:m.fx+60,y:m.fy+42},{x:m.fx+40,y:m.fy+42},{x:m.fx+20,y:m.fy+42}]},O=[{id:"exec-window-1",type:"window",room:"exec",zone:"wall",offsetX:10,offsetY:6,windowW:16,windowH:14},{id:"exec-picture-1",type:"picture",room:"exec",zone:"wall",offsetX:34,offsetY:8,pictureColor:"#1565C0"},{id:"exec-picture-2",type:"picture",room:"exec",zone:"wall",offsetX:48,offsetY:8,pictureColor:"#E65100"},{id:"exec-clock",type:"clock",room:"exec",zone:"wall",offsetX:64,offsetY:10},{id:"exec-shelf",type:"shelf",room:"exec",zone:"wall",offsetX:78,offsetY:18},{id:"exec-window-2",type:"window",room:"exec",zone:"wall",offsetX:104,offsetY:6,windowW:16,windowH:14},{id:"work-whiteboard",type:"whiteboard",room:"work",zone:"wall",offsetX:6,offsetY:4},{id:"work-window-1",type:"window",room:"work",zone:"wall",offsetX:50,offsetY:6,windowW:16,windowH:14},{id:"work-window-2",type:"window",room:"work",zone:"wall",offsetX:92,offsetY:6,windowW:16,windowH:14},{id:"meet-bulletin",type:"bulletin-board",room:"meet",zone:"wall",offsetX:6,offsetY:4,facility:{id:"bulletin",label:"BULLETIN",icon:"📋",color:"#F59E0B",hitW:22,hitH:16}},{id:"meet-picture",type:"picture",room:"meet",zone:"wall",offsetX:28,offsetY:8,pictureColor:"#10B981"},{id:"meet-window",type:"window",room:"meet",zone:"wall",offsetX:80,offsetY:6,windowW:16,windowH:14},{id:"meet-shelf",type:"shelf",room:"meet",zone:"wall",offsetX:102,offsetY:18},{id:"comm-screen",type:"screen",room:"comm",zone:"wall",offsetX:6,offsetY:6,facility:{id:"decisions",label:"DECISIONS",icon:"📜",color:"#EF4444",hitW:16,hitH:12}},{id:"comm-picture",type:"picture",room:"comm",zone:"wall",offsetX:28,offsetY:8,pictureColor:"#d4956a"},{id:"comm-window",type:"window",room:"comm",zone:"wall",offsetX:76,offsetY:6,windowW:16,windowH:14},{id:"comm-clock",type:"clock",room:"comm",zone:"wall",offsetX:98,offsetY:10},{id:"comm-shelf",type:"shelf",room:"comm",zone:"wall",offsetX:108,offsetY:18}],B=[{id:"exec-bookshelf",type:"bookshelf",room:"exec",zone:"floor",offsetX:2,offsetY:4},{id:"exec-plant-r",type:"plant",room:"exec",zone:"floor",anchorX:"right",offsetX:-10,offsetY:4},{id:"exec-plant-c",type:"plant",room:"exec",zone:"floor",offsetX:Math.floor(o.fw/2),offsetY:4},{id:"work-plant-1",type:"plant",room:"work",zone:"floor",offsetX:36,offsetY:4},{id:"work-plant-2",type:"plant",room:"work",zone:"floor",offsetX:80,offsetY:4},{id:"meet-plant",type:"plant",room:"meet",zone:"floor",anchorX:"right",offsetX:-12,offsetY:4},{id:"meet-table",type:"meeting-table",room:"meet",zone:"floor",offsetX:10,offsetY:14,condition:"no-desks",facility:{id:"meeting",label:"MEETING",icon:"🏢",color:"#3B82F6",hitW:44,hitH:40}},{id:"comm-coffee-machine",type:"coffee-machine",room:"comm",zone:"floor",anchorX:"right",offsetX:-30,offsetY:4,condition:"no-desks"},{id:"comm-plant-1",type:"plant",room:"comm",zone:"floor",offsetX:38,offsetY:4,condition:"no-desks"},{id:"comm-bookshelf",type:"bookshelf",room:"comm",zone:"floor",anchorX:"right",offsetX:-26,offsetY:16,accent:"#10B981",condition:"no-desks",facility:{id:"knowledge",label:"KNOWLEDGE",icon:"📚",color:"#10B981",hitW:26,hitH:24}},{id:"comm-sofa",type:"sofa",room:"comm",zone:"floor",offsetX:44,offsetY:30,condition:"no-desks"},{id:"comm-coffee-table",type:"coffee-table",room:"comm",zone:"floor",offsetX:50,offsetY:50,condition:"no-desks"},{id:"comm-plant-2",type:"plant",room:"comm",zone:"floor",offsetX:38,offsetY:50,condition:"no-desks"}];return{preset:"M",canvasW:288,canvasH:208,rooms:p,desks:h,doors:N,adjacency:E,corridorY:_,waypoints:$,wallDecorations:O,furniture:B}}function IE(t){const f={id:"exec",wx:Re+Ve,wy:Re,ww:180-Re-Ve-tt/2,wh:St,fx:Re+Ve,fy:Re+St+Pt,fw:180-Re-Ve-tt/2,fh:82,...Xl[0]},m={id:"work",wx:180+tt/2+Ve,wy:Re,ww:180-tt/2-Ve-Re,wh:St,fx:180+tt/2+Ve,fy:Re+St+Pt,fw:180-tt/2-Ve-Re,fh:82,...Xl[1]},p=Re+St+Pt+82,h={id:"meet",wx:Re+Ve,wy:p+tt,ww:180-Re-Ve-tt/2,wh:St,fx:Re+Ve,fy:p+tt+St+Pt,fw:180-Re-Ve-tt/2,fh:86,...Xl[2]},g={id:"comm",wx:180+tt/2+Ve,wy:p+tt,ww:180-tt/2-Ve-Re,wh:St,fx:180+tt/2+Ve,fy:p+tt+St+Pt,fw:180-tt/2-Ve-Re,fh:86,...Xl[3]},y={exec:f,work:m,meet:h,comm:g},b=[];let v=t;const k=[[f,Math.min(5,v)],[m,0]];k[1][1]=Math.min(5,v-k[0][1]);const S=[[h,0],[g,0]];let N=v-k[0][1]-k[1][1];N>0&&(S[0][1]=Math.min(3,N),N-=S[0][1]),N>0&&(S[1][1]=Math.min(3,N));for(const[G,P]of[...k,...S])P>0&&b.push(...fh(G,P,4));const E=180-tt/2,_={exec_work:{id:"exec_work",type:"v",doorY:f.fy+82/2,xA:E-2,xB:m.fx+2},meet_comm:{id:"meet_comm",type:"v",doorY:h.fy+86/2,xA:E-2,xB:g.fx+2},exec_meet:{id:"exec_meet",type:"h",doorX:f.fx+54,yA:p-2,yB:h.fy+2},work_comm:{id:"work_comm",type:"h",doorX:m.fx+54,yA:p-2,yB:g.fy+2}},$={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"}]},O={exec:f.fy+82-12,work:m.fy+82-12,meet:h.fy+86-12,comm:g.fy+86-12},B={exec:[{x:f.fx+10,y:O.exec},{x:f.fx+f.fw/2,y:O.exec},{x:f.fx+f.fw-10,y:O.exec}],work:[{x:m.fx+10,y:O.work},{x:m.fx+m.fw/2,y:O.work},{x:m.fx+m.fw-10,y:O.work}],meet:[{x:h.fx+10,y:O.meet},{x:h.fx+h.fw/2,y:O.meet},{x:h.fx+h.fw-10,y:O.meet}],comm:[{x:g.fx+10,y:O.comm},{x:g.fx+g.fw/2,y:O.comm},{x:g.fx+g.fw-10,y:O.comm}]},M=[{id:"exec-window-1",type:"window",room:"exec",zone:"wall",offsetX:10,offsetY:6,windowW:16,windowH:14},{id:"exec-picture-1",type:"picture",room:"exec",zone:"wall",offsetX:34,offsetY:8,pictureColor:"#1565C0"},{id:"exec-picture-2",type:"picture",room:"exec",zone:"wall",offsetX:48,offsetY:8,pictureColor:"#E65100"},{id:"exec-clock",type:"clock",room:"exec",zone:"wall",offsetX:64,offsetY:10},{id:"exec-shelf",type:"shelf",room:"exec",zone:"wall",offsetX:78,offsetY:18},{id:"exec-window-2",type:"window",room:"exec",zone:"wall",offsetX:104,offsetY:6,windowW:16,windowH:14},{id:"work-whiteboard",type:"whiteboard",room:"work",zone:"wall",offsetX:6,offsetY:4},{id:"work-window-1",type:"window",room:"work",zone:"wall",offsetX:50,offsetY:6,windowW:16,windowH:14},{id:"work-window-2",type:"window",room:"work",zone:"wall",offsetX:92,offsetY:6,windowW:16,windowH:14},{id:"meet-bulletin",type:"bulletin-board",room:"meet",zone:"wall",offsetX:6,offsetY:4,facility:{id:"bulletin",label:"BULLETIN",icon:"📋",color:"#F59E0B",hitW:22,hitH:16}},{id:"meet-picture",type:"picture",room:"meet",zone:"wall",offsetX:28,offsetY:8,pictureColor:"#10B981"},{id:"meet-window",type:"window",room:"meet",zone:"wall",offsetX:80,offsetY:6,windowW:16,windowH:14},{id:"meet-shelf",type:"shelf",room:"meet",zone:"wall",offsetX:102,offsetY:18},{id:"comm-screen",type:"screen",room:"comm",zone:"wall",offsetX:6,offsetY:6,facility:{id:"decisions",label:"DECISIONS",icon:"📜",color:"#EF4444",hitW:16,hitH:12}},{id:"comm-picture",type:"picture",room:"comm",zone:"wall",offsetX:28,offsetY:8,pictureColor:"#d4956a"},{id:"comm-window",type:"window",room:"comm",zone:"wall",offsetX:76,offsetY:6,windowW:16,windowH:14},{id:"comm-clock",type:"clock",room:"comm",zone:"wall",offsetX:98,offsetY:10},{id:"comm-shelf",type:"shelf",room:"comm",zone:"wall",offsetX:108,offsetY:18}],q=[{id:"exec-bookshelf",type:"bookshelf",room:"exec",zone:"floor",offsetX:2,offsetY:4},{id:"exec-plant-r",type:"plant",room:"exec",zone:"floor",anchorX:"right",offsetX:-10,offsetY:4},{id:"exec-plant-c",type:"plant",room:"exec",zone:"floor",offsetX:Math.floor(f.fw/2),offsetY:4},{id:"work-plant-1",type:"plant",room:"work",zone:"floor",offsetX:36,offsetY:4},{id:"work-plant-2",type:"plant",room:"work",zone:"floor",offsetX:80,offsetY:4},{id:"meet-plant",type:"plant",room:"meet",zone:"floor",anchorX:"right",offsetX:-12,offsetY:4},{id:"meet-table",type:"meeting-table",room:"meet",zone:"floor",offsetX:10,offsetY:14,condition:"no-desks",facility:{id:"meeting",label:"MEETING",icon:"🏢",color:"#3B82F6",hitW:44,hitH:40}},{id:"comm-coffee-machine",type:"coffee-machine",room:"comm",zone:"floor",anchorX:"right",offsetX:-30,offsetY:4,condition:"no-desks"},{id:"comm-plant-1",type:"plant",room:"comm",zone:"floor",offsetX:38,offsetY:4,condition:"no-desks"},{id:"comm-bookshelf",type:"bookshelf",room:"comm",zone:"floor",anchorX:"right",offsetX:-26,offsetY:16,accent:"#10B981",condition:"no-desks",facility:{id:"knowledge",label:"KNOWLEDGE",icon:"📚",color:"#10B981",hitW:26,hitH:24}},{id:"comm-sofa",type:"sofa",room:"comm",zone:"floor",offsetX:44,offsetY:30,condition:"no-desks"},{id:"comm-coffee-table",type:"coffee-table",room:"comm",zone:"floor",offsetX:50,offsetY:50,condition:"no-desks"},{id:"comm-plant-2",type:"plant",room:"comm",zone:"floor",offsetX:38,offsetY:50,condition:"no-desks"}];return{preset:"L",canvasW:360,canvasH:260,rooms:y,desks:b,doors:_,adjacency:$,corridorY:O,waypoints:B,wallDecorations:M,furniture:q}}const qE=2;function ag(t,l){return l?l==="L"&&t<=12-qE?"M":l==="M"&&t>12?"L":l:t<=12?"M":"L"}function rg(t,l){switch(l??ag(t)){case"S":return UE(t);case"M":return YE(t);case"L":return IE(t)}}function y0(t,l){if(!l||Object.keys(l).length===0)return t;const a=i=>i.map(o=>{const u=l[o.id];return u?{...o,offsetX:u.offsetX,offsetY:u.offsetY}:o});return{...t,wallDecorations:a(t.wallDecorations),furniture:a(t.furniture)}}let us;function XE(t){us=t}function F(t,l,a,i,o,u){t=Math.round(t),l=Math.round(l),!(u!==void 0&&u<.01)&&(u!==void 0&&u!==1&&(us.globalAlpha=u),us.fillStyle=o,us.fillRect(t,l,a,i),u!==void 0&&u!==1&&(us.globalAlpha=1))}function Ge(t,l,a,i){F(t,l,1,1,a,i)}let ac=1;function ei(t){ac=t}function bl(){return ac=ac*16807%2147483647,(ac&65535)/65535}function ig(t){const l=parseInt(t.slice(1,3),16)/255,a=parseInt(t.slice(3,5),16)/255,i=parseInt(t.slice(5,7),16)/255,o=Math.max(l,a,i),u=Math.min(l,a,i);let f=0,m=0;const p=(o+u)/2;if(o!==u){const h=o-u;m=p>.5?h/(2-o-u):h/(o+u),o===l?f=((a-i)/h+(a<i?6:0))/6:o===a?f=((i-l)/h+2)/6:f=((l-a)/h+4)/6}return[f*360,m*100,p*100]}function sg(t,l,a){t=(t%360+360)%360,l=Math.max(0,Math.min(100,l))/100,a=Math.max(0,Math.min(100,a))/100;const i=l*Math.min(a,1-a),o=f=>{const m=(f+t/30)%12;return a-i*Math.max(-1,Math.min(m-3,9-m,1))},u=f=>Math.round(f*255).toString(16).padStart(2,"0");return"#"+u(o(0))+u(o(8))+u(o(4))}function vl(t,l=1){const[a,i,o]=ig(t);return sg(a+15*l,Math.min(100,i+8),o-12*l)}function Rt(t,l=1){const[a,i,o]=ig(t);return sg(a-10*l,i-3,o+10*l)}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"},Aa="#100A06";function VE(t,l,a=14,i=12){F(t,l,a,i,"#4A3828"),F(t+1,l+1,a-2,i-2,"#5A4838"),F(t+2,l+2,a-4,i-4,"#4A7098"),F(t+2,l+2,a-4,Math.floor((i-4)/2),"#6A90B8",.35);const o=Math.floor(a/2);F(t+o,l+1,1,i-2,"#4A3828"),F(t+1,l+Math.floor(i/2),a-2,1,"#4A3828",.5),Ge(t+3,l+3,"#8AB8E8",.35),Ge(t+o+2,l+3,"#8AB8E8",.25),F(t-1,l+i,a+2,2,"#5A4838"),F(t-1,l+i,a+2,1,Rt("#5A4838",.5),.35)}function GE(t,l,a){F(t,l,10,8,"#3A2818"),F(t+1,l+1,8,6,a),F(t+2,l+2,4,3,Rt(a,1.2),.3),Ge(t+3,l+2,Rt(a,2),.25)}function KE(t,l){F(t,l,7,7,"#3A2818"),F(t+1,l+1,5,5,"#F0EDE5"),Ge(t+3,l+1,"#AAA"),Ge(t+3,l+5,"#AAA"),Ge(t+1,l+3,"#AAA"),Ge(t+5,l+3,"#AAA"),Ge(t+3,l+3,"#222"),F(t+3,l+1,1,2,"#333"),Ge(t+4,l+3,"#D32F2F")}function QE(t,l){F(t,l,26,16,"#586878"),F(t+1,l+1,24,13,"#ECEFF1"),F(t+1,l+1,24,1,"#F5F5F5",.4),F(t+3,l+3,14,1,"#1565C0",.6),F(t+3,l+5,18,1,"#333",.2),F(t+3,l+7,12,1,"#D32F2F",.35),F(t+3,l+9,16,1,"#333",.15),F(t+1,l+14,24,2,"#708898"),F(t+3,l+14,3,1,"#D32F2F"),F(t+7,l+14,3,1,"#1565C0"),F(t+11,l+14,3,1,"#2E7D32")}function ZE(t,l){F(t,l,22,16,"#6A5030"),F(t+1,l+1,20,14,"#C4A66A"),ei(88);for(let a=0;a<14;a++)for(let i=0;i<20;i++)bl()>.5&&Ge(t+1+i,l+1+a,bl()>.5?"#B89858":"#D4B87A",.18);F(t+2,l+2,5,4,"#FFF176"),F(t+8,l+2,5,4,"#90CAF9"),F(t+14,l+3,5,4,"#CE93D8"),F(t+3,l+8,7,4,"#C8E6C9"),F(t+11,l+8,8,4,"#F8BBD0"),Ge(t+4,l+2,"#E53935"),Ge(t+10,l+2,"#1E88E5"),Ge(t+16,l+3,"#FF9800")}function WE(t,l){F(t,l,20,3,"#5A4030"),F(t,l,20,1,Rt("#5A4030",.5),.35),F(t,l+2,20,1,vl("#5A4030",.5),.3),F(t+2,l-4,3,4,"#E53935"),F(t+2,l-4,3,1,Rt("#E53935",1),.3),F(t+6,l-3,2,3,"#1E88E5"),F(t+9,l-5,4,5,"#43A047"),F(t+14,l-3,3,3,"#FFD54F"),Ge(t+15,l-3,"#FFF176",.4)}function JE(t,l){F(t,l,16,12,"#1E1E28"),F(t+1,l+1,14,9,"#0C1420"),F(t+2,l+2,12,1,"#EF4444",.6),Ge(t+2,l+4,"#4CAF50"),F(t+4,l+4,7,1,"#8b949e",.4),Ge(t+2,l+6,"#FF9800"),F(t+4,l+6,5,1,"#8b949e",.3),Ge(t+2,l+8,"#42A5F5"),F(t+4,l+8,8,1,"#8b949e",.25),F(t+7,l+10,2,2,"#1E1E28"),F(t+5,l+11,6,1,"#586878")}function PE(t,l,a){F(t+2,l+20,22,2,Aa,.15),F(t,l,22,20,yl.deep),F(t+1,l+1,20,18,yl.base),F(t,l,22,1,yl.hi,.35),F(t,l,1,20,yl.hi,.2);for(const u of[6,12])F(t+1,l+u,20,2,yl.sh),F(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;F(o,l+1,f,5,i[u]),F(o,l+1,f,1,Rt(i[u],1),.35),o+=f+1}o=t+2;for(let u=0;u<4;u++)F(o,l+7,4,5,i[u+3]),F(o,l+7,4,1,Rt(i[u+3],1),.25),o+=5;F(t+2,l+14,4,4,"#FFD54F"),F(t+8,l+14,7,4,"#90CAF9"),a&&F(t,l-1,22,1,a,.7)}function eC(t,l){F(t+2,l+11,6,2,Aa,.1),F(t+2,l+8,6,4,"#8B5E3C"),F(t+1,l+7,8,2,vl("#A06E48",.3)),F(t+2,l+7,6,1,Rt("#A06E48",.5),.4),F(t+1,l+3,3,4,"#2E7D32"),F(t+5,l+2,3,4,"#2E7D32"),F(t+2,l+1,4,4,"#43A047"),F(t+3,l+0,3,3,"#66BB6A"),Ge(t+4,l,"#81C784"),Ge(t+3,l+1,"#A5D6A7",.4)}function tC(t,l){Qa(t+4,l-4,"down"),Qa(t+16,l-4,"down"),Qa(t+28,l-4,"down"),F(t+3,l+24,34,3,Aa,.15),F(t,l+2,36,18,Jt.deep),F(t+1,l+3,34,16,Jt.base),F(t+1,l+3,34,1,Jt.hi,.35);for(let a=0;a<14;a+=3)F(t+1,l+4+a,34,1,vl(Jt.base,.2),.08);F(t,l+20,36,4,Jt.deep),F(t+1,l+21,34,2,Jt.sh),F(t+6,l+7,10,6,"#1A1A24"),F(t+7,l+8,8,4,"#0C1420"),F(t+8,l+9,4,1,"#2A6898",.4),F(t+20,l+8,6,4,"#F0F0F0"),F(t+15,l+7,3,3,"#ECEFF1"),Ge(t+16,l+8,"#795548"),Qa(t+4,l+24,"up"),Qa(t+16,l+24,"up"),Qa(t+28,l+24,"up")}function nC(t,l){F(t+2,l+16,36,3,Aa,.15),F(t,l,36,5,"#5D4037"),F(t+1,l+1,34,3,"#6D4C41"),F(t+1,l+1,34,1,Rt("#6D4C41",.5),.3),F(t,l+5,36,8,"#5D4037"),F(t+2,l+6,15,6,"#6D4C41"),F(t+3,l+6,13,1,Rt("#6D4C41",.5),.35),F(t+19,l+6,15,6,"#6D4C41"),F(t+20,l+6,13,1,Rt("#6D4C41",.5),.35),F(t+17,l+6,2,6,"#5D4037"),F(t,l+13,36,3,vl("#5D4037",1)),F(t-2,l+2,3,12,"#5D4037"),F(t+35,l+2,3,12,"#5D4037"),F(t+4,l+7,6,4,"#FF8A65"),F(t+5,l+7,4,1,Rt("#FF8A65",1),.35)}function lC(t,l){F(t+2,l+10,22,2,Aa,.12),F(t,l,22,8,yl.deep),F(t+1,l+1,20,6,yl.base),F(t+1,l+1,20,1,yl.hi,.3),F(t,l+8,22,2,yl.sh),F(t+3,l+2,6,4,"#F0F0F0"),F(t+13,l+3,3,3,"#ECEFF1"),Ge(t+14,l+4,"#795548")}function aC(t,l){F(t+1,l+14,10,2,Aa,.12),F(t,l,10,14,"#546E7A"),F(t,l,10,1,Rt("#546E7A",1),.35),F(t+1,l+1,8,3,"#78909C"),F(t+1,l+5,8,4,"#37474F"),Ge(t+2,l+6,"#EF5350"),Ge(t+4,l+6,"#66BB6A"),F(t+2,l+11,4,2,"#ECEFF1")}function rC(t,l){F(t+2,l+16,26,3,Aa,.18),F(t,l,26,10,Jt.deep),F(t+1,l+1,24,8,Jt.base),F(t+1,l+2,24,1,Jt.hi,.2),F(t+1,l+4,24,1,vl(Jt.base,.2),.1),F(t+1,l+6,24,1,Jt.hi,.15),F(t+1,l+1,24,1,Jt.hi,.4),F(t+1,l+1,1,8,Jt.hi,.2),F(t,l+10,26,5,Jt.deep),F(t+1,l+11,24,3,Jt.sh),F(t+1,l+10,24,1,vl(Jt.base,1.5),.4),F(t+1,l+14,24,1,Jt.base,.15),F(t+2,l+12,10,1,Jt.deep,.4),F(t+14,l+12,10,1,Jt.deep,.4),Ge(t+7,l+11,"#C8D0D8",.6),Ge(t+19,l+11,"#C8D0D8",.6),F(t+6,l-5,14,7,"#1E1E28"),F(t+7,l-4,12,5,"#0C1420"),F(t+8,l-3,5,1,"#2A6898",.6),F(t+8,l-2,8,1,"#1A3858",.4),F(t+8,l-1,3,1,"#2A6898",.35),Ge(t+7,l-4,"#4A98D8",.25),Ge(t+12,l+1,"#4CAF50",.4),F(t+12,l+2,2,3,"#586878"),F(t+10,l+4,6,1,"#8898A8"),F(t+6,l+4,12,4,"#222228"),F(t+6,l+4,12,1,"#333338",.4);for(let a=0;a<5;a++)Ge(t+7+a*2,l+5,"#444",.6),Ge(t+7+a*2,l+6,"#3A3A3E",.4);F(t+20,l+5,3,4,"#333338"),F(t+20,l+5,3,1,"#444448"),F(t+1,l+3,4,4,"#F0EDE8"),F(t+1,l+3,4,1,"#F8F6F2"),Ge(t+2,l+5,"#6D4C41")}function Qa(t,l,a){F(t+1,l+9,10,2,Aa,.1),Ge(t+5,l+9,"#1E1E22"),Ge(t+1,l+10,"#1A1A1E"),Ge(t+9,l+10,"#1A1A1E"),Ge(t+3,l+11,"#1A1A1E"),Ge(t+7,l+11,"#1A1A1E"),F(t+1,l+2,8,6,xl.base),F(t+2,l+3,6,4,xl.hi,.35),F(t+2,l+3,6,1,Rt(xl.hi,.5),.25),F(t+1,l+7,8,1,xl.deep),a==="up"?(F(t,l+7,10,3,xl.deep),F(t+1,l+8,8,1,xl.sh)):(F(t,l-1,10,3,xl.deep),F(t+1,l,8,1,xl.sh)),F(t,l+3,1,4,xl.sh),F(t+9,l+3,1,4,xl.sh)}const og={bookshelf:(t,l,a)=>PE(t,l,a.accent),plant:(t,l)=>eC(t,l),"meeting-table":(t,l)=>tC(t,l),sofa:(t,l)=>nC(t,l),"coffee-table":(t,l)=>lC(t,l),"coffee-machine":(t,l)=>aC(t,l),window:(t,l,a)=>VE(t,l,a.windowW??16,a.windowH??14),picture:(t,l,a)=>GE(t,l,a.pictureColor??"#1565C0"),clock:(t,l)=>KE(t,l),whiteboard:(t,l)=>QE(t,l),"bulletin-board":(t,l)=>ZE(t,l),shelf:(t,l)=>WE(t,l),screen:(t,l)=>JE(t,l)};function Wr(t,l){const a=t.zone==="wall"?l.wx:l.fx,i=t.zone==="wall"?l.wy:l.fy;return{x:t.anchorX==="right"?(t.zone==="wall"?l.wx+l.ww:l.fx+l.fw)+t.offsetX:a+t.offsetX,y:i+t.offsetY}}function iC(t){for(const l of t.wallDecorations){const a=t.rooms[l.room];if(!a)continue;const{x:i,y:o}=Wr(l,a),u=og[l.type];u&&u(i,o,l)}}function sC(t,l,a){for(const i of t.furniture){const o=t.rooms[i.room];if(!o||i.condition==="no-desks"&&a.has(i.room))continue;const{x:u,y:f}=Wr(i,o),m=og[i.type];m&&l.push({y:f,draw:()=>m(u,f,i)})}}function qr(t){const l=[],a=[...t.wallDecorations,...t.furniture];for(const i of a){if(!i.facility)continue;const o=t.rooms[i.room];if(!o)continue;const{x:u,y:f}=Wr(i,o);l.push({id:i.facility.id,label:i.facility.label,icon:i.facility.icon,color:i.facility.color,dx:u,dy:f,pw:i.facility.hitW,ph:i.facility.hitH})}return l}const oC={bookshelf:{w:22,h:20},plant:{w:10,h:12},"meeting-table":{w:36,h:28},sofa:{w:38,h:16},"coffee-table":{w:22,h:10},"coffee-machine":{w:10,h:14},window:{w:16,h:14},picture:{w:10,h:8},clock:{w:7,h:7},whiteboard:{w:26,h:16},"bulletin-board":{w:22,h:16},shelf:{w:20,h:8},screen:{w:16,h:12}};function $d(t){return oC[t]??{w:16,h:16}}function g0(t,l,a,i){for(let o=t.furniture.length-1;o>=0;o--){const u=t.furniture[o],f=t.rooms[u.room];if(!f||u.condition==="no-desks"&&i.has(u.room))continue;const{x:m,y:p}=Wr(u,f),h=$d(u.type);if(l>=m&&l<=m+h.w&&a>=p&&a<=p+h.h)return u.id}for(let o=t.wallDecorations.length-1;o>=0;o--){const u=t.wallDecorations[o],f=t.rooms[u.room];if(!f)continue;const{x:m,y:p}=Wr(u,f),h=$d(u.type);if(l>=m&&l<=m+h.w&&a>=p&&a<=p+h.h)return u.id}return null}function b0(t,l,a,i,o){const f=[...l.wallDecorations,...l.furniture].find(y=>y.id===a);if(!f||f.condition==="no-desks"&&o.has(f.room))return;const m=l.rooms[f.room];if(!m)return;const{x:p,y:h}=Wr(f,m),g=$d(f.type);t.save(),t.fillStyle=i,t.globalAlpha=.2,t.fillRect(p-1,h-1,g.w+2,g.h+2),t.globalAlpha=.9,t.strokeStyle=i,t.lineWidth=1,t.strokeRect(p-.5,h-.5,g.w+1,g.h+1),t.restore()}const ec=16,cC=4,Ka=4,rc=2,ut=4,Sa=4;let $e=rg(7);const pc={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C","data-analyst":"#0277BD"};let ql=qr($e);function cg(t){return{x:t.dx,y:t.dy,w:t.pw,h:t.ph}}function ug(t){return{cx:t.dx+t.pw/2,botY:t.dy+t.ph}}let gl={};function uC(t){const l={};for(let a=0;a<t.length&&a<$e.desks.length;a++)l[t[a]]=$e.desks[a];return l}let Ft,Ja=null,Za=null,Xr=!1,Gr=null,Kr=null,un=null;function fC(t,l){const{wx:a,wy:i,ww:o,wh:u,wallColor:f,baseboardColor:m}=t,p=vl(f,.5),h=Rt(f,.5),g=[];if(l){const y=l.x-a,b=l.w;y>0&&g.push({sx:a,sw:y}),y+b<o&&g.push({sx:l.x+b,sw:o-y-b})}else g.push({sx:a,sw:o});for(const y of g){F(y.sx,i,y.sw,u,f);for(let b=0;b<u;b+=4)F(y.sx,i+b,y.sw,1,h,.08),F(y.sx,i+b+2,y.sw,1,p,.05);ei(Math.round(y.sx*7+i*13));for(let b=0;b<y.sw;b+=3)bl()>.4&&F(y.sx+b,i,1,u,h,.04);F(y.sx,i,y.sw,2,h,.3),F(y.sx,i,y.sw,1,Rt(f,1),.2),F(y.sx,i+u-2,y.sw,2,p,.3),F(y.sx,i+u,y.sw,rc,m),F(y.sx,i+u,y.sw,1,Rt(m,.5),.4)}l&&(F(l.x-1,i,1,u+rc,"#4A3828"),F(l.x+l.w,i,1,u+rc,"#4A3828"),F(l.x,i,l.w,1,"#0A0808",.12)),F(t.fx,t.fy,t.fw,3,"#0A0808",.12),F(t.fx,t.fy+3,t.fw,2,"#0A0808",.06)}function dC(t){const l="#504038",a=vl(l,.5),i=Rt(l,.5),o=t.wx-Sa,u=t.wy,f=t.wh+rc+t.fh;F(o,u,Sa,f,l),F(o,u,1,f,i,.3),F(o+Sa-1,u,1,f,a,.4);for(let p=0;p<f;p+=6)F(o+1,u+p,Sa-2,1,i,.06);const m=t.wx+t.ww;F(m,u,Sa,f,l),F(m,u,1,f,i,.2),F(m+Sa-1,u,1,f,a,.3)}function gd(t){const{fx:l,fy:a,fw:i,fh:o}=t,u="#B08040",f="#C89848",m="#8A6030",p="#6A4820";F(l,a,i,o,u),ei(42);for(let h=0;h<o;h+=5){const g=Math.floor(h/5)%2*10;for(let y=-10;y<i+10;y+=20){const b=l+y+g,v=Math.max(l,b),k=Math.min(b+19,l+i)-v;if(k<=0)continue;const S=bl()>.5?f:u;F(v,a+h,k,4,S,.25),F(v,a+h,k,1,f,.3),F(v,a+h+4,k,1,p,.35),b>=l&&b<l+i&&F(b,a+h,1,4,p,.2),F(v,a+h+2,k,1,m,.1)}}F(l,a,i,2,"#0A0808",.08),F(l,a,2,o,"#0A0808",.06)}function v0(t){const{fx:l,fy:a,fw:i,fh:o}=t,u="#1C2A38",f="#101820";ei(99),F(l,a,i,o,u);for(let m=0;m<o;m+=ec)for(let p=0;p<i;p+=ec){const h=Math.min(ec,i-p),g=Math.min(ec,o-m);bl()>.5&&F(l+p,a+m,h,g,Rt(u,.2),.15),F(l+p+2,a+m+2,h-4,g-4,Rt(u,.3),.08),F(l+p,a+m,h,1,f,.5),F(l+p,a+m,1,g,f,.5),F(l+p+1,a+m+1,1,g-1,Rt(u,.4),.1),bl()>.85&&Ge(l+p+4+Math.floor(bl()*8),a+m+4+Math.floor(bl()*8),"#3A6A9A",.08)}}function hC(t){const{fx:l,fy:a,fw:i,fh:o}=t,u="#387848",f="#4A9058",m="#285E38";F(l,a,i,o,u),ei(77);for(let h=0;h<o;h+=2)for(let g=0;g<i;g+=2)bl()>.5&&Ge(l+g,a+h,f,.1),bl()>.8&&Ge(l+g+1,a+h+1,m,.12);const p=5;F(l+p,a+p,i-p*2,1,f,.45),F(l+p,a+o-p-1,i-p*2,1,m,.45),F(l+p,a+p,1,o-p*2,f,.35),F(l+i-p-1,a+p,1,o-p*2,m,.35)}function mC(t){const{fx:l,fy:a,fw:i,fh:o}=t,u="#D8C490",f="#B09060",m="#907848";ei(55);for(let p=0;p<o;p+=8)for(let h=0;h<i;h+=8){const g=Math.min(8,i-h),y=Math.min(8,o-p),b=(h/8+p/8)%2===0?f:u;F(l+h,a+p,g,y,b),F(l+h+1,a+p+1,g-2,1,Rt(b,.4),.2),F(l+h+1,a+p+1,1,y-2,Rt(b,.4),.15),F(l+h+g-2,a+p+2,1,y-3,vl(b,.4),.15),F(l+h+2,a+p+y-2,g-3,1,vl(b,.4),.15),F(l+h,a+p,g,1,m,.3),F(l+h,a+p,1,y,m,.3)}}function xC(){const{canvasW:t,canvasH:l,rooms:a,doors:i}=$e,o="#2A1E14",u="#3A2E24";if(F(0,0,t,Ka,o),F(0,l-Ka,t,Ka,o),F(0,0,Ka,l,o),F(t-Ka,0,Ka,l,o),F(0,0,t,1,u,.3),F(0,0,1,l,u,.2),!a.exec||!a.work||!a.meet||!a.comm)return;const f=a.exec,m=a.meet,p=t/2,h=p-ut/2,g=f.fy+f.fh,y=i.exec_work,b=i.meet_comm,v=i.exec_meet,k=i.work_comm,S=24,N=28,E=((y==null?void 0:y.doorY)??f.fy+20)-S/2,_=((v==null?void 0:v.doorX)??Ka+Sa+54)-N/2,$=((k==null?void 0:k.doorX)??p+ut/2+Sa+54)-N/2,O=((b==null?void 0:b.doorY)??m.fy+20)-S/2;F(0,g,_,ut,o),F(_+N,g,h-_-N,ut,o),F(h+ut,g,$-h-ut,ut,o),F($+N,g,t-$-N,ut,o),F(0,g,_,1,u,.3),F(_+N,g,h-_-N,1,u,.3),F(h+ut,g,$-h-ut,1,u,.3),F($+N,g,t-$-N,1,u,.3),F(h,0,ut,E,o),F(h,E+S,ut,g-E-S,o),F(h,g+ut,ut,O-g-ut,o),F(h,O+S,ut,l-O-S,o),F(h,0,1,E,u,.2),F(h,E+S,1,g-E-S,u,.2),F(h,g+ut,1,O-g-ut,u,.2),F(h,O+S,1,l-O-S,u,.2),F(h,E,ut,S,"#C4A070"),F(h+ut/2,E,ut/2,S,"#3A4858"),F(h,O,ut,S,"#7AA880"),F(h+ut/2,O,ut/2,S,"#C8B890");const B="#4A3828";F(h,E-1,ut,1,B),F(h,E+S,ut,1,B),F(_-1,g,1,ut,B),F(_+N,g,1,ut,B),F($-1,g,1,ut,B),F($+N,g,1,ut,B),F(h,O-1,ut,1,B),F(h,O+S,ut,1,B)}const w0=new Map;function pC(t){const l=`${t.hairStyle??""}|${t.outfitStyle??""}|${t.accessory??""}`;let a=w0.get(l);if(!a){const i=_d("mini-seated:default"),o=Ly(i,t);a=o?o.layers.flatMap(u=>u.pixels):[],w0.set(l,a)}return a}function yC(t,l,a){Fd(Ft,pC(a),t,l,a)}function gC(t,l,a,i,o){Qa(t+8,l+20,"up"),o||yC(t+8,l+0+i,a),rC(t,l+14)}function bC(t,l,a,i,o){const u=i in p0?i:"down",f=o%4,m=p0[u][f];Fd(Ft,m,t,l,a);const p=f===1||f===3?-1:0;if(a.accessory&&a.accessory!=="none"){const h=dS(a.accessory,u);h&&h.pixels.length>0&&Fd(Ft,h.pixels,t,l+p,a)}Ft.globalAlpha=1}function vC(t){const l={};let a=0;for(const i of t){const o=gl[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:a*17,stateTimer:600+Math.floor(Math.random()*900)},a++)}return l}function ms(t,l,a,i,o){const u=$e.corridorY[o]??l,f=[];return l<u-4&&f.push({x:t,y:u}),Math.abs(t-a)>4&&f.push({x:a,y:u}),f.push({x:a,y:i}),f}function bd(t,l,a,i){const o=$e.adjacency[a];if(!o)return[];const u=o.find(g=>g.room===i);if(!u)return[];const f=$e.doors[u.door];if(!f)return[];const m=[],p=$e.corridorY[a]??l,h=$e.corridorY[i]??l;if(Math.abs(l-p)>4&&m.push({x:t,y:p}),f.type==="v"){const g=u.side==="A"?f.xA:f.xB,y=u.side==="A"?f.xB:f.xA;m.push({x:g,y:p}),m.push({x:g,y:f.doorY}),m.push({x:y,y:f.doorY}),m.push({x:y,y:h})}else{const g=u.side==="A"?f.yA:f.yB,y=u.side==="A"?f.yB:f.yA;m.push({x:f.doorX,y:p}),m.push({x:f.doorX,y:g}),m.push({x:f.doorX,y}),m.push({x:f.doorX,y:h})}return m}function fg(t,l){const a=$e.adjacency[t.room];if(!a)return[];if(!a.find(o=>o.room===l)){for(const o of a){const u=$e.adjacency[o.room];if(u!=null&&u.find(f=>f.room===l)){const f=bd(t.x,t.y,t.room,o.room),m=f[f.length-1],p=bd((m==null?void 0:m.x)??t.x,(m==null?void 0:m.y)??t.y,o.room,l);return[...f,...p]}}return[]}return bd(t.x,t.y,t.room,l)}function wC(t){if(t.room!==t.homeRoom){const l=fg({...t},t.homeRoom),a=l[l.length-1],i=ms((a==null?void 0:a.x)??t.x,(a==null?void 0:a.y)??t.y,t.homeX,t.homeY,t.homeRoom);return[...l,...i]}return ms(t.x,t.y,t.homeX,t.homeY,t.room)}function kC(t,l){for(const[,a]of Object.entries(t))if(a.stateTimer--,a.state==="sitting"){if(a.bobY=(l+a.bobOff)%60<30?1:0,a.stateTimer<=0){a.state="walking",a.x=a.homeX,a.y=a.homeY,a.room=a.homeRoom;const i=Object.keys($e.rooms);if(Math.random()<.25&&i.length>1){const o=i.filter(p=>p!==a.room),u=o[Math.floor(Math.random()*o.length)],f=fg(a,u),m=$e.waypoints[u];if(m&&m.length>0){const p=m[Math.floor(Math.random()*m.length)],h=f[f.length-1]??{x:a.x,y:a.y},g=ms(h.x,h.y,p.x,p.y,u);a.path=[...f,...g]}else a.path=f;a.walkTimer=0}else{const o=$e.waypoints[a.room];if(o&&o.length>0){const u=o[Math.floor(Math.random()*o.length)];a.path=ms(a.x,a.y,u.x,u.y,a.room)}a.walkTimer=0}}}else if(a.state==="walking"||a.state==="returning"){if(a.path.length===0){a.state==="returning"?(a.state="sitting",a.room=a.homeRoom,a.stateTimer=800+Math.floor(Math.random()*1200)):(a.state="idle",a.dir="down",a.stateTimer=180+Math.floor(Math.random()*360));continue}const i=a.path[0],o=i.x-a.x,u=i.y-a.y,f=Math.sqrt(o*o+u*u);if(f<1.5){a.x=i.x,a.y=i.y,a.path.shift();for(const[m,p]of Object.entries($e.rooms))if(a.x>=p.fx&&a.x<=p.fx+p.fw&&a.y>=p.fy&&a.y<=p.fy+p.fh){a.room=m;break}}else a.x+=o/f*.2,a.y+=u/f*.2,Math.abs(o)>Math.abs(u)?a.dir=o>0?"right":"left":a.dir=u>0?"down":"up",a.walkTimer++,a.walkFrame=Math.floor(a.walkTimer/12)%4}else if(a.state==="idle"&&a.stateTimer<=0)if(Math.random()<.3){a.state="walking";const i=$e.waypoints[a.room];if(i&&i.length>0){const o=i[Math.floor(Math.random()*i.length)];a.path=ms(a.x,a.y,o.x,o.y,a.room)}a.walkTimer=0}else a.state="returning",a.path=wC(a),a.walkTimer=0}function SC(t,l,a){const{canvasW:i,canvasH:o,rooms:u}=$e;Ft.clearRect(0,0,i,o),F(0,0,i,o,"#2A1E14");const f={wood:gd,dark:v0,carpet:hC,tile:mC};for(const y of Object.values(u))(f[y.floorType]??gd)(y);const m=Object.keys(u);if(m.length>=4){const y=u.exec,b=u.meet,{doors:v}=$e;if(y&&b&&v.exec_meet&&v.work_comm){const S=(v.exec_meet.doorX??0)-14,N=(v.work_comm.doorX??0)-28/2,E=y.fy+y.fh,_=b.fy;gd({fx:S,fy:E,fw:28,fh:_-E}),v0({fx:N,fy:E,fw:28,fh:_-E})}}const p={};if(m.length>=4){const{doors:y}=$e,b=28,v=y.exec_meet,k=y.work_comm;v!=null&&v.doorX&&(p.meet={x:v.doorX-b/2,w:b}),k!=null&&k.doorX&&(p.comm={x:k.doorX-b/2,w:b})}for(const y of Object.values(u))fC(y,p[y.id]),dC(y);xC(),iC($e);const h=[],g=new Set(Object.values(gl).map(y=>y.room));sC($e,h,g);for(const[y,b]of Object.entries(gl)){const v=t[y];if(!v)continue;const k=v.state==="sitting",S=l(y),N=a[y]==="working";h.push({y:b.dy+14,draw:()=>{if(gC(b.dx,b.dy,S,k?v.bobY:0,!k),k&&N){const E=pc[y]??"#388bfd";F(b.dx+7,b.dy+14-4,12,5,E,.15),Ge(b.dx+12,b.dy+14+1,"#4CAF50",.8)}}})}for(const[y,b]of Object.entries(t))if(b.state!=="sitting"){const v=l(y);h.push({y:b.y+14,draw:()=>bC(Math.round(b.x),Math.round(b.y),v,b.dir,b.walkFrame)})}h.sort((y,b)=>y.y-b.y);for(const y of h)y.draw();for(const y of ql){const b=Za===y.id,v=ug(y);if(Ft.save(),Ft.globalAlpha=b?.9:.5,Ft.fillStyle=y.color,Ft.fillRect(v.cx-1,v.botY-2,3,3),b){const k=cg(y);Ft.globalAlpha=.3,Ft.strokeStyle=y.color,Ft.lineWidth=1,Ft.strokeRect(k.x-1,k.y-1,k.w+2,k.h+2)}Ft.restore()}if(Xr){const y=new Set(Object.values(gl).map(b=>b.room));Gr&&Gr!==Kr&&b0(Ft,$e,Gr,"#FBBF24",y),Kr&&b0(Ft,$e,Kr,"#3B82F6",y)}if(Ja){const y=gl[Ja],b=t[Ja];y&&b&&(Ft.save(),Ft.globalAlpha=.25,Ft.fillStyle=pc[Ja]??"#fff",b.state==="sitting"?Ft.fillRect(y.dx-1,y.dy+6,28,30):Ft.fillRect(Math.round(b.x)-1,Math.round(b.y)-1,14,24),Ft.restore())}}function jC({roles:t,projects:l,roleStatuses:a,activeExecs:i,onRoleClick:o,onProjectClick:u,onBulletinClick:f,onDecisionsClick:m,onKnowledgeClick:p,getRoleSpeech:h,getAppearance:g,onHireClick:y}){const b=j.useRef(null),v=j.useRef(null),k=j.useRef(null),S=j.useRef({}),N=j.useRef(0),E=j.useRef(cC),[_,$]=j.useState(!1),O=j.useRef({});j.useEffect(()=>{Xr=_},[_]),j.useEffect(()=>{Ae.getPreferences().then(ae=>{const D=ae.furnitureOverrides;D&&Object.keys(D).length>0&&(O.current=D,$e=y0($e,D),ql=qr($e))}).catch(()=>{})},[]);const B=j.useRef({roleStatuses:a,activeExecs:i,getRoleSpeech:h,getAppearance:g});B.current={roleStatuses:a,activeExecs:i,getRoleSpeech:h,getAppearance:g};const M=j.useMemo(()=>t.map(ae=>ae.id),[t]),q=j.useRef($e);j.useEffect(()=>{const ae=M.length,D=ag(ae,q.current.preset);let T=rg(ae,D);Object.keys(O.current).length>0&&(T=y0(T,O.current)),$e=T,q.current=T,gl=uC(M),ql=qr(T),S.current=vC(M);const X=b.current;X&&(X.width=T.canvasW,X.height=T.canvasH),P()},[M]);const G=j.useCallback(ae=>{var D,T;return((T=(D=B.current).getAppearance)==null?void 0:T.call(D,ae))??ch(ae)},[]),P=j.useCallback(()=>{const ae=v.current,D=b.current;if(!ae||!D)return;const T=ae.parentElement;if(!T)return;const X=T.clientWidth,A=T.clientHeight;if(X===0||A===0)return;const{canvasW:se,canvasH:de}=$e;let he=Math.floor(Math.min(X/se,A/de));he=Math.max(2,Math.min(he,5)),E.current=he,D.style.width=se*he+"px",D.style.height=de*he+"px",ae.style.width=se*he+"px",ae.style.height=de*he+"px"},[]);j.useEffect(()=>{var de;const ae=b.current;if(!ae)return;const D=ae.getContext("2d");if(!D)return;Ft=D,XE(D),P();const T=new ResizeObserver(()=>P()),X=(de=v.current)==null?void 0:de.parentElement;X&&T.observe(X);let A;const se=()=>{N.current++,kC(S.current,N.current),SC(S.current,G,B.current.roleStatuses),z(),A=requestAnimationFrame(se)};return A=requestAnimationFrame(se),()=>{cancelAnimationFrame(A),T.disconnect()}},[G,P]),j.useEffect(()=>{const ae=k.current;if(!ae)return;ae.innerHTML="";for(const T of M){const X=pc[T]??"#8b949e",A=document.createElement("div");A.className="td-nametag",A.dataset.role=T;const se=document.createElement("span");se.className="td-dot",se.style.background=X,A.appendChild(se),A.appendChild(document.createTextNode(T.toUpperCase())),ae.appendChild(A);const de=document.createElement("div");de.className="td-bubble",de.dataset.role=T,de.dataset.type="bubble",ae.appendChild(de)}const D={meeting:()=>{const T=l[0];T?u(T.id):f()},bulletin:f,decisions:m,knowledge:p};for(const T of ql){const X=document.createElement("div");X.className="td-facility-label",X.dataset.facility=T.id,X.textContent=`${T.icon} ${T.label}`,X.style.borderColor=`${T.color}44`;const A=D[T.id];A&&X.addEventListener("click",A),X.addEventListener("mouseenter",()=>{Za=T.id}),X.addEventListener("mouseleave",()=>{Za=null}),ae.appendChild(X)}},[M,l,u,f,m,p]);const z=j.useCallback(()=>{var de;const ae=k.current;if(!ae)return;const D=E.current,T=S.current,{getRoleSpeech:X,roleStatuses:A,activeExecs:se}=B.current;for(const he of Object.keys(T)){const we=T[he],Ce=gl[he];if(!Ce)continue;let Oe,pe,Ke;we.state==="sitting"?(Oe=Ce.dx+13,Ke=Ce.dy+2,pe=Ce.dy+37):(Oe=Math.round(we.x)+6,Ke=Math.round(we.y)-2,pe=Math.round(we.y)+18);const lt=Oe/$e.canvasW*100,me=ae.querySelector(`.td-nametag[data-role="${he}"]`);if(me){me.style.left=lt+"%",me.style.top=pe*D+2+"px";const qe=me.querySelector(".td-dot");if(qe){const Mt=A[he]==="working";qe.style.background=Mt?"#FBBF24":pc[he]??"#8b949e",Mt?qe.style.animation="td-pulse 1s ease-in-out infinite":qe.style.animation=""}}const Ee=ae.querySelector(`.td-bubble[data-role="${he}"]`);if(Ee){const qe=A[he]==="working",Mt=(de=se.find(_t=>_t.roleId===he))==null?void 0:de.task,mt=X(he),Yt=qe&&Mt?Mt.slice(0,30):mt?mt.slice(0,30):"";Yt&&we.state==="sitting"?(Ee.style.display="",Ee.style.left=lt+"%",Ee.style.top=(Ke-5)*D+"px",Ee.textContent=Yt):Ee.style.display="none"}}for(const he of ql){const we=ae.querySelector(`.td-facility-label[data-facility="${he.id}"]`);if(we){const Ce=ug(he);we.style.left=Ce.cx/$e.canvasW*100+"%",we.style.top=Ce.botY*D+2+"px",we.classList.toggle("td-facility-label--hover",Za===he.id)}}},[]),U=j.useCallback(ae=>{const D=b.current;if(!D)return null;const T=D.getBoundingClientRect(),X=E.current,A=(ae.clientX-T.left)/X,se=(ae.clientY-T.top)/X,de=S.current;for(const[he,we]of Object.entries(gl)){if(!de[he])continue;const Ce=de[he];if(Ce.state==="sitting"){if(A>=we.dx&&A<=we.dx+26&&se>=we.dy&&se<=we.dy+40)return{type:"role",id:he}}else if(A>=Ce.x-2&&A<=Ce.x+14&&se>=Ce.y-2&&se<=Ce.y+20)return{type:"role",id:he}}for(const he of ql){const we=cg(he);if(A>=we.x&&A<=we.x+we.w&&se>=we.y&&se<=we.y+we.h)return{type:"facility",id:he.id}}return null},[]),L=j.useCallback(ae=>{const D=b.current;if(!D)return{mx:0,my:0};const T=D.getBoundingClientRect(),X=E.current;return{mx:(ae.clientX-T.left)/X,my:(ae.clientY-T.top)/X}},[]),ee=j.useCallback(ae=>{O.current=ae,Ae.updatePreferences({furnitureOverrides:ae}).catch(()=>{})},[]),ne=j.useCallback(ae=>{const D=b.current;if(Xr&&un){const{mx:X,my:A}=L(ae),de=[...$e.furniture,...$e.wallDecorations].find(Ke=>Ke.id===un.defId);if(!de||!$e.rooms[de.room])return;const we=X-un.startMx,Ce=A-un.startMy,Oe=Math.round(un.origOffX+we),pe=Math.round(un.origOffY+Ce);de.offsetX=Oe,de.offsetY=pe,ql=qr($e),D&&(D.style.cursor="grabbing");return}if(Xr){const{mx:X,my:A}=L(ae),se=new Set(Object.values(gl).map(he=>he.room)),de=g0($e,X,A,se);Gr=de,Ja=null,Za=null,D&&(D.style.cursor=de?"grab":"default");return}const T=U(ae);Ja=(T==null?void 0:T.type)==="role"?T.id:null,Za=(T==null?void 0:T.type)==="facility"?T.id:null,Gr=null,D&&(D.style.cursor=T?"pointer":"default")},[U,L]),V=j.useCallback(ae=>{if(!Xr)return;const{mx:D,my:T}=L(ae),X=new Set(Object.values(gl).map(se=>se.room)),A=g0($e,D,T,X);if(A){const de=[...$e.furniture,...$e.wallDecorations].find(he=>he.id===A);de&&(Kr=A,un={defId:A,startMx:D,startMy:T,origOffX:de.offsetX,origOffY:de.offsetY},ae.preventDefault())}else Kr=null},[L]),Y=j.useCallback(ae=>{if(!un)return;const T=[...$e.furniture,...$e.wallDecorations].find(X=>X.id===un.defId);if(T){const X={...O.current,[T.id]:{offsetX:T.offsetX,offsetY:T.offsetY}};ee(X),ql=qr($e)}un=null,b.current&&(b.current.style.cursor="grab")},[ee]),Q=j.useCallback(()=>{if(un){const D=[...$e.furniture,...$e.wallDecorations].find(T=>T.id===un.defId);D&&(D.offsetX=un.origOffX,D.offsetY=un.origOffY,ql=qr($e)),un=null}Ja=null,Za=null,Gr=null,b.current&&(b.current.style.cursor="default")},[]),re=j.useCallback(ae=>{if(Xr)return;const D=U(ae);if(D){if(D.type==="role"){o(D.id);return}switch(D.id){case"meeting":{const T=l[0];T?u(T.id):f();break}case"bulletin":f();break;case"decisions":m();break;case"knowledge":p();break}}},[U,o,u,f,m,p]);return c.jsxs("div",{className:"td-scene",children:[c.jsxs("div",{ref:v,className:"td-wrap",children:[c.jsx("canvas",{ref:b,width:$e.canvasW,height:$e.canvasH,className:"td-canvas",onClick:re,onMouseDown:V,onMouseUp:Y,onMouseMove:ne,onMouseLeave:Q}),c.jsx("div",{ref:k,className:"td-overlay"})]}),c.jsxs("button",{className:`td-edit-btn${_?" td-edit-btn--active":""}`,onClick:()=>{$(ae=>!ae),Kr=null,un=null},title:_?"Exit Edit Mode":"Edit Furniture Layout",children:[c.jsx("span",{className:"td-edit-btn__icon",children:_?"✓":"✎"}),c.jsx("span",{className:"td-edit-btn__label",children:_?"DONE":"EDIT"})]}),y&&c.jsxs("button",{className:"td-hire-btn",onClick:y,title:"Hire New Role",children:[c.jsx("span",{className:"td-hire-btn__icon",children:"+"}),c.jsx("span",{className:"td-hire-btn__label",children:"HIRE"})]})]})}function EC({role:t,appearance:l,onSave:a,onReset:i,onClose:o,theme:u,onThemeChange:f,onUpdateName:m,initialTab:p,speechSettings:h,onSpeechSettingsChange:g,language:y,onLanguageChange:b}){var P;const[v,k]=j.useState(p??"character"),[S,N]=j.useState({...l}),[E,_]=j.useState(t.name),[$,O]=j.useState(!1),B=j.useCallback(()=>N(cs()),[]),M=j.useCallback(()=>{const z=ch(t.id);N({...z}),i()},[t.id,i]),q=j.useCallback(async()=>{a(S);const z=E.trim();if(m&&z&&z!==t.name){O(!0);try{await m(t.id,z)}catch{}O(!1)}o()},[S,a,o,E,t.name,t.id,m]),G=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:z=>_(z.target.value),disabled:$,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:z=>z.stopPropagation(),children:[c.jsxs("div",{className:"customize-header",children:[c.jsxs("div",{className:"customize-tabs",children:[c.jsx("button",{className:`customize-tab ${v==="character"?"active":""}`,onClick:()=>k("character"),children:"CHARACTER"}),c.jsx("button",{className:`customize-tab ${v==="office"?"active":""}`,onClick:()=>k("office"),children:"OFFICE THEME"}),c.jsx("button",{className:`customize-tab ${v==="settings"?"active":""}`,onClick:()=>k("settings"),children:"SETTINGS"})]}),c.jsx("button",{className:"customize-close",onClick:o,children:"X"})]}),v==="character"?c.jsx("div",{className:"customize-body",children:c.jsx(Jy,{roleId:t.id,appearance:S,onChange:N,onRandomize:B,onReset:M,label:G})}):v==="office"?c.jsx("div",{className:"customize-body",children:c.jsx("div",{className:"customize-themes",children:Object.entries(Ea).map(([z,U])=>c.jsxs("button",{className:`customize-theme-card ${u===z?"active":""}`,onClick:()=>f(z),children:[c.jsxs("div",{className:"customize-theme-preview",style:{background:U.vars["--floor-light"],borderColor:U.vars["--pixel-border"]},children:[c.jsx("div",{style:{background:U.vars["--hud-bg"],height:8,borderBottom:`2px solid ${U.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:U.vars["--accent"],borderRadius:1}}),c.jsx("div",{style:{width:10,height:14,background:U.vars["--active-green"],borderRadius:1}}),c.jsx("div",{style:{width:10,height:14,background:U.vars["--idle-amber"],borderRadius:1}})]}),c.jsx("div",{style:{background:U.vars["--hud-bg"],height:6,borderTop:`2px solid ${U.vars["--pixel-border"]}`}})]}),c.jsxs("div",{className:"customize-theme-name",children:[U.icon," ",U.name]})]},z))})}):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(z=>c.jsxs("button",{onClick:()=>g==null?void 0:g({mode:z}),style:{flex:1,padding:"8px 12px",fontSize:11,border:`2px solid ${(h==null?void 0:h.mode)===z?"var(--accent)":"rgba(255,255,255,0.1)"}`,background:(h==null?void 0:h.mode)===z?"rgba(255,255,255,0.08)":"transparent",color:(h==null?void 0:h.mode)===z?"var(--terminal-text)":"var(--terminal-text-muted)",borderRadius:6,cursor:"pointer",textAlign:"center"},children:[c.jsx("div",{style:{fontWeight:600,marginBottom:2},children:z==="template"?"TEMPLATE":z==="llm"?"AI":"AUTO"}),c.jsx("div",{style:{fontSize:9,opacity:.7},children:z==="template"?"Static pool ($0)":z==="llm"?"LLM generated":"Detect engine"})]},z))}),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:z=>g==null?void 0:g({intervalSec:Number(z.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: $",((P=h==null?void 0:h.dailyBudgetUsd)==null?void 0:P.toFixed(2))??"1.00"]}),c.jsx("input",{type:"range",min:0,max:5,step:.25,value:(h==null?void 0:h.dailyBudgetUsd)??1,onChange:z=>g==null?void 0:g({dailyBudgetUsd:Number(z.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"})]})]}),c.jsxs("div",{children:[c.jsx("div",{style:{fontSize:11,fontWeight:600,marginBottom:8,color:"var(--terminal-text)"},children:"LANGUAGE"}),c.jsx("div",{style:{display:"flex",gap:6},children:[{key:"auto",label:"Auto"},{key:"en",label:"English"},{key:"ko",label:"한국어"},{key:"ja",label:"日本語"}].map(({key:z,label:U})=>c.jsx("button",{onClick:()=>b==null?void 0:b(z),style:{flex:1,padding:"8px 12px",fontSize:11,border:`2px solid ${(y??"auto")===z?"var(--accent)":"rgba(255,255,255,0.1)"}`,background:(y??"auto")===z?"rgba(255,255,255,0.08)":"transparent",color:(y??"auto")===z?"var(--terminal-text)":"var(--terminal-text-muted)",borderRadius:6,cursor:"pointer",textAlign:"center",fontWeight:600},children:U},z))}),c.jsx("div",{style:{fontSize:9,color:"var(--terminal-text-muted)",marginTop:4},children:"Sets language for AI responses and speech bubbles"})]})]})}),v==="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:q,children:"SAVE"})]})]})})}function k0(t){const l=Date.now()-new Date(t).getTime(),a=Math.floor(l/6e4);if(a<1)return"just now";if(a<60)return`${a}m ago`;const i=Math.floor(a/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function CC({status:t,history:l,onClose:a,onSave:i,onLoadHistory:o,onRestore:u,saving:f}){const[m,p]=j.useState("save"),[h,g]=j.useState(""),[y,b]=j.useState(null),[v,k]=j.useState(!1),[S,N]=j.useState(null),E=j.useRef(null);j.useEffect(()=>{m==="history"&&o()},[m,o]),j.useEffect(()=>{var M;(M=E.current)==null||M.focus()},[]);const _=[...((t==null?void 0:t.modified)??[]).map(M=>({status:"M",file:M})),...((t==null?void 0:t.untracked)??[]).map(M=>({status:"A",file:M}))],$=async()=>{b(null),N(null);try{const M=await i(h||void 0);N(M),g("")}catch(M){b(M instanceof Error?M.message:"Save failed")}},O=async M=>{if(confirm(`Restore from commit ${M.slice(0,7)}? This creates a new commit with those files.`)){k(!0);try{await u(M),k(!1)}catch(q){b(q instanceof Error?q.message:"Restore failed"),k(!1)}}};j.useEffect(()=>{const M=q=>{q.key==="Escape"&&a()};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[a]);const B=M=>{M.key==="Enter"&&(M.metaKey||M.ctrlKey)&&$()};return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 bg-black/40 z-[60] backdrop-blur-sm",onClick:a}),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:B,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:a,className:"text-[var(--terminal-text-secondary)] hover:text-[var(--terminal-text)] cursor-pointer text-lg",children:"×"})]}),c.jsx("div",{className:"flex shrink-0",style:{borderBottom:"2px solid var(--pixel-border)"},children:["save","history"].map(M=>c.jsx("button",{onClick:()=>p(M),className:"flex-1 py-2 text-[11px] font-bold uppercase tracking-wider cursor-pointer",style:{background:m===M?"var(--hud-bg-alt)":"transparent",color:m===M?"var(--terminal-text)":"var(--terminal-text-muted)",borderBottom:m===M?"2px solid var(--accent)":"2px solid transparent"},children:M==="save"?"SAVE":"HISTORY"},M))}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-5 space-y-4",children:[m==="save"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"text-[11px]",style:{color:"var(--terminal-text-secondary)"},children:_.length>0?c.jsxs("span",{style:{color:"var(--idle-amber)"},children:["* ",_.length," unsaved change",_.length>1?"s":""]}):c.jsx("span",{style:{color:"var(--active-green)"},children:"All changes saved"})}),_.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:_.map(({status:M,file:q})=>c.jsxs("div",{className:"flex gap-2",children:[c.jsx("span",{style:{color:M==="A"?"var(--active-green)":"var(--idle-amber)",width:"14px"},children:M}),c.jsx("span",{style:{color:"var(--terminal-text-secondary)"},children:q})]},q))})]}),_.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:E,type:"text",value:h,onChange:M=>g(M.target.value),placeholder:"Optional: describe your progress...",className:"w-full px-3 py-2 text-[12px] outline-none",style:{background:"var(--terminal-bg)",border:"1px solid var(--terminal-border)",color:"var(--terminal-text)",fontFamily:"var(--pixel-font)"}})]}),_.length>0&&c.jsx("div",{className:"flex gap-3",children:c.jsx("button",{onClick:$,disabled:f,className:"flex-1 py-2.5 text-[12px] font-black uppercase tracking-wider cursor-pointer disabled:opacity-50",style:{background:"var(--accent)",color:"#fff",border:"2px solid var(--accent)"},children:f?"SAVING...":t!=null&&t.hasRemote?"SAVE & PUSH":"SAVE"})}),_.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"}),S&&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! ",S.filesChanged," file",S.filesChanged>1?"s":""," committed",S.pushed?" & pushed":"",S.pushError?` (push error: ${S.pushError})`:""]}),y&&c.jsx("div",{className:"text-[11px] p-2",style:{background:"rgba(211,47,47,0.1)",border:"1px solid #D32F2F",color:"#EF5350"},children:y}),(t==null?void 0:t.lastCommit)&&c.jsxs("div",{className:"text-[10px]",style:{color:"var(--terminal-text-muted)"},children:["Last save: ",t.lastCommit.message," (",k0(t.lastCommit.date),")"]})]}),m==="history"&&c.jsxs(c.Fragment,{children:[l.length===0&&c.jsx("div",{className:"text-[11px] text-center py-8",style:{color:"var(--terminal-text-muted)"},children:"No save history"}),c.jsx("div",{className:"space-y-1",children:l.map(M=>c.jsxs("div",{className:"flex items-center justify-between py-2 px-3 group",style:{background:"var(--hud-bg-alt)",border:"1px solid var(--terminal-border)"},children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-[11px] font-mono",style:{color:"var(--accent)"},children:M.shortSha}),c.jsx("span",{className:"text-[11px] truncate",style:{color:"var(--terminal-text)"},children:M.message})]}),c.jsx("div",{className:"text-[10px]",style:{color:"var(--terminal-text-muted)"},children:k0(M.date)})]}),c.jsx("button",{onClick:()=>O(M.sha),disabled:v,className:"text-[10px] font-bold px-2 py-1 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",style:{background:"var(--terminal-bg)",border:"1px solid var(--terminal-border)",color:"var(--idle-amber)"},children:"LOAD"})]},M.sha))})]})]})]})]})}const NC={cto:"🏗️",cbo:"📊",pm:"📋",engineer:"⚙️",designer:"🎨",qa:"🔍","data-analyst":"📊"},ic={cto:"#1565C0",cbo:"#E65100",pm:"#2E7D32",engineer:"#4A148C",designer:"#AD1457",qa:"#00695C","data-analyst":"#0277BD"},AC={cto:8,cbo:7,pm:6,engineer:5,designer:5,qa:4,"data-analyst":4},DC={cto:"아키텍처",cbo:"시장 분석",pm:"PRD 작성",engineer:"코딩",designer:"시안 제작",qa:"품질 검증"};function TC(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 zC({importJob:t,onImportDone:l}){var oi,or,Cl;const[a,i]=j.useState([]),[o,u]=j.useState([]),[f,m]=j.useState([]),[p,h]=j.useState([]),[g,y]=j.useState([]),[b,v]=j.useState([]),[k,S]=j.useState("TYCONO"),[N,E]=j.useState(!0),[_,$]=j.useState(null),[O,B]=j.useState({type:"none"}),[M,q]=j.useState(null),[G,P]=j.useState(null),[z,U]=j.useState([]),[L,ee]=j.useState(!1),[ne,V]=j.useState([]),[Y,Q]=j.useState(0),[re,ae]=j.useState(!1),[D,T]=j.useState({}),[X,A]=j.useState("ceo"),[se,de]=j.useState(null),[he,we]=j.useState(!1),[Ce,Oe]=j.useState(!1),[pe,Ke]=j.useState(null),[lt,me]=j.useState({}),[Ee,qe]=j.useState([]),[Mt,mt]=j.useState([]),[Yt,_t]=j.useState(void 0),[on,Ct]=j.useState(!1);j.useEffect(()=>{Ae.getStatus().then(H=>{_t(H.engine),Ct(!!H.hasApiKey)}).catch(()=>{})},[]);const{getAppearance:Ot,setAppearance:Ln,resetAppearance:Bt,theme:Hn,setTheme:le,speechSettings:ye,setSpeechSettings:Te,language:xe,setLanguage:be}=gE(),[rt,xt]=j.useState(null),[Xe,ue]=j.useState("character"),De=vE(),[it,gn]=j.useState(!1);j.useEffect(()=>{const H=fe=>{(fe.metaKey||fe.ctrlKey)&&fe.key==="s"&&(fe.preventDefault(),De.dirtyCount>0&&gn(!0))};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[De.dirtyCount]);const[en,ti]=j.useState(null),[Jn,Pn]=j.useState(null),[el,ol]=j.useState([]),[tl,Gl]=j.useState(!1),Es=j.useRef(!1),lr=j.useRef(null);let ar=j.useRef(0);const An=(H,fe,ve)=>{const Se={id:ar.current++,type:H,text:fe,detail:ve};ol(ke=>[...ke,Se])};j.useEffect(()=>{var H;tl&&((H=lr.current)==null||H.scrollIntoView({behavior:"smooth"}))},[el,tl]),j.useEffect(()=>{t&&(Es.current||(Es.current=!0,Pn("Scanning knowledge sources..."),ol([{id:0,type:"scan",text:"Starting knowledge import..."}]),ar.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 H=>{var ke;const fe=(ke=H.body)==null?void 0:ke.getReader();if(!fe)return;const ve=new TextDecoder;let Se="";for(;;){const{done:Me,value:Be}=await fe.read();if(Me)break;Se+=ve.decode(Be,{stream:!0});const Je=Se.split(`
88
+ `);Se=Je.pop()||"";let st="";for(const Le of Je)if(Le.startsWith("event: "))st=Le.slice(7).trim();else if(Le.startsWith("data: ")&&st){try{const ht=JSON.parse(Le.slice(6));switch(st){case"scanning":Pn(`Scanning: ${ht.path} (${ht.fileCount} files)`),An("scan",`Found ${ht.fileCount} files`,ht.path);break;case"processing":ti({index:ht.index,total:ht.total}),Pn(`Importing knowledge... (${ht.index}/${ht.total})`),An("process",`Processing: ${ht.file}`,`${ht.index} / ${ht.total}`);break;case"created":An("created",ht.title,ht.summary);break;case"skipped":An("process",`Skipped: ${ht.file}`,ht.reason);break;case"done":Pn(null),ti(null),An("done",`Import complete! ${ht.created} created, ${ht.skipped} skipped.`),Tt(`Knowledge import complete! ${ht.created} documents imported.`,"#2E7D32"),l==null||l();break;case"error":Pn(null),ti(null),An("error",ht.message),Tt(`Import failed: ${ht.message}`,"#B71C1C"),l==null||l();break}}catch{}st=""}}}).catch(H=>{Pn(null),An("error",H.message),Tt(`Import error: ${H.message}`,"#B71C1C"),l==null||l()})))},[t]);const[ni,li]=j.useState("card"),[ai,Cs]=j.useState(typeof window<"u"?window.innerWidth:1200);j.useEffect(()=>{const H=()=>Cs(window.innerWidth);return window.addEventListener("resize",H),()=>window.removeEventListener("resize",H)},[]);const Da=ai<1024,[bn,Sl]=j.useState(!1),[Kl,cl]=j.useState(560),[$t,pt]=j.useState([]),[nl,Dn]=j.useState(null),[Ns,ri]=j.useState(null),{sendMessage:As}=xE();j.useEffect(()=>{Promise.all([Ae.getCompany().then(H=>{S(H.name),i(H.roles)}),Ae.getProjects().then(u),Ae.getStandups().then(m),Ae.getWaves().then(h),Ae.getDecisions().then(y),Ae.getKnowledge().then(v).catch(()=>{}),Ae.getOrgTree().then(H=>{T(H.nodes),A(H.root)}).catch(()=>{})]).catch(H=>$(`Failed to load: ${H.message}`)).finally(()=>E(!1))},[]),j.useEffect(()=>{Ae.deleteEmptySessions().catch(()=>{}),Ae.getSessions().then(H=>{if(H.length>0){const fe=H.map(Se=>({...Se,messages:[]}));pt(fe);const ve=fe.find(Se=>Se.status==="active")??fe[0];Dn(ve.id),Sl(!0)}}).catch(H=>{console.error("Failed to load sessions",H)})},[]),j.useEffect(()=>{const H=()=>{fetch("/api/exec/status").then(ve=>ve.json()).then(ve=>{me(ve.statuses??{}),qe(ve.activeExecutions??[])}).catch(()=>{})};H();const fe=setInterval(H,3e3);return()=>clearInterval(fe)},[]),j.useEffect(()=>{O.type==="role"?Ae.getRole(O.roleId).then(q).catch(console.error):q(null)},[O]);const ll=()=>B({type:"none"}),ii=async(H,fe)=>{const ve=a.find(ke=>ke.id===H),Se=(G==null?void 0:G.mode)==="ask";P(null);try{const{jobId:ke}=await Ae.startJob({type:"assign",roleId:H,task:fe,readOnly:Se}),Me=ic[H]??"#666",Be=`${H.toUpperCase()} · ${(ve==null?void 0:ve.name)??H}`;ae(!1),U([{jobId:ke,title:Be,color:Me}]),yt.pushMessage({ts:Date.now(),roleId:"ceo",text:`[CEO → ${(ve==null?void 0:ve.name)??H}] ${Se?"Ask":"Assign"}: ${fe}`,type:"dispatch",targetRoleId:H})}catch(ke){Tt(`Failed to start job: ${ke instanceof Error?ke.message:"unknown"}`,"#C62828")}},Tt=(H,fe)=>{const ve=Date.now();mt(Se=>[...Se,{id:ve,message:H,color:fe}]),setTimeout(()=>mt(Se=>Se.filter(ke=>ke.id!==ve)),4e3)},Ql=()=>{var fe;const H=z[z.length-1];H&&(Tt(`${H.title} completed`,H.color),yt.pushMessage({ts:Date.now(),roleId:((fe=H.title.split(" · ")[0])==null?void 0:fe.toLowerCase())??"unknown",text:`[${H.title}] Job completed`,type:"dispatch"})),Ae.getStandups().then(m).catch(console.error),Ae.getCompany().then(ve=>i(ve.roles)).catch(console.error)},Ta=async H=>{ee(!1);try{const fe=await Ae.startJob({type:"wave",directive:H}),ve=fe.jobIds??(fe.jobId?[fe.jobId]:[]),Se=a.filter(Me=>Me.level==="c-level"),ke=ve.map((Me,Be)=>{var Je,st;return{jobId:Me,roleId:((Je=Se[Be])==null?void 0:Je.id)??`role-${Be}`,roleName:((st=Se[Be])==null?void 0:st.name)??`C-Level ${Be+1}`}});yt.pushMessage({ts:Date.now(),roleId:"ceo",text:`[CEO WAVE] "${H}" → ${ke.map(Me=>Me.roleName).join(", ")}`,type:"dispatch"}),Object.keys(D).length>0?(de({directive:H,rootJobs:ke}),we(!1)):(V(ke),Q(0),ae(!1),ke.length>0&&U([{jobId:ke[0].jobId,title:`CEO WAVE · ${ke[0].roleId.toUpperCase()}`,color:"#B71C1C"}]))}catch(fe){Tt(`Failed to start wave: ${fe instanceof Error?fe.message:"unknown"}`,"#C62828")}},jl=()=>{Ae.getWaves().then(h).catch(console.error),Ae.getStandups().then(m).catch(console.error)},Lt=()=>{Ae.getCompany().then(H=>i(H.roles)).catch(console.error)},Ds=async(H,fe)=>{await Ae.createRole(H),Ln(H.id,fe),Lt(),Tt(`${H.name} hired!`,"#2E7D32")},Ts=async H=>{await Ae.deleteRole(H),Lt(),Ke(null),Tt(`${H.toUpperCase()} removed`,"#B71C1C")},ul=async(H,fe)=>{await Ae.updateRole(H,fe),Lt(),fe.name&&Tt(`${H.toUpperCase()} renamed to "${fe.name}"`,"#1565C0")},Zl=H=>{Sl(!0)},Ec=async H=>{try{const fe=await Ae.createSession(H,"talk");pt(ve=>[fe,...ve]),Dn(fe.id),Sl(!0)}catch(fe){console.error("Failed to create session",fe),Tt(`Failed to create session: ${fe instanceof Error?fe.message:"API unreachable"}`,"#B71C1C")}},zs=async H=>{try{const fe=await Ae.createSession(H,"talk");pt(ve=>[fe,...ve]),Dn(fe.id)}catch(fe){console.error("Failed to create session",fe),Tt(`Failed to create session: ${fe instanceof Error?fe.message:"API unreachable"}`,"#B71C1C")}},Ms=async H=>{const fe=Ee.find(ke=>ke.roleId===H),ve=(fe==null?void 0:fe.jobId)??(fe==null?void 0:fe.id);if(ve&&lt[H]==="working"){const ke=a.find(Je=>Je.id===H),Me=ic[H]??"#666",Be=`${H.toUpperCase()} · ${(ke==null?void 0:ke.name)??H}`;U([{jobId:ve,title:Be,color:Me}]),ae(!1);return}const Se=$t.find(ke=>ke.roleId===H);if(Se)Dn(Se.id),yt.setActiveChannelId(null);else try{const ke=await Ae.createSession(H,"talk");pt(Me=>[ke,...Me]),Dn(ke.id),yt.setActiveChannelId(null)}catch(ke){console.error("Failed to create session",ke)}Sl(!0)},Cc=async H=>{try{await Ae.deleteSession(H),pt(fe=>{var Se;const ve=fe.filter(ke=>ke.id!==H);return nl===H&&Dn(((Se=ve[0])==null?void 0:Se.id)??null),ve})}catch(fe){console.error("Failed to delete session",fe),Tt(`Failed to close session: ${fe instanceof Error?fe.message:"API error"}`,"#B71C1C")}},rr=async()=>{try{const{ids:H}=await Ae.deleteEmptySessions();if(H.length===0)return;pt(fe=>{var Se;const ve=fe.filter(ke=>!H.includes(ke.id));return nl&&H.includes(nl)&&Dn(((Se=ve[0])==null?void 0:Se.id)??null),ve}),Tt(`Cleared ${H.length} empty session${H.length!==1?"s":""}`,"#2E7D32")}catch(H){Tt(`Failed to clear empty sessions: ${H instanceof Error?H.message:"API error"}`,"#B71C1C")}},ir=async()=>{if(!confirm("Close all sessions? This cannot be undone."))return;const H=$t.map(fe=>fe.id);try{await Ae.deleteSessions(H),pt([]),Dn(null),Tt("All sessions closed","#2E7D32")}catch(fe){Tt(`Failed to close sessions: ${fe instanceof Error?fe.message:"API error"}`,"#B71C1C")}},tn=(H,fe)=>{pt(ve=>ve.map(Se=>{if(Se.id!==H)return Se;const ke=[...Se.messages],Me=ke[ke.length-1];if(Me&&Me.from==="role"&&Me.status==="streaming"){const Be=[...Me.streamEvents??[],fe];ke[ke.length-1]={...Me,streamEvents:Be}}return{...Se,messages:ke}}))},hn=(H,fe,ve)=>{const Se={id:`msg-${Date.now()}-ceo`,from:"ceo",content:fe,type:ve==="do"?"directive":"conversation",status:"done",timestamp:new Date().toISOString()},ke={id:`msg-${Date.now()+1}-role`,from:"role",content:"",type:"conversation",status:"streaming",timestamp:new Date().toISOString(),streamEvents:[]};pt(Me=>Me.map(Be=>Be.id===H?{...Be,messages:[...Be.messages,Se,ke],updatedAt:new Date().toISOString()}:Be)),ri(H),As(H,fe,ve,{onThinking:Me=>{pt(Be=>Be.map(Je=>{if(Je.id!==H)return Je;const st=[...Je.messages],Le=st[st.length-1];return Le&&Le.from==="role"&&Le.status==="streaming"&&(st[st.length-1]={...Le,thinking:(Le.thinking??"")+Me}),{...Je,messages:st}})),tn(H,{type:"thinking",timestamp:Date.now(),text:Me})},onText:Me=>{pt(Be=>Be.map(Je=>{if(Je.id!==H)return Je;const st=[...Je.messages],Le=st[st.length-1];return Le&&Le.from==="role"&&Le.status==="streaming"&&(st[st.length-1]={...Le,content:Le.content+Me}),{...Je,messages:st}}))},onToolUse:(Me,Be)=>{tn(H,{type:"tool",timestamp:Date.now(),toolName:Me,toolInput:Be})},onDispatch:(Me,Be)=>{tn(H,{type:"dispatch",timestamp:Date.now(),roleId:Me,task:Be})},onDispatchProgress:(Me,Be,Je)=>{var st;Be==="tool"?tn(H,{type:"dispatch:progress",timestamp:Date.now(),roleId:Me,progressType:"tool",toolName:Je.name,toolInput:Je.input}):Be==="thinking"?tn(H,{type:"dispatch:progress",timestamp:Date.now(),roleId:Me,progressType:"thinking",text:Je.text}):Be==="text"?tn(H,{type:"dispatch:progress",timestamp:Date.now(),roleId:Me,progressType:"text",text:(st=Je.text)==null?void 0:st.slice(-200)}):(Be==="done"||Be==="error")&&tn(H,{type:"dispatch:progress",timestamp:Date.now(),roleId:Me,progressType:Be})},onTurn:Me=>{tn(H,{type:"turn",timestamp:Date.now(),turn:Me})},onDone:()=>{pt(Me=>Me.map(Be=>{if(Be.id!==H)return Be;const Je=Be.messages.map(Le=>Le.status==="streaming"?{...Le,status:"done"}:Le),st=Be.messages.length<=2?fe.slice(0,40).replace(/\n/g," "):Be.title;return{...Be,messages:Je,title:st}})),ri(null)},onError:Me=>{pt(Be=>Be.map(Je=>{if(Je.id!==H)return Je;const st=Je.messages.map(Le=>Le.status==="streaming"?{...Le,status:"error",content:Le.content||Me}:Le);return{...Je,messages:st}})),ri(null)}})},_s=(H,fe)=>{pt(ve=>ve.map(Se=>Se.id===H?{...Se,mode:fe}:Se)),Ae.updateSession(H,{mode:fe}).catch(console.error)},Nc=new Date().toISOString().slice(0,10),Un=o[0],si={cto:"Chief Technology Officer",cbo:"Chief Business Officer",pm:"Product Manager",engineer:"Software Engineer",designer:"UI/UX Designer",qa:"QA Engineer"},sr=H=>{const fe=si[H];if(!fe)return"";for(const ve of f){const Se=ve.content,ke=Se.indexOf(`## ${fe}`);if(ke===-1)continue;const Me=Se.indexOf(`
89
+ ## `,ke+10),Je=(Me===-1?Se.slice(ke):Se.slice(ke,Me)).split(`
90
+ `).filter(st=>st.trim().length>0);for(const st of Je){const Le=st.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}}return""},Ac=H=>{const fe=si[H];if(!fe)return"";for(const ve of f){const Se=ve.content,ke=Se.indexOf(`## ${fe}`);if(ke===-1)continue;const Me=Se.indexOf(`
91
+ ## `,ke+10),Je=(Me===-1?Se.slice(ke):Se.slice(ke,Me)).replace(/^## .+\n/,"").trim();if(Je)return Je.slice(0,1500)}return""},yt=FE();j.useEffect(()=>{a.length>0&&yt.syncDefaultMembers(a)},[a]);const El=DE({roles:a,roleStatuses:lt,activeExecs:Ee,getStandupSpeech:sr});return LE({roles:a,roleStatuses:lt,activeExecs:Ee,channels:yt.channels,relationships:El.relationships,pushMessage:yt.pushMessage,speechSettings:ye,engineType:Yt,hasApiKey:on}),N?c.jsxs("div",{className:"h-screen flex flex-col bg-[var(--floor-light)]",style:{fontFamily:"var(--pixel-font)"},children:[(Jn||el.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:()=>Gl(H=>!H),children:[Jn?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:Jn||"Knowledge import finished"}),en&&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:`${en.index/en.total*100}%`,background:"#fff"}})}),c.jsx("span",{className:"text-[10px] opacity-70 shrink-0",children:tl?"▲":"▼"})]}),tl&&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:[el.map(H=>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:[H.type==="scan"&&"🔍",H.type==="process"&&"⚙️",H.type==="created"&&"✅",H.type==="done"&&"🎉",H.type==="error"&&"❌"]}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{style:{color:H.type==="error"?"#EF4444":H.type==="done"?"var(--active-green)":"var(--terminal-text)"},children:H.text}),H.detail&&c.jsx("div",{className:"text-[10px] truncate",style:{color:"var(--terminal-text-muted)"},children:H.detail})]})]},H.id)),c.jsx("div",{ref:lr})]})]}),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..."})]})})]}):_?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:_}),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:a.length})]}),c.jsxs("span",{className:"hidden sm:inline",children:["Projects: ",c.jsx("strong",{className:"text-[var(--terminal-text)]",children:o.length})]}),Ee.length>0&&c.jsxs("span",{className:"text-amber-400",children:["Working: ",c.jsx("strong",{children:Ee.length})]}),c.jsxs("button",{onClick:()=>De.state!=="no-git"&&gn(!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:De.state==="no-git"?.5:1,cursor:De.state==="no-git"?"default":"pointer"},title:De.state==="no-git"?'No git repository — run "git init" to enable save':De.state==="dirty"?`${De.dirtyCount} unsaved changes`:"All saved",children:[c.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:De.state==="no-git"?"var(--terminal-text-muted)":De.state==="saving"||De.state==="dirty"?"var(--idle-amber)":De.state==="error"?"#EF5350":"var(--active-green)",animation:De.state==="saving"?"pulse 1s infinite":void 0}}),c.jsx("span",{children:Nc})]})]})]}),(Jn||el.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:()=>Gl(H=>!H),children:[Jn?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:Jn||"Knowledge import finished"}),en&&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:`${en.index/en.total*100}%`,background:"#fff"}})}),c.jsx("span",{className:"text-[10px] opacity-70 shrink-0",children:tl?"▲":"▼"})]}),tl&&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:[el.map(H=>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:[H.type==="scan"&&"🔍",H.type==="process"&&"⚙️",H.type==="created"&&"✅",H.type==="done"&&"🎉",H.type==="error"&&"❌"]}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{style:{color:H.type==="error"?"#EF4444":H.type==="done"?"var(--active-green)":"var(--terminal-text)"},children:H.text}),H.detail&&c.jsx("div",{className:"text-[10px] truncate",style:{color:"var(--terminal-text-muted)"},children:H.detail})]})]},H.id)),c.jsx("div",{ref:lr}),el.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:ni==="iso"?c.jsx(jC,{roles:a,projects:o,waves:p,standups:f,decisions:g,roleStatuses:lt,activeExecs:Ee,onRoleClick:H=>B({type:"role",roleId:H}),onProjectClick:H=>B({type:"project",projectId:H}),onBulletinClick:()=>B({type:"bulletin"}),onDecisionsClick:()=>B({type:"decisions"}),onKnowledgeClick:()=>B({type:"knowledge"}),knowledgeDocsCount:b.length,getRoleSpeech:El.getSpeech,getAppearance:Ot,onHireClick:()=>Oe(!0)}):c.jsxs("div",{className:`${bn?"max-w-full":"max-w-[1100px]"} mx-auto h-full p-4 flex flex-col gap-3 relative z-[1]`,children:[(()=>{const H=a.filter(ve=>ve.level==="c-level"),fe=a.filter(ve=>ve.level!=="c-level");return c.jsxs(c.Fragment,{children:[H.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"pixel-section-label",children:"LEADERSHIP"}),c.jsx("div",{className:`grid gap-2 ${H.length===1?"grid-cols-1":"grid-cols-2"}`,children:H.map(ve=>{var Se;return c.jsx(S0,{role:ve,speech:El.getSpeech(ve.id),onClick:()=>B({type:"role",roleId:ve.id}),liveStatus:lt[ve.id],activeTask:(Se=Ee.find(ke=>ke.roleId===ve.id))==null?void 0:Se.task,featured:!0,appearance:Ot(ve.id)},ve.id)})})]}),c.jsx("div",{className:"pixel-section-label",children:"TEAM"}),c.jsxs("div",{className:`grid gap-2 ${bn?"grid-cols-3":"grid-cols-4"}`,children:[fe.map(ve=>{var Se;return c.jsx(S0,{role:ve,speech:El.getSpeech(ve.id),onClick:()=>B({type:"role",roleId:ve.id}),liveStatus:lt[ve.id],activeTask:(Se=Ee.find(ke=>ke.roleId===ve.id))==null?void 0:Se.task,appearance:Ot(ve.id)},ve.id)}),c.jsx("div",{className:"pixel-card pixel-card--hire",onClick:()=>Oe(!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:Un?()=>B({type:"project",projectId:Un.id}):void 0,style:Un?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(Wo,{type:"meeting"})}),c.jsxs("div",{className:"fcc-body",children:[c.jsx("div",{className:"fcc-desc",children:"Projects, PRDs, and task boards"}),Un?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"fcc-title",children:['"',Un.name,'"']}),c.jsxs("div",{className:"fcc-meta",children:["Status: ",c.jsx("strong",{style:{color:"var(--active-green)"},children:Un.status})]})]}):c.jsx("div",{className:"fcc-meta",style:{fontStyle:"italic"},children:"No active projects"})]})]}),c.jsxs("div",{className:"facility-card-compact",onClick:()=>B({type:"bulletin"}),children:[c.jsxs("div",{className:"fcc-hdr",style:{background:"#64748b"},children:["📋"," BULLETIN"]}),c.jsx("div",{className:"fcc-canvas",children:c.jsx(Wo,{type:"bulletin"})}),c.jsxs("div",{className:"fcc-body",children:[c.jsx("div",{className:"fcc-desc",children:"Waves and daily standups"}),p.slice(0,1).map(H=>c.jsxs("div",{className:"fcc-item",children:["Wave ",H.id]},H.id)),f.slice(0,1).map(H=>c.jsxs("div",{className:"fcc-item",children:["Standup ",H.date]},H.date)),p.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:()=>B({type:"decisions"}),children:[c.jsxs("div",{className:"fcc-hdr",style:{background:"#EF4444"},children:["📜"," DECISIONS"]}),c.jsx("div",{className:"fcc-canvas",children:c.jsx(Wo,{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:[g.length," decisions"]}),g.slice(0,2).map(H=>c.jsxs("div",{className:"fcc-item",children:["#",H.id," ",H.title]},H.id))]})]}),c.jsxs("div",{className:"facility-card-compact",onClick:()=>B({type:"knowledge"}),children:[c.jsxs("div",{className:"fcc-hdr",style:{background:"#0D9488"},children:["📚"," KNOWLEDGE"]}),c.jsx("div",{className:"fcc-canvas",children:c.jsx(Wo,{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:[b.length," docs"]}),b.slice(0,2).map(H=>c.jsx("div",{className:"fcc-item",children:H.title},H.id))]})]})]})]})}),bn&&c.jsx("div",{className:Da?"absolute inset-0 z-50":"contents",children:c.jsx(mE,{sessions:$t,activeSessionId:nl,roles:a,streamingSessionId:Ns,width:Da?ai:Kl,onWidthChange:Da?void 0:cl,onSwitchSession:Dn,onCloseSession:Cc,onCreateSession:Ec,onClearEmpty:rr,onCloseAll:ir,onSendMessage:hn,onModeChange:_s,onCloseTerminal:()=>Sl(!1),chatChannels:yt.channels,activeChatChannelId:yt.activeChannelId,onSwitchChatChannel:yt.setActiveChannelId,onCreateChatChannel:yt.createChannel,onDeleteChatChannel:yt.deleteChannel,onUpdateChatMembers:yt.updateMembers,onUpdateChatTopic:yt.updateTopic,unreadChannels:yt.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:()=>li("card"),className:`view-toggle-btn ${ni==="card"?"active":""}`,children:"CARD"}),c.jsx("button",{onClick:()=>li("iso"),className:`view-toggle-btn ${ni==="iso"?"active":""}`,children:"ISO"}),c.jsx("span",{className:"mx-1",children:"|"}),c.jsxs("button",{className:"theme-btn",onClick:()=>{ue("office"),xt(a[0]??null)},title:"Customize",children:[((oi=Ea[Hn])==null?void 0:oi.icon)??""," ",((or=Ea[Hn])==null?void 0:or.name)??"THEME"]}),c.jsx("span",{className:"mx-1",children:"|"}),c.jsx("span",{style:{color:De.state==="dirty"?"var(--idle-amber)":"var(--terminal-text-muted)"},children:De.state==="no-git"?"No git":De.state==="saving"?"Saving...":De.state==="dirty"?`${De.dirtyCount} unsaved`:De.lastSaved?`Saved ${(()=>{const H=Math.floor((Date.now()-new Date(De.lastSaved).getTime())/6e4);return H<1?"just now":H<60?`${H}m ago`:`${Math.floor(H/60)}h ago`})()}`:"Saved"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[se&&he&&c.jsx("button",{onClick:()=>we(!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"}),z.length>0&&re&&c.jsxs("button",{onClick:()=>ae(!1),className:"px-3 py-1 font-black text-white cursor-pointer animate-pulse",style:{background:z[z.length-1].color,border:`2px solid ${z[z.length-1].color}88`,fontFamily:"var(--pixel-font)",borderRadius:4},children:[z[z.length-1].title.slice(0,20),z[z.length-1].title.length>20?"..":""]}),c.jsxs("button",{onClick:()=>ee(!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:()=>bn?Sl(!1):Zl(),className:"px-3 py-1 font-black cursor-pointer",style:{background:bn?"var(--terminal-bg)":"var(--hud-bg-alt)",color:"var(--terminal-text)",border:`2px solid ${bn?"var(--terminal-border-hover)":"var(--pixel-border)"}`,fontFamily:"var(--pixel-font)"},children:"TERMINAL"})]}),c.jsxs("span",{children:["Expand: +",Math.max(0,10-a.length)," desks available"]})]}),O.type==="role"&&M&&(()=>{const H=Ee.find(fe=>fe.roleId===M.id);return c.jsx($S,{role:M,allRoles:a,recentActivity:Ac(M.id),onClose:ll,onFireRole:(fe,ve)=>{Ke({roleId:fe,roleName:ve}),ll()},terminalWidth:bn?Kl:0,activeJobId:H==null?void 0:H.id,activeTask:H==null?void 0:H.task,isWorking:lt[M.id]==="working",jobStartedAt:H==null?void 0:H.startedAt,onStopJob:fe=>Ae.abortJob(fe),sessions:$t,streamingSessionId:Ns,onCreateSessionSilent:zs,onSendMessage:hn,onFocusTerminal:Ms,onCustomize:fe=>{const ve=a.find(Se=>Se.id===fe);ve&&(ue("character"),xt(ve))},onUpdateRole:ul,appearance:Ot(M.id),relationships:El.relationships})})(),O.type==="project"&&Un&&c.jsx(_j,{projectId:Un.id,onClose:ll,terminalWidth:bn?Kl:0}),(O.type==="bulletin"||O.type==="decisions")&&c.jsx(zj,{standups:f,waves:p,decisions:g,mode:O.type==="bulletin"?"bulletin":"decisions",onClose:ll,terminalWidth:bn?Kl:0}),O.type==="knowledge"&&c.jsx(Tj,{docs:b,onClose:ll,onRefresh:()=>Ae.getKnowledge().then(v).catch(()=>{}),terminalWidth:bn?Kl:0,initialDocId:O.docId}),G&&c.jsx(Oj,{roleId:G.roleId,roleName:G.roleName,mode:G.mode,onClose:()=>P(null),onExecutionStart:ii}),se&&!he&&c.jsx(qj,{directive:se.directive,rootJobs:se.rootJobs,orgNodes:D,rootRoleId:X,onClose:()=>{de(null),we(!1)},onMinimize:()=>we(!0),onDone:()=>{jl(),Tt("Wave complete","#2E7D32")},onOpenKnowledgeDoc:H=>{de(null),we(!1),B({type:"knowledge",docId:H}),Ae.getKnowledge().then(v).catch(()=>{})}}),z.length>0&&!re&&(()=>{var ve;const H=z[z.length-1],fe=ne.length>1;return c.jsxs(c.Fragment,{children:[fe&&z.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:ne.map((Se,ke)=>c.jsx("button",{onClick:()=>{Q(ke),U([{jobId:Se.jobId,title:`CEO WAVE · ${Se.roleId.toUpperCase()}`,color:"#B71C1C"}])},className:"px-3 py-1.5 text-xs font-bold rounded-t-lg cursor-pointer transition-colors",style:{background:Y===ke?"#B71C1C":"var(--terminal-bg)",color:Y===ke?"#fff":"var(--terminal-text-secondary)",border:`1px solid ${Y===ke?"#B71C1C":"var(--terminal-border)"}`,borderBottom:"none"},children:Se.roleId.toUpperCase()},Se.jobId))}),c.jsx(Bj,{jobId:H.jobId,title:z.length>1?H.title:fe?`CEO WAVE · ${((ve=ne[Y])==null?void 0:ve.roleName)??""}`:H.title,color:H.color,variant:"modal",style:fe&&z.length===1?{marginTop:28}:void 0,onClose:()=>{U([]),V([]),Q(0),ae(!1)},onMinimize:()=>ae(!0),onDone:()=>{Ql(),jl()},onNavigateToJob:Se=>{Ae.getJob(Se).then(ke=>{const Me=ic[ke.roleId]??"#888";U(Be=>[...Be,{jobId:Se,title:`${ke.roleId.toUpperCase()} · ${ke.task.slice(0,40)}`,color:Me}])}).catch(console.error)},onOpenKnowledgeDoc:Se=>{U([]),V([]),Q(0),ae(!1),B({type:"knowledge",docId:Se}),Ae.getKnowledge().then(v).catch(()=>{})}},H.jobId)]})})(),z.length>1&&c.jsx("div",{className:"fixed top-[5%] left-1/2 -translate-x-1/2 w-[720px] max-w-[95vw] z-[62] pointer-events-none",children:c.jsx("div",{className:"pointer-events-auto",children:c.jsxs("button",{onClick:()=>U(H=>H.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 ",(Cl=z[z.length-2])==null?void 0:Cl.title]})})}),L&&c.jsx(Lj,{cLevelRoles:a.filter(H=>H.level==="c-level"),orgNodes:D,rootId:X,onClose:()=>ee(!1),onDispatch:Ta}),Ce&&c.jsx(Qj,{existingRoles:a,onClose:()=>Oe(!1),onHire:Ds}),pe&&c.jsx(Zj,{roleId:pe.roleId,roleName:pe.roleName,onClose:()=>Ke(null),onConfirm:Ts}),rt&&c.jsx(EC,{role:rt,appearance:Ot(rt.id),onSave:H=>Ln(rt.id,H),onReset:()=>Bt(rt.id),onClose:()=>{xt(null),ue("character")},theme:Hn,onThemeChange:le,onUpdateName:async(H,fe)=>{await ul(H,{name:fe})},initialTab:Xe,speechSettings:ye,onSpeechSettingsChange:Te,language:xe,onLanguageChange:be}),it&&c.jsx(CC,{status:De.status,history:De.history,onClose:()=>gn(!1),onSave:async H=>await De.save(H),onLoadHistory:De.loadHistory,onRestore:De.restore,saving:De.state==="saving"}),c.jsx("div",{className:"fixed top-16 right-4 z-[70] flex flex-col gap-2",children:Mt.map(H=>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:H.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"}),H.message]},H.id))})]})}function S0({role:t,speech:l,onClick:a,liveStatus:i,activeTask:o,featured:u,appearance:f}){const m=ic[t.id]??TC(t.id),p=AC[t.id]??1,h=DC[t.id]??t.name,g=i==="working",y=g&&o?o:l||h;return c.jsxs("div",{className:`pixel-card ${g?"working":""} ${u?"pixel-card--featured":""}`,onClick:a,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.",p]})]}),c.jsxs("div",{className:"pixel-card-body",children:[c.jsx("div",{className:"pixel-desk"}),c.jsx(Sc,{roleId:t.id,appearance:f}),c.jsx("div",{className:"pixel-status-dot",style:{background:g?"var(--idle-amber)":"var(--active-green)"}})]}),c.jsxs("div",{className:"pixel-card-task",children:[c.jsx("span",{className:"pixel-card-task-icon",children:g?"🛠️":NC[t.id]??"👤"}),c.jsx("span",{className:"pixel-card-task-text",children:y||h})]})]})}function vd({onSelect:t,onClose:l}){const[a,i]=j.useState(null),[o,u]=j.useState(!0),f=j.useCallback(async m=>{u(!0);try{const p=await Ae.browse(m);i(p)}catch{}finally{u(!1)}},[]);return j.useEffect(()=>{f()},[f]),o&&!a?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..."}):a?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:a.current}),c.jsx("button",{onClick:()=>t(a.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:"✕"})]}),a.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(a.parent),children:[c.jsx("span",{children:"⬆️"}),c.jsx("span",{children:".."})]}),a.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)),a.dirs.length===0&&c.jsx("div",{className:"px-3 py-3 text-center",style:{color:"var(--terminal-text-muted)"},children:"No subdirectories"})]}):null}const MC={engine:"AI Engine",company:"Company Info",project:"Project",knowledge:"Knowledge",team:"Team Template",create:"Create"};function j0(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 _C({onComplete:t}){const[l,a]=j.useState(0),[i,o]=j.useState(null),[u,f]=j.useState("none"),[m,p]=j.useState(""),[h,g]=j.useState(!0),[y,b]=j.useState(""),[v,k]=j.useState(""),S=j.useRef(null),[N,E]=j.useState("fresh"),[_,$]=j.useState(""),[O,B]=j.useState(null),[M,q]=j.useState(!1),[G,P]=j.useState(!1),[z,U]=j.useState("skip"),[L,ee]=j.useState([]),[ne,V]=j.useState(""),[Y,Q]=j.useState(!1),[re,ae]=j.useState(""),[D,T]=j.useState(null),[X,A]=j.useState(!1),[se,de]=j.useState(!1),[he,we]=j.useState([]),[Ce,Oe]=j.useState("startup"),[pe,Ke]=j.useState(!1),[lt,me]=j.useState(!1),[Ee,qe]=j.useState(null),[Mt,mt]=j.useState([]),[Yt,_t]=j.useState(!1),on=j.useMemo(()=>j0(z),[z]),Ct=on[l]??"engine";j.useEffect(()=>{Ae.detectEngine().then(ue=>{o(ue),f(ue.recommended),g(!1)}).catch(()=>g(!1)),Ae.getTeams().then(we).catch(()=>{})},[]),j.useEffect(()=>{var ue;Ct==="company"&&((ue=S.current)==null||ue.focus())},[Ct]);const Ot=()=>{switch(Ct){case"engine":return u!=="none"||m.length>10;case"company":return y.trim().length>0;case"project":return N==="fresh"||N==="existing"&&O===!0;case"knowledge":return z==="existing-akb"?D===!0:z==="import"?L.length>0:!0;case"team":return!0;case"create":return!lt;default:return!1}},Ln=()=>{l<on.length-1&&Ot()&&a(l+1),Ct==="create"&&!pe&&!Yt&&(z==="existing-akb"?xe():Te())},Bt=()=>{l>0&&a(l-1)};j.useEffect(()=>{const ue=j0(z);l>=ue.length&&a(ue.length-1)},[z,l]);const Hn=async()=>{if(_.trim()){q(!0);try{const ue=await Ae.validatePath(_.trim());B(ue.valid)}catch{B(!1)}finally{q(!1)}}},le=async()=>{if(re.trim()){A(!0);try{const ue=await Ae.validatePath(re.trim());T(ue.valid&&ue.hasClaudeMd===!0)}catch{T(!1)}finally{A(!1)}}},ye=()=>{const ue=ne.trim();ue&&!L.includes(ue)&&(ee([...L,ue]),V(""))},Te=async()=>{Ke(!0),qe(null);try{const ue={companyName:y.trim(),description:v.trim()||"An AI-powered organization",team:Ce,existingProjectPath:N==="existing"?_.trim():void 0,knowledgePaths:z==="import"&&L.length>0?L:void 0};(u==="direct-api"||m)&&(ue.apiKey=m||void 0);const De=await Ae.scaffold(ue);mt(De.created),me(!0)}catch(ue){qe(ue instanceof Error?ue.message:"Scaffold failed")}finally{Ke(!1)}},xe=async()=>{_t(!0),qe(null);try{const ue=await Ae.connectAkb(re.trim());ue.ok?(me(!0),mt([`Connected to: ${ue.companyRoot}`])):qe(ue.error||"Failed to connect")}catch(ue){qe(ue instanceof Error?ue.message:"Connect failed")}finally{_t(!1)}},be=()=>{z==="import"&&L.length>0?t({paths:L,companyRoot:""}):t()},rt=ue=>{ue.key==="Enter"&&Ot()&&(ue.preventDefault(),Ln())},xt=`w-full px-3 py-2 rounded text-sm outline-none transition-colors
92
+ bg-[var(--terminal-bg)] text-[var(--terminal-text)]
93
+ border border-[var(--terminal-border)]
94
+ focus:border-[var(--terminal-border-hover)]
95
+ placeholder:text-[var(--terminal-text-muted)]`,Xe=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:on.map((ue,De)=>c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"h-1 rounded-full transition-colors",style:{background:De<=l?"var(--accent)":"var(--terminal-surface-light)"}}),c.jsx("div",{className:"text-[9px] mt-1 truncate",style:{color:De===l?"var(--terminal-text)":"var(--terminal-text-muted)"},children:MC[ue]})]},ue))})]}),c.jsxs("div",{className:"px-6 py-5 min-h-[280px]",children:[Ct==="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:Xe(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:Xe(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:`${xt} mt-3`,placeholder:"sk-ant-...",value:m,onChange:ue=>p(ue.target.value),autoFocus:!0})]})]})]}),Ct==="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:S,className:xt,placeholder:"e.g. Acme Corp",value:y,onChange:ue=>b(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:`${xt} resize-none`,rows:3,placeholder:"What does your AI company do?",value:v,onChange:ue=>k(ue.target.value)})]})]}),Ct==="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:Xe(N==="fresh"),onClick:()=>{E("fresh"),B(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:Xe(N==="existing"),onClick:()=>E("existing"),children:[c.jsxs("div",{className:"font-medium text-sm",children:["📂"," Connect Existing Project"]}),c.jsx("div",{className:"text-xs opacity-70 mt-1",children:"Add AI company structure to an existing codebase or knowledge base."}),N==="existing"&&c.jsxs("div",{className:"mt-3",onClick:ue=>ue.stopPropagation(),children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{className:`${xt} flex-1`,placeholder:"/path/to/your/project",value:_,onChange:ue=>{$(ue.target.value),B(null)},autoFocus:!0}),c.jsx("button",{onClick:()=>P(!G),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:Hn,disabled:M||!_.trim(),className:"px-3 py-2 rounded text-xs font-medium transition-colors",style:{background:"var(--accent)",color:"#fff",opacity:M||!_.trim()?.5:1},children:M?"...":"Verify"})]}),O===!0&&c.jsxs("div",{className:"text-xs mt-2",style:{color:"var(--active-green)"},children:["✅"," Path verified: ",_]}),O===!1&&c.jsxs("div",{className:"text-xs mt-2",style:{color:"#EF4444"},children:["❌"," Invalid path"]}),G&&c.jsx(vd,{onSelect:ue=>{$(ue),B(!0),P(!1)},onClose:()=>P(!1)})]})]})]}),Ct==="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:Xe(z==="skip"),onClick:()=>U("skip"),children:[c.jsxs("div",{className:"font-medium text-sm",children:["🌱"," Start Fresh"]}),c.jsx("div",{className:"text-xs opacity-70 mt-1",children:"Empty knowledge base. Add documents later from the office."})]}),c.jsxs("div",{className:Xe(z==="import"),onClick:()=>U("import"),children:[c.jsxs("div",{className:"font-medium text-sm",children:["📚"," Import & Build"]}),c.jsx("div",{className:"text-xs opacity-70 mt-1",children:"Select folders with documents — AI reads, summarizes, and organizes them."}),z==="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:`${xt} flex-1`,placeholder:"/path/to/docs",value:ne,onChange:ue=>V(ue.target.value),onKeyDown:ue=>{ue.key==="Enter"&&(ue.preventDefault(),ye())},autoFocus:!0}),c.jsx("button",{onClick:()=>Q(!Y),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:ye,disabled:!ne.trim(),className:"px-3 py-2 rounded text-xs font-medium",style:{background:"var(--accent)",color:"#fff",opacity:ne.trim()?1:.5},children:"Add"})]}),Y&&c.jsx(vd,{onSelect:ue=>{L.includes(ue)||ee([...L,ue]),Q(!1)},onClose:()=>Q(!1)}),L.length>0&&c.jsx("div",{className:"space-y-1",children:L.map((ue,De)=>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:()=>ee(L.filter((it,gn)=>gn!==De)),className:"opacity-50 hover:opacity-100",children:"✕"})]},De))}),L.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:Xe(z==="existing-akb"),onClick:()=>U("existing-akb"),children:[c.jsxs("div",{className:"font-medium text-sm",children:["🔗"," Connect Existing AKB"]}),c.jsx("div",{className:"text-xs opacity-70 mt-1",children:"Connect a directory that already has CLAUDE.md and AKB structure."}),z==="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:`${xt} flex-1`,placeholder:"/path/to/your/akb",value:re,onChange:ue=>{ae(ue.target.value),T(null)},autoFocus:!0}),c.jsx("button",{onClick:()=>de(!se),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:le,disabled:X||!re.trim(),className:"px-3 py-2 rounded text-xs font-medium transition-colors",style:{background:"var(--accent)",color:"#fff",opacity:X||!re.trim()?.5:1},children:X?"...":"Verify"})]}),D===!0&&c.jsxs("div",{className:"text-xs mt-2",style:{color:"var(--active-green)"},children:["✅"," Valid AKB found: ",re]}),D===!1&&c.jsxs("div",{className:"text-xs mt-2",style:{color:"#EF4444"},children:["❌"," No valid AKB (CLAUDE.md required)"]}),se&&c.jsx(vd,{onSelect:ue=>{ae(ue),T(null),de(!1)},onClose:()=>de(!1)})]})]})]}),Ct==="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."}),he.map(ue=>c.jsxs("div",{className:Xe(Ce===ue.id),onClick:()=>Oe(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(De=>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:De.name},De.id))})]},ue.id)),c.jsxs("div",{className:Xe(Ce==="custom"),onClick:()=>Oe("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."})]})]}),Ct==="create"&&c.jsxs("div",{className:"space-y-4",children:[c.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--terminal-text)"},children:lt?z==="existing-akb"?"AKB Connected!":"Company Created!":"Review & Create"}),!lt&&!pe&&!Yt&&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:z==="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:"})," ",re]}),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:"})," ",y]}),c.jsxs("div",{children:[c.jsx("span",{className:"opacity-50",children:"Engine:"})," ",u==="claude-cli"?"Claude Code CLI":"Direct API"]}),c.jsxs("div",{children:[c.jsx("span",{className:"opacity-50",children:"Project:"})," ",N==="fresh"?"Start Fresh":`Existing (${_})`]}),c.jsxs("div",{children:[c.jsx("span",{className:"opacity-50",children:"Knowledge:"})," ",z==="skip"?"Fresh (empty)":`Import ${L.length} source(s)`]}),c.jsxs("div",{children:[c.jsx("span",{className:"opacity-50",children:"Team:"})," ",Ce]}),z==="import"&&L.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."})]})}),Ee&&c.jsx("div",{className:"text-xs p-3 rounded",style:{background:"rgba(220,38,38,0.15)",color:"#f87171"},children:Ee})]}),(pe||Yt)&&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:Yt?"Connecting to AKB...":"Scaffolding your company..."})]}),lt&&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:Mt.map((ue,De)=>c.jsxs("div",{className:"py-0.5",children:[c.jsx("span",{style:{color:"var(--active-green)"},children:"✓"})," ",ue]},De))}),z==="import"&&L.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&&!lt&&c.jsx("button",{onClick:Bt,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," / ",on.length]}),c.jsx("div",{children:lt?c.jsx("button",{onClick:be,className:"px-5 py-2 rounded text-sm font-medium transition-colors",style:{background:"var(--active-green)",color:"#fff"},children:"Enter Office"}):c.jsx("button",{onClick:Ln,disabled:!Ot()||pe||Yt,className:"px-5 py-2 rounded text-sm font-medium transition-colors",style:{background:Ot()?"var(--accent)":"var(--terminal-border)",color:"#fff",opacity:Ot()&&!pe&&!Yt?1:.5},children:Ct==="create"?pe||Yt?Yt?"Connecting...":"Creating...":z==="existing-akb"?"Connect AKB":"Create Company":"Next"})})]})]})})}function FC(){const[t,l]=j.useState(null),[a,i]=j.useState(!0),[o,u]=j.useState(null),f=j.useCallback(async()=>{i(!0),u(null);try{const m=await Ae.getStatus();l(m)}catch(m){u(m instanceof Error?m.message:"Failed to fetch status")}finally{i(!1)}},[]);return j.useEffect(()=>{f()},[f]),{initialized:(t==null?void 0:t.initialized)??!1,companyName:(t==null?void 0:t.companyName)??null,engine:(t==null?void 0:t.engine)??"none",companyRoot:(t==null?void 0:t.companyRoot)??"",loading:a,error:o,refetch:f}}const RC=j.lazy(()=>Db(()=>import("./preview-app-DgPZuBe8.js"),[]));function dg(){return c.jsx("div",{className:"h-full flex items-center justify-center",style:{background:"var(--floor-dark)"},children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"w-10 h-10 mx-auto border-2 rounded-full animate-spin",style:{borderColor:"var(--terminal-border)",borderTopColor:"var(--accent)"}}),c.jsx("div",{className:"mt-4 text-sm",style:{color:"var(--terminal-text-secondary)",fontFamily:"var(--pixel-font)"},children:"Loading..."})]})})}function OC(){var t;try{const l=localStorage.getItem("tycono-theme")||localStorage.getItem("the-company-theme"),a=l&&l in Ea?l:"default",i=(t=Ea[a])==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 BC(){const{initialized:t,loading:l,refetch:a}=FC(),[i,o]=j.useState(null);j.useEffect(()=>{OC()},[]);const u=f=>{f&&o(f),a()};return l?c.jsx(dg,{}):t?c.jsx(zC,{importJob:i,onImportDone:()=>o(null)}):c.jsx(_C,{onComplete:u})}function $C(){const t=new URLSearchParams(window.location.search).has("sprite-preview");return c.jsx(Tb,{children:t?c.jsx(j.Suspense,{fallback:c.jsx(dg,{}),children:c.jsx(RC,{})}):c.jsx(BC,{})})}Cb.createRoot(document.getElementById("root")).render(c.jsx(j.StrictMode,{children:c.jsx($C,{})}));export{Ky as H,Zy as P,Wy as S,UC as a,Qy as b,Gy as c,_d as d,sS as e,iS as f,HC as g,oS as h,c as j,j as r};