neoctl-web 0.1.11 → 0.1.13
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/dist/assets/{index-BbUoWpPT.css → index-9hY14np_.css} +1 -1
- package/dist/assets/index-BnJuxSfa.js +121 -0
- package/dist/index.html +2 -2
- package/package.json +2 -2
- package/plugins/downloads/index.mjs +1 -0
- package/server.mjs +1 -0
- package/tool-settings.mjs +16 -9
- package/dist/assets/index-DZgO3hdD.js +0 -121
- package/plugins/xhs-artifact/OBS-12.md +0 -65
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
var Rm=Object.defineProperty;var Nm=(e,t,n)=>t in e?Rm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var De=(e,t,n)=>Nm(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"]'))r(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();/**
|
|
2
|
-
* @vue/shared v3.5.34
|
|
3
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
-
* @license MIT
|
|
5
|
-
**/function pl(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ue={},Rs=[],nn=()=>{},Wd=()=>!1,ho=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),po=e=>e.startsWith("onUpdate:"),st=Object.assign,ml=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Om=Object.prototype.hasOwnProperty,Le=(e,t)=>Om.call(e,t),_e=Array.isArray,Ns=e=>Hr(e)==="[object Map]",Fs=e=>Hr(e)==="[object Set]",Eu=e=>Hr(e)==="[object Date]",xe=e=>typeof e=="function",Ke=e=>typeof e=="string",sn=e=>typeof e=="symbol",$e=e=>e!==null&&typeof e=="object",Kd=e=>($e(e)||xe(e))&&xe(e.then)&&xe(e.catch),Gd=Object.prototype.toString,Hr=e=>Gd.call(e),Lm=e=>Hr(e).slice(8,-1),Vd=e=>Hr(e)==="[object Object]",bl=e=>Ke(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Sr=pl(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),mo=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Pm=/-\w/g,wt=mo(e=>e.replace(Pm,t=>t.slice(1).toUpperCase())),$m=/\B([A-Z])/g,Fn=mo(e=>e.replace($m,"-$1").toLowerCase()),bo=mo(e=>e.charAt(0).toUpperCase()+e.slice(1)),wa=mo(e=>e?`on${bo(e)}`:""),tn=(e,t)=>!Object.is(e,t),ji=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},qd=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},yo=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Dm=e=>{const t=Ke(e)?Number(e):NaN;return isNaN(t)?e:t};let Tu;const ko=()=>Tu||(Tu=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Nt(e){if(_e(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],o=Ke(r)?zm(r):Nt(r);if(o)for(const a in o)t[a]=o[a]}return t}else if(Ke(e)||$e(e))return e}const Bm=/;(?![^(]*\))/g,Um=/:([^]+)/,Fm=/\/\*[^]*?\*\//g;function zm(e){const t={};return e.replace(Fm,"").split(Bm).forEach(n=>{if(n){const r=n.split(Um);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function ge(e){let t="";if(Ke(e))t=e;else if(_e(e))for(let n=0;n<e.length;n++){const r=ge(e[n]);r&&(t+=r+" ")}else if($e(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Hm="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",jm=pl(Hm);function Zd(e){return!!e||e===""}function Wm(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Dn(e[r],t[r]);return n}function Dn(e,t){if(e===t)return!0;let n=Eu(e),r=Eu(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=sn(e),r=sn(t),n||r)return e===t;if(n=_e(e),r=_e(t),n||r)return n&&r?Wm(e,t):!1;if(n=$e(e),r=$e(t),n||r){if(!n||!r)return!1;const o=Object.keys(e).length,a=Object.keys(t).length;if(o!==a)return!1;for(const c in e){const u=e.hasOwnProperty(c),d=t.hasOwnProperty(c);if(u&&!d||!u&&d||!Dn(e[c],t[c]))return!1}}return String(e)===String(t)}function yl(e,t){return e.findIndex(n=>Dn(n,t))}const Qd=e=>!!(e&&e.__v_isRef===!0),C=e=>Ke(e)?e:e==null?"":_e(e)||$e(e)&&(e.toString===Gd||!xe(e.toString))?Qd(e)?C(e.value):JSON.stringify(e,Yd,2):String(e),Yd=(e,t)=>Qd(t)?Yd(e,t.value):Ns(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,o],a)=>(n[va(r,a)+" =>"]=o,n),{})}:Fs(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>va(n))}:sn(t)?va(t):$e(t)&&!_e(t)&&!Vd(t)?String(t):t,va=(e,t="")=>{var n;return sn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
|
6
|
-
* @vue/reactivity v3.5.34
|
|
7
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8
|
-
* @license MIT
|
|
9
|
-
**/let tt;class Km{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&&tt&&(tt.active?(this.parent=tt,this.index=(tt.scopes||(tt.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)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[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)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=tt;try{return tt=this,t()}finally{tt=n}}}on(){++this._on===1&&(this.prevScope=tt,tt=this)}off(){if(this._on>0&&--this._on===0){if(tt===this)tt=this.prevScope;else{let t=tt;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,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[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 Gm(){return tt}function Vm(e,t=!1){tt&&tt.cleanups.push(e)}let He;const xa=new WeakSet;class Jd{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,tt&&(tt.active?tt.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,xa.has(this)&&(xa.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ef(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Au(this),tf(this);const t=He,n=zt;He=this,zt=!0;try{return this.fn()}finally{nf(this),He=t,zt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)wl(t);this.deps=this.depsTail=void 0,Au(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?xa.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ka(this)&&this.run()}get dirty(){return Ka(this)}}let Xd=0,Er,Tr;function ef(e,t=!1){if(e.flags|=8,t){e.next=Tr,Tr=e;return}e.next=Er,Er=e}function kl(){Xd++}function _l(){if(--Xd>0)return;if(Tr){let t=Tr;for(Tr=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Er;){let t=Er;for(Er=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function tf(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function nf(e){let t,n=e.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),wl(r),qm(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function Ka(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(sf(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function sf(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Lr)||(e.globalVersion=Lr,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ka(e))))return;e.flags|=2;const t=e.dep,n=He,r=zt;He=e,zt=!0;try{tf(e);const o=e.fn(e._value);(t.version===0||tn(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{He=n,zt=r,nf(e),e.flags&=-3}}function wl(e,t=!1){const{dep:n,prevSub:r,nextSub:o}=e;if(r&&(r.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let a=n.computed.deps;a;a=a.nextDep)wl(a,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function qm(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let zt=!0;const rf=[];function yn(){rf.push(zt),zt=!1}function kn(){const e=rf.pop();zt=e===void 0?!0:e}function Au(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=He;He=void 0;try{t()}finally{He=n}}}let Lr=0;class Zm{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 vl{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(!He||!zt||He===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==He)n=this.activeLink=new Zm(He,this),He.deps?(n.prevDep=He.depsTail,He.depsTail.nextDep=n,He.depsTail=n):He.deps=He.depsTail=n,of(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=He.depsTail,n.nextDep=void 0,He.depsTail.nextDep=n,He.depsTail=n,He.deps===n&&(He.deps=r)}return n}trigger(t){this.version++,Lr++,this.notify(t)}notify(t){kl();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{_l()}}}function of(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)of(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Ga=new WeakMap,as=Symbol(""),Va=Symbol(""),Pr=Symbol("");function lt(e,t,n){if(zt&&He){let r=Ga.get(e);r||Ga.set(e,r=new Map);let o=r.get(n);o||(r.set(n,o=new vl),o.map=r,o.key=n),o.track()}}function pn(e,t,n,r,o,a){const c=Ga.get(e);if(!c){Lr++;return}const u=d=>{d&&d.trigger()};if(kl(),t==="clear")c.forEach(u);else{const d=_e(e),m=d&&bl(n);if(d&&n==="length"){const p=Number(r);c.forEach((y,_)=>{(_==="length"||_===Pr||!sn(_)&&_>=p)&&u(y)})}else switch((n!==void 0||c.has(void 0))&&u(c.get(n)),m&&u(c.get(Pr)),t){case"add":d?m&&u(c.get("length")):(u(c.get(as)),Ns(e)&&u(c.get(Va)));break;case"delete":d||(u(c.get(as)),Ns(e)&&u(c.get(Va)));break;case"set":Ns(e)&&u(c.get(as));break}}_l()}function Ss(e){const t=Ne(e);return t===e?t:(lt(t,"iterate",Pr),Ot(e)?t:t.map(Ht))}function _o(e){return lt(e=Ne(e),"iterate",Pr),e}function Xt(e,t){return _n(e)?$s(cs(e)?Ht(t):t):Ht(t)}const Qm={__proto__:null,[Symbol.iterator](){return Sa(this,Symbol.iterator,e=>Xt(this,e))},concat(...e){return Ss(this).concat(...e.map(t=>_e(t)?Ss(t):t))},entries(){return Sa(this,"entries",e=>(e[1]=Xt(this,e[1]),e))},every(e,t){return un(this,"every",e,t,void 0,arguments)},filter(e,t){return un(this,"filter",e,t,n=>n.map(r=>Xt(this,r)),arguments)},find(e,t){return un(this,"find",e,t,n=>Xt(this,n),arguments)},findIndex(e,t){return un(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return un(this,"findLast",e,t,n=>Xt(this,n),arguments)},findLastIndex(e,t){return un(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return un(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ea(this,"includes",e)},indexOf(...e){return Ea(this,"indexOf",e)},join(e){return Ss(this).join(e)},lastIndexOf(...e){return Ea(this,"lastIndexOf",e)},map(e,t){return un(this,"map",e,t,void 0,arguments)},pop(){return cr(this,"pop")},push(...e){return cr(this,"push",e)},reduce(e,...t){return Cu(this,"reduce",e,t)},reduceRight(e,...t){return Cu(this,"reduceRight",e,t)},shift(){return cr(this,"shift")},some(e,t){return un(this,"some",e,t,void 0,arguments)},splice(...e){return cr(this,"splice",e)},toReversed(){return Ss(this).toReversed()},toSorted(e){return Ss(this).toSorted(e)},toSpliced(...e){return Ss(this).toSpliced(...e)},unshift(...e){return cr(this,"unshift",e)},values(){return Sa(this,"values",e=>Xt(this,e))}};function Sa(e,t,n){const r=_o(e),o=r[t]();return r!==e&&!Ot(e)&&(o._next=o.next,o.next=()=>{const a=o._next();return a.done||(a.value=n(a.value)),a}),o}const Ym=Array.prototype;function un(e,t,n,r,o,a){const c=_o(e),u=c!==e&&!Ot(e),d=c[t];if(d!==Ym[t]){const y=d.apply(e,a);return u?Ht(y):y}let m=n;c!==e&&(u?m=function(y,_){return n.call(this,Xt(e,y),_,e)}:n.length>2&&(m=function(y,_){return n.call(this,y,_,e)}));const p=d.call(c,m,r);return u&&o?o(p):p}function Cu(e,t,n,r){const o=_o(e),a=o!==e&&!Ot(e);let c=n,u=!1;o!==e&&(a?(u=r.length===0,c=function(m,p,y){return u&&(u=!1,m=Xt(e,m)),n.call(this,m,Xt(e,p),y,e)}):n.length>3&&(c=function(m,p,y){return n.call(this,m,p,y,e)}));const d=o[t](c,...r);return u?Xt(e,d):d}function Ea(e,t,n){const r=Ne(e);lt(r,"iterate",Pr);const o=r[t](...n);return(o===-1||o===!1)&&El(n[0])?(n[0]=Ne(n[0]),r[t](...n)):o}function cr(e,t,n=[]){yn(),kl();const r=Ne(e)[t].apply(e,n);return _l(),kn(),r}const Jm=pl("__proto__,__v_isRef,__isVue"),af=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(sn));function Xm(e){sn(e)||(e=String(e));const t=Ne(this);return lt(t,"has",e),t.hasOwnProperty(e)}class lf{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,a=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return a;if(n==="__v_raw")return r===(o?a?cb:ff:a?df:uf).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const c=_e(t);if(!o){let d;if(c&&(d=Qm[n]))return d;if(n==="hasOwnProperty")return Xm}const u=Reflect.get(t,n,ft(t)?t:r);if((sn(n)?af.has(n):Jm(n))||(o||lt(t,"get",n),a))return u;if(ft(u)){const d=c&&bl(n)?u:u.value;return o&&$e(d)?Za(d):d}return $e(u)?o?Za(u):ls(u):u}}class cf extends lf{constructor(t=!1){super(!1,t)}set(t,n,r,o){let a=t[n];const c=_e(t)&&bl(n);if(!this._isShallow){const m=_n(a);if(!Ot(r)&&!_n(r)&&(a=Ne(a),r=Ne(r)),!c&&ft(a)&&!ft(r))return m||(a.value=r),!0}const u=c?Number(n)<t.length:Le(t,n),d=Reflect.set(t,n,r,ft(t)?t:o);return t===Ne(o)&&(u?tn(r,a)&&pn(t,"set",n,r):pn(t,"add",n,r)),d}deleteProperty(t,n){const r=Le(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&r&&pn(t,"delete",n,void 0),o}has(t,n){const r=Reflect.has(t,n);return(!sn(n)||!af.has(n))&<(t,"has",n),r}ownKeys(t){return lt(t,"iterate",_e(t)?"length":as),Reflect.ownKeys(t)}}class eb extends lf{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const tb=new cf,nb=new eb,sb=new cf(!0);const qa=e=>e,Mi=e=>Reflect.getPrototypeOf(e);function rb(e,t,n){return function(...r){const o=this.__v_raw,a=Ne(o),c=Ns(a),u=e==="entries"||e===Symbol.iterator&&c,d=e==="keys"&&c,m=o[e](...r),p=n?qa:t?$s:Ht;return!t&<(a,"iterate",d?Va:as),st(Object.create(m),{next(){const{value:y,done:_}=m.next();return _?{value:y,done:_}:{value:u?[p(y[0]),p(y[1])]:p(y),done:_}}})}}function Ri(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function ib(e,t){const n={get(o){const a=this.__v_raw,c=Ne(a),u=Ne(o);e||(tn(o,u)&<(c,"get",o),lt(c,"get",u));const{has:d}=Mi(c),m=t?qa:e?$s:Ht;if(d.call(c,o))return m(a.get(o));if(d.call(c,u))return m(a.get(u));a!==c&&a.get(o)},get size(){const o=this.__v_raw;return!e&<(Ne(o),"iterate",as),o.size},has(o){const a=this.__v_raw,c=Ne(a),u=Ne(o);return e||(tn(o,u)&<(c,"has",o),lt(c,"has",u)),o===u?a.has(o):a.has(o)||a.has(u)},forEach(o,a){const c=this,u=c.__v_raw,d=Ne(u),m=t?qa:e?$s:Ht;return!e&<(d,"iterate",as),u.forEach((p,y)=>o.call(a,m(p),m(y),c))}};return st(n,e?{add:Ri("add"),set:Ri("set"),delete:Ri("delete"),clear:Ri("clear")}:{add(o){const a=Ne(this),c=Mi(a),u=Ne(o),d=!t&&!Ot(o)&&!_n(o)?u:o;return c.has.call(a,d)||tn(o,d)&&c.has.call(a,o)||tn(u,d)&&c.has.call(a,u)||(a.add(d),pn(a,"add",d,d)),this},set(o,a){!t&&!Ot(a)&&!_n(a)&&(a=Ne(a));const c=Ne(this),{has:u,get:d}=Mi(c);let m=u.call(c,o);m||(o=Ne(o),m=u.call(c,o));const p=d.call(c,o);return c.set(o,a),m?tn(a,p)&&pn(c,"set",o,a):pn(c,"add",o,a),this},delete(o){const a=Ne(this),{has:c,get:u}=Mi(a);let d=c.call(a,o);d||(o=Ne(o),d=c.call(a,o)),u&&u.call(a,o);const m=a.delete(o);return d&&pn(a,"delete",o,void 0),m},clear(){const o=Ne(this),a=o.size!==0,c=o.clear();return a&&pn(o,"clear",void 0,void 0),c}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=rb(o,e,t)}),n}function xl(e,t){const n=ib(e,t);return(r,o,a)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(Le(n,o)&&o in r?n:r,o,a)}const ob={get:xl(!1,!1)},ab={get:xl(!1,!0)},lb={get:xl(!0,!1)};const uf=new WeakMap,df=new WeakMap,ff=new WeakMap,cb=new WeakMap;function ub(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function db(e){return e.__v_skip||!Object.isExtensible(e)?0:ub(Lm(e))}function ls(e){return _n(e)?e:Sl(e,!1,tb,ob,uf)}function fb(e){return Sl(e,!1,sb,ab,df)}function Za(e){return Sl(e,!0,nb,lb,ff)}function Sl(e,t,n,r,o){if(!$e(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const a=db(e);if(a===0)return e;const c=o.get(e);if(c)return c;const u=new Proxy(e,a===2?r:n);return o.set(e,u),u}function cs(e){return _n(e)?cs(e.__v_raw):!!(e&&e.__v_isReactive)}function _n(e){return!!(e&&e.__v_isReadonly)}function Ot(e){return!!(e&&e.__v_isShallow)}function El(e){return e?!!e.__v_raw:!1}function Ne(e){const t=e&&e.__v_raw;return t?Ne(t):e}function gb(e){return!Le(e,"__v_skip")&&Object.isExtensible(e)&&qd(e,"__v_skip",!0),e}const Ht=e=>$e(e)?ls(e):e,$s=e=>$e(e)?Za(e):e;function ft(e){return e?e.__v_isRef===!0:!1}function Be(e){return gf(e,!1)}function hb(e){return gf(e,!0)}function gf(e,t){return ft(e)?e:new pb(e,t)}class pb{constructor(t,n){this.dep=new vl,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Ne(t),this._value=n?t:Ht(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Ot(t)||_n(t);t=r?t:Ne(t),tn(t,n)&&(this._rawValue=t,this._value=r?t:Ht(t),this.dep.trigger())}}function Iu(e){e.dep&&e.dep.trigger()}function Ar(e){return ft(e)?e.value:e}const mb={get:(e,t,n)=>t==="__v_raw"?e:Ar(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return ft(o)&&!ft(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function hf(e){return cs(e)?e:new Proxy(e,mb)}class bb{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new vl(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Lr-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&He!==this)return ef(this,!0),!0}get value(){const t=this.dep.track();return sf(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function yb(e,t,n=!1){let r,o;return xe(e)?r=e:(r=e.get,o=e.set),new bb(r,o,n)}const Ni={},Qi=new WeakMap;let ss;function kb(e,t=!1,n=ss){if(n){let r=Qi.get(n);r||Qi.set(n,r=[]),r.push(e)}}function _b(e,t,n=Ue){const{immediate:r,deep:o,once:a,scheduler:c,augmentJob:u,call:d}=n,m=N=>o?N:Ot(N)||o===!1||o===0?mn(N,1):mn(N);let p,y,_,A,x=!1,O=!1;if(ft(e)?(y=()=>e.value,x=Ot(e)):cs(e)?(y=()=>m(e),x=!0):_e(e)?(O=!0,x=e.some(N=>cs(N)||Ot(N)),y=()=>e.map(N=>{if(ft(N))return N.value;if(cs(N))return m(N);if(xe(N))return d?d(N,2):N()})):xe(e)?t?y=d?()=>d(e,2):e:y=()=>{if(_){yn();try{_()}finally{kn()}}const N=ss;ss=p;try{return d?d(e,3,[A]):e(A)}finally{ss=N}}:y=nn,t&&o){const N=y,U=o===!0?1/0:o;y=()=>mn(N(),U)}const M=Gm(),D=()=>{p.stop(),M&&M.active&&ml(M.effects,p)};if(a&&t){const N=t;t=(...U)=>{N(...U),D()}}let l=O?new Array(e.length).fill(Ni):Ni;const R=N=>{if(!(!(p.flags&1)||!p.dirty&&!N))if(t){const U=p.run();if(o||x||(O?U.some((Z,se)=>tn(Z,l[se])):tn(U,l))){_&&_();const Z=ss;ss=p;try{const se=[U,l===Ni?void 0:O&&l[0]===Ni?[]:l,A];l=U,d?d(t,3,se):t(...se)}finally{ss=Z}}}else p.run()};return u&&u(R),p=new Jd(y),p.scheduler=c?()=>c(R,!1):R,A=N=>kb(N,!1,p),_=p.onStop=()=>{const N=Qi.get(p);if(N){if(d)d(N,4);else for(const U of N)U();Qi.delete(p)}},t?r?R(!0):l=p.run():c?c(R.bind(null,!0),!0):p.run(),D.pause=p.pause.bind(p),D.resume=p.resume.bind(p),D.stop=D,D}function mn(e,t=1/0,n){if(t<=0||!$e(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ft(e))mn(e.value,t,n);else if(_e(e))for(let r=0;r<e.length;r++)mn(e[r],t,n);else if(Fs(e)||Ns(e))e.forEach(r=>{mn(r,t,n)});else if(Vd(e)){for(const r in e)mn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&mn(e[r],t,n)}return e}/**
|
|
10
|
-
* @vue/runtime-core v3.5.34
|
|
11
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
|
-
* @license MIT
|
|
13
|
-
**/function jr(e,t,n,r){try{return r?e(...r):e()}catch(o){wo(o,t,n)}}function jt(e,t,n,r){if(xe(e)){const o=jr(e,t,n,r);return o&&Kd(o)&&o.catch(a=>{wo(a,t,n)}),o}if(_e(e)){const o=[];for(let a=0;a<e.length;a++)o.push(jt(e[a],t,n,r));return o}}function wo(e,t,n,r=!0){const o=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:c}=t&&t.appContext.config||Ue;if(t){let u=t.parent;const d=t.proxy,m=`https://vuejs.org/error-reference/#runtime-${n}`;for(;u;){const p=u.ec;if(p){for(let y=0;y<p.length;y++)if(p[y](e,d,m)===!1)return}u=u.parent}if(a){yn(),jr(a,null,10,[e,d,m]),kn();return}}wb(e,n,o,r,c)}function wb(e,t,n,r=!0,o=!1){if(o)throw e;console.error(e)}const _t=[];let Jt=-1;const Os=[];let Pn=null,Cs=0;const pf=Promise.resolve();let Yi=null;function kt(e){const t=Yi||pf;return e?t.then(this?e.bind(this):e):t}function vb(e){let t=Jt+1,n=_t.length;for(;t<n;){const r=t+n>>>1,o=_t[r],a=$r(o);a<e||a===e&&o.flags&2?t=r+1:n=r}return t}function Tl(e){if(!(e.flags&1)){const t=$r(e),n=_t[_t.length-1];!n||!(e.flags&2)&&t>=$r(n)?_t.push(e):_t.splice(vb(t),0,e),e.flags|=1,mf()}}function mf(){Yi||(Yi=pf.then(yf))}function xb(e){_e(e)?Os.push(...e):Pn&&e.id===-1?Pn.splice(Cs+1,0,e):e.flags&1||(Os.push(e),e.flags|=1),mf()}function Mu(e,t,n=Jt+1){for(;n<_t.length;n++){const r=_t[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;_t.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function bf(e){if(Os.length){const t=[...new Set(Os)].sort((n,r)=>$r(n)-$r(r));if(Os.length=0,Pn){Pn.push(...t);return}for(Pn=t,Cs=0;Cs<Pn.length;Cs++){const n=Pn[Cs];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Pn=null,Cs=0}}const $r=e=>e.id==null?e.flags&2?-1:1/0:e.id;function yf(e){try{for(Jt=0;Jt<_t.length;Jt++){const t=_t[Jt];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),jr(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Jt<_t.length;Jt++){const t=_t[Jt];t&&(t.flags&=-2)}Jt=-1,_t.length=0,bf(),Yi=null,(_t.length||Os.length)&&yf()}}let Et=null,kf=null;function Ji(e){const t=Et;return Et=e,kf=e&&e.type.__scopeId||null,t}function _f(e,t=Et,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&Wu(-1);const a=Ji(t);let c;try{c=e(...o)}finally{Ji(a),r._d&&Wu(1)}return c};return r._n=!0,r._c=!0,r._d=!0,r}function Mt(e,t){if(Et===null)return e;const n=Eo(Et),r=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[a,c,u,d=Ue]=t[o];a&&(xe(a)&&(a={mounted:a,updated:a}),a.deep&&mn(c),r.push({dir:a,instance:n,value:c,oldValue:void 0,arg:u,modifiers:d}))}return e}function es(e,t,n,r){const o=e.dirs,a=t&&t.dirs;for(let c=0;c<o.length;c++){const u=o[c];a&&(u.oldValue=a[c].value);let d=u.dir[r];d&&(yn(),jt(d,n,8,[e.el,u,e,t]),kn())}}function Sb(e,t){if(ut){let n=ut.provides;const r=ut.parent&&ut.parent.provides;r===n&&(n=ut.provides=Object.create(r)),n[e]=t}}function Wi(e,t,n=!1){const r=Zf();if(r||Ls){let o=Ls?Ls._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&xe(t)?t.call(r&&r.proxy):t}}const Eb=Symbol.for("v-scx"),Tb=()=>Wi(Eb);function nt(e,t,n){return wf(e,t,n)}function wf(e,t,n=Ue){const{immediate:r,deep:o,flush:a,once:c}=n,u=st({},n),d=t&&r||!t&&a!=="post";let m;if(Ur){if(a==="sync"){const A=Tb();m=A.__watcherHandles||(A.__watcherHandles=[])}else if(!d){const A=()=>{};return A.stop=nn,A.resume=nn,A.pause=nn,A}}const p=ut;u.call=(A,x,O)=>jt(A,p,x,O);let y=!1;a==="post"?u.scheduler=A=>{yt(A,p&&p.suspense)}:a!=="sync"&&(y=!0,u.scheduler=(A,x)=>{x?A():Tl(A)}),u.augmentJob=A=>{t&&(A.flags|=4),y&&(A.flags|=2,p&&(A.id=p.uid,A.i=p))};const _=_b(e,t,u);return Ur&&(m?m.push(_):d&&_()),_}function Ab(e,t,n){const r=this.proxy,o=Ke(e)?e.includes(".")?vf(r,e):()=>r[e]:e.bind(r,r);let a;xe(t)?a=t:(a=t.handler,n=t);const c=Kr(this),u=wf(o,a.bind(r),n);return c(),u}function vf(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o<n.length&&r;o++)r=r[n[o]];return r}}const Rn=new WeakMap,xf=Symbol("_vte"),Cb=e=>e.__isTeleport,rs=e=>e&&(e.disabled||e.disabled===""),Ib=e=>e&&(e.defer||e.defer===""),Ru=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Nu=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Qa=(e,t)=>{const n=e&&e.to;return Ke(n)?t?t(n):null:n},Mb={name:"Teleport",__isTeleport:!0,process(e,t,n,r,o,a,c,u,d,m){const{mc:p,pc:y,pbc:_,o:{insert:A,querySelector:x,createText:O,createComment:M,parentNode:D}}=m,l=rs(t.props);let{dynamicChildren:R}=t;const N=(se,oe,ne)=>{se.shapeFlag&16&&p(se.children,oe,ne,o,a,c,u,d)},U=(se=t)=>{const oe=rs(se.props),ne=se.target=Qa(se.props,x),de=Ya(ne,se,O,A);ne&&(c!=="svg"&&Ru(ne)?c="svg":c!=="mathml"&&Nu(ne)&&(c="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(ne),oe||(N(se,ne,de),pr(se,!1)))},Z=se=>{const oe=()=>{if(Rn.get(se)===oe){if(Rn.delete(se),rs(se.props)){const ne=D(se.el)||n;N(se,ne,se.anchor),pr(se,!0)}U(se)}};Rn.set(se,oe),yt(oe,a)};if(e==null){const se=t.el=O(""),oe=t.anchor=O("");if(A(se,n,r),A(oe,n,r),Ib(t.props)||a&&a.pendingBranch){Z(t);return}l&&(N(t,n,oe),pr(t,!0)),U()}else{t.el=e.el;const se=t.anchor=e.anchor,oe=Rn.get(e);if(oe){oe.flags|=8,Rn.delete(e),Z(t);return}t.targetStart=e.targetStart;const ne=t.target=e.target,de=t.targetAnchor=e.targetAnchor,ye=rs(e.props),Q=ye?n:ne,ke=ye?se:de;if(c==="svg"||Ru(ne)?c="svg":(c==="mathml"||Nu(ne))&&(c="mathml"),R?(_(e.dynamicChildren,R,Q,o,a,c,u),Il(e,t,!0)):d||y(e,t,Q,ke,o,a,c,u,!1),l)ye?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Oi(t,n,se,m,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Ee=t.target=Qa(t.props,x);Ee&&Oi(t,Ee,null,m,0)}else ye&&Oi(t,ne,de,m,1);pr(t,l)}},remove(e,t,n,{um:r,o:{remove:o}},a){const{shapeFlag:c,children:u,anchor:d,targetStart:m,targetAnchor:p,target:y,props:_}=e;let A=a||!rs(_);const x=Rn.get(e);if(x&&(x.flags|=8,Rn.delete(e),A=!1),y&&(o(m),o(p)),a&&o(d),c&16)for(let O=0;O<u.length;O++){const M=u[O];r(M,t,n,A,!!M.dynamicChildren)}},move:Oi,hydrate:Rb};function Oi(e,t,n,{o:{insert:r},m:o},a=2){a===0&&r(e.targetAnchor,t,n);const{el:c,anchor:u,shapeFlag:d,children:m,props:p}=e,y=a===2;if(y&&r(c,t,n),!Rn.has(e)&&(!y||rs(p))&&d&16)for(let _=0;_<m.length;_++)o(m[_],t,n,2);y&&r(u,t,n)}function Rb(e,t,n,r,o,a,{o:{nextSibling:c,parentNode:u,querySelector:d,insert:m,createText:p}},y){function _(M,D){let l=D;for(;l;){if(l&&l.nodeType===8){if(l.data==="teleport start anchor")t.targetStart=l;else if(l.data==="teleport anchor"){t.targetAnchor=l,M._lpa=t.targetAnchor&&c(t.targetAnchor);break}}l=c(l)}}function A(M,D){D.anchor=y(c(M),D,u(M),n,r,o,a)}const x=t.target=Qa(t.props,d),O=rs(t.props);if(x){const M=x._lpa||x.firstChild;t.shapeFlag&16&&(O?(A(e,t),_(x,M),t.targetAnchor||Ya(x,t,p,m,u(e)===x?e:null)):(t.anchor=c(e),_(x,M),t.targetAnchor||Ya(x,t,p,m),y(M&&c(M),t,x,n,r,o,a))),pr(t,O)}else O&&t.shapeFlag&16&&(A(e,t),t.targetStart=e,t.targetAnchor=c(e));return t.anchor&&c(t.anchor)}const Vt=Mb;function pr(e,t){const n=e.ctx;if(n&&n.ut){let r,o;for(t?(r=e.el,o=e.anchor):(r=e.targetStart,o=e.targetAnchor);r&&r!==o;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function Ya(e,t,n,r,o=null){const a=t.targetStart=n(""),c=t.targetAnchor=n("");return a[xf]=c,e&&(r(a,e,o),r(c,e,o)),c}const Nn=Symbol("_leaveCb"),ur=Symbol("_enterCb");function Nb(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Wr(()=>{e.isMounted=!0}),Bn(()=>{e.isUnmounting=!0}),e}const Rt=[Function,Array],Ob={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Rt,onEnter:Rt,onAfterEnter:Rt,onEnterCancelled:Rt,onBeforeLeave:Rt,onLeave:Rt,onAfterLeave:Rt,onLeaveCancelled:Rt,onBeforeAppear:Rt,onAppear:Rt,onAfterAppear:Rt,onAppearCancelled:Rt};function Lb(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Ja(e,t,n,r,o){const{appear:a,mode:c,persisted:u=!1,onBeforeEnter:d,onEnter:m,onAfterEnter:p,onEnterCancelled:y,onBeforeLeave:_,onLeave:A,onAfterLeave:x,onLeaveCancelled:O,onBeforeAppear:M,onAppear:D,onAfterAppear:l,onAppearCancelled:R}=t,N=String(e.key),U=Lb(n,e),Z=(ne,de)=>{ne&&jt(ne,r,9,de)},se=(ne,de)=>{const ye=de[1];Z(ne,de),_e(ne)?ne.every(Q=>Q.length<=1)&&ye():ne.length<=1&&ye()},oe={mode:c,persisted:u,beforeEnter(ne){let de=d;if(!n.isMounted)if(a)de=M||d;else return;ne[Nn]&&ne[Nn](!0);const ye=U[N];ye&&Is(e,ye)&&ye.el[Nn]&&ye.el[Nn](),Z(de,[ne])},enter(ne){if(U[N]===e)return;let de=m,ye=p,Q=y;if(!n.isMounted)if(a)de=D||m,ye=l||p,Q=R||y;else return;let ke=!1;ne[ur]=Ge=>{ke||(ke=!0,Ge?Z(Q,[ne]):Z(ye,[ne]),oe.delayedLeave&&oe.delayedLeave(),ne[ur]=void 0)};const Ee=ne[ur].bind(null,!1);de?se(de,[ne,Ee]):Ee()},leave(ne,de){const ye=String(e.key);if(ne[ur]&&ne[ur](!0),n.isUnmounting)return de();Z(_,[ne]);let Q=!1;ne[Nn]=Ee=>{Q||(Q=!0,de(),Ee?Z(O,[ne]):Z(x,[ne]),ne[Nn]=void 0,U[ye]===e&&delete U[ye])};const ke=ne[Nn].bind(null,!1);U[ye]=e,A?se(A,[ne,ke]):ke()},clone(ne){return Ja(ne,t,n,r)}};return oe}function Dr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Dr(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 Sf(e,t=!1,n){let r=[],o=0;for(let a=0;a<e.length;a++){let c=e[a];const u=n==null?c.key:String(n)+String(c.key!=null?c.key:a);c.type===ue?(c.patchFlag&128&&o++,r=r.concat(Sf(c.children,t,u))):(t||c.type!==wn)&&r.push(u!=null?ds(c,{key:u}):c)}if(o>1)for(let a=0;a<r.length;a++)r[a].patchFlag=-2;return r}function Ef(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Ou(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Xi=new WeakMap;function Cr(e,t,n,r,o=!1){if(_e(e)){e.forEach((O,M)=>Cr(O,t&&(_e(t)?t[M]:t),n,r,o));return}if(Ir(r)&&!o){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Cr(e,t,n,r.component.subTree);return}const a=r.shapeFlag&4?Eo(r.component):r.el,c=o?null:a,{i:u,r:d}=e,m=t&&t.r,p=u.refs===Ue?u.refs={}:u.refs,y=u.setupState,_=Ne(y),A=y===Ue?Wd:O=>Ou(p,O)?!1:Le(_,O),x=(O,M)=>!(M&&Ou(p,M));if(m!=null&&m!==d){if(Lu(t),Ke(m))p[m]=null,A(m)&&(y[m]=null);else if(ft(m)){const O=t;x(m,O.k)&&(m.value=null),O.k&&(p[O.k]=null)}}if(xe(d))jr(d,u,12,[c,p]);else{const O=Ke(d),M=ft(d);if(O||M){const D=()=>{if(e.f){const l=O?A(d)?y[d]:p[d]:x()||!e.k?d.value:p[e.k];if(o)_e(l)&&ml(l,a);else if(_e(l))l.includes(a)||l.push(a);else if(O)p[d]=[a],A(d)&&(y[d]=p[d]);else{const R=[a];x(d,e.k)&&(d.value=R),e.k&&(p[e.k]=R)}}else O?(p[d]=c,A(d)&&(y[d]=c)):M&&(x(d,e.k)&&(d.value=c),e.k&&(p[e.k]=c))};if(c){const l=()=>{D(),Xi.delete(e)};l.id=-1,Xi.set(e,l),yt(l,n)}else Lu(e),D()}}}function Lu(e){const t=Xi.get(e);t&&(t.flags|=8,Xi.delete(e))}ko().requestIdleCallback;ko().cancelIdleCallback;const Ir=e=>!!e.type.__asyncLoader,Tf=e=>e.type.__isKeepAlive;function Pb(e,t){Af(e,"a",t)}function $b(e,t){Af(e,"da",t)}function Af(e,t,n=ut){const r=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(vo(t,r,n),n){let o=n.parent;for(;o&&o.parent;)Tf(o.parent.vnode)&&Db(r,t,n,o),o=o.parent}}function Db(e,t,n,r){const o=vo(t,e,r,!0);If(()=>{ml(r[t],o)},n)}function vo(e,t,n=ut,r=!1){if(n){const o=n[e]||(n[e]=[]),a=t.__weh||(t.__weh=(...c)=>{yn();const u=Kr(n),d=jt(t,n,e,c);return u(),kn(),d});return r?o.unshift(a):o.push(a),a}}const vn=e=>(t,n=ut)=>{(!Ur||e==="sp")&&vo(e,(...r)=>t(...r),n)},Bb=vn("bm"),Wr=vn("m"),Ub=vn("bu"),Cf=vn("u"),Bn=vn("bum"),If=vn("um"),Fb=vn("sp"),zb=vn("rtg"),Hb=vn("rtc");function jb(e,t=ut){vo("ec",e,t)}const Wb="components";function Kb(e,t){return Vb(Wb,e,!0,t)||e}const Gb=Symbol.for("v-ndc");function Vb(e,t,n=!0,r=!1){const o=Et||ut;if(o){const a=o.type;{const u=Ry(a,!1);if(u&&(u===t||u===wt(t)||u===bo(wt(t))))return a}const c=Pu(o[e]||a[e],t)||Pu(o.appContext[e],t);return!c&&r?a:c}}function Pu(e,t){return e&&(e[t]||e[wt(t)]||e[bo(wt(t))])}function Te(e,t,n,r){let o;const a=n,c=_e(e);if(c||Ke(e)){const u=c&&cs(e);let d=!1,m=!1;u&&(d=!Ot(e),m=_n(e),e=_o(e)),o=new Array(e.length);for(let p=0,y=e.length;p<y;p++)o[p]=t(d?m?$s(Ht(e[p])):Ht(e[p]):e[p],p,void 0,a)}else if(typeof e=="number"){o=new Array(e);for(let u=0;u<e;u++)o[u]=t(u+1,u,void 0,a)}else if($e(e))if(e[Symbol.iterator])o=Array.from(e,(u,d)=>t(u,d,void 0,a));else{const u=Object.keys(e);o=new Array(u.length);for(let d=0,m=u.length;d<m;d++){const p=u[d];o[d]=t(e[p],p,d,a)}}else o=[];return o}const Xa=e=>e?Qf(e)?Eo(e):Xa(e.parent):null,Mr=st(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=>Xa(e.parent),$root:e=>Xa(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Rf(e),$forceUpdate:e=>e.f||(e.f=()=>{Tl(e.update)}),$nextTick:e=>e.n||(e.n=kt.bind(e.proxy)),$watch:e=>Ab.bind(e)}),Ta=(e,t)=>e!==Ue&&!e.__isScriptSetup&&Le(e,t),qb={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:o,props:a,accessCache:c,type:u,appContext:d}=e;if(t[0]!=="$"){const _=c[t];if(_!==void 0)switch(_){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return a[t]}else{if(Ta(r,t))return c[t]=1,r[t];if(o!==Ue&&Le(o,t))return c[t]=2,o[t];if(Le(a,t))return c[t]=3,a[t];if(n!==Ue&&Le(n,t))return c[t]=4,n[t];el&&(c[t]=0)}}const m=Mr[t];let p,y;if(m)return t==="$attrs"&<(e.attrs,"get",""),m(e);if((p=u.__cssModules)&&(p=p[t]))return p;if(n!==Ue&&Le(n,t))return c[t]=4,n[t];if(y=d.config.globalProperties,Le(y,t))return y[t]},set({_:e},t,n){const{data:r,setupState:o,ctx:a}=e;return Ta(o,t)?(o[t]=n,!0):r!==Ue&&Le(r,t)?(r[t]=n,!0):Le(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:o,props:a,type:c}},u){let d;return!!(n[u]||e!==Ue&&u[0]!=="$"&&Le(e,u)||Ta(t,u)||Le(a,u)||Le(r,u)||Le(Mr,u)||Le(o.config.globalProperties,u)||(d=c.__cssModules)&&d[u])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Le(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function $u(e){return _e(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let el=!0;function Zb(e){const t=Rf(e),n=e.proxy,r=e.ctx;el=!1,t.beforeCreate&&Du(t.beforeCreate,e,"bc");const{data:o,computed:a,methods:c,watch:u,provide:d,inject:m,created:p,beforeMount:y,mounted:_,beforeUpdate:A,updated:x,activated:O,deactivated:M,beforeDestroy:D,beforeUnmount:l,destroyed:R,unmounted:N,render:U,renderTracked:Z,renderTriggered:se,errorCaptured:oe,serverPrefetch:ne,expose:de,inheritAttrs:ye,components:Q,directives:ke,filters:Ee}=t;if(m&&Qb(m,r,null),c)for(const X in c){const q=c[X];xe(q)&&(r[X]=q.bind(n))}if(o){const X=o.call(n,n);$e(X)&&(e.data=ls(X))}if(el=!0,a)for(const X in a){const q=a[X],fe=xe(q)?q.bind(n,n):xe(q.get)?q.get.bind(n,n):nn,pe=!xe(q)&&xe(q.set)?q.set.bind(n):nn,Ce=be({get:fe,set:pe});Object.defineProperty(r,X,{enumerable:!0,configurable:!0,get:()=>Ce.value,set:Re=>Ce.value=Re})}if(u)for(const X in u)Mf(u[X],r,n,X);if(d){const X=xe(d)?d.call(n):d;Reflect.ownKeys(X).forEach(q=>{Sb(q,X[q])})}p&&Du(p,e,"c");function F(X,q){_e(q)?q.forEach(fe=>X(fe.bind(n))):q&&X(q.bind(n))}if(F(Bb,y),F(Wr,_),F(Ub,A),F(Cf,x),F(Pb,O),F($b,M),F(jb,oe),F(Hb,Z),F(zb,se),F(Bn,l),F(If,N),F(Fb,ne),_e(de))if(de.length){const X=e.exposed||(e.exposed={});de.forEach(q=>{Object.defineProperty(X,q,{get:()=>n[q],set:fe=>n[q]=fe,enumerable:!0})})}else e.exposed||(e.exposed={});U&&e.render===nn&&(e.render=U),ye!=null&&(e.inheritAttrs=ye),Q&&(e.components=Q),ke&&(e.directives=ke),ne&&Ef(e)}function Qb(e,t,n=nn){_e(e)&&(e=tl(e));for(const r in e){const o=e[r];let a;$e(o)?"default"in o?a=Wi(o.from||r,o.default,!0):a=Wi(o.from||r):a=Wi(o),ft(a)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>a.value,set:c=>a.value=c}):t[r]=a}}function Du(e,t,n){jt(_e(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Mf(e,t,n,r){let o=r.includes(".")?vf(n,r):()=>n[r];if(Ke(e)){const a=t[e];xe(a)&&nt(o,a)}else if(xe(e))nt(o,e.bind(n));else if($e(e))if(_e(e))e.forEach(a=>Mf(a,t,n,r));else{const a=xe(e.handler)?e.handler.bind(n):t[e.handler];xe(a)&&nt(o,a,e)}}function Rf(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:a,config:{optionMergeStrategies:c}}=e.appContext,u=a.get(t);let d;return u?d=u:!o.length&&!n&&!r?d=t:(d={},o.length&&o.forEach(m=>eo(d,m,c,!0)),eo(d,t,c)),$e(t)&&a.set(t,d),d}function eo(e,t,n,r=!1){const{mixins:o,extends:a}=t;a&&eo(e,a,n,!0),o&&o.forEach(c=>eo(e,c,n,!0));for(const c in t)if(!(r&&c==="expose")){const u=Yb[c]||n&&n[c];e[c]=u?u(e[c],t[c]):t[c]}return e}const Yb={data:Bu,props:Uu,emits:Uu,methods:mr,computed:mr,beforeCreate:bt,created:bt,beforeMount:bt,mounted:bt,beforeUpdate:bt,updated:bt,beforeDestroy:bt,beforeUnmount:bt,destroyed:bt,unmounted:bt,activated:bt,deactivated:bt,errorCaptured:bt,serverPrefetch:bt,components:mr,directives:mr,watch:Xb,provide:Bu,inject:Jb};function Bu(e,t){return t?e?function(){return st(xe(e)?e.call(this,this):e,xe(t)?t.call(this,this):t)}:t:e}function Jb(e,t){return mr(tl(e),tl(t))}function tl(e){if(_e(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function bt(e,t){return e?[...new Set([].concat(e,t))]:t}function mr(e,t){return e?st(Object.create(null),e,t):t}function Uu(e,t){return e?_e(e)&&_e(t)?[...new Set([...e,...t])]:st(Object.create(null),$u(e),$u(t??{})):t}function Xb(e,t){if(!e)return t;if(!t)return e;const n=st(Object.create(null),e);for(const r in t)n[r]=bt(e[r],t[r]);return n}function Nf(){return{app:null,config:{isNativeTag:Wd,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 ey=0;function ty(e,t){return function(r,o=null){xe(r)||(r=st({},r)),o!=null&&!$e(o)&&(o=null);const a=Nf(),c=new WeakSet,u=[];let d=!1;const m=a.app={_uid:ey++,_component:r,_props:o,_container:null,_context:a,_instance:null,version:Oy,get config(){return a.config},set config(p){},use(p,...y){return c.has(p)||(p&&xe(p.install)?(c.add(p),p.install(m,...y)):xe(p)&&(c.add(p),p(m,...y))),m},mixin(p){return a.mixins.includes(p)||a.mixins.push(p),m},component(p,y){return y?(a.components[p]=y,m):a.components[p]},directive(p,y){return y?(a.directives[p]=y,m):a.directives[p]},mount(p,y,_){if(!d){const A=m._ceVNode||ct(r,o);return A.appContext=a,_===!0?_="svg":_===!1&&(_=void 0),e(A,p,_),d=!0,m._container=p,p.__vue_app__=m,Eo(A.component)}},onUnmount(p){u.push(p)},unmount(){d&&(jt(u,m._instance,16),e(null,m._container),delete m._container.__vue_app__)},provide(p,y){return a.provides[p]=y,m},runWithContext(p){const y=Ls;Ls=m;try{return p()}finally{Ls=y}}};return m}}let Ls=null;const ny=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${wt(t)}Modifiers`]||e[`${Fn(t)}Modifiers`];function sy(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||Ue;let o=n;const a=t.startsWith("update:"),c=a&&ny(r,t.slice(7));c&&(c.trim&&(o=n.map(p=>Ke(p)?p.trim():p)),c.number&&(o=n.map(yo)));let u,d=r[u=wa(t)]||r[u=wa(wt(t))];!d&&a&&(d=r[u=wa(Fn(t))]),d&&jt(d,e,6,o);const m=r[u+"Once"];if(m){if(!e.emitted)e.emitted={};else if(e.emitted[u])return;e.emitted[u]=!0,jt(m,e,6,o)}}const ry=new WeakMap;function Of(e,t,n=!1){const r=n?ry:t.emitsCache,o=r.get(e);if(o!==void 0)return o;const a=e.emits;let c={},u=!1;if(!xe(e)){const d=m=>{const p=Of(m,t,!0);p&&(u=!0,st(c,p))};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}return!a&&!u?($e(e)&&r.set(e,null),null):(_e(a)?a.forEach(d=>c[d]=null):st(c,a),$e(e)&&r.set(e,c),c)}function xo(e,t){return!e||!ho(t)?!1:(t=t.slice(2).replace(/Once$/,""),Le(e,t[0].toLowerCase()+t.slice(1))||Le(e,Fn(t))||Le(e,t))}function Fu(e){const{type:t,vnode:n,proxy:r,withProxy:o,propsOptions:[a],slots:c,attrs:u,emit:d,render:m,renderCache:p,props:y,data:_,setupState:A,ctx:x,inheritAttrs:O}=e,M=Ji(e);let D,l;try{if(n.shapeFlag&4){const N=o||r,U=N;D=en(m.call(U,N,p,y,A,_,x)),l=u}else{const N=t;D=en(N.length>1?N(y,{attrs:u,slots:c,emit:d}):N(y,null)),l=t.props?u:iy(u)}}catch(N){Rr.length=0,wo(N,e,1),D=ct(wn)}let R=D;if(l&&O!==!1){const N=Object.keys(l),{shapeFlag:U}=R;N.length&&U&7&&(a&&N.some(po)&&(l=oy(l,a)),R=ds(R,l,!1,!0))}return n.dirs&&(R=ds(R,null,!1,!0),R.dirs=R.dirs?R.dirs.concat(n.dirs):n.dirs),n.transition&&Dr(R,n.transition),D=R,Ji(M),D}const iy=e=>{let t;for(const n in e)(n==="class"||n==="style"||ho(n))&&((t||(t={}))[n]=e[n]);return t},oy=(e,t)=>{const n={};for(const r in e)(!po(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function ay(e,t,n){const{props:r,children:o,component:a}=e,{props:c,children:u,patchFlag:d}=t,m=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&d>=0){if(d&1024)return!0;if(d&16)return r?zu(r,c,m):!!c;if(d&8){const p=t.dynamicProps;for(let y=0;y<p.length;y++){const _=p[y];if(Lf(c,r,_)&&!xo(m,_))return!0}}}else return(o||u)&&(!u||!u.$stable)?!0:r===c?!1:r?c?zu(r,c,m):!0:!!c;return!1}function zu(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;o<r.length;o++){const a=r[o];if(Lf(t,e,a)&&!xo(n,a))return!0}return!1}function Lf(e,t,n){const r=e[n],o=t[n];return n==="style"&&$e(r)&&$e(o)?!Dn(r,o):r!==o}function ly({vnode:e,parent:t,suspense:n},r){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=r,e=o),o===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}const Pf={},$f=()=>Object.create(Pf),Df=e=>Object.getPrototypeOf(e)===Pf;function cy(e,t,n,r=!1){const o={},a=$f();e.propsDefaults=Object.create(null),Bf(e,t,o,a);for(const c in e.propsOptions[0])c in o||(o[c]=void 0);n?e.props=r?o:fb(o):e.type.props?e.props=o:e.props=a,e.attrs=a}function uy(e,t,n,r){const{props:o,attrs:a,vnode:{patchFlag:c}}=e,u=Ne(o),[d]=e.propsOptions;let m=!1;if((r||c>0)&&!(c&16)){if(c&8){const p=e.vnode.dynamicProps;for(let y=0;y<p.length;y++){let _=p[y];if(xo(e.emitsOptions,_))continue;const A=t[_];if(d)if(Le(a,_))A!==a[_]&&(a[_]=A,m=!0);else{const x=wt(_);o[x]=nl(d,u,x,A,e,!1)}else A!==a[_]&&(a[_]=A,m=!0)}}}else{Bf(e,t,o,a)&&(m=!0);let p;for(const y in u)(!t||!Le(t,y)&&((p=Fn(y))===y||!Le(t,p)))&&(d?n&&(n[y]!==void 0||n[p]!==void 0)&&(o[y]=nl(d,u,y,void 0,e,!0)):delete o[y]);if(a!==u)for(const y in a)(!t||!Le(t,y))&&(delete a[y],m=!0)}m&&pn(e.attrs,"set","")}function Bf(e,t,n,r){const[o,a]=e.propsOptions;let c=!1,u;if(t)for(let d in t){if(Sr(d))continue;const m=t[d];let p;o&&Le(o,p=wt(d))?!a||!a.includes(p)?n[p]=m:(u||(u={}))[p]=m:xo(e.emitsOptions,d)||(!(d in r)||m!==r[d])&&(r[d]=m,c=!0)}if(a){const d=Ne(n),m=u||Ue;for(let p=0;p<a.length;p++){const y=a[p];n[y]=nl(o,d,y,m[y],e,!Le(m,y))}}return c}function nl(e,t,n,r,o,a){const c=e[n];if(c!=null){const u=Le(c,"default");if(u&&r===void 0){const d=c.default;if(c.type!==Function&&!c.skipFactory&&xe(d)){const{propsDefaults:m}=o;if(n in m)r=m[n];else{const p=Kr(o);r=m[n]=d.call(null,t),p()}}else r=d;o.ce&&o.ce._setProp(n,r)}c[0]&&(a&&!u?r=!1:c[1]&&(r===""||r===Fn(n))&&(r=!0))}return r}const dy=new WeakMap;function Uf(e,t,n=!1){const r=n?dy:t.propsCache,o=r.get(e);if(o)return o;const a=e.props,c={},u=[];let d=!1;if(!xe(e)){const p=y=>{d=!0;const[_,A]=Uf(y,t,!0);st(c,_),A&&u.push(...A)};!n&&t.mixins.length&&t.mixins.forEach(p),e.extends&&p(e.extends),e.mixins&&e.mixins.forEach(p)}if(!a&&!d)return $e(e)&&r.set(e,Rs),Rs;if(_e(a))for(let p=0;p<a.length;p++){const y=wt(a[p]);Hu(y)&&(c[y]=Ue)}else if(a)for(const p in a){const y=wt(p);if(Hu(y)){const _=a[p],A=c[y]=_e(_)||xe(_)?{type:_}:st({},_),x=A.type;let O=!1,M=!0;if(_e(x))for(let D=0;D<x.length;++D){const l=x[D],R=xe(l)&&l.name;if(R==="Boolean"){O=!0;break}else R==="String"&&(M=!1)}else O=xe(x)&&x.name==="Boolean";A[0]=O,A[1]=M,(O||Le(A,"default"))&&u.push(y)}}const m=[c,u];return $e(e)&&r.set(e,m),m}function Hu(e){return e[0]!=="$"&&!Sr(e)}const Al=e=>e==="_"||e==="_ctx"||e==="$stable",Cl=e=>_e(e)?e.map(en):[en(e)],fy=(e,t,n)=>{if(t._n)return t;const r=_f((...o)=>Cl(t(...o)),n);return r._c=!1,r},Ff=(e,t,n)=>{const r=e._ctx;for(const o in e){if(Al(o))continue;const a=e[o];if(xe(a))t[o]=fy(o,a,r);else if(a!=null){const c=Cl(a);t[o]=()=>c}}},zf=(e,t)=>{const n=Cl(t);e.slots.default=()=>n},Hf=(e,t,n)=>{for(const r in t)(n||!Al(r))&&(e[r]=t[r])},gy=(e,t,n)=>{const r=e.slots=$f();if(e.vnode.shapeFlag&32){const o=t._;o?(Hf(r,t,n),n&&qd(r,"_",o,!0)):Ff(t,r)}else t&&zf(e,t)},hy=(e,t,n)=>{const{vnode:r,slots:o}=e;let a=!0,c=Ue;if(r.shapeFlag&32){const u=t._;u?n&&u===1?a=!1:Hf(o,t,n):(a=!t.$stable,Ff(t,o)),c=t}else t&&(zf(e,t),c={default:1});if(a)for(const u in o)!Al(u)&&c[u]==null&&delete o[u]},yt=ky;function py(e){return my(e)}function my(e,t){const n=ko();n.__VUE__=!0;const{insert:r,remove:o,patchProp:a,createElement:c,createText:u,createComment:d,setText:m,setElementText:p,parentNode:y,nextSibling:_,setScopeId:A=nn,insertStaticContent:x}=e,O=(v,T,P,H=null,j=null,W=null,B=void 0,J=null,K=!!T.dynamicChildren)=>{if(v===T)return;v&&!Is(v,T)&&(H=Wt(v),Re(v,j,W,!0),v=null),T.patchFlag===-2&&(K=!1,T.dynamicChildren=null);const{type:$,ref:ce,shapeFlag:ee}=T;switch($){case So:M(v,T,P,H);break;case wn:D(v,T,P,H);break;case Ki:v==null&&l(T,P,H,B);break;case ue:Q(v,T,P,H,j,W,B,J,K);break;default:ee&1?U(v,T,P,H,j,W,B,J,K):ee&6?ke(v,T,P,H,j,W,B,J,K):(ee&64||ee&128)&&$.process(v,T,P,H,j,W,B,J,K,vt)}ce!=null&&j?Cr(ce,v&&v.ref,W,T||v,!T):ce==null&&v&&v.ref!=null&&Cr(v.ref,null,W,v,!0)},M=(v,T,P,H)=>{if(v==null)r(T.el=u(T.children),P,H);else{const j=T.el=v.el;T.children!==v.children&&m(j,T.children)}},D=(v,T,P,H)=>{v==null?r(T.el=d(T.children||""),P,H):T.el=v.el},l=(v,T,P,H)=>{[v.el,v.anchor]=x(v.children,T,P,H,v.el,v.anchor)},R=({el:v,anchor:T},P,H)=>{let j;for(;v&&v!==T;)j=_(v),r(v,P,H),v=j;r(T,P,H)},N=({el:v,anchor:T})=>{let P;for(;v&&v!==T;)P=_(v),o(v),v=P;o(T)},U=(v,T,P,H,j,W,B,J,K)=>{if(T.type==="svg"?B="svg":T.type==="math"&&(B="mathml"),v==null)Z(T,P,H,j,W,B,J,K);else{const $=v.el&&v.el._isVueCE?v.el:null;try{$&&$._beginPatch(),ne(v,T,j,W,B,J,K)}finally{$&&$._endPatch()}}},Z=(v,T,P,H,j,W,B,J)=>{let K,$;const{props:ce,shapeFlag:ee,transition:ae,dirs:me}=v;if(K=v.el=c(v.type,W,ce&&ce.is,ce),ee&8?p(K,v.children):ee&16&&oe(v.children,K,null,H,j,Aa(v,W),B,J),me&&es(v,null,H,"created"),se(K,v,v.scopeId,B,H),ce){for(const Y in ce)Y!=="value"&&!Sr(Y)&&a(K,Y,null,ce[Y],W,H);"value"in ce&&a(K,"value",null,ce.value,W),($=ce.onVnodeBeforeMount)&&qt($,H,v)}me&&es(v,null,H,"beforeMount");const z=by(j,ae);z&&ae.beforeEnter(K),r(K,T,P),(($=ce&&ce.onVnodeMounted)||z||me)&&yt(()=>{try{$&&qt($,H,v),z&&ae.enter(K),me&&es(v,null,H,"mounted")}finally{}},j)},se=(v,T,P,H,j)=>{if(P&&A(v,P),H)for(let W=0;W<H.length;W++)A(v,H[W]);if(j){let W=j.subTree;if(T===W||Kf(W.type)&&(W.ssContent===T||W.ssFallback===T)){const B=j.vnode;se(v,B,B.scopeId,B.slotScopeIds,j.parent)}}},oe=(v,T,P,H,j,W,B,J,K=0)=>{for(let $=K;$<v.length;$++){const ce=v[$]=J?hn(v[$]):en(v[$]);O(null,ce,T,P,H,j,W,B,J)}},ne=(v,T,P,H,j,W,B)=>{const J=T.el=v.el;let{patchFlag:K,dynamicChildren:$,dirs:ce}=T;K|=v.patchFlag&16;const ee=v.props||Ue,ae=T.props||Ue;let me;if(P&&ts(P,!1),(me=ae.onVnodeBeforeUpdate)&&qt(me,P,T,v),ce&&es(T,v,P,"beforeUpdate"),P&&ts(P,!0),(ee.innerHTML&&ae.innerHTML==null||ee.textContent&&ae.textContent==null)&&p(J,""),$?de(v.dynamicChildren,$,J,P,H,Aa(T,j),W):B||q(v,T,J,null,P,H,Aa(T,j),W,!1),K>0){if(K&16)ye(J,ee,ae,P,j);else if(K&2&&ee.class!==ae.class&&a(J,"class",null,ae.class,j),K&4&&a(J,"style",ee.style,ae.style,j),K&8){const z=T.dynamicProps;for(let Y=0;Y<z.length;Y++){const ie=z[Y],he=ee[ie],Ae=ae[ie];(Ae!==he||ie==="value")&&a(J,ie,he,Ae,j,P)}}K&1&&v.children!==T.children&&p(J,T.children)}else!B&&$==null&&ye(J,ee,ae,P,j);((me=ae.onVnodeUpdated)||ce)&&yt(()=>{me&&qt(me,P,T,v),ce&&es(T,v,P,"updated")},H)},de=(v,T,P,H,j,W,B)=>{for(let J=0;J<T.length;J++){const K=v[J],$=T[J],ce=K.el&&(K.type===ue||!Is(K,$)||K.shapeFlag&198)?y(K.el):P;O(K,$,ce,null,H,j,W,B,!0)}},ye=(v,T,P,H,j)=>{if(T!==P){if(T!==Ue)for(const W in T)!Sr(W)&&!(W in P)&&a(v,W,T[W],null,j,H);for(const W in P){if(Sr(W))continue;const B=P[W],J=T[W];B!==J&&W!=="value"&&a(v,W,J,B,j,H)}"value"in P&&a(v,"value",T.value,P.value,j)}},Q=(v,T,P,H,j,W,B,J,K)=>{const $=T.el=v?v.el:u(""),ce=T.anchor=v?v.anchor:u("");let{patchFlag:ee,dynamicChildren:ae,slotScopeIds:me}=T;me&&(J=J?J.concat(me):me),v==null?(r($,P,H),r(ce,P,H),oe(T.children||[],P,ce,j,W,B,J,K)):ee>0&&ee&64&&ae&&v.dynamicChildren&&v.dynamicChildren.length===ae.length?(de(v.dynamicChildren,ae,P,j,W,B,J),(T.key!=null||j&&T===j.subTree)&&Il(v,T,!0)):q(v,T,P,ce,j,W,B,J,K)},ke=(v,T,P,H,j,W,B,J,K)=>{T.slotScopeIds=J,v==null?T.shapeFlag&512?j.ctx.activate(T,P,H,B,K):Ee(T,P,H,j,W,B,K):Ge(v,T,K)},Ee=(v,T,P,H,j,W,B)=>{const J=v.component=Ty(v,H,j);if(Tf(v)&&(J.ctx.renderer=vt),Ay(J,!1,B),J.asyncDep){if(j&&j.registerDep(J,F,B),!v.el){const K=J.subTree=ct(wn);D(null,K,T,P),v.placeholder=K.el}}else F(J,v,T,P,j,W,B)},Ge=(v,T,P)=>{const H=T.component=v.component;if(ay(v,T,P))if(H.asyncDep&&!H.asyncResolved){X(H,T,P);return}else H.next=T,H.update();else T.el=v.el,H.vnode=T},F=(v,T,P,H,j,W,B)=>{const J=()=>{if(v.isMounted){let{next:ee,bu:ae,u:me,parent:z,vnode:Y}=v;{const gt=jf(v);if(gt){ee&&(ee.el=Y.el,X(v,ee,B)),gt.asyncDep.then(()=>{yt(()=>{v.isUnmounted||$()},j)});return}}let ie=ee,he;ts(v,!1),ee?(ee.el=Y.el,X(v,ee,B)):ee=Y,ae&&ji(ae),(he=ee.props&&ee.props.onVnodeBeforeUpdate)&&qt(he,z,ee,Y),ts(v,!0);const Ae=Fu(v),qe=v.subTree;v.subTree=Ae,O(qe,Ae,y(qe.el),Wt(qe),v,j,W),ee.el=Ae.el,ie===null&&ly(v,Ae.el),me&&yt(me,j),(he=ee.props&&ee.props.onVnodeUpdated)&&yt(()=>qt(he,z,ee,Y),j)}else{let ee;const{el:ae,props:me}=T,{bm:z,m:Y,parent:ie,root:he,type:Ae}=v,qe=Ir(T);ts(v,!1),z&&ji(z),!qe&&(ee=me&&me.onVnodeBeforeMount)&&qt(ee,ie,T),ts(v,!0);{he.ce&&he.ce._hasShadowRoot()&&he.ce._injectChildStyle(Ae,v.parent?v.parent.type:void 0);const gt=v.subTree=Fu(v);O(null,gt,P,H,v,j,W),T.el=gt.el}if(Y&&yt(Y,j),!qe&&(ee=me&&me.onVnodeMounted)){const gt=T;yt(()=>qt(ee,ie,gt),j)}(T.shapeFlag&256||ie&&Ir(ie.vnode)&&ie.vnode.shapeFlag&256)&&v.a&&yt(v.a,j),v.isMounted=!0,T=P=H=null}};v.scope.on();const K=v.effect=new Jd(J);v.scope.off();const $=v.update=K.run.bind(K),ce=v.job=K.runIfDirty.bind(K);ce.i=v,ce.id=v.uid,K.scheduler=()=>Tl(ce),ts(v,!0),$()},X=(v,T,P)=>{T.component=v;const H=v.vnode.props;v.vnode=T,v.next=null,uy(v,T.props,H,P),hy(v,T.children,P),yn(),Mu(v),kn()},q=(v,T,P,H,j,W,B,J,K=!1)=>{const $=v&&v.children,ce=v?v.shapeFlag:0,ee=T.children,{patchFlag:ae,shapeFlag:me}=T;if(ae>0){if(ae&128){pe($,ee,P,H,j,W,B,J,K);return}else if(ae&256){fe($,ee,P,H,j,W,B,J,K);return}}me&8?(ce&16&&Fe($,j,W),ee!==$&&p(P,ee)):ce&16?me&16?pe($,ee,P,H,j,W,B,J,K):Fe($,j,W,!0):(ce&8&&p(P,""),me&16&&oe(ee,P,H,j,W,B,J,K))},fe=(v,T,P,H,j,W,B,J,K)=>{v=v||Rs,T=T||Rs;const $=v.length,ce=T.length,ee=Math.min($,ce);let ae;for(ae=0;ae<ee;ae++){const me=T[ae]=K?hn(T[ae]):en(T[ae]);O(v[ae],me,P,null,j,W,B,J,K)}$>ce?Fe(v,j,W,!0,!1,ee):oe(T,P,H,j,W,B,J,K,ee)},pe=(v,T,P,H,j,W,B,J,K)=>{let $=0;const ce=T.length;let ee=v.length-1,ae=ce-1;for(;$<=ee&&$<=ae;){const me=v[$],z=T[$]=K?hn(T[$]):en(T[$]);if(Is(me,z))O(me,z,P,null,j,W,B,J,K);else break;$++}for(;$<=ee&&$<=ae;){const me=v[ee],z=T[ae]=K?hn(T[ae]):en(T[ae]);if(Is(me,z))O(me,z,P,null,j,W,B,J,K);else break;ee--,ae--}if($>ee){if($<=ae){const me=ae+1,z=me<ce?T[me].el:H;for(;$<=ae;)O(null,T[$]=K?hn(T[$]):en(T[$]),P,z,j,W,B,J,K),$++}}else if($>ae)for(;$<=ee;)Re(v[$],j,W,!0),$++;else{const me=$,z=$,Y=new Map;for($=z;$<=ae;$++){const rt=T[$]=K?hn(T[$]):en(T[$]);rt.key!=null&&Y.set(rt.key,$)}let ie,he=0;const Ae=ae-z+1;let qe=!1,gt=0;const Kt=new Array(Ae);for($=0;$<Ae;$++)Kt[$]=0;for($=me;$<=ee;$++){const rt=v[$];if(he>=Ae){Re(rt,j,W,!0);continue}let ht;if(rt.key!=null)ht=Y.get(rt.key);else for(ie=z;ie<=ae;ie++)if(Kt[ie-z]===0&&Is(rt,T[ie])){ht=ie;break}ht===void 0?Re(rt,j,W,!0):(Kt[ht-z]=$+1,ht>=gt?gt=ht:qe=!0,O(rt,T[ht],P,null,j,W,B,J,K),he++)}const xn=qe?yy(Kt):Rs;for(ie=xn.length-1,$=Ae-1;$>=0;$--){const rt=z+$,ht=T[rt],js=T[rt+1],ps=rt+1<ce?js.el||Wf(js):H;Kt[$]===0?O(null,ht,P,ps,j,W,B,J,K):qe&&(ie<0||$!==xn[ie]?Ce(ht,P,ps,2):ie--)}}},Ce=(v,T,P,H,j=null)=>{const{el:W,type:B,transition:J,children:K,shapeFlag:$}=v;if($&6){Ce(v.component.subTree,T,P,H);return}if($&128){v.suspense.move(T,P,H);return}if($&64){B.move(v,T,P,vt);return}if(B===ue){r(W,T,P);for(let ee=0;ee<K.length;ee++)Ce(K[ee],T,P,H);r(v.anchor,T,P);return}if(B===Ki){R(v,T,P);return}if(H!==2&&$&1&&J)if(H===0)J.beforeEnter(W),r(W,T,P),yt(()=>J.enter(W),j);else{const{leave:ee,delayLeave:ae,afterLeave:me}=J,z=()=>{v.ctx.isUnmounted?o(W):r(W,T,P)},Y=()=>{W._isLeaving&&W[Nn](!0),ee(W,()=>{z(),me&&me()})};ae?ae(W,z,Y):Y()}else r(W,T,P)},Re=(v,T,P,H=!1,j=!1)=>{const{type:W,props:B,ref:J,children:K,dynamicChildren:$,shapeFlag:ce,patchFlag:ee,dirs:ae,cacheIndex:me,memo:z}=v;if(ee===-2&&(j=!1),J!=null&&(yn(),Cr(J,null,P,v,!0),kn()),me!=null&&(T.renderCache[me]=void 0),ce&256){T.ctx.deactivate(v);return}const Y=ce&1&&ae,ie=!Ir(v);let he;if(ie&&(he=B&&B.onVnodeBeforeUnmount)&&qt(he,T,v),ce&6)Xe(v.component,P,H);else{if(ce&128){v.suspense.unmount(P,H);return}Y&&es(v,null,T,"beforeUnmount"),ce&64?v.type.remove(v,T,P,vt,H):$&&!$.hasOnce&&(W!==ue||ee>0&&ee&64)?Fe($,T,P,!1,!0):(W===ue&&ee&384||!j&&ce&16)&&Fe(K,T,P),H&&Je(v)}const Ae=z!=null&&me==null;(ie&&(he=B&&B.onVnodeUnmounted)||Y||Ae)&&yt(()=>{he&&qt(he,T,v),Y&&es(v,null,T,"unmounted"),Ae&&(v.el=null)},P)},Je=v=>{const{type:T,el:P,anchor:H,transition:j}=v;if(T===ue){Qe(P,H);return}if(T===Ki){N(v);return}const W=()=>{o(P),j&&!j.persisted&&j.afterLeave&&j.afterLeave()};if(v.shapeFlag&1&&j&&!j.persisted){const{leave:B,delayLeave:J}=j,K=()=>B(P,W);J?J(v.el,W,K):K()}else W()},Qe=(v,T)=>{let P;for(;v!==T;)P=_(v),o(v),v=P;o(T)},Xe=(v,T,P)=>{const{bum:H,scope:j,job:W,subTree:B,um:J,m:K,a:$}=v;ju(K),ju($),H&&ji(H),j.stop(),W&&(W.flags|=8,Re(B,v,T,P)),J&&yt(J,T),yt(()=>{v.isUnmounted=!0},T)},Fe=(v,T,P,H=!1,j=!1,W=0)=>{for(let B=W;B<v.length;B++)Re(v[B],T,P,H,j)},Wt=v=>{if(v.shapeFlag&6)return Wt(v.component.subTree);if(v.shapeFlag&128)return v.suspense.next();const T=_(v.anchor||v.el),P=T&&T[xf];return P?_(P):T};let At=!1;const et=(v,T,P)=>{let H;v==null?T._vnode&&(Re(T._vnode,null,null,!0),H=T._vnode.component):O(T._vnode||null,v,T,null,null,null,P),T._vnode=v,At||(At=!0,Mu(H),bf(),At=!1)},vt={p:O,um:Re,m:Ce,r:Je,mt:Ee,mc:oe,pc:q,pbc:de,n:Wt,o:e};return{render:et,hydrate:void 0,createApp:ty(et)}}function Aa({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 ts({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function by(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Il(e,t,n=!1){const r=e.children,o=t.children;if(_e(r)&&_e(o))for(let a=0;a<r.length;a++){const c=r[a];let u=o[a];u.shapeFlag&1&&!u.dynamicChildren&&((u.patchFlag<=0||u.patchFlag===32)&&(u=o[a]=hn(o[a]),u.el=c.el),!n&&u.patchFlag!==-2&&Il(c,u)),u.type===So&&(u.patchFlag===-1&&(u=o[a]=hn(u)),u.el=c.el),u.type===wn&&!u.el&&(u.el=c.el)}}function yy(e){const t=e.slice(),n=[0];let r,o,a,c,u;const d=e.length;for(r=0;r<d;r++){const m=e[r];if(m!==0){if(o=n[n.length-1],e[o]<m){t[r]=o,n.push(r);continue}for(a=0,c=n.length-1;a<c;)u=a+c>>1,e[n[u]]<m?a=u+1:c=u;m<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,c=n[a-1];a-- >0;)n[a]=c,c=t[c];return n}function jf(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:jf(t)}function ju(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Wf(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Wf(t.subTree):null}const Kf=e=>e.__isSuspense;function ky(e,t){t&&t.pendingBranch?_e(e)?t.effects.push(...e):t.effects.push(e):xb(e)}const ue=Symbol.for("v-fgt"),So=Symbol.for("v-txt"),wn=Symbol.for("v-cmt"),Ki=Symbol.for("v-stc"),Rr=[];let Tt=null;function k(e=!1){Rr.push(Tt=e?null:[])}function _y(){Rr.pop(),Tt=Rr[Rr.length-1]||null}let Br=1;function Wu(e,t=!1){Br+=e,e<0&&Tt&&t&&(Tt.hasOnce=!0)}function Gf(e){return e.dynamicChildren=Br>0?Tt||Rs:null,_y(),Br>0&&Tt&&Tt.push(e),e}function w(e,t,n,r,o,a){return Gf(f(e,t,n,r,o,a,!0))}function at(e,t,n,r,o){return Gf(ct(e,t,n,r,o,!0))}function Vf(e){return e?e.__v_isVNode===!0:!1}function Is(e,t){return e.type===t.type&&e.key===t.key}const qf=({key:e})=>e??null,Gi=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ke(e)||ft(e)||xe(e)?{i:Et,r:e,k:t,f:!!n}:e:null);function f(e,t=null,n=null,r=0,o=null,a=e===ue?0:1,c=!1,u=!1){const d={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&qf(t),ref:t&&Gi(t),scopeId:kf,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:a,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Et};return u?(Ml(d,n),a&128&&e.normalize(d)):n&&(d.shapeFlag|=Ke(n)?8:16),Br>0&&!c&&Tt&&(d.patchFlag>0||a&6)&&d.patchFlag!==32&&Tt.push(d),d}const ct=wy;function wy(e,t=null,n=null,r=0,o=null,a=!1){if((!e||e===Gb)&&(e=wn),Vf(e)){const u=ds(e,t,!0);return n&&Ml(u,n),Br>0&&!a&&Tt&&(u.shapeFlag&6?Tt[Tt.indexOf(e)]=u:Tt.push(u)),u.patchFlag=-2,u}if(Ny(e)&&(e=e.__vccOpts),t){t=vy(t);let{class:u,style:d}=t;u&&!Ke(u)&&(t.class=ge(u)),$e(d)&&(El(d)&&!_e(d)&&(d=st({},d)),t.style=Nt(d))}const c=Ke(e)?1:Kf(e)?128:Cb(e)?64:$e(e)?4:xe(e)?2:0;return f(e,t,n,r,o,c,a,!0)}function vy(e){return e?El(e)||Df(e)?st({},e):e:null}function ds(e,t,n=!1,r=!1){const{props:o,ref:a,patchFlag:c,children:u,transition:d}=e,m=t?xy(o||{},t):o,p={__v_isVNode:!0,__v_skip:!0,type:e.type,props:m,key:m&&qf(m),ref:t&&t.ref?n&&a?_e(a)?a.concat(Gi(t)):[a,Gi(t)]:Gi(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:u,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ue?c===-1?16:c|16:c,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:d,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ds(e.ssContent),ssFallback:e.ssFallback&&ds(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return d&&r&&Dr(p,d.clone(p)),p}function br(e=" ",t=0){return ct(So,null,e,t)}function Ku(e,t){const n=ct(Ki,null,e);return n.staticCount=t,n}function V(e="",t=!1){return t?(k(),at(wn,null,e)):ct(wn,null,e)}function en(e){return e==null||typeof e=="boolean"?ct(wn):_e(e)?ct(ue,null,e.slice()):Vf(e)?hn(e):ct(So,null,String(e))}function hn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ds(e)}function Ml(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(_e(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),Ml(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Df(t)?t._ctx=Et:o===3&&Et&&(Et.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else xe(t)?(t={default:t,_ctx:Et},n=32):(t=String(t),r&64?(n=16,t=[br(t)]):n=8);e.children=t,e.shapeFlag|=n}function xy(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const o in r)if(o==="class")t.class!==r.class&&(t.class=ge([t.class,r.class]));else if(o==="style")t.style=Nt([t.style,r.style]);else if(ho(o)){const a=t[o],c=r[o];c&&a!==c&&!(_e(a)&&a.includes(c))?t[o]=a?[].concat(a,c):c:c==null&&a==null&&!po(o)&&(t[o]=c)}else o!==""&&(t[o]=r[o])}return t}function qt(e,t,n,r=null){jt(e,t,7,[n,r])}const Sy=Nf();let Ey=0;function Ty(e,t,n){const r=e.type,o=(t?t.appContext:e.appContext)||Sy,a={uid:Ey++,vnode:e,type:r,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Km(!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:Uf(r,o),emitsOptions:Of(r,o),emit:null,emitted:null,propsDefaults:Ue,inheritAttrs:r.inheritAttrs,ctx:Ue,data:Ue,props:Ue,attrs:Ue,slots:Ue,refs:Ue,setupState:Ue,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 a.ctx={_:a},a.root=t?t.root:a,a.emit=sy.bind(null,a),e.ce&&e.ce(a),a}let ut=null;const Zf=()=>ut||Et;let to,sl;{const e=ko(),t=(n,r)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(r),a=>{o.length>1?o.forEach(c=>c(a)):o[0](a)}};to=t("__VUE_INSTANCE_SETTERS__",n=>ut=n),sl=t("__VUE_SSR_SETTERS__",n=>Ur=n)}const Kr=e=>{const t=ut;return to(e),e.scope.on(),()=>{e.scope.off(),to(t)}},Gu=()=>{ut&&ut.scope.off(),to(null)};function Qf(e){return e.vnode.shapeFlag&4}let Ur=!1;function Ay(e,t=!1,n=!1){t&&sl(t);const{props:r,children:o}=e.vnode,a=Qf(e);cy(e,r,a,t),gy(e,o,n||t);const c=a?Cy(e,t):void 0;return t&&sl(!1),c}function Cy(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,qb);const{setup:r}=n;if(r){yn();const o=e.setupContext=r.length>1?My(e):null,a=Kr(e),c=jr(r,e,0,[e.props,o]),u=Kd(c);if(kn(),a(),(u||e.sp)&&!Ir(e)&&Ef(e),u){if(c.then(Gu,Gu),t)return c.then(d=>{Vu(e,d)}).catch(d=>{wo(d,e,0)});e.asyncDep=c}else Vu(e,c)}else Yf(e)}function Vu(e,t,n){xe(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:$e(t)&&(e.setupState=hf(t)),Yf(e)}function Yf(e,t,n){const r=e.type;e.render||(e.render=r.render||nn);{const o=Kr(e);yn();try{Zb(e)}finally{kn(),o()}}}const Iy={get(e,t){return lt(e,"get",""),e[t]}};function My(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Iy),slots:e.slots,emit:e.emit,expose:t}}function Eo(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(hf(gb(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Mr)return Mr[n](e)},has(t,n){return n in t||n in Mr}})):e.proxy}function Ry(e,t=!0){return xe(e)?e.displayName||e.name:e.name||t&&e.__name}function Ny(e){return xe(e)&&"__vccOpts"in e}const be=(e,t)=>yb(e,t,Ur),Oy="3.5.34";/**
|
|
14
|
-
* @vue/runtime-dom v3.5.34
|
|
15
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
16
|
-
* @license MIT
|
|
17
|
-
**/let rl;const qu=typeof window<"u"&&window.trustedTypes;if(qu)try{rl=qu.createPolicy("vue",{createHTML:e=>e})}catch{}const Jf=rl?e=>rl.createHTML(e):e=>e,Ly="http://www.w3.org/2000/svg",Py="http://www.w3.org/1998/Math/MathML",gn=typeof document<"u"?document:null,Zu=gn&&gn.createElement("template"),$y={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t==="svg"?gn.createElementNS(Ly,e):t==="mathml"?gn.createElementNS(Py,e):n?gn.createElement(e,{is:n}):gn.createElement(e);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>gn.createTextNode(e),createComment:e=>gn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>gn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,a){const c=n?n.previousSibling:t.lastChild;if(o&&(o===a||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===a||!(o=o.nextSibling)););else{Zu.innerHTML=Jf(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const u=Zu.content;if(r==="svg"||r==="mathml"){const d=u.firstChild;for(;d.firstChild;)u.appendChild(d.firstChild);u.removeChild(d)}t.insertBefore(u,n)}return[c?c.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},In="transition",dr="animation",Ds=Symbol("_vtc"),Xf={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},Dy=st({},Ob,Xf),ns=(e,t=[])=>{_e(e)?e.forEach(n=>n(...t)):e&&e(...t)},Qu=e=>e?_e(e)?e.some(t=>t.length>1):e.length>1:!1;function By(e){const t={};for(const Q in e)Q in Xf||(t[Q]=e[Q]);if(e.css===!1)return t;const{name:n="v",type:r,duration:o,enterFromClass:a=`${n}-enter-from`,enterActiveClass:c=`${n}-enter-active`,enterToClass:u=`${n}-enter-to`,appearFromClass:d=a,appearActiveClass:m=c,appearToClass:p=u,leaveFromClass:y=`${n}-leave-from`,leaveActiveClass:_=`${n}-leave-active`,leaveToClass:A=`${n}-leave-to`}=e,x=Uy(o),O=x&&x[0],M=x&&x[1],{onBeforeEnter:D,onEnter:l,onEnterCancelled:R,onLeave:N,onLeaveCancelled:U,onBeforeAppear:Z=D,onAppear:se=l,onAppearCancelled:oe=R}=t,ne=(Q,ke,Ee,Ge)=>{Q._enterCancelled=Ge,On(Q,ke?p:u),On(Q,ke?m:c),Ee&&Ee()},de=(Q,ke)=>{Q._isLeaving=!1,On(Q,y),On(Q,A),On(Q,_),ke&&ke()},ye=Q=>(ke,Ee)=>{const Ge=Q?se:l,F=()=>ne(ke,Q,Ee);ns(Ge,[ke,F]),Yu(()=>{On(ke,Q?d:a),Zt(ke,Q?p:u),Qu(Ge)||Ju(ke,r,O,F)})};return st(t,{onBeforeEnter(Q){ns(D,[Q]),Zt(Q,a),Zt(Q,c)},onBeforeAppear(Q){ns(Z,[Q]),Zt(Q,d),Zt(Q,m)},onEnter:ye(!1),onAppear:ye(!0),onLeave(Q,ke){Q._isLeaving=!0;const Ee=()=>de(Q,ke);Zt(Q,y),Q._enterCancelled?(Zt(Q,_),il(Q)):(il(Q),Zt(Q,_)),Yu(()=>{Q._isLeaving&&(On(Q,y),Zt(Q,A),Qu(N)||Ju(Q,r,M,Ee))}),ns(N,[Q,Ee])},onEnterCancelled(Q){ne(Q,!1,void 0,!0),ns(R,[Q])},onAppearCancelled(Q){ne(Q,!0,void 0,!0),ns(oe,[Q])},onLeaveCancelled(Q){de(Q),ns(U,[Q])}})}function Uy(e){if(e==null)return null;if($e(e))return[Ca(e.enter),Ca(e.leave)];{const t=Ca(e);return[t,t]}}function Ca(e){return Dm(e)}function Zt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Ds]||(e[Ds]=new Set)).add(t)}function On(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Ds];n&&(n.delete(t),n.size||(e[Ds]=void 0))}function Yu(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Fy=0;function Ju(e,t,n,r){const o=e._endId=++Fy,a=()=>{o===e._endId&&r()};if(n!=null)return setTimeout(a,n);const{type:c,timeout:u,propCount:d}=eg(e,t);if(!c)return r();const m=c+"end";let p=0;const y=()=>{e.removeEventListener(m,_),a()},_=A=>{A.target===e&&++p>=d&&y()};setTimeout(()=>{p<d&&y()},u+1),e.addEventListener(m,_)}function eg(e,t){const n=window.getComputedStyle(e),r=x=>(n[x]||"").split(", "),o=r(`${In}Delay`),a=r(`${In}Duration`),c=Xu(o,a),u=r(`${dr}Delay`),d=r(`${dr}Duration`),m=Xu(u,d);let p=null,y=0,_=0;t===In?c>0&&(p=In,y=c,_=a.length):t===dr?m>0&&(p=dr,y=m,_=d.length):(y=Math.max(c,m),p=y>0?c>m?In:dr:null,_=p?p===In?a.length:d.length:0);const A=p===In&&/\b(?:transform|all)(?:,|$)/.test(r(`${In}Property`).toString());return{type:p,timeout:y,propCount:_,hasTransform:A}}function Xu(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>ed(n)+ed(e[r])))}function ed(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function il(e){return(e?e.ownerDocument:document).body.offsetHeight}function zy(e,t,n){const r=e[Ds];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const td=Symbol("_vod"),Hy=Symbol("_vsh"),jy=Symbol(""),Wy=/(?:^|;)\s*display\s*:/;function Ky(e,t,n){const r=e.style,o=Ke(n);let a=!1;if(n&&!o){if(t)if(Ke(t))for(const c of t.split(";")){const u=c.slice(0,c.indexOf(":")).trim();n[u]==null&&yr(r,u,"")}else for(const c in t)n[c]==null&&yr(r,c,"");for(const c in n){c==="display"&&(a=!0);const u=n[c];u!=null?Vy(e,c,!Ke(t)&&t?t[c]:void 0,u)||yr(r,c,u):yr(r,c,"")}}else if(o){if(t!==n){const c=r[jy];c&&(n+=";"+c),r.cssText=n,a=Wy.test(n)}}else t&&e.removeAttribute("style");td in e&&(e[td]=a?r.display:"",e[Hy]&&(r.display="none"))}const nd=/\s*!important$/;function yr(e,t,n){if(_e(n))n.forEach(r=>yr(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Gy(e,t);nd.test(n)?e.setProperty(Fn(r),n.replace(nd,""),"important"):e[r]=n}}const sd=["Webkit","Moz","ms"],Ia={};function Gy(e,t){const n=Ia[t];if(n)return n;let r=wt(t);if(r!=="filter"&&r in e)return Ia[t]=r;r=bo(r);for(let o=0;o<sd.length;o++){const a=sd[o]+r;if(a in e)return Ia[t]=a}return t}function Vy(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Ke(r)&&n===r}const rd="http://www.w3.org/1999/xlink";function id(e,t,n,r,o,a=jm(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(rd,t.slice(6,t.length)):e.setAttributeNS(rd,t,n):n==null||a&&!Zd(n)?e.removeAttribute(t):e.setAttribute(t,a?"":sn(n)?String(n):n)}function od(e,t,n,r,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Jf(n):n);return}const a=e.tagName;if(t==="value"&&a!=="PROGRESS"&&!a.includes("-")){const u=a==="OPTION"?e.getAttribute("value")||"":e.value,d=n==null?e.type==="checkbox"?"on":"":String(n);(u!==d||!("_value"in e))&&(e.value=d),n==null&&e.removeAttribute(t),e._value=n;return}let c=!1;if(n===""||n==null){const u=typeof e[t];u==="boolean"?n=Zd(n):n==null&&u==="string"?(n="",c=!0):u==="number"&&(n=0,c=!0)}try{e[t]=n}catch{}c&&e.removeAttribute(o||t)}function bn(e,t,n,r){e.addEventListener(t,n,r)}function qy(e,t,n,r){e.removeEventListener(t,n,r)}const ad=Symbol("_vei");function Zy(e,t,n,r,o=null){const a=e[ad]||(e[ad]={}),c=a[t];if(r&&c)c.value=r;else{const[u,d]=Qy(t);if(r){const m=a[t]=Xy(r,o);bn(e,u,m,d)}else c&&(qy(e,u,c,d),a[t]=void 0)}}const ld=/(?:Once|Passive|Capture)$/;function Qy(e){let t;if(ld.test(e)){t={};let r;for(;r=e.match(ld);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Fn(e.slice(2)),t]}let Ma=0;const Yy=Promise.resolve(),Jy=()=>Ma||(Yy.then(()=>Ma=0),Ma=Date.now());function Xy(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;jt(ek(r,n.value),t,5,[r])};return n.value=e,n.attached=Jy(),n}function ek(e,t){if(_e(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>o=>!o._stopped&&r&&r(o))}else return t}const cd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,tk=(e,t,n,r,o,a)=>{const c=o==="svg";t==="class"?zy(e,r,c):t==="style"?Ky(e,n,r):ho(t)?po(t)||Zy(e,t,n,r,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):nk(e,t,r,c))?(od(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&id(e,t,r,c,a,t!=="value")):e._isVueCE&&(sk(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Ke(r)))?od(e,wt(t),r,a,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),id(e,t,r,c))};function nk(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&cd(t)&&xe(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 cd(t)&&Ke(n)?!1:t in e}function sk(e,t){const n=e._def.props;if(!n)return!1;const r=wt(t);return Array.isArray(n)?n.some(o=>wt(o)===r):Object.keys(n).some(o=>wt(o)===r)}const tg=new WeakMap,ng=new WeakMap,no=Symbol("_moveCb"),ud=Symbol("_enterCb"),rk=e=>(delete e.props.mode,e),ik=rk({name:"TransitionGroup",props:st({},Dy,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Zf(),r=Nb();let o,a;return Cf(()=>{if(!o.length)return;const c=e.moveClass||`${e.name||"v"}-move`;if(!uk(o[0].el,n.vnode.el,c)){o=[];return}o.forEach(ak),o.forEach(lk);const u=o.filter(ck);il(n.vnode.el),u.forEach(d=>{const m=d.el,p=m.style;Zt(m,c),p.transform=p.webkitTransform=p.transitionDuration="";const y=m[no]=_=>{_&&_.target!==m||(!_||_.propertyName.endsWith("transform"))&&(m.removeEventListener("transitionend",y),m[no]=null,On(m,c))};m.addEventListener("transitionend",y)}),o=[]}),()=>{const c=Ne(e),u=By(c);let d=c.tag||ue;if(o=[],a)for(let m=0;m<a.length;m++){const p=a[m];p.el&&p.el instanceof Element&&(o.push(p),Dr(p,Ja(p,u,r,n)),tg.set(p,sg(p.el)))}a=t.default?Sf(t.default()):[];for(let m=0;m<a.length;m++){const p=a[m];p.key!=null&&Dr(p,Ja(p,u,r,n))}return ct(d,null,a)}}}),ok=ik;function ak(e){const t=e.el;t[no]&&t[no](),t[ud]&&t[ud]()}function lk(e){ng.set(e,sg(e.el))}function ck(e){const t=tg.get(e),n=ng.get(e),r=t.left-n.left,o=t.top-n.top;if(r||o){const a=e.el,c=a.style,u=a.getBoundingClientRect();let d=1,m=1;return a.offsetWidth&&(d=u.width/a.offsetWidth),a.offsetHeight&&(m=u.height/a.offsetHeight),(!Number.isFinite(d)||d===0)&&(d=1),(!Number.isFinite(m)||m===0)&&(m=1),Math.abs(d-1)<.01&&(d=1),Math.abs(m-1)<.01&&(m=1),c.transform=c.webkitTransform=`translate(${r/d}px,${o/m}px)`,c.transitionDuration="0s",e}}function sg(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function uk(e,t,n){const r=e.cloneNode(),o=e[Ds];o&&o.forEach(u=>{u.split(/\s+/).forEach(d=>d&&r.classList.remove(d))}),n.split(/\s+/).forEach(u=>u&&r.classList.add(u)),r.style.display="none";const a=t.nodeType===1?t:t.parentNode;a.appendChild(r);const{hasTransform:c}=eg(r);return a.removeChild(r),c}const Un=e=>{const t=e.props["onUpdate:modelValue"]||!1;return _e(t)?n=>ji(t,n):t};function dk(e){e.target.composing=!0}function dd(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Lt=Symbol("_assign");function fd(e,t,n){return t&&(e=e.trim()),n&&(e=yo(e)),e}const Bt={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e[Lt]=Un(o);const a=r||o.props&&o.props.type==="number";bn(e,t?"change":"input",c=>{c.target.composing||e[Lt](fd(e.value,n,a))}),(n||a)&&bn(e,"change",()=>{e.value=fd(e.value,n,a)}),t||(bn(e,"compositionstart",dk),bn(e,"compositionend",dd),bn(e,"change",dd))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:o,number:a}},c){if(e[Lt]=Un(c),e.composing)return;const u=(a||e.type==="number")&&!/^0\d/.test(e.value)?yo(e.value):e.value,d=t??"";if(u===d)return;const m=e.getRootNode();(m instanceof Document||m instanceof ShadowRoot)&&m.activeElement===e&&e.type!=="range"&&(r&&t===n||o&&e.value.trim()===d)||(e.value=d)}},ol={deep:!0,created(e,t,n){e[Lt]=Un(n),bn(e,"change",()=>{const r=e._modelValue,o=Bs(e),a=e.checked,c=e[Lt];if(_e(r)){const u=yl(r,o),d=u!==-1;if(a&&!d)c(r.concat(o));else if(!a&&d){const m=[...r];m.splice(u,1),c(m)}}else if(Fs(r)){const u=new Set(r);a?u.add(o):u.delete(o),c(u)}else c(rg(e,a))})},mounted:gd,beforeUpdate(e,t,n){e[Lt]=Un(n),gd(e,t,n)}};function gd(e,{value:t,oldValue:n},r){e._modelValue=t;let o;if(_e(t))o=yl(t,r.props.value)>-1;else if(Fs(t))o=t.has(r.props.value);else{if(t===n)return;o=Dn(t,rg(e,!0))}e.checked!==o&&(e.checked=o)}const fk={created(e,{value:t},n){e.checked=Dn(t,n.props.value),e[Lt]=Un(n),bn(e,"change",()=>{e[Lt](Bs(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Lt]=Un(r),t!==n&&(e.checked=Dn(t,r.props.value))}},gk={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const o=Fs(t);bn(e,"change",()=>{const a=Array.prototype.filter.call(e.options,c=>c.selected).map(c=>n?yo(Bs(c)):Bs(c));e[Lt](e.multiple?o?new Set(a):a:a[0]),e._assigning=!0,kt(()=>{e._assigning=!1})}),e[Lt]=Un(r)},mounted(e,{value:t}){hd(e,t)},beforeUpdate(e,t,n){e[Lt]=Un(n)},updated(e,{value:t}){e._assigning||hd(e,t)}};function hd(e,t){const n=e.multiple,r=_e(t);if(!(n&&!r&&!Fs(t))){for(let o=0,a=e.options.length;o<a;o++){const c=e.options[o],u=Bs(c);if(n)if(r){const d=typeof u;d==="string"||d==="number"?c.selected=t.some(m=>String(m)===String(u)):c.selected=yl(t,u)>-1}else c.selected=t.has(u);else if(Dn(Bs(c),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Bs(e){return"_value"in e?e._value:e.value}function rg(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const hk={created(e,t,n){Li(e,t,n,null,"created")},mounted(e,t,n){Li(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){Li(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){Li(e,t,n,r,"updated")}};function pk(e,t){switch(e){case"SELECT":return gk;case"TEXTAREA":return Bt;default:switch(t){case"checkbox":return ol;case"radio":return fk;default:return Bt}}}function Li(e,t,n,r,o){const c=pk(e.tagName,n.props&&n.props.type)[o];c&&c(e,t,n,r)}const mk=["ctrl","shift","alt","meta"],bk={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)=>mk.some(n=>e[`${n}Key`]&&!t.includes(n))},Ye=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(o,...a)=>{for(let c=0;c<t.length;c++){const u=bk[t[c]];if(u&&u(o,t))return}return e(o,...a)})},yk={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},fr=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=o=>{if(!("key"in o))return;const a=Fn(o.key);if(t.some(c=>c===a||yk[c]===a))return e(o)})},kk=st({patchProp:tk},$y);let pd;function _k(){return pd||(pd=py(kk))}const wk=(...e)=>{const t=_k().createApp(...e),{mount:n}=t;return t.mount=r=>{const o=xk(r);if(!o)return;const a=t._component;!xe(a)&&!a.render&&!a.template&&(a.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const c=n(o,!1,vk(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),c},t};function vk(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function xk(e){return Ke(e)?document.querySelector(e):e}function Rl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var gs=Rl();function ig(e){gs=e}var is={exec:()=>null};function Me(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(o,a)=>{let c=typeof a=="string"?a:a.source;return c=c.replace(dt.caret,"$1"),n=n.replace(o,c),r},getRegex:()=>new RegExp(n,t)};return r}var Sk=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),dt={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,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ 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,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"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Ek=/^(?:[ \t]*(?:\n|$))+/,Tk=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ak=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Gr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ck=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Nl=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,og=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ag=Me(og).replace(/bull/g,Nl).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(),Ik=Me(og).replace(/bull/g,Nl).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(),Ol=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Mk=/^[^\n]+/,Ll=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Rk=Me(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ll).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Nk=Me(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Nl).getRegex(),To="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",Pl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ok=Me("^ {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",Pl).replace("tag",To).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),lg=Me(Ol).replace("hr",Gr).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[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",To).getRegex(),Lk=Me(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",lg).getRegex(),$l={blockquote:Lk,code:Tk,def:Rk,fences:Ak,heading:Ck,hr:Gr,html:Ok,lheading:ag,list:Nk,newline:Ek,paragraph:lg,table:is,text:Mk},md=Me("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Gr).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[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",To).getRegex(),Pk={...$l,lheading:Ik,table:md,paragraph:Me(Ol).replace("hr",Gr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",md).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",To).getRegex()},$k={...$l,html:Me(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Pl).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:is,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Me(Ol).replace("hr",Gr).replace("heading",` *#{1,6} *[^
|
|
18
|
-
]`).replace("lheading",ag).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Dk=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Bk=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,cg=/^( {2,}|\\)\n(?!\s*$)/,Uk=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,zs=/[\p{P}\p{S}]/u,Ao=/[\s\p{P}\p{S}]/u,Dl=/[^\s\p{P}\p{S}]/u,Fk=Me(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ao).getRegex(),ug=/(?!~)[\p{P}\p{S}]/u,zk=/(?!~)[\s\p{P}\p{S}]/u,Hk=/(?:[^\s\p{P}\p{S}]|~)/u,jk=Me(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Sk?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),dg=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Wk=Me(dg,"u").replace(/punct/g,zs).getRegex(),Kk=Me(dg,"u").replace(/punct/g,ug).getRegex(),fg="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Gk=Me(fg,"gu").replace(/notPunctSpace/g,Dl).replace(/punctSpace/g,Ao).replace(/punct/g,zs).getRegex(),Vk=Me(fg,"gu").replace(/notPunctSpace/g,Hk).replace(/punctSpace/g,zk).replace(/punct/g,ug).getRegex(),qk=Me("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Dl).replace(/punctSpace/g,Ao).replace(/punct/g,zs).getRegex(),Zk=Me(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,zs).getRegex(),Qk="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Yk=Me(Qk,"gu").replace(/notPunctSpace/g,Dl).replace(/punctSpace/g,Ao).replace(/punct/g,zs).getRegex(),Jk=Me(/\\(punct)/,"gu").replace(/punct/g,zs).getRegex(),Xk=Me(/^<(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(),e_=Me(Pl).replace("(?:-->|$)","-->").getRegex(),t_=Me("^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",e_).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),so=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,n_=Me(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",so).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),gg=Me(/^!?\[(label)\]\[(ref)\]/).replace("label",so).replace("ref",Ll).getRegex(),hg=Me(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ll).getRegex(),s_=Me("reflink|nolink(?!\\()","g").replace("reflink",gg).replace("nolink",hg).getRegex(),bd=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Bl={_backpedal:is,anyPunctuation:Jk,autolink:Xk,blockSkip:jk,br:cg,code:Bk,del:is,delLDelim:is,delRDelim:is,emStrongLDelim:Wk,emStrongRDelimAst:Gk,emStrongRDelimUnd:qk,escape:Dk,link:n_,nolink:hg,punctuation:Fk,reflink:gg,reflinkSearch:s_,tag:t_,text:Uk,url:is},r_={...Bl,link:Me(/^!?\[(label)\]\((.*?)\)/).replace("label",so).getRegex(),reflink:Me(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",so).getRegex()},al={...Bl,emStrongRDelimAst:Vk,emStrongLDelim:Kk,delLDelim:Zk,delRDelim:Yk,url:Me(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",bd).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\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Me(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",bd).getRegex()},i_={...al,br:Me(cg).replace("{2,}","*").getRegex(),text:Me(al.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Pi={normal:$l,gfm:Pk,pedantic:$k},gr={normal:Bl,gfm:al,breaks:i_,pedantic:r_},o_={"&":"&","<":"<",">":">",'"':""","'":"'"},yd=e=>o_[e];function Qt(e,t){if(t){if(dt.escapeTest.test(e))return e.replace(dt.escapeReplace,yd)}else if(dt.escapeTestNoEncode.test(e))return e.replace(dt.escapeReplaceNoEncode,yd);return e}function kd(e){try{e=encodeURI(e).replace(dt.percentDecode,"%")}catch{return null}return e}function _d(e,t){var a;let n=e.replace(dt.findPipe,(c,u,d)=>{let m=!1,p=u;for(;--p>=0&&d[p]==="\\";)m=!m;return m?"|":" |"}),r=n.split(dt.splitPipe),o=0;if(r[0].trim()||r.shift(),r.length>0&&!((a=r.at(-1))!=null&&a.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(dt.slashPipe,"|");return r}function Mn(e,t,n){let r=e.length;if(r===0)return"";let o=0;for(;o<r&&e.charAt(r-o-1)===t;)o++;return e.slice(0,r-o)}function wd(e){let t=e.split(`
|
|
19
|
-
`),n=t.length-1;for(;n>=0&&dt.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
20
|
-
`)}function a_(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function l_(e,t=0){let n=t,r="";for(let o of e)if(o===" "){let a=4-n%4;r+=" ".repeat(a),n+=a}else r+=o,n++;return r}function vd(e,t,n,r,o){let a=t.href,c=t.title||null,u=e[1].replace(o.other.outputLinkReplace,"$1");r.state.inLink=!0;let d={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:c,text:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,d}function c_(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let o=r[1];return t.split(`
|
|
21
|
-
`).map(a=>{let c=a.match(n.other.beginningSpace);if(c===null)return a;let[u]=c;return u.length>=o.length?a.slice(o.length):a}).join(`
|
|
22
|
-
`)}var ro=class{constructor(e){De(this,"options");De(this,"rules");De(this,"lexer");this.options=e||gs}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=this.options.pedantic?t[0]:wd(t[0]),r=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:r}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=c_(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:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=Mn(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:Mn(t[0],`
|
|
23
|
-
`),depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Mn(t[0],`
|
|
24
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=Mn(t[0],`
|
|
25
|
-
`).split(`
|
|
26
|
-
`),r="",o="",a=[];for(;n.length>0;){let c=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),c=!0;else if(!c)u.push(n[d]);else break;n=n.slice(d);let m=u.join(`
|
|
27
|
-
`),p=m.replace(this.rules.other.blockquoteSetextReplace,`
|
|
28
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
29
|
-
${m}`:m,o=o?`${o}
|
|
30
|
-
${p}`:p;let y=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,a,!0),this.lexer.state.top=y,n.length===0)break;let _=a.at(-1);if((_==null?void 0:_.type)==="code")break;if((_==null?void 0:_.type)==="blockquote"){let A=_,x=A.raw+`
|
|
31
|
-
`+n.join(`
|
|
32
|
-
`),O=this.blockquote(x);a[a.length-1]=O,r=r.substring(0,r.length-A.raw.length)+O.raw,o=o.substring(0,o.length-A.text.length)+O.text;break}else if((_==null?void 0:_.type)==="list"){let A=_,x=A.raw+`
|
|
33
|
-
`+n.join(`
|
|
34
|
-
`),O=this.list(x);a[a.length-1]=O,r=r.substring(0,r.length-_.raw.length)+O.raw,o=o.substring(0,o.length-A.raw.length)+O.raw,n=x.substring(a.at(-1).raw.length).split(`
|
|
35
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:a,text:o}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let a=this.rules.other.listItemRegex(n),c=!1;for(;e;){let d=!1,m="",p="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;m=t[0],e=e.substring(m.length);let y=l_(t[2].split(`
|
|
36
|
-
`,1)[0],t[1].length),_=e.split(`
|
|
37
|
-
`,1)[0],A=!y.trim(),x=0;if(this.options.pedantic?(x=2,p=y.trimStart()):A?x=t[1].length+1:(x=y.search(this.rules.other.nonSpaceChar),x=x>4?1:x,p=y.slice(x),x+=t[1].length),A&&this.rules.other.blankLine.test(_)&&(m+=_+`
|
|
38
|
-
`,e=e.substring(_.length+1),d=!0),!d){let O=this.rules.other.nextBulletRegex(x),M=this.rules.other.hrRegex(x),D=this.rules.other.fencesBeginRegex(x),l=this.rules.other.headingBeginRegex(x),R=this.rules.other.htmlBeginRegex(x),N=this.rules.other.blockquoteBeginRegex(x);for(;e;){let U=e.split(`
|
|
39
|
-
`,1)[0],Z;if(_=U,this.options.pedantic?(_=_.replace(this.rules.other.listReplaceNesting," "),Z=_):Z=_.replace(this.rules.other.tabCharGlobal," "),D.test(_)||l.test(_)||R.test(_)||N.test(_)||O.test(_)||M.test(_))break;if(Z.search(this.rules.other.nonSpaceChar)>=x||!_.trim())p+=`
|
|
40
|
-
`+Z.slice(x);else{if(A||y.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||D.test(y)||l.test(y)||M.test(y))break;p+=`
|
|
41
|
-
`+_}A=!_.trim(),m+=U+`
|
|
42
|
-
`,e=e.substring(U.length+1),y=Z.slice(x)}}o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(c=!0)),o.items.push({type:"list_item",raw:m,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),o.raw+=m}let u=o.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let d of o.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let m=d.tokens[0];if(d.task&&((m==null?void 0:m.type)==="text"||(m==null?void 0:m.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),m.raw=m.raw.replace(this.rules.other.listReplaceTask,""),m.text=m.text.replace(this.rules.other.listReplaceTask,"");for(let y=this.lexer.inlineQueue.length-1;y>=0;y--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[y].src)){this.lexer.inlineQueue[y].src=this.lexer.inlineQueue[y].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(d.raw);if(p){let y={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};d.checked=y.checked,o.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=y.raw+d.tokens[0].raw,d.tokens[0].text=y.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(y)):d.tokens.unshift({type:"paragraph",raw:y.raw,text:y.raw,tokens:[y]}):d.tokens.unshift(y)}}else d.task&&(d.task=!1);if(!o.loose){let p=d.tokens.filter(_=>_.type==="space"),y=p.length>0&&p.some(_=>this.rules.other.anyLine.test(_.raw));o.loose=y}}if(o.loose)for(let d of o.items){d.loose=!0;for(let m of d.tokens)m.type==="text"&&(m.type="paragraph")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let n=wd(t[0]);return{type:"html",block:!0,raw:n,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:n}}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=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:Mn(t[0],`
|
|
43
|
-
`),href:r,title:o}}}table(e){var c;let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=_d(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(c=t[3])!=null&&c.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
44
|
-
`):[],a={type:"table",raw:Mn(t[0],`
|
|
45
|
-
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let u of r)this.rules.other.tableAlignRight.test(u)?a.align.push("right"):this.rules.other.tableAlignCenter.test(u)?a.align.push("center"):this.rules.other.tableAlignLeft.test(u)?a.align.push("left"):a.align.push(null);for(let u=0;u<n.length;u++)a.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:a.align[u]});for(let u of o)a.rows.push(_d(u,a.header.length).map((d,m)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:a.align[m]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:Mn(t[0],`
|
|
46
|
-
`),depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
47
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let 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){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let 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){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=Mn(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=a_(t[2],"()");if(a===-2)return;if(a>-1){let c=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let r=t[2],o="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(r);a&&(r=a[1],o=a[3])}else o=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),vd(t,{href:r&&r.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))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=t[r.toLowerCase()];if(!o){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return vd(n,o,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let o=[...r[0]].length-1,a,c,u=o,d=0,m=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,t=t.slice(-1*e.length+o);(r=m.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(c=[...a].length,r[3]||r[4]){u+=c;continue}else if((r[5]||r[6])&&o%3&&!((o+c)%3)){d+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+d);let p=[...r[0]][0].length,y=e.slice(0,o+r.index+p+c);if(Math.min(o,c)%2){let A=y.slice(1,-1);return{type:"em",raw:y,text:A,tokens:this.lexer.inlineTokens(A)}}let _=y.slice(2,-2);return{type:"strong",raw:y,text:_,tokens:this.lexer.inlineTokens(_)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),o=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&o&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let o=[...r[0]].length-1,a,c,u=o,d=this.rules.inline.delRDelim;for(d.lastIndex=0,t=t.slice(-1*e.length+o);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a||(c=[...a].length,c!==o))continue;if(r[3]||r[4]){u+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u);let m=[...r[0]][0].length,p=e.slice(0,o+r.index+m+c),y=p.slice(o,-o);return{type:"del",raw:p,text:y,tokens:this.lexer.inlineTokens(y)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,o;if(t[2]==="@")r=t[0],o="mailto:"+r;else{let a;do a=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(a!==t[0]);r=t[0],t[1]==="www."?o="http://"+t[0]:o=t[0]}return{type:"link",raw:t[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},Ut=class ll{constructor(t){De(this,"tokens");De(this,"options");De(this,"state");De(this,"inlineQueue");De(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||gs,this.options.tokenizer=this.options.tokenizer||new ro,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:dt,block:Pi.normal,inline:gr.normal};this.options.pedantic?(n.block=Pi.pedantic,n.inline=gr.pedantic):this.options.gfm&&(n.block=Pi.gfm,this.options.breaks?n.inline=gr.breaks:n.inline=gr.gfm),this.tokenizer.rules=n}static get rules(){return{block:Pi,inline:gr}}static lex(t,n){return new ll(n).lex(t)}static lexInline(t,n){return new ll(n).inlineTokens(t)}lex(t){t=t.replace(dt.carriageReturn,`
|
|
48
|
-
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var a,c,u;this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(dt.tabCharGlobal," ").replace(dt.spaceLine,""));let o=1/0;for(;t;){if(t.length<o)o=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let d;if((c=(a=this.options.extensions)==null?void 0:a.block)!=null&&c.some(p=>(d=p.call({lexer:this},t,n))?(t=t.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.space(t)){t=t.substring(d.raw.length);let p=n.at(-1);d.raw.length===1&&p!==void 0?p.raw+=`
|
|
49
|
-
`:n.push(d);continue}if(d=this.tokenizer.code(t)){t=t.substring(d.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
|
|
50
|
-
`)?"":`
|
|
51
|
-
`)+d.raw,p.text+=`
|
|
52
|
-
`+d.text,this.inlineQueue.at(-1).src=p.text):n.push(d);continue}if(d=this.tokenizer.fences(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.heading(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.hr(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.blockquote(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.list(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.html(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.def(t)){t=t.substring(d.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
|
|
53
|
-
`)?"":`
|
|
54
|
-
`)+d.raw,p.text+=`
|
|
55
|
-
`+d.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title},n.push(d));continue}if(d=this.tokenizer.table(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.lheading(t)){t=t.substring(d.raw.length),n.push(d);continue}let m=t;if((u=this.options.extensions)!=null&&u.startBlock){let p=1/0,y=t.slice(1),_;this.options.extensions.startBlock.forEach(A=>{_=A.call({lexer:this},y),typeof _=="number"&&_>=0&&(p=Math.min(p,_))}),p<1/0&&p>=0&&(m=t.substring(0,p+1))}if(this.state.top&&(d=this.tokenizer.paragraph(m))){let p=n.at(-1);r&&(p==null?void 0:p.type)==="paragraph"?(p.raw+=(p.raw.endsWith(`
|
|
56
|
-
`)?"":`
|
|
57
|
-
`)+d.raw,p.text+=`
|
|
58
|
-
`+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):n.push(d),r=m.length!==t.length,t=t.substring(d.raw.length);continue}if(d=this.tokenizer.text(t)){t=t.substring(d.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
|
|
59
|
-
`)?"":`
|
|
60
|
-
`)+d.raw,p.text+=`
|
|
61
|
-
`+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):n.push(d);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var m,p,y,_,A;this.tokenizer.lexer=this;let r=t,o=null;if(this.tokens.links){let x=Object.keys(this.tokens.links);if(x.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)x.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,o.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)a=o[2]?o[2].length:0,r=r.slice(0,o.index+a)+"["+"a".repeat(o[0].length-a-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((p=(m=this.options.hooks)==null?void 0:m.emStrongMask)==null?void 0:p.call({lexer:this},r))??r;let c=!1,u="",d=1/0;for(;t;){if(t.length<d)d=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}c||(u=""),c=!1;let x;if((_=(y=this.options.extensions)==null?void 0:y.inline)!=null&&_.some(M=>(x=M.call({lexer:this},t,n))?(t=t.substring(x.raw.length),n.push(x),!0):!1))continue;if(x=this.tokenizer.escape(t)){t=t.substring(x.raw.length),n.push(x);continue}if(x=this.tokenizer.tag(t)){t=t.substring(x.raw.length),n.push(x);continue}if(x=this.tokenizer.link(t)){t=t.substring(x.raw.length),n.push(x);continue}if(x=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(x.raw.length);let M=n.at(-1);x.type==="text"&&(M==null?void 0:M.type)==="text"?(M.raw+=x.raw,M.text+=x.text):n.push(x);continue}if(x=this.tokenizer.emStrong(t,r,u)){t=t.substring(x.raw.length),n.push(x);continue}if(x=this.tokenizer.codespan(t)){t=t.substring(x.raw.length),n.push(x);continue}if(x=this.tokenizer.br(t)){t=t.substring(x.raw.length),n.push(x);continue}if(x=this.tokenizer.del(t,r,u)){t=t.substring(x.raw.length),n.push(x);continue}if(x=this.tokenizer.autolink(t)){t=t.substring(x.raw.length),n.push(x);continue}if(!this.state.inLink&&(x=this.tokenizer.url(t))){t=t.substring(x.raw.length),n.push(x);continue}let O=t;if((A=this.options.extensions)!=null&&A.startInline){let M=1/0,D=t.slice(1),l;this.options.extensions.startInline.forEach(R=>{l=R.call({lexer:this},D),typeof l=="number"&&l>=0&&(M=Math.min(M,l))}),M<1/0&&M>=0&&(O=t.substring(0,M+1))}if(x=this.tokenizer.inlineText(O)){t=t.substring(x.raw.length),x.raw.slice(-1)!=="_"&&(u=x.raw.slice(-1)),c=!0;let M=n.at(-1);(M==null?void 0:M.type)==="text"?(M.raw+=x.raw,M.text+=x.text):n.push(x);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return n}infiniteLoopError(t){let n="Infinite loop on byte: "+t;if(this.options.silent)console.error(n);else throw new Error(n)}},io=class{constructor(e){De(this,"options");De(this,"parser");this.options=e||gs}space(e){return""}code({text:e,lang:t,escaped:n}){var a;let r=(a=(t||"").match(dt.notSpaceStart))==null?void 0:a[0],o=e.replace(dt.endingNewline,"")+`
|
|
62
|
-
`;return r?'<pre><code class="language-'+Qt(r)+'">'+(n?o:Qt(o,!0))+`</code></pre>
|
|
63
|
-
`:"<pre><code>"+(n?o:Qt(o,!0))+`</code></pre>
|
|
64
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
65
|
-
${this.parser.parse(e)}</blockquote>
|
|
66
|
-
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
67
|
-
`}hr(e){return`<hr>
|
|
68
|
-
`}list(e){let t=e.ordered,n=e.start,r="";for(let c=0;c<e.items.length;c++){let u=e.items[c];r+=this.listitem(u)}let o=t?"ol":"ul",a=t&&n!==1?' start="'+n+'"':"";return"<"+o+a+`>
|
|
69
|
-
`+r+"</"+o+`>
|
|
70
|
-
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
71
|
-
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
72
|
-
`}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 r="";for(let o=0;o<e.rows.length;o++){let a=e.rows[o];n="";for(let c=0;c<a.length;c++)n+=this.tablecell(a[c]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
73
|
-
<thead>
|
|
74
|
-
`+t+`</thead>
|
|
75
|
-
`+r+`</table>
|
|
76
|
-
`}tablerow({text:e}){return`<tr>
|
|
77
|
-
${e}</tr>
|
|
78
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
79
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Qt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),o=kd(e);if(o===null)return r;e=o;let a='<a href="'+e+'"';return t&&(a+=' title="'+Qt(t)+'"'),a+=">"+r+"</a>",a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let o=kd(e);if(o===null)return Qt(n);e=o;let a=`<img src="${e}" alt="${Qt(n)}"`;return t&&(a+=` title="${Qt(t)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Qt(e.text)}},Ul=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""}checkbox({raw:e}){return e}},Ft=class cl{constructor(t){De(this,"options");De(this,"renderer");De(this,"textRenderer");this.options=t||gs,this.options.renderer=this.options.renderer||new io,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ul}static parse(t,n){return new cl(n).parse(t)}static parseInline(t,n){return new cl(n).parseInline(t)}parse(t){var r,o;this.renderer.parser=this;let n="";for(let a=0;a<t.length;a++){let c=t[a];if((o=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&o[c.type]){let d=c,m=this.options.extensions.renderers[d.type].call({parser:this},d);if(m!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=m||"";continue}}let u=c;switch(u.type){case"space":{n+=this.renderer.space(u);break}case"hr":{n+=this.renderer.hr(u);break}case"heading":{n+=this.renderer.heading(u);break}case"code":{n+=this.renderer.code(u);break}case"table":{n+=this.renderer.table(u);break}case"blockquote":{n+=this.renderer.blockquote(u);break}case"list":{n+=this.renderer.list(u);break}case"checkbox":{n+=this.renderer.checkbox(u);break}case"html":{n+=this.renderer.html(u);break}case"def":{n+=this.renderer.def(u);break}case"paragraph":{n+=this.renderer.paragraph(u);break}case"text":{n+=this.renderer.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(t,n=this.renderer){var o,a;this.renderer.parser=this;let r="";for(let c=0;c<t.length;c++){let u=t[c];if((a=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&a[u.type]){let m=this.options.extensions.renderers[u.type].call({parser:this},u);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){r+=m||"";continue}}let d=u;switch(d.type){case"escape":{r+=n.text(d);break}case"html":{r+=n.html(d);break}case"link":{r+=n.link(d);break}case"image":{r+=n.image(d);break}case"checkbox":{r+=n.checkbox(d);break}case"strong":{r+=n.strong(d);break}case"em":{r+=n.em(d);break}case"codespan":{r+=n.codespan(d);break}case"br":{r+=n.br(d);break}case"del":{r+=n.del(d);break}case"text":{r+=n.text(d);break}default:{let m='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return r}},Hi,kr=(Hi=class{constructor(e){De(this,"options");De(this,"block");this.options=e||gs}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Ut.lex:Ut.lexInline}provideParser(e=this.block){return e?Ft.parse:Ft.parseInline}},De(Hi,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),De(Hi,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Hi),u_=class{constructor(...e){De(this,"defaults",Rl());De(this,"options",this.setOptions);De(this,"parse",this.parseMarkdown(!0));De(this,"parseInline",this.parseMarkdown(!1));De(this,"Parser",Ft);De(this,"Renderer",io);De(this,"TextRenderer",Ul);De(this,"Lexer",Ut);De(this,"Tokenizer",ro);De(this,"Hooks",kr);this.use(...e)}walkTokens(e,t){var r,o;let n=[];for(let a of e)switch(n=n.concat(t.call(this,a)),a.type){case"table":{let c=a;for(let u of c.header)n=n.concat(this.walkTokens(u.tokens,t));for(let u of c.rows)for(let d of u)n=n.concat(this.walkTokens(d.tokens,t));break}case"list":{let c=a;n=n.concat(this.walkTokens(c.items,t));break}default:{let c=a;(o=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&o[c.type]?this.defaults.extensions.childTokens[c.type].forEach(u=>{let d=c[u].flat(1/0);n=n.concat(this.walkTokens(d,t))}):c.tokens&&(n=n.concat(this.walkTokens(c.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let a=t.renderers[o.name];a?t.renderers[o.name]=function(...c){let u=o.renderer.apply(this,c);return u===!1&&(u=a.apply(this,c)),u}: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'");let a=t[o.level];a?a.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)}),r.extensions=t),n.renderer){let o=this.defaults.renderer||new io(this.defaults);for(let a in n.renderer){if(!(a in o))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let c=a,u=n.renderer[c],d=o[c];o[c]=(...m)=>{let p=u.apply(o,m);return p===!1&&(p=d.apply(o,m)),p||""}}r.renderer=o}if(n.tokenizer){let o=this.defaults.tokenizer||new ro(this.defaults);for(let a in n.tokenizer){if(!(a in o))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let c=a,u=n.tokenizer[c],d=o[c];o[c]=(...m)=>{let p=u.apply(o,m);return p===!1&&(p=d.apply(o,m)),p}}r.tokenizer=o}if(n.hooks){let o=this.defaults.hooks||new kr;for(let a in n.hooks){if(!(a in o))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let c=a,u=n.hooks[c],d=o[c];kr.passThroughHooks.has(a)?o[c]=m=>{if(this.defaults.async&&kr.passThroughHooksRespectAsync.has(a))return(async()=>{let y=await u.call(o,m);return d.call(o,y)})();let p=u.call(o,m);return d.call(o,p)}:o[c]=(...m)=>{if(this.defaults.async)return(async()=>{let y=await u.apply(o,m);return y===!1&&(y=await d.apply(o,m)),y})();let p=u.apply(o,m);return p===!1&&(p=d.apply(o,m)),p}}r.hooks=o}if(n.walkTokens){let o=this.defaults.walkTokens,a=n.walkTokens;r.walkTokens=function(c){let u=[];return u.push(a.call(this,c)),o&&(u=u.concat(o.call(this,c))),u}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Ut.lex(e,t??this.defaults)}parser(e,t){return Ft.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},o={...this.defaults,...r},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&r.async===!1)return a(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 t>"u"||t===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let c=o.hooks?await o.hooks.preprocess(t):t,u=await(o.hooks?await o.hooks.provideLexer(e):e?Ut.lex:Ut.lexInline)(c,o),d=o.hooks?await o.hooks.processAllTokens(u):u;o.walkTokens&&await Promise.all(this.walkTokens(d,o.walkTokens));let m=await(o.hooks?await o.hooks.provideParser(e):e?Ft.parse:Ft.parseInline)(d,o);return o.hooks?await o.hooks.postprocess(m):m})().catch(a);try{o.hooks&&(t=o.hooks.preprocess(t));let c=(o.hooks?o.hooks.provideLexer(e):e?Ut.lex:Ut.lexInline)(t,o);o.hooks&&(c=o.hooks.processAllTokens(c)),o.walkTokens&&this.walkTokens(c,o.walkTokens);let u=(o.hooks?o.hooks.provideParser(e):e?Ft.parse:Ft.parseInline)(c,o);return o.hooks&&(u=o.hooks.postprocess(u)),u}catch(c){return a(c)}}}onError(e,t){return n=>{if(n.message+=`
|
|
80
|
-
Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+Qt(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},fs=new u_;function Ie(e,t){return fs.parse(e,t)}Ie.options=Ie.setOptions=function(e){return fs.setOptions(e),Ie.defaults=fs.defaults,ig(Ie.defaults),Ie};Ie.getDefaults=Rl;Ie.defaults=gs;Ie.use=function(...e){return fs.use(...e),Ie.defaults=fs.defaults,ig(Ie.defaults),Ie};Ie.walkTokens=function(e,t){return fs.walkTokens(e,t)};Ie.parseInline=fs.parseInline;Ie.Parser=Ft;Ie.parser=Ft.parse;Ie.Renderer=io;Ie.TextRenderer=Ul;Ie.Lexer=Ut;Ie.lexer=Ut.lex;Ie.Tokenizer=ro;Ie.Hooks=kr;Ie.parse=Ie;Ie.options;Ie.setOptions;Ie.use;Ie.walkTokens;Ie.parseInline;Ft.parse;Ut.lex;const d_={key:0,class:"terminal-output-reader","aria-label":"终端运行输出"},f_={key:0,class:"background-task-live-output",tabindex:"0"},g_={key:1,class:"background-task-live-output terminal-stderr",tabindex:"0"},h_={__name:"TerminalOutputReader",props:{ownerSessionId:String,runId:String},setup(e){const t=e,n=ls({record:null,stdout:"",stderr:"",offsets:{stdout:0,stderr:0}});let r=0,o,a;async function c(){var d;const u=r;try{for(const m of["stdout","stderr"]){let p;do{const y=n.offsets[m],_=new URLSearchParams({sessionId:t.ownerSessionId,runId:t.runId,stream:m,offset:String(y),limitBytes:"65536"}),A=await fetch(`/api/terminal-output?${_}`,{signal:a.signal,cache:"no-store"});if(u!==r||!A.ok)return;const x=await A.json();if(u!==r||x.sessionId!==t.ownerSessionId||x.runId!==t.runId||x.stream!==m||x.offset!==y||!Number.isSafeInteger(x.nextOffset)||x.nextOffset<y||(n.record=x.record,((d=x.record)==null?void 0:d.availability)!=="available"||typeof x.text!="string")||x.text&&x.nextOffset===y)return;if(p??(p=x.record.streams[m].storedBytes),n[m]+=x.text,n.offsets[m]=x.nextOffset,x.endOfStoredOutput||x.nextOffset>=p)break}while(u===r)}}catch{}finally{u===r&&(!n.record||n.record.lifecycle==="running")&&(o=setTimeout(c,1e3))}}return nt(()=>[t.ownerSessionId,t.runId],()=>{r++,a==null||a.abort(),a=new AbortController,clearTimeout(o),Object.assign(n,{record:null,stdout:"",stderr:"",offsets:{stdout:0,stderr:0}}),t.ownerSessionId&&t.runId&&c()},{immediate:!0,flush:"pre"}),Bn(()=>{r++,a==null||a.abort(),clearTimeout(o)}),(u,d)=>n.stdout||n.stderr?(k(),w("section",d_,[n.stdout?(k(),w("pre",f_,C(n.stdout),1)):V("",!0),n.stderr?(k(),w("pre",g_,C(n.stderr),1)):V("",!0)])):V("",!0)}},p_=["report","timeline","messages","delegation"],m_=(e,t)=>e.ownerSessionId===t.ownerSessionId&&e.taskId===t.taskId&&e.runGeneration===t.runGeneration,b_=e=>typeof e.ownerSessionId=="string"&&!!e.ownerSessionId&&typeof e.taskId=="string"&&!!e.taskId&&Number.isSafeInteger(e.runGeneration)&&e.runGeneration>0;function y_(e,t,n,r=!1){if(!b_(e)||!p_.includes(t)||r&&(!n||t!=="timeline"))throw new Error("所属会话、任务、轮次或读取方式无效");const o=new URLSearchParams({sessionId:e.ownerSessionId,taskId:e.taskId,runGeneration:String(e.runGeneration),view:t,pageChars:"16000"});return n&&o.set("cursor",n),r&&o.set("refresh","true"),`/api/agent-content?${o}`}const k_=["complete","truncated","missing","unavailable"];function xd(e,t){if(!t||!k_.includes(t.state)||typeof t.text!="string"||!Number.isSafeInteger(t.offset)||t.offset<0||!Number.isSafeInteger(t.totalChars)||t.totalChars<0||typeof t.hasMore!="boolean")throw new Error("内容分片格式无效");const n=t.offset+t.text.length;if(n>t.totalChars||t.hasMore!==n<t.totalChars)throw new Error("内容分片范围无效");if(e&&(e.totalChars!==t.totalChars||e.state!==t.state))throw new Error("分片源内容已改变,请重新读取");const r=(e==null?void 0:e.text)??"";if(t.offset>r.length)throw new Error("内容分片缺页,请重新读取");const o=Math.min(r.length-t.offset,t.text.length);if(r.slice(t.offset,t.offset+o)!==t.text.slice(0,o))throw new Error("内容分片冲突,请重新读取");const a=r+t.text.slice(o);return{...t,offset:0,text:a,hasMore:a.length<t.totalChars}}function pg(){return{page:null,items:[],fragment:null}}function __(e,t,n,r,o="next"){var u,d,m,p,y;if(!t||!m_(t,n))throw new Error("响应所属会话、任务或轮次不匹配,已丢弃");if(!["complete","partial","missing","unavailable"].includes(t.state))throw new Error("未知内容读取状态");for(const _ of["nextCursor","refreshCursor","snapshotId"])if(t[_]!==void 0&&(typeof t[_]!="string"||!t[_]))throw new Error("响应游标或快照无效");const a=o==="start"?pg():e;if(o==="next"&&((u=a.page)!=null&&u.snapshotId)&&t.snapshotId&&a.page.snapshotId!==t.snapshotId)throw new Error("分页快照已改变,请重新读取");if(o==="refresh"&&(r!=="timeline"||!((d=a.page)!=null&&d.refreshCursor)||a.page.nextCursor))throw new Error("尚未读完快照,不能增量刷新");if(t.state==="partial"&&!t.nextCursor)throw new Error("分页未完成但未提供继续游标");if(t.nextCursor&&t.refreshCursor)throw new Error("分页与刷新游标冲突");if(t.state==="unavailable")return{...a,page:t};if(r==="timeline"){if(!Array.isArray(t.items)&&t.state!=="missing")throw new Error("过程页未提供 items");const _=a.items.slice(),A=new Map(_.map((x,O)=>[x.id,O]));for(const x of t.items??[]){if(!x||typeof x.id!="string"||!x.id||!["assistant","tool_use","tool_result"].includes(x.kind))throw new Error("过程条目身份或类型无效");const O=A.get(x.id),M=O===void 0?void 0:_[O];if(M&&(M.kind!==x.kind||M.messageId!==x.messageId||M.toolUseId!==x.toolUseId||M.toolName!==x.toolName))throw new Error("过程条目身份冲突");const D={...x,content:xd(M==null?void 0:M.content,x.content)};O===void 0?(A.set(x.id,_.length),_.push(D)):_[O]=D}return{page:t,items:_,fragment:null}}if(r==="delegation"&&t.delegation&&t.delegation.scope!=="task")throw new Error("未知委派 scope;不展示上下文或续跑指令");const c=r==="delegation"?(m=t.delegation)==null?void 0:m.prompt:r==="messages"?(p=t.messages)==null?void 0:p.content:(y=t.report)==null?void 0:y.content;if(!c&&t.state!=="missing")throw new Error("读取页未提供正文");return{page:t,items:[],fragment:c?xd(a.fragment,c):null}}const w_={class:"agent-content-reader agent-parent-messages","aria-label":"代理消息"},v_=["innerHTML"],x_={key:0,class:"reader-error",role:"alert"},S_={__name:"AgentExchangeReader",props:{ownerSessionId:String,task:Object,renderMarkdown:Function},setup(e){const t=e,n=Be([]),r=Be("");let o=0,a,c;const u={whiteSpace:"pre-wrap",overflowWrap:"anywhere"};async function d(){const m=++o;a==null||a.abort(),a=new AbortController;const p=a.signal;clearTimeout(c);const y=t.task,_=t.ownerSessionId;if(!(y!=null&&y.taskId)||!_||!Number.isSafeInteger(y.runGeneration))return;const A=()=>m===o&&!p.aborted,x=[];let O=!1;async function M(N,U){var ne;const Z={ownerSessionId:_,taskId:y.taskId,runGeneration:U};let se=pg(),oe;do{const de=await fetch(y_(Z,N,oe),{signal:p,cache:"no-store"});if(!de.ok)throw new Error("加载失败");const ye=await de.json();if(!A())return"";if(ye.state==="unavailable")throw new Error("加载失败");if(se=__(se,ye,Z,N,oe?"next":"start"),oe&&ye.nextCursor===oe)throw new Error("加载失败");oe=ye.nextCursor}while(oe&&A());return((ne=se.fragment)==null?void 0:ne.text)||""}async function D(N,U){try{return await M(N,U)}catch(Z){return A()&&Z.name!=="AbortError"&&(O=!0),""}}function l(N,U,Z){typeof Z=="string"&&Z.trim()&&x.push({id:N,direction:U,text:Z})}l("delegation","主代理 → 子代理",await D("delegation",y.runGeneration));const R=[...y.runHistory||[],y].filter(N=>Number.isSafeInteger(N.runGeneration)).sort((N,U)=>N.runGeneration-U.runGeneration);for(const N of R){if(!A())return;const U=await D("messages",N.runGeneration);try{const Z=JSON.parse(U||"[]");if(!Array.isArray(Z))throw new Error;for(const se of Z)l(`message:${N.runGeneration}:${se.id}`,"主代理 → 子代理",se.text)}catch{O=!0}l(`report:${N.runGeneration}`,"子代理 → 主代理",await D("report",N.runGeneration))}A()&&(n.value=x,r.value=O?"加载失败":"",["pending","running"].includes(y.status)&&(c=setTimeout(d,3e3)))}return nt(()=>{var m,p,y;return[t.ownerSessionId,(m=t.task)==null?void 0:m.taskId,(p=t.task)==null?void 0:p.runGeneration,(y=t.task)==null?void 0:y.status]},()=>{n.value=[],r.value="",d()},{immediate:!0}),Bn(()=>{o++,a==null||a.abort(),clearTimeout(c)}),(m,p)=>(k(),w("section",w_,[(k(!0),w(ue,null,Te(n.value,y=>(k(),w("article",{key:y.id,class:"agent-parent-message"},[f("header",null,[f("strong",null,C(y.direction),1)]),e.renderMarkdown?(k(),w("div",{key:0,class:"markdown",innerHTML:e.renderMarkdown(y.text)},null,8,v_)):(k(),w("pre",{key:1,style:u},C(y.text),1))]))),128)),r.value?(k(),w("p",x_,C(r.value),1)):V("",!0)]))}};function E_(e,t,n){const r=new Array(e);return new Proxy(r,{get(o,a,c){if(typeof a=="string"){const u=a.charCodeAt(0);if(u>=48&&u<=57){const d=+a;if(Number.isInteger(d)&&d>=0&&d<e){let m=o[d];if(!m){const p=t[d*2];m=o[d]={index:d,key:n(d),start:p,size:t[d*2+1],end:p+t[d*2+1],lane:0}}return m}}if(a==="length")return e}return Reflect.get(o,a,c)}})}function Es(e,t,n){let r=n.initialDeps??[],o,a=!0;function c(){const u=e();return(u.length!==r.length||u.some((m,p)=>r[p]!==m))&&(r=u,o=t(...u),n!=null&&n.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(o),a=!1),o}return c.updateDeps=u=>{r=u},c}function Sd(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const T_=(e,t)=>Math.abs(e-t)<1.01,A_=(e,t,n)=>{let r;return Object.assign(function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)},{cancel:()=>{e.clearTimeout(r)}})};let hr;const Ra=()=>{if(hr!==void 0)return hr;if(typeof navigator>"u")return hr=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return hr=!0;const e=navigator.maxTouchPoints;return hr=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Ed=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},C_=e=>e,mg=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,o=new Array(r);for(let a=0;a<r;a++)o[a]=t+a;return o},I_=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=c=>{const{width:u,height:d}=c;t({width:Math.round(u),height:Math.round(d)})};if(o(Ed(n)),!r.ResizeObserver)return()=>{};const a=new r.ResizeObserver(c=>{const u=()=>{const d=c[0];if(d!=null&&d.borderBoxSize){const m=d.borderBoxSize[0];if(m){o({width:m.inlineSize,height:m.blockSize});return}}o(Ed(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()});return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},oo={passive:!0},M_=typeof window>"u"?!0:"onscrollend"in window,R_=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;const a=e.options.useScrollendEvent&&M_;let c=0;const u=a?null:A_(o,()=>t(c,!1),e.options.isScrollingResetDelay),d=y=>()=>{c=n(r),u==null||u(),t(c,y)},m=d(!0),p=d(!1);return r.addEventListener("scroll",m,oo),a&&r.addEventListener("scrollend",p,oo),()=>{r.removeEventListener("scroll",m),a&&r.removeEventListener("scrollend",p),u==null||u.cancel()}},N_=(e,t)=>R_(e,t,n=>{const{horizontal:r,isRtl:o}=e.options;return r?n.scrollLeft*(o&&-1||1):n.scrollTop}),O_=(e,t,n)=>{if(n.options.useCachedMeasurements){const r=n.indexFromElement(e),o=n.options.getItemKey(r);return n.itemSizeCache.get(o)??n.options.estimateSize(r)}if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const r=n.indexFromElement(e),o=n.options.getItemKey(r),a=n.itemSizeCache.get(o);if(a!==void 0)return a}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},L_=(e,{adjustments:t=0,behavior:n},r)=>{var o,a;(a=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||a.call(o,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})},P_=L_;class $_{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,o;return((o=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:o.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(a=>{const c=()=>{const u=a.target,d=this.indexFromElement(u);if(!u.isConnected){this.observer.unobserve(u);for(const[m,p]of this.elementsCache)if(p===u){this.elementsCache.delete(m);break}return}this.isIndexInRange(d)&&this.shouldMeasureDuringScroll(d)&&this.resizeItem(d,this.options.measureElement(u,a,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var a;return(a=r())==null?void 0:a.observe(o,{box:"border-box"})},unobserve:o=>{var a;return(a=r())==null?void 0:a.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{var r,o;const a={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:C_,rangeExtractor:mg,onChange:()=>{},measureElement:O_,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const _ in n){const A=n[_];A!==void 0&&(a[_]=A)}const c=this.options;let u=null,d=null,m=!1;if(c!==void 0&&c.enabled&&a.enabled&&a.anchorTo==="end"&&this.scrollElement!==null){const _=c.count,A=a.count,x=this.getMeasurements(),O=_>0?((r=x[0])==null?void 0:r.key)??c.getItemKey(0):null,M=_>0?((o=x[_-1])==null?void 0:o.key)??c.getItemKey(_-1):null;if(A!==_||_>0&&A>0&&(a.getItemKey(0)!==O||a.getItemKey(A-1)!==M)){m=!0;const R=_>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;R&&(u=[R.key,this.getScrollOffset()-R.start]);const N=a.followOnAppend===!0?"auto":a.followOnAppend||null;N&&A>_&&this.isAtEnd(c.scrollEndThreshold)&&(_===0||a.getItemKey(A-1)!==M)&&(d=N)}}this.options=a,m&&(this.pendingMin=0,this.itemSizeCacheVersion++);let p=!1,y=0;if(u&&this.scrollOffset!==null){const[_,A]=u,x=this.getMeasurements(),{count:O,getItemKey:M}=this.options;let D=0;for(;D<O&&M(D)!==_;)D++;if(D<O){const l=x[D];if(l){const R=Math.max(0,l.start+A);R!==this.scrollOffset&&(y=R-this.scrollOffset,this.scrollOffset=R,p=!0)}}}(p||d)&&(this.pendingScrollAnchor=[p?u[0]:null,p?u[1]:0,d,y])},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=Es(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(a=>{this.observer.observe(a)}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(a,c)=>{if(c&&this._intendedScrollOffset===null&&a===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(a-this._intendedScrollOffset)<1.5&&(a=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const u=this.getScrollOffset();this.scrollDirection=c?u===a?this.scrollDirection:u<a?"forward":"backward":null,this.scrollOffset=a,this.isScrolling=c,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const a=this.scrollElement,c=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},u=()=>{this._iosTouching=!1,!(!Ra()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};a.addEventListener("touchstart",c,oo),a.addEventListener("touchend",u,oo),this.unsubs.push(()=>{a.removeEventListener("touchstart",c),a.removeEventListener("touchend",u),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const o=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,o&&this.scrollElement&&this.options.enabled){const[a,c,u,d]=o;a!==null&&!u&&(Ra()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?d!==0&&(this._iosDeferredAdjustment+=d):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),u&&this.scrollToEnd({behavior:u})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;if(this._iosDeferredAdjustment<0&&n>=r-1){this._iosDeferredAdjustment=0;return}const o=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=o,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Es(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(n,r,o,a,c,u,d,m)=>(this.prevLanes!==void 0&&this.prevLanes!==u&&(this.lanesChangedFlag=!0),this.prevLanes=u,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:o,getItemKey:a,enabled:c,lanes:u,laneAssignmentMode:d,gap:m}),{key:!1}),this.isIndexInRange=n=>n>=0&&n<this.options.count,this.getMeasurements=Es(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:o,getItemKey:a,enabled:c,lanes:u,laneAssignmentMode:d,gap:m},p)=>{const y=this.itemSizeCache;if(!c)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const D of this.laneAssignments.keys())D>=n&&this.laneAssignments.delete(D);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(D=>{this.itemSizeCache.set(D.key,D.size)}));const _=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),u===1){const D=n*2;let l=this._flatMeasurements;if(!l||l.length<D){const U=new Float64Array(D);l&&_>0&&U.set(l.subarray(0,_*2)),l=U,this._flatMeasurements=l}let R;if(_===0)R=r+o;else{const U=_-1;R=l[U*2]+l[U*2+1]+m}for(let U=_;U<n;U++){const Z=a(U),se=y.get(Z),oe=typeof se=="number"?se:this.options.estimateSize(U);l[U*2]=R,l[U*2+1]=oe,R+=oe+m}const N=E_(n,l,a);return this.measurementsCache=N,N}const A=this.measurementsCache.slice(0,_),x=new Array(u).fill(void 0),O=new Float64Array(u);let M=0;for(let D=0;D<_;D++){const l=A[D];l&&(x[l.lane]===void 0&&M++,x[l.lane]=D,O[l.lane]=l.end)}for(let D=_;D<n;D++){const l=a(D),R=this.laneAssignments.get(D);let N,U;const Z=d==="estimate"||y.has(l);if(R!==void 0&&this.options.lanes>1){N=R;const de=x[N],ye=de!==void 0?A[de]:void 0;U=ye?ye.end+m:r+o}else if(M===u){let de=0,ye=O[0],Q=x[0];for(let ke=1;ke<u;ke++){const Ee=O[ke];(Ee<ye||Ee===ye&&x[ke]<Q)&&(de=ke,ye=Ee,Q=x[ke])}N=de,U=ye+m,Z&&this.laneAssignments.set(D,N)}else N=D%this.options.lanes,U=r+o,Z&&this.laneAssignments.set(D,N);const se=y.get(l),oe=typeof se=="number"?se:this.options.estimateSize(D),ne=U+oe;A[D]={index:D,start:U,size:oe,end:ne,key:l,lane:N},x[N]===void 0&&M++,x[N]=D,O[N]=ne}return this.measurementsCache=A,A},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Es(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,a)=>n.length===0||r===0?(this.range=null,null):(this.range=B_(n,r,o,a,a===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Es(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,a,c)=>a===null||c===null?[]:n({startIndex:a,endIndex:c,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(o!==void 0&&this.range){const a=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),c=Math.max(0,o-a),u=Math.min(this.options.count-1,o+a);return n>=c&&n<=u}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((c,u)=>{c.isConnected||(this.observer.unobserve(c),this.elementsCache.delete(u))});return}const r=this.indexFromElement(n);if(!this.isIndexInRange(r))return;const o=this.options.getItemKey(r),a=this.elementsCache.get(o);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(o,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var o,a;if(!this.isIndexInRange(n))return;let c,u,d;const m=this._flatMeasurements;if(this.options.lanes===1&&m!==null)d=this.options.getItemKey(n),u=m[n*2],c=m[n*2+1];else{const _=this.measurementsCache[n];if(!_)return;d=_.key,u=_.start,c=_.size}const p=this.itemSizeCache.get(d)??c,y=r-p;if(y!==0){const _=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,A=_?this.getTotalSize():0,x=this.getScrollOffset()+this.scrollAdjustments,M=!this.itemSizeCache.has(d)?u<x:u+p<=x&&this.scrollDirection!=="backward",D=((a=this.scrollState)==null?void 0:a.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:d,start:u,size:c,end:u+c,lane:0},y,this):M);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(d,r),this.itemSizeCacheVersion++;let l=!1;_?l=this.applyScrollAdjustment(this.getTotalSize()-A):D&&(l=this.applyScrollAdjustment(y)),this.notify(l)}},this.getVirtualItems=Es(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let a=0,c=n.length;a<c;a++){const u=n[a],d=r[u];o.push(d)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const o=this._flatMeasurements,a=this.options.lanes===1&&o!=null,c=bg(0,r.length-1,a?u=>o[u*2]:u=>Sd(r[u]).start,n);return Sd(r[c])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,o=0)=>{if(!this.scrollElement)return 0;const a=this.getSize(),c=this.getScrollOffset();r==="auto"&&(r=n>=c+a?"end":"start"),r==="center"?n+=(o-a)/2:r==="end"&&(n-=a);const u=this.getMaxScrollOffset();return Math.max(Math.min(u,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getSize(),a=this.getScrollOffset(),c=this.measurementsCache[n];if(!c)return;if(r==="auto")if(c.end>=a+o-this.options.scrollPaddingEnd)r="end";else if(c.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const u=r==="end"?c.end+this.options.scrollPaddingEnd:c.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(u,r,c.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:o="auto"}={})=>{this._iosDeferredAdjustment=0;const a=this.getOffsetForAlignment(n,r),c=this.now();this.scrollState={index:null,align:r,behavior:o,startedAt:c,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:o="auto"}={})=>{this._iosDeferredAdjustment=0,n=Math.max(0,Math.min(n,this.options.count-1));const a=this.getOffsetForIndex(n,r);if(!a)return;const[c,u]=a,d=this.now();this.scrollState={index:n,align:u,behavior:o,startedAt:d,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const o=this.getScrollOffset()+n,a=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:a,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1){const a=r.length-1,c=this._flatMeasurements;c!=null?o=c[a*2]+c[a*2+1]:o=((n=r[a])==null?void 0:n.end)??0}else{const a=Array(this.options.lanes).fill(null);let c=r.length-1;for(;c>=0&&a.some(u=>u===null);){const u=r[c];a[u.lane]===null&&(a[u.lane]=u.end),c--}o=Math.max(...a.filter(u=>u!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const o of r)o&&this.itemSizeCache.has(o.key)&&n.push({index:o.index,key:o.key,start:o.start,size:o.size,end:o.end,lane:o.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){return t===0?!1:Ra()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=t,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=r?r[0]:this.scrollState.lastTargetOffset,a=1,c=o!==this.scrollState.lastTargetOffset;if(!c&&T_(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=a){this.getScrollOffset()!==o&&this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,c){const u=this.getSize()||600,d=Math.abs(o-this.getScrollOffset()),m=this.scrollState.behavior==="smooth"&&d>u;this.scrollState.lastTargetOffset=o,m||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:m?"smooth":"auto"})}this.scheduleScrollReconcile()}}const bg=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,a=n(o);if(a<r)e=o+1;else if(a>r)t=o-1;else return o}return e>0?e-1:0};function D_(e,t,n){let r=0;for(;r<=t;){const o=(r+t)/2|0,a=e[o*2];if(a<n)r=o+1;else if(a>n)t=o-1;else return o}return r>0?r-1:0}function B_(e,t,n,r,o){const a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&o!==null){const m=D_(o,a,n);let p=m;const y=n+t;for(;p<a&&o[p*2]+o[p*2+1]<y;)p++;return{startIndex:m,endIndex:p}}let u=bg(0,a,m=>e[m].start,n),d=u;if(r===1)for(;d<a&&e[d].end<n+t;)d++;else if(r>1){const m=Array(r).fill(0);for(;d<a&&m.some(y=>y<n+t);){const y=e[d];m[y.lane]=y.end,d++}const p=Array(r).fill(n+t);for(;u>=0&&p.some(y=>y>=n);){const y=e[u];p[y.lane]=y.start,u--}u=Math.max(0,u-u%r),d=Math.min(a,d+(r-1-d%r))}return{startIndex:u,endIndex:d}}function U_(e){const t=new $_(Ar(e)),n=hb(t),r=t._didMount();return nt(()=>Ar(e).getScrollElement(),o=>{o&&t._willUpdate()},{immediate:!0}),nt(()=>Ar(e),o=>{t.setOptions({...o,onChange:(a,c)=>{var u;Iu(n),(u=o.onChange)==null||u.call(o,a,c)}}),t._willUpdate(),Iu(n)},{immediate:!0}),Vm(r),n}function F_(e){return U_(be(()=>({observeElementRect:I_,observeElementOffset:N_,scrollToFn:P_,...Ar(e)})))}function z_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function yg(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&yg(n)}),e}class Td{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function kg(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function $n(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const o in r)n[o]=r[o]}),n}const H_="</span>",Ad=e=>!!e.scope,j_=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,o)=>`${r}${"_".repeat(o+1)}`)].join(" ")}return`${t}${e}`};class W_{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=kg(t)}openNode(t){if(!Ad(t))return;const n=j_(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){Ad(t)&&(this.buffer+=H_)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const Cd=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Fl{constructor(){this.rootNode=Cd(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=Cd({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{Fl._collapse(n)}))}}class K_ extends Fl{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new W_(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Fr(e){return e?typeof e=="string"?e:e.source:null}function _g(e){return hs("(?=",e,")")}function G_(e){return hs("(?:",e,")*")}function V_(e){return hs("(?:",e,")?")}function hs(...e){return e.map(n=>Fr(n)).join("")}function q_(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function zl(...e){return"("+(q_(e).capture?"":"?:")+e.map(r=>Fr(r)).join("|")+")"}function wg(e){return new RegExp(e.toString()+"|").exec("").length-1}function Z_(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Q_=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Hl(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const o=n;let a=Fr(r),c="";for(;a.length>0;){const u=Q_.exec(a);if(!u){c+=a;break}c+=a.substring(0,u.index),a=a.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?c+="\\"+String(Number(u[1])+o):(c+=u[0],u[0]==="("&&n++)}return c}).map(r=>`(${r})`).join(t)}const Y_=/\b\B/,vg="[a-zA-Z]\\w*",jl="[a-zA-Z_]\\w*",xg="\\b\\d+(\\.\\d+)?",Sg="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Eg="\\b(0b[01]+)",J_="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",X_=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=hs(t,/.*\b/,e.binary,/\b.*/)),$n({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},zr={begin:"\\\\[\\s\\S]",relevance:0},ew={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[zr]},tw={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[zr]},nw={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Co=function(e,t,n={}){const r=$n({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const o=zl("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:hs(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},sw=Co("//","$"),rw=Co("/\\*","\\*/"),iw=Co("#","$"),ow={scope:"number",begin:xg,relevance:0},aw={scope:"number",begin:Sg,relevance:0},lw={scope:"number",begin:Eg,relevance:0},cw={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[zr,{begin:/\[/,end:/\]/,relevance:0,contains:[zr]}]},uw={scope:"title",begin:vg,relevance:0},dw={scope:"title",begin:jl,relevance:0},fw={begin:"\\.\\s*"+jl,relevance:0},gw=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var $i=Object.freeze({__proto__:null,APOS_STRING_MODE:ew,BACKSLASH_ESCAPE:zr,BINARY_NUMBER_MODE:lw,BINARY_NUMBER_RE:Eg,COMMENT:Co,C_BLOCK_COMMENT_MODE:rw,C_LINE_COMMENT_MODE:sw,C_NUMBER_MODE:aw,C_NUMBER_RE:Sg,END_SAME_AS_BEGIN:gw,HASH_COMMENT_MODE:iw,IDENT_RE:vg,MATCH_NOTHING_RE:Y_,METHOD_GUARD:fw,NUMBER_MODE:ow,NUMBER_RE:xg,PHRASAL_WORDS_MODE:nw,QUOTE_STRING_MODE:tw,REGEXP_MODE:cw,RE_STARTERS_RE:J_,SHEBANG:X_,TITLE_MODE:uw,UNDERSCORE_IDENT_RE:jl,UNDERSCORE_TITLE_MODE:dw});function hw(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function pw(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function mw(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=hw,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function bw(e,t){Array.isArray(e.illegal)&&(e.illegal=zl(...e.illegal))}function yw(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function kw(e,t){e.relevance===void 0&&(e.relevance=1)}const _w=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=hs(n.beforeMatch,_g(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},ww=["of","and","for","in","not","or","if","then","parent","list","value"],vw="keyword";function Tg(e,t,n=vw){const r=Object.create(null);return typeof e=="string"?o(n,e.split(" ")):Array.isArray(e)?o(n,e):Object.keys(e).forEach(function(a){Object.assign(r,Tg(e[a],t,a))}),r;function o(a,c){t&&(c=c.map(u=>u.toLowerCase())),c.forEach(function(u){const d=u.split("|");r[d[0]]=[a,xw(d[0],d[1])]})}}function xw(e,t){return t?Number(t):Sw(e)?0:1}function Sw(e){return ww.includes(e.toLowerCase())}const Id={},us=e=>{console.error(e)},Md=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Ts=(e,t)=>{Id[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Id[`${e}/${t}`]=!0)},ao=new Error;function Ag(e,t,{key:n}){let r=0;const o=e[n],a={},c={};for(let u=1;u<=t.length;u++)c[u+r]=o[u],a[u+r]=!0,r+=wg(t[u-1]);e[n]=c,e[n]._emit=a,e[n]._multi=!0}function Ew(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw us("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ao;if(typeof e.beginScope!="object"||e.beginScope===null)throw us("beginScope must be object"),ao;Ag(e,e.begin,{key:"beginScope"}),e.begin=Hl(e.begin,{joinWith:""})}}function Tw(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw us("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ao;if(typeof e.endScope!="object"||e.endScope===null)throw us("endScope must be object"),ao;Ag(e,e.end,{key:"endScope"}),e.end=Hl(e.end,{joinWith:""})}}function Aw(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Cw(e){Aw(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Ew(e),Tw(e)}function Iw(e){function t(c,u){return new RegExp(Fr(c),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(u?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(u,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,u]),this.matchAt+=wg(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=t(Hl(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const m=d.findIndex((y,_)=>_>0&&y!==void 0),p=this.matchIndexes[m];return d.splice(0,m),Object.assign(d,p)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(u){if(this.multiRegexes[u])return this.multiRegexes[u];const d=new n;return this.rules.slice(u).forEach(([m,p])=>d.addRule(m,p)),d.compile(),this.multiRegexes[u]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,d){this.rules.push([u,d]),d.type==="begin"&&this.count++}exec(u){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let m=d.exec(u);if(this.resumingScanAtSamePosition()&&!(m&&m.index===this.lastIndex)){const p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,m=p.exec(u)}return m&&(this.regexIndex+=m.position+1,this.regexIndex===this.count&&this.considerAll()),m}}function o(c){const u=new r;return c.contains.forEach(d=>u.addRule(d.begin,{rule:d,type:"begin"})),c.terminatorEnd&&u.addRule(c.terminatorEnd,{type:"end"}),c.illegal&&u.addRule(c.illegal,{type:"illegal"}),u}function a(c,u){const d=c;if(c.isCompiled)return d;[pw,yw,Cw,_w].forEach(p=>p(c,u)),e.compilerExtensions.forEach(p=>p(c,u)),c.__beforeBegin=null,[mw,bw,kw].forEach(p=>p(c,u)),c.isCompiled=!0;let m=null;return typeof c.keywords=="object"&&c.keywords.$pattern&&(c.keywords=Object.assign({},c.keywords),m=c.keywords.$pattern,delete c.keywords.$pattern),m=m||/\w+/,c.keywords&&(c.keywords=Tg(c.keywords,e.case_insensitive)),d.keywordPatternRe=t(m,!0),u&&(c.begin||(c.begin=/\B|\b/),d.beginRe=t(d.begin),!c.end&&!c.endsWithParent&&(c.end=/\B|\b/),c.end&&(d.endRe=t(d.end)),d.terminatorEnd=Fr(d.end)||"",c.endsWithParent&&u.terminatorEnd&&(d.terminatorEnd+=(c.end?"|":"")+u.terminatorEnd)),c.illegal&&(d.illegalRe=t(c.illegal)),c.contains||(c.contains=[]),c.contains=[].concat(...c.contains.map(function(p){return Mw(p==="self"?c:p)})),c.contains.forEach(function(p){a(p,d)}),c.starts&&a(c.starts,u),d.matcher=o(d),d}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=$n(e.classNameAliases||{}),a(e)}function Cg(e){return e?e.endsWithParent||Cg(e.starts):!1}function Mw(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return $n(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Cg(e)?$n(e,{starts:e.starts?$n(e.starts):null}):Object.isFrozen(e)?$n(e):e}var Rw="11.11.1";class Nw extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Na=kg,Rd=$n,Nd=Symbol("nomatch"),Ow=7,Ig=function(e){const t=Object.create(null),n=Object.create(null),r=[];let o=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:K_};function d(F){return u.noHighlightRe.test(F)}function m(F){let X=F.className+" ";X+=F.parentNode?F.parentNode.className:"";const q=u.languageDetectRe.exec(X);if(q){const fe=oe(q[1]);return fe||(Md(a.replace("{}",q[1])),Md("Falling back to no-highlight mode for this block.",F)),fe?q[1]:"no-highlight"}return X.split(/\s+/).find(fe=>d(fe)||oe(fe))}function p(F,X,q){let fe="",pe="";typeof X=="object"?(fe=F,q=X.ignoreIllegals,pe=X.language):(Ts("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ts("10.7.0",`Please use highlight(code, options) instead.
|
|
81
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),pe=F,fe=X),q===void 0&&(q=!0);const Ce={code:fe,language:pe};Ee("before:highlight",Ce);const Re=Ce.result?Ce.result:y(Ce.language,Ce.code,q);return Re.code=Ce.code,Ee("after:highlight",Re),Re}function y(F,X,q,fe){const pe=Object.create(null);function Ce(z,Y){return z.keywords[Y]}function Re(){if(!B.keywords){K.addText($);return}let z=0;B.keywordPatternRe.lastIndex=0;let Y=B.keywordPatternRe.exec($),ie="";for(;Y;){ie+=$.substring(z,Y.index);const he=H.case_insensitive?Y[0].toLowerCase():Y[0],Ae=Ce(B,he);if(Ae){const[qe,gt]=Ae;if(K.addText(ie),ie="",pe[he]=(pe[he]||0)+1,pe[he]<=Ow&&(ce+=gt),qe.startsWith("_"))ie+=Y[0];else{const Kt=H.classNameAliases[qe]||qe;Xe(Y[0],Kt)}}else ie+=Y[0];z=B.keywordPatternRe.lastIndex,Y=B.keywordPatternRe.exec($)}ie+=$.substring(z),K.addText(ie)}function Je(){if($==="")return;let z=null;if(typeof B.subLanguage=="string"){if(!t[B.subLanguage]){K.addText($);return}z=y(B.subLanguage,$,!0,J[B.subLanguage]),J[B.subLanguage]=z._top}else z=A($,B.subLanguage.length?B.subLanguage:null);B.relevance>0&&(ce+=z.relevance),K.__addSublanguage(z._emitter,z.language)}function Qe(){B.subLanguage!=null?Je():Re(),$=""}function Xe(z,Y){z!==""&&(K.startScope(Y),K.addText(z),K.endScope())}function Fe(z,Y){let ie=1;const he=Y.length-1;for(;ie<=he;){if(!z._emit[ie]){ie++;continue}const Ae=H.classNameAliases[z[ie]]||z[ie],qe=Y[ie];Ae?Xe(qe,Ae):($=qe,Re(),$=""),ie++}}function Wt(z,Y){return z.scope&&typeof z.scope=="string"&&K.openNode(H.classNameAliases[z.scope]||z.scope),z.beginScope&&(z.beginScope._wrap?(Xe($,H.classNameAliases[z.beginScope._wrap]||z.beginScope._wrap),$=""):z.beginScope._multi&&(Fe(z.beginScope,Y),$="")),B=Object.create(z,{parent:{value:B}}),B}function At(z,Y,ie){let he=Z_(z.endRe,ie);if(he){if(z["on:end"]){const Ae=new Td(z);z["on:end"](Y,Ae),Ae.isMatchIgnored&&(he=!1)}if(he){for(;z.endsParent&&z.parent;)z=z.parent;return z}}if(z.endsWithParent)return At(z.parent,Y,ie)}function et(z){return B.matcher.regexIndex===0?($+=z[0],1):(me=!0,0)}function vt(z){const Y=z[0],ie=z.rule,he=new Td(ie),Ae=[ie.__beforeBegin,ie["on:begin"]];for(const qe of Ae)if(qe&&(qe(z,he),he.isMatchIgnored))return et(Y);return ie.skip?$+=Y:(ie.excludeBegin&&($+=Y),Qe(),!ie.returnBegin&&!ie.excludeBegin&&($=Y)),Wt(ie,z),ie.returnBegin?0:Y.length}function rn(z){const Y=z[0],ie=X.substring(z.index),he=At(B,z,ie);if(!he)return Nd;const Ae=B;B.endScope&&B.endScope._wrap?(Qe(),Xe(Y,B.endScope._wrap)):B.endScope&&B.endScope._multi?(Qe(),Fe(B.endScope,z)):Ae.skip?$+=Y:(Ae.returnEnd||Ae.excludeEnd||($+=Y),Qe(),Ae.excludeEnd&&($=Y));do B.scope&&K.closeNode(),!B.skip&&!B.subLanguage&&(ce+=B.relevance),B=B.parent;while(B!==he.parent);return he.starts&&Wt(he.starts,z),Ae.returnEnd?0:Y.length}function v(){const z=[];for(let Y=B;Y!==H;Y=Y.parent)Y.scope&&z.unshift(Y.scope);z.forEach(Y=>K.openNode(Y))}let T={};function P(z,Y){const ie=Y&&Y[0];if($+=z,ie==null)return Qe(),0;if(T.type==="begin"&&Y.type==="end"&&T.index===Y.index&&ie===""){if($+=X.slice(Y.index,Y.index+1),!o){const he=new Error(`0 width match regex (${F})`);throw he.languageName=F,he.badRule=T.rule,he}return 1}if(T=Y,Y.type==="begin")return vt(Y);if(Y.type==="illegal"&&!q){const he=new Error('Illegal lexeme "'+ie+'" for mode "'+(B.scope||"<unnamed>")+'"');throw he.mode=B,he}else if(Y.type==="end"){const he=rn(Y);if(he!==Nd)return he}if(Y.type==="illegal"&&ie==="")return $+=`
|
|
82
|
-
`,1;if(ae>1e5&&ae>Y.index*3)throw new Error("potential infinite loop, way more iterations than matches");return $+=ie,ie.length}const H=oe(F);if(!H)throw us(a.replace("{}",F)),new Error('Unknown language: "'+F+'"');const j=Iw(H);let W="",B=fe||j;const J={},K=new u.__emitter(u);v();let $="",ce=0,ee=0,ae=0,me=!1;try{if(H.__emitTokens)H.__emitTokens(X,K);else{for(B.matcher.considerAll();;){ae++,me?me=!1:B.matcher.considerAll(),B.matcher.lastIndex=ee;const z=B.matcher.exec(X);if(!z)break;const Y=X.substring(ee,z.index),ie=P(Y,z);ee=z.index+ie}P(X.substring(ee))}return K.finalize(),W=K.toHTML(),{language:F,value:W,relevance:ce,illegal:!1,_emitter:K,_top:B}}catch(z){if(z.message&&z.message.includes("Illegal"))return{language:F,value:Na(X),illegal:!0,relevance:0,_illegalBy:{message:z.message,index:ee,context:X.slice(ee-100,ee+100),mode:z.mode,resultSoFar:W},_emitter:K};if(o)return{language:F,value:Na(X),illegal:!1,relevance:0,errorRaised:z,_emitter:K,_top:B};throw z}}function _(F){const X={value:Na(F),illegal:!1,relevance:0,_top:c,_emitter:new u.__emitter(u)};return X._emitter.addText(F),X}function A(F,X){X=X||u.languages||Object.keys(t);const q=_(F),fe=X.filter(oe).filter(de).map(Qe=>y(Qe,F,!1));fe.unshift(q);const pe=fe.sort((Qe,Xe)=>{if(Qe.relevance!==Xe.relevance)return Xe.relevance-Qe.relevance;if(Qe.language&&Xe.language){if(oe(Qe.language).supersetOf===Xe.language)return 1;if(oe(Xe.language).supersetOf===Qe.language)return-1}return 0}),[Ce,Re]=pe,Je=Ce;return Je.secondBest=Re,Je}function x(F,X,q){const fe=X&&n[X]||q;F.classList.add("hljs"),F.classList.add(`language-${fe}`)}function O(F){let X=null;const q=m(F);if(d(q))return;if(Ee("before:highlightElement",{el:F,language:q}),F.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",F);return}if(F.children.length>0&&(u.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(F)),u.throwUnescapedHTML))throw new Nw("One of your code blocks includes unescaped HTML.",F.innerHTML);X=F;const fe=X.textContent,pe=q?p(fe,{language:q,ignoreIllegals:!0}):A(fe);F.innerHTML=pe.value,F.dataset.highlighted="yes",x(F,q,pe.language),F.result={language:pe.language,re:pe.relevance,relevance:pe.relevance},pe.secondBest&&(F.secondBest={language:pe.secondBest.language,relevance:pe.secondBest.relevance}),Ee("after:highlightElement",{el:F,result:pe,text:fe})}function M(F){u=Rd(u,F)}const D=()=>{N(),Ts("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function l(){N(),Ts("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let R=!1;function N(){function F(){N()}if(document.readyState==="loading"){R||window.addEventListener("DOMContentLoaded",F,!1),R=!0;return}document.querySelectorAll(u.cssSelector).forEach(O)}function U(F,X){let q=null;try{q=X(e)}catch(fe){if(us("Language definition for '{}' could not be registered.".replace("{}",F)),o)us(fe);else throw fe;q=c}q.name||(q.name=F),t[F]=q,q.rawDefinition=X.bind(null,e),q.aliases&&ne(q.aliases,{languageName:F})}function Z(F){delete t[F];for(const X of Object.keys(n))n[X]===F&&delete n[X]}function se(){return Object.keys(t)}function oe(F){return F=(F||"").toLowerCase(),t[F]||t[n[F]]}function ne(F,{languageName:X}){typeof F=="string"&&(F=[F]),F.forEach(q=>{n[q.toLowerCase()]=X})}function de(F){const X=oe(F);return X&&!X.disableAutodetect}function ye(F){F["before:highlightBlock"]&&!F["before:highlightElement"]&&(F["before:highlightElement"]=X=>{F["before:highlightBlock"](Object.assign({block:X.el},X))}),F["after:highlightBlock"]&&!F["after:highlightElement"]&&(F["after:highlightElement"]=X=>{F["after:highlightBlock"](Object.assign({block:X.el},X))})}function Q(F){ye(F),r.push(F)}function ke(F){const X=r.indexOf(F);X!==-1&&r.splice(X,1)}function Ee(F,X){const q=F;r.forEach(function(fe){fe[q]&&fe[q](X)})}function Ge(F){return Ts("10.7.0","highlightBlock will be removed entirely in v12.0"),Ts("10.7.0","Please use highlightElement now."),O(F)}Object.assign(e,{highlight:p,highlightAuto:A,highlightAll:N,highlightElement:O,highlightBlock:Ge,configure:M,initHighlighting:D,initHighlightingOnLoad:l,registerLanguage:U,unregisterLanguage:Z,listLanguages:se,getLanguage:oe,registerAliases:ne,autoDetection:de,inherit:Rd,addPlugin:Q,removePlugin:ke}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Rw,e.regex={concat:hs,lookahead:_g,either:zl,optional:V_,anyNumberOfTimes:G_};for(const F in $i)typeof $i[F]=="object"&&yg($i[F]);return Object.assign(e,$i),e},Us=Ig({});Us.newInstance=()=>Ig({});var Lw=Us;Us.HighlightJS=Us;Us.default=Us;const We=z_(Lw),Od="[A-Za-z$_][0-9A-Za-z$_]*",Pw=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],$w=["true","false","null","undefined","NaN","Infinity"],Mg=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Rg=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ng=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Dw=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Bw=[].concat(Ng,Mg,Rg);function Oa(e){const t=e.regex,n=(q,{after:fe})=>{const pe="</"+q[0].slice(1);return q.input.indexOf(pe,fe)!==-1},r=Od,o={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(q,fe)=>{const pe=q[0].length+q.index,Ce=q.input[pe];if(Ce==="<"||Ce===","){fe.ignoreMatch();return}Ce===">"&&(n(q,{after:pe})||fe.ignoreMatch());let Re;const Je=q.input.substring(pe);if(Re=Je.match(/^\s*=/)){fe.ignoreMatch();return}if((Re=Je.match(/^\s+extends\s+/))&&Re.index===0){fe.ignoreMatch();return}}},u={$pattern:Od,keyword:Pw,literal:$w,built_in:Bw,"variable.language":Dw},d="[0-9](_?[0-9])*",m=`\\.(${d})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${p})((${m})|\\.)?|(${m}))[eE][+-]?(${d})\\b`},{begin:`\\b(${p})\\b((${m})\\b|\\.)?|(${m})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},_={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},A={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,_],subLanguage:"xml"}},x={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,_],subLanguage:"css"}},O={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,_],subLanguage:"graphql"}},M={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,_]},l={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},R=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,A,x,O,M,{match:/\$\d+/},y];_.contains=R.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(R)});const N=[].concat(l,_.contains),U=N.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(N)}]),Z={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:U},se={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},oe={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Mg,...Rg]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},de={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[Z],illegal:/%/},ye={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Q(q){return t.concat("(?!",q.join("|"),")")}const ke={match:t.concat(/\b/,Q([...Ng,"super","import"].map(q=>`${q}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},Ee={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Ge={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},Z]},F="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",X={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(F)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[Z]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:U,CLASS_REFERENCE:oe},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,A,x,O,M,l,{match:/\$\d+/},y,oe,{scope:"attr",match:r+t.lookahead(":"),relevance:0},X,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[l,e.REGEXP_MODE,{className:"function",begin:F,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:U}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:a},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},de,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[Z,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Ee,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[Z]},ke,ye,se,Ge,{match:/\$[(.]/}]}}const lo="[A-Za-z$_][0-9A-Za-z$_]*",Og=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Lg=["true","false","null","undefined","NaN","Infinity"],Pg=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],$g=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Dg=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Bg=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ug=[].concat(Dg,Pg,$g);function Uw(e){const t=e.regex,n=(q,{after:fe})=>{const pe="</"+q[0].slice(1);return q.input.indexOf(pe,fe)!==-1},r=lo,o={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(q,fe)=>{const pe=q[0].length+q.index,Ce=q.input[pe];if(Ce==="<"||Ce===","){fe.ignoreMatch();return}Ce===">"&&(n(q,{after:pe})||fe.ignoreMatch());let Re;const Je=q.input.substring(pe);if(Re=Je.match(/^\s*=/)){fe.ignoreMatch();return}if((Re=Je.match(/^\s+extends\s+/))&&Re.index===0){fe.ignoreMatch();return}}},u={$pattern:lo,keyword:Og,literal:Lg,built_in:Ug,"variable.language":Bg},d="[0-9](_?[0-9])*",m=`\\.(${d})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${p})((${m})|\\.)?|(${m}))[eE][+-]?(${d})\\b`},{begin:`\\b(${p})\\b((${m})\\b|\\.)?|(${m})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},_={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},A={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,_],subLanguage:"xml"}},x={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,_],subLanguage:"css"}},O={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,_],subLanguage:"graphql"}},M={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,_]},l={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},R=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,A,x,O,M,{match:/\$\d+/},y];_.contains=R.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(R)});const N=[].concat(l,_.contains),U=N.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(N)}]),Z={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:U},se={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},oe={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Pg,...$g]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},de={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[Z],illegal:/%/},ye={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Q(q){return t.concat("(?!",q.join("|"),")")}const ke={match:t.concat(/\b/,Q([...Dg,"super","import"].map(q=>`${q}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},Ee={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Ge={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},Z]},F="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",X={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(F)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[Z]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:U,CLASS_REFERENCE:oe},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,A,x,O,M,l,{match:/\$\d+/},y,oe,{scope:"attr",match:r+t.lookahead(":"),relevance:0},X,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[l,e.REGEXP_MODE,{className:"function",begin:F,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:U}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:a},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},de,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[Z,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Ee,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[Z]},ke,ye,se,Ge,{match:/\$[(.]/}]}}function La(e){const t=e.regex,n=Uw(e),r=lo,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},c={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],m={$pattern:lo,keyword:Og.concat(d),literal:Lg,built_in:Ug.concat(o),"variable.language":Bg},p={className:"meta",begin:"@"+r},y=(O,M,D)=>{const l=O.contains.findIndex(R=>R.label===M);if(l===-1)throw new Error("can not find mode to replace");O.contains.splice(l,1,D)};Object.assign(n.keywords,m),n.exports.PARAMS_CONTAINS.push(p);const _=n.contains.find(O=>O.scope==="attr"),A=Object.assign({},_,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,_,A]),n.contains=n.contains.concat([p,a,c,A]),y(n,"shebang",e.SHEBANG()),y(n,"use_strict",u);const x=n.contains.find(O=>O.label==="func.def");return x.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Ld(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},m={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},p={begin:/\{\{/,relevance:0},y={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,d,p,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d,p,m]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,p,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,p,m]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},_="[0-9](_?[0-9])*",A=`(\\b(${_}))?\\.(${_})|\\b(${_})\\.`,x=`\\b|${r.join("|")}`,O={className:"number",relevance:0,variants:[{begin:`(\\b(${_})|(${A}))[eE][+-]?(${_})[jJ]?(?=${x})`},{begin:`(${A})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${x})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${x})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${x})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${x})`},{begin:`\\b(${_})[jJ](?=${x})`}]},M={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},D={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,O,y,e.HASH_COMMENT_MODE]}]};return m.contains=[y,O,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,O,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},y,M,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[D]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[O,D,y]}]}}function Pa(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),c={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,o]};o.contains.push(u);const d={match:/\\"/},m={className:"string",begin:/'/,end:/'/},p={match:/\\'/},y={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},_=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],A=e.SHEBANG({binary:`(${_.join("|")})`,relevance:10}),x={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},O=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],M=["true","false"],D={match:/(\/[a-z._-]+)+/},l=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],R=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],N=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],U=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:O,literal:M,built_in:[...l,...R,"set","shopt",...N,...U]},contains:[A,e.SHEBANG(),x,y,a,c,D,u,d,m,p,n]}}function Fw(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],o={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,o,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}const zw=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Hw=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],jw=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Ww=[...Hw,...jw],Kw=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Gw=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Vw=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),qw=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Zw(e){const t=e.regex,n=zw(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="and or not only",a=/@-?\w[\w]*(-\w+)*/,c="[a-zA-Z-][a-zA-Z0-9_-]*",u=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+c,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Gw.join("|")+")"},{begin:":(:)?("+Vw.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+qw.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:Kw.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Ww.join("|")+")\\b"}]}}function $a(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=e.inherit(a,{begin:/\(/,end:/\)/}),u=e.inherit(e.APOS_STRING_MODE,{className:"string"}),d=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),m={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,d,u,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,c,d,u]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[m],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[m],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:m}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Pd(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},a={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},c={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},m={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},p={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},y=e.inherit(m,{contains:[]}),_=e.inherit(p,{contains:[]});m.contains.push(_),p.contains.push(y);let A=[n,d];return[m,p,y,_].forEach(D=>{D.contains=D.contains.concat(A)}),A=A.concat(m,p),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:A},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:A}]}]},n,a,m,p,{className:"quote",begin:"^>\\s+",contains:A,end:"$"},o,r,d,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function $d(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},c={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,o]},u=e.inherit(c,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),_={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},A={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},x={begin:/\{/,end:/\}/,contains:[A],illegal:"\\n",relevance:0},O={begin:"\\[",end:"\\]",contains:[A],illegal:"\\n",relevance:0},M=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},_,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},x,O,a,c],D=[...M];return D.pop(),D.push(u),A.contains=D,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:M}}function Qw(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}const Yw=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},Jw=["disabled","aria-label","aria-expanded"],Xw=["aria-label"],ev=["disabled","aria-selected","onClick"],tv={__name:"NeoSelect",props:{modelValue:{default:""},options:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},ariaLabel:{type:String,default:"请选择"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,r=t,o=Be(null),a=Be(null),c=Be(!1),u=`neo-select-${Math.random().toString(36).slice(2,10)}`,d=be(()=>n.options.map((R,N)=>R&&typeof R=="object"&&!Array.isArray(R)?{value:Object.prototype.hasOwnProperty.call(R,"value")?R.value:R.label,label:String(R.label??R.value??""),disabled:R.disabled===!0,key:String(R.key??R.value??N)}:{value:R,label:String(R??""),disabled:!1,key:`${String(R)}-${N}`})),m=be(()=>d.value.find(R=>Object.is(R.value,n.modelValue))),p=be(()=>{var R;return((R=m.value)==null?void 0:R.label)||"请选择"});function y(){c.value=!1}async function _(R=!1){var se,oe;if(n.disabled||c.value)return;c.value=!0,await kt();const N=[...((se=a.value)==null?void 0:se.querySelectorAll("button:not(:disabled)"))||[]],Z=((oe=a.value)==null?void 0:oe.querySelector('button[aria-selected="true"]'))||(R?N.at(-1):N[0]);Z==null||Z.focus()}function A(){c.value?y():_()}function x(R){R.disabled||(y(),Object.is(R.value,n.modelValue)||(r("update:modelValue",R.value),r("change",R.value)),kt(()=>{var N,U;return(U=(N=o.value)==null?void 0:N.querySelector(".neo-select-trigger"))==null?void 0:U.focus()}))}function O(R){(R.key==="ArrowDown"||R.key==="ArrowUp")&&(R.preventDefault(),_(R.key==="ArrowUp")),R.key==="Escape"&&c.value&&(R.preventDefault(),R.stopPropagation(),y())}function M(R,N){var oe,ne;const U=[...((oe=a.value)==null?void 0:oe.querySelectorAll("button:not(:disabled)"))||[]];if(!U.length)return;const Z=U.indexOf(document.activeElement),se=N==="start"?0:N==="end"?U.length-1:(Z+N+U.length)%U.length;R.preventDefault(),(ne=U[se])==null||ne.focus()}function D(R){R.key==="ArrowDown"?M(R,1):R.key==="ArrowUp"?M(R,-1):R.key==="Home"?M(R,"start"):R.key==="End"?M(R,"end"):R.key==="Escape"?(R.preventDefault(),R.stopPropagation(),y(),kt(()=>{var N,U;return(U=(N=o.value)==null?void 0:N.querySelector(".neo-select-trigger"))==null?void 0:U.focus()})):R.key==="Tab"&&y()}function l(R){var N;c.value&&!((N=o.value)!=null&&N.contains(R.target))&&y()}return Wr(()=>document.addEventListener("pointerdown",l)),Bn(()=>document.removeEventListener("pointerdown",l)),(R,N)=>(k(),w("span",{ref_key:"root",ref:o,class:ge(["neo-select",{open:c.value,disabled:e.disabled}])},[f("button",{type:"button",class:"neo-select-trigger",disabled:e.disabled,"aria-label":e.ariaLabel,"aria-haspopup":"listbox","aria-expanded":c.value,"aria-controls":u,onClick:A,onKeydown:O},[f("span",null,C(p.value),1)],40,Jw),c.value?(k(),w("span",{key:0,id:u,ref_key:"menu",ref:a,class:"neo-select-menu",role:"listbox","aria-label":e.ariaLabel,onKeydown:D},[(k(!0),w(ue,null,Te(d.value,U=>(k(),w("button",{key:U.key,type:"button",role:"option",disabled:U.disabled,class:ge({selected:Object.is(U.value,e.modelValue)}),"aria-selected":Object.is(U.value,e.modelValue),onClick:Z=>x(U)},C(U.label),11,ev))),128))],40,Xw)):V("",!0)],2))}},Di=Yw(tv,[["__scopeId","data-v-edb5aaac"]]),co=1,ul=2,Wl=3,Kl=4,Gl=5,Vl=6,ql=7,Zl=8,uo=9,fo=10,dl=11,Vi=12,_r=13,wr=14,vr=15,xr=16,Ms=17,fl=18,St=19,Nr=20,Ln=21,Fg=22,Or=23,go=24,Hs=25,zg=26,gl=27,qi=28,Zi=29,dn=30,Yt=31,Bi=101,Dd=102,Hg=103,Bd=104,Da=105,Ps=1,Ql=2,jg=4,Wg=8,Kg=16;function nv(e){switch(e){case Ps:return"href";case Ql:return"src";case jg:return"class";case Wg:return"checked";case Kg:return"start"}}const sv=e=>{switch(e){case 1:return Wl;case 2:return Kl;case 3:return Gl;case 4:return Vl;case 5:return ql;default:return Zl}},rv=sv,Ud=24;function iv(e){const t=new Uint32Array(Ud);return t[0]=co,{renderer:e,text:"",pending:"",tokens:t,len:0,token:co,fence_end:0,blockquote_idx:0,hr_char:"",hr_chars:0,fence_start:0,spaces:new Uint8Array(Ud),indent:"",indent_len:0,table_state:0}}function Fd(e){e.pending.length>0&&it(e,`
|
|
83
|
-
`)}function Oe(e){e.text.length!==0&&(console.assert(e.len>0,"Never adding text to root"),e.renderer.add_text(e.renderer.data,e.text),e.text="")}function Ze(e){console.assert(e.len>0,"No nodes to end"),e.len-=1,e.token=e.tokens[e.len],e.renderer.end_token(e.renderer.data)}function Pe(e,t){(e.tokens[e.len]===go||e.tokens[e.len]===Or)&&t!==Hs&&Ze(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function ov(e,t,n){for(;n<=e.len;){if(e.tokens[n]===t)return n;n+=1}return-1}function os(e,t){for(e.fence_start=0;e.len>t;)Ze(e)}function Ui(e,t){let n=0;for(let r=0;r<=e.len&&(t-=e.spaces[r],!(t<0));r+=1)switch(e.tokens[r]){case uo:case fo:case Nr:case Hs:n=r;break}for(;e.len>n;)Ze(e);return t}function Ba(e,t){let n=-1,r=-1;for(let o=e.blockquote_idx+1;o<=e.len;o+=1)if(e.tokens[o]===Hs){if(e.indent_len<e.spaces[o]){r=-1;break}r=o}else e.tokens[o]===t&&(n=o);return r===-1?n===-1?(os(e,e.blockquote_idx),Pe(e,t),!0):(os(e,n),!1):(os(e,r),Pe(e,t),!0)}function Ua(e,t){Pe(e,Hs),e.spaces[e.len]=e.indent_len+t,fn(e),e.token=Hg}function fn(e){e.indent="",e.indent_len=0,e.pending=""}function hl(e){switch(e){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return!0;default:return!1}}function av(e){switch(e){case 32:case 58:case 59:case 41:case 44:case 33:case 46:case 63:case 93:case 10:return!0;default:return!1}}function lv(e){return hl(e)||av(e)}function it(e,t){for(const n of t){if(e.token===Bi){switch(n){case" ":e.indent_len+=1;continue;case" ":e.indent_len+=4;continue}let o=Ui(e,e.indent_len);e.indent_len=0,e.token=e.tokens[e.len],o>0&&it(e," ".repeat(o))}const r=e.pending+n;switch(e.token){case Ln:case co:case Nr:case go:case Or:switch(console.assert(e.text.length===0,"Root should not have any text"),e.pending[0]){case void 0:e.pending=n;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=1;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=4;continue;case`
|
|
84
|
-
`:if(console.assert(e.pending.length===1),e.tokens[e.len]===Hs&&e.token===Ln){Ze(e),fn(e),e.pending=n;continue}os(e,e.blockquote_idx),fn(e),e.blockquote_idx=0,e.fence_start=0,e.pending=n;continue;case"#":switch(n){case"#":if(e.pending.length<6){e.pending=r;continue}break;case" ":Ui(e,e.indent_len),Pe(e,rv(e.pending.length)),fn(e);continue}break;case">":{const a=ov(e,Nr,e.blockquote_idx+1);a===-1?(os(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,Pe(e,Nr)):e.blockquote_idx=a,fn(e),e.pending=n;continue}case"-":case"*":case"_":if(e.hr_chars===0&&(console.assert(e.pending.length===1,"Pending should be one character"),e.hr_chars=1,e.hr_char=e.pending),e.hr_chars>0){switch(n){case e.hr_char:e.hr_chars+=1,e.pending=r;continue;case" ":e.pending=r;continue;case`
|
|
85
|
-
`:if(e.hr_chars<3)break;Ui(e,e.indent_len),e.renderer.add_token(e.renderer.data,Fg),e.renderer.end_token(e.renderer.data),fn(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){Ba(e,Or),Ua(e,2),it(e,r.slice(2));continue}break;case"`":if(e.pending.length<3){if(n==="`"){e.pending=r,e.fence_start=r.length;continue}e.fence_start=0;break}switch(n){case"`":e.pending.length===e.fence_start?(e.pending=r,e.fence_start=r.length):(Pe(e,ul),fn(e),e.fence_start=0,it(e,r));continue;case`
|
|
86
|
-
`:{Ui(e,e.indent_len),Pe(e,fo),e.pending.length>e.fence_start&&e.renderer.set_attr(e.renderer.data,jg,e.pending.slice(e.fence_start)),fn(e),e.token=Bi;continue}default:e.pending=r;continue}case"+":if(n!==" ")break;Ba(e,Or),Ua(e,2);continue;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":if(e.pending[e.pending.length-1]==="."){if(n!==" ")break;Ba(e,go)&&e.pending!=="1."&&e.renderer.set_attr(e.renderer.data,Kg,e.pending.slice(0,-1)),Ua(e,e.pending.length+1);continue}else{const a=n.charCodeAt(0);if(a===46||hl(a)){e.pending=r;continue}}break;case"|":os(e,e.blockquote_idx),Pe(e,gl),Pe(e,qi),e.pending="",it(e,n);continue}let o=r;if(e.token===Ln)e.token=e.tokens[e.len],e.renderer.add_token(e.renderer.data,Ln),e.renderer.end_token(e.renderer.data);else if(e.indent_len>=4){let a=0;for(;a<4;a+=1)if(e.indent[a]===" "){a=a+1;break}o=e.indent.slice(a)+r,Pe(e,uo)}else Pe(e,ul);fn(e),it(e,o);continue;case gl:if(e.table_state===1)switch(n){case"-":case" ":case"|":case":":e.pending=r;continue;case`
|
|
87
|
-
`:e.table_state=2,e.pending="";continue;default:Ze(e),e.table_state=0;break}else switch(e.pending){case"|":Pe(e,qi),e.pending="",it(e,n);continue;case`
|
|
88
|
-
`:Ze(e),e.pending="",e.table_state=0,it(e,n);continue}break;case qi:switch(e.pending){case"":break;case"|":Pe(e,Zi),Ze(e),e.pending="",it(e,n);continue;case`
|
|
89
|
-
`:Ze(e),e.table_state=Math.min(e.table_state+1,2),e.pending="",it(e,n);continue;default:Pe(e,Zi),it(e,n);continue}break;case Zi:if(e.pending==="|"){Oe(e),Ze(e),e.pending="",it(e,n);continue}break;case uo:switch(r){case`
|
|
90
|
-
`:case`
|
|
91
|
-
`:case`
|
|
92
|
-
`:case`
|
|
93
|
-
`:case`
|
|
94
|
-
`:e.text+=`
|
|
95
|
-
`,e.pending="";continue;case`
|
|
96
|
-
`:case`
|
|
97
|
-
`:case`
|
|
98
|
-
`:case`
|
|
99
|
-
`:e.pending=r;continue;default:e.pending.length!==0?(Oe(e),Ze(e),e.pending=n):e.text+=n;continue}case fo:switch(n){case"`":e.pending=r;continue;case`
|
|
100
|
-
`:if(r.length===e.fence_start+e.fence_end+1){Oe(e),Ze(e),e.pending="",e.fence_start=0,e.fence_end=0,e.token=Bi;continue}e.token=Bi;break;case" ":if(e.pending[0]===`
|
|
101
|
-
`){e.pending=r,e.fence_end+=1;continue}break}e.text+=e.pending,e.pending=n,e.fence_end=1;continue;case dl:switch(n){case"`":r.length===e.fence_start+ +(e.pending[0]===" ")?(Oe(e),Ze(e),e.pending="",e.fence_start=0):e.pending=r;continue;case`
|
|
102
|
-
`:e.text+=e.pending,e.pending="",e.token=Ln,e.blockquote_idx=0,Oe(e);continue;case" ":e.text+=e.pending,e.pending=n;continue;default:e.text+=r,e.pending="";continue}case Hg:switch(e.pending.length){case 0:if(n!=="[")break;e.pending=r;continue;case 1:if(n!==" "&&n!=="x")break;e.pending=r;continue;case 2:if(n!=="]")break;e.pending=r;continue;case 3:if(n!==" ")break;e.renderer.add_token(e.renderer.data,zg),e.pending[1]==="x"&&e.renderer.set_attr(e.renderer.data,Wg,""),e.renderer.end_token(e.renderer.data),e.pending=" ";continue}e.token=e.tokens[e.len],e.pending="",it(e,r);continue;case wr:case vr:{let a="*",c=Vi;if(e.token===vr&&(a="_",c=_r),a===e.pending){if(Oe(e),a===n){Ze(e),e.pending="";continue}Pe(e,c),e.pending=n;continue}break}case Vi:case _r:{let a="*",c=wr;switch(e.token===_r&&(a="_",c=vr),e.pending){case a:a===n?e.tokens[e.len-1]===c?e.pending=r:(Oe(e),Pe(e,c),e.pending=""):(Oe(e),Ze(e),e.pending=n);continue;case a+a:const u=e.token;Oe(e),Ze(e),Ze(e),a!==n?(Pe(e,u),e.pending=n):e.pending="";continue}break}case xr:if(r==="~~"){Oe(e),Ze(e),e.pending="";continue}break;case Da:n===`
|
|
103
|
-
`?(Oe(e),Pe(e,dn),e.pending=""):(e.token=e.tokens[e.len],e.pending[0]==="\\"?e.text+="[":e.text+="$$",e.pending="",it(e,n));continue;case dn:if(r==="\\]"||r==="$$"){Oe(e),Ze(e),e.pending="";continue}break;case Yt:if(r==="\\)"||e.pending[0]==="$"){Oe(e),Ze(e),n===")"?e.pending="":e.pending=n;continue}break;case Dd:r==="http://"||r==="https://"?(Oe(e),Pe(e,fl),e.pending=r,e.text=r):"http:/"[e.pending.length]===n||"https:/"[e.pending.length]===n?e.pending=r:(e.token=e.tokens[e.len],it(e,n));continue;case Ms:case St:if(e.pending==="]"){Oe(e),n==="("?e.pending=r:(Ze(e),e.pending=n);continue}if(e.pending[0]==="]"&&e.pending[1]==="("){if(n===")"){const a=e.token===Ms?Ps:Ql,c=e.pending.slice(2);e.renderer.set_attr(e.renderer.data,a,c),Ze(e),e.pending=""}else e.pending+=n;continue}break;case fl:n===" "||n===`
|
|
104
|
-
`||n==="\\"?(e.renderer.set_attr(e.renderer.data,Ps,e.pending),Oe(e),Ze(e),e.pending=n):(e.text+=n,e.pending=r);continue;case Bd:if(r.startsWith("<br")){if(r.length===3||n===" "||n==="/"&&(r.length===4||e.pending[e.pending.length-1]===" ")){e.pending=r;continue}if(n===">"){Oe(e),e.token=e.tokens[e.len],e.renderer.add_token(e.renderer.data,Ln),e.renderer.end_token(e.renderer.data),e.pending="";continue}}e.token=e.tokens[e.len],e.text+="<",e.pending=e.pending.slice(1),it(e,n);continue}switch(e.pending[0]){case"\\":if(e.token===St||e.token===dn||e.token===Yt)break;switch(n){case"(":Oe(e),Pe(e,Yt),e.pending="";continue;case"[":e.token=Da,e.pending=r;continue;case`
|
|
105
|
-
`:e.pending=n;continue;default:let o=n.charCodeAt(0);e.pending="",e.text+=hl(o)||o>=65&&o<=90||o>=97&&o<=122?r:n;continue}case`
|
|
106
|
-
`:switch(e.token){case St:case dn:case Yt:break;case Wl:case Kl:case Gl:case Vl:case ql:case Zl:Oe(e),os(e,e.blockquote_idx),e.blockquote_idx=0,e.pending=n;continue;default:Oe(e),e.pending=n,e.token=Ln,e.blockquote_idx=0;continue}break;case"<":if(e.token!==St&&e.token!==dn&&e.token!==Yt){Oe(e),e.pending=r,e.token=Bd;continue}break;case"`":if(e.token===St)break;n==="`"?(e.fence_start+=1,e.pending=r):(e.fence_start+=1,Oe(e),Pe(e,dl),e.text=n===" "||n===`
|
|
107
|
-
`?"":n,e.pending="");continue;case"_":case"*":{if(e.token===St||e.token===dn||e.token===Yt||e.token===wr)break;let o=Vi,a=wr;const c=e.pending[0];if(c==="_"&&(o=_r,a=vr),e.pending.length===1){if(c===n){e.pending=r;continue}if(n!==" "&&n!==`
|
|
108
|
-
`){Oe(e),Pe(e,o),e.pending=n;continue}}else{if(c===n){Oe(e),Pe(e,a),Pe(e,o),e.pending="";continue}if(n!==" "&&n!==`
|
|
109
|
-
`){Oe(e),Pe(e,a),e.pending=n;continue}}break}case"~":if(e.token!==St&&e.token!==xr){if(e.pending==="~"){if(n==="~"){e.pending=r;continue}}else if(n!==" "&&n!==`
|
|
110
|
-
`){Oe(e),Pe(e,xr),e.pending=n;continue}}break;case"$":if(e.token!==St&&e.token!==xr&&e.pending==="$")if(n==="$"){e.token=Da,e.pending=r;continue}else{if(lv(n.charCodeAt(0)))break;Oe(e),Pe(e,Yt),e.pending=n;continue}break;case"[":if(e.token!==St&&e.token!==Ms&&e.token!==dn&&e.token!==Yt&&n!=="]"){Oe(e),Pe(e,Ms),e.pending=n;continue}break;case"!":if(e.token!==St&&n==="["){Oe(e),Pe(e,St),e.pending="";continue}break;case" ":if(e.pending.length===1&&n===" ")continue;break}if(e.token!==St&&e.token!==Ms&&e.token!==dn&&e.token!==Yt&&n==="h"&&(e.pending===" "||e.pending==="")){e.text+=e.pending,e.pending=n,e.token=Dd;continue}e.text+=e.pending,e.pending=n}Oe(e)}function cv(e){return{add_token:uv,end_token:dv,add_text:fv,set_attr:Gg,data:{nodes:[e,,,,,],index:0}}}function uv(e,t){var o;let n=e.nodes[e.index],r;switch(t){case co:return;case Nr:r=document.createElement("blockquote");break;case ul:r=document.createElement("p");break;case Ln:r=document.createElement("br");break;case Fg:r=document.createElement("hr");break;case Wl:r=document.createElement("h1");break;case Kl:r=document.createElement("h2");break;case Gl:r=document.createElement("h3");break;case Vl:r=document.createElement("h4");break;case ql:r=document.createElement("h5");break;case Zl:r=document.createElement("h6");break;case Vi:case _r:r=document.createElement("em");break;case wr:case vr:r=document.createElement("strong");break;case xr:r=document.createElement("s");break;case dl:r=document.createElement("code");break;case fl:case Ms:r=document.createElement("a");break;case St:r=document.createElement("img");break;case Or:r=document.createElement("ul");break;case go:r=document.createElement("ol");break;case Hs:r=document.createElement("li");break;case zg:let a=r=document.createElement("input");a.type="checkbox",a.disabled=!0;break;case uo:case fo:n=n.appendChild(document.createElement("pre")),r=document.createElement("code");break;case gl:r=document.createElement("table");break;case qi:switch(n.children.length){case 0:n=n.appendChild(document.createElement("thead"));break;case 1:n=n.appendChild(document.createElement("tbody"));break;default:n=n.children[1]}r=document.createElement("tr");break;case Zi:r=document.createElement(((o=n.parentElement)==null?void 0:o.tagName)==="THEAD"?"th":"td");break;case dn:r=document.createElement("equation-block");break;case Yt:r=document.createElement("equation-inline");break}e.nodes[++e.index]=n.appendChild(r)}function dv(e){e.index-=1}function fv(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function Gg(e,t,n){e.nodes[e.index].setAttribute(nv(t),n)}const gv={__name:"StreamingMarkdown",props:{text:{type:String,default:""},exposedResources:{type:Array,default:()=>[]}},setup(e){const t=e,n=Be(null);let r,o="",a="",c;function u(){c&&clearTimeout(c),c=void 0}function d(){u(),c=setTimeout(()=>{c=void 0,r!=null&&r.pending&&o&&x(`${o}
|
|
111
|
-
`,o)},80)}function m(O){const M=String(O||"").trim();return M?/^(?:https?:|mailto:|\/|#)/i.test(M)?!0:!/^[a-z][a-z\d+.-]*:/i.test(M):!1}function p(O){const M=String(O||"").trim();return t.exposedResources.find(D=>String((D==null?void 0:D.reference)||"").trim()===M)}function y(O){const M=Number(O);if(!Number.isFinite(M)||M<=0)return"";const D=["B","KB","MB","GB"];let l=M,R=0;for(;l>=1024&&R<D.length-1;)l/=1024,R+=1;return`${l>=10||R===0?Math.round(l):l.toFixed(1)}${D[R]}`}function _(O){return{...cv(O),set_attr(D,l,R){const N=l===Ps?p(R):void 0,U=(N==null?void 0:N.url)||R;if(!((l===Ps||l===Ql)&&!m(U))&&(Gg(D,l,U),l===Ps)){const Z=D.nodes[D.index];if(N){if(Z.classList.add("inline-resource-link",`inline-resource-${N.kind||"link"}`),N.kind==="download"||N.downloadName){Z.setAttribute("download",N.downloadName||N.label||""),Z.setAttribute("title",`下载 ${N.label||N.downloadName||"资源"}`),Z.removeAttribute("target"),Z.removeAttribute("rel"),Z.dataset.resourceDownload="true",Z.dataset.resourceExpiresAt=String(Number(N.expiresAt)||0);const se=y(N.sizeBytes);se&&(Z.dataset.resourceSize=`(${se})`)}}else Z.setAttribute("target","_blank"),Z.setAttribute("rel","noreferrer noopener")}}}}function A(O){if(!r)return;const M=String(O||"");if(u(),!M.startsWith(o)||a!==o){x(M),d();return}const D=M.slice(o.length);o=M,a=M,D&&it(r,D),d()}function x(O=t.text,M=O){const D=n.value;D&&(r&&Fd(r),D.replaceChildren(),r=iv(_(D)),a=String(O||""),o=String(M||""),a&&it(r,a))}return Wr(()=>{x(),d()}),nt(()=>t.text,A,{flush:"post"}),nt(()=>t.exposedResources,()=>x(),{deep:!0,flush:"post"}),Bn(()=>{u(),r&&Fd(r),r=void 0}),(O,M)=>(k(),w("div",{ref_key:"root",ref:n,class:"streaming-markdown-content"},null,512))}},hv=["onDblclick"],pv=["aria-label","onClick"],mv=["title","onClick"],bv=["aria-label","onClick"],yv=Object.assign({name:"CwdTreeNode"},{__name:"CwdTreeNode",props:{nodes:{type:Array,default:()=>[]},children:{type:Object,default:()=>({})},expanded:{type:Object,default:()=>({})},selectedPath:{type:String,default:""},level:{type:Number,default:0},allowDelete:{type:Boolean,default:!0}},emits:["toggle","select","delete"],setup(e,{emit:t}){const n=t;return(r,o)=>{const a=Kb("CwdTreeNode",!0);return k(!0),w(ue,null,Te(e.nodes,c=>(k(),w("div",{key:c.path,class:"cwd-tree-branch"},[f("div",{class:ge(["cwd-tree-row",{selected:e.selectedPath===c.path}]),style:Nt({"--cwd-tree-level":e.level}),onDblclick:u=>n("toggle",c)},[f("button",{type:"button",class:"cwd-tree-toggle","aria-label":e.expanded[c.path]?"收起":"展开",onClick:Ye(u=>n("toggle",c),["stop"])},C(e.expanded[c.path]?"▾":"▸"),9,pv),f("button",{type:"button",class:"cwd-tree-name",title:c.path,onClick:u=>n("select",c)},[o[3]||(o[3]=f("span",{"aria-hidden":"true"},"◇",-1)),f("strong",null,C(c.name),1)],8,mv),e.allowDelete?(k(),w("button",{key:0,type:"button",class:"cwd-tree-delete","aria-label":`删除 ${c.name}`,onClick:Ye(u=>n("delete",c),["stop"])},"×",8,bv)):V("",!0)],46,hv),e.expanded[c.path]&&e.children[c.path]?(k(),at(a,{key:0,nodes:e.children[c.path],children:e.children,expanded:e.expanded,"selected-path":e.selectedPath,level:e.level+1,onToggle:o[0]||(o[0]=u=>n("toggle",u)),onSelect:o[1]||(o[1]=u=>n("select",u)),onDelete:o[2]||(o[2]=u=>n("delete",u))},null,8,["nodes","children","expanded","selected-path","level"])):V("",!0)]))),128)}}});function kv(e,t=Date.now()){const n=typeof(e==null?void 0:e.startedAt)=="string"?Date.parse(e.startedAt):NaN;if(!Number.isSafeInteger(n)||n<0)return;if(e.status==="running"){const o=t-n;return Number.isSafeInteger(o)&&o>=0?o:void 0}if(!["completed","failed","killed"].includes(e.status))return;const r=typeof e.completedAt=="string"?Date.parse(e.completedAt):NaN;return Number.isSafeInteger(r)&&r>=n&&Number.isSafeInteger(e.durationMs)&&e.durationMs>=0&&e.durationMs===r-n?e.durationMs:void 0}function _v(e){return e!=null&&e.live?{key:"running",label:"执行中"}:(e==null?void 0:e.titleStatus)==="failure"||(e==null?void 0:e.titleStatus)==="failed"||(e==null?void 0:e.kind)==="error"||e!=null&&e.toolError?{key:"failed",label:"失败"}:(e==null?void 0:e.titleStatus)==="success"?{key:"completed",label:"完成"}:{key:"unknown",label:"未提供"}}function wv(e,t){const n=String(e||"").trim();if(!n)return"模型未配置";const r=String(t||"").trim();return r?`${n}(${r})`:n}function vv({maxEntries:e=64,timeoutMs:t=15e3,createImage:n,fetchOriginal:r=n?null:(o,a)=>fetch(o,{cache:"no-store",signal:a})}={}){if(n||(n=()=>new Image),!Number.isInteger(e)||e<1||e>512)throw new RangeError("maxEntries must be 1..512");if(!Number.isFinite(t)||t<1)throw new RangeError("timeoutMs must be positive");const o=new Map;let a="";const c=(_,A)=>JSON.stringify([_,A]);function u(_){const A=o.get(_);o.delete(_),A==null||A.cancel()}function d(){for(const _ of o.keys())u(_)}function m(_){_!==a&&(d(),a=_)}function p(_){u(c(a,_))}function y({sessionId:_,originalUrl:A,available:x=!0}){const O={sessionId:_,originalUrl:A},M=Q=>Object.freeze({...O,state:Q});if(!_||_!==a)return Promise.resolve(M("stale"));const D=c(_,A);if(x===!1)return u(D),Promise.resolve(M("unavailable"));if(typeof A!="string"||!A.trim())return Promise.resolve(M("unknown"));const l=o.get(D);if(l)return o.delete(D),o.set(D,l),l.promise;for(;o.size>=e;)u(o.keys().next().value);let R,N,U,Z=!1,se;const oe=new AbortController,ne=new Promise(Q=>{se=Q}),de=Q=>{Z||(Z=!0,clearTimeout(N),oe.abort(),U&&URL.revokeObjectURL(U),se(Object.freeze(Q)))},ye={promise:ne,cancel:()=>{de(M("stale")),R&&(R.src="")}};return o.set(D,ye),N=setTimeout(()=>{de(M("unknown")),R&&(R.src="")},t),(async()=>{try{let Q=A;if(r&&!/^(data:|blob:)/i.test(A)){const Ge=await r(A,oe.signal);if(!Ge.ok)throw new Error("Original unavailable");const F=await Ge.blob();if(Z)return;Q=U=URL.createObjectURL(F)}if(Z)return;R=n(),R.src=Q,await R.decode();const ke=R.naturalWidth,Ee=R.naturalHeight;Number.isInteger(ke)&&ke>0&&Number.isInteger(Ee)&&Ee>0?de({...O,state:"actual",width:ke,height:Ee,source:"original-decode"}):de(M("unknown"))}catch{de(M("unknown"))}})(),ne}return{setSession:m,load:y,invalidate:p,clear:d,get size(){return o.size}}}function Fa(e,t){const n=typeof e=="string"&&/^(\d+)x(\d+)$/.exec(e),r=(t==null?void 0:t.state)==="actual"&&Number.isInteger(t.width)&&t.width>0&&Number.isInteger(t.height)&&t.height>0;return{requested:e==="auto"?"auto(自动策略)":typeof e=="string"&&e?e:"未提供",actual:r?`${t.width} × ${t.height}`:(t==null?void 0:t.state)==="unavailable"?"不可获取":"未知",mismatch:!!(r&&n&&(+n[1]!==t.width||+n[2]!==t.height))}}const xv={class:"shell"},Sv={class:"sidebar"},Ev={class:"brand-row logo-only"},Tv=["aria-label","aria-pressed","title"],Av={class:"nav"},Cv=["title"],Iv={class:"session-entry-main"},Mv={key:0,"aria-hidden":"true"},Rv={class:"sidebar-card prompt-stack"},Nv={class:"prompt-stack-head"},Ov={class:"prompt-list"},Lv={key:0,class:"prompt-list-empty"},Pv={key:1,class:"prompt-list-empty"},$v=["onDragstart","onDblclick"],Dv={class:"prompt-card-body"},Bv={class:"prompt-card-actions"},Uv=["onClick"],Fv=["onClick"],zv={class:"workspace"},Hv={class:"topbar"},jv={class:"top-actions"},Wv=["onClick"],Kv=["onKeydown"],Gv=["title"],Vv=["aria-label","aria-pressed","title"],qv={key:0,class:"content-grid chat-grid"},Zv={class:"chat-panel"},Qv={key:0,class:"runtime-context-bar"},Yv={key:0,class:"runtime-context-bar-actions"},Jv={key:2,class:"runtime-context-syncing"},Xv={key:1,class:"runtime-context-bar project-context-bar"},e0={class:"runtime-context-bar-actions"},t0=["data-index"],n0={class:"tool-group-shell"},s0=["aria-expanded","onClick"],r0={class:"tool-group-label"},i0={class:"tool-group-label-name"},o0={key:0,class:"tool-group-label-count"},a0={key:1,class:"tool-group-label-separator"},l0={key:1,class:"tool-group-lines"},c0=["open"],u0={class:"reasoning-reveal"},d0={class:"reasoning-paper"},f0=["innerHTML"],g0={class:"compaction-context-actions"},h0={key:0},p0={class:"tool-result-title-row"},m0={class:"tool-result-name"},b0={key:0,class:"tool-result-failure-mark","aria-label":"执行失败"},y0={class:"tool-result-detail-row"},k0={key:0,class:"tool-result-primary"},_0={key:1},w0={key:2,class:"tool-group-shell"},v0=["aria-expanded","onClick"],x0={class:"tool-group-label"},S0={class:"tool-group-label-name"},E0={key:0,class:"tool-group-label-count"},T0={key:1,class:"tool-group-label-separator"},A0={key:0,class:"tool-group-purposes"},C0={key:3,class:"tool-result-primary"},I0={key:0},M0={key:4,class:"tool-result-previews"},R0={class:"tool-result-preview kind-list"},N0={tabindex:"0"},O0={key:5,class:"tool-result-previews"},L0={class:"tool-result-preview kind-code"},P0={tabindex:"0"},$0={key:6,class:"tool-result-previews"},D0={tabindex:"0"},B0={key:3},U0={key:0,class:"message-head"},F0={key:0,class:"tool-result-failure-mark","aria-label":"执行失败"},z0=["innerHTML"],H0={key:0,class:"message-body compaction-message-body"},j0={class:"compaction-context-actions"},W0={key:0},K0={key:1,class:"message-body reasoning-body"},G0=["open"],V0={key:0,class:"reasoning-elapsed"},q0={class:"reasoning-reveal"},Z0={class:"reasoning-paper"},Q0=["innerHTML"],Y0={key:2,class:"message-body"},J0={key:0,class:"message-head"},X0={key:0,class:"tool-result-failure-mark","aria-label":"执行失败"},ex={key:1},tx={key:2,class:"elapsed-pill"},nx={key:1,class:"image2-result-shell"},sx=["innerHTML"],rx={key:0,class:"message-image-attachments image2-output-images"},ix=["data-preview-src","aria-label"],ox=["src","alt"],ax={key:1,class:"image-unavailable-placeholder",role:"status"},lx={class:"image-card-actions"},cx=["href","download"],ux=["onClick"],dx=["onClick"],fx={class:"tool-result-title-row"},gx={class:"tool-result-name"},hx={key:0,class:"tool-result-failure-mark","aria-label":"执行失败"},px={class:"tool-result-detail-row"},mx={key:0,class:"tool-result-primary"},bx={key:1},yx={key:2,class:"tool-group-shell"},kx=["aria-expanded","onClick"],_x={class:"tool-group-label"},wx={class:"tool-group-label-name"},vx={key:0,class:"tool-group-label-count"},xx={key:1,class:"tool-group-label-separator"},Sx={key:0,class:"tool-group-purposes"},Ex={key:3,class:"tool-result-primary"},Tx={key:0},Ax={key:4,class:"tool-result-previews"},Cx={class:"tool-result-preview kind-list"},Ix={tabindex:"0"},Mx={key:5,class:"tool-result-previews"},Rx={class:"tool-result-preview kind-code"},Nx={tabindex:"0"},Ox={key:6,class:"tool-result-previews"},Lx={tabindex:"0"},Px={class:"plugin-resource-stack"},$x=["src","title"],Dx=["innerHTML"],Bx={key:1,class:"message-text markdown streaming-markdown"},Ux=["innerHTML"],Fx={key:0,class:"message-image-attachments"},zx=["data-preview-src","aria-label"],Hx=["src","alt"],jx={key:1,class:"image-unavailable-placeholder",role:"status"},Wx=["href","download"],Kx={key:2,class:"message-loading",role:"status","aria-live":"polite"},Gx={class:"message-loading-body"},Vx={class:"message-loading-label"},qx={key:0,class:"queued"},Zx={key:0,class:"composer-app-prompt"},Qx={key:1,class:"attachments file-attachments"},Yx=["onClick"],Jx={key:2,class:"attachments image-attachments"},Xx=["src","alt"],e1=["onClick"],t1={class:"composer-path-row"},n1=["title"],s1={class:"mobile-session-options"},r1={class:"mobile-session-options-body"},i1={class:"mobile-session-actions"},o1=["aria-pressed"],a1=["disabled"],l1={class:"mobile-runtime-info"},c1={class:"mobile-runtime-grid"},u1={key:1,class:"mobile-runtime-card"},d1={key:2,class:"mobile-runtime-card"},f1={class:"mobile-runtime-card"},g1={class:"composer-footer"},h1={class:"composer-metrics","aria-label":"运行状态指标"},p1={class:"metric-chip model-chip"},m1=["aria-pressed","title"],b1={class:"compress-wrap"},y1=["disabled"],k1={class:"composer-actions"},_1=["disabled"],w1=["type","disabled","aria-label"],v1=["data-mobile-card","onKeydown"],x1={class:"background-task-section","data-card":"tasks"},S1={class:"background-task-head"},E1={class:"panel-title"},T1={key:0,class:"background-task-count"},A1=["title"],C1={key:0,class:"background-task-more"},I1={key:1,class:"background-task-history"},M1={class:"background-task-history-list"},R1=["title","onClick"],N1={key:1,class:"quota-card","data-card":"quota"},O1={class:"quota-card-head"},L1={class:"quota-card-controls"},P1=["aria-valuenow"],$1={class:"quota-card-foot"},D1={class:"quota-card-update"},B1={class:"quota-card memory-card","data-card":"memory"},U1={class:"memory-card-head"},F1={class:"memory-trend",viewBox:"0 0 260 44",preserveAspectRatio:"none",role:"img","aria-label":"最近一小时 RSS 趋势"},z1=["d"],H1=["cx","cy","r","onFocus"],j1={key:1,class:"memory-trend-empty"},W1={class:"memory-stats"},K1={class:"memory-card-foot"},G1={key:1,class:"content-grid single"},V1={class:"panel-page sessions-page"},q1={class:"session-toolbar"},Z1={class:"session-search","aria-label":"搜索会话"},Q1={class:"session-count"},Y1={key:0,class:"empty-state"},J1={key:1,class:"empty-state"},X1={key:2,class:"empty-state"},eS={key:3,class:"session-list"},tS={class:"session-card-main"},nS={class:"session-card-title"},sS={key:0,class:"current-pill"},rS={key:1,class:"live-pill"},iS={class:"session-card-meta"},oS=["title"],aS=["datetime"],lS={class:"session-actions"},cS=["disabled","onClick"],uS=["disabled","onClick"],dS={key:4,class:"session-pagination","aria-label":"会话分页"},fS=["disabled"],gS=["aria-current","onClick"],hS=["disabled"],pS={key:2,class:"content-grid single"},mS={class:"panel-page prompt-page"},bS={class:"page-head"},yS={class:"page-head-actions"},kS={class:"prompt-workbench"},_S={class:"prompt-library-panel"},wS={class:"prompt-library-head"},vS={class:"prompt-library-list"},xS={key:0,class:"prompt-list-empty"},SS={key:1,class:"prompt-list-empty"},ES=["onClick","onDblclick","onDragstart","onDragover","onDrop"],TS={key:0},AS={class:"prompt-editor-panel"},CS={class:"prompt-editor-toolbar"},IS={class:"prompt-editor-current"},MS={class:"prompt-editor-toolbar-actions"},RS=["disabled"],NS=["disabled"],OS={class:"prompt-editor-grid"},LS={class:"prompt-editor-field"},PS={class:"prompt-editor-field prompt-editor-field-full"},$S={class:"prompt-editor-field prompt-editor-field-full"},DS={key:3,class:"content-grid single"},BS={class:"panel-page settings-page"},US={class:"page-head settings-page-head"},FS=["disabled"],zS={key:0,class:"empty-state"},HS={class:"settings-card"},jS={class:"settings-field-grid"},WS={class:"settings-field"},KS={key:0,class:"settings-required","aria-label":"必填"},GS=["onUpdate:modelValue","type","placeholder"],VS={class:"settings-card"},qS={class:"settings-field-grid"},ZS={class:"settings-field"},QS={class:"settings-field"},YS={class:"settings-card settings-plugin-card"},JS={class:"settings-card-head"},XS=["disabled"],eE={class:"plugin-settings-list"},tE={class:"plugin-toggle"},nE=["onUpdate:modelValue","aria-label"],sE={class:"settings-card settings-plugin-card"},rE={class:"settings-card-head"},iE=["disabled"],oE={class:"plugin-settings-list"},aE={class:"plugin-toggle"},lE=["onUpdate:modelValue","disabled","aria-label"],cE={key:4,class:"content-grid single"},uE={class:"panel-page"},dE={class:"capability-grid"},fE={key:0,class:"toast"},gE=["title","onKeydown"],hE={class:"cwd-picker-modal",role:"dialog","aria-modal":"true","aria-label":"选择工作目录"},pE=["disabled"],mE=["disabled"],bE={class:"cwd-picker-shortcuts"},yE={class:"cwd-picker-browser"},kE={class:"cwd-picker-locations","aria-label":"常用位置"},_E=["title","onClick"],wE={"aria-hidden":"true"},vE={class:"cwd-picker-tree"},xE={key:0,class:"cwd-picker-empty"},SE={key:1,class:"cwd-picker-error"},EE={class:"cwd-picker-actions"},TE=["disabled"],AE={class:"runtime-context-modal",role:"dialog","aria-modal":"true","aria-label":"项目上下文"},CE={class:"runtime-context-modal-head"},IE={key:0,class:"runtime-context-kicker"},ME=["aria-label"],RE={class:"runtime-context-modal-content"},NE={key:0,class:"runtime-context-index"},OE=["onClick"],LE={key:1,class:"project-context-document"},PE=["aria-label"],$E={class:"confirm-dialog-content"},DE={class:"confirm-dialog-actions"},BE={class:"context-window-modal",role:"dialog","aria-modal":"true","aria-label":"调整上下文窗口"},UE={class:"context-window-input-wrap"},FE={key:0,class:"context-window-error",role:"alert"},zE={class:"context-window-actions"},HE=["disabled"],jE=["disabled"],WE=["aria-label"],KE={class:"image-preview-canvas"},GE=["src","alt"],VE={key:0,class:"image-preview-caption"},qE={class:"runtime-context-detail-modal compaction-detail-modal",role:"dialog","aria-modal":"true","aria-label":"压缩上下文详情"},ZE={class:"runtime-context-detail-content compaction-detail-content"},QE={class:"compaction-detail-stats"},YE={class:"runtime-context-modal",role:"dialog","aria-modal":"true","aria-label":"运行上下文"},JE={class:"runtime-context-modal-head"},XE={class:"runtime-context-modal-content"},eT={key:0,class:"runtime-context-index"},tT=["onClick"],nT={key:1,class:"runtime-plugin-list"},sT={key:0,class:"runtime-context-empty"},rT={class:"runtime-tool-status"},iT=["disabled","onClick"],oT={key:2,class:"runtime-plugin-list"},aT={key:0,class:"runtime-context-empty"},lT=["aria-label"],cT={class:"runtime-context-modal-head"},uT={key:0,class:"runtime-context-kicker"},dT={class:"runtime-context-detail-content"},fT={key:0},gT={key:1},hT={class:"tool-result-modal background-task-modal",role:"dialog","aria-modal":"true","aria-label":"后台任务"},pT={class:"tool-result-modal-head"},mT={class:"tool-result-modal-title"},bT={class:"background-task-modal-count"},yT={key:0,class:"background-task-index","aria-label":"后台任务列表"},kT=["title","onClick"],_T={class:"background-task-index-copy"},wT={class:"background-task-detail"},vT={class:"background-task-detail-head"},xT={class:"background-task-detail-title"},ST={class:"background-task-meta"},ET={key:0},TT={key:1,class:"wide"},AT={class:"background-task-detail-body"},CT={key:0,class:"background-task-command-section"},IT={class:"background-task-command"},MT={key:2,style:{"min-width":"0",width:"100%"}},RT=["aria-label"],NT={class:"tool-result-modal-head"},OT={class:"tool-result-modal-title"},LT={key:0},PT={class:"tool-result-modal-content"},$T=["innerHTML"],DT=2048,BT=18e5,za=.62,Ha=10,UT="System hint: if the user is asking you to draw, render, create, generate, or illustrate a new image, you must call the image2 tool with mode=generate instead of replying with text-only description. After the tool returns images, continue the response normally so the UI can display them in the conversation.",FT="System hint: the user attached an image. If this request involves image editing, modification, redraw, background replacement, style transfer, repair, object removal, or localized changes, you must call the image2 tool with mode=edit and use the attached or most recent image as the source image. Image operations may take a while, so wait up to 10 minutes by default unless the tool returns an error or the user interrupts.",zT="System hint from web UI: if your final answer produces, creates, modifies, exports, packages, or identifies local files that the user should receive, you must call the expose_downloads tool with all relevant absolute file paths before your final textual response. Do not paste absolute paths as the primary delivery method; expose them as browser downloads.",HT="<<ATTACHMENT_MANIFEST>>",jT="<</ATTACHMENT_MANIFEST>>",Fi="••••••••••••••••••",zi="neoctl-web.tabId",As="neoctl-web.sessionId",zd="neoctl-web.theme",ja="neoctl-web.clientRevision",Hd="neoctl-web.clientReloadRequest",Wa="__neo_reload",WT=112,jd=4e4,KT={__name:"App",setup(e){We.registerLanguage("javascript",Oa),We.registerLanguage("js",Oa),We.registerLanguage("jsx",Oa),We.registerLanguage("typescript",La),We.registerLanguage("ts",La),We.registerLanguage("tsx",La),We.registerLanguage("python",Ld),We.registerLanguage("py",Ld),We.registerLanguage("bash",Pa),We.registerLanguage("sh",Pa),We.registerLanguage("shell",Pa),We.registerLanguage("json",Fw),We.registerLanguage("css",Zw),We.registerLanguage("html",$a),We.registerLanguage("xml",$a),We.registerLanguage("vue",$a),We.registerLanguage("markdown",Pd),We.registerLanguage("md",Pd),We.registerLanguage("yaml",$d),We.registerLanguage("yml",$d),We.registerLanguage("diff",Qw);const t=[{value:"inherit",label:"跟随全局"},{value:"enabled",label:"启用"},{value:"disabled",label:"关闭"}],n={Assistant:"助手",You:"你",User:"你",System:"系统","Context compaction":"上下文压缩",Config:"配置",Reasoning:"思考","Runtime tool":"运行时工具",multi_tool_use:"并行执行工具",文件下载:"文件下载"},r={"API key":"API Key","Base URL":"Base URL",Model:"模型","Fallback model":"备用模型",Endpoint:"Endpoint","Reasoning effort":"推理强度","Reasoning summary":"推理摘要","Max output tokens":"最大输出 Token","Timeout ms":"请求超时(ms)","Stream idle timeout ms":"流式空闲超时(ms)","Max retries":"最大重试次数"},o={openai:"OpenAI"},a={INVALID_REQUEST:"请求参数无效",SESSION_ACTIVE:"当前会话不能删除,请先切换到其他会话",SESSION_RUNNING:"运行中的会话不能删除,请等待运行结束",SESSION_NOT_FOUND:"会话不存在或已被删除",SESSION_RESUME_FAILED:"打开会话失败",SESSION_CREATE_FAILED:"新建会话失败",SESSION_DELETE_FAILED:"删除会话失败",PLUGIN_UPDATE_BLOCKED:"模型回答期间不能修改会话插件",PLUGIN_NOT_CONFIGURED:"插件功能未配置",PLUGIN_INVALID:"插件配置无效",PLUGIN_UPDATE_FAILED:"插件配置更新失败",PLUGINS_LOCKED:"插件配置已由环境变量锁定",TOOL_UPDATE_BLOCKED:"模型回答期间不能修改会话工具",TOOL_NOT_CONFIGURED:"工具配置功能未启用",TOOL_INVALID:"工具配置无效",TOOL_UPDATE_FAILED:"工具配置更新失败",PROMPT_UPDATE_FAILED:"提示词更新失败",PROMPT_INVALID:"提示词内容无效",FAST_MODE_UPDATE_FAILED:"快速模式切换失败",CONTEXT_WINDOW_UPDATE_BLOCKED:"回答期间不能调整上下文窗口",CONTEXT_WINDOW_INVALID:"请输入大于 0 的整数",CONTEXT_WINDOW_UPDATE_FAILED:"上下文窗口调整失败",CWD_NOT_CONFIGURED:"当前运行时不支持工作目录切换",CWD_INVALID:"路径不存在或不可访问",CWD_UPDATE_BLOCKED:"模型回答期间不能切换工作目录",CWD_UPDATE_FAILED:"工作目录切换失败",CWD_CREATE_FAILED:"文件夹新建失败",CWD_DELETE_FAILED:"只能删除空文件夹,且不能删除当前目录或其上级目录",LOGIN_INVALID:"模型配置无效",LOGIN_SAVE_FAILED:"模型配置保存失败",API_NOT_FOUND:"当前运行时不支持此功能,请重启服务",WEB_REQUEST_FAILED:"请求处理失败"};let c=x(),u=sessionStorage.getItem(As)||"",d=!u,m=!1;const p=[];function y(){return{id:"",title:"",content:"",usage:""}}function _(s){if(!s||typeof s!="object")return null;const i=String(s.title||"").trim(),g=String(s.content||"").trim();return!i||!g?null:{id:String(s.id||A()).trim(),title:i,content:g,usage:String(s.usage||"").trim()}}function A(){return`prompt-${Math.random().toString(36).slice(2,10)}`}function x(){let s=sessionStorage.getItem(zi);return s||(s=O(),sessionStorage.setItem(zi,s)),s}function O(){var g,h;if((g=globalThis.crypto)!=null&&g.randomUUID)return globalThis.crypto.randomUUID();const s=new Uint8Array(16);if((h=globalThis.crypto)!=null&&h.getRandomValues)globalThis.crypto.getRandomValues(s);else for(let b=0;b<s.length;b+=1)s[b]=Math.floor(Math.random()*256);s[6]=s[6]&15|64,s[8]=s[8]&63|128;const i=[...s].map(b=>b.toString(16).padStart(2,"0"));return`${i.slice(0,4).join("")}-${i.slice(4,6).join("")}-${i.slice(6,8).join("")}-${i.slice(8,10).join("")}-${i.slice(10).join("")}`}function M(s){const i=new URL(s,window.location.origin);return i.searchParams.set("tabId",c),u&&i.searchParams.set("sessionId",u),`${i.pathname}${i.search}${i.hash}`}function D(s,i=!1){const g=(s==null?void 0:s.sessionId)||"";!g||g===u||!i&&!d&&u||(u=g,d=!1,sessionStorage.setItem(As,g))}const l=ls({connected:!1,connecting:!0,coreVersion:"",coreEasterEgg:!1,lines:[],status:{phase:"ready",streamedOutputTokens:0},appPrompt:{hasActivePrompt:!1,activePrompt:void 0},runtimeContext:void 0,runtimeContextLoading:!0,runtimeContextError:"",runtimeContextModal:"",runtimeContextDetail:void 0,projectContextOpen:!1,projectContextDocument:void 0,globalPlugins:{items:[],locked:!1,restartRequired:!0,loading:!1},sessionPlugins:{items:[],busy:!1,loading:!1},globalTools:{items:[],loading:!1},sessionTools:{items:[],busy:!1,loading:!1},fastMode:!1,fastModeMutating:!1,contextWindowModalOpen:!1,contextWindowDraft:"",contextWindowError:"",contextWindowSaving:!1,busy:!1,queuedInput:void 0,backgroundTaskCount:0,backgroundTasks:[],agentTaskHistory:[],terminalTaskHistory:[],backgroundSessionRunCount:0,runningSessionIds:[],session:void 0,modelSettings:void 0,cwd:"",cwdPicker:{open:!1,cwd:"",parent:"",home:"",entries:[],locations:[],treeRoots:[],treeChildren:{},treeExpanded:{},selectedPath:"",selectionExplicit:!1,input:"",loading:!1,mutating:!1,error:""},sessionsLoading:!1,sessionResumeLoading:!1,pendingResumeSessionId:"",catalog:{commands:[],modelIds:[],reasoning:[]},interactive:{},sessions:[],login:void 0,cpaConfig:{url:"",password:"",hasPassword:!1,loaded:!1},cpaQuotas:[],cpaQuotaIndex:0,memory:{current:null,history:[],sampleMs:6e4,retentionMs:864e5},activePanel:"chat",toolDetailLineId:void 0,expandedToolGroups:{},compactionDetailLineId:void 0,backgroundTaskDetail:void 0,imagePreview:void 0,confirmDialog:{open:!1,title:"",message:"",confirmLabel:"确认",cancelLabel:"取消",tone:"warning"},promptLibrary:[],promptLibraryLoading:!0,promptManagerOpen:!1,selectedPromptId:"",composerDropActive:!1,composerDropMode:"prompt",attachments:[],attachmentCounter:0,uploadingFiles:!1,messageImagePreviews:[],liveToolStartedAt:{},clockTick:Date.now(),composerMetrics:{context:{display:0,target:0,bump:0,initialized:!1},inputTokens:{display:0,target:0,bump:0,initialized:!1},outputTokens:{display:0,target:0,bump:0,initialized:!1}},toast:""}),R=Be(""),N=Be(""),U=Be(1),Z=Be(Jp()),se=Be(null),oe=Be(null),ne=Be(null),de=Be(null),ye=Be(null),Q=Be(null),ke=Be(""),Ee=be(()=>[{id:"tasks",title:"后台任务"},...Ct.value?[{id:"quota",title:"周额度"}]:[],{id:"memory",title:"服务端内存"}]),Ge=s=>{var i;return((i=Ee.value.find(g=>g.id===s))==null?void 0:i.title)||""};function F(s){Ai(),l.activePanel="chat",ke.value=s,kt(()=>{var i;return(i=document.querySelector(".mobile-card-close"))==null?void 0:i.focus()})}function X(){ke.value="",kt(()=>{var s,i;return(i=(s=Q.value)==null?void 0:s.querySelector("summary"))==null?void 0:i.focus()})}const q=Be(""),fe=ls({}),pe=ls(y()),Ce=Be(""),Re=Be(""),Je=Be(""),Qe=Be("before"),Xe=Be(-1);let Fe,Wt,At=0,et=0,vt=0,rn,v=!1,T,P,H,j=0,W=Promise.resolve(),B=0,J,K=!1,$,ce;uh();const ee=new Map,ae=new Map,me=Be(0),z=be(()=>[...l.lines||[]].reverse().find(s=>Ko(s))||null),Y=be(()=>{var s;return up((s=l.status)==null?void 0:s.phase)}),ie=be(()=>{var s,i;if(z.value)return Bc(z.value)?"整理图片结果":"图片生成中";if(((s=l.status)==null?void 0:s.phase)==="running_tools"){const g=(i=l.status)==null?void 0:i.currentTool;if(String((g==null?void 0:g.name)||"").toLowerCase()==="image_create")return"图片生成中";if(g!=null&&g.name)return`调用 ${g.name}${g.kind?` · ${g.kind}`:""}`}return Y.value}),he=be(()=>{var s;return Im((s=l.status)==null?void 0:s.phase)}),Ae=be(()=>he.value||l.busy||l.sessionResumeLoading),qe=be(()=>{if(l.sessionResumeLoading)return"正在加载会话";if(z.value){const s=rr(z.value),i=Bc(z.value)?"正在载入图片结果":"图片模型正在生成";return s?`${i} · 已用时 ${s}`:i}return`正在${ie.value}`}),gt=s=>String(s||"").replace(/设计/g,"").trim(),Kt=s=>gt(s==null?void 0:s.title)||"未命名会话",xn=be(()=>{var i;const s=gt((i=l.session)==null?void 0:i.title);return s&&s!=="neo"?s:""}),rt=be(()=>xn.value||"未命名会话"),ht=Be(null),js=Be(null),ps=Be(!1);let Vr;const Io=async()=>{await kt();const s=ht.value,i=js.value;ps.value=!!(s&&i&&i.scrollWidth>s.clientWidth+2)},Yl=be(()=>l.cwd||"—"),Jl=be(()=>{var s,i,g,h,b;return wv(((s=l.modelSettings)==null?void 0:s.model)??((g=(i=l.status)==null?void 0:i.metrics)==null?void 0:g.model),(b=(h=l.modelSettings)==null?void 0:h.reasoning)==null?void 0:b.effort)}),Xl=be(()=>`${l.composerMetrics.context.display.toFixed(1)}%`),Vg=be(()=>{var i,g;const s=Number((g=(i=l.status)==null?void 0:i.metrics)==null?void 0:g.contextWindowTokens);return Number.isFinite(s)&&s>0?String(Math.max(1,Math.round(s/1e3))):""}),ec=be(()=>ln(l.composerMetrics.inputTokens.display)),tc=be(()=>ln(l.composerMetrics.outputTokens.display)),zn=be(()=>he.value||l.busy),Hn=be(()=>l.backgroundTasks.length),qr=be(()=>[...l.agentTaskHistory,...l.terminalTaskHistory].sort((s,i)=>{const g=h=>typeof h.completedAt=="number"?h.completedAt:Date.parse(h.completedAt||h.updatedAt||"")||(typeof h.createdAt=="number"?h.createdAt:0);return g(i)-g(s)})),Sn=be(()=>{const s=new Set;return[...l.backgroundTasks,...qr.value].filter(i=>{const g=Qn(i);return s.has(g)?!1:(s.add(g),!0)})}),Ws=be(()=>l.backgroundTasks[0]),nc=be(()=>!!(R.value.trim()||l.attachments.length)),sc=be(()=>zn.value?nc.value?"打断并发送":l.queuedInput?"立即发送":"停止":"发送 ↵"),Ks=be(()=>{const s=N.value.trim().toLocaleLowerCase(),i=l.sessions||[];return s?i.filter(g=>[Kt(g),g.title,g.sessionId,g.updatedAt,g.createdAt].some(h=>String(h||"").toLocaleLowerCase().includes(s))):i}),Zr=be(()=>Math.max(1,Math.ceil(Ks.value.length/Ha))),qg=be(()=>{const s=(U.value-1)*Ha;return Ks.value.slice(s,s+Ha)}),Zg=be(()=>{const s=Zr.value,i=Math.max(1,Math.min(U.value-2,s-4)),g=Math.min(s,i+4);return Array.from({length:g-i+1},(h,b)=>i+b)}),jn=be(()=>l.sessionResumeLoading?[]:Jh((l.lines||[]).filter(s=>!op(s)))),Qr=F_(be(()=>({count:jn.value.length,getScrollElement:()=>ne.value,estimateSize:Sm,getItemKey:s=>xm(jn.value[s]),rangeExtractor:s=>{const i=new Set(mg(s));return jn.value.forEach((g,h)=>{(g==null?void 0:g.live)===!0&&i.add(h)}),[...i].sort((g,h)=>g-h)},overscan:8,scrollMargin:me.value,anchorTo:"end",followOnAppend:!0,scrollEndThreshold:96,useAnimationFrameWithResizeObserver:!0}))),Qg=be(()=>Qr.value.getVirtualItems().filter(s=>jn.value[s.index])),Yg=be(()=>Qr.value.getTotalSize()),rc=be(()=>{var s,i;return Array.isArray((i=(s=l.runtimeContext)==null?void 0:s.prompt)==null?void 0:i.sections)?l.runtimeContext.prompt.sections:[]}),Mo=be(()=>{var s;return Array.isArray((s=l.runtimeContext)==null?void 0:s.tools)?l.runtimeContext.tools:[]}),Gs=be(()=>{var s,i;return Array.isArray((i=(s=l.runtimeContext)==null?void 0:s.project)==null?void 0:i.documents)?l.runtimeContext.project.documents:[]}),Jg=be(()=>l.sessionPlugins.items.filter(s=>s.effectiveEnabled).length),Xg=be(()=>l.sessionTools.items.filter(s=>s.effectiveEnabled).length),Pt=be(()=>l.lines.find(s=>String(s.id)===String(l.toolDetailLineId))||null),on=be(()=>l.lines.find(s=>String(s.id)===String(l.compactionDetailLineId))||null),Wn=be(()=>{var s;return((s=l.appPrompt)==null?void 0:s.activePrompt)||void 0}),eh=be(()=>{var s,i;return((s=Wn.value)==null?void 0:s.title)||((i=Wn.value)==null?void 0:i.id)||""}),Yr=be(()=>l.promptLibrary.find(s=>s.id===l.selectedPromptId)||l.promptLibrary[0]||null),Jr=be(()=>Z.value==="dark"),Xr=be(()=>Jr.value?"切换到日间模式":"切换到夜间模式"),Ct=be(()=>l.cpaQuotas.length?l.cpaQuotas[l.cpaQuotaIndex%l.cpaQuotas.length]||l.cpaQuotas[0]:null),Kn=be(()=>{var s;return((s=l.memory)==null?void 0:s.current)||null}),ei=be(()=>{var E;const s=(((E=l.memory)==null?void 0:E.history)||[]).filter(I=>Number.isFinite(Number(I==null?void 0:I.rss))),i=s.map(I=>Number(I.rss));if(!i.length)return[];const g=Math.min(...i),h=Math.max(...i),b=Math.max(1,h-g);return i.map((I,G)=>({entry:s[G],x:i.length===1?130:G/(i.length-1)*260,y:i.length===1?22:40-(I-g)/b*36}))}),ic=be(()=>ei.value.map((s,i)=>`${i?"L":"M"} ${s.x.toFixed(1)} ${s.y.toFixed(1)}`).join(" ")),Vs=be(()=>ei.value[Xe.value]||null);nt(Z,Xp,{immediate:!0}),nt([zn,Jr],([s,i])=>{const h=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M32 4 50 32 32 60 14 32Z" fill="${s?i?"#bef264":"#a3e635":i?"#38bdf8":"#7dd3fc"}"/></svg>`,b=document.querySelector('link[rel="icon"]');b&&(b.href=`data:image/svg+xml,${encodeURIComponent(h)}`)},{immediate:!0}),nt(xn,s=>{document.title=s||"对话工作台"},{immediate:!0}),nt(rt,Io,{immediate:!0}),nt(N,()=>{U.value=1}),nt(Zr,s=>{U.value>s&&(U.value=s)}),nt(()=>{var s;return(s=l.backgroundTaskDetail)==null?void 0:s.output},async()=>{await kt();const s=ye.value;s&&(s.scrollTop=s.scrollHeight)}),nt(()=>jn.value.length,async()=>{await kt(),ma(),Ei()}),nt(()=>l.activePanel,async s=>{s==="chat"&&(await kt(),ma(),Ei())}),Wr(async()=>{typeof ResizeObserver<"u"&&(ce=new ResizeObserver(Ei),ma()),Ei(),await Promise.all([ms(),th(),ti(),Ro(),ni(),oc(),Po(),vc()]),si(),T=setInterval(()=>{l.clockTick=Date.now()},1e3),P=setInterval(Po,6e4),H=setInterval(vc,6e4),window.addEventListener("keydown",nu),document.addEventListener("click",Mc),document.addEventListener("click",Rc),document.addEventListener("pointerdown",_u,!0),typeof ResizeObserver<"u"&&ht.value&&(Vr=new ResizeObserver(Io),Vr.observe(ht.value)),Io()}),Bn(()=>{Fe&&Fe.close(),At&&cancelAnimationFrame(At),et&&cancelAnimationFrame(et),ri(),rn=void 0,j&&cancelAnimationFrame(j),T&&clearInterval(T),P&&clearInterval(P),H&&clearInterval(H),$&&clearTimeout($),Vr&&Vr.disconnect(),ce&&ce.disconnect(),document.body.classList.remove("tool-detail-open","image-preview-open","runtime-context-open","context-window-open","cwd-picker-lock"),J&&ys(!1),window.removeEventListener("keydown",nu),document.removeEventListener("click",Mc),document.removeEventListener("click",Rc),document.removeEventListener("pointerdown",_u,!0)});async function ms(s={}){try{const i=await fetch(M("/api/state"));if(!i.ok)throw new Error(`state ${i.status}`);return gc(await i.json()),!0}catch(i){return s.silent||we(`运行时不可用:${i.message||i}`),!1}}async function th(){try{const s=await fetch(M("/api/client-info"),{cache:"no-store"});if(!s.ok)return;ac(await s.json())}catch{}}async function ti(){l.runtimeContextLoading=!0;try{const s=await fetch(M("/api/runtime-context")),i=await s.json().catch(()=>({}));if(!s.ok)throw new Error(i.error||`runtime-context ${s.status}`);return cc(i),!0}catch(s){return l.runtimeContextError=s.message||String(s),!1}finally{l.runtimeContextLoading=!1}}async function nh(){l.globalTools.loading=!0;try{const s=await fetch(M("/api/tools")),i=await s.json().catch(()=>({}));if(!s.ok)throw new Error(i.error||`tools ${s.status}`);l.globalTools={items:Array.isArray(i.items)?i.items.map(g=>({...g})):[],loading:!1}}catch(s){l.globalTools.loading=!1,we(s.message||String(s))}}async function sh(){const s=Object.fromEntries(l.globalTools.items.map(i=>[i.name,i.configuredEnabled!==!1]));l.globalTools.loading=!0;try{const i=await Ve("/api/tools/global",{overrides:s});l.globalTools={...i.state,loading:!1},await Promise.all([ni(),ti()]),we("全局工具配置已保存并立即生效")}catch(i){l.globalTools.loading=!1,xt(i,"工具配置保存失败")}}async function ni(){l.sessionTools.loading=!0;try{const s=await fetch(M("/api/session-tools")),i=await s.json().catch(()=>({}));if(!s.ok)throw new Error(i.error||`session-tools ${s.status}`);l.sessionTools={...i,items:Array.isArray(i.items)?i.items:[],loading:!1}}catch(s){l.sessionTools.loading=!1,we(s.message||String(s))}}async function rh(s,i){const g=Object.fromEntries(l.sessionTools.items.map(h=>[h.name,h.name===s.name?i:h.mode]));l.sessionTools.busy=!0;try{const h=await Ve("/api/session-tools",{overrides:g});l.sessionTools={...h.state,loading:!1,busy:!1}}catch(h){l.sessionTools.busy=!1,xt(h,"会话工具更新失败")}}async function ih(){l.globalPlugins.loading=!0;try{const s=await fetch(M("/api/plugins")),i=await s.json().catch(()=>({}));if(!s.ok)throw new Error(i.error||`plugins ${s.status}`);l.globalPlugins={items:Array.isArray(i.items)?i.items.map(g=>({...g})):[],locked:i.locked===!0,restartRequired:i.restartRequired!==!1,loading:!1}}catch(s){l.globalPlugins.loading=!1,we(s.message||String(s))}}async function oh(){const s=l.globalPlugins.items.filter(i=>i.configuredEnabled!==!1).map(i=>i.id);l.globalPlugins.loading=!0;try{const i=await Ve("/api/plugins/global",{enabledIds:s}),g=new Set(i.enabledIds||s);l.globalPlugins.items=l.globalPlugins.items.map(h=>({...h,configuredEnabled:g.has(h.id)})),we("插件配置已保存,重启后生效")}catch(i){xt(i,"插件配置保存失败")}finally{l.globalPlugins.loading=!1}}async function Ro(){l.sessionPlugins.loading=!0;try{const s=await fetch(M("/api/session-plugins")),i=await s.json().catch(()=>({}));if(!s.ok)throw new Error(i.error||`session-plugins ${s.status}`);l.sessionPlugins={...i,items:Array.isArray(i.items)?i.items:[],loading:!1}}catch(s){l.sessionPlugins.loading=!1,we(s.message||String(s))}}async function ah(s,i){const g=Object.fromEntries(l.sessionPlugins.items.map(h=>[h.id,h.id===s.id?i:h.mode]));l.sessionPlugins.busy=!0;try{const h=await Ve("/api/session-plugins",{overrides:g});l.sessionPlugins={...h.state,loading:!1,busy:!1}}catch(h){l.sessionPlugins.busy=!1,xt(h,"会话插件更新失败")}}async function oc(){l.promptLibraryLoading=!0;try{const s=await fetch(M("/api/prompt-library")),i=await s.json().catch(()=>({}));if(!s.ok)throw new Error(i.error||`prompt-library ${s.status}`);qs(Array.isArray(i.items)?i.items:p)}catch(s){qs([]),we(s.message||String(s))}finally{l.promptLibraryLoading=!1}}function si(){Fe&&Fe.close(),et&&cancelAnimationFrame(et),et=0,ri(),rn=void 0,v=!1,l.connecting=!0,Fe=new EventSource(M("/events")),Fe.addEventListener("open",()=>{v=!1,l.connected=!0,l.connecting=!1}),Fe.addEventListener("error",()=>{No(),l.connected=!1,l.connecting=!1}),Fe.addEventListener("sync",s=>{if(!v){v=!0,dc(s.data);return}dh(s.data)}),Fe.addEventListener("delta",s=>{No(),fh(s.data)}),Fe.addEventListener("terminal.output",s=>{try{No(),bh(JSON.parse(s.data))}catch{}}),Fe.addEventListener("client.version",s=>{try{ac(JSON.parse(s.data))}catch{}}),Fe.addEventListener("client.reload",s=>{try{lh(JSON.parse(s.data))}catch{}}),Fe.addEventListener("runtime.context",s=>{try{cc(JSON.parse(s.data))}catch(i){l.runtimeContextError=i.message||String(i)}}),Fe.addEventListener("runtime.context.error",s=>{try{const i=JSON.parse(s.data);l.runtimeContextError=i.message||"运行上下文同步失败"}catch{l.runtimeContextError="运行上下文同步失败"}})}function ac(s){if(Number(s==null?void 0:s.protocolVersion)!==1)return;l.coreVersion=String(s.coreVersion||"");const i=String(s.revision||"").trim();if(!i)return;const g=localStorage.getItem(ja);localStorage.setItem(ja,i),g&&g!==i&&lc({...s,requestId:`revision:${i}`,clearCache:!0})}async function lh(s){if(Number(s==null?void 0:s.protocolVersion)!==1)return;const i=String(s.requestId||"").trim();if(!i||sessionStorage.getItem(Hd)===i)return;sessionStorage.setItem(Hd,i);const g=String(s.revision||"").trim();g&&localStorage.setItem(ja,g),l.coreVersion=String(s.coreVersion||l.coreVersion||""),await lc(s)}async function lc(s){if(K)return;K=!0,s.clearCache!==!1&&await ch();const i=new URL(window.location.href);i.searchParams.set(Wa,String(s.requestId||s.revision||Date.now())),window.location.replace(i.href)}async function ch(){const s=[];"caches"in window&&s.push(caches.keys().then(i=>Promise.all(i.map(g=>caches.delete(g))))),"serviceWorker"in navigator&&s.push(navigator.serviceWorker.getRegistrations().then(i=>Promise.all(i.map(g=>g.unregister())))),await Promise.allSettled(s)}function uh(){const s=new URL(window.location.href);s.searchParams.has(Wa)&&(s.searchParams.delete(Wa),window.history.replaceState(window.history.state,"",s.href))}function bs(){$&&clearTimeout($),l.coreEasterEgg=!1,requestAnimationFrame(()=>{l.coreEasterEgg=!0,$=setTimeout(()=>{l.coreEasterEgg=!1},1300)})}function cc(s){var b,E;if(![1,2].includes(Number(s==null?void 0:s.protocolVersion)))throw new Error(`不支持的运行上下文协议版本:${(s==null?void 0:s.protocolVersion)??"未知"}`);const i=Number(s.revision||0),g=Number(((b=l.runtimeContext)==null?void 0:b.revision)||0);(!s.sessionId||!((E=l.runtimeContext)!=null&&E.sessionId)||s.sessionId===l.runtimeContext.sessionId)&&i<g||(l.runtimeContext=s,l.projectContextDocument&&!Gs.value.some(I=>I.path===l.projectContextDocument.path)&&(l.projectContextDocument=void 0),l.projectContextOpen&&Gs.value.length===0&&(l.projectContextOpen=!1,document.body.classList.remove("runtime-context-open")),l.runtimeContextLoading=!1,l.runtimeContextError="")}function dh(s){rn=s,!et&&(et=requestAnimationFrame(()=>{et=0,uc()}))}function No(){et&&cancelAnimationFrame(et),et=0,uc()}function uc(){const s=rn;rn=void 0,s&&dc(s)}function dc(s){try{gc(JSON.parse(s))}catch(i){we(`运行状态同步失败:${i.message||i}`)}}function fh(s){try{mh(JSON.parse(s))}catch(i){we(`流式增量同步失败:${i.message||i}`),ms()}}function gh(s,i){const g=String(i||"");if(!g)return;const h=String(s);ae.set(h,`${ae.get(h)||""}${g}`),fc()}function fc(){vt||(vt=requestAnimationFrame(hh))}function hh(){vt=0;const s=ha(),i=[...ae];ae.clear();for(const[g,h]of i){const b=l.lines.findIndex(I=>String(I.id)===g);if(b<0)continue;const E=l.lines[b];l.lines[b]={...E,text:`${E.text||""}${h}`}}s&&ya(),ae.size&&fc()}function ph(s){const i=String(s),g=ae.get(i);if(!g)return;ae.delete(i);const h=l.lines.findIndex(E=>String(E.id)===i);if(h<0)return;const b=l.lines[h];l.lines[h]={...b,text:`${b.text||""}${g}`}}function ri(){vt&&cancelAnimationFrame(vt),vt=0,ae.clear()}function mh(s){const i=String(s.sessionId||"");if(u&&i&&i!==u&&!d){Gc();return}const g=ha();for(const h of s.operations||[]){if(h.type==="line.append"){l.lines.some(E=>{var I;return String(E.id)===String((I=h.line)==null?void 0:I.id)})||l.lines.push(h.line);continue}const b=l.lines.findIndex(E=>String(E.id)===String(h.id));if(b<0)throw new Error(`找不到增量消息行 ${h.id}`);if(l.lines[b],h.type==="line.text.append")gh(h.id,h.text);else if(h.type==="line.patch"){ph(h.id);const E=l.lines[b];l.lines[b]={...E,...h.patch||{}}}}s.status&&(l.status=s.status),Go(),l.connected=!0,l.connecting=!1,g&&ya()}function bh(s){var i,g;for(const h of(s==null?void 0:s.updates)||[]){const b=String((h==null?void 0:h.sessionId)||"");if(!b||h.ownerSessionId!==((i=l.session)==null?void 0:i.sessionId)||h.invalidated===!0)continue;const E=l.backgroundTasks.findIndex(cn=>String((cn==null?void 0:cn.sessionId)||"")===b);if(E<0)continue;const I=String(h.text||"");if(!I)continue;const G=l.backgroundTasks[E],re=String(G.output||""),le=Number(G.outputEnd??re.length),Se=Number(h.outputStart??le),ze=Number(h.outputEnd??Se+I.length),Dt=Se===le?yh(re,I,jd):I.slice(-jd);l.backgroundTasks[E]={...G,output:Dt,outputEnd:ze},String(((g=l.backgroundTaskDetail)==null?void 0:g.sessionId)||"")===b&&(l.backgroundTaskDetail={...l.backgroundTaskDetail,output:Dt,outputEnd:ze})}}function yh(s,i,g){const h=`${s}${i}`;return h.length<=g?h:h.slice(-g)}function gc(s){var b,E,I,G;ri();const i=String(((b=s.session)==null?void 0:b.sessionId)||""),g=String(((E=l.session)==null?void 0:E.sessionId)||"");if(i&&i!==g&&_s(),u&&i&&i!==u&&!d){Gc();return}const h=ha();if(i!==g&&(ba(),l.messageImagePreviews=l.messageImagePreviews.filter(re=>re.sessionId===i),l.attachmentCounter=0),l.lines=s.lines||[],l.toolDetailLineId!==void 0&&!l.lines.some(re=>String(re.id)===String(l.toolDetailLineId))&&_s(),l.compactionDetailLineId!==void 0&&!l.lines.some(re=>String(re.id)===String(l.compactionDetailLineId))&&li(),om(l.lines),ap(l.lines),l.status=s.status||l.status,Go(),l.busy=!!s.busy,l.queuedInput=s.queuedInput,l.backgroundTaskCount=s.backgroundTaskCount||0,l.backgroundTasks=s.backgroundTasks||[],l.agentTaskHistory=s.agentTaskHistory||[],l.terminalTaskHistory=s.terminalTaskHistory||[],l.backgroundTaskDetail){const re=Sn.value.find(le=>Qn(le)===Qn(l.backgroundTaskDetail));re?l.backgroundTaskDetail={...re}:l.backgroundTaskDetail.kind==="terminal"&&l.backgroundTaskDetail.ownerSessionId===((I=s.session)==null?void 0:I.sessionId)?l.backgroundTaskDetail={...l.backgroundTaskDetail,status:"unknown",outputAvailability:"unavailable"}:pi()}if(l.backgroundSessionRunCount=s.backgroundSessionRunCount||0,l.runningSessionIds=s.runningSessionIds||[],l.session=s.session,l.modelSettings=s.modelSettings,l.cwd=s.cwd||"",l.fastModeMutating||(l.fastMode=s.fastMode===!0),l.appPrompt=s.appPrompt||{hasActivePrompt:!1,activePrompt:void 0},D(s.session,d),i&&i!==g&&Promise.all([Ro(),ni()]),l.sessionResumeLoading){const re=((G=s.session)==null?void 0:G.sessionId)||"";l.pendingResumeSessionId&&re===l.pendingResumeSessionId&&(l.sessionResumeLoading=!1,l.pendingResumeSessionId="")}s.catalog&&(l.catalog=s.catalog),s.interactive&&(l.interactive=s.interactive),s.tips&&(l.tips=s.tips),s.tipIndex!==void 0&&l.tipIndex===0&&(l.tipIndex=s.tipIndex),l.connected=!0,l.connecting=!1,cp(l.backgroundTasks),Cm(),h&&ya()}function qs(s,i=l.selectedPromptId){const g=(s||[]).map(_).filter(Boolean);l.promptLibrary=g;const h=g.find(b=>b.id===i)||g[0]||null;l.selectedPromptId=(h==null?void 0:h.id)||"",Zs(h||y())}function Zs(s){pe.id=(s==null?void 0:s.id)||"",pe.title=(s==null?void 0:s.title)||"",pe.content=(s==null?void 0:s.content)||"",pe.usage=(s==null?void 0:s.usage)||""}function Oo(s){l.activePanel="prompts",l.promptManagerOpen=!0,s&&(l.selectedPromptId=s);const i=l.promptLibrary.find(g=>g.id===l.selectedPromptId)||l.promptLibrary[0]||y();l.selectedPromptId=i.id||"",Zs(i)}function kh(s){l.selectedPromptId=s.id,Oo(s.id)}function _h(){l.selectedPromptId="",Zs(y()),l.activePanel="prompts",l.promptManagerOpen=!0}function wh(s){l.selectedPromptId=s.id,Zs(s)}async function vh(){const s=_({id:pe.id||A(),title:pe.title,content:pe.content,usage:pe.usage});if(!s){we("标题和内容不能为空");return}try{const i=await Ve("/api/prompt-library",{item:s});qs(i.items,s.id)}catch(i){we(i.message||String(i));return}we("已保存提示词")}async function xh(){var h;const s=String(pe.id||"").trim();if(!s){Zs(y());return}const i=l.promptLibrary.find(b=>b.id===s);if(!(!i||!await Ys({title:"删除提示词?",message:`“${i.title}”删除后无法恢复。`,confirmLabel:"确认删除",tone:"danger"}))){try{const b=await Ve("/api/prompt-library/delete",{id:s});qs(b.items)}catch(b){we(b.message||String(b));return}((h=Wn.value)==null?void 0:h.id)===i.id&&hc({confirm:!1}),we("已删除提示词")}}async function Qs(s){const i=_(s);if(!i){we("提示词无效");return}const g=Wn.value;if(g&&(g.id!==i.id||String(g.content||"").trim()!==i.content)){const b=g.id===i.id;if(!await Ys({title:b?"更新当前提示词?":"切换当前提示词?",message:b?`“${i.title}”的内容已经变化。重新应用会影响模型对后续问题的理解和回答方式。`:`将从“${g.title||g.id||"当前提示词"}”切换为“${i.title}”。提示词变化会影响模型对后续问题的理解和回答方式。`,confirmLabel:b?"确认更新":"确认切换"}))return}try{const b=await Ve("/api/app-prompt",{id:i.id,title:i.title,usage:i.usage,source:"sidebar-library",content:i.content});(b==null?void 0:b.ok)!==!1&&(l.appPrompt=b.appPrompt||{hasActivePrompt:!0,activePrompt:i},we(`已应用:${i.title}`))}catch(b){xt(b,"应用提示词失败")}}async function hc(s={}){if(Wn.value&&!(s.confirm!==!1&&!await Ys({title:"清除当前提示词?",message:"清除后,模型将不再遵循当前应用提示词,这会改变它对后续问题的理解和回答方式。",confirmLabel:"确认清除",tone:"danger"})))try{const i=await Ve("/api/app-prompt",{clear:!0});(i==null?void 0:i.ok)!==!1&&(l.appPrompt=i.appPrompt||{hasActivePrompt:!1,activePrompt:void 0},we("已清空应用提示词"))}catch(i){xt(i,"清空提示词失败")}}function Ys(s){return J&&ys(!1),Object.assign(l.confirmDialog,{open:!0,title:String((s==null?void 0:s.title)||"请确认"),message:String((s==null?void 0:s.message)||""),confirmLabel:String((s==null?void 0:s.confirmLabel)||"确认"),cancelLabel:String((s==null?void 0:s.cancelLabel)||"取消"),tone:(s==null?void 0:s.tone)==="danger"?"danger":"warning"}),new Promise(i=>{J=i})}function ys(s){const i=J;J=void 0,l.confirmDialog.open=!1,i==null||i(s===!0)}function Sh(s,i){Ce.value=i.id,s!=null&&s.dataTransfer&&(s.dataTransfer.effectAllowed="copy",s.dataTransfer.setData("application/x-neoctl-prompt-id",i.id),s.dataTransfer.setData("text/plain",i.title))}function Eh(s){var h;const i=Array.from(((h=s==null?void 0:s.dataTransfer)==null?void 0:h.types)||[]),g=Ch(s);!i.includes("application/x-neoctl-prompt-id")&&!g||(s.preventDefault(),l.composerDropActive=!0,l.composerDropMode=g?"files":"prompt",s.dataTransfer&&(s.dataTransfer.dropEffect="copy"))}function Th(s){s!=null&&s.currentTarget&&(s!=null&&s.relatedTarget)&&s.currentTarget.contains(s.relatedTarget)||(l.composerDropActive=!1,l.composerDropMode="prompt")}async function Ah(s){var b,E;const i=Ih(s==null?void 0:s.dataTransfer);if(i.length){s.preventDefault(),l.composerDropActive=!1,l.composerDropMode="prompt",Ce.value="",await ru(i),(b=se.value)==null||b.focus();return}const g=((E=s==null?void 0:s.dataTransfer)==null?void 0:E.getData("application/x-neoctl-prompt-id"))||Ce.value;if(l.composerDropActive=!1,l.composerDropMode="prompt",!g)return;s.preventDefault();const h=l.promptLibrary.find(I=>I.id===g);if(Ce.value="",!h){we("未找到提示词");return}await Qs(h)}function Ch(s){var g,h;return Array.from(((g=s==null?void 0:s.dataTransfer)==null?void 0:g.types)||[]).includes("Files")?!0:Array.from(((h=s==null?void 0:s.dataTransfer)==null?void 0:h.items)||[]).some(b=>b.kind==="file")}function Ih(s){const i=Array.from((s==null?void 0:s.files)||[]);return i.length?i:Array.from((s==null?void 0:s.items)||[]).filter(g=>g.kind==="file").map(g=>g.getAsFile()).filter(Boolean)}function Mh(){Ce.value="",l.composerDropActive=!1,l.composerDropMode="prompt"}function Rh(s,i){Re.value=i.id,Je.value="",s!=null&&s.dataTransfer&&(s.dataTransfer.effectAllowed="move",s.dataTransfer.setData("application/x-neoctl-prompt-sort-id",i.id),s.dataTransfer.setData("text/plain",i.title))}function Nh(s,i){var b,E,I;const g=Re.value||((b=s==null?void 0:s.dataTransfer)==null?void 0:b.getData("application/x-neoctl-prompt-sort-id"));if(!g||g===i.id)return;s.preventDefault();const h=(I=(E=s.currentTarget)==null?void 0:E.getBoundingClientRect)==null?void 0:I.call(E);Je.value=i.id,Qe.value=h&&s.clientY>h.top+h.height/2?"after":"before",s.dataTransfer&&(s.dataTransfer.dropEffect="move")}async function Oh(s,i){var re;s.preventDefault();const g=((re=s==null?void 0:s.dataTransfer)==null?void 0:re.getData("application/x-neoctl-prompt-sort-id"))||Re.value,h=Qe.value;if(pc(),!g||g===i.id)return;const b=[...l.promptLibrary],E=b.findIndex(le=>le.id===g);if(E<0)return;const[I]=b.splice(E,1),G=b.findIndex(le=>le.id===i.id);if(!(G<0)){b.splice(G+(h==="after"?1:0),0,I),l.promptLibrary=b;try{const le=await Ve("/api/prompt-library/reorder",{ids:b.map(Se=>Se.id)});qs(le.items,l.selectedPromptId),we("提示词顺序已更新")}catch(le){await oc(),we(le.message||String(le))}}}function pc(){Re.value="",Je.value="",Qe.value="before"}async function mc(){const s=R.value;if(!s.trim()&&l.attachments.length===0)return;if(s.trim()==="/sessions"){R.value="",ar(),await ii();return}if(s.trim()==="/login"){R.value="",ar(),await Js();return}if(s.trim()==="/new"){R.value="",ar(),await oi();return}const i=[...l.attachments],g=i.filter(E=>E.kind==="image"),h=i.filter(E=>E.kind==="file"&&E.absolutePath),b=ou(s,g);au(g),R.value="",l.attachments=[],ar();try{const E=await fetch(M("/api/submit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:b,attachments:[...g,...h]})}),I=await E.json();if(!E.ok||I!=null&&I.error)throw new Error(I.error||`submit ${E.status}`)}catch(E){we(E.message||String(E))}}async function Lh(){if(!nc.value){l.queuedInput?await yc():await bc();return}const s=R.value,i=[...l.attachments],g=i.filter(E=>E.kind==="image"),h=i.filter(E=>E.kind==="file"&&E.absolutePath),b=ou(s,g);au(g),R.value="",l.attachments=[],ar();try{await Ve("/api/submit-now",{text:b,attachments:[...g,...h]})}catch(E){we(E.message||String(E))}}async function bc(){try{await Ve("/api/interrupt",{})}catch(s){xt(s,"停止回答失败")}}async function Ph(){try{const s=await Ve("/api/queue/cancel",{});we(s.cancelled?"已撤回排队消息":"没有待撤回的消息")}catch(s){xt(s,"撤回排队消息失败")}}async function yc(){try{const s=await Ve("/api/queue/send-now",{});we(s.interrupted?"已打断并发送排队消息":"已发送排队消息")}catch(s){xt(s,"发送排队消息失败")}}async function kc(){try{await Ve("/api/submit",{text:"/compact",attachments:[]}),we("压缩会话将在下一轮生效")}catch(s){xt(s,"压缩上下文失败")}}function _c(){l.contextWindowDraft=Vg.value,l.contextWindowError="",l.contextWindowModalOpen=!0,document.body.classList.add("context-window-open")}function Lo(){l.contextWindowSaving||(l.contextWindowModalOpen=!1,l.contextWindowError="",document.body.classList.remove("context-window-open"))}function $h(){l.contextWindowError=""}async function Dh(){var i;const s=String(l.contextWindowDraft||"");if(!/^\d+$/.test(s)||s==="0"){l.contextWindowError="请输入大于 0 的整数";return}l.contextWindowSaving=!0,l.contextWindowError="";try{const g=await Ve("/api/context-window",{value:s}),h=((i=l.status)==null?void 0:i.metrics)||{},b=Number(g.contextWindowTokens),E=Number(h.estimatedInputTokens||0);l.status={...l.status,metrics:{...h,contextWindowTokens:b,contextWindowSource:"session",contextUsageRatio:b>0?E/b:void 0}},Go(),l.contextWindowModalOpen=!1,document.body.classList.remove("context-window-open")}catch(g){l.contextWindowError=an(g,"调整失败")}finally{l.contextWindowSaving=!1}}function wc(){const s=!l.fastMode,i=++B;l.fastMode=s,l.fastModeMutating=!0,W=W.catch(()=>{}).then(()=>Ve("/api/fast-mode",{enabled:s})).then(g=>{i===B&&(l.fastMode=g.fastMode===!0,l.fastModeMutating=!1,we(l.fastMode?"快速模式已为当前会话启动":"快速模式已关闭"))}).catch(async g=>{i===B&&(l.fastModeMutating=!1,await ms(),xt(g,"快速模式切换失败"))})}async function ii(){l.activePanel="sessions",l.sessionsLoading=!0;try{const s=await fetch(M("/api/sessions")),i=await s.json().catch(()=>({}));if(!s.ok||i!=null&&i.error||(i==null?void 0:i.ok)===!1)throw Xs(i,s.status);l.sessions=i.sessions||[],l.runningSessionIds=i.runningSessionIds||[]}catch(s){xt(s,"加载会话失败")}finally{l.sessionsLoading=!1}}async function Bh(s){const i=c,g=u;if(l.pendingResumeSessionId=s,l.sessionResumeLoading=!0,await Vc(s))l.activePanel="chat",we("已打开会话");else{const b=await qc(i,g);we(b?"打开会话失败,已恢复原会话":"打开会话失败,运行时连接已断开")}l.sessionResumeLoading=!1,l.pendingResumeSessionId=""}async function Po(){try{const s=await fetch(M("/api/cpa-quota"));if(!s.ok)throw new Error(`cpa-quota ${s.status}`);const i=await s.json();l.cpaQuotas=Array.isArray(i==null?void 0:i.quotas)?i.quotas:[],l.cpaQuotaIndex>=l.cpaQuotas.length&&(l.cpaQuotaIndex=0),i!=null&&i.config&&(l.cpaConfig.loaded||(l.cpaConfig.url=String(i.config.url||""),l.cpaConfig.password=i.config.hasPassword?Fi:"",l.cpaConfig.loaded=!0),l.cpaConfig.hasPassword=!!i.config.hasPassword)}catch{l.cpaQuotas=[],l.cpaQuotaIndex=0}}async function vc(){try{const s=await fetch(M("/api/memory"));if(!s.ok)throw new Error(`memory ${s.status}`);const i=await s.json();l.memory={current:(i==null?void 0:i.current)||null,history:Array.isArray(i==null?void 0:i.history)?i.history:[],sampleMs:Number(i==null?void 0:i.sampleMs)||6e4,retentionMs:Number(i==null?void 0:i.retentionMs)||864e5}}catch{}}async function oi(){const s=c,i=u;if(sa(),c=O(),u="",d=!0,sessionStorage.setItem(zi,c),sessionStorage.removeItem(As),l.sessionResumeLoading=!0,l.pendingResumeSessionId="",await ms({silent:!0}))l.activePanel="chat",we("已创建新会话"),si();else{const h=await qc(s,i);we(h?"新建会话失败,已恢复原会话":"新建会话失败,运行时连接已断开")}l.sessionResumeLoading=!1}function $o(s){var i;return!!s&&String(((i=l.session)==null?void 0:i.sessionId)||"")===String(s)}function Do(s){return l.runningSessionIds.includes(s)}async function Uh(s){const i=l.sessions.find(h=>h.sessionId===s);if($o(s)){we(a.SESSION_ACTIVE);return}if(Do(s)){we(a.SESSION_RUNNING);return}if(await Ys({title:"删除会话?",message:`“${(i==null?void 0:i.title)||s||"这个会话"}”删除后无法恢复。`,confirmLabel:"确认删除",tone:"danger"}))try{await Ve("/api/sessions/delete",{sessionId:s}),await ii(),we("会话已删除")}catch(h){xt(h,"删除会话失败")}}async function Js(s){l.activePanel="settings";const i=s?`?provider=${encodeURIComponent(s)}`:"";try{const g=await fetch(M(`/api/login${i}`)),h=await g.json().catch(()=>({}));if(!g.ok||h!=null&&h.error||(h==null?void 0:h.ok)===!1)throw Xs(h,g.status);l.login=h,q.value=h.provider,Object.keys(fe).forEach(b=>delete fe[b]),Object.assign(fe,h.values||{}),await Promise.all([Po(),ih(),nh()])}catch(g){xt(g,"加载模型配置失败")}}async function Fh(){await Js(q.value)}async function xc(){var h;const[s,i]=await Promise.allSettled([Ve("/api/login",{provider:q.value,values:{...fe}}),Ve("/api/cpa-config",{url:l.cpaConfig.url,password:l.cpaConfig.password===Fi?"":l.cpaConfig.password,preservePassword:l.cpaConfig.hasPassword&&(!l.cpaConfig.password||l.cpaConfig.password===Fi)})]);if(i.status==="fulfilled"){const b=i.value;l.cpaQuotas=Array.isArray(b==null?void 0:b.quotas)?b.quotas:[],l.cpaQuotaIndex=0,l.cpaConfig.loaded=!0,l.cpaConfig.hasPassword=!!((h=b==null?void 0:b.config)!=null&&h.hasPassword),l.cpaConfig.password=l.cpaConfig.hasPassword?Fi:""}if(s.status==="fulfilled"&&i.status==="fulfilled"){we("模型配置已保存");return}const g=[];s.status==="rejected"&&g.push(an(s.reason,"模型配置保存失败")),i.status==="rejected"&&g.push(an(i.reason,"CPA 配置保存失败")),we(g.join(";"))}function Bo(s){const i=Number.parseFloat(String(s??"").replace("%",""));return Number.isFinite(i)?Math.max(0,Math.min(100,i)):0}function Uo(s){const i=Number.parseFloat(String(s??"").replace("%",""));if(!Number.isFinite(i))return"—";const g=Bo(i);return`${g.toFixed(g%1?1:0)}%`}function Fo(s){const i=new Date(s);return Number.isNaN(i.getTime())?"—":new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(i)}function Sc(s){const i=new Date(s);return Number.isNaN(i.getTime())?"—":new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(i)}function Ec(s){const i=l.cpaQuotas.length;i<2||(l.cpaQuotaIndex=(l.cpaQuotaIndex+s+i)%i)}function zh(s){const i=String(s||"").trim();if(!i)return"Codex 凭据";const[g,h]=i.split("@");return!h||g.length<=3?i:`${g.slice(0,3)}***@${h}`}function Gn(s){const i=Number(s);if(!Number.isFinite(i)||i<0)return"—";const g=i/1024/1024;return`${g.toFixed(g>=100?0:1)} MB`}function Hh(s){const i=new Date(s);return Number.isNaN(i.getTime())?"等待采样":new Intl.DateTimeFormat("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(i)}function jh(s){const i=new Date(s);return Number.isNaN(i.getTime())?"—":new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(i)}function Wh(s){const i=ei.value.length;if(!i)return;const g=s.currentTarget.getBoundingClientRect(),h=Math.min(1,Math.max(0,(s.clientX-g.left)/Math.max(1,g.width)));Xe.value=i===1?0:Math.round(h*(i-1))}function Tc(){Xe.value=-1}async function Ve(s,i){const g=await fetch(M(s),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),h=await g.json().catch(()=>({}));if(!g.ok||h!=null&&h.error||(h==null?void 0:h.ok)===!1)throw Xs(h,g.status);return h}class Kh extends Error{constructor(i,g=""){super(i),this.name="ActionRequestError",this.code=g}}function Xs(s,i){const g=String((s==null?void 0:s.errorCode)||(i===404?"API_NOT_FOUND":""));return new Kh((s==null?void 0:s.error)||`请求失败(${i})`,g)}function an(s,i="操作失败"){const g=String((s==null?void 0:s.code)||"");if(g&&a[g])return a[g];const h=String((s==null?void 0:s.message)||s||"").trim();return h?`${i}:${h}`:i}function xt(s,i){we(an(s,i))}function Vn(s){const i=im(rm(sm(s.text||"")));return s.kind==="system"||s.kind==="meta"?Gh(i):i}function Gh(s){return String(s||"").replace(/^Interactive web UI enabled\.\s*Type \/help for commands\.\s*/i,"工作台已连接。输入 `/help` 可查看命令说明。").replace(/\bSession:\s*/gi,"会话:").replace(/\bTip:\s*/gi,"提示:").replace(/Start fresh/gi,"重新开始").replace(/\/reset clears the visible conversation and adds a reset marker so you can start a fresh thread in the same session\./gi,"`/reset` 会清空当前可见对话,并插入一个重置标记,方便你在同一会话中重新开始。").replace(/^new session\s+/i,"已新建会话:").replace(/^deleted session\s+/i,"已删除会话:").replace(/^resumed session\s+(.+?):\s+(\d+)\s+messages?\s+from\s+(.+)$/i,"已恢复会话:$1,共载入 $2 条消息,来源:$3").replace(/\((\d+)\s+resumed messages\)/gi,"(已恢复 $1 条消息)").replace(/\bType \/help for commands\./gi,"输入 `/help` 可查看命令说明。")}function qn(s){var i;if(s.kind==="tool"||s.toolName){const g=Zn(s);return(i=s==null?void 0:s.toolPresentation)!=null&&i.label?String(s.toolPresentation.label):er(s)?"任务计划":s.title?n[s.title]||n[String(s.title).toLowerCase()]||s.title:n[g]||g}return s.title?n[s.title]||n[String(s.title).toLowerCase()]||s.title:s.kind==="assistant"?"助手":s.kind==="user"?"你":s.kind==="thinking"?"思考":"系统"}function Zn(s){return String((s==null?void 0:s.toolName)||"tool").trim()||"tool"}function er(s){return(s==null?void 0:s.kind)==="tool"&&Zn(s)==="plan_update"}function Vh(s){return er(s)||$t(s)||ws(s).length>0}function qh(s){return(s==null?void 0:s.kind)==="meta"&&String((s==null?void 0:s.title)||"")==="提示词用法"}function ai(s){return!!(s!=null&&s.compaction&&typeof s.compaction=="object")}function Zh(s){var i;return(i=s==null?void 0:s.compaction)!=null&&i.modelDriven?"模型生成摘要":"确定性摘要"}function li(){l.compactionDetailLineId=void 0,!l.runtimeContextModal&&!l.runtimeContextDetail&&!l.projectContextOpen&&document.body.classList.remove("runtime-context-open")}function tr(s){return((s==null?void 0:s.kind)==="tool"||(s==null?void 0:s.kind)==="error"&&(s==null?void 0:s.toolName))&&!Vh(s)}function zo(s){return(s==null?void 0:s.kind)==="tool-group"&&Array.isArray(s.lines)}function Qh(s){return!s||s.presentationLevel==="primary"||s.kind==="user"||s.kind==="assistant"?!0:$t(s)}function Yh(s){return!s||Qh(s)?!1:["thinking","tool","error","meta","system","agent"].includes(String(s.kind||"system"))}function Jh(s){const i=[];let g=[];const h=()=>{if(!g.length)return;const b=g.some(E=>(E==null?void 0:E.kind)!=="thinking");g.length===1||!b?i.push(...g):i.push({id:`tool-group:${g[0].id}`,kind:"tool-group",lines:g,live:g.some(E=>(E==null?void 0:E.live)===!0)}),g=[]};for(const b of s||[])Yh(b)?g.push(b):(h(),i.push(b));return h(),i}function ks(s){return l.expandedToolGroups[s==null?void 0:s.id]===!0}async function Xh(s){zo(s)&&(l.expandedToolGroups[s.id]=!ks(s),await kt(),ba())}function Ac(s){const i=new Map;for(const h of(s==null?void 0:s.lines)||[]){const b=(h==null?void 0:h.kind)==="thinking"?"思考":qn(h);b&&i.set(b,(i.get(b)||0)+1)}const g=[...i.entries()].map(([h,b])=>({name:h,count:b}));return g.length?g:[{name:"过程",count:1}]}function Ho(s){return((s==null?void 0:s.lines)||[]).flatMap((i,g)=>{var b;const h=String(((b=i==null?void 0:i.toolDisplay)==null?void 0:b.purpose)||"").trim();return h?[{id:`${i.id}:purpose:${g}`,text:h,live:(i==null?void 0:i.live)===!0}]:[]})}let Cc;function Ic(s,i){Cn(s)&&(Cc=document.activeElement,l.toolDetailLineId=s.id,document.body.classList.add("tool-detail-open"),kt(()=>{var g;return(g=document.querySelector(".tool-result-modal-close"))==null?void 0:g.focus()}))}function ep(s){return vs(Ie.parse(String(s??"")))}function _s(){l.toolDetailLineId=void 0,document.body.classList.remove("tool-detail-open");const s=Cc;kt(()=>{s!=null&&s.isConnected&&s.focus()})}function tp(s){if(s.key!=="Tab")return;const i=Array.from(s.currentTarget.querySelectorAll('button:not(:disabled), [tabindex="0"]')),g=i[0],h=i.at(-1);s.shiftKey&&document.activeElement===g?(s.preventDefault(),h==null||h.focus()):!s.shiftKey&&document.activeElement===h&&(s.preventDefault(),g==null||g.focus())}function Mc(s){var h;const i=s.target instanceof HTMLImageElement?s.target:null;if(!i||i.closest(".image-preview-modal"))return;const g=((h=i.closest("[data-preview-src]"))==null?void 0:h.dataset.previewSrc)||i.currentSrc||i.src;g&&(s.preventDefault(),s.stopPropagation(),np(g,i.alt))}async function Rc(s){const i=s.target instanceof Element?s.target.closest('a[data-resource-download="true"]'):null;if(!(i instanceof HTMLAnchorElement))return;s.preventDefault(),s.stopPropagation();const g=Number(i.dataset.resourceExpiresAt);if(Number.isFinite(g)&&g>0&&Date.now()>=g){we("下载链接已过期,请重新生成");return}try{const h=await fetch(i.href);if(!h.ok){we(h.status===404||h.status===410?"下载链接已过期,请重新生成":`下载失败(${h.status})`);return}const b=URL.createObjectURL(await h.blob()),E=document.createElement("a");E.href=b,E.download=i.download||"download",document.body.appendChild(E),E.click(),E.remove(),setTimeout(()=>URL.revokeObjectURL(b),3e4)}catch{we("下载失败,请稍后重试")}}function np(s,i=""){l.imagePreview={src:String(s||""),caption:String(i||"").trim()},document.body.classList.add("image-preview-open")}function jo(){l.imagePreview=void 0,document.body.classList.remove("image-preview-open")}function En(s){return _v(s)}function Nc(s){return rp(s).summary}function Oc(s){var i;return(((i=s==null?void 0:s.toolDisplay)==null?void 0:i.previews)||[]).filter(g=>g.content!==void 0&&g.content!==null&&String(g.content).trim()!=="")}function Tn(s){var i;return Array.isArray((i=s==null?void 0:s.toolStream)==null?void 0:i.steps)?s.toolStream.steps:[]}function An(s){return Zn(s)==="subagent_run"}function ci(s){return["file_write","file_edit","write_file","edit_file"].includes(Zn(s).toLowerCase())}function Wo(s){const i=Zn(s).toLowerCase();return i==="terminal_run"||i==="terminal_control"}function Lc(s){var i;return Array.isArray((i=s==null?void 0:s.toolDisplay)==null?void 0:i.previews)&&s.toolDisplay.previews.length>0&&(!Zn(s).startsWith("subagent_")||Zn(s)==="subagent_message")&&!(Wo(s)&&(s==null?void 0:s.live)===!0&&sp(s))}function nr(s){var E,I,G,re;const i=Array.isArray((E=s==null?void 0:s.toolStream)==null?void 0:E.chunks)?s.toolStream.chunks:[];if(i.length)return i.map(le=>String((le==null?void 0:le.text)||"")).join("").trimEnd();const g=String(((I=s==null?void 0:s.toolStream)==null?void 0:I.stdout)||""),h=String(((G=s==null?void 0:s.toolStream)==null?void 0:G.stderr)||""),b=String(((re=s==null?void 0:s.toolStream)==null?void 0:re.output)||"");return[g,h,b].filter(Boolean).join(`
|
|
112
|
-
`).trimEnd()}function sr(s){var h,b,E;const i=String(((h=s==null?void 0:s.toolStream)==null?void 0:h.message)||"").trim(),g=String(((b=s==null?void 0:s.toolDisplay)==null?void 0:b.purpose)||((E=s==null?void 0:s.toolDisplay)==null?void 0:E.subject)||"").trim();return i&&i!==g?i:""}function Pc(s){return Tn(s).map(i=>`${(i==null?void 0:i.status)==="completed"?"✓":(i==null?void 0:i.status)==="failed"?"×":"•"} ${String((i==null?void 0:i.message)||"").trim()}${(i==null?void 0:i.status)==="unknown"||!(s!=null&&s.live)&&(i==null?void 0:i.status)==="running"?"(阶段结果未提供)":""}`.trimEnd()).join(`
|
|
113
|
-
`)}function ui(s){const i=new Map;for(const g of Tn(s)){const h=String((g==null?void 0:g.toolName)||"").trim();if(!h)continue;const b=i.get(h);i.set(h,{label:(b==null?void 0:b.label)||String((g==null?void 0:g.toolLabel)||h),count:((b==null?void 0:b.count)||0)+1})}return[...i.entries()].map(([g,h])=>({name:g,label:h.label,count:h.count}))}function $c(s){return Tn(s).flatMap((i,g)=>{const h=String((i==null?void 0:i.message)||"").trim();return h?[{key:`${i.key}:${g}`,purpose:h}]:[]})}function di(s){return l.expandedToolGroups[`agent:${s==null?void 0:s.id}`]===!0}async function Dc(s){const i=`agent:${s==null?void 0:s.id}`;l.expandedToolGroups[i]=!l.expandedToolGroups[i],await kt(),ba()}function sp(s){return!!(sr(s)||Tn(s).length||nr(s))}function fi(s){var b,E,I;const i=Number((b=s==null?void 0:s.toolStream)==null?void 0:b.current),g=Number((E=s==null?void 0:s.toolStream)==null?void 0:E.total);if(!Number.isFinite(i))return"";const h=String(((I=s==null?void 0:s.toolStream)==null?void 0:I.unit)||"").trim();return Number.isFinite(g)&&g>0?`${i}/${g}${h?` ${h}`:""}`:`${i}${h?` ${h}`:""}`}function rp(s){const i=(s==null?void 0:s.live)===!0,g=(s==null?void 0:s.titleStatus)==="failure"||(s==null?void 0:s.kind)==="error",h=i?{key:"running",label:"运行中"}:g?{key:"failed",label:"失败"}:{key:"completed",label:"成功"},b=s!=null&&s.toolDisplay&&typeof s.toolDisplay=="object"?s.toolDisplay:void 0,E=String((b==null?void 0:b.purpose)||(b==null?void 0:b.subject)||(s==null?void 0:s.bodyTitle)||"").trim();return{status:h,summary:E}}function ip(s,i){const g=String(s||"").replace(/\s+/g," ").trim();return g.length>i?`${g.slice(0,i)}…`:g}function $t(s){return(s==null?void 0:s.kind)==="tool"&&String((s==null?void 0:s.toolName)||"").toLowerCase()==="image_create"}function Ko(s){return(s==null?void 0:s.live)&&$t(s)}function Bc(s){return $t(s)&&(s==null?void 0:s.pendingReplacement)===!0}function op(s){var g,h;if(Si(s)&&!$t(s)||((g=s==null?void 0:s.toolPresentation)==null?void 0:g.visibility)==="hidden"&&(s==null?void 0:s.kind)!=="error")return!0;if((s==null?void 0:s.kind)!=="user")return!1;const i=cu(s);return lm(i)?String((h=cm(i))==null?void 0:h.id)!==String(s==null?void 0:s.id):!Vn(s)&&vi(s).length===0&&wi(s==null?void 0:s.text).length===0}function ap(s){const i=new Set,g=Date.now();for(const h of s||[]){if(!Ko(h))continue;const b=String(h.id);i.add(b),l.liveToolStartedAt[b]||(l.liveToolStartedAt[b]=g)}for(const h of Object.keys(l.liveToolStartedAt))i.has(h)||delete l.liveToolStartedAt[h]}function rr(s){if(!Ko(s))return"";const i=l.liveToolStartedAt[String(s.id)];return i?Yn(l.clockTick-i):""}function Go(){var i,g,h,b,E,I,G,re,le;const s=(g=(i=l.status)==null?void 0:i.metrics)==null?void 0:g.contextUsageRatio;Vo("context",s===void 0?0:s*100),Vo("inputTokens",Number(((b=(h=l.status)==null?void 0:h.usage)==null?void 0:b.inputTokens)??((I=(E=l.status)==null?void 0:E.metrics)==null?void 0:I.estimatedInputTokens)??0)),Vo("outputTokens",Number(((re=(G=l.status)==null?void 0:G.usage)==null?void 0:re.outputTokens)??((le=l.status)==null?void 0:le.streamedOutputTokens)??0))}function Vo(s,i){const g=l.composerMetrics[s],h=Number.isFinite(i)?Math.max(0,i):0;if(!g.initialized){g.display=h,g.target=h,g.initialized=!0;return}Math.abs(g.target-h)<.001||(g.target=h,g.bump+=1,lp())}function lp(){if(j)return;const s=()=>{let i=!1;for(const g of Object.values(l.composerMetrics)){const h=g.target-g.display;if(Math.abs(h)<.01){g.display=g.target;continue}const b=Math.min(.42,Math.max(.14,Math.abs(h)>1e3?.32:.2)),E=Math.sin(Date.now()/90)*Math.min(Math.abs(h)*.018,g.target*.006+1);g.display+=h*b+E,g.display<0&&(g.display=0),i=!0}i?j=requestAnimationFrame(s):j=0};j=requestAnimationFrame(s)}function qo(s){return`bump-${l.composerMetrics[s].bump%2}`}function cp(s=[]){return new Map(s.map(i=>[String(i.taskId||i.agentId||i.description||i.type),i.status]))}function Qn(s){var g;const i=String((s==null?void 0:s.taskId)||(s==null?void 0:s.agentId)||(s==null?void 0:s.sessionId)||"");return(s==null?void 0:s.kind)==="terminal"?`${s.ownerSessionId||((g=l.session)==null?void 0:g.sessionId)||""}:${i}`:i}function gi(s){return String((s==null?void 0:s.description)||(s==null?void 0:s.command)||(s==null?void 0:s.type)||"后台任务").replace(/\s+/g," ").trim()||"后台任务"}function ir(s){const i=gi(s);return i.length>72?`${i.slice(0,72)}…`:i}function Uc(s){if((s==null?void 0:s.kind)==="terminal")return s.status!=="running"?Number.isFinite(s.durationMs)&&s.durationMs>=0?Yn(s.durationMs):"":Number.isFinite(s.createdAt)&&s.createdAt<=l.clockTick?Yn(l.clockTick-s.createdAt):"";if((s==null?void 0:s.kind)==="agent"){const b=kv(s,l.clockTick);return b===void 0?"":Yn(b)}const i=s==null?void 0:s.createdAt,g=Number(i),h=Number.isFinite(g)&&g>0?g:Date.parse(String(i||""));return!Number.isFinite(h)||h<=0?"":Yn((s!=null&&s.completedAt?Date.parse(s.completedAt):l.clockTick)-h)}function Fc(s){return String((s==null?void 0:s.prompt)||(s==null?void 0:s.command)||"").trim()}function hi(s){l.backgroundTaskDetail={...s},document.body.classList.add("tool-detail-open")}function pi(){l.backgroundTaskDetail=void 0,document.body.classList.remove("tool-detail-open")}function up(s="ready"){return{ready:"就绪",running:"运行中",preparing:"准备中",calling_model:"调用模型",thinking:"推理中",running_tools:"调用工具",injecting_context:"注入上下文",compacting:"压缩上下文",stopped:"已停止",error:"出错"}[s]||s}function Zo(s){return{pending:"排队中",running:"运行中",completed:"已完成",failed:"失败",killed:"已停止",stopped:"已停止",exited:"已退出",lost:"已失联",unknown:"未提供"}[s]||(s?"未知状态":"未提供")}function Qo(s){return r[s]||s}function dp(s){return(s||[]).map(i=>({value:i,label:o[i]||i}))}function fp(s){return((s==null?void 0:s.options)||[]).map(i=>({value:i,label:i||"默认"}))}function gp(s){return!["ansi","plain","diff"].includes(s.format)&&["assistant","thinking","system","tool"].includes(s.kind)}function hp(s){return JSON.stringify((s==null?void 0:s.inputSchema)||{},null,2)}function zc(s){return s!=null&&s.cacheStable?"稳定缓存段":"动态段"}function Yo(s){l.runtimeContextModal=s,l.runtimeContextDetail=void 0,document.body.classList.add("runtime-context-open"),s==="plugins"&&Ro(),s==="tools"&&ni()}function Jo(){l.runtimeContextDetail=void 0,l.runtimeContextModal="",document.body.classList.remove("runtime-context-open")}function Xo(){l.runtimeContextDetail=void 0}function pp(){l.projectContextOpen=!0,l.projectContextDocument=void 0,document.body.classList.add("runtime-context-open")}function mp(s){l.projectContextDocument=s}function ea(){if(l.projectContextDocument){l.projectContextDocument=void 0;return}l.projectContextOpen=!1,document.body.classList.remove("runtime-context-open")}async function bp(){l.cwdPicker.open=!0,l.cwdPicker.input=l.cwd||"",l.cwdPicker.selectionExplicit=!1,l.cwdPicker.error="",document.body.classList.add("cwd-picker-lock"),await bi(l.cwd)}function mi(){l.cwdPicker.mutating||(l.cwdPicker.open=!1,l.cwdPicker.error="",document.body.classList.remove("cwd-picker-lock"))}async function bi(s=l.cwdPicker.input){l.cwdPicker.loading=!0,l.cwdPicker.error="";try{const i=new URL("/api/cwd",window.location.origin);String(s||"").trim()&&i.searchParams.set("path",String(s).trim());const g=await fetch(M(`${i.pathname}${i.search}`)),h=await g.json().catch(()=>({}));if(!g.ok||h!=null&&h.error||(h==null?void 0:h.ok)===!1)throw Xs(h,g.status);ta(h)}catch(i){l.cwdPicker.error=an(i,"无法打开路径")}finally{l.cwdPicker.loading=!1}}function yp(s){return String(s||"").replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean).at(-1)||String(s||"")}function ta(s){const i=String(s.cwd||""),g={name:yp(i),path:i};l.cwdPicker.cwd=i,l.cwdPicker.parent=s.parent||"",l.cwdPicker.home=s.home||"",l.cwdPicker.locations=Array.isArray(s.locations)?s.locations:l.cwdPicker.locations,l.cwdPicker.entries=Array.isArray(s.entries)?s.entries:[],l.cwdPicker.input=i,l.cwdPicker.selectedPath=s.fallback?"":i,l.cwdPicker.selectionExplicit=!1,l.cwdPicker.treeRoots=[g],l.cwdPicker.treeChildren={[i]:l.cwdPicker.entries},l.cwdPicker.treeExpanded={[i]:!0}}async function kp(s){const i=new URL("/api/cwd",window.location.origin);i.searchParams.set("path",s);const g=await fetch(M(`${i.pathname}${i.search}`)),h=await g.json().catch(()=>({}));if(!g.ok||h!=null&&h.error||(h==null?void 0:h.ok)===!1)throw Xs(h,g.status);return Array.isArray(h.locations)&&(l.cwdPicker.locations=h.locations),h}async function _p(s){const i=s.path;if(l.cwdPicker.treeExpanded[i]){l.cwdPicker.treeExpanded={...l.cwdPicker.treeExpanded,[i]:!1};return}l.cwdPicker.error="";try{if(!l.cwdPicker.treeChildren[i]){const g=await kp(i);l.cwdPicker.treeChildren={...l.cwdPicker.treeChildren,[i]:g.entries||[]}}l.cwdPicker.treeExpanded={...l.cwdPicker.treeExpanded,[i]:!0}}catch(g){l.cwdPicker.error=an(g,"无法展开路径")}}function wp(s){l.cwdPicker.selectedPath=s.path,l.cwdPicker.selectionExplicit=!0,l.cwdPicker.input=s.path}async function vp(){const s=String(l.cwdPicker.input||"").trim();if(s){l.cwdPicker.mutating=!0,l.cwdPicker.error="";try{const i=await Ve("/api/cwd/create",{path:s});ta(i)}catch(i){l.cwdPicker.error=an(i,"新建失败")}finally{l.cwdPicker.mutating=!1}}}async function xp(s){if(await Ys({title:"删除文件夹?",message:s.path,confirmLabel:"删除",tone:"danger"})){l.cwdPicker.mutating=!0;try{const g=await Ve("/api/cwd/delete",{path:s.path});ta(g)}catch(g){l.cwdPicker.error=an(g,"删除失败")}finally{l.cwdPicker.mutating=!1}}}async function Sp(){const s=String(l.cwdPicker.selectionExplicit?l.cwdPicker.selectedPath:l.cwdPicker.input).trim();if(s&&!(!l.cwdPicker.selectionExplicit&&s===l.cwdPicker.cwd&&s!==l.cwd)){l.cwdPicker.mutating=!0,l.cwdPicker.error="";try{const i=await Ve("/api/cwd/change",{path:s});l.cwd=i.cwd||s,l.cwdPicker.open=!1,document.body.classList.remove("cwd-picker-lock"),await ti(),we(i.unchanged?"工作目录未变":"工作目录已切换")}catch(i){l.cwdPicker.error=an(i,"切换失败")}finally{l.cwdPicker.mutating=!1}}}function Ep(s){l.runtimeContextDetail={kind:"prompt",title:s.name,meta:zc(s),content:s.content}}function Tp(){var s,i,g,h;l.runtimeContextDetail={kind:"prompt",title:"完整系统提示词",meta:`${ln(((i=(s=l.runtimeContext)==null?void 0:s.prompt)==null?void 0:i.chars)||0)} 字符`,content:((h=(g=l.runtimeContext)==null?void 0:g.prompt)==null?void 0:h.systemPrompt)||""}}function Ap(s){s&&(l.runtimeContextDetail={kind:"tool",title:s.name,meta:s.strict?"严格模式":"兼容模式",description:s.description||"",schema:hp(s)})}function yi(s){if(er(s))return Ip(s);if(Cn(s))return oa(s);if(ws(s).length)return Yc(s);if(Np(s))return $p(s);if(Op(s))return Lp(s);const i=Vn(s),g=Jc(s),h=g.map(G=>`${G.kind}:${G.reference||""}:${G.url}:${G.label||G.downloadName||""}:${G.expiresAt||""}`).join("|"),b=[s.id,s.kind,s.format,s.title,s.titleStatus,s.live?"1":"0",h,i].join(""),E=ee.get(b);if(E!==void 0)return E;let I;return s.format==="diff"?I=Kc(i):s.format==="ansi"||!gp(s)?I=ku(je(Ti(i))):I=Fp(vs(Ie.parse(i||""),g.map(Xc)),g),ee.set(b,I),I}function Cp(s){if(!s)return"";if($t(s))return Vp(s);const i=Vn(s);if(s.format==="diff"||/(?:^|\n)---\s+.+\n\+\+\+\s+/.test(i))return Kc(i);if(s.format==="ansi")return`<pre class="tool-detail-pre">${je(Ti(i))}</pre>`;const g=ia(i);if(g){const h=JSON.stringify(g,null,2);return vs(Ie.parse(`\`\`\`json
|
|
114
|
-
${h}
|
|
115
|
-
\`\`\``))}return`<pre class="tool-detail-pre">${je(Ti(i))}</pre>`}function Ip(s){const i=Mp(s),g=Array.isArray(i==null?void 0:i.items)?i.items:[];if(!i||!g.length)return vs(Ie.parse(Vn(s)||""));const h=jc(g),b=Number.isFinite(Number(i.completed))?Number(i.completed):h.completed,E=Number.isFinite(Number(i.total))?Number(i.total):h.total,I=je(i.title||"任务计划"),G=Hc(g);return`<section class="plan-card"><div class="plan-card-head"><strong>${I}</strong><span class="plan-progress-label">${b} / ${E}</span></div><ol class="plan-items">${G}</ol></section>`}function Hc(s,i=0){return s.map((g,h)=>{const b=Wc(g==null?void 0:g.status),E=b==="completed"?"✓":b==="in_progress"?"●":b==="failed"?"!":String(h+1),I=Array.isArray(g==null?void 0:g.subitems)?g.subitems:[],G=I.length?`<ol class="plan-subitems" aria-label="${je((g==null?void 0:g.description)||`步骤 ${h+1}`)}的子步骤">${Hc(I,i+1)}</ol>`:"";return`<li class="plan-item status-${b}" data-plan-depth="${i}"><div class="plan-item-row"><span class="plan-item-marker" role="img" aria-label="${Rp(b)}">${E}</span><span class="plan-item-text">${je((g==null?void 0:g.description)||`步骤 ${h+1}`)}</span></div>${G}</li>`}).join("")}function jc(s){return s.reduce((i,g)=>{if(i.total+=1,Wc(g==null?void 0:g.status)==="completed"&&(i.completed+=1),Array.isArray(g==null?void 0:g.subitems)&&g.subitems.length){const h=jc(g.subitems);i.total+=h.total,i.completed+=h.completed}return i},{total:0,completed:0})}function Mp(s){const i=String((s==null?void 0:s.text)||""),g=ia(i),h=g!=null&&g.output&&typeof g.output=="object"?g.output:g;if(Array.isArray(h==null?void 0:h.items))return h;const b=i.split(/\r?\n/).map(le=>le.trim()).filter(Boolean),E=/^(\d+)\s*\/\s*(\d+)\s+completed/i.exec(b[0]||""),G=b.filter(le=>/^[-*]\s+/.test(le)).map(le=>{let Se=le.replace(/^[-*]\s+/,"").trim(),ze="pending";return/^~~[\s\S]+~~$/.test(Se)?(ze="completed",Se=Se.slice(2,-2).trim()):/^[▶►●]\s*/.test(Se)?(ze="in_progress",Se=Se.replace(/^[▶►●]\s*/,"").trim()):/^[!✗×]\s*/.test(Se)&&(ze="failed",Se=Se.replace(/^[!✗×]\s*/,"").trim()),{description:Se,status:ze}});return{title:"当前执行计划",note:b.slice(E?1:0).filter(le=>!/^[-*]\s+/.test(le)).join(" "),items:G,completed:E?Number(E[1]):G.filter(le=>le.status==="completed").length,total:E?Number(E[2]):G.length}}function Wc(s){const i=String(s||"pending").toLowerCase().replace(/[\s-]+/g,"_");return i==="complete"||i==="done"?"completed":i==="running"||i==="inprogress"?"in_progress":i==="error"?"failed":["completed","in_progress","failed","pending"].includes(i)?i:"pending"}function Rp(s){return{completed:"已完成",in_progress:"进行中",failed:"失败",pending:"待处理"}[s]||"待处理"}function Kc(s){return`<pre class="diff-block">${je(s)}</pre>`}function Cn(s){return $t(s)&&/\b(ok|failed|generated|edited|image\s+(?:generate|edit)\s+failed)\b/i.test(String((s==null?void 0:s.text)||""))}function Np(s){const i=String((s==null?void 0:s.title)||"").toLowerCase();return(s==null?void 0:s.kind)==="tool"&&i==="image_note"}function Op(s){const i=String((s==null?void 0:s.title)||"").toLowerCase();return(s==null?void 0:s.kind)==="tool"&&i==="skill_read"}function Lp(s){return vs(Ie.parse(`技能${Pp((s==null?void 0:s.text)||"")}`))}function Pp(s){var b,E,I;const i=String(s||""),g=((b=/\bname:\s*([^\s]+)/i.exec(i))==null?void 0:b[1])||((E=/(?:^|\s)skill:\s*([^\s]+)/i.exec(i))==null?void 0:E[1])||((I=/(?:^|\s)id:\s*([^\s]+)/i.exec(i))==null?void 0:I[1]),h=String(g||"").trim();return h||""}function $p(s){return vs(Ie.parse(`图片记录${Dp((s==null?void 0:s.text)||"")}`))}function Dp(s){const i=Bp(s);return i?` ${i}`:""}function Bp(s){var G,re,le,Se,ze;const i=String(s||""),g=(G=/(?:^|\s)(?:storagePath|path|file|filename):\s*([^\s]+\.(?:png|jpe?g|webp|gif|bmp|avif|txt))/i.exec(i))==null?void 0:G[1],h=g?na(g.split(/[\\/]/).pop()||""):"";if(h)return h;const b=(re=/(?:^|\s)imageRef:\s*([^\s]+)/i.exec(i))==null?void 0:re[1],E=na(b||"");if(E)return E;const I=((le=/(?:^|\s)tags:\s*(?:[-*]\s*)?([^\n\r,,]+)/i.exec(i))==null?void 0:le[1])||((Se=/(?:^|\s)detectedText:\s*(?:[-*]\s*)?([^\n\r,,]+)/i.exec(i))==null?void 0:Se[1])||((ze=/(?:^|\s)caption:\s*([^.,,。;\n\r]{2,24})/i.exec(i))==null?void 0:ze[1]);return na(I||"")}function na(s){let i=String(s||"").trim();return i=i.replace(/\.base64\.txt$/i,"").replace(/\.(?:png|jpe?g|webp|gif|bmp|avif|txt)$/i,""),i=i.replace(/^[-*]\s*/,"").replace(/[_-]+/g," ").replace(/\s+/g," ").trim(),!i||/^ok$/i.test(i)?"":i.length>18?`${i.slice(0,18)}...`:i}async function Gc(){if(!(m||!u)){m=!0;try{if(!await Vc(u))throw new Error("无法重新绑定目标会话")}catch(s){we(`会话恢复失败:${s.message||s}`)}finally{m=!1}}}async function Vc(s){var h;const i=String(s||"").trim();return!i||(sa(),u=i,d=!1,sessionStorage.setItem(As,i),!await ms({silent:!0})||String(((h=l.session)==null?void 0:h.sessionId)||"")!==i)?!1:(si(),!0)}async function qc(s,i){sa(),c=s,u=i,d=!i,sessionStorage.setItem(zi,s),i?sessionStorage.setItem(As,i):sessionStorage.removeItem(As);const g=await ms({silent:!0});return g&&si(),g}function sa(){Fe&&Fe.close(),Fe=void 0,et&&cancelAnimationFrame(et),et=0,ri(),rn=void 0,v=!1,l.connected=!1,l.connecting=!0}function ws(s){return Array.isArray(s==null?void 0:s.resources)?s.resources.filter(i=>i&&typeof i=="object"&&typeof i.url=="string"&&i.url):[]}function ra(s){return ws(s).filter(i=>i.kind==="embed")}function Zc(s){return ws(s).filter(i=>i.kind!=="embed")}function Up(s){const i=new URL(s.url,window.location.origin);return i.searchParams.set("theme",Z.value),i.origin===window.location.origin?`${i.pathname}${i.search}${i.hash}`:i.href}function Qc(s){const i=Number(s==null?void 0:s.height);return Number.isFinite(i)?Math.max(240,Math.min(1600,Math.round(i))):640}function Yc(s){const i=Zc(s);return i.length?`<div class="resource-result"><div class="resource-grid">${i.map((h,b)=>{const E=je(h.label||h.downloadName||`资源 ${b+1}`),I=je(h.url),G=h.sizeBytes?da(h.sizeBytes):"",re=h.expiresAt?Hp(h.expiresAt):"",le=[G,re].filter(Boolean).join(" · "),Se=h.kind==="download"||h.downloadName,ze=Se?"下载":"打开",Dt=Se?` download="${je(h.downloadName||h.label||"")}"`:' target="_blank" rel="noreferrer noopener"';if(Se){const cn=je(G.replace(/\s+/g,"")),Ii=Number(h.expiresAt)||0;return`<a class="resource-file-link" href="${I}"${Dt} data-resource-download="true" data-resource-expires-at="${Ii}"><span class="resource-file-name">${E}</span>${cn?`<span class="resource-file-size">(${cn})</span>`:""}</a>`}return`<a class="resource-card resource-${je(h.kind||"link")}" href="${I}"${Dt}><span class="resource-icon" aria-hidden="true"></span><span class="resource-main"><strong>${E}</strong><span>${je(le||(Se?"文件已就绪":"资源已就绪"))}</span></span><span class="resource-action"><span>${ze}</span><i aria-hidden="true">${Se?"↓":"↗"}</i></span></a>`}).join("")}</div></div>`:ku(je(Ti(Vn(s))))}function Jc(s){if((s==null?void 0:s.kind)!=="assistant")return[];const i=l.lines||[],g=i.findIndex(I=>String(I==null?void 0:I.id)===String(s==null?void 0:s.id)),h=g>=0?g:i.length,b=[],E=new Set;for(let I=0;I<h;I+=1){const G=i[I];if(!(G!=null&&G.live))for(const re of ws(G))E.has(re.url)||(E.add(re.url),b.push(re))}return b}function Fp(s,i){if(!i.length)return s;const g=new Map(i.map(b=>[Xc(b),b]).filter(([b])=>b)),h=document.createElement("template");h.innerHTML=String(s||"");for(const b of h.content.querySelectorAll("a[href]")){const E=b.getAttribute("href")||"",I=g.get(E);I&&(b.classList.add("inline-resource-link",`inline-resource-${I.kind||"link"}`),b.setAttribute("href",I.url),(I.kind==="download"||I.downloadName)&&(b.setAttribute("download",I.downloadName||I.label||""),b.removeAttribute("target"),b.removeAttribute("rel"),b.setAttribute("title",`下载 ${I.label||I.downloadName||"资源"}`),b.dataset.resourceDownload="true",b.dataset.resourceExpiresAt=String(Number(I.expiresAt)||0),I.sizeBytes&&(b.dataset.resourceSize=`(${da(I.sizeBytes).replace(/\s+/g,"")})`)))}return h.innerHTML}function Xc(s){return String((s==null?void 0:s.reference)||"").trim()}function ia(s){const i=String(s||"");if(!i.includes("{"))return null;const g=zp(i);g.sort((h,b)=>h.start-b.start||b.end-h.end);for(const{start:h,end:b}of g)try{return JSON.parse(i.slice(h,b+1))}catch{}return null}function zp(s){const i=[],g=[];let h=!1,b=!1;for(let E=0;E<s.length;E+=1){const I=s[E];if(h){b?b=!1:I==="\\"?b=!0:I==='"'?h=!1:(I===`
|
|
116
|
-
`||I==="\r")&&(h=!1,b=!1);continue}if(g.length&&I==='"'){h=!0;continue}if(I==="{"){g.push(E);continue}I==="}"&&g.length&&i.push({start:g.pop(),end:E})}return i}function Hp(s){const i=Number(s);if(!Number.isFinite(i))return"";const g=i-Date.now();return g<=0?"已过期":`${Yn(g)} 后过期`}function jp(s){return Jn(s).length||Cn(s)?oa(s):Wp(s)}function Wp(s){const i=Kp(s),g=i.prompt?`<div class="image2-stage-prompt"><p>${je(ip(i.prompt,240))}</p></div>`:"";return`<div class="image2-stage"><div class="image2-diamond-field" aria-hidden="true">${Array.from({length:11},(b,E)=>`<i class="diamond-${E+1}"></i>`).join("")}<b></b></div>${g}</div>`}function Kp(s){const i=ia((s==null?void 0:s.text)||"")||{},g=i.input||i.arguments||i.args||i;return{mode:String(g.mode||"").toLowerCase(),model:String(g.model||""),size:String(g.size||""),prompt:String(g.prompt||"")}}function oa(s){const i=tu(s.text||""),g=String(s.text||""),h=/\bfail(?:ed)?\b|failed/i.test(g)?"生成失败":/^edited\b/i.test(g.trim())?"修改完成":"生成完成",b=[i.count?`${i.count} 张`:"",i.model,`请求尺寸 ${Fa(i.size).requested}`,i.quality,i.outputFormat,i.sourceImages?`源图 ${i.sourceImages} 张`:"",i.duration].filter(Boolean);return`<div class="image2-result"><div class="image2-summary"><strong>${je(h)}</strong>${b.map(E=>`<span>${je(E)}</span>`).join("")}</div></div>`}const ki=vv(),_i=Be([]);let aa=0;const eu=be(()=>{var i;const s=Pt.value;return JSON.stringify([((i=l.session)==null?void 0:i.sessionId)||"",s==null?void 0:s.id,s==null?void 0:s.toolUseId,s==null?void 0:s.messageId,s&&Cn(s)?Jn(s).map(g=>[g.originalDecodeUrl,g.available,xs(g)]):[]])});nt(eu,async s=>{var E;const i=++aa;_i.value=[],ki.clear();const g=((E=l.session)==null?void 0:E.sessionId)||"";ki.setSession(g);const h=Pt.value;if(!h||!Cn(h))return;const b=Jn(h);_i.value=b.map(I=>({state:I.available?"loading":"unavailable"})),await Promise.all(b.map(async(I,G)=>{const re=await ki.load({sessionId:g,originalUrl:I.originalDecodeUrl,available:I.available});i!==aa||s!==eu.value||re.state==="stale"||(_i.value[G]=re)}))},{immediate:!0,flush:"sync"}),Bn(()=>{++aa,ki.clear()});function Gp(s,i){const g=Jn(s);return g.length?g.map((h,b)=>{const E=_i.value[b],I=Fa(i,h.available?E:{state:"unavailable"}),G=(E==null?void 0:E.state)==="loading"&&h.available?"加载中…":I.actual;return`<section class="image2-detail-prompt" data-original-dimensions="${b}"><span>${je(Xn(h,b))}</span><dl class="image2-detail-grid"><div><dt>请求尺寸</dt><dd>${je(I.requested)}</dd></div><div><dt>实际尺寸</dt><dd>${je(G)}</dd></div></dl>${I.mismatch?"<p>实际尺寸与请求尺寸不同(保留原图)</p>":""}</section>`}).join(""):"<p>实际尺寸:未知(未提供原图资源)</p>"}function Vp(s){const i=tu((s==null?void 0:s.text)||""),g=[["模型",i.model],["模式",i.mode],["请求尺寸",Fa(i.size).requested],["质量",i.quality],["格式",i.outputFormat],["背景",i.background],["图片数量",i.count?`${i.count} 张`:""],["源图数量",i.sourceImages?`${i.sourceImages} 张`:""],["耗时",i.duration],["语义名称",i.semanticName],["开始时间",i.startedAt],["完成时间",i.finishedAt]].filter(([,I])=>I),h=g.length?`<dl class="image2-detail-grid">${g.map(([I,G])=>`<div><dt>${je(I)}</dt><dd>${je(G)}</dd></div>`).join("")}</dl>`:"",b=i.prompt?`<section class="image2-detail-prompt"><span>调用提示词</span><p>${je(i.prompt)}</p></section>`:'<section class="image2-detail-prompt empty"><span>调用提示词</span><p>当前历史记录未保存提示词;新执行的 image_create 调用会在这里显示。</p></section>',E=i.revisedPrompt&&i.revisedPrompt!==i.prompt?`<section class="image2-detail-prompt"><span>修订提示词</span><p>${je(i.revisedPrompt)}</p></section>`:"";return`<div class="image2-detail-view">${h}${Gp(s,i.size)}${b}${E}</div>`}function tu(s){const i=String(s||""),g=i.replace(/\s+/g," ").trim(),h=i.split(/\r?\n/).map(re=>re.trim()).filter(Boolean),b=/^(generated|edited)\s+(\d+)\s+images?/i.exec(h[0]||g),I=(h.find(re=>re.includes(" · "))||"").split(" · ").map(re=>re.trim()).filter(Boolean),G=qp(g,["duration","durationMs","elapsed","elapsedMs"]);return{provider:pt(g,"provider",["model","prompt"])||I[0]||"",model:pt(g,"model",["prompt"])||I[1]||"",prompt:pt(g,"prompt",["revisedPrompt","mode","semanticName","size","quality","outputFormat","background","returnedImages","startedAt","finishedAt","duration"]),mode:pt(g,"mode",["semanticName","prompt","size","quality"]),semanticName:pt(g,"semanticName",["prompt","size","quality","outputFormat"]),size:pt(g,"size",["quality","outputFormat","background","returnedImages","duration"])||I.find(re=>/^\d+x\d+$/i.test(re))||"",quality:pt(g,"quality",["outputFormat","background","returnedImages","duration"])||I.find(re=>["low","medium","high"].includes(re.toLowerCase()))||"",outputFormat:pt(g,"outputFormat",["background","returnedImages","images","duration"])||I.find(re=>["png","jpeg","jpg","webp"].includes(re.toLowerCase()))||"",background:pt(g,"background",["returnedImages","images","startedAt","finishedAt","duration"]),sourceImages:pt(g,"source images",["prompt","mode","semanticName","duration"]),count:pt(g,"returnedImages",["images","index","duration"])||(b==null?void 0:b[2])||"",revisedPrompt:pt(g,"revisedPrompt",["mode","semanticName","raw","created","data","b64_json","background","output_format","quality","size","usage","startedAt","finishedAt","duration"]),usage:pt(g,"usage",["duration"]),startedAt:pt(g,"startedAt",["finishedAt","duration"]),finishedAt:pt(g,"finishedAt",["duration"]),duration:G===void 0?"":Yn(G)}}function pt(s,i,g){var I;const h=g.length?`(?=\\s(?:${g.map(or).join("|")}):)`:"$",E=new RegExp(`(?:^|\\s)${or(i)}:\\s*([\\s\\S]*?)${h}`,"i").exec(s);return((I=E==null?void 0:E[1])==null?void 0:I.replace(/\[(?:base64 image|data URL) omitted[^\]]*\]/gi,"").trim().replace(/\s{2,}/g," "))||""}function qp(s,i){for(const g of i){const h=new RegExp(`(?:^|\\s)${or(g)}:\\s*(\\d+(?:\\.\\d+)?)\\s*ms?\\b`,"i").exec(s);if(h)return Number(h[1])}}function Yn(s){const i=Math.max(0,Number(s)||0);if(i<1e3)return`${Math.round(i)}ms`;if(i<6e4)return`${(i/1e3).toFixed(i<1e4?1:0).replace(/\.0$/,"")}s`;const g=Math.floor(i/6e4),h=Math.round(i%6e4/1e3);return`${g}m ${h}s`}function or(s){return String(s).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vs(s,i=[]){const g=new Set(i.map(G=>String(G||"").trim()).filter(Boolean)),h=document.createElement("template");h.innerHTML=String(s);const b=new Set(["A","P","BR","STRONG","B","EM","I","CODE","PRE","BLOCKQUOTE","UL","OL","LI","H1","H2","H3","H4","H5","H6","HR","TABLE","THEAD","TBODY","TR","TH","TD","DEL","S","INPUT"]),E=document.createTreeWalker(h.content,NodeFilter.SHOW_ELEMENT),I=[];for(;E.nextNode();)I.push(E.currentNode);for(const G of I){if(!b.has(G.tagName)){G.replaceWith(document.createTextNode(G.textContent||""));continue}for(const re of Array.from(G.attributes)){const le=re.name.toLowerCase(),Se=re.value;G.tagName==="A"&&le==="href"&&(Mm(Se)||g.has(Se))||G.tagName==="A"&&le==="title"||G.tagName==="CODE"&&le==="class"&&/^language-[\w-]+$/.test(Se)||G.tagName==="PRE"&&le==="data-lang"&&/^[\w-]+$/.test(Se)||G.tagName==="INPUT"&&["type","checked","disabled"].includes(le)||G.removeAttribute(re.name)}G.tagName==="A"&&!g.has(G.getAttribute("href")||"")&&(G.setAttribute("target","_blank"),G.setAttribute("rel","noreferrer noopener"))}return Zp(h.content),h.innerHTML}function Zp(s){for(const i of s.querySelectorAll("pre > code")){const g=Qp(i.className),h=i.textContent||"",b=i.parentElement;b&&g&&b.setAttribute("data-lang",g);try{const E=g&&We.getLanguage(g)?We.highlight(h,{language:g,ignoreIllegals:!0}):h.length<=2e4?We.highlightAuto(h):void 0;if(!E)continue;i.innerHTML=E.value,i.className=["hljs",E.language?`language-${E.language}`:g?`language-${g}`:""].filter(Boolean).join(" "),b&&E.language&&!b.hasAttribute("data-lang")&&b.setAttribute("data-lang",E.language)}catch{i.textContent=h}}}function Qp(s){const i=/(?:^|\s)language-([\w-]+)/.exec(s||"")||/(?:^|\s)lang-([\w-]+)/.exec(s||"");if(!i)return"";const g=i[1].toLowerCase();return{cjs:"javascript",mjs:"javascript",node:"javascript",shell:"bash",zsh:"bash",powershell:"bash",ps1:"bash",python3:"python",yml:"yaml",html:"xml",vue:"xml"}[g]||g}function Yp(s){s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),mc())}function nu(s){var i;if(s.key==="Escape"&&l.confirmDialog.open){s.preventDefault(),ys(!1);return}if(s.key==="Escape"&&l.contextWindowModalOpen){s.preventDefault(),Lo();return}if(s.key==="Escape"&&l.compactionDetailLineId!==void 0){s.preventDefault(),li();return}if(s.key==="Escape"&&l.backgroundTaskDetail){s.preventDefault(),pi();return}if(s.key==="Escape"&&l.projectContextOpen){s.preventDefault(),ea();return}if(s.key==="Escape"&&l.cwdPicker.open){s.preventDefault(),mi();return}if(s.key==="Escape"&&l.runtimeContextDetail){s.preventDefault(),Xo();return}if(s.key==="Escape"&&l.runtimeContextModal){s.preventDefault(),Jo();return}if(s.key==="Escape"&&l.imagePreview){s.preventDefault(),jo();return}if(s.key==="Escape"&&l.toolDetailLineId!==void 0){s.preventDefault(),_s();return}(s.ctrlKey||s.metaKey)&&s.key.toLowerCase()==="k"&&(s.preventDefault(),(i=se.value)==null||i.focus()),(s.ctrlKey||s.metaKey)&&s.key.toLowerCase()==="c"&&!R.value&&bc()}function Jp(){var s;try{const i=localStorage.getItem(zd);if(i==="light"||i==="dark")return i}catch{}return(s=window.matchMedia)!=null&&s.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}function Xp(s){var i,g,h,b;document.documentElement.dataset.theme=s,document.documentElement.style.colorScheme=s,(i=document.querySelector('meta[name="theme-color"]'))==null||i.setAttribute("content",s==="dark"?"#0c0c0f":"#ffffff"),(b=(h=(g=window.__TAURI__)==null?void 0:g.core)==null?void 0:h.invoke)==null||b.call(h,"sync_window_theme",{theme:s}).catch(()=>{});try{localStorage.setItem(zd,s)}catch{}}function su(){Z.value=Z.value==="dark"?"light":"dark"}async function em(s){var h;const i=Array.from(((h=s.clipboardData)==null?void 0:h.files)||[]).filter(b=>b.type.startsWith("image/"));if(!i.length)return;s.preventDefault();const g=[];for(const b of i){const E=++l.attachmentCounter,I=`[img#${E}]`,G=await hu(b);G.compressionRate>0&&g.push(G.compressionRate),l.attachments.push({kind:"image",imageId:iu(),label:I,mimeType:G.mimeType,data:G.data,previewUrl:G.previewUrl,name:b.name||`图片 ${E}`})}we(`已添加 ${i.length} 张图片附件`),g.length&&setTimeout(()=>we(mu(g)),0)}function tm(){var s;(s=oe.value)==null||s.click()}async function nm(s){var g;const i=Array.from(((g=s==null?void 0:s.target)==null?void 0:g.files)||[]);i.length&&(await ru(i),s!=null&&s.target&&(s.target.value=""))}async function ru(s){var i;l.uploadingFiles=!0;try{const g=[],h=[];for(const b of s){if(b.type.startsWith("image/")){const G=await hu(b),re=`[img#${++l.attachmentCounter}]`;G.compressionRate>0&&h.push(G.compressionRate),g.push({kind:"image",imageId:iu(),label:re,name:b.name||re,mimeType:G.mimeType,data:G.data,previewUrl:G.previewUrl});continue}const E=await mm(b),I=await Ve("/api/uploads",{name:b.name,mimeType:b.type||"application/octet-stream",data:E.data});if(!((i=I==null?void 0:I.file)!=null&&i.absolutePath))throw new Error("upload response missing path");g.push({kind:"file",label:`[file#${++l.attachmentCounter}]`,name:I.file.name||b.name||`附件 ${l.attachmentCounter}`,mimeType:I.file.mimeType||b.type||"application/octet-stream",size:Number(I.file.size||b.size||0),absolutePath:I.file.absolutePath,relativePath:I.file.relativePath||""})}l.attachments.push(...g),h.length&&setTimeout(()=>we(mu(h)),0),we(`已上传 ${g.length} 个附件`)}catch(g){we(g.message||String(g))}finally{l.uploadingFiles=!1}}function iu(){return typeof(crypto==null?void 0:crypto.randomUUID)=="function"?`image_${crypto.randomUUID()}`:`image_${Date.now().toString(16).slice(-8).padStart(8,"0")}-${Math.random().toString(16).slice(2,6).padEnd(4,"0")}-4${Math.random().toString(16).slice(2,5).padEnd(3,"0")}-a${Math.random().toString(16).slice(2,5).padEnd(3,"0")}-${Math.random().toString(16).slice(2,14).padEnd(12,"0")}`}function ou(s,i){if(!i.length)return s;const g=i.map(h=>h.label).join(" ");return s.trim()?`${s.trim()}
|
|
117
|
-
|
|
118
|
-
${g}`:g}function sm(s){return String(s).replace(/\s*\[img#\d+\]\s*/g," ").replace(/[ \t]{2,}/g," ").trim()}function rm(s){return String(s).replace(UT,"").replace(FT,"").replace(zT,"").replace(/[ \t]{2,}/g," ").trim()}function im(s){return String(s||"").replace(new RegExp(`${or(HT)}[\\s\\S]*?${or(jT)}`,"g"),"").replace(/[ \t]{2,}/g," ").replace(/\n{3,}/g,`
|
|
119
|
-
|
|
120
|
-
`).trim()}function wi(s){return Array.from(new Set(String(s||"").match(/\[img#\d+\]/g)||[]))}function au(s){var h;const i=String(((h=l.session)==null?void 0:h.sessionId)||u||""),g=s.filter(b=>(b==null?void 0:b.kind)==="image"&&b.imageId&&b.previewUrl).map(b=>({sessionId:i,imageId:b.imageId,label:b.label,mimeType:b.mimeType,previewUrl:b.previewUrl,originalUrl:b.previewUrl,name:b.name,available:!0,pending:!0}));lu(g)}function om(s){const i=[];for(const g of s||[])xi(g,i);lu(i.map(la).filter(Boolean))}function xs(s){var g;const i=String((s==null?void 0:s.sessionId)||((g=l.session)==null?void 0:g.sessionId)||u||"");return s!=null&&s.imageId?`${i}:image:${s.imageId}`:s!=null&&s.messageId&&Number.isInteger(Number(s==null?void 0:s.blockIndex))?`${i}:block:${s.messageId}:${Number(s.blockIndex)}`:""}function lu(s){if(!s.length)return;const i=s.map(h=>{var b;return{...h,sessionId:String(h.sessionId||((b=l.session)==null?void 0:b.sessionId)||u||"")}}),g=new Set(i.map(xs).filter(Boolean));l.messageImagePreviews=[...l.messageImagePreviews.filter(h=>{const b=xs(h);return!b||!g.has(b)}),...i].slice(-200)}function Jn(s){var h;if($t(s))return am(s);const i=(s==null?void 0:s.kind)==="user"?cu(s):[s],g=[];for(const b of i){g.push(...vi(b));for(const E of wi(b==null?void 0:b.text)){const I=String(((h=l.session)==null?void 0:h.sessionId)||u||""),G=l.messageImagePreviews.filter(le=>le.sessionId===I&&le.label===E),re=String((b==null?void 0:b.messageId)||"").startsWith("web-user-")?[...G].reverse().find(le=>le.pending):G.length===1?G[0]:void 0;re&&g.push(re)}}return ua(g)}function am(s){const i=[];xi(s,i);for(const g of um(s))xi(g,i);return ua(i.map(la).filter(Boolean))}function vi(s){const i=[];return xi(s,i),ua(i.map(g=>la(g)).filter(Boolean))}function cu(s){if((s==null?void 0:s.kind)!=="user")return[s];const i=String((s==null?void 0:s.messageId)||"");return i?(l.lines||[]).filter(h=>(h==null?void 0:h.kind)==="user"&&String((h==null?void 0:h.messageId)||"")===i):[s]}function lm(s){return s.some(i=>vi(i).length>0||wi(i==null?void 0:i.text).length>0)}function cm(s){return s.find(i=>Vn(i))||s.find(i=>vi(i).length>0||wi(i==null?void 0:i.text).length>0)||s[0]}function um(s){const i=l.lines||[],g=String((s==null?void 0:s.toolUseId)||"");if(g)return i.filter(E=>Si(E)&&String((E==null?void 0:E.parentToolUseId)||"")===g);const h=i.findIndex(E=>(E==null?void 0:E.id)===(s==null?void 0:s.id));if(h<0)return[];const b=[];for(let E=h+1;E<i.length;E+=1){const I=i[E];if(Si(I)&&!$t(I)){b.push(I);continue}if((I==null?void 0:I.kind)==="tool"||(I==null?void 0:I.kind)==="user"||(I==null?void 0:I.kind)==="assistant"&&String((I==null?void 0:I.text)||"").trim())break}return b}function xi(s,i){if(!s||typeof s!="object")return;const g=b=>{var E;return i.push({...b,messageId:b.messageId||s.messageId,sessionId:b.sessionId||((E=l.session)==null?void 0:E.sessionId)||u||""})},h=[s.images,s.imageAttachments,s.attachments,s.thumbnails];for(const b of h)if(Array.isArray(b))for(const E of b)!E||E.kind&&E.kind!=="image"||E.type&&E.type!=="image"||g(E);if(Array.isArray(s.blocks))for(const b of s.blocks)(b==null?void 0:b.type)==="image"&&g(b);s.image&&g(s.image)}function la(s){var E,I,G,re,le,Se,ze,Dt;if(!s||typeof s!="object")return;const i=s.mimeType||((E=s.thumbnail)==null?void 0:E.mimeType)||((I=s.original)==null?void 0:I.mimeType)||"image/png",g=s.thumbnailSrc||((G=s.thumbnail)==null?void 0:G.src)||s.previewUrl||s.src||s.originalSrc||((re=s.original)==null?void 0:re.src)||ca(s.data,i);if(!g&&s.available!==!1)return;const h=g?ka(g):"",b=s.originalSrc||((le=s.original)==null?void 0:le.src)||s.src||s.previewUrl||g;return{sessionId:String(s.sessionId||((Se=l.session)==null?void 0:Se.sessionId)||u||""),messageId:s.messageId,blockIndex:Number.isInteger(Number(s.blockIndex??s.index))?Number(s.blockIndex??s.index):void 0,imageId:s.imageId,label:s.label,mimeType:i,available:s.available!==!1&&!!h,error:s.error,previewUrl:h,originalUrl:b?ka(b):"",originalDecodeUrl:s.originalSrc||(ze=s.original)!=null&&ze.src||s.originalUrl||ca(s.data,i)?ka(s.originalSrc||((Dt=s.original)==null?void 0:Dt.src)||s.originalUrl||ca(s.data,i)):"",name:s.name||s.filename||s.label,sizeBytes:s.sizeBytes,pending:s.pending===!0}}function ca(s,i){return!s||typeof s!="string"?"":s.startsWith("data:")?s:`data:${i};base64,${s}`}function ua(s){const i=new Set,g=[];for(const[h,b]of s.entries()){const E=xs(b)||(b.previewUrl?`url:${b.previewUrl}`:`position:${b.messageId||"unknown"}:${b.blockIndex??h}`);i.has(E)||(i.add(E),g.push(b))}return g}function Xn(s,i){return(s==null?void 0:s.label)||(s!=null&&s.name&&!/^\[img#\d+\]$/.test(s.name)?s.name:`图片 ${i+1}`)}function uu(s,i){const g=dm(s==null?void 0:s.mimeType),h=((s==null?void 0:s.name)||(s==null?void 0:s.label)||`image-${i+1}`).replace(/[^\p{L}\p{N}._-]+/gu,"-").replace(/^-+|-+$/g,"")||`image-${i+1}`;return/\.[a-z0-9]{2,5}$/i.test(h)?h:`${h}.${g}`}function dm(s){const i=String(s||"").toLowerCase();return i.includes("jpeg")?"jpg":i.includes("webp")?"webp":i.includes("gif")?"gif":"png"}function Si(s){return(s==null?void 0:s.kind)==="tool"&&String((s==null?void 0:s.parentToolName)||"").toLowerCase()==="image_create"}function fm(s){return Si(s)&&Jn(s).length>0}function du(s){l.attachments=l.attachments.filter(i=>i.label!==s)}function fu(){return l.attachments.filter(s=>s.kind==="file")}function gu(){return l.attachments.filter(s=>s.kind==="image")}function gm(s,i){return(s==null?void 0:s.name)||`附件 ${i+1}`}function hm(s){return`${pm(s)} · ${da(s==null?void 0:s.size)}`}function pm(s){const i=String((s==null?void 0:s.mimeType)||"").toLowerCase();return i?i.includes("pdf")?"PDF":i.includes("spreadsheet")||i.includes("excel")||i.includes("csv")?"表格":i.includes("word")||i.includes("document")?"文档":i.startsWith("text/")?"文本":i.startsWith("image/")?"图片":"文件":"文件"}function da(s){const i=Number(s||0);return!Number.isFinite(i)||i<=0?"0 B":i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(i<10*1024?1:0).replace(/\.0$/,"")} KB`:i<1024*1024*1024?`${(i/(1024*1024)).toFixed(i<10*1024*1024?1:0).replace(/\.0$/,"")} MB`:`${(i/(1024*1024*1024)).toFixed(1).replace(/\.0$/,"")} GB`}async function hu(s){const i=await fa(s);return bm(i,s.type||"image/png")}async function mm(s){const i=await fa(s),g=i.indexOf(",");return{mimeType:s.type||"application/octet-stream",data:g>=0?i.slice(g+1):i}}async function fa(s){return new Promise((i,g)=>{const h=new FileReader;h.onload=()=>i(String(h.result||"")),h.onerror=()=>g(h.error||new Error("read failed")),h.readAsDataURL(s)})}async function bm(s,i="image/png"){const g=pu(s,i),h=ym(g.base64),b=await _m(g.dataUrl).catch(()=>{});if(!b){const ze=ga(g.base64);if(!ze)throw new Error("图片格式异常,无法读取为有效图片");return{mimeType:g.mimeType,data:ze,previewUrl:`data:${g.mimeType};base64,${ze}`,compressionRate:0}}const E=Math.min(1,DT/Math.max(b.naturalWidth||b.width,b.naturalHeight||b.height));let I=Math.max(1,Math.round((b.naturalWidth||b.width)*E)),G=Math.max(1,Math.round((b.naturalHeight||b.height)*E)),re=.88,le;for(let ze=0;ze<8&&(le=await wm(b,I,G,"image/jpeg",re),!(le.bytes<=BT||re<=za&&Math.max(I,G)<=1280));ze+=1)re>za?re=Math.max(za,re-.1):(I=Math.max(1,Math.round(I*.82)),G=Math.max(1,Math.round(G*.82)));const Se=ga(le==null?void 0:le.base64);if(!Se)throw new Error("图片格式异常,无法转换为有效图片");return{mimeType:le.mimeType,data:Se,previewUrl:`data:${le.mimeType};base64,${Se}`,compressionRate:km(h,le.bytes)}}function pu(s,i){var I;const g=String(s||"").trim(),h=/^data:([^;,]+);base64,([\s\S]*)$/i.exec(g),b=(I=h==null?void 0:h[1])!=null&&I.startsWith("image/")?h[1]:i,E=h?h[2]:g;return{mimeType:b,base64:E,dataUrl:h?g:`data:${b};base64,${E}`}}function ym(s){const i=ga(s);if(!i)return 0;const g=i.endsWith("==")?2:i.endsWith("=")?1:0;return Math.max(0,Math.floor(i.length*.75)-g)}function km(s,i){return!s||!i||i>=s?0:Math.round((1-i/s)*100)}function mu(s){const i=Math.max(...s);return s.length>1?`图片已压缩,最高压缩率为 ${i}%`:`图片已压缩,压缩率为 ${i}%`}function ga(s){let i=String(s||"").trim().replace(/^data:[^;,]+;base64,/i,"").replace(/\s+/g,"");if(!i)return"";i=i.replace(/-/g,"+").replace(/_/g,"/");const g=i.length%4;if(g&&(i+="=".repeat(4-g)),!/^[A-Za-z0-9+/]*={0,2}$/.test(i))return"";try{return atob(i),i}catch{return""}}function _m(s){return new Promise((i,g)=>{const h=new Image;h.onload=()=>i(h),h.onerror=()=>g(new Error("image decode failed")),h.src=s})}async function wm(s,i,g,h,b){const E=document.createElement("canvas");E.width=i,E.height=g;const I=E.getContext("2d");if(!I)throw new Error("canvas unavailable");I.fillStyle="#fff",I.fillRect(0,0,i,g),I.drawImage(s,0,0,i,g);const G=await new Promise(Se=>E.toBlob(Se,h,b));if(!G)throw new Error("image encode failed");const re=await fa(G),le=pu(re,h);return{mimeType:le.mimeType,base64:le.base64,bytes:G.size}}function bu(){return window.matchMedia("(max-width: 820px)").matches?50:64}function ar(){const s=se.value;s&&(s.style.height=`${bu()}px`,s.scrollTop=0)}function vm(){const s=se.value;if(!s)return;s.style.height="auto";const i=window.innerHeight*(window.matchMedia("(max-width: 820px)").matches?.28:.34);s.style.height=`${Math.max(bu(),Math.min(s.scrollHeight,i))}px`}function ha(s=96){const i=ne.value;return i?i.scrollHeight-i.scrollTop-i.clientHeight<=s:!0}function xm(s){return String((s==null?void 0:s.id)??"")}function Sm(s){const i=jn.value[s];if(!i)return WT;if(zo(i))return ks(i)?Math.min(1200,72+i.lines.reduce((h,b)=>h+pa(b),0)):Math.max(72,52+Ho(i).length*28);if(ai(i))return 74;if(tr(i))return 88;const g=ra(i);return g.length?64+g.reduce((h,b)=>h+Qc(b),0):$t(i)||Em(i)?Math.max(560,pa(i)):pa(i)}function pa(s){const i=Vn(s),g=Math.max(1,i.split(`
|
|
121
|
-
`).length),h=Math.ceil(i.length/72);return Math.max(72,Math.min(1200,52+Math.max(g,h)*24))}function Em(s){return s!=null&&s.image||[s==null?void 0:s.images,s==null?void 0:s.imageAttachments,s==null?void 0:s.thumbnails].some(i=>Array.isArray(i)&&i.length)||Array.isArray(s==null?void 0:s.attachments)&&s.attachments.some(i=>(i==null?void 0:i.kind)==="image"||(i==null?void 0:i.type)==="image"||String((i==null?void 0:i.mimeType)||"").startsWith("image/"))?!0:Array.isArray(s==null?void 0:s.blocks)&&s.blocks.some(i=>(i==null?void 0:i.type)==="image")}function Ei(){const s=ne.value,i=de.value;!s||!i||(me.value=Math.max(0,i.getBoundingClientRect().top-s.getBoundingClientRect().top+s.scrollTop))}function ma(){ce&&(ce.disconnect(),ne.value&&ce.observe(ne.value),de.value&&ce.observe(de.value))}function Tm(s){s instanceof Element&&Qr.value.measureElement(s)}function ba(){Qr.value.measure()}function ya(){At||(At=requestAnimationFrame(()=>{At=0,Am()}))}function Am(){const s=ne.value;s&&(s.scrollTop=s.scrollHeight)}function Cm(){if(ee.size<300)return;const s=new Set(l.lines.map(i=>i.id));for(const i of ee.keys()){const g=Number(String(i).split("",1)[0]);s.has(g)||ee.delete(i)}ee.size>500&&ee.clear()}function we(s){l.toast=s,clearTimeout(Wt),Wt=setTimeout(()=>{l.toast=""},3600)}function Im(s){return["running","preparing","calling_model","thinking","running_tools","compacting","injecting_context"].includes(s)}function ln(s){if(s==null||!Number.isFinite(Number(s)))return"—";const i=Math.max(0,Math.round(Number(s)));return i>=1e6?`${yu(i/1e6)}m`:i>=1e4?`${Math.round(i/1e3)}k`:i>=1e3?`${yu(i/1e3)}k`:String(i)}function yu(s){return s>=10?s.toFixed(0):s.toFixed(1).replace(/\.0$/,"")}function Ti(s){return String(s).replace(/\x1b\[[0-9;]*m/g,"")}function Mm(s){try{const i=new URL(s,window.location.href);return["http:","https:","mailto:"].includes(i.protocol)}catch{return!1}}function je(s){return String(s).replace(/[&<>"']/g,i=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[i])}function ku(s){return s.replace(/(https?:\/\/[^\s<]+)/g,'<a target="_blank" rel="noreferrer noopener" href="$1">$1</a>')}function ka(s){const i=String(s||"");return i.startsWith("/api/images/")?M(i):i}function Ai(){var s;(s=Q.value)==null||s.removeAttribute("open")}function _u(s){const i=Q.value;i!=null&&i.open&&!s.composedPath().includes(i)&&Ai()}function Ci(s){if(ke.value="",Ai(),s==="sessions")return ii();if(s==="prompts")return Oo();if(s==="settings")return Js();l.activePanel="chat"}function wu(){return ke.value="",Ai(),oi()}return(s,i)=>{var g,h,b,E,I,G,re,le,Se,ze,Dt,cn,Ii;return k(),w(ue,null,[f("div",xv,[f("aside",Sv,[f("div",Ev,[f("button",{class:"theme-toggle celestial-theme-toggle",type:"button","aria-label":Xr.value,"aria-pressed":Jr.value,title:Xr.value,onClick:su},[...i[35]||(i[35]=[Ku('<span class="theme-orbit-scene" aria-hidden="true"><i class="theme-cloud theme-cloud-one"></i><i class="theme-cloud theme-cloud-two"></i><i class="theme-star theme-star-one"></i><i class="theme-star theme-star-two"></i><i class="theme-star theme-star-three"></i><span class="theme-orbit-body"><svg class="theme-sun" viewBox="0 0 28 28"><circle cx="14" cy="14" r="5.2"></circle><path d="M14 2.5v3M14 22.5v3M2.5 14h3M22.5 14h3M5.9 5.9 8 8M20 20l2.1 2.1M22.1 5.9 20 8M8 20l-2.1 2.1"></path></svg><svg class="theme-moon" viewBox="0 0 28 28"><path d="M20.8 18.8A9.2 9.2 0 0 1 9.2 7.2a9.2 9.2 0 1 0 11.6 11.6Z"></path><circle cx="10.2" cy="16.8" r="1"></circle><circle cx="15.4" cy="21" r=".75"></circle></svg></span></span>',1)])],8,Tv)]),f("nav",Av,[f("button",{class:ge({active:l.activePanel==="chat"}),onClick:oi},[...i[36]||(i[36]=[f("span",{class:"nav-button-content"},[f("svg",{class:"ui-icon nav-icon",viewBox:"0 0 20 20","aria-hidden":"true"},[f("path",{d:"M10 4v12M4 10h12"})]),f("span",null,"新建会话")],-1)])],2),f("button",{class:ge({active:l.activePanel==="sessions"}),onClick:ii},[...i[37]||(i[37]=[f("span",{class:"nav-button-content"},[f("svg",{class:"ui-icon nav-icon",viewBox:"0 0 20 20","aria-hidden":"true"},[f("path",{d:"M5 4.5h10a1.5 1.5 0 0 1 1.5 1.5v8A1.5 1.5 0 0 1 15 15.5H8l-3.5 2v-3.5A1.5 1.5 0 0 1 3 12.5V6A1.5 1.5 0 0 1 4.5 4.5Z"}),f("path",{d:"M6.75 8h6.5M6.75 11h4.5"})]),f("span",null,"会话管理")],-1)])],2),f("button",{class:ge({active:l.activePanel==="settings"}),onClick:i[0]||(i[0]=S=>Js())},[...i[38]||(i[38]=[f("span",{class:"nav-button-content"},[f("svg",{class:"ui-icon nav-icon",viewBox:"0 0 20 20","aria-hidden":"true"},[f("path",{d:"M10 3.5v2M10 14.5v2M5.4 5.4l1.4 1.4M13.2 13.2l1.4 1.4M3.5 10h2M14.5 10h2M5.4 14.6l1.4-1.4M13.2 6.8l1.4-1.4"}),f("circle",{cx:"10",cy:"10",r:"2.75"})]),f("span",null,"模型配置")],-1)])],2)]),f("button",{class:ge(["sidebar-card","session-entry",{working:zn.value}]),type:"button",onClick:i[1]||(i[1]=S=>l.activePanel="chat"),title:rt.value},[i[39]||(i[39]=f("span",{class:"session-entry-icon","aria-hidden":"true"},[f("i",{class:"session-diamond"})],-1)),f("span",Iv,[f("span",{ref_key:"sessionTitleViewport",ref:ht,class:ge(["session-title-line",{marquee:ps.value}])},[f("strong",{ref_key:"sessionTitleText",ref:js},C(rt.value),513),ps.value?(k(),w("strong",Mv,C(rt.value),1)):V("",!0)],2)])],10,Cv),f("section",Rv,[f("div",Nv,[f("button",{type:"button",class:"mini-button",onClick:i[2]||(i[2]=S=>Oo())},"提示词管理")]),f("div",Ov,[l.promptLibraryLoading?(k(),w("div",Lv,"正在加载…")):l.promptLibrary.length?(k(!0),w(ue,{key:2},Te(l.promptLibrary,S=>{var L;return k(),w("article",{key:S.id,class:ge(["prompt-card",{active:((L=Wn.value)==null?void 0:L.id)===S.id}]),draggable:"true",onDragstart:ot=>Sh(ot,S),onDragend:Mh,onDblclick:ot=>Qs(S)},[f("div",Dv,[f("strong",null,C(S.title),1)]),f("div",Bv,[f("button",{type:"button",class:"mini-button",onClick:ot=>Qs(S)},"应用",8,Uv),f("button",{type:"button",class:"mini-button",onClick:ot=>kh(S)},"编辑",8,Fv)])],42,$v)}),128)):(k(),w("div",Pv,"暂无提示词"))])])]),f("main",zv,[f("header",Hv,[f("div",jv,[f("details",{ref_key:"mobileMenu",ref:Q,class:"mobile-nav-menu"},[i[43]||(i[43]=f("summary",{"aria-label":"打开导航菜单",title:"导航菜单"},[f("svg",{class:"ui-icon",viewBox:"0 0 20 20","aria-hidden":"true"},[f("path",{d:"M4 5.5h12M4 10h12M4 14.5h12"})])],-1)),f("nav",null,[f("button",{type:"button",class:ge({active:l.activePanel==="chat"}),onClick:i[3]||(i[3]=S=>Ci("chat"))},"对话",2),f("button",{type:"button",onClick:wu},"新建会话"),f("button",{type:"button",class:ge({active:l.activePanel==="sessions"}),onClick:i[4]||(i[4]=S=>Ci("sessions"))},"会话",2),f("button",{type:"button",class:ge({active:l.activePanel==="prompts"}),onClick:i[5]||(i[5]=S=>Ci("prompts"))},"提示词",2),f("button",{type:"button",class:ge({active:l.activePanel==="settings"}),onClick:i[6]||(i[6]=S=>Ci("settings"))},"模型配置",2),(k(!0),w(ue,null,Te(Ee.value,S=>(k(),w("button",{key:S.id,type:"button",onClick:L=>F(S.id)},C(S.title),9,Wv))),128)),l.coreVersion?(k(),w("div",{key:0,class:ge(["core-version","mobile-core-version",{celebrating:l.coreEasterEgg}]),role:"button",tabindex:"0",onClick:bs,onKeydown:[fr(Ye(bs,["prevent"]),["enter"]),fr(Ye(bs,["prevent"]),["space"])]},[i[40]||(i[40]=f("span",{class:"core-version-spark spark-a","aria-hidden":"true"},null,-1)),i[41]||(i[41]=f("span",{class:"core-version-spark spark-b","aria-hidden":"true"},null,-1)),i[42]||(i[42]=f("span",{class:"core-version-spark spark-c","aria-hidden":"true"},null,-1)),f("span",null,"内核版本 "+C(l.coreVersion),1)],42,Kv)):V("",!0)])],512),xn.value?(k(),w("strong",{key:0,class:"mobile-session-title",title:xn.value},C(xn.value),9,Gv)):V("",!0),f("button",{class:"ghost mobile-theme-toggle celestial-theme-toggle",type:"button","aria-label":Xr.value,"aria-pressed":Jr.value,title:Xr.value,onClick:su},[...i[44]||(i[44]=[Ku('<span class="theme-orbit-scene" aria-hidden="true"><i class="theme-cloud theme-cloud-one"></i><i class="theme-cloud theme-cloud-two"></i><i class="theme-star theme-star-one"></i><i class="theme-star theme-star-two"></i><i class="theme-star theme-star-three"></i><span class="theme-orbit-body"><svg class="theme-sun" viewBox="0 0 28 28"><circle cx="14" cy="14" r="5.2"></circle><path d="M14 2.5v3M14 22.5v3M2.5 14h3M22.5 14h3M5.9 5.9 8 8M20 20l2.1 2.1M22.1 5.9 20 8M8 20l-2.1 2.1"></path></svg><svg class="theme-moon" viewBox="0 0 28 28"><path d="M20.8 18.8A9.2 9.2 0 0 1 9.2 7.2a9.2 9.2 0 1 0 11.6 11.6Z"></path><circle cx="10.2" cy="16.8" r="1"></circle><circle cx="15.4" cy="21" r=".75"></circle></svg></span></span>',1)])],8,Vv),f("button",{class:"ghost desktop-config-button",onClick:i[7]||(i[7]=S=>Js())},"配置模型"),f("button",{class:"primary new-session-button",onClick:wu},"+ 新建")])]),l.activePanel==="chat"?(k(),w("section",qv,[f("div",Zv,[f("div",{ref_key:"transcript",ref:ne,class:"transcript"},[l.runtimeContext||l.runtimeContextLoading||l.runtimeContextError?(k(),w("section",Qv,[i[48]||(i[48]=f("div",{class:"runtime-context-bar-title"},[f("strong",null,"运行上下文")],-1)),l.runtimeContext?(k(),w("div",Yv,[f("button",{type:"button",onClick:i[8]||(i[8]=S=>Yo("prompt"))},[i[45]||(i[45]=f("span",null,"系统提示词",-1)),f("strong",null,C(rc.value.length),1)]),f("button",{type:"button",onClick:i[9]||(i[9]=S=>Yo("tools"))},[i[46]||(i[46]=f("span",null,"工具",-1)),f("strong",null,C(Mo.value.length),1)]),f("button",{type:"button",onClick:i[10]||(i[10]=S=>Yo("plugins"))},[i[47]||(i[47]=f("span",null,"插件",-1)),f("strong",null,C(Jg.value),1)])])):l.runtimeContextError?(k(),w("button",{key:1,type:"button",class:"runtime-context-retry",onClick:ti},"重试")):(k(),w("span",Jv,"同步中"))])):V("",!0),Gs.value.length?(k(),w("section",Xv,[i[50]||(i[50]=f("div",{class:"runtime-context-bar-title"},[f("strong",null,"项目上下文")],-1)),f("div",e0,[f("button",{type:"button",onClick:pp},[i[49]||(i[49]=f("span",null,"文档",-1)),f("strong",null,C(Gs.value.length),1)])])])):V("",!0),f("div",{ref_key:"messageList",ref:de,class:"virtual-message-list",style:Nt({height:`${Yg.value}px`})},[(k(!0),w(ue,null,Te(Qg.value,S=>(k(),w("div",{key:S.key,ref_for:!0,ref:Tm,class:"virtual-message-row","data-index":S.index,style:Nt({transform:`translateY(${S.start-me.value}px)`})},[(k(!0),w(ue,null,Te([jn.value[S.index]],L=>{var ot,Gt,vu,xu;return k(),w(ue,{key:L.id},[zo(L)?(k(),w("article",{key:0,class:ge(["message","tool-group-message",{live:L.live,expanded:ks(L)}])},[f("div",n0,[f("button",{type:"button",class:"tool-group-trigger","aria-expanded":ks(L),onClick:te=>Xh(L)},[f("span",r0,[(k(!0),w(ue,null,Te(Ac(L),(te,ve)=>(k(),w(ue,{key:te.name},[f("span",i0,C(te.name),1),te.count>1?(k(),w("span",o0,"×"+C(te.count),1)):V("",!0),ve<Ac(L).length-1?(k(),w("span",a0,"、")):V("",!0)],64))),128))]),i[51]||(i[51]=f("span",{class:"tool-group-chevron","aria-hidden":"true"},null,-1))],8,s0),!ks(L)&&Ho(L).length?(k(),at(ok,{key:0,name:"tool-purpose",tag:"div",class:"tool-group-purposes"},{default:_f(()=>[(k(!0),w(ue,null,Te(Ho(L),(te,ve)=>(k(),w("div",{key:te.id,class:ge(["tool-group-purpose",{live:te.live}]),style:Nt({"--purpose-index":ve})},[f("span",null,C(te.text),1)],6))),128))]),_:2},1024)):V("",!0),ks(L)?(k(),w("div",l0,[(k(!0),w(ue,null,Te(L.lines,te=>{var ve,mt,_a,Su;return k(),w("div",{key:te.id,class:ge(["tool-group-result",`kind-${te.kind||"system"}`])},[te.kind==="thinking"?(k(),w("details",{key:0,class:"reasoning-sheet",open:te.live||void 0},[i[52]||(i[52]=f("summary",null,[f("span",{class:"reasoning-title-mark","aria-hidden":"true"},[f("i"),f("i"),f("i")]),f("span",{class:"reasoning-heading"},"思考")],-1)),f("div",u0,[f("div",d0,[f("div",{class:"message-text markdown reasoning-text",innerHTML:yi(te)},null,8,f0)])])],8,c0)):ai(te)?(k(),w("section",{key:1,class:ge(["compaction-context-bar",{current:te.compaction.current}])},[i[55]||(i[55]=f("div",{class:"compaction-context-title"},[f("strong",null,"压缩上下文")],-1)),f("div",g0,[f("span",null,[i[53]||(i[53]=f("span",null,"摘要",-1)),f("strong",null,C(ln(String(te.compaction.summary||"").length)),1)]),te.compaction.imageCount?(k(),w("span",h0,[i[54]||(i[54]=f("span",null,"图片",-1)),f("strong",null,C(te.compaction.imageCount),1)])):V("",!0)])],2)):tr(te)?(k(),w("div",{key:2,class:ge(["tool-result-summary",`status-${En(te).key}`])},[f("div",p0,[(k(),w("svg",{class:ge(["tool-result-diamond",{spinning:te.live}]),viewBox:"0 0 20 20","aria-hidden":"true"},[...i[56]||(i[56]=[f("path",{d:"M10 2.75 17.25 10 10 17.25 2.75 10Z"},null,-1)])],2)),f("strong",m0,C(qn(te)),1),En(te).key==="failed"?(k(),w("span",b0,"×")):V("",!0)]),f("div",y0,[(ve=te.toolDisplay)!=null&&ve.purpose||(mt=te.toolDisplay)!=null&&mt.subject?(k(),w("p",k0,C(((_a=te.toolDisplay)==null?void 0:_a.purpose)||((Su=te.toolDisplay)==null?void 0:Su.subject)),1)):V("",!0),te.toolError?(k(),w("p",_0,C(te.toolError),1)):V("",!0),An(te)&&Tn(te).length?(k(),w("div",w0,[f("button",{type:"button",class:"tool-group-trigger","aria-expanded":di(te),onClick:It=>Dc(te)},[f("span",x0,[(k(!0),w(ue,null,Te(ui(te),(It,lr)=>(k(),w(ue,{key:It.name},[f("span",S0,C(It.label),1),It.count>1?(k(),w("span",E0,"×"+C(It.count),1)):V("",!0),lr<ui(te).length-1?(k(),w("span",T0,"、")):V("",!0)],64))),128))]),i[57]||(i[57]=f("span",{class:"tool-group-chevron","aria-hidden":"true"},null,-1))],8,v0),di(te)?(k(),w("div",A0,[(k(!0),w(ue,null,Te($c(te),(It,lr)=>(k(),w("div",{key:It.key,class:"tool-group-purpose",style:Nt({"--purpose-index":lr})},[f("span",null,C(It.purpose),1)],4))),128))])):V("",!0)])):!ci(te)&&sr(te)?(k(),w("p",C0,[br(C(sr(te)),1),fi(te)?(k(),w("span",I0,C(fi(te)),1)):V("",!0)])):V("",!0),!ci(te)&&!An(te)&&Tn(te).length?(k(),w("div",M0,[f("section",R0,[f("pre",N0,C(Pc(te)),1)])])):V("",!0),!An(te)&&nr(te)&&(!Wo(te)||te.live===!0)?(k(),w("div",O0,[f("section",L0,[f("pre",P0,C(nr(te)),1)])])):V("",!0),!An(te)&&Lc(te)?(k(),w("div",$0,[(k(!0),w(ue,null,Te(Oc(te),(It,lr)=>(k(),w("section",{key:`${It.kind}-${lr}`,class:ge(["tool-result-preview",`kind-${It.kind}`])},[f("pre",D0,C(It.content),1)],2))),128))])):V("",!0)])],2)):(k(),w("div",B0,[er(te)?V("",!0):(k(),w("div",U0,[f("strong",null,C(qn(te)),1),te.toolName&&En(te).key==="failed"?(k(),w("span",F0,"×")):V("",!0)])),f("div",{class:"message-text markdown",innerHTML:yi(te)},null,8,z0)]))],2)}),128))])):V("",!0)])],2)):(k(),w("article",{key:1,class:ge(["message",L.kind||"system",{live:L.live,"prompt-usage":qh(L),"context-compaction":ai(L),"compact-tool":tr(L)}])},[f("div",{class:ge(["message-marker",{spinning:L.live}])},[...i[58]||(i[58]=[f("svg",{class:"message-marker-icon",viewBox:"0 0 20 20","aria-hidden":"true"},[f("path",{d:"M10 2.75 17.25 10 10 17.25 2.75 10Z"})],-1)])],2),ai(L)?(k(),w("div",H0,[f("section",{class:ge(["compaction-context-bar",{current:L.compaction.current}])},[i[61]||(i[61]=f("div",{class:"compaction-context-title"},[f("strong",null,"压缩上下文")],-1)),f("div",j0,[f("span",null,[i[59]||(i[59]=f("span",null,"摘要",-1)),f("strong",null,C(ln(String(L.compaction.summary||"").length)),1)]),L.compaction.imageCount?(k(),w("span",W0,[i[60]||(i[60]=f("span",null,"图片",-1)),f("strong",null,C(L.compaction.imageCount),1)])):V("",!0)])],2)])):L.kind==="thinking"?(k(),w("div",K0,[f("details",{class:"reasoning-sheet",open:L.live||void 0},[f("summary",null,[i[62]||(i[62]=f("span",{class:"reasoning-title-mark","aria-hidden":"true"},[f("i"),f("i"),f("i")],-1)),i[63]||(i[63]=f("span",{class:"reasoning-heading"},"思考",-1)),rr(L)?(k(),w("span",V0,C(rr(L)),1)):V("",!0)]),f("div",q0,[f("div",Z0,[f("div",{class:"message-text markdown reasoning-text",innerHTML:yi(L)},null,8,Q0)])])],8,G0)])):(k(),w("div",Y0,[!er(L)&&(L.kind!=="tool"||ws(L).length)&&!tr(L)?(k(),w("div",J0,[f("strong",null,C(qn(L)),1),L.toolName&&En(L).key==="failed"?(k(),w("span",X0,"×")):V("",!0),!L.toolName&&L.titleStatus?(k(),w("span",ex,C(L.titleStatus),1)):V("",!0),rr(L)?(k(),w("span",tx,C(rr(L)),1)):V("",!0)])):V("",!0),$t(L)?(k(),w("div",nx,[f("div",{class:"message-text markdown image2-stage-wrap",innerHTML:jp(L)},null,8,sx),(k(!0),w(ue,null,Te([Jn(L)],te=>(k(),w(ue,{key:`${L.id}-image2-images`},[te.length?(k(),w("div",rx,[(k(!0),w(ue,null,Te(te,(ve,mt)=>(k(),w("figure",{key:xs(ve)||ve.previewUrl||mt,class:ge(["message-image-attachment",{"image-unavailable":!ve.available}])},[ve.available&&ve.previewUrl?(k(),w("button",{key:0,type:"button",class:"image-preview-trigger","data-preview-src":ve.originalUrl||ve.previewUrl,"aria-label":`预览 ${Xn(ve,mt)}`},[f("img",{src:ve.previewUrl,alt:Xn(ve,mt),loading:"lazy",decoding:"async"},null,8,ox)],8,ix)):(k(),w("div",ax,"图片不可用")),f("figcaption",null,C(Xn(ve,mt)),1),f("div",lx,[ve.available&&ve.previewUrl?(k(),w("a",{key:0,class:"image-download",href:ve.originalUrl||ve.previewUrl,download:uu(ve,mt)},"下载",8,cx)):V("",!0),mt===0&&Cn(L)?(k(),w("button",{key:1,type:"button",class:"image2-detail-button",onClick:_a=>Ic(L)},"详情",8,ux)):V("",!0)])],2))),128))])):Cn(L)?(k(),w("button",{key:1,type:"button",class:"image2-detail-button",onClick:ve=>Ic(L)},"详情",8,dx)):V("",!0)],64))),128))])):tr(L)?(k(),w("div",{key:2,class:ge(["tool-result-summary",`status-${En(L).key}`])},[f("div",fx,[(k(),w("svg",{class:ge(["tool-result-diamond",{spinning:L.live}]),viewBox:"0 0 20 20","aria-hidden":"true"},[...i[64]||(i[64]=[f("path",{d:"M10 2.75 17.25 10 10 17.25 2.75 10Z"},null,-1)])],2)),f("strong",gx,C(qn(L)),1),En(L).key==="failed"?(k(),w("span",hx,"×")):V("",!0)]),f("div",px,[(ot=L.toolDisplay)!=null&&ot.purpose||(Gt=L.toolDisplay)!=null&&Gt.subject?(k(),w("p",mx,C(((vu=L.toolDisplay)==null?void 0:vu.purpose)||((xu=L.toolDisplay)==null?void 0:xu.subject)),1)):V("",!0),L.toolError?(k(),w("p",bx,C(L.toolError),1)):V("",!0),An(L)&&Tn(L).length?(k(),w("div",yx,[f("button",{type:"button",class:"tool-group-trigger","aria-expanded":di(L),onClick:te=>Dc(L)},[f("span",_x,[(k(!0),w(ue,null,Te(ui(L),(te,ve)=>(k(),w(ue,{key:te.name},[f("span",wx,C(te.label),1),te.count>1?(k(),w("span",vx,"×"+C(te.count),1)):V("",!0),ve<ui(L).length-1?(k(),w("span",xx,"、")):V("",!0)],64))),128))]),i[65]||(i[65]=f("span",{class:"tool-group-chevron","aria-hidden":"true"},null,-1))],8,kx),di(L)?(k(),w("div",Sx,[(k(!0),w(ue,null,Te($c(L),(te,ve)=>(k(),w("div",{key:te.key,class:"tool-group-purpose",style:Nt({"--purpose-index":ve})},[f("span",null,C(te.purpose),1)],4))),128))])):V("",!0)])):!ci(L)&&sr(L)?(k(),w("p",Ex,[br(C(sr(L)),1),fi(L)?(k(),w("span",Tx,C(fi(L)),1)):V("",!0)])):V("",!0),!ci(L)&&!An(L)&&Tn(L).length?(k(),w("div",Ax,[f("section",Cx,[f("pre",Ix,C(Pc(L)),1)])])):V("",!0),!An(L)&&nr(L)&&(!Wo(L)||L.live===!0)?(k(),w("div",Mx,[f("section",Rx,[f("pre",Nx,C(nr(L)),1)])])):V("",!0),!An(L)&&Lc(L)?(k(),w("div",Ox,[(k(!0),w(ue,null,Te(Oc(L),(te,ve)=>(k(),w("section",{key:`${te.kind}-${ve}`,class:ge(["tool-result-preview",`kind-${te.kind}`])},[f("pre",Lx,C(te.content),1)],2))),128))])):V("",!0)])],2)):(k(),w(ue,{key:3},[ra(L).length?(k(),w(ue,{key:0},[f("div",Px,[(k(!0),w(ue,null,Te(ra(L),te=>(k(),w("iframe",{key:te.url,class:"plugin-resource-frame",src:Up(te),title:te.label||"插件资源",style:Nt({height:`${Qc(te)}px`}),loading:"lazy",allow:"fullscreen",allowfullscreen:""},null,12,$x))),128))]),Zc(L).length?(k(),w("div",{key:0,class:"message-text markdown",innerHTML:Yc(L)},null,8,Dx)):V("",!0)],64)):L.kind==="assistant"&&L.live?(k(),w("div",Bx,[ct(gv,{text:L.text||"","exposed-resources":Jc(L)},null,8,["text","exposed-resources"])])):fm(L)?V("",!0):(k(),w("div",{key:2,class:"message-text markdown",innerHTML:yi(L)},null,8,Ux)),(k(!0),w(ue,null,Te([Jn(L)],te=>(k(),w(ue,{key:`${L.id}-images`},[te.length?(k(),w("div",Fx,[(k(!0),w(ue,null,Te(te,(ve,mt)=>(k(),w("figure",{key:xs(ve)||ve.previewUrl||mt,class:ge(["message-image-attachment",{"image-unavailable":!ve.available}])},[ve.available&&ve.previewUrl?(k(),w("button",{key:0,type:"button",class:"image-preview-trigger","data-preview-src":ve.originalUrl||ve.previewUrl,"aria-label":`预览 ${Xn(ve,mt)}`},[f("img",{src:ve.previewUrl,alt:Xn(ve,mt),loading:"lazy",decoding:"async"},null,8,Hx)],8,zx)):(k(),w("div",jx,"图片不可用")),f("figcaption",null,C(Xn(ve,mt)),1),ve.available&&ve.previewUrl?(k(),w("a",{key:2,class:"image-download",href:ve.originalUrl||ve.previewUrl,download:uu(ve,mt)},"下载",8,Wx)):V("",!0)],2))),128))])):V("",!0)],64))),128))],64))]))],2))],64)}),128))],12,t0))),128))],4),Ae.value?(k(),w("div",Kx,[f("div",Gx,[f("span",Vx,C(qe.value),1)]),i[66]||(i[66]=f("span",{class:"message-loading-emblem","aria-hidden":"true"},[f("i"),f("i"),f("i")],-1))])):V("",!0)],512),l.queuedInput?(k(),w("div",qx,[f("span",null,"已排队:"+C(l.queuedInput),1),f("div",null,[f("button",{type:"button",onClick:yc},"立即发送"),f("button",{type:"button",onClick:Ph},"取消")])])):V("",!0),f("form",{class:ge(["composer",{"drop-active":l.composerDropActive}]),onSubmit:Ye(mc,["prevent"]),onDragover:Eh,onDragleave:Th,onDrop:Ah},[(g=l.appPrompt)!=null&&g.hasActivePrompt?(k(),w("div",Zx,[i[67]||(i[67]=f("span",{class:"composer-app-prompt-label"},"当前提示词",-1)),f("strong",null,C(eh.value),1),f("button",{type:"button",class:"mini-button danger",onClick:hc},"清空")])):V("",!0),fu().length?(k(),w("div",Qx,[(k(!0),w(ue,null,Te(fu(),(S,L)=>(k(),w("figure",{key:S.label,class:"file-attachment"},[f("figcaption",null,[f("strong",null,C(gm(S,L)),1),f("span",null,C(hm(S)),1)]),f("button",{type:"button","aria-label":"移除附件",onClick:ot=>du(S.label)},"×",8,Yx)]))),128))])):V("",!0),gu().length?(k(),w("div",Jx,[(k(!0),w(ue,null,Te(gu(),(S,L)=>(k(),w("figure",{key:S.label,class:"image-attachment"},[f("img",{src:S.previewUrl,alt:S.name||`图片 ${L+1}`},null,8,Xx),f("figcaption",null,"图片 "+C(L+1),1),f("button",{type:"button","aria-label":"移除图片",onClick:ot=>du(S.label)},"×",8,e1)]))),128))])):V("",!0),f("input",{ref_key:"fileInput",ref:oe,type:"file",multiple:"",hidden:"",onChange:nm},null,544),Mt(f("textarea",{ref_key:"composer",ref:se,"onUpdate:modelValue":i[11]||(i[11]=S=>R.value=S),placeholder:"在这里输入你的问题、需求或下一步安排…",onKeydown:Yp,onPaste:em,onInput:vm},null,544),[[Bt,R.value]]),f("div",t1,[f("button",{type:"button",class:"composer-cwd",title:"切换工作目录","aria-label":"切换工作目录",onClick:bp},[i[68]||(i[68]=f("svg",{class:"composer-cwd-icon",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round","aria-hidden":"true"},[f("path",{d:"M2.5 5h5l2 2h8v9h-15Z"})],-1)),f("span",{title:Yl.value},C(Yl.value),9,n1)])]),f("details",s1,[f("summary",null,[i[69]||(i[69]=f("span",null,"会话选项",-1)),f("small",null,C(ie.value),1),i[70]||(i[70]=f("svg",{class:"mobile-session-chevron",viewBox:"0 0 12 12","aria-hidden":"true"},[f("path",{d:"m3 4.5 3 3 3-3"})],-1))]),f("div",r1,[f("dl",null,[f("div",null,[i[71]||(i[71]=f("dt",null,"模型",-1)),f("dd",null,C(Jl.value),1)]),f("div",null,[i[72]||(i[72]=f("dt",null,"上下文",-1)),f("dd",null,[f("button",{type:"button",class:"mobile-context-button",onClick:_c},C(Xl.value),1)])]),f("div",null,[i[73]||(i[73]=f("dt",null,"Token",-1)),f("dd",null,"↑ "+C(ec.value)+" / ↓ "+C(tc.value),1)])]),f("div",i1,[f("button",{type:"button",class:ge(["fast-mode-button",{active:l.fastMode,syncing:l.fastModeMutating}]),"aria-pressed":l.fastMode,onClick:wc},[...i[74]||(i[74]=[f("span",null,"快速模式",-1)])],10,o1),f("button",{type:"button",class:"compact-button",disabled:he.value,onClick:kc},"压缩会话",8,a1)]),f("details",l1,[f("summary",null,[i[75]||(i[75]=br("运行信息 ",-1)),f("span",null,C(Hn.value?`${Hn.value} 个后台任务`:"无后台任务"),1)]),f("div",c1,[Sn.value.length?(k(),w("button",{key:0,type:"button",class:"mobile-runtime-card",onClick:i[12]||(i[12]=S=>hi(Sn.value[0]))},[f("span",null,C(Hn.value?"后台任务":"最近结束"),1),f("strong",null,C(ir(Sn.value[0])),1)])):(k(),w("div",u1,[...i[76]||(i[76]=[f("span",null,"后台任务",-1),f("strong",null,"暂无",-1)])])),Ct.value?(k(),w("div",d1,[i[77]||(i[77]=f("span",null,"周额度",-1)),f("strong",null,C(Uo(Ct.value.remainingPercent)),1),f("small",null,"续期 "+C(Fo(Ct.value.resetAt)),1)])):V("",!0),f("div",f1,[f("span",null,C(Ge("memory")),1),f("strong",null,C(Gn((h=Kn.value)==null?void 0:h.rss)),1),f("small",null,"堆 "+C(Gn((b=Kn.value)==null?void 0:b.heapUsed))+" · 外部 "+C(Gn((E=Kn.value)==null?void 0:E.external)),1)])])])])]),f("div",g1,[f("div",h1,[f("span",p1,[i[78]||(i[78]=f("em",null,"模型",-1)),f("strong",null,C(Jl.value),1)]),(k(),w("button",{type:"button",class:ge(["metric-chip","numeric","context-window-trigger",qo("context")]),key:`context-${l.composerMetrics.context.bump}`,onClick:_c},[i[79]||(i[79]=f("em",null,"上下文",-1)),f("strong",null,C(Xl.value),1)],2)),(k(),w("span",{class:ge(["metric-chip numeric",qo("inputTokens")]),key:`input-${l.composerMetrics.inputTokens.bump}`},[i[80]||(i[80]=f("em",null,"输入",-1)),f("strong",null,C(ec.value),1)],2)),(k(),w("span",{class:ge(["metric-chip numeric",qo("outputTokens")]),key:`output-${l.composerMetrics.outputTokens.bump}`},[i[81]||(i[81]=f("em",null,"输出",-1)),f("strong",null,C(tc.value),1)],2)),f("button",{type:"button",class:ge(["fast-mode-button",{active:l.fastMode,syncing:l.fastModeMutating}]),"aria-pressed":l.fastMode,title:l.fastMode?"关闭当前会话的快速模式":"为当前会话启动快速模式",onClick:wc},[...i[82]||(i[82]=[f("span",null,"快速模式",-1)])],10,m1),f("span",b1,[f("button",{type:"button",class:"compact-button",disabled:he.value,onClick:kc},"压缩会话",8,y1)])]),f("div",k1,[f("button",{type:"button",class:"ghost",disabled:l.uploadingFiles,onClick:tm},C(l.uploadingFiles?"上传中…":"上传附件"),9,_1),f("button",{type:zn.value?"button":"submit",class:ge(["primary","composer-action",{stop:zn.value}]),disabled:!zn.value&&(l.uploadingFiles||!R.value.trim()&&!l.attachments.length),"aria-label":sc.value,onClick:i[13]||(i[13]=S=>zn.value?Lh():void 0)},C(sc.value),11,w1)])])],34)]),f("aside",{class:ge(["right-panel",{"mobile-card-open":ke.value}]),"data-mobile-card":ke.value,onKeydown:fr(Ye(X,["stop"]),["esc"])},[ke.value?(k(),w("button",{key:0,type:"button",class:"mobile-card-close","aria-label":"关闭卡片",onClick:X},"×")):V("",!0),f("section",x1,[f("div",S1,[f("div",E1,C(Ge("tasks")),1),Hn.value?(k(),w("strong",T1,C(Hn.value),1)):V("",!0)]),Ws.value?(k(),w("button",{key:0,type:"button",class:"background-task-summary",title:gi(Ws.value),onClick:i[14]||(i[14]=S=>hi(Ws.value))},[f("span",{class:ge(["background-task-dot",`status-${Ws.value.status}`])},null,2),f("strong",null,C(ir(Ws.value)),1),Hn.value>1?(k(),w("span",C1,"+"+C(Hn.value-1),1)):V("",!0),i[83]||(i[83]=f("b",{"aria-hidden":"true"},"›",-1))],8,A1)):V("",!0),qr.value.length?(k(),w("details",I1,[f("summary",null,[i[84]||(i[84]=f("span",null,"最近结束",-1)),f("strong",null,C(qr.value.length),1)]),f("div",M1,[(k(!0),w(ue,null,Te(qr.value,S=>(k(),w("button",{key:Qn(S),type:"button",class:"background-task-summary background-task-history-item",title:gi(S),onClick:L=>hi(S)},[f("span",{class:ge(["background-task-dot",`status-${S.status}`])},null,2),f("strong",null,C(ir(S)),1),f("span",{class:ge(["background-task-summary-status",`status-${S.status}`])},C(Zo(S.status)),3)],8,R1))),128))])])):V("",!0)]),Ct.value?(k(),w("section",N1,[f("div",O1,[f("div",null,[f("span",null,C(Ge("quota"))+" · "+C(zh(Ct.value.account)),1),f("strong",null,C(Uo(Ct.value.remainingPercent)),1)]),f("div",L1,[l.cpaQuotas.length>1?(k(),w("button",{key:0,type:"button","aria-label":"上一个凭据",onClick:i[15]||(i[15]=S=>Ec(-1))},"‹")):V("",!0),f("small",null,C(l.cpaQuotas.length>1?`${l.cpaQuotaIndex+1}/${l.cpaQuotas.length}`:"剩余"),1),l.cpaQuotas.length>1?(k(),w("button",{key:1,type:"button","aria-label":"下一个凭据",onClick:i[16]||(i[16]=S=>Ec(1))},"›")):V("",!0)])]),f("div",{class:"quota-progress",role:"progressbar","aria-label":"周额度剩余","aria-valuenow":Bo(Ct.value.remainingPercent),"aria-valuemin":"0","aria-valuemax":"100"},[f("span",{class:"quota-progress-fill",style:Nt({width:`${Bo(Ct.value.remainingPercent)}%`})},null,4)],8,P1),f("div",$1,[f("span",null,"已使用 "+C(Uo(Ct.value.usedPercent)),1),f("span",null,"续期时间 "+C(Fo(Ct.value.resetAt)),1)]),f("div",D1,"更新于 "+C(Fo(Ct.value.updatedAt)),1)])):V("",!0),f("section",B1,[f("div",U1,[f("div",null,[f("span",null,C(Ge("memory")),1),f("strong",null,C(Gn((I=Kn.value)==null?void 0:I.rss)),1)]),i[85]||(i[85]=f("small",null,"RSS",-1))]),ic.value?(k(),w("div",{key:0,class:"memory-chart",onMousemove:Wh,onMouseleave:Tc},[(k(),w("svg",F1,[f("path",{d:ic.value},null,8,z1),(k(!0),w(ue,null,Te(ei.value,(S,L)=>(k(),w("circle",{key:S.entry.at,class:ge(["memory-trend-point",{active:L===Xe.value}]),cx:S.x,cy:S.y,r:L===Xe.value?3.2:1.5,tabindex:"0",onFocus:ot=>Xe.value=L,onBlur:Tc},null,42,H1))),128))])),Vs.value?(k(),w("div",{key:0,class:"memory-tooltip",style:Nt({left:`clamp(58px, ${Vs.value.x/260*100}%, calc(100% - 58px))`,top:`${Vs.value.y/44*100}%`})},[f("strong",null,C(Gn(Vs.value.entry.rss)),1),f("span",null,C(jh(Vs.value.entry.at)),1)],4)):V("",!0)],32)):(k(),w("div",j1,"—")),f("div",W1,[f("div",null,[i[86]||(i[86]=f("span",null,"V8 堆",-1)),f("strong",null,C(Gn((G=Kn.value)==null?void 0:G.heapUsed)),1)]),f("div",null,[i[87]||(i[87]=f("span",null,"外部内存",-1)),f("strong",null,C(Gn((re=Kn.value)==null?void 0:re.external)),1)])]),f("div",K1,[f("span",null,"更新于 "+C(Hh((le=Kn.value)==null?void 0:le.at)),1)])])],42,v1)])):l.activePanel==="sessions"?(k(),w("section",G1,[f("div",V1,[f("div",{class:"page-head sessions-page-head"},[i[88]||(i[88]=f("div",null,[f("h2",null,"会话管理"),f("p",null,"查找、继续或整理历史会话")],-1)),f("button",{class:"primary",onClick:oi},"+ 新建会话")]),f("div",q1,[f("label",Z1,[Mt(f("input",{"onUpdate:modelValue":i[17]||(i[17]=S=>N.value=S),type:"search",placeholder:"搜索标题或 ID",autocomplete:"off"},null,512),[[Bt,N.value]])]),f("span",Q1,C(N.value.trim()?`${Ks.value.length} / ${l.sessions.length}`:`${l.sessions.length} 个会话`),1)]),l.sessionsLoading?(k(),w("div",Y1,"正在加载会话…")):l.sessions.length?Ks.value.length?(k(),w("div",eS,[(k(!0),w(ue,null,Te(qg.value,S=>(k(),w("article",{key:S.sessionId,class:ge(["session-card",{current:$o(S.sessionId),running:Do(S.sessionId)}])},[f("div",tS,[f("div",nS,[f("strong",null,C(Kt(S)),1),$o(S.sessionId)?(k(),w("span",sS,"当前")):Do(S.sessionId)?(k(),w("span",rS,"运行中")):V("",!0)]),f("div",iS,[f("code",{title:S.sessionId},"ID · "+C(S.sessionId),9,oS),f("time",{datetime:S.updatedAt||S.createdAt},"更新于 "+C(Sc(S.updatedAt||S.createdAt)),9,aS)])]),f("div",lS,[f("button",{disabled:l.sessionResumeLoading||l.sessionsLoading,onClick:L=>Bh(S.sessionId)},C(l.pendingResumeSessionId===S.sessionId&&l.sessionResumeLoading?"打开中…":"打开"),9,cS),f("button",{class:"danger",disabled:l.sessionResumeLoading||l.sessionsLoading,onClick:L=>Uh(S.sessionId)},"删除",8,uS)])],2))),128))])):(k(),w("div",X1,"没有匹配的会话")):(k(),w("div",J1,"暂无会话")),!l.sessionsLoading&&Ks.value.length&&Zr.value>1?(k(),w("nav",dS,[f("button",{type:"button",disabled:U.value===1,onClick:i[18]||(i[18]=S=>U.value-=1)},"上一页",8,fS),(k(!0),w(ue,null,Te(Zg.value,S=>(k(),w("button",{key:S,type:"button",class:ge({active:S===U.value}),"aria-current":S===U.value?"page":void 0,onClick:L=>U.value=S},C(S),11,gS))),128)),f("button",{type:"button",disabled:U.value===Zr.value,onClick:i[19]||(i[19]=S=>U.value+=1)},"下一页",8,hS)])):V("",!0)])])):l.activePanel==="prompts"?(k(),w("section",pS,[f("div",mS,[f("div",bS,[i[89]||(i[89]=f("h2",null,"提示词",-1)),f("div",yS,[f("button",{class:"ghost",onClick:i[20]||(i[20]=S=>l.activePanel="chat")},"回到对话"),f("button",{class:"primary",onClick:_h},"+ 新建提示词")])]),f("div",kS,[f("aside",_S,[f("div",wS,[f("strong",null,C(l.promptLibrary.length)+" 个提示词",1)]),f("div",vS,[l.promptLibraryLoading?(k(),w("div",xS,"正在加载…")):l.promptLibrary.length?(k(!0),w(ue,{key:2},Te(l.promptLibrary,S=>{var L,ot;return k(),w("button",{key:S.id,class:ge(["prompt-library-item",{active:((L=Yr.value)==null?void 0:L.id)===S.id,applied:((ot=Wn.value)==null?void 0:ot.id)===S.id,dragging:Re.value===S.id,"drop-before":Je.value===S.id&&Qe.value==="before","drop-after":Je.value===S.id&&Qe.value==="after"}]),type:"button",draggable:"true",onClick:Gt=>wh(S),onDblclick:Gt=>Qs(S),onDragstart:Gt=>Rh(Gt,S),onDragover:Gt=>Nh(Gt,S),onDrop:Gt=>Oh(Gt,S),onDragend:pc},[f("strong",null,C(S.title),1),S.usage?(k(),w("span",TS,"用法:"+C(S.usage),1)):V("",!0)],42,ES)}),128)):(k(),w("div",SS,"暂无提示词"))])]),f("section",AS,[f("div",CS,[f("strong",IS,C(pe.title||"新提示词"),1),f("div",MS,[f("button",{class:"mini-button",type:"button",disabled:!Yr.value,onClick:i[21]||(i[21]=S=>Yr.value&&Qs(Yr.value))},"应用",8,RS),f("button",{class:"mini-button",type:"button",onClick:vh},"保存"),f("button",{class:"mini-button danger",type:"button",disabled:!pe.id,onClick:xh},"删除",8,NS)])]),f("div",OS,[f("label",LS,[i[90]||(i[90]=f("span",null,"名称",-1)),Mt(f("input",{"onUpdate:modelValue":i[22]||(i[22]=S=>pe.title=S),type:"text",placeholder:"例如:代码评审"},null,512),[[Bt,pe.title]])]),f("label",PS,[i[91]||(i[91]=f("span",null,"提示词内容",-1)),Mt(f("textarea",{"onUpdate:modelValue":i[23]||(i[23]=S=>pe.content=S),rows:"14",placeholder:"输入提示词内容"},null,512),[[Bt,pe.content]])]),f("label",$S,[i[92]||(i[92]=f("span",null,"用法(选填)",-1)),Mt(f("textarea",{"onUpdate:modelValue":i[24]||(i[24]=S=>pe.usage=S),rows:"4",placeholder:"输入适用场景"},null,512),[[Bt,pe.usage]])])])])])])])):l.activePanel==="settings"?(k(),w("section",DS,[f("div",BS,[f("div",US,[i[93]||(i[93]=f("h2",null,"模型配置",-1)),f("button",{class:"primary",onClick:xc,disabled:!l.login},"保存",8,FS)]),l.login?(k(),w("form",{key:1,class:"settings-form",onSubmit:Ye(xc,["prevent"])},[f("section",HS,[i[95]||(i[95]=f("header",{class:"settings-card-head"},[f("strong",null,"模型")],-1)),f("div",jS,[f("label",WS,[i[94]||(i[94]=f("span",null,"供应商",-1)),ct(Di,{modelValue:q.value,"onUpdate:modelValue":i[25]||(i[25]=S=>q.value=S),options:dp(l.login.providers),"aria-label":"供应商",onChange:Fh},null,8,["modelValue","options"])]),(k(!0),w(ue,null,Te(l.login.fields,S=>(k(),w("label",{key:S.key,class:"settings-field"},[f("span",null,[br(C(Qo(S.label)),1),S.required?(k(),w("i",KS)):V("",!0)]),S.options?(k(),at(Di,{key:0,modelValue:fe[S.key],"onUpdate:modelValue":L=>fe[S.key]=L,options:fp(S),"aria-label":Qo(S.label)},null,8,["modelValue","onUpdate:modelValue","options","aria-label"])):Mt((k(),w("input",{key:1,"onUpdate:modelValue":L=>fe[S.key]=L,type:S.secret?"password":"text",placeholder:S.placeholder||`请输入${Qo(S.label)}`},null,8,GS)),[[hk,fe[S.key]]])]))),128))])]),f("section",VS,[i[98]||(i[98]=f("header",{class:"settings-card-head"},[f("strong",null,"CPA")],-1)),f("div",qS,[f("label",ZS,[i[96]||(i[96]=f("span",null,"URL",-1)),Mt(f("input",{"onUpdate:modelValue":i[26]||(i[26]=S=>l.cpaConfig.url=S),type:"text",placeholder:"http://127.0.0.1:8317",autocomplete:"off"},null,512),[[Bt,l.cpaConfig.url]])]),f("label",QS,[i[97]||(i[97]=f("span",null,"管理密码",-1)),Mt(f("input",{"onUpdate:modelValue":i[27]||(i[27]=S=>l.cpaConfig.password=S),type:"password",placeholder:"请输入管理密码",autocomplete:"new-password"},null,512),[[Bt,l.cpaConfig.password]])])])]),f("section",YS,[f("header",JS,[i[99]||(i[99]=f("div",null,[f("strong",null,"工具"),f("small",null,"内置与插件工具默认开启,关闭后立即对当前会话生效。")],-1)),f("button",{type:"button",class:"mini-button",disabled:l.busy||l.globalTools.loading,onClick:sh},"保存",8,XS)]),f("div",eE,[(k(!0),w(ue,null,Te(l.globalTools.items,S=>(k(),w("label",{key:S.name,class:"plugin-settings-row"},[f("span",null,[f("strong",null,[f("code",null,C(S.name),1)]),f("small",null,C(S.source==="plugin"?`插件 · ${S.pluginName||S.pluginId}`:S.source==="external"?"外部工具":"内置工具"),1)]),f("span",tE,[Mt(f("input",{"onUpdate:modelValue":L=>S.configuredEnabled=L,type:"checkbox","aria-label":S.name},null,8,nE),[[ol,S.configuredEnabled]]),i[100]||(i[100]=f("span",{"aria-hidden":"true"},null,-1))])]))),128))])]),f("section",sE,[f("header",rE,[i[101]||(i[101]=f("strong",null,"插件",-1)),f("button",{type:"button",class:"mini-button",disabled:l.globalPlugins.locked||l.globalPlugins.loading,onClick:oh},"保存",8,iE)]),f("div",oE,[(k(!0),w(ue,null,Te(l.globalPlugins.items,S=>(k(),w("label",{key:S.id,class:"plugin-settings-row"},[f("span",null,[f("strong",null,C(S.name),1),f("small",null,C(S.tools.length)+" 个工具",1)]),f("span",aE,[Mt(f("input",{"onUpdate:modelValue":L=>S.configuredEnabled=L,type:"checkbox",disabled:l.globalPlugins.locked,"aria-label":S.name},null,8,lE),[[ol,S.configuredEnabled]]),i[102]||(i[102]=f("span",{"aria-hidden":"true"},null,-1))])]))),128))])])],32)):(k(),w("div",zS,"正在加载配置…"))])])):(k(),w("section",cE,[f("div",uE,[i[103]||(i[103]=f("h2",null,"运行时能力",-1)),f("div",dE,[(k(),w(ue,null,Te(["流式模型循环","工具执行","上下文指标","会话恢复","后台代理","登录配置","图片附件","Markdown 输出"],S=>f("div",{key:S,class:"capability-card"},C(S),1)),64))])])]))]),l.toast?(k(),w("div",fE,C(l.toast),1)):V("",!0)]),(k(),at(Vt,{to:"body"},[l.coreVersion?(k(),w("div",{key:0,class:ge(["core-version",{celebrating:l.coreEasterEgg}]),role:"button",tabindex:"0",title:`内核版本 ${l.coreVersion} · 点击试试`,onClick:bs,onKeydown:[fr(Ye(bs,["prevent"]),["enter"]),fr(Ye(bs,["prevent"]),["space"])]},[i[104]||(i[104]=f("span",{class:"core-version-spark spark-a","aria-hidden":"true"},null,-1)),i[105]||(i[105]=f("span",{class:"core-version-spark spark-b","aria-hidden":"true"},null,-1)),i[106]||(i[106]=f("span",{class:"core-version-spark spark-c","aria-hidden":"true"},null,-1)),f("span",null,"内核版本 "+C(l.coreVersion),1)],42,gE)):V("",!0)])),(k(),at(Vt,{to:"body"},[l.cwdPicker.open?(k(),w("div",{key:0,class:"cwd-picker-backdrop",onClick:Ye(mi,["self"])},[f("section",hE,[f("header",{class:"cwd-picker-head"},[i[107]||(i[107]=f("strong",null,"CWD",-1)),f("button",{type:"button","aria-label":"关闭",onClick:mi},"×")]),f("form",{class:"cwd-picker-path",onSubmit:i[29]||(i[29]=Ye(S=>bi(),["prevent"]))},[Mt(f("input",{"onUpdate:modelValue":i[28]||(i[28]=S=>l.cwdPicker.input=S),autocomplete:"off",spellcheck:"false","aria-label":"工作目录路径"},null,512),[[Bt,l.cwdPicker.input]]),f("button",{type:"submit",disabled:l.cwdPicker.loading},"前往",8,pE),f("button",{type:"button",disabled:l.cwdPicker.mutating,onClick:vp},"新建",8,mE)],32),f("div",bE,[l.cwdPicker.parent?(k(),w("button",{key:0,type:"button",onClick:i[30]||(i[30]=S=>bi(l.cwdPicker.parent))},"← 上级")):V("",!0),f("span",null,C(l.cwdPicker.selectedPath||l.cwdPicker.cwd),1)]),f("div",yE,[f("nav",kE,[(k(!0),w(ue,null,Te(l.cwdPicker.locations,S=>(k(),w("button",{key:`${S.id}-${S.path}`,type:"button",class:ge({active:l.cwdPicker.cwd===S.path}),title:S.path,onClick:L=>bi(S.path)},[f("span",wE,C(S.kind==="drive"||S.kind==="volume"?"▣":S.kind==="home"?"◆":"◇"),1),f("strong",null,C(S.label),1)],10,_E))),128))]),f("div",vE,[l.cwdPicker.loading?(k(),w("div",xE,"读取中")):l.cwdPicker.error?(k(),w("div",SE,C(l.cwdPicker.error),1)):(k(),at(yv,{key:2,nodes:l.cwdPicker.treeRoots,children:l.cwdPicker.treeChildren,expanded:l.cwdPicker.treeExpanded,"selected-path":l.cwdPicker.selectedPath,"allow-delete":!1,onToggle:_p,onSelect:wp,onDelete:xp},null,8,["nodes","children","expanded","selected-path"]))])]),f("footer",EE,[f("button",{type:"button",onClick:mi},"取消"),f("button",{type:"button",class:"primary",disabled:l.cwdPicker.mutating||l.cwdPicker.loading,onClick:Sp},"选择",8,TE)])])])):V("",!0)])),(k(),at(Vt,{to:"body"},[l.projectContextOpen?(k(),w("div",{key:0,class:"runtime-context-modal-backdrop",onClick:Ye(ea,["self"])},[f("section",AE,[f("header",CE,[f("div",null,[l.projectContextDocument?(k(),w("span",IE,C(l.projectContextDocument.path),1)):V("",!0),f("strong",null,C(((Se=l.projectContextDocument)==null?void 0:Se.name)||"项目上下文"),1)]),f("button",{type:"button","aria-label":l.projectContextDocument?"返回":"关闭",onClick:ea},"×",8,ME)]),f("div",RE,[l.projectContextDocument?(k(),w("pre",LE,C(l.projectContextDocument.content),1)):(k(),w("div",NE,[(k(!0),w(ue,null,Te(Gs.value,S=>(k(),w("button",{key:S.path,type:"button",class:"runtime-context-index-item",onClick:L=>mp(S)},[f("span",null,[f("strong",null,C(S.name),1),f("small",null,C(ln(S.chars||0))+" 字符",1)]),i[108]||(i[108]=f("b",null,"›",-1))],8,OE))),128))]))])])])):V("",!0)])),(k(),at(Vt,{to:"body"},[l.confirmDialog.open?(k(),w("div",{key:0,class:"confirm-dialog-backdrop",onClick:i[33]||(i[33]=Ye(S=>ys(!1),["self"]))},[f("section",{class:"confirm-dialog",role:"alertdialog","aria-modal":"true","aria-label":l.confirmDialog.title},[f("div",{class:ge(["confirm-dialog-icon",`tone-${l.confirmDialog.tone}`]),"aria-hidden":"true"},"!",2),f("div",$E,[f("h3",null,C(l.confirmDialog.title),1),f("p",null,C(l.confirmDialog.message),1)]),f("div",DE,[f("button",{type:"button",class:"ghost",onClick:i[31]||(i[31]=S=>ys(!1))},C(l.confirmDialog.cancelLabel),1),f("button",{type:"button",class:ge(["primary",{danger:l.confirmDialog.tone==="danger"}]),onClick:i[32]||(i[32]=S=>ys(!0))},C(l.confirmDialog.confirmLabel),3)])],8,PE)])):V("",!0)])),(k(),at(Vt,{to:"body"},[l.contextWindowModalOpen?(k(),w("div",{key:0,class:"context-window-backdrop",onClick:Ye(Lo,["self"])},[f("section",BE,[f("form",{onSubmit:Ye(Dh,["prevent"])},[i[110]||(i[110]=f("label",{for:"context-window-input"},"调整本次会话上下文窗口大小:",-1)),f("div",UE,[Mt(f("input",{id:"context-window-input","onUpdate:modelValue":i[34]||(i[34]=S=>l.contextWindowDraft=S),type:"text",inputmode:"numeric",autocomplete:"off",autofocus:"","aria-describedby":"context-window-unit",onInput:$h},null,544),[[Bt,l.contextWindowDraft]]),i[109]||(i[109]=f("span",{id:"context-window-unit"},"k",-1))]),l.contextWindowError?(k(),w("p",FE,C(l.contextWindowError),1)):V("",!0),f("div",zE,[f("button",{type:"button",class:"ghost",disabled:l.contextWindowSaving,onClick:Lo},"取消",8,HE),f("button",{type:"submit",class:"primary",disabled:l.contextWindowSaving},C(l.contextWindowSaving?"保存中…":"确认"),9,jE)])],32)])])):V("",!0)])),(k(),at(Vt,{to:"body"},[l.imagePreview?(k(),w("div",{key:0,class:"image-preview-backdrop",onClick:Ye(jo,["self"])},[f("section",{class:"image-preview-modal",role:"dialog","aria-modal":"true","aria-label":l.imagePreview.caption||"图片预览"},[f("button",{type:"button",class:"image-preview-close","aria-label":"关闭图片预览",onClick:jo},"×"),f("div",KE,[f("img",{src:l.imagePreview.src,alt:l.imagePreview.caption||"图片预览"},null,8,GE)]),l.imagePreview.caption?(k(),w("footer",VE,C(l.imagePreview.caption),1)):V("",!0)],8,WE)])):V("",!0)])),(k(),at(Vt,{to:"body"},[on.value?(k(),w("div",{key:0,class:"runtime-context-detail-backdrop",onClick:Ye(li,["self"])},[f("section",qE,[f("header",{class:"runtime-context-modal-head"},[i[111]||(i[111]=f("div",null,[f("strong",null,"压缩上下文详情")],-1)),f("button",{type:"button","aria-label":"关闭",onClick:li},"×")]),f("div",ZE,[f("dl",QE,[f("div",null,[i[112]||(i[112]=f("dt",null,"压缩方式",-1)),f("dd",null,C(Zh(on.value)),1)]),f("div",null,[i[113]||(i[113]=f("dt",null,"发生时间",-1)),f("dd",null,C(Sc(on.value.compaction.createdAt)),1)]),f("div",null,[i[114]||(i[114]=f("dt",null,"新窗口消息",-1)),f("dd",null,C(on.value.compaction.newWindowMessages),1)]),f("div",null,[i[115]||(i[115]=f("dt",null,"保留用户消息",-1)),f("dd",null,C(on.value.compaction.preservedUserMessages),1)]),f("div",null,[i[116]||(i[116]=f("dt",null,"释放字符",-1)),f("dd",null,C(ln(on.value.compaction.charsFreed)),1)]),f("div",null,[i[117]||(i[117]=f("dt",null,"图片引用",-1)),f("dd",null,C(on.value.compaction.imageCount||0),1)])]),i[118]||(i[118]=f("h3",null,"实际续接上下文",-1)),f("pre",null,C(on.value.compaction.continuationState||on.value.compaction.summary||"未提供续接上下文"),1)])])])):V("",!0)])),(k(),at(Vt,{to:"body"},[l.runtimeContextModal?(k(),w("div",{key:0,class:"runtime-context-modal-backdrop",onClick:Ye(Jo,["self"])},[f("section",YE,[f("header",JE,[f("div",null,[f("strong",null,C(l.runtimeContextModal==="prompt"?"系统提示词":l.runtimeContextModal==="tools"?"可用工具":"会话插件"),1)]),f("button",{type:"button","aria-label":"关闭",onClick:Jo},"×")]),f("div",XE,[l.runtimeContextModal==="prompt"?(k(),w("div",eT,[f("button",{type:"button",class:"runtime-context-index-item featured",onClick:Tp},[f("span",null,[i[119]||(i[119]=f("strong",null,"完整系统提示词",-1)),f("small",null,C(ln(((Dt=(ze=l.runtimeContext)==null?void 0:ze.prompt)==null?void 0:Dt.chars)||0))+" 字符",1)]),i[120]||(i[120]=f("b",null,"›",-1))]),(k(!0),w(ue,null,Te(rc.value,(S,L)=>(k(),w("button",{key:`${S.name}-${L}`,type:"button",class:"runtime-context-index-item",onClick:ot=>Ep(S)},[f("span",null,[f("strong",null,C(S.name),1),f("small",null,C(zc(S))+" · "+C(ln(S.chars||0))+" 字符",1)]),i[121]||(i[121]=f("b",null,"›",-1))],8,tT))),128))])):l.runtimeContextModal==="tools"?(k(),w("div",nT,[l.sessionTools.loading?(k(),w("div",sT,"同步中")):(k(),w(ue,{key:1},[f("div",rT,[f("span",null,"可用 "+C(Xg.value)+" / "+C(l.sessionTools.items.length),1)]),(k(!0),w(ue,null,Te(l.sessionTools.items,S=>(k(),w("div",{key:S.name,class:"runtime-plugin-row"},[f("button",{type:"button",class:"runtime-tool-detail-button",disabled:!Mo.value.some(L=>L.name===S.name),onClick:L=>Ap(Mo.value.find(ot=>ot.name===S.name))},[f("code",null,C(S.name),1),f("small",null,C(S.available===!1?`插件未启用 · ${S.pluginName||S.pluginId}`:S.source==="plugin"?`插件 · ${S.pluginName||S.pluginId}`:S.source==="external"?"外部工具":"内置工具"),1)],8,iT),ct(Di,{class:"runtime-plugin-control","model-value":S.mode,options:t,disabled:l.busy||l.sessionTools.busy||S.available===!1,"aria-label":`${S.name}状态`,"data-mode":S.mode,"onUpdate:modelValue":L=>rh(S,L)},null,8,["model-value","disabled","aria-label","data-mode","onUpdate:modelValue"])]))),128))],64))])):(k(),w("div",oT,[l.sessionPlugins.loading?(k(),w("div",aT,"同步中")):(k(!0),w(ue,{key:1},Te(l.sessionPlugins.items,S=>(k(),w("div",{key:S.id,class:"runtime-plugin-row"},[f("span",null,[f("strong",null,C(S.name),1),f("small",null,C(S.tools.length)+" 个工具",1)]),ct(Di,{class:"runtime-plugin-control","model-value":S.mode,options:t,disabled:l.busy||l.sessionPlugins.busy||!S.globallyEnabled,"aria-label":`${S.name}状态`,"data-mode":S.mode,"onUpdate:modelValue":L=>ah(S,L)},null,8,["model-value","disabled","aria-label","data-mode","onUpdate:modelValue"])]))),128))]))])])])):V("",!0)])),(k(),at(Vt,{to:"body"},[l.runtimeContextDetail?(k(),w("div",{key:0,class:"runtime-context-detail-backdrop",onClick:Ye(Xo,["self"])},[f("section",{class:"runtime-context-detail-modal",role:"dialog","aria-modal":"true","aria-label":l.runtimeContextDetail.title},[f("header",cT,[f("div",null,[l.runtimeContextDetail.meta?(k(),w("span",uT,C(l.runtimeContextDetail.meta),1)):V("",!0),f("strong",null,C(l.runtimeContextDetail.title),1)]),f("button",{type:"button","aria-label":"返回",onClick:Xo},"×")]),f("div",dT,[l.runtimeContextDetail.kind==="tool"?(k(),w(ue,{key:0},[l.runtimeContextDetail.description?(k(),w("p",fT,C(l.runtimeContextDetail.description),1)):V("",!0),f("pre",null,C(l.runtimeContextDetail.schema),1)],64)):(k(),w("pre",gT,C(l.runtimeContextDetail.content),1))])],8,lT)])):V("",!0)])),(k(),at(Vt,{to:"body"},[l.backgroundTaskDetail?(k(),w("div",{key:0,class:"tool-result-modal-backdrop",onClick:Ye(pi,["self"])},[f("section",hT,[f("header",pT,[f("div",mT,[i[122]||(i[122]=f("strong",null,"后台任务",-1)),f("span",bT,C(Sn.value.length),1)]),f("button",{type:"button",class:"tool-result-modal-close","aria-label":"关闭",onClick:pi},"×")]),f("div",{class:ge(["tool-result-modal-content","background-task-page",{single:Sn.value.length<=1}])},[Sn.value.length>1?(k(),w("nav",yT,[(k(!0),w(ue,null,Te(Sn.value,S=>(k(),w("button",{key:Qn(S),type:"button",class:ge(["background-task-index-item",{active:Qn(S)===Qn(l.backgroundTaskDetail)}]),title:gi(S),onClick:L=>hi(S)},[f("span",{class:ge(["background-task-dot",`status-${S.status}`])},null,2),f("span",_T,[f("strong",null,C(ir(S)),1),f("small",null,C(Zo(S.status)),1)])],10,kT))),128))])):V("",!0),f("article",wT,[f("header",vT,[f("div",xT,[f("span",{class:ge(["background-task-dot",`status-${l.backgroundTaskDetail.status}`])},null,2),f("strong",null,C(ir(l.backgroundTaskDetail)),1)]),f("span",{class:ge(["tool-result-modal-status",`status-${l.backgroundTaskDetail.status}`])},C(Zo(l.backgroundTaskDetail.status)),3)]),f("dl",ST,[Uc(l.backgroundTaskDetail)?(k(),w("div",ET,[i[123]||(i[123]=f("dt",null,"耗时",-1)),f("dd",null,C(Uc(l.backgroundTaskDetail)),1)])):V("",!0),l.backgroundTaskDetail.cwd?(k(),w("div",TT,[i[124]||(i[124]=f("dt",null,"目录",-1)),f("dd",null,C(l.backgroundTaskDetail.cwd),1)])):V("",!0)]),f("div",AT,[l.backgroundTaskDetail.kind!=="agent"&&Fc(l.backgroundTaskDetail)?(k(),w("section",CT,[i[125]||(i[125]=f("header",null,"命令",-1)),f("pre",IT,C(Fc(l.backgroundTaskDetail)),1)])):V("",!0),l.backgroundTaskDetail.kind==="terminal"?(k(),at(h_,{key:1,"owner-session-id":l.backgroundTaskDetail.ownerSessionId||((cn=l.session)==null?void 0:cn.sessionId),"run-id":l.backgroundTaskDetail.sessionId},null,8,["owner-session-id","run-id"])):V("",!0),l.backgroundTaskDetail.kind==="agent"?(k(),w("div",MT,[ct(S_,{"owner-session-id":(Ii=l.session)==null?void 0:Ii.sessionId,task:l.backgroundTaskDetail,"render-markdown":ep},null,8,["owner-session-id","task"])])):V("",!0)])])],2)])])):V("",!0),Pt.value?(k(),w("div",{key:1,class:"tool-result-modal-backdrop",onClick:Ye(_s,["self"])},[f("section",{class:"tool-result-modal",onKeydown:tp,role:"dialog","aria-modal":"true","aria-label":`${qn(Pt.value)}详情`},[f("header",NT,[f("div",null,[f("div",OT,[f("strong",null,C(qn(Pt.value)),1),f("span",{class:ge(["tool-result-modal-status",`status-${En(Pt.value).key}`])},C(En(Pt.value).label),3)]),Nc(Pt.value)?(k(),w("p",LT,C(Nc(Pt.value)),1)):V("",!0)]),f("button",{type:"button",class:"tool-result-modal-close","aria-label":"关闭工具结果",onClick:_s},"×")]),f("div",PT,[Cn(Pt.value)?(k(),w("div",{key:0,class:"message-text markdown tool-detail-markdown",innerHTML:Cp(Pt.value)},null,8,$T)):V("",!0)]),f("footer",{class:"tool-result-modal-footer"},[f("button",{type:"button",class:"primary",onClick:_s},"关闭")])],40,RT)])):V("",!0)]))],64)}}};wk(KT).mount("#app");
|