nexum-code 0.15.3 → 0.18.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/XMLParser-DFAnGqkc.mjs +3956 -0
- package/dist/{app-Dzqtno-_.mjs → app-aqWxJw2S.mjs} +12703 -8967
- package/dist/{dispatch-ClUS04uO.mjs → dispatch-ByfuGE0h.mjs} +1 -1
- package/dist/{dispatch-RwKBVuHW.mjs → dispatch-DQ6ufFQt.mjs} +37473 -28766
- package/dist/main.mjs +1 -1
- package/dist/{markit-DG5XsAGz.mjs → markit-XGWU21rO.mjs} +65 -3926
- package/dist/public/assets/astro-DAp21e1Q.js +2 -0
- package/dist/public/assets/astro-DAp21e1Q.js.map +1 -0
- package/dist/public/assets/bash-Yzrsuije.js +2 -0
- package/dist/public/assets/bash-Yzrsuije.js.map +1 -0
- package/dist/public/assets/c-BIGW1oBm.js +2 -0
- package/dist/public/assets/c-BIGW1oBm.js.map +1 -0
- package/dist/public/assets/cpp-BRuaLJcg.js +2 -0
- package/dist/public/assets/cpp-BRuaLJcg.js.map +1 -0
- package/dist/public/assets/csharp-COcwbKMJ.js +2 -0
- package/dist/public/assets/csharp-COcwbKMJ.js.map +1 -0
- package/dist/public/assets/css-DEUVOdPa.js +2 -0
- package/dist/public/assets/css-DEUVOdPa.js.map +1 -0
- package/dist/public/assets/dart-CF10PKvl.js +2 -0
- package/dist/public/assets/dart-CF10PKvl.js.map +1 -0
- package/dist/public/assets/docker-BcOcwvcX.js +2 -0
- package/dist/public/assets/docker-BcOcwvcX.js.map +1 -0
- package/dist/public/assets/go-CxLEBnE3.js +2 -0
- package/dist/public/assets/go-CxLEBnE3.js.map +1 -0
- package/dist/public/assets/graphql-ChdNCCLP.js +2 -0
- package/dist/public/assets/graphql-ChdNCCLP.js.map +1 -0
- package/dist/public/assets/html-CNxCFRDw.js +2 -0
- package/dist/public/assets/html-CNxCFRDw.js.map +1 -0
- package/dist/public/assets/index-BfTRKbmy.css +1 -0
- package/dist/public/assets/index-C28kWE_L.js +240 -0
- package/dist/public/assets/index-C28kWE_L.js.map +1 -0
- package/dist/public/assets/ini-BEwlwnbL.js +2 -0
- package/dist/public/assets/ini-BEwlwnbL.js.map +1 -0
- package/dist/public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/dist/public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/dist/public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/dist/public/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/dist/public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/dist/public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/dist/public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/dist/public/assets/java-CylS5w8V.js +2 -0
- package/dist/public/assets/java-CylS5w8V.js.map +1 -0
- package/dist/public/assets/javascript-wDzz0qaB.js +2 -0
- package/dist/public/assets/javascript-wDzz0qaB.js.map +1 -0
- package/dist/public/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
- package/dist/public/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
- package/dist/public/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/dist/public/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/dist/public/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
- package/dist/public/assets/json-Cp-IABpG.js +2 -0
- package/dist/public/assets/json-Cp-IABpG.js.map +1 -0
- package/dist/public/assets/jsx-g9-lgVsj.js +2 -0
- package/dist/public/assets/jsx-g9-lgVsj.js.map +1 -0
- package/dist/public/assets/kotlin-BdnUsdx6.js +2 -0
- package/dist/public/assets/kotlin-BdnUsdx6.js.map +1 -0
- package/dist/public/assets/lua-BaeVxFsk.js +2 -0
- package/dist/public/assets/lua-BaeVxFsk.js.map +1 -0
- package/dist/public/assets/make-CHLpvVh8.js +2 -0
- package/dist/public/assets/make-CHLpvVh8.js.map +1 -0
- package/dist/public/assets/markdown-Cvjx9yec.js +2 -0
- package/dist/public/assets/markdown-Cvjx9yec.js.map +1 -0
- package/dist/public/assets/perl-CptaX86O.js +2 -0
- package/dist/public/assets/perl-CptaX86O.js.map +1 -0
- package/dist/public/assets/postcss-DnzrXTVv.js +2 -0
- package/dist/public/assets/postcss-DnzrXTVv.js.map +1 -0
- package/dist/public/assets/protobuf-C7zT0LnQ.js +2 -0
- package/dist/public/assets/protobuf-C7zT0LnQ.js.map +1 -0
- package/dist/public/assets/python-B6aJPvgy.js +2 -0
- package/dist/public/assets/python-B6aJPvgy.js.map +1 -0
- package/dist/public/assets/r-Dspwwk_N.js +2 -0
- package/dist/public/assets/r-Dspwwk_N.js.map +1 -0
- package/dist/public/assets/ruby-CcrC3V9I.js +2 -0
- package/dist/public/assets/ruby-CcrC3V9I.js.map +1 -0
- package/dist/public/assets/rust-B1yitclQ.js +2 -0
- package/dist/public/assets/rust-B1yitclQ.js.map +1 -0
- package/dist/public/assets/scala-C151Ov-r.js +2 -0
- package/dist/public/assets/scala-C151Ov-r.js.map +1 -0
- package/dist/public/assets/sql-BLtJtn59.js +2 -0
- package/dist/public/assets/sql-BLtJtn59.js.map +1 -0
- package/dist/public/assets/svelte-U4fHntn6.js +2 -0
- package/dist/public/assets/svelte-U4fHntn6.js.map +1 -0
- package/dist/public/assets/swift-D82vCrfD.js +2 -0
- package/dist/public/assets/swift-D82vCrfD.js.map +1 -0
- package/dist/public/assets/toml-vGWfd6FD.js +2 -0
- package/dist/public/assets/toml-vGWfd6FD.js.map +1 -0
- package/dist/public/assets/tsx-COt5Ahok.js +2 -0
- package/dist/public/assets/tsx-COt5Ahok.js.map +1 -0
- package/dist/public/assets/typescript-BPQ3VLAy.js +2 -0
- package/dist/public/assets/typescript-BPQ3VLAy.js.map +1 -0
- package/dist/public/assets/xml-sdJ4AIDG.js +2 -0
- package/dist/public/assets/xml-sdJ4AIDG.js.map +1 -0
- package/dist/public/assets/yaml-Buea-lGh.js +2 -0
- package/dist/public/assets/yaml-Buea-lGh.js.map +1 -0
- package/dist/public/index.html +2 -2
- package/dist/src-BPh-7A8j.mjs +7262 -0
- package/dist/{src-CtMkYz0K.mjs → src-pqi1HIGh.mjs} +1 -1
- package/dist/{text-input-dialog-Dvux6kIR.mjs → text-input-dialog-BIhpfWk_.mjs} +510 -40
- package/dist/{text-input-dialog-WSd537y1.mjs → text-input-dialog-CAaXBGxG.mjs} +1 -1
- package/package.json +15 -5
- package/dist/base64-js-DzVmk6Nb.mjs +0 -95
- package/dist/public/assets/index-CGwN8W_j.js +0 -93
- package/dist/public/assets/index-CGwN8W_j.js.map +0 -1
- package/dist/public/assets/index-DMyG0a38.css +0 -1
- package/dist/public/assets/wasm-CG6Dc4jp.js +0 -2
- package/dist/public/assets/wasm-CG6Dc4jp.js.map +0 -1
- package/dist/src-DE9LHL58.mjs +0 -2249
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
var df=Object.defineProperty;var ff=(e,t,n)=>t in e?df(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var M=(e,t,n)=>ff(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();/**
|
|
2
|
-
* @vue/shared v3.5.40
|
|
3
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
-
* @license MIT
|
|
5
|
-
**/function wi(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Fe={},Xn=[],zt=()=>{},Da=()=>!1,Ko=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Zo=e=>e.startsWith("onUpdate:"),Xe=Object.assign,_i=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},hf=Object.prototype.hasOwnProperty,Pe=(e,t)=>hf.call(e,t),pe=Array.isArray,Qn=e=>Hs(e)==="[object Map]",Jo=e=>Hs(e)==="[object Set]",gl=e=>Hs(e)==="[object Date]",ye=e=>typeof e=="function",We=e=>typeof e=="string",qt=e=>typeof e=="symbol",Be=e=>e!==null&&typeof e=="object",Ba=e=>(Be(e)||ye(e))&&ye(e.then)&&ye(e.catch),ja=Object.prototype.toString,Hs=e=>ja.call(e),pf=e=>Hs(e).slice(8,-1),Ua=e=>Hs(e)==="[object Object]",Si=e=>We(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,xs=wi(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Yo=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},gf=/-\w/g,_t=Yo(e=>e.replace(gf,t=>t.slice(1).toUpperCase())),mf=/\B([A-Z])/g,Rn=Yo(e=>e.replace(mf,"-$1").toLowerCase()),Xo=Yo(e=>e.charAt(0).toUpperCase()+e.slice(1)),_r=Yo(e=>e?`on${Xo(e)}`:""),rn=(e,t)=>!Object.is(e,t),po=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Fa=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Qo=e=>{const t=parseFloat(e);return isNaN(t)?e:t},vf=e=>{const t=We(e)?Number(e):NaN;return isNaN(t)?e:t};let ml;const er=()=>ml||(ml=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ln(e){if(pe(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=We(s)?wf(s):ln(s);if(o)for(const r in o)t[r]=o[r]}return t}else if(We(e)||Be(e))return e}const yf=/;(?![^(]*\))/g,bf=/:([^]+)/,kf=/\/\*[^]*?\*\//g;function wf(e){const t={};return e.replace(kf,"").split(yf).forEach(n=>{if(n){const s=n.split(bf);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function fe(e){let t="";if(We(e))t=e;else if(pe(e))for(let n=0;n<e.length;n++){const s=fe(e[n]);s&&(t+=s+" ")}else if(Be(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const _f="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Sf=wi(_f);function Ga(e){return!!e||e===""}function xf(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=qs(e[s],t[s]);return n}function qs(e,t){if(e===t)return!0;let n=gl(e),s=gl(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=qt(e),s=qt(t),n||s)return e===t;if(n=pe(e),s=pe(t),n||s)return n&&s?xf(e,t):!1;if(n=Be(e),s=Be(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,r=Object.keys(t).length;if(o!==r)return!1;for(const i in e){const l=e.hasOwnProperty(i),a=t.hasOwnProperty(i);if(l&&!a||!l&&a||!qs(e[i],t[i]))return!1}}return String(e)===String(t)}function Cf(e,t){return e.findIndex(n=>qs(n,t))}const za=e=>!!(e&&e.__v_isRef===!0),I=e=>We(e)?e:e==null?"":pe(e)||Be(e)&&(e.toString===ja||!ye(e.toString))?za(e)?I(e.value):JSON.stringify(e,Ha,2):String(e),Ha=(e,t)=>za(t)?Ha(e,t.value):Qn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],r)=>(n[Sr(s,r)+" =>"]=o,n),{})}:Jo(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Sr(n))}:qt(t)?Sr(t):Be(t)&&!pe(t)&&!Ua(t)?String(t):t,Sr=(e,t="")=>{var n;return qt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function $f(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/**
|
|
6
|
-
* @vue/reactivity v3.5.40
|
|
7
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8
|
-
* @license MIT
|
|
9
|
-
**/let it;class Tf{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&it&&(it.active?(this.parent=it,this.index=(it.scopes||(it.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const s=this.scopes.slice();for(t=0,n=s.length;t<n;t++)s[t].pause()}for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes){const o=this.scopes.slice();for(t=0,n=o.length;t<n;t++)o[t].resume()}const s=this.effects.slice();for(t=0,n=s.length;t<n;t++)s[t].resume()}}run(t){if(this._active){const n=it;try{return it=this,t()}finally{it=n}}}on(){++this._on===1&&(this.prevScope=it,it=this)}off(){if(this._on>0&&--this._on===0){if(it===this)it=this.prevScope;else{let t=it;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const o=this.scopes.slice();for(n=0,s=o.length;n<s;n++)o[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function Af(){return it}let ze;const xr=new WeakSet;class qa{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,it&&(it.active?it.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,xr.has(this)&&(xr.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Va(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,vl(this),Ka(this);const t=ze,n=Ht;ze=this,Ht=!0;try{return this.fn()}finally{Za(this),ze=t,Ht=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)$i(t);this.deps=this.depsTail=void 0,vl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?xr.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){qr(this)&&this.run()}get dirty(){return qr(this)}}let Wa=0,Cs,$s;function Va(e,t=!1){if(e.flags|=8,t){e.next=$s,$s=e;return}e.next=Cs,Cs=e}function xi(){Wa++}function Ci(){if(--Wa>0)return;if($s){let t=$s;for($s=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Cs;){let t=Cs;for(Cs=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function Ka(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Za(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),$i(s),Rf(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function qr(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ja(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ja(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Is)||(e.globalVersion=Is,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!qr(e))))return;e.flags|=2;const t=e.dep,n=ze,s=Ht;ze=e,Ht=!0;try{Ka(e);const o=e.fn(e._value);(t.version===0||rn(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{ze=n,Ht=s,Za(e),e.flags&=-3}}function $i(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let r=n.computed.deps;r;r=r.nextDep)$i(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Rf(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Ht=!0;const Ya=[];function bn(){Ya.push(Ht),Ht=!1}function kn(){const e=Ya.pop();Ht=e===void 0?!0:e}function vl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ze;ze=void 0;try{t()}finally{ze=n}}}let Is=0;class Ef{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ti{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ze||!Ht||ze===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ze)n=this.activeLink=new Ef(ze,this),ze.deps?(n.prevDep=ze.depsTail,ze.depsTail.nextDep=n,ze.depsTail=n):ze.deps=ze.depsTail=n,Xa(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=ze.depsTail,n.nextDep=void 0,ze.depsTail.nextDep=n,ze.depsTail=n,ze.deps===n&&(ze.deps=s)}return n}trigger(t){this.version++,Is++,this.notify(t)}notify(t){xi();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ci()}}}function Xa(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Xa(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Wr=new WeakMap,Bn=Symbol(""),Vr=Symbol(""),Ls=Symbol("");function dt(e,t,n){if(Ht&&ze){let s=Wr.get(e);s||Wr.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Ti),o.map=s,o.key=n),o.track()}}function dn(e,t,n,s,o,r){const i=Wr.get(e);if(!i){Is++;return}const l=a=>{a&&a.trigger()};if(xi(),t==="clear")i.forEach(l);else{const a=pe(e),c=a&&Si(n);if(a&&n==="length"){const u=Number(s);i.forEach((f,h)=>{(h==="length"||h===Ls||!qt(h)&&h>=u)&&l(f)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),c&&l(i.get(Ls)),t){case"add":a?c&&l(i.get("length")):(l(i.get(Bn)),Qn(e)&&l(i.get(Vr)));break;case"delete":a||(l(i.get(Bn)),Qn(e)&&l(i.get(Vr)));break;case"set":Qn(e)&&l(i.get(Bn));break}}Ci()}function Kn(e){const t=Ie(e);return t===e?t:(dt(t,"iterate",Ls),Bt(e)?t:t.map(Wt))}function tr(e){return dt(e=Ie(e),"iterate",Ls),e}function sn(e,t){return wn(e)?rs(jn(e)?Wt(t):t):Wt(t)}const If={__proto__:null,[Symbol.iterator](){return Cr(this,Symbol.iterator,e=>sn(this,e))},concat(...e){return Kn(this).concat(...e.map(t=>pe(t)?Kn(t):t))},entries(){return Cr(this,"entries",e=>(e[1]=sn(this,e[1]),e))},every(e,t){return an(this,"every",e,t,void 0,arguments)},filter(e,t){return an(this,"filter",e,t,n=>n.map(s=>sn(this,s)),arguments)},find(e,t){return an(this,"find",e,t,n=>sn(this,n),arguments)},findIndex(e,t){return an(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return an(this,"findLast",e,t,n=>sn(this,n),arguments)},findLastIndex(e,t){return an(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return an(this,"forEach",e,t,void 0,arguments)},includes(...e){return $r(this,"includes",e)},indexOf(...e){return $r(this,"indexOf",e)},join(e){return Kn(this).join(e)},lastIndexOf(...e){return $r(this,"lastIndexOf",e)},map(e,t){return an(this,"map",e,t,void 0,arguments)},pop(){return ds(this,"pop")},push(...e){return ds(this,"push",e)},reduce(e,...t){return yl(this,"reduce",e,t)},reduceRight(e,...t){return yl(this,"reduceRight",e,t)},shift(){return ds(this,"shift")},some(e,t){return an(this,"some",e,t,void 0,arguments)},splice(...e){return ds(this,"splice",e)},toReversed(){return Kn(this).toReversed()},toSorted(e){return Kn(this).toSorted(e)},toSpliced(...e){return Kn(this).toSpliced(...e)},unshift(...e){return ds(this,"unshift",e)},values(){return Cr(this,"values",e=>sn(this,e))}};function Cr(e,t,n){const s=tr(e),o=s[t]();return s!==e&&!Bt(e)&&(o._next=o.next,o.next=()=>{const r=o._next();return r.done||(r.value=n(r.value)),r}),o}const Lf=Array.prototype;function an(e,t,n,s,o,r){const i=tr(e),l=i!==e&&!Bt(e),a=i[t];if(a!==Lf[t]){const f=a.apply(e,r);return l?Wt(f):f}let c=n;i!==e&&(l?c=function(f,h){return n.call(this,sn(e,f),h,e)}:n.length>2&&(c=function(f,h){return n.call(this,f,h,e)}));const u=a.call(i,c,s);return l&&o?o(u):u}function yl(e,t,n,s){const o=tr(e),r=o!==e&&!Bt(e);let i=n,l=!1;o!==e&&(r?(l=s.length===0,i=function(c,u,f){return l&&(l=!1,c=sn(e,c)),n.call(this,c,sn(e,u),f,e)}):n.length>3&&(i=function(c,u,f){return n.call(this,c,u,f,e)}));const a=o[t](i,...s);return l?sn(e,a):a}function $r(e,t,n){const s=Ie(e);dt(s,"iterate",Ls);const o=s[t](...n);return(o===-1||o===!1)&&Ii(n[0])?(n[0]=Ie(n[0]),s[t](...n)):o}function ds(e,t,n=[]){bn(),xi();const s=Ie(e)[t].apply(e,n);return Ci(),kn(),s}const Mf=wi("__proto__,__v_isRef,__isVue"),Qa=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(qt));function Pf(e){qt(e)||(e=String(e));const t=Ie(this);return dt(t,"has",e),t.hasOwnProperty(e)}class ec{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,r=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return r;if(n==="__v_raw")return s===(o?r?Hf:oc:r?sc:nc).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const i=pe(t);if(!o){let a;if(i&&(a=If[n]))return a;if(n==="hasOwnProperty")return Pf}const l=Reflect.get(t,n,gt(t)?t:s);if((qt(n)?Qa.has(n):Mf(n))||(o||dt(t,"get",n),r))return l;if(gt(l)){const a=i&&Si(n)?l:l.value;return o&&Be(a)?Zr(a):a}return Be(l)?o?Zr(l):Ri(l):l}}class tc extends ec{constructor(t=!1){super(!1,t)}set(t,n,s,o){let r=t[n];const i=pe(t)&&Si(n);if(!this._isShallow){const c=wn(r);if(!Bt(s)&&!wn(s)&&(r=Ie(r),s=Ie(s)),!i&>(r)&&!gt(s))return c||(r.value=s),!0}const l=i?Number(n)<t.length:Pe(t,n),a=Reflect.set(t,n,s,gt(t)?t:o);return t===Ie(o)&&a&&(l?rn(s,r)&&dn(t,"set",n,s):dn(t,"add",n,s)),a}deleteProperty(t,n){const s=Pe(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&dn(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!qt(n)||!Qa.has(n))&&dt(t,"has",n),s}ownKeys(t){return dt(t,"iterate",pe(t)?"length":Bn),Reflect.ownKeys(t)}}class Nf extends ec{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Of=new tc,Df=new Nf,Bf=new tc(!0);const Kr=e=>e,to=e=>Reflect.getPrototypeOf(e);function jf(e,t,n){return function(...s){const o=this.__v_raw,r=Ie(o),i=Qn(r),l=e==="entries"||e===Symbol.iterator&&i,a=e==="keys"&&i,c=o[e](...s),u=n?Kr:t?rs:Wt;return!t&&dt(r,"iterate",a?Vr:Bn),Xe(Object.create(c),{next(){const{value:f,done:h}=c.next();return h?{value:f,done:h}:{value:l?[u(f[0]),u(f[1])]:u(f),done:h}}})}}function no(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Uf(e,t){const n={get(o){const r=this.__v_raw,i=Ie(r),l=Ie(o);e||(rn(o,l)&&dt(i,"get",o),dt(i,"get",l));const{has:a}=to(i),c=t?Kr:e?rs:Wt;if(a.call(i,o))return c(r.get(o));if(a.call(i,l))return c(r.get(l));r!==i&&r.get(o)},get size(){const o=this.__v_raw;return!e&&dt(Ie(o),"iterate",Bn),o.size},has(o){const r=this.__v_raw,i=Ie(r),l=Ie(o);return e||(rn(o,l)&&dt(i,"has",o),dt(i,"has",l)),o===l?r.has(o):r.has(o)||r.has(l)},forEach(o,r){const i=this,l=i.__v_raw,a=Ie(l),c=t?Kr:e?rs:Wt;return!e&&dt(a,"iterate",Bn),l.forEach((u,f)=>o.call(r,c(u),c(f),i))}};return Xe(n,e?{add:no("add"),set:no("set"),delete:no("delete"),clear:no("clear")}:{add(o){const r=Ie(this),i=to(r),l=Ie(o),a=!t&&!Bt(o)&&!wn(o)?l:o;return i.has.call(r,a)||rn(o,a)&&i.has.call(r,o)||rn(l,a)&&i.has.call(r,l)||(r.add(a),dn(r,"add",a,a)),this},set(o,r){!t&&!Bt(r)&&!wn(r)&&(r=Ie(r));const i=Ie(this),{has:l,get:a}=to(i);let c=l.call(i,o);c||(o=Ie(o),c=l.call(i,o));const u=a.call(i,o);return i.set(o,r),c?rn(r,u)&&dn(i,"set",o,r):dn(i,"add",o,r),this},delete(o){const r=Ie(this),{has:i,get:l}=to(r);let a=i.call(r,o);a||(o=Ie(o),a=i.call(r,o)),l&&l.call(r,o);const c=r.delete(o);return a&&dn(r,"delete",o,void 0),c},clear(){const o=Ie(this),r=o.size!==0,i=o.clear();return r&&dn(o,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=jf(o,e,t)}),n}function Ai(e,t){const n=Uf(e,t);return(s,o,r)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(Pe(n,o)&&o in s?n:s,o,r)}const Ff={get:Ai(!1,!1)},Gf={get:Ai(!1,!0)},zf={get:Ai(!0,!1)};const nc=new WeakMap,sc=new WeakMap,oc=new WeakMap,Hf=new WeakMap;function qf(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ri(e){return wn(e)?e:Ei(e,!1,Of,Ff,nc)}function Wf(e){return Ei(e,!1,Bf,Gf,sc)}function Zr(e){return Ei(e,!0,Df,zf,oc)}function Ei(e,t,n,s,o){if(!Be(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const r=o.get(e);if(r)return r;const i=qf(pf(e));if(i===0)return e;const l=new Proxy(e,i===2?s:n);return o.set(e,l),l}function jn(e){return wn(e)?jn(e.__v_raw):!!(e&&e.__v_isReactive)}function wn(e){return!!(e&&e.__v_isReadonly)}function Bt(e){return!!(e&&e.__v_isShallow)}function Ii(e){return e?!!e.__v_raw:!1}function Ie(e){const t=e&&e.__v_raw;return t?Ie(t):e}function Vf(e){return!Pe(e,"__v_skip")&&Object.isExtensible(e)&&Fa(e,"__v_skip",!0),e}const Wt=e=>Be(e)?Ri(e):e,rs=e=>Be(e)?Zr(e):e;function gt(e){return e?e.__v_isRef===!0:!1}function N(e){return Kf(e,!1)}function Kf(e,t){return gt(e)?e:new Zf(e,t)}class Zf{constructor(t,n){this.dep=new Ti,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Ie(t),this._value=n?t:Wt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Bt(t)||wn(t);t=s?t:Ie(t),rn(t,n)&&(this._rawValue=t,this._value=s?t:Wt(t),this.dep.trigger())}}function re(e){return gt(e)?e.value:e}const Jf={get:(e,t,n)=>t==="__v_raw"?e:re(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return gt(o)&&!gt(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function rc(e){return jn(e)?e:new Proxy(e,Jf)}class Yf{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Ti(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Is-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&ze!==this)return Va(this,!0),!0}get value(){const t=this.dep.track();return Ja(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Xf(e,t,n=!1){let s,o;return ye(e)?s=e:(s=e.get,o=e.set),new Yf(s,o,n)}const so={},_o=new WeakMap;let Mn;function Qf(e,t=!1,n=Mn){if(n){let s=_o.get(n);s||_o.set(n,s=[]),s.push(e)}}function eh(e,t,n=Fe){const{immediate:s,deep:o,once:r,scheduler:i,augmentJob:l,call:a}=n,c=A=>o?A:Bt(A)||o===!1||o===0?fn(A,1):fn(A);let u,f,h,p,g=!1,_=!1;if(gt(e)?(f=()=>e.value,g=Bt(e)):jn(e)?(f=()=>c(e),g=!0):pe(e)?(_=!0,g=e.some(A=>jn(A)||Bt(A)),f=()=>e.map(A=>{if(gt(A))return A.value;if(jn(A))return c(A);if(ye(A))return a?a(A,2):A()})):ye(e)?t?f=a?()=>a(e,2):e:f=()=>{if(h){bn();try{h()}finally{kn()}}const A=Mn;Mn=u;try{return a?a(e,3,[p]):e(p)}finally{Mn=A}}:f=zt,t&&o){const A=f,G=o===!0?1/0:o;f=()=>fn(A(),G)}const k=Af(),w=()=>{u.stop(),k&&k.active&&_i(k.effects,u)};if(r&&t){const A=t;t=(...G)=>{const Q=A(...G);return w(),Q}}let x=_?new Array(e.length).fill(so):so;const $=A=>{if(!(!(u.flags&1)||!u.dirty&&!A))if(t){const G=u.run();if(A||o||g||(_?G.some((Q,C)=>rn(Q,x[C])):rn(G,x))){h&&h();const Q=Mn;Mn=u;try{const C=[G,x===so?void 0:_&&x[0]===so?[]:x,p];x=G,a?a(t,3,C):t(...C)}finally{Mn=Q}}}else u.run()};return l&&l($),u=new qa(f),u.scheduler=i?()=>i($,!1):$,p=A=>Qf(A,!1,u),h=u.onStop=()=>{const A=_o.get(u);if(A){if(a)a(A,4);else for(const G of A)G();_o.delete(u)}},t?s?$(!0):x=u.run():i?i($.bind(null,!0),!0):u.run(),w.pause=u.pause.bind(u),w.resume=u.resume.bind(u),w.stop=w,w}function fn(e,t=1/0,n){if(t<=0||!Be(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,gt(e))fn(e.value,t,n);else if(pe(e))for(let s=0;s<e.length;s++)fn(e[s],t,n);else if(Jo(e)||Qn(e))e.forEach(s=>{fn(s,t,n)});else if(Ua(e)){for(const s in e)fn(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&fn(e[s],t,n)}return e}/**
|
|
10
|
-
* @vue/runtime-core v3.5.40
|
|
11
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
|
-
* @license MIT
|
|
13
|
-
**/function Ws(e,t,n,s){try{return s?e(...s):e()}catch(o){nr(o,t,n)}}function jt(e,t,n,s){if(ye(e)){const o=Ws(e,t,n,s);return o&&Ba(o)&&o.catch(r=>{nr(r,t,n)}),o}if(pe(e)){const o=[];for(let r=0;r<e.length;r++)o.push(jt(e[r],t,n,s));return o}}function nr(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||Fe;if(t){let l=t.parent;const a=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const u=l.ec;if(u){for(let f=0;f<u.length;f++)if(u[f](e,a,c)===!1)return}l=l.parent}if(r){bn(),Ws(r,null,10,[e,a,c]),kn();return}}th(e,n,o,s,i)}function th(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const kt=[];let nn=-1;const es=[];let $n=null,Zn=0;const ic=Promise.resolve();let So=null;function Ot(e){const t=So||ic;return e?t.then(this?e.bind(this):e):t}function nh(e){let t=nn+1,n=kt.length;for(;t<n;){const s=t+n>>>1,o=kt[s],r=Ms(o);r<e||r===e&&o.flags&2?t=s+1:n=s}return t}function Li(e){if(!(e.flags&1)){const t=Ms(e),n=kt[kt.length-1];!n||!(e.flags&2)&&t>=Ms(n)?kt.push(e):kt.splice(nh(t),0,e),e.flags|=1,lc()}}function lc(){So||(So=ic.then(uc))}function ac(e){pe(e)?es.push(...e):$n&&e.id===-1?$n.splice(Zn+1,0,e):e.flags&1||(es.push(e),e.flags|=1),lc()}function bl(e,t,n=nn+1){for(;n<kt.length;n++){const s=kt[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;kt.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function cc(e){if(es.length){const t=[...new Set(es)].sort((n,s)=>Ms(n)-Ms(s));if(es.length=0,$n){$n.push(...t);return}for($n=t,Zn=0;Zn<$n.length;Zn++){const n=$n[Zn];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}$n=null,Zn=0}}const Ms=e=>e.id==null?e.flags&2?-1:1/0:e.id;function uc(e){try{for(nn=0;nn<kt.length;nn++){const t=kt[nn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Ws(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;nn<kt.length;nn++){const t=kt[nn];t&&(t.flags&=-2)}nn=-1,kt.length=0,cc(),So=null,(kt.length||es.length)&&uc()}}let lt=null,dc=null;function xo(e){const t=lt;return lt=e,dc=e&&e.type.__scopeId||null,t}function $t(e,t=lt,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&To(-1);const r=xo(t),i=yn.length;let l;try{l=e(...o)}finally{for(let a=yn.length;a>i;a--)Bi();xo(r),s._d&&To(1)}return l};return s._n=!0,s._c=!0,s._d=!0,s}function Ye(e,t){if(lt===null)return e;const n=cr(lt),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[r,i,l,a=Fe]=t[o];r&&(ye(r)&&(r={mounted:r,updated:r}),r.deep&&fn(i),s.push({dir:r,instance:n,value:i,oldValue:void 0,arg:l,modifiers:a}))}return e}function En(e,t,n,s){const o=e.dirs,r=t&&t.dirs;for(let i=0;i<o.length;i++){const l=o[i];r&&(l.oldValue=r[i].value);let a=l.dir[s];a&&(bn(),jt(a,n,8,[e.el,l,e,t]),kn())}}function go(e,t){if(ht){let n=ht.provides;const s=ht.parent&&ht.parent.provides;s===n&&(n=ht.provides=Object.create(s)),n[e]=t}}function vn(e,t,n=!1){const s=ar();if(s||ns){let o=ns?ns._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&ye(t)?t.call(s&&s.proxy):t}}const sh=Symbol.for("v-scx"),oh=()=>vn(sh);function Oe(e,t,n){return fc(e,t,n)}function fc(e,t,n=Fe){const{immediate:s,deep:o,flush:r,once:i}=n,l=Xe({},n),a=t&&s||!t&&r!=="post";let c;if(Ds){if(r==="sync"){const p=oh();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!a){const p=()=>{};return p.stop=zt,p.resume=zt,p.pause=zt,p}}const u=ht;l.call=(p,g,_)=>jt(p,u,g,_);let f=!1;r==="post"?l.scheduler=p=>{bt(p,u&&u.suspense)}:r!=="sync"&&(f=!0,l.scheduler=(p,g)=>{g?p():Li(p)}),l.augmentJob=p=>{t&&(p.flags|=4),f&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const h=eh(e,t,l);return Ds&&(c?c.push(h):a&&h()),h}function rh(e,t,n){const s=this.proxy,o=We(e)?e.includes(".")?hc(s,e):()=>s[e]:e.bind(s,s);let r;ye(t)?r=t:(r=t.handler,n=t);const i=Vs(this),l=fc(o,r.bind(s),n);return i(),l}function hc(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const xn=new WeakMap,pc=Symbol("_vte"),gc=e=>e.__isTeleport,Pn=e=>e&&(e.disabled||e.disabled===""),ih=e=>e&&(e.defer||e.defer===""),kl=e=>typeof SVGElement<"u"&&e instanceof SVGElement,wl=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Jr=(e,t)=>{const n=e&&e.to;return We(n)?t?t(n):null:n},lh={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,r,i,l,a,c){const{mc:u,pc:f,pbc:h,o:{insert:p,querySelector:g,createText:_,createComment:k,parentNode:w}}=c,x=Pn(t.props);let{dynamicChildren:$}=t;const A=(C,R,L)=>{C.shapeFlag&16&&u(C.children,R,L,o,r,i,l,a)},G=(C=t)=>{const R=Pn(C.props),L=C.target=Jr(C.props,g),J=Yr(L,C,_,p);L&&(i!=="svg"&&kl(L)?i="svg":i!=="mathml"&&wl(L)&&(i="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(L),R||(A(C,L,J),ks(C,!1)))},Q=C=>{const R=()=>{if(xn.get(C)===R){if(xn.delete(C),Pn(C.props)){const L=w(C.el)||n;A(C,L,C.anchor),ks(C,!0)}G(C)}};xn.set(C,R),bt(R,r)};if(e==null){const C=t.el=_(""),R=t.anchor=_("");if(p(C,n,s),p(R,n,s),ih(t.props)||r&&r.pendingBranch){Q(t);return}x&&(A(t,n,R),ks(t,!0)),G()}else{t.el=e.el;const C=t.anchor=e.anchor,R=xn.get(e);if(R){R.flags|=8,xn.delete(e),Q(t);return}t.targetStart=e.targetStart;const L=t.target=e.target,J=t.targetAnchor=e.targetAnchor,ie=Pn(e.props),z=ie?n:L,ve=ie?C:J;if(i==="svg"||kl(L)?i="svg":(i==="mathml"||wl(L))&&(i="mathml"),$?(h(e.dynamicChildren,$,z,o,r,i,l),Di(e,t,!0)):a||f(e,t,z,ve,o,r,i,l,!1),x)ie?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):oo(t,n,C,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const O=Jr(t.props,g);O&&(t.target=O,oo(t,O,null,c,0))}else ie&&oo(t,L,J,c,1);ks(t,x)}},remove(e,t,n,{um:s,o:{remove:o}},r){const{shapeFlag:i,children:l,anchor:a,targetStart:c,targetAnchor:u,target:f,props:h}=e,p=Pn(h),g=r||!p,_=xn.get(e);if(_&&(_.flags|=8,xn.delete(e)),f&&(o(c),o(u)),r&&o(a),!_&&(p||f)&&i&16)for(let k=0;k<l.length;k++){const w=l[k];s(w,t,n,g,!!w.dynamicChildren)}},move:oo,hydrate:ah};function oo(e,t,n,{o:{insert:s},m:o},r=2){r===0&&s(e.targetAnchor,t,n);const{el:i,anchor:l,shapeFlag:a,children:c,props:u}=e,f=r===2;if(f&&s(i,t,n),!xn.has(e)&&(!f||Pn(u))&&a&16)for(let h=0;h<c.length;h++)o(c[h],t,n,2);f&&s(l,t,n)}function ah(e,t,n,s,o,r,{o:{nextSibling:i,parentNode:l,querySelector:a,insert:c,createText:u}},f){function h(k,w){let x=w;for(;x;){if(x&&x.nodeType===8){if(x.data==="teleport start anchor")t.targetStart=x;else if(x.data==="teleport anchor"){t.targetAnchor=x,k._lpa=t.targetAnchor&&i(t.targetAnchor);break}}x=i(x)}}function p(k,w){w.anchor=f(i(k),w,l(k),n,s,o,r)}const g=t.target=Jr(t.props,a),_=Pn(t.props);if(g){const k=g._lpa||g.firstChild;t.shapeFlag&16&&(_?(p(e,t),h(g,k),t.targetAnchor||Yr(g,t,u,c,l(e)===g?e:null)):(t.anchor=i(e),h(g,k),t.targetAnchor||Yr(g,t,u,c),f(k&&i(k),t,g,n,s,o,r))),ks(t,_)}else _&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Mi=lh;function ks(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function Yr(e,t,n,s,o=null){const r=t.targetStart=n(""),i=t.targetAnchor=n("");return r[pc]=i,e&&(s(r,e,o),s(i,e,o)),i}const Nt=Symbol("_leaveCb"),fs=Symbol("_enterCb");function mc(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ut(()=>{e.isMounted=!0}),Vt(()=>{e.isUnmounting=!0}),e}const Mt=[Function,Array],vc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Mt,onEnter:Mt,onAfterEnter:Mt,onEnterCancelled:Mt,onBeforeLeave:Mt,onLeave:Mt,onAfterLeave:Mt,onLeaveCancelled:Mt,onBeforeAppear:Mt,onAppear:Mt,onAfterAppear:Mt,onAppearCancelled:Mt},yc=e=>{const t=e.subTree;return t.component?yc(t.component):t},ch={name:"BaseTransition",props:vc,setup(e,{slots:t}){const n=ar(),s=mc();return()=>{const o=t.default&&Pi(t.default(),!0),r=o&&o.length?bc(o):n.subTree?D():void 0;if(!r)return;const i=Ie(e),{mode:l}=i;if(s.isLeaving)return Tr(r);const a=_l(r);if(!a)return Tr(r);let c=Ps(a,i,s,n,f=>c=f);a.type!==ft&&Fn(a,c);let u=n.subTree&&_l(n.subTree);if(u&&u.type!==ft&&!Nn(u,a)&&yc(n).type!==ft){let f=Ps(u,i,s,n);if(Fn(u,f),l==="out-in"&&a.type!==ft)return s.isLeaving=!0,f.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,u=void 0},Tr(r);l==="in-out"&&a.type!==ft?f.delayLeave=(h,p,g)=>{const _=kc(s,u);_[String(u.key)]=u,h[Nt]=()=>{p(),h[Nt]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{g(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return r}}};function bc(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==ft){t=n;break}}return t}const uh=ch;function kc(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Ps(e,t,n,s,o){const{appear:r,mode:i,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:h,onLeave:p,onAfterLeave:g,onLeaveCancelled:_,onBeforeAppear:k,onAppear:w,onAfterAppear:x,onAppearCancelled:$}=t,A=String(e.key),G=kc(n,e),Q=(L,J)=>{L&&jt(L,s,9,J)},C=(L,J)=>{const ie=J[1];Q(L,J),pe(L)?L.every(z=>z.length<=1)&&ie():L.length<=1&&ie()},R={mode:i,persisted:l,beforeEnter(L){let J=a;if(!n.isMounted)if(r)J=k||a;else return;L[Nt]&&L[Nt](!0);const ie=G[A];ie&&Nn(e,ie)&&ie.el[Nt]&&ie.el[Nt](),Q(J,[L])},enter(L){if(G[A]===e)return;let J=c,ie=u,z=f;if(!n.isMounted)if(r)J=w||c,ie=x||u,z=$||f;else return;let ve=!1;L[fs]=P=>{ve||(ve=!0,P?Q(z,[L]):Q(ie,[L]),R.delayedLeave&&R.delayedLeave(),L[fs]=void 0)};const O=L[fs].bind(null,!1);J?C(J,[L,O]):O()},leave(L,J){const ie=String(e.key);if(L[fs]&&L[fs](!0),n.isUnmounting)return J();Q(h,[L]);let z=!1;L[Nt]=O=>{z||(z=!0,J(),O?Q(_,[L]):Q(g,[L]),L[Nt]=void 0,G[ie]===e&&delete G[ie])};const ve=L[Nt].bind(null,!1);G[ie]=e,p?C(p,[L,ve]):ve()},clone(L){const J=Ps(L,t,n,s,o);return o&&o(J),J}};return R}function Tr(e){if(sr(e))return e=An(e),e.children=null,e}function _l(e){if(!sr(e))return gc(e.type)&&e.children?bc(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&ye(n.default))return n.default()}}function Fn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Fn(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Pi(e,t=!1,n){let s=[],o=0;for(let r=0;r<e.length;r++){let i=e[r];const l=n==null?i.key:String(n)+String(i.key!=null?i.key:r);i.type===ee?(i.patchFlag&128&&o++,s=s.concat(Pi(i.children,t,l))):(t||i.type!==ft)&&s.push(l!=null?An(i,{key:l}):i)}if(o>1)for(let r=0;r<s.length;r++)s[r].patchFlag=-2;return s}function Se(e,t){return ye(e)?Xe({name:e.name},t,{setup:e}):e}function wc(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Sl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Co=new WeakMap;function Ts(e,t,n,s,o=!1){if(pe(e)){e.forEach((_,k)=>Ts(_,t&&(pe(t)?t[k]:t),n,s,o));return}if(ts(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Ts(e,t,n,s.component.subTree);return}const r=s.shapeFlag&4?cr(s.component):s.el,i=o?null:r,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Fe?l.refs={}:l.refs,f=l.setupState,h=Ie(f),p=f===Fe?Da:_=>Sl(u,_)?!1:Pe(h,_),g=(_,k)=>!(k&&Sl(u,k));if(c!=null&&c!==a){if(xl(t),We(c))u[c]=null,p(c)&&(f[c]=null);else if(gt(c)){const _=t;g(c,_.k)&&(c.value=null),_.k&&(u[_.k]=null)}}if(ye(a))Ws(a,l,12,[i,u]);else{const _=We(a),k=gt(a);if(_||k){const w=()=>{if(e.f){const x=_?p(a)?f[a]:u[a]:g()||!e.k?a.value:u[e.k];if(o)pe(x)&&_i(x,r);else if(pe(x))x.includes(r)||x.push(r);else if(_)u[a]=[r],p(a)&&(f[a]=u[a]);else{const $=[r];g(a,e.k)&&(a.value=$),e.k&&(u[e.k]=$)}}else _?(u[a]=i,p(a)&&(f[a]=i)):k&&(g(a,e.k)&&(a.value=i),e.k&&(u[e.k]=i))};if(i){const x=()=>{w(),Co.delete(e)};x.id=-1,Co.set(e,x),bt(x,n)}else xl(e),w()}}}function xl(e){const t=Co.get(e);t&&(t.flags|=8,Co.delete(e))}er().requestIdleCallback;er().cancelIdleCallback;const ts=e=>!!e.type.__asyncLoader,sr=e=>e.type.__isKeepAlive;function dh(e,t){_c(e,"a",t)}function fh(e,t){_c(e,"da",t)}function _c(e,t,n=ht){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(or(t,s,n),n){let o=n.parent;for(;o&&o.parent;)sr(o.parent.vnode)&&hh(s,t,n,o),o=o.parent}}function hh(e,t,n,s){const o=or(t,e,s,!0);rr(()=>{_i(s[t],o)},n)}function or(e,t,n=ht,s=!1){if(n){const o=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...i)=>{bn();const l=Vs(n),a=jt(t,n,e,i);return l(),kn(),a});return s?o.unshift(r):o.push(r),r}}const _n=e=>(t,n=ht)=>{(!Ds||e==="sp")&&or(e,(...s)=>t(...s),n)},ph=_n("bm"),Ut=_n("m"),Sc=_n("bu"),xc=_n("u"),Vt=_n("bum"),rr=_n("um"),gh=_n("sp"),mh=_n("rtg"),vh=_n("rtc");function yh(e,t=ht){or("ec",e,t)}const Cc="components";function bh(e,t){return Tc(Cc,e,!0,t)||e}const $c=Symbol.for("v-ndc");function kh(e){return We(e)?Tc(Cc,e,!1)||e:e||$c}function Tc(e,t,n=!0,s=!1){const o=lt||ht;if(o){const r=o.type;{const l=sp(r,!1);if(l&&(l===t||l===_t(t)||l===Xo(_t(t))))return r}const i=Cl(o[e]||r[e],t)||Cl(o.appContext[e],t);return!i&&s?r:i}}function Cl(e,t){return e&&(e[t]||e[_t(t)]||e[Xo(_t(t))])}function Ve(e,t,n,s){let o;const r=n,i=pe(e);if(i||We(e)){const l=i&&jn(e);let a=!1,c=!1;l&&(a=!Bt(e),c=wn(e),e=tr(e)),o=new Array(e.length);for(let u=0,f=e.length;u<f;u++)o[u]=t(a?c?rs(Wt(e[u])):Wt(e[u]):e[u],u,void 0,r)}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,r)}else if(Be(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,r));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=t(e[u],u,a,r)}}else o=[];return o}function mo(e,t,n={},s,o,r){if(lt.ce||lt.parent&&ts(lt.parent)&<.parent.ce){const c=n,u=Object.keys(c).length>0;return t!=="default"&&(c.name=t),y(),qe(ee,null,[Z("slot",c,s&&s())],u?-2:64)}let i=e[t];i&&i._c&&(i._d=!1);const l=yn.length;y();let a;try{const c=i&&Ac(i(n)),u=n.key||r||c&&c.key;a=qe(ee,{key:(u&&!qt(u)?u:`_${t}`)+(!c&&s?"_fb":"")},c||(s?s():[]),c&&e._===1?64:-2)}catch(c){for(let u=yn.length;u>l;u--)Bi();throw c}finally{i&&i._c&&(i._d=!0)}return a}function Ac(e){return e.some(t=>Os(t)?!(t.type===ft||t.type===ee&&!Ac(t.children)):!0)?e:null}const Xr=e=>e?Vc(e)?cr(e):Xr(e.parent):null,As=Xe(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Xr(e.parent),$root:e=>Xr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ec(e),$forceUpdate:e=>e.f||(e.f=()=>{Li(e.update)}),$nextTick:e=>e.n||(e.n=Ot.bind(e.proxy)),$watch:e=>rh.bind(e)}),Ar=(e,t)=>e!==Fe&&!e.__isScriptSetup&&Pe(e,t),wh={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:r,accessCache:i,type:l,appContext:a}=e;if(t[0]!=="$"){const h=i[t];if(h!==void 0)switch(h){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return r[t]}else{if(Ar(s,t))return i[t]=1,s[t];if(o!==Fe&&Pe(o,t))return i[t]=2,o[t];if(Pe(r,t))return i[t]=3,r[t];if(n!==Fe&&Pe(n,t))return i[t]=4,n[t];Qr&&(i[t]=0)}}const c=As[t];let u,f;if(c)return t==="$attrs"&&dt(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Fe&&Pe(n,t))return i[t]=4,n[t];if(f=a.config.globalProperties,Pe(f,t))return f[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:r}=e;return Ar(o,t)?(o[t]=n,!0):s!==Fe&&Pe(s,t)?(s[t]=n,!0):Pe(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:r,type:i}},l){let a;return!!(n[l]||e!==Fe&&l[0]!=="$"&&Pe(e,l)||Ar(t,l)||Pe(r,l)||Pe(s,l)||Pe(As,l)||Pe(o.config.globalProperties,l)||(a=i.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Pe(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function $l(e){return pe(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Qr=!0;function _h(e){const t=Ec(e),n=e.proxy,s=e.ctx;Qr=!1,t.beforeCreate&&Tl(t.beforeCreate,e,"bc");const{data:o,computed:r,methods:i,watch:l,provide:a,inject:c,created:u,beforeMount:f,mounted:h,beforeUpdate:p,updated:g,activated:_,deactivated:k,beforeDestroy:w,beforeUnmount:x,destroyed:$,unmounted:A,render:G,renderTracked:Q,renderTriggered:C,errorCaptured:R,serverPrefetch:L,expose:J,inheritAttrs:ie,components:z,directives:ve,filters:O}=t;if(c&&Sh(c,s,null),i)for(const q in i){const ge=i[q];ye(ge)&&(s[q]=ge.bind(n))}if(o){const q=o.call(n,n);Be(q)&&(e.data=Ri(q))}if(Qr=!0,r)for(const q in r){const ge=r[q],Ae=ye(ge)?ge.bind(n,n):ye(ge.get)?ge.get.bind(n,n):zt,ke=!ye(ge)&&ye(ge.set)?ge.set.bind(n):zt,ae=X({get:Ae,set:ke});Object.defineProperty(s,q,{enumerable:!0,configurable:!0,get:()=>ae.value,set:Ce=>ae.value=Ce})}if(l)for(const q in l)Rc(l[q],s,n,q);if(a){const q=ye(a)?a.call(n):a;Reflect.ownKeys(q).forEach(ge=>{go(ge,q[ge])})}u&&Tl(u,e,"c");function te(q,ge){pe(ge)?ge.forEach(Ae=>q(Ae.bind(n))):ge&&q(ge.bind(n))}if(te(ph,f),te(Ut,h),te(Sc,p),te(xc,g),te(dh,_),te(fh,k),te(yh,R),te(vh,Q),te(mh,C),te(Vt,x),te(rr,A),te(gh,L),pe(J))if(J.length){const q=e.exposed||(e.exposed={});J.forEach(ge=>{Object.defineProperty(q,ge,{get:()=>n[ge],set:Ae=>n[ge]=Ae,enumerable:!0})})}else e.exposed||(e.exposed={});G&&e.render===zt&&(e.render=G),ie!=null&&(e.inheritAttrs=ie),z&&(e.components=z),ve&&(e.directives=ve),L&&wc(e)}function Sh(e,t,n=zt){pe(e)&&(e=ei(e));for(const s in e){const o=e[s];let r;Be(o)?"default"in o?r=vn(o.from||s,o.default,!0):r=vn(o.from||s):r=vn(o),gt(r)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:i=>r.value=i}):t[s]=r}}function Tl(e,t,n){jt(pe(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Rc(e,t,n,s){let o=s.includes(".")?hc(n,s):()=>n[s];if(We(e)){const r=t[e];ye(r)&&Oe(o,r)}else if(ye(e))Oe(o,e.bind(n));else if(Be(e))if(pe(e))e.forEach(r=>Rc(r,t,n,s));else{const r=ye(e.handler)?e.handler.bind(n):t[e.handler];ye(r)&&Oe(o,r,e)}}function Ec(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:r,config:{optionMergeStrategies:i}}=e.appContext,l=r.get(t);let a;return l?a=l:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(c=>$o(a,c,i,!0)),$o(a,t,i)),Be(t)&&r.set(t,a),a}function $o(e,t,n,s=!1){const{mixins:o,extends:r}=t;r&&$o(e,r,n,!0),o&&o.forEach(i=>$o(e,i,n,!0));for(const i in t)if(!(s&&i==="expose")){const l=xh[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const xh={data:Al,props:Rl,emits:Rl,methods:ws,computed:ws,beforeCreate:yt,created:yt,beforeMount:yt,mounted:yt,beforeUpdate:yt,updated:yt,beforeDestroy:yt,beforeUnmount:yt,destroyed:yt,unmounted:yt,activated:yt,deactivated:yt,errorCaptured:yt,serverPrefetch:yt,components:ws,directives:ws,watch:$h,provide:Al,inject:Ch};function Al(e,t){return t?e?function(){return Xe(ye(e)?e.call(this,this):e,ye(t)?t.call(this,this):t)}:t:e}function Ch(e,t){return ws(ei(e),ei(t))}function ei(e){if(pe(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function yt(e,t){return e?[...new Set([].concat(e,t))]:t}function ws(e,t){return e?Xe(Object.create(null),e,t):t}function Rl(e,t){return e?pe(e)&&pe(t)?[...new Set([...e,...t])]:Xe(Object.create(null),$l(e),$l(t??{})):t}function $h(e,t){if(!e)return t;if(!t)return e;const n=Xe(Object.create(null),e);for(const s in t)n[s]=yt(e[s],t[s]);return n}function Ic(){return{app:null,config:{isNativeTag:Da,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Th=0;function Ah(e,t){return function(s,o=null){ye(s)||(s=Xe({},s)),o!=null&&!Be(o)&&(o=null);const r=Ic(),i=new WeakSet,l=[];let a=!1;const c=r.app={_uid:Th++,_component:s,_props:o,_container:null,_context:r,_instance:null,version:rp,get config(){return r.config},set config(u){},use(u,...f){return i.has(u)||(u&&ye(u.install)?(i.add(u),u.install(c,...f)):ye(u)&&(i.add(u),u(c,...f))),c},mixin(u){return r.mixins.includes(u)||r.mixins.push(u),c},component(u,f){return f?(r.components[u]=f,c):r.components[u]},directive(u,f){return f?(r.directives[u]=f,c):r.directives[u]},mount(u,f,h){if(!a){const p=c._ceVNode||Z(s,o);return p.appContext=r,h===!0?h="svg":h===!1&&(h=void 0),e(p,u,h),a=!0,c._container=u,u.__vue_app__=c,cr(p.component)}},onUnmount(u){l.push(u)},unmount(){a&&(jt(l,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,f){return r.provides[u]=f,c},runWithContext(u){const f=ns;ns=c;try{return u()}finally{ns=f}}};return c}}let ns=null;const Rh=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${_t(t)}Modifiers`]||e[`${Rn(t)}Modifiers`];function Eh(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Fe;let o=n;const r=t.startsWith("update:"),i=r&&Rh(s,t.slice(7));i&&(i.trim&&(o=n.map(u=>We(u)?u.trim():u)),i.number&&(o=n.map(Qo)));let l,a=s[l=_r(t)]||s[l=_r(_t(t))];!a&&r&&(a=s[l=_r(Rn(t))]),a&&jt(a,e,6,o);const c=s[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,jt(c,e,6,o)}}const Ih=new WeakMap;function Lc(e,t,n=!1){const s=n?Ih:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const r=e.emits;let i={},l=!1;if(!ye(e)){const a=c=>{const u=Lc(c,t,!0);u&&(l=!0,Xe(i,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!r&&!l?(Be(e)&&s.set(e,null),null):(pe(r)?r.forEach(a=>i[a]=null):Xe(i,r),Be(e)&&s.set(e,i),i)}function ir(e,t){return!e||!Ko(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),Pe(e,t[0].toLowerCase()+t.slice(1))||Pe(e,Rn(t))||Pe(e,t))}function El(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[r],slots:i,attrs:l,emit:a,render:c,renderCache:u,props:f,data:h,setupState:p,ctx:g,inheritAttrs:_}=e,k=xo(e);let w,x;try{if(n.shapeFlag&4){const A=o||s,G=A;w=on(c.call(G,A,u,f,p,h,g)),x=l}else{const A=t;w=on(A.length>1?A(f,{attrs:l,slots:i,emit:a}):A(f,null)),x=t.props?l:Lh(l)}}catch(A){yn.length=0,nr(A,e,1),w=Z(ft)}let $=w;if(x&&_!==!1){const A=Object.keys(x),{shapeFlag:G}=$;A.length&&G&7&&(r&&A.some(Zo)&&(x=Mh(x,r)),$=An($,x,!1,!0))}return n.dirs&&($=An($,null,!1,!0),$.dirs=$.dirs?$.dirs.concat(n.dirs):n.dirs),n.transition&&Fn($,n.transition),w=$,xo(k),w}const Lh=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ko(n))&&((t||(t={}))[n]=e[n]);return t},Mh=(e,t)=>{const n={};for(const s in e)(!Zo(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Ph(e,t,n){const{props:s,children:o,component:r}=e,{props:i,children:l,patchFlag:a}=t,c=r.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?Il(s,i,c):!!i;if(a&8){const u=t.dynamicProps;for(let f=0;f<u.length;f++){const h=u[f];if(Mc(i,s,h)&&!ir(c,h))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===i?!1:s?i?Il(s,i,c):!0:!!i;return!1}function Il(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const r=s[o];if(Mc(t,e,r)&&!ir(n,r))return!0}return!1}function Mc(e,t,n){const s=e[n],o=t[n];return n==="style"&&Be(s)&&Be(o)?!qs(s,o):s!==o}function Nh({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const Pc={},Nc=()=>Object.create(Pc),Oc=e=>Object.getPrototypeOf(e)===Pc;function Oh(e,t,n,s=!1){const o={},r=Nc();e.propsDefaults=Object.create(null),Dc(e,t,o,r);for(const i in e.propsOptions[0])i in o||(o[i]=void 0);n?e.props=s?o:Wf(o):e.type.props?e.props=o:e.props=r,e.attrs=r}function Dh(e,t,n,s){const{props:o,attrs:r,vnode:{patchFlag:i}}=e,l=Ie(o),[a]=e.propsOptions;let c=!1;if((s||i>0)&&!(i&16)){if(i&8){const u=e.vnode.dynamicProps;for(let f=0;f<u.length;f++){let h=u[f];if(ir(e.emitsOptions,h))continue;const p=t[h];if(a)if(Pe(r,h))p!==r[h]&&(r[h]=p,c=!0);else{const g=_t(h);o[g]=ti(a,l,g,p,e,!1)}else p!==r[h]&&(r[h]=p,c=!0)}}}else{Dc(e,t,o,r)&&(c=!0);let u;for(const f in l)(!t||!Pe(t,f)&&((u=Rn(f))===f||!Pe(t,u)))&&(a?n&&(n[f]!==void 0||n[u]!==void 0)&&(o[f]=ti(a,l,f,void 0,e,!0)):delete o[f]);if(r!==l)for(const f in r)(!t||!Pe(t,f))&&(delete r[f],c=!0)}c&&dn(e.attrs,"set","")}function Dc(e,t,n,s){const[o,r]=e.propsOptions;let i=!1,l;if(t)for(let a in t){if(xs(a))continue;const c=t[a];let u;o&&Pe(o,u=_t(a))?!r||!r.includes(u)?n[u]=c:(l||(l={}))[u]=c:ir(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,i=!0)}if(r){const a=Ie(n),c=l||Fe;for(let u=0;u<r.length;u++){const f=r[u];n[f]=ti(o,a,f,c[f],e,!Pe(c,f))}}return i}function ti(e,t,n,s,o,r){const i=e[n];if(i!=null){const l=Pe(i,"default");if(l&&s===void 0){const a=i.default;if(i.type!==Function&&!i.skipFactory&&ye(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=Vs(o);s=c[n]=a.call(null,t),u()}}else s=a;o.ce&&o.ce._setProp(n,s)}i[0]&&(r&&!l?s=!1:i[1]&&(s===""||s===Rn(n))&&(s=!0))}return s}const Bh=new WeakMap;function Bc(e,t,n=!1){const s=n?Bh:t.propsCache,o=s.get(e);if(o)return o;const r=e.props,i={},l=[];let a=!1;if(!ye(e)){const u=f=>{a=!0;const[h,p]=Bc(f,t,!0);Xe(i,h),p&&l.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!r&&!a)return Be(e)&&s.set(e,Xn),Xn;if(pe(r))for(let u=0;u<r.length;u++){const f=_t(r[u]);Ll(f)&&(i[f]=Fe)}else if(r)for(const u in r){const f=_t(u);if(Ll(f)){const h=r[u],p=i[f]=pe(h)||ye(h)?{type:h}:Xe({},h),g=p.type;let _=!1,k=!0;if(pe(g))for(let w=0;w<g.length;++w){const x=g[w],$=ye(x)&&x.name;if($==="Boolean"){_=!0;break}else $==="String"&&(k=!1)}else _=ye(g)&&g.name==="Boolean";p[0]=_,p[1]=k,(_||Pe(p,"default"))&&l.push(f)}}const c=[i,l];return Be(e)&&s.set(e,c),c}function Ll(e){return e[0]!=="$"&&!xs(e)}const Ni=e=>e==="_"||e==="_ctx"||e==="$stable",Oi=e=>pe(e)?e.map(on):[on(e)],jh=(e,t,n)=>{if(t._n)return t;const s=$t((...o)=>Oi(t(...o)),n);return s._c=!1,s},jc=(e,t,n)=>{const s=e._ctx;for(const o in e){if(Ni(o))continue;const r=e[o];if(ye(r))t[o]=jh(o,r,s);else if(r!=null){const i=Oi(r);t[o]=()=>i}}},Uc=(e,t)=>{const n=Oi(t);e.slots.default=()=>n},Fc=(e,t,n)=>{for(const s in t)(n||!Ni(s))&&(e[s]=t[s])},Uh=(e,t,n)=>{const s=e.slots=Nc();if(e.vnode.shapeFlag&32){const o=t._;o?(Fc(s,t,n),n&&Fa(s,"_",o,!0)):jc(t,s)}else t&&Uc(e,t)},Fh=(e,t,n)=>{const{vnode:s,slots:o}=e;let r=!0,i=Fe;if(s.shapeFlag&32){const l=t._;l?n&&l===1?r=!1:Fc(o,t,n):(r=!t.$stable,jc(t,o)),i=t}else t&&(Uc(e,t),i={default:1});if(r)for(const l in o)!Ni(l)&&i[l]==null&&delete o[l]},bt=Wh;function Gh(e){return zh(e)}function zh(e,t){const n=er();n.__VUE__=!0;const{insert:s,remove:o,patchProp:r,createElement:i,createText:l,createComment:a,setText:c,setElementText:u,parentNode:f,nextSibling:h,setScopeId:p=zt,insertStaticContent:g}=e,_=(m,S,E,F=null,B=null,j=null,se=void 0,V=null,Y=!!S.dynamicChildren)=>{if(m===S)return;m&&!Nn(m,S)&&(F=xt(m),Ce(m,B,j,!0),m=null),S.patchFlag===-2&&(Y=!1,S.dynamicChildren=null);const{type:U,ref:ue,shapeFlag:oe}=S;switch(U){case lr:k(m,S,E,F);break;case ft:w(m,S,E,F);break;case vo:m==null&&x(S,E,F,se);break;case ee:z(m,S,E,F,B,j,se,V,Y);break;default:oe&1?G(m,S,E,F,B,j,se,V,Y):oe&6?ve(m,S,E,F,B,j,se,V,Y):(oe&64||oe&128)&&U.process(m,S,E,F,B,j,se,V,Y,ne)}ue!=null&&B?Ts(ue,m&&m.ref,j,S||m,!S):ue==null&&m&&m.ref!=null&&Ts(m.ref,null,j,m,!0)},k=(m,S,E,F)=>{if(m==null)s(S.el=l(S.children),E,F);else{const B=S.el=m.el;S.children!==m.children&&c(B,S.children)}},w=(m,S,E,F)=>{m==null?s(S.el=a(S.children||""),E,F):S.el=m.el},x=(m,S,E,F)=>{[m.el,m.anchor]=g(m.children,S,E,F,m.el,m.anchor)},$=({el:m,anchor:S},E,F)=>{let B;for(;m&&m!==S;)B=h(m),s(m,E,F),m=B;s(S,E,F)},A=({el:m,anchor:S})=>{let E;for(;m&&m!==S;)E=h(m),o(m),m=E;o(S)},G=(m,S,E,F,B,j,se,V,Y)=>{if(S.type==="svg"?se="svg":S.type==="math"&&(se="mathml"),m==null)Q(S,E,F,B,j,se,V,Y);else{const U=m.el&&m.el._isVueCE?m.el:null;try{U&&U._beginPatch(),L(m,S,B,j,se,V,Y)}finally{U&&U._endPatch()}}},Q=(m,S,E,F,B,j,se,V)=>{let Y,U;const{props:ue,shapeFlag:oe,transition:le,dirs:de}=m;if(Y=m.el=i(m.type,j,ue&&ue.is,ue),oe&8?u(Y,m.children):oe&16&&R(m.children,Y,null,F,B,Rr(m,j),se,V),de&&En(m,null,F,"created"),C(Y,m,m.scopeId,se,F),ue){for(const Me in ue)Me!=="value"&&!xs(Me)&&r(Y,Me,null,ue[Me],j,F);"value"in ue&&r(Y,"value",null,ue.value,j),(U=ue.onVnodeBeforeMount)&&Yt(U,F,m)}de&&En(m,null,F,"beforeMount");const _e=Hh(B,le);_e&&le.beforeEnter(Y),s(Y,S,E),((U=ue&&ue.onVnodeMounted)||_e||de)&&bt(()=>{try{U&&Yt(U,F,m),_e&&le.enter(Y),de&&En(m,null,F,"mounted")}finally{}},B)},C=(m,S,E,F,B)=>{if(E&&p(m,E),F)for(let j=0;j<F.length;j++)p(m,F[j]);if(B){let j=B.subTree;if(S===j||Hc(j.type)&&(j.ssContent===S||j.ssFallback===S)){const se=B.vnode;C(m,se,se.scopeId,se.slotScopeIds,B.parent)}}},R=(m,S,E,F,B,j,se,V,Y=0)=>{for(let U=Y;U<m.length;U++){const ue=m[U]=V?un(m[U]):on(m[U]);_(null,ue,S,E,F,B,j,se,V)}},L=(m,S,E,F,B,j,se)=>{const V=S.el=m.el;let{patchFlag:Y,dynamicChildren:U,dirs:ue}=S;Y|=m.patchFlag&16;const oe=m.props||Fe,le=S.props||Fe;let de;if(E&&In(E,!1),(de=le.onVnodeBeforeUpdate)&&Yt(de,E,S,m),ue&&En(S,m,E,"beforeUpdate"),E&&In(E,!0),U&&(!m.dynamicChildren||m.dynamicChildren.length!==U.length)&&(Y=0,se=!1,U=null),(oe.innerHTML&&le.innerHTML==null||oe.textContent&&le.textContent==null)&&u(V,""),U?J(m.dynamicChildren,U,V,E,F,Rr(S,B),j):se||ge(m,S,V,null,E,F,Rr(S,B),j,!1),Y>0){if(Y&16)ie(V,oe,le,E,B);else if(Y&2&&oe.class!==le.class&&r(V,"class",null,le.class,B),Y&4&&r(V,"style",oe.style,le.style,B),Y&8){const _e=S.dynamicProps;for(let Me=0;Me<_e.length;Me++){const Ee=_e[Me],Le=oe[Ee],Qe=le[Ee];(Qe!==Le||Ee==="value")&&r(V,Ee,Le,Qe,B,E)}}Y&1&&m.children!==S.children&&u(V,S.children)}else!se&&U==null&&ie(V,oe,le,E,B);((de=le.onVnodeUpdated)||ue)&&bt(()=>{de&&Yt(de,E,S,m),ue&&En(S,m,E,"updated")},F)},J=(m,S,E,F,B,j,se)=>{for(let V=0;V<S.length;V++){const Y=m[V],U=S[V],ue=Y.el&&(Y.type===ee||!Nn(Y,U)||Y.shapeFlag&198)?f(Y.el):E;_(Y,U,ue,null,F,B,j,se,!0)}},ie=(m,S,E,F,B)=>{if(S!==E){if(S!==Fe)for(const j in S)!xs(j)&&!(j in E)&&r(m,j,S[j],null,B,F);for(const j in E){if(xs(j))continue;const se=E[j],V=S[j];se!==V&&j!=="value"&&r(m,j,V,se,B,F)}"value"in E&&r(m,"value",S.value,E.value,B)}},z=(m,S,E,F,B,j,se,V,Y)=>{const U=S.el=m?m.el:l(""),ue=S.anchor=m?m.anchor:l("");let{patchFlag:oe,dynamicChildren:le,slotScopeIds:de}=S;de&&(V=V?V.concat(de):de),m==null?(s(U,E,F),s(ue,E,F),R(S.children||[],E,ue,B,j,se,V,Y)):oe>0&&oe&64&&le&&m.dynamicChildren&&m.dynamicChildren.length===le.length?(J(m.dynamicChildren,le,E,B,j,se,V),(S.key!=null||B&&S===B.subTree)&&Di(m,S,!0)):ge(m,S,E,ue,B,j,se,V,Y)},ve=(m,S,E,F,B,j,se,V,Y)=>{S.slotScopeIds=V,m==null?S.shapeFlag&512?B.ctx.activate(S,E,F,se,Y):O(S,E,F,B,j,se,Y):P(m,S,Y)},O=(m,S,E,F,B,j,se)=>{const V=m.component=Xh(m,F,B);if(sr(m)&&(V.ctx.renderer=ne),Qh(V,!1,se),V.asyncDep){if(B&&B.registerDep(V,te,se),!m.el){const Y=V.subTree=Z(ft);w(null,Y,S,E),m.placeholder=Y.el}}else te(V,m,S,E,B,j,se)},P=(m,S,E)=>{const F=S.component=m.component;if(Ph(m,S,E))if(F.asyncDep&&!F.asyncResolved){q(F,S,E);return}else F.next=S,F.update();else S.el=m.el,F.vnode=S},te=(m,S,E,F,B,j,se)=>{const V=()=>{if(m.isMounted){let{next:oe,bu:le,u:de,parent:_e,vnode:Me}=m;{const Et=Gc(m);if(Et){oe&&(oe.el=Me.el,q(m,oe,se)),Et.asyncDep.then(()=>{bt(()=>{m.isUnmounted||U()},B)});return}}let Ee=oe,Le;In(m,!1),oe?(oe.el=Me.el,q(m,oe,se)):oe=Me,le&&po(le),(Le=oe.props&&oe.props.onVnodeBeforeUpdate)&&Yt(Le,_e,oe,Me),In(m,!0);const Qe=El(m),et=m.subTree;m.subTree=Qe,_(et,Qe,f(et.el),xt(et),m,B,j),oe.el=Qe.el,Ee===null&&Nh(m,Qe.el),de&&bt(de,B),(Le=oe.props&&oe.props.onVnodeUpdated)&&bt(()=>Yt(Le,_e,oe,Me),B)}else{let oe;const{el:le,props:de}=S,{bm:_e,m:Me,parent:Ee,root:Le,type:Qe}=m,et=ts(S);In(m,!1),_e&&po(_e),!et&&(oe=de&&de.onVnodeBeforeMount)&&Yt(oe,Ee,S),In(m,!0);{Le.ce&&Le.ce._hasShadowRoot()&&Le.ce._injectChildStyle(Qe,m.parent?m.parent.type:void 0);const Et=m.subTree=El(m);_(null,Et,E,F,m,B,j),S.el=Et.el}if(Me&&bt(Me,B),!et&&(oe=de&&de.onVnodeMounted)){const Et=S;bt(()=>Yt(oe,Ee,Et),B)}(S.shapeFlag&256||Ee&&ts(Ee.vnode)&&Ee.vnode.shapeFlag&256)&&m.a&&bt(m.a,B),m.isMounted=!0,S=E=F=null}};m.scope.on();const Y=m.effect=new qa(V);m.scope.off();const U=m.update=Y.run.bind(Y),ue=m.job=Y.runIfDirty.bind(Y);ue.i=m,ue.id=m.uid,Y.scheduler=()=>Li(ue),In(m,!0),U()},q=(m,S,E)=>{S.component=m;const F=m.vnode.props;m.vnode=S,m.next=null,Dh(m,S.props,F,E),Fh(m,S.children,E),bn(),bl(m),kn()},ge=(m,S,E,F,B,j,se,V,Y=!1)=>{const U=m&&m.children,ue=m?m.shapeFlag:0,oe=S.children,{patchFlag:le,shapeFlag:de}=S;if(le>0){if(le&128){ke(U,oe,E,F,B,j,se,V,Y);return}else if(le&256){Ae(U,oe,E,F,B,j,se,V,Y);return}}de&8?(ue&16&&Ze(U,B,j),oe!==U&&u(E,oe)):ue&16?de&16?ke(U,oe,E,F,B,j,se,V,Y):Ze(U,B,j,!0):(ue&8&&u(E,""),de&16&&R(oe,E,F,B,j,se,V,Y))},Ae=(m,S,E,F,B,j,se,V,Y)=>{m=m||Xn,S=S||Xn;const U=m.length,ue=S.length,oe=Math.min(U,ue);let le;for(le=0;le<oe;le++){const de=S[le]=Y?un(S[le]):on(S[le]);_(m[le],de,E,null,B,j,se,V,Y)}U>ue?Ze(m,B,j,!0,!1,oe):R(S,E,F,B,j,se,V,Y,oe)},ke=(m,S,E,F,B,j,se,V,Y)=>{let U=0;const ue=S.length;let oe=m.length-1,le=ue-1;for(;U<=oe&&U<=le;){const de=m[U],_e=S[U]=Y?un(S[U]):on(S[U]);if(Nn(de,_e))_(de,_e,E,null,B,j,se,V,Y);else break;U++}for(;U<=oe&&U<=le;){const de=m[oe],_e=S[le]=Y?un(S[le]):on(S[le]);if(Nn(de,_e))_(de,_e,E,null,B,j,se,V,Y);else break;oe--,le--}if(U>oe){if(U<=le){const de=le+1,_e=de<ue?S[de].el:F;for(;U<=le;)_(null,S[U]=Y?un(S[U]):on(S[U]),E,_e,B,j,se,V,Y),U++}}else if(U>le)for(;U<=oe;)Ce(m[U],B,j,!0),U++;else{const de=U,_e=U,Me=new Map;for(U=_e;U<=le;U++){const vt=S[U]=Y?un(S[U]):on(S[U]);vt.key!=null&&Me.set(vt.key,U)}let Ee,Le=0;const Qe=le-_e+1;let et=!1,Et=0;const Gt=new Array(Qe);for(U=0;U<Qe;U++)Gt[U]=0;for(U=de;U<=oe;U++){const vt=m[U];if(Le>=Qe){Ce(vt,B,j,!0);continue}let rt;if(vt.key!=null)rt=Me.get(vt.key);else for(Ee=_e;Ee<=le;Ee++)if(Gt[Ee-_e]===0&&Nn(vt,S[Ee])){rt=Ee;break}rt===void 0?Ce(vt,B,j,!0):(Gt[rt-_e]=U+1,rt>=Et?Et=rt:et=!0,_(vt,S[rt],E,null,B,j,se,V,Y),Le++)}const Ys=et?qh(Gt):Xn;for(Ee=Ys.length-1,U=Qe-1;U>=0;U--){const vt=_e+U,rt=S[vt],Kt=S[vt+1],Zt=vt+1<ue?Kt.el||zc(Kt):F;Gt[U]===0?_(null,rt,E,Zt,B,j,se,V,Y):et&&(Ee<0||U!==Ys[Ee]?ae(rt,E,Zt,2):Ee--)}}},ae=(m,S,E,F,B=null)=>{const{el:j,type:se,transition:V,children:Y,shapeFlag:U}=m;if(U&6){ae(m.component.subTree,S,E,F);return}if(U&128){m.suspense.move(S,E,F);return}if(U&64){se.move(m,S,E,ne);return}if(se===ee){s(j,S,E);for(let oe=0;oe<Y.length;oe++)ae(Y[oe],S,E,F);s(m.anchor,S,E);return}if(se===vo){$(m,S,E);return}if(F!==2&&U&1&&V)if(F===0)V.persisted&&!j[Nt]?s(j,S,E):(V.beforeEnter(j),s(j,S,E),bt(()=>V.enter(j),B));else{const{leave:oe,delayLeave:le,afterLeave:de}=V,_e=()=>{m.ctx.isUnmounted?o(j):s(j,S,E)},Me=()=>{const Ee=j._isLeaving||!!j[Nt];j._isLeaving&&j[Nt](!0),V.persisted&&!Ee?_e():oe(j,()=>{_e(),de&&de()})};le?le(j,_e,Me):Me()}else s(j,S,E)},Ce=(m,S,E,F=!1,B=!1)=>{const{type:j,props:se,ref:V,children:Y,dynamicChildren:U,shapeFlag:ue,patchFlag:oe,dirs:le,cacheIndex:de,memo:_e}=m;if(oe===-2&&(B=!1),V!=null&&(bn(),Ts(V,null,E,m,!0),kn()),de!=null&&(S.renderCache[de]=void 0),ue&256){S.ctx.deactivate(m);return}const Me=ue&1&&le,Ee=!ts(m);let Le;if(Ee&&(Le=se&&se.onVnodeBeforeUnmount)&&Yt(Le,S,m),ue&6)Ke(m.component,E,F);else{if(ue&128){m.suspense.unmount(E,F);return}Me&&En(m,null,S,"beforeUnmount"),ue&64?m.type.remove(m,S,E,ne,F):U&&!U.hasOnce&&(j!==ee||oe>0&&oe&64)?Ze(U,S,E,!1,!0):(j===ee&&oe&384||!B&&ue&16)&&Ze(Y,S,E),F&&Te(m)}const Qe=_e!=null&&de==null;(Ee&&(Le=se&&se.onVnodeUnmounted)||Me||Qe)&&bt(()=>{Le&&Yt(Le,S,m),Me&&En(m,null,S,"unmounted"),Qe&&(m.el=null)},E)},Te=m=>{const{type:S,el:E,anchor:F,transition:B}=m;if(S===ee){Rt(E,F);return}if(S===vo){A(m);return}const j=()=>{o(E),B&&!B.persisted&&B.afterLeave&&B.afterLeave()};if(m.shapeFlag&1&&B&&!B.persisted){const{leave:se,delayLeave:V}=B,Y=()=>se(E,j);V?V(m.el,j,Y):Y()}else j()},Rt=(m,S)=>{let E;for(;m!==S;)E=h(m),o(m),m=E;o(S)},Ke=(m,S,E)=>{const{bum:F,scope:B,job:j,subTree:se,um:V,m:Y,a:U}=m;Ml(Y),Ml(U),F&&po(F),B.stop(),j&&(j.flags|=8,Ce(se,m,S,E)),V&&bt(V,S),bt(()=>{m.isUnmounted=!0},S)},Ze=(m,S,E,F=!1,B=!1,j=0)=>{for(let se=j;se<m.length;se++)Ce(m[se],S,E,F,B)},xt=m=>{if(m.shapeFlag&6)return xt(m.component.subTree);if(m.shapeFlag&128)return m.suspense.next();const S=h(m.anchor||m.el),E=S&&S[pc];return E?h(E):S};let mt=!1;const Ft=(m,S,E)=>{let F;m==null?S._vnode&&(Ce(S._vnode,null,null,!0),F=S._vnode.component):_(S._vnode||null,m,S,null,null,null,E),S._vnode=m,mt||(mt=!0,bl(F),cc(),mt=!1)},ne={p:_,um:Ce,m:ae,r:Te,mt:O,mc:R,pc:ge,pbc:J,n:xt,o:e};return{render:Ft,hydrate:void 0,createApp:Ah(Ft)}}function Rr({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function In({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Hh(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Di(e,t,n=!1){const s=e.children,o=t.children;if(pe(s)&&pe(o))for(let r=0;r<s.length;r++){const i=s[r];let l=o[r];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[r]=un(o[r]),l.el=i.el),!n&&l.patchFlag!==-2&&Di(i,l)),l.type===lr&&(l.patchFlag===-1&&(l=o[r]=un(l)),l.el=i.el),l.type===ft&&!l.el&&(l.el=i.el)}}function qh(e){const t=e.slice(),n=[0];let s,o,r,i,l;const a=e.length;for(s=0;s<a;s++){const c=e[s];if(c!==0){if(o=n[n.length-1],e[o]<c){t[s]=o,n.push(s);continue}for(r=0,i=n.length-1;r<i;)l=r+i>>1,e[n[l]]<c?r=l+1:i=l;c<e[n[r]]&&(r>0&&(t[s]=n[r-1]),n[r]=s)}}for(r=n.length,i=n[r-1];r-- >0;)n[r]=i,i=t[i];return n}function Gc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Gc(t)}function Ml(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function zc(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?zc(t.subTree):null}const Hc=e=>e.__isSuspense;function Wh(e,t){t&&t.pendingBranch?pe(e)?t.effects.push(...e):t.effects.push(e):ac(e)}const ee=Symbol.for("v-fgt"),lr=Symbol.for("v-txt"),ft=Symbol.for("v-cmt"),vo=Symbol.for("v-stc"),yn=[];let Tt=null;function y(e=!1){yn.push(Tt=e?null:[])}function Bi(){yn.pop(),Tt=yn[yn.length-1]||null}let Ns=1;function To(e,t=!1){Ns+=e,e<0&&Tt&&t&&(Tt.hasOnce=!0)}function qc(e){return e.dynamicChildren=Ns>0?Tt||Xn:null,Bi(),Ns>0&&Tt&&Tt.push(e),e}function b(e,t,n,s,o,r){return qc(d(e,t,n,s,o,r,!0))}function qe(e,t,n,s,o){return qc(Z(e,t,n,s,o,!0))}function Os(e){return e?e.__v_isVNode===!0:!1}function Nn(e,t){return e.type===t.type&&e.key===t.key}const Wc=({key:e})=>e??null,yo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?We(e)||gt(e)||ye(e)?{i:lt,r:e,k:t,f:!!n}:e:null);function d(e,t=null,n=null,s=0,o=null,r=e===ee?0:1,i=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Wc(t),ref:t&&yo(t),scopeId:dc,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:lt};return l?(Ao(a,n),r&128&&e.normalize(a)):n&&(a.shapeFlag|=We(n)?8:16),Ns>0&&!i&&Tt&&(a.patchFlag>0||r&6)&&a.patchFlag!==32&&Tt.push(a),a}const Z=Vh;function Vh(e,t=null,n=null,s=0,o=null,r=!1){if((!e||e===$c)&&(e=ft),Os(e)){const l=An(e,t,!0);return n&&Ao(l,n),Ns>0&&!r&&Tt&&(l.shapeFlag&6?Tt[Tt.indexOf(e)]=l:Tt.push(l)),l.patchFlag=-2,l}if(op(e)&&(e=e.__vccOpts),t){t=Kh(t);let{class:l,style:a}=t;l&&!We(l)&&(t.class=fe(l)),Be(a)&&(Ii(a)&&!pe(a)&&(a=Xe({},a)),t.style=ln(a))}const i=We(e)?1:Hc(e)?128:gc(e)?64:Be(e)?4:ye(e)?2:0;return d(e,t,n,s,o,i,r,!0)}function Kh(e){return e?Ii(e)||Oc(e)?Xe({},e):e:null}function An(e,t,n=!1,s=!1){const{props:o,ref:r,patchFlag:i,children:l,transition:a}=e,c=t?Zh(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Wc(c),ref:t&&t.ref?n&&r?pe(r)?r.concat(yo(t)):[r,yo(t)]:yo(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ee?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&An(e.ssContent),ssFallback:e.ssFallback&&An(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&Fn(u,a.clone(u)),u}function Re(e=" ",t=0){return Z(lr,null,e,t)}function D(e="",t=!1){return t?(y(),qe(ft,null,e)):Z(ft,null,e)}function on(e){return e==null||typeof e=="boolean"?Z(ft):pe(e)?Z(ee,null,e.slice()):Os(e)?un(e):Z(lr,null,String(e))}function un(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:An(e)}function Ao(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(pe(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),Ao(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Oc(t)?t._ctx=lt:o===3&<&&(lt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(ye(t)){if(s&65){Ao(e,{default:t});return}t={default:t,_ctx:lt},n=32}else t=String(t),s&64?(n=16,t=[Re(t)]):n=8;e.children=t,e.shapeFlag|=n}function Zh(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=fe([t.class,s.class]));else if(o==="style")t.style=ln([t.style,s.style]);else if(Ko(o)){const r=t[o],i=s[o];i&&r!==i&&!(pe(r)&&r.includes(i))?t[o]=r?[].concat(r,i):i:i==null&&r==null&&!Zo(o)&&(t[o]=i)}else o!==""&&(t[o]=s[o])}return t}function Yt(e,t,n,s=null){jt(e,t,7,[n,s])}const Jh=Ic();let Yh=0;function Xh(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Jh,r={uid:Yh++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Tf(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Bc(s,o),emitsOptions:Lc(s,o),emit:null,emitted:null,propsDefaults:Fe,inheritAttrs:s.inheritAttrs,ctx:Fe,data:Fe,props:Fe,attrs:Fe,slots:Fe,refs:Fe,setupState:Fe,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return r.ctx={_:r},r.root=t?t.root:r,r.emit=Eh.bind(null,r),e.ce&&e.ce(r),r}let ht=null;const ar=()=>ht||lt;let Ro,ni;{const e=er(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),r=>{o.length>1?o.forEach(i=>i(r)):o[0](r)}};Ro=t("__VUE_INSTANCE_SETTERS__",n=>ht=n),ni=t("__VUE_SSR_SETTERS__",n=>Ds=n)}const Vs=e=>{const t=ht;return Ro(e),e.scope.on(),()=>{e.scope.off(),Ro(t)}},Pl=()=>{ht&&ht.scope.off(),Ro(null)};function Vc(e){return e.vnode.shapeFlag&4}let Ds=!1;function Qh(e,t=!1,n=!1){t&&ni(t);const{props:s,children:o}=e.vnode,r=Vc(e);Oh(e,s,r,t),Uh(e,o,n||t);const i=r?ep(e,t):void 0;return t&&ni(!1),i}function ep(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,wh);const{setup:s}=n;if(s){bn();const o=e.setupContext=s.length>1?np(e):null,r=Vs(e),i=Ws(s,e,0,[e.props,o]),l=Ba(i);if(kn(),r(),(l||e.sp)&&!ts(e)&&wc(e),l){if(i.then(Pl,Pl),t)return i.then(a=>{Nl(e,a)}).catch(a=>{nr(a,e,0)});e.asyncDep=i}else Nl(e,i)}else Kc(e)}function Nl(e,t,n){ye(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Be(t)&&(e.setupState=rc(t)),Kc(e)}function Kc(e,t,n){const s=e.type;e.render||(e.render=s.render||zt);{const o=Vs(e);bn();try{_h(e)}finally{kn(),o()}}}const tp={get(e,t){return dt(e,"get",""),e[t]}};function np(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,tp),slots:e.slots,emit:e.emit,expose:t}}function cr(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(rc(Vf(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in As)return As[n](e)},has(t,n){return n in t||n in As}})):e.proxy}function sp(e,t=!0){return ye(e)?e.displayName||e.name:e.name||t&&e.__name}function op(e){return ye(e)&&"__vccOpts"in e}const X=(e,t)=>Xf(e,t,Ds);function Ne(e,t,n){try{To(-1);const s=arguments.length;return s===2?Be(t)&&!pe(t)?Os(t)?Z(e,null,[t]):Z(e,t):Z(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Os(n)&&(n=[n]),Z(e,t,n))}finally{To(1)}}const rp="3.5.40";/**
|
|
14
|
-
* @vue/runtime-dom v3.5.40
|
|
15
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
16
|
-
* @license MIT
|
|
17
|
-
**/let si;const Ol=typeof window<"u"&&window.trustedTypes;if(Ol)try{si=Ol.createPolicy("vue",{createHTML:e=>e})}catch{}const Zc=si?e=>si.createHTML(e):e=>e,ip="http://www.w3.org/2000/svg",lp="http://www.w3.org/1998/Math/MathML",cn=typeof document<"u"?document:null,Dl=cn&&cn.createElement("template"),ap={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?cn.createElementNS(ip,e):t==="mathml"?cn.createElementNS(lp,e):n?cn.createElement(e,{is:n}):cn.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>cn.createTextNode(e),createComment:e=>cn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>cn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,r){const i=n?n.previousSibling:t.lastChild;if(o&&(o===r||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===r||!(o=o.nextSibling)););else{Dl.innerHTML=Zc(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=Dl.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Sn="transition",hs="animation",is=Symbol("_vtc"),Jc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Yc=Xe({},vc,Jc),cp=e=>(e.displayName="Transition",e.props=Yc,e),ur=cp((e,{slots:t})=>Ne(uh,Xc(e),t)),Ln=(e,t=[])=>{pe(e)?e.forEach(n=>n(...t)):e&&e(...t)},Bl=e=>e?pe(e)?e.some(t=>t.length>1):e.length>1:!1;function Xc(e){const t={};for(const z in e)z in Jc||(t[z]=e[z]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:r=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=r,appearActiveClass:c=i,appearToClass:u=l,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,g=up(o),_=g&&g[0],k=g&&g[1],{onBeforeEnter:w,onEnter:x,onEnterCancelled:$,onLeave:A,onLeaveCancelled:G,onBeforeAppear:Q=w,onAppear:C=x,onAppearCancelled:R=$}=t,L=(z,ve,O,P)=>{z._enterCancelled=P,Cn(z,ve?u:l),Cn(z,ve?c:i),O&&O()},J=(z,ve)=>{z._isLeaving=!1,Cn(z,f),Cn(z,p),Cn(z,h),ve&&ve()},ie=z=>(ve,O)=>{const P=z?C:x,te=()=>L(ve,z,O);Ln(P,[ve,te]),jl(()=>{Cn(ve,z?a:r),Xt(ve,z?u:l),Bl(P)||Ul(ve,s,_,te)})};return Xe(t,{onBeforeEnter(z){Ln(w,[z]),Xt(z,r),Xt(z,i)},onBeforeAppear(z){Ln(Q,[z]),Xt(z,a),Xt(z,c)},onEnter:ie(!1),onAppear:ie(!0),onLeave(z,ve){z._isLeaving=!0;const O=()=>J(z,ve);Xt(z,f),z._enterCancelled?(Xt(z,h),oi(z)):(oi(z),Xt(z,h)),jl(()=>{z._isLeaving&&(Cn(z,f),Xt(z,p),Bl(A)||Ul(z,s,k,O))}),Ln(A,[z,O])},onEnterCancelled(z){L(z,!1,void 0,!0),Ln($,[z])},onAppearCancelled(z){L(z,!0,void 0,!0),Ln(R,[z])},onLeaveCancelled(z){J(z),Ln(G,[z])}})}function up(e){if(e==null)return null;if(Be(e))return[Er(e.enter),Er(e.leave)];{const t=Er(e);return[t,t]}}function Er(e){return vf(e)}function Xt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[is]||(e[is]=new Set)).add(t)}function Cn(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[is];n&&(n.delete(t),n.size||(e[is]=void 0))}function jl(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let dp=0;function Ul(e,t,n,s){const o=e._endId=++dp,r=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(r,n);const{type:i,timeout:l,propCount:a}=Qc(e,t);if(!i)return s();const c=i+"end";let u=0;const f=()=>{e.removeEventListener(c,h),r()},h=p=>{p.target===e&&++u>=a&&f()};setTimeout(()=>{u<a&&f()},l+1),e.addEventListener(c,h)}function Qc(e,t){const n=window.getComputedStyle(e),s=g=>(n[g]||"").split(", "),o=s(`${Sn}Delay`),r=s(`${Sn}Duration`),i=Fl(o,r),l=s(`${hs}Delay`),a=s(`${hs}Duration`),c=Fl(l,a);let u=null,f=0,h=0;t===Sn?i>0&&(u=Sn,f=i,h=r.length):t===hs?c>0&&(u=hs,f=c,h=a.length):(f=Math.max(i,c),u=f>0?i>c?Sn:hs:null,h=u?u===Sn?r.length:a.length:0);const p=u===Sn&&/\b(?:transform|all)(?:,|$)/.test(s(`${Sn}Property`).toString());return{type:u,timeout:f,propCount:h,hasTransform:p}}function Fl(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>Gl(n)+Gl(e[s])))}function Gl(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function oi(e){return(e?e.ownerDocument:document).body.offsetHeight}function fp(e,t,n){const s=e[is];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Eo=Symbol("_vod"),ji=Symbol("_vsh"),eu={name:"show",beforeMount(e,{value:t},{transition:n}){e[Eo]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):ps(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),ps(e,!0),s.enter(e)):s.leave(e,()=>{ps(e,!1)}):ps(e,t))},beforeUnmount(e,{value:t}){ps(e,t)}};function ps(e,t){e.style.display=t?e[Eo]:"none",e[ji]=!t}const tu=Symbol("");function hp(e){const t=ar();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(r=>Io(r,o))},s=()=>{const o=e(t.proxy);t.ce?Io(t.ce,o):ri(t.subTree,o),n(o)};Sc(()=>{ac(s)}),Ut(()=>{Oe(s,zt,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),rr(()=>o.disconnect())})}function ri(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{ri(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Io(e.el,t);else if(e.type===ee)e.children.forEach(n=>ri(n,t));else if(e.type===vo){let{el:n,anchor:s}=e;for(;n&&(Io(n,t),n!==s);)n=n.nextSibling}}function Io(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const r=$f(t[o]);n.setProperty(`--${o}`,r),s+=`--${o}: ${r};`}n[tu]=s}}const pp=/(?:^|;)\s*display\s*:/;function gp(e,t,n){const s=e.style,o=We(n);let r=!1;if(n&&!o){if(t)if(We(t))for(const i of t.split(";")){const l=i.slice(0,i.indexOf(":")).trim();n[l]==null&&_s(s,l,"")}else for(const i in t)n[i]==null&&_s(s,i,"");for(const i in n){i==="display"&&(r=!0);const l=n[i];l!=null?vp(e,i,!We(t)&&t?t[i]:void 0,l)||_s(s,i,l):_s(s,i,"")}}else if(o){if(t!==n){const i=s[tu];i&&(n+=";"+i),s.cssText=n,r=pp.test(n)}}else t&&e.removeAttribute("style");Eo in e&&(e[Eo]=r?s.display:"",e[ji]&&(s.display="none"))}const zl=/\s*!important$/;function _s(e,t,n){if(pe(n))n.forEach(s=>_s(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=mp(e,t);zl.test(n)?e.setProperty(Rn(s),n.replace(zl,""),"important"):e[s]=n}}const Hl=["Webkit","Moz","ms"],Ir={};function mp(e,t){const n=Ir[t];if(n)return n;let s=_t(t);if(s!=="filter"&&s in e)return Ir[t]=s;s=Xo(s);for(let o=0;o<Hl.length;o++){const r=Hl[o]+s;if(r in e)return Ir[t]=r}return t}function vp(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&We(s)&&n===s}const ql="http://www.w3.org/1999/xlink";function Wl(e,t,n,s,o,r=Sf(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ql,t.slice(6,t.length)):e.setAttributeNS(ql,t,n):n==null||r&&!Ga(n)?e.removeAttribute(t):e.setAttribute(t,r?"":qt(n)?String(n):n)}function Vl(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Zc(n):n);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const l=r==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=Ga(n):n==null&&l==="string"?(n="",i=!0):l==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(o||t)}function On(e,t,n,s){e.addEventListener(t,n,s)}function yp(e,t,n,s){e.removeEventListener(t,n,s)}const Kl=Symbol("_vei");function bp(e,t,n,s,o=null){const r=e[Kl]||(e[Kl]={}),i=r[t];if(s&&i)i.value=s;else{const[l,a]=_p(t);if(s){const c=r[t]=Cp(s,o);On(e,l,c,a)}else i&&(yp(e,l,i,a),r[t]=void 0)}}const kp=/(Once|Passive|Capture)$/,wp=/^on:?(?:Once|Passive|Capture)$/;function _p(e){let t,n;for(;(n=e.match(kp))&&!wp.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):Rn(e.slice(2)),t]}let Lr=0;const Sp=Promise.resolve(),xp=()=>Lr||(Sp.then(()=>Lr=0),Lr=Date.now());function Cp(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(pe(o)){const r=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{r.call(s),s._stopped=!0};const i=o.slice(),l=[s];for(let a=0;a<i.length&&!s._stopped;a++){const c=i[a];c&&jt(c,t,5,l)}}else jt(o,t,5,[s])};return n.value=e,n.attached=xp(),n}const Zl=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,$p=(e,t,n,s,o,r)=>{const i=o==="svg";t==="class"?fp(e,s,i):t==="style"?gp(e,n,s):Ko(t)?Zo(t)||bp(e,t,n,s,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Tp(e,t,s,i))?(Vl(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Wl(e,t,s,i,r,t!=="value")):e._isVueCE&&(Ap(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!We(s)))?Vl(e,_t(t),s,r,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Wl(e,t,s,i))};function Tp(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Zl(t)&&ye(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Zl(t)&&We(n)?!1:t in e}function Ap(e,t){const n=e._def.props;if(!n)return!1;const s=_t(t);return Array.isArray(n)?n.some(o=>_t(o)===s):Object.keys(n).some(o=>_t(o)===s)}const nu=new WeakMap,su=new WeakMap,Lo=Symbol("_moveCb"),Jl=Symbol("_enterCb"),Rp=e=>(delete e.props.mode,e),Ep=Rp({name:"TransitionGroup",props:Xe({},Yc,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=ar(),s=mc();let o,r;return xc(()=>{if(!o.length)return;const i=e.moveClass||`${e.name||"v"}-move`;if(!Np(o[0].el,n.vnode.el,i)){o=[];return}o.forEach(Lp),o.forEach(Mp);const l=o.filter(Pp);oi(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Xt(c,i),u.transform=u.webkitTransform=u.transitionDuration="";const f=c[Lo]=h=>{h&&h.target!==c||(!h||h.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",f),c[Lo]=null,Cn(c,i))};c.addEventListener("transitionend",f)}),o=[]}),()=>{const i=Ie(e),l=Xc(i);let a=i.tag||ee;if(o=[],r)for(let c=0;c<r.length;c++){const u=r[c];u.el&&u.el instanceof Element&&!u.el[ji]&&(o.push(u),Fn(u,Ps(u,l,s,n)),nu.set(u,ou(u.el)))}r=t.default?Pi(t.default()):[];for(let c=0;c<r.length;c++){const u=r[c];u.key!=null&&Fn(u,Ps(u,l,s,n))}return Z(a,null,r)}}}),Ip=Ep;function Lp(e){const t=e.el;t[Lo]&&t[Lo](),t[Jl]&&t[Jl]()}function Mp(e){su.set(e,ou(e.el))}function Pp(e){const t=nu.get(e),n=su.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const r=e.el,i=r.style,l=r.getBoundingClientRect();let a=1,c=1;return r.offsetWidth&&(a=l.width/r.offsetWidth),r.offsetHeight&&(c=l.height/r.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),i.transform=i.webkitTransform=`translate(${s/a}px,${o/c}px)`,i.transitionDuration="0s",e}}function ou(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function Np(e,t,n){const s=e.cloneNode(),o=e[is];o&&o.forEach(l=>{l.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&s.classList.add(l)),s.style.display="none";const r=t.nodeType===1?t:t.parentNode;r.appendChild(s);const{hasTransform:i}=Qc(s);return r.removeChild(s),i}const Mo=e=>{const t=e.props["onUpdate:modelValue"]||!1;return pe(t)?n=>po(t,n):t};function Op(e){e.target.composing=!0}function Yl(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ss=Symbol("_assign");function Xl(e,t,n){return t&&(e=e.trim()),n&&(e=Qo(e)),e}const ut={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[ss]=Mo(o);const r=s||o.props&&o.props.type==="number";On(e,t?"change":"input",i=>{i.target.composing||e[ss](Xl(e.value,n,r))}),(n||r)&&On(e,"change",()=>{e.value=Xl(e.value,n,r)}),t||(On(e,"compositionstart",Op),On(e,"compositionend",Yl),On(e,"change",Yl))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:r}},i){if(e[ss]=Mo(i),e.composing)return;const l=(r||e.type==="number")&&!/^0\d/.test(e.value)?Qo(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},Ql={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,On(e,"change",()=>{const o=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Qo(Po(r)):Po(r));e[ss](e.multiple?Jo(e._modelValue)?new Set(o):o:o[0]),e._assigning=!0,Ot(()=>{e._assigning=!1})}),e[ss]=Mo(s)},mounted(e,{value:t}){ea(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[ss]=Mo(n)},updated(e,{value:t}){e._assigning||ea(e,t)}};function ea(e,t){const n=e.multiple,s=pe(t);if(!(n&&!s&&!Jo(t))){for(let o=0,r=e.options.length;o<r;o++){const i=e.options[o],l=Po(i);if(n)if(s){const a=typeof l;a==="string"||a==="number"?i.selected=t.some(c=>String(c)===String(l)):i.selected=Cf(t,l)>-1}else i.selected=t.has(l);else if(qs(Po(i),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Po(e){return"_value"in e?e._value:e.value}const Dp=["ctrl","shift","alt","meta"],Bp={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Dp.some(n=>e[`${n}Key`]&&!t.includes(n))},At=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...r)=>{for(let i=0;i<t.length;i++){const l=Bp[t[i]];if(l&&l(o,t))return}return e(o,...r)}))},jp={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Bs=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const r=Rn(o.key);if(t.some(i=>i===r||jp[i]===r))return e(o)}))},Up=Xe({patchProp:$p},ap);let ta;function Fp(){return ta||(ta=Gh(Up))}const Gp=((...e)=>{const t=Fp().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=Hp(s);if(!o)return;const r=t._component;!ye(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,zp(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t});function zp(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Hp(e){return We(e)?document.querySelector(e):e}const js=N([]);let qp=0;function Wp(e,t="info",n=3500){const s=`toast_${++qp}`;js.value=[...js.value,{id:s,type:t,message:e}],n>0&&window.setTimeout(()=>ru(s),n)}function ru(e){js.value=js.value.filter(t=>t.id!==e)}function iu(){return{toasts:js,showToast:Wp,removeToast:ru}}const Vp={class:"toast-container"},Kp=["onClick"],Zp={class:"toast-icon"},Jp={class:"toast-msg"},Yp=Se({__name:"Toast",setup(e){const{toasts:t,removeToast:n}=iu(),s={info:"ℹ",success:"✓",error:"✗",warning:"⚠"};return(o,r)=>(y(),qe(Mi,{to:"body"},[d("div",Vp,[Z(Ip,{name:"toast"},{default:$t(()=>[(y(!0),b(ee,null,Ve(re(t),i=>(y(),b("div",{key:i.id,class:fe(["toast",`toast--${i.type}`]),onClick:l=>re(n)(i.id)},[d("span",Zp,I(s[i.type]),1),d("span",Jp,I(i.message),1)],10,Kp))),128))]),_:1})])]))}}),xe=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Xp=xe(Yp,[["__scopeId","data-v-9f4cde13"]]),dr=[{name:"compact",description:"压缩会话上下文",target:"backend"},{name:"model",description:"切换模型 / 思考强度",target:"local"},{name:"clear",description:"清空本地消息列表",target:"local"},{name:"new",description:"新建会话",target:"local"},{name:"help",description:"显示可用命令",target:"local"},{name:"auto",description:"切换为 auto 权限模式",target:"backend"},{name:"yes",description:"切换为 yolo 权限模式",target:"backend",aliases:["yolo"]},{name:"plan",description:"切换计划模式",target:"backend"},{name:"fork",description:"复制当前会话为新分支",target:"backend"},{name:"title",description:"重命名当前会话",target:"backend",aliases:["rename"],acceptsInput:!0},{name:"status",description:"查看会话状态",target:"local"},{name:"usage",description:"查看 Token 用量",target:"local"},{name:"btw",description:"快速侧问(不打断当前回合)",target:"backend",acceptsInput:!0}];function Qp(e){const t=e.toLowerCase();return dr.filter(n=>{var s;return n.name.startsWith(t)||((s=n.aliases)==null?void 0:s.some(o=>o.startsWith(t)))})}function eg(e){const t=e.toLowerCase(),n=dr.find(s=>{var o;return s.name===t||((o=s.aliases)==null?void 0:o.includes(t))});return(n==null?void 0:n.name)??t}function lu(){return["可用命令:",...dr.map(t=>{var s;return`${(s=t.aliases)!=null&&s.length?[t.name,...t.aliases].map(o=>`/${o}`).join(", "):`/${t.name}`} - ${t.description}`})].join(`
|
|
18
|
-
`)}function ro(e,t,n,s){return e===n&&t===s}function tg(e){return e.currentSessionId===e.targetSessionId&&e.snapshot.sessionId===e.targetSessionId&&e.currentSessionGeneration===e.targetSessionGeneration&&e.currentConnectionGeneration===e.targetConnectionGeneration&&e.currentPromptGeneration===e.targetPromptGeneration&&e.currentLiveGeneration===e.targetLiveGeneration&&(e.currentEpoch===0||e.snapshot.epoch===e.currentEpoch)&&(e.snapshot.epoch!==e.currentEpoch||e.snapshot.seq>=e.currentSeq)}function ng(e){return{objective:e.objective,completionCriterion:e.completionCriterion,replace:e.replace,budgets:e.budgets}}function sg(e){return{objective:e.objective,budgets:e.budgets}}function og(e,t,n){return e!==0&&n.epoch!==e?"resync":n.seq<=t?"duplicate":"apply"}function rg(e,t){return t.type==="goal.updated"?{...e,goal:t.snapshot}:t.type==="todo.updated"?{...e,todos:t.todos}:e}function ig(e){const t=[],n=new Map;for(const s of e){const o=s.phase??null;let r=n.get(o);r===void 0&&(r=t.length,n.set(o,r),t.push({phase:o,items:[]})),t[r].items.push(s)}return t}function lg(e){let t=null;return{schedule:()=>{t===null&&(t=requestAnimationFrame(()=>{t=null,e()}))},flushNow:()=>{t!==null&&(cancelAnimationFrame(t),t=null),e()},dispose:()=>{t!==null&&(cancelAnimationFrame(t),t=null)}}}const $e="/api/v1",ag=2*3e4;function cg(){const{showToast:e}=iu(),t=N("connecting"),n=N([]),s=N(!1),o=N(void 0),r=N([]),i=N({busy:!1}),l=N(null),a=N([]),c=N(!1),u=N(null),f=N(!1),h=N(null),p=N(null),g=N(null),_=X(()=>i.value.busy||f.value),k=N([]),w=N(null),x=N(!1),$=X(()=>p.value!==null&&!x.value),A=N(null),G=N([]),Q=N(null),C=N([]),R=N([]),L=N(null),J=N([]),ie=N(null),z=N([]),ve=N(""),O=N(null),P=N(null),te=N(!1);let q=null,ge=null,Ae=null,ke=null,ae=Date.now(),Ce=0,Te=0,Rt=0,Ke=0,Ze=0,xt=0,mt=0,Ft=0,ne=0,ce=null,m=!1,S=null,E=!1,F=!1;const B=new Map;let j=0,se=0,V=null,Y=0;const U=new Map;function ue(){const T=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/ws`;return w.value?`${T}?sessionId=${encodeURIComponent(w.value)}`:T}function oe(v){t.value=v}function le(v){(q==null?void 0:q.readyState)===WebSocket.OPEN&&q.send(JSON.stringify(v))}function de(){c.value=m||ce!==null}function _e(){ne++,ce=null,m=!1,S=null,c.value=!1,u.value=null}function Me(v,T){if(v!==null&&typeof v=="object"){const K=v.message;if(typeof K=="string")return K}return T}function Ee(){F||ke!==null||(ke=window.setTimeout(()=>{ke=null;const v=S;S=null,Le(v??void 0)},250))}async function Le(v){const T=p.value;if(!T)return;const K=n.value.length===0?100:void 0,W=Ke,he=Ze,we=xt,Ge=mt;try{const He=await fetch(`${$e}/sessions/${T}/snapshot${K?`?tail=${K}`:""}`);if(!He.ok){v!==void 0&&(ce==null?void 0:ce.generation)===v&&(S=v,Ee());return}const It=await He.json();if(!tg({snapshot:It,targetSessionId:T,currentSessionId:p.value,targetSessionGeneration:W,currentSessionGeneration:Ke,targetConnectionGeneration:he,currentConnectionGeneration:Ze,targetPromptGeneration:we,currentPromptGeneration:xt,targetLiveGeneration:Ge,currentLiveGeneration:mt,currentEpoch:Te,currentSeq:Ce})){v!==void 0&&(S=v),Ee();return}Qe(It,v)}catch{v!==void 0&&(ce==null?void 0:ce.generation)===v&&(S=v,Ee())}}function Qe(v,T){var pl;rt="",Kt="",Zt.clear();const K=n.value.filter(Lt=>Lt.local),W=B.keys().next().value,he=W?B.get(W):void 0,we=he?n.value.find(Lt=>Lt.id===he.messageId):void 0,Ge=!!(W&&v.messages.some(Lt=>Lt.clientMessageId===W)),He=!!(he&&!Ge&&he.connectionGeneration<Ze);He&&we&&(we.isError=!0);const It=we&&!Ge?[we]:[];n.value=[...v.messages.map(Lt=>({...Lt,id:Lt.id??et()})),...K,...It];for(let Lt=n.value.length-1;Lt>=0;Lt--){const eo=(pl=n.value[Lt])==null?void 0:pl.turnStats;if(eo&&typeof eo.turn=="number"&&eo.turn>0){j=eo.turn;break}}r.value=v.pendingApprovals,i.value={...v.status,busy:v.busy},s.value=!!v.olderAvailable,o.value=v.oldestSeq,l.value=v.goal,a.value=v.todos,T!==void 0&&ce!==null&&ce.generation===T&&ne===T&&(ce=null,de()),(Ge||He)&&(f.value=!1,E=!1,B.clear(),He&&e("消息未送达,已恢复连接。","error")),Ce=v.seq,Te=v.epoch,g.value=v.workDir}function et(){return`msg_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}function Et(v){Gt(),ae=Date.now(),ge=window.setInterval(()=>{if(Date.now()-ae>ag){q==null||q.close();return}le({type:"ping"})},v)}function Gt(){ge!==null&&(clearInterval(ge),ge=null)}function Ys(){if(F||Ae!==null)return;oe("reconnecting"),Rt++;const v=Math.min(1e3*2**Rt,3e4);Ae=window.setTimeout(()=>{Ae=null,Jt()},v)}function vt(v){switch(v.type){case"server_hello":{const T=v;p.value=T.sessionId,g.value=T.workDir,w.value=T.sessionId,x.value=T.active;const K=Te;Te=T.epoch,Et(T.heartbeat_ms),le({type:"client_hello",lastSeq:Ce,epoch:K}),K!==0&&K!==T.epoch&&(Ce=0),oe("connected"),Rt=0,T.active?(Le(),Vn(),Xs()):gd(T.sessionId).then(W=>{W&&p.value===T.sessionId&&(x.value=!0),Le(),Vn(),Xs()});break}case"event":{const T=og(Te,Ce,v);if(T==="resync"){Te=v.epoch,Ce=0,Le();break}if(T==="duplicate")break;Ce=v.seq,Te=v.epoch,mt++,ld(v.payload);break}case"user_message":{if(mt++,v.clientMessageId&&B.has(v.clientMessageId)){E=!0;break}n.value.push({id:et(),role:"user",content:v.text,clientMessageId:v.clientMessageId,tools:[],ts:Date.now()});break}case"approval_request":{mt++,r.value=[...r.value,{id:v.id,toolName:v.toolName,action:v.action,display:v.display}];break}case"approval_resolved":{mt++,r.value=r.value.filter(T=>T.id!==v.id);break}case"command_result":{const T=v.pendingMsgId?n.value.findIndex(K=>K.id===v.pendingMsgId):-1;if(T>=0){const K=n.value[T];n.value[T]={...K,content:v.message,isError:!v.ok,pending:!1}}else n.value.push({id:et(),role:"system",content:v.message,tools:[],isError:!v.ok,ts:Date.now(),local:!0});(v.command==="fork"||v.command==="title")&&Vn(),v.ok&&v.command==="compact"&&Le();break}case"resync_required":{Ce=0,Le();break}case"status":{mt++,i.value={...i.value,...v.status};break}case"error":{if(h.value=v.message,v.clientMessageId){const T=B.get(v.clientMessageId);if(T){B.delete(v.clientMessageId),f.value=!1,E=!1;const K=n.value.find(W=>W.id===T.messageId);K&&(K.isError=!0),e(`消息未发送:${v.message}`,"error")}}break}case"server_empty":{oe("idle");break}}}let rt="",Kt="";const Zt=new Map;let ll=!1;function id(){if(ll)return;const v=Wn();if(!v){rt="",Kt="",Zt.clear();return}if(rt&&(v.content+=rt,rt=""),Kt){const T=v.tools.find(K=>K.name==="thinking");T?T.output=(T.output??"")+Kt:v.tools.push({toolCallId:"thinking",name:"thinking",output:Kt}),Kt=""}if(Zt.size>0){for(const[T,K]of Zt){const W=v.tools.find(he=>he.toolCallId===T);W&&(W.output=K)}Zt.clear()}}const qn=lg(id);function ld(v){var K;const T=rg({goal:l.value,todos:a.value},v);switch(l.value=T.goal,a.value=T.todos,v.type==="goal.updated"&&ce!==null&&ce.generation===ne&&(ce=null,S=null,de()),v.type){case"turn.started":{E&&(f.value=!1,E=!1,B.clear()),qn.flushNow(),i.value={...i.value,busy:!0},j+=1,se=Date.now(),V=null,Y=0,U.clear(),n.value.push({id:et(),role:"assistant",content:"",tools:[],ts:Date.now(),model:i.value.model,turnStats:{turn:j,step:0,status:"running",firstTokenMs:null,llmMs:0,toolMs:0,tokens:null,tokensPerSec:null}});break}case"assistant.delta":{V===null&&(V=Date.now()),rt+=String(v.delta),qn.schedule();break}case"thinking.delta":{V===null&&(V=Date.now()),Kt+=String(v.delta),qn.schedule();break}case"tool.call.started":{const W=Wn();W&&(W.tools.push({toolCallId:String(v.toolCallId),name:String(v.name),args:v.args}),W.turnStats&&(W.turnStats.step+=1)),U.set(String(v.toolCallId),Date.now());break}case"tool.result":{Zt.delete(String(v.toolCallId));const W=U.get(String(v.toolCallId));W!==void 0&&(Y+=Date.now()-W,U.delete(String(v.toolCallId)));const he=Wn();if(he){const we=he.tools.find(Ge=>Ge.toolCallId===v.toolCallId);we&&(we.output=String(v.output),we.isError=!!v.isError)}break}case"tool.progress":{Zt.set(String(v.toolCallId),String(v.message??v.output)),qn.schedule();break}case"turn.ended":{if(qn.flushNow(),i.value={...i.value,busy:!1},v.reason==="failed"){const He=Wn();He&&(He.isError=!0),h.value=Me(v.error,"Turn failed")}const W=Wn(),he=Date.now()-se,we=(K=i.value.usage)==null?void 0:K.currentTurn,Ge=we?we.inputOther+we.output+we.inputCacheRead+we.inputCacheCreation:null;W&&W.turnStats&&(W.turnStats.status="done",W.turnStats.llmMs=he,W.turnStats.toolMs=Y,W.turnStats.firstTokenMs=V!==null?V-se:null,W.turnStats.tokens=Ge,W.turnStats.tokensPerSec=Ge!==null&&he>0?Math.round(Ge/he*1e3):null),Vn(),Xs();break}case"session.meta.updated":{const W={};v.model!==void 0&&(W.model=v.model),v.contextTokens!==void 0&&(W.contextTokens=v.contextTokens),v.maxContextTokens!==void 0&&(W.maxContextTokens=v.maxContextTokens),v.contextUsage!==void 0&&(W.contextUsage=v.contextUsage),i.value={...i.value,...W};break}case"agent.status.updated":{const W={};if(v.model!==void 0&&(W.model=v.model),v.thinkingLevel!==void 0&&(W.thinkingLevel=v.thinkingLevel),v.contextTokens!==void 0&&(W.contextTokens=v.contextTokens),v.maxContextTokens!==void 0&&(W.maxContextTokens=v.maxContextTokens),v.contextUsage!==void 0&&(W.contextUsage=v.contextUsage),v.usage!==void 0){W.usage=v.usage;const he=v.usage;if(he!=null&&he.currentTurn){const we=Wn(),Ge=he.currentTurn.inputOther+he.currentTurn.output+he.currentTurn.inputCacheRead+he.currentTurn.inputCacheCreation;we!=null&&we.turnStats&&we.turnStats.status==="done"&&we.turnStats.tokens===null&&(we.turnStats.tokens=Ge,we.turnStats.tokensPerSec=we.turnStats.llmMs?Math.round(Ge/we.turnStats.llmMs*1e3):null)}}i.value={...i.value,...W};break}case"error":{h.value=Me(v.error,"Unknown error");break}}}function Wn(){for(let v=n.value.length-1;v>=0;v--)if(n.value[v].role==="assistant")return n.value[v];return null}function ad(){if(!F){if(Ae!==null&&(clearTimeout(Ae),Ae=null),q!==null){try{q.close()}catch{}q=null}Rt=0,Jt()}}async function cd(){var K;const v=p.value,T=o.value;if(!v||T===void 0)return 0;try{const W=await fetch(`${$e}/sessions/${v}/messages?before=${T}&tail=50`);if(!W.ok)return 0;const he=await W.json();if(he.messages.length===0)return 0;const we=he.messages.map(Ge=>({...Ge,id:Ge.id??et()}));return n.value=[...we,...n.value],o.value=((K=we[0])==null?void 0:K.seq)??T,s.value=he.hasMore,we.length}catch{return 0}}function Jt(){if(F||q&&(q.readyState===WebSocket.CONNECTING||q.readyState===WebSocket.OPEN))return;oe("connecting"),h.value=null,_e(),Ze++;const v=new WebSocket(ue());q=v,v.onclose=T=>{if(q===v&&(q=null,Gt(),t.value!=="idle")){if(T.code===1008){Ke++,_e(),p.value=null,w.value=null,x.value=!1,l.value=null,a.value=[],oe("idle");return}oe("disconnected"),Ys()}},v.onerror=()=>{q===v&&oe("reconnecting")},v.onmessage=T=>{if(q!==v)return;ae=Date.now();let K;try{K=JSON.parse(T.data)}catch{return}vt(K)}}function ud(v){if(!v||_.value)return;if(t.value==="idle"){e("暂无会话,请先新建会话。","warning");return}if(t.value!=="connected"){e("连接已断开,正在尝试重连...","error"),Jt();return}const T=`client_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,K=et();B.set(T,{messageId:K,connectionGeneration:Ze}),xt++,E=!1,f.value=!0,n.value.push({id:K,role:"user",content:v,clientMessageId:T,tools:[],ts:Date.now()}),le({type:"prompt",text:v,clientMessageId:T})}function dd(){le({type:"abort"})}function fd(v,T){if(t.value==="idle"){e("暂无会话,请先新建会话。","warning");return}if(t.value!=="connected"){e("连接已断开,命令未发送。","error"),Jt();return}if(_.value&&v!=="btw"){e(`会话忙碌中,无法执行 /${v},请稍后再试。`,"warning");return}const K=["compact","plan","auto","yes","fork","title"];let W=null;K.includes(v)&&(W=et(),n.value.push({id:W,role:"system",content:`正在执行 /${v}${T?` ${T}`:""}...`,tools:[],pending:!0,ts:Date.now(),local:!0})),le({type:"command",command:v,...T?{args:T}:{},...W?{pendingMsgId:W}:{}})}function hd(){n.value=[],r.value=[]}function al(v){n.value.push({id:et(),role:"system",content:v,tools:[],ts:Date.now(),local:!0})}function pd(v,T,K,W){if(t.value!=="connected"){e("连接已断开,审批结果未发送。","error"),Jt();return}r.value=r.value.filter(he=>he.id!==v),le({type:"approval_response",id:v,decision:T,...K?{feedback:K}:{},...W?{scope:W}:{}})}async function Vn(){try{const v=await fetch(`${$e}/sessions`);if(!v.ok)return;k.value=await v.json()}catch{}}async function gd(v){const T=Ke,K=Ze;try{return(await fetch(`${$e}/sessions/${v}/activate`,{method:"POST"})).ok&&Ze===K&&ro(p.value,Ke,v,T)}catch{return!1}}async function Xs(){try{const v=await fetch(`${$e}/git/status`);if(!v.ok)return;const T=await v.json();A.value=T.isRepo?T:null}catch{}}async function cl(){try{const v=await fetch(`${$e}/models`);if(!v.ok)return;const T=await v.json();G.value=T.models}catch{}}const yr=N({});async function md(){try{const v=await fetch(`${$e}/like`);if(!v.ok)return;yr.value=await v.json()}catch{}}async function vd(v){try{return(await fetch(`${$e}/like`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(v)})).ok?(yr.value=v,!0):!1}catch{return!1}}async function ul(v,T,K){const W=p.value;if(!W)return;const he=Ke,we=Ze,Ge=++Ft;try{const He=await fetch(`${$e}/sessions/${W}/${v}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)}),It=await He.json();if(p.value!==W||Ke!==he||Ze!==we||Ft!==Ge)return;if(!He.ok){e(It.message??`请求失败(HTTP ${He.status})`,"error");return}It.status&&(i.value={...i.value,...It.status}),al(K)}catch(He){if(p.value!==W||Ke!==he||Ze!==we||Ft!==Ge)return;e(`请求失败:${He instanceof Error?He.message:String(He)}`,"error")}}async function yd(v){v!==i.value.model&&await ul("model",{model:v},`已切换模型:${v}`)}async function bd(v){v!==i.value.thinkingLevel&&await ul("thinking",{level:v},`思考强度已切换为 ${v}`)}async function Qs(v,T,K,W){const he=p.value;if(!he)return u.value="暂无可操作的会话。",null;if(t.value!=="connected")return u.value="连接已断开,请等待重连后再试。",null;if($.value)return u.value="当前会话已归档,无法修改 Goal。",null;if(m)return u.value="正在处理上一个请求,请稍候。",null;ce!==null&&(ce=null,de());const we=Ke,Ge=++ne;m=!0,de(),u.value=null;try{const He=await fetch(`${$e}/sessions/${he}/goal${v}`,{method:T,headers:{"Content-Type":"application/json"},body:JSON.stringify(K)}),It=await He.json().catch(()=>({}));return!ro(p.value,Ke,he,we)||ne!==Ge?null:He.ok?(W&&(ce={generation:Ge},S=Ge),It):(u.value=typeof It.message=="string"?It.message:`请求失败(HTTP ${He.status})`,null)}catch(He){return ro(p.value,Ke,he,we)&&ne===Ge&&(u.value=`请求失败:${He instanceof Error?He.message:String(He)}`),null}finally{ro(p.value,Ke,he,we)&&ne===Ge&&(m=!1,de())}}async function kd(v){const T=await Qs("/refine","POST",{description:v},!1);return typeof(T==null?void 0:T.objective)=="string"?T.objective:null}async function wd(v){return await Qs("","POST",ng(v),!0)===null?!1:(ce!==null&&Le(ce.generation),!0)}async function _d(v){return await Qs("","PATCH",sg(v),!0)===null?!1:(ce!==null&&Le(ce.generation),!0)}async function br(v){return await Qs(v,"POST",{},!0)===null?!1:(ce!==null&&Le(ce.generation),!0)}function Sd(){return br("/pause")}function xd(){return br("/resume")}function Cd(){return br("/cancel")}async function $d(){try{const v=await fetch(`${$e}/sessions`,{method:"POST"});if(!v.ok){e(`新建会话失败(HTTP ${v.status})`,"error");return}const T=await v.json();k.value=[T,...k.value],await kr(T.sessionId)}catch(v){e(`新建会话失败:${v instanceof Error?v.message:String(v)}`,"error")}}async function kr(v){w.value===v&&t.value==="connected"||(w.value=v,p.value=v,Ke++,_e(),Ce=0,Te=0,n.value=[],r.value=[],i.value={busy:!1},l.value=null,a.value=[],Q.value=null,C.value=[],R.value=[],L.value=null,J.value=[],ie.value=null,z.value=[],ve.value="",x.value=!1,f.value=!1,E=!1,B.clear(),Ae!==null&&(clearTimeout(Ae),Ae=null),ke!==null&&(clearTimeout(ke),ke=null),q&&(q.onclose=null,q.close(),q=null),Gt(),Jt())}async function Td(v){try{const T=await fetch(`${$e}/sessions/${v}`,{method:"DELETE"});if(!T.ok){e(`删除会话失败(HTTP ${T.status})`,"error");return}if(k.value=k.value.filter(K=>K.sessionId!==v),w.value===v){const K=k.value[0];K?await kr(K.sessionId):(Ke++,_e(),p.value=null,w.value=null,x.value=!1,Ce=0,Te=0,n.value=[],r.value=[],i.value={busy:!1},l.value=null,a.value=[],Q.value=null,C.value=[],R.value=[],L.value=null,J.value=[],ie.value=null,z.value=[],ve.value="",f.value=!1,E=!1,B.clear(),q&&(q.onclose=null,q.close(),q=null),Gt(),oe("idle"))}}catch(T){e(`删除会话失败:${T instanceof Error?T.message:String(T)}`,"error")}}async function Ad(v){try{const T=await fetch(`${$e}/sessions/${v}/export`);if(!T.ok){e(`导出会话失败(HTTP ${T.status})`,"error");return}const K=await T.blob(),W=URL.createObjectURL(K),he=document.createElement("a");he.href=W,he.download=`${v}.md`,he.click(),URL.revokeObjectURL(W)}catch(T){e(`导出会话失败:${T instanceof Error?T.message:String(T)}`,"error")}}async function us(){const v=p.value;if(v)try{const T=await fetch(`${$e}/sessions/${v}/status`);if(!T.ok)return;const K=await T.json();i.value={...i.value,...K}}catch{}}async function Rd(){const v=p.value;if(v)try{const T=await fetch(`${$e}/sessions/${v}/usage`);if(!T.ok)return;const K=await T.json();i.value={...i.value,usage:K}}catch{}}async function Ed(){const v=p.value;if(v)try{const T=await fetch(`${$e}/sessions/${v}/context`);if(!T.ok)return;const K=await T.json();K.tokenCount!==void 0&&(i.value={...i.value,contextTokens:K.tokenCount})}catch{}}async function Id(){const v=p.value;if(v)try{const T=await fetch(`${$e}/sessions/${v}/plan`);if(!T.ok)return;Q.value=await T.json()}catch{}}async function Ld(){const v=p.value;if(!v)return!1;try{return(await fetch(`${$e}/sessions/${v}/plan/clear`,{method:"POST"})).ok?(Q.value=null,!0):!1}catch{return!1}}async function at(v,T){const K=p.value;if(!K)return!1;if(t.value!=="connected")return e("连接已断开,操作未发送。","error"),Jt(),!1;try{const W=await fetch(`${$e}/sessions/${K}/${v}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T??{})});if(!W.ok){const he=await W.json().catch(()=>({}));return e(he.message??`操作失败(HTTP ${W.status})`,"error"),!1}return!0}catch(W){return e(`操作失败:${W instanceof Error?W.message:String(W)}`,"error"),!1}}async function Md(v){const T=await at("permission",{mode:v});return T&&await us(),T}async function Pd(v,T){const K=await at("plan",{enabled:v,...T?{strategy:T}:{}});return K&&await us(),K}async function Nd(v){const T=await at("wolfpack",{enabled:v});return T&&await us(),T}async function Od(v,T){const K=await at("rlm",{enabled:v,...T!==void 0?{maxDepth:T}:{}});return K&&await us(),K}async function Dd(v=1){return at("undo",{count:v})}async function Bd(v){return at("compact",v?{instruction:v}:{})}async function jd(){const v=p.value;if(v)try{const T=await fetch(`${$e}/sessions/${v}/skills`);if(!T.ok)return;C.value=await T.json()}catch{}}async function Ud(v,T){return at(`skills/${encodeURIComponent(v)}/activate`,T?{args:T}:{})}async function Fd(v){const T=p.value;if(!T)return!1;try{return(await fetch(`${$e}/sessions/${T}/skills/${encodeURIComponent(v)}`,{method:"DELETE"})).ok?(C.value=C.value.filter(W=>W.name!==v),!0):!1}catch{return!1}}async function wr(){const v=p.value;if(v)try{const T=await fetch(`${$e}/sessions/${v}/plugins`);if(!T.ok)return;R.value=await T.json()}catch{}}async function Gd(v){const T=p.value;if(T)try{const K=await fetch(`${$e}/sessions/${T}/plugins/${encodeURIComponent(v)}`);if(!K.ok)return;L.value=await K.json()}catch{}}async function zd(v){const T=p.value;if(!T)return null;try{const K=await fetch(`${$e}/sessions/${T}/plugins/install`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:v})});if(!K.ok)return null;const W=await K.json();return await wr(),W}catch{return null}}async function Hd(v,T){return at(`plugins/${encodeURIComponent(v)}/enable`,{enabled:T})}async function qd(v,T,K){return at(`plugins/${encodeURIComponent(v)}/mcp/${encodeURIComponent(T)}/enable`,{enabled:K})}async function Wd(v){const T=p.value;if(!T)return!1;try{return(await fetch(`${$e}/sessions/${T}/plugins/${encodeURIComponent(v)}`,{method:"DELETE"})).ok?(R.value=R.value.filter(W=>W.id!==v),!0):!1}catch{return!1}}async function Vd(){const v=p.value;if(!v)return null;try{const T=await fetch(`${$e}/sessions/${v}/plugins/reload`,{method:"POST"});if(!T.ok)return null;const K=await T.json();return await wr(),K}catch{return null}}async function Kd(v){return at(`plugins/${encodeURIComponent(v)}/activate`)}async function Zd(v){return at(`plugins/${encodeURIComponent(v)}/deactivate`)}async function Jd(v){return at(`plugins/${encodeURIComponent(v)}/inject`)}async function Yd(){const v=p.value;if(v)try{const T=await fetch(`${$e}/sessions/${v}/mcp`);if(!T.ok)return;J.value=await T.json()}catch{}}async function Xd(){const v=p.value;if(v)try{const T=await fetch(`${$e}/sessions/${v}/mcp/startup-metrics`);if(!T.ok)return;ie.value=await T.json()}catch{}}async function Qd(v,T){return at("mcp/add",{name:v,config:T})}async function ef(v){return at(`mcp/${encodeURIComponent(v)}/reconnect`)}async function tf(v){return at(`mcp/${encodeURIComponent(v)}/stop`)}async function nf(v){const T=p.value;if(!T)return!1;try{return(await fetch(`${$e}/sessions/${T}/mcp/${encodeURIComponent(v)}`,{method:"DELETE"})).ok?(J.value=J.value.filter(W=>W.name!==v),!0):!1}catch{return!1}}async function sf(v,T){const K=p.value;if(K)try{const W=new URLSearchParams;v!==void 0&&W.set("activeOnly",String(v)),T!==void 0&&W.set("limit",String(T));const he=W.toString(),we=await fetch(`${$e}/sessions/${K}/tasks${he?`?${he}`:""}`);if(!we.ok)return;z.value=await we.json()}catch{}}async function of(v,T){const K=p.value;if(K)try{const W=T!==void 0?`?tail=${T}`:"",he=await fetch(`${$e}/sessions/${K}/tasks/${encodeURIComponent(v)}/output${W}`);if(!he.ok)return;const we=await he.json();ve.value=we.output}catch{}}async function rf(v,T){return at(`tasks/${encodeURIComponent(v)}/stop`,T?{reason:T}:{})}async function dl(){try{const v=await fetch(`${$e}/config`);if(!v.ok)return;O.value=await v.json()}catch{}}async function lf(v){try{const T=await fetch(`${$e}/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({patch:v})});return T.ok?(O.value=await T.json(),!0):!1}catch{return!1}}async function af(v){try{return(await fetch(`${$e}/config/providers/${encodeURIComponent(v)}`,{method:"DELETE"})).ok?(await dl(),!0):!1}catch{return!1}}async function cf(){try{const v=await fetch(`${$e}/experimental-flags`);if(!v.ok)return;P.value=await v.json()}catch{}}async function uf(){try{if(!(await fetch(`${$e}/preflight`)).ok)return;te.value=!0}catch{}}Jt(),Vn(),cl();const fl=()=>{Jt()},hl=()=>{!document.hidden&&t.value!=="connected"&&Jt()};return window.addEventListener("online",fl),document.addEventListener("visibilitychange",hl),Vt(()=>{F=!0,ll=!0,qn.dispose(),window.removeEventListener("online",fl),document.removeEventListener("visibilitychange",hl),Gt(),Ae!==null&&(clearTimeout(Ae),Ae=null),ke!==null&&(clearTimeout(ke),ke=null),q&&(q.onclose=null,q.close(),q=null)}),{connectionStatus:t,messages:n,pendingApprovals:r,status:i,goal:l,todos:a,goalRequestPending:c,goalRequestError:u,error:h,sessionId:p,workDir:g,isBusy:_,isArchived:$,sessions:k,currentSessionId:w,gitStatus:A,models:G,like:yr,fetchLike:md,updateLike:vd,sendPrompt:ud,sendCommand:fd,clearMessages:hd,appendSystemMessage:al,abort:dd,resolveApproval:pd,fetchSessions:Vn,fetchGitStatus:Xs,fetchModels:cl,reconnectNow:ad,olderAvailable:s,oldestSeq:o,loadOlderMessages:cd,switchModel:yd,switchThinking:bd,refineGoal:kd,createGoal:wd,updateGoal:_d,pauseGoal:Sd,resumeGoal:xd,cancelGoal:Cd,createSession:$d,switchSession:kr,deleteSession:Td,exportSession:Ad,fetchSnapshot:Le,fetchSessionStatus:us,fetchSessionUsage:Rd,fetchSessionContext:Ed,fetchSessionPlan:Id,sessionPlan:Q,clearPlan:Ld,switchPermission:Md,switchPlanMode:Pd,switchWolfpack:Nd,switchRlm:Od,undoHistory:Dd,compact:Bd,skills:C,fetchSkills:jd,activateSkill:Ud,removeSkill:Fd,plugins:R,pluginInfo:L,fetchPlugins:wr,fetchPluginInfo:Gd,installPlugin:zd,setPluginEnabled:Hd,setPluginMcpServerEnabled:qd,removePlugin:Wd,reloadPlugins:Vd,activatePlugin:Kd,deactivatePlugin:Zd,injectPlugin:Jd,mcpServers:J,mcpStartupMetrics:ie,fetchMcpServers:Yd,fetchMcpStartupMetrics:Xd,addMcpServer:Qd,reconnectMcpServer:ef,stopMcpServer:tf,removeMcpServer:nf,backgroundTasks:z,backgroundTaskOutput:ve,fetchBackgroundTasks:sf,fetchBackgroundTaskOutput:of,stopBackgroundTask:rf,config:O,fetchConfig:dl,setConfig:lf,removeProvider:af,experimentalFlags:P,fetchExperimentalFlags:cf,preflightOk:te,preflight:uf}}const ug=["type","disabled"],dg=Se({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(y(),b("button",{class:fe(["ui-btn",[`ui-btn--${e.variant}`,`ui-btn--${e.size}`]]),type:e.type,disabled:e.disabled},[mo(t.$slots,"default",{},void 0)],10,ug))}}),Jn=xe(dg,[["__scopeId","data-v-2340e137"]]),fg={key:0,class:"approval-card"},hg={class:"approval-header"},pg={class:"approval-title"},gg={class:"tool-name"},mg={class:"action-summary"},vg={key:0,class:"approval-count"},yg={class:"approval-action"},bg={key:0,class:"feedback-area"},kg={class:"approval-buttons"},wg={key:0,class:"busy-indicator","aria-label":"处理中"},_g=Se({__name:"ApprovalCard",props:{approvals:{}},emits:["resolve"],setup(e,{emit:t}){const n=e,s=t,o=N(!1),r=N(!1),i=N(""),l=N(new Set),a=X(()=>n.approvals[0]);Oe(()=>n.approvals.map(g=>g.id).join(","),()=>{r.value=!1,i.value="";const g=new Set(n.approvals.map(_=>_.id));l.value=new Set([...l.value].filter(_=>g.has(_)))});function c(g){return typeof g.display=="string"?g.display:g.display&&typeof g.display=="object"&&"description"in g.display?String(g.display.description??""):g.action??"执行该操作"}function u(g){return l.value.has(g)}function f(g,_,k){const w=a.value;!w||u(w.id)||(l.value=new Set([...l.value,w.id]),s("resolve",w.id,g,_,k))}function h(){const g=i.value.trim();g&&f("rejected",g)}function p(g){if(!a.value||o.value)return;const k=g.target;if(k&&(k.tagName==="TEXTAREA"||k.tagName==="INPUT")){r.value&&g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),h());return}switch(g.key){case"1":g.preventDefault(),f("approved",void 0,"once");break;case"2":g.preventDefault(),f("approved",void 0,"session");break;case"3":g.preventDefault(),f("rejected");break;case"4":g.preventDefault(),r.value=!r.value;break}}return Ut(()=>window.addEventListener("keydown",p)),Vt(()=>window.removeEventListener("keydown",p)),(g,_)=>e.approvals.length?(y(),b("div",fg,[o.value?(y(),b("button",{key:0,class:"approval-minibar",onClick:_[0]||(_[0]=k=>o.value=!1)}," ⚠ "+I(e.approvals.length)+" 个待审批请求 — 点击展开 ",1)):a.value?(y(),b(ee,{key:1},[d("div",hg,[_[7]||(_[7]=d("span",{class:"approval-icon"},"⚠",-1)),d("span",pg,[d("span",gg,I(a.value.toolName),1),d("span",mg,I(c(a.value)),1)]),e.approvals.length>1?(y(),b("span",vg,"+"+I(e.approvals.length-1),1)):D("",!0),d("button",{class:"icon-btn",title:"最小化","aria-label":"最小化",onClick:_[1]||(_[1]=k=>o.value=!0)}," — ")]),d("pre",yg,I(c(a.value)),1),r.value?(y(),b("div",bg,[Ye(d("textarea",{"onUpdate:modelValue":_[2]||(_[2]=k=>i.value=k),class:"feedback-input",rows:"2",name:"approval-feedback","aria-label":"拒绝反馈",placeholder:"输入反馈,Enter 提交(将作为拒绝原因反馈给 Agent)"},null,512),[[ut,i.value]])])):D("",!0),d("div",kg,[Z(Jn,{variant:"primary",disabled:u(a.value.id),onClick:_[3]||(_[3]=k=>f("approved",void 0,"once"))},{default:$t(()=>[..._[8]||(_[8]=[d("kbd",null,"1",-1),Re(" 批准 ",-1)])]),_:1},8,["disabled"]),Z(Jn,{variant:"secondary",disabled:u(a.value.id),onClick:_[4]||(_[4]=k=>f("approved",void 0,"session"))},{default:$t(()=>[..._[9]||(_[9]=[d("kbd",null,"2",-1),Re(" 会话批准 ",-1)])]),_:1},8,["disabled"]),Z(Jn,{variant:"danger",disabled:u(a.value.id),onClick:_[5]||(_[5]=k=>f("rejected"))},{default:$t(()=>[..._[10]||(_[10]=[d("kbd",null,"3",-1),Re(" 拒绝 ",-1)])]),_:1},8,["disabled"]),Z(Jn,{variant:"secondary",class:fe({"feedback-active":r.value}),disabled:u(a.value.id),onClick:_[6]||(_[6]=k=>r.value=!r.value)},{default:$t(()=>[..._[11]||(_[11]=[d("kbd",null,"4",-1),Re(" 反馈 ",-1)])]),_:1},8,["class","disabled"]),u(a.value.id)?(y(),b("span",wg,[..._[12]||(_[12]=[d("span",{class:"spinner"},null,-1),Re(" 处理中… ",-1)])])):D("",!0)])],64)):D("",!0)])):D("",!0)}}),Sg=xe(_g,[["__scopeId","data-v-cee65a74"]]),xg=["title","aria-label"],Cg=["width","height","viewBox"],$g=["cx","cy","r"],Tg=["cx","cy","r","stroke-dasharray","stroke-dashoffset","transform"],Mr=2,Ag=Se({__name:"ContextRing",props:{usage:{default:void 0},size:{default:16}},setup(e){hp(a=>({c1c51b42:l.value}));const t=e,n=X(()=>{if(t.usage===void 0||Number.isNaN(t.usage))return 0;const a=t.usage>1?t.usage/100:t.usage;return Math.min(1,Math.max(0,a))}),s=X(()=>Math.round(n.value*100)),o=X(()=>(t.size-Mr)/2),r=X(()=>2*Math.PI*o.value),i=X(()=>r.value*(1-n.value)),l=X(()=>n.value>=.9?"var(--color-danger)":n.value>=.7?"var(--color-warning)":"var(--color-accent)");return(a,c)=>(y(),b("span",{class:"context-ring",role:"img",title:`上下文占用 ${s.value}%`,"aria-label":`上下文占用 ${s.value}%`},[(y(),b("svg",{width:e.size,height:e.size,viewBox:`0 0 ${e.size} ${e.size}`},[d("circle",{class:"ring-track",cx:e.size/2,cy:e.size/2,r:o.value,"stroke-width":Mr,fill:"none"},null,8,$g),d("circle",{class:"ring-value",cx:e.size/2,cy:e.size/2,r:o.value,"stroke-width":Mr,fill:"none","stroke-linecap":"round","stroke-dasharray":r.value,"stroke-dashoffset":i.value,transform:`rotate(-90 ${e.size/2} ${e.size/2})`},null,8,Tg)],8,Cg))],8,xg))}}),au=xe(Ag,[["__scopeId","data-v-c3d987c6"]]),Rg=["onKeydown"],Eg={key:0,class:"picker-empty"},Ig={class:"picker-group-title"},Lg=["onClick"],Mg={class:"row-main"},Pg={class:"row-name"},Ng={class:"row-alias"},Og={class:"row-meta"},Dg={key:0,class:"row-check"},Bg={class:"picker-thinking"},jg={class:"thinking-options"},Ug=["onClick"],Fg=Se({__name:"ModelPicker",props:{models:{},currentModel:{},currentThinking:{}},emits:["apply-model","apply-thinking","close"],setup(e,{emit:t}){const n=e,s=t,o=["off","low","medium","high"],r={off:"关闭",low:"低",medium:"中",high:"高",xhigh:"超高",max:"最大"},i=N(""),l=N(null);Ut(()=>{var C;(C=l.value)==null||C.focus()});const a=X(()=>{const C=i.value.trim().toLowerCase();return C?n.models.filter(R=>R.alias.toLowerCase().includes(C)||R.provider.toLowerCase().includes(C)||(R.displayName??"").toLowerCase().includes(C)):n.models}),c=X(()=>{const C=new Map;for(const R of a.value){const L=C.get(R.provider)??[];L.push(R),C.set(R.provider,L)}return[...C.entries()].map(([R,L])=>({provider:R,models:L}))}),u=X(()=>n.models.find(C=>C.alias===n.currentModel)),f=X(()=>{var C;return((C=u.value)==null?void 0:C.thinkingLevels)??o});function h(C){return r[C]??C}function p(C){return C>=1e3?`${Math.round(C/1e3)}k`:String(C)}function g(C){return C.displayName??C.model}const _=N(null);function k(C){_.value&&!_.value.contains(C.target)&&s("close")}Ut(()=>document.addEventListener("mousedown",k,!0)),Vt(()=>document.removeEventListener("mousedown",k,!0));function w(C){C!==n.currentModel&&s("apply-model",C),s("close")}const x=N(null);function $(){const C=x.value;return C?Array.from(C.querySelectorAll(".picker-row")):[]}function A(){var C;(C=$()[0])==null||C.focus()}function G(C){var J,ie,z;if(C.key!=="ArrowDown"&&C.key!=="ArrowUp")return;const R=$();if(R.length===0)return;const L=R.indexOf(document.activeElement);C.preventDefault(),L===-1?(J=R[0])==null||J.focus():C.key==="ArrowDown"?(ie=R[(L+1)%R.length])==null||ie.focus():(z=R[(L-1+R.length)%R.length])==null||z.focus()}function Q(C){C!==n.currentThinking&&s("apply-thinking",C)}return(C,R)=>(y(),b("div",{ref_key:"rootRef",ref:_,class:"model-picker",role:"dialog","aria-label":"模型选择",onKeydown:R[1]||(R[1]=Bs(At(L=>s("close"),["stop"]),["esc"]))},[Ye(d("input",{ref_key:"searchRef",ref:l,"onUpdate:modelValue":R[0]||(R[0]=L=>i.value=L),class:"picker-search",type:"text",placeholder:"搜索模型…",id:"model-search-input",name:"model-search",autocomplete:"off",spellcheck:"false",onKeydown:Bs(At(A,["prevent"]),["arrow-down"])},null,40,Rg),[[ut,i.value]]),d("div",{ref_key:"listRef",ref:x,class:"picker-list",onKeydown:G},[c.value.length===0?(y(),b("div",Eg,"无匹配模型")):D("",!0),(y(!0),b(ee,null,Ve(c.value,L=>(y(),b("div",{key:L.provider,class:"picker-group"},[d("div",Ig,I(L.provider),1),(y(!0),b(ee,null,Ve(L.models,J=>(y(),b("button",{key:J.alias,class:fe(["picker-row",{active:J.alias===e.currentModel}]),onClick:ie=>w(J.alias)},[d("span",Mg,[d("span",Pg,I(g(J)),1),d("span",Ng,I(J.alias),1)]),d("span",Og,I(p(J.maxContextSize)),1),J.alias===e.currentModel?(y(),b("span",Dg,"✓")):D("",!0)],10,Lg))),128))]))),128))],544),d("div",Bg,[R[2]||(R[2]=d("span",{class:"thinking-label"},"思考强度",-1)),d("div",jg,[(y(!0),b(ee,null,Ve(f.value,L=>(y(),b("button",{key:L,class:fe(["thinking-btn",{active:L===e.currentThinking}]),onClick:J=>Q(L)},I(h(L)),11,Ug))),128))])])],544))}}),Gg=xe(Fg,[["__scopeId","data-v-d63e78a7"]]),zg={class:"slash-menu",role:"listbox","aria-label":"斜杠命令"},Hg=["aria-selected","onMousedown","onMouseenter"],qg={class:"slash-name"},Wg={key:0,class:"slash-aliases"},Vg={class:"slash-desc"},Kg={key:0,class:"slash-badge slash-badge-input"},Zg={key:1,class:"slash-badge"},Jg=Se({__name:"SlashMenu",props:{commands:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const n=t;return(s,o)=>(y(),b("div",zg,[(y(!0),b(ee,null,Ve(e.commands,(r,i)=>{var l;return y(),b("button",{key:r.name,class:fe(["slash-item",{active:i===e.activeIndex}]),role:"option","aria-selected":i===e.activeIndex,onMousedown:At(a=>n("select",r),["prevent"]),onMouseenter:a=>n("hover",i)},[d("span",qg,[Re("/"+I(r.name),1),(l=r.aliases)!=null&&l.length?(y(),b("span",Wg,I(r.aliases.map(a=>`/${a}`).join(" ")),1)):D("",!0)]),d("span",Vg,I(r.description),1),r.acceptsInput?(y(),b("span",Kg,"输入参数")):D("",!0),r.target==="backend"?(y(),b("span",Zg,"服务端")):D("",!0)],42,Hg)}),128)),o[0]||(o[0]=d("div",{class:"slash-hint"},"↑↓ 选择 · Enter/Tab 执行 · Esc 关闭",-1))]))}}),Yg=xe(Jg,[["__scopeId","data-v-ad1b92cd"]]),Xg=["width","height"],Qg={key:0,d:"M4 7h16M4 12h16M4 17h16"},em={key:1,d:"M12 5v14M5 12h14"},tm={key:5,d:"M4 6h16M7 12h10M10 18h4"},nm={key:6,d:"M12 3v12m0 0 4-4m-4 4-4-4M5 20h14"},sm={key:7,d:"M4 7h16M9 7V4h6v3m3 0-1 13H7L6 7m4 4v5m4-5v5"},om={key:8,d:"M3 12h4l2-7 4 14 2-7h6"},rm={key:10,d:"m15 18-6-6 6-6"},im={key:11,d:"m9 18 6-6-6-6"},lm={key:12,d:"m6 9 6 6 6-6"},am={key:16,d:"M20 15.5A8.5 8.5 0 0 1 8.5 4 8.5 8.5 0 1 0 20 15.5Z"},cm={key:18,d:"M5 9a11 11 0 0 1 14 0M8.5 12.5a6 6 0 0 1 7 0M12 17h.01"},um={key:19,d:"M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L8 18l-4 1 1-4Z"},dm={key:20,d:"M12 16V4m0 0-4 4m4-4 4 4M5 20h14"},fm={key:21,d:"m15 4 5 5M17.5 6.5 10 14m-2-2 4 4-3 4H3l1-6Z"},hm={key:22,d:"M9 6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3Z"},pm={key:24,d:"m22 2-7 20-4-9-9-4ZM22 2 11 13"},gm={key:25,x:"6",y:"6",width:"12",height:"12",rx:"2"},mm={key:26,d:"m8 3 4 4 4-4M8 21l4-4 4 4M12 7v10"},vm={key:27,d:"M9.5 4.5A3 3 0 0 0 5 7a3 3 0 0 0 .5 5.5A3 3 0 0 0 9 17v2a2 2 0 0 0 4 0V5a2.5 2.5 0 0 0-3.5-.5ZM13 6a3 3 0 0 1 5 2 3 3 0 0 1 .5 5.5A3 3 0 0 1 15 18"},ym={key:30,d:"M21 12a8 8 0 0 1-9 8 9 9 0 0 1-4-.9L3 21l1.7-4A9 9 0 1 1 21 12Z"},bm={key:31,d:"M20 13 13 20l-9-9V4h7ZM8.5 8.5h.01"},km={key:32,d:"m12 3 1.3 3.7L17 8l-3.7 1.3L12 13l-1.3-3.7L7 8l3.7-1.3ZM5 15l.8 2.2L8 18l-2.2.8L5 21l-.8-2.2L2 18l2.2-.8ZM19 14l.7 1.8 1.8.7-1.8.7L19 19l-.7-1.8-1.8-.7 1.8-.7Z"},wm={key:34,d:"M3 6h7l2 2h9v11H3Z"},_m={key:35,d:"m5 12 4 4L19 6"},Sm={key:39,d:"M21 12a9 9 0 1 1-2.6-6.4M21 3v6h-6"},xm={key:46,d:"M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18l3 3 6.3-6.3a4 4 0 0 0 5.4-5.4l-2.5 2.5-3-3Z"},Cm={key:47,d:"M12 19V5m0 0-6 6m6-6 6 6"},$m={key:48,d:"M18 6 6 18M6 6l12 12"},Tm=Se({__name:"SvgIcon",props:{name:{},size:{default:20}},setup(e){return(t,n)=>(y(),b("svg",{class:"svg-icon",width:e.size,height:e.size,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.name==="menu"?(y(),b("path",Qg)):e.name==="plus"?(y(),b("path",em)):e.name==="panel-left"?(y(),b(ee,{key:2},[n[0]||(n[0]=d("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"},null,-1)),n[1]||(n[1]=d("path",{d:"M9 4v16"},null,-1))],64)):e.name==="panel-right"?(y(),b(ee,{key:3},[n[2]||(n[2]=d("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"},null,-1)),n[3]||(n[3]=d("path",{d:"M15 4v16"},null,-1))],64)):e.name==="search"?(y(),b(ee,{key:4},[n[4]||(n[4]=d("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[5]||(n[5]=d("path",{d:"m20 20-4-4"},null,-1))],64)):e.name==="filter"?(y(),b("path",tm)):e.name==="download"?(y(),b("path",nm)):e.name==="trash"?(y(),b("path",sm)):e.name==="activity"?(y(),b("path",om)):e.name==="help"?(y(),b(ee,{key:9},[n[6]||(n[6]=d("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[7]||(n[7]=d("path",{d:"M9.7 9a2.5 2.5 0 1 1 3.5 2.3c-.8.4-1.2 1-1.2 1.7M12 17h.01"},null,-1))],64)):e.name==="chevron-left"?(y(),b("path",rm)):e.name==="chevron-right"?(y(),b("path",im)):e.name==="chevron-down"?(y(),b("path",lm)):e.name==="bot"?(y(),b(ee,{key:13},[n[8]||(n[8]=d("rect",{x:"4",y:"7",width:"16",height:"12",rx:"3"},null,-1)),n[9]||(n[9]=d("path",{d:"M12 3v4M8 12h.01M16 12h.01M9 16h6"},null,-1))],64)):e.name==="git-branch"?(y(),b(ee,{key:14},[n[10]||(n[10]=d("circle",{cx:"6",cy:"5",r:"2"},null,-1)),n[11]||(n[11]=d("circle",{cx:"18",cy:"7",r:"2"},null,-1)),n[12]||(n[12]=d("circle",{cx:"6",cy:"19",r:"2"},null,-1)),n[13]||(n[13]=d("path",{d:"M6 7v10M8 10c5 0 3-3 8-3"},null,-1))],64)):e.name==="sun"?(y(),b(ee,{key:15},[n[14]||(n[14]=d("circle",{cx:"12",cy:"12",r:"4"},null,-1)),n[15]||(n[15]=d("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.42 1.42m11.3 11.3 1.42 1.42M2 12h2m16 0h2M4.93 19.07l1.42-1.42m11.3-11.3 1.42-1.42"},null,-1))],64)):e.name==="moon"?(y(),b("path",am)):e.name==="monitor"?(y(),b(ee,{key:17},[n[16]||(n[16]=d("rect",{x:"3",y:"4",width:"18",height:"13",rx:"2"},null,-1)),n[17]||(n[17]=d("path",{d:"M8 21h8M12 17v4"},null,-1))],64)):e.name==="wifi"?(y(),b("path",cm)):e.name==="edit"?(y(),b("path",um)):e.name==="upload"?(y(),b("path",dm)):e.name==="broom"?(y(),b("path",fm)):e.name==="command"?(y(),b("path",hm)):e.name==="at"?(y(),b(ee,{key:23},[n[18]||(n[18]=d("circle",{cx:"12",cy:"12",r:"4"},null,-1)),n[19]||(n[19]=d("path",{d:"M16 12v1.5a2.5 2.5 0 0 0 5 0V12a9 9 0 1 0-3.5 7"},null,-1))],64)):e.name==="send"?(y(),b("path",pm)):e.name==="stop"?(y(),b("rect",gm)):e.name==="compact"?(y(),b("path",mm)):e.name==="brain"?(y(),b("path",vm)):e.name==="clipboard"?(y(),b(ee,{key:28},[n[20]||(n[20]=d("rect",{x:"5",y:"4",width:"14",height:"17",rx:"2"},null,-1)),n[21]||(n[21]=d("path",{d:"M9 4V2h6v2M9 10h6M9 14h6"},null,-1))],64)):e.name==="fork"?(y(),b(ee,{key:29},[n[22]||(n[22]=d("circle",{cx:"6",cy:"4",r:"2"},null,-1)),n[23]||(n[23]=d("circle",{cx:"18",cy:"6",r:"2"},null,-1)),n[24]||(n[24]=d("circle",{cx:"6",cy:"20",r:"2"},null,-1)),n[25]||(n[25]=d("path",{d:"M6 6v12M8 10c6 0 4-4 8-4"},null,-1))],64)):e.name==="message-circle"?(y(),b("path",ym)):e.name==="tag"?(y(),b("path",bm)):e.name==="sparkles"?(y(),b("path",km)):e.name==="terminal"?(y(),b(ee,{key:33},[n[26]||(n[26]=d("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"},null,-1)),n[27]||(n[27]=d("path",{d:"m7 9 3 3-3 3m5 0h5"},null,-1))],64)):e.name==="folder"?(y(),b("path",wm)):e.name==="check"?(y(),b("path",_m)):e.name==="speaker"?(y(),b(ee,{key:36},[n[28]||(n[28]=d("path",{d:"M11 5 6 9H3v6h3l5 4V5z"},null,-1)),n[29]||(n[29]=d("path",{d:"M15.5 8.5a5 5 0 0 1 0 7"},null,-1)),n[30]||(n[30]=d("path",{d:"M18 6a8.5 8.5 0 0 1 0 12"},null,-1))],64)):e.name==="speaker-off"?(y(),b(ee,{key:37},[n[31]||(n[31]=d("path",{d:"M11 5 6 9H3v6h3l5 4V5z"},null,-1)),n[32]||(n[32]=d("path",{d:"m16 9 5 6M21 9l-5 6"},null,-1))],64)):e.name==="copy"?(y(),b(ee,{key:38},[n[33]||(n[33]=d("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"},null,-1)),n[34]||(n[34]=d("path",{d:"M16 8V4H4v12h4"},null,-1))],64)):e.name==="refresh"?(y(),b("path",Sm)):e.name==="target"?(y(),b(ee,{key:40},[n[35]||(n[35]=d("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[36]||(n[36]=d("circle",{cx:"12",cy:"12",r:"5"},null,-1)),n[37]||(n[37]=d("circle",{cx:"12",cy:"12",r:"1"},null,-1))],64)):e.name==="settings"?(y(),b(ee,{key:41},[n[38]||(n[38]=d("circle",{cx:"12",cy:"12",r:"3"},null,-1)),n[39]||(n[39]=d("path",{d:"M19.4 15a1.7 1.7 0 0 0 .34 1.87l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.7 1.7 0 0 0-1.87-.34 1.7 1.7 0 0 0-1 1.55V21a2 2 0 1 1-4 0v-.09a1.7 1.7 0 0 0-1-1.55 1.7 1.7 0 0 0-1.87.34l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.7 1.7 0 0 0 .34-1.87 1.7 1.7 0 0 0-1.55-1H3a2 2 0 1 1 0-4h.09a1.7 1.7 0 0 0 1.55-1 1.7 1.7 0 0 0-.34-1.87l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.7 1.7 0 0 0 1.87.34h.09a1.7 1.7 0 0 0 1-1.55V3a2 2 0 1 1 4 0v.09a1.7 1.7 0 0 0 1 1.55 1.7 1.7 0 0 0 1.87-.34l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.7 1.7 0 0 0-.34 1.87v.09a1.7 1.7 0 0 0 1.55 1H21a2 2 0 1 1 0 4h-.09a1.7 1.7 0 0 0-1.55 1Z"},null,-1))],64)):e.name==="home"?(y(),b(ee,{key:42},[n[40]||(n[40]=d("path",{d:"M3 10.5 12 3l9 7.5"},null,-1)),n[41]||(n[41]=d("path",{d:"M5 9.5V21h14V9.5"},null,-1))],64)):e.name==="bell"?(y(),b(ee,{key:43},[n[42]||(n[42]=d("path",{d:"M6 9a6 6 0 1 1 12 0c0 5 2 6 2 6H4s2-1 2-6"},null,-1)),n[43]||(n[43]=d("path",{d:"M10 19a2 2 0 0 0 4 0"},null,-1))],64)):e.name==="book"?(y(),b(ee,{key:44},[n[44]||(n[44]=d("path",{d:"M4 5a2 2 0 0 1 2-2h13v18H6a2 2 0 0 0-2 2Z"},null,-1)),n[45]||(n[45]=d("path",{d:"M6 3v18"},null,-1))],64)):e.name==="layers"?(y(),b(ee,{key:45},[n[46]||(n[46]=d("path",{d:"m12 3 9 5-9 5-9-5Z"},null,-1)),n[47]||(n[47]=d("path",{d:"m3 13 9 5 9-5"},null,-1))],64)):e.name==="wrench"?(y(),b("path",xm)):e.name==="arrow-up"?(y(),b("path",Cm)):e.name==="x"?(y(),b("path",$m)):e.name==="file"?(y(),b(ee,{key:49},[n[48]||(n[48]=d("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"},null,-1)),n[49]||(n[49]=d("path",{d:"M14 2v6h6"},null,-1))],64)):D("",!0)],8,Xg))}}),be=xe(Tm,[["__scopeId","data-v-ce28bbaa"]]),Am=["placeholder"],Rm={class:"composer-footer"},Em={class:"composer-quick-actions"},Im=["title"],Lm={key:3,class:"queue-label",title:"运行结束后自动发送"},Mm={class:"composer-actions"},Pm=["disabled","title"],Nm={key:1,class:"context-label",title:"上下文使用率"},Om=["disabled"],Dm=Se({__name:"Composer",props:{busy:{type:Boolean},status:{default:void 0},sessionId:{default:null},models:{default:()=>[]},variant:{default:"chat"},placeholder:{default:void 0}},emits:["send","abort","command","switch-model","switch-thinking"],setup(e,{expose:t,emit:n}){const s=e,o=n,r=N(""),i=N(null),l=N(0),a=N(!1),c=X(()=>{const m=r.value;return!m.startsWith("/")||m.includes(`
|
|
19
|
-
`)||/\s/.test(m.slice(1))?null:m.slice(1)}),u=X(()=>c.value===null?[]:Qp(c.value)),f=X(()=>c.value!==null&&u.value.length>0&&!a.value);Oe(c,()=>{l.value=0,a.value=!1});function h(m){const S=m??u.value[l.value];if(S){if(S.acceptsInput){r.value=`/${S.name} `,a.value=!0,Ot(()=>{var E;(E=i.value)==null||E.focus(),C()});return}$(`/${S.name}`),J(),o("command",S.name)}}const p=N([]);Oe(()=>s.sessionId,()=>{p.value=[]}),Oe(()=>s.busy,m=>{if(!m&&p.value.length>0){const[S,...E]=p.value;p.value=E,S&&o("send",S)}});const g=N([]),_=N(-1),k=N("");function w(){return`nexum-history:${s.sessionId??"default"}`}function x(){try{const m=localStorage.getItem(w());g.value=m?JSON.parse(m):[]}catch{g.value=[]}_.value=-1}function $(m){if(g.value.at(-1)!==m){g.value=[...g.value,m].slice(-50);try{localStorage.setItem(w(),JSON.stringify(g.value))}catch{}}_.value=-1,k.value=""}function A(m,S){const E=i.value;if(!E)return;const F=E.value.slice(0,E.selectionStart??0),B=E.value.slice(E.selectionEnd??0);if(!(m===-1&&F.includes(`
|
|
20
|
-
`))&&!(m===1&&B.includes(`
|
|
21
|
-
`))){if(m===-1){if(g.value.length===0)return;S.preventDefault(),_.value===-1?(k.value=r.value,_.value=g.value.length-1):_.value>0&&_.value--,r.value=g.value[_.value]??""}else{if(_.value===-1)return;S.preventDefault(),_.value<g.value.length-1?(_.value++,r.value=g.value[_.value]??""):(_.value=-1,r.value=k.value)}Ot(()=>{E.selectionStart=E.selectionEnd=E.value.length})}}function G(){return`nexum-draft:${s.sessionId??"default"}`}let Q;Oe(r,()=>{C(),clearTimeout(Q),Q=setTimeout(()=>{try{r.value?localStorage.setItem(G(),r.value):localStorage.removeItem(G())}catch{}},300)}),Oe(()=>s.sessionId,()=>{clearTimeout(Q),x();let m="";try{m=localStorage.getItem(G())??""}catch{m=""}r.value=m,Ot(C)},{immediate:!0});function C(){const m=i.value;if(!m)return;m.style.height="auto";const S=Math.round(window.innerHeight*.25);m.style.height=`${Math.min(Math.max(m.scrollHeight,36),S)}px`}const R=N(0);function L(){const m=window.visualViewport;if(!m)return;const S=Math.round(window.innerHeight-m.height-m.offsetTop);R.value=S>120?S:0}"visualViewport"in window&&(Ut(()=>{var m;(m=window.visualViewport)==null||m.addEventListener("resize",L),L()}),Vt(()=>{var m;(m=window.visualViewport)==null||m.removeEventListener("resize",L),R.value=0}));function J(){r.value="",Ot(()=>{i.value&&(i.value.style.height="auto")})}function ie(){const m=r.value.trim();if(m){if(m.startsWith("/")){const S=m.indexOf(" "),E=(S===-1?m.slice(1):m.slice(1,S)).toLowerCase(),F=eg(E),B=S===-1?"":m.slice(S+1).trim();$(m),o("command",F,B),J();return}if(s.busy){z();return}$(m),o("send",m),J()}}function z(){const m=r.value.trim();m&&(p.value=[...p.value,m],J())}function ve(m){if(f.value){if(m.key==="ArrowUp"){m.preventDefault(),l.value=(l.value-1+u.value.length)%u.value.length;return}if(m.key==="ArrowDown"){m.preventDefault(),l.value=(l.value+1)%u.value.length;return}if(m.key==="Tab"||m.key==="Enter"&&!m.shiftKey){if(m.key==="Enter"&&m.isComposing)return;m.preventDefault(),h();return}if(m.key==="Escape"){m.preventDefault(),a.value=!0;return}}if((m.ctrlKey||m.metaKey)&&m.key.toLowerCase()==="s"){m.preventDefault(),z();return}if(m.key==="Enter"&&!m.shiftKey){if(m.isComposing)return;m.preventDefault(),ie();return}m.key==="ArrowUp"?A(-1,m):m.key==="ArrowDown"&&A(1,m)}function O(){p.value=[],o("abort")}function P(m){r.value=m,Ot(()=>{var S;C(),(S=i.value)==null||S.focus()})}function te(m){r.value+=m,Ot(()=>{var S;C(),(S=i.value)==null||S.focus()})}t({insertText:P,openModelPicker:Ze});const q=X(()=>{var m;return(m=s.status)==null?void 0:m.model}),ge=X(()=>{var m;return(m=s.status)==null?void 0:m.permission}),Ae=X(()=>{var m;return(m=s.status)==null?void 0:m.contextUsage}),ke=X(()=>s.placeholder??(s.busy?"回合进行中:Enter/Ctrl+S 排队消息,随下一轮注入":"输入消息,@ 提及,/ 触发指令")),ae=N(!1),Ce={off:"关闭",low:"低",medium:"中",high:"高",xhigh:"超高",max:"最大"},Te=X(()=>{var m;return(m=s.status)==null?void 0:m.thinkingLevel}),Rt=X(()=>{const m=Te.value;return!m||m==="none"?"":Ce[m]??m}),Ke=X(()=>s.models.length>0);function Ze(){return Ke.value?(ae.value=!0,!0):!1}function xt(){Ke.value&&(ae.value=!ae.value)}function mt(m){o("switch-model",m)}function Ft(m){o("switch-thinking",m)}const ne=X(()=>{switch(ge.value){case"auto":return"perm-auto";case"yolo":return"perm-yolo";default:return"perm-manual"}}),ce=X(()=>{switch(ge.value){case"auto":return"自动";case"yolo":return"YOLO";default:return"手动"}});return(m,S)=>(y(),b("div",{class:"composer",style:ln(R.value?{paddingBottom:R.value+"px"}:void 0)},[f.value?(y(),qe(Yg,{key:0,commands:u.value,"active-index":l.value,onSelect:h,onHover:S[0]||(S[0]=E=>l.value=E)},null,8,["commands","active-index"])):D("",!0),Ye(d("textarea",{ref_key:"textareaRef",ref:i,"onUpdate:modelValue":S[1]||(S[1]=E=>r.value=E),id:"composer-input",name:"message",class:"composer-input",rows:"1",placeholder:ke.value,onKeydown:ve},null,40,Am),[[ut,r.value]]),d("div",Rm,[d("div",Em,[e.variant==="home"?(y(),b("button",{key:0,class:"quick-action",title:"插入 / 触发指令",onClick:S[2]||(S[2]=E=>te("/"))},[Z(be,{name:"command",size:15}),S[6]||(S[6]=d("span",null,"技能",-1))])):(y(),b(ee,{key:1},[d("button",{class:"quick-action",title:"插入 @ 提及",onClick:S[3]||(S[3]=E=>te("@"))},[Z(be,{name:"at",size:15}),S[7]||(S[7]=d("span",null,"提及",-1))]),d("button",{class:"quick-action",title:"插入 / 触发指令",onClick:S[4]||(S[4]=E=>te("/"))},[Z(be,{name:"command",size:15}),S[8]||(S[8]=d("span",null,"指令",-1))])],64)),ge.value?(y(),b("span",{key:2,class:fe(["permission-label",ne.value]),title:`权限模式:${ge.value}`},I(ce.value),11,Im)):D("",!0),p.value.length?(y(),b("span",Lm,"已排队 "+I(p.value.length)+" 条",1)):D("",!0)]),d("div",Mm,[q.value?(y(),b("button",{key:0,class:fe(["model-select",{clickable:Ke.value}]),disabled:!Ke.value,title:e.variant==="home"?`当前模型:${q.value}`:`当前模型:${q.value}`,onClick:xt},[Z(be,{name:"brain",size:15}),d("span",null,I(e.variant==="home"?"通用智能体":q.value),1),e.variant!=="home"&&Rt.value?(y(),b(ee,{key:0},[Re(" · "+I(Rt.value),1)],64)):D("",!0),Ke.value?(y(),qe(be,{key:1,name:"chevron-down",size:12})):D("",!0)],10,Pm)):D("",!0),Z(ur,{name:"picker"},{default:$t(()=>[ae.value?(y(),qe(Gg,{key:0,models:e.models,"current-model":q.value,"current-thinking":Te.value,onApplyModel:mt,onApplyThinking:Ft,onClose:S[5]||(S[5]=E=>ae.value=!1)},null,8,["models","current-model","current-thinking"])):D("",!0)]),_:1}),Ae.value!==void 0?(y(),b("span",Nm,[Z(au,{usage:Ae.value,size:15},null,8,["usage"])])):D("",!0),e.busy?(y(),b("button",{key:2,class:"stop-btn",title:"停止当前回合",onClick:O},[Z(be,{name:"stop",size:14}),S[9]||(S[9]=d("span",null,"停止",-1))])):(y(),b("button",{key:3,class:"send-btn",disabled:!r.value.trim(),title:"发送 (Enter)","aria-label":"发送",onClick:ie},[Z(be,{name:"arrow-up",size:16})],8,Om))])])],4))}}),cu=xe(Dm,[["__scopeId","data-v-e999a680"]]),Bm={class:"conv-bar"},jm={class:"conv-bar-left"},Um=["title"],Fm=["title"],Gm={key:1,class:"title-text"},zm={class:"conv-bar-right"},Hm=["title","aria-label"],qm=Se({__name:"ConversationHeader",props:{title:{default:null},busy:{type:Boolean,default:!1},drawerOpen:{type:Boolean,default:!1}},emits:["home","rename","export","clear","toggle-drawer"],setup(e,{emit:t}){const n=e,s=t,o=N(!1),r=N("");function i(){r.value=n.title??"",o.value=!0}function l(){const u=r.value.trim();o.value=!1,u&&u!==n.title&&s("rename",u)}function a(u){u.key==="Enter"?(u.preventDefault(),l()):u.key==="Escape"&&(u.preventDefault(),o.value=!1)}const c=X(()=>n.busy?"运行中":"就绪");return(u,f)=>(y(),b("header",Bm,[d("div",jm,[d("button",{class:"ghost-btn back-btn",title:"返回工作台","aria-label":"返回工作台",onClick:f[0]||(f[0]=h=>s("home"))},[Z(be,{name:"chevron-left",size:20})]),d("span",{class:fe(["status-dot",{busy:e.busy}]),title:c.value,"aria-hidden":"true"},null,10,Um),d("button",{class:"title-btn",title:o.value?"":"点击重命名",onClick:i},[o.value?Ye((y(),b("input",{key:0,"onUpdate:modelValue":f[1]||(f[1]=h=>r.value=h),class:"title-input","aria-label":"会话标题",onKeydown:a,onBlur:l,onClick:f[2]||(f[2]=At(()=>{},["stop"]))},null,544)),[[ut,r.value]]):(y(),b("span",Gm,I(e.title||"新会话"),1))],8,Fm)]),d("div",zm,[d("button",{class:"ghost-btn",title:"导出 Markdown","aria-label":"导出 Markdown",onClick:f[3]||(f[3]=h=>s("export"))},[Z(be,{name:"download",size:18})]),d("button",{class:"ghost-btn",title:"清空本地消息","aria-label":"清空本地消息",onClick:f[4]||(f[4]=h=>s("clear"))},[Z(be,{name:"broom",size:18})]),d("button",{class:fe(["ghost-btn",{active:e.drawerOpen}]),title:e.drawerOpen?"收起详情":"会话详情","aria-label":e.drawerOpen?"收起详情":"会话详情",onClick:f[5]||(f[5]=h=>s("toggle-drawer"))},[Z(be,{name:"panel-right",size:18})],10,Hm)])]))}}),Wm=xe(qm,[["__scopeId","data-v-bba70931"]]),Vm={key:0,class:"ui-dialog-header"},Km={class:"ui-dialog-title"},Zm={class:"ui-dialog-body"},Jm={key:1,class:"ui-dialog-footer"},Ym='a[href], button:not([disabled]), textarea, input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',Xm=Se({__name:"Dialog",props:{open:{type:Boolean},title:{default:void 0},closable:{type:Boolean,default:!0},maxWidth:{default:void 0}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,o=N(null);let r=null;function i(){const a=o.value;return a?Array.from(a.querySelectorAll(Ym)).filter(c=>c.offsetParent!==null||c===document.activeElement):[]}function l(a){var p,g,_;if(!n.open)return;if(a.key==="Escape"&&n.closable!==!1){a.stopPropagation(),s("close");return}if(a.key!=="Tab")return;const c=i();if(c.length===0){a.preventDefault(),(p=o.value)==null||p.focus();return}const u=c[0],f=c[c.length-1],h=document.activeElement;a.shiftKey?(h===u||!((g=o.value)!=null&&g.contains(h)))&&(a.preventDefault(),f.focus()):(h===f||!((_=o.value)!=null&&_.contains(h)))&&(a.preventDefault(),u.focus())}return Oe(()=>n.open,a=>{a?(r=document.activeElement instanceof HTMLElement?document.activeElement:null,Ot(()=>{const c=i()[0]??o.value;c==null||c.focus()})):r&&(r.focus(),r=null)},{immediate:!1}),Ut(()=>window.addEventListener("keydown",l,!0)),Vt(()=>window.removeEventListener("keydown",l,!0)),(a,c)=>(y(),qe(Mi,{to:"body"},[Z(ur,{name:"dialog"},{default:$t(()=>[e.open?(y(),b("div",{key:0,class:"ui-dialog-overlay",onClick:c[1]||(c[1]=At(u=>e.closable!==!1&&s("close"),["self"]))},[d("div",{ref_key:"dialogRef",ref:o,class:"ui-dialog",style:ln(e.maxWidth?{maxWidth:e.maxWidth}:void 0),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||a.$slots.header?(y(),b("div",Vm,[mo(a.$slots,"header",{},()=>[d("span",Km,I(e.title),1)],!0),e.closable!==!1?(y(),b("button",{key:0,class:"ui-dialog-close","aria-label":"关闭",onClick:c[0]||(c[0]=u=>s("close"))}," ✕ ")):D("",!0)])):D("",!0),d("div",Zm,[mo(a.$slots,"default",{},void 0,!0)]),a.$slots.footer?(y(),b("div",Jm,[mo(a.$slots,"footer",{},void 0,!0)])):D("",!0)],4)])):D("",!0)]),_:3})]))}}),Qm=xe(Xm,[["__scopeId","data-v-312d9f98"]]),ev={class:"info-row"},tv={class:"info-val mono"},nv={class:"info-row"},sv={class:"info-val mono"},ov={class:"info-row"},rv={class:"info-val"},iv={class:"info-row"},lv={class:"info-val"},av={class:"info-row"},cv={class:"info-val"},uv={class:"info-row"},dv={class:"info-val"},fv={class:"info-row"},hv={class:"info-val"},pv={class:"info-row"},gv={class:"info-val"},mv={class:"info-row"},vv={class:"info-val"},yv={class:"info-row"},bv={class:"info-val"},kv={key:0,class:"info-row"},wv={class:"info-val"},_v={key:1,class:"info-row"},Sv={class:"info-val"},xv={class:"info-val mono"},Cv={class:"info-val"},$v={key:3,class:"info-empty"},Tv=Se({__name:"InfoPanel",props:{mode:{},status:{},sessionId:{},workDir:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,o=X(()=>n.mode==="status"?"会话状态":"Token 用量");function r(p){switch(p){case"auto":return"自动 (auto)";case"yolo":return"YOLO";case"manual":return"手动 (manual)";default:return p??"-"}}function i(p){return p?"开启":"关闭"}function l(p){return p!=null}function a(p){return typeof p=="number"?p.toLocaleString():"-"}function c(p){return typeof p!="number"?"-":`${(p>1?p:p*100).toFixed(1)}%`}function u(p){return p?p.inputOther+p.output+p.inputCacheRead+p.inputCacheCreation:0}function f(p){return p!=null&&p.byModel?Object.entries(p.byModel).map(([g,_])=>({model:g,tokens:u(_),output:_.output,cacheRead:_.inputCacheRead})):[]}const h=X(()=>l(n.status.usage)||l(n.status.contextTokens));return(p,g)=>(y(),qe(Qm,{open:!0,title:o.value,onClose:g[0]||(g[0]=_=>s("close"))},{default:$t(()=>{var _,k;return[e.mode==="status"?(y(),b(ee,{key:0},[d("div",ev,[g[1]||(g[1]=d("span",{class:"info-key"},"会话 ID",-1)),d("span",tv,I(e.sessionId??"-"),1)]),d("div",nv,[g[2]||(g[2]=d("span",{class:"info-key"},"工作目录",-1)),d("span",sv,I(e.workDir??"-"),1)]),d("div",ov,[g[3]||(g[3]=d("span",{class:"info-key"},"模型",-1)),d("span",rv,I(e.status.model??"-"),1)]),d("div",iv,[g[4]||(g[4]=d("span",{class:"info-key"},"权限模式",-1)),d("span",lv,I(r(e.status.permission)),1)]),d("div",av,[g[5]||(g[5]=d("span",{class:"info-key"},"思考级别",-1)),d("span",cv,I(e.status.thinkingLevel??"-"),1)]),d("div",uv,[g[6]||(g[6]=d("span",{class:"info-key"},"计划模式",-1)),d("span",dv,I(i(e.status.planMode)),1)]),d("div",fv,[g[7]||(g[7]=d("span",{class:"info-key"},"WolfPack 模式",-1)),d("span",hv,I(i(e.status.wolfpackMode)),1)]),d("div",pv,[g[8]||(g[8]=d("span",{class:"info-key"},"上下文",-1)),d("span",gv,I(a(e.status.contextTokens))+" / "+I(a(e.status.maxContextTokens))+" ("+I(c(e.status.contextUsage))+")",1)])],64)):(y(),b(ee,{key:1},[d("div",mv,[g[9]||(g[9]=d("span",{class:"info-key"},"上下文 Token",-1)),d("span",vv,I(a(e.status.contextTokens))+" / "+I(a(e.status.maxContextTokens)),1)]),d("div",yv,[g[10]||(g[10]=d("span",{class:"info-key"},"上下文占比",-1)),d("span",bv,I(c(e.status.contextUsage)),1)]),(_=e.status.usage)!=null&&_.total?(y(),b("div",kv,[g[11]||(g[11]=d("span",{class:"info-key"},"累计 Token",-1)),d("span",wv,I(a(u(e.status.usage.total))),1)])):D("",!0),(k=e.status.usage)!=null&&k.currentTurn?(y(),b("div",_v,[g[12]||(g[12]=d("span",{class:"info-key"},"当前回合",-1)),d("span",Sv,I(a(u(e.status.usage.currentTurn))),1)])):D("",!0),f(e.status.usage).length?(y(),b(ee,{key:2},[g[13]||(g[13]=d("div",{class:"info-subhead"},"按模型",-1)),(y(!0),b(ee,null,Ve(f(e.status.usage),w=>(y(),b("div",{key:w.model,class:"info-row info-row-model"},[d("span",xv,I(w.model),1),d("span",Cv,I(a(w.tokens))+"(输出 "+I(a(w.output))+" · 缓存读 "+I(a(w.cacheRead))+")",1)]))),128))],64)):D("",!0),h.value?D("",!0):(y(),b("div",$v,"暂无用量数据"))],64))]}),_:1},8,["title"]))}}),Av=xe(Tv,[["__scopeId","data-v-f50b25c9"]]),Rv=""+new URL("../icon.ico",import.meta.url).href,Ev={class:"empty-state"},Iv={class:"suggestions"},Lv=["onClick"],Mv={class:"suggestion-icon"},Pv={class:"suggestion-title"},Nv=["title"],Ov={class:"workdir-path"},Dv={class:"empty-status","aria-label":"连接与模型状态"},Bv={class:"status-item"},jv={class:"status-item"},Uv={class:"status-item"},Fv=Se({__name:"EmptyState",props:{workDir:{default:null},model:{default:null},contextUsage:{default:null},connected:{type:Boolean,default:!1}},emits:["pick"],setup(e,{emit:t}){const n=t,s=[{icon:"edit",title:"帮我写一个函数",prompt:"帮我写一个函数"},{icon:"clipboard",title:"解释这段代码",prompt:"解释这段代码"},{icon:"activity",title:"调试这个问题",prompt:"调试这个问题"}];function o(r){if(r==null)return"—";const i=r<=1?Math.round(r*100):Math.round(r);return`${Math.min(i,100)}%`}return(r,i)=>(y(),b("div",Ev,[i[3]||(i[3]=d("div",{class:"empty-logo"},[d("img",{src:Rv,alt:"Nexum",class:"logo-img"})],-1)),i[4]||(i[4]=d("h1",{class:"empty-title"},"Nexum Web UI",-1)),i[5]||(i[5]=d("p",{class:"empty-subtitle"},"给 Nexum 发消息,开始处理你的任务",-1)),d("div",Iv,[(y(),b(ee,null,Ve(s,l=>d("button",{key:l.title,class:"suggestion-card",onClick:a=>n("pick",l.prompt)},[d("span",Mv,[Z(be,{name:l.icon,size:22},null,8,["name"])]),d("span",Pv,I(l.title),1)],8,Lv)),64))]),e.workDir?(y(),b("div",{key:0,class:"empty-workdir",title:e.workDir},[i[0]||(i[0]=d("span",{class:"workdir-label"},"工作目录",-1)),d("span",Ov,I(e.workDir),1)],8,Nv)):D("",!0),d("div",Dv,[d("span",{class:fe(["status-dot",e.connected?"on":"off"])},null,2),d("span",Bv,I(e.connected?"已连接":"未连接"),1),e.model?(y(),b(ee,{key:0},[i[1]||(i[1]=d("span",{class:"status-sep"},"·",-1)),d("span",jv,"模型 "+I(e.model),1)],64)):D("",!0),e.contextUsage!==null&&e.contextUsage!==void 0?(y(),b(ee,{key:1},[i[2]||(i[2]=d("span",{class:"status-sep"},"·",-1)),d("span",Uv,"上下文 "+I(o(e.contextUsage)),1)],64)):D("",!0)]),i[6]||(i[6]=d("div",{class:"empty-shortcuts","aria-hidden":"true"},[d("span",null,[d("kbd",null,"⌘K"),Re(" 搜索会话")]),d("span",null,[d("kbd",null,"⌘N"),Re(" 新建会话")])],-1))]))}}),Gv=xe(Fv,[["__scopeId","data-v-cd5d5dea"]]);function Ui(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var zn=Ui();function uu(e){zn=e}var Rs={exec:()=>null};function je(e,t=""){let n=typeof e=="string"?e:e.source;const s={replace:(o,r)=>{let i=typeof r=="string"?r:r.source;return i=i.replace(wt.caret,"$1"),n=n.replace(o,i),s},getRegex:()=>new RegExp(n,t)};return s}var wt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},zv=/^(?:[ \t]*(?:\n|$))+/,Hv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,qv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ks=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Wv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Fi=/(?:[*+-]|\d{1,9}[.)])/,du=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,fu=je(du).replace(/bull/g,Fi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Vv=je(du).replace(/bull/g,Fi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Gi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Kv=/^[^\n]+/,zi=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Zv=je(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",zi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Jv=je(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Fi).getRegex(),fr="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Hi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Yv=je("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Hi).replace("tag",fr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),hu=je(Gi).replace("hr",Ks).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fr).getRegex(),Xv=je(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",hu).getRegex(),qi={blockquote:Xv,code:Hv,def:Zv,fences:qv,heading:Wv,hr:Ks,html:Yv,lheading:fu,list:Jv,newline:zv,paragraph:hu,table:Rs,text:Kv},na=je("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ks).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fr).getRegex(),Qv={...qi,lheading:Vv,table:na,paragraph:je(Gi).replace("hr",Ks).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",na).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fr).getRegex()},e1={...qi,html:je(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Hi).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Rs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:je(Gi).replace("hr",Ks).replace("heading",` *#{1,6} *[^
|
|
22
|
-
]`).replace("lheading",fu).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},t1=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,n1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pu=/^( {2,}|\\)\n(?!\s*$)/,s1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,hr=/[\p{P}\p{S}]/u,Wi=/[\s\p{P}\p{S}]/u,gu=/[^\s\p{P}\p{S}]/u,o1=je(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Wi).getRegex(),mu=/(?!~)[\p{P}\p{S}]/u,r1=/(?!~)[\s\p{P}\p{S}]/u,i1=/(?:[^\s\p{P}\p{S}]|~)/u,l1=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,vu=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,a1=je(vu,"u").replace(/punct/g,hr).getRegex(),c1=je(vu,"u").replace(/punct/g,mu).getRegex(),yu="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",u1=je(yu,"gu").replace(/notPunctSpace/g,gu).replace(/punctSpace/g,Wi).replace(/punct/g,hr).getRegex(),d1=je(yu,"gu").replace(/notPunctSpace/g,i1).replace(/punctSpace/g,r1).replace(/punct/g,mu).getRegex(),f1=je("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,gu).replace(/punctSpace/g,Wi).replace(/punct/g,hr).getRegex(),h1=je(/\\(punct)/,"gu").replace(/punct/g,hr).getRegex(),p1=je(/^<(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(),g1=je(Hi).replace("(?:-->|$)","-->").getRegex(),m1=je("^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",g1).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),No=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,v1=je(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",No).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),bu=je(/^!?\[(label)\]\[(ref)\]/).replace("label",No).replace("ref",zi).getRegex(),ku=je(/^!?\[(ref)\](?:\[\])?/).replace("ref",zi).getRegex(),y1=je("reflink|nolink(?!\\()","g").replace("reflink",bu).replace("nolink",ku).getRegex(),Vi={_backpedal:Rs,anyPunctuation:h1,autolink:p1,blockSkip:l1,br:pu,code:n1,del:Rs,emStrongLDelim:a1,emStrongRDelimAst:u1,emStrongRDelimUnd:f1,escape:t1,link:v1,nolink:ku,punctuation:o1,reflink:bu,reflinkSearch:y1,tag:m1,text:s1,url:Rs},b1={...Vi,link:je(/^!?\[(label)\]\((.*?)\)/).replace("label",No).getRegex(),reflink:je(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",No).getRegex()},ii={...Vi,emStrongRDelimAst:d1,emStrongLDelim:c1,url:je(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},k1={...ii,br:je(pu).replace("{2,}","*").getRegex(),text:je(ii.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},io={normal:qi,gfm:Qv,pedantic:e1},gs={normal:Vi,gfm:ii,breaks:k1,pedantic:b1},w1={"&":"&","<":"<",">":">",'"':""","'":"'"},sa=e=>w1[e];function Qt(e,t){if(t){if(wt.escapeTest.test(e))return e.replace(wt.escapeReplace,sa)}else if(wt.escapeTestNoEncode.test(e))return e.replace(wt.escapeReplaceNoEncode,sa);return e}function oa(e){try{e=encodeURI(e).replace(wt.percentDecode,"%")}catch{return null}return e}function ra(e,t){var r;const n=e.replace(wt.findPipe,(i,l,a)=>{let c=!1,u=l;for(;--u>=0&&a[u]==="\\";)c=!c;return c?"|":" |"}),s=n.split(wt.splitPipe);let o=0;if(s[0].trim()||s.shift(),s.length>0&&!((r=s.at(-1))!=null&&r.trim())&&s.pop(),t)if(s.length>t)s.splice(t);else for(;s.length<t;)s.push("");for(;o<s.length;o++)s[o]=s[o].trim().replace(wt.slashPipe,"|");return s}function ms(e,t,n){const s=e.length;if(s===0)return"";let o=0;for(;o<s&&e.charAt(s-o-1)===t;)o++;return e.slice(0,s-o)}function _1(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let s=0;s<e.length;s++)if(e[s]==="\\")s++;else if(e[s]===t[0])n++;else if(e[s]===t[1]&&(n--,n<0))return s;return n>0?-2:-1}function ia(e,t,n,s,o){const r=t.href,i=t.title||null,l=e[1].replace(o.other.outputLinkReplace,"$1");s.state.inLink=!0;const a={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:r,title:i,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,a}function S1(e,t,n){const s=e.match(n.other.indentCodeCompensation);if(s===null)return t;const o=s[1];return t.split(`
|
|
23
|
-
`).map(r=>{const i=r.match(n.other.beginningSpace);if(i===null)return r;const[l]=i;return l.length>=o.length?r.slice(o.length):r}).join(`
|
|
24
|
-
`)}var Oo=class{constructor(e){M(this,"options");M(this,"rules");M(this,"lexer");this.options=e||zn}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:ms(n,`
|
|
25
|
-
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],s=S1(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const s=ms(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:ms(t[0],`
|
|
26
|
-
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=ms(t[0],`
|
|
27
|
-
`).split(`
|
|
28
|
-
`),s="",o="";const r=[];for(;n.length>0;){let i=!1;const l=[];let a;for(a=0;a<n.length;a++)if(this.rules.other.blockquoteStart.test(n[a]))l.push(n[a]),i=!0;else if(!i)l.push(n[a]);else break;n=n.slice(a);const c=l.join(`
|
|
29
|
-
`),u=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
30
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
31
|
-
${c}`:c,o=o?`${o}
|
|
32
|
-
${u}`:u;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,r,!0),this.lexer.state.top=f,n.length===0)break;const h=r.at(-1);if((h==null?void 0:h.type)==="code")break;if((h==null?void 0:h.type)==="blockquote"){const p=h,g=p.raw+`
|
|
33
|
-
`+n.join(`
|
|
34
|
-
`),_=this.blockquote(g);r[r.length-1]=_,s=s.substring(0,s.length-p.raw.length)+_.raw,o=o.substring(0,o.length-p.text.length)+_.text;break}else if((h==null?void 0:h.type)==="list"){const p=h,g=p.raw+`
|
|
35
|
-
`+n.join(`
|
|
36
|
-
`),_=this.list(g);r[r.length-1]=_,s=s.substring(0,s.length-h.raw.length)+_.raw,o=o.substring(0,o.length-p.raw.length)+_.raw,n=g.substring(r.at(-1).raw.length).split(`
|
|
37
|
-
`);continue}}return{type:"blockquote",raw:s,tokens:r,text:o}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const s=n.length>1,o={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const r=this.rules.other.listItemRegex(n);let i=!1;for(;e;){let a=!1,c="",u="";if(!(t=r.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let f=t[2].split(`
|
|
38
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,w=>" ".repeat(3*w.length)),h=e.split(`
|
|
39
|
-
`,1)[0],p=!f.trim(),g=0;if(this.options.pedantic?(g=2,u=f.trimStart()):p?g=t[1].length+1:(g=t[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,u=f.slice(g),g+=t[1].length),p&&this.rules.other.blankLine.test(h)&&(c+=h+`
|
|
40
|
-
`,e=e.substring(h.length+1),a=!0),!a){const w=this.rules.other.nextBulletRegex(g),x=this.rules.other.hrRegex(g),$=this.rules.other.fencesBeginRegex(g),A=this.rules.other.headingBeginRegex(g),G=this.rules.other.htmlBeginRegex(g);for(;e;){const Q=e.split(`
|
|
41
|
-
`,1)[0];let C;if(h=Q,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),C=h):C=h.replace(this.rules.other.tabCharGlobal," "),$.test(h)||A.test(h)||G.test(h)||w.test(h)||x.test(h))break;if(C.search(this.rules.other.nonSpaceChar)>=g||!h.trim())u+=`
|
|
42
|
-
`+C.slice(g);else{if(p||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||$.test(f)||A.test(f)||x.test(f))break;u+=`
|
|
43
|
-
`+h}!p&&!h.trim()&&(p=!0),c+=Q+`
|
|
44
|
-
`,e=e.substring(Q.length+1),f=C.slice(g)}}o.loose||(i?o.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(i=!0));let _=null,k;this.options.gfm&&(_=this.rules.other.listIsTask.exec(u),_&&(k=_[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:c,task:!!_,checked:k,loose:!1,text:u,tokens:[]}),o.raw+=c}const l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let a=0;a<o.items.length;a++)if(this.lexer.state.top=!1,o.items[a].tokens=this.lexer.blockTokens(o.items[a].text,[]),!o.loose){const c=o.items[a].tokens.filter(f=>f.type==="space"),u=c.length>0&&c.some(f=>this.rules.other.anyLine.test(f.raw));o.loose=u}if(o.loose)for(let a=0;a<o.items.length;a++)o.items[a].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:s,title:o}}}table(e){var i;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=ra(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(i=t[3])!=null&&i.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
45
|
-
`):[],r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===s.length){for(const l of s)this.rules.other.tableAlignRight.test(l)?r.align.push("right"):this.rules.other.tableAlignCenter.test(l)?r.align.push("center"):this.rules.other.tableAlignLeft.test(l)?r.align.push("left"):r.align.push(null);for(let l=0;l<n.length;l++)r.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:r.align[l]});for(const l of o)r.rows.push(ra(l,r.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:r.align[c]})));return r}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
|
|
46
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const r=ms(n.slice(0,-1),"\\");if((n.length-r.length)%2===0)return}else{const r=_1(t[2],"()");if(r===-2)return;if(r>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let s=t[2],o="";if(this.options.pedantic){const r=this.rules.other.pedanticHrefTitle.exec(s);r&&(s=r[1],o=r[3])}else o=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),ia(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=t[s.toLowerCase()];if(!o){const r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return ia(n,o,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!s||s[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const r=[...s[0]].length-1;let i,l,a=r,c=0;const u=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+r);(s=u.exec(t))!=null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(l=[...i].length,s[3]||s[4]){a+=l;continue}else if((s[5]||s[6])&&r%3&&!((r+l)%3)){c+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a+c);const f=[...s[0]][0].length,h=e.slice(0,r+s.index+f+l);if(Math.min(r,l)%2){const g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}const p=h.slice(2,-2);return{type:"strong",raw:h,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const s=this.rules.other.nonSpaceChar.test(n),o=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&o&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,s;return t[2]==="@"?(n=t[1],s="mailto:"+n):(n=t[1],s=n),{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let s,o;if(t[2]==="@")s=t[0],o="mailto:"+s;else{let r;do r=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(r!==t[0]);s=t[0],t[1]==="www."?o="http://"+t[0]:o=t[0]}return{type:"link",raw:t[0],text:s,href:o,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},pn=class li{constructor(t){M(this,"tokens");M(this,"options");M(this,"state");M(this,"tokenizer");M(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||zn,this.options.tokenizer=this.options.tokenizer||new Oo,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 n={other:wt,block:io.normal,inline:gs.normal};this.options.pedantic?(n.block=io.pedantic,n.inline=gs.pedantic):this.options.gfm&&(n.block=io.gfm,this.options.breaks?n.inline=gs.breaks:n.inline=gs.gfm),this.tokenizer.rules=n}static get rules(){return{block:io,inline:gs}}static lex(t,n){return new li(n).lex(t)}static lexInline(t,n){return new li(n).inlineTokens(t)}lex(t){t=t.replace(wt.carriageReturn,`
|
|
47
|
-
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],s=!1){var o,r,i;for(this.options.pedantic&&(t=t.replace(wt.tabCharGlobal," ").replace(wt.spaceLine,""));t;){let l;if((r=(o=this.options.extensions)==null?void 0:o.block)!=null&&r.some(c=>(l=c.call({lexer:this},t,n))?(t=t.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);const c=n.at(-1);l.raw.length===1&&c!==void 0?c.raw+=`
|
|
48
|
-
`:n.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
49
|
-
`+l.raw,c.text+=`
|
|
50
|
-
`+l.text,this.inlineQueue.at(-1).src=c.text):n.push(l);continue}if(l=this.tokenizer.fences(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.heading(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.hr(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.blockquote(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.list(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.html(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.def(t)){t=t.substring(l.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
51
|
-
`+l.raw,c.text+=`
|
|
52
|
-
`+l.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title});continue}if(l=this.tokenizer.table(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.lheading(t)){t=t.substring(l.raw.length),n.push(l);continue}let a=t;if((i=this.options.extensions)!=null&&i.startBlock){let c=1/0;const u=t.slice(1);let f;this.options.extensions.startBlock.forEach(h=>{f=h.call({lexer:this},u),typeof f=="number"&&f>=0&&(c=Math.min(c,f))}),c<1/0&&c>=0&&(a=t.substring(0,c+1))}if(this.state.top&&(l=this.tokenizer.paragraph(a))){const c=n.at(-1);s&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=`
|
|
53
|
-
`+l.raw,c.text+=`
|
|
54
|
-
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(l),s=a.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
55
|
-
`+l.raw,c.text+=`
|
|
56
|
-
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(l);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var l,a,c;let s=t,o=null;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)u.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,o.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(o=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let r=!1,i="";for(;t;){r||(i=""),r=!1;let u;if((a=(l=this.options.extensions)==null?void 0:l.inline)!=null&&a.some(h=>(u=h.call({lexer:this},t,n))?(t=t.substring(u.raw.length),n.push(u),!0):!1))continue;if(u=this.tokenizer.escape(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.tag(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.link(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(u.raw.length);const h=n.at(-1);u.type==="text"&&(h==null?void 0:h.type)==="text"?(h.raw+=u.raw,h.text+=u.text):n.push(u);continue}if(u=this.tokenizer.emStrong(t,s,i)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.codespan(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.br(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.del(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.autolink(t)){t=t.substring(u.raw.length),n.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(t))){t=t.substring(u.raw.length),n.push(u);continue}let f=t;if((c=this.options.extensions)!=null&&c.startInline){let h=1/0;const p=t.slice(1);let g;this.options.extensions.startInline.forEach(_=>{g=_.call({lexer:this},p),typeof g=="number"&&g>=0&&(h=Math.min(h,g))}),h<1/0&&h>=0&&(f=t.substring(0,h+1))}if(u=this.tokenizer.inlineText(f)){t=t.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(i=u.raw.slice(-1)),r=!0;const h=n.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=u.raw,h.text+=u.text):n.push(u);continue}if(t){const h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return n}},Do=class{constructor(e){M(this,"options");M(this,"parser");this.options=e||zn}space(e){return""}code({text:e,lang:t,escaped:n}){var r;const s=(r=(t||"").match(wt.notSpaceStart))==null?void 0:r[0],o=e.replace(wt.endingNewline,"")+`
|
|
57
|
-
`;return s?'<pre><code class="language-'+Qt(s)+'">'+(n?o:Qt(o,!0))+`</code></pre>
|
|
58
|
-
`:"<pre><code>"+(n?o:Qt(o,!0))+`</code></pre>
|
|
59
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
60
|
-
${this.parser.parse(e)}</blockquote>
|
|
61
|
-
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
62
|
-
`}hr(e){return`<hr>
|
|
63
|
-
`}list(e){const t=e.ordered,n=e.start;let s="";for(let i=0;i<e.items.length;i++){const l=e.items[i];s+=this.listitem(l)}const o=t?"ol":"ul",r=t&&n!==1?' start="'+n+'"':"";return"<"+o+r+`>
|
|
64
|
-
`+s+"</"+o+`>
|
|
65
|
-
`}listitem(e){var n;let t="";if(e.task){const s=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=s+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=s+" "+Qt(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:s+" ",text:s+" ",escaped:!0}):t+=s+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
66
|
-
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
67
|
-
`}table(e){let t="",n="";for(let o=0;o<e.header.length;o++)n+=this.tablecell(e.header[o]);t+=this.tablerow({text:n});let s="";for(let o=0;o<e.rows.length;o++){const r=e.rows[o];n="";for(let i=0;i<r.length;i++)n+=this.tablecell(r[i]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
68
|
-
<thead>
|
|
69
|
-
`+t+`</thead>
|
|
70
|
-
`+s+`</table>
|
|
71
|
-
`}tablerow({text:e}){return`<tr>
|
|
72
|
-
${e}</tr>
|
|
73
|
-
`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
74
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Qt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const s=this.parser.parseInline(n),o=oa(e);if(o===null)return s;e=o;let r='<a href="'+e+'"';return t&&(r+=' title="'+Qt(t)+'"'),r+=">"+s+"</a>",r}image({href:e,title:t,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));const o=oa(e);if(o===null)return Qt(n);e=o;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${Qt(t)}"`),r+=">",r}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Qt(e.text)}},Ki=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},gn=class ai{constructor(t){M(this,"options");M(this,"renderer");M(this,"textRenderer");this.options=t||zn,this.options.renderer=this.options.renderer||new Do,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ki}static parse(t,n){return new ai(n).parse(t)}static parseInline(t,n){return new ai(n).parseInline(t)}parse(t,n=!0){var o,r;let s="";for(let i=0;i<t.length;i++){const l=t[i];if((r=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&r[l.type]){const c=l,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type)){s+=u||"";continue}}const a=l;switch(a.type){case"space":{s+=this.renderer.space(a);continue}case"hr":{s+=this.renderer.hr(a);continue}case"heading":{s+=this.renderer.heading(a);continue}case"code":{s+=this.renderer.code(a);continue}case"table":{s+=this.renderer.table(a);continue}case"blockquote":{s+=this.renderer.blockquote(a);continue}case"list":{s+=this.renderer.list(a);continue}case"html":{s+=this.renderer.html(a);continue}case"paragraph":{s+=this.renderer.paragraph(a);continue}case"text":{let c=a,u=this.renderer.text(c);for(;i+1<t.length&&t[i+1].type==="text";)c=t[++i],u+=`
|
|
75
|
-
`+this.renderer.text(c);n?s+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):s+=u;continue}default:{const c='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}parseInline(t,n=this.renderer){var o,r;let s="";for(let i=0;i<t.length;i++){const l=t[i];if((r=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&r[l.type]){const c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){s+=c||"";continue}}const a=l;switch(a.type){case"escape":{s+=n.text(a);break}case"html":{s+=n.html(a);break}case"link":{s+=n.link(a);break}case"image":{s+=n.image(a);break}case"strong":{s+=n.strong(a);break}case"em":{s+=n.em(a);break}case"codespan":{s+=n.codespan(a);break}case"br":{s+=n.br(a);break}case"del":{s+=n.del(a);break}case"text":{s+=n.text(a);break}default:{const c='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}},Hr,bo=(Hr=class{constructor(e){M(this,"options");M(this,"block");this.options=e||zn}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?pn.lex:pn.lexInline}provideParser(){return this.block?gn.parse:gn.parseInline}},M(Hr,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Hr),x1=class{constructor(...e){M(this,"defaults",Ui());M(this,"options",this.setOptions);M(this,"parse",this.parseMarkdown(!0));M(this,"parseInline",this.parseMarkdown(!1));M(this,"Parser",gn);M(this,"Renderer",Do);M(this,"TextRenderer",Ki);M(this,"Lexer",pn);M(this,"Tokenizer",Oo);M(this,"Hooks",bo);this.use(...e)}walkTokens(e,t){var s,o;let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const i=r;for(const l of i.header)n=n.concat(this.walkTokens(l.tokens,t));for(const l of i.rows)for(const a of l)n=n.concat(this.walkTokens(a.tokens,t));break}case"list":{const i=r;n=n.concat(this.walkTokens(i.items,t));break}default:{const i=r;(o=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&o[i.type]?this.defaults.extensions.childTokens[i.type].forEach(l=>{const a=i[l].flat(1/0);n=n.concat(this.walkTokens(a,t))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){const r=t.renderers[o.name];r?t.renderers[o.name]=function(...i){let l=o.renderer.apply(this,i);return l===!1&&(l=r.apply(this,i)),l}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const r=t[o.level];r?r.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),s.extensions=t),n.renderer){const o=this.defaults.renderer||new Do(this.defaults);for(const r in n.renderer){if(!(r in o))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const i=r,l=n.renderer[i],a=o[i];o[i]=(...c)=>{let u=l.apply(o,c);return u===!1&&(u=a.apply(o,c)),u||""}}s.renderer=o}if(n.tokenizer){const o=this.defaults.tokenizer||new Oo(this.defaults);for(const r in n.tokenizer){if(!(r in o))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const i=r,l=n.tokenizer[i],a=o[i];o[i]=(...c)=>{let u=l.apply(o,c);return u===!1&&(u=a.apply(o,c)),u}}s.tokenizer=o}if(n.hooks){const o=this.defaults.hooks||new bo;for(const r in n.hooks){if(!(r in o))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;const i=r,l=n.hooks[i],a=o[i];bo.passThroughHooks.has(r)?o[i]=c=>{if(this.defaults.async)return Promise.resolve(l.call(o,c)).then(f=>a.call(o,f));const u=l.call(o,c);return a.call(o,u)}:o[i]=(...c)=>{let u=l.apply(o,c);return u===!1&&(u=a.apply(o,c)),u}}s.hooks=o}if(n.walkTokens){const o=this.defaults.walkTokens,r=n.walkTokens;s.walkTokens=function(i){let l=[];return l.push(r.call(this,i)),o&&(l=l.concat(o.call(this,i))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return pn.lex(e,t??this.defaults)}parser(e,t){return gn.parse(e,t??this.defaults)}parseMarkdown(e){return(n,s)=>{const o={...s},r={...this.defaults,...o},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&o.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));r.hooks&&(r.hooks.options=r,r.hooks.block=e);const l=r.hooks?r.hooks.provideLexer():e?pn.lex:pn.lexInline,a=r.hooks?r.hooks.provideParser():e?gn.parse:gn.parseInline;if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(c=>l(c,r)).then(c=>r.hooks?r.hooks.processAllTokens(c):c).then(c=>r.walkTokens?Promise.all(this.walkTokens(c,r.walkTokens)).then(()=>c):c).then(c=>a(c,r)).then(c=>r.hooks?r.hooks.postprocess(c):c).catch(i);try{r.hooks&&(n=r.hooks.preprocess(n));let c=l(n,r);r.hooks&&(c=r.hooks.processAllTokens(c)),r.walkTokens&&this.walkTokens(c,r.walkTokens);let u=a(c,r);return r.hooks&&(u=r.hooks.postprocess(u)),u}catch(c){return i(c)}}}onError(e,t){return n=>{if(n.message+=`
|
|
76
|
-
Please report this to https://github.com/markedjs/marked.`,e){const s="<p>An error occurred:</p><pre>"+Qt(n.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}},Gn=new x1;function De(e,t){return Gn.parse(e,t)}De.options=De.setOptions=function(e){return Gn.setOptions(e),De.defaults=Gn.defaults,uu(De.defaults),De};De.getDefaults=Ui;De.defaults=zn;De.use=function(...e){return Gn.use(...e),De.defaults=Gn.defaults,uu(De.defaults),De};De.walkTokens=function(e,t){return Gn.walkTokens(e,t)};De.parseInline=Gn.parseInline;De.Parser=gn;De.parser=gn.parse;De.Renderer=Do;De.TextRenderer=Ki;De.Lexer=pn;De.lexer=pn.lex;De.Tokenizer=Oo;De.Hooks=bo;De.parse=De;De.options;De.setOptions;De.use;De.walkTokens;De.parseInline;gn.parse;pn.lex;const C1="modulepreload",$1=function(e,t){return new URL(e,t).href},la={},lo=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let i=function(u){return Promise.all(u.map(f=>Promise.resolve(f).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const l=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),c=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));o=i(n.map(u=>{if(u=$1(u,s),u in la)return;la[u]=!0;const f=u.endsWith(".css"),h=f?'[rel="stylesheet"]':"";if(!!s)for(let _=l.length-1;_>=0;_--){const k=l[_];if(k.href===u&&(!f||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${h}`))return;const g=document.createElement("link");if(g.rel=f?"stylesheet":C1,f||(g.as="script"),g.crossOrigin="",g.href=u,c&&g.setAttribute("nonce",c),document.head.appendChild(g),f)return new Promise((_,k)=>{g.addEventListener("load",_),g.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${u}`)))})}))}function r(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return o.then(i=>{for(const l of i||[])l.status==="rejected"&&r(l.reason);return t().catch(r)})};let ot=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function T1(e){return Zi(e)}function Zi(e){return Array.isArray(e)?A1(e):e instanceof RegExp?e:typeof e=="object"?R1(e):e}function A1(e){let t=[];for(let n=0,s=e.length;n<s;n++)t[n]=Zi(e[n]);return t}function R1(e){let t={};for(let n in e)t[n]=Zi(e[n]);return t}function wu(e,...t){return t.forEach(n=>{for(let s in n)e[s]=n[s]}),e}function _u(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?_u(e.substring(0,e.length-1)):e.substr(~t+1)}var Pr=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,ao=class{static hasCaptures(e){return e===null?!1:(Pr.lastIndex=0,Pr.test(e))}static replaceCaptures(e,t,n){return e.replace(Pr,(s,o,r,i)=>{let l=n[parseInt(o||r,10)];if(l){let a=t.substring(l.start,l.end);for(;a[0]===".";)a=a.substring(1);switch(i){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return s})}};function Su(e,t){return e<t?-1:e>t?1:0}function xu(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,s=t.length;if(n===s){for(let o=0;o<n;o++){let r=Su(e[o],t[o]);if(r!==0)return r}return 0}return n-s}function aa(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Cu(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var $u=class{constructor(e){M(this,"cache",new Map);this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},Bo=class{constructor(e,t,n){M(this,"_cachedMatchRoot",new $u(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(L1(e),t)}static createFromParsedTheme(e,t){return P1(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,s=this._cachedMatchRoot.get(t).find(o=>E1(e.parent,o.parentScopes));return s?new Tu(s.fontStyle,s.foreground,s.background):null}},Nr=class ko{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const s of n)t=new ko(t,s);return t}static from(...t){let n=null;for(let s=0;s<t.length;s++)n=new ko(n,t[s]);return n}push(t){return new ko(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let s=this;for(;s&&s!==t;)n.push(s.scopeName),s=s.parent;return s===t?n.reverse():void 0}};function E1(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let s=t[n],o=!1;if(s===">"){if(n===t.length-1)return!1;s=t[++n],o=!0}for(;e&&!I1(e.scopeName,s);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function I1(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Tu=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function L1(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],s=0;for(let o=0,r=t.length;o<r;o++){let i=t[o];if(!i.settings)continue;let l;if(typeof i.scope=="string"){let f=i.scope;f=f.replace(/^[,]+/,""),f=f.replace(/[,]+$/,""),l=f.split(",")}else Array.isArray(i.scope)?l=i.scope:l=[""];let a=-1;if(typeof i.settings.fontStyle=="string"){a=0;let f=i.settings.fontStyle.split(" ");for(let h=0,p=f.length;h<p;h++)switch(f[h]){case"italic":a=a|1;break;case"bold":a=a|2;break;case"underline":a=a|4;break;case"strikethrough":a=a|8;break}}let c=null;typeof i.settings.foreground=="string"&&aa(i.settings.foreground)&&(c=i.settings.foreground);let u=null;typeof i.settings.background=="string"&&aa(i.settings.background)&&(u=i.settings.background);for(let f=0,h=l.length;f<h;f++){let g=l[f].trim().split(" "),_=g[g.length-1],k=null;g.length>1&&(k=g.slice(0,g.length-1),k.reverse()),n[s++]=new M1(_,k,o,a,c,u)}}return n}var M1=class{constructor(e,t,n,s,o,r){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=s,this.foreground=o,this.background=r}},pt=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(pt||{});function P1(e,t){e.sort((a,c)=>{let u=Su(a.scope,c.scope);return u!==0||(u=xu(a.parentScopes,c.parentScopes),u!==0)?u:a.index-c.index});let n=0,s="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let a=e.shift();a.fontStyle!==-1&&(n=a.fontStyle),a.foreground!==null&&(s=a.foreground),a.background!==null&&(o=a.background)}let r=new N1(t),i=new Tu(n,r.getId(s),r.getId(o)),l=new D1(new ci(0,null,-1,0,0),[]);for(let a=0,c=e.length;a<c;a++){let u=e[a];l.insert(0,u.scope,u.parentScopes,u.fontStyle,r.getId(u.foreground),r.getId(u.background))}return new Bo(r,i,l)}var N1=class{constructor(e){M(this,"_isFrozen");M(this,"_lastColorId");M(this,"_id2color");M(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},O1=Object.freeze([]),ci=class Au{constructor(t,n,s,o,r){M(this,"scopeDepth");M(this,"parentScopes");M(this,"fontStyle");M(this,"foreground");M(this,"background");this.scopeDepth=t,this.parentScopes=n||O1,this.fontStyle=s,this.foreground=o,this.background=r}clone(){return new Au(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let s=0,o=t.length;s<o;s++)n[s]=t[s].clone();return n}acceptOverwrite(t,n,s,o){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),s!==0&&(this.foreground=s),o!==0&&(this.background=o)}},D1=class ui{constructor(t,n=[],s={}){M(this,"_rulesWithParentScopes");this._mainRule=t,this._children=s,this._rulesWithParentScopes=n}static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let s=0,o=0;for(;t.parentScopes[s]===">"&&s++,n.parentScopes[o]===">"&&o++,!(s>=t.parentScopes.length||o>=n.parentScopes.length);){const r=n.parentScopes[o].length-t.parentScopes[s].length;if(r!==0)return r;s++,o++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let s=t.indexOf("."),o,r;if(s===-1?(o=t,r=""):(o=t.substring(0,s),r=t.substring(s+1)),this._children.hasOwnProperty(o))return this._children[o].match(r)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(ui._cmpBySpecificity),n}insert(t,n,s,o,r,i){if(n===""){this._doInsertHere(t,s,o,r,i);return}let l=n.indexOf("."),a,c;l===-1?(a=n,c=""):(a=n.substring(0,l),c=n.substring(l+1));let u;this._children.hasOwnProperty(a)?u=this._children[a]:(u=new ui(this._mainRule.clone(),ci.cloneArr(this._rulesWithParentScopes)),this._children[a]=u),u.insert(t+1,c,s,o,r,i)}_doInsertHere(t,n,s,o,r){if(n===null){this._mainRule.acceptOverwrite(t,s,o,r);return}for(let i=0,l=this._rulesWithParentScopes.length;i<l;i++){let a=this._rulesWithParentScopes[i];if(xu(a.parentScopes,n)===0){a.acceptOverwrite(t,s,o,r);return}}s===-1&&(s=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),r===0&&(r=this._mainRule.background),this._rulesWithParentScopes.push(new ci(t,n,s,o,r))}},ls=class Pt{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=Pt.getLanguageId(t),s=Pt.getTokenType(t),o=Pt.getFontStyle(t),r=Pt.getForeground(t),i=Pt.getBackground(t);console.log({languageId:n,tokenType:s,fontStyle:o,foreground:r,background:i})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,s,o,r,i,l){let a=Pt.getLanguageId(t),c=Pt.getTokenType(t),u=Pt.containsBalancedBrackets(t)?1:0,f=Pt.getFontStyle(t),h=Pt.getForeground(t),p=Pt.getBackground(t);return n!==0&&(a=n),s!==8&&(c=s),o!==null&&(u=o?1:0),r!==-1&&(f=r),i!==0&&(h=i),l!==0&&(p=l),(a<<0|c<<8|u<<10|f<<11|h<<15|p<<24)>>>0}};function jo(e,t){const n=[],s=B1(e);let o=s.next();for(;o!==null;){let a=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=s.next()}let c=i();if(n.push({matcher:c,priority:a}),o!==",")break;o=s.next()}return n;function r(){if(o==="-"){o=s.next();const a=r();return c=>!!a&&!a(c)}if(o==="("){o=s.next();const a=l();return o===")"&&(o=s.next()),a}if(ca(o)){const a=[];do a.push(o),o=s.next();while(ca(o));return c=>t(a,c)}return null}function i(){const a=[];let c=r();for(;c;)a.push(c),c=r();return u=>a.every(f=>f(u))}function l(){const a=[];let c=i();for(;c&&(a.push(c),o==="|"||o===",");){do o=s.next();while(o==="|"||o===",");c=i()}return u=>a.some(f=>f(u))}}function ca(e){return!!e&&!!e.match(/[\w\.:]+/)}function B1(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const s=n[0];return n=t.exec(e),s}}}function Ru(e){typeof e.dispose=="function"&&e.dispose()}var Us=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},j1=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},U1=class{constructor(){M(this,"_references",[]);M(this,"_seenReferenceKeys",new Set);M(this,"visitedRule",new Set)}get references(){return this._references}add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},F1=class{constructor(e,t){M(this,"seenFullScopeRequests",new Set);M(this,"seenPartialScopeRequests",new Set);M(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Us(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new U1;for(const n of e)G1(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Us){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function G1(e,t,n,s){const o=n.lookup(e.scopeName);if(!o){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const r=n.lookup(t);e instanceof Us?wo({baseGrammar:r,selfGrammar:o},s):di(e.ruleName,{baseGrammar:r,selfGrammar:o,repository:o.repository},s);const i=n.injections(e.scopeName);if(i)for(const l of i)s.add(new Us(l))}function di(e,t,n){if(t.repository&&t.repository[e]){const s=t.repository[e];Uo([s],t,n)}}function wo(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Uo(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Uo(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Uo(e,t,n){for(const s of e){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const o=s.repository?wu({},t.repository,s.repository):t.repository;Array.isArray(s.patterns)&&Uo(s.patterns,{...t,repository:o},n);const r=s.include;if(!r)continue;const i=Eu(r);switch(i.kind){case 0:wo({...t,selfGrammar:t.baseGrammar},n);break;case 1:wo(t,n);break;case 2:di(i.ruleName,{...t,repository:o},n);break;case 3:case 4:const l=i.scopeName===t.selfGrammar.scopeName?t.selfGrammar:i.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(l){const a={baseGrammar:t.baseGrammar,selfGrammar:l,repository:o};i.kind===4?di(i.ruleName,a,n):wo(a,n)}else i.kind===4?n.add(new j1(i.scopeName,i.ruleName)):n.add(new Us(i.scopeName));break}}}var z1=class{constructor(){M(this,"kind",0)}},H1=class{constructor(){M(this,"kind",1)}},q1=class{constructor(e){M(this,"kind",2);this.ruleName=e}},W1=class{constructor(e){M(this,"kind",3);this.scopeName=e}},V1=class{constructor(e,t){M(this,"kind",4);this.scopeName=e,this.ruleName=t}};function Eu(e){if(e==="$base")return new z1;if(e==="$self")return new H1;const t=e.indexOf("#");if(t===-1)return new W1(e);if(t===0)return new q1(e.substring(1));{const n=e.substring(0,t),s=e.substring(t+1);return new V1(n,s)}}var K1=/\\(\d+)/,ua=/\\(\d+)/g,Z1=-1,Iu=-2;var Zs=class{constructor(e,t,n,s){M(this,"$location");M(this,"id");M(this,"_nameIsCapturing");M(this,"_name");M(this,"_contentNameIsCapturing");M(this,"_contentName");this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=ao.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=ao.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${_u(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:ao.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:ao.replaceCaptures(this._contentName,e,t)}},J1=class extends Zs{constructor(t,n,s,o,r){super(t,n,s,o);M(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(t,n){throw new Error("Not supported!")}compile(t,n){throw new Error("Not supported!")}compileAG(t,n,s,o){throw new Error("Not supported!")}},Y1=class extends Zs{constructor(t,n,s,o,r){super(t,n,s,null);M(this,"_match");M(this,"captures");M(this,"_cachedCompiledPatterns");this._match=new Fs(o,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,n){n.push(this._match)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,s,o){return this._getCachedCompiledPatterns(t).compileAG(t,s,o)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Gs,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},da=class extends Zs{constructor(t,n,s,o,r){super(t,n,s,o);M(this,"hasMissingPatterns");M(this,"patterns");M(this,"_cachedCompiledPatterns");this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,n){for(const s of this.patterns)t.getRule(s).collectPatterns(t,n)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,s,o){return this._getCachedCompiledPatterns(t).compileAG(t,s,o)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Gs,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},fi=class extends Zs{constructor(t,n,s,o,r,i,l,a,c,u){super(t,n,s,o);M(this,"_begin");M(this,"beginCaptures");M(this,"_end");M(this,"endHasBackReferences");M(this,"endCaptures");M(this,"applyEndPatternLast");M(this,"hasMissingPatterns");M(this,"patterns");M(this,"_cachedCompiledPatterns");this._begin=new Fs(r,this.id),this.beginCaptures=i,this._end=new Fs(l||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=c||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,n){return this._end.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t,n).compile(t)}compileAG(t,n,s,o){return this._getCachedCompiledPatterns(t,n).compileAG(t,s,o)}_getCachedCompiledPatterns(t,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Gs;for(const s of this.patterns)t.getRule(s).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}},Fo=class extends Zs{constructor(t,n,s,o,r,i,l,a,c){super(t,n,s,o);M(this,"_begin");M(this,"beginCaptures");M(this,"whileCaptures");M(this,"_while");M(this,"whileHasBackReferences");M(this,"hasMissingPatterns");M(this,"patterns");M(this,"_cachedCompiledPatterns");M(this,"_cachedCompiledWhilePatterns");this._begin=new Fs(r,this.id),this.beginCaptures=i,this.whileCaptures=a,this._while=new Fs(l,Iu),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,n){return this._while.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,s,o){return this._getCachedCompiledPatterns(t).compileAG(t,s,o)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Gs;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,n){return this._getCachedCompiledWhilePatterns(t,n).compile(t)}compileWhileAG(t,n,s,o){return this._getCachedCompiledWhilePatterns(t,n).compileAG(t,s,o)}_getCachedCompiledWhilePatterns(t,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Gs,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||""),this._cachedCompiledWhilePatterns}},Lu=class ct{static createCaptureRule(t,n,s,o,r){return t.registerRule(i=>new J1(n,i,s,o,r))}static getCompiledRuleId(t,n,s){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new Y1(t.$vscodeTextmateLocation,t.id,t.name,t.match,ct._compileCaptures(t.captures,n,s));if(typeof t.begin>"u"){t.repository&&(s=wu({},s,t.repository));let r=t.patterns;return typeof r>"u"&&t.include&&(r=[{include:t.include}]),new da(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,ct._compilePatterns(r,n,s))}return t.while?new Fo(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,ct._compileCaptures(t.beginCaptures||t.captures,n,s),t.while,ct._compileCaptures(t.whileCaptures||t.captures,n,s),ct._compilePatterns(t.patterns,n,s)):new fi(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,ct._compileCaptures(t.beginCaptures||t.captures,n,s),t.end,ct._compileCaptures(t.endCaptures||t.captures,n,s),t.applyEndPatternLast,ct._compilePatterns(t.patterns,n,s))}),t.id}static _compileCaptures(t,n,s){let o=[];if(t){let r=0;for(const i in t){if(i==="$vscodeTextmateLocation")continue;const l=parseInt(i,10);l>r&&(r=l)}for(let i=0;i<=r;i++)o[i]=null;for(const i in t){if(i==="$vscodeTextmateLocation")continue;const l=parseInt(i,10);let a=0;t[i].patterns&&(a=ct.getCompiledRuleId(t[i],n,s)),o[l]=ct.createCaptureRule(n,t[i].$vscodeTextmateLocation,t[i].name,t[i].contentName,a)}}return o}static _compilePatterns(t,n,s){let o=[];if(t)for(let r=0,i=t.length;r<i;r++){const l=t[r];let a=-1;if(l.include){const c=Eu(l.include);switch(c.kind){case 0:case 1:a=ct.getCompiledRuleId(s[l.include],n,s);break;case 2:let u=s[c.ruleName];u&&(a=ct.getCompiledRuleId(u,n,s));break;case 3:case 4:const f=c.scopeName,h=c.kind===4?c.ruleName:null,p=n.getExternalGrammar(f,s);if(p)if(h){let g=p.repository[h];g&&(a=ct.getCompiledRuleId(g,n,p.repository))}else a=ct.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else a=ct.getCompiledRuleId(l,n,s);if(a!==-1){const c=n.getRule(a);let u=!1;if((c instanceof da||c instanceof fi||c instanceof Fo)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;o.push(a)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},Fs=class Mu{constructor(t,n){M(this,"source");M(this,"ruleId");M(this,"hasAnchor");M(this,"hasBackReferences");M(this,"_anchorCache");if(t&&typeof t=="string"){const s=t.length;let o=0,r=[],i=!1;for(let l=0;l<s;l++)if(t.charAt(l)==="\\"&&l+1<s){const c=t.charAt(l+1);c==="z"?(r.push(t.substring(o,l)),r.push("$(?!\\n)(?<!\\n)"),o=l+2):(c==="A"||c==="G")&&(i=!0),l++}this.hasAnchor=i,o===0?this.source=t:(r.push(t.substring(o,s)),this.source=r.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=K1.test(this.source):this.hasBackReferences=!1}clone(){return new Mu(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let s=n.map(o=>t.substring(o.start,o.end));return ua.lastIndex=0,this.source.replace(ua,(o,r)=>Cu(s[parseInt(r,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],s=[],o=[],r,i,l,a;for(r=0,i=this.source.length;r<i;r++)l=this.source.charAt(r),t[r]=l,n[r]=l,s[r]=l,o[r]=l,l==="\\"&&r+1<i&&(a=this.source.charAt(r+1),a==="A"?(t[r+1]="",n[r+1]="",s[r+1]="A",o[r+1]="A"):a==="G"?(t[r+1]="",n[r+1]="G",s[r+1]="",o[r+1]="G"):(t[r+1]=a,n[r+1]=a,s[r+1]=a,o[r+1]=a),r++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:s.join(""),A1_G1:o.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Gs=class{constructor(){M(this,"_items");M(this,"_hasAnchors");M(this,"_cached");M(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new fa(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let s=this._items.map(o=>o.resolveAnchors(t,n));return new fa(e,s,this._items.map(o=>o.ruleId))}},fa=class{constructor(e,t,n){M(this,"scanner");this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
77
|
-
`)}findNextMatchSync(e,t,n){const s=this.scanner.findNextMatchSync(e,t,n);return s?{ruleId:this.rules[s.index],captureIndices:s.captureIndices}:null}},Or=class{constructor(e,t){this.languageId=e,this.tokenType=t}},hn,X1=(hn=class{constructor(t,n){M(this,"_defaultAttributes");M(this,"_embeddedLanguagesMatcher");M(this,"_getBasicScopeAttributes",new $u(t=>{const n=this._scopeToLanguage(t),s=this._toStandardTokenType(t);return new Or(n,s)}));this._defaultAttributes=new Or(t,8),this._embeddedLanguagesMatcher=new Q1(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?hn._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(hn.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},M(hn,"_NULL_SCOPE_METADATA",new Or(0,0)),M(hn,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),hn),Q1=class{constructor(e){M(this,"values");M(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,s])=>Cu(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},ha=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Pu(e,t,n,s,o,r,i,l){const a=t.content.length;let c=!1,u=-1;if(i){const p=ey(e,t,n,s,o,r);o=p.stack,s=p.linePos,n=p.isFirstLine,u=p.anchorPosition}const f=Date.now();for(;!c;){if(l!==0&&Date.now()-f>l)return new ha(o,!0);h()}return new ha(o,!1);function h(){const p=ty(e,t,n,s,o,u);if(!p){r.produce(o,a),c=!0;return}const g=p.captureIndices,_=p.matchedRuleId,k=g&&g.length>0?g[0].end>s:!1;if(_===Z1){const w=o.getRule(e);r.produce(o,g[0].start),o=o.withContentNameScopesList(o.nameScopesList),Ss(e,t,n,o,r,w.endCaptures,g),r.produce(o,g[0].end);const x=o;if(o=o.parent,u=x.getAnchorPos(),!k&&x.getEnterPos()===s){o=x,r.produce(o,a),c=!0;return}}else{const w=e.getRule(_);r.produce(o,g[0].start);const x=o,$=w.getName(t.content,g),A=o.contentNameScopesList.pushAttributed($,e);if(o=o.push(_,s,u,g[0].end===a,null,A,A),w instanceof fi){const G=w;Ss(e,t,n,o,r,G.beginCaptures,g),r.produce(o,g[0].end),u=g[0].end;const Q=G.getContentName(t.content,g),C=A.pushAttributed(Q,e);if(o=o.withContentNameScopesList(C),G.endHasBackReferences&&(o=o.withEndRule(G.getEndWithResolvedBackReferences(t.content,g))),!k&&x.hasSameRuleAs(o)){o=o.pop(),r.produce(o,a),c=!0;return}}else if(w instanceof Fo){const G=w;Ss(e,t,n,o,r,G.beginCaptures,g),r.produce(o,g[0].end),u=g[0].end;const Q=G.getContentName(t.content,g),C=A.pushAttributed(Q,e);if(o=o.withContentNameScopesList(C),G.whileHasBackReferences&&(o=o.withEndRule(G.getWhileWithResolvedBackReferences(t.content,g))),!k&&x.hasSameRuleAs(o)){o=o.pop(),r.produce(o,a),c=!0;return}}else if(Ss(e,t,n,o,r,w.captures,g),r.produce(o,g[0].end),o=o.pop(),!k){o=o.safePop(),r.produce(o,a),c=!0;return}}g[0].end>s&&(s=g[0].end,n=!1)}}function ey(e,t,n,s,o,r){let i=o.beginRuleCapturedEOL?0:-1;const l=[];for(let a=o;a;a=a.pop()){const c=a.getRule(e);c instanceof Fo&&l.push({rule:c,stack:a})}for(let a=l.pop();a;a=l.pop()){const{ruleScanner:c,findOptions:u}=oy(a.rule,e,a.stack.endRule,n,s===i),f=c.findNextMatchSync(t,s,u);if(f){if(f.ruleId!==Iu){o=a.stack.pop();break}f.captureIndices&&f.captureIndices.length&&(r.produce(a.stack,f.captureIndices[0].start),Ss(e,t,n,a.stack,r,a.rule.whileCaptures,f.captureIndices),r.produce(a.stack,f.captureIndices[0].end),i=f.captureIndices[0].end,f.captureIndices[0].end>s&&(s=f.captureIndices[0].end,n=!1))}else{o=a.stack.pop();break}}return{stack:o,linePos:s,anchorPosition:i,isFirstLine:n}}function ty(e,t,n,s,o,r){const i=ny(e,t,n,s,o,r),l=e.getInjections();if(l.length===0)return i;const a=sy(l,e,t,n,s,o,r);if(!a)return i;if(!i)return a;const c=i.captureIndices[0].start,u=a.captureIndices[0].start;return u<c||a.priorityMatch&&u===c?a:i}function ny(e,t,n,s,o,r){const i=o.getRule(e),{ruleScanner:l,findOptions:a}=Nu(i,e,o.endRule,n,s===r),c=l.findNextMatchSync(t,s,a);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function sy(e,t,n,s,o,r,i){let l=Number.MAX_VALUE,a=null,c,u=0;const f=r.contentNameScopesList.getScopeNames();for(let h=0,p=e.length;h<p;h++){const g=e[h];if(!g.matcher(f))continue;const _=t.getRule(g.ruleId),{ruleScanner:k,findOptions:w}=Nu(_,t,null,s,o===i),x=k.findNextMatchSync(n,o,w);if(!x)continue;const $=x.captureIndices[0].start;if(!($>=l)&&(l=$,a=x.captureIndices,c=x.ruleId,u=g.priority,l===o))break}return a?{priorityMatch:u===-1,captureIndices:a,matchedRuleId:c}:null}function Nu(e,t,n,s,o){return{ruleScanner:e.compileAG(t,n,s,o),findOptions:0}}function oy(e,t,n,s,o){return{ruleScanner:e.compileWhileAG(t,n,s,o),findOptions:0}}function Ss(e,t,n,s,o,r,i){if(r.length===0)return;const l=t.content,a=Math.min(r.length,i.length),c=[],u=i[0].end;for(let f=0;f<a;f++){const h=r[f];if(h===null)continue;const p=i[f];if(p.length===0)continue;if(p.start>u)break;for(;c.length>0&&c[c.length-1].endPos<=p.start;)o.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?o.produceFromScopes(c[c.length-1].scopes,p.start):o.produce(s,p.start),h.retokenizeCapturedWithRuleId){const _=h.getName(l,i),k=s.contentNameScopesList.pushAttributed(_,e),w=h.getContentName(l,i),x=k.pushAttributed(w,e),$=s.push(h.retokenizeCapturedWithRuleId,p.start,-1,!1,null,k,x),A=e.createOnigString(l.substring(0,p.end));Pu(e,A,n&&p.start===0,p.start,$,o,!1,0),Ru(A);continue}const g=h.getName(l,i);if(g!==null){const k=(c.length>0?c[c.length-1].scopes:s.contentNameScopesList).pushAttributed(g,e);c.push(new ry(k,p.end))}}for(;c.length>0;)o.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var ry=class{constructor(e,t){M(this,"scopes");M(this,"endPos");this.scopes=e,this.endPos=t}};function iy(e,t,n,s,o,r,i,l){return new ay(e,t,n,s,o,r,i,l)}function pa(e,t,n,s,o){const r=jo(t,Go),i=Lu.getCompiledRuleId(n,s,o.repository);for(const l of r)e.push({debugSelector:t,matcher:l.matcher,ruleId:i,grammar:o,priority:l.priority})}function Go(e,t){if(t.length<e.length)return!1;let n=0;return e.every(s=>{for(let o=n;o<t.length;o++)if(ly(t[o],s))return n=o+1,!0;return!1})}function ly(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var ay=class{constructor(e,t,n,s,o,r,i,l){M(this,"_rootId");M(this,"_lastRuleId");M(this,"_ruleId2desc");M(this,"_includedGrammars");M(this,"_grammarRepository");M(this,"_grammar");M(this,"_injections");M(this,"_basicScopeAttributesProvider");M(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=r,this._onigLib=l,this._basicScopeAttributesProvider=new X1(n,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=i,this._grammar=ga(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const a of Object.keys(o)){const c=jo(a,Go);for(const u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:o[a]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},t=[],n=this._rootScopeName,s=e.lookup(n);if(s){const o=s.injections;if(o)for(let i in o)pa(t,i,o[i],this,s);const r=this._grammarRepository.injections(n);r&&r.forEach(i=>{const l=this.getExternalGrammar(i);if(l){const a=l.injectionSelector;a&&pa(t,a,l,this,l)}})}return t.sort((o,r)=>o.priority-r.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=ga(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const s=this._tokenize(e,t,!1,n);return{tokens:s.lineTokens.getResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}tokenizeLine2(e,t,n=0){const s=this._tokenize(e,t,!0,n);return{tokens:s.lineTokens.getBinaryResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}_tokenize(e,t,n,s){this._rootId===-1&&(this._rootId=Lu.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===hi.NULL){o=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),f=ls.set(0,c.languageId,c.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),h=this.getRule(this._rootId).getName(null,null);let p;h?p=Es.createRootAndLookUpScopeName(h,f,this):p=Es.createRoot("unknown",f),t=new hi(null,this._rootId,-1,-1,!1,null,p,p)}else o=!1,t.reset();e=e+`
|
|
78
|
-
`;const r=this.createOnigString(e),i=r.content.length,l=new uy(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),a=Pu(this,r,o,0,t,l,!0,s);return Ru(r),{lineLength:i,lineTokens:l,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function ga(e,t){return e=T1(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Es=class en{constructor(t,n,s){this.parent=t,this.scopePath=n,this.tokenAttributes=s}static fromExtension(t,n){let s=t,o=(t==null?void 0:t.scopePath)??null;for(const r of n)o=Nr.push(o,r.scopeNames),s=new en(s,o,r.encodedTokenAttributes);return s}static createRoot(t,n){return new en(null,new Nr(null,t),n)}static createRootAndLookUpScopeName(t,n,s){const o=s.getMetadataForScope(t),r=new Nr(null,t),i=s.themeProvider.themeMatch(r),l=en.mergeAttributes(n,o,i);return new en(null,r,l)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return en.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,s){let o=-1,r=0,i=0;return s!==null&&(o=s.fontStyle,r=s.foregroundId,i=s.backgroundId),ls.set(t,n.languageId,n.tokenType,null,o,r,i)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return en._pushAttributed(this,t,n);const s=t.split(/ /g);let o=this;for(const r of s)o=en._pushAttributed(o,r,n);return o}static _pushAttributed(t,n,s){const o=s.getMetadataForScope(n),r=t.scopePath.push(n),i=s.themeProvider.themeMatch(r),l=en.mergeAttributes(t.tokenAttributes,o,i);return new en(t,r,l)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){var o;const n=[];let s=this;for(;s&&s!==t;)n.push({encodedTokenAttributes:s.tokenAttributes,scopeNames:s.scopePath.getExtensionIfDefined(((o=s.parent)==null?void 0:o.scopePath)??null)}),s=s.parent;return s===t?n.reverse():void 0}},Dt,hi=(Dt=class{constructor(t,n,s,o,r,i,l,a){M(this,"_stackElementBrand");M(this,"_enterPos");M(this,"_anchorPos");M(this,"depth");this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=r,this.endRule=i,this.nameScopesList=l,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=o}equals(t){return t===null?!1:Dt._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Es.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Dt._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,s,o,r,i,l){return new Dt(this,t,n,s,o,r,i,l)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){var s,o;return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${(s=this.nameScopesList)==null?void 0:s.toString()}, ${(o=this.contentNameScopesList)==null?void 0:o.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Dt(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){var t,n,s;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((n=this.nameScopesList)==null?void 0:n.getExtensionIfDefined(((t=this.parent)==null?void 0:t.nameScopesList)??null))??[],contentNameScopesList:((s=this.contentNameScopesList)==null?void 0:s.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(t,n){const s=Es.fromExtension((t==null?void 0:t.nameScopesList)??null,n.nameScopesList);return new Dt(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,s,Es.fromExtension(s,n.contentNameScopesList))}},M(Dt,"NULL",new Dt(null,0,0,0,!1,null,null,null)),Dt),cy=class{constructor(e,t){M(this,"balancedBracketScopes");M(this,"unbalancedBracketScopes");M(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):jo(n,Go).map(s=>s.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>jo(n,Go).map(s=>s.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},uy=class{constructor(e,t,n,s){M(this,"_emitBinaryTokens");M(this,"_lineText");M(this,"_tokens");M(this,"_binaryTokens");M(this,"_lastTokenEndIndex");M(this,"_tokenTypeOverrides");this.balancedBracketSelectors=s,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){var s;if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let o=(e==null?void 0:e.tokenAttributes)??0,r=!1;if((s=this.balancedBracketSelectors)!=null&&s.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=(e==null?void 0:e.getScopeNames())??[];for(const l of this._tokenTypeOverrides)l.matcher(i)&&(o=ls.set(o,0,l.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(i))}if(r&&(o=ls.set(o,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===o){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(o),this._lastTokenEndIndex=t;return}const n=(e==null?void 0:e.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let s=0,o=this._binaryTokens.length;s<o;s++)n[s]=this._binaryTokens[s];return n}},dy=class{constructor(e,t){M(this,"_grammars",new Map);M(this,"_rawGrammars",new Map);M(this,"_injectionGrammars",new Map);M(this,"_theme");this._onigLib=t,this._theme=e}dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,s,o){if(!this._grammars.has(e)){let r=this._rawGrammars.get(e);if(!r)return null;this._grammars.set(e,iy(e,r,t,n,s,o,this,this._onigLib))}return this._grammars.get(e)}},fy=class{constructor(t){M(this,"_options");M(this,"_syncRegistry");M(this,"_ensureGrammarCache");this._options=t,this._syncRegistry=new dy(Bo.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(Bo.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,s){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:s})}loadGrammarWithConfiguration(t,n,s){return this._loadGrammar(t,n,s.embeddedLanguages,s.tokenTypes,new cy(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,s,o,r){const i=new F1(this._syncRegistry,t);for(;i.Q.length>0;)i.Q.map(l=>this._loadSingleGrammar(l.scopeName)),i.processQueue();return this._grammarForScopeName(t,n,s,o,r)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const s=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,s)}}addGrammar(t,n=[],s=0,o=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,s,o)}_grammarForScopeName(t,n=0,s=null,o=null,r=null){return this._syncRegistry.grammarForScopeName(t,n,s,o,r)}},pi=hi.NULL;const hy=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Js{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}Js.prototype.normal={};Js.prototype.property={};Js.prototype.space=void 0;function Ou(e,t){const n={},s={};for(const o of e)Object.assign(n,o.property),Object.assign(s,o.normal);return new Js(n,s,t)}function gi(e){return e.toLowerCase()}class St{constructor(t,n){this.attribute=n,this.property=t}}St.prototype.attribute="";St.prototype.booleanish=!1;St.prototype.boolean=!1;St.prototype.commaOrSpaceSeparated=!1;St.prototype.commaSeparated=!1;St.prototype.defined=!1;St.prototype.mustUseProperty=!1;St.prototype.number=!1;St.prototype.overloadedBoolean=!1;St.prototype.property="";St.prototype.spaceSeparated=!1;St.prototype.space=void 0;let py=0;const me=Hn(),Je=Hn(),mi=Hn(),H=Hn(),Ue=Hn(),Un=Hn(),Ct=Hn();function Hn(){return 2**++py}const vi=Object.freeze(Object.defineProperty({__proto__:null,boolean:me,booleanish:Je,commaOrSpaceSeparated:Ct,commaSeparated:Un,number:H,overloadedBoolean:mi,spaceSeparated:Ue},Symbol.toStringTag,{value:"Module"})),Dr=Object.keys(vi);class Ji extends St{constructor(t,n,s,o){let r=-1;if(super(t,n),ma(this,"space",o),typeof s=="number")for(;++r<Dr.length;){const i=Dr[r];ma(this,Dr[r],(s&vi[i])===vi[i])}}}Ji.prototype.defined=!0;function ma(e,t,n){n&&(e[t]=n)}function as(e){const t={},n={};for(const[s,o]of Object.entries(e.properties)){const r=new Ji(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(r.mustUseProperty=!0),t[s]=r,n[gi(s)]=s,n[gi(r.attribute)]=s}return new Js(t,n,e.space)}const Du=as({properties:{ariaActiveDescendant:null,ariaAtomic:Je,ariaAutoComplete:null,ariaBusy:Je,ariaChecked:Je,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:Ue,ariaCurrent:null,ariaDescribedBy:Ue,ariaDetails:null,ariaDisabled:Je,ariaDropEffect:Ue,ariaErrorMessage:null,ariaExpanded:Je,ariaFlowTo:Ue,ariaGrabbed:Je,ariaHasPopup:null,ariaHidden:Je,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ue,ariaLevel:H,ariaLive:null,ariaModal:Je,ariaMultiLine:Je,ariaMultiSelectable:Je,ariaOrientation:null,ariaOwns:Ue,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:Je,ariaReadOnly:Je,ariaRelevant:null,ariaRequired:Je,ariaRoleDescription:Ue,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:Je,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Bu(e,t){return t in e?e[t]:t}function ju(e,t){return Bu(e,t.toLowerCase())}const gy=as({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Un,acceptCharset:Ue,accessKey:Ue,action:null,allow:null,allowFullScreen:me,allowPaymentRequest:me,allowUserMedia:me,alpha:me,alt:null,as:null,async:me,autoCapitalize:null,autoComplete:Ue,autoFocus:me,autoPlay:me,blocking:Ue,capture:null,charSet:null,checked:me,cite:null,className:Ue,closedBy:null,colorSpace:null,cols:H,colSpan:H,command:null,commandFor:null,content:null,contentEditable:Je,controls:me,controlsList:Ue,coords:H|Un,crossOrigin:null,data:null,dateTime:null,decoding:null,default:me,defer:me,dir:null,dirName:null,disabled:me,download:mi,draggable:Je,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:me,formTarget:null,headers:Ue,height:H,hidden:mi,high:H,href:null,hrefLang:null,htmlFor:Ue,httpEquiv:Ue,id:null,imageSizes:null,imageSrcSet:null,inert:me,inputMode:null,integrity:null,is:null,isMap:me,itemId:null,itemProp:Ue,itemRef:Ue,itemScope:me,itemType:Ue,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:me,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:me,muted:me,name:null,nonce:null,noModule:me,noValidate:me,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:me,optimum:H,pattern:null,ping:Ue,placeholder:null,playsInline:me,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:me,referrerPolicy:null,rel:Ue,required:me,reversed:me,rows:H,rowSpan:H,sandbox:Ue,scope:null,scoped:me,seamless:me,selected:me,shadowRootClonable:me,shadowRootCustomElementRegistry:me,shadowRootDelegatesFocus:me,shadowRootMode:null,shadowRootSerializable:me,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:Je,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:me,useMap:null,value:Je,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ue,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:me,declare:me,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:me,noHref:me,noShade:me,noWrap:me,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:Je,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:me,disablePictureInPicture:me,disableRemotePlayback:me,exportParts:Un,part:Ue,prefix:null,property:null,results:H,security:null,unselectable:null},space:"html",transform:ju}),my=as({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ct,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:Ue,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:me,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Un,g2:Un,glyphName:Un,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:Ct,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:H,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ue,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ct,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ct,rev:Ct,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ct,requiredFeatures:Ct,requiredFonts:Ct,requiredFormats:Ct,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:Ct,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ct,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ct,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Bu}),Uu=as({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Fu=as({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ju}),Gu=as({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),vy=/[A-Z]/g,va=/-[a-z]/g,yy=/^data[-\w.:]+$/i;function by(e,t){const n=gi(t);let s=t,o=St;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&yy.test(t)){if(t.charAt(4)==="-"){const r=t.slice(5).replace(va,wy);s="data"+r.charAt(0).toUpperCase()+r.slice(1)}else{const r=t.slice(4);if(!va.test(r)){let i=r.replace(vy,ky);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}o=Ji}return new o(s,t)}function ky(e){return"-"+e.toLowerCase()}function wy(e){return e.charAt(1).toUpperCase()}const _y=Ou([Du,gy,Uu,Fu,Gu],"html"),zu=Ou([Du,my,Uu,Fu,Gu],"svg"),ya={}.hasOwnProperty;function Sy(e,t){const n=t||{};function s(o,...r){let i=s.invalid;const l=s.handlers;if(o&&ya.call(o,e)){const a=String(o[e]);i=ya.call(l,a)?l[a]:s.unknown}if(i)return i.call(this,o,...r)}return s.handlers=n.handlers||{},s.invalid=n.invalid,s.unknown=n.unknown,s}const xy=/["&'<>`]/g,Cy=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,$y=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ty=/[|\\{}()[\]^$+*?.]/g,ba=new WeakMap;function Ay(e,t){if(e=e.replace(t.subset?Ry(t.subset):xy,s),t.subset||t.escapeOnly)return e;return e.replace(Cy,n).replace($y,s);function n(o,r,i){return t.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,i.charCodeAt(r+2),t)}function s(o,r,i){return t.format(o.charCodeAt(0),i.charCodeAt(r+1),t)}}function Ry(e){let t=ba.get(e);return t||(t=Ey(e),ba.set(e,t)),t}function Ey(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Ty,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Iy=/[\dA-Fa-f]/;function Ly(e,t,n){const s="&#x"+e.toString(16).toUpperCase();return n&&t&&!Iy.test(String.fromCharCode(t))?s:s+";"}const My=/\d/;function Py(e,t,n){const s="&#"+String(e);return n&&t&&!My.test(String.fromCharCode(t))?s:s+";"}const Ny=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Br={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Oy=["cent","copy","divide","gt","lt","not","para","times"],Hu={}.hasOwnProperty,yi={};let co;for(co in Br)Hu.call(Br,co)&&(yi[Br[co]]=co);const Dy=/[^\dA-Za-z]/;function By(e,t,n,s){const o=String.fromCharCode(e);if(Hu.call(yi,o)){const r=yi[o],i="&"+r;return n&&Ny.includes(r)&&!Oy.includes(r)&&(!s||t&&t!==61&&Dy.test(String.fromCharCode(t)))?i:i+";"}return""}function jy(e,t,n){let s=Ly(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=By(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const r=Py(e,t,n.omitOptionalSemicolons);r.length<s.length&&(s=r)}return o&&(!n.useShortestReferences||o.length<s.length)?o:s}function os(e,t){return Ay(e,Object.assign({format:jy},t))}const Uy=/^>|^->|<!--|-->|--!>|<!-$/g,Fy=[">"],Gy=["<",">"];function zy(e,t,n,s){return s.settings.bogusComments?"<?"+os(e.value,Object.assign({},s.settings.characterReferences,{subset:Fy}))+">":"<!--"+e.value.replace(Uy,o)+"-->";function o(r){return os(r,Object.assign({},s.settings.characterReferences,{subset:Gy}))}}function Hy(e,t,n,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}function ka(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,o=n.indexOf(t);for(;o!==-1;)s++,o=n.indexOf(t,o+t.length);return s}function qy(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Wy(e){return e.join(" ").trim()}const Vy=/[ \t\n\f\r]/g;function Yi(e){return typeof e=="object"?e.type==="text"?wa(e.value):!1:wa(e)}function wa(e){return e.replace(Vy,"")===""}const nt=Wu(1),qu=Wu(-1),Ky=[];function Wu(e){return t;function t(n,s,o){const r=n?n.children:Ky;let i=(s||0)+e,l=r[i];if(!o)for(;l&&Yi(l);)i+=e,l=r[i];return l}}const Zy={}.hasOwnProperty;function Vu(e){return t;function t(n,s,o){return Zy.call(e,n.tagName)&&e[n.tagName](n,s,o)}}const Xi=Vu({body:Yy,caption:jr,colgroup:jr,dd:t0,dt:e0,head:jr,html:Jy,li:Qy,optgroup:n0,option:s0,p:Xy,rp:_a,rt:_a,tbody:r0,td:Sa,tfoot:i0,th:Sa,thead:o0,tr:l0});function jr(e,t,n){const s=nt(n,t,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&Yi(s.value.charAt(0)))}function Jy(e,t,n){const s=nt(n,t);return!s||s.type!=="comment"}function Yy(e,t,n){const s=nt(n,t);return!s||s.type!=="comment"}function Xy(e,t,n){const s=nt(n,t);return s?s.type==="element"&&(s.tagName==="address"||s.tagName==="article"||s.tagName==="aside"||s.tagName==="blockquote"||s.tagName==="details"||s.tagName==="div"||s.tagName==="dl"||s.tagName==="fieldset"||s.tagName==="figcaption"||s.tagName==="figure"||s.tagName==="footer"||s.tagName==="form"||s.tagName==="h1"||s.tagName==="h2"||s.tagName==="h3"||s.tagName==="h4"||s.tagName==="h5"||s.tagName==="h6"||s.tagName==="header"||s.tagName==="hgroup"||s.tagName==="hr"||s.tagName==="main"||s.tagName==="menu"||s.tagName==="nav"||s.tagName==="ol"||s.tagName==="p"||s.tagName==="pre"||s.tagName==="section"||s.tagName==="table"||s.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function Qy(e,t,n){const s=nt(n,t);return!s||s.type==="element"&&s.tagName==="li"}function e0(e,t,n){const s=nt(n,t);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function t0(e,t,n){const s=nt(n,t);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function _a(e,t,n){const s=nt(n,t);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function n0(e,t,n){const s=nt(n,t);return!s||s.type==="element"&&s.tagName==="optgroup"}function s0(e,t,n){const s=nt(n,t);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function o0(e,t,n){const s=nt(n,t);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function r0(e,t,n){const s=nt(n,t);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function i0(e,t,n){return!nt(n,t)}function l0(e,t,n){const s=nt(n,t);return!s||s.type==="element"&&s.tagName==="tr"}function Sa(e,t,n){const s=nt(n,t);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const a0=Vu({body:d0,colgroup:f0,head:u0,html:c0,tbody:h0});function c0(e){const t=nt(e,-1);return!t||t.type!=="comment"}function u0(e){const t=new Set;for(const s of e.children)if(s.type==="element"&&(s.tagName==="base"||s.tagName==="title")){if(t.has(s.tagName))return!1;t.add(s.tagName)}const n=e.children[0];return!n||n.type==="element"}function d0(e){const t=nt(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Yi(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function f0(e,t,n){const s=qu(n,t),o=nt(e,-1,!0);return n&&s&&s.type==="element"&&s.tagName==="colgroup"&&Xi(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function h0(e,t,n){const s=qu(n,t),o=nt(e,-1);return n&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&Xi(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const uo={name:[[`
|
|
79
|
-
\f\r &/=>`.split(""),`
|
|
80
|
-
\f\r "&'/=>\``.split("")],[`\0
|
|
81
|
-
\f\r "&'/<=>`.split(""),`\0
|
|
82
|
-
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
83
|
-
\f\r &>`.split(""),`\0
|
|
84
|
-
\f\r "&'<=>\``.split("")],[`\0
|
|
85
|
-
\f\r "&'<=>\``.split(""),`\0
|
|
86
|
-
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function p0(e,t,n,s){const o=s.schema,r=o.space==="svg"?!1:s.settings.omitOptionalTags;let i=o.space==="svg"?s.settings.closeEmptyElements:s.settings.voids.includes(e.tagName.toLowerCase());const l=[];let a;o.space==="html"&&e.tagName==="svg"&&(s.schema=zu);const c=g0(s,e.properties),u=s.all(o.space==="html"&&e.tagName==="template"?e.content:e);return s.schema=o,u&&(i=!1),(c||!r||!a0(e,t,n))&&(l.push("<",e.tagName,c?" "+c:""),i&&(o.space==="svg"||s.settings.closeSelfClosing)&&(a=c.charAt(c.length-1),(!s.settings.tightSelfClosing||a==="/"||a&&a!=='"'&&a!=="'")&&l.push(" "),l.push("/")),l.push(">")),l.push(u),!i&&(!r||!Xi(e,t,n))&&l.push("</"+e.tagName+">"),l.join("")}function g0(e,t){const n=[];let s=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const r=m0(e,o,t[o]);r&&n.push(r)}}for(;++s<n.length;){const r=e.settings.tightAttributes?n[s].charAt(n[s].length-1):void 0;s!==n.length-1&&r!=='"'&&r!=="'"&&(n[s]+=" ")}return n.join("")}function m0(e,t,n){const s=by(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,r=e.settings.allowDangerousCharacters?0:1;let i=e.quote,l;if(s.overloadedBoolean&&(n===s.attribute||n==="")?n=!0:(s.boolean||s.overloadedBoolean)&&(typeof n!="string"||n===s.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const a=os(s.attribute,Object.assign({},e.settings.characterReferences,{subset:uo.name[o][r]}));return n===!0||(n=Array.isArray(n)?(s.commaSeparated?qy:Wy)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?a:(e.settings.preferUnquoted&&(l=os(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:uo.unquoted[o][r]}))),l!==n&&(e.settings.quoteSmart&&ka(n,i)>ka(n,e.alternative)&&(i=e.alternative),l=i+os(n,Object.assign({},e.settings.characterReferences,{subset:(i==="'"?uo.single:uo.double)[o][r],attribute:!0}))+i),a+(l&&"="+l))}const v0=["<","&"];function Ku(e,t,n,s){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:os(e.value,Object.assign({},s.settings.characterReferences,{subset:v0}))}function y0(e,t,n,s){return s.settings.allowDangerousHtml?e.value:Ku(e,t,n,s)}function b0(e,t,n,s){return s.all(e)}const k0=Sy("type",{invalid:w0,unknown:_0,handlers:{comment:zy,doctype:Hy,element:p0,raw:y0,root:b0,text:Ku}});function w0(e){throw new Error("Expected node, not `"+e+"`")}function _0(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const S0={},x0={},C0=[];function $0(e,t){const n=t||S0,s=n.quote||'"',o=s==='"'?"'":'"';if(s!=='"'&&s!=="'")throw new Error("Invalid quote `"+s+"`, expected `'` or `\"`");return{one:T0,all:A0,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||hy,characterReferences:n.characterReferences||x0,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?zu:_y,quote:s,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function T0(e,t,n){return k0(e,t,n,this)}function A0(e){const t=[],n=e&&e.children||C0;let s=-1;for(;++s<n.length;)t[s]=this.one(n[s],s,e);return t.join("")}function zo(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},s=typeof e=="string"?e:e.name;for(const[o,r]of Object.entries((t==null?void 0:t.colorReplacements)||{}))typeof r=="string"?n[o]=r:o===s&&Object.assign(n,r);return n}function Tn(e,t){return e&&((t==null?void 0:t[e==null?void 0:e.toLowerCase()])||e)}function R0(e){return Array.isArray(e)?e:[e]}async function Zu(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Qi(e){return!e||["plaintext","txt","text","plain"].includes(e)}function E0(e){return e==="ansi"||Qi(e)}function el(e){return e==="none"}function I0(e){return el(e)}function Ju(e,t){var s;if(!t)return e;e.properties||(e.properties={}),(s=e.properties).class||(s.class=[]),typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const o of n)o&&!e.properties.class.includes(o)&&e.properties.class.push(o);return e}function pr(e,t=!1){var r;if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let s=0;const o=[];for(let i=0;i<n.length;i+=2){const l=t?n[i]+(n[i+1]||""):n[i];o.push([l,s]),s+=n[i].length,s+=((r=n[i+1])==null?void 0:r.length)||0}return o}function L0(e){const t=pr(e,!0).map(([o])=>o);function n(o){if(o===e.length)return{line:t.length-1,character:t[t.length-1].length};let r=o,i=0;for(const l of t){if(r<l.length)break;r-=l.length,i++}return{line:i,character:r}}function s(o,r){let i=0;for(let l=0;l<o;l++)i+=t[l].length;return i+=r,i}return{lines:t,indexToPos:n,posToIndex:s}}const tl="light-dark()",M0=["color","background-color"];function P0(e,t){let n=0;const s=[];for(const o of t)o>n&&s.push({...e,content:e.content.slice(n,o),offset:e.offset+n}),n=o;return n<e.content.length&&s.push({...e,content:e.content.slice(n),offset:e.offset+n}),s}function N0(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((s,o)=>s-o);return n.length?e.map(s=>s.flatMap(o=>{const r=n.filter(i=>o.offset<i&&i<o.offset+o.content.length).map(i=>i-o.offset).sort((i,l)=>i-l);return r.length?P0(o,r):o})):e}function O0(e,t,n,s,o="css-vars"){const r={content:e.content,explanation:e.explanation,offset:e.offset},i=t.map(u=>Ho(e.variants[u])),l=new Set(i.flatMap(u=>Object.keys(u))),a={},c=(u,f)=>{const h=f==="color"?"":f==="background-color"?"-bg":`-${f}`;return n+t[u]+(f==="color"?"":h)};return i.forEach((u,f)=>{for(const h of l){const p=u[h]||"inherit";if(f===0&&s&&M0.includes(h))if(s===tl&&i.length>1){const g=t.findIndex(x=>x==="light"),_=t.findIndex(x=>x==="dark");if(g===-1||_===-1)throw new ot('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const k=i[g][h]||"inherit",w=i[_][h]||"inherit";a[h]=`light-dark(${k}, ${w})`,o==="css-vars"&&(a[c(f,h)]=p)}else a[h]=p;else o==="css-vars"&&(a[c(f,h)]=p)}}),r.htmlStyle=a,r}function Ho(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&pt.Italic&&(t["font-style"]="italic"),e.fontStyle&pt.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&pt.Underline&&n.push("underline"),e.fontStyle&pt.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function bi(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const Yu=new WeakMap;function gr(e,t){Yu.set(e,t)}function zs(e){return Yu.get(e)}class cs{constructor(...t){M(this,"_stacks",{});M(this,"lang");if(t.length===2){const[n,s]=t;this.lang=s,this._stacks=n}else{const[n,s,o]=t;this.lang=s,this._stacks={[o]:n}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new cs(Object.fromEntries(R0(n).map(s=>[s,pi])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return D0(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function D0(e){const t=[],n=new Set;function s(o){var i;if(n.has(o))return;n.add(o);const r=(i=o==null?void 0:o.nameScopesList)==null?void 0:i.scopeName;r&&t.push(r),o.parent&&s(o.parent)}return s(e),t}function B0(e,t){if(!(e instanceof cs))throw new ot("Invalid grammar state");return e.getInternalStack(t)}function j0(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let s=function(i){if(typeof i=="number"){if(i<0||i>n.source.length)throw new ot(`Invalid decoration offset: ${i}. Code length: ${n.source.length}`);return{...o.indexToPos(i),offset:i}}else{const l=o.lines[i.line];if(l===void 0)throw new ot(`Invalid decoration position ${JSON.stringify(i)}. Lines length: ${o.lines.length}`);let a=i.character;if(a<0&&(a=l.length+a),a<0||a>l.length)throw new ot(`Invalid decoration position ${JSON.stringify(i)}. Line ${i.line} length: ${l.length}`);return{...i,character:a,offset:o.posToIndex(i.line,a)}}};const o=L0(n.source),r=(n.options.decorations||[]).map(i=>({...i,start:s(i.start),end:s(i.end)}));U0(r),e.set(n.meta,{decorations:r,converter:o,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){var i;if(!((i=this.options.decorations)!=null&&i.length))return;const o=t(this).decorations.flatMap(l=>[l.start.offset,l.end.offset]);return N0(n,o)},code(n){var u;if(!((u=this.options.decorations)!=null&&u.length))return;const s=t(this),o=Array.from(n.children).filter(f=>f.type==="element"&&f.tagName==="span");if(o.length!==s.converter.lines.length)throw new ot(`Number of lines in code element (${o.length}) does not match the number of lines in the source (${s.converter.lines.length}). Failed to apply decorations.`);function r(f,h,p,g){const _=o[f];let k="",w=-1,x=-1;if(h===0&&(w=0),p===0&&(x=0),p===Number.POSITIVE_INFINITY&&(x=_.children.length),w===-1||x===-1)for(let A=0;A<_.children.length;A++)k+=Xu(_.children[A]),w===-1&&k.length===h&&(w=A+1),x===-1&&k.length===p&&(x=A+1);if(w===-1)throw new ot(`Failed to find start index for decoration ${JSON.stringify(g.start)}`);if(x===-1)throw new ot(`Failed to find end index for decoration ${JSON.stringify(g.end)}`);const $=_.children.slice(w,x);if(!g.alwaysWrap&&$.length===_.children.length)l(_,g,"line");else if(!g.alwaysWrap&&$.length===1&&$[0].type==="element")l($[0],g,"token");else{const A={type:"element",tagName:"span",properties:{},children:$};l(A,g,"wrapper"),_.children.splice(w,$.length,A)}}function i(f,h){o[f]=l(o[f],h,"line")}function l(f,h,p){var k;const g=h.properties||{},_=h.transform||(w=>w);return f.tagName=h.tagName||"span",f.properties={...f.properties,...g,class:f.properties.class},(k=h.properties)!=null&&k.class&&Ju(f,h.properties.class),f=_(f,p)||f,f}const a=[],c=s.decorations.sort((f,h)=>h.start.offset-f.start.offset||f.end.offset-h.end.offset);for(const f of c){const{start:h,end:p}=f;if(h.line===p.line)r(h.line,h.character,p.character,f);else if(h.line<p.line){r(h.line,h.character,Number.POSITIVE_INFINITY,f);for(let g=h.line+1;g<p.line;g++)a.unshift(()=>i(g,f));r(p.line,0,p.character,f)}}a.forEach(f=>f())}}}function U0(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new ot(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let s=t+1;s<e.length;s++){const o=e[s],r=n.start.offset<=o.start.offset&&o.start.offset<n.end.offset,i=n.start.offset<o.end.offset&&o.end.offset<=n.end.offset,l=o.start.offset<=n.start.offset&&n.start.offset<o.end.offset,a=o.start.offset<n.end.offset&&n.end.offset<=o.end.offset;if(r||i||l||a){if(r&&i||l&&a||l&&n.start.offset===n.end.offset||i&&o.start.offset===o.end.offset)continue;throw new ot(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function Xu(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Xu).join(""):""}const F0=[j0()];function qo(e){const t=G0(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...F0]}function G0(e){const t=[],n=[],s=[];for(const o of e)switch(o.enforce){case"pre":t.push(o);break;case"post":n.push(o);break;default:s.push(o)}return{pre:t,post:n,normal:s}}var Dn=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Ur={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function z0(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const s=e.indexOf("m",n);if(s!==-1)return{sequence:e.substring(n+2,s).split(";"),startPosition:n,position:s+1}}return{position:e.length}}function xa(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(s=>Number.parseInt(s));return n.length!==3||n.some(s=>Number.isNaN(s))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function H0(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const s=Number.parseInt(n);if(!Number.isNaN(s))if(s===0)t.push({type:"resetAll"});else if(s<=9)Ur[s]&&t.push({type:"setDecoration",value:Ur[s]});else if(s<=29){const o=Ur[s-20];o&&(t.push({type:"resetDecoration",value:o}),o==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(s<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Dn[s-30]}});else if(s===38){const o=xa(e);o&&t.push({type:"setForegroundColor",value:o})}else if(s===39)t.push({type:"resetForegroundColor"});else if(s<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Dn[s-40]}});else if(s===48){const o=xa(e);o&&t.push({type:"setBackgroundColor",value:o})}else s===49?t.push({type:"resetBackgroundColor"}):s===53?t.push({type:"setDecoration",value:"overline"}):s===55?t.push({type:"resetDecoration",value:"overline"}):s>=90&&s<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Dn[s-90+8]}}):s>=100&&s<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Dn[s-100+8]}})}return t}function q0(){let e=null,t=null,n=new Set;return{parse(s){const o=[];let r=0;do{const i=z0(s,r),l=i.sequence?s.substring(r,i.startPosition):s.substring(r);if(l.length>0&&o.push({value:l,foreground:e,background:t,decorations:new Set(n)}),i.sequence){const a=H0(i.sequence);for(const c of a)c.type==="resetAll"?(e=null,t=null,n.clear()):c.type==="resetForegroundColor"?e=null:c.type==="resetBackgroundColor"?t=null:c.type==="resetDecoration"&&n.delete(c.value);for(const c of a)c.type==="setForegroundColor"?e=c.value:c.type==="setBackgroundColor"?t=c.value:c.type==="setDecoration"&&n.add(c.value)}r=i.position}while(r<s.length);return o}}}var W0={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function V0(e=W0){function t(l){return e[l]}function n(l){return`#${l.map(a=>Math.max(0,Math.min(a,255)).toString(16).padStart(2,"0")).join("")}`}let s;function o(){if(s)return s;s=[];for(let c=0;c<Dn.length;c++)s.push(t(Dn[c]));let l=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let u=0;u<6;u++)for(let f=0;f<6;f++)s.push(n([l[c],l[u],l[f]]));let a=8;for(let c=0;c<24;c++,a+=10)s.push(n([a,a,a]));return s}function r(l){return o()[l]}function i(l){switch(l.type){case"named":return t(l.name);case"rgb":return n(l.rgb);case"table":return r(l.index)}}return{value:i}}const K0={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function Z0(e,t,n){const s=zo(e,n),o=pr(t),r=Object.fromEntries(Dn.map(a=>{var f;const c=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`,u=(f=e.colors)==null?void 0:f[c];return[a,u||K0[a]]})),i=V0(r),l=q0();return o.map(a=>l.parse(a[0]).map(c=>{let u,f;c.decorations.has("reverse")?(u=c.background?i.value(c.background):e.bg,f=c.foreground?i.value(c.foreground):e.fg):(u=c.foreground?i.value(c.foreground):e.fg,f=c.background?i.value(c.background):void 0),u=Tn(u,s),f=Tn(f,s),c.decorations.has("dim")&&(u=J0(u));let h=pt.None;return c.decorations.has("bold")&&(h|=pt.Bold),c.decorations.has("italic")&&(h|=pt.Italic),c.decorations.has("underline")&&(h|=pt.Underline),c.decorations.has("strikethrough")&&(h|=pt.Strikethrough),{content:c.value,offset:a[1],color:u,bgColor:f,fontStyle:h}}))}function J0(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const s=t[1];if(s.length===8){const o=Math.round(Number.parseInt(s.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${s.slice(0,6)}${o}`}else{if(s.length===6)return`#${s}80`;if(s.length===4){const o=s[0],r=s[1],i=s[2],l=s[3],a=Math.round(Number.parseInt(`${l}${l}`,16)/2).toString(16).padStart(2,"0");return`#${o}${o}${r}${r}${i}${i}${a}`}else if(s.length===3){const o=s[0],r=s[1],i=s[2];return`#${o}${o}${r}${r}${i}${i}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function nl(e,t,n={}){const{theme:s=e.getLoadedThemes()[0]}=n,o=e.resolveLangAlias(n.lang||"text");if(Qi(o)||el(s))return pr(t).map(a=>[{content:a[0],offset:a[1]}]);const{theme:r,colorMap:i}=e.setTheme(s);if(o==="ansi")return Z0(r,t,n);const l=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==l.name)throw new ot(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${l.name}"`);if(!n.grammarState.themes.includes(r.name))throw new ot(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${r.name}"`)}return X0(t,l,r,i,n)}function Y0(...e){if(e.length===2)return zs(e[1]);const[t,n,s={}]=e,{lang:o="text",theme:r=t.getLoadedThemes()[0]}=s;if(Qi(o)||el(r))throw new ot("Plain language does not have grammar state");if(o==="ansi")throw new ot("ANSI language does not have grammar state");const{theme:i,colorMap:l}=t.setTheme(r),a=t.getLanguage(o);return new cs(sl(n,a,i,l,s).stateStack,a.name,i.name)}function X0(e,t,n,s,o){const r=sl(e,t,n,s,o),i=new cs(r.stateStack,t.name,n.name);return gr(r.tokens,i),r.tokens}function sl(e,t,n,s,o){const r=zo(n,o),{tokenizeMaxLineLength:i=0,tokenizeTimeLimit:l=500}=o,a=pr(e);let c=o.grammarState?B0(o.grammarState,n.name)??pi:o.grammarContextCode!=null?sl(o.grammarContextCode,t,n,s,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:pi,u=[];const f=[];for(let h=0,p=a.length;h<p;h++){const[g,_]=a[h];if(g===""){u=[],f.push([]);continue}if(i>0&&g.length>=i){u=[],f.push([{content:g,offset:_,color:"",fontStyle:0}]);continue}let k,w,x;o.includeExplanation&&(k=t.tokenizeLine(g,c,l),w=k.tokens,x=0);const $=t.tokenizeLine2(g,c,l),A=$.tokens.length/2;for(let G=0;G<A;G++){const Q=$.tokens[2*G],C=G+1<A?$.tokens[2*G+2]:g.length;if(Q===C)continue;const R=$.tokens[2*G+1],L=Tn(s[ls.getForeground(R)],r),J=ls.getFontStyle(R),ie={content:g.substring(Q,C),offset:_+Q,color:L,fontStyle:J};if(o.includeExplanation){const z=[];if(o.includeExplanation!=="scopeName")for(const O of n.settings){let P;switch(typeof O.scope){case"string":P=O.scope.split(/,/).map(te=>te.trim());break;case"object":P=O.scope;break;default:continue}z.push({settings:O,selectors:P.map(te=>te.split(/ /))})}ie.explanation=[];let ve=0;for(;Q+ve<C;){const O=w[x],P=g.substring(O.startIndex,O.endIndex);ve+=P.length,ie.explanation.push({content:P,scopes:o.includeExplanation==="scopeName"?Q0(O.scopes):eb(z,O.scopes)}),x+=1}}u.push(ie)}f.push(u),u=[],c=$.ruleStack}return{tokens:f,stateStack:c}}function Q0(e){return e.map(t=>({scopeName:t}))}function eb(e,t){const n=[];for(let s=0,o=t.length;s<o;s++){const r=t[s];n[s]={scopeName:r,themeMatches:nb(e,r,t.slice(0,s))}}return n}function Ca(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function tb(e,t,n){if(!Ca(e[e.length-1],t))return!1;let s=e.length-2,o=n.length-1;for(;s>=0&&o>=0;)Ca(e[s],n[o])&&(s-=1),o-=1;return s===-1}function nb(e,t,n){const s=[];for(const{selectors:o,settings:r}of e)for(const i of o)if(tb(i,t,n)){s.push(r);break}return s}function Qu(e,t,n){const s=Object.entries(n.themes).filter(a=>a[1]).map(a=>({color:a[0],theme:a[1]})),o=s.map(a=>{const c=nl(e,t,{...n,theme:a.theme}),u=zs(c),f=typeof a.theme=="string"?a.theme:a.theme.name;return{tokens:c,state:u,theme:f}}),r=sb(...o.map(a=>a.tokens)),i=r[0].map((a,c)=>a.map((u,f)=>{const h={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(h.explanation=u.explanation),r.forEach((p,g)=>{const{content:_,explanation:k,offset:w,...x}=p[c][f];h.variants[s[g].color]=x}),h})),l=o[0].state?new cs(Object.fromEntries(o.map(a=>{var c;return[a.theme,(c=a.state)==null?void 0:c.getInternalStack(a.theme)]})),o[0].state.lang):void 0;return l&&gr(i,l),i}function sb(...e){const t=e.map(()=>[]),n=e.length;for(let s=0;s<e[0].length;s++){const o=e.map(a=>a[s]),r=t.map(()=>[]);t.forEach((a,c)=>a.push(r[c]));const i=o.map(()=>0),l=o.map(a=>a[0]);for(;l.every(a=>a);){const a=Math.min(...l.map(c=>c.content.length));for(let c=0;c<n;c++){const u=l[c];u.content.length===a?(r[c].push(u),i[c]+=1,l[c]=o[c][i[c]]):(r[c].push({...u,content:u.content.slice(0,a)}),l[c]={...u,content:u.content.slice(a),offset:u.offset+a})}}}return t}function Wo(e,t,n){let s,o,r,i,l,a;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:u="--shiki-",colorsRendering:f="css-vars"}=n,h=Object.entries(n.themes).filter(w=>w[1]).map(w=>({color:w[0],theme:w[1]})).sort((w,x)=>w.color===c?-1:x.color===c?1:0);if(h.length===0)throw new ot("`themes` option must not be empty");const p=Qu(e,t,n);if(a=zs(p),c&&tl!==c&&!h.find(w=>w.color===c))throw new ot(`\`themes\` option must contain the defaultColor key \`${c}\``);const g=h.map(w=>e.getTheme(w.theme)),_=h.map(w=>w.color);r=p.map(w=>w.map(x=>O0(x,_,u,c,f))),a&&gr(r,a);const k=h.map(w=>zo(w.theme,n));o=$a(h,g,k,u,c,"fg",f),s=$a(h,g,k,u,c,"bg",f),i=`shiki-themes ${g.map(w=>w.name).join(" ")}`,l=c?void 0:[o,s].join(";")}else if("theme"in n){const c=zo(n.theme,n);r=nl(e,t,n);const u=e.getTheme(n.theme);s=Tn(u.bg,c),o=Tn(u.fg,c),i=u.name,a=zs(r)}else throw new ot("Invalid options, either `theme` or `themes` must be provided");return{tokens:r,fg:o,bg:s,themeName:i,rootStyle:l,grammarState:a}}function $a(e,t,n,s,o,r,i){return e.map((l,a)=>{const c=Tn(t[a][r],n[a])||"inherit",u=`${s+l.color}${r==="bg"?"-bg":""}:${c}`;if(a===0&&o){if(o===tl&&e.length>1){const f=e.findIndex(_=>_.color==="light"),h=e.findIndex(_=>_.color==="dark");if(f===-1||h===-1)throw new ot('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const p=Tn(t[f][r],n[f])||"inherit",g=Tn(t[h][r],n[h])||"inherit";return`light-dark(${p}, ${g});${u}`}return c}return i==="css-vars"?u:null}).filter(l=>!!l).join(";")}function Vo(e,t,n,s={meta:{},options:n,codeToHast:(o,r)=>Vo(e,o,r),codeToTokens:(o,r)=>Wo(e,o,r)}){var g,_;let o=t;for(const k of qo(n))o=((g=k.preprocess)==null?void 0:g.call(s,o,n))||o;let{tokens:r,fg:i,bg:l,themeName:a,rootStyle:c,grammarState:u}=Wo(e,o,n);const{mergeWhitespaces:f=!0,mergeSameStyleTokens:h=!1}=n;f===!0?r=rb(r):f==="never"&&(r=ib(r)),h&&(r=lb(r));const p={...s,get source(){return o}};for(const k of qo(n))r=((_=k.tokens)==null?void 0:_.call(p,r))||r;return ob(r,{...n,fg:i,bg:l,themeName:a,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},p,u)}function ob(e,t,n,s=zs(e)){var _,k,w,x;const o=qo(t),r=[],i={type:"root",children:[]},{structure:l="classic",tabindex:a="0"}=t,c={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?c.style=t.rootStyle:c.style=`background-color:${t.bg};color:${t.fg}`),a!==!1&&a!=null&&(c.tabindex=a.toString());for(const[$,A]of Object.entries(t.meta||{}))$.startsWith("_")||(c[$]=A);let u={type:"element",tagName:"pre",properties:c,children:[],data:t.data},f={type:"element",tagName:"code",properties:{},children:r};const h=[],p={...n,structure:l,addClassToHast:Ju,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return i},get pre(){return u},get code(){return f},get lines(){return h}};if(e.forEach(($,A)=>{var C,R;A&&(l==="inline"?i.children.push({type:"element",tagName:"br",properties:{},children:[]}):l==="classic"&&r.push({type:"text",value:`
|
|
87
|
-
`}));let G={type:"element",tagName:"span",properties:{class:"line"},children:[]},Q=0;for(const L of $){let J={type:"element",tagName:"span",properties:{...L.htmlAttrs},children:[{type:"text",value:L.content}]};const ie=bi(L.htmlStyle||Ho(L));ie&&(J.properties.style=ie);for(const z of o)J=((C=z==null?void 0:z.span)==null?void 0:C.call(p,J,A+1,Q,G,L))||J;l==="inline"?i.children.push(J):l==="classic"&&G.children.push(J),Q+=L.content.length}if(l==="classic"){for(const L of o)G=((R=L==null?void 0:L.line)==null?void 0:R.call(p,G,A+1))||G;h.push(G),r.push(G)}else l==="inline"&&h.push(G)}),l==="classic"){for(const $ of o)f=((_=$==null?void 0:$.code)==null?void 0:_.call(p,f))||f;u.children.push(f);for(const $ of o)u=((k=$==null?void 0:$.pre)==null?void 0:k.call(p,u))||u;i.children.push(u)}else if(l==="inline"){const $=[];let A={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const C of i.children)C.type==="element"&&C.tagName==="br"?($.push(A),A={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(C.type==="element"||C.type==="text")&&A.children.push(C);$.push(A);let Q={type:"element",tagName:"code",properties:{},children:$};for(const C of o)Q=((w=C==null?void 0:C.code)==null?void 0:w.call(p,Q))||Q;i.children=[];for(let C=0;C<Q.children.length;C++){C>0&&i.children.push({type:"element",tagName:"br",properties:{},children:[]});const R=Q.children[C];R.type==="element"&&i.children.push(...R.children)}}let g=i;for(const $ of o)g=((x=$==null?void 0:$.root)==null?void 0:x.call(p,g))||g;return s&&gr(g,s),g}function rb(e){return e.map(t=>{const n=[];let s="",o;return t.forEach((r,i)=>{const a=!(r.fontStyle&&(r.fontStyle&pt.Underline||r.fontStyle&pt.Strikethrough));a&&r.content.match(/^\s+$/)&&t[i+1]?(o===void 0&&(o=r.offset),s+=r.content):s?(a?n.push({...r,offset:o,content:s+r.content}):n.push({content:s,offset:o},r),o=void 0,s=""):n.push(r)}),n})}function ib(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const s=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!s)return n;const[,o,r,i]=s;if(!o&&!i)return n;const l=[{...n,offset:n.offset+o.length,content:r}];return o&&l.unshift({content:o,offset:n.offset}),i&&l.push({content:i,offset:n.offset+o.length+r.length}),l}))}function lb(e){return e.map(t=>{const n=[];for(const s of t){if(n.length===0){n.push({...s});continue}const o=n[n.length-1],r=bi(o.htmlStyle||Ho(o)),i=bi(s.htmlStyle||Ho(s)),l=o.fontStyle&&(o.fontStyle&pt.Underline||o.fontStyle&pt.Strikethrough),a=s.fontStyle&&(s.fontStyle&pt.Underline||s.fontStyle&pt.Strikethrough);!l&&!a&&r===i?o.content+=s.content:n.push({...s})}return n})}const ab=$0;function cb(e,t,n){var r;const s={meta:{},options:n,codeToHast:(i,l)=>Vo(e,i,l),codeToTokens:(i,l)=>Wo(e,i,l)};let o=ab(Vo(e,t,n,s));for(const i of qo(n))o=((r=i.postprocess)==null?void 0:r.call(s,o,n))||o;return o}const Ta={light:"#333333",dark:"#bbbbbb"},Aa={light:"#fffffe",dark:"#1e1e1e"},Ra="__shiki_resolved";function ol(e){var l,a,c,u,f;if(e!=null&&e[Ra])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||(t.type="dark"),t.colorReplacements={...t.colorReplacements},t.settings||(t.settings=[]);let{bg:n,fg:s}=t;if(!n||!s){const h=t.settings?t.settings.find(p=>!p.name&&!p.scope):void 0;(l=h==null?void 0:h.settings)!=null&&l.foreground&&(s=h.settings.foreground),(a=h==null?void 0:h.settings)!=null&&a.background&&(n=h.settings.background),!s&&((c=t==null?void 0:t.colors)!=null&&c["editor.foreground"])&&(s=t.colors["editor.foreground"]),!n&&((u=t==null?void 0:t.colors)!=null&&u["editor.background"])&&(n=t.colors["editor.background"]),s||(s=t.type==="light"?Ta.light:Ta.dark),n||(n=t.type==="light"?Aa.light:Aa.dark),t.fg=s,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let o=0;const r=new Map;function i(h){var g;if(r.has(h))return r.get(h);o+=1;const p=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return(g=t.colorReplacements)!=null&&g[`#${p}`]?i(h):(r.set(h,p),p)}t.settings=t.settings.map(h=>{var k,w;const p=((k=h.settings)==null?void 0:k.foreground)&&!h.settings.foreground.startsWith("#"),g=((w=h.settings)==null?void 0:w.background)&&!h.settings.background.startsWith("#");if(!p&&!g)return h;const _={...h,settings:{...h.settings}};if(p){const x=i(h.settings.foreground);t.colorReplacements[x]=h.settings.foreground,_.settings.foreground=x}if(g){const x=i(h.settings.background);t.colorReplacements[x]=h.settings.background,_.settings.background=x}return _});for(const h of Object.keys(t.colors||{}))if((h==="editor.foreground"||h==="editor.background"||h.startsWith("terminal.ansi"))&&!((f=t.colors[h])!=null&&f.startsWith("#"))){const p=i(t.colors[h]);t.colorReplacements[p]=t.colors[h],t.colors[h]=p}return Object.defineProperty(t,Ra,{enumerable:!1,writable:!1,value:!0}),t}async function ed(e){return Array.from(new Set((await Promise.all(e.filter(t=>!E0(t)).map(async t=>await Zu(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function td(e){return(await Promise.all(e.map(async n=>I0(n)?null:ol(await Zu(n))))).filter(n=>!!n)}let ub=3;function db(e,t=3){t>ub||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let Yn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function nd(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Yn(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class fb extends fy{constructor(n,s,o,r={}){super(n);M(this,"_resolvedThemes",new Map);M(this,"_resolvedGrammars",new Map);M(this,"_langMap",new Map);M(this,"_langGraph",new Map);M(this,"_textmateThemeCache",new WeakMap);M(this,"_loadedThemesCache",null);M(this,"_loadedLanguagesCache",null);this._resolver=n,this._themes=s,this._langs=o,this._alias=r,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(n){return typeof n=="string"?this._resolvedThemes.get(n):this.loadTheme(n)}loadTheme(n){const s=ol(n);return s.name&&(this._resolvedThemes.set(s.name,s),this._loadedThemesCache=null),s}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(n){let s=this._textmateThemeCache.get(n);s||(s=Bo.createFromRawTheme(n),this._textmateThemeCache.set(n,s)),this._syncRegistry.setTheme(s)}getGrammar(n){return n=nd(n,this._alias),this._resolvedGrammars.get(n)}loadLanguage(n){var i,l,a,c;if(this.getGrammar(n.name))return;const s=new Set([...this._langMap.values()].filter(u=>{var f;return(f=u.embeddedLangsLazy)==null?void 0:f.includes(n.name)}));this._resolver.addLanguage(n);const o={balancedBracketSelectors:n.balancedBracketSelectors||["*"],unbalancedBracketSelectors:n.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(n.scopeName,n);const r=this.loadGrammarWithConfiguration(n.scopeName,1,o);if(r.name=n.name,this._resolvedGrammars.set(n.name,r),n.aliases&&n.aliases.forEach(u=>{this._alias[u]=n.name}),this._loadedLanguagesCache=null,s.size)for(const u of s)this._resolvedGrammars.delete(u.name),this._loadedLanguagesCache=null,(l=(i=this._syncRegistry)==null?void 0:i._injectionGrammars)==null||l.delete(u.scopeName),(c=(a=this._syncRegistry)==null?void 0:a._grammars)==null||c.delete(u.scopeName),this.loadLanguage(this._langMap.get(u.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(n){for(const r of n)this.resolveEmbeddedLanguages(r);const s=Array.from(this._langGraph.entries()),o=s.filter(([r,i])=>!i);if(o.length){const r=s.filter(([i,l])=>{if(!l)return!1;const a=l.embeddedLanguages||l.embeddedLangs;return a==null?void 0:a.some(c=>o.map(([u])=>u).includes(c))}).filter(i=>!o.includes(i));throw new Yn(`Missing languages ${o.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of s)this._resolver.addLanguage(i);for(const[r,i]of s)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(n){this._langMap.set(n.name,n),this._langGraph.set(n.name,n);const s=n.embeddedLanguages??n.embeddedLangs;if(s)for(const o of s)this._langGraph.set(o,this._langMap.get(o))}}class hb{constructor(t,n){M(this,"_langs",new Map);M(this,"_scopeToLang",new Map);M(this,"_injections",new Map);M(this,"_onigLib");this._onigLib={createOnigScanner:s=>t.createScanner(s),createOnigString:s=>t.createString(s)},n.forEach(s=>this.addLanguage(s))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let s=[];for(let o=1;o<=n.length;o++){const r=n.slice(0,o).join(".");s=[...s,...this._injections.get(r)||[]]}return s}}let vs=0;function pb(e){vs+=1,e.warnings!==!1&&vs>=10&&vs%10===0&&console.warn(`[Shiki] ${vs} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Yn("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),s=(e.themes||[]).flat(1).map(ol),o=new hb(e.engine,n),r=new fb(o,s,n,e.langAlias);let i;function l($){return nd($,e.langAlias)}function a($){w();const A=r.getGrammar(typeof $=="string"?$:$.name);if(!A)throw new Yn(`Language \`${$}\` not found, you may need to load it first`);return A}function c($){if($==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};w();const A=r.getTheme($);if(!A)throw new Yn(`Theme \`${$}\` not found, you may need to load it first`);return A}function u($){w();const A=c($);i!==$&&(r.setTheme(A),i=$);const G=r.getColorMap();return{theme:A,colorMap:G}}function f(){return w(),r.getLoadedThemes()}function h(){return w(),r.getLoadedLanguages()}function p(...$){w(),r.loadLanguages($.flat(1))}async function g(...$){return p(await ed($))}function _(...$){w();for(const A of $.flat(1))r.loadTheme(A)}async function k(...$){return w(),_(await td($))}function w(){if(t)throw new Yn("Shiki instance has been disposed")}function x(){t||(t=!0,r.dispose(),vs-=1)}return{setTheme:u,getTheme:c,getLanguage:a,getLoadedThemes:f,getLoadedLanguages:h,resolveLangAlias:l,loadLanguage:g,loadLanguageSync:p,loadTheme:k,loadThemeSync:_,dispose:x,[Symbol.dispose]:x}}async function gb(e){e.engine||db("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,s]=await Promise.all([td(e.themes||[]),ed(e.langs||[]),e.engine]);return pb({...e,themes:t,langs:n,engine:s})}async function mb(e){const t=await gb(e);return{getLastGrammarState:(...n)=>Y0(t,...n),codeToTokensBase:(n,s)=>nl(t,n,s),codeToTokensWithThemes:(n,s)=>Qu(t,n,s),codeToTokens:(n,s)=>Wo(t,n,s),codeToHast:(n,s)=>Vo(t,n,s),codeToHtml:(n,s)=>cb(t,n,s),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}class rl extends Error{constructor(t){super(t),this.name="ShikiError"}}function vb(){return 2147483648}function yb(){return typeof performance<"u"?performance.now():Date.now()}const bb=(e,t)=>e+(t-e%t)%t;async function kb(e){let t,n;const s={};function o(p){n=p,s.HEAPU8=new Uint8Array(p),s.HEAPU32=new Uint32Array(p)}function r(p,g,_){s.HEAPU8.copyWithin(p,g,g+_)}function i(p){try{return t.grow(p-n.byteLength+65535>>>16),o(t.buffer),1}catch{}}function l(p){const g=s.HEAPU8.length;p=p>>>0;const _=vb();if(p>_)return!1;for(let k=1;k<=4;k*=2){let w=g*(1+.2/k);w=Math.min(w,p+100663296);const x=Math.min(_,bb(Math.max(p,w),65536));if(i(x))return!0}return!1}const a=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function c(p,g,_=1024){const k=g+_;let w=g;for(;p[w]&&!(w>=k);)++w;if(w-g>16&&p.buffer&&a)return a.decode(p.subarray(g,w));let x="";for(;g<w;){let $=p[g++];if(!($&128)){x+=String.fromCharCode($);continue}const A=p[g++]&63;if(($&224)===192){x+=String.fromCharCode(($&31)<<6|A);continue}const G=p[g++]&63;if(($&240)===224?$=($&15)<<12|A<<6|G:$=($&7)<<18|A<<12|G<<6|p[g++]&63,$<65536)x+=String.fromCharCode($);else{const Q=$-65536;x+=String.fromCharCode(55296|Q>>10,56320|Q&1023)}}return x}function u(p,g){return p?c(s.HEAPU8,p,g):""}const f={emscripten_get_now:yb,emscripten_memcpy_big:r,emscripten_resize_heap:l,fd_write:()=>0};async function h(){const g=await e({env:f,wasi_snapshot_preview1:f});t=g.memory,o(t.buffer),Object.assign(s,g),s.UTF8ToString=u}return await h(),s}var wb=Object.defineProperty,_b=(e,t,n)=>t in e?wb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tt=(e,t,n)=>_b(e,typeof t!="symbol"?t+"":t,n);let st=null;function Sb(e){throw new rl(e.UTF8ToString(e.getLastOnigError()))}class mr{constructor(t){tt(this,"utf16Length"),tt(this,"utf8Length"),tt(this,"utf16Value"),tt(this,"utf8Value"),tt(this,"utf16OffsetToUtf8"),tt(this,"utf8OffsetToUtf16");const n=t.length,s=mr._utf8ByteLength(t),o=s!==n,r=o?new Uint32Array(n+1):null;o&&(r[n]=s);const i=o?new Uint32Array(s+1):null;o&&(i[s]=n);const l=new Uint8Array(s);let a=0;for(let c=0;c<n;c++){const u=t.charCodeAt(c);let f=u,h=!1;if(u>=55296&&u<=56319&&c+1<n){const p=t.charCodeAt(c+1);p>=56320&&p<=57343&&(f=(u-55296<<10)+65536|p-56320,h=!0)}o&&(r[c]=a,h&&(r[c+1]=a),f<=127?i[a+0]=c:f<=2047?(i[a+0]=c,i[a+1]=c):f<=65535?(i[a+0]=c,i[a+1]=c,i[a+2]=c):(i[a+0]=c,i[a+1]=c,i[a+2]=c,i[a+3]=c)),f<=127?l[a++]=f:f<=2047?(l[a++]=192|(f&1984)>>>6,l[a++]=128|(f&63)>>>0):f<=65535?(l[a++]=224|(f&61440)>>>12,l[a++]=128|(f&4032)>>>6,l[a++]=128|(f&63)>>>0):(l[a++]=240|(f&1835008)>>>18,l[a++]=128|(f&258048)>>>12,l[a++]=128|(f&4032)>>>6,l[a++]=128|(f&63)>>>0),h&&c++}this.utf16Length=n,this.utf8Length=s,this.utf16Value=t,this.utf8Value=l,this.utf16OffsetToUtf8=r,this.utf8OffsetToUtf16=i}static _utf8ByteLength(t){let n=0;for(let s=0,o=t.length;s<o;s++){const r=t.charCodeAt(s);let i=r,l=!1;if(r>=55296&&r<=56319&&s+1<o){const a=t.charCodeAt(s+1);a>=56320&&a<=57343&&(i=(r-55296<<10)+65536|a-56320,l=!0)}i<=127?n+=1:i<=2047?n+=2:i<=65535?n+=3:n+=4,l&&s++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const vr=class tn{constructor(t){if(tt(this,"id",++tn.LAST_ID),tt(this,"_onigBinding"),tt(this,"content"),tt(this,"utf16Length"),tt(this,"utf8Length"),tt(this,"utf16OffsetToUtf8"),tt(this,"utf8OffsetToUtf16"),tt(this,"ptr"),!st)throw new rl("Must invoke loadWasm first.");this._onigBinding=st,this.content=t;const n=new mr(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!tn._sharedPtrInUse?(tn._sharedPtr||(tn._sharedPtr=st.omalloc(1e4)),tn._sharedPtrInUse=!0,st.HEAPU8.set(n.utf8Value,tn._sharedPtr),this.ptr=tn._sharedPtr):this.ptr=n.createString(st)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===tn._sharedPtr?tn._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};tt(vr,"LAST_ID",0);tt(vr,"_sharedPtr",0);tt(vr,"_sharedPtrInUse",!1);let sd=vr;class xb{constructor(t){if(tt(this,"_onigBinding"),tt(this,"_ptr"),!st)throw new rl("Must invoke loadWasm first.");const n=[],s=[];for(let l=0,a=t.length;l<a;l++){const c=new mr(t[l]);n[l]=c.createString(st),s[l]=c.utf8Length}const o=st.omalloc(4*t.length);st.HEAPU32.set(n,o/4);const r=st.omalloc(4*t.length);st.HEAPU32.set(s,r/4);const i=st.createOnigScanner(o,r,t.length);for(let l=0,a=t.length;l<a;l++)st.ofree(n[l]);st.ofree(r),st.ofree(o),i===0&&Sb(st),this._onigBinding=st,this._ptr=i}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,s){let o=0;if(typeof s=="number"&&(o=s),typeof t=="string"){t=new sd(t);const r=this._findNextMatchSync(t,n,!1,o);return t.dispose(),r}return this._findNextMatchSync(t,n,!1,o)}_findNextMatchSync(t,n,s,o){const r=this._onigBinding,i=r.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),o);if(i===0)return null;const l=r.HEAPU32;let a=i/4;const c=l[a++],u=l[a++],f=[];for(let h=0;h<u;h++){const p=t.convertUtf8OffsetToUtf16(l[a++]),g=t.convertUtf8OffsetToUtf16(l[a++]);f[h]={start:p,end:g,length:g-p}}return{index:c,captureIndices:f}}}function Cb(e){return typeof e.instantiator=="function"}function $b(e){return typeof e.default=="function"}function Tb(e){return typeof e.data<"u"}function Ab(e){return typeof Response<"u"&&e instanceof Response}function Rb(e){var t;return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&((t=Buffer.isBuffer)==null?void 0:t.call(Buffer,e))||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let fo;function Eb(e){if(fo)return fo;async function t(){st=await kb(async n=>{let s=e;return s=await s,typeof s=="function"&&(s=await s(n)),typeof s=="function"&&(s=await s(n)),Cb(s)?s=await s.instantiator(n):$b(s)?s=await s.default(n):(Tb(s)&&(s=s.data),Ab(s)?typeof WebAssembly.instantiateStreaming=="function"?s=await Ib(s)(n):s=await Lb(s)(n):Rb(s)?s=await Fr(s)(n):s instanceof WebAssembly.Module?s=await Fr(s)(n):"default"in s&&s.default instanceof WebAssembly.Module&&(s=await Fr(s.default)(n))),"instance"in s&&(s=s.instance),"exports"in s&&(s=s.exports),s})}return fo=t(),fo}function Fr(e){return t=>WebAssembly.instantiate(e,t)}function Ib(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Lb(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function Mb(e){return e&&await Eb(e),{createScanner(t){return new xb(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new sd(t)}}}const Pb={class:"code-block"},Nb={class:"code-header"},Ob={class:"code-lang"},Db=["innerHTML"],Bb=Se({__name:"CodeBlock",props:{code:{},lang:{},streaming:{type:Boolean}},setup(e){const t=e,n=vn("effectiveTheme",N(typeof document<"u"&&document.documentElement.dataset.theme==="dark"?"dark":"light")),s=N(""),o=N(""),r=N(!1);let i=null;const l=new Set,a=new Map,c={js:"javascript",ts:"typescript",py:"python",sh:"bash",shell:"bash",shscript:"bash","shell-script":"bash",yml:"yaml",md:"markdown",rs:"rust",rb:"ruby",go:"go",java:"java",c:"c",cpp:"cpp","c++":"cpp",cs:"csharp","c#":"csharp",kt:"kotlin",kts:"kotlin",scala:"scala",swift:"swift",dart:"dart",lua:"lua",r:"r",sql:"sql",toml:"toml",ini:"ini",xml:"xml",svelte:"svelte",astro:"astro",dockerfile:"docker",makefile:"make",graphql:"graphql",proto:"protobuf",pl:"perl",pm:"perl"};async function u(){if(i)return i;const[k,w]=await Promise.all([lo(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url),lo(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url)]);return i=await mb({themes:[k.default,w.default],langs:[],engine:Mb(()=>lo(()=>import("./wasm-CG6Dc4jp.js"),[],import.meta.url))}),i}async function f(k){if(l.has(k))return!0;if(a.has(k))return await a.get(k),l.has(k);const w=(async()=>{try{const x=await u(),$=await lo(()=>import(`shiki/langs/${k}.mjs`),[],import.meta.url);await x.loadLanguage($.default),l.add(k)}catch{}})();return a.set(k,w),await w,a.delete(k),l.has(k)}function h(k){const w=k.toLowerCase();return c[w]??w}async function p(){var $;const k=(($=t.lang)==null?void 0:$.toLowerCase())??"text",w=h(k),x=n.value==="light"?"github-light":"github-dark";try{const A=await u();await f(w)?s.value=A.codeToHtml(t.code,{lang:w,theme:x}):s.value=`<pre class="shiki-fallback"><code>${g(t.code)}</code></pre>`}catch{s.value=`<pre class="shiki-fallback"><code>${g(t.code)}</code></pre>`}}function g(k){return k.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}function _(){navigator.clipboard.writeText(t.code).then(()=>{r.value=!0,setTimeout(()=>r.value=!1,1500)})}return Oe(()=>[t.code,t.lang,n.value],([k])=>{t.streaming?o.value=`<pre class="shiki-fallback"><code>${g(k)}</code></pre>`:p()},{immediate:!0}),Oe(()=>t.streaming,(k,w)=>{w&&!k&&p()}),(k,w)=>(y(),b("div",Pb,[d("div",Nb,[d("span",Ob,I(e.lang||"text"),1),d("button",{class:fe(["code-copy",{copied:r.value}]),onClick:_},I(r.value?"已复制":"复制"),3)]),d("div",{class:"code-content",innerHTML:t.streaming?o.value:s.value||o.value},null,8,Db)]))}}),jb=xe(Bb,[["__scopeId","data-v-b14b66d7"]]);De.setOptions({gfm:!0,breaks:!1});const Ub=Se({props:{content:{type:String,required:!0},streaming:{type:Boolean,default:!1}},setup(e){const t=N(e.content);let n=null;Oe(()=>e.content,o=>{if(!e.streaming){t.value=o;return}n===null&&(n=requestAnimationFrame(()=>{n=null,t.value=e.content}))}),Oe(()=>e.streaming,(o,r)=>{r&&!o&&(n!==null&&(cancelAnimationFrame(n),n=null),t.value=e.content)});const s=X(()=>{const o=Fb(t.value);return De.lexer(o).flatMap(i=>ki(i,e.streaming))});return()=>Ne("div",{class:"markdown-body"},s.value)}});function Fb(e){const t=/^(`{3,})/gm;let n=null,s=-1,o=0,r;for(;(r=t.exec(e))!==null;){const i=r[1];n===null?(n=i,s=r.index,o=i.length):i.length>=o&&(n=null)}return n!==null?e.substring(0,s).trimEnd():e}function ki(e,t=!1){const n=e;switch(n.type){case"paragraph":return[Ne("p",{class:"md-p"},mn(n.tokens??[]))];case"heading":return[Ne(`h${n.depth??2}`,{class:`md-h${n.depth??2}`},mn(n.tokens??[]))];case"code":return[Ne(jb,{code:n.text??"",lang:n.lang??"text",streaming:t})];case"blockquote":return[Ne("blockquote",{class:"md-blockquote"},(n.tokens??[]).flatMap(s=>ki(s,t)))];case"list":{const s=(n.items??[]).map(o=>{const r=[];return o.task&&r.push(Ne("input",{type:"checkbox",checked:o.checked,disabled:!0,class:"md-checkbox"})),r.push(...o.tokens.flatMap(i=>ki(i,t))),Ne("li",{class:["md-li",o.task?"md-task":""]},r)});return[Ne(n.ordered?"ol":"ul",{class:n.ordered?"md-ol":"md-ul"},s)]}case"hr":return[Ne("hr",{class:"md-hr"})];case"space":return[];case"html":return[Ne("pre",{class:"md-raw-html"},n.text??"")];case"table":return[Ne("div",{class:"md-table-wrap",style:"overflow-x:auto"},[Gb(n)])];case"br":return[Ne("br")];case"text":return[Ne("span",{class:"md-text"},n.tokens?mn(n.tokens):n.text??"")];case"def":return[];default:return[Ne("p",{class:"md-p"},n.raw??"")]}}function Gb(e){const t=(e.header??[]).map((s,o)=>{var l;const r=(l=e.align)==null?void 0:l[o],i=s;return Ne("th",{class:"md-th",style:r?`text-align:${r}`:""},i.tokens?mn(i.tokens):String(i.text??""))}),n=(e.rows??[]).map(s=>Ne("tr",{},s.map((o,r)=>{var a;const i=(a=e.align)==null?void 0:a[r],l=o;return Ne("td",{class:"md-td",style:i?`text-align:${i}`:""},l.tokens?mn(l.tokens):String(l.text??""))})));return Ne("table",{class:"md-table"},[Ne("thead",{},[Ne("tr",{},t)]),Ne("tbody",{},n)])}function mn(e){return e.map(t=>{const n=t;switch(n.type){case"text":return n.text??"";case"codespan":return Ne("code",{class:"md-code"},n.text??"");case"strong":return Ne("strong",{class:"md-strong"},mn(n.tokens??[]));case"em":return Ne("em",{class:"md-em"},mn(n.tokens??[]));case"del":return Ne("del",{class:"md-del"},mn(n.tokens??[]));case"link":{const s=n.href;return s&&!/^(https?:|mailto:|#|\/)/i.test(s)?n.raw??"":Ne("a",{class:"md-a",href:s,target:"_blank",rel:"noopener"},mn(n.tokens??[]))}case"image":return Ne("img",{class:"md-img",src:n.href,alt:n.text??"",loading:"lazy"});case"br":return Ne("br");case"html":return Ne("code",{class:"md-raw-inline"},n.text??"");case"escape":return n.text??"";default:return n.raw??""}})}const zb=xe(Ub,[["__scopeId","data-v-8988fc80"]]),Hb={class:"thinking-block"},qb=["title"],Wb={class:"teaser-text"},Vb={class:"teaser-open"},Kb={key:1,class:"thinking-stream"},Zb={class:"thinking-panel",role:"dialog","aria-label":"思考过程"},Jb={class:"panel-body"},Yb=Se({__name:"ThinkingBlock",props:{tool:{},active:{type:Boolean,default:!1},sessionId:{default:""},msgSeq:{default:void 0}},setup(e){const t=e,n=N(!1),s=N(null),o=N(!1),r=N(!1),i=N(t.tool.output??"");Oe(()=>t.tool.output,h=>{h!==void 0&&!o.value&&!r.value&&(i.value=h)});const l=X(()=>!!t.tool.truncated);async function a(){if(!(!l.value||r.value||o.value)&&!(!t.sessionId||t.msgSeq===void 0)){o.value=!0;try{const p=await(await fetch(`/api/v1/sessions/${t.sessionId}/messages?seq=${t.msgSeq}&tool=${encodeURIComponent(t.tool.toolCallId)}`)).json();typeof p.output=="string"&&p.output.length>0&&(i.value=p.output,r.value=!0)}catch{}finally{o.value=!1}}}const c=X(()=>i.value.split(/\n+/).map(p=>p.trim()).filter(Boolean).at(-1)??"");Oe(i,()=>{t.active&&Ot(()=>{const h=s.value;h&&(h.scrollTop=h.scrollHeight)})});function u(){a(),n.value=!0}function f(){n.value=!1}return(h,p)=>(y(),b("div",Hb,[e.active?(y(),b("div",Kb,[p[1]||(p[1]=d("div",{class:"stream-header"},[d("span",{class:"stream-icon"},"💭"),d("span",{class:"stream-title"},"思考中…"),d("span",{class:"stream-dot"})],-1)),d("div",{ref_key:"streamRef",ref:s,class:"stream-body"},I(i.value),513)])):(y(),b("button",{key:0,class:"thinking-teaser",title:l.value?"思考较长,点击查看完整思考过程":"点击查看完整思考过程",onClick:u},[p[0]||(p[0]=d("span",{class:"teaser-icon"},"💭",-1)),d("span",Wb,I(o.value?"加载完整思考…":c.value||"思考过程"),1),d("span",Vb,I(l.value?"查看全文":"展开"),1)],8,qb)),(y(),qe(Mi,{to:"body"},[n.value?(y(),b("div",{key:0,class:"thinking-overlay",onClick:At(f,["self"])},[d("aside",Zb,[d("header",{class:"panel-header"},[p[2]||(p[2]=d("span",null,"💭 思考过程",-1)),d("button",{class:"panel-close","aria-label":"关闭",onClick:f},"✕")]),d("div",Jb,I(i.value||"(空)"),1)])])):D("",!0)]))]))}}),Xb=xe(Yb,[["__scopeId","data-v-7ff555b4"]]),Qb=new Set(["edit","str_replace","replace","write","multi_edit","create_file","edit_file","apply_patch"]);function ek(e){return Qb.has(e.toLowerCase())}function il(e,t=!0){return e.suspended?"suspended":e.isError?"error":e.output===void 0?t?"running":"unknown":"ok"}function tk(e,t=!0){const n=new Set(e.map(s=>il(s,t)));return n.has("running")?"running":n.has("error")?"error":n.has("suspended")?"suspended":n.has("unknown")?"unknown":"ok"}const nk=500;function sk(e,t){const n=e.length,s=t.length,o=Array.from({length:n+1},()=>Array.from({length:s+1},()=>0));for(let r=1;r<=n;r++)for(let i=1;i<=s;i++)o[r][i]=e[r-1]===t[i-1]?o[r-1][i-1]+1:Math.max(o[r-1][i],o[r][i-1]);return o}function ok(e,t,n,s,o){const r=[];for(;s>0||o>0;)s>0&&o>0&&t[s-1]===n[o-1]?(r.unshift({type:"context",text:t[s-1],oldNo:s,newNo:o}),s--,o--):o>0&&(s===0||e[s][o-1]>=e[s-1][o])?(r.unshift({type:"add",text:n[o-1],newNo:o}),o--):(r.unshift({type:"del",text:t[s-1],oldNo:s}),s--);return r}function rk(e){const t=[],n=e.replaceAll(`\r
|
|
88
|
-
`,`
|
|
89
|
-
`).split(`
|
|
90
|
-
`);let s=0,o=0;for(const r of n){if(r.startsWith("@@")){const i=/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(r);s=i?Number(i[1]):0,o=i?Number(i[2]):0;const l=r.startsWith("@@")?r.slice(r.indexOf("@@")+2,r.lastIndexOf("@@")||r.length):"";t.push({type:"context",text:l.trim()?`@@ hunk ${s},${o} @@`:r,oldNo:s,newNo:o});continue}if(r.startsWith("+++")||r.startsWith("---")){t.push({type:"context",text:r,oldNo:s,newNo:o});continue}r.startsWith("+")?(o+=1,t.push({type:"add",text:r.slice(1),newNo:o})):r.startsWith("-")?(s+=1,t.push({type:"del",text:r.slice(1),oldNo:s})):(s+=1,o+=1,t.push({type:"context",text:r,oldNo:s,newNo:o}))}return t}function ik(e,t){const n=e.split(`
|
|
91
|
-
`),s=t.split(`
|
|
92
|
-
`);if(n.length+s.length>nk){const r=[];return n.forEach((i,l)=>r.push({type:"del",text:i,oldNo:l+1})),s.forEach((i,l)=>r.push({type:"add",text:i,newNo:l+1})),r}const o=sk(n,s);return ok(o,n,s,n.length,s.length)}function lk(e){let t=0,n=0;for(const s of e)s.type==="add"?t++:s.type==="del"&&n++;return{added:t,removed:n}}const ak=["old_string","oldString","old_str","old_text","oldText","old","search"],ck=["new_string","newString","new_str","new_text","newText","new","replace","content"],uk=["path","file_path","filePath","file","filename"];function Gr(e,t){for(const n of t){const s=e[n];if(typeof s=="string"&&s.length>0)return s}}function dk(e){if(!e||typeof e!="object")return null;const t=e,n=Gr(t,uk),s=Gr(t,ak),o=Gr(t,ck);if(!o&&!s)return null;const r=ik(s??"",o??""),i=lk(r);return{path:n,diff:r,stats:i}}const fk={class:"diff-lines"},hk={class:"dl-gutter old"},pk={class:"dl-gutter new"},gk={class:"dl-sign"},mk={class:"dl-text"},vk=Se({__name:"DiffLines",props:{lines:{}},setup(e){return(t,n)=>(y(),b("div",fk,[(y(!0),b(ee,null,Ve(e.lines,(s,o)=>(y(),b("div",{key:o,class:fe(["dl",`dl-${s.type}`])},[d("span",hk,I(s.oldNo??""),1),d("span",pk,I(s.newNo??""),1),d("span",gk,I(s.type==="add"?"+":s.type==="del"?"−":" "),1),d("span",mk,I(s.text),1)],2))),128))]))}}),od=xe(vk,[["__scopeId","data-v-582491c0"]]),yk=["onKeydown"],bk={class:"tool-name"},kk=["title"],wk={key:1,class:"diff-chip"},_k={class:"tool-collapse-inner"},Sk={class:"tool-body"},xk={key:1,class:"tool-result"},Ck={key:2,class:"tool-running-hint"},$k=Se({__name:"EditToolCard",props:{tool:{},live:{type:Boolean,default:!0}},setup(e){const t=e,n=X(()=>il(t.tool,t.live)),s=X(()=>{switch(n.value){case"ok":return"✓";case"error":return"✗";default:return""}}),o=X(()=>dk(t.tool.args)),r=X(()=>{const h=o.value;if(!h||n.value==="error")return"";const{added:p,removed:g}=h.stats;return!p&&!g?"":`+${p} −${g}`}),i=X(()=>{var h;return(h=o.value)==null?void 0:h.path}),l=N(!1);let a=!1;Oe(n,h=>{a||(l.value=h==="running")},{immediate:!0});function c(){a=!0,l.value=!l.value}const u=X(()=>{var h;return((h=o.value)==null?void 0:h.diff)??[]}),f=X(()=>u.value.length>0);return(h,p)=>(y(),b("div",{class:fe(["tool-card",`is-${n.value}`,"edit-tool-card"])},[d("div",{class:"tool-header",role:"button",tabindex:"0",onClick:c,onKeydown:Bs(At(c,["prevent"]),["enter"])},[d("span",{class:fe(["status-dot",n.value])},[s.value?(y(),b(ee,{key:0},[Re(I(s.value),1)],64)):D("",!0)],2),d("span",bk,I(e.tool.name),1),i.value?(y(),b("span",{key:0,class:"tool-filepath",title:i.value},I(i.value),9,kk)):D("",!0),r.value?(y(),b("span",wk,I(r.value),1)):D("",!0),d("span",{class:fe(["tool-chevron",{open:l.value}])},"▸",2)],40,yk),d("div",{class:fe(["tool-collapse",{open:l.value}])},[d("div",_k,[d("div",Sk,[f.value?(y(),qe(od,{key:0,lines:u.value},null,8,["lines"])):D("",!0),e.tool.output!==void 0?(y(),b("pre",xk,[d("code",null,I(e.tool.output||"(无输出)"),1)])):(y(),b("div",Ck,"执行中…"))])])],2)],2))}}),Tk=xe($k,[["__scopeId","data-v-a3d397e4"]]),Ak=["onKeydown"],Rk={class:"tool-name"},Ek=["title"],Ik={class:"tool-collapse-inner"},Lk={class:"tool-body"},Mk={key:0,class:"tool-args"},Pk={key:1,class:"tool-result"},Nk={key:2,class:"tool-image-wrap"},Ok=["src"],Dk={key:3,class:"tool-output-actions"},Bk={key:4,class:"tool-running-hint"},jk=Se({__name:"GenericToolCard",props:{tool:{},live:{type:Boolean,default:!0}},setup(e){const t=e,n=X(()=>il(t.tool,t.live)),s=X(()=>{switch(n.value){case"ok":return"✓";case"error":return"✗";default:return""}}),o=N(!1);let r=!1;Oe(n,k=>{r||(o.value=k==="running")},{immediate:!0});function i(){r=!0,o.value=!o.value}const l=X(()=>{const k=t.tool.args;if(!k||typeof k!="object")return k===void 0?"":String(k);const w=[];for(const[x,$]of Object.entries(k)){let A;if(typeof $=="string")A=$.length>40?`${$.slice(0,40)}…`:$;else{try{A=JSON.stringify($)}catch{A=String($)}A.length>40&&(A=`${A.slice(0,40)}…`)}if(w.push(`${x}=${A}`),w.length>=3)break}return w.join(" ")});function a(){if(!t.tool.args)return"";try{return JSON.stringify(t.tool.args,null,2)}catch{return String(t.tool.args)}}function c(k){return k??""}const u=X(()=>c(t.tool.output)),f=X(()=>u.value.length>8192),h=N(!1),p=X(()=>f.value&&!h.value?u.value.slice(0,280):u.value);async function g(){var k;try{await((k=navigator.clipboard)==null?void 0:k.writeText(u.value))}catch{}}const _=X(()=>{const k=u.value.trim();return!/^[\w@./-]+\.(png|jpe?g|gif|webp|avif)$/i.test(k)||k.includes("..")||k.startsWith("/")||f.value?null:`/api/v1/files/raw?path=${encodeURIComponent(k)}`});return(k,w)=>(y(),b("div",{class:fe(["tool-card",`is-${n.value}`])},[d("div",{class:"tool-header",role:"button",tabindex:"0",onClick:i,onKeydown:Bs(At(i,["prevent"]),["enter"])},[d("span",{class:fe(["status-dot",n.value])},[s.value?(y(),b(ee,{key:0},[Re(I(s.value),1)],64)):D("",!0)],2),d("span",Rk,I(e.tool.name),1),l.value?(y(),b("span",{key:0,class:"tool-params",title:l.value},I(l.value),9,Ek)):D("",!0),d("span",{class:fe(["tool-chevron",{open:o.value}])},"▸",2)],40,Ak),d("div",{class:fe(["tool-collapse",{open:o.value}])},[d("div",Ik,[d("div",Lk,[a()?(y(),b("pre",Mk,[d("code",null,I(a()),1)])):D("",!0),e.tool.output!==void 0&&!_.value?(y(),b("pre",Pk,[d("code",null,I(p.value||"(无输出)"),1)])):D("",!0),e.tool.output!==void 0&&_.value?(y(),b("div",Nk,[d("img",{class:"tool-image",src:_.value,alt:"",loading:"lazy",onError:w[0]||(w[0]=x=>x.currentTarget.style.display="none")},null,40,Ok)])):D("",!0),f.value?(y(),b("div",Dk,[d("button",{class:"tool-output-btn",onClick:w[1]||(w[1]=x=>h.value=!h.value)},I(h.value?"收起":"展开全文"),1),d("button",{class:"tool-output-btn",onClick:g},"复制")])):(y(),b("div",Bk,"执行中…"))])])],2)],2))}}),Uk=xe(jk,[["__scopeId","data-v-f52b91f5"]]),Fk=["aria-expanded"],Gk={class:"process-label"},zk={class:"process-meta"},Hk=["title"],qk={class:"process-collapse"},Wk={class:"process-inner"},Vk=Se({__name:"ToolGroup",props:{name:{},tools:{},live:{type:Boolean,default:!0}},setup(e){const t=e,n=N(!1),s=X(()=>tk(t.tools,t.live)),o=X(()=>t.tools.filter(l=>l.output!==void 0&&!l.isError).length),r=X(()=>s.value==="running"?"执行中":s.value==="error"?"含失败调用":s.value==="suspended"?"含挂起等待":s.value==="unknown"?"结果未持久化":`已完成 ${o.value} 项`);function i(){n.value=!n.value}return(l,a)=>(y(),b("section",{class:fe(["tool-process",{open:n.value,running:s.value==="running",error:s.value==="error"}])},[d("button",{class:"process-head",type:"button","aria-expanded":n.value,onClick:i},[Z(be,{name:"chevron-down",size:12,class:"chevron"}),d("span",{class:fe(["process-dot",s.value]),"aria-hidden":"true"},null,2),d("span",Gk,I(e.name),1),d("span",zk,I(r.value)+" · "+I(e.tools.length)+" 步",1),d("span",{class:"process-names",title:e.tools.map(c=>c.name).join("、")},I(e.tools.map(c=>c.name).join(" · ")),9,Hk)],8,Fk),d("div",qk,[d("div",Wk,[(y(!0),b(ee,null,Ve(t.tools,c=>(y(),qe(kh(re(ek)(c.name)?Tk:Uk),{key:c.toolCallId,tool:c,live:e.live},null,8,["tool","live"]))),128))])])],2))}}),Kk=xe(Vk,[["__scopeId","data-v-b93b7ef2"]]),Zk={key:0,class:"clock"},Jk={class:"stat"},Yk={class:"stat"},Xk={class:"stat"},Qk={class:"stat"},ew={class:"stat"},tw={class:"stat"},nw=Se({__name:"TurnStats",props:{stats:{}},setup(e){const t=e,n=N(null);let s=null;function o(){s!==null&&(clearInterval(s),s=null)}function r(){o();const a=t.stats.llmMs??0,c=Date.now();n.value=a,s=setInterval(()=>{n.value=a+(Date.now()-c)},300)}Oe(()=>t.stats.status,a=>{a==="running"?r():o()},{immediate:!0}),Vt(o);function i(a){return a==null?"—":a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(1)}s`}function l(a){return a==null?"—":a>=1e3?`${(a/1e3).toFixed(1)}k`:`${a}`}return(a,c)=>(y(),b("div",{class:fe(["turn-stats",`is-${e.stats.status}`]),"aria-live":"polite"},[e.stats.status==="running"?(y(),b(ee,{key:0},[c[0]||(c[0]=d("span",{class:"badge-gradient"},"正在思考",-1)),n.value!==null?(y(),b("span",Zk,I(i(n.value)),1)):D("",!0)],64)):(y(),b(ee,{key:1},[d("span",Jk,I(e.stats.turn)+" 轮 · "+I(e.stats.step)+" 步",1),c[10]||(c[10]=d("span",{class:"dot"},"·",-1)),d("span",Yk,[c[1]||(c[1]=d("span",{class:"k"},"LLM",-1)),Re(" "+I(i(e.stats.llmMs)),1)]),e.stats.toolMs?(y(),b(ee,{key:0},[c[3]||(c[3]=d("span",{class:"dot"},"·",-1)),d("span",Xk,[c[2]||(c[2]=d("span",{class:"k"},"工具",-1)),Re(" "+I(i(e.stats.toolMs)),1)])],64)):D("",!0),e.stats.firstTokenMs!==null&&e.stats.firstTokenMs!==void 0?(y(),b(ee,{key:1},[c[5]||(c[5]=d("span",{class:"dot"},"·",-1)),d("span",Qk,[c[4]||(c[4]=d("span",{class:"k"},"首token",-1)),Re(" "+I(i(e.stats.firstTokenMs)),1)])],64)):D("",!0),e.stats.tokens!==null&&e.stats.tokens!==void 0?(y(),b(ee,{key:2},[c[7]||(c[7]=d("span",{class:"dot"},"·",-1)),d("span",ew,[c[6]||(c[6]=d("span",{class:"k"},"tokens",-1)),Re(" "+I(l(e.stats.tokens)),1)])],64)):D("",!0),e.stats.tokensPerSec!==null&&e.stats.tokensPerSec!==void 0?(y(),b(ee,{key:3},[c[9]||(c[9]=d("span",{class:"dot"},"·",-1)),d("span",tw,[c[8]||(c[8]=d("span",{class:"k"},"tok/s",-1)),Re(" "+I(e.stats.tokensPerSec),1)])],64)):D("",!0)],64))],2))}}),sw=xe(nw,[["__scopeId","data-v-0a8bf8da"]]),ow={key:0,class:"user-wrap"},rw={class:"user-bubble"},iw={key:0,class:"message-meta user-meta"},lw={key:1,class:"meta-time"},aw={key:1,class:"assistant-wrap"},cw={key:0,class:"assistant-brand"},uw={key:0,class:"brand-model"},dw={key:1,class:"brand-streaming"},fw={class:"assistant-body"},hw={key:0,class:"degraded-note"},pw={key:4,class:"streaming-cursor","aria-label":"正在生成"},gw={key:6,class:"message-meta"},mw=["title"],vw=["title"],yw={key:4,class:"meta-time"},bw=Se({__name:"MessageItem",props:{message:{},isLatestUser:{type:Boolean,default:!1},idle:{type:Boolean,default:!0},streaming:{type:Boolean,default:!1},canFork:{type:Boolean,default:!1},showTimestamp:{type:Boolean,default:!0},sessionId:{default:""}},emits:["edit","retry","fork"],setup(e,{emit:t}){const n=e,s=t,o=N(!1);let r=null;const i=X(()=>n.message.role==="user"),l=X(()=>n.message.role==="assistant"),a=X(()=>n.message.tools.filter(x=>x.name==="thinking")),c=X(()=>n.message.tools.filter(x=>x.name!=="thinking")),u=X(()=>n.message.ts!==void 0?new Date(n.message.ts).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}):""),f=X(()=>i.value&&n.isLatestUser&&n.idle),h=vn("showThinking",N(!0)),p=vn("showTools",N(!0)),g=N(!1);let _=null;function k(){if(typeof window>"u"||!("speechSynthesis"in window))return;if(g.value){window.speechSynthesis.cancel(),g.value=!1,_=null;return}const x=n.message.content;if(!x)return;const $=new SpeechSynthesisUtterance(x);$.lang="zh-CN";const A=()=>{_===A&&(g.value=!1,_=null)};_=A,$.addEventListener("end",A),$.addEventListener("error",A),window.speechSynthesis.cancel(),requestAnimationFrame(()=>{window.speechSynthesis.speak($)}),g.value=!0}Vt(()=>{g.value&&"speechSynthesis"in window&&window.speechSynthesis.cancel()});async function w(){try{await navigator.clipboard.writeText(n.message.content)}catch{const x=document.createElement("textarea");x.value=n.message.content,document.body.append(x),x.select(),document.execCommand("copy"),x.remove()}o.value=!0,r!==null&&clearTimeout(r),r=window.setTimeout(()=>{o.value=!1},1500)}return(x,$)=>(y(),b("article",{class:fe(["message",e.message.role,{error:e.message.isError}])},[i.value?(y(),b("div",ow,[d("div",rw,I(e.message.content),1),u.value||f.value?(y(),b("div",iw,[f.value?(y(),b("button",{key:0,title:"编辑并重新发送",onClick:$[0]||($[0]=A=>s("edit",e.message.content))},[Z(be,{name:"edit",size:12}),$[3]||($[3]=Re("编辑重发 ",-1))])):D("",!0),u.value?(y(),b("span",lw,I(u.value),1)):D("",!0)])):D("",!0)])):(y(),b("div",aw,[l.value&&(e.message.model||e.streaming)?(y(),b("div",cw,[e.message.model?(y(),b("span",uw,I(e.message.model),1)):D("",!0),e.streaming?(y(),b("span",dw,[...$[4]||($[4]=[d("i",{"aria-hidden":"true"},null,-1),Re("生成中",-1)])])):D("",!0)])):D("",!0),d("div",fw,[e.message.degraded?(y(),b("p",hw," 该回合早于持久化快照:正文与思考在服务重启后无法恢复(工具记录与消息结构已保留)。 ")):D("",!0),re(h)?(y(!0),b(ee,{key:1},Ve(a.value,A=>(y(),qe(Xb,{key:A.toolCallId,tool:A,active:e.streaming,"session-id":e.sessionId,"msg-seq":e.message.seq},null,8,["tool","active","session-id","msg-seq"]))),128)):D("",!0),c.value.length&&re(p)?(y(),qe(Kk,{key:2,name:"工具调用过程",tools:c.value,live:e.streaming},null,8,["tools","live"])):D("",!0),e.message.content?(y(),qe(zb,{key:3,class:"assistant-content",content:e.message.content,streaming:e.streaming},null,8,["content","streaming"])):e.streaming?(y(),b("span",pw)):D("",!0),e.message.turnStats?(y(),qe(sw,{key:5,stats:e.message.turnStats},null,8,["stats"])):D("",!0),e.message.content||e.message.isError&&!e.streaming||e.canFork||e.showTimestamp&&u.value?(y(),b("div",gw,[e.message.content?(y(),b("button",{key:0,title:o.value?"已复制":"复制内容",onClick:w},[Z(be,{name:o.value?"check":"copy",size:12},null,8,["name"]),Re(I(o.value?"已复制":"复制"),1)],8,mw)):D("",!0),e.message.content?(y(),b("button",{key:1,title:g.value?"停止朗读":"朗读",onClick:k},[Z(be,{name:g.value?"speaker-off":"speaker",size:12},null,8,["name"]),Re(I(g.value?"停止":"朗读"),1)],8,vw)):D("",!0),e.message.isError&&!e.streaming?(y(),b("button",{key:2,class:"retry-btn",title:"重发最后一条消息",onClick:$[1]||($[1]=A=>s("retry"))},[Z(be,{name:"refresh",size:12}),$[5]||($[5]=Re("重试 ",-1))])):D("",!0),l.value&&e.canFork&&!e.streaming?(y(),b("button",{key:3,title:"以当前对话为起点创建一个新会话",onClick:$[2]||($[2]=A=>s("fork"))},[Z(be,{name:"fork",size:12}),$[6]||($[6]=Re("Fork ",-1))])):D("",!0),e.showTimestamp&&u.value?(y(),b("time",yw,I(u.value),1)):D("",!0)])):D("",!0)])]))],2))}}),kw=xe(bw,[["__scopeId","data-v-e95505d6"]]),ww={class:"message-list-wrapper"},_w={key:0,class:"conn-banner",role:"status"},Sw={key:0,class:"load-older-row"},xw=["disabled"],Cw={key:2,class:"message-skeleton","aria-hidden":"true"},$w=Se({__name:"MessageList",props:{messages:{},busy:{type:Boolean,default:!1},workDir:{default:null},sessionId:{default:""},model:{default:null},contextUsage:{default:null},connected:{type:Boolean,default:!1},olderAvailable:{type:Boolean,default:!1},olderLoading:{type:Boolean,default:!1}},emits:["edit","pick","retry-connection","retry-message","load-older","fork"],setup(e,{emit:t}){const n=e,s=t,o=N(null),r=X(()=>{for(let C=n.messages.length-1;C>=0;C--)if(n.messages[C].role==="user")return n.messages[C].id;return null}),i=X(()=>{var C;return((C=n.messages.at(-1))==null?void 0:C.id)??null}),l=X(()=>{var C;return((C=[...n.messages].reverse().find(R=>R.role==="assistant"))==null?void 0:C.id)??null});function a(C){const R=n.messages[C];if(!R)return!1;if(R.role!=="assistant")return!0;const L=n.messages[C+1];return!L||L.role!=="assistant"||R.ts!==void 0&&L.ts!==void 0&&L.ts-R.ts>300*1e3}const c=X(()=>{var L;const C=n.messages.at(-1);if(!C)return 0;let R=C.content.length;for(const J of C.tools)R+=((L=J.output)==null?void 0:L.length)??0;return R});let u=!1;const f=N(!1);function h(){const C=o.value;return C?C.scrollHeight-C.scrollTop-C.clientHeight<80:!0}function p(){return typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function g(C){requestAnimationFrame(()=>{const R=o.value;if(!R)return;const L=p()?"auto":C;R.scrollTo({top:R.scrollHeight,behavior:L})})}let _=null;function k(){const C=o.value,R=n.sessionId;!C||!R||_===null&&(_=requestAnimationFrame(()=>{_=null;try{localStorage.setItem(`nexum-scroll:${R}`,String(C.scrollTop))}catch{}}))}function w(){const C=o.value,R=n.sessionId;if(!C||!R)return;let L=null;try{L=localStorage.getItem(`nexum-scroll:${R}`)}catch{}L&&(C.scrollTop=Number(L))}let x=0;Oe(()=>n.olderLoading,C=>{const R=o.value;if(R){if(C)x=R.scrollHeight;else if(x>0){const L=R.scrollHeight-x;L>0&&(R.scrollTop=R.scrollTop+L),x=0}}});function $(){const C=o.value;if(!C)return;const R=C.scrollHeight-C.scrollTop-C.clientHeight>80;f.value=R,R&&u&&(u=!1),n.busy||k()}let A="";Oe(()=>n.sessionId,()=>{A=""}),Oe(()=>[n.messages.length,c.value],([C],[R])=>{if(C!==R){if(C>0&&A!==n.sessionId){A=n.sessionId,requestAnimationFrame(()=>requestAnimationFrame(w));return}u=!0,f.value=!1,g("smooth");return}!u&&!h()||g("auto")}),Oe(()=>n.busy,C=>{C||(u=!1)});function G(){u=!0,f.value=!1,g("smooth")}const Q=X(()=>!n.busy||n.messages.length===0?!1:n.messages.at(-1).role==="user");return Ut(()=>{var C;(C=o.value)==null||C.addEventListener("scroll",$,{passive:!0}),requestAnimationFrame(()=>requestAnimationFrame(w))}),rr(()=>{var C;(C=o.value)==null||C.removeEventListener("scroll",$),_!==null&&(cancelAnimationFrame(_),_=null)}),(C,R)=>(y(),b("div",ww,[!e.connected&&e.messages.length>0?(y(),b("div",_w,[R[6]||(R[6]=d("span",{class:"conn-dot","aria-hidden":"true"},null,-1)),R[7]||(R[7]=d("span",null,"连接中断,自动恢复中…",-1)),d("button",{class:"conn-retry",onClick:R[0]||(R[0]=L=>s("retry-connection"))},"立即重试")])):D("",!0),d("div",{ref_key:"listRef",ref:o,class:"message-list"},[e.olderAvailable?(y(),b("div",Sw,[d("button",{class:"load-older-btn",disabled:e.olderLoading,onClick:R[1]||(R[1]=L=>s("load-older"))},I(e.olderLoading?"加载中…":"加载更早消息"),9,xw)])):D("",!0),e.messages.length===0?(y(),qe(Gv,{key:1,"work-dir":e.workDir,model:e.model,"context-usage":e.contextUsage,connected:e.connected,onPick:R[2]||(R[2]=L=>s("pick",L))},null,8,["work-dir","model","context-usage","connected"])):D("",!0),(y(!0),b(ee,null,Ve(e.messages,(L,J)=>(y(),qe(kw,{key:L.id,message:L,"is-latest-user":L.id===r.value,idle:!e.busy,streaming:e.busy&&L.id===i.value&&L.role==="assistant","session-id":e.sessionId,"can-fork":!e.busy&&L.id===l.value,"show-timestamp":a(J),onEdit:R[3]||(R[3]=ie=>s("edit",ie)),onRetry:R[4]||(R[4]=ie=>s("retry-message")),onFork:R[5]||(R[5]=ie=>s("fork"))},null,8,["message","is-latest-user","idle","streaming","session-id","can-fork","show-timestamp"]))),128)),Q.value?(y(),b("div",Cw,[...R[8]||(R[8]=[d("div",{class:"sk-body"},[d("div",{class:"sk-line sk-w-60"}),d("div",{class:"sk-line sk-w-90"}),d("div",{class:"sk-line sk-w-40"})],-1)])])):D("",!0)],512),Z(ur,{name:"scroll-btn"},{default:$t(()=>[f.value?(y(),b("button",{key:0,class:"scroll-to-bottom",title:"滚动到最新消息",onClick:G},[Z(be,{name:"chevron-down",size:18})])):D("",!0)]),_:1})]))}}),Tw=xe($w,[["__scopeId","data-v-e29fd87d"]]),Aw={class:"files-pane"},Rw={class:"files-path"},Ew={class:"crumbs"},Iw=["onClick"],Lw={key:0,class:"crumb-sep"},Mw={class:"crumb-name"},Pw={key:0,class:"files-error"},Nw={key:1,class:"files-loading"},Ow={class:"files-preview-head"},Dw=["title"],Bw={key:0,class:"files-preview-note"},jw={class:"files-preview-body"},Uw={key:0,class:"files-pre"},Fw=["src"],Gw=["src"],zw=["src"],Hw={key:4,class:"files-binary"},qw={key:3,class:"files-list"},Ww=["onClick"],Vw={class:"files-name"},Kw={class:"files-meta"},Zw={key:0,class:"files-empty"},ho="/api/v1/files",Jw=Se({__name:"FilesBrowser",props:{initialPath:{default:""}},setup(e){const t=e,n=N(""),s=N([]),o=N(!1),r=N(""),i=N(null),l=N("");function a(k){return`${ho}/raw?path=${encodeURIComponent(k)}`}const c=X(()=>{if(!n.value)return[];const k=n.value.split("/"),w=[];for(let x=0;x<k.length;x++){if(k[x]==="")continue;let $=k[x];x>1&&$==="Users"&&k[x-1]===""&&($=$),w.push({label:$.slice(0,12),path:k.slice(0,x+1).join("/")||"/"})}return w.length>4?[{label:"…",path:"/"},...w.slice(w.length-3)]:w});async function u(k){o.value=!0,r.value="",i.value=null;try{const w=await fetch(`${ho}/list?path=${encodeURIComponent(k)}`);if(!w.ok)throw new Error(`HTTP ${w.status}`);const x=await w.json();n.value=x.path||await f(),s.value=x.entries,n.value||(r.value="没有可访问的目录(尚无会话)")}catch(w){r.value=w instanceof Error?w.message:String(w)}finally{o.value=!1}}async function f(){try{return(await(await fetch(`${ho}/root`)).json()).roots[0]??""}catch{return""}}async function h(k){if(k.type==="dir"){await u(k.path);return}if(p(k.name)==="binary"){i.value={path:k.path,content:"",truncated:!1},l.value="该文件类型暂不支持预览";return}l.value="";try{const x=await fetch(`${ho}/read?path=${encodeURIComponent(k.path)}`);if(!x.ok)throw new Error(`HTTP ${x.status}`);const $=await x.json();$.truncated&&(l.value="文件较大,仅显示前 256KB"),i.value=$}catch(x){l.value=x instanceof Error?x.message:String(x),i.value=null}}function p(k){var x;const w=((x=k.split(".").pop())==null?void 0:x.toLowerCase())??"";return["png","jpg","jpeg","gif","webp","svg","ico","avif"].includes(w)?"image":["mp3","wav","ogg","m4a"].includes(w)?"audio":w==="pdf"?"pdf":["md","txt","json","yml","yaml","csv","log","toml","ts","tsx","js","jsx","py","rs","go","java","c","h","cpp","hpp","sh","css","html","vue","lock","env","patch","diff"].includes(w)?"text":"binary"}const g=X(()=>i.value?{name:i.value.path.split(/[\\/]/).pop()??"",path:i.value.path}:null);function _(k){return k<1024?`${k} B`:k<1024*1024?`${(k/1024).toFixed(1)} KB`:`${(k/(1024*1024)).toFixed(1)} MB`}return Ut(()=>{u(t.initialPath)}),Oe(()=>t.initialPath,k=>{k&&u(k)}),(k,w)=>{var x,$,A,G,Q,C;return y(),b("div",Aw,[d("div",Rw,[d("button",{class:"files-up",title:"上一级","aria-label":"上一级",onClick:w[0]||(w[0]=R=>u(n.value.split("/").slice(0,-1).join("/")||"/"))},[Z(be,{name:"chevron-left",size:16})]),d("div",Ew,[(y(!0),b(ee,null,Ve(c.value,(R,L)=>(y(),b("span",{key:L,class:"crumb",onClick:J=>u(R.path)},[L>0?(y(),b("b",Lw,"/")):D("",!0),d("span",Mw,I(R.label),1)],8,Iw))),128))])]),r.value?(y(),b("p",Pw,I(r.value),1)):o.value?(y(),b("p",Nw,"加载中…")):D("",!0),i.value?(y(),b(ee,{key:2},[d("div",Ow,[d("span",{class:"files-preview-name",title:(x=i.value)==null?void 0:x.path},I(($=g.value)==null?void 0:$.name),9,Dw),d("button",{class:"files-preview-close",title:"关闭预览","aria-label":"关闭预览",onClick:w[1]||(w[1]=R=>i.value=null)},[Z(be,{name:"x",size:16})])]),l.value?(y(),b("p",Bw,I(l.value),1)):D("",!0),d("div",jw,[p(((A=g.value)==null?void 0:A.name)??"")==="text"?(y(),b("pre",Uw,I(i.value.content),1)):p(((G=g.value)==null?void 0:G.name)??"")==="image"?(y(),b("img",{key:1,src:a(i.value.path),alt:"",class:"files-img"},null,8,Fw)):p(((Q=g.value)==null?void 0:Q.name)??"")==="audio"?(y(),b("audio",{key:2,src:a(i.value.path),controls:""},null,8,Gw)):p(((C=g.value)==null?void 0:C.name)??"")==="pdf"?(y(),b("iframe",{key:3,src:a(i.value.path),class:"files-pdf",title:"PDF 预览"},null,8,zw)):(y(),b("p",Hw,"该文件类型暂不支持预览(可下载)。"))])],64)):(y(),b("ul",qw,[(y(!0),b(ee,null,Ve(s.value,R=>(y(),b("li",{key:R.path},[d("button",{class:fe(["files-item",{dir:R.type==="dir"}]),onClick:L=>h(R)},[Z(be,{name:R.type==="dir"?"folder":"file",size:16},null,8,["name"]),d("span",Vw,I(R.name),1),d("span",Kw,I(R.type==="dir"?"目录":_(R.size)),1)],10,Ww)]))),128)),!o.value&&s.value.length===0?(y(),b("li",Zw,"空目录")):D("",!0)]))])}}}),Yw=xe(Jw,[["__scopeId","data-v-d31df742"]]),Xw=34;function zr(e){const t=e.split("/"),n=t.at(-1)??e;return t.length<=2?{dir:t.length===2?`${t[0]}/`:"",base:n}:e.length<=Xw?{dir:`${t.slice(0,-1).join("/")}/`,base:n}:{dir:`…/${t.at(-2)}/`,base:n}}const Qw={class:"panel-head-row"},e_=["aria-expanded"],t_={class:"head-icon"},n_=["title"],s_={key:1,class:"head-hint"},o_={class:"head-tail"},r_={key:0,class:"head-count"},i_={class:"panel-body"},l_={key:0,class:"git-files"},a_=["title","onClick"],c_={class:"git-file-name"},u_={key:0,class:"git-file-dir"},d_={class:"git-file-base"},f_={key:0,class:"git-file-stat"},h_={key:0,class:"add"},p_={key:1,class:"del"},g_={key:2,class:"diff-body"},m_={key:3,class:"diff-empty"},v_={key:1,class:"diff-empty"},y_=8,Ea="nexum-panel-git-open",b_=Se({__name:"GitPanel",props:{gitStatus:{default:null}},emits:["refresh","diff"],setup(e,{emit:t}){const n=e,s=t,o={M:"M",A:"A",D:"D",R:"R",U:"U","??":"?","?":"?"},r={D:"danger",A:"success",R:"success",U:"danger","??":"warning","?":"warning"},i=N(!1),l=N(!0);try{l.value=localStorage.getItem(Ea)!=="0"}catch{}function a(){l.value=!l.value;try{localStorage.setItem(Ea,l.value?"1":"0")}catch{}}function c(){s("refresh")}const u=X(()=>{var g;const p=((g=n.gitStatus)==null?void 0:g.files)??[];return i.value?p:p.slice(0,y_)}),f=X(()=>{var p,g;return Math.max(0,(((g=(p=n.gitStatus)==null?void 0:p.files)==null?void 0:g.length)??0)-u.value.length)}),h=X(()=>{var k,w;const p=((k=n.gitStatus)==null?void 0:k.ahead)??0,g=((w=n.gitStatus)==null?void 0:w.behind)??0;if(!p&&!g)return"";const _=[];return p&&_.push(`↑${p}`),g&&_.push(`↓${g}`),` · ${_.join(" ")}`});return(p,g)=>{var _;return y(),b("section",{class:fe(["panel-section","git-panel",{"is-open":l.value}])},[d("div",Qw,[d("button",{class:"panel-head","aria-expanded":l.value,onClick:a},[d("span",t_,[Z(be,{name:"git-branch",size:14})]),g[1]||(g[1]=d("span",{class:"head-title"},"Git 变更",-1)),e.gitStatus?(y(),b("span",{key:0,class:"head-hint",title:`${e.gitStatus.branch??"detached"}${h.value}`},I(e.gitStatus.branch??"detached")+I(h.value),9,n_)):(y(),b("span",s_,"状态不可用")),d("span",o_,[e.gitStatus?(y(),b("span",r_,I(e.gitStatus.changed),1)):D("",!0),Z(be,{class:fe(["chevron",{rotated:l.value}]),name:"chevron-down",size:14},null,8,["class"])])],8,e_),d("button",{class:"icon-btn",title:"刷新","aria-label":"刷新 Git 状态",onClick:c},[Z(be,{name:"refresh",size:14})])]),Ye(d("div",i_,[e.gitStatus?(y(),b(ee,{key:0},[u.value.length?(y(),b("ul",l_,[(y(!0),b(ee,null,Ve(u.value,k=>(y(),b("li",{key:k.path},[d("button",{class:"git-file",title:`查看 ${k.displayPath??k.path} 的 diff`,onClick:w=>s("diff",{path:k.path,display:k.displayPath??k.path,adds:k.adds,dels:k.dels})},[d("span",{class:fe(["git-file-status",r[k.status]??""])},I(o[k.status]??k.status),3),d("span",c_,[re(zr)(k.displayPath??k.path).dir?(y(),b("span",u_,I(re(zr)(k.displayPath??k.path).dir),1)):D("",!0),d("span",d_,I(re(zr)(k.displayPath??k.path).base),1)]),k.adds!==void 0||k.dels!==void 0?(y(),b("span",f_,[k.adds?(y(),b("span",h_,"+"+I(k.adds),1)):D("",!0),k.dels?(y(),b("span",p_,"−"+I(k.dels),1)):D("",!0)])):D("",!0)],8,a_)]))),128))])):D("",!0),f.value?(y(),b("button",{key:1,class:"git-more",onClick:g[0]||(g[0]=k=>i.value=!i.value)},I(i.value?"收起列表":`显示全部 ${((_=e.gitStatus.files)==null?void 0:_.length)??0} 个文件`),1)):D("",!0),e.gitStatus.diffStat?(y(),b("pre",g_,I(e.gitStatus.diffStat),1)):u.value.length?D("",!0):(y(),b("div",m_,"工作区干净,没有变更。"))],64)):(y(),b("div",v_,"读取 Git 状态失败,点右上角刷新重试。"))],512),[[eu,l.value]])],2)}}}),k_=xe(b_,[["__scopeId","data-v-8397de5f"]]),w_={class:"goal-panel panel-section"},__={class:"section-heading"},S_={class:"head-icon"},x_=["title"],C_={key:0,class:"head-tail"},$_={class:"panel-body"},T_={key:0,class:"empty-state"},A_=["disabled"],R_={class:"refine-row"},E_=["disabled"],I_={key:0},L_=["disabled"],M_={class:"budget-grid"},P_=["disabled"],N_=["disabled"],O_={class:"time-budget"},D_=["disabled"],B_=["disabled"],j_=["disabled"],U_={key:0,class:"goal-summary"},F_={class:"objective"},G_={class:"criterion"},z_={key:0,class:"reason"},H_={class:"goal-metrics"},q_={class:"goal-metric"},W_={key:0,class:"bar"},V_={class:"goal-metric"},K_={key:0,class:"bar"},Z_={class:"goal-metric"},J_={key:0,class:"bar"},Y_={key:1,class:"budget-warning"},X_={key:2,class:"notes"},Q_={class:"panel-actions"},eS=["disabled"],tS=["disabled"],nS=["disabled"],sS=["disabled"],oS=["disabled"],rS={class:"budget-grid"},iS=["disabled"],lS=["disabled"],aS={class:"time-budget"},cS=["disabled"],uS=["disabled"],dS={class:"edit-actions"},fS=["disabled"],hS=["disabled"],pS={key:3,class:"form-error"},gS={key:4,class:"pending-copy"},mS=Se({__name:"GoalPanel",props:{goal:{},sessionId:{default:null},connectionStatus:{},busy:{type:Boolean,default:!1},archived:{type:Boolean,default:!1},pending:{type:Boolean,default:!1},error:{default:null},refineGoal:{},createGoal:{},updateGoal:{},pauseGoal:{},resumeGoal:{},cancelGoal:{}},setup(e){const t=e,n=N(""),s=N(""),o=N(""),r=N(""),i=N(""),l=N("minutes"),a=N(!1),c=N(null),u=N(!1),f=X(()=>t.connectionStatus==="connected"),h=X(()=>!t.sessionId||!f.value||t.archived||t.pending),p=X(()=>h.value),g=X(()=>{var O;return{active:"进行中",paused:"已暂停",blocked:"受阻",complete:"已完成"}[((O=t.goal)==null?void 0:O.status)??"active"]}),_=X(()=>t.sessionId?t.archived?"归档会话为只读状态":f.value?t.pending?"正在提交请求…":t.goal?"状态由核心事件实时同步":"创建后 Agent 将自动开始执行":"连接恢复后可继续管理":"选择或新建会话后即可配置");Oe(()=>t.sessionId,()=>{a.value=!1,k()}),Oe(()=>{var O;return(O=t.goal)==null?void 0:O.goalId},(O,P)=>{a.value=!1,O!==P&&k()});function k(){n.value="",s.value="",o.value="",r.value="",i.value="",l.value="minutes",u.value=!1,c.value=null}function w(O,P){const te=O.trim();if(!te)return null;const q=Number(te);if(!Number.isSafeInteger(q)||q<=0){c.value=`${P}必须是正整数。`;return}return q}function x(){c.value=null;const O=w(o.value,"轮次预算");if(O===void 0)return null;const P=w(r.value,"Token 预算");if(P===void 0)return null;const te=w(i.value,"时间预算");if(te===void 0)return null;const q=[];return O!==null&&q.push({value:O,unit:"turns"}),P!==null&&q.push({value:P,unit:"tokens"}),te!==null&&q.push({value:te,unit:l.value}),q}async function $(){const O=n.value.trim();if(!O){c.value="请先输入需要优化的目标描述。";return}c.value=null,u.value=!1;const P=await t.refineGoal(O);P!==null&&(n.value=P,u.value=!0)}async function A(){const O=n.value.trim();if(!O){c.value="目标内容不能为空。";return}const P=x();if(P===null)return;await t.createGoal({objective:O,completionCriterion:s.value.trim()||void 0,replace:!1,budgets:P})&&(u.value=!1)}function G(O){O===null?(i.value="",l.value="minutes"):O%36e5===0?(i.value=String(O/36e5),l.value="hours"):O%6e4===0?(i.value=String(O/6e4),l.value="minutes"):O%1e3===0?(i.value=String(O/1e3),l.value="seconds"):(i.value=String(O),l.value="milliseconds")}function Q(){const O=t.goal;O&&(n.value=O.objective,o.value=O.budget.turnBudget===null?"":String(O.budget.turnBudget),r.value=O.budget.tokenBudget===null?"":String(O.budget.tokenBudget),G(O.budget.wallClockBudgetMs),c.value=null,a.value=!0)}function C(O,P){return P==="hours"?O*36e5:P==="minutes"?O*6e4:P==="seconds"?O*1e3:O}async function R(){const O=t.goal;if(!O)return;const P=n.value.trim();if(!P){c.value="目标内容不能为空。";return}const te=x();if(te===null)return;const q=w(o.value,"轮次预算"),ge=w(r.value,"Token 预算"),Ae=w(i.value,"时间预算");if(q===void 0||ge===void 0||Ae===void 0)return;if(O.budget.turnBudget!==null&&q===null){c.value="当前协议不支持清除已有轮次预算,请填写新的正整数。";return}if(O.budget.tokenBudget!==null&&ge===null){c.value="当前协议不支持清除已有 Token 预算,请填写新的正整数。";return}if(O.budget.wallClockBudgetMs!==null&&Ae===null){c.value="当前协议不支持清除已有时间预算,请填写新的正整数。";return}const ke=te.filter(Te=>Te.unit==="turns"?Te.value!==O.budget.turnBudget:Te.unit==="tokens"?Te.value!==O.budget.tokenBudget:C(Te.value,Te.unit)!==O.budget.wallClockBudgetMs),ae=P===O.objective?void 0:P;if(ae===void 0&&ke.length===0){c.value="目标与预算没有变化。";return}await t.updateGoal({objective:ae,budgets:ke})&&(a.value=!1)}async function L(O){c.value=null,!(O==="cancel"&&!window.confirm("确定取消当前 Goal?当前 Goal 状态将被清除。"))&&(O==="pause"?await t.pauseGoal():O==="resume"?await t.resumeGoal():await t.cancelGoal())}function J(O){return O.toLocaleString("zh-CN")}function ie(O){if(O<1e3)return`${O} 毫秒`;const P=Math.floor(O/1e3);if(P<60)return`${P} 秒`;const te=Math.floor(P/3600),q=Math.floor(P%3600/60);return te>0?`${te} 小时 ${q} 分钟`:`${q} 分钟`}function z(O,P){return P===null||P<=0?0:Math.min(100,Math.round(O/P*100))}function ve(O){return new Date(O).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}return(O,P)=>(y(),b("section",w_,[d("div",__,[d("span",S_,[Z(be,{name:"target",size:14})]),P[15]||(P[15]=d("span",{class:"head-title"},"Goal 管理",-1)),d("span",{class:"head-hint",title:_.value},I(_.value),9,x_),e.goal?(y(),b("span",C_,[d("span",{class:fe(["status-pill",`is-${e.goal.status}`])},I(g.value),3)])):D("",!0)]),d("div",$_,[e.sessionId?e.goal?(y(),b(ee,{key:2},[a.value?(y(),b("form",{key:1,class:"goal-form edit-form",onSubmit:At(R,["prevent"])},[d("label",null,[P[31]||(P[31]=d("span",null,"目标内容",-1)),Ye(d("textarea",{"onUpdate:modelValue":P[9]||(P[9]=te=>n.value=te),rows:"3",maxlength:"4000",disabled:h.value||e.busy},null,8,oS),[[ut,n.value]])]),P[36]||(P[36]=d("div",{class:"budget-title"},[Re("更新预算 "),d("small",null,"仅提交发生变化的预算")],-1)),d("div",rS,[d("label",null,[P[32]||(P[32]=d("span",null,"轮次",-1)),Ye(d("input",{"onUpdate:modelValue":P[10]||(P[10]=te=>o.value=te),type:"number",min:"1",step:"1",placeholder:"不限",disabled:h.value||e.busy},null,8,iS),[[ut,o.value]])]),d("label",null,[P[33]||(P[33]=d("span",null,"Token",-1)),Ye(d("input",{"onUpdate:modelValue":P[11]||(P[11]=te=>r.value=te),type:"number",min:"1",step:"1",placeholder:"不限",disabled:h.value||e.busy},null,8,lS),[[ut,r.value]])])]),d("div",aS,[d("label",null,[P[34]||(P[34]=d("span",null,"时间",-1)),Ye(d("input",{"onUpdate:modelValue":P[12]||(P[12]=te=>i.value=te),type:"number",min:"1",step:"1",placeholder:"不限",disabled:h.value||e.busy},null,8,cS),[[ut,i.value]])]),Ye(d("select",{"onUpdate:modelValue":P[13]||(P[13]=te=>l.value=te),"aria-label":"时间预算单位",disabled:h.value||e.busy},[...P[35]||(P[35]=[d("option",{value:"minutes"},"分钟",-1),d("option",{value:"hours"},"小时",-1),d("option",{value:"seconds"},"秒",-1),d("option",{value:"milliseconds"},"毫秒",-1)])],8,uS),[[Ql,l.value]])]),d("div",dS,[d("button",{type:"button",class:"secondary",disabled:e.pending,onClick:P[14]||(P[14]=te=>a.value=!1)}," 返回",8,fS),d("button",{class:"primary small",type:"submit",disabled:h.value||e.busy}," 保存修改 ",8,hS)])],32)):(y(),b("div",U_,[d("div",F_,[P[24]||(P[24]=d("small",null,"目标",-1)),d("p",null,I(e.goal.objective),1)]),d("div",G_,[P[25]||(P[25]=d("small",null,"完成标准",-1)),d("p",null,I(e.goal.completionCriterion??"未设置,由 Agent 根据目标判断完成。"),1)]),e.goal.terminalReason?(y(),b("div",z_,[P[26]||(P[26]=d("strong",null,"状态原因",-1)),d("span",null,I(e.goal.terminalReason),1)])):D("",!0),d("dl",H_,[d("div",q_,[P[27]||(P[27]=d("dt",null,"轮次",-1)),d("dd",null,I(e.goal.turnsUsed)+" / "+I(e.goal.budget.turnBudget??"不限"),1),e.goal.budget.turnBudget!==null?(y(),b("i",W_,[d("i",{style:ln({width:`${z(e.goal.turnsUsed,e.goal.budget.turnBudget)}%`})},null,4)])):D("",!0)]),d("div",V_,[P[28]||(P[28]=d("dt",null,"Token",-1)),d("dd",null,I(J(e.goal.tokensUsed))+" / "+I(e.goal.budget.tokenBudget===null?"不限":J(e.goal.budget.tokenBudget)),1),e.goal.budget.tokenBudget!==null?(y(),b("i",K_,[d("i",{style:ln({width:`${z(e.goal.tokensUsed,e.goal.budget.tokenBudget)}%`})},null,4)])):D("",!0)]),d("div",Z_,[P[29]||(P[29]=d("dt",null,"时间",-1)),d("dd",null,I(ie(e.goal.wallClockMs))+" / "+I(e.goal.budget.wallClockBudgetMs===null?"不限":ie(e.goal.budget.wallClockBudgetMs)),1),e.goal.budget.wallClockBudgetMs!==null?(y(),b("i",J_,[d("i",{style:ln({width:`${z(e.goal.wallClockMs,e.goal.budget.wallClockBudgetMs)}%`})},null,4)])):D("",!0)])]),e.goal.budget.overBudget?(y(),b("div",Y_,"已达到或超过执行预算。")):D("",!0),e.goal.notes.length?(y(),b("details",X_,[d("summary",null,"工作记录("+I(e.goal.notes.length)+")",1),d("ol",null,[(y(!0),b(ee,null,Ve(e.goal.notes,te=>(y(),b("li",{key:`${te.time}-${te.content}`},[d("time",null,I(ve(te.time)),1),d("span",null,I(te.content),1)]))),128))])])):D("",!0),d("div",Q_,[e.goal.status!=="complete"?(y(),b("button",{key:0,class:"secondary",disabled:h.value||e.busy,onClick:Q},[Z(be,{name:"edit",size:14}),P[30]||(P[30]=Re("编辑 ",-1))],8,eS)):D("",!0),e.goal.status==="active"?(y(),b("button",{key:1,class:"secondary",disabled:h.value,onClick:P[6]||(P[6]=te=>L("pause"))}," 暂停 ",8,tS)):D("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(y(),b("button",{key:2,class:"primary small",disabled:h.value||e.busy,onClick:P[7]||(P[7]=te=>L("resume"))}," 继续 ",8,nS)):D("",!0),d("button",{class:"danger",disabled:h.value,onClick:P[8]||(P[8]=te=>L("cancel"))}," 取消 Goal ",8,sS)])]))],64)):(y(),b("form",{key:1,class:"goal-form",onSubmit:At(A,["prevent"])},[d("label",null,[P[16]||(P[16]=d("span",null,"目标内容",-1)),Ye(d("textarea",{"onUpdate:modelValue":P[0]||(P[0]=te=>n.value=te),rows:"3",maxlength:"4000",placeholder:"描述希望 Agent 持续完成的目标",disabled:p.value},null,8,A_),[[ut,n.value]])]),d("div",R_,[d("button",{type:"button",class:"secondary",disabled:p.value||!n.value.trim(),onClick:$},[Z(be,{name:"sparkles",size:15}),P[17]||(P[17]=Re(" AI 优化 ",-1))],8,E_),u.value?(y(),b("small",I_,"已优化,请确认或继续编辑后再创建。")):D("",!0)]),d("label",null,[P[18]||(P[18]=d("span",null,[Re("完成标准 "),d("small",null,"可选")],-1)),Ye(d("textarea",{"onUpdate:modelValue":P[1]||(P[1]=te=>s.value=te),rows:"2",placeholder:"例如:聚焦测试、类型检查与 Web 构建全部通过",disabled:p.value},null,8,L_),[[ut,s.value]])]),P[23]||(P[23]=d("div",{class:"budget-title"},[Re("执行预算 "),d("small",null,"留空表示不限制")],-1)),d("div",M_,[d("label",null,[P[19]||(P[19]=d("span",null,"轮次",-1)),Ye(d("input",{"onUpdate:modelValue":P[2]||(P[2]=te=>o.value=te),type:"number",min:"1",step:"1",placeholder:"不限",disabled:p.value},null,8,P_),[[ut,o.value]])]),d("label",null,[P[20]||(P[20]=d("span",null,"Token",-1)),Ye(d("input",{"onUpdate:modelValue":P[3]||(P[3]=te=>r.value=te),type:"number",min:"1",step:"1",placeholder:"不限",disabled:p.value},null,8,N_),[[ut,r.value]])])]),d("div",O_,[d("label",null,[P[21]||(P[21]=d("span",null,"时间",-1)),Ye(d("input",{"onUpdate:modelValue":P[4]||(P[4]=te=>i.value=te),type:"number",min:"1",step:"1",placeholder:"不限",disabled:p.value},null,8,D_),[[ut,i.value]])]),Ye(d("select",{"onUpdate:modelValue":P[5]||(P[5]=te=>l.value=te),"aria-label":"时间预算单位",disabled:p.value},[...P[22]||(P[22]=[d("option",{value:"minutes"},"分钟",-1),d("option",{value:"hours"},"小时",-1),d("option",{value:"seconds"},"秒",-1),d("option",{value:"milliseconds"},"毫秒",-1)])],8,B_),[[Ql,l.value]])]),d("button",{class:"primary",type:"submit",disabled:p.value||!n.value.trim()},I(e.pending?"正在创建…":"创建并开始执行"),9,j_)],32)):(y(),b("div",T_,"暂无会话,Goal 管理暂不可用。")),c.value||e.error?(y(),b("p",pS,I(c.value??e.error),1)):e.pending?(y(),b("p",gS,"请求处理中,状态将在核心事件到达后同步。")):D("",!0)])]))}}),vS=xe(mS,[["__scopeId","data-v-ba06ed4c"]]),yS={class:"panel-section like-section"},bS={class:"section-heading"},kS={class:"head-icon"},wS={class:"panel-body"},_S={class:"kv-rows"},SS={class:"dialog"},xS=["onUpdate:modelValue","placeholder"],CS={key:0,class:"dialog-error"},$S={class:"dialog-actions"},TS=["disabled"],AS=Se({__name:"LikePanel",props:{like:{},updateLike:{type:Function}},setup(e){const t=e,n=N(!1),s=N(!1),o=N(""),r=N({}),i=[{key:"nickname",label:"昵称",placeholder:"用户称呼,如:老板"},{key:"tone",label:"语气",placeholder:"AI 风格,如:专业不拖沓"},{key:"other",label:"偏好",placeholder:"其他用户偏好"},{key:"doNot",label:"禁止",placeholder:"用户明确不让做的事"}];function l(){r.value={...t.like},o.value="",n.value=!0}async function a(){s.value=!0,o.value="";const c=await t.updateLike(r.value);s.value=!1,c?n.value=!1:o.value="保存失败"}return(c,u)=>(y(),b("section",yS,[d("div",bS,[d("span",kS,[Z(be,{name:"settings",size:14})]),u[2]||(u[2]=d("span",{class:"head-title"},"偏好设置",-1)),u[3]||(u[3]=d("span",{class:"head-hint"},"/like 用户偏好",-1))]),d("div",wS,[d("dl",_S,[(y(),b(ee,null,Ve(i,f=>d("div",{key:f.key,class:"kv-row"},[d("dt",null,I(f.label),1),d("dd",null,I((e.like[f.key]??"").trim()||"未设置"),1)])),64))]),d("div",{class:"panel-actions"},[d("button",{class:"like-edit",onClick:l},"编辑偏好")])]),n.value?(y(),b("div",{key:0,class:"dialog-overlay",onClick:u[1]||(u[1]=At(f=>n.value=!1,["self"]))},[d("div",SS,[u[4]||(u[4]=d("div",{class:"dialog-title"},"编辑用户偏好",-1)),(y(),b(ee,null,Ve(i,f=>d("label",{key:f.key,class:"dialog-field"},[d("span",null,I(f.label),1),Ye(d("input",{"onUpdate:modelValue":h=>r.value[f.key]=h,placeholder:f.placeholder},null,8,xS),[[ut,r.value[f.key]]])])),64)),o.value?(y(),b("div",CS,I(o.value),1)):D("",!0),d("div",$S,[d("button",{onClick:u[0]||(u[0]=f=>n.value=!1)},"取消"),d("button",{disabled:s.value,onClick:a},I(s.value?"保存中…":"确认"),9,TS)])])])):D("",!0)]))}}),RS=xe(AS,[["__scopeId","data-v-153071fb"]]),ES=["aria-expanded"],IS={class:"head-icon"},LS={class:"head-hint"},MS={class:"head-tail"},PS=["title"],NS={class:"panel-body"},OS={class:"stat-grid"},DS={class:"stat"},BS={class:"stat"},jS=["title"],US={key:1,class:"faint"},FS={class:"stat wide"},GS={class:"mono"},Ia="nexum-panel-runstatus-open",zS=Se({__name:"RunStatusPanel",props:{status:{},busy:{type:Boolean,default:!1},connectionStatus:{}},setup(e){const t=e,n=N(!0);try{n.value=localStorage.getItem(Ia)!=="0"}catch{}function s(){n.value=!n.value;try{localStorage.setItem(Ia,n.value?"1":"0")}catch{}}const o=X(()=>{const l=t.status.contextUsage;return l===void 0?null:Math.round((l>1?l/100:l)*100)}),r=X(()=>{var l,a;return`Tokens: ${((l=t.status.contextTokens)==null?void 0:l.toLocaleString())??"-"} / ${((a=t.status.maxContextTokens)==null?void 0:a.toLocaleString())??"-"}`}),i=X(()=>({connected:"已连接",connecting:"连接中",reconnecting:"重连中",disconnected:"已断开",idle:"空闲"})[t.connectionStatus]??"空闲");return Oe(()=>t.busy,()=>{t.busy&&!n.value&&(n.value=!0)}),(l,a)=>{var c,u;return y(),b("section",{class:fe(["panel-section","run-status",{"is-open":n.value}])},[d("button",{class:"panel-head","aria-expanded":n.value,onClick:s},[d("span",IS,[Z(be,{name:"activity",size:14})]),a[0]||(a[0]=d("span",{class:"head-title"},"运行状态",-1)),d("span",LS,I(e.busy?"正在处理会话":"已就绪,等待任务"),1),d("span",MS,[d("span",{class:fe(["head-dot",{busy:e.busy}]),title:e.busy?"Agent 正在处理":"空闲"},null,10,PS),Z(be,{class:fe(["chevron",{rotated:n.value}]),name:"chevron-down",size:14},null,8,["class"])])],8,ES),Ye(d("div",NS,[d("dl",OS,[d("div",DS,[a[1]||(a[1]=d("dt",null,"连接",-1)),d("dd",null,[d("span",{class:fe(["conn-dot",e.connectionStatus]),"aria-hidden":"true"},null,2),d("span",{class:fe(["conn",e.connectionStatus])},I(i.value),3)])]),d("div",BS,[a[2]||(a[2]=d("dt",null,"上下文占用",-1)),o.value!==null?(y(),b("dd",{key:0,title:r.value},[Z(au,{usage:e.status.contextUsage,size:14},null,8,["usage"]),Re(I(o.value)+"% ",1)],8,jS)):(y(),b("dd",US,"未知"))]),d("div",FS,[a[3]||(a[3]=d("dt",null,"Token(输入 / 上限)",-1)),d("dd",GS,I(((c=e.status.contextTokens)==null?void 0:c.toLocaleString())??"-")+" / "+I(((u=e.status.maxContextTokens)==null?void 0:u.toLocaleString())??"-"),1)])])],512),[[eu,n.value]])],2)}}}),HS=xe(zS,[["__scopeId","data-v-da49e2d9"]]),qS={class:"todo-panel panel-section"},WS={class:"section-heading"},VS={class:"head-icon"},KS={class:"head-hint"},ZS={class:"head-tail"},JS={class:"head-count"},YS={key:0,class:"panel-body"},XS={class:"empty-state"},QS={key:1,class:"panel-body"},e2={class:"progress-row"},t2={class:"bar","aria-hidden":"true"},n2={class:"progress-value"},s2=["title"],o2={class:"todo-title"},r2=Se({__name:"TodoPanel",props:{todos:{}},setup(e){const t=e,n=X(()=>ig(t.todos)),s=X(()=>t.todos.filter(c=>c.status==="done").length),o=X(()=>t.todos.filter(c=>c.status==="in_progress").length),r=X(()=>t.todos.filter(c=>c.status==="pending").length),i=X(()=>t.todos.length?Math.round(s.value/t.todos.length*100):0),l=X(()=>{if(!t.todos.length)return"直接来自 Agent 核心状态";if(s.value===t.todos.length)return"全部完成";const c=[];return o.value&&c.push(`进行中 ${o.value}`),r.value&&c.push(`待处理 ${r.value}`),c.join(" · ")||"直接来自 Agent 核心状态"}),a={pending:{label:"待处理",symbol:"○"},in_progress:{label:"进行中",symbol:"●"},done:{label:"已完成",symbol:"✓"}};return(c,u)=>(y(),b("section",qS,[d("div",WS,[d("span",VS,[Z(be,{name:"clipboard",size:14})]),u[0]||(u[0]=d("span",{class:"head-title"},"核心 Todo",-1)),d("span",KS,I(l.value),1),d("span",ZS,[d("span",JS,I(s.value)+"/"+I(e.todos.length),1)])]),e.todos.length===0?(y(),b("div",YS,[d("div",XS,[Z(be,{name:"check",size:18}),u[1]||(u[1]=d("span",null,"暂无 Todo",-1)),u[2]||(u[2]=d("small",null,"Agent 创建任务清单后会在这里实时显示。",-1))])])):(y(),b("div",QS,[d("div",e2,[d("i",t2,[d("i",{style:ln({width:`${i.value}%`})},null,4)]),d("span",n2,I(i.value)+"%",1)]),(y(!0),b(ee,null,Ve(n.value,(f,h)=>(y(),b("section",{key:f.phase??`unphased-${h}`,class:"todo-group"},[d("h4",null,I(f.phase??"未分阶段"),1),d("ol",null,[(y(!0),b(ee,null,Ve(f.items,(p,g)=>(y(),b("li",{key:`${h}-${g}-${p.title}`,class:fe(`is-${p.status}`)},[d("span",{class:"status-symbol",title:a[p.status].label},I(a[p.status].symbol),9,s2),d("span",o2,I(p.title),1),d("small",null,I(a[p.status].label),1)],2))),128))])]))),128))]))]))}}),i2=xe(r2,[["__scopeId","data-v-2e8a2c4d"]]),l2={class:"drawer"},a2={class:"drawer-toolbar"},c2={class:"drawer-tabs",role:"tablist","aria-label":"抽屉面板"},u2=["aria-selected"],d2=["aria-selected"],f2={class:"drawer-body"},h2={class:"git-diff-head"},p2=["title"],g2={class:"git-diff-tools"},m2={key:0,class:"git-diff-stat"},v2={key:0,class:"add"},y2={key:1,class:"del"},b2={key:0,class:"git-diff-body"},k2={key:1,class:"git-diff-empty"},w2=Se({__name:"SessionDrawer",props:{client:{}},emits:["refresh-git","close","insert"],setup(e){const t=e,n=N("detail"),s=N(null),o=N(null);async function r(C){var L,J,ie;s.value={...C,lines:[],loading:!0};try{const ve=await(await fetch(`/api/v1/git/diff?path=${encodeURIComponent(C.path)}`)).json(),O=rk(ve.patch??""),P=C.adds??(C.dels===void 0?O.filter(te=>te.type==="add").length:void 0);s.value={...C,adds:P,lines:O,loading:!1}}catch{s.value={...C,lines:[],loading:!1}}await Ot();const R=((J=(L=globalThis.window)==null?void 0:L.matchMedia)==null?void 0:J.call(L,"(prefers-reduced-motion: reduce)").matches)===!0;(ie=o.value)==null||ie.scrollIntoView({block:"start",behavior:R?"auto":"smooth"})}const{connectionStatus:i,status:l,sessionId:a,isBusy:c,isArchived:u,goal:f,todos:h,goalRequestPending:p,goalRequestError:g,like:_,gitStatus:k,refineGoal:w,createGoal:x,updateGoal:$,pauseGoal:A,resumeGoal:G,cancelGoal:Q}=t.client;return(C,R)=>{const L=bh("SvgIcon");return y(),b("aside",l2,[d("div",a2,[d("div",c2,[d("button",{role:"tab","aria-selected":n.value==="detail",class:fe(["drawer-tab",{active:n.value==="detail"}]),onClick:R[0]||(R[0]=J=>n.value="detail")}," 详情 ",10,u2),d("button",{role:"tab","aria-selected":n.value==="files",class:fe(["drawer-tab",{active:n.value==="files"}]),onClick:R[1]||(R[1]=J=>n.value="files")}," 文件 ",10,d2)]),d("button",{class:"drawer-close",title:"收起面板","aria-label":"收起详情",onClick:R[2]||(R[2]=J=>C.$emit("close"))},[Z(L,{name:"panel-right",size:16})])]),d("div",f2,[n.value==="detail"?(y(),b(ee,{key:0},[Z(HS,{status:re(l),busy:re(c),"connection-status":re(i)},null,8,["status","busy","connection-status"]),Z(k_,{"git-status":re(k),onRefresh:R[3]||(R[3]=J=>C.$emit("refresh-git")),onDiff:r},null,8,["git-status"]),s.value?(y(),b("div",{key:0,ref_key:"diffRef",ref:o,class:"git-diff-view"},[d("div",h2,[d("span",{class:"git-diff-title",title:s.value.path},I(s.value.loading?"加载中…":s.value.display),9,p2),d("span",g2,[!s.value.loading&&(s.value.adds||s.value.dels)?(y(),b("span",m2,[s.value.adds?(y(),b("span",v2,"+"+I(s.value.adds),1)):D("",!0),s.value.dels?(y(),b("span",y2,"−"+I(s.value.dels),1)):D("",!0)])):D("",!0),d("button",{class:"git-diff-close",title:"关闭 diff","aria-label":"关闭 diff",onClick:R[4]||(R[4]=J=>s.value=null)}," ✕ ")])]),s.value.lines.length?(y(),b("div",b2,[Z(od,{lines:s.value.lines},null,8,["lines"])])):s.value.loading?D("",!0):(y(),b("p",k2," 该文件无差异内容(可能是二进制文件或已被忽略)。 "))],512)):D("",!0),Z(i2,{todos:re(h)},null,8,["todos"]),Z(RS,{like:re(_),"update-like":t.client.updateLike},null,8,["like","update-like"]),Z(vS,{goal:re(f),"session-id":re(a),"connection-status":re(i),busy:re(c),archived:re(u),pending:re(p),error:re(g),"refine-goal":re(w),"create-goal":re(x),"update-goal":re($),"pause-goal":re(A),"resume-goal":re(G),"cancel-goal":re(Q)},null,8,["goal","session-id","connection-status","busy","archived","pending","error","refine-goal","create-goal","update-goal","pause-goal","resume-goal","cancel-goal"])],64)):(y(),qe(Yw,{key:t.client.workDir.value||"none","initial-path":t.client.workDir.value||""},null,8,["initial-path"]))])])}}}),_2=xe(w2,[["__scopeId","data-v-2e36428a"]]),S2={class:"conversation"},x2={class:"chat-stage"},C2={class:"chat-column"},$2={class:"composer-dock"},T2=Se({__name:"ConversationView",props:{client:{}},emits:["home"],setup(e,{emit:t}){const n=e,s=t,{connectionStatus:o,messages:r,pendingApprovals:i,status:l,sessionId:a,workDir:c,isBusy:u,models:f,sendPrompt:h,sendCommand:p,clearMessages:g,appendSystemMessage:_,abort:k,resolveApproval:w,exportSession:x,fetchSnapshot:$,switchModel:A,switchThinking:G}=n.client,Q=N(null),C=N(!1),R=N(!1),L=N("status"),J=X(()=>{const ke=n.client.sessions.value.find(Te=>Te.sessionId===n.client.currentSessionId.value),ae=ke==null?void 0:ke.title;if(ae&&ae!=="新会话"&&ae!=="New Session")return ae;const Ce=r.value.find(Te=>Te.role==="user");if(Ce){const Te=Ce.content.replace(/\s+/g," ").trim();if(Te)return Te.length>24?`${Te.slice(0,24)}…`:Te}return ae??null});function ie(ke){var ae;(ae=Q.value)==null||ae.insertText(ke)}function z(ke){$(),L.value=ke,R.value=!0}function ve(){var ae;(((ae=Q.value)==null?void 0:ae.openModelPicker())??!1)||_(`当前模型:${l.value.model??"unknown"}`)}function O(ke,ae){switch(ke){case"compact":p("compact");break;case"model":ve();break;case"clear":g();break;case"new":s("home");break;case"help":_(lu());break;case"auto":case"yes":case"plan":case"fork":case"title":case"btw":p(ke,ae);break;case"status":z("status");break;case"usage":z("usage");break;default:_(`未知命令:/${ke}`)}}function P(ke){p("title",ke)}function te(){if(u.value||!o.value)return;const ke=[...r.value].reverse().find(ae=>ae.role==="user");ke&&h(ke.content)}const q=N(!1);async function ge(){q.value=!0,await n.client.loadOlderMessages(),q.value=!1}function Ae(){u.value||(p("fork"),setTimeout(()=>{n.client.fetchSessions()},1200))}return(ke,ae)=>(y(),b("div",S2,[Z(Wm,{title:J.value,busy:re(u),"drawer-open":C.value,onHome:ae[0]||(ae[0]=Ce=>s("home")),onRename:P,onExport:ae[1]||(ae[1]=Ce=>re(a)&&re(x)(re(a))),onClear:re(g),onToggleDrawer:ae[2]||(ae[2]=Ce=>C.value=!C.value)},null,8,["title","busy","drawer-open","onClear"]),d("div",x2,[d("div",C2,[Z(Tw,{messages:re(r),busy:re(u),"work-dir":re(c),"session-id":re(a)??"",model:re(l).model??null,"context-usage":re(l).contextUsage??null,connected:re(o)==="connected","older-available":n.client.olderAvailable.value,"older-loading":q.value,onEdit:ie,onPick:re(h),onRetryConnection:ae[3]||(ae[3]=Ce=>n.client.reconnectNow()),onRetryMessage:te,onLoadOlder:ge,onFork:Ae},null,8,["messages","busy","work-dir","session-id","model","context-usage","connected","older-available","older-loading","onPick"]),d("div",$2,[Z(Sg,{approvals:re(i),onResolve:re(w)},null,8,["approvals","onResolve"]),Z(cu,{ref_key:"composerRef",ref:Q,busy:re(u),status:re(l),"session-id":re(a),models:re(f),onSend:re(h),onAbort:re(k),onCommand:O,onSwitchModel:re(A),onSwitchThinking:re(G)},null,8,["busy","status","session-id","models","onSend","onAbort","onSwitchModel","onSwitchThinking"])])]),Z(ur,{name:"drawer"},{default:$t(()=>[C.value?(y(),qe(_2,{key:0,client:n.client,onRefreshGit:ae[4]||(ae[4]=Ce=>n.client.fetchGitStatus()),onClose:ae[5]||(ae[5]=Ce=>C.value=!1)},null,8,["client"])):D("",!0)]),_:1})]),R.value?(y(),qe(Av,{key:0,mode:L.value,status:re(l),"session-id":re(a),"work-dir":re(c),onClose:ae[6]||(ae[6]=Ce=>R.value=!1)},null,8,["mode","status","session-id","work-dir"])):D("",!0)]))}}),A2=xe(T2,[["__scopeId","data-v-a29790e6"]]),R2={class:"settings"},E2={class:"settings-inner"},I2={class:"settings-section"},L2={class:"theme-grid",role:"radiogroup","aria-label":"主题"},M2=["aria-checked","onClick"],P2={class:"settings-section"},N2={class:"like-fields"},O2={class:"like-label"},D2=["onUpdate:modelValue","placeholder","aria-label"],B2={class:"like-actions"},j2={key:0,class:"saved-hint"},U2=Se({__name:"SettingsView",props:{like:{default:()=>({})}},emits:["update-like"],setup(e,{emit:t}){const n=e,s=t,o=vn("theme",N("system")),r=vn("setTheme",()=>{}),i=[{id:"light",label:"浅色",icon:"sun"},{id:"dark",label:"深色",icon:"moon"},{id:"system",label:"跟随系统",icon:"monitor"}],l=N({...n.like}),a=N(!1);Oe(()=>n.like,h=>{l.value={...h}});const c=[{key:"nickname",label:"称呼",hint:"AI 如何称呼你"},{key:"tone",label:"语气",hint:"回复的语气风格"},{key:"other",label:"偏好",hint:"其他偏好说明"},{key:"doNot",label:"禁止事项",hint:"明确禁止的行为"}];function u(){s("update-like",f()),a.value=!0,setTimeout(()=>a.value=!1,1500)}function f(){const h={};for(const p of c){const g=l.value[p.key];typeof g=="string"&&g.trim()&&(h[p.key]=g.trim())}return h}return(h,p)=>(y(),b("div",R2,[d("div",E2,[p[3]||(p[3]=d("h1",{class:"settings-title"},"设置",-1)),d("section",I2,[p[0]||(p[0]=d("h2",{class:"section-title"},"外观",-1)),d("div",L2,[(y(),b(ee,null,Ve(i,g=>d("button",{key:g.id,role:"radio","aria-checked":re(o)===g.id,class:fe(["theme-option",{active:re(o)===g.id}]),onClick:_=>re(r)(g.id)},[Z(be,{name:g.icon,size:20},null,8,["name"]),d("span",null,I(g.label),1)],10,M2)),64))])]),d("section",P2,[p[2]||(p[2]=d("h2",{class:"section-title"},"偏好设置",-1)),d("div",N2,[(y(),b(ee,null,Ve(c,g=>d("label",{key:g.key,class:"like-field"},[d("span",O2,I(g.label),1),Ye(d("input",{"onUpdate:modelValue":_=>l.value[g.key]=_,class:"like-input",placeholder:g.hint,"aria-label":g.label},null,8,D2),[[ut,l.value[g.key]]])])),64)),d("div",B2,[Z(Jn,{variant:"primary",onClick:u},{default:$t(()=>[...p[1]||(p[1]=[Re("保存偏好",-1)])]),_:1}),a.value?(y(),b("span",j2,"已保存")):D("",!0)])])])])]))}}),F2=xe(U2,[["__scopeId","data-v-51b9163d"]]),rd="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='40px'%20height='40px'%20viewBox='0%200%2040%2040'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eenginecloud%3c/title%3e%3cdefs%3e%3cpath%20d='M39.9999598,40%20L0,40%20L0,0%20L39.9999597,0%20Z'%20id='path-1'%3e%3c/path%3e%3cpolygon%20id='path-2'%20points='0%200%2039.9999598%200%2039.9999598%2040%200%2040'%3e%3c/polygon%3e%3c/defs%3e%3cg%20id='enginecloud'%20stroke='none'%20fill='none'%20xlink:href='%23path-1'%20fill-rule='evenodd'%3e%3cg%20id='编组'%20stroke-width='1'%3e%3cmask%20id='mask-3'%20fill='white'%3e%3cuse%20xlink:href='%23path-2'%3e%3c/use%3e%3c/mask%3e%3cg%20id='Clip-2'%3e%3c/g%3e%3cpath%20d='M28.126965,40%20L11.8729546,40%20C5.34286777,40%20-4.02297116e-05,34.657092%20-4.02297116e-05,28.1270052%20L-4.02297116e-05,11.8729948%20C-4.02297116e-05,5.342908%205.34286777,0%2011.8729546,0%20L28.126965,0%20C34.6570518,0%2039.9999598,5.342908%2039.9999598,11.8729948%20L39.9999598,28.1270052%20C39.9999598,34.657092%2034.6570518,40%2028.126965,40'%20id='Fill-1'%20fill='%23121833'%20mask='url(%23mask-3)'%3e%3c/path%3e%3c/g%3e%3cpath%20d='M23.4035945,21.505074%20L25.2638164,21.505074%20C28.0316206,21.505074%2030.2836798,23.6750646%2030.2836798,26.3422945%20C30.2836798,29.0095244%2028.0316206,31.1791127%2025.2638164,31.1791127%20L13.7001881,31.1791127%20L14.2404731,29.0175703%20L22.6883103,29.0091221%20C24.2492231,29.0091221%2025.5188728,27.7394724%2025.5188728,26.1785596%20C25.5188728,25.2174718%2025.1185871,24.6498305%2024.782669,24.3424755%20C23.9885345,23.6163292%2022.8552636,23.6364441%2022.4819318,23.6666164%20L20.6269398,23.6629957%20C17.9375836,23.5905822%2015.7494896,21.4222008%2015.7494896,18.8293959%20C15.7494896,16.162166%2018.0011465,13.9925776%2020.7689507,13.9925776%20L31.8301099,13.9925776%20L31.2894226,16.15412%20L23.4035945,16.15412%20C21.8277967,16.15412%2020.5456758,17.3541723%2020.5456758,18.8293959%20C20.5456758,20.3046194%2021.8277967,21.505074%2023.4035945,21.505074%20L23.4035945,21.505074%20Z%20M15.8504662,22.6842068%20C16.1542005,23.0478834%2016.4997737,23.3773648%2016.8787376,23.6666164%20L15.5567893,23.6666164%20L15.8504662,22.6842068%20Z%20M13.482143,8.82064589%20L18.621891,8.82064589%20L17.1350009,13.7922337%20C15.5020769,14.9065967%2014.4319665,16.7483129%2014.4319665,18.8293959%20C14.4319665,19.6601394%2014.608575,20.4554808%2014.9243782,21.1836386%20L13.7878888,24.9841394%20L22.572851,24.9809211%20C22.8456084,24.9744843%2023.5383641,24.9897716%2023.8935924,25.3148277%20C24.1011777,25.5039073%2024.201752,25.7867222%2024.201752,26.1785596%20C24.201752,27.0129238%2023.5226745,27.691599%2022.6883103,27.691599%20L8.21808527,27.691599%20L13.482143,8.82064589%20Z%20M23.4035945,17.4716431%20L32.3180963,17.4716431%20L33.517344,12.6750546%20L20.7689507,12.6750546%20C20.0621147,12.6750546%2019.3826348,12.7897092%2018.7474077,12.9980991%20L20.3903891,7.50352513%20L12.4816301,7.50352513%20L6.4829778,29.0091221%20L12.8847318,29.0091221%20L12.012954,32.4966358%20L25.2638164,32.4966358%20C28.7581691,32.4966358%2031.6008006,29.7356707%2031.6008006,26.3422945%20C31.6008006,22.948516%2028.7581691,20.1875509%2025.2638164,20.1875509%20L23.4035945,20.1875509%20C22.5543453,20.1875509%2021.8631989,19.5784731%2021.8631989,18.8293959%20C21.8631989,18.0807209%2022.5543453,17.4716431%2023.4035945,17.4716431%20L23.4035945,17.4716431%20Z'%20id='Fill-3'%20fill='%23FFFFFF'%3e%3c/path%3e%3c/g%3e%3c/svg%3e",G2={class:"sidebar-head"},z2=["src"],H2=["title","aria-label","aria-expanded"],q2=["title"],W2={key:0},V2={key:0,class:"side-search"},K2={class:"spaces"},Z2=["title"],J2=["title","onClick"],Y2={class:"space-name"},X2={class:"space-count"},Q2={key:0,class:"space-sessions"},ex=["title","onClick"],tx={key:0,class:"session-run","aria-hidden":"true"},nx={class:"session-text"},sx={class:"session-title"},ox={class:"session-meta"},rx=["title","onClick","onKeydown"],ix={key:0,class:"spaces-empty"},lx={class:"sidebar-foot","aria-label":"功能区"},ax=["title"],cx={key:0},ux=["title"],dx={key:0},fx={class:"sidebar-identity"},hx={key:0,class:"identity-text"},px=Se({__name:"Sidebar",props:{view:{},sessions:{},currentSessionId:{default:null},collapsed:{type:Boolean,default:!1},showCollapseToggle:{type:Boolean,default:!0}},emits:["navigate","switch-session","delete-session","create-session","toggle-collapse"],setup(e,{expose:t,emit:n}){const s=e,o=n,r=N(null),i=N("");function l(){var k,w;(k=r.value)==null||k.focus(),(w=r.value)==null||w.select()}t({focusSearch:l});const a=X(()=>{const k=i.value.trim().toLowerCase();return k?s.sessions.filter(w=>_(w).toLowerCase().includes(k)||w.workDir.toLowerCase().includes(k)):s.sessions}),c=X(()=>{var x;const k=new Map;for(const $ of a.value){const A=$.workDir||"默认空间",G=A.split(/[\\/]/).filter(Boolean),Q=G.length>0?G[G.length-1]:A,C=k.get(Q);C?C.items.push($):k.set(Q,{name:Q,workDir:A,items:[$]})}const w=(x=s.sessions.find($=>$.sessionId===s.currentSessionId))==null?void 0:x.workDir;return[...k.values()].sort(($,A)=>{var G,Q;return $.workDir===w?-1:A.workDir===w?1:(((G=A.items[0])==null?void 0:G.createdAt)??0)-(((Q=$.items[0])==null?void 0:Q.createdAt)??0)})}),u=N(new Set);function f(k){const w=new Set(u.value);w.has(k)?w.delete(k):w.add(k),u.value=w}function h(k){o("switch-session",k)}function p(k,w){window.confirm(`删除会话「${w}」?此操作不可恢复。`)&&o("delete-session",k)}function g(k){if(!k)return"";const w=Date.now()-k;if(w<6e4)return"刚刚";if(w<36e5)return`${Math.floor(w/6e4)} 分钟前`;if(w<864e5)return`${Math.floor(w/36e5)} 小时前`;const x=new Date(k);return`${x.getMonth()+1}/${x.getDate()}`}function _(k){const w=(k.title||"").trim();return w&&w!=="新会话"&&w!=="New Session"?w:"未命名会话"}return(k,w)=>(y(),b("aside",{class:fe(["sidebar",{"is-collapsed":e.collapsed}])},[d("div",G2,[d("button",{class:"sidebar-brand",title:"回到新对话",onClick:w[0]||(w[0]=x=>o("navigate","home"))},[d("img",{class:"brand-logo",src:re(rd),alt:"nexum"},null,8,z2)]),e.showCollapseToggle?(y(),b("button",{key:0,class:fe(["collapse-btn",{rotated:e.collapsed}]),title:e.collapsed?"展开侧栏":"折叠侧栏","aria-label":e.collapsed?"展开侧栏":"折叠侧栏","aria-expanded":!e.collapsed,onClick:w[1]||(w[1]=x=>o("toggle-collapse"))},[Z(be,{name:"panel-left",size:15})],10,H2)):D("",!0)]),d("button",{class:"new-chat-btn",title:e.collapsed?"新建对话":void 0,onClick:w[2]||(w[2]=x=>o("create-session"))},[Z(be,{name:"plus",size:16}),e.collapsed?D("",!0):(y(),b("span",W2,"新建对话"))],8,q2),e.collapsed?D("",!0):(y(),b("label",V2,[Z(be,{name:"search",size:15}),Ye(d("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":w[3]||(w[3]=x=>i.value=x),type:"text",placeholder:"搜索会话… (⌘K)","aria-label":"搜索会话",spellcheck:"false"},null,512),[[ut,i.value]])])),d("div",K2,[(y(!0),b(ee,null,Ve(c.value,x=>(y(),b("div",{key:x.name,class:"space-group"},[e.collapsed?(y(),b("button",{key:0,class:fe(["space-dot",{active:x.items.some($=>$.sessionId===e.currentSessionId)}]),title:x.name,onClick:w[4]||(w[4]=$=>o("toggle-collapse"))},I(x.name.slice(0,1).toUpperCase()),11,Z2)):(y(),b(ee,{key:1},[d("button",{class:"space-head",title:x.workDir,onClick:$=>f(x.name)},[Z(be,{name:u.value.has(x.name)?"chevron-right":"chevron-down",size:14},null,8,["name"]),d("span",Y2,I(x.name),1),d("span",X2,I(x.items.length),1)],8,J2),u.value.has(x.name)?D("",!0):(y(),b("div",Q2,[(y(!0),b(ee,null,Ve(x.items,$=>(y(),b("button",{key:$.sessionId,class:fe(["session-item",{active:$.sessionId===e.currentSessionId}]),title:_($),onClick:A=>h($.sessionId)},[$.active?(y(),b("span",tx)):D("",!0),d("span",nx,[d("span",sx,I(_($)),1),d("span",ox,[d("span",null,I(g($.createdAt)),1),w[7]||(w[7]=d("span",{class:"meta-sep","aria-hidden":"true"},"·",-1)),d("span",null,I($.messageCount)+" 条",1)])]),d("span",{class:"session-delete",role:"button",tabindex:"0",title:`删除会话 ${_($)}`,"aria-label":"删除会话",onClick:At(A=>p($.sessionId,_($)),["stop"]),onKeydown:Bs(At(A=>p($.sessionId,_($)),["stop","prevent"]),["enter"])},[Z(be,{name:"trash",size:14})],40,rx)],10,ex))),128))]))],64))]))),128)),!e.collapsed&&c.value.length===0?(y(),b("p",ix,I(i.value?"没有匹配的会话":"还没有会话,点击上方「新建对话」开始"),1)):D("",!0)]),d("nav",lx,[d("button",{class:fe(["foot-item",{active:e.view==="skills"}]),title:e.collapsed?"技能中心":void 0,onClick:w[5]||(w[5]=x=>o("navigate","skills"))},[Z(be,{name:"sparkles",size:17}),e.collapsed?D("",!0):(y(),b("span",cx,"技能中心"))],10,ax),d("button",{class:fe(["foot-item",{active:e.view==="settings"}]),title:e.collapsed?"设置":void 0,onClick:w[6]||(w[6]=x=>o("navigate","settings"))},[Z(be,{name:"settings",size:17}),e.collapsed?D("",!0):(y(),b("span",dx,"设置"))],10,ux),d("div",fx,[w[8]||(w[8]=d("span",{class:"identity-dot","aria-hidden":"true"},null,-1)),e.collapsed?D("",!0):(y(),b("span",hx,"nexum web"))])])],2))}}),La=xe(px,[["__scopeId","data-v-00be3632"]]),gx={class:"skills"},mx={class:"skills-head"},vx={class:"skills-grid"},yx={class:"skill-card-head"},bx={class:"skill-cmd"},kx={class:"skill-desc"},wx={key:0,class:"skill-aliases"},_x=Se({__name:"SkillsView",emits:["create"],setup(e,{emit:t}){const n=t,s={backend:"服务端",local:"本地"};return(o,r)=>(y(),b("div",gx,[d("div",mx,[r[2]||(r[2]=d("div",null,[d("h1",{class:"skills-title"},"技能中心"),d("p",{class:"skills-sub"},[Re("在输入框中输入 "),d("code",null,"/"),Re(" 即可触发以下命令")])],-1)),Z(Jn,{variant:"primary",onClick:r[0]||(r[0]=i=>n("create"))},{default:$t(()=>[Z(be,{name:"plus",size:16}),r[1]||(r[1]=Re(" 新建会话 ",-1))]),_:1})]),d("div",vx,[(y(!0),b(ee,null,Ve(re(dr),i=>{var l;return y(),b("article",{key:i.name,class:"skill-card"},[d("div",yx,[d("span",bx,"/"+I(i.name),1),d("span",{class:fe(["skill-target",`target-${i.target}`])},I(s[i.target]),3)]),d("p",kx,I(i.description),1),(l=i.aliases)!=null&&l.length?(y(),b("p",wx," 别名:"+I(i.aliases.map(a=>`/${a}`).join(" ")),1)):D("",!0)])}),128))])]))}}),Sx=xe(_x,[["__scopeId","data-v-f0fe3b71"]]),xx={class:"mode-switch",role:"group","aria-label":"工作模式"},Cx=["aria-pressed","onClick"],$x=Se({__name:"ModeSwitch",props:{modelValue:{default:"chat"}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,s=[{id:"chat",label:"智能工作"},{id:"goal",label:"任务模式"}];return(o,r)=>(y(),b("div",xx,[(y(),b(ee,null,Ve(s,i=>d("button",{key:i.id,class:fe(["mode-pill",`is-${i.id}`,{active:e.modelValue===i.id}]),"aria-pressed":e.modelValue===i.id,onClick:l=>n("update:modelValue",i.id)},I(i.label),11,Cx)),64))]))}}),Tx=xe($x,[["__scopeId","data-v-7069fcdc"]]),Ax={class:"workspace"},Rx={class:"workspace-hero"},Ex={class:"workspace-brand"},Ix=["src"],Lx={class:"mode-hint"},Mx={class:"workspace-composer"},Px=Se({__name:"WorkspaceHome",props:{models:{},status:{default:void 0},busy:{type:Boolean},mode:{default:"chat"}},emits:["send","command","switch-model","switch-thinking","update:mode"],setup(e,{emit:t}){const n=e,s=t,o=X(()=>n.mode==="goal"),r=X(()=>o.value?"任务模式:提交后将创建执行目标(Goal),Agent 持续执行到完成或预算耗尽;抽屉「Goal 管理」可查看与暂停。":"直接对话:提问后 Agent 按需调用工具完成你的请求。");return(i,l)=>(y(),b("div",Ax,[d("section",Rx,[d("h1",Ex,[d("img",{class:"brand-logo",src:re(rd),alt:"nexum"},null,8,Ix)]),l[5]||(l[5]=d("p",{class:"workspace-tagline"},"你的智能协作伙伴",-1)),Z(Tx,{class:"workspace-mode","model-value":n.mode,"onUpdate:modelValue":l[0]||(l[0]=a=>s("update:mode",a))},null,8,["model-value"]),d("p",Lx,[(y(),b("span",{key:String(o.value),class:"hint-fade"},I(r.value),1))])]),d("section",Mx,[Z(cu,{busy:e.busy,status:e.status,models:e.models,variant:"home",placeholder:o.value?"描述你要完成的目标,Enter 创建并开始执行…":"输入 @ 引用知识库 / 使用技能 / 或者直接提问...",onSend:l[1]||(l[1]=a=>s("send",a,n.mode)),onCommand:l[2]||(l[2]=(a,c)=>s("command",a,c)),onSwitchModel:l[3]||(l[3]=a=>s("switch-model",a)),onSwitchThinking:l[4]||(l[4]=a=>s("switch-thinking",a))},null,8,["busy","status","models","placeholder"])])]))}}),Nx=xe(Px,[["__scopeId","data-v-fd782c93"]]),Ox=["aria-valuenow"],Dx={key:2,class:"sidebar-mobile"},Bx={class:"canvas"},jx={class:"topbar mobile-only"},Ux={class:"topbar-left"},Fx={key:0,class:"topbar-running",title:"Agent 运行中"},Gx={class:"canvas-body"},Ma="nexum-sidebar-collapsed",Pa="nexum-sidebar-width",ys=180,bs=480,Na=288,Oa="nexum-workspace-mode",zx=Se({__name:"WebShell",setup(e){const t=cg(),{connectionStatus:n,status:s,isBusy:o,sessions:r,currentSessionId:i,models:l,like:a,sendPrompt:c,sendCommand:u,appendSystemMessage:f,createSession:h,switchSession:p,deleteSession:g,switchModel:_,switchThinking:k,fetchLike:w,fetchGitStatus:x,abort:$}=t,A=N("home"),G=N(!1),Q=N(null);function C(ne=8e3){return n.value==="connected"?Promise.resolve(!0):new Promise(ce=>{const m=Date.now(),S=window.setInterval(()=>{n.value==="connected"?(window.clearInterval(S),ce(!0)):Date.now()-m>ne&&(window.clearInterval(S),ce(!1))},80)})}function R(ne){ne==="chat"?i.value?A.value="chat":L():A.value=ne,G.value=!1}function L(){G.value=!1,A.value="chat",h()}async function J(ne,ce){if(G.value=!1,i.value||await h(),!!await C())if(A.value="chat",ce==="goal")try{await t.createGoal({objective:ne,budgets:[]})}catch(S){f(`Goal 创建失败:${ie(S)}。已保留对话模式,可重新发送。`),c(ne);return}else c(ne)}function ie(ne){return ne instanceof Error?ne.message:String(ne)}function z(ne){G.value=!1,A.value="chat",p(ne)}function ve(ne,ce){switch(ne){case"compact":case"auto":case"yes":case"plan":case"fork":case"title":case"btw":if(!i.value){h().then(()=>u(ne,ce));return}u(ne,ce);break;case"clear":t.clearMessages();break;case"new":L();break;case"help":f(lu());break;case"model":f(`当前模型:${s.value.model??"unknown"}`);break;case"status":case"usage":f("请在对话页查看会话详情");break;default:f(`未知命令:/${ne}`)}}const O=N(!1);try{O.value=localStorage.getItem(Ma)==="1"}catch{}function P(){O.value=!O.value;try{localStorage.setItem(Ma,O.value?"1":"0")}catch{}}function te(){try{const ne=Number(localStorage.getItem(Pa));if(Number.isFinite(ne)&&ne>=ys&&ne<=bs)return Math.round(ne)}catch{}return Na}const q=N(te()),ge=N(!1);let Ae=null;function ke(){try{localStorage.setItem(Pa,String(q.value))}catch{}}function ae(ne){if(!O.value){ne.preventDefault(),ge.value=!0,Ae=ne.pointerId;try{ne.currentTarget.setPointerCapture(ne.pointerId)}catch{}}}function Ce(ne){!ge.value||ne.pointerId!==Ae||(q.value=Math.min(bs,Math.max(ys,Math.round(ne.clientX))))}function Te(ne){!ge.value||ne.pointerId!==Ae||(ge.value=!1,Ae=null,ke())}function Rt(){q.value=Na,ke()}function Ke(ne){const ce=ne.shiftKey?32:12;if(ne.key==="ArrowLeft")ne.preventDefault(),q.value=Math.max(ys,q.value-ce);else if(ne.key==="ArrowRight")ne.preventDefault(),q.value=Math.min(bs,q.value+ce);else if(ne.key==="Home")ne.preventDefault(),q.value=ys;else if(ne.key==="End")ne.preventDefault(),q.value=bs;else if(ne.key==="Enter")ne.preventDefault(),Rt();else return;ke()}function Ze(){try{return localStorage.getItem(Oa)==="goal"?"goal":"chat"}catch{return"chat"}}const xt=N(Ze());function mt(ne){xt.value=ne;try{localStorage.setItem(Oa,ne)}catch{}}function Ft(ne){if((ne.metaKey||ne.ctrlKey)&&ne.key==="k")ne.preventDefault(),O.value&&P(),Ot(()=>{var ce;return(ce=Q.value)==null?void 0:ce.focusSearch()});else if((ne.metaKey||ne.ctrlKey)&&ne.key==="n")ne.preventDefault(),L();else if(ne.key==="Escape"&&o.value){const ce=ne.target;ce&&(ce.tagName==="TEXTAREA"||ce.tagName==="INPUT")||(ne.preventDefault(),$())}}return Ut(()=>{window.addEventListener("keydown",Ft),w(),x()}),Vt(()=>window.removeEventListener("keydown",Ft)),(ne,ce)=>(y(),b("div",{class:fe(["shell",{"sidebar-collapsed":O.value,resizing:ge.value}]),style:ln({"--sidebar-width":q.value+"px"})},[Z(La,{ref_key:"sidebarRef",ref:Q,view:A.value,sessions:re(r),"current-session-id":re(i),collapsed:O.value,onNavigate:R,onSwitchSession:z,onDeleteSession:re(g),onCreateSession:L,onToggleCollapse:P},null,8,["view","sessions","current-session-id","collapsed","onDeleteSession"]),O.value?D("",!0):(y(),b("div",{key:0,class:fe(["sidebar-resize-handle",{resizing:ge.value}]),role:"separator","aria-orientation":"vertical","aria-label":"调整侧栏宽度","aria-valuenow":q.value,"aria-valuemin":ys,"aria-valuemax":bs,tabindex:"0",title:"拖拽调整宽度 · 双击复位",onPointerdown:ae,onPointermove:Ce,onPointerup:Te,onPointercancel:Te,onDblclick:Rt,onKeydown:Ke},null,42,Ox)),G.value?(y(),b("div",{key:1,class:"sidebar-backdrop","aria-hidden":"true",onClick:ce[0]||(ce[0]=m=>G.value=!1)})):D("",!0),G.value?(y(),b("div",Dx,[Z(La,{view:A.value,sessions:re(r),"current-session-id":re(i),"show-collapse-toggle":!1,onNavigate:R,onSwitchSession:z,onDeleteSession:re(g),onCreateSession:L},null,8,["view","sessions","current-session-id","onDeleteSession"])])):D("",!0),d("main",Bx,[d("header",jx,[d("div",Ux,[d("button",{class:"topbar-icon mobile-menu",title:"菜单","aria-label":"打开菜单",onClick:ce[1]||(ce[1]=m=>G.value=!0)},[Z(be,{name:"menu",size:20})]),re(o)?(y(),b("span",Fx,[...ce[3]||(ce[3]=[d("span",{class:"running-dot","aria-hidden":"true"},null,-1),d("span",{class:"running-text"},"运行中",-1)])])):D("",!0)])]),d("div",Gx,[A.value==="home"?(y(),qe(Nx,{key:0,models:re(l),status:re(s),busy:re(o),mode:xt.value,"onUpdate:mode":mt,onSend:J,onCommand:ve,onSwitchModel:re(_),onSwitchThinking:re(k)},null,8,["models","status","busy","mode","onSwitchModel","onSwitchThinking"])):A.value==="chat"?(y(),qe(A2,{key:1,client:re(t),onHome:ce[2]||(ce[2]=m=>A.value="home")},null,8,["client"])):A.value==="skills"?(y(),qe(Sx,{key:2,onCreate:L})):A.value==="settings"?(y(),qe(F2,{key:3,like:re(a),onUpdateLike:re(t).updateLike},null,8,["like","onUpdateLike"])):D("",!0)])])],6))}}),Hx=xe(zx,[["__scopeId","data-v-da3d5426"]]),qx={class:"app"},Wx=Se({__name:"App",setup(e){const t=N("system"),n=N("dark");go("effectiveTheme",n),go("theme",t);const s={light:"#ffffff",dark:"#101113"};function o(){const a=document.documentElement,c=window.matchMedia("(prefers-color-scheme: dark)").matches,u=t.value==="system"?c?"dark":"light":t.value;n.value=u,a.dataset.theme=u;const f=document.querySelector('meta[name="theme-color"]');f&&f.setAttribute("content",s[u])}let r=null;function i(a){t.value=a;try{localStorage.setItem("nexum-theme",a)}catch{}const c=document.documentElement;c.classList.add("theme-transition"),o(),r!==null&&clearTimeout(r),r=window.setTimeout(()=>c.classList.remove("theme-transition"),320)}go("setTheme",i),Ut(()=>{try{const a=localStorage.getItem("nexum-theme");(a==="light"||a==="dark"||a==="system")&&(t.value=a)}catch{}o()}),Oe(t,o);const l=window.matchMedia("(prefers-color-scheme: dark)");return l.addEventListener("change",o),Vt(()=>{l.removeEventListener("change",o),r!==null&&clearTimeout(r),document.documentElement.classList.remove("theme-transition")}),(a,c)=>(y(),b("div",qx,[Z(Hx),Z(Xp)]))}}),Vx=xe(Wx,[["__scopeId","data-v-1bc438c4"]]);Gp(Vx).mount("#app");
|
|
93
|
-
//# sourceMappingURL=index-CGwN8W_j.js.map
|