pi-forge 0.0.0 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +48 -4
- package/bin/pi-forge.mjs +37 -0
- package/dist/client/assets/CodeMirrorEditor-BqaaP1EE.js +34 -0
- package/dist/client/assets/CodeMirrorEditor-BqaaP1EE.js.map +1 -0
- package/dist/client/assets/index-B-529kgJ.css +32 -0
- package/dist/client/assets/index-BzKzxXFs.js +392 -0
- package/dist/client/assets/index-BzKzxXFs.js.map +1 -0
- package/dist/client/assets/workbox-window.prod.es5-BBnX5xw4.js +3 -0
- package/dist/client/assets/workbox-window.prod.es5-BBnX5xw4.js.map +1 -0
- package/dist/client/icons/icon-192.png +0 -0
- package/dist/client/icons/icon-512.png +0 -0
- package/dist/client/icons/icon-maskable-512.png +0 -0
- package/dist/client/icons/icon.svg +9 -0
- package/dist/client/index.html +24 -0
- package/dist/client/manifest.webmanifest +1 -0
- package/dist/client/offline.html +142 -0
- package/dist/client/sw.js +3 -0
- package/dist/client/sw.js.map +1 -0
- package/dist/client/workbox-6d7155ed.js +3 -0
- package/dist/client/workbox-6d7155ed.js.map +1 -0
- package/dist/server/agent-resource-loader.js +126 -0
- package/dist/server/agent-resource-loader.js.map +1 -0
- package/dist/server/attachment-converters.js +96 -0
- package/dist/server/attachment-converters.js.map +1 -0
- package/dist/server/auth.js +209 -0
- package/dist/server/auth.js.map +1 -0
- package/dist/server/compaction-history.js +106 -0
- package/dist/server/compaction-history.js.map +1 -0
- package/dist/server/concurrency.js +49 -0
- package/dist/server/concurrency.js.map +1 -0
- package/dist/server/config-export.js +220 -0
- package/dist/server/config-export.js.map +1 -0
- package/dist/server/config-manager.js +528 -0
- package/dist/server/config-manager.js.map +1 -0
- package/dist/server/config.js +326 -0
- package/dist/server/config.js.map +1 -0
- package/dist/server/conversion-worker.mjs +90 -0
- package/dist/server/diagnostics.js +137 -0
- package/dist/server/diagnostics.js.map +1 -0
- package/dist/server/extensions-discovery.js +147 -0
- package/dist/server/extensions-discovery.js.map +1 -0
- package/dist/server/file-manager.js +734 -0
- package/dist/server/file-manager.js.map +1 -0
- package/dist/server/file-references.js +215 -0
- package/dist/server/file-references.js.map +1 -0
- package/dist/server/file-searcher.js +385 -0
- package/dist/server/file-searcher.js.map +1 -0
- package/dist/server/git-runner.js +684 -0
- package/dist/server/git-runner.js.map +1 -0
- package/dist/server/index.js +468 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/mcp/config.js +133 -0
- package/dist/server/mcp/config.js.map +1 -0
- package/dist/server/mcp/manager.js +351 -0
- package/dist/server/mcp/manager.js.map +1 -0
- package/dist/server/mcp/tool-bridge.js +173 -0
- package/dist/server/mcp/tool-bridge.js.map +1 -0
- package/dist/server/project-manager.js +301 -0
- package/dist/server/project-manager.js.map +1 -0
- package/dist/server/pty-manager.js +354 -0
- package/dist/server/pty-manager.js.map +1 -0
- package/dist/server/routes/_schemas.js +73 -0
- package/dist/server/routes/_schemas.js.map +1 -0
- package/dist/server/routes/auth.js +164 -0
- package/dist/server/routes/auth.js.map +1 -0
- package/dist/server/routes/config.js +1163 -0
- package/dist/server/routes/config.js.map +1 -0
- package/dist/server/routes/control.js +464 -0
- package/dist/server/routes/control.js.map +1 -0
- package/dist/server/routes/exec.js +217 -0
- package/dist/server/routes/exec.js.map +1 -0
- package/dist/server/routes/files.js +847 -0
- package/dist/server/routes/files.js.map +1 -0
- package/dist/server/routes/git.js +837 -0
- package/dist/server/routes/git.js.map +1 -0
- package/dist/server/routes/health.js +97 -0
- package/dist/server/routes/health.js.map +1 -0
- package/dist/server/routes/mcp.js +300 -0
- package/dist/server/routes/mcp.js.map +1 -0
- package/dist/server/routes/projects.js +259 -0
- package/dist/server/routes/projects.js.map +1 -0
- package/dist/server/routes/prompt.js +496 -0
- package/dist/server/routes/prompt.js.map +1 -0
- package/dist/server/routes/sessions.js +783 -0
- package/dist/server/routes/sessions.js.map +1 -0
- package/dist/server/routes/stream.js +69 -0
- package/dist/server/routes/stream.js.map +1 -0
- package/dist/server/routes/terminal.js +335 -0
- package/dist/server/routes/terminal.js.map +1 -0
- package/dist/server/session-registry.js +1197 -0
- package/dist/server/session-registry.js.map +1 -0
- package/dist/server/skill-overrides.js +151 -0
- package/dist/server/skill-overrides.js.map +1 -0
- package/dist/server/skills-export.js +257 -0
- package/dist/server/skills-export.js.map +1 -0
- package/dist/server/sse-bridge.js +220 -0
- package/dist/server/sse-bridge.js.map +1 -0
- package/dist/server/tool-overrides.js +277 -0
- package/dist/server/tool-overrides.js.map +1 -0
- package/dist/server/turn-diff-builder.js +280 -0
- package/dist/server/turn-diff-builder.js.map +1 -0
- package/package.json +53 -12
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
var Gw=Object.defineProperty;var Ww=(e,r,n)=>r in e?Gw(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n;var Il=(e,r,n)=>Ww(e,typeof r!="symbol"?r+"":r,n);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function n(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(a){if(a.ep)return;a.ep=!0;const u=n(a);fetch(a.href,u)}})();function xf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vd={exports:{}},Fa={};/**
|
|
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 xy;function Kw(){if(xy)return Fa;xy=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function n(s,a,u){var d=null;if(u!==void 0&&(d=""+u),a.key!==void 0&&(d=""+a.key),"key"in a){u={};for(var o in a)o!=="key"&&(u[o]=a[o])}else u=a;return a=u.ref,{$$typeof:e,type:s,key:d,ref:a!==void 0?a:null,props:u}}return Fa.Fragment=r,Fa.jsx=n,Fa.jsxs=n,Fa}var _y;function Vw(){return _y||(_y=1,Vd.exports=Kw()),Vd.exports}var g=Vw(),Xd={exports:{}},qe={};/**
|
|
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 Sy;function Xw(){if(Sy)return qe;Sy=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),d=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),v=Symbol.iterator;function w(O){return O===null||typeof O!="object"?null:(O=v&&O[v]||O["@@iterator"],typeof O=="function"?O:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,y={};function S(O,Q,M){this.props=O,this.context=Q,this.refs=y,this.updater=M||A}S.prototype.isReactComponent={},S.prototype.setState=function(O,Q){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,Q,"setState")},S.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function _(){}_.prototype=S.prototype;function x(O,Q,M){this.props=O,this.context=Q,this.refs=y,this.updater=M||A}var E=x.prototype=new _;E.constructor=x,b(E,S.prototype),E.isPureReactComponent=!0;var N=Array.isArray;function T(){}var j={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function D(O,Q,M){var J=M.ref;return{$$typeof:e,type:O,key:Q,ref:J!==void 0?J:null,props:M}}function L(O,Q){return D(O.type,Q,O.props)}function z(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function U(O){var Q={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(M){return Q[M]})}var P=/\/+/g;function G(O,Q){return typeof O=="object"&&O!==null&&O.key!=null?U(""+O.key):Q.toString(36)}function K(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(T,T):(O.status="pending",O.then(function(Q){O.status==="pending"&&(O.status="fulfilled",O.value=Q)},function(Q){O.status==="pending"&&(O.status="rejected",O.reason=Q)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function W(O,Q,M,J,de){var pe=typeof O;(pe==="undefined"||pe==="boolean")&&(O=null);var X=!1;if(O===null)X=!0;else switch(pe){case"bigint":case"string":case"number":X=!0;break;case"object":switch(O.$$typeof){case e:case r:X=!0;break;case m:return X=O._init,W(X(O._payload),Q,M,J,de)}}if(X)return de=de(O),X=J===""?"."+G(O,0):J,N(de)?(M="",X!=null&&(M=X.replace(P,"$&/")+"/"),W(de,Q,M,"",function(le){return le})):de!=null&&(z(de)&&(de=L(de,M+(de.key==null||O&&O.key===de.key?"":(""+de.key).replace(P,"$&/")+"/")+X)),Q.push(de)),1;X=0;var $=J===""?".":J+":";if(N(O))for(var se=0;se<O.length;se++)J=O[se],pe=$+G(J,se),X+=W(J,Q,M,pe,de);else if(se=w(O),typeof se=="function")for(O=se.call(O),se=0;!(J=O.next()).done;)J=J.value,pe=$+G(J,se++),X+=W(J,Q,M,pe,de);else if(pe==="object"){if(typeof O.then=="function")return W(K(O),Q,M,J,de);throw Q=String(O),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return X}function Y(O,Q,M){if(O==null)return O;var J=[],de=0;return W(O,J,"","",function(pe){return Q.call(M,pe,de++)}),J}function ne(O){if(O._status===-1){var Q=O._result;Q=Q(),Q.then(function(M){(O._status===0||O._status===-1)&&(O._status=1,O._result=M)},function(M){(O._status===0||O._status===-1)&&(O._status=2,O._result=M)}),O._status===-1&&(O._status=0,O._result=Q)}if(O._status===1)return O._result.default;throw O._result}var F=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},B={map:Y,forEach:function(O,Q,M){Y(O,function(){Q.apply(this,arguments)},M)},count:function(O){var Q=0;return Y(O,function(){Q++}),Q},toArray:function(O){return Y(O,function(Q){return Q})||[]},only:function(O){if(!z(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return qe.Activity=f,qe.Children=B,qe.Component=S,qe.Fragment=n,qe.Profiler=a,qe.PureComponent=x,qe.StrictMode=s,qe.Suspense=c,qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,qe.__COMPILER_RUNTIME={__proto__:null,c:function(O){return j.H.useMemoCache(O)}},qe.cache=function(O){return function(){return O.apply(null,arguments)}},qe.cacheSignal=function(){return null},qe.cloneElement=function(O,Q,M){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var J=b({},O.props),de=O.key;if(Q!=null)for(pe in Q.key!==void 0&&(de=""+Q.key),Q)!R.call(Q,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&Q.ref===void 0||(J[pe]=Q[pe]);var pe=arguments.length-2;if(pe===1)J.children=M;else if(1<pe){for(var X=Array(pe),$=0;$<pe;$++)X[$]=arguments[$+2];J.children=X}return D(O.type,de,J)},qe.createContext=function(O){return O={$$typeof:d,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:u,_context:O},O},qe.createElement=function(O,Q,M){var J,de={},pe=null;if(Q!=null)for(J in Q.key!==void 0&&(pe=""+Q.key),Q)R.call(Q,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(de[J]=Q[J]);var X=arguments.length-2;if(X===1)de.children=M;else if(1<X){for(var $=Array(X),se=0;se<X;se++)$[se]=arguments[se+2];de.children=$}if(O&&O.defaultProps)for(J in X=O.defaultProps,X)de[J]===void 0&&(de[J]=X[J]);return D(O,pe,de)},qe.createRef=function(){return{current:null}},qe.forwardRef=function(O){return{$$typeof:o,render:O}},qe.isValidElement=z,qe.lazy=function(O){return{$$typeof:m,_payload:{_status:-1,_result:O},_init:ne}},qe.memo=function(O,Q){return{$$typeof:h,type:O,compare:Q===void 0?null:Q}},qe.startTransition=function(O){var Q=j.T,M={};j.T=M;try{var J=O(),de=j.S;de!==null&&de(M,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(T,F)}catch(pe){F(pe)}finally{Q!==null&&M.types!==null&&(Q.types=M.types),j.T=Q}},qe.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},qe.use=function(O){return j.H.use(O)},qe.useActionState=function(O,Q,M){return j.H.useActionState(O,Q,M)},qe.useCallback=function(O,Q){return j.H.useCallback(O,Q)},qe.useContext=function(O){return j.H.useContext(O)},qe.useDebugValue=function(){},qe.useDeferredValue=function(O,Q){return j.H.useDeferredValue(O,Q)},qe.useEffect=function(O,Q){return j.H.useEffect(O,Q)},qe.useEffectEvent=function(O){return j.H.useEffectEvent(O)},qe.useId=function(){return j.H.useId()},qe.useImperativeHandle=function(O,Q,M){return j.H.useImperativeHandle(O,Q,M)},qe.useInsertionEffect=function(O,Q){return j.H.useInsertionEffect(O,Q)},qe.useLayoutEffect=function(O,Q){return j.H.useLayoutEffect(O,Q)},qe.useMemo=function(O,Q){return j.H.useMemo(O,Q)},qe.useOptimistic=function(O,Q){return j.H.useOptimistic(O,Q)},qe.useReducer=function(O,Q,M){return j.H.useReducer(O,Q,M)},qe.useRef=function(O){return j.H.useRef(O)},qe.useState=function(O){return j.H.useState(O)},qe.useSyncExternalStore=function(O,Q,M){return j.H.useSyncExternalStore(O,Q,M)},qe.useTransition=function(){return j.H.useTransition()},qe.version="19.2.6",qe}var wy;function _f(){return wy||(wy=1,Xd.exports=Xw()),Xd.exports}var q=_f();const Ll=xf(q);var Yd={exports:{}},Pa={},Zd={exports:{}},Jd={};/**
|
|
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 Ay;function Yw(){return Ay||(Ay=1,(function(e){function r(W,Y){var ne=W.length;W.push(Y);e:for(;0<ne;){var F=ne-1>>>1,B=W[F];if(0<a(B,Y))W[F]=Y,W[ne]=B,ne=F;else break e}}function n(W){return W.length===0?null:W[0]}function s(W){if(W.length===0)return null;var Y=W[0],ne=W.pop();if(ne!==Y){W[0]=ne;e:for(var F=0,B=W.length,O=B>>>1;F<O;){var Q=2*(F+1)-1,M=W[Q],J=Q+1,de=W[J];if(0>a(M,ne))J<B&&0>a(de,M)?(W[F]=de,W[J]=ne,F=J):(W[F]=M,W[Q]=ne,F=Q);else if(J<B&&0>a(de,ne))W[F]=de,W[J]=ne,F=J;else break e}}return Y}function a(W,Y){var ne=W.sortIndex-Y.sortIndex;return ne!==0?ne:W.id-Y.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var d=Date,o=d.now();e.unstable_now=function(){return d.now()-o}}var c=[],h=[],m=1,f=null,v=3,w=!1,A=!1,b=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function E(W){for(var Y=n(h);Y!==null;){if(Y.callback===null)s(h);else if(Y.startTime<=W)s(h),Y.sortIndex=Y.expirationTime,r(c,Y);else break;Y=n(h)}}function N(W){if(b=!1,E(W),!A)if(n(c)!==null)A=!0,T||(T=!0,U());else{var Y=n(h);Y!==null&&K(N,Y.startTime-W)}}var T=!1,j=-1,R=5,D=-1;function L(){return y?!0:!(e.unstable_now()-D<R)}function z(){if(y=!1,T){var W=e.unstable_now();D=W;var Y=!0;try{e:{A=!1,b&&(b=!1,_(j),j=-1),w=!0;var ne=v;try{t:{for(E(W),f=n(c);f!==null&&!(f.expirationTime>W&&L());){var F=f.callback;if(typeof F=="function"){f.callback=null,v=f.priorityLevel;var B=F(f.expirationTime<=W);if(W=e.unstable_now(),typeof B=="function"){f.callback=B,E(W),Y=!0;break t}f===n(c)&&s(c),E(W)}else s(c);f=n(c)}if(f!==null)Y=!0;else{var O=n(h);O!==null&&K(N,O.startTime-W),Y=!1}}break e}finally{f=null,v=ne,w=!1}Y=void 0}}finally{Y?U():T=!1}}}var U;if(typeof x=="function")U=function(){x(z)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,G=P.port2;P.port1.onmessage=z,U=function(){G.postMessage(null)}}else U=function(){S(z,0)};function K(W,Y){j=S(function(){W(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(W){W.callback=null},e.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<W?Math.floor(1e3/W):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(W){switch(v){case 1:case 2:case 3:var Y=3;break;default:Y=v}var ne=v;v=Y;try{return W()}finally{v=ne}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(W,Y){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var ne=v;v=W;try{return Y()}finally{v=ne}},e.unstable_scheduleCallback=function(W,Y,ne){var F=e.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?F+ne:F):ne=F,W){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=ne+B,W={id:m++,callback:Y,priorityLevel:W,startTime:ne,expirationTime:B,sortIndex:-1},ne>F?(W.sortIndex=ne,r(h,W),n(c)===null&&W===n(h)&&(b?(_(j),j=-1):b=!0,K(N,ne-F))):(W.sortIndex=B,r(c,W),A||w||(A=!0,T||(T=!0,U()))),W},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(W){var Y=v;return function(){var ne=v;v=Y;try{return W.apply(this,arguments)}finally{v=ne}}}})(Jd)),Jd}var Cy;function Zw(){return Cy||(Cy=1,Zd.exports=Yw()),Zd.exports}var eh={exports:{}},an={};/**
|
|
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 Ey;function Jw(){if(Ey)return an;Ey=1;var e=_f();function r(c){var h="https://react.dev/errors/"+c;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+c+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={d:{f:n,r:function(){throw Error(r(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function u(c,h,m){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:f==null?null:""+f,children:c,containerInfo:h,implementation:m}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,h){if(c==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return an.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,an.createPortal=function(c,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(r(299));return u(c,h,null,m)},an.flushSync=function(c){var h=d.T,m=s.p;try{if(d.T=null,s.p=2,c)return c()}finally{d.T=h,s.p=m,s.d.f()}},an.preconnect=function(c,h){typeof c=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,s.d.C(c,h))},an.prefetchDNS=function(c){typeof c=="string"&&s.d.D(c)},an.preinit=function(c,h){if(typeof c=="string"&&h&&typeof h.as=="string"){var m=h.as,f=o(m,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?s.d.S(c,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:f,integrity:v,fetchPriority:w}):m==="script"&&s.d.X(c,{crossOrigin:f,integrity:v,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},an.preinitModule=function(c,h){if(typeof c=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=o(h.as,h.crossOrigin);s.d.M(c,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&s.d.M(c)},an.preload=function(c,h){if(typeof c=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,f=o(m,h.crossOrigin);s.d.L(c,m,{crossOrigin:f,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})}},an.preloadModule=function(c,h){if(typeof c=="string")if(h){var m=o(h.as,h.crossOrigin);s.d.m(c,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else s.d.m(c)},an.requestFormReset=function(c){s.d.r(c)},an.unstable_batchedUpdates=function(c,h){return c(h)},an.useFormState=function(c,h,m){return d.H.useFormState(c,h,m)},an.useFormStatus=function(){return d.H.useHostTransitionStatus()},an.version="19.2.6",an}var ky;function eA(){if(ky)return eh.exports;ky=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),eh.exports=Jw(),eh.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 Ny;function tA(){if(Ny)return Pa;Ny=1;var e=Zw(),r=_f(),n=eA();function s(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){var i=t,l=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(l=i.return),t=i.return;while(t)}return i.tag===3?l:null}function d(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function o(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function c(t){if(u(t)!==t)throw Error(s(188))}function h(t){var i=t.alternate;if(!i){if(i=u(t),i===null)throw Error(s(188));return i!==t?null:t}for(var l=t,p=i;;){var C=l.return;if(C===null)break;var k=C.alternate;if(k===null){if(p=C.return,p!==null){l=p;continue}break}if(C.child===k.child){for(k=C.child;k;){if(k===l)return c(C),t;if(k===p)return c(C),i;k=k.sibling}throw Error(s(188))}if(l.return!==p.return)l=C,p=k;else{for(var I=!1,H=C.child;H;){if(H===l){I=!0,l=C,p=k;break}if(H===p){I=!0,p=C,l=k;break}H=H.sibling}if(!I){for(H=k.child;H;){if(H===l){I=!0,l=k,p=C;break}if(H===p){I=!0,p=k,l=C;break}H=H.sibling}if(!I)throw Error(s(189))}}if(l.alternate!==p)throw Error(s(190))}if(l.tag!==3)throw Error(s(188));return l.stateNode.current===l?t:i}function m(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=m(t),i!==null)return i;t=t.sibling}return null}var f=Object.assign,v=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),x=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function U(t){return t===null||typeof t!="object"?null:(t=z&&t[z]||t["@@iterator"],typeof t=="function"?t:null)}var P=Symbol.for("react.client.reference");function G(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===P?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case b:return"Fragment";case S:return"Profiler";case y:return"StrictMode";case N:return"Suspense";case T:return"SuspenseList";case D:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case A:return"Portal";case x:return t.displayName||"Context";case _:return(t._context.displayName||"Context")+".Consumer";case E:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case j:return i=t.displayName||null,i!==null?i:G(t.type)||"Memo";case R:i=t._payload,t=t._init;try{return G(t(i))}catch{}}return null}var K=Array.isArray,W=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},F=[],B=-1;function O(t){return{current:t}}function Q(t){0>B||(t.current=F[B],F[B]=null,B--)}function M(t,i){B++,F[B]=t.current,t.current=i}var J=O(null),de=O(null),pe=O(null),X=O(null);function $(t,i){switch(M(pe,i),M(de,t),M(J,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?$0(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=$0(i),t=q0(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Q(J),M(J,t)}function se(){Q(J),Q(de),Q(pe)}function le(t){t.memoizedState!==null&&M(X,t);var i=J.current,l=q0(i,t.type);i!==l&&(M(de,t),M(J,l))}function te(t){de.current===t&&(Q(J),Q(de)),X.current===t&&(Q(X),La._currentValue=ne)}var ue,Ae;function Le(t){if(ue===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);ue=i&&i[1]||"",Ae=-1<l.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+ue+t+Ae}var Me=!1;function Pe(t,i){if(!t||Me)return"";Me=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(i){var ye=function(){throw Error()};if(Object.defineProperty(ye.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ye,[])}catch(he){var ce=he}Reflect.construct(t,[],ye)}else{try{ye.call()}catch(he){ce=he}t.call(ye.prototype)}}else{try{throw Error()}catch(he){ce=he}(ye=t())&&typeof ye.catch=="function"&&ye.catch(function(){})}}catch(he){if(he&&ce&&typeof he.stack=="string")return[he.stack,ce.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var C=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");C&&C.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=p.DetermineComponentFrameRoot(),I=k[0],H=k[1];if(I&&H){var V=I.split(`
|
|
44
|
+
`),oe=H.split(`
|
|
45
|
+
`);for(C=p=0;p<V.length&&!V[p].includes("DetermineComponentFrameRoot");)p++;for(;C<oe.length&&!oe[C].includes("DetermineComponentFrameRoot");)C++;if(p===V.length||C===oe.length)for(p=V.length-1,C=oe.length-1;1<=p&&0<=C&&V[p]!==oe[C];)C--;for(;1<=p&&0<=C;p--,C--)if(V[p]!==oe[C]){if(p!==1||C!==1)do if(p--,C--,0>C||V[p]!==oe[C]){var ge=`
|
|
46
|
+
`+V[p].replace(" at new "," at ");return t.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",t.displayName)),ge}while(1<=p&&0<=C);break}}}finally{Me=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?Le(l):""}function Be(t,i){switch(t.tag){case 26:case 27:case 5:return Le(t.type);case 16:return Le("Lazy");case 13:return t.child!==i&&i!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return Pe(t.type,!1);case 11:return Pe(t.type.render,!1);case 1:return Pe(t.type,!0);case 31:return Le("Activity");default:return""}}function jt(t){try{var i="",l=null;do i+=Be(t,l),l=t,t=t.return;while(t);return i}catch(p){return`
|
|
47
|
+
Error generating stack: `+p.message+`
|
|
48
|
+
`+p.stack}}var gt=Object.prototype.hasOwnProperty,Ce=e.unstable_scheduleCallback,Kt=e.unstable_cancelCallback,Mt=e.unstable_shouldYield,st=e.unstable_requestPaint,xt=e.unstable_now,Pt=e.unstable_getCurrentPriorityLevel,fe=e.unstable_ImmediatePriority,_e=e.unstable_UserBlockingPriority,je=e.unstable_NormalPriority,Ue=e.unstable_LowPriority,$e=e.unstable_IdlePriority,Tt=e.log,Ye=e.unstable_setDisableYieldValue,Ot=null,Dt=null;function Z(t){if(typeof Tt=="function"&&Ye(t),Dt&&typeof Dt.setStrictMode=="function")try{Dt.setStrictMode(Ot,t)}catch{}}var xe=Math.clz32?Math.clz32:Gn,Qe=Math.log,Ct=Math.LN2;function Gn(t){return t>>>=0,t===0?32:31-(Qe(t)/Ct|0)|0}var ie=256,Ne=262144,Te=4194304;function Ve(t){var i=t&42;if(i!==0)return i;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function mt(t,i,l){var p=t.pendingLanes;if(p===0)return 0;var C=0,k=t.suspendedLanes,I=t.pingedLanes;t=t.warmLanes;var H=p&134217727;return H!==0?(p=H&~k,p!==0?C=Ve(p):(I&=H,I!==0?C=Ve(I):l||(l=H&~t,l!==0&&(C=Ve(l))))):(H=p&~k,H!==0?C=Ve(H):I!==0?C=Ve(I):l||(l=p&~t,l!==0&&(C=Ve(l)))),C===0?0:i!==0&&i!==C&&(i&k)===0&&(k=C&-C,l=i&-i,k>=l||k===32&&(l&4194048)!==0)?i:C}function ut(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function Jn(t,i){switch(t){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 Ap(){var t=Te;return Te<<=1,(Te&62914560)===0&&(Te=4194304),t}function Oc(t){for(var i=[],l=0;31>l;l++)i.push(t);return i}function Vs(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function I1(t,i,l,p,C,k){var I=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var H=t.entanglements,V=t.expirationTimes,oe=t.hiddenUpdates;for(l=I&~l;0<l;){var ge=31-xe(l),ye=1<<ge;H[ge]=0,V[ge]=-1;var ce=oe[ge];if(ce!==null)for(oe[ge]=null,ge=0;ge<ce.length;ge++){var he=ce[ge];he!==null&&(he.lane&=-536870913)}l&=~ye}p!==0&&Cp(t,p,0),k!==0&&C===0&&t.tag!==0&&(t.suspendedLanes|=k&~(I&~i))}function Cp(t,i,l){t.pendingLanes|=i,t.suspendedLanes&=~i;var p=31-xe(i);t.entangledLanes|=i,t.entanglements[p]=t.entanglements[p]|1073741824|l&261930}function Ep(t,i){var l=t.entangledLanes|=i;for(t=t.entanglements;l;){var p=31-xe(l),C=1<<p;C&i|t[p]&i&&(t[p]|=i),l&=~C}}function kp(t,i){var l=i&-i;return l=(l&42)!==0?1:zc(l),(l&(t.suspendedLanes|i))!==0?0:l}function zc(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Fc(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Np(){var t=Y.p;return t!==0?t:(t=window.event,t===void 0?32:fy(t.type))}function Tp(t,i){var l=Y.p;try{return Y.p=t,i()}finally{Y.p=l}}var Or=Math.random().toString(36).slice(2),en="__reactFiber$"+Or,hn="__reactProps$"+Or,Qi="__reactContainer$"+Or,Pc="__reactEvents$"+Or,L1="__reactListeners$"+Or,M1="__reactHandles$"+Or,Rp="__reactResources$"+Or,Xs="__reactMarker$"+Or;function Hc(t){delete t[en],delete t[hn],delete t[Pc],delete t[L1],delete t[M1]}function Gi(t){var i=t[en];if(i)return i;for(var l=t.parentNode;l;){if(i=l[Qi]||l[en]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(t=Y0(t);t!==null;){if(l=t[en])return l;t=Y0(t)}return i}t=l,l=t.parentNode}return null}function Wi(t){if(t=t[en]||t[Qi]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function Ys(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(s(33))}function Ki(t){var i=t[Rp];return i||(i=t[Rp]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Vt(t){t[Xs]=!0}var jp=new Set,Dp={};function fi(t,i){Vi(t,i),Vi(t+"Capture",i)}function Vi(t,i){for(Dp[t]=i,t=0;t<i.length;t++)jp.add(i[t])}var O1=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]*$"),Bp={},Ip={};function z1(t){return gt.call(Ip,t)?!0:gt.call(Bp,t)?!1:O1.test(t)?Ip[t]=!0:(Bp[t]=!0,!1)}function So(t,i,l){if(z1(i))if(l===null)t.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var p=i.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+l)}}function wo(t,i,l){if(l===null)t.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+l)}}function pr(t,i,l,p){if(p===null)t.removeAttribute(l);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(i,l,""+p)}}function Bn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Lp(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function F1(t,i,l){var p=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var C=p.get,k=p.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return C.call(this)},set:function(I){l=""+I,k.call(this,I)}}),Object.defineProperty(t,i,{enumerable:p.enumerable}),{getValue:function(){return l},setValue:function(I){l=""+I},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function Uc(t){if(!t._valueTracker){var i=Lp(t)?"checked":"value";t._valueTracker=F1(t,i,""+t[i])}}function Mp(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var l=i.getValue(),p="";return t&&(p=Lp(t)?t.checked?"true":"false":t.value),t=p,t!==l?(i.setValue(t),!0):!1}function Ao(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var P1=/[\n"\\]/g;function In(t){return t.replace(P1,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function $c(t,i,l,p,C,k,I,H){t.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?t.type=I:t.removeAttribute("type"),i!=null?I==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+Bn(i)):t.value!==""+Bn(i)&&(t.value=""+Bn(i)):I!=="submit"&&I!=="reset"||t.removeAttribute("value"),i!=null?qc(t,I,Bn(i)):l!=null?qc(t,I,Bn(l)):p!=null&&t.removeAttribute("value"),C==null&&k!=null&&(t.defaultChecked=!!k),C!=null&&(t.checked=C&&typeof C!="function"&&typeof C!="symbol"),H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"?t.name=""+Bn(H):t.removeAttribute("name")}function Op(t,i,l,p,C,k,I,H){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(t.type=k),i!=null||l!=null){if(!(k!=="submit"&&k!=="reset"||i!=null)){Uc(t);return}l=l!=null?""+Bn(l):"",i=i!=null?""+Bn(i):l,H||i===t.value||(t.value=i),t.defaultValue=i}p=p??C,p=typeof p!="function"&&typeof p!="symbol"&&!!p,t.checked=H?t.checked:!!p,t.defaultChecked=!!p,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(t.name=I),Uc(t)}function qc(t,i,l){i==="number"&&Ao(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function Xi(t,i,l,p){if(t=t.options,i){i={};for(var C=0;C<l.length;C++)i["$"+l[C]]=!0;for(l=0;l<t.length;l++)C=i.hasOwnProperty("$"+t[l].value),t[l].selected!==C&&(t[l].selected=C),C&&p&&(t[l].defaultSelected=!0)}else{for(l=""+Bn(l),i=null,C=0;C<t.length;C++){if(t[C].value===l){t[C].selected=!0,p&&(t[C].defaultSelected=!0);return}i!==null||t[C].disabled||(i=t[C])}i!==null&&(i.selected=!0)}}function zp(t,i,l){if(i!=null&&(i=""+Bn(i),i!==t.value&&(t.value=i),l==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=l!=null?""+Bn(l):""}function Fp(t,i,l,p){if(i==null){if(p!=null){if(l!=null)throw Error(s(92));if(K(p)){if(1<p.length)throw Error(s(93));p=p[0]}l=p}l==null&&(l=""),i=l}l=Bn(i),t.defaultValue=l,p=t.textContent,p===l&&p!==""&&p!==null&&(t.value=p),Uc(t)}function Yi(t,i){if(i){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=i;return}}t.textContent=i}var H1=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 Pp(t,i,l){var p=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?p?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":p?t.setProperty(i,l):typeof l!="number"||l===0||H1.has(i)?i==="float"?t.cssFloat=l:t[i]=(""+l).trim():t[i]=l+"px"}function Hp(t,i,l){if(i!=null&&typeof i!="object")throw Error(s(62));if(t=t.style,l!=null){for(var p in l)!l.hasOwnProperty(p)||i!=null&&i.hasOwnProperty(p)||(p.indexOf("--")===0?t.setProperty(p,""):p==="float"?t.cssFloat="":t[p]="");for(var C in i)p=i[C],i.hasOwnProperty(C)&&l[C]!==p&&Pp(t,C,p)}else for(var k in i)i.hasOwnProperty(k)&&Pp(t,k,i[k])}function Qc(t){if(t.indexOf("-")===-1)return!1;switch(t){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 U1=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"]]),$1=/^[\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 Co(t){return $1.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function gr(){}var Gc=null;function Wc(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Zi=null,Ji=null;function Up(t){var i=Wi(t);if(i&&(t=i.stateNode)){var l=t[hn]||null;e:switch(t=i.stateNode,i.type){case"input":if($c(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+In(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var p=l[i];if(p!==t&&p.form===t.form){var C=p[hn]||null;if(!C)throw Error(s(90));$c(p,C.value,C.defaultValue,C.defaultValue,C.checked,C.defaultChecked,C.type,C.name)}}for(i=0;i<l.length;i++)p=l[i],p.form===t.form&&Mp(p)}break e;case"textarea":zp(t,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&Xi(t,!!l.multiple,i,!1)}}}var Kc=!1;function $p(t,i,l){if(Kc)return t(i,l);Kc=!0;try{var p=t(i);return p}finally{if(Kc=!1,(Zi!==null||Ji!==null)&&(hl(),Zi&&(i=Zi,t=Ji,Ji=Zi=null,Up(i),t)))for(i=0;i<t.length;i++)Up(t[i])}}function Zs(t,i){var l=t.stateNode;if(l===null)return null;var p=l[hn]||null;if(p===null)return null;l=p[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(t=t.type,p=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!p;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(s(231,i,typeof l));return l}var mr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vc=!1;if(mr)try{var Js={};Object.defineProperty(Js,"passive",{get:function(){Vc=!0}}),window.addEventListener("test",Js,Js),window.removeEventListener("test",Js,Js)}catch{Vc=!1}var zr=null,Xc=null,Eo=null;function qp(){if(Eo)return Eo;var t,i=Xc,l=i.length,p,C="value"in zr?zr.value:zr.textContent,k=C.length;for(t=0;t<l&&i[t]===C[t];t++);var I=l-t;for(p=1;p<=I&&i[l-p]===C[k-p];p++);return Eo=C.slice(t,1<p?1-p:void 0)}function ko(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function No(){return!0}function Qp(){return!1}function fn(t){function i(l,p,C,k,I){this._reactName=l,this._targetInst=C,this.type=p,this.nativeEvent=k,this.target=I,this.currentTarget=null;for(var H in t)t.hasOwnProperty(H)&&(l=t[H],this[H]=l?l(k):k[H]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?No:Qp,this.isPropagationStopped=Qp,this}return f(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=No)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=No)},persist:function(){},isPersistent:No}),i}var pi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},To=fn(pi),ea=f({},pi,{view:0,detail:0}),q1=fn(ea),Yc,Zc,ta,Ro=f({},ea,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:eu,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==ta&&(ta&&t.type==="mousemove"?(Yc=t.screenX-ta.screenX,Zc=t.screenY-ta.screenY):Zc=Yc=0,ta=t),Yc)},movementY:function(t){return"movementY"in t?t.movementY:Zc}}),Gp=fn(Ro),Q1=f({},Ro,{dataTransfer:0}),G1=fn(Q1),W1=f({},ea,{relatedTarget:0}),Jc=fn(W1),K1=f({},pi,{animationName:0,elapsedTime:0,pseudoElement:0}),V1=fn(K1),X1=f({},pi,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Y1=fn(X1),Z1=f({},pi,{data:0}),Wp=fn(Z1),J1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},eS={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"},tS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nS(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=tS[t])?!!i[t]:!1}function eu(){return nS}var rS=f({},ea,{key:function(t){if(t.key){var i=J1[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=ko(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?eS[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:eu,charCode:function(t){return t.type==="keypress"?ko(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ko(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),iS=fn(rS),sS=f({},Ro,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Kp=fn(sS),aS=f({},ea,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:eu}),oS=fn(aS),lS=f({},pi,{propertyName:0,elapsedTime:0,pseudoElement:0}),cS=fn(lS),uS=f({},Ro,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),dS=fn(uS),hS=f({},pi,{newState:0,oldState:0}),fS=fn(hS),pS=[9,13,27,32],tu=mr&&"CompositionEvent"in window,na=null;mr&&"documentMode"in document&&(na=document.documentMode);var gS=mr&&"TextEvent"in window&&!na,Vp=mr&&(!tu||na&&8<na&&11>=na),Xp=" ",Yp=!1;function Zp(t,i){switch(t){case"keyup":return pS.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jp(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var es=!1;function mS(t,i){switch(t){case"compositionend":return Jp(i);case"keypress":return i.which!==32?null:(Yp=!0,Xp);case"textInput":return t=i.data,t===Xp&&Yp?null:t;default:return null}}function yS(t,i){if(es)return t==="compositionend"||!tu&&Zp(t,i)?(t=qp(),Eo=Xc=zr=null,es=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Vp&&i.locale!=="ko"?null:i.data;default:return null}}var vS={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 eg(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!vS[t.type]:i==="textarea"}function tg(t,i,l,p){Zi?Ji?Ji.push(p):Ji=[p]:Zi=p,i=bl(i,"onChange"),0<i.length&&(l=new To("onChange","change",null,l,p),t.push({event:l,listeners:i}))}var ra=null,ia=null;function bS(t){O0(t,0)}function jo(t){var i=Ys(t);if(Mp(i))return t}function ng(t,i){if(t==="change")return i}var rg=!1;if(mr){var nu;if(mr){var ru="oninput"in document;if(!ru){var ig=document.createElement("div");ig.setAttribute("oninput","return;"),ru=typeof ig.oninput=="function"}nu=ru}else nu=!1;rg=nu&&(!document.documentMode||9<document.documentMode)}function sg(){ra&&(ra.detachEvent("onpropertychange",ag),ia=ra=null)}function ag(t){if(t.propertyName==="value"&&jo(ia)){var i=[];tg(i,ia,t,Wc(t)),$p(bS,i)}}function xS(t,i,l){t==="focusin"?(sg(),ra=i,ia=l,ra.attachEvent("onpropertychange",ag)):t==="focusout"&&sg()}function _S(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return jo(ia)}function SS(t,i){if(t==="click")return jo(i)}function wS(t,i){if(t==="input"||t==="change")return jo(i)}function AS(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var Sn=typeof Object.is=="function"?Object.is:AS;function sa(t,i){if(Sn(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var l=Object.keys(t),p=Object.keys(i);if(l.length!==p.length)return!1;for(p=0;p<l.length;p++){var C=l[p];if(!gt.call(i,C)||!Sn(t[C],i[C]))return!1}return!0}function og(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function lg(t,i){var l=og(t);t=0;for(var p;l;){if(l.nodeType===3){if(p=t+l.textContent.length,t<=i&&p>=i)return{node:l,offset:i-t};t=p}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=og(l)}}function cg(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?cg(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function ug(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=Ao(t.document);i instanceof t.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)t=i.contentWindow;else break;i=Ao(t.document)}return i}function iu(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var CS=mr&&"documentMode"in document&&11>=document.documentMode,ts=null,su=null,aa=null,au=!1;function dg(t,i,l){var p=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;au||ts==null||ts!==Ao(p)||(p=ts,"selectionStart"in p&&iu(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),aa&&sa(aa,p)||(aa=p,p=bl(su,"onSelect"),0<p.length&&(i=new To("onSelect","select",null,i,l),t.push({event:i,listeners:p}),i.target=ts)))}function gi(t,i){var l={};return l[t.toLowerCase()]=i.toLowerCase(),l["Webkit"+t]="webkit"+i,l["Moz"+t]="moz"+i,l}var ns={animationend:gi("Animation","AnimationEnd"),animationiteration:gi("Animation","AnimationIteration"),animationstart:gi("Animation","AnimationStart"),transitionrun:gi("Transition","TransitionRun"),transitionstart:gi("Transition","TransitionStart"),transitioncancel:gi("Transition","TransitionCancel"),transitionend:gi("Transition","TransitionEnd")},ou={},hg={};mr&&(hg=document.createElement("div").style,"AnimationEvent"in window||(delete ns.animationend.animation,delete ns.animationiteration.animation,delete ns.animationstart.animation),"TransitionEvent"in window||delete ns.transitionend.transition);function mi(t){if(ou[t])return ou[t];if(!ns[t])return t;var i=ns[t],l;for(l in i)if(i.hasOwnProperty(l)&&l in hg)return ou[t]=i[l];return t}var fg=mi("animationend"),pg=mi("animationiteration"),gg=mi("animationstart"),ES=mi("transitionrun"),kS=mi("transitionstart"),NS=mi("transitioncancel"),mg=mi("transitionend"),yg=new Map,lu="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(" ");lu.push("scrollEnd");function Wn(t,i){yg.set(t,i),fi(i,[t])}var Do=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=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(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Ln=[],rs=0,cu=0;function Bo(){for(var t=rs,i=cu=rs=0;i<t;){var l=Ln[i];Ln[i++]=null;var p=Ln[i];Ln[i++]=null;var C=Ln[i];Ln[i++]=null;var k=Ln[i];if(Ln[i++]=null,p!==null&&C!==null){var I=p.pending;I===null?C.next=C:(C.next=I.next,I.next=C),p.pending=C}k!==0&&vg(l,C,k)}}function Io(t,i,l,p){Ln[rs++]=t,Ln[rs++]=i,Ln[rs++]=l,Ln[rs++]=p,cu|=p,t.lanes|=p,t=t.alternate,t!==null&&(t.lanes|=p)}function uu(t,i,l,p){return Io(t,i,l,p),Lo(t)}function yi(t,i){return Io(t,null,null,i),Lo(t)}function vg(t,i,l){t.lanes|=l;var p=t.alternate;p!==null&&(p.lanes|=l);for(var C=!1,k=t.return;k!==null;)k.childLanes|=l,p=k.alternate,p!==null&&(p.childLanes|=l),k.tag===22&&(t=k.stateNode,t===null||t._visibility&1||(C=!0)),t=k,k=k.return;return t.tag===3?(k=t.stateNode,C&&i!==null&&(C=31-xe(l),t=k.hiddenUpdates,p=t[C],p===null?t[C]=[i]:p.push(i),i.lane=l|536870912),k):null}function Lo(t){if(50<Na)throw Na=0,bd=null,Error(s(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var is={};function TS(t,i,l,p){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wn(t,i,l,p){return new TS(t,i,l,p)}function du(t){return t=t.prototype,!(!t||!t.isReactComponent)}function yr(t,i){var l=t.alternate;return l===null?(l=wn(t.tag,i,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=i,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,i=t.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function bg(t,i){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,i=l.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function Mo(t,i,l,p,C,k){var I=0;if(p=t,typeof t=="function")du(t)&&(I=1);else if(typeof t=="string")I=Iw(t,l,J.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case D:return t=wn(31,l,i,C),t.elementType=D,t.lanes=k,t;case b:return vi(l.children,C,k,i);case y:I=8,C|=24;break;case S:return t=wn(12,l,i,C|2),t.elementType=S,t.lanes=k,t;case N:return t=wn(13,l,i,C),t.elementType=N,t.lanes=k,t;case T:return t=wn(19,l,i,C),t.elementType=T,t.lanes=k,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case x:I=10;break e;case _:I=9;break e;case E:I=11;break e;case j:I=14;break e;case R:I=16,p=null;break e}I=29,l=Error(s(130,t===null?"null":typeof t,"")),p=null}return i=wn(I,l,i,C),i.elementType=t,i.type=p,i.lanes=k,i}function vi(t,i,l,p){return t=wn(7,t,p,i),t.lanes=l,t}function hu(t,i,l){return t=wn(6,t,null,i),t.lanes=l,t}function xg(t){var i=wn(18,null,null,0);return i.stateNode=t,i}function fu(t,i,l){return i=wn(4,t.children!==null?t.children:[],t.key,i),i.lanes=l,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var _g=new WeakMap;function Mn(t,i){if(typeof t=="object"&&t!==null){var l=_g.get(t);return l!==void 0?l:(i={value:t,source:i,stack:jt(i)},_g.set(t,i),i)}return{value:t,source:i,stack:jt(i)}}var ss=[],as=0,Oo=null,oa=0,On=[],zn=0,Fr=null,er=1,tr="";function vr(t,i){ss[as++]=oa,ss[as++]=Oo,Oo=t,oa=i}function Sg(t,i,l){On[zn++]=er,On[zn++]=tr,On[zn++]=Fr,Fr=t;var p=er;t=tr;var C=32-xe(p)-1;p&=~(1<<C),l+=1;var k=32-xe(i)+C;if(30<k){var I=C-C%5;k=(p&(1<<I)-1).toString(32),p>>=I,C-=I,er=1<<32-xe(i)+C|l<<C|p,tr=k+t}else er=1<<k|l<<C|p,tr=t}function pu(t){t.return!==null&&(vr(t,1),Sg(t,1,0))}function gu(t){for(;t===Oo;)Oo=ss[--as],ss[as]=null,oa=ss[--as],ss[as]=null;for(;t===Fr;)Fr=On[--zn],On[zn]=null,tr=On[--zn],On[zn]=null,er=On[--zn],On[zn]=null}function wg(t,i){On[zn++]=er,On[zn++]=tr,On[zn++]=Fr,er=i.id,tr=i.overflow,Fr=t}var tn=null,Et=null,rt=!1,Pr=null,Fn=!1,mu=Error(s(519));function Hr(t){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw la(Mn(i,t)),mu}function Ag(t){var i=t.stateNode,l=t.type,p=t.memoizedProps;switch(i[en]=t,i[hn]=p,l){case"dialog":Je("cancel",i),Je("close",i);break;case"iframe":case"object":case"embed":Je("load",i);break;case"video":case"audio":for(l=0;l<Ra.length;l++)Je(Ra[l],i);break;case"source":Je("error",i);break;case"img":case"image":case"link":Je("error",i),Je("load",i);break;case"details":Je("toggle",i);break;case"input":Je("invalid",i),Op(i,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Je("invalid",i);break;case"textarea":Je("invalid",i),Fp(i,p.value,p.defaultValue,p.children)}l=p.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||p.suppressHydrationWarning===!0||H0(i.textContent,l)?(p.popover!=null&&(Je("beforetoggle",i),Je("toggle",i)),p.onScroll!=null&&Je("scroll",i),p.onScrollEnd!=null&&Je("scrollend",i),p.onClick!=null&&(i.onclick=gr),i=!0):i=!1,i||Hr(t,!0)}function Cg(t){for(tn=t.return;tn;)switch(tn.tag){case 5:case 31:case 13:Fn=!1;return;case 27:case 3:Fn=!0;return;default:tn=tn.return}}function os(t){if(t!==tn)return!1;if(!rt)return Cg(t),rt=!0,!1;var i=t.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Id(t.type,t.memoizedProps)),l=!l),l&&Et&&Hr(t),Cg(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));Et=X0(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));Et=X0(t)}else i===27?(i=Et,ti(t.type)?(t=Fd,Fd=null,Et=t):Et=i):Et=tn?Hn(t.stateNode.nextSibling):null;return!0}function bi(){Et=tn=null,rt=!1}function yu(){var t=Pr;return t!==null&&(yn===null?yn=t:yn.push.apply(yn,t),Pr=null),t}function la(t){Pr===null?Pr=[t]:Pr.push(t)}var vu=O(null),xi=null,br=null;function Ur(t,i,l){M(vu,i._currentValue),i._currentValue=l}function xr(t){t._currentValue=vu.current,Q(vu)}function bu(t,i,l){for(;t!==null;){var p=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,p!==null&&(p.childLanes|=i)):p!==null&&(p.childLanes&i)!==i&&(p.childLanes|=i),t===l)break;t=t.return}}function xu(t,i,l,p){var C=t.child;for(C!==null&&(C.return=t);C!==null;){var k=C.dependencies;if(k!==null){var I=C.child;k=k.firstContext;e:for(;k!==null;){var H=k;k=C;for(var V=0;V<i.length;V++)if(H.context===i[V]){k.lanes|=l,H=k.alternate,H!==null&&(H.lanes|=l),bu(k.return,l,t),p||(I=null);break e}k=H.next}}else if(C.tag===18){if(I=C.return,I===null)throw Error(s(341));I.lanes|=l,k=I.alternate,k!==null&&(k.lanes|=l),bu(I,l,t),I=null}else I=C.child;if(I!==null)I.return=C;else for(I=C;I!==null;){if(I===t){I=null;break}if(C=I.sibling,C!==null){C.return=I.return,I=C;break}I=I.return}C=I}}function ls(t,i,l,p){t=null;for(var C=i,k=!1;C!==null;){if(!k){if((C.flags&524288)!==0)k=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var I=C.alternate;if(I===null)throw Error(s(387));if(I=I.memoizedProps,I!==null){var H=C.type;Sn(C.pendingProps.value,I.value)||(t!==null?t.push(H):t=[H])}}else if(C===X.current){if(I=C.alternate,I===null)throw Error(s(387));I.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(t!==null?t.push(La):t=[La])}C=C.return}t!==null&&xu(i,t,l,p),i.flags|=262144}function zo(t){for(t=t.firstContext;t!==null;){if(!Sn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function _i(t){xi=t,br=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function nn(t){return Eg(xi,t)}function Fo(t,i){return xi===null&&_i(t),Eg(t,i)}function Eg(t,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},br===null){if(t===null)throw Error(s(308));br=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else br=br.next=i;return l}var RS=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(l,p){t.push(p)}};this.abort=function(){i.aborted=!0,t.forEach(function(l){return l()})}},jS=e.unstable_scheduleCallback,DS=e.unstable_NormalPriority,Ht={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _u(){return{controller:new RS,data:new Map,refCount:0}}function ca(t){t.refCount--,t.refCount===0&&jS(DS,function(){t.controller.abort()})}var ua=null,Su=0,cs=0,us=null;function BS(t,i){if(ua===null){var l=ua=[];Su=0,cs=Cd(),us={status:"pending",value:void 0,then:function(p){l.push(p)}}}return Su++,i.then(kg,kg),i}function kg(){if(--Su===0&&ua!==null){us!==null&&(us.status="fulfilled");var t=ua;ua=null,cs=0,us=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function IS(t,i){var l=[],p={status:"pending",value:null,reason:null,then:function(C){l.push(C)}};return t.then(function(){p.status="fulfilled",p.value=i;for(var C=0;C<l.length;C++)(0,l[C])(i)},function(C){for(p.status="rejected",p.reason=C,C=0;C<l.length;C++)(0,l[C])(void 0)}),p}var Ng=W.S;W.S=function(t,i){d0=xt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&BS(t,i),Ng!==null&&Ng(t,i)};var Si=O(null);function wu(){var t=Si.current;return t!==null?t:_t.pooledCache}function Po(t,i){i===null?M(Si,Si.current):M(Si,i.pool)}function Tg(){var t=wu();return t===null?null:{parent:Ht._currentValue,pool:t}}var ds=Error(s(460)),Au=Error(s(474)),Ho=Error(s(542)),Uo={then:function(){}};function Rg(t){return t=t.status,t==="fulfilled"||t==="rejected"}function jg(t,i,l){switch(l=t[l],l===void 0?t.push(i):l!==i&&(i.then(gr,gr),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,Bg(t),t;default:if(typeof i.status=="string")i.then(gr,gr);else{if(t=_t,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=i,t.status="pending",t.then(function(p){if(i.status==="pending"){var C=i;C.status="fulfilled",C.value=p}},function(p){if(i.status==="pending"){var C=i;C.status="rejected",C.reason=p}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,Bg(t),t}throw Ai=i,ds}}function wi(t){try{var i=t._init;return i(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Ai=l,ds):l}}var Ai=null;function Dg(){if(Ai===null)throw Error(s(459));var t=Ai;return Ai=null,t}function Bg(t){if(t===ds||t===Ho)throw Error(s(483))}var hs=null,da=0;function $o(t){var i=da;return da+=1,hs===null&&(hs=[]),jg(hs,t,i)}function ha(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function qo(t,i){throw i.$$typeof===v?Error(s(525)):(t=Object.prototype.toString.call(i),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function Ig(t){function i(re,ee){if(t){var ae=re.deletions;ae===null?(re.deletions=[ee],re.flags|=16):ae.push(ee)}}function l(re,ee){if(!t)return null;for(;ee!==null;)i(re,ee),ee=ee.sibling;return null}function p(re){for(var ee=new Map;re!==null;)re.key!==null?ee.set(re.key,re):ee.set(re.index,re),re=re.sibling;return ee}function C(re,ee){return re=yr(re,ee),re.index=0,re.sibling=null,re}function k(re,ee,ae){return re.index=ae,t?(ae=re.alternate,ae!==null?(ae=ae.index,ae<ee?(re.flags|=67108866,ee):ae):(re.flags|=67108866,ee)):(re.flags|=1048576,ee)}function I(re){return t&&re.alternate===null&&(re.flags|=67108866),re}function H(re,ee,ae,me){return ee===null||ee.tag!==6?(ee=hu(ae,re.mode,me),ee.return=re,ee):(ee=C(ee,ae),ee.return=re,ee)}function V(re,ee,ae,me){var ze=ae.type;return ze===b?ge(re,ee,ae.props.children,me,ae.key):ee!==null&&(ee.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===R&&wi(ze)===ee.type)?(ee=C(ee,ae.props),ha(ee,ae),ee.return=re,ee):(ee=Mo(ae.type,ae.key,ae.props,null,re.mode,me),ha(ee,ae),ee.return=re,ee)}function oe(re,ee,ae,me){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ae.containerInfo||ee.stateNode.implementation!==ae.implementation?(ee=fu(ae,re.mode,me),ee.return=re,ee):(ee=C(ee,ae.children||[]),ee.return=re,ee)}function ge(re,ee,ae,me,ze){return ee===null||ee.tag!==7?(ee=vi(ae,re.mode,me,ze),ee.return=re,ee):(ee=C(ee,ae),ee.return=re,ee)}function ye(re,ee,ae){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=hu(""+ee,re.mode,ae),ee.return=re,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case w:return ae=Mo(ee.type,ee.key,ee.props,null,re.mode,ae),ha(ae,ee),ae.return=re,ae;case A:return ee=fu(ee,re.mode,ae),ee.return=re,ee;case R:return ee=wi(ee),ye(re,ee,ae)}if(K(ee)||U(ee))return ee=vi(ee,re.mode,ae,null),ee.return=re,ee;if(typeof ee.then=="function")return ye(re,$o(ee),ae);if(ee.$$typeof===x)return ye(re,Fo(re,ee),ae);qo(re,ee)}return null}function ce(re,ee,ae,me){var ze=ee!==null?ee.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return ze!==null?null:H(re,ee,""+ae,me);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case w:return ae.key===ze?V(re,ee,ae,me):null;case A:return ae.key===ze?oe(re,ee,ae,me):null;case R:return ae=wi(ae),ce(re,ee,ae,me)}if(K(ae)||U(ae))return ze!==null?null:ge(re,ee,ae,me,null);if(typeof ae.then=="function")return ce(re,ee,$o(ae),me);if(ae.$$typeof===x)return ce(re,ee,Fo(re,ae),me);qo(re,ae)}return null}function he(re,ee,ae,me,ze){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return re=re.get(ae)||null,H(ee,re,""+me,ze);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case w:return re=re.get(me.key===null?ae:me.key)||null,V(ee,re,me,ze);case A:return re=re.get(me.key===null?ae:me.key)||null,oe(ee,re,me,ze);case R:return me=wi(me),he(re,ee,ae,me,ze)}if(K(me)||U(me))return re=re.get(ae)||null,ge(ee,re,me,ze,null);if(typeof me.then=="function")return he(re,ee,ae,$o(me),ze);if(me.$$typeof===x)return he(re,ee,ae,Fo(ee,me),ze);qo(ee,me)}return null}function De(re,ee,ae,me){for(var ze=null,ot=null,Ie=ee,We=ee=0,nt=null;Ie!==null&&We<ae.length;We++){Ie.index>We?(nt=Ie,Ie=null):nt=Ie.sibling;var lt=ce(re,Ie,ae[We],me);if(lt===null){Ie===null&&(Ie=nt);break}t&&Ie&<.alternate===null&&i(re,Ie),ee=k(lt,ee,We),ot===null?ze=lt:ot.sibling=lt,ot=lt,Ie=nt}if(We===ae.length)return l(re,Ie),rt&&vr(re,We),ze;if(Ie===null){for(;We<ae.length;We++)Ie=ye(re,ae[We],me),Ie!==null&&(ee=k(Ie,ee,We),ot===null?ze=Ie:ot.sibling=Ie,ot=Ie);return rt&&vr(re,We),ze}for(Ie=p(Ie);We<ae.length;We++)nt=he(Ie,re,We,ae[We],me),nt!==null&&(t&&nt.alternate!==null&&Ie.delete(nt.key===null?We:nt.key),ee=k(nt,ee,We),ot===null?ze=nt:ot.sibling=nt,ot=nt);return t&&Ie.forEach(function(ai){return i(re,ai)}),rt&&vr(re,We),ze}function He(re,ee,ae,me){if(ae==null)throw Error(s(151));for(var ze=null,ot=null,Ie=ee,We=ee=0,nt=null,lt=ae.next();Ie!==null&&!lt.done;We++,lt=ae.next()){Ie.index>We?(nt=Ie,Ie=null):nt=Ie.sibling;var ai=ce(re,Ie,lt.value,me);if(ai===null){Ie===null&&(Ie=nt);break}t&&Ie&&ai.alternate===null&&i(re,Ie),ee=k(ai,ee,We),ot===null?ze=ai:ot.sibling=ai,ot=ai,Ie=nt}if(lt.done)return l(re,Ie),rt&&vr(re,We),ze;if(Ie===null){for(;!lt.done;We++,lt=ae.next())lt=ye(re,lt.value,me),lt!==null&&(ee=k(lt,ee,We),ot===null?ze=lt:ot.sibling=lt,ot=lt);return rt&&vr(re,We),ze}for(Ie=p(Ie);!lt.done;We++,lt=ae.next())lt=he(Ie,re,We,lt.value,me),lt!==null&&(t&<.alternate!==null&&Ie.delete(lt.key===null?We:lt.key),ee=k(lt,ee,We),ot===null?ze=lt:ot.sibling=lt,ot=lt);return t&&Ie.forEach(function(Qw){return i(re,Qw)}),rt&&vr(re,We),ze}function bt(re,ee,ae,me){if(typeof ae=="object"&&ae!==null&&ae.type===b&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case w:e:{for(var ze=ae.key;ee!==null;){if(ee.key===ze){if(ze=ae.type,ze===b){if(ee.tag===7){l(re,ee.sibling),me=C(ee,ae.props.children),me.return=re,re=me;break e}}else if(ee.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===R&&wi(ze)===ee.type){l(re,ee.sibling),me=C(ee,ae.props),ha(me,ae),me.return=re,re=me;break e}l(re,ee);break}else i(re,ee);ee=ee.sibling}ae.type===b?(me=vi(ae.props.children,re.mode,me,ae.key),me.return=re,re=me):(me=Mo(ae.type,ae.key,ae.props,null,re.mode,me),ha(me,ae),me.return=re,re=me)}return I(re);case A:e:{for(ze=ae.key;ee!==null;){if(ee.key===ze)if(ee.tag===4&&ee.stateNode.containerInfo===ae.containerInfo&&ee.stateNode.implementation===ae.implementation){l(re,ee.sibling),me=C(ee,ae.children||[]),me.return=re,re=me;break e}else{l(re,ee);break}else i(re,ee);ee=ee.sibling}me=fu(ae,re.mode,me),me.return=re,re=me}return I(re);case R:return ae=wi(ae),bt(re,ee,ae,me)}if(K(ae))return De(re,ee,ae,me);if(U(ae)){if(ze=U(ae),typeof ze!="function")throw Error(s(150));return ae=ze.call(ae),He(re,ee,ae,me)}if(typeof ae.then=="function")return bt(re,ee,$o(ae),me);if(ae.$$typeof===x)return bt(re,ee,Fo(re,ae),me);qo(re,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,ee!==null&&ee.tag===6?(l(re,ee.sibling),me=C(ee,ae),me.return=re,re=me):(l(re,ee),me=hu(ae,re.mode,me),me.return=re,re=me),I(re)):l(re,ee)}return function(re,ee,ae,me){try{da=0;var ze=bt(re,ee,ae,me);return hs=null,ze}catch(Ie){if(Ie===ds||Ie===Ho)throw Ie;var ot=wn(29,Ie,null,re.mode);return ot.lanes=me,ot.return=re,ot}finally{}}}var Ci=Ig(!0),Lg=Ig(!1),$r=!1;function Cu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Eu(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function qr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Qr(t,i,l){var p=t.updateQueue;if(p===null)return null;if(p=p.shared,(ct&2)!==0){var C=p.pending;return C===null?i.next=i:(i.next=C.next,C.next=i),p.pending=i,i=Lo(t),vg(t,null,l),i}return Io(t,p,i,l),Lo(t)}function fa(t,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var p=i.lanes;p&=t.pendingLanes,l|=p,i.lanes=l,Ep(t,l)}}function ku(t,i){var l=t.updateQueue,p=t.alternate;if(p!==null&&(p=p.updateQueue,l===p)){var C=null,k=null;if(l=l.firstBaseUpdate,l!==null){do{var I={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};k===null?C=k=I:k=k.next=I,l=l.next}while(l!==null);k===null?C=k=i:k=k.next=i}else C=k=i;l={baseState:p.baseState,firstBaseUpdate:C,lastBaseUpdate:k,shared:p.shared,callbacks:p.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=i:t.next=i,l.lastBaseUpdate=i}var Nu=!1;function pa(){if(Nu){var t=us;if(t!==null)throw t}}function ga(t,i,l,p){Nu=!1;var C=t.updateQueue;$r=!1;var k=C.firstBaseUpdate,I=C.lastBaseUpdate,H=C.shared.pending;if(H!==null){C.shared.pending=null;var V=H,oe=V.next;V.next=null,I===null?k=oe:I.next=oe,I=V;var ge=t.alternate;ge!==null&&(ge=ge.updateQueue,H=ge.lastBaseUpdate,H!==I&&(H===null?ge.firstBaseUpdate=oe:H.next=oe,ge.lastBaseUpdate=V))}if(k!==null){var ye=C.baseState;I=0,ge=oe=V=null,H=k;do{var ce=H.lane&-536870913,he=ce!==H.lane;if(he?(tt&ce)===ce:(p&ce)===ce){ce!==0&&ce===cs&&(Nu=!0),ge!==null&&(ge=ge.next={lane:0,tag:H.tag,payload:H.payload,callback:null,next:null});e:{var De=t,He=H;ce=i;var bt=l;switch(He.tag){case 1:if(De=He.payload,typeof De=="function"){ye=De.call(bt,ye,ce);break e}ye=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=He.payload,ce=typeof De=="function"?De.call(bt,ye,ce):De,ce==null)break e;ye=f({},ye,ce);break e;case 2:$r=!0}}ce=H.callback,ce!==null&&(t.flags|=64,he&&(t.flags|=8192),he=C.callbacks,he===null?C.callbacks=[ce]:he.push(ce))}else he={lane:ce,tag:H.tag,payload:H.payload,callback:H.callback,next:null},ge===null?(oe=ge=he,V=ye):ge=ge.next=he,I|=ce;if(H=H.next,H===null){if(H=C.shared.pending,H===null)break;he=H,H=he.next,he.next=null,C.lastBaseUpdate=he,C.shared.pending=null}}while(!0);ge===null&&(V=ye),C.baseState=V,C.firstBaseUpdate=oe,C.lastBaseUpdate=ge,k===null&&(C.shared.lanes=0),Xr|=I,t.lanes=I,t.memoizedState=ye}}function Mg(t,i){if(typeof t!="function")throw Error(s(191,t));t.call(i)}function Og(t,i){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Mg(l[t],i)}var fs=O(null),Qo=O(0);function zg(t,i){t=Tr,M(Qo,t),M(fs,i),Tr=t|i.baseLanes}function Tu(){M(Qo,Tr),M(fs,fs.current)}function Ru(){Tr=Qo.current,Q(fs),Q(Qo)}var An=O(null),Pn=null;function Gr(t){var i=t.alternate;M(zt,zt.current&1),M(An,t),Pn===null&&(i===null||fs.current!==null||i.memoizedState!==null)&&(Pn=t)}function ju(t){M(zt,zt.current),M(An,t),Pn===null&&(Pn=t)}function Fg(t){t.tag===22?(M(zt,zt.current),M(An,t),Pn===null&&(Pn=t)):Wr()}function Wr(){M(zt,zt.current),M(An,An.current)}function Cn(t){Q(An),Pn===t&&(Pn=null),Q(zt)}var zt=O(0);function Go(t){for(var i=t;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Od(l)||zd(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var _r=0,Ge=null,yt=null,Ut=null,Wo=!1,ps=!1,Ei=!1,Ko=0,ma=0,gs=null,LS=0;function It(){throw Error(s(321))}function Du(t,i){if(i===null)return!1;for(var l=0;l<i.length&&l<t.length;l++)if(!Sn(t[l],i[l]))return!1;return!0}function Bu(t,i,l,p,C,k){return _r=k,Ge=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,W.H=t===null||t.memoizedState===null?Sm:Ku,Ei=!1,k=l(p,C),Ei=!1,ps&&(k=Hg(i,l,p,C)),Pg(t),k}function Pg(t){W.H=ba;var i=yt!==null&&yt.next!==null;if(_r=0,Ut=yt=Ge=null,Wo=!1,ma=0,gs=null,i)throw Error(s(300));t===null||$t||(t=t.dependencies,t!==null&&zo(t)&&($t=!0))}function Hg(t,i,l,p){Ge=t;var C=0;do{if(ps&&(gs=null),ma=0,ps=!1,25<=C)throw Error(s(301));if(C+=1,Ut=yt=null,t.updateQueue!=null){var k=t.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}W.H=wm,k=i(l,p)}while(ps);return k}function MS(){var t=W.H,i=t.useState()[0];return i=typeof i.then=="function"?ya(i):i,t=t.useState()[0],(yt!==null?yt.memoizedState:null)!==t&&(Ge.flags|=1024),i}function Iu(){var t=Ko!==0;return Ko=0,t}function Lu(t,i,l){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~l}function Mu(t){if(Wo){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}Wo=!1}_r=0,Ut=yt=Ge=null,ps=!1,ma=Ko=0,gs=null}function un(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Ge.memoizedState=Ut=t:Ut=Ut.next=t,Ut}function Ft(){if(yt===null){var t=Ge.alternate;t=t!==null?t.memoizedState:null}else t=yt.next;var i=Ut===null?Ge.memoizedState:Ut.next;if(i!==null)Ut=i,yt=t;else{if(t===null)throw Ge.alternate===null?Error(s(467)):Error(s(310));yt=t,t={memoizedState:yt.memoizedState,baseState:yt.baseState,baseQueue:yt.baseQueue,queue:yt.queue,next:null},Ut===null?Ge.memoizedState=Ut=t:Ut=Ut.next=t}return Ut}function Vo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ya(t){var i=ma;return ma+=1,gs===null&&(gs=[]),t=jg(gs,t,i),i=Ge,(Ut===null?i.memoizedState:Ut.next)===null&&(i=i.alternate,W.H=i===null||i.memoizedState===null?Sm:Ku),t}function Xo(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return ya(t);if(t.$$typeof===x)return nn(t)}throw Error(s(438,String(t)))}function Ou(t){var i=null,l=Ge.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var p=Ge.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(i={data:p.data.map(function(C){return C.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=Vo(),Ge.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(t),p=0;p<t;p++)l[p]=L;return i.index++,l}function Sr(t,i){return typeof i=="function"?i(t):i}function Yo(t){var i=Ft();return zu(i,yt,t)}function zu(t,i,l){var p=t.queue;if(p===null)throw Error(s(311));p.lastRenderedReducer=l;var C=t.baseQueue,k=p.pending;if(k!==null){if(C!==null){var I=C.next;C.next=k.next,k.next=I}i.baseQueue=C=k,p.pending=null}if(k=t.baseState,C===null)t.memoizedState=k;else{i=C.next;var H=I=null,V=null,oe=i,ge=!1;do{var ye=oe.lane&-536870913;if(ye!==oe.lane?(tt&ye)===ye:(_r&ye)===ye){var ce=oe.revertLane;if(ce===0)V!==null&&(V=V.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),ye===cs&&(ge=!0);else if((_r&ce)===ce){oe=oe.next,ce===cs&&(ge=!0);continue}else ye={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},V===null?(H=V=ye,I=k):V=V.next=ye,Ge.lanes|=ce,Xr|=ce;ye=oe.action,Ei&&l(k,ye),k=oe.hasEagerState?oe.eagerState:l(k,ye)}else ce={lane:ye,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},V===null?(H=V=ce,I=k):V=V.next=ce,Ge.lanes|=ye,Xr|=ye;oe=oe.next}while(oe!==null&&oe!==i);if(V===null?I=k:V.next=H,!Sn(k,t.memoizedState)&&($t=!0,ge&&(l=us,l!==null)))throw l;t.memoizedState=k,t.baseState=I,t.baseQueue=V,p.lastRenderedState=k}return C===null&&(p.lanes=0),[t.memoizedState,p.dispatch]}function Fu(t){var i=Ft(),l=i.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=t;var p=l.dispatch,C=l.pending,k=i.memoizedState;if(C!==null){l.pending=null;var I=C=C.next;do k=t(k,I.action),I=I.next;while(I!==C);Sn(k,i.memoizedState)||($t=!0),i.memoizedState=k,i.baseQueue===null&&(i.baseState=k),l.lastRenderedState=k}return[k,p]}function Ug(t,i,l){var p=Ge,C=Ft(),k=rt;if(k){if(l===void 0)throw Error(s(407));l=l()}else l=i();var I=!Sn((yt||C).memoizedState,l);if(I&&(C.memoizedState=l,$t=!0),C=C.queue,Uu(Qg.bind(null,p,C,t),[t]),C.getSnapshot!==i||I||Ut!==null&&Ut.memoizedState.tag&1){if(p.flags|=2048,ms(9,{destroy:void 0},qg.bind(null,p,C,l,i),null),_t===null)throw Error(s(349));k||(_r&127)!==0||$g(p,i,l)}return l}function $g(t,i,l){t.flags|=16384,t={getSnapshot:i,value:l},i=Ge.updateQueue,i===null?(i=Vo(),Ge.updateQueue=i,i.stores=[t]):(l=i.stores,l===null?i.stores=[t]:l.push(t))}function qg(t,i,l,p){i.value=l,i.getSnapshot=p,Gg(i)&&Wg(t)}function Qg(t,i,l){return l(function(){Gg(i)&&Wg(t)})}function Gg(t){var i=t.getSnapshot;t=t.value;try{var l=i();return!Sn(t,l)}catch{return!0}}function Wg(t){var i=yi(t,2);i!==null&&vn(i,t,2)}function Pu(t){var i=un();if(typeof t=="function"){var l=t;if(t=l(),Ei){Z(!0);try{l()}finally{Z(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:t},i}function Kg(t,i,l,p){return t.baseState=l,zu(t,yt,typeof p=="function"?p:Sr)}function OS(t,i,l,p,C){if(el(t))throw Error(s(485));if(t=i.action,t!==null){var k={payload:C,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(I){k.listeners.push(I)}};W.T!==null?l(!0):k.isTransition=!1,p(k),l=i.pending,l===null?(k.next=i.pending=k,Vg(i,k)):(k.next=l.next,i.pending=l.next=k)}}function Vg(t,i){var l=i.action,p=i.payload,C=t.state;if(i.isTransition){var k=W.T,I={};W.T=I;try{var H=l(C,p),V=W.S;V!==null&&V(I,H),Xg(t,i,H)}catch(oe){Hu(t,i,oe)}finally{k!==null&&I.types!==null&&(k.types=I.types),W.T=k}}else try{k=l(C,p),Xg(t,i,k)}catch(oe){Hu(t,i,oe)}}function Xg(t,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(p){Yg(t,i,p)},function(p){return Hu(t,i,p)}):Yg(t,i,l)}function Yg(t,i,l){i.status="fulfilled",i.value=l,Zg(i),t.state=l,i=t.pending,i!==null&&(l=i.next,l===i?t.pending=null:(l=l.next,i.next=l,Vg(t,l)))}function Hu(t,i,l){var p=t.pending;if(t.pending=null,p!==null){p=p.next;do i.status="rejected",i.reason=l,Zg(i),i=i.next;while(i!==p)}t.action=null}function Zg(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function Jg(t,i){return i}function em(t,i){if(rt){var l=_t.formState;if(l!==null){e:{var p=Ge;if(rt){if(Et){t:{for(var C=Et,k=Fn;C.nodeType!==8;){if(!k){C=null;break t}if(C=Hn(C.nextSibling),C===null){C=null;break t}}k=C.data,C=k==="F!"||k==="F"?C:null}if(C){Et=Hn(C.nextSibling),p=C.data==="F!";break e}}Hr(p)}p=!1}p&&(i=l[0])}}return l=un(),l.memoizedState=l.baseState=i,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jg,lastRenderedState:i},l.queue=p,l=bm.bind(null,Ge,p),p.dispatch=l,p=Pu(!1),k=Wu.bind(null,Ge,!1,p.queue),p=un(),C={state:i,dispatch:null,action:t,pending:null},p.queue=C,l=OS.bind(null,Ge,C,k,l),C.dispatch=l,p.memoizedState=t,[i,l,!1]}function tm(t){var i=Ft();return nm(i,yt,t)}function nm(t,i,l){if(i=zu(t,i,Jg)[0],t=Yo(Sr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var p=ya(i)}catch(I){throw I===ds?Ho:I}else p=i;i=Ft();var C=i.queue,k=C.dispatch;return l!==i.memoizedState&&(Ge.flags|=2048,ms(9,{destroy:void 0},zS.bind(null,C,l),null)),[p,k,t]}function zS(t,i){t.action=i}function rm(t){var i=Ft(),l=yt;if(l!==null)return nm(i,l,t);Ft(),i=i.memoizedState,l=Ft();var p=l.queue.dispatch;return l.memoizedState=t,[i,p,!1]}function ms(t,i,l,p){return t={tag:t,create:l,deps:p,inst:i,next:null},i=Ge.updateQueue,i===null&&(i=Vo(),Ge.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=t.next=t:(p=l.next,l.next=t,t.next=p,i.lastEffect=t),t}function im(){return Ft().memoizedState}function Zo(t,i,l,p){var C=un();Ge.flags|=t,C.memoizedState=ms(1|i,{destroy:void 0},l,p===void 0?null:p)}function Jo(t,i,l,p){var C=Ft();p=p===void 0?null:p;var k=C.memoizedState.inst;yt!==null&&p!==null&&Du(p,yt.memoizedState.deps)?C.memoizedState=ms(i,k,l,p):(Ge.flags|=t,C.memoizedState=ms(1|i,k,l,p))}function sm(t,i){Zo(8390656,8,t,i)}function Uu(t,i){Jo(2048,8,t,i)}function FS(t){Ge.flags|=4;var i=Ge.updateQueue;if(i===null)i=Vo(),Ge.updateQueue=i,i.events=[t];else{var l=i.events;l===null?i.events=[t]:l.push(t)}}function am(t){var i=Ft().memoizedState;return FS({ref:i,nextImpl:t}),function(){if((ct&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}function om(t,i){return Jo(4,2,t,i)}function lm(t,i){return Jo(4,4,t,i)}function cm(t,i){if(typeof i=="function"){t=t();var l=i(t);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function um(t,i,l){l=l!=null?l.concat([t]):null,Jo(4,4,cm.bind(null,i,t),l)}function $u(){}function dm(t,i){var l=Ft();i=i===void 0?null:i;var p=l.memoizedState;return i!==null&&Du(i,p[1])?p[0]:(l.memoizedState=[t,i],t)}function hm(t,i){var l=Ft();i=i===void 0?null:i;var p=l.memoizedState;if(i!==null&&Du(i,p[1]))return p[0];if(p=t(),Ei){Z(!0);try{t()}finally{Z(!1)}}return l.memoizedState=[p,i],p}function qu(t,i,l){return l===void 0||(_r&1073741824)!==0&&(tt&261930)===0?t.memoizedState=i:(t.memoizedState=l,t=f0(),Ge.lanes|=t,Xr|=t,l)}function fm(t,i,l,p){return Sn(l,i)?l:fs.current!==null?(t=qu(t,l,p),Sn(t,i)||($t=!0),t):(_r&42)===0||(_r&1073741824)!==0&&(tt&261930)===0?($t=!0,t.memoizedState=l):(t=f0(),Ge.lanes|=t,Xr|=t,i)}function pm(t,i,l,p,C){var k=Y.p;Y.p=k!==0&&8>k?k:8;var I=W.T,H={};W.T=H,Wu(t,!1,i,l);try{var V=C(),oe=W.S;if(oe!==null&&oe(H,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var ge=IS(V,p);va(t,i,ge,Nn(t))}else va(t,i,p,Nn(t))}catch(ye){va(t,i,{then:function(){},status:"rejected",reason:ye},Nn())}finally{Y.p=k,I!==null&&H.types!==null&&(I.types=H.types),W.T=I}}function PS(){}function Qu(t,i,l,p){if(t.tag!==5)throw Error(s(476));var C=gm(t).queue;pm(t,C,i,ne,l===null?PS:function(){return mm(t),l(p)})}function gm(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:ne},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:l},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function mm(t){var i=gm(t);i.next===null&&(i=t.alternate.memoizedState),va(t,i.next.queue,{},Nn())}function Gu(){return nn(La)}function ym(){return Ft().memoizedState}function vm(){return Ft().memoizedState}function HS(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var l=Nn();t=qr(l);var p=Qr(i,t,l);p!==null&&(vn(p,i,l),fa(p,i,l)),i={cache:_u()},t.payload=i;return}i=i.return}}function US(t,i,l){var p=Nn();l={lane:p,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},el(t)?xm(i,l):(l=uu(t,i,l,p),l!==null&&(vn(l,t,p),_m(l,i,p)))}function bm(t,i,l){var p=Nn();va(t,i,l,p)}function va(t,i,l,p){var C={lane:p,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(el(t))xm(i,C);else{var k=t.alternate;if(t.lanes===0&&(k===null||k.lanes===0)&&(k=i.lastRenderedReducer,k!==null))try{var I=i.lastRenderedState,H=k(I,l);if(C.hasEagerState=!0,C.eagerState=H,Sn(H,I))return Io(t,i,C,0),_t===null&&Bo(),!1}catch{}finally{}if(l=uu(t,i,C,p),l!==null)return vn(l,t,p),_m(l,i,p),!0}return!1}function Wu(t,i,l,p){if(p={lane:2,revertLane:Cd(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},el(t)){if(i)throw Error(s(479))}else i=uu(t,l,p,2),i!==null&&vn(i,t,2)}function el(t){var i=t.alternate;return t===Ge||i!==null&&i===Ge}function xm(t,i){ps=Wo=!0;var l=t.pending;l===null?i.next=i:(i.next=l.next,l.next=i),t.pending=i}function _m(t,i,l){if((l&4194048)!==0){var p=i.lanes;p&=t.pendingLanes,l|=p,i.lanes=l,Ep(t,l)}}var ba={readContext:nn,use:Xo,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It};ba.useEffectEvent=It;var Sm={readContext:nn,use:Xo,useCallback:function(t,i){return un().memoizedState=[t,i===void 0?null:i],t},useContext:nn,useEffect:sm,useImperativeHandle:function(t,i,l){l=l!=null?l.concat([t]):null,Zo(4194308,4,cm.bind(null,i,t),l)},useLayoutEffect:function(t,i){return Zo(4194308,4,t,i)},useInsertionEffect:function(t,i){Zo(4,2,t,i)},useMemo:function(t,i){var l=un();i=i===void 0?null:i;var p=t();if(Ei){Z(!0);try{t()}finally{Z(!1)}}return l.memoizedState=[p,i],p},useReducer:function(t,i,l){var p=un();if(l!==void 0){var C=l(i);if(Ei){Z(!0);try{l(i)}finally{Z(!1)}}}else C=i;return p.memoizedState=p.baseState=C,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:C},p.queue=t,t=t.dispatch=US.bind(null,Ge,t),[p.memoizedState,t]},useRef:function(t){var i=un();return t={current:t},i.memoizedState=t},useState:function(t){t=Pu(t);var i=t.queue,l=bm.bind(null,Ge,i);return i.dispatch=l,[t.memoizedState,l]},useDebugValue:$u,useDeferredValue:function(t,i){var l=un();return qu(l,t,i)},useTransition:function(){var t=Pu(!1);return t=pm.bind(null,Ge,t.queue,!0,!1),un().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,l){var p=Ge,C=un();if(rt){if(l===void 0)throw Error(s(407));l=l()}else{if(l=i(),_t===null)throw Error(s(349));(tt&127)!==0||$g(p,i,l)}C.memoizedState=l;var k={value:l,getSnapshot:i};return C.queue=k,sm(Qg.bind(null,p,k,t),[t]),p.flags|=2048,ms(9,{destroy:void 0},qg.bind(null,p,k,l,i),null),l},useId:function(){var t=un(),i=_t.identifierPrefix;if(rt){var l=tr,p=er;l=(p&~(1<<32-xe(p)-1)).toString(32)+l,i="_"+i+"R_"+l,l=Ko++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=LS++,i="_"+i+"r_"+l.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:Gu,useFormState:em,useActionState:em,useOptimistic:function(t){var i=un();i.memoizedState=i.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=Wu.bind(null,Ge,!0,l),l.dispatch=i,[t,i]},useMemoCache:Ou,useCacheRefresh:function(){return un().memoizedState=HS.bind(null,Ge)},useEffectEvent:function(t){var i=un(),l={impl:t};return i.memoizedState=l,function(){if((ct&2)!==0)throw Error(s(440));return l.impl.apply(void 0,arguments)}}},Ku={readContext:nn,use:Xo,useCallback:dm,useContext:nn,useEffect:Uu,useImperativeHandle:um,useInsertionEffect:om,useLayoutEffect:lm,useMemo:hm,useReducer:Yo,useRef:im,useState:function(){return Yo(Sr)},useDebugValue:$u,useDeferredValue:function(t,i){var l=Ft();return fm(l,yt.memoizedState,t,i)},useTransition:function(){var t=Yo(Sr)[0],i=Ft().memoizedState;return[typeof t=="boolean"?t:ya(t),i]},useSyncExternalStore:Ug,useId:ym,useHostTransitionStatus:Gu,useFormState:tm,useActionState:tm,useOptimistic:function(t,i){var l=Ft();return Kg(l,yt,t,i)},useMemoCache:Ou,useCacheRefresh:vm};Ku.useEffectEvent=am;var wm={readContext:nn,use:Xo,useCallback:dm,useContext:nn,useEffect:Uu,useImperativeHandle:um,useInsertionEffect:om,useLayoutEffect:lm,useMemo:hm,useReducer:Fu,useRef:im,useState:function(){return Fu(Sr)},useDebugValue:$u,useDeferredValue:function(t,i){var l=Ft();return yt===null?qu(l,t,i):fm(l,yt.memoizedState,t,i)},useTransition:function(){var t=Fu(Sr)[0],i=Ft().memoizedState;return[typeof t=="boolean"?t:ya(t),i]},useSyncExternalStore:Ug,useId:ym,useHostTransitionStatus:Gu,useFormState:rm,useActionState:rm,useOptimistic:function(t,i){var l=Ft();return yt!==null?Kg(l,yt,t,i):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Ou,useCacheRefresh:vm};wm.useEffectEvent=am;function Vu(t,i,l,p){i=t.memoizedState,l=l(p,i),l=l==null?i:f({},i,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Xu={enqueueSetState:function(t,i,l){t=t._reactInternals;var p=Nn(),C=qr(p);C.payload=i,l!=null&&(C.callback=l),i=Qr(t,C,p),i!==null&&(vn(i,t,p),fa(i,t,p))},enqueueReplaceState:function(t,i,l){t=t._reactInternals;var p=Nn(),C=qr(p);C.tag=1,C.payload=i,l!=null&&(C.callback=l),i=Qr(t,C,p),i!==null&&(vn(i,t,p),fa(i,t,p))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var l=Nn(),p=qr(l);p.tag=2,i!=null&&(p.callback=i),i=Qr(t,p,l),i!==null&&(vn(i,t,l),fa(i,t,l))}};function Am(t,i,l,p,C,k,I){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(p,k,I):i.prototype&&i.prototype.isPureReactComponent?!sa(l,p)||!sa(C,k):!0}function Cm(t,i,l,p){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,p),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,p),i.state!==t&&Xu.enqueueReplaceState(i,i.state,null)}function ki(t,i){var l=i;if("ref"in i){l={};for(var p in i)p!=="ref"&&(l[p]=i[p])}if(t=t.defaultProps){l===i&&(l=f({},l));for(var C in t)l[C]===void 0&&(l[C]=t[C])}return l}function Em(t){Do(t)}function km(t){console.error(t)}function Nm(t){Do(t)}function tl(t,i){try{var l=t.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(p){setTimeout(function(){throw p})}}function Tm(t,i,l){try{var p=t.onCaughtError;p(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function Yu(t,i,l){return l=qr(l),l.tag=3,l.payload={element:null},l.callback=function(){tl(t,i)},l}function Rm(t){return t=qr(t),t.tag=3,t}function jm(t,i,l,p){var C=l.type.getDerivedStateFromError;if(typeof C=="function"){var k=p.value;t.payload=function(){return C(k)},t.callback=function(){Tm(i,l,p)}}var I=l.stateNode;I!==null&&typeof I.componentDidCatch=="function"&&(t.callback=function(){Tm(i,l,p),typeof C!="function"&&(Yr===null?Yr=new Set([this]):Yr.add(this));var H=p.stack;this.componentDidCatch(p.value,{componentStack:H!==null?H:""})})}function $S(t,i,l,p,C){if(l.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(i=l.alternate,i!==null&&ls(i,l,C,!0),l=An.current,l!==null){switch(l.tag){case 31:case 13:return Pn===null?fl():l.alternate===null&&Lt===0&&(Lt=3),l.flags&=-257,l.flags|=65536,l.lanes=C,p===Uo?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([p]):i.add(p),Sd(t,p,C)),!1;case 22:return l.flags|=65536,p===Uo?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([p])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([p]):l.add(p)),Sd(t,p,C)),!1}throw Error(s(435,l.tag))}return Sd(t,p,C),fl(),!1}if(rt)return i=An.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=C,p!==mu&&(t=Error(s(422),{cause:p}),la(Mn(t,l)))):(p!==mu&&(i=Error(s(423),{cause:p}),la(Mn(i,l))),t=t.current.alternate,t.flags|=65536,C&=-C,t.lanes|=C,p=Mn(p,l),C=Yu(t.stateNode,p,C),ku(t,C),Lt!==4&&(Lt=2)),!1;var k=Error(s(520),{cause:p});if(k=Mn(k,l),ka===null?ka=[k]:ka.push(k),Lt!==4&&(Lt=2),i===null)return!0;p=Mn(p,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,t=C&-C,l.lanes|=t,t=Yu(l.stateNode,p,t),ku(l,t),!1;case 1:if(i=l.type,k=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(Yr===null||!Yr.has(k))))return l.flags|=65536,C&=-C,l.lanes|=C,C=Rm(C),jm(C,t,l,p),ku(l,C),!1}l=l.return}while(l!==null);return!1}var Zu=Error(s(461)),$t=!1;function rn(t,i,l,p){i.child=t===null?Lg(i,null,l,p):Ci(i,t.child,l,p)}function Dm(t,i,l,p,C){l=l.render;var k=i.ref;if("ref"in p){var I={};for(var H in p)H!=="ref"&&(I[H]=p[H])}else I=p;return _i(i),p=Bu(t,i,l,I,k,C),H=Iu(),t!==null&&!$t?(Lu(t,i,C),wr(t,i,C)):(rt&&H&&pu(i),i.flags|=1,rn(t,i,p,C),i.child)}function Bm(t,i,l,p,C){if(t===null){var k=l.type;return typeof k=="function"&&!du(k)&&k.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=k,Im(t,i,k,p,C)):(t=Mo(l.type,null,p,i,i.mode,C),t.ref=i.ref,t.return=i,i.child=t)}if(k=t.child,!ad(t,C)){var I=k.memoizedProps;if(l=l.compare,l=l!==null?l:sa,l(I,p)&&t.ref===i.ref)return wr(t,i,C)}return i.flags|=1,t=yr(k,p),t.ref=i.ref,t.return=i,i.child=t}function Im(t,i,l,p,C){if(t!==null){var k=t.memoizedProps;if(sa(k,p)&&t.ref===i.ref)if($t=!1,i.pendingProps=p=k,ad(t,C))(t.flags&131072)!==0&&($t=!0);else return i.lanes=t.lanes,wr(t,i,C)}return Ju(t,i,l,p,C)}function Lm(t,i,l,p){var C=p.children,k=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((i.flags&128)!==0){if(k=k!==null?k.baseLanes|l:l,t!==null){for(p=i.child=t.child,C=0;p!==null;)C=C|p.lanes|p.childLanes,p=p.sibling;p=C&~k}else p=0,i.child=null;return Mm(t,i,k,l,p)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&Po(i,k!==null?k.cachePool:null),k!==null?zg(i,k):Tu(),Fg(i);else return p=i.lanes=536870912,Mm(t,i,k!==null?k.baseLanes|l:l,l,p)}else k!==null?(Po(i,k.cachePool),zg(i,k),Wr(),i.memoizedState=null):(t!==null&&Po(i,null),Tu(),Wr());return rn(t,i,C,l),i.child}function xa(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Mm(t,i,l,p,C){var k=wu();return k=k===null?null:{parent:Ht._currentValue,pool:k},i.memoizedState={baseLanes:l,cachePool:k},t!==null&&Po(i,null),Tu(),Fg(i),t!==null&&ls(t,i,p,!0),i.childLanes=C,null}function nl(t,i){return i=il({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function Om(t,i,l){return Ci(i,t.child,null,l),t=nl(i,i.pendingProps),t.flags|=2,Cn(i),i.memoizedState=null,t}function qS(t,i,l){var p=i.pendingProps,C=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(rt){if(p.mode==="hidden")return t=nl(i,p),i.lanes=536870912,xa(null,t);if(ju(i),(t=Et)?(t=V0(t,Fn),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Fr!==null?{id:er,overflow:tr}:null,retryLane:536870912,hydrationErrors:null},l=xg(t),l.return=i,i.child=l,tn=i,Et=null)):t=null,t===null)throw Hr(i);return i.lanes=536870912,null}return nl(i,p)}var k=t.memoizedState;if(k!==null){var I=k.dehydrated;if(ju(i),C)if(i.flags&256)i.flags&=-257,i=Om(t,i,l);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(s(558));else if($t||ls(t,i,l,!1),C=(l&t.childLanes)!==0,$t||C){if(p=_t,p!==null&&(I=kp(p,l),I!==0&&I!==k.retryLane))throw k.retryLane=I,yi(t,I),vn(p,t,I),Zu;fl(),i=Om(t,i,l)}else t=k.treeContext,Et=Hn(I.nextSibling),tn=i,rt=!0,Pr=null,Fn=!1,t!==null&&wg(i,t),i=nl(i,p),i.flags|=4096;return i}return t=yr(t.child,{mode:p.mode,children:p.children}),t.ref=i.ref,i.child=t,t.return=i,t}function rl(t,i){var l=i.ref;if(l===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(s(284));(t===null||t.ref!==l)&&(i.flags|=4194816)}}function Ju(t,i,l,p,C){return _i(i),l=Bu(t,i,l,p,void 0,C),p=Iu(),t!==null&&!$t?(Lu(t,i,C),wr(t,i,C)):(rt&&p&&pu(i),i.flags|=1,rn(t,i,l,C),i.child)}function zm(t,i,l,p,C,k){return _i(i),i.updateQueue=null,l=Hg(i,p,l,C),Pg(t),p=Iu(),t!==null&&!$t?(Lu(t,i,k),wr(t,i,k)):(rt&&p&&pu(i),i.flags|=1,rn(t,i,l,k),i.child)}function Fm(t,i,l,p,C){if(_i(i),i.stateNode===null){var k=is,I=l.contextType;typeof I=="object"&&I!==null&&(k=nn(I)),k=new l(p,k),i.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=Xu,i.stateNode=k,k._reactInternals=i,k=i.stateNode,k.props=p,k.state=i.memoizedState,k.refs={},Cu(i),I=l.contextType,k.context=typeof I=="object"&&I!==null?nn(I):is,k.state=i.memoizedState,I=l.getDerivedStateFromProps,typeof I=="function"&&(Vu(i,l,I,p),k.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(I=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),I!==k.state&&Xu.enqueueReplaceState(k,k.state,null),ga(i,p,k,C),pa(),k.state=i.memoizedState),typeof k.componentDidMount=="function"&&(i.flags|=4194308),p=!0}else if(t===null){k=i.stateNode;var H=i.memoizedProps,V=ki(l,H);k.props=V;var oe=k.context,ge=l.contextType;I=is,typeof ge=="object"&&ge!==null&&(I=nn(ge));var ye=l.getDerivedStateFromProps;ge=typeof ye=="function"||typeof k.getSnapshotBeforeUpdate=="function",H=i.pendingProps!==H,ge||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(H||oe!==I)&&Cm(i,k,p,I),$r=!1;var ce=i.memoizedState;k.state=ce,ga(i,p,k,C),pa(),oe=i.memoizedState,H||ce!==oe||$r?(typeof ye=="function"&&(Vu(i,l,ye,p),oe=i.memoizedState),(V=$r||Am(i,l,V,p,ce,oe,I))?(ge||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(i.flags|=4194308)):(typeof k.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=p,i.memoizedState=oe),k.props=p,k.state=oe,k.context=I,p=V):(typeof k.componentDidMount=="function"&&(i.flags|=4194308),p=!1)}else{k=i.stateNode,Eu(t,i),I=i.memoizedProps,ge=ki(l,I),k.props=ge,ye=i.pendingProps,ce=k.context,oe=l.contextType,V=is,typeof oe=="object"&&oe!==null&&(V=nn(oe)),H=l.getDerivedStateFromProps,(oe=typeof H=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(I!==ye||ce!==V)&&Cm(i,k,p,V),$r=!1,ce=i.memoizedState,k.state=ce,ga(i,p,k,C),pa();var he=i.memoizedState;I!==ye||ce!==he||$r||t!==null&&t.dependencies!==null&&zo(t.dependencies)?(typeof H=="function"&&(Vu(i,l,H,p),he=i.memoizedState),(ge=$r||Am(i,l,ge,p,ce,he,V)||t!==null&&t.dependencies!==null&&zo(t.dependencies))?(oe||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(p,he,V),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(p,he,V)),typeof k.componentDidUpdate=="function"&&(i.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof k.componentDidUpdate!="function"||I===t.memoizedProps&&ce===t.memoizedState||(i.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||I===t.memoizedProps&&ce===t.memoizedState||(i.flags|=1024),i.memoizedProps=p,i.memoizedState=he),k.props=p,k.state=he,k.context=V,p=ge):(typeof k.componentDidUpdate!="function"||I===t.memoizedProps&&ce===t.memoizedState||(i.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||I===t.memoizedProps&&ce===t.memoizedState||(i.flags|=1024),p=!1)}return k=p,rl(t,i),p=(i.flags&128)!==0,k||p?(k=i.stateNode,l=p&&typeof l.getDerivedStateFromError!="function"?null:k.render(),i.flags|=1,t!==null&&p?(i.child=Ci(i,t.child,null,C),i.child=Ci(i,null,l,C)):rn(t,i,l,C),i.memoizedState=k.state,t=i.child):t=wr(t,i,C),t}function Pm(t,i,l,p){return bi(),i.flags|=256,rn(t,i,l,p),i.child}var ed={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function td(t){return{baseLanes:t,cachePool:Tg()}}function nd(t,i,l){return t=t!==null?t.childLanes&~l:0,i&&(t|=kn),t}function Hm(t,i,l){var p=i.pendingProps,C=!1,k=(i.flags&128)!==0,I;if((I=k)||(I=t!==null&&t.memoizedState===null?!1:(zt.current&2)!==0),I&&(C=!0,i.flags&=-129),I=(i.flags&32)!==0,i.flags&=-33,t===null){if(rt){if(C?Gr(i):Wr(),(t=Et)?(t=V0(t,Fn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Fr!==null?{id:er,overflow:tr}:null,retryLane:536870912,hydrationErrors:null},l=xg(t),l.return=i,i.child=l,tn=i,Et=null)):t=null,t===null)throw Hr(i);return zd(t)?i.lanes=32:i.lanes=536870912,null}var H=p.children;return p=p.fallback,C?(Wr(),C=i.mode,H=il({mode:"hidden",children:H},C),p=vi(p,C,l,null),H.return=i,p.return=i,H.sibling=p,i.child=H,p=i.child,p.memoizedState=td(l),p.childLanes=nd(t,I,l),i.memoizedState=ed,xa(null,p)):(Gr(i),rd(i,H))}var V=t.memoizedState;if(V!==null&&(H=V.dehydrated,H!==null)){if(k)i.flags&256?(Gr(i),i.flags&=-257,i=id(t,i,l)):i.memoizedState!==null?(Wr(),i.child=t.child,i.flags|=128,i=null):(Wr(),H=p.fallback,C=i.mode,p=il({mode:"visible",children:p.children},C),H=vi(H,C,l,null),H.flags|=2,p.return=i,H.return=i,p.sibling=H,i.child=p,Ci(i,t.child,null,l),p=i.child,p.memoizedState=td(l),p.childLanes=nd(t,I,l),i.memoizedState=ed,i=xa(null,p));else if(Gr(i),zd(H)){if(I=H.nextSibling&&H.nextSibling.dataset,I)var oe=I.dgst;I=oe,p=Error(s(419)),p.stack="",p.digest=I,la({value:p,source:null,stack:null}),i=id(t,i,l)}else if($t||ls(t,i,l,!1),I=(l&t.childLanes)!==0,$t||I){if(I=_t,I!==null&&(p=kp(I,l),p!==0&&p!==V.retryLane))throw V.retryLane=p,yi(t,p),vn(I,t,p),Zu;Od(H)||fl(),i=id(t,i,l)}else Od(H)?(i.flags|=192,i.child=t.child,i=null):(t=V.treeContext,Et=Hn(H.nextSibling),tn=i,rt=!0,Pr=null,Fn=!1,t!==null&&wg(i,t),i=rd(i,p.children),i.flags|=4096);return i}return C?(Wr(),H=p.fallback,C=i.mode,V=t.child,oe=V.sibling,p=yr(V,{mode:"hidden",children:p.children}),p.subtreeFlags=V.subtreeFlags&65011712,oe!==null?H=yr(oe,H):(H=vi(H,C,l,null),H.flags|=2),H.return=i,p.return=i,p.sibling=H,i.child=p,xa(null,p),p=i.child,H=t.child.memoizedState,H===null?H=td(l):(C=H.cachePool,C!==null?(V=Ht._currentValue,C=C.parent!==V?{parent:V,pool:V}:C):C=Tg(),H={baseLanes:H.baseLanes|l,cachePool:C}),p.memoizedState=H,p.childLanes=nd(t,I,l),i.memoizedState=ed,xa(t.child,p)):(Gr(i),l=t.child,t=l.sibling,l=yr(l,{mode:"visible",children:p.children}),l.return=i,l.sibling=null,t!==null&&(I=i.deletions,I===null?(i.deletions=[t],i.flags|=16):I.push(t)),i.child=l,i.memoizedState=null,l)}function rd(t,i){return i=il({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function il(t,i){return t=wn(22,t,null,i),t.lanes=0,t}function id(t,i,l){return Ci(i,t.child,null,l),t=rd(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function Um(t,i,l){t.lanes|=i;var p=t.alternate;p!==null&&(p.lanes|=i),bu(t.return,i,l)}function sd(t,i,l,p,C,k){var I=t.memoizedState;I===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:p,tail:l,tailMode:C,treeForkCount:k}:(I.isBackwards=i,I.rendering=null,I.renderingStartTime=0,I.last=p,I.tail=l,I.tailMode=C,I.treeForkCount=k)}function $m(t,i,l){var p=i.pendingProps,C=p.revealOrder,k=p.tail;p=p.children;var I=zt.current,H=(I&2)!==0;if(H?(I=I&1|2,i.flags|=128):I&=1,M(zt,I),rn(t,i,p,l),p=rt?oa:0,!H&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Um(t,l,i);else if(t.tag===19)Um(t,l,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(C){case"forwards":for(l=i.child,C=null;l!==null;)t=l.alternate,t!==null&&Go(t)===null&&(C=l),l=l.sibling;l=C,l===null?(C=i.child,i.child=null):(C=l.sibling,l.sibling=null),sd(i,!1,C,l,k,p);break;case"backwards":case"unstable_legacy-backwards":for(l=null,C=i.child,i.child=null;C!==null;){if(t=C.alternate,t!==null&&Go(t)===null){i.child=C;break}t=C.sibling,C.sibling=l,l=C,C=t}sd(i,!0,l,null,k,p);break;case"together":sd(i,!1,null,null,void 0,p);break;default:i.memoizedState=null}return i.child}function wr(t,i,l){if(t!==null&&(i.dependencies=t.dependencies),Xr|=i.lanes,(l&i.childLanes)===0)if(t!==null){if(ls(t,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(s(153));if(i.child!==null){for(t=i.child,l=yr(t,t.pendingProps),i.child=l,l.return=i;t.sibling!==null;)t=t.sibling,l=l.sibling=yr(t,t.pendingProps),l.return=i;l.sibling=null}return i.child}function ad(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&zo(t)))}function QS(t,i,l){switch(i.tag){case 3:$(i,i.stateNode.containerInfo),Ur(i,Ht,t.memoizedState.cache),bi();break;case 27:case 5:le(i);break;case 4:$(i,i.stateNode.containerInfo);break;case 10:Ur(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,ju(i),null;break;case 13:var p=i.memoizedState;if(p!==null)return p.dehydrated!==null?(Gr(i),i.flags|=128,null):(l&i.child.childLanes)!==0?Hm(t,i,l):(Gr(i),t=wr(t,i,l),t!==null?t.sibling:null);Gr(i);break;case 19:var C=(t.flags&128)!==0;if(p=(l&i.childLanes)!==0,p||(ls(t,i,l,!1),p=(l&i.childLanes)!==0),C){if(p)return $m(t,i,l);i.flags|=128}if(C=i.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),M(zt,zt.current),p)break;return null;case 22:return i.lanes=0,Lm(t,i,l,i.pendingProps);case 24:Ur(i,Ht,t.memoizedState.cache)}return wr(t,i,l)}function qm(t,i,l){if(t!==null)if(t.memoizedProps!==i.pendingProps)$t=!0;else{if(!ad(t,l)&&(i.flags&128)===0)return $t=!1,QS(t,i,l);$t=(t.flags&131072)!==0}else $t=!1,rt&&(i.flags&1048576)!==0&&Sg(i,oa,i.index);switch(i.lanes=0,i.tag){case 16:e:{var p=i.pendingProps;if(t=wi(i.elementType),i.type=t,typeof t=="function")du(t)?(p=ki(t,p),i.tag=1,i=Fm(null,i,t,p,l)):(i.tag=0,i=Ju(null,i,t,p,l));else{if(t!=null){var C=t.$$typeof;if(C===E){i.tag=11,i=Dm(null,i,t,p,l);break e}else if(C===j){i.tag=14,i=Bm(null,i,t,p,l);break e}}throw i=G(t)||t,Error(s(306,i,""))}}return i;case 0:return Ju(t,i,i.type,i.pendingProps,l);case 1:return p=i.type,C=ki(p,i.pendingProps),Fm(t,i,p,C,l);case 3:e:{if($(i,i.stateNode.containerInfo),t===null)throw Error(s(387));p=i.pendingProps;var k=i.memoizedState;C=k.element,Eu(t,i),ga(i,p,null,l);var I=i.memoizedState;if(p=I.cache,Ur(i,Ht,p),p!==k.cache&&xu(i,[Ht],l,!0),pa(),p=I.element,k.isDehydrated)if(k={element:p,isDehydrated:!1,cache:I.cache},i.updateQueue.baseState=k,i.memoizedState=k,i.flags&256){i=Pm(t,i,p,l);break e}else if(p!==C){C=Mn(Error(s(424)),i),la(C),i=Pm(t,i,p,l);break e}else{switch(t=i.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Et=Hn(t.firstChild),tn=i,rt=!0,Pr=null,Fn=!0,l=Lg(i,null,p,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(bi(),p===C){i=wr(t,i,l);break e}rn(t,i,p,l)}i=i.child}return i;case 26:return rl(t,i),t===null?(l=ty(i.type,null,i.pendingProps,null))?i.memoizedState=l:rt||(l=i.type,t=i.pendingProps,p=xl(pe.current).createElement(l),p[en]=i,p[hn]=t,sn(p,l,t),Vt(p),i.stateNode=p):i.memoizedState=ty(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return le(i),t===null&&rt&&(p=i.stateNode=Z0(i.type,i.pendingProps,pe.current),tn=i,Fn=!0,C=Et,ti(i.type)?(Fd=C,Et=Hn(p.firstChild)):Et=C),rn(t,i,i.pendingProps.children,l),rl(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&rt&&((C=p=Et)&&(p=_w(p,i.type,i.pendingProps,Fn),p!==null?(i.stateNode=p,tn=i,Et=Hn(p.firstChild),Fn=!1,C=!0):C=!1),C||Hr(i)),le(i),C=i.type,k=i.pendingProps,I=t!==null?t.memoizedProps:null,p=k.children,Id(C,k)?p=null:I!==null&&Id(C,I)&&(i.flags|=32),i.memoizedState!==null&&(C=Bu(t,i,MS,null,null,l),La._currentValue=C),rl(t,i),rn(t,i,p,l),i.child;case 6:return t===null&&rt&&((t=l=Et)&&(l=Sw(l,i.pendingProps,Fn),l!==null?(i.stateNode=l,tn=i,Et=null,t=!0):t=!1),t||Hr(i)),null;case 13:return Hm(t,i,l);case 4:return $(i,i.stateNode.containerInfo),p=i.pendingProps,t===null?i.child=Ci(i,null,p,l):rn(t,i,p,l),i.child;case 11:return Dm(t,i,i.type,i.pendingProps,l);case 7:return rn(t,i,i.pendingProps,l),i.child;case 8:return rn(t,i,i.pendingProps.children,l),i.child;case 12:return rn(t,i,i.pendingProps.children,l),i.child;case 10:return p=i.pendingProps,Ur(i,i.type,p.value),rn(t,i,p.children,l),i.child;case 9:return C=i.type._context,p=i.pendingProps.children,_i(i),C=nn(C),p=p(C),i.flags|=1,rn(t,i,p,l),i.child;case 14:return Bm(t,i,i.type,i.pendingProps,l);case 15:return Im(t,i,i.type,i.pendingProps,l);case 19:return $m(t,i,l);case 31:return qS(t,i,l);case 22:return Lm(t,i,l,i.pendingProps);case 24:return _i(i),p=nn(Ht),t===null?(C=wu(),C===null&&(C=_t,k=_u(),C.pooledCache=k,k.refCount++,k!==null&&(C.pooledCacheLanes|=l),C=k),i.memoizedState={parent:p,cache:C},Cu(i),Ur(i,Ht,C)):((t.lanes&l)!==0&&(Eu(t,i),ga(i,null,null,l),pa()),C=t.memoizedState,k=i.memoizedState,C.parent!==p?(C={parent:p,cache:p},i.memoizedState=C,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=C),Ur(i,Ht,p)):(p=k.cache,Ur(i,Ht,p),p!==C.cache&&xu(i,[Ht],l,!0))),rn(t,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(s(156,i.tag))}function Ar(t){t.flags|=4}function od(t,i,l,p,C){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(C&335544128)===C)if(t.stateNode.complete)t.flags|=8192;else if(y0())t.flags|=8192;else throw Ai=Uo,Au}else t.flags&=-16777217}function Qm(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!ay(i))if(y0())t.flags|=8192;else throw Ai=Uo,Au}function sl(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Ap():536870912,t.lanes|=i,xs|=i)}function _a(t,i){if(!rt)switch(t.tailMode){case"hidden":i=t.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var p=null;l!==null;)l.alternate!==null&&(p=l),l=l.sibling;p===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:p.sibling=null}}function kt(t){var i=t.alternate!==null&&t.alternate.child===t.child,l=0,p=0;if(i)for(var C=t.child;C!==null;)l|=C.lanes|C.childLanes,p|=C.subtreeFlags&65011712,p|=C.flags&65011712,C.return=t,C=C.sibling;else for(C=t.child;C!==null;)l|=C.lanes|C.childLanes,p|=C.subtreeFlags,p|=C.flags,C.return=t,C=C.sibling;return t.subtreeFlags|=p,t.childLanes=l,i}function GS(t,i,l){var p=i.pendingProps;switch(gu(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(i),null;case 1:return kt(i),null;case 3:return l=i.stateNode,p=null,t!==null&&(p=t.memoizedState.cache),i.memoizedState.cache!==p&&(i.flags|=2048),xr(Ht),se(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(os(i)?Ar(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,yu())),kt(i),null;case 26:var C=i.type,k=i.memoizedState;return t===null?(Ar(i),k!==null?(kt(i),Qm(i,k)):(kt(i),od(i,C,null,p,l))):k?k!==t.memoizedState?(Ar(i),kt(i),Qm(i,k)):(kt(i),i.flags&=-16777217):(t=t.memoizedProps,t!==p&&Ar(i),kt(i),od(i,C,t,p,l)),null;case 27:if(te(i),l=pe.current,C=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==p&&Ar(i);else{if(!p){if(i.stateNode===null)throw Error(s(166));return kt(i),null}t=J.current,os(i)?Ag(i):(t=Z0(C,p,l),i.stateNode=t,Ar(i))}return kt(i),null;case 5:if(te(i),C=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==p&&Ar(i);else{if(!p){if(i.stateNode===null)throw Error(s(166));return kt(i),null}if(k=J.current,os(i))Ag(i);else{var I=xl(pe.current);switch(k){case 1:k=I.createElementNS("http://www.w3.org/2000/svg",C);break;case 2:k=I.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;default:switch(C){case"svg":k=I.createElementNS("http://www.w3.org/2000/svg",C);break;case"math":k=I.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;case"script":k=I.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof p.is=="string"?I.createElement("select",{is:p.is}):I.createElement("select"),p.multiple?k.multiple=!0:p.size&&(k.size=p.size);break;default:k=typeof p.is=="string"?I.createElement(C,{is:p.is}):I.createElement(C)}}k[en]=i,k[hn]=p;e:for(I=i.child;I!==null;){if(I.tag===5||I.tag===6)k.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===i)break e;for(;I.sibling===null;){if(I.return===null||I.return===i)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}i.stateNode=k;e:switch(sn(k,C,p),C){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Ar(i)}}return kt(i),od(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,l),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==p&&Ar(i);else{if(typeof p!="string"&&i.stateNode===null)throw Error(s(166));if(t=pe.current,os(i)){if(t=i.stateNode,l=i.memoizedProps,p=null,C=tn,C!==null)switch(C.tag){case 27:case 5:p=C.memoizedProps}t[en]=i,t=!!(t.nodeValue===l||p!==null&&p.suppressHydrationWarning===!0||H0(t.nodeValue,l)),t||Hr(i,!0)}else t=xl(t).createTextNode(p),t[en]=i,i.stateNode=t}return kt(i),null;case 31:if(l=i.memoizedState,t===null||t.memoizedState!==null){if(p=os(i),l!==null){if(t===null){if(!p)throw Error(s(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[en]=i}else bi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;kt(i),t=!1}else l=yu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return i.flags&256?(Cn(i),i):(Cn(i),null);if((i.flags&128)!==0)throw Error(s(558))}return kt(i),null;case 13:if(p=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(C=os(i),p!==null&&p.dehydrated!==null){if(t===null){if(!C)throw Error(s(318));if(C=i.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(s(317));C[en]=i}else bi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;kt(i),C=!1}else C=yu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=C),C=!0;if(!C)return i.flags&256?(Cn(i),i):(Cn(i),null)}return Cn(i),(i.flags&128)!==0?(i.lanes=l,i):(l=p!==null,t=t!==null&&t.memoizedState!==null,l&&(p=i.child,C=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(C=p.alternate.memoizedState.cachePool.pool),k=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(k=p.memoizedState.cachePool.pool),k!==C&&(p.flags|=2048)),l!==t&&l&&(i.child.flags|=8192),sl(i,i.updateQueue),kt(i),null);case 4:return se(),t===null&&Td(i.stateNode.containerInfo),kt(i),null;case 10:return xr(i.type),kt(i),null;case 19:if(Q(zt),p=i.memoizedState,p===null)return kt(i),null;if(C=(i.flags&128)!==0,k=p.rendering,k===null)if(C)_a(p,!1);else{if(Lt!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(k=Go(t),k!==null){for(i.flags|=128,_a(p,!1),t=k.updateQueue,i.updateQueue=t,sl(i,t),i.subtreeFlags=0,t=l,l=i.child;l!==null;)bg(l,t),l=l.sibling;return M(zt,zt.current&1|2),rt&&vr(i,p.treeForkCount),i.child}t=t.sibling}p.tail!==null&&xt()>ul&&(i.flags|=128,C=!0,_a(p,!1),i.lanes=4194304)}else{if(!C)if(t=Go(k),t!==null){if(i.flags|=128,C=!0,t=t.updateQueue,i.updateQueue=t,sl(i,t),_a(p,!0),p.tail===null&&p.tailMode==="hidden"&&!k.alternate&&!rt)return kt(i),null}else 2*xt()-p.renderingStartTime>ul&&l!==536870912&&(i.flags|=128,C=!0,_a(p,!1),i.lanes=4194304);p.isBackwards?(k.sibling=i.child,i.child=k):(t=p.last,t!==null?t.sibling=k:i.child=k,p.last=k)}return p.tail!==null?(t=p.tail,p.rendering=t,p.tail=t.sibling,p.renderingStartTime=xt(),t.sibling=null,l=zt.current,M(zt,C?l&1|2:l&1),rt&&vr(i,p.treeForkCount),t):(kt(i),null);case 22:case 23:return Cn(i),Ru(),p=i.memoizedState!==null,t!==null?t.memoizedState!==null!==p&&(i.flags|=8192):p&&(i.flags|=8192),p?(l&536870912)!==0&&(i.flags&128)===0&&(kt(i),i.subtreeFlags&6&&(i.flags|=8192)):kt(i),l=i.updateQueue,l!==null&&sl(i,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),p=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(p=i.memoizedState.cachePool.pool),p!==l&&(i.flags|=2048),t!==null&&Q(Si),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),xr(Ht),kt(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function WS(t,i){switch(gu(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return xr(Ht),se(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return te(i),null;case 31:if(i.memoizedState!==null){if(Cn(i),i.alternate===null)throw Error(s(340));bi()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(Cn(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(s(340));bi()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return Q(zt),null;case 4:return se(),null;case 10:return xr(i.type),null;case 22:case 23:return Cn(i),Ru(),t!==null&&Q(Si),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return xr(Ht),null;case 25:return null;default:return null}}function Gm(t,i){switch(gu(i),i.tag){case 3:xr(Ht),se();break;case 26:case 27:case 5:te(i);break;case 4:se();break;case 31:i.memoizedState!==null&&Cn(i);break;case 13:Cn(i);break;case 19:Q(zt);break;case 10:xr(i.type);break;case 22:case 23:Cn(i),Ru(),t!==null&&Q(Si);break;case 24:xr(Ht)}}function Sa(t,i){try{var l=i.updateQueue,p=l!==null?l.lastEffect:null;if(p!==null){var C=p.next;l=C;do{if((l.tag&t)===t){p=void 0;var k=l.create,I=l.inst;p=k(),I.destroy=p}l=l.next}while(l!==C)}}catch(H){ht(i,i.return,H)}}function Kr(t,i,l){try{var p=i.updateQueue,C=p!==null?p.lastEffect:null;if(C!==null){var k=C.next;p=k;do{if((p.tag&t)===t){var I=p.inst,H=I.destroy;if(H!==void 0){I.destroy=void 0,C=i;var V=l,oe=H;try{oe()}catch(ge){ht(C,V,ge)}}}p=p.next}while(p!==k)}}catch(ge){ht(i,i.return,ge)}}function Wm(t){var i=t.updateQueue;if(i!==null){var l=t.stateNode;try{Og(i,l)}catch(p){ht(t,t.return,p)}}}function Km(t,i,l){l.props=ki(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(p){ht(t,i,p)}}function wa(t,i){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var p=t.stateNode;break;case 30:p=t.stateNode;break;default:p=t.stateNode}typeof l=="function"?t.refCleanup=l(p):l.current=p}}catch(C){ht(t,i,C)}}function nr(t,i){var l=t.ref,p=t.refCleanup;if(l!==null)if(typeof p=="function")try{p()}catch(C){ht(t,i,C)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(C){ht(t,i,C)}else l.current=null}function Vm(t){var i=t.type,l=t.memoizedProps,p=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&p.focus();break e;case"img":l.src?p.src=l.src:l.srcSet&&(p.srcset=l.srcSet)}}catch(C){ht(t,t.return,C)}}function ld(t,i,l){try{var p=t.stateNode;gw(p,t.type,l,i),p[hn]=i}catch(C){ht(t,t.return,C)}}function Xm(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ti(t.type)||t.tag===4}function cd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Xm(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ti(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function ud(t,i,l){var p=t.tag;if(p===5||p===6)t=t.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(t),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=gr));else if(p!==4&&(p===27&&ti(t.type)&&(l=t.stateNode,i=null),t=t.child,t!==null))for(ud(t,i,l),t=t.sibling;t!==null;)ud(t,i,l),t=t.sibling}function al(t,i,l){var p=t.tag;if(p===5||p===6)t=t.stateNode,i?l.insertBefore(t,i):l.appendChild(t);else if(p!==4&&(p===27&&ti(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(al(t,i,l),t=t.sibling;t!==null;)al(t,i,l),t=t.sibling}function Ym(t){var i=t.stateNode,l=t.memoizedProps;try{for(var p=t.type,C=i.attributes;C.length;)i.removeAttributeNode(C[0]);sn(i,p,l),i[en]=t,i[hn]=l}catch(k){ht(t,t.return,k)}}var Cr=!1,qt=!1,dd=!1,Zm=typeof WeakSet=="function"?WeakSet:Set,Xt=null;function KS(t,i){if(t=t.containerInfo,Dd=kl,t=ug(t),iu(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var p=l.getSelection&&l.getSelection();if(p&&p.rangeCount!==0){l=p.anchorNode;var C=p.anchorOffset,k=p.focusNode;p=p.focusOffset;try{l.nodeType,k.nodeType}catch{l=null;break e}var I=0,H=-1,V=-1,oe=0,ge=0,ye=t,ce=null;t:for(;;){for(var he;ye!==l||C!==0&&ye.nodeType!==3||(H=I+C),ye!==k||p!==0&&ye.nodeType!==3||(V=I+p),ye.nodeType===3&&(I+=ye.nodeValue.length),(he=ye.firstChild)!==null;)ce=ye,ye=he;for(;;){if(ye===t)break t;if(ce===l&&++oe===C&&(H=I),ce===k&&++ge===p&&(V=I),(he=ye.nextSibling)!==null)break;ye=ce,ce=ye.parentNode}ye=he}l=H===-1||V===-1?null:{start:H,end:V}}else l=null}l=l||{start:0,end:0}}else l=null;for(Bd={focusedElem:t,selectionRange:l},kl=!1,Xt=i;Xt!==null;)if(i=Xt,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,Xt=t;else for(;Xt!==null;){switch(i=Xt,k=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)C=t[l],C.ref.impl=C.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&k!==null){t=void 0,l=i,C=k.memoizedProps,k=k.memoizedState,p=l.stateNode;try{var De=ki(l.type,C);t=p.getSnapshotBeforeUpdate(De,k),p.__reactInternalSnapshotBeforeUpdate=t}catch(He){ht(l,l.return,He)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,l=t.nodeType,l===9)Md(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Md(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(s(163))}if(t=i.sibling,t!==null){t.return=i.return,Xt=t;break}Xt=i.return}}function Jm(t,i,l){var p=l.flags;switch(l.tag){case 0:case 11:case 15:kr(t,l),p&4&&Sa(5,l);break;case 1:if(kr(t,l),p&4)if(t=l.stateNode,i===null)try{t.componentDidMount()}catch(I){ht(l,l.return,I)}else{var C=ki(l.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(C,i,t.__reactInternalSnapshotBeforeUpdate)}catch(I){ht(l,l.return,I)}}p&64&&Wm(l),p&512&&wa(l,l.return);break;case 3:if(kr(t,l),p&64&&(t=l.updateQueue,t!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{Og(t,i)}catch(I){ht(l,l.return,I)}}break;case 27:i===null&&p&4&&Ym(l);case 26:case 5:kr(t,l),i===null&&p&4&&Vm(l),p&512&&wa(l,l.return);break;case 12:kr(t,l);break;case 31:kr(t,l),p&4&&n0(t,l);break;case 13:kr(t,l),p&4&&r0(t,l),p&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=rw.bind(null,l),ww(t,l))));break;case 22:if(p=l.memoizedState!==null||Cr,!p){i=i!==null&&i.memoizedState!==null||qt,C=Cr;var k=qt;Cr=p,(qt=i)&&!k?Nr(t,l,(l.subtreeFlags&8772)!==0):kr(t,l),Cr=C,qt=k}break;case 30:break;default:kr(t,l)}}function e0(t){var i=t.alternate;i!==null&&(t.alternate=null,e0(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&Hc(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Rt=null,pn=!1;function Er(t,i,l){for(l=l.child;l!==null;)t0(t,i,l),l=l.sibling}function t0(t,i,l){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(Ot,l)}catch{}switch(l.tag){case 26:qt||nr(l,i),Er(t,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:qt||nr(l,i);var p=Rt,C=pn;ti(l.type)&&(Rt=l.stateNode,pn=!1),Er(t,i,l),Da(l.stateNode),Rt=p,pn=C;break;case 5:qt||nr(l,i);case 6:if(p=Rt,C=pn,Rt=null,Er(t,i,l),Rt=p,pn=C,Rt!==null)if(pn)try{(Rt.nodeType===9?Rt.body:Rt.nodeName==="HTML"?Rt.ownerDocument.body:Rt).removeChild(l.stateNode)}catch(k){ht(l,i,k)}else try{Rt.removeChild(l.stateNode)}catch(k){ht(l,i,k)}break;case 18:Rt!==null&&(pn?(t=Rt,W0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Ns(t)):W0(Rt,l.stateNode));break;case 4:p=Rt,C=pn,Rt=l.stateNode.containerInfo,pn=!0,Er(t,i,l),Rt=p,pn=C;break;case 0:case 11:case 14:case 15:Kr(2,l,i),qt||Kr(4,l,i),Er(t,i,l);break;case 1:qt||(nr(l,i),p=l.stateNode,typeof p.componentWillUnmount=="function"&&Km(l,i,p)),Er(t,i,l);break;case 21:Er(t,i,l);break;case 22:qt=(p=qt)||l.memoizedState!==null,Er(t,i,l),qt=p;break;default:Er(t,i,l)}}function n0(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ns(t)}catch(l){ht(i,i.return,l)}}}function r0(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ns(t)}catch(l){ht(i,i.return,l)}}function VS(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Zm),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Zm),i;default:throw Error(s(435,t.tag))}}function ol(t,i){var l=VS(t);i.forEach(function(p){if(!l.has(p)){l.add(p);var C=iw.bind(null,t,p);p.then(C,C)}})}function gn(t,i){var l=i.deletions;if(l!==null)for(var p=0;p<l.length;p++){var C=l[p],k=t,I=i,H=I;e:for(;H!==null;){switch(H.tag){case 27:if(ti(H.type)){Rt=H.stateNode,pn=!1;break e}break;case 5:Rt=H.stateNode,pn=!1;break e;case 3:case 4:Rt=H.stateNode.containerInfo,pn=!0;break e}H=H.return}if(Rt===null)throw Error(s(160));t0(k,I,C),Rt=null,pn=!1,k=C.alternate,k!==null&&(k.return=null),C.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)i0(i,t),i=i.sibling}var Kn=null;function i0(t,i){var l=t.alternate,p=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:gn(i,t),mn(t),p&4&&(Kr(3,t,t.return),Sa(3,t),Kr(5,t,t.return));break;case 1:gn(i,t),mn(t),p&512&&(qt||l===null||nr(l,l.return)),p&64&&Cr&&(t=t.updateQueue,t!==null&&(p=t.callbacks,p!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?p:l.concat(p))));break;case 26:var C=Kn;if(gn(i,t),mn(t),p&512&&(qt||l===null||nr(l,l.return)),p&4){var k=l!==null?l.memoizedState:null;if(p=t.memoizedState,l===null)if(p===null)if(t.stateNode===null){e:{p=t.type,l=t.memoizedProps,C=C.ownerDocument||C;t:switch(p){case"title":k=C.getElementsByTagName("title")[0],(!k||k[Xs]||k[en]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=C.createElement(p),C.head.insertBefore(k,C.querySelector("head > title"))),sn(k,p,l),k[en]=t,Vt(k),p=k;break e;case"link":var I=iy("link","href",C).get(p+(l.href||""));if(I){for(var H=0;H<I.length;H++)if(k=I[H],k.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&k.getAttribute("rel")===(l.rel==null?null:l.rel)&&k.getAttribute("title")===(l.title==null?null:l.title)&&k.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){I.splice(H,1);break t}}k=C.createElement(p),sn(k,p,l),C.head.appendChild(k);break;case"meta":if(I=iy("meta","content",C).get(p+(l.content||""))){for(H=0;H<I.length;H++)if(k=I[H],k.getAttribute("content")===(l.content==null?null:""+l.content)&&k.getAttribute("name")===(l.name==null?null:l.name)&&k.getAttribute("property")===(l.property==null?null:l.property)&&k.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&k.getAttribute("charset")===(l.charSet==null?null:l.charSet)){I.splice(H,1);break t}}k=C.createElement(p),sn(k,p,l),C.head.appendChild(k);break;default:throw Error(s(468,p))}k[en]=t,Vt(k),p=k}t.stateNode=p}else sy(C,t.type,t.stateNode);else t.stateNode=ry(C,p,t.memoizedProps);else k!==p?(k===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):k.count--,p===null?sy(C,t.type,t.stateNode):ry(C,p,t.memoizedProps)):p===null&&t.stateNode!==null&&ld(t,t.memoizedProps,l.memoizedProps)}break;case 27:gn(i,t),mn(t),p&512&&(qt||l===null||nr(l,l.return)),l!==null&&p&4&&ld(t,t.memoizedProps,l.memoizedProps);break;case 5:if(gn(i,t),mn(t),p&512&&(qt||l===null||nr(l,l.return)),t.flags&32){C=t.stateNode;try{Yi(C,"")}catch(De){ht(t,t.return,De)}}p&4&&t.stateNode!=null&&(C=t.memoizedProps,ld(t,C,l!==null?l.memoizedProps:C)),p&1024&&(dd=!0);break;case 6:if(gn(i,t),mn(t),p&4){if(t.stateNode===null)throw Error(s(162));p=t.memoizedProps,l=t.stateNode;try{l.nodeValue=p}catch(De){ht(t,t.return,De)}}break;case 3:if(wl=null,C=Kn,Kn=_l(i.containerInfo),gn(i,t),Kn=C,mn(t),p&4&&l!==null&&l.memoizedState.isDehydrated)try{Ns(i.containerInfo)}catch(De){ht(t,t.return,De)}dd&&(dd=!1,s0(t));break;case 4:p=Kn,Kn=_l(t.stateNode.containerInfo),gn(i,t),mn(t),Kn=p;break;case 12:gn(i,t),mn(t);break;case 31:gn(i,t),mn(t),p&4&&(p=t.updateQueue,p!==null&&(t.updateQueue=null,ol(t,p)));break;case 13:gn(i,t),mn(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(cl=xt()),p&4&&(p=t.updateQueue,p!==null&&(t.updateQueue=null,ol(t,p)));break;case 22:C=t.memoizedState!==null;var V=l!==null&&l.memoizedState!==null,oe=Cr,ge=qt;if(Cr=oe||C,qt=ge||V,gn(i,t),qt=ge,Cr=oe,mn(t),p&8192)e:for(i=t.stateNode,i._visibility=C?i._visibility&-2:i._visibility|1,C&&(l===null||V||Cr||qt||Ni(t)),l=null,i=t;;){if(i.tag===5||i.tag===26){if(l===null){V=l=i;try{if(k=V.stateNode,C)I=k.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none";else{H=V.stateNode;var ye=V.memoizedProps.style,ce=ye!=null&&ye.hasOwnProperty("display")?ye.display:null;H.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(De){ht(V,V.return,De)}}}else if(i.tag===6){if(l===null){V=i;try{V.stateNode.nodeValue=C?"":V.memoizedProps}catch(De){ht(V,V.return,De)}}}else if(i.tag===18){if(l===null){V=i;try{var he=V.stateNode;C?K0(he,!0):K0(V.stateNode,!1)}catch(De){ht(V,V.return,De)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}p&4&&(p=t.updateQueue,p!==null&&(l=p.retryQueue,l!==null&&(p.retryQueue=null,ol(t,l))));break;case 19:gn(i,t),mn(t),p&4&&(p=t.updateQueue,p!==null&&(t.updateQueue=null,ol(t,p)));break;case 30:break;case 21:break;default:gn(i,t),mn(t)}}function mn(t){var i=t.flags;if(i&2){try{for(var l,p=t.return;p!==null;){if(Xm(p)){l=p;break}p=p.return}if(l==null)throw Error(s(160));switch(l.tag){case 27:var C=l.stateNode,k=cd(t);al(t,k,C);break;case 5:var I=l.stateNode;l.flags&32&&(Yi(I,""),l.flags&=-33);var H=cd(t);al(t,H,I);break;case 3:case 4:var V=l.stateNode.containerInfo,oe=cd(t);ud(t,oe,V);break;default:throw Error(s(161))}}catch(ge){ht(t,t.return,ge)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function s0(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;s0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function kr(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Jm(t,i.alternate,i),i=i.sibling}function Ni(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:Kr(4,i,i.return),Ni(i);break;case 1:nr(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&Km(i,i.return,l),Ni(i);break;case 27:Da(i.stateNode);case 26:case 5:nr(i,i.return),Ni(i);break;case 22:i.memoizedState===null&&Ni(i);break;case 30:Ni(i);break;default:Ni(i)}t=t.sibling}}function Nr(t,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var p=i.alternate,C=t,k=i,I=k.flags;switch(k.tag){case 0:case 11:case 15:Nr(C,k,l),Sa(4,k);break;case 1:if(Nr(C,k,l),p=k,C=p.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(oe){ht(p,p.return,oe)}if(p=k,C=p.updateQueue,C!==null){var H=p.stateNode;try{var V=C.shared.hiddenCallbacks;if(V!==null)for(C.shared.hiddenCallbacks=null,C=0;C<V.length;C++)Mg(V[C],H)}catch(oe){ht(p,p.return,oe)}}l&&I&64&&Wm(k),wa(k,k.return);break;case 27:Ym(k);case 26:case 5:Nr(C,k,l),l&&p===null&&I&4&&Vm(k),wa(k,k.return);break;case 12:Nr(C,k,l);break;case 31:Nr(C,k,l),l&&I&4&&n0(C,k);break;case 13:Nr(C,k,l),l&&I&4&&r0(C,k);break;case 22:k.memoizedState===null&&Nr(C,k,l),wa(k,k.return);break;case 30:break;default:Nr(C,k,l)}i=i.sibling}}function hd(t,i){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&ca(l))}function fd(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&ca(t))}function Vn(t,i,l,p){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)a0(t,i,l,p),i=i.sibling}function a0(t,i,l,p){var C=i.flags;switch(i.tag){case 0:case 11:case 15:Vn(t,i,l,p),C&2048&&Sa(9,i);break;case 1:Vn(t,i,l,p);break;case 3:Vn(t,i,l,p),C&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&ca(t)));break;case 12:if(C&2048){Vn(t,i,l,p),t=i.stateNode;try{var k=i.memoizedProps,I=k.id,H=k.onPostCommit;typeof H=="function"&&H(I,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(V){ht(i,i.return,V)}}else Vn(t,i,l,p);break;case 31:Vn(t,i,l,p);break;case 13:Vn(t,i,l,p);break;case 23:break;case 22:k=i.stateNode,I=i.alternate,i.memoizedState!==null?k._visibility&2?Vn(t,i,l,p):Aa(t,i):k._visibility&2?Vn(t,i,l,p):(k._visibility|=2,ys(t,i,l,p,(i.subtreeFlags&10256)!==0||!1)),C&2048&&hd(I,i);break;case 24:Vn(t,i,l,p),C&2048&&fd(i.alternate,i);break;default:Vn(t,i,l,p)}}function ys(t,i,l,p,C){for(C=C&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var k=t,I=i,H=l,V=p,oe=I.flags;switch(I.tag){case 0:case 11:case 15:ys(k,I,H,V,C),Sa(8,I);break;case 23:break;case 22:var ge=I.stateNode;I.memoizedState!==null?ge._visibility&2?ys(k,I,H,V,C):Aa(k,I):(ge._visibility|=2,ys(k,I,H,V,C)),C&&oe&2048&&hd(I.alternate,I);break;case 24:ys(k,I,H,V,C),C&&oe&2048&&fd(I.alternate,I);break;default:ys(k,I,H,V,C)}i=i.sibling}}function Aa(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=t,p=i,C=p.flags;switch(p.tag){case 22:Aa(l,p),C&2048&&hd(p.alternate,p);break;case 24:Aa(l,p),C&2048&&fd(p.alternate,p);break;default:Aa(l,p)}i=i.sibling}}var Ca=8192;function vs(t,i,l){if(t.subtreeFlags&Ca)for(t=t.child;t!==null;)o0(t,i,l),t=t.sibling}function o0(t,i,l){switch(t.tag){case 26:vs(t,i,l),t.flags&Ca&&t.memoizedState!==null&&Lw(l,Kn,t.memoizedState,t.memoizedProps);break;case 5:vs(t,i,l);break;case 3:case 4:var p=Kn;Kn=_l(t.stateNode.containerInfo),vs(t,i,l),Kn=p;break;case 22:t.memoizedState===null&&(p=t.alternate,p!==null&&p.memoizedState!==null?(p=Ca,Ca=16777216,vs(t,i,l),Ca=p):vs(t,i,l));break;default:vs(t,i,l)}}function l0(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function Ea(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var p=i[l];Xt=p,u0(p,t)}l0(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)c0(t),t=t.sibling}function c0(t){switch(t.tag){case 0:case 11:case 15:Ea(t),t.flags&2048&&Kr(9,t,t.return);break;case 3:Ea(t);break;case 12:Ea(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,ll(t)):Ea(t);break;default:Ea(t)}}function ll(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var p=i[l];Xt=p,u0(p,t)}l0(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:Kr(8,i,i.return),ll(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,ll(i));break;default:ll(i)}t=t.sibling}}function u0(t,i){for(;Xt!==null;){var l=Xt;switch(l.tag){case 0:case 11:case 15:Kr(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var p=l.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:ca(l.memoizedState.cache)}if(p=l.child,p!==null)p.return=l,Xt=p;else e:for(l=t;Xt!==null;){p=Xt;var C=p.sibling,k=p.return;if(e0(p),p===l){Xt=null;break e}if(C!==null){C.return=k,Xt=C;break e}Xt=k}}}var XS={getCacheForType:function(t){var i=nn(Ht),l=i.data.get(t);return l===void 0&&(l=t(),i.data.set(t,l)),l},cacheSignal:function(){return nn(Ht).controller.signal}},YS=typeof WeakMap=="function"?WeakMap:Map,ct=0,_t=null,Ze=null,tt=0,dt=0,En=null,Vr=!1,bs=!1,pd=!1,Tr=0,Lt=0,Xr=0,Ti=0,gd=0,kn=0,xs=0,ka=null,yn=null,md=!1,cl=0,d0=0,ul=1/0,dl=null,Yr=null,Gt=0,Zr=null,_s=null,Rr=0,yd=0,vd=null,h0=null,Na=0,bd=null;function Nn(){return(ct&2)!==0&&tt!==0?tt&-tt:W.T!==null?Cd():Np()}function f0(){if(kn===0)if((tt&536870912)===0||rt){var t=Ne;Ne<<=1,(Ne&3932160)===0&&(Ne=262144),kn=t}else kn=536870912;return t=An.current,t!==null&&(t.flags|=32),kn}function vn(t,i,l){(t===_t&&(dt===2||dt===9)||t.cancelPendingCommit!==null)&&(Ss(t,0),Jr(t,tt,kn,!1)),Vs(t,l),((ct&2)===0||t!==_t)&&(t===_t&&((ct&2)===0&&(Ti|=l),Lt===4&&Jr(t,tt,kn,!1)),rr(t))}function p0(t,i,l){if((ct&6)!==0)throw Error(s(327));var p=!l&&(i&127)===0&&(i&t.expiredLanes)===0||ut(t,i),C=p?ew(t,i):_d(t,i,!0),k=p;do{if(C===0){bs&&!p&&Jr(t,i,0,!1);break}else{if(l=t.current.alternate,k&&!ZS(l)){C=_d(t,i,!1),k=!1;continue}if(C===2){if(k=i,t.errorRecoveryDisabledLanes&k)var I=0;else I=t.pendingLanes&-536870913,I=I!==0?I:I&536870912?536870912:0;if(I!==0){i=I;e:{var H=t;C=ka;var V=H.current.memoizedState.isDehydrated;if(V&&(Ss(H,I).flags|=256),I=_d(H,I,!1),I!==2){if(pd&&!V){H.errorRecoveryDisabledLanes|=k,Ti|=k,C=4;break e}k=yn,yn=C,k!==null&&(yn===null?yn=k:yn.push.apply(yn,k))}C=I}if(k=!1,C!==2)continue}}if(C===1){Ss(t,0),Jr(t,i,0,!0);break}e:{switch(p=t,k=C,k){case 0:case 1:throw Error(s(345));case 4:if((i&4194048)!==i)break;case 6:Jr(p,i,kn,!Vr);break e;case 2:yn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((i&62914560)===i&&(C=cl+300-xt(),10<C)){if(Jr(p,i,kn,!Vr),mt(p,0,!0)!==0)break e;Rr=i,p.timeoutHandle=Q0(g0.bind(null,p,l,yn,dl,md,i,kn,Ti,xs,Vr,k,"Throttled",-0,0),C);break e}g0(p,l,yn,dl,md,i,kn,Ti,xs,Vr,k,null,-0,0)}}break}while(!0);rr(t)}function g0(t,i,l,p,C,k,I,H,V,oe,ge,ye,ce,he){if(t.timeoutHandle=-1,ye=i.subtreeFlags,ye&8192||(ye&16785408)===16785408){ye={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:gr},o0(i,k,ye);var De=(k&62914560)===k?cl-xt():(k&4194048)===k?d0-xt():0;if(De=Mw(ye,De),De!==null){Rr=k,t.cancelPendingCommit=De(w0.bind(null,t,i,k,l,p,C,I,H,V,ge,ye,null,ce,he)),Jr(t,k,I,!oe);return}}w0(t,i,k,l,p,C,I,H,V)}function ZS(t){for(var i=t;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var p=0;p<l.length;p++){var C=l[p],k=C.getSnapshot;C=C.value;try{if(!Sn(k(),C))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Jr(t,i,l,p){i&=~gd,i&=~Ti,t.suspendedLanes|=i,t.pingedLanes&=~i,p&&(t.warmLanes|=i),p=t.expirationTimes;for(var C=i;0<C;){var k=31-xe(C),I=1<<k;p[k]=-1,C&=~I}l!==0&&Cp(t,l,i)}function hl(){return(ct&6)===0?(Ta(0),!1):!0}function xd(){if(Ze!==null){if(dt===0)var t=Ze.return;else t=Ze,br=xi=null,Mu(t),hs=null,da=0,t=Ze;for(;t!==null;)Gm(t.alternate,t),t=t.return;Ze=null}}function Ss(t,i){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,vw(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Rr=0,xd(),_t=t,Ze=l=yr(t.current,null),tt=i,dt=0,En=null,Vr=!1,bs=ut(t,i),pd=!1,xs=kn=gd=Ti=Xr=Lt=0,yn=ka=null,md=!1,(i&8)!==0&&(i|=i&32);var p=t.entangledLanes;if(p!==0)for(t=t.entanglements,p&=i;0<p;){var C=31-xe(p),k=1<<C;i|=t[C],p&=~k}return Tr=i,Bo(),l}function m0(t,i){Ge=null,W.H=ba,i===ds||i===Ho?(i=Dg(),dt=3):i===Au?(i=Dg(),dt=4):dt=i===Zu?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,En=i,Ze===null&&(Lt=1,tl(t,Mn(i,t.current)))}function y0(){var t=An.current;return t===null?!0:(tt&4194048)===tt?Pn===null:(tt&62914560)===tt||(tt&536870912)!==0?t===Pn:!1}function v0(){var t=W.H;return W.H=ba,t===null?ba:t}function b0(){var t=W.A;return W.A=XS,t}function fl(){Lt=4,Vr||(tt&4194048)!==tt&&An.current!==null||(bs=!0),(Xr&134217727)===0&&(Ti&134217727)===0||_t===null||Jr(_t,tt,kn,!1)}function _d(t,i,l){var p=ct;ct|=2;var C=v0(),k=b0();(_t!==t||tt!==i)&&(dl=null,Ss(t,i)),i=!1;var I=Lt;e:do try{if(dt!==0&&Ze!==null){var H=Ze,V=En;switch(dt){case 8:xd(),I=6;break e;case 3:case 2:case 9:case 6:An.current===null&&(i=!0);var oe=dt;if(dt=0,En=null,ws(t,H,V,oe),l&&bs){I=0;break e}break;default:oe=dt,dt=0,En=null,ws(t,H,V,oe)}}JS(),I=Lt;break}catch(ge){m0(t,ge)}while(!0);return i&&t.shellSuspendCounter++,br=xi=null,ct=p,W.H=C,W.A=k,Ze===null&&(_t=null,tt=0,Bo()),I}function JS(){for(;Ze!==null;)x0(Ze)}function ew(t,i){var l=ct;ct|=2;var p=v0(),C=b0();_t!==t||tt!==i?(dl=null,ul=xt()+500,Ss(t,i)):bs=ut(t,i);e:do try{if(dt!==0&&Ze!==null){i=Ze;var k=En;t:switch(dt){case 1:dt=0,En=null,ws(t,i,k,1);break;case 2:case 9:if(Rg(k)){dt=0,En=null,_0(i);break}i=function(){dt!==2&&dt!==9||_t!==t||(dt=7),rr(t)},k.then(i,i);break e;case 3:dt=7;break e;case 4:dt=5;break e;case 7:Rg(k)?(dt=0,En=null,_0(i)):(dt=0,En=null,ws(t,i,k,7));break;case 5:var I=null;switch(Ze.tag){case 26:I=Ze.memoizedState;case 5:case 27:var H=Ze;if(I?ay(I):H.stateNode.complete){dt=0,En=null;var V=H.sibling;if(V!==null)Ze=V;else{var oe=H.return;oe!==null?(Ze=oe,pl(oe)):Ze=null}break t}}dt=0,En=null,ws(t,i,k,5);break;case 6:dt=0,En=null,ws(t,i,k,6);break;case 8:xd(),Lt=6;break e;default:throw Error(s(462))}}tw();break}catch(ge){m0(t,ge)}while(!0);return br=xi=null,W.H=p,W.A=C,ct=l,Ze!==null?0:(_t=null,tt=0,Bo(),Lt)}function tw(){for(;Ze!==null&&!Mt();)x0(Ze)}function x0(t){var i=qm(t.alternate,t,Tr);t.memoizedProps=t.pendingProps,i===null?pl(t):Ze=i}function _0(t){var i=t,l=i.alternate;switch(i.tag){case 15:case 0:i=zm(l,i,i.pendingProps,i.type,void 0,tt);break;case 11:i=zm(l,i,i.pendingProps,i.type.render,i.ref,tt);break;case 5:Mu(i);default:Gm(l,i),i=Ze=bg(i,Tr),i=qm(l,i,Tr)}t.memoizedProps=t.pendingProps,i===null?pl(t):Ze=i}function ws(t,i,l,p){br=xi=null,Mu(i),hs=null,da=0;var C=i.return;try{if($S(t,C,i,l,tt)){Lt=1,tl(t,Mn(l,t.current)),Ze=null;return}}catch(k){if(C!==null)throw Ze=C,k;Lt=1,tl(t,Mn(l,t.current)),Ze=null;return}i.flags&32768?(rt||p===1?t=!0:bs||(tt&536870912)!==0?t=!1:(Vr=t=!0,(p===2||p===9||p===3||p===6)&&(p=An.current,p!==null&&p.tag===13&&(p.flags|=16384))),S0(i,t)):pl(i)}function pl(t){var i=t;do{if((i.flags&32768)!==0){S0(i,Vr);return}t=i.return;var l=GS(i.alternate,i,Tr);if(l!==null){Ze=l;return}if(i=i.sibling,i!==null){Ze=i;return}Ze=i=t}while(i!==null);Lt===0&&(Lt=5)}function S0(t,i){do{var l=WS(t.alternate,t);if(l!==null){l.flags&=32767,Ze=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(t=t.sibling,t!==null)){Ze=t;return}Ze=t=l}while(t!==null);Lt=6,Ze=null}function w0(t,i,l,p,C,k,I,H,V){t.cancelPendingCommit=null;do gl();while(Gt!==0);if((ct&6)!==0)throw Error(s(327));if(i!==null){if(i===t.current)throw Error(s(177));if(k=i.lanes|i.childLanes,k|=cu,I1(t,l,k,I,H,V),t===_t&&(Ze=_t=null,tt=0),_s=i,Zr=t,Rr=l,yd=k,vd=C,h0=p,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,sw(je,function(){return N0(),null})):(t.callbackNode=null,t.callbackPriority=0),p=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||p){p=W.T,W.T=null,C=Y.p,Y.p=2,I=ct,ct|=4;try{KS(t,i,l)}finally{ct=I,Y.p=C,W.T=p}}Gt=1,A0(),C0(),E0()}}function A0(){if(Gt===1){Gt=0;var t=Zr,i=_s,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=W.T,W.T=null;var p=Y.p;Y.p=2;var C=ct;ct|=4;try{i0(i,t);var k=Bd,I=ug(t.containerInfo),H=k.focusedElem,V=k.selectionRange;if(I!==H&&H&&H.ownerDocument&&cg(H.ownerDocument.documentElement,H)){if(V!==null&&iu(H)){var oe=V.start,ge=V.end;if(ge===void 0&&(ge=oe),"selectionStart"in H)H.selectionStart=oe,H.selectionEnd=Math.min(ge,H.value.length);else{var ye=H.ownerDocument||document,ce=ye&&ye.defaultView||window;if(ce.getSelection){var he=ce.getSelection(),De=H.textContent.length,He=Math.min(V.start,De),bt=V.end===void 0?He:Math.min(V.end,De);!he.extend&&He>bt&&(I=bt,bt=He,He=I);var re=lg(H,He),ee=lg(H,bt);if(re&&ee&&(he.rangeCount!==1||he.anchorNode!==re.node||he.anchorOffset!==re.offset||he.focusNode!==ee.node||he.focusOffset!==ee.offset)){var ae=ye.createRange();ae.setStart(re.node,re.offset),he.removeAllRanges(),He>bt?(he.addRange(ae),he.extend(ee.node,ee.offset)):(ae.setEnd(ee.node,ee.offset),he.addRange(ae))}}}}for(ye=[],he=H;he=he.parentNode;)he.nodeType===1&&ye.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof H.focus=="function"&&H.focus(),H=0;H<ye.length;H++){var me=ye[H];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}kl=!!Dd,Bd=Dd=null}finally{ct=C,Y.p=p,W.T=l}}t.current=i,Gt=2}}function C0(){if(Gt===2){Gt=0;var t=Zr,i=_s,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=W.T,W.T=null;var p=Y.p;Y.p=2;var C=ct;ct|=4;try{Jm(t,i.alternate,i)}finally{ct=C,Y.p=p,W.T=l}}Gt=3}}function E0(){if(Gt===4||Gt===3){Gt=0,st();var t=Zr,i=_s,l=Rr,p=h0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Gt=5:(Gt=0,_s=Zr=null,k0(t,t.pendingLanes));var C=t.pendingLanes;if(C===0&&(Yr=null),Fc(l),i=i.stateNode,Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(Ot,i,void 0,(i.current.flags&128)===128)}catch{}if(p!==null){i=W.T,C=Y.p,Y.p=2,W.T=null;try{for(var k=t.onRecoverableError,I=0;I<p.length;I++){var H=p[I];k(H.value,{componentStack:H.stack})}}finally{W.T=i,Y.p=C}}(Rr&3)!==0&&gl(),rr(t),C=t.pendingLanes,(l&261930)!==0&&(C&42)!==0?t===bd?Na++:(Na=0,bd=t):Na=0,Ta(0)}}function k0(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,ca(i)))}function gl(){return A0(),C0(),E0(),N0()}function N0(){if(Gt!==5)return!1;var t=Zr,i=yd;yd=0;var l=Fc(Rr),p=W.T,C=Y.p;try{Y.p=32>l?32:l,W.T=null,l=vd,vd=null;var k=Zr,I=Rr;if(Gt=0,_s=Zr=null,Rr=0,(ct&6)!==0)throw Error(s(331));var H=ct;if(ct|=4,c0(k.current),a0(k,k.current,I,l),ct=H,Ta(0,!1),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(Ot,k)}catch{}return!0}finally{Y.p=C,W.T=p,k0(t,i)}}function T0(t,i,l){i=Mn(l,i),i=Yu(t.stateNode,i,2),t=Qr(t,i,2),t!==null&&(Vs(t,2),rr(t))}function ht(t,i,l){if(t.tag===3)T0(t,t,l);else for(;i!==null;){if(i.tag===3){T0(i,t,l);break}else if(i.tag===1){var p=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Yr===null||!Yr.has(p))){t=Mn(l,t),l=Rm(2),p=Qr(i,l,2),p!==null&&(jm(l,p,i,t),Vs(p,2),rr(p));break}}i=i.return}}function Sd(t,i,l){var p=t.pingCache;if(p===null){p=t.pingCache=new YS;var C=new Set;p.set(i,C)}else C=p.get(i),C===void 0&&(C=new Set,p.set(i,C));C.has(l)||(pd=!0,C.add(l),t=nw.bind(null,t,i,l),i.then(t,t))}function nw(t,i,l){var p=t.pingCache;p!==null&&p.delete(i),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,_t===t&&(tt&l)===l&&(Lt===4||Lt===3&&(tt&62914560)===tt&&300>xt()-cl?(ct&2)===0&&Ss(t,0):gd|=l,xs===tt&&(xs=0)),rr(t)}function R0(t,i){i===0&&(i=Ap()),t=yi(t,i),t!==null&&(Vs(t,i),rr(t))}function rw(t){var i=t.memoizedState,l=0;i!==null&&(l=i.retryLane),R0(t,l)}function iw(t,i){var l=0;switch(t.tag){case 31:case 13:var p=t.stateNode,C=t.memoizedState;C!==null&&(l=C.retryLane);break;case 19:p=t.stateNode;break;case 22:p=t.stateNode._retryCache;break;default:throw Error(s(314))}p!==null&&p.delete(i),R0(t,l)}function sw(t,i){return Ce(t,i)}var ml=null,As=null,wd=!1,yl=!1,Ad=!1,ei=0;function rr(t){t!==As&&t.next===null&&(As===null?ml=As=t:As=As.next=t),yl=!0,wd||(wd=!0,ow())}function Ta(t,i){if(!Ad&&yl){Ad=!0;do for(var l=!1,p=ml;p!==null;){if(t!==0){var C=p.pendingLanes;if(C===0)var k=0;else{var I=p.suspendedLanes,H=p.pingedLanes;k=(1<<31-xe(42|t)+1)-1,k&=C&~(I&~H),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(l=!0,I0(p,k))}else k=tt,k=mt(p,p===_t?k:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(k&3)===0||ut(p,k)||(l=!0,I0(p,k));p=p.next}while(l);Ad=!1}}function aw(){j0()}function j0(){yl=wd=!1;var t=0;ei!==0&&yw()&&(t=ei);for(var i=xt(),l=null,p=ml;p!==null;){var C=p.next,k=D0(p,i);k===0?(p.next=null,l===null?ml=C:l.next=C,C===null&&(As=l)):(l=p,(t!==0||(k&3)!==0)&&(yl=!0)),p=C}Gt!==0&&Gt!==5||Ta(t),ei!==0&&(ei=0)}function D0(t,i){for(var l=t.suspendedLanes,p=t.pingedLanes,C=t.expirationTimes,k=t.pendingLanes&-62914561;0<k;){var I=31-xe(k),H=1<<I,V=C[I];V===-1?((H&l)===0||(H&p)!==0)&&(C[I]=Jn(H,i)):V<=i&&(t.expiredLanes|=H),k&=~H}if(i=_t,l=tt,l=mt(t,t===i?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),p=t.callbackNode,l===0||t===i&&(dt===2||dt===9)||t.cancelPendingCommit!==null)return p!==null&&p!==null&&Kt(p),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||ut(t,l)){if(i=l&-l,i===t.callbackPriority)return i;switch(p!==null&&Kt(p),Fc(l)){case 2:case 8:l=_e;break;case 32:l=je;break;case 268435456:l=$e;break;default:l=je}return p=B0.bind(null,t),l=Ce(l,p),t.callbackPriority=i,t.callbackNode=l,i}return p!==null&&p!==null&&Kt(p),t.callbackPriority=2,t.callbackNode=null,2}function B0(t,i){if(Gt!==0&&Gt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(gl()&&t.callbackNode!==l)return null;var p=tt;return p=mt(t,t===_t?p:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),p===0?null:(p0(t,p,i),D0(t,xt()),t.callbackNode!=null&&t.callbackNode===l?B0.bind(null,t):null)}function I0(t,i){if(gl())return null;p0(t,i,!0)}function ow(){bw(function(){(ct&6)!==0?Ce(fe,aw):j0()})}function Cd(){if(ei===0){var t=cs;t===0&&(t=ie,ie<<=1,(ie&261888)===0&&(ie=256)),ei=t}return ei}function L0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Co(""+t)}function M0(t,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,t.id&&l.setAttribute("form",t.id),i.parentNode.insertBefore(l,i),t=new FormData(t),l.parentNode.removeChild(l),t}function lw(t,i,l,p,C){if(i==="submit"&&l&&l.stateNode===C){var k=L0((C[hn]||null).action),I=p.submitter;I&&(i=(i=I[hn]||null)?L0(i.formAction):I.getAttribute("formAction"),i!==null&&(k=i,I=null));var H=new To("action","action",null,p,C);t.push({event:H,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(ei!==0){var V=I?M0(C,I):new FormData(C);Qu(l,{pending:!0,data:V,method:C.method,action:k},null,V)}}else typeof k=="function"&&(H.preventDefault(),V=I?M0(C,I):new FormData(C),Qu(l,{pending:!0,data:V,method:C.method,action:k},k,V))},currentTarget:C}]})}}for(var Ed=0;Ed<lu.length;Ed++){var kd=lu[Ed],cw=kd.toLowerCase(),uw=kd[0].toUpperCase()+kd.slice(1);Wn(cw,"on"+uw)}Wn(fg,"onAnimationEnd"),Wn(pg,"onAnimationIteration"),Wn(gg,"onAnimationStart"),Wn("dblclick","onDoubleClick"),Wn("focusin","onFocus"),Wn("focusout","onBlur"),Wn(ES,"onTransitionRun"),Wn(kS,"onTransitionStart"),Wn(NS,"onTransitionCancel"),Wn(mg,"onTransitionEnd"),Vi("onMouseEnter",["mouseout","mouseover"]),Vi("onMouseLeave",["mouseout","mouseover"]),Vi("onPointerEnter",["pointerout","pointerover"]),Vi("onPointerLeave",["pointerout","pointerover"]),fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fi("onBeforeInput",["compositionend","keypress","textInput","paste"]),fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ra="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(" "),dw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ra));function O0(t,i){i=(i&4)!==0;for(var l=0;l<t.length;l++){var p=t[l],C=p.event;p=p.listeners;e:{var k=void 0;if(i)for(var I=p.length-1;0<=I;I--){var H=p[I],V=H.instance,oe=H.currentTarget;if(H=H.listener,V!==k&&C.isPropagationStopped())break e;k=H,C.currentTarget=oe;try{k(C)}catch(ge){Do(ge)}C.currentTarget=null,k=V}else for(I=0;I<p.length;I++){if(H=p[I],V=H.instance,oe=H.currentTarget,H=H.listener,V!==k&&C.isPropagationStopped())break e;k=H,C.currentTarget=oe;try{k(C)}catch(ge){Do(ge)}C.currentTarget=null,k=V}}}}function Je(t,i){var l=i[Pc];l===void 0&&(l=i[Pc]=new Set);var p=t+"__bubble";l.has(p)||(z0(i,t,2,!1),l.add(p))}function Nd(t,i,l){var p=0;i&&(p|=4),z0(l,t,p,i)}var vl="_reactListening"+Math.random().toString(36).slice(2);function Td(t){if(!t[vl]){t[vl]=!0,jp.forEach(function(l){l!=="selectionchange"&&(dw.has(l)||Nd(l,!1,t),Nd(l,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[vl]||(i[vl]=!0,Nd("selectionchange",!1,i))}}function z0(t,i,l,p){switch(fy(i)){case 2:var C=Fw;break;case 8:C=Pw;break;default:C=qd}l=C.bind(null,i,l,t),C=void 0,!Vc||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(C=!0),p?C!==void 0?t.addEventListener(i,l,{capture:!0,passive:C}):t.addEventListener(i,l,!0):C!==void 0?t.addEventListener(i,l,{passive:C}):t.addEventListener(i,l,!1)}function Rd(t,i,l,p,C){var k=p;if((i&1)===0&&(i&2)===0&&p!==null)e:for(;;){if(p===null)return;var I=p.tag;if(I===3||I===4){var H=p.stateNode.containerInfo;if(H===C)break;if(I===4)for(I=p.return;I!==null;){var V=I.tag;if((V===3||V===4)&&I.stateNode.containerInfo===C)return;I=I.return}for(;H!==null;){if(I=Gi(H),I===null)return;if(V=I.tag,V===5||V===6||V===26||V===27){p=k=I;continue e}H=H.parentNode}}p=p.return}$p(function(){var oe=k,ge=Wc(l),ye=[];e:{var ce=yg.get(t);if(ce!==void 0){var he=To,De=t;switch(t){case"keypress":if(ko(l)===0)break e;case"keydown":case"keyup":he=iS;break;case"focusin":De="focus",he=Jc;break;case"focusout":De="blur",he=Jc;break;case"beforeblur":case"afterblur":he=Jc;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=Gp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=G1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=oS;break;case fg:case pg:case gg:he=V1;break;case mg:he=cS;break;case"scroll":case"scrollend":he=q1;break;case"wheel":he=dS;break;case"copy":case"cut":case"paste":he=Y1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=Kp;break;case"toggle":case"beforetoggle":he=fS}var He=(i&4)!==0,bt=!He&&(t==="scroll"||t==="scrollend"),re=He?ce!==null?ce+"Capture":null:ce;He=[];for(var ee=oe,ae;ee!==null;){var me=ee;if(ae=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ae===null||re===null||(me=Zs(ee,re),me!=null&&He.push(ja(ee,me,ae))),bt)break;ee=ee.return}0<He.length&&(ce=new he(ce,De,null,l,ge),ye.push({event:ce,listeners:He}))}}if((i&7)===0){e:{if(ce=t==="mouseover"||t==="pointerover",he=t==="mouseout"||t==="pointerout",ce&&l!==Gc&&(De=l.relatedTarget||l.fromElement)&&(Gi(De)||De[Qi]))break e;if((he||ce)&&(ce=ge.window===ge?ge:(ce=ge.ownerDocument)?ce.defaultView||ce.parentWindow:window,he?(De=l.relatedTarget||l.toElement,he=oe,De=De?Gi(De):null,De!==null&&(bt=u(De),He=De.tag,De!==bt||He!==5&&He!==27&&He!==6)&&(De=null)):(he=null,De=oe),he!==De)){if(He=Gp,me="onMouseLeave",re="onMouseEnter",ee="mouse",(t==="pointerout"||t==="pointerover")&&(He=Kp,me="onPointerLeave",re="onPointerEnter",ee="pointer"),bt=he==null?ce:Ys(he),ae=De==null?ce:Ys(De),ce=new He(me,ee+"leave",he,l,ge),ce.target=bt,ce.relatedTarget=ae,me=null,Gi(ge)===oe&&(He=new He(re,ee+"enter",De,l,ge),He.target=ae,He.relatedTarget=bt,me=He),bt=me,he&&De)t:{for(He=hw,re=he,ee=De,ae=0,me=re;me;me=He(me))ae++;me=0;for(var ze=ee;ze;ze=He(ze))me++;for(;0<ae-me;)re=He(re),ae--;for(;0<me-ae;)ee=He(ee),me--;for(;ae--;){if(re===ee||ee!==null&&re===ee.alternate){He=re;break t}re=He(re),ee=He(ee)}He=null}else He=null;he!==null&&F0(ye,ce,he,He,!1),De!==null&&bt!==null&&F0(ye,bt,De,He,!0)}}e:{if(ce=oe?Ys(oe):window,he=ce.nodeName&&ce.nodeName.toLowerCase(),he==="select"||he==="input"&&ce.type==="file")var ot=ng;else if(eg(ce))if(rg)ot=wS;else{ot=_S;var Ie=xS}else he=ce.nodeName,!he||he.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?oe&&Qc(oe.elementType)&&(ot=ng):ot=SS;if(ot&&(ot=ot(t,oe))){tg(ye,ot,l,ge);break e}Ie&&Ie(t,ce,oe),t==="focusout"&&oe&&ce.type==="number"&&oe.memoizedProps.value!=null&&qc(ce,"number",ce.value)}switch(Ie=oe?Ys(oe):window,t){case"focusin":(eg(Ie)||Ie.contentEditable==="true")&&(ts=Ie,su=oe,aa=null);break;case"focusout":aa=su=ts=null;break;case"mousedown":au=!0;break;case"contextmenu":case"mouseup":case"dragend":au=!1,dg(ye,l,ge);break;case"selectionchange":if(CS)break;case"keydown":case"keyup":dg(ye,l,ge)}var We;if(tu)e:{switch(t){case"compositionstart":var nt="onCompositionStart";break e;case"compositionend":nt="onCompositionEnd";break e;case"compositionupdate":nt="onCompositionUpdate";break e}nt=void 0}else es?Zp(t,l)&&(nt="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(nt="onCompositionStart");nt&&(Vp&&l.locale!=="ko"&&(es||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&es&&(We=qp()):(zr=ge,Xc="value"in zr?zr.value:zr.textContent,es=!0)),Ie=bl(oe,nt),0<Ie.length&&(nt=new Wp(nt,t,null,l,ge),ye.push({event:nt,listeners:Ie}),We?nt.data=We:(We=Jp(l),We!==null&&(nt.data=We)))),(We=gS?mS(t,l):yS(t,l))&&(nt=bl(oe,"onBeforeInput"),0<nt.length&&(Ie=new Wp("onBeforeInput","beforeinput",null,l,ge),ye.push({event:Ie,listeners:nt}),Ie.data=We)),lw(ye,t,oe,l,ge)}O0(ye,i)})}function ja(t,i,l){return{instance:t,listener:i,currentTarget:l}}function bl(t,i){for(var l=i+"Capture",p=[];t!==null;){var C=t,k=C.stateNode;if(C=C.tag,C!==5&&C!==26&&C!==27||k===null||(C=Zs(t,l),C!=null&&p.unshift(ja(t,C,k)),C=Zs(t,i),C!=null&&p.push(ja(t,C,k))),t.tag===3)return p;t=t.return}return[]}function hw(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function F0(t,i,l,p,C){for(var k=i._reactName,I=[];l!==null&&l!==p;){var H=l,V=H.alternate,oe=H.stateNode;if(H=H.tag,V!==null&&V===p)break;H!==5&&H!==26&&H!==27||oe===null||(V=oe,C?(oe=Zs(l,k),oe!=null&&I.unshift(ja(l,oe,V))):C||(oe=Zs(l,k),oe!=null&&I.push(ja(l,oe,V)))),l=l.return}I.length!==0&&t.push({event:i,listeners:I})}var fw=/\r\n?/g,pw=/\u0000|\uFFFD/g;function P0(t){return(typeof t=="string"?t:""+t).replace(fw,`
|
|
49
|
+
`).replace(pw,"")}function H0(t,i){return i=P0(i),P0(t)===i}function vt(t,i,l,p,C,k){switch(l){case"children":typeof p=="string"?i==="body"||i==="textarea"&&p===""||Yi(t,p):(typeof p=="number"||typeof p=="bigint")&&i!=="body"&&Yi(t,""+p);break;case"className":wo(t,"class",p);break;case"tabIndex":wo(t,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":wo(t,l,p);break;case"style":Hp(t,p,k);break;case"data":if(i!=="object"){wo(t,"data",p);break}case"src":case"href":if(p===""&&(i!=="a"||l!=="href")){t.removeAttribute(l);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){t.removeAttribute(l);break}p=Co(""+p),t.setAttribute(l,p);break;case"action":case"formAction":if(typeof p=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof k=="function"&&(l==="formAction"?(i!=="input"&&vt(t,i,"name",C.name,C,null),vt(t,i,"formEncType",C.formEncType,C,null),vt(t,i,"formMethod",C.formMethod,C,null),vt(t,i,"formTarget",C.formTarget,C,null)):(vt(t,i,"encType",C.encType,C,null),vt(t,i,"method",C.method,C,null),vt(t,i,"target",C.target,C,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){t.removeAttribute(l);break}p=Co(""+p),t.setAttribute(l,p);break;case"onClick":p!=null&&(t.onclick=gr);break;case"onScroll":p!=null&&Je("scroll",t);break;case"onScrollEnd":p!=null&&Je("scrollend",t);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(s(61));if(l=p.__html,l!=null){if(C.children!=null)throw Error(s(60));t.innerHTML=l}}break;case"multiple":t.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":t.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){t.removeAttribute("xlink:href");break}l=Co(""+p),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?t.setAttribute(l,""+p):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":p===!0?t.setAttribute(l,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?t.setAttribute(l,p):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?t.setAttribute(l,p):t.removeAttribute(l);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?t.removeAttribute(l):t.setAttribute(l,p);break;case"popover":Je("beforetoggle",t),Je("toggle",t),So(t,"popover",p);break;case"xlinkActuate":pr(t,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":pr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":pr(t,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":pr(t,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":pr(t,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":pr(t,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":pr(t,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":pr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":pr(t,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":So(t,"is",p);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=U1.get(l)||l,So(t,l,p))}}function jd(t,i,l,p,C,k){switch(l){case"style":Hp(t,p,k);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(s(61));if(l=p.__html,l!=null){if(C.children!=null)throw Error(s(60));t.innerHTML=l}}break;case"children":typeof p=="string"?Yi(t,p):(typeof p=="number"||typeof p=="bigint")&&Yi(t,""+p);break;case"onScroll":p!=null&&Je("scroll",t);break;case"onScrollEnd":p!=null&&Je("scrollend",t);break;case"onClick":p!=null&&(t.onclick=gr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Dp.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(C=l.endsWith("Capture"),i=l.slice(2,C?l.length-7:void 0),k=t[hn]||null,k=k!=null?k[l]:null,typeof k=="function"&&t.removeEventListener(i,k,C),typeof p=="function")){typeof k!="function"&&k!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(i,p,C);break e}l in t?t[l]=p:p===!0?t.setAttribute(l,""):So(t,l,p)}}}function sn(t,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Je("error",t),Je("load",t);var p=!1,C=!1,k;for(k in l)if(l.hasOwnProperty(k)){var I=l[k];if(I!=null)switch(k){case"src":p=!0;break;case"srcSet":C=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:vt(t,i,k,I,l,null)}}C&&vt(t,i,"srcSet",l.srcSet,l,null),p&&vt(t,i,"src",l.src,l,null);return;case"input":Je("invalid",t);var H=k=I=C=null,V=null,oe=null;for(p in l)if(l.hasOwnProperty(p)){var ge=l[p];if(ge!=null)switch(p){case"name":C=ge;break;case"type":I=ge;break;case"checked":V=ge;break;case"defaultChecked":oe=ge;break;case"value":k=ge;break;case"defaultValue":H=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(s(137,i));break;default:vt(t,i,p,ge,l,null)}}Op(t,k,H,V,oe,I,C,!1);return;case"select":Je("invalid",t),p=I=k=null;for(C in l)if(l.hasOwnProperty(C)&&(H=l[C],H!=null))switch(C){case"value":k=H;break;case"defaultValue":I=H;break;case"multiple":p=H;default:vt(t,i,C,H,l,null)}i=k,l=I,t.multiple=!!p,i!=null?Xi(t,!!p,i,!1):l!=null&&Xi(t,!!p,l,!0);return;case"textarea":Je("invalid",t),k=C=p=null;for(I in l)if(l.hasOwnProperty(I)&&(H=l[I],H!=null))switch(I){case"value":p=H;break;case"defaultValue":C=H;break;case"children":k=H;break;case"dangerouslySetInnerHTML":if(H!=null)throw Error(s(91));break;default:vt(t,i,I,H,l,null)}Fp(t,p,C,k);return;case"option":for(V in l)if(l.hasOwnProperty(V)&&(p=l[V],p!=null))switch(V){case"selected":t.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:vt(t,i,V,p,l,null)}return;case"dialog":Je("beforetoggle",t),Je("toggle",t),Je("cancel",t),Je("close",t);break;case"iframe":case"object":Je("load",t);break;case"video":case"audio":for(p=0;p<Ra.length;p++)Je(Ra[p],t);break;case"image":Je("error",t),Je("load",t);break;case"details":Je("toggle",t);break;case"embed":case"source":case"link":Je("error",t),Je("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(oe in l)if(l.hasOwnProperty(oe)&&(p=l[oe],p!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:vt(t,i,oe,p,l,null)}return;default:if(Qc(i)){for(ge in l)l.hasOwnProperty(ge)&&(p=l[ge],p!==void 0&&jd(t,i,ge,p,l,void 0));return}}for(H in l)l.hasOwnProperty(H)&&(p=l[H],p!=null&&vt(t,i,H,p,l,null))}function gw(t,i,l,p){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var C=null,k=null,I=null,H=null,V=null,oe=null,ge=null;for(he in l){var ye=l[he];if(l.hasOwnProperty(he)&&ye!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":V=ye;default:p.hasOwnProperty(he)||vt(t,i,he,null,p,ye)}}for(var ce in p){var he=p[ce];if(ye=l[ce],p.hasOwnProperty(ce)&&(he!=null||ye!=null))switch(ce){case"type":k=he;break;case"name":C=he;break;case"checked":oe=he;break;case"defaultChecked":ge=he;break;case"value":I=he;break;case"defaultValue":H=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(s(137,i));break;default:he!==ye&&vt(t,i,ce,he,p,ye)}}$c(t,I,H,V,oe,ge,k,C);return;case"select":he=I=H=ce=null;for(k in l)if(V=l[k],l.hasOwnProperty(k)&&V!=null)switch(k){case"value":break;case"multiple":he=V;default:p.hasOwnProperty(k)||vt(t,i,k,null,p,V)}for(C in p)if(k=p[C],V=l[C],p.hasOwnProperty(C)&&(k!=null||V!=null))switch(C){case"value":ce=k;break;case"defaultValue":H=k;break;case"multiple":I=k;default:k!==V&&vt(t,i,C,k,p,V)}i=H,l=I,p=he,ce!=null?Xi(t,!!l,ce,!1):!!p!=!!l&&(i!=null?Xi(t,!!l,i,!0):Xi(t,!!l,l?[]:"",!1));return;case"textarea":he=ce=null;for(H in l)if(C=l[H],l.hasOwnProperty(H)&&C!=null&&!p.hasOwnProperty(H))switch(H){case"value":break;case"children":break;default:vt(t,i,H,null,p,C)}for(I in p)if(C=p[I],k=l[I],p.hasOwnProperty(I)&&(C!=null||k!=null))switch(I){case"value":ce=C;break;case"defaultValue":he=C;break;case"children":break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(s(91));break;default:C!==k&&vt(t,i,I,C,p,k)}zp(t,ce,he);return;case"option":for(var De in l)if(ce=l[De],l.hasOwnProperty(De)&&ce!=null&&!p.hasOwnProperty(De))switch(De){case"selected":t.selected=!1;break;default:vt(t,i,De,null,p,ce)}for(V in p)if(ce=p[V],he=l[V],p.hasOwnProperty(V)&&ce!==he&&(ce!=null||he!=null))switch(V){case"selected":t.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:vt(t,i,V,ce,p,he)}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 He in l)ce=l[He],l.hasOwnProperty(He)&&ce!=null&&!p.hasOwnProperty(He)&&vt(t,i,He,null,p,ce);for(oe in p)if(ce=p[oe],he=l[oe],p.hasOwnProperty(oe)&&ce!==he&&(ce!=null||he!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(s(137,i));break;default:vt(t,i,oe,ce,p,he)}return;default:if(Qc(i)){for(var bt in l)ce=l[bt],l.hasOwnProperty(bt)&&ce!==void 0&&!p.hasOwnProperty(bt)&&jd(t,i,bt,void 0,p,ce);for(ge in p)ce=p[ge],he=l[ge],!p.hasOwnProperty(ge)||ce===he||ce===void 0&&he===void 0||jd(t,i,ge,ce,p,he);return}}for(var re in l)ce=l[re],l.hasOwnProperty(re)&&ce!=null&&!p.hasOwnProperty(re)&&vt(t,i,re,null,p,ce);for(ye in p)ce=p[ye],he=l[ye],!p.hasOwnProperty(ye)||ce===he||ce==null&&he==null||vt(t,i,ye,ce,p,he)}function U0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function mw(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,l=performance.getEntriesByType("resource"),p=0;p<l.length;p++){var C=l[p],k=C.transferSize,I=C.initiatorType,H=C.duration;if(k&&H&&U0(I)){for(I=0,H=C.responseEnd,p+=1;p<l.length;p++){var V=l[p],oe=V.startTime;if(oe>H)break;var ge=V.transferSize,ye=V.initiatorType;ge&&U0(ye)&&(V=V.responseEnd,I+=ge*(V<H?1:(H-oe)/(V-oe)))}if(--p,i+=8*(k+I)/(C.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Dd=null,Bd=null;function xl(t){return t.nodeType===9?t:t.ownerDocument}function $0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function q0(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function Id(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Ld=null;function yw(){var t=window.event;return t&&t.type==="popstate"?t===Ld?!1:(Ld=t,!0):(Ld=null,!1)}var Q0=typeof setTimeout=="function"?setTimeout:void 0,vw=typeof clearTimeout=="function"?clearTimeout:void 0,G0=typeof Promise=="function"?Promise:void 0,bw=typeof queueMicrotask=="function"?queueMicrotask:typeof G0<"u"?function(t){return G0.resolve(null).then(t).catch(xw)}:Q0;function xw(t){setTimeout(function(){throw t})}function ti(t){return t==="head"}function W0(t,i){var l=i,p=0;do{var C=l.nextSibling;if(t.removeChild(l),C&&C.nodeType===8)if(l=C.data,l==="/$"||l==="/&"){if(p===0){t.removeChild(C),Ns(i);return}p--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")p++;else if(l==="html")Da(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,Da(l);for(var k=l.firstChild;k;){var I=k.nextSibling,H=k.nodeName;k[Xs]||H==="SCRIPT"||H==="STYLE"||H==="LINK"&&k.rel.toLowerCase()==="stylesheet"||l.removeChild(k),k=I}}else l==="body"&&Da(t.ownerDocument.body);l=C}while(l);Ns(i)}function K0(t,i){var l=t;t=0;do{var p=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),p&&p.nodeType===8)if(l=p.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=p}while(l)}function Md(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Md(l),Hc(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function _w(t,i,l,p){for(;t.nodeType===1;){var C=l;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!p&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(p){if(!t[Xs])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(k=t.getAttribute("rel"),k==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(k!==C.rel||t.getAttribute("href")!==(C.href==null||C.href===""?null:C.href)||t.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin)||t.getAttribute("title")!==(C.title==null?null:C.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(k=t.getAttribute("src"),(k!==(C.src==null?null:C.src)||t.getAttribute("type")!==(C.type==null?null:C.type)||t.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin))&&k&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var k=C.name==null?null:""+C.name;if(C.type==="hidden"&&t.getAttribute("name")===k)return t}else return t;if(t=Hn(t.nextSibling),t===null)break}return null}function Sw(t,i,l){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Hn(t.nextSibling),t===null))return null;return t}function V0(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=Hn(t.nextSibling),t===null))return null;return t}function Od(t){return t.data==="$?"||t.data==="$~"}function zd(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function ww(t,i){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||l.readyState!=="loading")i();else{var p=function(){i(),l.removeEventListener("DOMContentLoaded",p)};l.addEventListener("DOMContentLoaded",p),t._reactRetry=p}}function Hn(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var Fd=null;function X0(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(i===0)return Hn(t.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}t=t.nextSibling}return null}function Y0(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return t;i--}else l!=="/$"&&l!=="/&"||i++}t=t.previousSibling}return null}function Z0(t,i,l){switch(i=xl(l),t){case"html":if(t=i.documentElement,!t)throw Error(s(452));return t;case"head":if(t=i.head,!t)throw Error(s(453));return t;case"body":if(t=i.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function Da(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Hc(t)}var Un=new Map,J0=new Set;function _l(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var jr=Y.d;Y.d={f:Aw,r:Cw,D:Ew,C:kw,L:Nw,m:Tw,X:jw,S:Rw,M:Dw};function Aw(){var t=jr.f(),i=hl();return t||i}function Cw(t){var i=Wi(t);i!==null&&i.tag===5&&i.type==="form"?mm(i):jr.r(t)}var Cs=typeof document>"u"?null:document;function ey(t,i,l){var p=Cs;if(p&&typeof i=="string"&&i){var C=In(i);C='link[rel="'+t+'"][href="'+C+'"]',typeof l=="string"&&(C+='[crossorigin="'+l+'"]'),J0.has(C)||(J0.add(C),t={rel:t,crossOrigin:l,href:i},p.querySelector(C)===null&&(i=p.createElement("link"),sn(i,"link",t),Vt(i),p.head.appendChild(i)))}}function Ew(t){jr.D(t),ey("dns-prefetch",t,null)}function kw(t,i){jr.C(t,i),ey("preconnect",t,i)}function Nw(t,i,l){jr.L(t,i,l);var p=Cs;if(p&&t&&i){var C='link[rel="preload"][as="'+In(i)+'"]';i==="image"&&l&&l.imageSrcSet?(C+='[imagesrcset="'+In(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(C+='[imagesizes="'+In(l.imageSizes)+'"]')):C+='[href="'+In(t)+'"]';var k=C;switch(i){case"style":k=Es(t);break;case"script":k=ks(t)}Un.has(k)||(t=f({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:t,as:i},l),Un.set(k,t),p.querySelector(C)!==null||i==="style"&&p.querySelector(Ba(k))||i==="script"&&p.querySelector(Ia(k))||(i=p.createElement("link"),sn(i,"link",t),Vt(i),p.head.appendChild(i)))}}function Tw(t,i){jr.m(t,i);var l=Cs;if(l&&t){var p=i&&typeof i.as=="string"?i.as:"script",C='link[rel="modulepreload"][as="'+In(p)+'"][href="'+In(t)+'"]',k=C;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=ks(t)}if(!Un.has(k)&&(t=f({rel:"modulepreload",href:t},i),Un.set(k,t),l.querySelector(C)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Ia(k)))return}p=l.createElement("link"),sn(p,"link",t),Vt(p),l.head.appendChild(p)}}}function Rw(t,i,l){jr.S(t,i,l);var p=Cs;if(p&&t){var C=Ki(p).hoistableStyles,k=Es(t);i=i||"default";var I=C.get(k);if(!I){var H={loading:0,preload:null};if(I=p.querySelector(Ba(k)))H.loading=5;else{t=f({rel:"stylesheet",href:t,"data-precedence":i},l),(l=Un.get(k))&&Pd(t,l);var V=I=p.createElement("link");Vt(V),sn(V,"link",t),V._p=new Promise(function(oe,ge){V.onload=oe,V.onerror=ge}),V.addEventListener("load",function(){H.loading|=1}),V.addEventListener("error",function(){H.loading|=2}),H.loading|=4,Sl(I,i,p)}I={type:"stylesheet",instance:I,count:1,state:H},C.set(k,I)}}}function jw(t,i){jr.X(t,i);var l=Cs;if(l&&t){var p=Ki(l).hoistableScripts,C=ks(t),k=p.get(C);k||(k=l.querySelector(Ia(C)),k||(t=f({src:t,async:!0},i),(i=Un.get(C))&&Hd(t,i),k=l.createElement("script"),Vt(k),sn(k,"link",t),l.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},p.set(C,k))}}function Dw(t,i){jr.M(t,i);var l=Cs;if(l&&t){var p=Ki(l).hoistableScripts,C=ks(t),k=p.get(C);k||(k=l.querySelector(Ia(C)),k||(t=f({src:t,async:!0,type:"module"},i),(i=Un.get(C))&&Hd(t,i),k=l.createElement("script"),Vt(k),sn(k,"link",t),l.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},p.set(C,k))}}function ty(t,i,l,p){var C=(C=pe.current)?_l(C):null;if(!C)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=Es(l.href),l=Ki(C).hoistableStyles,p=l.get(i),p||(p={type:"style",instance:null,count:0,state:null},l.set(i,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=Es(l.href);var k=Ki(C).hoistableStyles,I=k.get(t);if(I||(C=C.ownerDocument||C,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(t,I),(k=C.querySelector(Ba(t)))&&!k._p&&(I.instance=k,I.state.loading=5),Un.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Un.set(t,l),k||Bw(C,t,l,I.state))),i&&p===null)throw Error(s(528,""));return I}if(i&&p!==null)throw Error(s(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ks(l),l=Ki(C).hoistableScripts,p=l.get(i),p||(p={type:"script",instance:null,count:0,state:null},l.set(i,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Es(t){return'href="'+In(t)+'"'}function Ba(t){return'link[rel="stylesheet"]['+t+"]"}function ny(t){return f({},t,{"data-precedence":t.precedence,precedence:null})}function Bw(t,i,l,p){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?p.loading=1:(i=t.createElement("link"),p.preload=i,i.addEventListener("load",function(){return p.loading|=1}),i.addEventListener("error",function(){return p.loading|=2}),sn(i,"link",l),Vt(i),t.head.appendChild(i))}function ks(t){return'[src="'+In(t)+'"]'}function Ia(t){return"script[async]"+t}function ry(t,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var p=t.querySelector('style[data-href~="'+In(l.href)+'"]');if(p)return i.instance=p,Vt(p),p;var C=f({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return p=(t.ownerDocument||t).createElement("style"),Vt(p),sn(p,"style",C),Sl(p,l.precedence,t),i.instance=p;case"stylesheet":C=Es(l.href);var k=t.querySelector(Ba(C));if(k)return i.state.loading|=4,i.instance=k,Vt(k),k;p=ny(l),(C=Un.get(C))&&Pd(p,C),k=(t.ownerDocument||t).createElement("link"),Vt(k);var I=k;return I._p=new Promise(function(H,V){I.onload=H,I.onerror=V}),sn(k,"link",p),i.state.loading|=4,Sl(k,l.precedence,t),i.instance=k;case"script":return k=ks(l.src),(C=t.querySelector(Ia(k)))?(i.instance=C,Vt(C),C):(p=l,(C=Un.get(k))&&(p=f({},l),Hd(p,C)),t=t.ownerDocument||t,C=t.createElement("script"),Vt(C),sn(C,"link",p),t.head.appendChild(C),i.instance=C);case"void":return null;default:throw Error(s(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(p=i.instance,i.state.loading|=4,Sl(p,l.precedence,t));return i.instance}function Sl(t,i,l){for(var p=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),C=p.length?p[p.length-1]:null,k=C,I=0;I<p.length;I++){var H=p[I];if(H.dataset.precedence===i)k=H;else if(k!==C)break}k?k.parentNode.insertBefore(t,k.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(t,i.firstChild))}function Pd(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function Hd(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var wl=null;function iy(t,i,l){if(wl===null){var p=new Map,C=wl=new Map;C.set(l,p)}else C=wl,p=C.get(l),p||(p=new Map,C.set(l,p));if(p.has(t))return p;for(p.set(t,null),l=l.getElementsByTagName(t),C=0;C<l.length;C++){var k=l[C];if(!(k[Xs]||k[en]||t==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var I=k.getAttribute(i)||"";I=t+I;var H=p.get(I);H?H.push(k):p.set(I,[k])}}return p}function sy(t,i,l){t=t.ownerDocument||t,t.head.insertBefore(l,i==="title"?t.querySelector("head > title"):null)}function Iw(t,i,l){if(l===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return t=i.disabled,typeof i.precedence=="string"&&t==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function ay(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Lw(t,i,l,p){if(l.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var C=Es(p.href),k=i.querySelector(Ba(C));if(k){i=k._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=Al.bind(t),i.then(t,t)),l.state.loading|=4,l.instance=k,Vt(k);return}k=i.ownerDocument||i,p=ny(p),(C=Un.get(C))&&Pd(p,C),k=k.createElement("link"),Vt(k);var I=k;I._p=new Promise(function(H,V){I.onload=H,I.onerror=V}),sn(k,"link",p),l.instance=k}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Al.bind(t),i.addEventListener("load",l),i.addEventListener("error",l))}}var Ud=0;function Mw(t,i){return t.stylesheets&&t.count===0&&El(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var p=setTimeout(function(){if(t.stylesheets&&El(t,t.stylesheets),t.unsuspend){var k=t.unsuspend;t.unsuspend=null,k()}},6e4+i);0<t.imgBytes&&Ud===0&&(Ud=62500*mw());var C=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&El(t,t.stylesheets),t.unsuspend)){var k=t.unsuspend;t.unsuspend=null,k()}},(t.imgBytes>Ud?50:800)+i);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(p),clearTimeout(C)}}:null}function Al(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)El(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Cl=null;function El(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Cl=new Map,i.forEach(Ow,t),Cl=null,Al.call(t))}function Ow(t,i){if(!(i.state.loading&4)){var l=Cl.get(t);if(l)var p=l.get(null);else{l=new Map,Cl.set(t,l);for(var C=t.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<C.length;k++){var I=C[k];(I.nodeName==="LINK"||I.getAttribute("media")!=="not all")&&(l.set(I.dataset.precedence,I),p=I)}p&&l.set(null,p)}C=i.instance,I=C.getAttribute("data-precedence"),k=l.get(I)||p,k===p&&l.set(null,C),l.set(I,C),this.count++,p=Al.bind(this),C.addEventListener("load",p),C.addEventListener("error",p),k?k.parentNode.insertBefore(C,k.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(C,t.firstChild)),i.state.loading|=4}}var La={$$typeof:x,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function zw(t,i,l,p,C,k,I,H,V){this.tag=1,this.containerInfo=t,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=Oc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oc(0),this.hiddenUpdates=Oc(null),this.identifierPrefix=p,this.onUncaughtError=C,this.onCaughtError=k,this.onRecoverableError=I,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=V,this.incompleteTransitions=new Map}function oy(t,i,l,p,C,k,I,H,V,oe,ge,ye){return t=new zw(t,i,l,I,V,oe,ge,ye,H),i=1,k===!0&&(i|=24),k=wn(3,null,null,i),t.current=k,k.stateNode=t,i=_u(),i.refCount++,t.pooledCache=i,i.refCount++,k.memoizedState={element:p,isDehydrated:l,cache:i},Cu(k),t}function ly(t){return t?(t=is,t):is}function cy(t,i,l,p,C,k){C=ly(C),p.context===null?p.context=C:p.pendingContext=C,p=qr(i),p.payload={element:l},k=k===void 0?null:k,k!==null&&(p.callback=k),l=Qr(t,p,i),l!==null&&(vn(l,t,i),fa(l,t,i))}function uy(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<i?l:i}}function $d(t,i){uy(t,i),(t=t.alternate)&&uy(t,i)}function dy(t){if(t.tag===13||t.tag===31){var i=yi(t,67108864);i!==null&&vn(i,t,67108864),$d(t,67108864)}}function hy(t){if(t.tag===13||t.tag===31){var i=Nn();i=zc(i);var l=yi(t,i);l!==null&&vn(l,t,i),$d(t,i)}}var kl=!0;function Fw(t,i,l,p){var C=W.T;W.T=null;var k=Y.p;try{Y.p=2,qd(t,i,l,p)}finally{Y.p=k,W.T=C}}function Pw(t,i,l,p){var C=W.T;W.T=null;var k=Y.p;try{Y.p=8,qd(t,i,l,p)}finally{Y.p=k,W.T=C}}function qd(t,i,l,p){if(kl){var C=Qd(p);if(C===null)Rd(t,i,p,Nl,l),py(t,p);else if(Uw(C,t,i,l,p))p.stopPropagation();else if(py(t,p),i&4&&-1<Hw.indexOf(t)){for(;C!==null;){var k=Wi(C);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var I=Ve(k.pendingLanes);if(I!==0){var H=k;for(H.pendingLanes|=2,H.entangledLanes|=2;I;){var V=1<<31-xe(I);H.entanglements[1]|=V,I&=~V}rr(k),(ct&6)===0&&(ul=xt()+500,Ta(0))}}break;case 31:case 13:H=yi(k,2),H!==null&&vn(H,k,2),hl(),$d(k,2)}if(k=Qd(p),k===null&&Rd(t,i,p,Nl,l),k===C)break;C=k}C!==null&&p.stopPropagation()}else Rd(t,i,p,null,l)}}function Qd(t){return t=Wc(t),Gd(t)}var Nl=null;function Gd(t){if(Nl=null,t=Gi(t),t!==null){var i=u(t);if(i===null)t=null;else{var l=i.tag;if(l===13){if(t=d(i),t!==null)return t;t=null}else if(l===31){if(t=o(i),t!==null)return t;t=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return Nl=t,null}function fy(t){switch(t){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(Pt()){case fe:return 2;case _e:return 8;case je:case Ue:return 32;case $e:return 268435456;default:return 32}default:return 32}}var Wd=!1,ni=null,ri=null,ii=null,Ma=new Map,Oa=new Map,si=[],Hw="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 py(t,i){switch(t){case"focusin":case"focusout":ni=null;break;case"dragenter":case"dragleave":ri=null;break;case"mouseover":case"mouseout":ii=null;break;case"pointerover":case"pointerout":Ma.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oa.delete(i.pointerId)}}function za(t,i,l,p,C,k){return t===null||t.nativeEvent!==k?(t={blockedOn:i,domEventName:l,eventSystemFlags:p,nativeEvent:k,targetContainers:[C]},i!==null&&(i=Wi(i),i!==null&&dy(i)),t):(t.eventSystemFlags|=p,i=t.targetContainers,C!==null&&i.indexOf(C)===-1&&i.push(C),t)}function Uw(t,i,l,p,C){switch(i){case"focusin":return ni=za(ni,t,i,l,p,C),!0;case"dragenter":return ri=za(ri,t,i,l,p,C),!0;case"mouseover":return ii=za(ii,t,i,l,p,C),!0;case"pointerover":var k=C.pointerId;return Ma.set(k,za(Ma.get(k)||null,t,i,l,p,C)),!0;case"gotpointercapture":return k=C.pointerId,Oa.set(k,za(Oa.get(k)||null,t,i,l,p,C)),!0}return!1}function gy(t){var i=Gi(t.target);if(i!==null){var l=u(i);if(l!==null){if(i=l.tag,i===13){if(i=d(l),i!==null){t.blockedOn=i,Tp(t.priority,function(){hy(l)});return}}else if(i===31){if(i=o(l),i!==null){t.blockedOn=i,Tp(t.priority,function(){hy(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Tl(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var l=Qd(t.nativeEvent);if(l===null){l=t.nativeEvent;var p=new l.constructor(l.type,l);Gc=p,l.target.dispatchEvent(p),Gc=null}else return i=Wi(l),i!==null&&dy(i),t.blockedOn=l,!1;i.shift()}return!0}function my(t,i,l){Tl(t)&&l.delete(i)}function $w(){Wd=!1,ni!==null&&Tl(ni)&&(ni=null),ri!==null&&Tl(ri)&&(ri=null),ii!==null&&Tl(ii)&&(ii=null),Ma.forEach(my),Oa.forEach(my)}function Rl(t,i){t.blockedOn===i&&(t.blockedOn=null,Wd||(Wd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,$w)))}var jl=null;function yy(t){jl!==t&&(jl=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){jl===t&&(jl=null);for(var i=0;i<t.length;i+=3){var l=t[i],p=t[i+1],C=t[i+2];if(typeof p!="function"){if(Gd(p||l)===null)continue;break}var k=Wi(l);k!==null&&(t.splice(i,3),i-=3,Qu(k,{pending:!0,data:C,method:l.method,action:p},p,C))}}))}function Ns(t){function i(V){return Rl(V,t)}ni!==null&&Rl(ni,t),ri!==null&&Rl(ri,t),ii!==null&&Rl(ii,t),Ma.forEach(i),Oa.forEach(i);for(var l=0;l<si.length;l++){var p=si[l];p.blockedOn===t&&(p.blockedOn=null)}for(;0<si.length&&(l=si[0],l.blockedOn===null);)gy(l),l.blockedOn===null&&si.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(p=0;p<l.length;p+=3){var C=l[p],k=l[p+1],I=C[hn]||null;if(typeof k=="function")I||yy(l);else if(I){var H=null;if(k&&k.hasAttribute("formAction")){if(C=k,I=k[hn]||null)H=I.formAction;else if(Gd(C)!==null)continue}else H=I.action;typeof H=="function"?l[p+1]=H:(l.splice(p,3),p-=3),yy(l)}}}function vy(){function t(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(I){return C=I})},focusReset:"manual",scroll:"manual"})}function i(){C!==null&&(C(),C=null),p||setTimeout(l,20)}function l(){if(!p&&!navigation.transition){var k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,C=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){p=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),C!==null&&(C(),C=null)}}}function Kd(t){this._internalRoot=t}Dl.prototype.render=Kd.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(s(409));var l=i.current,p=Nn();cy(l,p,t,i,null,null)},Dl.prototype.unmount=Kd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;cy(t.current,2,null,t,null,null),hl(),i[Qi]=null}};function Dl(t){this._internalRoot=t}Dl.prototype.unstable_scheduleHydration=function(t){if(t){var i=Np();t={blockedOn:null,target:t,priority:i};for(var l=0;l<si.length&&i!==0&&i<si[l].priority;l++);si.splice(l,0,t),l===0&&gy(t)}};var by=r.version;if(by!=="19.2.6")throw Error(s(527,by,"19.2.6"));Y.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=h(i),t=t!==null?m(t):null,t=t===null?null:t.stateNode,t};var qw={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:W,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bl.isDisabled&&Bl.supportsFiber)try{Ot=Bl.inject(qw),Dt=Bl}catch{}}return Pa.createRoot=function(t,i){if(!a(t))throw Error(s(299));var l=!1,p="",C=Em,k=km,I=Nm;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onUncaughtError!==void 0&&(C=i.onUncaughtError),i.onCaughtError!==void 0&&(k=i.onCaughtError),i.onRecoverableError!==void 0&&(I=i.onRecoverableError)),i=oy(t,1,!1,null,null,l,p,null,C,k,I,vy),t[Qi]=i.current,Td(t),new Kd(i)},Pa.hydrateRoot=function(t,i,l){if(!a(t))throw Error(s(299));var p=!1,C="",k=Em,I=km,H=Nm,V=null;return l!=null&&(l.unstable_strictMode===!0&&(p=!0),l.identifierPrefix!==void 0&&(C=l.identifierPrefix),l.onUncaughtError!==void 0&&(k=l.onUncaughtError),l.onCaughtError!==void 0&&(I=l.onCaughtError),l.onRecoverableError!==void 0&&(H=l.onRecoverableError),l.formState!==void 0&&(V=l.formState)),i=oy(t,1,!0,i,l??null,p,C,V,k,I,H,vy),i.context=ly(null),l=i.current,p=Nn(),p=zc(p),C=qr(p),C.callback=null,Qr(l,C,p),l=p,i.current.lanes=l,Vs(i,l),rr(i),t[Qi]=i.current,Td(t),new Dl(i)},Pa.version="19.2.6",Pa}var Ty;function nA(){if(Ty)return Yd.exports;Ty=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),Yd.exports=tA(),Yd.exports}var rA=nA();const iA="modulepreload",sA=function(e){return"/"+e},Ry={},Ub=function(r,n,s){let a=Promise.resolve();if(n&&n.length>0){let d=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));a=d(n.map(h=>{if(h=sA(h),h in Ry)return;Ry[h]=!0;const m=h.endsWith(".css"),f=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${f}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":iA,m||(v.as="script"),v.crossOrigin="",v.href=h,c&&v.setAttribute("nonce",c),document.head.appendChild(v),m)return new Promise((w,A)=>{v.addEventListener("load",w),v.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${h}`)))})}))}function u(d){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=d,window.dispatchEvent(o),!o.defaultPrevented)throw d}return a.then(d=>{for(const o of d||[])o.status==="rejected"&&u(o.reason);return r().catch(u)})};function aA(e={}){const{immediate:r=!1,onNeedRefresh:n,onOfflineReady:s,onRegistered:a,onRegisteredSW:u,onRegisterError:d}=e;let o,c;const h=async(f=!0)=>{await c};async function m(){if("serviceWorker"in navigator){if(o=await Ub(async()=>{const{Workbox:f}=await import("./workbox-window.prod.es5-BBnX5xw4.js");return{Workbox:f}},[]).then(({Workbox:f})=>new f("/sw.js",{scope:"/",type:"classic"})).catch(f=>{d==null||d(f)}),!o)return;o.addEventListener("activated",f=>{(f.isUpdate||f.isExternal)&&window.location.reload()}),o.addEventListener("installed",f=>{f.isUpdate||s==null||s()}),o.register({immediate:r}).then(f=>{u?u("/sw.js",f):a==null||a(f)}).catch(f=>{d==null||d(f)})}}return c=m(),h}/**
|
|
50
|
+
* @license lucide-react v1.14.0 - ISC
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the ISC license.
|
|
53
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/const $b=(...e)=>e.filter((r,n,s)=>!!r&&r.trim()!==""&&s.indexOf(r)===n).join(" ").trim();/**
|
|
55
|
+
* @license lucide-react v1.14.0 - ISC
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the ISC license.
|
|
58
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/const oA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
60
|
+
* @license lucide-react v1.14.0 - ISC
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the ISC license.
|
|
63
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
+
*/const lA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,n,s)=>s?s.toUpperCase():n.toLowerCase());/**
|
|
65
|
+
* @license lucide-react v1.14.0 - ISC
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the ISC license.
|
|
68
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/const jy=e=>{const r=lA(e);return r.charAt(0).toUpperCase()+r.slice(1)};/**
|
|
70
|
+
* @license lucide-react v1.14.0 - ISC
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the ISC license.
|
|
73
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
+
*/var th={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
75
|
+
* @license lucide-react v1.14.0 - ISC
|
|
76
|
+
*
|
|
77
|
+
* This source code is licensed under the ISC license.
|
|
78
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
+
*/const cA=e=>{for(const r in e)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1},uA=q.createContext({}),dA=()=>q.useContext(uA),hA=q.forwardRef(({color:e,size:r,strokeWidth:n,absoluteStrokeWidth:s,className:a="",children:u,iconNode:d,...o},c)=>{const{size:h=24,strokeWidth:m=2,absoluteStrokeWidth:f=!1,color:v="currentColor",className:w=""}=dA()??{},A=s??f?Number(n??m)*24/Number(r??h):n??m;return q.createElement("svg",{ref:c,...th,width:r??h??th.width,height:r??h??th.height,stroke:e??v,strokeWidth:A,className:$b("lucide",w,a),...!u&&!cA(o)&&{"aria-hidden":"true"},...o},[...d.map(([b,y])=>q.createElement(b,y)),...Array.isArray(u)?u:[u]])});/**
|
|
80
|
+
* @license lucide-react v1.14.0 - ISC
|
|
81
|
+
*
|
|
82
|
+
* This source code is licensed under the ISC license.
|
|
83
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
+
*/const Xe=(e,r)=>{const n=q.forwardRef(({className:s,...a},u)=>q.createElement(hA,{ref:u,iconNode:r,className:$b(`lucide-${oA(jy(e))}`,`lucide-${e}`,s),...a}));return n.displayName=jy(e),n};/**
|
|
85
|
+
* @license lucide-react v1.14.0 - ISC
|
|
86
|
+
*
|
|
87
|
+
* This source code is licensed under the ISC license.
|
|
88
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
+
*/const fA=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],Sf=Xe("at-sign",fA);/**
|
|
90
|
+
* @license lucide-react v1.14.0 - ISC
|
|
91
|
+
*
|
|
92
|
+
* This source code is licensed under the ISC license.
|
|
93
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
+
*/const pA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],wf=Xe("check",pA);/**
|
|
95
|
+
* @license lucide-react v1.14.0 - ISC
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the ISC license.
|
|
98
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/const gA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ur=Xe("chevron-down",gA);/**
|
|
100
|
+
* @license lucide-react v1.14.0 - ISC
|
|
101
|
+
*
|
|
102
|
+
* This source code is licensed under the ISC license.
|
|
103
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
+
*/const mA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],dr=Xe("chevron-right",mA);/**
|
|
105
|
+
* @license lucide-react v1.14.0 - ISC
|
|
106
|
+
*
|
|
107
|
+
* This source code is licensed under the ISC license.
|
|
108
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
+
*/const yA=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],vA=Xe("code-xml",yA);/**
|
|
110
|
+
* @license lucide-react v1.14.0 - ISC
|
|
111
|
+
*
|
|
112
|
+
* This source code is licensed under the ISC license.
|
|
113
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
+
*/const bA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],Af=Xe("columns-2",bA);/**
|
|
115
|
+
* @license lucide-react v1.14.0 - ISC
|
|
116
|
+
*
|
|
117
|
+
* This source code is licensed under the ISC license.
|
|
118
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
+
*/const xA=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],qb=Xe("copy",xA);/**
|
|
120
|
+
* @license lucide-react v1.14.0 - ISC
|
|
121
|
+
*
|
|
122
|
+
* This source code is licensed under the ISC license.
|
|
123
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
+
*/const _A=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Qb=Xe("download",_A);/**
|
|
125
|
+
* @license lucide-react v1.14.0 - ISC
|
|
126
|
+
*
|
|
127
|
+
* This source code is licensed under the ISC license.
|
|
128
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
+
*/const SA=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Gb=Xe("external-link",SA);/**
|
|
130
|
+
* @license lucide-react v1.14.0 - ISC
|
|
131
|
+
*
|
|
132
|
+
* This source code is licensed under the ISC license.
|
|
133
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
+
*/const wA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],Wb=Xe("file-code",wA);/**
|
|
135
|
+
* @license lucide-react v1.14.0 - ISC
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the ISC license.
|
|
138
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/const AA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]],Kb=Xe("file-diff",AA);/**
|
|
140
|
+
* @license lucide-react v1.14.0 - ISC
|
|
141
|
+
*
|
|
142
|
+
* This source code is licensed under the ISC license.
|
|
143
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
+
*/const CA=[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],EA=Xe("file-plus-corner",CA);/**
|
|
145
|
+
* @license lucide-react v1.14.0 - ISC
|
|
146
|
+
*
|
|
147
|
+
* This source code is licensed under the ISC license.
|
|
148
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
+
*/const kA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],NA=Xe("file-search",kA);/**
|
|
150
|
+
* @license lucide-react v1.14.0 - ISC
|
|
151
|
+
*
|
|
152
|
+
* This source code is licensed under the ISC license.
|
|
153
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
+
*/const TA=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],RA=Xe("folder-plus",TA);/**
|
|
155
|
+
* @license lucide-react v1.14.0 - ISC
|
|
156
|
+
*
|
|
157
|
+
* This source code is licensed under the ISC license.
|
|
158
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
+
*/const jA=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],DA=Xe("folder-tree",jA);/**
|
|
160
|
+
* @license lucide-react v1.14.0 - ISC
|
|
161
|
+
*
|
|
162
|
+
* This source code is licensed under the ISC license.
|
|
163
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
+
*/const BA=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],ho=Xe("git-branch",BA);/**
|
|
165
|
+
* @license lucide-react v1.14.0 - ISC
|
|
166
|
+
*
|
|
167
|
+
* This source code is licensed under the ISC license.
|
|
168
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
+
*/const IA=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],LA=Xe("git-commit-horizontal",IA);/**
|
|
170
|
+
* @license lucide-react v1.14.0 - ISC
|
|
171
|
+
*
|
|
172
|
+
* This source code is licensed under the ISC license.
|
|
173
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
+
*/const MA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],OA=Xe("image",MA);/**
|
|
175
|
+
* @license lucide-react v1.14.0 - ISC
|
|
176
|
+
*
|
|
177
|
+
* This source code is licensed under the ISC license.
|
|
178
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
+
*/const zA=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],FA=Xe("layers",zA);/**
|
|
180
|
+
* @license lucide-react v1.14.0 - ISC
|
|
181
|
+
*
|
|
182
|
+
* This source code is licensed under the ISC license.
|
|
183
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
+
*/const PA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],fo=Xe("loader-circle",PA);/**
|
|
185
|
+
* @license lucide-react v1.14.0 - ISC
|
|
186
|
+
*
|
|
187
|
+
* This source code is licensed under the ISC license.
|
|
188
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
+
*/const HA=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],UA=Xe("message-square",HA);/**
|
|
190
|
+
* @license lucide-react v1.14.0 - ISC
|
|
191
|
+
*
|
|
192
|
+
* This source code is licensed under the ISC license.
|
|
193
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
+
*/const $A=[["path",{d:"M5 12h14",key:"1ays0h"}]],qA=Xe("minus",$A);/**
|
|
195
|
+
* @license lucide-react v1.14.0 - ISC
|
|
196
|
+
*
|
|
197
|
+
* This source code is licensed under the ISC license.
|
|
198
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
+
*/const QA=[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]],GA=Xe("navigation",QA);/**
|
|
200
|
+
* @license lucide-react v1.14.0 - ISC
|
|
201
|
+
*
|
|
202
|
+
* This source code is licensed under the ISC license.
|
|
203
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
+
*/const WA=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Vb=Xe("paperclip",WA);/**
|
|
205
|
+
* @license lucide-react v1.14.0 - ISC
|
|
206
|
+
*
|
|
207
|
+
* This source code is licensed under the ISC license.
|
|
208
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
+
*/const KA=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],VA=Xe("pencil",KA);/**
|
|
210
|
+
* @license lucide-react v1.14.0 - ISC
|
|
211
|
+
*
|
|
212
|
+
* This source code is licensed under the ISC license.
|
|
213
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
+
*/const XA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],no=Xe("plus",XA);/**
|
|
215
|
+
* @license lucide-react v1.14.0 - ISC
|
|
216
|
+
*
|
|
217
|
+
* This source code is licensed under the ISC license.
|
|
218
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
+
*/const YA=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],po=Xe("refresh-cw",YA);/**
|
|
220
|
+
* @license lucide-react v1.14.0 - ISC
|
|
221
|
+
*
|
|
222
|
+
* This source code is licensed under the ISC license.
|
|
223
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
+
*/const ZA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]],Cf=Xe("rows-2",ZA);/**
|
|
225
|
+
* @license lucide-react v1.14.0 - ISC
|
|
226
|
+
*
|
|
227
|
+
* This source code is licensed under the ISC license.
|
|
228
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
+
*/const JA=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],eC=Xe("save",JA);/**
|
|
230
|
+
* @license lucide-react v1.14.0 - ISC
|
|
231
|
+
*
|
|
232
|
+
* This source code is licensed under the ISC license.
|
|
233
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
+
*/const tC=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Xb=Xe("search",tC);/**
|
|
235
|
+
* @license lucide-react v1.14.0 - ISC
|
|
236
|
+
*
|
|
237
|
+
* This source code is licensed under the ISC license.
|
|
238
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
+
*/const nC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],rC=Xe("square-x",nC);/**
|
|
240
|
+
* @license lucide-react v1.14.0 - ISC
|
|
241
|
+
*
|
|
242
|
+
* This source code is licensed under the ISC license.
|
|
243
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
+
*/const iC=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Yb=Xe("terminal",iC);/**
|
|
245
|
+
* @license lucide-react v1.14.0 - ISC
|
|
246
|
+
*
|
|
247
|
+
* This source code is licensed under the ISC license.
|
|
248
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
+
*/const sC=[["path",{d:"m16 16-3 3 3 3",key:"117b85"}],["path",{d:"M3 12h14.5a1 1 0 0 1 0 7H13",key:"18xa6z"}],["path",{d:"M3 19h6",key:"1ygdsz"}],["path",{d:"M3 5h18",key:"1u36vt"}]],aC=Xe("text-wrap",sC);/**
|
|
250
|
+
* @license lucide-react v1.14.0 - ISC
|
|
251
|
+
*
|
|
252
|
+
* This source code is licensed under the ISC license.
|
|
253
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
+
*/const oC=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Qh=Xe("trash-2",oC);/**
|
|
255
|
+
* @license lucide-react v1.14.0 - ISC
|
|
256
|
+
*
|
|
257
|
+
* This source code is licensed under the ISC license.
|
|
258
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
+
*/const lC=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],cC=Xe("triangle-alert",lC);/**
|
|
260
|
+
* @license lucide-react v1.14.0 - ISC
|
|
261
|
+
*
|
|
262
|
+
* This source code is licensed under the ISC license.
|
|
263
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
+
*/const uC=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],dC=Xe("undo-2",uC);/**
|
|
265
|
+
* @license lucide-react v1.14.0 - ISC
|
|
266
|
+
*
|
|
267
|
+
* This source code is licensed under the ISC license.
|
|
268
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
+
*/const hC=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Ef=Xe("upload",hC);/**
|
|
270
|
+
* @license lucide-react v1.14.0 - ISC
|
|
271
|
+
*
|
|
272
|
+
* This source code is licensed under the ISC license.
|
|
273
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
+
*/const fC=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Zb=Xe("users",fC);/**
|
|
275
|
+
* @license lucide-react v1.14.0 - ISC
|
|
276
|
+
*
|
|
277
|
+
* This source code is licensed under the ISC license.
|
|
278
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
+
*/const pC=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Br=Xe("x",pC),Dy=e=>{let r;const n=new Set,s=(h,m)=>{const f=typeof h=="function"?h(r):h;if(!Object.is(f,r)){const v=r;r=m??(typeof f!="object"||f===null)?f:Object.assign({},r,f),n.forEach(w=>w(r,v))}},a=()=>r,o={setState:s,getState:a,getInitialState:()=>c,subscribe:h=>(n.add(h),()=>n.delete(h))},c=r=e(s,a,o);return o},gC=(e=>e?Dy(e):Dy),mC=e=>e;function yC(e,r=mC){const n=Ll.useSyncExternalStore(e.subscribe,Ll.useCallback(()=>r(e.getState()),[e,r]),Ll.useCallback(()=>r(e.getInitialState()),[e,r]));return Ll.useDebugValue(n),n}const By=e=>{const r=gC(e),n=s=>yC(r,s);return Object.assign(n,r),n},Ir=(e=>e?By(e):By);/*!
|
|
280
|
+
* hash-wasm (https://www.npmjs.com/package/hash-wasm)
|
|
281
|
+
* (c) Dani Biro
|
|
282
|
+
* @license MIT
|
|
283
|
+
*/function ic(e,r,n,s){function a(u){return u instanceof n?u:new n(function(d){d(u)})}return new(n||(n=Promise))(function(u,d){function o(m){try{h(s.next(m))}catch(f){d(f)}}function c(m){try{h(s.throw(m))}catch(f){d(f)}}function h(m){m.done?u(m.value):a(m.value).then(o,c)}h((s=s.apply(e,[])).next())})}class Bt{constructor(){this.mutex=Promise.resolve()}lock(){let r=()=>{};return this.mutex=this.mutex.then(()=>new Promise(r)),new Promise(n=>{r=n})}dispatch(r){return ic(this,void 0,void 0,function*(){const n=yield this.lock();try{return yield Promise.resolve(r())}finally{n()}})}}var nh;function vC(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global}const Gh=vC(),rh=(nh=Gh.Buffer)!==null&&nh!==void 0?nh:null,bC=Gh.TextEncoder?new Gh.TextEncoder:null;function Jb(e,r){return(e&15)+(e>>6|e>>3&8)<<4|(r&15)+(r>>6|r>>3&8)}function xC(e,r){const n=r.length>>1;for(let s=0;s<n;s++){const a=s<<1;e[s]=Jb(r.charCodeAt(a),r.charCodeAt(a+1))}}function _C(e,r){if(e.length!==r.length*2)return!1;for(let n=0;n<r.length;n++){const s=n<<1;if(r[n]!==Jb(e.charCodeAt(s),e.charCodeAt(s+1)))return!1}return!0}const Iy=87,Ly=48;function My(e,r,n){let s=0;for(let a=0;a<n;a++){let u=r[a]>>>4;e[s++]=u>9?u+Iy:u+Ly,u=r[a]&15,e[s++]=u>9?u+Iy:u+Ly}return String.fromCharCode.apply(null,e)}const Oy=rh!==null?e=>{if(typeof e=="string"){const r=rh.from(e,"utf8");return new Uint8Array(r.buffer,r.byteOffset,r.length)}if(rh.isBuffer(e))return new Uint8Array(e.buffer,e.byteOffset,e.length);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")}:e=>{if(typeof e=="string")return bC.encode(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")},zy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xa=new Uint8Array(256);for(let e=0;e<zy.length;e++)Xa[zy.charCodeAt(e)]=e;function SC(e){let r=Math.floor(e.length*.75);const n=e.length;return e[n-1]==="="&&(r-=1,e[n-2]==="="&&(r-=1)),r}function wC(e){const r=SC(e),n=e.length,s=new Uint8Array(r);let a=0;for(let u=0;u<n;u+=4){const d=Xa[e.charCodeAt(u)],o=Xa[e.charCodeAt(u+1)],c=Xa[e.charCodeAt(u+2)],h=Xa[e.charCodeAt(u+3)];s[a]=d<<2|o>>4,a+=1,s[a]=(o&15)<<4|c>>2,a+=1,s[a]=(c&3)<<6|h&63,a+=1}return s}const Ml=16*1024,Ha=4,AC=new Bt,ih=new Map;function CC(e,r){return ic(this,void 0,void 0,function*(){let n=null,s=null,a=!1;if(typeof WebAssembly>"u")throw new Error("WebAssembly is not supported in this environment!");const u=(T,j=0)=>{s.set(T,j)},d=()=>s,o=()=>n.exports,c=T=>{n.exports.Hash_SetMemorySize(T);const j=n.exports.Hash_GetBuffer(),R=n.exports.memory.buffer;s=new Uint8Array(R,j,T)},h=()=>new DataView(n.exports.memory.buffer).getUint32(n.exports.STATE_SIZE,!0),m=AC.dispatch(()=>ic(this,void 0,void 0,function*(){if(!ih.has(e.name)){const j=wC(e.data),R=WebAssembly.compile(j);ih.set(e.name,R)}const T=yield ih.get(e.name);n=yield WebAssembly.instantiate(T,{})})),f=()=>ic(this,void 0,void 0,function*(){n||(yield m);const T=n.exports.Hash_GetBuffer(),j=n.exports.memory.buffer;s=new Uint8Array(j,T,Ml)}),v=(T=null)=>{a=!0,n.exports.Hash_Init(T)},w=T=>{let j=0;for(;j<T.length;){const R=T.subarray(j,j+Ml);j+=R.length,s.set(R),n.exports.Hash_Update(R.length)}},A=T=>{if(!a)throw new Error("update() called before init()");const j=Oy(T);w(j)},b=new Uint8Array(r*2),y=(T,j=null)=>{if(!a)throw new Error("digest() called before init()");return a=!1,n.exports.Hash_Final(j),T==="binary"?s.slice(0,r):My(b,s,r)},S=()=>{if(!a)throw new Error("save() can only be called after init() and before digest()");const T=n.exports.Hash_GetState(),j=h(),R=n.exports.memory.buffer,D=new Uint8Array(R,T,j),L=new Uint8Array(Ha+j);return xC(L,e.hash),L.set(D,Ha),L},_=T=>{if(!(T instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const j=n.exports.Hash_GetState(),R=h(),D=Ha+R,L=n.exports.memory.buffer;if(T.length!==D)throw new Error(`Bad state length (expected ${D} bytes, got ${T.length})`);if(!_C(e.hash,T.subarray(0,Ha)))throw new Error("This state was written by an incompatible hash implementation");const z=T.subarray(Ha);new Uint8Array(L,j,R).set(z),a=!0},x=T=>typeof T=="string"?T.length<Ml/4:T.byteLength<Ml;let E=x;switch(e.name){case"argon2":case"scrypt":E=()=>!0;break;case"blake2b":case"blake2s":E=(T,j)=>j<=512&&x(T);break;case"blake3":E=(T,j)=>j===0&&x(T);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":E=()=>!1;break}const N=(T,j=null,R=null)=>{if(!E(T,j))return v(j),A(T),y("hex",R);const D=Oy(T);return s.set(D),n.exports.Hash_Calculate(D.length,j,R),My(b,s,r)};return yield f(),{getMemory:d,writeMemory:u,getExports:o,setMemorySize:c,init:v,update:A,digest:y,save:S,load:_,calculate:N,hashLength:r}})}new Bt;new Bt;new Bt;new Bt;new Bt;new Bt;new Bt;new Bt;new Bt;new Bt;new Bt;var EC="sha256",kC="AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQfCJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwABA1IYXNoX0dldFN0YXRlAAUOSGFzaF9DYWxjdWxhdGUABgpTVEFURV9TSVpFAwEKnEoHBQBBgAkLnQEAQQBCADcDwIkBQQBBHEEgIABB4AFGIgAbNgLoiQFBAEKnn+anxvST/b5/Qquzj/yRo7Pw2wAgABs3A+CJAUEAQrGWgP6fooWs6ABC/6S5iMWR2oKbfyAAGzcD2IkBQQBCl7rDg5Onlod3QvLmu+Ojp/2npX8gABs3A9CJAUEAQti9loj8oLW+NkLnzKfQ1tDrs7t/IAAbNwPIiQEL7wICAX4Gf0EAQQApA8CJASIBIACtfDcDwIkBAkACQAJAIAGnQT9xIgINAEGACSEDDAELAkBBwAAgAmsiBCAAIAQgAEkbIgNFDQAgA0EDcSEFIAJBgIkBaiEGQQAhAgJAIANBBEkNACADQfwAcSEHQQAhAgNAIAYgAmoiAyACQYAJai0AADoAACADQQFqIAJBgQlqLQAAOgAAIANBAmogAkGCCWotAAA6AAAgA0EDaiACQYMJai0AADoAACAHIAJBBGoiAkcNAAsLIAVFDQADQCAGIAJqIAJBgAlqLQAAOgAAIAJBAWohAiAFQX9qIgUNAAsLIAAgBEkNAUGAiQEQAyAAIARrIQAgBEGACWohAwsCQCAAQcAASQ0AA0AgAxADIANBwABqIQMgAEFAaiIAQT9LDQALCyAARQ0AQQAhAkEAIQUDQCACQYCJAWogAyACai0AADoAACACQQFqIQIgACAFQQFqIgVB/wFxSw0ACwsLoz4BRX9BACAAKAI8IgFBGHQgAUGA/gNxQQh0ciABQQh2QYD+A3EgAUEYdnJyIgFBGXcgAUEOd3MgAUEDdnMgACgCOCICQRh0IAJBgP4DcUEIdHIgAkEIdkGA/gNxIAJBGHZyciICaiAAKAIgIgNBGHQgA0GA/gNxQQh0ciADQQh2QYD+A3EgA0EYdnJyIgRBGXcgBEEOd3MgBEEDdnMgACgCHCIDQRh0IANBgP4DcUEIdHIgA0EIdkGA/gNxIANBGHZyciIFaiAAKAIEIgNBGHQgA0GA/gNxQQh0ciADQQh2QYD+A3EgA0EYdnJyIgZBGXcgBkEOd3MgBkEDdnMgACgCACIDQRh0IANBgP4DcUEIdHIgA0EIdkGA/gNxIANBGHZyciIHaiAAKAIkIgNBGHQgA0GA/gNxQQh0ciADQQh2QYD+A3EgA0EYdnJyIghqIAJBD3cgAkENd3MgAkEKdnNqIgNqIAAoAhgiCUEYdCAJQYD+A3FBCHRyIAlBCHZBgP4DcSAJQRh2cnIiCkEZdyAKQQ53cyAKQQN2cyAAKAIUIglBGHQgCUGA/gNxQQh0ciAJQQh2QYD+A3EgCUEYdnJyIgtqIAJqIAAoAhAiCUEYdCAJQYD+A3FBCHRyIAlBCHZBgP4DcSAJQRh2cnIiDEEZdyAMQQ53cyAMQQN2cyAAKAIMIglBGHQgCUGA/gNxQQh0ciAJQQh2QYD+A3EgCUEYdnJyIg1qIAAoAjAiCUEYdCAJQYD+A3FBCHRyIAlBCHZBgP4DcSAJQRh2cnIiDmogACgCCCIJQRh0IAlBgP4DcUEIdHIgCUEIdkGA/gNxIAlBGHZyciIPQRl3IA9BDndzIA9BA3ZzIAZqIAAoAigiCUEYdCAJQYD+A3FBCHRyIAlBCHZBgP4DcSAJQRh2cnIiEGogAUEPdyABQQ13cyABQQp2c2oiCUEPdyAJQQ13cyAJQQp2c2oiEUEPdyARQQ13cyARQQp2c2oiEkEPdyASQQ13cyASQQp2c2oiE2ogACgCNCIUQRh0IBRBgP4DcUEIdHIgFEEIdkGA/gNxIBRBGHZyciIVQRl3IBVBDndzIBVBA3ZzIA5qIBJqIAAoAiwiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnIiFkEZdyAWQQ53cyAWQQN2cyAQaiARaiAIQRl3IAhBDndzIAhBA3ZzIARqIAlqIAVBGXcgBUEOd3MgBUEDdnMgCmogAWogC0EZdyALQQ53cyALQQN2cyAMaiAVaiANQRl3IA1BDndzIA1BA3ZzIA9qIBZqIANBD3cgA0ENd3MgA0EKdnNqIhRBD3cgFEENd3MgFEEKdnNqIhdBD3cgF0ENd3MgF0EKdnNqIhhBD3cgGEENd3MgGEEKdnNqIhlBD3cgGUENd3MgGUEKdnNqIhpBD3cgGkENd3MgGkEKdnNqIhtBD3cgG0ENd3MgG0EKdnNqIhxBGXcgHEEOd3MgHEEDdnMgAkEZdyACQQ53cyACQQN2cyAVaiAYaiAOQRl3IA5BDndzIA5BA3ZzIBZqIBdqIBBBGXcgEEEOd3MgEEEDdnMgCGogFGogE0EPdyATQQ13cyATQQp2c2oiHUEPdyAdQQ13cyAdQQp2c2oiHkEPdyAeQQ13cyAeQQp2c2oiH2ogE0EZdyATQQ53cyATQQN2cyAYaiADQRl3IANBDndzIANBA3ZzIAFqIBlqIB9BD3cgH0ENd3MgH0EKdnNqIiBqIBJBGXcgEkEOd3MgEkEDdnMgF2ogH2ogEUEZdyARQQ53cyARQQN2cyAUaiAeaiAJQRl3IAlBDndzIAlBA3ZzIANqIB1qIBxBD3cgHEENd3MgHEEKdnNqIiFBD3cgIUENd3MgIUEKdnNqIiJBD3cgIkENd3MgIkEKdnNqIiNBD3cgI0ENd3MgI0EKdnNqIiRqIBtBGXcgG0EOd3MgG0EDdnMgHmogI2ogGkEZdyAaQQ53cyAaQQN2cyAdaiAiaiAZQRl3IBlBDndzIBlBA3ZzIBNqICFqIBhBGXcgGEEOd3MgGEEDdnMgEmogHGogF0EZdyAXQQ53cyAXQQN2cyARaiAbaiAUQRl3IBRBDndzIBRBA3ZzIAlqIBpqICBBD3cgIEENd3MgIEEKdnNqIiVBD3cgJUENd3MgJUEKdnNqIiZBD3cgJkENd3MgJkEKdnNqIidBD3cgJ0ENd3MgJ0EKdnNqIihBD3cgKEENd3MgKEEKdnNqIilBD3cgKUENd3MgKUEKdnNqIipBD3cgKkENd3MgKkEKdnNqIitBGXcgK0EOd3MgK0EDdnMgH0EZdyAfQQ53cyAfQQN2cyAbaiAnaiAeQRl3IB5BDndzIB5BA3ZzIBpqICZqIB1BGXcgHUEOd3MgHUEDdnMgGWogJWogJEEPdyAkQQ13cyAkQQp2c2oiLEEPdyAsQQ13cyAsQQp2c2oiLUEPdyAtQQ13cyAtQQp2c2oiLmogJEEZdyAkQQ53cyAkQQN2cyAnaiAgQRl3ICBBDndzICBBA3ZzIBxqIChqIC5BD3cgLkENd3MgLkEKdnNqIi9qICNBGXcgI0EOd3MgI0EDdnMgJmogLmogIkEZdyAiQQ53cyAiQQN2cyAlaiAtaiAhQRl3ICFBDndzICFBA3ZzICBqICxqICtBD3cgK0ENd3MgK0EKdnNqIjBBD3cgMEENd3MgMEEKdnNqIjFBD3cgMUENd3MgMUEKdnNqIjJBD3cgMkENd3MgMkEKdnNqIjNqICpBGXcgKkEOd3MgKkEDdnMgLWogMmogKUEZdyApQQ53cyApQQN2cyAsaiAxaiAoQRl3IChBDndzIChBA3ZzICRqIDBqICdBGXcgJ0EOd3MgJ0EDdnMgI2ogK2ogJkEZdyAmQQ53cyAmQQN2cyAiaiAqaiAlQRl3ICVBDndzICVBA3ZzICFqIClqIC9BD3cgL0ENd3MgL0EKdnNqIjRBD3cgNEENd3MgNEEKdnNqIjVBD3cgNUENd3MgNUEKdnNqIjZBD3cgNkENd3MgNkEKdnNqIjdBD3cgN0ENd3MgN0EKdnNqIjhBD3cgOEENd3MgOEEKdnNqIjlBD3cgOUENd3MgOUEKdnNqIjogOCA0IC4gLCAhIBsgGSADIA4gBEEAKALYiQEiO0EadyA7QRV3cyA7QQd3c0EAKALkiQEiPGpBACgC4IkBIj1BACgC3IkBIj5zIDtxID1zaiAHakGY36iUBGoiB0EAKALUiQEiP2oiACAMaiA7IA1qID4gD2ogPSAGaiAAID4gO3NxID5zaiAAQRp3IABBFXdzIABBB3dzakGRid2JB2oiQEEAKALQiQEiQWoiDCAAIDtzcSA7c2ogDEEadyAMQRV3cyAMQQd3c2pBz/eDrntqIkJBACgCzIkBIkNqIg0gDCAAc3EgAHNqIA1BGncgDUEVd3MgDUEHd3NqQaW3181+aiJEQQAoAsiJASIAaiIPIA0gDHNxIAxzaiAPQRp3IA9BFXdzIA9BB3dzakHbhNvKA2oiRSBBIEMgAHNxIEMgAHFzIABBHncgAEETd3MgAEEKd3NqIAdqIgZqIgdqIAUgD2ogCiANaiALIAxqIAcgDyANc3EgDXNqIAdBGncgB0EVd3MgB0EHd3NqQfGjxM8FaiIKIAYgAHMgQ3EgBiAAcXMgBkEedyAGQRN3cyAGQQp3c2ogQGoiDGoiBCAHIA9zcSAPc2ogBEEadyAEQRV3cyAEQQd3c2pBpIX+kXlqIgsgDCAGcyAAcSAMIAZxcyAMQR53IAxBE3dzIAxBCndzaiBCaiINaiIPIAQgB3NxIAdzaiAPQRp3IA9BFXdzIA9BB3dzakHVvfHYemoiQCANIAxzIAZxIA0gDHFzIA1BHncgDUETd3MgDUEKd3NqIERqIgZqIgcgDyAEc3EgBHNqIAdBGncgB0EVd3MgB0EHd3NqQZjVnsB9aiJCIAYgDXMgDHEgBiANcXMgBkEedyAGQRN3cyAGQQp3c2ogRWoiDGoiBWogFiAHaiAQIA9qIAggBGogBSAHIA9zcSAPc2ogBUEadyAFQRV3cyAFQQd3c2pBgbaNlAFqIgggDCAGcyANcSAMIAZxcyAMQR53IAxBE3dzIAxBCndzaiAKaiINaiIPIAUgB3NxIAdzaiAPQRp3IA9BFXdzIA9BB3dzakG+i8ahAmoiDiANIAxzIAZxIA0gDHFzIA1BHncgDUETd3MgDUEKd3NqIAtqIgZqIgcgDyAFc3EgBXNqIAdBGncgB0EVd3MgB0EHd3NqQcP7sagFaiIQIAYgDXMgDHEgBiANcXMgBkEedyAGQRN3cyAGQQp3c2ogQGoiDGoiBCAHIA9zcSAPc2ogBEEadyAEQRV3cyAEQQd3c2pB9Lr5lQdqIhYgDCAGcyANcSAMIAZxcyAMQR53IAxBE3dzIAxBCndzaiBCaiINaiIFaiABIARqIAIgB2ogFSAPaiAFIAQgB3NxIAdzaiAFQRp3IAVBFXdzIAVBB3dzakH+4/qGeGoiByANIAxzIAZxIA0gDHFzIA1BHncgDUETd3MgDUEKd3NqIAhqIgFqIgYgBSAEc3EgBHNqIAZBGncgBkEVd3MgBkEHd3NqQaeN8N55aiIEIAEgDXMgDHEgASANcXMgAUEedyABQRN3cyABQQp3c2ogDmoiAmoiDCAGIAVzcSAFc2ogDEEadyAMQRV3cyAMQQd3c2pB9OLvjHxqIgUgAiABcyANcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAQaiIDaiINIAwgBnNxIAZzaiANQRp3IA1BFXdzIA1BB3dzakHB0+2kfmoiCCADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBZqIgFqIg8gF2ogESANaiAUIAxqIAkgBmogDyANIAxzcSAMc2ogD0EadyAPQRV3cyAPQQd3c2pBho/5/X5qIgYgASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAHaiICaiIJIA8gDXNxIA1zaiAJQRp3IAlBFXdzIAlBB3dzakHGu4b+AGoiDCACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIARqIgNqIhEgCSAPc3EgD3NqIBFBGncgEUEVd3MgEUEHd3NqQczDsqACaiINIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogBWoiAWoiFCARIAlzcSAJc2ogFEEadyAUQRV3cyAUQQd3c2pB79ik7wJqIg8gASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAIaiICaiIXaiATIBRqIBggEWogEiAJaiAXIBQgEXNxIBFzaiAXQRp3IBdBFXdzIBdBB3dzakGqidLTBGoiGCACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIAZqIgNqIgkgFyAUc3EgFHNqIAlBGncgCUEVd3MgCUEHd3NqQdzTwuUFaiIUIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogDGoiAWoiESAJIBdzcSAXc2ogEUEadyARQRV3cyARQQd3c2pB2pHmtwdqIhcgASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiANaiICaiISIBEgCXNxIAlzaiASQRp3IBJBFXdzIBJBB3dzakHSovnBeWoiGSACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIA9qIgNqIhNqIB4gEmogGiARaiAdIAlqIBMgEiARc3EgEXNqIBNBGncgE0EVd3MgE0EHd3NqQe2Mx8F6aiIaIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogGGoiAWoiCSATIBJzcSASc2ogCUEadyAJQRV3cyAJQQd3c2pByM+MgHtqIhggASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAUaiICaiIRIAkgE3NxIBNzaiARQRp3IBFBFXdzIBFBB3dzakHH/+X6e2oiFCACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIBdqIgNqIhIgESAJc3EgCXNqIBJBGncgEkEVd3MgEkEHd3NqQfOXgLd8aiIXIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogGWoiAWoiE2ogICASaiAcIBFqIB8gCWogEyASIBFzcSARc2ogE0EadyATQRV3cyATQQd3c2pBx6KerX1qIhkgASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAaaiICaiIJIBMgEnNxIBJzaiAJQRp3IAlBFXdzIAlBB3dzakHRxqk2aiIaIAIgAXMgA3EgAiABcXMgAkEedyACQRN3cyACQQp3c2ogGGoiA2oiESAJIBNzcSATc2ogEUEadyARQRV3cyARQQd3c2pB59KkoQFqIhggAyACcyABcSADIAJxcyADQR53IANBE3dzIANBCndzaiAUaiIBaiISIBEgCXNxIAlzaiASQRp3IBJBFXdzIBJBB3dzakGFldy9AmoiFCABIANzIAJxIAEgA3FzIAFBHncgAUETd3MgAUEKd3NqIBdqIgJqIhMgI2ogJiASaiAiIBFqICUgCWogEyASIBFzcSARc2ogE0EadyATQRV3cyATQQd3c2pBuMLs8AJqIhcgAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAZaiIDaiIJIBMgEnNxIBJzaiAJQRp3IAlBFXdzIAlBB3dzakH827HpBGoiGSADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBpqIgFqIhEgCSATc3EgE3NqIBFBGncgEUEVd3MgEUEHd3NqQZOa4JkFaiIaIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogGGoiAmoiEiARIAlzcSAJc2ogEkEadyASQRV3cyASQQd3c2pB1OapqAZqIhggAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAUaiIDaiITaiAoIBJqICQgEWogJyAJaiATIBIgEXNxIBFzaiATQRp3IBNBFXdzIBNBB3dzakG7laizB2oiFCADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBdqIgFqIgkgEyASc3EgEnNqIAlBGncgCUEVd3MgCUEHd3NqQa6Si454aiIXIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogGWoiAmoiESAJIBNzcSATc2ogEUEadyARQRV3cyARQQd3c2pBhdnIk3lqIhkgAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAaaiIDaiISIBEgCXNxIAlzaiASQRp3IBJBFXdzIBJBB3dzakGh0f+VemoiGiADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBhqIgFqIhNqICogEmogLSARaiApIAlqIBMgEiARc3EgEXNqIBNBGncgE0EVd3MgE0EHd3NqQcvM6cB6aiIYIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogFGoiAmoiCSATIBJzcSASc2ogCUEadyAJQRV3cyAJQQd3c2pB8JauknxqIhQgAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAXaiIDaiIRIAkgE3NxIBNzaiARQRp3IBFBFXdzIBFBB3dzakGjo7G7fGoiFyADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBlqIgFqIhIgESAJc3EgCXNqIBJBGncgEkEVd3MgEkEHd3NqQZnQy4x9aiIZIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogGmoiAmoiE2ogMCASaiAvIBFqICsgCWogEyASIBFzcSARc2ogE0EadyATQRV3cyATQQd3c2pBpIzktH1qIhogAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAYaiIDaiIJIBMgEnNxIBJzaiAJQRp3IAlBFXdzIAlBB3dzakGF67igf2oiGCADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBRqIgFqIhEgCSATc3EgE3NqIBFBGncgEUEVd3MgEUEHd3NqQfDAqoMBaiIUIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogF2oiAmoiEiARIAlzcSAJc2ogEkEadyASQRV3cyASQQd3c2pBloKTzQFqIhcgAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAZaiIDaiITIDZqIDIgEmogNSARaiAxIAlqIBMgEiARc3EgEXNqIBNBGncgE0EVd3MgE0EHd3NqQYjY3fEBaiIZIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogGmoiAWoiCSATIBJzcSASc2ogCUEadyAJQRV3cyAJQQd3c2pBzO6hugJqIhogASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAYaiICaiIRIAkgE3NxIBNzaiARQRp3IBFBFXdzIBFBB3dzakG1+cKlA2oiGCACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIBRqIgNqIhIgESAJc3EgCXNqIBJBGncgEkEVd3MgEkEHd3NqQbOZ8MgDaiIUIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogF2oiAWoiE2ogLEEZdyAsQQ53cyAsQQN2cyAoaiA0aiAzQQ93IDNBDXdzIDNBCnZzaiIXIBJqIDcgEWogMyAJaiATIBIgEXNxIBFzaiATQRp3IBNBFXdzIBNBB3dzakHK1OL2BGoiGyABIANzIAJxIAEgA3FzIAFBHncgAUETd3MgAUEKd3NqIBlqIgJqIgkgEyASc3EgEnNqIAlBGncgCUEVd3MgCUEHd3NqQc+U89wFaiIZIAIgAXMgA3EgAiABcXMgAkEedyACQRN3cyACQQp3c2ogGmoiA2oiESAJIBNzcSATc2ogEUEadyARQRV3cyARQQd3c2pB89+5wQZqIhogAyACcyABcSADIAJxcyADQR53IANBE3dzIANBCndzaiAYaiIBaiISIBEgCXNxIAlzaiASQRp3IBJBFXdzIBJBB3dzakHuhb6kB2oiHCABIANzIAJxIAEgA3FzIAFBHncgAUETd3MgAUEKd3NqIBRqIgJqIhNqIC5BGXcgLkEOd3MgLkEDdnMgKmogNmogLUEZdyAtQQ53cyAtQQN2cyApaiA1aiAXQQ93IBdBDXdzIBdBCnZzaiIUQQ93IBRBDXdzIBRBCnZzaiIYIBJqIDkgEWogFCAJaiATIBIgEXNxIBFzaiATQRp3IBNBFXdzIBNBB3dzakHvxpXFB2oiCSACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIBtqIgNqIhEgEyASc3EgEnNqIBFBGncgEUEVd3MgEUEHd3NqQZTwoaZ4aiIbIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogGWoiAWoiEiARIBNzcSATc2ogEkEadyASQRV3cyASQQd3c2pBiISc5nhqIhkgASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAaaiICaiITIBIgEXNxIBFzaiATQRp3IBNBFXdzIBNBB3dzakH6//uFeWoiGiACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIBxqIgNqIhQgPGo2AuSJAUEAID8gAyACcyABcSADIAJxcyADQR53IANBE3dzIANBCndzaiAJaiIBIANzIAJxIAEgA3FzIAFBHncgAUETd3MgAUEKd3NqIBtqIgIgAXMgA3EgAiABcXMgAkEedyACQRN3cyACQQp3c2ogGWoiAyACcyABcSADIAJxcyADQR53IANBE3dzIANBCndzaiAaaiIJajYC1IkBQQAgPSAvQRl3IC9BDndzIC9BA3ZzICtqIDdqIBhBD3cgGEENd3MgGEEKdnNqIhggEWogFCATIBJzcSASc2ogFEEadyAUQRV3cyAUQQd3c2pB69nBonpqIhkgAWoiEWo2AuCJAUEAIEEgCSADcyACcSAJIANxcyAJQR53IAlBE3dzIAlBCndzaiAZaiIBajYC0IkBQQAgPiAwQRl3IDBBDndzIDBBA3ZzIC9qIBdqIDpBD3cgOkENd3MgOkEKdnNqIBJqIBEgFCATc3EgE3NqIBFBGncgEUEVd3MgEUEHd3NqQffH5vd7aiIXIAJqIhJqNgLciQFBACBDIAEgCXMgA3EgASAJcXMgAUEedyABQRN3cyABQQp3c2ogF2oiAmo2AsyJAUEAIDsgNEEZdyA0QQ53cyA0QQN2cyAwaiA4aiAYQQ93IBhBDXdzIBhBCnZzaiATaiASIBEgFHNxIBRzaiASQRp3IBJBFXdzIBJBB3dzakHy8cWzfGoiESADamo2AtiJAUEAIAAgAiABcyAJcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiARamo2AsiJAQuyBgIEfwF+QQAoAsCJASIAQQJ2QQ9xIgFBAnRBgIkBaiICIAIoAgBBfyAAQQN0IgB0QX9zcUGAASAAdHM2AgACQAJAAkAgAUEOSQ0AAkAgAUEORw0AQQBBADYCvIkBC0GAiQEQA0EAIQIMAQsgAUENRg0BIAFBAWohAgsgAiEDAkBBBiACa0EHcSIARQ0AIAIgAGohAyACQQJ0QYCJAWohAQNAIAFBADYCACABQQRqIQEgAEF/aiIADQALCyACQXlqQQdJDQAgA0ECdCEBA0AgAUGYiQFqQgA3AgAgAUGQiQFqQgA3AgAgAUGIiQFqQgA3AgAgAUGAiQFqQgA3AgAgAUEgaiIBQThHDQALC0EAIQFBAEEAKQPAiQEiBKciAEEbdCAAQQt0QYCA/AdxciAAQQV2QYD+A3EgAEEDdEEYdnJyNgK8iQFBACAEQh2IpyIAQRh0IABBgP4DcUEIdHIgAEEIdkGA/gNxIABBGHZycjYCuIkBQYCJARADQQBBACgC5IkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLkiQFBAEEAKALgiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AuCJAUEAQQAoAtyJASIAQRh0IABBgP4DcUEIdHIgAEEIdkGA/gNxIABBGHZycjYC3IkBQQBBACgC2IkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLYiQFBAEEAKALUiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AtSJAUEAQQAoAtCJASIAQRh0IABBgP4DcUEIdHIgAEEIdkGA/gNxIABBGHZycjYC0IkBQQBBACgCzIkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLMiQFBAEEAKALIiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AsiJAQJAQQAoAuiJASICRQ0AQQAhAANAIAFBgAlqIAFByIkBai0AADoAACABQQFqIQEgAiAAQQFqIgBB/wFxSw0ACwsLBgBBgIkBC6MBAEEAQgA3A8CJAUEAQRxBICABQeABRiIBGzYC6IkBQQBCp5/mp8b0k/2+f0Krs4/8kaOz8NsAIAEbNwPgiQFBAEKxloD+n6KFrOgAQv+kuYjFkdqCm38gARs3A9iJAUEAQpe6w4OTp5aHd0Ly5rvjo6f9p6V/IAEbNwPQiQFBAELYvZaI/KC1vjZC58yn0NbQ67O7fyABGzcDyIkBIAAQAhAECwsLAQBBgAgLBHAAAAA=",NC="8c18dd94",TC={name:EC,data:kC,hash:NC};new Bt;new Bt;function RC(){return CC(TC,32).then(e=>{e.init(256);const r={init:()=>(e.init(256),r),update:n=>(e.update(n),r),digest:n=>e.digest(n),save:()=>e.save(),load:n=>(e.load(n),r),blockSize:64,digestSize:32};return r})}new Bt;new Bt;new Bt;new Bt;new Bt;new Bt;new Bt;new Bt;new Bt;const kf="pi-forge/auth-token",Nf="pi-forge/auth-expires-at",Tf="pi-forge/auth-must-change-password";function ci(){const e=localStorage.getItem(kf),r=localStorage.getItem(Nf);if(!e||!r)return;if(new Date(r).getTime()<=Date.now()){Oi();return}const n=localStorage.getItem(Tf)==="true";return{token:e,expiresAt:r,mustChangePassword:n}}function Fy(e){localStorage.setItem(kf,e.token),localStorage.setItem(Nf,e.expiresAt),localStorage.setItem(Tf,e.mustChangePassword?"true":"false")}function Oi(){localStorage.removeItem(kf),localStorage.removeItem(Nf),localStorage.removeItem(Tf)}const zi="pi-forge:unauthorized";class we extends Error{constructor(n,s,a){super(a??`${n} ${s}`);Il(this,"status");Il(this,"code");this.status=n,this.code=s}}function jC(e){const r=()=>e();return window.addEventListener(zi,r),()=>window.removeEventListener(zi,r)}function Re(e,r){throw new we(e,"invalid_response_body",r)}function ke(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Ol=(e,r)=>{e!==void 0&&Re(r,"expected empty body")};function DC(e,r){return(!ke(e)||typeof e.authEnabled!="boolean")&&Re(r,"expected { authEnabled: boolean }"),{authEnabled:e.authEnabled}}function ex(e,r){return(!ke(e)||typeof e.token!="string"||typeof e.expiresAt!="string"||typeof e.mustChangePassword!="boolean")&&Re(r,"expected { token, expiresAt, mustChangePassword }"),{token:e.token,expiresAt:e.expiresAt,mustChangePassword:e.mustChangePassword}}function BC(e,r){return ex(e,r)}function IC(e,r){(!ke(e)||typeof e.minimal!="boolean"||typeof e.workspaceRoot!="string")&&Re(r,"expected { minimal: boolean, workspaceRoot: string }");const n=typeof e.version=="string"?e.version:"unknown",s=typeof e.passwordAuthEnabled=="boolean"?e.passwordAuthEnabled:!0;return{minimal:e.minimal,workspaceRoot:e.workspaceRoot,version:n,passwordAuthEnabled:s}}function LC(e,r){return(!ke(e)||e.status!=="ok"||typeof e.activeSessions!="number"||typeof e.activePtys!="number")&&Re(r,"expected { status: 'ok', activeSessions, activePtys }"),{status:"ok",activeSessions:e.activeSessions,activePtys:e.activePtys}}function Wh(e,r){return(!ke(e)||typeof e.id!="string"||typeof e.name!="string"||typeof e.path!="string"||typeof e.createdAt!="string")&&Re(r,"expected Project"),{id:e.id,name:e.name,path:e.path,createdAt:e.createdAt}}function MC(e,r){return(!ke(e)||!Array.isArray(e.projects))&&Re(r,"expected { projects: Project[] }"),{projects:e.projects.map(n=>Wh(n,r))}}function OC(e,r){return(!ke(e)||typeof e.name!="string"||typeof e.path!="string"||typeof e.isGitRepo!="boolean")&&Re(r,"expected BrowseEntry"),{name:e.name,path:e.path,isGitRepo:e.isGitRepo}}function zC(e,r){return(!ke(e)||typeof e.path!="string"||!(e.parentPath===null||e.parentPath===void 0||typeof e.parentPath=="string")||!Array.isArray(e.entries))&&Re(r,"expected BrowseResponse"),{path:e.path,parentPath:typeof e.parentPath=="string"?e.parentPath:null,entries:e.entries.map(n=>OC(n,r))}}function FC(e,r){return(!ke(e)||typeof e.path!="string")&&Re(r,"expected { path }"),{path:e.path}}function PC(e,r){(!ke(e)||typeof e.sessionId!="string"||typeof e.projectId!="string"||typeof e.isLive!="boolean"||typeof e.workspacePath!="string"||typeof e.lastActivityAt!="string"||typeof e.createdAt!="string"||typeof e.messageCount!="number"||typeof e.firstMessage!="string")&&Re(r,"expected UnifiedSession");const n={sessionId:e.sessionId,projectId:e.projectId,isLive:e.isLive,workspacePath:e.workspacePath,lastActivityAt:e.lastActivityAt,createdAt:e.createdAt,messageCount:e.messageCount,firstMessage:e.firstMessage};return typeof e.name=="string"&&(n.name=e.name),typeof e.parentSessionId=="string"&&(n.parentSessionId=e.parentSessionId),typeof e.runId=="string"&&(n.runId=e.runId),typeof e.path=="string"&&(n.path=e.path),n}function HC(e,r){return(!ke(e)||!Array.isArray(e.sessions))&&Re(r,"expected { sessions: UnifiedSession[] }"),{sessions:e.sessions.map(n=>PC(n,r))}}function zl(e,r){(!ke(e)||typeof e.sessionId!="string"||typeof e.projectId!="string"||typeof e.workspacePath!="string"||typeof e.createdAt!="string"||typeof e.lastActivityAt!="string"||typeof e.isLive!="boolean"||typeof e.messageCount!="number"||typeof e.isStreaming!="boolean")&&Re(r,"expected SessionSummary");const n={sessionId:e.sessionId,projectId:e.projectId,workspacePath:e.workspacePath,createdAt:e.createdAt,lastActivityAt:e.lastActivityAt,isLive:e.isLive,messageCount:e.messageCount,isStreaming:e.isStreaming};return typeof e.name=="string"&&(n.name=e.name),n}function sh(e,r){return(!ke(e)||e.accepted!==!0)&&Re(r,"expected { accepted: true }"),{accepted:!0}}function ah(e,r){return(!ke(e)||!Array.isArray(e.skills))&&Re(r,"expected { skills: SkillSummary[] }"),{skills:e.skills.map(n=>{(!ke(n)||typeof n.name!="string"||typeof n.description!="string"||n.source!=="global"&&n.source!=="project"&&n.source!=="extension"||typeof n.filePath!="string"||typeof n.enabled!="boolean"||typeof n.effective!="boolean"||typeof n.disableModelInvocation!="boolean")&&Re(r,"expected SkillSummary");const s={name:n.name,description:n.description,source:n.source,filePath:n.filePath,enabled:n.enabled,effective:n.effective,disableModelInvocation:n.disableModelInvocation};return typeof n.extensionPath=="string"&&(s.extensionPath=n.extensionPath),(n.projectOverride==="enabled"||n.projectOverride==="disabled")&&(s.projectOverride=n.projectOverride),s})}}function UC(e,r){(!ke(e)||!ke(e.projects))&&Re(r,"expected { projects: { ... } }");const n={};for(const[s,a]of Object.entries(e.projects)){if(!ke(a))continue;const u=Array.isArray(a.enable)?a.enable.filter(o=>typeof o=="string"):[],d=Array.isArray(a.disable)?a.disable.filter(o=>typeof o=="string"):[];n[s]={enable:u,disable:d}}return{projects:n}}function $C(e,r){return(!ke(e)||!Array.isArray(e.providers))&&Re(r,"expected { providers: [...] }"),{providers:e.providers}}function qC(e,r){return(!ke(e)||!ke(e.servers)||!Array.isArray(e.status))&&Re(r,"expected { servers, status[] }"),e}function Py(e,r){return(!ke(e)||typeof e.enabled!="boolean"||typeof e.connected!="number"||typeof e.total!="number")&&Re(r,"expected { enabled, connected, total }"),{enabled:e.enabled,connected:e.connected,total:e.total}}function QC(e,r){return(!ke(e)||!ke(e.status))&&Re(r,"expected { status: {...} }"),{status:e.status}}function GC(e,r){return(!ke(e)||!Array.isArray(e.tools))&&Re(r,"expected { tools: [...] }"),{tools:e.tools}}function WC(e,r){return(!ke(e)||e.ok!==!0)&&Re(r,"expected { ok: true }"),{ok:!0}}function KC(e,r){return(!ke(e)||typeof e.removed!="boolean")&&Re(r,"expected { removed: boolean }"),{removed:e.removed}}function VC(e,r){return(!ke(e)||!ke(e.providers))&&Re(r,"expected { providers: { ... } }"),e}function Hy(e,r){return ke(e)||Re(r,"expected settings object"),e}function Uy(e,r){return(!ke(e)||!ke(e.providers))&&Re(r,"expected { providers: {...} }"),e}function tx(e,r){ke(e)||Re(r,"expected FileTreeNode");const n=e.type;(typeof e.name!="string"||typeof e.path!="string"||n!=="file"&&n!=="directory")&&Re(r,"expected FileTreeNode");const s={name:e.name,path:e.path,type:n};return Array.isArray(e.children)&&(s.children=e.children.map(a=>tx(a,r))),typeof e.truncated=="boolean"&&(s.truncated=e.truncated),s}function XC(e,r){return(!ke(e)||typeof e.path!="string"||typeof e.content!="string"||typeof e.size!="number"||typeof e.language!="string"||typeof e.binary!="boolean")&&Re(r,"expected FileReadResponse"),{path:e.path,content:e.content,size:e.size,language:e.language,binary:e.binary}}function YC(e,r){return(!ke(e)||!Array.isArray(e.entries))&&Re(r,"expected { entries: TurnDiffEntry[] }"),{entries:e.entries.map(n=>((!ke(n)||typeof n.file!="string"||n.tool!=="write"&&n.tool!=="edit"||typeof n.diff!="string"||typeof n.additions!="number"||typeof n.deletions!="number"||typeof n.isPureAddition!="boolean")&&Re(r,"expected TurnDiffEntry"),{file:n.file,tool:n.tool,diff:n.diff,additions:n.additions,deletions:n.deletions,isPureAddition:n.isPureAddition}))}}function ZC(e,r){(!ke(e)||typeof e.isGitRepo!="boolean"||!Array.isArray(e.files))&&Re(r,"expected GitStatus");const n={isGitRepo:e.isGitRepo,files:e.files.map(s=>{(!ke(s)||typeof s.path!="string"||typeof s.staged!="boolean"||typeof s.unstaged!="boolean"||typeof s.kind!="string"||typeof s.code!="string")&&Re(r,"expected GitFileStatus");const a={path:s.path,staged:s.staged,unstaged:s.unstaged,kind:s.kind,code:s.code};return typeof s.originalPath=="string"&&(a.originalPath=s.originalPath),a})};return typeof e.branch=="string"&&(n.branch=e.branch),n}function oh(e,r){return(!ke(e)||typeof e.isGitRepo!="boolean"||typeof e.diff!="string")&&Re(r,"expected GitDiffResponse"),{isGitRepo:e.isGitRepo,diff:e.diff}}function JC(e,r){return(!ke(e)||typeof e.isGitRepo!="boolean"||!Array.isArray(e.commits))&&Re(r,"expected GitLogResponse"),{isGitRepo:e.isGitRepo,commits:e.commits.map(n=>((!ke(n)||typeof n.hash!="string"||typeof n.message!="string"||typeof n.author!="string"||typeof n.date!="string"||!Array.isArray(n.parents)||!Array.isArray(n.refs))&&Re(r,"expected GitLogEntry"),{hash:n.hash,message:n.message,author:n.author,date:n.date,parents:n.parents.filter(s=>typeof s=="string"),refs:n.refs.filter(s=>typeof s=="string")}))}}function eE(e,r){(!ke(e)||typeof e.isGitRepo!="boolean"||!Array.isArray(e.branches))&&Re(r,"expected GitBranchesResponse");const n={isGitRepo:e.isGitRepo,branches:e.branches.map(s=>((!ke(s)||typeof s.name!="string"||typeof s.current!="boolean"||typeof s.remote!="boolean")&&Re(r,"expected GitBranch"),{name:s.name,current:s.current,remote:s.remote}))};return typeof e.current=="string"&&(n.current=e.current),n}function tE(e,r){(!ke(e)||!Array.isArray(e.messages)||typeof e.totalInputTokens!="number"||typeof e.totalOutputTokens!="number"||typeof e.totalCacheReadTokens!="number"||typeof e.totalCacheWriteTokens!="number"||typeof e.totalTokens!="number"||typeof e.totalCost!="number"||!Array.isArray(e.turns)||!ke(e.contextUsage))&&Re(r,"expected SessionContextResponse");const n=e.turns.map(u=>{(!ke(u)||typeof u.index!="number"||typeof u.inputTokens!="number"||typeof u.outputTokens!="number"||typeof u.cacheReadTokens!="number"||typeof u.cacheWriteTokens!="number"||typeof u.totalTokens!="number"||typeof u.cost!="number"||typeof u.model!="string"||typeof u.provider!="string"||typeof u.timestamp!="number")&&Re(r,"expected ContextTurn");const d={index:u.index,inputTokens:u.inputTokens,outputTokens:u.outputTokens,cacheReadTokens:u.cacheReadTokens,cacheWriteTokens:u.cacheWriteTokens,totalTokens:u.totalTokens,cost:u.cost,model:u.model,provider:u.provider,timestamp:u.timestamp};return typeof u.stopReason=="string"&&(d.stopReason=u.stopReason),d}),s=e.contextUsage,a={contextWindow:typeof s.contextWindow=="number"?s.contextWindow:0};return typeof s.tokens=="number"&&(a.tokens=s.tokens),typeof s.percent=="number"&&(a.percent=s.percent),{messages:e.messages.filter(u=>ke(u)),totalInputTokens:e.totalInputTokens,totalOutputTokens:e.totalOutputTokens,totalCacheReadTokens:e.totalCacheReadTokens,totalCacheWriteTokens:e.totalCacheWriteTokens,totalTokens:e.totalTokens,totalCost:e.totalCost,turns:n,contextUsage:a}}function nE(e,r){(!ke(e)||!(e.leafId===null||typeof e.leafId=="string")||!Array.isArray(e.branchIds)||!Array.isArray(e.entries))&&Re(r,"expected SessionTreeResponse");const n=e.branchIds.filter(a=>typeof a=="string"),s=e.entries.map(a=>{(!ke(a)||typeof a.id!="string"||!(a.parentId===null||typeof a.parentId=="string")||typeof a.type!="string"||typeof a.timestamp!="string")&&Re(r,"expected SessionTreeEntry");const u={id:a.id,parentId:a.parentId,type:a.type,timestamp:a.timestamp};return typeof a.role=="string"&&(u.role=a.role),typeof a.preview=="string"&&(u.preview=a.preview),typeof a.label=="string"&&(u.label=a.label),u});return{leafId:e.leafId,branchIds:n,entries:s}}function rE(e,r){return(!ke(e)||!Array.isArray(e.files))&&Re(r,"expected { files: UploadedFile[] }"),{files:e.files.map(n=>((!ke(n)||typeof n.path!="string"||typeof n.size!="number"||typeof n.sha256!="string")&&Re(r,"expected UploadedFile"),{path:n.path,size:n.size,sha256:n.sha256}))}}function iE(e,r){return(!ke(e)||e.engine!=="ripgrep"&&e.engine!=="node"||typeof e.truncated!="boolean"||!Array.isArray(e.matches))&&Re(r,"expected SearchResponse"),{engine:e.engine,truncated:e.truncated,matches:e.matches.map(n=>((!ke(n)||typeof n.path!="string"||typeof n.line!="number"||typeof n.column!="number"||typeof n.length!="number"||typeof n.lineSnippet!="string")&&Re(r,"expected SearchMatch"),{path:n.path,line:n.line,column:n.column,length:n.length,lineSnippet:n.lineSnippet}))}}function sE(e,r){return(!ke(e)||typeof e.isGitRepo!="boolean"||!Array.isArray(e.remotes))&&Re(r,"expected GitRemotesResponse"),{isGitRepo:e.isGitRepo,remotes:e.remotes.map(n=>((!ke(n)||typeof n.name!="string"||typeof n.fetchUrl!="string"||typeof n.pushUrl!="string")&&Re(r,"expected GitRemote"),{name:n.name,fetchUrl:n.fetchUrl,pushUrl:n.pushUrl}))}}function Fl(e,r){return(!ke(e)||typeof e.path!="string")&&Re(r,"expected { path: string }"),{path:e.path}}async function aE(e,r){const n=await RC();n.init();const s=e.stream().getReader();let a=!1;try{for(;;){const{value:u,done:d}=await s.read();if(d)break;n.update(u),r==null||r(u.byteLength)}}catch(u){throw a=!0,await s.cancel().catch(()=>{}),u}finally{a||s.releaseLock()}return n.digest("hex")}function lh(e){const r=/filename\*=UTF-8''([^;\r\n]+)/i.exec(e);if(r!==null)try{return decodeURIComponent(r[1])}catch{}const n=/filename="([^"]+)"/i.exec(e)??/filename=([^;\r\n]+)/i.exec(e);if(n!==null)return n[1]}function oE(e){if(e==="")return{ok:!0,value:void 0};try{return{ok:!0,value:JSON.parse(e)}}catch{return{ok:!1}}}async function Ee(e,r,n={}){const s={Accept:"application/json"};if(!n.skipAuth){const h=ci();h&&(s.Authorization=`Bearer ${h.token}`)}const a=n.body instanceof FormData;n.body!==void 0&&!a&&(s["Content-Type"]="application/json");const u={method:n.method??"GET",headers:s};n.body!==void 0&&(u.body=a?n.body:JSON.stringify(n.body)),n.signal!==void 0&&(u.signal=n.signal);let d;try{d=await fetch(e,u)}catch(h){throw h instanceof Error&&h.name==="AbortError"?h:new we(0,"network_error",h.message)}d.status===401&&!n.skipAuth&&(Oi(),window.dispatchEvent(new Event(zi)));const o=await d.text(),c=oE(o);if(!d.ok){let h;throw c.ok&&ke(c.value)&&"error"in c.value?h=String(c.value.error):c.ok?h="request_failed":h="invalid_error_body",new we(d.status,h,c.ok?void 0:`non-JSON ${d.status} body`)}if(!c.ok)throw new we(d.status,"invalid_response_body","server returned non-JSON 2xx body");return r(c.value,d.status)}const be={authStatus:()=>Ee("/api/v1/auth/status",DC,{skipAuth:!0}),login:e=>Ee("/api/v1/auth/login",ex,{method:"POST",body:{password:e},skipAuth:!0}),changePassword:(e,r)=>Ee("/api/v1/auth/change-password",BC,{method:"POST",body:{currentPassword:e,newPassword:r}}),health:()=>Ee("/api/v1/health",LC,{skipAuth:!0}),uiConfig:()=>Ee("/api/v1/ui-config",IC,{skipAuth:!0}),listProjects:()=>Ee("/api/v1/projects",MC),createProject:(e,r)=>Ee("/api/v1/projects",Wh,{method:"POST",body:{name:e,path:r}}),renameProject:(e,r)=>Ee(`/api/v1/projects/${encodeURIComponent(e)}`,Wh,{method:"PATCH",body:{name:r}}),deleteProject:(e,r)=>{const n=(r==null?void 0:r.cascade)===!0?"?cascade=1":"";return Ee(`/api/v1/projects/${encodeURIComponent(e)}${n}`,(s,a)=>((!ke(s)||typeof s.cascaded!="boolean")&&Re(a,"expected { cascaded }"),{cascaded:s.cascaded}),{method:"DELETE"})},browse:e=>{const r=e!==void 0?`?path=${encodeURIComponent(e)}`:"";return Ee(`/api/v1/projects/browse${r}`,zC)},mkdir:(e,r)=>Ee("/api/v1/projects/browse/mkdir",FC,{method:"POST",body:{parentPath:e,name:r}}),listSessions:e=>{const r=e!==void 0?`?projectId=${encodeURIComponent(e)}`:"";return Ee(`/api/v1/sessions${r}`,HC)},createSession:e=>Ee("/api/v1/sessions",zl,{method:"POST",body:{projectId:e}}),getSession:e=>Ee(`/api/v1/sessions/${encodeURIComponent(e)}`,zl),getMessages:e=>Ee(`/api/v1/sessions/${encodeURIComponent(e)}/messages`,(r,n)=>((!ke(r)||!Array.isArray(r.messages))&&Re(n,"expected { messages: [...] }"),{messages:r.messages})),getCompactions:e=>Ee(`/api/v1/sessions/${encodeURIComponent(e)}/compactions`,(r,n)=>((!ke(r)||!Array.isArray(r.compactions))&&Re(n,"expected { compactions: [...] }"),{compactions:r.compactions})),disposeSession:(e,r)=>{const n=(r==null?void 0:r.hard)===!0?"?hard=1":"";return Ee(`/api/v1/sessions/${encodeURIComponent(e)}${n}`,Ol,{method:"DELETE"})},renameSession:(e,r)=>Ee(`/api/v1/sessions/${encodeURIComponent(e)}/name`,zl,{method:"POST",body:{name:r}}),getSessionContext:(e,r)=>Ee(`/api/v1/sessions/${encodeURIComponent(e)}/context`,tE,r!==void 0?{signal:r}:{}),getSessionTree:e=>Ee(`/api/v1/sessions/${encodeURIComponent(e)}/tree`,nE),navigateSession:(e,r,n)=>{const s={entryId:r};return(n==null?void 0:n.summarize)!==void 0&&(s.summarize=n.summarize),(n==null?void 0:n.customInstructions)!==void 0&&(s.customInstructions=n.customInstructions),(n==null?void 0:n.label)!==void 0&&(s.label=n.label),Ee(`/api/v1/sessions/${encodeURIComponent(e)}/navigate`,(a,u)=>(ke(a)||Re(u,"expected navigate result"),a),{method:"POST",body:s})},forkSession:(e,r)=>Ee(`/api/v1/sessions/${encodeURIComponent(e)}/fork`,zl,{method:"POST",body:{entryId:r}}),getTurnDiff:e=>Ee(`/api/v1/sessions/${encodeURIComponent(e)}/turn-diff`,YC),prompt:(e,r,n)=>{const s=`/api/v1/sessions/${encodeURIComponent(e)}/prompt`;if((n==null?void 0:n.attachments)!==void 0&&n.attachments.length>0){const u=new FormData;u.append("text",r),n.streamingBehavior!==void 0&&u.append("streamingBehavior",n.streamingBehavior);for(const d of n.attachments)u.append("attachments",d,d.name);return Ee(s,sh,{method:"POST",body:u})}const a={text:r};return(n==null?void 0:n.streamingBehavior)!==void 0&&(a.streamingBehavior=n.streamingBehavior),Ee(s,sh,{method:"POST",body:a})},steer:(e,r,n)=>{const s={text:r};return n!==void 0&&(s.mode=n),Ee(`/api/v1/sessions/${encodeURIComponent(e)}/steer`,sh,{method:"POST",body:s})},abort:e=>Ee(`/api/v1/sessions/${encodeURIComponent(e)}/abort`,Ol,{method:"POST"}),compact:e=>Ee(`/api/v1/sessions/${encodeURIComponent(e)}/compact`,(r,n)=>(ke(r)||Re(n,"expected compact result object"),{summary:typeof r.summary=="string"?r.summary:void 0,tokensBefore:typeof r.tokensBefore=="number"?r.tokensBefore:void 0,tokensAfter:typeof r.tokensAfter=="number"?r.tokensAfter:void 0}),{method:"POST",body:{}}),exec:(e,r,n)=>Ee(`/api/v1/sessions/${encodeURIComponent(e)}/exec`,(s,a)=>((!ke(s)||!("exitCode"in s)||typeof s.output!="string"||typeof s.durationMs!="number"||typeof s.truncated!="boolean"||typeof s.cancelled!="boolean")&&Re(a,"expected { exitCode, output, durationMs, truncated, cancelled }"),{exitCode:typeof s.exitCode=="number"?s.exitCode:null,output:s.output,durationMs:s.durationMs,truncated:s.truncated,cancelled:s.cancelled}),{method:"POST",body:{command:r,excludeFromContext:(n==null?void 0:n.excludeFromContext)===!0}}),setModel:(e,r,n)=>Ee(`/api/v1/sessions/${encodeURIComponent(e)}/model`,(s,a)=>((!ke(s)||typeof s.provider!="string"||typeof s.modelId!="string")&&Re(a,"expected { provider, modelId }"),{provider:s.provider,modelId:s.modelId}),{method:"POST",body:{provider:r,modelId:n}}),getModelsJson:()=>Ee("/api/v1/config/models",Uy),setModelsJson:e=>Ee("/api/v1/config/models",Uy,{method:"PUT",body:e}),getProviders:()=>Ee("/api/v1/config/providers",$C),getSettings:()=>Ee("/api/v1/config/settings",Hy),updateSettings:e=>Ee("/api/v1/config/settings",Hy,{method:"PUT",body:e}),getAuthSummary:()=>Ee("/api/v1/config/auth",VC),setApiKey:(e,r)=>Ee(`/api/v1/config/auth/${encodeURIComponent(e)}`,(n,s)=>((!ke(n)||typeof n.provider!="string"||n.configured!==!0)&&Re(s,"expected { provider, configured: true }"),{provider:n.provider,configured:!0}),{method:"PUT",body:{apiKey:r}}),removeApiKey:e=>Ee(`/api/v1/config/auth/${encodeURIComponent(e)}`,Ol,{method:"DELETE"}),getMcpSettings:()=>Ee("/api/v1/mcp/settings",Py),setMcpEnabled:e=>Ee("/api/v1/mcp/settings",Py,{method:"PUT",body:{enabled:e}}),listMcpServers:e=>{const r=e!==void 0?`?projectId=${encodeURIComponent(e)}`:"";return Ee(`/api/v1/mcp/servers${r}`,qC)},upsertMcpServer:(e,r)=>Ee(`/api/v1/mcp/servers/${encodeURIComponent(e)}`,WC,{method:"PUT",body:r}),deleteMcpServer:e=>Ee(`/api/v1/mcp/servers/${encodeURIComponent(e)}`,KC,{method:"DELETE"}),probeMcpServer:(e,r)=>{const n=r!==void 0?`?projectId=${encodeURIComponent(r)}`:"";return Ee(`/api/v1/mcp/servers/${encodeURIComponent(e)}/probe${n}`,QC,{method:"POST",body:{}})},listMcpTools:e=>Ee(`/api/v1/mcp/tools?projectId=${encodeURIComponent(e)}`,GC),listSkills:e=>Ee(`/api/v1/config/skills?projectId=${encodeURIComponent(e)}`,ah),listSkillOverrides:()=>Ee("/api/v1/config/skills/overrides",UC),setSkillEnabled:(e,r,n,s="global")=>Ee(`/api/v1/config/skills/${encodeURIComponent(r)}/enabled?projectId=${encodeURIComponent(e)}`,ah,{method:"PUT",body:{enabled:n,scope:s}}),clearSkillProjectOverride:(e,r)=>Ee(`/api/v1/config/skills/${encodeURIComponent(r)}/enabled?projectId=${encodeURIComponent(e)}`,ah,{method:"DELETE"}),listTools:e=>{const r=e!==void 0&&e.length>0?`?projectId=${encodeURIComponent(e)}`:"";return Ee(`/api/v1/config/tools${r}`,n=>{if(!ke(n)||!Array.isArray(n.builtin)||!Array.isArray(n.mcp)||n.extension!==void 0&&!Array.isArray(n.extension))throw new we(0,"invalid_response_body");const s=n;return s.extension===void 0&&(s.extension=[]),s})},setToolEnabled:(e,r,n,s="global",a)=>{const u=s==="project"&&a!==void 0?`?projectId=${encodeURIComponent(a)}`:"";return Ee(`/api/v1/config/tools/${e}/${encodeURIComponent(r)}/enabled${u}`,d=>{if(!ke(d)||typeof d.family!="string"||typeof d.name!="string"||typeof d.enabled!="boolean"||typeof d.scope!="string")throw new we(0,"invalid_response_body");return{family:d.family,name:d.name,enabled:d.enabled,scope:d.scope}},{method:"PUT",body:{enabled:n,scope:s}})},listToolOverrides:()=>Ee("/api/v1/config/tools/overrides",e=>{if(!ke(e)||typeof e.projects!="object"||e.projects===null)throw new we(0,"invalid_response_body");const r=e.projects;for(const n of Object.values(r))(n.extension===void 0||n.extension===null)&&(n.extension={enable:[],disable:[]});return e}),clearToolProjectOverride:(e,r,n)=>Ee(`/api/v1/config/tools/${e}/${encodeURIComponent(r)}/enabled?projectId=${encodeURIComponent(n)}`,s=>{if(!ke(s)||typeof s.family!="string"||typeof s.name!="string"||typeof s.projectId!="string")throw new we(0,"invalid_response_body");return{family:s.family,name:s.name,projectId:s.projectId}},{method:"DELETE"}),exportConfig:async()=>{const e={},r=ci();r!==void 0&&(e.Authorization=`Bearer ${r.token}`);const n=await fetch("/api/v1/config/export",{headers:e});if(n.status===401)throw Oi(),window.dispatchEvent(new Event(zi)),new we(401,"unauthorized");if(!n.ok){let c="request_failed";try{const h=await n.json();typeof h.error=="string"&&(c=h.error)}catch{}throw new we(n.status,c)}const s=await n.blob(),a=n.headers.get("Content-Disposition")??"",u=lh(a)??"pi-forge-config.tar.gz",o=(n.headers.get("X-Pi-Forge-Files")??"").split(",").filter(c=>c.length>0);return{blob:s,filename:u,files:o}},importConfig:e=>{const r=new FormData;return r.append("file",e,e.name),Ee("/api/v1/config/import",n=>{if(!ke(n)||!Array.isArray(n.imported)||!Array.isArray(n.skipped)||!Array.isArray(n.errors))throw new we(0,"invalid_response_body");return n},{method:"POST",body:r})},exportSkills:async()=>{const e={},r=ci();r!==void 0&&(e.Authorization=`Bearer ${r.token}`);const n=await fetch("/api/v1/config/skills/export",{headers:e});if(n.status===401)throw Oi(),window.dispatchEvent(new Event(zi)),new we(401,"unauthorized");if(!n.ok){let c="request_failed";try{const h=await n.json();typeof h.error=="string"&&(c=h.error)}catch{}throw new we(n.status,c)}const s=await n.blob(),a=n.headers.get("Content-Disposition")??"",u=lh(a)??"pi-forge-skills.tar.gz",d=n.headers.get("X-Pi-Forge-File-Count")??"0",o=Number.parseInt(d,10)||0;return{blob:s,filename:u,fileCount:o}},importSkills:e=>{const r=new FormData;for(const n of e){const s=n.webkitRelativePath,a=s!==void 0&&s.length>0?s:n.name;r.append("file",n,a)}return Ee("/api/v1/config/skills/import",n=>{if(!ke(n)||!Array.isArray(n.imported)||!Array.isArray(n.skipped))throw new we(0,"invalid_response_body");return n},{method:"POST",body:r})},filesTree:(e,r)=>{const n=new URLSearchParams({projectId:e});return r!==void 0&&n.set("maxDepth",String(r)),Ee(`/api/v1/files/tree?${n.toString()}`,tx)},filesRead:(e,r)=>{const n=new URLSearchParams({projectId:e,path:r});return Ee(`/api/v1/files/read?${n.toString()}`,XC)},filesWrite:(e,r,n)=>Ee("/api/v1/files/write",Fl,{method:"PUT",body:{projectId:e,path:r,content:n}}),filesMkdir:(e,r,n)=>Ee("/api/v1/files/mkdir",Fl,{method:"POST",body:{projectId:e,parentPath:r,name:n}}),filesRename:(e,r,n)=>Ee("/api/v1/files/rename",Fl,{method:"POST",body:{projectId:e,path:r,name:n}}),filesMove:(e,r,n)=>Ee("/api/v1/files/move",Fl,{method:"POST",body:{projectId:e,src:r,dest:n}}),filesDelete:(e,r,n)=>{const s=new URLSearchParams({projectId:e,path:r});return(n==null?void 0:n.recursive)===!0&&s.set("recursive","true"),Ee(`/api/v1/files/delete?${s.toString()}`,Ol,{method:"DELETE"})},filesDownload:async(e,r)=>{const n=new URLSearchParams({projectId:e});r!==void 0&&r.length>0&&n.set("path",r);const s={},a=ci();a!==void 0&&(s.Authorization=`Bearer ${a.token}`);const u=await fetch(`/api/v1/files/download?${n.toString()}`,{headers:s});if(u.status===401)throw Oi(),window.dispatchEvent(new Event(zi)),new we(401,"unauthorized");if(!u.ok){let c="request_failed";try{const h=await u.json();typeof h.error=="string"&&(c=h.error)}catch{}throw new we(u.status,c)}const d=await u.blob(),o=u.headers.get("Content-Disposition")??"";return{blob:d,filename:lh(o)??"download"}},uploadFiles:async(e,r,n,s)=>{const a=new FormData;a.append("projectId",e),a.append("parentPath",r),(s==null?void 0:s.overwrite)===!0&&a.append("overwrite","1");const u=n.reduce((o,c)=>o+c.size,0);let d=0;for(const o of n){const c=await aE(o,h=>{var m;d+=h,(m=s==null?void 0:s.onHashProgress)==null||m.call(s,d,u)});a.append(`sha256:${o.name}`,c)}for(const o of n)a.append("files",o,o.name);return Ee("/api/v1/files/upload",rE,{method:"POST",body:a,...(s==null?void 0:s.signal)!==void 0?{signal:s.signal}:{}})},completeFiles:(e,r,n)=>{const s=new URLSearchParams({projectId:e,query:r});return(n==null?void 0:n.limit)!==void 0&&s.set("limit",String(n.limit)),Ee(`/api/v1/files/complete?${s.toString()}`,(a,u)=>((!ke(a)||!Array.isArray(a.paths))&&Re(u,"expected { paths: string[] }"),{paths:a.paths.filter(d=>typeof d=="string")}),(n==null?void 0:n.signal)!==void 0?{signal:n.signal}:{})},searchFiles:(e,r,n)=>{const s=new URLSearchParams({projectId:e,q:r.query});return r.regex===!0&&s.set("regex","1"),r.caseSensitive===!0&&s.set("caseSensitive","1"),r.includeGitignored===!0&&s.set("includeGitignored","1"),r.include!==void 0&&r.include.length>0&&s.set("include",r.include),r.exclude!==void 0&&r.exclude.length>0&&s.set("exclude",r.exclude),r.limit!==void 0&&s.set("limit",String(r.limit)),Ee(`/api/v1/files/search?${s.toString()}`,iE,n!==void 0?{signal:n}:{})},gitInit:e=>Ee("/api/v1/git/init",(r,n)=>((!ke(r)||typeof r.alreadyInitialised!="boolean"||typeof r.isGitRepo!="boolean")&&Re(n,"expected { alreadyInitialised, isGitRepo }"),{alreadyInitialised:r.alreadyInitialised,isGitRepo:r.isGitRepo}),{method:"POST",body:{projectId:e}}),gitStatus:e=>Ee(`/api/v1/git/status?projectId=${encodeURIComponent(e)}`,ZC),gitDiff:e=>Ee(`/api/v1/git/diff?projectId=${encodeURIComponent(e)}`,oh),gitDiffStaged:e=>Ee(`/api/v1/git/diff/staged?projectId=${encodeURIComponent(e)}`,oh),gitDiffFile:(e,r,n)=>{const s=new URLSearchParams({projectId:e,path:r});return n&&s.set("staged","1"),Ee(`/api/v1/git/diff/file?${s.toString()}`,oh)},gitLog:(e,r)=>{const n=new URLSearchParams({projectId:e});return r!==void 0&&n.set("limit",String(r)),Ee(`/api/v1/git/log?${n.toString()}`,JC)},gitBranches:e=>Ee(`/api/v1/git/branches?projectId=${encodeURIComponent(e)}`,eE),gitRemotes:e=>Ee(`/api/v1/git/remotes?projectId=${encodeURIComponent(e)}`,sE),gitRemoteAdd:(e,r,n)=>Ee("/api/v1/git/remote/add",(s,a)=>((!ke(s)||s.ok!==!0)&&Re(a,"expected { ok: true }"),{ok:!0}),{method:"POST",body:{projectId:e,name:r,url:n}}),gitRemoteRemove:(e,r)=>Ee(`/api/v1/git/remote/${encodeURIComponent(r)}?projectId=${encodeURIComponent(e)}`,(n,s)=>((!ke(n)||n.ok!==!0)&&Re(s,"expected { ok: true }"),{ok:!0}),{method:"DELETE"}),gitCheckout:(e,r)=>Ee("/api/v1/git/checkout",(n,s)=>((!ke(n)||n.ok!==!0)&&Re(s,"expected { ok: true }"),{ok:!0}),{method:"POST",body:{projectId:e,branch:r}}),gitBranchCreate:(e,r,n)=>{const s={projectId:e,name:r};return(n==null?void 0:n.startPoint)!==void 0&&(s.startPoint=n.startPoint),(n==null?void 0:n.checkout)!==void 0&&(s.checkout=n.checkout),Ee("/api/v1/git/branch/create",(a,u)=>((!ke(a)||a.ok!==!0)&&Re(u,"expected { ok: true }"),{ok:!0}),{method:"POST",body:s})},gitBranchDelete:(e,r,n)=>{const s=new URLSearchParams({projectId:e});return n===!0&&s.set("force","1"),Ee(`/api/v1/git/branch/${encodeURIComponent(r)}?${s.toString()}`,(a,u)=>((!ke(a)||a.ok!==!0)&&Re(u,"expected { ok: true }"),{ok:!0}),{method:"DELETE"})},gitStage:(e,r)=>Ee("/api/v1/git/stage",(n,s)=>((!ke(n)||n.ok!==!0)&&Re(s,"expected { ok: true }"),{ok:!0}),{method:"POST",body:{projectId:e,paths:r}}),gitUnstage:(e,r)=>Ee("/api/v1/git/unstage",(n,s)=>((!ke(n)||n.ok!==!0)&&Re(s,"expected { ok: true }"),{ok:!0}),{method:"POST",body:{projectId:e,paths:r}}),gitRevert:(e,r)=>Ee("/api/v1/git/revert",(n,s)=>((!ke(n)||n.ok!==!0)&&Re(s,"expected { ok: true }"),{ok:!0}),{method:"POST",body:{projectId:e,paths:r}}),gitCommit:(e,r)=>Ee("/api/v1/git/commit",(n,s)=>((!ke(n)||typeof n.hash!="string")&&Re(s,"expected { hash }"),{hash:n.hash}),{method:"POST",body:{projectId:e,message:r}}),gitFetch:(e,r)=>{const n={projectId:e};return(r==null?void 0:r.remote)!==void 0&&(n.remote=r.remote),(r==null?void 0:r.prune)!==void 0&&(n.prune=r.prune),Ee("/api/v1/git/fetch",(s,a)=>((!ke(s)||typeof s.output!="string")&&Re(a,"expected { output }"),{output:s.output}),{method:"POST",body:n})},gitPull:(e,r)=>{const n={projectId:e};return(r==null?void 0:r.remote)!==void 0&&(n.remote=r.remote),(r==null?void 0:r.branch)!==void 0&&(n.branch=r.branch),(r==null?void 0:r.rebase)!==void 0&&(n.rebase=r.rebase),Ee("/api/v1/git/pull",(s,a)=>((!ke(s)||typeof s.output!="string")&&Re(a,"expected { output }"),{output:s.output}),{method:"POST",body:n})},gitPush:(e,r)=>{const n={projectId:e};return(r==null?void 0:r.remote)!==void 0&&(n.remote=r.remote),(r==null?void 0:r.branch)!==void 0&&(n.branch=r.branch),(r==null?void 0:r.setUpstream)!==void 0&&(n.setUpstream=r.setUpstream),Ee("/api/v1/git/push",(s,a)=>((!ke(s)||typeof s.output!="string")&&Re(a,"expected { output }"),{output:s.output}),{method:"POST",body:n})}},on=Ir((e,r)=>({ready:!1,authRequired:!1,isAuthenticated:!1,mustChangePassword:!1,loginError:void 0,loginPending:!1,changePasswordError:void 0,changePasswordPending:!1,bootstrap:async()=>{try{const{authEnabled:n}=await be.authStatus();if(!n){e({ready:!0,authRequired:!1,isAuthenticated:!0,mustChangePassword:!1});return}const s=ci();e({ready:!0,authRequired:!0,isAuthenticated:s!==void 0,mustChangePassword:(s==null?void 0:s.mustChangePassword)??!1})}catch(n){e({ready:!0,authRequired:!0,isAuthenticated:!1,mustChangePassword:!1,loginError:n instanceof Error?n.message:"bootstrap_failed"})}},login:async n=>{if(!r().loginPending){e({loginPending:!0,loginError:void 0});try{const s=await be.login(n);Fy({token:s.token,expiresAt:s.expiresAt,mustChangePassword:s.mustChangePassword}),e({isAuthenticated:!0,mustChangePassword:s.mustChangePassword,loginPending:!1})}catch(s){const a=s instanceof we?s.code:"login_failed";e({loginPending:!1,loginError:a})}}},changePassword:async(n,s)=>{if(!r().changePasswordPending){e({changePasswordPending:!0,changePasswordError:void 0});try{const a=await be.changePassword(n,s);Fy({token:a.token,expiresAt:a.expiresAt,mustChangePassword:a.mustChangePassword}),e({isAuthenticated:!0,mustChangePassword:a.mustChangePassword,changePasswordPending:!1})}catch(a){const u=a instanceof we?a.code:"change_password_failed";e({changePasswordPending:!1,changePasswordError:u})}}},logout:()=>{Oi(),e({isAuthenticated:!1,mustChangePassword:!1,loginError:void 0})}}));globalThis.__piForgeAuthListenerRegistered||(globalThis.__piForgeAuthListenerCleanup=jC(()=>on.setState({isAuthenticated:!1})),globalThis.__piForgeAuthListenerRegistered=!0);const oi="pi-forge/active-project-id",nx="pi-forge/collapsed-projects";function lE(){try{const e=localStorage.getItem(nx);if(!e)return{};const r=JSON.parse(e);if(typeof r!="object"||r===null)return{};const n={};for(const[s,a]of Object.entries(r))typeof a=="boolean"&&(n[s]=a);return n}catch{return{}}}function cE(e){localStorage.setItem(nx,JSON.stringify(e))}const Wt=Ir((e,r)=>({projects:[],activeProjectId:localStorage.getItem(oi)??void 0,collapsed:lE(),loading:!1,error:void 0,load:async()=>{var n;e({loading:!0,error:void 0});try{const{projects:s}=await be.listProjects(),a=r().activeProjectId,d=a!==void 0&&s.some(o=>o.id===a)?a:(n=s[0])==null?void 0:n.id;d!==a&&(d?localStorage.setItem(oi,d):localStorage.removeItem(oi)),e({projects:s,activeProjectId:d,loading:!1})}catch(s){e({loading:!1,error:s instanceof we?s.code:s.message})}},create:async(n,s)=>{e({error:void 0});try{const a=await be.createProject(n,s);return e(u=>({projects:[...u.projects,a],activeProjectId:a.id})),localStorage.setItem(oi,a.id),a}catch(a){throw e({error:a instanceof we?a.code:a.message}),a}},rename:async(n,s)=>{try{const a=await be.renameProject(n,s);e(u=>({projects:u.projects.map(d=>d.id===n?a:d)}))}catch(a){throw e({error:a instanceof we?a.code:a.message}),a}},remove:async(n,s)=>{try{await be.deleteProject(n,s),e(a=>{var o;const u=a.projects.filter(c=>c.id!==n),d=a.activeProjectId===n?(o=u[0])==null?void 0:o.id:a.activeProjectId;return d?localStorage.setItem(oi,d):localStorage.removeItem(oi),{projects:u,activeProjectId:d}})}catch(a){throw e({error:a instanceof we?a.code:a.message}),a}},setActive:n=>{n?localStorage.setItem(oi,n):localStorage.removeItem(oi),e({activeProjectId:n})},toggleCollapsed:n=>{e(s=>{const a={...s.collapsed,[n]:!s.collapsed[n]};return cE(a),{collapsed:a}})}}));function hr(){return Wt(e=>e.activeProjectId===void 0?void 0:e.projects.find(r=>r.id===e.activeProjectId))}const uE=new Set([401,404]),dE=3e4;function $y(e){return Math.min(2**e*1e3,dE)}function qy(e,r){return new Promise((n,s)=>{if((r==null?void 0:r.aborted)===!0){s(new DOMException("Aborted","AbortError"));return}const a=setTimeout(()=>{r==null||r.removeEventListener("abort",u),n()},e),u=()=>{clearTimeout(a),s(new DOMException("Aborted","AbortError"))};r==null||r.addEventListener("abort",u,{once:!0})})}async function hE(e,r){const n={Accept:"text/event-stream"},s=ci();s&&(n.Authorization=`Bearer ${s.token}`);const a={method:"GET",headers:n};r.signal!==void 0&&(a.signal=r.signal);let u;try{u=await fetch(e,a)}catch(c){if(c instanceof Error&&c.name==="AbortError")return"aborted";throw new we(0,"network_error",c.message)}if(u.status===401&&(Oi(),window.dispatchEvent(new Event(zi))),!u.ok||u.body===null)throw new we(u.status,"stream_open_failed");const d=u.body.pipeThrough(new TextDecoderStream).getReader();let o="";try{for(;;){const{value:c,done:h}=await d.read();if(h)return"eof";o+=c.replace(/\r\n/g,`
|
|
284
|
+
`);let m=o.indexOf(`
|
|
285
|
+
|
|
286
|
+
`);for(;m!==-1;){const f=o.slice(0,m);o=o.slice(m+2);const v=[];for(const w of f.split(`
|
|
287
|
+
`))w.startsWith(":")||w.startsWith("data:")&&v.push(w.slice(5).trimStart());if(v.length>0){const w=v.join(`
|
|
288
|
+
`);try{const A=JSON.parse(w);await r.onEvent(A)}catch{}}m=o.indexOf(`
|
|
289
|
+
|
|
290
|
+
`)}}}catch(c){if(c instanceof Error&&c.name==="AbortError")return"aborted";throw c instanceof Error?c:new Error(String(c))}finally{try{d.releaseLock()}catch{}}}async function fE(e,r){var s,a,u;let n=0;for(;;){let d;try{d=await hE(e,r)}catch(c){if(c instanceof we&&uE.has(c.status)||(n+=1,r.maxReconnects!==void 0&&r.maxReconnects>0&&n>r.maxReconnects))throw c;const h=$y(n),m=c instanceof Error?c.message:String(c);(s=r.onReconnect)==null||s.call(r,{attempt:n,delayMs:h,reason:m});try{await qy(h,r.signal)}catch{return}continue}if(d==="aborted")return;if(n+=1,r.maxReconnects!==void 0&&r.maxReconnects>0&&n>r.maxReconnects){(a=r.onClose)==null||a.call(r);return}const o=$y(n);(u=r.onReconnect)==null||u.call(r,{attempt:n,delayMs:o,reason:"server closed stream"});try{await qy(o,r.signal)}catch{return}}}const pE="pi-forge",rx=`tab-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;let Pl;function ix(){if(Pl!==void 0)return Pl;if(!(typeof BroadcastChannel>"u"))return Pl=new BroadcastChannel(pE),Pl}function ch(e){const r=ix();if(r===void 0)return;const n={from:rx,msg:e};try{r.postMessage(n)}catch{}}function gE(e){const r=ix();if(r===void 0)return()=>{};const n=s=>{const a=s.data;a===null||typeof a!="object"||a.from!==rx&&(typeof a.msg!="object"||a.msg===null||e(a.msg))};return r.addEventListener("message",n),()=>r.removeEventListener("message",n)}const Ii="pi-forge/active-session-id",mE=[],sx=[],yE="",vE=[],Ts=new Map,Ri=new Map,Rs=new Map,ji=new Map;function Rf(e){for(const r of e)if(r.role==="user"&&Array.isArray(r.content))for(const n of r.content){const s=n;if(s.type==="image"&&s.__blobUrl===!0&&typeof s.data=="string")try{URL.revokeObjectURL(s.data)}catch{}}}function ax(e,r){for(const[n,s]of Object.entries(e.byProject))if(s.some(a=>a.sessionId===r))return n}function Kh(e,r){const n=e.messagesBySession[r];n!==void 0&&Rf(n);const s={...e.messagesBySession};delete s[r];const a={...e.streamingBySession};delete a[r];const u={...e.bannerBySession};delete u[r];const d={...e.streamingTextBySession};delete d[r];const o={...e.activeToolBySession};delete o[r];const c={...e.agentEndCountBySession};delete c[r];const h={...e.queuedBySession};delete h[r];const m={};for(const[f,v]of Object.entries(e.byProject))m[f]=v.filter(w=>w.sessionId!==r);return{messagesBySession:s,streamingBySession:a,bannerBySession:u,streamingTextBySession:d,activeToolBySession:o,agentEndCountBySession:c,queuedBySession:h,byProject:m,activeSessionId:e.activeSessionId===r?void 0:e.activeSessionId}}const Oe=Ir((e,r)=>({byProject:{},activeSessionId:localStorage.getItem(Ii)??void 0,messagesBySession:{},compactionsBySession:{},pendingDraftBySession:{},streamingBySession:{},bannerBySession:{},streamingTextBySession:{},activeToolBySession:{},agentEndCountBySession:{},compactionEndCountBySession:{},queuedBySession:{},error:void 0,loadingList:!1,loadSessionsForProject:async n=>{e({loadingList:!0,error:void 0});try{const{sessions:s}=await be.listSessions(n);e(a=>({byProject:{...a.byProject,[n]:s},loadingList:!1}))}catch(s){e({loadingList:!1,error:s instanceof we?s.code:s.message})}},createSession:async n=>{e({error:void 0});try{const s=await be.createSession(n),a={sessionId:s.sessionId,projectId:s.projectId,isLive:!0,workspacePath:s.workspacePath,lastActivityAt:s.lastActivityAt,createdAt:s.createdAt,messageCount:s.messageCount,firstMessage:""};return s.name!==void 0&&(a.name=s.name),e(u=>{const d=u.byProject[n]??[];return{byProject:{...u.byProject,[n]:[a,...d]},activeSessionId:s.sessionId}}),localStorage.setItem(Ii,s.sessionId),ch({type:"session_created",projectId:n,session:a}),s}catch(s){throw e({error:s instanceof we?s.code:s.message}),s}},renameSession:async(n,s)=>{e({error:void 0});try{const a=await be.renameSession(n,s);e(u=>{const d={};for(const[o,c]of Object.entries(u.byProject))d[o]=c.map(h=>{if(h.sessionId!==n)return h;const m={...h};return a.name!==void 0?m.name=a.name:delete m.name,m});return{byProject:d}}),ch({type:"session_renamed",sessionId:n,name:a.name})}catch(a){throw e({error:a instanceof we?a.code:a.message}),a}},reloadMessages:n=>{Mi(e,n)},loadCompactions:async n=>{try{const s=await be.getCompactions(n);e(a=>({compactionsBySession:{...a.compactionsBySession,[n]:s.compactions}}))}catch{}},setPendingDraft:(n,s)=>e(a=>({pendingDraftBySession:{...a.pendingDraftBySession,[n]:s}})),consumePendingDraft:n=>e(s=>{if(s.pendingDraftBySession[n]===void 0)return{};const a={...s.pendingDraftBySession};return delete a[n],{pendingDraftBySession:a}}),setActiveSession:n=>{n!==void 0?localStorage.setItem(Ii,n):localStorage.removeItem(Ii),e({activeSessionId:n})},openStream:n=>{if(ji.get(n)!==void 0)return;const a=new AbortController;ji.set(n,a),r().loadCompactions(n);const u=()=>{ji.get(n)===a&&ji.delete(n)};fE(`/api/v1/sessions/${encodeURIComponent(n)}/stream`,{signal:a.signal,onEvent:d=>bE(e,r,n,d),onClose:u,onReconnect:({attempt:d,delayMs:o,reason:c})=>{e(h=>({bannerBySession:{...h.bannerBySession,[n]:`Reconnecting (attempt ${d}, ${Math.round(o/1e3)}s) — ${c}`}}))}}).catch(d=>{if(d instanceof we&&d.status===404){e(c=>Kh(c,n)),r().activeSessionId===void 0&&localStorage.removeItem(Ii),u();return}const o=d instanceof we?d.code:d.message;e(c=>({bannerBySession:{...c.bannerBySession,[n]:`stream error: ${o}`}})),u()})},closeStream:n=>{const s=ji.get(n);s!==void 0&&(s.abort(),ji.get(n)===s&&ji.delete(n))},sendPrompt:async(n,s,a)=>{e({error:void 0});const u=[{type:"text",text:s}];if(a!==void 0)for(const o of a)o.type.startsWith("image/")?u.push({type:"image",mimeType:o.type,data:URL.createObjectURL(o),__blobUrl:!0}):u.push({type:"file",filename:o.name,size:o.size});const d={role:"user",content:u,timestamp:Date.now()};e(o=>({messagesBySession:{...o.messagesBySession,[n]:[...o.messagesBySession[n]??[],d]}}));try{const o={};a!==void 0&&a.length>0&&(o.attachments=a),await be.prompt(n,s,o)}catch(o){throw Rf([d]),e(c=>{const h=c.messagesBySession[n]??[];return{messagesBySession:{...c.messagesBySession,[n]:h.filter(m=>m!==d)},error:o instanceof we?o.code:o.message,bannerBySession:{...c.bannerBySession,[n]:o instanceof we?`prompt rejected: ${o.code}${o.message!==`${o.status} ${o.code}`?` — ${o.message}`:""}`:`prompt rejected: ${o.message}`}}}),o}},sendSteer:async(n,s,a)=>{e({error:void 0});try{await be.steer(n,s,a)}catch(u){throw e({error:u instanceof we?u.code:u.message}),u}},abortSession:async n=>{e({error:void 0});try{await be.abort(n)}catch(s){e({error:s instanceof we?s.code:s.message})}},disposeSession:async(n,s)=>{e({error:void 0});try{r().closeStream(n);const a=ax(r(),n);await be.disposeSession(n,s),e(u=>Kh(u,n)),r().activeSessionId===void 0&&localStorage.removeItem(Ii),a!==void 0&&(ch({type:"session_deleted",projectId:a,sessionId:n}),r().loadSessionsForProject(a))}catch(a){e({error:a instanceof we?a.code:a.message})}}}));function bE(e,r,n,s){if(s.type==="snapshot"){e(a=>({messagesBySession:{...a.messagesBySession,[n]:s.messages??[]},streamingBySession:{...a.streamingBySession,[n]:s.isStreaming??!1},bannerBySession:{...a.bannerBySession,[n]:void 0},activeToolBySession:{...a.activeToolBySession,[n]:void 0}}));return}if(s.type==="agent_start"){const a=Ri.get(n);a!==void 0&&cancelAnimationFrame(a),Ri.delete(n),Ts.delete(n),e(u=>({streamingBySession:{...u.streamingBySession,[n]:!0},streamingTextBySession:{...u.streamingTextBySession,[n]:""},bannerBySession:{...u.bannerBySession,[n]:void 0}}));return}if(s.type==="agent_end"){const a=Ri.get(n);a!==void 0&&cancelAnimationFrame(a),Ri.delete(n),Ts.delete(n);const u=s.errorMessage,d=typeof u=="string"&&u.length>0?`Agent error: ${u}`:void 0;be.getMessages(n).then(({messages:o})=>{e(c=>{const h=c.messagesBySession[n];h!==void 0&&Rf(h);const m=c.bannerBySession[n],f=d??m;return{messagesBySession:{...c.messagesBySession,[n]:o},streamingBySession:{...c.streamingBySession,[n]:!1},streamingTextBySession:{...c.streamingTextBySession,[n]:""},activeToolBySession:{...c.activeToolBySession,[n]:void 0},bannerBySession:{...c.bannerBySession,[n]:f},agentEndCountBySession:{...c.agentEndCountBySession,[n]:(c.agentEndCountBySession[n]??0)+1}}})}).catch(()=>{e(o=>({streamingBySession:{...o.streamingBySession,[n]:!1},activeToolBySession:{...o.activeToolBySession,[n]:void 0},bannerBySession:{...o.bannerBySession,[n]:d??"Couldn't refresh messages after the agent finished — reload to sync"},agentEndCountBySession:{...o.agentEndCountBySession,[n]:(o.agentEndCountBySession[n]??0)+1}}))});return}if(s.type==="queue_update"){const a=s,u=Array.isArray(a.steering)?a.steering.filter(o=>typeof o=="string"):[],d=Array.isArray(a.followUp)?a.followUp.filter(o=>typeof o=="string"):[];e(o=>({queuedBySession:{...o.queuedBySession,[n]:u.length===0&&d.length===0?void 0:{steering:u,followUp:d}}}));return}if(s.type==="tool_execution_start"){const a=typeof s.toolName=="string"?s.toolName:"tool",u=s.input??{},d=xE(a,u),o=d!==void 0?{name:a,summary:d}:{name:a};e(c=>({activeToolBySession:{...c.activeToolBySession,[n]:o}})),Mi(e,n);return}if(s.type==="tool_execution_end"){if(e(a=>({activeToolBySession:{...a.activeToolBySession,[n]:void 0}})),Mi(e,n),s.toolName==="subagent"){const a=ax(r(),n);a!==void 0&&r().loadSessionsForProject(a)}return}if(s.type==="message_end"||s.type==="tool_result"){Mi(e,n);return}if(s.type==="user_bash_result"){Mi(e,n);return}if(s.type==="message_update"){const a=s.assistantMessageEvent;if(typeof a=="object"&&a!==null&&a.type==="text_delta"&&typeof a.delta=="string"){const u=a.delta;if(Ts.set(n,(Ts.get(n)??"")+u),!Ri.has(n)){const d=requestAnimationFrame(()=>{Ri.delete(n);const o=Ts.get(n)??"";o.length!==0&&(Ts.delete(n),e(c=>({streamingTextBySession:{...c.streamingTextBySession,[n]:(c.streamingTextBySession[n]??"")+o}})))});Ri.set(n,d)}}return}if(s.type==="compaction_start"){e(a=>({bannerBySession:{...a.bannerBySession,[n]:"Compacting context…"}}));return}if(s.type==="compaction_end"){const a=s.errorMessage,u=typeof a=="string"&&a.length>0?`Agent error: ${a}`:void 0;e(d=>({bannerBySession:{...d.bannerBySession,[n]:u},compactionEndCountBySession:{...d.compactionEndCountBySession,[n]:(d.compactionEndCountBySession[n]??0)+1}})),Oe.getState().loadCompactions(n),Mi(e,n);return}if(s.type==="auto_retry_start"){const a=typeof s.attempt=="number"?s.attempt:"?",u=typeof s.maxAttempts=="number"?s.maxAttempts:"?";e(d=>({bannerBySession:{...d.bannerBySession,[n]:`Retrying (${a}/${u})…`}}));return}if(s.type==="auto_retry_end"){const a=s.success!==!1,u=s.finalError,d=!a&&typeof u=="string"&&u.length>0?`Agent error: ${u}`:void 0;e(o=>({bannerBySession:{...o.bannerBySession,[n]:d}}));return}if(s.type==="message_end"){const a=s.message;if((a==null?void 0:a.stopReason)==="error"){const u=typeof a.errorMessage=="string"?a.errorMessage:"";u.length>0&&e(d=>({bannerBySession:{...d.bannerBySession,[n]:`Agent error: ${u}`}}))}return}}function Mi(e,r){const n=Rs.get(r)??{inflight:!1,queued:!1};if(n.inflight){n.queued=!0,Rs.set(r,n);return}n.inflight=!0,Rs.set(r,n),be.getMessages(r).then(({messages:a})=>{e(u=>({messagesBySession:{...u.messagesBySession,[r]:a}}))}).catch(()=>{}).finally(()=>{const a=Rs.get(r);a!==void 0&&(a.queued?(a.queued=!1,a.inflight=!1,Rs.set(r,a),Mi(e,r)):Rs.delete(r))})}function xE(e,r){const n=s=>{const a=r[s];return typeof a=="string"&&a.length>0?a:void 0};switch(e){case"bash":return n("command");case"read":case"write":case"edit":return n("filePath")??n("path")??n("file");case"grep":return n("pattern");case"glob":return n("pattern")??n("path");default:{for(const s of["path","file","filePath","command","pattern","query","url"]){const a=n(s);if(a!==void 0)return a}return}}}globalThis.__piForgeSessionCrossTabRegistered||(globalThis.__piForgeSessionCrossTabCleanup=gE(e=>{if(e.type==="session_created"){const r=e.session,n=typeof r.sessionId=="string"?r.sessionId:void 0;if(n===void 0)return;const s={sessionId:n,projectId:e.projectId,isLive:r.isLive===!0,workspacePath:typeof r.workspacePath=="string"?r.workspacePath:"",lastActivityAt:typeof r.lastActivityAt=="string"?r.lastActivityAt:new Date().toISOString(),createdAt:typeof r.createdAt=="string"?r.createdAt:new Date().toISOString(),messageCount:typeof r.messageCount=="number"?r.messageCount:0,firstMessage:typeof r.firstMessage=="string"?r.firstMessage:""};typeof r.name=="string"&&(s.name=r.name),Oe.setState(a=>{const u=a.byProject[e.projectId]??[];return u.some(d=>d.sessionId===n)?{}:{byProject:{...a.byProject,[e.projectId]:[s,...u]}}});return}if(e.type==="session_deleted"){if(Oe.setState(r=>Kh(r,e.sessionId)),Oe.getState().activeSessionId===void 0)try{localStorage.removeItem(Ii)}catch{}Oe.getState().loadSessionsForProject(e.projectId);return}if(e.type==="session_renamed"){Oe.setState(r=>{const n={};for(const[s,a]of Object.entries(r.byProject))n[s]=a.map(u=>{if(u.sessionId!==e.sessionId)return u;const d={...u};return e.name!==void 0?d.name=e.name:delete d.name,d});return{byProject:n}});return}}),globalThis.__piForgeSessionCrossTabRegistered=!0);const _E=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/;function SE(e){if(e.length===0)return[];let r=0,n=0;const s=new Map,a=(d,o)=>{const c=s.get(d);c!=="modified"&&(c==="added"&&o==="deletedAbove"||s.set(d,o))},u=()=>{n!==0&&(a(r,"deletedAbove"),n=0)};for(const d of e.split(`
|
|
291
|
+
`)){if(d.startsWith("@@")){u();const c=_E.exec(d);if(c===null)continue;r=Number.parseInt(c[1]??"0",10),n=0;continue}if(d.startsWith("\\")||r===0)continue;const o=d.charAt(0);o===" "?(u(),r+=1):o==="-"?n+=1:o==="+"&&(n>0?(a(r,"modified"),n-=1):a(r,"added"),r+=1)}return u(),Array.from(s.entries()).map(([d,o])=>({line:d,kind:o})).sort((d,o)=>d.line-o.line)}const ox="forge.editor.tabs.v1:";function wE(e){try{const r=sessionStorage.getItem(ox+e);if(r===null)return{paths:[],activePath:null};const n=JSON.parse(r);if(typeof n!="object"||n===null)return{paths:[],activePath:null};const s=n,a=Array.isArray(s.paths)?s.paths.filter(d=>typeof d=="string"):[],u=typeof s.activePath=="string"?s.activePath:null;return{paths:a,activePath:a.includes(u??"")?u:a[0]??null}}catch{return{paths:[],activePath:null}}}function AE(e,r,n){try{sessionStorage.setItem(ox+e,JSON.stringify({paths:r,activePath:n??null}))}catch{}}let ir;function js(e,r){e!==void 0&&AE(e,r.openFiles.map(n=>n.path),r.activePath)}const ft=Ir((e,r)=>({treeByProject:{},treeLoading:{},openFiles:[],activePath:void 0,error:void 0,externallyChanged:{},gitDiffByPath:{},loadGitDiff:async(n,s)=>{try{const a=await be.gitDiffFile(n,s,!1),u=SE(a.diff);e(d=>({gitDiffByPath:{...d.gitDiffByPath,[s]:u}}))}catch{e(a=>{if(!(s in a.gitDiffByPath))return{};const u={...a.gitDiffByPath};return delete u[s],{gitDiffByPath:u}})}},loadTree:async n=>{e(s=>({treeLoading:{...s.treeLoading,[n]:!0},error:void 0}));try{const s=await be.filesTree(n);e(a=>({treeByProject:{...a.treeByProject,[n]:s},treeLoading:{...a.treeLoading,[n]:!1}}))}catch(s){e(a=>({treeLoading:{...a.treeLoading,[n]:!1},error:s instanceof we?s.code:s.message}))}},restoreTabs:async n=>{if(ir===n&&r().openFiles.length>0)return;ir!==n&&e({openFiles:[],activePath:void 0,externallyChanged:{},gitDiffByPath:{}}),ir=n;const s=wE(n);if(s.paths.length!==0){for(const a of s.paths)try{await r().openFile(n,a)}catch{}s.activePath!==null&&r().setActiveFile(s.activePath)}},openFile:async(n,s,a)=>{if(ir=n,r().openFiles.find(d=>d.path===s)!==void 0){e(a!==void 0?d=>{const o={openFiles:d.openFiles.map(c=>c.path===s?{...c,pendingNav:a}:c),activePath:s};return js(ir,o),o}:d=>(js(ir,{openFiles:d.openFiles,activePath:s}),{activePath:s}));return}e({error:void 0});try{const d=await be.filesRead(n,s),o={tabId:CE(),path:s,saved:d.content,draft:d.content,dirty:!1,language:d.language,binary:d.binary,saving:!1,savedAt:void 0,saveError:void 0,loadingError:d.binary?"Binary file — open externally to edit.":void 0};a!==void 0&&(o.pendingNav=a),e(c=>{const h={openFiles:[...c.openFiles,o],activePath:s};return js(ir,h),h}),r().loadGitDiff(n,s)}catch(d){e({error:d instanceof we?d.code:d.message})}},closeFile:n=>{e(s=>{var m;const a=s.openFiles.findIndex(f=>f.path===n);if(a===-1)return{};const u=s.openFiles.slice(0,a).concat(s.openFiles.slice(a+1)),d=s.activePath===n?(m=u[a]??u[a-1]??u[0])==null?void 0:m.path:s.activePath,o={...s.externallyChanged};delete o[n];const c={...s.gitDiffByPath};delete c[n];const h={openFiles:u,activePath:d,externallyChanged:o,gitDiffByPath:c};return js(ir,h),h})},closeAllFiles:()=>{e(()=>{const n={openFiles:[],activePath:void 0,externallyChanged:{},gitDiffByPath:{}};return js(ir,n),n})},setActiveFile:n=>e(s=>(js(ir,{openFiles:s.openFiles,activePath:n}),{activePath:n})),consumePendingNav:n=>{e(s=>({openFiles:s.openFiles.map(a=>{if(a.path!==n||a.pendingNav===void 0)return a;const u={...a};return delete u.pendingNav,u})}))},updateDraft:(n,s)=>{e(a=>({openFiles:a.openFiles.map(u=>u.path===n?{...u,draft:s,dirty:s!==u.saved}:u)}))},saveFile:async(n,s)=>{const a=r().openFiles.find(u=>u.path===s);if(!(a===void 0||a.binary)){e(u=>({openFiles:u.openFiles.map(d=>d.path===s?{...d,saving:!0,saveError:void 0}:d),error:void 0}));try{await be.filesWrite(n,s,a.draft),e(u=>({openFiles:u.openFiles.map(d=>d.path===s?{...d,saving:!1,saved:d.draft,dirty:!1,savedAt:Date.now(),saveError:void 0}:d),externallyChanged:Hl(u.externallyChanged,s)})),r().loadGitDiff(n,s)}catch(u){const d=u instanceof we?u.code:u.message;throw e(o=>({openFiles:o.openFiles.map(c=>c.path===s?{...c,saving:!1,saveError:d}:c),error:d})),u}}},reloadFile:async(n,s)=>{e({error:void 0});try{const a=await be.filesRead(n,s);e(u=>({openFiles:u.openFiles.map(d=>d.path===s?{...d,saved:a.content,draft:a.content,dirty:!1,language:a.language,binary:a.binary,loadingError:a.binary?"Binary file — open externally to edit.":void 0}:d),externallyChanged:Hl(u.externallyChanged,s)})),r().loadGitDiff(n,s)}catch(a){e({error:a instanceof we?a.code:a.message})}},refreshOpenFiles:async n=>{const s=r().openFiles.map(u=>({path:u.path,saved:u.saved,dirty:u.dirty}));if(s.length===0)return;const a=await Promise.allSettled(s.map(u=>be.filesRead(n,u.path)));e(u=>{let d=u.openFiles,o=u.externallyChanged;for(let c=0;c<s.length;c++){const h=a[c],m=s[c];if(h===void 0||m===void 0||h.status!=="fulfilled")continue;const f=h.value;f.content===m.saved&&!m.dirty||f.content!==m.saved&&(m.dirty?o={...o,[m.path]:!0}:(d=d.map(v=>v.path===m.path?{...v,saved:f.content,draft:f.content,dirty:!1,language:f.language,binary:f.binary,loadingError:f.binary?"Binary file — open externally to edit.":void 0}:v),o=Hl(o,m.path)))}return{openFiles:d,externallyChanged:o}}),await Promise.allSettled(s.map(u=>r().loadGitDiff(n,u.path)))},markExternallyChanged:n=>{e(s=>({externallyChanged:{...s.externallyChanged,[n]:!0}}))},dismissExternallyChanged:n=>{e(s=>({externallyChanged:Hl(s.externallyChanged,n)}))},createFile:async(n,s,a)=>{e({error:void 0});try{const u=`${s}/${a}`;return await be.filesWrite(n,u,""),await r().loadTree(n),u}catch(u){throw e({error:u instanceof we?u.code:u.message}),u}},createFolder:async(n,s,a)=>{e({error:void 0});try{await be.filesMkdir(n,s,a),await r().loadTree(n)}catch(u){throw e({error:u instanceof we?u.code:u.message}),u}},renameEntry:async(n,s,a)=>{e({error:void 0});try{const{path:u}=await be.filesRename(n,s,a);return e(d=>({openFiles:d.openFiles.map(o=>o.path===s?{...o,path:u}:o),activePath:d.activePath===s?u:d.activePath})),await r().loadTree(n),u}catch(u){throw e({error:u instanceof we?u.code:u.message}),u}},moveEntry:async(n,s,a)=>{e({error:void 0});try{const{path:u}=await be.filesMove(n,s,a);return e(d=>({openFiles:d.openFiles.map(o=>{if(o.path===s)return{...o,path:u};const c=`${s}/`;return o.path.startsWith(c)?{...o,path:`${u}/${o.path.slice(c.length)}`}:o}),activePath:d.activePath===s?u:d.activePath!==void 0&&d.activePath.startsWith(`${s}/`)?`${u}/${d.activePath.slice(s.length+1)}`:d.activePath})),await r().loadTree(n),u}catch(u){throw e({error:u instanceof we?u.code:u.message}),u}},deleteEntry:async(n,s,a)=>{e({error:void 0});try{await be.filesDelete(n,s,(a==null?void 0:a.recursive)===!0?{recursive:!0}:void 0),r().openFiles.find(d=>d.path===s)!==void 0&&r().closeFile(s),await r().loadTree(n)}catch(u){throw e({error:u instanceof we?u.code:u.message}),u}},uploadFiles:async(n,s,a,u)=>{e({error:void 0});try{const d=await be.uploadFiles(n,s,a,{...(u==null?void 0:u.overwrite)!==void 0?{overwrite:u.overwrite}:{},...(u==null?void 0:u.onHashProgress)!==void 0?{onHashProgress:u.onHashProgress}:{}});return await r().loadTree(n),d.files}catch(d){throw e({error:d instanceof we?d.code:d.message}),d}}}));function CE(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`tab-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function Hl(e,r){if(e[r]===void 0)return e;const n={...e};return delete n[r],n}const Dr=Ir(e=>({loaded:!1,minimal:!1,workspaceRoot:"",version:"",passwordAuthEnabled:!0,error:void 0,load:async()=>{try{const r=await be.uiConfig();e({loaded:!0,minimal:r.minimal,workspaceRoot:r.workspaceRoot,version:r.version,passwordAuthEnabled:r.passwordAuthEnabled,error:void 0})}catch(r){const n=r instanceof we?r.code:r.message;typeof console<"u"&&console.warn("[ui-config] load failed:",n),e({loaded:!0,error:n})}}}));function EE(){const[e,r]=q.useState(""),n=on(d=>d.login),s=on(d=>d.loginPending),a=on(d=>d.loginError),u=d=>{d.preventDefault(),e.length!==0&&n(e)};return g.jsx("main",{className:"flex min-h-screen items-center justify-center px-4",children:g.jsxs("form",{onSubmit:u,className:"w-full max-w-sm space-y-4 rounded-lg border border-neutral-800 bg-neutral-900 p-6 shadow-lg",children:[g.jsxs("header",{className:"space-y-1",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("img",{src:"/icons/icon.svg",alt:"",className:"h-6 w-6","aria-hidden":"true"}),g.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"pi-forge"})]}),g.jsx("p",{className:"text-sm text-neutral-400",children:"Enter the pi-forge password to continue."})]}),g.jsxs("label",{className:"block space-y-1.5",children:[g.jsx("span",{className:"text-sm font-medium text-neutral-300",children:"Password"}),g.jsx("input",{type:"password",value:e,onChange:d=>r(d.target.value),autoFocus:!0,autoComplete:"current-password",className:"w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-2 text-sm outline-none focus:border-neutral-500"})]}),a!==void 0&&g.jsx("p",{role:"alert",className:"text-sm text-red-400",children:a==="invalid_password"?"Incorrect password.":`Login failed: ${a}`}),g.jsx("button",{type:"submit",disabled:s||e.length===0,className:"w-full rounded-md bg-neutral-100 px-3 py-2 text-sm font-medium text-neutral-900 transition hover:bg-white disabled:cursor-not-allowed disabled:opacity-50",children:s?"Signing in…":"Sign in"})]})})}const Ul=8;function kE(){const[e,r]=q.useState(""),[n,s]=q.useState(""),[a,u]=q.useState(""),[d,o]=q.useState(void 0),c=on(A=>A.changePassword),h=on(A=>A.changePasswordPending),m=on(A=>A.changePasswordError),f=on(A=>A.logout),v=A=>{if(A.preventDefault(),o(void 0),n.length<Ul){o(`new password must be at least ${Ul} characters`);return}if(n!==a){o("new password and confirmation do not match");return}if(n===e){o("new password must differ from the current one");return}c(e,n)},w=d??NE(m);return g.jsx("main",{className:"flex min-h-screen items-center justify-center px-4",children:g.jsxs("form",{onSubmit:v,className:"w-full max-w-sm space-y-4 rounded-lg border border-neutral-800 bg-neutral-900 p-6 shadow-lg",children:[g.jsxs("header",{className:"space-y-1",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("img",{src:"/icons/icon.svg",alt:"",className:"h-6 w-6","aria-hidden":"true"}),g.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Set a new password"})]}),g.jsx("p",{className:"text-sm text-neutral-400",children:"You signed in with the deployment-supplied initial password. Pick a new one before continuing — it will be stored as a hash on the pi-forge data volume."})]}),g.jsxs("label",{className:"block space-y-1.5",children:[g.jsx("span",{className:"text-sm font-medium text-neutral-300",children:"Current password"}),g.jsx("input",{type:"password",value:e,onChange:A=>r(A.target.value),autoFocus:!0,autoComplete:"current-password",className:"w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-2 text-sm outline-none focus:border-neutral-500"})]}),g.jsxs("label",{className:"block space-y-1.5",children:[g.jsx("span",{className:"text-sm font-medium text-neutral-300",children:"New password"}),g.jsx("input",{type:"password",value:n,onChange:A=>s(A.target.value),autoComplete:"new-password",minLength:Ul,className:"w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-2 text-sm outline-none focus:border-neutral-500"})]}),g.jsxs("label",{className:"block space-y-1.5",children:[g.jsx("span",{className:"text-sm font-medium text-neutral-300",children:"Confirm new password"}),g.jsx("input",{type:"password",value:a,onChange:A=>u(A.target.value),autoComplete:"new-password",minLength:Ul,className:"w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-2 text-sm outline-none focus:border-neutral-500"})]}),w!==void 0&&g.jsx("p",{role:"alert",className:"text-sm text-red-400",children:w}),g.jsx("button",{type:"submit",disabled:h||e.length===0||n.length===0,className:"w-full rounded-md bg-neutral-100 px-3 py-2 text-sm font-medium text-neutral-900 transition hover:bg-white disabled:cursor-not-allowed disabled:opacity-50",children:h?"Saving…":"Set new password"}),g.jsx("button",{type:"button",onClick:f,className:"w-full rounded-md border border-neutral-700 px-3 py-2 text-xs text-neutral-400 hover:border-neutral-500 hover:text-neutral-200",children:"Sign out"})]})})}function NE(e){if(e!==void 0)switch(e){case"invalid_password":return"Current password is incorrect.";case"password_unchanged":return"New password must differ from the current one.";case"ui_password_not_configured":return"Password auth is not configured on this server.";case"auth_required":return"Session expired — sign in again.";default:return`Could not change password: ${e}`}}function lx({onClose:e,required:r=!1}){const n=Wt(P=>P.create),s=Dr(P=>P.minimal),a=Dr(P=>P.workspaceRoot),[u,d]=q.useState("name"),[o,c]=q.useState(""),[h,m]=q.useState(!1),[f,v]=q.useState(),[w,A]=q.useState(),[b,y]=q.useState(null),[S,_]=q.useState([]),[x,E]=q.useState(!1),[N,T]=q.useState(""),[j,R]=q.useState(!1);q.useEffect(()=>{if(u!=="browse")return;let P=!1;return E(!0),v(void 0),be.browse(w).then(G=>{P||(A(G.path),y(G.parentPath),_(G.entries))}).catch(G=>{P||v(G instanceof we?G.code:G.message)}).finally(()=>{P||E(!1)}),()=>{P=!0}},[u,w]);const D=async()=>{const P=o.trim();if(P.length!==0){if(!s){d("browse");return}if(a.length===0){v("workspace_not_loaded");return}m(!0),v(void 0);try{const{path:G}=await be.mkdir(a,P);await n(P,G),e()}catch(G){v(G instanceof we?G.code:G.message),m(!1)}}},L=async P=>{if(!h){if(a.length>0&&P===a){v("workspace_root_not_allowed");return}m(!0),v(void 0);try{await n(o.trim(),P),e()}catch(G){v(G instanceof we?G.code:G.message),m(!1)}}},z=()=>{b!==null&&A(b)},U=async()=>{if(!(!w||N.trim().length===0)){v(void 0);try{const{path:P}=await be.mkdir(w,N.trim());T(""),R(!1),await L(P)}catch(P){v(P instanceof we?P.code:P.message)}}};return g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4",children:g.jsxs("div",{className:"w-full max-w-lg rounded-lg border border-neutral-800 bg-neutral-900 p-6 shadow-xl",children:[g.jsxs("header",{className:"mb-4 flex items-center justify-between",children:[g.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:u==="name"?"New project":`Pick a folder for "${o.trim()}"`}),!r&&g.jsx("button",{onClick:e,className:"rounded-md px-2 py-1 text-sm text-neutral-400 hover:bg-neutral-800",children:"Cancel"})]}),u==="name"&&g.jsxs("form",{onSubmit:P=>{P.preventDefault(),D()},className:"space-y-4",children:[g.jsxs("label",{className:"block space-y-1.5",children:[g.jsx("span",{className:"text-sm font-medium text-neutral-300",children:"Project name"}),g.jsx("input",{value:o,onChange:P=>c(P.target.value),autoFocus:!0,className:"w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-2 text-sm outline-none focus:border-neutral-500"}),s&&a.length>0&&g.jsxs("span",{className:"block font-mono text-[11px] text-neutral-500",children:["Will create ",a,"/",o.trim().length>0?o.trim():"<name>"]})]}),f!==void 0&&g.jsxs("p",{className:"text-xs text-red-400",children:["Error: ",f]}),g.jsx("button",{type:"submit",disabled:o.trim().length===0||h,className:"w-full rounded-md bg-neutral-100 px-3 py-2 text-sm font-medium text-neutral-900 disabled:opacity-50",children:s?h?"Creating…":"Create project":"Next: pick folder"})]}),u==="browse"&&g.jsxs("div",{className:"space-y-3",children:[g.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-400",children:[g.jsx("button",{onClick:z,disabled:b===null,className:"rounded-md border border-neutral-700 px-2 py-1 hover:bg-neutral-800 disabled:cursor-not-allowed disabled:opacity-40",title:b===null?"At workspace root":"Up one folder",children:"↑ up"}),g.jsx("code",{className:"truncate font-mono text-neutral-300",children:w??"(loading)"})]}),g.jsxs("div",{className:"max-h-64 overflow-y-auto rounded-md border border-neutral-800 bg-neutral-950",children:[x&&g.jsx("div",{className:"px-3 py-2 text-sm text-neutral-400",children:"Loading…"}),!x&&S.length===0&&g.jsx("div",{className:"px-3 py-2 text-sm text-neutral-400",children:"(empty)"}),!x&&S.map(P=>g.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-neutral-800 px-3 py-2 text-sm last:border-b-0",children:[g.jsxs("button",{onClick:()=>A(P.path),className:"flex flex-1 items-center gap-2 text-left text-neutral-200 hover:text-white",children:[g.jsx("span",{children:"📁"}),g.jsx("span",{className:"truncate",children:P.name}),P.isGitRepo&&g.jsx("span",{className:"rounded-sm bg-neutral-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-300",children:"git"})]}),g.jsx("button",{onClick:()=>void L(P.path),disabled:h,className:"rounded-md border border-neutral-700 px-2 py-1 text-xs text-neutral-200 hover:bg-neutral-800 disabled:opacity-50",children:"Select"})]},P.path))]}),j?g.jsxs("div",{className:"flex gap-2",children:[g.jsx("input",{value:N,onChange:P=>T(P.target.value),placeholder:"folder name",className:"flex-1 rounded-md border border-neutral-700 bg-neutral-950 px-3 py-2 text-sm",autoFocus:!0}),g.jsx("button",{onClick:()=>void U(),className:"rounded-md bg-neutral-100 px-3 py-2 text-sm font-medium text-neutral-900",children:"Create + select"}),g.jsx("button",{onClick:()=>{R(!1),T("")},className:"rounded-md border border-neutral-700 px-3 py-2 text-sm text-neutral-300",children:"Cancel"})]}):g.jsxs("div",{className:"flex justify-between gap-2",children:[g.jsx("button",{onClick:()=>d("name"),className:"rounded-md border border-neutral-700 px-3 py-2 text-sm text-neutral-300",children:"← Back"}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx("button",{onClick:()=>R(!0),className:"rounded-md border border-neutral-700 px-3 py-2 text-sm text-neutral-300",children:"+ New folder"}),g.jsx("button",{onClick:()=>w&&void L(w),disabled:!w||h||a.length>0&&w===a,className:"rounded-md bg-neutral-100 px-3 py-2 text-sm font-medium text-neutral-900 disabled:opacity-50",title:a.length>0&&w===a?"Pick a sub-folder — the workspace root itself can't be a project.":"Use this folder as the project root",children:"Select this folder"})]})]})]}),f!==void 0&&g.jsx("p",{className:"mt-3 text-sm text-red-400",children:f==="path_not_allowed"?"That folder is outside the workspace root.":f==="workspace_root_not_allowed"?"Pick a sub-folder — the workspace root itself can't be a project.":f==="not_a_directory"?"That path is not a directory.":f==="already_exists"?"A folder with that name already exists.":f==="duplicate_path"?"Another project already points at that folder.":f==="network_error"?"Couldn't reach the server.":`Error: ${f}`})]})})}function go({open:e,onClose:r,title:n,children:s,width:a="max-w-sm",initialFocusRef:u}){const d=q.useRef(null),o=q.useId(),c=q.useRef(r),h=q.useRef(u);return q.useEffect(()=>{c.current=r}),q.useEffect(()=>{h.current=u}),q.useEffect(()=>{if(!e)return;const m=document.activeElement,f=d.current,v=A=>{if(A.key==="Escape"){A.preventDefault(),c.current();return}if(A.key==="Tab"&&d.current!==null){const b=d.current.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])');if(b.length===0)return;const y=b[0],S=b[b.length-1];A.shiftKey&&document.activeElement===y?(A.preventDefault(),S.focus()):!A.shiftKey&&document.activeElement===S&&(A.preventDefault(),y.focus())}};document.addEventListener("keydown",v);const w=window.setTimeout(()=>{var y,S;const A=(y=h.current)==null?void 0:y.current;if(A!=null){A.focus();return}const b=(S=d.current)==null?void 0:S.querySelector('a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])');b==null||b.focus()},0);return()=>{document.removeEventListener("keydown",v),window.clearTimeout(w),m!==null&&document.contains(m)&&f!==null&&f.contains(document.activeElement)&&m.focus()}},[e]),e?g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:r,role:"dialog","aria-modal":"true","aria-labelledby":o,children:g.jsxs("div",{ref:d,className:`w-full ${a} rounded-lg border border-neutral-800 bg-neutral-900 shadow-xl`,onClick:m=>m.stopPropagation(),children:[g.jsxs("header",{className:"flex items-center justify-between border-b border-neutral-800 px-4 py-2",children:[g.jsx("h2",{id:o,className:"text-sm font-medium text-neutral-100",children:n}),g.jsx("button",{onClick:r,className:"rounded p-2 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200",title:"Close (Esc)","aria-label":"Close",children:g.jsx(Br,{size:20})})]}),s]})}):null}function cx({open:e,onClose:r,onSubmit:n,title:s,label:a,initialValue:u="",placeholder:d,primaryLabel:o="OK"}){const[c,h]=q.useState(u),m=q.useRef(null);q.useEffect(()=>{e&&h(u)},[e,u]);const f=c.trim(),v=()=>{f.length!==0&&n(f)};return g.jsx(go,{open:e,onClose:r,title:s,initialFocusRef:m,children:g.jsxs("form",{onSubmit:w=>{w.preventDefault(),v()},className:"flex flex-col gap-3 px-4 py-3",children:[g.jsxs("label",{className:"block space-y-1.5",children:[g.jsx("span",{className:"text-xs text-neutral-300",children:a}),g.jsx("input",{ref:m,type:"text",value:c,onChange:w=>h(w.target.value),placeholder:d,className:"w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-1.5 text-sm text-neutral-100 outline-none focus:border-neutral-500"})]}),g.jsxs("footer",{className:"flex justify-end gap-2 pt-1",children:[g.jsx("button",{type:"button",onClick:r,className:"rounded-md border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:bg-neutral-800",children:"Cancel"}),g.jsx("button",{type:"submit",disabled:f.length===0,className:"rounded-md bg-neutral-100 px-3 py-1 text-xs font-medium text-neutral-900 hover:bg-white disabled:cursor-not-allowed disabled:opacity-40",children:o})]})]})})}function ro({open:e,onClose:r,onConfirm:n,title:s,message:a,primaryLabel:u="Confirm",tone:d="default"}){return g.jsx(go,{open:e,onClose:r,title:s,children:g.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[g.jsx("p",{className:"text-xs text-neutral-300",children:a}),g.jsxs("footer",{className:"flex justify-end gap-2 pt-1",children:[g.jsx("button",{type:"button",onClick:r,className:"rounded-md border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:bg-neutral-800",children:"Cancel"}),g.jsx("button",{type:"button",onClick:n,className:d==="danger"?"rounded-md bg-red-700 px-3 py-1 text-xs font-medium text-red-50 hover:bg-red-600":"rounded-md bg-neutral-100 px-3 py-1 text-xs font-medium text-neutral-900 hover:bg-white",children:u})]})]})})}function TE({projectId:e}){const r=Oe(G=>G.byProject[e]??mE),n=Oe(G=>G.activeSessionId),s=Oe(G=>G.loadSessionsForProject),a=Oe(G=>G.setActiveSession),u=Oe(G=>G.disposeSession),d=Oe(G=>G.renameSession),o=Wt(G=>G.setActive),c=Wt(G=>G.activeProjectId),h=G=>{c!==e&&o(e),a(G)},[m,f]=q.useState(void 0),[v,w]=q.useState(""),[A,b]=q.useState(void 0),[y,S]=q.useState(new Set),_=()=>S(new Set),x=G=>{S(K=>{const W=new Set(K);return W.has(G)?W.delete(G):W.add(G),W})},[E,N]=q.useState(new Map),T=(G,K)=>{N(W=>{const Y=new Map(W);return Y.set(G,!K),Y})},{topLevel:j,childrenByParent:R}=q.useMemo(()=>{const G=new Map,K=new Set(r.filter(Y=>Y.parentSessionId===void 0).map(Y=>Y.sessionId));for(const Y of r){if(Y.parentSessionId===void 0||!K.has(Y.parentSessionId))continue;const ne=G.get(Y.parentSessionId);ne===void 0?G.set(Y.parentSessionId,[Y]):ne.push(Y)}const W=r.filter(Y=>Y.parentSessionId===void 0||!K.has(Y.parentSessionId));return r.some(Y=>Y.parentSessionId!==void 0)&&console.info("[subagent] SessionList grouping",{projectId:e,sessionCount:r.length,topLevelCount:W.length,childCount:Array.from(G.values()).reduce((Y,ne)=>Y+ne.length,0),topLevelIds:Array.from(K),parentIdsOnChildren:r.filter(Y=>Y.parentSessionId!==void 0).map(Y=>Y.parentSessionId),bucketed:Array.from(G.keys())}),{topLevel:W,childrenByParent:G}},[r,e]),D=async()=>{if(A!==void 0){if(b(void 0),A.kind==="single"){u(A.sessionId,{hard:!0});return}for(const G of A.sessionIds)try{await u(G,{hard:!0})}catch{}_()}};q.useEffect(()=>{s(e)},[e,s]);const L=(G,K)=>{f(G),w(K)},z=()=>{f(void 0),w("")},U=async G=>{const K=v.trim();z();try{await d(G,K)}catch{}},P=(G,K)=>{G.key==="Enter"?(G.preventDefault(),U(K)):G.key==="Escape"&&(G.preventDefault(),z())};return g.jsxs("div",{className:"ml-6 mt-1 space-y-0.5",children:[r.length===0&&g.jsx("p",{className:"px-2 py-1 text-xs italic text-neutral-600",children:"No sessions yet."}),y.size>0&&g.jsxs("div",{className:"flex items-center justify-between gap-2 rounded bg-neutral-900/60 px-2 py-1 text-[11px] text-neutral-300",children:[g.jsxs("span",{children:[y.size," selected"]}),g.jsxs("div",{className:"flex gap-1",children:[g.jsx("button",{onClick:()=>b({kind:"many",sessionIds:Array.from(y)}),className:"rounded border border-red-700/50 px-1.5 py-0.5 text-red-300 hover:bg-red-900/20",children:"Delete"}),g.jsx("button",{onClick:_,className:"rounded border border-neutral-700 px-1.5 py-0.5 text-neutral-300 hover:border-neutral-500",children:"Clear"})]})]}),j.flatMap(G=>{const K=R.get(G.sessionId)??[],Y=E.get(G.sessionId)===!0,ne=[g.jsx(Qy,{session:G,isActive:G.sessionId===n,isSelected:y.has(G.sessionId),isRenaming:m===G.sessionId,renameDraft:v,childCount:K.length,isExpanded:Y,isChild:!1,onSelect:h,onToggleSelect:x,onStartRename:L,onChangeRename:w,onRenameKeyDown:P,onCommitRename:F=>void U(F),onToggleExpanded:T,onAskDelete:F=>b(F)},G.sessionId)];if(Y)for(const F of K)ne.push(g.jsx(Qy,{session:F,isActive:F.sessionId===n,isSelected:y.has(F.sessionId),isRenaming:m===F.sessionId,renameDraft:v,childCount:0,isExpanded:!1,isChild:!0,onSelect:h,onToggleSelect:x,onStartRename:L,onChangeRename:w,onRenameKeyDown:P,onCommitRename:B=>void U(B),onToggleExpanded:T,onAskDelete:B=>b(B)},F.sessionId));return ne}),g.jsx(ro,{open:A!==void 0,onClose:()=>b(void 0),onConfirm:()=>void D(),title:(A==null?void 0:A.kind)==="many"?`Delete ${A.sessionIds.length} session${A.sessionIds.length===1?"":"s"}`:`Delete session "${(A==null?void 0:A.label)??""}"`,message:(A==null?void 0:A.kind)==="many"?`Delete the ${A.sessionIds.length} selected session${A.sessionIds.length===1?"":"s"}? Live sessions are killed and on-disk JSONLs are removed. Cannot be undone.`:(A==null?void 0:A.kind)==="single"&&A.isLive?`Delete "${A.label}"? This kills the live shell AND removes the on-disk JSONL. Cannot be undone.`:(A==null?void 0:A.kind)==="single"?`Delete the on-disk JSONL for "${A.label}"? Cannot be undone — the file is the only copy.`:"",primaryLabel:(A==null?void 0:A.kind)==="many"?"Delete all":"Delete",tone:"danger"})]})}function Qy(e){const{session:r,isActive:n,isSelected:s,isRenaming:a,renameDraft:u,childCount:d,isExpanded:o,isChild:c,onSelect:h,onToggleSelect:m,onStartRename:f,onChangeRename:v,onRenameKeyDown:w,onCommitRename:A,onToggleExpanded:b,onAskDelete:y}=e,S=r.name??(r.firstMessage.length>0?r.firstMessage.slice(0,40):`session ${r.sessionId.slice(0,6)}`);return g.jsxs("div",{className:`group flex items-center gap-1 rounded ${c?"ml-4":""} px-2 py-0.5 text-xs ${s?"bg-emerald-900/20 text-neutral-100":n?"bg-neutral-800 text-neutral-100":"text-neutral-400 hover:bg-neutral-900 hover:text-neutral-200"}`,children:[d>0?g.jsx("button",{onClick:()=>b(r.sessionId,o),className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-neutral-500 hover:text-neutral-200",title:`${d} sub-agent session${d===1?"":"s"}`,"aria-label":o?"Collapse sub-agents":"Expand sub-agents",children:o?g.jsx(ur,{size:12}):g.jsx(dr,{size:12})}):g.jsx("span",{className:"inline-block h-4 w-4 shrink-0","aria-hidden":"true"}),a?g.jsx("input",{autoFocus:!0,value:u,onChange:_=>v(_.target.value),onKeyDown:_=>w(_,r.sessionId),onBlur:()=>A(r.sessionId),placeholder:S,maxLength:200,className:"flex-1 rounded border border-neutral-700 bg-neutral-950 px-1.5 py-0.5 text-xs text-neutral-100 outline-none focus:border-neutral-500"}):g.jsxs("button",{onClick:_=>{if(_.metaKey||_.ctrlKey){m(r.sessionId);return}h(r.sessionId)},onDoubleClick:()=>f(r.sessionId,r.name??""),className:"flex-1 truncate text-left",title:`${r.sessionId} — double-click to rename, Cmd/Ctrl+click to select for bulk delete`,children:[r.isLive&&g.jsx("span",{className:"mr-1 text-emerald-500",children:"●"}),c&&g.jsx("span",{className:"mr-1 text-purple-400",title:"sub-agent",children:"↳"}),S]}),!a&&g.jsx("button",{onClick:()=>y({kind:"single",sessionId:r.sessionId,label:S,isLive:r.isLive}),className:"inline-flex items-center p-1 text-neutral-500 hover:text-red-400",title:r.isLive?"Delete session — also kills the live shell":"Delete session JSONL from disk",children:g.jsx(Br,{size:16})})]})}function RE(){const e=Wt(N=>N.projects),r=Wt(N=>N.activeProjectId),n=Wt(N=>N.collapsed),s=Wt(N=>N.setActive),a=Wt(N=>N.toggleCollapsed),u=Wt(N=>N.remove),d=Wt(N=>N.rename),o=Oe(N=>N.byProject),c=Oe(N=>N.createSession),h=async N=>{r!==N&&s(N);try{await c(N)}catch{}},[m,f]=q.useState(!1),[v,w]=q.useState(),[A,b]=q.useState(""),[y,S]=q.useState(void 0),_=(N,T)=>{const j=o[N]??[],R=j.filter(L=>L.isLive).length;if(R>0){alert(`Cannot delete "${T}" — it has ${R} live session${R===1?"":"s"}. Dispose ${R===1?"it":"them"} first (× next to each session in the sidebar), then try again.`);return}const D=j.filter(L=>!L.isLive).length;S({id:N,name:T,onDiskCount:D,cascade:!1})},x=async()=>{if(y===void 0)return;const{id:N,cascade:T}=y;S(void 0),u(N,{cascade:T})},E=async N=>{const T=A.trim();if(T.length===0){w(void 0);return}try{await d(N,T)}finally{w(void 0),b("")}};return g.jsxs("aside",{className:"flex h-full w-64 flex-col border-r border-neutral-800 bg-neutral-950",children:[g.jsxs("header",{className:"flex items-center justify-between border-b border-neutral-800 px-3 py-2",children:[g.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-neutral-400",children:"Projects"}),g.jsx("button",{onClick:()=>f(!0),className:"rounded-md border border-neutral-700 px-2 py-0.5 text-xs text-neutral-200 hover:bg-neutral-800",children:"+ New"})]}),g.jsxs("div",{className:"flex-1 overflow-y-auto py-1",children:[e.length===0&&g.jsx("p",{className:"px-3 py-4 text-sm text-neutral-500",children:"No projects yet."}),e.map(N=>{const T=N.id===r,j=n[N.id]??!1;return g.jsxs("div",{className:"mt-1 px-1",children:[g.jsxs("div",{className:`group flex items-center gap-1 rounded-md px-2 py-1 text-sm ${T?"bg-neutral-800 text-neutral-100":"text-neutral-300 hover:bg-neutral-900"}`,children:[g.jsx("button",{onClick:()=>a(N.id),className:"flex items-center text-neutral-500 hover:text-neutral-300",title:j?"Expand":"Collapse",children:j?g.jsx(dr,{size:16}):g.jsx(ur,{size:16})}),v===N.id?g.jsx("input",{value:A,onChange:R=>b(R.target.value),onBlur:()=>void E(N.id),onKeyDown:R=>{R.key==="Enter"&&E(N.id),R.key==="Escape"&&w(void 0)},autoFocus:!0,className:"flex-1 rounded border border-neutral-700 bg-neutral-950 px-1 py-0.5 text-sm"}):g.jsx("button",{onClick:()=>s(N.id),onDoubleClick:()=>{w(N.id),b(N.name)},className:"flex-1 truncate text-left",title:N.path,children:N.name}),g.jsx("button",{onClick:()=>void h(N.id),className:"inline-flex p-1 text-neutral-500 hover:text-neutral-200",title:"New session in this project",children:g.jsx(no,{size:16})}),g.jsx("button",{onClick:()=>_(N.id,N.name),className:"inline-flex items-center p-1 text-neutral-500 hover:text-red-400",title:"Delete project (blocked while live sessions exist)",children:g.jsx(Br,{size:16})})]}),!j&&g.jsx(TE,{projectId:N.id})]},N.id)})]}),m&&g.jsx(lx,{onClose:()=>f(!1)}),g.jsx(go,{open:y!==void 0,onClose:()=>S(void 0),title:y!==void 0?`Delete project "${y.name}"`:"Delete project",children:y!==void 0&&g.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[g.jsxs("p",{className:"text-xs text-neutral-300",children:['Remove "',y.name,'" from the pi-forge. The project folder on disk is'," ",g.jsx("strong",{children:"not"})," deleted; only the pi-forge's record of it goes away."]}),y.onDiskCount>0&&g.jsxs("label",{className:"flex items-start gap-2 rounded border border-neutral-800 bg-neutral-950 px-2 py-1.5 text-xs text-neutral-300",children:[g.jsx("input",{type:"checkbox",checked:y.cascade,onChange:N=>S(T=>T===void 0?T:{...T,cascade:N.target.checked}),className:"mt-0.5 h-3 w-3"}),g.jsxs("span",{children:["Also delete ",y.onDiskCount," on-disk session file",y.onDiskCount===1?"":"s"," (under"," ",g.jsxs("code",{className:"font-mono text-[10px] text-neutral-400",children:[".pi/sessions/",y.id,"/"]}),"). Without this, the JSONLs stay on disk and become orphaned — recoverable but not reachable through the pi-forge."]})]}),y.onDiskCount===0&&g.jsx("p",{className:"text-[11px] italic text-neutral-500",children:"No on-disk sessions for this project; nothing to clean up beyond the project record."}),g.jsxs("footer",{className:"flex justify-end gap-2 pt-1",children:[g.jsx("button",{type:"button",onClick:()=>S(void 0),className:"rounded-md border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:bg-neutral-800",children:"Cancel"}),g.jsx("button",{type:"button",onClick:()=>void x(),className:"rounded-md bg-red-700 px-3 py-1 text-xs font-medium text-red-50 hover:bg-red-600",children:"Delete"})]})]})})]})}function ux(e){var r,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(r=0;r<a;r++)e[r]&&(n=ux(e[r]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function dx(){for(var e,r,n=0,s="",a=arguments.length;n<a;n++)(e=arguments[n])&&(r=ux(e))&&(s&&(s+=" "),s+=r);return s}var jE=Object.create,bc=Object.defineProperty,DE=Object.defineProperties,BE=Object.getOwnPropertyDescriptor,IE=Object.getOwnPropertyDescriptors,hx=Object.getOwnPropertyNames,hc=Object.getOwnPropertySymbols,LE=Object.getPrototypeOf,jf=Object.prototype.hasOwnProperty,fx=Object.prototype.propertyIsEnumerable,Gy=(e,r,n)=>r in e?bc(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,or=(e,r)=>{for(var n in r||(r={}))jf.call(r,n)&&Gy(e,n,r[n]);if(hc)for(var n of hc(r))fx.call(r,n)&&Gy(e,n,r[n]);return e},xc=(e,r)=>DE(e,IE(r)),px=(e,r)=>{var n={};for(var s in e)jf.call(e,s)&&r.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&hc)for(var s of hc(e))r.indexOf(s)<0&&fx.call(e,s)&&(n[s]=e[s]);return n},ME=(e,r)=>function(){return r||(0,e[hx(e)[0]])((r={exports:{}}).exports,r),r.exports},OE=(e,r)=>{for(var n in r)bc(e,n,{get:r[n],enumerable:!0})},zE=(e,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of hx(r))!jf.call(e,a)&&a!==n&&bc(e,a,{get:()=>r[a],enumerable:!(s=BE(r,a))||s.enumerable});return e},FE=(e,r,n)=>(n=e!=null?jE(LE(e)):{},zE(!e||!e.__esModule?bc(n,"default",{value:e,enumerable:!0}):n,e)),PE=ME({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,r){var n=(function(){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,a=0,u={},d={util:{encode:function A(b){return b instanceof o?new o(b.type,A(b.content),b.alias):Array.isArray(b)?b.map(A):b.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(A){return Object.prototype.toString.call(A).slice(8,-1)},objId:function(A){return A.__id||Object.defineProperty(A,"__id",{value:++a}),A.__id},clone:function A(b,y){y=y||{};var S,_;switch(d.util.type(b)){case"Object":if(_=d.util.objId(b),y[_])return y[_];S={},y[_]=S;for(var x in b)b.hasOwnProperty(x)&&(S[x]=A(b[x],y));return S;case"Array":return _=d.util.objId(b),y[_]?y[_]:(S=[],y[_]=S,b.forEach(function(E,N){S[N]=A(E,y)}),S);default:return b}},getLanguage:function(A){for(;A;){var b=s.exec(A.className);if(b)return b[1].toLowerCase();A=A.parentElement}return"none"},setLanguage:function(A,b){A.className=A.className.replace(RegExp(s,"gi"),""),A.classList.add("language-"+b)},isActive:function(A,b,y){for(var S="no-"+b;A;){var _=A.classList;if(_.contains(b))return!0;if(_.contains(S))return!1;A=A.parentElement}return!!y}},languages:{plain:u,plaintext:u,text:u,txt:u,extend:function(A,b){var y=d.util.clone(d.languages[A]);for(var S in b)y[S]=b[S];return y},insertBefore:function(A,b,y,S){S=S||d.languages;var _=S[A],x={};for(var E in _)if(_.hasOwnProperty(E)){if(E==b)for(var N in y)y.hasOwnProperty(N)&&(x[N]=y[N]);y.hasOwnProperty(E)||(x[E]=_[E])}var T=S[A];return S[A]=x,d.languages.DFS(d.languages,function(j,R){R===T&&j!=A&&(this[j]=x)}),x},DFS:function A(b,y,S,_){_=_||{};var x=d.util.objId;for(var E in b)if(b.hasOwnProperty(E)){y.call(b,E,b[E],S||E);var N=b[E],T=d.util.type(N);T==="Object"&&!_[x(N)]?(_[x(N)]=!0,A(N,y,null,_)):T==="Array"&&!_[x(N)]&&(_[x(N)]=!0,A(N,y,E,_))}}},plugins:{},highlight:function(A,b,y){var S={code:A,grammar:b,language:y};if(d.hooks.run("before-tokenize",S),!S.grammar)throw new Error('The language "'+S.language+'" has no grammar.');return S.tokens=d.tokenize(S.code,S.grammar),d.hooks.run("after-tokenize",S),o.stringify(d.util.encode(S.tokens),S.language)},tokenize:function(A,b){var y=b.rest;if(y){for(var S in y)b[S]=y[S];delete b.rest}var _=new m;return f(_,_.head,A),h(A,_,b,_.head,0),w(_)},hooks:{all:{},add:function(A,b){var y=d.hooks.all;y[A]=y[A]||[],y[A].push(b)},run:function(A,b){var y=d.hooks.all[A];if(!(!y||!y.length))for(var S=0,_;_=y[S++];)_(b)}},Token:o};function o(A,b,y,S){this.type=A,this.content=b,this.alias=y,this.length=(S||"").length|0}o.stringify=function A(b,y){if(typeof b=="string")return b;if(Array.isArray(b)){var S="";return b.forEach(function(T){S+=A(T,y)}),S}var _={type:b.type,content:A(b.content,y),tag:"span",classes:["token",b.type],attributes:{},language:y},x=b.alias;x&&(Array.isArray(x)?Array.prototype.push.apply(_.classes,x):_.classes.push(x)),d.hooks.run("wrap",_);var E="";for(var N in _.attributes)E+=" "+N+'="'+(_.attributes[N]||"").replace(/"/g,""")+'"';return"<"+_.tag+' class="'+_.classes.join(" ")+'"'+E+">"+_.content+"</"+_.tag+">"};function c(A,b,y,S){A.lastIndex=b;var _=A.exec(y);if(_&&S&&_[1]){var x=_[1].length;_.index+=x,_[0]=_[0].slice(x)}return _}function h(A,b,y,S,_,x){for(var E in y)if(!(!y.hasOwnProperty(E)||!y[E])){var N=y[E];N=Array.isArray(N)?N:[N];for(var T=0;T<N.length;++T){if(x&&x.cause==E+","+T)return;var j=N[T],R=j.inside,D=!!j.lookbehind,L=!!j.greedy,z=j.alias;if(L&&!j.pattern.global){var U=j.pattern.toString().match(/[imsuy]*$/)[0];j.pattern=RegExp(j.pattern.source,U+"g")}for(var P=j.pattern||j,G=S.next,K=_;G!==b.tail&&!(x&&K>=x.reach);K+=G.value.length,G=G.next){var W=G.value;if(b.length>A.length)return;if(!(W instanceof o)){var Y=1,ne;if(L){if(ne=c(P,K,A,D),!ne||ne.index>=A.length)break;var Q=ne.index,F=ne.index+ne[0].length,B=K;for(B+=G.value.length;Q>=B;)G=G.next,B+=G.value.length;if(B-=G.value.length,K=B,G.value instanceof o)continue;for(var O=G;O!==b.tail&&(B<F||typeof O.value=="string");O=O.next)Y++,B+=O.value.length;Y--,W=A.slice(K,B),ne.index-=K}else if(ne=c(P,0,W,D),!ne)continue;var Q=ne.index,M=ne[0],J=W.slice(0,Q),de=W.slice(Q+M.length),pe=K+W.length;x&&pe>x.reach&&(x.reach=pe);var X=G.prev;J&&(X=f(b,X,J),K+=J.length),v(b,X,Y);var $=new o(E,R?d.tokenize(M,R):M,z,M);if(G=f(b,X,$),de&&f(b,G,de),Y>1){var se={cause:E+","+T,reach:pe};h(A,b,y,G.prev,K,se),x&&se.reach>x.reach&&(x.reach=se.reach)}}}}}}function m(){var A={value:null,prev:null,next:null},b={value:null,prev:A,next:null};A.next=b,this.head=A,this.tail=b,this.length=0}function f(A,b,y){var S=b.next,_={value:y,prev:b,next:S};return b.next=_,S.prev=_,A.length++,_}function v(A,b,y){for(var S=b.next,_=0;_<y&&S!==A.tail;_++)S=S.next;b.next=S,S.prev=b,A.length-=_}function w(A){for(var b=[],y=A.head.next;y!==A.tail;)b.push(y.value),y=y.next;return b}return d})();r.exports=n,n.default=n}}),ve=FE(PE());ve.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},ve.languages.markup.tag.inside["attr-value"].inside.entity=ve.languages.markup.entity,ve.languages.markup.doctype.inside["internal-subset"].inside=ve.languages.markup,ve.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(ve.languages.markup.tag,"addInlined",{value:function(e,s){var n={},n=(n["language-"+s]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:ve.languages[s]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),s=(n["language-"+s]={pattern:/[\s\S]+/,inside:ve.languages[s]},{});s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:n},ve.languages.insertBefore("markup","cdata",s)}}),Object.defineProperty(ve.languages.markup.tag,"addAttribute",{value:function(e,r){ve.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[r,"language-"+r],inside:ve.languages[r]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),ve.languages.html=ve.languages.markup,ve.languages.mathml=ve.languages.markup,ve.languages.svg=ve.languages.markup,ve.languages.xml=ve.languages.extend("markup",{}),ve.languages.ssml=ve.languages.xml,ve.languages.atom=ve.languages.xml,ve.languages.rss=ve.languages.xml,(function(e){var r={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,s="(?:[^\\\\-]|"+n.source+")",s=RegExp(s+"-"+s),a={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:s,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":r,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":r,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":a}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":a}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(ve),ve.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},ve.languages.javascript=ve.languages.extend("clike",{"class-name":[ve.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),ve.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,ve.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:ve.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:ve.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:ve.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:ve.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:ve.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),ve.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:ve.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),ve.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),ve.languages.markup&&(ve.languages.markup.tag.addInlined("script","javascript"),ve.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),ve.languages.js=ve.languages.javascript,ve.languages.actionscript=ve.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),ve.languages.actionscript["class-name"].alias="function",delete ve.languages.actionscript.parameter,delete ve.languages.actionscript["literal-property"],ve.languages.markup&&ve.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:ve.languages.markup}}),(function(e){var r=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:r,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:r,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript})(ve),(function(e){var r=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(r,"addSupport",{value:function(n,s){(n=typeof n=="string"?[n]:n).forEach(function(a){var u=function(f){f.inside||(f.inside={}),f.inside.rest=s},d="doc-comment";if(o=e.languages[a]){var o,c=o[d];if((c=c||(o=e.languages.insertBefore(a,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[d])instanceof RegExp&&(c=o[d]={pattern:c}),Array.isArray(c))for(var h=0,m=c.length;h<m;h++)c[h]instanceof RegExp&&(c[h]={pattern:c[h]}),u(c[h]);else u(c)}})}}),r.addSupport(["java","javascript","php"],r)})(ve),(function(e){var r=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,r=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+r.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+r.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+r.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+r.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:r,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(ve),(function(e){var r=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,r=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:r={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+r.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[r,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=r,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:n})})(ve),(function(e){var r=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+n.source+"(?:[ ]+"+r.source+")?|"+r.source+"(?:[ ]+"+n.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),u=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function d(o,c){c=(c||"").replace(/m/g,"")+"m";var h=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return s}).replace(/<<value>>/g,function(){return o});return RegExp(h,c)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return s}).replace(/<<key>>/g,function(){return"(?:"+a+"|"+u+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:d(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:d(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:d(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:d(u),lookbehind:!0,greedy:!0},number:{pattern:d(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:r,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml})(ve),(function(e){var r=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(h){return h=h.replace(/<inner>/g,function(){return r}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+h+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),u=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,d=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+a+u+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+u+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+u+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(h){["url","bold","italic","strike","code-snippet"].forEach(function(m){h!==m&&(e.languages.markdown[h].inside.content.inside[m]=e.languages.markdown[m])})}),e.hooks.add("after-tokenize",function(h){h.language!=="markdown"&&h.language!=="md"||(function m(f){if(f&&typeof f!="string")for(var v=0,w=f.length;v<w;v++){var A,b=f[v];b.type!=="code"?m(b.content):(A=b.content[1],b=b.content[3],A&&b&&A.type==="code-language"&&b.type==="code-block"&&typeof A.content=="string"&&(A=A.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),A="language-"+(A=(/[a-z][\w-]*/i.exec(A)||[""])[0].toLowerCase()),b.alias?typeof b.alias=="string"?b.alias=[b.alias,A]:b.alias.push(A):b.alias=[A]))}})(h.tokens)}),e.hooks.add("wrap",function(h){if(h.type==="code-block"){for(var m="",f=0,v=h.classes.length;f<v;f++){var w=h.classes[f],w=/language-(.+)/.exec(w);if(w){m=w[1];break}}var A,b=e.languages[m];b?h.content=e.highlight((function(y){return y=y.replace(d,""),y=y.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(S,_){var x;return(_=_.toLowerCase())[0]==="#"?(x=_[1]==="x"?parseInt(_.slice(2),16):Number(_.slice(1)),c(x)):o[_]||S})})(h.content),b,m):m&&m!=="none"&&e.plugins.autoloader&&(A="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),h.attributes.id=A,e.plugins.autoloader.loadLanguages(m,function(){var y=document.getElementById(A);y&&(y.innerHTML=e.highlight(y.textContent,e.languages[m],m))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),o={amp:"&",lt:"<",gt:">",quot:'"'},c=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown})(ve),ve.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:ve.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},ve.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var r=e.tokens.filter(function(A){return typeof A!="string"&&A.type!=="comment"&&A.type!=="scalar"}),n=0;n<r.length;){var s=r[n++];if(s.type==="keyword"&&s.content==="mutation"){var a=[];if(f(["definition-mutation","punctuation"])&&m(1).content==="("){n+=2;var u=v(/^\($/,/^\)$/);if(u===-1)continue;for(;n<u;n++){var d=m(0);d.type==="variable"&&(w(d,"variable-input"),a.push(d.content))}n=u+1}if(f(["punctuation","property-query"])&&m(0).content==="{"&&(n++,w(m(0),"property-mutation"),0<a.length)){var o=v(/^\{$/,/^\}$/);if(o!==-1)for(var c=n;c<o;c++){var h=r[c];h.type==="variable"&&0<=a.indexOf(h.content)&&w(h,"variable-input")}}}}function m(A){return r[n+A]}function f(A,b){b=b||0;for(var y=0;y<A.length;y++){var S=m(y+b);if(!S||S.type!==A[y])return}return 1}function v(A,b){for(var y=1,S=n;S<r.length;S++){var _=r[S],x=_.content;if(_.type==="punctuation"&&typeof x=="string"){if(A.test(x))y++;else if(b.test(x)&&--y===0)return S}}return-1}function w(A,b){var y=A.alias;y?Array.isArray(y)||(A.alias=y=[y]):A.alias=y=[],y.push(b)}}),ve.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(e){var r=e.languages.javascript["template-string"],n=r.pattern.source,s=r.inside.interpolation,a=s.inside["interpolation-punctuation"],u=s.pattern.source;function d(f,v){if(e.languages[f])return{pattern:RegExp("((?:"+v+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:f}}}}function o(f,v,w){return f={code:f,grammar:v,language:w},e.hooks.run("before-tokenize",f),f.tokens=e.tokenize(f.code,f.grammar),e.hooks.run("after-tokenize",f),f.tokens}function c(f,v,w){var y=e.tokenize(f,{interpolation:{pattern:RegExp(u),lookbehind:!0}}),A=0,b={},y=o(y.map(function(_){if(typeof _=="string")return _;for(var x,E,_=_.content;f.indexOf((E=A++,x="___"+w.toUpperCase()+"_"+E+"___"))!==-1;);return b[x]=_,x}).join(""),v,w),S=Object.keys(b);return A=0,(function _(x){for(var E=0;E<x.length;E++){if(A>=S.length)return;var N,T,j,R,D,L,z,U=x[E];typeof U=="string"||typeof U.content=="string"?(N=S[A],(z=(L=typeof U=="string"?U:U.content).indexOf(N))!==-1&&(++A,T=L.substring(0,z),D=b[N],j=void 0,(R={})["interpolation-punctuation"]=a,(R=e.tokenize(D,R)).length===3&&((j=[1,1]).push.apply(j,o(R[1],e.languages.javascript,"javascript")),R.splice.apply(R,j)),j=new e.Token("interpolation",R,s.alias,D),R=L.substring(z+N.length),D=[],T&&D.push(T),D.push(j),R&&(_(L=[R]),D.push.apply(D,L)),typeof U=="string"?(x.splice.apply(x,[E,1].concat(D)),E+=D.length-1):U.content=D)):(z=U.content,Array.isArray(z)?_(z):_([z]))}})(y),new e.Token(w,y,"language-"+w,f)}e.languages.javascript["template-string"]=[d("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),d("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),d("svg",/\bsvg/.source),d("markdown",/\b(?:markdown|md)/.source),d("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),d("sql",/\bsql/.source),r].filter(Boolean);var h={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function m(f){return typeof f=="string"?f:Array.isArray(f)?f.map(m).join(""):m(f.content)}e.hooks.add("after-tokenize",function(f){f.language in h&&(function v(w){for(var A=0,b=w.length;A<b;A++){var y,S,_,x=w[A];typeof x!="string"&&(y=x.content,Array.isArray(y)?x.type==="template-string"?(x=y[1],y.length===3&&typeof x!="string"&&x.type==="embedded-code"&&(S=m(x),x=x.alias,x=Array.isArray(x)?x[0]:x,_=e.languages[x])&&(y[1]=c(S,_,x))):v(y):typeof y!="string"&&v([y]))}})(f.tokens)})})(ve),(function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var r=e.languages.extend("typescript",{});delete r["class-name"],e.languages.typescript["class-name"].inside=r,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:r}}}}),e.languages.ts=e.languages.typescript})(ve),(function(e){var r=e.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,s="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(s+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(s+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:r,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:r.string,number:r.number,boolean:r.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:r,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)})(ve),(function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})})(ve),ve.languages.n4js=ve.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),ve.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),ve.languages.n4jsd=ve.languages.n4js,(function(e){function r(d,o){return RegExp(d.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),o)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:r(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:r(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:r(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],s=0;s<n.length;s++){var u=n[s],a=e.languages.javascript[u],u=(a=e.util.type(a)==="RegExp"?e.languages.javascript[u]={pattern:a}:a).inside||{};(a.inside=u)["maybe-class-name"]=/^[A-Z][\s\S]*/}})(ve),(function(e){var r=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,s=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,a=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function u(c,h){return c=c.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return s}).replace(/<SPREAD>/g,function(){return a}),RegExp(c,h)}a=u(a).source,e.languages.jsx=e.languages.extend("markup",r),e.languages.jsx.tag.pattern=u(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=r.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:u(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:u(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function d(c){for(var h=[],m=0;m<c.length;m++){var f=c[m],v=!1;typeof f!="string"&&(f.type==="tag"&&f.content[0]&&f.content[0].type==="tag"?f.content[0].content[0].content==="</"?0<h.length&&h[h.length-1].tagName===o(f.content[0].content[1])&&h.pop():f.content[f.content.length-1].content!=="/>"&&h.push({tagName:o(f.content[0].content[1]),openedBraces:0}):0<h.length&&f.type==="punctuation"&&f.content==="{"?h[h.length-1].openedBraces++:0<h.length&&0<h[h.length-1].openedBraces&&f.type==="punctuation"&&f.content==="}"?h[h.length-1].openedBraces--:v=!0),(v||typeof f=="string")&&0<h.length&&h[h.length-1].openedBraces===0&&(v=o(f),m<c.length-1&&(typeof c[m+1]=="string"||c[m+1].type==="plain-text")&&(v+=o(c[m+1]),c.splice(m+1,1)),0<m&&(typeof c[m-1]=="string"||c[m-1].type==="plain-text")&&(v=o(c[m-1])+v,c.splice(m-1,1),m--),c[m]=new e.Token("plain-text",v,null,v)),f.content&&typeof f.content!="string"&&d(f.content)}}var o=function(c){return c?typeof c=="string"?c:typeof c.content=="string"?c.content:c.content.map(o).join(""):""};e.hooks.add("after-tokenize",function(c){c.language!=="jsx"&&c.language!=="tsx"||d(c.tokens)})})(ve),(function(e){var r=e.util.clone(e.languages.typescript),r=(e.languages.tsx=e.languages.extend("jsx",r),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);r.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+r.pattern.source+")",r.pattern.flags),r.lookbehind=!0})(ve),ve.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},ve.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=ve.languages.swift}),(function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var r={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:r},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:r},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin})(ve),ve.languages.c=ve.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),ve.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),ve.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},ve.languages.c.string],char:ve.languages.c.char,comment:ve.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:ve.languages.c}}}}),ve.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete ve.languages.c.boolean,ve.languages.objectivec=ve.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete ve.languages.objectivec["class-name"],ve.languages.objc=ve.languages.objectivec,ve.languages.reason=ve.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),ve.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete ve.languages.reason.function,(function(e){for(var r=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)r=r.replace(/<self>/g,function(){return r});r=r.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+r),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(ve),ve.languages.go=ve.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),ve.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete ve.languages.go["class-name"],(function(e){var r=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return r.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return r.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:r,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(ve),ve.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},ve.languages.python["string-interpolation"].inside.interpolation.inside.rest=ve.languages.python,ve.languages.py=ve.languages.python,ve.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},ve.languages.webmanifest=ve.languages.json;var Df={};OE(Df,{dracula:()=>UE,duotoneDark:()=>qE,duotoneLight:()=>GE,github:()=>KE,gruvboxMaterialDark:()=>wk,gruvboxMaterialLight:()=>Ck,jettwaveDark:()=>gk,jettwaveLight:()=>yk,nightOwl:()=>XE,nightOwlLight:()=>ZE,oceanicNext:()=>ek,okaidia:()=>nk,oneDark:()=>bk,oneLight:()=>_k,palenight:()=>ik,shadesOfPurple:()=>ak,synthwave84:()=>lk,ultramin:()=>uk,vsDark:()=>gx,vsLight:()=>fk});var HE={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},UE=HE,$E={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},qE=$E,QE={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},GE=QE,WE={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},KE=WE,VE={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},XE=VE,YE={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},ZE=YE,Tn={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},JE={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:Tn.keyword}},{types:["attr-value"],style:{color:Tn.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:Tn.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:Tn.primitive}},{types:["boolean"],style:{color:Tn.boolean}},{types:["tag"],style:{color:Tn.tag}},{types:["string"],style:{color:Tn.string}},{types:["punctuation"],style:{color:Tn.string}},{types:["selector","char","builtin","inserted"],style:{color:Tn.char}},{types:["function"],style:{color:Tn.function}},{types:["operator","entity","url","variable"],style:{color:Tn.variable}},{types:["keyword"],style:{color:Tn.keyword}},{types:["atrule","class-name"],style:{color:Tn.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},ek=JE,tk={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},nk=tk,rk={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},ik=rk,sk={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},ak=sk,ok={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},lk=ok,ck={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},uk=ck,dk={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},gx=dk,hk={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},fk=hk,pk={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},gk=pk,mk={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},yk=mk,vk={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},bk=vk,xk={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},_k=xk,Sk={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},wk=Sk,Ak={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},Ck=Ak,Ek=e=>q.useCallback(r=>{var n=r,{className:s,style:a,line:u}=n,d=px(n,["className","style","line"]);const o=xc(or({},d),{className:dx("token-line",s)});return typeof e=="object"&&"plain"in e&&(o.style=e.plain),typeof a=="object"&&(o.style=or(or({},o.style||{}),a)),o},[e]),kk=e=>{const r=q.useCallback(({types:n,empty:s})=>{if(e!=null){{if(n.length===1&&n[0]==="plain")return s!=null?{display:"inline-block"}:void 0;if(n.length===1&&s!=null)return e[n[0]]}return Object.assign(s!=null?{display:"inline-block"}:{},...n.map(a=>e[a]))}},[e]);return q.useCallback(n=>{var s=n,{token:a,className:u,style:d}=s,o=px(s,["token","className","style"]);const c=xc(or({},o),{className:dx("token",...a.types,u),children:a.content,style:r(a)});return d!=null&&(c.style=or(or({},c.style||{}),d)),c},[r])},Nk=/\r\n|\r|\n/,Wy=e=>{e.length===0?e.push({types:["plain"],content:`
|
|
292
|
+
`,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
|
|
293
|
+
`,e[0].empty=!0)},Ky=(e,r)=>{const n=e.length;return n>0&&e[n-1]===r?e:e.concat(r)},Tk=e=>{const r=[[]],n=[e],s=[0],a=[e.length];let u=0,d=0,o=[];const c=[o];for(;d>-1;){for(;(u=s[d]++)<a[d];){let h,m=r[d];const v=n[d][u];if(typeof v=="string"?(m=d>0?m:["plain"],h=v):(m=Ky(m,v.type),v.alias&&(m=Ky(m,v.alias)),h=v.content),typeof h!="string"){d++,r.push(m),n.push(h),s.push(0),a.push(h.length);continue}const w=h.split(Nk),A=w.length;o.push({types:m,content:w[0]});for(let b=1;b<A;b++)Wy(o),c.push(o=[]),o.push({types:m,content:w[b]})}d--,r.pop(),n.pop(),s.pop(),a.pop()}return Wy(o),c},Vy=Tk,Rk=({prism:e,code:r,grammar:n,language:s})=>q.useMemo(()=>{if(n==null)return Vy([r]);const a={code:r,grammar:n,language:s,tokens:[]};return e.hooks.run("before-tokenize",a),a.tokens=e.tokenize(r,n),e.hooks.run("after-tokenize",a),Vy(a.tokens)},[r,n,s,e]),jk=(e,r)=>{const{plain:n}=e,s=e.styles.reduce((a,u)=>{const{languages:d,style:o}=u;return d&&!d.includes(r)||u.types.forEach(c=>{const h=or(or({},a[c]),o);a[c]=h}),a},{});return s.root=n,s.plain=xc(or({},n),{backgroundColor:void 0}),s},Dk=jk,Bk=({children:e,language:r,code:n,theme:s,prism:a})=>{const u=r.toLowerCase(),d=Dk(s,u),o=Ek(d),c=kk(d),h=a.languages[u],m=Rk({prism:a,language:u,code:n,grammar:h});return e({tokens:m,className:`prism-code language-${u}`,style:d!=null?d.root:{},getLineProps:o,getTokenProps:c})},mx=e=>q.createElement(Bk,xc(or({},e),{prism:e.prism||ve,theme:e.theme||gx,code:e.code,language:e.language}));/*! Bundled license information:
|
|
294
|
+
|
|
295
|
+
prismjs/prism.js:
|
|
296
|
+
(**
|
|
297
|
+
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
298
|
+
*
|
|
299
|
+
* @license MIT <https://opensource.org/licenses/MIT>
|
|
300
|
+
* @author Lea Verou <https://lea.verou.me>
|
|
301
|
+
* @namespace
|
|
302
|
+
* @public
|
|
303
|
+
*)
|
|
304
|
+
*/function Xy(e){const r=[],n=String(e||"");let s=n.indexOf(","),a=0,u=!1;for(;!u;){s===-1&&(s=n.length,u=!0);const d=n.slice(a,s).trim();(d||!u)&&r.push(d),a=s+1,s=n.indexOf(",",a)}return r}function Ik(e,r){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Lk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Mk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ok={};function Yy(e,r){return(Ok.jsx?Mk:Lk).test(e)}const zk=/[ \t\n\f\r]/g;function Fk(e){return typeof e=="object"?e.type==="text"?Zy(e.value):!1:Zy(e)}function Zy(e){return e.replace(zk,"")===""}class mo{constructor(r,n,s){this.normal=n,this.property=r,s&&(this.space=s)}}mo.prototype.normal={};mo.prototype.property={};mo.prototype.space=void 0;function yx(e,r){const n={},s={};for(const a of e)Object.assign(n,a.property),Object.assign(s,a.normal);return new mo(n,s,r)}function io(e){return e.toLowerCase()}class _n{constructor(r,n){this.attribute=n,this.property=r}}_n.prototype.attribute="";_n.prototype.booleanish=!1;_n.prototype.boolean=!1;_n.prototype.commaOrSpaceSeparated=!1;_n.prototype.commaSeparated=!1;_n.prototype.defined=!1;_n.prototype.mustUseProperty=!1;_n.prototype.number=!1;_n.prototype.overloadedBoolean=!1;_n.prototype.property="";_n.prototype.spaceSeparated=!1;_n.prototype.space=void 0;let Pk=0;const Ke=Hi(),Qt=Hi(),Vh=Hi(),Se=Hi(),At=Hi(),Ps=Hi(),Rn=Hi();function Hi(){return 2**++Pk}const Xh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ke,booleanish:Qt,commaOrSpaceSeparated:Rn,commaSeparated:Ps,number:Se,overloadedBoolean:Vh,spaceSeparated:At},Symbol.toStringTag,{value:"Module"})),uh=Object.keys(Xh);class Bf extends _n{constructor(r,n,s,a){let u=-1;if(super(r,n),Jy(this,"space",a),typeof s=="number")for(;++u<uh.length;){const d=uh[u];Jy(this,uh[u],(s&Xh[d])===Xh[d])}}}Bf.prototype.defined=!0;function Jy(e,r,n){n&&(e[r]=n)}function Qs(e){const r={},n={};for(const[s,a]of Object.entries(e.properties)){const u=new Bf(s,e.transform(e.attributes||{},s),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(u.mustUseProperty=!0),r[s]=u,n[io(s)]=s,n[io(u.attribute)]=s}return new mo(r,n,e.space)}const vx=Qs({properties:{ariaActiveDescendant:null,ariaAtomic:Qt,ariaAutoComplete:null,ariaBusy:Qt,ariaChecked:Qt,ariaColCount:Se,ariaColIndex:Se,ariaColSpan:Se,ariaControls:At,ariaCurrent:null,ariaDescribedBy:At,ariaDetails:null,ariaDisabled:Qt,ariaDropEffect:At,ariaErrorMessage:null,ariaExpanded:Qt,ariaFlowTo:At,ariaGrabbed:Qt,ariaHasPopup:null,ariaHidden:Qt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:At,ariaLevel:Se,ariaLive:null,ariaModal:Qt,ariaMultiLine:Qt,ariaMultiSelectable:Qt,ariaOrientation:null,ariaOwns:At,ariaPlaceholder:null,ariaPosInSet:Se,ariaPressed:Qt,ariaReadOnly:Qt,ariaRelevant:null,ariaRequired:Qt,ariaRoleDescription:At,ariaRowCount:Se,ariaRowIndex:Se,ariaRowSpan:Se,ariaSelected:Qt,ariaSetSize:Se,ariaSort:null,ariaValueMax:Se,ariaValueMin:Se,ariaValueNow:Se,ariaValueText:null,role:null},transform(e,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function bx(e,r){return r in e?e[r]:r}function xx(e,r){return bx(e,r.toLowerCase())}const Hk=Qs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ps,acceptCharset:At,accessKey:At,action:null,allow:null,allowFullScreen:Ke,allowPaymentRequest:Ke,allowUserMedia:Ke,alt:null,as:null,async:Ke,autoCapitalize:null,autoComplete:At,autoFocus:Ke,autoPlay:Ke,blocking:At,capture:null,charSet:null,checked:Ke,cite:null,className:At,cols:Se,colSpan:null,content:null,contentEditable:Qt,controls:Ke,controlsList:At,coords:Se|Ps,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ke,defer:Ke,dir:null,dirName:null,disabled:Ke,download:Vh,draggable:Qt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ke,formTarget:null,headers:At,height:Se,hidden:Vh,high:Se,href:null,hrefLang:null,htmlFor:At,httpEquiv:At,id:null,imageSizes:null,imageSrcSet:null,inert:Ke,inputMode:null,integrity:null,is:null,isMap:Ke,itemId:null,itemProp:At,itemRef:At,itemScope:Ke,itemType:At,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ke,low:Se,manifest:null,max:null,maxLength:Se,media:null,method:null,min:null,minLength:Se,multiple:Ke,muted:Ke,name:null,nonce:null,noModule:Ke,noValidate:Ke,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:Ke,optimum:Se,pattern:null,ping:At,placeholder:null,playsInline:Ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ke,referrerPolicy:null,rel:At,required:Ke,reversed:Ke,rows:Se,rowSpan:Se,sandbox:At,scope:null,scoped:Ke,seamless:Ke,selected:Ke,shadowRootClonable:Ke,shadowRootDelegatesFocus:Ke,shadowRootMode:null,shape:null,size:Se,sizes:null,slot:null,span:Se,spellCheck:Qt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Se,step:null,style:null,tabIndex:Se,target:null,title:null,translate:null,type:null,typeMustMatch:Ke,useMap:null,value:Qt,width:Se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:At,axis:null,background:null,bgColor:null,border:Se,borderColor:null,bottomMargin:Se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ke,declare:Ke,event:null,face:null,frame:null,frameBorder:null,hSpace:Se,leftMargin:Se,link:null,longDesc:null,lowSrc:null,marginHeight:Se,marginWidth:Se,noResize:Ke,noHref:Ke,noShade:Ke,noWrap:Ke,object:null,profile:null,prompt:null,rev:null,rightMargin:Se,rules:null,scheme:null,scrolling:Qt,standby:null,summary:null,text:null,topMargin:Se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Se,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ke,disableRemotePlayback:Ke,prefix:null,property:null,results:Se,security:null,unselectable:null},space:"html",transform:xx}),Uk=Qs({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:Rn,accentHeight:Se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Se,amplitude:Se,arabicForm:null,ascent:Se,attributeName:null,attributeType:null,azimuth:Se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Se,by:null,calcMode:null,capHeight:Se,className:At,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:Se,diffuseConstant:Se,direction:null,display:null,dur:null,divisor:Se,dominantBaseline:null,download:Ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:Se,enableBackground:null,end:null,event:null,exponent:Se,externalResourcesRequired:null,fill:null,fillOpacity:Se,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:Ps,g2:Ps,glyphName:Ps,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Se,horizOriginX:Se,horizOriginY:Se,id:null,ideographic:Se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Se,k:Se,k1:Se,k2:Se,k3:Se,k4:Se,kernelMatrix:Rn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Se,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:Se,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:Se,overlineThickness:Se,paintOrder:null,panose1:null,path:null,pathLength:Se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:At,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Se,pointsAtY:Se,pointsAtZ:Se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Rn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Rn,rev:Rn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Rn,requiredFeatures:Rn,requiredFonts:Rn,requiredFormats:Rn,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:Se,specularExponent:Se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Se,strikethroughThickness:Se,string:null,stroke:null,strokeDashArray:Rn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Se,strokeOpacity:Se,strokeWidth:null,style:null,surfaceScale:Se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Rn,tabIndex:Se,tableValues:null,target:null,targetX:Se,targetY:Se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Rn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Se,underlineThickness:Se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Se,values:null,vAlphabetic:Se,vMathematical:Se,vectorEffect:null,vHanging:Se,vIdeographic:Se,version:null,vertAdvY:Se,vertOriginX:Se,vertOriginY:Se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:bx}),_x=Qs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,r){return"xlink:"+r.slice(5).toLowerCase()}}),Sx=Qs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:xx}),wx=Qs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,r){return"xml:"+r.slice(3).toLowerCase()}}),$k={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"},qk=/[A-Z]/g,ev=/-[a-z]/g,Qk=/^data[-\w.:]+$/i;function Ax(e,r){const n=io(r);let s=r,a=_n;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Qk.test(r)){if(r.charAt(4)==="-"){const u=r.slice(5).replace(ev,Wk);s="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=r.slice(4);if(!ev.test(u)){let d=u.replace(qk,Gk);d.charAt(0)!=="-"&&(d="-"+d),r="data"+d}}a=Bf}return new a(s,r)}function Gk(e){return"-"+e.toLowerCase()}function Wk(e){return e.charAt(1).toUpperCase()}const Cx=yx([vx,Hk,_x,Sx,wx],"html"),_c=yx([vx,Uk,_x,Sx,wx],"svg");function tv(e){const r=String(e||"").trim();return r?r.split(/[ \t\n\r\f]+/g):[]}function Kk(e){return e.join(" ").trim()}var Ds={},dh,nv;function Vk(){if(nv)return dh;nv=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,n=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,o=/^\s+|\s+$/g,c=`
|
|
305
|
+
`,h="/",m="*",f="",v="comment",w="declaration";function A(y,S){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];S=S||{};var _=1,x=1;function E(G){var K=G.match(r);K&&(_+=K.length);var W=G.lastIndexOf(c);x=~W?G.length-W:x+G.length}function N(){var G={line:_,column:x};return function(K){return K.position=new T(G),D(),K}}function T(G){this.start=G,this.end={line:_,column:x},this.source=S.source}T.prototype.content=y;function j(G){var K=new Error(S.source+":"+_+":"+x+": "+G);if(K.reason=G,K.filename=S.source,K.line=_,K.column=x,K.source=y,!S.silent)throw K}function R(G){var K=G.exec(y);if(K){var W=K[0];return E(W),y=y.slice(W.length),K}}function D(){R(n)}function L(G){var K;for(G=G||[];K=z();)K!==!1&&G.push(K);return G}function z(){var G=N();if(!(h!=y.charAt(0)||m!=y.charAt(1))){for(var K=2;f!=y.charAt(K)&&(m!=y.charAt(K)||h!=y.charAt(K+1));)++K;if(K+=2,f===y.charAt(K-1))return j("End of comment missing");var W=y.slice(2,K-2);return x+=2,E(W),y=y.slice(K),x+=2,G({type:v,comment:W})}}function U(){var G=N(),K=R(s);if(K){if(z(),!R(a))return j("property missing ':'");var W=R(u),Y=G({type:w,property:b(K[0].replace(e,f)),value:W?b(W[0].replace(e,f)):f});return R(d),Y}}function P(){var G=[];L(G);for(var K;K=U();)K!==!1&&(G.push(K),L(G));return G}return D(),P()}function b(y){return y?y.replace(o,f):f}return dh=A,dh}var rv;function Xk(){if(rv)return Ds;rv=1;var e=Ds&&Ds.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.default=n;const r=e(Vk());function n(s,a){let u=null;if(!s||typeof s!="string")return u;const d=(0,r.default)(s),o=typeof a=="function";return d.forEach(c=>{if(c.type!=="declaration")return;const{property:h,value:m}=c;o?a(h,m,c):m&&(u=u||{},u[h]=m)}),u}return Ds}var Ua={},iv;function Yk(){if(iv)return Ua;iv=1,Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,n=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,u=function(h){return!h||n.test(h)||e.test(h)},d=function(h,m){return m.toUpperCase()},o=function(h,m){return"".concat(m,"-")},c=function(h,m){return m===void 0&&(m={}),u(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(a,o):h=h.replace(s,o),h.replace(r,d))};return Ua.camelCase=c,Ua}var $a,sv;function Zk(){if(sv)return $a;sv=1;var e=$a&&$a.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},r=e(Xk()),n=Yk();function s(a,u){var d={};return!a||typeof a!="string"||(0,r.default)(a,function(o,c){o&&c&&(d[(0,n.camelCase)(o,u)]=c)}),d}return s.default=s,$a=s,$a}var Jk=Zk();const e2=xf(Jk),Ex=kx("end"),If=kx("start");function kx(e){return r;function r(n){const s=n&&n.position&&n.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function t2(e){const r=If(e),n=Ex(e);if(r&&n)return{start:r,end:n}}function Za(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?av(e.position):"start"in e||"end"in e?av(e):"line"in e||"column"in e?Yh(e):""}function Yh(e){return ov(e&&e.line)+":"+ov(e&&e.column)}function av(e){return Yh(e&&e.start)+"-"+Yh(e&&e.end)}function ov(e){return e&&typeof e=="number"?e:1}class cn extends Error{constructor(r,n,s){super(),typeof n=="string"&&(s=n,n=void 0);let a="",u={},d=!1;if(n&&("line"in n&&"column"in n?u={place:n}:"start"in n&&"end"in n?u={place:n}:"type"in n?u={ancestors:[n],place:n.position}:u={...n}),typeof r=="string"?a=r:!u.cause&&r&&(d=!0,a=r.message,u.cause=r),!u.ruleId&&!u.source&&typeof s=="string"){const c=s.indexOf(":");c===-1?u.ruleId=s:(u.source=s.slice(0,c),u.ruleId=s.slice(c+1))}if(!u.place&&u.ancestors&&u.ancestors){const c=u.ancestors[u.ancestors.length-1];c&&(u.place=c.position)}const o=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=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=o?o.line:void 0,this.name=Za(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=d&&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}}cn.prototype.file="";cn.prototype.name="";cn.prototype.reason="";cn.prototype.message="";cn.prototype.stack="";cn.prototype.column=void 0;cn.prototype.line=void 0;cn.prototype.ancestors=void 0;cn.prototype.cause=void 0;cn.prototype.fatal=void 0;cn.prototype.place=void 0;cn.prototype.ruleId=void 0;cn.prototype.source=void 0;const Lf={}.hasOwnProperty,n2=new Map,r2=/[A-Z]/g,i2=new Set(["table","tbody","thead","tfoot","tr"]),s2=new Set(["td","th"]),Nx="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function a2(e,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=r.filePath||void 0;let s;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=p2(n,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=f2(n,r.jsx,r.jsxs)}const a={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:s,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?_c:Cx,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},u=Tx(a,e,void 0);return u&&typeof u!="string"?u:a.create(e,a.Fragment,{children:u||void 0},void 0)}function Tx(e,r,n){if(r.type==="element")return o2(e,r,n);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return l2(e,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return u2(e,r,n);if(r.type==="mdxjsEsm")return c2(e,r);if(r.type==="root")return d2(e,r,n);if(r.type==="text")return h2(e,r)}function o2(e,r,n){const s=e.schema;let a=s;r.tagName.toLowerCase()==="svg"&&s.space==="html"&&(a=_c,e.schema=a),e.ancestors.push(r);const u=jx(e,r.tagName,!1),d=g2(e,r);let o=Of(e,r);return i2.has(r.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!Fk(c):!0})),Rx(e,d,u,r),Mf(d,o),e.ancestors.pop(),e.schema=s,e.create(r,u,d,n)}function l2(e,r){if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}so(e,r.position)}function c2(e,r){if(r.data&&r.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(r.data.estree);so(e,r.position)}function u2(e,r,n){const s=e.schema;let a=s;r.name==="svg"&&s.space==="html"&&(a=_c,e.schema=a),e.ancestors.push(r);const u=r.name===null?e.Fragment:jx(e,r.name,!0),d=m2(e,r),o=Of(e,r);return Rx(e,d,u,r),Mf(d,o),e.ancestors.pop(),e.schema=s,e.create(r,u,d,n)}function d2(e,r,n){const s={};return Mf(s,Of(e,r)),e.create(r,e.Fragment,s,n)}function h2(e,r){return r.value}function Rx(e,r,n,s){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(r.node=s)}function Mf(e,r){if(r.length>0){const n=r.length>1?r:r[0];n&&(e.children=n)}}function f2(e,r,n){return s;function s(a,u,d,o){const h=Array.isArray(d.children)?n:r;return o?h(u,d,o):h(u,d)}}function p2(e,r){return n;function n(s,a,u,d){const o=Array.isArray(u.children),c=If(s);return r(a,u,d,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function g2(e,r){const n={};let s,a;for(a in r.properties)if(a!=="children"&&Lf.call(r.properties,a)){const u=y2(e,a,r.properties[a]);if(u){const[d,o]=u;e.tableCellAlignToStyle&&d==="align"&&typeof o=="string"&&s2.has(r.tagName)?s=o:n[d]=o}}if(s){const u=n.style||(n.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return n}function m2(e,r){const n={};for(const s of r.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const u=s.data.estree.body[0];u.type;const d=u.expression;d.type;const o=d.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else so(e,r.position);else{const a=s.name;let u;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const o=s.value.data.estree.body[0];o.type,u=e.evaluater.evaluateExpression(o.expression)}else so(e,r.position);else u=s.value===null?!0:s.value;n[a]=u}return n}function Of(e,r){const n=[];let s=-1;const a=e.passKeys?new Map:n2;for(;++s<r.children.length;){const u=r.children[s];let d;if(e.passKeys){const c=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(c){const h=a.get(c)||0;d=c+"-"+h,a.set(c,h+1)}}const o=Tx(e,u,d);o!==void 0&&n.push(o)}return n}function y2(e,r,n){const s=Ax(e.schema,r);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=s.commaSeparated?Ik(n):Kk(n)),s.property==="style"){let a=typeof n=="object"?n:v2(e,String(n));return e.stylePropertyNameCase==="css"&&(a=b2(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&s.space?$k[s.property]||s.property:s.attribute,n]}}function v2(e,r){try{return e2(r,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const s=n,a=new cn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=Nx+"#cannot-parse-style-attribute",a}}function jx(e,r,n){let s;if(!n)s={type:"Literal",value:r};else if(r.includes(".")){const a=r.split(".");let u=-1,d;for(;++u<a.length;){const o=Yy(a[u])?{type:"Identifier",name:a[u]}:{type:"Literal",value:a[u]};d=d?{type:"MemberExpression",object:d,property:o,computed:!!(u&&o.type==="Literal"),optional:!1}:o}s=d}else s=Yy(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(s.type==="Literal"){const a=s.value;return Lf.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(s);so(e)}function so(e,r){const n=new cn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:r,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Nx+"#cannot-handle-mdx-estrees-without-createevaluater",n}function b2(e){const r={};let n;for(n in e)Lf.call(e,n)&&(r[x2(n)]=e[n]);return r}function x2(e){let r=e.replace(r2,_2);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function _2(e){return"-"+e.toLowerCase()}const hh={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"]},S2={};function zf(e,r){const n=S2,s=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Dx(e,s,a)}function Dx(e,r,n){if(w2(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(r&&"alt"in e&&e.alt)return e.alt;if("children"in e)return lv(e.children,r,n)}return Array.isArray(e)?lv(e,r,n):""}function lv(e,r,n){const s=[];let a=-1;for(;++a<e.length;)s[a]=Dx(e[a],r,n);return s.join("")}function w2(e){return!!(e&&typeof e=="object")}const cv=document.createElement("i");function ao(e){const r="&"+e+";";cv.innerHTML=r;const n=cv.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===r?!1:n}function Dn(e,r,n,s){const a=e.length;let u=0,d;if(r<0?r=-r>a?0:a+r:r=r>a?a:r,n=n>0?n:0,s.length<1e4)d=Array.from(s),d.unshift(r,n),e.splice(...d);else for(n&&e.splice(r,n);u<s.length;)d=s.slice(u,u+1e4),d.unshift(r,0),e.splice(...d),u+=1e4,r+=1e4}function qn(e,r){return e.length>0?(Dn(e,e.length,0,r),e):r}const uv={}.hasOwnProperty;function Bx(e){const r={};let n=-1;for(;++n<e.length;)A2(r,e[n]);return r}function A2(e,r){let n;for(n in r){const a=(uv.call(e,n)?e[n]:void 0)||(e[n]={}),u=r[n];let d;if(u)for(d in u){uv.call(a,d)||(a[d]=[]);const o=u[d];C2(a[d],Array.isArray(o)?o:o?[o]:[])}}}function C2(e,r){let n=-1;const s=[];for(;++n<r.length;)(r[n].add==="after"?e:s).push(r[n]);Dn(e,0,0,s)}function Ix(e,r){const n=Number.parseInt(e,r);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Zn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const dn=hi(/[A-Za-z]/),ln=hi(/[\dA-Za-z]/),E2=hi(/[#-'*+\--9=?A-Z^-~]/);function fc(e){return e!==null&&(e<32||e===127)}const Zh=hi(/\d/),k2=hi(/[\dA-Fa-f]/),N2=hi(/[!-/:-@[-`{-~]/);function Fe(e){return e!==null&&e<-2}function wt(e){return e!==null&&(e<0||e===32)}function et(e){return e===-2||e===-1||e===32}const Sc=hi(new RegExp("\\p{P}|\\p{S}","u")),Pi=hi(/\s/);function hi(e){return r;function r(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Gs(e){const r=[];let n=-1,s=0,a=0;for(;++n<e.length;){const u=e.charCodeAt(n);let d="";if(u===37&&ln(e.charCodeAt(n+1))&&ln(e.charCodeAt(n+2)))a=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(d=String.fromCharCode(u));else if(u>55295&&u<57344){const o=e.charCodeAt(n+1);u<56320&&o>56319&&o<57344?(d=String.fromCharCode(u,o),a=1):d="�"}else d=String.fromCharCode(u);d&&(r.push(e.slice(s,n),encodeURIComponent(d)),s=n+a+1,d=""),a&&(n+=a,a=0)}return r.join("")+e.slice(s)}function it(e,r,n,s){const a=s?s-1:Number.POSITIVE_INFINITY;let u=0;return d;function d(c){return et(c)?(e.enter(n),o(c)):r(c)}function o(c){return et(c)&&u++<a?(e.consume(c),o):(e.exit(n),r(c))}}const T2={tokenize:R2};function R2(e){const r=e.attempt(this.parser.constructs.contentInitial,s,a);let n;return r;function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),it(e,r,"linePrefix")}function a(o){return e.enter("paragraph"),u(o)}function u(o){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,d(o)}function d(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Fe(o)?(e.consume(o),e.exit("chunkText"),u):(e.consume(o),d)}}const j2={tokenize:D2},dv={tokenize:B2};function D2(e){const r=this,n=[];let s=0,a,u,d;return o;function o(x){if(s<n.length){const E=n[s];return r.containerState=E[1],e.attempt(E[0].continuation,c,h)(x)}return h(x)}function c(x){if(s++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,a&&_();const E=r.events.length;let N=E,T;for(;N--;)if(r.events[N][0]==="exit"&&r.events[N][1].type==="chunkFlow"){T=r.events[N][1].end;break}S(s);let j=E;for(;j<r.events.length;)r.events[j][1].end={...T},j++;return Dn(r.events,N+1,0,r.events.slice(E)),r.events.length=j,h(x)}return o(x)}function h(x){if(s===n.length){if(!a)return v(x);if(a.currentConstruct&&a.currentConstruct.concrete)return A(x);r.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return r.containerState={},e.check(dv,m,f)(x)}function m(x){return a&&_(),S(s),v(x)}function f(x){return r.parser.lazy[r.now().line]=s!==n.length,d=r.now().offset,A(x)}function v(x){return r.containerState={},e.attempt(dv,w,A)(x)}function w(x){return s++,n.push([r.currentConstruct,r.containerState]),v(x)}function A(x){if(x===null){a&&_(),S(0),e.consume(x);return}return a=a||r.parser.flow(r.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:u}),b(x)}function b(x){if(x===null){y(e.exit("chunkFlow"),!0),S(0),e.consume(x);return}return Fe(x)?(e.consume(x),y(e.exit("chunkFlow")),s=0,r.interrupt=void 0,o):(e.consume(x),b)}function y(x,E){const N=r.sliceStream(x);if(E&&N.push(null),x.previous=u,u&&(u.next=x),u=x,a.defineSkip(x.start),a.write(N),r.parser.lazy[x.start.line]){let T=a.events.length;for(;T--;)if(a.events[T][1].start.offset<d&&(!a.events[T][1].end||a.events[T][1].end.offset>d))return;const j=r.events.length;let R=j,D,L;for(;R--;)if(r.events[R][0]==="exit"&&r.events[R][1].type==="chunkFlow"){if(D){L=r.events[R][1].end;break}D=!0}for(S(s),T=j;T<r.events.length;)r.events[T][1].end={...L},T++;Dn(r.events,R+1,0,r.events.slice(j)),r.events.length=T}}function S(x){let E=n.length;for(;E-- >x;){const N=n[E];r.containerState=N[1],N[0].exit.call(r,e)}n.length=x}function _(){a.write([null]),u=void 0,a=void 0,r.containerState._closeFlow=void 0}}function B2(e,r,n){return it(e,e.attempt(this.parser.constructs.document,r,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Us(e){if(e===null||wt(e)||Pi(e))return 1;if(Sc(e))return 2}function wc(e,r,n){const s=[];let a=-1;for(;++a<e.length;){const u=e[a].resolveAll;u&&!s.includes(u)&&(r=u(r,n),s.push(u))}return r}const Jh={name:"attention",resolveAll:I2,tokenize:L2};function I2(e,r){let n=-1,s,a,u,d,o,c,h,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(s=n;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&r.sliceSerialize(e[s][1]).charCodeAt(0)===r.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[s][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[s][1].end.offset-e[s][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[s][1].end},v={...e[n][1].start};hv(f,-c),hv(v,c),d={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[s][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},u={type:c>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[n][1].start}},a={type:c>1?"strong":"emphasis",start:{...d.start},end:{...o.end}},e[s][1].end={...d.start},e[n][1].start={...o.end},h=[],e[s][1].end.offset-e[s][1].start.offset&&(h=qn(h,[["enter",e[s][1],r],["exit",e[s][1],r]])),h=qn(h,[["enter",a,r],["enter",d,r],["exit",d,r],["enter",u,r]]),h=qn(h,wc(r.parser.constructs.insideSpan.null,e.slice(s+1,n),r)),h=qn(h,[["exit",u,r],["enter",o,r],["exit",o,r],["exit",a,r]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,h=qn(h,[["enter",e[n][1],r],["exit",e[n][1],r]])):m=0,Dn(e,s-1,n-s+3,h),n=s+h.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function L2(e,r){const n=this.parser.constructs.attentionMarkers.null,s=this.previous,a=Us(s);let u;return d;function d(c){return u=c,e.enter("attentionSequence"),o(c)}function o(c){if(c===u)return e.consume(c),o;const h=e.exit("attentionSequence"),m=Us(c),f=!m||m===2&&a||n.includes(c),v=!a||a===2&&m||n.includes(s);return h._open=!!(u===42?f:f&&(a||!v)),h._close=!!(u===42?v:v&&(m||!f)),r(c)}}function hv(e,r){e.column+=r,e.offset+=r,e._bufferIndex+=r}const M2={name:"autolink",tokenize:O2};function O2(e,r,n){let s=0;return a;function a(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(w){return dn(w)?(e.consume(w),d):w===64?n(w):h(w)}function d(w){return w===43||w===45||w===46||ln(w)?(s=1,o(w)):h(w)}function o(w){return w===58?(e.consume(w),s=0,c):(w===43||w===45||w===46||ln(w))&&s++<32?(e.consume(w),o):(s=0,h(w))}function c(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),r):w===null||w===32||w===60||fc(w)?n(w):(e.consume(w),c)}function h(w){return w===64?(e.consume(w),m):E2(w)?(e.consume(w),h):n(w)}function m(w){return ln(w)?f(w):n(w)}function f(w){return w===46?(e.consume(w),s=0,m):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),r):v(w)}function v(w){if((w===45||ln(w))&&s++<63){const A=w===45?v:f;return e.consume(w),A}return n(w)}}const yo={partial:!0,tokenize:z2};function z2(e,r,n){return s;function s(u){return et(u)?it(e,a,"linePrefix")(u):a(u)}function a(u){return u===null||Fe(u)?r(u):n(u)}}const Lx={continuation:{tokenize:P2},exit:H2,name:"blockQuote",tokenize:F2};function F2(e,r,n){const s=this;return a;function a(d){if(d===62){const o=s.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),u}return n(d)}function u(d){return et(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),r):(e.exit("blockQuotePrefix"),r(d))}}function P2(e,r,n){const s=this;return a;function a(d){return et(d)?it(e,u,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):u(d)}function u(d){return e.attempt(Lx,r,n)(d)}}function H2(e){e.exit("blockQuote")}const Mx={name:"characterEscape",tokenize:U2};function U2(e,r,n){return s;function s(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),a}function a(u){return N2(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),r):n(u)}}const Ox={name:"characterReference",tokenize:$2};function $2(e,r,n){const s=this;let a=0,u,d;return o;function o(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),c}function c(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),u=31,d=ln,m(f))}function h(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,d=k2,m):(e.enter("characterReferenceValue"),u=7,d=Zh,m(f))}function m(f){if(f===59&&a){const v=e.exit("characterReferenceValue");return d===ln&&!ao(s.sliceSerialize(v))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),r)}return d(f)&&a++<u?(e.consume(f),m):n(f)}}const fv={partial:!0,tokenize:Q2},pv={concrete:!0,name:"codeFenced",tokenize:q2};function q2(e,r,n){const s=this,a={partial:!0,tokenize:N};let u=0,d=0,o;return c;function c(T){return h(T)}function h(T){const j=s.events[s.events.length-1];return u=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,o=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(T)}function m(T){return T===o?(d++,e.consume(T),m):d<3?n(T):(e.exit("codeFencedFenceSequence"),et(T)?it(e,f,"whitespace")(T):f(T))}function f(T){return T===null||Fe(T)?(e.exit("codeFencedFence"),s.interrupt?r(T):e.check(fv,b,E)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(T))}function v(T){return T===null||Fe(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(T)):et(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),it(e,w,"whitespace")(T)):T===96&&T===o?n(T):(e.consume(T),v)}function w(T){return T===null||Fe(T)?f(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),A(T))}function A(T){return T===null||Fe(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(T)):T===96&&T===o?n(T):(e.consume(T),A)}function b(T){return e.attempt(a,E,y)(T)}function y(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),S}function S(T){return u>0&&et(T)?it(e,_,"linePrefix",u+1)(T):_(T)}function _(T){return T===null||Fe(T)?e.check(fv,b,E)(T):(e.enter("codeFlowValue"),x(T))}function x(T){return T===null||Fe(T)?(e.exit("codeFlowValue"),_(T)):(e.consume(T),x)}function E(T){return e.exit("codeFenced"),r(T)}function N(T,j,R){let D=0;return L;function L(K){return T.enter("lineEnding"),T.consume(K),T.exit("lineEnding"),z}function z(K){return T.enter("codeFencedFence"),et(K)?it(T,U,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):U(K)}function U(K){return K===o?(T.enter("codeFencedFenceSequence"),P(K)):R(K)}function P(K){return K===o?(D++,T.consume(K),P):D>=d?(T.exit("codeFencedFenceSequence"),et(K)?it(T,G,"whitespace")(K):G(K)):R(K)}function G(K){return K===null||Fe(K)?(T.exit("codeFencedFence"),j(K)):R(K)}}}function Q2(e,r,n){const s=this;return a;function a(d){return d===null?n(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u)}function u(d){return s.parser.lazy[s.now().line]?n(d):r(d)}}const fh={name:"codeIndented",tokenize:W2},G2={partial:!0,tokenize:K2};function W2(e,r,n){const s=this;return a;function a(h){return e.enter("codeIndented"),it(e,u,"linePrefix",5)(h)}function u(h){const m=s.events[s.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?d(h):n(h)}function d(h){return h===null?c(h):Fe(h)?e.attempt(G2,d,c)(h):(e.enter("codeFlowValue"),o(h))}function o(h){return h===null||Fe(h)?(e.exit("codeFlowValue"),d(h)):(e.consume(h),o)}function c(h){return e.exit("codeIndented"),r(h)}}function K2(e,r,n){const s=this;return a;function a(d){return s.parser.lazy[s.now().line]?n(d):Fe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),a):it(e,u,"linePrefix",5)(d)}function u(d){const o=s.events[s.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(d):Fe(d)?a(d):n(d)}}const V2={name:"codeText",previous:Y2,resolve:X2,tokenize:Z2};function X2(e){let r=e.length-4,n=3,s,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[r][1].type==="lineEnding"||e[r][1].type==="space")){for(s=n;++s<r;)if(e[s][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[r][1].type="codeTextPadding",n+=2,r-=2;break}}for(s=n-1,r++;++s<=r;)a===void 0?s!==r&&e[s][1].type!=="lineEnding"&&(a=s):(s===r||e[s][1].type==="lineEnding")&&(e[a][1].type="codeTextData",s!==a+2&&(e[a][1].end=e[s-1][1].end,e.splice(a+2,s-a-2),r-=s-a-2,s=a+2),a=void 0);return e}function Y2(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Z2(e,r,n){let s=0,a,u;return d;function d(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),s++,o):(e.exit("codeTextSequence"),c(f))}function c(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),c):f===96?(u=e.enter("codeTextSequence"),a=0,m(f)):Fe(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),h(f))}function h(f){return f===null||f===32||f===96||Fe(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),h)}function m(f){return f===96?(e.consume(f),a++,m):a===s?(e.exit("codeTextSequence"),e.exit("codeText"),r(f)):(u.type="codeTextData",h(f))}}class J2{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,n){const s=n??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(r,s):r>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(r,n,s){const a=n||0;this.setCursor(Math.trunc(r));const u=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return s&&qa(this.left,s),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),qa(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),qa(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r<this.left.length){const n=this.left.splice(r,Number.POSITIVE_INFINITY);qa(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);qa(this.left,n.reverse())}}}function qa(e,r){let n=0;if(r.length<1e4)e.push(...r);else for(;n<r.length;)e.push(...r.slice(n,n+1e4)),n+=1e4}function zx(e){const r={};let n=-1,s,a,u,d,o,c,h;const m=new J2(e);for(;++n<m.length;){for(;n in r;)n=r[n];if(s=m.get(n),n&&s[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(c=s[1]._tokenizer.events,u=0,u<c.length&&c[u][1].type==="lineEndingBlank"&&(u+=2),u<c.length&&c[u][1].type==="content"))for(;++u<c.length&&c[u][1].type!=="content";)c[u][1].type==="chunkText"&&(c[u][1]._isInFirstContentOfListItem=!0,u++);if(s[0]==="enter")s[1].contentType&&(Object.assign(r,eN(m,n)),n=r[n],h=!0);else if(s[1]._container){for(u=n,a=void 0;u--;)if(d=m.get(u),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(a&&(m.get(a)[1].type="lineEndingBlank"),d[1].type="lineEnding",a=u);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;a&&(s[1].end={...m.get(a)[1].start},o=m.slice(a,n),o.unshift(s),m.splice(a,n-a+1,o))}}return Dn(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function eN(e,r){const n=e.get(r)[1],s=e.get(r)[2];let a=r-1;const u=[];let d=n._tokenizer;d||(d=s.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const o=d.events,c=[],h={};let m,f,v=-1,w=n,A=0,b=0;const y=[b];for(;w;){for(;e.get(++a)[1]!==w;);u.push(a),w._tokenizer||(m=s.sliceStream(w),w.next||m.push(null),f&&d.defineSkip(w.start),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(m),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),f=w,w=w.next}for(w=n;++v<o.length;)o[v][0]==="exit"&&o[v-1][0]==="enter"&&o[v][1].type===o[v-1][1].type&&o[v][1].start.line!==o[v][1].end.line&&(b=v+1,y.push(b),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(d.events=[],w?(w._tokenizer=void 0,w.previous=void 0):y.pop(),v=y.length;v--;){const S=o.slice(y[v],y[v+1]),_=u.pop();c.push([_,_+S.length-1]),e.splice(_,2,S)}for(c.reverse(),v=-1;++v<c.length;)h[A+c[v][0]]=A+c[v][1],A+=c[v][1]-c[v][0]-1;return h}const tN={resolve:rN,tokenize:iN},nN={partial:!0,tokenize:sN};function rN(e){return zx(e),e}function iN(e,r){let n;return s;function s(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(o)}function a(o){return o===null?u(o):Fe(o)?e.check(nN,d,u)(o):(e.consume(o),a)}function u(o){return e.exit("chunkContent"),e.exit("content"),r(o)}function d(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function sN(e,r,n){const s=this;return a;function a(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),it(e,u,"linePrefix")}function u(d){if(d===null||Fe(d))return n(d);const o=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(d):e.interrupt(s.parser.constructs.flow,n,r)(d)}}function Fx(e,r,n,s,a,u,d,o,c){const h=c||Number.POSITIVE_INFINITY;let m=0;return f;function f(S){return S===60?(e.enter(s),e.enter(a),e.enter(u),e.consume(S),e.exit(u),v):S===null||S===32||S===41||fc(S)?n(S):(e.enter(s),e.enter(d),e.enter(o),e.enter("chunkString",{contentType:"string"}),b(S))}function v(S){return S===62?(e.enter(u),e.consume(S),e.exit(u),e.exit(a),e.exit(s),r):(e.enter(o),e.enter("chunkString",{contentType:"string"}),w(S))}function w(S){return S===62?(e.exit("chunkString"),e.exit(o),v(S)):S===null||S===60||Fe(S)?n(S):(e.consume(S),S===92?A:w)}function A(S){return S===60||S===62||S===92?(e.consume(S),w):w(S)}function b(S){return!m&&(S===null||S===41||wt(S))?(e.exit("chunkString"),e.exit(o),e.exit(d),e.exit(s),r(S)):m<h&&S===40?(e.consume(S),m++,b):S===41?(e.consume(S),m--,b):S===null||S===32||S===40||fc(S)?n(S):(e.consume(S),S===92?y:b)}function y(S){return S===40||S===41||S===92?(e.consume(S),b):b(S)}}function Px(e,r,n,s,a,u){const d=this;let o=0,c;return h;function h(w){return e.enter(s),e.enter(a),e.consume(w),e.exit(a),e.enter(u),m}function m(w){return o>999||w===null||w===91||w===93&&!c||w===94&&!o&&"_hiddenFootnoteSupport"in d.parser.constructs?n(w):w===93?(e.exit(u),e.enter(a),e.consume(w),e.exit(a),e.exit(s),r):Fe(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),f(w))}function f(w){return w===null||w===91||w===93||Fe(w)||o++>999?(e.exit("chunkString"),m(w)):(e.consume(w),c||(c=!et(w)),w===92?v:f)}function v(w){return w===91||w===92||w===93?(e.consume(w),o++,f):f(w)}}function Hx(e,r,n,s,a,u){let d;return o;function o(v){return v===34||v===39||v===40?(e.enter(s),e.enter(a),e.consume(v),e.exit(a),d=v===40?41:v,c):n(v)}function c(v){return v===d?(e.enter(a),e.consume(v),e.exit(a),e.exit(s),r):(e.enter(u),h(v))}function h(v){return v===d?(e.exit(u),c(d)):v===null?n(v):Fe(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),it(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===d||v===null||Fe(v)?(e.exit("chunkString"),h(v)):(e.consume(v),v===92?f:m)}function f(v){return v===d||v===92?(e.consume(v),m):m(v)}}function Ja(e,r){let n;return s;function s(a){return Fe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,s):et(a)?it(e,s,n?"linePrefix":"lineSuffix")(a):r(a)}}const aN={name:"definition",tokenize:lN},oN={partial:!0,tokenize:cN};function lN(e,r,n){const s=this;let a;return u;function u(w){return e.enter("definition"),d(w)}function d(w){return Px.call(s,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function o(w){return a=Zn(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),c):n(w)}function c(w){return wt(w)?Ja(e,h)(w):h(w)}function h(w){return Fx(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function m(w){return e.attempt(oN,f,f)(w)}function f(w){return et(w)?it(e,v,"whitespace")(w):v(w)}function v(w){return w===null||Fe(w)?(e.exit("definition"),s.parser.defined.push(a),r(w)):n(w)}}function cN(e,r,n){return s;function s(o){return wt(o)?Ja(e,a)(o):n(o)}function a(o){return Hx(e,u,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function u(o){return et(o)?it(e,d,"whitespace")(o):d(o)}function d(o){return o===null||Fe(o)?r(o):n(o)}}const uN={name:"hardBreakEscape",tokenize:dN};function dN(e,r,n){return s;function s(u){return e.enter("hardBreakEscape"),e.consume(u),a}function a(u){return Fe(u)?(e.exit("hardBreakEscape"),r(u)):n(u)}}const hN={name:"headingAtx",resolve:fN,tokenize:pN};function fN(e,r){let n=e.length-2,s=3,a,u;return e[s][1].type==="whitespace"&&(s+=2),n-2>s&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(s===n-1||n-4>s&&e[n-2][1].type==="whitespace")&&(n-=s+1===n?2:4),n>s&&(a={type:"atxHeadingText",start:e[s][1].start,end:e[n][1].end},u={type:"chunkText",start:e[s][1].start,end:e[n][1].end,contentType:"text"},Dn(e,s,n-s+1,[["enter",a,r],["enter",u,r],["exit",u,r],["exit",a,r]])),e}function pN(e,r,n){let s=0;return a;function a(m){return e.enter("atxHeading"),u(m)}function u(m){return e.enter("atxHeadingSequence"),d(m)}function d(m){return m===35&&s++<6?(e.consume(m),d):m===null||wt(m)?(e.exit("atxHeadingSequence"),o(m)):n(m)}function o(m){return m===35?(e.enter("atxHeadingSequence"),c(m)):m===null||Fe(m)?(e.exit("atxHeading"),r(m)):et(m)?it(e,o,"whitespace")(m):(e.enter("atxHeadingText"),h(m))}function c(m){return m===35?(e.consume(m),c):(e.exit("atxHeadingSequence"),o(m))}function h(m){return m===null||m===35||wt(m)?(e.exit("atxHeadingText"),o(m)):(e.consume(m),h)}}const gN=["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"],gv=["pre","script","style","textarea"],mN={concrete:!0,name:"htmlFlow",resolveTo:bN,tokenize:xN},yN={partial:!0,tokenize:SN},vN={partial:!0,tokenize:_N};function bN(e){let r=e.length;for(;r--&&!(e[r][0]==="enter"&&e[r][1].type==="htmlFlow"););return r>1&&e[r-2][1].type==="linePrefix"&&(e[r][1].start=e[r-2][1].start,e[r+1][1].start=e[r-2][1].start,e.splice(r-2,2)),e}function xN(e,r,n){const s=this;let a,u,d,o,c;return h;function h(M){return m(M)}function m(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),f}function f(M){return M===33?(e.consume(M),v):M===47?(e.consume(M),u=!0,b):M===63?(e.consume(M),a=3,s.interrupt?r:B):dn(M)?(e.consume(M),d=String.fromCharCode(M),y):n(M)}function v(M){return M===45?(e.consume(M),a=2,w):M===91?(e.consume(M),a=5,o=0,A):dn(M)?(e.consume(M),a=4,s.interrupt?r:B):n(M)}function w(M){return M===45?(e.consume(M),s.interrupt?r:B):n(M)}function A(M){const J="CDATA[";return M===J.charCodeAt(o++)?(e.consume(M),o===J.length?s.interrupt?r:U:A):n(M)}function b(M){return dn(M)?(e.consume(M),d=String.fromCharCode(M),y):n(M)}function y(M){if(M===null||M===47||M===62||wt(M)){const J=M===47,de=d.toLowerCase();return!J&&!u&&gv.includes(de)?(a=1,s.interrupt?r(M):U(M)):gN.includes(d.toLowerCase())?(a=6,J?(e.consume(M),S):s.interrupt?r(M):U(M)):(a=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(M):u?_(M):x(M))}return M===45||ln(M)?(e.consume(M),d+=String.fromCharCode(M),y):n(M)}function S(M){return M===62?(e.consume(M),s.interrupt?r:U):n(M)}function _(M){return et(M)?(e.consume(M),_):L(M)}function x(M){return M===47?(e.consume(M),L):M===58||M===95||dn(M)?(e.consume(M),E):et(M)?(e.consume(M),x):L(M)}function E(M){return M===45||M===46||M===58||M===95||ln(M)?(e.consume(M),E):N(M)}function N(M){return M===61?(e.consume(M),T):et(M)?(e.consume(M),N):x(M)}function T(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),c=M,j):et(M)?(e.consume(M),T):R(M)}function j(M){return M===c?(e.consume(M),c=null,D):M===null||Fe(M)?n(M):(e.consume(M),j)}function R(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||wt(M)?N(M):(e.consume(M),R)}function D(M){return M===47||M===62||et(M)?x(M):n(M)}function L(M){return M===62?(e.consume(M),z):n(M)}function z(M){return M===null||Fe(M)?U(M):et(M)?(e.consume(M),z):n(M)}function U(M){return M===45&&a===2?(e.consume(M),W):M===60&&a===1?(e.consume(M),Y):M===62&&a===4?(e.consume(M),O):M===63&&a===3?(e.consume(M),B):M===93&&a===5?(e.consume(M),F):Fe(M)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(yN,Q,P)(M)):M===null||Fe(M)?(e.exit("htmlFlowData"),P(M)):(e.consume(M),U)}function P(M){return e.check(vN,G,Q)(M)}function G(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),K}function K(M){return M===null||Fe(M)?P(M):(e.enter("htmlFlowData"),U(M))}function W(M){return M===45?(e.consume(M),B):U(M)}function Y(M){return M===47?(e.consume(M),d="",ne):U(M)}function ne(M){if(M===62){const J=d.toLowerCase();return gv.includes(J)?(e.consume(M),O):U(M)}return dn(M)&&d.length<8?(e.consume(M),d+=String.fromCharCode(M),ne):U(M)}function F(M){return M===93?(e.consume(M),B):U(M)}function B(M){return M===62?(e.consume(M),O):M===45&&a===2?(e.consume(M),B):U(M)}function O(M){return M===null||Fe(M)?(e.exit("htmlFlowData"),Q(M)):(e.consume(M),O)}function Q(M){return e.exit("htmlFlow"),r(M)}}function _N(e,r,n){const s=this;return a;function a(d){return Fe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):n(d)}function u(d){return s.parser.lazy[s.now().line]?n(d):r(d)}}function SN(e,r,n){return s;function s(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(yo,r,n)}}const wN={name:"htmlText",tokenize:AN};function AN(e,r,n){const s=this;let a,u,d;return o;function o(B){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(B),c}function c(B){return B===33?(e.consume(B),h):B===47?(e.consume(B),N):B===63?(e.consume(B),x):dn(B)?(e.consume(B),R):n(B)}function h(B){return B===45?(e.consume(B),m):B===91?(e.consume(B),u=0,A):dn(B)?(e.consume(B),_):n(B)}function m(B){return B===45?(e.consume(B),w):n(B)}function f(B){return B===null?n(B):B===45?(e.consume(B),v):Fe(B)?(d=f,Y(B)):(e.consume(B),f)}function v(B){return B===45?(e.consume(B),w):f(B)}function w(B){return B===62?W(B):B===45?v(B):f(B)}function A(B){const O="CDATA[";return B===O.charCodeAt(u++)?(e.consume(B),u===O.length?b:A):n(B)}function b(B){return B===null?n(B):B===93?(e.consume(B),y):Fe(B)?(d=b,Y(B)):(e.consume(B),b)}function y(B){return B===93?(e.consume(B),S):b(B)}function S(B){return B===62?W(B):B===93?(e.consume(B),S):b(B)}function _(B){return B===null||B===62?W(B):Fe(B)?(d=_,Y(B)):(e.consume(B),_)}function x(B){return B===null?n(B):B===63?(e.consume(B),E):Fe(B)?(d=x,Y(B)):(e.consume(B),x)}function E(B){return B===62?W(B):x(B)}function N(B){return dn(B)?(e.consume(B),T):n(B)}function T(B){return B===45||ln(B)?(e.consume(B),T):j(B)}function j(B){return Fe(B)?(d=j,Y(B)):et(B)?(e.consume(B),j):W(B)}function R(B){return B===45||ln(B)?(e.consume(B),R):B===47||B===62||wt(B)?D(B):n(B)}function D(B){return B===47?(e.consume(B),W):B===58||B===95||dn(B)?(e.consume(B),L):Fe(B)?(d=D,Y(B)):et(B)?(e.consume(B),D):W(B)}function L(B){return B===45||B===46||B===58||B===95||ln(B)?(e.consume(B),L):z(B)}function z(B){return B===61?(e.consume(B),U):Fe(B)?(d=z,Y(B)):et(B)?(e.consume(B),z):D(B)}function U(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(e.consume(B),a=B,P):Fe(B)?(d=U,Y(B)):et(B)?(e.consume(B),U):(e.consume(B),G)}function P(B){return B===a?(e.consume(B),a=void 0,K):B===null?n(B):Fe(B)?(d=P,Y(B)):(e.consume(B),P)}function G(B){return B===null||B===34||B===39||B===60||B===61||B===96?n(B):B===47||B===62||wt(B)?D(B):(e.consume(B),G)}function K(B){return B===47||B===62||wt(B)?D(B):n(B)}function W(B){return B===62?(e.consume(B),e.exit("htmlTextData"),e.exit("htmlText"),r):n(B)}function Y(B){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),ne}function ne(B){return et(B)?it(e,F,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):F(B)}function F(B){return e.enter("htmlTextData"),d(B)}}const Ff={name:"labelEnd",resolveAll:NN,resolveTo:TN,tokenize:RN},CN={tokenize:jN},EN={tokenize:DN},kN={tokenize:BN};function NN(e){let r=-1;const n=[];for(;++r<e.length;){const s=e[r][1];if(n.push(e[r]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const a=s.type==="labelImage"?4:2;s.type="data",r+=a}}return e.length!==n.length&&Dn(e,0,e.length,n),e}function TN(e,r){let n=e.length,s=0,a,u,d,o;for(;n--;)if(a=e[n][1],u){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(d){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(u=n,a.type!=="labelLink")){s=2;break}}else a.type==="labelEnd"&&(d=n);const c={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[u][1].start},end:{...e[d][1].end}},m={type:"labelText",start:{...e[u+s+2][1].end},end:{...e[d-2][1].start}};return o=[["enter",c,r],["enter",h,r]],o=qn(o,e.slice(u+1,u+s+3)),o=qn(o,[["enter",m,r]]),o=qn(o,wc(r.parser.constructs.insideSpan.null,e.slice(u+s+4,d-3),r)),o=qn(o,[["exit",m,r],e[d-2],e[d-1],["exit",h,r]]),o=qn(o,e.slice(d+1)),o=qn(o,[["exit",c,r]]),Dn(e,u,e.length,o),e}function RN(e,r,n){const s=this;let a=s.events.length,u,d;for(;a--;)if((s.events[a][1].type==="labelImage"||s.events[a][1].type==="labelLink")&&!s.events[a][1]._balanced){u=s.events[a][1];break}return o;function o(v){return u?u._inactive?f(v):(d=s.parser.defined.includes(Zn(s.sliceSerialize({start:u.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),c):n(v)}function c(v){return v===40?e.attempt(CN,m,d?m:f)(v):v===91?e.attempt(EN,m,d?h:f)(v):d?m(v):f(v)}function h(v){return e.attempt(kN,m,f)(v)}function m(v){return r(v)}function f(v){return u._balanced=!0,n(v)}}function jN(e,r,n){return s;function s(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),a}function a(f){return wt(f)?Ja(e,u)(f):u(f)}function u(f){return f===41?m(f):Fx(e,d,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function d(f){return wt(f)?Ja(e,c)(f):m(f)}function o(f){return n(f)}function c(f){return f===34||f===39||f===40?Hx(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):m(f)}function h(f){return wt(f)?Ja(e,m)(f):m(f)}function m(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),r):n(f)}}function DN(e,r,n){const s=this;return a;function a(o){return Px.call(s,e,u,d,"reference","referenceMarker","referenceString")(o)}function u(o){return s.parser.defined.includes(Zn(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?r(o):n(o)}function d(o){return n(o)}}function BN(e,r,n){return s;function s(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),a}function a(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),r):n(u)}}const IN={name:"labelStartImage",resolveAll:Ff.resolveAll,tokenize:LN};function LN(e,r,n){const s=this;return a;function a(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),u}function u(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),d):n(o)}function d(o){return o===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(o):r(o)}}const MN={name:"labelStartLink",resolveAll:Ff.resolveAll,tokenize:ON};function ON(e,r,n){const s=this;return a;function a(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),u}function u(d){return d===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):r(d)}}const ph={name:"lineEnding",tokenize:zN};function zN(e,r){return n;function n(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),it(e,r,"linePrefix")}}const sc={name:"thematicBreak",tokenize:FN};function FN(e,r,n){let s=0,a;return u;function u(h){return e.enter("thematicBreak"),d(h)}function d(h){return a=h,o(h)}function o(h){return h===a?(e.enter("thematicBreakSequence"),c(h)):s>=3&&(h===null||Fe(h))?(e.exit("thematicBreak"),r(h)):n(h)}function c(h){return h===a?(e.consume(h),s++,c):(e.exit("thematicBreakSequence"),et(h)?it(e,o,"whitespace")(h):o(h))}}const bn={continuation:{tokenize:$N},exit:QN,name:"list",tokenize:UN},PN={partial:!0,tokenize:GN},HN={partial:!0,tokenize:qN};function UN(e,r,n){const s=this,a=s.events[s.events.length-1];let u=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,d=0;return o;function o(w){const A=s.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(A==="listUnordered"?!s.containerState.marker||w===s.containerState.marker:Zh(w)){if(s.containerState.type||(s.containerState.type=A,e.enter(A,{_container:!0})),A==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(sc,n,h)(w):h(w);if(!s.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(w)}return n(w)}function c(w){return Zh(w)&&++d<10?(e.consume(w),c):(!s.interrupt||d<2)&&(s.containerState.marker?w===s.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),h(w)):n(w)}function h(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||w,e.check(yo,s.interrupt?n:m,e.attempt(PN,v,f))}function m(w){return s.containerState.initialBlankLine=!0,u++,v(w)}function f(w){return et(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),v):n(w)}function v(w){return s.containerState.size=u+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,r(w)}}function $N(e,r,n){const s=this;return s.containerState._closeFlow=void 0,e.check(yo,a,u);function a(o){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,it(e,r,"listItemIndent",s.containerState.size+1)(o)}function u(o){return s.containerState.furtherBlankLines||!et(o)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,d(o)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(HN,r,d)(o))}function d(o){return s.containerState._closeFlow=!0,s.interrupt=void 0,it(e,e.attempt(bn,r,n),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function qN(e,r,n){const s=this;return it(e,a,"listItemIndent",s.containerState.size+1);function a(u){const d=s.events[s.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===s.containerState.size?r(u):n(u)}}function QN(e){e.exit(this.containerState.type)}function GN(e,r,n){const s=this;return it(e,a,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(u){const d=s.events[s.events.length-1];return!et(u)&&d&&d[1].type==="listItemPrefixWhitespace"?r(u):n(u)}}const mv={name:"setextUnderline",resolveTo:WN,tokenize:KN};function WN(e,r){let n=e.length,s,a,u;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){s=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!u&&e[n][1].type==="definition"&&(u=n);const d={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",u?(e.splice(a,0,["enter",d,r]),e.splice(u+1,0,["exit",e[s][1],r]),e[s][1].end={...e[u][1].end}):e[s][1]=d,e.push(["exit",d,r]),e}function KN(e,r,n){const s=this;let a;return u;function u(h){let m=s.events.length,f;for(;m--;)if(s.events[m][1].type!=="lineEnding"&&s.events[m][1].type!=="linePrefix"&&s.events[m][1].type!=="content"){f=s.events[m][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||f)?(e.enter("setextHeadingLine"),a=h,d(h)):n(h)}function d(h){return e.enter("setextHeadingLineSequence"),o(h)}function o(h){return h===a?(e.consume(h),o):(e.exit("setextHeadingLineSequence"),et(h)?it(e,c,"lineSuffix")(h):c(h))}function c(h){return h===null||Fe(h)?(e.exit("setextHeadingLine"),r(h)):n(h)}}const VN={tokenize:XN};function XN(e){const r=this,n=e.attempt(yo,s,e.attempt(this.parser.constructs.flowInitial,a,it(e,e.attempt(this.parser.constructs.flow,a,e.attempt(tN,a)),"linePrefix")));return n;function s(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),r.currentConstruct=void 0,n}function a(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),r.currentConstruct=void 0,n}}const YN={resolveAll:$x()},ZN=Ux("string"),JN=Ux("text");function Ux(e){return{resolveAll:$x(e==="text"?e3:void 0),tokenize:r};function r(n){const s=this,a=this.parser.constructs[e],u=n.attempt(a,d,o);return d;function d(m){return h(m)?u(m):o(m)}function o(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),c}function c(m){return h(m)?(n.exit("data"),u(m)):(n.consume(m),c)}function h(m){if(m===null)return!0;const f=a[m];let v=-1;if(f)for(;++v<f.length;){const w=f[v];if(!w.previous||w.previous.call(s,s.previous))return!0}return!1}}}function $x(e){return r;function r(n,s){let a=-1,u;for(;++a<=n.length;)u===void 0?n[a]&&n[a][1].type==="data"&&(u=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==u+2&&(n[u][1].end=n[a-1][1].end,n.splice(u+2,a-u-2),a=u+2),u=void 0);return e?e(n,s):n}}function e3(e,r){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const s=e[n-1][1],a=r.sliceStream(s);let u=a.length,d=-1,o=0,c;for(;u--;){const h=a[u];if(typeof h=="string"){for(d=h.length;h.charCodeAt(d-1)===32;)o++,d--;if(d)break;d=-1}else if(h===-2)c=!0,o++;else if(h!==-1){u++;break}}if(r._contentTypeTextTrailing&&n===e.length&&(o=0),o){const h={type:n===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?d:s.start._bufferIndex+d,_index:s.start._index+u,line:s.end.line,column:s.end.column-o,offset:s.end.offset-o},end:{...s.end}};s.end={...h.start},s.start.offset===s.end.offset?Object.assign(s,h):(e.splice(n,0,["enter",h,r],["exit",h,r]),n+=2)}n++}return e}const t3={42:bn,43:bn,45:bn,48:bn,49:bn,50:bn,51:bn,52:bn,53:bn,54:bn,55:bn,56:bn,57:bn,62:Lx},n3={91:aN},r3={[-2]:fh,[-1]:fh,32:fh},i3={35:hN,42:sc,45:[mv,sc],60:mN,61:mv,95:sc,96:pv,126:pv},s3={38:Ox,92:Mx},a3={[-5]:ph,[-4]:ph,[-3]:ph,33:IN,38:Ox,42:Jh,60:[M2,wN],91:MN,92:[uN,Mx],93:Ff,95:Jh,96:V2},o3={null:[Jh,YN]},l3={null:[42,95]},c3={null:[]},u3=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:l3,contentInitial:n3,disable:c3,document:t3,flow:i3,flowInitial:r3,insideSpan:o3,string:s3,text:a3},Symbol.toStringTag,{value:"Module"}));function d3(e,r,n){let s={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},u=[];let d=[],o=[];const c={attempt:j(N),check:j(T),consume:_,enter:x,exit:E,interrupt:j(T,{interrupt:!0})},h={code:null,containerState:{},defineSkip:b,events:[],now:A,parser:e,previous:null,sliceSerialize:v,sliceStream:w,write:f};let m=r.tokenize.call(h,c);return r.resolveAll&&u.push(r),h;function f(z){return d=qn(d,z),y(),d[d.length-1]!==null?[]:(R(r,0),h.events=wc(u,h.events,h),h.events)}function v(z,U){return f3(w(z),U)}function w(z){return h3(d,z)}function A(){const{_bufferIndex:z,_index:U,line:P,column:G,offset:K}=s;return{_bufferIndex:z,_index:U,line:P,column:G,offset:K}}function b(z){a[z.line]=z.column,L()}function y(){let z;for(;s._index<d.length;){const U=d[s._index];if(typeof U=="string")for(z=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===z&&s._bufferIndex<U.length;)S(U.charCodeAt(s._bufferIndex));else S(U)}}function S(z){m=m(z)}function _(z){Fe(z)?(s.line++,s.column=1,s.offset+=z===-3?2:1,L()):z!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===d[s._index].length&&(s._bufferIndex=-1,s._index++)),h.previous=z}function x(z,U){const P=U||{};return P.type=z,P.start=A(),h.events.push(["enter",P,h]),o.push(P),P}function E(z){const U=o.pop();return U.end=A(),h.events.push(["exit",U,h]),U}function N(z,U){R(z,U.from)}function T(z,U){U.restore()}function j(z,U){return P;function P(G,K,W){let Y,ne,F,B;return Array.isArray(G)?Q(G):"tokenize"in G?Q([G]):O(G);function O(pe){return X;function X($){const se=$!==null&&pe[$],le=$!==null&&pe.null,te=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(le)?le:le?[le]:[]];return Q(te)($)}}function Q(pe){return Y=pe,ne=0,pe.length===0?W:M(pe[ne])}function M(pe){return X;function X($){return B=D(),F=pe,pe.partial||(h.currentConstruct=pe),pe.name&&h.parser.constructs.disable.null.includes(pe.name)?de():pe.tokenize.call(U?Object.assign(Object.create(h),U):h,c,J,de)($)}}function J(pe){return z(F,B),K}function de(pe){return B.restore(),++ne<Y.length?M(Y[ne]):W}}}function R(z,U){z.resolveAll&&!u.includes(z)&&u.push(z),z.resolve&&Dn(h.events,U,h.events.length-U,z.resolve(h.events.slice(U),h)),z.resolveTo&&(h.events=z.resolveTo(h.events,h))}function D(){const z=A(),U=h.previous,P=h.currentConstruct,G=h.events.length,K=Array.from(o);return{from:G,restore:W};function W(){s=z,h.previous=U,h.currentConstruct=P,h.events.length=G,o=K,L()}}function L(){s.line in a&&s.column<2&&(s.column=a[s.line],s.offset+=a[s.line]-1)}}function h3(e,r){const n=r.start._index,s=r.start._bufferIndex,a=r.end._index,u=r.end._bufferIndex;let d;if(n===a)d=[e[n].slice(s,u)];else{if(d=e.slice(n,a),s>-1){const o=d[0];typeof o=="string"?d[0]=o.slice(s):d.shift()}u>0&&d.push(e[a].slice(0,u))}return d}function f3(e,r){let n=-1;const s=[];let a;for(;++n<e.length;){const u=e[n];let d;if(typeof u=="string")d=u;else switch(u){case-5:{d="\r";break}case-4:{d=`
|
|
306
|
+
`;break}case-3:{d=`\r
|
|
307
|
+
`;break}case-2:{d=r?" ":" ";break}case-1:{if(!r&&a)continue;d=" ";break}default:d=String.fromCharCode(u)}a=u===-2,s.push(d)}return s.join("")}function p3(e){const s={constructs:Bx([u3,...(e||{}).extensions||[]]),content:a(T2),defined:[],document:a(j2),flow:a(VN),lazy:{},string:a(ZN),text:a(JN)};return s;function a(u){return d;function d(o){return d3(s,u,o)}}}function g3(e){for(;!zx(e););return e}const yv=/[\0\t\n\r]/g;function m3(){let e=1,r="",n=!0,s;return a;function a(u,d,o){const c=[];let h,m,f,v,w;for(u=r+(typeof u=="string"?u.toString():new TextDecoder(d||void 0).decode(u)),f=0,r="",n&&(u.charCodeAt(0)===65279&&f++,n=void 0);f<u.length;){if(yv.lastIndex=f,h=yv.exec(u),v=h&&h.index!==void 0?h.index:u.length,w=u.charCodeAt(v),!h){r=u.slice(f);break}if(w===10&&f===v&&s)c.push(-3),s=void 0;else switch(s&&(c.push(-5),s=void 0),f<v&&(c.push(u.slice(f,v)),e+=v-f),w){case 0:{c.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,c.push(-2);e++<m;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:s=!0,e=1}f=v+1}return o&&(s&&c.push(-5),r&&c.push(r),c.push(null)),c}}const y3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function v3(e){return e.replace(y3,b3)}function b3(e,r,n){if(r)return r;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),u=a===120||a===88;return Ix(n.slice(u?2:1),u?16:10)}return ao(n)||e}const qx={}.hasOwnProperty;function x3(e,r,n){return r&&typeof r=="object"&&(n=r,r=void 0),_3(n)(g3(p3(n).document().write(m3()(e,r,!0))))}function _3(e){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(gt),autolinkProtocol:D,autolinkEmail:D,atxHeading:u(Me),blockQuote:u(le),characterEscape:D,characterReference:D,codeFenced:u(te),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:u(te,d),codeText:u(ue,d),codeTextData:D,data:D,codeFlowValue:D,definition:u(Ae),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:u(Le),hardBreakEscape:u(Pe),hardBreakTrailing:u(Pe),htmlFlow:u(Be,d),htmlFlowData:D,htmlText:u(Be,d),htmlTextData:D,image:u(jt),label:d,link:u(gt),listItem:u(Kt),listItemValue:v,listOrdered:u(Ce,f),listUnordered:u(Ce),paragraph:u(Mt),reference:M,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:u(Me),strong:u(st),thematicBreak:u(Pt)},exit:{atxHeading:c(),atxHeadingSequence:N,autolink:c(),autolinkEmail:se,autolinkProtocol:$,blockQuote:c(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:pe,characterReference:X,codeFenced:c(y),codeFencedFence:b,codeFencedFenceInfo:w,codeFencedFenceMeta:A,codeFlowValue:L,codeIndented:c(S),codeText:c(K),codeTextData:L,data:L,definition:c(),definitionDestinationString:E,definitionLabelString:_,definitionTitleString:x,emphasis:c(),hardBreakEscape:c(U),hardBreakTrailing:c(U),htmlFlow:c(P),htmlFlowData:L,htmlText:c(G),htmlTextData:L,image:c(Y),label:F,labelText:ne,lineEnding:z,link:c(W),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:J,resourceDestinationString:B,resourceTitleString:O,resource:Q,setextHeading:c(R),setextHeadingLineSequence:j,setextHeadingText:T,strong:c(),thematicBreak:c()}};Qx(r,(e||{}).mdastExtensions||[]);const n={};return s;function s(fe){let _e={type:"root",children:[]};const je={stack:[_e],tokenStack:[],config:r,enter:o,exit:h,buffer:d,resume:m,data:n},Ue=[];let $e=-1;for(;++$e<fe.length;)if(fe[$e][1].type==="listOrdered"||fe[$e][1].type==="listUnordered")if(fe[$e][0]==="enter")Ue.push($e);else{const Tt=Ue.pop();$e=a(fe,Tt,$e)}for($e=-1;++$e<fe.length;){const Tt=r[fe[$e][0]];qx.call(Tt,fe[$e][1].type)&&Tt[fe[$e][1].type].call(Object.assign({sliceSerialize:fe[$e][2].sliceSerialize},je),fe[$e][1])}if(je.tokenStack.length>0){const Tt=je.tokenStack[je.tokenStack.length-1];(Tt[1]||vv).call(je,void 0,Tt[0])}for(_e.position={start:li(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:li(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},$e=-1;++$e<r.transforms.length;)_e=r.transforms[$e](_e)||_e;return _e}function a(fe,_e,je){let Ue=_e-1,$e=-1,Tt=!1,Ye,Ot,Dt,Z;for(;++Ue<=je;){const xe=fe[Ue];switch(xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{xe[0]==="enter"?$e++:$e--,Z=void 0;break}case"lineEndingBlank":{xe[0]==="enter"&&(Ye&&!Z&&!$e&&!Dt&&(Dt=Ue),Z=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Z=void 0}if(!$e&&xe[0]==="enter"&&xe[1].type==="listItemPrefix"||$e===-1&&xe[0]==="exit"&&(xe[1].type==="listUnordered"||xe[1].type==="listOrdered")){if(Ye){let Qe=Ue;for(Ot=void 0;Qe--;){const Ct=fe[Qe];if(Ct[1].type==="lineEnding"||Ct[1].type==="lineEndingBlank"){if(Ct[0]==="exit")continue;Ot&&(fe[Ot][1].type="lineEndingBlank",Tt=!0),Ct[1].type="lineEnding",Ot=Qe}else if(!(Ct[1].type==="linePrefix"||Ct[1].type==="blockQuotePrefix"||Ct[1].type==="blockQuotePrefixWhitespace"||Ct[1].type==="blockQuoteMarker"||Ct[1].type==="listItemIndent"))break}Dt&&(!Ot||Dt<Ot)&&(Ye._spread=!0),Ye.end=Object.assign({},Ot?fe[Ot][1].start:xe[1].end),fe.splice(Ot||Ue,0,["exit",Ye,xe[2]]),Ue++,je++}if(xe[1].type==="listItemPrefix"){const Qe={type:"listItem",_spread:!1,start:Object.assign({},xe[1].start),end:void 0};Ye=Qe,fe.splice(Ue,0,["enter",Qe,xe[2]]),Ue++,je++,Dt=void 0,Z=!0}}}return fe[_e][1]._spread=Tt,je}function u(fe,_e){return je;function je(Ue){o.call(this,fe(Ue),Ue),_e&&_e.call(this,Ue)}}function d(){this.stack.push({type:"fragment",children:[]})}function o(fe,_e,je){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([_e,je||void 0]),fe.position={start:li(_e.start),end:void 0}}function c(fe){return _e;function _e(je){fe&&fe.call(this,je),h.call(this,je)}}function h(fe,_e){const je=this.stack.pop(),Ue=this.tokenStack.pop();if(Ue)Ue[0].type!==fe.type&&(_e?_e.call(this,fe,Ue[0]):(Ue[1]||vv).call(this,fe,Ue[0]));else throw new Error("Cannot close `"+fe.type+"` ("+Za({start:fe.start,end:fe.end})+"): it’s not open");je.position.end=li(fe.end)}function m(){return zf(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function v(fe){if(this.data.expectingFirstListItemValue){const _e=this.stack[this.stack.length-2];_e.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function w(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.lang=fe}function A(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.meta=fe}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe.replace(/(\r?\n|\r)$/g,"")}function _(fe){const _e=this.resume(),je=this.stack[this.stack.length-1];je.label=_e,je.identifier=Zn(this.sliceSerialize(fe)).toLowerCase()}function x(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.title=fe}function E(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.url=fe}function N(fe){const _e=this.stack[this.stack.length-1];if(!_e.depth){const je=this.sliceSerialize(fe).length;_e.depth=je}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function j(fe){const _e=this.stack[this.stack.length-1];_e.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function D(fe){const je=this.stack[this.stack.length-1].children;let Ue=je[je.length-1];(!Ue||Ue.type!=="text")&&(Ue=xt(),Ue.position={start:li(fe.start),end:void 0},je.push(Ue)),this.stack.push(Ue)}function L(fe){const _e=this.stack.pop();_e.value+=this.sliceSerialize(fe),_e.position.end=li(fe.end)}function z(fe){const _e=this.stack[this.stack.length-1];if(this.data.atHardBreak){const je=_e.children[_e.children.length-1];je.position.end=li(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(_e.type)&&(D.call(this,fe),L.call(this,fe))}function U(){this.data.atHardBreak=!0}function P(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe}function G(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe}function K(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe}function W(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const _e=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=_e,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function Y(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const _e=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=_e,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function ne(fe){const _e=this.sliceSerialize(fe),je=this.stack[this.stack.length-2];je.label=v3(_e),je.identifier=Zn(_e).toLowerCase()}function F(){const fe=this.stack[this.stack.length-1],_e=this.resume(),je=this.stack[this.stack.length-1];if(this.data.inReference=!0,je.type==="link"){const Ue=fe.children;je.children=Ue}else je.alt=_e}function B(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.url=fe}function O(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.title=fe}function Q(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function J(fe){const _e=this.resume(),je=this.stack[this.stack.length-1];je.label=_e,je.identifier=Zn(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function de(fe){this.data.characterReferenceType=fe.type}function pe(fe){const _e=this.sliceSerialize(fe),je=this.data.characterReferenceType;let Ue;je?(Ue=Ix(_e,je==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ue=ao(_e);const $e=this.stack[this.stack.length-1];$e.value+=Ue}function X(fe){const _e=this.stack.pop();_e.position.end=li(fe.end)}function $(fe){L.call(this,fe);const _e=this.stack[this.stack.length-1];_e.url=this.sliceSerialize(fe)}function se(fe){L.call(this,fe);const _e=this.stack[this.stack.length-1];_e.url="mailto:"+this.sliceSerialize(fe)}function le(){return{type:"blockquote",children:[]}}function te(){return{type:"code",lang:null,meta:null,value:""}}function ue(){return{type:"inlineCode",value:""}}function Ae(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Le(){return{type:"emphasis",children:[]}}function Me(){return{type:"heading",depth:0,children:[]}}function Pe(){return{type:"break"}}function Be(){return{type:"html",value:""}}function jt(){return{type:"image",title:null,url:"",alt:null}}function gt(){return{type:"link",title:null,url:"",children:[]}}function Ce(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[]}}function Kt(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[]}}function Mt(){return{type:"paragraph",children:[]}}function st(){return{type:"strong",children:[]}}function xt(){return{type:"text",value:""}}function Pt(){return{type:"thematicBreak"}}}function li(e){return{line:e.line,column:e.column,offset:e.offset}}function Qx(e,r){let n=-1;for(;++n<r.length;){const s=r[n];Array.isArray(s)?Qx(e,s):S3(e,s)}}function S3(e,r){let n;for(n in r)if(qx.call(r,n))switch(n){case"canContainEols":{const s=r[n];s&&e[n].push(...s);break}case"transforms":{const s=r[n];s&&e[n].push(...s);break}case"enter":case"exit":{const s=r[n];s&&Object.assign(e[n],s);break}}}function vv(e,r){throw e?new Error("Cannot close `"+e.type+"` ("+Za({start:e.start,end:e.end})+"): a different token (`"+r.type+"`, "+Za({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+Za({start:r.start,end:r.end})+") is still open")}function w3(e){const r=this;r.parser=n;function n(s){return x3(s,{...r.data("settings"),...e,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function A3(e,r){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(r),!0)};return e.patch(r,n),e.applyData(r,n)}function C3(e,r){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(r,n),[e.applyData(r,n),{type:"text",value:`
|
|
308
|
+
`}]}function E3(e,r){const n=r.value?r.value+`
|
|
309
|
+
`:"",s={},a=r.lang?r.lang.split(/\s+/):[];a.length>0&&(s.className=["language-"+a[0]]);let u={type:"element",tagName:"code",properties:s,children:[{type:"text",value:n}]};return r.meta&&(u.data={meta:r.meta}),e.patch(r,u),u=e.applyData(r,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(r,u),u}function k3(e,r){const n={type:"element",tagName:"del",properties:{},children:e.all(r)};return e.patch(r,n),e.applyData(r,n)}function N3(e,r){const n={type:"element",tagName:"em",properties:{},children:e.all(r)};return e.patch(r,n),e.applyData(r,n)}function T3(e,r){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(r.identifier).toUpperCase(),a=Gs(s.toLowerCase()),u=e.footnoteOrder.indexOf(s);let d,o=e.footnoteCounts.get(s);o===void 0?(o=0,e.footnoteOrder.push(s),d=e.footnoteOrder.length):d=u+1,o+=1,e.footnoteCounts.set(s,o);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(r,c);const h={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(r,h),e.applyData(r,h)}function R3(e,r){const n={type:"element",tagName:"h"+r.depth,properties:{},children:e.all(r)};return e.patch(r,n),e.applyData(r,n)}function j3(e,r){if(e.options.allowDangerousHtml){const n={type:"raw",value:r.value};return e.patch(r,n),e.applyData(r,n)}}function Gx(e,r){const n=r.referenceType;let s="]";if(n==="collapsed"?s+="[]":n==="full"&&(s+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+s}];const a=e.all(r),u=a[0];u&&u.type==="text"?u.value="["+u.value:a.unshift({type:"text",value:"["});const d=a[a.length-1];return d&&d.type==="text"?d.value+=s:a.push({type:"text",value:s}),a}function D3(e,r){const n=String(r.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return Gx(e,r);const a={src:Gs(s.url||""),alt:r.alt};s.title!==null&&s.title!==void 0&&(a.title=s.title);const u={type:"element",tagName:"img",properties:a,children:[]};return e.patch(r,u),e.applyData(r,u)}function B3(e,r){const n={src:Gs(r.url)};r.alt!==null&&r.alt!==void 0&&(n.alt=r.alt),r.title!==null&&r.title!==void 0&&(n.title=r.title);const s={type:"element",tagName:"img",properties:n,children:[]};return e.patch(r,s),e.applyData(r,s)}function I3(e,r){const n={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};e.patch(r,n);const s={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(r,s),e.applyData(r,s)}function L3(e,r){const n=String(r.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return Gx(e,r);const a={href:Gs(s.url||"")};s.title!==null&&s.title!==void 0&&(a.title=s.title);const u={type:"element",tagName:"a",properties:a,children:e.all(r)};return e.patch(r,u),e.applyData(r,u)}function M3(e,r){const n={href:Gs(r.url)};r.title!==null&&r.title!==void 0&&(n.title=r.title);const s={type:"element",tagName:"a",properties:n,children:e.all(r)};return e.patch(r,s),e.applyData(r,s)}function O3(e,r,n){const s=e.all(r),a=n?z3(n):Wx(r),u={},d=[];if(typeof r.checked=="boolean"){const m=s[0];let f;m&&m.type==="element"&&m.tagName==="p"?f=m:(f={type:"element",tagName:"p",properties:{},children:[]},s.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let o=-1;for(;++o<s.length;){const m=s[o];(a||o!==0||m.type!=="element"||m.tagName!=="p")&&d.push({type:"text",value:`
|
|
310
|
+
`}),m.type==="element"&&m.tagName==="p"&&!a?d.push(...m.children):d.push(m)}const c=s[s.length-1];c&&(a||c.type!=="element"||c.tagName!=="p")&&d.push({type:"text",value:`
|
|
311
|
+
`});const h={type:"element",tagName:"li",properties:u,children:d};return e.patch(r,h),e.applyData(r,h)}function z3(e){let r=!1;if(e.type==="list"){r=e.spread||!1;const n=e.children;let s=-1;for(;!r&&++s<n.length;)r=Wx(n[s])}return r}function Wx(e){const r=e.spread;return r??e.children.length>1}function F3(e,r){const n={},s=e.all(r);let a=-1;for(typeof r.start=="number"&&r.start!==1&&(n.start=r.start);++a<s.length;){const d=s[a];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const u={type:"element",tagName:r.ordered?"ol":"ul",properties:n,children:e.wrap(s,!0)};return e.patch(r,u),e.applyData(r,u)}function P3(e,r){const n={type:"element",tagName:"p",properties:{},children:e.all(r)};return e.patch(r,n),e.applyData(r,n)}function H3(e,r){const n={type:"root",children:e.wrap(e.all(r))};return e.patch(r,n),e.applyData(r,n)}function U3(e,r){const n={type:"element",tagName:"strong",properties:{},children:e.all(r)};return e.patch(r,n),e.applyData(r,n)}function $3(e,r){const n=e.all(r),s=n.shift(),a=[];if(s){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(r.children[0],d),a.push(d)}if(n.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=If(r.children[1]),c=Ex(r.children[r.children.length-1]);o&&c&&(d.position={start:o,end:c}),a.push(d)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(r,u),e.applyData(r,u)}function q3(e,r,n){const s=n?n.children:void 0,u=(s?s.indexOf(r):1)===0?"th":"td",d=n&&n.type==="table"?n.align:void 0,o=d?d.length:r.children.length;let c=-1;const h=[];for(;++c<o;){const f=r.children[c],v={},w=d?d[c]:void 0;w&&(v.align=w);let A={type:"element",tagName:u,properties:v,children:[]};f&&(A.children=e.all(f),e.patch(f,A),A=e.applyData(f,A)),h.push(A)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(r,m),e.applyData(r,m)}function Q3(e,r){const n={type:"element",tagName:"td",properties:{},children:e.all(r)};return e.patch(r,n),e.applyData(r,n)}const bv=9,xv=32;function G3(e){const r=String(e),n=/\r?\n|\r/g;let s=n.exec(r),a=0;const u=[];for(;s;)u.push(_v(r.slice(a,s.index),a>0,!0),s[0]),a=s.index+s[0].length,s=n.exec(r);return u.push(_v(r.slice(a),a>0,!1)),u.join("")}function _v(e,r,n){let s=0,a=e.length;if(r){let u=e.codePointAt(s);for(;u===bv||u===xv;)s++,u=e.codePointAt(s)}if(n){let u=e.codePointAt(a-1);for(;u===bv||u===xv;)a--,u=e.codePointAt(a-1)}return a>s?e.slice(s,a):""}function W3(e,r){const n={type:"text",value:G3(String(r.value))};return e.patch(r,n),e.applyData(r,n)}function K3(e,r){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(r,n),e.applyData(r,n)}const V3={blockquote:A3,break:C3,code:E3,delete:k3,emphasis:N3,footnoteReference:T3,heading:R3,html:j3,imageReference:D3,image:B3,inlineCode:I3,linkReference:L3,link:M3,listItem:O3,list:F3,paragraph:P3,root:H3,strong:U3,table:$3,tableCell:Q3,tableRow:q3,text:W3,thematicBreak:K3,toml:$l,yaml:$l,definition:$l,footnoteDefinition:$l};function $l(){}const Kx=-1,Ac=0,eo=1,pc=2,Pf=3,Hf=4,Uf=5,$f=6,Vx=7,Xx=8,Sv=typeof self=="object"?self:globalThis,X3=(e,r)=>{const n=(a,u)=>(e.set(u,a),a),s=a=>{if(e.has(a))return e.get(a);const[u,d]=r[a];switch(u){case Ac:case Kx:return n(d,a);case eo:{const o=n([],a);for(const c of d)o.push(s(c));return o}case pc:{const o=n({},a);for(const[c,h]of d)o[s(c)]=s(h);return o}case Pf:return n(new Date(d),a);case Hf:{const{source:o,flags:c}=d;return n(new RegExp(o,c),a)}case Uf:{const o=n(new Map,a);for(const[c,h]of d)o.set(s(c),s(h));return o}case $f:{const o=n(new Set,a);for(const c of d)o.add(s(c));return o}case Vx:{const{name:o,message:c}=d;return n(new Sv[o](c),a)}case Xx:return n(BigInt(d),a);case"BigInt":return n(Object(BigInt(d)),a);case"ArrayBuffer":return n(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:o}=new Uint8Array(d);return n(new DataView(o),d)}}return n(new Sv[u](d),a)};return s},wv=e=>X3(new Map,e)(0),Bs="",{toString:Y3}={},{keys:Z3}=Object,Qa=e=>{const r=typeof e;if(r!=="object"||!e)return[Ac,r];const n=Y3.call(e).slice(8,-1);switch(n){case"Array":return[eo,Bs];case"Object":return[pc,Bs];case"Date":return[Pf,Bs];case"RegExp":return[Hf,Bs];case"Map":return[Uf,Bs];case"Set":return[$f,Bs];case"DataView":return[eo,n]}return n.includes("Array")?[eo,n]:n.includes("Error")?[Vx,n]:[pc,n]},ql=([e,r])=>e===Ac&&(r==="function"||r==="symbol"),J3=(e,r,n,s)=>{const a=(d,o)=>{const c=s.push(d)-1;return n.set(o,c),c},u=d=>{if(n.has(d))return n.get(d);let[o,c]=Qa(d);switch(o){case Ac:{let m=d;switch(c){case"bigint":o=Xx,m=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);m=null;break;case"undefined":return a([Kx],d)}return a([o,m],d)}case eo:{if(c){let v=d;return c==="DataView"?v=new Uint8Array(d.buffer):c==="ArrayBuffer"&&(v=new Uint8Array(d)),a([c,[...v]],d)}const m=[],f=a([o,m],d);for(const v of d)m.push(u(v));return f}case pc:{if(c)switch(c){case"BigInt":return a([c,d.toString()],d);case"Boolean":case"Number":case"String":return a([c,d.valueOf()],d)}if(r&&"toJSON"in d)return u(d.toJSON());const m=[],f=a([o,m],d);for(const v of Z3(d))(e||!ql(Qa(d[v])))&&m.push([u(v),u(d[v])]);return f}case Pf:return a([o,d.toISOString()],d);case Hf:{const{source:m,flags:f}=d;return a([o,{source:m,flags:f}],d)}case Uf:{const m=[],f=a([o,m],d);for(const[v,w]of d)(e||!(ql(Qa(v))||ql(Qa(w))))&&m.push([u(v),u(w)]);return f}case $f:{const m=[],f=a([o,m],d);for(const v of d)(e||!ql(Qa(v)))&&m.push(u(v));return f}}const{message:h}=d;return a([o,{name:c,message:h}],d)};return u},Av=(e,{json:r,lossy:n}={})=>{const s=[];return J3(!(r||n),!!r,new Map,s)(e),s},gc=typeof structuredClone=="function"?(e,r)=>r&&("json"in r||"lossy"in r)?wv(Av(e,r)):structuredClone(e):(e,r)=>wv(Av(e,r));function eT(e,r){const n=[{type:"text",value:"↩"}];return r>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),n}function tT(e,r){return"Back to reference "+(e+1)+(r>1?"-"+r:"")}function nT(e){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||eT,s=e.options.footnoteBackLabel||tT,a=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[c]);if(!h)continue;const m=e.all(h),f=String(h.identifier).toUpperCase(),v=Gs(f.toLowerCase());let w=0;const A=[],b=e.footnoteCounts.get(f);for(;b!==void 0&&++w<=b;){A.length>0&&A.push({type:"text",value:" "});let _=typeof n=="string"?n:n(c,w);typeof _=="string"&&(_={type:"text",value:_}),A.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+v+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(c,w),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const y=m[m.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const _=y.children[y.children.length-1];_&&_.type==="text"?_.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...A)}else m.push(...A);const S={type:"element",tagName:"li",properties:{id:r+"fn-"+v},children:e.wrap(m,!0)};e.patch(h,S),o.push(S)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...gc(d),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
|
|
312
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
|
|
313
|
+
`}]}}const Cc=(function(e){if(e==null)return aT;if(typeof e=="function")return Ec(e);if(typeof e=="object")return Array.isArray(e)?rT(e):iT(e);if(typeof e=="string")return sT(e);throw new Error("Expected function, string, or object as test")});function rT(e){const r=[];let n=-1;for(;++n<e.length;)r[n]=Cc(e[n]);return Ec(s);function s(...a){let u=-1;for(;++u<r.length;)if(r[u].apply(this,a))return!0;return!1}}function iT(e){const r=e;return Ec(n);function n(s){const a=s;let u;for(u in e)if(a[u]!==r[u])return!1;return!0}}function sT(e){return Ec(r);function r(n){return n&&n.type===e}}function Ec(e){return r;function r(n,s,a){return!!(oT(n)&&e.call(this,n,typeof s=="number"?s:void 0,a||void 0))}}function aT(){return!0}function oT(e){return e!==null&&typeof e=="object"&&"type"in e}const Yx=[],lT=!0,ef=!1,cT="skip";function Zx(e,r,n,s){let a;typeof r=="function"&&typeof n!="function"?(s=n,n=r):a=r;const u=Cc(a),d=s?-1:1;o(e,void 0,[])();function o(c,h,m){const f=c&&typeof c=="object"?c:{};if(typeof f.type=="string"){const w=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(c.type+(w?"<"+w+">":""))+")"})}return v;function v(){let w=Yx,A,b,y;if((!r||u(c,h,m[m.length-1]||void 0))&&(w=uT(n(c,m)),w[0]===ef))return w;if("children"in c&&c.children){const S=c;if(S.children&&w[0]!==cT)for(b=(s?S.children.length:-1)+d,y=m.concat(S);b>-1&&b<S.children.length;){const _=S.children[b];if(A=o(_,b,y)(),A[0]===ef)return A;b=typeof A[1]=="number"?A[1]:b+d}}return w}}}function uT(e){return Array.isArray(e)?e:typeof e=="number"?[lT,e]:e==null?Yx:[e]}function qf(e,r,n,s){let a,u,d;typeof r=="function"&&typeof n!="function"?(u=void 0,d=r,a=n):(u=r,d=n,a=s),Zx(e,u,o,a);function o(c,h){const m=h[h.length-1],f=m?m.children.indexOf(c):void 0;return d(c,f,m)}}const tf={}.hasOwnProperty,dT={};function hT(e,r){const n=r||dT,s=new Map,a=new Map,u=new Map,d={...V3,...n.handlers},o={all:h,applyData:pT,definitionById:s,footnoteById:a,footnoteCounts:u,footnoteOrder:[],handlers:d,one:c,options:n,patch:fT,wrap:mT};return qf(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const f=m.type==="definition"?s:a,v=String(m.identifier).toUpperCase();f.has(v)||f.set(v,m)}}),o;function c(m,f){const v=m.type,w=o.handlers[v];if(tf.call(o.handlers,v)&&w)return w(o,m,f);if(o.options.passThrough&&o.options.passThrough.includes(v)){if("children"in m){const{children:b,...y}=m,S=gc(y);return S.children=o.all(m),S}return gc(m)}return(o.options.unknownHandler||gT)(o,m,f)}function h(m){const f=[];if("children"in m){const v=m.children;let w=-1;for(;++w<v.length;){const A=o.one(v[w],m);if(A){if(w&&v[w-1].type==="break"&&(!Array.isArray(A)&&A.type==="text"&&(A.value=Cv(A.value)),!Array.isArray(A)&&A.type==="element")){const b=A.children[0];b&&b.type==="text"&&(b.value=Cv(b.value))}Array.isArray(A)?f.push(...A):f.push(A)}}}return f}}function fT(e,r){e.position&&(r.position=t2(e))}function pT(e,r){let n=r;if(e&&e.data){const s=e.data.hName,a=e.data.hChildren,u=e.data.hProperties;if(typeof s=="string")if(n.type==="element")n.tagName=s;else{const d="children"in n?n.children:[n];n={type:"element",tagName:s,properties:{},children:d}}n.type==="element"&&u&&Object.assign(n.properties,gc(u)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function gT(e,r){const n=r.data||{},s="value"in r&&!(tf.call(n,"hProperties")||tf.call(n,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:e.all(r)};return e.patch(r,s),e.applyData(r,s)}function mT(e,r){const n=[];let s=-1;for(r&&n.push({type:"text",value:`
|
|
314
|
+
`});++s<e.length;)s&&n.push({type:"text",value:`
|
|
315
|
+
`}),n.push(e[s]);return r&&e.length>0&&n.push({type:"text",value:`
|
|
316
|
+
`}),n}function Cv(e){let r=0,n=e.charCodeAt(r);for(;n===9||n===32;)r++,n=e.charCodeAt(r);return e.slice(r)}function Ev(e,r){const n=hT(e,r),s=n.one(e,void 0),a=nT(n),u=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return a&&u.children.push({type:"text",value:`
|
|
317
|
+
`},a),u}function yT(e,r){return e&&"run"in e?async function(n,s){const a=Ev(n,{file:s,...r});await e.run(a,s)}:function(n,s){return Ev(n,{file:s,...e||r})}}function kv(e){if(e)throw e}var gh,Nv;function vT(){if(Nv)return gh;Nv=1;var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(h){return typeof Array.isArray=="function"?Array.isArray(h):r.call(h)==="[object Array]"},u=function(h){if(!h||r.call(h)!=="[object Object]")return!1;var m=e.call(h,"constructor"),f=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!f)return!1;var v;for(v in h);return typeof v>"u"||e.call(h,v)},d=function(h,m){n&&m.name==="__proto__"?n(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},o=function(h,m){if(m==="__proto__")if(e.call(h,m)){if(s)return s(h,m).value}else return;return h[m]};return gh=function c(){var h,m,f,v,w,A,b=arguments[0],y=1,S=arguments.length,_=!1;for(typeof b=="boolean"&&(_=b,b=arguments[1]||{},y=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});y<S;++y)if(h=arguments[y],h!=null)for(m in h)f=o(b,m),v=o(h,m),b!==v&&(_&&v&&(u(v)||(w=a(v)))?(w?(w=!1,A=f&&a(f)?f:[]):A=f&&u(f)?f:{},d(b,{name:m,newValue:c(_,A,v)})):typeof v<"u"&&d(b,{name:m,newValue:v}));return b},gh}var bT=vT();const mh=xf(bT);function nf(e){if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function xT(){const e=[],r={run:n,use:s};return r;function n(...a){let u=-1;const d=a.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);o(null,...a);function o(c,...h){const m=e[++u];let f=-1;if(c){d(c);return}for(;++f<a.length;)(h[f]===null||h[f]===void 0)&&(h[f]=a[f]);a=h,m?_T(m,o)(...h):d(null,...h)}}function s(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),r}}function _T(e,r){let n;return s;function s(...d){const o=e.length>d.length;let c;o&&d.push(a);try{c=e.apply(this,d)}catch(h){const m=h;if(o&&n)throw m;return a(m)}o||(c&&c.then&&typeof c.then=="function"?c.then(u,a):c instanceof Error?a(c):u(c))}function a(d,...o){n||(n=!0,r(d,...o))}function u(d){a(null,d)}}const ar={basename:ST,dirname:wT,extname:AT,join:CT,sep:"/"};function ST(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');vo(e);let n=0,s=-1,a=e.length,u;if(r===void 0||r.length===0||r.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(u){n=a+1;break}}else s<0&&(u=!0,s=a+1);return s<0?"":e.slice(n,s)}if(r===e)return"";let d=-1,o=r.length-1;for(;a--;)if(e.codePointAt(a)===47){if(u){n=a+1;break}}else d<0&&(u=!0,d=a+1),o>-1&&(e.codePointAt(a)===r.codePointAt(o--)?o<0&&(s=a):(o=-1,s=d));return n===s?s=d:s<0&&(s=e.length),e.slice(n,s)}function wT(e){if(vo(e),e.length===0)return".";let r=-1,n=e.length,s;for(;--n;)if(e.codePointAt(n)===47){if(s){r=n;break}}else s||(s=!0);return r<0?e.codePointAt(0)===47?"/":".":r===1&&e.codePointAt(0)===47?"//":e.slice(0,r)}function AT(e){vo(e);let r=e.length,n=-1,s=0,a=-1,u=0,d;for(;r--;){const o=e.codePointAt(r);if(o===47){if(d){s=r+1;break}continue}n<0&&(d=!0,n=r+1),o===46?a<0?a=r:u!==1&&(u=1):a>-1&&(u=-1)}return a<0||n<0||u===0||u===1&&a===n-1&&a===s+1?"":e.slice(a,n)}function CT(...e){let r=-1,n;for(;++r<e.length;)vo(e[r]),e[r]&&(n=n===void 0?e[r]:n+"/"+e[r]);return n===void 0?".":ET(n)}function ET(e){vo(e);const r=e.codePointAt(0)===47;let n=kT(e,!r);return n.length===0&&!r&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),r?"/"+n:n}function kT(e,r){let n="",s=0,a=-1,u=0,d=-1,o,c;for(;++d<=e.length;){if(d<e.length)o=e.codePointAt(d);else{if(o===47)break;o=47}if(o===47){if(!(a===d-1||u===1))if(a!==d-1&&u===2){if(n.length<2||s!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",s=0):(n=n.slice(0,c),s=n.length-1-n.lastIndexOf("/")),a=d,u=0;continue}}else if(n.length>0){n="",s=0,a=d,u=0;continue}}r&&(n=n.length>0?n+"/..":"..",s=2)}else n.length>0?n+="/"+e.slice(a+1,d):n=e.slice(a+1,d),s=d-a-1;a=d,u=0}else o===46&&u>-1?u++:u=-1}return n}function vo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const NT={cwd:TT};function TT(){return"/"}function rf(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function RT(e){if(typeof e=="string")e=new URL(e);else if(!rf(e)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(e.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return jT(e)}function jT(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const r=e.pathname;let n=-1;for(;++n<r.length;)if(r.codePointAt(n)===37&&r.codePointAt(n+1)===50){const s=r.codePointAt(n+2);if(s===70||s===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(r)}const yh=["history","path","basename","stem","extname","dirname"];class Jx{constructor(r){let n;r?rf(r)?n={path:r}:typeof r=="string"||DT(r)?n={value:r}:n=r:n={},this.cwd="cwd"in n?"":NT.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<yh.length;){const u=yh[s];u in n&&n[u]!==void 0&&n[u]!==null&&(this[u]=u==="history"?[...n[u]]:n[u])}let a;for(a in n)yh.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?ar.basename(this.path):void 0}set basename(r){bh(r,"basename"),vh(r,"basename"),this.path=ar.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?ar.dirname(this.path):void 0}set dirname(r){Tv(this.basename,"dirname"),this.path=ar.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?ar.extname(this.path):void 0}set extname(r){if(vh(r,"extname"),Tv(this.dirname,"extname"),r){if(r.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(r.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ar.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){rf(r)&&(r=RT(r)),bh(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?ar.basename(this.path,this.extname):void 0}set stem(r){bh(r,"stem"),vh(r,"stem"),this.path=ar.join(this.dirname||"",r+(this.extname||""))}fail(r,n,s){const a=this.message(r,n,s);throw a.fatal=!0,a}info(r,n,s){const a=this.message(r,n,s);return a.fatal=void 0,a}message(r,n,s){const a=new cn(r,n,s);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function vh(e,r){if(e&&e.includes(ar.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+ar.sep+"`")}function bh(e,r){if(!e)throw new Error("`"+r+"` cannot be empty")}function Tv(e,r){if(!e)throw new Error("Setting `"+r+"` requires `path` to be set too")}function DT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const BT=(function(e){const s=this.constructor.prototype,a=s[e],u=function(){return a.apply(u,arguments)};return Object.setPrototypeOf(u,s),u}),IT={}.hasOwnProperty;class Qf extends BT{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=xT()}copy(){const r=new Qf;let n=-1;for(;++n<this.attachers.length;){const s=this.attachers[n];r.use(...s)}return r.data(mh(!0,{},this.namespace)),r}data(r,n){return typeof r=="string"?arguments.length===2?(Sh("data",this.frozen),this.namespace[r]=n,this):IT.call(this.namespace,r)&&this.namespace[r]||void 0:r?(Sh("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const a=n.call(r,...s);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const n=Ql(r),s=this.parser||this.Parser;return xh("parse",s),s(String(n),n)}process(r,n){const s=this;return this.freeze(),xh("process",this.parser||this.Parser),_h("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(u,d){const o=Ql(r),c=s.parse(o);s.run(c,o,function(m,f,v){if(m||!f||!v)return h(m);const w=f,A=s.stringify(w,v);OT(A)?v.value=A:v.result=A,h(m,v)});function h(m,f){m||!f?d(m):u?u(f):n(void 0,f)}}}processSync(r){let n=!1,s;return this.freeze(),xh("processSync",this.parser||this.Parser),_h("processSync",this.compiler||this.Compiler),this.process(r,a),jv("processSync","process",n),s;function a(u,d){n=!0,kv(u),s=d}}run(r,n,s){Rv(r),this.freeze();const a=this.transformers;return!s&&typeof n=="function"&&(s=n,n=void 0),s?u(void 0,s):new Promise(u);function u(d,o){const c=Ql(n);a.run(r,c,h);function h(m,f,v){const w=f||r;m?o(m):d?d(w):s(void 0,w,v)}}}runSync(r,n){let s=!1,a;return this.run(r,n,u),jv("runSync","run",s),a;function u(d,o){kv(d),a=o,s=!0}}stringify(r,n){this.freeze();const s=Ql(n),a=this.compiler||this.Compiler;return _h("stringify",a),Rv(r),a(r,s)}use(r,...n){const s=this.attachers,a=this.namespace;if(Sh("use",this.frozen),r!=null)if(typeof r=="function")c(r,n);else if(typeof r=="object")Array.isArray(r)?o(r):d(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function u(h){if(typeof h=="function")c(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...f]=h;c(m,f)}else d(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function d(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");o(h.plugins),h.settings&&(a.settings=mh(!0,a.settings,h.settings))}function o(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){const f=h[m];u(f)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function c(h,m){let f=-1,v=-1;for(;++f<s.length;)if(s[f][0]===h){v=f;break}if(v===-1)s.push([h,...m]);else if(m.length>0){let[w,...A]=m;const b=s[v][1];nf(b)&&nf(w)&&(w=mh(!0,b,w)),s[v]=[h,w,...A]}}}}const LT=new Qf().freeze();function xh(e,r){if(typeof r!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function _h(e,r){if(typeof r!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Sh(e,r){if(r)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Rv(e){if(!nf(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function jv(e,r,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+r+"` instead")}function Ql(e){return MT(e)?e:new Jx(e)}function MT(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function OT(e){return typeof e=="string"||zT(e)}function zT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const FT="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Dv=[],Bv={allowDangerousHtml:!0},PT=/^(https?|ircs?|mailto|xmpp)$/i,HT=[{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 UT(e){const r=$T(e),n=qT(e);return QT(r.runSync(r.parse(n),n),e)}function $T(e){const r=e.rehypePlugins||Dv,n=e.remarkPlugins||Dv,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Bv}:Bv;return LT().use(w3).use(n).use(yT,s).use(r)}function qT(e){const r=e.children||"",n=new Jx;return typeof r=="string"&&(n.value=r),n}function QT(e,r){const n=r.allowedElements,s=r.allowElement,a=r.components,u=r.disallowedElements,d=r.skipHtml,o=r.unwrapDisallowed,c=r.urlTransform||GT;for(const m of HT)Object.hasOwn(r,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+FT+m.id,void 0);return qf(e,h),a2(e,{Fragment:g.Fragment,components:a,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function h(m,f,v){if(m.type==="raw"&&v&&typeof f=="number")return d?v.children.splice(f,1):v.children[f]={type:"text",value:m.value},f;if(m.type==="element"){let w;for(w in hh)if(Object.hasOwn(hh,w)&&Object.hasOwn(m.properties,w)){const A=m.properties[w],b=hh[w];(b===null||b.includes(m.tagName))&&(m.properties[w]=c(String(A||""),w,m))}}if(m.type==="element"){let w=n?!n.includes(m.tagName):u?u.includes(m.tagName):!1;if(!w&&s&&typeof f=="number"&&(w=!s(m,f,v)),w&&v&&typeof f=="number")return o&&m.children?v.children.splice(f,1,...m.children):v.children.splice(f,1),f}}}function GT(e){const r=e.indexOf(":"),n=e.indexOf("?"),s=e.indexOf("#"),a=e.indexOf("/");return r===-1||a!==-1&&r>a||n!==-1&&r>n||s!==-1&&r>s||PT.test(e.slice(0,r))?e:""}function WT(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function e_(e,r,n){const a=Cc((n||{}).ignore||[]),u=KT(r);let d=-1;for(;++d<u.length;)Zx(e,"text",o);function o(h,m){let f=-1,v;for(;++f<m.length;){const w=m[f],A=v?v.children:void 0;if(a(w,A?A.indexOf(w):void 0,v))return;v=w}if(v)return c(h,m)}function c(h,m){const f=m[m.length-1],v=u[d][0],w=u[d][1];let A=0;const y=f.children.indexOf(h);let S=!1,_=[];v.lastIndex=0;let x=v.exec(h.value);for(;x;){const E=x.index,N={index:x.index,input:x.input,stack:[...m,h]};let T=w(...x,N);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1?v.lastIndex=E+1:(A!==E&&_.push({type:"text",value:h.value.slice(A,E)}),Array.isArray(T)?_.push(...T):T&&_.push(T),A=E+x[0].length,S=!0),!v.global)break;x=v.exec(h.value)}return S?(A<h.value.length&&_.push({type:"text",value:h.value.slice(A)}),f.children.splice(y,1,..._)):_=[h],y+_.length}}function KT(e){const r=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<n.length;){const a=n[s];r.push([VT(a[0]),XT(a[1])])}return r}function VT(e){return typeof e=="string"?new RegExp(WT(e),"g"):e}function XT(e){return typeof e=="function"?e:function(){return e}}function YT(e){e_(e,[/\r?\n|\r/g,ZT])}function ZT(){return{type:"break"}}function JT(){return function(e){YT(e)}}function Iv(e,r){const n=String(e);if(typeof r!="string")throw new TypeError("Expected character");let s=0,a=n.indexOf(r);for(;a!==-1;)s++,a=n.indexOf(r,a+r.length);return s}const wh="phrasing",Ah=["autolink","link","image","label"];function eR(){return{transforms:[oR],enter:{literalAutolink:nR,literalAutolinkEmail:Ch,literalAutolinkHttp:Ch,literalAutolinkWww:Ch},exit:{literalAutolink:aR,literalAutolinkEmail:sR,literalAutolinkHttp:rR,literalAutolinkWww:iR}}}function tR(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:wh,notInConstruct:Ah},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:wh,notInConstruct:Ah},{character:":",before:"[ps]",after:"\\/",inConstruct:wh,notInConstruct:Ah}]}}function nR(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ch(e){this.config.enter.autolinkProtocol.call(this,e)}function rR(e){this.config.exit.autolinkProtocol.call(this,e)}function iR(e){this.config.exit.data.call(this,e);const r=this.stack[this.stack.length-1];r.type,r.url="http://"+this.sliceSerialize(e)}function sR(e){this.config.exit.autolinkEmail.call(this,e)}function aR(e){this.exit(e)}function oR(e){e_(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,lR],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),cR]],{ignore:["link","linkReference"]})}function lR(e,r,n,s,a){let u="";if(!t_(a)||(/^w/i.test(r)&&(n=r+n,r="",u="http://"),!uR(n)))return!1;const d=dR(n+s);if(!d[0])return!1;const o={type:"link",title:null,url:u+r+d[0],children:[{type:"text",value:r+d[0]}]};return d[1]?[o,{type:"text",value:d[1]}]:o}function cR(e,r,n,s){return!t_(s,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+n,children:[{type:"text",value:r+"@"+n}]}}function uR(e){const r=e.split(".");return!(r.length<2||r[r.length-1]&&(/_/.test(r[r.length-1])||!/[a-zA-Z\d]/.test(r[r.length-1]))||r[r.length-2]&&(/_/.test(r[r.length-2])||!/[a-zA-Z\d]/.test(r[r.length-2])))}function dR(e){const r=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!r)return[e,void 0];e=e.slice(0,r.index);let n=r[0],s=n.indexOf(")");const a=Iv(e,"(");let u=Iv(e,")");for(;s!==-1&&a>u;)e+=n.slice(0,s+1),n=n.slice(s+1),s=n.indexOf(")"),u++;return[e,n]}function t_(e,r){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Pi(n)||Sc(n))&&(!r||n!==47)}n_.peek=xR;function hR(){this.buffer()}function fR(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function pR(){this.buffer()}function gR(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function mR(e){const r=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zn(this.sliceSerialize(e)).toLowerCase(),n.label=r}function yR(e){this.exit(e)}function vR(e){const r=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zn(this.sliceSerialize(e)).toLowerCase(),n.label=r}function bR(e){this.exit(e)}function xR(){return"["}function n_(e,r,n,s){const a=n.createTracker(s);let u=a.move("[^");const d=n.enter("footnoteReference"),o=n.enter("reference");return u+=a.move(n.safe(n.associationId(e),{after:"]",before:u})),o(),d(),u+=a.move("]"),u}function _R(){return{enter:{gfmFootnoteCallString:hR,gfmFootnoteCall:fR,gfmFootnoteDefinitionLabelString:pR,gfmFootnoteDefinition:gR},exit:{gfmFootnoteCallString:mR,gfmFootnoteCall:yR,gfmFootnoteDefinitionLabelString:vR,gfmFootnoteDefinition:bR}}}function SR(e){let r=!1;return e&&e.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:n,footnoteReference:n_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(s,a,u,d){const o=u.createTracker(d);let c=o.move("[^");const h=u.enter("footnoteDefinition"),m=u.enter("label");return c+=o.move(u.safe(u.associationId(s),{before:c,after:"]"})),m(),c+=o.move("]:"),s.children&&s.children.length>0&&(o.shift(4),c+=o.move((r?`
|
|
318
|
+
`:" ")+u.indentLines(u.containerFlow(s,o.current()),r?r_:wR))),h(),c}}function wR(e,r,n){return r===0?e:r_(e,r,n)}function r_(e,r,n){return(n?"":" ")+e}const AR=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];i_.peek=TR;function CR(){return{canContainEols:["delete"],enter:{strikethrough:kR},exit:{strikethrough:NR}}}function ER(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:AR}],handlers:{delete:i_}}}function kR(e){this.enter({type:"delete",children:[]},e)}function NR(e){this.exit(e)}function i_(e,r,n,s){const a=n.createTracker(s),u=n.enter("strikethrough");let d=a.move("~~");return d+=n.containerPhrasing(e,{...a.current(),before:d,after:"~"}),d+=a.move("~~"),u(),d}function TR(){return"~"}function RR(e){return e.length}function jR(e,r){const n=r||{},s=(n.align||[]).concat(),a=n.stringLength||RR,u=[],d=[],o=[],c=[];let h=0,m=-1;for(;++m<e.length;){const b=[],y=[];let S=-1;for(e[m].length>h&&(h=e[m].length);++S<e[m].length;){const _=DR(e[m][S]);if(n.alignDelimiters!==!1){const x=a(_);y[S]=x,(c[S]===void 0||x>c[S])&&(c[S]=x)}b.push(_)}d[m]=b,o[m]=y}let f=-1;if(typeof s=="object"&&"length"in s)for(;++f<h;)u[f]=Lv(s[f]);else{const b=Lv(s);for(;++f<h;)u[f]=b}f=-1;const v=[],w=[];for(;++f<h;){const b=u[f];let y="",S="";b===99?(y=":",S=":"):b===108?y=":":b===114&&(S=":");let _=n.alignDelimiters===!1?1:Math.max(1,c[f]-y.length-S.length);const x=y+"-".repeat(_)+S;n.alignDelimiters!==!1&&(_=y.length+_+S.length,_>c[f]&&(c[f]=_),w[f]=_),v[f]=x}d.splice(1,0,v),o.splice(1,0,w),m=-1;const A=[];for(;++m<d.length;){const b=d[m],y=o[m];f=-1;const S=[];for(;++f<h;){const _=b[f]||"";let x="",E="";if(n.alignDelimiters!==!1){const N=c[f]-(y[f]||0),T=u[f];T===114?x=" ".repeat(N):T===99?N%2?(x=" ".repeat(N/2+.5),E=" ".repeat(N/2-.5)):(x=" ".repeat(N/2),E=x):E=" ".repeat(N)}n.delimiterStart!==!1&&!f&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&_==="")&&(n.delimiterStart!==!1||f)&&S.push(" "),n.alignDelimiters!==!1&&S.push(x),S.push(_),n.alignDelimiters!==!1&&S.push(E),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||f!==h-1)&&S.push("|")}A.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return A.join(`
|
|
319
|
+
`)}function DR(e){return e==null?"":String(e)}function Lv(e){const r=typeof e=="string"?e.codePointAt(0):0;return r===67||r===99?99:r===76||r===108?108:r===82||r===114?114:0}function BR(e,r,n,s){const a=n.enter("blockquote"),u=n.createTracker(s);u.move("> "),u.shift(2);const d=n.indentLines(n.containerFlow(e,u.current()),IR);return a(),d}function IR(e,r,n){return">"+(n?"":" ")+e}function LR(e,r){return Mv(e,r.inConstruct,!0)&&!Mv(e,r.notInConstruct,!1)}function Mv(e,r,n){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return n;let s=-1;for(;++s<r.length;)if(e.includes(r[s]))return!0;return!1}function Ov(e,r,n,s){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
|
|
320
|
+
`&&LR(n.stack,n.unsafe[a]))return/[ \t]/.test(s.before)?"":" ";return`\\
|
|
321
|
+
`}function MR(e,r){const n=String(e);let s=n.indexOf(r),a=s,u=0,d=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===a?++u>d&&(d=u):u=1,a=s+r.length,s=n.indexOf(r,a);return d}function OR(e,r){return!!(r.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function zR(e){const r=e.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function FR(e,r,n,s){const a=zR(n),u=e.value||"",d=a==="`"?"GraveAccent":"Tilde";if(OR(e,n)){const f=n.enter("codeIndented"),v=n.indentLines(u,PR);return f(),v}const o=n.createTracker(s),c=a.repeat(Math.max(MR(u,a)+1,3)),h=n.enter("codeFenced");let m=o.move(c);if(e.lang){const f=n.enter(`codeFencedLang${d}`);m+=o.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${d}`);m+=o.move(" "),m+=o.move(n.safe(e.meta,{before:m,after:`
|
|
322
|
+
`,encode:["`"],...o.current()})),f()}return m+=o.move(`
|
|
323
|
+
`),u&&(m+=o.move(u+`
|
|
324
|
+
`)),m+=o.move(c),h(),m}function PR(e,r,n){return(n?"":" ")+e}function Gf(e){const r=e.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function HR(e,r,n,s){const a=Gf(n),u=a==='"'?"Quote":"Apostrophe",d=n.enter("definition");let o=n.enter("label");const c=n.createTracker(s);let h=c.move("[");return h+=c.move(n.safe(n.associationId(e),{before:h,after:"]",...c.current()})),h+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(n.safe(e.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(o=n.enter("destinationRaw"),h+=c.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
325
|
+
`,...c.current()}))),o(),e.title&&(o=n.enter(`title${u}`),h+=c.move(" "+a),h+=c.move(n.safe(e.title,{before:h,after:a,...c.current()})),h+=c.move(a),o()),d(),h}function UR(e){const r=e.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function oo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function mc(e,r,n){const s=Us(e),a=Us(r);return s===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}s_.peek=$R;function s_(e,r,n,s){const a=UR(n),u=n.enter("emphasis"),d=n.createTracker(s),o=d.move(a);let c=d.move(n.containerPhrasing(e,{after:a,before:o,...d.current()}));const h=c.charCodeAt(0),m=mc(s.before.charCodeAt(s.before.length-1),h,a);m.inside&&(c=oo(h)+c.slice(1));const f=c.charCodeAt(c.length-1),v=mc(s.after.charCodeAt(0),f,a);v.inside&&(c=c.slice(0,-1)+oo(f));const w=d.move(a);return u(),n.attentionEncodeSurroundingInfo={after:v.outside,before:m.outside},o+c+w}function $R(e,r,n){return n.options.emphasis||"*"}function qR(e,r){let n=!1;return qf(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return n=!0,ef}),!!((!e.depth||e.depth<3)&&zf(e)&&(r.options.setext||n))}function QR(e,r,n,s){const a=Math.max(Math.min(6,e.depth||1),1),u=n.createTracker(s);if(qR(e,n)){const m=n.enter("headingSetext"),f=n.enter("phrasing"),v=n.containerPhrasing(e,{...u.current(),before:`
|
|
326
|
+
`,after:`
|
|
327
|
+
`});return f(),m(),v+`
|
|
328
|
+
`+(a===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
|
|
329
|
+
`))+1))}const d="#".repeat(a),o=n.enter("headingAtx"),c=n.enter("phrasing");u.move(d+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
330
|
+
`,...u.current()});return/^[\t ]/.test(h)&&(h=oo(h.charCodeAt(0))+h.slice(1)),h=h?d+" "+h:d,n.options.closeAtx&&(h+=" "+d),c(),o(),h}a_.peek=GR;function a_(e){return e.value||""}function GR(){return"<"}o_.peek=WR;function o_(e,r,n,s){const a=Gf(n),u=a==='"'?"Quote":"Apostrophe",d=n.enter("image");let o=n.enter("label");const c=n.createTracker(s);let h=c.move("![");return h+=c.move(n.safe(e.alt,{before:h,after:"]",...c.current()})),h+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(n.safe(e.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(o=n.enter("destinationRaw"),h+=c.move(n.safe(e.url,{before:h,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=n.enter(`title${u}`),h+=c.move(" "+a),h+=c.move(n.safe(e.title,{before:h,after:a,...c.current()})),h+=c.move(a),o()),h+=c.move(")"),d(),h}function WR(){return"!"}l_.peek=KR;function l_(e,r,n,s){const a=e.referenceType,u=n.enter("imageReference");let d=n.enter("label");const o=n.createTracker(s);let c=o.move("![");const h=n.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(h+"]["),d();const m=n.stack;n.stack=[],d=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return d(),n.stack=m,u(),a==="full"||!h||h!==f?c+=o.move(f+"]"):a==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function KR(){return"!"}c_.peek=VR;function c_(e,r,n){let s=e.value||"",a="`",u=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(s);)a+="`";for(/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++u<n.unsafe.length;){const d=n.unsafe[u],o=n.compilePattern(d);let c;if(d.atBreak)for(;c=o.exec(s);){let h=c.index;s.charCodeAt(h)===10&&s.charCodeAt(h-1)===13&&h--,s=s.slice(0,h)+" "+s.slice(c.index+1)}}return a+s+a}function VR(){return"`"}function u_(e,r){const n=zf(e);return!!(!r.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}d_.peek=XR;function d_(e,r,n,s){const a=Gf(n),u=a==='"'?"Quote":"Apostrophe",d=n.createTracker(s);let o,c;if(u_(e,n)){const m=n.stack;n.stack=[],o=n.enter("autolink");let f=d.move("<");return f+=d.move(n.containerPhrasing(e,{before:f,after:">",...d.current()})),f+=d.move(">"),o(),n.stack=m,f}o=n.enter("link"),c=n.enter("label");let h=d.move("[");return h+=d.move(n.containerPhrasing(e,{before:h,after:"](",...d.current()})),h+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(c=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${u}`),h+=d.move(" "+a),h+=d.move(n.safe(e.title,{before:h,after:a,...d.current()})),h+=d.move(a),c()),h+=d.move(")"),o(),h}function XR(e,r,n){return u_(e,n)?"<":"["}h_.peek=YR;function h_(e,r,n,s){const a=e.referenceType,u=n.enter("linkReference");let d=n.enter("label");const o=n.createTracker(s);let c=o.move("[");const h=n.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(h+"]["),d();const m=n.stack;n.stack=[],d=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return d(),n.stack=m,u(),a==="full"||!h||h!==f?c+=o.move(f+"]"):a==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function YR(){return"["}function Wf(e){const r=e.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function ZR(e){const r=Wf(e),n=e.options.bulletOther;if(!n)return r==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+n+"`) to be different");return n}function JR(e){const r=e.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function f_(e){const r=e.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function ej(e,r,n,s){const a=n.enter("list"),u=n.bulletCurrent;let d=e.ordered?JR(n):Wf(n);const o=e.ordered?d==="."?")":".":ZR(n);let c=r&&n.bulletLastUsed?d===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),f_(n)===d&&m){let f=-1;for(;++f<e.children.length;){const v=e.children[f];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(d=o),n.bulletCurrent=d;const h=n.containerFlow(e,s);return n.bulletLastUsed=d,n.bulletCurrent=u,a(),h}function tj(e){const r=e.options.listItemIndent||"one";if(r!=="tab"&&r!=="one"&&r!=="mixed")throw new Error("Cannot serialize items with `"+r+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return r}function nj(e,r,n,s){const a=tj(n);let u=n.bulletCurrent||Wf(n);r&&r.type==="list"&&r.ordered&&(u=(typeof r.start=="number"&&r.start>-1?r.start:1)+(n.options.incrementListMarker===!1?0:r.children.indexOf(e))+u);let d=u.length+1;(a==="tab"||a==="mixed"&&(r&&r.type==="list"&&r.spread||e.spread))&&(d=Math.ceil(d/4)*4);const o=n.createTracker(s);o.move(u+" ".repeat(d-u.length)),o.shift(d);const c=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,o.current()),m);return c(),h;function m(f,v,w){return v?(w?"":" ".repeat(d))+f:(w?u:u+" ".repeat(d-u.length))+f}}function rj(e,r,n,s){const a=n.enter("paragraph"),u=n.enter("phrasing"),d=n.containerPhrasing(e,s);return u(),a(),d}const ij=Cc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function sj(e,r,n,s){return(e.children.some(function(d){return ij(d)})?n.containerPhrasing:n.containerFlow).call(n,e,s)}function aj(e){const r=e.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}p_.peek=oj;function p_(e,r,n,s){const a=aj(n),u=n.enter("strong"),d=n.createTracker(s),o=d.move(a+a);let c=d.move(n.containerPhrasing(e,{after:a,before:o,...d.current()}));const h=c.charCodeAt(0),m=mc(s.before.charCodeAt(s.before.length-1),h,a);m.inside&&(c=oo(h)+c.slice(1));const f=c.charCodeAt(c.length-1),v=mc(s.after.charCodeAt(0),f,a);v.inside&&(c=c.slice(0,-1)+oo(f));const w=d.move(a+a);return u(),n.attentionEncodeSurroundingInfo={after:v.outside,before:m.outside},o+c+w}function oj(e,r,n){return n.options.strong||"*"}function lj(e,r,n,s){return n.safe(e.value,s)}function cj(e){const r=e.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function uj(e,r,n){const s=(f_(n)+(n.options.ruleSpaces?" ":"")).repeat(cj(n));return n.options.ruleSpaces?s.slice(0,-1):s}const g_={blockquote:BR,break:Ov,code:FR,definition:HR,emphasis:s_,hardBreak:Ov,heading:QR,html:a_,image:o_,imageReference:l_,inlineCode:c_,link:d_,linkReference:h_,list:ej,listItem:nj,paragraph:rj,root:sj,strong:p_,text:lj,thematicBreak:uj};function dj(){return{enter:{table:hj,tableData:zv,tableHeader:zv,tableRow:pj},exit:{codeText:gj,table:fj,tableData:Eh,tableHeader:Eh,tableRow:Eh}}}function hj(e){const r=e._align;this.enter({type:"table",align:r.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function fj(e){this.exit(e),this.data.inTable=void 0}function pj(e){this.enter({type:"tableRow",children:[]},e)}function Eh(e){this.exit(e)}function zv(e){this.enter({type:"tableCell",children:[]},e)}function gj(e){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,mj));const n=this.stack[this.stack.length-1];n.type,n.value=r,this.exit(e)}function mj(e,r){return r==="|"?r:e}function yj(e){const r=e||{},n=r.tableCellPadding,s=r.tablePipeAlign,a=r.stringLength,u=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
331
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:d,tableCell:c,tableRow:o}};function d(w,A,b,y){return h(m(w,b,y),w.align)}function o(w,A,b,y){const S=f(w,b,y),_=h([S]);return _.slice(0,_.indexOf(`
|
|
332
|
+
`))}function c(w,A,b,y){const S=b.enter("tableCell"),_=b.enter("phrasing"),x=b.containerPhrasing(w,{...y,before:u,after:u});return _(),S(),x}function h(w,A){return jR(w,{align:A,alignDelimiters:s,padding:n,stringLength:a})}function m(w,A,b){const y=w.children;let S=-1;const _=[],x=A.enter("table");for(;++S<y.length;)_[S]=f(y[S],A,b);return x(),_}function f(w,A,b){const y=w.children;let S=-1;const _=[],x=A.enter("tableRow");for(;++S<y.length;)_[S]=c(y[S],w,A,b);return x(),_}function v(w,A,b){let y=g_.inlineCode(w,A,b);return b.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function vj(){return{exit:{taskListCheckValueChecked:Fv,taskListCheckValueUnchecked:Fv,paragraph:xj}}}function bj(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:_j}}}function Fv(e){const r=this.stack[this.stack.length-2];r.type,r.checked=e.type==="taskListCheckValueChecked"}function xj(e){const r=this.stack[this.stack.length-2];if(r&&r.type==="listItem"&&typeof r.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const s=n.children[0];if(s&&s.type==="text"){const a=r.children;let u=-1,d;for(;++u<a.length;){const o=a[u];if(o.type==="paragraph"){d=o;break}}d===n&&(s.value=s.value.slice(1),s.value.length===0?n.children.shift():n.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,n.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function _j(e,r,n,s){const a=e.children[0],u=typeof e.checked=="boolean"&&a&&a.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",o=n.createTracker(s);u&&o.move(d);let c=g_.listItem(e,r,n,{...s,...o.current()});return u&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),c;function h(m){return m+d}}function Sj(){return[eR(),_R(),CR(),dj(),vj()]}function wj(e){return{extensions:[tR(),SR(e),ER(),yj(e),bj()]}}const Aj={tokenize:Rj,partial:!0},m_={tokenize:jj,partial:!0},y_={tokenize:Dj,partial:!0},v_={tokenize:Bj,partial:!0},Cj={tokenize:Ij,partial:!0},b_={name:"wwwAutolink",tokenize:Nj,previous:__},x_={name:"protocolAutolink",tokenize:Tj,previous:S_},Lr={name:"emailAutolink",tokenize:kj,previous:w_},fr={};function Ej(){return{text:fr}}let Di=48;for(;Di<123;)fr[Di]=Lr,Di++,Di===58?Di=65:Di===91&&(Di=97);fr[43]=Lr;fr[45]=Lr;fr[46]=Lr;fr[95]=Lr;fr[72]=[Lr,x_];fr[104]=[Lr,x_];fr[87]=[Lr,b_];fr[119]=[Lr,b_];function kj(e,r,n){const s=this;let a,u;return d;function d(f){return!sf(f)||!w_.call(s,s.previous)||Kf(s.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return sf(f)?(e.consume(f),o):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(Cj,m,h)(f):f===45||f===95||ln(f)?(u=!0,e.consume(f),c):m(f)}function h(f){return e.consume(f),a=!0,c}function m(f){return u&&a&&dn(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),r(f)):n(f)}}function Nj(e,r,n){const s=this;return a;function a(d){return d!==87&&d!==119||!__.call(s,s.previous)||Kf(s.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Aj,e.attempt(m_,e.attempt(y_,u),n),n)(d))}function u(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),r(d)}}function Tj(e,r,n){const s=this;let a="",u=!1;return d;function d(f){return(f===72||f===104)&&S_.call(s,s.previous)&&!Kf(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(dn(f)&&a.length<5)return a+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const v=a.toLowerCase();if(v==="http"||v==="https")return e.consume(f),c}return n(f)}function c(f){return f===47?(e.consume(f),u?h:(u=!0,c)):n(f)}function h(f){return f===null||fc(f)||wt(f)||Pi(f)||Sc(f)?n(f):e.attempt(m_,e.attempt(y_,m),n)(f)}function m(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),r(f)}}function Rj(e,r,n){let s=0;return a;function a(d){return(d===87||d===119)&&s<3?(s++,e.consume(d),a):d===46&&s===3?(e.consume(d),u):n(d)}function u(d){return d===null?n(d):r(d)}}function jj(e,r,n){let s,a,u;return d;function d(h){return h===46||h===95?e.check(v_,c,o)(h):h===null||wt(h)||Pi(h)||h!==45&&Sc(h)?c(h):(u=!0,e.consume(h),d)}function o(h){return h===95?s=!0:(a=s,s=void 0),e.consume(h),d}function c(h){return a||s||!u?n(h):r(h)}}function Dj(e,r){let n=0,s=0;return a;function a(d){return d===40?(n++,e.consume(d),a):d===41&&s<n?u(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(v_,r,u)(d):d===null||wt(d)||Pi(d)?r(d):(e.consume(d),a)}function u(d){return d===41&&s++,e.consume(d),a}}function Bj(e,r,n){return s;function s(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),s):o===38?(e.consume(o),u):o===93?(e.consume(o),a):o===60||o===null||wt(o)||Pi(o)?r(o):n(o)}function a(o){return o===null||o===40||o===91||wt(o)||Pi(o)?r(o):s(o)}function u(o){return dn(o)?d(o):n(o)}function d(o){return o===59?(e.consume(o),s):dn(o)?(e.consume(o),d):n(o)}}function Ij(e,r,n){return s;function s(u){return e.consume(u),a}function a(u){return ln(u)?n(u):r(u)}}function __(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||wt(e)}function S_(e){return!dn(e)}function w_(e){return!(e===47||sf(e))}function sf(e){return e===43||e===45||e===46||e===95||ln(e)}function Kf(e){let r=e.length,n=!1;for(;r--;){const s=e[r][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){n=!0;break}if(s._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Lj={tokenize:$j,partial:!0};function Mj(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Pj,continuation:{tokenize:Hj},exit:Uj}},text:{91:{name:"gfmFootnoteCall",tokenize:Fj},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Oj,resolveTo:zj}}}}function Oj(e,r,n){const s=this;let a=s.events.length;const u=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let d;for(;a--;){const c=s.events[a][1];if(c.type==="labelImage"){d=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!d||!d._balanced)return n(c);const h=Zn(s.sliceSerialize({start:d.end,end:s.now()}));return h.codePointAt(0)!==94||!u.includes(h.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),r(c))}}function zj(e,r){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},o=[e[n+1],e[n+2],["enter",s,r],e[n+3],e[n+4],["enter",a,r],["exit",a,r],["enter",u,r],["enter",d,r],["exit",d,r],["exit",u,r],e[e.length-2],e[e.length-1],["exit",s,r]];return e.splice(n,e.length-n+1,...o),e}function Fj(e,r,n){const s=this,a=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let u=0,d;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(f){if(u>999||f===93&&!d||f===null||f===91||wt(f))return n(f);if(f===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return a.includes(Zn(s.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),r):n(f)}return wt(f)||(d=!0),u++,e.consume(f),f===92?m:h}function m(f){return f===91||f===92||f===93?(e.consume(f),u++,h):h(f)}}function Pj(e,r,n){const s=this,a=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let u,d=0,o;return c;function c(A){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(A),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(A){return A===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(A),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(A)}function m(A){if(d>999||A===93&&!o||A===null||A===91||wt(A))return n(A);if(A===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return u=Zn(s.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(A),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return wt(A)||(o=!0),d++,e.consume(A),A===92?f:m}function f(A){return A===91||A===92||A===93?(e.consume(A),d++,m):m(A)}function v(A){return A===58?(e.enter("definitionMarker"),e.consume(A),e.exit("definitionMarker"),a.includes(u)||a.push(u),it(e,w,"gfmFootnoteDefinitionWhitespace")):n(A)}function w(A){return r(A)}}function Hj(e,r,n){return e.check(yo,r,e.attempt(Lj,r,n))}function Uj(e){e.exit("gfmFootnoteDefinition")}function $j(e,r,n){const s=this;return it(e,a,"gfmFootnoteDefinitionIndent",5);function a(u){const d=s.events[s.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?r(u):n(u)}}function qj(e){let n=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:u,resolveAll:a};return n==null&&(n=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function a(d,o){let c=-1;for(;++c<d.length;)if(d[c][0]==="enter"&&d[c][1].type==="strikethroughSequenceTemporary"&&d[c][1]._close){let h=c;for(;h--;)if(d[h][0]==="exit"&&d[h][1].type==="strikethroughSequenceTemporary"&&d[h][1]._open&&d[c][1].end.offset-d[c][1].start.offset===d[h][1].end.offset-d[h][1].start.offset){d[c][1].type="strikethroughSequence",d[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},d[h][1].start),end:Object.assign({},d[c][1].end)},f={type:"strikethroughText",start:Object.assign({},d[h][1].end),end:Object.assign({},d[c][1].start)},v=[["enter",m,o],["enter",d[h][1],o],["exit",d[h][1],o],["enter",f,o]],w=o.parser.constructs.insideSpan.null;w&&Dn(v,v.length,0,wc(w,d.slice(h+1,c),o)),Dn(v,v.length,0,[["exit",f,o],["enter",d[c][1],o],["exit",d[c][1],o],["exit",m,o]]),Dn(d,h-1,c-h+3,v),c=h+v.length-2;break}}for(c=-1;++c<d.length;)d[c][1].type==="strikethroughSequenceTemporary"&&(d[c][1].type="data");return d}function u(d,o,c){const h=this.previous,m=this.events;let f=0;return v;function v(A){return h===126&&m[m.length-1][1].type!=="characterEscape"?c(A):(d.enter("strikethroughSequenceTemporary"),w(A))}function w(A){const b=Us(h);if(A===126)return f>1?c(A):(d.consume(A),f++,w);if(f<2&&!n)return c(A);const y=d.exit("strikethroughSequenceTemporary"),S=Us(A);return y._open=!S||S===2&&!!b,y._close=!b||b===2&&!!S,o(A)}}}class Qj{constructor(){this.map=[]}add(r,n,s){Gj(this,r,n,s)}consume(r){if(this.map.sort(function(u,d){return u[0]-d[0]}),this.map.length===0)return;let n=this.map.length;const s=[];for(;n>0;)n-=1,s.push(r.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),r.length=this.map[n][0];s.push(r.slice()),r.length=0;let a=s.pop();for(;a;){for(const u of a)r.push(u);a=s.pop()}this.map.length=0}}function Gj(e,r,n,s){let a=0;if(!(n===0&&s.length===0)){for(;a<e.map.length;){if(e.map[a][0]===r){e.map[a][1]+=n,e.map[a][2].push(...s);return}a+=1}e.map.push([r,n,s])}}function Wj(e,r){let n=!1;const s=[];for(;r<e.length;){const a=e[r];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&s.push(e[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[r-1][1].type==="tableDelimiterMarker"){const u=s.length-1;s[u]=s[u]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);r+=1}return s}function Kj(){return{flow:{null:{name:"table",tokenize:Vj,resolveAll:Xj}}}}function Vj(e,r,n){const s=this;let a=0,u=0,d;return o;function o(L){let z=s.events.length-1;for(;z>-1;){const G=s.events[z][1].type;if(G==="lineEnding"||G==="linePrefix")z--;else break}const U=z>-1?s.events[z][1].type:null,P=U==="tableHead"||U==="tableRow"?T:c;return P===T&&s.parser.lazy[s.now().line]?n(L):P(L)}function c(L){return e.enter("tableHead"),e.enter("tableRow"),h(L)}function h(L){return L===124||(d=!0,u+=1),m(L)}function m(L){return L===null?n(L):Fe(L)?u>1?(u=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),w):n(L):et(L)?it(e,m,"whitespace")(L):(u+=1,d&&(d=!1,a+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),d=!0,m):(e.enter("data"),f(L)))}function f(L){return L===null||L===124||wt(L)?(e.exit("data"),m(L)):(e.consume(L),L===92?v:f)}function v(L){return L===92||L===124?(e.consume(L),f):f(L)}function w(L){return s.interrupt=!1,s.parser.lazy[s.now().line]?n(L):(e.enter("tableDelimiterRow"),d=!1,et(L)?it(e,A,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):A(L))}function A(L){return L===45||L===58?y(L):L===124?(d=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),b):N(L)}function b(L){return et(L)?it(e,y,"whitespace")(L):y(L)}function y(L){return L===58?(u+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),S):L===45?(u+=1,S(L)):L===null||Fe(L)?E(L):N(L)}function S(L){return L===45?(e.enter("tableDelimiterFiller"),_(L)):N(L)}function _(L){return L===45?(e.consume(L),_):L===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(L))}function x(L){return et(L)?it(e,E,"whitespace")(L):E(L)}function E(L){return L===124?A(L):L===null||Fe(L)?!d||a!==u?N(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),r(L)):N(L)}function N(L){return n(L)}function T(L){return e.enter("tableRow"),j(L)}function j(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),j):L===null||Fe(L)?(e.exit("tableRow"),r(L)):et(L)?it(e,j,"whitespace")(L):(e.enter("data"),R(L))}function R(L){return L===null||L===124||wt(L)?(e.exit("data"),j(L)):(e.consume(L),L===92?D:R)}function D(L){return L===92||L===124?(e.consume(L),R):R(L)}}function Xj(e,r){let n=-1,s=!0,a=0,u=[0,0,0,0],d=[0,0,0,0],o=!1,c=0,h,m,f;const v=new Qj;for(;++n<e.length;){const w=e[n],A=w[1];w[0]==="enter"?A.type==="tableHead"?(o=!1,c!==0&&(Pv(v,r,c,h,m),m=void 0,c=0),h={type:"table",start:Object.assign({},A.start),end:Object.assign({},A.end)},v.add(n,0,[["enter",h,r]])):A.type==="tableRow"||A.type==="tableDelimiterRow"?(s=!0,f=void 0,u=[0,0,0,0],d=[0,n+1,0,0],o&&(o=!1,m={type:"tableBody",start:Object.assign({},A.start),end:Object.assign({},A.end)},v.add(n,0,[["enter",m,r]])),a=A.type==="tableDelimiterRow"?2:m?3:1):a&&(A.type==="data"||A.type==="tableDelimiterMarker"||A.type==="tableDelimiterFiller")?(s=!1,d[2]===0&&(u[1]!==0&&(d[0]=d[1],f=Gl(v,r,u,a,void 0,f),u=[0,0,0,0]),d[2]=n)):A.type==="tableCellDivider"&&(s?s=!1:(u[1]!==0&&(d[0]=d[1],f=Gl(v,r,u,a,void 0,f)),u=d,d=[u[1],n,0,0])):A.type==="tableHead"?(o=!0,c=n):A.type==="tableRow"||A.type==="tableDelimiterRow"?(c=n,u[1]!==0?(d[0]=d[1],f=Gl(v,r,u,a,n,f)):d[1]!==0&&(f=Gl(v,r,d,a,n,f)),a=0):a&&(A.type==="data"||A.type==="tableDelimiterMarker"||A.type==="tableDelimiterFiller")&&(d[3]=n)}for(c!==0&&Pv(v,r,c,h,m),v.consume(r.events),n=-1;++n<r.events.length;){const w=r.events[n];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=Wj(r.events,n))}return e}function Gl(e,r,n,s,a,u){const d=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(u.end=Object.assign({},Is(r.events,n[0])),e.add(n[0],0,[["exit",u,r]]));const c=Is(r.events,n[1]);if(u={type:d,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",u,r]]),n[2]!==0){const h=Is(r.events,n[2]),m=Is(r.events,n[3]),f={type:o,start:Object.assign({},h),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",f,r]]),s!==2){const v=r.events[n[2]],w=r.events[n[3]];if(v[1].end=Object.assign({},w[1].end),v[1].type="chunkText",v[1].contentType="text",n[3]>n[2]+1){const A=n[2]+1,b=n[3]-n[2]-1;e.add(A,b,[])}}e.add(n[3]+1,0,[["exit",f,r]])}return a!==void 0&&(u.end=Object.assign({},Is(r.events,a)),e.add(a,0,[["exit",u,r]]),u=void 0),u}function Pv(e,r,n,s,a){const u=[],d=Is(r.events,n);a&&(a.end=Object.assign({},d),u.push(["exit",a,r])),s.end=Object.assign({},d),u.push(["exit",s,r]),e.add(n+1,0,u)}function Is(e,r){const n=e[r],s=n[0]==="enter"?"start":"end";return n[1][s]}const Yj={name:"tasklistCheck",tokenize:Jj};function Zj(){return{text:{91:Yj}}}function Jj(e,r,n){const s=this;return a;function a(c){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),u)}function u(c){return wt(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),d):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),d):n(c)}function d(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return Fe(c)?r(c):et(c)?e.check({tokenize:eD},r,n)(c):n(c)}}function eD(e,r,n){return it(e,s,"whitespace");function s(a){return a===null?n(a):r(a)}}function tD(e){return Bx([Ej(),Mj(),qj(e),Kj(),Zj()])}const nD={};function Hv(e){const r=this,n=e||nD,s=r.data(),a=s.micromarkExtensions||(s.micromarkExtensions=[]),u=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),d=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);a.push(tD(n)),u.push(Sj()),d.push(wj(n))}function rD({code:e}){const[r,n]=q.useState(!1),s=()=>{var o,c;if(e.length===0)return;const a=()=>{n(!0),window.setTimeout(()=>n(!1),1200)},u=(c=(o=navigator.clipboard)==null?void 0:o.writeText)==null?void 0:c.bind(navigator.clipboard);if(u!==void 0){u(e).then(a).catch(d);return}d();function d(){try{const h=document.createElement("textarea");h.value=e,h.style.position="fixed",h.style.opacity="0",document.body.appendChild(h),h.select(),document.execCommand("copy"),document.body.removeChild(h),a()}catch{}}};return g.jsx("button",{type:"button",onClick:s,className:"absolute right-1 top-1 rounded bg-neutral-800/80 p-1 text-neutral-400 opacity-0 transition-opacity hover:text-neutral-100 group-hover:opacity-100 focus:opacity-100",title:"Copy code block",children:r?g.jsx(wf,{size:12}):g.jsx(qb,{size:12})})}const iD=({className:e,children:r,...n})=>{const s=/language-([\w-]+)/.exec(e??""),a=String(r??"").replace(/\n$/,"");if(!(s!==null||a.includes(`
|
|
333
|
+
`)))return g.jsx("code",{className:"rounded bg-neutral-800 px-1 py-0.5 font-mono text-[0.9em] text-neutral-100",...n,children:r});const d=(s==null?void 0:s[1])??"text";return g.jsxs("div",{className:"group relative",children:[g.jsx(rD,{code:a}),g.jsx(mx,{code:a,language:d,theme:Df.vsDark,children:({style:o,tokens:c,getLineProps:h,getTokenProps:m})=>g.jsx("pre",{className:"overflow-x-auto rounded border border-neutral-800 p-2 font-mono text-[12px]",style:{...o,background:"#0d0d0d"},children:c.map((f,v)=>{const w=h({line:f});return g.jsx("div",{...w,children:f.map((A,b)=>{const y=m({token:A});return g.jsx("span",{...y},b)})},v)})})})]})},sD={h1:({children:e})=>g.jsx("h1",{className:"mb-1 mt-3 text-base font-semibold first:mt-0",children:e}),h2:({children:e})=>g.jsx("h2",{className:"mb-1 mt-3 text-sm font-semibold first:mt-0",children:e}),h3:({children:e})=>g.jsx("h3",{className:"mb-1 mt-2 text-sm font-semibold first:mt-0",children:e}),h4:({children:e})=>g.jsx("h4",{className:"mb-1 mt-2 text-xs font-semibold first:mt-0",children:e}),h5:({children:e})=>g.jsx("h5",{className:"mb-1 mt-2 text-xs font-semibold first:mt-0",children:e}),h6:({children:e})=>g.jsx("h6",{className:"mb-1 mt-2 text-xs font-semibold first:mt-0",children:e}),p:({children:e})=>g.jsx("p",{className:"my-2 first:mt-0 last:mb-0",children:e}),ul:({children:e})=>g.jsx("ul",{className:"my-2 ml-5 list-disc space-y-1 first:mt-0",children:e}),ol:({children:e})=>g.jsx("ol",{className:"my-2 ml-5 list-decimal space-y-1 first:mt-0",children:e}),li:({children:e})=>g.jsx("li",{className:"leading-snug",children:e}),blockquote:({children:e})=>g.jsx("blockquote",{className:"my-2 border-l-2 border-neutral-700 pl-3 text-neutral-400",children:e}),table:({children:e})=>g.jsx("div",{className:"my-2 overflow-x-auto",children:g.jsx("table",{className:"min-w-full border-collapse text-xs",children:e})}),th:({children:e})=>g.jsx("th",{className:"border border-neutral-800 px-2 py-1 text-left font-semibold",children:e}),td:({children:e})=>g.jsx("td",{className:"border border-neutral-800 px-2 py-1 align-top",children:e}),a:({children:e,href:r})=>g.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 underline hover:text-blue-300",children:e}),hr:()=>g.jsx("hr",{className:"my-3 border-neutral-800"}),strong:({children:e})=>g.jsx("strong",{className:"font-semibold",children:e}),em:({children:e})=>g.jsx("em",{className:"italic",children:e}),code:iD,pre:({children:e})=>g.jsx(g.Fragment,{children:e})};function Vf({text:e,size:r="sm",chatStyleBreaks:n=!1}){const s=r==="xs"?"text-xs":"text-sm",a=n?[Hv,JT]:[Hv];return g.jsx("div",{className:`${s} break-words [overflow-wrap:anywhere]`,children:g.jsx(UT,{remarkPlugins:a,components:sD,children:e})})}function aD({event:e,renderArchived:r}){var h;const[n,s]=q.useState(!1),a=((h=e.summary.split(`
|
|
334
|
+
`)[0])==null?void 0:h.trim())??"",u=a.length>160?a.slice(0,157)+"…":a,d=new Date(e.timestamp),o=`${d.toLocaleDateString()} ${d.toLocaleTimeString()}`,c=e.archivedMessages.length;return g.jsxs("div",{className:"my-2 rounded-md border border-dashed border-amber-700/50 bg-amber-900/10",children:[g.jsxs("button",{type:"button",onClick:()=>s(m=>!m),className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-amber-200/90 hover:bg-amber-900/20",title:n?"Hide archived messages":`Expand ${c} archived message${c===1?"":"s"}`,children:[n?g.jsx(ur,{size:12}):g.jsx(dr,{size:12}),g.jsx(FA,{size:12,className:"text-amber-400"}),g.jsx("span",{className:"flex-1 truncate",children:u.length>0?u:"Compaction"}),g.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-amber-300/70",children:[c," msg · ",e.tokensBefore.toLocaleString()," tok · ",o]})]}),n&&g.jsxs("div",{className:"border-t border-dashed border-amber-700/50 px-3 py-3",children:[e.summary.length>0&&g.jsx("div",{className:"mb-3 whitespace-pre-wrap rounded bg-amber-900/15 px-2 py-1 text-[11px] italic text-amber-100/80",children:e.summary}),g.jsx("div",{className:"space-y-3 opacity-80",children:r()})]})]})}function Uv(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,s)}return n}function pt(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Uv(Object(n),!0).forEach((function(s){af(e,s,n[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uv(Object(n)).forEach((function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))}))}return e}function af(e,r,n){return(r=(function(s){var a=(function(u,d){if(typeof u!="object"||u===null)return u;var o=u[Symbol.toPrimitive];if(o!==void 0){var c=o.call(u,d);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(u)})(s,"string");return typeof a=="symbol"?a:String(a)})(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function di(e,r){if(e==null)return{};var n,s,a=(function(d,o){if(d==null)return{};var c,h,m={},f=Object.keys(d);for(h=0;h<f.length;h++)c=f[h],o.indexOf(c)>=0||(m[c]=d[c]);return m})(e,r);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(s=0;s<u.length;s++)n=u[s],r.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function Jt(e,r){return A_(e)||(function(n,s){var a=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(a!=null){var u,d,o,c,h=[],m=!0,f=!1;try{if(o=(a=a.call(n)).next,s===0){if(Object(a)!==a)return;m=!1}else for(;!(m=(u=o.call(a)).done)&&(h.push(u.value),h.length!==s);m=!0);}catch(v){f=!0,d=v}finally{try{if(!m&&a.return!=null&&(c=a.return(),Object(c)!==c))return}finally{if(f)throw d}}return h}})(e,r)||kc(e,r)||E_()}function oD(e){return A_(e)||C_(e)||kc(e)||E_()}function Hs(e){return(function(r){if(Array.isArray(r))return of(r)})(e)||C_(e)||kc(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
335
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function A_(e){if(Array.isArray(e))return e}function C_(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kc(e,r){if(e){if(typeof e=="string")return of(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?of(e,r):void 0}}function of(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,s=new Array(r);n<r;n++)s[n]=e[n];return s}function E_(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
336
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xf(e,r){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=kc(e))||r){n&&(e=n);var s=0,a=function(){};return{s:a,n:function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(c){throw c},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
337
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var u,d=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return d=c.done,c},e:function(c){o=!0,u=c},f:function(){try{d||n.return==null||n.return()}finally{if(o)throw u}}}}var Wl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bo(e,r){return e(r={exports:{}},r.exports),r.exports}var jn=bo((function(e){/*!
|
|
338
|
+
Copyright (c) 2018 Jed Watson.
|
|
339
|
+
Licensed under the MIT License (MIT), see
|
|
340
|
+
http://jedwatson.github.io/classnames
|
|
341
|
+
*/(function(){var r={}.hasOwnProperty;function n(){for(var s=[],a=0;a<arguments.length;a++){var u=arguments[a];if(u){var d=typeof u;if(d==="string"||d==="number")s.push(u);else if(Array.isArray(u)){if(u.length){var o=n.apply(null,u);o&&s.push(o)}}else if(d==="object"){if(u.toString!==Object.prototype.toString&&!u.toString.toString().includes("[native code]")){s.push(u.toString());continue}for(var c in u)r.call(u,c)&&u[c]&&s.push(c)}}}return s.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})),xn={hunkClassName:"",lineClassName:"",gutterClassName:"",codeClassName:"",monotonous:!1,gutterType:"default",viewType:"split",widgets:{},hideGutter:!1,selectedChanges:[],generateAnchorID:function(){},generateLineClassName:function(){},renderGutter:function(e){var r=e.renderDefault;return(0,e.wrapInAnchor)(r())},codeEvents:{},gutterEvents:{}},k_=q.createContext(xn),lD=k_.Provider,cD=function(){return q.useContext(k_)},uD=bo((function(e,r){(function(n){function s(u){var d=u.slice(11),o=null,c=null;switch(d.indexOf('"')){case-1:o=(f=d.split(" "))[0].slice(2),c=f[1].slice(2);break;case 0:var h=d.indexOf('"',2);o=d.slice(3,h);var m=d.indexOf('"',h+1);c=m<0?d.slice(h+4):d.slice(m+3,-1);break;default:var f;o=(f=d.split(" "))[0].slice(2),c=f[1].slice(3,-1)}return{oldPath:o,newPath:c}}var a={parse:function(u){for(var d,o,c,h,m,f=[],v=2,w=u.split(`
|
|
342
|
+
`),A=w.length,b=0;b<A;){var y=w[b];if(y.indexOf("diff --git")===0){d={hunks:[],oldEndingNewLine:!0,newEndingNewLine:!0,oldPath:(m=s(y)).oldPath,newPath:m.newPath},f.push(d);var S,_=null;e:for(;S=w[++b];){var x=S.indexOf(" "),E=x>-1?S.slice(0,x):E;switch(E){case"diff":b--;break e;case"deleted":case"new":var N=S.slice(x+1);N.indexOf("file mode")===0&&(d[E==="new"?"newMode":"oldMode"]=N.slice(10));break;case"similarity":d.similarity=parseInt(S.split(" ")[2],10);break;case"index":var T=S.slice(x+1).split(" "),j=T[0].split("..");d.oldRevision=j[0],d.newRevision=j[1],T[1]&&(d.oldMode=d.newMode=T[1]);break;case"copy":case"rename":var R=S.slice(x+1);R.indexOf("from")===0?d.oldPath=R.slice(5):d.newPath=R.slice(3),_=E;break;case"---":var D=S.slice(x+1),L=w[++b].slice(4);D==="/dev/null"?(L=L.slice(2),_="add"):L==="/dev/null"?(D=D.slice(2),_="delete"):(_="modify",D=D.slice(2),L=L.slice(2)),D&&(d.oldPath=D),L&&(d.newPath=L),v=5;break e}}d.type=_||"modify"}else if(y.indexOf("Binary")===0)d.isBinary=!0,d.type=y.indexOf("/dev/null and")>=0?"add":y.indexOf("and /dev/null")>=0?"delete":"modify",v=2,d=null;else if(v===5)if(y.indexOf("@@")===0){var z=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(y);o={content:y,oldStart:z[1]-0,newStart:z[4]-0,oldLines:z[3]-0||1,newLines:z[6]-0||1,changes:[]},d.hunks.push(o),c=o.oldStart,h=o.newStart}else{var U=y.slice(0,1),P={content:y.slice(1)};switch(U){case"+":P.type="insert",P.isInsert=!0,P.lineNumber=h,h++;break;case"-":P.type="delete",P.isDelete=!0,P.lineNumber=c,c++;break;case" ":P.type="normal",P.isNormal=!0,P.oldLineNumber=c,P.newLineNumber=h,c++,h++;break;case"\\":var G=o.changes[o.changes.length-1];G.isDelete||(d.newEndingNewLine=!1),G.isInsert||(d.oldEndingNewLine=!1)}P.type&&o.changes.push(P)}b++}return f}};e.exports=a})()}));function Ws(e){return e.type==="insert"}function lr(e){return e.type==="delete"}function $s(e){return e.type==="normal"}function dD(e,r){var n=r.nearbySequences==="zip"?(function(s){var a=s.reduce((function(u,d,o){var c=Jt(u,3),h=c[0],m=c[1],f=c[2];return m?Ws(d)&&f>=0?(h.splice(f+1,0,d),[h,d,f+2]):(h.push(d),[h,d,lr(d)&&lr(m)?f:o]):(h.push(d),[h,d,lr(d)?o:-1])}),[[],null,-1]);return Jt(a,1)[0]})(e.changes):e.changes;return pt(pt({},e),{},{isPlain:!1,changes:n})}function hD(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=(function(s){if(s.startsWith("diff --git"))return s;var a=s.indexOf(`
|
|
343
|
+
`),u=s.indexOf(`
|
|
344
|
+
`,a+1),d=s.slice(0,a),o=s.slice(a+1,u),c=d.split(" ").slice(1,-3).join(" "),h=o.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(c," b/").concat(h),"index 1111111..2222222 100644","--- a/".concat(c),"+++ b/".concat(h),s.slice(u+1)].join(`
|
|
345
|
+
`)})(e.trimStart());return uD.parse(n).map((function(s){return(function(a,u){var d=a.hunks.map((function(o){return dD(o,u)}));return pt(pt({},a),{},{hunks:d})})(s,r)}))}function fD(e){return e[0]}function pD(e){return e[e.length-1]}function lf(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function lo(e){return e==="old"?function(r){return Ws(r)?-1:$s(r)?r.oldLineNumber:r.lineNumber}:function(r){return lr(r)?-1:$s(r)?r.newLineNumber:r.lineNumber}}function N_(e,r){return function(n,s){var a=n[e],u=a+n[r];return s>=a&&s<u}}function gD(e,r){return function(n,s,a){var u=n[e]+n[r],d=s[e];return a>=u&&a<d}}function T_(e){var r=lo(e),n=(function(s){var a=Jt(lf(s),2),u=N_(a[0],a[1]);return function(d,o){return d.find((function(c){return u(c,o)}))}})(e);return function(s,a){var u=n(s,a);if(u)return u.changes.find((function(d){return r(d)===a}))}}function Yf(e){var r=e==="old"?"new":"old",n=Jt(lf(e),2),s=n[0],a=n[1],u=Jt(lf(r),2),d=u[0],o=u[1],c=lo(e),h=lo(r),m=N_(s,a),f=gD(s,a);return function(v,w){var A=fD(v);if(w<A[s]){var b=A[s]-w;return A[d]-b}var y=pD(v);if(y[s]+y[a]<=w){var S=w-y[s]-y[a];return y[d]+y[o]+S}for(var _=0;_<v.length;_++){var x=v[_],E=v[_+1];if(m(x,w)){var N=x.changes.findIndex((function(z){return c(z)===w})),T=x.changes[N];if($s(T))return h(T);var j=lr(T)?N+1:N-1,R=x.changes[j];if(!R)return-1;var D=Ws(T)?"delete":"insert";return R.type===D?h(R):-1}if(f(x,E,w)){var L=w-x[s]-x[a];return x[d]+x[o]+L}}throw new Error("Unexpected line position ".concat(w))}}var mD=function(){this.__data__=[],this.size=0},R_=function(e,r){return e===r||e!=e&&r!=r},Nc=function(e,r){for(var n=e.length;n--;)if(R_(e[n][0],r))return n;return-1},yD=Array.prototype.splice,vD=function(e){var r=this.__data__,n=Nc(r,e);return!(n<0)&&(n==r.length-1?r.pop():yD.call(r,n,1),--this.size,!0)},bD=function(e){var r=this.__data__,n=Nc(r,e);return n<0?void 0:r[n][1]},xD=function(e){return Nc(this.__data__,e)>-1},_D=function(e,r){var n=this.__data__,s=Nc(n,e);return s<0?(++this.size,n.push([e,r])):n[s][1]=r,this};function Ls(e){var r=-1,n=e==null?0:e.length;for(this.clear();++r<n;){var s=e[r];this.set(s[0],s[1])}}Ls.prototype.clear=mD,Ls.prototype.delete=vD,Ls.prototype.get=bD,Ls.prototype.has=xD,Ls.prototype.set=_D;var Tc=Ls,SD=function(){this.__data__=new Tc,this.size=0},wD=function(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n},AD=function(e){return this.__data__.get(e)},CD=function(e){return this.__data__.has(e)},j_=typeof Wl=="object"&&Wl&&Wl.Object===Object&&Wl,ED=typeof self=="object"&&self&&self.Object===Object&&self,Mr=j_||ED||Function("return this")(),cr=Mr.Symbol,D_=Object.prototype,kD=D_.hasOwnProperty,ND=D_.toString,Ga=cr?cr.toStringTag:void 0,TD=function(e){var r=kD.call(e,Ga),n=e[Ga];try{e[Ga]=void 0;var s=!0}catch{}var a=ND.call(e);return s&&(r?e[Ga]=n:delete e[Ga]),a},RD=Object.prototype.toString,jD=function(e){return RD.call(e)},$v=cr?cr.toStringTag:void 0,Ks=function(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":$v&&$v in Object(e)?TD(e):jD(e)},Zf=function(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")},B_=function(e){if(!Zf(e))return!1;var r=Ks(e);return r=="[object Function]"||r=="[object GeneratorFunction]"||r=="[object AsyncFunction]"||r=="[object Proxy]"},kh=Mr["__core-js_shared__"],qv=(function(){var e=/[^.]+$/.exec(kh&&kh.keys&&kh.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})(),DD=function(e){return!!qv&&qv in e},BD=Function.prototype.toString,Ui=function(e){if(e!=null){try{return BD.call(e)}catch{}try{return e+""}catch{}}return""},ID=/^\[object .+?Constructor\]$/,LD=Function.prototype,MD=Object.prototype,OD=LD.toString,zD=MD.hasOwnProperty,FD=RegExp("^"+OD.call(zD).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),PD=function(e){return!(!Zf(e)||DD(e))&&(B_(e)?FD:ID).test(Ui(e))},HD=function(e,r){return e==null?void 0:e[r]},$i=function(e,r){var n=HD(e,r);return PD(n)?n:void 0},co=$i(Mr,"Map"),uo=$i(Object,"create"),UD=function(){this.__data__=uo?uo(null):{},this.size=0},$D=function(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r},qD=Object.prototype.hasOwnProperty,QD=function(e){var r=this.__data__;if(uo){var n=r[e];return n==="__lodash_hash_undefined__"?void 0:n}return qD.call(r,e)?r[e]:void 0},GD=Object.prototype.hasOwnProperty,WD=function(e){var r=this.__data__;return uo?r[e]!==void 0:GD.call(r,e)},KD=function(e,r){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=uo&&r===void 0?"__lodash_hash_undefined__":r,this};function Ms(e){var r=-1,n=e==null?0:e.length;for(this.clear();++r<n;){var s=e[r];this.set(s[0],s[1])}}Ms.prototype.clear=UD,Ms.prototype.delete=$D,Ms.prototype.get=QD,Ms.prototype.has=WD,Ms.prototype.set=KD;var Qv=Ms,VD=function(){this.size=0,this.__data__={hash:new Qv,map:new(co||Tc),string:new Qv}},XD=function(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null},Rc=function(e,r){var n=e.__data__;return XD(r)?n[typeof r=="string"?"string":"hash"]:n.map},YD=function(e){var r=Rc(this,e).delete(e);return this.size-=r?1:0,r},ZD=function(e){return Rc(this,e).get(e)},JD=function(e){return Rc(this,e).has(e)},e5=function(e,r){var n=Rc(this,e),s=n.size;return n.set(e,r),this.size+=n.size==s?0:1,this};function Os(e){var r=-1,n=e==null?0:e.length;for(this.clear();++r<n;){var s=e[r];this.set(s[0],s[1])}}Os.prototype.clear=VD,Os.prototype.delete=YD,Os.prototype.get=ZD,Os.prototype.has=JD,Os.prototype.set=e5;var jc=Os,t5=function(e,r){var n=this.__data__;if(n instanceof Tc){var s=n.__data__;if(!co||s.length<199)return s.push([e,r]),this.size=++n.size,this;n=this.__data__=new jc(s)}return n.set(e,r),this.size=n.size,this};function zs(e){var r=this.__data__=new Tc(e);this.size=r.size}zs.prototype.clear=SD,zs.prototype.delete=wD,zs.prototype.get=AD,zs.prototype.has=CD,zs.prototype.set=t5;var ac=zs,n5=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},r5=function(e){return this.__data__.has(e)};function oc(e){var r=-1,n=e==null?0:e.length;for(this.__data__=new jc;++r<n;)this.add(e[r])}oc.prototype.add=oc.prototype.push=n5,oc.prototype.has=r5;var i5=oc,s5=function(e,r){for(var n=-1,s=e==null?0:e.length;++n<s;)if(r(e[n],n,e))return!0;return!1},a5=function(e,r){return e.has(r)},I_=function(e,r,n,s,a,u){var d=1&n,o=e.length,c=r.length;if(o!=c&&!(d&&c>o))return!1;var h=u.get(e),m=u.get(r);if(h&&m)return h==r&&m==e;var f=-1,v=!0,w=2&n?new i5:void 0;for(u.set(e,r),u.set(r,e);++f<o;){var A=e[f],b=r[f];if(s)var y=d?s(b,A,f,r,e,u):s(A,b,f,e,r,u);if(y!==void 0){if(y)continue;v=!1;break}if(w){if(!s5(r,(function(S,_){if(!a5(w,_)&&(A===S||a(A,S,n,s,u)))return w.push(_)}))){v=!1;break}}else if(A!==b&&!a(A,b,n,s,u)){v=!1;break}}return u.delete(e),u.delete(r),v},Gv=Mr.Uint8Array,o5=function(e){var r=-1,n=Array(e.size);return e.forEach((function(s,a){n[++r]=[a,s]})),n},l5=function(e){var r=-1,n=Array(e.size);return e.forEach((function(s){n[++r]=s})),n},Wv=cr?cr.prototype:void 0,Nh=Wv?Wv.valueOf:void 0,c5=function(e,r,n,s,a,u,d){switch(n){case"[object DataView]":if(e.byteLength!=r.byteLength||e.byteOffset!=r.byteOffset)return!1;e=e.buffer,r=r.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=r.byteLength||!u(new Gv(e),new Gv(r)));case"[object Boolean]":case"[object Date]":case"[object Number]":return R_(+e,+r);case"[object Error]":return e.name==r.name&&e.message==r.message;case"[object RegExp]":case"[object String]":return e==r+"";case"[object Map]":var o=o5;case"[object Set]":var c=1&s;if(o||(o=l5),e.size!=r.size&&!c)return!1;var h=d.get(e);if(h)return h==r;s|=2,d.set(e,r);var m=I_(o(e),o(r),s,a,u,d);return d.delete(e),m;case"[object Symbol]":if(Nh)return Nh.call(e)==Nh.call(r)}return!1},L_=function(e,r){for(var n=-1,s=r.length,a=e.length;++n<s;)e[a+n]=r[n];return e},Qn=Array.isArray,u5=function(e,r,n){var s=r(e);return Qn(e)?s:L_(s,n(e))},d5=function(e,r){for(var n=-1,s=e==null?0:e.length,a=0,u=[];++n<s;){var d=e[n];r(d,n,e)&&(u[a++]=d)}return u},h5=function(){return[]},f5=Object.prototype.propertyIsEnumerable,Kv=Object.getOwnPropertySymbols,p5=Kv?function(e){return e==null?[]:(e=Object(e),d5(Kv(e),(function(r){return f5.call(e,r)})))}:h5,g5=function(e,r){for(var n=-1,s=Array(e);++n<e;)s[n]=r(n);return s},qs=function(e){return e!=null&&typeof e=="object"},Vv=function(e){return qs(e)&&Ks(e)=="[object Arguments]"},M_=Object.prototype,m5=M_.hasOwnProperty,y5=M_.propertyIsEnumerable,Jf=Vv((function(){return arguments})())?Vv:function(e){return qs(e)&&m5.call(e,"callee")&&!y5.call(e,"callee")},v5=function(){return!1},cf=bo((function(e,r){var n=r&&!r.nodeType&&r,s=n&&e&&!e.nodeType&&e,a=s&&s.exports===n?Mr.Buffer:void 0,u=(a?a.isBuffer:void 0)||v5;e.exports=u})),b5=/^(?:0|[1-9]\d*)$/,O_=function(e,r){var n=typeof e;return!!(r=r??9007199254740991)&&(n=="number"||n!="symbol"&&b5.test(e))&&e>-1&&e%1==0&&e<r},ep=function(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=9007199254740991},Nt={};Nt["[object Float32Array]"]=Nt["[object Float64Array]"]=Nt["[object Int8Array]"]=Nt["[object Int16Array]"]=Nt["[object Int32Array]"]=Nt["[object Uint8Array]"]=Nt["[object Uint8ClampedArray]"]=Nt["[object Uint16Array]"]=Nt["[object Uint32Array]"]=!0,Nt["[object Arguments]"]=Nt["[object Array]"]=Nt["[object ArrayBuffer]"]=Nt["[object Boolean]"]=Nt["[object DataView]"]=Nt["[object Date]"]=Nt["[object Error]"]=Nt["[object Function]"]=Nt["[object Map]"]=Nt["[object Number]"]=Nt["[object Object]"]=Nt["[object RegExp]"]=Nt["[object Set]"]=Nt["[object String]"]=Nt["[object WeakMap]"]=!1;var x5=function(e){return qs(e)&&ep(e.length)&&!!Nt[Ks(e)]},_5=function(e){return function(r){return e(r)}},Xv=bo((function(e,r){var n=r&&!r.nodeType&&r,s=n&&e&&!e.nodeType&&e,a=s&&s.exports===n&&j_.process,u=(function(){try{var d=s&&s.require&&s.require("util").types;return d||a&&a.binding&&a.binding("util")}catch{}})();e.exports=u})),Yv=Xv&&Xv.isTypedArray,z_=Yv?_5(Yv):x5,S5=Object.prototype.hasOwnProperty,w5=function(e,r){var n=Qn(e),s=!n&&Jf(e),a=!n&&!s&&cf(e),u=!n&&!s&&!a&&z_(e),d=n||s||a||u,o=d?g5(e.length,String):[],c=o.length;for(var h in e)!S5.call(e,h)||d&&(h=="length"||a&&(h=="offset"||h=="parent")||u&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||O_(h,c))||o.push(h);return o},A5=Object.prototype,C5=function(e){var r=e&&e.constructor;return e===(typeof r=="function"&&r.prototype||A5)},E5=(function(e,r){return function(n){return e(r(n))}})(Object.keys,Object),k5=Object.prototype.hasOwnProperty,N5=function(e){if(!C5(e))return E5(e);var r=[];for(var n in Object(e))k5.call(e,n)&&n!="constructor"&&r.push(n);return r},tp=function(e){return e!=null&&ep(e.length)&&!B_(e)},np=function(e){return tp(e)?w5(e):N5(e)},Zv=function(e){return u5(e,np,p5)},T5=Object.prototype.hasOwnProperty,R5=function(e,r,n,s,a,u){var d=1&n,o=Zv(e),c=o.length;if(c!=Zv(r).length&&!d)return!1;for(var h=c;h--;){var m=o[h];if(!(d?m in r:T5.call(r,m)))return!1}var f=u.get(e),v=u.get(r);if(f&&v)return f==r&&v==e;var w=!0;u.set(e,r),u.set(r,e);for(var A=d;++h<c;){var b=e[m=o[h]],y=r[m];if(s)var S=d?s(y,b,m,r,e,u):s(b,y,m,e,r,u);if(!(S===void 0?b===y||a(b,y,n,s,u):S)){w=!1;break}A||(A=m=="constructor")}if(w&&!A){var _=e.constructor,x=r.constructor;_==x||!("constructor"in e)||!("constructor"in r)||typeof _=="function"&&_ instanceof _&&typeof x=="function"&&x instanceof x||(w=!1)}return u.delete(e),u.delete(r),w},uf=$i(Mr,"DataView"),df=$i(Mr,"Promise"),hf=$i(Mr,"Set"),ff=$i(Mr,"WeakMap"),j5=Ui(uf),D5=Ui(co),B5=Ui(df),I5=Ui(hf),L5=Ui(ff),Li=Ks;(uf&&Li(new uf(new ArrayBuffer(1)))!="[object DataView]"||co&&Li(new co)!="[object Map]"||df&&Li(df.resolve())!="[object Promise]"||hf&&Li(new hf)!="[object Set]"||ff&&Li(new ff)!="[object WeakMap]")&&(Li=function(e){var r=Ks(e),n=r=="[object Object]"?e.constructor:void 0,s=n?Ui(n):"";if(s)switch(s){case j5:return"[object DataView]";case D5:return"[object Map]";case B5:return"[object Promise]";case I5:return"[object Set]";case L5:return"[object WeakMap]"}return r});var Jv=Li,Kl="[object Object]",eb=Object.prototype.hasOwnProperty,M5=function(e,r,n,s,a,u){var d=Qn(e),o=Qn(r),c=d?"[object Array]":Jv(e),h=o?"[object Array]":Jv(r),m=(c=c=="[object Arguments]"?Kl:c)==Kl,f=(h=h=="[object Arguments]"?Kl:h)==Kl,v=c==h;if(v&&cf(e)){if(!cf(r))return!1;d=!0,m=!1}if(v&&!m)return u||(u=new ac),d||z_(e)?I_(e,r,n,s,a,u):c5(e,r,c,n,s,a,u);if(!(1&n)){var w=m&&eb.call(e,"__wrapped__"),A=f&&eb.call(r,"__wrapped__");if(w||A){var b=w?e.value():e,y=A?r.value():r;return u||(u=new ac),a(b,y,n,s,u)}}return!!v&&(u||(u=new ac),R5(e,r,n,s,a,u))},Dc=function e(r,n,s,a,u){return r===n||(r==null||n==null||!qs(r)&&!qs(n)?r!=r&&n!=n:M5(r,n,s,a,e,u))},O5=function(e,r,n,s){var a=n.length,u=a;if(e==null)return!u;for(e=Object(e);a--;){var d=n[a];if(d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++a<u;){var o=(d=n[a])[0],c=e[o],h=d[1];if(d[2]){if(c===void 0&&!(o in e))return!1}else{var m=new ac,f;if(!(f===void 0?Dc(h,c,3,s,m):f))return!1}}return!0},F_=function(e){return e==e&&!Zf(e)},z5=function(e){for(var r=np(e),n=r.length;n--;){var s=r[n],a=e[s];r[n]=[s,a,F_(a)]}return r},P_=function(e,r){return function(n){return n!=null&&n[e]===r&&(r!==void 0||e in Object(n))}},F5=function(e){var r=z5(e);return r.length==1&&r[0][2]?P_(r[0][0],r[0][1]):function(n){return n===e||O5(n,e,r)}},rp=function(e){return typeof e=="symbol"||qs(e)&&Ks(e)=="[object Symbol]"},P5=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H5=/^\w*$/,ip=function(e,r){if(Qn(e))return!1;var n=typeof e;return!(n!="number"&&n!="symbol"&&n!="boolean"&&e!=null&&!rp(e))||H5.test(e)||!P5.test(e)||r!=null&&e in Object(r)};function sp(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError("Expected a function");var n=function(){var s=arguments,a=r?r.apply(this,s):s[0],u=n.cache;if(u.has(a))return u.get(a);var d=e.apply(this,s);return n.cache=u.set(a,d)||u,d};return n.cache=new(sp.Cache||jc),n}sp.Cache=jc;var U5=sp,$5=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,q5=/\\(\\)?/g,Q5=(function(e){var r=U5(e,(function(s){return n.size===500&&n.clear(),s})),n=r.cache;return r})((function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace($5,(function(n,s,a,u){r.push(a?u.replace(q5,"$1"):s||n)})),r})),H_=function(e,r){for(var n=-1,s=e==null?0:e.length,a=Array(s);++n<s;)a[n]=r(e[n],n,e);return a},tb=cr?cr.prototype:void 0,nb=tb?tb.toString:void 0,G5=function e(r){if(typeof r=="string")return r;if(Qn(r))return H_(r,e)+"";if(rp(r))return nb?nb.call(r):"";var n=r+"";return n=="0"&&1/r==-1/0?"-0":n},W5=function(e){return e==null?"":G5(e)},U_=function(e,r){return Qn(e)?e:ip(e,r)?[e]:Q5(W5(e))},Bc=function(e){if(typeof e=="string"||rp(e))return e;var r=e+"";return r=="0"&&1/e==-1/0?"-0":r},$_=function(e,r){for(var n=0,s=(r=U_(r,e)).length;e!=null&&n<s;)e=e[Bc(r[n++])];return n&&n==s?e:void 0},K5=function(e,r,n){var s=e==null?void 0:$_(e,r);return s===void 0?n:s},V5=function(e,r){return e!=null&&r in Object(e)},X5=function(e,r,n){for(var s=-1,a=(r=U_(r,e)).length,u=!1;++s<a;){var d=Bc(r[s]);if(!(u=e!=null&&n(e,d)))break;e=e[d]}return u||++s!=a?u:!!(a=e==null?0:e.length)&&ep(a)&&O_(d,a)&&(Qn(e)||Jf(e))},Y5=function(e,r){return e!=null&&X5(e,r,V5)},Z5=function(e,r){return ip(e)&&F_(r)?P_(Bc(e),r):function(n){var s=K5(n,e);return s===void 0&&s===r?Y5(n,e):Dc(r,s,3)}},J5=function(e){return e},eB=function(e){return function(r){return r==null?void 0:r[e]}},tB=function(e){return function(r){return $_(r,e)}},nB=function(e){return ip(e)?eB(Bc(e)):tB(e)},ap=function(e){return typeof e=="function"?e:e==null?J5:typeof e=="object"?Qn(e)?Z5(e[0],e[1]):F5(e):nB(e)};function ui(e){if(!e)throw new Error("change is not provided");if($s(e))return"N".concat(e.oldLineNumber);var r=Ws(e)?"I":"D";return"".concat(r).concat(e.lineNumber)}Yf("old");var Ic=lo("old"),Lc=lo("new");T_("old");T_("new");Yf("new");Yf("old");var rb=(function(){try{var e=$i(Object,"defineProperty");return e({},"",{}),e}catch{}})(),q_=function(e,r,n){r=="__proto__"&&rb?rb(e,r,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[r]=n},rB=function(e){return function(r,n,s){for(var a=-1,u=Object(r),d=s(r),o=d.length;o--;){var c=d[++a];if(n(u[c],c,u)===!1)break}return r}},iB=rB(),Q_=function(e,r){return e&&iB(e,r,np)},G_=function(e,r){var n={};return r=ap(r),Q_(e,(function(s,a,u){q_(n,a,r(s,a,u))})),n},sB=["changeKey","text","tokens","renderToken"],ib=function e(r,n){var s=r.type,a=r.value,u=r.markType,d=r.properties,o=r.className,c=r.children,h=function(f){return g.jsx("span",{className:f,children:a||c&&c.map(e)},n)};switch(s){case"text":return a;case"mark":return h("diff-code-mark diff-code-mark-".concat(u));case"edit":return h("diff-code-edit");default:var m=d&&d.className;return h(jn(o||m))}};function aB(e){if(!Array.isArray(e))return!0;if(e.length>1)return!1;if(e.length===1){var r=Jt(e,1)[0];return r.type==="text"&&!r.value}return!0}function oB(e){var r=e.changeKey,n=e.text,s=e.tokens,a=e.renderToken,u=di(e,sB),d=a?function(o,c){return a(o,ib,c)}:ib;return g.jsx("td",pt(pt({},u),{},{"data-change-key":r,children:s?aB(s)?" ":s.map(d):n||" "}))}var W_=q.memo(oB);function K_(e,r){return function(){var n=r==="old"?Ic(e):Lc(e);return n===-1?void 0:n}}function V_(e,r){return function(n){return e&&n?g.jsx("a",{href:r?"#"+r:void 0,children:n}):n}}function yc(e,r){return r?function(n){e(),r(n)}:e}function sb(e,r,n,s){return q.useMemo((function(){var a=G_(e,(function(u){return function(d){return u&&u(r,d)}}));return a.onMouseEnter=yc(n,a.onMouseEnter),a.onMouseLeave=yc(s,a.onMouseLeave),a}),[e,n,s,r])}function ab(e,r,n,s,a,u,d,o,c){var h={change:r,side:s,inHoverState:o,renderDefault:K_(r,s),wrapInAnchor:V_(a,u)};return g.jsx("td",pt(pt({className:e},d),{},{"data-change-key":n,children:c(h)}))}function lB(e){var r,n,s,a=e.change,u=e.selected,d=e.tokens,o=e.className,c=e.generateLineClassName,h=e.gutterClassName,m=e.codeClassName,f=e.gutterEvents,v=e.codeEvents,w=e.hideGutter,A=e.gutterAnchor,b=e.generateAnchorID,y=e.renderToken,S=e.renderGutter,_=a.type,x=a.content,E=ui(a),N=(r=Jt(q.useState(!1),2),n=r[0],s=r[1],[n,q.useCallback((function(){return s(!0)}),[]),q.useCallback((function(){return s(!1)}),[])]),T=Jt(N,3),j=T[0],R=T[1],D=T[2],L=q.useMemo((function(){return{change:a}}),[a]),z=sb(f,L,R,D),U=sb(v,L,R,D),P=b(a),G=c({changes:[a],defaultGenerate:function(){return o}}),K=jn("diff-gutter","diff-gutter-".concat(_),h,{"diff-gutter-selected":u}),W=jn("diff-code","diff-code-".concat(_),m,{"diff-code-selected":u});return g.jsxs("tr",{id:P,className:jn("diff-line",G),children:[!w&&ab(K,a,E,"old",A,P,z,j,S),!w&&ab(K,a,E,"new",A,P,z,j,S),g.jsx(W_,pt({className:W,changeKey:E,text:x,tokens:d,renderToken:y},U))]})}var cB=q.memo(lB);function uB(e){var r=e.hideGutter,n=e.element;return g.jsx("tr",{className:"diff-widget",children:g.jsx("td",{colSpan:r?1:3,className:"diff-widget-content",children:n})})}var dB=["hideGutter","selectedChanges","tokens","lineClassName"],hB=["hunk","widgets","className"];function fB(e){var r=e.hunk,n=e.widgets,s=e.className,a=di(e,hB),u=(function(d,o){return d.reduce((function(c,h){var m=ui(h);c.push(["change",m,h]);var f=o[m];return f&&c.push(["widget",m,f]),c}),[])})(r.changes,n);return g.jsx("tbody",{className:jn("diff-hunk",s),children:u.map((function(d){return(function(o,c){var h=Jt(o,3),m=h[0],f=h[1],v=h[2],w=c.hideGutter,A=c.selectedChanges,b=c.tokens,y=c.lineClassName,S=di(c,dB);if(m==="change"){var _=lr(v)?"old":"new",x=lr(v)?Ic(v):Lc(v),E=b?b[_][x-1]:null;return g.jsx(cB,pt({className:y,change:v,hideGutter:w,selected:A.includes(f),tokens:E},S),"change".concat(f))}return m==="widget"?g.jsx(uB,{hideGutter:w,element:v},"widget".concat(f)):null})(d,a)}))})}var X_=0;function Vl(e,r,n,s){var a=q.useCallback((function(){return r(e)}),[e,r]),u=q.useCallback((function(){return r("")}),[r]);return q.useMemo((function(){var d=G_(s,(function(o){return function(c){return o&&o({side:e,change:n},c)}}));return d.onMouseEnter=yc(a,d.onMouseEnter),d.onMouseLeave=yc(u,d.onMouseLeave),d}),[n,s,a,e,u])}function Th(e){var r=e.change,n=e.side,s=e.selected,a=e.tokens,u=e.gutterClassName,d=e.codeClassName,o=e.gutterEvents,c=e.codeEvents,h=e.anchorID,m=e.gutterAnchor,f=e.gutterAnchorTarget,v=e.hideGutter,w=e.hover,A=e.renderToken,b=e.renderGutter;if(!r){var y=jn("diff-gutter","diff-gutter-omit",u),S=jn("diff-code","diff-code-omit",d);return[!v&&g.jsx("td",{className:y},"gutter"),g.jsx("td",{className:S},"code")]}var _=r.type,x=r.content,E=ui(r),N=n===X_?"old":"new",T=pt({id:h||void 0,className:jn("diff-gutter","diff-gutter-".concat(_),af({"diff-gutter-selected":s},"diff-line-hover-"+N,w),u),children:b({change:r,side:N,inHoverState:w,renderDefault:K_(r,N),wrapInAnchor:V_(m,f)})},o),j=jn("diff-code","diff-code-".concat(_),af({"diff-code-selected":s},"diff-line-hover-"+N,w),d);return[!v&&g.jsx("td",pt(pt({},T),{},{"data-change-key":E}),"gutter"),g.jsx(W_,pt({className:j,changeKey:E,text:x,tokens:a,renderToken:A},c),"code")]}function pB(e){var r=e.className,n=e.oldChange,s=e.newChange,a=e.oldSelected,u=e.newSelected,d=e.oldTokens,o=e.newTokens,c=e.monotonous,h=e.gutterClassName,m=e.codeClassName,f=e.gutterEvents,v=e.codeEvents,w=e.hideGutter,A=e.generateAnchorID,b=e.generateLineClassName,y=e.gutterAnchor,S=e.renderToken,_=e.renderGutter,x=Jt(q.useState(""),2),E=x[0],N=x[1],T=Vl("old",N,n,f),j=Vl("new",N,s,f),R=Vl("old",N,n,v),D=Vl("new",N,s,v),L=n&&A(n),z=s&&A(s),U=b({changes:[n,s],defaultGenerate:function(){return r}}),P={monotonous:c,hideGutter:w,gutterClassName:h,codeClassName:m,gutterEvents:f,codeEvents:v,renderToken:S,renderGutter:_},G=pt(pt({},P),{},{change:n,side:X_,selected:a,tokens:d,gutterEvents:T,codeEvents:R,anchorID:L,gutterAnchor:y,gutterAnchorTarget:L,hover:E==="old"}),K=pt(pt({},P),{},{change:s,side:1,selected:u,tokens:o,gutterEvents:j,codeEvents:D,anchorID:n===s?null:z,gutterAnchor:y,gutterAnchorTarget:n===s?L:z,hover:E==="new"});if(c)return g.jsx("tr",{className:jn("diff-line",U),children:Th(n?G:K)});var W=(function(Y,ne){return Y&&!ne?"diff-line-old-only":!Y&&ne?"diff-line-new-only":Y===ne?"diff-line-normal":"diff-line-compare"})(n,s);return g.jsxs("tr",{className:jn("diff-line",W,U),children:[Th(G),Th(K)]})}var gB=q.memo(pB);function mB(e){var r=e.hideGutter,n=e.oldElement,s=e.newElement;return e.monotonous?g.jsx("tr",{className:"diff-widget",children:g.jsx("td",{colSpan:r?1:2,className:"diff-widget-content",children:n||s})}):n===s?g.jsx("tr",{className:"diff-widget",children:g.jsx("td",{colSpan:r?2:4,className:"diff-widget-content",children:n})}):g.jsxs("tr",{className:"diff-widget",children:[g.jsx("td",{colSpan:r?1:2,className:"diff-widget-content",children:n}),g.jsx("td",{colSpan:r?1:2,className:"diff-widget-content",children:s})]})}var yB=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],vB=["hunk","widgets","className"];function Xl(e,r){return(e?ui(e):"00")+(r?ui(r):"00")}function bB(e){var r=e.hunk,n=e.widgets,s=e.className,a=di(e,vB),u=(function(d,o){for(var c=function(S){if(!S)return null;var _=ui(S);return o[_]||null},h=[],m=0;m<d.length;m++){var f=d[m];if($s(f))h.push(["change",Xl(f,f),f,f]);else if(lr(f)){var v=d[m+1];v&&Ws(v)?(m+=1,h.push(["change",Xl(f,v),f,v])):h.push(["change",Xl(f,null),f,null])}else h.push(["change",Xl(null,f),null,f]);var w=h[h.length-1],A=c(w[2]),b=c(w[3]);if(A||b){var y=w[1];h.push(["widget",y,A,b])}}return h})(r.changes,n);return g.jsx("tbody",{className:jn("diff-hunk",s),children:u.map((function(d){return(function(o,c){var h=Jt(o,4),m=h[0],f=h[1],v=h[2],w=h[3],A=c.selectedChanges,b=c.monotonous,y=c.hideGutter,S=c.tokens,_=c.lineClassName,x=di(c,yB);if(m==="change"){var E=!!v&&A.includes(ui(v)),N=!!w&&A.includes(ui(w)),T=v&&S?S.old[Ic(v)-1]:null,j=w&&S?S.new[Lc(w)-1]:null;return g.jsx(gB,pt({className:_,oldChange:v,newChange:w,monotonous:b,hideGutter:y,oldSelected:E,newSelected:N,oldTokens:T,newTokens:j},x),"change".concat(f))}return m==="widget"?g.jsx(mB,{monotonous:b,hideGutter:y,oldElement:v,newElement:w},"widget".concat(f)):null})(d,a)}))})}var xB=["gutterType","hunkClassName"];function Y_(e){var r=e.hunk,n=cD(),s=n.gutterType,a=n.hunkClassName,u=di(n,xB),d=s==="none",o=s==="anchor",c=u.viewType==="unified"?fB:bB;return g.jsx(c,pt(pt({},u),{},{hunk:r,hideGutter:d,gutterAnchor:o,className:a}))}function _B(){}function ob(e,r){var n=r?"auto":"none";e instanceof HTMLElement&&e.style.userSelect!==n&&(e.style.userSelect=n)}function SB(e){return e.map((function(r){return g.jsx(Y_,{hunk:r},(function(n){return"-".concat(n.oldStart,",").concat(n.oldLines," +").concat(n.newStart,",").concat(n.newLines)})(r))}))}function wB(e){var r=e.diffType,n=e.hunks,s=e.optimizeSelection,a=e.className,u=e.hunkClassName,d=u===void 0?xn.hunkClassName:u,o=e.lineClassName,c=o===void 0?xn.lineClassName:o,h=e.generateLineClassName,m=h===void 0?xn.generateLineClassName:h,f=e.gutterClassName,v=f===void 0?xn.gutterClassName:f,w=e.codeClassName,A=w===void 0?xn.codeClassName:w,b=e.gutterType,y=b===void 0?xn.gutterType:b,S=e.viewType,_=S===void 0?xn.viewType:S,x=e.gutterEvents,E=x===void 0?xn.gutterEvents:x,N=e.codeEvents,T=N===void 0?xn.codeEvents:N,j=e.generateAnchorID,R=j===void 0?xn.generateAnchorID:j,D=e.selectedChanges,L=D===void 0?xn.selectedChanges:D,z=e.widgets,U=z===void 0?xn.widgets:z,P=e.renderGutter,G=P===void 0?xn.renderGutter:P,K=e.tokens,W=e.renderToken,Y=e.children,ne=Y===void 0?SB:Y,F=q.useRef(null),B=q.useCallback((function(pe){var X=pe.target;if(pe.button===0){var $=(function(Le,Me){for(var Pe=Le;Pe&&Pe!==document.documentElement&&!Pe.classList.contains(Me);)Pe=Pe.parentElement;return Pe===document.documentElement?null:Pe})(X,"diff-code");if($&&$.parentElement){var se=window.getSelection();se&&se.removeAllRanges();var le=Hs($.parentElement.children).indexOf($);if(le===1||le===3){var te,ue=Xf(F.current?F.current.querySelectorAll(".diff-line"):[]);try{for(ue.s();!(te=ue.n()).done;){var Ae=te.value.children;ob(Ae[1],le===1),ob(Ae[3],le===3)}}catch(Le){ue.e(Le)}finally{ue.f()}}}}}),[]),O=y==="none",Q=r==="add"||r==="delete",M=_==="split"&&!Q&&s?B:_B,J=q.useMemo((function(){return g.jsxs("colgroup",_==="unified"?{children:[!O&&g.jsx("col",{className:"diff-gutter-col"}),!O&&g.jsx("col",{className:"diff-gutter-col"}),g.jsx("col",{})]}:Q?{children:[!O&&g.jsx("col",{className:"diff-gutter-col"}),g.jsx("col",{})]}:{children:[!O&&g.jsx("col",{className:"diff-gutter-col"}),g.jsx("col",{}),!O&&g.jsx("col",{className:"diff-gutter-col"}),g.jsx("col",{})]})}),[_,Q,O]),de=q.useMemo((function(){return{hunkClassName:d,lineClassName:c,generateLineClassName:m,gutterClassName:v,codeClassName:A,monotonous:Q,hideGutter:O,viewType:_,gutterType:y,codeEvents:T,gutterEvents:E,generateAnchorID:R,selectedChanges:L,widgets:U,renderGutter:G,tokens:K,renderToken:W}}),[A,T,R,v,E,y,O,d,c,m,Q,G,W,L,K,_,U]);return g.jsx(lD,{value:de,children:g.jsxs("table",{ref:F,className:jn("diff","diff-".concat(_),a),onMouseDown:M,children:[J,ne(n)]})})}var AB=q.memo(wB),CB=function(e,r,n,s){for(var a=-1,u=e==null?0:e.length;++a<u;){var d=e[a];r(s,d,n(d),e)}return s},EB=function(e,r){return function(n,s){if(n==null)return n;if(!tp(n))return e(n,s);for(var a=n.length,u=-1,d=Object(n);++u<a&&s(d[u],u,d)!==!1;);return n}},Z_=EB(Q_),kB=function(e,r,n,s){return Z_(e,(function(a,u,d){r(s,a,n(a),d)})),s},NB=function(e,r){return function(n,s){var a=Qn(n)?CB:kB,u=r?r():{};return a(n,e,ap(s),u)}},TB=NB((function(e,r,n){q_(e,n,r)})),lb=cr?cr.isConcatSpreadable:void 0,RB=function(e){return Qn(e)||Jf(e)||!!(lb&&e&&e[lb])},jB=function(r,n,s,a,u){var d=-1,o=r.length;for(s||(s=RB),u||(u=[]);++d<o;){var c=r[d];s(c)?L_(u,c):u[u.length]=c}return u},DB=function(e,r){var n=-1,s=tp(e)?Array(e.length):[];return Z_(e,(function(a,u,d){s[++n]=r(a,u,d)})),s},BB=function(e,r){return(Qn(e)?H_:DB)(e,ap(r))},IB=function(e,r){return jB(BB(e,r))};function LB(e,r){var n=r.newStart,s=r.changes.reduce((function(a,u){var d=Jt(a,2),o=d[0],c=d[1];return lr(u)?(o.splice(c,1),[o,c]):(Ws(u)&&o.splice(c,0,u.content),[o,c+1])}),[e,n-1]);return Jt(s,1)[0]}function cb(e,r,n){if(!e.length)return[];var s=r==="old"?Ic:Lc,a=TB(e,s),u=s(e[e.length-1]);return Array.from({length:u}).map((function(d,o){return n(a[o+1])}))}function MB(e){var r=(function(d){return IB(d,(function(o){return o.changes})).reduce((function(o,c){var h=Jt(o,2),m=h[0],f=h[1];return $s(c)?(m.push(c),f.push(c)):lr(c)?m.push(c):f.push(c),[m,f]}),[[],[]])})(e),n=Jt(r,2),s=n[0],a=n[1],u=function(d){return d?d.content:""};return[cb(s,"old",u).join(`
|
|
346
|
+
`),cb(a,"new",u).join(`
|
|
347
|
+
`)]}function Yl(e){return{type:"root",children:e}}function OB(e,r){if(r.oldSource){var n=(function(c,h){return h.reduce(LB,c.split(`
|
|
348
|
+
`)).join(`
|
|
349
|
+
`)})(r.oldSource,e),s=r.highlight?function(c){return r.refractor.highlight(c,r.language)}:function(c){return[{type:"text",value:c}]};return[Yl(s(r.oldSource)),Yl(s(n))]}var a=Jt(MB(e),2),u=a[0],d=a[1],o=r.highlight?function(c){return Yl(r.refractor.highlight(c,r.language))}:function(c){return Yl([{type:"text",value:c}])};return[o(u),o(d)]}function J_(e){return e.map((function(r){return pt({},r)}))}function zB(e,r){return[].concat(Hs(J_(e.slice(0,-1))),[r])}function FB(e){return e.type==="text"}function PB(e){var r=e[e.length-1];if(FB(r))return r;throw new Error("Invalid token path with leaf of type ".concat(r.type))}var HB=["children"];function e1(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var s=e.children,a=di(e,HB);n.push(a);var u,d=Xf(s);try{for(d.s();!(u=d.n()).done;)e1(u.value,r,n)}catch(o){d.e(o)}finally{d.f()}n.pop()}else r.push(J_([].concat(Hs(n.slice(1)),[e])));return r}function UB(e){return e.reduce((function(r,n){var s=r[r.length-1],a=(function(c){var h=PB(c);return h.value.includes(`
|
|
350
|
+
`)?h.value.split(`
|
|
351
|
+
`).map((function(m){return zB(c,pt(pt({},h),{},{value:m}))})):[c]})(n),u=oD(a),d=u[0],o=u.slice(1);return[].concat(Hs(r.slice(0,-1)),[[].concat(Hs(s),[d])],Hs(o.map((function(c){return[c]}))))}),[[]])}function ub(e){return UB(e1(e))}var $B=function(e,r,n){var s=(n=typeof n=="function"?n:void 0)?n(e,r):void 0;return s===void 0?Dc(e,r,void 0,n):!!s},qB=function(e,r){return Dc(e,r)},QB=function(e){var r=e==null?0:e.length;return r?e[r-1]:void 0};function GB(e,r){if(!e.children)throw new Error("parent node missing children property");var n,s,a=QB(e.children);return a&&(s=r,(n=a).type===s.type&&(n.type==="text"||n.children&&s.children&&$B(n,s,(function(u,d,o){return o==="chlidren"||qB(u,d)}))))?e.children[e.children.length-1]=(function(u,d){return"value"in u&&"value"in d?pt(pt({},u),{},{value:"".concat(u.value).concat(d.value)}):u})(a,r):e.children.push(r),e.children[e.children.length-1]}function db(e){var r,n={type:"root",children:[]},s=Xf(e);try{var a=function(){var u=r.value;u.reduce((function(d,o,c){return GB(d,c===u.length-1?pt({},o):pt(pt({},o),{},{children:[]}))}),n)};for(s.s();!(r=s.n()).done;)a()}catch(u){s.e(u)}finally{s.f()}return n}var op=bo((function(e){var r=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32};r.Diff=function(n,s){return[n,s]},r.prototype.diff_main=function(n,s,a,u){u===void 0&&(u=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+1e3*this.Diff_Timeout);var d=u;if(n==null||s==null)throw new Error("Null input. (diff_main)");if(n==s)return n?[new r.Diff(0,n)]:[];a===void 0&&(a=!0);var o=a,c=this.diff_commonPrefix(n,s),h=n.substring(0,c);n=n.substring(c),s=s.substring(c),c=this.diff_commonSuffix(n,s);var m=n.substring(n.length-c);n=n.substring(0,n.length-c),s=s.substring(0,s.length-c);var f=this.diff_compute_(n,s,o,d);return h&&f.unshift(new r.Diff(0,h)),m&&f.push(new r.Diff(0,m)),this.diff_cleanupMerge(f),f},r.prototype.diff_compute_=function(n,s,a,u){var d;if(!n)return[new r.Diff(1,s)];if(!s)return[new r.Diff(-1,n)];var o=n.length>s.length?n:s,c=n.length>s.length?s:n,h=o.indexOf(c);if(h!=-1)return d=[new r.Diff(1,o.substring(0,h)),new r.Diff(0,c),new r.Diff(1,o.substring(h+c.length))],n.length>s.length&&(d[0][0]=d[2][0]=-1),d;if(c.length==1)return[new r.Diff(-1,n),new r.Diff(1,s)];var m=this.diff_halfMatch_(n,s);if(m){var f=m[0],v=m[1],w=m[2],A=m[3],b=m[4],y=this.diff_main(f,w,a,u),S=this.diff_main(v,A,a,u);return y.concat([new r.Diff(0,b)],S)}return a&&n.length>100&&s.length>100?this.diff_lineMode_(n,s,u):this.diff_bisect_(n,s,u)},r.prototype.diff_lineMode_=function(n,s,a){var u=this.diff_linesToChars_(n,s);n=u.chars1,s=u.chars2;var d=u.lineArray,o=this.diff_main(n,s,!1,a);this.diff_charsToLines_(o,d),this.diff_cleanupSemantic(o),o.push(new r.Diff(0,""));for(var c=0,h=0,m=0,f="",v="";c<o.length;){switch(o[c][0]){case 1:m++,v+=o[c][1];break;case-1:h++,f+=o[c][1];break;case 0:if(h>=1&&m>=1){o.splice(c-h-m,h+m),c=c-h-m;for(var w=this.diff_main(f,v,!1,a),A=w.length-1;A>=0;A--)o.splice(c,0,w[A]);c+=w.length}m=0,h=0,f="",v=""}c++}return o.pop(),o},r.prototype.diff_bisect_=function(n,s,a){for(var u=n.length,d=s.length,o=Math.ceil((u+d)/2),c=o,h=2*o,m=new Array(h),f=new Array(h),v=0;v<h;v++)m[v]=-1,f[v]=-1;m[c+1]=0,f[c+1]=0;for(var w=u-d,A=w%2!=0,b=0,y=0,S=0,_=0,x=0;x<o&&!(new Date().getTime()>a);x++){for(var E=-x+b;E<=x-y;E+=2){for(var N=c+E,T=(z=E==-x||E!=x&&m[N-1]<m[N+1]?m[N+1]:m[N-1]+1)-E;z<u&&T<d&&n.charAt(z)==s.charAt(T);)z++,T++;if(m[N]=z,z>u)y+=2;else if(T>d)b+=2;else if(A&&(D=c+w-E)>=0&&D<h&&f[D]!=-1&&z>=(R=u-f[D]))return this.diff_bisectSplit_(n,s,z,T,a)}for(var j=-x+S;j<=x-_;j+=2){for(var R,D=c+j,L=(R=j==-x||j!=x&&f[D-1]<f[D+1]?f[D+1]:f[D-1]+1)-j;R<u&&L<d&&n.charAt(u-R-1)==s.charAt(d-L-1);)R++,L++;if(f[D]=R,R>u)_+=2;else if(L>d)S+=2;else if(!A&&(N=c+w-j)>=0&&N<h&&m[N]!=-1){var z;if(T=c+(z=m[N])-N,z>=(R=u-R))return this.diff_bisectSplit_(n,s,z,T,a)}}}return[new r.Diff(-1,n),new r.Diff(1,s)]},r.prototype.diff_bisectSplit_=function(n,s,a,u,d){var o=n.substring(0,a),c=s.substring(0,u),h=n.substring(a),m=s.substring(u),f=this.diff_main(o,c,!1,d),v=this.diff_main(h,m,!1,d);return f.concat(v)},r.prototype.diff_linesToChars_=function(n,s){var a=[],u={};function d(h){for(var m="",f=0,v=-1,w=a.length;v<h.length-1;){(v=h.indexOf(`
|
|
352
|
+
`,f))==-1&&(v=h.length-1);var A=h.substring(f,v+1);(u.hasOwnProperty?u.hasOwnProperty(A):u[A]!==void 0)?m+=String.fromCharCode(u[A]):(w==o&&(A=h.substring(f),v=h.length),m+=String.fromCharCode(w),u[A]=w,a[w++]=A),f=v+1}return m}a[0]="";var o=4e4,c=d(n);return o=65535,{chars1:c,chars2:d(s),lineArray:a}},r.prototype.diff_charsToLines_=function(n,s){for(var a=0;a<n.length;a++){for(var u=n[a][1],d=[],o=0;o<u.length;o++)d[o]=s[u.charCodeAt(o)];n[a][1]=d.join("")}},r.prototype.diff_commonPrefix=function(n,s){if(!n||!s||n.charAt(0)!=s.charAt(0))return 0;for(var a=0,u=Math.min(n.length,s.length),d=u,o=0;a<d;)n.substring(o,d)==s.substring(o,d)?o=a=d:u=d,d=Math.floor((u-a)/2+a);return d},r.prototype.diff_commonSuffix=function(n,s){if(!n||!s||n.charAt(n.length-1)!=s.charAt(s.length-1))return 0;for(var a=0,u=Math.min(n.length,s.length),d=u,o=0;a<d;)n.substring(n.length-d,n.length-o)==s.substring(s.length-d,s.length-o)?o=a=d:u=d,d=Math.floor((u-a)/2+a);return d},r.prototype.diff_commonOverlap_=function(n,s){var a=n.length,u=s.length;if(a==0||u==0)return 0;a>u?n=n.substring(a-u):a<u&&(s=s.substring(0,a));var d=Math.min(a,u);if(n==s)return d;for(var o=0,c=1;;){var h=n.substring(d-c),m=s.indexOf(h);if(m==-1)return o;c+=m,m!=0&&n.substring(d-c)!=s.substring(0,c)||(o=c,c++)}},r.prototype.diff_halfMatch_=function(n,s){if(this.Diff_Timeout<=0)return null;var a=n.length>s.length?n:s,u=n.length>s.length?s:n;if(a.length<4||2*u.length<a.length)return null;var d=this;function o(b,y,S){for(var _,x,E,N,T=b.substring(S,S+Math.floor(b.length/4)),j=-1,R="";(j=y.indexOf(T,j+1))!=-1;){var D=d.diff_commonPrefix(b.substring(S),y.substring(j)),L=d.diff_commonSuffix(b.substring(0,S),y.substring(0,j));R.length<L+D&&(R=y.substring(j-L,j)+y.substring(j,j+D),_=b.substring(0,S-L),x=b.substring(S+D),E=y.substring(0,j-L),N=y.substring(j+D))}return 2*R.length>=b.length?[_,x,E,N,R]:null}var c,h,m,f,v,w=o(a,u,Math.ceil(a.length/4)),A=o(a,u,Math.ceil(a.length/2));return w||A?(c=A?w&&w[4].length>A[4].length?w:A:w,n.length>s.length?(h=c[0],m=c[1],f=c[2],v=c[3]):(f=c[0],v=c[1],h=c[2],m=c[3]),[h,m,f,v,c[4]]):null},r.prototype.diff_cleanupSemantic=function(n){for(var s=!1,a=[],u=0,d=null,o=0,c=0,h=0,m=0,f=0;o<n.length;)n[o][0]==0?(a[u++]=o,c=m,h=f,m=0,f=0,d=n[o][1]):(n[o][0]==1?m+=n[o][1].length:f+=n[o][1].length,d&&d.length<=Math.max(c,h)&&d.length<=Math.max(m,f)&&(n.splice(a[u-1],0,new r.Diff(-1,d)),n[a[u-1]+1][0]=1,u--,o=--u>0?a[u-1]:-1,c=0,h=0,m=0,f=0,d=null,s=!0)),o++;for(s&&this.diff_cleanupMerge(n),this.diff_cleanupSemanticLossless(n),o=1;o<n.length;){if(n[o-1][0]==-1&&n[o][0]==1){var v=n[o-1][1],w=n[o][1],A=this.diff_commonOverlap_(v,w),b=this.diff_commonOverlap_(w,v);A>=b?(A>=v.length/2||A>=w.length/2)&&(n.splice(o,0,new r.Diff(0,w.substring(0,A))),n[o-1][1]=v.substring(0,v.length-A),n[o+1][1]=w.substring(A),o++):(b>=v.length/2||b>=w.length/2)&&(n.splice(o,0,new r.Diff(0,v.substring(0,b))),n[o-1][0]=1,n[o-1][1]=w.substring(0,w.length-b),n[o+1][0]=-1,n[o+1][1]=v.substring(b),o++),o++}o++}},r.prototype.diff_cleanupSemanticLossless=function(n){function s(b,y){if(!b||!y)return 6;var S=b.charAt(b.length-1),_=y.charAt(0),x=S.match(r.nonAlphaNumericRegex_),E=_.match(r.nonAlphaNumericRegex_),N=x&&S.match(r.whitespaceRegex_),T=E&&_.match(r.whitespaceRegex_),j=N&&S.match(r.linebreakRegex_),R=T&&_.match(r.linebreakRegex_),D=j&&b.match(r.blanklineEndRegex_),L=R&&y.match(r.blanklineStartRegex_);return D||L?5:j||R?4:x&&!N&&T?3:N||T?2:x||E?1:0}for(var a=1;a<n.length-1;){if(n[a-1][0]==0&&n[a+1][0]==0){var u=n[a-1][1],d=n[a][1],o=n[a+1][1],c=this.diff_commonSuffix(u,d);if(c){var h=d.substring(d.length-c);u=u.substring(0,u.length-c),d=h+d.substring(0,d.length-c),o=h+o}for(var m=u,f=d,v=o,w=s(u,d)+s(d,o);d.charAt(0)===o.charAt(0);){u+=d.charAt(0),d=d.substring(1)+o.charAt(0),o=o.substring(1);var A=s(u,d)+s(d,o);A>=w&&(w=A,m=u,f=d,v=o)}n[a-1][1]!=m&&(m?n[a-1][1]=m:(n.splice(a-1,1),a--),n[a][1]=f,v?n[a+1][1]=v:(n.splice(a+1,1),a--))}a++}},r.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,r.whitespaceRegex_=/\s/,r.linebreakRegex_=/[\r\n]/,r.blanklineEndRegex_=/\n\r?\n$/,r.blanklineStartRegex_=/^\r?\n\r?\n/,r.prototype.diff_cleanupEfficiency=function(n){for(var s=!1,a=[],u=0,d=null,o=0,c=!1,h=!1,m=!1,f=!1;o<n.length;)n[o][0]==0?(n[o][1].length<this.Diff_EditCost&&(m||f)?(a[u++]=o,c=m,h=f,d=n[o][1]):(u=0,d=null),m=f=!1):(n[o][0]==-1?f=!0:m=!0,d&&(c&&h&&m&&f||d.length<this.Diff_EditCost/2&&c+h+m+f==3)&&(n.splice(a[u-1],0,new r.Diff(-1,d)),n[a[u-1]+1][0]=1,u--,d=null,c&&h?(m=f=!0,u=0):(o=--u>0?a[u-1]:-1,m=f=!1),s=!0)),o++;s&&this.diff_cleanupMerge(n)},r.prototype.diff_cleanupMerge=function(n){n.push(new r.Diff(0,""));for(var s,a=0,u=0,d=0,o="",c="";a<n.length;)switch(n[a][0]){case 1:d++,c+=n[a][1],a++;break;case-1:u++,o+=n[a][1],a++;break;case 0:u+d>1?(u!==0&&d!==0&&((s=this.diff_commonPrefix(c,o))!==0&&(a-u-d>0&&n[a-u-d-1][0]==0?n[a-u-d-1][1]+=c.substring(0,s):(n.splice(0,0,new r.Diff(0,c.substring(0,s))),a++),c=c.substring(s),o=o.substring(s)),(s=this.diff_commonSuffix(c,o))!==0&&(n[a][1]=c.substring(c.length-s)+n[a][1],c=c.substring(0,c.length-s),o=o.substring(0,o.length-s))),a-=u+d,n.splice(a,u+d),o.length&&(n.splice(a,0,new r.Diff(-1,o)),a++),c.length&&(n.splice(a,0,new r.Diff(1,c)),a++),a++):a!==0&&n[a-1][0]==0?(n[a-1][1]+=n[a][1],n.splice(a,1)):a++,d=0,u=0,o="",c=""}n[n.length-1][1]===""&&n.pop();var h=!1;for(a=1;a<n.length-1;)n[a-1][0]==0&&n[a+1][0]==0&&(n[a][1].substring(n[a][1].length-n[a-1][1].length)==n[a-1][1]?(n[a][1]=n[a-1][1]+n[a][1].substring(0,n[a][1].length-n[a-1][1].length),n[a+1][1]=n[a-1][1]+n[a+1][1],n.splice(a-1,1),h=!0):n[a][1].substring(0,n[a+1][1].length)==n[a+1][1]&&(n[a-1][1]+=n[a+1][1],n[a][1]=n[a][1].substring(n[a+1][1].length)+n[a+1][1],n.splice(a+1,1),h=!0)),a++;h&&this.diff_cleanupMerge(n)},r.prototype.diff_xIndex=function(n,s){var a,u=0,d=0,o=0,c=0;for(a=0;a<n.length&&(n[a][0]!==1&&(u+=n[a][1].length),n[a][0]!==-1&&(d+=n[a][1].length),!(u>s));a++)o=u,c=d;return n.length!=a&&n[a][0]===-1?c:c+(s-o)},r.prototype.diff_prettyHtml=function(n){for(var s=[],a=/&/g,u=/</g,d=/>/g,o=/\n/g,c=0;c<n.length;c++){var h=n[c][0],m=n[c][1].replace(a,"&").replace(u,"<").replace(d,">").replace(o,"¶<br>");switch(h){case 1:s[c]='<ins style="background:#e6ffe6;">'+m+"</ins>";break;case-1:s[c]='<del style="background:#ffe6e6;">'+m+"</del>";break;case 0:s[c]="<span>"+m+"</span>"}}return s.join("")},r.prototype.diff_text1=function(n){for(var s=[],a=0;a<n.length;a++)n[a][0]!==1&&(s[a]=n[a][1]);return s.join("")},r.prototype.diff_text2=function(n){for(var s=[],a=0;a<n.length;a++)n[a][0]!==-1&&(s[a]=n[a][1]);return s.join("")},r.prototype.diff_levenshtein=function(n){for(var s=0,a=0,u=0,d=0;d<n.length;d++){var o=n[d][0],c=n[d][1];switch(o){case 1:a+=c.length;break;case-1:u+=c.length;break;case 0:s+=Math.max(a,u),a=0,u=0}}return s+=Math.max(a,u)},r.prototype.diff_toDelta=function(n){for(var s=[],a=0;a<n.length;a++)switch(n[a][0]){case 1:s[a]="+"+encodeURI(n[a][1]);break;case-1:s[a]="-"+n[a][1].length;break;case 0:s[a]="="+n[a][1].length}return s.join(" ").replace(/%20/g," ")},r.prototype.diff_fromDelta=function(n,s){for(var a=[],u=0,d=0,o=s.split(/\t/g),c=0;c<o.length;c++){var h=o[c].substring(1);switch(o[c].charAt(0)){case"+":try{a[u++]=new r.Diff(1,decodeURI(h))}catch{throw new Error("Illegal escape in diff_fromDelta: "+h)}break;case"-":case"=":var m=parseInt(h,10);if(isNaN(m)||m<0)throw new Error("Invalid number in diff_fromDelta: "+h);var f=n.substring(d,d+=m);o[c].charAt(0)=="="?a[u++]=new r.Diff(0,f):a[u++]=new r.Diff(-1,f);break;default:if(o[c])throw new Error("Invalid diff operation in diff_fromDelta: "+o[c])}}if(d!=n.length)throw new Error("Delta length ("+d+") does not equal source text length ("+n.length+").");return a},r.prototype.match_main=function(n,s,a){if(n==null||s==null||a==null)throw new Error("Null input. (match_main)");return a=Math.max(0,Math.min(a,n.length)),n==s?0:n.length?n.substring(a,a+s.length)==s?a:this.match_bitap_(n,s,a):-1},r.prototype.match_bitap_=function(n,s,a){if(s.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var u=this.match_alphabet_(s),d=this;function o(T,j){var R=T/s.length,D=Math.abs(a-j);return d.Match_Distance?R+D/d.Match_Distance:D?1:R}var c=this.Match_Threshold,h=n.indexOf(s,a);h!=-1&&(c=Math.min(o(0,h),c),(h=n.lastIndexOf(s,a+s.length))!=-1&&(c=Math.min(o(0,h),c)));var m,f,v=1<<s.length-1;h=-1;for(var w,A=s.length+n.length,b=0;b<s.length;b++){for(m=0,f=A;m<f;)o(b,a+f)<=c?m=f:A=f,f=Math.floor((A-m)/2+m);A=f;var y=Math.max(1,a-f+1),S=Math.min(a+f,n.length)+s.length,_=Array(S+2);_[S+1]=(1<<b)-1;for(var x=S;x>=y;x--){var E=u[n.charAt(x-1)];if(_[x]=b===0?(_[x+1]<<1|1)&E:(_[x+1]<<1|1)&E|(w[x+1]|w[x])<<1|1|w[x+1],_[x]&v){var N=o(b,x-1);if(N<=c){if(c=N,!((h=x-1)>a))break;y=Math.max(1,2*a-h)}}}if(o(b+1,a)>c)break;w=_}return h},r.prototype.match_alphabet_=function(n){for(var s={},a=0;a<n.length;a++)s[n.charAt(a)]=0;for(a=0;a<n.length;a++)s[n.charAt(a)]|=1<<n.length-a-1;return s},r.prototype.patch_addContext_=function(n,s){if(s.length!=0){if(n.start2===null)throw Error("patch not initialized");for(var a=s.substring(n.start2,n.start2+n.length1),u=0;s.indexOf(a)!=s.lastIndexOf(a)&&a.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)u+=this.Patch_Margin,a=s.substring(n.start2-u,n.start2+n.length1+u);u+=this.Patch_Margin;var d=s.substring(n.start2-u,n.start2);d&&n.diffs.unshift(new r.Diff(0,d));var o=s.substring(n.start2+n.length1,n.start2+n.length1+u);o&&n.diffs.push(new r.Diff(0,o)),n.start1-=d.length,n.start2-=d.length,n.length1+=d.length+o.length,n.length2+=d.length+o.length}},r.prototype.patch_make=function(n,s,a){var u,d;if(typeof n=="string"&&typeof s=="string"&&a===void 0)u=n,(d=this.diff_main(u,s,!0)).length>2&&(this.diff_cleanupSemantic(d),this.diff_cleanupEfficiency(d));else if(n&&typeof n=="object"&&s===void 0&&a===void 0)d=n,u=this.diff_text1(d);else if(typeof n=="string"&&s&&typeof s=="object"&&a===void 0)u=n,d=s;else{if(typeof n!="string"||typeof s!="string"||!a||typeof a!="object")throw new Error("Unknown call format to patch_make.");u=n,d=a}if(d.length===0)return[];for(var o=[],c=new r.patch_obj,h=0,m=0,f=0,v=u,w=u,A=0;A<d.length;A++){var b=d[A][0],y=d[A][1];switch(h||b===0||(c.start1=m,c.start2=f),b){case 1:c.diffs[h++]=d[A],c.length2+=y.length,w=w.substring(0,f)+y+w.substring(f);break;case-1:c.length1+=y.length,c.diffs[h++]=d[A],w=w.substring(0,f)+w.substring(f+y.length);break;case 0:y.length<=2*this.Patch_Margin&&h&&d.length!=A+1?(c.diffs[h++]=d[A],c.length1+=y.length,c.length2+=y.length):y.length>=2*this.Patch_Margin&&h&&(this.patch_addContext_(c,v),o.push(c),c=new r.patch_obj,h=0,v=w,m=f)}b!==1&&(m+=y.length),b!==-1&&(f+=y.length)}return h&&(this.patch_addContext_(c,v),o.push(c)),o},r.prototype.patch_deepCopy=function(n){for(var s=[],a=0;a<n.length;a++){var u=n[a],d=new r.patch_obj;d.diffs=[];for(var o=0;o<u.diffs.length;o++)d.diffs[o]=new r.Diff(u.diffs[o][0],u.diffs[o][1]);d.start1=u.start1,d.start2=u.start2,d.length1=u.length1,d.length2=u.length2,s[a]=d}return s},r.prototype.patch_apply=function(n,s){if(n.length==0)return[s,[]];n=this.patch_deepCopy(n);var a=this.patch_addPadding(n);s=a+s+a,this.patch_splitMax(n);for(var u=0,d=[],o=0;o<n.length;o++){var c,h,m=n[o].start2+u,f=this.diff_text1(n[o].diffs),v=-1;if(f.length>this.Match_MaxBits?(c=this.match_main(s,f.substring(0,this.Match_MaxBits),m))!=-1&&((v=this.match_main(s,f.substring(f.length-this.Match_MaxBits),m+f.length-this.Match_MaxBits))==-1||c>=v)&&(c=-1):c=this.match_main(s,f,m),c==-1)d[o]=!1,u-=n[o].length2-n[o].length1;else if(d[o]=!0,u=c-m,f==(h=v==-1?s.substring(c,c+f.length):s.substring(c,v+this.Match_MaxBits)))s=s.substring(0,c)+this.diff_text2(n[o].diffs)+s.substring(c+f.length);else{var w=this.diff_main(f,h,!1);if(f.length>this.Match_MaxBits&&this.diff_levenshtein(w)/f.length>this.Patch_DeleteThreshold)d[o]=!1;else{this.diff_cleanupSemanticLossless(w);for(var A,b=0,y=0;y<n[o].diffs.length;y++){var S=n[o].diffs[y];S[0]!==0&&(A=this.diff_xIndex(w,b)),S[0]===1?s=s.substring(0,c+A)+S[1]+s.substring(c+A):S[0]===-1&&(s=s.substring(0,c+A)+s.substring(c+this.diff_xIndex(w,b+S[1].length))),S[0]!==-1&&(b+=S[1].length)}}}}return[s=s.substring(a.length,s.length-a.length),d]},r.prototype.patch_addPadding=function(n){for(var s=this.Patch_Margin,a="",u=1;u<=s;u++)a+=String.fromCharCode(u);for(u=0;u<n.length;u++)n[u].start1+=s,n[u].start2+=s;var d=n[0],o=d.diffs;if(o.length==0||o[0][0]!=0)o.unshift(new r.Diff(0,a)),d.start1-=s,d.start2-=s,d.length1+=s,d.length2+=s;else if(s>o[0][1].length){var c=s-o[0][1].length;o[0][1]=a.substring(o[0][1].length)+o[0][1],d.start1-=c,d.start2-=c,d.length1+=c,d.length2+=c}return(o=(d=n[n.length-1]).diffs).length==0||o[o.length-1][0]!=0?(o.push(new r.Diff(0,a)),d.length1+=s,d.length2+=s):s>o[o.length-1][1].length&&(c=s-o[o.length-1][1].length,o[o.length-1][1]+=a.substring(0,c),d.length1+=c,d.length2+=c),a},r.prototype.patch_splitMax=function(n){for(var s=this.Match_MaxBits,a=0;a<n.length;a++)if(!(n[a].length1<=s)){var u=n[a];n.splice(a--,1);for(var d=u.start1,o=u.start2,c="";u.diffs.length!==0;){var h=new r.patch_obj,m=!0;for(h.start1=d-c.length,h.start2=o-c.length,c!==""&&(h.length1=h.length2=c.length,h.diffs.push(new r.Diff(0,c)));u.diffs.length!==0&&h.length1<s-this.Patch_Margin;){var f=u.diffs[0][0],v=u.diffs[0][1];f===1?(h.length2+=v.length,o+=v.length,h.diffs.push(u.diffs.shift()),m=!1):f===-1&&h.diffs.length==1&&h.diffs[0][0]==0&&v.length>2*s?(h.length1+=v.length,d+=v.length,m=!1,h.diffs.push(new r.Diff(f,v)),u.diffs.shift()):(v=v.substring(0,s-h.length1-this.Patch_Margin),h.length1+=v.length,d+=v.length,f===0?(h.length2+=v.length,o+=v.length):m=!1,h.diffs.push(new r.Diff(f,v)),v==u.diffs[0][1]?u.diffs.shift():u.diffs[0][1]=u.diffs[0][1].substring(v.length))}c=(c=this.diff_text2(h.diffs)).substring(c.length-this.Patch_Margin);var w=this.diff_text1(u.diffs).substring(0,this.Patch_Margin);w!==""&&(h.length1+=w.length,h.length2+=w.length,h.diffs.length!==0&&h.diffs[h.diffs.length-1][0]===0?h.diffs[h.diffs.length-1][1]+=w:h.diffs.push(new r.Diff(0,w))),m||n.splice(++a,0,h)}}},r.prototype.patch_toText=function(n){for(var s=[],a=0;a<n.length;a++)s[a]=n[a];return s.join("")},r.prototype.patch_fromText=function(n){var s=[];if(!n)return s;for(var a=n.split(`
|
|
353
|
+
`),u=0,d=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;u<a.length;){var o=a[u].match(d);if(!o)throw new Error("Invalid patch string: "+a[u]);var c=new r.patch_obj;for(s.push(c),c.start1=parseInt(o[1],10),o[2]===""?(c.start1--,c.length1=1):o[2]=="0"?c.length1=0:(c.start1--,c.length1=parseInt(o[2],10)),c.start2=parseInt(o[3],10),o[4]===""?(c.start2--,c.length2=1):o[4]=="0"?c.length2=0:(c.start2--,c.length2=parseInt(o[4],10)),u++;u<a.length;){var h=a[u].charAt(0);try{var m=decodeURI(a[u].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+m)}if(h=="-")c.diffs.push(new r.Diff(-1,m));else if(h=="+")c.diffs.push(new r.Diff(1,m));else if(h==" ")c.diffs.push(new r.Diff(0,m));else{if(h=="@")break;if(h!=="")throw new Error('Invalid patch mode "'+h+'" in: '+m)}u++}}return s},(r.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var n,s=["@@ -"+(this.length1===0?this.start1+",0":this.length1==1?this.start1+1:this.start1+1+","+this.length1)+" +"+(this.length2===0?this.start2+",0":this.length2==1?this.start2+1:this.start2+1+","+this.length2)+` @@
|
|
354
|
+
`],a=0;a<this.diffs.length;a++){switch(this.diffs[a][0]){case 1:n="+";break;case-1:n="-";break;case 0:n=" "}s[a+1]=n+encodeURI(this.diffs[a][1])+`
|
|
355
|
+
`}return s.join("").replace(/%20/g," ")},e.exports=r,e.exports.diff_match_patch=r,e.exports.DIFF_DELETE=-1,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0}));op.DIFF_EQUAL;op.DIFF_DELETE;op.DIFF_INSERT;var WB=["enhancers"],KB=function(e){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.enhancers,a=s===void 0?[]:s,u=Jt(OB(e,di(n,WB)),2),d=u[0],o=u[1],c=[ub(d),ub(o)],h=(r=[c[0],c[1]],a.reduce((function(b,y){return y(b)}),r)),m=Jt(h,2),f=m[0],v=m[1],w=[f.map(db),v.map(db)],A=w[1];return{old:w[0].map((function(b){var y;return(y=b.children)!==null&&y!==void 0?y:[]})),new:A.map((function(b){var y;return(y=b.children)!==null&&y!==void 0?y:[]}))}};const hb=/[#.]/g;function VB(e,r){const n=e||"",s={};let a=0,u,d;for(;a<n.length;){hb.lastIndex=a;const o=hb.exec(n),c=n.slice(a,o?o.index:n.length);c&&(u?u==="#"?s.id=c:Array.isArray(s.className)?s.className.push(c):s.className=[c]:d=c,a+=c.length),o&&(u=o[0],a++)}return{type:"element",tagName:d||r||"div",properties:s,children:[]}}function t1(e,r,n){const s=n?JB(n):void 0;function a(u,d,...o){let c;if(u==null){c={type:"root",children:[]};const h=d;o.unshift(h)}else{c=VB(u,r);const h=c.tagName.toLowerCase(),m=s?s.get(h):void 0;if(c.tagName=m||h,XB(d))o.unshift(d);else for(const[f,v]of Object.entries(d))YB(e,c.properties,f,v)}for(const h of o)pf(c.children,h);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return a}function XB(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const r=e,n=Object.keys(e);for(const s of n){const a=r[s];if(a&&typeof a=="object"){if(!Array.isArray(a))return!0;const u=a;for(const d of u)if(typeof d!="number"&&typeof d!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function YB(e,r,n,s){const a=Ax(e,n);let u;if(s!=null){if(typeof s=="number"){if(Number.isNaN(s))return;u=s}else typeof s=="boolean"?u=s:typeof s=="string"?a.spaceSeparated?u=tv(s):a.commaSeparated?u=Xy(s):a.commaOrSpaceSeparated?u=tv(Xy(s).join(" ")):u=fb(a,a.property,s):Array.isArray(s)?u=[...s]:u=a.property==="style"?ZB(s):String(s);if(Array.isArray(u)){const d=[];for(const o of u)d.push(fb(a,a.property,o));u=d}a.property==="className"&&Array.isArray(r.className)&&(u=r.className.concat(u)),r[a.property]=u}}function pf(e,r){if(r!=null)if(typeof r=="number"||typeof r=="string")e.push({type:"text",value:String(r)});else if(Array.isArray(r))for(const n of r)pf(e,n);else if(typeof r=="object"&&"type"in r)r.type==="root"?pf(e,r.children):e.push(r);else throw new Error("Expected node, nodes, or string, got `"+r+"`")}function fb(e,r,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||io(n)===io(r)))return!0}return n}function ZB(e){const r=[];for(const[n,s]of Object.entries(e))r.push([n,s].join(": "));return r.join("; ")}function JB(e){const r=new Map;for(const n of e)r.set(n.toLowerCase(),n);return r}const eI=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],tI=t1(Cx,"div");t1(_c,"g",eI);const nI=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],pb={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function n1(e){const r=typeof e=="string"?e.charCodeAt(0):e;return r>=48&&r<=57}function rI(e){const r=typeof e=="string"?e.charCodeAt(0):e;return r>=97&&r<=102||r>=65&&r<=70||r>=48&&r<=57}function iI(e){const r=typeof e=="string"?e.charCodeAt(0):e;return r>=97&&r<=122||r>=65&&r<=90}function gb(e){return iI(e)||n1(e)}const sI=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function aI(e,r){const n={},s=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,a=[];let u=0,d=-1,o="",c,h;n.position&&("start"in n.position||"indent"in n.position?(h=n.position.indent,c=n.position.start):c=n.position);let m=(c?c.line:0)||1,f=(c?c.column:0)||1,v=A(),w;for(u--;++u<=e.length;)if(w===10&&(f=(h?h[d]:0)||1),w=e.charCodeAt(u),w===38){const S=e.charCodeAt(u+1);if(S===9||S===10||S===12||S===32||S===38||S===60||Number.isNaN(S)||s&&S===s){o+=String.fromCharCode(w),f++;continue}const _=u+1;let x=_,E=_,N;if(S===35){E=++x;const P=e.charCodeAt(E);P===88||P===120?(N="hexadecimal",E=++x):N="decimal"}else N="named";let T="",j="",R="";const D=N==="named"?gb:N==="decimal"?n1:rI;for(E--;++E<=e.length;){const P=e.charCodeAt(E);if(!D(P))break;R+=String.fromCharCode(P),N==="named"&&nI.includes(R)&&(T=R,j=ao(R))}let L=e.charCodeAt(E)===59;if(L){E++;const P=N==="named"?ao(R):!1;P&&(T=R,j=P)}let z=1+E-_,U="";if(!(!L&&n.nonTerminated===!1))if(!R)N!=="named"&&b(4,z);else if(N==="named"){if(L&&!j)b(5,1);else if(T!==R&&(E=x+T.length,z=1+E-x,L=!1),!L){const P=T?1:3;if(n.attribute){const G=e.charCodeAt(E);G===61?(b(P,z),j=""):gb(G)?j="":b(P,z)}else b(P,z)}U=j}else{L||b(2,z);let P=Number.parseInt(R,N==="hexadecimal"?16:10);if(oI(P))b(7,z),U="�";else if(P in pb)b(6,z),U=pb[P];else{let G="";lI(P)&&b(6,z),P>65535&&(P-=65536,G+=String.fromCharCode(P>>>10|55296),P=56320|P&1023),U=G+String.fromCharCode(P)}}if(U){y(),v=A(),u=E-1,f+=E-_+1,a.push(U);const P=A();P.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,U,{start:v,end:P},e.slice(_-1,E)),v=P}else R=e.slice(_-1,E),o+=R,f+=R.length,u=E-1}else w===10&&(m++,d++,f=0),Number.isNaN(w)?y():(o+=String.fromCharCode(w),f++);return a.join("");function A(){return{line:m,column:f,offset:u+((c?c.offset:0)||0)}}function b(S,_){let x;n.warning&&(x=A(),x.column+=_,x.offset+=_,n.warning.call(n.warningContext||void 0,sI[S],x,S))}function y(){o&&(a.push(o),n.text&&n.text.call(n.textContext||void 0,o,{start:v,end:A()}),o="")}}function oI(e){return e>=55296&&e<=57343||e>1114111}function lI(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var cI=0,Zl={},Yt={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++cI}),e.__id},clone:function e(r,n){n=n||{};var s,a;switch(Yt.util.type(r)){case"Object":if(a=Yt.util.objId(r),n[a])return n[a];s={},n[a]=s;for(var u in r)r.hasOwnProperty(u)&&(s[u]=e(r[u],n));return s;case"Array":return a=Yt.util.objId(r),n[a]?n[a]:(s=[],n[a]=s,r.forEach(function(d,o){s[o]=e(d,n)}),s);default:return r}}},languages:{plain:Zl,plaintext:Zl,text:Zl,txt:Zl,extend:function(e,r){var n=Yt.util.clone(Yt.languages[e]);for(var s in r)n[s]=r[s];return n},insertBefore:function(e,r,n,s){s=s||Yt.languages;var a=s[e],u={};for(var d in a)if(a.hasOwnProperty(d)){if(d==r)for(var o in n)n.hasOwnProperty(o)&&(u[o]=n[o]);n.hasOwnProperty(d)||(u[d]=a[d])}var c=s[e];return s[e]=u,Yt.languages.DFS(Yt.languages,function(h,m){m===c&&h!=e&&(this[h]=u)}),u},DFS:function e(r,n,s,a){a=a||{};var u=Yt.util.objId;for(var d in r)if(r.hasOwnProperty(d)){n.call(r,d,r[d],s||d);var o=r[d],c=Yt.util.type(o);c==="Object"&&!a[u(o)]?(a[u(o)]=!0,e(o,n,null,a)):c==="Array"&&!a[u(o)]&&(a[u(o)]=!0,e(o,n,d,a))}}},plugins:{},highlight:function(e,r,n){var s={code:e,grammar:r,language:n};if(Yt.hooks.run("before-tokenize",s),!s.grammar)throw new Error('The language "'+s.language+'" has no grammar.');return s.tokens=Yt.tokenize(s.code,s.grammar),Yt.hooks.run("after-tokenize",s),to.stringify(Yt.util.encode(s.tokens),s.language)},tokenize:function(e,r){var n=r.rest;if(n){for(var s in n)r[s]=n[s];delete r.rest}var a=new uI;return lc(a,a.head,e),r1(e,a,r,a.head,0),hI(a)},hooks:{all:{},add:function(e,r){var n=Yt.hooks.all;n[e]=n[e]||[],n[e].push(r)},run:function(e,r){var n=Yt.hooks.all[e];if(!(!n||!n.length))for(var s=0,a;a=n[s++];)a(r)}},Token:to};function to(e,r,n,s){this.type=e,this.content=r,this.alias=n,this.length=(s||"").length|0}function mb(e,r,n,s){e.lastIndex=r;var a=e.exec(n);if(a&&s&&a[1]){var u=a[1].length;a.index+=u,a[0]=a[0].slice(u)}return a}function r1(e,r,n,s,a,u){for(var d in n)if(!(!n.hasOwnProperty(d)||!n[d])){var o=n[d];o=Array.isArray(o)?o:[o];for(var c=0;c<o.length;++c){if(u&&u.cause==d+","+c)return;var h=o[c],m=h.inside,f=!!h.lookbehind,v=!!h.greedy,w=h.alias;if(v&&!h.pattern.global){var A=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,A+"g")}for(var b=h.pattern||h,y=s.next,S=a;y!==r.tail&&!(u&&S>=u.reach);S+=y.value.length,y=y.next){var _=y.value;if(r.length>e.length)return;if(!(_ instanceof to)){var x=1,E;if(v){if(E=mb(b,S,e,f),!E||E.index>=e.length)break;var R=E.index,N=E.index+E[0].length,T=S;for(T+=y.value.length;R>=T;)y=y.next,T+=y.value.length;if(T-=y.value.length,S=T,y.value instanceof to)continue;for(var j=y;j!==r.tail&&(T<N||typeof j.value=="string");j=j.next)x++,T+=j.value.length;x--,_=e.slice(S,T),E.index-=S}else if(E=mb(b,0,_,f),!E)continue;var R=E.index,D=E[0],L=_.slice(0,R),z=_.slice(R+D.length),U=S+_.length;u&&U>u.reach&&(u.reach=U);var P=y.prev;L&&(P=lc(r,P,L),S+=L.length),dI(r,P,x);var G=new to(d,m?Yt.tokenize(D,m):D,w,D);if(y=lc(r,P,G),z&&lc(r,y,z),x>1){var K={cause:d+","+c,reach:U};r1(e,r,n,y.prev,S,K),u&&K.reach>u.reach&&(u.reach=K.reach)}}}}}}function uI(){var e={value:null,prev:null,next:null},r={value:null,prev:e,next:null};e.next=r,this.head=e,this.tail=r,this.length=0}function lc(e,r,n){var s=r.next,a={value:n,prev:r,next:s};return r.next=a,s.prev=a,e.length++,a}function dI(e,r,n){for(var s=r.next,a=0;a<n&&s!==e.tail;a++)s=s.next;r.next=s,s.prev=r,e.length-=a}function hI(e){for(var r=[],n=e.head.next;n!==e.tail;)r.push(n.value),n=n.next;return r}const i1=Yt;function s1(){}s1.prototype=i1;const at=new s1;at.highlight=fI;at.register=pI;at.alias=gI;at.registered=mI;at.listLanguages=yI;at.util.encode=vI;at.Token.stringify=gf;function fI(e,r){if(typeof e!="string")throw new TypeError("Expected `string` for `value`, got `"+e+"`");let n,s;if(r&&typeof r=="object")n=r;else{if(s=r,typeof s!="string")throw new TypeError("Expected `string` for `name`, got `"+s+"`");if(Object.hasOwn(at.languages,s))n=at.languages[s];else throw new Error("Unknown language: `"+s+"` is not registered")}return{type:"root",children:i1.highlight.call(at,e,n,s)}}function pI(e){if(typeof e!="function"||!e.displayName)throw new Error("Expected `function` for `syntax`, got `"+e+"`");Object.hasOwn(at.languages,e.displayName)||e(at)}function gI(e,r){const n=at.languages;let s={};typeof e=="string"?r&&(s[e]=r):s=e;let a;for(a in s)if(Object.hasOwn(s,a)){const u=s[a],d=typeof u=="string"?[u]:u;let o=-1;for(;++o<d.length;)n[d[o]]=n[a]}}function mI(e){if(typeof e!="string")throw new TypeError("Expected `string` for `aliasOrLanguage`, got `"+e+"`");return Object.hasOwn(at.languages,e)}function yI(){const e=at.languages,r=[];let n;for(n in e)Object.hasOwn(e,n)&&typeof e[n]=="object"&&r.push(n);return r}function gf(e,r){if(typeof e=="string")return{type:"text",value:e};if(Array.isArray(e)){const s=[];let a=-1;for(;++a<e.length;)e[a]!==null&&e[a]!==void 0&&e[a]!==""&&s.push(gf(e[a],r));return s}const n={attributes:{},classes:["token",e.type],content:gf(e.content,r),language:r,tag:"span",type:e.type};return e.alias&&n.classes.push(...typeof e.alias=="string"?[e.alias]:e.alias),at.hooks.run("wrap",n),tI(n.tag+"."+n.classes.join("."),bI(n.attributes),n.content)}function vI(e){return e}function bI(e){let r;for(r in e)Object.hasOwn(e,r)&&(e[r]=aI(e[r]));return e}lp.displayName="bash";lp.aliases=["sh","shell"];function lp(e){(function(r){var n="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",s={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},a={bash:s,environment:{pattern:RegExp("\\$"+n),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+n),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};r.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+n),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:a},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:s}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:a},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:a.entity}}],environment:{pattern:RegExp("\\$?"+n),alias:"constant"},variable:a.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},s.inside=r.languages.bash;for(var u=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],d=a.variable[1].inside,o=0;o<u.length;o++)d[u[o]]=r.languages.bash[u[o]];r.languages.sh=r.languages.bash,r.languages.shell=r.languages.bash})(e)}qi.displayName="clike";qi.aliases=[];function qi(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}cp.displayName="c";cp.aliases=[];function cp(e){e.register(qi),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}up.displayName="cpp";up.aliases=[];function up(e){e.register(cp),(function(r){var n=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,s=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return n.source});r.languages.cpp=r.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return n.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:n,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),r.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return s})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),r.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:r.languages.cpp}}}}),r.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),r.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:r.languages.extend("cpp",{})}}),r.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},r.languages.cpp["base-clause"])})(e)}dp.displayName="css";dp.aliases=[];function dp(e){(function(r){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var s=r.languages.markup;s&&(s.tag.addInlined("style","css"),s.tag.addAttribute("style","css"))})(e)}hp.displayName="go";hp.aliases=[];function hp(e){e.register(qi),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}fp.displayName="java";fp.aliases=[];function fp(e){e.register(qi),(function(r){var n=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,s=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,a={pattern:RegExp(/(^|[^\w.])/.source+s+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};r.languages.java=r.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[a,{pattern:RegExp(/(^|[^\w.])/.source+s+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:a.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+s+/[A-Z]\w*\b/.source),lookbehind:!0,inside:a.inside}],keyword:n,function:[r.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),r.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),r.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":a,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+s+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:a.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+s+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:a.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return n.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}xo.displayName="javascript";xo.aliases=["js"];function xo(e){e.register(qi),e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}pp.displayName="json";pp.aliases=["webmanifest"];function pp(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}_o.displayName="markup";_o.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function _o(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(n,s){var a={};a["language-"+s]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[s]},a.cdata=/^<!\[CDATA\[|\]\]>$/i;var u={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:a}};u["language-"+s]={pattern:/[\s\S]+/,inside:e.languages[s]};var d={};d[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:u},e.languages.insertBefore("markup","cdata",d)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(r,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}gp.displayName="markdown";gp.aliases=["md"];function gp(e){e.register(_o),(function(r){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function s(o){return o=o.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var a=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,u=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return a}),d=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;r.languages.markdown=r.languages.extend("markup",{}),r.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:r.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+u+d+"(?:"+u+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+u+d+")(?:"+u+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(a),inside:r.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+u+")"+d+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+u+"$"),inside:{"table-header":{pattern:RegExp(a),alias:"important",inside:r.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:s(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:s(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:s(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:s(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(c){o!==c&&(r.languages.markdown[o].inside.content.inside[c]=r.languages.markdown[c])})}),r.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function c(h){if(!(!h||typeof h=="string"))for(var m=0,f=h.length;m<f;m++){var v=h[m];if(v.type!=="code"){c(v.content);continue}var w=v.content[1],A=v.content[3];if(w&&A&&w.type==="code-language"&&A.type==="code-block"&&typeof w.content=="string"){var b=w.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");b=(/[a-z][\w-]*/i.exec(b)||[""])[0].toLowerCase();var y="language-"+b;A.alias?typeof A.alias=="string"?A.alias=[A.alias,y]:A.alias.push(y):A.alias=[y]}}}c(o.tokens)}),r.hooks.add("wrap",function(o){if(o.type==="code-block"){for(var c="",h=0,m=o.classes.length;h<m;h++){var f=o.classes[h],v=/language-(.+)/.exec(f);if(v){c=v[1];break}}var w=r.languages[c];if(w)o.content=r.highlight(o.content.value,w,c);else if(c&&c!=="none"&&r.plugins.autoloader){var A="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);o.attributes.id=A,r.plugins.autoloader.loadLanguages(c,function(){var b=document.getElementById(A);b&&(b.innerHTML=r.highlight(b.textContent,r.languages[c],c))})}}}),RegExp(r.languages.markup.tag.pattern.source,"gi"),r.languages.md=r.languages.markdown})(e)}mp.displayName="python";mp.aliases=["py"];function mp(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}yp.displayName="ruby";yp.aliases=["rb"];function yp(e){e.register(qi),(function(r){r.languages.ruby=r.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),r.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var n={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:r.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete r.languages.ruby.function;var s="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",a=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;r.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+s+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+a),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+a+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),r.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+s),greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+s),greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete r.languages.ruby.string,r.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),r.languages.rb=r.languages.ruby})(e)}vp.displayName="rust";vp.aliases=[];function vp(e){(function(r){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,s=0;s<2;s++)n=n.replace(/<self>/g,function(){return n});n=n.replace(/<self>/g,function(){return/[^\s\S]/.source}),r.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},r.languages.rust["closure-params"].inside.rest=r.languages.rust,r.languages.rust.attribute.inside.string=r.languages.rust.string})(e)}bp.displayName="sql";bp.aliases=[];function bp(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}xp.displayName="jsx";xp.aliases=[];function xp(e){e.register(xo),e.register(_o),(function(r){var n=r.util.clone(r.languages.javascript),s=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,a=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,u=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function d(h,m){return h=h.replace(/<S>/g,function(){return s}).replace(/<BRACES>/g,function(){return a}).replace(/<SPREAD>/g,function(){return u}),RegExp(h,m)}u=d(u).source,r.languages.jsx=r.languages.extend("markup",n),r.languages.jsx.tag.pattern=d(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),r.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,r.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,r.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,r.languages.jsx.tag.inside.comment=n.comment,r.languages.insertBefore("inside","attr-name",{spread:{pattern:d(/<SPREAD>/.source),inside:r.languages.jsx}},r.languages.jsx.tag),r.languages.insertBefore("inside","special-attr",{script:{pattern:d(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:r.languages.jsx}}},r.languages.jsx.tag);var o=function(h){return h?typeof h=="string"?h:typeof h.content=="string"?h.content:h.content.map(o).join(""):""},c=function(h){for(var m=[],f=0;f<h.length;f++){var v=h[f],w=!1;if(typeof v!="string"&&(v.type==="tag"&&v.content[0]&&v.content[0].type==="tag"?v.content[0].content[0].content==="</"?m.length>0&&m[m.length-1].tagName===o(v.content[0].content[1])&&m.pop():v.content[v.content.length-1].content==="/>"||m.push({tagName:o(v.content[0].content[1]),openedBraces:0}):m.length>0&&v.type==="punctuation"&&v.content==="{"?m[m.length-1].openedBraces++:m.length>0&&m[m.length-1].openedBraces>0&&v.type==="punctuation"&&v.content==="}"?m[m.length-1].openedBraces--:w=!0),(w||typeof v=="string")&&m.length>0&&m[m.length-1].openedBraces===0){var A=o(v);f<h.length-1&&(typeof h[f+1]=="string"||h[f+1].type==="plain-text")&&(A+=o(h[f+1]),h.splice(f+1,1)),f>0&&(typeof h[f-1]=="string"||h[f-1].type==="plain-text")&&(A=o(h[f-1])+A,h.splice(f-1,1),f--),h[f]=new r.Token("plain-text",A,null,A)}v.content&&typeof v.content!="string"&&c(v.content)}};r.hooks.add("after-tokenize",function(h){h.language!=="jsx"&&h.language!=="tsx"||c(h.tokens)})})(e)}Mc.displayName="typescript";Mc.aliases=["ts"];function Mc(e){e.register(xo),(function(r){r.languages.typescript=r.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),r.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete r.languages.typescript.parameter,delete r.languages.typescript["literal-property"];var n=r.languages.extend("typescript",{});delete n["class-name"],r.languages.typescript["class-name"].inside=n,r.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),r.languages.ts=r.languages.typescript})(e)}_p.displayName="tsx";_p.aliases=[];function _p(e){e.register(xp),e.register(Mc),(function(r){var n=r.util.clone(r.languages.typescript);r.languages.tsx=r.languages.extend("jsx",n),delete r.languages.tsx.parameter,delete r.languages.tsx["literal-property"];var s=r.languages.tsx.tag;s.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+s.pattern.source+")",s.pattern.flags),s.lookbehind=!0})(e)}Sp.displayName="yaml";Sp.aliases=["yml"];function Sp(e){(function(r){var n=/[*&][^\s[\]{},]+/,s=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,a="(?:"+s.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+s.source+")?)",u=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),d=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(c,h){h=(h||"").replace(/m/g,"")+"m";var m=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return a}).replace(/<<value>>/g,function(){return c});return RegExp(m,h)}r.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return a})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return a}).replace(/<<key>>/g,function(){return"(?:"+u+"|"+d+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(d),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:s,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},r.languages.yml=r.languages.yaml})(e)}at.register(lp);at.register(up);at.register(dp);at.register(hp);at.register(fp);at.register(xo);at.register(pp);at.register(gp);at.register(_o);at.register(mp);at.register(yp);at.register(vp);at.register(bp);at.register(_p);at.register(Mc);at.register(Sp);const xI=new Set(["bash","cpp","css","go","java","javascript","json","markdown","markup","python","ruby","rust","sql","tsx","typescript","yaml"]),_I={ts:"typescript",tsx:"tsx",js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"tsx",rs:"rust",go:"go",c:"cpp",h:"cpp",cpp:"cpp",cc:"cpp",hpp:"cpp",java:"java",py:"python",rb:"ruby",sh:"bash",bash:"bash",zsh:"bash",json:"json",yaml:"yaml",yml:"yaml",md:"markdown",markdown:"markdown",html:"markup",htm:"markup",xml:"markup",svg:"markup",css:"css",scss:"css",sql:"sql"};function SI(e){if(e===void 0)return;const r=e.lastIndexOf(".");if(r===-1)return;const n=e.slice(r+1).toLowerCase(),s=_I[n];if(!(s===void 0||!xI.has(s)))return s}function wI(e,r){if(r!==void 0)try{return KB(e,{highlight:!0,refractor:at,language:r})}catch{return}}const Rh=800,AI=({change:e,side:r})=>{if(r==="old")return null;const n=e.type==="normal"?e.newLineNumber:e.lineNumber;return n===void 0?null:g.jsx("span",{children:n})},CI=({change:e,side:r})=>{if(e.type==="normal"){const n=r==="old"?e.oldLineNumber:e.newLineNumber;return g.jsx("span",{children:n})}return e.type==="insert"&&r==="new"?g.jsx("span",{children:e.lineNumber}):e.type==="delete"&&r==="old"?g.jsx("span",{children:e.lineNumber}):null};function wp({diff:e,viewType:r="unified"}){let n=[],s="fallback";const a=NI(e);if(a!==void 0){const o=jh(a);Dh(o)&&(n=o,s="pi")}if(s==="fallback"){const o=jh(e);Dh(o)&&(n=o,s="raw")}if(s==="fallback"&&TI(e)){const o=jh(a1+e.replace(/^\n+/,""));Dh(o)&&(n=o,s="synthetic")}if(s==="fallback")return typeof console<"u"&&console.warn("[DiffBlock] parseDiff produced no hunks; rendering colored fallback. Diff prefix:",e.slice(0,200)),g.jsx(RI,{diff:e});const u=r==="split"?CI:AI,d=`pi-diff-block ${r==="split"?"pi-diff-split":"pi-diff-unified"} overflow-auto px-2 pb-2 text-[11px]`;return g.jsx("div",{className:d,children:n.map(o=>g.jsx(EI,{file:o,viewType:r,renderGutter:u},`${o.oldPath??""}:${o.newPath??""}`))})}function EI({file:e,viewType:r,renderGutter:n}){const[s,a]=q.useState(!1),u=(e.newPath??e.oldPath??"").replace(/^[ab]\//,""),d=SI(u),o=e.hunks.reduce((f,v)=>f+v.changes.length,0),c=o>Rh&&!s,h=c?kI(e.hunks,Rh):e.hunks,m=wI(h,d);return g.jsxs(g.Fragment,{children:[g.jsx(AB,{viewType:r,diffType:e.type,hunks:h,renderGutter:n,tokens:m??null,children:f=>f.map(v=>g.jsx(Y_,{hunk:v},v.content))}),c&&g.jsxs("button",{onClick:()=>a(!0),className:"my-1 w-full rounded border border-neutral-700 bg-neutral-900/60 px-3 py-1 text-[11px] text-neutral-300 hover:border-neutral-500 hover:bg-neutral-900",title:`Showing ~${Rh} of ${o} lines — large diffs slow the renderer; click to render the rest.`,children:["Show all (",o," lines, ",e.hunks.length," hunks)"]})]})}function kI(e,r){const n=[];let s=0;for(const a of e)if(n.length>0&&s+a.changes.length>r||(n.push(a),s+=a.changes.length,s>=r))break;return n}const a1=`--- a/file
|
|
356
|
+
+++ b/file
|
|
357
|
+
`;function NI(e){const r=e.split(`
|
|
358
|
+
`),n=/^([+\- ]) *(\d+)(?: (.*))?$/,s=/^ +\.\.\.$/,a=[];let u,d=0;const o=()=>{u!==void 0&&u.body.length>0&&a.push(u),u=void 0};for(const c of r){if(c.length===0)continue;if(s.test(c)){o();continue}const h=n.exec(c);if(h===null)return;d+=1;const m=h[1],f=Number.parseInt(h[2]??"",10),v=h[3]??"";u===void 0&&(u={oldStart:f,newStart:f,oldCount:0,newCount:0,body:[]}),m===" "?(u.body.push(" "+v),u.oldCount+=1,u.newCount+=1):m==="-"?(u.body.push("-"+v),u.oldCount+=1):(u.body.push("+"+v),u.newCount+=1)}if(o(),!(d===0||a.length===0))return a1+a.map(c=>`@@ -${c.oldStart},${c.oldCount} +${c.newStart},${c.newCount} @@
|
|
359
|
+
`+c.body.join(`
|
|
360
|
+
`)).join(`
|
|
361
|
+
`)+`
|
|
362
|
+
`}function jh(e){try{return hD(e)}catch{return[]}}function Dh(e){return e.length>0&&e.some(r=>r.hunks.length>0)}function TI(e){const r=/^@@ /m.test(e),n=/^--- /m.test(e)&&/^\+\+\+ /m.test(e);return r&&!n}function RI({diff:e}){const r=e.split(`
|
|
363
|
+
`);return g.jsx("pre",{className:"overflow-auto px-3 pb-2 font-mono text-[11px] leading-tight",children:r.map((n,s)=>g.jsx("div",{className:jI(n),children:n.length===0?" ":n},s))})}function jI(e){return e.startsWith("+++")||e.startsWith("---")?"text-neutral-500":e.startsWith("@@")?"bg-neutral-900 text-cyan-400":e.startsWith("+")?"bg-emerald-950/60 text-emerald-200":e.startsWith("-")?"bg-red-950/60 text-red-200":"text-neutral-400"}const yb="pi-forge/model/",vb="pi-forge/sessionTree.view";function DI({sessionId:e,projectId:r,onClose:n}){const s=Oe(z=>z.streamingBySession[e]??!1),a=Oe(z=>z.setActiveSession),u=Oe(z=>z.loadSessionsForProject),d=Oe(z=>z.reloadMessages),o=Oe(z=>z.setPendingDraft),c=Oe(z=>z.agentEndCountBySession[e]??0),[h,m]=q.useState(void 0),[f,v]=q.useState(!0),[w,A]=q.useState(void 0),[b,y]=q.useState(!1),[S,_]=q.useState(void 0),x=async()=>{v(!0),A(void 0);try{const z=await be.getSessionTree(e);m(z)}catch(z){A(z instanceof we?z.code:z.message)}finally{v(!1)}};q.useEffect(()=>{x()},[e]),q.useEffect(()=>{c!==0&&x()},[c]);const E=q.useMemo(()=>h===void 0?[]:HI(h),[h]),[N,T]=q.useState(()=>{try{return localStorage.getItem(vb)==="list"?"list":"graph"}catch{return"graph"}}),j=z=>{T(z);try{localStorage.setItem(vb,z)}catch{}},R=z=>{if(b||(h==null?void 0:h.leafId)===z)return;const U=FI(h,z);if(s||U){_({entryId:z,abandonsBranch:U,isStreaming:s});return}D(z,{})},D=async(z,U)=>{y(!0),A(void 0);try{await be.navigateSession(e,z,U),await x(),d(e)}catch(P){A(P instanceof we?P.code:P.message)}finally{y(!1)}},L=async(z,U={})=>{if(!b){y(!0),A(void 0);try{const P=U.parentId!==void 0&&U.parentId!==null?U.parentId:z,G=await be.forkSession(e,P);try{const K=localStorage.getItem(yb+e);K!==null&&K.length>0&&localStorage.setItem(yb+G.sessionId,K)}catch{}U.editDraft!==void 0&&U.editDraft.length>0&&o(G.sessionId,U.editDraft),await u(r),a(G.sessionId),n()}catch(P){A(P instanceof we?P.code:P.message),y(!1)}}};return g.jsxs("div",{className:"fixed inset-0 z-40 flex items-center justify-center bg-black/60 px-4 py-8",onClick:n,children:[g.jsxs("div",{onClick:z=>z.stopPropagation(),className:"flex h-[min(90vh,900px)] w-[min(95vw,1400px)] flex-col overflow-hidden rounded-lg border border-neutral-800 bg-neutral-950 shadow-2xl",children:[g.jsxs("header",{className:"flex items-center justify-between border-b border-neutral-800 px-4 py-2.5",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ho,{size:14,className:"text-neutral-400"}),g.jsx("h2",{className:"text-sm font-semibold text-neutral-100",children:"Session tree"}),b&&g.jsx(fo,{size:11,className:"animate-spin text-neutral-500"})]}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsxs("div",{className:"mr-1 flex overflow-hidden rounded border border-neutral-700",children:[g.jsx("button",{onClick:()=>j("list"),className:`px-2 py-0.5 text-[10px] uppercase tracking-wider ${N==="list"?"bg-neutral-700 text-neutral-100":"text-neutral-400 hover:bg-neutral-800"}`,title:"Vertical list view",children:"List"}),g.jsx("button",{onClick:()=>j("graph"),className:`px-2 py-0.5 text-[10px] uppercase tracking-wider ${N==="graph"?"bg-neutral-700 text-neutral-100":"text-neutral-400 hover:bg-neutral-800"}`,title:"Branching graph view (turn-grouped)",children:"Graph"})]}),g.jsx("button",{onClick:()=>void x(),disabled:f||b,className:"rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200 disabled:opacity-40",title:"Refresh tree",children:g.jsx(po,{size:13,className:f?"animate-spin":""})}),g.jsx("button",{onClick:n,className:"rounded p-2 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200",title:"Close (Esc)",children:g.jsx(Br,{size:20})})]})]}),w!==void 0&&g.jsx("div",{className:"border-b border-red-700/40 bg-red-900/20 px-4 py-1.5 text-xs text-red-300",children:w}),g.jsxs("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:[f&&h===void 0&&g.jsx("div",{className:"px-4 py-6 text-center text-xs italic text-neutral-500",children:"Loading tree…"}),!f&&E.length===0&&g.jsx("div",{className:"px-4 py-6 text-center text-xs italic text-neutral-500",children:"No entries yet."}),N==="list"?g.jsx("ul",{className:"space-y-0.5",children:E.map(z=>g.jsx(zI,{node:z,disabled:b,onNavigate:()=>void R(z.id),onFork:()=>void L(z.id,{...z.type==="message"&&z.role==="user"?{editDraft:z.preview??"",parentId:z.parentId}:{}})},z.id))}):h!==void 0?g.jsx($I,{tree:h,disabled:b,onNavigate:z=>R(z),onForkAfterTurn:z=>void L(z)}):null]}),g.jsxs("footer",{className:"flex items-center justify-between border-t border-neutral-800 bg-neutral-900/40 px-4 py-2 text-[10px] text-neutral-500",children:[g.jsx("span",{children:"Click a row to navigate · fork icon on user messages to branch from that point"}),h!==void 0&&g.jsxs("span",{children:[h.entries.length," ",h.entries.length===1?"entry":"entries"]})]})]}),g.jsx(BI,{state:S,onCancel:()=>_(void 0),onConfirm:z=>{if(S===void 0)return;const{entryId:U}=S;_(void 0),D(U,z)}})]})}function BI({state:e,onCancel:r,onConfirm:n}){const[s,a]=q.useState(""),[u,d]=q.useState(!1),[o,c]=q.useState(""),h=q.useRef(null);q.useEffect(()=>{e!==void 0&&(a(""),d(!1),c(""))},[e]);const m=e!==void 0,f=(e==null?void 0:e.abandonsBranch)===!0,v=()=>{const w={},A=s.trim();if(A.length>0&&(w.label=A),u){w.summarize=!0;const b=o.trim();b.length>0&&(w.customInstructions=b)}n(w)};return g.jsx(go,{open:m,onClose:r,title:"Navigate session leaf",width:f?"max-w-md":"max-w-sm",...f?{initialFocusRef:h}:{},children:g.jsxs("form",{onSubmit:w=>{w.preventDefault(),v()},className:"flex flex-col gap-3 px-4 py-3 text-xs text-neutral-200",children:[(e==null?void 0:e.isStreaming)===!0&&g.jsx("p",{className:"rounded border border-amber-700/50 bg-amber-900/20 px-2 py-1.5 text-amber-200",children:"The agent is currently running. Navigating will abort the in-progress turn."}),f?g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"text-neutral-400",children:"You’re leaving the current branch behind. The tip stays on the tree (you can navigate back to it any time), but you can also bookmark + summarize it before moving on."}),g.jsxs("label",{className:"flex flex-col gap-1",children:[g.jsxs("span",{className:"text-neutral-500",children:["Label for the abandoned branch tip"," ",g.jsx("span",{className:"text-neutral-600",children:"(optional)"})]}),g.jsx("input",{ref:h,type:"text",value:s,onChange:w=>a(w.target.value),placeholder:"e.g. wrong-approach",maxLength:200,className:"rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-neutral-100 outline-none focus:border-neutral-500"})]}),g.jsxs("label",{className:"flex items-start gap-2 rounded border border-neutral-800 bg-neutral-950 px-2 py-1.5",children:[g.jsx("input",{type:"checkbox",checked:u,onChange:w=>d(w.target.checked),className:"mt-0.5 h-3 w-3"}),g.jsxs("span",{className:"flex-1 text-neutral-300",children:["Have pi write a ",g.jsx("code",{className:"font-mono text-[11px]",children:"branch_summary"})," entry capturing what this branch did. Costs one extra LLM call."]})]}),u&&g.jsxs("label",{className:"flex flex-col gap-1",children:[g.jsxs("span",{className:"text-neutral-500",children:["Custom summarizer instructions"," ",g.jsx("span",{className:"text-neutral-600",children:"(optional)"})]}),g.jsx("textarea",{value:o,onChange:w=>c(w.target.value),rows:3,placeholder:"e.g. Focus on what files were changed and why",className:"rounded border border-neutral-700 bg-neutral-950 px-2 py-1 font-mono text-[11px] text-neutral-100 outline-none focus:border-neutral-500"})]})]}):g.jsx("p",{className:"text-neutral-400",children:"Confirm navigation?"}),g.jsxs("footer",{className:"flex justify-end gap-2 pt-1",children:[g.jsx("button",{type:"button",onClick:r,className:"rounded-md border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:bg-neutral-800",children:"Cancel"}),g.jsx("button",{type:"submit",className:`rounded-md px-3 py-1 text-xs font-medium ${(e==null?void 0:e.isStreaming)===!0?"bg-amber-600 text-amber-50 hover:bg-amber-500":"bg-neutral-100 text-neutral-900 hover:bg-white"}`,children:(e==null?void 0:e.isStreaming)===!0?"Abort & navigate":"Navigate"})]})]})})}const II=4,LI=18,MI=10,OI=8;function zI({node:e,disabled:r,onNavigate:n,onFork:s}){const a=Math.min(e.depth,II)*LI+Math.min(e.branchLevel,OI)*MI,u=e.type==="message"&&e.role==="user",d=!e.onActivePath,o=o1(e);return g.jsx("li",{className:"group min-w-0",style:{paddingLeft:`${a}px`},children:g.jsxs("div",{className:`flex min-w-0 items-start gap-1.5 rounded border px-2 py-1.5 ${e.isLeaf?"border-emerald-700/60 bg-emerald-900/10":e.onActivePath?"border-neutral-700 bg-neutral-900/40":"border-neutral-800/50 bg-transparent"} ${d?"opacity-60":""}`,style:e.branchLevel>0?{boxShadow:`inset 3px 0 0 ${Bh(e.branchLevel)}`}:void 0,children:[g.jsxs("div",{className:"flex shrink-0 items-center gap-0.5 pt-0.5",children:[e.isLeaf?g.jsx("span",{className:"inline-block w-[22px]","aria-hidden":"true"}):g.jsx("button",{onClick:n,disabled:r,className:"rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-100 disabled:opacity-40",title:"Navigate the session leaf to this entry",children:g.jsx(GA,{size:11})}),u?g.jsx("button",{onClick:s,disabled:r,className:"rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-emerald-300 disabled:opacity-40",title:"Fork BEFORE this message — opens a new session with the message text loaded into the input for editing.",children:g.jsx(ho,{size:11})}):g.jsx("span",{className:"inline-block w-[22px]","aria-hidden":"true"})]}),g.jsxs("button",{onClick:n,disabled:r||e.isLeaf,className:"flex min-w-0 flex-1 flex-col items-start gap-0.5 text-left disabled:cursor-default",title:e.isLeaf?"Current leaf":"Navigate the session leaf to this entry",children:[g.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[g.jsx("span",{className:`rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wider ${e.role==="user"?"bg-sky-900/40 text-sky-300":e.role==="assistant"?"bg-violet-900/40 text-violet-300":e.type==="branch_summary"?"bg-amber-900/40 text-amber-300":e.type==="compaction"?"bg-fuchsia-900/40 text-fuchsia-300":"bg-neutral-800 text-neutral-400"}`,children:o}),e.isBranchHead&&g.jsxs("span",{className:"rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wider",style:{background:`${Bh(e.branchLevel)}33`,color:Bh(e.branchLevel)},title:"First entry of a divergent branch",children:["branch ",e.branchLevel]}),e.label!==void 0&&e.label.length>0&&g.jsxs("span",{className:"rounded bg-neutral-800 px-1.5 py-0.5 text-[9px] text-neutral-300",children:["★ ",e.label]}),e.isLeaf&&g.jsx("span",{className:"rounded bg-emerald-900/40 px-1.5 py-0.5 text-[9px] text-emerald-300",children:"leaf"}),e.siblings>1&&g.jsxs("span",{className:"text-[9px] text-amber-400",title:`${e.siblings} branches diverge from this point`,children:["⑂ ",e.siblings]}),g.jsx("span",{className:"text-[9px] text-neutral-600",children:new Date(e.timestamp).toLocaleString()})]}),e.preview!==void 0&&g.jsx("p",{className:"w-full truncate text-[11px] text-neutral-300",children:e.preview})]})]})})}function FI(e,r){var a;if(e===void 0||e.leafId===null||e.leafId===r)return!1;const n=new Map(e.entries.map(u=>[u.id,u]));let s=e.leafId;for(;s!==null;){if(s===r)return!1;s=((a=n.get(s))==null?void 0:a.parentId)??null}return!0}function PI(e){return e.type!=="message"||e.role==="user"?0:e.role==="tool"?2:1}function HI(e){const r=new Map;for(const u of e.entries){const d=r.get(u.parentId);d===void 0?r.set(u.parentId,[u]):d.push(u)}for(const u of r.values())u.sort((d,o)=>d.timestamp.localeCompare(o.timestamp));const n=new Set(e.branchIds),s=[],a=(u,d)=>{const o=r.get(u);if(o===void 0)return;const c=o.length;o.forEach((h,m)=>{const f=m===0?d:d+1,v=m>0&&f>0;s.push({...h,depth:PI(h),branchLevel:f,onActivePath:n.has(h.id),isLeaf:e.leafId===h.id,siblings:c,isBranchHead:v}),a(h.id,f)})};return a(null,0),s}const bb=["#f59e0b","#0ea5e9","#ec4899","#10b981","#8b5cf6","#f97316"];function Bh(e){return e<=0?"transparent":bb[(e-1)%bb.length]}function o1(e){return e.type==="message"?e.role??"message":e.type==="thinking_level_change"?"thinking":e.type==="model_change"?"model":e.type==="compaction"?"compact":e.type==="branch_summary"?"branch":e.type==="label"?"label":e.type==="session_info"?"info":e.type==="custom"?"custom":e.type==="custom_message"?"extension":e.type}const Ya=220,cc=78,xb=64,_b=28,Jl=24;function UI(e){const r=new Map(e.entries.map(b=>[b.id,b])),n=new Map;for(const b of e.entries){const y=n.get(b.parentId);y===void 0?n.set(b.parentId,[b]):y.push(b)}for(const b of n.values())b.sort((y,S)=>y.timestamp.localeCompare(S.timestamp));const s=new Map,a=b=>{const y=s.get(b.id);if(y!==void 0)return y;if(b.type==="message"&&b.role==="user"||b.parentId===null)return s.set(b.id,b.id),b.id;const S=r.get(b.parentId);if(S===void 0)return s.set(b.id,b.id),b.id;const _=a(S);return s.set(b.id,_),_};for(const b of e.entries)a(b);const u=new Map;for(const b of e.entries){if(s.get(b.id)!==b.id)continue;const y=b.type==="message"&&b.role==="user";u.set(b.id,{id:b.id,parentId:null,col:0,row:0,isOnActivePath:!1,isLeafTurn:!1,hasMultipleChildren:!1,childCount:0,roleLabel:y?"user":o1(b),preview:b.preview??"",insideCounts:{assistant:0,tool:0,thinking:0,meta:0},isUserAnchor:y,anchorParentId:b.parentId,lastEntryId:b.id,timestamp:b.timestamp})}for(const b of e.entries){const y=s.get(b.id),S=u.get(y);if(S===void 0)continue;const _=r.get(S.lastEntryId);(_===void 0||b.timestamp.localeCompare(_.timestamp)>0)&&(S.lastEntryId=b.id),y!==b.id&&(b.type==="message"&&b.role==="assistant"?S.insideCounts.assistant+=1:b.type==="message"&&(b.role==="tool"||b.role==="toolResult")?S.insideCounts.tool+=1:(b.type==="message"&&b.role,S.insideCounts.meta+=1))}for(const b of u.values()){if(b.anchorParentId===null)continue;const y=s.get(b.anchorParentId);y!==void 0&&y!==b.id&&(b.parentId=y)}const d=new Map;for(const b of u.values()){const y=d.get(b.parentId);y===void 0?d.set(b.parentId,[b]):y.push(b)}for(const b of d.values())b.sort((y,S)=>y.timestamp.localeCompare(S.timestamp));for(const b of u.values()){const y=d.get(b.id)??[];b.childCount=y.length,b.hasMultipleChildren=y.length>1}const o=new Set(e.branchIds),c=e.leafId!==null?s.get(e.leafId):void 0;for(const b of u.values())b.isOnActivePath=o.has(b.id),b.isLeafTurn=c===b.id;let h=0;const m=new Map,f=(b,y)=>{(d.get(b)??[]).forEach((_,x)=>{let E;x===0?E=y:(E=h,h+=1),_.col=E,m.set(_.id,E),f(_.id,E)})};(d.get(null)??[]).forEach((b,y)=>{y===0?(b.col=0,h=Math.max(h,1)):(b.col=h,h+=1),m.set(b.id,b.col),f(b.id,b.col)});const w=(b,y)=>{const S=y.get(b.id);if(S!==void 0)return S;if(b.parentId===null)return y.set(b.id,0),0;const _=u.get(b.parentId);if(_===void 0)return y.set(b.id,0),0;const x=w(_,y)+1;return y.set(b.id,x),x},A=new Map;for(const b of u.values())b.row=w(b,A);return[...u.values()].sort((b,y)=>b.row!==y.row?b.row-y.row:b.col-y.col)}function $I({tree:e,disabled:r,onNavigate:n,onForkAfterTurn:s}){const a=q.useMemo(()=>UI(e),[e]),u=q.useMemo(()=>{if(a.length===0)return{width:0,height:0};const h=a.reduce((f,v)=>Math.max(f,v.col),0),m=a.reduce((f,v)=>Math.max(f,v.row),0);return{width:Jl*2+(h+1)*Ya+h*xb,height:Jl*2+(m+1)*cc+m*_b}},[a]);if(a.length===0)return g.jsx("div",{className:"px-4 py-6 text-center text-xs italic text-neutral-500",children:"No turns to render."});const d=h=>Jl+h*(Ya+xb),o=h=>Jl+h*(cc+_b),c=new Map(a.map(h=>[h.id,h]));return g.jsxs("div",{className:"relative",style:{width:`${u.width}px`,height:`${u.height}px`},children:[g.jsx("svg",{"aria-hidden":"true",className:"pointer-events-none absolute left-0 top-0",width:u.width,height:u.height,children:a.map(h=>{if(h.parentId===null)return null;const m=c.get(h.parentId);if(m===void 0)return null;const f=d(m.col)+Ya/2,v=o(m.row)+cc,w=d(h.col)+Ya/2,A=o(h.row),b=h.isOnActivePath&&m.isOnActivePath,y=f===w?`M ${f} ${v} L ${w} ${A}`:(()=>{const S=v+(A-v)/2,_=8,x=w>f,E=x?f+_:f-_,N=x?w-_:w+_;return[`M ${f} ${v}`,`L ${f} ${S-_}`,`Q ${f} ${S} ${E} ${S}`,`L ${N} ${S}`,`Q ${w} ${S} ${w} ${S+_}`,`L ${w} ${A}`].join(" ")})();return g.jsx("path",{d:y,fill:"none",stroke:b?"#a3a3a3":"#404040",strokeWidth:b?1.5:1,strokeOpacity:b?.85:.5},h.id)})}),a.map(h=>g.jsx(qI,{turn:h,x:d(h.col),y:o(h.row),disabled:r,onNavigate:()=>n(h.lastEntryId),onForkAfterTurn:()=>s(h.lastEntryId)},h.id))]})}function qI({turn:e,x:r,y:n,disabled:s,onNavigate:a,onForkAfterTurn:u}){const d=!e.isOnActivePath,o=e.isLeafTurn?"border-emerald-700/70 bg-emerald-900/15":e.isOnActivePath?"border-neutral-600 bg-neutral-900":"border-neutral-800 bg-neutral-950";return g.jsx("div",{className:`absolute overflow-hidden rounded-lg border ${o} ${d?"opacity-60":""}`,style:{left:`${r}px`,top:`${n}px`,width:`${Ya}px`,height:`${cc}px`},children:g.jsxs("button",{onClick:a,disabled:s||e.isLeafTurn,className:"flex h-full w-full flex-col items-stretch gap-1 px-2 py-1.5 text-left disabled:cursor-default",title:e.isLeafTurn?"Current leaf turn":"Navigate to this turn",children:[g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:`rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wider ${e.roleLabel==="user"?"bg-sky-900/40 text-sky-300":e.roleLabel==="compact"?"bg-fuchsia-900/40 text-fuchsia-300":e.roleLabel==="branch"?"bg-amber-900/40 text-amber-300":"bg-neutral-800 text-neutral-400"}`,children:e.roleLabel}),e.isLeafTurn&&g.jsx("span",{className:"rounded bg-emerald-900/40 px-1.5 py-0.5 text-[9px] text-emerald-300",children:"leaf"}),e.hasMultipleChildren&&g.jsxs("span",{className:"text-[9px] text-amber-400",title:`${e.childCount} branches diverge from here`,children:["⑂ ",e.childCount]}),g.jsx("button",{onClick:c=>{c.stopPropagation(),u()},disabled:s,className:"ml-auto rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-emerald-300 disabled:opacity-40",title:"Fork AFTER this turn — opens a new session that includes this turn's full output, ready for the next prompt.",children:g.jsx(ho,{size:11})})]}),g.jsx("p",{className:"line-clamp-2 flex-1 text-[11px] text-neutral-200",children:e.preview.length>0?e.preview:g.jsx("em",{className:"text-neutral-500",children:"(no text)"})}),g.jsxs("div",{className:"flex items-center gap-2 text-[9px] text-neutral-500",children:[e.insideCounts.assistant>0&&g.jsxs("span",{title:"Assistant messages within this turn",children:[e.insideCounts.assistant,"a"]}),e.insideCounts.tool>0&&g.jsxs("span",{title:"Tool results within this turn",children:[e.insideCounts.tool,"t"]}),e.insideCounts.thinking>0&&g.jsxs("span",{title:"Thinking blocks",children:[e.insideCounts.thinking,"th"]}),e.insideCounts.meta>0&&g.jsxs("span",{title:"Meta entries (model_change, branch_summary, etc.)",children:[e.insideCounts.meta,"m"]}),g.jsx("span",{className:"ml-auto",children:new Date(e.timestamp).toLocaleTimeString()})]})]})})}const QI=new Set(["single","parallel","chain","management"]);function GI(e){if(!e.endsWith(".jsonl"))return;const r=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\")),s=(r>=0?e.slice(r+1):e).slice(0,-6);if(s.length!==0)return s}function WI(e){if(typeof e!="object"||e===null)return{mode:"unknown",results:[]};const r=e,n=QI.has(r.mode)?r.mode:"unknown",s=typeof r.runId=="string"&&r.runId.length>0?r.runId:void 0,a=r.context==="fresh"||r.context==="fork"?r.context:void 0,u=[];if(Array.isArray(r.results))for(const d of r.results){if(typeof d!="object"||d===null)continue;const o=d,c={agent:typeof o.agent=="string"?o.agent:"agent",task:typeof o.task=="string"?o.task:"",exitCode:typeof o.exitCode=="number"?o.exitCode:0};if(typeof o.sessionFile=="string"&&o.sessionFile.length>0){c.sessionFile=o.sessionFile;const h=GI(o.sessionFile);h!==void 0&&(c.sessionId=h)}typeof o.finalOutput=="string"&&o.finalOutput.length>0&&(c.finalOutput=o.finalOutput),u.push(c)}return{mode:n,...s!==void 0?{runId:s}:{},...a!==void 0?{context:a}:{},results:u}}const l1=q.createContext({viewType:"unified",setViewType:()=>{}}),c1="forge.chat.viewType";function KI(){try{return localStorage.getItem(c1)==="split"?"split":"unified"}catch{return"unified"}}function VI({sessionId:e}){const r=Oe(N=>N.messagesBySession[e]??sx),n=Oe(N=>N.compactionsBySession[e]??vE),s=Oe(N=>N.streamingTextBySession[e]??yE),a=Oe(N=>N.streamingBySession[e]??!1),u=Oe(N=>N.activeToolBySession[e]),d=Oe(N=>N.bannerBySession[e]),o=Oe(N=>N.queuedBySession[e]),c=Oe(N=>N.openStream),h=Oe(N=>N.closeStream),[m,f]=q.useState(KI),v=N=>{f(N);try{localStorage.setItem(c1,N)}catch{}},w=hr(),[A,b]=q.useState(!1);q.useEffect(()=>(c(e),()=>{h(e)}),[e,c,h]);const y=q.useRef(null),S=96,_=q.useRef(!0),x=()=>{const N=y.current;if(N===null)return;const T=N.scrollHeight-N.scrollTop-N.clientHeight;_.current=T<=S};q.useEffect(()=>{const N=y.current;N!==null&&_.current&&(N.scrollTop=N.scrollHeight)},[r,s,a]);const E=q.useRef(0);return q.useEffect(()=>{const N=r.reduce((T,j)=>j.role==="user"?T+1:T,0);if(N>E.current){const T=y.current;T!==null&&(T.scrollTop=T.scrollHeight),_.current=!0}E.current=N},[r]),g.jsxs(l1.Provider,{value:{viewType:m,setViewType:v},children:[g.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[g.jsx("div",{className:"flex items-center justify-end gap-1 border-b border-neutral-800 bg-neutral-900/30 px-3 py-1",children:g.jsxs("button",{onClick:()=>b(!0),className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200",title:"Open session tree (navigate / fork from any prior point)",children:[g.jsx(ho,{size:11}),"Tree"]})}),d!==void 0&&g.jsx("div",{className:"border-b border-amber-700/40 bg-amber-900/20 px-6 py-2 text-xs text-amber-200",children:d}),g.jsxs("div",{ref:y,onScroll:x,className:"flex-1 overflow-y-auto px-6 py-4",children:[r.length===0&&s.length===0&&!a&&g.jsx("p",{className:"mt-12 text-center text-sm text-neutral-500",children:"No messages yet. Send a prompt to get started."}),g.jsxs("div",{className:"chat-message-list mx-auto max-w-3xl space-y-4",children:[(()=>{const N=new Map,T=new Set;for(const z of r)z.role==="toolResult"&&typeof z.toolCallId=="string"&&N.set(z.toolCallId,z);for(const z of r)if(!(z.role!=="assistant"||!Array.isArray(z.content)))for(const U of z.content)U.type==="toolCall"&&typeof U.id=="string"&&T.add(U.id);const j=new Map;for(const z of n){const U=j.get(z.insertBeforeIndex)??[];U.push(z),j.set(z.insertBeforeIndex,U)}const R=z=>z.archivedMessages.map((U,P)=>g.jsx(Sb,{message:U,toolResultsById:N},P)),D=[],L=z=>{const U=j.get(z);if(U!==void 0)for(const P of U)D.push(g.jsx(aD,{event:P,renderArchived:()=>R(P)},`compaction-${P.id}`))};return r.forEach((z,U)=>{L(U),!(z.role==="toolResult"&&typeof z.toolCallId=="string"&&T.has(z.toolCallId))&&z.role!=="compactionSummary"&&D.push(g.jsx(Sb,{message:z,toolResultsById:N},U))}),L(r.length),D})(),s.length>0&&g.jsxs("div",{className:"message-bubble rounded-lg border border-neutral-800 bg-neutral-900 px-4 py-3",children:[g.jsx("div",{className:"mb-1 text-[10px] uppercase tracking-wider text-neutral-500",children:"assistant (streaming)"}),g.jsxs("div",{className:"text-neutral-100",children:[g.jsx(Vf,{text:s}),g.jsx("span",{className:"ml-1 inline-block h-3 w-1.5 animate-pulse bg-neutral-300 align-text-bottom"})]})]}),a&&s.length===0&&g.jsx(YI,{tool:u}),o!==void 0&&g.jsx(XI,{queued:o})]})]})]}),A&&w!==void 0&&g.jsx(DI,{sessionId:e,projectId:w.id,onClose:()=>b(!1)})]})}function XI({queued:e}){const r=[];for(const n of e.steering)r.push({kind:"steer",text:n});for(const n of e.followUp)r.push({kind:"followUp",text:n});return r.length===0?null:g.jsxs("div",{className:"rounded-md border border-neutral-800 bg-neutral-900/40 px-3 py-2",children:[g.jsxs("div",{className:"mb-1 text-[10px] uppercase tracking-wider text-neutral-500",children:["queued (",r.length,")"]}),g.jsx("ul",{className:"space-y-1",children:r.map(n=>g.jsxs("li",{className:"flex items-baseline gap-2 text-xs text-neutral-300",children:[g.jsx("span",{className:n.kind==="steer"?"shrink-0 rounded bg-amber-900/30 px-1.5 py-0.5 text-[9px] uppercase tracking-wider text-amber-300":"shrink-0 rounded bg-neutral-800 px-1.5 py-0.5 text-[9px] uppercase tracking-wider text-neutral-400",title:n.kind==="steer"?"Delivered at the agent's next decision point (often mid-tool)":"Delivered after the agent goes fully idle",children:n.kind==="steer"?"steer":"follow-up"}),g.jsx("span",{className:"truncate",children:n.text})]},`${n.kind}:${n.text}`))})]})}function YI({tool:e}){return e===void 0?g.jsx("div",{className:"text-xs italic text-neutral-500",children:"Thinking…"}):g.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-400",children:[g.jsx("span",{className:"inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-neutral-400"}),g.jsx("span",{className:"text-neutral-500",children:"running"}),g.jsx("code",{className:"rounded bg-neutral-800 px-1.5 py-0.5 font-mono text-[11px] text-neutral-200",children:e.name}),e.summary!==void 0&&g.jsx("code",{className:"truncate rounded bg-neutral-900 px-1.5 py-0.5 font-mono text-[11px] text-neutral-300",title:e.summary,children:e.summary})]})}function u1({diff:e,filename:r,adds:n,dels:s}){const{viewType:a,setViewType:u}=q.useContext(l1);return g.jsxs("details",{className:"group rounded border border-neutral-800 bg-neutral-950 text-xs",children:[g.jsxs("summary",{className:"flex cursor-pointer items-center justify-between gap-2 px-3 py-2 text-neutral-300",children:[g.jsxs("span",{className:"flex min-w-0 items-baseline gap-2",children:[g.jsxs("span",{className:"text-neutral-500",children:["edit",r!==void 0?" ":""]}),r!==void 0&&g.jsx("span",{className:"truncate font-mono",children:r}),g.jsxs("span",{className:"ml-2 text-emerald-400",children:["+",n]}),g.jsxs("span",{className:"ml-1 text-red-400",children:["−",s]})]}),g.jsx("button",{onClick:d=>{d.preventDefault(),d.stopPropagation(),u(a==="split"?"unified":"split")},className:"rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200",title:a==="split"?"Switch chat diffs to unified view":"Switch chat diffs to side-by-side view",children:a==="split"?g.jsx(Cf,{size:11}):g.jsx(Af,{size:11})})]}),g.jsx(wp,{diff:e,viewType:a})]})}function ZI(e){const r=[],n=/\n?(`{3,})(\w*)\s+file:\s+([^\n]+)\n([\s\S]*?)\n\1\n?/g;let s=e.replace(n,(d,o,c,h,m)=>(r.push({kind:"inline",path:h.trim(),lang:c,content:m}),""));const a=/(^|\s)@(?:"([^"\n]+)"|([^\s]+?))(?=[?,;:!)\]]?(?:\s|$))/g;let u;for(;(u=a.exec(s))!==null;){const d=(u[2]??u[3]??"").trim();d.length!==0&&(r.some(o=>o.kind==="inline"&&o.path===d)||r.push({kind:"defer",path:d}))}return s=s.replace(/\n{3,}/g,`
|
|
364
|
+
|
|
365
|
+
`).trim(),{stripped:s,refs:r}}function JI({ref:e}){const[r,n]=q.useState(!1),s=e.kind==="inline";return g.jsxs("div",{className:`overflow-hidden rounded border bg-neutral-900 ${s?"border-neutral-700":"border-emerald-700/60 bg-emerald-900/15"}`,children:[g.jsxs("button",{type:"button",onClick:()=>s&&n(a=>!a),disabled:!s,className:`flex w-full items-center gap-1.5 px-2 py-1 text-left text-[11px] ${s?"text-neutral-200 hover:bg-neutral-800":"cursor-default text-emerald-200"}`,title:s?`${e.path} — click to ${r?"collapse":"expand"}`:`${e.path} — model will load this on demand using its read tool (file is larger than the inline threshold)`,children:[s?r?g.jsx(ur,{size:12}):g.jsx(dr,{size:12}):g.jsx(Sf,{size:12,className:"text-emerald-300/80"}),g.jsx(Wb,{size:12,className:s?"text-neutral-400":"text-emerald-300/80"}),g.jsx("span",{className:"font-mono",children:e.path}),s&&g.jsx("span",{className:"text-[10px] text-neutral-500",children:e.content.length<1024?`${e.content.length} B`:`${(e.content.length/1024).toFixed(1)} KB`}),!s&&g.jsx("span",{className:"text-[10px] text-emerald-300/70",children:"on demand"})]}),s&&r&&g.jsx("pre",{className:"max-h-72 overflow-auto border-t border-neutral-800 bg-neutral-950 px-3 py-2 font-mono text-[11px] leading-relaxed text-neutral-300",children:e.content})]})}function Sb({message:e,toolResultsById:r}){const[n,s]=q.useState(!1);if(e.role==="user"){const a=lL(e),{stripped:u,refs:d}=ZI(a),o=Array.isArray(e.content)?e.content:[],c=[],h=[];for(let m=0;m<o.length;m++){const f=o[m];if(f.type==="image"){const v=typeof f.data=="string"?f.data:"",w=typeof f.mimeType=="string"?f.mimeType:"image/png",b=f.__blobUrl===!0?v:`data:${w};base64,${v}`;v.length>0&&c.push({src:b,key:`img-${m}`})}else if(f.type==="file"){const w={name:typeof f.filename=="string"?f.filename:"attachment",key:`file-${m}`};typeof f.size=="number"&&(w.size=f.size),h.push(w)}}return g.jsxs("div",{className:"message-bubble rounded-lg bg-neutral-800 px-4 py-3","data-message-role":"user",children:[g.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[g.jsx("span",{className:"text-[10px] uppercase tracking-wider text-neutral-400",children:"you"}),u.length>0&&g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(wb,{getText:()=>u,title:"Copy message text"}),g.jsx(Ab,{showRaw:n,onToggle:s})]})]}),u.length>0&&g.jsx("div",{className:"text-neutral-100",children:n?g.jsx(h1,{text:u}):g.jsx(Vf,{text:u,chatStyleBreaks:!0})}),d.length>0&&g.jsx("div",{className:"mt-2 flex flex-col gap-1",children:d.map((m,f)=>g.jsx(JI,{ref:m},`fileref-${f}-${m.path}`))}),c.length>0&&g.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:c.map(m=>g.jsx("img",{src:m.src,alt:"",className:"max-h-48 max-w-full rounded border border-neutral-700"},m.key))}),h.length>0&&g.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:h.map(m=>g.jsxs("span",{className:"inline-flex items-center gap-1 rounded border border-neutral-700 bg-neutral-900 px-2 py-1 text-[11px] text-neutral-300",title:m.name,children:[g.jsx("span",{className:"font-mono",children:m.name}),m.size!==void 0&&g.jsx("span",{className:"text-[10px] text-neutral-500",children:m.size<1024?`${m.size} B`:m.size<1024*1024?`${(m.size/1024).toFixed(1)} KB`:`${(m.size/(1024*1024)).toFixed(1)} MB`})]},m.key))})]})}if(e.role==="assistant"){const a=Array.isArray(e.content)?e.content:[],u=a.some(d=>d.type==="text");return g.jsxs("div",{className:"message-bubble rounded-lg border border-neutral-800 bg-neutral-900 px-4 py-3","data-message-role":"assistant",children:[g.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[g.jsx("span",{className:"text-[10px] uppercase tracking-wider text-neutral-500",children:"assistant"}),u&&g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(wb,{getText:()=>aL(a),title:"Copy all text from this assistant message"}),g.jsx(Ab,{showRaw:n,onToggle:s})]})]}),g.jsx("div",{className:"space-y-2 text-sm text-neutral-100",children:a.map((d,o)=>{const c={block:d,showRaw:n};return r!==void 0&&(c.toolResultsById=r),g.jsx(eL,{...c},o)})})]})}return e.role==="toolResult"?g.jsx(nL,{message:e}):e.role==="bashExecution"||e.type==="bashExecution"||e.customType==="bashExecution"?g.jsx(sL,{message:e}):g.jsxs("details",{className:"rounded-lg border border-neutral-800 bg-neutral-900/40 px-3 py-2 text-xs text-neutral-400",children:[g.jsxs("summary",{className:"cursor-pointer",children:["unknown message (",String(e.role??e.type??"?"),")"]}),g.jsx("pre",{className:"mt-2 overflow-auto whitespace-pre-wrap text-[10px] text-neutral-500",children:JSON.stringify(e,null,2)})]})}function eL({block:e,toolResultsById:r,showRaw:n=!1}){const s=e.type;if(s==="text"&&typeof e.text=="string")return n?g.jsx(h1,{text:e.text}):g.jsx(Vf,{text:e.text});if(s==="thinking"&&typeof e.thinking=="string")return g.jsxs("details",{className:"rounded border border-neutral-800 px-2 py-1 text-xs text-neutral-400",children:[g.jsx("summary",{className:"cursor-pointer",children:"Thinking…"}),g.jsx("pre",{className:"mt-1 whitespace-pre-wrap break-words font-sans text-[12px]",children:e.thinking})]});if(s==="toolCall"){const a=typeof e.id=="string"?e.id:void 0,u=a!==void 0?r==null?void 0:r.get(a):void 0;return g.jsx(tL,{block:e,result:u})}return g.jsxs("details",{className:"text-xs text-neutral-500",children:[g.jsxs("summary",{className:"cursor-pointer",children:["block (",String(s??"?"),")"]}),g.jsx("pre",{className:"mt-1 overflow-auto whitespace-pre-wrap text-[10px]",children:JSON.stringify(e,null,2)})]})}function tL({block:e,result:r}){const n=String(e.name??"tool"),s=e.input??e.arguments??{},a=typeof s=="string"?s:JSON.stringify(s,null,2),u=(r==null?void 0:r.isError)===!0,d=Array.isArray(r==null?void 0:r.content)?r==null?void 0:r.content:[],o=oL(s)?s:void 0,c=n==="bash"&&typeof(o==null?void 0:o.command)=="string"?o.command:(n==="read"||n==="write"||n==="edit")&&typeof(o==null?void 0:o.path)=="string"?o.path:void 0,h=d.filter(A=>{const b=A;return b.type==="text"&&typeof b.text=="string"}).map(A=>A.text).join(`
|
|
366
|
+
`),m=n==="edit"&&r!==void 0?(()=>{var b;const A=(b=r.details)==null?void 0:b.diff;return typeof A=="string"?A:h})():void 0,f=n==="edit"&&r!==void 0?uc(r):void 0,v=m!==void 0?f1(m):void 0;if(n==="subagent")return g.jsx(rL,{argsText:a,input:o,result:r,isError:u,outputText:h});const w=r===void 0?"border-neutral-700":u?"border-red-700/50":"border-neutral-800";return g.jsxs("div",{className:`rounded border ${w} bg-neutral-950 text-xs`,children:[g.jsxs("div",{className:"flex items-center justify-between px-3 py-2 text-neutral-300",children:[g.jsxs("div",{className:"min-w-0 flex-1 truncate",children:[g.jsx("span",{className:"text-neutral-500",children:"→ "}),g.jsx("span",{className:"font-mono",children:n}),c!==void 0&&g.jsx("span",{className:"ml-2 truncate font-mono text-neutral-400",title:c,children:c})]}),g.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[r===void 0&&g.jsx("span",{className:"rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400",children:"running…"}),u&&g.jsx("span",{className:"rounded bg-red-900/30 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-red-300",children:"error"})]})]}),a.length>0&&g.jsxs("details",{className:"border-t border-neutral-800/60",children:[g.jsx("summary",{className:"cursor-pointer px-3 py-1.5 text-[11px] text-neutral-500 hover:text-neutral-300",children:"Input"}),g.jsx("pre",{className:"overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-400",children:a})]}),r!==void 0&&g.jsxs("details",{className:"border-t border-neutral-800/60",children:[g.jsxs("summary",{className:"cursor-pointer px-3 py-1.5 text-[11px] text-neutral-500 hover:text-neutral-300",children:["Output",v!==void 0&&g.jsxs("span",{className:"ml-2 font-mono text-[10px]",children:[g.jsxs("span",{className:"text-emerald-400",children:["+",v.adds]})," ",g.jsxs("span",{className:"text-red-400",children:["-",v.dels]})]}),f!==void 0&&g.jsx("span",{className:"ml-2 font-mono text-[10px] text-neutral-500",children:f})]}),m!==void 0&&v!==void 0?g.jsx("div",{className:"px-3 pb-2",children:g.jsx(u1,{diff:m,filename:f,adds:v.adds,dels:v.dels})}):g.jsx("pre",{className:"max-h-96 overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-300",children:h.length>0?h:"(empty)"})]})]})}function nL({message:e}){const r=String(e.toolName??"tool"),n=e.isError===!0,a=(Array.isArray(e.content)?e.content:[]).filter(u=>{const d=u;return d.type==="text"&&typeof d.text=="string"}).map(u=>u.text).join(`
|
|
367
|
+
`);if(r==="edit"){const u=e.details,d=typeof(u==null?void 0:u.diff)=="string"?u.diff:a,o=uc(e),{adds:c,dels:h}=f1(d);return g.jsx(u1,{diff:d,filename:o,adds:c,dels:h})}if(r==="read"){const u=uc(e);return g.jsxs("details",{className:"rounded border border-neutral-800 bg-neutral-950 text-xs",children:[g.jsxs("summary",{className:"cursor-pointer px-3 py-2 text-neutral-300",children:[g.jsxs("span",{className:"text-neutral-500",children:["read",u!==void 0?" ":""]}),u!==void 0&&g.jsx("span",{className:"font-mono",children:u})]}),g.jsx("pre",{className:"overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-400",children:a})]})}if(r==="bash"){const u=cL(e);return g.jsxs("div",{className:`rounded border ${n?"border-red-700/40":"border-neutral-800"} bg-neutral-950 text-xs`,children:[g.jsxs("div",{className:"px-3 py-2 text-neutral-400",children:[g.jsxs("span",{className:"text-neutral-500",children:["bash",u!==void 0?" → ":" output"]}),u!==void 0&&g.jsx("span",{className:"font-mono",children:u})]}),g.jsx("pre",{className:"max-h-64 overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-300",children:a})]})}if(r==="write"){const u=uc(e);return g.jsxs("details",{className:"rounded border border-neutral-800 bg-neutral-950 text-xs",children:[g.jsxs("summary",{className:"cursor-pointer px-3 py-2 text-neutral-300",children:[g.jsxs("span",{className:"text-neutral-500",children:["write",u!==void 0?" ":""]}),u!==void 0&&g.jsx("span",{className:"font-mono",children:u}),g.jsxs("span",{className:"ml-2 text-neutral-500",children:["(",a.split(`
|
|
368
|
+
`).length," lines)"]})]}),g.jsx("pre",{className:"overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-400",children:a})]})}return r==="subagent"?g.jsx(d1,{message:e,argsText:"",outputText:a,isError:n}):g.jsxs("details",{className:`rounded border ${n?"border-red-700/40":"border-neutral-800"} bg-neutral-950 text-xs`,children:[g.jsxs("summary",{className:"cursor-pointer px-3 py-2 text-neutral-300",children:[g.jsx("span",{className:"text-neutral-500",children:r}),n&&g.jsx("span",{className:"ml-2 text-red-400",children:"error"})]}),g.jsx("pre",{className:"overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-400",children:a})]})}function rL({argsText:e,input:r,result:n,isError:s,outputText:a}){if(n!==void 0)return g.jsx(d1,{message:n,argsText:e,outputText:a,isError:s});let u;if(r!==void 0){const d=typeof r.agent=="string"?r.agent:void 0,o=typeof r.task=="string"?r.task:void 0,c=typeof r.action=="string"?r.action:void 0,h=Array.isArray(r.tasks)?r.tasks.length:void 0,m=Array.isArray(r.chain)?r.chain.length:void 0;c!==void 0?u=`action: ${c}`:h!==void 0?u=`${h} parallel task${h===1?"":"s"}`:m!==void 0?u=`${m}-step chain`:d!==void 0&&o!==void 0?u=`${d} — ${o}`:d!==void 0&&(u=d)}return g.jsx("div",{className:"overflow-hidden rounded border border-l-2 border-sky-700/50 border-l-sky-400 bg-sky-950/15 text-xs",children:g.jsx("div",{className:"flex items-center justify-between gap-2 px-2.5 py-1.5",children:g.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[g.jsx(Zb,{size:11,className:"shrink-0 text-sky-300"}),g.jsx("span",{className:"truncate font-medium text-sky-100",children:"Sub-agent running…"}),u!==void 0&&g.jsx("span",{className:"ml-1 truncate font-mono text-[11px] text-sky-200/70",title:u,children:u})]})})})}function d1({message:e,argsText:r,outputText:n,isError:s}){const a=Oe(A=>A.setActiveSession),u=Wt(A=>A.setActive),d=Oe(A=>A.byProject),o=q.useMemo(()=>{const A=new Map;for(const b of Object.values(d))for(const y of b)typeof y.path=="string"&&y.path.length>0&&A.set(y.path,{sessionId:y.sessionId,projectId:y.projectId});return A},[d]),c=A=>{if(A===void 0){console.warn("[subagent] Open clicked but result has no sessionFile");return}const b=o.get(A);if(console.info("[subagent] Open clicked",{sessionFile:A,match:b}),b===void 0){console.warn("[subagent] Open: sessionFile not found in any project's session list",A);return}u(b.projectId),a(b.sessionId)},h=WI(e.details),m=h.mode==="management",f=h.results.length,v=f===1?`Sub-agent: ${h.results[0].agent}`:f>1?`${f} sub-agents (${h.mode})`:m?"Sub-agent management":"Sub-agent",w=s?"border-red-700/50 border-l-red-400 bg-red-950/15":"border-sky-700/50 border-l-sky-400 bg-sky-950/15";return g.jsxs("div",{className:`overflow-hidden rounded border border-l-2 ${w} text-xs`,children:[g.jsxs("div",{className:"flex items-center justify-between gap-2 px-2.5 py-1.5",children:[g.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[g.jsx(Zb,{size:11,className:"shrink-0 text-sky-300"}),g.jsx("span",{className:"truncate font-medium text-sky-100",children:v}),h.context!==void 0&&g.jsx("span",{className:"shrink-0 rounded bg-sky-900/40 px-1 py-0.5 text-[9px] font-medium uppercase tracking-wider text-sky-200",title:h.context==="fork"?"Forked from parent context":"Fresh context",children:h.context}),s&&g.jsx("span",{className:"shrink-0 rounded bg-red-900/40 px-1 py-0.5 text-[9px] font-medium uppercase tracking-wider text-red-200",children:"error"})]}),h.results.length===1&&h.results[0].sessionFile!==void 0&&g.jsxs("button",{onClick:()=>c(h.results[0].sessionFile),className:"inline-flex shrink-0 items-center gap-1 rounded border border-sky-700/60 px-1.5 py-0.5 text-[10px] font-medium text-sky-200 hover:border-sky-500 hover:bg-sky-900/30 hover:text-sky-100",title:`Open sub-agent session — ${h.results[0].sessionFile}`,children:[g.jsx(Gb,{size:10}),"Open"]})]}),f>1&&g.jsx("div",{className:"space-y-1.5 border-t border-sky-900/30 px-2.5 py-2",children:h.results.map((A,b)=>g.jsx(iL,{result:A,onOpenFile:c},A.sessionFile??`${b}-${A.agent}`))}),r.length>0&&g.jsxs("details",{className:"border-t border-sky-900/30",children:[g.jsx("summary",{className:"cursor-pointer px-2.5 py-1 text-[11px] text-neutral-500 hover:text-neutral-300",children:"Input"}),g.jsx("pre",{className:"overflow-auto px-2.5 pb-2 font-mono text-[11px] text-neutral-400",children:r})]}),n.length>0&&g.jsxs("details",{open:s,className:"border-t border-sky-900/30",children:[g.jsx("summary",{className:"cursor-pointer px-2.5 py-1 text-[11px] text-neutral-500 hover:text-neutral-300",children:"Output"}),g.jsx("pre",{className:"overflow-auto px-2.5 pb-2 font-mono text-[11px] text-neutral-300 whitespace-pre-wrap",children:n})]})]})}function iL({result:e,onOpenFile:r}){const n=e.exitCode!==0;return g.jsxs("div",{className:`flex items-center justify-between gap-2 rounded border ${n?"border-red-700/40":"border-sky-900/40"} bg-neutral-950/60 px-2 py-1.5`,children:[g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsxs("div",{className:"flex items-baseline gap-2",children:[g.jsx("span",{className:"font-mono text-[11px] font-medium text-sky-200",children:e.agent}),n&&g.jsxs("span",{className:"text-[10px] font-medium text-red-400",children:["exit ",e.exitCode]})]}),e.task.length>0&&g.jsx("div",{className:"mt-0.5 truncate text-[11px] text-neutral-400",title:e.task,children:e.task})]}),e.sessionFile!==void 0&&g.jsxs("button",{onClick:()=>r(e.sessionFile),className:"inline-flex shrink-0 items-center gap-1 rounded border border-sky-700/60 px-1.5 py-0.5 text-[10px] font-medium text-sky-200 hover:border-sky-500 hover:bg-sky-900/30 hover:text-sky-100",title:e.sessionFile,children:[g.jsx(Gb,{size:10}),"Open"]})]})}function sL({message:e}){const r=String(e.command??""),n=String(e.output??""),s=typeof e.exitCode=="number"?e.exitCode:void 0,a=e.truncated===!0,u=e.cancelled===!0,d=e.excludeFromContext===!0;return g.jsxs("div",{className:"rounded border border-neutral-800 bg-neutral-950 text-xs",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2 text-neutral-400",children:[g.jsxs("div",{className:"min-w-0 flex-1 truncate",children:[g.jsx("span",{className:"text-neutral-500",children:"$ "}),g.jsx("span",{className:"font-mono text-neutral-200",children:r})]}),g.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[d&&g.jsx("span",{className:"rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400",title:"!! prefix — kept out of LLM context on the next turn",children:"local-only"}),u&&g.jsx("span",{className:"rounded bg-amber-900/40 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-amber-300",children:"timed out"}),a&&!u&&g.jsx("span",{className:"rounded bg-amber-900/40 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-amber-300",children:"truncated"}),s!==void 0&&g.jsxs("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-mono ${s===0?"bg-emerald-900/30 text-emerald-300":"bg-red-900/30 text-red-300"}`,title:s===0?"exit 0":`exit ${String(s)}`,children:["exit ",s]})]})]}),n.length>0&&g.jsx("pre",{className:"max-h-64 overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-300",children:n})]})}function wb({getText:e,title:r}){const[n,s]=q.useState(!1),a=()=>{var c,h;const d=e();if(d.length===0)return;const o=(h=(c=navigator.clipboard)==null?void 0:c.writeText)==null?void 0:h.bind(navigator.clipboard);o!==void 0?o(d).then(()=>{s(!0),window.setTimeout(()=>s(!1),1200)}).catch(()=>u(d)):u(d)},u=d=>{try{const o=document.createElement("textarea");o.value=d,o.style.position="fixed",o.style.opacity="0",document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o),s(!0),window.setTimeout(()=>s(!1),1200)}catch{}};return g.jsx("button",{type:"button",onClick:a,className:"rounded px-1.5 py-0.5 text-neutral-500 hover:bg-neutral-700/40 hover:text-neutral-300",title:r,children:n?g.jsx(wf,{size:12}):g.jsx(qb,{size:12})})}function aL(e){const r=[];for(const n of e)n.type==="text"&&typeof n.text=="string"&&r.push(n.text);return r.join(`
|
|
369
|
+
|
|
370
|
+
`)}function Ab({showRaw:e,onToggle:r}){return g.jsx("button",{type:"button",onClick:()=>r(!e),className:"rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-500 hover:bg-neutral-700/40 hover:text-neutral-300",title:e?"Show rendered markdown":"Show raw text",children:e?"rendered":"raw"})}function h1({text:e}){return g.jsx("pre",{className:"whitespace-pre-wrap break-words font-sans text-sm text-neutral-100 [overflow-wrap:anywhere]",children:e})}function oL(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function lL(e){return typeof e.content=="string"?e.content:Array.isArray(e.content)?e.content.filter(r=>{const n=r;return n.type==="text"&&typeof n.text=="string"}).map(r=>r.text).join(`
|
|
371
|
+
`):""}function uc(e){const r=e.details,n=e.input;for(const s of[r,n])if(s!==void 0){if(typeof s.path=="string")return s.path;if(typeof s.filename=="string")return s.filename;if(typeof s.file=="string")return s.file;if(typeof s.file_path=="string")return s.file_path}}function f1(e){let r=0,n=0;for(const s of e.split(`
|
|
372
|
+
`))s.startsWith("+++")||s.startsWith("---")||(s.startsWith("+")?r+=1:s.startsWith("-")&&(n+=1));return{adds:r,dels:n}}function cL(e){const r=e.details,n=e.input;if(typeof(r==null?void 0:r.command)=="string")return r.command;if(typeof(n==null?void 0:n.command)=="string")return n.command}const Fi=Ir((e,r)=>({settingsRequest:void 0,openSettings:n=>{var u;const a={seq:(((u=r().settingsRequest)==null?void 0:u.seq)??0)+1};n!==void 0&&(a.tab=n),e({settingsRequest:a})},clearSettingsRequest:()=>{e({settingsRequest:void 0})},chatInsertRequest:void 0,requestChatInsert:n=>{var a;const s=((a=r().chatInsertRequest)==null?void 0:a.seq)??0;e({chatInsertRequest:{text:n,seq:s+1}})},clearChatInsertRequest:()=>{e({chatInsertRequest:void 0})}}));function uL(e){const r=/(?:^|\s)@(?:"([^"\n]+)"|([^\s]+?))(?=[?,;:!)\]]?(?:\s|$))/g,n=[];let s;for(;(s=r.exec(e))!==null;){const a=s[1]??s[2];a!==void 0&&n.push(a)}return n}function dL(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function hL(e){const r=dL(e);return new RegExp(`(^|\\s)@(?:"${r}"|${r})\\s?`,"g")}const p1=100,g1="forge.input.history.v1:";function m1(e){try{const r=localStorage.getItem(g1+e);if(r===null)return[];const n=JSON.parse(r);return Array.isArray(n)?n.filter(s=>typeof s=="string").slice(0,p1):[]}catch{return[]}}function fL(e,r){const n=r.trim();if(n.length!==0)try{const s=m1(e);if(s[0]===n)return;const a=[n,...s].slice(0,p1);localStorage.setItem(g1+e,JSON.stringify(a))}catch{}}function pL(e){const r=[];let n;for(let s=e.length-1;s>=0;s--){const a=e[s];if((a==null?void 0:a.role)!=="user")continue;let u="";if(typeof a.content=="string")u=a.content;else if(Array.isArray(a.content)){const d=[];for(const o of a.content){const c=o;c.type==="text"&&typeof c.text=="string"&&d.push(c.text)}u=d.join(`
|
|
373
|
+
`)}u=u.trim(),u.length!==0&&u!==n&&(r.push(u),n=u)}return r}const Ih="pi-forge/model/";function gL(e){if(e===void 0)return[];const r=[];for(const n of e.providers)for(const s of n.models)s.hasAuth&&r.push({value:`${n.provider}:${s.id}`,provider:n.provider,modelId:s.id,name:s.name,haystack:`${n.provider} ${s.name} ${s.id}`.toLowerCase()});return r}function mL(e,r){if(r.length===0)return 0;const n=r.toLowerCase(),s=n.split(/\s+/).filter(u=>u.length>0);let a=0;for(const u of s){const d=e.haystack.indexOf(u);if(d===-1)return;a+=d}return e.modelId.toLowerCase().startsWith(n)&&(a-=50),e.name.toLowerCase().startsWith(n)&&(a-=30),e.provider.toLowerCase()===n&&(a-=20),a}const yL=600;function vL({sessionId:e}){const r=Oe(ie=>ie.streamingBySession[e]??!1),n=Dr(ie=>ie.minimal),s=Oe(ie=>ie.bannerBySession[e]),a=s!==void 0&&s.startsWith("Retrying ("),u=Oe(ie=>ie.sendPrompt),d=Oe(ie=>ie.sendSteer),o=Oe(ie=>ie.reloadMessages),c=Oe(ie=>ie.abortSession),h=Oe(ie=>ie.error),[m,f]=q.useState(""),[v,w]=q.useState(!1),A=hr(),b=q.useRef(null),[y,S]=q.useState(void 0),[_,x]=q.useState([]),[E,N]=q.useState(0),T=q.useRef(0),j=Fi(ie=>ie.openSettings),R=Fi(ie=>ie.chatInsertRequest),D=Fi(ie=>ie.clearChatInsertRequest),L=q.useRef(0),[z,U]=q.useState(0),P=m.startsWith("/")&&!m.includes(`
|
|
374
|
+
`),G=P?m.slice(1).split(/\s/)[0]??"":"",K=(()=>{if(!r&&!n){if(m.startsWith("!!"))return"local";if(m.startsWith("!"))return"context"}})(),W=q.useMemo(()=>[{name:"/compact",description:"Manually compact the session context",available:!r,run:async()=>{try{await be.compact(e),o(e)}catch(Ne){const Te=Ne instanceof we?Ne.code:Ne.message;se(`Compact failed: ${Te}`)}}},{name:"/clear",description:"Compact context (alias for /compact)",available:!r,run:async()=>{try{await be.compact(e),o(e)}catch(Ne){const Te=Ne instanceof we?Ne.code:Ne.message;se(`Clear failed: ${Te}`)}}},{name:"/abort",description:"Stop the agent (alias for the Abort button)",available:r,run:()=>c(e)},{name:"/settings",description:"Open the Settings panel",available:!0,run:()=>j()},{name:"/skills",description:"Open Settings → Skills",available:!0,run:()=>j("skills")},{name:"/mcp",description:"Open Settings → MCP",available:!0,run:()=>j("mcp")},{name:"/providers",description:"Open Settings → Providers",available:!0,run:()=>j("providers")},{name:"/help",description:n?"Show what `/` and `@` do in the input":"Show what `/`, `!`, `@` do in the input",available:!0,run:()=>{se(n?"/<cmd> runs a pi-forge command (compact, abort, settings, …). @<path> references a project file (autocomplete from the popover).":"/<cmd> runs a pi-forge command (compact, abort, settings, …). !cmd runs bash (output → next LLM context); !!cmd runs bash local-only. @<path> references a project file (autocomplete from the popover).")}}],[r,e,c,o,j,n]),Y=q.useMemo(()=>{const ie=G.toLowerCase();return ie.length===0?W:W.filter(Ne=>Ne.name.slice(1).toLowerCase().startsWith(ie))},[W,G]),ne=()=>{const ie=Y[z];ie===void 0||!ie.available||(f(""),U(0),ie.run())},F=q.useRef(0),[B,O]=q.useState([]),Q=q.useRef(new Map),M=q.useRef(null),J=20*1024*1024,de=4,pe=8,X=new Set(["doc","xls","ppt","pptx","vsd","vsdx","odt","ods","odp","rtf","zip","tar","gz","bz2","xz","7z","rar","exe","dll","so","dylib","bin","o","a","class","jar","wasm","mp3","mp4","m4a","wav","flac","ogg","avi","mov","wmv","mkv","heic","heif","tiff","tif","bmp","ico","psd","ttf","otf","woff","woff2","eot","sqlite","db","iso","dmg"]),[$,se]=q.useState(void 0),le=ie=>{var mt;se(void 0);const Ne=B,Te=[...Ne];let Ve=Ne.filter(ut=>ut.type.startsWith("image/")).length;for(const ut of ie){if(Te.length>=pe){se(`Up to ${pe} attachments per message; "${ut.name}" dropped.`);continue}if(ut.size>J){se(`"${ut.name}" exceeds the 20 MB per-file limit.`);continue}if(ut.type.startsWith("image/")&&Ve>=de){se(`Up to ${de} images per message; "${ut.name}" dropped.`);continue}const Jn=ut.name.includes(".")?(mt=ut.name.split(".").pop())==null?void 0:mt.toLowerCase():void 0;if(Jn!==void 0&&X.has(Jn)){se(`"${ut.name}" is a binary format that the agent can't read directly. Convert to text/markdown (or to a PNG/JPEG screenshot for diagrams) and try again.`);continue}Te.push(ut),ut.type.startsWith("image/")&&(Ve+=1,Q.current.set(ut,URL.createObjectURL(ut)))}O(Te)},te=ie=>{const Ne=Q.current.get(ie);Ne!==void 0&&(URL.revokeObjectURL(Ne),Q.current.delete(ie)),O(Te=>Te.filter(Ve=>Ve!==ie))},ue=()=>{for(const ie of Q.current.values())URL.revokeObjectURL(ie);Q.current.clear(),O([]),se(void 0)};q.useEffect(()=>{const ie=Q.current;return()=>{for(const Ne of ie.values())URL.revokeObjectURL(Ne);ie.clear()}},[]);const Ae=Oe(ie=>ie.messagesBySession[e]??sx),[Le,Me]=q.useState(0),Pe=q.useMemo(()=>{const ie=m1(e),Ne=pL(Ae),Te=new Set,Ve=[];for(const mt of[...ie,...Ne])Te.has(mt)||(Te.add(mt),Ve.push(mt));return Ve},[Ae,e,Le]),[Be,jt]=q.useState(void 0),gt=q.useRef("");q.useEffect(()=>{jt(void 0),gt.current=""},[e]),q.useEffect(()=>{F.current=0},[e]);const Ce=Ih+e,[Kt,Mt]=q.useState(void 0),[st,xt]=q.useState(void 0),[Pt,fe]=q.useState(()=>localStorage.getItem(Ih+e)??""),[_e,je]=q.useState(void 0);q.useEffect(()=>{be.getProviders().then(Mt).catch(ie=>{const Ne=ie instanceof we?ie.code:ie.message;je(`models unavailable (${Ne})`)}),be.getSettings().then(ie=>{xt({provider:typeof ie.defaultProvider=="string"?ie.defaultProvider:"",modelId:typeof ie.defaultModel=="string"?ie.defaultModel:""})}).catch(()=>{})},[]),q.useEffect(()=>{const ie=localStorage.getItem(Ih+e)??"";if(fe(ie),je(void 0),ie==="")return;const[Ne,...Te]=ie.split(":"),Ve=Te.join(":");if(Ne===void 0||Ve.length===0)return;const mt=e;be.setModel(mt,Ne,Ve).catch(ut=>{if(mt!==e)return;const Jn=ut instanceof we?ut.code:ut.message;je(`set model failed: ${Jn}`)})},[e]);const Ue=Oe(ie=>ie.pendingDraftBySession[e]),$e=Oe(ie=>ie.consumePendingDraft);q.useEffect(()=>{Ue!==void 0&&(f(Ue),$e(e))},[Ue,e,$e]),q.useEffect(()=>{if(R===void 0||R.seq<=L.current)return;L.current=R.seq;const ie=R.text;f(Ne=>{if(Ne.length===0)return ie;const Te=/\s$/.test(Ne)?"":" ";return`${Ne}${Te}${ie}`}),requestAnimationFrame(()=>{const Ne=b.current;if(Ne===null)return;Ne.focus();const Te=Ne.value.length;Ne.setSelectionRange(Te,Te)}),D()},[R,D]);const Tt=async ie=>{if(fe(ie),ie===""){localStorage.removeItem(Ce);return}const[Ne,...Te]=ie.split(":"),Ve=Te.join(":");if(!(Ne===void 0||Ve.length===0))try{await be.setModel(e,Ne,Ve),localStorage.setItem(Ce,ie),je(void 0)}catch(mt){const ut=mt instanceof we?mt.code:mt.message;je(`set model failed: ${ut}`)}},Ye=async()=>{const ie=m.trim();if(!(ie.length===0&&B.length===0||v)){if(ie.length>0&&(fL(e,ie),Me(Ne=>Ne+1)),P){Y.length>0?ne():se(`Unknown command "${m.split(/\s/)[0]??m}". Type /help to see commands.`);return}w(!0);try{if(!r&&/^!!?[^!]/.test(ie)){if(n){se("Bash exec is disabled in this deployment.");return}const Ne=ie.startsWith("!!"),Te=ie.slice(Ne?2:1).trim();if(Te.length===0){se("Empty bash command. Type something after the `!`.");return}B.length>0&&(ue(),se("Attachments aren't sent with `!` exec. Cleared.")),await be.exec(e,Te,{excludeFromContext:Ne}),o(e),f(""),jt(void 0),gt.current="";return}r?(B.length>0&&(ue(),se("Attachments aren't sent on steer (mid-turn). Cleared.")),await d(e,ie)):await u(e,ie,B.length>0?B:void 0),f(""),ue(),jt(void 0),gt.current=""}catch(Ne){const Te=Ne instanceof we?Ne.code:Ne.message;se(`Command failed: ${Te}`)}finally{w(!1)}}},Ot=ie=>{if(P){if(ie.key==="Escape"){ie.preventDefault(),f("");return}if(Y.length>0){if(ie.key==="ArrowDown"){ie.preventDefault(),U(Te=>Math.min(Te+1,Y.length-1));return}if(ie.key==="ArrowUp"){ie.preventDefault(),U(Te=>Math.max(Te-1,0));return}if(ie.key==="Enter"||ie.key==="Tab"){ie.preventDefault(),ne();return}}else if(ie.key==="Enter"&&!ie.shiftKey){ie.preventDefault(),se(`Unknown command "${m.split(/\s/)[0]??m}". Type /help to see commands, or backspace the leading / to send as a prompt.`);return}}if(y!==void 0&&_.length>0){if(ie.key==="ArrowDown"){ie.preventDefault(),N(Te=>Math.min(Te+1,_.length-1));return}if(ie.key==="ArrowUp"){ie.preventDefault(),N(Te=>Math.max(Te-1,0));return}if(ie.key==="Enter"||ie.key==="Tab"){const Te=_[E];if(Te!==void 0){ie.preventDefault(),xe(Te);return}}if(ie.key==="Escape"){ie.preventDefault(),Qe();return}}if(ie.key==="Enter"&&!ie.shiftKey){ie.preventDefault(),Ye();return}if(ie.key==="ArrowUp"){const Te=Be!==void 0;if(Te||m.length===0){if(Pe.length===0)return;ie.preventDefault();const Ve=Te?Math.min((Be??0)+1,Pe.length-1):0;Te||(gt.current=m),jt(Ve);const mt=Pe[Ve];mt!==void 0&&f(mt)}return}if(ie.key==="ArrowDown"){if(Be===void 0)return;if(ie.preventDefault(),Be>0){const Te=Be-1;jt(Te);const Ve=Pe[Te];Ve!==void 0&&f(Ve)}else jt(void 0),f(gt.current),gt.current="";return}if(ie.key==="Escape"){if(!r)return;ie.preventDefault();const Te=Date.now(),Ve=Te-F.current;F.current=Te,Ve<yL&&(F.current=0,c(e))}},Dt=ie=>{var Ve;f(ie),Be!==void 0&&(jt(void 0),gt.current="");const Ne=((Ve=b.current)==null?void 0:Ve.selectionStart)??ie.length,Te=Z(ie,Ne);S(Te),Te===void 0&&x([]),N(0)};function Z(ie,Ne){let Te=Ne-1;for(;Te>=0;){const Ve=ie[Te];if(Ve===void 0)break;if(/\s/.test(Ve))return;if(Ve==="@"){const mt=Te===0?" ":ie[Te-1];return mt===void 0||/\s/.test(mt)?{start:Te,end:Ne,query:ie.slice(Te+1,Ne)}:void 0}Te-=1}}q.useEffect(()=>{if(y===void 0||A===void 0)return;const ie=T.current+1;T.current=ie;const Ne=window.setTimeout(()=>{be.completeFiles(A.id,y.query,{limit:20}).then(Te=>{T.current===ie&&(x(Te.paths),N(0))}).catch(()=>{T.current===ie&&x([])})},100);return()=>window.clearTimeout(Ne)},[y,A]);const xe=ie=>{if(y===void 0)return;const Ne=m.slice(0,y.start),Te=m.slice(y.end),Ve=`@"${ie}"`,mt=`${Ne}${Ve}${Te}`;f(mt),S(void 0),x([]);const ut=Ne.length+Ve.length;requestAnimationFrame(()=>{const Jn=b.current;Jn!==null&&(Jn.focus(),Jn.setSelectionRange(ut,ut))})},Qe=()=>{S(void 0),x([])},Ct=uL(m),Gn=ie=>{const Ne=hL(ie);f(Te=>Te.replace(Ne,(Ve,mt)=>mt).trimEnd())};return g.jsx("div",{className:"border-t border-neutral-800 bg-neutral-950 px-6 py-3",children:g.jsxs("div",{className:"mx-auto max-w-3xl space-y-2",children:[g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsx(bL,{providers:Kt,defaultModel:st,value:Pt,onChange:ie=>void Tt(ie)}),Ct.length>0&&g.jsx("div",{className:"flex flex-wrap items-center gap-1",children:Ct.map((ie,Ne)=>g.jsxs("span",{className:"inline-flex max-w-[220px] items-center gap-1 truncate rounded border border-emerald-700/60 bg-emerald-900/20 px-1.5 py-0.5 text-[11px] text-emerald-200",title:`@${ie} — model will use its read tool to load this file when it needs to`,children:[g.jsx(Sf,{size:11,className:"shrink-0"}),g.jsx("span",{className:"truncate font-mono",children:ie}),g.jsx("button",{type:"button",onClick:()=>Gn(ie),className:"-mr-0.5 ml-0.5 rounded p-0.5 text-emerald-300/70 hover:bg-emerald-900/40 hover:text-emerald-100",title:`Remove @${ie}`,children:g.jsx(Br,{size:10})})]},`ref-${Ne}-${ie}`))}),_e!==void 0&&g.jsx("span",{className:"ml-auto text-[11px] text-red-400",children:_e})]}),h!==void 0&&g.jsxs("p",{className:"text-xs text-red-400",children:["Error: ",h]}),$!==void 0&&g.jsx("p",{className:"text-xs text-amber-400",children:$}),B.length>0&&g.jsx(xL,{attachments:B,previewUrls:Q.current,onRemove:te}),g.jsxs("div",{className:"flex items-end gap-2",children:[g.jsx("input",{ref:M,type:"file",multiple:!0,className:"hidden",onChange:ie=>{ie.target.files!==null&&le(ie.target.files),ie.target.value=""}}),g.jsx("button",{onClick:()=>{var ie;return(ie=M.current)==null?void 0:ie.click()},disabled:v||r,className:"self-stretch rounded-md border border-neutral-700 bg-neutral-900 px-2 text-neutral-300 hover:border-neutral-500 hover:text-neutral-100 disabled:cursor-not-allowed disabled:opacity-50",title:r?"Attachments aren't sent on steer (mid-turn). Wait for the current run to finish.":"Attach files (images go into model context; text files are prepended to the prompt)",children:g.jsx(Vb,{size:14})}),g.jsxs("div",{className:"relative flex-1",children:[P&&Y.length>0&&g.jsxs("div",{className:"absolute bottom-full left-0 right-0 z-10 mb-1 overflow-hidden rounded-md border border-neutral-700 bg-neutral-900 shadow-lg",children:[g.jsx("div",{className:"max-h-64 overflow-y-auto py-1",children:Y.map((ie,Ne)=>g.jsxs("button",{onMouseDown:Te=>{Te.preventDefault(),ie.available&&(U(Ne),ne())},onMouseEnter:()=>U(Ne),disabled:!ie.available,className:`block w-full px-3 py-1 text-left text-[12px] ${Ne===z&&ie.available?"bg-neutral-800 text-neutral-100":"text-neutral-300 hover:bg-neutral-900/80"} ${ie.available?"":"opacity-40"}`,title:ie.available?ie.description:`${ie.description} — unavailable right now`,children:[g.jsx("span",{className:"font-mono text-neutral-200",children:ie.name}),g.jsx("span",{className:"ml-2 text-[10px] text-neutral-500",children:ie.description})]},ie.name))}),g.jsx("div",{className:"border-t border-neutral-800 px-3 py-1 text-[10px] text-neutral-500",children:"↑↓ navigate · Enter/Tab run · Esc cancel"})]}),y!==void 0&&_.length>0&&g.jsxs("div",{className:"absolute bottom-full left-0 right-0 z-10 mb-1 overflow-hidden rounded-md border border-neutral-700 bg-neutral-900 shadow-lg",children:[g.jsx("div",{className:"max-h-64 overflow-y-auto py-1",children:_.map((ie,Ne)=>g.jsx("button",{onMouseDown:Te=>{Te.preventDefault(),xe(ie)},onMouseEnter:()=>N(Ne),className:`block w-full truncate px-3 py-1 text-left font-mono text-[12px] ${Ne===E?"bg-neutral-800 text-neutral-100":"text-neutral-300 hover:bg-neutral-900/80"}`,title:ie,children:ie},ie))}),g.jsx("div",{className:"border-t border-neutral-800 px-3 py-1 text-[10px] text-neutral-500",children:"↑↓ navigate · Enter/Tab insert · Esc close"})]}),g.jsx("textarea",{ref:b,value:m,onChange:ie=>Dt(ie.target.value),onKeyDown:Ot,onBlur:()=>{setTimeout(()=>{b.current!==document.activeElement&&Qe()},0)},placeholder:a?"Auto-retry in progress — your message will be queued and sent after the retry completes…":r?"Steer the agent (Enter to send, Shift+Enter for newline)…":n?"Ask pi (Enter to send, Shift+Enter for newline) — `/` runs commands, `@path` references files…":"Ask pi (Enter to send, Shift+Enter for newline) — `/` runs commands, `!` runs bash, `@path` references files…",title:a?"The agent is auto-retrying after a provider error. New messages are queued and delivered when the retry succeeds.":void 0,rows:3,className:`w-full resize-none rounded-md border bg-neutral-900 px-3 py-2 text-sm text-neutral-100 outline-none ${K==="local"?"border-amber-500 focus:border-amber-400":K==="context"?"border-emerald-500 focus:border-emerald-400":"border-neutral-700 focus:border-neutral-500"}`}),K!==void 0&&g.jsx("span",{className:`pointer-events-none absolute right-2 top-2 select-none rounded px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wide ${K==="local"?"bg-amber-500/15 text-amber-300":"bg-emerald-500/15 text-emerald-300"}`,title:K==="local"?"!! — runs bash; output stays local (excluded from LLM context)":"! — runs bash; output is added to the next turn's LLM context",children:K==="local"?"bash · local":"bash · context"})]}),g.jsxs("div",{className:"flex flex-row gap-1",children:[g.jsx("button",{onClick:()=>void Ye(),disabled:m.trim().length===0&&B.length===0||v,className:"rounded-md bg-neutral-100 px-4 py-2 text-sm font-medium text-neutral-900 disabled:cursor-not-allowed disabled:opacity-50",title:r?"Send (Pi queues at the next agent break — steer or follow-up depending on agent state)":"Send (Enter)",children:"Send"}),r&&g.jsx("button",{onClick:()=>void c(e),className:"rounded-md border border-red-700/50 px-3 py-2 text-sm text-red-300 hover:bg-red-900/20",title:"Stop the agent (or press Esc twice in the textbox)",children:"Abort"})]})]}),r&&g.jsx("p",{className:"text-[10px] text-neutral-600",children:"Send queues at the next agent break — Pi picks steer or follow-up. Abort: stop the agent (or press Esc twice in the textbox)."})]})})}function bL({providers:e,defaultModel:r,value:n,onChange:s}){const a=q.useMemo(()=>gL(e),[e]),[u,d]=q.useState(!1),[o,c]=q.useState(""),[h,m]=q.useState(0),f=q.useRef(null),v=q.useRef(null),w=q.useRef(null),A=q.useMemo(()=>{if(o.trim().length===0)return a;const E=[];for(const N of a){const T=mL(N,o);T!==void 0&&E.push({opt:N,score:T})}return E.sort((N,T)=>N.score-T.score),E.map(N=>N.opt)},[a,o]),b=a.find(E=>E.value===n),y=r!==void 0&&r.provider.length>0&&r.modelId.length>0?`${r.provider} / ${r.modelId}`:"",S=b!==void 0?`${b.provider} / ${b.name}`:y.length>0?`${y} (default)`:"default model";q.useEffect(()=>{if(!u)return;const E=N=>{f.current!==null&&(f.current.contains(N.target)||d(!1))};return window.addEventListener("mousedown",E),()=>window.removeEventListener("mousedown",E)},[u]),q.useEffect(()=>{u&&(c(""),m(0),requestAnimationFrame(()=>{var E;return(E=v.current)==null?void 0:E.focus()}))},[u]),q.useEffect(()=>{if(!u||w.current===null)return;const E=w.current.querySelector(`[data-idx="${h}"]`);E==null||E.scrollIntoView({block:"nearest"})},[u,h]);const _=E=>{if(E===-1)s("");else{const N=A[E];if(N===void 0)return;s(N.value)}d(!1)},x=E=>{E.key==="ArrowDown"?(E.preventDefault(),m(N=>Math.min(N+1,A.length-1))):E.key==="ArrowUp"?(E.preventDefault(),m(N=>Math.max(N-1,-1))):E.key==="Enter"?(E.preventDefault(),_(h)):E.key==="Escape"&&(E.preventDefault(),d(!1))};return g.jsxs("div",{ref:f,className:"relative",children:[g.jsxs("button",{onClick:()=>d(E=>!E),disabled:e===void 0,className:"flex max-w-[260px] items-center gap-1 truncate rounded border border-neutral-700 bg-neutral-900 px-2 py-1 text-left text-[11px] text-neutral-200 disabled:opacity-50",title:"Override the model for this session (click to search)",children:[g.jsx("span",{className:"text-neutral-500",children:"model:"}),g.jsx("span",{className:"truncate",children:S}),g.jsx("span",{className:"ml-1 text-neutral-500",children:"▾"})]}),u&&g.jsxs("div",{className:"absolute bottom-full left-0 z-10 mb-1 w-[360px] rounded border border-neutral-700 bg-neutral-950 shadow-xl",children:[g.jsx("input",{ref:v,value:o,onChange:E=>{c(E.target.value),m(0)},onKeyDown:x,placeholder:"Search provider or model…",className:"w-full border-b border-neutral-800 bg-transparent px-3 py-2 text-xs text-neutral-100 outline-none"}),g.jsxs("div",{ref:w,className:"max-h-72 overflow-y-auto py-1",children:[g.jsxs("button",{"data-idx":-1,onMouseEnter:()=>m(-1),onClick:()=>_(-1),className:`flex w-full items-center justify-between px-3 py-1.5 text-left text-xs ${h===-1?"bg-neutral-800 text-neutral-100":"text-neutral-400"}`,children:[g.jsxs("span",{className:"flex min-w-0 items-baseline gap-2",children:[g.jsx("span",{children:"Use agent default"}),y.length>0&&g.jsx("span",{className:"truncate font-mono text-[10px] text-neutral-500",children:y})]}),n===""&&g.jsx("span",{className:"text-emerald-400",children:"●"})]}),A.length===0?g.jsx("p",{className:"px-3 py-2 text-xs italic text-neutral-500",children:"No models match. Add an API key in Settings → Providers."}):A.map((E,N)=>g.jsxs("button",{"data-idx":N,onMouseEnter:()=>m(N),onClick:()=>_(N),className:`flex w-full items-center justify-between px-3 py-1.5 text-left text-xs ${N===h?"bg-neutral-800 text-neutral-100":"text-neutral-300"}`,children:[g.jsxs("span",{className:"flex min-w-0 items-baseline gap-2",children:[g.jsx("span",{className:"text-neutral-500",children:E.provider}),g.jsx("span",{className:"truncate font-mono",children:E.name})]}),E.value===n&&g.jsx("span",{className:"text-emerald-400",children:"●"})]},E.value))]}),g.jsxs("div",{className:"border-t border-neutral-800 px-3 py-1.5 text-[10px] text-neutral-600",children:[A.length," of ",a.length," models — ↑↓ to move, Enter to pick, Esc to close"]})]})]})}function xL({attachments:e,previewUrls:r,onRemove:n}){return g.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((s,a)=>{const u=s.type.startsWith("image/"),d=r.get(s);return g.jsxs("div",{className:"group relative flex items-center gap-1.5 rounded-md border border-neutral-700 bg-neutral-900 pr-1 text-xs text-neutral-200",children:[u&&d!==void 0?g.jsx("img",{src:d,alt:s.name,className:"h-12 w-12 shrink-0 rounded-l-md object-cover"}):g.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-l-md bg-neutral-800 text-neutral-400",children:u?g.jsx(OA,{size:14}):g.jsx(Vb,{size:12})}),g.jsxs("span",{className:"flex flex-col py-1 pl-1",children:[g.jsx("span",{className:"max-w-[160px] truncate font-mono text-[11px]",title:s.name,children:s.name}),g.jsx("span",{className:"text-[10px] text-neutral-500",children:_L(s.size)})]}),g.jsx("button",{onClick:()=>n(s),className:"ml-1 rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-red-300",title:`Remove ${s.name}`,children:g.jsx(Br,{size:16})})]},`${a}-${s.name}`)})})}function _L(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function SL({sessionId:e,alreadyOnChangesTab:r,onOpen:n}){const s=Oe(o=>o.streamingBySession[e]??!1),a=Oe(o=>o.agentEndCountBySession[e]??0),[u,d]=q.useState(0);return q.useEffect(()=>{d(0)},[e]),q.useEffect(()=>{if(s)return;let o=!1;return be.getTurnDiff(e).then(c=>{o||d(c.entries.length)}).catch(c=>{o||(c instanceof we&&c.status===404||typeof console<"u"&&console.warn("[ChangedFilesBadge] turn-diff fetch failed:",c),d(0))}),()=>{o=!0}},[e,a,s]),u===0||r?null:g.jsx("div",{className:"border-t border-neutral-800 bg-neutral-950 px-6 py-2",children:g.jsx("div",{className:"mx-auto max-w-3xl",children:g.jsxs("button",{onClick:n,className:"flex items-center gap-2 rounded-md border border-neutral-700 bg-neutral-900 px-3 py-1.5 text-xs text-neutral-200 hover:border-neutral-500 hover:bg-neutral-800",title:"Open the Last turn pane to review what the agent just wrote",children:[g.jsx(Kb,{size:12}),u===1?"1 file edited":`${u} files edited`,g.jsx("span",{className:"text-[10px] text-neutral-500",children:"— review"})]})})})}const wL=3e4,AL=[];function Bi(e){return e instanceof we?e.code:e instanceof Error?e.message:String(e)}const Yn=Ir((e,r)=>({settings:void 0,globalServers:{},byProject:{},loading:!1,error:void 0,pollHandle:void 0,startPolling:()=>{if(r().pollHandle!==void 0)return;const n=()=>{typeof document<"u"&&document.hidden||r().refreshSettings()};n();const s=window.setInterval(n,wL);e({pollHandle:s})},stopPolling:()=>{const n=r().pollHandle;n!==void 0&&(window.clearInterval(n),e({pollHandle:void 0}))},refreshSettings:async()=>{try{const n=await be.getMcpSettings();e({settings:n,error:void 0})}catch(n){if(!(n instanceof we)||n.status===401)return;e({error:Bi(n)})}},refreshProject:async n=>{if(n===void 0){try{const s=await be.listMcpServers();e({globalServers:s.servers,error:void 0})}catch(s){if(s instanceof we&&s.status===401)return;e({error:Bi(s)})}return}e({loading:!0});try{const s=await be.listMcpServers(n);e(a=>({loading:!1,error:void 0,globalServers:s.servers,byProject:{...a.byProject,[n]:{status:s.status,loadedAt:Date.now()}}}))}catch(s){e({loading:!1,error:Bi(s)})}},setMcpEnabled:async n=>{const s=r().settings;s!==void 0&&e({settings:{...s,enabled:n}});try{const a=await be.setMcpEnabled(n);e({settings:a,error:void 0})}catch(a){throw s!==void 0&&e({settings:s}),e({error:Bi(a)}),a}},upsertServer:async(n,s)=>{try{await be.upsertMcpServer(n,s),await Promise.all([r().refreshSettings(),...Object.keys(r().byProject).map(a=>r().refreshProject(a))])}catch(a){throw e({error:Bi(a)}),a}},deleteServer:async n=>{try{await be.deleteMcpServer(n),await Promise.all([r().refreshSettings(),...Object.keys(r().byProject).map(s=>r().refreshProject(s))])}catch(s){throw e({error:Bi(s)}),s}},probeServer:async(n,s)=>{try{await be.probeMcpServer(n,s),await Promise.all([r().refreshSettings(),r().refreshProject(s)])}catch(a){throw e({error:Bi(a)}),a}}})),vc=[{id:"dark",label:"Dark (default)",mode:"dark"},{id:"light",label:"Light",mode:"light"},{id:"dracula",label:"Dracula",mode:"dark"},{id:"solarized-dark",label:"Solarized Dark",mode:"dark"},{id:"catppuccin-mocha",label:"Catppuccin Mocha",mode:"dark"}],y1="forge.theme";function CL(e){return typeof e=="string"&&vc.some(r=>r.id===e)}function v1(){try{const e=localStorage.getItem(y1);if(CL(e))return e}catch{}return"dark"}function EL(e){try{localStorage.setItem(y1,e)}catch{}}function b1(e){typeof document>"u"||(document.documentElement.dataset.theme=e)}function kL(){const e=v1();return b1(e),e}const mf=Ir(e=>({theme:v1(),setTheme:r=>{b1(r),EL(r),e({theme:r})}}));function XM(e){return vc.find(r=>r.id===e)??vc[0]}function sr(e,r){if(typeof getComputedStyle>"u")return r;const n=getComputedStyle(document.documentElement).getPropertyValue(e).trim();return n.length>0?n:r}function NL({onClose:e,initialTab:r}){const n=Dr(c=>c.minimal),s=q.useMemo(()=>n?["skills","tools","appearance","backup","general"]:["providers","agent","mcp","tools","skills","appearance","backup","general"],[n]),[a,u]=q.useState(r??(n?"skills":"providers"));q.useEffect(()=>{s.includes(a)||u(s[0])},[s,a]),q.useEffect(()=>{r!==void 0&&s.includes(r)&&u(r)},[r,s]);const[d,o]=q.useState(void 0);return g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4 py-8",onClick:e,children:g.jsxs("div",{onClick:c=>c.stopPropagation(),className:"flex h-full max-h-[640px] w-full max-w-3xl flex-col overflow-hidden rounded-lg border border-neutral-800 bg-neutral-950 shadow-2xl",children:[g.jsxs("header",{className:"flex items-center justify-between border-b border-neutral-800 px-4 py-3",children:[g.jsx("div",{className:"flex items-center gap-1",children:s.map(c=>g.jsx("button",{onClick:()=>u(c),className:`rounded px-3 py-1 text-xs ${a===c?"bg-neutral-800 text-neutral-100":"text-neutral-400 hover:bg-neutral-900 hover:text-neutral-200"}`,children:c==="providers"?"Providers":c==="agent"?"Agent":c==="mcp"?"MCP":c==="tools"?"Tools":c==="skills"?"Skills":c==="appearance"?"Appearance":c==="backup"?"Backup":"General"},c))}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("button",{onClick:()=>{const c=ci(),h=c!==void 0?`/api/docs?token=${encodeURIComponent(c.token)}`:"/api/docs";window.open(h,"_blank","noopener,noreferrer")},className:"rounded border border-neutral-700 px-2 py-1 text-xs text-neutral-300 hover:border-neutral-500",title:"Open the OpenAPI / Swagger UI in a new tab. Carries your auth token automatically.",children:"API Docs ↗"}),g.jsx("button",{onClick:e,className:"rounded border border-neutral-700 px-2 py-1 text-xs text-neutral-300 hover:border-neutral-500",title:"Close (Esc)",children:"Close"})]})]}),d!==void 0&&g.jsx("div",{className:"border-b border-red-700/40 bg-red-900/20 px-4 py-2 text-xs text-red-300",children:d}),g.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 text-sm text-neutral-200",children:[a==="providers"&&g.jsx(TL,{onError:o}),a==="agent"&&g.jsx(jL,{onError:o}),a==="mcp"&&g.jsx(PL,{onError:o}),a==="tools"&&g.jsx(LL,{onError:o}),a==="skills"&&g.jsx(IL,{onError:o}),a==="appearance"&&g.jsx(ML,{}),a==="backup"&&g.jsx(zL,{onError:o}),a==="general"&&g.jsx($L,{})]})]})})}function St(e){return e instanceof we?e.code:e.message}function TL({onError:e}){const[r,n]=q.useState(void 0),[s,a]=q.useState(void 0),[u,d]=q.useState(void 0),[o,c]=q.useState(""),[h,m]=q.useState(!1),f=async()=>{e(void 0);try{const[A,b]=await Promise.all([be.getProviders(),be.getAuthSummary()]);n(A),a(b)}catch(A){e(`Failed to load providers: ${St(A)}`)}};q.useEffect(()=>{f()},[]);const v=async A=>{if(o.trim().length!==0){m(!0);try{await be.setApiKey(A,o.trim()),d(void 0),c(""),await f()}catch(b){e(`Save key failed: ${St(b)}`)}finally{m(!1)}}},w=async A=>{if(confirm(`Remove the stored key for "${A}"?`)){m(!0);try{await be.removeApiKey(A),await f()}catch(b){e(`Remove key failed: ${St(b)}`)}finally{m(!1)}}};return r===void 0?g.jsx("p",{className:"text-xs italic text-neutral-500",children:"Loading providers…"}):g.jsxs("div",{className:"space-y-3",children:[g.jsxs("p",{className:"text-xs text-neutral-500",children:["Built-in providers and anything in ",g.jsx("code",{className:"font-mono",children:"models.json"}),". Stored API keys are presence-only — actual values are never sent to the browser."]}),r.providers.length===0&&g.jsx("p",{className:"text-xs italic text-neutral-500",children:"No providers configured."}),r.providers.map(A=>{const b=s==null?void 0:s.providers[A.provider],y=(b==null?void 0:b.configured)===!0,S=u===A.provider;return g.jsxs("div",{className:"rounded border border-neutral-800 bg-neutral-900/40 p-3",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"font-mono text-sm text-neutral-100",children:A.provider}),g.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider ${y?"bg-emerald-900/40 text-emerald-300":"bg-neutral-800 text-neutral-500"}`,children:y?"key set":"no key"}),(b==null?void 0:b.source)!==void 0&&g.jsxs("span",{className:"text-[10px] text-neutral-500",children:["via ",b.source]})]}),g.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[!S&&g.jsx("button",{onClick:()=>{d(A.provider),c("")},className:"rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500",children:y?"Replace key":"Add key"}),y&&!S&&g.jsx("button",{onClick:()=>void w(A.provider),disabled:h,className:"rounded border border-red-700/50 px-2 py-0.5 text-red-300 hover:bg-red-900/20 disabled:opacity-50",children:"Remove"})]})]}),S&&g.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[g.jsx("input",{type:"password",value:o,onChange:_=>c(_.target.value),placeholder:"Paste API key",autoFocus:!0,className:"flex-1 rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-xs text-neutral-100 outline-none focus:border-neutral-500"}),g.jsx("button",{onClick:()=>void v(A.provider),disabled:h||o.trim().length===0,className:"rounded bg-neutral-100 px-2 py-1 text-xs font-medium text-neutral-900 disabled:opacity-50",children:"Save"}),g.jsx("button",{onClick:()=>{d(void 0),c("")},className:"rounded border border-neutral-700 px-2 py-1 text-xs text-neutral-300",children:"Cancel"})]}),g.jsxs("details",{className:"mt-2",children:[g.jsxs("summary",{className:"cursor-pointer text-[11px] text-neutral-500",children:[A.models.length," model",A.models.length===1?"":"s"]}),g.jsx("ul",{className:"mt-1 space-y-0.5 text-[11px]",children:A.models.map(_=>g.jsxs("li",{className:"flex justify-between font-mono",children:[g.jsx("span",{className:_.hasAuth?"text-neutral-300":"text-neutral-600",children:_.name}),g.jsxs("span",{className:"text-neutral-600",children:["ctx ",Math.round(_.contextWindow/1e3),"k"]})]},_.id))})]})]},A.provider)}),g.jsx(RL,{onError:e})]})}function RL({onError:e}){const[r,n]=q.useState(void 0),[s,a]=q.useState(!1),[u,d]=q.useState(void 0);x1(u,()=>d(void 0));const o=async()=>{try{const h=await be.getModelsJson();n(JSON.stringify(h,null,2))}catch(h){e(`Load models.json failed: ${St(h)}`)}},c=async()=>{if(r===void 0)return;let h;try{h=JSON.parse(r)}catch{e("models.json: invalid JSON");return}if(typeof h!="object"||h===null||typeof h.providers!="object"||h.providers===null){e('models.json: top-level must be { "providers": { ... } }');return}a(!0),d(void 0);try{await be.setModelsJson(h),e(void 0),d(Date.now())}catch(m){e(`Save failed: ${St(m)}`)}finally{a(!1)}};return g.jsxs("details",{className:"rounded border border-neutral-800 bg-neutral-900/40 p-3",children:[g.jsx("summary",{className:"cursor-pointer text-xs text-neutral-300",onClick:()=>{r===void 0&&o()},children:"Custom providers (models.json)"}),g.jsx("p",{className:"mt-1 text-[11px] text-neutral-500",children:"Raw JSON editor. Add vLLM / LiteLLM / Ollama / OpenAI-compatible endpoints here. The SDK validates on next session creation."}),r===void 0?g.jsx("p",{className:"mt-2 text-xs italic text-neutral-500",children:"Loading…"}):g.jsxs(g.Fragment,{children:[g.jsx("textarea",{value:r,onChange:h=>n(h.target.value),spellCheck:!1,rows:10,className:"mt-2 w-full rounded border border-neutral-700 bg-neutral-950 px-2 py-1 font-mono text-[11px] text-neutral-100 outline-none focus:border-neutral-500"}),g.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2 text-xs",children:[u!==void 0&&g.jsx("span",{className:"text-emerald-400","aria-live":"polite",children:"Saved"}),g.jsx("button",{onClick:()=>void o(),disabled:s,className:"rounded border border-neutral-700 px-2 py-1 text-neutral-300",children:"Reload"}),g.jsx("button",{onClick:()=>void c(),disabled:s,className:"rounded bg-neutral-100 px-3 py-1 font-medium text-neutral-900 disabled:opacity-50",children:s?"Saving…":"Save"})]})]})]})}function jL({onError:e}){const[r,n]=q.useState(void 0),[s,a]=q.useState(!1),[u,d]=q.useState("form"),o=async()=>{e(void 0);try{const m=await be.getSettings();n(m)}catch(m){e(`Failed to load settings: ${St(m)}`)}};q.useEffect(()=>{o()},[]);const c=m=>{if(r===void 0)return"";const f=r[m];return typeof f=="string"?f:""},h=async m=>{a(!0);try{const f=await be.updateSettings(m);n(f)}catch(f){e(`Save failed: ${St(f)}`)}finally{a(!1)}};return r===void 0?g.jsx("p",{className:"text-xs italic text-neutral-500",children:"Loading settings…"}):u==="json"?g.jsx(DL,{initial:r,onSave:async m=>{const f={...m};for(const v of Object.keys(r))v in m||(f[v]=null);a(!0);try{const v=await be.updateSettings(f);n(v),e(void 0)}catch(v){throw e(`Save failed: ${St(v)}`),v}finally{a(!1)}},onSwitchToForm:()=>d("form"),busy:s,onError:e}):g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("p",{className:"text-xs text-neutral-500",children:"Defaults for new sessions. The form covers common keys; switch to JSON to edit anything the SDK accepts."}),g.jsx("button",{onClick:()=>d("json"),className:"rounded border border-neutral-700 px-2 py-0.5 text-[11px] text-neutral-300 hover:border-neutral-500",children:"Edit as JSON"})]}),g.jsx(Wa,{label:"Default provider",hint:"e.g. anthropic, openai, google, custom",children:g.jsx(Cb,{value:c("defaultProvider"),onSave:m=>h({defaultProvider:m.length===0?null:m}),disabled:s})}),g.jsx(Wa,{label:"Default model",hint:"model id from the chosen provider",children:g.jsx(Cb,{value:c("defaultModel"),onSave:m=>h({defaultModel:m.length===0?null:m}),disabled:s})}),g.jsx(Wa,{label:"Thinking level",hint:"off, low, medium, high (provider-dependent)",children:g.jsx(Lh,{value:c("defaultThinkingLevel"),options:["","off","low","medium","high"],onSave:m=>h({defaultThinkingLevel:m.length===0?null:m}),disabled:s})}),g.jsx(Wa,{label:"Steering mode",hint:"how interruptions during streaming are queued",children:g.jsx(Lh,{value:c("steeringMode"),options:["","steer","followUp"],onSave:m=>h({steeringMode:m.length===0?null:m}),disabled:s})}),g.jsx(Wa,{label:"Follow-up mode",hint:"how queued messages are delivered after agent_end",children:g.jsx(Lh,{value:c("followUpMode"),options:["","steer","followUp"],onSave:m=>h({followUpMode:m.length===0?null:m}),disabled:s})})]})}function DL({initial:e,onSave:r,onSwitchToForm:n,busy:s,onError:a}){const[u,d]=q.useState(()=>JSON.stringify(e,null,2)),[o,c]=q.useState(void 0);x1(o,()=>c(void 0));const h=async()=>{let m;try{m=JSON.parse(u)}catch{a("settings.json: invalid JSON");return}if(typeof m!="object"||m===null||Array.isArray(m)){a("settings.json: top-level must be an object");return}c(void 0);try{await r(m),c(Date.now())}catch{}};return g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("p",{className:"text-[11px] text-neutral-500",children:["Raw ",g.jsx("code",{className:"font-mono",children:"settings.json"}),". Keys removed here are deleted on save (mapped to ",g.jsx("code",{className:"font-mono",children:"null"})," in the merge patch). The SDK validates on next session creation."]}),g.jsx("button",{onClick:n,className:"rounded border border-neutral-700 px-2 py-0.5 text-[11px] text-neutral-300 hover:border-neutral-500",children:"Back to form"})]}),g.jsx("textarea",{value:u,onChange:m=>d(m.target.value),spellCheck:!1,rows:18,className:"w-full rounded border border-neutral-700 bg-neutral-950 px-2 py-1 font-mono text-[11px] text-neutral-100 outline-none focus:border-neutral-500"}),g.jsxs("div",{className:"flex items-center justify-end gap-2 text-xs",children:[o!==void 0&&g.jsx("span",{className:"text-emerald-400","aria-live":"polite",children:"Saved"}),g.jsx("button",{onClick:()=>d(JSON.stringify(e,null,2)),disabled:s,className:"rounded border border-neutral-700 px-2 py-1 text-neutral-300",children:"Reset"}),g.jsx("button",{onClick:()=>void h(),disabled:s,className:"rounded bg-neutral-100 px-3 py-1 font-medium text-neutral-900 disabled:opacity-50",children:s?"Saving…":"Save"})]})]})}const BL=2500;function x1(e,r){q.useEffect(()=>{if(e===void 0)return;const n=window.setTimeout(r,BL);return()=>window.clearTimeout(n)},[e,r])}function Wa({label:e,hint:r,children:n}){return g.jsxs("div",{className:"space-y-1",children:[g.jsx("label",{className:"block text-xs font-medium text-neutral-200",children:e}),r!==void 0&&g.jsx("p",{className:"text-[11px] text-neutral-500",children:r}),n]})}function Cb({value:e,onSave:r,disabled:n}){const[s,a]=q.useState(e);q.useEffect(()=>a(e),[e]);const u=s!==e;return g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("input",{value:s,onChange:d=>a(d.target.value),disabled:n,className:"flex-1 rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-xs text-neutral-100 outline-none focus:border-neutral-500"}),g.jsx("button",{onClick:()=>void r(s),disabled:n||!u,className:"rounded bg-neutral-100 px-2 py-1 text-xs font-medium text-neutral-900 disabled:opacity-50",children:"Save"})]})}function Lh({value:e,options:r,onSave:n,disabled:s}){return g.jsx("select",{value:e,disabled:s,onChange:a=>void n(a.target.value),className:"rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-xs text-neutral-100",children:r.map(a=>g.jsx("option",{value:a,children:a.length===0?"(unset)":a},a))})}function IL({onError:e}){const r=hr(),n=Wt(b=>b.projects),[s,a]=q.useState(void 0),[u,d]=q.useState({}),[o,c]=q.useState({}),[h,m]=q.useState(!1),f=async()=>{if(r!==void 0){e(void 0);try{const[{skills:b},y]=await Promise.all([be.listSkills(r.id),be.listSkillOverrides()]);a(b),d(y.projects)}catch(b){e(`Failed to load skills: ${St(b)}`)}}};if(q.useEffect(()=>{f()},[r==null?void 0:r.id]),r===void 0)return g.jsx("p",{className:"text-xs italic text-neutral-500",children:"Pick a project from the header to manage its skills."});if(s===void 0)return g.jsxs("p",{className:"text-xs italic text-neutral-500",children:["Loading skills for ",r.name,"…"]});const v=async(b,y)=>{m(!0);try{const{skills:S}=await be.setSkillEnabled(r.id,b,y,"global");a(S)}catch(S){e(`Toggle failed: ${St(S)}`)}finally{m(!1)}},w=async(b,y,S)=>{m(!0);try{S===void 0?await be.clearSkillProjectOverride(b,y):await be.setSkillEnabled(b,y,S==="enabled","project"),await f()}catch(_){e(`Override write failed: ${St(_)}`)}finally{m(!1)}},A=(b,y)=>{const S=u[b];if(S!==void 0){if(S.enable.includes(y))return"enabled";if(S.disable.includes(y))return"disabled"}};return g.jsxs("div",{className:"space-y-2",children:[g.jsxs("p",{className:"text-xs text-neutral-500",children:["Skills discovered in ",g.jsx("code",{className:"font-mono",children:"~/.pi/agent/skills/"})," and"," ",g.jsxs("code",{className:"font-mono",children:[r.path,"/.pi/skills/"]}),". The global toggle writes to pi's ",g.jsx("code",{className:"font-mono",children:"settings.skills"}),"; per-project overrides write to the pi-forge-private file at"," ",g.jsx("code",{className:"font-mono",children:"${FORGE_DATA_DIR}/skills-overrides.json"}),"."]}),g.jsxs("div",{className:"rounded border border-amber-700/40 bg-amber-900/10 px-3 py-2 text-[11px] text-amber-200",children:["Skill changes apply to the ",g.jsx("strong",{children:"next session"})," you start in the affected project. Live sessions keep the skill set they booted with — start a new session to use a freshly enabled skill."]}),s.length===0&&g.jsx("p",{className:"text-xs italic text-neutral-500",children:"No skills found for this project."}),s.map(b=>{const y=`${b.source}:${b.name}`,S=o[y]===!0,_=n.map(E=>({project:E,state:A(E.id,b.name)})).filter(E=>E.state!==void 0),x=n.filter(E=>A(E.id,b.name)===void 0);return g.jsxs("div",{className:"rounded border border-neutral-800 bg-neutral-900/40",children:[g.jsxs("div",{className:"flex items-start gap-3 p-3",children:[g.jsx("span",{className:`mt-1.5 inline-block h-2.5 w-2.5 rounded-full ${b.effective?"bg-emerald-500":"bg-neutral-700"}`,title:`Effective for ${r.name}: ${b.effective?"enabled":"disabled"}`}),g.jsxs("div",{className:"flex-1 space-y-0.5",children:[g.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[g.jsx("span",{className:"font-mono text-neutral-100",children:b.name}),g.jsx("span",{className:"rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400",children:b.source}),b.projectOverride!==void 0&&g.jsxs("span",{className:`rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider ${b.projectOverride==="enabled"?"bg-emerald-900/40 text-emerald-300":"bg-red-900/40 text-red-300"}`,title:`Active project ('${r.name}') has an override`,children:["Project: ",b.projectOverride]})]}),g.jsx("p",{className:"text-xs text-neutral-400",children:b.description||"(no description)"}),g.jsx("p",{className:"font-mono text-[10px] text-neutral-600",children:b.filePath})]}),g.jsxs("div",{className:"flex shrink-0 items-center gap-1 text-xs",children:[g.jsxs("button",{onClick:()=>void v(b.name,!b.enabled),disabled:h,className:`rounded border px-2 py-0.5 ${b.enabled?"border-emerald-700/50 bg-emerald-900/20 text-emerald-300":"border-neutral-700 text-neutral-300 hover:border-neutral-500"}`,title:"Global enable in pi's settings.skills",children:["Global: ",b.enabled?"enabled":"disabled"]}),g.jsx("button",{onClick:()=>c(E=>({...E,[y]:!S})),className:"rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500",title:"Show per-project overrides",children:S?"▾ Overrides":`▸ Overrides (${_.length})`})]})]}),S&&g.jsxs("div",{className:"border-t border-neutral-800 px-3 py-2",children:[_.length===0?g.jsx("p",{className:"mb-2 text-[11px] italic text-neutral-500",children:"No project overrides yet — every project inherits the global state."}):g.jsx("div",{className:"mb-2 space-y-1",children:_.map(({project:E,state:N})=>g.jsxs("div",{className:"flex items-center justify-between gap-2 rounded bg-neutral-900/60 px-2 py-1 text-xs",children:[g.jsx("span",{className:"truncate text-neutral-200",title:E.path,children:E.name}),g.jsx(_1,{value:N,disabled:h,onChange:T=>void w(E.id,b.name,T)})]},E.id))}),x.length>0&&g.jsx(S1,{projects:x,disabled:h,onAdd:(E,N)=>void w(E,b.name,N)})]})]},y)})]})}function _1({value:e,disabled:r,onChange:n}){const s=(a,u,d)=>g.jsx("button",{onClick:()=>n(u),disabled:r,className:`rounded px-2 py-0.5 text-[11px] ${d?u==="enabled"?"bg-emerald-900/40 text-emerald-300":u==="disabled"?"bg-red-900/40 text-red-300":"bg-neutral-800 text-neutral-400":"text-neutral-500 hover:bg-neutral-800 hover:text-neutral-300"}`,children:a});return g.jsxs("div",{className:"flex shrink-0 items-center gap-0.5 rounded border border-neutral-700 px-0.5",children:[s("Inherit",void 0,e===void 0),s("Enabled","enabled",e==="enabled"),s("Disabled","disabled",e==="disabled")]})}function S1({projects:e,disabled:r,onAdd:n}){const[s,a]=q.useState(!1),[u,d]=q.useState("");return s?g.jsxs("div",{className:"flex flex-wrap items-center gap-1 text-[11px]",children:[g.jsxs("select",{value:u,onChange:o=>d(o.target.value),className:"rounded border border-neutral-700 bg-neutral-950 px-2 py-0.5 text-neutral-100 outline-none focus:border-neutral-500",children:[g.jsx("option",{value:"",children:"Pick project…"}),e.map(o=>g.jsx("option",{value:o.id,children:o.name},o.id))]}),g.jsx("button",{onClick:()=>{u.length!==0&&(n(u,"enabled"),a(!1),d(""))},disabled:r||u.length===0,className:"rounded bg-emerald-900/40 px-2 py-0.5 text-emerald-300 disabled:opacity-50",children:"Enable here"}),g.jsx("button",{onClick:()=>{u.length!==0&&(n(u,"disabled"),a(!1),d(""))},disabled:r||u.length===0,className:"rounded bg-red-900/40 px-2 py-0.5 text-red-300 disabled:opacity-50",children:"Disable here"}),g.jsx("button",{onClick:()=>{a(!1),d("")},className:"rounded border border-neutral-700 px-2 py-0.5 text-neutral-400 hover:border-neutral-500",children:"Cancel"})]}):g.jsx("button",{onClick:()=>a(!0),disabled:r,className:"rounded border border-neutral-700 px-2 py-0.5 text-[11px] text-neutral-300 hover:border-neutral-500",children:"+ Add override for…"})}function LL({onError:e}){const r=Wt(f=>f.projects),[n,s]=q.useState(void 0),[a,u]=q.useState({}),[d,o]=q.useState(!1),c=async()=>{e(void 0);try{const[f,v]=await Promise.all([be.listTools(),be.listToolOverrides()]);s(f),u(v.projects)}catch(f){e(`Failed to load tools: ${St(f)}`)}};q.useEffect(()=>{c()},[]);const h=async(f,v,w)=>{o(!0);try{await be.setToolEnabled(f,v,w,"global"),await c()}catch(A){e(`Toggle failed: ${St(A)}`)}finally{o(!1)}},m=async(f,v,w,A)=>{o(!0);try{A===void 0?await be.clearToolProjectOverride(f,w,v):await be.setToolEnabled(f,w,A==="enabled","project",v),await c()}catch(b){e(`Override write failed: ${St(b)}`)}finally{o(!1)}};return n===void 0?g.jsx("p",{className:"text-xs italic text-neutral-500",children:"Loading tools…"}):g.jsxs("div",{className:"space-y-4",children:[g.jsxs("p",{className:"text-xs text-neutral-500",children:["Toggle individual built-in tools the agent can call. The global toggle on the right is the default for every project. Use ",g.jsx("strong",{children:"Overrides"})," to enable/disable a tool per project — explicit project overrides win over the global default. Changes apply to the next session — already-running sessions keep the tool set they started with. MCP server tools live under their respective server in the ",g.jsx("strong",{children:"MCP"})," tab."]}),g.jsxs("section",{children:[g.jsx("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-neutral-400",children:"Built-in tools"}),g.jsx("div",{className:"space-y-2",children:n.builtin.map(f=>g.jsx(yf,{family:"builtin",name:f.name,fqn:f.name,description:f.description,globalEnabled:f.globalEnabled,projects:r,allOverrides:a,busy:d,onToggleGlobal:v=>void h("builtin",f.name,v),onSetProjectOverride:(v,w)=>void m("builtin",v,f.name,w)},`builtin:${f.name}`))})]}),n.extension.length>0&&g.jsxs("section",{children:[g.jsx("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-neutral-400",children:"Extension tools"}),g.jsxs("p",{className:"mb-2 text-[11px] text-neutral-500",children:["Tools registered programmatically by pi extensions installed under"," ",g.jsx("code",{className:"font-mono",children:"~/.pi/agent/extensions/"})," or a project's"," ",g.jsx("code",{className:"font-mono",children:".pi/extensions/"}),". Disabled tools are dropped from the allowlist passed to the next session — the extension itself remains loaded."]}),g.jsx("div",{className:"space-y-4",children:n.extension.map(f=>g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"text-[11px] font-semibold text-neutral-300",children:["Package: ",g.jsx("code",{className:"font-mono text-neutral-400",children:f.packageSource})]}),g.jsx("div",{className:"space-y-2",children:f.tools.map(v=>g.jsx(yf,{family:"extension",name:v.name,fqn:v.name,description:v.description,globalEnabled:v.globalEnabled,projects:r,allOverrides:a,busy:d,onToggleGlobal:w=>void h("extension",v.name,w),onSetProjectOverride:(w,A)=>void m("extension",w,v.name,A)},`extension:${f.packageSource}:${v.name}`))})]},f.packageSource))})]})]})}function yf({family:e,name:r,fqn:n,description:s,globalEnabled:a,projects:u,allOverrides:d,busy:o,onToggleGlobal:c,onSetProjectOverride:h}){const[m,f]=q.useState(!1),v=b=>{const y=d[b];if(y===void 0)return;const S=e==="builtin"?y.builtin:e==="mcp"?y.mcp:y.extension;if(S!==void 0){if(S.enable.includes(n))return"enabled";if(S.disable.includes(n))return"disabled"}},w=u.map(b=>({project:b,state:v(b.id)})).filter(b=>b.state!==void 0),A=u.filter(b=>v(b.id)===void 0);return g.jsxs("div",{className:"rounded border border-neutral-800 bg-neutral-900/40",children:[g.jsxs("div",{className:"flex items-start gap-3 p-3",children:[g.jsx("span",{className:`mt-1.5 inline-block h-2.5 w-2.5 rounded-full ${a?"bg-emerald-500":"bg-neutral-700"}`,title:`Global default: ${a?"enabled":"disabled"}`}),g.jsxs("div",{className:"min-w-0 flex-1 space-y-0.5",children:[g.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[g.jsx("span",{className:"font-mono text-neutral-100",children:r}),n!==r&&g.jsx("span",{className:"font-mono text-[10px] text-neutral-500",title:"Bridged tool name pi sees on the wire",children:n})]}),s.length>0&&g.jsx("p",{className:"line-clamp-2 text-[11px] text-neutral-500",title:s,children:s})]}),g.jsxs("div",{className:"flex shrink-0 items-center gap-1 text-xs",children:[g.jsxs("button",{onClick:()=>c(!a),disabled:o,className:`rounded border px-2 py-0.5 disabled:opacity-50 ${a?"border-emerald-700/50 bg-emerald-900/20 text-emerald-300":"border-neutral-700 text-neutral-300 hover:border-neutral-500"}`,title:"Global default for every project that doesn't override",children:["Global: ",a?"enabled":"disabled"]}),g.jsx("button",{onClick:()=>f(b=>!b),className:"rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500",title:"Show per-project overrides",children:m?"▾ Overrides":`▸ Overrides (${w.length})`})]})]}),m&&g.jsxs("div",{className:"border-t border-neutral-800 px-3 py-2",children:[w.length===0?g.jsx("p",{className:"mb-2 text-[11px] italic text-neutral-500",children:"No project overrides yet — every project inherits the global state."}):g.jsx("div",{className:"mb-2 space-y-1",children:w.map(({project:b,state:y})=>g.jsxs("div",{className:"flex items-center justify-between gap-2 rounded bg-neutral-900/60 px-2 py-1 text-xs",children:[g.jsx("span",{className:"truncate text-neutral-200",title:b.path,children:b.name}),g.jsx(_1,{value:y,disabled:o,onChange:S=>h(b.id,S)})]},b.id))}),A.length>0&&g.jsx(S1,{projects:A,disabled:o,onAdd:(b,y)=>h(b,y)}),u.length===0&&g.jsx("p",{className:"text-[11px] italic text-neutral-500",children:"No projects exist yet. Create a project first to add per-project overrides."})]})]})}function ML(){const e=mf(n=>n.theme),r=mf(n=>n.setTheme);return g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-sm font-semibold text-neutral-100",children:"Theme"}),g.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Sets the color palette for the chrome, editor, and terminal. Persisted in this browser only — open in another browser to use a different theme there."})]}),g.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:vc.map(n=>{const s=n.id===e;return g.jsxs("button",{onClick:()=>r(n.id),className:`flex items-center justify-between gap-3 rounded border px-3 py-2 text-left ${s?"border-neutral-400 bg-neutral-800":"border-neutral-700 hover:border-neutral-500"}`,children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm text-neutral-100",children:n.label}),g.jsx("div",{className:"text-[10px] uppercase tracking-wider text-neutral-500",children:n.mode})]}),g.jsx(OL,{id:n.id})]},n.id)})})]})}function OL({id:e}){return g.jsxs("div",{"data-theme":e,className:"flex h-6 overflow-hidden rounded border border-neutral-700",children:[g.jsx("div",{className:"w-4 bg-neutral-950"}),g.jsx("div",{className:"w-4 bg-neutral-800"}),g.jsx("div",{className:"w-4 bg-neutral-500"}),g.jsx("div",{className:"w-4 bg-neutral-200"})]})}function zL({onError:e}){const[r,n]=q.useState(!1),[s,a]=q.useState(void 0),[u,d]=q.useState(void 0),o=q.useRef(null),[c,h]=q.useState(void 0),[m,f]=q.useState(void 0),v=q.useRef(null),w=q.useRef(null),A=async()=>{e(void 0),n(!0),d(void 0);try{const{blob:x,filename:E,files:N}=await be.exportConfig(),T=URL.createObjectURL(x),j=document.createElement("a");j.href=T,j.download=E,document.body.appendChild(j),j.click(),document.body.removeChild(j),requestAnimationFrame(()=>URL.revokeObjectURL(T)),a({filename:E,files:N})}catch(x){e(`Export failed: ${St(x)}`)}finally{n(!1)}},b=async x=>{e(void 0),n(!0),a(void 0);try{const E=await be.importConfig(x);d(E)}catch(E){e(`Import failed: ${St(E)}`)}finally{n(!1),o.current&&(o.current.value="")}},y=(x,E)=>{const N=URL.createObjectURL(x),T=document.createElement("a");T.href=N,T.download=E,document.body.appendChild(T),T.click(),document.body.removeChild(T),requestAnimationFrame(()=>URL.revokeObjectURL(N))},S=async()=>{e(void 0),n(!0),f(void 0),h(void 0);try{const{blob:x,filename:E,fileCount:N}=await be.exportSkills();y(x,E),h({filename:E,fileCount:N})}catch(x){x instanceof we&&x.code==="skills_directory_empty"?h({filename:"",fileCount:0}):e(`Skills export failed: ${St(x)}`)}finally{n(!1)}},_=async x=>{if(x.length!==0){e(void 0),n(!0),h(void 0);try{const E=await be.importSkills(x);f(E)}catch(E){e(`Skills import failed: ${St(E)}`)}finally{n(!1),v.current&&(v.current.value=""),w.current&&(w.current.value="")}}};return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("section",{children:[g.jsx("h3",{className:"mb-2 text-sm font-medium text-neutral-100",children:"Export config"}),g.jsxs("p",{className:"mb-3 text-xs text-neutral-400",children:["Downloads a ",g.jsx("code",{className:"font-mono",children:".tar.gz"})," with"," ",g.jsx("code",{className:"font-mono",children:"mcp.json"}),","," ",g.jsx("code",{className:"font-mono",children:"settings.json"}),", and"," ",g.jsx("code",{className:"font-mono",children:"models.json"}),". Provider auth (",g.jsx("code",{className:"font-mono",children:"auth.json"})," — API keys, OAuth tokens) is"," ",g.jsx("strong",{children:"not"})," included; re-authenticate providers after restoring on a new install."]}),g.jsx("button",{onClick:()=>void A(),disabled:r,className:"rounded border border-neutral-700 bg-neutral-900 px-3 py-1.5 text-xs text-neutral-100 hover:border-neutral-500 disabled:opacity-50",children:r?"Exporting…":"Download config archive"}),s!==void 0&&g.jsxs("p",{className:"mt-2 text-xs text-emerald-400",children:["Exported ",g.jsx("code",{className:"font-mono",children:s.filename})," (",s.files.length===0?"no files were on disk":`included: ${s.files.join(", ")}`,")"]})]}),g.jsxs("section",{children:[g.jsx("h3",{className:"mb-2 text-sm font-medium text-neutral-100",children:"Import config"}),g.jsxs("p",{className:"mb-3 text-xs text-neutral-400",children:["Restores a previously-exported archive. Each file is parsed before any disk write — if any file fails validation, ",g.jsx("strong",{children:"nothing"})," is imported. Existing live agent sessions keep their original settings until restarted."]}),g.jsx("input",{ref:o,type:"file",accept:".gz,.tgz,application/gzip,application/x-gzip",disabled:r,onChange:x=>{var N;const E=(N=x.target.files)==null?void 0:N[0];E!==void 0&&b(E)},className:"block text-xs text-neutral-300 file:mr-3 file:rounded file:border file:border-neutral-700 file:bg-neutral-900 file:px-3 file:py-1.5 file:text-xs file:text-neutral-100 hover:file:border-neutral-500 disabled:opacity-50"}),u!==void 0&&g.jsxs("div",{className:"mt-3 space-y-1 text-xs",children:[u.imported.length>0&&g.jsxs("p",{className:"text-emerald-400",children:["Imported: ",g.jsx("code",{className:"font-mono",children:u.imported.join(", ")})]}),u.skipped.length>0&&g.jsxs("p",{className:"text-amber-400",children:["Skipped (not in allow-list):"," ",g.jsx("code",{className:"font-mono",children:u.skipped.join(", ")})]}),u.errors.length>0&&g.jsxs("div",{className:"text-red-400",children:[g.jsx("p",{children:"Errors — nothing was written:"}),g.jsx("ul",{className:"ml-4 list-disc",children:u.errors.map(x=>g.jsxs("li",{children:[g.jsx("code",{className:"font-mono",children:x.file}),": ",x.reason]},x.file))})]}),u.imported.length===0&&u.errors.length===0&&u.skipped.length===0&&g.jsx("p",{className:"italic text-neutral-500",children:"Archive was empty."})]})]}),g.jsxs("section",{children:[g.jsx("h3",{className:"mb-2 text-sm font-medium text-neutral-100",children:"Export skills"}),g.jsxs("p",{className:"mb-3 text-xs text-neutral-400",children:["Downloads a ",g.jsx("code",{className:"font-mono",children:".tar.gz"})," of every file under"," ",g.jsx("code",{className:"font-mono",children:"~/.pi/agent/skills/"})," — both single-file (",g.jsx("code",{className:"font-mono",children:"<name>.md"}),") and directory skills (",g.jsx("code",{className:"font-mono",children:"<name>/SKILL.md"})," + assets) round-trip verbatim."]}),g.jsx("button",{onClick:()=>void S(),disabled:r,className:"rounded border border-neutral-700 bg-neutral-900 px-3 py-1.5 text-xs text-neutral-100 hover:border-neutral-500 disabled:opacity-50",children:r?"Working…":"Download skills archive"}),c!==void 0&&(c.fileCount===0?g.jsx("p",{className:"mt-2 text-xs text-neutral-400",children:"No skills to export — your skills directory is empty."}):g.jsxs("p",{className:"mt-2 text-xs text-emerald-400",children:["Exported ",g.jsx("code",{className:"font-mono",children:c.filename})," (",c.fileCount," file",c.fileCount===1?"":"s"," packed)"]}))]}),g.jsxs("section",{children:[g.jsx("h3",{className:"mb-2 text-sm font-medium text-neutral-100",children:"Import skills"}),g.jsxs("p",{className:"mb-3 text-xs text-neutral-400",children:["Restore skills from a previously-exported ",g.jsx("code",{className:"font-mono",children:".tar.gz"}),", OR upload a folder of skill files directly. Existing files at the same path are"," ",g.jsx("strong",{children:"overwritten"}),"; new files are added. Path traversal and absolute paths are rejected."]}),g.jsxs("div",{className:"space-y-3",children:[g.jsxs("label",{className:"block space-y-1",children:[g.jsx("span",{className:"text-[11px] uppercase tracking-wider text-neutral-500",children:"From tar.gz"}),g.jsx("input",{ref:v,type:"file",accept:".gz,.tgz,application/gzip,application/x-gzip",disabled:r,onChange:x=>{var N;const E=(N=x.target.files)==null?void 0:N[0];E!==void 0&&_([E])},className:"block text-xs text-neutral-300 file:mr-3 file:rounded file:border file:border-neutral-700 file:bg-neutral-900 file:px-3 file:py-1.5 file:text-xs file:text-neutral-100 hover:file:border-neutral-500 disabled:opacity-50"})]}),g.jsxs("label",{className:"block space-y-1",children:[g.jsx("span",{className:"text-[11px] uppercase tracking-wider text-neutral-500",children:"From folder (Chromium / WebKit only)"}),g.jsx("input",{ref:w,type:"file",multiple:!0,webkitdirectory:"",disabled:r,onChange:x=>{const E=x.target.files;E===null||E.length===0||_(Array.from(E))},className:"block text-xs text-neutral-300 file:mr-3 file:rounded file:border file:border-neutral-700 file:bg-neutral-900 file:px-3 file:py-1.5 file:text-xs file:text-neutral-100 hover:file:border-neutral-500 disabled:opacity-50"})]})]}),m!==void 0&&g.jsxs("div",{className:"mt-3 space-y-1 text-xs",children:[m.imported.length>0&&g.jsxs("p",{className:"text-emerald-400",children:["Imported ",m.imported.length," file",m.imported.length===1?"":"s",":"," ",g.jsx("code",{className:"font-mono",children:m.imported.join(", ")})]}),m.skipped.length>0&&g.jsxs("div",{className:"text-amber-400",children:[g.jsxs("p",{children:["Skipped ",m.skipped.length," entr",m.skipped.length===1?"y":"ies",":"]}),g.jsx("ul",{className:"ml-4 list-disc",children:m.skipped.map(x=>g.jsxs("li",{children:[g.jsx("code",{className:"font-mono",children:x.name})," (",x.reason,")"]},x.name))})]}),m.imported.length===0&&m.skipped.length===0&&g.jsx("p",{className:"italic text-neutral-500",children:"No files were imported."})]})]})]})}const Mh="***REDACTED***";function FL(){return{name:"",url:"",transport:"auto",enabled:!0,headers:[]}}function PL({onError:e}){const r=hr(),n=Wt(M=>M.projects),s=Yn(M=>M.settings),a=Yn(M=>M.globalServers),u=Yn(M=>{var J;return((J=M.byProject[(r==null?void 0:r.id)??"__no_project__"])==null?void 0:J.status)??AL}),d=Yn(M=>M.refreshProject),o=Yn(M=>M.setMcpEnabled),c=Yn(M=>M.upsertServer),h=Yn(M=>M.deleteServer),m=Yn(M=>M.probeServer),[f,v]=q.useState(void 0),[w,A]=q.useState(void 0),[b,y]=q.useState(!1),[S,_]=q.useState(void 0),[x,E]=q.useState(new Map),[N,T]=q.useState({}),[j,R]=q.useState(new Set),D=async()=>{try{const[M,J]=await Promise.all([be.listTools(r==null?void 0:r.id),be.listToolOverrides()]),de=new Map;for(const pe of M.mcp)de.set(`${pe.scope}:${pe.server}`,pe.tools);E(de),T(J.projects)}catch(M){e(`Failed to load tool listing: ${St(M)}`)}};q.useEffect(()=>{d(r==null?void 0:r.id).catch(M=>{e(`Failed to load MCP config: ${St(M)}`)}),D()},[r==null?void 0:r.id]);const L=async M=>{y(!0);try{await o(M),e(void 0),await d(r==null?void 0:r.id)}catch(J){e(`Failed to toggle MCP: ${St(J)}`)}finally{y(!1)}},z=async(M,J)=>{const de=a[M];if(de!==void 0){y(!0);try{await c(M,{...de,enabled:J}),e(void 0)}catch(pe){e(`Failed to update server: ${St(pe)}`)}finally{y(!1)}}},U=M=>{const J=a[M];J!==void 0&&(A(M),v({name:M,url:J.url,transport:J.transport??"auto",enabled:J.enabled!==!1,headers:Object.entries(J.headers??{}).map(([de,pe])=>({key:de,value:pe}))}))},P=()=>{A(void 0),v(FL())},G=async()=>{if(f===void 0)return;if(f.name.trim().length===0||f.url.trim().length===0){e("Name and URL are required.");return}const M={};for(const de of f.headers)de.key.trim().length!==0&&(M[de.key]=de.value);const J={url:f.url,transport:f.transport,enabled:f.enabled};Object.keys(M).length>0&&(J.headers=M),y(!0);try{await c(f.name,J),e(void 0),v(void 0),A(void 0)}catch(de){e(`Failed to save server: ${St(de)}`)}finally{y(!1)}},K=async M=>{if(window.confirm(`Remove MCP server '${M}' from the global registry?`)){y(!0);try{await h(M),e(void 0)}catch(J){e(`Failed to remove server: ${St(J)}`)}finally{y(!1)}}},W=async(M,J)=>{_(M);try{await m(M,J==="project"?r==null?void 0:r.id:void 0),e(void 0),D()}catch(de){e(`Probe failed for '${M}': ${St(de)}`)}finally{_(void 0)}},Y=async(M,J)=>{y(!0);try{await be.setToolEnabled("mcp",M,J,"global"),await D()}catch(de){e(`Toggle failed: ${St(de)}`)}finally{y(!1)}},ne=async(M,J,de)=>{y(!0);try{de===void 0?await be.clearToolProjectOverride("mcp",J,M):await be.setToolEnabled("mcp",J,de==="enabled","project",M),await D()}catch(pe){e(`Override write failed: ${St(pe)}`)}finally{y(!1)}},F=M=>{R(J=>{const de=new Set(J);return de.has(M)?de.delete(M):de.add(M),de})};if(s===void 0)return g.jsx("p",{className:"text-xs italic text-neutral-500",children:"Loading MCP config…"});const B=s.enabled,O=u.filter(M=>M.scope==="global"),Q=u.filter(M=>M.scope==="project");return g.jsxs("div",{className:"space-y-4",children:[g.jsxs("p",{className:"text-xs text-neutral-500",children:["MCP servers extend the agent with custom tools. Servers configured here are loaded by every new session. Project-scoped servers in ",g.jsx("code",{className:"font-mono",children:".mcp.json"})," at the project root are also loaded for sessions in that project (project entries override globals on name collision)."]}),g.jsxs("div",{className:"flex items-center justify-between rounded border border-neutral-800 bg-neutral-900/40 p-3",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium text-neutral-100",children:"MCP tools"}),g.jsx("div",{className:"text-[11px] text-neutral-500",children:"Master switch. When off, no MCP tools reach the agent regardless of per-server state."})]}),g.jsx("button",{onClick:()=>void L(!B),disabled:b,className:`rounded border px-3 py-1 text-xs ${B?"border-emerald-700/50 bg-emerald-900/20 text-emerald-300":"border-neutral-700 text-neutral-300 hover:border-neutral-500"}`,children:B?"Enabled":"Disabled"})]}),g.jsx(Eb,{title:"Global servers",emptyHint:"No global MCP servers configured. Click 'Add server' to add one.",servers:O.map(M=>({status:M,config:a[M.name]})),editable:!0,editingName:w??null,probingName:S??null,toolsByServer:x,expandedServers:j,allOverrides:N,projects:n,busy:b,onToggleExpanded:F,onToggleToolGlobal:(M,J)=>void Y(M,J),onSetProjectToolOverride:(M,J,de)=>void ne(M,J,de),onToggle:(M,J)=>void z(M,J),onProbe:M=>void W(M,"global"),onEdit:U,onRemove:M=>void K(M)}),r!==void 0&&g.jsx(Eb,{title:`Project servers (${r.name})`,emptyHint:g.jsxs(g.Fragment,{children:["No project servers. Add a ",g.jsx("code",{className:"font-mono",children:".mcp.json"})," file at the project root to define some — supports both"," ",g.jsx("code",{className:"font-mono",children:"{ servers: {...} }"})," and the standard"," ",g.jsx("code",{className:"font-mono",children:"{ mcpServers: {...} }"})," shape."]}),servers:Q.map(M=>({status:M,config:void 0})),editable:!1,probingName:S??null,toolsByServer:x,expandedServers:j,allOverrides:N,projects:n,busy:b,onToggleExpanded:F,onToggleToolGlobal:(M,J)=>void Y(M,J),onSetProjectToolOverride:(M,J,de)=>void ne(M,J,de),onProbe:M=>void W(M,"project")}),f===void 0?g.jsx("button",{onClick:P,className:"rounded-md border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:border-neutral-500",children:"+ Add server"}):g.jsx(UL,{draft:f,isEditing:w!==void 0,busy:b,onChange:v,onSave:()=>void G(),onCancel:()=>{v(void 0),A(void 0)}})]})}function Eb(e){return g.jsxs("section",{className:"space-y-2",children:[g.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-neutral-400",children:e.title}),e.servers.length===0?g.jsx("p",{className:"text-[11px] italic text-neutral-500",children:e.emptyHint}):g.jsx("div",{className:"space-y-2",children:e.servers.map(r=>{const n=r.status,s=e.editingName===n.name,a=e.probingName===n.name,u=`${n.scope}:${n.name}`,d=e.toolsByServer.get(u)??[],o=e.expandedServers.has(u),c=d.length>0;return g.jsxs("div",{className:`rounded border ${s?"border-neutral-500 bg-neutral-900":"border-neutral-800 bg-neutral-900/40"}`,children:[g.jsxs("div",{className:"p-3",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g.jsx("button",{type:"button",onClick:()=>c&&e.onToggleExpanded(u),disabled:!c,className:"flex h-5 w-5 items-center justify-center rounded text-neutral-300 hover:bg-neutral-800 hover:text-neutral-100 disabled:opacity-30",title:c?o?"Hide tools":"Show tools":"No tools to show (server not connected or empty)",children:o?g.jsx(ur,{size:16}):g.jsx(dr,{size:16})}),g.jsx(HL,{state:n.state}),g.jsx("span",{className:"font-mono text-sm text-neutral-100",children:n.name}),g.jsx("span",{className:"rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400",children:n.transport??"auto"}),g.jsxs("span",{className:"text-[11px] text-neutral-500",children:[n.toolCount," tools"]})]}),g.jsxs("div",{className:"flex shrink-0 items-center gap-1 text-xs",children:[e.editable&&e.onToggle!==void 0&&g.jsx("button",{onClick:()=>{var h;return(h=e.onToggle)==null?void 0:h.call(e,n.name,!n.enabled)},className:`rounded border px-2 py-0.5 ${n.enabled?"border-emerald-700/50 bg-emerald-900/20 text-emerald-300":"border-neutral-700 text-neutral-400 hover:border-neutral-500"}`,children:n.enabled?"Enabled":"Disabled"}),g.jsx("button",{onClick:()=>e.onProbe(n.name),disabled:a,className:"rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500 disabled:opacity-50",title:"Reconnect and refresh tool list",children:a?"Probing…":"Probe"}),e.editable&&e.onEdit!==void 0&&g.jsx("button",{onClick:()=>{var h;return(h=e.onEdit)==null?void 0:h.call(e,n.name)},className:"rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500",children:"Edit"}),e.editable&&e.onRemove!==void 0&&g.jsx("button",{onClick:()=>{var h;return(h=e.onRemove)==null?void 0:h.call(e,n.name)},className:"rounded border border-red-700/50 px-2 py-0.5 text-red-300 hover:bg-red-900/20",children:"Remove"})]})]}),g.jsx("div",{className:"mt-1 truncate text-[11px] text-neutral-500",title:n.url,children:n.url}),n.lastError!==void 0&&g.jsx("div",{className:"mt-1 truncate text-[11px] text-red-300",title:n.lastError,children:n.lastError})]}),o&&c&&g.jsxs("div",{className:"space-y-2 border-t border-neutral-800 bg-neutral-950/40 px-3 py-2",children:[g.jsx("div",{className:"text-[10px] uppercase tracking-wider text-neutral-500",children:"Tools"}),g.jsx("div",{className:"space-y-2",children:d.map(h=>g.jsx(yf,{family:"mcp",name:h.shortName,fqn:h.name,description:h.description,globalEnabled:h.globalEnabled,projects:e.projects,allOverrides:e.allOverrides,busy:e.busy,onToggleGlobal:m=>e.onToggleToolGlobal(h.name,m),onSetProjectOverride:(m,f)=>e.onSetProjectToolOverride(m,h.name,f)},`mcp:${h.name}`))})]})]},u)})})]})}function HL({state:e}){const r=e==="connected"?"bg-emerald-500":e==="connecting"?"bg-amber-400 animate-pulse":e==="error"?"bg-red-500":e==="disabled"?"bg-neutral-700":"bg-neutral-500";return g.jsx("span",{className:`h-2 w-2 rounded-full ${r}`,title:e})}function UL(e){const{draft:r,busy:n}=e,s=(a,u)=>{e.onChange({...r,[a]:u})};return g.jsxs("div",{className:"rounded border border-neutral-700 bg-neutral-900 p-3",children:[g.jsx("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-neutral-400",children:e.isEditing?`Edit '${r.name}'`:"Add MCP server"}),g.jsxs("div",{className:"grid grid-cols-[80px_1fr] items-center gap-2 text-xs",children:[g.jsx("label",{className:"text-neutral-500",children:"Name"}),g.jsx("input",{value:r.name,onChange:a=>s("name",a.target.value),disabled:e.isEditing,placeholder:"my-server",className:"rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-neutral-100 outline-none focus:border-neutral-500 disabled:opacity-50"}),g.jsx("label",{className:"text-neutral-500",children:"URL"}),g.jsx("input",{value:r.url,onChange:a=>s("url",a.target.value),placeholder:"https://mcp.example.com/sse",className:"rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-neutral-100 outline-none focus:border-neutral-500"}),g.jsx("label",{className:"text-neutral-500",children:"Transport"}),g.jsxs("select",{value:r.transport,onChange:a=>s("transport",a.target.value),className:"rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-neutral-100 outline-none focus:border-neutral-500",children:[g.jsx("option",{value:"auto",children:"auto (StreamableHTTP, fall back to SSE)"}),g.jsx("option",{value:"streamable-http",children:"streamable-http"}),g.jsx("option",{value:"sse",children:"sse"})]}),g.jsx("label",{className:"text-neutral-500",children:"Enabled"}),g.jsxs("label",{className:"flex items-center gap-2",children:[g.jsx("input",{type:"checkbox",checked:r.enabled,onChange:a=>s("enabled",a.target.checked)}),g.jsx("span",{className:"text-[11px] text-neutral-500",children:"Disabled servers don't connect or contribute tools."})]})]}),g.jsxs("div",{className:"mt-3",children:[g.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[g.jsx("h5",{className:"text-[11px] font-semibold uppercase tracking-wider text-neutral-500",children:"Headers"}),g.jsx("button",{onClick:()=>s("headers",[...r.headers,{key:"",value:""}]),className:"rounded border border-neutral-700 px-2 py-0.5 text-[11px] text-neutral-300 hover:border-neutral-500",children:"+ Header"})]}),r.headers.length===0&&g.jsx("p",{className:"text-[11px] italic text-neutral-600",children:"No headers. Add `Authorization: Bearer …` here for auth."}),r.headers.map((a,u)=>g.jsxs("div",{className:"mb-1 grid grid-cols-[1fr_2fr_auto] gap-1",children:[g.jsx("input",{value:a.key,onChange:d=>{const o=[...r.headers];o[u]={...a,key:d.target.value},s("headers",o)},placeholder:"Authorization",className:"rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-[11px] font-mono text-neutral-100 outline-none focus:border-neutral-500"}),g.jsx("input",{value:a.value===Mh?"":a.value,onChange:d=>{const o=[...r.headers];o[u]={...a,value:d.target.value},s("headers",o)},placeholder:a.value===Mh?"leave blank to keep stored value":"Bearer …",type:"password",className:"rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-[11px] font-mono text-neutral-100 outline-none focus:border-neutral-500"}),g.jsx("button",{onClick:()=>{const d=r.headers.filter((o,c)=>c!==u);s("headers",d)},className:"rounded border border-neutral-700 px-2 text-[11px] text-neutral-400 hover:text-red-300",title:"Remove header",children:"×"})]},u)),r.headers.some(a=>a.value===Mh)&&g.jsx("p",{className:"mt-1 text-[10px] italic text-neutral-500",children:"Headers with the redaction sentinel keep their stored value when you save."})]}),g.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[g.jsx("button",{onClick:e.onCancel,className:"rounded border border-neutral-700 px-3 py-1 text-xs text-neutral-300 hover:border-neutral-500",children:"Cancel"}),g.jsx("button",{onClick:e.onSave,disabled:n,className:"rounded bg-neutral-100 px-3 py-1 text-xs font-medium text-neutral-900 disabled:opacity-50",children:n?"Saving…":"Save"})]})]})}const ec=8;function $L(){const e=Dr(s=>s.version),r=Dr(s=>s.loaded),n=Dr(s=>s.passwordAuthEnabled);return g.jsxs("div",{className:"space-y-6 text-sm text-neutral-300",children:[g.jsxs("header",{className:"space-y-1",children:[g.jsx("h2",{className:"text-base font-semibold text-neutral-100",children:"pi-forge"}),g.jsxs("p",{className:"text-xs text-neutral-500",children:["Browser interface for the"," ",g.jsx("a",{href:"https://github.com/badlogic/pi-mono",target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 underline hover:text-blue-300",children:"pi coding agent"}),"."]})]}),g.jsxs("section",{className:"space-y-2",children:[g.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-neutral-500",children:"Version"}),g.jsx("p",{className:"font-mono text-sm",children:r?e.length>0?e:g.jsx("span",{className:"text-neutral-500",children:"unknown"}):g.jsx("span",{className:"text-neutral-500",children:"loading…"})})]}),g.jsxs("section",{className:"space-y-2",children:[g.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-neutral-500",children:"Links"}),g.jsxs("ul",{className:"space-y-1 text-xs",children:[g.jsx("li",{children:g.jsx("a",{href:"https://github.com/Devin-Marks/pi-forge",target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 underline hover:text-blue-300",children:"github.com/Devin-Marks/pi-forge"})}),g.jsx("li",{children:g.jsx("a",{href:"https://github.com/Devin-Marks/pi-forge/blob/main/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 underline hover:text-blue-300",children:"Changelog"})}),g.jsx("li",{children:g.jsx("a",{href:"https://github.com/Devin-Marks/pi-forge/blob/main/SECURITY.md",target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 underline hover:text-blue-300",children:"Security"})})]})]}),n&&g.jsx(qL,{})]})}function qL(){const e=on(y=>y.changePassword),r=on(y=>y.changePasswordPending),n=on(y=>y.changePasswordError),[s,a]=q.useState(""),[u,d]=q.useState(""),[o,c]=q.useState(""),[h,m]=q.useState(void 0),[f,v]=q.useState(!1),w=q.useRef(!1);q.useEffect(()=>{if(w.current&&!r&&n===void 0){a(""),d(""),c(""),v(!0);const y=window.setTimeout(()=>v(!1),2500);return()=>window.clearTimeout(y)}w.current=r},[r,n]);const A=y=>{if(y.preventDefault(),m(void 0),v(!1),u.length<ec){m(`New password must be at least ${ec} characters.`);return}if(u!==o){m("New password and confirmation do not match.");return}if(u===s){m("New password must differ from the current one.");return}e(s,u)},b=h??QL(n);return g.jsxs("section",{className:"space-y-2 border-t border-neutral-800 pt-5",children:[g.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-neutral-500",children:"Change password"}),g.jsx("p",{className:"text-xs text-neutral-500",children:"Updates the scrypt hash on disk; existing browser sessions stay signed in."}),g.jsxs("form",{onSubmit:A,className:"space-y-2",children:[g.jsxs("label",{className:"block space-y-1",children:[g.jsx("span",{className:"text-xs text-neutral-400",children:"Current password"}),g.jsx("input",{type:"password",value:s,onChange:y=>a(y.target.value),autoComplete:"current-password",className:"w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-1.5 text-sm outline-none focus:border-neutral-500"})]}),g.jsxs("label",{className:"block space-y-1",children:[g.jsx("span",{className:"text-xs text-neutral-400",children:"New password"}),g.jsx("input",{type:"password",value:u,onChange:y=>d(y.target.value),autoComplete:"new-password",minLength:ec,className:"w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-1.5 text-sm outline-none focus:border-neutral-500"})]}),g.jsxs("label",{className:"block space-y-1",children:[g.jsx("span",{className:"text-xs text-neutral-400",children:"Confirm new password"}),g.jsx("input",{type:"password",value:o,onChange:y=>c(y.target.value),autoComplete:"new-password",minLength:ec,className:"w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-1.5 text-sm outline-none focus:border-neutral-500"})]}),b!==void 0&&g.jsx("p",{role:"alert",className:"text-xs text-red-400",children:b}),f&&g.jsx("p",{role:"status",className:"text-xs text-emerald-400",children:"Password updated."}),g.jsx("button",{type:"submit",disabled:r||s.length===0||u.length===0,className:"rounded-md bg-neutral-100 px-3 py-1.5 text-xs font-medium text-neutral-900 transition hover:bg-white disabled:cursor-not-allowed disabled:opacity-50",children:r?"Saving…":"Update password"})]})]})}function QL(e){if(e!==void 0)switch(e){case"invalid_password":return"Current password is incorrect.";case"password_unchanged":return"New password must differ from the current one.";case"ui_password_not_configured":return"Password auth is not configured on this server.";case"auth_required":return"Session expired — sign in again.";default:return`Could not change password: ${e}`}}function kb(){const e=hr(),r=ft(te=>e!==void 0?te.treeByProject[e.id]:void 0),n=ft(te=>e!==void 0?te.treeLoading[e.id]??!1:!1),s=ft(te=>te.error),a=ft(te=>te.loadTree),u=ft(te=>te.openFile),d=ft(te=>te.createFile),o=ft(te=>te.createFolder),c=ft(te=>te.renameEntry),h=ft(te=>te.moveEntry),m=ft(te=>te.deleteEntry),[f,v]=q.useState({"":!0}),[w,A]=q.useState(void 0),[b,y]=q.useState(""),[S,_]=q.useState(void 0),[x,E]=q.useState(void 0),[N,T]=q.useState(void 0),j=q.useRef(null),R=q.useRef(void 0),D=ft(te=>te.uploadFiles),[L,z]=q.useState(void 0),U=Fi(te=>te.requestChatInsert),[P,G]=q.useState(new Set);if(q.useEffect(()=>{e!==void 0&&a(e.id)},[e==null?void 0:e.id,a]),e===void 0)return g.jsx("div",{className:"p-4 text-xs italic text-neutral-500",children:"Select a project to browse its files."});const K=async(te,ue)=>{E(void 0);try{if(te==="file"){const Ae=await d(e.id,e.path,ue);await u(e.id,Ae)}else await o(e.id,e.path,ue)}catch{}},W=(te,ue)=>{A(te),y(ue)},Y=async te=>{const ue=b.trim();if(A(void 0),y(""),ue.length!==0)try{await c(e.id,te,ue)}catch{}},ne=()=>G(new Set),F=te=>{G(ue=>{const Ae=new Set(ue);return Ae.has(te)?Ae.delete(te):Ae.add(te),Ae})},B=(te,ue,Ae)=>{E({kind:"delete",absPath:te,name:ue,isDir:Ae,recursive:!1})},O=async()=>{if((x==null?void 0:x.kind)!=="delete")return;const{absPath:te,name:ue,isDir:Ae,recursive:Le}=x;E(void 0);try{await m(e.id,te,Le?{recursive:!0}:void 0)}catch(Me){if(Me instanceof we&&Me.code==="directory_not_empty"){E({kind:"delete",absPath:te,name:ue,isDir:Ae,recursive:!0});return}}},Q=async()=>{if((x==null?void 0:x.kind)!=="deleteMany")return;const{paths:te}=x;E(void 0);for(const ue of te)try{await m(e.id,ue,{recursive:!0})}catch{}ne()},M=async te=>{if(te.type==="directory"){v(ue=>({...ue,[te.path]:!ue[te.path]}));return}await u(e.id,w1(e.path,te.path))},J=(te,ue,Ae)=>{te.preventDefault(),z({x:te.clientX,y:te.clientY,absPath:ue,isDir:Ae})},de=te=>{let ue=te;te.startsWith(`${e.path}/`)&&(ue=te.slice(e.path.length+1));const Ae=/\s/.test(ue)?`@"${ue}"`:`@${ue}`;U(Ae),z(void 0)},pe=async(te,ue)=>{if(te.preventDefault(),te.stopPropagation(),_(void 0),te.dataTransfer.files.length>0){const Pe=Array.from(te.dataTransfer.files);await X(ue,Pe);return}const Ae=te.dataTransfer.getData("application/x-pi-path");if(Ae.length===0)return;const Le=Ae.split("/").pop()??"";if(Le.length===0)return;const Me=`${ue}/${Le}`;if(Me!==Ae&&!(ue===Ae||ue.startsWith(`${Ae}/`)))try{await h(e.id,Ae,Me)}catch{}},X=async(te,ue)=>{if(ue.length===0)return;const Ae=ue.reduce((Le,Me)=>Le+Me.size,0);T(`Hashing ${ue.length} file${ue.length===1?"":"s"} (${tc(Ae)})…`);try{const Le=await D(e.id,te,ue,{onHashProgress:(Me,Pe)=>{Me<Pe?T(`Hashing ${tc(Me)} / ${tc(Pe)} (${Math.floor(Me/Pe*100)}%)…`):T(`Uploading ${ue.length} file${ue.length===1?"":"s"} (${tc(Pe)})…`)}});T(`Uploaded ${Le.length} file${Le.length===1?"":"s"}.`),window.setTimeout(()=>T(void 0),2500)}catch{T(void 0)}},$=te=>{var ue;R.current=te,(ue=j.current)==null||ue.click()},se=async te=>{T("Preparing download…");try{const{blob:ue,filename:Ae}=await be.filesDownload(e.id,te),Le=URL.createObjectURL(ue),Me=document.createElement("a");Me.href=Le,Me.download=Ae,document.body.appendChild(Me),Me.click(),Me.remove(),window.setTimeout(()=>URL.revokeObjectURL(Le),1e3),T(void 0)}catch(ue){T(void 0),ft.setState({error:ue instanceof Error?ue.message:"download_failed"})}},le=async te=>{const ue=te.target.files,Ae=ue!==null?Array.from(ue):[],Le=R.current??e.path;te.target.value="",R.current=void 0,Ae.length!==0&&await X(Le,Ae)};return g.jsxs("div",{className:"flex h-full flex-col text-xs text-neutral-300",children:[g.jsxs("div",{className:"flex items-center justify-between border-b border-neutral-800 px-3 py-2",children:[g.jsx("span",{className:"truncate font-medium text-neutral-200",title:e.path,children:e.name}),g.jsxs("div",{className:"flex gap-1",children:[g.jsx("button",{onClick:()=>E({kind:"create",entryKind:"file"}),className:"rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200",title:"New file",children:g.jsx(EA,{size:14})}),g.jsx("button",{onClick:()=>E({kind:"create",entryKind:"folder"}),className:"rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200",title:"New folder",children:g.jsx(RA,{size:14})}),g.jsx("button",{onClick:()=>$(e.path),className:"rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200",title:"Upload files into project root (drag-and-drop also works on any folder)",children:g.jsx(Ef,{size:14})}),g.jsx("button",{onClick:()=>void se(void 0),className:"rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200",title:"Download project as .tar.gz (skips node_modules, .git, dist, etc.)",children:g.jsx(Qb,{size:14})}),g.jsx("button",{onClick:()=>void a(e.id),className:"rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200",title:"Refresh",children:g.jsx(po,{size:14,className:n?"animate-spin":""})})]})]}),g.jsx("input",{ref:j,type:"file",multiple:!0,className:"hidden",onChange:te=>void le(te)}),N!==void 0&&g.jsxs("div",{className:"flex items-center gap-1.5 border-b border-emerald-700/40 bg-emerald-900/20 px-3 py-1.5 text-[11px] text-emerald-200",children:[!N.startsWith("Uploaded")&&g.jsx(fo,{size:11,className:"animate-spin"}),g.jsx("span",{children:N})]}),s!==void 0&&g.jsx("div",{className:"border-b border-red-700/40 bg-red-900/20 px-3 py-1.5 text-[11px] text-red-300",children:s}),P.size>0&&g.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-neutral-800 bg-neutral-900/60 px-3 py-1.5 text-[11px] text-neutral-300",children:[g.jsxs("span",{children:[P.size," selected",g.jsx("span",{className:"ml-2 text-neutral-500",children:"(Cmd/Ctrl+click rows to add or remove)"})]}),g.jsxs("div",{className:"flex gap-1",children:[g.jsx("button",{onClick:()=>E({kind:"deleteMany",paths:Array.from(P)}),className:"rounded border border-red-700/50 px-2 py-0.5 text-red-300 hover:bg-red-900/20",children:"Delete selected"}),g.jsx("button",{onClick:ne,className:"rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500",children:"Clear"})]})]}),g.jsxs("div",{className:"flex-1 overflow-y-auto py-1",onDragOver:te=>{(te.dataTransfer.types.includes("application/x-pi-path")||te.dataTransfer.types.includes("Files"))&&(te.preventDefault(),te.dataTransfer.dropEffect=te.dataTransfer.types.includes("Files")?"copy":"move")},onDrop:te=>void pe(te,e.path),children:[r===void 0&&!n&&g.jsx("p",{className:"px-3 py-2 italic text-neutral-500",children:"Tree not loaded."}),r!==void 0&&g.jsx(vf,{node:r,depth:0,projectPath:e.path,expanded:f,onToggle:te=>v(ue=>({...ue,[te]:!ue[te]})),onOpen:te=>void M(te),renaming:w,renameDraft:b,onRenameDraftChange:y,onRenameCommit:te=>void Y(te),onRenameStart:W,onDelete:(te,ue,Ae)=>B(te,ue,Ae),onUpload:te=>$(te),onDownload:te=>void se(te),dropTarget:S,onDropTargetChange:_,onDrop:(te,ue)=>void pe(te,ue),onContextMenu:J,selectedPaths:P,onToggleSelect:F})]}),g.jsx(cx,{open:(x==null?void 0:x.kind)==="create",onClose:()=>E(void 0),onSubmit:te=>{(x==null?void 0:x.kind)==="create"&&K(x.entryKind,te)},title:(x==null?void 0:x.kind)==="create"&&x.entryKind==="folder"?"New folder":"New file",label:(x==null?void 0:x.kind)==="create"&&x.entryKind==="folder"?"Folder name (relative to project root)":"File name (relative to project root)",placeholder:(x==null?void 0:x.kind)==="create"&&x.entryKind==="folder"?"src/utils":"src/index.ts",primaryLabel:"Create"}),g.jsx(ro,{open:(x==null?void 0:x.kind)==="delete",onClose:()=>E(void 0),onConfirm:()=>void O(),title:(x==null?void 0:x.kind)==="delete"?x.recursive?`"${x.name}" is not empty`:x.isDir?"Delete directory":"Delete file":"",message:(x==null?void 0:x.kind)==="delete"?x.recursive?`"${x.name}" contains files. Delete the directory and ALL its contents? This cannot be undone.`:`Delete ${x.isDir?"directory":"file"} "${x.name}"? This cannot be undone.`:"",primaryLabel:(x==null?void 0:x.kind)==="delete"&&x.recursive?"Delete contents":"Delete",tone:"danger"}),g.jsx(ro,{open:(x==null?void 0:x.kind)==="deleteMany",onClose:()=>E(void 0),onConfirm:()=>void Q(),title:(x==null?void 0:x.kind)==="deleteMany"?`Delete ${x.paths.length} item${x.paths.length===1?"":"s"}`:"",message:(x==null?void 0:x.kind)==="deleteMany"?`Delete the ${x.paths.length} selected file${x.paths.length===1?"":"s"} / folder${x.paths.length===1?"":"s"}? Folders are deleted recursively. This cannot be undone.`:"",primaryLabel:"Delete all",tone:"danger"}),L!==void 0&&g.jsx(GL,{x:L.x,y:L.y,isDir:L.isDir,onClose:()=>z(void 0),onAddAsContext:()=>de(L.absPath)})]})}function GL(e){return q.useEffect(()=>{const r=a=>{a.key==="Escape"&&e.onClose()},n=()=>e.onClose();window.addEventListener("keydown",r);const s=setTimeout(()=>window.addEventListener("mousedown",n),0);return()=>{window.removeEventListener("keydown",r),window.removeEventListener("mousedown",n),clearTimeout(s)}},[e]),g.jsx("div",{className:"fixed z-50 min-w-[200px] overflow-hidden rounded-md border border-neutral-700 bg-neutral-900 shadow-lg",style:{left:e.x,top:e.y},onMouseDown:r=>r.stopPropagation(),children:g.jsxs("button",{type:"button",disabled:e.isDir,onClick:e.onAddAsContext,className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-neutral-200 hover:bg-neutral-800 disabled:cursor-not-allowed disabled:text-neutral-600 disabled:hover:bg-transparent",title:e.isDir?"Directory references aren't supported — pick a single file":"Append @<path> to the chat input so the file's content is sent with the next prompt",children:[g.jsx(Sf,{size:12}),"Add as @ context"]})})}function vf(e){var m;const{node:r,depth:n,projectPath:s}=e;if(n===0&&r.type==="directory")return g.jsx("ul",{children:(m=r.children)==null?void 0:m.map(f=>g.jsx(vf,{...e,node:f,depth:1},f.path))});const a=w1(s,r.path),u=r.type==="directory",d=u&&(e.expanded[r.path]??!1),o=e.renaming===a,c=u&&e.dropTarget===a,h=e.selectedPaths.has(a);return g.jsxs("li",{children:[g.jsxs("div",{className:`group flex items-center gap-1 px-2 py-0.5 hover:bg-neutral-900 ${h?"bg-emerald-900/20":""} ${c?"bg-emerald-900/30 ring-1 ring-emerald-700/50":""}`,style:{paddingLeft:`${n*12+6}px`},onContextMenu:o?void 0:f=>e.onContextMenu(f,a,u),draggable:!o,onDragStart:f=>{f.dataTransfer.setData("application/x-pi-path",a),f.dataTransfer.effectAllowed="move"},onDragOver:u?f=>{const v=f.dataTransfer.types.includes("Files"),w=f.dataTransfer.types.includes("application/x-pi-path");!v&&!w||(f.preventDefault(),f.stopPropagation(),f.dataTransfer.dropEffect=v?"copy":"move",e.dropTarget!==a&&e.onDropTargetChange(a))}:void 0,onDragLeave:u?()=>{e.dropTarget===a&&e.onDropTargetChange(void 0)}:void 0,onDrop:u?f=>{f.stopPropagation(),e.onDrop(f,a)}:void 0,children:[g.jsxs("button",{onClick:f=>{if(f.metaKey||f.ctrlKey){e.onToggleSelect(a);return}e.onOpen(r)},className:"flex flex-1 items-center gap-1 truncate text-left",title:a,children:[u?d?g.jsx(ur,{size:12,className:"text-neutral-500"}):g.jsx(dr,{size:12,className:"text-neutral-500"}):g.jsx("span",{className:"inline-block w-3"}),o?g.jsx("input",{autoFocus:!0,value:e.renameDraft,onChange:f=>e.onRenameDraftChange(f.target.value),onKeyDown:f=>{(f.key==="Enter"||f.key==="Escape")&&(f.preventDefault(),e.onRenameCommit(a))},onBlur:()=>e.onRenameCommit(a),onClick:f=>f.stopPropagation(),className:"flex-1 rounded border border-neutral-700 bg-neutral-950 px-1 text-[11px] text-neutral-100 outline-none focus:border-neutral-500"}):g.jsx("span",{className:`truncate ${u?"text-neutral-200":"text-neutral-300"}`,children:r.name}),r.truncated===!0&&g.jsx("span",{className:"ml-1 text-[10px] text-neutral-600",children:"…"})]}),!o&&g.jsxs("div",{className:"hidden items-center gap-0.5 group-hover:flex",children:[u&&g.jsx("button",{onClick:f=>{f.stopPropagation(),e.onUpload(a)},className:"rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200",title:"Upload into this folder",children:g.jsx(Ef,{size:11})}),g.jsx("button",{onClick:f=>{f.stopPropagation(),e.onDownload(a)},className:"rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200",title:u?"Download folder as .tar.gz":"Download file",children:g.jsx(Qb,{size:11})}),g.jsx("button",{onClick:f=>{f.stopPropagation(),e.onRenameStart(a,r.name)},className:"rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200",title:"Rename",children:g.jsx(VA,{size:11})}),g.jsx("button",{onClick:f=>{f.stopPropagation(),e.onDelete(a,r.name,u)},className:"rounded p-0.5 text-neutral-500 hover:bg-red-900/30 hover:text-red-300",title:"Delete",children:g.jsx(Qh,{size:11})})]})]}),u&&d&&r.children!==void 0&&g.jsx("ul",{children:r.children.map(f=>g.jsx(vf,{...e,node:f,depth:n+1},f.path))})]})}function w1(e,r){return r===""?e:`${e}/${r.replaceAll("\\","/")}`}function tc(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}const A1="forge.editor.wrap.",WL=[];function KL(e){const r=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\")),n=r===-1?e:e.slice(r+1),s=n.lastIndexOf(".");return s<=0?"":n.slice(s+1).toLowerCase()}function Nb(e){try{const r=localStorage.getItem(A1+e);if(r==="0")return!1;if(r==="1")return!0}catch{}return!0}function VL(e,r){try{localStorage.setItem(A1+e,r?"1":"0")}catch{}}const XL=q.lazy(()=>Ub(()=>import("./CodeMirrorEditor-BqaaP1EE.js"),[]).then(e=>({default:e.CodeMirrorEditor})));function Tb(){const e=hr(),r=ft(y=>y.openFiles),n=ft(y=>y.activePath),s=ft(y=>y.setActiveFile),a=ft(y=>y.closeFile),u=ft(y=>y.closeAllFiles),d=ft(y=>y.updateDraft),o=ft(y=>y.saveFile),c=ft(y=>y.reloadFile),h=ft(y=>y.externallyChanged),m=ft(y=>y.gitDiffByPath),f=r.find(y=>y.path===n),v=f!==void 0?KL(f.path):"",[w,A]=q.useState(()=>Nb(v));q.useEffect(()=>{A(Nb(v))},[v]);const b=q.useCallback(()=>{A(y=>{const S=!y;return VL(v,S),S})},[v]);return g.jsxs("div",{className:"flex h-full flex-col bg-neutral-950 text-sm text-neutral-200",children:[g.jsx(ZL,{files:r,activePath:n,externallyChanged:h,onActivate:s,onClose:a,onCloseAll:u}),f===void 0?g.jsx("div",{className:"flex flex-1 items-center justify-center text-xs italic text-neutral-500",children:"No file open. Click a file in the tree to start editing."}):g.jsxs(g.Fragment,{children:[h[f.path]===!0&&g.jsx(JL,{path:f.path,onReload:()=>{e!==void 0&&c(e.id,f.path)},onDiscard:()=>ft.getState().dismissExternallyChanged(f.path)}),f.binary?g.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-neutral-500",children:f.loadingError??"Binary file."}):g.jsx(q.Suspense,{fallback:g.jsx(YL,{}),children:g.jsx(XL,{file:f,wrap:w,diffChanges:m[f.path]??WL,onChange:y=>d(f.path,y),onSaveShortcut:()=>{e!==void 0&&o(e.id,f.path)},onConsumePendingNav:y=>ft.getState().consumePendingNav(y)},f.tabId)}),g.jsx(eM,{file:f,wrap:w,onToggleWrap:b,onSave:()=>{e!==void 0&&o(e.id,f.path)}})]})]})}function YL(){return g.jsx("div",{className:"flex flex-1 items-center justify-center text-xs italic text-neutral-500",children:"Loading editor…"})}function ZL({files:e,activePath:r,externallyChanged:n,onActivate:s,onClose:a,onCloseAll:u}){if(e.length===0)return null;const d=e.filter(c=>c.dirty).length,o=()=>{d>0&&!window.confirm(`Close ${e.length} tab${e.length===1?"":"s"}? ${d} ha${d===1?"s":"ve"} unsaved changes that will be lost.`)||u()};return g.jsxs("div",{className:"flex border-b border-neutral-800 bg-neutral-900/40",children:[g.jsx("button",{onClick:o,className:"flex shrink-0 items-center justify-center border-r border-neutral-800 px-2 py-1.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200",title:`Close all ${e.length} tab${e.length===1?"":"s"}`,children:g.jsx(rC,{size:14})}),g.jsx("div",{className:"flex flex-1 overflow-x-auto",children:e.map(c=>{const h=c.path.split("/").pop()??c.path,m=c.path===r,f=n[c.path]===!0,v=m?"bg-neutral-950 text-neutral-100":"text-neutral-400 hover:bg-neutral-900 hover:text-neutral-200",w=f?"bg-amber-900/30 text-amber-200":"";return g.jsxs("div",{className:`group flex items-center gap-1 border-r border-neutral-800 px-3 py-1.5 text-xs ${v} ${w}`,title:f?`${c.path}
|
|
375
|
+
|
|
376
|
+
External change while you have unsaved edits — open the tab to review.`:c.path,children:[g.jsxs("button",{onClick:()=>s(c.path),className:"truncate",children:[f?g.jsx(cC,{size:11,className:"mr-1 inline text-amber-400"}):c.dirty?g.jsx("span",{className:"mr-1 text-amber-400",children:"•"}):null,h]}),g.jsx("button",{onClick:()=>a(c.path),className:"rounded p-1 text-neutral-600 hover:bg-neutral-800 hover:text-neutral-200",title:"Close (any unsaved changes are lost)",children:g.jsx(Br,{size:16})})]},c.tabId)})})]})}function JL({path:e,onReload:r,onDiscard:n}){return g.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-amber-700/40 bg-amber-900/20 px-4 py-1.5 text-xs text-amber-200",children:[g.jsxs("span",{children:["File changed externally — local edits in this tab are stale. Reload from disk?",g.jsx("span",{className:"ml-2 font-mono text-[10px] text-amber-400/70",children:e})]}),g.jsxs("div",{className:"flex gap-1",children:[g.jsx("button",{onClick:r,className:"rounded border border-amber-700/50 px-2 py-0.5 hover:bg-amber-900/30",children:"Reload"}),g.jsx("button",{onClick:n,className:"rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500",children:"Keep mine"})]})]})}function eM({file:e,wrap:r,onToggleWrap:n,onSave:s}){const a=e.dirty,u=e.saving,d=e.savedAt,o=e.saveError;let c,h="text-neutral-500";o!==void 0?(c=`Save failed (${o}) — Cmd/Ctrl+S or Save to retry`,h="text-rose-400"):u?c="Saving…":a?(c="Unsaved changes",h="text-amber-400"):d!==void 0?(c=`Saved ${new Date(d).toLocaleTimeString()}`,h="text-emerald-500"):c="Up to date";const m=(a||o!==void 0)&&!u&&!e.binary;return g.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-neutral-800 bg-neutral-900/40 px-3 py-1 text-[11px]",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"font-mono text-neutral-500",children:e.language}),g.jsxs("button",{onClick:n,className:`flex items-center gap-1 rounded px-1 py-0.5 text-[10px] hover:bg-neutral-800 ${r?"text-neutral-300":"text-neutral-500"}`,title:r?"Wrap on (click to switch to horizontal scroll, persisted per file extension)":"Wrap off (click to enable wrap, persisted per file extension)",children:[g.jsx(aC,{size:11}),r?"wrap":"no wrap"]})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:h,children:c}),g.jsxs("button",{onClick:s,disabled:!m,className:"flex items-center gap-1 rounded border border-neutral-700 px-1.5 py-0.5 text-[10px] text-neutral-200 hover:border-neutral-500 disabled:cursor-not-allowed disabled:border-neutral-800 disabled:text-neutral-600",title:"Save (Cmd/Ctrl+S)",children:[g.jsx(eC,{size:11}),"Save"]})]})]})}var Oh={exports:{}},Rb;function tM(){return Rb||(Rb=1,(function(e,r){(function(n,s){e.exports=s()})(globalThis,(()=>(()=>{var n={4567:function(d,o,c){var h=this&&this.__decorate||function(_,x,E,N){var T,j=arguments.length,R=j<3?x:N===null?N=Object.getOwnPropertyDescriptor(x,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(_,x,E,N);else for(var D=_.length-1;D>=0;D--)(T=_[D])&&(R=(j<3?T(R):j>3?T(x,E,R):T(x,E))||R);return j>3&&R&&Object.defineProperty(x,E,R),R},m=this&&this.__param||function(_,x){return function(E,N){x(E,N,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const f=c(9042),v=c(9924),w=c(844),A=c(4725),b=c(2585),y=c(3656);let S=o.AccessibilityManager=class extends w.Disposable{constructor(_,x,E,N){super(),this._terminal=_,this._coreBrowserService=E,this._renderService=N,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let T=0;T<this._terminal.rows;T++)this._rowElements[T]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[T]);if(this._topBoundaryFocusListener=T=>this._handleBoundaryFocus(T,0),this._bottomBoundaryFocusListener=T=>this._handleBoundaryFocus(T,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new v.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((T=>this._handleResize(T.rows)))),this.register(this._terminal.onRender((T=>this._refreshRows(T.start,T.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((T=>this._handleChar(T)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
377
|
+
`)))),this.register(this._terminal.onA11yTab((T=>this._handleTab(T)))),this.register(this._terminal.onKey((T=>this._handleKey(T.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,y.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,w.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(_){for(let x=0;x<_;x++)this._handleChar(" ")}_handleChar(_){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==_&&(this._charsToAnnounce+=_):this._charsToAnnounce+=_,_===`
|
|
378
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(_){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(_)||this._charsToConsume.push(_)}_refreshRows(_,x){this._liveRegionDebouncer.refresh(_,x,this._terminal.rows)}_renderRows(_,x){const E=this._terminal.buffer,N=E.lines.length.toString();for(let T=_;T<=x;T++){const j=E.lines.get(E.ydisp+T),R=[],D=(j==null?void 0:j.translateToString(!0,void 0,void 0,R))||"",L=(E.ydisp+T+1).toString(),z=this._rowElements[T];z&&(D.length===0?(z.innerText=" ",this._rowColumns.set(z,[0,1])):(z.textContent=D,this._rowColumns.set(z,R)),z.setAttribute("aria-posinset",L),z.setAttribute("aria-setsize",N))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(_,x){const E=_.target,N=this._rowElements[x===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(x===0?"1":`${this._terminal.buffer.lines.length}`)||_.relatedTarget!==N)return;let T,j;if(x===0?(T=E,j=this._rowElements.pop(),this._rowContainer.removeChild(j)):(T=this._rowElements.shift(),j=E,this._rowContainer.removeChild(T)),T.removeEventListener("focus",this._topBoundaryFocusListener),j.removeEventListener("focus",this._bottomBoundaryFocusListener),x===0){const R=this._createAccessibilityTreeNode();this._rowElements.unshift(R),this._rowContainer.insertAdjacentElement("afterbegin",R)}else{const R=this._createAccessibilityTreeNode();this._rowElements.push(R),this._rowContainer.appendChild(R)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(x===0?-1:1),this._rowElements[x===0?1:this._rowElements.length-2].focus(),_.preventDefault(),_.stopImmediatePropagation()}_handleSelectionChange(){var D;if(this._rowElements.length===0)return;const _=document.getSelection();if(!_)return;if(_.isCollapsed)return void(this._rowContainer.contains(_.anchorNode)&&this._terminal.clearSelection());if(!_.anchorNode||!_.focusNode)return void console.error("anchorNode and/or focusNode are null");let x={node:_.anchorNode,offset:_.anchorOffset},E={node:_.focusNode,offset:_.focusOffset};if((x.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||x.node===E.node&&x.offset>E.offset)&&([x,E]=[E,x]),x.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(x={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(x.node))return;const N=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(N)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:N,offset:((D=N.textContent)==null?void 0:D.length)??0}),!this._rowContainer.contains(E.node))return;const T=({node:L,offset:z})=>{const U=L instanceof Text?L.parentNode:L;let P=parseInt(U==null?void 0:U.getAttribute("aria-posinset"),10)-1;if(isNaN(P))return console.warn("row is invalid. Race condition?"),null;const G=this._rowColumns.get(U);if(!G)return console.warn("columns is null. Race condition?"),null;let K=z<G.length?G[z]:G.slice(-1)[0]+1;return K>=this._terminal.cols&&(++P,K=0),{row:P,column:K}},j=T(x),R=T(E);if(j&&R){if(j.row>R.row||j.row===R.row&&j.column>=R.column)throw new Error("invalid range");this._terminal.select(j.column,j.row,(R.row-j.row)*this._terminal.cols-j.column+R.column)}}_handleResize(_){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let x=this._rowContainer.children.length;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);for(;this._rowElements.length>_;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const _=this._coreBrowserService.mainDocument.createElement("div");return _.setAttribute("role","listitem"),_.tabIndex=-1,this._refreshRowDimensions(_),_}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let _=0;_<this._terminal.rows;_++)this._refreshRowDimensions(this._rowElements[_])}}_refreshRowDimensions(_){_.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=S=h([m(1,b.IInstantiationService),m(2,A.ICoreBrowserService),m(3,A.IRenderService)],S)},3614:(d,o)=>{function c(v){return v.replace(/\r?\n/g,"\r")}function h(v,w){return w?"\x1B[200~"+v+"\x1B[201~":v}function m(v,w,A,b){v=h(v=c(v),A.decPrivateModes.bracketedPasteMode&&b.rawOptions.ignoreBracketedPasteMode!==!0),A.triggerDataEvent(v,!0),w.value=""}function f(v,w,A){const b=A.getBoundingClientRect(),y=v.clientX-b.left-10,S=v.clientY-b.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${y}px`,w.style.top=`${S}px`,w.style.zIndex="1000",w.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=h,o.copyHandler=function(v,w){v.clipboardData&&v.clipboardData.setData("text/plain",w.selectionText),v.preventDefault()},o.handlePasteEvent=function(v,w,A,b){v.stopPropagation(),v.clipboardData&&m(v.clipboardData.getData("text/plain"),w,A,b)},o.paste=m,o.moveTextAreaUnderMouseCursor=f,o.rightClickHandler=function(v,w,A,b,y){f(v,w,A),y&&b.rightClickSelect(v),w.value=b.selectionText,w.select()}},7239:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const h=c(1505);o.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(m,f,v){this._css.set(m,f,v)}getCss(m,f){return this._css.get(m,f)}setColor(m,f,v){this._color.set(m,f,v)}getColor(m,f){return this._color.get(m,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,h,m,f){c.addEventListener(h,m,f);let v=!1;return{dispose:()=>{v||(v=!0,c.removeEventListener(h,m,f))}}}},3551:function(d,o,c){var h=this&&this.__decorate||function(S,_,x,E){var N,T=arguments.length,j=T<3?_:E===null?E=Object.getOwnPropertyDescriptor(_,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(S,_,x,E);else for(var R=S.length-1;R>=0;R--)(N=S[R])&&(j=(T<3?N(j):T>3?N(_,x,j):N(_,x))||j);return T>3&&j&&Object.defineProperty(_,x,j),j},m=this&&this.__param||function(S,_){return function(x,E){_(x,E,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const f=c(3656),v=c(8460),w=c(844),A=c(2585),b=c(4725);let y=o.Linkifier=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(S,_,x,E,N){super(),this._element=S,this._mouseService=_,this._renderService=x,this._bufferService=E,this._linkProviderService=N,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.toDisposable)((()=>{var T;this._lastMouseEvent=void 0,(T=this._activeProviderReplies)==null||T.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(S){this._lastMouseEvent=S;const _=this._positionFromMouseEvent(S,this._element,this._mouseService);if(!_)return;this._isMouseOut=!1;const x=S.composedPath();for(let E=0;E<x.length;E++){const N=x[E];if(N.classList.contains("xterm"))break;if(N.classList.contains("xterm-hover"))return}this._lastBufferCell&&_.x===this._lastBufferCell.x&&_.y===this._lastBufferCell.y||(this._handleHover(_),this._lastBufferCell=_)}_handleHover(S){if(this._activeLine!==S.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(S,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,S)||(this._clearCurrentLink(),this._askForLink(S,!0))}_askForLink(S,_){var E,N;this._activeProviderReplies&&_||((E=this._activeProviderReplies)==null||E.forEach((T=>{T==null||T.forEach((j=>{j.link.dispose&&j.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=S.y);let x=!1;for(const[T,j]of this._linkProviderService.linkProviders.entries())_?(N=this._activeProviderReplies)!=null&&N.get(T)&&(x=this._checkLinkProviderResult(T,S,x)):j.provideLinks(S.y,(R=>{var L,z;if(this._isMouseOut)return;const D=R==null?void 0:R.map((U=>({link:U})));(L=this._activeProviderReplies)==null||L.set(T,D),x=this._checkLinkProviderResult(T,S,x),((z=this._activeProviderReplies)==null?void 0:z.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(S.y,this._activeProviderReplies)}))}_removeIntersectingLinks(S,_){const x=new Set;for(let E=0;E<_.size;E++){const N=_.get(E);if(N)for(let T=0;T<N.length;T++){const j=N[T],R=j.link.range.start.y<S?0:j.link.range.start.x,D=j.link.range.end.y>S?this._bufferService.cols:j.link.range.end.x;for(let L=R;L<=D;L++){if(x.has(L)){N.splice(T--,1);break}x.add(L)}}}}_checkLinkProviderResult(S,_,x){var T;if(!this._activeProviderReplies)return x;const E=this._activeProviderReplies.get(S);let N=!1;for(let j=0;j<S;j++)this._activeProviderReplies.has(j)&&!this._activeProviderReplies.get(j)||(N=!0);if(!N&&E){const j=E.find((R=>this._linkAtPosition(R.link,_)));j&&(x=!0,this._handleNewLink(j))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!x)for(let j=0;j<this._activeProviderReplies.size;j++){const R=(T=this._activeProviderReplies.get(j))==null?void 0:T.find((D=>this._linkAtPosition(D.link,_)));if(R){x=!0,this._handleNewLink(R);break}}return x}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(S){if(!this._currentLink)return;const _=this._positionFromMouseEvent(S,this._element,this._mouseService);_&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,_)&&this._currentLink.link.activate(S,this._currentLink.link.text)}_clearCurrentLink(S,_){this._currentLink&&this._lastMouseEvent&&(!S||!_||this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=_)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(S){if(!this._lastMouseEvent)return;const _=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);_&&this._linkAtPosition(S.link,_)&&(this._currentLink=S,this._currentLink.state={decorations:{underline:S.link.decorations===void 0||S.link.decorations.underline,pointerCursor:S.link.decorations===void 0||S.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,S.link,this._lastMouseEvent),S.link.decorations={},Object.defineProperties(S.link.decorations,{pointerCursor:{get:()=>{var x,E;return(E=(x=this._currentLink)==null?void 0:x.state)==null?void 0:E.decorations.pointerCursor},set:x=>{var E;(E=this._currentLink)!=null&&E.state&&this._currentLink.state.decorations.pointerCursor!==x&&(this._currentLink.state.decorations.pointerCursor=x,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",x))}},underline:{get:()=>{var x,E;return(E=(x=this._currentLink)==null?void 0:x.state)==null?void 0:E.decorations.underline},set:x=>{var E,N,T;(E=this._currentLink)!=null&&E.state&&((T=(N=this._currentLink)==null?void 0:N.state)==null?void 0:T.decorations.underline)!==x&&(this._currentLink.state.decorations.underline=x,this._currentLink.state.isHovered&&this._fireUnderlineEvent(S.link,x))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((x=>{if(!this._currentLink)return;const E=x.start===0?0:x.start+1+this._bufferService.buffer.ydisp,N=this._bufferService.buffer.ydisp+1+x.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=N&&(this._clearCurrentLink(E,N),this._lastMouseEvent)){const T=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);T&&this._askForLink(T,!1)}}))))}_linkHover(S,_,x){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!0),this._currentLink.state.decorations.pointerCursor&&S.classList.add("xterm-cursor-pointer")),_.hover&&_.hover(x,_.text)}_fireUnderlineEvent(S,_){const x=S.range,E=this._bufferService.buffer.ydisp,N=this._createLinkUnderlineEvent(x.start.x-1,x.start.y-E-1,x.end.x,x.end.y-E-1,void 0);(_?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(N)}_linkLeave(S,_,x){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!1),this._currentLink.state.decorations.pointerCursor&&S.classList.remove("xterm-cursor-pointer")),_.leave&&_.leave(x,_.text)}_linkAtPosition(S,_){const x=S.range.start.y*this._bufferService.cols+S.range.start.x,E=S.range.end.y*this._bufferService.cols+S.range.end.x,N=_.y*this._bufferService.cols+_.x;return x<=N&&N<=E}_positionFromMouseEvent(S,_,x){const E=x.getCoords(S,_,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(S,_,x,E,N){return{x1:S,y1:_,x2:x,y2:E,cols:this._bufferService.cols,fg:N}}};o.Linkifier=y=h([m(1,b.IMouseService),m(2,b.IRenderService),m(3,A.IBufferService),m(4,b.ILinkProviderService)],y)},9042:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(d,o,c){var h=this&&this.__decorate||function(b,y,S,_){var x,E=arguments.length,N=E<3?y:_===null?_=Object.getOwnPropertyDescriptor(y,S):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(b,y,S,_);else for(var T=b.length-1;T>=0;T--)(x=b[T])&&(N=(E<3?x(N):E>3?x(y,S,N):x(y,S))||N);return E>3&&N&&Object.defineProperty(y,S,N),N},m=this&&this.__param||function(b,y){return function(S,_){y(S,_,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const f=c(511),v=c(2585);let w=o.OscLinkProvider=class{constructor(b,y,S){this._bufferService=b,this._optionsService=y,this._oscLinkService=S}provideLinks(b,y){var D;const S=this._bufferService.buffer.lines.get(b-1);if(!S)return void y(void 0);const _=[],x=this._optionsService.rawOptions.linkHandler,E=new f.CellData,N=S.getTrimmedLength();let T=-1,j=-1,R=!1;for(let L=0;L<N;L++)if(j!==-1||S.hasContent(L)){if(S.loadCell(L,E),E.hasExtendedAttrs()&&E.extended.urlId){if(j===-1){j=L,T=E.extended.urlId;continue}R=E.extended.urlId!==T}else j!==-1&&(R=!0);if(R||j!==-1&&L===N-1){const z=(D=this._oscLinkService.getLinkData(T))==null?void 0:D.uri;if(z){const U={start:{x:j+1,y:b},end:{x:L+(R||L!==N-1?0:1),y:b}};let P=!1;if(!(x!=null&&x.allowNonHttpProtocols))try{const G=new URL(z);["http:","https:"].includes(G.protocol)||(P=!0)}catch{P=!0}P||_.push({text:z,range:U,activate:(G,K)=>x?x.activate(G,K,U):A(0,K),hover:(G,K)=>{var W;return(W=x==null?void 0:x.hover)==null?void 0:W.call(x,G,K,U)},leave:(G,K)=>{var W;return(W=x==null?void 0:x.leave)==null?void 0:W.call(x,G,K,U)}})}R=!1,E.hasExtendedAttrs()&&E.extended.urlId?(j=L,T=E.extended.urlId):(j=-1,T=-1)}}y(_)}};function A(b,y){if(confirm(`Do you want to navigate to ${y}?
|
|
379
|
+
|
|
380
|
+
WARNING: This link could potentially be dangerous`)){const S=window.open();if(S){try{S.opener=null}catch{}S.location.href=y}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=w=h([m(0,v.IBufferService),m(1,v.IOptionsService),m(2,v.IOscLinkService)],w)},6193:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,h){this._renderCallback=c,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,h,m){this._rowCount=m,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const h=c(3614),m=c(3656),f=c(3551),v=c(9042),w=c(3730),A=c(1680),b=c(3107),y=c(5744),S=c(2950),_=c(1296),x=c(428),E=c(4269),N=c(5114),T=c(8934),j=c(3230),R=c(9312),D=c(4725),L=c(6731),z=c(8055),U=c(8969),P=c(8460),G=c(844),K=c(6114),W=c(8437),Y=c(2584),ne=c(7399),F=c(5941),B=c(9074),O=c(2585),Q=c(5435),M=c(4567),J=c(779);class de extends U.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(X={}){super(X),this.browser=K,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new G.MutableDisposable),this._onCursorMove=this.register(new P.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new P.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new P.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new P.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new P.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new P.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new P.EventEmitter),this._onBlur=this.register(new P.EventEmitter),this._onA11yCharEmitter=this.register(new P.EventEmitter),this._onA11yTabEmitter=this.register(new P.EventEmitter),this._onWillOpen=this.register(new P.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(J.LinkProviderService),this._instantiationService.setService(D.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(w.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows((($,se)=>this.refresh($,se)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport(($=>this._reportWindowsOptions($)))),this.register(this._inputHandler.onColor(($=>this._handleColorEvent($)))),this.register((0,P.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,P.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(($=>this._afterResize($.cols,$.rows)))),this.register((0,G.toDisposable)((()=>{var $,se;this._customKeyEventHandler=void 0,(se=($=this.element)==null?void 0:$.parentNode)==null||se.removeChild(this.element)})))}_handleColorEvent(X){if(this._themeService)for(const $ of X){let se,le="";switch($.index){case 256:se="foreground",le="10";break;case 257:se="background",le="11";break;case 258:se="cursor",le="12";break;default:se="ansi",le="4;"+$.index}switch($.type){case 0:const te=z.color.toColorRGB(se==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[se]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${le};${(0,F.toRgbString)(te)}${Y.C1_ESCAPED.ST}`);break;case 1:if(se==="ansi")this._themeService.modifyColors((ue=>ue.ansi[$.index]=z.channels.toColor(...$.color)));else{const ue=se;this._themeService.modifyColors((Ae=>Ae[ue]=z.channels.toColor(...$.color)))}break;case 2:this._themeService.restoreColor($.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(X){X?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(M.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(X){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var X;return(X=this.textarea)==null?void 0:X.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const X=this.buffer.ybase+this.buffer.y,$=this.buffer.lines.get(X);if(!$)return;const se=Math.min(this.buffer.x,this.cols-1),le=this._renderService.dimensions.css.cell.height,te=$.getWidth(se),ue=this._renderService.dimensions.css.cell.width*te,Ae=this.buffer.y*this._renderService.dimensions.css.cell.height,Le=se*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Le+"px",this.textarea.style.top=Ae+"px",this.textarea.style.width=ue+"px",this.textarea.style.height=le+"px",this.textarea.style.lineHeight=le+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",($=>{this.hasSelection()&&(0,h.copyHandler)($,this._selectionService)})));const X=$=>(0,h.handlePasteEvent)($,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",X)),this.register((0,m.addDisposableDomListener)(this.element,"paste",X)),K.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",($=>{$.button===2&&(0,h.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",($=>{(0,h.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),K.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",($=>{$.button===1&&(0,h.moveTextAreaUnderMouseCursor)($,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(X=>this._keyUp(X)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(X=>this._keyDown(X)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(X=>this._keyPress(X)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(X=>this._compositionHelper.compositionupdate(X)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(X=>this._inputEvent(X)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(X){var se;if(!X)throw new Error("Terminal requires a parent element.");if(X.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((se=this.element)==null?void 0:se.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=X.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),X.appendChild(this.element);const $=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),$.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,m.addDisposableDomListener)(this.screenElement,"mousemove",(le=>this.updateCursorStyle(le)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),$.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),K.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(N.CoreBrowserService,this.textarea,X.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(D.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(le=>this._handleTextAreaFocus(le)))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(x.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(D.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(L.ThemeService),this._instantiationService.setService(D.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(D.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(j.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(D.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((le=>this._onRender.fire(le)))),this.onResize((le=>this._renderService.resize(le.cols,le.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(S.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(T.MouseService),this._instantiationService.setService(D.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild($);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(A.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((le=>this.scrollLines(le.amount,le.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(R.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(D.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((le=>this.scrollLines(le.amount,le.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((le=>this._renderService.handleSelectionChanged(le.start,le.end,le.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((le=>{this.textarea.value=le,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((le=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(b.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(le=>this._selectionService.handleMouseDown(le)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(M.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(le=>this._handleScreenReaderModeOptionChange(le)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(le=>{!this._overviewRulerRenderer&&le&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(_.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const X=this,$=this.element;function se(ue){const Ae=X._mouseService.getMouseReportCoords(ue,X.screenElement);if(!Ae)return!1;let Le,Me;switch(ue.overrideType||ue.type){case"mousemove":Me=32,ue.buttons===void 0?(Le=3,ue.button!==void 0&&(Le=ue.button<3?ue.button:3)):Le=1&ue.buttons?0:4&ue.buttons?1:2&ue.buttons?2:3;break;case"mouseup":Me=0,Le=ue.button<3?ue.button:3;break;case"mousedown":Me=1,Le=ue.button<3?ue.button:3;break;case"wheel":if(X._customWheelEventHandler&&X._customWheelEventHandler(ue)===!1||X.viewport.getLinesScrolled(ue)===0)return!1;Me=ue.deltaY<0?0:1,Le=4;break;default:return!1}return!(Me===void 0||Le===void 0||Le>4)&&X.coreMouseService.triggerMouseEvent({col:Ae.col,row:Ae.row,x:Ae.x,y:Ae.y,button:Le,action:Me,ctrl:ue.ctrlKey,alt:ue.altKey,shift:ue.shiftKey})}const le={mouseup:null,wheel:null,mousedrag:null,mousemove:null},te={mouseup:ue=>(se(ue),ue.buttons||(this._document.removeEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.removeEventListener("mousemove",le.mousedrag)),this.cancel(ue)),wheel:ue=>(se(ue),this.cancel(ue,!0)),mousedrag:ue=>{ue.buttons&&se(ue)},mousemove:ue=>{ue.buttons||se(ue)}};this.register(this.coreMouseService.onProtocolChange((ue=>{ue?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ue)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&ue?le.mousemove||($.addEventListener("mousemove",te.mousemove),le.mousemove=te.mousemove):($.removeEventListener("mousemove",le.mousemove),le.mousemove=null),16&ue?le.wheel||($.addEventListener("wheel",te.wheel,{passive:!1}),le.wheel=te.wheel):($.removeEventListener("wheel",le.wheel),le.wheel=null),2&ue?le.mouseup||(le.mouseup=te.mouseup):(this._document.removeEventListener("mouseup",le.mouseup),le.mouseup=null),4&ue?le.mousedrag||(le.mousedrag=te.mousedrag):(this._document.removeEventListener("mousemove",le.mousedrag),le.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)($,"mousedown",(ue=>{if(ue.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ue))return se(ue),le.mouseup&&this._document.addEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.addEventListener("mousemove",le.mousedrag),this.cancel(ue)}))),this.register((0,m.addDisposableDomListener)($,"wheel",(ue=>{if(!le.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ue)===!1)return!1;if(!this.buffer.hasScrollback){const Ae=this.viewport.getLinesScrolled(ue);if(Ae===0)return;const Le=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ue.deltaY<0?"A":"B");let Me="";for(let Pe=0;Pe<Math.abs(Ae);Pe++)Me+=Le;return this.coreService.triggerDataEvent(Me,!0),this.cancel(ue,!0)}return this.viewport.handleWheel(ue)?this.cancel(ue):void 0}}),{passive:!1})),this.register((0,m.addDisposableDomListener)($,"touchstart",(ue=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ue),this.cancel(ue)}),{passive:!0})),this.register((0,m.addDisposableDomListener)($,"touchmove",(ue=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ue)?void 0:this.cancel(ue)}),{passive:!1}))}refresh(X,$){var se;(se=this._renderService)==null||se.refreshRows(X,$)}updateCursorStyle(X){var $;($=this._selectionService)!=null&&$.shouldColumnSelect(X)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(X,$,se=0){var le;se===1?(super.scrollLines(X,$,se),this.refresh(0,this.rows-1)):(le=this.viewport)==null||le.scrollLines(X)}paste(X){(0,h.paste)(X,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(X){this._customKeyEventHandler=X}attachCustomWheelEventHandler(X){this._customWheelEventHandler=X}registerLinkProvider(X){return this._linkProviderService.registerLinkProvider(X)}registerCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const $=this._characterJoinerService.register(X);return this.refresh(0,this.rows-1),$}deregisterCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(X)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(X){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+X)}registerDecoration(X){return this._decorationService.registerDecoration(X)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(X,$,se){this._selectionService.setSelection(X,$,se)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var X;(X=this._selectionService)==null||X.clearSelection()}selectAll(){var X;(X=this._selectionService)==null||X.selectAll()}selectLines(X,$){var se;(se=this._selectionService)==null||se.selectLines(X,$)}_keyDown(X){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;const $=this.browser.isMac&&this.options.macOptionIsMeta&&X.altKey;if(!$&&!this._compositionHelper.keydown(X))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;$||X.key!=="Dead"&&X.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const se=(0,ne.evaluateKeyboardEvent)(X,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),se.type===3||se.type===2){const le=this.rows-1;return this.scrollLines(se.type===2?-le:le),this.cancel(X,!0)}return se.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,X)||(se.cancel&&this.cancel(X,!0),!se.key||!!(X.key&&!X.ctrlKey&&!X.altKey&&!X.metaKey&&X.key.length===1&&X.key.charCodeAt(0)>=65&&X.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(se.key!==Y.C0.ETX&&se.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:se.key,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(se.key,!0),!this.optionsService.rawOptions.screenReaderMode||X.altKey||X.ctrlKey?this.cancel(X,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(X,$){const se=X.isMac&&!this.options.macOptionIsMeta&&$.altKey&&!$.ctrlKey&&!$.metaKey||X.isWindows&&$.altKey&&$.ctrlKey&&!$.metaKey||X.isWindows&&$.getModifierState("AltGraph");return $.type==="keypress"?se:se&&(!$.keyCode||$.keyCode>47)}_keyUp(X){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||((function($){return $.keyCode===16||$.keyCode===17||$.keyCode===18})(X)||this.focus(),this.updateCursorStyle(X),this._keyPressHandled=!1)}_keyPress(X){let $;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)$=X.charCode;else if(X.which===null||X.which===void 0)$=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;$=X.which}return!(!$||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X)||($=String.fromCharCode($),this._onKey.fire({key:$,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent($,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(X){if(X.data&&X.inputType==="insertText"&&(!X.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const $=X.data;return this.coreService.triggerDataEvent($,!0),this.cancel(X),!0}return!1}resize(X,$){X!==this.cols||$!==this.rows?super.resize(X,$):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(X,$){var se,le;(se=this._charSizeService)==null||se.measure(),(le=this.viewport)==null||le.syncScrollArea(!0)}clear(){var X;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let $=1;$<this.rows;$++)this.buffer.lines.push(this.buffer.getBlankLine(W.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(X=this.viewport)==null||X.reset(),this.refresh(0,this.rows-1)}}reset(){var $,se;this.options.rows=this.rows,this.options.cols=this.cols;const X=this._customKeyEventHandler;this._setup(),super.reset(),($=this._selectionService)==null||$.reset(),this._decorationService.reset(),(se=this.viewport)==null||se.reset(),this._customKeyEventHandler=X,this.refresh(0,this.rows-1)}clearTextureAtlas(){var X;(X=this._renderService)==null||X.clearTextureAtlas()}_reportFocus(){var X;(X=this.element)!=null&&X.classList.contains("focus")?this.coreService.triggerDataEvent(Y.C0.ESC+"[I"):this.coreService.triggerDataEvent(Y.C0.ESC+"[O")}_reportWindowsOptions(X){if(this._renderService)switch(X){case Q.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const $=this._renderService.dimensions.css.canvas.width.toFixed(0),se=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[4;${se};${$}t`);break;case Q.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const le=this._renderService.dimensions.css.cell.width.toFixed(0),te=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[6;${te};${le}t`)}}cancel(X,$){if(this.options.cancelEvents||$)return X.preventDefault(),X.stopPropagation(),!1}}o.Terminal=de},9924:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,h=1e3){this._renderCallback=c,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,h,m){this._rowCount=m,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const v=f-this._lastRefreshMs,w=this._debounceThresholdMS-v;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),w)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h)}}},1680:function(d,o,c){var h=this&&this.__decorate||function(S,_,x,E){var N,T=arguments.length,j=T<3?_:E===null?E=Object.getOwnPropertyDescriptor(_,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(S,_,x,E);else for(var R=S.length-1;R>=0;R--)(N=S[R])&&(j=(T<3?N(j):T>3?N(_,x,j):N(_,x))||j);return T>3&&j&&Object.defineProperty(_,x,j),j},m=this&&this.__param||function(S,_){return function(x,E){_(x,E,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const f=c(3656),v=c(4725),w=c(8460),A=c(844),b=c(2585);let y=o.Viewport=class extends A.Disposable{constructor(S,_,x,E,N,T,j,R){super(),this._viewportElement=S,this._scrollArea=_,this._bufferService=x,this._optionsService=E,this._charSizeService=N,this._renderService=T,this._coreBrowserService=j,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((D=>this._renderDimensions=D))),this._handleThemeChange(R.colors),this.register(R.onChangeColors((D=>this._handleThemeChange(D)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(S){this._viewportElement.style.backgroundColor=S.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(S){if(S)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const _=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==_&&(this._lastRecordedBufferHeight=_,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const S=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==S&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=S),this._refreshAnimationFrame=null}syncScrollArea(S=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(S);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(S)}_handleScroll(S){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const _=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:_,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const S=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(S*(this._smoothScrollState.target-this._smoothScrollState.origin)),S<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(S,_){const x=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(_<0&&this._viewportElement.scrollTop!==0||_>0&&x<this._lastRecordedBufferHeight)||(S.cancelable&&S.preventDefault(),!1)}handleWheel(S){const _=this._getPixelsScrolled(S);return _!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+_:this._smoothScrollState.target+=_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=_,this._bubbleScroll(S,_))}scrollLines(S){if(S!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const _=S*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:S,suppressScrollEvent:!1})}_getPixelsScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let _=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_LINE?_*=this._currentRowHeight:S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._currentRowHeight*this._bufferService.rows),_}getBufferElements(S,_){var R;let x,E="";const N=[],T=_??this._bufferService.buffer.lines.length,j=this._bufferService.buffer.lines;for(let D=S;D<T;D++){const L=j.get(D);if(!L)continue;const z=(R=j.get(D+1))==null?void 0:R.isWrapped;if(E+=L.translateToString(!z),!z||D===j.length-1){const U=document.createElement("div");U.textContent=E,N.push(U),E.length>0&&(x=U),E=""}}return{bufferElements:N,cursorElement:x}}getLinesScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let _=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(_/=this._currentRowHeight+0,this._wheelPartialScroll+=_,_=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._bufferService.rows),_}_applyScrollModifier(S,_){const x=this._optionsService.rawOptions.fastScrollModifier;return x==="alt"&&_.altKey||x==="ctrl"&&_.ctrlKey||x==="shift"&&_.shiftKey?S*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:S*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(S){this._lastTouchY=S.touches[0].pageY}handleTouchMove(S){const _=this._lastTouchY-S.touches[0].pageY;return this._lastTouchY=S.touches[0].pageY,_!==0&&(this._viewportElement.scrollTop+=_,this._bubbleScroll(S,_))}};o.Viewport=y=h([m(2,b.IBufferService),m(3,b.IOptionsService),m(4,v.ICharSizeService),m(5,v.IRenderService),m(6,v.ICoreBrowserService),m(7,v.IThemeService)],y)},3107:function(d,o,c){var h=this&&this.__decorate||function(b,y,S,_){var x,E=arguments.length,N=E<3?y:_===null?_=Object.getOwnPropertyDescriptor(y,S):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(b,y,S,_);else for(var T=b.length-1;T>=0;T--)(x=b[T])&&(N=(E<3?x(N):E>3?x(y,S,N):x(y,S))||N);return E>3&&N&&Object.defineProperty(y,S,N),N},m=this&&this.__param||function(b,y){return function(S,_){y(S,_,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const f=c(4725),v=c(844),w=c(2585);let A=o.BufferDecorationRenderer=class extends v.Disposable{constructor(b,y,S,_,x){super(),this._screenElement=b,this._bufferService=y,this._coreBrowserService=S,this._decorationService=_,this._renderService=x,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((E=>this._removeDecoration(E)))),this.register((0,v.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const b of this._decorationService.decorations)this._renderDecoration(b);this._dimensionsChanged=!1}_renderDecoration(b){this._refreshStyle(b),this._dimensionsChanged&&this._refreshXPosition(b)}_createElement(b){var _;const y=this._coreBrowserService.mainDocument.createElement("div");y.classList.add("xterm-decoration"),y.classList.toggle("xterm-decoration-top-layer",((_=b==null?void 0:b.options)==null?void 0:_.layer)==="top"),y.style.width=`${Math.round((b.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,y.style.height=(b.options.height||1)*this._renderService.dimensions.css.cell.height+"px",y.style.top=(b.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",y.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const S=b.options.x??0;return S&&S>this._bufferService.cols&&(y.style.display="none"),this._refreshXPosition(b,y),y}_refreshStyle(b){const y=b.marker.line-this._bufferService.buffers.active.ydisp;if(y<0||y>=this._bufferService.rows)b.element&&(b.element.style.display="none",b.onRenderEmitter.fire(b.element));else{let S=this._decorationElements.get(b);S||(S=this._createElement(b),b.element=S,this._decorationElements.set(b,S),this._container.appendChild(S),b.onDispose((()=>{this._decorationElements.delete(b),S.remove()}))),S.style.top=y*this._renderService.dimensions.css.cell.height+"px",S.style.display=this._altBufferIsActive?"none":"block",b.onRenderEmitter.fire(S)}}_refreshXPosition(b,y=b.element){if(!y)return;const S=b.options.x??0;(b.options.anchor||"left")==="right"?y.style.right=S?S*this._renderService.dimensions.css.cell.width+"px":"":y.style.left=S?S*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(b){var y;(y=this._decorationElements.get(b))==null||y.remove(),this._decorationElements.delete(b),b.dispose()}};o.BufferDecorationRenderer=A=h([m(1,w.IBufferService),m(2,f.ICoreBrowserService),m(3,w.IDecorationService),m(4,f.IRenderService)],A)},5871:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const h of this._zones)if(h.color===c.options.overviewRulerOptions.color&&h.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,c.marker.line))return;if(this._lineAdjacentToZone(h,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(h,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,h){return h>=c.startBufferLine&&h<=c.endBufferLine}_lineAdjacentToZone(c,h,m){return h>=c.startBufferLine-this._linePadding[m||"full"]&&h<=c.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(d,o,c){var h=this&&this.__decorate||function(x,E,N,T){var j,R=arguments.length,D=R<3?E:T===null?T=Object.getOwnPropertyDescriptor(E,N):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(x,E,N,T);else for(var L=x.length-1;L>=0;L--)(j=x[L])&&(D=(R<3?j(D):R>3?j(E,N,D):j(E,N))||D);return R>3&&D&&Object.defineProperty(E,N,D),D},m=this&&this.__param||function(x,E){return function(N,T){E(N,T,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const f=c(5871),v=c(4725),w=c(844),A=c(2585),b={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0},S={full:0,left:0,center:0,right:0};let _=o.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(x,E,N,T,j,R,D){var z;super(),this._viewportElement=x,this._screenElement=E,this._bufferService=N,this._decorationService=T,this._renderService=j,this._optionsService=R,this._coreBrowserService=D,this._colorZoneStore=new f.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(z=this._viewportElement.parentElement)==null||z.insertBefore(this._canvas,this._viewportElement);const L=this._canvas.getContext("2d");if(!L)throw new Error("Ctx cannot be null");this._ctx=L,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,w.toDisposable)((()=>{var U;(U=this._canvas)==null||U.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const x=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);y.full=this._canvas.width,y.left=x,y.center=E,y.right=x,this._refreshDrawHeightConstants(),S.full=0,S.left=0,S.center=y.left,S.right=y.left+y.center}_refreshDrawHeightConstants(){b.full=Math.round(2*this._coreBrowserService.dpr);const x=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(x,12),6)*this._coreBrowserService.dpr);b.left=E,b.center=E,b.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const x=this._colorZoneStore.zones;for(const E of x)E.position!=="full"&&this._renderColorZone(E);for(const E of x)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(x){this._ctx.fillStyle=x.color,this._ctx.fillRect(S[x.position||"full"],Math.round((this._canvas.height-1)*(x.startBufferLine/this._bufferService.buffers.active.lines.length)-b[x.position||"full"]/2),y[x.position||"full"],Math.round((this._canvas.height-1)*((x.endBufferLine-x.startBufferLine)/this._bufferService.buffers.active.lines.length)+b[x.position||"full"]))}_queueRefresh(x,E){this._shouldUpdateDimensions=x||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=_=h([m(2,A.IBufferService),m(3,A.IDecorationService),m(4,v.IRenderService),m(5,A.IOptionsService),m(6,v.ICoreBrowserService)],_)},2950:function(d,o,c){var h=this&&this.__decorate||function(b,y,S,_){var x,E=arguments.length,N=E<3?y:_===null?_=Object.getOwnPropertyDescriptor(y,S):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(b,y,S,_);else for(var T=b.length-1;T>=0;T--)(x=b[T])&&(N=(E<3?x(N):E>3?x(y,S,N):x(y,S))||N);return E>3&&N&&Object.defineProperty(y,S,N),N},m=this&&this.__param||function(b,y){return function(S,_){y(S,_,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const f=c(4725),v=c(2585),w=c(2584);let A=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(b,y,S,_,x,E){this._textarea=b,this._compositionView=y,this._bufferService=S,this._optionsService=_,this._coreService=x,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(b){this._compositionView.textContent=b.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(b){if(this._isComposing||this._isSendingComposition){if(b.keyCode===229||b.keyCode===16||b.keyCode===17||b.keyCode===18)return!1;this._finalizeComposition(!1)}return b.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(b){if(this._compositionView.classList.remove("active"),this._isComposing=!1,b){const y={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let S;this._isSendingComposition=!1,y.start+=this._dataAlreadySent.length,S=this._isComposing?this._textarea.value.substring(y.start,y.end):this._textarea.value.substring(y.start),S.length>0&&this._coreService.triggerDataEvent(S,!0)}}),0)}else{this._isSendingComposition=!1;const y=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(y,!0)}}_handleAnyTextareaChanges(){const b=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const y=this._textarea.value,S=y.replace(b,"");this._dataAlreadySent=S,y.length>b.length?this._coreService.triggerDataEvent(S,!0):y.length<b.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):y.length===b.length&&y!==b&&this._coreService.triggerDataEvent(y,!0)}}),0)}updateCompositionElements(b){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const y=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),S=this._renderService.dimensions.css.cell.height,_=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,x=y*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=x+"px",this._compositionView.style.top=_+"px",this._compositionView.style.height=S+"px",this._compositionView.style.lineHeight=S+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=x+"px",this._textarea.style.top=_+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}b||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=A=h([m(2,v.IBufferService),m(3,v.IOptionsService),m(4,v.ICoreService),m(5,f.IRenderService)],A)},9806:(d,o)=>{function c(h,m,f){const v=f.getBoundingClientRect(),w=h.getComputedStyle(f),A=parseInt(w.getPropertyValue("padding-left")),b=parseInt(w.getPropertyValue("padding-top"));return[m.clientX-v.left-A,m.clientY-v.top-b]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(h,m,f,v,w,A,b,y,S){if(!A)return;const _=c(h,m,f);return _?(_[0]=Math.ceil((_[0]+(S?b/2:0))/b),_[1]=Math.ceil(_[1]/y),_[0]=Math.min(Math.max(_[0],1),v+(S?1:0)),_[1]=Math.min(Math.max(_[1],1),w),_):void 0}},9504:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const h=c(2584);function m(y,S,_,x){const E=y-f(y,_),N=S-f(S,_),T=Math.abs(E-N)-(function(j,R,D){let L=0;const z=j-f(j,D),U=R-f(R,D);for(let P=0;P<Math.abs(z-U);P++){const G=v(j,R)==="A"?-1:1,K=D.buffer.lines.get(z+G*P);K!=null&&K.isWrapped&&L++}return L})(y,S,_);return b(T,A(v(y,S),x))}function f(y,S){let _=0,x=S.buffer.lines.get(y),E=x==null?void 0:x.isWrapped;for(;E&&y>=0&&y<S.rows;)_++,x=S.buffer.lines.get(--y),E=x==null?void 0:x.isWrapped;return _}function v(y,S){return y>S?"A":"B"}function w(y,S,_,x,E,N){let T=y,j=S,R="";for(;T!==_||j!==x;)T+=E?1:-1,E&&T>N.cols-1?(R+=N.buffer.translateBufferLineToString(j,!1,y,T),T=0,y=0,j++):!E&&T<0&&(R+=N.buffer.translateBufferLineToString(j,!1,0,y+1),T=N.cols-1,y=T,j--);return R+N.buffer.translateBufferLineToString(j,!1,y,T)}function A(y,S){const _=S?"O":"[";return h.C0.ESC+_+y}function b(y,S){y=Math.floor(y);let _="";for(let x=0;x<y;x++)_+=S;return _}o.moveToCellSequence=function(y,S,_,x){const E=_.buffer.x,N=_.buffer.y;if(!_.buffer.hasScrollback)return(function(R,D,L,z,U,P){return m(D,z,U,P).length===0?"":b(w(R,D,R,D-f(D,U),!1,U).length,A("D",P))})(E,N,0,S,_,x)+m(N,S,_,x)+(function(R,D,L,z,U,P){let G;G=m(D,z,U,P).length>0?z-f(z,U):D;const K=z,W=(function(Y,ne,F,B,O,Q){let M;return M=m(F,B,O,Q).length>0?B-f(B,O):ne,Y<F&&M<=B||Y>=F&&M<B?"C":"D"})(R,D,L,z,U,P);return b(w(R,G,L,K,W==="C",U).length,A(W,P))})(E,N,y,S,_,x);let T;if(N===S)return T=E>y?"D":"C",b(Math.abs(E-y),A(T,x));T=N>S?"D":"C";const j=Math.abs(N-S);return b((function(R,D){return D.cols-R})(N>S?y:E,_)+(j-1)*_.cols+1+((N>S?E:y)-1),A(T,x))}},1296:function(d,o,c){var h=this&&this.__decorate||function(P,G,K,W){var Y,ne=arguments.length,F=ne<3?G:W===null?W=Object.getOwnPropertyDescriptor(G,K):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(P,G,K,W);else for(var B=P.length-1;B>=0;B--)(Y=P[B])&&(F=(ne<3?Y(F):ne>3?Y(G,K,F):Y(G,K))||F);return ne>3&&F&&Object.defineProperty(G,K,F),F},m=this&&this.__param||function(P,G){return function(K,W){G(K,W,P)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const f=c(3787),v=c(2550),w=c(2223),A=c(6171),b=c(6052),y=c(4725),S=c(8055),_=c(8460),x=c(844),E=c(2585),N="xterm-dom-renderer-owner-",T="xterm-rows",j="xterm-fg-",R="xterm-bg-",D="xterm-focus",L="xterm-selection";let z=1,U=o.DomRenderer=class extends x.Disposable{constructor(P,G,K,W,Y,ne,F,B,O,Q,M,J,de){super(),this._terminal=P,this._document=G,this._element=K,this._screenElement=W,this._viewportElement=Y,this._helperContainer=ne,this._linkifier2=F,this._charSizeService=O,this._optionsService=Q,this._bufferService=M,this._coreBrowserService=J,this._themeService=de,this._terminalClass=z++,this._rowElements=[],this._selectionRenderModel=(0,b.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new _.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(T),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(L),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,A.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((pe=>this._injectCss(pe)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(N+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((pe=>this._handleLinkHover(pe)))),this.register(this._linkifier2.onHideLinkUnderline((pe=>this._handleLinkLeave(pe)))),this.register((0,x.toDisposable)((()=>{this._element.classList.remove(N+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new v.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const P=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*P,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*P),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/P),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/P),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const K of this._rowElements)K.style.width=`${this.dimensions.css.canvas.width}px`,K.style.height=`${this.dimensions.css.cell.height}px`,K.style.lineHeight=`${this.dimensions.css.cell.height}px`,K.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const G=`${this._terminalSelector} .${T} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=G,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(P){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let G=`${this._terminalSelector} .${T} { color: ${P.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;G+=`${this._terminalSelector} .${T} .xterm-dim { color: ${S.color.multiplyOpacity(P.foreground,.5).css};}`,G+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const K=`blink_underline_${this._terminalClass}`,W=`blink_bar_${this._terminalClass}`,Y=`blink_block_${this._terminalClass}`;G+=`@keyframes ${K} { 50% { border-bottom-style: hidden; }}`,G+=`@keyframes ${W} { 50% { box-shadow: none; }}`,G+=`@keyframes ${Y} { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,G+=`${this._terminalSelector} .${T}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${T}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${T}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-block { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css};}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${P.cursor.css} !important; color: ${P.cursorAccent.css} !important;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${P.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${P.cursor.css} inset;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${P.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,G+=`${this._terminalSelector} .${L} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${L} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${L} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[ne,F]of P.ansi.entries())G+=`${this._terminalSelector} .${j}${ne} { color: ${F.css}; }${this._terminalSelector} .${j}${ne}.xterm-dim { color: ${S.color.multiplyOpacity(F,.5).css}; }${this._terminalSelector} .${R}${ne} { background-color: ${F.css}; }`;G+=`${this._terminalSelector} .${j}${w.INVERTED_DEFAULT_COLOR} { color: ${S.color.opaque(P.background).css}; }${this._terminalSelector} .${j}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${S.color.multiplyOpacity(S.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${R}${w.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=G}_setDefaultSpacing(){const P=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${P}px`,this._rowFactory.defaultSpacing=P}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(P,G){for(let K=this._rowElements.length;K<=G;K++){const W=this._document.createElement("div");this._rowContainer.appendChild(W),this._rowElements.push(W)}for(;this._rowElements.length>G;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,G){this._refreshRowElements(P,G),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(D),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(D),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(P,G,K){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,G,K),this.renderRows(0,this._bufferService.rows-1),!P||!G)return;this._selectionRenderModel.update(this._terminal,P,G,K);const W=this._selectionRenderModel.viewportStartRow,Y=this._selectionRenderModel.viewportEndRow,ne=this._selectionRenderModel.viewportCappedStartRow,F=this._selectionRenderModel.viewportCappedEndRow;if(ne>=this._bufferService.rows||F<0)return;const B=this._document.createDocumentFragment();if(K){const O=P[0]>G[0];B.appendChild(this._createSelectionElement(ne,O?G[0]:P[0],O?P[0]:G[0],F-ne+1))}else{const O=W===ne?P[0]:0,Q=ne===Y?G[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(ne,O,Q));const M=F-ne-1;if(B.appendChild(this._createSelectionElement(ne+1,0,this._bufferService.cols,M)),ne!==F){const J=Y===F?G[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(F,0,J))}}this._selectionContainer.appendChild(B)}_createSelectionElement(P,G,K,W=1){const Y=this._document.createElement("div"),ne=G*this.dimensions.css.cell.width;let F=this.dimensions.css.cell.width*(K-G);return ne+F>this.dimensions.css.canvas.width&&(F=this.dimensions.css.canvas.width-ne),Y.style.height=W*this.dimensions.css.cell.height+"px",Y.style.top=P*this.dimensions.css.cell.height+"px",Y.style.left=`${ne}px`,Y.style.width=`${F}px`,Y}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const P of this._rowElements)P.replaceChildren()}renderRows(P,G){const K=this._bufferService.buffer,W=K.ybase+K.y,Y=Math.min(K.x,this._bufferService.cols-1),ne=this._optionsService.rawOptions.cursorBlink,F=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=P;O<=G;O++){const Q=O+K.ydisp,M=this._rowElements[O],J=K.lines.get(Q);if(!M||!J)break;M.replaceChildren(...this._rowFactory.createRow(J,Q,Q===W,F,B,Y,ne,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${N}${this._terminalClass}`}_handleLinkHover(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!0)}_handleLinkLeave(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!1)}_setCellUnderline(P,G,K,W,Y,ne){K<0&&(P=0),W<0&&(G=0);const F=this._bufferService.rows-1;K=Math.max(Math.min(K,F),0),W=Math.max(Math.min(W,F),0),Y=Math.min(Y,this._bufferService.cols);const B=this._bufferService.buffer,O=B.ybase+B.y,Q=Math.min(B.x,Y-1),M=this._optionsService.rawOptions.cursorBlink,J=this._optionsService.rawOptions.cursorStyle,de=this._optionsService.rawOptions.cursorInactiveStyle;for(let pe=K;pe<=W;++pe){const X=pe+B.ydisp,$=this._rowElements[pe],se=B.lines.get(X);if(!$||!se)break;$.replaceChildren(...this._rowFactory.createRow(se,X,X===O,J,de,Q,M,this.dimensions.css.cell.width,this._widthCache,ne?pe===K?P:0:-1,ne?(pe===W?G:Y)-1:-1))}}};o.DomRenderer=U=h([m(7,E.IInstantiationService),m(8,y.ICharSizeService),m(9,E.IOptionsService),m(10,E.IBufferService),m(11,y.ICoreBrowserService),m(12,y.IThemeService)],U)},3787:function(d,o,c){var h=this&&this.__decorate||function(T,j,R,D){var L,z=arguments.length,U=z<3?j:D===null?D=Object.getOwnPropertyDescriptor(j,R):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(T,j,R,D);else for(var P=T.length-1;P>=0;P--)(L=T[P])&&(U=(z<3?L(U):z>3?L(j,R,U):L(j,R))||U);return z>3&&U&&Object.defineProperty(j,R,U),U},m=this&&this.__param||function(T,j){return function(R,D){j(R,D,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const f=c(2223),v=c(643),w=c(511),A=c(2585),b=c(8055),y=c(4725),S=c(4269),_=c(6171),x=c(3734);let E=o.DomRendererRowFactory=class{constructor(T,j,R,D,L,z,U){this._document=T,this._characterJoinerService=j,this._optionsService=R,this._coreBrowserService=D,this._coreService=L,this._decorationService=z,this._themeService=U,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(T,j,R){this._selectionStart=T,this._selectionEnd=j,this._columnSelectMode=R}createRow(T,j,R,D,L,z,U,P,G,K,W){const Y=[],ne=this._characterJoinerService.getJoinedCharacters(j),F=this._themeService.colors;let B,O=T.getNoBgTrimmedLength();R&&O<z+1&&(O=z+1);let Q=0,M="",J=0,de=0,pe=0,X=!1,$=0,se=!1,le=0;const te=[],ue=K!==-1&&W!==-1;for(let Ae=0;Ae<O;Ae++){T.loadCell(Ae,this._workCell);let Le=this._workCell.getWidth();if(Le===0)continue;let Me=!1,Pe=Ae,Be=this._workCell;if(ne.length>0&&Ae===ne[0][0]){Me=!0;const Ye=ne.shift();Be=new S.JoinedCellData(this._workCell,T.translateToString(!0,Ye[0],Ye[1]),Ye[1]-Ye[0]),Pe=Ye[1]-1,Le=Be.getWidth()}const jt=this._isCellInSelection(Ae,j),gt=R&&Ae===z,Ce=ue&&Ae>=K&&Ae<=W;let Kt=!1;this._decorationService.forEachDecorationAtCell(Ae,j,void 0,(Ye=>{Kt=!0}));let Mt=Be.getChars()||v.WHITESPACE_CELL_CHAR;if(Mt===" "&&(Be.isUnderline()||Be.isOverline())&&(Mt=" "),le=Le*P-G.get(Mt,Be.isBold(),Be.isItalic()),B){if(Q&&(jt&&se||!jt&&!se&&Be.bg===J)&&(jt&&se&&F.selectionForeground||Be.fg===de)&&Be.extended.ext===pe&&Ce===X&&le===$&&!gt&&!Me&&!Kt){Be.isInvisible()?M+=v.WHITESPACE_CELL_CHAR:M+=Mt,Q++;continue}Q&&(B.textContent=M),B=this._document.createElement("span"),Q=0,M=""}else B=this._document.createElement("span");if(J=Be.bg,de=Be.fg,pe=Be.extended.ext,X=Ce,$=le,se=jt,Me&&z>=Ae&&z<=Pe&&(z=Ae),!this._coreService.isCursorHidden&>&&this._coreService.isCursorInitialized){if(te.push("xterm-cursor"),this._coreBrowserService.isFocused)U&&te.push("xterm-cursor-blink"),te.push(D==="bar"?"xterm-cursor-bar":D==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(L)switch(L){case"outline":te.push("xterm-cursor-outline");break;case"block":te.push("xterm-cursor-block");break;case"bar":te.push("xterm-cursor-bar");break;case"underline":te.push("xterm-cursor-underline")}}if(Be.isBold()&&te.push("xterm-bold"),Be.isItalic()&&te.push("xterm-italic"),Be.isDim()&&te.push("xterm-dim"),M=Be.isInvisible()?v.WHITESPACE_CELL_CHAR:Be.getChars()||v.WHITESPACE_CELL_CHAR,Be.isUnderline()&&(te.push(`xterm-underline-${Be.extended.underlineStyle}`),M===" "&&(M=" "),!Be.isUnderlineColorDefault()))if(Be.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${x.AttributeData.toColorRGB(Be.getUnderlineColor()).join(",")})`;else{let Ye=Be.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Be.isBold()&&Ye<8&&(Ye+=8),B.style.textDecorationColor=F.ansi[Ye].css}Be.isOverline()&&(te.push("xterm-overline"),M===" "&&(M=" ")),Be.isStrikethrough()&&te.push("xterm-strikethrough"),Ce&&(B.style.textDecoration="underline");let st=Be.getFgColor(),xt=Be.getFgColorMode(),Pt=Be.getBgColor(),fe=Be.getBgColorMode();const _e=!!Be.isInverse();if(_e){const Ye=st;st=Pt,Pt=Ye;const Ot=xt;xt=fe,fe=Ot}let je,Ue,$e,Tt=!1;switch(this._decorationService.forEachDecorationAtCell(Ae,j,void 0,(Ye=>{Ye.options.layer!=="top"&&Tt||(Ye.backgroundColorRGB&&(fe=50331648,Pt=Ye.backgroundColorRGB.rgba>>8&16777215,je=Ye.backgroundColorRGB),Ye.foregroundColorRGB&&(xt=50331648,st=Ye.foregroundColorRGB.rgba>>8&16777215,Ue=Ye.foregroundColorRGB),Tt=Ye.options.layer==="top")})),!Tt&&jt&&(je=this._coreBrowserService.isFocused?F.selectionBackgroundOpaque:F.selectionInactiveBackgroundOpaque,Pt=je.rgba>>8&16777215,fe=50331648,Tt=!0,F.selectionForeground&&(xt=50331648,st=F.selectionForeground.rgba>>8&16777215,Ue=F.selectionForeground)),Tt&&te.push("xterm-decoration-top"),fe){case 16777216:case 33554432:$e=F.ansi[Pt],te.push(`xterm-bg-${Pt}`);break;case 50331648:$e=b.channels.toColor(Pt>>16,Pt>>8&255,255&Pt),this._addStyle(B,`background-color:#${N((Pt>>>0).toString(16),"0",6)}`);break;default:_e?($e=F.foreground,te.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):$e=F.background}switch(je||Be.isDim()&&(je=b.color.multiplyOpacity($e,.5)),xt){case 16777216:case 33554432:Be.isBold()&&st<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(st+=8),this._applyMinimumContrast(B,$e,F.ansi[st],Be,je,void 0)||te.push(`xterm-fg-${st}`);break;case 50331648:const Ye=b.channels.toColor(st>>16&255,st>>8&255,255&st);this._applyMinimumContrast(B,$e,Ye,Be,je,Ue)||this._addStyle(B,`color:#${N(st.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,$e,F.foreground,Be,je,Ue)||_e&&te.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}te.length&&(B.className=te.join(" "),te.length=0),gt||Me||Kt?B.textContent=M:Q++,le!==this.defaultSpacing&&(B.style.letterSpacing=`${le}px`),Y.push(B),Ae=Pe}return B&&Q&&(B.textContent=M),Y}_applyMinimumContrast(T,j,R,D,L,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,_.treatGlyphAsBackgroundColor)(D.getCode()))return!1;const U=this._getContrastCache(D);let P;if(L||z||(P=U.getColor(j.rgba,R.rgba)),P===void 0){const G=this._optionsService.rawOptions.minimumContrastRatio/(D.isDim()?2:1);P=b.color.ensureContrastRatio(L||j,z||R,G),U.setColor((L||j).rgba,(z||R).rgba,P??null)}return!!P&&(this._addStyle(T,`color:${P.css}`),!0)}_getContrastCache(T){return T.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(T,j){T.setAttribute("style",`${T.getAttribute("style")||""}${j};`)}_isCellInSelection(T,j){const R=this._selectionStart,D=this._selectionEnd;return!(!R||!D)&&(this._columnSelectMode?R[0]<=D[0]?T>=R[0]&&j>=R[1]&&T<D[0]&&j<=D[1]:T<R[0]&&j>=R[1]&&T>=D[0]&&j<=D[1]:j>R[1]&&j<D[1]||R[1]===D[1]&&j===R[1]&&T>=R[0]&&T<D[0]||R[1]<D[1]&&j===D[1]&&T<D[0]||R[1]<D[1]&&j===R[1]&&T>=R[0])}};function N(T,j,R){for(;T.length<R;)T=j+T;return T}o.DomRendererRowFactory=E=h([m(1,y.ICharacterJoinerService),m(2,A.IOptionsService),m(3,y.ICoreBrowserService),m(4,A.ICoreService),m(5,A.IDecorationService),m(6,y.IThemeService)],E)},2550:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const m=c.createElement("span");m.classList.add("xterm-char-measure-element");const f=c.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const v=c.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontStyle="italic";const w=c.createElement("span");w.classList.add("xterm-char-measure-element"),w.style.fontWeight="bold",w.style.fontStyle="italic",this._measureElements=[m,f,v,w],this._container.appendChild(m),this._container.appendChild(f),this._container.appendChild(v),this._container.appendChild(w),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,h,m,f){c===this._font&&h===this._fontSize&&m===this._weight&&f===this._weightBold||(this._font=c,this._fontSize=h,this._weight=m,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(c,h,m){let f=0;if(!h&&!m&&c.length===1&&(f=c.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const A=this._measure(c,0);return A>0&&(this._flat[f]=A),A}let v=c;h&&(v+="B"),m&&(v+="I");let w=this._holey.get(v);if(w===void 0){let A=0;h&&(A|=1),m&&(A|=2),w=this._measure(c,A),w>0&&this._holey.set(v,w)}return w}_measure(c,h){const m=this._measureElements[h];return m.textContent=c.repeat(32),m.offsetWidth/32}}},2223:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(d,o)=>{function c(m){return 57508<=m&&m<=57558}function h(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},o.isEmoji=h,o.allowRescaling=function(m,f,v,w){return f===1&&v>Math.ceil(1.5*w)&&m!==void 0&&m>255&&!h(m)&&!c(m)&&!(function(A){return 57344<=A&&A<=63743})(m)},o.treatGlyphAsBackgroundColor=function(m){return c(m)||(function(f){return 9472<=f&&f<=9631})(m)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(m,f,v=0){return(m-(2*Math.round(f)-v))%(2*Math.round(f))}},6052:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(m,f,v,w=!1){if(this.selectionStart=f,this.selectionEnd=v,!f||!v||f[0]===v[0]&&f[1]===v[1])return void this.clear();const A=m.buffers.active.ydisp,b=f[1]-A,y=v[1]-A,S=Math.max(b,0),_=Math.min(y,m.rows-1);S>=m.rows||_<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=b,this.viewportEndRow=y,this.viewportCappedStartRow=S,this.viewportCappedEndRow=_,this.startCol=f[0],this.endCol=v[0])}isCellSelected(m,f,v){return!!this.hasSelection&&(v-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&v>=this.viewportCappedStartRow&&f<this.endCol&&v<=this.viewportCappedEndRow:f<this.startCol&&v>=this.viewportCappedStartRow&&f>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&v===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportStartRow&&f>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,h=this.selectionEnd;return!(!c||!h)&&(c[1]>h[1]||c[1]===h[1]&&c[0]>h[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(d,o,c){var h=this&&this.__decorate||function(_,x,E,N){var T,j=arguments.length,R=j<3?x:N===null?N=Object.getOwnPropertyDescriptor(x,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(_,x,E,N);else for(var D=_.length-1;D>=0;D--)(T=_[D])&&(R=(j<3?T(R):j>3?T(x,E,R):T(x,E))||R);return j>3&&R&&Object.defineProperty(x,E,R),R},m=this&&this.__param||function(_,x){return function(E,N){x(E,N,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const f=c(2585),v=c(8460),w=c(844);let A=o.CharSizeService=class extends w.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(_,x,E){super(),this._optionsService=E,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new S(this._optionsService))}catch{this._measureStrategy=this.register(new y(_,x,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const _=this._measureStrategy.measure();_.width===this.width&&_.height===this.height||(this.width=_.width,this.height=_.height,this._onCharSizeChange.fire())}};o.CharSizeService=A=h([m(2,f.IOptionsService)],A);class b extends w.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(x,E){x!==void 0&&x>0&&E!==void 0&&E>0&&(this._result.width=x,this._result.height=E)}}class y extends b{constructor(x,E,N){super(),this._document=x,this._parentElement=E,this._optionsService=N,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class S extends b{constructor(x){super(),this._optionsService=x,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const E=this._ctx.measureText("W");if(!("width"in E&&"fontBoundingBoxAscent"in E&&"fontBoundingBoxDescent"in E))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const x=this._ctx.measureText("W");return this._validateAndSet(x.width,x.fontBoundingBoxAscent+x.fontBoundingBoxDescent),this._result}}},4269:function(d,o,c){var h=this&&this.__decorate||function(S,_,x,E){var N,T=arguments.length,j=T<3?_:E===null?E=Object.getOwnPropertyDescriptor(_,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(S,_,x,E);else for(var R=S.length-1;R>=0;R--)(N=S[R])&&(j=(T<3?N(j):T>3?N(_,x,j):N(_,x))||j);return T>3&&j&&Object.defineProperty(_,x,j),j},m=this&&this.__param||function(S,_){return function(x,E){_(x,E,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const f=c(3734),v=c(643),w=c(511),A=c(2585);class b extends f.AttributeData{constructor(_,x,E){super(),this.content=0,this.combinedData="",this.fg=_.fg,this.bg=_.bg,this.combinedData=x,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(_){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=b;let y=o.CharacterJoinerService=class C1{constructor(_){this._bufferService=_,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(_){const x={id:this._nextCharacterJoinerId++,handler:_};return this._characterJoiners.push(x),x.id}deregister(_){for(let x=0;x<this._characterJoiners.length;x++)if(this._characterJoiners[x].id===_)return this._characterJoiners.splice(x,1),!0;return!1}getJoinedCharacters(_){if(this._characterJoiners.length===0)return[];const x=this._bufferService.buffer.lines.get(_);if(!x||x.length===0)return[];const E=[],N=x.translateToString(!0);let T=0,j=0,R=0,D=x.getFg(0),L=x.getBg(0);for(let z=0;z<x.getTrimmedLength();z++)if(x.loadCell(z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==D||this._workCell.bg!==L){if(z-T>1){const U=this._getJoinedRanges(N,R,j,x,T);for(let P=0;P<U.length;P++)E.push(U[P])}T=z,R=j,D=this._workCell.fg,L=this._workCell.bg}j+=this._workCell.getChars().length||v.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-T>1){const z=this._getJoinedRanges(N,R,j,x,T);for(let U=0;U<z.length;U++)E.push(z[U])}return E}_getJoinedRanges(_,x,E,N,T){const j=_.substring(x,E);let R=[];try{R=this._characterJoiners[0].handler(j)}catch(D){console.error(D)}for(let D=1;D<this._characterJoiners.length;D++)try{const L=this._characterJoiners[D].handler(j);for(let z=0;z<L.length;z++)C1._mergeRanges(R,L[z])}catch(L){console.error(L)}return this._stringRangesToCellRanges(R,N,T),R}_stringRangesToCellRanges(_,x,E){let N=0,T=!1,j=0,R=_[N];if(R){for(let D=E;D<this._bufferService.cols;D++){const L=x.getWidth(D),z=x.getString(D).length||v.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!T&&R[0]<=j&&(R[0]=D,T=!0),R[1]<=j){if(R[1]=D,R=_[++N],!R)break;R[0]<=j?(R[0]=D,T=!0):T=!1}j+=z}}R&&(R[1]=this._bufferService.cols)}}static _mergeRanges(_,x){let E=!1;for(let N=0;N<_.length;N++){const T=_[N];if(E){if(x[1]<=T[0])return _[N-1][1]=x[1],_;if(x[1]<=T[1])return _[N-1][1]=Math.max(x[1],T[1]),_.splice(N,1),_;_.splice(N,1),N--}else{if(x[1]<=T[0])return _.splice(N,0,x),_;if(x[1]<=T[1])return T[0]=Math.min(x[0],T[0]),_;x[0]<T[1]&&(T[0]=Math.min(x[0],T[0]),E=!0)}}return E?_[_.length-1][1]=x[1]:_.push(x),_}};o.CharacterJoinerService=y=h([m(0,A.IBufferService)],y)},5114:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const h=c(844),m=c(8460),f=c(3656);class v extends h.Disposable{constructor(b,y,S){super(),this._textarea=b,this._window=y,this.mainDocument=S,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new w(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((_=>this._screenDprMonitor.setWindow(_)))),this.register((0,m.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(b){this._window!==b&&(this._window=b,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=v;class w extends h.Disposable{constructor(b){super(),this._parentWindow=b,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(b){this._parentWindow=b,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var b;this._outerListener&&((b=this._resolutionMediaMatchList)==null||b.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const h=c(844);class m extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(v){return this.linkProviders.push(v),{dispose:()=>{const w=this.linkProviders.indexOf(v);w!==-1&&this.linkProviders.splice(w,1)}}}}o.LinkProviderService=m},8934:function(d,o,c){var h=this&&this.__decorate||function(A,b,y,S){var _,x=arguments.length,E=x<3?b:S===null?S=Object.getOwnPropertyDescriptor(b,y):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(A,b,y,S);else for(var N=A.length-1;N>=0;N--)(_=A[N])&&(E=(x<3?_(E):x>3?_(b,y,E):_(b,y))||E);return x>3&&E&&Object.defineProperty(b,y,E),E},m=this&&this.__param||function(A,b){return function(y,S){b(y,S,A)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const f=c(4725),v=c(9806);let w=o.MouseService=class{constructor(A,b){this._renderService=A,this._charSizeService=b}getCoords(A,b,y,S,_){return(0,v.getCoords)(window,A,b,y,S,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,_)}getMouseReportCoords(A,b){const y=(0,v.getCoordsRelativeToElement)(window,A,b);if(this._charSizeService.hasValidSize)return y[0]=Math.min(Math.max(y[0],0),this._renderService.dimensions.css.canvas.width-1),y[1]=Math.min(Math.max(y[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(y[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(y[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(y[0]),y:Math.floor(y[1])}}};o.MouseService=w=h([m(0,f.IRenderService),m(1,f.ICharSizeService)],w)},3230:function(d,o,c){var h=this&&this.__decorate||function(_,x,E,N){var T,j=arguments.length,R=j<3?x:N===null?N=Object.getOwnPropertyDescriptor(x,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(_,x,E,N);else for(var D=_.length-1;D>=0;D--)(T=_[D])&&(R=(j<3?T(R):j>3?T(x,E,R):T(x,E))||R);return j>3&&R&&Object.defineProperty(x,E,R),R},m=this&&this.__param||function(_,x){return function(E,N){x(E,N,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const f=c(6193),v=c(4725),w=c(8460),A=c(844),b=c(7226),y=c(2585);let S=o.RenderService=class extends A.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(_,x,E,N,T,j,R,D){super(),this._rowCount=_,this._charSizeService=N,this._renderer=this.register(new A.MutableDisposable),this._pausedResizeTask=new b.DebouncedIdleTask,this._observerDisposable=this.register(new A.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new w.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new w.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new w.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((L,z)=>this._renderRows(L,z)),R),this.register(this._renderDebouncer),this.register(R.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(j.onResize((()=>this._fullRefresh()))),this.register(j.buffers.onBufferActivate((()=>{var L;return(L=this._renderer.value)==null?void 0:L.clear()}))),this.register(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(T.onDecorationRegistered((()=>this._fullRefresh()))),this.register(T.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(j.cols,j.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(j.buffer.y,j.buffer.y,!0)))),this.register(D.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(R.window,x),this.register(R.onWindowChange((L=>this._registerIntersectionObserver(L,x))))}_registerIntersectionObserver(_,x){if("IntersectionObserver"in _){const E=new _.IntersectionObserver((N=>this._handleIntersectionChange(N[N.length-1])),{threshold:0});E.observe(x),this._observerDisposable.value=(0,A.toDisposable)((()=>E.disconnect()))}}_handleIntersectionChange(_){this._isPaused=_.isIntersecting===void 0?_.intersectionRatio===0:!_.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(_,x,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(_,x,this._rowCount))}_renderRows(_,x){this._renderer.value&&(_=Math.min(_,this._rowCount-1),x=Math.min(x,this._rowCount-1),this._renderer.value.renderRows(_,x),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:_,end:x}),this._onRender.fire({start:_,end:x}),this._isNextRenderRedrawOnly=!0)}resize(_,x){this._rowCount=x,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(_){this._renderer.value=_,this._renderer.value&&(this._renderer.value.onRequestRedraw((x=>this.refreshRows(x.start,x.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(_){return this._renderDebouncer.addRefreshCallback(_)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var _,x;this._renderer.value&&((x=(_=this._renderer.value).clearTextureAtlas)==null||x.call(_),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(_,x){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var E;return(E=this._renderer.value)==null?void 0:E.handleResize(_,x)})):this._renderer.value.handleResize(_,x),this._fullRefresh())}handleCharSizeChanged(){var _;(_=this._renderer.value)==null||_.handleCharSizeChanged()}handleBlur(){var _;(_=this._renderer.value)==null||_.handleBlur()}handleFocus(){var _;(_=this._renderer.value)==null||_.handleFocus()}handleSelectionChanged(_,x,E){var N;this._selectionState.start=_,this._selectionState.end=x,this._selectionState.columnSelectMode=E,(N=this._renderer.value)==null||N.handleSelectionChanged(_,x,E)}handleCursorMove(){var _;(_=this._renderer.value)==null||_.handleCursorMove()}clear(){var _;(_=this._renderer.value)==null||_.clear()}};o.RenderService=S=h([m(2,y.IOptionsService),m(3,v.ICharSizeService),m(4,y.IDecorationService),m(5,y.IBufferService),m(6,v.ICoreBrowserService),m(7,v.IThemeService)],S)},9312:function(d,o,c){var h=this&&this.__decorate||function(R,D,L,z){var U,P=arguments.length,G=P<3?D:z===null?z=Object.getOwnPropertyDescriptor(D,L):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(R,D,L,z);else for(var K=R.length-1;K>=0;K--)(U=R[K])&&(G=(P<3?U(G):P>3?U(D,L,G):U(D,L))||G);return P>3&&G&&Object.defineProperty(D,L,G),G},m=this&&this.__param||function(R,D){return function(L,z){D(L,z,R)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const f=c(9806),v=c(9504),w=c(456),A=c(4725),b=c(8460),y=c(844),S=c(6114),_=c(4841),x=c(511),E=c(2585),N=" ",T=new RegExp(N,"g");let j=o.SelectionService=class extends y.Disposable{constructor(R,D,L,z,U,P,G,K,W){super(),this._element=R,this._screenElement=D,this._linkifier=L,this._bufferService=z,this._coreService=U,this._mouseService=P,this._optionsService=G,this._renderService=K,this._coreBrowserService=W,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new x.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new b.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new b.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new b.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Y=>this._handleMouseMove(Y),this._mouseUpListener=Y=>this._handleMouseUp(Y),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Y=>this._handleTrim(Y))),this.register(this._bufferService.buffers.onBufferActivate((Y=>this._handleBufferActivate(Y)))),this.enable(),this._model=new w.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,y.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const R=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;return!(!R||!D||R[0]===D[0]&&R[1]===D[1])}get selectionText(){const R=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;if(!R||!D)return"";const L=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(R[0]===D[0])return"";const U=R[0]<D[0]?R[0]:D[0],P=R[0]<D[0]?D[0]:R[0];for(let G=R[1];G<=D[1];G++){const K=L.translateBufferLineToString(G,!0,U,P);z.push(K)}}else{const U=R[1]===D[1]?D[0]:void 0;z.push(L.translateBufferLineToString(R[1],!0,R[0],U));for(let P=R[1]+1;P<=D[1]-1;P++){const G=L.lines.get(P),K=L.translateBufferLineToString(P,!0);G!=null&&G.isWrapped?z[z.length-1]+=K:z.push(K)}if(R[1]!==D[1]){const P=L.lines.get(D[1]),G=L.translateBufferLineToString(D[1],!0,0,D[0]);P&&P.isWrapped?z[z.length-1]+=G:z.push(G)}}return z.map((U=>U.replace(T," "))).join(S.isWindows?`\r
|
|
381
|
+
`:`
|
|
382
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(R){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),S.isLinux&&R&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(R){const D=this._getMouseBufferCoords(R),L=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(L&&z&&D)&&this._areCoordsInSelection(D,L,z)}isCellInSelection(R,D){const L=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!L||!z)&&this._areCoordsInSelection([R,D],L,z)}_areCoordsInSelection(R,D,L){return R[1]>D[1]&&R[1]<L[1]||D[1]===L[1]&&R[1]===D[1]&&R[0]>=D[0]&&R[0]<L[0]||D[1]<L[1]&&R[1]===L[1]&&R[0]<L[0]||D[1]<L[1]&&R[1]===D[1]&&R[0]>=D[0]}_selectWordAtCursor(R,D){var U,P;const L=(P=(U=this._linkifier.currentLink)==null?void 0:U.link)==null?void 0:P.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,_.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const z=this._getMouseBufferCoords(R);return!!z&&(this._selectWordAt(z,D),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(R,D){this._model.clearSelection(),R=Math.max(R,0),D=Math.min(D,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,R],this._model.selectionEnd=[this._bufferService.cols,D],this.refresh(),this._onSelectionChange.fire()}_handleTrim(R){this._model.handleTrim(R)&&this.refresh()}_getMouseBufferCoords(R){const D=this._mouseService.getCoords(R,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(D)return D[0]--,D[1]--,D[1]+=this._bufferService.buffer.ydisp,D}_getMouseEventScrollAmount(R){let D=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,R,this._screenElement)[1];const L=this._renderService.dimensions.css.canvas.height;return D>=0&&D<=L?0:(D>L&&(D-=L),D=Math.min(Math.max(D,-50),50),D/=50,D/Math.abs(D)+Math.round(14*D))}shouldForceSelection(R){return S.isMac?R.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:R.shiftKey}handleMouseDown(R){if(this._mouseDownTimeStamp=R.timeStamp,(R.button!==2||!this.hasSelection)&&R.button===0){if(!this._enabled){if(!this.shouldForceSelection(R))return;R.stopPropagation()}R.preventDefault(),this._dragScrollAmount=0,this._enabled&&R.shiftKey?this._handleIncrementalClick(R):R.detail===1?this._handleSingleClick(R):R.detail===2?this._handleDoubleClick(R):R.detail===3&&this._handleTripleClick(R),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(R){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(R))}_handleSingleClick(R){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(R)?3:0,this._model.selectionStart=this._getMouseBufferCoords(R),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const D=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);D&&D.length!==this._model.selectionStart[0]&&D.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(R){this._selectWordAtCursor(R,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(R){const D=this._getMouseBufferCoords(R);D&&(this._activeSelectionMode=2,this._selectLineAt(D[1]))}shouldColumnSelect(R){return R.altKey&&!(S.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(R){if(R.stopImmediatePropagation(),!this._model.selectionStart)return;const D=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(R),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(R),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const L=this._bufferService.buffer;if(this._model.selectionEnd[1]<L.lines.length){const z=L.lines.get(this._model.selectionEnd[1]);z&&z.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}D&&D[0]===this._model.selectionEnd[0]&&D[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const R=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(R.ydisp+this._bufferService.rows,R.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=R.ydisp),this.refresh()}}_handleMouseUp(R){const D=R.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&D<500&&R.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const L=this._mouseService.getCoords(R,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(L&&L[0]!==void 0&&L[1]!==void 0){const z=(0,v.moveToCellSequence)(L[0]-1,L[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const R=this._model.finalSelectionStart,D=this._model.finalSelectionEnd,L=!(!R||!D||R[0]===D[0]&&R[1]===D[1]);L?R&&D&&(this._oldSelectionStart&&this._oldSelectionEnd&&R[0]===this._oldSelectionStart[0]&&R[1]===this._oldSelectionStart[1]&&D[0]===this._oldSelectionEnd[0]&&D[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(R,D,L)):this._oldHasSelection&&this._fireOnSelectionChange(R,D,L)}_fireOnSelectionChange(R,D,L){this._oldSelectionStart=R,this._oldSelectionEnd=D,this._oldHasSelection=L,this._onSelectionChange.fire()}_handleBufferActivate(R){this.clearSelection(),this._trimListener.dispose(),this._trimListener=R.activeBuffer.lines.onTrim((D=>this._handleTrim(D)))}_convertViewportColToCharacterIndex(R,D){let L=D;for(let z=0;D>=z;z++){const U=R.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?L--:U>1&&D!==z&&(L+=U-1)}return L}setSelection(R,D,L){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[R,D],this._model.selectionStartLength=L,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(R){this._isClickInSelection(R)||(this._selectWordAtCursor(R,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(R,D,L=!0,z=!0){if(R[0]>=this._bufferService.cols)return;const U=this._bufferService.buffer,P=U.lines.get(R[1]);if(!P)return;const G=U.translateBufferLineToString(R[1],!1);let K=this._convertViewportColToCharacterIndex(P,R[0]),W=K;const Y=R[0]-K;let ne=0,F=0,B=0,O=0;if(G.charAt(K)===" "){for(;K>0&&G.charAt(K-1)===" ";)K--;for(;W<G.length&&G.charAt(W+1)===" ";)W++}else{let J=R[0],de=R[0];P.getWidth(J)===0&&(ne++,J--),P.getWidth(de)===2&&(F++,de++);const pe=P.getString(de).length;for(pe>1&&(O+=pe-1,W+=pe-1);J>0&&K>0&&!this._isCharWordSeparator(P.loadCell(J-1,this._workCell));){P.loadCell(J-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(ne++,J--):X>1&&(B+=X-1,K-=X-1),K--,J--}for(;de<P.length&&W+1<G.length&&!this._isCharWordSeparator(P.loadCell(de+1,this._workCell));){P.loadCell(de+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(F++,de++):X>1&&(O+=X-1,W+=X-1),W++,de++}}W++;let Q=K+Y-ne+B,M=Math.min(this._bufferService.cols,W-K+ne+F-B-O);if(D||G.slice(K,W).trim()!==""){if(L&&Q===0&&P.getCodePoint(0)!==32){const J=U.lines.get(R[1]-1);if(J&&P.isWrapped&&J.getCodePoint(this._bufferService.cols-1)!==32){const de=this._getWordAt([this._bufferService.cols-1,R[1]-1],!1,!0,!1);if(de){const pe=this._bufferService.cols-de.start;Q-=pe,M+=pe}}}if(z&&Q+M===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const J=U.lines.get(R[1]+1);if(J!=null&&J.isWrapped&&J.getCodePoint(0)!==32){const de=this._getWordAt([0,R[1]+1],!1,!1,!0);de&&(M+=de.length)}}return{start:Q,length:M}}}_selectWordAt(R,D){const L=this._getWordAt(R,D);if(L){for(;L.start<0;)L.start+=this._bufferService.cols,R[1]--;this._model.selectionStart=[L.start,R[1]],this._model.selectionStartLength=L.length}}_selectToWordAt(R){const D=this._getWordAt(R,!0);if(D){let L=R[1];for(;D.start<0;)D.start+=this._bufferService.cols,L--;if(!this._model.areSelectionValuesReversed())for(;D.start+D.length>this._bufferService.cols;)D.length-=this._bufferService.cols,L++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?D.start:D.start+D.length,L]}}_isCharWordSeparator(R){return R.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(R.getChars())>=0}_selectLineAt(R){const D=this._bufferService.buffer.getWrappedRangeForLine(R),L={start:{x:0,y:D.first},end:{x:this._bufferService.cols-1,y:D.last}};this._model.selectionStart=[0,D.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,_.getRangeLength)(L,this._bufferService.cols)}};o.SelectionService=j=h([m(3,E.IBufferService),m(4,E.ICoreService),m(5,A.IMouseService),m(6,E.IOptionsService),m(7,A.IRenderService),m(8,A.ICoreBrowserService)],j)},4725:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const h=c(8343);o.ICharSizeService=(0,h.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),o.IMouseService=(0,h.createDecorator)("MouseService"),o.IRenderService=(0,h.createDecorator)("RenderService"),o.ISelectionService=(0,h.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,h.createDecorator)("ThemeService"),o.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(d,o,c){var h=this&&this.__decorate||function(j,R,D,L){var z,U=arguments.length,P=U<3?R:L===null?L=Object.getOwnPropertyDescriptor(R,D):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(j,R,D,L);else for(var G=j.length-1;G>=0;G--)(z=j[G])&&(P=(U<3?z(P):U>3?z(R,D,P):z(R,D))||P);return U>3&&P&&Object.defineProperty(R,D,P),P},m=this&&this.__param||function(j,R){return function(D,L){R(D,L,j)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const f=c(7239),v=c(8055),w=c(8460),A=c(844),b=c(2585),y=v.css.toColor("#ffffff"),S=v.css.toColor("#000000"),_=v.css.toColor("#ffffff"),x=v.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const j=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],R=[0,95,135,175,215,255];for(let D=0;D<216;D++){const L=R[D/36%6|0],z=R[D/6%6|0],U=R[D%6];j.push({css:v.channels.toCss(L,z,U),rgba:v.channels.toRgba(L,z,U)})}for(let D=0;D<24;D++){const L=8+10*D;j.push({css:v.channels.toCss(L,L,L),rgba:v.channels.toRgba(L,L,L)})}return j})());let N=o.ThemeService=class extends A.Disposable{get colors(){return this._colors}constructor(j){super(),this._optionsService=j,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:y,background:S,cursor:_,cursorAccent:x,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:v.color.blend(S,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:v.color.blend(S,E),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(j={}){const R=this._colors;if(R.foreground=T(j.foreground,y),R.background=T(j.background,S),R.cursor=T(j.cursor,_),R.cursorAccent=T(j.cursorAccent,x),R.selectionBackgroundTransparent=T(j.selectionBackground,E),R.selectionBackgroundOpaque=v.color.blend(R.background,R.selectionBackgroundTransparent),R.selectionInactiveBackgroundTransparent=T(j.selectionInactiveBackground,R.selectionBackgroundTransparent),R.selectionInactiveBackgroundOpaque=v.color.blend(R.background,R.selectionInactiveBackgroundTransparent),R.selectionForeground=j.selectionForeground?T(j.selectionForeground,v.NULL_COLOR):void 0,R.selectionForeground===v.NULL_COLOR&&(R.selectionForeground=void 0),v.color.isOpaque(R.selectionBackgroundTransparent)&&(R.selectionBackgroundTransparent=v.color.opacity(R.selectionBackgroundTransparent,.3)),v.color.isOpaque(R.selectionInactiveBackgroundTransparent)&&(R.selectionInactiveBackgroundTransparent=v.color.opacity(R.selectionInactiveBackgroundTransparent,.3)),R.ansi=o.DEFAULT_ANSI_COLORS.slice(),R.ansi[0]=T(j.black,o.DEFAULT_ANSI_COLORS[0]),R.ansi[1]=T(j.red,o.DEFAULT_ANSI_COLORS[1]),R.ansi[2]=T(j.green,o.DEFAULT_ANSI_COLORS[2]),R.ansi[3]=T(j.yellow,o.DEFAULT_ANSI_COLORS[3]),R.ansi[4]=T(j.blue,o.DEFAULT_ANSI_COLORS[4]),R.ansi[5]=T(j.magenta,o.DEFAULT_ANSI_COLORS[5]),R.ansi[6]=T(j.cyan,o.DEFAULT_ANSI_COLORS[6]),R.ansi[7]=T(j.white,o.DEFAULT_ANSI_COLORS[7]),R.ansi[8]=T(j.brightBlack,o.DEFAULT_ANSI_COLORS[8]),R.ansi[9]=T(j.brightRed,o.DEFAULT_ANSI_COLORS[9]),R.ansi[10]=T(j.brightGreen,o.DEFAULT_ANSI_COLORS[10]),R.ansi[11]=T(j.brightYellow,o.DEFAULT_ANSI_COLORS[11]),R.ansi[12]=T(j.brightBlue,o.DEFAULT_ANSI_COLORS[12]),R.ansi[13]=T(j.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),R.ansi[14]=T(j.brightCyan,o.DEFAULT_ANSI_COLORS[14]),R.ansi[15]=T(j.brightWhite,o.DEFAULT_ANSI_COLORS[15]),j.extendedAnsi){const D=Math.min(R.ansi.length-16,j.extendedAnsi.length);for(let L=0;L<D;L++)R.ansi[L+16]=T(j.extendedAnsi[L],o.DEFAULT_ANSI_COLORS[L+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(j){this._restoreColor(j),this._onChangeColors.fire(this.colors)}_restoreColor(j){if(j!==void 0)switch(j){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[j]=this._restoreColors.ansi[j]}else for(let R=0;R<this._restoreColors.ansi.length;++R)this._colors.ansi[R]=this._restoreColors.ansi[R]}modifyColors(j){j(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function T(j,R){if(j!==void 0)try{return v.css.toColor(j)}catch{}return R}o.ThemeService=N=h([m(0,b.IOptionsService)],N)},6349:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const h=c(8460),m=c(844);class f extends m.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(w){if(this._maxLength===w)return;const A=new Array(w);for(let b=0;b<Math.min(w,this.length);b++)A[b]=this._array[this._getCyclicIndex(b)];this._array=A,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let A=this._length;A<w;A++)this._array[A]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,A){this._array[this._getCyclicIndex(w)]=A}push(w){this._array[this._getCyclicIndex(this._length)]=w,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(w,A,...b){if(A){for(let y=w;y<this._length-A;y++)this._array[this._getCyclicIndex(y)]=this._array[this._getCyclicIndex(y+A)];this._length-=A,this.onDeleteEmitter.fire({index:w,amount:A})}for(let y=this._length-1;y>=w;y--)this._array[this._getCyclicIndex(y+b.length)]=this._array[this._getCyclicIndex(y)];for(let y=0;y<b.length;y++)this._array[this._getCyclicIndex(w+y)]=b[y];if(b.length&&this.onInsertEmitter.fire({index:w,amount:b.length}),this._length+b.length>this._maxLength){const y=this._length+b.length-this._maxLength;this._startIndex+=y,this._length=this._maxLength,this.onTrimEmitter.fire(y)}else this._length+=b.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,A,b){if(!(A<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+b<0)throw new Error("Cannot shift elements in list beyond index 0");if(b>0){for(let S=A-1;S>=0;S--)this.set(w+S+b,this.get(w+S));const y=w+A+b-this._length;if(y>0)for(this._length+=y;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let y=0;y<A;y++)this.set(w+y+b,this.get(w+y))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}o.CircularList=f},1439:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(h,m=5){if(typeof h!="object")return h;const f=Array.isArray(h)?[]:{};for(const v in h)f[v]=m<=1?h[v]:h[v]&&c(h[v],m-1);return f}},8055:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,h=0,m=0,f=0;var v,w,A,b,y;function S(x){const E=x.toString(16);return E.length<2?"0"+E:E}function _(x,E){return x<E?(E+.05)/(x+.05):(x+.05)/(E+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(x){x.toCss=function(E,N,T,j){return j!==void 0?`#${S(E)}${S(N)}${S(T)}${S(j)}`:`#${S(E)}${S(N)}${S(T)}`},x.toRgba=function(E,N,T,j=255){return(E<<24|N<<16|T<<8|j)>>>0},x.toColor=function(E,N,T,j){return{css:x.toCss(E,N,T,j),rgba:x.toRgba(E,N,T,j)}}})(v||(o.channels=v={})),(function(x){function E(N,T){return f=Math.round(255*T),[c,h,m]=y.toChannels(N.rgba),{css:v.toCss(c,h,m,f),rgba:v.toRgba(c,h,m,f)}}x.blend=function(N,T){if(f=(255&T.rgba)/255,f===1)return{css:T.css,rgba:T.rgba};const j=T.rgba>>24&255,R=T.rgba>>16&255,D=T.rgba>>8&255,L=N.rgba>>24&255,z=N.rgba>>16&255,U=N.rgba>>8&255;return c=L+Math.round((j-L)*f),h=z+Math.round((R-z)*f),m=U+Math.round((D-U)*f),{css:v.toCss(c,h,m),rgba:v.toRgba(c,h,m)}},x.isOpaque=function(N){return(255&N.rgba)==255},x.ensureContrastRatio=function(N,T,j){const R=y.ensureContrastRatio(N.rgba,T.rgba,j);if(R)return v.toColor(R>>24&255,R>>16&255,R>>8&255)},x.opaque=function(N){const T=(255|N.rgba)>>>0;return[c,h,m]=y.toChannels(T),{css:v.toCss(c,h,m),rgba:T}},x.opacity=E,x.multiplyOpacity=function(N,T){return f=255&N.rgba,E(N,f*T/255)},x.toColorRGB=function(N){return[N.rgba>>24&255,N.rgba>>16&255,N.rgba>>8&255]}})(w||(o.color=w={})),(function(x){let E,N;try{const T=document.createElement("canvas");T.width=1,T.height=1;const j=T.getContext("2d",{willReadFrequently:!0});j&&(E=j,E.globalCompositeOperation="copy",N=E.createLinearGradient(0,0,1,1))}catch{}x.toColor=function(T){if(T.match(/#[\da-f]{3,8}/i))switch(T.length){case 4:return c=parseInt(T.slice(1,2).repeat(2),16),h=parseInt(T.slice(2,3).repeat(2),16),m=parseInt(T.slice(3,4).repeat(2),16),v.toColor(c,h,m);case 5:return c=parseInt(T.slice(1,2).repeat(2),16),h=parseInt(T.slice(2,3).repeat(2),16),m=parseInt(T.slice(3,4).repeat(2),16),f=parseInt(T.slice(4,5).repeat(2),16),v.toColor(c,h,m,f);case 7:return{css:T,rgba:(parseInt(T.slice(1),16)<<8|255)>>>0};case 9:return{css:T,rgba:parseInt(T.slice(1),16)>>>0}}const j=T.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(j)return c=parseInt(j[1]),h=parseInt(j[2]),m=parseInt(j[3]),f=Math.round(255*(j[5]===void 0?1:parseFloat(j[5]))),v.toColor(c,h,m,f);if(!E||!N)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=N,E.fillStyle=T,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[c,h,m,f]=E.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:v.toRgba(c,h,m,f),css:T}}})(A||(o.css=A={})),(function(x){function E(N,T,j){const R=N/255,D=T/255,L=j/255;return .2126*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.7152*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}x.relativeLuminance=function(N){return E(N>>16&255,N>>8&255,255&N)},x.relativeLuminance2=E})(b||(o.rgb=b={})),(function(x){function E(T,j,R){const D=T>>24&255,L=T>>16&255,z=T>>8&255;let U=j>>24&255,P=j>>16&255,G=j>>8&255,K=_(b.relativeLuminance2(U,P,G),b.relativeLuminance2(D,L,z));for(;K<R&&(U>0||P>0||G>0);)U-=Math.max(0,Math.ceil(.1*U)),P-=Math.max(0,Math.ceil(.1*P)),G-=Math.max(0,Math.ceil(.1*G)),K=_(b.relativeLuminance2(U,P,G),b.relativeLuminance2(D,L,z));return(U<<24|P<<16|G<<8|255)>>>0}function N(T,j,R){const D=T>>24&255,L=T>>16&255,z=T>>8&255;let U=j>>24&255,P=j>>16&255,G=j>>8&255,K=_(b.relativeLuminance2(U,P,G),b.relativeLuminance2(D,L,z));for(;K<R&&(U<255||P<255||G<255);)U=Math.min(255,U+Math.ceil(.1*(255-U))),P=Math.min(255,P+Math.ceil(.1*(255-P))),G=Math.min(255,G+Math.ceil(.1*(255-G))),K=_(b.relativeLuminance2(U,P,G),b.relativeLuminance2(D,L,z));return(U<<24|P<<16|G<<8|255)>>>0}x.blend=function(T,j){if(f=(255&j)/255,f===1)return j;const R=j>>24&255,D=j>>16&255,L=j>>8&255,z=T>>24&255,U=T>>16&255,P=T>>8&255;return c=z+Math.round((R-z)*f),h=U+Math.round((D-U)*f),m=P+Math.round((L-P)*f),v.toRgba(c,h,m)},x.ensureContrastRatio=function(T,j,R){const D=b.relativeLuminance(T>>8),L=b.relativeLuminance(j>>8);if(_(D,L)<R){if(L<D){const P=E(T,j,R),G=_(D,b.relativeLuminance(P>>8));if(G<R){const K=N(T,j,R);return G>_(D,b.relativeLuminance(K>>8))?P:K}return P}const z=N(T,j,R),U=_(D,b.relativeLuminance(z>>8));if(U<R){const P=E(T,j,R);return U>_(D,b.relativeLuminance(P>>8))?z:P}return z}},x.reduceLuminance=E,x.increaseLuminance=N,x.toChannels=function(T){return[T>>24&255,T>>16&255,T>>8&255,255&T]}})(y||(o.rgba=y={})),o.toPaddedHex=S,o.contrastRatio=_},8969:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const h=c(844),m=c(2585),f=c(4348),v=c(7866),w=c(744),A=c(7302),b=c(6975),y=c(8460),S=c(1753),_=c(1480),x=c(7994),E=c(9282),N=c(5435),T=c(5981),j=c(2660);let R=!1;class D extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new y.EventEmitter),this._onScroll.event((z=>{var U;(U=this._onScrollApi)==null||U.fire(z.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(z){for(const U in z)this.optionsService.options[U]=z[U]}constructor(z){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new y.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new y.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new y.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new A.OptionsService(z)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(b.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(S.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(_.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(x.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(j.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new N.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,y.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,y.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,y.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,y.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((U=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((U=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new T.WriteBuffer(((U,P)=>this._inputHandler.parse(U,P)))),this.register((0,y.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(z,U){this._writeBuffer.write(z,U)}writeSync(z,U){this._logService.logLevel<=m.LogLevelEnum.WARN&&!R&&(this._logService.warn("writeSync is unreliable and will be removed soon."),R=!0),this._writeBuffer.writeSync(z,U)}input(z,U=!0){this.coreService.triggerDataEvent(z,U)}resize(z,U){isNaN(z)||isNaN(U)||(z=Math.max(z,w.MINIMUM_COLS),U=Math.max(U,w.MINIMUM_ROWS),this._bufferService.resize(z,U))}scroll(z,U=!1){this._bufferService.scroll(z,U)}scrollLines(z,U,P){this._bufferService.scrollLines(z,U,P)}scrollPages(z){this.scrollLines(z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(z){const U=z-this._bufferService.buffer.ydisp;U!==0&&this.scrollLines(U)}registerEscHandler(z,U){return this._inputHandler.registerEscHandler(z,U)}registerDcsHandler(z,U){return this._inputHandler.registerDcsHandler(z,U)}registerCsiHandler(z,U){return this._inputHandler.registerCsiHandler(z,U)}registerOscHandler(z,U){return this._inputHandler.registerOscHandler(z,U)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let z=!1;const U=this.optionsService.rawOptions.windowsPty;U&&U.buildNumber!==void 0&&U.buildNumber!==void 0?z=U.backend==="conpty"&&U.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(z=!0),z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const z=[];z.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),z.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const U of z)U.dispose()}))}}}o.CoreTerminal=D},8460:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const m=[];for(let f=0;f<this._listeners.length;f++)m.push(this._listeners[f]);for(let f=0;f<m.length;f++)m[f].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,h){return c((m=>h.fire(m)))},o.runAndSubscribe=function(c,h){return h(void 0),c((m=>h(m)))}},5435:function(d,o,c){var h=this&&this.__decorate||function(ne,F,B,O){var Q,M=arguments.length,J=M<3?F:O===null?O=Object.getOwnPropertyDescriptor(F,B):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(ne,F,B,O);else for(var de=ne.length-1;de>=0;de--)(Q=ne[de])&&(J=(M<3?Q(J):M>3?Q(F,B,J):Q(F,B))||J);return M>3&&J&&Object.defineProperty(F,B,J),J},m=this&&this.__param||function(ne,F){return function(B,O){F(B,O,ne)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const f=c(2584),v=c(7116),w=c(2015),A=c(844),b=c(482),y=c(8437),S=c(8460),_=c(643),x=c(511),E=c(3734),N=c(2585),T=c(1480),j=c(6242),R=c(6351),D=c(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},z=131072;function U(ne,F){if(ne>24)return F.setWinLines||!1;switch(ne){case 1:return!!F.restoreWin;case 2:return!!F.minimizeWin;case 3:return!!F.setWinPosition;case 4:return!!F.setWinSizePixels;case 5:return!!F.raiseWin;case 6:return!!F.lowerWin;case 7:return!!F.refreshWin;case 8:return!!F.setWinSizeChars;case 9:return!!F.maximizeWin;case 10:return!!F.fullscreenWin;case 11:return!!F.getWinState;case 13:return!!F.getWinPosition;case 14:return!!F.getWinSizePixels;case 15:return!!F.getScreenSizePixels;case 16:return!!F.getCellSizePixels;case 18:return!!F.getWinSizeChars;case 19:return!!F.getScreenSizeChars;case 20:return!!F.getIconTitle;case 21:return!!F.getWinTitle;case 22:return!!F.pushTitle;case 23:return!!F.popTitle;case 24:return!!F.setWinLines}return!1}var P;(function(ne){ne[ne.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ne[ne.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(o.WindowsOptionsReportType=P={}));let G=0;class K extends A.Disposable{getAttrData(){return this._curAttrData}constructor(F,B,O,Q,M,J,de,pe,X=new w.EscapeSequenceParser){super(),this._bufferService=F,this._charsetService=B,this._coreService=O,this._logService=Q,this._optionsService=M,this._oscLinkService=J,this._coreMouseService=de,this._unicodeService=pe,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new b.StringToUtf32,this._utf8Decoder=new b.Utf8ToUtf32,this._workCell=new x.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new S.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new S.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new S.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new S.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new S.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new S.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new S.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new S.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new S.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new S.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new S.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new S.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new S.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new W(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(($=>this._activeBuffer=$.activeBuffer))),this._parser.setCsiHandlerFallback((($,se)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString($),params:se.toArray()})})),this._parser.setEscHandlerFallback(($=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString($)})})),this._parser.setExecuteHandlerFallback(($=>{this._logService.debug("Unknown EXECUTE code: ",{code:$})})),this._parser.setOscHandlerFallback((($,se,le)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:se,data:le})})),this._parser.setDcsHandlerFallback((($,se,le)=>{se==="HOOK"&&(le=le.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:se,payload:le})})),this._parser.setPrintHandler((($,se,le)=>this.print($,se,le))),this._parser.registerCsiHandler({final:"@"},($=>this.insertChars($))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},($=>this.scrollLeft($))),this._parser.registerCsiHandler({final:"A"},($=>this.cursorUp($))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},($=>this.scrollRight($))),this._parser.registerCsiHandler({final:"B"},($=>this.cursorDown($))),this._parser.registerCsiHandler({final:"C"},($=>this.cursorForward($))),this._parser.registerCsiHandler({final:"D"},($=>this.cursorBackward($))),this._parser.registerCsiHandler({final:"E"},($=>this.cursorNextLine($))),this._parser.registerCsiHandler({final:"F"},($=>this.cursorPrecedingLine($))),this._parser.registerCsiHandler({final:"G"},($=>this.cursorCharAbsolute($))),this._parser.registerCsiHandler({final:"H"},($=>this.cursorPosition($))),this._parser.registerCsiHandler({final:"I"},($=>this.cursorForwardTab($))),this._parser.registerCsiHandler({final:"J"},($=>this.eraseInDisplay($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},($=>this.eraseInDisplay($,!0))),this._parser.registerCsiHandler({final:"K"},($=>this.eraseInLine($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},($=>this.eraseInLine($,!0))),this._parser.registerCsiHandler({final:"L"},($=>this.insertLines($))),this._parser.registerCsiHandler({final:"M"},($=>this.deleteLines($))),this._parser.registerCsiHandler({final:"P"},($=>this.deleteChars($))),this._parser.registerCsiHandler({final:"S"},($=>this.scrollUp($))),this._parser.registerCsiHandler({final:"T"},($=>this.scrollDown($))),this._parser.registerCsiHandler({final:"X"},($=>this.eraseChars($))),this._parser.registerCsiHandler({final:"Z"},($=>this.cursorBackwardTab($))),this._parser.registerCsiHandler({final:"`"},($=>this.charPosAbsolute($))),this._parser.registerCsiHandler({final:"a"},($=>this.hPositionRelative($))),this._parser.registerCsiHandler({final:"b"},($=>this.repeatPrecedingCharacter($))),this._parser.registerCsiHandler({final:"c"},($=>this.sendDeviceAttributesPrimary($))),this._parser.registerCsiHandler({prefix:">",final:"c"},($=>this.sendDeviceAttributesSecondary($))),this._parser.registerCsiHandler({final:"d"},($=>this.linePosAbsolute($))),this._parser.registerCsiHandler({final:"e"},($=>this.vPositionRelative($))),this._parser.registerCsiHandler({final:"f"},($=>this.hVPosition($))),this._parser.registerCsiHandler({final:"g"},($=>this.tabClear($))),this._parser.registerCsiHandler({final:"h"},($=>this.setMode($))),this._parser.registerCsiHandler({prefix:"?",final:"h"},($=>this.setModePrivate($))),this._parser.registerCsiHandler({final:"l"},($=>this.resetMode($))),this._parser.registerCsiHandler({prefix:"?",final:"l"},($=>this.resetModePrivate($))),this._parser.registerCsiHandler({final:"m"},($=>this.charAttributes($))),this._parser.registerCsiHandler({final:"n"},($=>this.deviceStatus($))),this._parser.registerCsiHandler({prefix:"?",final:"n"},($=>this.deviceStatusPrivate($))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},($=>this.softReset($))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},($=>this.setCursorStyle($))),this._parser.registerCsiHandler({final:"r"},($=>this.setScrollRegion($))),this._parser.registerCsiHandler({final:"s"},($=>this.saveCursor($))),this._parser.registerCsiHandler({final:"t"},($=>this.windowOptions($))),this._parser.registerCsiHandler({final:"u"},($=>this.restoreCursor($))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},($=>this.insertColumns($))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},($=>this.deleteColumns($))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},($=>this.selectProtected($))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},($=>this.requestMode($,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},($=>this.requestMode($,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new j.OscHandler(($=>(this.setTitle($),this.setIconName($),!0)))),this._parser.registerOscHandler(1,new j.OscHandler(($=>this.setIconName($)))),this._parser.registerOscHandler(2,new j.OscHandler(($=>this.setTitle($)))),this._parser.registerOscHandler(4,new j.OscHandler(($=>this.setOrReportIndexedColor($)))),this._parser.registerOscHandler(8,new j.OscHandler(($=>this.setHyperlink($)))),this._parser.registerOscHandler(10,new j.OscHandler(($=>this.setOrReportFgColor($)))),this._parser.registerOscHandler(11,new j.OscHandler(($=>this.setOrReportBgColor($)))),this._parser.registerOscHandler(12,new j.OscHandler(($=>this.setOrReportCursorColor($)))),this._parser.registerOscHandler(104,new j.OscHandler(($=>this.restoreIndexedColor($)))),this._parser.registerOscHandler(110,new j.OscHandler(($=>this.restoreFgColor($)))),this._parser.registerOscHandler(111,new j.OscHandler(($=>this.restoreBgColor($)))),this._parser.registerOscHandler(112,new j.OscHandler(($=>this.restoreCursorColor($)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const $ in v.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:$},(()=>this.selectCharset("("+$))),this._parser.registerEscHandler({intermediates:")",final:$},(()=>this.selectCharset(")"+$))),this._parser.registerEscHandler({intermediates:"*",final:$},(()=>this.selectCharset("*"+$))),this._parser.registerEscHandler({intermediates:"+",final:$},(()=>this.selectCharset("+"+$))),this._parser.registerEscHandler({intermediates:"-",final:$},(()=>this.selectCharset("-"+$))),this._parser.registerEscHandler({intermediates:".",final:$},(()=>this.selectCharset("."+$))),this._parser.registerEscHandler({intermediates:"/",final:$},(()=>this.selectCharset("/"+$)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler(($=>(this._logService.error("Parsing error: ",$),$))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new R.DcsHandler((($,se)=>this.requestStatusString($,se))))}_preserveStack(F,B,O,Q){this._parseStack.paused=!0,this._parseStack.cursorStartX=F,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=O,this._parseStack.position=Q}_logSlowResolvingAsync(F){this._logService.logLevel<=N.LogLevelEnum.WARN&&Promise.race([F,new Promise(((B,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(F,B){let O,Q=this._activeBuffer.x,M=this._activeBuffer.y,J=0;const de=this._parseStack.paused;if(de){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(O),O;Q=this._parseStack.cursorStartX,M=this._parseStack.cursorStartY,this._parseStack.paused=!1,F.length>z&&(J=this._parseStack.position+z)}if(this._logService.logLevel<=N.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof F=="string"?` "${F}"`:` "${Array.prototype.map.call(F,($=>String.fromCharCode($))).join("")}"`),typeof F=="string"?F.split("").map(($=>$.charCodeAt(0))):F),this._parseBuffer.length<F.length&&this._parseBuffer.length<z&&(this._parseBuffer=new Uint32Array(Math.min(F.length,z))),de||this._dirtyRowTracker.clearRange(),F.length>z)for(let $=J;$<F.length;$+=z){const se=$+z<F.length?$+z:F.length,le=typeof F=="string"?this._stringDecoder.decode(F.substring($,se),this._parseBuffer):this._utf8Decoder.decode(F.subarray($,se),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,le))return this._preserveStack(Q,M,le,$),this._logSlowResolvingAsync(O),O}else if(!de){const $=typeof F=="string"?this._stringDecoder.decode(F,this._parseBuffer):this._utf8Decoder.decode(F,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,$))return this._preserveStack(Q,M,$,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===Q&&this._activeBuffer.y===M||this._onCursorMove.fire();const pe=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),X=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);X<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(X,this._bufferService.rows-1),Math.min(pe,this._bufferService.rows-1))}print(F,B,O){let Q,M;const J=this._charsetService.charset,de=this._optionsService.rawOptions.screenReaderMode,pe=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,$=this._coreService.modes.insertMode,se=this._curAttrData;let le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&O-B>0&&le.getWidth(this._activeBuffer.x-1)===2&&le.setCellFromCodepoint(this._activeBuffer.x-1,0,1,se);let te=this._parser.precedingJoinState;for(let ue=B;ue<O;++ue){if(Q=F[ue],Q<127&&J){const Pe=J[String.fromCharCode(Q)];Pe&&(Q=Pe.charCodeAt(0))}const Ae=this._unicodeService.charProperties(Q,te);M=T.UnicodeService.extractWidth(Ae);const Le=T.UnicodeService.extractShouldJoin(Ae),Me=Le?T.UnicodeService.extractWidth(te):0;if(te=Ae,de&&this._onA11yChar.fire((0,b.stringFromCodePoint)(Q)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+M-Me>pe){if(X){const Pe=le;let Be=this._activeBuffer.x-Me;for(this._activeBuffer.x=Me,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Me>0&&le instanceof y.BufferLine&&le.copyCellsFrom(Pe,Be,0,Me,!1);Be<pe;)Pe.setCellFromCodepoint(Be++,0,1,se)}else if(this._activeBuffer.x=pe-1,M===2)continue}if(Le&&this._activeBuffer.x){const Pe=le.getWidth(this._activeBuffer.x-1)?1:2;le.addCodepointToCell(this._activeBuffer.x-Pe,Q,M);for(let Be=M-Me;--Be>=0;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}else if($&&(le.insertCells(this._activeBuffer.x,M-Me,this._activeBuffer.getNullCell(se)),le.getWidth(pe-1)===2&&le.setCellFromCodepoint(pe-1,_.NULL_CELL_CODE,_.NULL_CELL_WIDTH,se)),le.setCellFromCodepoint(this._activeBuffer.x++,Q,M,se),M>0)for(;--M;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}this._parser.precedingJoinState=te,this._activeBuffer.x<pe&&O-B>0&&le.getWidth(this._activeBuffer.x)===0&&!le.hasContent(this._activeBuffer.x)&&le.setCellFromCodepoint(this._activeBuffer.x,0,1,se),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(F,B){return F.final!=="t"||F.prefix||F.intermediates?this._parser.registerCsiHandler(F,B):this._parser.registerCsiHandler(F,(O=>!U(O.params[0],this._optionsService.rawOptions.windowOptions)||B(O)))}registerDcsHandler(F,B){return this._parser.registerDcsHandler(F,new R.DcsHandler(B))}registerEscHandler(F,B){return this._parser.registerEscHandler(F,B)}registerOscHandler(F,B){return this._parser.registerOscHandler(F,new j.OscHandler(B))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var F;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&F.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const F=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-F),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(F=this._bufferService.cols-1){this._activeBuffer.x=Math.min(F,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(F,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=F,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=F,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(F,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+F,this._activeBuffer.y+B)}cursorUp(F){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,F.params[0]||1)):this._moveCursor(0,-(F.params[0]||1)),!0}cursorDown(F){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,F.params[0]||1)):this._moveCursor(0,F.params[0]||1),!0}cursorForward(F){return this._moveCursor(F.params[0]||1,0),!0}cursorBackward(F){return this._moveCursor(-(F.params[0]||1),0),!0}cursorNextLine(F){return this.cursorDown(F),this._activeBuffer.x=0,!0}cursorPrecedingLine(F){return this.cursorUp(F),this._activeBuffer.x=0,!0}cursorCharAbsolute(F){return this._setCursor((F.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(F){return this._setCursor(F.length>=2?(F.params[1]||1)-1:0,(F.params[0]||1)-1),!0}charPosAbsolute(F){return this._setCursor((F.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(F){return this._moveCursor(F.params[0]||1,0),!0}linePosAbsolute(F){return this._setCursor(this._activeBuffer.x,(F.params[0]||1)-1),!0}vPositionRelative(F){return this._moveCursor(0,F.params[0]||1),!0}hVPosition(F){return this.cursorPosition(F),!0}tabClear(F){const B=F.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(F){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=F.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(F){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=F.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(F){const B=F.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(F,B,O,Q=!1,M=!1){const J=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);J.replaceCells(B,O,this._activeBuffer.getNullCell(this._eraseAttrData()),M),Q&&(J.isWrapped=!1)}_resetBufferLine(F,B=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+F),O.isWrapped=!1)}eraseInDisplay(F,B=!1){let O;switch(this._restrictCursor(this._bufferService.cols),F.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);O<this._bufferService.rows;O++)this._resetBufferLine(O,B);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,B);this._dirtyRowTracker.markDirty(0);break;case 3:const Q=this._activeBuffer.lines.length-this._bufferService.rows;Q>0&&(this._activeBuffer.lines.trimStart(Q),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-Q,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-Q,0),this._onScroll.fire(0))}return!0}eraseInLine(F,B=!1){switch(this._restrictCursor(this._bufferService.cols),F.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(F){this._restrictCursor();let B=F.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,Q=this._bufferService.rows-1-this._activeBuffer.scrollBottom,M=this._bufferService.rows-1+this._activeBuffer.ybase-Q+1;for(;B--;)this._activeBuffer.lines.splice(M-1,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(F){this._restrictCursor();let B=F.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y;let Q;for(Q=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Q=this._bufferService.rows-1+this._activeBuffer.ybase-Q;B--;)this._activeBuffer.lines.splice(O,1),this._activeBuffer.lines.splice(Q,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(F){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,F.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(F){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,F.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(F){let B=F.params[0]||1;for(;B--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(F){let B=F.params[0]||1;for(;B--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(y.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(F){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=F.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);Q.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),Q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(F){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=F.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);Q.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),Q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(F){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=F.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);Q.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),Q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(F){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=F.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);Q.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),Q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(F){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(F.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(F){const B=this._parser.precedingJoinState;if(!B)return!0;const O=F.params[0]||1,Q=T.UnicodeService.extractWidth(B),M=this._activeBuffer.x-Q,J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(M),de=new Uint32Array(J.length*O);let pe=0;for(let $=0;$<J.length;){const se=J.codePointAt($)||0;de[pe++]=se,$+=se>65535?2:1}let X=pe;for(let $=1;$<O;++$)de.copyWithin(X,0,pe),X+=pe;return this.print(de,0,X),!0}sendDeviceAttributesPrimary(F){return F.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(F){return F.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(F.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(F){return(this._optionsService.rawOptions.termName+"").indexOf(F)===0}setMode(F){for(let B=0;B<F.length;B++)switch(F.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(F){for(let B=0;B<F.length;B++)switch(F.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),this._charsetService.setgCharset(1,v.DEFAULT_CHARSET),this._charsetService.setgCharset(2,v.DEFAULT_CHARSET),this._charsetService.setgCharset(3,v.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(F){for(let B=0;B<F.length;B++)switch(F.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(F){for(let B=0;B<F.length;B++)switch(F.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),F.params[B]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(F,B){const O=this._coreService.decPrivateModes,{activeProtocol:Q,activeEncoding:M}=this._coreMouseService,J=this._coreService,{buffers:de,cols:pe}=this._bufferService,{active:X,alt:$}=de,se=this._optionsService.rawOptions,le=Le=>Le?1:2,te=F.params[0];return ue=te,Ae=B?te===2?4:te===4?le(J.modes.insertMode):te===12?3:te===20?le(se.convertEol):0:te===1?le(O.applicationCursorKeys):te===3?se.windowOptions.setWinLines?pe===80?2:pe===132?1:0:0:te===6?le(O.origin):te===7?le(O.wraparound):te===8?3:te===9?le(Q==="X10"):te===12?le(se.cursorBlink):te===25?le(!J.isCursorHidden):te===45?le(O.reverseWraparound):te===66?le(O.applicationKeypad):te===67?4:te===1e3?le(Q==="VT200"):te===1002?le(Q==="DRAG"):te===1003?le(Q==="ANY"):te===1004?le(O.sendFocus):te===1005?4:te===1006?le(M==="SGR"):te===1015?4:te===1016?le(M==="SGR_PIXELS"):te===1048?1:te===47||te===1047||te===1049?le(X===$):te===2004?le(O.bracketedPasteMode):0,J.triggerDataEvent(`${f.C0.ESC}[${B?"":"?"}${ue};${Ae}$y`),!0;var ue,Ae}_updateAttrColor(F,B,O,Q,M){return B===2?(F|=50331648,F&=-16777216,F|=E.AttributeData.fromColorRGB([O,Q,M])):B===5&&(F&=-50331904,F|=33554432|255&O),F}_extractColor(F,B,O){const Q=[0,0,-1,0,0,0];let M=0,J=0;do{if(Q[J+M]=F.params[B+J],F.hasSubParams(B+J)){const de=F.getSubParams(B+J);let pe=0;do Q[1]===5&&(M=1),Q[J+pe+1+M]=de[pe];while(++pe<de.length&&pe+J+1+M<Q.length);break}if(Q[1]===5&&J+M>=2||Q[1]===2&&J+M>=5)break;Q[1]&&(M=1)}while(++J+B<F.length&&J+M<Q.length);for(let de=2;de<Q.length;++de)Q[de]===-1&&(Q[de]=0);switch(Q[0]){case 38:O.fg=this._updateAttrColor(O.fg,Q[1],Q[3],Q[4],Q[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,Q[1],Q[3],Q[4],Q[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,Q[1],Q[3],Q[4],Q[5])}return J}_processUnderline(F,B){B.extended=B.extended.clone(),(!~F||F>5)&&(F=1),B.extended.underlineStyle=F,B.fg|=268435456,F===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(F){F.fg=y.DEFAULT_ATTR_DATA.fg,F.bg=y.DEFAULT_ATTR_DATA.bg,F.extended=F.extended.clone(),F.extended.underlineStyle=0,F.extended.underlineColor&=-67108864,F.updateExtended()}charAttributes(F){if(F.length===1&&F.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=F.length;let O;const Q=this._curAttrData;for(let M=0;M<B;M++)O=F.params[M],O>=30&&O<=37?(Q.fg&=-50331904,Q.fg|=16777216|O-30):O>=40&&O<=47?(Q.bg&=-50331904,Q.bg|=16777216|O-40):O>=90&&O<=97?(Q.fg&=-50331904,Q.fg|=16777224|O-90):O>=100&&O<=107?(Q.bg&=-50331904,Q.bg|=16777224|O-100):O===0?this._processSGR0(Q):O===1?Q.fg|=134217728:O===3?Q.bg|=67108864:O===4?(Q.fg|=268435456,this._processUnderline(F.hasSubParams(M)?F.getSubParams(M)[0]:1,Q)):O===5?Q.fg|=536870912:O===7?Q.fg|=67108864:O===8?Q.fg|=1073741824:O===9?Q.fg|=2147483648:O===2?Q.bg|=134217728:O===21?this._processUnderline(2,Q):O===22?(Q.fg&=-134217729,Q.bg&=-134217729):O===23?Q.bg&=-67108865:O===24?(Q.fg&=-268435457,this._processUnderline(0,Q)):O===25?Q.fg&=-536870913:O===27?Q.fg&=-67108865:O===28?Q.fg&=-1073741825:O===29?Q.fg&=2147483647:O===39?(Q.fg&=-67108864,Q.fg|=16777215&y.DEFAULT_ATTR_DATA.fg):O===49?(Q.bg&=-67108864,Q.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?M+=this._extractColor(F,M,Q):O===53?Q.bg|=1073741824:O===55?Q.bg&=-1073741825:O===59?(Q.extended=Q.extended.clone(),Q.extended.underlineColor=-1,Q.updateExtended()):O===100?(Q.fg&=-67108864,Q.fg|=16777215&y.DEFAULT_ATTR_DATA.fg,Q.bg&=-67108864,Q.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(F){switch(F.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${B};${O}R`)}return!0}deviceStatusPrivate(F){if(F.params[0]===6){const B=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${B};${O}R`)}return!0}softReset(F){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(F){const B=F.params[0]||1;switch(B){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const O=B%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(F){const B=F.params[0]||1;let O;return(F.length<2||(O=F.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(F){if(!U(F.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=F.length>1?F.params[1]:0;switch(F.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire(P.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(P.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(F){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(F){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(F){return this._windowTitle=F,this._onTitleChange.fire(F),!0}setIconName(F){return this._iconName=F,!0}setOrReportIndexedColor(F){const B=[],O=F.split(";");for(;O.length>1;){const Q=O.shift(),M=O.shift();if(/^\d+$/.exec(Q)){const J=parseInt(Q);if(Y(J))if(M==="?")B.push({type:0,index:J});else{const de=(0,D.parseColor)(M);de&&B.push({type:1,index:J,color:de})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(F){const B=F.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(F,B){this._getCurrentLinkId()&&this._finishHyperlink();const O=F.split(":");let Q;const M=O.findIndex((J=>J.startsWith("id=")));return M!==-1&&(Q=O[M].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:Q,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(F,B){const O=F.split(";");for(let Q=0;Q<O.length&&!(B>=this._specialColors.length);++Q,++B)if(O[Q]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const M=(0,D.parseColor)(O[Q]);M&&this._onColor.fire([{type:1,index:this._specialColors[B],color:M}])}return!0}setOrReportFgColor(F){return this._setOrReportSpecialColor(F,0)}setOrReportBgColor(F){return this._setOrReportSpecialColor(F,1)}setOrReportCursorColor(F){return this._setOrReportSpecialColor(F,2)}restoreIndexedColor(F){if(!F)return this._onColor.fire([{type:2}]),!0;const B=[],O=F.split(";");for(let Q=0;Q<O.length;++Q)if(/^\d+$/.exec(O[Q])){const M=parseInt(O[Q]);Y(M)&&B.push({type:2,index:M})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(F){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(F){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(F){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),!0}selectCharset(F){return F.length!==2?(this.selectDefaultCharset(),!0):(F[0]==="/"||this._charsetService.setgCharset(L[F[0]],v.CHARSETS[F[1]]||v.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const F=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,F,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(F){return this._charsetService.setgLevel(F),!0}screenAlignmentPattern(){const F=new x.CellData;F.content=4194373,F.fg=this._curAttrData.fg,F.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const O=this._activeBuffer.ybase+this._activeBuffer.y+B,Q=this._activeBuffer.lines.get(O);Q&&(Q.fill(F),Q.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(F,B){const O=this._bufferService.buffer,Q=this._optionsService.rawOptions;return(M=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${M}${f.C0.ESC}\\`),!0))(F==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:F==='"p'?'P1$r61;1"p':F==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:F==="m"?"P1$r0m":F===" q"?`P1$r${{block:2,underline:4,bar:6}[Q.cursorStyle]-(Q.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(F,B){this._dirtyRowTracker.markRangeDirty(F,B)}}o.InputHandler=K;let W=class{constructor(ne){this._bufferService=ne,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ne){ne<this.start?this.start=ne:ne>this.end&&(this.end=ne)}markRangeDirty(ne,F){ne>F&&(G=ne,ne=F,F=G),ne<this.start&&(this.start=ne),F>this.end&&(this.end=F)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Y(ne){return 0<=ne&&ne<256}W=h([m(0,N.IBufferService)],W)},844:(d,o)=>{function c(h){for(const m of h)m.dispose();h.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const m=this._disposables.indexOf(h);m!==-1&&this._disposables.splice(m,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var m;this._isDisposed||h===this._value||((m=this._value)==null||m.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},o.toDisposable=function(h){return{dispose:h}},o.disposeArray=c,o.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(m,f,v){this._data[m]||(this._data[m]={}),this._data[m][f]=v}get(m,f){return this._data[m]?this._data[m][f]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(h,m,f,v,w){this._data.get(h,m)||this._data.set(h,m,new c),this._data.get(h,m).set(f,v,w)}get(h,m,f,v){var w;return(w=this._data.get(h,m))==null?void 0:w.get(f,v)}clear(){this._data.clear()}}},6114:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,h=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const m=c.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),o.isIpad=h==="iPad",o.isIphone=h==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),o.isLinux=h.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(c=this._search(this._getKey(h)),this._array.splice(c,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const m=this._getKey(h);if(m===void 0||(c=this._search(m),c===-1)||this._getKey(this._array[c])!==m)return!1;do if(this._array[c]===h)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===m);return!1}*getKeyIterator(h){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===h)}forEachByKey(h,m){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do m(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let m=0,f=this._array.length-1;for(;f>=m;){let v=m+f>>1;const w=this._getKey(this._array[v]);if(w>h)f=v-1;else{if(!(w<h)){for(;v>0&&this._getKey(this._array[v-1])===h;)v--;return v}m=v+1}}return m}}},7226:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const h=c(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(w){this._idleCallback=void 0;let A=0,b=0,y=w.timeRemaining(),S=0;for(;this._i<this._tasks.length;){if(A=Date.now(),this._tasks[this._i]()||this._i++,A=Math.max(1,Date.now()-A),b=Math.max(A,b),S=w.timeRemaining(),1.5*b>S)return y-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(y-A))}ms`),void this._start();y=S}this.clear()}}class f extends m{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const A=Date.now()+w;return{timeRemaining:()=>Math.max(0,A-Date.now())}}}o.PriorityTaskQueue=f,o.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:f,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const h=c(643);o.updateWindowsModeWrappedState=function(m){const f=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),v=f==null?void 0:f.get(m.cols-1),w=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);w&&v&&(w.isWrapped=v[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&v[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new c;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,v=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=v}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=h},9092:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const h=c(6349),m=c(7226),f=c(3734),v=c(8437),w=c(4634),A=c(511),b=c(643),y=c(4863),S=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(_,x,E){this._hasScrollback=_,this._optionsService=x,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=S.DEFAULT_CHARSET,this.markers=[],this._nullCell=A.CellData.fromCharData([0,b.NULL_CELL_CHAR,b.NULL_CELL_WIDTH,b.NULL_CELL_CODE]),this._whitespaceCell=A.CellData.fromCharData([0,b.WHITESPACE_CELL_CHAR,b.WHITESPACE_CELL_WIDTH,b.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(_){return _?(this._nullCell.fg=_.fg,this._nullCell.bg=_.bg,this._nullCell.extended=_.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(_){return _?(this._whitespaceCell.fg=_.fg,this._whitespaceCell.bg=_.bg,this._whitespaceCell.extended=_.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(_,x){return new v.BufferLine(this._bufferService.cols,this.getNullCell(_),x)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const _=this.ybase+this.y-this.ydisp;return _>=0&&_<this._rows}_getCorrectBufferLength(_){if(!this._hasScrollback)return _;const x=_+this._optionsService.rawOptions.scrollback;return x>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:x}fillViewportRows(_){if(this.lines.length===0){_===void 0&&(_=v.DEFAULT_ATTR_DATA);let x=this._rows;for(;x--;)this.lines.push(this.getBlankLine(_))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(_,x){const E=this.getNullCell(v.DEFAULT_ATTR_DATA);let N=0;const T=this._getCorrectBufferLength(x);if(T>this.lines.maxLength&&(this.lines.maxLength=T),this.lines.length>0){if(this._cols<_)for(let R=0;R<this.lines.length;R++)N+=+this.lines.get(R).resize(_,E);let j=0;if(this._rows<x)for(let R=this._rows;R<x;R++)this.lines.length<x+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new v.BufferLine(_,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+j+1?(this.ybase--,j++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(_,E)));else for(let R=this._rows;R>x;R--)this.lines.length>x+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(T<this.lines.maxLength){const R=this.lines.length-T;R>0&&(this.lines.trimStart(R),this.ybase=Math.max(this.ybase-R,0),this.ydisp=Math.max(this.ydisp-R,0),this.savedY=Math.max(this.savedY-R,0)),this.lines.maxLength=T}this.x=Math.min(this.x,_-1),this.y=Math.min(this.y,x-1),j&&(this.y+=j),this.savedX=Math.min(this.savedX,_-1),this.scrollTop=0}if(this.scrollBottom=x-1,this._isReflowEnabled&&(this._reflow(_,x),this._cols>_))for(let j=0;j<this.lines.length;j++)N+=+this.lines.get(j).resize(_,E);this._cols=_,this._rows=x,this._memoryCleanupQueue.clear(),N>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let _=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,_=!1);let x=0;for(;this._memoryCleanupPosition<this.lines.length;)if(x+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),x>100)return!0;return _}get _isReflowEnabled(){const _=this._optionsService.rawOptions.windowsPty;return _&&_.buildNumber?this._hasScrollback&&_.backend==="conpty"&&_.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(_,x){this._cols!==_&&(_>this._cols?this._reflowLarger(_,x):this._reflowSmaller(_,x))}_reflowLarger(_,x){const E=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,_,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(E.length>0){const N=(0,w.reflowLargerCreateNewLayout)(this.lines,E);(0,w.reflowLargerApplyNewLayout)(this.lines,N.layout),this._reflowLargerAdjustViewport(_,x,N.countRemoved)}}_reflowLargerAdjustViewport(_,x,E){const N=this.getNullCell(v.DEFAULT_ATTR_DATA);let T=E;for(;T-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<x&&this.lines.push(new v.BufferLine(_,N))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(_,x){const E=this.getNullCell(v.DEFAULT_ATTR_DATA),N=[];let T=0;for(let j=this.lines.length-1;j>=0;j--){let R=this.lines.get(j);if(!R||!R.isWrapped&&R.getTrimmedLength()<=_)continue;const D=[R];for(;R.isWrapped&&j>0;)R=this.lines.get(--j),D.unshift(R);const L=this.ybase+this.y;if(L>=j&&L<j+D.length)continue;const z=D[D.length-1].getTrimmedLength(),U=(0,w.reflowSmallerGetNewLineLengths)(D,this._cols,_),P=U.length-D.length;let G;G=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+P):Math.max(0,this.lines.length-this.lines.maxLength+P);const K=[];for(let O=0;O<P;O++){const Q=this.getBlankLine(v.DEFAULT_ATTR_DATA,!0);K.push(Q)}K.length>0&&(N.push({start:j+D.length+T,newLines:K}),T+=K.length),D.push(...K);let W=U.length-1,Y=U[W];Y===0&&(W--,Y=U[W]);let ne=D.length-P-1,F=z;for(;ne>=0;){const O=Math.min(F,Y);if(D[W]===void 0)break;if(D[W].copyCellsFrom(D[ne],F-O,Y-O,O,!0),Y-=O,Y===0&&(W--,Y=U[W]),F-=O,F===0){ne--;const Q=Math.max(ne,0);F=(0,w.getWrappedLineTrimmedLength)(D,Q,this._cols)}}for(let O=0;O<D.length;O++)U[O]<_&&D[O].setCell(U[O],E);let B=P-G;for(;B-- >0;)this.ybase===0?this.y<x-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+T)-x&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+x-1)}if(N.length>0){const j=[],R=[];for(let W=0;W<this.lines.length;W++)R.push(this.lines.get(W));const D=this.lines.length;let L=D-1,z=0,U=N[z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+T);let P=0;for(let W=Math.min(this.lines.maxLength-1,D+T-1);W>=0;W--)if(U&&U.start>L+P){for(let Y=U.newLines.length-1;Y>=0;Y--)this.lines.set(W--,U.newLines[Y]);W++,j.push({index:L+1,amount:U.newLines.length}),P+=U.newLines.length,U=N[++z]}else this.lines.set(W,R[L--]);let G=0;for(let W=j.length-1;W>=0;W--)j[W].index+=G,this.lines.onInsertEmitter.fire(j[W]),G+=j[W].amount;const K=Math.max(0,D+T-this.lines.maxLength);K>0&&this.lines.onTrimEmitter.fire(K)}}translateBufferLineToString(_,x,E=0,N){const T=this.lines.get(_);return T?T.translateToString(x,E,N):""}getWrappedRangeForLine(_){let x=_,E=_;for(;x>0&&this.lines.get(x).isWrapped;)x--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:x,last:E}}setupTabStops(_){for(_!=null?this.tabs[_]||(_=this.prevStop(_)):(this.tabs={},_=0);_<this._cols;_+=this._optionsService.rawOptions.tabStopWidth)this.tabs[_]=!0}prevStop(_){for(_==null&&(_=this.x);!this.tabs[--_]&&_>0;);return _>=this._cols?this._cols-1:_<0?0:_}nextStop(_){for(_==null&&(_=this.x);!this.tabs[++_]&&_<this._cols;);return _>=this._cols?this._cols-1:_<0?0:_}clearMarkers(_){this._isClearing=!0;for(let x=0;x<this.markers.length;x++)this.markers[x].line===_&&(this.markers[x].dispose(),this.markers.splice(x--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].dispose(),this.markers.splice(_--,1);this._isClearing=!1}addMarker(_){const x=new y.Marker(_);return this.markers.push(x),x.register(this.lines.onTrim((E=>{x.line-=E,x.line<0&&x.dispose()}))),x.register(this.lines.onInsert((E=>{x.line>=E.index&&(x.line+=E.amount)}))),x.register(this.lines.onDelete((E=>{x.line>=E.index&&x.line<E.index+E.amount&&x.dispose(),x.line>E.index&&(x.line-=E.amount)}))),x.register(x.onDispose((()=>this._removeMarker(x)))),x}_removeMarker(_){this._isClearing||this.markers.splice(this.markers.indexOf(_),1)}}},8437:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const h=c(3734),m=c(511),f=c(643),v=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let w=0;class A{constructor(y,S,_=!1){this.isWrapped=_,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*y);const x=S||m.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let E=0;E<y;++E)this.setCell(E,x);this.length=y}get(y){const S=this._data[3*y+0],_=2097151&S;return[this._data[3*y+1],2097152&S?this._combined[y]:_?(0,v.stringFromCodePoint)(_):"",S>>22,2097152&S?this._combined[y].charCodeAt(this._combined[y].length-1):_]}set(y,S){this._data[3*y+1]=S[f.CHAR_DATA_ATTR_INDEX],S[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[y]=S[1],this._data[3*y+0]=2097152|y|S[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*y+0]=S[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(y){return this._data[3*y+0]>>22}hasWidth(y){return 12582912&this._data[3*y+0]}getFg(y){return this._data[3*y+1]}getBg(y){return this._data[3*y+2]}hasContent(y){return 4194303&this._data[3*y+0]}getCodePoint(y){const S=this._data[3*y+0];return 2097152&S?this._combined[y].charCodeAt(this._combined[y].length-1):2097151&S}isCombined(y){return 2097152&this._data[3*y+0]}getString(y){const S=this._data[3*y+0];return 2097152&S?this._combined[y]:2097151&S?(0,v.stringFromCodePoint)(2097151&S):""}isProtected(y){return 536870912&this._data[3*y+2]}loadCell(y,S){return w=3*y,S.content=this._data[w+0],S.fg=this._data[w+1],S.bg=this._data[w+2],2097152&S.content&&(S.combinedData=this._combined[y]),268435456&S.bg&&(S.extended=this._extendedAttrs[y]),S}setCell(y,S){2097152&S.content&&(this._combined[y]=S.combinedData),268435456&S.bg&&(this._extendedAttrs[y]=S.extended),this._data[3*y+0]=S.content,this._data[3*y+1]=S.fg,this._data[3*y+2]=S.bg}setCellFromCodepoint(y,S,_,x){268435456&x.bg&&(this._extendedAttrs[y]=x.extended),this._data[3*y+0]=S|_<<22,this._data[3*y+1]=x.fg,this._data[3*y+2]=x.bg}addCodepointToCell(y,S,_){let x=this._data[3*y+0];2097152&x?this._combined[y]+=(0,v.stringFromCodePoint)(S):2097151&x?(this._combined[y]=(0,v.stringFromCodePoint)(2097151&x)+(0,v.stringFromCodePoint)(S),x&=-2097152,x|=2097152):x=S|4194304,_&&(x&=-12582913,x|=_<<22),this._data[3*y+0]=x}insertCells(y,S,_){if((y%=this.length)&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,_),S<this.length-y){const x=new m.CellData;for(let E=this.length-y-S-1;E>=0;--E)this.setCell(y+S+E,this.loadCell(y+E,x));for(let E=0;E<S;++E)this.setCell(y+E,_)}else for(let x=y;x<this.length;++x)this.setCell(x,_);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,_)}deleteCells(y,S,_){if(y%=this.length,S<this.length-y){const x=new m.CellData;for(let E=0;E<this.length-y-S;++E)this.setCell(y+E,this.loadCell(y+S+E,x));for(let E=this.length-S;E<this.length;++E)this.setCell(E,_)}else for(let x=y;x<this.length;++x)this.setCell(x,_);y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,_),this.getWidth(y)!==0||this.hasContent(y)||this.setCellFromCodepoint(y,0,1,_)}replaceCells(y,S,_,x=!1){if(x)for(y&&this.getWidth(y-1)===2&&!this.isProtected(y-1)&&this.setCellFromCodepoint(y-1,0,1,_),S<this.length&&this.getWidth(S-1)===2&&!this.isProtected(S)&&this.setCellFromCodepoint(S,0,1,_);y<S&&y<this.length;)this.isProtected(y)||this.setCell(y,_),y++;else for(y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,_),S<this.length&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S,0,1,_);y<S&&y<this.length;)this.setCell(y++,_)}resize(y,S){if(y===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const _=3*y;if(y>this.length){if(this._data.buffer.byteLength>=4*_)this._data=new Uint32Array(this._data.buffer,0,_);else{const x=new Uint32Array(_);x.set(this._data),this._data=x}for(let x=this.length;x<y;++x)this.setCell(x,S)}else{this._data=this._data.subarray(0,_);const x=Object.keys(this._combined);for(let N=0;N<x.length;N++){const T=parseInt(x[N],10);T>=y&&delete this._combined[T]}const E=Object.keys(this._extendedAttrs);for(let N=0;N<E.length;N++){const T=parseInt(E[N],10);T>=y&&delete this._extendedAttrs[T]}}return this.length=y,4*_*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const y=new Uint32Array(this._data.length);return y.set(this._data),this._data=y,1}return 0}fill(y,S=!1){if(S)for(let _=0;_<this.length;++_)this.isProtected(_)||this.setCell(_,y);else{this._combined={},this._extendedAttrs={};for(let _=0;_<this.length;++_)this.setCell(_,y)}}copyFrom(y){this.length!==y.length?this._data=new Uint32Array(y._data):this._data.set(y._data),this.length=y.length,this._combined={};for(const S in y._combined)this._combined[S]=y._combined[S];this._extendedAttrs={};for(const S in y._extendedAttrs)this._extendedAttrs[S]=y._extendedAttrs[S];this.isWrapped=y.isWrapped}clone(){const y=new A(0);y._data=new Uint32Array(this._data),y.length=this.length;for(const S in this._combined)y._combined[S]=this._combined[S];for(const S in this._extendedAttrs)y._extendedAttrs[S]=this._extendedAttrs[S];return y.isWrapped=this.isWrapped,y}getTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0])return y+(this._data[3*y+0]>>22);return 0}getNoBgTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0]||50331648&this._data[3*y+2])return y+(this._data[3*y+0]>>22);return 0}copyCellsFrom(y,S,_,x,E){const N=y._data;if(E)for(let j=x-1;j>=0;j--){for(let R=0;R<3;R++)this._data[3*(_+j)+R]=N[3*(S+j)+R];268435456&N[3*(S+j)+2]&&(this._extendedAttrs[_+j]=y._extendedAttrs[S+j])}else for(let j=0;j<x;j++){for(let R=0;R<3;R++)this._data[3*(_+j)+R]=N[3*(S+j)+R];268435456&N[3*(S+j)+2]&&(this._extendedAttrs[_+j]=y._extendedAttrs[S+j])}const T=Object.keys(y._combined);for(let j=0;j<T.length;j++){const R=parseInt(T[j],10);R>=S&&(this._combined[R-S+_]=y._combined[R])}}translateToString(y,S,_,x){S=S??0,_=_??this.length,y&&(_=Math.min(_,this.getTrimmedLength())),x&&(x.length=0);let E="";for(;S<_;){const N=this._data[3*S+0],T=2097151&N,j=2097152&N?this._combined[S]:T?(0,v.stringFromCodePoint)(T):f.WHITESPACE_CELL_CHAR;if(E+=j,x)for(let R=0;R<j.length;++R)x.push(S);S+=N>>22||1}return x&&x.push(S),E}}o.BufferLine=A},4841:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,h){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return h*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(d,o)=>{function c(h,m,f){if(m===h.length-1)return h[m].getTrimmedLength();const v=!h[m].hasContent(f-1)&&h[m].getWidth(f-1)===1,w=h[m+1].getWidth(0)===2;return v&&w?f-1:f}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(h,m,f,v,w){const A=[];for(let b=0;b<h.length-1;b++){let y=b,S=h.get(++y);if(!S.isWrapped)continue;const _=[h.get(b)];for(;y<h.length&&S.isWrapped;)_.push(S),S=h.get(++y);if(v>=b&&v<y){b+=_.length-1;continue}let x=0,E=c(_,x,m),N=1,T=0;for(;N<_.length;){const R=c(_,N,m),D=R-T,L=f-E,z=Math.min(D,L);_[x].copyCellsFrom(_[N],T,E,z,!1),E+=z,E===f&&(x++,E=0),T+=z,T===R&&(N++,T=0),E===0&&x!==0&&_[x-1].getWidth(f-1)===2&&(_[x].copyCellsFrom(_[x-1],f-1,E++,1,!1),_[x-1].setCell(f-1,w))}_[x].replaceCells(E,f,w);let j=0;for(let R=_.length-1;R>0&&(R>x||_[R].getTrimmedLength()===0);R--)j++;j>0&&(A.push(b+_.length-j),A.push(j)),b+=_.length-1}return A},o.reflowLargerCreateNewLayout=function(h,m){const f=[];let v=0,w=m[v],A=0;for(let b=0;b<h.length;b++)if(w===b){const y=m[++v];h.onDeleteEmitter.fire({index:b-A,amount:y}),b+=y-1,A+=y,w=m[++v]}else f.push(b);return{layout:f,countRemoved:A}},o.reflowLargerApplyNewLayout=function(h,m){const f=[];for(let v=0;v<m.length;v++)f.push(h.get(m[v]));for(let v=0;v<f.length;v++)h.set(v,f[v]);h.length=m.length},o.reflowSmallerGetNewLineLengths=function(h,m,f){const v=[],w=h.map(((S,_)=>c(h,_,m))).reduce(((S,_)=>S+_));let A=0,b=0,y=0;for(;y<w;){if(w-y<f){v.push(w-y);break}A+=f;const S=c(h,b,m);A>S&&(A-=S,b++);const _=h[b].getWidth(A-1)===2;_&&A--;const x=_?f-1:f;v.push(x),y+=x}return v},o.getWrappedLineTrimmedLength=c},5295:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const h=c(8460),m=c(844),f=c(9092);class v extends m.Disposable{constructor(A,b){super(),this._optionsService=A,this._bufferService=b,this._onBufferActivate=this.register(new h.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(A){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(A),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(A,b){this._normal.resize(A,b),this._alt.resize(A,b),this.setupTabStops(A)}setupTabStops(A){this._normal.setupTabStops(A),this._alt.setupTabStops(A)}}o.BufferSet=v},511:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const h=c(482),m=c(643),f=c(3734);class v extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(A){const b=new v;return b.setFromCharData(A),b}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(A){this.fg=A[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let b=!1;if(A[m.CHAR_DATA_CHAR_INDEX].length>2)b=!0;else if(A[m.CHAR_DATA_CHAR_INDEX].length===2){const y=A[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=y&&y<=56319){const S=A[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=S&&S<=57343?this.content=1024*(y-55296)+S-56320+65536|A[m.CHAR_DATA_WIDTH_INDEX]<<22:b=!0}else b=!0}else this.content=A[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[m.CHAR_DATA_WIDTH_INDEX]<<22;b&&(this.combinedData=A[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|A[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=v},643:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const h=c(8460),m=c(844);class f{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(w){return this._disposables.push(w),w}}o.Marker=f,f._nextId=1},7116:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(d,o)=>{var c,h,m;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
|
|
383
|
+
`,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(c||(o.C0=c={})),(function(f){f.PAD="",f.HOP="",f.BPH="",f.NBH="",f.IND="",f.NEL="
",f.SSA="",f.ESA="",f.HTS="",f.HTJ="",f.VTS="",f.PLD="",f.PLU="",f.RI="",f.SS2="",f.SS3="",f.DCS="",f.PU1="",f.PU2="",f.STS="",f.CCH="",f.MW="",f.SPA="",f.EPA="",f.SOS="",f.SGCI="",f.SCI="",f.CSI="",f.ST="",f.OSC="",f.PM="",f.APC=""})(h||(o.C1=h={})),(function(f){f.ST=`${c.ESC}\\`})(m||(o.C1_ESCAPED=m={}))},7399:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const h=c(2584),m={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(f,v,w,A){const b={type:0,cancel:!1,key:void 0},y=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?b.key=v?h.C0.ESC+"OA":h.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?b.key=v?h.C0.ESC+"OD":h.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?b.key=v?h.C0.ESC+"OC":h.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(b.key=v?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:b.key=f.ctrlKey?"\b":h.C0.DEL,f.altKey&&(b.key=h.C0.ESC+b.key);break;case 9:if(f.shiftKey){b.key=h.C0.ESC+"[Z";break}b.key=h.C0.HT,b.cancel=!0;break;case 13:b.key=f.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,b.cancel=!0;break;case 27:b.key=h.C0.ESC,f.altKey&&(b.key=h.C0.ESC+h.C0.ESC),b.cancel=!0;break;case 37:if(f.metaKey)break;y?(b.key=h.C0.ESC+"[1;"+(y+1)+"D",b.key===h.C0.ESC+"[1;3D"&&(b.key=h.C0.ESC+(w?"b":"[1;5D"))):b.key=v?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(f.metaKey)break;y?(b.key=h.C0.ESC+"[1;"+(y+1)+"C",b.key===h.C0.ESC+"[1;3C"&&(b.key=h.C0.ESC+(w?"f":"[1;5C"))):b.key=v?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(f.metaKey)break;y?(b.key=h.C0.ESC+"[1;"+(y+1)+"A",w||b.key!==h.C0.ESC+"[1;3A"||(b.key=h.C0.ESC+"[1;5A")):b.key=v?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(f.metaKey)break;y?(b.key=h.C0.ESC+"[1;"+(y+1)+"B",w||b.key!==h.C0.ESC+"[1;3B"||(b.key=h.C0.ESC+"[1;5B")):b.key=v?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(b.key=h.C0.ESC+"[2~");break;case 46:b.key=y?h.C0.ESC+"[3;"+(y+1)+"~":h.C0.ESC+"[3~";break;case 36:b.key=y?h.C0.ESC+"[1;"+(y+1)+"H":v?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:b.key=y?h.C0.ESC+"[1;"+(y+1)+"F":v?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:f.shiftKey?b.type=2:f.ctrlKey?b.key=h.C0.ESC+"[5;"+(y+1)+"~":b.key=h.C0.ESC+"[5~";break;case 34:f.shiftKey?b.type=3:f.ctrlKey?b.key=h.C0.ESC+"[6;"+(y+1)+"~":b.key=h.C0.ESC+"[6~";break;case 112:b.key=y?h.C0.ESC+"[1;"+(y+1)+"P":h.C0.ESC+"OP";break;case 113:b.key=y?h.C0.ESC+"[1;"+(y+1)+"Q":h.C0.ESC+"OQ";break;case 114:b.key=y?h.C0.ESC+"[1;"+(y+1)+"R":h.C0.ESC+"OR";break;case 115:b.key=y?h.C0.ESC+"[1;"+(y+1)+"S":h.C0.ESC+"OS";break;case 116:b.key=y?h.C0.ESC+"[15;"+(y+1)+"~":h.C0.ESC+"[15~";break;case 117:b.key=y?h.C0.ESC+"[17;"+(y+1)+"~":h.C0.ESC+"[17~";break;case 118:b.key=y?h.C0.ESC+"[18;"+(y+1)+"~":h.C0.ESC+"[18~";break;case 119:b.key=y?h.C0.ESC+"[19;"+(y+1)+"~":h.C0.ESC+"[19~";break;case 120:b.key=y?h.C0.ESC+"[20;"+(y+1)+"~":h.C0.ESC+"[20~";break;case 121:b.key=y?h.C0.ESC+"[21;"+(y+1)+"~":h.C0.ESC+"[21~";break;case 122:b.key=y?h.C0.ESC+"[23;"+(y+1)+"~":h.C0.ESC+"[23~";break;case 123:b.key=y?h.C0.ESC+"[24;"+(y+1)+"~":h.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(w&&!A||!f.altKey||f.metaKey)!w||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?b.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(b.key=h.C0.US),f.key==="@"&&(b.key=h.C0.NUL)):f.keyCode===65&&(b.type=1);else{const S=m[f.keyCode],_=S==null?void 0:S[f.shiftKey?1:0];if(_)b.key=h.C0.ESC+_;else if(f.keyCode>=65&&f.keyCode<=90){const x=f.ctrlKey?f.keyCode-64:f.keyCode+32;let E=String.fromCharCode(x);f.shiftKey&&(E=E.toUpperCase()),b.key=h.C0.ESC+E}else if(f.keyCode===32)b.key=h.C0.ESC+(f.ctrlKey?h.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let x=f.code.slice(3,4);f.shiftKey||(x=x.toLowerCase()),b.key=h.C0.ESC+x,b.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?b.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?b.key=h.C0.NUL:f.keyCode>=51&&f.keyCode<=55?b.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?b.key=h.C0.DEL:f.keyCode===219?b.key=h.C0.ESC:f.keyCode===220?b.key=h.C0.FS:f.keyCode===221&&(b.key=h.C0.GS)}return b}},482:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,h=0,m=c.length){let f="";for(let v=h;v<m;++v){let w=c[v];w>65535?(w-=65536,f+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):f+=String.fromCharCode(w)}return f},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const m=c.length;if(!m)return 0;let f=0,v=0;if(this._interim){const w=c.charCodeAt(v++);56320<=w&&w<=57343?h[f++]=1024*(this._interim-55296)+w-56320+65536:(h[f++]=this._interim,h[f++]=w),this._interim=0}for(let w=v;w<m;++w){const A=c.charCodeAt(w);if(55296<=A&&A<=56319){if(++w>=m)return this._interim=A,f;const b=c.charCodeAt(w);56320<=b&&b<=57343?h[f++]=1024*(A-55296)+b-56320+65536:(h[f++]=A,h[f++]=b)}else A!==65279&&(h[f++]=A)}return f}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const m=c.length;if(!m)return 0;let f,v,w,A,b=0,y=0,S=0;if(this.interim[0]){let E=!1,N=this.interim[0];N&=(224&N)==192?31:(240&N)==224?15:7;let T,j=0;for(;(T=63&this.interim[++j])&&j<4;)N<<=6,N|=T;const R=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,D=R-j;for(;S<D;){if(S>=m)return 0;if(T=c[S++],(192&T)!=128){S--,E=!0;break}this.interim[j++]=T,N<<=6,N|=63&T}E||(R===2?N<128?S--:h[b++]=N:R===3?N<2048||N>=55296&&N<=57343||N===65279||(h[b++]=N):N<65536||N>1114111||(h[b++]=N)),this.interim.fill(0)}const _=m-4;let x=S;for(;x<m;){for(;!(!(x<_)||128&(f=c[x])||128&(v=c[x+1])||128&(w=c[x+2])||128&(A=c[x+3]));)h[b++]=f,h[b++]=v,h[b++]=w,h[b++]=A,x+=4;if(f=c[x++],f<128)h[b++]=f;else if((224&f)==192){if(x>=m)return this.interim[0]=f,b;if(v=c[x++],(192&v)!=128){x--;continue}if(y=(31&f)<<6|63&v,y<128){x--;continue}h[b++]=y}else if((240&f)==224){if(x>=m)return this.interim[0]=f,b;if(v=c[x++],(192&v)!=128){x--;continue}if(x>=m)return this.interim[0]=f,this.interim[1]=v,b;if(w=c[x++],(192&w)!=128){x--;continue}if(y=(15&f)<<12|(63&v)<<6|63&w,y<2048||y>=55296&&y<=57343||y===65279)continue;h[b++]=y}else if((248&f)==240){if(x>=m)return this.interim[0]=f,b;if(v=c[x++],(192&v)!=128){x--;continue}if(x>=m)return this.interim[0]=f,this.interim[1]=v,b;if(w=c[x++],(192&w)!=128){x--;continue}if(x>=m)return this.interim[0]=f,this.interim[1]=v,this.interim[2]=w,b;if(A=c[x++],(192&A)!=128){x--;continue}if(y=(7&f)<<18|(63&v)<<12|(63&w)<<6|63&A,y<65536||y>1114111)continue;h[b++]=y}}return b}}},225:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const h=c(1480),m=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],f=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let v;o.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let w=0;w<m.length;++w)v.fill(0,m[w][0],m[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?v[w]:(function(A,b){let y,S=0,_=b.length-1;if(A<b[0][0]||A>b[_][1])return!1;for(;_>=S;)if(y=S+_>>1,A>b[y][1])S=y+1;else{if(!(A<b[y][0]))return!0;_=y-1}return!1})(w,f)?0:w>=131072&&w<=196605||w>=196608&&w<=262141?2:1}charProperties(w,A){let b=this.wcwidth(w),y=b===0&&A!==0;if(y){const S=h.UnicodeService.extractWidth(A);S===0?y=!1:S>b&&(b=S)}return h.UnicodeService.createPropertyValue(0,b,y)}}},5981:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const h=c(8460),m=c(844);class f extends m.Disposable{constructor(w){super(),this._action=w,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(w,A){if(A!==void 0&&this._syncCalls>A)return void(this._syncCalls=0);if(this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let b;for(this._isSyncWriting=!0;b=this._writeBuffer.shift();){this._action(b);const y=this._callbacks.shift();y&&y()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,A){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(A),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(A)}_innerWrite(w=0,A=!0){const b=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const y=this._writeBuffer[this._bufferOffset],S=this._action(y,A);if(S){const x=E=>Date.now()-b>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(b,E);return void S.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(x)}const _=this._callbacks[this._bufferOffset];if(_&&_(),this._bufferOffset++,this._pendingData-=y.length,Date.now()-b>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=f},5941:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function m(f,v){const w=f.toString(16),A=w.length<2?"0"+w:w;switch(v){case 4:return w[0];case 8:return A;case 12:return(A+A).slice(0,3);default:return A+A}}o.parseColor=function(f){if(!f)return;let v=f.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const w=c.exec(v);if(w){const A=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/A*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/A*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/A*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),h.exec(v)&&[3,6,9,12].includes(v.length))){const w=v.length/3,A=[0,0,0];for(let b=0;b<3;++b){const y=parseInt(v.slice(w*b,w*b+w),16);A[b]=w===1?y<<4:w===2?y:w===3?y>>4:y>>8}return A}},o.toRgbString=function(f,v=16){const[w,A,b]=f;return`rgb:${m(w,v)}/${m(A,v)}/${m(b,v)}`}},5770:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const h=c(482),m=c(8742),f=c(5770),v=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(A,b){this._handlers[A]===void 0&&(this._handlers[A]=[]);const y=this._handlers[A];return y.push(b),{dispose:()=>{const S=y.indexOf(b);S!==-1&&y.splice(S,1)}}}clearHandler(A){this._handlers[A]&&delete this._handlers[A]}setHandlerFallback(A){this._handlerFb=A}reset(){if(this._active.length)for(let A=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;A>=0;--A)this._active[A].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(A,b){if(this.reset(),this._ident=A,this._active=this._handlers[A]||v,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].hook(b);else this._handlerFb(this._ident,"HOOK",b)}put(A,b,y){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(A,b,y);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(A,b,y))}unhook(A,b=!0){if(this._active.length){let y=!1,S=this._active.length-1,_=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,y=b,_=this._stack.fallThrough,this._stack.paused=!1),!_&&y===!1){for(;S>=0&&(y=this._active[S].unhook(A),y!==!0);S--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,y;S--}for(;S>=0;S--)if(y=this._active[S].unhook(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,y}else this._handlerFb(this._ident,"UNHOOK",A);this._active=v,this._ident=0}};const w=new m.Params;w.addParam(0),o.DcsHandler=class{constructor(A){this._handler=A,this._data="",this._params=w,this._hitLimit=!1}hook(A){this._params=A.length>1||A.params[0]?A.clone():w,this._data="",this._hitLimit=!1}put(A,b,y){this._hitLimit||(this._data+=(0,h.utf32ToString)(A,b,y),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(A){let b=!1;if(this._hitLimit)b=!1;else if(A&&(b=this._handler(this._data,this._params),b instanceof Promise))return b.then((y=>(this._params=w,this._data="",this._hitLimit=!1,y)));return this._params=w,this._data="",this._hitLimit=!1,b}}},2015:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const h=c(844),m=c(8742),f=c(6242),v=c(6351);class w{constructor(S){this.table=new Uint8Array(S)}setDefault(S,_){this.table.fill(S<<4|_)}add(S,_,x,E){this.table[_<<8|S]=x<<4|E}addMany(S,_,x,E){for(let N=0;N<S.length;N++)this.table[_<<8|S[N]]=x<<4|E}}o.TransitionTable=w;const A=160;o.VT500_TRANSITION_TABLE=(function(){const y=new w(4095),S=Array.apply(null,Array(256)).map(((j,R)=>R)),_=(j,R)=>S.slice(j,R),x=_(32,127),E=_(0,24);E.push(25),E.push.apply(E,_(28,32));const N=_(0,14);let T;for(T in y.setDefault(1,0),y.addMany(x,0,2,0),N)y.addMany([24,26,153,154],T,3,0),y.addMany(_(128,144),T,3,0),y.addMany(_(144,152),T,3,0),y.add(156,T,0,0),y.add(27,T,11,1),y.add(157,T,4,8),y.addMany([152,158,159],T,0,7),y.add(155,T,11,3),y.add(144,T,11,9);return y.addMany(E,0,3,0),y.addMany(E,1,3,1),y.add(127,1,0,1),y.addMany(E,8,0,8),y.addMany(E,3,3,3),y.add(127,3,0,3),y.addMany(E,4,3,4),y.add(127,4,0,4),y.addMany(E,6,3,6),y.addMany(E,5,3,5),y.add(127,5,0,5),y.addMany(E,2,3,2),y.add(127,2,0,2),y.add(93,1,4,8),y.addMany(x,8,5,8),y.add(127,8,5,8),y.addMany([156,27,24,26,7],8,6,0),y.addMany(_(28,32),8,0,8),y.addMany([88,94,95],1,0,7),y.addMany(x,7,0,7),y.addMany(E,7,0,7),y.add(156,7,0,0),y.add(127,7,0,7),y.add(91,1,11,3),y.addMany(_(64,127),3,7,0),y.addMany(_(48,60),3,8,4),y.addMany([60,61,62,63],3,9,4),y.addMany(_(48,60),4,8,4),y.addMany(_(64,127),4,7,0),y.addMany([60,61,62,63],4,0,6),y.addMany(_(32,64),6,0,6),y.add(127,6,0,6),y.addMany(_(64,127),6,0,0),y.addMany(_(32,48),3,9,5),y.addMany(_(32,48),5,9,5),y.addMany(_(48,64),5,0,6),y.addMany(_(64,127),5,7,0),y.addMany(_(32,48),4,9,5),y.addMany(_(32,48),1,9,2),y.addMany(_(32,48),2,9,2),y.addMany(_(48,127),2,10,0),y.addMany(_(48,80),1,10,0),y.addMany(_(81,88),1,10,0),y.addMany([89,90,92],1,10,0),y.addMany(_(96,127),1,10,0),y.add(80,1,11,9),y.addMany(E,9,0,9),y.add(127,9,0,9),y.addMany(_(28,32),9,0,9),y.addMany(_(32,48),9,9,12),y.addMany(_(48,60),9,8,10),y.addMany([60,61,62,63],9,9,10),y.addMany(E,11,0,11),y.addMany(_(32,128),11,0,11),y.addMany(_(28,32),11,0,11),y.addMany(E,10,0,10),y.add(127,10,0,10),y.addMany(_(28,32),10,0,10),y.addMany(_(48,60),10,8,10),y.addMany([60,61,62,63],10,0,11),y.addMany(_(32,48),10,9,12),y.addMany(E,12,0,12),y.add(127,12,0,12),y.addMany(_(28,32),12,0,12),y.addMany(_(32,48),12,9,12),y.addMany(_(48,64),12,0,11),y.addMany(_(64,127),12,12,13),y.addMany(_(64,127),10,12,13),y.addMany(_(64,127),9,12,13),y.addMany(E,13,13,13),y.addMany(x,13,13,13),y.add(127,13,0,13),y.addMany([27,156,24,26],13,14,0),y.add(A,0,2,0),y.add(A,8,5,8),y.add(A,6,0,6),y.add(A,11,0,11),y.add(A,13,13,13),y})();class b extends h.Disposable{constructor(S=o.VT500_TRANSITION_TABLE){super(),this._transitions=S,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(_,x,E)=>{},this._executeHandlerFb=_=>{},this._csiHandlerFb=(_,x)=>{},this._escHandlerFb=_=>{},this._errorHandlerFb=_=>_,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(S,_=[64,126]){let x=0;if(S.prefix){if(S.prefix.length>1)throw new Error("only one byte as prefix supported");if(x=S.prefix.charCodeAt(0),x&&60>x||x>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(S.intermediates){if(S.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let N=0;N<S.intermediates.length;++N){const T=S.intermediates.charCodeAt(N);if(32>T||T>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");x<<=8,x|=T}}if(S.final.length!==1)throw new Error("final must be a single byte");const E=S.final.charCodeAt(0);if(_[0]>E||E>_[1])throw new Error(`final must be in range ${_[0]} .. ${_[1]}`);return x<<=8,x|=E,x}identToString(S){const _=[];for(;S;)_.push(String.fromCharCode(255&S)),S>>=8;return _.reverse().join("")}setPrintHandler(S){this._printHandler=S}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(S,_){const x=this._identifier(S,[48,126]);this._escHandlers[x]===void 0&&(this._escHandlers[x]=[]);const E=this._escHandlers[x];return E.push(_),{dispose:()=>{const N=E.indexOf(_);N!==-1&&E.splice(N,1)}}}clearEscHandler(S){this._escHandlers[this._identifier(S,[48,126])]&&delete this._escHandlers[this._identifier(S,[48,126])]}setEscHandlerFallback(S){this._escHandlerFb=S}setExecuteHandler(S,_){this._executeHandlers[S.charCodeAt(0)]=_}clearExecuteHandler(S){this._executeHandlers[S.charCodeAt(0)]&&delete this._executeHandlers[S.charCodeAt(0)]}setExecuteHandlerFallback(S){this._executeHandlerFb=S}registerCsiHandler(S,_){const x=this._identifier(S);this._csiHandlers[x]===void 0&&(this._csiHandlers[x]=[]);const E=this._csiHandlers[x];return E.push(_),{dispose:()=>{const N=E.indexOf(_);N!==-1&&E.splice(N,1)}}}clearCsiHandler(S){this._csiHandlers[this._identifier(S)]&&delete this._csiHandlers[this._identifier(S)]}setCsiHandlerFallback(S){this._csiHandlerFb=S}registerDcsHandler(S,_){return this._dcsParser.registerHandler(this._identifier(S),_)}clearDcsHandler(S){this._dcsParser.clearHandler(this._identifier(S))}setDcsHandlerFallback(S){this._dcsParser.setHandlerFallback(S)}registerOscHandler(S,_){return this._oscParser.registerHandler(S,_)}clearOscHandler(S){this._oscParser.clearHandler(S)}setOscHandlerFallback(S){this._oscParser.setHandlerFallback(S)}setErrorHandler(S){this._errorHandler=S}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(S,_,x,E,N){this._parseStack.state=S,this._parseStack.handlers=_,this._parseStack.handlerPos=x,this._parseStack.transition=E,this._parseStack.chunkPos=N}parse(S,_,x){let E,N=0,T=0,j=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,j=this._parseStack.chunkPos+1;else{if(x===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const R=this._parseStack.handlers;let D=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(x===!1&&D>-1){for(;D>=0&&(E=R[D](this._params),E!==!0);D--)if(E instanceof Promise)return this._parseStack.handlerPos=D,E}this._parseStack.handlers=[];break;case 4:if(x===!1&&D>-1){for(;D>=0&&(E=R[D](),E!==!0);D--)if(E instanceof Promise)return this._parseStack.handlerPos=D,E}this._parseStack.handlers=[];break;case 6:if(N=S[this._parseStack.chunkPos],E=this._dcsParser.unhook(N!==24&&N!==26,x),E)return E;N===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(N=S[this._parseStack.chunkPos],E=this._oscParser.end(N!==24&&N!==26,x),E)return E;N===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,j=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let R=j;R<_;++R){switch(N=S[R],T=this._transitions.table[this.currentState<<8|(N<160?N:A)],T>>4){case 2:for(let P=R+1;;++P){if(P>=_||(N=S[P])<32||N>126&&N<A){this._printHandler(S,R,P),R=P-1;break}if(++P>=_||(N=S[P])<32||N>126&&N<A){this._printHandler(S,R,P),R=P-1;break}if(++P>=_||(N=S[P])<32||N>126&&N<A){this._printHandler(S,R,P),R=P-1;break}if(++P>=_||(N=S[P])<32||N>126&&N<A){this._printHandler(S,R,P),R=P-1;break}}break;case 3:this._executeHandlers[N]?this._executeHandlers[N]():this._executeHandlerFb(N),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:R,code:N,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const D=this._csiHandlers[this._collect<<8|N];let L=D?D.length-1:-1;for(;L>=0&&(E=D[L](this._params),E!==!0);L--)if(E instanceof Promise)return this._preserveStack(3,D,L,T,R),E;L<0&&this._csiHandlerFb(this._collect<<8|N,this._params),this.precedingJoinState=0;break;case 8:do switch(N){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(N-48)}while(++R<_&&(N=S[R])>47&&N<60);R--;break;case 9:this._collect<<=8,this._collect|=N;break;case 10:const z=this._escHandlers[this._collect<<8|N];let U=z?z.length-1:-1;for(;U>=0&&(E=z[U](),E!==!0);U--)if(E instanceof Promise)return this._preserveStack(4,z,U,T,R),E;U<0&&this._escHandlerFb(this._collect<<8|N),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|N,this._params);break;case 13:for(let P=R+1;;++P)if(P>=_||(N=S[P])===24||N===26||N===27||N>127&&N<A){this._dcsParser.put(S,R,P),R=P-1;break}break;case 14:if(E=this._dcsParser.unhook(N!==24&&N!==26),E)return this._preserveStack(6,[],0,T,R),E;N===27&&(T|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let P=R+1;;P++)if(P>=_||(N=S[P])<32||N>127&&N<A){this._oscParser.put(S,R,P),R=P-1;break}break;case 6:if(E=this._oscParser.end(N!==24&&N!==26),E)return this._preserveStack(5,[],0,T,R),E;N===27&&(T|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&T}}}o.EscapeSequenceParser=b},6242:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const h=c(5770),m=c(482),f=[];o.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,w){this._handlers[v]===void 0&&(this._handlers[v]=[]);const A=this._handlers[v];return A.push(w),{dispose:()=>{const b=A.indexOf(w);b!==-1&&A.splice(b,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,w,A){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(v,w,A);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(v,w,A))}start(){this.reset(),this._state=1}put(v,w,A){if(this._state!==3){if(this._state===1)for(;w<A;){const b=v[w++];if(b===59){this._state=2,this._start();break}if(b<48||57<b)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+b-48}this._state===2&&A-w>0&&this._put(v,w,A)}}end(v,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let A=!1,b=this._active.length-1,y=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,A=w,y=this._stack.fallThrough,this._stack.paused=!1),!y&&A===!1){for(;b>=0&&(A=this._active[b].end(v),A!==!0);b--)if(A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,A;b--}for(;b>=0;b--)if(A=this._active[b].end(!1),A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,A}else this._handlerFb(this._id,"END",v);this._active=f,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,w,A){this._hitLimit||(this._data+=(0,m.utf32ToString)(v,w,A),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let w=!1;if(this._hitLimit)w=!1;else if(v&&(w=this._handler(this._data),w instanceof Promise))return w.then((A=>(this._data="",this._hitLimit=!1,A)));return this._data="",this._hitLimit=!1,w}}},8742:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class h{static fromArray(f){const v=new h;if(!f.length)return v;for(let w=Array.isArray(f[0])?1:0;w<f.length;++w){const A=f[w];if(Array.isArray(A))for(let b=0;b<A.length;++b)v.addSubParam(A[b]);else v.addParam(A)}return v}constructor(f=32,v=32){if(this.maxLength=f,this.maxSubParamsLength=v,v>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new h(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let v=0;v<this.length;++v){f.push(this.params[v]);const w=this._subParamsIdx[v]>>8,A=255&this._subParamsIdx[v];A-w>0&&f.push(Array.prototype.slice.call(this._subParams,w,A))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>c?c:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>c?c:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const v=this._subParamsIdx[f]>>8,w=255&this._subParamsIdx[f];return w-v>0?this._subParams.subarray(v,w):null}getSubParamsAll(){const f={};for(let v=0;v<this.length;++v){const w=this._subParamsIdx[v]>>8,A=255&this._subParamsIdx[v];A-w>0&&(f[v]=this._subParams.slice(w,A))}return f}addDigit(f){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,A=w[v-1];w[v-1]=~A?Math.min(10*A+f,c):f}}o.Params=h},5741:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,h){const m={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(m),h.dispose=()=>this._wrappedAddonDispose(m),h.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let h=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===c){h=m;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(h,1)}}},8771:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const h=c(3785),m=c(511);o.BufferApiView=class{constructor(f,v){this._buffer=f,this.type=v}init(f){return this._buffer=f,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(f){const v=this._buffer.lines.get(f);if(v)return new h.BufferLineApiView(v)}getNullCell(){return new m.CellData}}},3785:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const h=c(511);o.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,f){if(!(m<0||m>=this._line.length))return f?(this._line.loadCell(m,f),f):this._line.loadCell(m,new h.CellData)}translateToString(m,f,v){return this._line.translateToString(m,f,v)}}},8285:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const h=c(8771),m=c(8460),f=c(844);class v extends f.Disposable{constructor(A){super(),this._core=A,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=v},7975:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,h){return this._core.registerCsiHandler(c,(m=>h(m.toArray())))}addCsiHandler(c,h){return this.registerCsiHandler(c,h)}registerDcsHandler(c,h){return this._core.registerDcsHandler(c,((m,f)=>h(m,f.toArray())))}addDcsHandler(c,h){return this.registerDcsHandler(c,h)}registerEscHandler(c,h){return this._core.registerEscHandler(c,h)}addEscHandler(c,h){return this.registerEscHandler(c,h)}registerOscHandler(c,h){return this._core.registerOscHandler(c,h)}addOscHandler(c,h){return this.registerOscHandler(c,h)}}},7090:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(d,o,c){var h=this&&this.__decorate||function(y,S,_,x){var E,N=arguments.length,T=N<3?S:x===null?x=Object.getOwnPropertyDescriptor(S,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(y,S,_,x);else for(var j=y.length-1;j>=0;j--)(E=y[j])&&(T=(N<3?E(T):N>3?E(S,_,T):E(S,_))||T);return N>3&&T&&Object.defineProperty(S,_,T),T},m=this&&this.__param||function(y,S){return function(_,x){S(_,x,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const f=c(8460),v=c(844),w=c(5295),A=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let b=o.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(y){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(y.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(y.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(y,this))}resize(y,S){this.cols=y,this.rows=S,this.buffers.resize(y,S),this._onResize.fire({cols:y,rows:S})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(y,S=!1){const _=this.buffer;let x;x=this._cachedBlankLine,x&&x.length===this.cols&&x.getFg(0)===y.fg&&x.getBg(0)===y.bg||(x=_.getBlankLine(y,S),this._cachedBlankLine=x),x.isWrapped=S;const E=_.ybase+_.scrollTop,N=_.ybase+_.scrollBottom;if(_.scrollTop===0){const T=_.lines.isFull;N===_.lines.length-1?T?_.lines.recycle().copyFrom(x):_.lines.push(x.clone()):_.lines.splice(N+1,0,x.clone()),T?this.isUserScrolling&&(_.ydisp=Math.max(_.ydisp-1,0)):(_.ybase++,this.isUserScrolling||_.ydisp++)}else{const T=N-E+1;_.lines.shiftElements(E+1,T-1,-1),_.lines.set(N,x.clone())}this.isUserScrolling||(_.ydisp=_.ybase),this._onScroll.fire(_.ydisp)}scrollLines(y,S,_){const x=this.buffer;if(y<0){if(x.ydisp===0)return;this.isUserScrolling=!0}else y+x.ydisp>=x.ybase&&(this.isUserScrolling=!1);const E=x.ydisp;x.ydisp=Math.max(Math.min(x.ydisp+y,x.ybase),0),E!==x.ydisp&&(S||this._onScroll.fire(x.ydisp))}};o.BufferService=b=h([m(0,A.IOptionsService)],b)},7994:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,h){this._charsets[c]=h,this.glevel===c&&(this.charset=h)}}},1753:function(d,o,c){var h=this&&this.__decorate||function(x,E,N,T){var j,R=arguments.length,D=R<3?E:T===null?T=Object.getOwnPropertyDescriptor(E,N):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(x,E,N,T);else for(var L=x.length-1;L>=0;L--)(j=x[L])&&(D=(R<3?j(D):R>3?j(E,N,D):j(E,N))||D);return R>3&&D&&Object.defineProperty(E,N,D),D},m=this&&this.__param||function(x,E){return function(N,T){E(N,T,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const f=c(2585),v=c(8460),w=c(844),A={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:x=>x.button!==4&&x.action===1&&(x.ctrl=!1,x.alt=!1,x.shift=!1,!0)},VT200:{events:19,restrict:x=>x.action!==32},DRAG:{events:23,restrict:x=>x.action!==32||x.button!==3},ANY:{events:31,restrict:x=>!0}};function b(x,E){let N=(x.ctrl?16:0)|(x.shift?4:0)|(x.alt?8:0);return x.button===4?(N|=64,N|=x.action):(N|=3&x.button,4&x.button&&(N|=64),8&x.button&&(N|=128),x.action===32?N|=32:x.action!==0||E||(N|=3)),N}const y=String.fromCharCode,S={DEFAULT:x=>{const E=[b(x,!1)+32,x.col+32,x.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${y(E[0])}${y(E[1])}${y(E[2])}`},SGR:x=>{const E=x.action===0&&x.button!==4?"m":"M";return`\x1B[<${b(x,!0)};${x.col};${x.row}${E}`},SGR_PIXELS:x=>{const E=x.action===0&&x.button!==4?"m":"M";return`\x1B[<${b(x,!0)};${x.x};${x.y}${E}`}};let _=o.CoreMouseService=class extends w.Disposable{constructor(x,E){super(),this._bufferService=x,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const N of Object.keys(A))this.addProtocol(N,A[N]);for(const N of Object.keys(S))this.addEncoding(N,S[N]);this.reset()}addProtocol(x,E){this._protocols[x]=E}addEncoding(x,E){this._encodings[x]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(x){if(!this._protocols[x])throw new Error(`unknown protocol "${x}"`);this._activeProtocol=x,this._onProtocolChange.fire(this._protocols[x].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(x){if(!this._encodings[x])throw new Error(`unknown encoding "${x}"`);this._activeEncoding=x}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(x){if(x.col<0||x.col>=this._bufferService.cols||x.row<0||x.row>=this._bufferService.rows||x.button===4&&x.action===32||x.button===3&&x.action!==32||x.button!==4&&(x.action===2||x.action===3)||(x.col++,x.row++,x.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,x,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(x))return!1;const E=this._encodings[this._activeEncoding](x);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=x,!0}explainEvents(x){return{down:!!(1&x),up:!!(2&x),drag:!!(4&x),move:!!(8&x),wheel:!!(16&x)}}_equalEvents(x,E,N){if(N){if(x.x!==E.x||x.y!==E.y)return!1}else if(x.col!==E.col||x.row!==E.row)return!1;return x.button===E.button&&x.action===E.action&&x.ctrl===E.ctrl&&x.alt===E.alt&&x.shift===E.shift}};o.CoreMouseService=_=h([m(0,f.IBufferService),m(1,f.ICoreService)],_)},6975:function(d,o,c){var h=this&&this.__decorate||function(_,x,E,N){var T,j=arguments.length,R=j<3?x:N===null?N=Object.getOwnPropertyDescriptor(x,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(_,x,E,N);else for(var D=_.length-1;D>=0;D--)(T=_[D])&&(R=(j<3?T(R):j>3?T(x,E,R):T(x,E))||R);return j>3&&R&&Object.defineProperty(x,E,R),R},m=this&&this.__param||function(_,x){return function(E,N){x(E,N,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const f=c(1439),v=c(8460),w=c(844),A=c(2585),b=Object.freeze({insertMode:!1}),y=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let S=o.CoreService=class extends w.Disposable{constructor(_,x,E){super(),this._bufferService=_,this._logService=x,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(b),this.decPrivateModes=(0,f.clone)(y)}reset(){this.modes=(0,f.clone)(b),this.decPrivateModes=(0,f.clone)(y)}triggerDataEvent(_,x=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;x&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),x&&this._onUserInput.fire(),this._logService.debug(`sending data "${_}"`,(()=>_.split("").map((N=>N.charCodeAt(0))))),this._onData.fire(_)}triggerBinaryEvent(_){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${_}"`,(()=>_.split("").map((x=>x.charCodeAt(0))))),this._onBinary.fire(_))}};o.CoreService=S=h([m(0,A.IBufferService),m(1,A.ILogService),m(2,A.IOptionsService)],S)},9074:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const h=c(8055),m=c(8460),f=c(844),v=c(6106);let w=0,A=0;class b extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList((_=>_==null?void 0:_.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(_){if(_.marker.isDisposed)return;const x=new y(_);if(x){const E=x.marker.onDispose((()=>x.dispose()));x.onDispose((()=>{x&&(this._decorations.delete(x)&&this._onDecorationRemoved.fire(x),E.dispose())})),this._decorations.insert(x),this._onDecorationRegistered.fire(x)}return x}reset(){for(const _ of this._decorations.values())_.dispose();this._decorations.clear()}*getDecorationsAtCell(_,x,E){let N=0,T=0;for(const j of this._decorations.getKeyIterator(x))N=j.options.x??0,T=N+(j.options.width??1),_>=N&&_<T&&(!E||(j.options.layer??"bottom")===E)&&(yield j)}forEachDecorationAtCell(_,x,E,N){this._decorations.forEachByKey(x,(T=>{w=T.options.x??0,A=w+(T.options.width??1),_>=w&&_<A&&(!E||(T.options.layer??"bottom")===E)&&N(T)}))}}o.DecorationService=b;class y extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(_){super(),this.options=_,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=_.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const h=c(2585),m=c(8343);class f{constructor(...w){this._entries=new Map;for(const[A,b]of w)this.set(A,b)}set(w,A){const b=this._entries.get(w);return this._entries.set(w,A),b}forEach(w){for(const[A,b]of this._entries.entries())w(A,b)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}o.ServiceCollection=f,o.InstantiationService=class{constructor(){this._services=new f,this._services.set(h.IInstantiationService,this)}setService(v,w){this._services.set(v,w)}getService(v){return this._services.get(v)}createInstance(v,...w){const A=(0,m.getServiceDependencies)(v).sort(((S,_)=>S.index-_.index)),b=[];for(const S of A){const _=this._services.get(S.id);if(!_)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${S.id}.`);b.push(_)}const y=A.length>0?A[0].index:w.length;if(w.length!==y)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${y+1} conflicts with ${w.length} static arguments`);return new v(...w,...b)}}},7866:function(d,o,c){var h=this&&this.__decorate||function(y,S,_,x){var E,N=arguments.length,T=N<3?S:x===null?x=Object.getOwnPropertyDescriptor(S,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(y,S,_,x);else for(var j=y.length-1;j>=0;j--)(E=y[j])&&(T=(N<3?E(T):N>3?E(S,_,T):E(S,_))||T);return N>3&&T&&Object.defineProperty(S,_,T),T},m=this&&this.__param||function(y,S){return function(_,x){S(_,x,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const f=c(844),v=c(2585),w={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let A,b=o.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(y){super(),this._optionsService=y,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),A=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(y){for(let S=0;S<y.length;S++)typeof y[S]=="function"&&(y[S]=y[S]())}_log(y,S,_){this._evalLazyOptionalParams(_),y.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+S,..._)}trace(y,...S){var _;this._logLevel<=v.LogLevelEnum.TRACE&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.trace.bind(this._optionsService.options.logger))??console.log,y,S)}debug(y,...S){var _;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.debug.bind(this._optionsService.options.logger))??console.log,y,S)}info(y,...S){var _;this._logLevel<=v.LogLevelEnum.INFO&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.info.bind(this._optionsService.options.logger))??console.info,y,S)}warn(y,...S){var _;this._logLevel<=v.LogLevelEnum.WARN&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.warn.bind(this._optionsService.options.logger))??console.warn,y,S)}error(y,...S){var _;this._logLevel<=v.LogLevelEnum.ERROR&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.error.bind(this._optionsService.options.logger))??console.error,y,S)}};o.LogService=b=h([m(0,v.IOptionsService)],b),o.setTraceLogger=function(y){A=y},o.traceCall=function(y,S,_){if(typeof _.value!="function")throw new Error("not supported");const x=_.value;_.value=function(...E){if(A.logLevel!==v.LogLevelEnum.TRACE)return x.apply(this,E);A.trace(`GlyphRenderer#${x.name}(${E.map((T=>JSON.stringify(T))).join(", ")})`);const N=x.apply(this,E);return A.trace(`GlyphRenderer#${x.name} return`,N),N}}},7302:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const h=c(8460),m=c(844),f=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class w extends m.Disposable{constructor(b){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const y={...o.DEFAULT_OPTIONS};for(const S in b)if(S in y)try{const _=b[S];y[S]=this._sanitizeAndValidateOption(S,_)}catch(_){console.error(_)}this.rawOptions=y,this.options={...y},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(b,y){return this.onOptionChange((S=>{S===b&&y(this.rawOptions[b])}))}onMultipleOptionChange(b,y){return this.onOptionChange((S=>{b.indexOf(S)!==-1&&y()}))}_setupOptions(){const b=S=>{if(!(S in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);return this.rawOptions[S]},y=(S,_)=>{if(!(S in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);_=this._sanitizeAndValidateOption(S,_),this.rawOptions[S]!==_&&(this.rawOptions[S]=_,this._onOptionChange.fire(S))};for(const S in this.rawOptions){const _={get:b.bind(this,S),set:y.bind(this,S)};Object.defineProperty(this.options,S,_)}}_sanitizeAndValidateOption(b,y){switch(b){case"cursorStyle":if(y||(y=o.DEFAULT_OPTIONS[b]),!(function(S){return S==="block"||S==="underline"||S==="bar"})(y))throw new Error(`"${y}" is not a valid value for ${b}`);break;case"wordSeparator":y||(y=o.DEFAULT_OPTIONS[b]);break;case"fontWeight":case"fontWeightBold":if(typeof y=="number"&&1<=y&&y<=1e3)break;y=v.includes(y)?y:o.DEFAULT_OPTIONS[b];break;case"cursorWidth":y=Math.floor(y);case"lineHeight":case"tabStopWidth":if(y<1)throw new Error(`${b} cannot be less than 1, value: ${y}`);break;case"minimumContrastRatio":y=Math.max(1,Math.min(21,Math.round(10*y)/10));break;case"scrollback":if((y=Math.min(y,4294967295))<0)throw new Error(`${b} cannot be less than 0, value: ${y}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(y<=0)throw new Error(`${b} cannot be less than or equal to 0, value: ${y}`);break;case"rows":case"cols":if(!y&&y!==0)throw new Error(`${b} must be numeric, value: ${y}`);break;case"windowsPty":y=y??{}}return y}}o.OptionsService=w},2660:function(d,o,c){var h=this&&this.__decorate||function(w,A,b,y){var S,_=arguments.length,x=_<3?A:y===null?y=Object.getOwnPropertyDescriptor(A,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(w,A,b,y);else for(var E=w.length-1;E>=0;E--)(S=w[E])&&(x=(_<3?S(x):_>3?S(A,b,x):S(A,b))||x);return _>3&&x&&Object.defineProperty(A,b,x),x},m=this&&this.__param||function(w,A){return function(b,y){A(b,y,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const f=c(2585);let v=o.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const A=this._bufferService.buffer;if(w.id===void 0){const E=A.addMarker(A.ybase+A.y),N={data:w,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(N,E))),this._dataByLinkId.set(N.id,N),N.id}const b=w,y=this._getEntryIdKey(b),S=this._entriesWithId.get(y);if(S)return this.addLineToLink(S.id,A.ybase+A.y),S.id;const _=A.addMarker(A.ybase+A.y),x={id:this._nextId++,key:this._getEntryIdKey(b),data:b,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(x,_))),this._entriesWithId.set(x.key,x),this._dataByLinkId.set(x.id,x),x.id}addLineToLink(w,A){const b=this._dataByLinkId.get(w);if(b&&b.lines.every((y=>y.line!==A))){const y=this._bufferService.buffer.addMarker(A);b.lines.push(y),y.onDispose((()=>this._removeMarkerFromLink(b,y)))}}getLinkData(w){var A;return(A=this._dataByLinkId.get(w))==null?void 0:A.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,A){const b=w.lines.indexOf(A);b!==-1&&(w.lines.splice(b,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};o.OscLinkService=v=h([m(0,f.IBufferService)],v)},8343:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",h="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(m){return m[h]||[]},o.createDecorator=function(m){if(o.serviceRegistry.has(m))return o.serviceRegistry.get(m);const f=function(v,w,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(b,y,S){y[c]===y?y[h].push({id:b,index:S}):(y[h]=[{id:b,index:S}],y[c]=y)})(f,v,A)};return f.toString=()=>m,o.serviceRegistry.set(m,f),f}},2585:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const h=c(8343);var m;o.IBufferService=(0,h.createDecorator)("BufferService"),o.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),o.ICoreService=(0,h.createDecorator)("CoreService"),o.ICharsetService=(0,h.createDecorator)("CharsetService"),o.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(m||(o.LogLevelEnum=m={})),o.ILogService=(0,h.createDecorator)("LogService"),o.IOptionsService=(0,h.createDecorator)("OptionsService"),o.IOscLinkService=(0,h.createDecorator)("OscLinkService"),o.IUnicodeService=(0,h.createDecorator)("UnicodeService"),o.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const h=c(8460),m=c(225);class f{static extractShouldJoin(w){return(1&w)!=0}static extractWidth(w){return w>>1&3}static extractCharKind(w){return w>>3}static createPropertyValue(w,A,b=!1){return(16777215&w)<<3|(3&A)<<1|(b?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const w=new m.UnicodeV6;this.register(w),this._active=w.version,this._activeProvider=w}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(w){if(!this._providers[w])throw new Error(`unknown Unicode version "${w}"`);this._active=w,this._activeProvider=this._providers[w],this._onChange.fire(w)}register(w){this._providers[w.version]=w}wcwidth(w){return this._activeProvider.wcwidth(w)}getStringCellWidth(w){let A=0,b=0;const y=w.length;for(let S=0;S<y;++S){let _=w.charCodeAt(S);if(55296<=_&&_<=56319){if(++S>=y)return A+this.wcwidth(_);const N=w.charCodeAt(S);56320<=N&&N<=57343?_=1024*(_-55296)+N-56320+65536:A+=this.wcwidth(N)}const x=this.charProperties(_,b);let E=f.extractWidth(x);f.extractShouldJoin(x)&&(E-=f.extractWidth(b)),A+=E,b=x}return A}charProperties(w,A){return this._activeProvider.charProperties(w,A)}}o.UnicodeService=f}},s={};function a(d){var o=s[d];if(o!==void 0)return o.exports;var c=s[d]={exports:{}};return n[d].call(c.exports,c,c.exports,a),c.exports}var u={};return(()=>{var d=u;Object.defineProperty(d,"__esModule",{value:!0}),d.Terminal=void 0;const o=a(9042),c=a(3236),h=a(844),m=a(5741),f=a(8285),v=a(7975),w=a(7090),A=["cols","rows"];class b extends h.Disposable{constructor(S){super(),this._core=this.register(new c.Terminal(S)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const _=E=>this._core.options[E],x=(E,N)=>{this._checkReadonlyOptions(E),this._core.options[E]=N};for(const E in this._core.options){const N={get:_.bind(this,E),set:x.bind(this,E)};Object.defineProperty(this._publicOptions,E,N)}}_checkReadonlyOptions(S){if(A.includes(S))throw new Error(`Option "${S}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new w.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const S=this._core.coreService.decPrivateModes;let _="none";switch(this._core.coreMouseService.activeProtocol){case"X10":_="x10";break;case"VT200":_="vt200";break;case"DRAG":_="drag";break;case"ANY":_="any"}return{applicationCursorKeysMode:S.applicationCursorKeys,applicationKeypadMode:S.applicationKeypad,bracketedPasteMode:S.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:_,originMode:S.origin,reverseWraparoundMode:S.reverseWraparound,sendFocusMode:S.sendFocus,wraparoundMode:S.wraparound}}get options(){return this._publicOptions}set options(S){for(const _ in S)this._publicOptions[_]=S[_]}blur(){this._core.blur()}focus(){this._core.focus()}input(S,_=!0){this._core.input(S,_)}resize(S,_){this._verifyIntegers(S,_),this._core.resize(S,_)}open(S){this._core.open(S)}attachCustomKeyEventHandler(S){this._core.attachCustomKeyEventHandler(S)}attachCustomWheelEventHandler(S){this._core.attachCustomWheelEventHandler(S)}registerLinkProvider(S){return this._core.registerLinkProvider(S)}registerCharacterJoiner(S){return this._checkProposedApi(),this._core.registerCharacterJoiner(S)}deregisterCharacterJoiner(S){this._checkProposedApi(),this._core.deregisterCharacterJoiner(S)}registerMarker(S=0){return this._verifyIntegers(S),this._core.registerMarker(S)}registerDecoration(S){return this._checkProposedApi(),this._verifyPositiveIntegers(S.x??0,S.width??0,S.height??0),this._core.registerDecoration(S)}hasSelection(){return this._core.hasSelection()}select(S,_,x){this._verifyIntegers(S,_,x),this._core.select(S,_,x)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(S,_){this._verifyIntegers(S,_),this._core.selectLines(S,_)}dispose(){super.dispose()}scrollLines(S){this._verifyIntegers(S),this._core.scrollLines(S)}scrollPages(S){this._verifyIntegers(S),this._core.scrollPages(S)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(S){this._verifyIntegers(S),this._core.scrollToLine(S)}clear(){this._core.clear()}write(S,_){this._core.write(S,_)}writeln(S,_){this._core.write(S),this._core.write(`\r
|
|
384
|
+
`,_)}paste(S){this._core.paste(S)}refresh(S,_){this._verifyIntegers(S,_),this._core.refresh(S,_)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(S){this._addonManager.loadAddon(this,S)}static get strings(){return o}_verifyIntegers(...S){for(const _ of S)if(_===1/0||isNaN(_)||_%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...S){for(const _ of S)if(_&&(_===1/0||isNaN(_)||_%1!=0||_<0))throw new Error("This API only accepts positive integers")}}d.Terminal=b})(),u})()))})(Oh)),Oh.exports}var nM=tM(),zh={exports:{}},jb;function rM(){return jb||(jb=1,(function(e,r){(function(n,s){e.exports=s()})(self,(()=>(()=>{var n={};return(()=>{var s=n;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(a){this._terminal=a}dispose(){}fit(){const a=this.proposeDimensions();if(!a||!this._terminal||isNaN(a.cols)||isNaN(a.rows))return;const u=this._terminal._core;this._terminal.rows===a.rows&&this._terminal.cols===a.cols||(u._renderService.clear(),this._terminal.resize(a.cols,a.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const a=this._terminal._core,u=a._renderService.dimensions;if(u.css.cell.width===0||u.css.cell.height===0)return;const d=this._terminal.options.scrollback===0?0:a.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),h=Math.max(0,parseInt(o.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),f=c-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),v=h-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-d;return{cols:Math.max(2,Math.floor(v/u.css.cell.width)),rows:Math.max(1,Math.floor(f/u.css.cell.height))}}}})(),n})()))})(zh)),zh.exports}var iM=rM(),Fh={exports:{}},Db;function sM(){return Db||(Db=1,(function(e,r){(function(n,s){e.exports=s()})(self,(()=>(()=>{var n={6:(d,o)=>{function c(m){try{const f=new URL(m),v=f.password&&f.username?`${f.protocol}//${f.username}:${f.password}@${f.host}`:f.username?`${f.protocol}//${f.username}@${f.host}`:`${f.protocol}//${f.host}`;return m.toLocaleLowerCase().startsWith(v.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(m,f,v,w={}){this._terminal=m,this._regex=f,this._handler=v,this._options=w}provideLinks(m,f){const v=h.computeLink(m,this._regex,this._terminal,this._handler);f(this._addCallbacks(v))}_addCallbacks(m){return m.map((f=>(f.leave=this._options.leave,f.hover=(v,w)=>{if(this._options.hover){const{range:A}=f;this._options.hover(v,w,A)}},f)))}};class h{static computeLink(f,v,w,A){const b=new RegExp(v.source,(v.flags||"")+"g"),[y,S]=h._getWindowedLineStrings(f-1,w),_=y.join("");let x;const E=[];for(;x=b.exec(_);){const N=x[0];if(!c(N))continue;const[T,j]=h._mapStrIdx(w,S,0,x.index),[R,D]=h._mapStrIdx(w,T,j,N.length);if(T===-1||j===-1||R===-1||D===-1)continue;const L={start:{x:j+1,y:T+1},end:{x:D,y:R+1}};E.push({range:L,text:N,activate:A})}return E}static _getWindowedLineStrings(f,v){let w,A=f,b=f,y=0,S="";const _=[];if(w=v.buffer.active.getLine(f)){const x=w.translateToString(!0);if(w.isWrapped&&x[0]!==" "){for(y=0;(w=v.buffer.active.getLine(--A))&&y<2048&&(S=w.translateToString(!0),y+=S.length,_.push(S),w.isWrapped&&S.indexOf(" ")===-1););_.reverse()}for(_.push(x),y=0;(w=v.buffer.active.getLine(++b))&&w.isWrapped&&y<2048&&(S=w.translateToString(!0),y+=S.length,_.push(S),S.indexOf(" ")===-1););}return[_,A]}static _mapStrIdx(f,v,w,A){const b=f.buffer.active,y=b.getNullCell();let S=w;for(;A;){const _=b.getLine(v);if(!_)return[-1,-1];for(let x=S;x<_.length;++x){_.getCell(x,y);const E=y.getChars();if(y.getWidth()&&(A-=E.length||1,x===_.length-1&&E==="")){const N=b.getLine(v+1);N&&N.isWrapped&&(N.getCell(0,y),y.getWidth()===2&&(A+=1))}if(A<0)return[v,x]}v++,S=0}return[v,S]}}o.LinkComputer=h}},s={};function a(d){var o=s[d];if(o!==void 0)return o.exports;var c=s[d]={exports:{}};return n[d](c,c.exports,a),c.exports}var u={};return(()=>{var d=u;Object.defineProperty(d,"__esModule",{value:!0}),d.WebLinksAddon=void 0;const o=a(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(m,f){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=f}else console.warn("Opening link blocked as opener could not be cleared")}d.WebLinksAddon=class{constructor(m=h,f={}){this._handler=m,this._options=f}activate(m){this._terminal=m;const f=this._options,v=f.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,v,this._handler,f))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),u})()))})(Fh)),Fh.exports}var aM=sM();const Fs="forge.terminal.tabs.v1";function oM(){var e;try{if(sessionStorage.getItem(Fs)===null){const o=localStorage.getItem(Fs);o!==null&&(sessionStorage.setItem(Fs,o),localStorage.removeItem(Fs))}const n=sessionStorage.getItem(Fs);if(n===null)return{tabs:[],activeTabId:void 0};const s=JSON.parse(n);if(typeof s!="object"||s===null||!Array.isArray(s.tabs))return{tabs:[],activeTabId:void 0};const a=[];for(const o of s.tabs)typeof o=="object"&&o!==null&&typeof o.id=="string"&&typeof o.projectId=="string"&&typeof o.label=="string"&&typeof o.createdAt=="number"&&a.push(o);const u=s.activeTabId,d=typeof u=="string"?u:void 0;return{tabs:a,activeTabId:a.some(o=>o.id===d)?d:(e=a[0])==null?void 0:e.id}}catch{return{tabs:[],activeTabId:void 0}}}function nc(e){try{sessionStorage.setItem(Fs,JSON.stringify(e))}catch{}}let lM=0;const cM=()=>`term-${Date.now().toString(36)}-${(lM++).toString(36)}`,Bb=oM(),Ka=Ir(e=>({tabs:Bb.tabs,activeTabId:Bb.activeTabId,openTab:r=>{const n=cM();return e(s=>{const a=s.tabs.filter(o=>o.projectId===r),u={id:n,projectId:r,label:`Terminal ${a.length+1}`,createdAt:Date.now()},d={tabs:[...s.tabs,u],activeTabId:n};return nc(d),d}),n},closeTab:r=>{e(n=>{var o;const s=n.tabs.findIndex(c=>c.id===r);if(s===-1)return{};const a=n.tabs.slice(0,s).concat(n.tabs.slice(s+1)),u=n.activeTabId===r?(o=a[s]??a[s-1]??a[0])==null?void 0:o.id:n.activeTabId,d={tabs:a,activeTabId:u};return nc(d),d})},setActiveTab:r=>e(n=>{const s={...n};return nc({tabs:s.tabs,activeTabId:r}),{activeTabId:r}}),closeProjectTabs:r=>{e(n=>{var d;const s=n.tabs.filter(o=>o.projectId!==r),a=s.some(o=>o.id===n.activeTabId)?n.activeTabId:(d=s[0])==null?void 0:d.id,u={tabs:s,activeTabId:a};return nc(u),u})}})),$n=new Map;function uM(e){const r=[1,2,4,8,16,30];return(r[Math.min(e,r.length-1)]??30)*1e3}function dM(e){return e===1e3||e===4401||e===4404}function hM(){const e=hr(),r=Ka(v=>v.tabs),n=Ka(v=>v.activeTabId),s=Ka(v=>v.openTab),a=Ka(v=>v.closeTab),u=Ka(v=>v.setActiveTab),d=Wt(v=>v.projects),o=r.filter(v=>v.projectId===(e==null?void 0:e.id)),c=o.find(v=>v.id===n)??o[0],h=new Map(d.map(v=>[v.id,v.path]));if(e===void 0)return g.jsx("div",{className:"flex h-full items-center justify-center text-xs italic text-neutral-500",children:"Select a project to open a terminal."});const m=()=>{s(e.id)},f=v=>{pM(v),a(v)};return g.jsxs("div",{className:"flex h-full flex-col bg-black",children:[g.jsx("div",{className:"flex items-center justify-between border-b border-neutral-800 bg-neutral-900/40 px-2 py-1",children:g.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto",children:[o.length===0&&g.jsx("span",{className:"px-2 text-[11px] italic text-neutral-500",children:"No terminals open."}),o.map(v=>{const w=v.id===(c==null?void 0:c.id);return g.jsxs("div",{className:`group flex items-center gap-1 rounded px-2 py-0.5 text-xs ${w?"bg-neutral-800 text-neutral-100":"text-neutral-400 hover:bg-neutral-900 hover:text-neutral-200"}`,children:[g.jsxs("button",{onClick:()=>u(v.id),className:"flex items-center gap-1",children:[g.jsx(Yb,{size:11}),v.label]}),g.jsx("button",{onClick:()=>f(v.id),className:"rounded p-1 text-neutral-600 hover:bg-neutral-800 hover:text-neutral-200",title:"Close terminal (kills the PTY)",children:g.jsx(Br,{size:16})})]},v.id)}),g.jsxs("button",{onClick:m,className:"ml-1 flex items-center gap-1 rounded px-2 py-0.5 text-xs text-neutral-400 hover:bg-neutral-900 hover:text-neutral-200",title:"New terminal",children:[g.jsx(no,{size:14}),"New"]})]})}),g.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[o.length===0&&g.jsxs("div",{className:"flex h-full items-center justify-center text-xs italic text-neutral-500",children:['Click "New" to open a terminal in ',e.path,"."]}),r.map(v=>g.jsx(fM,{tab:v,projectPath:h.get(v.projectId)??"",visible:v.projectId===e.id&&v.id===(c==null?void 0:c.id)},v.id))]})]})}function fM({tab:e,projectPath:r,visible:n}){const s=q.useRef(null);q.useEffect(()=>{if(s.current===null)return;const d=s.current,o=$n.get(e.id);if(o!==void 0){try{const b=o.term.element;b!==void 0&&b.parentNode!==d?d.appendChild(b):o.term.open(d),o.fit.fit()}catch{}const A=new ResizeObserver(()=>{try{o.fit.fit()}catch{}const b=o.term.cols,y=o.term.rows;b===o.lastSize.cols&&y===o.lastSize.rows||(o.lastSize={cols:b,rows:y},o.ws.readyState===WebSocket.OPEN&&o.ws.send(JSON.stringify({type:"resize",cols:b,rows:y})))});A.observe(d);try{o.observer.disconnect()}catch{}return o.observer=A,requestAnimationFrame(()=>{try{o.fit.fit(),o.term.focus()}catch{}}),()=>{try{A.disconnect()}catch{}}}const c=new nM.Terminal({theme:{background:sr("--pi-terminal-bg","#0a0a0a"),foreground:sr("--pi-terminal-fg","#e5e5e5"),cursor:sr("--pi-terminal-fg","#e5e5e5"),black:sr("--color-neutral-800","#262626"),brightBlack:sr("--color-neutral-600","#525252")},fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace',fontSize:13,cursorBlink:!0,scrollback:5e3,convertEol:!1}),h=new iM.FitAddon,m=new aM.WebLinksAddon;c.loadAddon(h),c.loadAddon(m),c.open(d),h.fit();const f={cols:c.cols,rows:c.rows},v=E1(e.id,e.projectId,c,f);c.onData(A=>{var y;const b=(y=$n.get(e.id))==null?void 0:y.ws;(b==null?void 0:b.readyState)===WebSocket.OPEN&&b.send(JSON.stringify({type:"input",data:A}))});const w=new ResizeObserver(()=>{try{h.fit()}catch{}const A=c.cols,b=c.rows,y=$n.get(e.id);y!==void 0&&(A===y.lastSize.cols&&b===y.lastSize.rows||(y.lastSize={cols:A,rows:b},y.ws.readyState===WebSocket.OPEN&&y.ws.send(JSON.stringify({type:"resize",cols:A,rows:b}))))});return w.observe(s.current),$n.set(e.id,{term:c,fit:h,ws:v,observer:w,lastSize:f,reconnectAttempt:0,reconnectTimer:void 0,disposed:!1}),()=>{try{w.disconnect()}catch{}}},[e.id]),q.useEffect(()=>{if(!n)return;const d=$n.get(e.id);d!==void 0&&requestAnimationFrame(()=>{try{d.fit.fit(),d.term.focus()}catch{}})},[n,e.id]);const a=mf(d=>d.theme);q.useEffect(()=>{const d=$n.get(e.id);d!==void 0&&(d.term.options.theme={background:sr("--pi-terminal-bg","#0a0a0a"),foreground:sr("--pi-terminal-fg","#e5e5e5"),cursor:sr("--pi-terminal-fg","#e5e5e5"),black:sr("--color-neutral-800","#262626"),brightBlack:sr("--color-neutral-600","#525252")})},[a,e.id]);const u=()=>{var d;(d=$n.get(e.id))==null||d.term.focus()};return g.jsx("div",{ref:s,onClick:u,className:"absolute inset-y-0 left-2 right-0",style:{visibility:n?"visible":"hidden",pointerEvents:n?"auto":"none",zIndex:n?1:0},title:r})}function E1(e,r,n,s,a){const u=window.location.protocol==="https:"?"wss":"ws",d=ci(),o=d!==void 0?`&token=${encodeURIComponent(d.token)}`:"",c=`${u}://${window.location.host}/api/v1/terminal?projectId=${encodeURIComponent(r)}&tabId=${encodeURIComponent(e)}${o}`,h=new WebSocket(c);return h.binaryType="arraybuffer",h.onopen=()=>{h.send(JSON.stringify({type:"resize",cols:s.cols,rows:s.rows}));const m=$n.get(e);m!==void 0&&(m.reconnectAttempt=0)},h.onmessage=m=>{typeof m.data=="string"?n.write(m.data):m.data instanceof ArrayBuffer&&n.write(new Uint8Array(m.data))},h.onclose=m=>{const f=$n.get(e);if(f===void 0||f.disposed)return;if(dM(m.code)){let A=`[connection closed: ${String(m.code)}]`;m.code===4401?A="[connection closed (4401): your session expired — refresh the page after logging back in]":m.code===4404&&(A="[connection closed (4404): project no longer exists]"),n.write(`\r
|
|
385
|
+
${A}\r
|
|
386
|
+
`);return}const v=f.reconnectAttempt+1;f.reconnectAttempt=v;const w=uM(v);n.write(`\r
|
|
387
|
+
[connection lost (${String(m.code)}) — reconnecting in ${String(w/1e3)}s, attempt ${String(v)}]\r
|
|
388
|
+
`),f.reconnectTimer=setTimeout(()=>{const A=$n.get(e);A===void 0||A.disposed||(A.reconnectTimer=void 0,A.ws=E1(e,r,n,A.lastSize))},w)},h}function pM(e){const r=$n.get(e);if(r!==void 0){r.disposed=!0,r.reconnectTimer!==void 0&&clearTimeout(r.reconnectTimer),$n.delete(e);try{r.observer.disconnect()}catch{}try{(r.ws.readyState===WebSocket.OPEN||r.ws.readyState===WebSocket.CONNECTING)&&r.ws.close(1e3,"tab_closed")}catch{}try{r.term.dispose()}catch{}}}function gM(){const e=Yn(c=>c.settings),r=Fi(c=>c.openSettings);if(e===void 0||e.total===0&&e.enabled)return null;const{enabled:n,connected:s,total:a}=e,u=n?s===a?"bg-emerald-500":s===0?"bg-red-500":"bg-amber-400":"bg-neutral-600",d=n?`MCP ${s}/${a}`:"MCP off",o=n?`${s} of ${a} MCP server(s) connected. Click to open Settings → MCP.`:"MCP tools disabled. Click to open Settings → MCP.";return g.jsxs("button",{type:"button",onClick:()=>r("mcp"),className:"inline-flex items-center gap-1.5 rounded-md border border-neutral-700 px-2 py-1 text-xs text-neutral-300 hover:border-neutral-500 hover:text-neutral-100",title:o,children:[g.jsx("span",{className:`h-2 w-2 rounded-full ${u}`}),d]})}const k1="forge.turnDiff.viewType";function mM(){try{return localStorage.getItem(k1)==="split"?"split":"unified"}catch{return"unified"}}function yM(){const e=Oe(b=>b.activeSessionId),r=Oe(b=>e!==void 0?b.agentEndCountBySession[e]??0:0),n=Oe(b=>e!==void 0?b.streamingBySession[e]??!1:!1),[s,a]=q.useState([]),[u,d]=q.useState(void 0),[o,c]=q.useState(!1),[h,m]=q.useState({}),[f,v]=q.useState(mM),w=b=>{v(b);try{localStorage.setItem(k1,b)}catch{}},A=async()=>{if(e!==void 0){c(!0),d(void 0);try{const b=await be.getTurnDiff(e);a(b.entries)}catch(b){b instanceof we&&b.status===404?a([]):(a([]),d(b instanceof we?b.code:b.message))}finally{c(!1)}}};return q.useEffect(()=>{a([]),d(void 0)},[e]),q.useEffect(()=>{e===void 0||n||A()},[e,r,n]),e===void 0?g.jsx("div",{className:"flex h-full items-center justify-center px-4 text-center text-xs italic text-neutral-500",children:"Pick a session to see its file changes."}):g.jsxs("div",{className:"flex h-full flex-col text-xs text-neutral-300",children:[g.jsxs("div",{className:"flex items-center justify-between border-b border-neutral-800 px-3 py-2",children:[g.jsxs("div",{className:"flex items-center gap-2 font-medium text-neutral-200",children:[g.jsx(Kb,{size:13}),"Last turn",s.length>0&&g.jsx("span",{className:"rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] text-neutral-400",children:s.length})]}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx("button",{onClick:()=>w(f==="split"?"unified":"split"),className:"rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200",title:f==="split"?"Switch to unified view":"Switch to side-by-side view",children:f==="split"?g.jsx(Cf,{size:13}):g.jsx(Af,{size:13})}),g.jsx("button",{onClick:()=>void A(),className:"rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200",title:"Refresh diff",children:g.jsx(po,{size:13,className:o?"animate-spin":""})})]})]}),u!==void 0&&g.jsx("div",{className:"border-b border-red-700/40 bg-red-900/20 px-3 py-1.5 text-[11px] text-red-300",children:u}),g.jsxs("div",{className:"flex-1 overflow-y-auto",children:[s.length===0&&g.jsx("p",{className:"px-3 py-3 italic text-neutral-500",children:o?"Loading…":u!==void 0?"Couldn't load the latest turn diff (see banner).":"No file changes from the most recent turn."}),s.map(b=>{const y=h[b.file]??!1,S=b.file.split("/").pop()??b.file;return g.jsxs("div",{className:"border-b border-neutral-800/60",children:[g.jsxs("button",{onClick:()=>m(_=>({..._,[b.file]:!y})),className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left hover:bg-neutral-900",title:b.file,children:[g.jsxs("span",{className:"flex min-w-0 items-baseline gap-2",children:[g.jsx("span",{className:"truncate font-mono text-neutral-200",children:S}),b.isPureAddition&&g.jsx("span",{className:"rounded bg-emerald-900/40 px-1 py-0.5 text-[9px] uppercase tracking-wider text-emerald-300",children:"new"})]}),g.jsxs("span",{className:"flex shrink-0 items-baseline gap-2 text-[11px]",children:[g.jsxs("span",{className:"text-emerald-400",children:["+",b.additions]}),g.jsxs("span",{className:"text-red-400",children:["−",b.deletions]})]})]}),y&&g.jsx(wp,{diff:b.diff,viewType:f})]},b.file)})]})]})}const vM=15e3;function N1(e){const[r,n]=q.useState(void 0),[s,a]=q.useState(void 0),u=Oe(m=>m.activeSessionId),d=Oe(m=>u!==void 0?m.streamingBySession[u]??!1:!1),o=Oe(m=>u!==void 0?m.agentEndCountBySession[u]??0:0),c=q.useRef(0),h=async()=>{if(e===void 0)return;const m=c.current,f=e;try{const v=await be.gitStatus(f);if(c.current!==m)return;n(v),a(void 0)}catch(v){if(c.current!==m)return;a(v instanceof we?v.code:v.message)}};return q.useEffect(()=>{c.current+=1,n(void 0),a(void 0)},[e]),q.useEffect(()=>{if(e===void 0)return;if(h(),d)return()=>{};const m=window.setInterval(()=>{h()},vM);return()=>{window.clearInterval(m)}},[e,d]),q.useEffect(()=>{e!==void 0&&o!==0&&h()},[e,u,o]),{status:r,error:s,refresh:h}}function bM(e){const r=[],n=[];for(const s of e){const a=r.slice();let u=r.findIndex(m=>m===s.hash);u===-1&&(u=r.findIndex(m=>m===void 0),u===-1&&(u=r.length,r.push(void 0)));const d=[];for(let m=0;m<r.length;m++)r[m]===s.hash&&d.push(m);for(const m of d)r[m]=void 0;const o=[];if(s.parents.length>0){const m=s.parents[0];r[u]=m,o.push({lane:u,parent:m})}for(let m=1;m<s.parents.length;m++){const f=s.parents[m];let v=r.findIndex(w=>w===f);v===-1&&(v=r.findIndex(w=>w===void 0),v===-1&&(v=r.length,r.push(void 0)),r[v]=f),o.push({lane:v,parent:f})}for(;r.length>0&&r[r.length-1]===void 0;)r.pop();const c=[];for(let m=0;m<a.length;m++)a[m]!==void 0&&m!==u&&(d.includes(m)||c.push(m));const h=Math.max(u+1,r.length,...d.map(m=>m+1),...o.map(m=>m.lane+1),...c.map(m=>m+1));n.push({hash:s.hash,lane:u,incomingLanes:d,outgoingLanes:o,through:c,width:h})}return n}const Ib=["#a5b4fc","#fde047","#a3e635","#f472b6","#67e8f9","#fb923c","#c084fc","#86efac"];function Va(e){return Ib[e%Ib.length]??"#a5b4fc"}function xM(){const e=hr(),{status:r,error:n,refresh:s}=N1(e==null?void 0:e.id),[a,u]=q.useState(""),[d,o]=q.useState(!1),[c,h]=q.useState(void 0),[m,f]=q.useState(void 0),[v,w]=q.useState(void 0),[A,b]=q.useState(void 0),[y,S]=q.useState(void 0),[_,x]=q.useState(!1),[E,N]=q.useState(!1),[T,j]=q.useState(!1),[R,D]=q.useState(void 0),[L,z]=q.useState(void 0),[U,P]=q.useState(void 0),[G,K]=q.useState(!1),[W,Y]=q.useState(""),[ne,F]=q.useState(""),[B,O]=q.useState(void 0),Q=async()=>{if(e!==void 0)try{const Z=await be.gitRemotes(e.id);S(Z.remotes)}catch(Z){h(Z instanceof we?Z.code:Z.message)}},M=async()=>{if(e===void 0)return;const Z=W.trim(),xe=ne.trim();if(!(Z.length===0||xe.length===0)){P(Z),h(void 0);try{await be.gitRemoteAdd(e.id,Z,xe),K(!1),Y(""),F(""),await Q()}catch(Qe){h(Qe instanceof we?Qe.message||Qe.code:Qe.message)}finally{P(void 0)}}},J=async()=>{if(e===void 0||B===void 0)return;const Z=B;O(void 0),P(Z),h(void 0);try{await be.gitRemoteRemove(e.id,Z),await Q()}catch(xe){h(xe instanceof we?xe.message||xe.code:xe.message)}finally{P(void 0)}},de=async()=>{if(e!==void 0)try{const Z=await be.gitBranches(e.id);b(Z.branches)}catch(Z){h(Z instanceof we?Z.code:Z.message)}},pe=async Z=>{if(e!==void 0){D(Z),h(void 0);try{await be.gitCheckout(e.id,Z),await de(),s()}catch(xe){h(xe instanceof we?xe.code:xe.message)}finally{D(void 0)}}},X=async Z=>{if(e!==void 0){z(void 0),D(Z),h(void 0);try{await be.gitBranchCreate(e.id,Z,{checkout:!0}),await de(),s()}catch(xe){h(xe instanceof we?xe.code:xe.message)}finally{D(void 0)}}},$=async Z=>{if(e===void 0||(L==null?void 0:L.kind)!=="delete")return;const{name:xe}=L;z(void 0),D(xe),h(void 0);try{await be.gitBranchDelete(e.id,xe,Z),await de()}catch(Qe){h(Qe instanceof we?Qe.code:Qe.message)}finally{D(void 0)}},[se,le]=q.useState({}),[te,ue]=q.useState(void 0),[Ae,Le]=q.useState(""),[Me,Pe]=q.useState(!1),[Be,jt]=q.useState(!1),[gt,Ce]=q.useState(()=>{try{return localStorage.getItem("forge.gitPanel.viewType")==="split"?"split":"unified"}catch{return"unified"}}),Kt=Z=>{Ce(Z);try{localStorage.setItem("forge.gitPanel.viewType",Z)}catch{}};if(q.useEffect(()=>{if(r===void 0)return;const Z=new Set(r.files.map(xe=>xe.path));le(xe=>{let Qe=!1;const Ct={};for(const[Gn,ie]of Object.entries(xe)){const Ne=Gn.split("|")[0]??"";Z.has(Ne)?Ct[Gn]=ie:Qe=!0}return Qe?Ct:xe})},[r]),q.useEffect(()=>{_&&e!==void 0&&be.gitLog(e.id,30).then(Z=>w(Z.commits)).catch(Z=>h(Z instanceof we?Z.code:Z.message))},[_,e==null?void 0:e.id]),q.useEffect(()=>{E&&e!==void 0&&be.gitBranches(e.id).then(Z=>b(Z.branches)).catch(Z=>h(Z instanceof we?Z.code:Z.message))},[E,e==null?void 0:e.id]),q.useEffect(()=>{T&&e!==void 0&&be.gitRemotes(e.id).then(Z=>S(Z.remotes)).catch(Z=>h(Z instanceof we?Z.code:Z.message))},[T,e==null?void 0:e.id]),e===void 0)return g.jsx("div",{className:"flex h-full items-center justify-center px-4 text-center text-xs italic text-neutral-500",children:"Pick a project to see its git status."});if((r==null?void 0:r.isGitRepo)===!1){const Z=async()=>{o(!0),h(void 0);try{await be.gitInit(e.id),await s()}catch(xe){h(xe instanceof we?xe.code:xe.message)}finally{o(!1)}};return g.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 px-4 text-center text-xs text-neutral-500",children:[g.jsxs("p",{className:"italic",children:[e.name," isn't a git repository."]}),g.jsx("button",{onClick:()=>void Z(),disabled:d,className:"rounded-md bg-neutral-100 px-3 py-1.5 text-xs font-medium text-neutral-900 hover:bg-white disabled:cursor-not-allowed disabled:opacity-50",title:"Run `git init -b main` in the project root",children:d?"Initializing…":"Initialize git repo"}),g.jsxs("p",{className:"text-[10px] text-neutral-600",children:["Default branch will be ",g.jsx("code",{className:"font-mono text-neutral-400",children:"main"}),"."]}),c!==void 0&&g.jsxs("p",{className:"text-[10px] text-red-400",children:["git init failed: ",c]})]})}const Mt=(r==null?void 0:r.files.filter(Z=>Z.staged))??[],st=(r==null?void 0:r.files.filter(Z=>Z.unstaged&&!Z.staged))??[],xt=(r==null?void 0:r.files.filter(Z=>Z.kind==="untracked"))??[],Pt=async(Z,xe)=>{const Qe=`${Z.path}|${xe?"staged":"unstaged"}`;if(se[Qe]!==void 0){le(Ct=>{const Gn={...Ct};return delete Gn[Qe],Gn});return}le(Ct=>({...Ct,[Qe]:"loading"}));try{const Ct=await be.gitDiffFile(e.id,Z.path,xe);le(Gn=>({...Gn,[Qe]:Ct.diff}))}catch{le(Ct=>({...Ct,[Qe]:"error"}))}},fe=async Z=>{if(Z.length!==0){o(!0),h(void 0);try{await be.gitStage(e.id,Z),await s()}catch(xe){h((xe instanceof we,xe.message))}finally{o(!1)}}},_e=async Z=>{if(Z.length!==0){o(!0),h(void 0),f(void 0);try{await be.gitRevert(e.id,Z),f(Z.length===1?`Reverted ${Z[0]}`:`Reverted ${Z.length} files`),await s()}catch(xe){h((xe instanceof we,xe.message))}finally{o(!1)}}},je=async Z=>{if(Z.length!==0){o(!0),h(void 0);try{await be.gitUnstage(e.id,Z),await s()}catch(xe){h((xe instanceof we,xe.message))}finally{o(!1)}}},Ue=async()=>{const Z=a.trim();if(Z.length!==0){o(!0),h(void 0),f(void 0);try{const{hash:xe}=await be.gitCommit(e.id,Z);if(u(""),f(`Committed ${xe.slice(0,7)}`),await s(),_){const Qe=await be.gitLog(e.id,30);w(Qe.commits)}}catch(xe){h((xe instanceof we,xe.message))}finally{o(!1)}}},$e=(()=>{if(y!==void 0)return y.map(xe=>xe.name).sort();if(A===void 0)return[];const Z=new Set;for(const xe of A){if(!xe.remote)continue;const Qe=xe.name.indexOf("/");Qe>0&&Z.add(xe.name.slice(0,Qe))}return Array.from(Z).sort()})(),Tt=A===void 0?[]:A.filter(Z=>!Z.remote).map(Z=>Z.name).sort(),Ye=async()=>{o(!0),h(void 0),f(void 0);try{const Z={};te!==void 0&&(Z.remote=te);const{output:xe}=await be.gitFetch(e.id,Z);f(xe.trim().length>0?xe.trim().split(`
|
|
389
|
+
`).pop()??"Fetched":"Fetched")}catch(Z){h((Z instanceof we,Z.message))}finally{o(!1)}},Ot=async()=>{o(!0),h(void 0),f(void 0);try{const Z={};te!==void 0&&(Z.remote=te);const xe=Ae.trim();xe.length>0&&(Z.branch=xe);const{output:Qe}=await be.gitPull(e.id,Z);f(Qe.trim().length>0?Qe.trim().split(`
|
|
390
|
+
`).pop()??"Pulled":"Pulled"),s()}catch(Z){h((Z instanceof we,Z.message))}finally{o(!1)}},Dt=async()=>{o(!0),h(void 0),f(void 0);try{const Z={};te!==void 0&&(Z.remote=te);const xe=Ae.trim();xe.length>0&&(Z.branch=xe),Me&&(Z.setUpstream=!0);const{output:Qe}=await be.gitPush(e.id,Z);f(Qe.trim().length>0?Qe.trim().split(`
|
|
391
|
+
`).pop()??"Pushed":"Pushed"),Me&&Pe(!1)}catch(Z){h((Z instanceof we,Z.message))}finally{o(!1)}};return g.jsxs("div",{className:"flex h-full flex-col text-xs text-neutral-300",children:[g.jsxs("div",{className:"flex items-center justify-between border-b border-neutral-800 px-3 py-2",children:[g.jsxs("div",{className:"flex items-center gap-2 font-medium text-neutral-200",children:[g.jsx(ho,{size:13}),(r==null?void 0:r.branch)??"—",r!==void 0&&r.files.length>0&&g.jsx("span",{className:"rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] text-neutral-400",children:r.files.length})]}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx("button",{onClick:()=>Kt(gt==="split"?"unified":"split"),className:"rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200",title:gt==="split"?"Switch git diffs to unified view":"Switch git diffs to side-by-side view",children:gt==="split"?g.jsx(Cf,{size:13}):g.jsx(Af,{size:13})}),g.jsx("button",{onClick:()=>void s(),className:"rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200",title:"Refresh",children:g.jsx(po,{size:13,className:d?"animate-spin":""})})]})]}),(n!==void 0||c!==void 0)&&g.jsx("div",{className:"border-b border-red-700/40 bg-red-900/20 px-3 py-1.5 text-[11px] text-red-300",children:c??n}),m!==void 0&&g.jsx("div",{className:"border-b border-emerald-700/40 bg-emerald-900/20 px-3 py-1.5 text-[11px] text-emerald-300",children:m}),g.jsxs("div",{className:"flex-1 overflow-y-auto",children:[r===void 0&&g.jsx("p",{className:"px-3 py-3 italic text-neutral-500",children:"Loading…"}),(r==null?void 0:r.files.length)===0&&g.jsx("p",{className:"px-3 py-3 italic text-neutral-500",children:"Working tree clean."}),Mt.length>0&&g.jsx(Ph,{label:"Staged",files:Mt,actionLabel:"Unstage all",onGroupAction:()=>void je(Mt.map(Z=>Z.path)),onFileAction:Z=>void je([Z.path]),fileActionLabel:"Unstage",onRevert:Z=>void _e([Z.path]),onClickFile:Z=>void Pt(Z,!0),openDiffs:se,staged:!0,diffViewType:gt}),st.length>0&&g.jsx(Ph,{label:"Unstaged",files:st,actionLabel:"Stage all",onGroupAction:()=>void fe(st.map(Z=>Z.path)),onFileAction:Z=>void fe([Z.path]),fileActionLabel:"Stage",onRevert:Z=>void _e([Z.path]),onClickFile:Z=>void Pt(Z,!1),openDiffs:se,staged:!1,diffViewType:gt}),xt.length>0&&g.jsx(Ph,{label:"Untracked",files:xt,actionLabel:"Stage all",onGroupAction:()=>void fe(xt.map(Z=>Z.path)),onFileAction:Z=>void fe([Z.path]),fileActionLabel:"Stage",onRevert:void 0,onClickFile:Z=>void Pt(Z,!1),openDiffs:se,staged:!1,diffViewType:gt}),g.jsxs("div",{className:"border-t border-neutral-800/60 px-3 py-3",children:[g.jsxs("div",{className:"mb-1 flex items-center gap-1 text-[10px] uppercase tracking-wider text-neutral-500",children:[g.jsx(LA,{size:10})," Commit"]}),g.jsx("textarea",{value:a,onChange:Z=>u(Z.target.value),placeholder:"Commit message…",rows:3,className:"w-full resize-none rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-xs text-neutral-100 outline-none focus:border-neutral-500"}),g.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2",children:[g.jsxs("span",{className:"text-[10px] text-neutral-500",children:[Mt.length," staged"]}),g.jsx("button",{onClick:()=>void Ue(),disabled:d||Mt.length===0||a.trim().length===0,className:"rounded bg-neutral-100 px-3 py-1 text-xs font-medium text-neutral-900 disabled:cursor-not-allowed disabled:opacity-50",children:"Commit"})]})]}),g.jsxs("div",{className:"border-t border-neutral-800/60 px-3 py-3",children:[g.jsxs("div",{className:"mb-1 flex items-center justify-between gap-1 text-[10px] uppercase tracking-wider text-neutral-500",children:[g.jsxs("span",{className:"flex items-center gap-1",children:[g.jsx(Ef,{size:10})," Push"]}),g.jsx("button",{onClick:()=>{jt(Z=>!Z),!Be&&A===void 0&&be.gitBranches(e.id).then(Z=>b(Z.branches)).catch(()=>{}),!Be&&y===void 0&&be.gitRemotes(e.id).then(Z=>S(Z.remotes)).catch(()=>{})},className:"rounded px-1 py-0.5 text-[10px] normal-case text-neutral-400 hover:bg-neutral-900 hover:text-neutral-200",children:Be?"Hide options":"Options"})]}),Be&&g.jsxs("div",{className:"mb-2 space-y-1.5 rounded border border-neutral-800 bg-neutral-900/40 p-2",children:[g.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[g.jsx("span",{className:"w-16 shrink-0 text-neutral-400",children:"Remote"}),$e.length>0?g.jsxs("select",{value:te??"",onChange:Z=>ue(Z.target.value===""?void 0:Z.target.value),className:"flex-1 rounded border border-neutral-700 bg-neutral-950 px-1 py-0.5 text-[11px] text-neutral-100 outline-none focus:border-neutral-500",children:[g.jsx("option",{value:"",children:"configured upstream"}),$e.map(Z=>g.jsx("option",{value:Z,children:Z},Z))]}):g.jsx("input",{type:"text",value:te??"",onChange:Z=>ue(Z.target.value.length===0?void 0:Z.target.value),placeholder:"origin",className:"flex-1 rounded border border-neutral-700 bg-neutral-950 px-1 py-0.5 text-[11px] text-neutral-100 outline-none focus:border-neutral-500"})]}),g.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[g.jsx("span",{className:"w-16 shrink-0 text-neutral-400",children:"Branch"}),Tt.length>0?g.jsxs("select",{value:Ae,onChange:Z=>Le(Z.target.value),className:"flex-1 rounded border border-neutral-700 bg-neutral-950 px-1 py-0.5 text-[11px] text-neutral-100 outline-none focus:border-neutral-500",children:[g.jsx("option",{value:"",children:(r==null?void 0:r.branch)??"current branch"}),Tt.map(Z=>g.jsx("option",{value:Z,children:Z},Z))]}):g.jsx("input",{type:"text",value:Ae,onChange:Z=>Le(Z.target.value),placeholder:(r==null?void 0:r.branch)??"current",className:"flex-1 rounded border border-neutral-700 bg-neutral-950 px-1 py-0.5 text-[11px] text-neutral-100 outline-none focus:border-neutral-500"})]}),g.jsxs("label",{className:"flex items-center gap-2 text-[11px] text-neutral-300",children:[g.jsx("input",{type:"checkbox",checked:Me,onChange:Z=>Pe(Z.target.checked),className:"h-3 w-3"}),g.jsx("span",{children:"Set upstream (first push of a new branch)"})]})]}),g.jsxs("div",{className:"flex gap-1",children:[g.jsx("button",{onClick:()=>void Ye(),disabled:d,className:"flex-1 rounded border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:border-neutral-500 disabled:opacity-50",title:te!==void 0?`git fetch ${te}`:"git fetch (configured upstream)",children:"Fetch"}),g.jsx("button",{onClick:()=>void Ot(),disabled:d,className:"flex-1 rounded border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:border-neutral-500 disabled:opacity-50",title:"git pull — conflicts surface in the error banner; resolve via the integrated terminal",children:"Pull"}),g.jsx("button",{onClick:()=>void Dt(),disabled:d,className:"flex-1 rounded border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:border-neutral-500 disabled:opacity-50",title:te===void 0&&Ae.trim().length===0?"git push (configured upstream)":`git push ${te??"(upstream)"}${Ae.trim().length>0?` ${Ae.trim()}`:""}`,children:"Push"})]})]}),g.jsxs("div",{className:"border-t border-neutral-800/60",children:[g.jsxs("button",{onClick:()=>x(Z=>!Z),className:"flex w-full items-center justify-between px-3 py-2 text-left text-[10px] uppercase tracking-wider text-neutral-400 hover:bg-neutral-900",children:[g.jsx("span",{children:"Log"}),g.jsx("span",{children:_?"−":"+"})]}),_&&g.jsx("div",{className:"px-3 pb-3 text-[11px]",children:v===void 0?g.jsx("p",{className:"italic text-neutral-500",children:"Loading…"}):v.length===0?g.jsx("p",{className:"italic text-neutral-500",children:"No commits yet."}):g.jsx(wM,{commits:v})})]}),g.jsxs("div",{className:"border-t border-neutral-800/60",children:[g.jsxs("button",{onClick:()=>N(Z=>!Z),className:"flex w-full items-center justify-between px-3 py-2 text-left text-[10px] uppercase tracking-wider text-neutral-400 hover:bg-neutral-900",children:[g.jsx("span",{children:"Branches"}),g.jsx("span",{children:E?"−":"+"})]}),E&&g.jsx("div",{className:"px-3 pb-3 text-[11px]",children:A===void 0?g.jsx("p",{className:"italic text-neutral-500",children:"Loading…"}):g.jsxs(g.Fragment,{children:[g.jsx("ul",{className:"space-y-0.5",children:A.map(Z=>{const xe=R===Z.name;return g.jsxs("li",{className:`group flex items-center gap-1 rounded px-1 py-0.5 font-mono hover:bg-neutral-900 ${Z.current?"text-emerald-400":"text-neutral-300"}`,children:[g.jsx("span",{className:"w-3 shrink-0",children:Z.current?g.jsx(wf,{size:10}):null}),g.jsx("span",{className:"flex-1 truncate",title:Z.name,children:Z.name}),Z.remote&&g.jsx("span",{className:"ml-1 text-[10px] text-neutral-600",children:"remote"}),!Z.current&&g.jsxs("div",{className:"hidden gap-0.5 group-hover:flex",children:[g.jsx("button",{onClick:()=>void pe(Z.name),disabled:xe,className:"rounded px-1 py-0.5 text-[10px] text-neutral-400 hover:bg-neutral-800 hover:text-neutral-100 disabled:opacity-40",title:Z.remote?`Checkout (creates a tracking branch from ${Z.name})`:`Checkout ${Z.name}`,children:"checkout"}),!Z.remote&&g.jsx("button",{onClick:()=>z({kind:"delete",name:Z.name}),disabled:xe,className:"rounded p-0.5 text-neutral-500 hover:bg-red-900/30 hover:text-red-300 disabled:opacity-40",title:"Delete branch",children:g.jsx(Qh,{size:10})})]})]},Z.name)})}),g.jsxs("button",{onClick:()=>z({kind:"create"}),className:"mt-2 flex items-center gap-1 rounded px-1 py-0.5 text-[11px] text-neutral-400 hover:bg-neutral-900 hover:text-neutral-100",children:[g.jsx(no,{size:10})," New branch"]})]})})]}),g.jsxs("div",{className:"border-t border-neutral-800/60",children:[g.jsxs("button",{onClick:()=>j(Z=>!Z),className:"flex w-full items-center justify-between px-3 py-2 text-left text-[10px] uppercase tracking-wider text-neutral-400 hover:bg-neutral-900",children:[g.jsx("span",{children:"Remotes"}),g.jsx("span",{children:T?"−":"+"})]}),T&&g.jsx("div",{className:"px-3 pb-3 text-[11px]",children:y===void 0?g.jsx("p",{className:"italic text-neutral-500",children:"Loading…"}):g.jsxs(g.Fragment,{children:[y.length===0?g.jsx("p",{className:"italic text-neutral-500",children:"No remotes configured."}):g.jsx("ul",{className:"space-y-1",children:y.map(Z=>{const xe=Z.fetchUrl!==Z.pushUrl,Qe=U===Z.name;return g.jsxs("li",{className:"group flex flex-col gap-0.5",children:[g.jsxs("div",{className:"flex items-baseline gap-2",children:[g.jsx("span",{className:"font-mono text-neutral-200",children:Z.name}),xe&&g.jsx("span",{className:"rounded bg-amber-900/30 px-1 py-0.5 text-[9px] uppercase tracking-wider text-amber-300",children:"fetch ≠ push"}),g.jsx("button",{onClick:()=>O(Z.name),disabled:Qe,className:"ml-auto hidden rounded p-0.5 text-neutral-500 hover:bg-red-900/30 hover:text-red-300 disabled:opacity-40 group-hover:inline-flex",title:`Remove remote "${Z.name}"`,children:g.jsx(Qh,{size:10})})]}),g.jsx("span",{className:"break-all font-mono text-[10px] text-neutral-500",title:Z.fetchUrl,children:Z.fetchUrl}),xe&&g.jsxs("span",{className:"break-all font-mono text-[10px] text-neutral-500",title:`push → ${Z.pushUrl}`,children:["push → ",Z.pushUrl]})]},Z.name)})}),g.jsxs("button",{onClick:()=>{Y(""),F(""),K(!0)},className:"mt-2 flex items-center gap-1 rounded px-1 py-0.5 text-[11px] text-neutral-400 hover:bg-neutral-900 hover:text-neutral-100",children:[g.jsx(no,{size:10})," Add remote"]})]})})]})]}),g.jsx(cx,{open:(L==null?void 0:L.kind)==="create",onClose:()=>z(void 0),onSubmit:Z=>void X(Z),title:"New branch",label:"Branch name",placeholder:"feature/my-change",primaryLabel:"Create + checkout"}),g.jsx(ro,{open:(L==null?void 0:L.kind)==="delete",onClose:()=>z(void 0),onConfirm:()=>void $(!1),title:"Delete branch",message:(L==null?void 0:L.kind)==="delete"?`Delete branch "${L.name}"? Refused if not merged into HEAD; force-delete from the terminal if you really mean it.`:"",primaryLabel:"Delete",tone:"danger"}),g.jsx(go,{open:G,onClose:()=>K(!1),title:"Add remote",children:g.jsxs("form",{onSubmit:Z=>{Z.preventDefault(),M()},className:"flex flex-col gap-3 px-4 py-3",children:[g.jsxs("label",{className:"block space-y-1.5",children:[g.jsx("span",{className:"text-xs text-neutral-300",children:"Name"}),g.jsx("input",{type:"text",value:W,onChange:Z=>Y(Z.target.value),placeholder:"origin",autoFocus:!0,className:"w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-1.5 font-mono text-sm text-neutral-100 outline-none focus:border-neutral-500"})]}),g.jsxs("label",{className:"block space-y-1.5",children:[g.jsx("span",{className:"text-xs text-neutral-300",children:"URL"}),g.jsx("input",{type:"text",value:ne,onChange:Z=>F(Z.target.value),placeholder:"git@github.com:user/repo.git",className:"w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-1.5 font-mono text-sm text-neutral-100 outline-none focus:border-neutral-500"})]}),g.jsxs("footer",{className:"flex justify-end gap-2 pt-1",children:[g.jsx("button",{type:"button",onClick:()=>K(!1),className:"rounded-md border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:bg-neutral-800",children:"Cancel"}),g.jsx("button",{type:"submit",disabled:W.trim().length===0||ne.trim().length===0,className:"rounded-md bg-neutral-100 px-3 py-1 text-xs font-medium text-neutral-900 hover:bg-white disabled:cursor-not-allowed disabled:opacity-40",children:"Add"})]})]})}),g.jsx(ro,{open:B!==void 0,onClose:()=>O(void 0),onConfirm:()=>void J(),title:"Remove remote",message:B!==void 0?`Remove remote "${B}"? The local repo loses its reference to this URL; existing commits aren't affected.`:"",primaryLabel:"Remove",tone:"danger"})]})}const _M=3e3;function Ph(e){const[r,n]=q.useState(void 0),s=q.useRef(void 0),a=()=>{s.current!==void 0&&(window.clearTimeout(s.current),s.current=void 0),n(void 0)};q.useEffect(()=>()=>{s.current!==void 0&&window.clearTimeout(s.current)},[]);const u=d=>{if(e.onRevert!==void 0){if(r===d.path){a(),e.onRevert(d);return}s.current!==void 0&&window.clearTimeout(s.current),n(d.path),s.current=window.setTimeout(()=>{n(void 0),s.current=void 0},_M)}};return g.jsxs("div",{className:"border-t border-neutral-800/60",children:[g.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5",children:[g.jsxs("span",{className:"text-[10px] uppercase tracking-wider text-neutral-500",children:[e.label," (",e.files.length,")"]}),g.jsx("button",{onClick:e.onGroupAction,className:"text-[10px] text-neutral-400 hover:text-neutral-200",children:e.actionLabel})]}),g.jsx("ul",{children:e.files.map(d=>{const o=`${d.path}|${e.staged?"staged":"unstaged"}`,c=e.openDiffs[o],h=r===d.path;return g.jsxs("li",{className:"border-t border-neutral-900",children:[g.jsxs("div",{className:"group flex items-center gap-2 px-3 py-1 hover:bg-neutral-900",children:[g.jsx("span",{className:"inline-block w-5 shrink-0 text-center font-mono text-[10px] text-neutral-500",title:`porcelain code: ${d.code}`,children:SM(d.kind)}),g.jsx("button",{onClick:()=>e.onClickFile(d),className:"flex-1 truncate text-left font-mono",title:d.path,children:d.path}),e.onRevert!==void 0&&g.jsxs("button",{onClick:()=>u(d),className:h?"inline-flex items-center gap-1 rounded bg-red-900/40 px-1 py-0.5 text-[10px] text-red-200":"hidden items-center gap-1 text-[10px] text-neutral-500 hover:text-red-300 group-hover:inline-flex",title:h?"Click again to discard local changes (this cannot be undone)":"Revert: discard local changes for this file",children:[g.jsx(dC,{size:10}),h?"Confirm?":"Revert"]}),g.jsxs("button",{onClick:()=>e.onFileAction(d),className:"ml-3 hidden items-center gap-1 text-[10px] text-neutral-500 hover:text-neutral-200 group-hover:inline-flex",children:[e.fileActionLabel==="Stage"?g.jsx(no,{size:10}):e.fileActionLabel==="Unstage"?g.jsx(qA,{size:10}):null,e.fileActionLabel]})]}),c!==void 0&&g.jsx("div",{className:"border-t border-neutral-900 bg-neutral-950",children:c==="loading"?g.jsx("p",{className:"px-3 py-2 italic text-neutral-500",children:"Loading…"}):c==="error"?g.jsx("p",{className:"px-3 py-2 text-red-400",children:"Failed to load diff."}):c.length===0?g.jsx("p",{className:"px-3 py-2 italic text-neutral-500",children:"(no diff — file is binary or unchanged)"}):g.jsx(wp,{diff:c,viewType:e.diffViewType})})]},d.path)})})]})}function SM(e){switch(e){case"modified":return"M";case"added":return"A";case"deleted":return"D";case"renamed":return"R";case"copied":return"C";case"untracked":return"?";case"ignored":return"!";case"conflicted":return"U";default:return"·"}}const Xn=14,T1=36;function wM({commits:e}){const r=bM(e),n=Math.max(1,...r.map(s=>s.width));return g.jsx("ul",{className:"space-y-0",children:e.map((s,a)=>{const u=r[a];return u===void 0?null:g.jsxs("li",{className:"group flex items-stretch",children:[g.jsx(AM,{layout:u,isLast:a===r.length-1,maxLanes:n}),g.jsxs("div",{className:"flex flex-col justify-center gap-0.5 pl-2",style:{minHeight:T1},children:[g.jsxs("div",{className:"flex items-baseline gap-2",children:[g.jsx("span",{className:"font-mono text-neutral-500",children:s.hash.slice(0,7)}),s.refs.map((d,o)=>g.jsx(CM,{ref_:d},`${o}-${d}`)),g.jsx("span",{className:"truncate text-neutral-200",title:s.message,children:s.message})]}),g.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[s.author," · ",new Date(s.date).toLocaleString()]})]})]},s.hash)})})}function AM({layout:e,isLast:r,maxLanes:n}){const s=n*Xn,a=T1,u=e.lane*Xn+Xn/2,d=a/2,o=[];for(const c of e.through){const h=c*Xn+Xn/2;o.push({x1:h,y1:0,x2:h,y2:a,color:Va(c)})}for(const c of e.incomingLanes){const h=c*Xn+Xn/2;o.push({x1:h,y1:0,x2:u,y2:d,color:Va(c)})}if(!r)for(const c of e.outgoingLanes){const h=c.lane*Xn+Xn/2;o.push({x1:u,y1:d,x2:h,y2:a,color:Va(c.lane)})}if(r&&e.outgoingLanes.length>0)for(const c of e.outgoingLanes){const h=c.lane*Xn+Xn/2;o.push({x1:u,y1:d,x2:h,y2:d+6,color:Va(c.lane)})}return g.jsxs("svg",{width:s,height:a,viewBox:`0 0 ${s} ${a}`,className:"shrink-0","aria-hidden":!0,children:[o.map((c,h)=>g.jsx("line",{x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:c.color,strokeWidth:1.5,strokeLinecap:"round"},h)),g.jsx("circle",{cx:u,cy:d,r:3.5,fill:Va(e.lane)})]})}function CM({ref_:e}){const r=e.startsWith("HEAD ->")||e==="HEAD",n=e.startsWith("tag:"),s=r?e.replace(/^HEAD ->\s*/,""):n?e.replace(/^tag:\s*/,""):e,a=r?"bg-emerald-900/40 text-emerald-300":n?"bg-amber-900/40 text-amber-300":e.includes("/")?"bg-neutral-800 text-neutral-500":"bg-neutral-800 text-neutral-300";return g.jsx("span",{className:`shrink-0 rounded px-1.5 py-0 text-[9px] uppercase tracking-wider ${a}`,children:n?`▼ ${s}`:s})}const EM=250,dc=2,R1=200;function kM(){const e=hr(),r=ft(D=>D.openFile),[n,s]=q.useState(""),[a,u]=q.useState(!1),[d,o]=q.useState(!1),[c,h]=q.useState(!1),[m,f]=q.useState(""),[v,w]=q.useState(""),[A,b]=q.useState(!1),[y,S]=q.useState(void 0),[_,x]=q.useState(!1),[E,N]=q.useState(void 0),T=q.useRef(void 0),j=q.useCallback(async D=>{var z;if(e===void 0)return;if(D.length<dc){S(void 0),N(void 0);return}(z=T.current)==null||z.abort();const L=new AbortController;T.current=L,x(!0),N(void 0);try{const U={query:D,regex:a,caseSensitive:d,includeGitignored:c,limit:R1,...m.length>0?{include:m}:{},...v.length>0?{exclude:v}:{}},P=await be.searchFiles(e.id,U,L.signal);if(L.signal.aborted)return;S(P)}catch(U){if(L.signal.aborted||U instanceof Error&&U.name==="AbortError")return;U instanceof we&&U.code==="invalid_response_body"?N("server returned an unexpected response"):U instanceof Error?N(U.message):N("search failed"),S(void 0)}finally{L.signal.aborted||x(!1)}},[e,a,d,c,m,v]);q.useEffect(()=>{const D=window.setTimeout(()=>void j(n),EM);return()=>window.clearTimeout(D)},[n,j]),q.useEffect(()=>()=>{var D;(D=T.current)==null||D.abort()},[]);const R=q.useMemo(()=>TM((y==null?void 0:y.matches)??[]),[y]);return e===void 0?g.jsx("div",{className:"p-4 text-xs italic text-neutral-500",children:"Select a project to search its files."}):g.jsxs("div",{className:"flex h-full flex-col",children:[g.jsxs("div",{className:"border-b border-neutral-800 bg-neutral-900/40 p-2",children:[g.jsxs("div",{className:"relative",children:[g.jsx(Xb,{size:12,className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-neutral-500"}),g.jsx("input",{type:"text",value:n,onChange:D=>s(D.target.value),placeholder:a?"Regex…":"Search project…",className:"w-full rounded border border-neutral-700 bg-neutral-900 py-1.5 pl-7 pr-2 text-xs text-neutral-100 placeholder:text-neutral-500 focus:border-neutral-500 focus:outline-none",autoFocus:!0})]}),g.jsxs("div",{className:"mt-2 flex flex-wrap gap-1",children:[g.jsx(Hh,{label:"Regex",active:a,onClick:()=>u(D=>!D)}),g.jsx(Hh,{label:"Aa",title:"Case sensitive",active:d,onClick:()=>o(D=>!D)}),g.jsx(Hh,{label:"+ignored",title:"Include files that .gitignore would normally skip",active:c,onClick:()=>h(D=>!D)}),g.jsxs("button",{onClick:()=>b(D=>!D),className:"ml-auto flex items-center gap-1 rounded border border-neutral-700 px-1.5 py-0.5 text-[10px] text-neutral-400 hover:border-neutral-500",children:[A?g.jsx(ur,{size:10}):g.jsx(dr,{size:10}),"Globs"]})]}),A&&g.jsxs("div",{className:"mt-2 grid grid-cols-1 gap-1.5",children:[g.jsx("input",{type:"text",value:m,onChange:D=>f(D.target.value),placeholder:"include glob — e.g. **/*.ts",className:"rounded border border-neutral-700 bg-neutral-900 px-2 py-1 text-[11px] text-neutral-200 placeholder:text-neutral-500 focus:border-neutral-500 focus:outline-none"}),g.jsx("input",{type:"text",value:v,onChange:D=>w(D.target.value),placeholder:"exclude glob — e.g. **/dist/**",className:"rounded border border-neutral-700 bg-neutral-900 px-2 py-1 text-[11px] text-neutral-200 placeholder:text-neutral-500 focus:border-neutral-500 focus:outline-none"})]})]}),g.jsxs("div",{className:"flex-1 overflow-auto",children:[g.jsx(RM,{query:n,loading:_,error:E,results:y,totalFiles:R.length}),g.jsx("ul",{className:"divide-y divide-neutral-900",children:R.map(([D,L])=>g.jsx(jM,{path:D,matches:L,onPick:z=>void r(e.id,NM(e.path,D),{line:z.line,column:z.column})},D))})]})]})}function NM(e,r){if(r.startsWith("/"))return r;const n=e.endsWith("/")?"":"/";return`${e}${n}${r}`}function TM(e){const r=new Map;for(const n of e){const s=r.get(n.path);s===void 0?r.set(n.path,[n]):s.push(n)}return Array.from(r.entries())}function Hh({label:e,title:r,active:n,onClick:s}){return g.jsx("button",{onClick:s,title:r,className:`rounded border px-1.5 py-0.5 text-[10px] ${n?"border-neutral-500 bg-neutral-800 text-neutral-100":"border-neutral-700 text-neutral-400 hover:border-neutral-500"}`,children:e})}function RM({query:e,loading:r,error:n,results:s,totalFiles:a}){return e.length===0?g.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center text-xs text-neutral-500",children:[g.jsx(NA,{size:20,className:"text-neutral-700"}),g.jsx("p",{children:"Type to search across project files."}),g.jsxs("p",{className:"text-[10px] text-neutral-600",children:["Min ",dc," chars · Click a result to jump to that line."]})]}):e.length<dc?g.jsxs("div",{className:"px-4 py-3 text-xs italic text-neutral-500",children:["Keep typing — at least ",dc," characters."]}):r&&s===void 0?g.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 text-xs text-neutral-400",children:[g.jsx(fo,{size:12,className:"animate-spin"})," Searching…"]}):n!==void 0?g.jsx("div",{className:"px-4 py-3 text-xs text-rose-400",children:n}):s===void 0?null:s.matches.length===0?g.jsx("div",{className:"px-4 py-3 text-xs italic text-neutral-500",children:"No matches."}):g.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-neutral-800 bg-neutral-950/60 px-3 py-1.5 text-[10px]",children:[g.jsxs("span",{className:"text-neutral-400",children:[s.matches.length," match",s.matches.length===1?"":"es"," in ",a," ","file",a===1?"":"s",s.truncated&&g.jsxs("span",{className:"ml-1 text-amber-400",children:["· truncated at ",R1]})]}),s.engine==="node"&&g.jsx("span",{className:"rounded bg-amber-900/40 px-1.5 py-0.5 text-[9px] uppercase tracking-wider text-amber-300",title:"ripgrep was not found on this host — using the slower in-process fallback",children:"fallback"})]})}function jM({path:e,matches:r,onPick:n}){const[s,a]=q.useState(!0);return g.jsxs("li",{className:"bg-neutral-950",children:[g.jsxs("button",{onClick:()=>a(u=>!u),className:"flex w-full items-center gap-1 truncate px-2 py-1 text-left text-[11px] text-neutral-300 hover:bg-neutral-900",title:e,children:[s?g.jsx(ur,{size:11}):g.jsx(dr,{size:11}),g.jsx("span",{className:"truncate font-mono",children:e}),g.jsx("span",{className:"ml-auto text-[10px] text-neutral-500",children:r.length})]}),s&&g.jsx("ul",{children:r.map((u,d)=>g.jsx("li",{children:g.jsxs("button",{onClick:()=>n(u),className:"flex w-full gap-2 px-2 py-0.5 text-left font-mono text-[11px] text-neutral-400 hover:bg-neutral-900 hover:text-neutral-100",title:`${e}:${u.line}:${u.column}`,children:[g.jsx("span",{className:"w-10 shrink-0 text-right text-neutral-600",children:u.line}),g.jsx("span",{className:"truncate",children:DM(u.lineSnippet,u.column,u.length)})]})},`${u.line}:${u.column}:${d}`))})]})}function DM(e,r,n){const s=Math.max(0,Math.min(e.length,r-1)),a=Math.max(s,Math.min(e.length,s+n)),u=e.length-e.trimStart().length,d=Math.min(u,s),o=e.slice(d,s),c=e.slice(s,a),h=e.slice(a);return n===0||c.length===0?g.jsx("span",{children:e.slice(d)}):g.jsxs("span",{children:[g.jsx("span",{children:o}),g.jsx("span",{className:"bg-amber-700/30 text-amber-100",children:c}),g.jsx("span",{children:h})]})}function BM(){const e=Oe(N=>N.activeSessionId),r=Oe(N=>e!==void 0?N.agentEndCountBySession[e]??0:0),n=Oe(N=>e!==void 0?N.compactionEndCountBySession[e]??0:0),s=Oe(N=>e!==void 0?N.streamingBySession[e]??!1:!1),a=Oe(N=>e!==void 0?N.streamingTextBySession[e]??"":""),[u,d]=q.useState(void 0),[o,c]=q.useState(!1),[h,m]=q.useState(void 0),[f,v]=q.useState(!1),[w,A]=q.useState(!1),[b,y]=q.useState(""),[S,_]=q.useState(void 0),x=q.useRef(void 0),E=async()=>{var T;if(e===void 0){d(void 0);return}(T=x.current)==null||T.abort();const N=new AbortController;x.current=N,c(!0),m(void 0);try{const j=await be.getSessionContext(e,N.signal);if(N.signal.aborted)return;d(j)}catch(j){if(N.signal.aborted||j instanceof Error&&j.name==="AbortError")return;j instanceof we&&j.status===404?(d(void 0),m(void 0)):m(j instanceof we?j.code:j.message)}finally{N.signal.aborted||c(!1)}};return q.useEffect(()=>{E()},[e,r,n]),q.useEffect(()=>()=>{var N;(N=x.current)==null||N.abort()},[]),e===void 0?g.jsx("div",{className:"flex h-full items-center justify-center px-4 py-6 text-center text-xs italic text-neutral-500",children:"Select a session to inspect its context."}):g.jsxs("div",{className:"flex h-full flex-col bg-neutral-950 text-xs text-neutral-200",children:[g.jsxs("div",{className:"flex items-center justify-between border-b border-neutral-800 bg-neutral-900/40 px-3 py-1.5",children:[g.jsx("span",{className:"text-[10px] uppercase tracking-wider text-neutral-400",children:"Context inspector"}),g.jsxs("div",{className:"flex items-center gap-1",children:[o&&g.jsx(fo,{size:11,className:"animate-spin text-neutral-500"}),g.jsx("button",{onClick:()=>void E(),disabled:o,className:"rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200 disabled:opacity-40",title:"Refresh",children:g.jsx(po,{size:11,className:o?"animate-spin":""})})]})]}),h!==void 0&&g.jsx("div",{className:"border-b border-red-700/40 bg-red-900/20 px-3 py-1.5 text-[11px] text-red-300",children:h}),g.jsx("div",{className:"flex-1 overflow-y-auto",children:u===void 0?g.jsx("div",{className:"px-4 py-6 text-center text-xs italic text-neutral-500",children:o?"Loading…":"No data — try refresh."}):g.jsxs(g.Fragment,{children:[g.jsx(IM,{data:u,turnsExpanded:f,onToggleTurns:()=>v(N=>!N)}),g.jsx(zM,{messages:u.messages,showThinking:w,onToggleThinking:()=>A(N=>!N),onViewRaw:(N,T)=>_({index:N,payload:T}),search:b,onSearchChange:y,...s&&a.length>0?{streamingTail:{content:a}}:{}})]})}),S!==void 0&&g.jsx(PM,{title:`Message ${S.index} — raw AgentMessage JSON`,payload:S.payload,onClose:()=>_(void 0)})]})}function IM({data:e,turnsExpanded:r,onToggleTurns:n}){const s=e.contextUsage,a=q.useMemo(()=>MM(e.messages,s.tokens),[e.messages,s.tokens]),u=q.useMemo(()=>UM(e.messages,e.turns),[e.messages,e.turns]),d=s.tokens??a.total,o=s.contextWindow>0?Math.min(1,d/s.contextWindow):0,c=s.tokens===void 0?"estimate":"current";return g.jsxs("div",{className:"space-y-2 border-b border-neutral-800 px-3 py-2",children:[g.jsxs("div",{children:[g.jsxs("div",{className:"mb-1 flex items-center justify-between text-[10px] text-neutral-400",children:[g.jsxs("span",{children:["Context window (",c,")"]}),g.jsxs("span",{children:[Zt(d)," /"," ",s.contextWindow>0?Zt(s.contextWindow):"unknown",s.contextWindow>0&&g.jsxs("span",{className:"ml-1 text-neutral-600",children:["(",(o*100).toFixed(1),"%)"]})]})]}),g.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded bg-neutral-800",children:g.jsx("div",{className:`h-full ${o>.9?"bg-red-500":o>.7?"bg-amber-500":"bg-emerald-500"}`,style:{width:`${Math.max(2,Math.min(100,o*100))}%`}})})]}),g.jsx(LM,{breakdown:a,contextWindow:s.contextWindow}),g.jsxs("div",{className:"space-y-0.5 border-t border-neutral-800 pt-1.5",children:[e.turns.length>0&&(()=>{const h=e.turns[e.turns.length-1],m=u.get(h.index)??0;return g.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[g.jsx("span",{className:"text-neutral-500",children:"Last turn"}),g.jsxs("span",{className:"font-mono text-neutral-300",title:"New = user message + tool results since the prior assistant turn (estimate). Out = assistant output tokens. Cost = that turn's billed cost.",children:["~",Zt(m)," new · ",Zt(h.outputTokens)," out ·"," ",bf(h.cost)]})]})})(),g.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[g.jsx("span",{className:"text-neutral-500",title:"Sum of `usage.input` per turn — NEW non-cached input the LLM saw across the session. Excludes cached portions (tracked separately below).",children:"Input (lifetime)"}),g.jsx("span",{className:"font-mono text-neutral-400",children:Zt(e.totalInputTokens)})]}),g.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[g.jsx("span",{className:"text-neutral-500",title:"Sum of `usage.cacheRead` per turn — prior context served from the prompt cache. Counted ONCE PER API CALL: every turn re-reads the same cached content and re-pays the (discounted) read fee, so this number grows ~quadratically with conversation length. Billed at ~10% of input rate on most providers.",children:"Cache served (lifetime)"}),g.jsx("span",{className:"font-mono text-neutral-400",children:Zt(e.totalCacheReadTokens)})]}),g.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[g.jsx("span",{className:"text-neutral-500",title:"Sum of `usage.cacheWrite` per turn — portions cached for reuse on subsequent turns. Billed at ~125% of input rate; small premium up front for big savings on the cache-served line.",children:"Cache written (lifetime)"}),g.jsx("span",{className:"font-mono text-neutral-400",children:Zt(e.totalCacheWriteTokens)})]}),g.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[g.jsx("span",{className:"text-neutral-500",title:"Sum of `usage.output` per turn — assistant tokens generated.",children:"Output (lifetime)"}),g.jsx("span",{className:"font-mono text-neutral-400",children:Zt(e.totalOutputTokens)})]}),g.jsxs("div",{className:"flex items-center justify-between text-[11px] font-medium",children:[g.jsx("span",{className:"text-neutral-300",children:"Total cost"}),g.jsx("span",{className:"font-mono text-emerald-400",children:bf(e.totalCost)})]})]}),e.turns.length>0&&g.jsxs("div",{children:[g.jsxs("button",{onClick:n,className:"flex items-center gap-1 text-[10px] uppercase tracking-wider text-neutral-400 hover:text-neutral-200",children:[r?g.jsx(ur,{size:10}):g.jsx(dr,{size:10}),"Per-turn (",e.turns.length,")"]}),r&&g.jsx(OM,{turns:e.turns,newDeltas:u})]})]})}const Lb=[{key:"systemAndTools",label:"System + tools",color:"#64748b"},{key:"userPrompts",label:"User prompts",color:"#0ea5e9"},{key:"assistantText",label:"Assistant text",color:"#a78bfa"},{key:"thinking",label:"Thinking",color:"#71717a"},{key:"toolCalls",label:"Tool calls",color:"#f59e0b"},{key:"toolResults",label:"Tool results",color:"#10b981"},{key:"images",label:"Images",color:"#ec4899"}];function LM({breakdown:e,contextWindow:r}){const n=e.total;return n===0?null:g.jsxs("div",{children:[g.jsxs("div",{className:"mb-1 flex items-center justify-between text-[10px] text-neutral-400",children:[g.jsx("span",{children:"What’s in the context"}),g.jsxs("span",{className:"text-neutral-600",title:"Sum of category estimates (~chars/4)",children:["~",Zt(n)," tok",r>0&&g.jsxs("span",{className:"ml-1",children:["(",(n/r*100).toFixed(1),"%)"]})]})]}),g.jsx("div",{className:"flex h-1.5 w-full overflow-hidden rounded bg-neutral-800",children:Lb.map(s=>{const a=e[s.key];if(a===0)return null;const u=a/n*100;return g.jsx("div",{style:{width:`${u}%`,background:s.color},title:`${s.label}: ${Zt(a)} tok (${u.toFixed(1)}%)`},s.key)})}),g.jsx("ul",{className:"mt-1 grid grid-cols-2 gap-x-3 gap-y-0.5 text-[10px]",children:Lb.map(s=>{const a=e[s.key];if(a===0)return null;const u=a/n*100;return g.jsxs("li",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:"inline-block h-2 w-2 rounded-sm",style:{background:s.color},"aria-hidden":"true"}),g.jsx("span",{className:"flex-1 truncate text-neutral-400",children:s.label}),g.jsx("span",{className:"font-mono text-neutral-300",children:Zt(a)}),g.jsxs("span",{className:"w-10 text-right text-neutral-600",children:[u.toFixed(0),"%"]})]},s.key)})})]})}function MM(e,r){let n=0,s=0,a=0,u=0,d=0,o=0;for(const S of e){const _=typeof S.role=="string"?S.role:"",x=S.content;if(_==="user"){if(typeof x=="string")n+=x.length;else if(Array.isArray(x))for(const E of x){const N=E;N.type==="text"&&typeof N.text=="string"?n+=N.text.length:N.type==="image"&&(o+=1)}}else if(_==="assistant"&&Array.isArray(x))for(const E of x){const N=E;if(N.type==="text"&&typeof N.text=="string")s+=N.text.length;else if(N.type==="thinking"&&typeof N.text=="string")a+=N.text.length;else if(N.type==="toolUse")try{u+=JSON.stringify(N.input??{}).length}catch{u+=String(N.input??"").length}}else if(_==="toolResult"){if(typeof x=="string")d+=x.length;else if(Array.isArray(x))for(const E of x){const N=E;N.type==="text"&&typeof N.text=="string"?d+=N.text.length:N.type==="image"&&(o+=1)}}}const c=S=>Math.ceil(S/4),h=c(n),m=c(s),f=c(a),v=c(u),w=c(d),A=o*1500,b=h+m+f+v+w+A,y=r!==void 0&&r>b?r-b:0;return{systemAndTools:y,userPrompts:h,assistantText:m,thinking:f,toolCalls:v,toolResults:w,images:A,total:b+y}}function OM({turns:e,newDeltas:r}){return g.jsx("div",{className:"mt-1 overflow-x-auto",children:g.jsxs("table",{className:"w-full font-mono text-[10px]",children:[g.jsx("thead",{className:"text-neutral-500",children:g.jsxs("tr",{children:[g.jsx("th",{className:"pr-2 text-left font-normal",children:"#"}),g.jsx("th",{className:"pr-2 text-left font-normal",children:"Model"}),g.jsx("th",{className:"pr-2 text-right font-normal",title:"Estimated new tokens this turn — user message + tool results since the prior assistant turn (~chars/4 estimate). Distinct from Prompt.",children:"New"}),g.jsx("th",{className:"pr-2 text-right font-normal",title:"Full prompt sent to the LLM = usage.input + cacheRead + cacheWrite. Includes ALL re-sent prior context — this grows monotonically with conversation length, which is normal LLM behavior.",children:"Prompt"}),g.jsx("th",{className:"pr-2 text-right font-normal",title:"Assistant output tokens this turn",children:"Out"}),g.jsx("th",{className:"text-right font-normal",title:"Cost billed for this turn",children:"Cost"})]})}),g.jsx("tbody",{className:"text-neutral-300",children:e.map((n,s)=>{const a=n.inputTokens+n.cacheReadTokens+n.cacheWriteTokens,u=r.get(n.index)??0;return g.jsxs("tr",{className:"border-t border-neutral-800/60",children:[g.jsx("td",{className:"pr-2 text-neutral-600",children:s+1}),g.jsx("td",{className:"max-w-[140px] truncate pr-2",title:`${n.provider}/${n.model}`,children:n.model}),g.jsxs("td",{className:"pr-2 text-right text-neutral-200",title:"New content (estimate)",children:["~",Zt(u)]}),g.jsx("td",{className:"pr-2 text-right",title:`input ${Zt(n.inputTokens)} + cR ${Zt(n.cacheReadTokens)} + cW ${Zt(n.cacheWriteTokens)}`,children:Zt(a)}),g.jsx("td",{className:"pr-2 text-right",children:Zt(n.outputTokens)}),g.jsx("td",{className:"text-right text-emerald-400",children:bf(n.cost)})]},`${n.index}-${n.timestamp}`)})})]})})}function zM({messages:e,showThinking:r,onToggleThinking:n,onViewRaw:s,search:a,onSearchChange:u,streamingTail:d}){const o=a.trim().toLowerCase(),c=q.useMemo(()=>o.length===0?e.map((h,m)=>({msg:h,originalIndex:m})):e.map((h,m)=>({msg:h,originalIndex:m})).filter(({msg:h})=>(typeof h.role=="string"?h.role.toLowerCase():"").includes(o)?!0:j1(h,!0).toLowerCase().includes(o)),[e,o]);return g.jsxs("div",{className:"px-2 py-2",children:[g.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2 px-1",children:[g.jsxs("span",{className:"shrink-0 text-[10px] uppercase tracking-wider text-neutral-400",children:["Messages (",o.length>0?`${c.length}/${e.length}`:e.length,")"]}),g.jsxs("label",{className:"flex items-center gap-1 text-[10px] text-neutral-500 hover:text-neutral-300",children:[g.jsx("input",{type:"checkbox",checked:r,onChange:n,className:"h-3 w-3"}),"Show thinking blocks"]})]}),e.length>=10&&g.jsxs("div",{className:"relative mb-1 px-1",children:[g.jsx(Xb,{size:11,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-neutral-500"}),g.jsx("input",{type:"text",value:a,onChange:h=>u(h.target.value),placeholder:"Find in messages…",className:"w-full rounded border border-neutral-800 bg-neutral-950 py-1 pl-6 pr-2 text-[11px] text-neutral-200 placeholder:text-neutral-600 focus:border-neutral-600 focus:outline-none"})]}),g.jsxs("ul",{className:"space-y-1",children:[c.map(({msg:h,originalIndex:m})=>g.jsx(FM,{index:m,message:h,showThinking:r,onViewRaw:()=>s(m,h)},m)),d!==void 0&&o.length===0&&g.jsx("li",{className:"rounded border border-violet-700/40 bg-violet-900/10",children:g.jsxs("div",{className:"flex items-start gap-2 px-2 py-1.5",children:[g.jsx(fo,{size:11,className:"mt-0.5 shrink-0 animate-spin text-violet-300"}),g.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[g.jsx("div",{className:"flex items-center gap-1.5",children:g.jsx("span",{className:"rounded bg-violet-900/40 px-1.5 py-0.5 text-[9px] uppercase tracking-wider text-violet-300",children:"assistant (streaming)"})}),g.jsx("p",{className:"line-clamp-2 text-[11px] text-neutral-300",children:d.content})]})]})})]})]})}function FM({index:e,message:r,showThinking:n,onViewRaw:s}){const[a,u]=q.useState(!1),d=typeof r.role=="string"?r.role:"unknown",o=d==="compactionSummary",c=q.useMemo(()=>j1(r,n),[r,n]),h=D1(r),m=typeof r.timestamp=="number"?r.timestamp:0;return g.jsxs("li",{className:"rounded border border-neutral-800/70 bg-neutral-900/30",children:[g.jsxs("button",{onClick:()=>u(f=>!f),className:"flex w-full items-start gap-2 px-2 py-1.5 text-left hover:bg-neutral-900/60",children:[g.jsx("span",{className:"pt-0.5 text-neutral-600",children:a?g.jsx(ur,{size:11}):g.jsx(dr,{size:11})}),g.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[g.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[g.jsx("span",{className:`rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wider ${HM(d)}`,children:d}),o&&g.jsx("span",{className:"rounded bg-fuchsia-900/40 px-1.5 py-0.5 text-[9px] text-fuchsia-300",children:"compacted"}),g.jsxs("span",{className:"text-[10px] text-neutral-600",children:["~",Zt(h)," tok"]}),m>0&&g.jsx("span",{className:"text-[10px] text-neutral-600",children:new Date(m).toLocaleTimeString()})]}),!a&&c.length>0&&g.jsx("p",{className:"line-clamp-2 text-[11px] text-neutral-400",children:c})]}),g.jsx("button",{onClick:f=>{f.stopPropagation(),s()},className:"rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-100",title:"View raw AgentMessage JSON",children:g.jsx(vA,{size:11})})]}),a&&g.jsx("div",{className:"space-y-1 border-t border-neutral-800/70 px-3 py-2",children:$M(r,n,e)})]})}function PM({title:e,payload:r,onClose:n}){const s=q.useMemo(()=>{try{return JSON.stringify(r,null,2)}catch{return String(r)}},[r]);return q.useEffect(()=>{const a=u=>{u.key==="Escape"&&n()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[n]),g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 px-4 py-8",onClick:n,children:g.jsxs("div",{onClick:a=>a.stopPropagation(),className:"flex h-full max-h-[720px] w-full max-w-4xl flex-col overflow-hidden rounded-lg border border-neutral-800 bg-neutral-950 shadow-2xl",children:[g.jsxs("header",{className:"flex items-center justify-between border-b border-neutral-800 px-3 py-2",children:[g.jsx("span",{className:"text-xs text-neutral-200",children:e}),g.jsx("button",{onClick:n,className:"rounded p-2 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200",title:"Close (Esc)",children:g.jsx(Br,{size:20})})]}),g.jsx(mx,{code:s,language:"json",theme:Df.vsDark,children:({style:a,tokens:u,getLineProps:d,getTokenProps:o})=>g.jsx("pre",{className:"flex-1 overflow-auto whitespace-pre p-3 font-mono text-[11px]",style:{...a,background:"transparent"},children:u.map((c,h)=>{const m=d({line:c});return g.jsx("div",{...m,children:c.map((f,v)=>{const w=o({token:f});return g.jsx("span",{...w},v)})},h)})})})]})})}function HM(e){return e==="user"?"bg-sky-900/40 text-sky-300":e==="assistant"?"bg-violet-900/40 text-violet-300":e==="tool"||e==="toolResult"?"bg-amber-900/40 text-amber-300":e==="compactionSummary"?"bg-fuchsia-900/40 text-fuchsia-300":"bg-neutral-800 text-neutral-400"}function j1(e,r){const n=e.content;if(typeof n=="string")return n.slice(0,200);if(!Array.isArray(n))return"";const s=[];for(const a of n){const u=a;u.type==="thinking"&&!r||(u.type==="text"&&typeof u.text=="string"?s.push(u.text):u.type==="thinking"&&typeof u.text=="string"?s.push(`[thinking] ${u.text}`):u.type==="toolUse"&&typeof u.name=="string"&&s.push(`[tool: ${u.name}]`))}return s.join(" ").slice(0,200)}function D1(e){const r=e.usage;if(r!==void 0&&typeof r.totalTokens=="number")return r.totalTokens;const n=e.content;if(typeof n=="string")return Math.ceil(n.length/4);if(!Array.isArray(n))return 0;let s=0,a=0;for(const u of n){const d=u;typeof d.text=="string"&&(s+=d.text.length),d.type==="image"&&(a+=1)}return Math.ceil(s/4)+a*1500}function UM(e,r){const n=new Map;let s=-1;for(const a of r){let u=0;for(let d=s+1;d<a.index;d++){const o=e[d];if(o===void 0)continue;const c=typeof o.role=="string"?o.role:"";c!=="user"&&c!=="toolResult"||(u+=D1(o))}n.set(a.index,u),s=a.index}return n}function $M(e,r,n){const s=typeof e.role=="string"?e.role:"unknown",a=e.content;return s==="toolResult"?g.jsxs("div",{children:[g.jsxs("p",{className:"mb-1 text-[10px] text-neutral-500",children:["tool: ",g.jsx("span",{className:"font-mono",children:String(e.toolName??"unknown")})," ",e.isError===!0&&g.jsx("span",{className:"text-red-400",children:"(error)"})]}),g.jsx("pre",{className:"max-h-64 overflow-auto whitespace-pre-wrap break-words rounded bg-neutral-950 p-2 font-mono text-[10px] text-neutral-300",children:rc(a)})]}):Array.isArray(a)?g.jsx(g.Fragment,{children:a.map((u,d)=>{const o=u;return o.type==="thinking"&&!r?null:o.type==="text"||o.type==="thinking"?g.jsx("pre",{className:`whitespace-pre-wrap break-words font-sans text-[11px] ${o.type==="thinking"?"italic text-neutral-500":"text-neutral-200"}`,children:String(o.text??"")},`${n}-${d}`):o.type==="toolUse"?g.jsxs("div",{className:"rounded border border-neutral-800 p-2",children:[g.jsxs("p",{className:"mb-1 text-[10px] text-neutral-500",children:["tool call: ",g.jsx("span",{className:"font-mono",children:String(o.name??"unknown")})]}),g.jsx("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono text-[10px] text-neutral-300",children:rc(o.input)})]},`${n}-${d}`):o.type==="image"?g.jsx("p",{className:"text-[11px] italic text-neutral-500",children:"[image attachment]"},`${n}-${d}`):g.jsx("pre",{className:"whitespace-pre-wrap break-words font-mono text-[10px] text-neutral-500",children:rc(o)},`${n}-${d}`)})}):typeof a=="string"?g.jsx("pre",{className:"whitespace-pre-wrap break-words font-sans text-[11px] text-neutral-200",children:a}):g.jsx("pre",{className:"whitespace-pre-wrap break-words font-mono text-[10px] text-neutral-500",children:rc(e)})}function rc(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Zt(e){return e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(e<1e4?1:0)}k`:`${(e/1e6).toFixed(2)}M`}function bf(e){return e===0?"$0":e<.01?`$${e.toFixed(4)}`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function Uh({getStartSize:e,onResize:r,direction:n,minSize:s,maxSize:a,orientation:u="vertical"}){const d=q.useRef(null),o=u==="horizontal",c=o?"row-resize":"col-resize";q.useEffect(()=>{const b=()=>{d.current!==null&&(d.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select"))},y=S=>{S.key==="Escape"&&b()};return window.addEventListener("keydown",y),window.addEventListener("blur",b),()=>{b(),window.removeEventListener("keydown",y),window.removeEventListener("blur",b)}},[]);const h=b=>{b.preventDefault(),b.currentTarget.setPointerCapture(b.pointerId),d.current={start:o?b.clientY:b.clientX,startSize:e()},document.body.style.cursor=c,document.body.style.userSelect="none"},m=b=>{if(d.current===null)return;const S=(o?b.clientY:b.clientX)-d.current.start,_=d.current.startSize+S*n;r(Math.min(Math.max(_,s),a))},f=b=>{d.current!==null&&(b.currentTarget.releasePointerCapture(b.pointerId),d.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select"))},v="group relative shrink-0 bg-neutral-800 hover:bg-neutral-600 active:bg-neutral-500",w=o?"h-1 w-full cursor-row-resize":"w-1 h-full cursor-col-resize",A=o?"absolute inset-x-0 -top-1 -bottom-1":"absolute inset-y-0 -left-1 -right-1";return g.jsx("div",{onPointerDown:h,onPointerMove:m,onPointerUp:f,onPointerCancel:f,className:`${v} ${w}`,role:"separator","aria-orientation":o?"horizontal":"vertical",children:g.jsx("div",{className:A})})}const Mb="pi-forge/files-width",Ob="pi-forge/editor-width",zb="pi-forge/terminal-height",qM=280,QM=480,GM=280,Fb=200,$h=320,Pb=320,Hb=140;function qh(e,r){const n=localStorage.getItem(e);if(n===null)return r;const s=Number.parseInt(n,10);return Number.isFinite(s)&&s>0?s:r}function WM(){var gt;const e=on(Ce=>Ce.ready),r=on(Ce=>Ce.isAuthenticated),n=on(Ce=>Ce.mustChangePassword),s=on(Ce=>Ce.bootstrap),a=on(Ce=>Ce.logout),u=Wt(Ce=>Ce.projects),d=Wt(Ce=>!Ce.loading),o=Wt(Ce=>Ce.load),c=hr(),h=Oe(Ce=>Ce.activeSessionId),[m,f]=q.useState(!1),[v,w]=q.useState(()=>localStorage.getItem("pi-forge/files-open")==="true"),A=Ce=>{w(Ce),localStorage.setItem("pi-forge/files-open",Ce?"true":"false")},[b,y]=q.useState(()=>{const Ce=localStorage.getItem("pi-forge/right-tab");return Ce==="files"||Ce==="search"||Ce==="changes"||Ce==="git"||Ce==="context"?Ce:"files"}),S=Ce=>{y(Ce),localStorage.setItem("pi-forge/right-tab",Ce)},[_,x]=q.useState(()=>localStorage.getItem("pi-forge/terminal-open")==="true"),E=Ce=>{x(Ce),localStorage.setItem("pi-forge/terminal-open",Ce?"true":"false")},[N,T]=q.useState(()=>localStorage.getItem("pi-forge/chat-open")!=="false"),j=Ce=>{T(Ce),localStorage.setItem("pi-forge/chat-open",Ce?"true":"false")},[R,D]=q.useState(()=>localStorage.getItem("pi-forge/editor-open")!=="false"),L=Ce=>{D(Ce),localStorage.setItem("pi-forge/editor-open",Ce?"true":"false")},[z,U]=q.useState(!1),[P,G]=q.useState(()=>qh(zb,GM)),K=q.useRef(P);q.useEffect(()=>{K.current=P,localStorage.setItem(zb,String(P))},[P]);const[W,Y]=q.useState(()=>qh(Mb,qM)),[ne,F]=q.useState(()=>qh(Ob,QM)),B=q.useRef(W),O=q.useRef(ne);q.useEffect(()=>{B.current=W,localStorage.setItem(Mb,String(W))},[W]),q.useEffect(()=>{O.current=ne,localStorage.setItem(Ob,String(ne))},[ne]);const Q=ft(Ce=>Ce.openFiles.length),M=R&&Q>0,de=((gt=N1(c==null?void 0:c.id).status)==null?void 0:gt.files.length)??0,pe=Oe(Ce=>h!==void 0?Ce.agentEndCountBySession[h]??0:0),X=Oe(Ce=>h!==void 0?Ce.streamingBySession[h]??!1:!1),$=ft(Ce=>Ce.loadTree),se=ft(Ce=>Ce.restoreTabs),le=ft(Ce=>Ce.refreshOpenFiles);q.useEffect(()=>{c===void 0||X||($(c.id),le(c.id))},[c==null?void 0:c.id,X,pe]),q.useEffect(()=>{c!==void 0&&se(c.id)},[c==null?void 0:c.id]),q.useEffect(()=>{if(!m)return;const Ce=Kt=>{Kt.key==="Escape"&&f(!1)};return window.addEventListener("keydown",Ce),()=>window.removeEventListener("keydown",Ce)},[m]);const te=Fi(Ce=>Ce.settingsRequest),ue=Fi(Ce=>Ce.clearSettingsRequest),[Ae,Le]=q.useState(void 0);q.useEffect(()=>{te!==void 0&&(f(!0),te.tab!==void 0&&Le(te.tab),ue())},[te,ue]),q.useEffect(()=>{s()},[s]);const Me=Dr(Ce=>Ce.load),Pe=Dr(Ce=>Ce.minimal);q.useEffect(()=>{Me()},[Me]),q.useEffect(()=>{r&&!n&&o()},[r,n,o]);const Be=Yn(Ce=>Ce.startPolling),jt=Yn(Ce=>Ce.stopPolling);return q.useEffect(()=>{r&&!n?Be():jt()},[r,n,Be,jt]),e?r?n?g.jsx(kE,{}):g.jsxs("div",{className:"flex h-screen flex-col bg-neutral-950 text-neutral-100",children:[g.jsxs("header",{className:"flex items-center justify-between border-b border-neutral-800 px-4 py-2",children:[g.jsx("div",{className:"flex items-center gap-3",children:g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("img",{src:"/icons/icon.svg",alt:"",className:"h-8 w-8","aria-hidden":"true"}),g.jsx("span",{className:"text-sm font-semibold tracking-tight",children:"pi-forge"})]})}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("button",{onClick:()=>j(!N),className:`flex items-center gap-1 rounded-md border px-2 py-1 text-xs ${N?"border-neutral-500 bg-neutral-800 text-neutral-100":"border-neutral-700 text-neutral-300 hover:border-neutral-500"}`,title:"Toggle the chat pane",children:[g.jsx(UA,{size:13}),"Chat"]}),g.jsxs("button",{onClick:()=>L(!R),className:`flex items-center gap-1 rounded-md border px-2 py-1 text-xs ${R?"border-neutral-500 bg-neutral-800 text-neutral-100":"border-neutral-700 text-neutral-300 hover:border-neutral-500"}`,title:"Toggle the editor pane (open tabs persist across reloads)",children:[g.jsx(Wb,{size:13}),"Editor"]}),g.jsxs("button",{onClick:()=>A(!v),className:`flex items-center gap-1 rounded-md border px-2 py-1 text-xs ${v?"border-neutral-500 bg-neutral-800 text-neutral-100":"border-neutral-700 text-neutral-300 hover:border-neutral-500"}`,title:"Toggle the file browser tree",children:[g.jsx(DA,{size:13}),"Files"]}),!Pe&&g.jsxs("button",{onClick:()=>E(!_),className:`flex items-center gap-1 rounded-md border px-2 py-1 text-xs ${_?"border-neutral-500 bg-neutral-800 text-neutral-100":"border-neutral-700 text-neutral-300 hover:border-neutral-500"}`,title:"Toggle the integrated terminal",children:[g.jsx(Yb,{size:13}),"Terminal"]}),g.jsx(gM,{}),g.jsx("button",{onClick:()=>f(!0),className:"rounded-md border border-neutral-700 px-2 py-1 text-xs text-neutral-300 hover:border-neutral-500",title:"Settings (providers, agent defaults, MCP, skills)",children:"Settings"}),g.jsx("button",{onClick:a,className:"rounded-md border border-neutral-700 px-2 py-1 text-xs text-neutral-300 hover:border-neutral-500",children:"Sign out"})]})]}),m&&g.jsx(NL,{onClose:()=>{f(!1),Le(void 0)},...Ae!==void 0?{initialTab:Ae}:{}}),g.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[g.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[g.jsx(RE,{}),g.jsxs("main",{className:"flex flex-1 overflow-hidden",children:[N&&g.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:d&&u.length===0?z?g.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center",children:g.jsxs("div",{className:"space-y-3 text-sm text-neutral-400",children:[g.jsx("p",{children:"No projects yet."}),g.jsx("button",{onClick:()=>U(!1),className:"rounded-md bg-neutral-100 px-3 py-1.5 text-sm font-medium text-neutral-900 hover:bg-white",children:"+ New project"})]})}):g.jsx("div",{className:"flex flex-1 items-center justify-center",children:g.jsx(lx,{onClose:()=>U(!0)})}):h!==void 0?g.jsxs(g.Fragment,{children:[g.jsx(VI,{sessionId:h}),!Pe&&g.jsx(SL,{sessionId:h,alreadyOnChangesTab:v&&b==="changes",onOpen:()=>{v||A(!0),S("changes")}}),g.jsx(vL,{sessionId:h})]}):c?g.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center",children:g.jsxs("div",{className:"space-y-3 text-sm text-neutral-400",children:[g.jsx("h2",{className:"text-xl font-semibold text-neutral-100",children:c.name}),g.jsx("p",{className:"font-mono text-xs",children:c.path}),g.jsx("p",{children:"Pick a session from the sidebar — or start a new one here."}),g.jsx("button",{onClick:()=>{Oe.getState().createSession(c.id)},className:"rounded-md bg-neutral-100 px-3 py-1.5 text-sm font-medium text-neutral-900 hover:bg-white",children:"+ New session"})]})}):g.jsx("div",{className:"flex flex-1 items-center justify-center",children:g.jsx("p",{className:"text-sm text-neutral-400",children:"Select a project from the sidebar."})})}),M&&(N?g.jsxs(g.Fragment,{children:[g.jsx(Uh,{getStartSize:()=>O.current,onResize:Mt=>F(Mt),direction:-1,minSize:$h,maxSize:Math.max($h,window.innerWidth-(v?W:0)-Pb-240)}),g.jsx("div",{className:"flex shrink-0 flex-col border-l border-neutral-800",style:{width:`${ne}px`},children:g.jsx(Tb,{})})]}):g.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:g.jsx(Tb,{})})),v&&(()=>{const Kt=!N&&!M,Mt=g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"flex border-b border-neutral-800 bg-neutral-900/40",children:(Pe?["files","search","context"]:["files","search","changes","git","context"]).map(st=>g.jsxs("button",{onClick:()=>S(st),className:`flex items-center gap-1 px-3 py-1.5 text-[11px] uppercase tracking-wider ${b===st?"border-b border-neutral-100 text-neutral-100":"text-neutral-500 hover:text-neutral-300"}`,children:[st==="files"?"Files":st==="search"?"Search":st==="changes"?"Last turn":st==="git"?"Git":"Context",st==="git"&&de>0&&g.jsx("span",{className:"rounded bg-amber-900/40 px-1 py-0.5 text-[9px] text-amber-300",children:de})]},st))}),g.jsx("div",{className:"flex-1 overflow-hidden",children:b==="files"?g.jsx(kb,{}):b==="search"?g.jsx(kM,{}):!Pe&&b==="changes"?g.jsx(yM,{}):!Pe&&b==="git"?g.jsx(xM,{}):b==="context"?g.jsx(BM,{}):g.jsx(kb,{})})]});return Kt?g.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:Mt}):g.jsxs(g.Fragment,{children:[g.jsx(Uh,{getStartSize:()=>B.current,onResize:st=>Y(st),direction:-1,minSize:Fb,maxSize:Math.max(Fb,window.innerWidth-Pb-240-(M?$h:0))}),g.jsx("div",{className:"flex shrink-0 flex-col border-l border-neutral-800",style:{width:`${W}px`},children:Mt})]})})()]})]}),!Pe&&_&&g.jsxs(g.Fragment,{children:[g.jsx(Uh,{orientation:"horizontal",getStartSize:()=>K.current,onResize:Ce=>G(Ce),direction:-1,minSize:Hb,maxSize:Math.max(Hb,Math.floor(window.innerHeight*.7))}),g.jsx("div",{className:"shrink-0 border-t border-neutral-800",style:{height:`${P}px`},children:g.jsx(hM,{})})]})]})]}):g.jsx(EE,{}):g.jsx("main",{className:"flex min-h-screen items-center justify-center text-sm text-neutral-400",children:"Loading…"})}kL();aA({immediate:!0});class KM extends q.Component{constructor(){super(...arguments);Il(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,s){console.error("[pi-forge] root render error",n,s)}render(){return this.state.error!==null?g.jsxs("main",{style:{padding:"2rem",fontFamily:"monospace",color:"#fca5a5",background:"#0a0a0a",minHeight:"100vh",whiteSpace:"pre-wrap",overflow:"auto"},children:[g.jsx("h1",{style:{color:"#fff",marginBottom:"1rem"},children:"pi-forge: render crash"}),g.jsx("p",{style:{color:"#d4d4d4",marginBottom:"1rem"},children:this.state.error.message}),g.jsx("pre",{style:{fontSize:"11px",color:"#a3a3a3"},children:this.state.error.stack??"(no stack)"}),g.jsx("p",{style:{marginTop:"2rem",color:"#71717a",fontSize:"12px"},children:"Tip: open the browser console for more detail. Try clearing localStorage (devtools → Application → Local Storage → Clear) and refreshing if the error mentions stale state."})]}):this.props.children}}window.addEventListener("error",e=>{console.error("[pi-forge] uncaught error",e.error)});window.addEventListener("unhandledrejection",e=>{console.error("[pi-forge] unhandled rejection",e.reason)});const B1=document.getElementById("root");if(!B1)throw new Error("#root element missing in index.html");rA.createRoot(B1).render(g.jsx(q.StrictMode,{children:g.jsx(KM,{children:g.jsx(WM,{})})}));export{g as j,q as r,XM as t,mf as u};
|
|
392
|
+
//# sourceMappingURL=index-BzKzxXFs.js.map
|