mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-11-25 13:48:18 +08:00
feat(ui+server): 文件抽屉支持在系统文件管理器中定位
- 内核新增 repo_reveal call:目录直接打开、文件在父目录选中 (open / explorer /select / xdg-open);serve 仅绑 loopback,浏览器 与内核同机,浏览器模式与桌面壳行为一致,无需 Tauri 能力 - 路径强制限定工作区内(复用 resolve 守卫,越界单测);Start 不等退出 (explorer.exe 成功也返回非零码) - 入口按"不认识路径的普通用户"设计:抽屉底部常驻"这个任务的文件都 保存在这台电脑上" + 平台母语主按钮(在访达中打开/打开文件夹), 预览头部"在访达中显示/打开所在文件夹";完整路径仅在悬停提示 - 系统调用失败时复制绝对路径兜底并提示
This commit is contained in:
1 parent
e2c4112570
commit
f162bb2cde
7 files changed
+174
-57
No files matched your search
@@ -10,7 +10,7 @@
|
||||
<style>
|
||||
html, body { background: #fcfdfc; }
|
||||
</style>
|
||||
<script type="module" crossorigin>var Kh=Object.defineProperty;var Vh=(i,s,o)=>s in i?Kh(i,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[s]=o;var at=(i,s,o)=>Vh(i,typeof s!="symbol"?s+"":s,o);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const p of d)if(p.type==="childList")for(const v of p.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&u(v)}).observe(document,{childList:!0,subtree:!0});function o(d){const p={};return d.integrity&&(p.integrity=d.integrity),d.referrerPolicy&&(p.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?p.credentials="include":d.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function u(d){if(d.ep)return;d.ep=!0;const p=o(d);fetch(d.href,p)}})();function qh(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Pa={exports:{}},Ts={},Ba={exports:{}},Ye={};/**
|
||||
<script type="module" crossorigin>var Vh=Object.defineProperty;var qh=(i,s,o)=>s in i?Vh(i,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[s]=o;var at=(i,s,o)=>qh(i,typeof s!="symbol"?s+"":s,o);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const p of d)if(p.type==="childList")for(const v of p.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&u(v)}).observe(document,{childList:!0,subtree:!0});function o(d){const p={};return d.integrity&&(p.integrity=d.integrity),d.referrerPolicy&&(p.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?p.credentials="include":d.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function u(d){if(d.ep)return;d.ep=!0;const p=o(d);fetch(d.href,p)}})();function Qh(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Pa={exports:{}},Ts={},Ba={exports:{}},He={};/**
|
||||
* @license React
|
||||
* react.production.min.js
|
||||
*
|
||||
@@ -18,7 +18,7 @@
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var jd;function Qh(){if(jd)return Ye;jd=1;var i=Symbol.for("react.element"),s=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),v=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),M=Symbol.iterator;function T(m){return m===null||typeof m!="object"?null:(m=M&&m[M]||m["@@iterator"],typeof m=="function"?m:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},U=Object.assign,F={};function G(m,N,J){this.props=m,this.context=N,this.refs=F,this.updater=J||B}G.prototype.isReactComponent={},G.prototype.setState=function(m,N){if(typeof m!="object"&&typeof m!="function"&&m!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,m,N,"setState")},G.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function le(){}le.prototype=G.prototype;function ge(m,N,J){this.props=m,this.context=N,this.refs=F,this.updater=J||B}var ye=ge.prototype=new le;ye.constructor=ge,U(ye,G.prototype),ye.isPureReactComponent=!0;var Q=Array.isArray,de=Object.prototype.hasOwnProperty,C={current:null},V={key:!0,ref:!0,__self:!0,__source:!0};function j(m,N,J){var Ne,Le={},Me=null,Ge=null;if(N!=null)for(Ne in N.ref!==void 0&&(Ge=N.ref),N.key!==void 0&&(Me=""+N.key),N)de.call(N,Ne)&&!V.hasOwnProperty(Ne)&&(Le[Ne]=N[Ne]);var se=arguments.length-2;if(se===1)Le.children=J;else if(1<se){for(var xe=Array(se),He=0;He<se;He++)xe[He]=arguments[He+2];Le.children=xe}if(m&&m.defaultProps)for(Ne in se=m.defaultProps,se)Le[Ne]===void 0&&(Le[Ne]=se[Ne]);return{$$typeof:i,type:m,key:Me,ref:Ge,props:Le,_owner:C.current}}function H(m,N){return{$$typeof:i,type:m.type,key:N,ref:m.ref,props:m.props,_owner:m._owner}}function $(m){return typeof m=="object"&&m!==null&&m.$$typeof===i}function Oe(m){var N={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(J){return N[J]})}var ke=/\/+/g;function Be(m,N){return typeof m=="object"&&m!==null&&m.key!=null?Oe(""+m.key):N.toString(36)}function Ze(m,N,J,Ne,Le){var Me=typeof m;(Me==="undefined"||Me==="boolean")&&(m=null);var Ge=!1;if(m===null)Ge=!0;else switch(Me){case"string":case"number":Ge=!0;break;case"object":switch(m.$$typeof){case i:case s:Ge=!0}}if(Ge)return Ge=m,Le=Le(Ge),m=Ne===""?"."+Be(Ge,0):Ne,Q(Le)?(J="",m!=null&&(J=m.replace(ke,"$&/")+"/"),Ze(Le,N,J,"",function(He){return He})):Le!=null&&($(Le)&&(Le=H(Le,J+(!Le.key||Ge&&Ge.key===Le.key?"":(""+Le.key).replace(ke,"$&/")+"/")+m)),N.push(Le)),1;if(Ge=0,Ne=Ne===""?".":Ne+":",Q(m))for(var se=0;se<m.length;se++){Me=m[se];var xe=Ne+Be(Me,se);Ge+=Ze(Me,N,J,xe,Le)}else if(xe=T(m),typeof xe=="function")for(m=xe.call(m),se=0;!(Me=m.next()).done;)Me=Me.value,xe=Ne+Be(Me,se++),Ge+=Ze(Me,N,J,xe,Le);else if(Me==="object")throw N=String(m),Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.");return Ge}function tt(m,N,J){if(m==null)return m;var Ne=[],Le=0;return Ze(m,Ne,"","",function(Me){return N.call(J,Me,Le++)}),Ne}function Ke(m){if(m._status===-1){var N=m._result;N=N(),N.then(function(J){(m._status===0||m._status===-1)&&(m._status=1,m._result=J)},function(J){(m._status===0||m._status===-1)&&(m._status=2,m._result=J)}),m._status===-1&&(m._status=0,m._result=N)}if(m._status===1)return m._result.default;throw m._result}var Pe={current:null},P={transition:null},ne={ReactCurrentDispatcher:Pe,ReactCurrentBatchConfig:P,ReactCurrentOwner:C};function O(){throw Error("act(...) is not supported in production builds of React.")}return Ye.Children={map:tt,forEach:function(m,N,J){tt(m,function(){N.apply(this,arguments)},J)},count:function(m){var N=0;return tt(m,function(){N++}),N},toArray:function(m){return tt(m,function(N){return N})||[]},only:function(m){if(!$(m))throw Error("React.Children.only expected to receive a single React element child.");return m}},Ye.Component=G,Ye.Fragment=o,Ye.Profiler=d,Ye.PureComponent=ge,Ye.StrictMode=u,Ye.Suspense=S,Ye.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ne,Ye.act=O,Ye.cloneElement=function(m,N,J){if(m==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+m+".");var Ne=U({},m.props),Le=m.key,Me=m.ref,Ge=m._owner;if(N!=null){if(N.ref!==void 0&&(Me=N.ref,Ge=C.current),N.key!==void 0&&(Le=""+N.key),m.type&&m.type.defaultProps)var se=m.type.defaultProps;for(xe in N)de.call(N,xe)&&!V.hasOwnProperty(xe)&&(Ne[xe]=N[xe]===void 0&&se!==void 0?se[xe]:N[xe])}var xe=arguments.length-2;if(xe===1)Ne.children=J;else if(1<xe){se=Array(xe);for(var He=0;He<xe;He++)se[He]=arguments[He+2];Ne.children=se}return{$$typeof:i,type:m.Line truncated
|
||||
*/var jd;function Zh(){if(jd)return He;jd=1;var i=Symbol.for("react.element"),s=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),v=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),D=Symbol.iterator;function T(S){return S===null||typeof S!="object"?null:(S=D&&S[D]||S["@@iterator"],typeof S=="function"?S:null)}var P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B=Object.assign,U={};function G(S,N,W){this.props=S,this.context=N,this.refs=U,this.updater=W||P}G.prototype.isReactComponent={},G.prototype.setState=function(S,N){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,N,"setState")},G.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function ae(){}ae.prototype=G.prototype;function me(S,N,W){this.props=S,this.context=N,this.refs=U,this.updater=W||P}var xe=me.prototype=new ae;xe.constructor=me,B(xe,G.prototype),xe.isPureReactComponent=!0;var Z=Array.isArray,pe=Object.prototype.hasOwnProperty,A={current:null},V={key:!0,ref:!0,__self:!0,__source:!0};function j(S,N,W){var le,Le={},Ae=null,We=null;if(N!=null)for(le in N.ref!==void 0&&(We=N.ref),N.key!==void 0&&(Ae=""+N.key),N)pe.call(N,le)&&!V.hasOwnProperty(le)&&(Le[le]=N[le]);var se=arguments.length-2;if(se===1)Le.children=W;else if(1<se){for(var _e=Array(se),ze=0;ze<se;ze++)_e[ze]=arguments[ze+2];Le.children=_e}if(S&&S.defaultProps)for(le in se=S.defaultProps,se)Le[le]===void 0&&(Le[le]=se[le]);return{$$typeof:i,type:S,key:Ae,ref:We,props:Le,_owner:A.current}}function H(S,N){return{$$typeof:i,type:S.type,key:N,ref:S.ref,props:S.props,_owner:S._owner}}function ee(S){return typeof S=="object"&&S!==null&&S.$$typeof===i}function Me(S){var N={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(W){return N[W]})}var be=/\/+/g;function Be(S,N){return typeof S=="object"&&S!==null&&S.key!=null?Me(""+S.key):N.toString(36)}function qe(S,N,W,le,Le){var Ae=typeof S;(Ae==="undefined"||Ae==="boolean")&&(S=null);var We=!1;if(S===null)We=!0;else switch(Ae){case"string":case"number":We=!0;break;case"object":switch(S.$$typeof){case i:case s:We=!0}}if(We)return We=S,Le=Le(We),S=le===""?"."+Be(We,0):le,Z(Le)?(W="",S!=null&&(W=S.replace(be,"$&/")+"/"),qe(Le,N,W,"",function(ze){return ze})):Le!=null&&(ee(Le)&&(Le=H(Le,W+(!Le.key||We&&We.key===Le.key?"":(""+Le.key).replace(be,"$&/")+"/")+S)),N.push(Le)),1;if(We=0,le=le===""?".":le+":",Z(S))for(var se=0;se<S.length;se++){Ae=S[se];var _e=le+Be(Ae,se);We+=qe(Ae,N,W,_e,Le)}else if(_e=T(S),typeof _e=="function")for(S=_e.call(S),se=0;!(Ae=S.next()).done;)Ae=Ae.value,_e=le+Be(Ae,se++),We+=qe(Ae,N,W,_e,Le);else if(Ae==="object")throw N=String(S),Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.");return We}function $e(S,N,W){if(S==null)return S;var le=[],Le=0;return qe(S,le,"","",function(Ae){return N.call(W,Ae,Le++)}),le}function Ge(S){if(S._status===-1){var N=S._result;N=N(),N.then(function(W){(S._status===0||S._status===-1)&&(S._status=1,S._result=W)},function(W){(S._status===0||S._status===-1)&&(S._status=2,S._result=W)}),S._status===-1&&(S._status=0,S._result=N)}if(S._status===1)return S._result.default;throw S._result}var Pe={current:null},z={transition:null},re={ReactCurrentDispatcher:Pe,ReactCurrentBatchConfig:z,ReactCurrentOwner:A};function M(){throw Error("act(...) is not supported in production builds of React.")}return He.Children={map:$e,forEach:function(S,N,W){$e(S,function(){N.apply(this,arguments)},W)},count:function(S){var N=0;return $e(S,function(){N++}),N},toArray:function(S){return $e(S,function(N){return N})||[]},only:function(S){if(!ee(S))throw Error("React.Children.only expected to receive a single React element child.");return S}},He.Component=G,He.Fragment=o,He.Profiler=d,He.PureComponent=me,He.StrictMode=u,He.Suspense=w,He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=re,He.act=M,He.cloneElement=function(S,N,W){if(S==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+S+".");var le=B({},S.props),Le=S.key,Ae=S.ref,We=S._owner;if(N!=null){if(N.ref!==void 0&&(Ae=N.ref,We=A.current),N.key!==void 0&&(Le=""+N.key),S.type&&S.type.defaultProps)var se=S.type.defaultProps;for(_e in N)pe.call(N,_e)&&!V.hasOwnProperty(_e)&&(le[_e]=N[_e]===void 0&&se!==void 0?se[_e]:N[_e])}var _e=arguments.length-2;if(_e===1)le.children=W;else if(1<_e){se=Array(_e);for(var ze=0;ze<_e;ze++)se[ze]=arguments[ze+2];le.children=se}return{$$typeof:i,typeLine truncated
|
||||
* @license React
|
||||
* react-jsx-runtime.production.min.js
|
||||
*
|
||||
@@ -26,7 +26,7 @@
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Pd;function Zh(){if(Pd)return Ts;Pd=1;var i=lc(),s=Symbol.for("react.element"),o=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,d=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function v(g,S,y){var E,M={},T=null,B=null;y!==void 0&&(T=""+y),S.key!==void 0&&(T=""+S.key),S.ref!==void 0&&(B=S.ref);for(E in S)u.call(S,E)&&!p.hasOwnProperty(E)&&(M[E]=S[E]);if(g&&g.defaultProps)for(E in S=g.defaultProps,S)M[E]===void 0&&(M[E]=S[E]);return{$$typeof:s,type:g,key:T,ref:B,props:M,_owner:d.current}}return Ts.Fragment=o,Ts.jsx=v,Ts.jsxs=v,Ts}var Bd;function Xh(){return Bd||(Bd=1,Pa.exports=Zh()),Pa.exports}var c=Xh(),W=lc(),Fo={},Ua={exports:{}},Sn={},Fa={exports:{}},Wa={};/**
|
||||
*/var Pd;function Xh(){if(Pd)return Ts;Pd=1;var i=lc(),s=Symbol.for("react.element"),o=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,d=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function v(m,w,y){var E,D={},T=null,P=null;y!==void 0&&(T=""+y),w.key!==void 0&&(T=""+w.key),w.ref!==void 0&&(P=w.ref);for(E in w)u.call(w,E)&&!p.hasOwnProperty(E)&&(D[E]=w[E]);if(m&&m.defaultProps)for(E in w=m.defaultProps,w)D[E]===void 0&&(D[E]=w[E]);return{$$typeof:s,type:m,key:T,ref:P,props:D,_owner:d.current}}return Ts.Fragment=o,Ts.jsx=v,Ts.jsxs=v,Ts}var Bd;function Jh(){return Bd||(Bd=1,Pa.exports=Xh()),Pa.exports}var c=Jh(),F=lc(),Fo={},Ua={exports:{}},xn={},Fa={exports:{}},Wa={};/**
|
||||
* @license React
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
@@ -34,7 +34,7 @@
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Ud;function Jh(){return Ud||(Ud=1,(function(i){function s(P,ne){var O=P.length;P.push(ne);e:for(;0<O;){var m=O-1>>>1,N=P[m];if(0<d(N,ne))P[m]=ne,P[O]=N,O=m;else break e}}function o(P){return P.length===0?null:P[0]}function u(P){if(P.length===0)return null;var ne=P[0],O=P.pop();if(O!==ne){P[0]=O;e:for(var m=0,N=P.length,J=N>>>1;m<J;){var Ne=2*(m+1)-1,Le=P[Ne],Me=Ne+1,Ge=P[Me];if(0>d(Le,O))Me<N&&0>d(Ge,Le)?(P[m]=Ge,P[Me]=O,m=Me):(P[m]=Le,P[Ne]=O,m=Ne);else if(Me<N&&0>d(Ge,O))P[m]=Ge,P[Me]=O,m=Me;else break e}}return ne}function d(P,ne){var O=P.sortIndex-ne.sortIndex;return O!==0?O:P.id-ne.id}if(typeof performance=="object"&&typeof performance.now=="function"){var p=performance;i.unstable_now=function(){return p.now()}}else{var v=Date,g=v.now();i.unstable_now=function(){return v.now()-g}}var S=[],y=[],E=1,M=null,T=3,B=!1,U=!1,F=!1,G=typeof setTimeout=="function"?setTimeout:null,le=typeof clearTimeout=="function"?clearTimeout:null,ge=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function ye(P){for(var ne=o(y);ne!==null;){if(ne.callback===null)u(y);else if(ne.startTime<=P)u(y),ne.sortIndex=ne.expirationTime,s(S,ne);else break;ne=o(y)}}function Q(P){if(F=!1,ye(P),!U)if(o(S)!==null)U=!0,Ke(de);else{var ne=o(y);ne!==null&&Pe(Q,ne.startTime-P)}}function de(P,ne){U=!1,F&&(F=!1,le(j),j=-1),B=!0;var O=T;try{for(ye(ne),M=o(S);M!==null&&(!(M.expirationTime>ne)||P&&!Oe());){var m=M.callback;if(typeof m=="function"){M.callback=null,T=M.priorityLevel;var N=m(M.expirationTime<=ne);ne=i.unstable_now(),typeof N=="function"?M.callback=N:M===o(S)&&u(S),ye(ne)}else u(S);M=o(S)}if(M!==null)var J=!0;else{var Ne=o(y);Ne!==null&&Pe(Q,Ne.startTime-ne),J=!1}return J}finally{M=null,T=O,B=!1}}var C=!1,V=null,j=-1,H=5,$=-1;function Oe(){return!(i.unstable_now()-$<H)}function ke(){if(V!==null){var P=i.unstable_now();$=P;var ne=!0;try{ne=V(!0,P)}finally{ne?Be():(C=!1,V=null)}}else C=!1}var Be;if(typeof ge=="function")Be=function(){ge(ke)};else if(typeof MessageChannel<"u"){var Ze=new MessageChannel,tt=Ze.port2;Ze.port1.onmessage=ke,Be=function(){tt.postMessage(null)}}else Be=function(){G(ke,0)};function Ke(P){V=P,C||(C=!0,Be())}function Pe(P,ne){j=G(function(){P(i.unstable_now())},ne)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(P){P.callback=null},i.unstable_continueExecution=function(){U||B||(U=!0,Ke(de))},i.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<P?Math.floor(1e3/P):5},i.unstable_getCurrentPriorityLevel=function(){return T},i.unstable_getFirstCallbackNode=function(){return o(S)},i.unstable_next=function(P){switch(T){case 1:case 2:case 3:var ne=3;break;default:ne=T}var O=T;T=ne;try{return P()}finally{T=O}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(P,ne){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var O=T;T=P;try{return ne()}finally{T=O}},i.unstable_scheduleCallback=function(P,ne,O){var m=i.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?m+O:m):O=m,P){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=O+N,P={id:E++,callback:ne,priorityLevel:P,startTime:O,expirationTime:N,sortIndex:-1},O>m?(P.sortIndex=O,s(y,P),o(S)===null&&P===o(y)&&(F?(le(j),j=-1):F=!0,Pe(Q,O-m))):(P.sortIndex=N,s(S,P),U||B||(U=!0,Ke(de))),P},i.unstable_shouldYield=Oe,i.unstable_wrapCallback=function(P){var ne=T;return function(){var O=T;T=ne;try{return P.apply(this,arguments)}finally{T=O}}}})(Wa)),Wa}var Fd;function $h(){return Fd||(Fd=1,Fa.exports=Jh()),Fa.exports}/**
|
||||
*/var Ud;function $h(){return Ud||(Ud=1,(function(i){function s(z,re){var M=z.length;z.push(re);e:for(;0<M;){var S=M-1>>>1,N=z[S];if(0<d(N,re))z[S]=re,z[M]=N,M=S;else break e}}function o(z){return z.length===0?null:z[0]}function u(z){if(z.length===0)return null;var re=z[0],M=z.pop();if(M!==re){z[0]=M;e:for(var S=0,N=z.length,W=N>>>1;S<W;){var le=2*(S+1)-1,Le=z[le],Ae=le+1,We=z[Ae];if(0>d(Le,M))Ae<N&&0>d(We,Le)?(z[S]=We,z[Ae]=M,S=Ae):(z[S]=Le,z[le]=M,S=le);else if(Ae<N&&0>d(We,M))z[S]=We,z[Ae]=M,S=Ae;else break e}}return re}function d(z,re){var M=z.sortIndex-re.sortIndex;return M!==0?M:z.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var p=performance;i.unstable_now=function(){return p.now()}}else{var v=Date,m=v.now();i.unstable_now=function(){return v.now()-m}}var w=[],y=[],E=1,D=null,T=3,P=!1,B=!1,U=!1,G=typeof setTimeout=="function"?setTimeout:null,ae=typeof clearTimeout=="function"?clearTimeout:null,me=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function xe(z){for(var re=o(y);re!==null;){if(re.callback===null)u(y);else if(re.startTime<=z)u(y),re.sortIndex=re.expirationTime,s(w,re);else break;re=o(y)}}function Z(z){if(U=!1,xe(z),!B)if(o(w)!==null)B=!0,Ge(pe);else{var re=o(y);re!==null&&Pe(Z,re.startTime-z)}}function pe(z,re){B=!1,U&&(U=!1,ae(j),j=-1),P=!0;var M=T;try{for(xe(re),D=o(w);D!==null&&(!(D.expirationTime>re)||z&&!Me());){var S=D.callback;if(typeof S=="function"){D.callback=null,T=D.priorityLevel;var N=S(D.expirationTime<=re);re=i.unstable_now(),typeof N=="function"?D.callback=N:D===o(w)&&u(w),xe(re)}else u(w);D=o(w)}if(D!==null)var W=!0;else{var le=o(y);le!==null&&Pe(Z,le.startTime-re),W=!1}return W}finally{D=null,T=M,P=!1}}var A=!1,V=null,j=-1,H=5,ee=-1;function Me(){return!(i.unstable_now()-ee<H)}function be(){if(V!==null){var z=i.unstable_now();ee=z;var re=!0;try{re=V(!0,z)}finally{re?Be():(A=!1,V=null)}}else A=!1}var Be;if(typeof me=="function")Be=function(){me(be)};else if(typeof MessageChannel<"u"){var qe=new MessageChannel,$e=qe.port2;qe.port1.onmessage=be,Be=function(){$e.postMessage(null)}}else Be=function(){G(be,0)};function Ge(z){V=z,A||(A=!0,Be())}function Pe(z,re){j=G(function(){z(i.unstable_now())},re)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(z){z.callback=null},i.unstable_continueExecution=function(){B||P||(B=!0,Ge(pe))},i.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<z?Math.floor(1e3/z):5},i.unstable_getCurrentPriorityLevel=function(){return T},i.unstable_getFirstCallbackNode=function(){return o(w)},i.unstable_next=function(z){switch(T){case 1:case 2:case 3:var re=3;break;default:re=T}var M=T;T=re;try{return z()}finally{T=M}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(z,re){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var M=T;T=z;try{return re()}finally{T=M}},i.unstable_scheduleCallback=function(z,re,M){var S=i.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?S+M:S):M=S,z){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=M+N,z={id:E++,callback:re,priorityLevel:z,startTime:M,expirationTime:N,sortIndex:-1},M>S?(z.sortIndex=M,s(y,z),o(w)===null&&z===o(y)&&(U?(ae(j),j=-1):U=!0,Pe(Z,M-S))):(z.sortIndex=N,s(w,z),B||P||(B=!0,Ge(pe))),z},i.unstable_shouldYield=Me,i.unstable_wrapCallback=function(z){var re=T;return function(){var M=T;T=re;try{return z.apply(this,arguments)}finally{T=M}}}})(Wa)),Wa}var Fd;function eg(){return Fd||(Fd=1,Fa.exports=$h()),Fa.exports}/**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
@@ -42,62 +42,62 @@
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Wd;function eg(){if(Wd)return Sn;Wd=1;var i=lc(),s=$h();function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u=new Set,d={};function p(e,t){v(e,t),v(e+"Capture",t)}function v(e,t){for(d[e]=t,e=0;e<t.length;e++)u.add(t[e])}var g=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),S=Object.prototype.hasOwnProperty,y=/^[: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]*$/,E={},M={};function T(e){return S.call(M,e)?!0:S.call(E,e)?!1:y.test(e)?M[e]=!0:(E[e]=!0,!1)}function B(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function U(e,t,n,r){if(t===null||typeof t>"u"||B(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function F(e,t,n,r,l,a,f){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=f}var G={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){G[e]=new F(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];G[t]=new F(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){G[e]=new F(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){G[e]=new F(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){G[e]=new F(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){G[e]=new F(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){G[e]=new F(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){G[e]=new F(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){G[e]=new F(e,5,!1,e.toLowerCase(),null,!1,!1)});var le=/[\-:]([a-z])/g;function ge(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(le,ge);G[t]=new F(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(le,ge);G[t]=new F(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(le,ge);G[t]=new F(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){G[e]=new F(e,1,!1,e.toLowerCase(),null,!1,!1)}),G.xlinkHref=new F("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){G[e]=new F(e,1,!1,e.toLowerCase(),null,!0,!0)});function ye(e,t,n,r){var l=G.hasOwnProperty(t)?G[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="nLine truncated
|
||||
`+m+e}var J=!1;function Ne(e,t){if(!e||J)return"";J=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(I){var r=I}Reflect.construct(e,[],t)}else{try{t.call()}catch(I){r=I}e.call(t.prototype)}else{try{throw Error()}catch(I){r=I}e()}}catch(I){if(I&&r&&typeof I.stack=="string"){for(var l=I.stack.split(`
|
||||
*/var Wd;function tg(){if(Wd)return xn;Wd=1;var i=lc(),s=eg();function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u=new Set,d={};function p(e,t){v(e,t),v(e+"Capture",t)}function v(e,t){for(d[e]=t,e=0;e<t.length;e++)u.add(t[e])}var m=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),w=Object.prototype.hasOwnProperty,y=/^[: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]*$/,E={},D={};function T(e){return w.call(D,e)?!0:w.call(E,e)?!1:y.test(e)?D[e]=!0:(E[e]=!0,!1)}function P(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function B(e,t,n,r){if(t===null||typeof t>"u"||P(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function U(e,t,n,r,l,a,f){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=f}var G={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){G[e]=new U(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];G[t]=new U(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){G[e]=new U(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){G[e]=new U(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){G[e]=new U(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){G[e]=new U(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){G[e]=new U(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){G[e]=new U(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){G[e]=new U(e,5,!1,e.toLowerCase(),null,!1,!1)});var ae=/[\-:]([a-z])/g;function me(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ae,me);G[t]=new U(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ae,me);G[t]=new U(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ae,me);G[t]=new U(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){G[e]=new U(e,1,!1,e.toLowerCase(),null,!1,!1)}),G.xlinkHref=new U("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){G[e]=new U(e,1,!1,e.toLowerCase(),null,!0,!0)});function xe(e,t,n,r){var l=G.hasOwnProperty(t)?G[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="nLine truncated
|
||||
`+S+e}var W=!1;function le(e,t){if(!e||W)return"";W=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(O){var r=O}Reflect.construct(e,[],t)}else{try{t.call()}catch(O){r=O}e.call(t.prototype)}else{try{throw Error()}catch(O){r=O}e()}}catch(O){if(O&&r&&typeof O.stack=="string"){for(var l=O.stack.split(`
|
||||
`),a=r.stack.split(`
|
||||
`),f=l.length-1,x=a.length-1;1<=f&&0<=x&&l[f]!==a[x];)x--;for(;1<=f&&0<=x;f--,x--)if(l[f]!==a[x]){if(f!==1||x!==1)do if(f--,x--,0>x||l[f]!==a[x]){var k=`
|
||||
`+l[f].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),k}while(1<=f&&0<=x);break}}}finally{J=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?N(e):""}function Le(e){switch(e.tag){case 5:return N(e.type);case 16:return N("Lazy");case 13:return N("Suspense");case 19:return N("SuspenseList");case 0:case 2:case 15:return e=Ne(e.type,!1),e;case 11:return e=Ne(e.type.render,!1),e;case 1:return e=Ne(e.type,!0),e;default:return""}}function Me(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case V:return"Fragment";case C:return"Portal";case H:return"Profiler";case j:return"StrictMode";case Be:return"Suspense";case Ze:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Oe:return(e.displayName||"Context")+".Consumer";case $:return(e._context.displayName||"Context")+".Provider";case ke:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case tt:return t=e.displayName||null,t!==null?t:Me(e.type)||"Memo";case Ke:t=e._payload,e=e._init;try{return Me(e(t))}catch{}}return null}function Ge(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Me(t);case 8:return t===j?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function se(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function He(e){var t=xe(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(f){r=""+f,a.call(this,f)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(f){r=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function je(e){e._valueTracker||(e._valueTracker=He(e))}function xt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=xe(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function fe(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Bt(e,t){var n=t.checked;return O({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function qe(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=se(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Mn(e,t){t=t.checked,t!=null&&ye(e,"checked",t,!1)}function Gn(e,t){Mn(e,t);var n=se(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ln(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ln(e,t.type,se(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Qt(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ln(e,t,n){(t!=="number"||fe(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var fn=Array.isArray;function pn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+se(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function tr(e,t){if(t.dangerouslySetInLine truncated
|
||||
`).replace(sh,"")}function $s(e,t,n){if(t=tu(t),tu(e)!==t&&n)throw Error(o(425))}function eo(){}var Cl=null,Al=null;function Il(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ol=typeof setTimeout=="function"?setTimeout:void 0,oh=typeof clearTimeout=="function"?clearTimeout:void 0,nu=typeof Promise=="function"?Promise:void 0,lh=typeof queueMicrotask=="function"?queueMicrotask:typeof nu<"u"?function(e){return nu.resolve(null).then(e).catch(ah)}:Ol;function ah(e){setTimeout(function(){throw e})}function Ml(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),$i(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);$i(t)}function Ir(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ru(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Ti=Math.random().toString(36).slice(2),lr="__reactFiber$"+Ti,us="__reactProps$"+Ti,mr="__reactContainer$"+Ti,Ll="__reactEvents$"+Ti,ch="__reactListeners$"+Ti,uh="__reactHandles$"+Ti;function Jr(e){var t=e[lr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[mr]||n[lr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ru(e);e!==null;){if(n=e[lr])return n;e=ru(e)}return t}e=n,n=e.parentNode}return null}function ds(e){return e=e[lr]||e[mr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ni(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function to(e){return e[us]||null}var Dl=[],Ri=-1;function Or(e){return{current:e}}function pt(e){0>Ri||(e.current=Dl[Ri],Dl[Ri]=null,Ri--)}function ut(e,t){Ri++,Dl[Ri]=e.current,e.current=t}var Mr={},tn=Or(Mr),mn=Or(!1),$r=Mr;function Ci(e,t){var n=e.type.contextTypes;if(!n)return Mr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},a;for(a in n)l[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function vn(e){return e=e.childContextTypes,e!=null}function no(){pt(mn),pt(tn)}function iu(e,t,n){if(tn.current!==Mr)throw Error(o(168));ut(tn,t),ut(mn,n)}function su(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(o(108,Ge(e)||"Unknown",l));return O({},n,r)}function ro(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Mr,$r=tn.current,ut(tn,e),ut(mn,mn.current),!0}function ou(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=su(e,t,$r),r.__reactInternalMemoizedMergedChildContext=e,pt(mn),pt(tn),ut(tn,e)):pt(mn),ut(mn,n)}var vr=null,io=!1,jl=!1;function lu(e){vr===null?vr=[e]:vr.push(e)}function dh(e){io=!0,lu(e)}function Lr(){if(!jl&&vr!==null){jl=!0;var e=0,t=h;try{var n=vr;for(h=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}vr=null,io=!1}catch(l){throw vr!==null&&(vr=vr.slice(e+1)),gi(Tn,Lr),l}finally{h=t,jl=!1}}return null}var Ai=[],Ii=0,so=null,oo=0,zn=[],Pn=0,ei=null,yr=1,xr="";function ti(e,t){Ai[Ii++]=oo,Ai[Ii++]=so,so=e,oo=t}function au(e,t,n){zn[Pn++]=yr,zn[Pn++]=xr,zn[Pn++]=ei,ei=e;var r=yr;e=xr;var l=32-ot(r)-1;r&=~(1<<l),n+=1;var a=32-ot(t)+l;if(30<a){var f=l-l%5;a=(r&(1<<f)-1).toString(32),r>>=f,l-=f,yr=1<<32-ot(t)+l|n<<l|r,xr=a+e}else yr=1<<a|n<<l|r,xr=e}function zl(e){e.return!==null&&(ti(e,1),au(e,1,0))}function Pl(e){for(;e===so;)so=Ai[--Ii],Ai[Ii]=null,oo=Ai[--Ii],Ai[Ii]=null;for(;e===ei;)ei=zn[--Pn],zn[Pn]=null,xr=zn[--Pn],zn[Pn]=null,yr=zn[--Pn],zn[Pn]=null}var Cn=null,An=null,mt=!1,Zn=null;function cu(e,t){var n=Wn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function uu(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Cn=e,An=Ir(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Cn=e,An=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ei!==null?{id:yr,overflow:xr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Wn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Cn=e,An=null,!0):!1;default:return!1}}function Bl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ul(e){if(mt){var t=An;if(t){var n=t;if(!uu(e,t)){if(Bl(e))throw Error(o(418));t=Ir(n.nextSibling);var r=Cn;t&&uu(e,t)?cu(r,n):(e.flags=e.flags&-4097|2,mt=!1,Cn=e)}}else{if(Bl(e))throw Error(o(418));e.flags=e.flags&-4097|2,mt=!1,Cn=e}}}function du(e){for(e=e.retLine truncated
|
||||
`+l[f].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),k}while(1<=f&&0<=x);break}}}finally{W=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?N(e):""}function Le(e){switch(e.tag){case 5:return N(e.type);case 16:return N("Lazy");case 13:return N("Suspense");case 19:return N("SuspenseList");case 0:case 2:case 15:return e=le(e.type,!1),e;case 11:return e=le(e.type.render,!1),e;case 1:return e=le(e.type,!0),e;default:return""}}function Ae(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case V:return"Fragment";case A:return"Portal";case H:return"Profiler";case j:return"StrictMode";case Be:return"Suspense";case qe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Me:return(e.displayName||"Context")+".Consumer";case ee:return(e._context.displayName||"Context")+".Provider";case be:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $e:return t=e.displayName||null,t!==null?t:Ae(e.type)||"Memo";case Ge:t=e._payload,e=e._init;try{return Ae(e(t))}catch{}}return null}function We(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ae(t);case 8:return t===j?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function se(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _e(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ze(e){var t=_e(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(f){r=""+f,a.call(this,f)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(f){r=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function De(e){e._valueTracker||(e._valueTracker=ze(e))}function yt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=_e(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function fe(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function zt(e,t){var n=t.checked;return M({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ke(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=se(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Mn(e,t){t=t.checked,t!=null&&xe(e,"checked",t,!1)}function Gn(e,t){Mn(e,t);var n=se(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ln(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ln(e,t.type,se(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Vt(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ln(e,t,n){(t!=="number"||fe(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var cn=Array.isArray;function un(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+se(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function tr(e,t){if(t.dangerouslySetILine truncated
|
||||
`).replace(oh,"")}function $s(e,t,n){if(t=tu(t),tu(e)!==t&&n)throw Error(o(425))}function eo(){}var Cl=null,Al=null;function Il(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ol=typeof setTimeout=="function"?setTimeout:void 0,lh=typeof clearTimeout=="function"?clearTimeout:void 0,nu=typeof Promise=="function"?Promise:void 0,ah=typeof queueMicrotask=="function"?queueMicrotask:typeof nu<"u"?function(e){return nu.resolve(null).then(e).catch(ch)}:Ol;function ch(e){setTimeout(function(){throw e})}function Ml(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),$i(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);$i(t)}function Or(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ru(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Ti=Math.random().toString(36).slice(2),ar="__reactFiber$"+Ti,us="__reactProps$"+Ti,vr="__reactContainer$"+Ti,Ll="__reactEvents$"+Ti,uh="__reactListeners$"+Ti,dh="__reactHandles$"+Ti;function $r(e){var t=e[ar];if(t)return t;for(var n=e.parentNode;n;){if(t=n[vr]||n[ar]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ru(e);e!==null;){if(n=e[ar])return n;e=ru(e)}return t}e=n,n=e.parentNode}return null}function ds(e){return e=e[ar]||e[vr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ni(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function to(e){return e[us]||null}var Dl=[],Ri=-1;function Mr(e){return{current:e}}function pt(e){0>Ri||(e.current=Dl[Ri],Dl[Ri]=null,Ri--)}function ut(e,t){Ri++,Dl[Ri]=e.current,e.current=t}var Lr={},Zt=Mr(Lr),hn=Mr(!1),ei=Lr;function Ci(e,t){var n=e.type.contextTypes;if(!n)return Lr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},a;for(a in n)l[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function gn(e){return e=e.childContextTypes,e!=null}function no(){pt(hn),pt(Zt)}function iu(e,t,n){if(Zt.current!==Lr)throw Error(o(168));ut(Zt,t),ut(hn,n)}function su(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(o(108,We(e)||"Unknown",l));return M({},n,r)}function ro(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Lr,ei=Zt.current,ut(Zt,e),ut(hn,hn.current),!0}function ou(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=su(e,t,ei),r.__reactInternalMemoizedMergedChildContext=e,pt(hn),pt(Zt),ut(Zt,e)):pt(hn),ut(hn,n)}var yr=null,io=!1,jl=!1;function lu(e){yr===null?yr=[e]:yr.push(e)}function fh(e){io=!0,lu(e)}function Dr(){if(!jl&&yr!==null){jl=!0;var e=0,t=h;try{var n=yr;for(h=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}yr=null,io=!1}catch(l){throw yr!==null&&(yr=yr.slice(e+1)),gi(Tn,Dr),l}finally{h=t,jl=!1}}return null}var Ai=[],Ii=0,so=null,oo=0,zn=[],Pn=0,ti=null,xr=1,wr="";function ni(e,t){Ai[Ii++]=oo,Ai[Ii++]=so,so=e,oo=t}function au(e,t,n){zn[Pn++]=xr,zn[Pn++]=wr,zn[Pn++]=ti,ti=e;var r=xr;e=wr;var l=32-st(r)-1;r&=~(1<<l),n+=1;var a=32-st(t)+l;if(30<a){var f=l-l%5;a=(r&(1<<f)-1).toString(32),r>>=f,l-=f,xr=1<<32-st(t)+l|n<<l|r,wr=a+e}else xr=1<<a|n<<l|r,wr=e}function zl(e){e.return!==null&&(ni(e,1),au(e,1,0))}function Pl(e){for(;e===so;)so=Ai[--Ii],Ai[Ii]=null,oo=Ai[--Ii],Ai[Ii]=null;for(;e===ti;)ti=zn[--Pn],zn[Pn]=null,wr=zn[--Pn],zn[Pn]=null,xr=zn[--Pn],zn[Pn]=null}var Cn=null,An=null,gt=!1,Zn=null;function cu(e,t){var n=Wn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function uu(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Cn=e,An=Or(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Cn=e,An=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ti!==null?{id:xr,overflow:wr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Wn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Cn=e,An=null,!0):!1;default:return!1}}function Bl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ul(e){if(gt){var t=An;if(t){var n=t;if(!uu(e,t)){if(Bl(e))throw Error(o(418));t=Or(n.nextSibling);var r=Cn;t&&uu(e,t)?cu(r,n):(e.flags=e.flags&-4097|2,gt=!1,Cn=e)}}else{if(Bl(e))throw Error(o(418));e.flags=e.flags&-4097|2,gt=!1,Cn=e}}}function du(e){for(e=e.retLine truncated
|
||||
Error generating stack: `+a.message+`
|
||||
`+a.stack}return{value:e,source:t,stack:l,digest:null}}function aa(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ca(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var wh=typeof WeakMap=="function"?WeakMap:Map;function Yu(e,t,n){n=Sr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){No||(No=!0,ba=r),ca(e,t)},n}function Ku(e,t,n){n=Sr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){ca(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){ca(e,t),typeof r!="function"&&(Pr===null?Pr=new Set([this]):Pr.add(this));var f=t.stack;this.componentDidCatch(t.value,{componentStack:f!==null?f:""})}),n}function Vu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new wh;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Lh.bind(null,e,t,n),t.then(e,e))}function qu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Qu(e,t,n,r,l){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Sr(-1,1),t.tag=2,jr(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=l,e)}var Sh=Q.ReactCurrentOwner,yn=!1;function an(e,t,n,r){t.child=e===null?gu(t,null,n,r):Mi(t,e.child,n,r)}function Zu(e,t,n,r,l){n=n.render;var a=t.ref;return Di(t,l),r=ea(e,t,n,r,a,l),n=ta(),e!==null&&!yn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Er(e,t,l)):(mt&&n&&zl(t),t.flags|=1,an(e,t,r,l),t.child)}function Xu(e,t,n,r,l){if(e===null){var a=n.type;return typeof a=="function"&&!Ia(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Ju(e,t,a,r,l)):(e=Mo(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&l)===0){var f=a.memoizedProps;if(n=n.compare,n=n!==null?n:ss,n(f,r)&&e.ref===t.ref)return Er(e,t,l)}return t.flags|=1,e=Wr(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ju(e,t,n,r,l){if(e!==null){var a=e.memoizedProps;if(ss(a,r)&&e.ref===t.ref)if(yn=!1,t.pendingProps=r=a,(e.lanes&l)!==0)(e.flags&131072)!==0&&(yn=!0);else return t.lanes=e.lanes,Er(e,t,l)}return ua(e,t,n,r,l)}function $u(e,t,n){var r=t.pendingProps,l=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(Bi,In),In|=n;else{if((n&1073741824)===0)return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ut(Bi,In),In|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,ut(Bi,In),In|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,ut(Bi,In),In|=r;return an(e,t,l,n),t.child}function ed(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ua(e,t,n,r,l){var a=vn(n)?$r:tn.current;return a=Ci(t,a),Di(t,l),n=ea(e,t,n,r,a,l),r=ta(),e!==null&&!yn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Er(e,t,l)):(mt&&r&&zl(t),t.flags|=1,an(e,t,n,l),t.child)}function td(e,t,n,r,l){if(vn(n)){var a=!0;ro(t)}else a=!1;if(Di(t,l),t.stateNode===null)Eo(e,t),Hu(t,n,r),la(t,n,r,l),r=!0;else if(e===null){var f=t.stateNode,x=t.memoizedProps;f.props=x;var k=f.context,I=n.contextType;typeof I=="object"&&I!==null?I=Bn(I):(I=vn(n)?$r:tn.current,I=Ci(t,I));var q=n.getDerivedStateFromProps,X=typeof q=="function"||typeof f.getSnapshotBeforeUpdate=="function";X||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(x!==r||k!==I)&&Gu(t,f,r,I),Dr=!1;var K=t.memoizedState;f.state=K,po(t,r,f,l),k=t.memoizedState,x!==r||K!==k||mn.current||Dr?(typeof q=="function"&&(oa(t,n,q,r),k=t.memoizedState),(x=Dr||Wu(t,n,x,r,K,k,I))?(X||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=k),f.props=r,f.state=k,f.context=I,r=x):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{f=t.stateNode,vu(e,t),x=t.memoizedProps,I=t.type===t.elementType?x:Xn(t.type,x),f.props=I,X=t.pendingProps,K=f.context,k=n.contextType,typeof k=="object"&&k!==null?k=Bn(k):(k=vn(n)?$r:tn.current,k=Ci(t,k));var me=n.getDerivedStateFromProps;(q=typeof me=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(x!==X||K!==k)&&Gu(t,f,r,k),Dr=!1,K=t.memoizedState,f.state=K,po(t,r,fLine truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jg(i,s){return Mg(i)||Lg(i,s)||zg(i,s)||Dg()}function zg(i,s){if(i){if(typeof i=="string")return Yd(i,s);var o={}.toString.call(i).slice(8,-1);return o==="Object"&&i.constructor&&(o=i.constructor.name),o==="Map"||o==="Set"?Array.from(i):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?Yd(i,s):void 0}}const Mf=Object.entries,Kd=Object.setPrototypeOf,Pg=Object.isFrozen,Bg=Object.getPrototypeOf,Ug=Object.getOwnPropertyDescriptor;let Vt=Object.freeze,qt=Object.seal,Yi=Object.create,Lf=typeof Reflect<"u"&&Reflect,$a=Lf.apply,ec=Lf.construct;Vt||(Vt=function(s){return s});qt||(qt=function(s){return s});$a||($a=function(s,o){for(var u=arguments.length,d=new Array(u>2?u-2:0),p=2;p<u;p++)d[p-2]=arguments[p];return s.apply(o,d)});ec||(ec=function(s){for(var o=arguments.length,u=new Array(o>1?o-1:0),d=1;d<o;d++)u[d-1]=arguments[d];return new s(...u)});const Wi=At(Array.prototype.forEach),Fg=At(Array.prototype.lastIndexOf),Vd=At(Array.prototype.pop),Hi=At(Array.prototype.push),Wg=At(Array.prototype.splice),Vr=Array.isArray,Ds=At(String.prototype.toLowerCase),Ha=At(String.prototype.toString),qd=At(String.prototype.match),Ns=At(String.prototype.replace),Qd=At(String.prototype.indexOf),Hg=At(String.prototype.trim),Gg=At(Number.prototype.toString),Yg=At(Boolean.prototype.toString),Zd=typeof BigInt>"u"?null:At(BigInt.prototype.toString),Xd=typeof Symbol>"u"?null:At(Symbol.prototype.toString),Pt=At(Object.prototype.hasOwnProperty),Rs=At(Object.prototype.toString),zt=At(RegExp.prototype.test),ui=Kg(TypeError);function At(i){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var o=arguments.length,u=new Array(o>1?o-1:0),d=1;d<o;d++)u[d-1]=arguments[d];return $a(i,s,u)}}function Kg(i){return function(){for(var s=arguments.length,o=new Array(s),u=0;u<s;u++)o[u]=arguments[u];return ec(i,o)}}function Qe(i,s){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ds;if(Kd&&Kd(i,null),!Vr(s))return i;let u=s.length;for(;u--;){let d=s[u];if(typeof d=="string"){const p=o(d);p!==d&&(Pg(s)||(s[u]=p),d=p)}i[d]=!0}return i}function Vg(i){for(let s=0;s<i.length;s++)Pt(i,s)||(i[s]=null);return i}function un(i){const s=Yi(null);for(const u of Mf(i)){var o=jg(u,2);const d=o[0],p=o[1];Pt(i,d)&&(Vr(p)?s[d]=Vg(p):p&&typeof p=="object"&&p.constructor===Object?s[d]=un(p):s[d]=p)}return s}function qg(i){switch(typeof i){case"string":return i;case"number":return Gg(i);case"boolean":return Yg(i);case"bigint":return Zd?Zd(i):"0";case"symbol":return Xd?Xd(i):"Symbol()";case"undefined":return Rs(i);case"function":case"object":{if(i===null)return Rs(i);const s=i,o=fr(s,"toString");if(typeof o=="function"){const u=o(s);return typeof u=="string"?u:Rs(u)}return Rs(i)}default:return Rs(i)}}function fr(i,s){for(;i!==null;){const u=Ug(i,s);if(u){if(u.get)return At(u.get);if(typeof u.value=="function")return At(u.value)}i=Bg(i)}function o(){return null}return o}function Qg(i){try{return zt(i,""),!0}catch{return!1}}const Jd=Vt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ga=Vt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ya=Vt(["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"]),Zg=Vt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","sLine truncated
|
||||
`+Nt),Ut&&(Nt=Fe(Nt)),C&&Yn?ke(Nt):Nt},s.setConfig=function(){let te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ir(te),ln=!0,hn=je,_t=fe},s.clearConfig=function(){$t=null,ln=!1,hn=null,_t=null,C=j,V=""},s.isValidAttribute=function(te,h,b){$t||ir({});const Y=lt(te),oe=lt(h);return or(Y,oe,b)},s.addHook=function(te,h){typeof h=="function"&&Pt(m,te)&&Hi(m[te],h)},s.removeHook=function(te,h){if(Pt(m,te)){if(h!==void 0){const b=Fg(m[te],h);return b===-1?void 0:Wg(m[te],b,1)[0]}return Vd(m[te])}},s.removeHooks=function(te){Pt(m,te)&&(m[te]=[])},s.removeAllHooks=function(){m=of()},s}var dm=Df(),qa,lf;function fm(){if(lf)return qa;lf=1;function i(w){return w instanceof Map?w.clear=w.delete=w.set=function(){throw new Error("map is read-only")}:w instanceof Set&&(w.add=w.clear=w.delete=function(){throw new Error("set is read-only")}),Object.freeze(w),Object.getOwnPropertyNames(w).forEach(D=>{const z=w[D],be=typeof z;(be==="object"||be==="function")&&!Object.isFrozen(z)&&i(z)}),w}class s{constructor(D){D.data===void 0&&(D.data={}),this.data=D.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function o(w){return w.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function u(w,...D){const z=Object.create(null);for(const be in w)z[be]=w[be];return D.forEach(function(be){for(const We in be)z[We]=be[We]}),z}const d="</span>",p=w=>!!w.scope,v=(w,{prefix:D})=>{if(w.startsWith("language:"))return w.replace("language:","language-");if(w.includes(".")){const z=w.split(".");return[`${D}${z.shift()}`,...z.map((be,We)=>`${be}${"_".repeat(We+1)}`)].join(" ")}return`${D}${w}`};class g{constructor(D,z){this.buffer="",this.classPrefix=z.classPrefix,D.walk(this)}addText(D){this.buffer+=o(D)}openNode(D){if(!p(D))return;const z=v(D.scope,{prefix:this.classPrefix});this.span(z)}closeNode(D){p(D)&&(this.buffer+=d)}value(){return this.buffer}span(D){this.buffer+=`<span class="${D}">`}}const S=(w={})=>{const D={children:[]};return Object.assign(D,w),D};class y{constructor(){this.rootNode=S(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(D){this.top.children.push(D)}openNode(D){const z=S({scope:D});this.add(z),this.stack.push(z)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(D){return this.constructor._walk(D,this.rootNode)}static _walk(D,z){return typeof z=="string"?D.addText(z):z.children&&(D.openNode(z),z.children.forEach(be=>this._walk(D,be)),D.closeNode(z)),D}static _collapse(D){typeof D!="string"&&D.children&&(D.children.every(z=>typeof z=="string")?D.children=[D.children.join("")]:D.children.forEach(z=>{y._collapse(z)}))}}class E extends y{constructor(D){super(),this.options=D}addText(D){D!==""&&this.add(D)}startScope(D){this.openNode(D)}endScope(){this.closeNode()}__addSublanguage(D,z){const be=D.root;z&&(be.scope=`language:${z}`),this.add(be)}toHTML(){return new g(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function M(w){return w?typeof w=="string"?w:w.source:null}function T(w){return F("(?=",w,")")}function B(w){return F("(?:",w,")*")}function U(w){return F("(?:",w,")?")}function F(...w){return w.map(z=>M(z)).join("")}function G(w){const D=w[w.length-1];return typeof D=="object"&&D.constructor===Object?(w.splice(w.length-1,1),D):{}}function le(...w){return"("+(G(w).capture?"":"?:")+w.map(be=>M(be)).join("|")+")"}function ge(w){return new RegExp(w.toString()+"|").exec("").length-1}function ye(w,D){const z=w&&w.exec(D);return z&&z.index===0}const Q=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function de(w,{joinWith:D}){let z=0;return w.map(be=>{z+=1;const We=z;let nt=M(be),he="";for(;nt.length>0;){const pe=Q.exec(nt);if(!pe){he+=nt;break}he+=nt.substring(0,pe.index),nt=nt.substring(pe.index+pe[0].length),pe[0][0]==="\\"&&pe[1]?he+="\\"+String(Number(pe[1])+We):(he+=pe[0],pe[0]==="("&&z++)}return he}).map(be=>`(${be})`).join(D)}const C=/\b\B/,V="[a-zA-Z]\\w*",j="[a-zA-Z_]\\w*",H="\\b\\d+(\\.\\d+)?",$="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Oe="\\b(0b[01]+)",ke="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Be=(w={})=>{const D=/^#![ ]*\//;return w.binary&&(w.begin=F(D,/.*\b/,w.binary,/\b.*/)),u({scope:"meta",begin:D,end:/$/,relevance:0,"on:begin":(z,be)=>{z.index!==0&&be.ignoreMatch()}},w)},Ze={begin:"\\\\[\\s\\S]",relevance:0},tt={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ze]},Ke={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ze]},Pe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},P=function(w,D,z={}){const be=u({scope:"comment",begin:w,end:D,contains:[]},z);be.contains.push({scope:"doctagLine truncated
|
||||
https://github.com/highlightjs/highlight.js/issues/2277`),dt=ee,Fe=_e),Ue===void 0&&(Ue=!0);const ot={code:Fe,language:dt};hr("before:highlight",ot);const Ht=ot.result?ot.result:gn(ot.language,ot.code,Ue);return Ht.code=ot.code,hr("after:highlight",Ht),Ht}function gn(ee,_e,Ue,Fe){const dt=Object.create(null);function ot(Z,ce){return Z.keywords[ce]}function Ht(){if(!b.keywords){oe.addText(ae);return}let Z=0;b.keywordPatternRe.lastIndex=0;let ce=b.keywordPatternRe.exec(ae),we="";for(;ce;){we+=ae.substring(Z,ce.index);const Ve=en.case_insensitive?ce[0].toLowerCase():ce[0],wt=ot(b,Ve);if(wt){const[Mt,cl]=wt;if(oe.addText(we),we="",dt[Ve]=(dt[Ve]||0)+1,dt[Ve]<=re&&(Ce+=cl),Mt.startsWith("_"))we+=ce[0];else{const Us=en.classNameAliases[Mt]||Mt;Gt(ce[0],Us)}}else we+=ce[0];Z=b.keywordPatternRe.lastIndex,ce=b.keywordPatternRe.exec(ae)}we+=ae.substring(Z),oe.addText(we)}function jn(){if(ae==="")return;let Z=null;if(typeof b.subLanguage=="string"){if(!D[b.subLanguage]){oe.addText(ae);return}Z=gn(b.subLanguage,ae,!0,Y[b.subLanguage]),Y[b.subLanguage]=Z._top}else Z=bn(ae,b.subLanguage.length?b.subLanguage:null);b.relevance>0&&(Ce+=Z.relevance),oe.__addSublanguage(Z._emitter,Z.language)}function ct(){b.subLanguage!=null?jn():Ht(),ae=""}function Gt(Z,ce){Z!==""&&(oe.startScope(ce),oe.addText(Z),oe.endScope())}function gr(Z,ce){let we=1;const Ve=ce.length-1;for(;we<=Ve;){if(!Z._emit[we]){we++;continue}const wt=en.classNameAliases[Z[we]]||Z[we],Mt=ce[we];wt?Gt(Mt,wt):(ae=Mt,Ht(),ae=""),we++}}function Vn(Z,ce){return Z.scope&&typeof Z.scope=="string"&&oe.openNode(en.classNameAliases[Z.scope]||Z.scope),Z.beginScope&&(Z.beginScope._wrap?(Gt(ae,en.classNameAliases[Z.beginScope._wrap]||Z.beginScope._wrap),ae=""):Z.beginScope._multi&&(gr(Z.beginScope,ce),ae="")),b=Object.create(Z,{parent:{value:b}}),b}function or(Z,ce,we){let Ve=ye(Z.endRe,we);if(Ve){if(Z["on:end"]){const wt=new s(Z);Z["on:end"](ce,wt),wt.isMatchIgnored&&(Ve=!1)}if(Ve){for(;Z.endsParent&&Z.parent;)Z=Z.parent;return Z}}if(Z.endsWithParent)return or(Z.parent,ce,we)}function Zi(Z){return b.matcher.regexIndex===0?(ae+=Z[0],1):(Nt=!0,0)}function yi(Z){const ce=Z[0],we=Z.rule,Ve=new s(we),wt=[we.__beforeBegin,we["on:begin"]];for(const Mt of wt)if(Mt&&(Mt(Z,Ve),Ve.isMatchIgnored))return Zi(ce);return we.skip?ae+=ce:(we.excludeBegin&&(ae+=ce),ct(),!we.returnBegin&&!we.excludeBegin&&(ae=ce)),Vn(we,Z),we.returnBegin?0:ce.length}function Xr(Z){const ce=Z[0],we=_e.substring(Z.index),Ve=or(b,Z,we);if(!Ve)return L;const wt=b;b.endScope&&b.endScope._wrap?(ct(),Gt(ce,b.endScope._wrap)):b.endScope&&b.endScope._multi?(ct(),gr(b.endScope,Z)):wt.skip?ae+=ce:(wt.returnEnd||wt.excludeEnd||(ae+=ce),ct(),wt.excludeEnd&&(ae=ce));do b.scope&&oe.closeNode(),!b.skip&&!b.subLanguage&&(Ce+=b.relevance),b=b.parent;while(b!==Ve.parent);return Ve.starts&&Vn(Ve.starts,Z),wt.returnEnd?0:ce.length}function xi(){const Z=[];for(let ce=b;ce!==en;ce=ce.parent)ce.scope&&Z.unshift(ce.scope);Z.forEach(ce=>oe.openNode(ce))}let qn={};function Nn(Z,ce){const we=ce&&ce[0];if(ae+=Z,we==null)return ct(),0;if(qn.type==="begin"&&ce.type==="end"&&qn.index===ce.index&&we===""){if(ae+=_e.slice(ce.index,ce.index+1),!We){const Ve=new Error(`0 width match regex (${ee})`);throw Ve.languageName=ee,Ve.badRule=qn.rule,Ve}return 1}if(qn=ce,ce.type==="begin")return yi(ce);if(ce.type==="illegal"&&!Ue){const Ve=new Error('Illegal lexeme "'+we+'" for mode "'+(b.scope||"<unnamed>")+'"');throw Ve.mode=b,Ve}else if(ce.type==="end"){const Ve=Xr(ce);if(Ve!==L)return Ve}if(ce.type==="illegal"&&we==="")return ae+=`
|
||||
`,1;if(gt>1e5&>>ce.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ae+=we,we.length}const en=_n(ee);if(!en)throw Et(nt.replace("{}",ee)),new Error('Unknown language: "'+ee+'"');const te=Xt(en);let h="",b=Fe||te;const Y={},oe=new pe.__emitter(pe);xi();let ae="",Ce=0,Xe=0,gt=0,Nt=!1;try{if(en.__emitTokens)en.__emitTokens(_e,oe);else{for(b.matcher.considerAll();;){gt++,Nt?Nt=!1:b.matcher.considerAll(),b.matcher.lastIndex=Xe;const Z=b.matcher.exec(_e);if(!Z)break;const ce=_e.substring(Xe,Z.index),we=Nn(ce,Z);Xe=Z.index+we}Nn(_e.substring(Xe))}return oe.finalize(),h=oe.toHTML(),{language:ee,value:h,relevance:Ce,illegal:!1,_emitter:oe,_top:b}}catch(Z){if(Z.message&&Z.message.includes("Illegal"))return{language:ee,value:Wt(_e),illegal:!0,relevance:0,_illegalBy:{message:Z.message,index:Xe,context:_e.slice(Xe-100,Xe+100),mode:Z.mode,resultSoFar:h},_emitter:oe};if(We)return{language:ee,value:Wt(_e),illegal:!1,relevance:0,errorRaised:Z,_emitter:oe,_top:b};throw Z}}function rr(ee){const _e={value:Wt(ee),illegal:!1,relevance:0,_top:he,_emitter:new pe.__emitter(pe)};return _e._emitter.addText(ee),_e}function bn(ee,_e){_e=_e||pe.languages||Object.keys(D);const Ue=rr(ee),Fe=_e.filter(_n).filter(vi).map(ct=>gn(ct,ee,!1));Fe.unshift(Ue);const dt=Fe.sort((ct,Gt)=>{if(ct.relevance!==Gt.relevance)return Gt.relevance-ct.relevance;if(ct.language&&Gt.language){if(_n(ct.language).supersetOf===Gt.language)return 1;if(_n(Gt.language).supersetOf===ct.language)return-1}return 0}),[ot,Ht]=dt,jn=ot;return jn.secondBest=Ht,jn}function Qi(ee,_e,Ue){const Fe=_e&&z[_e]||Ue;ee.classList.add("hljs"),ee.classList.add(`language-${Fe}`)}function qr(ee){let _e=null;const Ue=ht(ee);if(Re(Ue))return;if(hr("before:highlightElement",{el:ee,language:Ue}),ee.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ee);return}if(ee.children.length>0&&(pe.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ee)),pe.throwUnescapedHTML))throw new Kn("One of your code blocks includes unescaped HTML.",ee.innerHTML);_e=ee;const Fe=_e.textContent,dt=Ue?st(Fe,{language:Ue,ignoreIllegals:!0}):bn(Fe);ee.innerHTML=dt.value,ee.dataset.highlighted="yes",Qi(ee,Ue,dt.language),ee.result={language:dt.language,re:dt.relevance,relevance:dt.relevance},dt.secondBest&&(ee.secondBest={language:dt.secondBest.language,relevance:dt.secondBest.relevance}),hr("after:highlightElement",{el:ee,result:dt,text:Fe})}function lt(ee){pe=Tt(pe,ee)}const $t=()=>{ir(),ln("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function hi(){ir(),ln("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Nr=!1;function ir(){function ee(){ir()}if(document.readyState==="loading"){Nr||window.addEventListener("DOMContentLoaded",ee,!1),Nr=!0;return}document.querySelectorAll(pe.cssSelector).forEach(qr)}function Qr(ee,_e){let Ue=null;try{Ue=_e(w)}catch(Fe){if(Et("Language definition for '{}' could not be registered.".replace("{}",ee)),We)Et(Fe);else throw Fe;Ue=he}Ue.name||(Ue.name=ee),D[ee]=Ue,Ue.rawDefinition=_e.bind(null,w),Ue.aliases&&mi(Ue.aliases,{languageName:ee})}function Zr(ee){delete D[ee];for(const _e of Object.keys(z))z[_e]===ee&&delete z[_e]}function gi(){return Object.keys(D)}function _n(ee){return ee=(ee||"").toLowerCase(),D[ee]||D[z[ee]]}function mi(ee,{languageName:_e}){typeof ee=="string"&&(ee=[ee]),ee.forEach(Ue=>{z[Ue.toLowerCase()]=_e})}function vi(ee){const _e=_n(ee);return _e&&!_e.disableAutodetect}function $e(ee){ee["before:highlightBlock"]&&!ee["before:highlightElement"]&&(ee["before:highlightElement"]=_e=>{ee["before:highlightBlock"](Object.assign({block:_e.el},_e))}),ee["after:highlightBlock"]&&!ee["after:highlightElement"]&&(ee["after:highlightElement"]=_e=>{ee["after:highlightBlock"](Object.assign({block:_e.el},_e))})}function Rr(ee){$e(ee),be.push(ee)}function Tn(ee){const _e=be.indexOf(ee);_e!==-1&&be.splice(_e,1)}function hr(ee,_e){const Ue=ee;be.forEach(function(Fe){Fe[Ue]&&Fe[Ue](_e)})}function sr(ee){return ln("10.7.0","highlightBlock will be removed entirely in v12.0"),ln("10.7.0","Please use highlightElement now."),qr(ee)}Object.assign(w,{highlight:st,highlightAuto:bn,highlightAll:ir,highlightElement:qr,highlightBlock:sr,configure:lt,initHighlighting:$t,initHighlightingOnLoad:hi,registerLanguage:Qr,unregisterLanguage:Zr,listLanguages:gi,getLanguage:_n,registerAliases:mi,autoDetection:vi,inherit:Tt,addPlugin:Rr,removePlugin:Tn}),w.debugMode=function(){We=!1},w.safeMode=function(){We=!0},w.versionString=Dn,w.regex={concat:F,lookahead:T,either:le,optional:U,anyNumberOfTimes:B};for(const ee in He)typeof He[ee]=="object"&&i(He[ee]);return Object.assign(w,He),w},De=ue({});return De.newInstance=()=>ue({}),qa=De,De.HLine truncated
|
||||
]`).replace("lheading",Zf).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},tv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,nv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Jf=/^( {2,}|\\)\n(?!\s*$)/,rv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ol=/[\p{P}\p{S}]/u,gc=/[\s\p{P}\p{S}]/u,$f=/[^\s\p{P}\p{S}]/u,iv=it(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,gc).getRegex(),ep=/(?!~)[\p{P}\p{S}]/u,sv=/(?!~)[\s\p{P}\p{S}]/u,ov=/(?:[^\s\p{P}\p{S}]|~)/u,lv=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,tp=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,av=it(tp,"u").replace(/punct/g,ol).getRegex(),cv=it(tp,"u").replace(/punct/g,ep).getRegex(),np="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",uv=it(np,"gu").replace(/notPunctSpace/g,$f).replace(/punctSpace/g,gc).replace(/punct/g,ol).getRegex(),dv=it(np,"gu").replace(/notPunctSpace/g,ov).replace(/punctSpace/g,sv).replace(/punct/g,ep).getRegex(),fv=it("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,$f).replace(/punctSpace/g,gc).replace(/punct/g,ol).getRegex(),pv=it(/\\(punct)/,"gu").replace(/punct/g,ol).getRegex(),hv=it(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),gv=it(pc).replace("(?:-->|$)","-->").getRegex(),mv=it("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",gv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Jo=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,vv=it(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Jo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),rp=it(/^!?\[(label)\]\[(ref)\]/).replace("label",Jo).replace("ref",fc).getRegex(),ip=it(/^!?\[(ref)\](?:\[\])?/).replace("ref",fc).getRegex(),yv=it("reflink|nolink(?!\\()","g").replace("reflink",rp).replace("nolink",ip).getRegex(),mc={_backpedal:zs,anyPunctuation:pv,autolink:hv,blockSkip:lv,br:Jf,code:nv,del:zs,emStrongLDelim:av,emStrongRDelimAst:uv,emStrongRDelimUnd:fv,escape:tv,link:vv,nolink:ip,punctuation:iv,reflink:rp,reflinkSearch:yv,tag:mv,text:rv,url:zs},xv={...mc,link:it(/^!?\[(label)\]\((.*?)\)/).replace("label",Jo).getRegex(),reflink:it(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Jo).getRegex()},tc={...mc,emStrongRDelimAst:dv,emStrongLDelim:cv,url:it(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},wv={...tc,br:it(Jf).replace("{2,}","*").getRegex(),text:it(tc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ko={normal:hc,gfm:$m,pedantic:ev},Cs={normal:mc,gfm:tc,breaks:wv,pedantic:xv},Sv={"&":"&","<":"<",">":">",'"':""","'":"'"},df=i=>Sv[i];function pr(i,s){if(s){if(dn.escapeTest.test(i))return i.replace(dn.escapeReplace,df)}else if(dn.escapeTestNoEncode.test(i))return i.replace(dn.escapeReplaceNoEncode,df);return i}function ff(i){try{i=encodeURI(i).replace(dn.percentDecode,"%")}catch{return null}return i}function pf(i,s){var p;const o=i.replace(dn.findPipe,(v,g,S)=>{let y=!1,E=g;for(;--E>=0&&S[E]==="\\";)y=!y;return y?"|":" |"}),u=o.split(dn.splitPipe);let d=0;if(u[0].trim()||u.shift(),u.length>0&&!((p=u.at(-1))!=null&&p.trim())&&u.pop(),s)if(u.length>s)u.splice(s);else for(;u.length<s;)u.push("");for(;d<u.length;d++)u[d]=u[d].trim().replace(dn.slashPipe,"|");return u}function As(i,s,o){const u=i.length;if(u===0)return"";let d=0;for(;d<u&&i.charAt(u-d-1)===s;)d++;return i.slice(0,u-d)}function Ev(i,s){if(i.indexOf(s[1])===-1)return-1;let o=0;for(let u=0;u<i.length;u++)if(i[u]==="\\")u++;else if(i[u]===s[0])o++;else if(i[u]===s[1]Line truncated
|
||||
`).map(p=>{const v=p.match(o.other.beginningSpace);if(v===null)return p;const[g]=v;return g.length>=d.length?p.slice(d.length):p}).join(`
|
||||
`+a.stack}return{value:e,source:t,stack:l,digest:null}}function aa(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ca(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Sh=typeof WeakMap=="function"?WeakMap:Map;function Yu(e,t,n){n=Er(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){No||(No=!0,ba=r),ca(e,t)},n}function Ku(e,t,n){n=Er(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){ca(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){ca(e,t),typeof r!="function"&&(Br===null?Br=new Set([this]):Br.add(this));var f=t.stack;this.componentDidCatch(t.value,{componentStack:f!==null?f:""})}),n}function Vu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Sh;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Dh.bind(null,e,t,n),t.then(e,e))}function qu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Qu(e,t,n,r,l){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Er(-1,1),t.tag=2,zr(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=l,e)}var Eh=Z.ReactCurrentOwner,mn=!1;function sn(e,t,n,r){t.child=e===null?gu(t,null,n,r):Mi(t,e.child,n,r)}function Zu(e,t,n,r,l){n=n.render;var a=t.ref;return Di(t,l),r=ea(e,t,n,r,a,l),n=ta(),e!==null&&!mn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,kr(e,t,l)):(gt&&n&&zl(t),t.flags|=1,sn(e,t,r,l),t.child)}function Xu(e,t,n,r,l){if(e===null){var a=n.type;return typeof a=="function"&&!Ia(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Ju(e,t,a,r,l)):(e=Mo(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&l)===0){var f=a.memoizedProps;if(n=n.compare,n=n!==null?n:ss,n(f,r)&&e.ref===t.ref)return kr(e,t,l)}return t.flags|=1,e=Hr(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ju(e,t,n,r,l){if(e!==null){var a=e.memoizedProps;if(ss(a,r)&&e.ref===t.ref)if(mn=!1,t.pendingProps=r=a,(e.lanes&l)!==0)(e.flags&131072)!==0&&(mn=!0);else return t.lanes=e.lanes,kr(e,t,l)}return ua(e,t,n,r,l)}function $u(e,t,n){var r=t.pendingProps,l=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(Bi,In),In|=n;else{if((n&1073741824)===0)return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ut(Bi,In),In|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,ut(Bi,In),In|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,ut(Bi,In),In|=r;return sn(e,t,l,n),t.child}function ed(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ua(e,t,n,r,l){var a=gn(n)?ei:Zt.current;return a=Ci(t,a),Di(t,l),n=ea(e,t,n,r,a,l),r=ta(),e!==null&&!mn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,kr(e,t,l)):(gt&&r&&zl(t),t.flags|=1,sn(e,t,n,l),t.child)}function td(e,t,n,r,l){if(gn(n)){var a=!0;ro(t)}else a=!1;if(Di(t,l),t.stateNode===null)Eo(e,t),Hu(t,n,r),la(t,n,r,l),r=!0;else if(e===null){var f=t.stateNode,x=t.memoizedProps;f.props=x;var k=f.context,O=n.contextType;typeof O=="object"&&O!==null?O=Bn(O):(O=gn(n)?ei:Zt.current,O=Ci(t,O));var Q=n.getDerivedStateFromProps,$=typeof Q=="function"||typeof f.getSnapshotBeforeUpdate=="function";$||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(x!==r||k!==O)&&Gu(t,f,r,O),jr=!1;var q=t.memoizedState;f.state=q,po(t,r,f,l),k=t.memoizedState,x!==r||q!==k||hn.current||jr?(typeof Q=="function"&&(oa(t,n,Q,r),k=t.memoizedState),(x=jr||Wu(t,n,x,r,q,k,O))?($||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=k),f.props=r,f.state=k,f.context=O,r=x):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{f=t.stateNode,vu(e,t),x=t.memoizedProps,O=t.type===t.elementType?x:Xn(t.type,x),f.props=O,$=t.pendingProps,q=f.context,k=n.contextType,typeof k=="object"&&k!==null?k=Bn(k):(k=gn(n)?ei:Zt.current,k=Ci(t,k));var ve=n.getDerivedStateFromProps;(Q=typeof ve=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(x!==$||q!==k)&&Gu(t,f,r,k),jr=!1,q=t.memoizedState,f.state=q,po(t,r,fLine truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zg(i,s){return Lg(i)||Dg(i,s)||Pg(i,s)||jg()}function Pg(i,s){if(i){if(typeof i=="string")return Yd(i,s);var o={}.toString.call(i).slice(8,-1);return o==="Object"&&i.constructor&&(o=i.constructor.name),o==="Map"||o==="Set"?Array.from(i):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?Yd(i,s):void 0}}const Lf=Object.entries,Kd=Object.setPrototypeOf,Bg=Object.isFrozen,Ug=Object.getPrototypeOf,Fg=Object.getOwnPropertyDescriptor;let Yt=Object.freeze,Kt=Object.seal,Yi=Object.create,Df=typeof Reflect<"u"&&Reflect,$a=Df.apply,ec=Df.construct;Yt||(Yt=function(s){return s});Kt||(Kt=function(s){return s});$a||($a=function(s,o){for(var u=arguments.length,d=new Array(u>2?u-2:0),p=2;p<u;p++)d[p-2]=arguments[p];return s.apply(o,d)});ec||(ec=function(s){for(var o=arguments.length,u=new Array(o>1?o-1:0),d=1;d<o;d++)u[d-1]=arguments[d];return new s(...u)});const Wi=Nt(Array.prototype.forEach),Wg=Nt(Array.prototype.lastIndexOf),Vd=Nt(Array.prototype.pop),Hi=Nt(Array.prototype.push),Hg=Nt(Array.prototype.splice),qr=Array.isArray,Ds=Nt(String.prototype.toLowerCase),Ha=Nt(String.prototype.toString),qd=Nt(String.prototype.match),Ns=Nt(String.prototype.replace),Qd=Nt(String.prototype.indexOf),Gg=Nt(String.prototype.trim),Yg=Nt(Number.prototype.toString),Kg=Nt(Boolean.prototype.toString),Zd=typeof BigInt>"u"?null:Nt(BigInt.prototype.toString),Xd=typeof Symbol>"u"?null:Nt(Symbol.prototype.toString),jt=Nt(Object.prototype.hasOwnProperty),Rs=Nt(Object.prototype.toString),Dt=Nt(RegExp.prototype.test),di=Vg(TypeError);function Nt(i){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var o=arguments.length,u=new Array(o>1?o-1:0),d=1;d<o;d++)u[d-1]=arguments[d];return $a(i,s,u)}}function Vg(i){return function(){for(var s=arguments.length,o=new Array(s),u=0;u<s;u++)o[u]=arguments[u];return ec(i,o)}}function Ve(i,s){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ds;if(Kd&&Kd(i,null),!qr(s))return i;let u=s.length;for(;u--;){let d=s[u];if(typeof d=="string"){const p=o(d);p!==d&&(Bg(s)||(s[u]=p),d=p)}i[d]=!0}return i}function qg(i){for(let s=0;s<i.length;s++)jt(i,s)||(i[s]=null);return i}function ln(i){const s=Yi(null);for(const u of Lf(i)){var o=zg(u,2);const d=o[0],p=o[1];jt(i,d)&&(qr(p)?s[d]=qg(p):p&&typeof p=="object"&&p.constructor===Object?s[d]=ln(p):s[d]=p)}return s}function Qg(i){switch(typeof i){case"string":return i;case"number":return Yg(i);case"boolean":return Kg(i);case"bigint":return Zd?Zd(i):"0";case"symbol":return Xd?Xd(i):"Symbol()";case"undefined":return Rs(i);case"function":case"object":{if(i===null)return Rs(i);const s=i,o=pr(s,"toString");if(typeof o=="function"){const u=o(s);return typeof u=="string"?u:Rs(u)}return Rs(i)}default:return Rs(i)}}function pr(i,s){for(;i!==null;){const u=Fg(i,s);if(u){if(u.get)return Nt(u.get);if(typeof u.value=="function")return Nt(u.value)}i=Ug(i)}function o(){return null}return o}function Zg(i){try{return Dt(i,""),!0}catch{return!1}}const Jd=Yt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ga=Yt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ya=Yt(["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"]),Xg=Yt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","sLine truncated
|
||||
`+bt),Pt&&(bt=Fe(bt)),A&&rr?be(bt):bt},s.setConfig=function(){let ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sr(ne),tn=!0,nn=De,En=fe},s.clearConfig=function(){qt=null,tn=!1,nn=null,En=null,A=j,V=""},s.isValidAttribute=function(ne,h,b){qt||sr({});const Y=lt(ne),oe=lt(h);return lr(Y,oe,b)},s.addHook=function(ne,h){typeof h=="function"&&jt(S,ne)&&Hi(S[ne],h)},s.removeHook=function(ne,h){if(jt(S,ne)){if(h!==void 0){const b=Wg(S[ne],h);return b===-1?void 0:Hg(S[ne],b,1)[0]}return Vd(S[ne])}},s.removeHooks=function(ne){jt(S,ne)&&(S[ne]=[])},s.removeAllHooks=function(){S=of()},s}var fm=jf(),qa,lf;function pm(){if(lf)return qa;lf=1;function i(g){return g instanceof Map?g.clear=g.delete=g.set=function(){throw new Error("map is read-only")}:g instanceof Set&&(g.add=g.clear=g.delete=function(){throw new Error("set is read-only")}),Object.freeze(g),Object.getOwnPropertyNames(g).forEach(C=>{const J=g[C],we=typeof J;(we==="object"||we==="function")&&!Object.isFrozen(J)&&i(J)}),g}class s{constructor(C){C.data===void 0&&(C.data={}),this.data=C.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function o(g){return g.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function u(g,...C){const J=Object.create(null);for(const we in g)J[we]=g[we];return C.forEach(function(we){for(const ge in we)J[ge]=we[ge]}),J}const d="</span>",p=g=>!!g.scope,v=(g,{prefix:C})=>{if(g.startsWith("language:"))return g.replace("language:","language-");if(g.includes(".")){const J=g.split(".");return[`${C}${J.shift()}`,...J.map((we,ge)=>`${we}${"_".repeat(ge+1)}`)].join(" ")}return`${C}${g}`};class m{constructor(C,J){this.buffer="",this.classPrefix=J.classPrefix,C.walk(this)}addText(C){this.buffer+=o(C)}openNode(C){if(!p(C))return;const J=v(C.scope,{prefix:this.classPrefix});this.span(J)}closeNode(C){p(C)&&(this.buffer+=d)}value(){return this.buffer}span(C){this.buffer+=`<span class="${C}">`}}const w=(g={})=>{const C={children:[]};return Object.assign(C,g),C};class y{constructor(){this.rootNode=w(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(C){this.top.children.push(C)}openNode(C){const J=w({scope:C});this.add(J),this.stack.push(J)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(C){return this.constructor._walk(C,this.rootNode)}static _walk(C,J){return typeof J=="string"?C.addText(J):J.children&&(C.openNode(J),J.children.forEach(we=>this._walk(C,we)),C.closeNode(J)),C}static _collapse(C){typeof C!="string"&&C.children&&(C.children.every(J=>typeof J=="string")?C.children=[C.children.join("")]:C.children.forEach(J=>{y._collapse(J)}))}}class E extends y{constructor(C){super(),this.options=C}addText(C){C!==""&&this.add(C)}startScope(C){this.openNode(C)}endScope(){this.closeNode()}__addSublanguage(C,J){const we=C.root;J&&(we.scope=`language:${J}`),this.add(we)}toHTML(){return new m(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function D(g){return g?typeof g=="string"?g:g.source:null}function T(g){return U("(?=",g,")")}function P(g){return U("(?:",g,")*")}function B(g){return U("(?:",g,")?")}function U(...g){return g.map(J=>D(J)).join("")}function G(g){const C=g[g.length-1];return typeof C=="object"&&C.constructor===Object?(g.splice(g.length-1,1),C):{}}function ae(...g){return"("+(G(g).capture?"":"?:")+g.map(we=>D(we)).join("|")+")"}function me(g){return new RegExp(g.toString()+"|").exec("").length-1}function xe(g,C){const J=g&&g.exec(C);return J&&J.index===0}const Z=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function pe(g,{joinWith:C}){let J=0;return g.map(we=>{J+=1;const ge=J;let et=D(we),ce="";for(;et.length>0;){const he=Z.exec(et);if(!he){ce+=et;break}ce+=et.substring(0,he.index),et=et.substring(he.index+he[0].length),he[0][0]==="\\"&&he[1]?ce+="\\"+String(Number(he[1])+ge):(ce+=he[0],he[0]==="("&&J++)}return ce}).map(we=>`(${we})`).join(C)}const A=/\b\B/,V="[a-zA-Z]\\w*",j="[a-zA-Z_]\\w*",H="\\b\\d+(\\.\\d+)?",ee="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Me="\\b(0b[01]+)",be="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Be=(g={})=>{const C=/^#![ ]*\//;return g.binary&&(g.begin=U(C,/.*\b/,g.binary,/\b.*/)),u({scope:"meta",begin:C,end:/$/,relevance:0,"on:begin":(J,we)=>{J.index!==0&&we.ignoreMatch()}},g)},qe={begin:"\\\\[\\s\\S]",relevance:0},$e={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[qe]},Ge={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[qe]},Pe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},z=function(g,C,J={}){const we=u({scope:"comment",begin:g,end:C,contains:[]},J);we.contains.push({scope:"doctaLine truncated
|
||||
https://github.com/highlightjs/highlight.js/issues/2277`),dt=te,Fe=Te),Ue===void 0&&(Ue=!0);const st={code:Fe,language:dt};gr("before:highlight",st);const Ft=st.result?st.result:pn(st.language,st.code,Ue);return Ft.code=st.code,gr("after:highlight",Ft),Ft}function pn(te,Te,Ue,Fe){const dt=Object.create(null);function st(X,de){return X.keywords[de]}function Ft(){if(!b.keywords){oe.addText(ue);return}let X=0;b.keywordPatternRe.lastIndex=0;let de=b.keywordPatternRe.exec(ue),Se="";for(;de;){Se+=ue.substring(X,de.index);const Ye=Qt.case_insensitive?de[0].toLowerCase():de[0],xt=st(b,Ye);if(xt){const[It,cl]=xt;if(oe.addText(Se),Se="",dt[Ye]=(dt[Ye]||0)+1,dt[Ye]<=fn&&(Ce+=cl),It.startsWith("_"))Se+=de[0];else{const Us=Qt.classNameAliases[It]||It;Wt(de[0],Us)}}else Se+=de[0];X=b.keywordPatternRe.lastIndex,de=b.keywordPatternRe.exec(ue)}Se+=ue.substring(X),oe.addText(Se)}function jn(){if(ue==="")return;let X=null;if(typeof b.subLanguage=="string"){if(!C[b.subLanguage]){oe.addText(ue);return}X=pn(b.subLanguage,ue,!0,Y[b.subLanguage]),Y[b.subLanguage]=X._top}else X=bn(ue,b.subLanguage.length?b.subLanguage:null);b.relevance>0&&(Ce+=X.relevance),oe.__addSublanguage(X._emitter,X.language)}function ct(){b.subLanguage!=null?jn():Ft(),ue=""}function Wt(X,de){X!==""&&(oe.startScope(de),oe.addText(X),oe.endScope())}function mr(X,de){let Se=1;const Ye=de.length-1;for(;Se<=Ye;){if(!X._emit[Se]){Se++;continue}const xt=Qt.classNameAliases[X[Se]]||X[Se],It=de[Se];xt?Wt(It,xt):(ue=It,Ft(),ue=""),Se++}}function Vn(X,de){return X.scope&&typeof X.scope=="string"&&oe.openNode(Qt.classNameAliases[X.scope]||X.scope),X.beginScope&&(X.beginScope._wrap?(Wt(ue,Qt.classNameAliases[X.beginScope._wrap]||X.beginScope._wrap),ue=""):X.beginScope._multi&&(mr(X.beginScope,de),ue="")),b=Object.create(X,{parent:{value:b}}),b}function lr(X,de,Se){let Ye=xe(X.endRe,Se);if(Ye){if(X["on:end"]){const xt=new s(X);X["on:end"](de,xt),xt.isMatchIgnored&&(Ye=!1)}if(Ye){for(;X.endsParent&&X.parent;)X=X.parent;return X}}if(X.endsWithParent)return lr(X.parent,de,Se)}function Zi(X){return b.matcher.regexIndex===0?(ue+=X[0],1):(bt=!0,0)}function yi(X){const de=X[0],Se=X.rule,Ye=new s(Se),xt=[Se.__beforeBegin,Se["on:begin"]];for(const It of xt)if(It&&(It(X,Ye),Ye.isMatchIgnored))return Zi(de);return Se.skip?ue+=de:(Se.excludeBegin&&(ue+=de),ct(),!Se.returnBegin&&!Se.excludeBegin&&(ue=de)),Vn(Se,X),Se.returnBegin?0:de.length}function Jr(X){const de=X[0],Se=Te.substring(X.index),Ye=lr(b,X,Se);if(!Ye)return kn;const xt=b;b.endScope&&b.endScope._wrap?(ct(),Wt(de,b.endScope._wrap)):b.endScope&&b.endScope._multi?(ct(),mr(b.endScope,X)):xt.skip?ue+=de:(xt.returnEnd||xt.excludeEnd||(ue+=de),ct(),xt.excludeEnd&&(ue=de));do b.scope&&oe.closeNode(),!b.skip&&!b.subLanguage&&(Ce+=b.relevance),b=b.parent;while(b!==Ye.parent);return Ye.starts&&Vn(Ye.starts,X),xt.returnEnd?0:de.length}function xi(){const X=[];for(let de=b;de!==Qt;de=de.parent)de.scope&&X.unshift(de.scope);X.forEach(de=>oe.openNode(de))}let qn={};function Nn(X,de){const Se=de&&de[0];if(ue+=X,Se==null)return ct(),0;if(qn.type==="begin"&&de.type==="end"&&qn.index===de.index&&Se===""){if(ue+=Te.slice(de.index,de.index+1),!ge){const Ye=new Error(`0 width match regex (${te})`);throw Ye.languageName=te,Ye.badRule=qn.rule,Ye}return 1}if(qn=de,de.type==="begin")return yi(de);if(de.type==="illegal"&&!Ue){const Ye=new Error('Illegal lexeme "'+Se+'" for mode "'+(b.scope||"<unnamed>")+'"');throw Ye.mode=b,Ye}else if(de.type==="end"){const Ye=Jr(de);if(Ye!==kn)return Ye}if(de.type==="illegal"&&Se==="")return ue+=`
|
||||
`,1;if(ht>1e5&&ht>de.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ue+=Se,Se.length}const Qt=_n(te);if(!Qt)throw St(et.replace("{}",te)),new Error('Unknown language: "'+te+'"');const ne=Dn(Qt);let h="",b=Fe||ne;const Y={},oe=new he.__emitter(he);xi();let ue="",Ce=0,Qe=0,ht=0,bt=!1;try{if(Qt.__emitTokens)Qt.__emitTokens(Te,oe);else{for(b.matcher.considerAll();;){ht++,bt?bt=!1:b.matcher.considerAll(),b.matcher.lastIndex=Qe;const X=b.matcher.exec(Te);if(!X)break;const de=Te.substring(Qe,X.index),Se=Nn(de,X);Qe=X.index+Se}Nn(Te.substring(Qe))}return oe.finalize(),h=oe.toHTML(),{language:te,value:h,relevance:Ce,illegal:!1,_emitter:oe,_top:b}}catch(X){if(X.message&&X.message.includes("Illegal"))return{language:te,value:Ut(Te),illegal:!0,relevance:0,_illegalBy:{message:X.message,index:Qe,context:Te.slice(Qe-100,Qe+100),mode:X.mode,resultSoFar:h},_emitter:oe};if(ge)return{language:te,value:Ut(Te),illegal:!1,relevance:0,errorRaised:X,_emitter:oe,_top:b};throw X}}function ir(te){const Te={value:Ut(te),illegal:!1,relevance:0,_top:ce,_emitter:new he.__emitter(he)};return Te._emitter.addText(te),Te}function bn(te,Te){Te=Te||he.languages||Object.keys(C);const Ue=ir(te),Fe=Te.filter(_n).filter(vi).map(ct=>pn(ct,te,!1));Fe.unshift(Ue);const dt=Fe.sort((ct,Wt)=>{if(ct.relevance!==Wt.relevance)return Wt.relevance-ct.relevance;if(ct.language&&Wt.language){if(_n(ct.language).supersetOf===Wt.language)return 1;if(_n(Wt.language).supersetOf===ct.language)return-1}return 0}),[st,Ft]=dt,jn=st;return jn.secondBest=Ft,jn}function Qi(te,Te,Ue){const Fe=Te&&J[Te]||Ue;te.classList.add("hljs"),te.classList.add(`language-${Fe}`)}function Qr(te){let Te=null;const Ue=ot(te);if(Re(Ue))return;if(gr("before:highlightElement",{el:te,language:Ue}),te.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",te);return}if(te.children.length>0&&(he.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(te)),he.throwUnescapedHTML))throw new Kn("One of your code blocks includes unescaped HTML.",te.innerHTML);Te=te;const Fe=Te.textContent,dt=Ue?it(Fe,{language:Ue,ignoreIllegals:!0}):bn(Fe);te.innerHTML=dt.value,te.dataset.highlighted="yes",Qi(te,Ue,dt.language),te.result={language:dt.language,re:dt.relevance,relevance:dt.relevance},dt.secondBest&&(te.secondBest={language:dt.secondBest.language,relevance:dt.secondBest.relevance}),gr("after:highlightElement",{el:te,result:dt,text:Fe})}function lt(te){he=Rt(he,te)}const qt=()=>{sr(),tn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function hi(){sr(),tn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Rr=!1;function sr(){function te(){sr()}if(document.readyState==="loading"){Rr||window.addEventListener("DOMContentLoaded",te,!1),Rr=!0;return}document.querySelectorAll(he.cssSelector).forEach(Qr)}function Zr(te,Te){let Ue=null;try{Ue=Te(g)}catch(Fe){if(St("Language definition for '{}' could not be registered.".replace("{}",te)),ge)St(Fe);else throw Fe;Ue=ce}Ue.name||(Ue.name=te),C[te]=Ue,Ue.rawDefinition=Te.bind(null,g),Ue.aliases&&mi(Ue.aliases,{languageName:te})}function Xr(te){delete C[te];for(const Te of Object.keys(J))J[Te]===te&&delete J[Te]}function gi(){return Object.keys(C)}function _n(te){return te=(te||"").toLowerCase(),C[te]||C[J[te]]}function mi(te,{languageName:Te}){typeof te=="string"&&(te=[te]),te.forEach(Ue=>{J[Ue.toLowerCase()]=Te})}function vi(te){const Te=_n(te);return Te&&!Te.disableAutodetect}function Xe(te){te["before:highlightBlock"]&&!te["before:highlightElement"]&&(te["before:highlightElement"]=Te=>{te["before:highlightBlock"](Object.assign({block:Te.el},Te))}),te["after:highlightBlock"]&&!te["after:highlightElement"]&&(te["after:highlightElement"]=Te=>{te["after:highlightBlock"](Object.assign({block:Te.el},Te))})}function Cr(te){Xe(te),we.push(te)}function Tn(te){const Te=we.indexOf(te);Te!==-1&&we.splice(Te,1)}function gr(te,Te){const Ue=te;we.forEach(function(Fe){Fe[Ue]&&Fe[Ue](Te)})}function or(te){return tn("10.7.0","highlightBlock will be removed entirely in v12.0"),tn("10.7.0","Please use highlightElement now."),Qr(te)}Object.assign(g,{highlight:it,highlightAuto:bn,highlightAll:sr,highlightElement:Qr,highlightBlock:or,configure:lt,initHighlighting:qt,initHighlightingOnLoad:hi,registerLanguage:Zr,unregisterLanguage:Xr,listLanguages:gi,getLanguage:_n,registerAliases:mi,autoDetection:vi,inherit:Rt,addPlugin:Cr,removePlugin:Tn}),g.debugMode=function(){ge=!1},g.safeMode=function(){ge=!0},g.versionString=Bt,g.regex={concat:U,lookahead:T,either:ae,optional:B,anyNumberOfTimes:P};for(const te in ze)typeof ze[te]=="object"&&i(ze[te]);return Object.assign(g,ze),g},K=L({});return K.newInstance=()=>L({}),qa=K,K.HighligLine truncated
|
||||
]`).replace("lheading",Xf).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},nv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,rv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,$f=/^( {2,}|\\)\n(?!\s*$)/,iv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ol=/[\p{P}\p{S}]/u,gc=/[\s\p{P}\p{S}]/u,ep=/[^\s\p{P}\p{S}]/u,sv=nt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,gc).getRegex(),tp=/(?!~)[\p{P}\p{S}]/u,ov=/(?!~)[\s\p{P}\p{S}]/u,lv=/(?:[^\s\p{P}\p{S}]|~)/u,av=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,np=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,cv=nt(np,"u").replace(/punct/g,ol).getRegex(),uv=nt(np,"u").replace(/punct/g,tp).getRegex(),rp="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",dv=nt(rp,"gu").replace(/notPunctSpace/g,ep).replace(/punctSpace/g,gc).replace(/punct/g,ol).getRegex(),fv=nt(rp,"gu").replace(/notPunctSpace/g,lv).replace(/punctSpace/g,ov).replace(/punct/g,tp).getRegex(),pv=nt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ep).replace(/punctSpace/g,gc).replace(/punct/g,ol).getRegex(),hv=nt(/\\(punct)/,"gu").replace(/punct/g,ol).getRegex(),gv=nt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),mv=nt(pc).replace("(?:-->|$)","-->").getRegex(),vv=nt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",mv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Jo=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,yv=nt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Jo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ip=nt(/^!?\[(label)\]\[(ref)\]/).replace("label",Jo).replace("ref",fc).getRegex(),sp=nt(/^!?\[(ref)\](?:\[\])?/).replace("ref",fc).getRegex(),xv=nt("reflink|nolink(?!\\()","g").replace("reflink",ip).replace("nolink",sp).getRegex(),mc={_backpedal:zs,anyPunctuation:hv,autolink:gv,blockSkip:av,br:$f,code:rv,del:zs,emStrongLDelim:cv,emStrongRDelimAst:dv,emStrongRDelimUnd:pv,escape:nv,link:yv,nolink:sp,punctuation:sv,reflink:ip,reflinkSearch:xv,tag:vv,text:iv,url:zs},wv={...mc,link:nt(/^!?\[(label)\]\((.*?)\)/).replace("label",Jo).getRegex(),reflink:nt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Jo).getRegex()},tc={...mc,emStrongRDelimAst:fv,emStrongLDelim:uv,url:nt(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Sv={...tc,br:nt($f).replace("{2,}","*").getRegex(),text:nt(tc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ko={normal:hc,gfm:ev,pedantic:tv},Cs={normal:mc,gfm:tc,breaks:Sv,pedantic:wv},Ev={"&":"&","<":"<",">":">",'"':""","'":"'"},df=i=>Ev[i];function hr(i,s){if(s){if(an.escapeTest.test(i))return i.replace(an.escapeReplace,df)}else if(an.escapeTestNoEncode.test(i))return i.replace(an.escapeReplaceNoEncode,df);return i}function ff(i){try{i=encodeURI(i).replace(an.percentDecode,"%")}catch{return null}return i}function pf(i,s){var p;const o=i.replace(an.findPipe,(v,m,w)=>{let y=!1,E=m;for(;--E>=0&&w[E]==="\\";)y=!y;return y?"|":" |"}),u=o.split(an.splitPipe);let d=0;if(u[0].trim()||u.shift(),u.length>0&&!((p=u.at(-1))!=null&&p.trim())&&u.pop(),s)if(u.length>s)u.splice(s);else for(;u.length<s;)u.push("");for(;d<u.length;d++)u[d]=u[d].trim().replace(an.slashPipe,"|");return u}function As(i,s,o){const u=i.length;if(u===0)return"";let d=0;for(;d<u&&i.charAt(u-d-1)===s;)d++;return i.slice(0,u-d)}function kv(i,s){if(i.indexOf(s[1])===-1)return-1;let o=0;for(let u=0;u<i.length;u++)if(i[u]==="\\")u++;else if(i[u]===s[0])o++;else if(i[u]===s[1]Line truncated
|
||||
`).map(p=>{const v=p.match(o.other.beginningSpace);if(v===null)return p;const[m]=v;return m.length>=d.length?p.slice(d.length):p}).join(`
|
||||
`)}var $o=class{constructor(i){at(this,"options");at(this,"rules");at(this,"lexer");this.options=i||pi}space(i){const s=this.rules.block.newline.exec(i);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(i){const s=this.rules.block.code.exec(i);if(s){const o=s[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:s[0],codeBlockStyle:"indented",text:this.options.pedantic?o:As(o,`
|
||||
`)}}}fences(i){const s=this.rules.block.fences.exec(i);if(s){const o=s[0],u=kv(o,s[3]||"",this.rules);return{type:"code",raw:o,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:u}}}heading(i){const s=this.rules.block.heading.exec(i);if(s){let o=s[2].trim();if(this.rules.other.endingHash.test(o)){const u=As(o,"#");(this.options.pedantic||!u||this.rules.other.endingSpaceChar.test(u))&&(o=u.trim())}return{type:"heading",raw:s[0],depth:s[1].length,text:o,tokens:this.lexer.inline(o)}}}hr(i){const s=this.rules.block.hr.exec(i);if(s)return{type:"hr",raw:As(s[0],`
|
||||
`)}}}fences(i){const s=this.rules.block.fences.exec(i);if(s){const o=s[0],u=bv(o,s[3]||"",this.rules);return{type:"code",raw:o,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:u}}}heading(i){const s=this.rules.block.heading.exec(i);if(s){let o=s[2].trim();if(this.rules.other.endingHash.test(o)){const u=As(o,"#");(this.options.pedantic||!u||this.rules.other.endingSpaceChar.test(u))&&(o=u.trim())}return{type:"heading",raw:s[0],depth:s[1].length,text:o,tokens:this.lexer.inline(o)}}}hr(i){const s=this.rules.block.hr.exec(i);if(s)return{type:"hr",raw:As(s[0],`
|
||||
`)}}blockquote(i){const s=this.rules.block.blockquote.exec(i);if(s){let o=As(s[0],`
|
||||
`).split(`
|
||||
`),u="",d="";const p=[];for(;o.length>0;){let v=!1;const g=[];let S;for(S=0;S<o.length;S++)if(this.rules.other.blockquoteStart.test(o[S]))g.push(o[S]),v=!0;else if(!v)g.push(o[S]);else break;o=o.slice(S);const y=g.join(`
|
||||
`),u="",d="";const p=[];for(;o.length>0;){let v=!1;const m=[];let w;for(w=0;w<o.length;w++)if(this.rules.other.blockquoteStart.test(o[w]))m.push(o[w]),v=!0;else if(!v)m.push(o[w]);else break;o=o.slice(w);const y=m.join(`
|
||||
`),E=y.replace(this.rules.other.blockquoteSetextReplace,`
|
||||
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");u=u?`${u}
|
||||
${y}`:y,d=d?`${d}
|
||||
${E}`:E;const M=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(E,p,!0),this.lexer.state.top=M,o.length===0)break;const T=p.at(-1);if((T==null?void 0:T.type)==="code")break;if((T==null?void 0:T.type)==="blockquote"){const B=T,U=B.raw+`
|
||||
${E}`:E;const D=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(E,p,!0),this.lexer.state.top=D,o.length===0)break;const T=p.at(-1);if((T==null?void 0:T.type)==="code")break;if((T==null?void 0:T.type)==="blockquote"){const P=T,B=P.raw+`
|
||||
`+o.join(`
|
||||
`),F=this.blockquote(U);p[p.length-1]=F,u=u.substring(0,u.length-B.raw.length)+F.raw,d=d.substring(0,d.length-B.text.length)+F.text;break}else if((T==null?void 0:T.type)==="list"){const B=T,U=B.raw+`
|
||||
`),U=this.blockquote(B);p[p.length-1]=U,u=u.substring(0,u.length-P.raw.length)+U.raw,d=d.substring(0,d.length-P.text.length)+U.text;break}else if((T==null?void 0:T.type)==="list"){const P=T,B=P.raw+`
|
||||
`+o.join(`
|
||||
`),F=this.list(U);p[p.length-1]=F,u=u.substring(0,u.length-T.raw.length)+F.raw,d=d.substring(0,d.length-B.raw.length)+F.raw,o=U.substring(p.at(-1).raw.length).split(`
|
||||
`);continue}}return{type:"blockquote",raw:u,tokens:p,text:d}}}list(i){let s=this.rules.block.list.exec(i);if(s){let o=s[1].trim();const u=o.length>1,d={type:"list",raw:"",ordered:u,start:u?+o.slice(0,-1):"",loose:!1,items:[]};o=u?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=u?o:"[*+-]");const p=this.rules.other.listItemRegex(o);let v=!1;for(;i;){let S=!1,y="",E="";if(!(s=p.exec(i))||this.rules.block.hr.test(i))break;y=s[0],i=i.substring(y.length);let M=s[2].split(`
|
||||
`,1)[0].replace(this.rules.other.listReplaceTabs,le=>" ".repeat(3*le.length)),T=i.split(`
|
||||
`,1)[0],B=!M.trim(),U=0;if(this.options.pedantic?(U=2,E=M.trimStart()):B?U=s[1].length+1:(U=s[2].search(this.rules.other.nonSpaceChar),U=U>4?1:U,E=M.slice(U),U+=s[1].length),B&&this.rules.other.blankLine.test(T)&&(y+=T+`
|
||||
`,i=i.substring(T.length+1),S=!0),!S){const le=this.rules.other.nextBulletRegex(U),ge=this.rules.other.hrRegex(U),ye=this.rules.other.fencesBeginRegex(U),Q=this.rules.other.headingBeginRegex(U),de=this.rules.other.htmlBeginRegex(U);for(;i;){const C=i.split(`
|
||||
`,1)[0];let V;if(T=C,this.options.pedantic?(T=T.replace(this.rules.other.listReplaceNesting," "),V=T):V=T.replace(this.rules.other.tabCharGlobal," "),ye.test(T)||Q.test(T)||de.test(T)||le.test(T)||ge.test(T))break;if(V.search(this.rules.other.nonSpaceChar)>=U||!T.trim())E+=`
|
||||
`+V.slice(U);else{if(B||M.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ye.test(M)||Q.test(M)||ge.test(M))break;E+=`
|
||||
`+T}!B&&!T.trim()&&(B=!0),y+=C+`
|
||||
`,i=i.substring(C.length+1),M=V.slice(U)}}d.loose||(v?d.loose=!0:this.rules.other.doubleBlankLine.test(y)&&(v=!0));let F=null,G;this.options.gfm&&(F=this.rules.other.listIsTask.exec(E),F&&(G=F[0]!=="[ ] ",E=E.replace(this.rules.other.listReplaceTask,""))),d.items.push({type:"list_item",raw:y,task:!!F,checked:G,loose:!1,text:E,tokens:[]}),d.raw+=y}const g=d.items.at(-1);if(g)g.raw=g.raw.trimEnd(),g.text=g.text.trimEnd();else return;d.raw=d.raw.trimEnd();for(let S=0;S<d.items.length;S++)if(this.lexer.state.top=!1,d.items[S].tokens=this.lexer.blockTokens(d.items[S].text,[]),!d.loose){const y=d.items[S].tokens.filter(M=>M.type==="space"),E=y.length>0&&y.some(M=>this.rules.other.anyLine.test(M.raw));d.loose=E}if(d.loose)for(let S=0;S<d.items.length;S++)d.items[S].loose=!0;return d}}html(i){const s=this.rules.block.html.exec(i);if(s)return{type:"html",block:!0,raw:s[0],pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:s[0]}}def(i){const s=this.rules.block.def.exec(i);if(s){const o=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),u=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",d=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:o,raw:s[0],href:u,title:d}}}table(i){var v;const s=this.rules.block.table.exec(i);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;const o=pf(s[1]),u=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),d=(v=s[3])!=null&&v.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
||||
`):[],p={type:"table",raw:s[0],header:[],align:[],rows:[]};if(o.length===u.length){for(const g of u)this.rules.other.tableAlignRight.test(g)?p.align.push("right"):this.rules.other.tableAlignCenter.test(g)?p.align.push("center"):this.rules.other.tableAlignLeft.test(g)?p.align.push("left"):p.align.push(null);for(let g=0;g<o.length;g++)p.header.push({text:o[g],tokens:this.lexer.inline(o[g]),header:!0,align:p.align[g]});for(const g of d)p.rows.push(pf(g,p.header.length).map((S,y)=>({text:S,tokens:this.lexer.inline(S),header:!1,align:p.align[y]})));return p}}lheading(i){const s=this.rules.block.lheading.exec(i);if(s)return{type:"heading",raw:s[0],depth:s[2].charAt(0)==="="?1:2,text:s[1],tokens:this.lexer.inline(s[1])}}paragraph(i){const s=this.rules.block.paragraph.exec(i);if(s){const o=s[1].charAt(s[1].length-1)===`
|
||||
`?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:o,tokens:this.lexer.inline(o)}}}text(i){const s=this.rules.block.text.exec(i);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(i){const s=this.rules.inline.escape.exec(i);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(i){const s=this.rules.inline.tag.exec(i);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(i){const s=this.rules.inline.link.exec(i);if(s){const o=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(o)){if(!this.rules.other.endAngleBracket.test(o))return;const p=As(o.slice(0,-1),"\\");if((o.length-p.length)%2===0)return}else{const p=Ev(s[2],"()");if(p===-2)return;if(p>-1){const g=(s[0].indexOf("!")===0?5:4)+s[1].length+p;s[2]=s[2].substring(0,p),s[0]=s[0].substring(0,g).trim(),s[3]=""}}let u=s[2],d="";if(this.options.pedantic){const p=this.rules.other.pedanticHrefTitle.exec(u);p&&(u=p[1],d=p[3])}else d=s[3]?s[3].slice(1,-1):"";return u=u.trim(),this.rules.other.startAngleBracket.test(u)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(o)?u=u.slice(1):u=u.slice(1,-1)),hf(s,{href:u&&u.replace(this.rules.inline.anyPunctuation,"$1"),title:d&&d.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(i,s){let o;if((o=this.rules.inline.reflink.exec(i))||(o=this.rules.inline.nolink.exec(i))){const u=(o[2]||o[1]).replace(this.rules.other.multipleSpaceGlobal," "),d=s[u.toLowerCase()];if(!d){const p=o[0].charAt(0);return{type:"text",raw:p,text:p}}return hf(o,d,o[0],this.lexer,this.rules)}}emStrong(i,s,o=""){let u=this.rules.inline.emStrongLDelim.exec(i);if(!u||u[3]&&o.match(this.rules.other.unicodeAlphaNumeric))return;if(!(u[1]||u[2]||"")||!o||this.rules.inline.punctuation.exec(o)){const p=[...u[0]].length-1;let v,g,S=p,y=0;const E=u[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(E.lastIndex=0,s=s.slice(-1*i.length+p);(u=E.exec(s))!=null;){if(v=u[1]||u[2]||u[3]||u[4]||u[5]||u[6],!v)continue;if(g=[...v].length,u[3]||u[4]){S+=g;continue}else if((u[5]||u[6])&&p%3&&!((p+g)%3)){y+=g;continue}if(S-=g,S>0)continue;g=Math.min(g,g+S+y);const M=[...u[0]][0].length,T=i.slice(0,p+u.index+M+g);if(Math.min(p,g)%2){const U=T.slice(1,-1);return{type:"em",raw:T,text:U,tokens:this.lexer.inlineTokens(U)}}const B=T.slice(2,-2);return{type:"strong",raw:T,text:B,tokens:this.lexer.inlineTokens(B)}}}}codespan(i){const s=this.rules.inline.code.exec(i);if(s){let o=s[2].replace(this.rules.other.newLineCharGlobal," ");const u=this.rules.other.nonSpaceChar.test(o),d=this.rules.other.startingSpaceChar.test(o)&&this.rules.other.endingSpaceChar.test(o);return u&&d&&(o=o.substring(1,o.length-1)),{type:"codespan",raw:s[0],text:o}}}br(i){const s=this.rules.inline.br.exec(i);if(s)return{type:"br",raw:s[0]}}del(i){const s=this.rules.inline.del.exec(i);if(s)return{type:"del",raw:s[0],text:s[2],tokens:this.lexer.inlineTokens(s[2])}}autolink(i){const s=this.rules.inline.autolink.exec(i);if(s){let o,u;return s[2]==="@"?(o=s[1],u="mailto:"+o):(o=s[1],u=o),{type:"link",raw:s[0],text:o,href:u,tokens:[{type:"text",raw:o,text:o}]}}}url(i){var o;let s;if(s=this.rules.inline.url.exec(i)){let u,d;if(s[2]==="@")u=s[0],d="mailto:"+u;else{let p;do p=s[0],s[0]=((o=this.rules.inline._backpedal.exec(s[0]))==null?void 0:o[0])??"";while(p!==s[0]);u=s[0],s[1]==="www."?d="http://"+s[0]:d=s[0]}return{type:"link",raw:s[0],text:u,href:d,tokens:[{type:"text",raw:u,text:u}]}}}inlineText(i){const s=this.rules.inline.text.exec(i);if(s){const o=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:o}}}},br=class nc{constructor(s){at(this,"tokens");at(this,"options");at(this,"state");at(this,"tokenizer");at(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||pi,this.options.tokenizer=this.options.tokenizer||new $o,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const o={other:dn,block:Ko.normal,inline:Cs.normal};this.options.pedantic?(o.block=Ko.pedantic,o.inline=Cs.pedantic):this.options.gfm&&(o.block=Ko.gfm,this.options.breaks?o.inline=Cs.breaks:o.inline=Cs.gfm),this.tokenizer.rules=o}static get rules(){return{block:Ko,inline:Cs}}static lex(s,o){return new nc(o).lex(s)}static lexInline(s,o){return new nc(o).inlineTokens(s)}lex(s){s=s.replace(dn.carriageReturn,`
|
||||
`),this.blockTokens(s,this.tokens);for(let o=0;o<this.inlineQueue.length;o++){const u=this.inlineQueue[o];this.inlineTokens(u.src,u.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(s,o=[],u=!1){var d,p,v;for(this.options.pedantic&&(s=s.replace(dn.tabCharGlobal," ").replace(dn.spaceLine,""));s;){let g;if((p=(d=this.options.extensions)==null?void 0:d.block)!=null&&p.some(y=>(g=y.call({lexer:this},s,o))?(s=s.substring(g.raw.length),o.push(g),!0):!1))continue;if(g=this.tokenizer.space(s)){s=s.substring(g.raw.length);const y=o.at(-1);g.raw.length===1&&y!==void 0?y.raw+=`
|
||||
`:o.push(g);continue}if(g=this.tokenizer.code(s)){s=s.substring(g.raw.length);const y=o.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=`
|
||||
`+g.raw,y.text+=`
|
||||
`+g.text,this.inlineQueue.at(-1).src=y.text):o.push(g);continue}if(g=this.tokenizer.fences(s)){s=s.substring(g.raw.length),o.push(g);continue}if(g=this.tokenizer.heading(s)){s=s.substring(g.raw.length),o.push(g);continue}if(g=this.tokenizer.hr(s)){s=s.substring(g.raw.length),o.push(g);continue}if(g=this.tokenizer.blockquote(s)){s=s.substring(g.raw.length),o.push(g);continue}if(g=this.tokenizer.list(s)){s=s.substring(g.raw.length),o.push(g);continue}if(g=this.tokenizer.html(s)){s=s.substring(g.raw.length),o.push(g);continue}if(g=this.tokenizer.def(s)){s=s.substring(g.raw.length);const y=o.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=`
|
||||
`+g.raw,y.text+=`
|
||||
`+g.raw,this.inlineQueue.at(-1).src=y.text):this.tokens.links[g.tag]||(this.tokens.links[g.tag]={href:g.href,title:g.title});continue}if(g=this.tokenizer.table(s)){s=s.substring(g.raw.length),o.push(g);continue}if(g=this.tokenizer.lheading(s)){s=s.substring(g.raw.length),o.push(g);continue}let S=s;if((v=this.options.extensions)!=null&&v.startBlock){let y=1/0;const E=s.slice(1);let M;this.options.extensions.startBlock.forEach(T=>{M=T.call({lexer:this},E),typeof M=="number"&&M>=0&&(y=Math.min(y,M))}),y<1/0&&y>=0&&(S=s.substring(0,y+1))}if(this.state.top&&(g=this.tokenizer.paragraph(S))){const y=o.at(-1);u&&(y==null?void 0:y.type)==="paragraph"?(y.raw+=`
|
||||
`+g.raw,y.text+=`
|
||||
`+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):o.push(g),u=S.length!==s.length,s=s.substring(g.raw.length);continue}if(g=this.tokenizer.text(s)){s=s.substring(g.raw.length);const y=o.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=`
|
||||
`+g.raw,y.text+=`
|
||||
`+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):o.push(g);continue}if(s){const y="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return this.state.top=!0,o}inline(s,o=[]){return this.inlineQueue.push({src:s,tokens:o}),o}inlineTokens(s,o=[]){var g,S,y;let u=s,d=null;if(this.tokens.links){const E=Object.keys(this.tokens.links);if(E.length>0)for(;(d=this.tokenizer.rules.inline.reflinkSearch.exec(u))!=null;)E.includes(d[0].slice(d[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(d=this.tokenizer.rules.inline.anyPunctuation.exec(u))!=null;)u=u.slice(0,d.index)+"++"+u.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(d=this.tokenizer.rules.inline.blockSkip.exec(u))!=null;)u=u.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let p=!1,v="";for(;s;){p||(v=""),p=!1;let E;if((S=(g=this.options.extensions)==null?void 0:g.inline)!=null&&S.some(T=>(E=T.call({lexer:this},s,o))?(s=s.substring(E.raw.length),o.push(E),!0):!1))continue;if(E=this.tokenizer.escape(s)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.tag(s)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.link(s)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(E.raw.length);const T=o.at(-1);E.type==="text"&&(T==null?void 0:T.type)==="text"?(T.raw+=E.raw,T.text+=E.text):o.push(E);continue}if(E=this.tokenizer.emStrong(s,u,v)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.codespan(s)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.br(s)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.del(s)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.autolink(s)){s=s.substring(E.raw.length),o.push(E);continue}if(!this.state.inLink&&(E=this.tokenizer.url(s))){s=s.substring(E.raw.length),o.push(E);continue}let M=s;if((y=this.options.extensions)!=null&&y.startInline){let T=1/0;const B=s.slice(1);let U;this.options.extensions.startInline.forEach(F=>{U=F.call({lexer:this},B),typeof U=="number"&&U>=0&&(T=Math.min(T,U))}),T<1/0&&T>=0&&(M=s.substring(0,T+1))}if(E=this.tokenizer.inlineText(M)){s=s.substring(E.raw.length),E.raw.slice(-1)!=="_"&&(v=E.raw.slice(-1)),p=!0;const T=o.at(-1);(T==null?void 0:T.type)==="text"?(T.raw+=E.raw,T.text+=E.text):o.push(E);continue}if(s){const T="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(T);break}else throw new Error(T)}}return o}},el=class{constructor(i){at(this,"options");at(this,"parser");this.options=i||pi}space(i){return""}code({text:i,lang:s,escaped:o}){var p;const u=(p=(s||"").match(dn.notSpaceStart))==null?void 0:p[0],d=i.replace(dn.endingNewline,"")+`
|
||||
`;return u?'<pre><code class="language-'+pr(u)+'">'+(o?d:pr(d,!0))+`</code></pre>
|
||||
`:"<pre><code>"+(o?d:pr(d,!0))+`</code></pre>
|
||||
`),U=this.list(B);p[p.length-1]=U,u=u.substring(0,u.length-T.raw.length)+U.raw,d=d.substring(0,d.length-P.raw.length)+U.raw,o=B.substring(p.at(-1).raw.length).split(`
|
||||
`);continue}}return{type:"blockquote",raw:u,tokens:p,text:d}}}list(i){let s=this.rules.block.list.exec(i);if(s){let o=s[1].trim();const u=o.length>1,d={type:"list",raw:"",ordered:u,start:u?+o.slice(0,-1):"",loose:!1,items:[]};o=u?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=u?o:"[*+-]");const p=this.rules.other.listItemRegex(o);let v=!1;for(;i;){let w=!1,y="",E="";if(!(s=p.exec(i))||this.rules.block.hr.test(i))break;y=s[0],i=i.substring(y.length);let D=s[2].split(`
|
||||
`,1)[0].replace(this.rules.other.listReplaceTabs,ae=>" ".repeat(3*ae.length)),T=i.split(`
|
||||
`,1)[0],P=!D.trim(),B=0;if(this.options.pedantic?(B=2,E=D.trimStart()):P?B=s[1].length+1:(B=s[2].search(this.rules.other.nonSpaceChar),B=B>4?1:B,E=D.slice(B),B+=s[1].length),P&&this.rules.other.blankLine.test(T)&&(y+=T+`
|
||||
`,i=i.substring(T.length+1),w=!0),!w){const ae=this.rules.other.nextBulletRegex(B),me=this.rules.other.hrRegex(B),xe=this.rules.other.fencesBeginRegex(B),Z=this.rules.other.headingBeginRegex(B),pe=this.rules.other.htmlBeginRegex(B);for(;i;){const A=i.split(`
|
||||
`,1)[0];let V;if(T=A,this.options.pedantic?(T=T.replace(this.rules.other.listReplaceNesting," "),V=T):V=T.replace(this.rules.other.tabCharGlobal," "),xe.test(T)||Z.test(T)||pe.test(T)||ae.test(T)||me.test(T))break;if(V.search(this.rules.other.nonSpaceChar)>=B||!T.trim())E+=`
|
||||
`+V.slice(B);else{if(P||D.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||xe.test(D)||Z.test(D)||me.test(D))break;E+=`
|
||||
`+T}!P&&!T.trim()&&(P=!0),y+=A+`
|
||||
`,i=i.substring(A.length+1),D=V.slice(B)}}d.loose||(v?d.loose=!0:this.rules.other.doubleBlankLine.test(y)&&(v=!0));let U=null,G;this.options.gfm&&(U=this.rules.other.listIsTask.exec(E),U&&(G=U[0]!=="[ ] ",E=E.replace(this.rules.other.listReplaceTask,""))),d.items.push({type:"list_item",raw:y,task:!!U,checked:G,loose:!1,text:E,tokens:[]}),d.raw+=y}const m=d.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.text.trimEnd();else return;d.raw=d.raw.trimEnd();for(let w=0;w<d.items.length;w++)if(this.lexer.state.top=!1,d.items[w].tokens=this.lexer.blockTokens(d.items[w].text,[]),!d.loose){const y=d.items[w].tokens.filter(D=>D.type==="space"),E=y.length>0&&y.some(D=>this.rules.other.anyLine.test(D.raw));d.loose=E}if(d.loose)for(let w=0;w<d.items.length;w++)d.items[w].loose=!0;return d}}html(i){const s=this.rules.block.html.exec(i);if(s)return{type:"html",block:!0,raw:s[0],pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:s[0]}}def(i){const s=this.rules.block.def.exec(i);if(s){const o=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),u=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",d=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:o,raw:s[0],href:u,title:d}}}table(i){var v;const s=this.rules.block.table.exec(i);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;const o=pf(s[1]),u=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),d=(v=s[3])!=null&&v.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
||||
`):[],p={type:"table",raw:s[0],header:[],align:[],rows:[]};if(o.length===u.length){for(const m of u)this.rules.other.tableAlignRight.test(m)?p.align.push("right"):this.rules.other.tableAlignCenter.test(m)?p.align.push("center"):this.rules.other.tableAlignLeft.test(m)?p.align.push("left"):p.align.push(null);for(let m=0;m<o.length;m++)p.header.push({text:o[m],tokens:this.lexer.inline(o[m]),header:!0,align:p.align[m]});for(const m of d)p.rows.push(pf(m,p.header.length).map((w,y)=>({text:w,tokens:this.lexer.inline(w),header:!1,align:p.align[y]})));return p}}lheading(i){const s=this.rules.block.lheading.exec(i);if(s)return{type:"heading",raw:s[0],depth:s[2].charAt(0)==="="?1:2,text:s[1],tokens:this.lexer.inline(s[1])}}paragraph(i){const s=this.rules.block.paragraph.exec(i);if(s){const o=s[1].charAt(s[1].length-1)===`
|
||||
`?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:o,tokens:this.lexer.inline(o)}}}text(i){const s=this.rules.block.text.exec(i);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(i){const s=this.rules.inline.escape.exec(i);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(i){const s=this.rules.inline.tag.exec(i);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(i){const s=this.rules.inline.link.exec(i);if(s){const o=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(o)){if(!this.rules.other.endAngleBracket.test(o))return;const p=As(o.slice(0,-1),"\\");if((o.length-p.length)%2===0)return}else{const p=kv(s[2],"()");if(p===-2)return;if(p>-1){const m=(s[0].indexOf("!")===0?5:4)+s[1].length+p;s[2]=s[2].substring(0,p),s[0]=s[0].substring(0,m).trim(),s[3]=""}}let u=s[2],d="";if(this.options.pedantic){const p=this.rules.other.pedanticHrefTitle.exec(u);p&&(u=p[1],d=p[3])}else d=s[3]?s[3].slice(1,-1):"";return u=u.trim(),this.rules.other.startAngleBracket.test(u)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(o)?u=u.slice(1):u=u.slice(1,-1)),hf(s,{href:u&&u.replace(this.rules.inline.anyPunctuation,"$1"),title:d&&d.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(i,s){let o;if((o=this.rules.inline.reflink.exec(i))||(o=this.rules.inline.nolink.exec(i))){const u=(o[2]||o[1]).replace(this.rules.other.multipleSpaceGlobal," "),d=s[u.toLowerCase()];if(!d){const p=o[0].charAt(0);return{type:"text",raw:p,text:p}}return hf(o,d,o[0],this.lexer,this.rules)}}emStrong(i,s,o=""){let u=this.rules.inline.emStrongLDelim.exec(i);if(!u||u[3]&&o.match(this.rules.other.unicodeAlphaNumeric))return;if(!(u[1]||u[2]||"")||!o||this.rules.inline.punctuation.exec(o)){const p=[...u[0]].length-1;let v,m,w=p,y=0;const E=u[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(E.lastIndex=0,s=s.slice(-1*i.length+p);(u=E.exec(s))!=null;){if(v=u[1]||u[2]||u[3]||u[4]||u[5]||u[6],!v)continue;if(m=[...v].length,u[3]||u[4]){w+=m;continue}else if((u[5]||u[6])&&p%3&&!((p+m)%3)){y+=m;continue}if(w-=m,w>0)continue;m=Math.min(m,m+w+y);const D=[...u[0]][0].length,T=i.slice(0,p+u.index+D+m);if(Math.min(p,m)%2){const B=T.slice(1,-1);return{type:"em",raw:T,text:B,tokens:this.lexer.inlineTokens(B)}}const P=T.slice(2,-2);return{type:"strong",raw:T,text:P,tokens:this.lexer.inlineTokens(P)}}}}codespan(i){const s=this.rules.inline.code.exec(i);if(s){let o=s[2].replace(this.rules.other.newLineCharGlobal," ");const u=this.rules.other.nonSpaceChar.test(o),d=this.rules.other.startingSpaceChar.test(o)&&this.rules.other.endingSpaceChar.test(o);return u&&d&&(o=o.substring(1,o.length-1)),{type:"codespan",raw:s[0],text:o}}}br(i){const s=this.rules.inline.br.exec(i);if(s)return{type:"br",raw:s[0]}}del(i){const s=this.rules.inline.del.exec(i);if(s)return{type:"del",raw:s[0],text:s[2],tokens:this.lexer.inlineTokens(s[2])}}autolink(i){const s=this.rules.inline.autolink.exec(i);if(s){let o,u;return s[2]==="@"?(o=s[1],u="mailto:"+o):(o=s[1],u=o),{type:"link",raw:s[0],text:o,href:u,tokens:[{type:"text",raw:o,text:o}]}}}url(i){var o;let s;if(s=this.rules.inline.url.exec(i)){let u,d;if(s[2]==="@")u=s[0],d="mailto:"+u;else{let p;do p=s[0],s[0]=((o=this.rules.inline._backpedal.exec(s[0]))==null?void 0:o[0])??"";while(p!==s[0]);u=s[0],s[1]==="www."?d="http://"+s[0]:d=s[0]}return{type:"link",raw:s[0],text:u,href:d,tokens:[{type:"text",raw:u,text:u}]}}}inlineText(i){const s=this.rules.inline.text.exec(i);if(s){const o=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:o}}}},_r=class nc{constructor(s){at(this,"tokens");at(this,"options");at(this,"state");at(this,"tokenizer");at(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||pi,this.options.tokenizer=this.options.tokenizer||new $o,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const o={other:an,block:Ko.normal,inline:Cs.normal};this.options.pedantic?(o.block=Ko.pedantic,o.inline=Cs.pedantic):this.options.gfm&&(o.block=Ko.gfm,this.options.breaks?o.inline=Cs.breaks:o.inline=Cs.gfm),this.tokenizer.rules=o}static get rules(){return{block:Ko,inline:Cs}}static lex(s,o){return new nc(o).lex(s)}static lexInline(s,o){return new nc(o).inlineTokens(s)}lex(s){s=s.replace(an.carriageReturn,`
|
||||
`),this.blockTokens(s,this.tokens);for(let o=0;o<this.inlineQueue.length;o++){const u=this.inlineQueue[o];this.inlineTokens(u.src,u.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(s,o=[],u=!1){var d,p,v;for(this.options.pedantic&&(s=s.replace(an.tabCharGlobal," ").replace(an.spaceLine,""));s;){let m;if((p=(d=this.options.extensions)==null?void 0:d.block)!=null&&p.some(y=>(m=y.call({lexer:this},s,o))?(s=s.substring(m.raw.length),o.push(m),!0):!1))continue;if(m=this.tokenizer.space(s)){s=s.substring(m.raw.length);const y=o.at(-1);m.raw.length===1&&y!==void 0?y.raw+=`
|
||||
`:o.push(m);continue}if(m=this.tokenizer.code(s)){s=s.substring(m.raw.length);const y=o.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=`
|
||||
`+m.raw,y.text+=`
|
||||
`+m.text,this.inlineQueue.at(-1).src=y.text):o.push(m);continue}if(m=this.tokenizer.fences(s)){s=s.substring(m.raw.length),o.push(m);continue}if(m=this.tokenizer.heading(s)){s=s.substring(m.raw.length),o.push(m);continue}if(m=this.tokenizer.hr(s)){s=s.substring(m.raw.length),o.push(m);continue}if(m=this.tokenizer.blockquote(s)){s=s.substring(m.raw.length),o.push(m);continue}if(m=this.tokenizer.list(s)){s=s.substring(m.raw.length),o.push(m);continue}if(m=this.tokenizer.html(s)){s=s.substring(m.raw.length),o.push(m);continue}if(m=this.tokenizer.def(s)){s=s.substring(m.raw.length);const y=o.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=`
|
||||
`+m.raw,y.text+=`
|
||||
`+m.raw,this.inlineQueue.at(-1).src=y.text):this.tokens.links[m.tag]||(this.tokens.links[m.tag]={href:m.href,title:m.title});continue}if(m=this.tokenizer.table(s)){s=s.substring(m.raw.length),o.push(m);continue}if(m=this.tokenizer.lheading(s)){s=s.substring(m.raw.length),o.push(m);continue}let w=s;if((v=this.options.extensions)!=null&&v.startBlock){let y=1/0;const E=s.slice(1);let D;this.options.extensions.startBlock.forEach(T=>{D=T.call({lexer:this},E),typeof D=="number"&&D>=0&&(y=Math.min(y,D))}),y<1/0&&y>=0&&(w=s.substring(0,y+1))}if(this.state.top&&(m=this.tokenizer.paragraph(w))){const y=o.at(-1);u&&(y==null?void 0:y.type)==="paragraph"?(y.raw+=`
|
||||
`+m.raw,y.text+=`
|
||||
`+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):o.push(m),u=w.length!==s.length,s=s.substring(m.raw.length);continue}if(m=this.tokenizer.text(s)){s=s.substring(m.raw.length);const y=o.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=`
|
||||
`+m.raw,y.text+=`
|
||||
`+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):o.push(m);continue}if(s){const y="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return this.state.top=!0,o}inline(s,o=[]){return this.inlineQueue.push({src:s,tokens:o}),o}inlineTokens(s,o=[]){var m,w,y;let u=s,d=null;if(this.tokens.links){const E=Object.keys(this.tokens.links);if(E.length>0)for(;(d=this.tokenizer.rules.inline.reflinkSearch.exec(u))!=null;)E.includes(d[0].slice(d[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(d=this.tokenizer.rules.inline.anyPunctuation.exec(u))!=null;)u=u.slice(0,d.index)+"++"+u.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(d=this.tokenizer.rules.inline.blockSkip.exec(u))!=null;)u=u.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let p=!1,v="";for(;s;){p||(v=""),p=!1;let E;if((w=(m=this.options.extensions)==null?void 0:m.inline)!=null&&w.some(T=>(E=T.call({lexer:this},s,o))?(s=s.substring(E.raw.length),o.push(E),!0):!1))continue;if(E=this.tokenizer.escape(s)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.tag(s)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.link(s)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(E.raw.length);const T=o.at(-1);E.type==="text"&&(T==null?void 0:T.type)==="text"?(T.raw+=E.raw,T.text+=E.text):o.push(E);continue}if(E=this.tokenizer.emStrong(s,u,v)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.codespan(s)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.br(s)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.del(s)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.autolink(s)){s=s.substring(E.raw.length),o.push(E);continue}if(!this.state.inLink&&(E=this.tokenizer.url(s))){s=s.substring(E.raw.length),o.push(E);continue}let D=s;if((y=this.options.extensions)!=null&&y.startInline){let T=1/0;const P=s.slice(1);let B;this.options.extensions.startInline.forEach(U=>{B=U.call({lexer:this},P),typeof B=="number"&&B>=0&&(T=Math.min(T,B))}),T<1/0&&T>=0&&(D=s.substring(0,T+1))}if(E=this.tokenizer.inlineText(D)){s=s.substring(E.raw.length),E.raw.slice(-1)!=="_"&&(v=E.raw.slice(-1)),p=!0;const T=o.at(-1);(T==null?void 0:T.type)==="text"?(T.raw+=E.raw,T.text+=E.text):o.push(E);continue}if(s){const T="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(T);break}else throw new Error(T)}}return o}},el=class{constructor(i){at(this,"options");at(this,"parser");this.options=i||pi}space(i){return""}code({text:i,lang:s,escaped:o}){var p;const u=(p=(s||"").match(an.notSpaceStart))==null?void 0:p[0],d=i.replace(an.endingNewline,"")+`
|
||||
`;return u?'<pre><code class="language-'+hr(u)+'">'+(o?d:hr(d,!0))+`</code></pre>
|
||||
`:"<pre><code>"+(o?d:hr(d,!0))+`</code></pre>
|
||||
`}blockquote({tokens:i}){return`<blockquote>
|
||||
${this.parser.parse(i)}</blockquote>
|
||||
`}html({text:i}){return i}heading({tokens:i,depth:s}){return`<h${s}>${this.parser.parseInline(i)}</h${s}>
|
||||
`}hr(i){return`<hr>
|
||||
`}list(i){const s=i.ordered,o=i.start;let u="";for(let v=0;v<i.items.length;v++){const g=i.items[v];u+=this.listitem(g)}const d=s?"ol":"ul",p=s&&o!==1?' start="'+o+'"':"";return"<"+d+p+`>
|
||||
`}list(i){const s=i.ordered,o=i.start;let u="";for(let v=0;v<i.items.length;v++){const m=i.items[v];u+=this.listitem(m)}const d=s?"ol":"ul",p=s&&o!==1?' start="'+o+'"':"";return"<"+d+p+`>
|
||||
`+u+"</"+d+`>
|
||||
`}listitem(i){var o;let s="";if(i.task){const u=this.checkbox({checked:!!i.checked});i.loose?((o=i.tokens[0])==null?void 0:o.type)==="paragraph"?(i.tokens[0].text=u+" "+i.tokens[0].text,i.tokens[0].tokens&&i.tokens[0].tokens.length>0&&i.tokens[0].tokens[0].type==="text"&&(i.tokens[0].tokens[0].text=u+" "+pr(i.tokens[0].tokens[0].text),i.tokens[0].tokens[0].escaped=!0)):i.tokens.unshift({type:"text",raw:u+" ",text:u+" ",escaped:!0}):s+=u+" "}return s+=this.parser.parse(i.tokens,!!i.loose),`<li>${s}</li>
|
||||
`}listitem(i){var o;let s="";if(i.task){const u=this.checkbox({checked:!!i.checked});i.loose?((o=i.tokens[0])==null?void 0:o.type)==="paragraph"?(i.tokens[0].text=u+" "+i.tokens[0].text,i.tokens[0].tokens&&i.tokens[0].tokens.length>0&&i.tokens[0].tokens[0].type==="text"&&(i.tokens[0].tokens[0].text=u+" "+hr(i.tokens[0].tokens[0].text),i.tokens[0].tokens[0].escaped=!0)):i.tokens.unshift({type:"text",raw:u+" ",text:u+" ",escaped:!0}):s+=u+" "}return s+=this.parser.parse(i.tokens,!!i.loose),`<li>${s}</li>
|
||||
`}checkbox({checked:i}){return"<input "+(i?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:i}){return`<p>${this.parser.parseInline(i)}</p>
|
||||
`}table(i){let s="",o="";for(let d=0;d<i.header.length;d++)o+=this.tablecell(i.header[d]);s+=this.tablerow({text:o});let u="";for(let d=0;d<i.rows.length;d++){const p=i.rows[d];o="";for(let v=0;v<p.length;v++)o+=this.tablecell(p[v]);u+=this.tablerow({text:o})}return u&&(u=`<tbody>${u}</tbody>`),`<table>
|
||||
<thead>
|
||||
@@ -106,18 +106,18 @@ ${this.parser.parse(i)}</blockquote>
|
||||
`}tablerow({text:i}){return`<tr>
|
||||
${i}</tr>
|
||||
`}tablecell(i){const s=this.parser.parseInline(i.tokens),o=i.header?"th":"td";return(i.align?`<${o} align="${i.align}">`:`<${o}>`)+s+`</${o}>
|
||||
`}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${pr(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:s,tokens:o}){const u=this.parser.parseInline(o),d=ff(i);if(d===null)return u;i=d;let p='<a href="'+i+'"';return s&&(p+=' title="'+pr(s)+'"'),p+=">"+u+"</a>",p}image({href:i,title:s,text:o,tokens:u}){u&&(o=this.parser.parseInline(u,this.parser.textRenderer));const d=ff(i);if(d===null)return pr(o);i=d;let p=`<img src="${i}" alt="${o}"`;return s&&(p+=` title="${pr(s)}"`),p+=">",p}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:pr(i.text)}},vc=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}},_r=class rc{constructor(s){at(this,"options");at(this,"renderer");at(this,"textRenderer");this.options=s||pi,this.options.renderer=this.options.renderer||new el,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new vc}static parse(s,o){return new rc(o).parse(s)}static parseInline(s,o){return new rc(o).parseInline(s)}parse(s,o=!0){var d,p;let u="";for(let v=0;v<s.length;v++){const g=s[v];if((p=(d=this.options.extensions)==null?void 0:d.renderers)!=null&&p[g.type]){const y=g,E=this.options.extensions.renderers[y.type].call({parser:this},y);if(E!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(y.type)){u+=E||"";continue}}const S=g;switch(S.type){case"space":{u+=this.renderer.space(S);continue}case"hr":{u+=this.renderer.hr(S);continue}case"heading":{u+=this.renderer.heading(S);continue}case"code":{u+=this.renderer.code(S);continue}case"table":{u+=this.renderer.table(S);continue}case"blockquote":{u+=this.renderer.blockquote(S);continue}case"list":{u+=this.renderer.list(S);continue}case"html":{u+=this.renderer.html(S);continue}case"paragraph":{u+=this.renderer.paragraph(S);continue}case"text":{let y=S,E=this.renderer.text(y);for(;v+1<s.length&&s[v+1].type==="text";)y=s[++v],E+=`
|
||||
`+this.renderer.text(y);o?u+=this.renderer.paragraph({type:"paragraph",raw:E,text:E,tokens:[{type:"text",raw:E,text:E,escaped:!0}]}):u+=E;continue}default:{const y='Token with "'+S.type+'" type was not found.';if(this.options.silent)return console.error(y),"";throw new Error(y)}}}return u}parseInline(s,o=this.renderer){var d,p;let u="";for(let v=0;v<s.length;v++){const g=s[v];if((p=(d=this.options.extensions)==null?void 0:d.renderers)!=null&&p[g.type]){const y=this.options.extensions.renderers[g.type].call({parser:this},g);if(y!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(g.type)){u+=y||"";continue}}const S=g;switch(S.type){case"escape":{u+=o.text(S);break}case"html":{u+=o.html(S);break}case"link":{u+=o.link(S);break}case"image":{u+=o.image(S);break}case"strong":{u+=o.strong(S);break}case"em":{u+=o.em(S);break}case"codespan":{u+=o.codespan(S);break}case"br":{u+=o.br(S);break}case"del":{u+=o.del(S);break}case"text":{u+=o.text(S);break}default:{const y='Token with "'+S.type+'" type was not found.';if(this.options.silent)return console.error(y),"";throw new Error(y)}}}return u}},Ja,Qo=(Ja=class{constructor(i){at(this,"options");at(this,"block");this.options=i||pi}preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}provideLexer(){return this.block?br.lex:br.lexInline}provideParser(){return this.block?_r.parse:_r.parseInline}},at(Ja,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Ja),bv=class{constructor(...i){at(this,"defaults",cc());at(this,"options",this.setOptions);at(this,"parse",this.parseMarkdown(!0));at(this,"parseInline",this.parseMarkdown(!1));at(this,"Parser",_r);at(this,"Renderer",el);at(this,"TextRenderer",vc);at(this,"Lexer",br);at(this,"Tokenizer",$o);at(this,"Hooks",Qo);this.use(...i)}walkTokens(i,s){var u,d;let o=[];for(const p of i)switch(o=o.concat(s.call(this,p)),p.type){case"table":{const v=p;for(const g of v.header)o=o.concat(this.walkTokens(g.tokens,s));for(const g of v.rows)for(const S of g)o=o.concat(this.walkTokens(S.tokens,s));break}case"list":{const v=p;o=o.concat(this.walkTokens(v.items,s));break}default:{const v=p;(d=(u=this.defaults.extensions)==null?void 0:u.childTokens)!=null&&d[v.type]?this.defaults.extensions.childTokens[v.type].forEach(g=>{const S=v[g].flat(1/0);o=o.concat(this.walkTokens(S,s))}):v.tokens&&(o=o.concat(this.walkTokens(v.tokens,s)))}}return o}use(...i){const s=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(o=>{const u={...o};if(u.async=this.defaults.async||u.async||!1,o.extensions&&(o.extensions.forEach(d=>{if(!d.name)throw new Error("extension name required");if("renderer"in d){const p=s.renderers[d.name];p?s.renderers[d.name]=function(...v){let g=d.renderer.apply(this,v);return g===!1&&(g=p.apply(this,v)),g}:s.renderers[d.name]=d.renderer}if("tokenizer"in d){if(!d.level||d.level!=="block"&&d.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const p=s[d.level];p?p.unshift(d.tokenizer):s[d.level]=[d.tokenizer],d.start&&(d.level==="block"?s.startBlock?s.startBlock.push(d.start):s.startBlock=[d.start]:d.level==="inline"&&(s.startInline?s.startInline.push(d.start):s.startInline=[d.start]))}"childTokens"in d&&d.childTokens&&(s.childTokens[d.name]=d.childTokens)}),u.extensions=s),o.renderer){const d=this.defaults.renderer||new el(this.defaults);for(const p in o.renderer){if(!(p in d))throw new Error(`renderer '${p}' does not exist`);if(["options","parser"].includes(p))continue;const v=p,g=o.renderer[v],S=d[v];d[v]=(...y)=>{let E=g.apply(d,y);return E===!1&&(E=S.apply(d,y)),E||""}}u.renderer=d}if(o.tokenizer){const d=this.defaults.tokenizer||new $o(this.defaults);for(const p in o.tokenizer){if(!(p in d))throw new Error(`tokenizer '${p}' does not exist`);if(["options","rules","lexer"].includes(p))continue;const v=p,g=o.tokenizer[v],S=d[v];d[v]=(...y)=>{let E=g.apply(d,y);return E===!1&&(E=S.apply(d,y)),E}}u.tokenizer=d}if(o.hooks){const d=this.defaults.hooks||new Qo;for(const p in o.hooks){if(!(p in d))throw new Error(`hook '${p}' does not exist`);if(["options","block"].includes(p))continue;const v=p,g=o.hooks[v],S=d[v];Qo.passThroughHooks.has(p)?d[v]=y=>{if(this.defaults.async)return Promise.resolve(g.call(d,y)).then(M=>S.call(d,M));const E=g.call(d,y);return S.call(d,E)}:d[v]=(...y)=>{let E=g.apply(d,y);return E===!1&&(E=S.apply(d,y)),E}}u.hooks=d}if(o.walkTokens){const d=this.defaults.walkTokens,p=o.walkTokens;u.walkTokens=function(v){let g=[];return g.push(p.call(this,v)),d&&(g=g.concat(d.call(this,v))),g}}this.defaults={...this.defaults,...u}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,s){return br.lex(i,s??this.defaults)}parser(i,s){return _r.parse(i,s??this.defaults)}parseMarkdown(i){return(o,u)=>{const d={...u},p={...this.defaults,...d},v=this.onError(!!p.silent,!!p.async);if(this.defaults.async===!0&&d.async===!1)return v(new Error("marked(): The async option was set to tLine truncated
|
||||
Please report this to https://github.com/markedjs/marked.`,i){const u="<p>An error occurred:</p><pre>"+pr(o.message+"",!0)+"</pre>";return s?Promise.resolve(u):u}if(s)return Promise.reject(o);throw o}}},fi=new bv;function rt(i,s){return fi.parse(i,s)}rt.options=rt.setOptions=function(i){return fi.setOptions(i),rt.defaults=fi.defaults,qf(rt.defaults),rt};rt.getDefaults=cc;rt.defaults=pi;rt.use=function(...i){return fi.use(...i),rt.defaults=fi.defaults,qf(rt.defaults),rt};rt.walkTokens=function(i,s){return fi.walkTokens(i,s)};rt.parseInline=fi.parseInline;rt.Parser=_r;rt.parser=_r.parse;rt.Renderer=el;rt.TextRenderer=vc;rt.Lexer=br;rt.lexer=br.lex;rt.Tokenizer=$o;rt.Hooks=Qo;rt.parse=rt;rt.options;rt.setOptions;rt.use;rt.walkTokens;rt.parseInline;_r.parse;br.lex;const bt={flex:"none",display:"block"};function di({size:i=13,color:s="var(--t3)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...bt,...o},children:c.jsx("path",{d:"M1.5 4a1.5 1.5 0 0 1 1.5-1.5h2.6l1.3 1.5H11A1.5 1.5 0 0 1 12.5 5.5v5A1.5 1.5 0 0 1 11 12H3a1.5 1.5 0 0 1-1.5-1.5V4z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"})})}function Is({size:i=13,color:s="var(--t4)",style:o}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...bt,...o},children:[c.jsx("path",{d:"M3.5 2.8A1.3 1.3 0 0 1 4.8 1.5h3.4l2.3 2.3v7.4a1.3 1.3 0 0 1-1.3 1.3H4.8a1.3 1.3 0 0 1-1.3-1.3V2.8z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"}),c.jsx("path",{d:"M8 1.7v2.5h2.4",stroke:s,strokeWidth:"1.1",strokeLinejoin:"round"})]})}function _v({size:i=12,color:s="var(--t3)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...bt,...o},children:c.jsx("path",{d:"M2.3 9.7 9.2 2.8a1.25 1.25 0 0 1 1.77 0l.23.23a1.25 1.25 0 0 1 0 1.77L4.3 11.7l-2.6.6.6-2.6z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"})})}function ic({size:i=14,color:s="var(--t5)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 16 16",fill:"none",style:{...bt,...o},children:c.jsx("path",{d:"M4.5 12.5a3 3 0 0 1-.4-5.97 4 4 0 0 1 7.8-.03 2.75 2.75 0 0 1-.4 6H4.5z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"})})}function sp({size:i=14,color:s="var(--t5)",strokeWidth:o=1.2,style:u}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 16 16",fill:"none",style:{...bt,...u},children:[c.jsx("rect",{x:"2",y:"3.5",width:"12",height:"7.5",rx:"1.4",stroke:s,strokeWidth:o}),c.jsx("path",{d:"M5.5 13.5h5",stroke:s,strokeWidth:o,strokeLinecap:"round"})]})}function ll({size:i=11,color:s="var(--t4)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 12 12",fill:"none",style:{...bt,...o},children:c.jsx("path",{d:"M6 2v8M2 6h8",stroke:s,strokeWidth:"1.4",strokeLinecap:"round"})})}function yc({size:i=10,color:s="var(--t5)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 10 10",fill:"none",style:{...bt,...o},children:c.jsx("path",{d:"M3.5 2L7 5 3.5 8",stroke:s,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function sc({size:i=8,color:s="var(--t6)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 10 10",fill:"none",style:{...bt,...o},children:c.jsx("path",{d:"M2 3.5 5 6.5 8 3.5",stroke:s,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function op({size:i=12,color:s="var(--t3)",style:o}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...bt,...o},children:[c.jsx("circle",{cx:"3",cy:"7",r:"1.1",fill:s}),c.jsx("circle",{cx:"7",cy:"7",r:"1.1",fill:s}),c.jsx("circle",{cx:"11",cy:"7",r:"1.1",fill:s})]})}function lp({size:i=12,color:s="var(--t3)",style:o}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...bt,...o},children:[c.jsx("rect",{x:"2",y:"2.5",width:"10",height:"3",rx:"1",stroke:s,strokeWidth:"1.2"}),c.jsx("path",{d:"M3 5.5v4A1.5 1.5 0 0 0 4.5 11h5A1.5 1.5 0 0 0 11 9.5v-4M5.5 7.5h3",stroke:s,strokeWidth:"1.2",strokeLinecap:"round"})]})}function tl({size:i=12,color:s="var(--err)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...bt,...o},children:c.jsx("path",{d:"M2.5 3.5h9M5.5 3.5v-1h3v1M4 3.5l.5 7A1.5 1.5 0 0 0 6 12h2a1.5 1.5 0 0 0 1.5-1.5l.5-7",stroke:s,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Tv({size:i=15,color:s="var(--t3)",style:o}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 16 16",fill:"none",style:{...bt,...o},children:[c.jsx("path",{d:"M6.8 1.8h2.4l.3 1.6c.5.2 1 .4 1.4.8l1.6-.6 1.2 2-1.3 1.1c.05.25.1.55.1.85s-.05.6-.1.85l1.3 1.1-1.2 2-1.6-.6c-.4.35-.9.6-1.4.8l-.3 1.6H6.8l-.3-1.6c-.5-.2-1-.45-1.4-.8l-1.6.6-1.2-2 1.3-1.1A4.6 4.6 0 0 1 3.5 8c0-.3.03-.6.1-.85L2.3 6l1.2-2 1.6.6c.4-.35.9-.6 1.4-.8l.3-2z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"}),c.jsx("circle",{cx:"8",cy:"8",r:"1.9",stroke:s,strokeWidth:"1.2"})]})}function Nv({size:i=13,color:s="var(--t5)",style:o}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...bt,...o},children:[c.jsx("circle",{cx:"7",cyLine truncated
|
||||
`)[0].slice(0,160):"";d[p]={...v,status:s.status==="completed"?"ok":"fail",out:g,lastLine:void 0};break}}return{...i,items:d}}case"plan":{const d=i.items.slice();for(let p=d.length-1;p>=0;p--)if(d[p].kind==="plan")return d[p]={kind:"plan",entries:s.entries??[]},{...i,items:d,streamKind:""};return Yr(i,{kind:"plan",entries:s.entries??[]})}case"llm_call_retry":return Yr(i,{kind:"sys",text:`模型调用重试 #${s.attempt??"?"}: ${s.message??""}`});case"usage_update":return{...i,usage:{used:s.used??0,size:s.size??0}};case"compact_status":return Yr(i,{kind:"sys",text:s.status==="started"?"⟳ 上下文接近上限,正在压缩…":"⟳ 上下文压缩完成"});case"model_update":{const d=s.model??"";return{...Yr(i,{kind:"sys",text:`模型已切换为 ${d}`}),model:d}}case"permission_mode_update":{const d=s.mode??"default";return{...Yr(i,{kind:"sys",text:d==="yolo"?"⚡ 已开启 YOLO 模式:所有操作不再询问,直接执行":"已恢复默认权限模式"}),permMode:d}}default:return i}}function jv(i,s){switch(s.type){case"task-started":return{...i,running:!0};case"task-ended":return{...i,running:!1,streamKind:"",turnEnded:!0,items:[...vf(i.items),{kind:"sys",text:"— 本轮结束 —"}]};case"task-error":{const o=Gi(s);return{...i,running:!1,streamKind:"",items:[...vf(i.items),{kind:"sys",text:"✗ "+((o==null?void 0:o.error)||"未知错误"),error:!0}]}}case"user-input":{const o=Gi(s);let u="";try{u=o!=null&&o.content?Cf(o.content):""}catch{u=(o==null?void 0:o.content)??""}return Yr(i,{kind:"user",text:u})}case"permission-req":{const o=Gi(s);return o!=null&&o.id?Yr(i,{kind:"perm",id:o.id,title:o.title??"",tool:o.tool??"",state:"open"}):i}case"permission-resolved":{const o=Gi(s);return o!=null&&o.id?{...i,items:i.items.map(u=>u.kind==="perm"&&u.id===o.id&&u.state==="open"?{...u,state:o.outcome??"expired"}:u)}:i}case"task-running":if(s.kind==="acp_event"){const o=Gi(s);if(o!=null&&o.update)return Dv(i,o.update)}return i;default:return i}}function cp(i,s){let o=i;for(const u of s)o=jv(o,u);return o}function zv(i,s,o){return{...i,items:i.items.map(u=>u.kind==="perm"&&u.id===s&&u.state==="open"?{...u,state:o?"allowed":"rejected"}:u)}}rt.setOptions({gfm:!0,breaks:!0});const Ct='"JetBrains Mono","HarmonyOS Sans SC",ui-monospace,Menlo,Consolas,"Courier New","Microsoft YaHei",monospace';function Pv(i){const s=i.target.closest("a");if(!s)return;i.preventDefault();const o=s.getAttribute("href")||"";/^https?:/i.test(o)&&If(o)}function Bv({text:i}){const s=W.useMemo(()=>dm.sanitize(rt.parse(i,{async:!1})),[i]);return c.jsx("div",{className:"md",onClick:Pv,dangerouslySetInnerHTML:{__html:s}})}function Uv({text:i}){const[s,o]=W.useState(!1);return c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[c.jsxs("div",{onClick:()=>o(!s),style:{display:"flex",alignItems:"center",gap:8,fontSize:12,color:"var(--t4)",cursor:"pointer",userSelect:"none",lineHeight:1.6,minWidth:0},children:[c.jsx(Cv,{}),c.jsx("span",{style:{fontWeight:600,color:"var(--t3)",flex:"none"},children:"思考"}),!s&&c.jsx("span",{className:"ellipsis",style:{flex:1,minWidth:0},children:i.trim().replace(/\s+/g," ")}),s&&c.jsx("span",{style:{flex:1}}),c.jsx(yc,{size:9,color:"var(--t6)",style:{transform:s?"rotate(90deg)":"none",transition:"transform .15s ease"}})]}),s&&c.jsx("div",{style:{marginLeft:5,borderLeft:"2px solid var(--line)",padding:"2px 0 2px 13px",fontSize:12,color:"var(--t4)",lineHeight:1.7,whiteSpace:"pre-wrap",wordBreak:"break-word",animation:"mcin .2s ease"},children:i})]})}function Fv({entries:i}){const s=o=>o==="completed"?"☑":o==="in_progress"?"◐":"☐";return c.jsx("div",{className:"card",style:{padding:"11px 14px",fontSize:12.5,display:"flex",flexDirection:"column",gap:4,animation:"mcin .25s ease"},children:i.map((o,u)=>c.jsxs("div",{style:{color:o.status==="completed"?"var(--t5)":o.status==="in_progress"?"var(--acc)":"var(--t2)",textDecoration:o.status==="completed"?"line-through":"none"},children:[c.jsx("span",{style:{display:"inline-block",width:18},children:s(o.status)})," ",o.content]},u))})}function Wv({status:i}){return i==="ok"?c.jsx(xc,{size:11}):i==="fail"?c.jsx("span",{style:{color:"var(--err)",fontSize:11,flex:"none"},children:"✗"}):c.jsx("span",{style:{width:7,height:7,borderRadius:"50%",flex:"none",border:"1.5px solid var(--acc)",background:"var(--accBd)",animation:"mcpulse 1.4s infinite"}})}function Hv(i){return i==="ok"?c.jsx(xc,{size:10}):i==="fail"?c.jsx("span",{style:{color:"var(--err)",fontSize:10,flex:"none"},children:"✗"}):c.jsx("span",{style:{color:"var(--t5)",fontSize:10,flex:"none",animation:"mcpulse 1.2s infinite"},children:"◌"})}function yf(i,s){if(!s)return i;const o=s.endsWith("/")?s:s+"/";return i.split(o).join("")}function Gv({item:i,onOpenChild:s,workdir:o}){const u=i.feed??[],d=u.slice(-5),p=yf(i.title,o),v=p.indexOf(" "),g=(v>0?p.slice(0,v):"").replace(/[::]$/,""),S=v>0?p.slice(v+1):p,y={display:"flex",gap:7,alignItems:"center",paddingLeft:15,font:"11px/1.7 "+Ct,color:"vaLine truncated
|
||||
`),p=[],v=[],g=[];for(const y of d){const E=y.match(Vv);E&&s?(E[1]==="图片"?p:v).push(E[2]):g.push(y)}const S=g.join(`
|
||||
`).trim();return c.jsxs("div",{style:{display:"flex",justifyContent:"flex-end"},children:[c.jsxs("div",{style:{maxWidth:"70%",background:"var(--userBg)",border:"1px solid var(--accBd)",borderRadius:"12px 12px 3px 12px",padding:"9px 15px",fontSize:13.5,lineHeight:1.6,color:"var(--t1)",whiteSpace:"pre-wrap",wordBreak:"break-word",animation:"mcin .25s ease"},children:[S,(p.length>0||v.length>0)&&c.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginTop:S?8:2,alignItems:"center"},children:[p.map(y=>c.jsx("img",{src:s(y),alt:y,title:y,onClick:()=>u(y),style:{maxWidth:150,maxHeight:120,borderRadius:8,border:"1px solid var(--accBd)",cursor:"zoom-in",display:"block"}},y)),v.map(y=>c.jsxs("span",{title:y+"(点击下载)",onClick:()=>If(new URL(s(y),location.origin).href),style:{height:28,display:"flex",alignItems:"center",gap:6,padding:"0 10px",borderRadius:8,border:"1px solid var(--accBd)",background:"var(--card)",fontSize:12,color:"var(--t2)",maxWidth:240,cursor:"pointer"},children:["📄",c.jsx("span",{className:"ellipsis",children:y.split("/").pop()})]},y))]})]}),o&&c.jsx("div",{onClick:()=>u(null),style:{position:"fixed",inset:0,background:"var(--scrim3)",zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",cursor:"zoom-out"},children:c.jsx("img",{src:s(o),alt:o,style:{maxWidth:"90vw",maxHeight:"90vh",borderRadius:10,boxShadow:"var(--shadowLg)"}})})]})}function Qv({item:i,onPermAnswer:s,uploadUrl:o}){switch(i.kind){case"user":return c.jsx(qv,{text:i.text,uploadUrl:o});case"agent":return c.jsx("div",{style:{maxWidth:"92%",wordBreak:"break-word",animation:"mcin .25s ease"},children:c.jsx(Bv,{text:i.text})});case"thought":return c.jsx(Uv,{text:i.text});case"plan":return c.jsx(Fv,{entries:i.entries});case"sys":return i.text==="— 本轮结束 —"?c.jsx(Kv,{}):c.jsx("div",{style:{color:i.error?"var(--err)":"var(--t5)",fontSize:11.5,textAlign:"center"},children:i.text});case"perm":return c.jsx(Yv,{item:i,onAnswer:s})}}function up({items:i,onPermAnswer:s,onOpenChild:o,uploadUrl:u,workdir:d}){const p=[];for(let v=0;v<i.length;){const g=i[v];if(g.kind==="tool"){const S=v,y=[];for(;v<i.length;){const E=i[v];if(E.kind!=="tool")break;y.push(E),v++}p.push(c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:y.map((E,M)=>c.jsx(Gv,{item:E,onOpenChild:o,workdir:d},E.tcId||M))},"g"+S))}else p.push(c.jsx(Qv,{item:g,onPermAnswer:s,uploadUrl:u},v)),v++}return c.jsx(c.Fragment,{children:p})}function Zv(i){const s=[];let o=0,u=0;for(const d of i.split(`
|
||||
`)){const p=d.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(p){o=+p[1],u=+p[2],s.push({no:"",text:d,kind:"h"});continue}d.startsWith("diff ")||d.startsWith("index ")||d.startsWith("+++")||d.startsWith("---")||d.startsWith("new file")||d.startsWith("deleted file")||d.startsWith("similarity")||d.startsWith("rename")||d.startsWith("old mode")||d.startsWith("new mode")||(d.startsWith("+")?s.push({no:String(u++),text:d,kind:"add"}):d.startsWith("-")?s.push({no:String(o++),text:d,kind:"del"}):(s.push({no:String(u),text:d,kind:"ctx"}),o++,u++))}return s}function Xv({text:i}){const s=W.useMemo(()=>Zv(i),[i]);return s.some(o=>o.kind==="h")?c.jsx("div",{style:{font:"12px/1.9 "+Ct},children:s.map((o,u)=>o.kind==="h"?c.jsxs("div",{style:{display:"flex",padding:"2px 24px",background:"var(--codeBg)",color:"var(--t4)",fontSize:11},children:[c.jsx("span",{style:{width:36,flex:"none"}}),c.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all"},children:o.text})]},u):c.jsxs("div",{style:{display:"flex",padding:"0 24px",background:o.kind==="add"?"var(--addBg)":o.kind==="del"?"var(--delBg)":"transparent",color:o.kind==="add"?"var(--addT)":o.kind==="del"?"var(--delT)":"var(--t3)"},children:[c.jsx("span",{style:{width:36,color:"var(--t5)",flex:"none",opacity:.6},children:o.no}),c.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",minWidth:0},children:o.text||" "})]},u))}):c.jsx("pre",{style:{margin:0,padding:"10px 24px",font:"12px/1.9 "+Ct,color:"var(--t4)",whiteSpace:"pre-wrap"},children:i})}for(const[i,s]of Object.entries({bash:hm,c:gm,cpp:mm,css:_m,go:Tm,ini:Nm,java:Rm,javascript:Mm,json:Lm,markdown:Dm,python:jm,rust:zm,sql:Pm,typescript:Um,xml:Fm,yaml:Wm}))jf.registerLanguage(i,s);const Jv={js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",tsx:"typescript",go:"go",py:"python",rs:"rust",java:"java",c:"c",h:"c",cc:"cpp",cpp:"cpp",hpp:"cpp",json:"json",css:"css",html:"xml",htm:"xml",xml:"xml",svg:"xml",vue:"xml",md:"markdown",markdown:"markdown",sh:"bash",bash:"bash",zsh:"bash",yml:"yaml",yaml:"yaml",sql:"sql",ini:"ini",toml:"ini",conf:"ini"};function $v(i){const s=[],o=[];for(const u of i.split(`
|
||||
`)){const d=o.join(""),p=/<span[^>]*>|<\/span>/g;for(let v=p.exec(u);v;v=p.exec(u))v[0]==="</span>"?o.pop():o.push(v[0]);s.push(d+u+"</span>".repeat(o.length))}return s}const wf={flex:1,minWidth:0,whiteSpace:"pre-wrap",wordBreak:"break-word",color:"var(--t2)"};function ey({path:i,text:s}){const o=W.useMemo(()=>{var p;const u=((p=i.split(".").pop())==null?void 0:p.toLowerCase())??"",d=Jv[u];if(d)try{return{html:!0,rows:$v(jf.highlight(s,{language:d}).value)}}catch{}return{html:!1,rows:s.split(`
|
||||
`)}},[i,s]);return c.jsx("div",{style:{font:"12px/1.9 "+Ct},children:o.rows.map((u,d)=>c.jsxs("div",{style:{display:"flex",padding:"0 24px"},children:[c.jsx("span",{style:{width:42,color:"var(--t5)",flex:"none",opacity:.6,userSelect:"none"},children:d+1}),o.html?c.jsx("span",{className:"hl",style:wf,dangerouslySetInnerHTML:{__html:u||" "}}):c.jsx("span",{style:wf,children:u||" "})]},d))})}const al="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAABRHElEQVR4nO29d5xU1fn4/z7nlukzuwtLFQSxYkM0xkqxG40dkqiJibFrNNUYUxbSjUlMMTEmxhg1FogxdmMDLBhRBBRsiIL0Xdg2O/Xee57fH3dmG7sUP7Z8fz6v192ZvXPvac9znvO08xz4GD6Gj+Fj+Bg+ho/hY/gYPoaP4WP4GDYPCkEB6sNuyHsB/0904n0BEdXANPUKu6tG6tWc2bPD+5On+53PzJhhMXVq8OE08GN4T6FBRE+cNctmVoONoPt6RgEiokTEFiScPPK/PYn+pxv/fwIRNYWZeubsJYrJ0wNAqj85QFkk8p32p7ZvtstjlwXNw7yCN369KqadwN69mUI0HkuUDqD+67fWHPMwIhqlzIfXmXcP/78iABFRk2ZPs+ZM2l1QXaw7iuY2Wbrzo+3v7P+W17Z3ixT3bglyu7T6heFByrU8BaXAIIDn+WhfMAmbnQqRpnmDT965lto2QVBKSf+1fzTB/rAb8H5DF9IxKpylvgZekw3p6S3PT1pOduIGv3jQ19bO3rc9rpyCZfADD4MPtkDZC5TliHIc8DzsnKdFI7T75NFuPpu3SSP/q0vB/5sEIKgpzNAzAaVUAPgW8IsNC4b/hxWHvynZCRMa/310wWW7ojb4vkcgHpScQEcjYumIsjxLmeYOJavXWtaKZmRFI6qtjLn4MCRp+1Yibo/Opf65XXr4BmSGVannfw7+J6m2XxBRMFNX2bsCnpa1g37ePu/YpaWWkzaUSocVE066hMGUS6C00VHXCEap5pxm2TrFS2uQRavg9bXoVa3Q3IEqeaigiLngWPyfnyymNSeDIml/urXPHhcOGr+0QURP/x+VAf7f4AAiitnTLJTygUBErCuL8ybNyq88fWrTg8e1RxmcUwWMeFCOBFYsJqioZtlazQtLtZ77Fix6B95pgVwJhYBloRwLcW0wgtl5e4IrjoZsIXAHpO2x2dRtFw0av3SKzLCmd5/9EmoHDaBeYWaoQgITZ89mTncV8iMC/9sE0BPxvoikj9l41yn7brjjslUUxrXaQjmfQ3k6IOagHNHq1XUWT7yGmv0aevEqVEsuLCvigGtDTTzUB0TAhJNaiiX8y46BVERMtqSH5q22y4bu9oPZsxrst9hBIbMUs2fDpOkBFUFwejetAmDOBzku2wD/mwTQC/E/WfNk/b322gtGbbjpvA2Ov12hWEKKgVjpRGDFUhZvrbHUYy+jHl6CWrgK2vMo24KoCzUJAJQRRAQCg5IK9iyNastjjt4TOXEvZGOHiQ6us8ZlMz86We25EmA+0wHQlcsTiZ2fe7LGb+8Y/nI0PyRdlnEron56Tz+y+IH6qTeXja/4CGkL/1sygIiaOHuaVWWl31n32OC7WXVBU1C8MB+3B5eyObTSgUrFlLQVNLNfhbsXop95A92UBdtG4g5YujLDpcc87RoMCW/7BhIu/j0XIiNqjSitx0vd3KUjv3zwDR0Lh8xh3bA3TW5ULl/cb43JDTLCnh1+eVCADPYJYioZxbc1HoZMOskRG2u+fMfAY26cOKvB/qgsB/8zHGCKzLBmKhXMAf/BNW/UX6nnXXS9WnpRNqoHeW0FrJzjW8mkJWtbLHXzXNSMeaiXV4cITkSQ2gRKBGXCWS59IV5RIQgFWkEhT/CTUzC7DEVt6FA67mCQRO3K6174WsucnXPapIJYhGIkIBDBeCZ8D4WyHKzAD1TWE6PwmrXlNPnueODGOZM+yJHbPHz0CaAi2c9UUwNZLfHPxB74+kXlpy9aF/GHltqLqED7OhWz5M2Nttz2H/RdL6DfaQbXQdJxUKCMgcB0K7Jb+b15oAKUQnUUMSftS3D6vtCcQ1lKScFjQax5b21biB8gWOCXAhxLlAIlKJX3lW4uKFnXrqxs3goOGkUAemBZ9FidnPk4MIXdZeYHMHRbAx9tApAZFkoFFgRHrPvnETs5N/1yncveHdk2tGf7Oh235I01tv7rM+i7F6KasqhYFGqTYAwqMH0vcqrPr12gFQSG4LR9kHQEVfCRuAu2g6UwlANUyVN6Q5uSVc2WWdaEfr0RtboFVrdBcwes2Uhw4WFw9C5GlQNdn+e132135Nzfi6iZfHRUxo8kATRIg54OoKYGV699ZtCNeumP5+rmcztKJXQ28O1M0pJ3Ntr87F7sO+ejNuYhEYHaBAQCftA5k3sJ40B/gk+3uyLg2Og75mP23g7KBvXSanhrIyxdr9VbG1ArN6DWZ9HZAlbJR1WWDbE1ojVqYB3mnCMwxcDE4km9k19zo1LKmyiz7DmKj8T6Dx9BITBc66cGDnD4hn+dtcg0X9XoeIODDXljZZJQ8rX+2xzUdbNgbRsqEQPHCmd8Fdeq8w99EUDf0H0oBJRCch5SEwnL35hHlT1AobRGHAscC2WpCqEREo5W0JIjOGsi5prTJWhvU0OtVMfN6aNGHZnZbiMiHykt4KPDAUQUTLNmqqn+39YuGPU76/VfP221nNzRkUWjAzUwacnjr6F/9hB6/ltQZfVBuL5vSsnbMsZ9CAJGUAkHVQiQvA9RBxJupWQBA4ggRlBIVW8ImXsignzhE0i5EFjJmF2b5bojM9tt3PGN30beVKr0rsbnfYI+/d4fNDRIg4ZpSqvp/iUts076sbvwhUV228m5xtbAiseFjoJlfe027M/9CWvRSqhNoRyN8sNZvwny36v5ZQQsULYKNYigIlcE0kOSrKA+VC87SshRY5E9hkOuqHVgJJ2uSTzZ/kb9mztfVkJQYX8/GvChLwFVlh/D4vDGu66a57Ze3phtQRsC0mmLexZgTbsLvXwjZLqMNpuFd9WrXkuA9PqtF9eWTb4QGo5a85gzD8S/4axQKC36YtVnVH2Jd3aza3/6yOMn3aCmqiCUBSZ/6LLAh0oAE2fNsudMnuzPWL94yDT94g3Lk95x+TUtgZ1KaNORV9aPH0DdNBdsGxV3QsOMIhS4+oKt7E0PUaHfh3r9qrq/2QeTka5PsRTmgklw+gHIiHpMW0cg2ljxmgxDcjx9hD/ooj+PPO5lQs4nH6ZM8KERQNUa9sN3Ht3zL9Y7d66Jm92Cja2erk878vwKrK/egbV4JZJOojDhmktV3tqSHtc/bG6kexS1BSrplwAgXB46CsjgDP6XJ8AXJ6JTWoL2fEBNzK4N7Pw4u/7Spwed9tcyFa1HTf9QVMMPhQD2feF6Z/5+53tfanxw4mx7w/1vl9uSusP3ZWDcVv94Guvyu1FFg0pFwa9yybCp7ycB9Ib+it4s8qtgayj6UCgguw5HvnMcwXF7oLLFIBBjpQcNYOecc/vz/qRz1PDh+Q+LCD5wAqiufUe/ffukBcnC/Y3FbMIKCEzCtfTP7sP69WMQj0JFyOtUsbq1WL1LAng3fLZ38X2W0d9NpUK3cr6M+AH+5w/AfO9EVCoiqr0jYEDC3q0cX3h2cdCnvj7q2LVVeehdNPNdwwdLADLDQk0NJr59y6SXEsX720qFhCXKBBqtv34b1oznIZMK3bCmKt73RQDhF2FT+ths9e9VP7ay8E5LRMU/QFuOYPdhyG/PRO0zEtnQ6pu6hD2gZL1yaPvAI+4ee+oHTgQfmDoypYL8s9Y+NGlxwru/pVhIKKNNIKL1F/6CnvE8UpOCIAiRD/SP/G4yV2+B/aMAFXyLqrTNCJgAauPo19djnfI75O4FmEEDbasl72+MmLFPDWh+7KvLHxo6U00NGkQ+MLx8IBU1SIOeqaYGv9w4b8QcveHfG/18wjbKGAutz/4r+olXUTUplBdsEZtC34986ESgen32Bb5BJSMoX9Dn3Yh1/eMwoMa2Wwt+s23G/jve9NgNTa8Om46SD8pW8P5XIqKmz3xFiUjkT6U37luhOjJWKQiCiNb6gr+hH38FapLgdeN6nRuvpNf/PQru8+vm4APfz9VXuwIDtkYnolhXzED9/nGC+gG21Zz3VzrFsdd6zz8kS8SZDp3hZe8nfABUNs3SU2cG49fdfu076fLeVkfJl5q4pa+ciXX/IsiEyO/bZbOl/r+7ef+ejar0unrf7w+qS1w6jpr2L/R1j8OAtK0b2/yXo7m9xqf+/jdHTTcw833Hz/tawRQRCzXdP3blfV94M+mdU25q8U1d0ubaR7H+9gySToaeuwr0OWZ9ieE9BngzxpnNwLviBv0hvPczm61R9ZBcVSqG/u4M5K75mPpam6YO/42a4PRxq247CzU1mDhr1vvqr3nfCGDKjBnWTJS5WRbvuDje+sdsc6uxkjFLZi1G/+h+SMbCQI1uoHr+2RR6D253IpC+H9kSbBURbGlGv1uQsAEq5qK/cRvqxZXoTNwqNLcGbzv5P3y9adaucyZP9pkxw3ofagfeRwKYCbhKy28bF/1qtVNMWMoxQXNRWZfPREsl5Kp3WFZf2NjSjOt6+10habOvvJeIr0z8TS4BHBtV8NCX3oxpLylLO7TYfuIhb/lfRMRmCu+bPPD+EICE26aPW3vfYW9F/RPMxlxAKmLrXzyAXtoIcSf0qFVgU+RvydmjUNVrk7q3qoTNP9Mv4jf9QXVLine truncated
|
||||
`)){const d=u.indexOf("=");if(d<=0)continue;const p=u.slice(0,d).trim();p&&(s[p]=u.slice(d+1).trim(),o++)}return o?s:void 0}const ay=i=>i&&typeof i=="object"?Object.entries(i).map(([s,o])=>`${s}=${String(o)}`).join(`
|
||||
`):"";function cy(i){const s={};for(const o of i){const u=o.name.trim();if(u)if(o.type==="stdio"){if(!o.command.trim())continue;const d=o.args.trim()?o.args.trim().split(/\s+/):void 0;s[u]={command:o.command.trim(),args:d,env:bf(o.kv)}}else{if(!o.url.trim())continue;s[u]={url:o.url.trim(),headers:bf(o.kv)}}}return s}function _f(i){return Object.entries(i).map(([s,o])=>{const u=o??{},d=typeof u.command=="string"&&u.command!=="";return{name:s,type:d?"stdio":"http",url:typeof u.url=="string"?u.url:"",command:typeof u.command=="string"?u.command:"",args:Array.isArray(u.args)?u.args.map(String).join(" "):"",kv:ay(d?u.env:u.headers)}})}const uy={fontSize:11,fontWeight:700,letterSpacing:.5,color:"var(--t4)"},Hn={width:"100%",height:30,border:"1px solid var(--inputBd)",borderRadius:7,background:"var(--inputBg)",color:"var(--t1)",padding:"0 10px",fontSize:12,fontFamily:Ct,outline:"none",minWidth:0},Tf={width:"100%",height:30,border:"1px solid var(--inputBd)",borderRadius:7,background:"var(--inputBg)",color:"var(--t1)",padding:"0 6px",fontSize:12,outline:"none",cursor:"pointer"},Kr={height:28,border:"1px solid var(--btnBd)",background:"var(--card)",color:"var(--t1)",borderRadius:8,padding:"0 13px",fontSize:12,fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:5,boxShadow:"var(--cardSh)",whiteSpace:"nowrap"};function En({label:i,children:s}){return c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,flex:1,minWidth:0},children:[c.jsx("span",{style:{fontSize:11.5,color:"var(--t3)",fontWeight:600},children:i}),s]})}function Os({label:i,action:s,children:o}){return c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:9},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[c.jsx("span",{style:uy,children:i}),c.jsx("span",{style:{flex:1}}),s]}),o]})}function dy({version:i,update:s,onUpdateStatus:o}){const[u,d]=W.useState("idle"),[p,v]=W.useState(null),g=!!(s!=null&&s.available),S=async()=>{d("checking"),v(null);try{const B=await Af();o(B),B.available||v({text:"已是最新版本",color:"var(--ok)"})}catch(B){v({text:B instanceof Error?B.message:String(B),color:"var(--err)"})}finally{d("idle")}},y=async()=>{d("installing"),v(null);try{await Cg()}catch(B){v({text:B instanceof Error?B.message:String(B),color:"var(--err)"}),d("idle")}},E=u!=="idle",M=u==="checking"?"检查中":u==="installing"?"更新中":g?"下载更新":"检查更新",T=g&&u!=="checking";return c.jsxs("div",{className:"card card-lg",style:{padding:"14px 16px",display:"flex",alignItems:"center",gap:12},children:[c.jsx("div",{style:{width:34,height:34,borderRadius:9,background:"var(--accBg)",display:"flex",alignItems:"center",justifyContent:"center",flex:"none"},children:c.jsx("img",{src:al,alt:"",draggable:!1,style:{width:22,height:22,borderRadius:5}})}),c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[c.jsx("span",{style:{fontWeight:700,fontSize:13},children:"MonkeyCode"}),c.jsx("span",{className:"ellipsis",style:{fontSize:11.5,color:"var(--t5)",fontFamily:Ct},children:g?`${(s==null?void 0:s.current)??i} → ${s==null?void 0:s.latest} 可用`:i})]}),c.jsx("span",{style:{flex:1}}),p&&c.jsx("span",{style:{fontSize:12,color:p.color,flex:"none"},children:p.text}),c.jsxs("button",{className:T?"hv-acc":"hv",onClick:()=>!E&&void(T?y():S()),style:{...Kr,gap:6,flex:"none",...T?{background:"var(--acc)",borderColor:"var(--acc)",color:"var(--onAcc)"}:{},opacity:E?.7:1,cursor:E?"default":"pointer"},children:[E&&c.jsx("span",{style:{width:11,height:11,border:`1.5px solid ${T?"var(--onAcc)":"var(--t1)"}`,borderTopColor:"transparent",borderRadius:"50%",animation:"mcspin .9s linear infinite",display:"inline-block"}}),M]})]})}const Nf=i=>/^1[3-9]\d{9}$/.test(i.trim());function fy(i){for(const s of["name","nickname","username","phone","email"]){const o=i==null?void 0:i[s];if(typeof o=="string"&&o.trim())return o.trim()}return"已登录"}function py({onSynced:i,knownKeys:s,existingNames:o}){const[u,d]=W.useState(null),[p,v]=W.useState(""),[g,S]=W.useState("wechat"),[y,E]=W.useState(""),[M,T]=W.useState(""),[B,U]=W.useState(!1),[F,G]=W.useState(!1),[le,ge]=W.useState(0),[ye,Q]=W.useState(""),[de,C]=W.useState(""),[V,j]=W.useState("loading"),[H,$]=W.useState(!1),[Oe,ke]=W.useState(null),[Be,Ze]=W.useState(null),[tt,Ke]=W.useState({}),[Pe,P]=W.useState(!0),ne=W.useRef(!0),O=W.useRef(0);W.useEffect(()=>(ne.current=!0,Wo().then(se=>ne.current&&d(se)).catch(se=>ne.current&&v(se instanceof Error?se.message:String(se))),()=>{ne.current=!1,O.current++}),[]);const m=async()=>{const se=++O.current,xe=()=>ne.current&&se===O.current;Q(""),C(""),j("loading");try{const He=await gg();if(!xe())return;for(C(He.qr),j("waiting");;){const je=await mg();if(!xe())return;if(je.status==="waiting"||je.status==="scanned"){j(je.status);continue}if(je.status==="ok"){const xt=await Wo();xe()&&d(xt);return}j(je.status);return}}catch(He){if(!xe())return;j("error"),Q(He instanceof Error?He.message:String(HLine truncated
|
||||
`);if(!(!N||!V.current)){if(u.running){G(N),U(""),ge([]);return}V.current.send("user-input",{content:js(N)})&&(U(""),ge([]))}},stop:()=>{var m;return void((m=V.current)==null?void 0:m.send("user-cancel",{}))},clearQueued:()=>G(null),addFiles:async m=>{if(s)for(const N of m){if(N.size>20*1024*1024){v(`⚠ ${N.name||"文件"} 过大(上限 20MB)`);continue}try{const J=await new Promise((Ge,se)=>{const xe=new FileReader;xe.onload=()=>Ge(xe.result),xe.onerror=()=>se(new Error("读取文件失败")),xe.readAsDataURL(N)}),Ne=J.slice(J.indexOf(",")+1),Le=N.type.startsWith("image/"),{path:Me}=await ug(s,N.name,N.type,Ne);ge(Ge=>[...Ge,{path:Me,isImage:Le,name:N.name||Me.split("/").pop()||"",preview:Le?J:void 0}])}catch(J){v("⚠ 附件上传失败: "+(J instanceof Error?J.message:String(J)))}}},removeAtt:m=>ge(N=>N.filter((J,Ne)=>Ne!==m)),answerPerm:(m,N)=>{var Ne;const J=N!=="deny";(Ne=V.current)!=null&&Ne.send("permission-resp",{id:m,approved:J,remember:N==="always"||N==="persist",persist:N==="persist"})&&d(Le=>zv(Le,m,J))},switchModel:async m=>{var N;if(!(!V.current||!m||m===y))try{const J=await V.current.call("session_set_model",{model:m});if(J.error){v("⚠ 切换模型失败: "+J.error);return}E(m),(N=H.current)==null||N.call(H)}catch(J){v("⚠ 切换模型失败: "+(J instanceof Error?J.message:J))}},toggleYolo:async()=>{if(!V.current)return;const m=M,N=m?"default":"yolo";T(!m);try{const J=await V.current.call("session_set_mode",{mode:N});J.error&&(T(m),v("⚠ 切换权限模式失败: "+J.error))}catch(J){T(m),v("⚠ 切换权限模式失败: "+(J instanceof Error?J.message:J))}},refreshChanges:$,fileDiff:m=>{const N=V.current;return N?N.call("repo_file_diff",{path:m}):Promise.reject(new Error("未连接"))},listFiles:m=>{const N=V.current;return N?N.call("repo_file_list",{path:m}):Promise.reject(new Error("未连接"))},readFile:m=>{const N=V.current;return N?N.call("repo_read_file",{path:m}):Promise.reject(new Error("未连接"))},notify:v}}const Xa="~/MonkeyCode",dr={A:{text:"新增",fg:"var(--addT)",bg:"var(--addBg)"},M:{text:"修改",fg:"var(--warn)",bg:"var(--warnBg)"},D:{text:"删除",fg:"var(--delT)",bg:"var(--delBg)"}},xy=i=>i>=1<<20?(i/(1<<20)).toFixed(1)+" MB":i>=1024?(i/1024).toFixed(1)+" KB":i+" B",Ms={height:32,display:"flex",alignItems:"center",gap:9,padding:"0 10px",borderRadius:8,cursor:"pointer",minWidth:0,flex:"none"},Ls={flex:"none",fontSize:10.5,fontWeight:600,borderRadius:9,padding:"2px 8px",lineHeight:1.4},Rf=i=>({border:"none",background:"transparent",height:34,padding:"0 3px",marginBottom:-1,borderBottom:`2px solid ${i?"var(--acc)":"transparent"}`,fontSize:13,fontWeight:i?700:500,color:i?"var(--t1)":"var(--t5)",cursor:i?"default":"pointer",display:"flex",alignItems:"center",gap:6,flex:"none"});function wy(){var Wt,Tt;const[i,s]=W.useState([]),[o,u]=W.useState("new"),[d,p]=W.useState([]),[v,g]=W.useState(null),[S,y]=W.useState(null),[E,M]=W.useState(!1),[T,B]=W.useState("files"),[U,F]=W.useState(new Map),[G,le]=W.useState(new Set),[ge,ye]=W.useState(new Set),[Q,de]=W.useState(""),[C,V]=W.useState(null),[j,H]=W.useState(()=>{const L=parseInt(localStorage.getItem("mc.drawerWidth")??"",10);return Number.isFinite(L)?Math.min(Math.max(L,420),1200):600}),[$,Oe]=W.useState(!1),[ke,Be]=W.useState(()=>{const L=parseInt(localStorage.getItem("mc.drawerSplit")??"",10);return Number.isFinite(L)&&L>0?Math.max(L,80):0}),[Ze,tt]=W.useState(!1),Ke=W.useRef(null),[Pe,P]=W.useState(null),[ne,O]=W.useState(Xa),[m,N]=W.useState(""),[J,Ne]=W.useState(""),[Le,Me]=W.useState(""),[Ge,se]=W.useState(!1),[xe,He]=W.useState(!1),je=W.useRef(!1),xt=W.useCallback(async()=>{const L=await ig();return s(L),L},[]),fe=yy({onSessionsChanged:()=>void xt()}),Bt=(L,re)=>{fe.open(L.id,{model:L.model,mode:L.mode,firstMessage:re}),u("session"),M(!1),V(null)},qe=async L=>{try{await cg(L.id,!L.archived),await xt()}catch(re){fe.notify("⚠ 归档失败: "+(re instanceof Error?re.message:String(re)))}},Mn=async(L,re)=>{try{await ag(L.id,re),await xt()}catch(ue){fe.notify("⚠ 重命名失败: "+(ue instanceof Error?ue.message:String(ue)))}},Gn=async L=>{try{await lg(L.id)}catch(re){fe.notify("⚠ 删除失败: "+(re instanceof Error?re.message:String(re)));return}L.id===fe.id&&(fe.close(!0),u("new"),M(!1),V(null)),xt()};W.useEffect(()=>{const L=Ag("open-settings",()=>u("settings"));return Promise.all([sg().catch(()=>[]),xt()]).then(([re,ue])=>{var D;p(re),N(((D=re.find(z=>z.default))==null?void 0:D.name)??"");const De=vy(),w=ue.find(z=>z.id===De);w&&Bt(w),re.length===0&&qi()&&u("settings")}).catch(re=>fe.notify("无法连接服务: "+(re instanceof Error?re.message:re))),qi()&&(Rg().then(re=>g((re==null?void 0:re.version)??null)),Af().then(y).catch(()=>{})),()=>L()},[]);const Qt=((Wt=[...i].sort((L,re)=>(re.updated_at??"").localeCompare(L.updated_at??""))[0])==null?void 0:Wt.workdir)??"";W.useEffect(()=>{je.current||O(Qt||Xa)},[Qt]);const Ln=async L=>{var re;V({path:L,kind:"diff",text:"加载中…"});try{const ue=await fe.fileDLine truncated
|
||||
`}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${hr(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:s,tokens:o}){const u=this.parser.parseInline(o),d=ff(i);if(d===null)return u;i=d;let p='<a href="'+i+'"';return s&&(p+=' title="'+hr(s)+'"'),p+=">"+u+"</a>",p}image({href:i,title:s,text:o,tokens:u}){u&&(o=this.parser.parseInline(u,this.parser.textRenderer));const d=ff(i);if(d===null)return hr(o);i=d;let p=`<img src="${i}" alt="${o}"`;return s&&(p+=` title="${hr(s)}"`),p+=">",p}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:hr(i.text)}},vc=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}},Tr=class rc{constructor(s){at(this,"options");at(this,"renderer");at(this,"textRenderer");this.options=s||pi,this.options.renderer=this.options.renderer||new el,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new vc}static parse(s,o){return new rc(o).parse(s)}static parseInline(s,o){return new rc(o).parseInline(s)}parse(s,o=!0){var d,p;let u="";for(let v=0;v<s.length;v++){const m=s[v];if((p=(d=this.options.extensions)==null?void 0:d.renderers)!=null&&p[m.type]){const y=m,E=this.options.extensions.renderers[y.type].call({parser:this},y);if(E!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(y.type)){u+=E||"";continue}}const w=m;switch(w.type){case"space":{u+=this.renderer.space(w);continue}case"hr":{u+=this.renderer.hr(w);continue}case"heading":{u+=this.renderer.heading(w);continue}case"code":{u+=this.renderer.code(w);continue}case"table":{u+=this.renderer.table(w);continue}case"blockquote":{u+=this.renderer.blockquote(w);continue}case"list":{u+=this.renderer.list(w);continue}case"html":{u+=this.renderer.html(w);continue}case"paragraph":{u+=this.renderer.paragraph(w);continue}case"text":{let y=w,E=this.renderer.text(y);for(;v+1<s.length&&s[v+1].type==="text";)y=s[++v],E+=`
|
||||
`+this.renderer.text(y);o?u+=this.renderer.paragraph({type:"paragraph",raw:E,text:E,tokens:[{type:"text",raw:E,text:E,escaped:!0}]}):u+=E;continue}default:{const y='Token with "'+w.type+'" type was not found.';if(this.options.silent)return console.error(y),"";throw new Error(y)}}}return u}parseInline(s,o=this.renderer){var d,p;let u="";for(let v=0;v<s.length;v++){const m=s[v];if((p=(d=this.options.extensions)==null?void 0:d.renderers)!=null&&p[m.type]){const y=this.options.extensions.renderers[m.type].call({parser:this},m);if(y!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){u+=y||"";continue}}const w=m;switch(w.type){case"escape":{u+=o.text(w);break}case"html":{u+=o.html(w);break}case"link":{u+=o.link(w);break}case"image":{u+=o.image(w);break}case"strong":{u+=o.strong(w);break}case"em":{u+=o.em(w);break}case"codespan":{u+=o.codespan(w);break}case"br":{u+=o.br(w);break}case"del":{u+=o.del(w);break}case"text":{u+=o.text(w);break}default:{const y='Token with "'+w.type+'" type was not found.';if(this.options.silent)return console.error(y),"";throw new Error(y)}}}return u}},Ja,Qo=(Ja=class{constructor(i){at(this,"options");at(this,"block");this.options=i||pi}preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}provideLexer(){return this.block?_r.lex:_r.lexInline}provideParser(){return this.block?Tr.parse:Tr.parseInline}},at(Ja,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Ja),_v=class{constructor(...i){at(this,"defaults",cc());at(this,"options",this.setOptions);at(this,"parse",this.parseMarkdown(!0));at(this,"parseInline",this.parseMarkdown(!1));at(this,"Parser",Tr);at(this,"Renderer",el);at(this,"TextRenderer",vc);at(this,"Lexer",_r);at(this,"Tokenizer",$o);at(this,"Hooks",Qo);this.use(...i)}walkTokens(i,s){var u,d;let o=[];for(const p of i)switch(o=o.concat(s.call(this,p)),p.type){case"table":{const v=p;for(const m of v.header)o=o.concat(this.walkTokens(m.tokens,s));for(const m of v.rows)for(const w of m)o=o.concat(this.walkTokens(w.tokens,s));break}case"list":{const v=p;o=o.concat(this.walkTokens(v.items,s));break}default:{const v=p;(d=(u=this.defaults.extensions)==null?void 0:u.childTokens)!=null&&d[v.type]?this.defaults.extensions.childTokens[v.type].forEach(m=>{const w=v[m].flat(1/0);o=o.concat(this.walkTokens(w,s))}):v.tokens&&(o=o.concat(this.walkTokens(v.tokens,s)))}}return o}use(...i){const s=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(o=>{const u={...o};if(u.async=this.defaults.async||u.async||!1,o.extensions&&(o.extensions.forEach(d=>{if(!d.name)throw new Error("extension name required");if("renderer"in d){const p=s.renderers[d.name];p?s.renderers[d.name]=function(...v){let m=d.renderer.apply(this,v);return m===!1&&(m=p.apply(this,v)),m}:s.renderers[d.name]=d.renderer}if("tokenizer"in d){if(!d.level||d.level!=="block"&&d.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const p=s[d.level];p?p.unshift(d.tokenizer):s[d.level]=[d.tokenizer],d.start&&(d.level==="block"?s.startBlock?s.startBlock.push(d.start):s.startBlock=[d.start]:d.level==="inline"&&(s.startInline?s.startInline.push(d.start):s.startInline=[d.start]))}"childTokens"in d&&d.childTokens&&(s.childTokens[d.name]=d.childTokens)}),u.extensions=s),o.renderer){const d=this.defaults.renderer||new el(this.defaults);for(const p in o.renderer){if(!(p in d))throw new Error(`renderer '${p}' does not exist`);if(["options","parser"].includes(p))continue;const v=p,m=o.renderer[v],w=d[v];d[v]=(...y)=>{let E=m.apply(d,y);return E===!1&&(E=w.apply(d,y)),E||""}}u.renderer=d}if(o.tokenizer){const d=this.defaults.tokenizer||new $o(this.defaults);for(const p in o.tokenizer){if(!(p in d))throw new Error(`tokenizer '${p}' does not exist`);if(["options","rules","lexer"].includes(p))continue;const v=p,m=o.tokenizer[v],w=d[v];d[v]=(...y)=>{let E=m.apply(d,y);return E===!1&&(E=w.apply(d,y)),E}}u.tokenizer=d}if(o.hooks){const d=this.defaults.hooks||new Qo;for(const p in o.hooks){if(!(p in d))throw new Error(`hook '${p}' does not exist`);if(["options","block"].includes(p))continue;const v=p,m=o.hooks[v],w=d[v];Qo.passThroughHooks.has(p)?d[v]=y=>{if(this.defaults.async)return Promise.resolve(m.call(d,y)).then(D=>w.call(d,D));const E=m.call(d,y);return w.call(d,E)}:d[v]=(...y)=>{let E=m.apply(d,y);return E===!1&&(E=w.apply(d,y)),E}}u.hooks=d}if(o.walkTokens){const d=this.defaults.walkTokens,p=o.walkTokens;u.walkTokens=function(v){let m=[];return m.push(p.call(this,v)),d&&(m=m.concat(d.call(this,v))),m}}this.defaults={...this.defaults,...u}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,s){return _r.lex(i,s??this.defaults)}parser(i,s){return Tr.parse(i,s??this.defaults)}parseMarkdown(i){return(o,u)=>{const d={...u},p={...this.defaults,...d},v=this.onError(!!p.silent,!!p.async);if(this.defaults.async===!0&&d.async===!1)return v(new Error("marked(): The async option was set to tLine truncated
|
||||
Please report this to https://github.com/markedjs/marked.`,i){const u="<p>An error occurred:</p><pre>"+hr(o.message+"",!0)+"</pre>";return s?Promise.resolve(u):u}if(s)return Promise.reject(o);throw o}}},fi=new _v;function tt(i,s){return fi.parse(i,s)}tt.options=tt.setOptions=function(i){return fi.setOptions(i),tt.defaults=fi.defaults,Qf(tt.defaults),tt};tt.getDefaults=cc;tt.defaults=pi;tt.use=function(...i){return fi.use(...i),tt.defaults=fi.defaults,Qf(tt.defaults),tt};tt.walkTokens=function(i,s){return fi.walkTokens(i,s)};tt.parseInline=fi.parseInline;tt.Parser=Tr;tt.parser=Tr.parse;tt.Renderer=el;tt.TextRenderer=vc;tt.Lexer=_r;tt.lexer=_r.lex;tt.Tokenizer=$o;tt.Hooks=Qo;tt.parse=tt;tt.options;tt.setOptions;tt.use;tt.walkTokens;tt.parseInline;Tr.parse;_r.lex;const kt={flex:"none",display:"block"};function Nr({size:i=13,color:s="var(--t3)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M1.5 4a1.5 1.5 0 0 1 1.5-1.5h2.6l1.3 1.5H11A1.5 1.5 0 0 1 12.5 5.5v5A1.5 1.5 0 0 1 11 12H3a1.5 1.5 0 0 1-1.5-1.5V4z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"})})}function Is({size:i=13,color:s="var(--t4)",style:o}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...kt,...o},children:[c.jsx("path",{d:"M3.5 2.8A1.3 1.3 0 0 1 4.8 1.5h3.4l2.3 2.3v7.4a1.3 1.3 0 0 1-1.3 1.3H4.8a1.3 1.3 0 0 1-1.3-1.3V2.8z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"}),c.jsx("path",{d:"M8 1.7v2.5h2.4",stroke:s,strokeWidth:"1.1",strokeLinejoin:"round"})]})}function Tv({size:i=12,color:s="var(--t3)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M2.3 9.7 9.2 2.8a1.25 1.25 0 0 1 1.77 0l.23.23a1.25 1.25 0 0 1 0 1.77L4.3 11.7l-2.6.6.6-2.6z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"})})}function ic({size:i=14,color:s="var(--t5)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 16 16",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M4.5 12.5a3 3 0 0 1-.4-5.97 4 4 0 0 1 7.8-.03 2.75 2.75 0 0 1-.4 6H4.5z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"})})}function op({size:i=14,color:s="var(--t5)",strokeWidth:o=1.2,style:u}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 16 16",fill:"none",style:{...kt,...u},children:[c.jsx("rect",{x:"2",y:"3.5",width:"12",height:"7.5",rx:"1.4",stroke:s,strokeWidth:o}),c.jsx("path",{d:"M5.5 13.5h5",stroke:s,strokeWidth:o,strokeLinecap:"round"})]})}function ll({size:i=11,color:s="var(--t4)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 12 12",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M6 2v8M2 6h8",stroke:s,strokeWidth:"1.4",strokeLinecap:"round"})})}function yc({size:i=10,color:s="var(--t5)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 10 10",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M3.5 2L7 5 3.5 8",stroke:s,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function sc({size:i=8,color:s="var(--t6)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 10 10",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M2 3.5 5 6.5 8 3.5",stroke:s,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function lp({size:i=12,color:s="var(--t3)",style:o}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...kt,...o},children:[c.jsx("circle",{cx:"3",cy:"7",r:"1.1",fill:s}),c.jsx("circle",{cx:"7",cy:"7",r:"1.1",fill:s}),c.jsx("circle",{cx:"11",cy:"7",r:"1.1",fill:s})]})}function ap({size:i=12,color:s="var(--t3)",style:o}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...kt,...o},children:[c.jsx("rect",{x:"2",y:"2.5",width:"10",height:"3",rx:"1",stroke:s,strokeWidth:"1.2"}),c.jsx("path",{d:"M3 5.5v4A1.5 1.5 0 0 0 4.5 11h5A1.5 1.5 0 0 0 11 9.5v-4M5.5 7.5h3",stroke:s,strokeWidth:"1.2",strokeLinecap:"round"})]})}function tl({size:i=12,color:s="var(--err)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M2.5 3.5h9M5.5 3.5v-1h3v1M4 3.5l.5 7A1.5 1.5 0 0 0 6 12h2a1.5 1.5 0 0 0 1.5-1.5l.5-7",stroke:s,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Nv({size:i=15,color:s="var(--t3)",style:o}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 16 16",fill:"none",style:{...kt,...o},children:[c.jsx("path",{d:"M6.8 1.8h2.4l.3 1.6c.5.2 1 .4 1.4.8l1.6-.6 1.2 2-1.3 1.1c.05.25.1.55.1.85s-.05.6-.1.85l1.3 1.1-1.2 2-1.6-.6c-.4.35-.9.6-1.4.8l-.3 1.6H6.8l-.3-1.6c-.5-.2-1-.45-1.4-.8l-1.6.6-1.2-2 1.3-1.1A4.6 4.6 0 0 1 3.5 8c0-.3.03-.6.1-.85L2.3 6l1.2-2 1.6.6c.4-.35.9-.6 1.4-.8l.3-2z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"}),c.jsx("circle",{cx:"8",cy:"8",r:"1.9",stroke:s,strokeWidth:"1.2"})]})}function Rv({size:i=13,color:s="var(--t5)",style:o}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...kt,...o},children:[c.jsx("circle",{cx:"7",cyLine truncated
|
||||
`)[0].slice(0,160):"";d[p]={...v,status:s.status==="completed"?"ok":"fail",out:m,lastLine:void 0};break}}return{...i,items:d}}case"plan":{const d=i.items.slice();for(let p=d.length-1;p>=0;p--)if(d[p].kind==="plan")return d[p]={kind:"plan",entries:s.entries??[]},{...i,items:d,streamKind:""};return Kr(i,{kind:"plan",entries:s.entries??[]})}case"llm_call_retry":return Kr(i,{kind:"sys",text:`模型调用重试 #${s.attempt??"?"}: ${s.message??""}`});case"usage_update":return{...i,usage:{used:s.used??0,size:s.size??0}};case"compact_status":return Kr(i,{kind:"sys",text:s.status==="started"?"⟳ 上下文接近上限,正在压缩…":"⟳ 上下文压缩完成"});case"model_update":{const d=s.model??"";return{...Kr(i,{kind:"sys",text:`模型已切换为 ${d}`}),model:d}}case"permission_mode_update":{const d=s.mode??"default";return{...Kr(i,{kind:"sys",text:d==="yolo"?"⚡ 已开启 YOLO 模式:所有操作不再询问,直接执行":"已恢复默认权限模式"}),permMode:d}}default:return i}}function zv(i,s){switch(s.type){case"task-started":return{...i,running:!0};case"task-ended":return{...i,running:!1,streamKind:"",turnEnded:!0,items:[...vf(i.items),{kind:"sys",text:"— 本轮结束 —"}]};case"task-error":{const o=Gi(s);return{...i,running:!1,streamKind:"",items:[...vf(i.items),{kind:"sys",text:"✗ "+((o==null?void 0:o.error)||"未知错误"),error:!0}]}}case"user-input":{const o=Gi(s);let u="";try{u=o!=null&&o.content?Af(o.content):""}catch{u=(o==null?void 0:o.content)??""}return Kr(i,{kind:"user",text:u})}case"permission-req":{const o=Gi(s);return o!=null&&o.id?Kr(i,{kind:"perm",id:o.id,title:o.title??"",tool:o.tool??"",state:"open"}):i}case"permission-resolved":{const o=Gi(s);return o!=null&&o.id?{...i,items:i.items.map(u=>u.kind==="perm"&&u.id===o.id&&u.state==="open"?{...u,state:o.outcome??"expired"}:u)}:i}case"task-running":if(s.kind==="acp_event"){const o=Gi(s);if(o!=null&&o.update)return jv(i,o.update)}return i;default:return i}}function up(i,s){let o=i;for(const u of s)o=zv(o,u);return o}function Pv(i,s,o){return{...i,items:i.items.map(u=>u.kind==="perm"&&u.id===s&&u.state==="open"?{...u,state:o?"allowed":"rejected"}:u)}}tt.setOptions({gfm:!0,breaks:!0});const Tt='"JetBrains Mono","HarmonyOS Sans SC",ui-monospace,Menlo,Consolas,"Courier New","Microsoft YaHei",monospace';function Bv(i){const s=i.target.closest("a");if(!s)return;i.preventDefault();const o=s.getAttribute("href")||"";/^https?:/i.test(o)&&Of(o)}function Uv({text:i}){const s=F.useMemo(()=>fm.sanitize(tt.parse(i,{async:!1})),[i]);return c.jsx("div",{className:"md",onClick:Bv,dangerouslySetInnerHTML:{__html:s}})}function Fv({text:i}){const[s,o]=F.useState(!1);return c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[c.jsxs("div",{onClick:()=>o(!s),style:{display:"flex",alignItems:"center",gap:8,fontSize:12,color:"var(--t4)",cursor:"pointer",userSelect:"none",lineHeight:1.6,minWidth:0},children:[c.jsx(Av,{}),c.jsx("span",{style:{fontWeight:600,color:"var(--t3)",flex:"none"},children:"思考"}),!s&&c.jsx("span",{className:"ellipsis",style:{flex:1,minWidth:0},children:i.trim().replace(/\s+/g," ")}),s&&c.jsx("span",{style:{flex:1}}),c.jsx(yc,{size:9,color:"var(--t6)",style:{transform:s?"rotate(90deg)":"none",transition:"transform .15s ease"}})]}),s&&c.jsx("div",{style:{marginLeft:5,borderLeft:"2px solid var(--line)",padding:"2px 0 2px 13px",fontSize:12,color:"var(--t4)",lineHeight:1.7,whiteSpace:"pre-wrap",wordBreak:"break-word",animation:"mcin .2s ease"},children:i})]})}function Wv({entries:i}){const s=o=>o==="completed"?"☑":o==="in_progress"?"◐":"☐";return c.jsx("div",{className:"card",style:{padding:"11px 14px",fontSize:12.5,display:"flex",flexDirection:"column",gap:4,animation:"mcin .25s ease"},children:i.map((o,u)=>c.jsxs("div",{style:{color:o.status==="completed"?"var(--t5)":o.status==="in_progress"?"var(--acc)":"var(--t2)",textDecoration:o.status==="completed"?"line-through":"none"},children:[c.jsx("span",{style:{display:"inline-block",width:18},children:s(o.status)})," ",o.content]},u))})}function Hv({status:i}){return i==="ok"?c.jsx(xc,{size:11}):i==="fail"?c.jsx("span",{style:{color:"var(--err)",fontSize:11,flex:"none"},children:"✗"}):c.jsx("span",{style:{width:7,height:7,borderRadius:"50%",flex:"none",border:"1.5px solid var(--acc)",background:"var(--accBd)",animation:"mcpulse 1.4s infinite"}})}function Gv(i){return i==="ok"?c.jsx(xc,{size:10}):i==="fail"?c.jsx("span",{style:{color:"var(--err)",fontSize:10,flex:"none"},children:"✗"}):c.jsx("span",{style:{color:"var(--t5)",fontSize:10,flex:"none",animation:"mcpulse 1.2s infinite"},children:"◌"})}function yf(i,s){if(!s)return i;const o=s.endsWith("/")?s:s+"/";return i.split(o).join("")}function Yv({item:i,onOpenChild:s,workdir:o}){const u=i.feed??[],d=u.slice(-5),p=yf(i.title,o),v=p.indexOf(" "),m=(v>0?p.slice(0,v):"").replace(/[::]$/,""),w=v>0?p.slice(v+1):p,y={display:"flex",gap:7,alignItems:"center",paddingLeft:15,font:"11px/1.7 "+Tt,color:"vaLine truncated
|
||||
`),p=[],v=[],m=[];for(const y of d){const E=y.match(qv);E&&s?(E[1]==="图片"?p:v).push(E[2]):m.push(y)}const w=m.join(`
|
||||
`).trim();return c.jsxs("div",{style:{display:"flex",justifyContent:"flex-end"},children:[c.jsxs("div",{style:{maxWidth:"70%",background:"var(--userBg)",border:"1px solid var(--accBd)",borderRadius:"12px 12px 3px 12px",padding:"9px 15px",fontSize:13.5,lineHeight:1.6,color:"var(--t1)",whiteSpace:"pre-wrap",wordBreak:"break-word",animation:"mcin .25s ease"},children:[w,(p.length>0||v.length>0)&&c.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginTop:w?8:2,alignItems:"center"},children:[p.map(y=>c.jsx("img",{src:s(y),alt:y,title:y,onClick:()=>u(y),style:{maxWidth:150,maxHeight:120,borderRadius:8,border:"1px solid var(--accBd)",cursor:"zoom-in",display:"block"}},y)),v.map(y=>c.jsxs("span",{title:y+"(点击下载)",onClick:()=>Of(new URL(s(y),location.origin).href),style:{height:28,display:"flex",alignItems:"center",gap:6,padding:"0 10px",borderRadius:8,border:"1px solid var(--accBd)",background:"var(--card)",fontSize:12,color:"var(--t2)",maxWidth:240,cursor:"pointer"},children:["📄",c.jsx("span",{className:"ellipsis",children:y.split("/").pop()})]},y))]})]}),o&&c.jsx("div",{onClick:()=>u(null),style:{position:"fixed",inset:0,background:"var(--scrim3)",zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",cursor:"zoom-out"},children:c.jsx("img",{src:s(o),alt:o,style:{maxWidth:"90vw",maxHeight:"90vh",borderRadius:10,boxShadow:"var(--shadowLg)"}})})]})}function Zv({item:i,onPermAnswer:s,uploadUrl:o}){switch(i.kind){case"user":return c.jsx(Qv,{text:i.text,uploadUrl:o});case"agent":return c.jsx("div",{style:{maxWidth:"92%",wordBreak:"break-word",animation:"mcin .25s ease"},children:c.jsx(Uv,{text:i.text})});case"thought":return c.jsx(Fv,{text:i.text});case"plan":return c.jsx(Wv,{entries:i.entries});case"sys":return i.text==="— 本轮结束 —"?c.jsx(Vv,{}):c.jsx("div",{style:{color:i.error?"var(--err)":"var(--t5)",fontSize:11.5,textAlign:"center"},children:i.text});case"perm":return c.jsx(Kv,{item:i,onAnswer:s})}}function dp({items:i,onPermAnswer:s,onOpenChild:o,uploadUrl:u,workdir:d}){const p=[];for(let v=0;v<i.length;){const m=i[v];if(m.kind==="tool"){const w=v,y=[];for(;v<i.length;){const E=i[v];if(E.kind!=="tool")break;y.push(E),v++}p.push(c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:y.map((E,D)=>c.jsx(Yv,{item:E,onOpenChild:o,workdir:d},E.tcId||D))},"g"+w))}else p.push(c.jsx(Zv,{item:m,onPermAnswer:s,uploadUrl:u},v)),v++}return c.jsx(c.Fragment,{children:p})}function Xv(i){const s=[];let o=0,u=0;for(const d of i.split(`
|
||||
`)){const p=d.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(p){o=+p[1],u=+p[2],s.push({no:"",text:d,kind:"h"});continue}d.startsWith("diff ")||d.startsWith("index ")||d.startsWith("+++")||d.startsWith("---")||d.startsWith("new file")||d.startsWith("deleted file")||d.startsWith("similarity")||d.startsWith("rename")||d.startsWith("old mode")||d.startsWith("new mode")||(d.startsWith("+")?s.push({no:String(u++),text:d,kind:"add"}):d.startsWith("-")?s.push({no:String(o++),text:d,kind:"del"}):(s.push({no:String(u),text:d,kind:"ctx"}),o++,u++))}return s}function Jv({text:i}){const s=F.useMemo(()=>Xv(i),[i]);return s.some(o=>o.kind==="h")?c.jsx("div",{style:{font:"12px/1.9 "+Tt},children:s.map((o,u)=>o.kind==="h"?c.jsxs("div",{style:{display:"flex",padding:"2px 24px",background:"var(--codeBg)",color:"var(--t4)",fontSize:11},children:[c.jsx("span",{style:{width:36,flex:"none"}}),c.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all"},children:o.text})]},u):c.jsxs("div",{style:{display:"flex",padding:"0 24px",background:o.kind==="add"?"var(--addBg)":o.kind==="del"?"var(--delBg)":"transparent",color:o.kind==="add"?"var(--addT)":o.kind==="del"?"var(--delT)":"var(--t3)"},children:[c.jsx("span",{style:{width:36,color:"var(--t5)",flex:"none",opacity:.6},children:o.no}),c.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",minWidth:0},children:o.text||" "})]},u))}):c.jsx("pre",{style:{margin:0,padding:"10px 24px",font:"12px/1.9 "+Tt,color:"var(--t4)",whiteSpace:"pre-wrap"},children:i})}for(const[i,s]of Object.entries({bash:gm,c:mm,cpp:vm,css:Tm,go:Nm,ini:Rm,java:Cm,javascript:Lm,json:Dm,markdown:jm,python:zm,rust:Pm,sql:Bm,typescript:Fm,xml:Wm,yaml:Hm}))zf.registerLanguage(i,s);const $v={js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",tsx:"typescript",go:"go",py:"python",rs:"rust",java:"java",c:"c",h:"c",cc:"cpp",cpp:"cpp",hpp:"cpp",json:"json",css:"css",html:"xml",htm:"xml",xml:"xml",svg:"xml",vue:"xml",md:"markdown",markdown:"markdown",sh:"bash",bash:"bash",zsh:"bash",yml:"yaml",yaml:"yaml",sql:"sql",ini:"ini",toml:"ini",conf:"ini"};function ey(i){const s=[],o=[];for(const u of i.split(`
|
||||
`)){const d=o.join(""),p=/<span[^>]*>|<\/span>/g;for(let v=p.exec(u);v;v=p.exec(u))v[0]==="</span>"?o.pop():o.push(v[0]);s.push(d+u+"</span>".repeat(o.length))}return s}const wf={flex:1,minWidth:0,whiteSpace:"pre-wrap",wordBreak:"break-word",color:"var(--t2)"};function ty({path:i,text:s}){const o=F.useMemo(()=>{var p;const u=((p=i.split(".").pop())==null?void 0:p.toLowerCase())??"",d=$v[u];if(d)try{return{html:!0,rows:ey(zf.highlight(s,{language:d}).value)}}catch{}return{html:!1,rows:s.split(`
|
||||
`)}},[i,s]);return c.jsx("div",{style:{font:"12px/1.9 "+Tt},children:o.rows.map((u,d)=>c.jsxs("div",{style:{display:"flex",padding:"0 24px"},children:[c.jsx("span",{style:{width:42,color:"var(--t5)",flex:"none",opacity:.6,userSelect:"none"},children:d+1}),o.html?c.jsx("span",{className:"hl",style:wf,dangerouslySetInnerHTML:{__html:u||" "}}):c.jsx("span",{style:wf,children:u||" "})]},d))})}const al="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAABRHElEQVR4nO29d5xU1fn4/z7nlukzuwtLFQSxYkM0xkqxG40dkqiJibFrNNUYUxbSjUlMMTEmxhg1FogxdmMDLBhRBBRsiIL0Xdg2O/Xee57fH3dmG7sUP7Z8fz6v192ZvXPvac9znvO08xz4GD6Gj+Fj+Bg+ho/hY/gYPoaP4WP4GDYPCkEB6sNuyHsB/0904n0BEdXANPUKu6tG6tWc2bPD+5On+53PzJhhMXVq8OE08GN4T6FBRE+cNctmVoONoPt6RgEiokTEFiScPPK/PYn+pxv/fwIRNYWZeubsJYrJ0wNAqj85QFkk8p32p7ZvtstjlwXNw7yCN369KqadwN69mUI0HkuUDqD+67fWHPMwIhqlzIfXmXcP/78iABFRk2ZPs+ZM2l1QXaw7iuY2Wbrzo+3v7P+W17Z3ixT3bglyu7T6heFByrU8BaXAIIDn+WhfMAmbnQqRpnmDT965lto2QVBKSf+1fzTB/rAb8H5DF9IxKpylvgZekw3p6S3PT1pOduIGv3jQ19bO3rc9rpyCZfADD4MPtkDZC5TliHIc8DzsnKdFI7T75NFuPpu3SSP/q0vB/5sEIKgpzNAzAaVUAPgW8IsNC4b/hxWHvynZCRMa/310wWW7ojb4vkcgHpScQEcjYumIsjxLmeYOJavXWtaKZmRFI6qtjLn4MCRp+1Yibo/Opf65XXr4BmSGVannfw7+J6m2XxBRMFNX2bsCnpa1g37ePu/YpaWWkzaUSocVE066hMGUS6C00VHXCEap5pxm2TrFS2uQRavg9bXoVa3Q3IEqeaigiLngWPyfnyymNSeDIml/urXPHhcOGr+0QURP/x+VAf7f4AAiitnTLJTygUBErCuL8ybNyq88fWrTg8e1RxmcUwWMeFCOBFYsJqioZtlazQtLtZ77Fix6B95pgVwJhYBloRwLcW0wgtl5e4IrjoZsIXAHpO2x2dRtFw0av3SKzLCmd5/9EmoHDaBeYWaoQgITZ89mTncV8iMC/9sE0BPxvoikj9l41yn7brjjslUUxrXaQjmfQ3k6IOagHNHq1XUWT7yGmv0aevEqVEsuLCvigGtDTTzUB0TAhJNaiiX8y46BVERMtqSH5q22y4bu9oPZsxrst9hBIbMUs2fDpOkBFUFwejetAmDOBzku2wD/mwTQC/E/WfNk/b322gtGbbjpvA2Ov12hWEKKgVjpRGDFUhZvrbHUYy+jHl6CWrgK2vMo24KoCzUJAJQRRAQCg5IK9iyNastjjt4TOXEvZGOHiQ6us8ZlMz86We25EmA+0wHQlcsTiZ2fe7LGb+8Y/nI0PyRdlnEron56Tz+y+IH6qTeXja/4CGkL/1sygIiaOHuaVWWl31n32OC7WXVBU1C8MB+3B5eyObTSgUrFlLQVNLNfhbsXop95A92UBdtG4g5YujLDpcc87RoMCW/7BhIu/j0XIiNqjSitx0vd3KUjv3zwDR0Lh8xh3bA3TW5ULl/cb43JDTLCnh1+eVCADPYJYioZxbc1HoZMOskRG2u+fMfAY26cOKvB/qgsB/8zHGCKzLBmKhXMAf/BNW/UX6nnXXS9WnpRNqoHeW0FrJzjW8mkJWtbLHXzXNSMeaiXV4cITkSQ2gRKBGXCWS59IV5RIQgFWkEhT/CTUzC7DEVt6FA67mCQRO3K6174WsucnXPapIJYhGIkIBDBeCZ8D4WyHKzAD1TWE6PwmrXlNPnueODGOZM+yJHbPHz0CaAi2c9UUwNZLfHPxB74+kXlpy9aF/GHltqLqED7OhWz5M2Nttz2H/RdL6DfaQbXQdJxUKCMgcB0K7Jb+b15oAKUQnUUMSftS3D6vtCcQ1lKScFjQax5b21biB8gWOCXAhxLlAIlKJX3lW4uKFnXrqxs3goOGkUAemBZ9FidnPk4MIXdZeYHMHRbAx9tApAZFkoFFgRHrPvnETs5N/1yncveHdk2tGf7Oh235I01tv7rM+i7F6KasqhYFGqTYAwqMH0vcqrPr12gFQSG4LR9kHQEVfCRuAu2g6UwlANUyVN6Q5uSVc2WWdaEfr0RtboFVrdBcwes2Uhw4WFw9C5GlQNdn+e132135Nzfi6iZfHRUxo8kATRIg54OoKYGV699ZtCNeumP5+rmcztKJXQ28O1M0pJ3Ntr87F7sO+ejNuYhEYHaBAQCftA5k3sJ40B/gk+3uyLg2Og75mP23g7KBvXSanhrIyxdr9VbG1ArN6DWZ9HZAlbJR1WWDbE1ojVqYB3mnCMwxcDE4km9k19zo1LKmyiz7DmKj8T6Dx9BITBc66cGDnD4hn+dtcg0X9XoeIODDXljZZJQ8rX+2xzUdbNgbRsqEQPHCmd8Fdeq8w99EUDf0H0oBJRCch5SEwnL35hHlT1AobRGHAscC2WpCqEREo5W0JIjOGsi5prTJWhvU0OtVMfN6aNGHZnZbiMiHykt4KPDAUQUTLNmqqn+39YuGPU76/VfP221nNzRkUWjAzUwacnjr6F/9hB6/ltQZfVBuL5vSsnbMsZ9CAJGUAkHVQiQvA9RBxJupWQBA4ggRlBIVW8ImXsignzhE0i5EFjJmF2b5bojM9tt3PGN30beVKr0rsbnfYI+/d4fNDRIg4ZpSqvp/iUts076sbvwhUV228m5xtbAiseFjoJlfe027M/9CWvRSqhNoRyN8sNZvwny36v5ZQQsULYKNYigIlcE0kOSrKA+VC87SshRY5E9hkOuqHVgJJ2uSTzZ/kb9mztfVkJQYX8/GvChLwFVlh/D4vDGu66a57Ze3phtQRsC0mmLexZgTbsLvXwjZLqMNpuFd9WrXkuA9PqtF9eWTb4QGo5a85gzD8S/4axQKC36YtVnVH2Jd3aza3/6yOMn3aCmqiCUBSZ/6LLAh0oAE2fNsudMnuzPWL94yDT94g3Lk95x+TUtgZ1KaNORV9aPH0DdNBdsGxV3QsOMIhS4+oKt7E0PUaHfh3r9qrq/2QeTka5PsRTmgklw+gHIiHpMW0cg2ljxmgxDcjx9hD/ooj+PPO5lQs4nH6ZM8KERQNUa9sN3Ht3zL9Y7d66Jm92Cja2erk878vwKrK/egbV4JZJOojDhmktV3tqSHtc/bG6kexS1BSrplwAgXB46CsjgDP6XJ8AXJ6JTWoL2fEBNzK4N7Pw4u/7Spwed9tcyFa1HTf9QVMMPhQD2feF6Z/5+53tfanxw4mx7w/1vl9uSusP3ZWDcVv94Guvyu1FFg0pFwa9yybCp7ycB9Ib+it4s8qtgayj6UCgguw5HvnMcwXF7oLLFIBBjpQcNYOecc/vz/qRz1PDh+Q+LCD5wAqiufUe/ffukBcnC/Y3FbMIKCEzCtfTP7sP69WMQj0JFyOtUsbq1WL1LAng3fLZ38X2W0d9NpUK3cr6M+AH+5w/AfO9EVCoiqr0jYEDC3q0cX3h2cdCnvj7q2LVVeehdNPNdwwdLADLDQk0NJr59y6SXEsX720qFhCXKBBqtv34b1oznIZMK3bCmKt73RQDhF2FT+ths9e9VP7ay8E5LRMU/QFuOYPdhyG/PRO0zEtnQ6pu6hD2gZL1yaPvAI+4ee+oHTgQfmDoypYL8s9Y+NGlxwru/pVhIKKNNIKL1F/6CnvE8UpOCIAiRD/SP/G4yV2+B/aMAFXyLqrTNCJgAauPo19djnfI75O4FmEEDbasl72+MmLFPDWh+7KvLHxo6U00NGkQ+MLx8IBU1SIOeqaYGv9w4b8QcveHfG/18wjbKGAutz/4r+olXUTUplBdsEZtC34986ESgen32Bb5BJSMoX9Dn3Yh1/eMwoMa2Wwt+s23G/jve9NgNTa8Om46SD8pW8P5XIqKmz3xFiUjkT6U37luhOjJWKQiCiNb6gr+hH38FapLgdeN6nRuvpNf/PQru8+vm4APfz9VXuwIDtkYnolhXzED9/nGC+gG21Zz3VzrFsdd6zz8kS8SZDp3hZe8nfABUNs3SU2cG49fdfu076fLeVkfJl5q4pa+ciXX/IsiEyO/bZbOl/r+7ef+ejar0unrf7w+qS1w6jpr2L/R1j8OAtK0b2/yXo7m9xqf+/jdHTTcw833Hz/tawRQRCzXdP3blfV94M+mdU25q8U1d0ubaR7H+9gySToaeuwr0OWZ9ieE9BngzxpnNwLviBv0hvPczm61R9ZBcVSqG/u4M5K75mPpam6YO/42a4PRxq247CzU1mDhr1vvqr3nfCGDKjBnWTJS5WRbvuDje+sdsc6uxkjFLZi1G/+h+SMbCQI1uoHr+2RR6D253IpC+H9kSbBURbGlGv1uQsAEq5qK/cRvqxZXoTNwqNLcGbzv5P3y9adaucyZP9pkxw3ofagfeRwKYCbhKy28bF/1qtVNMWMoxQXNRWZfPREsl5Kp3WFZf2NjSjOt6+10habOvvJeIr0z8TS4BHBtV8NCX3oxpLylLO7TYfuIhb/lfRMRmCu+bPPD+EICE26aPW3vfYW9F/RPMxlxAKmLrXzyAXtoIcSf0qFVgU+RvydmjUNVrk7q3qoTNP9Mv4jf9QXVLine truncated
|
||||
`)){const d=u.indexOf("=");if(d<=0)continue;const p=u.slice(0,d).trim();p&&(s[p]=u.slice(d+1).trim(),o++)}return o?s:void 0}const cy=i=>i&&typeof i=="object"?Object.entries(i).map(([s,o])=>`${s}=${String(o)}`).join(`
|
||||
`):"";function uy(i){const s={};for(const o of i){const u=o.name.trim();if(u)if(o.type==="stdio"){if(!o.command.trim())continue;const d=o.args.trim()?o.args.trim().split(/\s+/):void 0;s[u]={command:o.command.trim(),args:d,env:bf(o.kv)}}else{if(!o.url.trim())continue;s[u]={url:o.url.trim(),headers:bf(o.kv)}}}return s}function _f(i){return Object.entries(i).map(([s,o])=>{const u=o??{},d=typeof u.command=="string"&&u.command!=="";return{name:s,type:d?"stdio":"http",url:typeof u.url=="string"?u.url:"",command:typeof u.command=="string"?u.command:"",args:Array.isArray(u.args)?u.args.map(String).join(" "):"",kv:cy(d?u.env:u.headers)}})}const dy={fontSize:11,fontWeight:700,letterSpacing:.5,color:"var(--t4)"},Hn={width:"100%",height:30,border:"1px solid var(--inputBd)",borderRadius:7,background:"var(--inputBg)",color:"var(--t1)",padding:"0 10px",fontSize:12,fontFamily:Tt,outline:"none",minWidth:0},Tf={width:"100%",height:30,border:"1px solid var(--inputBd)",borderRadius:7,background:"var(--inputBg)",color:"var(--t1)",padding:"0 6px",fontSize:12,outline:"none",cursor:"pointer"},Vr={height:28,border:"1px solid var(--btnBd)",background:"var(--card)",color:"var(--t1)",borderRadius:8,padding:"0 13px",fontSize:12,fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:5,boxShadow:"var(--cardSh)",whiteSpace:"nowrap"};function wn({label:i,children:s}){return c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,flex:1,minWidth:0},children:[c.jsx("span",{style:{fontSize:11.5,color:"var(--t3)",fontWeight:600},children:i}),s]})}function Os({label:i,action:s,children:o}){return c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:9},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[c.jsx("span",{style:dy,children:i}),c.jsx("span",{style:{flex:1}}),s]}),o]})}function fy({version:i,update:s,onUpdateStatus:o}){const[u,d]=F.useState("idle"),[p,v]=F.useState(null),m=!!(s!=null&&s.available),w=async()=>{d("checking"),v(null);try{const P=await If();o(P),P.available||v({text:"已是最新版本",color:"var(--ok)"})}catch(P){v({text:P instanceof Error?P.message:String(P),color:"var(--err)"})}finally{d("idle")}},y=async()=>{d("installing"),v(null);try{await Ag()}catch(P){v({text:P instanceof Error?P.message:String(P),color:"var(--err)"}),d("idle")}},E=u!=="idle",D=u==="checking"?"检查中":u==="installing"?"更新中":m?"下载更新":"检查更新",T=m&&u!=="checking";return c.jsxs("div",{className:"card card-lg",style:{padding:"14px 16px",display:"flex",alignItems:"center",gap:12},children:[c.jsx("div",{style:{width:34,height:34,borderRadius:9,background:"var(--accBg)",display:"flex",alignItems:"center",justifyContent:"center",flex:"none"},children:c.jsx("img",{src:al,alt:"",draggable:!1,style:{width:22,height:22,borderRadius:5}})}),c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[c.jsx("span",{style:{fontWeight:700,fontSize:13},children:"MonkeyCode"}),c.jsx("span",{className:"ellipsis",style:{fontSize:11.5,color:"var(--t5)",fontFamily:Tt},children:m?`${(s==null?void 0:s.current)??i} → ${s==null?void 0:s.latest} 可用`:i})]}),c.jsx("span",{style:{flex:1}}),p&&c.jsx("span",{style:{fontSize:12,color:p.color,flex:"none"},children:p.text}),c.jsxs("button",{className:T?"hv-acc":"hv",onClick:()=>!E&&void(T?y():w()),style:{...Vr,gap:6,flex:"none",...T?{background:"var(--acc)",borderColor:"var(--acc)",color:"var(--onAcc)"}:{},opacity:E?.7:1,cursor:E?"default":"pointer"},children:[E&&c.jsx("span",{style:{width:11,height:11,border:`1.5px solid ${T?"var(--onAcc)":"var(--t1)"}`,borderTopColor:"transparent",borderRadius:"50%",animation:"mcspin .9s linear infinite",display:"inline-block"}}),D]})]})}const Nf=i=>/^1[3-9]\d{9}$/.test(i.trim());function py(i){for(const s of["name","nickname","username","phone","email"]){const o=i==null?void 0:i[s];if(typeof o=="string"&&o.trim())return o.trim()}return"已登录"}function hy({onSynced:i,knownKeys:s,existingNames:o}){const[u,d]=F.useState(null),[p,v]=F.useState(""),[m,w]=F.useState("wechat"),[y,E]=F.useState(""),[D,T]=F.useState(""),[P,B]=F.useState(!1),[U,G]=F.useState(!1),[ae,me]=F.useState(0),[xe,Z]=F.useState(""),[pe,A]=F.useState(""),[V,j]=F.useState("loading"),[H,ee]=F.useState(!1),[Me,be]=F.useState(null),[Be,qe]=F.useState(null),[$e,Ge]=F.useState({}),[Pe,z]=F.useState(!0),re=F.useRef(!0),M=F.useRef(0);F.useEffect(()=>(re.current=!0,Wo().then(se=>re.current&&d(se)).catch(se=>re.current&&v(se instanceof Error?se.message:String(se))),()=>{re.current=!1,M.current++}),[]);const S=async()=>{const se=++M.current,_e=()=>re.current&&se===M.current;Z(""),A(""),j("loading");try{const ze=await mg();if(!_e())return;for(A(ze.qr),j("waiting");;){const De=await vg();if(!_e())return;if(De.status==="waiting"||De.status==="scanned"){j(De.status);continue}if(De.status==="ok"){const yt=await Wo();_e()&&d(yt);return}j(De.status);return}}catch(ze){if(!_e())return;j("error"),Z(ze instanceof Error?ze.message:String(Line truncated
|
||||
`);if(!(!W||!V.current)){if(u.running){G(W),B(""),me([]);return}V.current.send("user-input",{content:js(W)})&&(B(""),me([]))}},stop:()=>{var N;return void((N=V.current)==null?void 0:N.send("user-cancel",{}))},clearQueued:()=>G(null),addFiles:async N=>{if(s)for(const W of N){if(W.size>20*1024*1024){v(`⚠ ${W.name||"文件"} 过大(上限 20MB)`);continue}try{const le=await new Promise((se,_e)=>{const ze=new FileReader;ze.onload=()=>se(ze.result),ze.onerror=()=>_e(new Error("读取文件失败")),ze.readAsDataURL(W)}),Le=le.slice(le.indexOf(",")+1),Ae=W.type.startsWith("image/"),{path:We}=await dg(s,W.name,W.type,Le);me(se=>[...se,{path:We,isImage:Ae,name:W.name||We.split("/").pop()||"",preview:Ae?le:void 0}])}catch(le){v("⚠ 附件上传失败: "+(le instanceof Error?le.message:String(le)))}}},removeAtt:N=>me(W=>W.filter((le,Le)=>Le!==N)),answerPerm:(N,W)=>{var Le;const le=W!=="deny";(Le=V.current)!=null&&Le.send("permission-resp",{id:N,approved:le,remember:W==="always"||W==="persist",persist:W==="persist"})&&d(Ae=>Pv(Ae,N,le))},switchModel:async N=>{var W;if(!(!V.current||!N||N===y))try{const le=await V.current.call("session_set_model",{model:N});if(le.error){v("⚠ 切换模型失败: "+le.error);return}E(N),(W=H.current)==null||W.call(H)}catch(le){v("⚠ 切换模型失败: "+(le instanceof Error?le.message:le))}},toggleYolo:async()=>{if(!V.current)return;const N=D,W=N?"default":"yolo";T(!N);try{const le=await V.current.call("session_set_mode",{mode:W});le.error&&(T(N),v("⚠ 切换权限模式失败: "+le.error))}catch(le){T(N),v("⚠ 切换权限模式失败: "+(le instanceof Error?le.message:le))}},refreshChanges:ee,fileDiff:N=>{const W=V.current;return W?W.call("repo_file_diff",{path:N}):Promise.reject(new Error("未连接"))},listFiles:N=>{const W=V.current;return W?W.call("repo_file_list",{path:N}):Promise.reject(new Error("未连接"))},readFile:N=>{const W=V.current;return W?W.call("repo_read_file",{path:N}):Promise.reject(new Error("未连接"))},reveal:N=>{const W=V.current;return W?W.call("repo_reveal",{path:N}):Promise.reject(new Error("未连接"))},notify:v}}const Xa="~/MonkeyCode",Rf=/Mac/.test(navigator.userAgent),fr={A:{text:"新增",fg:"var(--addT)",bg:"var(--addBg)"},M:{text:"修改",fg:"var(--warn)",bg:"var(--warnBg)"},D:{text:"删除",fg:"var(--delT)",bg:"var(--delBg)"}},wy=i=>i>=1<<20?(i/(1<<20)).toFixed(1)+" MB":i>=1024?(i/1024).toFixed(1)+" KB":i+" B",Ms={height:32,display:"flex",alignItems:"center",gap:9,padding:"0 10px",borderRadius:8,cursor:"pointer",minWidth:0,flex:"none"},Ls={flex:"none",fontSize:10.5,fontWeight:600,borderRadius:9,padding:"2px 8px",lineHeight:1.4},Cf=i=>({border:"none",background:"transparent",height:34,padding:"0 3px",marginBottom:-1,borderBottom:`2px solid ${i?"var(--acc)":"transparent"}`,fontSize:13,fontWeight:i?700:500,color:i?"var(--t1)":"var(--t5)",cursor:i?"default":"pointer",display:"flex",alignItems:"center",gap:6,flex:"none"});function Sy(){var kn,fn;const[i,s]=F.useState([]),[o,u]=F.useState("new"),[d,p]=F.useState([]),[v,m]=F.useState(null),[w,y]=F.useState(null),[E,D]=F.useState(!1),[T,P]=F.useState("files"),[B,U]=F.useState(new Map),[G,ae]=F.useState(new Set),[me,xe]=F.useState(new Set),[Z,pe]=F.useState(""),[A,V]=F.useState(null),[j,H]=F.useState(()=>{const L=parseInt(localStorage.getItem("mc.drawerWidth")??"",10);return Number.isFinite(L)?Math.min(Math.max(L,420),1200):600}),[ee,Me]=F.useState(!1),[be,Be]=F.useState(()=>{const L=parseInt(localStorage.getItem("mc.drawerSplit")??"",10);return Number.isFinite(L)&&L>0?Math.max(L,80):0}),[qe,$e]=F.useState(!1),Ge=F.useRef(null),[Pe,z]=F.useState(null),[re,M]=F.useState(Xa),[S,N]=F.useState(""),[W,le]=F.useState(""),[Le,Ae]=F.useState(""),[We,se]=F.useState(!1),[_e,ze]=F.useState(!1),De=F.useRef(!1),yt=F.useCallback(async()=>{const L=await sg();return s(L),L},[]),fe=xy({onSessionsChanged:()=>void yt()}),zt=(L,K)=>{fe.open(L.id,{model:L.model,mode:L.mode,firstMessage:K}),u("session"),D(!1),V(null)},Ke=async L=>{try{await ug(L.id,!L.archived),await yt()}catch(K){fe.notify("⚠ 归档失败: "+(K instanceof Error?K.message:String(K)))}},Mn=async(L,K)=>{try{await cg(L.id,K),await yt()}catch(g){fe.notify("⚠ 重命名失败: "+(g instanceof Error?g.message:String(g)))}},Gn=async L=>{try{await ag(L.id)}catch(K){fe.notify("⚠ 删除失败: "+(K instanceof Error?K.message:String(K)));return}L.id===fe.id&&(fe.close(!0),u("new"),D(!1),V(null)),yt()};F.useEffect(()=>{const L=Ig("open-settings",()=>u("settings"));return Promise.all([og().catch(()=>[]),yt()]).then(([K,g])=>{var we;p(K),N(((we=K.find(ge=>ge.default))==null?void 0:we.name)??"");const C=yy(),J=g.find(ge=>ge.id===C);J&&zt(J),K.length===0&&qi()&&u("settings")}).catch(K=>fe.notify("无法连接服务: "+(K instanceof Error?K.message:K))),qi()&&(Cg().then(K=>m((K==null?void 0:K.version)??null)),If().then(y).catch(()=>{})),()=>L()},[]);const Vt=((kn=[...i].sort((L,K)=>(K.updated_at??"").localeCompare(L.updated_at??""))[0])==null?void 0:kn.workdir)??Line truncated
|
||||
<style rel="stylesheet" crossorigin>:root{--bg: #fcfdfc;--side: #eef1ee;--line: rgba(30, 40, 35, .12);--line2: rgba(30, 40, 35, .08);--t1: #1d221f;--t2: #2a302b;--t3: #59605a;--t4: #7b827c;--t5: #8a918b;--t6: #a8afa9;--t7: #c4c9c3;--tDis: #b3b9b2;--acc: #1f8a5b;--accH: #25a06b;--accBg: rgba(31, 138, 91, .12);--accBd: rgba(31, 138, 91, .2);--accBg2: rgba(31, 138, 91, .15);--onAcc: #fff;--ok: #28a866;--err: #c2503e;--errBg: rgba(194, 80, 62, .09);--warn: #a16207;--warnBg: rgba(232, 193, 90, .14);--warnBd: rgba(161, 98, 7, .35);--card: #ffffff;--cardBd: rgba(30, 40, 35, .1);--cardSh: 0 1px 2px rgba(0, 0, 0, .04);--hov: rgba(120, 130, 125, .12);--hov2: rgba(120, 130, 125, .18);--hov3: rgba(120, 130, 125, .25);--pop: #fcfdfd;--shadow: 0 8px 28px rgba(30, 45, 38, .2);--codeBg: rgba(30, 40, 35, .05);--userBg: #e9f2ec;--addBg: rgba(40, 168, 102, .08);--addT: #1c7a4b;--delBg: rgba(194, 80, 62, .08);--delT: #a63d2e;--scrim: rgba(20, 30, 25, .25);--scrim2: rgba(20, 30, 25, .35);--scrim3: rgba(20, 30, 25, .55);--panel: rgba(255, 255, 255, .92);--panel2: rgba(255, 255, 255, .7);--panelSh: 0 4px 20px rgba(30, 45, 38, .08);--panelShLg: 0 10px 36px rgba(30, 45, 38, .12);--shadowLg: 0 24px 70px rgba(30, 45, 38, .3);--inputBg: #fdfdfc;--inputBd: rgba(30, 40, 35, .13);--btnBd: rgba(30, 40, 35, .15);--dashBd: rgba(30, 40, 35, .22);--errBd: rgba(194, 80, 62, .3);--accBd2: rgba(31, 138, 91, .3);--accBgSoft: rgba(31, 138, 91, .07);--accSel: rgba(31, 138, 91, .85);--accSh: 0 2px 8px rgba(31, 138, 91, .25);--onAccDim: rgba(255, 255, 255, .85);--onAccBg: rgba(255, 255, 255, .18);--warnBd2: rgba(161, 98, 7, .18);--warnT: #7c5210;--notice: #e8913a;--track: var(--hov3);--segBg: var(--hov);--segSh: 0 1px 3px rgba(0, 0, 0, .12);--linkH: #166b46;--sbThumb: rgba(110, 120, 115, .22);--sbThumbH: rgba(110, 120, 115, .38);--hlKw: #cf222e;--hlStr: #0a3069;--hlNum: #0550ae;--hlFn: #8250df;--hlAttr: #953800}*{box-sizing:border-box}html,body,#root{height:100%}body{margin:0;font-family:HarmonyOS Sans SC,HarmonyOS Sans,PingFang SC,Microsoft YaHei,sans-serif;background:var(--bg);color:var(--t1);font-size:13px;overflow:hidden}a{color:var(--acc);text-decoration:none}a:hover{color:var(--linkH);text-decoration:underline}input,textarea,select,button{font-family:inherit}textarea::placeholder,input::placeholder{color:var(--t6)}.ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.icon-btn{border:none;background:transparent;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;border-radius:6px;flex:none}.backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:29}.pop{background:var(--pop);border:1px solid var(--line);border-radius:9px;box-shadow:var(--shadow);padding:4px;display:flex;flex-direction:column;z-index:30;animation:mcin .15s ease}.menu-item{border:none;background:transparent;cursor:pointer;display:flex;align-items:center;gap:8px;padding:6px 9px;border-radius:6px;font-size:12.5px;color:var(--t1);text-align:left;white-space:nowrap}.card{background:var(--card);border:1px solid var(--cardBd);border-radius:10px;box-shadow:var(--cardSh)}.card-lg{border-radius:11px;padding:16px}.skeleton{background:var(--hov);border-radius:6px;animation:mcpulse 1.4s ease infinite;flex:none}.spinner{width:13px;height:13px;border:2px solid var(--acc);border-top-color:transparent;border-radius:50%;animation:mcspin .9s linear infinite;flex:none}@keyframes mcspin{to{transform:rotate(360deg)}}@keyframes mcpulse{0%,to{opacity:1}50%{opacity:.35}}@keyframes mcin{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}@keyframes mcslide{0%{transform:translate(40px);opacity:0}to{transform:none;opacity:1}}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--sbThumb);border-radius:6px;border:2px solid transparent;background-clip:content-box}::-webkit-scrollbar-thumb:hover{background:var(--sbThumbH);background-clip:content-box}*{scrollbar-width:thin;scrollbar-color:var(--sbThumb) transparent}.hv:hover{background:var(--hov)!important}.hv2:hover{background:var(--hov2)!important}.hv3:hover{background:var(--hov3)!important}.hv-t1:hover{color:var(--t1)!important}.hv-err:hover{color:var(--err)!important}.hv-errbg:hover{background:var(--errBg)!important}.hv-op:hover{filter:brightness(.97)}.hv-acc:hover{background:var(--accH)!important}.hv-accbg:hover{background:var(--accBgSoft)!important}.hv-bd:hover{border-color:var(--acc)!important}.hv-caption-close:hover{background:#e81123!important;color:#fff!important}.hl .hljs-comment,.hl .hljs-quote{color:var(--t5);font-style:italic}.hl .hljs-keyword,.hl .hljs-selector-tag,.hl .hljs-meta,.hl .hljs-doctag{color:var(--hlKw)}.hl .hljs-string,.hl .hljs-regexp,.hl .hljs-addition{color:var(--hlStr)}.hl .hljs-number,.hl .hljs-literal,.hl .hljs-symbol,.hl .hljs-bullet,.hl .hljs-built_in,.hl .hljs-variable,.hl .hljs-template-variable{color:var(--hlNum)}.hl .hljs-title,.hl .hljs-section,.hl .hljs-type,.hl .hljs-functioLine truncated
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -48,6 +48,7 @@ const (
|
||||
KindRepoReadFile = "repo_read_file"
|
||||
KindRepoFileChanges = "repo_file_changes"
|
||||
KindRepoFileDiff = "repo_file_diff"
|
||||
KindRepoReveal = "repo_reveal"
|
||||
// KindSessionSetModel 切换会话模型(轮次间生效;执行中拒绝)。
|
||||
// 成功后另发 model_update 帧进事件日志,回放可见。
|
||||
KindSessionSetModel = "session_set_model"
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
@@ -175,6 +176,38 @@ func (b *Browser) FileDiff(rel string) (string, error) {
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Reveal 在系统文件管理器中定位路径:目录直接打开,文件在父目录中选中。
|
||||
// 内核与浏览器同机(serve 仅绑 loopback),浏览器模式也因此可用。
|
||||
// Start 不等退出:explorer.exe 成功也返回非零码,Run 会误报错误。
|
||||
func (b *Browser) Reveal(rel string) error {
|
||||
p, err := b.resolve(rel)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
st, err := os.Stat(p)
|
||||
if err != nil {
|
||||
return fmt.Errorf("路径不存在: %w", err)
|
||||
}
|
||||
switch runtime.GOOS {
|
||||
case "darwin":
|
||||
if st.IsDir() {
|
||||
return exec.Command("open", p).Start()
|
||||
}
|
||||
return exec.Command("open", "-R", p).Start()
|
||||
case "windows":
|
||||
if st.IsDir() {
|
||||
return exec.Command("explorer", p).Start()
|
||||
}
|
||||
return exec.Command("explorer", "/select,"+p).Start()
|
||||
default:
|
||||
dir := p
|
||||
if !st.IsDir() {
|
||||
dir = filepath.Dir(p)
|
||||
}
|
||||
return exec.Command("xdg-open", dir).Start()
|
||||
}
|
||||
}
|
||||
|
||||
func (b *Browser) isGitRepo() bool {
|
||||
out, err := b.git("rev-parse", "--is-inside-work-tree")
|
||||
return err == nil && strings.TrimSpace(out) == "true"
|
||||
|
||||
@@ -162,3 +162,15 @@ func TestFileChangesInSubdirWorkdir(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Reveal 的守卫路径:越界拒绝、不存在报错(真实唤起文件管理器不在单测覆盖)。
|
||||
func TestRevealGuards(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
b := New(dir)
|
||||
if err := b.Reveal("../etc"); err == nil {
|
||||
t.Fatal("越界路径应被拒绝")
|
||||
}
|
||||
if err := b.Reveal("no-such-file"); err == nil {
|
||||
t.Fatal("不存在的路径应报错")
|
||||
}
|
||||
}
|
||||
@@ -1121,6 +1121,13 @@ func (ls *liveSession) handleCall(c *wsClient, f *frame.Frame) {
|
||||
result = map[string]string{"path": p.Path, "content": content}
|
||||
case frame.KindRepoFileChanges:
|
||||
result, callErr = browser.FileChanges()
|
||||
case frame.KindRepoReveal:
|
||||
var p struct {
|
||||
Path string `json:"path"`
|
||||
}
|
||||
_ = json.Unmarshal(f.Data, &p)
|
||||
callErr = browser.Reveal(p.Path)
|
||||
result = map[string]bool{"ok": callErr == nil}
|
||||
case frame.KindRepoFileDiff:
|
||||
var p struct {
|
||||
Path string `json:"path"`
|
||||
|
||||
+56
-1
@@ -31,6 +31,9 @@ import type { FileChange, FileEntry, LogItem, ModelInfo, SessionMeta } from "./t
|
||||
/** 首启默认工作目录(内核解析 ~,不存在时自动创建);老用户默认沿用最近会话的目录 */
|
||||
const DEFAULT_DIR = "~/MonkeyCode";
|
||||
|
||||
/** 内核与页面同机(serve 仅绑 loopback),浏览器 UA 即宿主平台 */
|
||||
const IS_MAC = /Mac/.test(navigator.userAgent);
|
||||
|
||||
/** 改动状态 → 普通用户可读的中文标签与配色(git 的 A/M/D 不外显) */
|
||||
const CHANGE_KIND: Record<FileChange["status"], { text: string; fg: string; bg: string }> = {
|
||||
A: { text: "新增", fg: "var(--addT)", bg: "var(--addBg)" },
|
||||
@@ -317,6 +320,32 @@ export default function App() {
|
||||
);
|
||||
};
|
||||
|
||||
// 工作区相对路径 → 绝对路径(Windows workdir 为反斜杠时统一分隔符)
|
||||
const absPath = (rel: string) => {
|
||||
const wd = currentMeta?.workdir ?? "";
|
||||
if (!rel) return wd;
|
||||
const sep = wd.includes("\\") ? "\\" : "/";
|
||||
const tail = sep === "\\" ? rel.split("/").join(sep) : rel;
|
||||
return wd.endsWith(sep) ? wd + tail : wd + sep + tail;
|
||||
};
|
||||
|
||||
// 在系统文件管理器中定位:内核在本机执行(open/explorer/xdg-open),
|
||||
// 壳内与浏览器模式行为一致;失败时复制绝对路径兜底
|
||||
const revealPath = async (rel: string) => {
|
||||
try {
|
||||
const r = await session.reveal(rel);
|
||||
if (r.error) throw new Error(r.error);
|
||||
} catch (e) {
|
||||
const p = absPath(rel);
|
||||
try {
|
||||
await navigator.clipboard.writeText(p);
|
||||
session.notify("⚠ 无法打开文件夹,已复制路径: " + p);
|
||||
} catch {
|
||||
session.notify("⚠ 无法打开文件夹: " + (e instanceof Error ? e.message : String(e)));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 打开抽屉(可指定视角:聊天区徽标直达「改动」);两个 tab 的数据并行刷新
|
||||
const openDrawer = (tab: "files" | "changes" = "files") => {
|
||||
setDrawerOpen(true);
|
||||
@@ -710,7 +739,16 @@ export default function App() {
|
||||
{CHANGE_KIND[changeMap.get(viewer.path)!].text}
|
||||
</span>
|
||||
)}
|
||||
<button className="hv2 icon-btn" title="关闭,回到文件列表 (esc)" onClick={() => setViewer(null)} style={{ marginLeft: "auto", width: 22, height: 22 }}>
|
||||
<button
|
||||
className="hv"
|
||||
title="在系统文件管理器中定位此文件(浏览器模式复制路径)"
|
||||
onClick={() => void revealPath(viewer.path)}
|
||||
style={{ marginLeft: "auto", flex: "none", height: 22, display: "flex", alignItems: "center", gap: 5, border: "none", background: "transparent", borderRadius: 6, padding: "0 8px", fontSize: 11.5, fontWeight: 600, color: "var(--t3)", cursor: "pointer" }}
|
||||
>
|
||||
<IconFolder size={11} color="var(--t4)" />
|
||||
{IS_MAC ? "在访达中显示" : "打开所在文件夹"}
|
||||
</button>
|
||||
<button className="hv2 icon-btn" title="关闭,回到文件列表 (esc)" onClick={() => setViewer(null)} style={{ width: 22, height: 22 }}>
|
||||
<IconX size={10} color="var(--t4)" />
|
||||
</button>
|
||||
</div>
|
||||
@@ -727,6 +765,23 @@ export default function App() {
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* 底部动作栏:不给普通用户看路径(不认识),给任务语言 + 平台母语按钮;
|
||||
完整路径留在按钮悬停提示里给开发者 */}
|
||||
<div style={{ flex: "none", display: "flex", alignItems: "center", gap: 10, padding: "9px 12px 9px 16px", borderTop: "1px solid var(--line2)", whiteSpace: "nowrap" }}>
|
||||
<span className="ellipsis" style={{ flex: 1, fontSize: 11.5, color: "var(--t5)" }}>
|
||||
这个任务的文件都保存在这台电脑上
|
||||
</span>
|
||||
<button
|
||||
className="hv-acc"
|
||||
title={currentMeta?.workdir ?? ""}
|
||||
onClick={() => void revealPath("")}
|
||||
style={{ flex: "none", height: 26, border: "none", background: "var(--acc)", color: "var(--onAcc)", borderRadius: 8, padding: "0 12px", fontSize: 11.5, fontWeight: 700, cursor: "pointer", display: "flex", alignItems: "center", gap: 6, boxShadow: "var(--accSh)" }}
|
||||
>
|
||||
<IconFolder size={12} color="var(--onAcc)" />
|
||||
{IS_MAC ? "在访达中打开" : "打开文件夹"}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -52,6 +52,8 @@ export interface SessionHandle {
|
||||
listFiles(dir: string): Promise<{ result?: FileEntry[]; error?: string }>;
|
||||
/** repo_read_file 同步查询(文件抽屉:读文件内容,内核限 1MB) */
|
||||
readFile(path: string): Promise<{ result?: { content?: string }; error?: string }>;
|
||||
/** repo_reveal:在系统文件管理器中定位(内核本机执行,浏览器模式同样可用) */
|
||||
reveal(path: string): Promise<{ result?: { ok?: boolean }; error?: string }>;
|
||||
/** 在状态行外显一条告警(App 级操作失败与连接状态同渠道展示) */
|
||||
notify(text: string): void;
|
||||
}
|
||||
@@ -286,6 +288,12 @@ export function useSession(opts: { onSessionsChanged?: () => void } = {}): Sessi
|
||||
return conn.call<{ result?: { content?: string }; error?: string }>("repo_read_file", { path });
|
||||
};
|
||||
|
||||
const reveal = (path: string) => {
|
||||
const conn = connRef.current;
|
||||
if (!conn) return Promise.reject(new Error("未连接"));
|
||||
return conn.call<{ result?: { ok?: boolean }; error?: string }>("repo_reveal", { path });
|
||||
};
|
||||
|
||||
return {
|
||||
id,
|
||||
chat,
|
||||
@@ -314,6 +322,7 @@ export function useSession(opts: { onSessionsChanged?: () => void } = {}): Sessi
|
||||
fileDiff,
|
||||
listFiles,
|
||||
readFile,
|
||||
reveal,
|
||||
notify: setStatus,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user