scream-code 0.15.2 → 0.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{app-6Hcxs2tP.mjs → app-DHA9hN93.mjs} +77 -34
- package/dist/{dispatch-Dur5jHVw.mjs → dispatch-CULU8xVW.mjs} +1 -1
- package/dist/{dispatch-B_ViYZer.mjs → dispatch-m6mYTI1M.mjs} +1355 -168
- package/dist/main.mjs +1 -1
- package/dist/public/assets/index-ChLLVxTo.js +96 -0
- package/dist/public/assets/index-ChLLVxTo.js.map +1 -0
- package/dist/public/assets/index-yCBo3yth.css +1 -0
- package/dist/public/index.html +2 -2
- package/dist/{text-input-dialog-BUXAKycx.mjs → text-input-dialog-B2a6Ks8f.mjs} +12 -0
- package/dist/{text-input-dialog-Dr42qLMU.mjs → text-input-dialog-CR_kzyR3.mjs} +1 -1
- package/package.json +2 -2
- package/dist/public/assets/index-B9I4PIWR.js +0 -93
- package/dist/public/assets/index-B9I4PIWR.js.map +0 -1
- package/dist/public/assets/index-BfVIY6UW.css +0 -1
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
var id=Object.defineProperty;var ad=(e,t,n)=>t in e?id(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var M=(e,t,n)=>ad(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 l of r.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).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 bl(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const je={},Qn=[],Ut=()=>{},Ma=()=>!1,Vo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Wo=e=>e.startsWith("onUpdate:"),Je=Object.assign,kl=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},cd=Object.prototype.hasOwnProperty,Pe=(e,t)=>cd.call(e,t),he=Array.isArray,Xn=e=>Fs(e)==="[object Map]",Ko=e=>Fs(e)==="[object Set]",hi=e=>Fs(e)==="[object Date]",me=e=>typeof e=="function",qe=e=>typeof e=="string",Ft=e=>typeof e=="symbol",Oe=e=>e!==null&&typeof e=="object",La=e=>(Oe(e)||me(e))&&me(e.then)&&me(e.catch),Na=Object.prototype.toString,Fs=e=>Na.call(e),ud=e=>Fs(e).slice(8,-1),Oa=e=>Fs(e)==="[object Object]",wl=e=>qe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,_s=bl(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Zo=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},fd=/-\w/g,wt=Zo(e=>e.replace(fd,t=>t.slice(1).toUpperCase())),dd=/\B([A-Z])/g,Rn=Zo(e=>e.replace(dd,"-$1").toLowerCase()),Jo=Zo(e=>e.charAt(0).toUpperCase()+e.slice(1)),kr=Zo(e=>e?`on${Jo(e)}`:""),sn=(e,t)=>!Object.is(e,t),fo=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Da=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Yo=e=>{const t=parseFloat(e);return isNaN(t)?e:t},hd=e=>{const t=qe(e)?Number(e):NaN;return isNaN(t)?e:t};let pi;const Qo=()=>pi||(pi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function gn(e){if(he(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=qe(s)?vd(s):gn(s);if(o)for(const r in o)t[r]=o[r]}return t}else if(qe(e)||Oe(e))return e}const pd=/;(?![^(]*\))/g,gd=/:([^]+)/,md=/\/\*[^]*?\*\//g;function vd(e){const t={};return e.replace(md,"").split(pd).forEach(n=>{if(n){const s=n.split(gd);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function fe(e){let t="";if(qe(e))t=e;else if(he(e))for(let n=0;n<e.length;n++){const s=fe(e[n]);s&&(t+=s+" ")}else if(Oe(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const yd="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",bd=bl(yd);function Ba(e){return!!e||e===""}function kd(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=zs(e[s],t[s]);return n}function zs(e,t){if(e===t)return!0;let n=hi(e),s=hi(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=Ft(e),s=Ft(t),n||s)return e===t;if(n=he(e),s=he(t),n||s)return n&&s?kd(e,t):!1;if(n=Oe(e),s=Oe(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 l in e){const i=e.hasOwnProperty(l),a=t.hasOwnProperty(l);if(i&&!a||!i&&a||!zs(e[l],t[l]))return!1}}return String(e)===String(t)}function wd(e,t){return e.findIndex(n=>zs(n,t))}const ja=e=>!!(e&&e.__v_isRef===!0),I=e=>qe(e)?e:e==null?"":he(e)||Oe(e)&&(e.toString===Na||!me(e.toString))?ja(e)?I(e.value):JSON.stringify(e,Ua,2):String(e),Ua=(e,t)=>ja(t)?Ua(e,t.value):Xn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],r)=>(n[wr(s,r)+" =>"]=o,n),{})}:Ko(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>wr(n))}:Ft(t)?wr(t):Oe(t)&&!he(t)&&!Oa(t)?String(t):t,wr=(e,t="")=>{var n;return Ft(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function _d(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 rt;class Sd{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&&rt&&(rt.active?(this.parent=rt,this.index=(rt.scopes||(rt.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=rt;try{return rt=this,t()}finally{rt=n}}}on(){++this._on===1&&(this.prevScope=rt,rt=this)}off(){if(this._on>0&&--this._on===0){if(rt===this)rt=this.prevScope;else{let t=rt;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 xd(){return rt}let Fe;const _r=new WeakSet;class Ga{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,rt&&(rt.active?rt.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,_r.has(this)&&(_r.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||za(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,gi(this),Ha(this);const t=Fe,n=Gt;Fe=this,Gt=!0;try{return this.fn()}finally{qa(this),Fe=t,Gt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)xl(t);this.deps=this.depsTail=void 0,gi(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?_r.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){zr(this)&&this.run()}get dirty(){return zr(this)}}let Fa=0,Ss,xs;function za(e,t=!1){if(e.flags|=8,t){e.next=xs,xs=e;return}e.next=Ss,Ss=e}function _l(){Fa++}function Sl(){if(--Fa>0)return;if(xs){let t=xs;for(xs=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Ss;){let t=Ss;for(Ss=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 Ha(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function qa(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),xl(s),Cd(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function zr(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Va(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Va(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Rs)||(e.globalVersion=Rs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!zr(e))))return;e.flags|=2;const t=e.dep,n=Fe,s=Gt;Fe=e,Gt=!0;try{Ha(e);const o=e.fn(e._value);(t.version===0||sn(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Fe=n,Gt=s,qa(e),e.flags&=-3}}function xl(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)xl(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Cd(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Gt=!0;const Wa=[];function yn(){Wa.push(Gt),Gt=!1}function bn(){const e=Wa.pop();Gt=e===void 0?!0:e}function gi(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Fe;Fe=void 0;try{t()}finally{Fe=n}}}let Rs=0;class $d{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 Cl{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(!Fe||!Gt||Fe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Fe)n=this.activeLink=new $d(Fe,this),Fe.deps?(n.prevDep=Fe.depsTail,Fe.depsTail.nextDep=n,Fe.depsTail=n):Fe.deps=Fe.depsTail=n,Ka(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=Fe.depsTail,n.nextDep=void 0,Fe.depsTail.nextDep=n,Fe.depsTail=n,Fe.deps===n&&(Fe.deps=s)}return n}trigger(t){this.version++,Rs++,this.notify(t)}notify(t){_l();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Sl()}}}function Ka(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)Ka(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Hr=new WeakMap,Bn=Symbol(""),qr=Symbol(""),Es=Symbol("");function ut(e,t,n){if(Gt&&Fe){let s=Hr.get(e);s||Hr.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Cl),o.map=s,o.key=n),o.track()}}function cn(e,t,n,s,o,r){const l=Hr.get(e);if(!l){Rs++;return}const i=a=>{a&&a.trigger()};if(_l(),t==="clear")l.forEach(i);else{const a=he(e),c=a&&wl(n);if(a&&n==="length"){const u=Number(s);l.forEach((d,h)=>{(h==="length"||h===Es||!Ft(h)&&h>=u)&&i(d)})}else switch((n!==void 0||l.has(void 0))&&i(l.get(n)),c&&i(l.get(Es)),t){case"add":a?c&&i(l.get("length")):(i(l.get(Bn)),Xn(e)&&i(l.get(qr)));break;case"delete":a||(i(l.get(Bn)),Xn(e)&&i(l.get(qr)));break;case"set":Xn(e)&&i(l.get(Bn));break}}Sl()}function Kn(e){const t=Ae(e);return t===e?t:(ut(t,"iterate",Es),Ot(e)?t:t.map(zt))}function Xo(e){return ut(e=Ae(e),"iterate",Es),e}function tn(e,t){return kn(e)?rs(jn(e)?zt(t):t):zt(t)}const Td={__proto__:null,[Symbol.iterator](){return Sr(this,Symbol.iterator,e=>tn(this,e))},concat(...e){return Kn(this).concat(...e.map(t=>he(t)?Kn(t):t))},entries(){return Sr(this,"entries",e=>(e[1]=tn(this,e[1]),e))},every(e,t){return rn(this,"every",e,t,void 0,arguments)},filter(e,t){return rn(this,"filter",e,t,n=>n.map(s=>tn(this,s)),arguments)},find(e,t){return rn(this,"find",e,t,n=>tn(this,n),arguments)},findIndex(e,t){return rn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return rn(this,"findLast",e,t,n=>tn(this,n),arguments)},findLastIndex(e,t){return rn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return rn(this,"forEach",e,t,void 0,arguments)},includes(...e){return xr(this,"includes",e)},indexOf(...e){return xr(this,"indexOf",e)},join(e){return Kn(this).join(e)},lastIndexOf(...e){return xr(this,"lastIndexOf",e)},map(e,t){return rn(this,"map",e,t,void 0,arguments)},pop(){return fs(this,"pop")},push(...e){return fs(this,"push",e)},reduce(e,...t){return mi(this,"reduce",e,t)},reduceRight(e,...t){return mi(this,"reduceRight",e,t)},shift(){return fs(this,"shift")},some(e,t){return rn(this,"some",e,t,void 0,arguments)},splice(...e){return fs(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 fs(this,"unshift",e)},values(){return Sr(this,"values",e=>tn(this,e))}};function Sr(e,t,n){const s=Xo(e),o=s[t]();return s!==e&&!Ot(e)&&(o._next=o.next,o.next=()=>{const r=o._next();return r.done||(r.value=n(r.value)),r}),o}const Ad=Array.prototype;function rn(e,t,n,s,o,r){const l=Xo(e),i=l!==e&&!Ot(e),a=l[t];if(a!==Ad[t]){const d=a.apply(e,r);return i?zt(d):d}let c=n;l!==e&&(i?c=function(d,h){return n.call(this,tn(e,d),h,e)}:n.length>2&&(c=function(d,h){return n.call(this,d,h,e)}));const u=a.call(l,c,s);return i&&o?o(u):u}function mi(e,t,n,s){const o=Xo(e),r=o!==e&&!Ot(e);let l=n,i=!1;o!==e&&(r?(i=s.length===0,l=function(c,u,d){return i&&(i=!1,c=tn(e,c)),n.call(this,c,tn(e,u),d,e)}):n.length>3&&(l=function(c,u,d){return n.call(this,c,u,d,e)}));const a=o[t](l,...s);return i?tn(e,a):a}function xr(e,t,n){const s=Ae(e);ut(s,"iterate",Es);const o=s[t](...n);return(o===-1||o===!1)&&Rl(n[0])?(n[0]=Ae(n[0]),s[t](...n)):o}function fs(e,t,n=[]){yn(),_l();const s=Ae(e)[t].apply(e,n);return Sl(),bn(),s}const Rd=bl("__proto__,__v_isRef,__isVue"),Za=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ft));function Ed(e){Ft(e)||(e=String(e));const t=Ae(this);return ut(t,"has",e),t.hasOwnProperty(e)}class Ja{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?Ud:ec:r?Xa:Qa).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const l=he(t);if(!o){let a;if(l&&(a=Td[n]))return a;if(n==="hasOwnProperty")return Ed}const i=Reflect.get(t,n,pt(t)?t:s);if((Ft(n)?Za.has(n):Rd(n))||(o||ut(t,"get",n),r))return i;if(pt(i)){const a=l&&wl(n)?i:i.value;return o&&Oe(a)?Wr(a):a}return Oe(i)?o?Wr(i):Tl(i):i}}class Ya extends Ja{constructor(t=!1){super(!1,t)}set(t,n,s,o){let r=t[n];const l=he(t)&&wl(n);if(!this._isShallow){const c=kn(r);if(!Ot(s)&&!kn(s)&&(r=Ae(r),s=Ae(s)),!l&&pt(r)&&!pt(s))return c||(r.value=s),!0}const i=l?Number(n)<t.length:Pe(t,n),a=Reflect.set(t,n,s,pt(t)?t:o);return t===Ae(o)&&a&&(i?sn(s,r)&&cn(t,"set",n,s):cn(t,"add",n,s)),a}deleteProperty(t,n){const s=Pe(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&cn(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!Ft(n)||!Za.has(n))&&ut(t,"has",n),s}ownKeys(t){return ut(t,"iterate",he(t)?"length":Bn),Reflect.ownKeys(t)}}class Id extends Ja{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Pd=new Ya,Md=new Id,Ld=new Ya(!0);const Vr=e=>e,Xs=e=>Reflect.getPrototypeOf(e);function Nd(e,t,n){return function(...s){const o=this.__v_raw,r=Ae(o),l=Xn(r),i=e==="entries"||e===Symbol.iterator&&l,a=e==="keys"&&l,c=o[e](...s),u=n?Vr:t?rs:zt;return!t&&ut(r,"iterate",a?qr:Bn),Je(Object.create(c),{next(){const{value:d,done:h}=c.next();return h?{value:d,done:h}:{value:i?[u(d[0]),u(d[1])]:u(d),done:h}}})}}function eo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Od(e,t){const n={get(o){const r=this.__v_raw,l=Ae(r),i=Ae(o);e||(sn(o,i)&&ut(l,"get",o),ut(l,"get",i));const{has:a}=Xs(l),c=t?Vr:e?rs:zt;if(a.call(l,o))return c(r.get(o));if(a.call(l,i))return c(r.get(i));r!==l&&r.get(o)},get size(){const o=this.__v_raw;return!e&&ut(Ae(o),"iterate",Bn),o.size},has(o){const r=this.__v_raw,l=Ae(r),i=Ae(o);return e||(sn(o,i)&&ut(l,"has",o),ut(l,"has",i)),o===i?r.has(o):r.has(o)||r.has(i)},forEach(o,r){const l=this,i=l.__v_raw,a=Ae(i),c=t?Vr:e?rs:zt;return!e&&ut(a,"iterate",Bn),i.forEach((u,d)=>o.call(r,c(u),c(d),l))}};return Je(n,e?{add:eo("add"),set:eo("set"),delete:eo("delete"),clear:eo("clear")}:{add(o){const r=Ae(this),l=Xs(r),i=Ae(o),a=!t&&!Ot(o)&&!kn(o)?i:o;return l.has.call(r,a)||sn(o,a)&&l.has.call(r,o)||sn(i,a)&&l.has.call(r,i)||(r.add(a),cn(r,"add",a,a)),this},set(o,r){!t&&!Ot(r)&&!kn(r)&&(r=Ae(r));const l=Ae(this),{has:i,get:a}=Xs(l);let c=i.call(l,o);c||(o=Ae(o),c=i.call(l,o));const u=a.call(l,o);return l.set(o,r),c?sn(r,u)&&cn(l,"set",o,r):cn(l,"add",o,r),this},delete(o){const r=Ae(this),{has:l,get:i}=Xs(r);let a=l.call(r,o);a||(o=Ae(o),a=l.call(r,o)),i&&i.call(r,o);const c=r.delete(o);return a&&cn(r,"delete",o,void 0),c},clear(){const o=Ae(this),r=o.size!==0,l=o.clear();return r&&cn(o,"clear",void 0,void 0),l}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Nd(o,e,t)}),n}function $l(e,t){const n=Od(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 Dd={get:$l(!1,!1)},Bd={get:$l(!1,!0)},jd={get:$l(!0,!1)};const Qa=new WeakMap,Xa=new WeakMap,ec=new WeakMap,Ud=new WeakMap;function Gd(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Tl(e){return kn(e)?e:Al(e,!1,Pd,Dd,Qa)}function Fd(e){return Al(e,!1,Ld,Bd,Xa)}function Wr(e){return Al(e,!0,Md,jd,ec)}function Al(e,t,n,s,o){if(!Oe(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 l=Gd(ud(e));if(l===0)return e;const i=new Proxy(e,l===2?s:n);return o.set(e,i),i}function jn(e){return kn(e)?jn(e.__v_raw):!!(e&&e.__v_isReactive)}function kn(e){return!!(e&&e.__v_isReadonly)}function Ot(e){return!!(e&&e.__v_isShallow)}function Rl(e){return e?!!e.__v_raw:!1}function Ae(e){const t=e&&e.__v_raw;return t?Ae(t):e}function zd(e){return!Pe(e,"__v_skip")&&Object.isExtensible(e)&&Da(e,"__v_skip",!0),e}const zt=e=>Oe(e)?Tl(e):e,rs=e=>Oe(e)?Wr(e):e;function pt(e){return e?e.__v_isRef===!0:!1}function N(e){return Hd(e,!1)}function Hd(e,t){return pt(e)?e:new qd(e,t)}class qd{constructor(t,n){this.dep=new Cl,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Ae(t),this._value=n?t:zt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Ot(t)||kn(t);t=s?t:Ae(t),sn(t,n)&&(this._rawValue=t,this._value=s?t:zt(t),this.dep.trigger())}}function re(e){return pt(e)?e.value:e}const Vd={get:(e,t,n)=>t==="__v_raw"?e:re(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return pt(o)&&!pt(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function tc(e){return jn(e)?e:new Proxy(e,Vd)}class Wd{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Cl(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Rs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Fe!==this)return za(this,!0),!0}get value(){const t=this.dep.track();return Va(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Kd(e,t,n=!1){let s,o;return me(e)?s=e:(s=e.get,o=e.set),new Wd(s,o,n)}const to={},ko=new WeakMap;let Mn;function Zd(e,t=!1,n=Mn){if(n){let s=ko.get(n);s||ko.set(n,s=[]),s.push(e)}}function Jd(e,t,n=je){const{immediate:s,deep:o,once:r,scheduler:l,augmentJob:i,call:a}=n,c=A=>o?A:Ot(A)||o===!1||o===0?un(A,1):un(A);let u,d,h,p,g=!1,_=!1;if(pt(e)?(d=()=>e.value,g=Ot(e)):jn(e)?(d=()=>c(e),g=!0):he(e)?(_=!0,g=e.some(A=>jn(A)||Ot(A)),d=()=>e.map(A=>{if(pt(A))return A.value;if(jn(A))return c(A);if(me(A))return a?a(A,2):A()})):me(e)?t?d=a?()=>a(e,2):e:d=()=>{if(h){yn();try{h()}finally{bn()}}const A=Mn;Mn=u;try{return a?a(e,3,[p]):e(p)}finally{Mn=A}}:d=Ut,t&&o){const A=d,F=o===!0?1/0:o;d=()=>un(A(),F)}const k=xd(),w=()=>{u.stop(),k&&k.active&&kl(k.effects,u)};if(r&&t){const A=t;t=(...F)=>{const Q=A(...F);return w(),Q}}let x=_?new Array(e.length).fill(to):to;const $=A=>{if(!(!(u.flags&1)||!u.dirty&&!A))if(t){const F=u.run();if(A||o||g||(_?F.some((Q,C)=>sn(Q,x[C])):sn(F,x))){h&&h();const Q=Mn;Mn=u;try{const C=[F,x===to?void 0:_&&x[0]===to?[]:x,p];x=F,a?a(t,3,C):t(...C)}finally{Mn=Q}}}else u.run()};return i&&i($),u=new Ga(d),u.scheduler=l?()=>l($,!1):$,p=A=>Zd(A,!1,u),h=u.onStop=()=>{const A=ko.get(u);if(A){if(a)a(A,4);else for(const F of A)F();ko.delete(u)}},t?s?$(!0):x=u.run():l?l($.bind(null,!0),!0):u.run(),w.pause=u.pause.bind(u),w.resume=u.resume.bind(u),w.stop=w,w}function un(e,t=1/0,n){if(t<=0||!Oe(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,pt(e))un(e.value,t,n);else if(he(e))for(let s=0;s<e.length;s++)un(e[s],t,n);else if(Ko(e)||Xn(e))e.forEach(s=>{un(s,t,n)});else if(Oa(e)){for(const s in e)un(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&un(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 Hs(e,t,n,s){try{return s?e(...s):e()}catch(o){er(o,t,n)}}function Dt(e,t,n,s){if(me(e)){const o=Hs(e,t,n,s);return o&&La(o)&&o.catch(r=>{er(r,t,n)}),o}if(he(e)){const o=[];for(let r=0;r<e.length;r++)o.push(Dt(e[r],t,n,s));return o}}function er(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||je;if(t){let i=t.parent;const a=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;i;){const u=i.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](e,a,c)===!1)return}i=i.parent}if(r){yn(),Hs(r,null,10,[e,a,c]),bn();return}}Yd(e,n,o,s,l)}function Yd(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const bt=[];let en=-1;const es=[];let $n=null,Zn=0;const nc=Promise.resolve();let wo=null;function Lt(e){const t=wo||nc;return e?t.then(this?e.bind(this):e):t}function Qd(e){let t=en+1,n=bt.length;for(;t<n;){const s=t+n>>>1,o=bt[s],r=Is(o);r<e||r===e&&o.flags&2?t=s+1:n=s}return t}function El(e){if(!(e.flags&1)){const t=Is(e),n=bt[bt.length-1];!n||!(e.flags&2)&&t>=Is(n)?bt.push(e):bt.splice(Qd(t),0,e),e.flags|=1,sc()}}function sc(){wo||(wo=nc.then(lc))}function oc(e){he(e)?es.push(...e):$n&&e.id===-1?$n.splice(Zn+1,0,e):e.flags&1||(es.push(e),e.flags|=1),sc()}function vi(e,t,n=en+1){for(;n<bt.length;n++){const s=bt[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;bt.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function rc(e){if(es.length){const t=[...new Set(es)].sort((n,s)=>Is(n)-Is(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 Is=e=>e.id==null?e.flags&2?-1:1/0:e.id;function lc(e){try{for(en=0;en<bt.length;en++){const t=bt[en];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Hs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;en<bt.length;en++){const t=bt[en];t&&(t.flags&=-2)}en=-1,bt.length=0,rc(),wo=null,(bt.length||es.length)&&lc()}}let lt=null,ic=null;function _o(e){const t=lt;return lt=e,ic=e&&e.type.__scopeId||null,t}function Ct(e,t=lt,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Co(-1);const r=_o(t),l=vn.length;let i;try{i=e(...o)}finally{for(let a=vn.length;a>l;a--)Ol();_o(r),s._d&&Co(1)}return i};return s._n=!0,s._c=!0,s._d=!0,s}function Ze(e,t){if(lt===null)return e;const n=ir(lt),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[r,l,i,a=je]=t[o];r&&(me(r)&&(r={mounted:r,updated:r}),r.deep&&un(l),s.push({dir:r,instance:n,value:l,oldValue:void 0,arg:i,modifiers:a}))}return e}function En(e,t,n,s){const o=e.dirs,r=t&&t.dirs;for(let l=0;l<o.length;l++){const i=o[l];r&&(i.oldValue=r[l].value);let a=i.dir[s];a&&(yn(),Dt(a,n,8,[e.el,i,e,t]),bn())}}function ho(e,t){if(dt){let n=dt.provides;const s=dt.parent&&dt.parent.provides;s===n&&(n=dt.provides=Object.create(s)),n[e]=t}}function mn(e,t,n=!1){const s=lr();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&&me(t)?t.call(s&&s.proxy):t}}const Xd=Symbol.for("v-scx"),eh=()=>mn(Xd);function Le(e,t,n){return ac(e,t,n)}function ac(e,t,n=je){const{immediate:s,deep:o,flush:r,once:l}=n,i=Je({},n),a=t&&s||!t&&r!=="post";let c;if(Ns){if(r==="sync"){const p=eh();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!a){const p=()=>{};return p.stop=Ut,p.resume=Ut,p.pause=Ut,p}}const u=dt;i.call=(p,g,_)=>Dt(p,u,g,_);let d=!1;r==="post"?i.scheduler=p=>{yt(p,u&&u.suspense)}:r!=="sync"&&(d=!0,i.scheduler=(p,g)=>{g?p():El(p)}),i.augmentJob=p=>{t&&(p.flags|=4),d&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const h=Jd(e,t,i);return Ns&&(c?c.push(h):a&&h()),h}function th(e,t,n){const s=this.proxy,o=qe(e)?e.includes(".")?cc(s,e):()=>s[e]:e.bind(s,s);let r;me(t)?r=t:(r=t.handler,n=t);const l=qs(this),i=ac(o,r.bind(s),n);return l(),i}function cc(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,uc=Symbol("_vte"),fc=e=>e.__isTeleport,Ln=e=>e&&(e.disabled||e.disabled===""),nh=e=>e&&(e.defer||e.defer===""),yi=e=>typeof SVGElement<"u"&&e instanceof SVGElement,bi=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Kr=(e,t)=>{const n=e&&e.to;return qe(n)?t?t(n):null:n},sh={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,r,l,i,a,c){const{mc:u,pc:d,pbc:h,o:{insert:p,querySelector:g,createText:_,createComment:k,parentNode:w}}=c,x=Ln(t.props);let{dynamicChildren:$}=t;const A=(C,R,P)=>{C.shapeFlag&16&&u(C.children,R,P,o,r,l,i,a)},F=(C=t)=>{const R=Ln(C.props),P=C.target=Kr(C.props,g),Z=Zr(P,C,_,p);P&&(l!=="svg"&&yi(P)?l="svg":l!=="mathml"&&bi(P)&&(l="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(P),R||(A(C,P,Z),ys(C,!1)))},Q=C=>{const R=()=>{if(xn.get(C)===R){if(xn.delete(C),Ln(C.props)){const P=w(C.el)||n;A(C,P,C.anchor),ys(C,!0)}F(C)}};xn.set(C,R),yt(R,r)};if(e==null){const C=t.el=_(""),R=t.anchor=_("");if(p(C,n,s),p(R,n,s),nh(t.props)||r&&r.pendingBranch){Q(t);return}x&&(A(t,n,R),ys(t,!0)),F()}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 P=t.target=e.target,Z=t.targetAnchor=e.targetAnchor,ie=Ln(e.props),z=ie?n:P,ge=ie?C:Z;if(l==="svg"||yi(P)?l="svg":(l==="mathml"||bi(P))&&(l="mathml"),$?(h(e.dynamicChildren,$,z,o,r,l,i),Nl(e,t,!0)):a||d(e,t,z,ge,o,r,l,i,!1),x)ie?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):no(t,n,C,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const O=Kr(t.props,g);O&&(t.target=O,no(t,O,null,c,0))}else ie&&no(t,P,Z,c,1);ys(t,x)}},remove(e,t,n,{um:s,o:{remove:o}},r){const{shapeFlag:l,children:i,anchor:a,targetStart:c,targetAnchor:u,target:d,props:h}=e,p=Ln(h),g=r||!p,_=xn.get(e);if(_&&(_.flags|=8,xn.delete(e)),d&&(o(c),o(u)),r&&o(a),!_&&(p||d)&&l&16)for(let k=0;k<i.length;k++){const w=i[k];s(w,t,n,g,!!w.dynamicChildren)}},move:no,hydrate:oh};function no(e,t,n,{o:{insert:s},m:o},r=2){r===0&&s(e.targetAnchor,t,n);const{el:l,anchor:i,shapeFlag:a,children:c,props:u}=e,d=r===2;if(d&&s(l,t,n),!xn.has(e)&&(!d||Ln(u))&&a&16)for(let h=0;h<c.length;h++)o(c[h],t,n,2);d&&s(i,t,n)}function oh(e,t,n,s,o,r,{o:{nextSibling:l,parentNode:i,querySelector:a,insert:c,createText:u}},d){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&&l(t.targetAnchor);break}}x=l(x)}}function p(k,w){w.anchor=d(l(k),w,i(k),n,s,o,r)}const g=t.target=Kr(t.props,a),_=Ln(t.props);if(g){const k=g._lpa||g.firstChild;t.shapeFlag&16&&(_?(p(e,t),h(g,k),t.targetAnchor||Zr(g,t,u,c,i(e)===g?e:null)):(t.anchor=l(e),h(g,k),t.targetAnchor||Zr(g,t,u,c),d(k&&l(k),t,g,n,s,o,r))),ys(t,_)}else _&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=l(e));return t.anchor&&l(t.anchor)}const Il=sh;function ys(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 Zr(e,t,n,s,o=null){const r=t.targetStart=n(""),l=t.targetAnchor=n("");return r[uc]=l,e&&(s(r,e,o),s(l,e,o)),l}const Mt=Symbol("_leaveCb"),ds=Symbol("_enterCb");function dc(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Bt(()=>{e.isMounted=!0}),Ht(()=>{e.isUnmounting=!0}),e}const It=[Function,Array],hc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:It,onEnter:It,onAfterEnter:It,onEnterCancelled:It,onBeforeLeave:It,onLeave:It,onAfterLeave:It,onLeaveCancelled:It,onBeforeAppear:It,onAppear:It,onAfterAppear:It,onAppearCancelled:It},pc=e=>{const t=e.subTree;return t.component?pc(t.component):t},rh={name:"BaseTransition",props:hc,setup(e,{slots:t}){const n=lr(),s=dc();return()=>{const o=t.default&&Pl(t.default(),!0),r=o&&o.length?gc(o):n.subTree?B():void 0;if(!r)return;const l=Ae(e),{mode:i}=l;if(s.isLeaving)return Cr(r);const a=ki(r);if(!a)return Cr(r);let c=Ps(a,l,s,n,d=>c=d);a.type!==ft&&Gn(a,c);let u=n.subTree&&ki(n.subTree);if(u&&u.type!==ft&&!Nn(u,a)&&pc(n).type!==ft){let d=Ps(u,l,s,n);if(Gn(u,d),i==="out-in"&&a.type!==ft)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Cr(r);i==="in-out"&&a.type!==ft?d.delayLeave=(h,p,g)=>{const _=mc(s,u);_[String(u.key)]=u,h[Mt]=()=>{p(),h[Mt]=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 gc(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==ft){t=n;break}}return t}const lh=rh;function mc(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:l,persisted:i=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:h,onLeave:p,onAfterLeave:g,onLeaveCancelled:_,onBeforeAppear:k,onAppear:w,onAfterAppear:x,onAppearCancelled:$}=t,A=String(e.key),F=mc(n,e),Q=(P,Z)=>{P&&Dt(P,s,9,Z)},C=(P,Z)=>{const ie=Z[1];Q(P,Z),he(P)?P.every(z=>z.length<=1)&&ie():P.length<=1&&ie()},R={mode:l,persisted:i,beforeEnter(P){let Z=a;if(!n.isMounted)if(r)Z=k||a;else return;P[Mt]&&P[Mt](!0);const ie=F[A];ie&&Nn(e,ie)&&ie.el[Mt]&&ie.el[Mt](),Q(Z,[P])},enter(P){if(F[A]===e)return;let Z=c,ie=u,z=d;if(!n.isMounted)if(r)Z=w||c,ie=x||u,z=$||d;else return;let ge=!1;P[ds]=L=>{ge||(ge=!0,L?Q(z,[P]):Q(ie,[P]),R.delayedLeave&&R.delayedLeave(),P[ds]=void 0)};const O=P[ds].bind(null,!1);Z?C(Z,[P,O]):O()},leave(P,Z){const ie=String(e.key);if(P[ds]&&P[ds](!0),n.isUnmounting)return Z();Q(h,[P]);let z=!1;P[Mt]=O=>{z||(z=!0,Z(),O?Q(_,[P]):Q(g,[P]),P[Mt]=void 0,F[ie]===e&&delete F[ie])};const ge=P[Mt].bind(null,!1);F[ie]=e,p?C(p,[P,ge]):ge()},clone(P){const Z=Ps(P,t,n,s,o);return o&&o(Z),Z}};return R}function Cr(e){if(tr(e))return e=An(e),e.children=null,e}function ki(e){if(!tr(e))return fc(e.type)&&e.children?gc(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&&me(n.default))return n.default()}}function Gn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Gn(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 Pl(e,t=!1,n){let s=[],o=0;for(let r=0;r<e.length;r++){let l=e[r];const i=n==null?l.key:String(n)+String(l.key!=null?l.key:r);l.type===X?(l.patchFlag&128&&o++,s=s.concat(Pl(l.children,t,i))):(t||l.type!==ft)&&s.push(i!=null?An(l,{key:i}):l)}if(o>1)for(let r=0;r<s.length;r++)s[r].patchFlag=-2;return s}function _e(e,t){return me(e)?Je({name:e.name},t,{setup:e}):e}function vc(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function wi(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const So=new WeakMap;function Cs(e,t,n,s,o=!1){if(he(e)){e.forEach((_,k)=>Cs(_,t&&(he(t)?t[k]:t),n,s,o));return}if(ts(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Cs(e,t,n,s.component.subTree);return}const r=s.shapeFlag&4?ir(s.component):s.el,l=o?null:r,{i,r:a}=e,c=t&&t.r,u=i.refs===je?i.refs={}:i.refs,d=i.setupState,h=Ae(d),p=d===je?Ma:_=>wi(u,_)?!1:Pe(h,_),g=(_,k)=>!(k&&wi(u,k));if(c!=null&&c!==a){if(_i(t),qe(c))u[c]=null,p(c)&&(d[c]=null);else if(pt(c)){const _=t;g(c,_.k)&&(c.value=null),_.k&&(u[_.k]=null)}}if(me(a))Hs(a,i,12,[l,u]);else{const _=qe(a),k=pt(a);if(_||k){const w=()=>{if(e.f){const x=_?p(a)?d[a]:u[a]:g()||!e.k?a.value:u[e.k];if(o)he(x)&&kl(x,r);else if(he(x))x.includes(r)||x.push(r);else if(_)u[a]=[r],p(a)&&(d[a]=u[a]);else{const $=[r];g(a,e.k)&&(a.value=$),e.k&&(u[e.k]=$)}}else _?(u[a]=l,p(a)&&(d[a]=l)):k&&(g(a,e.k)&&(a.value=l),e.k&&(u[e.k]=l))};if(l){const x=()=>{w(),So.delete(e)};x.id=-1,So.set(e,x),yt(x,n)}else _i(e),w()}}}function _i(e){const t=So.get(e);t&&(t.flags|=8,So.delete(e))}Qo().requestIdleCallback;Qo().cancelIdleCallback;const ts=e=>!!e.type.__asyncLoader,tr=e=>e.type.__isKeepAlive;function ih(e,t){yc(e,"a",t)}function ah(e,t){yc(e,"da",t)}function yc(e,t,n=dt){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(nr(t,s,n),n){let o=n.parent;for(;o&&o.parent;)tr(o.parent.vnode)&&ch(s,t,n,o),o=o.parent}}function ch(e,t,n,s){const o=nr(t,e,s,!0);sr(()=>{kl(s[t],o)},n)}function nr(e,t,n=dt,s=!1){if(n){const o=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...l)=>{yn();const i=qs(n),a=Dt(t,n,e,l);return i(),bn(),a});return s?o.unshift(r):o.push(r),r}}const wn=e=>(t,n=dt)=>{(!Ns||e==="sp")&&nr(e,(...s)=>t(...s),n)},uh=wn("bm"),Bt=wn("m"),bc=wn("bu"),kc=wn("u"),Ht=wn("bum"),sr=wn("um"),fh=wn("sp"),dh=wn("rtg"),hh=wn("rtc");function ph(e,t=dt){nr("ec",e,t)}const wc="components";function gh(e,t){return Sc(wc,e,!0,t)||e}const _c=Symbol.for("v-ndc");function mh(e){return qe(e)?Sc(wc,e,!1)||e:e||_c}function Sc(e,t,n=!0,s=!1){const o=lt||dt;if(o){const r=o.type;{const i=Xh(r,!1);if(i&&(i===t||i===wt(t)||i===Jo(wt(t))))return r}const l=Si(o[e]||r[e],t)||Si(o.appContext[e],t);return!l&&s?r:l}}function Si(e,t){return e&&(e[t]||e[wt(t)]||e[Jo(wt(t))])}function Ve(e,t,n,s){let o;const r=n,l=he(e);if(l||qe(e)){const i=l&&jn(e);let a=!1,c=!1;i&&(a=!Ot(e),c=kn(e),e=Xo(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?rs(zt(e[u])):zt(e[u]):e[u],u,void 0,r)}else if(typeof e=="number"){o=new Array(e);for(let i=0;i<e;i++)o[i]=t(i+1,i,void 0,r)}else if(Oe(e))if(e[Symbol.iterator])o=Array.from(e,(i,a)=>t(i,a,void 0,r));else{const i=Object.keys(e);o=new Array(i.length);for(let a=0,c=i.length;a<c;a++){const u=i[a];o[a]=t(e[u],u,a,r)}}else o=[];return o}function po(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(),He(X,null,[K("slot",c,s&&s())],u?-2:64)}let l=e[t];l&&l._c&&(l._d=!1);const i=vn.length;y();let a;try{const c=l&&xc(l(n)),u=n.key||r||c&&c.key;a=He(X,{key:(u&&!Ft(u)?u:`_${t}`)+(!c&&s?"_fb":"")},c||(s?s():[]),c&&e._===1?64:-2)}catch(c){for(let u=vn.length;u>i;u--)Ol();throw c}finally{l&&l._c&&(l._d=!0)}return a}function xc(e){return e.some(t=>Ls(t)?!(t.type===ft||t.type===X&&!xc(t.children)):!0)?e:null}const Jr=e=>e?zc(e)?ir(e):Jr(e.parent):null,$s=Je(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=>Jr(e.parent),$root:e=>Jr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>$c(e),$forceUpdate:e=>e.f||(e.f=()=>{El(e.update)}),$nextTick:e=>e.n||(e.n=Lt.bind(e.proxy)),$watch:e=>th.bind(e)}),$r=(e,t)=>e!==je&&!e.__isScriptSetup&&Pe(e,t),vh={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:r,accessCache:l,type:i,appContext:a}=e;if(t[0]!=="$"){const h=l[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($r(s,t))return l[t]=1,s[t];if(o!==je&&Pe(o,t))return l[t]=2,o[t];if(Pe(r,t))return l[t]=3,r[t];if(n!==je&&Pe(n,t))return l[t]=4,n[t];Yr&&(l[t]=0)}}const c=$s[t];let u,d;if(c)return t==="$attrs"&&ut(e.attrs,"get",""),c(e);if((u=i.__cssModules)&&(u=u[t]))return u;if(n!==je&&Pe(n,t))return l[t]=4,n[t];if(d=a.config.globalProperties,Pe(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:r}=e;return $r(o,t)?(o[t]=n,!0):s!==je&&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:l}},i){let a;return!!(n[i]||e!==je&&i[0]!=="$"&&Pe(e,i)||$r(t,i)||Pe(r,i)||Pe(s,i)||Pe($s,i)||Pe(o.config.globalProperties,i)||(a=l.__cssModules)&&a[i])},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 xi(e){return he(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Yr=!0;function yh(e){const t=$c(e),n=e.proxy,s=e.ctx;Yr=!1,t.beforeCreate&&Ci(t.beforeCreate,e,"bc");const{data:o,computed:r,methods:l,watch:i,provide:a,inject:c,created:u,beforeMount:d,mounted:h,beforeUpdate:p,updated:g,activated:_,deactivated:k,beforeDestroy:w,beforeUnmount:x,destroyed:$,unmounted:A,render:F,renderTracked:Q,renderTriggered:C,errorCaptured:R,serverPrefetch:P,expose:Z,inheritAttrs:ie,components:z,directives:ge,filters:O}=t;if(c&&bh(c,s,null),l)for(const ee in l){const ve=l[ee];me(ve)&&(s[ee]=ve.bind(n))}if(o){const ee=o.call(n,n);Oe(ee)&&(e.data=Tl(ee))}if(Yr=!0,r)for(const ee in r){const ve=r[ee],Re=me(ve)?ve.bind(n,n):me(ve.get)?ve.get.bind(n,n):Ut,le=!me(ve)&&me(ve.set)?ve.set.bind(n):Ut,oe=Y({get:Re,set:le});Object.defineProperty(s,ee,{enumerable:!0,configurable:!0,get:()=>oe.value,set:ke=>oe.value=ke})}if(i)for(const ee in i)Cc(i[ee],s,n,ee);if(a){const ee=me(a)?a.call(n):a;Reflect.ownKeys(ee).forEach(ve=>{ho(ve,ee[ve])})}u&&Ci(u,e,"c");function te(ee,ve){he(ve)?ve.forEach(Re=>ee(Re.bind(n))):ve&&ee(ve.bind(n))}if(te(uh,d),te(Bt,h),te(bc,p),te(kc,g),te(ih,_),te(ah,k),te(ph,R),te(hh,Q),te(dh,C),te(Ht,x),te(sr,A),te(fh,P),he(Z))if(Z.length){const ee=e.exposed||(e.exposed={});Z.forEach(ve=>{Object.defineProperty(ee,ve,{get:()=>n[ve],set:Re=>n[ve]=Re,enumerable:!0})})}else e.exposed||(e.exposed={});F&&e.render===Ut&&(e.render=F),ie!=null&&(e.inheritAttrs=ie),z&&(e.components=z),ge&&(e.directives=ge),P&&vc(e)}function bh(e,t,n=Ut){he(e)&&(e=Qr(e));for(const s in e){const o=e[s];let r;Oe(o)?"default"in o?r=mn(o.from||s,o.default,!0):r=mn(o.from||s):r=mn(o),pt(r)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:l=>r.value=l}):t[s]=r}}function Ci(e,t,n){Dt(he(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Cc(e,t,n,s){let o=s.includes(".")?cc(n,s):()=>n[s];if(qe(e)){const r=t[e];me(r)&&Le(o,r)}else if(me(e))Le(o,e.bind(n));else if(Oe(e))if(he(e))e.forEach(r=>Cc(r,t,n,s));else{const r=me(e.handler)?e.handler.bind(n):t[e.handler];me(r)&&Le(o,r,e)}}function $c(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:r,config:{optionMergeStrategies:l}}=e.appContext,i=r.get(t);let a;return i?a=i:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(c=>xo(a,c,l,!0)),xo(a,t,l)),Oe(t)&&r.set(t,a),a}function xo(e,t,n,s=!1){const{mixins:o,extends:r}=t;r&&xo(e,r,n,!0),o&&o.forEach(l=>xo(e,l,n,!0));for(const l in t)if(!(s&&l==="expose")){const i=kh[l]||n&&n[l];e[l]=i?i(e[l],t[l]):t[l]}return e}const kh={data:$i,props:Ti,emits:Ti,methods:bs,computed:bs,beforeCreate:vt,created:vt,beforeMount:vt,mounted:vt,beforeUpdate:vt,updated:vt,beforeDestroy:vt,beforeUnmount:vt,destroyed:vt,unmounted:vt,activated:vt,deactivated:vt,errorCaptured:vt,serverPrefetch:vt,components:bs,directives:bs,watch:_h,provide:$i,inject:wh};function $i(e,t){return t?e?function(){return Je(me(e)?e.call(this,this):e,me(t)?t.call(this,this):t)}:t:e}function wh(e,t){return bs(Qr(e),Qr(t))}function Qr(e){if(he(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function vt(e,t){return e?[...new Set([].concat(e,t))]:t}function bs(e,t){return e?Je(Object.create(null),e,t):t}function Ti(e,t){return e?he(e)&&he(t)?[...new Set([...e,...t])]:Je(Object.create(null),xi(e),xi(t??{})):t}function _h(e,t){if(!e)return t;if(!t)return e;const n=Je(Object.create(null),e);for(const s in t)n[s]=vt(e[s],t[s]);return n}function Tc(){return{app:null,config:{isNativeTag:Ma,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 Sh=0;function xh(e,t){return function(s,o=null){me(s)||(s=Je({},s)),o!=null&&!Oe(o)&&(o=null);const r=Tc(),l=new WeakSet,i=[];let a=!1;const c=r.app={_uid:Sh++,_component:s,_props:o,_container:null,_context:r,_instance:null,version:tp,get config(){return r.config},set config(u){},use(u,...d){return l.has(u)||(u&&me(u.install)?(l.add(u),u.install(c,...d)):me(u)&&(l.add(u),u(c,...d))),c},mixin(u){return r.mixins.includes(u)||r.mixins.push(u),c},component(u,d){return d?(r.components[u]=d,c):r.components[u]},directive(u,d){return d?(r.directives[u]=d,c):r.directives[u]},mount(u,d,h){if(!a){const p=c._ceVNode||K(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,ir(p.component)}},onUnmount(u){i.push(u)},unmount(){a&&(Dt(i,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,d){return r.provides[u]=d,c},runWithContext(u){const d=ns;ns=c;try{return u()}finally{ns=d}}};return c}}let ns=null;const Ch=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${wt(t)}Modifiers`]||e[`${Rn(t)}Modifiers`];function $h(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||je;let o=n;const r=t.startsWith("update:"),l=r&&Ch(s,t.slice(7));l&&(l.trim&&(o=n.map(u=>qe(u)?u.trim():u)),l.number&&(o=n.map(Yo)));let i,a=s[i=kr(t)]||s[i=kr(wt(t))];!a&&r&&(a=s[i=kr(Rn(t))]),a&&Dt(a,e,6,o);const c=s[i+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[i])return;e.emitted[i]=!0,Dt(c,e,6,o)}}const Th=new WeakMap;function Ac(e,t,n=!1){const s=n?Th:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const r=e.emits;let l={},i=!1;if(!me(e)){const a=c=>{const u=Ac(c,t,!0);u&&(i=!0,Je(l,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!r&&!i?(Oe(e)&&s.set(e,null),null):(he(r)?r.forEach(a=>l[a]=null):Je(l,r),Oe(e)&&s.set(e,l),l)}function or(e,t){return!e||!Vo(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 Ai(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[r],slots:l,attrs:i,emit:a,render:c,renderCache:u,props:d,data:h,setupState:p,ctx:g,inheritAttrs:_}=e,k=_o(e);let w,x;try{if(n.shapeFlag&4){const A=o||s,F=A;w=nn(c.call(F,A,u,d,p,h,g)),x=i}else{const A=t;w=nn(A.length>1?A(d,{attrs:i,slots:l,emit:a}):A(d,null)),x=t.props?i:Ah(i)}}catch(A){vn.length=0,er(A,e,1),w=K(ft)}let $=w;if(x&&_!==!1){const A=Object.keys(x),{shapeFlag:F}=$;A.length&&F&7&&(r&&A.some(Wo)&&(x=Rh(x,r)),$=An($,x,!1,!0))}return n.dirs&&($=An($,null,!1,!0),$.dirs=$.dirs?$.dirs.concat(n.dirs):n.dirs),n.transition&&Gn($,n.transition),w=$,_o(k),w}const Ah=e=>{let t;for(const n in e)(n==="class"||n==="style"||Vo(n))&&((t||(t={}))[n]=e[n]);return t},Rh=(e,t)=>{const n={};for(const s in e)(!Wo(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Eh(e,t,n){const{props:s,children:o,component:r}=e,{props:l,children:i,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?Ri(s,l,c):!!l;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const h=u[d];if(Rc(l,s,h)&&!or(c,h))return!0}}}else return(o||i)&&(!i||!i.$stable)?!0:s===l?!1:s?l?Ri(s,l,c):!0:!!l;return!1}function Ri(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(Rc(t,e,r)&&!or(n,r))return!0}return!1}function Rc(e,t,n){const s=e[n],o=t[n];return n==="style"&&Oe(s)&&Oe(o)?!zs(s,o):s!==o}function Ih({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 Ec={},Ic=()=>Object.create(Ec),Pc=e=>Object.getPrototypeOf(e)===Ec;function Ph(e,t,n,s=!1){const o={},r=Ic();e.propsDefaults=Object.create(null),Mc(e,t,o,r);for(const l in e.propsOptions[0])l in o||(o[l]=void 0);n?e.props=s?o:Fd(o):e.type.props?e.props=o:e.props=r,e.attrs=r}function Mh(e,t,n,s){const{props:o,attrs:r,vnode:{patchFlag:l}}=e,i=Ae(o),[a]=e.propsOptions;let c=!1;if((s||l>0)&&!(l&16)){if(l&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let h=u[d];if(or(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=wt(h);o[g]=Xr(a,i,g,p,e,!1)}else p!==r[h]&&(r[h]=p,c=!0)}}}else{Mc(e,t,o,r)&&(c=!0);let u;for(const d in i)(!t||!Pe(t,d)&&((u=Rn(d))===d||!Pe(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=Xr(a,i,d,void 0,e,!0)):delete o[d]);if(r!==i)for(const d in r)(!t||!Pe(t,d))&&(delete r[d],c=!0)}c&&cn(e.attrs,"set","")}function Mc(e,t,n,s){const[o,r]=e.propsOptions;let l=!1,i;if(t)for(let a in t){if(_s(a))continue;const c=t[a];let u;o&&Pe(o,u=wt(a))?!r||!r.includes(u)?n[u]=c:(i||(i={}))[u]=c:or(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,l=!0)}if(r){const a=Ae(n),c=i||je;for(let u=0;u<r.length;u++){const d=r[u];n[d]=Xr(o,a,d,c[d],e,!Pe(c,d))}}return l}function Xr(e,t,n,s,o,r){const l=e[n];if(l!=null){const i=Pe(l,"default");if(i&&s===void 0){const a=l.default;if(l.type!==Function&&!l.skipFactory&&me(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=qs(o);s=c[n]=a.call(null,t),u()}}else s=a;o.ce&&o.ce._setProp(n,s)}l[0]&&(r&&!i?s=!1:l[1]&&(s===""||s===Rn(n))&&(s=!0))}return s}const Lh=new WeakMap;function Lc(e,t,n=!1){const s=n?Lh:t.propsCache,o=s.get(e);if(o)return o;const r=e.props,l={},i=[];let a=!1;if(!me(e)){const u=d=>{a=!0;const[h,p]=Lc(d,t,!0);Je(l,h),p&&i.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 Oe(e)&&s.set(e,Qn),Qn;if(he(r))for(let u=0;u<r.length;u++){const d=wt(r[u]);Ei(d)&&(l[d]=je)}else if(r)for(const u in r){const d=wt(u);if(Ei(d)){const h=r[u],p=l[d]=he(h)||me(h)?{type:h}:Je({},h),g=p.type;let _=!1,k=!0;if(he(g))for(let w=0;w<g.length;++w){const x=g[w],$=me(x)&&x.name;if($==="Boolean"){_=!0;break}else $==="String"&&(k=!1)}else _=me(g)&&g.name==="Boolean";p[0]=_,p[1]=k,(_||Pe(p,"default"))&&i.push(d)}}const c=[l,i];return Oe(e)&&s.set(e,c),c}function Ei(e){return e[0]!=="$"&&!_s(e)}const Ml=e=>e==="_"||e==="_ctx"||e==="$stable",Ll=e=>he(e)?e.map(nn):[nn(e)],Nh=(e,t,n)=>{if(t._n)return t;const s=Ct((...o)=>Ll(t(...o)),n);return s._c=!1,s},Nc=(e,t,n)=>{const s=e._ctx;for(const o in e){if(Ml(o))continue;const r=e[o];if(me(r))t[o]=Nh(o,r,s);else if(r!=null){const l=Ll(r);t[o]=()=>l}}},Oc=(e,t)=>{const n=Ll(t);e.slots.default=()=>n},Dc=(e,t,n)=>{for(const s in t)(n||!Ml(s))&&(e[s]=t[s])},Oh=(e,t,n)=>{const s=e.slots=Ic();if(e.vnode.shapeFlag&32){const o=t._;o?(Dc(s,t,n),n&&Da(s,"_",o,!0)):Nc(t,s)}else t&&Oc(e,t)},Dh=(e,t,n)=>{const{vnode:s,slots:o}=e;let r=!0,l=je;if(s.shapeFlag&32){const i=t._;i?n&&i===1?r=!1:Dc(o,t,n):(r=!t.$stable,Nc(t,o)),l=t}else t&&(Oc(e,t),l={default:1});if(r)for(const i in o)!Ml(i)&&l[i]==null&&delete o[i]},yt=Fh;function Bh(e){return jh(e)}function jh(e,t){const n=Qo();n.__VUE__=!0;const{insert:s,remove:o,patchProp:r,createElement:l,createText:i,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:h,setScopeId:p=Ut,insertStaticContent:g}=e,_=(m,S,E,G=null,D=null,j=null,ne=void 0,V=null,J=!!S.dynamicChildren)=>{if(m===S)return;m&&!Nn(m,S)&&(G=qt(m),ke(m,D,j,!0),m=null),S.patchFlag===-2&&(J=!1,S.dynamicChildren=null);const{type:U,ref:ce,shapeFlag:se}=S;switch(U){case rr:k(m,S,E,G);break;case ft:w(m,S,E,G);break;case go:m==null&&x(S,E,G,ne);break;case X:z(m,S,E,G,D,j,ne,V,J);break;default:se&1?F(m,S,E,G,D,j,ne,V,J):se&6?ge(m,S,E,G,D,j,ne,V,J):(se&64||se&128)&&U.process(m,S,E,G,D,j,ne,V,J,gt)}ce!=null&&D?Cs(ce,m&&m.ref,j,S||m,!S):ce==null&&m&&m.ref!=null&&Cs(m.ref,null,j,m,!0)},k=(m,S,E,G)=>{if(m==null)s(S.el=i(S.children),E,G);else{const D=S.el=m.el;S.children!==m.children&&c(D,S.children)}},w=(m,S,E,G)=>{m==null?s(S.el=a(S.children||""),E,G):S.el=m.el},x=(m,S,E,G)=>{[m.el,m.anchor]=g(m.children,S,E,G,m.el,m.anchor)},$=({el:m,anchor:S},E,G)=>{let D;for(;m&&m!==S;)D=h(m),s(m,E,G),m=D;s(S,E,G)},A=({el:m,anchor:S})=>{let E;for(;m&&m!==S;)E=h(m),o(m),m=E;o(S)},F=(m,S,E,G,D,j,ne,V,J)=>{if(S.type==="svg"?ne="svg":S.type==="math"&&(ne="mathml"),m==null)Q(S,E,G,D,j,ne,V,J);else{const U=m.el&&m.el._isVueCE?m.el:null;try{U&&U._beginPatch(),P(m,S,D,j,ne,V,J)}finally{U&&U._endPatch()}}},Q=(m,S,E,G,D,j,ne,V)=>{let J,U;const{props:ce,shapeFlag:se,transition:ae,dirs:ue}=m;if(J=m.el=l(m.type,j,ce&&ce.is,ce),se&8?u(J,m.children):se&16&&R(m.children,J,null,G,D,Tr(m,j),ne,V),ue&&En(m,null,G,"created"),C(J,m,m.scopeId,ne,G),ce){for(const Ie in ce)Ie!=="value"&&!_s(Ie)&&r(J,Ie,null,ce[Ie],j,G);"value"in ce&&r(J,"value",null,ce.value,j),(U=ce.onVnodeBeforeMount)&&Zt(U,G,m)}ue&&En(m,null,G,"beforeMount");const we=Uh(D,ae);we&&ae.beforeEnter(J),s(J,S,E),((U=ce&&ce.onVnodeMounted)||we||ue)&&yt(()=>{try{U&&Zt(U,G,m),we&&ae.enter(J),ue&&En(m,null,G,"mounted")}finally{}},D)},C=(m,S,E,G,D)=>{if(E&&p(m,E),G)for(let j=0;j<G.length;j++)p(m,G[j]);if(D){let j=D.subTree;if(S===j||Uc(j.type)&&(j.ssContent===S||j.ssFallback===S)){const ne=D.vnode;C(m,ne,ne.scopeId,ne.slotScopeIds,D.parent)}}},R=(m,S,E,G,D,j,ne,V,J=0)=>{for(let U=J;U<m.length;U++){const ce=m[U]=V?an(m[U]):nn(m[U]);_(null,ce,S,E,G,D,j,ne,V)}},P=(m,S,E,G,D,j,ne)=>{const V=S.el=m.el;let{patchFlag:J,dynamicChildren:U,dirs:ce}=S;J|=m.patchFlag&16;const se=m.props||je,ae=S.props||je;let ue;if(E&&In(E,!1),(ue=ae.onVnodeBeforeUpdate)&&Zt(ue,E,S,m),ce&&En(S,m,E,"beforeUpdate"),E&&In(E,!0),U&&(!m.dynamicChildren||m.dynamicChildren.length!==U.length)&&(J=0,ne=!1,U=null),(se.innerHTML&&ae.innerHTML==null||se.textContent&&ae.textContent==null)&&u(V,""),U?Z(m.dynamicChildren,U,V,E,G,Tr(S,D),j):ne||ve(m,S,V,null,E,G,Tr(S,D),j,!1),J>0){if(J&16)ie(V,se,ae,E,D);else if(J&2&&se.class!==ae.class&&r(V,"class",null,ae.class,D),J&4&&r(V,"style",se.style,ae.style,D),J&8){const we=S.dynamicProps;for(let Ie=0;Ie<we.length;Ie++){const Te=we[Ie],Ee=se[Te],Ye=ae[Te];(Ye!==Ee||Te==="value")&&r(V,Te,Ee,Ye,D,E)}}J&1&&m.children!==S.children&&u(V,S.children)}else!ne&&U==null&&ie(V,se,ae,E,D);((ue=ae.onVnodeUpdated)||ce)&&yt(()=>{ue&&Zt(ue,E,S,m),ce&&En(S,m,E,"updated")},G)},Z=(m,S,E,G,D,j,ne)=>{for(let V=0;V<S.length;V++){const J=m[V],U=S[V],ce=J.el&&(J.type===X||!Nn(J,U)||J.shapeFlag&198)?d(J.el):E;_(J,U,ce,null,G,D,j,ne,!0)}},ie=(m,S,E,G,D)=>{if(S!==E){if(S!==je)for(const j in S)!_s(j)&&!(j in E)&&r(m,j,S[j],null,D,G);for(const j in E){if(_s(j))continue;const ne=E[j],V=S[j];ne!==V&&j!=="value"&&r(m,j,V,ne,D,G)}"value"in E&&r(m,"value",S.value,E.value,D)}},z=(m,S,E,G,D,j,ne,V,J)=>{const U=S.el=m?m.el:i(""),ce=S.anchor=m?m.anchor:i("");let{patchFlag:se,dynamicChildren:ae,slotScopeIds:ue}=S;ue&&(V=V?V.concat(ue):ue),m==null?(s(U,E,G),s(ce,E,G),R(S.children||[],E,ce,D,j,ne,V,J)):se>0&&se&64&&ae&&m.dynamicChildren&&m.dynamicChildren.length===ae.length?(Z(m.dynamicChildren,ae,E,D,j,ne,V),(S.key!=null||D&&S===D.subTree)&&Nl(m,S,!0)):ve(m,S,E,ce,D,j,ne,V,J)},ge=(m,S,E,G,D,j,ne,V,J)=>{S.slotScopeIds=V,m==null?S.shapeFlag&512?D.ctx.activate(S,E,G,ne,J):O(S,E,G,D,j,ne,J):L(m,S,J)},O=(m,S,E,G,D,j,ne)=>{const V=m.component=Kh(m,G,D);if(tr(m)&&(V.ctx.renderer=gt),Zh(V,!1,ne),V.asyncDep){if(D&&D.registerDep(V,te,ne),!m.el){const J=V.subTree=K(ft);w(null,J,S,E),m.placeholder=J.el}}else te(V,m,S,E,D,j,ne)},L=(m,S,E)=>{const G=S.component=m.component;if(Eh(m,S,E))if(G.asyncDep&&!G.asyncResolved){ee(G,S,E);return}else G.next=S,G.update();else S.el=m.el,G.vnode=S},te=(m,S,E,G,D,j,ne)=>{const V=()=>{if(m.isMounted){let{next:se,bu:ae,u:ue,parent:we,vnode:Ie}=m;{const At=Bc(m);if(At){se&&(se.el=Ie.el,ee(m,se,ne)),At.asyncDep.then(()=>{yt(()=>{m.isUnmounted||U()},D)});return}}let Te=se,Ee;In(m,!1),se?(se.el=Ie.el,ee(m,se,ne)):se=Ie,ae&&fo(ae),(Ee=se.props&&se.props.onVnodeBeforeUpdate)&&Zt(Ee,we,se,Ie),In(m,!0);const Ye=Ai(m),Qe=m.subTree;m.subTree=Ye,_(Qe,Ye,d(Qe.el),qt(Qe),m,D,j),se.el=Ye.el,Te===null&&Ih(m,Ye.el),ue&&yt(ue,D),(Ee=se.props&&se.props.onVnodeUpdated)&&yt(()=>Zt(Ee,we,se,Ie),D)}else{let se;const{el:ae,props:ue}=S,{bm:we,m:Ie,parent:Te,root:Ee,type:Ye}=m,Qe=ts(S);In(m,!1),we&&fo(we),!Qe&&(se=ue&&ue.onVnodeBeforeMount)&&Zt(se,Te,S),In(m,!0);{Ee.ce&&Ee.ce._hasShadowRoot()&&Ee.ce._injectChildStyle(Ye,m.parent?m.parent.type:void 0);const At=m.subTree=Ai(m);_(null,At,E,G,m,D,j),S.el=At.el}if(Ie&&yt(Ie,D),!Qe&&(se=ue&&ue.onVnodeMounted)){const At=S;yt(()=>Zt(se,Te,At),D)}(S.shapeFlag&256||Te&&ts(Te.vnode)&&Te.vnode.shapeFlag&256)&&m.a&&yt(m.a,D),m.isMounted=!0,S=E=G=null}};m.scope.on();const J=m.effect=new Ga(V);m.scope.off();const U=m.update=J.run.bind(J),ce=m.job=J.runIfDirty.bind(J);ce.i=m,ce.id=m.uid,J.scheduler=()=>El(ce),In(m,!0),U()},ee=(m,S,E)=>{S.component=m;const G=m.vnode.props;m.vnode=S,m.next=null,Mh(m,S.props,G,E),Dh(m,S.children,E),yn(),vi(m),bn()},ve=(m,S,E,G,D,j,ne,V,J=!1)=>{const U=m&&m.children,ce=m?m.shapeFlag:0,se=S.children,{patchFlag:ae,shapeFlag:ue}=S;if(ae>0){if(ae&128){le(U,se,E,G,D,j,ne,V,J);return}else if(ae&256){Re(U,se,E,G,D,j,ne,V,J);return}}ue&8?(ce&16&&tt(U,D,j),se!==U&&u(E,se)):ce&16?ue&16?le(U,se,E,G,D,j,ne,V,J):tt(U,D,j,!0):(ce&8&&u(E,""),ue&16&&R(se,E,G,D,j,ne,V,J))},Re=(m,S,E,G,D,j,ne,V,J)=>{m=m||Qn,S=S||Qn;const U=m.length,ce=S.length,se=Math.min(U,ce);let ae;for(ae=0;ae<se;ae++){const ue=S[ae]=J?an(S[ae]):nn(S[ae]);_(m[ae],ue,E,null,D,j,ne,V,J)}U>ce?tt(m,D,j,!0,!1,se):R(S,E,G,D,j,ne,V,J,se)},le=(m,S,E,G,D,j,ne,V,J)=>{let U=0;const ce=S.length;let se=m.length-1,ae=ce-1;for(;U<=se&&U<=ae;){const ue=m[U],we=S[U]=J?an(S[U]):nn(S[U]);if(Nn(ue,we))_(ue,we,E,null,D,j,ne,V,J);else break;U++}for(;U<=se&&U<=ae;){const ue=m[se],we=S[ae]=J?an(S[ae]):nn(S[ae]);if(Nn(ue,we))_(ue,we,E,null,D,j,ne,V,J);else break;se--,ae--}if(U>se){if(U<=ae){const ue=ae+1,we=ue<ce?S[ue].el:G;for(;U<=ae;)_(null,S[U]=J?an(S[U]):nn(S[U]),E,we,D,j,ne,V,J),U++}}else if(U>ae)for(;U<=se;)ke(m[U],D,j,!0),U++;else{const ue=U,we=U,Ie=new Map;for(U=we;U<=ae;U++){const mt=S[U]=J?an(S[U]):nn(S[U]);mt.key!=null&&Ie.set(mt.key,U)}let Te,Ee=0;const Ye=ae-we+1;let Qe=!1,At=0;const jt=new Array(Ye);for(U=0;U<Ye;U++)jt[U]=0;for(U=ue;U<=se;U++){const mt=m[U];if(Ee>=Ye){ke(mt,D,j,!0);continue}let ot;if(mt.key!=null)ot=Ie.get(mt.key);else for(Te=we;Te<=ae;Te++)if(jt[Te-we]===0&&Nn(mt,S[Te])){ot=Te;break}ot===void 0?ke(mt,D,j,!0):(jt[ot-we]=U+1,ot>=At?At=ot:Qe=!0,_(mt,S[ot],E,null,D,j,ne,V,J),Ee++)}const Zs=Qe?Gh(jt):Qn;for(Te=Zs.length-1,U=Ye-1;U>=0;U--){const mt=we+U,ot=S[mt],Vt=S[mt+1],Wt=mt+1<ce?Vt.el||jc(Vt):G;jt[U]===0?_(null,ot,E,Wt,D,j,ne,V,J):Qe&&(Te<0||U!==Zs[Te]?oe(ot,E,Wt,2):Te--)}}},oe=(m,S,E,G,D=null)=>{const{el:j,type:ne,transition:V,children:J,shapeFlag:U}=m;if(U&6){oe(m.component.subTree,S,E,G);return}if(U&128){m.suspense.move(S,E,G);return}if(U&64){ne.move(m,S,E,gt);return}if(ne===X){s(j,S,E);for(let se=0;se<J.length;se++)oe(J[se],S,E,G);s(m.anchor,S,E);return}if(ne===go){$(m,S,E);return}if(G!==2&&U&1&&V)if(G===0)V.persisted&&!j[Mt]?s(j,S,E):(V.beforeEnter(j),s(j,S,E),yt(()=>V.enter(j),D));else{const{leave:se,delayLeave:ae,afterLeave:ue}=V,we=()=>{m.ctx.isUnmounted?o(j):s(j,S,E)},Ie=()=>{const Te=j._isLeaving||!!j[Mt];j._isLeaving&&j[Mt](!0),V.persisted&&!Te?we():se(j,()=>{we(),ue&&ue()})};ae?ae(j,we,Ie):Ie()}else s(j,S,E)},ke=(m,S,E,G=!1,D=!1)=>{const{type:j,props:ne,ref:V,children:J,dynamicChildren:U,shapeFlag:ce,patchFlag:se,dirs:ae,cacheIndex:ue,memo:we}=m;if(se===-2&&(D=!1),V!=null&&(yn(),Cs(V,null,E,m,!0),bn()),ue!=null&&(S.renderCache[ue]=void 0),ce&256){S.ctx.deactivate(m);return}const Ie=ce&1&&ae,Te=!ts(m);let Ee;if(Te&&(Ee=ne&&ne.onVnodeBeforeUnmount)&&Zt(Ee,S,m),ce&6)We(m.component,E,G);else{if(ce&128){m.suspense.unmount(E,G);return}Ie&&En(m,null,S,"beforeUnmount"),ce&64?m.type.remove(m,S,E,gt,G):U&&!U.hasOnce&&(j!==X||se>0&&se&64)?tt(U,S,E,!1,!0):(j===X&&se&384||!D&&ce&16)&&tt(J,S,E),G&&xe(m)}const Ye=we!=null&&ue==null;(Te&&(Ee=ne&&ne.onVnodeUnmounted)||Ie||Ye)&&yt(()=>{Ee&&Zt(Ee,S,m),Ie&&En(m,null,S,"unmounted"),Ye&&(m.el=null)},E)},xe=m=>{const{type:S,el:E,anchor:G,transition:D}=m;if(S===X){on(E,G);return}if(S===go){A(m);return}const j=()=>{o(E),D&&!D.persisted&&D.afterLeave&&D.afterLeave()};if(m.shapeFlag&1&&D&&!D.persisted){const{leave:ne,delayLeave:V}=D,J=()=>ne(E,j);V?V(m.el,j,J):J()}else j()},on=(m,S)=>{let E;for(;m!==S;)E=h(m),o(m),m=E;o(S)},We=(m,S,E)=>{const{bum:G,scope:D,job:j,subTree:ne,um:V,m:J,a:U}=m;Ii(J),Ii(U),G&&fo(G),D.stop(),j&&(j.flags|=8,ke(ne,m,S,E)),V&&yt(V,S),yt(()=>{m.isUnmounted=!0},S)},tt=(m,S,E,G=!1,D=!1,j=0)=>{for(let ne=j;ne<m.length;ne++)ke(m[ne],S,E,G,D)},qt=m=>{if(m.shapeFlag&6)return qt(m.component.subTree);if(m.shapeFlag&128)return m.suspense.next();const S=h(m.anchor||m.el),E=S&&S[uc];return E?h(E):S};let St=!1;const _n=(m,S,E)=>{let G;m==null?S._vnode&&(ke(S._vnode,null,null,!0),G=S._vnode.component):_(S._vnode||null,m,S,null,null,null,E),S._vnode=m,St||(St=!0,vi(G),rc(),St=!1)},gt={p:_,um:ke,m:oe,r:xe,mt:O,mc:R,pc:ve,pbc:Z,n:qt,o:e};return{render:_n,hydrate:void 0,createApp:xh(_n)}}function Tr({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 Uh(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Nl(e,t,n=!1){const s=e.children,o=t.children;if(he(s)&&he(o))for(let r=0;r<s.length;r++){const l=s[r];let i=o[r];i.shapeFlag&1&&!i.dynamicChildren&&((i.patchFlag<=0||i.patchFlag===32)&&(i=o[r]=an(o[r]),i.el=l.el),!n&&i.patchFlag!==-2&&Nl(l,i)),i.type===rr&&(i.patchFlag===-1&&(i=o[r]=an(i)),i.el=l.el),i.type===ft&&!i.el&&(i.el=l.el)}}function Gh(e){const t=e.slice(),n=[0];let s,o,r,l,i;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,l=n.length-1;r<l;)i=r+l>>1,e[n[i]]<c?r=i+1:l=i;c<e[n[r]]&&(r>0&&(t[s]=n[r-1]),n[r]=s)}}for(r=n.length,l=n[r-1];r-- >0;)n[r]=l,l=t[l];return n}function Bc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Bc(t)}function Ii(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function jc(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?jc(t.subTree):null}const Uc=e=>e.__isSuspense;function Fh(e,t){t&&t.pendingBranch?he(e)?t.effects.push(...e):t.effects.push(e):oc(e)}const X=Symbol.for("v-fgt"),rr=Symbol.for("v-txt"),ft=Symbol.for("v-cmt"),go=Symbol.for("v-stc"),vn=[];let $t=null;function y(e=!1){vn.push($t=e?null:[])}function Ol(){vn.pop(),$t=vn[vn.length-1]||null}let Ms=1;function Co(e,t=!1){Ms+=e,e<0&&$t&&t&&($t.hasOnce=!0)}function Gc(e){return e.dynamicChildren=Ms>0?$t||Qn:null,Ol(),Ms>0&&$t&&$t.push(e),e}function b(e,t,n,s,o,r){return Gc(f(e,t,n,s,o,r,!0))}function He(e,t,n,s,o){return Gc(K(e,t,n,s,o,!0))}function Ls(e){return e?e.__v_isVNode===!0:!1}function Nn(e,t){return e.type===t.type&&e.key===t.key}const Fc=({key:e})=>e??null,mo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?qe(e)||pt(e)||me(e)?{i:lt,r:e,k:t,f:!!n}:e:null);function f(e,t=null,n=null,s=0,o=null,r=e===X?0:1,l=!1,i=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Fc(t),ref:t&&mo(t),scopeId:ic,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 i?($o(a,n),r&128&&e.normalize(a)):n&&(a.shapeFlag|=qe(n)?8:16),Ms>0&&!l&&$t&&(a.patchFlag>0||r&6)&&a.patchFlag!==32&&$t.push(a),a}const K=zh;function zh(e,t=null,n=null,s=0,o=null,r=!1){if((!e||e===_c)&&(e=ft),Ls(e)){const i=An(e,t,!0);return n&&$o(i,n),Ms>0&&!r&&$t&&(i.shapeFlag&6?$t[$t.indexOf(e)]=i:$t.push(i)),i.patchFlag=-2,i}if(ep(e)&&(e=e.__vccOpts),t){t=Hh(t);let{class:i,style:a}=t;i&&!qe(i)&&(t.class=fe(i)),Oe(a)&&(Rl(a)&&!he(a)&&(a=Je({},a)),t.style=gn(a))}const l=qe(e)?1:Uc(e)?128:fc(e)?64:Oe(e)?4:me(e)?2:0;return f(e,t,n,s,o,l,r,!0)}function Hh(e){return e?Rl(e)||Pc(e)?Je({},e):e:null}function An(e,t,n=!1,s=!1){const{props:o,ref:r,patchFlag:l,children:i,transition:a}=e,c=t?qh(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Fc(c),ref:t&&t.ref?n&&r?he(r)?r.concat(mo(t)):[r,mo(t)]:mo(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==X?l===-1?16:l|16:l,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&&Gn(u,a.clone(u)),u}function $e(e=" ",t=0){return K(rr,null,e,t)}function B(e="",t=!1){return t?(y(),He(ft,null,e)):K(ft,null,e)}function nn(e){return e==null||typeof e=="boolean"?K(ft):he(e)?K(X,null,e.slice()):Ls(e)?an(e):K(rr,null,String(e))}function an(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:An(e)}function $o(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(he(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),$o(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Pc(t)?t._ctx=lt:o===3&<&&(lt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(me(t)){if(s&65){$o(e,{default:t});return}t={default:t,_ctx:lt},n=32}else t=String(t),s&64?(n=16,t=[$e(t)]):n=8;e.children=t,e.shapeFlag|=n}function qh(...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=gn([t.style,s.style]);else if(Vo(o)){const r=t[o],l=s[o];l&&r!==l&&!(he(r)&&r.includes(l))?t[o]=r?[].concat(r,l):l:l==null&&r==null&&!Wo(o)&&(t[o]=l)}else o!==""&&(t[o]=s[o])}return t}function Zt(e,t,n,s=null){Dt(e,t,7,[n,s])}const Vh=Tc();let Wh=0;function Kh(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Vh,r={uid:Wh++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Sd(!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:Lc(s,o),emitsOptions:Ac(s,o),emit:null,emitted:null,propsDefaults:je,inheritAttrs:s.inheritAttrs,ctx:je,data:je,props:je,attrs:je,slots:je,refs:je,setupState:je,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=$h.bind(null,r),e.ce&&e.ce(r),r}let dt=null;const lr=()=>dt||lt;let To,el;{const e=Qo(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),r=>{o.length>1?o.forEach(l=>l(r)):o[0](r)}};To=t("__VUE_INSTANCE_SETTERS__",n=>dt=n),el=t("__VUE_SSR_SETTERS__",n=>Ns=n)}const qs=e=>{const t=dt;return To(e),e.scope.on(),()=>{e.scope.off(),To(t)}},Pi=()=>{dt&&dt.scope.off(),To(null)};function zc(e){return e.vnode.shapeFlag&4}let Ns=!1;function Zh(e,t=!1,n=!1){t&&el(t);const{props:s,children:o}=e.vnode,r=zc(e);Ph(e,s,r,t),Oh(e,o,n||t);const l=r?Jh(e,t):void 0;return t&&el(!1),l}function Jh(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,vh);const{setup:s}=n;if(s){yn();const o=e.setupContext=s.length>1?Qh(e):null,r=qs(e),l=Hs(s,e,0,[e.props,o]),i=La(l);if(bn(),r(),(i||e.sp)&&!ts(e)&&vc(e),i){if(l.then(Pi,Pi),t)return l.then(a=>{Mi(e,a)}).catch(a=>{er(a,e,0)});e.asyncDep=l}else Mi(e,l)}else Hc(e)}function Mi(e,t,n){me(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Oe(t)&&(e.setupState=tc(t)),Hc(e)}function Hc(e,t,n){const s=e.type;e.render||(e.render=s.render||Ut);{const o=qs(e);yn();try{yh(e)}finally{bn(),o()}}}const Yh={get(e,t){return ut(e,"get",""),e[t]}};function Qh(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Yh),slots:e.slots,emit:e.emit,expose:t}}function ir(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(tc(zd(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in $s)return $s[n](e)},has(t,n){return n in t||n in $s}})):e.proxy}function Xh(e,t=!0){return me(e)?e.displayName||e.name:e.name||t&&e.__name}function ep(e){return me(e)&&"__vccOpts"in e}const Y=(e,t)=>Kd(e,t,Ns);function Me(e,t,n){try{Co(-1);const s=arguments.length;return s===2?Oe(t)&&!he(t)?Ls(t)?K(e,null,[t]):K(e,t):K(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Ls(n)&&(n=[n]),K(e,t,n))}finally{Co(1)}}const tp="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 tl;const Li=typeof window<"u"&&window.trustedTypes;if(Li)try{tl=Li.createPolicy("vue",{createHTML:e=>e})}catch{}const qc=tl?e=>tl.createHTML(e):e=>e,np="http://www.w3.org/2000/svg",sp="http://www.w3.org/1998/Math/MathML",ln=typeof document<"u"?document:null,Ni=ln&&ln.createElement("template"),op={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"?ln.createElementNS(np,e):t==="mathml"?ln.createElementNS(sp,e):n?ln.createElement(e,{is:n}):ln.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>ln.createTextNode(e),createComment:e=>ln.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ln.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,r){const l=n?n.previousSibling:t.lastChild;if(o&&(o===r||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===r||!(o=o.nextSibling)););else{Ni.innerHTML=qc(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const i=Ni.content;if(s==="svg"||s==="mathml"){const a=i.firstChild;for(;a.firstChild;)i.appendChild(a.firstChild);i.removeChild(a)}t.insertBefore(i,n)}return[l?l.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Sn="transition",hs="animation",ls=Symbol("_vtc"),Vc={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},Wc=Je({},hc,Vc),rp=e=>(e.displayName="Transition",e.props=Wc,e),ar=rp((e,{slots:t})=>Me(lh,Kc(e),t)),Pn=(e,t=[])=>{he(e)?e.forEach(n=>n(...t)):e&&e(...t)},Oi=e=>e?he(e)?e.some(t=>t.length>1):e.length>1:!1;function Kc(e){const t={};for(const z in e)z in Vc||(t[z]=e[z]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:r=`${n}-enter-from`,enterActiveClass:l=`${n}-enter-active`,enterToClass:i=`${n}-enter-to`,appearFromClass:a=r,appearActiveClass:c=l,appearToClass:u=i,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,g=lp(o),_=g&&g[0],k=g&&g[1],{onBeforeEnter:w,onEnter:x,onEnterCancelled:$,onLeave:A,onLeaveCancelled:F,onBeforeAppear:Q=w,onAppear:C=x,onAppearCancelled:R=$}=t,P=(z,ge,O,L)=>{z._enterCancelled=L,Cn(z,ge?u:i),Cn(z,ge?c:l),O&&O()},Z=(z,ge)=>{z._isLeaving=!1,Cn(z,d),Cn(z,p),Cn(z,h),ge&&ge()},ie=z=>(ge,O)=>{const L=z?C:x,te=()=>P(ge,z,O);Pn(L,[ge,te]),Di(()=>{Cn(ge,z?a:r),Jt(ge,z?u:i),Oi(L)||Bi(ge,s,_,te)})};return Je(t,{onBeforeEnter(z){Pn(w,[z]),Jt(z,r),Jt(z,l)},onBeforeAppear(z){Pn(Q,[z]),Jt(z,a),Jt(z,c)},onEnter:ie(!1),onAppear:ie(!0),onLeave(z,ge){z._isLeaving=!0;const O=()=>Z(z,ge);Jt(z,d),z._enterCancelled?(Jt(z,h),nl(z)):(nl(z),Jt(z,h)),Di(()=>{z._isLeaving&&(Cn(z,d),Jt(z,p),Oi(A)||Bi(z,s,k,O))}),Pn(A,[z,O])},onEnterCancelled(z){P(z,!1,void 0,!0),Pn($,[z])},onAppearCancelled(z){P(z,!0,void 0,!0),Pn(R,[z])},onLeaveCancelled(z){Z(z),Pn(F,[z])}})}function lp(e){if(e==null)return null;if(Oe(e))return[Ar(e.enter),Ar(e.leave)];{const t=Ar(e);return[t,t]}}function Ar(e){return hd(e)}function Jt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[ls]||(e[ls]=new Set)).add(t)}function Cn(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[ls];n&&(n.delete(t),n.size||(e[ls]=void 0))}function Di(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let ip=0;function Bi(e,t,n,s){const o=e._endId=++ip,r=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(r,n);const{type:l,timeout:i,propCount:a}=Zc(e,t);if(!l)return s();const c=l+"end";let u=0;const d=()=>{e.removeEventListener(c,h),r()},h=p=>{p.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},i+1),e.addEventListener(c,h)}function Zc(e,t){const n=window.getComputedStyle(e),s=g=>(n[g]||"").split(", "),o=s(`${Sn}Delay`),r=s(`${Sn}Duration`),l=ji(o,r),i=s(`${hs}Delay`),a=s(`${hs}Duration`),c=ji(i,a);let u=null,d=0,h=0;t===Sn?l>0&&(u=Sn,d=l,h=r.length):t===hs?c>0&&(u=hs,d=c,h=a.length):(d=Math.max(l,c),u=d>0?l>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:d,propCount:h,hasTransform:p}}function ji(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>Ui(n)+Ui(e[s])))}function Ui(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function nl(e){return(e?e.ownerDocument:document).body.offsetHeight}function ap(e,t,n){const s=e[ls];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Ao=Symbol("_vod"),Dl=Symbol("_vsh"),Jc={name:"show",beforeMount(e,{value:t},{transition:n}){e[Ao]=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[Ao]:"none",e[Dl]=!t}const Yc=Symbol("");function cp(e){const t=lr();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(r=>Ro(r,o))},s=()=>{const o=e(t.proxy);t.ce?Ro(t.ce,o):sl(t.subTree,o),n(o)};bc(()=>{oc(s)}),Bt(()=>{Le(s,Ut,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),sr(()=>o.disconnect())})}function sl(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{sl(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Ro(e.el,t);else if(e.type===X)e.children.forEach(n=>sl(n,t));else if(e.type===go){let{el:n,anchor:s}=e;for(;n&&(Ro(n,t),n!==s);)n=n.nextSibling}}function Ro(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const r=_d(t[o]);n.setProperty(`--${o}`,r),s+=`--${o}: ${r};`}n[Yc]=s}}const up=/(?:^|;)\s*display\s*:/;function fp(e,t,n){const s=e.style,o=qe(n);let r=!1;if(n&&!o){if(t)if(qe(t))for(const l of t.split(";")){const i=l.slice(0,l.indexOf(":")).trim();n[i]==null&&ks(s,i,"")}else for(const l in t)n[l]==null&&ks(s,l,"");for(const l in n){l==="display"&&(r=!0);const i=n[l];i!=null?hp(e,l,!qe(t)&&t?t[l]:void 0,i)||ks(s,l,i):ks(s,l,"")}}else if(o){if(t!==n){const l=s[Yc];l&&(n+=";"+l),s.cssText=n,r=up.test(n)}}else t&&e.removeAttribute("style");Ao in e&&(e[Ao]=r?s.display:"",e[Dl]&&(s.display="none"))}const Gi=/\s*!important$/;function ks(e,t,n){if(he(n))n.forEach(s=>ks(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=dp(e,t);Gi.test(n)?e.setProperty(Rn(s),n.replace(Gi,""),"important"):e[s]=n}}const Fi=["Webkit","Moz","ms"],Rr={};function dp(e,t){const n=Rr[t];if(n)return n;let s=wt(t);if(s!=="filter"&&s in e)return Rr[t]=s;s=Jo(s);for(let o=0;o<Fi.length;o++){const r=Fi[o]+s;if(r in e)return Rr[t]=r}return t}function hp(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&qe(s)&&n===s}const zi="http://www.w3.org/1999/xlink";function Hi(e,t,n,s,o,r=bd(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(zi,t.slice(6,t.length)):e.setAttributeNS(zi,t,n):n==null||r&&!Ba(n)?e.removeAttribute(t):e.setAttribute(t,r?"":Ft(n)?String(n):n)}function qi(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?qc(n):n);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const i=r==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(i!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let l=!1;if(n===""||n==null){const i=typeof e[t];i==="boolean"?n=Ba(n):n==null&&i==="string"?(n="",l=!0):i==="number"&&(n=0,l=!0)}try{e[t]=n}catch{}l&&e.removeAttribute(o||t)}function On(e,t,n,s){e.addEventListener(t,n,s)}function pp(e,t,n,s){e.removeEventListener(t,n,s)}const Vi=Symbol("_vei");function gp(e,t,n,s,o=null){const r=e[Vi]||(e[Vi]={}),l=r[t];if(s&&l)l.value=s;else{const[i,a]=yp(t);if(s){const c=r[t]=wp(s,o);On(e,i,c,a)}else l&&(pp(e,i,l,a),r[t]=void 0)}}const mp=/(Once|Passive|Capture)$/,vp=/^on:?(?:Once|Passive|Capture)$/;function yp(e){let t,n;for(;(n=e.match(mp))&&!vp.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 Er=0;const bp=Promise.resolve(),kp=()=>Er||(bp.then(()=>Er=0),Er=Date.now());function wp(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(he(o)){const r=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{r.call(s),s._stopped=!0};const l=o.slice(),i=[s];for(let a=0;a<l.length&&!s._stopped;a++){const c=l[a];c&&Dt(c,t,5,i)}}else Dt(o,t,5,[s])};return n.value=e,n.attached=kp(),n}const Wi=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 l=o==="svg";t==="class"?ap(e,s,l):t==="style"?fp(e,n,s):Vo(t)?Wo(t)||gp(e,t,n,s,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Sp(e,t,s,l))?(qi(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Hi(e,t,s,l,r,t!=="value")):e._isVueCE&&(xp(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!qe(s)))?qi(e,wt(t),s,r,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Hi(e,t,s,l))};function Sp(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Wi(t)&&me(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 Wi(t)&&qe(n)?!1:t in e}function xp(e,t){const n=e._def.props;if(!n)return!1;const s=wt(t);return Array.isArray(n)?n.some(o=>wt(o)===s):Object.keys(n).some(o=>wt(o)===s)}const Qc=new WeakMap,Xc=new WeakMap,Eo=Symbol("_moveCb"),Ki=Symbol("_enterCb"),Cp=e=>(delete e.props.mode,e),$p=Cp({name:"TransitionGroup",props:Je({},Wc,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=lr(),s=dc();let o,r;return kc(()=>{if(!o.length)return;const l=e.moveClass||`${e.name||"v"}-move`;if(!Ip(o[0].el,n.vnode.el,l)){o=[];return}o.forEach(Ap),o.forEach(Rp);const i=o.filter(Ep);nl(n.vnode.el),i.forEach(a=>{const c=a.el,u=c.style;Jt(c,l),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[Eo]=h=>{h&&h.target!==c||(!h||h.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[Eo]=null,Cn(c,l))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const l=Ae(e),i=Kc(l);let a=l.tag||X;if(o=[],r)for(let c=0;c<r.length;c++){const u=r[c];u.el&&u.el instanceof Element&&!u.el[Dl]&&(o.push(u),Gn(u,Ps(u,i,s,n)),Qc.set(u,eu(u.el)))}r=t.default?Pl(t.default()):[];for(let c=0;c<r.length;c++){const u=r[c];u.key!=null&&Gn(u,Ps(u,i,s,n))}return K(a,null,r)}}}),Tp=$p;function Ap(e){const t=e.el;t[Eo]&&t[Eo](),t[Ki]&&t[Ki]()}function Rp(e){Xc.set(e,eu(e.el))}function Ep(e){const t=Qc.get(e),n=Xc.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const r=e.el,l=r.style,i=r.getBoundingClientRect();let a=1,c=1;return r.offsetWidth&&(a=i.width/r.offsetWidth),r.offsetHeight&&(c=i.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),l.transform=l.webkitTransform=`translate(${s/a}px,${o/c}px)`,l.transitionDuration="0s",e}}function eu(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function Ip(e,t,n){const s=e.cloneNode(),o=e[ls];o&&o.forEach(i=>{i.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(i=>i&&s.classList.add(i)),s.style.display="none";const r=t.nodeType===1?t:t.parentNode;r.appendChild(s);const{hasTransform:l}=Zc(s);return r.removeChild(s),l}const Io=e=>{const t=e.props["onUpdate:modelValue"]||!1;return he(t)?n=>fo(t,n):t};function Pp(e){e.target.composing=!0}function Zi(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ss=Symbol("_assign");function Ji(e,t,n){return t&&(e=e.trim()),n&&(e=Yo(e)),e}const ct={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[ss]=Io(o);const r=s||o.props&&o.props.type==="number";On(e,t?"change":"input",l=>{l.target.composing||e[ss](Ji(e.value,n,r))}),(n||r)&&On(e,"change",()=>{e.value=Ji(e.value,n,r)}),t||(On(e,"compositionstart",Pp),On(e,"compositionend",Zi),On(e,"change",Zi))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:r}},l){if(e[ss]=Io(l),e.composing)return;const i=(r||e.type==="number")&&!/^0\d/.test(e.value)?Yo(e.value):e.value,a=t??"";if(i===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)}},Yi={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?Yo(Po(r)):Po(r));e[ss](e.multiple?Ko(e._modelValue)?new Set(o):o:o[0]),e._assigning=!0,Lt(()=>{e._assigning=!1})}),e[ss]=Io(s)},mounted(e,{value:t}){Qi(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[ss]=Io(n)},updated(e,{value:t}){e._assigning||Qi(e,t)}};function Qi(e,t){const n=e.multiple,s=he(t);if(!(n&&!s&&!Ko(t))){for(let o=0,r=e.options.length;o<r;o++){const l=e.options[o],i=Po(l);if(n)if(s){const a=typeof i;a==="string"||a==="number"?l.selected=t.some(c=>String(c)===String(i)):l.selected=wd(t,i)>-1}else l.selected=t.has(i);else if(zs(Po(l),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 Mp=["ctrl","shift","alt","meta"],Lp={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)=>Mp.some(n=>e[`${n}Key`]&&!t.includes(n))},Tt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...r)=>{for(let l=0;l<t.length;l++){const i=Lp[t[l]];if(i&&i(o,t))return}return e(o,...r)}))},Np={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Os=(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(l=>l===r||Np[l]===r))return e(o)}))},Op=Je({patchProp:_p},op);let Xi;function Dp(){return Xi||(Xi=Bh(Op))}const Bp=((...e)=>{const t=Dp().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=Up(s);if(!o)return;const r=t._component;!me(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const l=n(o,!1,jp(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),l},t});function jp(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Up(e){return qe(e)?document.querySelector(e):e}function so(e,t,n,s){return e===n&&t===s}function Gp(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 Fp(e){return{objective:e.objective,completionCriterion:e.completionCriterion,replace:e.replace,budgets:e.budgets}}function zp(e){return{objective:e.objective,budgets:e.budgets}}function Hp(e,t,n){return e!==0&&n.epoch!==e?"resync":n.seq<=t?"duplicate":"apply"}function qp(e,t){return t.type==="goal.updated"?{...e,goal:t.snapshot}:t.type==="todo.updated"?{...e,todos:t.todos}:e}function Vp(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}const Ds=N([]);let Wp=0;function Kp(e,t="info",n=3500){const s=`toast_${++Wp}`;Ds.value=[...Ds.value,{id:s,type:t,message:e}],n>0&&window.setTimeout(()=>tu(s),n)}function tu(e){Ds.value=Ds.value.filter(t=>t.id!==e)}function nu(){return{toasts:Ds,showToast:Kp,removeToast:tu}}function Zp(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 Ce="/api/v1",Jp=2*3e4;function Yp(){const{showToast:e}=nu(),t=N("connecting"),n=N([]),s=N(!1),o=N(void 0),r=N([]),l=N({busy:!1}),i=N(null),a=N([]),c=N(!1),u=N(null),d=N(!1),h=N(null),p=N(null),g=N(null),_=Y(()=>l.value.busy||d.value),k=N([]),w=N(null),x=N(!1),$=Y(()=>p.value!==null&&!x.value),A=N(null),F=N([]),Q=N(null),C=N([]),R=N([]),P=N(null),Z=N([]),ie=N(null),z=N([]),ge=N(""),O=N(null),L=N(null),te=N(!1);let ee=null,ve=null,Re=null,le=null,oe=Date.now(),ke=0,xe=0,on=0,We=0,tt=0,qt=0,St=0,_n=0,gt=0,Ue=null,m=!1,S=null,E=!1,G=!1;const D=new Map;let j=0,ne=0,V=null,J=0;const U=new Map;function ce(){const T=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/ws`;return w.value?`${T}?sessionId=${encodeURIComponent(w.value)}`:T}function se(v){t.value=v}function ae(v){(ee==null?void 0:ee.readyState)===WebSocket.OPEN&&ee.send(JSON.stringify(v))}function ue(){c.value=m||Ue!==null}function we(){gt++,Ue=null,m=!1,S=null,c.value=!1,u.value=null}function Ie(v,T){if(v!==null&&typeof v=="object"){const W=v.message;if(typeof W=="string")return W}return T}function Te(){G||le!==null||(le=window.setTimeout(()=>{le=null;const v=S;S=null,Ee(v??void 0)},250))}async function Ee(v){const T=p.value;if(!T)return;const W=n.value.length===0?100:void 0,q=We,de=tt,be=qt,Ge=St;try{const ze=await fetch(`${Ce}/sessions/${T}/snapshot${W?`?tail=${W}`:""}`);if(!ze.ok){v!==void 0&&(Ue==null?void 0:Ue.generation)===v&&(S=v,Te());return}const Rt=await ze.json();if(!Gp({snapshot:Rt,targetSessionId:T,currentSessionId:p.value,targetSessionGeneration:q,currentSessionGeneration:We,targetConnectionGeneration:de,currentConnectionGeneration:tt,targetPromptGeneration:be,currentPromptGeneration:qt,targetLiveGeneration:Ge,currentLiveGeneration:St,currentEpoch:xe,currentSeq:ke})){v!==void 0&&(S=v),Te();return}Ye(Rt,v)}catch{v!==void 0&&(Ue==null?void 0:Ue.generation)===v&&(S=v,Te())}}function Ye(v,T){var di;ot="",Vt="",Wt.clear();const W=n.value.filter(Et=>Et.local),q=D.keys().next().value,de=q?D.get(q):void 0,be=de?n.value.find(Et=>Et.id===de.messageId):void 0,Ge=!!(q&&v.messages.some(Et=>Et.clientMessageId===q)),ze=!!(de&&!Ge&&de.connectionGeneration<tt);ze&&be&&(be.isError=!0);const Rt=be&&!Ge?[be]:[];n.value=[...v.messages.map(Et=>({...Et,id:Et.id??Qe()})),...W,...Rt];for(let Et=n.value.length-1;Et>=0;Et--){const Qs=(di=n.value[Et])==null?void 0:di.turnStats;if(Qs&&typeof Qs.turn=="number"&&Qs.turn>0){j=Qs.turn;break}}r.value=v.pendingApprovals,l.value={...v.status,busy:v.busy},s.value=!!v.olderAvailable,o.value=v.oldestSeq,i.value=v.goal,a.value=v.todos,T!==void 0&&Ue!==null&&Ue.generation===T&>===T&&(Ue=null,ue()),(Ge||ze)&&(d.value=!1,E=!1,D.clear(),ze&&e("消息未送达,已恢复连接。","error")),ke=v.seq,xe=v.epoch,g.value=v.workDir}function Qe(){return`msg_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}function At(v){jt(),oe=Date.now(),ve=window.setInterval(()=>{if(Date.now()-oe>Jp){ee==null||ee.close();return}ae({type:"ping"})},v)}function jt(){ve!==null&&(clearInterval(ve),ve=null)}function Zs(){if(G||Re!==null)return;se("reconnecting"),on++;const v=Math.min(1e3*2**on,3e4);Re=window.setTimeout(()=>{Re=null,Kt()},v)}function mt(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 W=xe;xe=T.epoch,At(T.heartbeat_ms),ae({type:"client_hello",lastSeq:ke,epoch:W}),W!==0&&W!==T.epoch&&(ke=0),se("connected"),on=0,T.active?(Ee(),Wn(),Js()):df(T.sessionId).then(q=>{q&&p.value===T.sessionId&&(x.value=!0),Ee(),Wn(),Js()});break}case"event":{const T=Hp(xe,ke,v);if(T==="resync"){xe=v.epoch,ke=0,Ee();break}if(T==="duplicate")break;ke=v.seq,xe=v.epoch,St++,sf(v.payload);break}case"user_message":{if(St++,v.clientMessageId&&D.has(v.clientMessageId)){E=!0;break}n.value.push({id:Qe(),role:"user",content:v.text,clientMessageId:v.clientMessageId,tools:[],ts:Date.now()});break}case"approval_request":{St++,r.value=[...r.value,{id:v.id,toolName:v.toolName,action:v.action,display:v.display}];break}case"approval_resolved":{St++,r.value=r.value.filter(T=>T.id!==v.id);break}case"command_result":{const T=v.pendingMsgId?n.value.findIndex(W=>W.id===v.pendingMsgId):-1;if(T>=0){const W=n.value[T];n.value[T]={...W,content:v.message,isError:!v.ok,pending:!1}}else n.value.push({id:Qe(),role:"system",content:v.message,tools:[],isError:!v.ok,ts:Date.now(),local:!0});(v.command==="fork"||v.command==="title")&&Wn(),v.ok&&v.command==="compact"&&Ee();break}case"resync_required":{ke=0,Ee();break}case"status":{St++,l.value={...l.value,...v.status};break}case"error":{if(h.value=v.message,v.clientMessageId){const T=D.get(v.clientMessageId);if(T){D.delete(v.clientMessageId),d.value=!1,E=!1;const W=n.value.find(q=>q.id===T.messageId);W&&(W.isError=!0),e(`消息未发送:${v.message}`,"error")}}break}case"server_empty":{se("idle");break}}}let ot="",Vt="";const Wt=new Map;let ri=!1;function nf(){if(ri)return;const v=Vn();if(!v){ot="",Vt="",Wt.clear();return}if(ot&&(v.content+=ot,ot=""),Vt){const T=v.tools.find(W=>W.name==="thinking");T?T.output=(T.output??"")+Vt:v.tools.push({toolCallId:"thinking",name:"thinking",output:Vt}),Vt=""}if(Wt.size>0){for(const[T,W]of Wt){const q=v.tools.find(de=>de.toolCallId===T);q&&(q.output=W)}Wt.clear()}}const qn=Zp(nf);function sf(v){var W;const T=qp({goal:i.value,todos:a.value},v);switch(i.value=T.goal,a.value=T.todos,v.type==="goal.updated"&&Ue!==null&&Ue.generation===gt&&(Ue=null,S=null,ue()),v.type){case"turn.started":{E&&(d.value=!1,E=!1,D.clear()),qn.flushNow(),l.value={...l.value,busy:!0},j+=1,ne=Date.now(),V=null,J=0,U.clear(),n.value.push({id:Qe(),role:"assistant",content:"",tools:[],ts:Date.now(),model:l.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()),ot+=String(v.delta),qn.schedule();break}case"thinking.delta":{V===null&&(V=Date.now()),Vt+=String(v.delta),qn.schedule();break}case"tool.call.started":{const q=Vn();q&&(q.tools.push({toolCallId:String(v.toolCallId),name:String(v.name),args:v.args}),q.turnStats&&(q.turnStats.step+=1)),U.set(String(v.toolCallId),Date.now());break}case"tool.result":{Wt.delete(String(v.toolCallId));const q=U.get(String(v.toolCallId));q!==void 0&&(J+=Date.now()-q,U.delete(String(v.toolCallId)));const de=Vn();if(de){const be=de.tools.find(Ge=>Ge.toolCallId===v.toolCallId);be&&(be.output=String(v.output),be.isError=!!v.isError)}break}case"tool.progress":{Wt.set(String(v.toolCallId),String(v.message??v.output)),qn.schedule();break}case"turn.ended":{if(qn.flushNow(),l.value={...l.value,busy:!1},v.reason==="failed"){const ze=Vn();ze&&(ze.isError=!0),h.value=Ie(v.error,"Turn failed")}const q=Vn(),de=Date.now()-ne,be=(W=l.value.usage)==null?void 0:W.currentTurn,Ge=be?be.inputOther+be.output+be.inputCacheRead+be.inputCacheCreation:null;q&&q.turnStats&&(q.turnStats.status="done",q.turnStats.llmMs=de,q.turnStats.toolMs=J,q.turnStats.firstTokenMs=V!==null?V-ne:null,q.turnStats.tokens=Ge,q.turnStats.tokensPerSec=Ge!==null&&de>0?Math.round(Ge/de*1e3):null),Wn(),Js();break}case"session.meta.updated":{const q={};v.model!==void 0&&(q.model=v.model),v.contextTokens!==void 0&&(q.contextTokens=v.contextTokens),v.maxContextTokens!==void 0&&(q.maxContextTokens=v.maxContextTokens),v.contextUsage!==void 0&&(q.contextUsage=v.contextUsage),l.value={...l.value,...q};break}case"agent.status.updated":{const q={};if(v.model!==void 0&&(q.model=v.model),v.thinkingLevel!==void 0&&(q.thinkingLevel=v.thinkingLevel),v.contextTokens!==void 0&&(q.contextTokens=v.contextTokens),v.maxContextTokens!==void 0&&(q.maxContextTokens=v.maxContextTokens),v.contextUsage!==void 0&&(q.contextUsage=v.contextUsage),v.usage!==void 0){q.usage=v.usage;const de=v.usage;if(de!=null&&de.currentTurn){const be=Vn(),Ge=de.currentTurn.inputOther+de.currentTurn.output+de.currentTurn.inputCacheRead+de.currentTurn.inputCacheCreation;be!=null&&be.turnStats&&be.turnStats.status==="done"&&be.turnStats.tokens===null&&(be.turnStats.tokens=Ge,be.turnStats.tokensPerSec=be.turnStats.llmMs?Math.round(Ge/be.turnStats.llmMs*1e3):null)}}l.value={...l.value,...q};break}case"error":{h.value=Ie(v.error,"Unknown error");break}}}function Vn(){for(let v=n.value.length-1;v>=0;v--)if(n.value[v].role==="assistant")return n.value[v];return null}function of(){if(!G){if(Re!==null&&(clearTimeout(Re),Re=null),ee!==null){try{ee.close()}catch{}ee=null}on=0,Kt()}}async function rf(){var W;const v=p.value,T=o.value;if(!v||T===void 0)return 0;try{const q=await fetch(`${Ce}/sessions/${v}/messages?before=${T}&tail=50`);if(!q.ok)return 0;const de=await q.json();if(de.messages.length===0)return 0;const be=de.messages.map(Ge=>({...Ge,id:Ge.id??Qe()}));return n.value=[...be,...n.value],o.value=((W=be[0])==null?void 0:W.seq)??T,s.value=de.hasMore,be.length}catch{return 0}}function Kt(){if(G||ee&&(ee.readyState===WebSocket.CONNECTING||ee.readyState===WebSocket.OPEN))return;se("connecting"),h.value=null,we(),tt++;const v=new WebSocket(ce());ee=v,v.onclose=T=>{if(ee===v&&(ee=null,jt(),t.value!=="idle")){if(T.code===1008){We++,we(),p.value=null,w.value=null,x.value=!1,i.value=null,a.value=[],se("idle");return}se("disconnected"),Zs()}},v.onerror=()=>{ee===v&&se("reconnecting")},v.onmessage=T=>{if(ee!==v)return;oe=Date.now();let W;try{W=JSON.parse(T.data)}catch{return}mt(W)}}function lf(v){if(!v||_.value)return;if(t.value==="idle"){e("暂无会话,请先新建会话。","warning");return}if(t.value!=="connected"){e("连接已断开,正在尝试重连...","error"),Kt();return}const T=`client_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,W=Qe();D.set(T,{messageId:W,connectionGeneration:tt}),qt++,E=!1,d.value=!0,n.value.push({id:W,role:"user",content:v,clientMessageId:T,tools:[],ts:Date.now()}),ae({type:"prompt",text:v,clientMessageId:T})}function af(){ae({type:"abort"})}function cf(v,T){if(t.value==="idle"){e("暂无会话,请先新建会话。","warning");return}if(t.value!=="connected"){e("连接已断开,命令未发送。","error"),Kt();return}if(_.value&&v!=="btw"){e(`会话忙碌中,无法执行 /${v},请稍后再试。`,"warning");return}const W=["compact","plan","auto","yes","fork","title"];let q=null;W.includes(v)&&(q=Qe(),n.value.push({id:q,role:"system",content:`正在执行 /${v}${T?` ${T}`:""}...`,tools:[],pending:!0,ts:Date.now(),local:!0})),ae({type:"command",command:v,...T?{args:T}:{},...q?{pendingMsgId:q}:{}})}function uf(){n.value=[],r.value=[]}function li(v){n.value.push({id:Qe(),role:"system",content:v,tools:[],ts:Date.now(),local:!0})}function ff(v,T,W,q){if(t.value!=="connected"){e("连接已断开,审批结果未发送。","error"),Kt();return}r.value=r.value.filter(de=>de.id!==v),ae({type:"approval_response",id:v,decision:T,...W?{feedback:W}:{},...q?{scope:q}:{}})}async function Wn(){try{const v=await fetch(`${Ce}/sessions`);if(!v.ok)return;k.value=await v.json()}catch{}}async function df(v){const T=We,W=tt;try{return(await fetch(`${Ce}/sessions/${v}/activate`,{method:"POST"})).ok&&tt===W&&so(p.value,We,v,T)}catch{return!1}}async function Js(){try{const v=await fetch(`${Ce}/git/status`);if(!v.ok)return;const T=await v.json();A.value=T.isRepo?T:null}catch{}}async function ii(){try{const v=await fetch(`${Ce}/models`);if(!v.ok)return;const T=await v.json();F.value=T.models}catch{}}const mr=N({});async function hf(){try{const v=await fetch(`${Ce}/like`);if(!v.ok)return;mr.value=await v.json()}catch{}}async function pf(v){try{return(await fetch(`${Ce}/like`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(v)})).ok?(mr.value=v,!0):!1}catch{return!1}}async function ai(v,T,W){const q=p.value;if(!q)return;const de=We,be=tt,Ge=++_n;try{const ze=await fetch(`${Ce}/sessions/${q}/${v}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)}),Rt=await ze.json();if(p.value!==q||We!==de||tt!==be||_n!==Ge)return;if(!ze.ok){e(Rt.message??`请求失败(HTTP ${ze.status})`,"error");return}Rt.status&&(l.value={...l.value,...Rt.status}),li(W)}catch(ze){if(p.value!==q||We!==de||tt!==be||_n!==Ge)return;e(`请求失败:${ze instanceof Error?ze.message:String(ze)}`,"error")}}async function gf(v){v!==l.value.model&&await ai("model",{model:v},`已切换模型:${v}`)}async function mf(v){v!==l.value.thinkingLevel&&await ai("thinking",{level:v},`思考强度已切换为 ${v}`)}async function Ys(v,T,W,q){const de=p.value;if(!de)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;Ue!==null&&(Ue=null,ue());const be=We,Ge=++gt;m=!0,ue(),u.value=null;try{const ze=await fetch(`${Ce}/sessions/${de}/goal${v}`,{method:T,headers:{"Content-Type":"application/json"},body:JSON.stringify(W)}),Rt=await ze.json().catch(()=>({}));return!so(p.value,We,de,be)||gt!==Ge?null:ze.ok?(q&&(Ue={generation:Ge},S=Ge),Rt):(u.value=typeof Rt.message=="string"?Rt.message:`请求失败(HTTP ${ze.status})`,null)}catch(ze){return so(p.value,We,de,be)&>===Ge&&(u.value=`请求失败:${ze instanceof Error?ze.message:String(ze)}`),null}finally{so(p.value,We,de,be)&>===Ge&&(m=!1,ue())}}async function vf(v){const T=await Ys("/refine","POST",{description:v},!1);return typeof(T==null?void 0:T.objective)=="string"?T.objective:null}async function yf(v){return await Ys("","POST",Fp(v),!0)===null?!1:(Ue!==null&&Ee(Ue.generation),!0)}async function bf(v){return await Ys("","PATCH",zp(v),!0)===null?!1:(Ue!==null&&Ee(Ue.generation),!0)}async function vr(v){return await Ys(v,"POST",{},!0)===null?!1:(Ue!==null&&Ee(Ue.generation),!0)}function kf(){return vr("/pause")}function wf(){return vr("/resume")}function _f(){return vr("/cancel")}async function Sf(){try{const v=await fetch(`${Ce}/sessions`,{method:"POST"});if(!v.ok){e(`新建会话失败(HTTP ${v.status})`,"error");return}const T=await v.json();k.value=[T,...k.value],await yr(T.sessionId)}catch(v){e(`新建会话失败:${v instanceof Error?v.message:String(v)}`,"error")}}async function yr(v){w.value===v&&t.value==="connected"||(w.value=v,p.value=v,We++,we(),ke=0,xe=0,n.value=[],r.value=[],l.value={busy:!1},i.value=null,a.value=[],Q.value=null,C.value=[],R.value=[],P.value=null,Z.value=[],ie.value=null,z.value=[],ge.value="",x.value=!1,d.value=!1,E=!1,D.clear(),Re!==null&&(clearTimeout(Re),Re=null),le!==null&&(clearTimeout(le),le=null),ee&&(ee.onclose=null,ee.close(),ee=null),jt(),Kt())}async function xf(v){try{const T=await fetch(`${Ce}/sessions/${v}`,{method:"DELETE"});if(!T.ok){e(`删除会话失败(HTTP ${T.status})`,"error");return}if(k.value=k.value.filter(W=>W.sessionId!==v),w.value===v){const W=k.value[0];W?await yr(W.sessionId):(We++,we(),p.value=null,w.value=null,x.value=!1,ke=0,xe=0,n.value=[],r.value=[],l.value={busy:!1},i.value=null,a.value=[],Q.value=null,C.value=[],R.value=[],P.value=null,Z.value=[],ie.value=null,z.value=[],ge.value="",d.value=!1,E=!1,D.clear(),ee&&(ee.onclose=null,ee.close(),ee=null),jt(),se("idle"))}}catch(T){e(`删除会话失败:${T instanceof Error?T.message:String(T)}`,"error")}}async function Cf(v){try{const T=await fetch(`${Ce}/sessions/${v}/export`);if(!T.ok){e(`导出会话失败(HTTP ${T.status})`,"error");return}const W=await T.blob(),q=URL.createObjectURL(W),de=document.createElement("a");de.href=q,de.download=`${v}.md`,de.click(),URL.revokeObjectURL(q)}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(`${Ce}/sessions/${v}/status`);if(!T.ok)return;const W=await T.json();l.value={...l.value,...W}}catch{}}async function $f(){const v=p.value;if(v)try{const T=await fetch(`${Ce}/sessions/${v}/usage`);if(!T.ok)return;const W=await T.json();l.value={...l.value,usage:W}}catch{}}async function Tf(){const v=p.value;if(v)try{const T=await fetch(`${Ce}/sessions/${v}/context`);if(!T.ok)return;const W=await T.json();W.tokenCount!==void 0&&(l.value={...l.value,contextTokens:W.tokenCount})}catch{}}async function Af(){const v=p.value;if(v)try{const T=await fetch(`${Ce}/sessions/${v}/plan`);if(!T.ok)return;Q.value=await T.json()}catch{}}async function Rf(){const v=p.value;if(!v)return!1;try{return(await fetch(`${Ce}/sessions/${v}/plan/clear`,{method:"POST"})).ok?(Q.value=null,!0):!1}catch{return!1}}async function it(v,T){const W=p.value;if(!W)return!1;if(t.value!=="connected")return e("连接已断开,操作未发送。","error"),Kt(),!1;try{const q=await fetch(`${Ce}/sessions/${W}/${v}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T??{})});if(!q.ok){const de=await q.json().catch(()=>({}));return e(de.message??`操作失败(HTTP ${q.status})`,"error"),!1}return!0}catch(q){return e(`操作失败:${q instanceof Error?q.message:String(q)}`,"error"),!1}}async function Ef(v){const T=await it("permission",{mode:v});return T&&await us(),T}async function If(v,T){const W=await it("plan",{enabled:v,...T?{strategy:T}:{}});return W&&await us(),W}async function Pf(v){const T=await it("wolfpack",{enabled:v});return T&&await us(),T}async function Mf(v,T){const W=await it("rlm",{enabled:v,...T!==void 0?{maxDepth:T}:{}});return W&&await us(),W}async function Lf(v=1){return it("undo",{count:v})}async function Nf(v){return it("compact",v?{instruction:v}:{})}async function Of(){const v=p.value;if(v)try{const T=await fetch(`${Ce}/sessions/${v}/skills`);if(!T.ok)return;C.value=await T.json()}catch{}}async function Df(v,T){return it(`skills/${encodeURIComponent(v)}/activate`,T?{args:T}:{})}async function Bf(v){const T=p.value;if(!T)return!1;try{return(await fetch(`${Ce}/sessions/${T}/skills/${encodeURIComponent(v)}`,{method:"DELETE"})).ok?(C.value=C.value.filter(q=>q.name!==v),!0):!1}catch{return!1}}async function br(){const v=p.value;if(v)try{const T=await fetch(`${Ce}/sessions/${v}/plugins`);if(!T.ok)return;R.value=await T.json()}catch{}}async function jf(v){const T=p.value;if(T)try{const W=await fetch(`${Ce}/sessions/${T}/plugins/${encodeURIComponent(v)}`);if(!W.ok)return;P.value=await W.json()}catch{}}async function Uf(v){const T=p.value;if(!T)return null;try{const W=await fetch(`${Ce}/sessions/${T}/plugins/install`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:v})});if(!W.ok)return null;const q=await W.json();return await br(),q}catch{return null}}async function Gf(v,T){return it(`plugins/${encodeURIComponent(v)}/enable`,{enabled:T})}async function Ff(v,T,W){return it(`plugins/${encodeURIComponent(v)}/mcp/${encodeURIComponent(T)}/enable`,{enabled:W})}async function zf(v){const T=p.value;if(!T)return!1;try{return(await fetch(`${Ce}/sessions/${T}/plugins/${encodeURIComponent(v)}`,{method:"DELETE"})).ok?(R.value=R.value.filter(q=>q.id!==v),!0):!1}catch{return!1}}async function Hf(){const v=p.value;if(!v)return null;try{const T=await fetch(`${Ce}/sessions/${v}/plugins/reload`,{method:"POST"});if(!T.ok)return null;const W=await T.json();return await br(),W}catch{return null}}async function qf(v){return it(`plugins/${encodeURIComponent(v)}/activate`)}async function Vf(v){return it(`plugins/${encodeURIComponent(v)}/deactivate`)}async function Wf(v){return it(`plugins/${encodeURIComponent(v)}/inject`)}async function Kf(){const v=p.value;if(v)try{const T=await fetch(`${Ce}/sessions/${v}/mcp`);if(!T.ok)return;Z.value=await T.json()}catch{}}async function Zf(){const v=p.value;if(v)try{const T=await fetch(`${Ce}/sessions/${v}/mcp/startup-metrics`);if(!T.ok)return;ie.value=await T.json()}catch{}}async function Jf(v,T){return it("mcp/add",{name:v,config:T})}async function Yf(v){return it(`mcp/${encodeURIComponent(v)}/reconnect`)}async function Qf(v){return it(`mcp/${encodeURIComponent(v)}/stop`)}async function Xf(v){const T=p.value;if(!T)return!1;try{return(await fetch(`${Ce}/sessions/${T}/mcp/${encodeURIComponent(v)}`,{method:"DELETE"})).ok?(Z.value=Z.value.filter(q=>q.name!==v),!0):!1}catch{return!1}}async function ed(v,T){const W=p.value;if(W)try{const q=new URLSearchParams;v!==void 0&&q.set("activeOnly",String(v)),T!==void 0&&q.set("limit",String(T));const de=q.toString(),be=await fetch(`${Ce}/sessions/${W}/tasks${de?`?${de}`:""}`);if(!be.ok)return;z.value=await be.json()}catch{}}async function td(v,T){const W=p.value;if(W)try{const q=T!==void 0?`?tail=${T}`:"",de=await fetch(`${Ce}/sessions/${W}/tasks/${encodeURIComponent(v)}/output${q}`);if(!de.ok)return;const be=await de.json();ge.value=be.output}catch{}}async function nd(v,T){return it(`tasks/${encodeURIComponent(v)}/stop`,T?{reason:T}:{})}async function ci(){try{const v=await fetch(`${Ce}/config`);if(!v.ok)return;O.value=await v.json()}catch{}}async function sd(v){try{const T=await fetch(`${Ce}/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 od(v){try{return(await fetch(`${Ce}/config/providers/${encodeURIComponent(v)}`,{method:"DELETE"})).ok?(await ci(),!0):!1}catch{return!1}}async function rd(){try{const v=await fetch(`${Ce}/experimental-flags`);if(!v.ok)return;L.value=await v.json()}catch{}}async function ld(){try{if(!(await fetch(`${Ce}/preflight`)).ok)return;te.value=!0}catch{}}Kt(),Wn(),ii();const ui=()=>{Kt()},fi=()=>{!document.hidden&&t.value!=="connected"&&Kt()};return window.addEventListener("online",ui),document.addEventListener("visibilitychange",fi),Ht(()=>{G=!0,ri=!0,qn.dispose(),window.removeEventListener("online",ui),document.removeEventListener("visibilitychange",fi),jt(),Re!==null&&(clearTimeout(Re),Re=null),le!==null&&(clearTimeout(le),le=null),ee&&(ee.onclose=null,ee.close(),ee=null)}),{connectionStatus:t,messages:n,pendingApprovals:r,status:l,goal:i,todos:a,goalRequestPending:c,goalRequestError:u,error:h,sessionId:p,workDir:g,isBusy:_,isArchived:$,sessions:k,currentSessionId:w,gitStatus:A,models:F,like:mr,fetchLike:hf,updateLike:pf,sendPrompt:lf,sendCommand:cf,clearMessages:uf,appendSystemMessage:li,abort:af,resolveApproval:ff,fetchSessions:Wn,fetchGitStatus:Js,fetchModels:ii,reconnectNow:of,olderAvailable:s,oldestSeq:o,loadOlderMessages:rf,switchModel:gf,switchThinking:mf,refineGoal:vf,createGoal:yf,updateGoal:bf,pauseGoal:kf,resumeGoal:wf,cancelGoal:_f,createSession:Sf,switchSession:yr,deleteSession:xf,exportSession:Cf,fetchSnapshot:Ee,fetchSessionStatus:us,fetchSessionUsage:$f,fetchSessionContext:Tf,fetchSessionPlan:Af,sessionPlan:Q,clearPlan:Rf,switchPermission:Ef,switchPlanMode:If,switchWolfpack:Pf,switchRlm:Mf,undoHistory:Lf,compact:Nf,skills:C,fetchSkills:Of,activateSkill:Df,removeSkill:Bf,plugins:R,pluginInfo:P,fetchPlugins:br,fetchPluginInfo:jf,installPlugin:Uf,setPluginEnabled:Gf,setPluginMcpServerEnabled:Ff,removePlugin:zf,reloadPlugins:Hf,activatePlugin:qf,deactivatePlugin:Vf,injectPlugin:Wf,mcpServers:Z,mcpStartupMetrics:ie,fetchMcpServers:Kf,fetchMcpStartupMetrics:Zf,addMcpServer:Jf,reconnectMcpServer:Yf,stopMcpServer:Qf,removeMcpServer:Xf,backgroundTasks:z,backgroundTaskOutput:ge,fetchBackgroundTasks:ed,fetchBackgroundTaskOutput:td,stopBackgroundTask:nd,config:O,fetchConfig:ci,setConfig:sd,removeProvider:od,experimentalFlags:L,fetchExperimentalFlags:rd,preflightOk:te,preflight:ld}}const cr=[{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 cr.filter(n=>{var s;return n.name.startsWith(t)||((s=n.aliases)==null?void 0:s.some(o=>o.startsWith(t)))})}function Xp(e){const t=e.toLowerCase(),n=cr.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 su(){return["可用命令:",...cr.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
|
-
`)}const eg=["type","disabled"],tg=_e({__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},[po(t.$slots,"default",{},void 0)],10,eg))}}),Se=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Jn=Se(tg,[["__scopeId","data-v-746fbd2d"]]),ng={key:0,class:"approval-card"},sg={class:"approval-header"},og={class:"approval-title"},rg={class:"tool-name"},lg={class:"action-summary"},ig={key:0,class:"approval-count"},ag={class:"approval-action"},cg={key:0,class:"feedback-area"},ug={class:"approval-buttons"},fg={key:0,class:"busy-indicator","aria-label":"处理中"},dg=_e({__name:"ApprovalCard",props:{approvals:{}},emits:["resolve"],setup(e,{emit:t}){const n=e,s=t,o=N(!1),r=N(!1),l=N(""),i=N(new Set),a=Y(()=>n.approvals[0]);Le(()=>n.approvals.map(g=>g.id).join(","),()=>{r.value=!1,l.value="";const g=new Set(n.approvals.map(_=>_.id));i.value=new Set([...i.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 i.value.has(g)}function d(g,_,k){const w=a.value;!w||u(w.id)||(i.value=new Set([...i.value,w.id]),s("resolve",w.id,g,_,k))}function h(){const g=l.value.trim();g&&d("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(),d("approved",void 0,"once");break;case"2":g.preventDefault(),d("approved",void 0,"session");break;case"3":g.preventDefault(),d("rejected");break;case"4":g.preventDefault(),r.value=!r.value;break}}return Bt(()=>window.addEventListener("keydown",p)),Ht(()=>window.removeEventListener("keydown",p)),(g,_)=>e.approvals.length?(y(),b("div",ng,[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(X,{key:1},[f("div",sg,[_[7]||(_[7]=f("span",{class:"approval-icon"},"⚠",-1)),f("span",og,[f("span",rg,I(a.value.toolName),1),f("span",lg,I(c(a.value)),1)]),e.approvals.length>1?(y(),b("span",ig,"+"+I(e.approvals.length-1),1)):B("",!0),f("button",{class:"icon-btn",title:"最小化","aria-label":"最小化",onClick:_[1]||(_[1]=k=>o.value=!0)},"—")]),f("pre",ag,I(c(a.value)),1),r.value?(y(),b("div",cg,[Ze(f("textarea",{"onUpdate:modelValue":_[2]||(_[2]=k=>l.value=k),class:"feedback-input",rows:"2",name:"approval-feedback","aria-label":"拒绝反馈",placeholder:"输入反馈,Enter 提交(将作为拒绝原因反馈给 Agent)"},null,512),[[ct,l.value]])])):B("",!0),f("div",ug,[K(Jn,{variant:"primary",disabled:u(a.value.id),onClick:_[3]||(_[3]=k=>d("approved",void 0,"once"))},{default:Ct(()=>[..._[8]||(_[8]=[f("kbd",null,"1",-1),$e(" 批准 ",-1)])]),_:1},8,["disabled"]),K(Jn,{variant:"secondary",disabled:u(a.value.id),onClick:_[4]||(_[4]=k=>d("approved",void 0,"session"))},{default:Ct(()=>[..._[9]||(_[9]=[f("kbd",null,"2",-1),$e(" 会话批准 ",-1)])]),_:1},8,["disabled"]),K(Jn,{variant:"danger",disabled:u(a.value.id),onClick:_[5]||(_[5]=k=>d("rejected"))},{default:Ct(()=>[..._[10]||(_[10]=[f("kbd",null,"3",-1),$e(" 拒绝 ",-1)])]),_:1},8,["disabled"]),K(Jn,{variant:"secondary",class:fe({"feedback-active":r.value}),disabled:u(a.value.id),onClick:_[6]||(_[6]=k=>r.value=!r.value)},{default:Ct(()=>[..._[11]||(_[11]=[f("kbd",null,"4",-1),$e(" 反馈 ",-1)])]),_:1},8,["class","disabled"]),u(a.value.id)?(y(),b("span",fg,[..._[12]||(_[12]=[f("span",{class:"spinner"},null,-1),$e(" 处理中… ",-1)])])):B("",!0)])],64)):B("",!0)])):B("",!0)}}),hg=Se(dg,[["__scopeId","data-v-fa5dc764"]]),pg=["title","aria-label"],gg=["width","height","viewBox"],mg=["cx","cy","r"],vg=["cx","cy","r","stroke-dasharray","stroke-dashoffset","transform"],Ir=2,yg=_e({__name:"ContextRing",props:{usage:{default:void 0},size:{default:16}},setup(e){cp(a=>({v1d95ffa8:i.value}));const t=e,n=Y(()=>{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=Y(()=>Math.round(n.value*100)),o=Y(()=>(t.size-Ir)/2),r=Y(()=>2*Math.PI*o.value),l=Y(()=>r.value*(1-n.value)),i=Y(()=>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}`},[f("circle",{class:"ring-track",cx:e.size/2,cy:e.size/2,r:o.value,"stroke-width":Ir,fill:"none"},null,8,mg),f("circle",{class:"ring-value",cx:e.size/2,cy:e.size/2,r:o.value,"stroke-width":Ir,fill:"none","stroke-linecap":"round","stroke-dasharray":r.value,"stroke-dashoffset":l.value,transform:`rotate(-90 ${e.size/2} ${e.size/2})`},null,8,vg)],8,gg))],8,pg))}}),ou=Se(yg,[["__scopeId","data-v-3ffc343b"]]),bg=["onKeydown"],kg={key:0,class:"picker-empty"},wg={class:"picker-group-title"},_g=["onClick"],Sg={class:"row-main"},xg={class:"row-name"},Cg={class:"row-alias"},$g={class:"row-meta"},Tg={key:0,class:"row-check"},Ag={class:"picker-thinking"},Rg={class:"thinking-options"},Eg=["onClick"],Ig=_e({__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:"最大"},l=N(""),i=N(null);Bt(()=>{var C;(C=i.value)==null||C.focus()});const a=Y(()=>{const C=l.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=Y(()=>{const C=new Map;for(const R of a.value){const P=C.get(R.provider)??[];P.push(R),C.set(R.provider,P)}return[...C.entries()].map(([R,P])=>({provider:R,models:P}))}),u=Y(()=>n.models.find(C=>C.alias===n.currentModel)),d=Y(()=>{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")}Bt(()=>document.addEventListener("mousedown",k,!0)),Ht(()=>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 F(C){var Z,ie,z;if(C.key!=="ArrowDown"&&C.key!=="ArrowUp")return;const R=$();if(R.length===0)return;const P=R.indexOf(document.activeElement);C.preventDefault(),P===-1?(Z=R[0])==null||Z.focus():C.key==="ArrowDown"?(ie=R[(P+1)%R.length])==null||ie.focus():(z=R[(P-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]=Os(Tt(P=>s("close"),["stop"]),["esc"]))},[Ze(f("input",{ref_key:"searchRef",ref:i,"onUpdate:modelValue":R[0]||(R[0]=P=>l.value=P),class:"picker-search",type:"text",placeholder:"搜索模型…",id:"model-search-input",name:"model-search",autocomplete:"off",spellcheck:"false",onKeydown:Os(Tt(A,["prevent"]),["arrow-down"])},null,40,bg),[[ct,l.value]]),f("div",{ref_key:"listRef",ref:x,class:"picker-list",onKeydown:F},[c.value.length===0?(y(),b("div",kg,"无匹配模型")):B("",!0),(y(!0),b(X,null,Ve(c.value,P=>(y(),b("div",{key:P.provider,class:"picker-group"},[f("div",wg,I(P.provider),1),(y(!0),b(X,null,Ve(P.models,Z=>(y(),b("button",{key:Z.alias,class:fe(["picker-row",{active:Z.alias===e.currentModel}]),onClick:ie=>w(Z.alias)},[f("span",Sg,[f("span",xg,I(g(Z)),1),f("span",Cg,I(Z.alias),1)]),f("span",$g,I(p(Z.maxContextSize)),1),Z.alias===e.currentModel?(y(),b("span",Tg,"✓")):B("",!0)],10,_g))),128))]))),128))],544),f("div",Ag,[R[2]||(R[2]=f("span",{class:"thinking-label"},"思考强度",-1)),f("div",Rg,[(y(!0),b(X,null,Ve(d.value,P=>(y(),b("button",{key:P,class:fe(["thinking-btn",{active:P===e.currentThinking}]),onClick:Z=>Q(P)},I(h(P)),11,Eg))),128))])])],544))}}),Pg=Se(Ig,[["__scopeId","data-v-438275ef"]]),Mg={class:"slash-menu",role:"listbox","aria-label":"斜杠命令"},Lg=["aria-selected","onMousedown","onMouseenter"],Ng={class:"slash-name"},Og={key:0,class:"slash-aliases"},Dg={class:"slash-desc"},Bg={key:0,class:"slash-badge slash-badge-input"},jg={key:1,class:"slash-badge"},Ug=_e({__name:"SlashMenu",props:{commands:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const n=t;return(s,o)=>(y(),b("div",Mg,[(y(!0),b(X,null,Ve(e.commands,(r,l)=>{var i;return y(),b("button",{key:r.name,class:fe(["slash-item",{active:l===e.activeIndex}]),role:"option","aria-selected":l===e.activeIndex,onMousedown:Tt(a=>n("select",r),["prevent"]),onMouseenter:a=>n("hover",l)},[f("span",Ng,[$e("/"+I(r.name),1),(i=r.aliases)!=null&&i.length?(y(),b("span",Og,I(r.aliases.map(a=>`/${a}`).join(" ")),1)):B("",!0)]),f("span",Dg,I(r.description),1),r.acceptsInput?(y(),b("span",Bg,"输入参数")):B("",!0),r.target==="backend"?(y(),b("span",jg,"服务端")):B("",!0)],42,Lg)}),128)),o[0]||(o[0]=f("div",{class:"slash-hint"},"↑↓ 选择 · Enter/Tab 执行 · Esc 关闭",-1))]))}}),Gg=Se(Ug,[["__scopeId","data-v-6983799d"]]),Fg=["width","height"],zg={key:0,d:"M4 7h16M4 12h16M4 17h16"},Hg={key:1,d:"M12 5v14M5 12h14"},qg={key:5,d:"M4 6h16M7 12h10M10 18h4"},Vg={key:6,d:"M12 3v12m0 0 4-4m-4 4-4-4M5 20h14"},Wg={key:7,d:"M4 7h16M9 7V4h6v3m3 0-1 13H7L6 7m4 4v5m4-5v5"},Kg={key:8,d:"M3 12h4l2-7 4 14 2-7h6"},Zg={key:10,d:"m15 18-6-6 6-6"},Jg={key:11,d:"m9 18 6-6-6-6"},Yg={key:12,d:"m6 9 6 6 6-6"},Qg={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"},Xg={key:18,d:"M5 9a11 11 0 0 1 14 0M8.5 12.5a6 6 0 0 1 7 0M12 17h.01"},em={key:19,d:"M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L8 18l-4 1 1-4Z"},tm={key:20,d:"M12 16V4m0 0-4 4m4-4 4 4M5 20h14"},nm={key:21,d:"m15 4 5 5M17.5 6.5 10 14m-2-2 4 4-3 4H3l1-6Z"},sm={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"},om={key:24,d:"m22 2-7 20-4-9-9-4ZM22 2 11 13"},rm={key:25,x:"6",y:"6",width:"12",height:"12",rx:"2"},lm={key:26,d:"m8 3 4 4 4-4M8 21l4-4 4 4M12 7v10"},im={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"},am={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"},cm={key:31,d:"M20 13 13 20l-9-9V4h7ZM8.5 8.5h.01"},um={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"},fm={key:34,d:"M3 6h7l2 2h9v11H3Z"},dm={key:35,d:"m5 12 4 4L19 6"},hm={key:39,d:"M21 12a9 9 0 1 1-2.6-6.4M21 3v6h-6"},pm={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"},gm={key:47,d:"M12 19V5m0 0-6 6m6-6 6 6"},mm={key:48,d:"M18 6 6 18M6 6l12 12"},vm=_e({__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",zg)):e.name==="plus"?(y(),b("path",Hg)):e.name==="panel-left"?(y(),b(X,{key:2},[n[0]||(n[0]=f("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"},null,-1)),n[1]||(n[1]=f("path",{d:"M9 4v16"},null,-1))],64)):e.name==="panel-right"?(y(),b(X,{key:3},[n[2]||(n[2]=f("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"},null,-1)),n[3]||(n[3]=f("path",{d:"M15 4v16"},null,-1))],64)):e.name==="search"?(y(),b(X,{key:4},[n[4]||(n[4]=f("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[5]||(n[5]=f("path",{d:"m20 20-4-4"},null,-1))],64)):e.name==="filter"?(y(),b("path",qg)):e.name==="download"?(y(),b("path",Vg)):e.name==="trash"?(y(),b("path",Wg)):e.name==="activity"?(y(),b("path",Kg)):e.name==="help"?(y(),b(X,{key:9},[n[6]||(n[6]=f("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[7]||(n[7]=f("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",Zg)):e.name==="chevron-right"?(y(),b("path",Jg)):e.name==="chevron-down"?(y(),b("path",Yg)):e.name==="bot"?(y(),b(X,{key:13},[n[8]||(n[8]=f("rect",{x:"4",y:"7",width:"16",height:"12",rx:"3"},null,-1)),n[9]||(n[9]=f("path",{d:"M12 3v4M8 12h.01M16 12h.01M9 16h6"},null,-1))],64)):e.name==="git-branch"?(y(),b(X,{key:14},[n[10]||(n[10]=f("circle",{cx:"6",cy:"5",r:"2"},null,-1)),n[11]||(n[11]=f("circle",{cx:"18",cy:"7",r:"2"},null,-1)),n[12]||(n[12]=f("circle",{cx:"6",cy:"19",r:"2"},null,-1)),n[13]||(n[13]=f("path",{d:"M6 7v10M8 10c5 0 3-3 8-3"},null,-1))],64)):e.name==="sun"?(y(),b(X,{key:15},[n[14]||(n[14]=f("circle",{cx:"12",cy:"12",r:"4"},null,-1)),n[15]||(n[15]=f("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",Qg)):e.name==="monitor"?(y(),b(X,{key:17},[n[16]||(n[16]=f("rect",{x:"3",y:"4",width:"18",height:"13",rx:"2"},null,-1)),n[17]||(n[17]=f("path",{d:"M8 21h8M12 17v4"},null,-1))],64)):e.name==="wifi"?(y(),b("path",Xg)):e.name==="edit"?(y(),b("path",em)):e.name==="upload"?(y(),b("path",tm)):e.name==="broom"?(y(),b("path",nm)):e.name==="command"?(y(),b("path",sm)):e.name==="at"?(y(),b(X,{key:23},[n[18]||(n[18]=f("circle",{cx:"12",cy:"12",r:"4"},null,-1)),n[19]||(n[19]=f("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",om)):e.name==="stop"?(y(),b("rect",rm)):e.name==="compact"?(y(),b("path",lm)):e.name==="brain"?(y(),b("path",im)):e.name==="clipboard"?(y(),b(X,{key:28},[n[20]||(n[20]=f("rect",{x:"5",y:"4",width:"14",height:"17",rx:"2"},null,-1)),n[21]||(n[21]=f("path",{d:"M9 4V2h6v2M9 10h6M9 14h6"},null,-1))],64)):e.name==="fork"?(y(),b(X,{key:29},[n[22]||(n[22]=f("circle",{cx:"6",cy:"4",r:"2"},null,-1)),n[23]||(n[23]=f("circle",{cx:"18",cy:"6",r:"2"},null,-1)),n[24]||(n[24]=f("circle",{cx:"6",cy:"20",r:"2"},null,-1)),n[25]||(n[25]=f("path",{d:"M6 6v12M8 10c6 0 4-4 8-4"},null,-1))],64)):e.name==="message-circle"?(y(),b("path",am)):e.name==="tag"?(y(),b("path",cm)):e.name==="sparkles"?(y(),b("path",um)):e.name==="terminal"?(y(),b(X,{key:33},[n[26]||(n[26]=f("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"},null,-1)),n[27]||(n[27]=f("path",{d:"m7 9 3 3-3 3m5 0h5"},null,-1))],64)):e.name==="folder"?(y(),b("path",fm)):e.name==="check"?(y(),b("path",dm)):e.name==="speaker"?(y(),b(X,{key:36},[n[28]||(n[28]=f("path",{d:"M11 5 6 9H3v6h3l5 4V5z"},null,-1)),n[29]||(n[29]=f("path",{d:"M15.5 8.5a5 5 0 0 1 0 7"},null,-1)),n[30]||(n[30]=f("path",{d:"M18 6a8.5 8.5 0 0 1 0 12"},null,-1))],64)):e.name==="speaker-off"?(y(),b(X,{key:37},[n[31]||(n[31]=f("path",{d:"M11 5 6 9H3v6h3l5 4V5z"},null,-1)),n[32]||(n[32]=f("path",{d:"m16 9 5 6M21 9l-5 6"},null,-1))],64)):e.name==="copy"?(y(),b(X,{key:38},[n[33]||(n[33]=f("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"},null,-1)),n[34]||(n[34]=f("path",{d:"M16 8V4H4v12h4"},null,-1))],64)):e.name==="refresh"?(y(),b("path",hm)):e.name==="target"?(y(),b(X,{key:40},[n[35]||(n[35]=f("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[36]||(n[36]=f("circle",{cx:"12",cy:"12",r:"5"},null,-1)),n[37]||(n[37]=f("circle",{cx:"12",cy:"12",r:"1"},null,-1))],64)):e.name==="settings"?(y(),b(X,{key:41},[n[38]||(n[38]=f("circle",{cx:"12",cy:"12",r:"3"},null,-1)),n[39]||(n[39]=f("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(X,{key:42},[n[40]||(n[40]=f("path",{d:"M3 10.5 12 3l9 7.5"},null,-1)),n[41]||(n[41]=f("path",{d:"M5 9.5V21h14V9.5"},null,-1))],64)):e.name==="bell"?(y(),b(X,{key:43},[n[42]||(n[42]=f("path",{d:"M6 9a6 6 0 1 1 12 0c0 5 2 6 2 6H4s2-1 2-6"},null,-1)),n[43]||(n[43]=f("path",{d:"M10 19a2 2 0 0 0 4 0"},null,-1))],64)):e.name==="book"?(y(),b(X,{key:44},[n[44]||(n[44]=f("path",{d:"M4 5a2 2 0 0 1 2-2h13v18H6a2 2 0 0 0-2 2Z"},null,-1)),n[45]||(n[45]=f("path",{d:"M6 3v18"},null,-1))],64)):e.name==="layers"?(y(),b(X,{key:45},[n[46]||(n[46]=f("path",{d:"m12 3 9 5-9 5-9-5Z"},null,-1)),n[47]||(n[47]=f("path",{d:"m3 13 9 5 9-5"},null,-1))],64)):e.name==="wrench"?(y(),b("path",pm)):e.name==="arrow-up"?(y(),b("path",gm)):e.name==="x"?(y(),b("path",mm)):e.name==="file"?(y(),b(X,{key:49},[n[48]||(n[48]=f("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]=f("path",{d:"M14 2v6h6"},null,-1))],64)):B("",!0)],8,Fg))}}),ye=Se(vm,[["__scopeId","data-v-86a0768c"]]),ym=["placeholder"],bm={class:"composer-footer"},km={class:"composer-quick-actions"},wm=["title"],_m={key:3,class:"queue-label",title:"运行结束后自动发送"},Sm={class:"composer-actions"},xm=["disabled","title"],Cm={key:1,class:"context-label",title:"上下文使用率"},$m=["disabled"],Tm=_e({__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(""),l=N(null),i=N(0),a=N(!1),c=Y(()=>{const m=r.value;return!m.startsWith("/")||m.includes(`
|
|
19
|
-
`)||/\s/.test(m.slice(1))?null:m.slice(1)}),u=Y(()=>c.value===null?[]:Qp(c.value)),d=Y(()=>c.value!==null&&u.value.length>0&&!a.value);Le(c,()=>{i.value=0,a.value=!1});function h(m){const S=m??u.value[i.value];if(S){if(S.acceptsInput){r.value=`/${S.name} `,a.value=!0,Lt(()=>{var E;(E=l.value)==null||E.focus(),C()});return}$(`/${S.name}`),Z(),o("command",S.name)}}const p=N([]);Le(()=>s.sessionId,()=>{p.value=[]}),Le(()=>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`scream-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=l.value;if(!E)return;const G=E.value.slice(0,E.selectionStart??0),D=E.value.slice(E.selectionEnd??0);if(!(m===-1&&G.includes(`
|
|
20
|
-
`))&&!(m===1&&D.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)}Lt(()=>{E.selectionStart=E.selectionEnd=E.value.length})}}function F(){return`scream-draft:${s.sessionId??"default"}`}let Q;Le(r,()=>{C(),clearTimeout(Q),Q=setTimeout(()=>{try{r.value?localStorage.setItem(F(),r.value):localStorage.removeItem(F())}catch{}},300)}),Le(()=>s.sessionId,()=>{clearTimeout(Q),x();let m="";try{m=localStorage.getItem(F())??""}catch{m=""}r.value=m,Lt(C)},{immediate:!0});function C(){const m=l.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 P(){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&&(Bt(()=>{var m;(m=window.visualViewport)==null||m.addEventListener("resize",P),P()}),Ht(()=>{var m;(m=window.visualViewport)==null||m.removeEventListener("resize",P),R.value=0}));function Z(){r.value="",Lt(()=>{l.value&&(l.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(),G=Xp(E),D=S===-1?"":m.slice(S+1).trim();$(m),o("command",G,D),Z();return}if(s.busy){z();return}$(m),o("send",m),Z()}}function z(){const m=r.value.trim();m&&(p.value=[...p.value,m],Z())}function ge(m){if(d.value){if(m.key==="ArrowUp"){m.preventDefault(),i.value=(i.value-1+u.value.length)%u.value.length;return}if(m.key==="ArrowDown"){m.preventDefault(),i.value=(i.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 L(m){r.value=m,Lt(()=>{var S;C(),(S=l.value)==null||S.focus()})}function te(m){r.value+=m,Lt(()=>{var S;C(),(S=l.value)==null||S.focus()})}t({insertText:L,openModelPicker:tt});const ee=Y(()=>{var m;return(m=s.status)==null?void 0:m.model}),ve=Y(()=>{var m;return(m=s.status)==null?void 0:m.permission}),Re=Y(()=>{var m;return(m=s.status)==null?void 0:m.contextUsage}),le=Y(()=>s.placeholder??(s.busy?"回合进行中:Enter/Ctrl+S 排队消息,随下一轮注入":"输入消息,@ 提及,/ 触发指令")),oe=N(!1),ke={off:"关闭",low:"低",medium:"中",high:"高",xhigh:"超高",max:"最大"},xe=Y(()=>{var m;return(m=s.status)==null?void 0:m.thinkingLevel}),on=Y(()=>{const m=xe.value;return!m||m==="none"?"":ke[m]??m}),We=Y(()=>s.models.length>0);function tt(){return We.value?(oe.value=!0,!0):!1}function qt(){We.value&&(oe.value=!oe.value)}function St(m){o("switch-model",m)}function _n(m){o("switch-thinking",m)}const gt=Y(()=>{switch(ve.value){case"auto":return"perm-auto";case"yolo":return"perm-yolo";default:return"perm-manual"}}),Ue=Y(()=>{switch(ve.value){case"auto":return"自动";case"yolo":return"YOLO";default:return"手动"}});return(m,S)=>(y(),b("div",{class:"composer",style:gn(R.value?{paddingBottom:R.value+"px"}:void 0)},[d.value?(y(),He(Gg,{key:0,commands:u.value,"active-index":i.value,onSelect:h,onHover:S[0]||(S[0]=E=>i.value=E)},null,8,["commands","active-index"])):B("",!0),Ze(f("textarea",{ref_key:"textareaRef",ref:l,"onUpdate:modelValue":S[1]||(S[1]=E=>r.value=E),id:"composer-input",name:"message",class:"composer-input",rows:"1",placeholder:le.value,onKeydown:ge},null,40,ym),[[ct,r.value]]),f("div",bm,[f("div",km,[e.variant==="home"?(y(),b("button",{key:0,class:"quick-action",title:"插入 / 触发指令",onClick:S[2]||(S[2]=E=>te("/"))},[K(ye,{name:"command",size:15}),S[6]||(S[6]=f("span",null,"技能",-1))])):(y(),b(X,{key:1},[f("button",{class:"quick-action",title:"插入 @ 提及",onClick:S[3]||(S[3]=E=>te("@"))},[K(ye,{name:"at",size:15}),S[7]||(S[7]=f("span",null,"提及",-1))]),f("button",{class:"quick-action",title:"插入 / 触发指令",onClick:S[4]||(S[4]=E=>te("/"))},[K(ye,{name:"command",size:15}),S[8]||(S[8]=f("span",null,"指令",-1))])],64)),ve.value?(y(),b("span",{key:2,class:fe(["permission-label",gt.value]),title:`权限模式:${ve.value}`},I(Ue.value),11,wm)):B("",!0),p.value.length?(y(),b("span",_m,"已排队 "+I(p.value.length)+" 条",1)):B("",!0)]),f("div",Sm,[ee.value?(y(),b("button",{key:0,class:fe(["model-select",{clickable:We.value}]),disabled:!We.value,title:e.variant==="home"?`当前模型:${ee.value}`:`当前模型:${ee.value}`,onClick:qt},[K(ye,{name:"brain",size:15}),f("span",null,I(e.variant==="home"?"通用智能体":ee.value),1),e.variant!=="home"&&on.value?(y(),b(X,{key:0},[$e(" · "+I(on.value),1)],64)):B("",!0),We.value?(y(),He(ye,{key:1,name:"chevron-down",size:12})):B("",!0)],10,xm)):B("",!0),K(ar,{name:"picker"},{default:Ct(()=>[oe.value?(y(),He(Pg,{key:0,models:e.models,"current-model":ee.value,"current-thinking":xe.value,onApplyModel:St,onApplyThinking:_n,onClose:S[5]||(S[5]=E=>oe.value=!1)},null,8,["models","current-model","current-thinking"])):B("",!0)]),_:1}),Re.value!==void 0?(y(),b("span",Cm,[K(ou,{usage:Re.value,size:15},null,8,["usage"])])):B("",!0),e.busy?(y(),b("button",{key:2,class:"stop-btn",title:"停止当前回合",onClick:O},[K(ye,{name:"stop",size:14}),S[9]||(S[9]=f("span",null,"停止",-1))])):(y(),b("button",{key:3,class:"send-btn",disabled:!r.value.trim(),title:"发送 (Enter)","aria-label":"发送",onClick:ie},[K(ye,{name:"arrow-up",size:16})],8,$m))])])],4))}}),ru=Se(Tm,[["__scopeId","data-v-655218be"]]),Am={class:"conv-bar"},Rm={class:"conv-bar-left"},Em=["title"],Im=["title"],Pm={key:1,class:"title-text"},Mm={class:"conv-bar-right"},Lm=["title","aria-label"],Nm=_e({__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 l(){r.value=n.title??"",o.value=!0}function i(){const u=r.value.trim();o.value=!1,u&&u!==n.title&&s("rename",u)}function a(u){u.key==="Enter"?(u.preventDefault(),i()):u.key==="Escape"&&(u.preventDefault(),o.value=!1)}const c=Y(()=>n.busy?"运行中":"就绪");return(u,d)=>(y(),b("header",Am,[f("div",Rm,[f("button",{class:"ghost-btn back-btn",title:"返回工作台","aria-label":"返回工作台",onClick:d[0]||(d[0]=h=>s("home"))},[K(ye,{name:"chevron-left",size:20})]),f("span",{class:fe(["status-dot",{busy:e.busy}]),title:c.value,"aria-hidden":"true"},null,10,Em),f("button",{class:"title-btn",title:o.value?"":"点击重命名",onClick:l},[o.value?Ze((y(),b("input",{key:0,"onUpdate:modelValue":d[1]||(d[1]=h=>r.value=h),class:"title-input","aria-label":"会话标题",onKeydown:a,onBlur:i,onClick:d[2]||(d[2]=Tt(()=>{},["stop"]))},null,544)),[[ct,r.value]]):(y(),b("span",Pm,I(e.title||"新会话"),1))],8,Im)]),f("div",Mm,[f("button",{class:"ghost-btn",title:"导出 Markdown","aria-label":"导出 Markdown",onClick:d[3]||(d[3]=h=>s("export"))},[K(ye,{name:"download",size:18})]),f("button",{class:"ghost-btn",title:"清空本地消息","aria-label":"清空本地消息",onClick:d[4]||(d[4]=h=>s("clear"))},[K(ye,{name:"broom",size:18})]),f("button",{class:fe(["ghost-btn",{active:e.drawerOpen}]),title:e.drawerOpen?"收起详情":"会话详情","aria-label":e.drawerOpen?"收起详情":"会话详情",onClick:d[5]||(d[5]=h=>s("toggle-drawer"))},[K(ye,{name:"panel-right",size:18})],10,Lm)])]))}}),Om=Se(Nm,[["__scopeId","data-v-eccc6b36"]]),Dm={key:0,class:"ui-dialog-header"},Bm={class:"ui-dialog-title"},jm={class:"ui-dialog-body"},Um={key:1,class:"ui-dialog-footer"},Gm='a[href], button:not([disabled]), textarea, input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',Fm=_e({__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 l(){const a=o.value;return a?Array.from(a.querySelectorAll(Gm)).filter(c=>c.offsetParent!==null||c===document.activeElement):[]}function i(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=l();if(c.length===0){a.preventDefault(),(p=o.value)==null||p.focus();return}const u=c[0],d=c[c.length-1],h=document.activeElement;a.shiftKey?(h===u||!((g=o.value)!=null&&g.contains(h)))&&(a.preventDefault(),d.focus()):(h===d||!((_=o.value)!=null&&_.contains(h)))&&(a.preventDefault(),u.focus())}return Le(()=>n.open,a=>{a?(r=document.activeElement instanceof HTMLElement?document.activeElement:null,Lt(()=>{const c=l()[0]??o.value;c==null||c.focus()})):r&&(r.focus(),r=null)},{immediate:!1}),Bt(()=>window.addEventListener("keydown",i,!0)),Ht(()=>window.removeEventListener("keydown",i,!0)),(a,c)=>(y(),He(Il,{to:"body"},[K(ar,{name:"dialog"},{default:Ct(()=>[e.open?(y(),b("div",{key:0,class:"ui-dialog-overlay",onClick:c[1]||(c[1]=Tt(u=>e.closable!==!1&&s("close"),["self"]))},[f("div",{ref_key:"dialogRef",ref:o,class:"ui-dialog",style:gn(e.maxWidth?{maxWidth:e.maxWidth}:void 0),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||a.$slots.header?(y(),b("div",Dm,[po(a.$slots,"header",{},()=>[f("span",Bm,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"))},"✕")):B("",!0)])):B("",!0),f("div",jm,[po(a.$slots,"default",{},void 0,!0)]),a.$slots.footer?(y(),b("div",Um,[po(a.$slots,"footer",{},void 0,!0)])):B("",!0)],4)])):B("",!0)]),_:3})]))}}),zm=Se(Fm,[["__scopeId","data-v-396acebf"]]),Hm={class:"info-row"},qm={class:"info-val mono"},Vm={class:"info-row"},Wm={class:"info-val mono"},Km={class:"info-row"},Zm={class:"info-val"},Jm={class:"info-row"},Ym={class:"info-val"},Qm={class:"info-row"},Xm={class:"info-val"},ev={class:"info-row"},tv={class:"info-val"},nv={class:"info-row"},sv={class:"info-val"},ov={class:"info-row"},rv={class:"info-val"},lv={class:"info-row"},iv={class:"info-val"},av={class:"info-row"},cv={class:"info-val"},uv={key:0,class:"info-row"},fv={class:"info-val"},dv={key:1,class:"info-row"},hv={class:"info-val"},pv={class:"info-val mono"},gv={class:"info-val"},mv={key:3,class:"info-empty"},vv=_e({__name:"InfoPanel",props:{mode:{},status:{},sessionId:{},workDir:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,o=Y(()=>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 l(p){return p?"开启":"关闭"}function i(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 d(p){return p!=null&&p.byModel?Object.entries(p.byModel).map(([g,_])=>({model:g,tokens:u(_),output:_.output,cacheRead:_.inputCacheRead})):[]}const h=Y(()=>i(n.status.usage)||i(n.status.contextTokens));return(p,g)=>(y(),He(zm,{open:!0,title:o.value,onClose:g[0]||(g[0]=_=>s("close"))},{default:Ct(()=>{var _,k;return[e.mode==="status"?(y(),b(X,{key:0},[f("div",Hm,[g[1]||(g[1]=f("span",{class:"info-key"},"会话 ID",-1)),f("span",qm,I(e.sessionId??"-"),1)]),f("div",Vm,[g[2]||(g[2]=f("span",{class:"info-key"},"工作目录",-1)),f("span",Wm,I(e.workDir??"-"),1)]),f("div",Km,[g[3]||(g[3]=f("span",{class:"info-key"},"模型",-1)),f("span",Zm,I(e.status.model??"-"),1)]),f("div",Jm,[g[4]||(g[4]=f("span",{class:"info-key"},"权限模式",-1)),f("span",Ym,I(r(e.status.permission)),1)]),f("div",Qm,[g[5]||(g[5]=f("span",{class:"info-key"},"思考级别",-1)),f("span",Xm,I(e.status.thinkingLevel??"-"),1)]),f("div",ev,[g[6]||(g[6]=f("span",{class:"info-key"},"计划模式",-1)),f("span",tv,I(l(e.status.planMode)),1)]),f("div",nv,[g[7]||(g[7]=f("span",{class:"info-key"},"WolfPack 模式",-1)),f("span",sv,I(l(e.status.wolfpackMode)),1)]),f("div",ov,[g[8]||(g[8]=f("span",{class:"info-key"},"上下文",-1)),f("span",rv,I(a(e.status.contextTokens))+" / "+I(a(e.status.maxContextTokens))+" ("+I(c(e.status.contextUsage))+")",1)])],64)):(y(),b(X,{key:1},[f("div",lv,[g[9]||(g[9]=f("span",{class:"info-key"},"上下文 Token",-1)),f("span",iv,I(a(e.status.contextTokens))+" / "+I(a(e.status.maxContextTokens)),1)]),f("div",av,[g[10]||(g[10]=f("span",{class:"info-key"},"上下文占比",-1)),f("span",cv,I(c(e.status.contextUsage)),1)]),(_=e.status.usage)!=null&&_.total?(y(),b("div",uv,[g[11]||(g[11]=f("span",{class:"info-key"},"累计 Token",-1)),f("span",fv,I(a(u(e.status.usage.total))),1)])):B("",!0),(k=e.status.usage)!=null&&k.currentTurn?(y(),b("div",dv,[g[12]||(g[12]=f("span",{class:"info-key"},"当前回合",-1)),f("span",hv,I(a(u(e.status.usage.currentTurn))),1)])):B("",!0),d(e.status.usage).length?(y(),b(X,{key:2},[g[13]||(g[13]=f("div",{class:"info-subhead"},"按模型",-1)),(y(!0),b(X,null,Ve(d(e.status.usage),w=>(y(),b("div",{key:w.model,class:"info-row info-row-model"},[f("span",pv,I(w.model),1),f("span",gv,I(a(w.tokens))+"(输出 "+I(a(w.output))+" · 缓存读 "+I(a(w.cacheRead))+")",1)]))),128))],64)):B("",!0),h.value?B("",!0):(y(),b("div",mv,"暂无用量数据"))],64))]}),_:1},8,["title"]))}}),yv=Se(vv,[["__scopeId","data-v-1555711d"]]);function Bl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var zn=Bl();function lu(e){zn=e}var Ts={exec:()=>null};function De(e,t=""){let n=typeof e=="string"?e:e.source;const s={replace:(o,r)=>{let l=typeof r=="string"?r:r.source;return l=l.replace(kt.caret,"$1"),n=n.replace(o,l),s},getRegex:()=>new RegExp(n,t)};return s}var kt={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")},bv=/^(?:[ \t]*(?:\n|$))+/,kv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,wv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Vs=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,_v=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,jl=/(?:[*+-]|\d{1,9}[.)])/,iu=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,au=De(iu).replace(/bull/g,jl).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(),Sv=De(iu).replace(/bull/g,jl).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(),Ul=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,xv=/^[^\n]+/,Gl=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Cv=De(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Gl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$v=De(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,jl).getRegex(),ur="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",Fl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Tv=De("^ {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",Fl).replace("tag",ur).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),cu=De(Ul).replace("hr",Vs).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",ur).getRegex(),Av=De(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cu).getRegex(),zl={blockquote:Av,code:kv,def:Cv,fences:wv,heading:_v,hr:Vs,html:Tv,lheading:au,list:$v,newline:bv,paragraph:cu,table:Ts,text:xv},ea=De("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Vs).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",ur).getRegex(),Rv={...zl,lheading:Sv,table:ea,paragraph:De(Ul).replace("hr",Vs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ea).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",ur).getRegex()},Ev={...zl,html:De(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Fl).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:Ts,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:De(Ul).replace("hr",Vs).replace("heading",` *#{1,6} *[^
|
|
22
|
-
]`).replace("lheading",au).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Iv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Pv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,uu=/^( {2,}|\\)\n(?!\s*$)/,Mv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,fr=/[\p{P}\p{S}]/u,Hl=/[\s\p{P}\p{S}]/u,fu=/[^\s\p{P}\p{S}]/u,Lv=De(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Hl).getRegex(),du=/(?!~)[\p{P}\p{S}]/u,Nv=/(?!~)[\s\p{P}\p{S}]/u,Ov=/(?:[^\s\p{P}\p{S}]|~)/u,Dv=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,hu=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Bv=De(hu,"u").replace(/punct/g,fr).getRegex(),jv=De(hu,"u").replace(/punct/g,du).getRegex(),pu="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Uv=De(pu,"gu").replace(/notPunctSpace/g,fu).replace(/punctSpace/g,Hl).replace(/punct/g,fr).getRegex(),Gv=De(pu,"gu").replace(/notPunctSpace/g,Ov).replace(/punctSpace/g,Nv).replace(/punct/g,du).getRegex(),Fv=De("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,fu).replace(/punctSpace/g,Hl).replace(/punct/g,fr).getRegex(),zv=De(/\\(punct)/,"gu").replace(/punct/g,fr).getRegex(),Hv=De(/^<(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(),qv=De(Fl).replace("(?:-->|$)","-->").getRegex(),Vv=De("^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",qv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Mo=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Wv=De(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Mo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),gu=De(/^!?\[(label)\]\[(ref)\]/).replace("label",Mo).replace("ref",Gl).getRegex(),mu=De(/^!?\[(ref)\](?:\[\])?/).replace("ref",Gl).getRegex(),Kv=De("reflink|nolink(?!\\()","g").replace("reflink",gu).replace("nolink",mu).getRegex(),ql={_backpedal:Ts,anyPunctuation:zv,autolink:Hv,blockSkip:Dv,br:uu,code:Pv,del:Ts,emStrongLDelim:Bv,emStrongRDelimAst:Uv,emStrongRDelimUnd:Fv,escape:Iv,link:Wv,nolink:mu,punctuation:Lv,reflink:gu,reflinkSearch:Kv,tag:Vv,text:Mv,url:Ts},Zv={...ql,link:De(/^!?\[(label)\]\((.*?)\)/).replace("label",Mo).getRegex(),reflink:De(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Mo).getRegex()},ol={...ql,emStrongRDelimAst:Gv,emStrongLDelim:jv,url:De(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Jv={...ol,br:De(uu).replace("{2,}","*").getRegex(),text:De(ol.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},oo={normal:zl,gfm:Rv,pedantic:Ev},gs={normal:ql,gfm:ol,breaks:Jv,pedantic:Zv},Yv={"&":"&","<":"<",">":">",'"':""","'":"'"},ta=e=>Yv[e];function Yt(e,t){if(t){if(kt.escapeTest.test(e))return e.replace(kt.escapeReplace,ta)}else if(kt.escapeTestNoEncode.test(e))return e.replace(kt.escapeReplaceNoEncode,ta);return e}function na(e){try{e=encodeURI(e).replace(kt.percentDecode,"%")}catch{return null}return e}function sa(e,t){var r;const n=e.replace(kt.findPipe,(l,i,a)=>{let c=!1,u=i;for(;--u>=0&&a[u]==="\\";)c=!c;return c?"|":" |"}),s=n.split(kt.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(kt.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 Qv(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 oa(e,t,n,s,o){const r=t.href,l=t.title||null,i=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:l,text:i,tokens:s.inlineTokens(i)};return s.state.inLink=!1,a}function Xv(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 l=r.match(n.other.beginningSpace);if(l===null)return r;const[i]=l;return i.length>=o.length?r.slice(o.length):r}).join(`
|
|
24
|
-
`)}var Lo=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=Xv(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 l=!1;const i=[];let a;for(a=0;a<n.length;a++)if(this.rules.other.blockquoteStart.test(n[a]))i.push(n[a]),l=!0;else if(!l)i.push(n[a]);else break;n=n.slice(a);const c=i.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 d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,r,!0),this.lexer.state.top=d,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 l=!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 d=t[2].split(`
|
|
38
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,w=>" ".repeat(3*w.length)),h=e.split(`
|
|
39
|
-
`,1)[0],p=!d.trim(),g=0;if(this.options.pedantic?(g=2,u=d.trimStart()):p?g=t[1].length+1:(g=t[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,u=d.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),F=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)||F.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||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||$.test(d)||A.test(d)||x.test(d))break;u+=`
|
|
43
|
-
`+h}!p&&!h.trim()&&(p=!0),c+=Q+`
|
|
44
|
-
`,e=e.substring(Q.length+1),d=C.slice(g)}}o.loose||(l?o.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(l=!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 i=o.items.at(-1);if(i)i.raw=i.raw.trimEnd(),i.text=i.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(d=>d.type==="space"),u=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.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 l;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=sa(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(l=t[3])!=null&&l.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 i of s)this.rules.other.tableAlignRight.test(i)?r.align.push("right"):this.rules.other.tableAlignCenter.test(i)?r.align.push("center"):this.rules.other.tableAlignLeft.test(i)?r.align.push("left"):r.align.push(null);for(let i=0;i<n.length;i++)r.header.push({text:n[i],tokens:this.lexer.inline(n[i]),header:!0,align:r.align[i]});for(const i of o)r.rows.push(sa(i,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=Qv(t[2],"()");if(r===-2)return;if(r>-1){const i=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,i).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)),oa(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 oa(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 l,i,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(l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!l)continue;if(i=[...l].length,s[3]||s[4]){a+=i;continue}else if((s[5]||s[6])&&r%3&&!((r+i)%3)){c+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a+c);const d=[...s[0]][0].length,h=e.slice(0,r+s.index+d+i);if(Math.min(r,i)%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}}}},dn=class rl{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 Lo,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:kt,block:oo.normal,inline:gs.normal};this.options.pedantic?(n.block=oo.pedantic,n.inline=gs.pedantic):this.options.gfm&&(n.block=oo.gfm,this.options.breaks?n.inline=gs.breaks:n.inline=gs.gfm),this.tokenizer.rules=n}static get rules(){return{block:oo,inline:gs}}static lex(t,n){return new rl(n).lex(t)}static lexInline(t,n){return new rl(n).inlineTokens(t)}lex(t){t=t.replace(kt.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,l;for(this.options.pedantic&&(t=t.replace(kt.tabCharGlobal," ").replace(kt.spaceLine,""));t;){let i;if((r=(o=this.options.extensions)==null?void 0:o.block)!=null&&r.some(c=>(i=c.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);const c=n.at(-1);i.raw.length===1&&c!==void 0?c.raw+=`
|
|
48
|
-
`:n.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
49
|
-
`+i.raw,c.text+=`
|
|
50
|
-
`+i.text,this.inlineQueue.at(-1).src=c.text):n.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
51
|
-
`+i.raw,c.text+=`
|
|
52
|
-
`+i.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),n.push(i);continue}let a=t;if((l=this.options.extensions)!=null&&l.startBlock){let c=1/0;const u=t.slice(1);let d;this.options.extensions.startBlock.forEach(h=>{d=h.call({lexer:this},u),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(a=t.substring(0,c+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){const c=n.at(-1);s&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=`
|
|
53
|
-
`+i.raw,c.text+=`
|
|
54
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(i),s=a.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
55
|
-
`+i.raw,c.text+=`
|
|
56
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(i);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 i,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,l="";for(;t;){r||(l=""),r=!1;let u;if((a=(i=this.options.extensions)==null?void 0:i.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,l)){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 d=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&&(d=t.substring(0,h+1))}if(u=this.tokenizer.inlineText(d)){t=t.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(l=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}},No=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(kt.notSpaceStart))==null?void 0:r[0],o=e.replace(kt.endingNewline,"")+`
|
|
57
|
-
`;return s?'<pre><code class="language-'+Yt(s)+'">'+(n?o:Yt(o,!0))+`</code></pre>
|
|
58
|
-
`:"<pre><code>"+(n?o:Yt(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 l=0;l<e.items.length;l++){const i=e.items[l];s+=this.listitem(i)}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+" "+Yt(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 l=0;l<r.length;l++)n+=this.tablecell(r[l]);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>${Yt(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=na(e);if(o===null)return s;e=o;let r='<a href="'+e+'"';return t&&(r+=' title="'+Yt(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=na(e);if(o===null)return Yt(n);e=o;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${Yt(t)}"`),r+=">",r}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Yt(e.text)}},Vl=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""}},hn=class ll{constructor(t){M(this,"options");M(this,"renderer");M(this,"textRenderer");this.options=t||zn,this.options.renderer=this.options.renderer||new No,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Vl}static parse(t,n){return new ll(n).parse(t)}static parseInline(t,n){return new ll(n).parseInline(t)}parse(t,n=!0){var o,r;let s="";for(let l=0;l<t.length;l++){const i=t[l];if((r=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&r[i.type]){const c=i,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=i;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(;l+1<t.length&&t[l+1].type==="text";)c=t[++l],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 l=0;l<t.length;l++){const i=t[l];if((r=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&r[i.type]){const c=this.options.extensions.renderers[i.type].call({parser:this},i);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=c||"";continue}}const a=i;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}},Fr,vo=(Fr=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?dn.lex:dn.lexInline}provideParser(){return this.block?hn.parse:hn.parseInline}},M(Fr,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Fr),ey=class{constructor(...e){M(this,"defaults",Bl());M(this,"options",this.setOptions);M(this,"parse",this.parseMarkdown(!0));M(this,"parseInline",this.parseMarkdown(!1));M(this,"Parser",hn);M(this,"Renderer",No);M(this,"TextRenderer",Vl);M(this,"Lexer",dn);M(this,"Tokenizer",Lo);M(this,"Hooks",vo);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 l=r;for(const i of l.header)n=n.concat(this.walkTokens(i.tokens,t));for(const i of l.rows)for(const a of i)n=n.concat(this.walkTokens(a.tokens,t));break}case"list":{const l=r;n=n.concat(this.walkTokens(l.items,t));break}default:{const l=r;(o=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&o[l.type]?this.defaults.extensions.childTokens[l.type].forEach(i=>{const a=l[i].flat(1/0);n=n.concat(this.walkTokens(a,t))}):l.tokens&&(n=n.concat(this.walkTokens(l.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(...l){let i=o.renderer.apply(this,l);return i===!1&&(i=r.apply(this,l)),i}: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 No(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 l=r,i=n.renderer[l],a=o[l];o[l]=(...c)=>{let u=i.apply(o,c);return u===!1&&(u=a.apply(o,c)),u||""}}s.renderer=o}if(n.tokenizer){const o=this.defaults.tokenizer||new Lo(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 l=r,i=n.tokenizer[l],a=o[l];o[l]=(...c)=>{let u=i.apply(o,c);return u===!1&&(u=a.apply(o,c)),u}}s.tokenizer=o}if(n.hooks){const o=this.defaults.hooks||new vo;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 l=r,i=n.hooks[l],a=o[l];vo.passThroughHooks.has(r)?o[l]=c=>{if(this.defaults.async)return Promise.resolve(i.call(o,c)).then(d=>a.call(o,d));const u=i.call(o,c);return a.call(o,u)}:o[l]=(...c)=>{let u=i.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(l){let i=[];return i.push(r.call(this,l)),o&&(i=i.concat(o.call(this,l))),i}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return dn.lex(e,t??this.defaults)}parser(e,t){return hn.parse(e,t??this.defaults)}parseMarkdown(e){return(n,s)=>{const o={...s},r={...this.defaults,...o},l=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&o.async===!1)return l(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 l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(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 i=r.hooks?r.hooks.provideLexer():e?dn.lex:dn.lexInline,a=r.hooks?r.hooks.provideParser():e?hn.parse:hn.parseInline;if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(c=>i(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(l);try{r.hooks&&(n=r.hooks.preprocess(n));let c=i(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 l(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>"+Yt(n.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}},Fn=new ey;function Ne(e,t){return Fn.parse(e,t)}Ne.options=Ne.setOptions=function(e){return Fn.setOptions(e),Ne.defaults=Fn.defaults,lu(Ne.defaults),Ne};Ne.getDefaults=Bl;Ne.defaults=zn;Ne.use=function(...e){return Fn.use(...e),Ne.defaults=Fn.defaults,lu(Ne.defaults),Ne};Ne.walkTokens=function(e,t){return Fn.walkTokens(e,t)};Ne.parseInline=Fn.parseInline;Ne.Parser=hn;Ne.parser=hn.parse;Ne.Renderer=No;Ne.TextRenderer=Vl;Ne.Lexer=dn;Ne.lexer=dn.lex;Ne.Tokenizer=Lo;Ne.Hooks=vo;Ne.parse=Ne;Ne.options;Ne.setOptions;Ne.use;Ne.walkTokens;Ne.parseInline;hn.parse;dn.lex;const ty="modulepreload",ny=function(e,t){return new URL(e,t).href},ra={},ro=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let l=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const i=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=l(n.map(u=>{if(u=ny(u,s),u in ra)return;ra[u]=!0;const d=u.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(!!s)for(let _=i.length-1;_>=0;_--){const k=i[_];if(k.href===u&&(!d||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${h}`))return;const g=document.createElement("link");if(g.rel=d?"stylesheet":ty,d||(g.as="script"),g.crossOrigin="",g.href=u,c&&g.setAttribute("nonce",c),document.head.appendChild(g),d)return new Promise((_,k)=>{g.addEventListener("load",_),g.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${u}`)))})}))}function r(l){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=l,window.dispatchEvent(i),!i.defaultPrevented)throw l}return o.then(l=>{for(const i of l||[])i.status==="rejected"&&r(i.reason);return t().catch(r)})};let st=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function sy(e){return Wl(e)}function Wl(e){return Array.isArray(e)?oy(e):e instanceof RegExp?e:typeof e=="object"?ry(e):e}function oy(e){let t=[];for(let n=0,s=e.length;n<s;n++)t[n]=Wl(e[n]);return t}function ry(e){let t={};for(let n in e)t[n]=Wl(e[n]);return t}function vu(e,...t){return t.forEach(n=>{for(let s in n)e[s]=n[s]}),e}function yu(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?yu(e.substring(0,e.length-1)):e.substr(~t+1)}var Pr=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,lo=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,l)=>{let i=n[parseInt(o||r,10)];if(i){let a=t.substring(i.start,i.end);for(;a[0]===".";)a=a.substring(1);switch(l){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return s})}};function bu(e,t){return e<t?-1:e>t?1:0}function ku(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=bu(e[o],t[o]);if(r!==0)return r}return 0}return n-s}function la(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 wu(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}},Oo=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(ay(e),t)}static createFromParsedTheme(e,t){return uy(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=>ly(e.parent,o.parentScopes));return s?new Su(s.fontStyle,s.foreground,s.background):null}},Mr=class yo{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const s of n)t=new yo(t,s);return t}static from(...t){let n=null;for(let s=0;s<t.length;s++)n=new yo(n,t[s]);return n}push(t){return new yo(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 ly(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&&!iy(e.scopeName,s);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function iy(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Su=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function ay(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 l=t[o];if(!l.settings)continue;let i;if(typeof l.scope=="string"){let d=l.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),i=d.split(",")}else Array.isArray(l.scope)?i=l.scope:i=[""];let a=-1;if(typeof l.settings.fontStyle=="string"){a=0;let d=l.settings.fontStyle.split(" ");for(let h=0,p=d.length;h<p;h++)switch(d[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 l.settings.foreground=="string"&&la(l.settings.foreground)&&(c=l.settings.foreground);let u=null;typeof l.settings.background=="string"&&la(l.settings.background)&&(u=l.settings.background);for(let d=0,h=i.length;d<h;d++){let g=i[d].trim().split(" "),_=g[g.length-1],k=null;g.length>1&&(k=g.slice(0,g.length-1),k.reverse()),n[s++]=new cy(_,k,o,a,c,u)}}return n}var cy=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}},ht=(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))(ht||{});function uy(e,t){e.sort((a,c)=>{let u=bu(a.scope,c.scope);return u!==0||(u=ku(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 fy(t),l=new Su(n,r.getId(s),r.getId(o)),i=new hy(new il(0,null,-1,0,0),[]);for(let a=0,c=e.length;a<c;a++){let u=e[a];i.insert(0,u.scope,u.parentScopes,u.fontStyle,r.getId(u.foreground),r.getId(u.background))}return new Oo(r,l,i)}var fy=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)}},dy=Object.freeze([]),il=class xu{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||dy,this.fontStyle=s,this.foreground=o,this.background=r}clone(){return new xu(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)}},hy=class al{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(al._cmpBySpecificity),n}insert(t,n,s,o,r,l){if(n===""){this._doInsertHere(t,s,o,r,l);return}let i=n.indexOf("."),a,c;i===-1?(a=n,c=""):(a=n.substring(0,i),c=n.substring(i+1));let u;this._children.hasOwnProperty(a)?u=this._children[a]:(u=new al(this._mainRule.clone(),il.cloneArr(this._rulesWithParentScopes)),this._children[a]=u),u.insert(t+1,c,s,o,r,l)}_doInsertHere(t,n,s,o,r){if(n===null){this._mainRule.acceptOverwrite(t,s,o,r);return}for(let l=0,i=this._rulesWithParentScopes.length;l<i;l++){let a=this._rulesWithParentScopes[l];if(ku(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 il(t,n,s,o,r))}},is=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),l=Pt.getBackground(t);console.log({languageId:n,tokenType:s,fontStyle:o,foreground:r,background:l})}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,l,i){let a=Pt.getLanguageId(t),c=Pt.getTokenType(t),u=Pt.containsBalancedBrackets(t)?1:0,d=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&&(d=r),l!==0&&(h=l),i!==0&&(p=i),(a<<0|c<<8|u<<10|d<<11|h<<15|p<<24)>>>0}};function Do(e,t){const n=[],s=py(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=l();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=i();return o===")"&&(o=s.next()),a}if(ia(o)){const a=[];do a.push(o),o=s.next();while(ia(o));return c=>t(a,c)}return null}function l(){const a=[];let c=r();for(;c;)a.push(c),c=r();return u=>a.every(d=>d(u))}function i(){const a=[];let c=l();for(;c&&(a.push(c),o==="|"||o===",");){do o=s.next();while(o==="|"||o===",");c=l()}return u=>a.some(d=>d(u))}}function ia(e){return!!e&&!!e.match(/[\w\.:]+/)}function py(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 Cu(e){typeof e.dispose=="function"&&e.dispose()}var Bs=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},gy=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},my=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))}},vy=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 Bs(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new my;for(const n of e)yy(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Bs){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 yy(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 Bs?bo({baseGrammar:r,selfGrammar:o},s):cl(e.ruleName,{baseGrammar:r,selfGrammar:o,repository:o.repository},s);const l=n.injections(e.scopeName);if(l)for(const i of l)s.add(new Bs(i))}function cl(e,t,n){if(t.repository&&t.repository[e]){const s=t.repository[e];Bo([s],t,n)}}function bo(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Bo(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Bo(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Bo(e,t,n){for(const s of e){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const o=s.repository?vu({},t.repository,s.repository):t.repository;Array.isArray(s.patterns)&&Bo(s.patterns,{...t,repository:o},n);const r=s.include;if(!r)continue;const l=$u(r);switch(l.kind){case 0:bo({...t,selfGrammar:t.baseGrammar},n);break;case 1:bo(t,n);break;case 2:cl(l.ruleName,{...t,repository:o},n);break;case 3:case 4:const i=l.scopeName===t.selfGrammar.scopeName?t.selfGrammar:l.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(i){const a={baseGrammar:t.baseGrammar,selfGrammar:i,repository:o};l.kind===4?cl(l.ruleName,a,n):bo(a,n)}else l.kind===4?n.add(new gy(l.scopeName,l.ruleName)):n.add(new Bs(l.scopeName));break}}}var by=class{constructor(){M(this,"kind",0)}},ky=class{constructor(){M(this,"kind",1)}},wy=class{constructor(e){M(this,"kind",2);this.ruleName=e}},_y=class{constructor(e){M(this,"kind",3);this.scopeName=e}},Sy=class{constructor(e,t){M(this,"kind",4);this.scopeName=e,this.ruleName=t}};function $u(e){if(e==="$base")return new by;if(e==="$self")return new ky;const t=e.indexOf("#");if(t===-1)return new _y(e);if(t===0)return new wy(e.substring(1));{const n=e.substring(0,t),s=e.substring(t+1);return new Sy(n,s)}}var xy=/\\(\d+)/,aa=/\\(\d+)/g,Cy=-1,Tu=-2;var Ws=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=lo.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=lo.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${yu(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:lo.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:lo.replaceCaptures(this._contentName,e,t)}},$y=class extends Ws{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!")}},Ty=class extends Ws{constructor(t,n,s,o,r){super(t,n,s,null);M(this,"_match");M(this,"captures");M(this,"_cachedCompiledPatterns");this._match=new js(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 Us,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ca=class extends Ws{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 Us,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ul=class extends Ws{constructor(t,n,s,o,r,l,i,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 js(r,this.id),this.beginCaptures=l,this._end=new js(i||"",-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 Us;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}},jo=class extends Ws{constructor(t,n,s,o,r,l,i,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 js(r,this.id),this.beginCaptures=l,this.whileCaptures=a,this._while=new js(i,Tu),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 Us;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 Us,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||""),this._cachedCompiledWhilePatterns}},Au=class at{static createCaptureRule(t,n,s,o,r){return t.registerRule(l=>new $y(n,l,s,o,r))}static getCompiledRuleId(t,n,s){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new Ty(t.$vscodeTextmateLocation,t.id,t.name,t.match,at._compileCaptures(t.captures,n,s));if(typeof t.begin>"u"){t.repository&&(s=vu({},s,t.repository));let r=t.patterns;return typeof r>"u"&&t.include&&(r=[{include:t.include}]),new ca(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,at._compilePatterns(r,n,s))}return t.while?new jo(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,at._compileCaptures(t.beginCaptures||t.captures,n,s),t.while,at._compileCaptures(t.whileCaptures||t.captures,n,s),at._compilePatterns(t.patterns,n,s)):new ul(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,at._compileCaptures(t.beginCaptures||t.captures,n,s),t.end,at._compileCaptures(t.endCaptures||t.captures,n,s),t.applyEndPatternLast,at._compilePatterns(t.patterns,n,s))}),t.id}static _compileCaptures(t,n,s){let o=[];if(t){let r=0;for(const l in t){if(l==="$vscodeTextmateLocation")continue;const i=parseInt(l,10);i>r&&(r=i)}for(let l=0;l<=r;l++)o[l]=null;for(const l in t){if(l==="$vscodeTextmateLocation")continue;const i=parseInt(l,10);let a=0;t[l].patterns&&(a=at.getCompiledRuleId(t[l],n,s)),o[i]=at.createCaptureRule(n,t[l].$vscodeTextmateLocation,t[l].name,t[l].contentName,a)}}return o}static _compilePatterns(t,n,s){let o=[];if(t)for(let r=0,l=t.length;r<l;r++){const i=t[r];let a=-1;if(i.include){const c=$u(i.include);switch(c.kind){case 0:case 1:a=at.getCompiledRuleId(s[i.include],n,s);break;case 2:let u=s[c.ruleName];u&&(a=at.getCompiledRuleId(u,n,s));break;case 3:case 4:const d=c.scopeName,h=c.kind===4?c.ruleName:null,p=n.getExternalGrammar(d,s);if(p)if(h){let g=p.repository[h];g&&(a=at.getCompiledRuleId(g,n,p.repository))}else a=at.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else a=at.getCompiledRuleId(i,n,s);if(a!==-1){const c=n.getRule(a);let u=!1;if((c instanceof ca||c instanceof ul||c instanceof jo)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;o.push(a)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},js=class Ru{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=[],l=!1;for(let i=0;i<s;i++)if(t.charAt(i)==="\\"&&i+1<s){const c=t.charAt(i+1);c==="z"?(r.push(t.substring(o,i)),r.push("$(?!\\n)(?<!\\n)"),o=i+2):(c==="A"||c==="G")&&(l=!0),i++}this.hasAnchor=l,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=xy.test(this.source):this.hasBackReferences=!1}clone(){return new Ru(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 aa.lastIndex=0,this.source.replace(aa,(o,r)=>wu(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,l,i,a;for(r=0,l=this.source.length;r<l;r++)i=this.source.charAt(r),t[r]=i,n[r]=i,s[r]=i,o[r]=i,i==="\\"&&r+1<l&&(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}},Us=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 ua(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 ua(e,s,this._items.map(o=>o.ruleId))}},ua=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}},Lr=class{constructor(e,t){this.languageId=e,this.tokenType=t}},fn,Ay=(fn=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 Lr(n,s)}));this._defaultAttributes=new Lr(t,8),this._embeddedLanguagesMatcher=new Ry(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?fn._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(fn.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(fn,"_NULL_SCOPE_METADATA",new Lr(0,0)),M(fn,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),fn),Ry=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])=>wu(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])}},fa=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Eu(e,t,n,s,o,r,l,i){const a=t.content.length;let c=!1,u=-1;if(l){const p=Ey(e,t,n,s,o,r);o=p.stack,s=p.linePos,n=p.isFirstLine,u=p.anchorPosition}const d=Date.now();for(;!c;){if(i!==0&&Date.now()-d>i)return new fa(o,!0);h()}return new fa(o,!1);function h(){const p=Iy(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(_===Cy){const w=o.getRule(e);r.produce(o,g[0].start),o=o.withContentNameScopesList(o.nameScopesList),ws(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 ul){const F=w;ws(e,t,n,o,r,F.beginCaptures,g),r.produce(o,g[0].end),u=g[0].end;const Q=F.getContentName(t.content,g),C=A.pushAttributed(Q,e);if(o=o.withContentNameScopesList(C),F.endHasBackReferences&&(o=o.withEndRule(F.getEndWithResolvedBackReferences(t.content,g))),!k&&x.hasSameRuleAs(o)){o=o.pop(),r.produce(o,a),c=!0;return}}else if(w instanceof jo){const F=w;ws(e,t,n,o,r,F.beginCaptures,g),r.produce(o,g[0].end),u=g[0].end;const Q=F.getContentName(t.content,g),C=A.pushAttributed(Q,e);if(o=o.withContentNameScopesList(C),F.whileHasBackReferences&&(o=o.withEndRule(F.getWhileWithResolvedBackReferences(t.content,g))),!k&&x.hasSameRuleAs(o)){o=o.pop(),r.produce(o,a),c=!0;return}}else if(ws(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 l=o.beginRuleCapturedEOL?0:-1;const i=[];for(let a=o;a;a=a.pop()){const c=a.getRule(e);c instanceof jo&&i.push({rule:c,stack:a})}for(let a=i.pop();a;a=i.pop()){const{ruleScanner:c,findOptions:u}=Ly(a.rule,e,a.stack.endRule,n,s===l),d=c.findNextMatchSync(t,s,u);if(d){if(d.ruleId!==Tu){o=a.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(r.produce(a.stack,d.captureIndices[0].start),ws(e,t,n,a.stack,r,a.rule.whileCaptures,d.captureIndices),r.produce(a.stack,d.captureIndices[0].end),l=d.captureIndices[0].end,d.captureIndices[0].end>s&&(s=d.captureIndices[0].end,n=!1))}else{o=a.stack.pop();break}}return{stack:o,linePos:s,anchorPosition:l,isFirstLine:n}}function Iy(e,t,n,s,o,r){const l=Py(e,t,n,s,o,r),i=e.getInjections();if(i.length===0)return l;const a=My(i,e,t,n,s,o,r);if(!a)return l;if(!l)return a;const c=l.captureIndices[0].start,u=a.captureIndices[0].start;return u<c||a.priorityMatch&&u===c?a:l}function Py(e,t,n,s,o,r){const l=o.getRule(e),{ruleScanner:i,findOptions:a}=Iu(l,e,o.endRule,n,s===r),c=i.findNextMatchSync(t,s,a);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function My(e,t,n,s,o,r,l){let i=Number.MAX_VALUE,a=null,c,u=0;const d=r.contentNameScopesList.getScopeNames();for(let h=0,p=e.length;h<p;h++){const g=e[h];if(!g.matcher(d))continue;const _=t.getRule(g.ruleId),{ruleScanner:k,findOptions:w}=Iu(_,t,null,s,o===l),x=k.findNextMatchSync(n,o,w);if(!x)continue;const $=x.captureIndices[0].start;if(!($>=i)&&(i=$,a=x.captureIndices,c=x.ruleId,u=g.priority,i===o))break}return a?{priorityMatch:u===-1,captureIndices:a,matchedRuleId:c}:null}function Iu(e,t,n,s,o){return{ruleScanner:e.compileAG(t,n,s,o),findOptions:0}}function Ly(e,t,n,s,o){return{ruleScanner:e.compileWhileAG(t,n,s,o),findOptions:0}}function ws(e,t,n,s,o,r,l){if(r.length===0)return;const i=t.content,a=Math.min(r.length,l.length),c=[],u=l[0].end;for(let d=0;d<a;d++){const h=r[d];if(h===null)continue;const p=l[d];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(i,l),k=s.contentNameScopesList.pushAttributed(_,e),w=h.getContentName(i,l),x=k.pushAttributed(w,e),$=s.push(h.retokenizeCapturedWithRuleId,p.start,-1,!1,null,k,x),A=e.createOnigString(i.substring(0,p.end));Eu(e,A,n&&p.start===0,p.start,$,o,!1,0),Cu(A);continue}const g=h.getName(i,l);if(g!==null){const k=(c.length>0?c[c.length-1].scopes:s.contentNameScopesList).pushAttributed(g,e);c.push(new Ny(k,p.end))}}for(;c.length>0;)o.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var Ny=class{constructor(e,t){M(this,"scopes");M(this,"endPos");this.scopes=e,this.endPos=t}};function Oy(e,t,n,s,o,r,l,i){return new By(e,t,n,s,o,r,l,i)}function da(e,t,n,s,o){const r=Do(t,Uo),l=Au.getCompiledRuleId(n,s,o.repository);for(const i of r)e.push({debugSelector:t,matcher:i.matcher,ruleId:l,grammar:o,priority:i.priority})}function Uo(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(Dy(t[o],s))return n=o+1,!0;return!1})}function Dy(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 By=class{constructor(e,t,n,s,o,r,l,i){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=i,this._basicScopeAttributesProvider=new Ay(n,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=l,this._grammar=ha(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const a of Object.keys(o)){const c=Do(a,Uo);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 l in o)da(t,l,o[l],this,s);const r=this._grammarRepository.injections(n);r&&r.forEach(l=>{const i=this.getExternalGrammar(l);if(i){const a=i.injectionSelector;a&&da(t,a,i,this,i)}})}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]=ha(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=Au.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===fl.NULL){o=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),d=is.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=As.createRootAndLookUpScopeName(h,d,this):p=As.createRoot("unknown",d),t=new fl(null,this._rootId,-1,-1,!1,null,p,p)}else o=!1,t.reset();e=e+`
|
|
78
|
-
`;const r=this.createOnigString(e),l=r.content.length,i=new Uy(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),a=Eu(this,r,o,0,t,i,!0,s);return Cu(r),{lineLength:l,lineTokens:i,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function ha(e,t){return e=sy(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 As=class Qt{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=Mr.push(o,r.scopeNames),s=new Qt(s,o,r.encodedTokenAttributes);return s}static createRoot(t,n){return new Qt(null,new Mr(null,t),n)}static createRootAndLookUpScopeName(t,n,s){const o=s.getMetadataForScope(t),r=new Mr(null,t),l=s.themeProvider.themeMatch(r),i=Qt.mergeAttributes(n,o,l);return new Qt(null,r,i)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Qt.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,l=0;return s!==null&&(o=s.fontStyle,r=s.foregroundId,l=s.backgroundId),is.set(t,n.languageId,n.tokenType,null,o,r,l)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Qt._pushAttributed(this,t,n);const s=t.split(/ /g);let o=this;for(const r of s)o=Qt._pushAttributed(o,r,n);return o}static _pushAttributed(t,n,s){const o=s.getMetadataForScope(n),r=t.scopePath.push(n),l=s.themeProvider.themeMatch(r),i=Qt.mergeAttributes(t.tokenAttributes,o,l);return new Qt(t,r,i)}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}},Nt,fl=(Nt=class{constructor(t,n,s,o,r,l,i,a){M(this,"_stackElementBrand");M(this,"_enterPos");M(this,"_anchorPos");M(this,"depth");this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=r,this.endRule=l,this.nameScopesList=i,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=o}equals(t){return t===null?!1:Nt._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?As.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(){Nt._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,s,o,r,l,i){return new Nt(this,t,n,s,o,r,l,i)}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 Nt(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=As.fromExtension((t==null?void 0:t.nameScopesList)??null,n.nameScopesList);return new Nt(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,s,As.fromExtension(s,n.contentNameScopesList))}},M(Nt,"NULL",new Nt(null,0,0,0,!1,null,null,null)),Nt),jy=class{constructor(e,t){M(this,"balancedBracketScopes");M(this,"unbalancedBracketScopes");M(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Do(n,Uo).map(s=>s.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Do(n,Uo).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 l=(e==null?void 0:e.getScopeNames())??[];for(const i of this._tokenTypeOverrides)i.matcher(l)&&(o=is.set(o,0,i.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(l))}if(r&&(o=is.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}},Gy=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,Oy(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 Gy(Oo.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(Oo.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 jy(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,s,o,r){const l=new vy(this._syncRegistry,t);for(;l.Q.length>0;)l.Q.map(i=>this._loadSingleGrammar(i.scopeName)),l.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)}},dl=fl.NULL;const zy=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Ks{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}Ks.prototype.normal={};Ks.prototype.property={};Ks.prototype.space=void 0;function Pu(e,t){const n={},s={};for(const o of e)Object.assign(n,o.property),Object.assign(s,o.normal);return new Ks(n,s,t)}function hl(e){return e.toLowerCase()}class _t{constructor(t,n){this.attribute=n,this.property=t}}_t.prototype.attribute="";_t.prototype.booleanish=!1;_t.prototype.boolean=!1;_t.prototype.commaOrSpaceSeparated=!1;_t.prototype.commaSeparated=!1;_t.prototype.defined=!1;_t.prototype.mustUseProperty=!1;_t.prototype.number=!1;_t.prototype.overloadedBoolean=!1;_t.prototype.property="";_t.prototype.spaceSeparated=!1;_t.prototype.space=void 0;let Hy=0;const pe=Hn(),Ke=Hn(),pl=Hn(),H=Hn(),Be=Hn(),Un=Hn(),xt=Hn();function Hn(){return 2**++Hy}const gl=Object.freeze(Object.defineProperty({__proto__:null,boolean:pe,booleanish:Ke,commaOrSpaceSeparated:xt,commaSeparated:Un,number:H,overloadedBoolean:pl,spaceSeparated:Be},Symbol.toStringTag,{value:"Module"})),Nr=Object.keys(gl);class Kl extends _t{constructor(t,n,s,o){let r=-1;if(super(t,n),pa(this,"space",o),typeof s=="number")for(;++r<Nr.length;){const l=Nr[r];pa(this,Nr[r],(s&gl[l])===gl[l])}}}Kl.prototype.defined=!0;function pa(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 Kl(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(r.mustUseProperty=!0),t[s]=r,n[hl(s)]=s,n[hl(r.attribute)]=s}return new Ks(t,n,e.space)}const Mu=as({properties:{ariaActiveDescendant:null,ariaAtomic:Ke,ariaAutoComplete:null,ariaBusy:Ke,ariaChecked:Ke,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:Be,ariaCurrent:null,ariaDescribedBy:Be,ariaDetails:null,ariaDisabled:Ke,ariaDropEffect:Be,ariaErrorMessage:null,ariaExpanded:Ke,ariaFlowTo:Be,ariaGrabbed:Ke,ariaHasPopup:null,ariaHidden:Ke,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Be,ariaLevel:H,ariaLive:null,ariaModal:Ke,ariaMultiLine:Ke,ariaMultiSelectable:Ke,ariaOrientation:null,ariaOwns:Be,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:Ke,ariaReadOnly:Ke,ariaRelevant:null,ariaRequired:Ke,ariaRoleDescription:Be,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:Ke,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 Lu(e,t){return t in e?e[t]:t}function Nu(e,t){return Lu(e,t.toLowerCase())}const qy=as({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Un,acceptCharset:Be,accessKey:Be,action:null,allow:null,allowFullScreen:pe,allowPaymentRequest:pe,allowUserMedia:pe,alpha:pe,alt:null,as:null,async:pe,autoCapitalize:null,autoComplete:Be,autoFocus:pe,autoPlay:pe,blocking:Be,capture:null,charSet:null,checked:pe,cite:null,className:Be,closedBy:null,colorSpace:null,cols:H,colSpan:H,command:null,commandFor:null,content:null,contentEditable:Ke,controls:pe,controlsList:Be,coords:H|Un,crossOrigin:null,data:null,dateTime:null,decoding:null,default:pe,defer:pe,dir:null,dirName:null,disabled:pe,download:pl,draggable:Ke,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:pe,formTarget:null,headers:Be,height:H,hidden:pl,high:H,href:null,hrefLang:null,htmlFor:Be,httpEquiv:Be,id:null,imageSizes:null,imageSrcSet:null,inert:pe,inputMode:null,integrity:null,is:null,isMap:pe,itemId:null,itemProp:Be,itemRef:Be,itemScope:pe,itemType:Be,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:pe,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:pe,muted:pe,name:null,nonce:null,noModule:pe,noValidate:pe,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:pe,optimum:H,pattern:null,ping:Be,placeholder:null,playsInline:pe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:pe,referrerPolicy:null,rel:Be,required:pe,reversed:pe,rows:H,rowSpan:H,sandbox:Be,scope:null,scoped:pe,seamless:pe,selected:pe,shadowRootClonable:pe,shadowRootCustomElementRegistry:pe,shadowRootDelegatesFocus:pe,shadowRootMode:null,shadowRootSerializable:pe,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:Ke,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:pe,useMap:null,value:Ke,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Be,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:pe,declare:pe,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:pe,noHref:pe,noShade:pe,noWrap:pe,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:Ke,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:pe,disablePictureInPicture:pe,disableRemotePlayback:pe,exportParts:Un,part:Be,prefix:null,property:null,results:H,security:null,unselectable:null},space:"html",transform:Nu}),Vy=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:xt,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:Be,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:pe,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:xt,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:Be,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xt,rev:xt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xt,requiredFeatures:xt,requiredFonts:xt,requiredFormats:xt,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:xt,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:xt,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:xt,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:Lu}),Ou=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()}}),Du=as({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Nu}),Bu=as({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Wy=/[A-Z]/g,ga=/-[a-z]/g,Ky=/^data[-\w.:]+$/i;function Zy(e,t){const n=hl(t);let s=t,o=_t;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ky.test(t)){if(t.charAt(4)==="-"){const r=t.slice(5).replace(ga,Yy);s="data"+r.charAt(0).toUpperCase()+r.slice(1)}else{const r=t.slice(4);if(!ga.test(r)){let l=r.replace(Wy,Jy);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Kl}return new o(s,t)}function Jy(e){return"-"+e.toLowerCase()}function Yy(e){return e.charAt(1).toUpperCase()}const Qy=Pu([Mu,qy,Ou,Du,Bu],"html"),ju=Pu([Mu,Vy,Ou,Du,Bu],"svg"),ma={}.hasOwnProperty;function Xy(e,t){const n=t||{};function s(o,...r){let l=s.invalid;const i=s.handlers;if(o&&ma.call(o,e)){const a=String(o[e]);l=ma.call(i,a)?i[a]:s.unknown}if(l)return l.call(this,o,...r)}return s.handlers=n.handlers||{},s.invalid=n.invalid,s.unknown=n.unknown,s}const eb=/["&'<>`]/g,tb=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,nb=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,sb=/[|\\{}()[\]^$+*?.]/g,va=new WeakMap;function ob(e,t){if(e=e.replace(t.subset?rb(t.subset):eb,s),t.subset||t.escapeOnly)return e;return e.replace(tb,n).replace(nb,s);function n(o,r,l){return t.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,l.charCodeAt(r+2),t)}function s(o,r,l){return t.format(o.charCodeAt(0),l.charCodeAt(r+1),t)}}function rb(e){let t=va.get(e);return t||(t=lb(e),va.set(e,t)),t}function lb(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(sb,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const ib=/[\dA-Fa-f]/;function ab(e,t,n){const s="&#x"+e.toString(16).toUpperCase();return n&&t&&!ib.test(String.fromCharCode(t))?s:s+";"}const cb=/\d/;function ub(e,t,n){const s="&#"+String(e);return n&&t&&!cb.test(String.fromCharCode(t))?s:s+";"}const fb=["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"],Or={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:"€"},db=["cent","copy","divide","gt","lt","not","para","times"],Uu={}.hasOwnProperty,ml={};let io;for(io in Or)Uu.call(Or,io)&&(ml[Or[io]]=io);const hb=/[^\dA-Za-z]/;function pb(e,t,n,s){const o=String.fromCharCode(e);if(Uu.call(ml,o)){const r=ml[o],l="&"+r;return n&&fb.includes(r)&&!db.includes(r)&&(!s||t&&t!==61&&hb.test(String.fromCharCode(t)))?l:l+";"}return""}function gb(e,t,n){let s=ab(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=pb(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const r=ub(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 ob(e,Object.assign({format:gb},t))}const mb=/^>|^->|<!--|-->|--!>|<!-$/g,vb=[">"],yb=["<",">"];function bb(e,t,n,s){return s.settings.bogusComments?"<?"+os(e.value,Object.assign({},s.settings.characterReferences,{subset:vb}))+">":"<!--"+e.value.replace(mb,o)+"-->";function o(r){return os(r,Object.assign({},s.settings.characterReferences,{subset:yb}))}}function kb(e,t,n,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}function ya(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 wb(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function _b(e){return e.join(" ").trim()}const Sb=/[ \t\n\f\r]/g;function Zl(e){return typeof e=="object"?e.type==="text"?ba(e.value):!1:ba(e)}function ba(e){return e.replace(Sb,"")===""}const et=Fu(1),Gu=Fu(-1),xb=[];function Fu(e){return t;function t(n,s,o){const r=n?n.children:xb;let l=(s||0)+e,i=r[l];if(!o)for(;i&&Zl(i);)l+=e,i=r[l];return i}}const Cb={}.hasOwnProperty;function zu(e){return t;function t(n,s,o){return Cb.call(e,n.tagName)&&e[n.tagName](n,s,o)}}const Jl=zu({body:Tb,caption:Dr,colgroup:Dr,dd:Ib,dt:Eb,head:Dr,html:$b,li:Rb,optgroup:Pb,option:Mb,p:Ab,rp:ka,rt:ka,tbody:Nb,td:wa,tfoot:Ob,th:wa,thead:Lb,tr:Db});function Dr(e,t,n){const s=et(n,t,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&Zl(s.value.charAt(0)))}function $b(e,t,n){const s=et(n,t);return!s||s.type!=="comment"}function Tb(e,t,n){const s=et(n,t);return!s||s.type!=="comment"}function Ab(e,t,n){const s=et(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 Rb(e,t,n){const s=et(n,t);return!s||s.type==="element"&&s.tagName==="li"}function Eb(e,t,n){const s=et(n,t);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function Ib(e,t,n){const s=et(n,t);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function ka(e,t,n){const s=et(n,t);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function Pb(e,t,n){const s=et(n,t);return!s||s.type==="element"&&s.tagName==="optgroup"}function Mb(e,t,n){const s=et(n,t);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function Lb(e,t,n){const s=et(n,t);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function Nb(e,t,n){const s=et(n,t);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function Ob(e,t,n){return!et(n,t)}function Db(e,t,n){const s=et(n,t);return!s||s.type==="element"&&s.tagName==="tr"}function wa(e,t,n){const s=et(n,t);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const Bb=zu({body:Gb,colgroup:Fb,head:Ub,html:jb,tbody:zb});function jb(e){const t=et(e,-1);return!t||t.type!=="comment"}function Ub(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 Gb(e){const t=et(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Zl(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Fb(e,t,n){const s=Gu(n,t),o=et(e,-1,!0);return n&&s&&s.type==="element"&&s.tagName==="colgroup"&&Jl(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function zb(e,t,n){const s=Gu(n,t),o=et(e,-1);return n&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&Jl(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const ao={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 Hb(e,t,n,s){const o=s.schema,r=o.space==="svg"?!1:s.settings.omitOptionalTags;let l=o.space==="svg"?s.settings.closeEmptyElements:s.settings.voids.includes(e.tagName.toLowerCase());const i=[];let a;o.space==="html"&&e.tagName==="svg"&&(s.schema=ju);const c=qb(s,e.properties),u=s.all(o.space==="html"&&e.tagName==="template"?e.content:e);return s.schema=o,u&&(l=!1),(c||!r||!Bb(e,t,n))&&(i.push("<",e.tagName,c?" "+c:""),l&&(o.space==="svg"||s.settings.closeSelfClosing)&&(a=c.charAt(c.length-1),(!s.settings.tightSelfClosing||a==="/"||a&&a!=='"'&&a!=="'")&&i.push(" "),i.push("/")),i.push(">")),i.push(u),!l&&(!r||!Jl(e,t,n))&&i.push("</"+e.tagName+">"),i.join("")}function qb(e,t){const n=[];let s=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const r=Vb(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 Vb(e,t,n){const s=Zy(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,r=e.settings.allowDangerousCharacters?0:1;let l=e.quote,i;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:ao.name[o][r]}));return n===!0||(n=Array.isArray(n)?(s.commaSeparated?wb:_b)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?a:(e.settings.preferUnquoted&&(i=os(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:ao.unquoted[o][r]}))),i!==n&&(e.settings.quoteSmart&&ya(n,l)>ya(n,e.alternative)&&(l=e.alternative),i=l+os(n,Object.assign({},e.settings.characterReferences,{subset:(l==="'"?ao.single:ao.double)[o][r],attribute:!0}))+l),a+(i&&"="+i))}const Wb=["<","&"];function Hu(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:Wb}))}function Kb(e,t,n,s){return s.settings.allowDangerousHtml?e.value:Hu(e,t,n,s)}function Zb(e,t,n,s){return s.all(e)}const Jb=Xy("type",{invalid:Yb,unknown:Qb,handlers:{comment:bb,doctype:kb,element:Hb,raw:Kb,root:Zb,text:Hu}});function Yb(e){throw new Error("Expected node, not `"+e+"`")}function Qb(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const Xb={},e1={},t1=[];function n1(e,t){const n=t||Xb,s=n.quote||'"',o=s==='"'?"'":'"';if(s!=='"'&&s!=="'")throw new Error("Invalid quote `"+s+"`, expected `'` or `\"`");return{one:s1,all:o1,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||zy,characterReferences:n.characterReferences||e1,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?ju:Qy,quote:s,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function s1(e,t,n){return Jb(e,t,n,this)}function o1(e){const t=[],n=e&&e.children||t1;let s=-1;for(;++s<n.length;)t[s]=this.one(n[s],s,e);return t.join("")}function Go(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 r1(e){return Array.isArray(e)?e:[e]}async function qu(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Yl(e){return!e||["plaintext","txt","text","plain"].includes(e)}function l1(e){return e==="ansi"||Yl(e)}function Ql(e){return e==="none"}function i1(e){return Ql(e)}function Vu(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 dr(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 l=0;l<n.length;l+=2){const i=t?n[l]+(n[l+1]||""):n[l];o.push([i,s]),s+=n[l].length,s+=((r=n[l+1])==null?void 0:r.length)||0}return o}function a1(e){const t=dr(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,l=0;for(const i of t){if(r<i.length)break;r-=i.length,l++}return{line:l,character:r}}function s(o,r){let l=0;for(let i=0;i<o;i++)l+=t[i].length;return l+=r,l}return{lines:t,indexToPos:n,posToIndex:s}}const Xl="light-dark()",c1=["color","background-color"];function u1(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 f1(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(l=>o.offset<l&&l<o.offset+o.content.length).map(l=>l-o.offset).sort((l,i)=>l-i);return r.length?u1(o,r):o})):e}function d1(e,t,n,s,o="css-vars"){const r={content:e.content,explanation:e.explanation,offset:e.offset},l=t.map(u=>Fo(e.variants[u])),i=new Set(l.flatMap(u=>Object.keys(u))),a={},c=(u,d)=>{const h=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+t[u]+(d==="color"?"":h)};return l.forEach((u,d)=>{for(const h of i){const p=u[h]||"inherit";if(d===0&&s&&c1.includes(h))if(s===Xl&&l.length>1){const g=t.findIndex(x=>x==="light"),_=t.findIndex(x=>x==="dark");if(g===-1||_===-1)throw new st('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const k=l[g][h]||"inherit",w=l[_][h]||"inherit";a[h]=`light-dark(${k}, ${w})`,o==="css-vars"&&(a[c(d,h)]=p)}else a[h]=p;else o==="css-vars"&&(a[c(d,h)]=p)}}),r.htmlStyle=a,r}function Fo(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&ht.Italic&&(t["font-style"]="italic"),e.fontStyle&ht.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&ht.Underline&&n.push("underline"),e.fontStyle&ht.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function vl(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const Wu=new WeakMap;function hr(e,t){Wu.set(e,t)}function Gs(e){return Wu.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(r1(n).map(s=>[s,dl])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return h1(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function h1(e){const t=[],n=new Set;function s(o){var l;if(n.has(o))return;n.add(o);const r=(l=o==null?void 0:o.nameScopesList)==null?void 0:l.scopeName;r&&t.push(r),o.parent&&s(o.parent)}return s(e),t}function p1(e,t){if(!(e instanceof cs))throw new st("Invalid grammar state");return e.getInternalStack(t)}function g1(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let s=function(l){if(typeof l=="number"){if(l<0||l>n.source.length)throw new st(`Invalid decoration offset: ${l}. Code length: ${n.source.length}`);return{...o.indexToPos(l),offset:l}}else{const i=o.lines[l.line];if(i===void 0)throw new st(`Invalid decoration position ${JSON.stringify(l)}. Lines length: ${o.lines.length}`);let a=l.character;if(a<0&&(a=i.length+a),a<0||a>i.length)throw new st(`Invalid decoration position ${JSON.stringify(l)}. Line ${l.line} length: ${i.length}`);return{...l,character:a,offset:o.posToIndex(l.line,a)}}};const o=a1(n.source),r=(n.options.decorations||[]).map(l=>({...l,start:s(l.start),end:s(l.end)}));m1(r),e.set(n.meta,{decorations:r,converter:o,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){var l;if(!((l=this.options.decorations)!=null&&l.length))return;const o=t(this).decorations.flatMap(i=>[i.start.offset,i.end.offset]);return f1(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(d=>d.type==="element"&&d.tagName==="span");if(o.length!==s.converter.lines.length)throw new st(`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(d,h,p,g){const _=o[d];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+=Ku(_.children[A]),w===-1&&k.length===h&&(w=A+1),x===-1&&k.length===p&&(x=A+1);if(w===-1)throw new st(`Failed to find start index for decoration ${JSON.stringify(g.start)}`);if(x===-1)throw new st(`Failed to find end index for decoration ${JSON.stringify(g.end)}`);const $=_.children.slice(w,x);if(!g.alwaysWrap&&$.length===_.children.length)i(_,g,"line");else if(!g.alwaysWrap&&$.length===1&&$[0].type==="element")i($[0],g,"token");else{const A={type:"element",tagName:"span",properties:{},children:$};i(A,g,"wrapper"),_.children.splice(w,$.length,A)}}function l(d,h){o[d]=i(o[d],h,"line")}function i(d,h,p){var k;const g=h.properties||{},_=h.transform||(w=>w);return d.tagName=h.tagName||"span",d.properties={...d.properties,...g,class:d.properties.class},(k=h.properties)!=null&&k.class&&Vu(d,h.properties.class),d=_(d,p)||d,d}const a=[],c=s.decorations.sort((d,h)=>h.start.offset-d.start.offset||d.end.offset-h.end.offset);for(const d of c){const{start:h,end:p}=d;if(h.line===p.line)r(h.line,h.character,p.character,d);else if(h.line<p.line){r(h.line,h.character,Number.POSITIVE_INFINITY,d);for(let g=h.line+1;g<p.line;g++)a.unshift(()=>l(g,d));r(p.line,0,p.character,d)}}a.forEach(d=>d())}}}function m1(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new st(`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,l=n.start.offset<o.end.offset&&o.end.offset<=n.end.offset,i=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||l||i||a){if(r&&l||i&&a||i&&n.start.offset===n.end.offset||l&&o.start.offset===o.end.offset)continue;throw new st(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function Ku(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Ku).join(""):""}const v1=[g1()];function zo(e){const t=y1(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...v1]}function y1(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"],Br={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function b1(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 _a(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 k1(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)Br[s]&&t.push({type:"setDecoration",value:Br[s]});else if(s<=29){const o=Br[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=_a(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=_a(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 w1(){let e=null,t=null,n=new Set;return{parse(s){const o=[];let r=0;do{const l=b1(s,r),i=l.sequence?s.substring(r,l.startPosition):s.substring(r);if(i.length>0&&o.push({value:i,foreground:e,background:t,decorations:new Set(n)}),l.sequence){const a=k1(l.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=l.position}while(r<s.length);return o}}}var _1={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 S1(e=_1){function t(i){return e[i]}function n(i){return`#${i.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 i=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let u=0;u<6;u++)for(let d=0;d<6;d++)s.push(n([i[c],i[u],i[d]]));let a=8;for(let c=0;c<24;c++,a+=10)s.push(n([a,a,a]));return s}function r(i){return o()[i]}function l(i){switch(i.type){case"named":return t(i.name);case"rgb":return n(i.rgb);case"table":return r(i.index)}}return{value:l}}const x1={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 C1(e,t,n){const s=Go(e,n),o=dr(t),r=Object.fromEntries(Dn.map(a=>{var d;const c=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`,u=(d=e.colors)==null?void 0:d[c];return[a,u||x1[a]]})),l=S1(r),i=w1();return o.map(a=>i.parse(a[0]).map(c=>{let u,d;c.decorations.has("reverse")?(u=c.background?l.value(c.background):e.bg,d=c.foreground?l.value(c.foreground):e.fg):(u=c.foreground?l.value(c.foreground):e.fg,d=c.background?l.value(c.background):void 0),u=Tn(u,s),d=Tn(d,s),c.decorations.has("dim")&&(u=$1(u));let h=ht.None;return c.decorations.has("bold")&&(h|=ht.Bold),c.decorations.has("italic")&&(h|=ht.Italic),c.decorations.has("underline")&&(h|=ht.Underline),c.decorations.has("strikethrough")&&(h|=ht.Strikethrough),{content:c.value,offset:a[1],color:u,bgColor:d,fontStyle:h}}))}function $1(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],l=s[2],i=s[3],a=Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,"0");return`#${o}${o}${r}${r}${l}${l}${a}`}else if(s.length===3){const o=s[0],r=s[1],l=s[2];return`#${o}${o}${r}${r}${l}${l}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function ei(e,t,n={}){const{theme:s=e.getLoadedThemes()[0]}=n,o=e.resolveLangAlias(n.lang||"text");if(Yl(o)||Ql(s))return dr(t).map(a=>[{content:a[0],offset:a[1]}]);const{theme:r,colorMap:l}=e.setTheme(s);if(o==="ansi")return C1(r,t,n);const i=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==i.name)throw new st(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${i.name}"`);if(!n.grammarState.themes.includes(r.name))throw new st(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${r.name}"`)}return A1(t,i,r,l,n)}function T1(...e){if(e.length===2)return Gs(e[1]);const[t,n,s={}]=e,{lang:o="text",theme:r=t.getLoadedThemes()[0]}=s;if(Yl(o)||Ql(r))throw new st("Plain language does not have grammar state");if(o==="ansi")throw new st("ANSI language does not have grammar state");const{theme:l,colorMap:i}=t.setTheme(r),a=t.getLanguage(o);return new cs(ti(n,a,l,i,s).stateStack,a.name,l.name)}function A1(e,t,n,s,o){const r=ti(e,t,n,s,o),l=new cs(r.stateStack,t.name,n.name);return hr(r.tokens,l),r.tokens}function ti(e,t,n,s,o){const r=Go(n,o),{tokenizeMaxLineLength:l=0,tokenizeTimeLimit:i=500}=o,a=dr(e);let c=o.grammarState?p1(o.grammarState,n.name)??dl:o.grammarContextCode!=null?ti(o.grammarContextCode,t,n,s,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:dl,u=[];const d=[];for(let h=0,p=a.length;h<p;h++){const[g,_]=a[h];if(g===""){u=[],d.push([]);continue}if(l>0&&g.length>=l){u=[],d.push([{content:g,offset:_,color:"",fontStyle:0}]);continue}let k,w,x;o.includeExplanation&&(k=t.tokenizeLine(g,c,i),w=k.tokens,x=0);const $=t.tokenizeLine2(g,c,i),A=$.tokens.length/2;for(let F=0;F<A;F++){const Q=$.tokens[2*F],C=F+1<A?$.tokens[2*F+2]:g.length;if(Q===C)continue;const R=$.tokens[2*F+1],P=Tn(s[is.getForeground(R)],r),Z=is.getFontStyle(R),ie={content:g.substring(Q,C),offset:_+Q,color:P,fontStyle:Z};if(o.includeExplanation){const z=[];if(o.includeExplanation!=="scopeName")for(const O of n.settings){let L;switch(typeof O.scope){case"string":L=O.scope.split(/,/).map(te=>te.trim());break;case"object":L=O.scope;break;default:continue}z.push({settings:O,selectors:L.map(te=>te.split(/ /))})}ie.explanation=[];let ge=0;for(;Q+ge<C;){const O=w[x],L=g.substring(O.startIndex,O.endIndex);ge+=L.length,ie.explanation.push({content:L,scopes:o.includeExplanation==="scopeName"?R1(O.scopes):E1(z,O.scopes)}),x+=1}}u.push(ie)}d.push(u),u=[],c=$.ruleStack}return{tokens:d,stateStack:c}}function R1(e){return e.map(t=>({scopeName:t}))}function E1(e,t){const n=[];for(let s=0,o=t.length;s<o;s++){const r=t[s];n[s]={scopeName:r,themeMatches:P1(e,r,t.slice(0,s))}}return n}function Sa(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function I1(e,t,n){if(!Sa(e[e.length-1],t))return!1;let s=e.length-2,o=n.length-1;for(;s>=0&&o>=0;)Sa(e[s],n[o])&&(s-=1),o-=1;return s===-1}function P1(e,t,n){const s=[];for(const{selectors:o,settings:r}of e)for(const l of o)if(I1(l,t,n)){s.push(r);break}return s}function Zu(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=ei(e,t,{...n,theme:a.theme}),u=Gs(c),d=typeof a.theme=="string"?a.theme:a.theme.name;return{tokens:c,state:u,theme:d}}),r=M1(...o.map(a=>a.tokens)),l=r[0].map((a,c)=>a.map((u,d)=>{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][d];h.variants[s[g].color]=x}),h})),i=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 i&&hr(l,i),l}function M1(...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 l=o.map(()=>0),i=o.map(a=>a[0]);for(;i.every(a=>a);){const a=Math.min(...i.map(c=>c.content.length));for(let c=0;c<n;c++){const u=i[c];u.content.length===a?(r[c].push(u),l[c]+=1,i[c]=o[c][l[c]]):(r[c].push({...u,content:u.content.slice(0,a)}),i[c]={...u,content:u.content.slice(a),offset:u.offset+a})}}}return t}function Ho(e,t,n){let s,o,r,l,i,a;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:u="--shiki-",colorsRendering:d="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 st("`themes` option must not be empty");const p=Zu(e,t,n);if(a=Gs(p),c&&Xl!==c&&!h.find(w=>w.color===c))throw new st(`\`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=>d1(x,_,u,c,d))),a&&hr(r,a);const k=h.map(w=>Go(w.theme,n));o=xa(h,g,k,u,c,"fg",d),s=xa(h,g,k,u,c,"bg",d),l=`shiki-themes ${g.map(w=>w.name).join(" ")}`,i=c?void 0:[o,s].join(";")}else if("theme"in n){const c=Go(n.theme,n);r=ei(e,t,n);const u=e.getTheme(n.theme);s=Tn(u.bg,c),o=Tn(u.fg,c),l=u.name,a=Gs(r)}else throw new st("Invalid options, either `theme` or `themes` must be provided");return{tokens:r,fg:o,bg:s,themeName:l,rootStyle:i,grammarState:a}}function xa(e,t,n,s,o,r,l){return e.map((i,a)=>{const c=Tn(t[a][r],n[a])||"inherit",u=`${s+i.color}${r==="bg"?"-bg":""}:${c}`;if(a===0&&o){if(o===Xl&&e.length>1){const d=e.findIndex(_=>_.color==="light"),h=e.findIndex(_=>_.color==="dark");if(d===-1||h===-1)throw new st('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const p=Tn(t[d][r],n[d])||"inherit",g=Tn(t[h][r],n[h])||"inherit";return`light-dark(${p}, ${g});${u}`}return c}return l==="css-vars"?u:null}).filter(i=>!!i).join(";")}function qo(e,t,n,s={meta:{},options:n,codeToHast:(o,r)=>qo(e,o,r),codeToTokens:(o,r)=>Ho(e,o,r)}){var g,_;let o=t;for(const k of zo(n))o=((g=k.preprocess)==null?void 0:g.call(s,o,n))||o;let{tokens:r,fg:l,bg:i,themeName:a,rootStyle:c,grammarState:u}=Ho(e,o,n);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:h=!1}=n;d===!0?r=N1(r):d==="never"&&(r=O1(r)),h&&(r=D1(r));const p={...s,get source(){return o}};for(const k of zo(n))r=((_=k.tokens)==null?void 0:_.call(p,r))||r;return L1(r,{...n,fg:l,bg:i,themeName:a,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},p,u)}function L1(e,t,n,s=Gs(e)){var _,k,w,x;const o=zo(t),r=[],l={type:"root",children:[]},{structure:i="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},d={type:"element",tagName:"code",properties:{},children:r};const h=[],p={...n,structure:i,addClassToHast:Vu,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return l},get pre(){return u},get code(){return d},get lines(){return h}};if(e.forEach(($,A)=>{var C,R;A&&(i==="inline"?l.children.push({type:"element",tagName:"br",properties:{},children:[]}):i==="classic"&&r.push({type:"text",value:`
|
|
87
|
-
`}));let F={type:"element",tagName:"span",properties:{class:"line"},children:[]},Q=0;for(const P of $){let Z={type:"element",tagName:"span",properties:{...P.htmlAttrs},children:[{type:"text",value:P.content}]};const ie=vl(P.htmlStyle||Fo(P));ie&&(Z.properties.style=ie);for(const z of o)Z=((C=z==null?void 0:z.span)==null?void 0:C.call(p,Z,A+1,Q,F,P))||Z;i==="inline"?l.children.push(Z):i==="classic"&&F.children.push(Z),Q+=P.content.length}if(i==="classic"){for(const P of o)F=((R=P==null?void 0:P.line)==null?void 0:R.call(p,F,A+1))||F;h.push(F),r.push(F)}else i==="inline"&&h.push(F)}),i==="classic"){for(const $ of o)d=((_=$==null?void 0:$.code)==null?void 0:_.call(p,d))||d;u.children.push(d);for(const $ of o)u=((k=$==null?void 0:$.pre)==null?void 0:k.call(p,u))||u;l.children.push(u)}else if(i==="inline"){const $=[];let A={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const C of l.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;l.children=[];for(let C=0;C<Q.children.length;C++){C>0&&l.children.push({type:"element",tagName:"br",properties:{},children:[]});const R=Q.children[C];R.type==="element"&&l.children.push(...R.children)}}let g=l;for(const $ of o)g=((x=$==null?void 0:$.root)==null?void 0:x.call(p,g))||g;return s&&hr(g,s),g}function N1(e){return e.map(t=>{const n=[];let s="",o;return t.forEach((r,l)=>{const a=!(r.fontStyle&&(r.fontStyle&ht.Underline||r.fontStyle&ht.Strikethrough));a&&r.content.match(/^\s+$/)&&t[l+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 O1(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,l]=s;if(!o&&!l)return n;const i=[{...n,offset:n.offset+o.length,content:r}];return o&&i.unshift({content:o,offset:n.offset}),l&&i.push({content:l,offset:n.offset+o.length+r.length}),i}))}function D1(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=vl(o.htmlStyle||Fo(o)),l=vl(s.htmlStyle||Fo(s)),i=o.fontStyle&&(o.fontStyle&ht.Underline||o.fontStyle&ht.Strikethrough),a=s.fontStyle&&(s.fontStyle&ht.Underline||s.fontStyle&ht.Strikethrough);!i&&!a&&r===l?o.content+=s.content:n.push({...s})}return n})}const B1=n1;function j1(e,t,n){var r;const s={meta:{},options:n,codeToHast:(l,i)=>qo(e,l,i),codeToTokens:(l,i)=>Ho(e,l,i)};let o=B1(qo(e,t,n,s));for(const l of zo(n))o=((r=l.postprocess)==null?void 0:r.call(s,o,n))||o;return o}const Ca={light:"#333333",dark:"#bbbbbb"},$a={light:"#fffffe",dark:"#1e1e1e"},Ta="__shiki_resolved";function ni(e){var i,a,c,u,d;if(e!=null&&e[Ta])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;(i=h==null?void 0:h.settings)!=null&&i.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"?Ca.light:Ca.dark),n||(n=t.type==="light"?$a.light:$a.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 l(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}`]?l(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=l(h.settings.foreground);t.colorReplacements[x]=h.settings.foreground,_.settings.foreground=x}if(g){const x=l(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"))&&!((d=t.colors[h])!=null&&d.startsWith("#"))){const p=l(t.colors[h]);t.colorReplacements[p]=t.colors[h],t.colors[h]=p}return Object.defineProperty(t,Ta,{enumerable:!1,writable:!1,value:!0}),t}async function Ju(e){return Array.from(new Set((await Promise.all(e.filter(t=>!l1(t)).map(async t=>await qu(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function Yu(e){return(await Promise.all(e.map(async n=>i1(n)?null:ni(await qu(n))))).filter(n=>!!n)}let U1=3;function G1(e,t=3){t>U1||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let Yn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Qu(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 F1 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(l=>this.loadTheme(l)),this.loadLanguages(this._langs)}getTheme(n){return typeof n=="string"?this._resolvedThemes.get(n):this.loadTheme(n)}loadTheme(n){const s=ni(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=Oo.createFromRawTheme(n),this._textmateThemeCache.set(n,s)),this._syncRegistry.setTheme(s)}getGrammar(n){return n=Qu(n,this._alias),this._resolvedGrammars.get(n)}loadLanguage(n){var l,i,a,c;if(this.getGrammar(n.name))return;const s=new Set([...this._langMap.values()].filter(u=>{var d;return(d=u.embeddedLangsLazy)==null?void 0:d.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,(i=(l=this._syncRegistry)==null?void 0:l._injectionGrammars)==null||i.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,l])=>!l);if(o.length){const r=s.filter(([l,i])=>{if(!i)return!1;const a=i.embeddedLanguages||i.embeddedLangs;return a==null?void 0:a.some(c=>o.map(([u])=>u).includes(c))}).filter(l=>!o.includes(l));throw new Yn(`Missing languages ${o.map(([l])=>`\`${l}\``).join(", ")}, required by ${r.map(([l])=>`\`${l}\``).join(", ")}`)}for(const[r,l]of s)this._resolver.addLanguage(l);for(const[r,l]of s)this.loadLanguage(l)}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 z1{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 H1(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(ni),o=new z1(e.engine,n),r=new F1(o,s,n,e.langAlias);let l;function i($){return Qu($,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($);l!==$&&(r.setTheme(A),l=$);const F=r.getColorMap();return{theme:A,colorMap:F}}function d(){return w(),r.getLoadedThemes()}function h(){return w(),r.getLoadedLanguages()}function p(...$){w(),r.loadLanguages($.flat(1))}async function g(...$){return p(await Ju($))}function _(...$){w();for(const A of $.flat(1))r.loadTheme(A)}async function k(...$){return w(),_(await Yu($))}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:d,getLoadedLanguages:h,resolveLangAlias:i,loadLanguage:g,loadLanguageSync:p,loadTheme:k,loadThemeSync:_,dispose:x,[Symbol.dispose]:x}}async function q1(e){e.engine||G1("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,s]=await Promise.all([Yu(e.themes||[]),Ju(e.langs||[]),e.engine]);return H1({...e,themes:t,langs:n,engine:s})}async function V1(e){const t=await q1(e);return{getLastGrammarState:(...n)=>T1(t,...n),codeToTokensBase:(n,s)=>ei(t,n,s),codeToTokensWithThemes:(n,s)=>Zu(t,n,s),codeToTokens:(n,s)=>Ho(t,n,s),codeToHast:(n,s)=>qo(t,n,s),codeToHtml:(n,s)=>j1(t,n,s),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}class si extends Error{constructor(t){super(t),this.name="ShikiError"}}function W1(){return 2147483648}function K1(){return typeof performance<"u"?performance.now():Date.now()}const Z1=(e,t)=>e+(t-e%t)%t;async function J1(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 l(p){try{return t.grow(p-n.byteLength+65535>>>16),o(t.buffer),1}catch{}}function i(p){const g=s.HEAPU8.length;p=p>>>0;const _=W1();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(_,Z1(Math.max(p,w),65536));if(l(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 F=p[g++]&63;if(($&240)===224?$=($&15)<<12|A<<6|F:$=($&7)<<18|A<<12|F<<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 d={emscripten_get_now:K1,emscripten_memcpy_big:r,emscripten_resize_heap:i,fd_write:()=>0};async function h(){const g=await e({env:d,wasi_snapshot_preview1:d});t=g.memory,o(t.buffer),Object.assign(s,g),s.UTF8ToString=u}return await h(),s}var Y1=Object.defineProperty,Q1=(e,t,n)=>t in e?Y1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xe=(e,t,n)=>Q1(e,typeof t!="symbol"?t+"":t,n);let nt=null;function X1(e){throw new si(e.UTF8ToString(e.getLastOnigError()))}class pr{constructor(t){Xe(this,"utf16Length"),Xe(this,"utf8Length"),Xe(this,"utf16Value"),Xe(this,"utf8Value"),Xe(this,"utf16OffsetToUtf8"),Xe(this,"utf8OffsetToUtf16");const n=t.length,s=pr._utf8ByteLength(t),o=s!==n,r=o?new Uint32Array(n+1):null;o&&(r[n]=s);const l=o?new Uint32Array(s+1):null;o&&(l[s]=n);const i=new Uint8Array(s);let a=0;for(let c=0;c<n;c++){const u=t.charCodeAt(c);let d=u,h=!1;if(u>=55296&&u<=56319&&c+1<n){const p=t.charCodeAt(c+1);p>=56320&&p<=57343&&(d=(u-55296<<10)+65536|p-56320,h=!0)}o&&(r[c]=a,h&&(r[c+1]=a),d<=127?l[a+0]=c:d<=2047?(l[a+0]=c,l[a+1]=c):d<=65535?(l[a+0]=c,l[a+1]=c,l[a+2]=c):(l[a+0]=c,l[a+1]=c,l[a+2]=c,l[a+3]=c)),d<=127?i[a++]=d:d<=2047?(i[a++]=192|(d&1984)>>>6,i[a++]=128|(d&63)>>>0):d<=65535?(i[a++]=224|(d&61440)>>>12,i[a++]=128|(d&4032)>>>6,i[a++]=128|(d&63)>>>0):(i[a++]=240|(d&1835008)>>>18,i[a++]=128|(d&258048)>>>12,i[a++]=128|(d&4032)>>>6,i[a++]=128|(d&63)>>>0),h&&c++}this.utf16Length=n,this.utf8Length=s,this.utf16Value=t,this.utf8Value=i,this.utf16OffsetToUtf8=r,this.utf8OffsetToUtf16=l}static _utf8ByteLength(t){let n=0;for(let s=0,o=t.length;s<o;s++){const r=t.charCodeAt(s);let l=r,i=!1;if(r>=55296&&r<=56319&&s+1<o){const a=t.charCodeAt(s+1);a>=56320&&a<=57343&&(l=(r-55296<<10)+65536|a-56320,i=!0)}l<=127?n+=1:l<=2047?n+=2:l<=65535?n+=3:n+=4,i&&s++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const gr=class Xt{constructor(t){if(Xe(this,"id",++Xt.LAST_ID),Xe(this,"_onigBinding"),Xe(this,"content"),Xe(this,"utf16Length"),Xe(this,"utf8Length"),Xe(this,"utf16OffsetToUtf8"),Xe(this,"utf8OffsetToUtf16"),Xe(this,"ptr"),!nt)throw new si("Must invoke loadWasm first.");this._onigBinding=nt,this.content=t;const n=new pr(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Xt._sharedPtrInUse?(Xt._sharedPtr||(Xt._sharedPtr=nt.omalloc(1e4)),Xt._sharedPtrInUse=!0,nt.HEAPU8.set(n.utf8Value,Xt._sharedPtr),this.ptr=Xt._sharedPtr):this.ptr=n.createString(nt)}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===Xt._sharedPtr?Xt._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Xe(gr,"LAST_ID",0);Xe(gr,"_sharedPtr",0);Xe(gr,"_sharedPtrInUse",!1);let Xu=gr;class ek{constructor(t){if(Xe(this,"_onigBinding"),Xe(this,"_ptr"),!nt)throw new si("Must invoke loadWasm first.");const n=[],s=[];for(let i=0,a=t.length;i<a;i++){const c=new pr(t[i]);n[i]=c.createString(nt),s[i]=c.utf8Length}const o=nt.omalloc(4*t.length);nt.HEAPU32.set(n,o/4);const r=nt.omalloc(4*t.length);nt.HEAPU32.set(s,r/4);const l=nt.createOnigScanner(o,r,t.length);for(let i=0,a=t.length;i<a;i++)nt.ofree(n[i]);nt.ofree(r),nt.ofree(o),l===0&&X1(nt),this._onigBinding=nt,this._ptr=l}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,s){let o=0;if(typeof s=="number"&&(o=s),typeof t=="string"){t=new Xu(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,l=r.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),o);if(l===0)return null;const i=r.HEAPU32;let a=l/4;const c=i[a++],u=i[a++],d=[];for(let h=0;h<u;h++){const p=t.convertUtf8OffsetToUtf16(i[a++]),g=t.convertUtf8OffsetToUtf16(i[a++]);d[h]={start:p,end:g,length:g-p}}return{index:c,captureIndices:d}}}function tk(e){return typeof e.instantiator=="function"}function nk(e){return typeof e.default=="function"}function sk(e){return typeof e.data<"u"}function ok(e){return typeof Response<"u"&&e instanceof Response}function rk(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 co;function lk(e){if(co)return co;async function t(){nt=await J1(async n=>{let s=e;return s=await s,typeof s=="function"&&(s=await s(n)),typeof s=="function"&&(s=await s(n)),tk(s)?s=await s.instantiator(n):nk(s)?s=await s.default(n):(sk(s)&&(s=s.data),ok(s)?typeof WebAssembly.instantiateStreaming=="function"?s=await ik(s)(n):s=await ak(s)(n):rk(s)?s=await jr(s)(n):s instanceof WebAssembly.Module?s=await jr(s)(n):"default"in s&&s.default instanceof WebAssembly.Module&&(s=await jr(s.default)(n))),"instance"in s&&(s=s.instance),"exports"in s&&(s=s.exports),s})}return co=t(),co}function jr(e){return t=>WebAssembly.instantiate(e,t)}function ik(e){return t=>WebAssembly.instantiateStreaming(e,t)}function ak(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function ck(e){return e&&await lk(e),{createScanner(t){return new ek(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new Xu(t)}}}const uk={class:"code-block"},fk={class:"code-header"},dk={class:"code-lang"},hk=["innerHTML"],pk=_e({__name:"CodeBlock",props:{code:{},lang:{},streaming:{type:Boolean}},setup(e){const t=e,n=mn("effectiveTheme",N(typeof document<"u"&&document.documentElement.dataset.theme==="dark"?"dark":"light")),s=N(""),o=N(""),r=N(!1);let l=null;const i=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(l)return l;const[k,w]=await Promise.all([ro(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url),ro(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url)]);return l=await V1({themes:[k.default,w.default],langs:[],engine:ck(()=>ro(()=>import("./wasm-CG6Dc4jp.js"),[],import.meta.url))}),l}async function d(k){if(i.has(k))return!0;if(a.has(k))return await a.get(k),i.has(k);const w=(async()=>{try{const x=await u(),$=await ro(()=>import(`shiki/langs/${k}.mjs`),[],import.meta.url);await x.loadLanguage($.default),i.add(k)}catch{}})();return a.set(k,w),await w,a.delete(k),i.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 d(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 Le(()=>[t.code,t.lang,n.value],([k])=>{t.streaming?o.value=`<pre class="shiki-fallback"><code>${g(k)}</code></pre>`:p()},{immediate:!0}),Le(()=>t.streaming,(k,w)=>{w&&!k&&p()}),(k,w)=>(y(),b("div",uk,[f("div",fk,[f("span",dk,I(e.lang||"text"),1),f("button",{class:fe(["code-copy",{copied:r.value}]),onClick:_},I(r.value?"已复制":"复制"),3)]),f("div",{class:"code-content",innerHTML:t.streaming?o.value:s.value||o.value},null,8,hk)]))}}),gk=Se(pk,[["__scopeId","data-v-f94a1d0a"]]);Ne.setOptions({gfm:!0,breaks:!1});const mk=_e({props:{content:{type:String,required:!0},streaming:{type:Boolean,default:!1}},setup(e){const t=N(e.content);let n=null;Le(()=>e.content,o=>{if(!e.streaming){t.value=o;return}n===null&&(n=requestAnimationFrame(()=>{n=null,t.value=e.content}))}),Le(()=>e.streaming,(o,r)=>{r&&!o&&(n!==null&&(cancelAnimationFrame(n),n=null),t.value=e.content)});const s=Y(()=>{const o=vk(t.value);return Ne.lexer(o).flatMap(l=>yl(l,e.streaming))});return()=>Me("div",{class:"markdown-body"},s.value)}});function vk(e){const t=/^(`{3,})/gm;let n=null,s=-1,o=0,r;for(;(r=t.exec(e))!==null;){const l=r[1];n===null?(n=l,s=r.index,o=l.length):l.length>=o&&(n=null)}return n!==null?e.substring(0,s).trimEnd():e}function yl(e,t=!1){const n=e;switch(n.type){case"paragraph":return[Me("p",{class:"md-p"},pn(n.tokens??[]))];case"heading":return[Me(`h${n.depth??2}`,{class:`md-h${n.depth??2}`},pn(n.tokens??[]))];case"code":return[Me(gk,{code:n.text??"",lang:n.lang??"text",streaming:t})];case"blockquote":return[Me("blockquote",{class:"md-blockquote"},(n.tokens??[]).flatMap(s=>yl(s,t)))];case"list":{const s=(n.items??[]).map(o=>{const r=[];return o.task&&r.push(Me("input",{type:"checkbox",checked:o.checked,disabled:!0,class:"md-checkbox"})),r.push(...o.tokens.flatMap(l=>yl(l,t))),Me("li",{class:["md-li",o.task?"md-task":""]},r)});return[Me(n.ordered?"ol":"ul",{class:n.ordered?"md-ol":"md-ul"},s)]}case"hr":return[Me("hr",{class:"md-hr"})];case"space":return[];case"html":return[Me("pre",{class:"md-raw-html"},n.text??"")];case"table":return[Me("div",{class:"md-table-wrap",style:"overflow-x:auto"},[yk(n)])];case"br":return[Me("br")];case"text":return[Me("span",{class:"md-text"},n.tokens?pn(n.tokens):n.text??"")];case"def":return[];default:return[Me("p",{class:"md-p"},n.raw??"")]}}function yk(e){const t=(e.header??[]).map((s,o)=>{var i;const r=(i=e.align)==null?void 0:i[o],l=s;return Me("th",{class:"md-th",style:r?`text-align:${r}`:""},l.tokens?pn(l.tokens):String(l.text??""))}),n=(e.rows??[]).map(s=>Me("tr",{},s.map((o,r)=>{var a;const l=(a=e.align)==null?void 0:a[r],i=o;return Me("td",{class:"md-td",style:l?`text-align:${l}`:""},i.tokens?pn(i.tokens):String(i.text??""))})));return Me("table",{class:"md-table"},[Me("thead",{},[Me("tr",{},t)]),Me("tbody",{},n)])}function pn(e){return e.map(t=>{const n=t;switch(n.type){case"text":return n.text??"";case"codespan":return Me("code",{class:"md-code"},n.text??"");case"strong":return Me("strong",{class:"md-strong"},pn(n.tokens??[]));case"em":return Me("em",{class:"md-em"},pn(n.tokens??[]));case"del":return Me("del",{class:"md-del"},pn(n.tokens??[]));case"link":{const s=n.href;return s&&!/^(https?:|mailto:|#|\/)/i.test(s)?n.raw??"":Me("a",{class:"md-a",href:s,target:"_blank",rel:"noopener"},pn(n.tokens??[]))}case"image":return Me("img",{class:"md-img",src:n.href,alt:n.text??"",loading:"lazy"});case"br":return Me("br");case"html":return Me("code",{class:"md-raw-inline"},n.text??"");case"escape":return n.text??"";default:return n.raw??""}})}const bk=Se(mk,[["__scopeId","data-v-98ce0f33"]]),kk=new Set(["edit","str_replace","replace","write","multi_edit","create_file","edit_file","apply_patch"]);function wk(e){return kk.has(e.toLowerCase())}function oi(e,t=!0){return e.suspended?"suspended":e.isError?"error":e.output===void 0?t?"running":"unknown":"ok"}function _k(e,t=!0){const n=new Set(e.map(s=>oi(s,t)));return n.has("running")?"running":n.has("error")?"error":n.has("suspended")?"suspended":n.has("unknown")?"unknown":"ok"}const Sk=["onKeydown"],xk={class:"tool-name"},Ck=["title"],$k={class:"tool-collapse-inner"},Tk={class:"tool-body"},Ak={key:0,class:"tool-args"},Rk={key:1,class:"tool-result"},Ek={key:2,class:"tool-image-wrap"},Ik=["src"],Pk={key:3,class:"tool-output-actions"},Mk={key:4,class:"tool-running-hint"},Lk=_e({__name:"GenericToolCard",props:{tool:{},live:{type:Boolean,default:!0}},setup(e){const t=e,n=Y(()=>oi(t.tool,t.live)),s=Y(()=>{switch(n.value){case"ok":return"✓";case"error":return"✗";default:return""}}),o=N(!1);let r=!1;Le(n,k=>{r||(o.value=k==="running")},{immediate:!0});function l(){r=!0,o.value=!o.value}const i=Y(()=>{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=Y(()=>c(t.tool.output)),d=Y(()=>u.value.length>8192),h=N(!1),p=Y(()=>d.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 _=Y(()=>{const k=u.value.trim();return!/^[\w@./-]+\.(png|jpe?g|gif|webp|avif)$/i.test(k)||k.includes("..")||k.startsWith("/")||d.value?null:`/api/v1/files/raw?path=${encodeURIComponent(k)}`});return(k,w)=>(y(),b("div",{class:fe(["tool-card",`is-${n.value}`])},[f("div",{class:"tool-header",role:"button",tabindex:"0",onClick:l,onKeydown:Os(Tt(l,["prevent"]),["enter"])},[f("span",{class:fe(["status-dot",n.value])},[s.value?(y(),b(X,{key:0},[$e(I(s.value),1)],64)):B("",!0)],2),f("span",xk,I(e.tool.name),1),i.value?(y(),b("span",{key:0,class:"tool-params",title:i.value},I(i.value),9,Ck)):B("",!0),f("span",{class:fe(["tool-chevron",{open:o.value}])},"▸",2)],40,Sk),f("div",{class:fe(["tool-collapse",{open:o.value}])},[f("div",$k,[f("div",Tk,[a()?(y(),b("pre",Ak,[f("code",null,I(a()),1)])):B("",!0),e.tool.output!==void 0&&!_.value?(y(),b("pre",Rk,[f("code",null,I(p.value||"(无输出)"),1)])):B("",!0),e.tool.output!==void 0&&_.value?(y(),b("div",Ek,[f("img",{class:"tool-image",src:_.value,alt:"",loading:"lazy",onError:w[0]||(w[0]=x=>x.currentTarget.style.display="none")},null,40,Ik)])):B("",!0),d.value?(y(),b("div",Pk,[f("button",{class:"tool-output-btn",onClick:w[1]||(w[1]=x=>h.value=!h.value)},I(h.value?"收起":"展开全文"),1),f("button",{class:"tool-output-btn",onClick:g},"复制")])):(y(),b("div",Mk,"执行中…"))])])],2)],2))}}),Nk=Se(Lk,[["__scopeId","data-v-f8845a39"]]),Ok=500;function Dk(e,t){const n=e.length,s=t.length,o=Array.from({length:n+1},()=>new Array(s+1).fill(0));for(let r=1;r<=n;r++)for(let l=1;l<=s;l++)o[r][l]=e[r-1]===t[l-1]?o[r-1][l-1]+1:Math.max(o[r-1][l],o[r][l-1]);return o}function Bk(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 jk(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 l=/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(r);s=l?Number(l[1]):0,o=l?Number(l[2]):0;const i=r.startsWith("@@")?r.slice(r.indexOf("@@")+2,r.lastIndexOf("@@")||r.length):"";t.push({type:"context",text:i.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 Uk(e,t){const n=e.split(`
|
|
91
|
-
`),s=t.split(`
|
|
92
|
-
`);if(n.length+s.length>Ok){const r=[];return n.forEach((l,i)=>r.push({type:"del",text:l,oldNo:i+1})),s.forEach((l,i)=>r.push({type:"add",text:l,newNo:i+1})),r}const o=Dk(n,s);return Bk(o,n,s,n.length,s.length)}function Gk(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 Fk=["old_string","oldString","old_str","old_text","oldText","old","search"],zk=["new_string","newString","new_str","new_text","newText","new","replace","content"],Hk=["path","file_path","filePath","file","filename"];function Ur(e,t){for(const n of t){const s=e[n];if(typeof s=="string"&&s.length>0)return s}}function qk(e){if(!e||typeof e!="object")return null;const t=e,n=Ur(t,Hk),s=Ur(t,Fk),o=Ur(t,zk);if(!o&&!s)return null;const r=Uk(s??"",o??""),l=Gk(r);return{path:n,diff:r,stats:l}}const Vk={class:"diff-lines"},Wk={class:"dl-gutter old"},Kk={class:"dl-gutter new"},Zk={class:"dl-sign"},Jk={class:"dl-text"},Yk=_e({__name:"DiffLines",props:{lines:{}},setup(e){return(t,n)=>(y(),b("div",Vk,[(y(!0),b(X,null,Ve(e.lines,(s,o)=>(y(),b("div",{key:o,class:fe(["dl",`dl-${s.type}`])},[f("span",Wk,I(s.oldNo??""),1),f("span",Kk,I(s.newNo??""),1),f("span",Zk,I(s.type==="add"?"+":s.type==="del"?"−":" "),1),f("span",Jk,I(s.text),1)],2))),128))]))}}),ef=Se(Yk,[["__scopeId","data-v-e2e145aa"]]),Qk=["onKeydown"],Xk={class:"tool-name"},e0=["title"],t0={key:1,class:"diff-chip"},n0={class:"tool-collapse-inner"},s0={class:"tool-body"},o0={key:1,class:"tool-result"},r0={key:2,class:"tool-running-hint"},l0=_e({__name:"EditToolCard",props:{tool:{},live:{type:Boolean,default:!0}},setup(e){const t=e,n=Y(()=>oi(t.tool,t.live)),s=Y(()=>{switch(n.value){case"ok":return"✓";case"error":return"✗";default:return""}}),o=Y(()=>qk(t.tool.args)),r=Y(()=>{const h=o.value;if(!h||n.value==="error")return"";const{added:p,removed:g}=h.stats;return!p&&!g?"":`+${p} −${g}`}),l=Y(()=>{var h;return(h=o.value)==null?void 0:h.path}),i=N(!1);let a=!1;Le(n,h=>{a||(i.value=h==="running")},{immediate:!0});function c(){a=!0,i.value=!i.value}const u=Y(()=>{var h;return((h=o.value)==null?void 0:h.diff)??[]}),d=Y(()=>u.value.length>0);return(h,p)=>(y(),b("div",{class:fe(["tool-card",`is-${n.value}`,"edit-tool-card"])},[f("div",{class:"tool-header",role:"button",tabindex:"0",onClick:c,onKeydown:Os(Tt(c,["prevent"]),["enter"])},[f("span",{class:fe(["status-dot",n.value])},[s.value?(y(),b(X,{key:0},[$e(I(s.value),1)],64)):B("",!0)],2),f("span",Xk,I(e.tool.name),1),l.value?(y(),b("span",{key:0,class:"tool-filepath",title:l.value},I(l.value),9,e0)):B("",!0),r.value?(y(),b("span",t0,I(r.value),1)):B("",!0),f("span",{class:fe(["tool-chevron",{open:i.value}])},"▸",2)],40,Qk),f("div",{class:fe(["tool-collapse",{open:i.value}])},[f("div",n0,[f("div",s0,[d.value?(y(),He(ef,{key:0,lines:u.value},null,8,["lines"])):B("",!0),e.tool.output!==void 0?(y(),b("pre",o0,[f("code",null,I(e.tool.output||"(无输出)"),1)])):(y(),b("div",r0,"执行中…"))])])],2)],2))}}),i0=Se(l0,[["__scopeId","data-v-00b9973b"]]),a0=["aria-expanded"],c0={class:"process-label"},u0={class:"process-meta"},f0=["title"],d0={class:"process-collapse"},h0={class:"process-inner"},p0=_e({__name:"ToolGroup",props:{name:{},tools:{},live:{type:Boolean,default:!0}},setup(e){const t=e,n=N(!1),s=Y(()=>_k(t.tools,t.live)),o=Y(()=>t.tools.filter(i=>i.output!==void 0&&!i.isError).length),r=Y(()=>s.value==="running"?"执行中":s.value==="error"?"含失败调用":s.value==="suspended"?"含挂起等待":s.value==="unknown"?"结果未持久化":`已完成 ${o.value} 项`);function l(){n.value=!n.value}return(i,a)=>(y(),b("section",{class:fe(["tool-process",{open:n.value,running:s.value==="running",error:s.value==="error"}])},[f("button",{class:"process-head",type:"button","aria-expanded":n.value,onClick:l},[K(ye,{name:"chevron-down",size:12,class:"chevron"}),f("span",{class:fe(["process-dot",s.value]),"aria-hidden":"true"},null,2),f("span",c0,I(e.name),1),f("span",u0,I(r.value)+" · "+I(e.tools.length)+" 步",1),f("span",{class:"process-names",title:e.tools.map(c=>c.name).join("、")},I(e.tools.map(c=>c.name).join(" · ")),9,f0)],8,a0),f("div",d0,[f("div",h0,[(y(!0),b(X,null,Ve(t.tools,c=>(y(),He(mh(re(wk)(c.name)?i0:Nk),{key:c.toolCallId,tool:c,live:e.live},null,8,["tool","live"]))),128))])])],2))}}),g0=Se(p0,[["__scopeId","data-v-e8ad7860"]]),m0={class:"thinking-block"},v0=["title"],y0={class:"teaser-text"},b0={class:"teaser-open"},k0={key:1,class:"thinking-stream"},w0={class:"thinking-panel",role:"dialog","aria-label":"思考过程"},_0={class:"panel-body"},S0=_e({__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),l=N(t.tool.output??"");Le(()=>t.tool.output,h=>{h!==void 0&&!o.value&&!r.value&&(l.value=h)});const i=Y(()=>!!t.tool.truncated);async function a(){if(!(!i.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&&(l.value=p.output,r.value=!0)}catch{}finally{o.value=!1}}}const c=Y(()=>l.value.split(/\n+/).map(p=>p.trim()).filter(Boolean).at(-1)??"");Le(l,()=>{t.active&&Lt(()=>{const h=s.value;h&&(h.scrollTop=h.scrollHeight)})});function u(){a(),n.value=!0}function d(){n.value=!1}return(h,p)=>(y(),b("div",m0,[e.active?(y(),b("div",k0,[p[1]||(p[1]=f("div",{class:"stream-header"},[f("span",{class:"stream-icon"},"💭"),f("span",{class:"stream-title"},"思考中…"),f("span",{class:"stream-dot"})],-1)),f("div",{ref_key:"streamRef",ref:s,class:"stream-body"},I(l.value),513)])):(y(),b("button",{key:0,class:"thinking-teaser",title:i.value?"思考较长,点击查看完整思考过程":"点击查看完整思考过程",onClick:u},[p[0]||(p[0]=f("span",{class:"teaser-icon"},"💭",-1)),f("span",y0,I(o.value?"加载完整思考…":c.value||"思考过程"),1),f("span",b0,I(i.value?"查看全文":"展开"),1)],8,v0)),(y(),He(Il,{to:"body"},[n.value?(y(),b("div",{key:0,class:"thinking-overlay",onClick:Tt(d,["self"])},[f("aside",w0,[f("header",{class:"panel-header"},[p[2]||(p[2]=f("span",null,"💭 思考过程",-1)),f("button",{class:"panel-close","aria-label":"关闭",onClick:d},"✕")]),f("div",_0,I(l.value||"(空)"),1)])])):B("",!0)]))]))}}),x0=Se(S0,[["__scopeId","data-v-436ab760"]]),C0={key:0,class:"clock"},$0={class:"stat"},T0={class:"stat"},A0={class:"stat"},R0={class:"stat"},E0={class:"stat"},I0={class:"stat"},P0=_e({__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)}Le(()=>t.stats.status,a=>{a==="running"?r():o()},{immediate:!0}),Ht(o);function l(a){return a==null?"—":a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(1)}s`}function i(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(X,{key:0},[c[0]||(c[0]=f("span",{class:"badge-gradient"},"正在思考",-1)),n.value!==null?(y(),b("span",C0,I(l(n.value)),1)):B("",!0)],64)):(y(),b(X,{key:1},[f("span",$0,I(e.stats.turn)+" 轮 · "+I(e.stats.step)+" 步",1),c[10]||(c[10]=f("span",{class:"dot"},"·",-1)),f("span",T0,[c[1]||(c[1]=f("span",{class:"k"},"LLM",-1)),$e(" "+I(l(e.stats.llmMs)),1)]),e.stats.toolMs?(y(),b(X,{key:0},[c[3]||(c[3]=f("span",{class:"dot"},"·",-1)),f("span",A0,[c[2]||(c[2]=f("span",{class:"k"},"工具",-1)),$e(" "+I(l(e.stats.toolMs)),1)])],64)):B("",!0),e.stats.firstTokenMs!==null&&e.stats.firstTokenMs!==void 0?(y(),b(X,{key:1},[c[5]||(c[5]=f("span",{class:"dot"},"·",-1)),f("span",R0,[c[4]||(c[4]=f("span",{class:"k"},"首token",-1)),$e(" "+I(l(e.stats.firstTokenMs)),1)])],64)):B("",!0),e.stats.tokens!==null&&e.stats.tokens!==void 0?(y(),b(X,{key:2},[c[7]||(c[7]=f("span",{class:"dot"},"·",-1)),f("span",E0,[c[6]||(c[6]=f("span",{class:"k"},"tokens",-1)),$e(" "+I(i(e.stats.tokens)),1)])],64)):B("",!0),e.stats.tokensPerSec!==null&&e.stats.tokensPerSec!==void 0?(y(),b(X,{key:3},[c[9]||(c[9]=f("span",{class:"dot"},"·",-1)),f("span",I0,[c[8]||(c[8]=f("span",{class:"k"},"tok/s",-1)),$e(" "+I(e.stats.tokensPerSec),1)])],64)):B("",!0)],64))],2))}}),M0=Se(P0,[["__scopeId","data-v-95536a3e"]]),L0={key:0,class:"user-wrap"},N0={class:"user-bubble"},O0={key:0,class:"message-meta user-meta"},D0={key:1,class:"meta-time"},B0={key:1,class:"assistant-wrap"},j0={key:0,class:"assistant-brand"},U0={key:0,class:"brand-model"},G0={key:1,class:"brand-streaming"},F0={class:"assistant-body"},z0={key:0,class:"degraded-note"},H0={key:4,class:"streaming-cursor","aria-label":"正在生成"},q0={key:6,class:"message-meta"},V0=["title"],W0=["title"],K0={key:4,class:"meta-time"},Z0=_e({__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 l=Y(()=>n.message.role==="user"),i=Y(()=>n.message.role==="assistant"),a=Y(()=>n.message.tools.filter(x=>x.name==="thinking")),c=Y(()=>n.message.tools.filter(x=>x.name!=="thinking")),u=Y(()=>n.message.ts!==void 0?new Date(n.message.ts).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}):""),d=Y(()=>l.value&&n.isLatestUser&&n.idle),h=mn("showThinking",N(!0)),p=mn("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}Ht(()=>{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}])},[l.value?(y(),b("div",L0,[f("div",N0,I(e.message.content),1),u.value||d.value?(y(),b("div",O0,[d.value?(y(),b("button",{key:0,title:"编辑并重新发送",onClick:$[0]||($[0]=A=>s("edit",e.message.content))},[K(ye,{name:"edit",size:12}),$[3]||($[3]=$e("编辑重发",-1))])):B("",!0),u.value?(y(),b("span",D0,I(u.value),1)):B("",!0)])):B("",!0)])):(y(),b("div",B0,[i.value&&(e.message.model||e.streaming)?(y(),b("div",j0,[e.message.model?(y(),b("span",U0,I(e.message.model),1)):B("",!0),e.streaming?(y(),b("span",G0,[...$[4]||($[4]=[f("i",{"aria-hidden":"true"},null,-1),$e("生成中",-1)])])):B("",!0)])):B("",!0),f("div",F0,[e.message.degraded?(y(),b("p",z0,"该回合早于持久化快照:正文与思考在服务重启后无法恢复(工具记录与消息结构已保留)。")):B("",!0),re(h)?(y(!0),b(X,{key:1},Ve(a.value,A=>(y(),He(x0,{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)):B("",!0),c.value.length&&re(p)?(y(),He(g0,{key:2,name:"工具调用过程",tools:c.value,live:e.streaming},null,8,["tools","live"])):B("",!0),e.message.content?(y(),He(bk,{key:3,class:"assistant-content",content:e.message.content,streaming:e.streaming},null,8,["content","streaming"])):e.streaming?(y(),b("span",H0)):B("",!0),e.message.turnStats?(y(),He(M0,{key:5,stats:e.message.turnStats},null,8,["stats"])):B("",!0),e.message.content||e.message.isError&&!e.streaming||e.canFork||e.showTimestamp&&u.value?(y(),b("div",q0,[e.message.content?(y(),b("button",{key:0,title:o.value?"已复制":"复制内容",onClick:w},[K(ye,{name:o.value?"check":"copy",size:12},null,8,["name"]),$e(I(o.value?"已复制":"复制"),1)],8,V0)):B("",!0),e.message.content?(y(),b("button",{key:1,title:g.value?"停止朗读":"朗读",onClick:k},[K(ye,{name:g.value?"speaker-off":"speaker",size:12},null,8,["name"]),$e(I(g.value?"停止":"朗读"),1)],8,W0)):B("",!0),e.message.isError&&!e.streaming?(y(),b("button",{key:2,class:"retry-btn",title:"重发最后一条消息",onClick:$[1]||($[1]=A=>s("retry"))},[K(ye,{name:"refresh",size:12}),$[5]||($[5]=$e("重试",-1))])):B("",!0),i.value&&e.canFork&&!e.streaming?(y(),b("button",{key:3,title:"以当前对话为起点创建一个新会话",onClick:$[2]||($[2]=A=>s("fork"))},[K(ye,{name:"fork",size:12}),$[6]||($[6]=$e("Fork",-1))])):B("",!0),e.showTimestamp&&u.value?(y(),b("time",K0,I(u.value),1)):B("",!0)])):B("",!0)])]))],2))}}),J0=Se(Z0,[["__scopeId","data-v-7209f2f7"]]),Y0=""+new URL("../icon.ico",import.meta.url).href,Q0={class:"empty-state"},X0={class:"suggestions"},ew=["onClick"],tw={class:"suggestion-icon"},nw={class:"suggestion-title"},sw=["title"],ow={class:"workdir-path"},rw={class:"empty-status","aria-label":"连接与模型状态"},lw={class:"status-item"},iw={class:"status-item"},aw={class:"status-item"},cw=_e({__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 l=r<=1?Math.round(r*100):Math.round(r);return`${Math.min(l,100)}%`}return(r,l)=>(y(),b("div",Q0,[l[3]||(l[3]=f("div",{class:"empty-logo"},[f("img",{src:Y0,alt:"Scream",class:"logo-img"})],-1)),l[4]||(l[4]=f("h1",{class:"empty-title"},"Scream Web UI",-1)),l[5]||(l[5]=f("p",{class:"empty-subtitle"},"给 Scream 发消息,开始处理你的任务",-1)),f("div",X0,[(y(),b(X,null,Ve(s,i=>f("button",{key:i.title,class:"suggestion-card",onClick:a=>n("pick",i.prompt)},[f("span",tw,[K(ye,{name:i.icon,size:22},null,8,["name"])]),f("span",nw,I(i.title),1)],8,ew)),64))]),e.workDir?(y(),b("div",{key:0,class:"empty-workdir",title:e.workDir},[l[0]||(l[0]=f("span",{class:"workdir-label"},"工作目录",-1)),f("span",ow,I(e.workDir),1)],8,sw)):B("",!0),f("div",rw,[f("span",{class:fe(["status-dot",e.connected?"on":"off"])},null,2),f("span",lw,I(e.connected?"已连接":"未连接"),1),e.model?(y(),b(X,{key:0},[l[1]||(l[1]=f("span",{class:"status-sep"},"·",-1)),f("span",iw,"模型 "+I(e.model),1)],64)):B("",!0),e.contextUsage!==null&&e.contextUsage!==void 0?(y(),b(X,{key:1},[l[2]||(l[2]=f("span",{class:"status-sep"},"·",-1)),f("span",aw,"上下文 "+I(o(e.contextUsage)),1)],64)):B("",!0)]),l[6]||(l[6]=f("div",{class:"empty-shortcuts","aria-hidden":"true"},[f("span",null,[f("kbd",null,"⌘K"),$e(" 搜索会话")]),f("span",null,[f("kbd",null,"⌘N"),$e(" 新建会话")])],-1))]))}}),uw=Se(cw,[["__scopeId","data-v-cc2342f3"]]),fw={class:"message-list-wrapper"},dw={key:0,class:"conn-banner",role:"status"},hw={key:0,class:"load-older-row"},pw=["disabled"],gw={key:2,class:"message-skeleton","aria-hidden":"true"},mw=_e({__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=Y(()=>{for(let C=n.messages.length-1;C>=0;C--)if(n.messages[C].role==="user")return n.messages[C].id;return null}),l=Y(()=>{var C;return((C=n.messages.at(-1))==null?void 0:C.id)??null}),i=Y(()=>{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 P=n.messages[C+1];return!P||P.role!=="assistant"||R.ts!==void 0&&P.ts!==void 0&&P.ts-R.ts>300*1e3}const c=Y(()=>{var P;const C=n.messages.at(-1);if(!C)return 0;let R=C.content.length;for(const Z of C.tools)R+=((P=Z.output)==null?void 0:P.length)??0;return R});let u=!1;const d=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 P=p()?"auto":C;R.scrollTo({top:R.scrollHeight,behavior:P})})}let _=null;function k(){const C=o.value,R=n.sessionId;!C||!R||_===null&&(_=requestAnimationFrame(()=>{_=null;try{localStorage.setItem(`scream-scroll:${R}`,String(C.scrollTop))}catch{}}))}function w(){const C=o.value,R=n.sessionId;if(!C||!R)return;let P=null;try{P=localStorage.getItem(`scream-scroll:${R}`)}catch{}P&&(C.scrollTop=Number(P))}let x=0;Le(()=>n.olderLoading,C=>{const R=o.value;if(R){if(C)x=R.scrollHeight;else if(x>0){const P=R.scrollHeight-x;P>0&&(R.scrollTop=R.scrollTop+P),x=0}}});function $(){const C=o.value;if(!C)return;const R=C.scrollHeight-C.scrollTop-C.clientHeight>80;d.value=R,R&&u&&(u=!1),n.busy||k()}let A="";Le(()=>n.sessionId,()=>{A=""}),Le(()=>[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,d.value=!1,g("smooth");return}!u&&!h()||g("auto")}),Le(()=>n.busy,C=>{C||(u=!1)});function F(){u=!0,d.value=!1,g("smooth")}const Q=Y(()=>!n.busy||n.messages.length===0?!1:n.messages.at(-1).role==="user");return Bt(()=>{var C;(C=o.value)==null||C.addEventListener("scroll",$,{passive:!0}),requestAnimationFrame(()=>requestAnimationFrame(w))}),sr(()=>{var C;(C=o.value)==null||C.removeEventListener("scroll",$),_!==null&&(cancelAnimationFrame(_),_=null)}),(C,R)=>(y(),b("div",fw,[!e.connected&&e.messages.length>0?(y(),b("div",dw,[R[6]||(R[6]=f("span",{class:"conn-dot","aria-hidden":"true"},null,-1)),R[7]||(R[7]=f("span",null,"连接中断,自动恢复中…",-1)),f("button",{class:"conn-retry",onClick:R[0]||(R[0]=P=>s("retry-connection"))},"立即重试")])):B("",!0),f("div",{ref_key:"listRef",ref:o,class:"message-list"},[e.olderAvailable?(y(),b("div",hw,[f("button",{class:"load-older-btn",disabled:e.olderLoading,onClick:R[1]||(R[1]=P=>s("load-older"))},I(e.olderLoading?"加载中…":"加载更早消息"),9,pw)])):B("",!0),e.messages.length===0?(y(),He(uw,{key:1,"work-dir":e.workDir,model:e.model,"context-usage":e.contextUsage,connected:e.connected,onPick:R[2]||(R[2]=P=>s("pick",P))},null,8,["work-dir","model","context-usage","connected"])):B("",!0),(y(!0),b(X,null,Ve(e.messages,(P,Z)=>(y(),He(J0,{key:P.id,message:P,"is-latest-user":P.id===r.value,idle:!e.busy,streaming:e.busy&&P.id===l.value&&P.role==="assistant","session-id":e.sessionId,"can-fork":!e.busy&&P.id===i.value,"show-timestamp":a(Z),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",gw,[...R[8]||(R[8]=[f("div",{class:"sk-body"},[f("div",{class:"sk-line sk-w-60"}),f("div",{class:"sk-line sk-w-90"}),f("div",{class:"sk-line sk-w-40"})],-1)])])):B("",!0)],512),K(ar,{name:"scroll-btn"},{default:Ct(()=>[d.value?(y(),b("button",{key:0,class:"scroll-to-bottom",title:"滚动到最新消息",onClick:F},[K(ye,{name:"chevron-down",size:18})])):B("",!0)]),_:1})]))}}),vw=Se(mw,[["__scopeId","data-v-0705d80e"]]),yw={class:"files-pane"},bw={class:"files-path"},kw={class:"crumbs"},ww=["onClick"],_w={key:0,class:"crumb-sep"},Sw={class:"crumb-name"},xw={key:0,class:"files-error"},Cw={key:1,class:"files-loading"},$w={class:"files-preview-head"},Tw=["title"],Aw={key:0,class:"files-preview-note"},Rw={class:"files-preview-body"},Ew={key:0,class:"files-pre"},Iw=["src"],Pw=["src"],Mw=["src"],Lw={key:4,class:"files-binary"},Nw={key:3,class:"files-list"},Ow=["onClick"],Dw={class:"files-name"},Bw={class:"files-meta"},jw={key:0,class:"files-empty"},uo="/api/v1/files",Uw=_e({__name:"FilesBrowser",props:{initialPath:{default:""}},setup(e){const t=e,n=N(""),s=N([]),o=N(!1),r=N(""),l=N(null),i=N("");function a(k){return`${uo}/raw?path=${encodeURIComponent(k)}`}const c=Y(()=>{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="",l.value=null;try{const w=await fetch(`${uo}/list?path=${encodeURIComponent(k)}`);if(!w.ok)throw new Error(`HTTP ${w.status}`);const x=await w.json();n.value=x.path||await d(),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 d(){try{return(await(await fetch(`${uo}/root`)).json()).roots[0]??""}catch{return""}}async function h(k){if(k.type==="dir"){await u(k.path);return}if(p(k.name)==="binary"){l.value={path:k.path,content:"",truncated:!1},i.value="该文件类型暂不支持预览";return}i.value="";try{const x=await fetch(`${uo}/read?path=${encodeURIComponent(k.path)}`);if(!x.ok)throw new Error(`HTTP ${x.status}`);const $=await x.json();$.truncated&&(i.value="文件较大,仅显示前 256KB"),l.value=$}catch(x){i.value=x instanceof Error?x.message:String(x),l.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=Y(()=>l.value?{name:l.value.path.split(/[\\/]/).pop()??"",path:l.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 Bt(()=>{u(t.initialPath)}),Le(()=>t.initialPath,k=>{k&&u(k)}),(k,w)=>{var x,$,A,F,Q,C;return y(),b("div",yw,[f("div",bw,[f("button",{class:"files-up",title:"上一级","aria-label":"上一级",onClick:w[0]||(w[0]=R=>u(n.value.split("/").slice(0,-1).join("/")||"/"))},[K(ye,{name:"chevron-left",size:16})]),f("div",kw,[(y(!0),b(X,null,Ve(c.value,(R,P)=>(y(),b("span",{key:P,class:"crumb",onClick:Z=>u(R.path)},[P>0?(y(),b("b",_w,"/")):B("",!0),f("span",Sw,I(R.label),1)],8,ww))),128))])]),r.value?(y(),b("p",xw,I(r.value),1)):o.value?(y(),b("p",Cw,"加载中…")):B("",!0),l.value?(y(),b(X,{key:2},[f("div",$w,[f("span",{class:"files-preview-name",title:(x=l.value)==null?void 0:x.path},I(($=g.value)==null?void 0:$.name),9,Tw),f("button",{class:"files-preview-close",title:"关闭预览","aria-label":"关闭预览",onClick:w[1]||(w[1]=R=>l.value=null)},[K(ye,{name:"x",size:16})])]),i.value?(y(),b("p",Aw,I(i.value),1)):B("",!0),f("div",Rw,[p(((A=g.value)==null?void 0:A.name)??"")==="text"?(y(),b("pre",Ew,I(l.value.content),1)):p(((F=g.value)==null?void 0:F.name)??"")==="image"?(y(),b("img",{key:1,src:a(l.value.path),alt:"",class:"files-img"},null,8,Iw)):p(((Q=g.value)==null?void 0:Q.name)??"")==="audio"?(y(),b("audio",{key:2,src:a(l.value.path),controls:""},null,8,Pw)):p(((C=g.value)==null?void 0:C.name)??"")==="pdf"?(y(),b("iframe",{key:3,src:a(l.value.path),class:"files-pdf",title:"PDF 预览"},null,8,Mw)):(y(),b("p",Lw,"该文件类型暂不支持预览(可下载)。"))])],64)):(y(),b("ul",Nw,[(y(!0),b(X,null,Ve(s.value,R=>(y(),b("li",{key:R.path},[f("button",{class:fe(["files-item",{dir:R.type==="dir"}]),onClick:P=>h(R)},[K(ye,{name:R.type==="dir"?"folder":"file",size:16},null,8,["name"]),f("span",Dw,I(R.name),1),f("span",Bw,I(R.type==="dir"?"目录":_(R.size)),1)],10,Ow)]))),128)),!o.value&&s.value.length===0?(y(),b("li",jw,"空目录")):B("",!0)]))])}}}),Gw=Se(Uw,[["__scopeId","data-v-fa6c15e9"]]),Fw=34;function Gr(e){const t=e.split("/"),n=t.at(-1)??e;return t.length<=2?{dir:t.length===2?`${t[0]}/`:"",base:n}:e.length<=Fw?{dir:`${t.slice(0,-1).join("/")}/`,base:n}:{dir:`…/${t.at(-2)}/`,base:n}}const zw={class:"panel-head-row"},Hw=["aria-expanded"],qw={class:"head-icon"},Vw=["title"],Ww={key:1,class:"head-hint"},Kw={class:"head-tail"},Zw={key:0,class:"head-count"},Jw={class:"panel-body"},Yw={key:0,class:"git-files"},Qw=["title","onClick"],Xw={class:"git-file-name"},e_={key:0,class:"git-file-dir"},t_={class:"git-file-base"},n_={key:0,class:"git-file-stat"},s_={key:0,class:"add"},o_={key:1,class:"del"},r_={key:2,class:"diff-body"},l_={key:3,class:"diff-empty"},i_={key:1,class:"diff-empty"},a_=8,Aa="scream-panel-git-open",c_=_e({__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"},l=N(!1),i=N(!0);try{i.value=localStorage.getItem(Aa)!=="0"}catch{}function a(){i.value=!i.value;try{localStorage.setItem(Aa,i.value?"1":"0")}catch{}}function c(){s("refresh")}const u=Y(()=>{var g;const p=((g=n.gitStatus)==null?void 0:g.files)??[];return l.value?p:p.slice(0,a_)}),d=Y(()=>{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=Y(()=>{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":i.value}])},[f("div",zw,[f("button",{class:"panel-head","aria-expanded":i.value,onClick:a},[f("span",qw,[K(ye,{name:"git-branch",size:14})]),g[1]||(g[1]=f("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,Vw)):(y(),b("span",Ww,"状态不可用")),f("span",Kw,[e.gitStatus?(y(),b("span",Zw,I(e.gitStatus.changed),1)):B("",!0),K(ye,{class:fe(["chevron",{rotated:i.value}]),name:"chevron-down",size:14},null,8,["class"])])],8,Hw),f("button",{class:"icon-btn",title:"刷新","aria-label":"刷新 Git 状态",onClick:c},[K(ye,{name:"refresh",size:14})])]),Ze(f("div",Jw,[e.gitStatus?(y(),b(X,{key:0},[u.value.length?(y(),b("ul",Yw,[(y(!0),b(X,null,Ve(u.value,k=>(y(),b("li",{key:k.path},[f("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})},[f("span",{class:fe(["git-file-status",r[k.status]??""])},I(o[k.status]??k.status),3),f("span",Xw,[re(Gr)(k.displayPath??k.path).dir?(y(),b("span",e_,I(re(Gr)(k.displayPath??k.path).dir),1)):B("",!0),f("span",t_,I(re(Gr)(k.displayPath??k.path).base),1)]),k.adds!==void 0||k.dels!==void 0?(y(),b("span",n_,[k.adds?(y(),b("span",s_,"+"+I(k.adds),1)):B("",!0),k.dels?(y(),b("span",o_,"−"+I(k.dels),1)):B("",!0)])):B("",!0)],8,Qw)]))),128))])):B("",!0),d.value?(y(),b("button",{key:1,class:"git-more",onClick:g[0]||(g[0]=k=>l.value=!l.value)},I(l.value?"收起列表":`显示全部 ${((_=e.gitStatus.files)==null?void 0:_.length)??0} 个文件`),1)):B("",!0),e.gitStatus.diffStat?(y(),b("pre",r_,I(e.gitStatus.diffStat),1)):u.value.length?B("",!0):(y(),b("div",l_,"工作区干净,没有变更。"))],64)):(y(),b("div",i_,"读取 Git 状态失败,点右上角刷新重试。"))],512),[[Jc,i.value]])],2)}}}),u_=Se(c_,[["__scopeId","data-v-07e2afd4"]]),f_={class:"goal-panel panel-section"},d_={class:"section-heading"},h_={class:"head-icon"},p_=["title"],g_={key:0,class:"head-tail"},m_={class:"panel-body"},v_={key:0,class:"empty-state"},y_=["disabled"],b_={class:"refine-row"},k_=["disabled"],w_={key:0},__=["disabled"],S_={class:"budget-grid"},x_=["disabled"],C_=["disabled"],$_={class:"time-budget"},T_=["disabled"],A_=["disabled"],R_=["disabled"],E_={key:0,class:"goal-summary"},I_={class:"objective"},P_={class:"criterion"},M_={key:0,class:"reason"},L_={class:"goal-metrics"},N_={class:"goal-metric"},O_={key:0,class:"bar"},D_={class:"goal-metric"},B_={key:0,class:"bar"},j_={class:"goal-metric"},U_={key:0,class:"bar"},G_={key:1,class:"budget-warning"},F_={key:2,class:"notes"},z_={class:"panel-actions"},H_=["disabled"],q_=["disabled"],V_=["disabled"],W_=["disabled"],K_=["disabled"],Z_={class:"budget-grid"},J_=["disabled"],Y_=["disabled"],Q_={class:"time-budget"},X_=["disabled"],eS=["disabled"],tS={class:"edit-actions"},nS=["disabled"],sS=["disabled"],oS={key:3,class:"form-error"},rS={key:4,class:"pending-copy"},lS=_e({__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(""),l=N(""),i=N("minutes"),a=N(!1),c=N(null),u=N(!1),d=Y(()=>t.connectionStatus==="connected"),h=Y(()=>!t.sessionId||!d.value||t.archived||t.pending),p=Y(()=>h.value),g=Y(()=>{var O;return{active:"进行中",paused:"已暂停",blocked:"受阻",complete:"已完成"}[((O=t.goal)==null?void 0:O.status)??"active"]}),_=Y(()=>t.sessionId?t.archived?"归档会话为只读状态":d.value?t.pending?"正在提交请求…":t.goal?"状态由核心事件实时同步":"创建后 Agent 将自动开始执行":"连接恢复后可继续管理":"选择或新建会话后即可配置");Le(()=>t.sessionId,()=>{a.value=!1,k()}),Le(()=>{var O;return(O=t.goal)==null?void 0:O.goalId},(O,L)=>{a.value=!1,O!==L&&k()});function k(){n.value="",s.value="",o.value="",r.value="",l.value="",i.value="minutes",u.value=!1,c.value=null}function w(O,L){const te=O.trim();if(!te)return null;const ee=Number(te);if(!Number.isSafeInteger(ee)||ee<=0){c.value=`${L}必须是正整数。`;return}return ee}function x(){c.value=null;const O=w(o.value,"轮次预算");if(O===void 0)return null;const L=w(r.value,"Token 预算");if(L===void 0)return null;const te=w(l.value,"时间预算");if(te===void 0)return null;const ee=[];return O!==null&&ee.push({value:O,unit:"turns"}),L!==null&&ee.push({value:L,unit:"tokens"}),te!==null&&ee.push({value:te,unit:i.value}),ee}async function $(){const O=n.value.trim();if(!O){c.value="请先输入需要优化的目标描述。";return}c.value=null,u.value=!1;const L=await t.refineGoal(O);L!==null&&(n.value=L,u.value=!0)}async function A(){const O=n.value.trim();if(!O){c.value="目标内容不能为空。";return}const L=x();if(L===null)return;await t.createGoal({objective:O,completionCriterion:s.value.trim()||void 0,replace:!1,budgets:L})&&(u.value=!1)}function F(O){O===null?(l.value="",i.value="minutes"):O%36e5===0?(l.value=String(O/36e5),i.value="hours"):O%6e4===0?(l.value=String(O/6e4),i.value="minutes"):O%1e3===0?(l.value=String(O/1e3),i.value="seconds"):(l.value=String(O),i.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),F(O.budget.wallClockBudgetMs),c.value=null,a.value=!0)}function C(O,L){return L==="hours"?O*36e5:L==="minutes"?O*6e4:L==="seconds"?O*1e3:O}async function R(){const O=t.goal;if(!O)return;const L=n.value.trim();if(!L){c.value="目标内容不能为空。";return}const te=x();if(te===null)return;const ee=w(o.value,"轮次预算"),ve=w(r.value,"Token 预算"),Re=w(l.value,"时间预算");if(ee===void 0||ve===void 0||Re===void 0)return;if(O.budget.turnBudget!==null&&ee===null){c.value="当前协议不支持清除已有轮次预算,请填写新的正整数。";return}if(O.budget.tokenBudget!==null&&ve===null){c.value="当前协议不支持清除已有 Token 预算,请填写新的正整数。";return}if(O.budget.wallClockBudgetMs!==null&&Re===null){c.value="当前协议不支持清除已有时间预算,请填写新的正整数。";return}const le=te.filter(xe=>xe.unit==="turns"?xe.value!==O.budget.turnBudget:xe.unit==="tokens"?xe.value!==O.budget.tokenBudget:C(xe.value,xe.unit)!==O.budget.wallClockBudgetMs),oe=L===O.objective?void 0:L;if(oe===void 0&&le.length===0){c.value="目标与预算没有变化。";return}await t.updateGoal({objective:oe,budgets:le})&&(a.value=!1)}async function P(O){c.value=null,!(O==="cancel"&&!window.confirm("确定取消当前 Goal?当前 Goal 状态将被清除。"))&&(O==="pause"?await t.pauseGoal():O==="resume"?await t.resumeGoal():await t.cancelGoal())}function Z(O){return O.toLocaleString("zh-CN")}function ie(O){if(O<1e3)return`${O} 毫秒`;const L=Math.floor(O/1e3);if(L<60)return`${L} 秒`;const te=Math.floor(L/3600),ee=Math.floor(L%3600/60);return te>0?`${te} 小时 ${ee} 分钟`:`${ee} 分钟`}function z(O,L){return L===null||L<=0?0:Math.min(100,Math.round(O/L*100))}function ge(O){return new Date(O).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}return(O,L)=>(y(),b("section",f_,[f("div",d_,[f("span",h_,[K(ye,{name:"target",size:14})]),L[15]||(L[15]=f("span",{class:"head-title"},"Goal 管理",-1)),f("span",{class:"head-hint",title:_.value},I(_.value),9,p_),e.goal?(y(),b("span",g_,[f("span",{class:fe(["status-pill",`is-${e.goal.status}`])},I(g.value),3)])):B("",!0)]),f("div",m_,[e.sessionId?e.goal?(y(),b(X,{key:2},[a.value?(y(),b("form",{key:1,class:"goal-form edit-form",onSubmit:Tt(R,["prevent"])},[f("label",null,[L[31]||(L[31]=f("span",null,"目标内容",-1)),Ze(f("textarea",{"onUpdate:modelValue":L[9]||(L[9]=te=>n.value=te),rows:"3",maxlength:"4000",disabled:h.value||e.busy},null,8,K_),[[ct,n.value]])]),L[36]||(L[36]=f("div",{class:"budget-title"},[$e("更新预算 "),f("small",null,"仅提交发生变化的预算")],-1)),f("div",Z_,[f("label",null,[L[32]||(L[32]=f("span",null,"轮次",-1)),Ze(f("input",{"onUpdate:modelValue":L[10]||(L[10]=te=>o.value=te),type:"number",min:"1",step:"1",placeholder:"不限",disabled:h.value||e.busy},null,8,J_),[[ct,o.value]])]),f("label",null,[L[33]||(L[33]=f("span",null,"Token",-1)),Ze(f("input",{"onUpdate:modelValue":L[11]||(L[11]=te=>r.value=te),type:"number",min:"1",step:"1",placeholder:"不限",disabled:h.value||e.busy},null,8,Y_),[[ct,r.value]])])]),f("div",Q_,[f("label",null,[L[34]||(L[34]=f("span",null,"时间",-1)),Ze(f("input",{"onUpdate:modelValue":L[12]||(L[12]=te=>l.value=te),type:"number",min:"1",step:"1",placeholder:"不限",disabled:h.value||e.busy},null,8,X_),[[ct,l.value]])]),Ze(f("select",{"onUpdate:modelValue":L[13]||(L[13]=te=>i.value=te),"aria-label":"时间预算单位",disabled:h.value||e.busy},[...L[35]||(L[35]=[f("option",{value:"minutes"},"分钟",-1),f("option",{value:"hours"},"小时",-1),f("option",{value:"seconds"},"秒",-1),f("option",{value:"milliseconds"},"毫秒",-1)])],8,eS),[[Yi,i.value]])]),f("div",tS,[f("button",{type:"button",class:"secondary",disabled:e.pending,onClick:L[14]||(L[14]=te=>a.value=!1)},"返回",8,nS),f("button",{class:"primary small",type:"submit",disabled:h.value||e.busy},"保存修改",8,sS)])],32)):(y(),b("div",E_,[f("div",I_,[L[24]||(L[24]=f("small",null,"目标",-1)),f("p",null,I(e.goal.objective),1)]),f("div",P_,[L[25]||(L[25]=f("small",null,"完成标准",-1)),f("p",null,I(e.goal.completionCriterion??"未设置,由 Agent 根据目标判断完成。"),1)]),e.goal.terminalReason?(y(),b("div",M_,[L[26]||(L[26]=f("strong",null,"状态原因",-1)),f("span",null,I(e.goal.terminalReason),1)])):B("",!0),f("dl",L_,[f("div",N_,[L[27]||(L[27]=f("dt",null,"轮次",-1)),f("dd",null,I(e.goal.turnsUsed)+" / "+I(e.goal.budget.turnBudget??"不限"),1),e.goal.budget.turnBudget!==null?(y(),b("i",O_,[f("i",{style:gn({width:`${z(e.goal.turnsUsed,e.goal.budget.turnBudget)}%`})},null,4)])):B("",!0)]),f("div",D_,[L[28]||(L[28]=f("dt",null,"Token",-1)),f("dd",null,I(Z(e.goal.tokensUsed))+" / "+I(e.goal.budget.tokenBudget===null?"不限":Z(e.goal.budget.tokenBudget)),1),e.goal.budget.tokenBudget!==null?(y(),b("i",B_,[f("i",{style:gn({width:`${z(e.goal.tokensUsed,e.goal.budget.tokenBudget)}%`})},null,4)])):B("",!0)]),f("div",j_,[L[29]||(L[29]=f("dt",null,"时间",-1)),f("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",U_,[f("i",{style:gn({width:`${z(e.goal.wallClockMs,e.goal.budget.wallClockBudgetMs)}%`})},null,4)])):B("",!0)])]),e.goal.budget.overBudget?(y(),b("div",G_,"已达到或超过执行预算。")):B("",!0),e.goal.notes.length?(y(),b("details",F_,[f("summary",null,"工作记录("+I(e.goal.notes.length)+")",1),f("ol",null,[(y(!0),b(X,null,Ve(e.goal.notes,te=>(y(),b("li",{key:`${te.time}-${te.content}`},[f("time",null,I(ge(te.time)),1),f("span",null,I(te.content),1)]))),128))])])):B("",!0),f("div",z_,[e.goal.status!=="complete"?(y(),b("button",{key:0,class:"secondary",disabled:h.value||e.busy,onClick:Q},[K(ye,{name:"edit",size:14}),L[30]||(L[30]=$e("编辑",-1))],8,H_)):B("",!0),e.goal.status==="active"?(y(),b("button",{key:1,class:"secondary",disabled:h.value,onClick:L[6]||(L[6]=te=>P("pause"))},"暂停",8,q_)):B("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(y(),b("button",{key:2,class:"primary small",disabled:h.value||e.busy,onClick:L[7]||(L[7]=te=>P("resume"))},"继续",8,V_)):B("",!0),f("button",{class:"danger",disabled:h.value,onClick:L[8]||(L[8]=te=>P("cancel"))},"取消 Goal",8,W_)])]))],64)):(y(),b("form",{key:1,class:"goal-form",onSubmit:Tt(A,["prevent"])},[f("label",null,[L[16]||(L[16]=f("span",null,"目标内容",-1)),Ze(f("textarea",{"onUpdate:modelValue":L[0]||(L[0]=te=>n.value=te),rows:"3",maxlength:"4000",placeholder:"描述希望 Agent 持续完成的目标",disabled:p.value},null,8,y_),[[ct,n.value]])]),f("div",b_,[f("button",{type:"button",class:"secondary",disabled:p.value||!n.value.trim(),onClick:$},[K(ye,{name:"sparkles",size:15}),L[17]||(L[17]=$e(" AI 优化 ",-1))],8,k_),u.value?(y(),b("small",w_,"已优化,请确认或继续编辑后再创建。")):B("",!0)]),f("label",null,[L[18]||(L[18]=f("span",null,[$e("完成标准 "),f("small",null,"可选")],-1)),Ze(f("textarea",{"onUpdate:modelValue":L[1]||(L[1]=te=>s.value=te),rows:"2",placeholder:"例如:聚焦测试、类型检查与 Web 构建全部通过",disabled:p.value},null,8,__),[[ct,s.value]])]),L[23]||(L[23]=f("div",{class:"budget-title"},[$e("执行预算 "),f("small",null,"留空表示不限制")],-1)),f("div",S_,[f("label",null,[L[19]||(L[19]=f("span",null,"轮次",-1)),Ze(f("input",{"onUpdate:modelValue":L[2]||(L[2]=te=>o.value=te),type:"number",min:"1",step:"1",placeholder:"不限",disabled:p.value},null,8,x_),[[ct,o.value]])]),f("label",null,[L[20]||(L[20]=f("span",null,"Token",-1)),Ze(f("input",{"onUpdate:modelValue":L[3]||(L[3]=te=>r.value=te),type:"number",min:"1",step:"1",placeholder:"不限",disabled:p.value},null,8,C_),[[ct,r.value]])])]),f("div",$_,[f("label",null,[L[21]||(L[21]=f("span",null,"时间",-1)),Ze(f("input",{"onUpdate:modelValue":L[4]||(L[4]=te=>l.value=te),type:"number",min:"1",step:"1",placeholder:"不限",disabled:p.value},null,8,T_),[[ct,l.value]])]),Ze(f("select",{"onUpdate:modelValue":L[5]||(L[5]=te=>i.value=te),"aria-label":"时间预算单位",disabled:p.value},[...L[22]||(L[22]=[f("option",{value:"minutes"},"分钟",-1),f("option",{value:"hours"},"小时",-1),f("option",{value:"seconds"},"秒",-1),f("option",{value:"milliseconds"},"毫秒",-1)])],8,A_),[[Yi,i.value]])]),f("button",{class:"primary",type:"submit",disabled:p.value||!n.value.trim()},I(e.pending?"正在创建…":"创建并开始执行"),9,R_)],32)):(y(),b("div",v_,"暂无会话,Goal 管理暂不可用。")),c.value||e.error?(y(),b("p",oS,I(c.value??e.error),1)):e.pending?(y(),b("p",rS,"请求处理中,状态将在核心事件到达后同步。")):B("",!0)])]))}}),iS=Se(lS,[["__scopeId","data-v-2e8dbdc6"]]),aS={class:"panel-section like-section"},cS={class:"section-heading"},uS={class:"head-icon"},fS={class:"panel-body"},dS={class:"kv-rows"},hS={class:"dialog"},pS=["onUpdate:modelValue","placeholder"],gS={key:0,class:"dialog-error"},mS={class:"dialog-actions"},vS=["disabled"],yS=_e({__name:"LikePanel",props:{like:{},updateLike:{type:Function}},setup(e){const t=e,n=N(!1),s=N(!1),o=N(""),r=N({}),l=[{key:"nickname",label:"昵称",placeholder:"用户称呼,如:老板"},{key:"tone",label:"语气",placeholder:"AI 风格,如:专业不拖沓"},{key:"other",label:"偏好",placeholder:"其他用户偏好"},{key:"doNot",label:"禁止",placeholder:"用户明确不让做的事"}];function i(){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",aS,[f("div",cS,[f("span",uS,[K(ye,{name:"settings",size:14})]),u[2]||(u[2]=f("span",{class:"head-title"},"偏好设置",-1)),u[3]||(u[3]=f("span",{class:"head-hint"},"/like 用户偏好",-1))]),f("div",fS,[f("dl",dS,[(y(),b(X,null,Ve(l,d=>f("div",{key:d.key,class:"kv-row"},[f("dt",null,I(d.label),1),f("dd",null,I((e.like[d.key]??"").trim()||"未设置"),1)])),64))]),f("div",{class:"panel-actions"},[f("button",{class:"like-edit",onClick:i},"编辑偏好")])]),n.value?(y(),b("div",{key:0,class:"dialog-overlay",onClick:u[1]||(u[1]=Tt(d=>n.value=!1,["self"]))},[f("div",hS,[u[4]||(u[4]=f("div",{class:"dialog-title"},"编辑用户偏好",-1)),(y(),b(X,null,Ve(l,d=>f("label",{key:d.key,class:"dialog-field"},[f("span",null,I(d.label),1),Ze(f("input",{"onUpdate:modelValue":h=>r.value[d.key]=h,placeholder:d.placeholder},null,8,pS),[[ct,r.value[d.key]]])])),64)),o.value?(y(),b("div",gS,I(o.value),1)):B("",!0),f("div",mS,[f("button",{onClick:u[0]||(u[0]=d=>n.value=!1)},"取消"),f("button",{disabled:s.value,onClick:a},I(s.value?"保存中…":"确认"),9,vS)])])])):B("",!0)]))}}),bS=Se(yS,[["__scopeId","data-v-a7906d58"]]),kS=["aria-expanded"],wS={class:"head-icon"},_S={class:"head-hint"},SS={class:"head-tail"},xS=["title"],CS={class:"panel-body"},$S={class:"stat-grid"},TS={class:"stat"},AS={class:"stat"},RS=["title"],ES={key:1,class:"faint"},IS={class:"stat wide"},PS={class:"mono"},Ra="scream-panel-runstatus-open",MS=_e({__name:"RunStatusPanel",props:{status:{},busy:{type:Boolean,default:!1},connectionStatus:{}},setup(e){const t=e,n=N(!0);try{n.value=localStorage.getItem(Ra)!=="0"}catch{}function s(){n.value=!n.value;try{localStorage.setItem(Ra,n.value?"1":"0")}catch{}}const o=Y(()=>{const i=t.status.contextUsage;return i===void 0?null:Math.round((i>1?i/100:i)*100)}),r=Y(()=>{var i,a;return`Tokens: ${((i=t.status.contextTokens)==null?void 0:i.toLocaleString())??"-"} / ${((a=t.status.maxContextTokens)==null?void 0:a.toLocaleString())??"-"}`}),l=Y(()=>({connected:"已连接",connecting:"连接中",reconnecting:"重连中",disconnected:"已断开",idle:"空闲"})[t.connectionStatus]??"空闲");return Le(()=>t.busy,()=>{t.busy&&!n.value&&(n.value=!0)}),(i,a)=>{var c,u;return y(),b("section",{class:fe(["panel-section","run-status",{"is-open":n.value}])},[f("button",{class:"panel-head","aria-expanded":n.value,onClick:s},[f("span",wS,[K(ye,{name:"activity",size:14})]),a[0]||(a[0]=f("span",{class:"head-title"},"运行状态",-1)),f("span",_S,I(e.busy?"正在处理会话":"已就绪,等待任务"),1),f("span",SS,[f("span",{class:fe(["head-dot",{busy:e.busy}]),title:e.busy?"Agent 正在处理":"空闲"},null,10,xS),K(ye,{class:fe(["chevron",{rotated:n.value}]),name:"chevron-down",size:14},null,8,["class"])])],8,kS),Ze(f("div",CS,[f("dl",$S,[f("div",TS,[a[1]||(a[1]=f("dt",null,"连接",-1)),f("dd",null,[f("span",{class:fe(["conn-dot",e.connectionStatus]),"aria-hidden":"true"},null,2),f("span",{class:fe(["conn",e.connectionStatus])},I(l.value),3)])]),f("div",AS,[a[2]||(a[2]=f("dt",null,"上下文占用",-1)),o.value!==null?(y(),b("dd",{key:0,title:r.value},[K(ou,{usage:e.status.contextUsage,size:14},null,8,["usage"]),$e(I(o.value)+"% ",1)],8,RS)):(y(),b("dd",ES,"未知"))]),f("div",IS,[a[3]||(a[3]=f("dt",null,"Token(输入 / 上限)",-1)),f("dd",PS,I(((c=e.status.contextTokens)==null?void 0:c.toLocaleString())??"-")+" / "+I(((u=e.status.maxContextTokens)==null?void 0:u.toLocaleString())??"-"),1)])])],512),[[Jc,n.value]])],2)}}}),LS=Se(MS,[["__scopeId","data-v-59b0c4e7"]]),NS={class:"todo-panel panel-section"},OS={class:"section-heading"},DS={class:"head-icon"},BS={class:"head-hint"},jS={class:"head-tail"},US={class:"head-count"},GS={key:0,class:"panel-body"},FS={class:"empty-state"},zS={key:1,class:"panel-body"},HS={class:"progress-row"},qS={class:"bar","aria-hidden":"true"},VS={class:"progress-value"},WS=["title"],KS={class:"todo-title"},ZS=_e({__name:"TodoPanel",props:{todos:{}},setup(e){const t=e,n=Y(()=>Vp(t.todos)),s=Y(()=>t.todos.filter(c=>c.status==="done").length),o=Y(()=>t.todos.filter(c=>c.status==="in_progress").length),r=Y(()=>t.todos.filter(c=>c.status==="pending").length),l=Y(()=>t.todos.length?Math.round(s.value/t.todos.length*100):0),i=Y(()=>{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",NS,[f("div",OS,[f("span",DS,[K(ye,{name:"clipboard",size:14})]),u[0]||(u[0]=f("span",{class:"head-title"},"核心 Todo",-1)),f("span",BS,I(i.value),1),f("span",jS,[f("span",US,I(s.value)+"/"+I(e.todos.length),1)])]),e.todos.length===0?(y(),b("div",GS,[f("div",FS,[K(ye,{name:"check",size:18}),u[1]||(u[1]=f("span",null,"暂无 Todo",-1)),u[2]||(u[2]=f("small",null,"Agent 创建任务清单后会在这里实时显示。",-1))])])):(y(),b("div",zS,[f("div",HS,[f("i",qS,[f("i",{style:gn({width:`${l.value}%`})},null,4)]),f("span",VS,I(l.value)+"%",1)]),(y(!0),b(X,null,Ve(n.value,(d,h)=>(y(),b("section",{key:d.phase??`unphased-${h}`,class:"todo-group"},[f("h4",null,I(d.phase??"未分阶段"),1),f("ol",null,[(y(!0),b(X,null,Ve(d.items,(p,g)=>(y(),b("li",{key:`${h}-${g}-${p.title}`,class:fe(`is-${p.status}`)},[f("span",{class:"status-symbol",title:a[p.status].label},I(a[p.status].symbol),9,WS),f("span",KS,I(p.title),1),f("small",null,I(a[p.status].label),1)],2))),128))])]))),128))]))]))}}),JS=Se(ZS,[["__scopeId","data-v-6a025f22"]]),YS={class:"drawer"},QS={class:"drawer-toolbar"},XS={class:"drawer-tabs",role:"tablist","aria-label":"抽屉面板"},ex=["aria-selected"],tx=["aria-selected"],nx={class:"drawer-body"},sx={class:"git-diff-head"},ox=["title"],rx={class:"git-diff-tools"},lx={key:0,class:"git-diff-stat"},ix={key:0,class:"add"},ax={key:1,class:"del"},cx={key:0,class:"git-diff-body"},ux={key:1,class:"git-diff-empty"},fx=_e({__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 P,Z,ie;s.value={...C,lines:[],loading:!0};try{const ge=await(await fetch(`/api/v1/git/diff?path=${encodeURIComponent(C.path)}`)).json(),O=jk(ge.patch??""),L=C.adds??(C.dels===void 0?O.filter(te=>te.type==="add").length:void 0);s.value={...C,adds:L,lines:O,loading:!1}}catch{s.value={...C,lines:[],loading:!1}}await Lt();const R=((Z=(P=globalThis.window)==null?void 0:P.matchMedia)==null?void 0:Z.call(P,"(prefers-reduced-motion: reduce)").matches)===!0;(ie=o.value)==null||ie.scrollIntoView({block:"start",behavior:R?"auto":"smooth"})}const{connectionStatus:l,status:i,sessionId:a,isBusy:c,isArchived:u,goal:d,todos:h,goalRequestPending:p,goalRequestError:g,like:_,gitStatus:k,refineGoal:w,createGoal:x,updateGoal:$,pauseGoal:A,resumeGoal:F,cancelGoal:Q}=t.client;return(C,R)=>{const P=gh("SvgIcon");return y(),b("aside",YS,[f("div",QS,[f("div",XS,[f("button",{role:"tab","aria-selected":n.value==="detail",class:fe(["drawer-tab",{active:n.value==="detail"}]),onClick:R[0]||(R[0]=Z=>n.value="detail")}," 详情 ",10,ex),f("button",{role:"tab","aria-selected":n.value==="files",class:fe(["drawer-tab",{active:n.value==="files"}]),onClick:R[1]||(R[1]=Z=>n.value="files")}," 文件 ",10,tx)]),f("button",{class:"drawer-close",title:"收起面板","aria-label":"收起详情",onClick:R[2]||(R[2]=Z=>C.$emit("close"))},[K(P,{name:"panel-right",size:16})])]),f("div",nx,[n.value==="detail"?(y(),b(X,{key:0},[K(LS,{status:re(i),busy:re(c),"connection-status":re(l)},null,8,["status","busy","connection-status"]),K(u_,{"git-status":re(k),onRefresh:R[3]||(R[3]=Z=>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"},[f("div",sx,[f("span",{class:"git-diff-title",title:s.value.path},I(s.value.loading?"加载中…":s.value.display),9,ox),f("span",rx,[!s.value.loading&&(s.value.adds||s.value.dels)?(y(),b("span",lx,[s.value.adds?(y(),b("span",ix,"+"+I(s.value.adds),1)):B("",!0),s.value.dels?(y(),b("span",ax,"−"+I(s.value.dels),1)):B("",!0)])):B("",!0),f("button",{class:"git-diff-close",title:"关闭 diff","aria-label":"关闭 diff",onClick:R[4]||(R[4]=Z=>s.value=null)},"✕")])]),s.value.lines.length?(y(),b("div",cx,[K(ef,{lines:s.value.lines},null,8,["lines"])])):s.value.loading?B("",!0):(y(),b("p",ux,"该文件无差异内容(可能是二进制文件或已被忽略)。"))],512)):B("",!0),K(JS,{todos:re(h)},null,8,["todos"]),K(bS,{like:re(_),"update-like":t.client.updateLike},null,8,["like","update-like"]),K(iS,{goal:re(d),"session-id":re(a),"connection-status":re(l),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(F),"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(),He(Gw,{key:t.client.workDir.value||"none","initial-path":t.client.workDir.value||""},null,8,["initial-path"]))])])}}}),dx=Se(fx,[["__scopeId","data-v-2d1f803d"]]),hx={class:"conversation"},px={class:"chat-stage"},gx={class:"chat-column"},mx={class:"composer-dock"},vx=_e({__name:"ConversationView",props:{client:{}},emits:["home"],setup(e,{emit:t}){const n=e,s=t,{connectionStatus:o,messages:r,pendingApprovals:l,status:i,sessionId:a,workDir:c,isBusy:u,models:d,sendPrompt:h,sendCommand:p,clearMessages:g,appendSystemMessage:_,abort:k,resolveApproval:w,exportSession:x,fetchSnapshot:$,switchModel:A,switchThinking:F}=n.client,Q=N(null),C=N(!1),R=N(!1),P=N("status"),Z=Y(()=>{const le=n.client.sessions.value.find(xe=>xe.sessionId===n.client.currentSessionId.value),oe=le==null?void 0:le.title;if(oe&&oe!=="新会话"&&oe!=="New Session")return oe;const ke=r.value.find(xe=>xe.role==="user");if(ke){const xe=ke.content.replace(/\s+/g," ").trim();if(xe)return xe.length>24?`${xe.slice(0,24)}…`:xe}return oe??null});function ie(le){var oe;(oe=Q.value)==null||oe.insertText(le)}function z(le){$(),P.value=le,R.value=!0}function ge(){var oe;(((oe=Q.value)==null?void 0:oe.openModelPicker())??!1)||_(`当前模型:${i.value.model??"unknown"}`)}function O(le,oe){switch(le){case"compact":p("compact");break;case"model":ge();break;case"clear":g();break;case"new":s("home");break;case"help":_(su());break;case"auto":case"yes":case"plan":case"fork":case"title":case"btw":p(le,oe);break;case"status":z("status");break;case"usage":z("usage");break;default:_(`未知命令:/${le}`)}}function L(le){p("title",le)}function te(){if(u.value||!o.value)return;const le=[...r.value].reverse().find(oe=>oe.role==="user");le&&h(le.content)}const ee=N(!1);async function ve(){ee.value=!0,await n.client.loadOlderMessages(),ee.value=!1}function Re(){u.value||(p("fork"),setTimeout(()=>{n.client.fetchSessions()},1200))}return(le,oe)=>(y(),b("div",hx,[K(Om,{title:Z.value,busy:re(u),"drawer-open":C.value,onHome:oe[0]||(oe[0]=ke=>s("home")),onRename:L,onExport:oe[1]||(oe[1]=ke=>re(a)&&re(x)(re(a))),onClear:re(g),onToggleDrawer:oe[2]||(oe[2]=ke=>C.value=!C.value)},null,8,["title","busy","drawer-open","onClear"]),f("div",px,[f("div",gx,[K(vw,{messages:re(r),busy:re(u),"work-dir":re(c),"session-id":re(a)??"",model:re(i).model??null,"context-usage":re(i).contextUsage??null,connected:re(o)==="connected","older-available":n.client.olderAvailable.value,"older-loading":ee.value,onEdit:ie,onPick:re(h),onRetryConnection:oe[3]||(oe[3]=ke=>n.client.reconnectNow()),onRetryMessage:te,onLoadOlder:ve,onFork:Re},null,8,["messages","busy","work-dir","session-id","model","context-usage","connected","older-available","older-loading","onPick"]),f("div",mx,[K(hg,{approvals:re(l),onResolve:re(w)},null,8,["approvals","onResolve"]),K(ru,{ref_key:"composerRef",ref:Q,busy:re(u),status:re(i),"session-id":re(a),models:re(d),onSend:re(h),onAbort:re(k),onCommand:O,onSwitchModel:re(A),onSwitchThinking:re(F)},null,8,["busy","status","session-id","models","onSend","onAbort","onSwitchModel","onSwitchThinking"])])]),K(ar,{name:"drawer"},{default:Ct(()=>[C.value?(y(),He(dx,{key:0,client:n.client,onRefreshGit:oe[4]||(oe[4]=ke=>n.client.fetchGitStatus()),onClose:oe[5]||(oe[5]=ke=>C.value=!1)},null,8,["client"])):B("",!0)]),_:1})]),R.value?(y(),He(yv,{key:0,mode:P.value,status:re(i),"session-id":re(a),"work-dir":re(c),onClose:oe[6]||(oe[6]=ke=>R.value=!1)},null,8,["mode","status","session-id","work-dir"])):B("",!0)]))}}),yx=Se(vx,[["__scopeId","data-v-fc80feee"]]),bx={class:"settings"},kx={class:"settings-inner"},wx={class:"settings-section"},_x={class:"theme-grid",role:"radiogroup","aria-label":"主题"},Sx=["aria-checked","onClick"],xx={class:"settings-section"},Cx={class:"like-fields"},$x={class:"like-label"},Tx=["onUpdate:modelValue","placeholder","aria-label"],Ax={class:"like-actions"},Rx={key:0,class:"saved-hint"},Ex=_e({__name:"SettingsView",props:{like:{default:()=>({})}},emits:["update-like"],setup(e,{emit:t}){const n=e,s=t,o=mn("theme",N("system")),r=mn("setTheme",()=>{}),l=[{id:"light",label:"浅色",icon:"sun"},{id:"dark",label:"深色",icon:"moon"},{id:"system",label:"跟随系统",icon:"monitor"}],i=N({...n.like}),a=N(!1);Le(()=>n.like,h=>{i.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",d()),a.value=!0,setTimeout(()=>a.value=!1,1500)}function d(){const h={};for(const p of c){const g=i.value[p.key];typeof g=="string"&&g.trim()&&(h[p.key]=g.trim())}return h}return(h,p)=>(y(),b("div",bx,[f("div",kx,[p[3]||(p[3]=f("h1",{class:"settings-title"},"设置",-1)),f("section",wx,[p[0]||(p[0]=f("h2",{class:"section-title"},"外观",-1)),f("div",_x,[(y(),b(X,null,Ve(l,g=>f("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)},[K(ye,{name:g.icon,size:20},null,8,["name"]),f("span",null,I(g.label),1)],10,Sx)),64))])]),f("section",xx,[p[2]||(p[2]=f("h2",{class:"section-title"},"偏好设置",-1)),f("div",Cx,[(y(),b(X,null,Ve(c,g=>f("label",{key:g.key,class:"like-field"},[f("span",$x,I(g.label),1),Ze(f("input",{"onUpdate:modelValue":_=>i.value[g.key]=_,class:"like-input",placeholder:g.hint,"aria-label":g.label},null,8,Tx),[[ct,i.value[g.key]]])])),64)),f("div",Ax,[K(Jn,{variant:"primary",onClick:u},{default:Ct(()=>[...p[1]||(p[1]=[$e("保存偏好",-1)])]),_:1}),a.value?(y(),b("span",Rx,"已保存")):B("",!0)])])])])]))}}),Ix=Se(Ex,[["__scopeId","data-v-701eb9cd"]]),tf=""+new URL("logo-v2-ChmPAIbI.svg",import.meta.url).href,Px={class:"sidebar-head"},Mx=["src"],Lx=["title","aria-label","aria-expanded"],Nx=["title"],Ox={key:0},Dx={key:0,class:"side-search"},Bx={class:"spaces"},jx=["title"],Ux=["title","onClick"],Gx={class:"space-name"},Fx={class:"space-count"},zx={key:0,class:"space-sessions"},Hx=["title","onClick"],qx={class:"session-title"},Vx={class:"session-meta"},Wx=["title","onClick","onKeydown"],Kx={key:0,class:"spaces-empty"},Zx={class:"sidebar-foot","aria-label":"功能区"},Jx=["title"],Yx={key:0},Qx=["title"],Xx={key:0},eC={class:"sidebar-identity"},tC={key:0,class:"identity-text"},nC=_e({__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),l=N("");function i(){var k,w;(k=r.value)==null||k.focus(),(w=r.value)==null||w.select()}t({focusSearch:i});const a=Y(()=>{const k=l.value.trim().toLowerCase();return k?s.sessions.filter(w=>_(w).toLowerCase().includes(k)||w.workDir.toLowerCase().includes(k)):s.sessions}),c=Y(()=>{var x;const k=new Map;for(const $ of a.value){const A=$.workDir||"默认空间",F=A.split(/[\\/]/).filter(Boolean),Q=F.length>0?F[F.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 F,Q;return $.workDir===w?-1:A.workDir===w?1:(((F=A.items[0])==null?void 0:F.createdAt)??0)-(((Q=$.items[0])==null?void 0:Q.createdAt)??0)})}),u=N(new Set);function d(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}])},[f("div",Px,[f("button",{class:"sidebar-brand",title:"回到新对话",onClick:w[0]||(w[0]=x=>o("navigate","home"))},[f("img",{class:"brand-logo",src:re(tf),alt:"scream"},null,8,Mx)]),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"))},[K(ye,{name:"panel-left",size:15})],10,Lx)):B("",!0)]),f("button",{class:"new-chat-btn",title:e.collapsed?"新建对话":void 0,onClick:w[2]||(w[2]=x=>o("create-session"))},[K(ye,{name:"plus",size:16}),e.collapsed?B("",!0):(y(),b("span",Ox,"新建对话"))],8,Nx),e.collapsed?B("",!0):(y(),b("label",Dx,[K(ye,{name:"search",size:15}),Ze(f("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":w[3]||(w[3]=x=>l.value=x),type:"text",placeholder:"搜索会话… (⌘K)","aria-label":"搜索会话",spellcheck:"false"},null,512),[[ct,l.value]])])),f("div",Bx,[(y(!0),b(X,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,jx)):(y(),b(X,{key:1},[f("button",{class:"space-head",title:x.workDir,onClick:$=>d(x.name)},[K(ye,{name:u.value.has(x.name)?"chevron-right":"chevron-down",size:14},null,8,["name"]),f("span",Gx,I(x.name),1),f("span",Fx,I(x.items.length),1)],8,Ux),u.value.has(x.name)?B("",!0):(y(),b("div",zx,[(y(!0),b(X,null,Ve(x.items,$=>(y(),b("button",{key:$.sessionId,class:fe(["session-item",{active:$.sessionId===e.currentSessionId}]),title:_($),onClick:A=>h($.sessionId)},[f("span",qx,I(_($)),1),f("span",Vx,I(g($.createdAt)),1),f("span",{class:"session-delete",role:"button",tabindex:"0",title:`删除会话 ${_($)}`,"aria-label":"删除会话",onClick:Tt(A=>p($.sessionId,_($)),["stop"]),onKeydown:Os(Tt(A=>p($.sessionId,_($)),["stop","prevent"]),["enter"])},[K(ye,{name:"trash",size:14})],40,Wx)],10,Hx))),128))]))],64))]))),128)),!e.collapsed&&c.value.length===0?(y(),b("p",Kx,I(l.value?"没有匹配的会话":"还没有会话,点击上方「新建对话」开始"),1)):B("",!0)]),f("nav",Zx,[f("button",{class:fe(["foot-item",{active:e.view==="skills"}]),title:e.collapsed?"技能中心":void 0,onClick:w[5]||(w[5]=x=>o("navigate","skills"))},[K(ye,{name:"sparkles",size:17}),e.collapsed?B("",!0):(y(),b("span",Yx,"技能中心"))],10,Jx),f("button",{class:fe(["foot-item",{active:e.view==="settings"}]),title:e.collapsed?"设置":void 0,onClick:w[6]||(w[6]=x=>o("navigate","settings"))},[K(ye,{name:"settings",size:17}),e.collapsed?B("",!0):(y(),b("span",Xx,"设置"))],10,Qx),f("div",eC,[w[7]||(w[7]=f("span",{class:"identity-dot","aria-hidden":"true"},null,-1)),e.collapsed?B("",!0):(y(),b("span",tC,"scream web"))])])],2))}}),Ea=Se(nC,[["__scopeId","data-v-07fe8803"]]),sC={class:"skills"},oC={class:"skills-head"},rC={class:"skills-grid"},lC={class:"skill-card-head"},iC={class:"skill-cmd"},aC={class:"skill-desc"},cC={key:0,class:"skill-aliases"},uC=_e({__name:"SkillsView",emits:["create"],setup(e,{emit:t}){const n=t,s={backend:"服务端",local:"本地"};return(o,r)=>(y(),b("div",sC,[f("div",oC,[r[2]||(r[2]=f("div",null,[f("h1",{class:"skills-title"},"技能中心"),f("p",{class:"skills-sub"},[$e("在输入框中输入 "),f("code",null,"/"),$e(" 即可触发以下命令")])],-1)),K(Jn,{variant:"primary",onClick:r[0]||(r[0]=l=>n("create"))},{default:Ct(()=>[K(ye,{name:"plus",size:16}),r[1]||(r[1]=$e(" 新建会话 ",-1))]),_:1})]),f("div",rC,[(y(!0),b(X,null,Ve(re(cr),l=>{var i;return y(),b("article",{key:l.name,class:"skill-card"},[f("div",lC,[f("span",iC,"/"+I(l.name),1),f("span",{class:fe(["skill-target",`target-${l.target}`])},I(s[l.target]),3)]),f("p",aC,I(l.description),1),(i=l.aliases)!=null&&i.length?(y(),b("p",cC," 别名:"+I(l.aliases.map(a=>`/${a}`).join(" ")),1)):B("",!0)])}),128))])]))}}),fC=Se(uC,[["__scopeId","data-v-35313e25"]]),dC={class:"mode-switch",role:"group","aria-label":"工作模式"},hC=["aria-pressed","onClick"],pC=_e({__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",dC,[(y(),b(X,null,Ve(s,l=>f("button",{key:l.id,class:fe(["mode-pill",`is-${l.id}`,{active:e.modelValue===l.id}]),"aria-pressed":e.modelValue===l.id,onClick:i=>n("update:modelValue",l.id)},I(l.label),11,hC)),64))]))}}),gC=Se(pC,[["__scopeId","data-v-c4ac7862"]]),mC={class:"workspace"},vC={class:"workspace-hero"},yC={class:"workspace-brand"},bC=["src"],kC={class:"mode-hint"},wC={class:"workspace-composer"},_C=_e({__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=Y(()=>n.mode==="goal"),r=Y(()=>o.value?"任务模式:提交后将创建执行目标(Goal),Agent 持续执行到完成或预算耗尽;抽屉「Goal 管理」可查看与暂停。":"直接对话:提问后 Agent 按需调用工具完成你的请求。");return(l,i)=>(y(),b("div",mC,[f("section",vC,[f("h1",yC,[f("img",{class:"brand-logo",src:re(tf),alt:"scream"},null,8,bC)]),i[5]||(i[5]=f("p",{class:"workspace-tagline"},"你的智能协作伙伴",-1)),K(gC,{class:"workspace-mode","model-value":n.mode,"onUpdate:modelValue":i[0]||(i[0]=a=>s("update:mode",a))},null,8,["model-value"]),f("p",kC,[(y(),b("span",{key:String(o.value),class:"hint-fade"},I(r.value),1))])]),f("section",wC,[K(ru,{busy:e.busy,status:e.status,models:e.models,variant:"home",placeholder:o.value?"描述你要完成的目标,Enter 创建并开始执行…":"输入 @ 引用知识库 / 使用技能 / 或者直接提问...",onSend:i[1]||(i[1]=a=>s("send",a,n.mode)),onCommand:i[2]||(i[2]=(a,c)=>s("command",a,c)),onSwitchModel:i[3]||(i[3]=a=>s("switch-model",a)),onSwitchThinking:i[4]||(i[4]=a=>s("switch-thinking",a))},null,8,["busy","status","models","placeholder"])])]))}}),SC=Se(_C,[["__scopeId","data-v-2f5f04ab"]]),xC={key:1,class:"sidebar-mobile"},CC={class:"canvas"},$C={class:"topbar mobile-only"},TC={class:"topbar-left"},AC={key:0,class:"topbar-running",title:"Agent 运行中"},RC={class:"canvas-body"},Ia="scream-sidebar-collapsed",Pa="scream-workspace-mode",EC=_e({__name:"WebShell",setup(e){const t=Yp(),{connectionStatus:n,status:s,isBusy:o,sessions:r,currentSessionId:l,models:i,like:a,sendPrompt:c,sendCommand:u,appendSystemMessage:d,createSession:h,switchSession:p,deleteSession:g,switchModel:_,switchThinking:k,fetchLike:w,fetchGitStatus:x,abort:$}=t,A=N("home"),F=N(!1),Q=N(null);function C(le=8e3){return n.value==="connected"?Promise.resolve(!0):new Promise(oe=>{const ke=Date.now(),xe=window.setInterval(()=>{n.value==="connected"?(window.clearInterval(xe),oe(!0)):Date.now()-ke>le&&(window.clearInterval(xe),oe(!1))},80)})}function R(le){le==="chat"?l.value?A.value="chat":P():A.value=le,F.value=!1}function P(){F.value=!1,A.value="chat",h()}async function Z(le,oe){if(F.value=!1,l.value||await h(),!!await C())if(A.value="chat",oe==="goal")try{await t.createGoal({objective:le,budgets:[]})}catch(xe){d(`Goal 创建失败:${ie(xe)}。已保留对话模式,可重新发送。`),c(le);return}else c(le)}function ie(le){return le instanceof Error?le.message:String(le)}function z(le){F.value=!1,A.value="chat",p(le)}function ge(le,oe){switch(le){case"compact":case"auto":case"yes":case"plan":case"fork":case"title":case"btw":if(!l.value){h().then(()=>u(le,oe));return}u(le,oe);break;case"clear":t.clearMessages();break;case"new":P();break;case"help":d(su());break;case"model":d(`当前模型:${s.value.model??"unknown"}`);break;case"status":case"usage":d("请在对话页查看会话详情");break;default:d(`未知命令:/${le}`)}}const O=N(!1);try{O.value=localStorage.getItem(Ia)==="1"}catch{}function L(){O.value=!O.value;try{localStorage.setItem(Ia,O.value?"1":"0")}catch{}}function te(){try{return localStorage.getItem(Pa)==="goal"?"goal":"chat"}catch{return"chat"}}const ee=N(te());function ve(le){ee.value=le;try{localStorage.setItem(Pa,le)}catch{}}function Re(le){if((le.metaKey||le.ctrlKey)&&le.key==="k")le.preventDefault(),O.value&&L(),Lt(()=>{var oe;return(oe=Q.value)==null?void 0:oe.focusSearch()});else if((le.metaKey||le.ctrlKey)&&le.key==="n")le.preventDefault(),P();else if(le.key==="Escape"&&o.value){const oe=le.target;oe&&(oe.tagName==="TEXTAREA"||oe.tagName==="INPUT")||(le.preventDefault(),$())}}return Bt(()=>{window.addEventListener("keydown",Re),w(),x()}),Ht(()=>window.removeEventListener("keydown",Re)),(le,oe)=>(y(),b("div",{class:fe(["shell",{"sidebar-collapsed":O.value}])},[K(Ea,{ref_key:"sidebarRef",ref:Q,view:A.value,sessions:re(r),"current-session-id":re(l),collapsed:O.value,onNavigate:R,onSwitchSession:z,onDeleteSession:re(g),onCreateSession:P,onToggleCollapse:L},null,8,["view","sessions","current-session-id","collapsed","onDeleteSession"]),F.value?(y(),b("div",{key:0,class:"sidebar-backdrop","aria-hidden":"true",onClick:oe[0]||(oe[0]=ke=>F.value=!1)})):B("",!0),F.value?(y(),b("div",xC,[K(Ea,{view:A.value,sessions:re(r),"current-session-id":re(l),"show-collapse-toggle":!1,onNavigate:R,onSwitchSession:z,onDeleteSession:re(g),onCreateSession:P},null,8,["view","sessions","current-session-id","onDeleteSession"])])):B("",!0),f("main",CC,[f("header",$C,[f("div",TC,[f("button",{class:"topbar-icon mobile-menu",title:"菜单","aria-label":"打开菜单",onClick:oe[1]||(oe[1]=ke=>F.value=!0)},[K(ye,{name:"menu",size:20})]),re(o)?(y(),b("span",AC,[...oe[3]||(oe[3]=[f("span",{class:"running-dot","aria-hidden":"true"},null,-1),f("span",{class:"running-text"},"运行中",-1)])])):B("",!0)])]),f("div",RC,[A.value==="home"?(y(),He(SC,{key:0,models:re(i),status:re(s),busy:re(o),mode:ee.value,"onUpdate:mode":ve,onSend:Z,onCommand:ge,onSwitchModel:re(_),onSwitchThinking:re(k)},null,8,["models","status","busy","mode","onSwitchModel","onSwitchThinking"])):A.value==="chat"?(y(),He(yx,{key:1,client:re(t),onHome:oe[2]||(oe[2]=ke=>A.value="home")},null,8,["client"])):A.value==="skills"?(y(),He(fC,{key:2,onCreate:P})):A.value==="settings"?(y(),He(Ix,{key:3,like:re(a),onUpdateLike:re(t).updateLike},null,8,["like","onUpdateLike"])):B("",!0)])])],2))}}),IC=Se(EC,[["__scopeId","data-v-7e9d5760"]]),PC={class:"toast-container"},MC=["onClick"],LC={class:"toast-icon"},NC={class:"toast-msg"},OC=_e({__name:"Toast",setup(e){const{toasts:t,removeToast:n}=nu(),s={info:"ℹ",success:"✓",error:"✗",warning:"⚠"};return(o,r)=>(y(),He(Il,{to:"body"},[f("div",PC,[K(Tp,{name:"toast"},{default:Ct(()=>[(y(!0),b(X,null,Ve(re(t),l=>(y(),b("div",{key:l.id,class:fe(["toast",`toast--${l.type}`]),onClick:i=>re(n)(l.id)},[f("span",LC,I(s[l.type]),1),f("span",NC,I(l.message),1)],10,MC))),128))]),_:1})])]))}}),DC=Se(OC,[["__scopeId","data-v-a432e638"]]),BC={class:"app"},jC=_e({__name:"App",setup(e){const t=N("system"),n=N("dark");ho("effectiveTheme",n),ho("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 d=document.querySelector('meta[name="theme-color"]');d&&d.setAttribute("content",s[u])}let r=null;function l(a){t.value=a;try{localStorage.setItem("scream-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)}ho("setTheme",l),Bt(()=>{try{const a=localStorage.getItem("scream-theme");(a==="light"||a==="dark"||a==="system")&&(t.value=a)}catch{}o()}),Le(t,o);const i=window.matchMedia("(prefers-color-scheme: dark)");return i.addEventListener("change",o),Ht(()=>{i.removeEventListener("change",o),r!==null&&clearTimeout(r),document.documentElement.classList.remove("theme-transition")}),(a,c)=>(y(),b("div",BC,[K(IC),K(DC)]))}}),UC=Se(jC,[["__scopeId","data-v-f4ac7b91"]]);Bp(UC).mount("#app");
|
|
93
|
-
//# sourceMappingURL=index-B9I4PIWR.js.map
|